/*
    *
    * Wijmo Library 5.20181.436
    * http://wijmo.com/
    *
    * Copyright(c) GrapeCity, Inc.  All rights reserved.
    *
    * Licensed under the GrapeCity Commercial License.
    * sales@wijmo.com
    * wijmo.com/products/wijmo-5/license/
    *
    */
var __extends=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}();define(["require","exports","wijmo/wijmo","wijmo/wijmo.input","wijmo/wijmo.grid","wijmo/wijmo.viewer"],function(e,t,n,o,r,i){"use strict";function a(){return J}function s(e,t,o,r){var i,a=e?1:-1;return o instanceof n.Point?(i=o.x,r=o.y):(i=o,r=r||0),new n.Point(t.x+a*i,t.y+a*r)}function u(e){var t=g(G+e+X);n.addClass(t,"wj-svg-btn");var o=document.createElement("a");return o.appendChild(t),n.addClass(o,"wj-btn"),o.tabIndex=0,o}function c(e,t){if(e.landscape!==t){e.landscape=t;var n=e.width;e.width=e.height,e.height=n;var o=e.leftMargin;t?(e.leftMargin=e.bottomMargin,e.bottomMargin=e.rightMargin,e.rightMargin=e.topMargin,e.topMargin=o):(e.leftMargin=e.topMargin,e.topMargin=e.rightMargin,e.rightMargin=e.bottomMargin,e.bottomMargin=o)}}function l(e){if(!e)return null;var t={};return t.height=e.height?new re(e.height):null,t.width=e.width?new re(e.width):null,t.bottomMargin=e.bottomMargin?new re(e.bottomMargin):null,t.leftMargin=e.leftMargin?new re(e.leftMargin):null,t.rightMargin=e.rightMargin?new re(e.rightMargin):null,t.topMargin=e.topMargin?new re(e.topMargin):null,t.landscape=e.landscape,t.paperSize=e.paperSize,t}function h(e){var t=[];for(var n in e)n&&n.length&&"_"!=n[0]&&!isNaN(parseInt(n))&&t.push({text:e[n],value:n});return t}function p(e,t){if(e&&e.children)for(var o=e.children,r=o.length-1;r>-1;r--){var i=o[r];if(null==t||t(i)){var a=i.querySelector(".wj-control");a&&(a=n.Control.getControl(a))&&a.dispose(),e.removeChild(i)}}}function d(e){var t,n=document.createElement("div"),o=document.createDocumentFragment();for(n.innerHTML=e;t=n.firstChild;)o.appendChild(t);return o}function g(e){return d(e).firstChild}function _(e,t,n,o){for(var r,i=t.split(","),a=0;a<i.length;a++)r=i[a].trim(),e.addEventListener?e.addEventListener(r,n,o):e.attachEvent?e.attachEvent("on"+r,n):e["on"+r]=n}function m(e,t,n){for(var o,r=t.split(","),i=0;i<r.length;i++)o=r[i].trim(),e.removeEventListener?e.removeEventListener(o,n):e.detachEvent?e.detachEvent("on"+o,n):e["on"+o]=null}function f(e,t){t?n.addClass(e,Q):n.removeClass(e,Q)}function v(e,t){t?n.addClass(e,$):n.removeClass(e,$)}function y(e,o){o?n.removeClass(e,t._hiddenCss):n.addClass(e,t._hiddenCss)}function w(e){return n.hasClass(e,$)}function b(e){return n.hasClass(e,Q)}function P(e,t,n,o){if(e){var r=t[ee];r||(r=t[ee]={});var i=r[e];i||(i=r[e]=[]),i.push(n)}t.addHandler(n,o)}function S(e,t){if(e){var n=t[ee];if(n){var o=n[e];o&&o.forEach(function(e){return t.removeHandler(e)})}}}function C(e){var t;return kt.IsError(e)?t=e.json.Error.Description:(t=e,e.Message&&(t=e.Message,e.ExceptionMessage&&(t+="<br/>"+e.ExceptionMessage))),t||n.culture.Viewer.errorOccured}function x(e){for(var o,r,i,a,s=!0,u=0;u<e.children.length;u++)r=e.children[u],o=n.hasClass(r,"wj-separator"),i=n.hasClass(r,t._hiddenCss),o||i?o&&(s?i||n.addClass(r,t._hiddenCss):(i&&n.removeClass(r,t._hiddenCss),a=r),s=!0):s=!1;s&&a&&n.addClass(a,"hidden")}function T(e){return re.convertValue(e,oe.Twip,oe.Dip)}function E(e){return re.convertValue(e,oe.Dip,oe.Twip)}function M(e,t){return t?e.scrollWidth>e.clientWidth:e.scrollHeight>e.clientHeight}function I(e,t,o,r,i){r=null==r?1:r;var a=e.querySelector("g");if(a){var s="scale("+r+")";if(null!=i)switch(i){case Ze.Rotation90:s+=" rotate(90)",s+=" translate(0 "+-o+")";break;case Ze.Rotation180:s+=" rotate(180)",s+=" translate("+-t+" "+-o+")";break;case Ze.Rotation270:s+=" rotate(270)",s+=" translate("+-t+" 0)"}a.setAttribute("transform",s),n.isIE&&((e=a.parentNode).removeChild(a),e.appendChild(a))}return e}function V(e,t,o,r){var i,a,s={x:T(e.x),y:T(e.y),width:T(e.width),height:T(e.height)};switch(o){case Ze.NoRotate:i=s.y,a=s.x;break;case Ze.Rotation90:i=s.x,a=t.height.valueInPixel-s.y-s.height;break;case Ze.Rotation180:i=t.height.valueInPixel-s.y-s.height,a=t.width.valueInPixel-s.x-s.width;break;case Ze.Rotation270:i=t.width.valueInPixel-s.x-s.width,a=s.y}return new n.Point(a*r,i*r)}function A(e,t){return t===Ze.NoRotate||t===Ze.Rotation180?e:{width:e.height,height:e.width}}function j(e){return e?{pageIndex:e.pageIndex,pageBounds:{x:e.x,y:e.y,width:0,height:0}}:{pageIndex:0,pageBounds:{x:0,y:0,width:0,height:0}}}function D(e,t,n){return void 0===n&&(n=!1),n?e.slice(-t.length).toLowerCase()===t.toLowerCase():e.slice(-t.length)===t}function k(e,t){return e&&t&&n.isFunction(e.valueOf)&&n.isFunction(t.valueOf)?e.valueOf()===t.valueOf():e===t}function R(e,t){if(n.isString(t)){if(D(e,"DateTime"))return new Date(t);if("width"===e||"height"===e||D(e,"Margin"))return new re(t)}return t}function O(e,t){return n.isString(t)&&("width"===e||"height"===e||D(e,"Margin"))?new re(t):t}function H(e,t){t=t||{};var n=[];for(var o in t)n.push(o+"="+t[o]);return n.length&&(e+=(e.indexOf("?")<0?"?":"&")+n.join("&")),e}function N(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=[],o=0,r=e.length;o<r;o++){var i=e[o];i&&("string"!=typeof i?n=n.concat(F(i)):n.push(B(i).join("/")))}return n.join("/")}function F(e){if(null==e)return null;for(var t=[],n=0,o=e.length;n<o;n++)t=t.concat(B(e[n]));return t}function B(e){var t=e.split("/");return t.length>0&&!t[t.length-1].length&&t.splice(t.length-1),t}function z(e,t){if(t&&t.cache||(e=W(e)),t&&"GET"!==(t.method||"GET").toUpperCase()){if(t.data&&!1!==t.urlEncode){var o=L(t.data);null!=o&&(t.data=o)}!1!==t.urlEncode&&(t.requestHeaders?t.requestHeaders["Content-Type"]||(t.requestHeaders["Content-Type"]="application/x-www-form-urlencoded"):t.requestHeaders={"Content-Type":"application/x-www-form-urlencoded"})}return n.httpRequest(e,t)}function L(e){var t=[];e=e||{};for(var o in e)if(null!==e[o]&&void 0!==e[o])if(n.isArray(e[o]))if(e[o].length>0)for(var r=0;r<e[o].length;r++)t.push(o+"="+encodeURIComponent(e[o][r]));else t.push(o+"=");else t.push(o+"="+encodeURIComponent(e[o]));return t.join("&")}function W(e){return e+(-1==e.indexOf("?")?"?":"&")+"_="+(new Date).getTime()}function U(e){return JSON.parse(e,R)}function q(e){return JSON.parse(e,R)}function K(){return"ontouchstart"in window?ve:ye}Object.defineProperty(t,"__esModule",{value:!0});var Z=i||t;window.wijmo=window.wijmo||{},window.wijmo.viewer=Z;var J=null!=navigator.userAgent.match(/iPhone|iPad|iPod/i);t.isIOS=a;var G='<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 24 24" xml:space="preserve">',X="</svg>";t.icons={paginated:'<rect x="16" y= "1" width="1" height="1" /><rect x="17" y= "2" width="1" height="1" /><rect x="18" y= "3" width="1" height="1" /><path d= "M20,5V4h-1v1h-0.6H18h-3V2V1.3V1h1V0h-1h0H5H4H3v24h2v0h13h1.1H20L20,5L20,5z M5,22.1V2h8v5h1h1h3v15.1H5z" /><rect x="6" y= "8" width="10" height="1" /><rect x="6" y= "5" width="5" height="1" /><rect x="6" y= "11" width="10" height="1" /><rect x="6" y= "14" width="10" height="1" /><rect x="6" y= "17" width="10" height="1" /><rect x="6" y= "20" width="10" height="1" />',print:'<rect x="5" y= "1" width="14" height="4" /><polygon points= "22,8 22,7 19,7 19,6 5,6 5,7 2,7 2,8 1,8 1,11 1,20 2,20 2,21 5,21 5,11 19,11 19,21 22,21 22,20 23,20 23, 11 23, 8 "/><path d="M6,12v11h12V12H6z M16,21H8v-1h8V21z M16,18H8v-1h8V18z M16,15H8v-1h8V15z" />',exports:'<path d="M19.6,23"/><polyline points="5,19 5,2 13,2 13,7 14.3,7 15,7 18,7 18,9 20,9 20,7 20,6.4 20,5 20,4 19,4 19,5 15,5 15,2 15,1 16,1 16,0 15,0 5,0 3,0 3,2 3,19 3,21 5,21 "/><rect x="18" y="3" width="1" height="1"/><rect x="17" y="2" width="1" height="1"/><rect x="16" y="1" width="1" height="1"/><polygon points="17,16.6 20,14.1 17,11.6 17,13.6 13,13.6 13,14.6 17,14.6 "/><rect x="3" y="20.9" width="2" height="3.1"/><rect x="4.5" y="22" width="15.6" height="2"/><rect x="18" y="8.4" width="2" height="1.6"/><rect x="18" y="18" width="2.1" height="6"/>',portrait:'<path d="M19,0L19,0L5,0v0H3v24h0.1H5h14h1.7H21V0H19z M12.5,23h-1v-1h1V23z M19,21H5V2h14V21z"/>',landscape:'<path d="M24,19L24,19l0-14h0V3H0v0.1V5v14v1.7V21h24V19z M1,12.5v-1h1v1H1z M3,19V5h19v14H3z"/>',pageSetup:'<rect x="18" y="1" width="1" height="1"/><rect x="19" y="2" width="1" height="1"/><rect x="20" y="3" width="1" height="1"/><polygon points="22,5 22,4 21,4 21,5 20.4,5 20,5 17,5 17,2 17,1.3 17,1 18,1 18,0 17,0 17,0 7,0 6,0 5,0 5,5 7,5 7,2 15,2 15,7 16,7 17,7 20,7 20,22.1 7,22.1 7,19 5,19 5,24 5.9,24 7,24 20,24 21.1,24 22,24 22,5 "/><rect x="5" y="7" width="2" height="2"/><rect x="5" y="11" width="2" height="2"/><rect x="5" y="15" width="2" height="2"/><rect x="9" y="11" width="2" height="2"/><rect x="1" y="11" width="2" height="2"/><polygon points="9,8 9,8 8,8 8,9 9,9 9,10 10,10 10,8 "/><polygon points="2,9 2,9 2,10 3,10 3,9 4,9 4,8 2,8 "/><polygon points="3,16 3,16 4,16 4,15 3,15 3,14 2,14 2,16 "/><polygon points="10,15 10,15 10,14 9,14 9,15 8,15 8,16 10,16 "/>',previousPage:'<circle opacity=".25" cx="12" cy="12" r="12"/><polygon points="5.6,10.7 12,4.4 18.4,10.7 18.4,15 13.5,10.1 13.5,19.6 10.4,19.6 10.4,10.1 5.6,15 " />',nextPage:'<circle opacity=".25" cx="12" cy="12" r="12"/><polygon points="18.4,13.3 12,19.6 5.6,13.3 5.6,9 10.5,13.9 10.5,4.4 13.6,4.4 13.6,13.9 18.4,9 " />',firstPage:'<circle opacity=".25" cx="12" cy="12" r="12"/><polygon points="6.5,13.1 12,7.8 17.5,13.1 17.5,17.5 13.5,13.5 13.5,19.6 10.4,19.6 10.4,13.5 6.5,17.5 " /><rect x="6.5" y= "4.4" width="10.9" height="2.2" />',lastPage:'<circle opacity=".25" cx="12" cy="12" r="12"/><polygon points="17.5,10.9 12,16.2 6.5,10.9 6.5,6.5 10.5,10.5 10.5,4.4 13.6,4.4 13.6,10.5 17.5,6.5 " /><rect x="6.5" y= "17.5" transform="matrix(-1 -8.987357e-011 8.987357e-011 -1 24 37.0909)" width="10.9" height="2.2" />',backwardHistory:'<circle opacity=".25" cx="12" cy="12" r="12"/><polygon points="10.7,18.4 4.4,12 10.7,5.6 15,5.6 10.1,10.5 19.6,10.5 19.6,13.6 10.1,13.6 15,18.4 " />',forwardHistory:'<circle opacity=".25" cx="12" cy="12" r="12"/><polygon points="13.3,5.6 19.6,12 13.3,18.4 9,18.4 13.9,13.5 4.4,13.5 4.4,10.4 13.9,10.4 9,5.6 " />',selectTool:'<polygon points="19.9,13.4 5.6,1.1 5.3,19.9 10.5,14.7 14.3,23.3 16.4,22.4 12.6,13.8 "/>',moveTool:'<polygon points="12.5,3 14.5,3 12,0 9.5,3 11.5,3 11.5,21 11.5,21 9.6,21 12,24 14.5,21 12.5,21 "/><polygon points="21,12.5 21,14.5 24,12 21,9.5 21,11.5 3,11.5 3,11.5 3,9.6 0,12 3,14.5 3,12.5 "/>',continuousView:'<polygon points="22,0 22,5 9,5 9,0 7,0 7,5 7,7 7,7 24,7 24,7 24,5 24,0 "/><polygon points="23,15 19,15 19,11 20,11 20,10 19,10 18,10 17,10 9,10 7.4,10 7,10 7,24 9,24 9,12 17,12 17,15 17,16.6 17,17 22,17 22,24 24,24 24,17 24,15.1 24,15 24,15 24,14 23,14 "/><rect x="22" y="13" width="1" height="1"/><polygon points="20.9,12 20.9,13 22,13 22,12 21,12 21,11 20,11 20,12 "/><polygon points="4.9,5.2 2.5,2.2 0,5.2 2,5.2 2,9.2 3,9.2 3,5.2 "/><polygon points="2.9,19.2 2.9,15.2 1.9,15.2 1.9,19.2 0,19.2 2.5,22.1 4.9,19.2 "/>',singleView:'<rect x="16" y="1" width="1" height="1"/><rect x="17" y="2" width="1" height="1"/><rect x="18" y="3" width="1" height="1"/><path d="M20,5V4h-1v1h-0.6H18h-3V2V1.3V1h1V0h-1h0H5H4H3v24h2v0h13h1.1H20L20,5L20,5z M5,22.1V2h8v5h1h1h3v15.1H5z"/>',fitWholePage:'<rect x="16" y="1" width="1" height="1"/><rect x="17" y="2" width="1" height="1"/><rect x="18" y="3" width="1" height="1"/><path d="M20,5V4h-1v1h-0.6H18h-3V2V1.3V1h1V0h-1h0H5H4H3v24h2v0h13h1.1H20L20,5L20,5z M18,22.1H5V2h8v5h1h1h3V22.1z"/><polygon points="17,13.5 15,11 15,13 13,13 13,14 15,14 15,16 "/><polygon points="6,13.5 8,16 8,14 10,14 10,13 8,13 8,11 "/><polygon points="11.5,7 9,9 11,9 11,11 12,11 12,9 14,9 "/><polygon points="11.5,20 14,18 12,18 12,16 11,16 11,18 9,18 "/>',fitPageWidth:'<rect x="16" y="1" width="1" height="1"/><rect x="17" y="2" width="1" height="1"/><rect x="18" y="3" width="1" height="1"/><path d="M20,5V4h-1v1h-0.6H18h-3V2V1.3V1h1V0h-1h0H5H4H3v24h2v0h13h1.1H20L20,5L20,5z M5,22.1V2h8v5h1h1h3v15.1H5z"/><polygon points="14,15.5 17,13 14,10.6 14,12.6 13,12.6 13,13.6 14,13.6 "/><polyline points="6,13.1 9,15.6 9,13.6 10,13.6 10,12.6 9,12.6 9,10.6 6,13.1 "/>',zoomOut:'<circle opacity=".25" cx="12" cy="12" r="12"/><rect opacity=".75" x="5" y="10" width="14" height="3"/>',zoomIn:'<circle opacity=".25" cx="12" cy="12" r="12"/><polygon opacity=".75" points="19,10 13.5,10 13.5,4.5 10.5,4.5 10.5,10 5,10 5,13 10.5,13 10.5,18.5 13.5,18.5 13.5,13 19,13 " />',fullScreen:'<path d="M22,0H0v2.8V4v20h1.5H2h20h0.7H24V4V0H22z M7,1h1v1H7V1z M5,1h1v1H5V1z M3,1h1v1H3V1z M22,22H2L2,4h20L22,22z" /><polygon points="19.6,9.9 20,6 16.1,6.4 17.6,7.8 14.7,10.6 15.4,11.3 18.3,8.5"/><polygon points="4.4,16.2 4,20 7.9,19.7 6.5,18.3 9.3,15.5 8.6,14.8 5.8,17.6"/>',exitFullScreen:'<path d="M22,0H0v2.8V4v20h1.5H2h20h0.7H24V4V0H22z M7,1h1v1H7V1z M5,1h1v1H5V1z M3,1h1v1H3V1z M22,22H2L2,4h20L22,22z" /><polygon points="9.2,18.6 9.6,14.7 5.7,15.1 7.2,16.5 4.3,19.3 5,20 7.9,17.2"/><polygon points="14.8,7.5 14.4,11.3 18.3,11 16.9,9.6 19.7,6.8 19,6.1 16.2,8.9"/>',thumbnails:'<path d="M20,2h-5h-2v2v5v2v0h2v0h5v0h2v0V9V4V2H20z M20,9h-5V4h5V9z"/><path d="M20,13h-5h-2v2v5v2v0h2v0h5v0h2v0v-2v-5v-2H20z M20,20h-5v-5h5V20z"/><path d="M9,13H4H2v2v5v2v0h2v0h5v0h2v0v-2v-5v-2H9z M9,20H4v-5h5V20z"/><rect x="2" y="2" width="9" height="9"/>',outlines:'<path d="M22,0H2H0v2v20v2h2h20h2v-2V2V0H22z M2,2h12v20H2V2z M22,22h-6V2h6V22z"/><rect x="17.5" y="5" width="3" height="1" /><rect x="17.5" y="8" width="3" height="1"/><rect x="17.5" y="11" width="3" height="1"/>',search:'<circle stroke-width="2" fill="none" cx="9.5" cy="9.5" r="8.5"/><rect x="16.9" y="13.7" transform="matrix(-0.7193 0.6947 -0.6947 -0.7193 44.3315 18.4942)" width="3" height="9"/>',searchNext:'<polygon points="12,12.6 4,4.5 4,11.4 12,19.5 20,11.4 20,4.5 "/>',searchPrevious:'<polygon points="12,11.4 20,19.5 20,12.6 12,4.5 4,12.6 4,19.5 "/>',hamburgerMenu:'<rect x="2" y="4.875" width="20" height="1.5"/><rect x="2" y="11.25" width="20" height="1.5"/><rect x="2" y="17.625" width="20" height="1.5"/>',viewMenu:'<path transform="scale(1.5)" d="M8,2.9c-4.4,0-8,2.2-8,5s3.6,5,8,5s8-2.2,8-5S12.4,2.9,8,2.9z M8,11.8c-2.2,0-4-1.8-4-4c0-2.2,1.8-4,4-4s4, 1.8,4,4C12, 10,10.2,11.8,8,11.8z"/><circle class="st0" cx="12" cy="11.85" r="3.45"/>',searchOptions:'<polygon points="12,12.6 4,4.5 4,11.4 12,19.5 20,11.4 20,4.5 "/>',searchLeft:'<polygon points="11.4,12 19.5,20 12.6,20 4.5,12 12.6,4 19.5,4 "/>',searchRight:'<polygon points="12.6,12 4.5,4 11.4,4 19.5,12 11.4,20 4.5,20 "/>',showZoomBar:'<path d="M22.8,20.7l-4.4-4.4c1.1-1.6,1.8-3.5,1.8-5.6c0-5.2-4.3-9.5-9.5-9.5s-9.5,4.3-9.5,9.5s4.3,9.5,9.5,9.5 c2.1,0,4-0.7,5.6-1.8l4.4,4.4L22.8,20.7z M4.2,10.7c0-3.6,2.9-6.5,6.5-6.5s6.5,2.9,6.5,6.5s-2.9,6.5-6.5,6.5S4.2,14.3,4.2,10.7z"/><polygon points="7.2,9.2 7.2,7.2 9.2,7.2 9.2,6.2 6.2,6.2 6.2,9.2 "/><polygon points="12.2,7.2 14.2,7.2 14.2,9.2 15.2,9.2 15.2,6.2 12.2,6.2 "/><polygon points="9.2,14.2 7.2,14.2 7.2,12.2 6.2,12.2 6.2,15.2 9.2,15.2 "/><polygon points="14.2,12.2 14.2,14.2 12.2,14.2 12.2,15.2 15.2,15.2 15.2,12.2 "/>',rubberbandTool:'\n        <g>\n\t        <polygon points="11.5,2 4,2 2,2 2,4 2,11.5 4,11.5 4,4 11.5,4 \t"/>\n\t        <path d="M16,10V8h-2h-4H8v2v4v2h2h4h2v-2V10z M14,14h-4v-4h4V14z"/>\n\t        <polygon points="20,12 20,19 19,19 19,20 12,20 12,22 20,22 22,22 22,20 22,12 \t"/>\n\t        <rect x="16" y="16" class="st0" width="1" height="1"/>\n\t        <rect x="17" y="17" class="st0" width="1" height="1"/>\n\t        <rect x="18" y="18" class="st0" width="1" height="1"/>\n        </g>',magnifierTool:'\n        <circle fill="none" stroke-width="2" stroke-miterlimit="10" cx="9.5" cy="9.5" r="7.5"/>\n        <rect x="17" y="13.7" transform="matrix(0.7193 -0.6947 0.6947 0.7193 -7.4537 17.9238)" class="st1" width="3" height="9"/>\n        <polygon points="14,8.5 10.5,8.5 10.5,5 8.5,5 8.5,8.5 5,8.5 5,10.5 8.5,10.5 8.5,14 10.5,14 10.5,10.5 14,10.5 "/>\n        ',rotateDocument:'\n        <g>\n\t        <path d="M18,0H5H3v4v18v2h2h13h2v-2V4V0H18z M18,22H5V4h13V22z"/>\n\t        <polygon points="9,12 13,12 13,14 15,11.5 13,9 13,11 9,11 8,11 8,12 8,17 9,17 \t"/>\n        </g>',rotatePage:'\n        <g>\n\t        <rect x="16" y="1" width="1" height="1"/>\n\t        <rect x="17" y="2" width="1" height="1"/>\n\t        <rect x="18" y="3" width="1" height="1"/>\n\t        <path class="st0" d="M19,4v1h-0.6H18h-3V2V1.3V1h1V0h-1H5H4H3v24h2h13h1.1H20V5V4H19z M18,22.1H5V2h8v5h1h1h3V22.1z"/>\n\t        <polygon points="13,11 9,11 8,11 8,12 8,17 9,17 9,12 13,12 13,14 15,11.5 13,9 \t"/>\n        </g>'},t._hiddenCss="hidden",t._commandTagAttr="command-tag",t._pointMove=s;var Y=function(){function e(){this._actions=[],this._isStarted=!1}return e.prototype._any=function(){return this._actions.length>0},e.prototype.queue=function(e){var t=this,n=this._any();this._actions.push(function(){e(),t._continue()}),this.isStarted&&!n&&this._continue()},e.prototype._continue=function(){var e=this._actions.shift();e&&e()},e.prototype.start=function(){this._isStarted||(this._isStarted=!0,this._continue())},Object.defineProperty(e.prototype,"isStarted",{get:function(){return this._isStarted},enumerable:!0,configurable:!0}),e}();t._ActionQueue=Y,t._createSvgBtn=u,t._setLandscape=c,t._clonePageSettings=l,t._enumToArray=h,t._removeChildren=p,t._toDOMs=d,t._toDOM=g,t._addEvent=_,t._removeEvent=m;var Q="wj-state-active",$="wj-state-disabled";t._checkImageButton=f,t._disableImageButton=v,t._showImageButton=y,t._isDisabledImageButton=w,t._isCheckedImageButton=b;var ee="__wjEvents";t._addWjHandler=P,t._removeAllWjHandlers=S,t._getErrorMessage=C,t._checkSeparatorShown=x,t._twipToPixel=T,t._pixelToTwip=E,t._hasScrollbar=M,t._transformSvg=I,t._getTransformedPosition=V,t._getRotatedSize=A,t._getPositionByHitTestInfo=j,t._strEndsWith=D,t._isEqual=k;var te=function(){function e(e){this._hasOutlines=!1,this._pageCount=0,this._supportedExportDescriptions=[],this._isLoadCompleted=!1,this._isDisposed=!1,this._errors=[],this.pageCountChanged=new n.Event,this.disposed=new n.Event,this.pageSettingsChanged=new n.Event,this.loading=new n.Event,this.loadCompleted=new n.Event,this.queryLoadingData=new n.Event,this._service=this._createDocumentService(e),this._paginated=e.paginated}return e.prototype.onQueryLoadingData=function(e){this.queryLoadingData.raise(this,e)},e.prototype._updateIsLoadCompleted=function(e){this._isLoadCompleted!==e&&(this._isLoadCompleted=e,e&&this.onLoadCompleted())},e.prototype._updateIsDisposed=function(e){this._isDisposed!==e&&(this._isDisposed=e,this.onDisposed())},e.prototype._getIsDisposed=function(){return this._isDisposed},e.prototype._checkHasOutlines=function(e){return e.hasOutlines},e.prototype._checkIsLoadCompleted=function(e){return e.status===pe.completed||e.status===pe.stopped||e.status===pe.loaded},Object.defineProperty(e.prototype,"encodeRequestParams",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"executionDateTime",{get:function(){return this._executionDateTime},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"expiredDateTime",{get:function(){return this._expiredDateTime},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"errors",{get:function(){return this._errors},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isLoadCompleted",{get:function(){return this._isLoadCompleted},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisposed",{get:function(){return this._getIsDisposed()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"features",{get:function(){return this._features},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pageSettings",{get:function(){return this._pageSettings},enumerable:!0,configurable:!0}),e.prototype.onPageSettingsChanged=function(e){this.pageSettingsChanged.raise(this,e||new n.EventArgs)},e.prototype.onLoadCompleted=function(e){this.loadCompleted.raise(this,e||new n.EventArgs)},e.prototype.onLoading=function(e){this.loading.raise(this,e||new n.EventArgs)},e.prototype.onDisposed=function(e){this.disposed.raise(this,e||new n.EventArgs)},e.prototype.setPageSettings=function(e){var t=this;return this._innerService.setPageSettings(e).then(function(e){return t._updatePageSettings(e)})},e.prototype._updatePageSettings=function(e){this._pageSettings=e,this.onPageSettingsChanged()},Object.defineProperty(e.prototype,"_innerService",{get:function(){return this._service},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"paginated",{get:function(){return this.pageSettings?this.pageSettings.paginated:this._paginated},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasThumbnails",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasOutlines",{get:function(){return this._hasOutlines},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pageCount",{get:function(){return this._pageCount},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"initialPosition",{get:function(){return this._initialPosition},set:function(e){this._initialPosition=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"service",{get:function(){return this._service},enumerable:!0,configurable:!0}),e.prototype.getSupportedExportDescriptions=function(){return this._innerService.getSupportedExportDescriptions()},e.prototype.getBookmark=function(e){return this._innerService.getBookmark(e)},e.prototype.executeCustomAction=function(e){return this._innerService.executeCustomAction(e)},e.prototype.getOutlines=function(){return this._innerService.getOutlines()},e.prototype.getFeatures=function(){var e=this;return this._innerService.getFeatures().then(function(t){e._features=t})},e.prototype.dispose=function(){var e=this;return this._innerService.dispose().then(function(){return e._updateIsDisposed(!0)})},e.prototype.load=function(){var e=this;this.onLoading();var t={};null!=this._paginated&&(t["pageSettings.paginated"]=this.paginated);var n=new ue(t);return this.onQueryLoadingData(n),this._innerService.load(n.data).then(function(t){e._updateExecutionInfo(t)})},e.prototype._updateExecutionInfo=function(e){null!=e&&(this._executionDateTime=this._getExecutionDateTime(e),this._expiredDateTime=this._getExpiredDateTime(e),this._updatePageSettings(e.pageSettings),this._features=e.features,this._updateDocumentStatus(e.status))},e.prototype._updateDocumentStatus=function(e){e&&(this._errors=e.errorList,this._initialPosition=e.initialPosition,this._updatePageCount(this._getPageCount(e)),this._expiredDateTime=this._getExpiredDateTime(e),this._hasOutlines=this._checkHasOutlines(e),this._updateIsLoadCompleted(this._checkIsLoadCompleted(e)))},e.prototype._getExecutionDateTime=function(e){return e.loadedDateTime},e.prototype._getExpiredDateTime=function(e){return e.expiredDateTime},e.prototype._getPageCount=function(e){return e.pageCount},e.prototype._updatePageCount=function(e){this._pageCount!==e&&(this._pageCount=e,this.onPageCountChanged())},e.prototype.getStatus=function(){var e=this;return this._innerService.getStatus().then(function(t){e._updateDocumentStatus(t)})},e.prototype._createDocumentService=function(t){throw e._abstractMethodException},e.prototype.onPageCountChanged=function(e){this.pageCountChanged.raise(this,e||new n.EventArgs)},e.prototype.print=function(e){var t=this;if(n.isMobile())this.getExportedUrl({format:"pdf"}).then(function(e){window.open(e)});else{var o=new n.PrintDocument({title:"Document"});this.renderToFilter({format:"html"}).then(function(n){o.append(n.responseText),o._getDocument().close(),window.setTimeout(function(){t._removeScript(o),t._rotate(o,e),o.print()},100)})}},e.prototype._removeScript=function(e){for(var t=e._getDocument().querySelectorAll("script"),n=0;n<t.length;n++){var o=t.item(n);o.parentElement.removeChild(o)}},e.prototype._rotate=function(e,t){if(t&&t.length)for(var n=e._getDocument().querySelectorAll("svg"),o=0;o<n.length;o++){var r=t[o];if(r){for(var i=n[o],a=document.createElementNS("http://www.w3.org/2000/svg","g");i.hasChildNodes();)a.appendChild(i.firstChild);i.appendChild(a);var s={width:new re(i.width.baseVal.value),height:new re(i.height.baseVal.value)},u=A(s,r),c=i.parentNode;c.style.width=u.width.valueInPixel+"px",c.style.height=u.height.valueInPixel+"px",i.setAttribute("width",u.width.valueInPixel.toString()+"px"),i.setAttribute("height",u.height.valueInPixel.toString()+"px"),I(n[o],s.width.valueInPixel,s.height.valueInPixel,1,r)}}},e.prototype.renderToFilter=function(e){return this._innerService.renderToFilter(e)},e.prototype.getRenderToFilterUrl=function(e){return this._innerService.getRenderToFilterUrl(e)},e.prototype.getExportedUrl=function(e){return this._innerService.getExportedUrl(e)},e.prototype.search=function(e){return this._innerService.search(e)},e._abstractMethodException="It is an abstract method, please implement it.",e}();t._DocumentSource=te,t._statusJsonReviver=R;var ne=function(){function e(e){this._url="",this._url=e.serviceUrl||"",this._documentPath=e.filePath}return Object.defineProperty(e.prototype,"serviceUrl",{get:function(){return this._url},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"filePath",{get:function(){return this._documentPath},enumerable:!0,configurable:!0}),e.prototype.getStatus=function(){throw te._abstractMethodException},e.prototype.setPageSettings=function(e){throw te._abstractMethodException},e.prototype.getBookmark=function(e){throw te._abstractMethodException},e.prototype.executeCustomAction=function(e){throw te._abstractMethodException},e.prototype.load=function(e){throw te._abstractMethodException},e.prototype.dispose=function(){throw te._abstractMethodException},e.prototype.getOutlines=function(){throw te._abstractMethodException},e.prototype.renderToFilter=function(e){throw te._abstractMethodException},e.prototype.search=function(e){throw te._abstractMethodException},e.prototype.getRenderToFilterUrl=function(e){throw te._abstractMethodException},e.prototype.getExportedUrl=function(e){throw te._abstractMethodException},e.prototype.getSupportedExportDescriptions=function(){throw te._abstractMethodException},e.prototype.getFeatures=function(){throw te._abstractMethodException},e.prototype.getPingTimeout=function(){return 100},e}();t._DocumentService=ne,t._pageSettingsJsonReviver=O,t._appendQueryString=H,t._joinUrl=N,t._joinStringUrl=F,t._prepareStringUrl=B,t._httpRequest=z,t._objToParams=L,t._disableCache=W;var oe;!function(e){e[e.Document=0]="Document",e[e.Inch=1]="Inch",e[e.Mm=2]="Mm",e[e.Pica=3]="Pica",e[e.Point=4]="Point",e[e.Twip=5]="Twip",e[e.InHs=6]="InHs",e[e.Display=7]="Display",e[e.Cm=8]="Cm",e[e.Dip=9]="Dip"}(oe=t._UnitType||(t._UnitType={}));var re=function(){function e(t,o){if(void 0===o&&(o=oe.Dip),e._initUnitTypeDic(),n.isObject(t)){var r=t;t=r.value,o=r.units}else if(n.isString(t)){var i=parseFloat(t);isNaN(i)||(o=e._unitTypeDic[t.substr(i.toString().length)],t=i)}this._value=t,this._units=o,this._valueInPixel=e.convertValue(t,o,oe.Dip)}return e._initUnitTypeDic=function(){if(!e._unitTypeDic){e._unitTypeDic={};for(var t in e._unitTypes)e._unitTypeDic[e._unitTypeDic[t]=e._unitTypes[t]]=t}},Object.defineProperty(e.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"units",{get:function(){return this._units},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"valueInPixel",{get:function(){return this._valueInPixel},enumerable:!0,configurable:!0}),e.prototype.toString=function(){return e.toString(this)},e.toString=function(t){return null==t.value?"":t.value+e._unitTypeDic[t.units]},e.convertValue=function(t,n,o){if(n===o)return t;var r;switch(n){case oe.Document:r=t/e._DocumentUnitsPerInch;break;case oe.Inch:r=t;break;case oe.Mm:r=t/e._MmPerInch;break;case oe.Pica:r=t/e._PicaPerInch;break;case oe.Point:r=t/e._PointsPerInch;break;case oe.Twip:r=t/e._TwipsPerInch;break;case oe.InHs:r=t/100;break;case oe.Display:r=t/e._DisplayPerInch;break;case oe.Cm:r=t/e._CmPerInch;break;case oe.Dip:r=t/e._DipPerInch;break;default:throw"Invalid from _UnitType: "+n}switch(o){case oe.Document:return r*e._DocumentUnitsPerInch;case oe.Inch:return r;case oe.Mm:return r*e._MmPerInch;case oe.Pica:return r*e._PicaPerInch;case oe.Point:return r*e._PointsPerInch;case oe.Twip:return r*e._TwipsPerInch;case oe.InHs:return 100*r;case oe.Display:return r*e._DisplayPerInch;case oe.Cm:return r*e._CmPerInch;case oe.Dip:return r*e._DipPerInch;default:throw"Invalid to _UnitType: "+o}},e._MmPerInch=25.4,e._DocumentUnitsPerInch=300,e._PointsPerInch=72,e._TwipsPerInch=1440,e._PicaPerInch=6,e._CmPerInch=e._MmPerInch/10,e._DisplayPerInch=75,e._DipPerInch=96,e._unitTypes={doc:oe.Document,in:oe.Inch,mm:oe.Mm,pc:oe.Pica,pt:oe.Point,tw:oe.Twip,inhs:oe.InHs,dsp:oe.Display,cm:oe.Cm,dip:oe.Dip,px:oe.Dip},e}();t._Unit=re;var ie=function(){function e(){this._callbacks=[]}return e.prototype.then=function(e,t){return this._callbacks.push({onFulfilled:e,onRejected:t}),this},e.prototype.catch=function(e){return this.then(null,e)},e.prototype.resolve=function(e){var t=this;return setTimeout(function(){try{t.onFulfilled(e)}catch(e){t.onRejected(e)}},0),this},e.prototype.reject=function(e){var t=this;return setTimeout(function(){t.onRejected(e)},0),this},e.prototype.onFulfilled=function(e){for(var t;t=this._callbacks.shift();)if(t.onFulfilled){var n=t.onFulfilled(e);void 0!==n&&(e=n)}},e.prototype.onRejected=function(e){for(var t;t=this._callbacks.shift();)if(t.onRejected){var n=t.onRejected(e);return void this.onFulfilled(n)}throw e},e}();t._Promise=ie;var ae=function(e){function t(t){var n=e.call(this)||this;return n._promises=t,n._init(),n}return __extends(t,e),t.prototype._init=function(){var e=this;if(this._promises&&this._promises.length){var t=this._promises.length,n=0,o=[],r=!1;this._promises.some(function(i){return i.then(function(i){r||(o.push(i),++n>=t&&e.resolve(o))}).catch(function(t){r=!0,e.reject(t)}),r})}else this.reject("No promises in current composited promise.")},t}(ie);t._CompositedPromise=ae;var se;!function(e){e[e.Custom=0]="Custom",e[e.Letter=1]="Letter",e[e.LetterSmall=2]="LetterSmall",e[e.Tabloid=3]="Tabloid",e[e.Ledger=4]="Ledger",e[e.Legal=5]="Legal",e[e.Statement=6]="Statement",e[e.Executive=7]="Executive",e[e.A3=8]="A3",e[e.A4=9]="A4",e[e.A4Small=10]="A4Small",e[e.A5=11]="A5",e[e.B4=12]="B4",e[e.B5=13]="B5",e[e.Folio=14]="Folio",e[e.Quarto=15]="Quarto",e[e.Standard10x14=16]="Standard10x14",e[e.Standard11x17=17]="Standard11x17",e[e.Note=18]="Note",e[e.Number9Envelope=19]="Number9Envelope",e[e.Number10Envelope=20]="Number10Envelope",e[e.Number11Envelope=21]="Number11Envelope",e[e.Number12Envelope=22]="Number12Envelope",e[e.Number14Envelope=23]="Number14Envelope",e[e.CSheet=24]="CSheet",e[e.DSheet=25]="DSheet",e[e.ESheet=26]="ESheet",e[e.DLEnvelope=27]="DLEnvelope",e[e.C5Envelope=28]="C5Envelope",e[e.C3Envelope=29]="C3Envelope",e[e.C4Envelope=30]="C4Envelope",e[e.C6Envelope=31]="C6Envelope",e[e.C65Envelope=32]="C65Envelope",e[e.B4Envelope=33]="B4Envelope",e[e.B5Envelope=34]="B5Envelope",e[e.B6Envelope=35]="B6Envelope",e[e.ItalyEnvelope=36]="ItalyEnvelope",e[e.MonarchEnvelope=37]="MonarchEnvelope",e[e.PersonalEnvelope=38]="PersonalEnvelope",e[e.USStandardFanfold=39]="USStandardFanfold",e[e.GermanStandardFanfold=40]="GermanStandardFanfold",e[e.GermanLegalFanfold=41]="GermanLegalFanfold",e[e.IsoB4=42]="IsoB4",e[e.JapanesePostcard=43]="JapanesePostcard",e[e.Standard9x11=44]="Standard9x11",e[e.Standard10x11=45]="Standard10x11",e[e.Standard15x11=46]="Standard15x11",e[e.InviteEnvelope=47]="InviteEnvelope",e[e.LetterExtra=50]="LetterExtra",e[e.LegalExtra=51]="LegalExtra",e[e.TabloidExtra=52]="TabloidExtra",e[e.A4Extra=53]="A4Extra",e[e.LetterTransverse=54]="LetterTransverse",e[e.A4Transverse=55]="A4Transverse",e[e.LetterExtraTransverse=56]="LetterExtraTransverse",e[e.APlus=57]="APlus",e[e.BPlus=58]="BPlus",e[e.LetterPlus=59]="LetterPlus",e[e.A4Plus=60]="A4Plus",e[e.A5Transverse=61]="A5Transverse",e[e.B5Transverse=62]="B5Transverse",e[e.A3Extra=63]="A3Extra",e[e.A5Extra=64]="A5Extra",e[e.B5Extra=65]="B5Extra",e[e.A2=66]="A2",e[e.A3Transverse=67]="A3Transverse",e[e.A3ExtraTransverse=68]="A3ExtraTransverse",e[e.JapaneseDoublePostcard=69]="JapaneseDoublePostcard",e[e.A6=70]="A6",e[e.JapaneseEnvelopeKakuNumber2=71]="JapaneseEnvelopeKakuNumber2",e[e.JapaneseEnvelopeKakuNumber3=72]="JapaneseEnvelopeKakuNumber3",e[e.JapaneseEnvelopeChouNumber3=73]="JapaneseEnvelopeChouNumber3",e[e.JapaneseEnvelopeChouNumber4=74]="JapaneseEnvelopeChouNumber4",e[e.LetterRotated=75]="LetterRotated",e[e.A3Rotated=76]="A3Rotated",e[e.A4Rotated=77]="A4Rotated",e[e.A5Rotated=78]="A5Rotated",e[e.B4JisRotated=79]="B4JisRotated",e[e.B5JisRotated=80]="B5JisRotated",e[e.JapanesePostcardRotated=81]="JapanesePostcardRotated",e[e.JapaneseDoublePostcardRotated=82]="JapaneseDoublePostcardRotated",e[e.A6Rotated=83]="A6Rotated",e[e.JapaneseEnvelopeKakuNumber2Rotated=84]="JapaneseEnvelopeKakuNumber2Rotated",e[e.JapaneseEnvelopeKakuNumber3Rotated=85]="JapaneseEnvelopeKakuNumber3Rotated",e[e.JapaneseEnvelopeChouNumber3Rotated=86]="JapaneseEnvelopeChouNumber3Rotated",e[e.JapaneseEnvelopeChouNumber4Rotated=87]="JapaneseEnvelopeChouNumber4Rotated",e[e.B6Jis=88]="B6Jis",e[e.B6JisRotated=89]="B6JisRotated",e[e.Standard12x11=90]="Standard12x11",e[e.JapaneseEnvelopeYouNumber4=91]="JapaneseEnvelopeYouNumber4",e[e.JapaneseEnvelopeYouNumber4Rotated=92]="JapaneseEnvelopeYouNumber4Rotated",e[e.Prc16K=93]="Prc16K",e[e.Prc32K=94]="Prc32K",e[e.Prc32KBig=95]="Prc32KBig",e[e.PrcEnvelopeNumber1=96]="PrcEnvelopeNumber1",e[e.PrcEnvelopeNumber2=97]="PrcEnvelopeNumber2",e[e.PrcEnvelopeNumber3=98]="PrcEnvelopeNumber3",e[e.PrcEnvelopeNumber4=99]="PrcEnvelopeNumber4",e[e.PrcEnvelopeNumber5=100]="PrcEnvelopeNumber5",e[e.PrcEnvelopeNumber6=101]="PrcEnvelopeNumber6",e[e.PrcEnvelopeNumber7=102]="PrcEnvelopeNumber7",e[e.PrcEnvelopeNumber8=103]="PrcEnvelopeNumber8",e[e.PrcEnvelopeNumber9=104]="PrcEnvelopeNumber9",e[e.PrcEnvelopeNumber10=105]="PrcEnvelopeNumber10",e[e.Prc16KRotated=106]="Prc16KRotated",e[e.Prc32KRotated=107]="Prc32KRotated",e[e.Prc32KBigRotated=108]="Prc32KBigRotated",e[e.PrcEnvelopeNumber1Rotated=109]="PrcEnvelopeNumber1Rotated",e[e.PrcEnvelopeNumber2Rotated=110]="PrcEnvelopeNumber2Rotated",e[e.PrcEnvelopeNumber3Rotated=111]="PrcEnvelopeNumber3Rotated",e[e.PrcEnvelopeNumber4Rotated=112]="PrcEnvelopeNumber4Rotated",e[e.PrcEnvelopeNumber5Rotated=113]="PrcEnvelopeNumber5Rotated",e[e.PrcEnvelopeNumber6Rotated=114]="PrcEnvelopeNumber6Rotated",e[e.PrcEnvelopeNumber7Rotated=115]="PrcEnvelopeNumber7Rotated",e[e.PrcEnvelopeNumber8Rotated=116]="PrcEnvelopeNumber8Rotated",e[e.PrcEnvelopeNumber9Rotated=117]="PrcEnvelopeNumber9Rotated",e[e.PrcEnvelopeNumber10Rotated=118]="PrcEnvelopeNumber10Rotated"}(se=t._PaperKind||(t._PaperKind={}));var ue=function(e){function t(t){var n=e.call(this)||this;return n._data=t||{},n}return __extends(t,e),Object.defineProperty(t.prototype,"data",{get:function(){return this._data},enumerable:!0,configurable:!0}),t}(n.EventArgs);t.QueryLoadingDataEventArgs=ue;var ce=function(e){function t(t){return e.call(this,t)||this}return __extends(t,e),Object.defineProperty(t.prototype,"autoRun",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasParameters",{get:function(){throw te._abstractMethodException},enumerable:!0,configurable:!0}),t.prototype.getParameters=function(){throw te._abstractMethodException},t.prototype.setParameters=function(e){throw te._abstractMethodException},t.prototype.render=function(){throw te._abstractMethodException},t}(te);t._ReportDocumentSourceBase=ce;var le=function(e){function t(t){var o=e.call(this,t)||this;return o._hasParameters=!1,o._status=pe.notFound,o.statusChanged=new n.Event,o}return __extends(t,e),t.getReportNames=function(e,t){return he.getReportNames(e,t)},t.getReports=function(e,t,o){return n.isBoolean(o)&&(o={recursive:o}),he.getReports(e,t,o)},Object.defineProperty(t.prototype,"reportName",{get:function(){return this._innerService?this._innerService.reportName:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasParameters",{get:function(){return this._hasParameters},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this._status},enumerable:!0,configurable:!0}),t.prototype.load=function(){return e.prototype.load.call(this)},t.prototype._updateStatus=function(e){this._status!==e&&(this._status=e,this.onStatusChanged())},t.prototype.cancel=function(){var e=this;return this._innerService.cancel().then(function(t){return e._updateDocumentStatus(t)})},t.prototype.onStatusChanged=function(e){this.statusChanged.raise(this,e||new n.EventArgs)},t.prototype.dispose=function(){return e.prototype.dispose.call(this)},t.prototype.setParameters=function(e){var t=this;return this._innerService.setParameters(e).then(function(e){return void(t._parameters=e)})},t.prototype.getParameters=function(){var e=this;if(this._parameters&&this._parameters.length){var t=new ie;return t.resolve(this._parameters),t}return this._innerService.getParameters().then(function(t){return void(e._parameters=t)})},t.prototype._getIsDisposed=function(){return e.prototype._getIsDisposed.call(this)||this._innerService.isCleared},t.prototype._updateExecutionInfo=function(t){null==t||this.isDisposed||(this._hasParameters=!!t.hasParameters,e.prototype._updateExecutionInfo.call(this,t))},t.prototype._updateDocumentStatus=function(t){this._updateStatus(t.status),e.prototype._updateDocumentStatus.call(this,t)},t.prototype._checkIsLoadCompleted=function(e){return e.status===pe.completed||e.status===pe.stopped},t.prototype._createDocumentService=function(e){return new he(e)},Object.defineProperty(t.prototype,"_innerService",{get:function(){return this.service},enumerable:!0,configurable:!0}),t.prototype.render=function(){var e=this;return this._innerService.render().then(function(t){return e._updateDocumentStatus(t)})},t.prototype.executeCustomAction=function(e){var t=this;return this._innerService.executeCustomAction(e).then(function(e){return t._updateDocumentStatus(e)})},t}(ce);t._Report=le;var he=function(e){function t(t){var n=e.call(this,t)||this;return n._reportName=t.reportName,n}return __extends(t,e),Object.defineProperty(t.prototype,"isCleared",{get:function(){return!this._instanceId&&this._status==pe.cleared},enumerable:!0,configurable:!0}),t.getReportNames=function(e,n){return t.getReports(e,n).then(function(e){if(!e)return null;var t=[];return e.items.forEach(function(e){e.type===ge.Report&&t.push(e.name)}),t})},t.getReports=function(e,t,n){var o=new ie;return z(N(e,t),{data:n,success:function(e){o.resolve(JSON.parse(e.responseText))},error:function(e){return o.reject(e)}}),o},Object.defineProperty(t.prototype,"reportName",{get:function(){return this._reportName},enumerable:!0,configurable:!0}),t.prototype.getBookmark=function(e){var n=new ie;return this._checkReportInstanceController(n)?(z(this._getReportInstancesUrl(t._bookmarkAction,e),{success:function(e){n.resolve(JSON.parse(e.responseText))}}),n):n},t.prototype.executeCustomAction=function(e){var n={};return n[t._customActionParam]=e.data,this.render(n)},t.prototype.getStatus=function(){var e=new ie;return z(this._statusLocation,{success:function(t){e.resolve(JSON.parse(t.responseText,R))}}),e},t.prototype.getDocumentStatus=function(){return this._getReportCache()},t.prototype._getReportCache=function(){var e=new ie;return this._checkReportInstanceController(e)?(z(this._getReportInstancesUrl(),{success:function(t){e.resolve(U(t.responseText))}}),e):e},t.prototype.getParameters=function(){var e=new ie;return this._checkReportInstanceController(e)?(z(this._getReportInstancesUrl(t._parametersAction),{success:function(t){e.resolve(JSON.parse(t.responseText))}}),e):e},t.prototype._getUrlMainPart=function(){return N(this.serviceUrl,this.filePath,this.reportName)},t.prototype._getReportUrl=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return N(this._getUrlMainPart(),t._reportCommand,e)},t.prototype._getReportInstancesUrl=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return N(this._getUrlMainPart(),t._instancesCommand,this._instanceId,e)},t.prototype._checkReportController=function(e){return!(null==this.serviceUrl||!this.filePath||(D(this.filePath,".flxr",!0)||D(this.filePath,".xml",!0))&&!this.reportName)||(e&&e.reject(t._invalidReportControllerError),!1)},t.prototype._checkReportInstanceController=function(e){return!(!this._checkReportController(e)||!this._instanceId)||(e&&e.reject(t._invalidReportCacheControllerError),!1)},t.prototype._getError=function(e){var t=e.responseText;try{t&&(t=JSON.parse(t))}finally{return t}},t.prototype.render=function(e){var n=this,o=new ie;return this._checkReportInstanceController(o)?(z(this._getReportInstancesUrl(t._renderAction),{method:"POST",data:e,success:function(e){202===e.status?o.resolve({status:pe.rendering}):o.resolve(U(e.responseText))},error:function(e){o.reject(n._getError(e))}}),o.then(function(e){n._status=e.status})):o},t.prototype.renderToFilter=function(e){var t=this,n=new ie;return this._checkReportInstanceController(n)?(this.getRenderToFilterUrl(e).then(function(e){z(e,{cache:!0,success:function(e){n.resolve(e)},error:function(e){n.reject(t._getError(e))}})}),n):n},t.prototype.load=function(e){var t=this,n=new ie;return this._checkReportController(n)?(z(this._getReportInstancesUrl(),{method:"POST",data:e,success:function(e){n.resolve(U(e.responseText))},error:function(e){n.reject(t._getError(e))}}),n.then(function(e){t._instanceId=e.id,t._status=pe.loaded,t._outlinesLocation=e.outlinesLocation,t._statusLocation=e.statusLocation,t._pageSettingsLocation=e.pageSettingsLocation,t._featuresLocation=e.featuresLocation,t._parametersLocation=e.parametersLocation})):n},t.prototype.cancel=function(){var e=this,n=new ie;return this._checkReportInstanceController(n)?this._status!==pe.rendering?(n.reject("Cannot execute cancel when the report is not rendering."),n):(z(this._getReportInstancesUrl(t._cancelAction),{method:"POST",success:function(e){n.resolve(U(e.responseText))}}),n.then(function(t){return void(e._status=t.status)}),n):n},t.prototype.dispose=function(){var e=this,t=new ie;return this._checkReportInstanceController()?(z(this._getReportInstancesUrl(),{method:"DELETE",success:function(n){e._status=pe.cleared,e._instanceId="",t.resolve()}}),t):t},t.prototype.getOutlines=function(){var e=new ie;return this._checkReportInstanceController(e)?(z(this._getReportInstancesUrl(t._outlinesAction),{success:function(t){e.resolve(JSON.parse(t.responseText))}}),e):e},t.prototype.getRenderToFilterUrl=function(e){var n=new ie,o=null;return this._checkReportInstanceController()&&(o=H(o=W(o=this._getReportInstancesUrl(t._exportAction)),e),n.resolve(o)),n.resolve(o),n},t.prototype.getExportedUrl=function(e){return this.getRenderToFilterUrl(e)},t.prototype.search=function(e){var n=new ie;return this._checkReportInstanceController(n)?(z(this._getReportInstancesUrl(t._searchAction),{success:function(e){n.resolve(JSON.parse(e.responseText))},data:e}),n):n},t.prototype.setPageSettings=function(e){var n=this,o=new ie;return this._checkReportInstanceController(o)?(z(this._getReportInstancesUrl(t._pageSettingsAction),{method:"PUT",data:e,success:function(e){o.resolve(JSON.parse(e.responseText,O))},error:function(e){o.reject(n._getError(e))}}),o):o},t.prototype.setParameters=function(e){var n=this,o=new ie;return this._checkReportInstanceController(o)?(Object.keys(e).forEach(function(t){null===e[t]&&(e[t]="")}),z(this._getReportInstancesUrl(t._parametersAction),{method:"PATCH",data:e,success:function(e){o.resolve(JSON.parse(e.responseText))},error:function(e){o.reject(n._getError(e))}}),o):o},t.prototype.getSupportedExportDescriptions=function(){var e=new ie;return this._checkReportInstanceController(e)?(z(this._getReportInstancesUrl(t._supportedFormatsAction),{success:function(t){e.resolve(JSON.parse(t.responseText))}}),e):e},t.prototype.getFeatures=function(){var e=new ie;return this._checkReportInstanceController(e)?(z(this._featuresLocation,{success:function(t){e.resolve(JSON.parse(t.responseText))}}),e):e},t._reportCommand="$report",t._instancesCommand="$instances",t._customActionParam="actionString",t._renderAction="render",t._searchAction="search",t._cancelAction="stop",t._outlinesAction="outlines",t._exportAction="export",t._parametersAction="parameters",t._bookmarkAction="bookmarks",t._pageSettingsAction="pagesettings",t._supportedFormatsAction="supportedformats",t._invalidReportControllerError="Cannot call the service without service url, document path or report name.",t._invalidReportCacheControllerError="Cannot call the service when service url is not set or the report is not loaded.",t}(ne);t._ReportService=he,t._parseReportExecutionInfo=U;var pe=function(){function e(){}return e.loaded="Loaded",e.rendering="Rendering",e.completed="Completed",e.stopped="Stopped",e.cleared="Cleared",e.notFound="NotFound",e}();t._ExecutionStatus=pe;var de;!function(e){e[e.Boolean=0]="Boolean",e[e.DateTime=1]="DateTime",e[e.Time=2]="Time",e[e.Date=3]="Date",e[e.Integer=4]="Integer",e[e.Float=5]="Float",e[e.String=6]="String"}(de=t._ParameterType||(t._ParameterType={}));var ge;!function(e){e[e.Folder=0]="Folder",e[e.File=1]="File",e[e.Report=2]="Report"}(ge=t.CatalogItemType||(t.CatalogItemType={}));var _e=function(e){function t(t){var n=e.call(this,t)||this;return n._status=pe.notFound,n}return __extends(t,e),Object.defineProperty(t.prototype,"status",{get:function(){return this._status},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_innerService",{get:function(){return this.service},enumerable:!0,configurable:!0}),t.prototype._createDocumentService=function(e){return new me(e)},t.prototype.load=function(){return e.prototype.load.call(this)},t.prototype._updateStatus=function(e){this._status!==e&&(this._status=e)},t.prototype.getStatus=function(){var e=this,t=new ue;return this.onQueryLoadingData(t),this._innerService.getStatus(t.data).then(function(t){return e._updateDocumentStatus(t)})},t.prototype.renderToFilter=function(e){var t=new ue;return this.onQueryLoadingData(t),this._innerService.renderToFilter(e,t.data)},t.prototype._updateDocumentStatus=function(t){null!=t&&(this._updateStatus(t.status),e.prototype._updateDocumentStatus.call(this,t))},t}(te);t._PdfDocumentSource=_e;var me=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype._getPdfUrl=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return N(this.serviceUrl,this.filePath,t._pdfCommand,e)},t.prototype._getPdfStatus=function(e){var t=this,n=new ie;return this._checkPdfController(n)?(z(this._getPdfUrl(),{data:e,success:function(e){n.resolve(q(e.responseText))},error:function(e){n.reject(e.statusText)}}),n.then(function(e){t._status=pe.loaded,t._statusLocation=e.statusLocation,t._featuresLocation=e.featuresLocation})):n},t.prototype._checkPdfController=function(e){return!(null==this.serviceUrl||!this.filePath)||(e&&e.reject(t._invalidPdfControllerError),!1)},t.prototype.dispose=function(){var e=new ie;return e.resolve(),e},t.prototype.load=function(e){return this._getPdfStatus(e)},t.prototype.getStatus=function(e){var t=new ie;return z(this._statusLocation,{data:e,success:function(e){t.resolve(JSON.parse(e.responseText))}}),t},t.prototype.renderToFilter=function(e,t){var n=new ie;return this._checkPdfController(n)?(this.getRenderToFilterUrl(e).then(function(e){z(e,{data:t,cache:!0,success:function(e){n.resolve(e)}})}),n):n},t.prototype.getRenderToFilterUrl=function(e){var n=new ie,o=null;return this._checkPdfController()&&(o=H(o=W(o=this._getPdfUrl(t._exportAction)),e)),n.resolve(o),n},t.prototype.getExportedUrl=function(e){return this.getRenderToFilterUrl(e)},t.prototype.getSupportedExportDescriptions=function(){var e=new ie;return this._checkPdfController(e)?(z(this._getPdfUrl(t._supportedFormatsAction),{success:function(t){e.resolve(JSON.parse(t.responseText))}}),e):e},t.prototype.getFeatures=function(){var e=new ie;return this._checkPdfController(e)?(z(this._featuresLocation,{success:function(t){e.resolve(JSON.parse(t.responseText))}}),e):e},t.prototype.search=function(e){var n=new ie;return this._checkPdfController(n)?(z(this._getPdfUrl(t._searchAction),{success:function(e){n.resolve(JSON.parse(e.responseText))},data:e}),n):n},t._pdfCommand="$pdf",t._exportAction="export",t._supportedFormatsAction="supportedformats",t._searchAction="search",t._invalidPdfControllerError="Cannot call the service when service url is not set or the pdf is not loaded.",t}(ne);t._PdfDocumentService=me,t._parseExecutionInfo=q,n.culture.Viewer=window.wijmo.culture.Viewer||{cancel:"Cancel",ok:"OK",bottom:"Bottom:",top:"Top:",right:"Right:",left:"Left:",margins:"Margins(inches)",orientation:"Orientation:",paperKind:"Paper Kind:",pageSetup:"Page Setup",landscape:"Landscape",portrait:"Portrait",pageNumber:"Page Number",zoomFactor:"Zoom Factor",paginated:"Print Layout",print:"Print",search:"Search",matchCase:"Match case",wholeWord:"Match whole word only",searchResults:"Search Results",previousPage:"Previous Page",nextPage:"Next Page",firstPage:"First Page",lastPage:"Last Page",backwardHistory:"Backward",forwardHistory:"Forward",pageCount:"Page Count",selectTool:"Select Tool",moveTool:"Move Tool",continuousMode:"Continuous Page View",singleMode:"Single Page View",wholePage:"Fit Whole Page",pageWidth:"Fit Page Width",zoomOut:"Zoom Out",zoomIn:"Zoom In",rubberbandTool:"Zoom by Selection",magnifierTool:"Magnifier",rotatePage:"Rotate Page",rotateDocument:"Rotate Document",exports:"Export",fullScreen:"Full Screen",exitFullScreen:"Exit Full Screen",hamburgerMenu:"Tools",showSearchBar:"Show Search Bar",viewMenu:"Layout Options",searchOptions:"Search Options",matchCaseMenuItem:"Match Case",wholeWordMenuItem:"Match Whole Word",thumbnails:"Page Thumbnails",outlines:"Document Map",loading:"Loading...",pdfExportName:"Adobe PDF",docxExportName:"Open XML Word",xlsxExportName:"Open XML Excel",docExportName:"Microsoft Word",xlsExportName:"Microsoft Excel",mhtmlExportName:"Web archive (MHTML)",htmlExportName:"HTML document",rtfExportName:"RTF document",metafileExportName:"Compressed metafiles",csvExportName:"CSV",tiffExportName:"Tiff images",bmpExportName:"BMP images",emfExportName:"Enhanced metafile",gifExportName:"GIF images",jpgExportName:"JPEG images",jpegExportName:"JPEG images",pngExportName:"PNG images",abstractMethodException:"It is an abstract method, please implement it.",cannotRenderPageNoViewPage:"Cannot render page without document source and view page.",cannotRenderPageNoDoc:"Cannot render page without document source and view page.",exportFormat:"Export format:",exportOptionTitle:"Export options",documentRestrictionsGroup:"Document restrictions",passwordSecurityGroup:"Password security",outputRangeGroup:"Output range",documentInfoGroup:"Document info",generalGroup:"General",docInfoTitle:"Title",docInfoAuthor:"Author",docInfoManager:"Manager",docInfoOperator:"Operator",docInfoCompany:"Company",docInfoSubject:"Subject",docInfoComment:"Comment",docInfoCreator:"Creator",docInfoProducer:"Producer",docInfoCreationTime:"Creation time",docInfoRevisionTime:"Revision time",docInfoKeywords:"Keywords",embedFonts:"Embed TrueType fonts",pdfACompatible:"PDF/A compatible (level 2B)",useCompression:"Use compression",useOutlines:"Generate outlines",allowCopyContent:"Allow content copying or extraction",allowEditAnnotations:"Allow annotations editing",allowEditContent:"Allow content editing",allowPrint:"Allow printing",ownerPassword:"Permissions (owner) password:",userPassword:"Document open (user) password:",encryptionType:"Encryption level:",paged:"Paged",showNavigator:"Show Navigator",navigatorPosition:"Navigator Position",singleFile:"Single File",tolerance:"Tolerance when detecting text bounds (points):",pictureLayer:"Use separate picture layer",metafileType:"Metafile Type:",monochrome:"Monochrome",resolution:"Resolution:",outputRange:"Page range:",outputRangeInverted:"Inverted",showZoomBar:"Zoom Bar",searchPrev:"Search Previous",searchNext:"Search Next",checkMark:"✓",exportOk:"Export...",cannotSearch:"Search requires a document source to be specified.",parameters:"Parameters",requiringParameters:"Please input parameters.",nullParameterError:"Value cannot be null.",invalidParameterError:"Invalid input.",parameterNoneItemsSelected:"(none)",parameterAllItemsSelected:"(all)",parameterSelectAllItemText:"(Select All)",selectParameterValue:"(select value)",apply:"Apply",errorOccured:"An error has occured."};var fe=function(){function e(){this._currentIndex=-1,this.currentChanged=new n.Event,this.searchStarted=new n.Event,this.searchCompleted=new n.Event}return Object.defineProperty(e.prototype,"current",{get:function(){return this._currentIndex<0?null:this._searchResult[this._currentIndex]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentIndex",{get:function(){return this._currentIndex},set:function(e){var t=this;e!==this._currentIndex&&this._getSearchResults().then(function(n){t._currentIndex=e,t._onCurrentChanged()})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"documentSource",{get:function(){return this._documentSource},set:function(e){this._documentSource=e,this.clear()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"matchCase",{get:function(){return this._matchCase},set:function(e){this._matchCase!==e&&(this._matchCase=e,this._needUpdate=!0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"searchResult",{get:function(){return this._searchResult},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this._text},set:function(e){this._text!==e&&(this._text=e,this._needUpdate=!0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wholeWord",{get:function(){return this._wholeWord},set:function(e){this._wholeWord!==e&&(this._wholeWord=e,this._needUpdate=!0)},enumerable:!0,configurable:!0}),e.prototype.clear=function(){this._clearResults(),this._text=null,this._matchCase=!1,this._wholeWord=!1,this._currentIndex=-1},e.prototype.search=function(e){var t=this;this._needUpdate&&this._clearResults(),this._getSearchResults().then(function(n){var o=t._searchResult.length;e?(t._currentIndex--,t._currentIndex<0&&(t._currentIndex=o-1)):(t._currentIndex++,t._currentIndex>=o&&(t._currentIndex=0)),t._currentIndex=Math.max(Math.min(t._currentIndex,o-1),0),t._onCurrentChanged()})},e.prototype._clearResults=function(){this._currentIndex=-1,this._searchResult=null},e.prototype._getSearchResults=function(){var e=this,t=new ie;return this._searchResult?(t.resolve(this._searchResult),t):this.documentSource?null==this._text||0===this._text.length?t:(this._needUpdate=!1,this._onSearchStarted(),this.documentSource.search({text:this.documentSource.encodeRequestParams?encodeURIComponent(this.text):this.text,matchCase:this.matchCase,wholeWord:this.wholeWord}).then(function(t){e._searchResult=t,e._onSearchCompleted()})):(t.reject(n.culture.Viewer.cannotSearch),t)},e.prototype._onCurrentChanged=function(){this.currentChanged.raise(this,new n.EventArgs)},e.prototype._onSearchStarted=function(){this.searchStarted.raise(this,new n.EventArgs)},e.prototype._onSearchCompleted=function(){this.searchCompleted.raise(this,new n.EventArgs)},e}();t._SearchManager=fe,window.TouchEvent=window.TouchEvent||function(){},window.PointerEvent=window.PointerEvent||function(){},window.Touch=window.Touch||function(){};var ve={startName:"touchstart",moveName:"touchmove",endName:["touchend","touchcancel","touchleave"].join(",")},ye={startName:["pointerdown","pointerenter"].join(","),moveName:"pointermove",endName:["pointerup","pointercancel","pointerleave"].join(",")};t._getTouchEventMap=K;var we;!function(e){e[e.None=0]="None",e[e.Left=1]="Left",e[e.Up=2]="Up",e[e.Right=3]="Right",e[e.Down=4]="Down"}(we=t._TouchDirection||(t._TouchDirection={}));var be=function(){function e(e){this._systemTouchInfo=e,e instanceof Touch?this._id=e.identifier:this._id=e.pointerId,this._target=e.target,this._screenX=e.screenX,this._screenY=e.screenY,this._clientX=e.clientX,this._clientY=e.clientY}return e.getCenter=function(e,t){return new n.Point(e.x+(t.x-e.x)/2,e.y+(t.y-e.y)/2)},e.getCenterClient=function(t,o){return e.getCenter(new n.Point(t.clientX,t.clientY),new n.Point(o.clientX,o.clientY))},e.getCenterScreen=function(t,o){return e.getCenter(new n.Point(t.screenX,t.screenY),new n.Point(o.screenX,o.screenY))},e.getDistance=function(e,t){var n=Math.abs(e.clientX-t.clientX),o=Math.abs(e.clientY-t.clientY);return Math.sqrt(n*n+o*o)},e._getDirection=function(e,t){var n=t.clientX-e.clientX,o=t.clientY-e.clientY;return Math.abs(n)>=Math.abs(o)?n>0?we.Right:n<0?we.Left:we.None:o>0?we.Down:o<0?we.Up:we.None},Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"systemTouchInfo",{get:function(){return this._systemTouchInfo},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"screenX",{get:function(){return this._screenX},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"screenY",{get:function(){return this._screenY},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"clientX",{get:function(){return this._clientX},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"clientY",{get:function(){return this._clientY},enumerable:!0,configurable:!0}),e}();t._TouchInfo=be;var Pe=function(){function e(){this._timeInterval=50,this._speedInterval=5}return Object.defineProperty(e.prototype,"timeInterval",{get:function(){return this._timeInterval},set:function(e){this._timeInterval=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"speedInterval",{get:function(){return this._speedInterval},set:function(e){this._speedInterval=e},enumerable:!0,configurable:!0}),e.prototype.stop=function(){null!=this._timer&&(clearInterval(this._timer),this._timer=null)},e.prototype.start=function(e,t,n){var o=this;if(this.stop(),n){var r=e>=0?1:-1,i=t>=0?1:-1,a=Math.abs(e*this._timeInterval),s=Math.abs(t*this._timeInterval),u=Math.max(a,s),c=Math.floor(u/this.speedInterval),l=Math.floor(a/c),h=Math.floor(s/c);this._timer=setInterval(function(){a-=l,s-=h,a=Math.max(0,a),s=Math.max(0,s),a&&s?n(a*r,s*i):o.stop()},this._timeInterval)}},e}();t._SpeedReducer=Pe;var Se;!function(e){e[e.Start=0]="Start",e[e.Move=1]="Move",e[e.End=2]="End"}(Se=t._TouchEventType||(t._TouchEventType={}));var Ce=function(e){function t(n){var o=e.call(this)||this;return n instanceof t?(o._systemEvent=n.systemEvent,o._type=n.type,o._touchInfos=n.touchInfos,o):(o._systemEvent=n,Oe._registerTouchInfo(n),o._type=Oe._isTouchStart(n.type)?Se.Start:Oe._isTouchEnd(n.type)?Se.End:Se.Move,o._touchInfos=Oe._allTouchInfos?Oe._allTouchInfos.slice():[],o)}return __extends(t,e),Object.defineProperty(t.prototype,"timeStamp",{get:function(){return this.systemEvent.timeStamp},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"touchInfos",{get:function(){return this._touchInfos},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"systemEvent",{get:function(){return this._systemEvent},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"target",{get:function(){return this.systemEvent.target},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentTarget",{get:function(){return this.systemEvent.currentTarget},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){return this._type},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pointersCount",{get:function(){return this.touchInfos.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cancelBubble",{get:function(){return this._systemEvent.cancelBubble},set:function(e){this._systemEvent.cancelBubble=e},enumerable:!0,configurable:!0}),t.prototype.preventDefault=function(){this._systemEvent.preventDefault()},t}(n.EventArgs);t._TouchEventArgs=Ce;var xe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.raise=function(t,n){e.prototype.raise.call(this,t,n)},t}(n.Event);t._TouchEvent=xe;var Te=function(){function e(t){var o=this;this.touchMove=new xe,this.touchStart=new xe,this.touchEnd=new xe;var r=n.getElement(t);this._element=r;var i=e.getTrigger(r);if(i){var a=this._onTouchEvent.bind(this);return i.touchMove.addHandler(a),i.touchStart.addHandler(a),i.touchEnd.addHandler(a),void(this._disposeAction=function(){i.touchMove.removeHandler(a),i.touchStart.removeHandler(a),i.touchEnd.removeHandler(a),o._disposeAction=null})}var s=K(),u=this._onSystemTouchEvent.bind(this);_(r,s.startName,u),_(r,s.moveName,u),_(r,s.endName,u),e.bindElement(r,this),this._disposeAction=function(){m(r,s.startName,u),m(r,s.moveName,u),m(r,s.endName,u),e.unbindElement(r),o._disposeAction=null}}return e.bindElement=function(t,n){if(t[e._elementDataName])throw"Cannot bind multi _TouchTrigger on the same element.";t[e._elementDataName]=n},e.unbindElement=function(t){t[e._elementDataName]=null},e.getTrigger=function(t){return t[e._elementDataName]},e.prototype._onSystemTouchEvent=function(e){var t=this._createTouchEventArgs(e);t&&this._onTouchEvent(this,t)},e.prototype._createTouchEventArgs=function(e){return Oe._isTouchEvent(e)?new Ce(e):null},e.prototype.dispose=function(){this._disposeAction&&this._disposeAction()},Object.defineProperty(e.prototype,"hostElement",{get:function(){return this._element},enumerable:!0,configurable:!0}),e.prototype._onTouchEvent=function(e,t){switch(t.type){case Se.Start:return void this.onTouchStart(t);case Se.Move:return void this.onTouchMove(t);case Se.End:this.onTouchEnd(t)}},e.prototype.onTouchEnd=function(e){this.touchEnd.raise(this,e)},e.prototype.onTouchStart=function(e){this.touchStart.raise(this,e)},e.prototype.onTouchMove=function(e){this.touchMove.raise(this,e)},e._elementDataName="__wjTouchTrigger",e}();t._TouchTrigger=Te;var Ee=function(e){function t(t,o,r){var i=e.call(this,t)||this;return i._panType=null==r?t.type:r,i._client=new n.Point(i.touchInfo.clientX,i.touchInfo.clientY),i._screen=new n.Point(i.touchInfo.screenX,i.touchInfo.screenY),o&&(i._clientDelta=new n.Point(i.client.x-o.client.x,i.client.y-o.client.y),i._screenDelta=new n.Point(i.screen.x-o.screen.x,i.screen.y-o.screen.y)),i}return __extends(t,e),Object.defineProperty(t.prototype,"type",{get:function(){return this._panType},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"clientDelta",{get:function(){return this._clientDelta},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"screenDelta",{get:function(){return this._screenDelta},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"client",{get:function(){return this._client},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"screen",{get:function(){return this._screen},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pointersCount",{get:function(){return this.type==Se.End?0:1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"touchInfo",{get:function(){return this.touchInfos[0]||{}},enumerable:!0,configurable:!0}),t}(Ce);t._PanEventArgs=Ee;var Me=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.raise=function(t,n){e.prototype.raise.call(this,t,n)},t}(xe);t._PanEvent=Me;var Ie=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.panMove=new Me,t.panStart=new Me,t.panEnd=new Me,t}return __extends(t,e),t.prototype.onPanEnd=function(e){this.panEnd.raise(this,e)},t.prototype.onPanStart=function(e){this.panStart.raise(this,e)},t.prototype.onPanMove=function(e){this.panMove.raise(this,e)},t.prototype._prepareMove=function(e){var t=this;this._prePanEventArgs=e,this._panEvents.queue(function(){t.onPanMove(e)})},t.prototype._prepareStart=function(e){var n=this;this._prePanEventArgs=e,this._panEvents.queue(function(){n.onPanStart(e)}),this._clearPanStartTimer(),this._panStartTimer=setTimeout(function(){n._panEvents&&n._panEvents.start(),n._clearPanStartTimer()},t._threhold)},t.prototype._prepareEnd=function(e){var t=this;this._prePanEventArgs=null,this._panEvents.queue(function(){var n=e instanceof Ee?e:new Ee(e,null,Se.End);t.onPanEnd(n),t._stopPan()})},t.prototype._clearPanStartTimer=function(){null!=this._panStartTimer&&(clearTimeout(this._panStartTimer),this._panStartTimer=null)},t.prototype._tryStopPan=function(e){this._panEvents&&this._panEvents.isStarted?this._prepareEnd(e):this._stopPan()},t.prototype._stopPan=function(){this._clearPanStartTimer(),this._panEvents=null,this._prePanEventArgs=null},t.prototype._processPan=function(e){var t=this._createPanEventArgs(e);if(t)switch(t.type){case Se.Start:return void this._prepareStart(t);case Se.Move:return void this._prepareMove(t);case Se.End:return void this._prepareEnd(t)}else this._tryStopPan(e)},t.prototype.onTouchStart=function(t){e.prototype.onTouchStart.call(this,t),this._processPan(t)},t.prototype.onTouchMove=function(t){e.prototype.onTouchMove.call(this,t),this._processPan(t)},t.prototype.onTouchEnd=function(t){e.prototype.onTouchEnd.call(this,t);var n=this._createPanEventArgs(t);n?this._prepareEnd(n):this._tryStopPan(t)},t.prototype._createPanEventArgs=function(e){if(e.type==Se.End&&0!=e.pointersCount||e.type!=Se.End&&1!=e.pointersCount)return null;var t=new Ee(e,this._prePanEventArgs);if(t.type!=Se.Start){if(!this._panEvents)return null}else this._panEvents=new Y;return t},t._threhold=10,t}(Te);t._PanTrigger=Ie;var Ve=function(e){function t(t,o,r,i){var a=e.call(this,r)||this;a._duration=i,a._startTouchInfo=t,a._endTouchInfo=o;var u=s(!1,new n.Point(a.endTouchInfo.clientX,a.endTouchInfo.clientY),new n.Point(a.startTouchInfo.clientX,a.startTouchInfo.clientY));return a._speed=new n.Point(je.getSpeed(u.x,a.duration),je.getSpeed(u.y,a.duration)),a._direction=be._getDirection(a.startTouchInfo,a.endTouchInfo),a}return __extends(t,e),Object.defineProperty(t.prototype,"duration",{get:function(){return this._duration},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"startTouchInfo",{get:function(){return this._startTouchInfo},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"endTouchInfo",{get:function(){return this._endTouchInfo},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"speed",{get:function(){return this._speed},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pointersCount",{get:function(){return 1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"direction",{get:function(){return this._direction},enumerable:!0,configurable:!0}),t}(Ee);t._SwipeEventArgs=Ve;var Ae=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.raise=function(t,n){e.prototype.raise.call(this,t,n)},t}(Me);t._SwipeEvent=Ae;var je=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.swipe=new Ae,t}return __extends(t,e),t.getSpeed=function(e,t){return e/t},t.prototype.onPanStart=function(t){e.prototype.onPanStart.call(this,t),this._panStartEventArgs=t},t.prototype.onPanMove=function(t){e.prototype.onPanMove.call(this,t),this._prePanMoveEventArgs=t},t.prototype.onPanEnd=function(t){e.prototype.onPanEnd.call(this,t);var n=this._createSwipeEventArgs(t);n&&this.onSwipe(n),this._panStartEventArgs=null,this._prePanMoveEventArgs=null},t.prototype.onSwipe=function(e){this.swipe.raise(this,e)},t.prototype._createSwipeEventArgs=function(e){if(!this._panStartEventArgs||!this._prePanMoveEventArgs)return null;var n=e.timeStamp-this._panStartEventArgs.timeStamp;return n>t.maxDuration?null:be.getDistance(this._panStartEventArgs.touchInfo,this._prePanMoveEventArgs.touchInfo)<t.minDistance?null:new Ve(this._panStartEventArgs.touchInfo,this._prePanMoveEventArgs.touchInfo,e,n)},t.minDistance=50,t.maxDuration=300,t}(Ie);t._SwipeTrigger=je;var De=function(e){function t(t,o,r){var i=e.call(this,t)||this;return i._zoom=1,i._pinchType=o,i._pre=r||{},i.type==Se.End?i:(i._pinchDistance=be.getDistance(i.touchInfos[0],i.touchInfos[1]),i._centerClient=be.getCenterClient(i.touchInfos[0],i.touchInfos[1]),i._centerScreen=be.getCenterScreen(i.touchInfos[0],i.touchInfos[1]),i.type==Se.Start?i:(i._zoom=i.pinchDistance/i.prePinchDistance,i._centerClientDelta=new n.Point(i.centerClient.x-i.preCenterClient.x,i.centerClient.y-i.preCenterClient.y),i._centerScreenDelta=new n.Point(i.centerScreen.x-i.preCenterScreen.x,i.centerScreen.y-i.preCenterScreen.y),i))}return __extends(t,e),Object.defineProperty(t.prototype,"zoom",{get:function(){return this._zoom},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pointersCount",{get:function(){return this.type==Se.End?0:2},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"prePinchDistance",{get:function(){return this._pre.pinchDistance},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pinchDistance",{get:function(){return this._pinchDistance},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"centerScreenDelta",{get:function(){return this._centerScreenDelta},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"centerClientDelta",{get:function(){return this._centerClientDelta},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"centerClient",{get:function(){return this._centerClient},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"preCenterClient",{get:function(){return this._pre.centerClient},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"centerScreen",{get:function(){return this._centerScreen},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"preCenterScreen",{get:function(){return this._pre.centerScreen},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){return this._pinchType},enumerable:!0,configurable:!0}),t}(Ce);t._PinchEventArgs=De;var ke=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.raise=function(t,n){e.prototype.raise.call(this,t,n)},t}(xe);t._PinchEvent=ke;var Re=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.pinch=new ke,t}return __extends(t,e),t.prototype.onPinch=function(e){this.pinch.raise(this,e)},t.prototype.onTouchStart=function(e){this._process(e)},t.prototype.onTouchend=function(e){this._process(e)},t.prototype.onTouchMove=function(e){this._process(e)},t.prototype._onPinching=function(e){var t=new De(e,this._preEventArgs?Se.Move:Se.Start,this._preEventArgs);this.onPinch(t),this._preEventArgs=t},t.prototype._onPinchEnd=function(e){if(this._preEventArgs){var t=new De(e,Se.End,this._preEventArgs);this.onPinch(t),this._preEventArgs=null}},t.prototype._process=function(e){if(2==e.pointersCount)switch(e.type){case Se.Start:case Se.Move:return void this._onPinching(e);case Se.End:return void this._onPinchEnd(e)}else this._onPinchEnd(e)},t}(Te);t._PinchTrigger=Re;var Oe=function(){function e(e,t){void 0===t&&(t=!0);var n=this;this.touchMove=new xe,this.touchStart=new xe,this.touchEnd=new xe,this.panMove=new Me,this.panStart=new Me,this.panEnd=new Me,this.swipe=new Ae,this.pinch=new ke,this._trigger=new je(e),this._trigger.touchStart.addHandler(function(e,t){return n.onTouchStart(t)}),this._trigger.touchMove.addHandler(function(e,t){return n.onTouchMove(t)}),this._trigger.touchEnd.addHandler(function(e,t){return n.onTouchEnd(t)}),this._trigger.panStart.addHandler(function(e,t){return n.onPanStart(t)}),this._trigger.panMove.addHandler(function(e,t){return n.onPanMove(t)}),this._trigger.panEnd.addHandler(function(e,t){return n.onPanEnd(t)}),this._trigger.swipe.addHandler(function(e,t){return n.onSwipe(t)}),this._pinchTrigger=new Re(e),this._pinchTrigger.pinch.addHandler(function(e,t){return n.onPinch(t)}),this.removeDefaultTouch=t}return e._isTouchEvent=function(t){return t instanceof TouchEvent||(t.pointerType||"").toLowerCase()===e._touchPointerName},e._isTouchStart=function(t){return e._eventTypeContains(t,K().startName)},e._isTouchEnd=function(t){return e._eventTypeContains(t,K().endName)},e._isTouchMove=function(t){return e._eventTypeContains(t,K().moveName)},e._eventTypeContains=function(e,t){var n=t.split(",");e=e.toLowerCase();for(var o=0,r=n.length;o<r;o++){var i=n[o].trim().toLowerCase();if(e.indexOf(i)>-1)return!0}return!1},e._registerTouchInfo=function(t){if(e._isTouchEvent(t))if(t instanceof TouchEvent){e._allTouchInfos=[];for(var n=0,o=t.touches.length;n<o;n++)e._allTouchInfos.push(new be(t.touches.item(n)))}else if(t instanceof PointerEvent){if(e._allTouchInfos=e._allTouchInfos||[],e._isTouchEnd(t.type)){for(var r=0,o=e._allTouchInfos.length;r<o;r++)if(e._allTouchInfos[r].id==t.pointerId)return void e._allTouchInfos.splice(r,1);return}for(var r=0,o=e._allTouchInfos.length;r<o;r++)if(e._allTouchInfos[r].id==t.pointerId)return void(e._allTouchInfos[r]=new be(t));e._allTouchInfos.push(new be(t))}},e.prototype.onPinch=function(e){this.pinch.raise(this,e)},e.prototype.onSwipe=function(e){this.swipe.raise(this,e)},e.prototype.onTouchEnd=function(e){this.touchEnd.raise(this,e)},e.prototype.onTouchStart=function(e){this.touchStart.raise(this,e)},e.prototype.onTouchMove=function(e){this.touchMove.raise(this,e)},e.prototype.onPanEnd=function(e){this.panEnd.raise(this,e)},e.prototype.onPanStart=function(e){this.panStart.raise(this,e)},e.prototype.onPanMove=function(e){this.panMove.raise(this,e)},Object.defineProperty(e.prototype,"removeDefaultTouch",{get:function(){return this._removeDefaultTouch},set:function(e){this._removeDefaultTouch=e;var t=this.hostElement.style;e?(t.touchAction="none",t.msTouchAction="none"):(t.touchAction=this._defaultTouchAction,t.msTouchAction=this._defaultMsTouchAction)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hostElement",{get:function(){return this._pinchTrigger.hostElement},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentElement",{get:function(){return this.hostElement.children.length?this.hostElement.children[0]:null},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this._pinchTrigger&&this._pinchTrigger.dispose(),this._trigger&&this._trigger.dispose(),this.removeDefaultTouch&&(this.removeDefaultTouch=!1)},e._touchPointerName="touch",e._allTouchInfos=[],e}();t._TouchManager=Oe;var He=function(e){function t(t){var r=e.call(this,t)||this;r._uiUpdating=!1;n.assert(null!=o.ComboBox,"Missing dependency: _PageSetupEditor requires wijmo.input.");var i;i=r.getTemplate(),r.applyTemplate("wj-control",i,{_divPaperKind:"div-paper-kind",_divOrientation:"div-page-orientation",_divMarginsLeft:"div-margins-left",_divMarginsRight:"div-margins-right",_divMarginsTop:"div-margins-top",_divMarginsBottom:"div-margins-bottom",_gPaperKind:"g-paperkind",_gOrientation:"g-orientation",_gMargins:"g-margins",_gLeft:"g-left",_gRight:"g-right",_gTop:"g-top",_gBottom:"g-bottom"});var a={format:"n2",min:0,max:4,step:.25,valueChanged:r._updateValue.bind(r)};return r._numMarginsLeft=new o.InputNumber(r._divMarginsLeft,a),r._numMarginsRight=new o.InputNumber(r._divMarginsRight,a),r._numMarginsTop=new o.InputNumber(r._divMarginsTop,a),r._numMarginsBottom=new o.InputNumber(r._divMarginsBottom,a),r._cmbPaperKind=new o.ComboBox(r._divPaperKind,{itemsSource:h(se),displayMemberPath:"text",selectedValuePath:"value",isEditable:!1}),r._cmbPaperKind.selectedIndexChanged.addHandler(r._updateValue,r),r._cmbOrientation=new o.ComboBox(r._divOrientation,{itemsSource:[n.culture.Viewer.portrait,n.culture.Viewer.landscape],isEditable:!1}),r._cmbOrientation.selectedIndexChanged.addHandler(r._updateValue,r),r._globalize(),r}return __extends(t,e),Object.defineProperty(t.prototype,"pageSettings",{get:function(){return this._pageSettings},set:function(e){var t=l(e);this._pageSettings=t,this._updateUI(),this._cmbPaperKind.focus()},enumerable:!0,configurable:!0}),t.prototype._globalize=function(){var e=n.culture.Viewer;this._gPaperKind.textContent=e.paperKind,this._gOrientation.textContent=e.orientation,this._gMargins.textContent=e.margins,this._gLeft.textContent=e.left,this._gRight.textContent=e.right,this._gTop.textContent=e.top,this._gBottom.textContent=e.bottom;var t=this._cmbOrientation.selectedIndex;this._cmbOrientation.itemsSource=[n.culture.Viewer.portrait,n.culture.Viewer.landscape],this._cmbOrientation.selectedIndex=t},t.prototype._updateValue=function(){if(!this._uiUpdating){var e=this.pageSettings;e&&(e.bottomMargin=new re(this._numMarginsBottom.value,oe.Inch),e.leftMargin=new re(this._numMarginsLeft.value,oe.Inch),e.rightMargin=new re(this._numMarginsRight.value,oe.Inch),e.topMargin=new re(this._numMarginsTop.value,oe.Inch),e.paperSize=this._cmbPaperKind.selectedValue,c(e,this._cmbOrientation.text===n.culture.Viewer.landscape),this._updateUI())}},t.prototype._updateUI=function(){this._uiUpdating=!0;var e=this.pageSettings,t=function(e,t){e.value=re.convertValue(t.value,t.units,oe.Inch)};e&&(this._cmbPaperKind.selectedValue=e.paperSize,this._cmbOrientation.text=e.landscape?n.culture.Viewer.landscape:n.culture.Viewer.portrait,t(this._numMarginsLeft,e.leftMargin),t(this._numMarginsRight,e.rightMargin),t(this._numMarginsTop,e.topMargin),t(this._numMarginsBottom,e.bottomMargin)),this._uiUpdating=!1},t.prototype.refresh=function(t){void 0===t&&(t=!0),e.prototype.refresh.call(this,t),t&&this._globalize()},t.controlTemplate='<div><div style="padding:12px;"><table style="table-layout:fixed"><tr><td wj-part="g-paperkind"></td><td><div wj-part="div-paper-kind"></div></td></tr><tr><td wj-part="g-orientation"></td><td><div wj-part="div-page-orientation"></div></td></tr></table><fieldset style="margin-top: 12px"><legend wj-part="g-margins"></legend><table style="table-layout:fixed"><tr><td wj-part="g-left"></td><td><div wj-part="div-margins-left"></div></td></tr><tr><td wj-part="g-right"></td><td><div wj-part="div-margins-right"></div></td></tr><tr><td wj-part="g-top"></td><td><div wj-part="div-margins-top"></div></td></tr><tr><td wj-part="g-bottom"></td><td><div wj-part="div-margins-bottom"></div></td></tr></table></fieldset></div></div>',t}(n.Control);t._PageSetupEditor=He;var Ne=function(e){function t(t){var o=e.call(this,t)||this;return o._options={},o._optionLabels=null,o._groupTitleField=null,n.addClass(t,"wj-export-editor"),o}return __extends(t,e),Object.defineProperty(t.prototype,"options",{get:function(){return this._options},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"exportDescription",{get:function(){return this._exportDescription},set:function(e){this._exportDescription=e,this._options={},e&&(this._options.format=this.exportDescription.format,this._render())},enumerable:!0,configurable:!0}),t.prototype._skipOption=function(e){return t._skippedOptions.indexOf(e)>=0},t.prototype._render=function(){if(p(this.hostElement),this.exportDescription){document.createElement("table");var e=this.exportDescription.optionDescriptions,n={};if(e)for(var o=0;o<e.length;o++){var r=e[o];this._skipOption(r.name)||(r.group?(n[r.group]||(n[r.group]=[]),n[r.group].push(r)):(n[t._generalGroupName]||(n[t._generalGroupName]=[]),r.group=t._generalGroupName,n[t._generalGroupName].push(r)))}for(var i in n)this.hostElement.appendChild(this._generateGroup(n[i]));this._updateEditors()}},t.prototype._generateEditor=function(e){var o;if(n.isArray(e.allowedValues))o=this._generateComboEditor(e);else switch(e.type){case"bool":o=this._generateBoolEditor(e);break;case"int":case"float":o=this._generateNumberEditor(e);break;case"unit":e.defaultValue=new re(e.defaultValue);case"string":default:o=this._generateStringEditor(e)}return o.setAttribute(t._optionIdAttr,e.name),o},t.prototype._generateComboEditor=function(e){for(var t,n=this,r=[],i=document.createElement("div"),a=0;a<e.allowedValues.length;a++)r.push(e.allowedValues[a]);return t=new o.ComboBox(i),t.isEditable=!1,t.itemsSource=r,t.selectedValue=e.defaultValue,t.selectedIndexChanged.addHandler(function(t){n._setOptionValue(e.name,t.selectedValue.toString())}),i},t.prototype._generateBoolEditor=function(e){var t,r=this;if(e.nullable){t=document.createElement("div");var i=new o.ComboBox(t),a=[];i.isEditable=!1,i.displayMemberPath="name",i.selectedValuePath="value",a.push({name:"None",value:null}),a.push({name:"True",value:!0}),a.push({name:"False",value:!1}),i.itemsSource=a,i.selectedValue=e.defaultValue,i.selectedIndexChanged.addHandler(function(t){r._setOptionValue(e.name,t.selectedValue),r._updateEditors(e.name)})}else{(t=document.createElement("input")).type="checkbox";var s=n.changeType(e.defaultValue,n.DataType.Boolean,null);t.checked=s,_(t,"click",function(){r._setOptionValue(e.name,t.checked),r._updateEditors(e.name)})}return t},t.prototype._generateNumberEditor=function(e){var t,n,r=this,i="int"===e.type;return t=document.createElement("div"),n=new o.InputNumber(t),n.format=i?"n0":"n2",n.isRequired=!e.nullable,n.value=e.defaultValue,n.valueChanged.addHandler(function(t){r._setOptionValue(e.name,t.value)}),t},t.prototype._generateStringEditor=function(e){var t,n=this;return t=document.createElement("input"),e.name.match(/password/i)?t.type="password":t.type="text",t.value=e.defaultValue,_(t,"change,keyup,paste,input",function(){n._setOptionValue(e.name,t.value)}),t},t.prototype._generateGroup=function(e){var o=document.createElement("fieldset"),r=document.createElement("legend"),i=e[0].group;n.addClass(o,"wj-exportformats-group"),r.innerHTML=this._groupTitle[i],r.setAttribute(t._optionNameAttr,i),o.appendChild(r);for(var a=document.createElement("table"),s=0;s<e.length;s++){var u=e[s],c=document.createElement("tr"),l=document.createElement("td"),h=document.createElement("td");l.innerHTML=this._getOptionLabel(u.name),l.setAttribute(t._optionNameAttr,u.name),h.appendChild(this._generateEditor(u)),c.appendChild(l),c.appendChild(h),a.appendChild(c)}return o.appendChild(a),o},t.prototype._updateEditors=function(e){if("pdfACompatible"!==e&&e){if("paged"===e||!e){var o=this.hostElement.querySelector("["+t._optionIdAttr+'="showNavigator"]');if(o){var r=n.changeType(this._getOptionValue("paged"),n.DataType.Boolean,null);r?(o.checked=this._previousShowNavigator,this._setOptionValue("showNavigator",this._previousShowNavigator)):(this._previousShowNavigator=o.checked,o.checked=!1,this._setOptionValue("showNavigator",!1)),o.disabled=!r}}}else{var i=this.hostElement.querySelector("["+t._optionIdAttr+'="embedFonts"]');if(i){var a=n.changeType(this._getOptionValue("pdfACompatible"),n.DataType.Boolean,null);a?(this._previousEmbedFonts=i.checked,i.checked=!0,this._setOptionValue("embedFonts",!0)):(i.checked=this._previousEmbedFonts,this._setOptionValue("embedFonts",this._previousEmbedFonts)),i.disabled=a}}},t.prototype._getOptionLabel=function(e){var t=this._optionLabelsText[e];return t||e[0].toUpperCase()+e.substring(1)},t.prototype._getOptionDescByName=function(e){var t=null;return this._exportDescription.optionDescriptions.some(function(n){return n.name===e&&(t=n,!0)}),t},t.prototype._getOptionValue=function(e){return void 0!==this._options[e]?this._options[e]:this._getOptionDescByName(e).defaultValue},t.prototype._setOptionValue=function(e,t){var n=this._getOptionDescByName(e),o=n.defaultValue;"unit"===n.type&&(o=n.defaultValue.toString()),t!==o?this._options[e]=t:void 0!==this._options[e]&&delete this._options[e]},Object.defineProperty(t.prototype,"_optionLabelsText",{get:function(){if(!this._optionLabels){var e=n.culture.Viewer;this._optionLabels={title:e.docInfoTitle,author:e.docInfoAuthor,manager:e.docInfoManager,operator:e.docInfoOperator,company:e.docInfoCompany,subject:e.docInfoSubject,comment:e.docInfoComment,creator:e.docInfoCreator,producer:e.docInfoProducer,creationTime:e.docInfoCreationTime,revisionTime:e.docInfoRevisionTime,keywords:e.docInfoKeywords,embedFonts:e.embedFonts,pdfACompatible:e.pdfACompatible,useCompression:e.useCompression,useOutlines:e.useOutlines,allowCopyContent:e.allowCopyContent,allowEditAnnotations:e.allowEditAnnotations,allowEditContent:e.allowEditContent,allowPrint:e.allowPrint,ownerPassword:e.ownerPassword,userPassword:e.userPassword,encryptionType:e.encryptionType,paged:e.paged,showNavigator:e.showNavigator,navigatorPosition:e.navigatorPosition,singleFile:e.singleFile,tolerance:e.tolerance,pictureLayer:e.pictureLayer,metafileType:e.metafileType,monochrome:e.monochrome,resolution:e.resolution,outputRange:e.outputRange,outputRangeInverted:e.outputRangeInverted}}return this._optionLabels},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_groupTitle",{get:function(){return this._groupTitleField||(this._groupTitleField={documentRestrictions:n.culture.Viewer.documentRestrictionsGroup,passwordSecurity:n.culture.Viewer.passwordSecurityGroup,outputRange:n.culture.Viewer.outputRangeGroup,documentInfo:n.culture.Viewer.documentInfoGroup,general:n.culture.Viewer.generalGroup}),this._groupTitleField},enumerable:!0,configurable:!0}),t.prototype._globalize=function(){for(var e=this.hostElement.querySelectorAll("["+t._optionNameAttr+"]"),n=0;n<e.length;n++){var o=e[n];o instanceof HTMLLegendElement?o.innerHTML=this._groupTitle[o.getAttribute(t._optionNameAttr)]:o.innerHTML=this._getOptionLabel(o.getAttribute(t._optionNameAttr))}},t.prototype.refresh=function(t){void 0===t&&(t=!0),e.prototype.refresh.call(this,t),t&&(this._optionLabels=null,this._groupTitleField=null,this._globalize())},t._optionIdAttr="option-id",t._optionNameAttr="option-name",t._skippedOptions=["shapesWord2007Compatible","sheetName","navigatorPositions"],t._generalGroupName="general",t}(n.Control);t._ExportOptionEditor=Ne;var Fe=function(e){function o(t){var o=e.call(this,t)||this;o._disposed=!1,o.svgButtonClicked=new n.Event;var r;return r=o.getTemplate(),o.applyTemplate("wj-toolbar",r,{_toolbarWrapper:"toolbar-wrapper",_toolbarContainer:"toolbar-container",_toolbarLeft:"toolbar-left",_toolbarRight:"toolbar-right"}),_(o._toolbarLeft,"mouseover",function(){o._scrollLeft()}),_(o._toolbarLeft,"mouseout",function(){o._clearToolbarMoveTimer()}),_(o._toolbarRight,"mouseover",function(){o._scrollRight()}),_(o._toolbarRight,"mouseout",function(){o._clearToolbarMoveTimer()}),o}return __extends(o,e),o.prototype.applyTemplate=function(e,t,o){var r=this.hostElement;if(n.addClass(r,e),r.appendChild(d(t)),o)for(var i in o){var a=o[i];if(this[i]=r.querySelector('[wj-part="'+a+'"]'),null==this[i]&&r.getAttribute("wj-part")==a&&(this[i]=t),null==this[i])throw'Missing template part: "'+a+'"'}return r},o.prototype.dispose=function(){this._disposed=!0,e.prototype.dispose.call(this)},o.prototype._clearToolbarMoveTimer=function(){null!=this._toolbarMoveTimer&&(clearTimeout(this._toolbarMoveTimer),this._toolbarMoveTimer=null)},o.prototype._scrollRight=function(){var e=this,t=this._toolbarContainer.offsetWidth-this._toolbarWrapper.offsetWidth,n=this._toolbarWrapper.style,r=(n.left?parseInt(n.left):0)-o._moveStep;this._checkMoveButtonEnabled(),r<t||(n.left=r+"px",this._toolbarMoveTimer=setTimeout(function(){return e._scrollRight()},o._moveInterval))},o.prototype._scrollLeft=function(){var e=this,t=this._toolbarWrapper.style,n=(t.left?parseInt(t.left):0)+o._moveStep;this._checkMoveButtonEnabled(),n>0||(t.left=n+"px",this._toolbarMoveTimer=setTimeout(function(){return e._scrollLeft()},o._moveInterval))},o.prototype._checkMoveButtonEnabled=function(){var e=this._toolbarLeft.getBoundingClientRect().width,t=this._toolbarWrapper.offsetLeft-e+o._moveStep,r=t<=0,i=n.hasClass(this._toolbarLeft,o._enabledCss);r?i||n.addClass(this._toolbarLeft,o._enabledCss):i&&n.removeClass(this._toolbarLeft,o._enabledCss);var a=this._toolbarRight.getBoundingClientRect().width,s=this._toolbarContainer.getBoundingClientRect().width-this._toolbarWrapper.getBoundingClientRect().width,u=(t=this._toolbarWrapper.offsetLeft-a-o._moveStep)>=s,c=n.hasClass(this._toolbarRight,o._enabledCss);u?c||n.addClass(this._toolbarRight,o._enabledCss):c&&n.removeClass(this._toolbarRight,o._enabledCss)},o.prototype._showToolbarMoveButton=function(e){var t=e?"visible":"hidden";this._toolbarLeft.style.visibility=t,this._toolbarRight.style.visibility=t,this._checkMoveButtonEnabled()},o.prototype._globalize=function(){},o.prototype.resetWidth=function(){var e=this._toolbarLeft.getBoundingClientRect().width,t=this._toolbarRight.getBoundingClientRect().width,n=this.hostElement.getBoundingClientRect().width;this._toolbarContainer.style.width="1500px",this._toolbarWrapper.style.width="auto";var o=this._toolbarWrapper.getBoundingClientRect().width+2;this._toolbarWrapper.style.width=o+"px",this._toolbarContainer.style.width=n-e-t+"px";var r=e+t+o>n;this._showToolbarMoveButton(r),r||(this._toolbarWrapper.style.left="0px")},o.prototype.addSeparator=function(){var e=document.createElement("span");return e.className="wj-separator",this._toolbarWrapper.appendChild(e),e},o.prototype.onSvgButtonClicked=function(e){this.svgButtonClicked.raise(this,e)},o.prototype.addCustomItem=function(e,o){n.isString(e)&&(e=g(e)),null!=o&&e.setAttribute(t._commandTagAttr,o.toString()),this._toolbarWrapper.appendChild(e)},o.prototype.addSvgButton=function(e,o,r,i){var a=this,s=u(o);return s.title=e,s.setAttribute(t._commandTagAttr,r.toString()),this._toolbarWrapper.appendChild(s),_(s,"click,keydown",function(e){var t=e||window.event;!("keydown"===t.type&&t.keyCode===n.Key.Enter||"click"===t.type)||w(s)||!i&&b(s)||a.onSvgButtonClicked({commandTag:r})}),s},o.prototype.refresh=function(t){void 0===t&&(t=!0),e.prototype.refresh.call(this,t),t&&this._globalize()},o._moveStep=4,o._moveInterval=5,o._enabledCss="enabled",o.controlTemplate='<div class="wj-toolbar-move left" wj-part="toolbar-left"><span class="wj-glyph-left"></span></div><div class="wj-toolbarcontainer" wj-part="toolbar-container"><div class="wj-toolbarwrapper wj-btn-group" wj-part="toolbar-wrapper"></div></div><div class="wj-toolbar-move right" wj-part="toolbar-right"><span class="wj-glyph-right"></span></div>',o}(n.Control);t._Toolbar=Fe;var Be=function(e){function t(t,n){var o=e.call(this,t)||this;o._viewer=n,o._initToolbarItems();var r=function(){return o.isDisabled=!o._viewer._getDocumentSource()};return o._viewer._documentSourceChanged.addHandler(r),r(),o._viewer._viewerActionStatusChanged.addHandler(function(e,t){var n=t.action,r=o.hostElement.querySelector('[command-tag="'+n.actionType.toString()+'"]');f(r,n.checked),v(r,n.disabled),y(r,n.shown),x(o._toolbarWrapper)}),o}return __extends(t,e),t.prototype._initToolbarItems=function(){throw n.culture.Viewer.abstractMethodException},t.prototype.onSvgButtonClicked=function(t){e.prototype.onSvgButtonClicked.call(this,t),this._viewer._executeAction(parseInt(t.commandTag))},Object.defineProperty(t.prototype,"viewer",{get:function(){return this._viewer},enumerable:!0,configurable:!0}),t._initToolbarZoomValue=function(e,t){var r,i,a,s,u=n.Control.getControl(e),c=document.createElement("div"),l=dt._defaultZoomValues;c.className="wj-input-zoom",u.addCustomItem(c,_t.ZoomValue),(r=new o.ComboBox(c)).deferUpdate(function(){for(a=0;a<l.length;a++)for(s=a+1;s<l.length;s++)l[a].value>l[s].value&&(i=l[a],l[a]=l[s],l[s]=i);r.itemsSource=l,r.isEditable=!0,r.displayMemberPath="name",r.selectedValuePath="value",r.selectedValue=1}),r.selectedIndexChanged.addHandler(function(){if(r.isDroppedDown){var e=r.selectedValue;if(null==e){var n=r.text.replace(",","");e=parseFloat(n),isNaN(e)&&(e=100),e*=.01}t.zoomFactor=e}}),_(c,"keypress",function(e){var o,i=e||window.event,a=r.text;i.keyCode===n.Key.Enter&&(a.lastIndexOf("%")===a.length-1&&(a=a.substring(0,r.text.length-1)),a=a.replace(",",""),o=parseFloat(a),isNaN(o)?r.text=n.Globalize.format(t.zoomFactor,"p0"):t.zoomFactor=.01*o)}),_(c.querySelector(".wj-form-control"),"blur",function(e){r.text=n.Globalize.format(t.zoomFactor,"p0")}),t.zoomFactorChanged.addHandler(function(){r.isDroppedDown=!1,r.text=n.Globalize.format(t.zoomFactor,"p0")})},t._initToolbarPageNumberInput=function(e,t){var r,i=n.Control.getControl(e),a=document.createElement("div"),s=document.createElement("span"),u=function(){var e=t._getDocumentSource();e&&null!=e.pageCount&&(r.value=t.pageIndex+1)},c=function(){var e=t._getDocumentSource();e&&null!=e.pageCount&&(s.innerHTML=e.pageCount.toString(),r.max=e.pageCount,r.min=Math.min(e.pageCount,1),u())},l=function(){var e=t._getDocumentSource();e&&(c(),P(t._documentEventKey,e.pageCountChanged,c),P(t._documentEventKey,e.loadCompleted,c))};a.className="wj-pagenumber",i.addCustomItem(a,_t.PageNumber),(r=new o.InputNumber(a)).format="n0",_(a,"keyup",function(e){(e||window.event).keyCode===n.Key.Enter&&t.moveToPage(r.value-1)}),_(r.inputElement,"blur",function(e){t.moveToPage(r.value-1)}),i.addCustomItem('<span class="slash">/</span>'),s.className="wj-pagecount",i.addCustomItem(s,_t.PageCountLabel),t.pageIndexChanged.addHandler(u),t._getDocumentSource()&&l(),t._documentSourceChanged.addHandler(l)},t}(Fe);t._ViewerToolbarBase=Be;var ze=function(e){function o(t,n){return e.call(this,t,n)||this}return __extends(o,e),o.prototype._globalize=function(){var e=n.culture.Viewer;this._gPaginated.title=e.paginated,this._gPrint.title=e.print,this._gExports.title=e.exports,this._gPortrait.title=e.portrait,this._gLandscape.title=e.landscape,this._gPageSetup.title=e.pageSetup,this._gFirstPage.title=e.firstPage,this._gPreviousPage.title=e.previousPage,this._gNextPage.title=e.nextPage,this._gLastPage.title=e.lastPage,this._gBackwardHistory.title=e.backwardHistory,this._gForwardHistory.title=e.forwardHistory,this._gSelectTool.title=e.selectTool,this._gMoveTool.title=e.moveTool,this._gContinuousMode.title=e.continuousMode,this._gSingleMode.title=e.singleMode,this._gWholePage.title=e.wholePage,this._gPageWidth.title=e.pageWidth,this._gZoomOut.title=e.zoomOut,this._gZoomIn.title=e.zoomIn,this._gRubberbandTool.title=e.rubberbandTool,this._gMagnifierTool.title=e.magnifierTool,this._gRotateDocument.title=e.rotateDocument,this._gRotatePage.title=e.rotatePage,this._gFullScreen.title=e.fullScreen},o.prototype._initToolbarItems=function(){var e=n.culture.Viewer;this._gPaginated=this.addSvgButton(e.paginated,t.icons.paginated,_t.TogglePaginated,!0),this._gPrint=this.addSvgButton(e.print,t.icons.print,_t.Print),this._gExports=this.addSvgButton(e.exports,t.icons.exports,_t.ShowExportsPanel),this.addSeparator(),this._gPortrait=this.addSvgButton(e.portrait,t.icons.portrait,_t.Portrait),this._gLandscape=this.addSvgButton(e.landscape,t.icons.landscape,_t.Landscape),this._gPageSetup=this.addSvgButton(e.pageSetup,t.icons.pageSetup,_t.ShowPageSetupDialog),this.addSeparator(),this._gFirstPage=this.addSvgButton(e.firstPage,t.icons.firstPage,_t.FirstPage),this._gPreviousPage=this.addSvgButton(e.previousPage,t.icons.previousPage,_t.PrePage),this._gNextPage=this.addSvgButton(e.nextPage,t.icons.nextPage,_t.NextPage),this._gLastPage=this.addSvgButton(e.lastPage,t.icons.lastPage,_t.LastPage),Be._initToolbarPageNumberInput(this.hostElement,this.viewer),this.addSeparator(),this._gBackwardHistory=this.addSvgButton(e.backwardHistory,t.icons.backwardHistory,_t.Backward),this._gForwardHistory=this.addSvgButton(e.forwardHistory,t.icons.forwardHistory,_t.Forward),this.addSeparator(),this._gSelectTool=this.addSvgButton(e.selectTool,t.icons.selectTool,_t.SelectTool),this._gMoveTool=this.addSvgButton(e.moveTool,t.icons.moveTool,_t.MoveTool),this._gContinuousMode=this.addSvgButton(e.continuousMode,t.icons.continuousView,_t.Continuous),this._gSingleMode=this.addSvgButton(e.singleMode,t.icons.singleView,_t.Single),this.addSeparator(),this._gWholePage=this.addSvgButton(e.wholePage,t.icons.fitWholePage,_t.FitWholePage),this._gPageWidth=this.addSvgButton(e.pageWidth,t.icons.fitPageWidth,_t.FitPageWidth),this._gZoomOut=this.addSvgButton(e.zoomOut,t.icons.zoomOut,_t.ZoomOut),this._gZoomIn=this.addSvgButton(e.zoomIn,t.icons.zoomIn,_t.ZoomIn),this._gRubberbandTool=this.addSvgButton(e.rubberbandTool,t.icons.rubberbandTool,_t.RubberbandTool),this._gMagnifierTool=this.addSvgButton(e.magnifierTool,t.icons.magnifierTool,_t.MagnifierTool),this._gRotateDocument=this.addSvgButton(e.rotateDocument,t.icons.rotateDocument,_t.RotateDocument),this._gRotatePage=this.addSvgButton(e.rotatePage,t.icons.rotatePage,_t.RotatePage),Be._initToolbarZoomValue(this.hostElement,this.viewer),this._gFullScreen=this.addSvgButton(e.fullScreen,t.icons.fullScreen,_t.ToggleFullScreen,!0)},o}(Be);t._ViewerToolbar=ze;var Le=function(e){function o(t,n){return e.call(this,t,n)||this}return __extends(o,e),o.prototype._initToolbarItems=function(){var e=n.culture.Viewer;this._gPrint=this.addSvgButton(e.print,t.icons.print,_t.Print),this.addSeparator(),this._gPreviousPage=this.addSvgButton(e.previousPage,t.icons.previousPage,_t.PrePage),this._gNextPage=this.addSvgButton(e.nextPage,t.icons.nextPage,_t.NextPage),Be._initToolbarPageNumberInput(this.hostElement,this.viewer),this.addSeparator(),this._gZoomOut=this.addSvgButton(e.zoomOut,t.icons.zoomOut,_t.ZoomOut),this._gZoomIn=this.addSvgButton(e.zoomIn,t.icons.zoomIn,_t.ZoomIn),this._gExitFullScreen=this.addSvgButton(e.exitFullScreen,t.icons.exitFullScreen,_t.ToggleFullScreen,!0)},o.prototype._globalize=function(){var e=n.culture.Viewer;this._gPrint.title=e.print,this._gPreviousPage.title=e.previousPage,this._gNextPage.title=e.nextPage,this._gZoomOut.title=e.zoomOut,this._gZoomIn.title=e.zoomIn,this._gExitFullScreen.title=e.exitFullScreen},o}(Be);t._ViewerMiniToolbar=Le;var We=function(e){function t(t,o){var r=e.call(this,t,o)||this;return n.addClass(r.hostElement,"mobile"),r}return __extends(t,e),t}(Be);t._ViewerMobileToolbarBase=We;var Ue=function(e){function o(t,n){return e.call(this,t,n)||this}return __extends(o,e),o.prototype._initToolbarItems=function(){var e=n.culture.Viewer;this._gShowHamburgerMenu=this.addSvgButton(e.hamburgerMenu,t.icons.hamburgerMenu,_t.ShowHamburgerMenu),this.viewer._initHamburgerMenu(this._gShowHamburgerMenu),this._gPrevPage=this.addSvgButton(e.previousPage,t.icons.previousPage,_t.PrePage),this._gNextPage=this.addSvgButton(e.nextPage,t.icons.nextPage,_t.NextPage),Be._initToolbarPageNumberInput(this.hostElement,this.viewer),this._gShowViewMenu=this.addSvgButton(e.viewMenu,t.icons.viewMenu,_t.ShowViewMenu),this.viewer._initViewMenu(this._gShowViewMenu),this._gShowSearchBar=this.addSvgButton(e.showSearchBar,t.icons.search,_t.ShowSearchBar,!0),this._gFullScreen=this.addSvgButton(e.fullScreen,t.icons.fullScreen,_t.ToggleFullScreen,!0)},o.prototype._globalize=function(){var e=n.culture.Viewer;this._gShowHamburgerMenu.title=e.hamburgerMenu,this._gPrevPage.title=e.previousPage,this._gNextPage.title=e.nextPage,this._gShowViewMenu.title=e.viewMenu,this._gShowSearchBar.title=e.showSearchBar,this._gFullScreen.title=e.fullScreen},o}(We);t._ViewerMobileToolbar=Ue;var qe=function(e){function o(t,o){var r=e.call(this,t,o)||this;return n.addClass(r.hostElement,"wj-zoombar"),r}return __extends(o,e),o.prototype._initToolbarItems=function(){var e=n.culture.Viewer;this._gZoomOut=this.addSvgButton(e.zoomOut,t.icons.zoomOut,_t.ZoomOut),Be._initToolbarZoomValue(this.hostElement,this.viewer),this._gZoomIn=this.addSvgButton(e.zoomIn,t.icons.zoomIn,_t.ZoomIn)},o.prototype._globalize=function(){var e=n.culture.Viewer;this._gZoomOut.title=e.zoomOut,this._gZoomIn.title=e.zoomIn},o}(We);t._ViewerZoomBar=qe;var Ke=function(e){function o(t,n){return e.call(this,t,n)||this}return __extends(o,e),o.prototype._initToolbarItems=function(){var e=n.culture.Viewer;this._gSearchOptions=this.addSvgButton(e.searchOptions,t.icons.searchOptions,_t.ShowSearchOptions),this.viewer._initSearchOptionsMenu(this._gSearchOptions),this._initSearchInput(),this._initSearchBtnGroups()},o.prototype._initSearchInput=function(){var e=this,n=g('<div class="wj-searchcontainer"><input class="wj-searchbox" wj-part="search-box" type="text"/><div class="wj-btn-group"><button class="wj-btn wj-btn-search">'+u(t.icons.search).innerHTML+"</button></div></div>"),o=n.querySelector('input[type="text"]'),r=n.querySelector(".wj-btn-search");_(o,"input",function(){e.viewer._searchManager.text=o.value}),_(r,"click",function(){e.viewer._searchManager.search()}),this.viewer._searchManager.searchStarted.addHandler(function(){o.disabled=!0}),this.viewer._searchManager.searchCompleted.addHandler(function(){o.disabled=!1}),this.addCustomItem(n)},o.prototype._initSearchBtnGroups=function(){var e=g('<div class="wj-searchbtn-groups wj-btn-group wj-toolbarwrapper"></div>'),o=n.culture.Viewer;this._gSearchPrev=this.addSvgButton(o.searchPrev,t.icons.searchLeft,_t.SearchPrev),this._gSearchNext=this.addSvgButton(o.searchNext,t.icons.searchRight,_t.SearchNext),e.appendChild(this._gSearchPrev),e.appendChild(this._gSearchNext),this.addCustomItem(e)},o.prototype._globalize=function(){var e=n.culture.Viewer;this._gSearchOptions.title=e.searchOptions,this._gSearchPrev.title=e.searchPrev,this._gSearchNext.title=e.searchNext},o}(We);t._SearchBar=Ke;var Ze;!function(e){e[e.NoRotate=0]="NoRotate",e[e.Rotation90=1]="Rotation90",e[e.Rotation180=2]="Rotation180",e[e.Rotation270=3]="Rotation270"}(Ze=t._RotateAngle||(t._RotateAngle={}));var Je=function(){function e(e,t,o){this._content=null,this._rotateAngle=Ze.NoRotate,this.linkClicked=new n.Event,this._documentSource=e,this._index=t,this._size=o}return Object.defineProperty(e.prototype,"index",{get:function(){return this._index},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rotateAngle",{get:function(){return this._rotateAngle},set:function(e){this._rotateAngle=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"content",{get:function(){return this._content},enumerable:!0,configurable:!0}),e.prototype.getContent=function(){var e=this,t=new ie,o=this._documentSource;return o?this._content?(t.resolve(this._content),t):(o.renderToFilter({format:"html",paged:o.paginated,outputRange:(this.index+1).toString()}).then(function(n){if(e._documentSource===o){var r=document.createElement("div");r.innerHTML=e._processSvgResponse(e._addGlobalUniqueId(n.responseText));for(var i=r.querySelector("svg"),a=document.createElementNS("http://www.w3.org/2000/svg","g");i.hasChildNodes();)a.appendChild(i.firstChild);i.appendChild(a),e._size={width:new re(i.width.baseVal.value),height:new re(i.height.baseVal.value)},e._content=i,e._processActionLinks(i,function(t){_(t,"click",function(){e._onLinkClicked(new lt(t))})}),t.resolve(e._content)}}),t):(t.reject(n.culture.Viewer.cannotRenderPageNoDoc),t)},e.prototype._processSvgResponse=function(e){return e},e.prototype._extractSize=function(e){if(e){var t=e.querySelector("svg");if(t)return{width:new re(t.width.baseVal.value),height:new re(t.height.baseVal.value)}}return null},e.prototype._onLinkClicked=function(e){this.linkClicked.raise(this,e)},e.prototype._processActionLinks=function(t,n){for(var o=t.querySelectorAll("a"),r=0;r<o.length;r++){var i=o.item(r),a=i.href?i.href.baseVal:"";if(a.indexOf("navigate")>0){var s=e._bookmarkReg.exec(a);s&&(s[1]&&s[1].length>0?(i.href.baseVal=e._invalidHref,i.setAttribute(e._bookmarkAttr,s[1]),n(i)):i.removeAttribute("xlink:href"))}else e._customActionReg.test(a)&&(i.href.baseVal=e._invalidHref,i.setAttribute(e._customActionAttr,a.substr(3)),n(i))}},e.prototype._addGlobalUniqueId=function(t){var n=(new Date).getTime().toString();return t=t.replace(e._idReg,"$1$2"+n+"$3$4"),t=t.replace(e._idReferReg,"$1$2"+n+"$3$4")},e._bookmarkReg=/javascript\:navigate\(['|"](.*)['|"]\)/,e._bookmarkAttr="bookmark",e._customActionReg=/^CA\:/,e._customActionAttr="customAction",e._idReg=/(\<[^\>]+)(id=['|"])(\w+)(['|"])/g,e._idReferReg=/(\<[^\>]+)(url\(#)(\w+)(\))/g,e._invalidHref="javascript:void(0)",e}();t._Page=Je;var Ge=function(e){function o(t){var o=e.call(this,t)||this;o._viewMode=ut.Single,o.pageIndexChanged=new n.Event,o.zoomFactorChanged=new n.Event,o.zoomModeChanged=new n.Event,o.positionChanged=new n.Event,o.rotateAngleChanged=new n.Event;var r;return r=o.getTemplate(),o.applyTemplate("wj-viewpanel-container",r,{_singlePageView:"single-pageview",_continuousPageView:"continuous-pageview"}),o._initPageView(),o}return __extends(o,e),o.prototype.applyTemplate=function(e,t,o){var r=this.hostElement;if(n.addClass(r,e),r.appendChild(d(t)),o)for(var i in o){var a=o[i];if(this[i]=r.querySelector('[wj-part="'+a+'"]'),null==this[i]&&r.getAttribute("wj-part")==a&&(this[i]=t),null==this[i])throw'Missing template part: "'+a+'"'}return r},Object.defineProperty(o.prototype,"pageIndex",{get:function(){return this._activePageView.pageIndex},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"pages",{get:function(){return this._activePageView.pages},set:function(e){this._activePageView.pages=e},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"zoomMode",{get:function(){return this._activePageView.zoomMode},set:function(e){this._activePageView.zoomMode=e},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"zoomFactor",{get:function(){return this._activePageView.zoomFactor},set:function(e){this._activePageView.zoomFactor=e},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"panMode",{get:function(){return this._activePageView.panMode},set:function(e){this._activePageView.panMode=e},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"viewMode",{get:function(){return this._viewMode},set:function(e){this._viewMode!==e&&(this._viewMode=e,this._updateActivePageView())},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"scrollTop",{get:function(){return this._activePageView.scrollTop},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"scrollLeft",{get:function(){return this._activePageView.scrollLeft},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"_activePageViewElement",{get:function(){return this.viewMode===ut.Single?this._singlePageView:this._continuousPageView},enumerable:!0,configurable:!0}),o.prototype.onPageIndexChanged=function(){this.pageIndexChanged.raise(this)},o.prototype.onZoomFactorChanged=function(e,t){this.zoomFactorChanged.raise(this,{oldValue:e,newValue:t})},o.prototype.onZoomModeChanged=function(e,t){this.zoomModeChanged.raise(this,{oldValue:e,newValue:t})},o.prototype.onPositionChanged=function(){this.positionChanged.raise(this)},o.prototype.onRotateAngleChanged=function(){this.rotateAngleChanged.raise(this)},o.prototype._updateActivePageView=function(){var e=this._activePageView.pageIndex,t=this._activePageView.pages,o=this._activePageView.zoomFactor,r=this._activePageView.zoomMode,i=this._activePageView.panMode;this._removePageViewHandlers(this._activePageView),this._activePageView=n.Control.getControl(this._activePageViewElement),this._addPageViewHandlers(this._activePageView),this._activePageView.pages||(this._activePageView.pages=t),this._activePageView.invalidate(),this._activePageView.moveToPage(e),this._activePageView.zoomFactor=o,this._activePageView.zoomMode=r,this._activePageView.panMode=i,this._updatePageViewsVisible()},o.prototype._initPageView=function(){this._activePageView=new $e(this._singlePageView),this._addPageViewHandlers(this._activePageView),new et(this._continuousPageView),this._updatePageViewsVisible()},o.prototype._addPageViewHandlers=function(e){var t=this;this._activePageView.pageIndexChanged.addHandler(function(){t.onPageIndexChanged()}),this._activePageView.zoomFactorChanged.addHandler(function(e,n){t.onZoomFactorChanged(n.oldValue,n.newValue)}),this._activePageView.zoomModeChanged.addHandler(function(e,n){t.onZoomModeChanged(n.oldValue,n.newValue)}),this._activePageView.positionChanged.addHandler(function(){t.onPositionChanged()}),this._activePageView.rotateAngleChanged.addHandler(function(){t.onRotateAngleChanged()})},o.prototype._removePageViewHandlers=function(e){e.pageIndexChanged.removeHandler(this.onPageIndexChanged,this),e.zoomFactorChanged.removeHandler(this.onZoomFactorChanged,this),e.zoomModeChanged.removeHandler(this.onZoomModeChanged,this),e.positionChanged.removeHandler(this.onPositionChanged,this),e.rotateAngleChanged.removeHandler(this.onRotateAngleChanged,this)},o.prototype._updatePageViewsVisible=function(){this.viewMode===ut.Single?(n.removeClass(this._singlePageView,t._hiddenCss),n.hasClass(this._continuousPageView,t._hiddenCss)||n.addClass(this._continuousPageView,t._hiddenCss)):(n.removeClass(this._continuousPageView,t._hiddenCss),n.hasClass(this._singlePageView,t._hiddenCss)||n.addClass(this._singlePageView,t._hiddenCss))},o.prototype.moveToPage=function(e){return this._activePageView.moveToPage(e)},o.prototype.moveToPosition=function(e){return this._activePageView.moveToPosition(e)},o.prototype.rotatePageTo=function(e,t){this._activePageView.rotatePageTo(e,t)},o.prototype.hitTest=function(e,t){return this._activePageView.hitTest(e,t)},o.prototype.resetPages=function(){n.Control.getControl(this._singlePageView).resetPages(),n.Control.getControl(this._continuousPageView).resetPages()},o.prototype.refresh=function(t){void 0===t&&(t=!0),e.prototype.refresh.call(this,t),n.Control.getControl(this._activePageViewElement).invalidate(),this._activePageView.refresh()},o.prototype.isPageContentLoaded=function(e){return this._activePageView.isPageContentLoaded(e)},o.controlTemplate='<div class="wj-pageview" wj-part="single-pageview"></div><div class="wj-pageview" wj-part="continuous-pageview"></div>',o}(n.Control);t._CompositePageView=Ge;var Xe=function(e){function t(t){var o=e.call(this,t)||this;o._autoHeightCalculated=!1,o._startX=null,o._startY=null,o._panMode=!1,o._pageIndex=-1,o._zoomFactor=1,o._zoomMode=ct.Custom,o._zoomModeUpdating=!1,o.pageIndexChanged=new n.Event,o.zoomFactorChanged=new n.Event,o.zoomModeChanged=new n.Event,o.positionChanged=new n.Event,o.rotateAngleChanged=new n.Event;var r;return r=o.getTemplate(),o.applyTemplate("wj-pageview",r,o._getTemplateParts()),o._fBorderBoxMode="border-box"===getComputedStyle(t).boxSizing,o._init(),o}return __extends(t,e),t.prototype._getTemplateParts=function(){return{_pagesWrapper:"pages-wrapper"}},t.prototype._getPagesContainer=function(){return this.hostElement},t.prototype._init=function(){this._bindEvents()},t.prototype.dispose=function(){this._touchManager&&this._touchManager.dispose(),e.prototype.dispose.call(this)},t.prototype._bindTouchEvents=function(e){var t=this;e.touchStart.addHandler(function(){t.hostElement.focus()}),e.panMove.addHandler(function(t,n){e.hostElement.scrollTop-=n.clientDelta.y,e.hostElement.scrollLeft-=n.clientDelta.x}),e.pinch.addHandler(this._zoomByPinch,this)},t.prototype._initTouchEvents=function(){var e=this._pagesWrapper.parentElement,t=new Oe(e);this._touchManager=t,this._bindTouchEvents(t)},Object.defineProperty(t.prototype,"_borderBoxMode",{get:function(){return this._fBorderBoxMode},enumerable:!0,configurable:!0}),t.prototype._zoomByPinch=function(e,t){if(t.preventDefault(),t.type==Se.Move){var o=n.getElementRect(e.contentElement),r=getComputedStyle(e.contentElement),i=parseInt(r.marginTop),a=parseInt(r.marginLeft),u=s(!1,t.preCenterClient,o.left-a,o.top-i);this._zoom(e.hostElement,t.zoom,u,t.centerClientDelta)}},t.prototype._getFixedPosition=function(e){return new n.Point(t._pageMargin,t._pageMargin+this._getAbovePageCount(e.y)*t._pageMargin)},t.prototype._getAbovePageCount=function(e){return 0},t.prototype._zoom=function(e,t,o,r){var i=s(!1,o,e.scrollLeft,e.scrollTop),a=this._getFixedPosition(o),u=this.zoomFactor;this.zoomFactor=this.zoomFactor*t;var c=this.zoomFactor/u,l=s(!1,new n.Point((o.x-a.x)*c+a.x,(o.y-a.y)*c+a.y),s(!0,i,r));e.scrollTop=Math.round(l.y),e.scrollLeft=Math.round(l.x)},Object.defineProperty(t.prototype,"pageIndex",{get:function(){return this._pageIndex},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pages",{get:function(){return this._pages},set:function(e){this._pages=e,this._reserveViewPage()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scrollTop",{get:function(){return this.hostElement.scrollTop},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scrollLeft",{get:function(){return this.hostElement.scrollLeft},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(e){if(e=Math.max(.05,Math.min(10,e)),this._zoomFactor!=e){var t=this._zoomFactor;this._zoomFactor=e,this._updatePageViewTransform(),this._zoomModeUpdating||(this.zoomMode=ct.Custom),this._onZoomFactorChanged(t,e)}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"zoomMode",{get:function(){return this._zoomMode},set:function(e){if(this._zoomMode!=e){this._zoomModeUpdating=!0;var t=this._zoomMode;this._calcZoomModeZoom(e),this._zoomMode=e,this._onZoomModeChanged(t,e),this._zoomModeUpdating=!1}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"panMode",{get:function(){return this._panMode},set:function(e){this._panMode!=e&&(this._panMode=e)},enumerable:!0,configurable:!0}),t.prototype._bindEvents=function(){var e=this;_(document,"mousemove",function(t){null!==e._startX&&null!==e._startY&&e._panning(t)}),_(document,"mouseup",function(t){e._stopPanning()}),this._initTouchEvents()},t.prototype._startPanning=function(e){this._startX=e.screenX,this._startY=e.screenY},t.prototype._panning=function(e){var t=this._getPagesContainer();t.scrollLeft+=this._startX-e.screenX,t.scrollTop+=this._startY-e.screenY,this._startX=e.screenX,this._startY=e.screenY},t.prototype._stopPanning=function(){this._startX=null,this._startY=null},t.prototype._onPageIndexChanged=function(){this.pageIndexChanged.raise(this)},t.prototype._onZoomFactorChanged=function(e,t){this.zoomFactorChanged.raise(this,{oldValue:e,newValue:t})},t.prototype._onZoomModeChanged=function(e,t){this.zoomModeChanged.raise(this,{oldValue:e,newValue:t})},t.prototype._onPositionChanged=function(){this.positionChanged.raise(this)},t.prototype._onRotateAngleChanged=function(){this.rotateAngleChanged.raise(this)},t.prototype._onPageLoaded=function(e){},t.prototype._renderViewPage=function(e,t){var o,r=this,i=new ie;if(t=t<0?0:t,!e)return i.reject(n.culture.Viewer.cannotRenderPageNoViewPage),i;if(p(e),this._pages[t].content){var a=this._pages[t].content;return e.appendChild(a),this._setPageTransform(e,t),i.resolve(t),i}return o=document.createElement("div"),o.className="wj-loading",o.style.height=e.style.height,o.style.lineHeight=e.style.height,o.innerHTML=n.culture.Viewer.loading,e.appendChild(o),this._pages[t].getContent().then(function(n){if(r.pages){var o=n;p(e),e.appendChild(o),r._setPageTransform(e,t),r._onPageLoaded(t),i.resolve(t)}}).catch(function(e){o.innerHTML=C(e)}),i},t.prototype._reserveViewPage=function(){throw n.culture.Viewer.abstractMethodException},t.prototype._getViewPortHeight=function(){var e=this._pagesWrapper.currentStyle||window.getComputedStyle(this._pagesWrapper);return this.hostElement.offsetHeight-parseFloat(e.marginBottom)-parseFloat(e.marginTop)},t.prototype._getViewPortWidth=function(){var e=this._pagesWrapper.currentStyle||window.getComputedStyle(this._pagesWrapper);return this.hostElement.offsetWidth-parseFloat(e.marginLeft)-parseFloat(e.marginRight)},t.prototype._setPageTransform=function(e,t){var n;if(e){var o=this._getPageSize(t),r=this._pages[t].rotateAngle;e.style.height=o.height.valueInPixel*this._zoomFactor+"px",e.style.width=o.width.valueInPixel*this._zoomFactor+"px",(n=e.querySelector("g"))&&(n.parentNode.setAttribute("height",o.height.valueInPixel*this._zoomFactor+"px"),n.parentNode.setAttribute("width",o.width.valueInPixel*this._zoomFactor+"px"),I(n.parentNode,this._pages[t].size.width.valueInPixel,this._pages[t].size.height.valueInPixel,this._zoomFactor,r))}},t.prototype._addViewPage=function(){var e=this,t=document.createElement("div");return t.className="wj-view-page",_(t,"mousedown",function(t){e._panMode&&e._startPanning(t)}),_(t,"dragstart",function(t){e._panMode&&t.preventDefault()}),this._pagesWrapper.appendChild(t),t},t.prototype._getPageSize=function(e){if(e<0||e>=this._pages.length)return null;var t=this._pages[e];return A(t.size,t.rotateAngle)},t.prototype._render=function(e){throw n.culture.Viewer.abstractMethodException},t.prototype._moveToPagePosition=function(e){throw n.culture.Viewer.abstractMethodException},t.prototype._updatePageViewTransform=function(){throw n.culture.Viewer.abstractMethodException},t.prototype._updatePageIndex=function(e){this.pages&&(e=this.resolvePageIndex(e),this._pageIndex!==e&&(this._pageIndex=e,this._onPageIndexChanged()))},t.prototype.moveToPage=function(e){return this.moveToPosition({pageIndex:e})},t.prototype.resolvePageIndex=function(e){return Math.min((this.pages||[]).length-1,Math.max(e,0))},t.prototype.moveToPosition=function(e){var t=this,n=e.pageIndex||0,o=new ie;return!this.pages||n<0?(o.resolve(n),o):(n=this.resolvePageIndex(n),e.pageIndex=n,n!==this._pageIndex?(this._updatePageIndex(n),o=this._render(n)):o.resolve(n),o.then(function(){t.pages&&t._moveToPagePosition(e)}),o.then(function(e){return n}).then(function(){t._calcZoomModeZoom(),t._onPositionChanged()}))},t.prototype._calcZoomModeZoom=function(e){switch(this._zoomModeUpdating=!0,e=null==e?this.zoomMode:e){case ct.PageWidth:this._zoomToViewWidth();break;case ct.WholePage:this._zoomToView()}this._zoomModeUpdating=!1},t.prototype._zoomToView=function(){var e=this._getViewPortHeight(),t=this._getViewPortWidth(),n=this._getPageSize(this.pageIndex);n&&(this.zoomFactor=Math.min(e/n.height.valueInPixel,t/n.width.valueInPixel))},t.prototype._zoomToViewWidth=function(){throw n.culture.Viewer.abstractMethodException},t.prototype._getTransformedPoint=function(e,t,o){t/=this.zoomFactor,o/=this.zoomFactor;var r=this.pages[e],i=r.size;switch(r.rotateAngle){case Ze.Rotation90:a=t;t=i.height.valueInPixel-o,o=a;break;case Ze.Rotation180:t=i.height.valueInPixel-t,o=i.width.valueInPixel-o;break;case Ze.Rotation270:var a=t;t=o,o=i.width.valueInPixel-a}return new n.Point(o,t)},t.prototype._hitTestPagePosition=function(e){if(!e||e.pageIndex<0)return null;var n=e.y,o=e.x,r=e.pageIndex;n-=t._pageMargin+t._pageBorderWidth,o-=t._pageMargin+t._pageBorderWidth;var i=this._getTransformedPoint(e.pageIndex,n,o);n=i.y,o=i.x;var a=E(n),s=E(o),u=this.pages[r].size;return{pageIndex:r,x:s,y:a,hitWorkingArea:n>=0&&n<=u.height.valueInPixel&&o>=0&&o<=u.width.valueInPixel}},t.prototype.rotatePageTo=function(e,t){this._pages[e].rotateAngle=t,this._updatePageViewTransform(),this._onRotateAngleChanged()},t.prototype.hitTest=function(e,t){if(this._pointInViewPanelClientArea(e,t)){var n=this._panelViewPntToPageView(e,t);return this._hitTestPagePosition(n)}return null},t.prototype.resetPages=function(){this._pageIndex=-1,this._pages=null,p(this._pagesWrapper),this._addViewPage(),this.invalidate()},t.prototype.refresh=function(t){void 0===t&&(t=!0),e.prototype.refresh.call(this,t),this._autoHeightCalculated=!1,!this.pages||0==this.pages.length||this.pageIndex<0||this.pageIndex>=this.pages.length||(this._render(this.pageIndex),this._calcZoomModeZoom())},t.prototype.isPageContentLoaded=function(e){var t=this.pages;return!!t&&e>=0&&e<t.length&&!!t[e].content},t.prototype._hitTestPageIndex=function(e){throw n.culture.Viewer.abstractMethodException},t.prototype._pointInViewPanelClientArea=function(e,t){throw n.culture.Viewer.abstractMethodException},t.prototype._panelViewPntToPageView=function(e,t){throw n.culture.Viewer.abstractMethodException},t._pageMargin=30,t._pageBorderWidth=1,t.controlTemplate='<div class="wj-pages-wrapper" wj-part="pages-wrapper"></div>',t}(n.Control);t._PageViewBase=Xe;var Ye=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.getScrollbarWidth=function(e){var n,o;return t._scrollbarWidth&&!e||((n=document.createElement("div")).style.width="50px",n.style.height="50px",n.style.overflow="auto",document.body.appendChild(n),(o=document.createElement("div")).style.height="60px",n.appendChild(o),t._scrollbarWidth=n.offsetWidth-n.clientWidth,document.body.removeChild(n)),t._scrollbarWidth},t._scrollbarWidth=null,t}(n.Control);t._Scroller=Ye;var Qe=function(e){function t(t){var o=e.call(this,t)||this;o._height=100,o._max=100,o._desiredValue=0,o.valueChanged=new n.Event;var r;return r=o.getTemplate(),o.applyTemplate(null,r,{_wrapper:"wrapper"}),o.hostElement.style.width=Ye.getScrollbarWidth()+1+"px",_(o.hostElement,"scroll",function(){o.onValueChanged()}),o}return __extends(t,e),t.prototype.onValueChanged=function(){this._desiredValue!=this.value&&this.valueChanged.raise(this)},t.prototype.preventScrollEvent=function(){this._desiredValue=this.hostElement.scrollTop},Object.defineProperty(t.prototype,"height",{get:function(){return this._height},set:function(e){e!==this._height&&(this._height=e,this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.hostElement.scrollTop},set:function(e){this.hostElement.scrollTop=e,this.preventScrollEvent()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"max",{get:function(){return this._max},set:function(e){this._max!==e&&(this._max=e,this.invalidate())},enumerable:!0,configurable:!0}),t.prototype.refresh=function(t){void 0===t&&(t=!0),e.prototype.refresh.call(this,t);var n=this._height+"px";this.hostElement.style.height!==n&&(this.hostElement.style.height=n);var o=this._max+this.hostElement.clientHeight+"px";this._wrapper.style.height!==o&&(this._wrapper.style.height=o),this.preventScrollEvent()},t.controlTemplate='<div class="wj-vscroller-wrapper" wj-part="wrapper"></div>',t}(Ye);t._VScroller=Qe;var $e=function(e){function t(t){var o=e.call(this,t)||this;return o._innerNavigating=!1,o._virtualScrollMode=!0,n.addClass(t,"wj-pageview-single"),o}return __extends(t,e),t.prototype._init=function(){e.prototype._init.call(this),this._initScroller(),this._initEvents()},t.prototype._initScroller=function(){var e=this;new Qe(this._vscroller).valueChanged.addHandler(function(){setTimeout(function(){return e._doScrollerValueChanged()})})},t.prototype._initEvents=function(){var e=this;_(this._pagesContainer,"wheel",function(t){e._doContainerWheel(t)}),_(this._pagesContainer,"scroll",function(t){e._doContainerScroll()}),_(this._pagesContainer,"keydown",function(t){e._doContainerKeyDown()}),_(this._pagesContainer,"click",function(t){e._pagesContainer.focus()})},t.prototype._bindTouchEvents=function(t){var n=this;e.prototype._bindTouchEvents.call(this,t),t.swipe.addHandler(function(e,t){switch(t.direction){case we.Down:var o=n.resolvePageIndex(n.pageIndex-1);o!=n.pageIndex&&n.moveToPage(o);break;case we.Up:var r=n.resolvePageIndex(n.pageIndex+1);r!=n.pageIndex&&n.moveToPage(r)}})},t.prototype._getTemplateParts=function(){return{_pagesWrapper:"pages-wrapper",_pagesContainer:"pages-container",_vscroller:"vscroller"}},t.prototype.applyTemplate=function(e,t,o){var r=this.hostElement;if(n.addClass(r,e),r.appendChild(d(t)),o)for(var i in o){var a=o[i];if(this[i]=r.querySelector('[wj-part="'+a+'"]'),null==this[i]&&r.getAttribute("wj-part")==a&&(this[i]=t),null==this[i])throw'Missing template part: "'+a+'"'}return r},Object.defineProperty(t.prototype,"virtualScrollMode",{get:function(){return this._virtualScrollMode},set:function(e){this._virtualScrollMode!==e&&(this._virtualScrollMode=e,this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_isScrollerVisible",{get:function(){return this._virtualScrollMode&&this.pages&&this.pages.length>1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_scroller",{get:function(){return n.Control.getControl(this._vscroller)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_hasPageVScrollBar",{get:function(){return M(this._pagesContainer)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_hasPageHScrollBar",{get:function(){return M(this._pagesContainer,!0)},enumerable:!0,configurable:!0}),t.prototype._getPagesContainer=function(){return this._pagesContainer},t.prototype._getPageHeightWithoutZoom=function(e){var t=this._pagesContainer.clientHeight,n=this._getPageSize(e).height.valueInPixel+2*Xe._pageMargin;return Math.max(n,t)},t.prototype._updateScroller=function(){if(this._isScrollerVisible){var e=this._scroller;e.height=this._pagesContainer.clientHeight;for(var t=0,n=0;n<this.pages.length;n++)t+=this._getPageHeightWithoutZoom(n);e.max=t,this._updateScrollerValue()}},t.prototype._updateScrollerValue=function(){if(this._isScrollerVisible){var e=this.pageIndex;if(!(e<0)){var t=0;this._pagesContainer.scrollTop>0&&(t=this._pagesContainer.scrollTop/(this._pagesContainer.scrollHeight-this._pagesContainer.clientHeight));for(var n=this._scroller,o=this.pages.length,r=0,i=0;i<e;i++)r+=this._getPageHeightWithoutZoom(i);r+=this._getPageHeightWithoutZoom(e)*t,e>=o-1&&!this._hasPageVScrollBar&&(r=n.max),n.value=r}}},t.prototype._doScrollerValueChanged=function(){if(this._isScrollerVisible){for(var e=this._scroller,t=this.pages.length,n=e.value,o=0,r=1;o<t;o++){var i=this._getPageHeightWithoutZoom(o);if(!(n>i)){r=n/i;break}n-=i}o>=t&&(o=t-1),this._innerMoveToPage(o,r)}},t.prototype._doContainerWheel=function(e){if(this._isScrollerVisible&&0!=e.deltaY){var t=e.deltaY<0;if(this._hasPageVScrollBar)if(t){if(this._pagesContainer.scrollTop>0)return}else if(this._pagesContainer.scrollTop<this._pagesContainer.scrollHeight-this._pagesContainer.clientHeight)return;t?this._innerMoveToPreviousPageAtBottom(e):this._innerMoveToNextPageAtTop(e)}},t.prototype._doContainerScroll=function(){this._isScrollerVisible&&this._pagesContainer.scrollTop!=this._desiredPageScrollTop&&(this._updateScrollerValue(),this._onPositionChanged())},t.prototype._doContainerKeyDown=function(){if(this._isScrollerVisible){var e=event;if(this._hasPageVScrollBar)switch(e.keyCode){case n.Key.PageDown:this._pagesContainer.scrollTop>=this._pagesContainer.scrollHeight-this._pagesContainer.clientHeight&&this._innerMoveToNextPageAtTop(e);break;case n.Key.PageUp:0==this._pagesContainer.scrollTop&&this._innerMoveToPreviousPageAtBottom(e)}else switch(e.keyCode){case n.Key.Down:case n.Key.PageDown:this._innerMoveToNextPageAtTop(e);break;case n.Key.Up:case n.Key.PageUp:this._innerMoveToPreviousPageAtBottom(e)}}},t.prototype._preventContainerScroll=function(){this._desiredPageScrollTop=this._pagesContainer.scrollTop},t.prototype._innerMoveToPreviousPageAtBottom=function(e){this.pageIndex>0&&(e&&e.preventDefault(),this._innerMoveToPage(this.pageIndex-1,1),this._updateScrollerValue())},t.prototype._innerMoveToNextPageAtTop=function(e){this.pageIndex<this.pages.length-1&&(e&&e.preventDefault(),this._innerMoveToPage(this.pageIndex+1,0),this._updateScrollerValue())},t.prototype._innerMoveToPage=function(e,t){var n=this;this._innerNavigating=!0;var o={pageIndex:e};this.moveToPosition(o).then(function(e){n._innerMoveToPagePosition(t),n._innerNavigating=!1})},t.prototype._innerMoveToPagePosition=function(e){if(this._hasPageVScrollBar){var t=(this._pagesContainer.scrollHeight-this._pagesContainer.clientHeight)*e;this._pagesContainer.scrollTop=t,this._preventContainerScroll()}},t.prototype.moveToPosition=function(t){var n=e.prototype.moveToPosition.call(this,t);return this._innerNavigating||this._updateScrollerValue(),n},t.prototype._moveToPagePosition=function(e){var t=e.pageBounds||{x:0,y:0,width:0,height:0},n=e.pageBounds?Xe._pageMargin:0,o=this.pages[this.pageIndex],r=V(t,o.size,o.rotateAngle,this.zoomFactor);this._pagesContainer.scrollTop=r.y+n,this._pagesContainer.scrollLeft=r.x+n},t.prototype._hitTestPageIndex=function(e){return this.pageIndex},t.prototype._pointInViewPanelClientArea=function(e,t){return e>=0&&t>=0&&e<this._pagesContainer.clientWidth&&t<this._pagesContainer.clientHeight},t.prototype._panelViewPntToPageView=function(e,t){if(this.pageIndex<0)return null;var n=this._pagesContainer.scrollTop+t,o=0;if(this._pagesContainer.scrollLeft>0)o=this._pagesContainer.scrollLeft+e;else{var r=this._pagesContainer.getBoundingClientRect();o=e-(this._pagesWrapper.getBoundingClientRect().left-r.left)+Xe._pageMargin}return{x:o,y:n,pageIndex:this.pageIndex}},t.prototype._render=function(e){return this._renderViewPage(this._pagesWrapper.querySelector(".wj-view-page"),e)},t.prototype._guessPageIndex=function(){return this.pageIndex},t.prototype._reserveViewPage=function(){p(this._pagesWrapper),this._addViewPage(),this.invalidate()},t.prototype._updatePageViewTransform=function(){var e;e=this._pagesWrapper.querySelector(".wj-view-page"),this._setPageTransform(e,this.pageIndex)},t.prototype._onPageLoaded=function(t){e.prototype._onPageLoaded.call(this,t),this._updateScroller()},t.prototype._onZoomFactorChanged=function(t,n){e.prototype._onZoomFactorChanged.call(this,t,n),this._updateScroller()},t.prototype._zoomToViewWidth=function(){var e,t;e=this._getViewPortHeight(),t=this._getViewPortWidth();var n=this._getPageSize(this.pageIndex);if(n){var o=n.height.valueInPixel,r=n.width.valueInPixel;t/r>e/o&&(t-=Ye.getScrollbarWidth()),this.zoomFactor=t/r}},t.prototype.refresh=function(t){void 0===t&&(t=!0),e.prototype.refresh.call(this,t),this._isScrollerVisible?n.addClass(this.hostElement,"virtual"):n.removeClass(this.hostElement,"virtual"),this._updateScroller()},t.controlTemplate='<div class="wj-pageview-pagescontainer" wj-part="pages-container" tabindex="0">   <div class="wj-pages-wrapper" wj-part="pages-wrapper"></div></div><div class="wj-pageview-vscroller" wj-part="vscroller" tabindex="-1"></div> ',t}(Xe);t._SinglePageView=$e;var et=function(e){function t(t){var o=e.call(this,t)||this;return n.addClass(t,"wj-pageview-continuous"),o}return __extends(t,e),t.prototype._init=function(){var t=this;e.prototype._init.call(this),_(this.hostElement,"click",function(e){t.hostElement.focus()}),_(this.hostElement,"scroll",function(){t._onPositionChanged(),clearTimeout(t._scrollingTimer),t._scrollingTimer=setTimeout(function(){t._ensurePageIndexPosition()},200)}),this.zoomFactorChanged.addHandler(function(){clearTimeout(t._zoomFactorTimer),t._zoomFactorTimer=setTimeout(function(){t._ensurePageIndexPosition()},200)})},t.prototype.dispose=function(){clearTimeout(this._scrollingTimer),clearTimeout(this._zoomFactorTimer),this._disposeBodyStopSwipe&&this._disposeBodyStopSwipe(),e.prototype.dispose.call(this)},t.prototype._stopSwip=function(){this._swipeSpeedReducer&&this._swipeSpeedReducer.stop()},t.prototype._bindTouchEvents=function(t){var n=this;e.prototype._bindTouchEvents.call(this,t),t.touchStart.addHandler(this._stopSwip,this),t.swipe.addHandler(function(e,o){n._swipeSpeedReducer||(n._swipeSpeedReducer=new Pe),n._swipeSpeedReducer.start(o.speed.x,o.speed.y,function(e,o){var r=t.hostElement.scrollLeft,i=t.hostElement.scrollTop;t.hostElement.scrollLeft-=e,t.hostElement.scrollTop-=o,r==t.hostElement.scrollLeft&&i==t.hostElement.scrollTop&&n._stopSwip()})});var o=new Oe(document.body,!1),r=this._stopSwip.bind(this);_(document.body,"mousedown",r,!0),o.touchStart.addHandler(r),this._disposeBodyStopSwipe=function(){n._stopSwip(),m(document.body,"mousedown",r),o.touchStart.removeHandler(r),o.dispose(),n._disposeBodyStopSwipe=null}},t.prototype._getAbovePageCount=function(e){return this._hitTestPageIndex(e)},t.prototype.refresh=function(t){this._stopSwip(),e.prototype.refresh.call(this,t)},t.prototype._hitTestPageIndex=function(e){if(!this.pages)return this.pageIndex;for(var t=0,n=0;t<this.pages.length;t++)if(n+=this._getPageSize(t).height.valueInPixel*this.zoomFactor+Xe._pageMargin,e<n){if(n-e<1)continue;break}return Math.min(t,this.pages.length-1)},t.prototype._guessPageIndex=function(){return this.pages&&this.hostElement.scrollHeight-this.hostElement.clientHeight<=this.hostElement.scrollTop?this.pages.length-1:this._hitTestPageIndex(this.hostElement.scrollTop)},t.prototype._render=function(e){var n=this.pages.length,o=e-t._preFetchPageCount,r=e+t._preFetchPageCount,i=[];o=o<0?0:o,r=r>n-1?n-1:r;for(var a=o;a<=r;a++)i.push(this._renderViewPage(this._pagesWrapper.querySelectorAll(".wj-view-page").item(a),a));return new ae(i)},t.prototype._moveToPagePosition=function(e){this._stopSwip();for(var t=0,n=0,o=!e.pageBounds,r=e.pageBounds||{x:0,y:0,width:0,height:0},i=o?0:Xe._pageMargin,a=this.pages[this.pageIndex],s=0;s<e.pageIndex;s++)t+=this._getPageSize(s).height.valueInPixel*this.zoomFactor+Xe._pageMargin,this._borderBoxMode||(t+=2*Xe._pageBorderWidth);var u=V(r,a.size,o?Ze.NoRotate:a.rotateAngle,this.zoomFactor);t+=u.y+i,n+=u.x+i,n+=this._getPageViewOffsetLeft(e.pageIndex),this.hostElement.scrollTop=t,this.hostElement.scrollLeft=n},t.prototype._pointInViewPanelClientArea=function(e,t){return e>=0&&t>=0&&e<this.hostElement.clientWidth&&t<this.hostElement.clientHeight},t.prototype._panelViewPntToPageView=function(e,t){var n=this.hostElement.scrollTop+t,o=0;if(this.hostElement.scrollLeft>0)o=this.hostElement.scrollLeft+e;else{var r=this.hostElement.getBoundingClientRect();o=e-(this._pagesWrapper.getBoundingClientRect().left-r.left)+Xe._pageMargin}var i=this._hitTestPageIndex(n);if(i<0)return null;o-=this._getPageViewOffsetLeft(i);for(var a=0;a<i;a++)n-=this._getPageSize(a).height.valueInPixel*this.zoomFactor+Xe._pageMargin,this._borderBoxMode||(n-=2*Xe._pageBorderWidth);return{x:o,y:n,pageIndex:i}},t.prototype._reserveViewPage=function(){p(this._pagesWrapper);for(var e=0;e<(this.pages||[]).length;e++){var t=this._addViewPage(),n=this._getPageSize(e);t.style.height=n.height.valueInPixel*this.zoomFactor+"px",t.style.width=n.width.valueInPixel*this.zoomFactor+"px"}},t.prototype._updatePageViewTransform=function(){var e;e=this._pagesWrapper.querySelectorAll(".wj-view-page");for(var t=0;t<e.length;t++)this._setPageTransform(e.item(t),t)},t.prototype._zoomToViewWidth=function(){if(0!=this.pages.length){var e,t;e=this._getViewPortHeight(),t=this._getViewPortWidth();for(var n=0,o=0,r=0;r<this.pages.length;r++){var i=this._getPageSize(r);i.width.valueInPixel>n&&(n=i.width.valueInPixel),o+=i.height.valueInPixel}t/n>e/o&&(t-=Ye.getScrollbarWidth()),this.zoomFactor=t/n}},t.prototype._ensurePageIndexPosition=function(){var e=this._guessPageIndex();this.pageIndex!==e&&(this._render(e),this._updatePageIndex(e))},t.prototype._getPageViewOffsetLeft=function(e){var t=this._pagesWrapper.querySelectorAll(".wj-view-page").item(e);return t?t.offsetLeft-this._pagesWrapper.offsetLeft:0},t._preFetchPageCount=3,t}(Xe);t._ContinuousPageView=et;var tt=function(e){function o(t){var o=e.call(this,t)||this;o._idCounter=0,o._tabPages=[],o._tabPageDic={},o.tabPageActived=new n.Event,o.tabPageVisibilityChanged=new n.Event,o.expanded=new n.Event,o.collapsed=new n.Event;var r=o.getTemplate();return o.applyTemplate("wj-control",r,{_headersContainer:"wj-headers",_contentsContainer:"wj-contents"}),o}return __extends(o,e),o.prototype.applyTemplate=function(e,t,o){var r=this.hostElement;if(n.addClass(r,e),r.appendChild(d(t)),o)for(var i in o){var a=o[i];if(this[i]=r.querySelector('[wj-part="'+a+'"]'),null==this[i]&&r.getAttribute("wj-part")==a&&(this[i]=t),null==this[i])throw'Missing template part: "'+a+'"'}return r},Object.defineProperty(o.prototype,"tabPages",{get:function(){return this._tabPages},enumerable:!0,configurable:!0}),o.prototype.getTabPage=function(e){return this._tabPageDic[e]},o.prototype.getFirstShownTabPage=function(e){var t;return this._tabPages.some(function(n){return!n.isHidden&&n!==e&&(t=n,!0)}),t},Object.defineProperty(o.prototype,"visibleTabPagesCount",{get:function(){var e=0;return this._tabPages.forEach(function(t){t.isHidden||e++}),e},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"activedTabPage",{get:function(){var e;return this._tabPages.some(function(t){return!!t.isActived&&(e=t,!0)}),e},enumerable:!0,configurable:!0}),o.prototype.removePage=function(e){var t;if(t="string"==typeof e?this.getTabPage(e):e){var n=t.id,o=this._tabPages.indexOf(t);if(!(o<0)){if(this._tabPages.splice(o,1),this._tabPageDic[n]=void 0,!this.isCollapsed&&t.isActived){var r=this.getFirstShownTabPage();r?this.active(r):this.collapse()}this._headersContainer.removeChild(t.header),this._contentsContainer.removeChild(t.outContent)}}},o.prototype.addPage=function(e,t,o){var r=this,i=this._getNewTabPageId(),a=document.createElement("li"),s=g('<div class="wj-tabpane"><div class="wj-tabtitle-wrapper"><h3 class="wj-tabtitle">'+e+'</h3><span class="wj-close">×</span></div><div class="wj-tabcontent-wrapper"><div class="wj-tabcontent-inner"></div></div></div>'),c=u(t);a.appendChild(c),o=null==o?this._tabPages.length:o,(o=Math.min(Math.max(o,0),this._tabPages.length))>=this._tabPages.length?(this._headersContainer.appendChild(a),this._contentsContainer.appendChild(s)):(this._headersContainer.insertBefore(a,this._tabPages[o].header),this._contentsContainer.insertBefore(s,this._tabPages[o].outContent)),_(s.querySelector(".wj-close"),"click",function(){r.collapse()}),_(a.querySelector("a"),"click,keydown",function(e){var t=r.getTabPage(i);t&&("keydown"===e.type&&e.keyCode===n.Key.Enter||"click"===e.type)&&r.active(t)});var l=new nt(s,a,i);return o>=this._tabPages.length?this._tabPages.push(l):this._tabPages.splice(o,0,l),this._tabPageDic[i]=l,this.isCollapsed||this.activedTabPage||this.active(l),l},Object.defineProperty(o.prototype,"isCollapsed",{get:function(){return n.hasClass(this.hostElement,o._collapsedCss)},enumerable:!0,configurable:!0}),o.prototype.hide=function(e){var o="string"==typeof e?this.getTabPage(e):e;o&&(n.hasClass(o.header,t._hiddenCss)||(n.addClass(o.header,t._hiddenCss),this.onTabPageVisibilityChanged(o),this.deactive(o)))},o.prototype.show=function(e){var o="string"==typeof e?this.getTabPage(e):e;o&&n.hasClass(o.header,t._hiddenCss)&&(n.removeClass(o.header,t._hiddenCss),this.onTabPageVisibilityChanged(o),this.isCollapsed||this.activedTabPage||this.active(o))},o.prototype.deactive=function(e){var t="string"==typeof e?this.getTabPage(e):e;if(t&&t.isActived){n.removeClass(t.outContent,o._activedCss),f(t.header.querySelector("a"),!1);var r=this.getFirstShownTabPage(t);r?this.active(r):this.collapse()}},o.prototype.active=function(e){var t="string"==typeof e?this.getTabPage(e):e;t&&(this.expand(),t.isActived||(this._clearActiveStyles(),this.show(t),n.addClass(t.outContent,o._activedCss),f(t.header.querySelector("a"),!0),this.onTabPageActived()))},o.prototype.enable=function(e,t){void 0===t&&(t=!0);var n="string"==typeof e?this.getTabPage(e):e;n&&n.enable(t)},o.prototype.enableAll=function(e){void 0===e&&(e=!0),this._tabPages.forEach(function(t){t.enable(e)})},o.prototype.onTabPageActived=function(){this.tabPageActived.raise(this,new n.EventArgs)},o.prototype.onTabPageVisibilityChanged=function(e){this.tabPageVisibilityChanged.raise(this,{tabPage:e})},o.prototype.onExpanded=function(){this.expanded.raise(this,new n.EventArgs)},o.prototype.onCollapsed=function(){this.collapsed.raise(this,new n.EventArgs)},o.prototype.collapse=function(){this.isCollapsed||(this._clearActiveStyles(),n.addClass(this.hostElement,o._collapsedCss),this.onCollapsed())},o.prototype.expand=function(){if(this.isCollapsed){if(n.removeClass(this.hostElement,o._collapsedCss),!this.activedTabPage){var e=this.getFirstShownTabPage();e&&this.active(e)}this.onExpanded()}},o.prototype.toggle=function(){this.isCollapsed?this.expand():this.collapse()},o.prototype._clearActiveStyles=function(){this._tabPages.forEach(function(e){n.removeClass(e.outContent,o._activedCss),f(e.header.querySelector("a"),!1)})},o.prototype._getNewTabPageId=function(){for(;this._tabPageDic[(this._idCounter++).toString()];);return this._idCounter.toString()},o._activedCss="active",o._collapsedCss="collapsed",o.controlTemplate='<ul class="wj-nav wj-btn-group" wj-part="wj-headers"></ul><div class="wj-tabcontent" wj-part="wj-contents"></div>',o}(n.Control);t._SideTabs=tt;var nt=function(){function e(e,t,n){this._header=t,this._outContent=e,this._content=e.querySelector(".wj-tabcontent-inner"),this._id=n}return Object.defineProperty(e.prototype,"isActived",{get:function(){return n.hasClass(this.outContent,tt._activedCss)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isHidden",{get:function(){return n.hasClass(this.header,t._hiddenCss)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"header",{get:function(){return this._header},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"content",{get:function(){return this._content},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outContent",{get:function(){return this._outContent},enumerable:!0,configurable:!0}),e.prototype.enable=function(e){void 0===e&&(e=!0),n.enable(this._header,e),n.enable(this._content,e)},e.prototype.format=function(e){e(this)},e}();t._TabPage=nt;var ot=function(e){function o(n,o,r){var i=e.call(this,document.createElement("div"),r)||this;return i.owner=o,i.hostElement.style.display="none",i.owner.appendChild(i.hostElement),i.showDropDownButton=!1,i.itemClicked.addHandler(i._onItemClicked,i),i.formatItem.addHandler(i._formatItem,i),i._viewer=n,i.displayMemberPath="title",i.selectedValuePath="commandTag",i._bindMenuItems(),i._viewer._viewerActionStatusChanged.addHandler(function(e,n){var o=i.dropDown.querySelector("["+t._commandTagAttr+'="'+n.action.actionType.toString()+'"]');i._updateActionStatusCore(o,n.action)}),i}return __extends(o,e),Object.defineProperty(o.prototype,"viewer",{get:function(){return this._viewer},enumerable:!0,configurable:!0}),o.prototype._bindMenuItems=function(){this.itemsSource=this._initItems()},o.prototype._initItems=function(){throw n.culture.Viewer.abstractMethodException},o.prototype._internalFormatItem=function(e,n){if(e&&void 0!==e.commandTag){if(p(n),e.icon){var o=document.createElement("span");o.appendChild(u(e.icon)),n.insertBefore(o,n.firstChild)}n.setAttribute(t._commandTagAttr,e.commandTag.toString()),this._updateActionStatus(n,e.commandTag)}},o.prototype._formatItem=function(e,t){this._internalFormatItem(this.itemsSource[t.index],t.item)},o.prototype._onItemClicked=function(e){this._viewer._executeAction(parseInt(e.selectedItem.commandTag))},o.prototype._updateActionStatus=function(e,t){this._updateActionStatusCore(e,{actionType:t,checked:this._viewer._actionIsChecked(t),disabled:this._viewer._actionIsDisabled(t),shown:this._viewer._actionIsShown(t)})},o.prototype._updateActionStatusCore=function(e,t){f(e,t.checked),v(e,t.disabled),y(e,t.shown)},o.prototype._updateItemsStatus=function(){for(var e=this.dropDown.querySelectorAll("["+t._commandTagAttr+"]"),n=0;n<e.length;n++){var o=e[n],r=o.getAttribute(t._commandTagAttr);null!=r&&this._updateActionStatus(o,parseInt(r))}x(this.dropDown)},o.prototype.refresh=function(t){void 0===t&&(t=!0),e.prototype.refresh.call(this,t),t&&this._bindMenuItems(),this.isDroppedDown&&this.showMenu()},o.prototype.showMenu=function(e){this.selectedIndex=-1,n.showPopup(this.dropDown,this.owner,e,!1,!1),this.dropDown.style.color=this._viewer.hostElement.style.color,n.addClass(this.dropDown,"wj-btn-group-vertical"),n.addClass(this.dropDown,"wj-viewer-menu"),this._updateItemsStatus(),this.dropDown.focus()},o}(o.Menu);t._ViewerMenuBase=ot;var rt=function(e){function o(t,n,o){return e.call(this,t,n,o)||this}return __extends(o,e),o.prototype._initItems=function(){var e=[],o=n.culture.Viewer;return e.push({title:o.thumbnails,icon:t.icons.thumbnails,commandTag:_t.ShowThumbnails}),e.push({title:o.outlines,icon:t.icons.outlines,commandTag:_t.ShowOutlines}),e.push({title:o.exports,icon:t.icons.exports,commandTag:_t.ShowExportsPanel}),e.push({title:dt._seperatorHtml}),e.push({title:o.portrait,icon:t.icons.portrait,commandTag:_t.Portrait}),e.push({title:o.landscape,icon:t.icons.landscape,commandTag:_t.Landscape}),e.push({title:o.pageSetup,icon:t.icons.pageSetup,commandTag:_t.ShowPageSetupPanel}),e.push({title:dt._seperatorHtml}),e.push({title:o.showZoomBar,icon:t.icons.showZoomBar,commandTag:_t.ShowZoomBar}),e.push({title:dt._seperatorHtml}),e.push({title:o.paginated,icon:t.icons.paginated,commandTag:_t.TogglePaginated}),e.push({title:o.print,icon:t.icons.print,commandTag:_t.Print}),e.push({title:dt._seperatorHtml}),e.push({title:o.backwardHistory,icon:t.icons.backwardHistory,commandTag:_t.Backward}),e.push({title:o.forwardHistory,icon:t.icons.forwardHistory,commandTag:_t.Forward}),e},o}(ot);t._HamburgerMenu=rt;var it=function(e){function o(t,n,o){return e.call(this,t,n,o)||this}return __extends(o,e),o.prototype._initItems=function(){var e=[];return e.push({title:n.culture.Viewer.singleMode,icon:t.icons.singleView,commandTag:_t.Single}),e.push({title:n.culture.Viewer.continuousMode,icon:t.icons.continuousView,commandTag:_t.Continuous}),e.push({title:dt._seperatorHtml}),e.push({title:n.culture.Viewer.wholePage,icon:t.icons.fitWholePage,commandTag:_t.FitWholePage}),e.push({title:n.culture.Viewer.pageWidth,icon:t.icons.fitPageWidth,commandTag:_t.FitPageWidth}),e},o}(ot);t._ViewMenu=it;var at=function(e){function t(t,n,o){return e.call(this,t,n,o)||this}return __extends(t,e),t.prototype._initItems=function(){var e=[];return e.push({title:n.culture.Viewer.wholeWordMenuItem,commandTag:_t.SearchMatchWholeWord}),e.push({title:n.culture.Viewer.matchCaseMenuItem,commandTag:_t.SearchMatchCase}),e},t.prototype._internalFormatItem=function(t,o){if(e.prototype._internalFormatItem.call(this,t,o),t&&void 0!==t.commandTag){var r=document.createElement("span");r.innerHTML=n.culture.Viewer.checkMark,n.addClass(r,"checkIcon"),o.insertBefore(r,o.firstChild)}},t.prototype._updateActionStatus=function(t,o){e.prototype._updateActionStatus.call(this,t,o),this.viewer._actionIsChecked(o)&&n.addClass(t,"checked")},t}(ot);t._SearchOptionsMenu=at;var st;!function(e){e[e.SelectTool=0]="SelectTool",e[e.MoveTool=1]="MoveTool",e[e.RubberbandTool=2]="RubberbandTool",e[e.MagnifierTool=3]="MagnifierTool"}(st=t.MouseMode||(t.MouseMode={}));var ut;!function(e){e[e.Single=0]="Single",e[e.Continuous=1]="Continuous"}(ut=t.ViewMode||(t.ViewMode={}));var ct;!function(e){e[e.Custom=0]="Custom",e[e.PageWidth=1]="PageWidth",e[e.WholePage=2]="WholePage"}(ct=t.ZoomMode||(t.ZoomMode={}));var lt=function(e){function t(t){var n=e.call(this)||this;return n._a=t,n}return __extends(t,e),Object.defineProperty(t.prototype,"element",{get:function(){return this._a},enumerable:!0,configurable:!0}),t}(n.EventArgs);t._LinkClickedEventArgs=lt;var ht;!function(e){e[e.Bookmark=0]="Bookmark",e[e.Custom=1]="Custom"}(ht=t._ActionKind||(t._ActionKind={}));var pt=function(){function e(){this._items=[{}],this._position=0,this.statusChanged=new n.Event}return e.prototype._onStatusChanged=function(){this.statusChanged.raise(this,new n.EventArgs)},Object.defineProperty(e.prototype,"current",{get:function(){return this._items[this._position]},enumerable:!0,configurable:!0}),e.prototype.clear=function(){this._items=[{}],this._position=0,this._onStatusChanged()},e.prototype.add=function(){this._items.splice(++this._position),this._items.push({}),this._onStatusChanged()},e.prototype.forward=function(){if(!this.canForward())return null;var e=this._items[++this._position];return this._onStatusChanged(),e},e.prototype.backward=function(){if(!this.canBackward())return null;var e=this._items[--this._position];return this._onStatusChanged(),e},e.prototype.canForward=function(){return this._position<this._items.length-1},e.prototype.canBackward=function(){return this._position>0},e}();t._HistoryManager=pt;var dt=function(e){function i(t,o){var r=e.call(this,t,o,!0)||this;return r._pages=[],r._pageIndex=0,r._mouseMode=st.SelectTool,r._viewMode=ut.Single,r._needBind=!1,r._historyManager=new pt,r._fullScreen=!1,r._miniToolbarPinnedTimer=null,r._autoHeightCalculated=!1,r._searchManager=new fe,r._thresholdWidth=767,r._historyMoving=!1,r._documentSourceChanged=new n.Event,r.pageIndexChanged=new n.Event,r.viewModeChanged=new n.Event,r.selectMouseModeChanged=new n.Event,r.mouseModeChanged=new n.Event,r.fullScreenChanged=new n.Event,r.zoomFactorChanged=new n.Event,r.queryLoadingData=new n.Event,r._viewerActionStatusChanged=new n.Event,r._documentEventKey=(new Date).getTime().toString(),r._init(o),r}return __extends(i,e),i.prototype._getProductInfo=function(){return"QNI5,ViewerBase"},Object.defineProperty(i.prototype,"serviceUrl",{get:function(){return this._serviceUrl},set:function(e){e!=this._serviceUrl&&(this._serviceUrl=e,this._needBindDocumentSource(),this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"filePath",{get:function(){return this._filePath},set:function(e){e!=this._filePath&&(this._filePath=e,this._needBindDocumentSource(),this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"thresholdWidth",{get:function(){return this._thresholdWidth},set:function(e){e!=this._thresholdWidth&&(this._thresholdWidth=e,this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"_innerPaginated",{get:function(){return this._documentSource&&!this._needBind?this._documentSource.paginated:this._paginated},set:function(e){this._documentSource&&!this._needBind?this._setPaginated(e):this._paginated=null==e?null:n.asBoolean(e),this._setViewerAction(_t.TogglePaginated,!0)},enumerable:!0,configurable:!0}),i.prototype.reload=function(){this._needBindDocumentSource(),this.invalidate()},i.prototype.refresh=function(t){if(void 0===t&&(t=!0),e.prototype.refresh.call(this,t),this._needBind&&(this._setDocumentSource(this._getSource()),this._needBind=!1),t){var o=n.Control.getControl(this._toolbar);o&&o.refresh();var r=n.Control.getControl(this._miniToolbar);r&&r.refresh();var a=n.Control.getControl(this._mobileToolbar);a&&a.refresh();var s=n.Control.getControl(this._zoomBar);s&&s.refresh();var u=n.Control.getControl(this._searchBar);u&&u.refresh(),this._hamburgerMenu&&this._hamburgerMenu.refresh(),this._viewMenu&&this._viewMenu.refresh(),this._searchOptionsMenu&&this._searchOptionsMenu.refresh(),i._exportItems=null,this._updateExportTab(!0),this._globalize(),this._updateLayout()}this._resetMiniToolbarPosition(),this._resetToolbarWidth(),this._resetViewPanelContainerWidth(),this._autoHeightCalculated=!1},i.prototype._updateLayout=function(){this._switchTemplate(this._isMobileTemplate())},i.prototype._switchTemplate=function(e){var t=this.hostElement.querySelector(".wj-viewer-outer"),o=n.Control.getControl(this._sidePanel),r=o.getTabPage(this._pageSetupPageId);e?(n.addClass(t,"mobile"),o.show(r)):(n.removeClass(t,"mobile"),o.hide(r))},i.prototype._getSource=function(){return this.filePath?new te({serviceUrl:this._serviceUrl,filePath:this._filePath}):null},i.prototype._needBindDocumentSource=function(){this._needBind=!0},i.prototype._supportsPageSettingActions=function(){return!1},i.prototype._isMobileTemplate=function(){return this.thresholdWidth>this.hostElement.getBoundingClientRect().width},i.prototype._init=function(e){var t=this;this._createChildren(),this._autoCalculateHeight(),this._resetToolbarWidth(),this._resetViewPanelContainerWidth(),this._bindEvents(),this._initTools(),this.deferUpdate(function(){t.initialize(e)})},i.prototype._initTools=function(){var e=this;this._rubberband=new vt(document.createElement("div"),this._viewpanelContainer,this._pageView),this._rubberband.applied.addHandler(function(t,n){var o=n.rect,r=e._pageView.hitTest(o.left,o.top),i=e._viewpanelContainer.getBoundingClientRect();o.width>o.height?e._pageView.zoomFactor*=i.width/o.width:e._pageView.zoomFactor*=i.height/o.height,e._pageView.moveToPosition(j(r))}),this._magnifier=new yt(document.createElement("div"),this._viewpanelContainer,this._pageView)},i.prototype._globalize=function(){var e=n.culture.Viewer;this._gSearchTitle.textContent=e.search,this._gMatchCase.innerHTML="&nbsp;&nbsp;&nbsp;"+e.matchCase,this._gWholeWord.innerHTML="&nbsp;&nbsp;&nbsp;"+e.wholeWord,this._gSearchResults.textContent=e.searchResults,this._gThumbnailsTitle.textContent=e.thumbnails,this._gOutlinesTitle.textContent=e.outlines,this._gPageSetupTitle.textContent=e.pageSetup,this._gPageSetupApplyBtn.textContent=e.ok,this._gExportsPageTitle.textContent=e.exports,this._gExportsPageApplyBtn.textContent=e.exportOk,this._gExportFormatTitle.textContent=e.exportFormat},i.prototype._autoCalculateHeight=function(){if(this._shouldAutoHeight()){var e=this._viewpanelContainer.style.height;this._viewpanelContainer.style.height="100%",this._viewerContainer.style.height=Math.max(this._viewpanelContainer.getBoundingClientRect().height,i._viewpanelContainerMinHeight)+"px",this._viewpanelContainer.style.height=e}},i.prototype._bindEvents=function(){var e=this;_(window,"unload",function(){e._documentSource&&e._documentSource.dispose()}),_(document,"mousemove",function(t){if(e.fullScreen&&e._miniToolbar){var n=e._checkMiniToolbarVisible(t);null!=e._miniToolbarPinnedTimer&&n?(clearTimeout(e._miniToolbarPinnedTimer),e._miniToolbarPinnedTimer=null,e._showMiniToolbar(n)):null==e._miniToolbarPinnedTimer&&e._showMiniToolbar(n)}}),_(document,"keydown",function(t){t.keyCode===n.Key.Escape&&(e.fullScreen=!1)}),this._historyManager.statusChanged.addHandler(this._onHistoryManagerStatusUpdated,this),this._onHistoryManagerStatusUpdated(),this._pageView.pageIndexChanged.addHandler(function(){e._addHistory(!1,!0),e._updatePageIndex(e._pageView.pageIndex)}),this._pageView.zoomFactorChanged.addHandler(function(t,n){e.zoomMode===ct.Custom&&e._addHistory(!1,!0,{zoomFactor:n.oldValue}),e.onZoomFactorChanged()}),this._pageView.zoomModeChanged.addHandler(function(t,n){e._addHistory(!1,!0,{zoomMode:n.oldValue}),e._updateZoomModeActions()}),this._pageView.positionChanged.addHandler(function(){setTimeout(function(){e._historyManager.current.position=e._getCurrentPosition()},i._historyTimeout)});var t=!1;this._searchManager.currentChanged.addHandler(function(){if(!t){var n=e._searchManager.current;n&&(t=!0,e._highlightPosition(n.pageIndex,n.boundsList),t=!1)}})},i.prototype._checkMiniToolbarVisible=function(e){var t=e.clientX,n=e.clientY,o=this._miniToolbar.getBoundingClientRect(),r=o.left-60,i=o.right+60,a=o.top-60,s=o.bottom+60;return t>=r&&t<=i&&n>=a&&n<=s},i.prototype._showMiniToolbar=function(e){var t,n=parseFloat(getComputedStyle(this._miniToolbar,"").opacity),o=this._miniToolbar;t=e?setInterval(function(){n>=.8?window.clearInterval(t):(n+=.01,o.style.opacity=n.toString())},1):setInterval(function(){n<0?window.clearInterval(t):(n-=.01,o.style.opacity=n.toString())},1)},i.prototype._goToBookmark=function(e){var t=this;this._documentSource&&e.data&&this._documentSource.getBookmark(e.data).then(function(e){e&&t._scrollToPosition(e,!0)})},i.prototype._executeCustomAction=function(e){var t=this;if(this._documentSource&&e.data){this._initialPosition={pageIndex:this._pageIndex,pageBounds:{x:0,y:0,width:0,height:0}},this._resetDocument(),this._showViewPanelMessage(),this._setDocumentRendering();var n=this._documentSource;this._documentSource.executeCustomAction(e).then(function(e){t._initialPosition=e||t._initialPosition,t._getStatusUtilCompleted(n)}).catch(function(e){t._showViewPanelErrorMessage(C(e))})}},i.prototype._getStatusUtilCompleted=function(e){var t=this;!e||e.isLoadCompleted||e.isDisposed||e.getStatus().then(function(n){t._documentSource===e&&setTimeout(function(){return t._getStatusUtilCompleted(e)},e._innerService.getPingTimeout())}).catch(function(e){t._showViewPanelErrorMessage(e)})},i.prototype._initChildren=function(){this._initPageView(),this._initToolbar(),this._initSidePanel(),this._initSplitter(),this._initFooter(),this._initSearchBar(),this._initMiniToolbar()},i.prototype._initSearchBar=function(){new Ke(this._searchBar,this),this._showSearchBar(!1)},i.prototype._showSearchBar=function(e){var o=this.hostElement.querySelector(".wj-viewer-outer");e?(n.removeClass(this._searchBar,t._hiddenCss),n.addClass(o,"with-searchbar")):(n.addClass(this._searchBar,t._hiddenCss),n.removeClass(o,"with-searchbar"))},i.prototype._initFooter=function(){var e=this;new qe(this._zoomBar,this),_(this._footer.querySelector(".wj-close"),"click",function(){e._showFooter(!1)})},i.prototype._showFooter=function(e){var o=this.hostElement.querySelector(".wj-viewer-outer");e?(n.removeClass(this._footer,t._hiddenCss),n.addClass(o,"with-footer")):(n.addClass(this._footer,t._hiddenCss),n.removeClass(o,"with-footer"))},i.prototype._createChildren=function(){var e=this.getTemplate();this.applyTemplate("wj-viewer wj-control",e,{_viewpanelContainer:"viewpanel-container",_toolbar:"toolbar",_mobileToolbar:"mobile-toolbar",_miniToolbar:"mini-toolbar",_leftPanel:"viewer-left-panel",_sidePanel:"side-panel",_viewerContainer:"viewer-container",_splitter:"splitter",_footer:"viewer-footer",_zoomBar:"zoom-bar",_searchBar:"search-bar"}),this._initChildren()},i.prototype._initPageView=function(){new Ge(this._viewpanelContainer).viewMode=this.viewMode},Object.defineProperty(i.prototype,"_pageView",{get:function(){return n.Control.getControl(this._viewpanelContainer)},enumerable:!0,configurable:!0}),i.prototype._initSplitter=function(){var e=this;_(this._splitter,"click",function(){return e._toggleSplitter()})},i.prototype._toggleSplitter=function(e){var t=this._splitter.querySelector("span"),o=n.Control.getControl(this._sidePanel);if(!0===e){if(n.hasClass(t,"wj-glyph-right"))return}else if(!1===e){if(n.hasClass(t,"wj-glyph-left"))return}else e=n.hasClass(t,"wj-glyph-left");if(e)o.collapse(),t.className="wj-glyph-right";else{if(0===o.visibleTabPagesCount)return;t.className="wj-glyph-left",o.expand()}this._resetViewPanelContainerWidth()},i.prototype._resetMiniToolbarPosition=function(){if(this._miniToolbar){var e=this.hostElement.getBoundingClientRect().width,t=this._miniToolbar.getBoundingClientRect().width;this._miniToolbar.style.left=(e-t)/2+"px"}},i.prototype._resetToolbarWidth=function(){n.Control.getControl(this._toolbar).resetWidth()},i.prototype._resetViewPanelContainerWidth=function(){!this._isMobileTemplate()&&this.hostElement.getBoundingClientRect().width<=i._narrowWidthThreshold?n.addClass(this.hostElement,i._narrowCss):n.removeClass(this.hostElement,i._narrowCss);var e=this._splitter?this._splitter.getBoundingClientRect().width:0,t=this._leftPanel?this._leftPanel.getBoundingClientRect().width:0;this._viewpanelContainer.style.width=this._viewerContainer.getBoundingClientRect().width-e-t+"px",this._pageView.invalidate()},i.prototype._shouldAutoHeight=function(){return("100%"===this.hostElement.style.height||"auto"===this.hostElement.style.height)&&!this.fullScreen},i.prototype._initSidePanel=function(){var e=this,t=new tt(this._sidePanel);t.collapse(),t.collapsed.addHandler(function(){e._toggleSplitter(!0)}),t.expanded.addHandler(function(){e._toggleSplitter(!1);var t=e._splitter?e._splitter.getBoundingClientRect().width:0;e._sidePanel.getBoundingClientRect().width+t>e._viewerContainer.getBoundingClientRect().width&&n.addClass(e._sidePanel,"collapsed")}),t.tabPageVisibilityChanged.addHandler(function(n,o){(!o.tabPage.isHidden&&1==t.visibleTabPagesCount||o.tabPage.isHidden&&0==t.visibleTabPagesCount)&&e._resetViewPanelContainerWidth()}),this._initSidePanelThumbnails(),this._initSidePanelOutlines(),this._initSidePanelSearch(),this._initSidePanelExports(),this._initSidePanelPageSetup()},i.prototype._clearPreHightLights=function(){this._pages.forEach(function(e){var t;if(e.content){t=e.content.querySelectorAll(".highlight");for(var n=0;n<t.length;n++)t.item(n).parentNode.removeChild(t.item(n))}})},i.prototype._highlightPosition=function(e,t){var n,o=this,r=(this._pageIndex,this._pageView.scrollTop,this._pageView.scrollLeft,{pageIndex:e,pageBounds:t.length>0?t[0]:null});this._scrollToPosition(r,!0).then(function(e){o._clearPreHightLights(),o._pages[o.pageIndex].getContent().then(function(e){n=e.querySelector("g");for(var o=0;o<t.length;o++){var r=document.createElementNS("http://www.w3.org/2000/svg","rect");r.setAttributeNS(null,"x",T(t[o].x).toString()),r.setAttributeNS(null,"y",T(t[o].y).toString()),r.setAttributeNS(null,"height",T(t[o].height).toString()),r.setAttributeNS(null,"width",T(t[o].width).toString()),r.setAttributeNS(null,"class","highlight"),n.appendChild(r)}})})},i.prototype._scrollToPosition=function(e,t){return!0===t&&this._addHistory(!0,!1),e.pageIndex=e.pageIndex||0,this._pageView.moveToPosition(e)},i.prototype._initSidePanelSearch=function(){var e=this,r=n.Control.getControl(this._sidePanel),i=r.addPage(n.culture.Viewer.search,t.icons.search);this._gSearchTitle=i.outContent.querySelector(".wj-tabtitle"),i.format(function(a){var s=d('<div class="wj-searchcontainer"><input class="wj-searchbox" wj-part="search-box" type="text"/><div class="wj-btn-group"><button class="wj-btn wj-btn-searchpre">'+u(t.icons.searchPrevious).innerHTML+'</button><button class="wj-btn wj-btn-searchnext">'+u(t.icons.searchNext).innerHTML+'</button></div></div><div class="wj-searchoption"><label><span wj-part="g-matchCase">&nbsp;&nbsp;&nbsp;'+n.culture.Viewer.matchCase+'</span><input type="checkbox" wj-part="match-case" /></label></div><div class="wj-searchoption"><label><span wj-part="g-wholeWord">&nbsp;&nbsp;&nbsp;'+n.culture.Viewer.wholeWord+'</span><input type="checkbox" wj-part="whole-word" /></label></div><h3 wj-part="g-searchResults" class="wj-searchresult">'+n.culture.Viewer.searchResults+"</h3>");e._gMatchCase=s.querySelector('[wj-part="g-matchCase"]'),e._gWholeWord=s.querySelector('[wj-part="g-wholeWord"]'),e._gSearchResults=s.querySelector('[wj-part="g-searchResults"]'),a.outContent.querySelector(".wj-tabtitle-wrapper").appendChild(s);var c=a.outContent.querySelectorAll('input[type="checkbox"]')[0],l=a.outContent.querySelectorAll('input[type="checkbox"]')[1],h=a.outContent.querySelector('input[type="text"]'),p=a.outContent.querySelector(".wj-btn-searchpre"),g=a.outContent.querySelector(".wj-btn-searchnext");n.addClass(a.content.parentElement,"search-wrapper"),n.addClass(a.content,"wj-searchresultlist");var m=new o.ListBox(a.content),f=!1,v=!1;m.formatItem.addHandler(function(e,t){var o=t.item,r=t.data,i=document.createElement("div"),a=document.createElement("div");o.innerHTML="",a.innerHTML=r.nearText,a.className="wj-search-text",i.innerHTML="Page "+(r.pageIndex+1),i.className="wj-search-page",n.addClass(o,"wj-search-item"),o.setAttribute("tabIndex","-1"),o.appendChild(a),o.appendChild(i)}),m.selectedIndexChanged.addHandler(function(){return e._searchManager.currentIndex=m.selectedIndex});var y=function(e){void 0===e&&(e=!0);for(var t=i.outContent.querySelectorAll("input"),n=0;n<t.length;n++)t.item(n).disabled=!e};e._searchManager.searchStarted.addHandler(function(){y(!1)}),e._searchManager.searchCompleted.addHandler(function(){f=!0,e._clearPreHightLights(),m.itemsSource=e._searchManager.searchResult,f=!1,y(!0)}),e._searchManager.currentChanged.addHandler(function(){f||v||e._searchManager.current&&(v=!0,m.selectedIndex=e._searchManager.currentIndex,v=!1)});var w=function(){e._searchManager.clear(),m.itemsSource=null,c.checked=!1,l.checked=!1,h.value="",e._documentSource&&e._documentSource.features&&(!e._documentSource.paginated||e._documentSource.features.textSearchInPaginatedMode)?r.show(a):r.hide(a)};e._documentSourceChanged.addHandler(function(){e._documentSource&&P(e._documentEventKey,e._documentSource.loadCompleted,w),w()}),_(c,"click",function(){e._searchManager.matchCase=c.checked}),_(l,"click",function(){e._searchManager.wholeWord=l.checked}),_(h,"input",function(){e._searchManager.text=h.value}),_(h,"keyup",function(t){var o=t||window.event;o.keyCode===n.Key.Enter&&e._searchManager.search(o.shiftKey)}),_(g,"click",function(){return e._searchManager.search()}),_(p,"click",function(){return e._searchManager.search(!0)}),_(a.header,"keydown",function(t){var o,r=e._toolbar;t.keyCode===n.Key.Tab&&(o=r.querySelector("[tabIndex=0]")||r.querySelector('input:not([type="hidden"])')||r)&&o.focus&&(o.focus(),t.preventDefault())})})},i.prototype._initSidePanelOutlines=function(){var e=this,o=n.Control.getControl(this._sidePanel),i=o.addPage(n.culture.Viewer.outlines,t.icons.outlines);this._gOutlinesTitle=i.outContent.querySelector(".wj-tabtitle"),this._outlinesPageId=i.id,i.format(function(t){n.addClass(t.content,"wj-outlines-tree");var i=new r.FlexGrid(t.content);i.initialize({autoGenerateColumns:!1,columns:[{binding:"caption",width:"*"}],isReadOnly:!0,childItemsPath:"children",allowResizing:r.AllowResizing.None,headersVisibility:r.HeadersVisibility.None}),i.itemFormatter=function(e,t,n,o){var r;r=o.firstElementChild?o.firstElementChild.outerHTML:"&nbsp;&nbsp;&nbsp;&nbsp;";var i=e.rows[t].dataItem;o.innerHTML=r+"<a>"+i.caption+"</a>"};var a=!0;i.selectionChanged.addHandler(function(t,n){if(!a){var i=n.panel.rows[n.row];if(i){var s=i.dataItem;if(s.position)e._scrollToPosition(s.position,!0);else if(s.target){if(!e._documentSource)return;e._documentSource.getBookmark(s.target).then(function(o){s.position=o,t.getSelectedState(n.row,n.col)!=r.SelectedState.None&&e._scrollToPosition(o,!0)},function(e){})}e._isMobileTemplate()&&o.collapse()}}});var s=!1,u=function(){s||o.isCollapsed||!t.isActived||t.isHidden||(i.refresh(),s=!0)},c=function(){if(!e._documentSource)return i.itemsSource=null,void o.hide(t);P(e._documentEventKey,e._documentSource.loadCompleted,function(){if(!e._documentSource.hasOutlines)return i.itemsSource=null,void o.hide(t);e._documentSource.getOutlines().then(function(e){s=!1,i.itemsSource=e,o.show(t),u(),a=!1})})};e._documentSourceChanged.addHandler(c),o.expanded.addHandler(u),o.tabPageActived.addHandler(u),c()})},i.prototype._initSidePanelThumbnails=function(){var e=this,r=n.Control.getControl(this._sidePanel),a=r.addPage(n.culture.Viewer.thumbnails,t.icons.thumbnails);this._gThumbnailsTitle=a.outContent.querySelector(".wj-tabtitle"),this._thumbnailsPageId=a.id,a.format(function(t){n.addClass(t.content,"wj-thumbnaillist");var a=new o.ListBox(t.content),s=null,u=!1;a.formatItem.addHandler(function(t,o){var r=o.item,a=o.data;if(r.innerHTML="",e._pageView.pages){var s=document.createElement("div"),u=g('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml: space = "preserve" ></svg>'),l=document.createElementNS("http://www.w3.org/2000/svg","g"),h=document.createElementNS("http://www.w3.org/2000/svg","image"),p=document.createElement("div"),d=e._pageView.pages[o.index],_=d.size.height.valueInPixel*i._thumbnailWidth/d.size.width.valueInPixel;n.addClass(r,"wj-thumbnail-item"),h.setAttributeNS("http://www.w3.org/1999/xlink","href",a),h.setAttribute("x","0"),h.setAttribute("y","0"),h.setAttribute("width",i._thumbnailWidth.toString()),h.setAttribute("height",_.toString()),n.addClass(s,"wj-pagethumbnail"),s.setAttribute("tabIndex","-1"),l.appendChild(h),u.appendChild(l),s.appendChild(u),r.appendChild(s),c(u,d),p.className="page-index",p.innerHTML=(o.index+1).toString(),r.appendChild(p)}}),a.selectedIndexChanged.addHandler(function(){u||a.selectedIndex<0||a.selectedIndex==e._pageIndex||(e.moveToPage(a.selectedIndex),e._isMobileTemplate()&&r.collapse())}),e.pageIndexChanged.addHandler(function(){return a.selectedIndex=e._pageIndex});var c=function(e,t){var n=i._thumbnailWidth,o=t.size.height.valueInPixel*n/t.size.width.valueInPixel,r=e.parentNode;switch(I(e,n,o,1,t.rotateAngle),t.rotateAngle){case Ze.Rotation90:case Ze.Rotation270:var a=o;o=n,n=a}r.style.width=n+"px",r.style.height=o+"px",e.setAttribute("width",n.toString()),e.setAttribute("height",o.toString())},l=function(){if(!e._documentSource||!e._documentSource.isLoadCompleted||!e._documentSource.pageCount)return(new ie).resolve(null);for(var t=[],n=0;n<e._documentSource.pageCount;n++)t.push(e._documentSource.getExportedUrl({format:"png",resolution:50,outputRange:n+1}));return new ae(t)},h=function(){var n=function(){t.isActived&&a.itemsSource!==s&&a.deferUpdate(function(){u=!0,a.itemsSource=s,a.selectedIndex=e._pageIndex,u=!1})};!r.isCollapsed&&t.isActived&&(s?n():l().then(function(e){var t=/outputRange=(\d+)/;s=(e||[]).sort(function(e,n){return parseInt(e.match(t)[1])-parseInt(n.match(t)[1])}),n()}))},p=function(){if(!e._documentSource||!e._documentSource.paginated||!e._documentSource.hasThumbnails)return r.hide(t),void(a.itemsSource=null);r.show(t),s=null,h()},d=function(){if(!e._documentSource||!e._documentSource.hasThumbnails)return r.hide(t),void(a.itemsSource=null);P(e._documentEventKey,e._documentSource.loadCompleted,p),P(e._documentEventKey,e._documentSource.pageCountChanged,p),P(e._documentEventKey,e._documentSource.pageSettingsChanged,p),p()};e._documentSourceChanged.addHandler(d),d(),r.expanded.addHandler(function(){h()}),r.tabPageActived.addHandler(function(){h()}),h(),e._pageView.rotateAngleChanged.addHandler(function(){for(var t=a.hostElement.querySelectorAll("svg"),n=0;n<t.length;n++)c(t.item(n),e._pageView.pages[n])})})},i.prototype._initSidePanelExports=function(){var e=this,r=n.Control.getControl(this._sidePanel),i=r.addPage(n.culture.Viewer.exports,t.icons.exports);this._gExportsPageTitle=i.outContent.querySelector(".wj-tabtitle"),this._exportsPageId=i.id,i.format(function(t){var i=d('<div class="wj-exportcontainer"><label wj-part="g-wj-exportformat">'+n.culture.Viewer.exportFormat+'</label><div class="wj-exportformats"></div></div>');t.outContent.querySelector(".wj-tabtitle-wrapper").appendChild(i),e._gExportFormatTitle=t.outContent.querySelector('[wj-part="g-wj-exportformat"]');var a=t.outContent.querySelector(".wj-exportformats");new o.ComboBox(a),n.addClass(t.content.parentElement,"wj-exportformats-wrapper");var s=document.createElement("div"),u=new Ne(s);t.content.appendChild(s);var c=d('<div class="wj-exportformats-footer"><a wj-part="btn-apply" class="wj-btn wj-applybutton" tabindex="-1">'+n.culture.Viewer.exportOk+"</a></div>");t.content.appendChild(c);var l=t.content.querySelector('[wj-part="btn-apply"]');e._gExportsPageApplyBtn=l,_(l,"click",function(){e._export(u.options),r.collapse()})});var a=!0;this._documentSourceChanged.addHandler(function(){a=!0,e._documentSource&&P(e._documentEventKey,e._documentSource.loadCompleted,function(){a&&e._ensureExportFormatsLoaded().then(function(){e._updateExportTab(),a=null==e._exportFormats})})}),r.tabPageActived.addHandler(function(){a&&r.activedTabPage.id===e._exportsPageId&&e._ensureExportFormatsLoaded().then(function(){e._updateExportTab(),a=null==e._exportFormats})})},i.prototype._ensureExportFormatsLoaded=function(){var e=this;if(!this._exportFormats&&this._documentSource&&!this._documentSource.isDisposed)return this._documentSource.getSupportedExportDescriptions().then(function(t){e._exportFormats=t,e._setViewerAction(_t.ShowExportsPanel)});var t=new ie;return t.resolve(),t},i.prototype._updateExportTab=function(e){var t=this;if(this._exportFormats){var o=n.Control.getControl(this._sidePanel).getTabPage(this._exportsPageId),r=n.Control.getControl(o.outContent.querySelector(".wj-exportformats")),i=n.Control.getControl(o.content.firstElementChild);if(e)i.refresh(),r.itemsSource&&r.itemsSource.forEach(function(e){e.name=t._exportItemDescriptions[e.format].name}),r.refresh();else{var s=[];this._exportFormats.forEach(function(e){var n=t._exportItemDescriptions[e.format];a()&&!n.supportIOS||(e.name=n.name,s.push(e))}),r.selectedIndexChanged.addHandler(function(){i.exportDescription=r.selectedItem}),r.itemsSource=s,r.displayMemberPath="name",r.selectedValuePath="format",r.selectedIndex=-1}}},i.prototype._initSidePanelPageSetup=function(){var e=this,o=n.Control.getControl(this._sidePanel),r=o.addPage(n.culture.Viewer.pageSetup,t.icons.pageSetup);this._gPageSetupTitle=r.outContent.querySelector(".wj-tabtitle"),this._pageSetupPageId=r.id,r.format(function(t){var r=document.createElement("div"),i=new He(r);t.content.appendChild(r),n.addClass(r,"wj-pagesetupcontainer");var a=d('<div class="wj-pagesetup-footer"><a wj-part="btn-apply" class="wj-btn wj-applybutton" tabindex="-1">'+n.culture.Viewer.ok+"</a></div>");t.content.appendChild(a);var s=t.content.querySelector('[wj-part="btn-apply"]');e._gPageSetupApplyBtn=s,_(s,"click",function(){e._setPageSettings(i.pageSettings),o.collapse()});var u=function(){i.pageSettings=e._documentSource.pageSettings},c=function(){e._documentSource&&(P(e._documentEventKey,e._documentSource.pageSettingsChanged,u),u())};e._documentSourceChanged.addHandler(c),c()})},i.prototype._executeAction=function(e){if(!this._actionIsDisabled(e))switch(e){case _t.TogglePaginated:this._innerPaginated=!this._innerPaginated;break;case _t.Print:this._documentSource&&this._documentSource.print(this._pages.map(function(e){return e.rotateAngle}));break;case _t.ShowExportsPanel:n.Control.getControl(this._sidePanel).active(this._exportsPageId);break;case _t.Portrait:this._setPageLandscape(!1);break;case _t.Landscape:this._setPageLandscape(!0);break;case _t.ShowPageSetupDialog:this.showPageSetupDialog();break;case _t.FirstPage:this.moveToPage(0);break;case _t.LastPage:this._moveToLastPage();break;case _t.PrePage:this.moveToPage(this._pageIndex-1);break;case _t.NextPage:this.moveToPage(this._pageIndex+1);break;case _t.Backward:this._moveBackwardHistory();break;case _t.Forward:this._moveForwardHistory();break;case _t.SelectTool:this.mouseMode=st.SelectTool;break;case _t.MoveTool:this.mouseMode=st.MoveTool;break;case _t.Continuous:this._addHistory(!1,!0),this.viewMode=ut.Continuous;break;case _t.Single:this._addHistory(!1,!0),this.viewMode=ut.Single;break;case _t.FitPageWidth:this.zoomMode=ct.PageWidth;break;case _t.FitWholePage:this.zoomMode=ct.WholePage;break;case _t.ZoomOut:this._zoomBtnClicked(!1,i._defaultZoomValues);break;case _t.ZoomIn:this._zoomBtnClicked(!0,i._defaultZoomValues);break;case _t.ToggleFullScreen:this.fullScreen=!this.fullScreen;break;case _t.ShowHamburgerMenu:this._hamburgerMenu.showMenu();break;case _t.ShowViewMenu:this._viewMenu.showMenu();break;case _t.ShowSearchBar:this._showSearchBar(n.hasClass(this._searchBar,t._hiddenCss)),this._setViewerAction(_t.ShowSearchBar);break;case _t.ShowThumbnails:n.Control.getControl(this._sidePanel).active(this._thumbnailsPageId);break;case _t.ShowOutlines:n.Control.getControl(this._sidePanel).active(this._outlinesPageId);break;case _t.ShowPageSetupPanel:n.Control.getControl(this._sidePanel).active(this._pageSetupPageId);break;case _t.ShowZoomBar:this._showFooter(!0);break;case _t.SearchPrev:this._searchManager.search(!0);break;case _t.SearchNext:this._searchManager.search();break;case _t.ShowSearchOptions:this._searchOptionsMenu.showMenu(!0);break;case _t.SearchMatchCase:this._searchManager.matchCase=!this._searchManager.matchCase;break;case _t.SearchMatchWholeWord:this._searchManager.wholeWord=!this._searchManager.wholeWord;break;case _t.RubberbandTool:this.mouseMode=st.RubberbandTool;break;case _t.MagnifierTool:this.mouseMode=st.MagnifierTool;break;case _t.RotateDocument:this._rotateDocument();break;case _t.RotatePage:this._rotatePage()}},i.prototype._initSearchOptionsMenu=function(e){this._searchOptionsMenu=new at(this,e)},i.prototype._initHamburgerMenu=function(e){this._hamburgerMenu=new rt(this,e)},i.prototype._initViewMenu=function(e){this._viewMenu=new it(this,e)},i.prototype._initToolbar=function(){new ze(this._toolbar,this),new Ue(this._mobileToolbar,this)},i.prototype._clearExportFormats=function(){this._exportFormats=null},Object.defineProperty(i.prototype,"_exportItemDescriptions",{get:function(){return i._exportItems||(i._exportItems={pdf:{name:n.culture.Viewer.pdfExportName,supportIOS:!0},doc:{name:n.culture.Viewer.docExportName,supportIOS:!1},docx:{name:n.culture.Viewer.docxExportName,supportIOS:!1},rtf:{name:n.culture.Viewer.rtfExportName,supportIOS:!1},xlsx:{name:n.culture.Viewer.xlsxExportName,supportIOS:!0},xls:{name:n.culture.Viewer.xlsExportName,supportIOS:!0},mhtml:{name:n.culture.Viewer.mhtmlExportName,supportIOS:!0},html:{name:n.culture.Viewer.htmlExportName,supportIOS:!0},zip:{name:n.culture.Viewer.metafileExportName,supportIOS:!1},csv:{name:n.culture.Viewer.csvExportName,supportIOS:!0},tiff:{name:n.culture.Viewer.tiffExportName,supportIOS:!0},bmp:{name:n.culture.Viewer.bmpExportName,supportIOS:!1},emf:{name:n.culture.Viewer.emfExportName,supportIOS:!1},gif:{name:n.culture.Viewer.gifExportName,supportIOS:!1},jpeg:{name:n.culture.Viewer.jpegExportName,suportIOS:!1},jpg:{name:n.culture.Viewer.jpegExportName,supportIOS:!1},png:{name:n.culture.Viewer.pngExportName,supportIOS:!1},xml:{name:"XML document",supportIOS:!1}}),i._exportItems},enumerable:!0,configurable:!0}),i.prototype._actionIsChecked=function(e){switch(e){case _t.TogglePaginated:return!0===this._innerPaginated;case _t.Landscape:return!(!this._documentSource||!this._documentSource.pageSettings)&&this._documentSource.pageSettings.landscape;case _t.Portrait:return!(!this._documentSource||!this._documentSource.pageSettings)&&!this._documentSource.pageSettings.landscape;case _t.SelectTool:return this.mouseMode===st.SelectTool;case _t.MoveTool:return this.mouseMode===st.MoveTool;case _t.RubberbandTool:return this.mouseMode===st.RubberbandTool;case _t.MagnifierTool:return this.mouseMode===st.MagnifierTool;case _t.Continuous:return this.viewMode==ut.Continuous;case _t.Single:return this.viewMode==ut.Single;case _t.ToggleFullScreen:return this.fullScreen;case _t.FitPageWidth:return this.zoomMode==ct.PageWidth;case _t.FitWholePage:return this.zoomMode==ct.WholePage;case _t.SearchMatchCase:return this._searchManager.matchCase;case _t.SearchMatchWholeWord:return this._searchManager.wholeWord;case _t.ShowSearchBar:return!n.hasClass(this._searchBar,t._hiddenCss)}return!1},i.prototype._isDocumentSourceLoaded=function(){return this._documentSource&&this._documentSource.isLoadCompleted},i.prototype._actionIsDisabled=function(e){if(!(this._isDocumentSourceLoaded()&&this._documentSource.pageCount>0))return!0;switch(e){case _t.TogglePaginated:return null==this._innerPaginated;case _t.ShowExportsPanel:return!this._exportFormats||0===this._exportFormats.length;case _t.Landscape:case _t.Portrait:case _t.ShowPageSetupDialog:case _t.ShowPageSetupPanel:return!this._documentSource||!this._documentSource.pageSettings||!this._documentSource.paginated;case _t.FirstPage:case _t.PrePage:return this._pageIndex<=0;case _t.LastPage:case _t.NextPage:return this._pageIndex>=this._documentSource.pageCount-1;case _t.Backward:return!this._historyManager.canBackward();case _t.Forward:return!this._historyManager.canForward();case _t.Continuous:case _t.Single:return!this._documentSource||!this._documentSource.paginated;case _t.ZoomOut:return this.zoomFactor<=i._defaultZoomValues[0].value;case _t.ZoomIn:var t=i._defaultZoomValues;return this.zoomFactor>=t[t.length-1].value}return!1},i.prototype._actionIsShown=function(e){var t=this._documentSource?this._documentSource.features:null;switch(e){case _t.TogglePaginated:return t&&t.paginated&&t.nonPaginated;case _t.Landscape:case _t.Portrait:case _t.ShowPageSetupDialog:case _t.ShowPageSetupPanel:return t?t.pageSettings:this._supportsPageSettingActions();case _t.SelectTool:case _t.MoveTool:case _t.MagnifierTool:case _t.RubberbandTool:return!n.isMobile();case _t.ShowSearchBar:return t&&(!this._documentSource.paginated||t.textSearchInPaginatedMode);case _t.ShowOutlines:return this._documentSource&&this._documentSource.hasOutlines;case _t.ShowThumbnails:return this._documentSource&&this._documentSource.hasThumbnails}return!0},i.prototype._onViewerActionStatusChanged=function(e){this._viewerActionStatusChanged.raise(this,e)},i.prototype._setViewerAction=function(e,t,n,o){var r={actionType:e,disabled:t||this._actionIsDisabled(e),checked:n||this._actionIsChecked(e),shown:o||this._actionIsShown(e)};this._onViewerActionStatusChanged({action:r})},i.prototype._updateViewerActions=function(){this._updatePageSettingsActions(),this._updateViewModeActions(),this._updateMouseModeActions(),this._setViewerAction(_t.ShowExportsPanel)},i.prototype._updateViewModeActions=function(){this._setViewerAction(_t.Continuous),this._setViewerAction(_t.Single)},i.prototype._updatePageSettingsActions=function(){this._setViewerAction(_t.TogglePaginated),this._setViewerAction(_t.Landscape),this._setViewerAction(_t.Portrait),this._setViewerAction(_t.ShowPageSetupDialog)},i.prototype._updateMouseModeActions=function(){this._setViewerAction(_t.SelectTool),this._setViewerAction(_t.MoveTool),this._setViewerAction(_t.MagnifierTool),this._setViewerAction(_t.RubberbandTool)},i.prototype._updateZoomModeActions=function(){this._setViewerAction(_t.FitPageWidth),this._setViewerAction(_t.FitWholePage)},i.prototype._updateZoomFactorActions=function(){this._setViewerAction(_t.ZoomOut),this._setViewerAction(_t.ZoomIn)},i.prototype._onPageSettingsUpdated=function(){this._updatePageSettingsActions(),this._updateViewModeActions(),this._resetToolbarWidth()},i.prototype._onPageCountUpdated=function(){this._updatePageNavActions(),this._resetToolbarWidth()},i.prototype._updatePageNavActions=function(){this._setViewerAction(_t.FirstPage),this._setViewerAction(_t.LastPage),this._setViewerAction(_t.PrePage),this._setViewerAction(_t.NextPage)},i.prototype._onHistoryManagerStatusUpdated=function(){this._setViewerAction(_t.Backward),this._setViewerAction(_t.Forward)},i.prototype._updateUI=function(){var e=this;Object.keys(_t).forEach(function(t){isNaN(t)||e._setViewerAction(_t[_t[t]])});var t=n.Control.getControl(this._sidePanel);t&&t.enableAll(this._isDocumentSourceLoaded())},i.prototype._updateViewContainerCursor=function(){this.mouseMode===st.MoveTool?n.hasClass(this._viewpanelContainer,"move")||n.addClass(this._viewpanelContainer,"move"):n.hasClass(this._viewpanelContainer,"move")&&n.removeClass(this._viewpanelContainer,"move")},i.prototype._updateFullScreenStyle=function(){var e=document.body;this.fullScreen?(this._bodyOriginScrollLeft=document.documentElement&&document.documentElement.scrollLeft||e.scrollLeft,this._bodyOriginScrollTop=document.documentElement&&document.documentElement.scrollTop||e.scrollTop,n.addClass(this.hostElement,"full-screen"),n.addClass(e,"full-screen"),this._hostOriginWidth=this.hostElement.style.width,this._hostOriginHeight=this.hostElement.style.height,this.hostElement.style.width="100%",this.hostElement.style.height="100%",window.scrollTo(0,0)):(n.removeClass(this.hostElement,"full-screen"),n.removeClass(e,"full-screen"),this.hostElement.style.width=this._hostOriginWidth,this.hostElement.style.height=this._hostOriginHeight,n.isNumber(this._bodyOriginScrollLeft)&&(document.documentElement&&(document.documentElement.scrollLeft=this._bodyOriginScrollLeft),e.scrollLeft=this._bodyOriginScrollLeft),n.isNumber(this._bodyOriginScrollTop)&&(document.documentElement&&(document.documentElement.scrollTop=this._bodyOriginScrollTop),e.scrollTop=this._bodyOriginScrollTop)),this.refresh()},i.prototype._export=function(e){this._documentSource.getExportedUrl(e).then(function(e){if(a())window.open(e);else{var t=document.querySelector("#viewDownloader");t||((t=document.createElement("iframe")).id="viewDownloader",t.style.display="none",document.body.appendChild(t)),t.src=e}})},i.prototype.showPageSetupDialog=function(){this._pageSetupDialog||this._createPageSetupDialog(),this._pageSetupDialog.showWithValue(this._documentSource.pageSettings)},i.prototype._createPageSetupDialog=function(){var e=this,t=document.createElement("div");t.style.display="none",e.hostElement.appendChild(t),e._pageSetupDialog=new gt(t),e._pageSetupDialog.applied.addHandler(function(){return e._setPageSettings(e._pageSetupDialog.pageSettings)})},i.prototype.zoomToView=function(){n._deprecated("zoomToView","zoomMode"),this._documentSource&&(this.zoomMode=ct.WholePage)},i.prototype.zoomToViewWidth=function(){n._deprecated("zoomToViewWidth","zoomMode"),this._documentSource&&(this.zoomMode=ct.PageWidth)},i.prototype._setPageLandscape=function(e){var t=this,n=this._documentSource.pageSettings;c(n,e),t._setPageSettings(n)},i.prototype._setPaginated=function(e){var t=this._documentSource.features,n=this._documentSource.pageSettings;t&&n&&e!=n.paginated&&(e&&t.paginated?(n.paginated=!0,this._setPageSettings(n)):!e&&t.nonPaginated&&(n.paginated=!1,this._setPageSettings(n)))},i.prototype._setPageSettings=function(e){var t=this;return this._showViewPanelMessage(),this._setDocumentRendering(),this._documentSource.setPageSettings(e).then(function(e){t._resetDocument(),t._reRenderDocument()}).catch(function(e){t._showViewPanelErrorMessage(C(e))})},i.prototype._showViewPanelErrorMessage=function(e){this._showViewPanelMessage(e,"errormessage")},i.prototype._showViewPanelMessage=function(e,t){var o=this._viewpanelContainer.querySelector(".wj-viewer-loading");o||((o=document.createElement("div")).innerHTML='<span class="verticalalign"></span><span class="textspan"></span>',this._viewpanelContainer.appendChild(o)),o.className="wj-viewer-loading",t&&n.addClass(o,t);var r=o.querySelector(".textspan");r&&(r.innerHTML=e||n.culture.Viewer.loading)},i.prototype._removeViewPanelMessage=function(){var e=this._viewpanelContainer.querySelector(".wj-viewer-loading");e&&this._viewpanelContainer.removeChild(e)},i.prototype._reRenderDocument=function(){this._documentSource&&(this._showViewPanelMessage(),this._documentSource.load())},i.prototype._zoomBtnClicked=function(e,t){var n,o;for(n=0;n<t.length;n++){if(t[n].value>this.zoomFactor){o=n-.5;break}if(t[n].value===this.zoomFactor){o=n;break}}null==o&&(o=t.length-.5),o<=0&&!e||o>=t.length-1&&e||(o=e?Math.floor(o)+1:Math.ceil(o)-1,this.zoomFactor=t[o].value)},i.prototype._getDocumentSource=function(){return this._documentSource},i.prototype._setDocumentSource=function(e){var t=this;this._loadDocument(e).then(function(n){t._documentSource==e&&t._ensureExportFormatsLoaded()})},i.prototype._loadDocument=function(e){var t=this,n=new ie;return this._documentSource===e?n:(this._disposeDocument(),this._documentSource=e,e&&(P(this._documentEventKey,e.loading,function(){t._updateUI()},this),P(this._documentEventKey,e.loadCompleted,this._onDocumentSourceLoadCompleted,this),P(this._documentEventKey,e.queryLoadingData,function(e,n){t.onQueryLoadingData(n)},this),e.isLoadCompleted?(this._onDocumentSourceLoadCompleted(),this._keepServiceConnection(),n.resolve()):(this._showViewPanelMessage(),e.load().then(function(e){t._keepServiceConnection(),n.resolve(e)}).catch(function(e){t._showViewPanelErrorMessage(C(e))}))),this._onDocumentSourceChanged(),n)},i.prototype._actionElementClicked=function(e){var t=this._getActionInfo(e);t&&(t.kind===ht.Bookmark?this._goToBookmark(t):t.kind===ht.Custom&&this._executeCustomAction(t))},i.prototype._getActionInfo=function(e){var t=e.getAttribute(Je._bookmarkAttr);return t?{kind:ht.Bookmark,data:t}:(t=e.getAttribute(Je._customActionAttr))?{kind:ht.Custom,data:t}:null},i.prototype._onDocumentSourceLoadCompleted=function(){var e=this,t=this._documentSource.errors;if(this._documentSource.isLoadCompleted){if(this._removeViewPanelMessage(),this._pages.length=0,this._documentSource.pageCount<=0)return void this._updateUI();for(var n={width:this._documentSource.pageSettings.width,height:this._documentSource.pageSettings.height},o=0;o<this._documentSource.pageCount;o++){var r=this._createPage(o,n);r.linkClicked.addHandler(function(t,n){e._magnifier&&e._magnifier.isActive||e._rubberband&&e._rubberband.isActive||e._actionElementClicked(n.element)}),this._pages.push(r)}this._pageView.pages=this._pages,this._autoHeightCalculated||(this._autoCalculateHeight(),this._autoHeightCalculated=!0);var i=this._documentSource.initialPosition||this._initialPosition;if(this._documentSource.initialPosition=null,this._initialPosition=null,i&&0!=i.pageIndex||(this._pageIndex=0,i={pageIndex:0}),this._scrollToPosition(i),this._updateHistoryCurrent(),this._documentSource.paginated||(this.viewMode=ut.Single),t&&t.length>0)for(o=0;o<t.length;o++)t[o]+"\r\n";this._updateUI()}},i.prototype._createPage=function(e,t){return new Je(this._documentSource,e,t)},i.prototype._clearKeepSerConnTimer=function(){null!=this._keepSerConnTimer&&clearTimeout(this._keepSerConnTimer)},i.prototype._keepServiceConnection=function(){var e=this;this._clearKeepSerConnTimer();var t=this._documentSource;t&&(this._keepSerConnTimer=setTimeout(function(){e._documentSource===t&&e._documentSource.getStatus().then(function(t){return e._keepServiceConnection()})},this._getExpiredTime()))},i.prototype._getExpiredTime=function(){if(this._expiredTime)return this._expiredTime;var e=this._documentSource;return e&&e.expiredDateTime&&e.executionDateTime?(this._expiredTime=e.expiredDateTime.getTime()-e.executionDateTime.getTime(),this._expiredTime=Math.max(this._expiredTime-12e4,0),this._expiredTime):6e3},i.prototype._disposeDocument=function(){this._documentSource&&(S(this._documentEventKey,this._documentSource.disposed),S(this._documentEventKey,this._documentSource.pageCountChanged),S(this._documentEventKey,this._documentSource.pageSettingsChanged),S(this._documentEventKey,this._documentSource.loadCompleted),S(this._documentEventKey,this._documentSource.queryLoadingData),this._documentSource.dispose()),this._resetDocument()},i.prototype._resetDocument=function(){this._pages.length=0,this._pageView.resetPages(),this._pageIndex=0,clearTimeout(this._historyTimer),this._historyManager.clear(),this._rubberband&&this._rubberband.reset(),this._magnifier&&this._magnifier.reset()},i.prototype._setDocumentRendering=function(){this._documentSource._updateIsLoadCompleted(!1)},i.prototype.moveToPage=function(e){return this._innerMoveToPage(e)},i.prototype._getCurrentPosition=function(){return j(this._pageView.hitTest(0,0))},i.prototype._resolvePageIndex=function(e){return Math.min(this._documentSource.pageCount-1,Math.max(e,0))},i.prototype._innerMoveToPage=function(e){return this._resolvePageIndex(e)!=this.pageIndex&&this._addHistory(!1,!0),this._updatePageIndex(e),this._pageView.moveToPage(e)},i.prototype._moveToLastPage=function(){var e=new ie;return this._ensureDocumentLoadCompleted(e)?this._innerMoveToPage(this._documentSource.pageCount-1):e},i.prototype._moveBackwardHistory=function(){if(this._ensureDocumentLoadCompleted()&&this._historyManager.canBackward()){var e=this._historyManager.backward();this._moveToHistory(e)}},i.prototype._moveForwardHistory=function(){if(this._ensureDocumentLoadCompleted()&&this._historyManager.canForward()){var e=this._historyManager.forward();this._moveToHistory(e)}},i.prototype._moveToHistory=function(e){var t=this;if(e){this._historyMoving=!0,this.viewMode=e.viewMode,e.zoomMode===ct.Custom?this.zoomFactor=e.zoomFactor:this.zoomMode=e.zoomMode,this._scrollToPosition(e.position).then(function(e){t._historyMoving=!1});for(var n=0;n<e.pageAngles.length;n++)this._pageView.rotatePageTo(n,e.pageAngles[n])}},i.prototype._isPositionEquals=function(e,t,n){return e.pageIndex===t.pageIndex&&(!n||(e.pageBounds==t.pageBounds||null!=e.pageBounds&&null!=t.pageBounds&&(e.pageBounds.x===t.pageBounds.x&&e.pageBounds.y===t.pageBounds.y)))},i.prototype._isPageAnglesChanged=function(e){if(e.length!=this._pageView.pages.length)return!0;for(var t=e.length,n=0;n<t;n++)if(e[n]!==this._pageView.pages[n].rotateAngle)return!0;return!1},i.prototype._updateHistoryCurrent=function(){this._historyManager.current.position=this._getCurrentPosition(),this._historyManager.current.zoomMode=this.zoomMode,this._historyManager.current.zoomFactor=this.zoomFactor,this._historyManager.current.viewMode=this.viewMode,this._updateCurrentPageAngles(this._historyManager.current)},i.prototype._innerAddHistory=function(e){var t=this._getCurrentPosition(),n=this._historyManager.current;this._isPositionEquals(t,n.position,e)&&this.viewMode===n.viewMode&&this.zoomMode===n.zoomMode&&this.zoomFactor===n.zoomFactor&&!this._isPageAnglesChanged(n.pageAngles)||(n.position=n.position||this._getCurrentPosition(),n.viewMode=null==n.viewMode?this.viewMode:n.viewMode,n.zoomMode=null==n.zoomMode?this.zoomMode:n.zoomMode,n.zoomFactor=null==n.zoomFactor?this.zoomFactor:n.zoomFactor,n.pageAngles||this._updateCurrentPageAngles(n),this._historyManager.add(),this._updateHistoryCurrent())},i.prototype._addHistory=function(e,t,n){var o=this;this.isUpdating||this._historyMoving||(t?(this._mergeHistory(n),null!=this._historyTimer&&clearTimeout(this._historyTimer),this._historyTimer=setTimeout(function(){o._historyTimer=null,o._innerAddHistory(e)},i._historyTimeout)):this._innerAddHistory(e))},i.prototype._updateCurrentPageAngles=function(e){e.pageAngles||(e.pageAngles=new Array);for(var t=this._pageView.pages.length,n=0;n<t;n++)e.pageAngles[n]=this._pageView.pages[n].rotateAngle},i.prototype._mergeHistory=function(e){var t=this._historyManager.current;if(!e)return t.viewMode=this.viewMode,t.zoomMode=this.zoomMode,t.zoomFactor=this.zoomFactor,void this._updateCurrentPageAngles(t);if(null!=e.viewMode&&(t.viewMode=e.viewMode),null!=e.zoomMode&&(t.zoomMode=e.zoomMode),null!=e.zoomFactor&&(t.zoomFactor=e.zoomFactor),e.pageAngles){t.pageAngles=new Array;for(var n=this._pageView.pages.length,o=0;o<n;o++)t.pageAngles[o]=e.pageAngles[o]}},i.prototype._ensureDocumentLoadCompleted=function(e){return this._documentSource?!!this._documentSource.isLoadCompleted||(e&&e.reject("Cannot set page index when document source is not loaded completely."),!1):(e&&e.reject("Cannot set page index without document source."),!1)},i.prototype._updatePageIndex=function(e){this._documentSource&&(e=Math.min(this._documentSource.pageCount-1,Math.max(e,0)),this._pageIndex!==e&&(this._pageIndex=e,this.onPageIndexChanged()))},i.prototype._getRotatedAngle=function(e){switch(e){case Ze.NoRotate:return Ze.Rotation90;case Ze.Rotation90:return Ze.Rotation180;case Ze.Rotation180:return Ze.Rotation270;case Ze.Rotation270:return Ze.NoRotate}return Ze.NoRotate},i.prototype._rotateDocument=function(){this._addHistory(!1,!0);for(var e=this._pageView.pages.length,t=0;t<e;t++)this._pageView.rotatePageTo(t,this._getRotatedAngle(this._pageView.pages[t].rotateAngle))},i.prototype._rotatePage=function(){this._addHistory(!1,!0);var e=this._pageView.pages[this._pageIndex];this._pageView.rotatePageTo(this._pageIndex,this._getRotatedAngle(e.rotateAngle))},Object.defineProperty(i.prototype,"zoomMode",{get:function(){return this._pageView.zoomMode},set:function(e){this._pageView.zoomMode=n.asEnum(e,ct),this._updateZoomModeActions()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"zoomFactor",{get:function(){return this._pageView.zoomFactor},set:function(e){this._pageView.zoomFactor=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"viewMode",{get:function(){return this._viewMode},set:function(e){e=n.asEnum(e,ut),this._viewMode!==e&&(this._viewMode=e,this.onViewModeChanged())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"selectMouseMode",{get:function(){return this._mouseMode===st.SelectTool},set:function(e){n._deprecated("selectMouseMode","mouseMode"),e&&this._mouseMode===st.SelectTool||!e&&this._mouseMode!==st.SelectTool||(this.mouseMode=e?st.SelectTool:st.MoveTool)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"mouseMode",{get:function(){return this._mouseMode},set:function(e){if(this._mouseMode!==(e=n.asEnum(e,st))){var t=this.selectMouseMode;switch(this._mouseMode=e,this._mouseMode){case st.RubberbandTool:this._rubberband.activate(),this._magnifier.deactivate();break;case st.MagnifierTool:this._magnifier.activate(),this._rubberband.deactivate();break;default:this._magnifier.deactivate(),this._rubberband.deactivate()}this.onMouseModeChanged(),t!=this.selectMouseMode&&this.onSelectMouseModeChanged()}},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"fullScreen",{get:function(){return this._fullScreen},set:function(e){this._fullScreen!==e&&(this._fullScreen=e,this.onFullScreenChanged())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"pageIndex",{get:function(){return this._pageIndex},enumerable:!0,configurable:!0}),i.prototype._initMiniToolbar=function(){n.Control.getControl(this._miniToolbar)||(new Le(this._miniToolbar,this),n.addClass(this._miniToolbar,"wj-mini-toolbar"))},i.prototype._pinMiniToolbar=function(){var e=this;this._showMiniToolbar(!0),this._miniToolbarPinnedTimer=setTimeout(function(){e._showMiniToolbar(!1),e._miniToolbarPinnedTimer=null},i._miniToolbarPinnedTime)},i.prototype._onDocumentSourceChanged=function(e){this._clearExportFormats(),this._documentSourceChanged.raise(this,e||new n.EventArgs),this._updateViewerActions(),this._onPageSettingsUpdated(),this._onPageCountUpdated(),this._updateViewModeActions(),this._searchManager.documentSource=this._documentSource,this._documentSource&&(P(this._documentEventKey,this._documentSource.pageSettingsChanged,this._onPageSettingsUpdated,this),P(this._documentEventKey,this._documentSource.pageCountChanged,this._onPageCountUpdated,this),P(this._documentEventKey,this._documentSource.loadCompleted,this._onPageCountUpdated,this))},i.prototype.onPageIndexChanged=function(e){this.pageIndexChanged.raise(this,e||new n.EventArgs),this._updatePageNavActions()},i.prototype.onViewModeChanged=function(e){this.viewModeChanged.raise(this,e||new n.EventArgs),this._updateViewModeActions(),this._pageView.viewMode=this.viewMode},i.prototype.onSelectMouseModeChanged=function(e){this.selectMouseModeChanged.hasHandlers&&n._deprecated("selectMouseModeChanged","mouseModeChanged"),this.selectMouseModeChanged.raise(this,e)},i.prototype.onMouseModeChanged=function(e){this.mouseModeChanged.raise(this,e||new n.EventArgs),(this.mouseMode!==st.MoveTool&&this.mouseMode!==st.SelectTool||!n.isMobile())&&(this._updateMouseModeActions(),this._updateViewContainerCursor(),this._pageView.panMode=this.mouseMode===st.MoveTool)},i.prototype.onFullScreenChanged=function(e){this.fullScreenChanged.raise(this,e||new n.EventArgs),this._setViewerAction(_t.ToggleFullScreen),this._updateFullScreenStyle(),this.fullScreen&&this._pinMiniToolbar()},i.prototype.onZoomFactorChanged=function(e){this.zoomFactorChanged.raise(this,e||new n.EventArgs),this._updateZoomFactorActions(),this._updateZoomModeActions()},i.prototype.onQueryLoadingData=function(e){this.queryLoadingData.raise(this,e)},i._seperatorHtml="<div class='wj-separator' style='width:100%;height: 1px;margin: 3px 0;background-color:rgba(0,0,0,.2)'/>",i._viewpanelContainerMinHeight=300,i._miniToolbarPinnedTime=3e3,i._narrowCss="narrow",i._narrowWidthThreshold=400,i._thumbnailWidth=100,i._historyTimeout=300,i._defaultZoomValues=[{name:n.Globalize.format(.05,"p0"),value:.05},{name:n.Globalize.format(.25,"p0"),value:.25},{name:n.Globalize.format(.5,"p0"),value:.5},{name:n.Globalize.format(.75,"p0"),value:.75},{name:n.Globalize.format(1,"p0"),value:1},{name:n.Globalize.format(2,"p0"),value:2},{name:n.Globalize.format(3,"p0"),value:3},{name:n.Globalize.format(4,"p0"),value:4},{name:n.Globalize.format(8,"p0"),value:8},{name:n.Globalize.format(10,"p0"),value:10}],i.controlTemplate='<div class="wj-viewer-outer wj-content with-footer"><div wj-part="toolbar"></div><div wj-part="mobile-toolbar"></div><div class="wj-viewer-container" wj-part="viewer-container"><div class="wj-viewer-leftpanel" wj-part="viewer-left-panel"><div class="wj-viewer-tabsleft" wj-part="side-panel"></div></div><div class="wj-viewer-splitter" wj-part="splitter"><button class="wj-btn wj-btn-default" type="button"><span class="wj-glyph-right"></span></button></div><div class="wj-viewpanel-container" wj-part="viewpanel-container"></div></div><div wj-part="mini-toolbar"></div><div class="wj-searchbar mobile" wj-part="search-bar"></div><div class="wj-viewer-footer mobile" class="wj-viewer-footer" wj-part="viewer-footer"><div wj-part="zoom-bar"></div><span class="wj-close">×</span></div></div>',i}(n.Control);t.ViewerBase=dt;var gt=function(e){function t(t){var r=e.call(this,t)||this;r.applied=new n.Event;var i;return r.modal=!0,r.hideTrigger=o.PopupTrigger.None,i=r.getTemplate(),r.applyTemplate("wj-control wj-content",i,{_gHeader:"g-header",_pageSetupEditorElement:"pagesetup-editor",_btnApply:"btn-apply",_btnCancel:"btn-cancel",_btnClose:"a-close"}),r._pageSetupEditor=new He(r._pageSetupEditorElement),r._globalize(),r._addEvents(),r}return __extends(t,e),Object.defineProperty(t.prototype,"pageSettings",{get:function(){return this._pageSetupEditor.pageSettings},enumerable:!0,configurable:!0}),t.prototype._globalize=function(){var e=n.culture.Viewer;this._gHeader.textContent=e.pageSetup,this._btnApply.textContent=e.ok,this._btnCancel.textContent=e.cancel},t.prototype._addEvents=function(){var e=this;_(e._btnClose,"click",function(){e.hide()}),_(e._btnCancel,"click",function(){e.hide()}),_(e._btnApply,"click",function(){e._apply(),e.hide()})},t.prototype._apply=function(){this.onApplied()},t.prototype.onApplied=function(){this.applied.raise(this,new n.EventArgs)},t.prototype.showWithValue=function(t){this._pageSetupEditor.pageSettings=t,e.prototype.show.call(this)},t.prototype.refresh=function(t){void 0===t&&(t=!0),e.prototype.refresh.call(this,t),t&&(this._globalize(),this._pageSetupEditor.refresh())},t.controlTemplate='<div><div wj-part="g-header" class="wj-dialog-header"><a class="wj-hide" wj-part="a-close" style="float:right;outline:none;text-decoration:none;padding:0px 6px" href="" tabindex="-1" draggable="false">&times;</a></div><div style="padding:12px;"><div wj-part="pagesetup-editor"></div></div><div class="wj-dialog-footer"><a wj-part="btn-apply" class="wj-hide wj-btn" tabindex="-1"></a>&nbsp;&nbsp;<a wj-part="btn-cancel" class="wj-hide wj-btn" tabindex="-1"></a></div></div>',t}(o.Popup);t._PageSetupDialog=gt;var _t;!function(e){e[e.TogglePaginated=0]="TogglePaginated",e[e.Print=1]="Print",e[e.Portrait=2]="Portrait",e[e.Landscape=3]="Landscape",e[e.ShowPageSetupDialog=4]="ShowPageSetupDialog",e[e.FirstPage=5]="FirstPage",e[e.PrePage=6]="PrePage",e[e.NextPage=7]="NextPage",e[e.LastPage=8]="LastPage",e[e.PageNumber=9]="PageNumber",e[e.PageCountLabel=10]="PageCountLabel",e[e.Backward=11]="Backward",e[e.Forward=12]="Forward",e[e.SelectTool=13]="SelectTool",e[e.MoveTool=14]="MoveTool",e[e.Continuous=15]="Continuous",e[e.Single=16]="Single",e[e.ZoomOut=17]="ZoomOut",e[e.ZoomIn=18]="ZoomIn",e[e.ZoomValue=19]="ZoomValue",e[e.FitWholePage=20]="FitWholePage",e[e.FitPageWidth=21]="FitPageWidth",e[e.ToggleFullScreen=22]="ToggleFullScreen",e[e.ShowHamburgerMenu=23]="ShowHamburgerMenu",e[e.ShowViewMenu=24]="ShowViewMenu",e[e.ShowSearchBar=25]="ShowSearchBar",e[e.ShowThumbnails=26]="ShowThumbnails",e[e.ShowOutlines=27]="ShowOutlines",e[e.ShowExportsPanel=28]="ShowExportsPanel",e[e.ShowPageSetupPanel=29]="ShowPageSetupPanel",e[e.ShowZoomBar=30]="ShowZoomBar",e[e.ShowSearchOptions=31]="ShowSearchOptions",e[e.SearchPrev=32]="SearchPrev",e[e.SearchNext=33]="SearchNext",e[e.SearchMatchCase=34]="SearchMatchCase",e[e.SearchMatchWholeWord=35]="SearchMatchWholeWord",e[e.RubberbandTool=36]="RubberbandTool",e[e.MagnifierTool=37]="MagnifierTool",e[e.RotateDocument=38]="RotateDocument",e[e.RotatePage=39]="RotatePage"}(_t=t._ViewerActionType||(t._ViewerActionType={}));var mt=function(e){function t(t,n,o,r,i,a,s){var u=e.call(this,t)||this;return u._stopOnClientOut=r,u._css=i,u._activeCss=a,u._visibleCss=s,u._pageView=o,u._viewPanelContainer=n,u._initElement(),u._bindEvents(),u}return __extends(t,e),t.prototype.activate=function(){this._isActive||(this._isActive=!0,n.addClass(this._viewPanelContainer,this._activeCss))},t.prototype.deactivate=function(){this._isActive&&(this._isActive=!1,n.removeClass(this._viewPanelContainer,this._activeCss))},t.prototype.reset=function(){this._innerStop(null)},Object.defineProperty(t.prototype,"isActive",{get:function(){return this._isActive},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"startPnt",{get:function(){return this._startPnt},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pageView",{get:function(){return this._pageView},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"viewPanelContainer",{get:function(){return this._viewPanelContainer},enumerable:!0,configurable:!0}),t.prototype._initElement=function(){this.applyTemplate(this._css,this.getTemplate(),this._getTemplateParts()),this._viewPanelContainer.appendChild(this.hostElement)},t.prototype._innerStop=function(e){try{this._stop(e)}finally{this._isStarted=!1,this._startPnt=null}},t.prototype._getTemplateParts=function(){return null},t.prototype._onMouseDown=function(e){var t=this._toClientPoint(e),n=this._testPageWorkingAreaHit(t);n&&this.pageView.isPageContentLoaded(n.pageIndex)&&(void 0!==window.getSelection&&getSelection().removeAllRanges(),this._isStarted=!0,this._startPnt=t,this._start(n))},t.prototype._onMouseMove=function(e){if(this._isStarted){var t=this._toClientPoint(e),n=this._testPageWorkingAreaHit(t);n&&this.pageView.isPageContentLoaded(n.pageIndex)?this._move(t,n):this._stopOnClientOut&&this._stop(t)}},t.prototype._onMouseUp=function(e){this._isStarted&&this._innerStop(this._toClientPoint(e))},t.prototype._start=function(e){n.addClass(this.hostElement,this._visibleCss)},t.prototype._move=function(e,t){},t.prototype._stop=function(e){n.removeClass(this.hostElement,this._visibleCss)},t.prototype._bindEvents=function(){var e=this;this.addEventListener(this._viewPanelContainer,"mousedown",function(t){e._isActive&&e._onMouseDown(t)}),this.addEventListener(this._viewPanelContainer,"mousemove",function(t){e._isActive&&e._onMouseMove(t)}),this.addEventListener(document,"mouseup",function(t){e._isActive&&e._onMouseUp(t)})},t.prototype._toClientPoint=function(e){var t=this._viewPanelContainer.getBoundingClientRect();return new n.Point(e.clientX-t.left,e.clientY-t.top)},t.prototype._testPageWorkingAreaHit=function(e){var t=this._pageView.hitTest(e.x,e.y);return t&&t.hitWorkingArea?t:null},t}(n.Control);t._MouseTool=mt;var ft=function(e){function t(t){var n=e.call(this)||this;return n._rect=t,n}return __extends(t,e),Object.defineProperty(t.prototype,"rect",{get:function(){return this._rect},enumerable:!0,configurable:!0}),t}(n.EventArgs);t._RubberbandOnAppliedEventArgs=ft;var vt=function(e){function t(t,o,r){var i=e.call(this,t,o,r,!1,"wj-rubberband","rubberband-actived","show")||this;return i.applied=new n.Event,i}return __extends(t,e),t.prototype._start=function(t){e.prototype._start.call(this,t),this.hostElement.style.left=this.startPnt.x+"px",this.hostElement.style.top=this.startPnt.y+"px"},t.prototype._move=function(e,t){if(this.startPnt){this.viewPanelContainer.getBoundingClientRect();this.hostElement.style.width=e.x-this.startPnt.x+"px",this.hostElement.style.height=e.y-this.startPnt.y+"px"}},t.prototype._stop=function(t){if(t){var o=this.hostElement.getBoundingClientRect();o.width>5&&o.height>5&&this._onApplied(new ft(new n.Rect(this.startPnt.x,this.startPnt.y,o.width,o.height)))}this.hostElement.style.width="0px",this.hostElement.style.height="0px",e.prototype._stop.call(this,t)},t.prototype._onApplied=function(e){this.applied.raise(this,e)},t}(mt);t._Rubberband=vt;var yt=function(e){function t(t,n,o){var r=e.call(this,t,n,o,!0,"wj-magnifier","magnifier-actived","show")||this;return r._Magnification=2,r._currentPageIndex=-1,r}return __extends(t,e),t.prototype.deactivate=function(){e.prototype.deactivate.call(this),this._currentPageIndex=-1},t.prototype.reset=function(){e.prototype.reset.call(this),this._currentPageIndex=-1},t.prototype._getTemplateParts=function(){return{_viewPageDiv:"view-page-div"}},t.prototype._bindEvents=function(){var t=this;e.prototype._bindEvents.call(this);var n=function(){if(!(t._currentPageIndex<0)){var e=t.pageView.pages[t._currentPageIndex],n=A(e.size,e.rotateAngle),o=t._viewPageDiv.querySelector("svg");t._viewPageDiv.style.height=n.height.valueInPixel*t.pageView.zoomFactor*t._Magnification+"px",t._viewPageDiv.style.width=n.width.valueInPixel*t.pageView.zoomFactor*t._Magnification+"px",o.setAttribute("width",t._viewPageDiv.style.width),o.setAttribute("height",t._viewPageDiv.style.height),I(o,e.size.width.valueInPixel,e.size.height.valueInPixel,t._Magnification*t.pageView.zoomFactor,e.rotateAngle)}};this.pageView.zoomFactorChanged.addHandler(function(){n()}),this.pageView.rotateAngleChanged.addHandler(function(){n()})},t.prototype._start=function(t){e.prototype._start.call(this,t),this._showMagnifer(this.startPnt,t)},t.prototype._move=function(e,t){this._showMagnifer(e,t)},t.prototype._showMagnifer=function(e,t){var n=this.hostElement.getBoundingClientRect(),o=j(t);this.hostElement.style.left=e.x-n.width/2+"px",this.hostElement.style.top=e.y-n.height/2+"px",this._fillPage(o),this._showHitPosition(o)},t.prototype._fillPage=function(e){var t=this;e.pageIndex!==this._currentPageIndex&&(this._currentPageIndex=e.pageIndex,this.pageView.pages[this._currentPageIndex].getContent().then(function(e){var n=e.cloneNode(!0);t._viewPageDiv.innerHTML="",t._viewPageDiv.appendChild(n),n.setAttribute("width",new re(n.getAttribute("width")).valueInPixel*t._Magnification+"px"),n.setAttribute("height",new re(n.getAttribute("height")).valueInPixel*t._Magnification+"px");var o=t.pageView.pages[t._currentPageIndex].size;I(n,o.width.valueInPixel,o.height.valueInPixel,t._Magnification*t.pageView.zoomFactor,t.pageView.pages[t._currentPageIndex].rotateAngle),t._viewPageDiv.style.width=n.getAttribute("width"),t._viewPageDiv.style.height=n.getAttribute("height")}))},t.prototype._showHitPosition=function(e){var t=this.hostElement.getBoundingClientRect(),n=this.pageView.pages[this._currentPageIndex],o=V(e.pageBounds,n.size,n.rotateAngle,this.pageView.zoomFactor);this._viewPageDiv.style.left=-o.x*this._Magnification+t.width/2+"px",this._viewPageDiv.style.top=-o.y*this._Magnification+t.height/2+"px"},t.controlTemplate='<div wj-part="view-page-div" class="wj-view-page"></div>',t}(mt);t._Magnifier=yt;var wt='<path d="M24,11.9v-2h-4V7h0V5h0h-1h-5V2h0V0h0h-1H1H0h0v2h0v11h0v1h0h1h5v4h0v1h0h1h3v4h0v1h0h1h2.1v-1H11V12h2.1v-2H11h-1h0v2h0v6H7V7h12v2.9h-1v2h5V23h-4.9v1H23h1h0v-1h0L24,11.9L24,11.9z M6,5L6,5l0,2h0v6H1V2h12v3H7H6z"/><path d="M20,20v-3v-1h-1h-1v-1v-1h-1h-3h-1v1v3v1h1h1v2h0h1h3h1h0L20,20L20,20z M14,18v-3h3v1h-1h-1v1v1H14z M17,17v1h-1v-1H17z M16,20v-1h1h1v-1v-1h1v3H16z"/>',bt=function(e){function t(t,n){var o=e.call(this,t,n)||this;return o._initSidePanelParameters(),o}return __extends(t,e),t.prototype._getProductInfo=function(){return"QNI5,ReportViewer"},Object.defineProperty(t.prototype,"reportName",{get:function(){return this._reportName},set:function(e){e!=this._reportName&&(this._reportName=e,this._needBindDocumentSource(),this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"paginated",{get:function(){return this._innerPaginated},set:function(e){this._innerPaginated=e},enumerable:!0,configurable:!0}),t.getReportNames=function(e,t){return le.getReportNames(e,t)},t.getReports=function(e,t,n){return le.getReports(e,t,n)},t.prototype._globalize=function(){e.prototype._globalize.call(this);var t=n.culture.Viewer;this._gParameterTitle.textContent=t.parameters},t.prototype._executeAction=function(o){if(e.prototype._executeAction.call(this,o),!this._actionIsDisabled(o))switch(o){case t._parameterCommandTag:n.Control.getControl(this._sidePanel).active(this._parametersPageId)}},t.prototype._actionIsDisabled=function(n){switch(n){case t._parameterCommandTag:return!this._innerDocumentSource||!this._innerDocumentSource.hasParameters}return e.prototype._actionIsDisabled.call(this,n)},t.prototype._initHamburgerMenu=function(e){this._hamburgerMenu=new Ct(this,e)},t.prototype._initSidePanelParameters=function(){var e=this,t=n.Control.getControl(this._sidePanel),o=t.addPage(n.culture.Viewer.parameters,wt,2);this._parametersPageId=o.id,this._gParameterTitle=o.outContent.querySelector(".wj-tabtitle"),o.format(function(o){e._paramsEditor=new Pt(o.content),e._paramsEditor.commit.addHandler(function(){e._innerDocumentSource&&e._innerDocumentSource.hasParameters&&(e._showViewPanelMessage(),e._innerDocumentSource.setParameters(e._paramsEditor.parameters).then(function(t){var n=t||[],o=n.some(function(e){return!!e.error});e._paramsEditor._reset(),o?e._paramsEditor.itemsSource=n:(e._resetDocument(),e._paramsEditor.isDisabled=!0,e._renderDocumentSource())}).catch(function(t){e._showViewPanelErrorMessage(C(t))}),e._isMobileTemplate()&&t.collapse())}),e._paramsEditor.validate.addHandler(function(){e._innerDocumentSource&&e._innerDocumentSource.hasParameters&&(e._paramsEditor.isDisabled=!0,e._innerDocumentSource.setParameters(e._paramsEditor.parameters).then(function(t){e._paramsEditor.itemsSource=t,e._paramsEditor.isDisabled=!1},function(t){e._paramsEditor.isDisabled=!1}))});var r=function(){var r=e._innerDocumentSource;r.status===pe.cleared||r.status===pe.notFound?p(o.content):r.status===pe.rendering?e._paramsEditor.isDisabled=!0:r.status===pe.completed&&(e._paramsEditor.isDisabled=!1),r.status===pe.loaded&&(r.hasParameters?r.getParameters().then(function(i){i.filter(function(e){return!e.hidden}).length?(t.show(o),t.active(o)):t.hide(o),e._innerDocumentSource!=r||r.isDisposed||(e._paramsEditor.itemsSource=i,i.filter(function(e){return null==e.value&&!e.nullable&&!e.hidden}).length?(e._showViewPanelMessage(n.culture.Viewer.requiringParameters),e._updateUI(),n.Control.getControl(e._sidePanel).enable(e._parametersPageId)):(e._paramsEditor.isDisabled=!0,e._renderDocumentSource()))}):t.hide(o))},i=function(){e._innerDocumentSource&&(P(e._documentEventKey,e._innerDocumentSource.statusChanged,r),r())};e._documentSourceChanged.addHandler(i),i()})},Object.defineProperty(t.prototype,"_innerDocumentSource",{get:function(){return this._getDocumentSource()},enumerable:!0,configurable:!0}),t.prototype._loadDocument=function(t){var n=this._innerDocumentSource!==t,o=e.prototype._loadDocument.call(this,t);return t&&n&&P(this._documentEventKey,t.statusChanged,this._onDocumentStatusChanged,this),o},t.prototype._reRenderDocument=function(){this._renderDocumentSource()},t.prototype._onDocumentStatusChanged=function(){this._innerDocumentSource&&this._innerDocumentSource.status===pe.loaded&&!this._innerDocumentSource.hasParameters&&this._innerDocumentSource.autoRun&&this._renderDocumentSource()},t.prototype._renderDocumentSource=function(){var e=this;if(this._innerDocumentSource){this._setDocumentRendering();var t=this._innerDocumentSource;t.render().then(function(n){return e._getStatusUtilCompleted(t)})}},t.prototype._disposeDocument=function(){this._innerDocumentSource&&S(this._documentEventKey,this._innerDocumentSource.statusChanged),e.prototype._disposeDocument.call(this)},t.prototype._setDocumentRendering=function(){this._innerDocumentSource._updateStatus(pe.rendering),e.prototype._setDocumentRendering.call(this)},t.prototype._getSource=function(){return this.filePath?this._isArReport()?new Rt({serviceUrl:this.serviceUrl,filePath:this.filePath}):new le({serviceUrl:this.serviceUrl,filePath:this.filePath,reportName:this.reportName,paginated:this.paginated}):null},t.prototype._supportsPageSettingActions=function(){return!0},t.prototype.refresh=function(t){void 0===t&&(t=!0),e.prototype.refresh.call(this,t),t&&this._paramsEditor.refresh()},t.prototype._isArReport=function(){return!!this.filePath&&D(this.filePath,".rdlx",!0)},t.prototype._createPage=function(t,n){return this._isArReport()?new It(this._getDocumentSource(),t,n):e.prototype._createPage.call(this,t,n)},t.prototype._actionElementClicked=function(t){if(this._isArReport()){var n=this._getActionInfo(t);n&&n.arKind===Tt.Hyperlink?window.open(n.data,"_blank"):e.prototype._actionElementClicked.call(this,t)}else e.prototype._actionElementClicked.call(this,t)},t.prototype._getActionInfo=function(t){if(!this._isArReport())return e.prototype._getActionInfo.call(this,t);var n=t.attributes["arsvg:data-action-type"].value,o=t.attributes["arsvg:data-action-data"].value.replace(/&quot;/g,'"'),r=t.attributes["arsvg:data-action-page"].value;if(n)switch(n){case Tt.Bookmark:return{kind:ht.Bookmark,data:o?r+"|"+o:r,arKind:n};default:return{kind:ht.Custom,data:o,arKind:n}}return null},t._parameterCommandTag=99,t}(dt);t.ReportViewer=bt;var Pt=function(e){function t(t){var o=e.call(this,t)||this;return o._parameters={},o._errors=[],o._errorsVisible=!1,o.commit=new n.Event,o.validate=new n.Event,n.addClass(o.hostElement,"wj-parameterscontainer"),o._updateErrorsVisible(),o}return __extends(t,e),t.prototype._setErrors=function(e){this._errors=e,this._updateErrorDiv()},Object.defineProperty(t.prototype,"parameters",{get:function(){return this._parameters},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"itemsSource",{get:function(){return this._itemSources},set:function(e){this._itemSources=e,this._parameters={},this._render();var t=[];(e||[]).forEach(function(e){e.error&&t.push({key:e.name,value:e.error})}),this._setErrors(t)},enumerable:!0,configurable:!0}),t.prototype._reset=function(){this._lastEditedParam=null},t.prototype._setErrorsVisible=function(e){this._errorsVisible=e,this._updateErrorsVisible()},t.prototype._updateErrorsVisible=function(){this._errorsVisible?n.removeClass(this.hostElement,t._errorsHiddenCss):n.addClass(this.hostElement,t._errorsHiddenCss)},t.prototype.onCommit=function(){this.commit.raise(this,new n.EventArgs)},t.prototype.onValidate=function(){this.validate.raise(this,new n.EventArgs),this._setErrorsVisible(!1)},t.prototype._deferValidate=function(e,t,n){var o=this;null!=this._validateTimer&&(clearTimeout(this._validateTimer),this._validateTimer=null),this._validateTimer=setTimeout(function(){null!=t&&t(),o.onValidate(),null!=n&&n(),o._lastEditedParam=e,o._validateTimer=null},500)},t.prototype._updateErrorDiv=function(){for(var e=this._errors||[],n=this.hostElement.querySelectorAll(".error"),o=0;o<n.length;o++)n[o].parentNode.removeChild(n[o]);for(o=0;o<e.length;o++){var r,i=this.hostElement.querySelector("*["+t._paramIdAttr+'="'+e[o].key+'"]'),a=e[o].value;i&&((r=document.createElement("div")).innerHTML=a,r.className="error",i.appendChild(r))}},t.prototype._render=function(){var e,o=this;if(p(this.hostElement,function(n){if(!o._lastEditedParam||n.getAttribute(t._paramIdAttr)!==o._lastEditedParam)return!0;e=n}),this._itemSources){this._itemSources.forEach(function(r){if(o._lastEditedParam===r.name)return o._lastEditedParam=null,void(e=null);if(!r.hidden){var i=document.createElement("div"),a=document.createElement("span"),s=null;if(i.className="wj-parametercontainer",a.className="wj-parameterhead",a.innerHTML=r.prompt||r.name,n.isArray(r.allowedValues))s=o._generateComboEditor(r);else switch(r.dataType){case de.Boolean:s=o._generateBoolEditor(r);break;case de.DateTime:case de.Time:case de.Date:s=o._generateDateTimeEditor(r);break;case de.Integer:case de.Float:s=o._generateNumberEditor(r);break;case de.String:s=o._generateStringEditor(r)}s&&(s.className+=" wj-parametercontrol",i.setAttribute(t._paramIdAttr,r.name),i.appendChild(a),i.appendChild(s),e?o.hostElement.insertBefore(i,e):o.hostElement.appendChild(i))}});var r=document.createElement("input");r.type="button",r.value=n.culture.Viewer.apply,r.className="wj-applybutton",_(r,"click",function(){o._validateParameters()&&(o._errors=[],o.onCommit()),o._setErrorsVisible(!0)}),this.hostElement.appendChild(r)}},t.prototype.refresh=function(t){void 0===t&&(t=!0),e.prototype.refresh.call(this,t),t&&(this._reset(),this._render())},t.prototype._validateParameters=function(){for(var e,o=this.hostElement.querySelectorAll("textarea"),r=[],i=this.itemsSource,a=0;a<i.length;a++){var s=i[a];e=this.hostElement.querySelector("["+t._paramIdAttr+'="'+s.name+'"]'),s.nullable||this.parameters.hasOwnProperty(s.name)||this.parameters[s.name]||null!==s.value&&void 0!==s.value&&""!==s.value||e&&r.push({key:s.name,value:n.culture.Viewer.nullParameterError})}for(a=0;a<o.length;a++){var u=o.item(a),c=!0;switch(parseInt(u.getAttribute("data-type"))){case de.Date:case de.DateTime:case de.Time:c=t._checkValueType(u.value,n.isDate);break;case de.Float:c=t._checkValueType(u.value,t._isFloat);break;case de.Integer:c=t._checkValueType(u.value,n.isInt)}c||r.push({key:u.parentElement.id,value:n.culture.Viewer.invalidParameterError})}return this._setErrors(r),r.length<=0},t._isFloat=function(e){return!isNaN(parseFloat(e))},t._checkValueType=function(e,t){for(var n=e.split("\n"),o=0;o<n.length;o++)if(!(n[o].trim().length<=0||t(n[o].trim())))return!1;return!0},t.prototype._generateComboEditor=function(e){var t,r,i,a=this,s=[],u=document.createElement("div"),c=[],l=e.allowedValues&&e.allowedValues.length>0,h=l&&e.allowedValues.filter(function(t){return k(t.value,e.value)}).length>0;e.multiValue?t=new St(u):(t=new o.ComboBox(u),e.nullable?s.push({name:n.culture.Viewer.parameterNoneItemsSelected,value:null}):!l||null!=e.value&&h||s.push({name:n.culture.Viewer.selectParameterValue,value:null})),t.isEditable=!1,t.displayMemberPath="name",t.selectedValuePath="value",t.isDisabled=!l;for(p=0;p<e.allowedValues.length;p++)s.push({name:e.allowedValues[p].key,value:e.allowedValues[p].value});if(t.itemsSource=s,e.multiValue){if(r=t,l){if(e.value){for(var p=0;p<e.value.length;p++)for(var d=0;d<r.itemsSource.length;d++)if(k(r.itemsSource[d].value,e.value[p])){c.push(r.itemsSource[d]);break}r.checkedItems=c}}else r.checkedItems=[];r.checkedItemsChanged.addHandler(function(){a._deferValidate(e.name,function(){i=[];for(var t=0;t<r.checkedItems.length;t++)i.push(r.checkedItems[t].value);a._updateParameters(e,i)},function(){i.length>0&&!e.nullable&&a._validateNullValueOfParameter(u)})})}else{t.selectedValue=l&&h?e.value:null;var g=!1;t.selectedIndexChanged.addHandler(function(t){a._deferValidate(e.name,function(){g||(a._updateParameters(e,t.selectedValue),t.selectedValue&&t.itemsSource[0].name===n.culture.Viewer.selectParameterValue&&setTimeout(function(){g=!0;var e=t.selectedValue,n=t.selectedIndex;t.itemsSource.shift(),t.collectionView.refresh(),t.selectedValue=e,t.selectedIndex=n-1,g=!1}))},function(){return a._validateNullValueOfParameter(u)})})}return u},t.prototype._updateParameters=function(e,t){var o;this.itemsSource.some(function(t){return t.name===e.name&&(o=t,!0)}),this._parameters[e.name]=o.value=e.value=function(e,t){return t&&n.isString(e)?e.split(/[\r\n]+/):e}(t,e.multiValue)},t.prototype._generateBoolEditor=function(e){var t,n,r=this,i=[];return e.nullable?(n=document.createElement("div"),(t=new o.ComboBox(n)).isEditable=!1,t.displayMemberPath="name",t.selectedValuePath="value",i.push({name:"None",value:null}),i.push({name:"True",value:!0}),i.push({name:"False",value:!1}),t.itemsSource=i,t.selectedValue=e.value,t.selectedIndexChanged.addHandler(function(t){r._deferValidate(e.name,function(){return r._updateParameters(e,t.selectedValue)})})):((n=document.createElement("input")).type="checkbox",n.checked=e.value,_(n,"click",function(){r._deferValidate(e.name,function(){return r._updateParameters(e,n.checked)})})),n},t.prototype._generateStringEditor=function(e){var t,n=this;return e.multiValue?t=n._createTextarea(e.value,e.dataType):((t=document.createElement("input")).type="text",e.value&&(t.value=e.value)),n._bindTextChangedEvent(t,e),t},t.prototype._createTextarea=function(e,o){var r,i=document.createElement("textarea"),a=[];if(o!==de.DateTime&&o!==de.Time&&o!==de.Date||(r=t._dateTimeFormat),e&&e.length>0)if(r){for(var s=0;s<e.length;s++)a.push(n.Globalize.formatDate(new Date(e[s]),r));i.value=a.join("\n")}else i.value=e.join("\n");return i.wrap="off",i.setAttribute("data-type",o.toString()),i},t.prototype._bindTextChangedEvent=function(e,t){var n=this;_(e,"change,keyup,paste,input",function(){n._deferValidate(t.name,function(){return n._updateParameters(t,e.value)},function(){e.value&&!t.nullable&&n._validateNullValueOfParameter(e)})})},t.prototype._generateNumberEditor=function(e){var t,n,r=this;return e.multiValue?(t=this._createTextarea(e.value,e.dataType),this._bindTextChangedEvent(t,e)):(t=document.createElement("div"),(n=new o.InputNumber(t)).format=e.dataType===de.Integer?"n0":"n2",n.isRequired=!e.nullable,e.value&&(n.value=e.dataType===de.Integer?parseInt(e.value):parseFloat(e.value)),n.valueChanged.addHandler(function(t){r._deferValidate(e.name,function(){return r._updateParameters(e,t.value)})})),t},t.prototype._generateDateTimeEditor=function(e){var n,r,i=this;return e.multiValue?((n=this._createTextarea(e.value,e.dataType)).title=t._dateTimeFormat,this._bindTextChangedEvent(n,e)):(n=document.createElement("div"),e.dataType==de.Date?r=new o.InputDate(n):e.dataType==de.DateTime?(r=new o.InputDateTime(n)).timeStep=60:(r=new o.InputTime(n)).step=60,r.isRequired=!1,null!=e.value?r.value=new Date(e.value):r.value=null,r.isRequired=!e.nullable,r.valueChanged.addHandler(function(){i._deferValidate(e.name,function(){return i._updateParameters(e,r.value.toJSON())})})),n},t.prototype._validateNullValueOfParameter=function(e){var n=this._errors;if(n&&n.length)for(var o=0;o<n.length;o++)if(n[o].key===e.parentElement.getAttribute(t._paramIdAttr)){var r=e.parentElement.querySelector(".error");if(r){e.parentElement.removeChild(r),n.splice(o,1);break}}},t._paramIdAttr="param-id",t._errorsHiddenCss="wj-parametererrors-hidden",t._dateTimeFormat="MM/dd/yyyy HH:mm",t}(n.Control);t._ParametersEditor=Pt;var St=function(){function e(e){this._selectedAll=!1,this._innerCheckedItemsChanged=!1,this.checkedItemsChanged=new n.Event;var t=this,r=new o.MultiSelect(e);t._multiSelect=r,r.checkedItemsChanged.addHandler(t.onCheckedItemsChanged,t),r.isDroppedDownChanged.addHandler(t.onIsDroppedDownChanged,t),r.headerFormatter=function(){return t._updateHeader()}}return e.prototype._updateHeader=function(){var e=this,t=e.checkedItems||[],o=[],r=e.displayMemberPath;if(!t.length)return n.culture.Viewer.parameterNoneItemsSelected;if(e._selectedAll)return n.culture.Viewer.parameterAllItemsSelected;if(r){for(var i=0;i<t.length;i++)o[i]=t[i][r];return o.join(", ")}return t.join(", ")},e.prototype.onIsDroppedDownChanged=function(){this._multiSelect.isDroppedDown&&this._updateSelectedAll()},e.prototype.onCheckedItemsChanged=function(e,t){var n=this;n._innerCheckedItemsChanged||(n._selectAllItem?(n._updateSelectedAll(),n.checkedItemsChanged.raise(n,t)):n.checkedItemsChanged.raise(n,t))},Object.defineProperty(e.prototype,"isEditable",{get:function(){return this._multiSelect.isEditable},set:function(e){this._multiSelect.isEditable=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisabled",{get:function(){return this._multiSelect.isDisabled},set:function(e){this._multiSelect.isDisabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"displayMemberPath",{get:function(){return this._multiSelect.displayMemberPath},set:function(e){this._multiSelect.displayMemberPath=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectedValuePath",{get:function(){return this._multiSelect.selectedValuePath},set:function(e){this._multiSelect.selectedValuePath=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"itemsSource",{get:function(){return this._itemsSource},set:function(e){var t=this,o=t.displayMemberPath||"name";t._itemsSource=e;var r=[];e&&(e.length>1?(t._selectAllItem={},t._selectAllItem[o]=n.culture.Viewer.parameterSelectAllItemText,r.push(t._selectAllItem)):t._selectAllItem=null,r=r.concat(e)),t._multiSelect.itemsSource=r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"checkedItems",{get:function(){var e=this,t=[];e._multiSelect.checkedItems&&(t=e._multiSelect.checkedItems.slice());var n=t.indexOf(e._selectAllItem);return n>-1&&t.splice(n,1),t},set:function(e){var t=this;t._multiSelect.checkedItems=e,t._selectedAll=!1,t._updateSelectedAll()},enumerable:!0,configurable:!0}),e.prototype._updateSelectedAll=function(){var e=this;if(e._selectAllItem){var t=e._multiSelect.checkedItems||[],n=t.indexOf(e._selectAllItem),o=n>-1;if(e._selectedAll!==o)return e._selectedAll=o,e._innerCheckedItemsChanged=!0,e._selectedAll?e._multiSelect.checkedItems=e._multiSelect.itemsSource.slice():e._multiSelect.checkedItems=[],void(e._innerCheckedItemsChanged=!1);e._selectedAll=t&&e._itemsSource&&t.length-(o?1:0)===e._itemsSource.length,e._selectedAll!==o&&(e._innerCheckedItemsChanged=!0,e._selectedAll?e._multiSelect.checkedItems=t.concat(e._selectAllItem):((t=t.slice()).splice(n,1),e._multiSelect.checkedItems=t),e._innerCheckedItemsChanged=!1)}},e}();t._MultiSelectEx=St;var Ct=function(e){function t(t,n,o){return e.call(this,t,n,o)||this}return __extends(t,e),t.prototype._initItems=function(){var t=e.prototype._initItems.call(this);return t.splice(2,0,{title:n.culture.Viewer.parameters,icon:wt,commandTag:bt._parameterCommandTag}),t},t}(rt);t._ReportHamburgerMenu=Ct;var xt=function(e){function t(t,n){return e.call(this,t,n)||this}return __extends(t,e),t.prototype._getProductInfo=function(){return"QNI5,ReportViewer"},Object.defineProperty(t.prototype,"_innerDocumentSource",{get:function(){return this._getDocumentSource()},enumerable:!0,configurable:!0}),t.prototype._getSource=function(){return this.filePath?new _e({serviceUrl:this.serviceUrl,filePath:this.filePath}):null},t}(dt);t.PdfViewer=xt;var Tt;!function(e){e.Hyperlink="hyperlink",e.Bookmark="bookmark",e.Drillthrough="drillthrough",e.Sort="sort",e.Toggle="toggle"}(Tt=t._ArActionKind||(t._ArActionKind={}));var Et;!function(e){e[e.String=0]="String",e[e.DateTime=1]="DateTime",e[e.Boolean=2]="Boolean",e[e.Integer=3]="Integer",e[e.Float=4]="Float"}(Et=t._ArParameterType||(t._ArParameterType={}));var Mt;!function(e){e[e.OK=0]="OK",e[e.ExpectValue=1]="ExpectValue",e[e.HasOutstandingDependencies=2]="HasOutstandingDependencies",e[e.ValuesValidationFailed=3]="ValuesValidationFailed",e[e.DynamicValuesUnavailable=4]="DynamicValuesUnavailable"}(Mt=t._ArParameterState||(t._ArParameterState={}));var It=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype._processSvgResponse=function(t){t=e.prototype._processSvgResponse.call(this,t);var n=(new DOMParser).parseFromString(t,"text/xml");return t=(new XMLSerializer).serializeToString(n)},t.prototype._processActionLinks=function(e,t){for(var n=e.querySelectorAll("rect[arsvg\\:data-action-type]"),o=0;o<n.length;o++)t(n[o])},t}(Je);t._ArPage=It;var Vt;!function(e){e[e.Rpx=0]="Rpx",e[e.Rdf=1]="Rdf",e[e.Rdlx=2]="Rdlx"}(Vt||(Vt={}));var At;!function(e){e[e.Image=3]="Image",e[e.Pdf=4]="Pdf",e[e.Html=5]="Html",e[e.Word=6]="Word",e[e.Xls=7]="Xls",e[e.Xml=8]="Xml",e[e.Svg=9]="Svg"}(At=t._ArDocumentFormat||(t._ArDocumentFormat={}));var jt;!function(e){e[e.NotStarted=0]="NotStarted",e[e.Rendering=1]="Rendering",e[e.Rendered=2]="Rendered",e[e.Cancelling=3]="Cancelling",e[e.Cancelled=4]="Cancelled",e[e.Error=5]="Error"}(jt=t._ArLoadState||(t._ArLoadState={}));var Dt;!function(e){e[e.InvalidCulture=0]="InvalidCulture",e[e.InvalidVersion=1]="InvalidVersion",e[e.UnknownReportType=2]="UnknownReportType",e[e.NoSuchReport=3]="NoSuchReport",e[e.ParametersNotSet=4]="ParametersNotSet",e[e.RuntimeIsBusy=5]="RuntimeIsBusy",e[e.InternalError=6]="InternalError",e[e.ParameterNotExists=7]="ParameterNotExists",e[e.NoAcceptableFormats=8]="NoAcceptableFormats",e[e.InvalidToken=9]="InvalidToken",e[e.UnsupportedFormat=10]="UnsupportedFormat",e[e.InvalidSetOfParameters=11]="InvalidSetOfParameters",e[e.MethodNotSupported=12]="MethodNotSupported",e[e.NoValidLicenseFound=13]="NoValidLicenseFound"}(Dt=t._ArErrorCode||(t._ArErrorCode={}));var kt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._lifeTime=6e5,t._canChangeRenderMode=!1,t._uid=(new Date).getTime().toString(),t._isDisposed=!1,t._hasOutlines=void 0,t}return __extends(t,e),t.StateToStatus=function(e){switch(e){case jt.NotStarted:return pe.notFound;case jt.Rendered:return pe.completed;case jt.Rendering:return pe.rendering;case jt.Cancelled:return pe.stopped;default:throw"Not supported state: "+e}},t.ConvertFormat=function(e){switch(e){case"doc":case"docx":return At.Word;case"html":return At.Svg;case"mhtml":return At.Html;case"pdf":return At.Pdf;case"svg":return At.Svg;case"tiff":case"png":return At.Image;case"xml":return At.Xml;case"xlsx":case"xls":return At.Xls;default:throw"Not supported format: "+e}},t.IsError=function(e){return!!(e&&e.json&&e.json.Error)},Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"autoRun",{get:function(){return this._autoRun},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"canChangeRenderMode",{get:function(){return this._canChangeRenderMode},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parameters",{get:function(){return this._parameters||[]},enumerable:!0,configurable:!0}),t.prototype.getStatus=function(){var e=this,n=new ie;return this._isDisposed?n.resolve({status:pe.cleared}):this._token?(this._ajax(this.serviceUrl+"/GetStatus",{method:"POST"},{token:this._token}).then(function(o){var r=t.StateToStatus(o.json.LoadState),i={errorList:o.json.Error?[o.json.Error.Description]:[],pageCount:o.json.AvailablePages,hasOutlines:!!e._hasOutlines,progress:0,status:r};r===pe.completed&&null==e._hasOutlines?e.getOutlines(!0).then(function(t){i.hasOutlines=e._hasOutlines=(t||[]).length>0,n.resolve(i)}):n.resolve(i)},function(t){n.reject(e._getError(t))}),n):n.resolve({status:pe.notFound})},t.prototype.setPageSettings=function(e){throw te._abstractMethodException},t.prototype.getBookmark=function(e){var t=new ie,n=e.split("|");return t.resolve({pageIndex:parseInt(n[0],10)-1,pageBounds:function(e){if(e){var t=e.split(" ");return{x:re.convertValue(parseFloat(t[0]),oe.Dip,oe.Twip),y:re.convertValue(parseFloat(t[1]),oe.Dip,oe.Twip)}}}(n[1])})},t.prototype.executeCustomAction=function(e){switch(e.arKind){case Tt.Drillthrough:var t=JSON.parse(e.data);return(new ie).resolve(t);case Tt.Toggle:return this.processOnClick(e.data);default:return(new ie).reject("Not implemented action: "+e.arKind)}},t.prototype.load=function(e){var t=this,o=new ie,r=null;return e&&(r=e.parameters,delete e.parameters),this._ajax(this.serviceUrl+"/OpenReport",{method:"POST"},this._merge(e,{acceptedFormats:[At.Svg],culture:"en-US",lifeTime:this._lifeTime/1e3,reportPath:this.filePath,version:4})).then(function(e){t._hasDelayedContent=e.json.HasDelayedContent,t._autoRun=!!e.json.AutoRun,t._documentFormat=e.json.DocumentFormat,t._parameters=(e.json.ParameterCollection||[]).map(function(e){return t._convertFromServiceParameter(e)}),t._token=e.json.Token,t._isDisposed=!1;var n=new Date,o=new Date(n.getTime()+t._lifeTime);return{expiredDateTime:o,loadedDateTime:n,features:{nonPaginated:!1,paginated:!0,pageSettings:!1,textSearchInPaginatedMode:!0},pageSettings:{height:new re(1056,oe.Dip),width:new re(816,oe.Dip),leftMargin:new re(48,oe.Dip),rightMargin:new re(48,oe.Dip),topMargin:new re(48,oe.Dip),bottomMargin:new re(48,oe.Dip),paginated:!0},status:{errorList:e.json.Error?[e.json.Error.Description]:[],expiredDateTime:o,pageCount:0,progress:0,status:pe.loaded}}}).then(function(e){t.getReportProperty("ChangeRenderModeSupported").then(function(i){if(t._canChangeRenderMode=!!i,n.isArray(r)&&r.length){var a=t._mergeParameters(r,t._parameters);t.setParameters(a).then(function(t){o.resolve(e)})}else o.resolve(e)})}).catch(function(e){o.reject(t._getError(e))}),o},t.prototype.loadDrillthroughReport=function(e){var t=this,o=new ie;return this._ajax(this.serviceUrl+"/OpenDrillthroughReport",{method:"POST"},{token:this._token,lifeTime:this._lifeTime/1e3,reportPath:e.ReportName}).then(function(r){t.dispose(!1).then(function(){t._hasDelayedContent=r.json.HasDelayedContent,t._autoRun=!!r.json.AutoRun,t._documentFormat=r.json.DocumentFormat,t._parameters=(r.json.ParameterCollection||[]).map(function(e){return t._convertFromServiceParameter(e)}),t._token=r.json.Token,t._isDisposed=!1;var i=new Date,a=new Date(i.getTime()+t._lifeTime),s={expiredDateTime:a,loadedDateTime:i,features:{nonPaginated:!1,paginated:!0,pageSettings:!1,textSearchInPaginatedMode:!0},pageSettings:{height:new re(1056,oe.Dip),width:new re(816,oe.Dip),leftMargin:new re(48,oe.Dip),rightMargin:new re(48,oe.Dip),topMargin:new re(48,oe.Dip),bottomMargin:new re(48,oe.Dip),paginated:!0},status:{errorList:r.json.Error?[r.json.Error.Description]:[],expiredDateTime:a,pageCount:0,progress:0,status:pe.loaded}};t.getReportProperty("ChangeRenderModeSupported").then(function(r){t._canChangeRenderMode=!!r,n.isArray(e.Parameters)&&e.Parameters.length?t.setParameters(e.Parameters).then(function(e){o.resolve(s)}):o.resolve(s)})})},function(e){o.reject(t._getError(e))}),o},t.prototype.processOnClick=function(e){var t=this,n=new ie;return this._ajax(this.serviceUrl+"/ProcessOnClick",{method:"POST"},{token:this._token,data:{Action:"toggle",Data:e}}).then(function(e){n.resolve({status:pe.rendering})},function(e){n.reject(t._getError(e))}),n},t.prototype.getReportProperty=function(e){return this._ajax(this.serviceUrl+"/GetReportProperty",{method:"POST"},{token:this._token,propertyName:e}).then(function(e){return e.json.Error?null:e.json.PropertyValue}).catch(function(e){return null})},t.prototype.render=function(e){var t=this;return this._ajax(this.serviceUrl+"/RunReport",{method:"POST"},{token:this._token}).then(function(e){return t._isDisposed=!1,{errorList:e.json.Error?[e.json.Error.Description]:[],status:pe.rendering}})},t.prototype.dispose=function(e){var t=this;return void 0===e&&(e=!0),this._token?this._ajax(this.serviceUrl+"/CloseReport",{method:"POST",async:e},{token:this._token}).then(function(){return t._isDisposed=!0,t._token=null,t._hasOutlines=void 0,{status:pe.cleared}}):new ie},t.prototype.getOutlines=function(e){return void 0===e&&(e=!1),this._getBookmarks(-1,0,e?1:100,!e)},t.prototype._getError=function(e){var n=e;return t.IsError(n)?'ErrorCode: "'+n.json.Error.ErrorCode+'". Description: "'+n.json.Error.Description+'"':e.responseText},t.prototype._getBookmarks=function(e,t,n,o){var r=this;void 0===o&&(o=!0);var i=new ie;return this._ajax(this.serviceUrl+"/GetBookmarks",{method:"POST"},{token:this._token,parentId:e,fromChild:t,count:n}).then(function(a){var s=(a.json.Bookmarks||[]).map(function(e){return{caption:e.Name,children:e.ChildrenCount>0?function(){return r._getBookmarks(e.ID,0,n)}:null,position:{pageBounds:{height:re.convertValue(e.Size.Width||0,oe.Inch,oe.Twip),width:re.convertValue(e.Size.Height||0,oe.Inch,oe.Twip),x:re.convertValue(e.Location.X||0,oe.Inch,oe.Twip),y:re.convertValue(e.Location.Y||0,oe.Inch,oe.Twip)},pageIndex:e.Page},target:""}}),u=t+s.length;!o||u>=a.json.ChildrenCount||u>=1e5?i.resolve(s):r._getBookmarks(e,u,n).then(function(e){i.resolve(s.concat(e))})}),i},t.prototype.renderToFilter=function(e){var n=this,o=new ie;return this.getRenderToFilterUrl(e).then(function(r){n._ajax(r+"&WebViewerControlClientId="+n._uid+(e.outputRange?"&Page="+e.outputRange:""),{method:"GET",parseResponse:!1},{}).then(function(e){o.resolve(e.xhr)},function(r){t.IsError(r)&&r.json.Error.ErrorCode==Dt.RuntimeIsBusy?setTimeout(function(){return n.renderToFilter(e)},n.getPingTimeout()):o.reject(r)})}),o},t.prototype.search=function(e){var t=new ie;return this._ajax(this.serviceUrl+"/Search",{method:"POST"},{token:this._token,options:{Text:e.text,MatchCase:e.matchCase,WholeWord:e.wholeWord},startFrom:{PageIndex:-1},numberOfResults:100}).then(function(e){var n=e.json.SearchResults.map(function(e){return{nearText:e.DisplayText,positionInNearText:e.TextStart,pageIndex:e.PageIndex,boundsList:[{height:re.convertValue(e.ItemArea.Height||0,oe.Inch,oe.Twip),width:re.convertValue(e.ItemArea.Width||0,oe.Inch,oe.Twip),x:re.convertValue(e.ItemArea.Left||0,oe.Inch,oe.Twip),y:re.convertValue(e.ItemArea.Top||0,oe.Inch,oe.Twip)}]}});t.resolve(n)},function(e){return t.reject(e)}),t},t.prototype.setParameters=function(e){var t=this;return this._ajax(this.serviceUrl+"/SetParameters",{method:"POST"},{token:this._token,parametersSetAtClient:(e||[]).map(function(e){return t._convertToServiceParameter(e)})}).then(function(e){return t._parameters=(e.json.ParameterCollection||[]).map(function(e){return t._convertFromServiceParameter(e)})})},t.prototype.validateParameter=function(e){return this._ajax(this.serviceUrl+"/ValidateParameter",{method:"POST"},{token:this._token,parametersSetAtClient:this._convertToServiceParameter(e)}).then(function(e){return null})},t.prototype.getRenderToFilterUrl=function(e){var n=this,o=new ie;return this._ajax(this.serviceUrl+"/GetRenderedReportLink",{method:"POST"},{token:this._token}).then(function(e){o.resolve(e.json.ReportLink.Uri)},function(r){t.IsError(r)&&r.json.Error.ErrorCode==Dt.RuntimeIsBusy?setTimeout(function(){return n.getRenderToFilterUrl(e)},n.getPingTimeout()):o.reject(r)}),o},t.prototype.getExportedUrl=function(e){var o=this,r=t.ConvertFormat(e.format),i=function(){var t=/([^\\/]+)$/.exec(o.filePath)[1],n={FileName:t.substr(0,t.lastIndexOf("."))};return r==At.Pdf&&(n.EmbedFonts="All"),r==At.Image&&("png"===e.format&&(n.ImageType="PNG"),e.outputRange&&(n.StartPage=e.outputRange.toString(),n.EndPage=e.outputRange.toString()),e.resolution&&(n.DpiX=e.resolution.toString(),n.DpiY=e.resolution.toString())),e.printing&&r==At.Pdf&&(n.PrintOnOpen=!0),n}(),a=new ie;return this._ajax(this.serviceUrl+"/GetExportedReportLink",{method:"POST"},{token:this._token,format:r,exportingParameters:i,pageRange:null}).then(function(t){a.resolve(t.json.ReportLink.Uri+(n.isNumber(e.outputRange)?"&outputRange="+e.outputRange:"")+(e.printing?"":"&Attachment=1"))},function(n){t.IsError(n)&&n.json.Error.ErrorCode==Dt.RuntimeIsBusy?setTimeout(function(){return o.getExportedUrl(e)},o.getPingTimeout()):a.reject(n)}),a},t.prototype.getPingTimeout=function(){return 1e3},t.prototype.getSupportedExportDescriptions=function(){var e=new ie;return e.resolve([{name:"TIFF image",format:"tiff"},{name:"Adobe PDF",format:"pdf"},{name:"Web archive (MHTML)",format:"mhtml"},{name:"Microsoft Word",format:"doc"},{name:"Microsoft Excel",format:"xls"},{name:"XML document",format:"xml"}]),e},t.prototype.getFeatures=function(){throw te._abstractMethodException},t.prototype._ajax=function(e,t,n){var o=new ie,r={urlEncode:!1,success:function(e){var n={xhr:e};try{if(e.responseText&&!1!==t.parseResponse&&(n.json=JSON.parse(e.responseText).d),n.json&&n.json.Error)throw"";o.resolve(n)}catch(e){o.reject(n)}},error:function(e){o.reject(e)}};return this._merge(t,r),r.data=r.data||n,z(e,r),o},t.prototype._convertFromServiceParameter=function(e){var t=function(e,t){return e};return e.Value=t(e.Value,e.ParameterType),e.AvailableValues=(e.AvailableValues||[]).map(function(n){return{Label:n.Label,Value:t(n.Value,e.ParameterType)}}),e},t.prototype._convertToServiceParameter=function(e){var t=function(e,t){return e};return e.Value=t(e.Value,e.ParameterType),e.Values&&e.Values.forEach(function(n){n.Value=t(n.Value,e.ParameterType)}),e},t.prototype._merge=function(e,t){if(e&&t){for(var n in e)t[n]=e[n];return t}},t.prototype._mergeParameters=function(e,t){var n=[],o=t.map(function(t){var o=t.Name.toLowerCase();n.push(o);var r=e.filter(function(e){return o===e.Name.toLowerCase()});return r.length?(t.Value=r[0].Value,t):t});return o.push.apply(o,e.filter(function(e){return n.indexOf(e.Name.toLowerCase())<0})),o},t.prototype._parseXml=function(e){return(new DOMParser).parseFromString(e,"text/xml")},t}(ne);t._ArReportService=kt;var Rt=function(e){function t(t){var o=e.call(this,t)||this;return o._status=pe.notFound,o.statusChanged=new n.Event,o}return __extends(t,e),Object.defineProperty(t.prototype,"autoRun",{get:function(){return this._innerService.autoRun},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"encodeRequestParams",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasParameters",{get:function(){var e=this._innerService.parameters;return e&&e.length>0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasThumbnails",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_innerService",{get:function(){return this.service},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this._status},enumerable:!0,configurable:!0}),t.prototype.executeCustomAction=function(e){var t=this,n=new ie;return this._innerService.executeCustomAction(e).then(function(o){e.arKind===Tt.Drillthrough?t._innerService.loadDrillthroughReport(o).then(function(e){t._updateExecutionInfo(e),n.resolve()}):(t._updateDocumentStatus(o),n.resolve())}),n},t.prototype.load=function(){return e.prototype.load.call(this)},t.prototype.getParameters=function(){var e=new ie,t=this._convertParameters(this._innerService.parameters);return e.resolve(t)},t.prototype.setParameters=function(e){var t=this,o=new ie,r=[],i={};return this._innerService.parameters.forEach(function(e){i[e.Name]=e}),Object.keys(e).forEach(function(t){var o;r.push(o={AllowEmpty:i[t].AllowEmpty,DateOnly:i[t].DateOnly,MultiLine:i[t].MultiLine,MultiValue:i[t].MultiValue,Name:t,Nullable:i[t].Nullable,ParameterType:i[t].ParameterType}),o.MultiValue&&n.isArray(e[t])?o.Values=e[t].map(function(e){return{Value:e}}):o.Value=e[t]}),this._innerService.setParameters(r).then(function(e){t._convertParameters(e.filter(function(e){return e.State!==Mt.OK}));o.resolve(t._convertParameters(e))}),o},t.prototype.print=function(e){this.getExportedUrl({format:"pdf",printing:!0}).then(function(e){if(e)try{var t=window.open(e,"_blank");t&&t.focus()}catch(t){window.location.assign(e+"&Attachment=1")}})},t.prototype.render=function(){var e=this;return this._innerService.render().then(function(t){e._updateDocumentStatus(t)})},t.prototype.onStatusChanged=function(e){this.statusChanged.raise(this,e||new n.EventArgs)},t.prototype._createDocumentService=function(e){return new kt(e)},t.prototype._getIsDisposed=function(){return e.prototype._getIsDisposed.call(this)||this._innerService.isDisposed},t.prototype._updateExecutionInfo=function(t){e.prototype._updateExecutionInfo.call(this,t)},t.prototype._updateDocumentStatus=function(t){this._updateStatus(t),e.prototype._updateDocumentStatus.call(this,t)},t.prototype._checkIsLoadCompleted=function(e){return e.status===pe.completed||e.status===pe.stopped},t.prototype._updateStatus=function(e){e&&e.status!==this._status&&(this._status=e.status,this.onStatusChanged())},t.prototype._convertParameters=function(e){return e.map(function(e){return{name:e.Name,dataType:e.ParameterType===Et.Boolean?de.Boolean:e.ParameterType===Et.DateTime?de.DateTime:e.ParameterType===Et.Float?de.Float:e.ParameterType===Et.Integer?de.Integer:de.String,nullable:!!e.Nullable,allowedValues:e.AvailableValues&&e.AvailableValues.length?e.AvailableValues.map(function(e){return{key:e.Label,value:e.Value}}):void 0,value:e.MultiValue&&e.Values&&e.Values.length?e.Values.map(function(e){return e.Value}):e.Value,hidden:!1,multiValue:e.MultiValue,prompt:e.Prompt,error:e.ExtendedErrorInfo}})},t}(ce);t._ArReportSource=Rt});