var FBPublication=FBPublication||{};FBPublication.build=function(t){function e(n){if(i[n])return i[n].exports;var o=i[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var i={};return e.m=t,e.c=i,e.d=function(t,i,n){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var i=t&&t.__esModule?function(){return t["default"]}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=20)}([function(t,e,i){"use strict";var n,o;Object.defineProperty(e,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a=window,s=Array.prototype,l=Object.prototype,h="undefined"!=typeof Symbol?Symbol.prototype:null,d=s.push,u=s.slice,c=l.toString,p=l.hasOwnProperty,f=Array.isArray,g=Object.keys,m=Object.create,v=function(){},y=function $(t){return t instanceof $?t:this instanceof $?void(this._wrapped=t):new $(t)};y.VERSION="1.8.3";var b,w=function(t,e,i){if(void 0===e)return t;switch(null==i?3:i){case 1:return function(i){return t.call(e,i)};case 3:return function(i,n,o){return t.call(e,i,n,o)};case 4:return function(i,n,o,r){return t.call(e,i,n,o,r)}}return function(){return t.apply(e,arguments)}},_=function(t,e,i){return y.iteratee!==b?y.iteratee(t,e):null==t?y.identity:y.isFunction(t)?w(t,e,i):y.isObject(t)?y.matcher(t):y.property(t)};y.iteratee=b=function(t,e){return _(t,e,1/0)};var P=function(t,e){return e=null==e?t.length-1:+e,function(){for(var i=Math.max(arguments.length-e,0),n=Array(i),o=0;o=0&&e<=C};y.each=y.forEach=function(t,e,i){e=w(e,i);var n,o;if(S(t))for(n=0,o=t.length;n0?0:a-1;for(o||(n=e[r?r[s]:s],s+=t);s>=0&&s=3;return e(t,w(i,o,4),n,r)}};y.reduce=y.foldl=y.inject=k(1),y.reduceRight=y.foldr=k(-1),y.find=y.detect=function(t,e,i){var n=S(t)?y.findIndex:y.findKey,o=n(t,e,i);if(void 0!==o&&o!==-1)return t[o]},y.filter=y.select=function(t,e,i){var n=[];return e=_(e,i),y.each(t,function(t,i,o){e(t,i,o)&&n.push(t)}),n},y.reject=function(t,e,i){return y.filter(t,y.negate(_(e)),i)},y.every=y.all=function(t,e,i){e=_(e,i);for(var n=!S(t)&&y.keys(t),o=(n||t).length,r=0;r=0},y.invoke=P(function(t,e,i){var n=y.isFunction(e);return y.map(t,function(t){var o=n?e:t[e];return null==o?o:o.apply(t,i)})}),y.pluck=function(t,e){return y.map(t,y.property(e))},y.where=function(t,e){return y.filter(t,y.matcher(e))},y.findWhere=function(t,e){return y.find(t,y.matcher(e))},y.max=function(t,e,i){var n,o,a=-(1/0),s=-(1/0);if(null==e||"number"==typeof e&&"object"!=r(t[0])&&null!=t){t=S(t)?t:y.values(t);for(var l=0,h=t.length;la&&(a=n)}else e=_(e,i),y.each(t,function(t,i,n){o=e(t,i,n),(o>s||o===-(1/0)&&a===-(1/0))&&(a=t,s=o)});return a},y.min=function(t,e,i){var n,o,a=1/0,s=1/0;if(null==e||"number"==typeof e&&"object"!=r(t[0])&&null!=t){t=S(t)?t:y.values(t);for(var l=0,h=t.length;ln||void 0===i)return 1;if(i0?0:o-1;r>=0&&r0?a=r>=0?r:Math.max(r+s,a):s=r>=0?Math.min(r+1,s):r+s+1;else if(i&&r&&s)return r=i(n,o),n[r]===o?r:-1;if(o!==o)return r=e(u.call(n,a,s),y.isNaN),r>=0?r+a:-1;for(r=t>0?a:s-1;r>=0&&re?(n&&(clearTimeout(n),n=null),s=h,a=t.apply(o,r),n||(o=r=null)):n||i.trailing===!1||(n=setTimeout(l,d)),a};return h.cancel=function(){clearTimeout(n),s=0,n=o=r=null},h},y.debounce=function(t,e,i){var n,o,r=function(e,i){n=null,i&&(o=t.apply(e,i))},a=P(function(a){if(n&&clearTimeout(n),i){var s=!n;n=setTimeout(r,e),s&&(o=t.apply(this,a))}else n=y.delay(r,e,this,a);return o});return a.cancel=function(){clearTimeout(n),n=null},a},y.wrap=function(t,e){return y.partial(e,t)},y.negate=function(t){return function(){return!t.apply(this,arguments)}},y.compose=function(){var t=arguments,e=t.length-1;return function(){for(var i=e,n=t[e].apply(this,arguments);i--;)n=t[i].call(this,n);return n}},y.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},y.before=function(t,e){var i;return function(){return--t>0&&(i=e.apply(this,arguments)),t<=1&&(e=null),i}},y.once=y.partial(y.before,2),y.restArgs=P;var R=!{toString:null}.propertyIsEnumerable("toString"),z=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],D=function(t,e){var i=z.length,n=t.constructor,o=y.isFunction(n)&&n.prototype||l,r="constructor";for(y.has(t,r)&&!y.contains(e,r)&&e.push(r);i--;)r=z[i],r in t&&t[r]!==o[r]&&!y.contains(e,r)&&e.push(r)};y.keys=function(t){if(!y.isObject(t))return[];if(g)return g(t);var e=[];for(var i in t)y.has(t,i)&&e.push(i);return R&&D(t,e),e},y.allKeys=function(t){if(!y.isObject(t))return[];var e=[];for(var i in t)e.push(i);return R&&D(t,e),e},y.values=function(t){for(var e=y.keys(t),i=e.length,n=Array(i),o=0;o1&&(n=w(n,e[1])),e=y.allKeys(t)):(n=F,e=L(e,!1,!1),t=Object(t));for(var o=0,r=e.length;o1&&(i=e[1])):(e=y.map(L(e,!1,!1),String),n=function(t,i){return!y.contains(e,i)}),y.pick(t,n,i)}),y.defaults=B(y.allKeys,!0),y.create=function(t,e){var i=T(t);return e&&y.extendOwn(i,e),i},y.clone=function(t){return y.isObject(t)?y.isArray(t)?t.slice():y.extend({},t):t},y.tap=function(t,e){return e(t),t},y.isMatch=function(t,e){var i=y.keys(e),n=i.length;if(null==t)return!n;for(var o=Object(t),r=0;r":">",'"':""","'":"'","`":"`"},V=y.invert(U),X=function(t){var e=function(e){return t[e]},i="(?:"+y.keys(t).join("|")+")",n=RegExp(i),o=RegExp(i,"g");return function(t){return t=null==t?"":""+t,n.test(t)?t.replace(o,e):t}};y.escape=X(U),y.unescape=X(V),y.result=function(t,e,i){var n=null==t?void 0:t[e];return void 0===n&&(n=i),y.isFunction(n)?n.call(t):n};var Y=0;y.uniqueId=function(t){var e=++Y+"";return t?t+e:e},y.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var G=/(.)^/,q={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Z=/\\|'|\r|\n|\u2028|\u2029/g,K=function(t){return"\\"+q[t]};y.template=function(t,e,i){!e&&i&&(e=i),e=y.defaults({},e,y.templateSettings);var n=RegExp([(e.escape||G).source,(e.interpolate||G).source,(e.evaluate||G).source].join("|")+"|$","g"),o=0,r="__p+='";t.replace(n,function(e,i,n,a,s){return r+=t.slice(o,s).replace(Z,K),o=s+e.length,i?r+="'+\n((__t=("+i+"))==null?'':_.escape(__t))+\n'":n?r+="'+\n((__t=("+n+"))==null?'':__t)+\n'":a&&(r+="';\n"+a+"\n__p+='"),e}),r+="';\n",e.variable||(r="with(obj||{}){\n"+r+"}\n"),r="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+r+"return __p;\n";var a;try{a=new Function(e.variable||"obj","_",r)}catch(s){throw s.source=r,s}var l=function(t){return a.call(this,t,y)},h=e.variable||"obj";return l.source="function("+h+"){\n"+r+"}",l},y.chain=function(t){var e=y(t);return e._chain=!0,e};var Q=function(t,e){return t._chain?y(e).chain():e};y.mixin=function(t){return y.each(y.functions(t),function(e){var i=y[e]=t[e];y.prototype[e]=function(){var t=[this._wrapped];return d.apply(t,arguments),Q(this,i.apply(y,t))}}),y},y.mixin(y),y.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=s[t];y.prototype[t]=function(){var i=this._wrapped;return e.apply(i,arguments),"shift"!==t&&"splice"!==t||0!==i.length||delete i[0],Q(this,i)}}),y.each(["concat","join","slice"],function(t){var e=s[t];y.prototype[t]=function(){return Q(this,e.apply(this._wrapped,arguments))}}),y.prototype.value=function(){return this._wrapped},y.prototype.valueOf=y.prototype.toJSON=y.prototype.value,y.prototype.toString=function(){return String(this._wrapped)},n=[],o=function(){return y}.apply(e,n),!(void 0!==o&&(t.exports=o)),e["default"]=y},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(){}Object.defineProperty(e,"__esModule",{value:!0});var r,a,s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l=i(0),h=n(l),d=Array.prototype.slice;o.prototype.on=function(t,e,i){if(!r(this,"on",t,[e,i])||!e)return this;this._events=this._events||{};var n=this._events[t]||(this._events[t]=[]);return n.push({callback:e,context:i,ctx:i||this}),this},o.prototype.once=function(t,e,i){if(!r(this,"once",t,[e,i])||!e)return this;var n=this,o=h["default"].once(function(){n.off(t,o),e.apply(this,arguments)});return o._callback=e,this.on(t,o,i)},o.prototype.destructor=function(){var t,e,i;i=h["default"].keys(this._events);for(var n=0,o=i.length;n1){for(var a=0;a1){var d=function(t){var e=r[0],i=t[r[0]];t.trigger("change:"+e,i,null,this);for(var n=1;n1.3?2:1},u.split=function(t,e){for(var i=t.split(" "),n=[],o=0;o=e&&n.push(i[o]);return n},u.isSplitter=function(t){for(var e=0;e1?decodeURIComponent(o[1]):null}}return t},u.fitScreenSizes=function(e,i,n,o){var r=n||t.innerWidth,a=o||t.innerHeight,s=r/a,l=e/i,h=s>l?e*a/i:r,d=s>l?a:i*r/e;return{width:h,height:d,paddingTop:(a-d)/2,paddingLeft:(r-h)/2}},u.fillScreenSizes=function(e,i,n,o){var r=n||t.innerWidth,a=o||t.innerHeight,s=r/a,l=e/i,h=s>l?r:e*a/i,d=s>l?i*r/e:a;return{width:h,height:d,paddingTop:(a-d)/2,paddingLeft:(r-h)/2}},u._loadExternalUrl=function(t,e,i){e=e||function(){},i=i||function(){};var n=o();n.open("GET",t,!0),n.onerror=function(){console.error("Error loading "+t),i(n.status)},n.onreadystatechange=function(){4===n.readyState&&(200===n.status?e(n):i(n.status))},n.send(null)},u.loadText=function(t,e,i){e=e||function(){},i=i||function(){},u._loadExternalUrl(t,function(t){e(t.responseText)},function(t){i(t)})},u.loadJSON=function(t,e,i){e=e||function(){},i=i||function(){},u.loadText(t,function(t){e(JSON.parse(t))},function(t){i(t)})},u.loadXML=function(t,e,i){e=e||function(){},i=i||function(){},u._loadExternalUrl(t,function(t){e(t.response)},i)},u.loadScript=function(e,i){i=i||function(){};var n=t.document.getElementsByTagName("head")[0],o=t.document.createElement("script");o.type="text/javascript",o.src=e,n.appendChild(o),o.readyState?o.onreadystatechange=function(){"loaded"!==o.readyState&&"complete"!==o.readyState||(o.onreadystatechange=null,i())}:o.onload=function(){i()}},u.isPointInsideRect=function(t,e){if(e){var i,n;if(t.hasOwnProperty("x")&&(i=t.x),t.hasOwnProperty("y")&&(n=t.y),d["default"].isNumber(i)&&d["default"].isNumber(n)&&i>=e.left&&i<=e.right&&n>=e.top&&n<=e.bottom)return!0}return!1},u.localToGlobal=function(t,e){var i={};return t&&e.hasOwnProperty("x")&&(i.x=Number(e.x)+Number(t.left)),t&&e.hasOwnProperty("y")&&(i.y=Number(e.y)+Number(t.top)),t&&e.hasOwnProperty("left")&&(i.left=Number(e.left)+Number(t.left)),t&&e.hasOwnProperty("top")&&(i.top=Number(e.top)+Number(t.top)),i},u.globalToLocal=function(t,e){var i={};return t&&e.hasOwnProperty("x")&&(i.x=Number(e.x)-Number(t.left)),t&&e.hasOwnProperty("y")&&(i.y=Number(e.y)-Number(t.top)),t&&e.hasOwnProperty("left")&&(i.left=Number(e.left)-Number(t.left)),t&&e.hasOwnProperty("top")&&(i.top=Number(e.top)-Number(t.top)),i},u.downloadFile=function(t,e){var i=new XMLHttpRequest;i.open("GET",t,!0),i.responseType="arraybuffer",i.onreadystatechange=function(){4===i.readyState&&e&&e(i.response)},i.send(null)},u.loadCSS=function(e,i,n){var o=t.document.styleSheets.length,r=function(e){var i=t.document.getElementsByTagName("head")[0],r=t.document.createElement("link");r.href=e,r.type="text/css",r.rel="stylesheet",d["default"].isString(n)&&(r.id=n),n&&document.getElementById(n)?(i.replaceChild(r,document.getElementById(n)),o--):i.appendChild(r)},a=function(e){return d["default"].filter(t.document.styleSheets,function(t){return d["default"].isString(t.href)&&t.href.indexOf(e)>=0}).length>0};d["default"].isFunction(i)&&!function(){var n=setInterval(function(){o=i[o];)e+=o,n-=i[o];return e}},u.deromanize=function(t){var e,t=t.toUpperCase(),i=/^M*(?:D?C{0,3}|C[MD])(?:L?X{0,3}|X[CL])(?:V?I{0,3}|I[XV])$/,n=/[MDLV]|C[MD]?|X[CL]?|I[XV]?/g,o={M:1e3,CM:900,D:500,CD:400,C:100,XC:90,L:50,XL:40,X:10,IX:9,V:5,IV:4,I:1},r=0;if(t&&i.test(t)){for(e=n.exec(t);e;)r+=o[e[0]],e=n.exec(t);return r}},u.getBookSizes=function(t,e,i,n,o){var r={bookSize:t,realSize:e.hasOwnProperty("width")?{width:e.width,height:e.height}:{width:e.right-e.left,height:e.bottom-e.top}};return i?(r.offset=0,n&&(r.realSize.width=r.realSize.width/2)):r.offset=n&&o?r.bookSize.width:0,r.scales={scaleX:r.realSize.width/r.bookSize.width,scaleY:r.realSize.height/r.bookSize.height},r},u.hasParentClass=function(t,e){for(var i=t;i;){if(d["default"].isString(i.className)&&i.className.indexOf(e)>=0)return!0;i=i.parentNode}return!1},u.decodeEntities=function(t){var e=document.createElement("textarea");return e.innerHTML=t,e.value},u.cleanString=function(e){var i=t.document.createElement("div");return i.appendChild(t.document.createTextNode(e)),i.innerHTML},u.isRoman=function(t){var e=t.toUpperCase(),i=/^M*(?:D?C{0,3}|C[MD])(?:L?X{0,3}|X[CL])(?:V?I{0,3}|I[XV])$/;return e&&i.test(e)},u.renderTemplate=function(e,i,n,o){n=n||{}; var r=t.document.createElement("div");for(r.innerHTML=i(n);r.firstChild;)d["default"].isUndefined(o)?e.appendChild(r.firstChild):e.insertBefore(r.firstChild,o)},u.onWheel=function(t,e){t.addEventListener?"onwheel"in document?t.addEventListener("wheel",e):"onmousewheel"in document?t.addEventListener("mousewheel",e):t.addEventListener("MozMousePixelScroll",e):t.attachEvent("onmousewheel",e)},u.removeOnWheel=function(t,e){t.removeEventListener?"onwheel"in document?t.removeEventListener("wheel",e):"onmousewheel"in document?t.removeEventListener("mousewheel",e):t.removeEventListener("MozMousePixelScroll",e):t.detachEvent("onmousewheel",e)};var c=10,p=40,f=800;u.normalizeWheel=function(t){var e=0,i=0,n=0,o=0;return"detail"in t&&(i=t.detail),"wheelDelta"in t&&(i=-t.wheelDelta/120),"wheelDeltaY"in t&&(i=-t.wheelDeltaY/120),"wheelDeltaX"in t&&(e=-t.wheelDeltaX/120),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(e=i,i=0),n=e*c,o=i*c,"deltaY"in t&&(o=t.deltaY),"deltaX"in t&&(n=t.deltaX),(n||o)&&t.deltaMode&&(1===t.deltaMode?(n*=p,o*=p):(n*=f,o*=f)),n&&!e&&(e=n<1?-1:1),o&&!i&&(i=o<1?-1:1),{spinX:e,spinY:i,pixelX:n,pixelY:o}},u.fitRectIntoBounds=function(t,e){var i=t.width/t.height,n=e.width/e.height,o={};return i>n?(o.width=e.width,o.height=t.height*(e.width/t.width)):(o.width=t.width*(e.height/t.height),o.height=e.height),o},u.combinePath=function(){var t=d["default"].without(Array.prototype.slice.call(arguments),"");return 1===t.length?t[0]:d["default"].map(t,function(t,e,i){switch(e){case 0:return t.replace(/(\/$)/,"");case i.length-1:return t.replace(/(^\/)/,"");default:return t.replace(/(^\/|\/$)/,"")}}).join("/")},u.addListener=function(t,e,i){t.addEventListener?t.addEventListener(e,i):t.attachEvent&&t.attachEvent("on"+e,i)},u.deepExtend=function(){if(arguments.length<1||"object"!==l(arguments[0]))return!1;if(arguments.length<2)return arguments[0];var t,e,i=arguments[0],n=Array.prototype.slice.call(arguments,1);return n.forEach(function(n){"object"!==("undefined"==typeof n?"undefined":l(n))||Array.isArray(n)||Object.keys(n).forEach(function(o){return e=i[o],t=n[o],t===i?void 0:"object"!==("undefined"==typeof t?"undefined":l(t))||null===t?void(i[o]=t):Array.isArray(t)?void(i[o]=s(t)):r(t)?void(i[o]=a(t)):"object"!==("undefined"==typeof e?"undefined":l(e))||null===e||Array.isArray(e)?void(i[o]=u.deepExtend({},t)):void(i[o]=u.deepExtend(e,t))})}),i},u.findSpace=function(t,e,i,n){for(var o=0,r=0,a=void 0,s=void 0,l=void 0,h=0;h=n[d].left+i||a+i<=n[d].left||s>=n[d].top+i||s+i<=n[d].top)){l=!0;break}o++,3===o&&(o=0,r++),r*i+i>e&&(l=!1)}while(l);return{left:a,top:s}},e["default"]=u}).call(e,i(6))},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var o=i(0),r=n(o),a=function(){function t(){return e?e:this instanceof t?(e=this,void this.setCallback(function(){})):new t}var e;return t.prototype.setAdapter=function(t){var e=this;this.adapter&&(this.adapter.setCallback(null),this.adapter=null),this.adapter=t,this.adapter.setCallback(function(t){e.callback(t)})},t.prototype.setCallback=function(t){this.callback=t},t.prototype.getPathInfo=function(){return this.adapter.getPathInfo()},t.prototype.setPath=function(t){this.adapter.setPath(t)},t.prototype.getShareUrl=function(t,e,i){return this.adapter.getShareUrl(t,e,i)},t.prototype.getEmbedUrl=function(t){return this.adapter.getEmbedUrl(t)},t.prototype.getLocalStorage=function(){return this.adapter.getLocalStorage()},t.prototype.getSessionStorage=function(){return this.adapter.getSessionStorage()},t.prototype.translatePath=function(t,e){var i=this;r["default"].isString(t)&&(t=[t]);var n=r["default"].chain(t).flatten().map(function(t){return i.adapter.translatePath(t,e)}).value();return 1===n.length?n[0]:n},t.prototype.getEmbedPrefix=function(){return this.adapter.getEmbedPrefix()},t.prototype.getCrossOrigin=function(){return this.adapter.getCrossOrigin()},t}();e["default"]=a},function(t,e){var i;i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(n){"object"==typeof window&&(i=window)}t.exports=i},function(t,e,i){var n;!function(o,r,a,s){"use strict";function l(t,e,i){return setTimeout(p(t,i),e)}function h(t,e,i){return!!Array.isArray(t)&&(d(t,i[e],i),!0)}function d(t,e,i){var n;if(t)if(t.forEach)t.forEach(e,i);else if(t.length!==s)for(n=0;n\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",r=o.console&&(o.console.warn||o.console.log);return r&&r.call(o.console,n,i),t.apply(this,arguments)}}function c(t,e,i){var n,o=e.prototype;n=t.prototype=Object.create(o),n.constructor=t,n._super=o,i&>(n,i)}function p(t,e){return function(){return t.apply(e,arguments)}}function f(t,e){return typeof t==yt?t.apply(e?e[0]||s:s,e):t}function g(t,e){return t===s?e:t}function m(t,e,i){d(w(e),function(e){t.addEventListener(e,i,!1)})}function v(t,e,i){d(w(e),function(e){t.removeEventListener(e,i,!1)})}function y(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function b(t,e){return t.indexOf(e)>-1}function w(t){return t.trim().split(/\s+/g)}function _(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var n=0;ni[e]}):n.sort()),n}function E(t,e){for(var i,n,o=e[0].toUpperCase()+e.slice(1),r=0;r1&&!i.firstMultiple?i.firstMultiple=O(e):1===o&&(i.firstMultiple=!1);var r=i.firstInput,a=i.firstMultiple,s=a?a.center:r.center,l=e.center=N(n);e.timeStamp=_t(),e.deltaTime=e.timeStamp-r.timeStamp,e.angle=B(s,l),e.distance=D(s,l),L(i,e),e.offsetDirection=z(e.deltaX,e.deltaY);var h=R(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=h.x,e.overallVelocityY=h.y,e.overallVelocity=wt(h.x)>wt(h.y)?h.x:h.y,e.scale=a?W(a.pointers,n):1,e.rotation=a?F(a.pointers,n):0,e.maxPointers=i.prevInput?e.pointers.length>i.prevInput.maxPointers?e.pointers.length:i.prevInput.maxPointers:e.pointers.length,M(i,e);var d=t.element;y(e.srcEvent.target,d)&&(d=e.srcEvent.target),e.target=d}function L(t,e){var i=e.center,n=t.offsetDelta||{},o=t.prevDelta||{},r=t.prevInput||{};e.eventType!==Nt&&r.eventType!==zt||(o=t.prevDelta={x:r.deltaX||0,y:r.deltaY||0},n=t.offsetDelta={x:i.x,y:i.y}),e.deltaX=o.x+(i.x-n.x),e.deltaY=o.y+(i.y-n.y)}function M(t,e){var i,n,o,r,a=t.lastInterval||e,l=e.timeStamp-a.timeStamp;if(e.eventType!=Dt&&(l>Ot||a.velocity===s)){var h=e.deltaX-a.deltaX,d=e.deltaY-a.deltaY,u=R(l,h,d);n=u.x,o=u.y,i=wt(u.x)>wt(u.y)?u.x:u.y,r=z(h,d),t.lastInterval=e}else i=a.velocity,n=a.velocityX,o=a.velocityY,r=a.direction;e.velocity=i,e.velocityX=n,e.velocityY=o,e.direction=r}function O(t){for(var e=[],i=0;i=wt(e)?t<0?Ft:Wt:e<0?Ht:jt}function D(t,e,i){i||(i=Yt);var n=e[i[0]]-t[i[0]],o=e[i[1]]-t[i[1]];return Math.sqrt(n*n+o*o)}function B(t,e,i){i||(i=Yt);var n=e[i[0]]-t[i[0]],o=e[i[1]]-t[i[1]];return 180*Math.atan2(o,n)/Math.PI}function F(t,e){return B(e[1],e[0],Gt)+B(t[1],t[0],Gt)}function W(t,e){return D(e[0],e[1],Gt)/D(t[0],t[1],Gt)}function H(){this.evEl=Zt,this.evWin=Kt,this.pressed=!1,S.apply(this,arguments)}function j(){this.evEl=Jt,this.evWin=te,S.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function U(){this.evTarget=ie,this.evWin=ne,this.started=!1,S.apply(this,arguments)}function V(t,e){var i=P(t.touches),n=P(t.changedTouches);return e&(zt|Dt)&&(i=T(i.concat(n),"identifier",!0)),[i,n]}function X(){this.evTarget=re,this.targetIds={},S.apply(this,arguments)}function Y(t,e){var i=P(t.touches),n=this.targetIds;if(e&(Nt|Rt)&&1===i.length)return n[i[0].identifier]=!0,[i,i];var o,r,a=P(t.changedTouches),s=[],l=this.target;if(r=i.filter(function(t){return y(t.target,l)}),e===Nt)for(o=0;o-1&&n.splice(t,1)};setTimeout(o,ae)}}function K(t){for(var e=t.srcEvent.clientX,i=t.srcEvent.clientY,n=0;n-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){function e(e){i.manager.emit(e,t)}var i=this,n=this.state;n=we&&e(i.options.event+et(n))},tryEmit:function(t){return this.canEmit()?this.emit(t):void(this.state=Te)},canEmit:function(){for(var t=0;te.threshold&&o&e.direction},attrTest:function(t){return ot.prototype.attrTest.call(this,t)&&(this.state&ye||!(this.state&ye)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=it(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),c(at,ot,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[pe]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&ye)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),c(st,tt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[ue]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,n=t.distancee.time;if(this._input=t,!n||!i||t.eventType&(zt|Dt)&&!o)this.reset();else if(t.eventType&Nt)this.reset(),this._timer=l(function(){this.state=_e,this.tryEmit()},e.time,this);else if(t.eventType&zt)return _e;return Te},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===_e&&(t&&t.eventType&zt?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=_t(),this.manager.emit(this.options.event,this._input)))}}),c(lt,ot,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[pe]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&ye)}}),c(ht,ot,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Ut|Vt,pointers:1},getTouchAction:function(){return rt.prototype.getTouchAction.call(this)},attrTest:function(t){var e,i=this.options.direction;return i&(Ut|Vt)?e=t.overallVelocity:i&Ut?e=t.overallVelocityX:i&Vt&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&i&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&wt(e)>this.options.velocity&&t.eventType&zt},emit:function(t){var e=it(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),c(dt,tt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ce]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,n=t.distance
":">",'"':""","'":"'","/":"/"},i=t?/[&<>"'\/]/g:/&(?!#?\w+;)|<|>|"|'|\//g;return function(t){return t?t.toString().replace(i,function(t){return e[t]||t}):""}}(),i='
';return i},n["workspace-download-window"]=function(t){var e="undefined"!=typeof _encodeHTML?_encodeHTML:function(t){var e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},i=t?/[&<>"'\/]/g:/&(?!#?\w+;)|<|>|"|'|\//g;return function(t){return t?t.toString().replace(i,function(t){return e[t]||t}):""}}(),i="";t.full&&(i+=' '+e(t.full.title)+' - '+e(t.full.fileSize)+' '+e(t.localization.fullDescription)+""),i+='
"},n["workspace-note-rect"]=function(t){var e='
';return e+='
'+t.localization.DIALOG_DELETE_TEXT+'
'+t.localization.BUTTON_CANCEL+' '+t.localization.BUTTON_DELETE+"
"},n["workspace-pdf-print-window"]=function(t){var e="undefined"!=typeof _encodeHTML?_encodeHTML:function(t){var e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},i=t?/[&<>"'\/]/g:/&(?!#?\w+;)|<|>|"|'|\//g;return function(t){return t?t.toString().replace(i,function(t){return e[t]||t}):""}}(),i='"},n["workspace-social-window"]=function(t){var e="undefined"!=typeof _encodeHTML?_encodeHTML:function(t){var e={"&":"&","<":"<",">":">",'"':""","'":"'", "/":"/"},i=t?/[&<>"'\/]/g:/&(?!#?\w+;)|<|>|"|'|\//g;return function(t){return t?t.toString().replace(i,function(t){return e[t]||t}):""}}(),i='
'+e(t.localization.embedTab)+'
'+e(t.localization.shareText)+'
"},n["workspace-tool-window"]=function(t){var e="undefined"!=typeof _encodeHTML?_encodeHTML:function(t){var e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},i=t?/[&<>"'\/]/g:/&(?!#?\w+;)|<|>|"|'|\//g;return function(t){return t?t.toString().replace(i,function(t){return e[t]||t}):""}}(),i='

'+e(t.title)+'

';return i},n["workspace-tooltip"]=function(t){var e="undefined"!=typeof _encodeHTML?_encodeHTML:function(t){var e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},i=t?/[&<>"'\/]/g:/&(?!#?\w+;)|<|>|"|'|\//g;return function(t){return t?t.toString().replace(i,function(t){return e[t]||t}):""}}(),i='
'+e(t.text)+"
";return i},n["workspace-top-bar"]=function(t){var e="undefined"!=typeof _encodeHTML?_encodeHTML:function(t){var e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},i=t?/[&<>"'\/]/g:/&(?!#?\w+;)|<|>|"|'|\//g;return function(t){return t?t.toString().replace(i,function(t){return e[t]||t}):""}}(),i=''+e(t.title)+' '+e(t.page||"page:")+' / ';return i},e["default"]=n},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(){this._state=h.IDLE,this._loadedData=void 0,this._id=void 0,this._type=void 0,this._size=void 0,this.uses=0,this._url=void 0,this._history=[]}Object.defineProperty(e,"__esModule",{value:!0}),e.LoaderEvent=e.LoaderState=e["default"]=void 0;var r=i(0),a=n(r),s=i(1),l=n(s),h={IDLE:0,UNREADY:1,READY:2,LOADING:3,LOADED:4,ERROR:-1,CANCELLED:-2},d={LOADING:"loading",LOADED:"loaded",DATA_IS_READY:"data",ERROR:"error",CANCELLED:"cancelled"};o.prototype=Object.create(l["default"].prototype),o.constructor=o,o.prototype.destructor=function(){this.destructed=!0},o.prototype.free=function(){this._state=h.IDLE,this._loadedData=void 0,this._history.push(this.hash()),this._id=void 0,this._type=void 0,this._size=void 0,this.uses=0,this._url=void 0,l["default"].prototype.destructor.call(this)},o.prototype.setHash=function(t,e,i){return this._id=t,this._type=e,this._size=i||0,this._id+"_"+this._type+"_"+this._size},o.prototype.id=function(){return this._id},o.prototype.type=function(){return this._type},o.prototype.size=function(){return this._size},o.prototype.url=function(){return this._url},o.prototype.hash=function(){return this._id+"_"+this._type+"_"+this._size},o.prototype.getState=function(){return this._state},o.prototype.toString=function(){return this.hash()+"("+this._state+")"},o.prototype.setUrl=function(t){this._url=t},o.prototype.unready=function(){if(this._state!==h.IDLE)throw new Error("Only IDLE loader may become UNREADY.");this._state=h.UNREADY},o.prototype.ready=function(){if(this._state!==h.IDLE&&this._state!==h.UNREADY)throw new Error("Only IDLE or UNREADY loader may become READY.");this._state=h.READY,this._loadedData=this._url},o.prototype.load=function(){if(this._state!==h.READY)throw new Error("Can't load loader with status ",(+this._state));this._state=h.LOADING;var t=this;a["default"].defer(function(){t._onLoad(t._url)}),this.trigger(d.DATA_IS_READY),this.trigger(d.LOADING)},o.prototype.abort=function(){this._state=h.CANCELLED,this.trigger("onCancelled")},o.prototype.isIndefiniteProgress=function(){return!0},o.prototype.getLoadedData=function(){return this.isDataReady()?this._loadedData:void 0},o.prototype.isIdle=function(){return this._state===h.IDLE},o.prototype.isLoaded=function(){return this._state===h.LOADED},o.prototype.isDataReady=function(){return this._state>=h.LOADING},o.prototype.isLoading=function(){return this._state===h.LOADING},o.prototype.isError=function(){return this._state===h.ERROR},o.prototype.setError=function(t){this._onError(t)},o.prototype._onLoad=function(t){this._state=h.LOADED,this._loadedData=t,this.trigger(d.LOADED,this._loadedData)},o.prototype._onError=function(t){this._state=h.ERROR,this.trigger("onError",t)},o.prototype._onProgress=function(t,e,i){var n={progress:t};e&&(n.title=e),i&&(n.image=i),this.trigger("onProgress",n)},e["default"]=o,e.LoaderState=h,e.LoaderEvent=d},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var o=i(2),r=n(o),a=i(16),s=n(a),l={parseTranslate:function(t){function e(t){return parseInt(t.replace("px",""),10)}var i=t.match(/[^(),\s]+/g),n={};if("undefined"==typeof t)return n={},n.translate={x:0,y:0,z:0},n;if(null===i)return n.translate={x:0,y:0,z:0},n;for(var o=0,r=i.length;o50?this.rect.width*(1-t):this.rect.width-50,i=d["default"].fitRectIntoBounds({width:2*this.model.getBookSize().width,height:this.model.getBookSize().height},{width:e,height:this.rect.height*(1-t)});return{width:2*Math.round(i.width/2),height:Math.round(i.height)}},o.prototype.setRect=function(t){this.rect=t},r.prototype=Object.create(o.prototype),r.prototype.constructor=r,r.prototype.getPageSize=function(t){var e=o.prototype.getPageSize.call(this);if(1===t||t===this.model.getPagesCount()&&t%2===0)return e;var i=this.model.getHardcoverSize(),n=e.width/e.height,r=i,a=r*n;return e.width=Math.round(e.width-2*a),e.height=Math.round(e.height-2*r),e},a.prototype=Object.create(y["default"].prototype),a.prototype.constructor=a,a.prototype.destructor=function(){for(var t in this.contentPresenters)this.contentPresenters.hasOwnProperty(t)&&l["default"].isFunction(this.contentPresenters[t].destructor)&&this.contentPresenters[t].destructor();this.view._stopCorner()},a.prototype._createView=function(){return new m["default"](this)},a.prototype.init=function(t){var e=this;this.bookSizeProvider.setRect(t.getBoundingClientRect());var i=this.model.getPager().getState();return this.view.init(t,{hardcover:this.model.isHardcover(),coverColor:this.model.getCoverColor(),startPage:this.model.getPager().pageTable.getPageIndexById(i.leftPage?i.leftPage:i.rightPage)+1,totalPages:this.model.getPagesCount(),rightToLeft:this.model.getPager().isRtl(),pageFlippingDuration:this.model.getFlippingDuration(),bookSizeProvider:this.bookSizeProvider,contentProvider:this,flipCorner:this.model.getFlipCorner(),lightFlipCorner:this.model.getBrowser().firefox,notes:!(0,w["default"])().getLocalStorage().isStub&&this.model.getNotesEnabled()}),this.model.on("change:flipCorner",this._flipCornerUpdate,this),this.view.setPrevButtonVisible(!this.model.getPager().isFirstPage()),this.view.setNextButtonVisible(!this.model.getPager().isLastPage()),this.model.getPager().on("freezed",function(){e.view._jqueryFlipbook.turn("disable",!0),e.view._jqueryFlipbook.turn("stop"),e._flipCornerUpdate(!1)}),this.model.getPager().on("unfreezed",function(){e.view._jqueryFlipbook.turn("disable",!1),e._flipCornerUpdate(e.model.getFlipCorner())}),this.resize(t.getBoundingClientRect()),this.onPagerStateChange(i),y["default"].prototype.init.call(this)},a.prototype._flipCornerUpdate=function(t){this.view.setFlipCorner(t)},a.prototype.getViewContainer=function(){return this.view.getContainer()},a.prototype.getContentForPage=function(t){if(l["default"].has(this.contentPresenters,t))return this.contentPresenters[t].getViewElement();var e=this.model.getPageTable().getPageIdByIndex(t-1);if(!l["default"].isUndefined(e)){var i=this.model.getPageTable().getPageModel(e),n=i.getProperty("wide"),o=t%2!==0;this.model.getPager().isRtl()&&(o=!o);var r=new c["default"](this.model.getBookModel(),i,(!1),n?o?"wideRight":"wideLeft":void 0),a=new f["default"](r).init(this.bookSizeProvider.getPageSize(parseInt(t,10)),!1);return this.listenTo(a,"requestNavigation",function(e){if(!this.view.isFlipping()&&e)switch(e.type){case"page":this.model.getPager().goToPageById(e.data.pageId);break;case"next":if(this.view.isAnimating())break;this.model.getPager().goForward();break;case"prev":if(this.view.isAnimating())break;this.model.getPager().goBackward();break;case"zoom":var i=e.data.center;n&&o&&(i.x+=this.bookSizeProvider.getPageSize(t-1).width),this.model.getPager().setZoomMode(!0,t%2,{name:"mouse",center:i})}},this),this.contentPresenters[t]=a,a.getViewElement()}},a.prototype.goToPage=function(t){var e=this.model.getPager();if(e.isFreezed()&&e.isFreezedBy(this)&&e.unfreeze(this),l["default"].isNumber(t)){var i=this.model.getPageTable(),n=i.getPageIdByIndex(t);e.goToPageById(n,this.targetName)}else switch(t){case"next":e.goForward();break;case"previous":e.goBackward();break;case"first":e.goToFirst();break;case"last":e.goToLast()}e.freeze(this)},a.prototype.resize=function(t){var e=this;this.bookSizeProvider.setRect(t),this.view.resize(),l["default"].each(this.contentPresenters,function(t,i){t.resize(e.bookSizeProvider.getPageSize(parseInt(i,10)))})},a.prototype.onPagerStateChange=function(t,e,i,n){var o=this;if(!l["default"].isNull(t)&&!l["default"].isUndefined(t)&&(y["default"].prototype.onPagerStateChange.apply(this,arguments),this.view.setPrevButtonVisible(!this.model.isFirstPageState(t)),this.view.setNextButtonVisible(!this.model.isLastPageState(t)),this.view.setLastAddNoteVisible(this.model.isLastPageState(t)),this.targetName!==n)){var r=l["default"].isNull(e)||l["default"].isUndefined(e),a=l["default"].isUndefined(t.leftPage)?t.rightPage:t.leftPage;if(!r){var s=l["default"].isUndefined(e.leftPage)?e.rightPage:e.leftPage;if(a!==s){var h=this.model.getPageTable().getPageIndexById(a);if(this.model.isHardcover()){var d=function(t,e){t>=0&&(o.model.getPager().freeze(o),o.once("onPageChanged",function(){o.model.getPager().unfreeze(o),e>=0&&1!=e&&!(e>1&&t-e===1)&&o.view.goToPage(e+1)}),o.view.goToPage(t+1))};if(this.model.isFirstPageState(e)){if(!this.model.isLastPageState(t)||!this.model.hasBackOutsideCover())return void d(1,h)}else if(this.model.isLastPageState(e)&&this.model.hasBackOutsideCover()){if(!this.model.isFirstPageState(t))return void d(this.model.getPagesCount()-2,h)}else if(this.model.isFirstPageState(t)){if(!this.model.isFrontInsideCoverPageState(e))return void d(1,0)}else if(this.model.isLastPageState(t)&&this.model.hasBackOutsideCover()&&!this.model.isBackInsideCoverPageState(e))return void d(this.model.getPagesCount()-2,this.model.getPagesCount()-1)}h>=0&&this.view.goToPage(h+1)}}}},a.prototype.onPageActivate=function(t){y["default"].prototype.onPageActivate.call(this,t);var e=this,i=this.model.getPageTable(),n=i.getPageModel(t),o=n.getProperty("wide"),r=[i.getPageIndexById(t)+1];o&&r.push(i.getPageIndexById(t)+2),l["default"].each(r,function(t){t>0&&(l["default"].has(e.contentPresenters,t)||e.view.addPageContent(t),e.model.getBookModel().isReady?e.contentPresenters[t].setActive(!0):e.model.getBookModel().on("change:isReady",function(i){i&&e.contentPresenters[t].setActive(!0)}))})},a.prototype.onPageDeactivate=function(t){var e=this,i=this.model.getPageTable(),n=i.getPageModel(t),o=n.getProperty("wide"),r=[i.getPageIndexById(t)+1];o&&r.push(i.getPageIndexById(t)+2),l["default"].each(r,function(t){t>0&&l["default"].has(e.contentPresenters,t)&&e.contentPresenters[t].setActive(!1)})},a.prototype.getDataForTransitionStart=function(){var t={};return l["default"].each(this.view.getCurrentPagesDomElements(),function(e,i){t[i-1]=e}),t},a.prototype._onHardcoverColorChanged=function(t){this.view.setCoverColor(t)},a.prototype.destroy=function(){l["default"].each(this.contentPresenters,function(t){t.destroy()}),this.model.off("change:hardcoverColor",this._onHardcoverColorChanged,this),this.model.off("change:flipCorner",this._flipCornerUpdate,this),this.model.destroy(),this.view._stopCorner(),y["default"].prototype.destroy.call(this)},a.prototype.onPageChanged=function(){var t=this.model.getPager();t.isFreezed()&&t.isFreezedBy(this)&&t.unfreeze(this),y["default"].prototype.onPageChanged.call(this)},e["default"]=a},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t){this.parent=t,this.items={}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(1),a=n(r),s=i(3),l=n(s);o.prototype=new a["default"],o.prototype.constructor=o,o.prototype.addItem=function(t,e){var i=this.getElementType(e.target);if(!t.include||t.include.indexOf(i)>=0){var n=t.group||0;this.items.hasOwnProperty(n)||(this.items[n]=new Array),this.items[n].push({name:t.name,action:t.action,icon:t.icon,event:t.event,options:t.options,analyticsName:t.analyticsName||t.name})}},o.prototype.removeItemByName=function(t){for(var e in this.items)for(var i=0;idocument.documentElement.clientWidth/2?r?"left":"right":r?"right":"left";o="left"===a?i:n}return e.pageTable.getUrlHeaderById(o)},o.prototype.getElementType=function(t){var e={image:"image",video:"video","publication-link":"link",gif:"gif","publication-note":"note"},i=["playButton","image-inner","thumbnail","highlight","note-icon"],n="page",o=t.classList[0];return i.indexOf(o)!==-1&&(o=t.parentElement.classList[0]),e.hasOwnProperty(o)&&(n=e[o]),n},o.prototype.getLength=function(t){if(void 0===t){var e=0;for(var t in this.items)e+=this.items[t].length;return e}return this.items.hasOwnProperty(t)&&this.items[t].length,0},o.prototype.showMenu=function(t){if(this.getLength()>0&&!t.ctrlKey){var e=this.getElementType(t.target),i=i||this.parent;t=t||window.event,t.preventDefault?t.preventDefault():t.returnValue=!1,this.initMenu(i);var n=this.DOMObj.getBoundingClientRect(),r=i.getBoundingClientRect(),a=t.pageX,s=t.pageY,h=a-r.left,d=s-r.top,u=(0,l["default"])().get(l["default"].LOCALE).isLocaleRTL();u?h-n.width>=0?this.DOMObj.style.left=a-n.width+"px":h+n.width=0?this.DOMObj.style.left=a-n.width+"px":this.DOMObj.style.left=r.left+r.width-n.width+"px",d+n.height=0?this.DOMObj.style.top=s-n.height+"px":this.DOMObj.style.top=r.top+r.height-n.height+"px",(0,l["default"])().get(l["default"].API).trigger("contextMenu",{action:"open",page:this.getUrlHeaderByX(a),elementType:e,x:a,y:s});var c=this,p=function f(){c.DOMObj&&c.DOMObj.parentNode&&c.DOMObj.parentNode.removeChild(c.DOMObj),this.onclick=void 0,document.removeEventListener("click",f),document.removeEventListener("keydown",f),delete c._hideMenu,c.trigger(o.HIDE_EVENT)};this._hideMenu=p,document.addEventListener("click",p),document.addEventListener("keydown",p),c.trigger(o.SHOW_EVENT,t)}else this._hideMenu&&this._hideMenu()},o.prototype.initMenu=function(t){this.DOMObj&&this.DOMObj.parentNode&&this.DOMObj.parentNode.removeChild(this.DOMObj);var e=this,i=document.createElement("div");i.className="context-menu";var n=document.createElement("ul");i.appendChild(n);var o=!0;for(var r in this.items){if(!o){var a=document.createElement("li");a.className="context-menu-divider",n.appendChild(a)}for(var s=0;se.length)){for(var o=0;o0&&this.noteTextArea.focus(),this.options&&this.options.model&&this.options.model.isNew&&(this.noteTextArea.focus(),delete this.options.model.isNew)),this.state=t,this.trigger(v.CHANGE_STATE_EVENT,{state:t})},t.prototype.open=function(t,e){if(this.state===v.CLOSE_STATE||!this.ids||!this.isSameIds(e)){var n=this._getAreaContainer();this.noteRect&&this.close(null,!0),this.ids=e,this.options=t,s["default"].renderTemplate(n,r["default"]["workspace-note-rect"],t),this.noteRect=h["default"].id("note-rect"),this.noteTextArea=h["default"].id("note-text-area"),this.noteDeleteDialog=h["default"].id("note-delete-dialog"),this.noteRect&&(this.noteRect.style["z-index"]=10001,this.setState(t.text?v.VIEW_STATE:v.EDIT_STATE)),this.colorSet=h["default"].id("color-set"),this.noteTime=h["default"].id("note-time");var o=new Date(Date.now()),a=new Date(t.date),l=a.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});o.getDay()===a.getDay()&&o.getFullYear()===a.getFullYear()&&o.getMonth()===a.getMonth()||(l=a.toLocaleDateString()+", "+l),this.noteTime.innerText=l,this.colorSet.addEventListener("click",function(t){var e=t.target.getAttribute("data-color");if(e){i.trigger(v.CHANGE_COLOR_EVENT+i.eventSuffix(),e);for(var n=h["default"].className("note-border-color"),o=0;od?e*l/i:s,c=h>d?l:i*s/e;return n&&(u>e||c>i)?(u=e,c=i,s+=a,l+=a,a=0):(u=Math.round(u),c=Math.round(c)),{width:u,height:c,paddingTop:(l+a-c)/2-10,paddingLeft:(s+a-u)/2-10}},o=function(t,e,i){t.addEventListener?t.addEventListener(e,i):t.attachEvent("on"+e,i)},a=function(t,e,i){t.removeEventListener?t.removeEventListener(e,i):t.detachEvent("on"+e,i)};return e.prototype=new s["default"],e.prototype.setRootContainer=function(t){this.root=t},e.prototype.showFrame=function(e,i){var n=this,a=this.root;this.sizer=i,this.frame=e,this.blackout=u["default"].createElement("div",{"class":"black-out"},a),this.lightbox=u["default"].createElement("div",{"class":"contentfull-lightbox"},a),this.closeButton=u["default"].createElement("div",{"class":"closeButton"},this.lightbox),"img"===e.tagName.toLowerCase()?e.naturalWidth?(this.lightbox.appendChild(e),this._sizing(!0),n.trigger("contentLoaded")):(this.pr=document.createElement("img"),this.pr.src=(0,h["default"])().translatePath("static/html/styles/img/lightbox-preloader.gif"),n.lightbox.appendChild(this.pr),this._sizing(!0)):(this.lightbox.appendChild(e),this._sizing(),n.trigger("contentLoaded")),this._bindClose(),r["default"].defer(function(){u["default"].addClass(a,"lightbox-opened")}),o(t,"resize",function(){var t=!i||i.maxSizes;n._sizing.call(n,t)})},e.prototype._sizing=function(t){var e=1600,i=900;this.sizer&&this.sizer.width&&this.sizer.height&&(e=this.sizer.width,i=this.sizer.height,this.pr&&this.pr.parentElement===this.lightbox&&(this.lightbox.removeChild(this.pr),this.lightbox.appendChild(this.frame))),t=t||!1;var o=n(e,i,t,this.root);this.lightbox.style.width=o.width+"px",this.lightbox.style.height=o.height+"px",this.lightbox.style.top=o.paddingTop+"px",this.lightbox.style.left=o.paddingLeft+"px",this.lightbox.style.margin="0"},e.prototype._close=function(){var t=this,e=this.root;u["default"].removeClass(e,"lightbox-opened"),u["default"].del(t.lightbox),function i(){var e=getComputedStyle(t.blackout);"hidden"===e.visibility?(u["default"].del(t.blackout),t.trigger("closed")):setTimeout(i,100)}()},e.prototype._bindClose=function(){var e=this,i=function r(i){27===i.keyCode&&(i.stopPropagation(),a(t.document,"keyup",r),e._close(callback))},n=function(n){n.stopPropagation(),a(t.document,"keyup",i),e._close()};o(this.closeButton,"click",n),o(this.blackout,"click",n),o(t.document,"keyup",i)},e}();e["default"]=c}).call(e,i(6))},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(){this.value={},this.oldValue={},this.value.changingPosition=!1,this.value.changingZoom=!1,this.value.changeFullscreen=!1,this.video={}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(1),a=n(r),s=i(0),l=n(s);Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(t,e){if(void 0===t||null===t)throw new TypeError("Cannot convert first argument to object");for(var i=Object(t),n=1;n=0&&(i.hardcover=!1),i=new l["default"](i,M["default"]),t.pager=new c["default"](i),(0,P["default"])().set(P["default"].PAGER,t.pager),t.set("pagesProps",i,!0)};this.pagerFunc?this.pagerFunc().then(e):d["default"].loadJSON((0,w["default"])().translatePath("assets/common/pager.json"),e)},o.prototype.loadCss=function(){if(this.direction!==t.RTL){var e=this,i="buildCss";d["default"].loadCSS((0,w["default"])().translatePath("static/html/styles/css/build"+(t.RTL?".rtl":"")+".css"),function(){e._registerStyleTagForDestructor(i),e.loadSkin(),e.set("isCssLoaded",!0,!0),e.set("direction",t.RTL,!0)},i)}},o.prototype.loadSkin=function(){var e=this,i="skinCss";d["default"].loadCSS((0,w["default"])().translatePath("skins/current/css/build"+(t.RTL?".rtl":"")+".css"),function(){e._registerStyleTagForDestructor(i),d["default"].loadJSON((0,w["default"])().translatePath("skins/current/config.json"),function(t){var i=y["default"].isObject(e.extensions)&&y["default"].isObject(e.extensions.skinConfig)?d["default"].deepExtend(t,e.extensions.skinConfig):t;e.set("skinConfig",new l["default"](i),!0),e.skinConfig.on("all",e._onSkinConfigChange,e),y["default"].each(i,function(t,i){e.setParamToSkin(i,t)}),e.set("isSkinConfigInited",!0,!0)})},i)},o.prototype.initModules=function(){var t=(0,P["default"])().get(P["default"].LIBRARY_MANAGER),e=this;t.add({name:"search"}),y["default"].isObject(this.workspaceProps)&&y["default"].isObject(this.pagesProps)&&this.workspaceProps.onAndChange("change:search",function(i){if(i.enabled){var n=void 0,o=function(){if(n&&String.prototype.normalize){var t={};e.workspaceProps.search&&e.workspaceProps.search.searchCharactersLimit&&(t.searchCharactersLimit=e.workspaceProps.search.searchCharactersLimit),(0,P["default"])().set(P["default"].SEARCH_PROVIDER,new n(t,e.pager.pageTable))}};String.prototype.normalize||t.loaded("unorm")||(t.on("library:unorm",function(){o()}),t.load("unorm")),t.loaded("search")||(t.on("library:search",function(t){n=t.exports.LocalSearchProvider,o()}),t.load("search"))}},this)},o.prototype.loadLocale=function(){var e=this;y["default"].isObject(this.workspaceProps)&&this.workspaceProps.onAndChange("change:locales",function(){e.isLocaleLoading&&(0,P["default"])().get(P["default"].API).trigger("error",{msg:"Previous locale is still loading!",code:1}),e.set("isLocaleLoading",!0,!1),(0,P["default"])().has(P["default"].LOCALE)||(0,P["default"])().set(P["default"].LOCALE,new E["default"]);var i=(0,P["default"])().get(P["default"].LOCALE).getNewLocale(this.userAgentInfo.locales,this.workspaceProps.locales);d["default"].loadJSON((0,w["default"])().translatePath("locales/"+i+".json"),function(n){(0,P["default"])().get(P["default"].LOCALE).setLanguage(n,i),t.RTL=(0,P["default"])().get(P["default"].LOCALE).isLocaleRTL(),e.set("isLocaleLoading",!1,!1),e.set("isLocaleLoaded",!0,!0),e.loadCss(),e._setFont()},function(t){(0,P["default"])().get(P["default"].API).trigger("error",{msg:"Could not load locale '"+i+"', error code "+t+".",code:2})})},this)},o.prototype._setFont=function(){var e="fontCss",i=(0,P["default"])().get(P["default"].LOCALE).getFontConfig(),n=this;return y["default"].isUndefined(i)?(this.container.style.fontFamily='"Helvetica Neue", Helvetica, Arial, sans-serif',void this.set("isFontLoaded",!0,!0)):(this.container.style.fontFamily=i["font-family"]+", Helvetica, Arial, sans-serif",this.fontLoaderNormal=m["default"].createElement("span",{"class":"font-loader",styles:{"font-weight":i["font-weight-normal"]}},n.container),this.fontLoaderBold=m["default"].createElement("span",{"class":"font-loader",styles:{"font-weight":i["font-weight-bold"]}},n.container),this.fontLoaderNormal.innerText="ABC 123",this.fontLoaderBold.innerText="DEF 456",void d["default"].loadCSS("https://fonts.googleapis.com/css?family="+encodeURIComponent(i["font-family"]+":"+i["font-weight-normal"]+","+i["font-weight-bold"]+"&subset="+i.subset),function(){if(n._registerStyleTagForDestructor(e),n.setParamToSkin("font-weight-normal",i["font-weight-normal"]),n.setParamToSkin("font-weight-bold",i["font-weight-bold"]),t.navigator&&t.navigator.userAgent.indexOf("Publisher")!==-1)n.set("isFontLoaded",!0,!0);else if(document.fonts&&document.fonts.check&&navigator.onLine&&(n.userAgentInfo.browser.chrome||n.userAgentInfo.browser.firefox)){var o=0,r=function a(){setTimeout(function(){try{var t=document.fonts.check(i["font-weight-normal"]+" 16px "+i["font-family"]),e=document.fonts.check(i["font-weight-bold"]+" 16px "+i["font-family"]);t&&e?n.set("isFontLoaded",!0,!0):o<=20?a():n.set("isFontLoaded",!0,!0)}catch(r){console.error("Font error: "+r.message)}},100,o++)};r()}else setTimeout(function(){n.set("isFontLoaded",!0,!0)},1e3)},e))},o.prototype.setParamToSkin=function(t,e){var i=this,n=function(t,e){if(i._editorScriptLoader){if(!y["default"].isUndefined(i._previousSkinModifiers)){for(var n=i._previousSkinModifiers.length,o=0;o0&&(s=o?o/2.5*(d/8):0,h=a.abs(t)+s,l=h/d),{destination:a.round(s),duration:l}};var s=t("transform");return e.extend(e,{hasTransform:s!==!1,hasPerspective:t("perspective")in i,hasTouch:"ontouchstart"in o,hasPointer:!(!o.PointerEvent&&!o.MSPointerEvent),hasTransition:t("transition")in i}),e.isBadAndroid=function(){var t=o.navigator.appVersion;if(/Android/.test(t)&&!/Chrome\/\d/.test(t)){var e=t.match(/Safari\/(\d+.\d)/);return!(e&&"object"==typeof e&&e.length>=2)||parseFloat(e[1])<535.19}return!1}(),e.extend(e.style={},{transform:s,transitionTimingFunction:t("transitionTimingFunction"),transitionDuration:t("transitionDuration"),transitionDelay:t("transitionDelay"),transformOrigin:t("transformOrigin")}),e.hasClass=function(t,e){var i=new RegExp("(^|\\s)"+e+"(\\s|$)");return i.test(t.className)},e.addClass=function(t,i){if(!e.hasClass(t,i)){var n=t.className.split(" ");n.push(i),t.className=n.join(" ")}},e.removeClass=function(t,i){if(e.hasClass(t,i)){var n=new RegExp("(^|\\s)"+i+"(\\s|$)","g");t.className=t.className.replace(n," ")}},e.offset=function(t){for(var e=-t.offsetLeft,i=-t.offsetTop;t=t.offsetParent;)e-=t.offsetLeft,i-=t.offsetTop;return{left:e,top:i}},e.preventDefaultException=function(t,e){for(var i in e)if(e[i].test(t[i]))return!0;return!1},e.extend(e.eventType={},{touchstart:1,touchmove:1,touchend:1,mousedown:2,mousemove:2,mouseup:2,pointerdown:3,pointermove:3,pointerup:3,MSPointerDown:3,MSPointerMove:3,MSPointerUp:3}),e.extend(e.ease={},{quadratic:{style:"cubic-bezier(0.25, 0.46, 0.45, 0.94)",fn:function(t){return t*(2-t)}},circular:{style:"cubic-bezier(0.1, 0.57, 0.1, 1)",fn:function(t){return a.sqrt(1- --t*t)}},back:{style:"cubic-bezier(0.175, 0.885, 0.32, 1.275)",fn:function(t){var e=4;return(t-=1)*t*((e+1)*t+e)+1}},bounce:{style:"",fn:function(t){return(t/=1)<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}},elastic:{style:"",fn:function(t){var e=.22,i=.4;return 0===t?0:1==t?1:i*a.pow(2,-10*t)*a.sin((t-e/4)*(2*a.PI)/e)+1}}}),e.tap=function(t,e){var i=r.createEvent("Event");i.initEvent(e,!0,!0),i.pageX=t.pageX,i.pageY=t.pageY,t.target.dispatchEvent(i)},e.click=function(t){var e,i=t.target;/(SELECT|INPUT|TEXTAREA)/i.test(i.tagName)||(e=r.createEvent("MouseEvents"),e.initMouseEvent("click",!0,!0,t.view,1,i.screenX,i.screenY,i.clientX,i.clientY,t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,0,null),e._constructed=!0,i.dispatchEvent(e))},e}();s.prototype={version:"5.2.0",_init:function(){this._initEvents(),(this.options.scrollbars||this.options.indicators)&&this._initIndicators(),this.options.mouseWheel&&this._initWheel(),this.options.snap&&this._initSnap(),this.options.keyBindings&&this._initKeys()},destroy:function(){this._initEvents(!0),clearTimeout(this.resizeTimeout),this.resizeTimeout=null,this._execEvent("destroy")},_transitionEnd:function(t){t.target==this.scroller&&this.isInTransition&&(this._transitionTime(),this.resetPosition(this.options.bounceTime)||(this.isInTransition=!1,this._execEvent("scrollEnd")))},_start:function(t){if(1!=u.eventType[t.type]){var e;if(e=t.which?t.button:t.button<2?0:4==t.button?1:2,0!==e)return}if(this.enabled&&(!this.initiated||u.eventType[t.type]===this.initiated)){!this.options.preventDefault||u.isBadAndroid||u.preventDefaultException(t.target,this.options.preventDefaultException)||t.preventDefault();var i,n=t.touches?t.touches[0]:t;this.initiated=u.eventType[t.type],this.moved=!1,this.distX=0,this.distY=0,this.directionX=0,this.directionY=0,this.directionLocked=0,this.startTime=u.getTime(),this.options.useTransition&&this.isInTransition?(this._transitionTime(),this.isInTransition=!1,i=this.getComputedPosition(),this._translate(a.round(i.x),a.round(i.y)),this._execEvent("scrollEnd")):!this.options.useTransition&&this.isAnimating&&(this.isAnimating=!1,this._execEvent("scrollEnd")),this.startX=this.x,this.startY=this.y,this.absStartX=this.x,this.absStartY=this.y,this.pointX=n.pageX,this.pointY=n.pageY,this._execEvent("beforeScrollStart")}},_move:function(t){if(this.enabled&&u.eventType[t.type]===this.initiated){this.options.preventDefault&&t.preventDefault();var e,i,n,o,r=t.touches?t.touches[0]:t,s=r.pageX-this.pointX,l=r.pageY-this.pointY,h=u.getTime();if(this.pointX=r.pageX,this.pointY=r.pageY,this.distX+=s,this.distY+=l,n=a.abs(this.distX),o=a.abs(this.distY),!(h-this.endTime>300&&n<10&&o<10)){if(this.directionLocked||this.options.freeScroll||(n>o+this.options.directionLockThreshold?this.directionLocked="h":o>=n+this.options.directionLockThreshold?this.directionLocked="v":this.directionLocked="n"),"h"==this.directionLocked){if("vertical"==this.options.eventPassthrough)t.preventDefault();else if("horizontal"==this.options.eventPassthrough)return void(this.initiated=!1);l=0}else if("v"==this.directionLocked){if("horizontal"==this.options.eventPassthrough)t.preventDefault();else if("vertical"==this.options.eventPassthrough)return void(this.initiated=!1);s=0}s=this.hasHorizontalScroll?s:0,l=this.hasVerticalScroll?l:0,e=this.x+s,i=this.y+l,(e>0||e0?0:this.maxScrollX),(i>0||i0?0:this.maxScrollY),this.directionX=s>0?-1:s<0?1:0,this.directionY=l>0?-1:l<0?1:0,this.moved||this._execEvent("scrollStart"),this.moved=!0,this._translate(e,i),h-this.startTime>300&&(this.startTime=h,this.startX=this.x,this.startY=this.y,1==this.options.probeType&&this._execEvent("scroll")),this.options.probeType>1&&this._execEvent("scroll")}}},_end:function(t){if(this.enabled&&u.eventType[t.type]===this.initiated){this.options.preventDefault&&!u.preventDefaultException(t.target,this.options.preventDefaultException)&&t.preventDefault();var e,i,n=(t.changedTouches?t.changedTouches[0]:t,u.getTime()-this.startTime),o=a.round(this.x),r=a.round(this.y),s=a.abs(o-this.startX),l=a.abs(r-this.startY),h=0,d="";if(this.isInTransition=0,this.initiated=0,this.endTime=u.getTime(),!this.resetPosition(this.options.bounceTime)){if(this.scrollTo(o,r),!this.moved)return this.options.tap&&u.tap(t,this.options.tap),this.options.click&&u.click(t),void this._execEvent("scrollCancel");if(this._events.flick&&n<200&&s<100&&l<100)return void this._execEvent("flick");if(this.options.momentum&&n<300&&(e=this.hasHorizontalScroll?u.momentum(this.x,this.startX,n,this.maxScrollX,this.options.bounce?this.wrapperWidth:0,this.options.deceleration):{destination:o,duration:0},i=this.hasVerticalScroll?u.momentum(this.y,this.startY,n,this.maxScrollY,this.options.bounce?this.wrapperHeight:0,this.options.deceleration):{destination:r,duration:0},o=e.destination,r=i.destination,h=a.max(e.duration,i.duration),this.isInTransition=1),this.options.snap){var c=this._nearestSnap(o,r);this.currentPage=c,h=this.options.snapSpeed||a.max(a.max(a.min(a.abs(o-c.x),1e3),a.min(a.abs(r-c.y),1e3)),300),o=c.x,r=c.y,this.directionX=0,this.directionY=0,d=this.options.bounceEasing}return o!=this.x||r!=this.y?((o>0||o0||r0?e=0:this.x0?i=0:this.y-1&&this._events[t].splice(i,1)}},_execEvent:function(t){if(this._events[t]){var e=0,i=this._events[t].length;if(i)for(;e0;var o=this.options.useTransition&&n.style;!i||o?(o&&(this._transitionTimingFunction(n.style),this._transitionTime(i)),this._translate(t,e)):this._animate(t,e,i,n.fn)},scrollToElement:function(t,e,i,n,o){if(t=t.nodeType?t:this.scroller.querySelector(t)){var r=u.offset(t);r.left-=this.wrapperOffset.left,r.top-=this.wrapperOffset.top,i===!0&&(i=a.round(t.offsetWidth/2-this.wrapper.offsetWidth/2)),n===!0&&(n=a.round(t.offsetHeight/2-this.wrapper.offsetHeight/2)),r.left-=i||0,r.top-=n||0,r.left=r.left>0?0:r.left0?0:r.top0?n--:e<0&&n++,i>0?o--:i<0&&o++,void this.goToPage(n,o);n=this.x+a.round(this.hasHorizontalScroll?e:0),o=this.y+a.round(this.hasVerticalScroll?i:0),this.directionX=e>0?-1:e<0?1:0,this.directionY=i>0?-1:i<0?1:0,n>0?n=0:n0?o=0:o1&&this._execEvent("scroll")}},_initSnap:function(){this.currentPage={},"string"==typeof this.options.snap&&(this.options.snap=this.scroller.querySelectorAll(this.options.snap)),this.on("refresh",function(){var t,e,i,n,o,r,s=0,l=0,h=0,d=this.options.snapStepX||this.wrapperWidth,u=this.options.snapStepY||this.wrapperHeight;if(this.pages=[],this.wrapperWidth&&this.wrapperHeight&&this.scrollerWidth&&this.scrollerHeight){if(this.options.snap===!0)for(i=a.round(d/2),n=a.round(u/2);h>-this.scrollerWidth;){for(this.pages[s]=[],t=0,o=0;o>-this.scrollerHeight;)this.pages[s][t]={x:a.max(h,this.maxScrollX),y:a.max(o,this.maxScrollY),width:d,height:u,cx:h-i,cy:o-n},o-=u,t++;h-=d,s++}else for(r=this.options.snap,t=r.length,e=-1;sthis.maxScrollX&&l++;this.goToPage(this.currentPage.pageX||0,this.currentPage.pageY||0,0),this.options.snapThreshold%1===0?(this.snapThresholdX=this.options.snapThreshold,this.snapThresholdY=this.options.snapThreshold):(this.snapThresholdX=a.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].width*this.options.snapThreshold),this.snapThresholdY=a.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].height*this.options.snapThreshold))}}),this.on("flick",function(){var t=this.options.snapSpeed||a.max(a.max(a.min(a.abs(this.x-this.startX),1e3),a.min(a.abs(this.y-this.startY),1e3)),300);this.goToPage(this.currentPage.pageX+this.directionX,this.currentPage.pageY+this.directionY,t)})},_nearestSnap:function(t,e){if(!this.pages.length)return{x:0,y:0,pageX:0,pageY:0};var i=0,n=this.pages.length,o=0;if(a.abs(t-this.absStartX)0?t=0:t0?e=0:e=this.pages[i][0].cx){t=this.pages[i][0].x;break}for(n=this.pages[i].length;o=this.pages[0][o].cy){e=this.pages[0][o].y;break}return i==this.currentPage.pageX&&(i+=this.directionX,i<0?i=0:i>=this.pages.length&&(i=this.pages.length-1),t=this.pages[i][0].x),o==this.currentPage.pageY&&(o+=this.directionY,o<0?o=0:o>=this.pages[0].length&&(o=this.pages[0].length-1),e=this.pages[0][o].y),{x:t,y:e,pageX:i,pageY:o}},goToPage:function(t,e,i,n){n=n||this.options.bounceEasing,t>=this.pages.length?t=this.pages.length-1:t<0&&(t=0),e>=this.pages[t].length?e=this.pages[t].length-1:e<0&&(e=0);var o=this.pages[t][e].x,r=this.pages[t][e].y;i=void 0===i?this.options.snapSpeed||a.max(a.max(a.min(a.abs(o-this.x),1e3),a.min(a.abs(r-this.y),1e3)),300):i,this.currentPage={x:o,y:r,pageX:t,pageY:e},this.scrollTo(o,r,i,n)},next:function(t,e){var i=this.currentPage.pageX,n=this.currentPage.pageY;i++,i>=this.pages.length&&this.hasVerticalScroll&&(i=0,n++),this.goToPage(i,n,t,e)},prev:function(t,e){var i=this.currentPage.pageX,n=this.currentPage.pageY;i--,i<0&&this.hasVerticalScroll&&(i=0,n--),this.goToPage(i,n,t,e)},_initKeys:function(t){var e,i={pageUp:33,pageDown:34,end:35,home:36,left:37,up:38,right:39,down:40};if("object"==typeof this.options.keyBindings)for(e in this.options.keyBindings)"string"==typeof this.options.keyBindings[e]&&(this.options.keyBindings[e]=this.options.keyBindings[e].toUpperCase().charCodeAt(0));else this.options.keyBindings={};for(e in i)this.options.keyBindings[e]=this.options.keyBindings[e]||i[e];u.addEvent(o,"keydown",this),this.on("destroy",function(){u.removeEvent(o,"keydown",this)})},_key:function(t){if(this.enabled){var e,i=this.options.snap,n=i?this.currentPage.pageX:this.x,o=i?this.currentPage.pageY:this.y,r=u.getTime(),s=this.keyTime||0,l=.25;switch(this.options.useTransition&&this.isInTransition&&(e=this.getComputedPosition(),this._translate(a.round(e.x),a.round(e.y)),this.isInTransition=!1),this.keyAcceleration=r-s<200?a.min(this.keyAcceleration+l,50):0,t.keyCode){case this.options.keyBindings.pageUp:this.hasHorizontalScroll&&!this.hasVerticalScroll?n+=i?1:this.wrapperWidth:o+=i?1:this.wrapperHeight;break;case this.options.keyBindings.pageDown:this.hasHorizontalScroll&&!this.hasVerticalScroll?n-=i?1:this.wrapperWidth:o-=i?1:this.wrapperHeight;break;case this.options.keyBindings.end:n=i?this.pages.length-1:this.maxScrollX,o=i?this.pages[0].length-1:this.maxScrollY;break;case this.options.keyBindings.home:n=0,o=0;break;case this.options.keyBindings.left:n+=i?-1:5+this.keyAcceleration>>0;break;case this.options.keyBindings.up:o+=i?1:5+this.keyAcceleration>>0;break;case this.options.keyBindings.right:n-=i?-1:5+this.keyAcceleration>>0;break;case this.options.keyBindings.down:o-=i?1:5+this.keyAcceleration>>0;break;default:return}if(i)return void this.goToPage(n,o);n>0?(n=0,this.keyAcceleration=0):n0?(o=0,this.keyAcceleration=0):o=h?(r.isAnimating=!1,r._translate(t,e),void(r.resetPosition(r.options.bounceTime)||r._execEvent("scrollEnd"))):(g=(g-l)/i,f=n(g),c=(t-a)*f+a,p=(e-s)*f+s,r._translate(c,p),r.isAnimating&&d(o),void(3==r.options.probeType&&r._execEvent("scroll")))}var r=this,a=this.x,s=this.y,l=u.getTime(),h=l+i;this.isAnimating=!0,o()},handleEvent:function(t){switch(t.type){case"touchstart":case"pointerdown":case"MSPointerDown":case"mousedown":this._start(t);break;case"touchmove":case"pointermove":case"MSPointerMove":case"mousemove":this._move(t);break;case"touchend":case"pointerup":case"MSPointerUp":case"mouseup":case"touchcancel":case"pointercancel":case"MSPointerCancel":case"mousecancel":this._end(t);break;case"orientationchange":case"resize":this._resize();break;case"transitionend":case"webkitTransitionEnd":case"oTransitionEnd":case"MSTransitionEnd":this._transitionEnd(t);break;case"wheel":case"DOMMouseScroll":case"mousewheel":this._wheel(t);break;case"keydown":this._key(t);break;case"click":this.enabled&&!t._constructed&&(t.preventDefault(),t.stopPropagation())}}},h.prototype={handleEvent:function(t){switch(t.type){case"touchstart":case"pointerdown":case"MSPointerDown":case"mousedown":this._start(t);break;case"touchmove":case"pointermove":case"MSPointerMove":case"mousemove":this._move(t);break;case"touchend":case"pointerup":case"MSPointerUp":case"mouseup":case"touchcancel":case"pointercancel":case"MSPointerCancel":case"mousecancel":this._end(t)}},destroy:function(){this.options.fadeScrollbars&&(clearTimeout(this.fadeTimeout),this.fadeTimeout=null),this.options.interactive&&(u.removeEvent(this.indicator,"touchstart",this),u.removeEvent(this.indicator,u.prefixPointerEvent("pointerdown"),this),u.removeEvent(this.indicator,"mousedown",this),u.removeEvent(o,"touchmove",this),u.removeEvent(o,u.prefixPointerEvent("pointermove"),this),u.removeEvent(o,"mousemove",this),u.removeEvent(o,"touchend",this),u.removeEvent(o,u.prefixPointerEvent("pointerup"),this),u.removeEvent(o,"mouseup",this)),this.options.defaultScrollbars&&this.wrapper.parentNode.removeChild(this.wrapper)},_start:function(t){var e=t.touches?t.touches[0]:t;t.preventDefault(),t.stopPropagation(),this.transitionTime(),this.initiated=!0,this.moved=!1,this.lastPointX=e.pageX,this.lastPointY=e.pageY,this.startTime=u.getTime(),this.options.disableTouch||u.addEvent(o,"touchmove",this),this.options.disablePointer||u.addEvent(o,u.prefixPointerEvent("pointermove"),this),this.options.disableMouse||u.addEvent(o,"mousemove",this),this.scroller._execEvent("beforeScrollStart")},_move:function(t){var e,i,n,o,r=t.touches?t.touches[0]:t,a=u.getTime();this.moved||this.scroller._execEvent("scrollStart"),this.moved=!0,e=r.pageX-this.lastPointX,this.lastPointX=r.pageX,i=r.pageY-this.lastPointY,this.lastPointY=r.pageY,n=this.x+e,o=this.y+i,this._pos(n,o),1==this.scroller.options.probeType&&a-this.startTime>300?(this.startTime=a,this.scroller._execEvent("scroll")):this.scroller.options.probeType>1&&this.scroller._execEvent("scroll"),t.preventDefault(),t.stopPropagation()},_end:function(t){if(this.initiated){if(this.initiated=!1,t.preventDefault(),t.stopPropagation(),u.removeEvent(o,"touchmove",this),u.removeEvent(o,u.prefixPointerEvent("pointermove"),this),u.removeEvent(o,"mousemove",this),this.scroller.options.snap){var e=this.scroller._nearestSnap(this.scroller.x,this.scroller.y),i=this.options.snapSpeed||a.max(a.max(a.min(a.abs(this.scroller.x-e.x),1e3),a.min(a.abs(this.scroller.y-e.y),1e3)),300);this.scroller.x==e.x&&this.scroller.y==e.y||(this.scroller.directionX=0,this.scroller.directionY=0,this.scroller.currentPage=e,this.scroller.scrollTo(e.x,e.y,i,this.scroller.options.bounceEasing))}this.moved&&this.scroller._execEvent("scrollEnd")}},transitionTime:function(t){t=t||0;var e=u.style.transitionDuration;if(this.indicatorStyle[e]=t+"ms",!t&&u.isBadAndroid){this.indicatorStyle[e]="0.0001ms";var i=this;d(function(){"0.0001ms"===i.indicatorStyle[e]&&(i.indicatorStyle[e]="0s")})}},transitionTimingFunction:function(t){this.indicatorStyle[u.style.transitionTimingFunction]=t},refresh:function(){this.transitionTime(),this.options.listenX&&!this.options.listenY?this.indicatorStyle.display=this.scroller.hasHorizontalScroll?"block":"none":this.options.listenY&&!this.options.listenX?this.indicatorStyle.display=this.scroller.hasVerticalScroll?"block":"none":this.indicatorStyle.display=this.scroller.hasHorizontalScroll||this.scroller.hasVerticalScroll?"block":"none",this.scroller.hasHorizontalScroll&&this.scroller.hasVerticalScroll?(u.addClass(this.wrapper,"iScrollBothScrollbars"),u.removeClass(this.wrapper,"iScrollLoneScrollbar"),this.options.defaultScrollbars&&this.options.customStyle&&(this.options.listenX?this.wrapper.style.right="8px":this.wrapper.style.bottom="8px")):(u.removeClass(this.wrapper,"iScrollBothScrollbars"),u.addClass(this.wrapper,"iScrollLoneScrollbar"),this.options.defaultScrollbars&&this.options.customStyle&&(this.options.listenX?this.wrapper.style.right="2px":this.wrapper.style.bottom="2px"));this.wrapper.offsetHeight;this.options.listenX&&(this.wrapperWidth=this.wrapper.clientWidth,this.options.resize?(this.indicatorWidth=a.max(a.round(this.wrapperWidth*this.wrapperWidth/(this.scroller.scrollerWidth||this.wrapperWidth||1)),8),this.indicatorStyle.width=this.indicatorWidth+"px"):this.indicatorWidth=this.indicator.clientWidth,this.maxPosX=this.wrapperWidth-this.indicatorWidth,"clip"==this.options.shrink?(this.minBoundaryX=-this.indicatorWidth+8,this.maxBoundaryX=this.wrapperWidth-8):(this.minBoundaryX=0,this.maxBoundaryX=this.maxPosX),this.sizeRatioX=this.options.speedRatioX||this.scroller.maxScrollX&&this.maxPosX/this.scroller.maxScrollX),this.options.listenY&&(this.wrapperHeight=this.wrapper.clientHeight,this.options.resize?(this.indicatorHeight=a.max(a.round(this.wrapperHeight*this.wrapperHeight/(this.scroller.scrollerHeight||this.wrapperHeight||1)),8),this.indicatorStyle.height=this.indicatorHeight+"px"):this.indicatorHeight=this.indicator.clientHeight,this.maxPosY=this.wrapperHeight-this.indicatorHeight,"clip"==this.options.shrink?(this.minBoundaryY=-this.indicatorHeight+8,this.maxBoundaryY=this.wrapperHeight-8):(this.minBoundaryY=0,this.maxBoundaryY=this.maxPosY),this.maxPosY=this.wrapperHeight-this.indicatorHeight,this.sizeRatioY=this.options.speedRatioY||this.scroller.maxScrollY&&this.maxPosY/this.scroller.maxScrollY),this.updatePosition(); },updatePosition:function(){var t=this.options.listenX&&a.round(this.sizeRatioX*this.scroller.x)||0,e=this.options.listenY&&a.round(this.sizeRatioY*this.scroller.y)||0;this.options.ignoreBoundaries||(tthis.maxBoundaryX?"scale"==this.options.shrink?(this.width=a.max(this.indicatorWidth-(t-this.maxPosX),8),this.indicatorStyle.width=this.width+"px",t=this.maxPosX+this.indicatorWidth-this.width):t=this.maxBoundaryX:"scale"==this.options.shrink&&this.width!=this.indicatorWidth&&(this.width=this.indicatorWidth,this.indicatorStyle.width=this.width+"px"),ethis.maxBoundaryY?"scale"==this.options.shrink?(this.height=a.max(this.indicatorHeight-3*(e-this.maxPosY),8),this.indicatorStyle.height=this.height+"px",e=this.maxPosY+this.indicatorHeight-this.height):e=this.maxBoundaryY:"scale"==this.options.shrink&&this.height!=this.indicatorHeight&&(this.height=this.indicatorHeight,this.indicatorStyle.height=this.height+"px")),this.x=t,this.y=e,this.scroller.options.useTransform?this.indicatorStyle[u.style.transform]="translate("+t+"px,"+e+"px)"+this.scroller.translateZ:(this.indicatorStyle.left=t+"px",this.indicatorStyle.top=e+"px")},_pos:function(t,e){t<0?t=0:t>this.maxPosX&&(t=this.maxPosX),e<0?e=0:e>this.maxPosY&&(e=this.maxPosY),t=this.options.listenX?a.round(t/this.sizeRatioX):this.scroller.x,e=this.options.listenY?a.round(e/this.sizeRatioY):this.scroller.y,this.scroller.scrollTo(t,e)},fade:function(t,e){if(!e||this.visible){clearTimeout(this.fadeTimeout),this.fadeTimeout=null;var i=t?250:500,n=t?0:300;t=t?"1":"0",this.wrapperStyle[u.style.transitionDuration]=i+"ms",this.fadeTimeout=setTimeout(function(t){this.wrapperStyle.opacity=t,this.visible=+t}.bind(this,t),n)}}},s.utils=u,"undefined"!=typeof t&&t.exports?t.exports=s:(n=function(){return s}.call(e,i,e,t),!(void 0!==n&&(t.exports=n)))}(window,document,Math)},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t){this.id=t,this.index={};var e=this.getPageKey("~index"),i=(0,d["default"])().getLocalStorage().getItem(e);this.pages=i?JSON.parse(i):{}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=n(r),s=i(1),l=n(s),h=i(5),d=n(h);o.prototype=new l["default"],o.prototype.constructor=o,o.prototype.getColorKey=function(){return this.id+"~color"},o.prototype.getPageKey=function(t){return this.id+"~page"+t},o.prototype.getPageData=function(t){var e=this.getPageKey(t);if(!this.index.hasOwnProperty(e)){var i=(0,d["default"])().getLocalStorage().getItem(e);this.index[e]=i?JSON.parse(i):{notes:[],lastId:0}}return this.index[e]},o.prototype.add=function(t,e){if(!a["default"].isUndefined(t)){var i=this.getPageData(t),n=i.notes;return n.push(Object.assign(e,{id:++i.lastId})),this._save(t),this.trigger(o.ADD_EVENT,{pageId:t,note:e}),Object.assign({},n[n.length-1])}},o.prototype.change=function(t,e){var i=this.getPageData(t),n=a["default"].findIndex(i.notes,function(t){return t.id===e.id});if(n>=0){var r=i.notes;if(!a["default"].isMatch(r[n],e))return r[n]=Object.assign(r[n],e),this._save(t),this.trigger(o.CHANGE_EVENT,{pageId:t,note:e}),!0}return!1},o.prototype.setDefaultColor=function(t){var e=this.getColorKey();(0,d["default"])().getLocalStorage().setItem(e,t)},o.prototype.getDefaultColor=function(){var t=this.getColorKey();return(0,d["default"])().getLocalStorage().getItem(t)},o.prototype._save=function(t){var e=this.getPageKey(t),i=JSON.stringify(this.index[e]);(0,d["default"])().getLocalStorage().setItem(e,i),this.index[e].notes.length?this.pages[t]="1":delete this.pages[t],(0,d["default"])().getLocalStorage().setItem(this.getPageKey("~index"),JSON.stringify(this.pages))},o.prototype.remove=function(t,e){var i=this.getPageData(t),n=a["default"].findIndex(i.notes,function(t){return t.id===e.id});return n>=0&&(i.notes.splice(n,1),this._save(t),this.trigger(o.REMOVE_EVENT,{pageId:t,note:e}),!0)},o.prototype.getPageIds=function(){var t=[];for(var e in this.pages)t.push(e);return t},o.prototype.getNotesOnPage=function(t){return this.getPageData(t).notes},o.CHANGE_EVENT="CHANGE_EVENT",o.ADD_EVENT="ADD_EVENT",o.REMOVE_EVENT="REMOVE_EVENT",e["default"]=o},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t,e,i,n){var o=this;this.noteData=t.noteData,this.pageModel=e,t.props.cast("links"),this.shadowDepth=this.pageModel.getProperty("shadowDepth"),this.listenTo(this.pageModel.model,"change:shadowDepth",function(t){this.set("shadowDepth",t)}),this.defaultLinksProps=t.props.links,this.pageFlippingDuration=t.props.pageFlippingDuration,this.highQuality=i,this.pageType=n||(e.getProperty("wide")?"wide":"single"),this._bookModel=t,this._isReadyChanged=function(t){o.trigger("isReady",t)},this.listenTo(this._bookModel,"change:isReady",this._isReadyChanged),this._isSearchActiveChanged=function(t){o.trigger("isSearchActive",t)},this.listenTo(this._bookModel,"change:isSearchActive",this._isSearchActiveChanged),this._searchQueryChanged=function(t){o.trigger("change:searchQuery",t)},this.listenTo(this._bookModel,"change:searchQuery",this._searchQueryChanged),this._fillChanged=function(){o.trigger("change:fillChanged")},this._contentChanged=function(){o.trigger("change:pageContent")},this._backgroundChanged=function(){o.trigger("change:pageBackground")},this._textLayerChanged=function(){o.trigger("change:textLayer")},this.listenTo(this.pageModel.getPropertyModel(),"change:videos change:links change:images",this._contentChanged),this.listenTo(this.pageModel.getPropertyModel(),"change:pageResize",this._fillChanged),this.listenTo(this.pageModel.getPropertyModel(),"change:backgroundColor",this._backgroundChanged),this.listenTo(this.pageModel.getPropertyModel(),"change:textLayer",this._textLayerChanged),this.listenTo(this.getDefaultLinkProps(),"all",this._contentChanged)}Object.defineProperty(e,"__esModule",{value:!0});var r=i(1),a=n(r),s=i(0),l=n(s),h=i(3),d=n(h),u=window.FBPublication.PageResourceType;o.prototype=new a["default"],o.prototype.constructor=o,o.prototype.isReady=function(){return this._bookModel.isReady},o.prototype.getPageId=function(){return this.getPageModel().id},o.prototype.getPageModel=function(){return this.pageModel},o.prototype.getPageContent=function(){var t=this,e=[],i=t.getMode().indexOf("wide")!==-1;this.maxZIndex=0;var n=function(n,o){l["default"].each(l["default"].sortBy(t.pageModel.getProperty(n),"zIndex").reverse(),function(n){if(n.zIndex&&n.zIndex>t.maxZIndex&&(t.maxZIndex=n.zIndex),i){var r=t.getPageSize().width/2;switch(t.getMode()){case"wideRight":if(n.x+n.width<=r)return;break;case"wideLeft":if(n.x>=r)return}}e.push({type:o,data:n})})};return n("links","link"),n("videos","video"),n("images","image"),n("gifs","gif"),l["default"].each(this.noteData.getNotesOnPage(this.getPageId()),function(n){if(i)switch(t.getMode()){case"wideRight":if(n.pX<=t.pageModel.bookSize.width)return;break;case"wideLeft":if(n.pX>t.pageModel.bookSize.width)return}e.push({type:"note",data:{note:n}})}),e},o.prototype.getMode=function(){return this.pageType},o.prototype.isSearchActive=function(){return this._bookModel.isSearchActive},o.prototype.getSearchCharactersLimit=function(){return this._bookModel.searchCharactersLimit},o.prototype.getSearchQuery=function(){return this._bookModel.searchQuery},o.prototype.getPageSize=function(){return{width:this.pageModel.getProperty("width"),height:this.pageModel.getProperty("height")}},o.prototype.getDefaultLinkProps=function(){return this.defaultLinksProps},o.prototype.getPageFlippingDuration=function(){return 1e3*this.pageFlippingDuration},o.prototype.getImageSizes=function(t){var e=this.pageModel.getProperty("substrateSizes"),i={};if(e){var n=parseInt(this.pageModel.getProperty("substrateSizesReady"),10),o=this.pageModel.getProperty("customSubstrateSize"),r=this.pageModel.getProperty("textSizes");0===n&&(n=4);var a=e.slice(0,n),s=void 0,h=void 0,d=void 0;o&&(a=a.slice(0,a.length-1),a.push(parseInt(o,10))),d=Math.max(t.width,t.height),s=l["default"].findIndex(a,function(t){return t>=d||t===a[a.length-1]}),h=l["default"].findIndex(r,function(t){return t>=d||t===r[r.length-1]}),i.substrate=s+1,i.text=h+1}else this.highQuality?(i.substrate="l",i.text="l1"):(i.substrate="",i.text="c");return i},o.prototype.getBackgroundImages=function(t){var e=(0,d["default"])().get(d["default"].LOAD_MANAGER),i=this.getImageSizes(t),n=this.isSVGSupported();return l["default"].filter([e.getPageLoader(this.getPageId(),u.PAGE_SUBSTRATE,i.substrate),n?e.getPageLoader(this.getPageId(),u.SVG):null,n?null:e.getPageLoader(this.getPageId(),u.PAGE_TEXT,i.text)],function(t){return t})},o.prototype.isSVGSupported=function(){return!this.pageModel.getProperty("rasterize")&&((!this.pageModel.getProperty("rtlContent")||!this._bookModel.browser.msedge)&&(!!this.pageModel.getProperty("vectorText")&&(!this._bookModel.browser.ie||"11.0"!==this._bookModel.browser.version)))},o.prototype.getPreloaderImage=function(){var t=(0,d["default"])().get(d["default"].LOAD_MANAGER);return t.getPageLoader(this.getPageId(),u.THUMBNAIL)},o.prototype.getBackgroundColor=function(){return this.pageModel.getProperty("backgroundColor")},o.prototype.getPageTable=function(){return this._bookModel.getPageTable()},o.prototype.isRight=function(){var t=this.getPageNumber()%2===0;return this._bookModel.getPager().isRtl()&&(t=!t),t},o.prototype.isLeft=function(){return!this.isRight()},o.prototype.getPageNumber=function(){return this.getPageTable().getPageIndexById(this.getPageId())},o.prototype.getPageUrlHeader=function(){return this.getPageTable().getUrlHeaderById(this.getPageId())},o.prototype.getFillMode=function(){if("FILL"===this.getPageModel().getProperty("pageResize")){var t=this.getPageModel().getProperty("width");t/=this.getPageModel().getProperty("wide")?2:1;var e=this.getPageModel().getProperty("height"),i=this._bookModel.getProps().bookSize.width,n=this._bookModel.getProps().bookSize.height;return t/e=R.LoaderState.LOADED?this.view.setPreloaderImage(this.preloaderImageLoader.getLoadedData()):i=R.LoaderState.READY?e.view.setState(l["default"].STATES.LOADING):n=R.LoaderState.READY&&e=R.LoaderState.LOADED?r():e=i&&(n=!0)}switch(t.type){case"link":e=new d["default"](new y["default"](M["default"].mergeObjects(this.model.getDefaultLinkProps(),t.data),{pageNumber:this.model.getPageNumber(),pageTable:this.model.getPageTable(),crossWide:n,id:this.pageContentPresenters.length,isZoomed:this.isZoomed}),this).init();break;case"video":switch(e=new w["default"](new P["default"](t.data,{browser:this.model._bookModel.browser,pageId:this.model.getPageId(),crossWide:n,id:t.data.zIndex},this.model.getDefaultLinkProps())).init(),e.state){case R.LoaderState.LOADING:this.set("contentLoadCounter",this.contentLoadCounter+1),e.on("change:state",function(){this.set("contentLoadCounter",this.contentLoadCounter-1)},this)}break;case"image":e=new E["default"](new x["default"](M["default"].mergeObjects(t.data,{pageId:this.model.getPageId(),browser:this.model._bookModel.browser,crossWide:n,id:this.pageContentPresenters.length,isZoomed:this.isZoomed}),this.model.getDefaultLinkProps())).init();break;case"gif":switch(e=new k["default"](new I["default"](M["default"].mergeObjects(t.data,{pageId:this.model.getPageId(),browser:this.model._bookModel.browser,crossWide:n,id:this.pageContentPresenters.length,isZoomed:this.isZoomed}),this.model.getDefaultLinkProps())).init(),e.state){case R.LoaderState.LOADING:this.set("contentLoadCounter",this.contentLoadCounter+1),e.on("change:state",function(){this.set("contentLoadCounter",this.contentLoadCounter-1)},this)}break;case"note":e=new c["default"](new f["default"](t.data.note,this.model.noteData,{pageId:this.model.getPageId(),pageTable:this.model.getPageTable(),isRight:this.isRight(),isZoomed:this.isZoomed,zIndex:++this.model.maxZIndex,bookSize:this.getBookSize(),isWide:this.isWide()}))}return this.initPresenter(e)},o.prototype.isRight=function(){return"single"===this.model.getMode()?this.model.isRight():"wideRight"===this.model.getMode()},o.prototype.initPresenter=function(t){var e=this,i=function(){"wideRight"===e.model.getMode()&&t.offset(-e._pageWidth),t.constructor!==c["default"]||"wideRight"!==e.model.getMode()&&"wideLeft"!==e.model.getMode()||t.setOffsetForChangePage(-e._pageWidth),t.scale(e._scale,e.currentSize),t.commit(),e.isZoomed&&setTimeout(function(){t.commit()},0)};return this.on("change:currentSize",function(){i()}),i(),t.isActive=this.isActive,this.on("change:isActive",function(e){t.set("isActive",e)}),this.pageContentPresenters.push(t),t.getView()},o.prototype.getLibraryManager=function(){return(0,D["default"])().get(D["default"].LIBRARY_MANAGER)},o.prototype._generateSearchHighlights=function(){var t=this,e=this.model.getPageModel();if(e.isStub()!==!0){var i;this.getLibraryManager().loaded("search")?(i=this.getLibraryManager().getExports("search").HighlighterModel,this.highlightModel=new i(e,this.model.getSearchCharactersLimit())):this.getLibraryManager().on("library:search",function(t){i=t.exports.HighlighterModel,this.highlightModel=new i(e,this.model.getSearchCharactersLimit())},this),this.model.isSearchActive()&&this._loadSearchHighlights(),this.model.on("isSearchActive change:searchQuery",N["default"].bind(this._onSearch,this)),this.on("change:currentSize",function(){t.model.isSearchActive()&&t._highlightResize()})}},o.prototype._highlightResize=function(){if(this.highlightPresenter){var t=this.currentSize,e=this.model.getPageSize();switch(this.model.getMode()){case"wideRight":case"wideLeft":e.width/=2}var i=M["default"].fitScreenSizes(e.width,e.height,t.width,t.height),n=i.width/e.width;"wideRight"===this.model.getMode()&&this.highlightPresenter.offset(-e.width),this.highlightPresenter.scale(n)}},o.prototype._onSearch=function(t){this.model.isSearchActive&&(this.view.clearSearchView(),t&&this._loadSearchHighlights())},o.prototype._loadSearchHighlights=function(){var t=this;this.highlightPresenter&&this.highlightPresenter.cancelAllRequests();var e,i=function(){t.highlightPresenter=new e(t.highlightModel),t.highlightPresenter.getSearchHighlightViews(t.model.getSearchQuery(),function(e,i){!e&&i&&i.length&&(t.view.addSearchViews(i),t._highlightResize())})};this.getLibraryManager().loaded("search")?(e=this.getLibraryManager().getExports("search").HighlighterPresenter,i()):this.getLibraryManager().on("library:search",function(t){e=t.exports.HighlighterPresenter,i()})},o.prototype.getViewElement=function(){return this.view.getDOMElement()},o.prototype.updateScale=function(t){var e=this.model.getPageSize();switch(this.model.getMode()){case"wideRight":case"wideLeft":e.width/=2}var i=M["default"].fitScreenSizes(e.width,e.height,t.width,t.height);this._pageWidth=e.width,this._scale=i.width/e.width},o.prototype.resize=function(t){this.updateScale(t),this.set("currentSize",t),this.view.resize(t)},o.prototype.requestNavigation=function(t,e){this.trigger("requestNavigation",{type:t,data:e})},o.prototype.setActive=function(t){var e=this;if(this.realIsActive=t,t)if(e.view.state===l["default"].STATES.LOADED)N["default"].delay(function(){e.realIsActive&&e.set("isActive",!0)},500);else{var i=0,n=function(){i--,0===i&&N["default"].delay(function(){e.realIsActive&&e.set("isActive",!0)},500)};N["default"].each(this.pageResources,function(t){var e=t.getState();eo.getPageIndexById(e.leftPage)?!this.model.getPager().isRtl():this.model.getPager().isRtl(),this.view.goToPage(t.leftPage,n)}}},o.prototype.pre_destroy=function(){this.stopListening(this.model,"change:zoomScaleValue",this._onZoomScaleValueChanged),this.stopListening(this.model,"change:zoomChangeAnimation",this._changeAnimationType),this.view.off("zoom",this._onViewZoomChanged)},o.prototype.destroy=function(){y["default"].each(this.contentPresenters,function(t){t.destroy()}),a["default"].prototype.destroy.call(this)},o.prototype.getViewContainer=function(){return this.view.getContainer()},o.prototype.onPageActivate=function(t){var e=this;a["default"].prototype.onPageActivate.call(this,t),y["default"].has(this.contentPresenters,t)||this.getContentForPage(void 0,t),this.model.isReady?this.contentPresenters[t].setActive(!0):this.model.on("change:isReady",function(i){i&&e.contentPresenters[t].setActive(!0)})},o.prototype.onPageDeactivate=function(t){y["default"].has(this.contentPresenters,t)&&this.contentPresenters[t].setActive(!1)},o.prototype.setZoomValue=function(t,e,i,n){this.view.setZoomValue(t,e,i,n)},o.prototype.getDataForTransitionStart=function(){return this.view.getCurrentWrappers()},e["default"]=o},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(){}Object.defineProperty(e,"__esModule",{value:!0});var r=i(1),a=n(r);o.prototype=new a["default"],o.prototype.constructor=o,o.prototype.start=function(){},o.prototype.clear=function(){},e["default"]=o},,function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t,e,i){this.leftPage=t,this.rightPage=e,this.zoomMode=i}function r(t){this.pageTable=new u["default"](t),this._model=t,this.state=new o((void 0),this.pageTable.getPageIdByIndex(0),(!1)),this.totalPages=this.pageTable.getPagesCount(),this.isTotalCustom=!1,s["default"].has(t,"customTotalPages")&&(this.totalPages=t.customTotalPages,this.isTotalCustom=!0),this.target=null,this.rtl=t.rightToLeft,this._model.on("change:rightToLeft",function(t){this.set("rtl",t)},this)}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=e.PagerState=void 0;var a=i(0),s=n(a),l=i(1),h=n(l),d=i(33),u=n(d);o.prototype.isEqualTo=function(t){return s["default"].isEqual(this,t)},r.prototype=new h["default"],r.prototype.constructor=r,r.prototype.getState=function(){return this.state},r.prototype.goToPageById=function(t,e,i){var n=this._getStateByPageIdAndZoomMode(t,this.state.zoomMode);return!!this._canChangeStateTo(n)&&(!!this.state.isEqualTo(n)||(this.target=e||null,this.initiator=i,this.set("state",n),!0))},r.prototype.goToPageByIndex=function(t,e,i){if(t<0||t>=this.pageTable.getPagesCount())return!1;var n=this.pageTable.getPageIdByIndex(t);return(!s["default"].isUndefined(n)||(n=this.pageTable.getPageIdByIndex(t-1),!s["default"].isUndefined(n)))&&this.goToPageById(n,e,i)},r.prototype.setZoomMode=function(t,e,i){var n,o;return n=e?s["default"].isUndefined(this.state.rightPage)?this.state.leftPage:this.state.rightPage:s["default"].isUndefined(this.state.leftPage)?this.state.rightPage:this.state.leftPage,o=this._getStateByPageIdAndZoomMode(n,t),!!this._canChangeStateTo(o)&&(!!this.state.isEqualTo(o)||(this.target=i||null,this.set("state",o),!0))},r.prototype._canChangeStateTo=function(t){return!s["default"].isUndefined(t)&&(s["default"].isNull(this._isFreezedBy)||s["default"].isUndefined(this._isFreezedBy))},r.prototype._getStateByPageIdAndZoomMode=function(t,e){if(this.pageTable.hasPageWithId(t)){if(e)return new o(t,(void 0),(!0));var i=this.pageTable.getPageIndexById(t);return i%2!==0?new o(t,this.pageTable.getPageIdByIndex(i+1),(!1)):new o(this.pageTable.getPageIdByIndex(i-1),t,(!1))}},r.prototype.trigger=function(t){"change:state"!==t||s["default"].isNull(this.target)?h["default"].prototype.trigger.apply(this,arguments):(h["default"].prototype.trigger.apply(this,s["default"].union(arguments,[this.target])),this.target=null)},r.prototype.goToFirst=function(t){var e=this.pageTable.getUrlHeaderById(this.state.leftPage||this.state.rightPage);return!!this.goToPageByIndex(0,void 0,t)&&(this.trigger("goToFirstPage",{pageUrl:e}),!0)},r.prototype.goToLast=function(t){var e=this.pageTable.getUrlHeaderById(this.state.leftPage||this.state.rightPage);return!!this.goToPageByIndex(this.pageTable.getPagesCount()-1,t)&&(this.trigger("goToFirstPage",{pageUrl:e}),!0)},r.prototype.goBackward=function(t){var e=this.getPrevPageId();if(e)return this.goToPageById(e,void 0,t)},r.prototype.goForward=function(t){var e=this.getNextPageId();if(e)return this.goToPageById(e,void 0,t)},r.prototype.getNextPageId=function(){var t=s["default"].filter(this.pageTable.getStructure(),function(t){return!s["default"].isNull(t)}),e=this.state.rightPage?this.state.rightPage:this.state.leftPage,i=s["default"].indexOf(t,e);return i0?t[i-1]:null},r.prototype.toggleZoomMode=function(){return this.setZoomMode(!this.state.zoomMode,!1)},r.prototype.getStateForDisplay=function(t){var e=null,i=null;return t.leftPage===t.rightPage?this.pageTable.getPageCaptionById(t.leftPage):(s["default"].isUndefined(t.leftPage)||(e=this.pageTable.getPageCaptionById(t.leftPage)),s["default"].isUndefined(t.rightPage)||(i=this.pageTable.getPageCaptionById(t.rightPage)),this.isRtl()?s["default"].isNull(i)?s["default"].isNull(e)?"":e:i+(s["default"].isNull(e)?"":" - "+e):s["default"].isNull(e)?s["default"].isNull(i)?"":i:e+(s["default"].isNull(i)?"":" - "+i))},r.prototype.isFirstPage=function(t){var e,i,t=t||this.getState();return t.leftPage&&(e=this.pageTable.isFirstPage(t.leftPage)),t.rightPage&&(i=this.pageTable.isFirstPage(t.rightPage)),e||i},r.prototype.isLastPage=function(t){var e,i,t=t||this.getState();return t.leftPage&&(e=this.pageTable.isLastPage(t.leftPage)),t.rightPage&&(i=this.pageTable.isLastPage(t.rightPage)),e||i},r.prototype.isRtl=function(){return!s["default"].isUndefined(this._model.rightToLeft)&&this._model.rightToLeft},r.prototype.isHardcover=function(){return!s["default"].isUndefined(this._model.hardcover)&&this._model.hardcover},r.prototype.freeze=function(t){this._isFreezedBy||(this._isFreezedBy=t,"api"===t&&this.trigger("freezed"))},r.prototype.unfreeze=function(t){this._isFreezedBy&&this._isFreezedBy===t&&(this._isFreezedBy=null,"api"===t&&this.trigger("unfreezed"))},r.prototype.isFreezed=function(){return!!this._isFreezedBy},r.prototype.isFreezedBy=function(t){return this.isFreezed()&&this._isFreezedBy===t},e.PagerState=o,e["default"]=r},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t){this.model=t,this.numerationOffset=t.numerationOffset}Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=n(r),s=i(34),l=n(s),h=i(4),d=n(h);o.prototype.getPageModel=function(t){if(this.hasPageWithId(t)){if(a["default"].isUndefined(this.pageModelsCache)){var e=this;this.pageModelsCache=a["default"].memoize(function(t){return e.model.cast("pages."+t),new l["default"](t,e.model.pages[t],e.model.pages.defaults,e.model.bookSize)})}return this.pageModelsCache(t)}},o.prototype.getPageIdByIndex=function(t){if(!(t>=this.getPagesCount()||t<0)){var e=this.getStructure()[t];return a["default"].isNull(e)?this.getPageIdByIndex(t-1):e}},o.prototype.getStructure=function(){return this.model.pages.structure},o.prototype.getNumerationOffset=function(){return this.model.numerationOffset},o.prototype.getPageIndexById=function(t){var e=a["default"].indexOf(this.getStructure(),t);return a["default"].isUndefined(e)?-1:e},o.prototype.getUrlHeaderById=function(t){var e=this.getPageModel(t);if(!a["default"].isUndefined(e)){var i=e.getUrlHeader();return a["default"].isUndefined(i)?this._calculateCaptionById(t,"-"):i}},o.prototype.getPageCaptionById=function(t){var e=this.getPageModel(t);if(!a["default"].isUndefined(e)){var i=e.getCaption();return a["default"].isUndefined(i)?this._calculateCaptionById(t," - "):i}},o.prototype._calculateCaptionById=function(t,e){var i=this,n=this.getPageModel(t),o=this.getPageIndexById(t),r=n.getProperty("wide");if(!a["default"].isUndefined(this.getNumerationOffset())){var s=function(t){return t'+i+"";e=this.getLocaleProvider().get("Other.CUSTOM_POLICY_TEXT",{0:n})}else e=this.getLocaleProvider().get("Other.COOKIE_POLICY_NOTICE");var o=h["default"].id("banner-notice");if(o){var r=h["default"].id("notice-text");r.innerHTML=e}else{o=h["default"].createElement("div",{"class":"banner-notice",id:"banner-notice"},this.bodyContainer);var a=h["default"].createElement("div",{"class":"notice-text",id:"notice-text"},o),s=h["default"].createElement("div",{"class":"icon icon-cancel close-button"},o);a.innerHTML=e,new v["default"](s,{}).on("tap",function(){t.properties.cookieNotice.onClose&&"function"==typeof t.properties.cookieNotice.onClose?t.properties.cookieNotice.onClose():t.browser.publisher?t.hideNotice(!0):t.hideNotice()})}this._resize()}},s.prototype.updateDefaultToolWindow=function(){if(!this.miniMode)if(u["default"].isUndefined(this.properties.defaultToolWindow)){var t=g["default"].parseQuery();t.search&&t.search.length&&(this.searchProvider.set("query",t.search),this.set("toolWindow","search"))}else switch(this.properties.defaultToolWindow){case"toc":var e=this.properties.toc;e.enabled&&e.children&&e.children.length>0&&this.set("toolWindow","toc");break;case"notes":this.properties.components.notes&&!(0,it["default"])().getLocalStorage().isStub&&this.set("toolWindow","notes");break;case"thumbnails":this.set("toolWindow","thumbnails");break;case"search":this.set("toolWindow","search");break;default:this.set("toolWindow","none")}},s.prototype.contextMenu=function(){return(0,b["default"])().get(b["default"].CONTEXT_MENU)},s.prototype.getApiProvider=function(){return(0,b["default"])().get(b["default"].API)},s.prototype.getLocaleProvider=function(){return(0,b["default"])().get(b["default"].LOCALE)},s.prototype.freeze=function(){this._isFreezed=!0},s.prototype.unfreeze=function(){this._isFreezed=!1},s.prototype.isFreezed=function(){return this._isFreezed},s.prototype.updateMenuClasses=function(t){var e=this.workspaceContainer;h["default"].removeClass(e,"opaqueTop"),h["default"].removeClass(e,"opaqueBottom"),h["default"].removeClass(e,"justifyBottom");var i=t.split(" ");u["default"].each(i,function(t){h["default"].addClass(e,t)}),this.logo&&this.logo.updateMenuClasses(i)},s.prototype._initContextMenu=function(){function t(){this.shareCurrentPage=!0,this.tapSocial(),delete this.shareCurrentPage}var e="TOGGLE_FULLSCREEN_EVENT",i="SHARE_PAGE_EVENT",n="PRINT_PAGE_EVENT";this.contextMenu().on(at["default"].HIDE_EVENT,function(){this.contextMenu().off(e,this.tapFullscreen,this),this.contextMenu().off(i,t,this),this.contextMenu().off(n,this.tapPrint,this)},this),this.contextMenu().on(at["default"].SHOW_EVENT,function(){this.contextMenu().on(e,this.tapFullscreen,this),this.contextMenu().on(i,t,this),this.contextMenu().on(n,this.tapPrint,this)},this)},s.prototype.tapFullscreen=function(){this.isFreezed()||this.set("fullscreen",!this.fullscreen)},s.prototype.tapDownload=function(){this.isFreezed()||this.set("currentPopup","download")},s.prototype.tapSocial=function(){this.isFreezed()||this.set("currentPopup","social")},s.prototype.tapPrint=function(t){this.isFreezed()||(this.printOptions=t,this.set("currentPopup","print"),delete this.printOptions)},s.prototype._initBottomMenuButtons=function(){var t=this;this.bottomMenu.on("tap:fullscreen",function(){t.tapFullscreen()}),this.bottomMenu.on("tap:download",function(){t.tapDownload()}),this.bottomMenu.on("tap:social",function(){t.tapSocial()}),this.bottomMenu.on("tap:print",function(){t.tapPrint()}),this.bottomMenu.on("tap:toc",function(){t.isFreezed()||("toc"===t.toolWindow?t.set("toolWindow","none"):t.set("toolWindow","toc"))}),this.bottomMenu.on("tap:thumbnails",function(){t.isFreezed()||("thumbnails"===t.toolWindow?t.set("toolWindow","none"):t.set("toolWindow","thumbnails"))}),this.bottomMenu.on("tap:notes",function(){t.isFreezed()||("notes"===t.toolWindow?t.set("toolWindow","none"):t.set("toolWindow","notes"))}),this.bottomMenu.on("tap:sound",function(){t.isFreezed()||t.sound.set("muted",!t.sound.muted)}),this.sound.on("change:muted",function(e){t.getApiProvider().trigger("sound",{action:e?"off":"on"}),t.bottomMenu.toggleSound(e)}),this.bookModel.on("change:textSelectionMode",function(e){t.bottomMenu.toogleTextSelectionMode(e)})},s.prototype._sendStateApiEvents=function(t){var e=t||this.pager.state;this.getApiProvider().trigger("bookStateChanged",{leftPageUrl:this.pager.pageTable.getUrlHeaderById(e.leftPage||e.rightPage),rightPageUrl:this.pager.pageTable.getUrlHeaderById(e.rightPage||e.leftPage),isWide:e.leftPage||e.rightPage?this.pager.pageTable.getPageModel(e.leftPage||e.rightPage).getProperty("wide"):void 0,isZoomed:e.zoomMode})},s.prototype._bindProperties=function(){var t=this;this.properties.on("change:components.notes",function(e){e||"notes"!==t.toolWindow||t.set("toolWindow","none")}),this.properties.on("change:components.thumbnails",function(e){e||"thumbnails"!==t.toolWindow||t.set("toolWindow","none")}),this.properties.on("change:search",function(e){u["default"].isEmpty(e)&&"search"===t.toolWindow&&t.set("toolWindow","none")}),this.properties.on("change:downloads",function(e){!u["default"].isUndefined(e)&&!u["default"].isNull(e)&&u["default"].has(e,"enabled")&&e.enabled&&"download"===t.currentPopup?t._currentPopupObj.updateWindow(t.properties.downloads):"download"===t.currentPopup&&t._currentPopupObj.close()}),this.properties.on("change:components.share",function(t){}),this.getLocaleProvider().on("change:SearchToolWindow",function(){t.reloadToolWindow("search")}),this.getLocaleProvider().on("change:TOCToolWindow",function(){t.reloadToolWindow("toc")}),this.getLocaleProvider().on("change:ThumbnailsToolWindow",function(){t.reloadToolWindow("thumbnails")})},s.prototype._onToolWindowChanged=function(t,e){function i(t){n.properties.defaultToolWindow!==t||n.defaultToolWindowOpened?n.getApiProvider().trigger("window",{action:"open",component:t}):n.defaultToolWindowOpened=!0}var n=this;if("search"===e&&"search"!==t&&this.bookModel.setSearchQuery(""),"none"!==e&&(this._toolWindowObj&&(this._toolWindowObj.removeWindow(),this._toolWindowObj=void 0,this.getApiProvider().trigger("window",{action:"close",component:e})),this.topBar.set("searchButtonVisible",!0)),"toc"===t)this.properties.cast("toc"),this._toolWindowObj=new A["default"]({iconName:"toc",title:this.getLocaleProvider().get("TOCToolWindow.TITLE"),data:this.properties.toc},R["default"],this.pager,this.publContainer,{},this.browser),i("toc");else if("thumbnails"===t)this._toolWindowObj=new A["default"]({iconName:"thumbnails",title:this.getLocaleProvider().get("ThumbnailsToolWindow.TITLE"),data:this.bodyContainer},L["default"],this.pager,this.publContainer),i("thumbnails");else if("notes"===t)this._toolWindowObj=new A["default"]({iconName:"note",title:this.getLocaleProvider().get("NotesToolWindow.TITLE"),data:{noteData:this.noteData,bodyContainer:this.bodyContainer,bookModel:this.bookModel}},O["default"],this.pager,this.publContainer),i("notes");else{if("search"!==t||!this.properties.search||!this.properties.search.enabled)return void this._resize();this._toolWindowObj=new A["default"]({iconName:"search",title:this.getLocaleProvider().get("SearchToolWindow.TITLE"),data:this.searchProvider},D["default"],this.pager,this.publContainer,{position:"right"}),i("search"),this.topBar.set("searchButtonVisible",!1),this.searchProvider.isQueryValid()&&this.bookModel.setSearchQuery(this.searchProvider.query)}this._resize(),this._toolWindowObj.on("change:page",function(t){var e=u["default"].has(t,"target")?t.target:null;u["default"].isUndefined(t.pageId)?u["default"].isUndefined(t.pageIndex)||this.pager.goToPageByIndex(t.pageIndex,e):this.pager.goToPageById(t.pageId,e)},this),this._toolWindowObj.once("toolWindow:close",function(){this.set("toolWindow","none")},this),this._toolWindowObj.once("toolWindow:reload",this.reloadToolWindow,this)},s.prototype.reloadToolWindow=function(t){if(!t||t&&this.toolWindow===t){var e=this.toolWindow;this.set("toolWindow","none"),this.set("toolWindow",e)}},s.prototype._onCurrentPopupChanged=function(t,e){if("none"!==e&&this.getApiProvider().trigger("window",{action:"close",component:e}),"download"===t)this._currentPopupObj=new T["default"]({iconName:"download",title:this.getLocaleProvider().get("SaveWindow.TITLE"),content:"DownloadWindow",data:this.properties.downloads},this.bodyContainer,this.pager),this.getApiProvider().trigger("window",{action:"open",component:"download"});else if("social"===t)this._currentPopupObj=new T["default"]({iconName:"social",title:this.getLocaleProvider().get("PermanentLinkBar.TITLE"),content:"SocialWindow",data:this.properties},this.bodyContainer,this.pager,this.shareCurrentPage),this.getApiProvider().trigger("window",{action:"open",component:"social"});else{if("print"!==t)return;this._currentPopupObj=new T["default"]({iconName:"print",title:this.getLocaleProvider().get("PrintWindow.TITLE"),content:"PrintWindow",data:this.properties},this.bodyContainer,this.pager,this.printer,this.printOptions,this.browser),this.getApiProvider().trigger("window",{action:"open",component:"print"})}this._currentPopupObj.once("popup:close",function(){this.set("currentPopup","none"),this.set("_currentPopupObj",null)},this)},s.prototype.isFullscreen=function(){return t.document.fullScreen||t.document.mozFullScreen||t.document.webkitIsFullScreen||!!t.document.msFullscreenElement},s.prototype.fullscreenCheck=function(){this.isFullscreen()?this.set("fullscreen",!0):this.set("fullscreen",!1)},s.prototype.toggleFullscreen=function(t){t?(o(this.fullscreenContainer),this.getApiProvider().trigger("fullscreen",{action:"on"})):(a(),this.getApiProvider().trigger("fullscreen",{action:"off"})),r().fullscreen=t,this.bottomMenu.toggleFullscreen(t)},s.prototype._resize=function(){this.logo&&this.logo.resetLogoPosition()},s.prototype.getState=function(){return{toolWindow:this.toolWindow,popup:this.currentPopup,isFullscreen:this.fullscreen,searchQuery:this.searchProvider?this.searchProvider.query:null}},s.prototype._initSearch=function(){var t=this;this.searchProvider=(0,b["default"])().get(b["default"].SEARCH_PROVIDER),this.searchProvider.on("change:query",function(e){t.searchProvider.isQueryValid()?t.bookModel.setSearchQuery(e):t.bookModel.setSearchQuery("")})},s.prototype._initMiniMode=function(){var t=this;this.clickToRead=h["default"].createElement("div",{"class":"clickToRead"},this.publContainer),this.getLocaleProvider().onAndChange("change:Other.CLICK_TO_READ",function(){h["default"].setText(t.clickToRead,this.getLocaleProvider().get("Other.CLICK_TO_READ"))},this),new v["default"](t.clickToRead,{}).on("tap",function(){ t.set("fullscreen",!0)}),this.onResizeBodyContainer=function(){t.bodyContainerResized=!0;var e=t.bodyContainer.getBoundingClientRect();e.width<=550||e.height<=300?(t.zoomPanel.hidden=!0,t.miniMode=!0,h["default"].addClass(t.bodyContainer,"mini"),t._currentPopupObj&&t._currentPopupObj.close(),t.set("toolWindow","none"),t.zoomPanel.zoomPanel&&(h["default"].del(t.zoomPanel.zoomPanel),t.zoomPanel.zoomPanel=null)):(h["default"].removeClass(t.bodyContainer,"mini"),t.zoomPanel.hidden=!1,t.miniMode=!1,t.pager.getState().zoomMode&&(t.zoomPanel.zoomPanel||(t.zoomPanel.zoomPanel=t.zoomPanel.bindZoomPanel())))},(0,$.addResizeListener)(this.bodyContainer,this.onResizeBodyContainer,this.browser.firefox===!0),u["default"].defer(function(){t.bodyContainerResized!==!0&&t.onResizeBodyContainer()}),this.bookPresenter.on("onPageChanging onStartDrag",function(){h["default"].addClass(t.clickToRead,"turning")}),this.bookPresenter.on("onPageChanged onEndDrag",function(){h["default"].removeClass(t.clickToRead,"turning")})},s.prototype.onReady=function(){this.bookModel.set("isReady",!0),this.slideshow.set("isReady",!0)},e["default"]=s}).call(e,i(6))},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t,e,i){this._container=a["default"].createElement("div",{id:"top","class":"top-toolbar"},t,"top"),this._properties=i,this._properties.cast("components.paginator"),this._pager=e,this._render(),this._properties.on("change:components.topBar",this._checkVisibility,this),this._checkVisibility(this._properties.components.topBar),this.title=a["default"].id("publication-title"),this._properties.on("change:title",this._titleChange,this),this._properties.components.paginator.onAndChange("change:enabled",this._paginatorEnableChange,this)}Object.defineProperty(e,"__esModule",{value:!0});var r=i(2),a=n(r),s=i(0),l=n(s),h=i(1),d=n(h),u=i(4),c=n(u),p=i(7),f=n(p),g=i(3),m=n(g),v=i(37),y=n(v),b=i(8),w=n(b);o.prototype=new d["default"],o.prototype.constructor=o,o.prototype.getLocaleProvider=function(){return(0,m["default"])().get(m["default"].LOCALE)},o.prototype.getRootElement=function(){return this._container},o.prototype._checkVisibility=function(t){a["default"].removeClass(this._container,"hidden"),t||a["default"].addClass(this._container,"hidden")},o.prototype._titleChange=function(t){a["default"].setText(this.title,c["default"].decodeEntities(t)),this._validateDividerVisibility()},o.prototype._paginatorEnableChange=function(t){var e=a["default"].className("pager",this._container);this._validateDividerVisibility(),e.length>0&&(t?a["default"].removeClass(e[0],"hidden-component"):a["default"].addClass(e[0],"hidden-component"))},o.prototype._topMenuLableChange=function(){var t=a["default"].id("page-text");a["default"].setText(t,this.getLocaleProvider().get("TopMenu.PAGES_LABEL"))},o.prototype._searchButtonVisibleCheck=function(){this.searchButtonVisible&&this._properties.search&&this._properties.search.enabled?a["default"].removeClass(this._searchButton,"hidden-component"):a["default"].addClass(this._searchButton,"hidden-component")},o.prototype._copyrightEnableChange=function(t){var e=a["default"].id("copyright-button");a["default"].removeClass(e,"hidden-component"),t||a["default"].addClass(e,"hidden-component")},o.prototype._copyrightUrlLabelChange=function(t){var e=a["default"].id("copyright-link"),i=this._properties.components.copyright,n=i.url,o=c["default"].decodeEntities(i.label);e.href=n||"#",a["default"].setText(e,o||""),e.title=n?this.getLocaleProvider().get("TopMenu.EXTERNAL_LINK_TIP",{0:n}):o||""},o.prototype._topMenuEltChange=function(){var t=a["default"].id("copyright-link"),e=this._properties.components.copyright;e.url&&(t.title=this.getLocaleProvider().get("TopMenu.EXTERNAL_LINK_TIP",{0:e.url}))},o.prototype._copyrightTargetChange=function(t){var e=a["default"].id("copyright-link");e.target=t||"_blank"},o.prototype._validateDividerVisibility=function(){var t=a["default"].className("divider",this._container),e=t&&t.length>0?t[0]:null;l["default"].isNull(e)||(a["default"].removeClass(e,"hidden-component"),!l["default"].isEmpty(this._properties.title)&&this._properties.components.paginator.enabled||a["default"].addClass(e,"hidden-component"))},o.prototype._render=function(){this._container.innerHTML=w["default"]["workspace-top-bar"]({title:c["default"].decodeEntities(this._properties.title),searchTitle:this.getLocaleProvider().get("TopMenu.SEARCH")}),this.getLocaleProvider().onAndChange("change:TopMenu.PAGES_LABEL",this._topMenuLableChange,this),this.paginator=new y["default"](this._pager,this._properties.components.paginator),this._renderSearchButton(),this._renderCopyrightButton()},o.prototype._renderSearchButton=function(){var t=this;this._searchButton=a["default"].id("search-button"),new f["default"](this._searchButton,{}).on("tap",function(){t.trigger("search:request")}),this.searchButtonVisible=!0,this.on("change:searchButtonVisible",this._searchButtonVisibleCheck,this),this._properties.on("change:search",this._searchButtonVisibleCheck,this),this._searchButtonVisibleCheck()},o.prototype._renderCopyrightButton=function(){var t=void 0;this._properties.cast("components.copyright"),t=this._properties.components.copyright,t.onAndChange("change:enabled",this._copyrightEnableChange,this),t.onAndChange("change:url change:label",this._copyrightUrlLabelChange,this),this.getLocaleProvider().onAndChange("change:TopMenu.EXTERNAL_LINK_TIP",this._topMenuEltChange,this),t.onAndChange("change:target",this._copyrightTargetChange,this)},o.prototype.destructor=function(){var t=this._properties.components.copyright,e=this.getLocaleProvider();this._properties.off("change:components.topBar",this._checkVisibility,this),this._properties.off("change:title",this._titleChange,this),this._properties.components.paginator.off("change:enabled",this._paginatorEnableChange,this),e.off("change:TopMenu.PAGES_LABEL",this._topMenuLableChange,this),this.off("change:searchButtonVisible",this._searchButtonVisibleCheck,this),this._properties.off("change:search",this._searchButtonVisibleCheck,this),t.off("change:enabled",this._copyrightEnableChange,this),t.off("change:url change:label",this._copyrightUrlLabelChange,this),e.off("change:TopMenu.EXTERNAL_LINK_TIP",this._topMenuEltChange,this),t.off("change:target",this._copyrightTargetChange,this),this.paginator.destructor(),this._container&&a["default"].del(this._container)},e["default"]=o},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){var i=this;this.pager=t,this.properties=e,this.paginatorInput=a["default"].id("pager-val"),this.totalPages=a["default"].id("pages-count"),this.divider=a["default"].id("pages-divider"),this.properties.onAndChange("change:totalPagesVisible",this.totalPagesVisibleChange,this),this.leftPage=void 0,this.rightPage=void 0,this.paginatorInputClick=function(t){t.target.select()},this.paginatorInputKeypress=function(t){if(13===t.keyCode){var e=t.target.value;if(!l["default"].isEmpty(e)){var n=c["default"].findPageIndexByUserInput(e,i.pager);l["default"].isUndefined(n)||i.pager.goToPageByIndex(n)}t.target.blur()}},this.paginatorInputBlur=function(t){i._updateInput(i.pager.getState())},this.paginatorInput.addEventListener("click",this.paginatorInputClick),this.paginatorInput.addEventListener("keypress",this.paginatorInputKeypress),this.paginatorInput.addEventListener("blur",this.paginatorInputBlur),this.pager.on("change:totalPages",this.updateTotalPages,this),this.pager.on("change:rtl",this.pageTurned,this),(0,f["default"])().get(f["default"].API).on("turned",this.pageTurned,this),(0,f["default"])().get(f["default"].API).on("zoomed",this.pageTurned,this),(0,f["default"])().get(f["default"].API).on("unzoomed",this.pageTurned,this),this.pager._model.on("change:numerationOffset",this.numerationOffsetChange,this),this.target="paginator",this.updateCurrentPages(this.pager.getState());var n=this.pager.totalPages;this.pager.pageTable&&this.pager.pageTable.numerationOffset&&!this.pager.isTotalCustom&&(n-=this.pager.pageTable.numerationOffset),this.updateTotalPages(n)}Object.defineProperty(e,"__esModule",{value:!0});var r=i(2),a=n(r),s=i(0),l=n(s),h=i(1),d=n(h),u=i(38),c=n(u),p=i(3),f=n(p);o.prototype=new d["default"],o.prototype.constructor=o,o.prototype.paginatorInputClick=function(){},o.prototype.paginatorInputKeypress=function(){},o.prototype.paginatorInputBlur=function(){},o.prototype.totalPagesVisibleChange=function(t){t?(a["default"].removeClass(this.totalPages,"hidden-component"),a["default"].removeClass(this.divider,"hidden-component")):(a["default"].addClass(this.totalPages,"hidden-component"),a["default"].addClass(this.divider,"hidden-component"))},o.prototype.numerationOffsetChange=function(){var t=this.pager.isTotalCustom?this.pager.totalPages:this.pager.totalPages-this.pager.pageTable.getNumerationOffset();this.updateCurrentPages(this.pager.getState()),this.updateTotalPages(t)},o.prototype.pageTurned=function(){this.updateCurrentPages(this.pager.getState())},o.prototype.updateCurrentPages=function(t,e,i,n){e||n!==this.target&&(this._updateInput(t),this._updateListenToPageChanges(t))},o.prototype._updateListenToPageChanges=function(t){this.leftPage&&this.stopListening(this.pager.pageTable.getPageModel(this.leftPage).getPropertyModel(),"change:displayName",this._pageCaptionChanged),this.rightPage&&this.rightPage!==this.leftPage&&this.stopListening(this.pager.pageTable.getPageModel(this.rightPage).getPropertyModel(),"change:displayName",this._pageCaptionChanged),t.leftPage?(this.leftPage=t.leftPage,this.listenTo(this.pager.pageTable.getPageModel(this.leftPage).getPropertyModel(),"change:displayName",this._pageCaptionChanged)):this.leftPage=void 0,t.rightPage&&t.rightPage!==t.leftPage?(this.rightPage=t.rightPage,this.listenTo(this.pager.pageTable.getPageModel(this.rightPage).getPropertyModel(),"change:displayName",this._pageCaptionChanged)):this.rightPage=void 0},o.prototype._pageCaptionChanged=function(){this.updateCurrentPages(this.pager.getState())},o.prototype.updateTotalPages=function(t){a["default"].setText(this.totalPages,t)},o.prototype._updateInput=function(t){var e=this.pager.getStateForDisplay(t),i=5;this.paginatorInput.value=l["default"].isUndefined(e)?"":e,!l["default"].isUndefined(this.paginatorInput.value)&&!l["default"].isNull(this.paginatorInput.value)&&this.paginatorInput.value.length>5&&(i=this.paginatorInput.value.length),this.paginatorInput.size=i},o.prototype.destructor=function(){this.paginatorInput.removeEventListener("click",this.paginatorInputClick),this.paginatorInput.removeEventListener("keypress",this.paginatorInputKeypress),this.paginatorInput.removeEventListener("blur",this.paginatorInputBlur),this.properties.off("change:totalPagesVisible",this.totalPagesVisibleChange,this),this.pager.off("change:totalPages",this.updateTotalPages,this),this.pager.off("change:rtl",this.pageTurned,this),(0,f["default"])().get(f["default"].API).off("turned",this.pageTurned,this),(0,f["default"])().get(f["default"].API).off("zoomed",this.pageTurned,this),(0,f["default"])().get(f["default"].API).off("unzoomed",this.pageTurned,this),this.pager._model.off("change:numerationOffset",this.numerationOffsetChange,this)},e["default"]=o},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var o=i(0),r=n(o),a=i(4),s=n(a),l={};l.findPageIndexByUserInput=function(t,e){var i=r["default"].findWhere(e.pageTable.model.pages,{displayName:t});if(r["default"].isUndefined(i)){var n=e.pageTable.getNumerationOffset();if(n>0){var o=s["default"].deromanize(t);if(!r["default"].isUndefined(o)&&o<=n)return o-1}var a=parseInt(t,10);if(!r["default"].isNaN(a)&&a>0&&a+n<=e.pageTable.getPagesCount())return a+n-1}else{var l=r["default"].findKey(e.pageTable.model.pages,i);if(!r["default"].isUndefined(l))return e.pageTable.getPageIndexById(l)}},e["default"]=l},function(t,e,i){"use strict";(function(t){function n(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){var i=Array.prototype.slice.call(arguments,2);i.push(this),this.container=e||a["default"].tag("body"),this.renderWindow(t.iconName,t.title);var n=function(t){switch(t){case"SocialWindow":return f["default"];case"PrintWindow":return m["default"];case"DownloadWindow":return y["default"];default:throw new Error}}(t.content);this.childView=new(Function.prototype.bind.apply(n,l["default"].union([null,this.mainWindow,t.data,this.windowTitle],i))),l["default"].functions(this.childView).indexOf("on")!==-1&&this.childView.on("close",function(){this.close()},this)}Object.defineProperty(e,"__esModule",{value:!0});var r=i(2),a=n(r),s=i(0),l=n(s),h=i(1),d=n(h),u=i(7),c=n(u),p=i(40),f=n(p),g=i(52),m=n(g),v=i(53),y=n(v);o.prototype=new d["default"],o.prototype.constructor=o,o.prototype.renderWindow=function(t,e){this.blackOut=a["default"].createElement("div",{"class":"black-out"},this.container),this.mainWindow=a["default"].createElement("div",{"class":"popup-window"});var i=a["default"].createElement("div",{"class":"popup-title-frame"},this.mainWindow);this.windowTitle=a["default"].createElement("h3",{"class":"popup-title icon icon-"+t},i),a["default"].setText(this.windowTitle,e),this.closeButton=a["default"].createElement("span",{"class":"icon icon-close"},i),this.container.appendChild(this.mainWindow);var n=this;l["default"].defer(function(){a["default"].addClass(n.container,"popup-opened")}),this.bindDOM()},o.prototype.updateWindow=function(t){l["default"].functions(this.childView).indexOf("update")!==-1&&this.childView.update(t)},o.prototype.bindDOM=function(){var e=new c["default"](this.blackOut,{}),i=new c["default"](this.closeButton,{}),n=this,o=function(t){27===t.keyCode&&n.close()},r=function(){n.close()};e.on("tap",r),i.on("tap",r),t.addEventListener("keydown",o),this.on("popup:close",function(){t.removeEventListener("keydown",o)})},o.prototype.close=function(){l["default"].functions(this.childView).indexOf("onClose")!==-1&&this.childView.onClose(),a["default"].del(this.mainWindow),this.mainWindow=null,a["default"].removeClass(this.container,"popup-opened");var t=this;!function e(){var i=getComputedStyle(t.blackOut);"hidden"===i.visibility?a["default"].del(t.blackOut):setTimeout(e,100)}(),this.trigger("popup:close")},e["default"]=o}).call(e,i(6))},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t,e,i,n,o){this.rootElement=t,this.properties=e,this.pager=n,this.windowTitle=i,this.currentUrl=(0,c["default"])().getShareUrl(),this.embedTemplate=E["default"].template,this._render(o),this._enableClipboard(),this.getLocaleProvider().on("change:PermanentLinkBar",this._onLocaleChange,this)}Object.defineProperty(e,"__esModule",{value:!0});var r=i(2),a=n(r),s=i(0),l=n(s),h=i(3),d=n(h),u=i(5),c=n(u),p=i(4),f=n(p),g=i(21),m=n(g),v=i(8),y=n(v),b=i(41),w=n(b),_=i(42),P=n(_),T=i(50),E=n(T),C=i(51),x=n(C);o.prototype._render=function(t){var e=this;this.content||(this.content=a["default"].createElement("div",{"class":"popup-content"},this.rootElement)),f["default"].renderTemplate(this.content,y["default"]["workspace-social-window"],{embedVisibility:this.properties.components.embed,localization:{shareTab:this.getLocaleProvider().get("PermanentLinkBar.SHARE_TAB"),embedTab:this.getLocaleProvider().get("PermanentLinkBar.INSERT_TO_SITE_TAB"),shareCurrent:this.getLocaleProvider().get("PermanentLinkBar.SHARE_CURRENT_PAGE"),embedCurrent:this.getLocaleProvider().get("PermanentLinkBar.INSERT_CURRENT_PAGE"),width:this.getLocaleProvider().get("PermanentLinkBar.WIDTH"),height:this.getLocaleProvider().get("PermanentLinkBar.HEIGHT"),fullPublication:this.getLocaleProvider().get("PermanentLinkBar.FULL_PUBLICATION"),linkablePage:this.getLocaleProvider().get("PermanentLinkBar.LINKABLE_PAGE"),embedType:this.getLocaleProvider().get("PermanentLinkBar.EMBEDDING_TYPE"),copyButton:this.getLocaleProvider().get("PermanentLinkBar.COPY_BUTTON"),shareText:this.getLocaleProvider().get("PermanentLinkBar.SHARE_TEXT"),facebookTitle:this.getLocaleProvider().get("PermanentLinkBar.SHARE_TO_FACEBOOK"),twitterTitle:this.getLocaleProvider().get("PermanentLinkBar.SHARE_TO_TWITTER"),linkedinTitle:this.getLocaleProvider().get("PermanentLinkBar.SHARE_TO_LINKEDIN"),tumblrTitle:this.getLocaleProvider().get("PermanentLinkBar.SHARE_TO_TUMBLR"),googleTitle:this.getLocaleProvider().get("PermanentLinkBar.SHARE_TO_GOOGLE_PLUS"),mailTitle:this.getLocaleProvider().get("PermanentLinkBar.SEND_BY_EMAIL"),vkTitle:this.getLocaleProvider().get("PermanentLinkBar.SHARE_TO_VK")}}),this.qr=a["default"].id("qr"),this.copyButton=a["default"].id("copy-button"),this.urlContainer=a["default"].id("share-url-container"),this.facebookBtn=a["default"].id("facebook-link"),this.twitterBtn=a["default"].id("twitter-link"),this.linkedInBtn=a["default"].id("linkedin-link"),this.tubmlrBtn=a["default"].id("tumblr-link"),this.googleBtn=a["default"].id("google-link"),this.mailBtn=a["default"].id("mail-link"),this.vkBtn=a["default"].id("vk-link");var i=a["default"].id("current-page-checkbox");void 0!==t&&(a["default"].id("current-page-embed").checked=a["default"].id("current-page-checkbox").checked=t),"undefined"!=typeof i.addEventListener&&i.addEventListener("change",function(){a["default"].id("current-page-embed").checked=i.checked,e.currentUrl=(0,c["default"])().getShareUrl(i.checked),e.currentPage=i.checked,e._updateUrl()}),this._bindTabs(),this._updateUrl(),this._bindApiEvents(),this._initEmbedTab()},o.prototype._onLocaleChange=function(){a["default"].setText(this.windowTitle,this.getLocaleProvider().get("PermanentLinkBar.TITLE")),this.update()},o.prototype.getApiProvider=function(){return(0,d["default"])().get(d["default"].API)},o.prototype.getLocaleProvider=function(){return(0,d["default"])().get(d["default"].LOCALE)},o.prototype.update=function(t){t&&(this.properties=t),a["default"].del(this.content),delete this.content,this._render()},o.prototype._bindTabs=function(){var t=this;this.embedButtonTab=a["default"].id("embed-button-tab"),this.shareButtonTab=a["default"].id("share-button-tab"),this.embedButtonTab.addEventListener("click",function(){t.shareButtonTab.className="",t.embedButtonTab.className="active",a["default"].removeClass(a["default"].id("share-tab"),"active"),a["default"].addClass(a["default"].id("embed-tab"),"active")}),this.shareButtonTab.addEventListener("click",function(){t.shareButtonTab.className="active",t.embedButtonTab.className="",a["default"].addClass(a["default"].id("share-tab"),"active"),a["default"].removeClass(a["default"].id("embed-tab"),"active")})},o.prototype._bindApiEvents=function(){var t=this;this.facebookBtn.addEventListener("click",function(){t.getApiProvider().trigger("share",{service:"facebook",url:t.currentUrl})}),this.twitterBtn.addEventListener("click",function(){t.getApiProvider().trigger("share",{service:"twitter",url:t.currentUrl})}),this.linkedInBtn.addEventListener("click",function(){t.getApiProvider().trigger("share",{service:"linkedin",url:t.currentUrl})}),this.tubmlrBtn.addEventListener("click",function(){t.getApiProvider().trigger("share",{service:"tumblr",url:t.currentUrl})}),this.googleBtn.addEventListener("click",function(){t.getApiProvider().trigger("share",{service:"google+",url:t.currentUrl})}),this.mailBtn.addEventListener("click",function(){t.getApiProvider().trigger("share",{service:"email",url:t.currentUrl})}),this.vkBtn.addEventListener("click",function(){t.getApiProvider().trigger("share",{service:"vk",url:t.currentUrl})})},o.prototype._updateUrl=function(){var t=this.properties.title;this.urlContainer.value=this.currentUrl;var e=function(t,e){var i=[];for(var n in e)if(l["default"].has(e,n)){var o=encodeURIComponent(n),r=encodeURIComponent(e[n]);i.push(o+"="+r)}return t+"?"+i.join("&")};this.facebookBtn.href=e("http://www.facebook.com/sharer.php",{u:this.currentUrl}),this.twitterBtn.href=e("http://twitter.com/share",{text:t,url:this.currentUrl}),this.linkedInBtn.href=e("http://www.linkedin.com/shareArticle",{mini:!0,url:this.currentUrl,title:t,summary:t}),this.tubmlrBtn.href=e("http://www.tumblr.com/share/link",{url:this.currentUrl,name:t}),this.googleBtn.href=e("https://plus.google.com/share",{text:t,url:this.currentUrl}),this.mailBtn.href=e("mailto:",{subject:t,body:this.currentUrl}),this.vkBtn.href=e("http://vk.com/share.php",{url:this.currentUrl,title:t}),this._renderQR();var i=this._getPageLinkParams();this.animatedUrl=(0,c["default"])().translatePath(e("assets/common/embed/page.html",i))},o.prototype._getPageLinkParams=function(){function t(t){var e=i.pager.pageTable.getPageModel(t);if(e.isStub())return"s";switch(e.getProperty("thFormat")){case"jpg":return"j";default:return"p"}}var e={link:this.currentUrl},i=this;if(this.currentPage===!0){var n=this.pager.getState();e.f="",void 0!==n.rightPage&&(e.f+=t(n.rightPage),e.p=this.pager.pageTable.getPageIndexById(n.rightPage)+1),void 0!==n.leftPage&&(e.f+=t(n.leftPage),e.p=this.pager.pageTable.getPageIndexById(n.leftPage)+1)}else e.f=t(this.pager.pageTable.getPageIdByIndex(0));return e},o.prototype._renderQR=function(){a["default"].clear(this.qr),new w["default"](this.qr,{text:(0,c["default"])().getShareUrl(a["default"].id("current-page-embed").checked,"qr"),width:96,height:96})},o.prototype._enableClipboard=function(){var t=this,e=new P["default"](this.copyButton),i=new P["default"](a["default"].id("embed-copy-button")),n=a["default"].id("share-url-container");e.on("success",function(t){t.clearSelection()}),document.addEventListener("copy",function(e){e.target===n&&t.getApiProvider().trigger("share",{service:"clipboard",url:t.currentUrl})}),e.on("error",function(){(0,m["default"])().showTooltip(t.urlContainer,{hideTime:2e3,text:this.getLocaleProvider().get("PermanentLinkBar.COPY_TOOLTIP"),position:"bottom"})}),i.on("success",function(t){t.clearSelection()}),i.on("error",function(){(0,m["default"])().showTooltip(t.urlContainer,{hideTime:2e3,text:this.getLocaleProvider().get("PermanentLinkBar.COPY_TOOLTIP"),position:"bottom"})})},o.prototype._initEmbedTab=function(){var t=this;this.embedTextarea=a["default"].id("embed-text"),this.embedTypeSelect=a["default"].id("embed-type-select"),this.embedWidth=a["default"].id("embed-width"),this.embedHeight=a["default"].id("embed-height"),this.currentPageEmbed=a["default"].id("current-page-embed");var e=function(){t.currentUrl=(0,c["default"])().getShareUrl(t.currentPageEmbed.checked),t.currentPage=t.currentPageEmbed.checked,a["default"].id("current-page-checkbox").checked=t.currentPageEmbed.checked,t._updateUrl(),1*t.embedTypeSelect.value===1?(a["default"].id("embed-size-frame").style.display="inline-block",t.embedTextarea.value=t._getPublicationEmbed(t.embedWidth.value,t.embedHeight.value,!0)):(a["default"].id("embed-size-frame").style.display="none",t.embedTextarea.value=t._getPublicationEmbed("240","210",!0))};this.embedTypeSelect.addEventListener("change",e),this.currentPageEmbed.addEventListener("change",e),this.embedWidth.addEventListener("keyup",e),this.embedHeight.addEventListener("keyup",e),this.properties.on("change:title",e,this),e()},o.prototype._getPublicationEmbed=function(t,e,i){var n=(0,c["default"])().getEmbedPrefix(),o=void 0;o="fbp"===n?(0,c["default"])().getShareUrl(this.currentPageEmbed.checked,null,!0):this.currentUrl;var r={url:o,title:this.properties.title,script:(0,c["default"])().translatePath("static/html/embed.js",!0),prefix:n,lightbox:i?"yes":"no",width:t.indexOf("%")!==-1||t.indexOf("px")!==-1?t:t+"px",height:e.indexOf("%")!==-1||e.indexOf("px")!==-1?e:e+"px",method:"site"};return this.properties.publicationInfo&&(r.version=this.properties.publicationInfo.publicationVer),x["default"].render(this.embedTemplate,r)},o.prototype.onClose=function(){this.getLocaleProvider().off("change:PermanentLinkBar",this._onLocaleChange,this)},e["default"]=o},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n;!function(){function t(t){this.mode=d.MODE_8BIT_BYTE,this.data=t,this.parsedData=[];for(var e=0,i=this.data.length;e65536?(n[0]=240|(1835008&o)>>>18,n[1]=128|(258048&o)>>>12,n[2]=128|(4032&o)>>>6,n[3]=128|63&o):o>2048?(n[0]=224|(61440&o)>>>12,n[1]=128|(4032&o)>>>6,n[2]=128|63&o):o>128?(n[0]=192|(1984&o)>>>6,n[1]=128|63&o):n[0]=o,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}function e(t,e){this.typeNumber=t,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}function i(t,e){if(void 0==t.length)throw new Error(t.length+"/"+e);for(var i=0;im.length)throw new Error("Too long data");return i}function h(t){var e=encodeURI(t).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return e.length+(e.length!=t?3:0)}t.prototype={getLength:function(t){return this.parsedData.length},write:function(t){for(var e=0,i=this.parsedData.length;e=7&&this.setupTypeNumber(t),null==this.dataCache&&(this.dataCache=e.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,i)},setupPositionProbePattern:function(t,e){for(var i=-1;i<=7;i++)if(!(t+i<=-1||this.moduleCount<=t+i))for(var n=-1;n<=7;n++)e+n<=-1||this.moduleCount<=e+n||(0<=i&&i<=6&&(0==n||6==n)||0<=n&&n<=6&&(0==i||6==i)||2<=i&&i<=4&&2<=n&&n<=4?this.modules[t+i][e+n]=!0:this.modules[t+i][e+n]=!1)},getBestMaskPattern:function(){for(var t=0,e=0,i=0;i<8;i++){this.makeImpl(!0,i);var n=p.getLostPoint(this);(0==i||t>n)&&(t=n,e=i)}return e},createMovieClip:function(t,e,i){var n=t.createEmptyMovieClip(e,i),o=1;this.make();for(var r=0;r>i&1);this.modules[Math.floor(i/3)][i%3+this.moduleCount-8-3]=n}for(var i=0;i<18;i++){var n=!t&&1==(e>>i&1);this.modules[i%3+this.moduleCount-8-3][Math.floor(i/3)]=n}},setupTypeInfo:function(t,e){for(var i=this.errorCorrectLevel<<3|e,n=p.getBCHTypeInfo(i),o=0;o<15;o++){var r=!t&&1==(n>>o&1);o<6?this.modules[o][8]=r:o<8?this.modules[o+1][8]=r:this.modules[this.moduleCount-15+o][8]=r}for(var o=0;o<15;o++){var r=!t&&1==(n>>o&1);o<8?this.modules[8][this.moduleCount-o-1]=r:o<9?this.modules[8][15-o-1+1]=r:this.modules[8][15-o-1]=r}this.modules[this.moduleCount-8][8]=!t},mapData:function(t,e){for(var i=-1,n=this.moduleCount-1,o=7,r=0,a=this.moduleCount-1;a>0;a-=2)for(6==a&&a--;;){for(var s=0;s<2;s++)if(null==this.modules[n][a-s]){var l=!1;r>>o&1));var h=p.getMask(e,n,a-s);h&&(l=!l),this.modules[n][a-s]=l,o--,o==-1&&(r++,o=7)}if(n+=i,n<0||this.moduleCount<=n){n-=i,i=-i;break}}}},e.PAD0=236,e.PAD1=17,e.createData=function(t,i,n){for(var a=o.getRSBlocks(t,i),s=new r,l=0;l8*d)throw new Error("code length overflow. ("+s.getLengthInBits()+">"+8*d+")");for(s.getLengthInBits()+4<=8*d&&s.put(0,4);s.getLengthInBits()%8!=0;)s.putBit(!1);for(;;){if(s.getLengthInBits()>=8*d)break;if(s.put(e.PAD0,8),s.getLengthInBits()>=8*d)break;s.put(e.PAD1,8)}return e.createBytes(s,a)},e.createBytes=function(t,e){for(var n=0,o=0,r=0,a=new Array(e.length),s=new Array(e.length),l=0;l=0?g.get(m):0}}for(var v=0,u=0;u=0;)e^=p.G15<=0;)e^=p.G18<>>=1;return e},getPatternPosition:function(t){return p.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,i){switch(t){case c.PATTERN000:return(e+i)%2==0;case c.PATTERN001:return e%2==0;case c.PATTERN010:return i%3==0;case c.PATTERN011:return(e+i)%3==0;case c.PATTERN100:return(Math.floor(e/2)+Math.floor(i/3))%2==0;case c.PATTERN101:return e*i%2+e*i%3==0;case c.PATTERN110:return(e*i%2+e*i%3)%2==0;case c.PATTERN111:return(e*i%3+(e+i)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new i([1],0),n=0;n5&&(i+=3+r-5)}for(var n=0;n=256;)t-=255;return f.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},g=0;g<8;g++)f.EXP_TABLE[g]=1<>>7-t%8&1)},put:function(t,e){for(var i=0;i>>e-i-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var m=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]],v=function(){var t=function(t,e){this._el=t,this._htOption=e};return t.prototype.draw=function(t){function e(t,e){var i=document.createElementNS("http://www.w3.org/2000/svg",t);for(var n in e)e.hasOwnProperty(n)&&i.setAttribute(n,e[n]);return i}var i=this._htOption,n=this._el,o=t.getModuleCount();Math.floor(i.width/o),Math.floor(i.height/o);this.clear();var r=e("svg",{viewBox:"0 0 "+String(o)+" "+String(o),width:"100%",height:"100%",fill:i.colorLight});r.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),n.appendChild(r),r.appendChild(e("rect",{fill:i.colorLight,width:"100%",height:"100%"})),r.appendChild(e("rect",{fill:i.colorDark,width:"1",height:"1",id:"template"}));for(var a=0;a'],s=0;s");for(var l=0;l');a.push("")}a.push(""),i.innerHTML=a.join("");var h=i.childNodes[0],d=(e.width-h.offsetWidth)/2,u=(e.height-h.offsetHeight)/2;d>0&&u>0&&(h.style.margin=u+"px "+d+"px")},t.prototype.clear=function(){this._el.innerHTML=""},t}();n=function(t,e){if(this._htOption={width:256,height:256,typeNumber:4,colorDark:"#000000",colorLight:"#ffffff",correctLevel:u.H},"string"==typeof e&&(e={text:e}),e)for(var i in e)this._htOption[i]=e[i];"string"==typeof t&&(t=document.getElementById(t)),this._htOption.useSVG&&(b=v),this._android=s(),this._el=t,this._oQRCode=null,this._oDrawing=new b(this._el,this._htOption),this._htOption.text&&this.makeCode(this._htOption.text)},n.prototype.makeCode=function(t){this._oQRCode=new e(l(t,this._htOption.correctLevel),this._htOption.correctLevel),this._oQRCode.addData(t),this._oQRCode.make(),this._el.title=t,this._oDrawing.draw(this._oQRCode),this.makeImage()},n.prototype.makeImage=function(){"function"==typeof this._oDrawing.makeImage&&(!this._android||this._android>=3)&&this._oDrawing.makeImage()},n.prototype.clear=function(){this._oDrawing.clear()},n.CorrectLevel=u}(),e["default"]=n},function(t,e,i){var n,o,r;!function(a,s){o=[t,i(43),i(45),i(46)],n=s,r="function"==typeof n?n.apply(e,o):n,!(void 0!==r&&(t.exports=r))}(this,function(t,e,i,n){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function l(t,e){var i="data-clipboard-"+t;if(e.hasAttribute(i))return e.getAttribute(i)}var h=o(e),d=o(i),u=o(n),c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p=function(){function t(t,e){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===c(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=(0,u["default"])(t,"click",function(t){return e.onClick(t)})}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new h["default"]({action:this.action(e),target:this.target(e),text:this.text(e),container:this.container,trigger:e,emitter:this})}},{key:"defaultAction",value:function(t){return l("action",t)}},{key:"defaultTarget",value:function(t){var e=l("target",t);if(e)return document.querySelector(e)}},{key:"defaultText",value:function(t){return l("text",t)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],e="string"==typeof t?[t]:t,i=!!document.queryCommandSupported;return e.forEach(function(t){i=i&&!!document.queryCommandSupported(t)}),i}}]),e}(d["default"]);t.exports=f})},function(t,e,i){var n,o,r;!function(a,s){o=[t,i(44)],n=s,r="function"==typeof n?n.apply(e,o):n,!(void 0!==r&&(t.exports=r))}(this,function(t,e){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=i(e),r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a=function(){function t(t,e){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,e="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[e?"right":"left"]="-9999px";var i=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=i+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,o["default"])(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,o["default"])(this.target),this.copyText()}},{key:"copyText",value:function(){var t=void 0;try{t=document.execCommand(this.action)}catch(e){t=!1}this.handleResult(t)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=t,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(void 0!==t){if(!t||"object"!==("undefined"==typeof t?"undefined":r(t))||1!==t.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),t}();t.exports=s})},function(t,e){function i(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var i=t.hasAttribute("readonly");i||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),i||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var n=window.getSelection(),o=document.createRange();o.selectNodeContents(t),n.removeAllRanges(),n.addRange(o),e=n.toString()}return e}t.exports=i},function(t,e){function i(){}i.prototype={on:function(t,e,i){var n=this.e||(this.e={});return(n[t]||(n[t]=[])).push({fn:e,ctx:i}),this},once:function(t,e,i){function n(){o.off(t,n),e.apply(i,arguments)}var o=this;return n._=e,this.on(t,n,i)},emit:function(t){var e=[].slice.call(arguments,1),i=((this.e||(this.e={}))[t]||[]).slice(),n=0,o=i.length;for(n;n\n{{/legacy}}\n{{^legacy}}\n{{title}}\n{{/legacy}}'}},function(t,e,i){var n,o,r;!function(i,a){"object"==typeof e&&e&&"string"!=typeof e.nodeName?a(e):(o=[e],n=a,r="function"==typeof n?n.apply(e,o):n,!(void 0!==r&&(t.exports=r)))}(this,function(t){function e(t){return"function"==typeof t}function i(t){return g(t)?"array":typeof t}function n(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function o(t,e){return null!=t&&"object"==typeof t&&e in t}function r(t,e){return m.call(t,e)}function a(t){return!r(v,t)}function s(t){return String(t).replace(/[&<>"'`=\/]/g,function(t){return y[t]})}function l(e,i){function o(){if(v&&!y)for(;m.length;)delete f[m.pop()];else m=[];v=!1,y=!1}function r(t){if("string"==typeof t&&(t=t.split(w,2)),!g(t)||2!==t.length)throw new Error("Invalid tags: "+t);s=new RegExp(n(t[0])+"\\s*"),l=new RegExp("\\s*"+n(t[1])),c=new RegExp("\\s*"+n("}"+t[1]))}if(!e)return[];var s,l,c,p=[],f=[],m=[],v=!1,y=!1;r(i||t.tags);for(var E,C,x,S,k,A,I=new u(e);!I.eos();){if(E=I.pos,x=I.scanUntil(s))for(var L=0,M=x.length;L0?r[r.length-1][4]:n;break;default:o.push(e)}return n}function u(t){this.string=t,this.tail=t,this.pos=0}function c(t,e){this.view=t,this.cache={".":this.view},this.parent=e}function p(){this.cache={}}var f=Object.prototype.toString,g=Array.isArray||function(t){return"[object Array]"===f.call(t)},m=RegExp.prototype.test,v=/\S/,y={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="},b=/\s*/,w=/\s+/,_=/\s*=/,P=/\s*\}/,T=/#|\^|\/|>|\{|&|=|!/;u.prototype.eos=function(){return""===this.tail},u.prototype.scan=function(t){var e=this.tail.match(t);if(!e||0!==e.index)return"";var i=e[0];return this.tail=this.tail.substring(i.length),this.pos+=i.length,i},u.prototype.scanUntil=function(t){var e,i=this.tail.search(t);switch(i){case-1:e=this.tail,this.tail="";break;case 0:e="";break;default:e=this.tail.substring(0,i),this.tail=this.tail.substring(i)}return this.pos+=e.length,e},c.prototype.push=function(t){return new c(t,this)},c.prototype.lookup=function(t){var i,n=this.cache;if(n.hasOwnProperty(t))i=n[t];else{for(var r,a,s=this,l=!1;s;){if(t.indexOf(".")>0)for(i=s.view,r=t.split("."),a=0;null!=i&&a"===r?a=this.renderPartial(o,e,i,n):"&"===r?a=this.unescapedValue(o,e):"name"===r?a=this.escapedValue(o,e):"text"===r&&(a=this.rawValue(o)),void 0!==a&&(s+=a);return s},p.prototype.renderSection=function(t,i,n,o){function r(t){return a.render(t,i,n)}var a=this,s="",l=i.lookup(t[1]);if(l){if(g(l))for(var h=0,d=l.length;h=0;l.getPrinterProvider().setPdfPrintingSupport("application/pdf"===this.getResponseHeader("Content-Type")&&!e),l.pdfIsAvailable=!0}else l.getPrinterProvider().setPdfPrintingSupport(!1),console.error("Pdf printing is not ready."),l.pdfIsAvailable=!1;l.pagesForPrint=[],l._render(),l.getLocaleProvider().on("change:PrintWindow",l._onLocaleChange,l)}},d.send()}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(2),a=n(r),s=i(0),l=n(s),h=i(1),d=n(h),u=i(3),c=n(u),p=i(5),f=n(p),g=i(4),m=n(g),v=i(8),y=n(v),b=function(t){return(0,f["default"])().translatePath("assets/common/downloads/"+t)},w="idle",_="downloading",P="printing";o.prototype=new d["default"],o.prototype.constructor=o,o.prototype._formatSize=function(t){var e=t/1048576,i="MB";return e<1?e<.1?(e=(1024*e).toFixed(0),i="KB"):e=e.toFixed(2):e=e<100?e.toFixed(1):e.toFixed(0),this.getLocaleProvider().isLocaleRTL()?i+" "+e:e+" "+i},o.prototype._hasSingleFiles=function(){return this.downloads.pageFiles&&!l["default"].isEmpty(this.downloads.pageFiles)&&this.print&&this.print.currentPagesVisible},o.prototype._getFileByID=function(t){return l["default"].isArray(this.downloads.pageFiles)?l["default"].find(this.downloads.pageFiles,function(e){return e.url===t}):this.downloads.pageFiles[t]},o.prototype._buildPrintArray=function(){var t=[];if(this._hasSingleFiles())if(this.pager.state.leftPage&&this.pager.state.rightPage&&this.pager.state.leftPage!==this.pager.state.rightPage){var e=this.pager.isRtl()?this.pager.state.rightPage:this.pager.state.leftPage,i=this.pager.isRtl()?this.pager.state.leftPage:this.pager.state.rightPage,n=this._getFileByID(e),o=this._getFileByID(i);n&&n.size&&t.push({title:this.getLocaleProvider().get("PrintWindow.LEFT_PAGE"),fileUrl:b("page"+m["default"].getNum(e)+".pdf"),fileName:"page"+m["default"].getNum(e)+".pdf",fileSize:this._formatSize(n.size),fileType:".pdf",option:"Current",number:e}),o&&o.size&&t.push({title:this.getLocaleProvider().get("PrintWindow.RIGHT_PAGE"),fileUrl:b("page"+m["default"].getNum(i)+".pdf"),fileName:"page"+m["default"].getNum(i)+".pdf",fileSize:this._formatSize(o.size),fileType:".pdf",option:"Current",number:i})}else{var r=this.pager.state.leftPage||this.pager.state.rightPage,a=this._getFileByID(r);a&&a.size&&t.push({title:this.getLocaleProvider().get("PrintWindow.CURRENT_PAGE"),fileUrl:b("page"+m["default"].getNum(r)+".pdf"),fileName:"page"+m["default"].getNum(r)+".pdf",fileSize:this._formatSize(a.size),fileType:".pdf",option:"Current",number:r})}return this.downloads.url&&this.print&&this.print.selectedPagesVisible?t.push({title:this.getLocaleProvider().get("PrintWindow.CUSTOM_RANGE"),fileUrl:b(this.downloads.url),fileName:this.downloads.url,fileSize:this._formatSize(this.downloads.size),fileType:"."+this.downloads.url.split(".").pop(),option:"Custom"}):this.editorMode&&this.print&&this.print.selectedPagesVisible&&t.push({title:this.getLocaleProvider().get("PrintWindow.CUSTOM_RANGE"),fileUrl:"publication.pdf",fileName:"publication.pdf",fileSize:this._formatSize(0),fileType:".pdf",option:"Custom"}),t.text=this.getLocaleProvider().get("PrintWindow.INTRODUCTION"),t.button=this.getLocaleProvider().get("PrintWindow.PRINT_BUTTON"),t.cancel=this.getLocaleProvider().get("PrintWindow.CANCEL_BUTTON"),t.waiting=this.getLocaleProvider().get("PrintWindow.WAITING"),t.printSupported=this.getPrinterProvider().isPdfPrintingSupport(),t},o.prototype._render=function(){if(this.content||(this.content=a["default"].createElement("div",{"class":"print-window-container"},this.rootElement)),this.pdfIsAvailable){ if(this.content.innerHTML=y["default"]["workspace-pdf-print-window"](this._buildPrintArray()),this.printSelect=t.document.getElementById("print-opt"),this.options&&(this.printSelect.value=this.printSelect.querySelector('[data-filename="'+this.options.fileName+'"]').value,this.printSelect.selectedIndex===-1))for(var e=this.printSelect.getElementsByTagName("option"),i=0;i=0){var t=this.printSelect.options[this.printSelect.selectedIndex].dataset,e=t.url,i={option:t.option,filename:t.filename};t.number&&(i.number=t.number),this.getApiProvider().trigger("print",i),this.getPrinterProvider().isPdfPrintingSupport()&&this.printSelect.selectedIndex>=0?(this.set("state",_),this.getPrinterProvider().on("progress",this.progress,this),this.getPrinterProvider().on("loaded",this.loaded,this),this.getPrinterProvider().printPdf(e,function(){})):(this.popup.close(),window.open(e,"_blank"))}},this))},o.prototype._setPrintOption=function(){if(!this.getPrinterProvider().isPdfPrintingSupport()&&this.printSelect.selectedIndex>=0)switch(this.printSelect.options[this.printSelect.selectedIndex].dataset.option){case"Current":a["default"].setText(a["default"].id("print-comment"),this.getLocaleProvider().get("PrintWindow.COMMENT_OPEN_CURRENT"));break;case"Custom":a["default"].setText(a["default"].id("print-comment"),this.getLocaleProvider().get("PrintWindow.COMMENT_OPEN_CUSTOM"))}},o.prototype.onClose=function(){this.timeout&&clearTimeout(this.timeout),this.getPrinterProvider().reset(),this.printer.reset(),this.getLocaleProvider().off("change:PrintWindow",this._onLocaleChange,this)},e["default"]=o}).call(e,i(6))},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t,e,i,n){this.rootElement=t,this.data=e,this.pager=n,this.windowTitle=i,this.currentOption="",this.currentFile="",this._render(),this.getLocaleProvider().on("change:SaveWindow",this._onLocaleChange,this)}Object.defineProperty(e,"__esModule",{value:!0});var r=i(2),a=n(r),s=i(0),l=n(s),h=i(3),d=n(h),u=i(5),c=n(u),p=i(4),f=n(p),g=i(8),m=n(g),v=i(22),y=n(v);o.prototype._render=function(){this.content||(this.content=a["default"].createElement("div",{"class":"popup-content"},this.rootElement)),this.itemsArray=this._buildDownloadsArray(),this.content.innerHTML=m["default"]["workspace-download-window"](this.itemsArray),this._bindElements()},o.prototype._onLocaleChange=function(){a["default"].setText(this.windowTitle,this.getLocaleProvider().get("SaveWindow.TITLE")),this.update()},o.prototype.getApiProvider=function(){return(0,d["default"])().get(d["default"].API)},o.prototype.getLocaleProvider=function(){return(0,d["default"])().get(d["default"].LOCALE)},o.prototype.update=function(t){t&&(this.data=t),a["default"].del(this.content),delete this.content,this._render()},o.prototype._buildDownloadsArray=function(){var t=[],e=function(t){return(0,c["default"])().translatePath("assets/common/downloads/"+t)};if(this.data.url&&this.data.allPagesVisible&&(t.full={title:this.getLocaleProvider().get("SaveWindow.FULL_PUBLICATION"),fileUrl:e(this.data.url),fileName:this.data.url,fileSize:this._formatSize(this.data.size),fileType:"."+this.data.url.split(".").pop(),option:"full"}),this.data.pageFiles&&!l["default"].isEmpty(this.data.pageFiles)&&this.data.currentPagesVisible){var i=this.data.pageFiles,n=function(t){return l["default"].isArray(i)?l["default"].find(i,function(e){return e.url===t}):i[t]};if(this.pager.state.leftPage&&this.pager.state.rightPage&&this.pager.state.leftPage!==this.pager.state.rightPage){var o=this.pager.isRtl()?this.pager.state.rightPage:this.pager.state.leftPage,r=this.pager.isRtl()?this.pager.state.leftPage:this.pager.state.rightPage,a=n(o),s=n(r);a&&a.size&&t.push({title:this.getLocaleProvider().get("SaveWindow.SAVE_LEFT_PAGE"),fileUrl:e("page"+f["default"].getNum(o)+".pdf"),fileName:"page"+f["default"].getNum(o)+".pdf",fileSize:this._formatSize(a.size),fileIcon:"pdf",option:"single"}),s&&s.size&&t.push({title:this.getLocaleProvider().get("SaveWindow.SAVE_RIGHT_PAGE"),fileUrl:e("page"+f["default"].getNum(r)+".pdf"),fileName:"page"+f["default"].getNum(r)+".pdf",fileSize:this._formatSize(s.size),fileIcon:"pdf",option:"single"})}else{var h=this.pager.state.leftPage||this.pager.state.rightPage,d=n(h);d&&d.size&&t.push({title:this.getLocaleProvider().get("SaveWindow.SAVE_CURRENT_PAGE"),fileUrl:e("page"+f["default"].getNum(h)+".pdf"),fileName:"page"+f["default"].getNum(h)+".pdf",fileSize:this._formatSize(d.size),fileIcon:"pdf",option:"single"})}}if(this.data.macAppFile&&!l["default"].isEmpty(this.data.macAppFile)){var u=this.data.macAppFile,p=u.url.split(".").pop();t.push({title:this.getLocaleProvider().get("SaveWindow.MAC_OFFLINE_PUBLICATION"),fileUrl:e(u.url),fileName:u.url,fileSize:this._formatSize(u.size),fileIcon:this._getIcon(p),option:"mac"})}if(this.data.winAppFile&&!l["default"].isEmpty(this.data.winAppFile)){var g=this.data.winAppFile,m=g.url.split(".").pop();t.push({title:this.getLocaleProvider().get("SaveWindow.WINDOWS_OFFLINE_PUBLICATION"),fileUrl:e(g.url),fileName:g.url,fileSize:this._formatSize(g.size),fileIcon:this._getIcon(m),option:"windows"})}if(this.data.customFiles&&!l["default"].isEmpty(this.data.customFiles))for(var v=0;v45&&(w=w.slice(0,20)+" ... "+w.slice(-15)),t.push({title:w,fileUrl:e(y.url),fileName:y.url,fileSize:this._formatSize(y.size),fileIcon:this._getIcon(b),option:"custom"})}return t.localization={fullDescription:this.getLocaleProvider().get("SaveWindow.FULL_PUBLICATION_DESCRIPTION")},t},o.prototype._formatSize=function(t){var e=t/1048576;return e=e<1?e<.1?(1024*e).toFixed(0)+" KB":e.toFixed(2)+" MB":e<100?e.toFixed(1)+" MB":e.toFixed(0)+" MB"},o.prototype._getIcon=function(t){var e=void 0,i=void 0,n=["doc","exe","gif","html","jpg","mp3","mp4","pdf","png","ppt","psd","rar","xls","zip"],o={docx:"doc",pptx:"ppt",xlsx:"xls",htm:"html"};return i=n.indexOf(t),e=i!==-1?n[i]:o[t]||"any"},o.prototype._bindElements=function(){var t=this,e=document.querySelectorAll(".download-list a, .download-full-button"),i=function(e,i){t.getApiProvider().trigger("download",{option:e,url:i})};l["default"].each(e,function(t){t.addEventListener("click",function(t){i(t.currentTarget.getAttribute("data-option"),t.currentTarget.getAttribute("data-filename"))})}),this.itemsArray.length>4&&(this.scrollObj=new y["default"](a["default"].id("download-list"),{mouseWheel:!0,scrollbars:!0,interactiveScrollbars:!0,bounce:!1}))},o.prototype.onClose=function(){this.getLocaleProvider().off("change:SaveWindow",this._onLocaleChange,this)},e["default"]=o},function(t,e,i){"use strict";(function(t){function n(t){return t&&t.__esModule?t:{"default":t}}function o(t,e,i){this.container=t,this.bookModel=e,this.pager=i,this.hidden=!1,this.pager.on("change:state",function(t,e){t.zoomMode!==e.zoomMode&&(t.zoomMode?this.hidden||(this.zoomPanel=this.bindZoomPanel()):this.zoomPanel&&(a["default"].del(this.zoomPanel),this.zoomPanel=null))},this),this.pager.getState().zoomMode&&(this.zoomPanel=this.bindZoomPanel())}Object.defineProperty(e,"__esModule",{value:!0});var r=i(2),a=n(r),s=i(7),l=n(s);o.prototype.bindZoomPanel=function(){var e=this,i=a["default"].createElement("div",{id:"zoom-panel","class":"zoom-panel"},this.container),n=a["default"].createElement("span",{"class":"zoom-panel-caption minus"},i);a["default"].setText(n,"–");var o=a["default"].createElement("div",{"class":"zoom-panel-line"},i),r={};r[t.RTL?"right":"left"]=(77*this.bookModel.zoomScaleValue).toFixed(0)-4+"px";var s=a["default"].createElement("div",{id:"zoom-slider","class":"zoom-panel-slider",styles:r},o);!function(i){e.bookModel.on("change:zoomScaleValue",function(e){i&&(i.style[t.RTL?"right":"left"]=(77*e).toFixed(0)-4+"px")})}(s);var h=a["default"].createElement("span",{"class":"zoom-panel-caption"},i);a["default"].setText(h,"+");var s=new l["default"](s,{}),d=new l["default"](o,{}),u=new l["default"](h,{}),c=new l["default"](n,{}),p=o.getBoundingClientRect(),f=t.RTL?Math.abs(p.right-p.left):Math.abs(p.left-p.right),g=function(i){var n=t.RTL?-Math.round(i.center.x-p.right):Math.round(i.center.x-p.left);n<0||n>f||(i.isFinal&&e.bookModel.set("zoomChangeAnimation",!1),e.changeFlipBookZoomValue(n/f))};return s.on("press",function(){p=o.getBoundingClientRect()}),s.on("pan",g),s.on("panstart",function(){e.bookModel.set("zoomChangeAnimation",!0)}),s.on("panend",function(){e.bookModel.set("zoomChangeAnimation",!1)}),s.on("pancancel",function(){e.bookModel.set("zoomChangeAnimation",!1)}),d.on("tap",function(t){p=o.getBoundingClientRect(),g(t)}),u.on("tap",function(){var t=e.bookModel.zoomScaleValue+.1;t=t<0?0:t>1?1:t,e.changeFlipBookZoomValue(t)}),c.on("tap",function(){var t=e.bookModel.zoomScaleValue-.1;t=t<0?0:t>1?1:t,e.changeFlipBookZoomValue(t)}),i},o.prototype.changeFlipBookZoomValue=function(t){this.bookModel.set("zoomScaleValue",t)},e["default"]=o}).call(e,i(6))},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t,e,i){return this._canPlayMp3()?t&&t.constructor===f["default"]?(this.container=i||a["default"].tag("body"),this.properties=t,this.muted=!1,this.soundEnabled=!0,this.videosPlaying=[],this.pager=e,this.properties.cast("background"),this._initBackgroundSound(this.properties.background),this.properties.cast("flip"),this._initFlipBookSounds(this.properties.flip),void this.properties.on("change:enabled",function(t){this.soundEnabled=t,this._fadeBackgroundSound(),this._updateCanWork()},this)):void console.error("Sound need properties in constructor"):void console.error("Audio mp3 is not supported")}Object.defineProperty(e,"__esModule",{value:!0});var r=i(2),a=n(r),s=i(0),l=n(s),h=i(5),d=n(h),u=i(1),c=n(u),p=i(15),f=n(p),g=i(3),m=n(g);o.prototype=new c["default"],o.constructor=o,o.prototype.getApiProvider=function(){return(0,m["default"])().get(m["default"].API)},o.prototype._canPlayMp3=function(){if(navigator.userAgent.toLowerCase().indexOf("publisher")!==-1)return!0;var t=new Audio,e=!!t.canPlayType&&""!==t.canPlayType("audio/mp3");return e},o.prototype._updateCanWork=function(){var t=this.properties.enabled,e=this.flipEnabled&&!l["default"].isEmpty(this.properties.flip.soft),i=!l["default"].isEmpty(this.properties.background.url);this.set("canWork",this._canPlayMp3()&&t&&(e||i))},o.prototype._initBackgroundSound=function(t){var e=this,i={autoplay:"autoplay"};!this.muted&&this.soundEnabled||(i.muted="muted"),this.audio=a["default"].createElement("audio",i,this.container),this.on("change:muted",function(){this._fadeBackgroundSound()}),t.onAndChange("change:url",function(t){this._updateBackgroundURL(t),this._updateCanWork()},this),t.onAndChange("change:loop",function(t){this._updateBackgroundLoop(t)},this),t.onAndChange("change:volume",function(t){this._updateBackgroundVolume(t)},this),this.getApiProvider().on("video",function(t){switch(t.action){case"play":e.videosPlaying.indexOf(t.url)===-1&&e.videosPlaying.push(t.url),1!==e.videosPlaying.length||e.mutedByVideo||(e.mutedByVideo=!e.audio.muted),clearTimeout(this.muteTimeout),e.set("muted",!0);break;case"pause":case"stop":case"close":e.videosPlaying.splice(e.videosPlaying.indexOf(t.url),1),0===e.videosPlaying.length&&e.mutedByVideo&&(this.muteTimeout=setTimeout(function(){e.set("muted",!1),e.mutedByVideo=!1},1e3))}})},o.prototype._updateBackgroundVolume=function(t){this.audio.volume=t/100,this.backgroundVolume=this.audio.volume},o.prototype._updateBackgroundLoop=function(t){t?(this.audio.setAttribute("loop","loop"),this._playBackgroundSound()):this.audio.removeAttribute("loop")},o.prototype._updateBackgroundURL=function(t){if(l["default"].isEmpty(t))this._fadeBackgroundSound(!0);else{if(this.backgroundAudioSources)this.backgroundAudioSources.src=(0,d["default"])().translatePath("assets/common/sound/"+t),this.audio.load();else{var e={type:"audio/mp3"};e.src=(0,d["default"])().translatePath("assets/common/sound/"+t),this.backgroundAudioSources=a["default"].createElement("source",e,this.audio)}this._playBackgroundSound()}},o.prototype._playBackgroundSound=function(){var t=this,e=this.audio.play();e&&e.then&&"function"==typeof e.then&&e["catch"](function(){(0,m["default"])().get(m["default"].API).once("turned",function(){t.audio.play()})})},o.prototype._fadeBackgroundSound=function(t){if(!l["default"].isUndefined(this.audio)){var e=l["default"].isUndefined(t)?this.muted||!this.soundEnabled:t,i=this;this.fadeEffect=void 0;var n,o=500,r=100,a=o/r;l["default"].isUndefined(this.fadeEffect)||clearInterval(this.fadeEffect),e?(n=this.audio.volume/a,this.fadeEffect=setInterval(function(){0===i.audio.volume?(i.audio.muted=!0,clearInterval(i.fadeEffect)):i.audio.volume>n?i.audio.volume-=n:i.audio.volume=0},r)):(n=(this.backgroundVolume-this.audio.volume)/a,this.audio.muted=!1,this.fadeEffect=setInterval(function(){i.audio.volume===i.backgroundVolume?clearInterval(i.fadeEffect):i.audio.volume+n<=i.backgroundVolume?i.audio.volume+=n:i.audio.volume=i.backgroundVolume},r))}},o.prototype.createFlipElements=function(t,e){var i=[];if(!l["default"].isUndefined(e[t]))for(var n,o,r=e[t].length,s=0;s0){var o=i(0,n.length-1),r=n[o],a=i(5,10)/10;if(r.volume=e.flipVolume*a,!l["default"].isUndefined(r)){var s=r.pause();s&&s.then&&"function"==typeof s.then&&s["catch"](function(){}),function(t){l["default"].delay(function(){if(t.paused){t.currentTime=0;var e=t.play();e&&e.then&&"function"==typeof e.then&&e["catch"](function(){})}},10)}(r)}}};this.pager.on("change:state",function(t,i){if(!e.muted&&e.flipEnabled&&e.soundEnabled&&t.zoomMode===i.zoomMode&&!t.zoomMode){var o=(this.pageTable.isLastPage(i.leftPage)||this.pageTable.isLastPage(t.leftPage)||this.pageTable.isFirstPage(i.rightPage)||this.pageTable.isFirstPage(t.rightPage))&&this.isHardcover();n(o)}}),t.onAndChange("change:volume",function(t){this.flipVolume=t/100},this),t.onAndChange("change:enabled",function(t){this.flipEnabled=t,this._updateCanWork()},this)},o.prototype.destructor=function(){a["default"].del(this.audio),l["default"].each(this.hard,function(t){a["default"].del(t)}),l["default"].each(this.soft,function(t){a["default"].del(t)})},e["default"]=o},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t,e,i,n,o,r){this.options={position:"left"},l["default"].extend(this.options,o),this.container=n||a["default"].tag("body"),this.renderWindow(t.iconName,t.title),e&&(this.content=new e(a["default"].id("content-scroller"),i,t.data,r),this.content.on("change:page",function(t){this.trigger("change:page",t)},this),this.content.on("change:height",function(){this.scrollObj.refresh()},this),this.content.on("scroll:toElement",function(t){l["default"].isUndefined(t.el)||this.scrollObj.scrollToElement(t.el,t.speed,!0,!0)},this),this.content.on("scroll:toTop",function(){this.scrollObj.scrollTo(0,0)},this),this.content.on("reloadRequested",function(){this.trigger("toolWindow:reload")},this)),this.currentDOMElement=a["default"].id("tool-window"),"left"!==this.getPosition()&&a["default"].addClass(this.currentDOMElement,this.getPosition())}Object.defineProperty(e,"__esModule",{value:!0});var r=i(2),a=n(r),s=i(0),l=n(s),h=i(1),d=n(h),u=i(4),c=n(u),p=i(7),f=n(p),g=i(22),m=n(g),v=i(8),y=n(v);o.prototype=new d["default"],o.prototype.constructor=o,o.prototype.renderWindow=function(t,e){var i=this,n=this.container.querySelector(".publication-container > .resize-triggers");c["default"].renderTemplate(this.container,y["default"]["workspace-tool-window"],{icon:t,title:e},n),this.bindDOM(),this.scrollObj=new m["default"](a["default"].id("scroller"),{mouseWheel:!0,scrollbars:!0,fadeScrollbars:!0,interactiveScrollbars:!0,probeType:3}),this.scrollObj.on("scroll",function(){i.content instanceof d["default"]&&i.content.trigger("scroll")});for(var o=document.querySelectorAll(".iScrollLoneScrollbar"),r=0;re.left-25&&i.clientXe.top-25&&i.clientY=this.startIndex&&this._renderPageContent(),this.thumbnailsObj.on("change:active",function(){this._changePos(!0)},this),this.pager.on("change:state",this._updatePageHeight,this)}Object.defineProperty(e,"__esModule",{value:!0});var r=i(2),a=n(r),s=i(0),l=n(s),h=i(3),d=n(h),u=i(5),c=n(u),p=i(4),f=n(p),g=i(7),m=n(g),v=i(9),y=window.FBPublication.PageResourceType;o.prototype._init=function(){var t=2*this.numberOfRows*(this.pageNum-1)-1,e=2*this.numberOfRows*this.pageNum-2;this.startIndex=t<0?-1:t,this.endIndex=e>=this.pager.pageTable.getPagesCount()?this.pager.pageTable.getPagesCount()-1:e},o.prototype._initTH=function(){this._renderItem(0,!0);try{var t=a["default"].className("th-string th-template")[0],e=t.getBoundingClientRect();this.thHeight=e.bottom-e.top}catch(i){console.error("Can't find template. Defaulting thHeight to 43. \nError: "+i.name+i.message),this.thHeight=43}finally{a["default"].del(t)}},o.prototype.getApiProvider=function(){return(0,d["default"])().get(d["default"].API)},o.prototype._changePos=function(e){e=e||!1;var i=this.pager.getState(),n=this.pager.pageTable.getPageIndexById(i.leftPage||i.rightPage),o=n>=this.startIndex&&n<=this.endIndex;o&&!e||!o&&e||l["default"].delay(l["default"].bind(function(){var i=this.pageWrapper.getBoundingClientRect();this.visible?e||(i.bottom<0||i.top>t.innerHeight)&&this._clear():(i.bottom>0&&i.top=0){t=o;break}if(!i.RTL&&o.presenter.isWide()&&n.indexOf("Left")>=0){t=o;break}t=t?i.pager.rtl?i.RTL?parseInt(o.presenter.model.getPageNumber())parseInt(t.presenter.model.getPageNumber())?o:t:i.RTL?parseInt(o.presenter.model.getPageNumber())>parseInt(t.presenter.model.getPageNumber())?o:t:parseInt(o.presenter.model.getPageNumber())t.offsetHeight;)e.pop(),t.innerText=e.join(" ")+"..."}this.loadManager=(0,d["default"])().get(d["default"].LOAD_MANAGER);var e=this.pager.pageTable.getPageCaptionById(this.pageId);this.noteElement=a["default"].createElement("div",{id:"note"+this.pageId+"-"+this.data.id,"class":"note-window-item list-item"},this.body);var i=this.createImage();this.body=a["default"].createElement("div",{"class":"note-body-element p"+this.pageId,styles:{width:210-i.width+"px"}},this.noteElement),this.pageElement=a["default"].createElement("span",{"class":"note-window-item-title"},this.body),this.pageElement.innerHTML=l["default"].cleanString(this.getLocaleProvider().get("NotesToolWindow.PAGE",{0:e}));a["default"].createElement("div",{"class":"note-color "+this.data.color},this.body);this.textElement=a["default"].createElement("span",{"class":this.data.text?"note-window-item-text":"note-window-item-text not-available"},this.body),this.textElement.innerHTML=this.data.text?l["default"].cleanString(this.data.text):this.getLocaleProvider().get("NotesToolWindow.NO_TEXT_AVAILABLE"),t(this.textElement)},o.prototype.createImage=function(){var t=this,e=this.pager.pageTable.getPageModel(this.pageId),i=e.getProperty("wide"),n=e.getRect({width:40*(i?2:1),height:56}),o=n.pageHeight.toFixed(0),r=(n.pageWidth/(i?2:1)).toFixed(0),s=a["default"].createElement("div",{"class":"note-img-element p"+this.pageId,styles:{height:o+"px",width:r+"px","background-color":e.getProperty("backgroundColor"),overflow:"hidden"}},this.noteElement),h=this.loadManager.getPageLoader(this.pageId,m.THUMBNAIL);if(h){var d=function(){!function(n){var s="FILL"===e.getProperty("pageResize")?l["default"].fillScreenSizes(parseInt(e.getProperty("width"),10),parseInt(e.getProperty("height"),10),parseInt(r*(i?2:1),10),parseInt(o,10)):l["default"].fitScreenSizes(parseInt(e.getProperty("width"),10),parseInt(e.getProperty("height"),10),parseInt(r*(i?2:1),10),parseInt(o,10)),d=0;if(i){var u=parseInt(e.getProperty("width"),10)/2,c=u/parseInt(e.getProperty("height"),10),p=e.bookSize.width/e.bookSize.height,f=0;c200?i.highlightDelay-200:0,this.setBackgroundImages(i.backgroundImages),this.crossOrigin=(0,y["default"])().getCrossOrigin(),this.parentObject=f["default"].createElement("div",{"class":"page-content",styles:{position:"absolute",overflow:"hidden",top:0,bottom:0,right:0,left:0,background:i.pageBackgroundColor}});var n="ADD_NOTE_EVENT",r="TOGGLE_ZOOM_EVENT",a="SHARE_PAGE_EVENT",s="DOWNLOAD_PAGE_EVENT",l="PRINT_PAGE_EVENT",h="TOGGLE_FULLSCREEN_EVENT";this.container=f["default"].createElement("div",{},this.parentObject),this._buildDOM(this.container),this._addNavigationButtons(this.parentObject),this._bindDOMEvents(this.container),this.on("change:state",this._onStateChanged,this),this.set("state",i.state);var u=(0,m["default"])().get(m["default"].WIDE_HIGHLIGHTER),p=function(t){this.presenter.addNote(t,"context-menu")},g=function(t){var e=document.createElement("a");e.setAttribute("href",t.fileUrl),e.setAttribute("target","_blank"),e.setAttribute("download",t.fileName),document.body.appendChild(e),e.click(),document.body.removeChild(e)},v=function(t){function i(t,i,n,o,r,a,s){e.contextMenu().addItem({name:(0,m["default"])().get(m["default"].LOCALE).get(i),event:t,icon:n,options:o,group:s,include:a},r)}function o(t){t.preventDefault=function(){},this._onDoubleTap(t)}var d=e.parentObject.getBoundingClientRect(),u=0;"wideRight"===e.presenter.model.getMode()&&(u=d.right-d.left);var f=e.presenter.getBookSize(),v={width:d.right-d.left,height:d.bottom-d.top};v.ratio=v.width/v.height;var b=({scaleX:v.width/f.width,scaleY:v.height/f.height},c["default"].getBookSizes(e.presenter.getBookSize(),d,e.isZoomed,e.presenter.isWide(),e.presenter.isRight())),w={pX:Number((t.pageX-d.left)/b.scales.scaleX+b.offset).toFixed(2),pY:Number((t.pageY-d.top)/b.scales.scaleY).toFixed(2)},_=e.presenter.model._bookModel.getWorkspaceProperties(),T=_.components;if(T.notes!==!0||(0,y["default"])().getLocalStorage().isStub||i(n,"RightClickMenu.ADD_NOTE","icon-add-note",w,t,void 0,1),_.downloads.enabled===!0&&_.downloads.currentPagesVisible===!0&&!e.presenter.model.pageModel.isStub()){var E="page"+c["default"].getNum(e.presenter.model.pageModel.id)+".pdf",C=(0,y["default"])().translatePath("assets/common/downloads/"+E);i(s,"RightClickMenu.DOWNLOAD_PAGE","icon-download",{fileUrl:C,fileName:E},t,void 0,1)}if(T.print===!0&&!e.presenter.model.pageModel.isStub()){var x="page"+c["default"].getNum(e.presenter.model.pageModel.id)+".pdf";i(l,"RightClickMenu.PRINT_PAGE","icon-print",{fileName:x,pageId:e.presenter.model.getPageId(),isRight:e.presenter.model.isRight()&&!e.pager.state.zoomMode},t,void 0,1)}if(T.share===!0&&i(a,"RightClickMenu.SHARE_PAGE","icon-social",void 0,t,void 0,1),T.book.flip===!0&&_.components.book.slide===!0&&(e.pager.state.zoomMode===!1?i(r,"RightClickMenu.SWITCH_TO_ZOOM","icon-zoomin",{center:{x:t.pageX,y:t.pageY}},t,void 0,1):i(r,"RightClickMenu.SWITCH_TO_BOOK","icon-zoomout",{center:{x:t.pageX,y:t.pageY}},t,void 0,1)),T.fullscreen===!0){var S=(0,m["default"])().get(m["default"].BOOK_STATE);S.fullscreen===!0?i(h,"RightClickMenu.EXIT_FULLSCREEN","icon-fullscreen-out",void 0,t,void 0,1):i(h,"RightClickMenu.ENTER_FULLSCREEN","icon-fullscreen",void 0,t,void 0,1)}e.contextMenu().on(P["default"].HIDE_EVENT,function(){this.contextMenu().off(n,p,this),this.contextMenu().off(s,g,this)},e),e.contextMenu().on(n,p,e),e.contextMenu().on(s,g,e),e.contextMenu().on(P["default"].HIDE_EVENT,function(){this.contextMenu().off(r,o,this)},e),e.contextMenu().on(r,o,e)};return this.presenter.on("change:isActive",function(t){if(t){if(this.noteManager()&&this.noteManager().registerContentContainer(this.presenter.model.getPageId(),this.mode,this.parentObject,this.presenter),this.parentObject.addEventListener("contextmenu",v,!1),f["default"].addClass(e.contentContainer,"active"),e.highlightOnFlip){var i=this.pager.state,n=this.presenter.model.getPageId(),o=!0,r=void 0;if(i.leftPage!==n||d["default"].isUndefined(i.rightPage)?i.rightPage===n&&(r=i.leftPage):r=i.rightPage,r&&(i.isZoomed||(r=this.pager.pageTable.getPageIndexById(r)+1),o=(0,m["default"])().get(m["default"].CURRENT_PRESENTER).contentPresenters[r].isActive),o)if(e.isZoomed||0!==e.mode.indexOf("wide"))e.highlight("flip");else{var a=u.pushContent(this);a&&e.highlight("flip")}}d["default"].delay(function(){e._applyHQImages()},500)}else this.noteManager()&&this.noteManager().unregisterContentContainer(this.presenter.model.getPageId(),this.mode),this.parentObject.removeEventListener("contextmenu",v,!0),u.pushContent(null),clearTimeout(e.highlightTimeout),f["default"].removeClass(e.contentContainer,"active")},this),this.on("contentResize",function(){this.backgroundLayer.setAttribute("data-hq","0"),this.textLayer.setAttribute("data-hq","0"),this.presenter.isActive&&this._applyHQImages()}),this.listenTo(this.presenter,"change:currentSize",d["default"].debounce(function(t,i){t.width===i.width&&t.height===i.height||this.trigger("contentResize",e.presenter.currentSize)},500)),this},o.prototype.highlight=function(t){function e(t){i.highlightTimeout=setTimeout(function(){f["default"].addClass(n,t),setTimeout(function(){f["default"].removeClass(n,t)},500)},i.isZoomed?500:i.highlightDelay)}if((0,m["default"])().has(m["default"].CURRENT_PRESENTER)){var i=this,n=(0,m["default"])().get(m["default"].CURRENT_PRESENTER).getViewContainer();switch(t){case"full":e("highlighted");break;case"toggle":f["default"].hasClass(n,"highlighted")?(f["default"].removeClass(n,"highlighted"),this.trigger("highlight","off")):(f["default"].addClass(n,"highlighted"),this.trigger("highlight","on"));break;case"flip":default:e("flip-highlighted")}(0,m["default"])().get(m["default"].API).on("bookStateChanged",function(){f["default"].removeClass(n,"flip-highlighted"),f["default"].removeClass(n,"highlighted")})}},o.prototype._parseColor=function(t){var e;return(e=t.match(/^#([0-9a-f]{3})$/i))?(e=e[1],[17*parseInt(e.charAt(0),16),17*parseInt(e.charAt(1),16),17*parseInt(e.charAt(2),16)]):(e=t.match(/^#([0-9a-f]{6})$/i),e?(e=e[1],[parseInt(e.substr(0,2),16),parseInt(e.substr(2,2),16),parseInt(e.substr(4,2),16)]):[0,0,0])},o.prototype._calculateLuma=function(t){var e=299,i=667,n=114,o=(t[0]*e+t[1]*i+t[2]*n)/(e+i+n);return o/255},o.prototype._buildDOM=function(t){var e={position:"relative","background-position":"center center","background-repeat":"no-repeat",height:"100%"};switch(this.mode){case"wideLeft":e.width="200%";break;case"wideRight":e.width="200%",e["margin-left"]="-100%";break;default:e.width="100%"}this.backgroundContainer=f["default"].createElement("div",{"class":"background",styles:e});var i={styles:{"text-indent":"-999px"}};this.textLayer=f["default"].createElement("img",i),this.backgroundLayer=f["default"].createElement("img",i,this.backgroundContainer),this.setFillMode(this.fillMode),this.crossOrigin&&(this.textLayer.crossOrigin=this.crossOrigin,this.backgroundLayer.crossOrigin=this.crossOrigin),this.textLayer.setAttribute("draggable","false"),this.backgroundLayer.setAttribute("draggable","false"),this.container.appendChild(this.backgroundContainer),this.searchContainer=f["default"].createElement("div",{"class":"search-container"},this.container,"top"),this.contentContainer=f["default"].createElement("div",{"class":"content-container"},this.container,"top");var n=this.presenter.model._bookModel.browser,o=this.presenter.model.getPageNumber()+1,r=this.presenter.model.getPageTable().getPagesCount();n.chrome&&parseInt(n.version.split(".")[0],10)>=67&&(2===o||o===r-1||"wideRight"===this.mode&&o===r-2)&&(this.contentContainer.style.willChange="transform"),this.preloader=f["default"].createElement("div",{"class":"preloader",styles:{display:"none"}},t),this.shadowDiv=f["default"].createElement("div",{},this.parentObject)},o.prototype._bindDOMEvents=function(t){var e=this,i=new l["default"].Manager(t,{}),n=new l["default"].Tap({event:"singletap"}),o=new l["default"].Tap({event:"doubletap",taps:2});i.add([o,n]),o.recognizeWith(n),n.requireFailure(o),i.on("singletap",function(t){t.target&&t.target.className&&t.target.className.constructor===SVGAnimatedString||e.trigger("tap",t.srcEvent)}),i.on("doubletap",function(t){e._onDoubleTap(t)})},o.prototype._addNavigationButtons=function(t){var e=this,i=f["default"].createElement("div",{"class":"prev-nav-button"},t),n=f["default"].createElement("div",{"class":"next-nav-button"},t),o=new l["default"].Manager(i,{}),r=new l["default"].Tap({event:"singletap"}),a=new l["default"].Tap({event:"doubletap",taps:2});o.add([a,r]),a.recognizeWith(r),r.requireFailure([a]),o.on("singletap",function(t){e.presenter.requestNavigation("prev"),t.preventDefault()}),o.on("doubletap",function(t){e._onDoubleTap(t)});var s=new l["default"].Manager(n,{});r=new l["default"].Tap({event:"singletap"}),a=new l["default"].Tap({event:"doubletap",taps:2}),s.add([a,r]),a.recognizeWith(r),r.requireFailure([a]),s.on("singletap",function(t){e.presenter.requestNavigation("next"),t.preventDefault()}),s.on("doubletap",function(t){e._onDoubleTap(t)})},o.prototype.changeShadowDepth=function(t){switch(1*t){case 0:this.shadowDiv.className="gradient zero";break;case 1:this.shadowDiv.className="gradient light";break;case 2:this.shadowDiv.className="gradient";break;case 3:this.shadowDiv.className="gradient hard"}},o.prototype._onStateChanged=function(t,e){var i=this;switch(this._applyPreloaderVisibility(),t){case o.STATES.LOADED:this.content&&this.content.length&&d["default"].each(this.content,function(t){i.addContentElement(t)}),this._applyBackgroundImages()}},o.prototype._applyPreloaderVisibility=function(){if(!this.destructed){f["default"].clear(this.preloader),this.preloaderBackground=f["default"].createElement("div",{},this.preloader),this.preloaderAnimation=f["default"].createElement("div",{},this.preloaderBackground);var t=this.presenter.pageResources[0].preloaderHack?o.STATES.LOADING:this.state;switch(t){case o.STATES.ERROR:f["default"].removeClass(this.preloaderBackground,"loading-bg"),f["default"].removeClass(this.preloaderAnimation,"loading"),f["default"].removeClass(this.preloaderBackground,"unready-bg");var e=this._calculateLuma(this._parseColor(this.pageBackgroundColor));f["default"].css(this.backgroundContainer,{"background-image":"none",filter:"none"}),this.textLayer.removeAttribute("src"),this.backgroundLayer.removeAttribute("src"),this.preloaderTitle=f["default"].createElement("div",{"class":e<.5?"error-title-light":"error-title-dark"},this.preloader),this.preloaderTitle.innerText=(0,m["default"])().get(m["default"].LOCALE).get("Other.PAGE_ERROR_TITLE"),this.preloaderText=f["default"].createElement("div",{"class":e<.5?"error-text-light":"error-text-dark"},this.preloader),this.preloaderText.innerText=(0,m["default"])().get(m["default"].LOCALE).get("Other.PAGE_ERROR_MESSAGE"),f["default"].addClass(this.preloaderBackground,"error");break;case o.STATES.LOADING:f["default"].css(this.preloader,{display:"block"}),f["default"].addClass(this.preloaderBackground,"loading-bg"),f["default"].addClass(this.preloaderAnimation,"loading");break;case o.STATES.UNREADY:f["default"].css(this.preloader,{display:"block"}),f["default"].addClass(this.preloaderBackground,"unready-bg");var e=this._calculateLuma(this._parseColor(this.pageBackgroundColor));this.preloaderText=f["default"].createElement("div",{"class":e<.5?"unready-text-light":"unready-text-dark"},this.preloader),this.preloaderText.innerText=(0,m["default"])().get(m["default"].LOCALE).get("Other.CONVERTING_PAGE");break;default:f["default"].css(this.preloader,{display:"none"})}}},o.prototype.setPreloaderImage=function(t){!t||this.state!==o.STATES.LOADING&&this.state!==o.STATES.IDLE||(f["default"].css(this.backgroundLayer,{filter:"blur(2px)"}),this.backgroundLayer.src=t)},o.prototype._applyHQImages=function(){function t(t,e){(0,m["default"])().get(m["default"].API).trigger("develop",{action:"img-scale",data:t+(e?", length: "+e:"")})}function e(e,i,n,o){s.destructed||(n.setAttribute("data-hq","1"),o.resize(e,i,{unsharpAmount:80,unsharpRadius:.6,unsharpThreshold:166,quality:3,alpha:!0}).then(function(o){if(!s.destructed){e=null,i=null,n.onload=function(){n.onload=null,o=null};var r=window.MSInputMethodContext&&document.documentMode?1e4:6500;if("wideLeft"===s.mode)for(var a=document.querySelectorAll('[data-src="'+n.getAttribute("data-src")+'"]'),l=0,h=a.length;lr?a[l].src=d:t("error",d.length),d=null}else{var u=o.toDataURL();u.length>r?n.src=u:t("error",u.length),u=null}}}))}if(this.presenter.isActive){var i=this.backgroundImages.length>1&&this.backgroundImages[1].indexOf(".svg")===-1,n=i?this.textLayer:this.backgroundLayer;if("wideRight"!==this.mode&&"1"!==n.getAttribute("data-hq")&&"Promise"in window&&!this.isZoomed&&"firefox"!==this.presenter.model._bookModel.browser.name.toLowerCase()){var o,r,a=n.getBoundingClientRect(),s=this,l=f["default"].createElement("canvas",{styles:{transform:"translateZ(0)"}}),h=f["default"].createElement("canvas",{styles:{transform:"translateZ(0)"}}),s=this;h.width=a.width,h.height=a.height,o=new Image,s.crossOrigin&&(o.crossOrigin=this.crossOrigin),o.onload=function(){s.destructed||(i?(r=new Image,s.crossOrigin&&(r.crossOrigin=s.crossOrigin),r.onload=function(){if(!s.destructed){var t=l.getContext("2d");l.width=r.width,l.height=r.height,t.drawImage(o,0,0,r.width,r.height),t.drawImage(r,0,0,r.width,r.height),e(l,h,n,w["default"]),r=null,o=null}},r.src=s.backgroundImages[1]):(e(o,h,n,w["default"]),o=null))},o.src=this.backgroundImages[0]}}},o.prototype._applyBackgroundImages=function(){this.backgroundLayer.getAttribute("data-src")!==this.backgroundImages[0]&&("firefox"===this.presenter.model._bookModel.browser.name.toLowerCase()&&(this.backgroundLayer.src=this.backgroundImages[0]),this.backgroundLayer.src=this.backgroundImages[0],this.backgroundLayer.setAttribute("data-src",this.backgroundImages[0]),this.backgroundLayer.setAttribute("data-hq","0")),this.backgroundImages.length>1&&this.textLayer.getAttribute("data-src")!==this.backgroundImages[1]&&(this.textLayer.src=this.backgroundImages[1],this.textLayer.setAttribute("data-src",this.backgroundImages[1]),this.textLayer.parentNode||this.backgroundContainer.appendChild(this.textLayer)),d["default"].delay(d["default"].bind(function(){f["default"].css(this.backgroundLayer,{filter:"none"})},this),100)},o.prototype.setState=function(t){this.set("state",t)},o.prototype.setBackgroundImages=function(t){this.backgroundImages=d["default"].filter(t,function(t){return t}),this.state===o.STATES.LOADED&&this._applyBackgroundImages()},o.prototype.getDOMElement=function(){return this.parentObject},o.prototype.addContentElement=function(t){t.setBorderHolder&&t.setBorderHolder(this.parentObject),this.contentContainer.appendChild(t.getDOMElement()),t.commit()},o.prototype.clearContentView=function(){this.contentContainer.innerHTML=""},o.prototype.clearSearchView=function(){this.searchContainer.innerHTML=""},o.prototype.addSearchViews=function(t){var e=this;d["default"].each(t,function(t){e.searchContainer.appendChild(t)})},o.prototype.updateBackgroundColor=function(t){this.parentObject.style.backgroundColor=t},o.prototype.resize=function(t){var e=this.pageWidth;switch(this.mode){case"wideLeft":case"wideRight":e/=2}var i,n,o;if("fit"===this.fillMode)switch(i=c["default"].fitScreenSizes(e,this.pageHeight,t.width,t.height),Math.abs(i.paddingLeft)<1&&Math.abs(i.paddingTop)<1&&(i=c["default"].fillScreenSizes(e,this.pageHeight,t.width,t.height),this.backgroundContainer.style["background-size"]="cover"),n=(t.width-i.width)/2,o=(t.height-i.height)/2,this.mode){case"wideLeft":n*=2;break;case"wideRight":n=0}else i=t,n=o=0;var r=t.width/t.height,a=this.pageWidth/this.pageHeight;switch(this.mode){case"wideLeft":case"wideRight":a/=2}var s=r>a?r/a:a/r,l=r>a?(t.height/s-t.height)/2:0,h=0;switch(this.mode){case"wideLeft":ra&&(h=(t.width-t.width/s)/2);break;case"wideRight":r!==a&&(h=(t.width-t.width/s)/2);break;default:r>a&&(h=(t.width-t.width/s)/2)}var d="fit"===this.fillMode?"scale(1) translateX(0px) translateY(0px)":"scale("+s+") translateX("+h+"px) translateY("+l+"px)";this.contentContainer.style.transform=d,this.searchContainer.style.transform=d,this.presenter.sendContentSizeThr1("bookPage"),f["default"].css(this.container,{width:Math.floor(i.width)+"px",height:Math.floor(i.height)+"px","margin-left":n.toFixed(0)+"px","margin-top":o.toFixed(0)+"px"})},o.prototype._onDoubleTap=function(t){var e=this.container.getBoundingClientRect(),i={x:t.center.x-e.left,y:t.center.y-e.top};this.presenter.requestNavigation("zoom",{center:i}),t.preventDefault()},o.STATES={IDLE:"idle",UNREADY:"unready",LOADING:"loading",LOADED:"loaded",ERROR:"error"},(0,y["default"])(),e["default"]=o},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var o=i(63),r=n(o);e["default"]="Promise"in window?new r["default"]:function(){return!1}},function(t,e,i){"use strict";var n,o,r,a,a,s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(i){if("object"===s(e)&&"undefined"!=typeof t)t.exports=i();else{o=[],n=i,r="function"==typeof n?n.apply(e,o):n,!(void 0!==r&&(t.exports=r))}}(function(){return function t(e,i,n){function o(s,l){if(!i[s]){if(!e[s]){var h="function"==typeof a&&a;if(!l&&h)return a(s,!0);if(r)return r(s,!0);var d=new Error("Cannot find module '"+s+"'");throw d.code="MODULE_NOT_FOUND",d}var u=i[s]={exports:{}};e[s][0].call(u.exports,function(t){var i=e[s][1][t];return o(i?i:t)},u,u.exports,t,e,i,n)}return i[s].exports}for(var r="function"==typeof a&&a,s=0;s>8&255}}var s=t("./utils").base64decode,l=t("./mathlib/wasm/math_wasm_base64");n.prototype.__init__=function(t){var e=this;if(this.__initCallbacks.length>0)return void this.__initCallbacks.push(t);this.__initCallbacks=[t];var i=function(){var t=e.__initCallbacks;e.__initCallbacks=[],e.__initialized=!0,t.forEach(function(t){return t()})};return this.unsharp=this.unsharp_js,this.__requested_features.indexOf("js")>=0&&(this.features.js=!0,this.resize=this.resize_js),"undefined"!=typeof WebAssembly&&this.__requested_features.indexOf("wasm")>=0?this.__wasm_module?(this.features.wasm=!0,this.resize=this.resize_wasm,void i()):void WebAssembly.compile(s(l)).then(function(t){e.__wasm_module=t,e.features.wasm=!0,e.resize=e.resize_wasm,i()})["catch"](function(){i()}):void i()},n.prototype.init=function(t){var e=this;return"function"!=typeof t?this.__initialized?Promise.resolve(this):new Promise(function(t,i){e.__init__(function(n){return n?void i(n):e.features.wasm||e.features.js?void t(e):void i(new Error("Pica mathlib: no supported methods found"))})}):this.__initialized?void t(null,this):void this.__init__(function(i){return i?void t(i):e.features.wasm||e.features.js?void t(null,e):void t(new Error("Pica mathlib: no supported methods found"))})},n.prototype.resizeAndUnsharp=function(t,e){var i=this.resize(t,e);return t.unsharpAmount&&this.unsharp(i,t.toWidth,t.toHeight,t.unsharpAmount,t.unsharpRadius,t.unsharpThreshold),i},n.prototype.unsharp_js=t("./mathlib/unsharp_js"),n.prototype.resize_js=t("./mathlib/resize_js");var h=t("./mathlib/resize_filter_gen"),d=!0;try{d=1===new Uint32Array(new Uint8Array([1,0,0,0]).buffer)[0]}catch(u){}n.prototype.resize_wasm=function(t,e){var i=t.src,n=t.width,r=t.height,s=t.toWidth,l=t.toHeight,d=t.scaleX||t.toWidth/t.width,u=t.scaleY||t.toHeight/t.height,c=t.offsetX||0,p=t.offsetY||0,f=t.dest||new Uint8Array(s*l*4),g="undefined"==typeof t.quality?3:t.quality,m=t.alpha||!1;e||(e={});var v="filter_"+g+"|"+n+"|"+s+"|"+d+"|"+c,y="filter_"+g+"|"+r+"|"+l+"|"+u+"|"+p,b=e[v]||h(g,n,s,d,c),w=e[y]||h(g,r,l,u,p),_=Math.max(i.byteLength,f.byteLength)+b.byteLength+w.byteLength+r*s*4,P=Math.ceil(_/65536),T=e.wasm_imports||{env:{memory:new WebAssembly.Memory({initial:P})}},E=T.env.memory,C=E.buffer.byteLength/65536;P>C&&E.grow(P-C+16);var x=e.wasm_instance||new WebAssembly.Instance(this.__wasm_module,T);e.wasm_imports||(e.wasm_imports=T),e.wasm_instance||(e.wasm_instance=x);var S=new Uint8Array(T.env.memory.buffer),k=new Uint32Array(T.env.memory.buffer),A=new Uint32Array(i.buffer);k.set(A);var I=Math.max(i.byteLength,f.byteLength),L=I+r*s*4,M=L+b.byteLength;a(b,S,L),a(w,S,M),x.exports.convolveHV(L,M,I,n,r,s,l);var O=new Uint32Array(f.buffer);return O.set(k.subarray(0,O.length)),m||o(f,s,l),f},e.exports=n},{"./mathlib/resize_filter_gen":4,"./mathlib/resize_js":6,"./mathlib/unsharp_js":7,"./mathlib/wasm/math_wasm_base64":8,"./utils":11}],2:[function(t,e,i){e.exports=function(t,e,i){for(var n,o,r,a,s,l=e*i,h=new Uint16Array(l),d=0;d=o&&n>=r?n:o>=r&&o>=n?o:r,a=n<=o&&n<=r?n:o<=r&&o<=n?o:r,h[d]=257*(s+a)>>1;return h}},{}],3:[function(t,e,i){function n(t){return t<0?0:t>255?255:t}function o(t,e,i,o,r,a){var s,l,h,d,u,c,p,f,g,m,v,y=0,b=0;for(g=0;g0;p--)v=a[u++],d=d+v*t[f+3]|0,h=h+v*t[f+2]|0,l=l+v*t[f+1]|0,s=s+v*t[f]|0,f=f+4|0;e[b+3]=n(d+8192>>14),e[b+2]=n(h+8192>>14),e[b+1]=n(l+8192>>14),e[b]=n(s+8192>>14),b=b+4*o|0}b=4*(g+1)|0,y=(g+1)*i*4|0}}function r(t,e,i,o,r,a){var s,l,h,d,u,c,p,f,g,m,v,y=0,b=0;for(g=0;g0;p--)v=a[u++],d=d+v*t[f+3]|0,h=h+v*t[f+2]|0,l=l+v*t[f+1]|0,s=s+v*t[f]|0,f=f+4|0;e[b+3]=n(d+8192>>14),e[b+2]=n(h+8192>>14),e[b+1]=n(l+8192>>14),e[b]=n(s+8192>>14),b=b+4*o|0}b=4*(g+1)|0,y=(g+1)*i*4|0}}e.exports={convolveHorizontally:o,convolveVertically:r}},{}],4:[function(t,e,i){function n(t){return Math.round(t*((1<>1]+=n(1-y),w=0;w0&&0===p[_];)_--;if(P=h+w,T=_-w+1,A[I++]=P,A[I++]=T,L)for(m=w;m<=_;m++)A[I++]=p[m];else A.set(p.subarray(w,_+1),I),I+=T}else A[I++]=0,A[I++]=0}return A}},{"./resize_filter_info":5}],5:[function(t,e,i){e.exports=[{win:.5,filter:function(t){return t>=-.5&&t<.5?1:0}},{win:1,filter:function(t){if(t<=-1||t>=1)return 0;if(t>-1.1920929e-7&&t<1.1920929e-7)return 1;var e=t*Math.PI;return Math.sin(e)/e*(.54+.46*Math.cos(e/1))}},{win:2,filter:function(t){if(t<=-2||t>=2)return 0;if(t>-1.1920929e-7&&t<1.1920929e-7)return 1;var e=t*Math.PI;return Math.sin(e)/e*Math.sin(e/2)/(e/2)}},{win:3,filter:function(t){if(t<=-3||t>=3)return 0;if(t>-1.1920929e-7&&t<1.1920929e-7)return 1;var e=t*Math.PI;return Math.sin(e)/e*Math.sin(e/3)/(e/3); }}]},{}],6:[function(t,e,i){function n(t,e,i){for(var n=3,o=e*i*4|0;n2&&(a=2);var _=o(t,e,i),P=new Uint16Array(_);n(P,e,i,a);for(var T=r/100*4096+.5|0,E=257*s|0,C=e*i,x=0;x=E&&(w=4*x,l=t[w],h=t[w+1],d=t[w+2],g=l>=h&&l>=d?l:h>=l&&h>=d?h:d,f=l<=h&&l<=d?l:h<=l&&h<=d?h:d,p=257*(g+f)>>1,f===g?u=c=0:(c=p<=32767?4095*(g-f)/(g+f)|0:4095*(g-f)/(510-g-f)|0,u=l===g?65535*(h-d)/(6*(g-f))|0:h===g?21845+(65535*(d-l)/(6*(g-f))|0):43690+(65535*(l-h)/(6*(g-f))|0)),p+=T*b+2048>>12,p>65535?p=65535:p<0&&(p=0),0===c?l=h=d=p>>8:(v=p<=32767?p*(4096+c)+2048>>12:p+((65535-p)*c+2048>>12),m=2*p-v>>8,v>>=8,y=u+21845&65535,l=y>=43690?m:y>=32767?m+(6*(v-m)*(43690-y)+32768>>16):y>=10922?v:m+(6*(v-m)*y+32768>>16),y=65535&u,h=y>=43690?m:y>=32767?m+(6*(v-m)*(43690-y)+32768>>16):y>=10922?v:m+(6*(v-m)*y+32768>>16),y=u-21845&65535,d=y>=43690?m:y>=32767?m+(6*(v-m)*(43690-y)+32768>>16):y>=10922?v:m+(6*(v-m)*y+32768>>16)),t[w]=l,t[w+1]=h,t[w+2]=d)}}},{"./lightness16_js":2,"glur/mono16":13}],8:[function(t,e,i){e.exports="AGFzbQEAAAABlICAgAACYAZ/f39/f38AYAd/f39/f39/AAKPgICAAAEDZW52Bm1lbW9yeQIAAQODgICAAAIAAQSEgICAAAFwAAAHmYCAgAACCGNvbnZvbHZlAAAKY29udm9sdmVIVgABCYGAgIAAAArtg4CAAALBg4CAAAEQfwJAIANFDQAgBEUNACAFQQRqIRVBACEMQQAhDQNAIA0hDkEAIRFBACEHA0AgB0ECaiESAn8gBSAHQQF0IgdqIgZBAmouAQAiEwRAQQAhCEEAIBNrIRQgFSAHaiEPIAAgDCAGLgEAakECdGohEEEAIQlBACEKQQAhCwNAIBAoAgAiB0EYdiAPLgEAIgZsIAtqIQsgB0H/AXEgBmwgCGohCCAHQRB2Qf8BcSAGbCAKaiEKIAdBCHZB/wFxIAZsIAlqIQkgD0ECaiEPIBBBBGohECAUQQFqIhQNAAsgEiATagwBC0EAIQtBACEKQQAhCUEAIQggEgshByABIA5BAnRqIApBgMAAakEOdSIGQf8BIAZB/wFIG0EQdEGAgPwHcUEAIAZBAEobIAtBgMAAakEOdSIGQf8BIAZB/wFIG0EYdEEAIAZBAEobciAJQYDAAGpBDnUiBkH/ASAGQf8BSBtBCHRBgP4DcUEAIAZBAEobciAIQYDAAGpBDnUiBkH/ASAGQf8BSBtB/wFxQQAgBkEAShtyNgIAIA4gA2ohDiARQQFqIhEgBEcNAAsgDCACaiEMIA1BAWoiDSADRw0ACwsLoYCAgAAAAkBBACACIAMgBCAFIAAQACACQQAgBCAFIAYgARAACws="},{}],9:[function(t,e,i){function n(t,e){this.create=t,this.available=[],this.acquired={},this.lastId=1,this.timeoutId=0,this.idle=e||2e3}var o=100;n.prototype.acquire=function(){var t=this,e=void 0;return 0!==this.available.length?e=this.available.pop():(e=this.create(),e.id=this.lastId++,e.release=function(){return t.release(e)}),this.acquired[e.id]=e,e},n.prototype.release=function(t){var e=this;delete this.acquired[t.id],t.lastUsed=Date.now(),this.available.push(t),0===this.timeoutId&&(this.timeoutId=setTimeout(function(){return e.gc()},o))},n.prototype.gc=function(){var t=this,e=Date.now();this.available=this.available.filter(function(i){return!(e-i.lastUsed>t.idle)||(i.destroy(),!1)}),0!==this.available.length?this.timeoutId=setTimeout(function(){return t.gc()},o):this.timeoutId=0},e.exports=n},{}],10:[function(t,e,i){function n(t){var e=Math.round(t);return Math.abs(t-e)=t.toWidth&&(s=t.toWidth-e),i=a-t.destTileBorder,i<0&&(i=0),l=a+p+t.destTileBorder-i,i+l>=t.toHeight&&(l=t.toHeight-i),h={toX:e,toY:i,toWidth:s,toHeight:l,toInnerX:r,toInnerY:a,toInnerWidth:c,toInnerHeight:p,offsetX:e/d-n(e/d),offsetY:i/u-n(i/u),scaleX:d,scaleY:u,x:n(e/d),y:n(i/u),width:o(s/d),height:o(l/u)},f.push(h);return f}},{}],11:[function(t,e,i){function n(t){return Object.prototype.toString.call(t)}e.exports.isCanvas=function(t){var e=n(t);return"[object HTMLCanvasElement]"===e||"[object Canvas]"===e},e.exports.isImage=function(t){return"[object HTMLImageElement]"===n(t)},e.exports.limiter=function(t){function e(){i>16&255),n.push(r>>8&255),n.push(255&r)),r=r<<6|o.indexOf(e.charAt(a));var s=i%4*6;return 0===s?(n.push(r>>16&255),n.push(r>>8&255),n.push(255&r)):18===s?(n.push(r>>10&255),n.push(r>>2&255)):12===s&&n.push(r>>4&255),new Uint8Array(n)}},{}],12:[function(t,e,i){e.exports=function(){var e=t("./mathlib"),i=void 0,n={};onmessage=function(t){var o=t.data.opts;i||(i=new e(t.data.features,t.data.preload)),i.init(function(t){if(t)return void postMessage({err:t});var e=i.resizeAndUnsharp(o,n);postMessage({result:e},[e.buffer])})}}},{"./mathlib":1}],13:[function(t,e,i){function n(t){t<.5&&(t=.5);var e=Math.exp(.527076)/t,i=Math.exp(-e),n=Math.exp(-2*e),o=(1-i)*(1-i)/(1+2*e*i-n);return a=o,s=o*(e-1)*i,l=o*(e+1)*i,h=-o*n,d=2*i,u=-n,c=(a+s)/(1-d-u),p=(l+h)/(1-d-u),new Float32Array([a,s,l,h,d,u,c,p])}function o(t,e,i,n,o,r){var a,s,l,h,d,u,c,p,f,g,m,v,y,b;for(f=0;f=0;g--)l=s*m+a*v+h*y+d*b,d=h,h=l,a=s,s=t[u],e[c]=i[p]+h,u--,p--,c-=r}}function r(t,e,i,r){if(r){var a=new Uint16Array(t.length),s=new Float32Array(Math.max(e,i)),l=n(r);o(t,a,s,l,e,i,r),o(a,t,s,l,i,e,r)}}var a,s,l,h,d,u,c,p;e.exports=r},{}],14:[function(t,e,i){function n(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function o(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},i=0;i<10;i++)e["_"+String.fromCharCode(i)]=i;var n=Object.getOwnPropertyNames(e).map(function(t){return e[t]});if("0123456789"!==n.join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(t){o[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(r){return!1}}var r=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable;e.exports=o()?Object.assign:function(t,e){for(var i,o,l=n(t),h=1;h=0)}catch(f){}var g=1;"undefined"!=typeof navigator&&(g=Math.min(navigator.hardwareConcurrency||1,4));var m={tile:1024,concurrency:g,features:["js","wasm","ww"],idle:2e3},v={quality:3,alpha:!1,unsharpAmount:0,unsharpRadius:0,unsharpThreshold:0},y=void 0,b=void 0;o.prototype.init=function(){var e=this;if(this.__initPromise)return this.__initPromise;if(y!==!1&&y!==!0&&(y=!1,"undefined"!=typeof ImageData&&"undefined"!=typeof Uint8ClampedArray))try{new ImageData(new Uint8ClampedArray(400),10,10),y=!0}catch(i){}b!==!1&&b!==!0&&(b=!1,"undefined"!=typeof ImageBitmap&&(ImageBitmap.prototype&&ImageBitmap.prototype.close?b=!0:this.debug("ImageBitmap does not support .close(), disabled")));var o=this.options.features.slice();if(o.indexOf("all")>=0&&(o=["cib","wasm","js","ww"]),this.__requested_features=o,this.__mathlib=new s(o),o.indexOf("ww")>=0&&"undefined"!=typeof window&&"Worker"in window)try{var a=t("webworkify")(function(){});a.terminate(),this.features.ww=!0;var d="wp_"+JSON.stringify(this.options);c[d]?this.__workersPool=c[d]:(this.__workersPool=new l(n,this.options.idle),c[d]=this.__workersPool)}catch(i){}var u=this.__mathlib.init().then(function(t){r(e.features,t.features)}),p=void 0;return p=b?h.cib_support().then(function(t){return e.features.cib&&o.indexOf("cib")<0?void e.debug("createImageBitmap() resize supported, but disabled by config"):void(o.indexOf("cib")>=0&&(e.features.cib=t))}):Promise.resolve(!1),this.__initPromise=Promise.all([u,p]).then(function(){return e}),this.__initPromise},o.prototype.resize=function(t,e,i){var n=this;this.debug("Start resize...");var o=v;isNaN(i)?i&&(o=r(o,i)):o=r(o,{quality:i}),o.toWidth=e.width,o.toHeigth=e.height,o.width=t.naturalWidth||t.width,o.height=t.naturalHeight||t.height;var a=!1,s=null;o.cancelToken&&(s=o.cancelToken.then(function(t){throw a=!0,t},function(t){throw a=!0,t}));var l=e.getContext("2d",{alpha:Boolean(o.alpha)});return this.init().then(function(){if(a)return s;if(n.features.cib)return n.debug("Resize via createImageBitmap()"),createImageBitmap(t,{resizeWidth:o.toWidth,resizeHeight:o.toHeigth,resizeQuality:h.cib_quality_name(o.quality)}).then(function(t){if(a)return s;if(!o.unsharpAmount)return l.drawImage(t,0,0),t.close(),l=null,n.debug("Finished!"),e;n.debug("Unsharp result");var i=document.createElement("canvas");i.width=o.toWidth,i.height=o.toHeigth;var r=i.getContext("2d",{alpha:Boolean(o.alpha)});r.drawImage(t,0,0),t.close();var h=r.getImageData(0,0,o.toWidth,o.toHeigth);return n.__mathlib.unsharp(h.data,o.toWidth,o.toHeigth,o.unsharpAmount,o.unsharpRadius,o.unsharpThreshold),l.putImageData(h,0,0),h=r=i=l=null,n.debug("Finished!"),e});var i=void 0,r=void 0,d={},c=function(t){return Promise.resolve().then(function(){return n.features.ww?new Promise(function(e,i){var o=n.__workersPool.acquire();s&&s["catch"](function(t){return i(t)}),o.value.onmessage=function(t){o.release(),t.data.err?i(t.data.err):e(t.data.result)},o.value.postMessage({opts:t,features:n.__requested_features,preload:{wasm_nodule:n.__mathlib.__}},[t.src.buffer])}):n.__mathlib.resizeAndUnsharp(t,d)})},f=function(e){return n.__limit(function(){if(a)return s;var d=void 0;if(h.isCanvas(t))n.debug("Get tile pixel data"),d=i.getImageData(e.x,e.y,e.width,e.height);else{n.debug("Draw tile imageBitmap/image to temporary canvas");var u=document.createElement("canvas");u.width=e.width,u.height=e.height;var f=u.getContext("2d",{alpha:Boolean(o.alpha)});f.globalCompositeOperation="copy",f.drawImage(r||t,e.x,e.y,e.width,e.height,0,0,e.width,e.height),n.debug("Get tile pixel data"),d=f.getImageData(0,0,e.width,e.height),f=u=null}var g={src:d.data,width:e.width,height:e.height,toWidth:e.toWidth,toHeight:e.toHeight,scaleX:e.scaleX,scaleY:e.scaleY,offsetX:e.offsetX,offsetY:e.offsetY,quality:o.quality,alpha:o.alpha,unsharpAmount:o.unsharpAmount,unsharpRadius:o.unsharpRadius,unsharpThreshold:o.unsharpThreshold};return n.debug("Invoke resize math"),Promise.resolve().then(function(){return c(g)}).then(function(t){if(a)return s;d=null;var i=void 0;if(n.debug("Convert raw rgba tile result to ImageData"),y)i=new ImageData(new Uint8ClampedArray(t),e.toWidth,e.toHeight);else if(i=l.createImageData(e.toWidth,e.toHeight),i.data.set)i.data.set(t);else for(var o=i.data.length-1;o>=0;o--)i.data[o]=t[o];return n.debug("Draw tile"),p?l.putImageData(i,e.toX,e.toY,e.toInnerX-e.toX,e.toInnerY-e.toY,e.toInnerWidth+1e-5,e.toInnerHeight+1e-5):l.putImageData(i,e.toX,e.toY,e.toInnerX-e.toX,e.toInnerY-e.toY,e.toInnerWidth,e.toInnerHeight),null})})};return Promise.resolve().then(function(){if(h.isCanvas(t))return i=t.getContext("2d",{alpha:Boolean(o.alpha)}),null;if(h.isImage(t))return b?(n.debug("Decode image via createImageBitmap"),createImageBitmap(t).then(function(t){r=t})):null;throw new Error('".from" should be image or canvas')}).then(function(){function t(){r&&(r.close(),r=null)}if(a)return s;n.debug("Calculate tiles");var i=3,l=u({width:o.width,height:o.height,srcTileSize:n.options.tile,toWidth:o.toWidth,toHeight:o.toHeigth,destTileBorder:Math.ceil(Math.max(i,2.5*o.unsharpRadius|0))}),h=l.map(function(t){return f(t)});return n.debug("Process tiles"),Promise.all(h).then(function(){return n.debug("Finished!"),t(),e},function(e){throw t(),e})})})},o.prototype.resizeBuffer=function(t){var e=this,i=r(v,t);return this.init().then(function(){return e.__mathlib.resizeAndUnsharp(i)})},o.prototype.toBlob=function(t,e,i){return e=e||"image/png",new Promise(function(n){if(t.toBlob)return void t.toBlob(function(t){return n(t)},e,i);for(var o=atob(t.toDataURL(e,i).split(",")[1]),r=o.length,a=new Uint8Array(r),s=0;si.right)&&!(e>i.bottom)))}var n=this.getBorderHolder().getBoundingClientRect();if(!i(t,e,n)){var o=this.getNoteManager().containers;for(var r in o){var a=o[r];if(this.getBorderHolder()!==a.container&&i(t,e,a.container.getBoundingClientRect())){var s=a.container.getElementsByClassName("content-container");if(1===s.length){var l=s[0];l.appendChild(this.container),n=a.container.getBoundingClientRect(),this.presenter.toggleOffset();var h=this.idsEventName(_["default"].CHANGE_TEXT_EVENT);(0,_["default"])().off(this.idsEventName(_["default"].DELETE_EVENT),this.deleteNoteBubble,this),(0,_["default"])().off(h,this.setText,this),this.model.setIsRight(!this.model.isRight),this.presenter.setPageId(a.pageId);var d=this.idsEventName(_["default"].CHANGE_TEXT_EVENT);(0,_["default"])().on(d,this.setText,this),(0,_["default"])().on(this.idsEventName(_["default"].DELETE_EVENT),this.deleteNoteBubble,this)}}}}var u=g["default"].getBookSizes(this.model.bookSize,n,this.model.isZoomed,this.model.isWide,this.model.isRight),c={pX:Number(((t-n.left)/u.scales.scaleX+u.offset).toFixed(2)),pY:Number(((e-n.top)/u.scales.scaleY).toFixed(2))};this.model.setPosition(c)},o.prototype.getBookSizes=function(t,e,i,n,o){var r={bookSize:t,realSize:{width:e.right-e.left,height:e.bottom-e.top}};return i?(r.offset=0,n&&(r.realSize.width=r.realSize.width/2)):r.offset=n&&o?r.bookSize.width:0,r.scales={scaleX:r.realSize.width/r.bookSize.width,scaleY:r.realSize.height/r.bookSize.height},r},o.prototype.getDOMElement=function(){return this.container},o.prototype.commit=function(){this.render()},o.prototype._placeIcon=function(t){var e=g["default"].getBookSizes(this.model.bookSize,this.currentSize,this.model.isZoomed,this.model.isWide,this.model.isRight),i=Number(((this.model.note.pX-e.offset)*e.scales.scaleX).toFixed(2)),n=Number((this.model.note.pY*e.scales.scaleY).toFixed(2)),o=0,r=0,a=0,s=r+this.iconWidth/2,l=o+this.iconHeight/2,h=this.currentSize.width,d=this.currentSize.height,u={top:n,left:i,iconWidth:this.iconWidth,iconHeight:this.iconHeight,topShadow:o,sideShadow:r, bottomShadow:a};if(!(h>0&&d>0&&e.scales.scaleX>0&&e.scales.scaleY>0))return setTimeout(0,function(t){t._place()},this),null;if(i-s<0?i=0+s:i+s>h&&(i=h-s),n-l<0?n=0+l:n+l>d&&(n=d-l),!this.model.isZoomed&&this.presenter.isActive){var c=u.left+s>this.currentSize.width-100,p=u.left-s<100,f=u.top-l<100,m=u.top+l>this.currentSize.height-100;this.model.isRight?(c&&m||c&&f)&&(i=this.currentSize.width-100-s):(p&&m||p&&f)&&(i=100+s)}if(u.top=n,u.left=i,this.container.style.top=n+"px",this.container.style.left=i+"px",this.icon){var v={left:parseInt(this.container.parentNode.parentNode.style.marginLeft,10),top:parseInt(this.container.parentNode.parentNode.style.marginTop,10)};this.icon.style.left=Math.round(-s-v.left)+"px",this.icon.style.top=Math.round(-l-v.top)+"px"}return u},o.prototype._getAreaContainer=function(){var t=(0,u["default"])().get(u["default"].CURRENT_PRESENTER);return t.constructor===v["default"]?t.view.flipbook:t.view.currentWrapper?t.view.currentWrapper.content:null},o.prototype._placeArea=function(t,e){var i=this._getAreaContainer();if(i){var n=i.getBoundingClientRect(),o=n.right-n.left,r=n.bottom-n.top,a={x:e.left,y:e.top};a=g["default"].localToGlobal(t.getBoundingClientRect(),a),a=g["default"].globalToLocal(n,a);var s=0;a.x+this.areaWidth/2>o?s=o-(a.x+this.areaWidth/2):a.x-this.areaWidth/2<0&&(s=-(a.x-this.areaWidth/2));var l=a.y+e.iconHeight/2;a.y+e.iconHeight+this.areaHeight>r&&(l=a.y-e.iconHeight/2-this.areaHeight);var h={left:a.x-this.areaWidth/2+s,right:a.x+this.areaWidth/2+s,top:l,bottom:l+this.areaHeight};!this.model.isZoomed&&this.presenter.isActive&&(g["default"].isPointInsideRect({x:o-100,y:100},h)?h.left=o-100-this.areaWidth:g["default"].isPointInsideRect({x:o-100,y:r-100},h)?a.x>o-100?h.top=a.y-e.iconHeight/2-this.areaHeight-10:h.left=o-100-this.areaWidth:g["default"].isPointInsideRect({x:100,y:100},h)?h.left=100:g["default"].isPointInsideRect({x:100,y:r-100},h)&&(a.x<100?h.top=a.y-e.iconHeight/2-this.areaHeight-10:h.left=100)),this.noteRect&&(this.noteRect.style.top=h.top+"px",this.noteRect.style.left=h.left+"px")}},o.prototype._calculateSizes=function(){this.areaWidth=230,this.areaHeight=125,this.currentSize&&(this.areaWidth=Math.min(this.areaWidth,.8*this.currentSize.width),this.areaHeight=Math.min(this.areaHeight,.4*this.currentSize.height)),this.iconWidth=32,this.iconHeight=32},o.prototype._place=function(){if(this.container){this._calculateSizes();var t=this.getBorderHolder();if(t){var e=this._placeIcon(t);e&&this._placeArea(t,e)}}},o.prototype.getUserAgentInfo=function(){return(0,u["default"])().get(u["default"].USER_AGENT_INFO)},o.prototype.getLocaleProvider=function(){return(0,u["default"])().get(u["default"].LOCALE)},o.prototype.getNoteManager=function(){return(0,u["default"])().get(u["default"].NOTE_MANAGER)},o.prototype.contextMenu=function(){return(0,u["default"])().get(u["default"].CONTEXT_MENU)},o.prototype.getBookState=function(){return(0,u["default"])().get(u["default"].BOOK_STATE)},o.MINIMIZED_STATE="MINIMIZED_STATE",o.OPENED_STATE="OPENED_STATE",o.MOVING_STATE="MOVING_STATE",o.REMOVED_STATE="REMOVED_STATE",e["default"]=o},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){this.pageNumber=e.pageNumber,this.linkModel=t,this.pageTable=e.pageTable,this.crossWide=e.crossWide,this.id=e.id,this.isZoomed=e.isZoomed}Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=n(r);o.prototype.getTitle=function(){var t=-1;if(this.linkModel.tooltipEnabled!==!1){if(!a["default"].isUndefined(this.linkModel.url))return t=this.linkModel.url.indexOf("?"),t>-1?this.linkModel.url.substr(0,t):this.linkModel.url;if(!a["default"].isUndefined(this.linkModel.id))return""+this.pageTable.getPageCaptionById(this.linkModel.id)}return""},o.prototype.isInternal=function(){return!a["default"].isUndefined(this.linkModel.id)},o.prototype.getUrl=function(){return this.linkModel.url?this.linkModel.url:this.linkModel.id?"fb-internal://"+this.linkModel.id:"#"},o.prototype.getTarget=function(){return this.linkModel.target||"_self"},o.prototype.getBackgroundColor=function(){return this.linkModel.color||"#75869C"},o.prototype.getZIndex=function(){return this.linkModel.zIndex||0},o.prototype.getAngle=function(){return this.linkModel.angle||0},o.prototype.shouldBeHighlightedOnHover=function(){return this.linkModel.highlightOnHover},o.prototype.shouldBeHighlightedOnFlip=function(){return this.linkModel.highlightOnFlip},o.prototype.getRect=function(){return{width:this.linkModel.rect[0],height:this.linkModel.rect[1],left:this.linkModel.rect[2],top:this.linkModel.rect[3]}},o.prototype.getPageNumber=function(){return this.pageNumber},o.prototype.getPageIndexById=function(t){return this.pageTable.getPageIndexById(t)+1},o.prototype.getUrlHeader=function(){var t=this.pageTable.getPageIdByIndex(this.pageNumber);return this.pageTable.getUrlHeaderById(t)},o.prototype.getUrlHeaderById=function(t){return this.pageTable.getUrlHeaderById(t)},e["default"]=o},function(t,e,i){"use strict";(function(t){function n(t){return t&&t.__esModule?t:{"default":t}}function o(t){a["default"].call(this,t)}Object.defineProperty(e,"__esModule",{value:!0});var r=i(14),a=n(r),s=i(70),l=n(s),h=i(4),d=n(h),u=i(3),c=n(u),p=i(19),f=n(p),g=i(9),m=i(5),v=n(m);o.prototype=new a["default"],o.prototype.constructor=o,o.prototype.getBookState=function(){return(0,c["default"])().get(c["default"].BOOK_STATE)},o.prototype.getVideoState=function(){return this.getBookState().getVideoState(this.model.getPageId(),this.model.videoModel.id)},o.prototype.stopVideo=function(){return this.getBookState().stop(this.model.getPageId(),this.model.videoModel.id)},o.prototype.startVideo=function(){return this.getBookState().start(this.model.getPageId(),this.model.videoModel.id)},o.prototype.init=function(){this.iframeId=this.model.getIframeId(),this.view=new l["default"](this).init(this.getViewData());var t=this;this.thumbnail=new Image,this.thumbnail.setAttribute("draggable",!1),this.thumbnail.setAttribute("ondragstart","return false;");var e=(0,v["default"])().getCrossOrigin();return e&&(this.thumbnail.crossOrigin=e),this.thumbnail.onload=function(){t.view.setThumbnail(t.thumbnail),t.set("state",g.LoaderState.LOADED),t.thumbnail=null},this.thumbnail.onerror=function(e){t.set("state",g.LoaderState.ERROR),t.thumbnail=null},this.thumbnail.src=this.model.getThumbnailUrl(),this.thumbnail.className="thumbnail",this.set("state",g.LoaderState.LOADING),this.view.on("videoOpened",this._initVideoApi,this),this.view.on("videoClosed",this._onVideoClose,this),this},o.prototype.getViewData=function(){return{browser:this.model.getBrowser(),rect:this.model.getRect(),originalWidth:this.model.getOriginalWidth(),originalHeight:this.model.getOriginalHeight(),zIndex:this.model.getZIndex(),provider:this.model.getProvider(),mode:this.model.getMode(),state:this.model.state,autoplay:this.model.videoModel.autoplay,highlightColor:this.model.getHighlightColor(),iframeId:this.iframeId}},o.prototype.stopSaveTime=function(){this.interval&&clearInterval(this.interval),this.interval=!1},o.prototype.startSaveTime=function(){if(this.stopSaveTime(),this.isActive&&this.getVideoState()===f["default"].VIDEO_PLAYING){var t=this;this.interval=setInterval(function(){t.player.getCurrentTime&&(0,v["default"])().getSessionStorage().setItem(t.model.videoModel.id,parseInt(t.player.getCurrentTime()))},250)}},o.prototype._initVideoApi=function(e){var i=this.model.getBrowser();if(i&&i.publisher)return void this.getApiProvider().trigger("video",{action:"publisher",url:this.model.getApiVideoUrl()});var n,o=this,r=this.model.getProvider(),a=function(t){o.view.trigger("ready")};if("youtube"===r){var s=function(){var i=function(e){n.getCurrentTime&&(e.data===t.YT.PlayerState.PLAYING&&(o.startVideo(),o._onVideoPlay(Math.round(1e3*n.getCurrentTime())/1e3),o.startSaveTime()),e.data===t.YT.PlayerState.PAUSED&&(o.stopVideo(),o._onVideoPause(Math.round(1e3*n.getCurrentTime())/1e3),o.stopSaveTime()),e.data===t.YT.PlayerState.ENDED&&(o.stopVideo(),o._onVideoStop(Math.round(1e3*n.getCurrentTime())/1e3),o.stopSaveTime()))},r=function(){o.player=n=new t.YT.Player(e),o.startSaveTime(),o.on("change:isActive",function(t){o.startSaveTime()}),n.addEventListener("onStateChange",i),n.addEventListener("onReady",a)};t.YT&&t.YT.Player?r():t.onYouTubeIframeAPIReady=function(){r()}};t.onYouTubeIframeAPIReady?s():d["default"].loadScript("https://www.youtube.com/iframe_api",s)}if("vimeo"===r){var l=function(){n=new t.Vimeo.Player(e),n.getVideoHeight().then(function(t){o.view.set("height",t),o.view.set("height",t)}),n.getVideoWidth().then(function(t){o.view.set("width",t),o.view.set("width",t)});try{}catch(i){console.error("vimeo api does not work now")}n.on("play",function(t){o.startVideo(),o._onVideoPlay(t.seconds)}),n.on("pause",function(t){o.stopVideo(),o._onVideoPause(t.seconds)}),n.on("ended",function(t){o.stopVideo(),o._onVideoStop(t.seconds)}),n.on("seeked",function(t){o._onVideoSeekTo(t.seconds)}),n.on("loaded",a),n.on("timeupdate",function(t){t&&(0,v["default"])().getSessionStorage().setItem(o.model.videoModel.id,parseInt(t.seconds))})};t.Vimeo&&t.Vimeo.Player?l():d["default"].loadScript("https://player.vimeo.com/api/player.js",l)}if("wistia"===r){var h=function(){var t={id:o.iframeId,onEmbedded:function(t){o.apiBound||(t.bind("play",function(){o.startVideo(),o._onVideoPlay(t.time())}),t.bind("pause",function(){o.stopVideo(),o._onVideoPause(t.time())}),t.bind("seek",function(t){o._onVideoSeekTo(t)}),t.bind("end",function(){o.stopVideo(),o._onVideoStop(t.time())}),t.bind("secondchange",function(t){t&&(0,v["default"])().getSessionStorage().setItem(o.model.videoModel.id,t)}),o.apiBound=!0)},onReady:function(){a()}};window._wq=window._wq||[],window._wq.push(t)};window.Wistia?h():d["default"].loadScript("https://fast.wistia.com/assets/external/E-v1.js",h)}},o.prototype._onVideoPlay=function(t){this.getApiProvider().trigger("video",{action:"play",url:this.model.getApiVideoUrl(),time:t.toFixed(0)})},o.prototype._onVideoPause=function(t){this.getApiProvider().trigger("video",{action:"pause",url:this.model.getApiVideoUrl(),time:t.toFixed(0)})},o.prototype._onVideoStop=function(t){this.getApiProvider().trigger("video",{action:"stop",url:this.model.getApiVideoUrl(),time:t.toFixed(0)})},o.prototype._onVideoSeekTo=function(t){this.getApiProvider().trigger("video",{action:"seekTo",url:this.model.getApiVideoUrl(),time:t.toFixed(0)})},o.prototype._onVideoClose=function(){this.getApiProvider().trigger("video",{action:"close",url:this.model.getApiVideoUrl()})},e["default"]=o}).call(e,i(6))},function(t,e,i){"use strict";(function(t){function n(t){return t&&t.__esModule?t:{"default":t}}function o(t){l["default"].call(this,t)}Object.defineProperty(e,"__esModule",{value:!0});var r=i(2),a=n(r),s=i(13),l=n(s),h=i(18),d=n(h),u=i(0),c=n(u),p=i(4),f=n(p),g=i(3),m=n(g),v=i(19),y=n(v),b=i(71),w=n(b);o.prototype=new l["default"],o.prototype.constructor=o,o.prototype.isFullscreen=function(){return this.iframeContainer&&this.iframeContainer.fullScreen||this.iframeContainer.mozFullScreen||this.iframeContainer.webkitIsFullScreen||!!this.iframeContainer.msFullscreenElement},o.prototype.getBookState=function(){return(0,m["default"])().get(m["default"].BOOK_STATE)},o.prototype.createIFrame=function(t,e){if(this.iframeContainer||(this.iframeContainer=a["default"].createElement("iframe",{id:this.options.iframeId,"class":this.options.provider+"_embed",width:"100%",height:"100%",frameborder:0,allowfullscreen:"allowfullscreen",allow:"autoplay; fullscreen"})),this.options.browser.ie&&!this.firstLoaded){this.iframeContainer.style.visibility="hidden";var i=this;this.iframeContainer.onload=function(){this.style.visibility="visible",i.firstLoaded=!0}}this.iframeContainer.src=this.presenter.model.getVideoUrl(t,e)},o.prototype.createVideoButton=function(){if(!this.videoContainer){if(this.videoContainer=a["default"].createElement("div",{"class":"video",styles:{position:"absolute",width:"100%",height:"100%"}}),new t.Hammer(this.videoContainer,{}).on("tap",c["default"].bind(this._onVideoClick,this)),f["default"].addListener(this.videoContainer,"mousemove",function(t){t.stopPropagation()}),f["default"].addListener(this.videoContainer,"mousedown",function(t){t.stopPropagation()}),this.videoButton=a["default"].createElement("div",{"class":"playButton",styles:{"will-change":this.options.browser.safari?"opacity, transform":""}},this.videoContainer),this.updateThumbnail(),this.presenter.model.options.crossWide&&!this.presenter.model.options.isZoomed){var e=this,i=(0,m["default"])().get(m["default"].WIDE_HIGHLIGHTER),n=i.pushLink(this,this.presenter.model.options.pageNumber,this.presenter.model.options.id);n&&(this.reflection=n,n.reflection=this),this.videoContainer.onmouseover=this.videoButton.onmouseover=function(){a["default"].addClass(e.videoButton,"highlighted"),e.reflection&&a["default"].addClass(e.reflection.videoButton,"highlighted")},this.videoContainer.onmouseout=this.videoButton.onmouseout=function(){a["default"].removeClass(e.videoButton,"highlighted"),e.reflection&&a["default"].removeClass(e.reflection.videoButton,"highlighted")}}this.videoButton.innerHTML=w["default"]}},o.prototype.updateThumbnail=function(){if(this.thumbnail&&(this.presenter.model.videoModel.showImage||"dialog"!==this.options.mode)){this.videoContainer&&this.videoButton&&!this.thumbnail.parent&&this.videoContainer.insertBefore(this.thumbnail,this.videoButton);var t=this.presenter.model.getRect().width,e=this.thumbnail.naturalWidth,i=this.presenter.model.getRect().height,n=this.thumbnail.naturalHeight;if(!e||!n){var o=this;c["default"].defer(function(){o.updateThumbnail()})}var r=t/i>e/n;this.thumbnail.style.width=r?"100%":"auto",this.thumbnail.style.height=r?"auto":"100%",this.thumbnail.style.position="absolute";var a=r?t/e:i/n;r?this.thumbnail.style["margin-top"]=Math.floor(this.scaleFactor*(i-n*a)/2)+"px":this.thumbnail.style["margin-left"]=Math.floor(this.scaleFactor*(t-e*a)/2)+"px"}},o.prototype.setThumbnail=function(t){this.thumbnail=t,this.updateThumbnail()},o.prototype.init=function(t){var e=this;this.options={url:"",rect:null,zIndex:void 0,mode:"auto",provider:"youtube"},c["default"].extend(this.options,t);var i={position:"absolute",width:"100%",height:"100%"};return this.presenter.model.videoModel.showImage!==!1&&(i["background-color"]="#000000"),this.videoContainerSwitcher=a["default"].createElement("div",{"class":"video",styles:i}),c["default"].isUndefined(this.options.zIndex)||(this.videoContainerSwitcher.style.zIndex=this.options.zIndex),this.on("videoClosed",function(){"wistia"!==e.options.provider&&delete e.iframeContainer}),this.presenter.on("change:isActive",function(){this._place()},this),this._place(),this},o.prototype._onVideoClick=function(t){if(this.inDialog()){if(!this.options.browser.publisher){var e=function(){(0,d["default"])().lightbox&&i.width&&i.height&&(0,d["default"])()._sizing(!1)};this.createIFrame(!0,!1);var i=this;this.maxSizes=!1,(0,d["default"])().showFrame(this.iframeContainer,this),(0,d["default"])().once("closed",function(){this.trigger("videoClosed",this.iframeContainer)},this),this.on("change:width",e),this.on("change:height",e),e()}this.trigger("videoOpened",this.iframeContainer)}else this.addVideoWithImage();t.srcEvent.stopPropagation()},o.prototype.getDOMElement=function(){return this.videoContainerSwitcher},o.prototype.scale=function(t){l["default"].prototype.scale.call(this,t),this._place()},o.prototype.offset=function(t){l["default"].prototype.offset.call(this,t),this._place()},o.prototype.getRealHeight=function(){return(this.options.rect.height*this.scaleFactor).toFixed(2)},o.prototype.inDialog=function(){return"dialog"===this.options.mode||this.options.browser.safari||this.options.browser.publisher||this.getRealHeight()<144},o.prototype.isVideoPaused=function(){return this.options.autoplay&&this.presenter.getVideoState()===y["default"].VIDEO_STOPPED||!this.options.autoplay&&!(this.presenter.getVideoState()===y["default"].VIDEO_PLAYING)},o.prototype.addVideo=function(){this.videoContainerSwitcher.style["background-image"]="none",this.createIFrame(!0,!0),this.videoContainer&&this.videoContainerSwitcher===this.videoContainer.parentNode&&this.videoContainerSwitcher.removeChild(this.videoContainer),this.iframeContainer&&this.videoContainerSwitcher!==this.iframeContainer.parentNode&&(this.videoContainerSwitcher.appendChild(this.iframeContainer),this.trigger("videoOpened",this.iframeContainer))},o.prototype.removeVideo=function(){this.videoContainerSwitcher.style["background-image"]="none",this.iframeContainer&&this.videoContainerSwitcher===this.iframeContainer.parentNode&&(this.videoContainerSwitcher.removeChild(this.iframeContainer),this.trigger("videoClosed")),this.videoContainer&&this.videoContainerSwitcher===this.videoContainer.parentNode&&this.videoContainerSwitcher.removeChild(this.videoContainer)},o.prototype.addButtonWithImage=function(){this.createVideoButton(),this.videoContainer&&this.videoContainerSwitcher!==this.videoContainer.parentNode&&this.videoContainerSwitcher.appendChild(this.videoContainer),this.iframeContainer&&this.videoContainerSwitcher===this.iframeContainer.parentNode&&(this.videoContainerSwitcher.removeChild(this.iframeContainer),this.trigger("videoClosed"))},o.prototype.addVideoWithImage=function(){this.createIFrame(!0,!1),this.videoContainer&&this.videoContainerSwitcher===this.videoContainer.parentNode&&this.videoContainerSwitcher.removeChild(this.videoContainer),this.iframeContainer&&this.videoContainerSwitcher!==this.iframeContainer.parentNode&&(this.videoContainerSwitcher.appendChild(this.iframeContainer),this.trigger("videoOpened",this.iframeContainer))},o.prototype._place=function(){var t=this.options.rect;this.videoContainerSwitcher.style.width=(t.width*this.scaleFactor).toFixed(2)+"px",this.videoContainerSwitcher.style.height=this.getRealHeight()+"px",this.videoContainerSwitcher.style.left=((t.left+this.offsetFactor)*this.scaleFactor).toFixed(2)+"px",this.videoContainerSwitcher.style.top=(t.top*this.scaleFactor).toFixed(2)+"px",this.videoContainer&&(this.videoButton.style.maxWidth=Math.min(.5*t.width*this.scaleFactor,.5*t.height*this.scaleFactor).toFixed(0)+"px",this.videoButton.style.maxHeight=this.videoButton.style.maxWidth);var e=this.getBookState().getLastChanging();switch(this.updateThumbnail(),e){case y["default"].POSITION:case y["default"].NONE:!this.options.autoplay||this.inDialog()||this.isVideoPaused()?this.options.autoplay&&this.inDialog()?this.addButtonWithImage():this.options.autoplay&&!this.inDialog()&&this.isVideoPaused()?this.addButtonWithImage():this.addButtonWithImage():this.presenter.isActive?this.addVideo():this.removeVideo();break;case y["default"].ZOOM:case y["default"].FULLSCREEN:!this.options.autoplay||this.inDialog()||this.isVideoPaused()?this.options.autoplay?this.addButtonWithImage():this.options.autoplay||this.inDialog()||this.isVideoPaused()?this.addButtonWithImage():this.presenter.isActive?this.addVideoWithImage():this.removeVideo():this.presenter.isActive?this.addVideoWithImage():this.removeVideo()}},e["default"]=o}).call(e,i(6))},function(t,e){t.exports=''},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t,e,i){this.videoModel=t,this.options=e,this.linkProps=i}Object.defineProperty(e,"__esModule",{value:!0});var r=i(5),a=n(r);o.prototype.getStartFrom=function(){var t=this.videoModel.startFrom,e=(0,a["default"])().getSessionStorage().getItem(this.videoModel.id);return e&&(t=parseInt(e)),t},o.prototype.getVideoUrl=function(t,e){var i=this.videoModel.id,n=this.videoModel.provider,o=this.getStartFrom(),t=t,r={},a="",s={},l=function(t){var e=parseInt(t/3600,10)%24,i=parseInt(t/60,10)%60,t=t%60,n="";return e&&(n+=e+"h"),i&&(n+=i+"m"),n+=t+"s"};switch(n){case"youtube":a="https://www.youtube.com/embed/"+i,o?s.start=o:s.start=0,s.enablejsapi="1",s.version="3",s.rel="0",s.modestbranding="1",t&&(s.autoplay="1"),e&&(s.mute="1");break;case"vimeo":a="https://player.vimeo.com/video/"+i,o&&t?r.t=l(o):r.t=l(0),t&&(s.autoplay="1"),e&&(s.muted="1");break;case"wistia":a="https://fast.wistia.net/embed/iframe/"+i,o&&(s.time=l(o)),t&&(s.autoPlay="true"),e&&(s.silentAutoPlay="true"),s.googleAnalytics=!1;break;default:a=i,o?s.start=o:s.start=0}var h=function(t){var e=[];for(var i in t)t.hasOwnProperty(i)&&e.push(encodeURIComponent(i)+"="+encodeURIComponent(t[i]));return e.join("&")},d=h(s),u=h(r);return a+(d.length>0?"?"+d:"")+(u?"#"+u:"")},o.prototype.getApiVideoUrl=function(){var t=this.videoModel.id,e=this.videoModel.provider,i=this.videoModel.account,n="";switch(e){case"youtube":n="https://www.youtube.com/watch?v="+t;break;case"vimeo":n="https://vimeo.com/"+t;break;case"wistia":n="https://"+i+".wistia.com/medias/"+t;break;default:n=t}return n},o.prototype.getRect=function(){return{width:this.videoModel.rect[0],height:this.videoModel.rect[1],left:this.videoModel.rect[2],top:this.videoModel.rect[3]}},o.prototype.getOriginalWidth=function(){return this.videoModel.width},o.prototype.getOriginalHeight=function(){return this.videoModel.height},o.prototype.getIframeId=function(){return this.videoModel.provider+"_"+this.videoModel.id+"_"+(1e3*Math.random()).toFixed(0)},o.prototype.getZIndex=function(){return this.videoModel.zIndex||0},o.prototype.getStartTime=function(){return this.videoModel.startFrom},o.prototype.getProvider=function(){return this.videoModel.provider},o.prototype.getBrowser=function(){return this.options?this.options.browser:void 0},o.prototype.getPageId=function(){return this.options?this.options.pageId:void 0},o.prototype.getMode=function(){return this.options.crossWide?"dialog":this.videoModel.mode||"auto"},o.prototype.getThumbnailUrl=function(){return this.videoModel.image?(0,a["default"])().translatePath("assets/common/pages-content/"+this.videoModel.image):""},o.prototype.getHighlightColor=function(){return this.linkProps.color},e["default"]=o},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t){a["default"].call(this,t)}Object.defineProperty(e,"__esModule",{value:!0});var r=i(14),a=n(r),s=i(74),l=n(s);o.prototype=Object.create(a["default"].prototype),o.prototype.init=function(){return this.view=new l["default"](this).init(this.getViewData()),this},o.prototype.getViewData=function(){return{id:this.model.getId(),urls:this.getImageUrls(),rect:this.model.getRect(),rotation:this.model.getRotation(),zIndex:this.model.getZIndex(),thumbnailUrl:this.getThumbnailUrl(),highlightOnHover:this.model.shouldBeHighlightedOnHover(),highlightOnFlip:this.model.shouldBeHighlightedOnFlip(),highlightColor:this.model.getHighlightColor(),showIcon:this.model.getShowIcon(),crossWide:this.model.getCrossWide(),pageId:this.model.getPageId(),browser:this.model.getBrowser(),isZoomed:this.model.isZoomed()}},o.prototype.getImageUrls=function(){return this.model.getImageUrls()},o.prototype.getThumbnailUrl=function(){return this.model.getThumbnailUrl()},o.prototype.onImageClick=function(){this.getApiProvider().trigger("image",{action:"click",url:this.model.getImageFileNames()[0]})},o.prototype.onImageLoaded=function(){this.getApiProvider().trigger("image",{action:"loaded",url:this.model.getImageFileNames()[0]})},e["default"]=o},function(t,e,i){"use strict";(function(t){function n(t){return t&&t.__esModule?t:{"default":t}}function o(t){c["default"].call(this,t)}Object.defineProperty(e,"__esModule",{value:!0});var r=i(2),a=n(r),s=i(10),l=n(s),h=i(0),d=n(h),u=i(13),c=n(u),p=i(4),f=n(p),g=i(18),m=n(g),v=i(75),y=n(v),b=i(3),w=n(b);o.prototype=Object.create(c["default"].prototype),o.prototype.init=function(e){var i={urls:[],rect:null,thumbnailUrl:"",rotation:0,zIndex:void 0,highlightOnHover:!0,highlightOnFlip:!0,highlightColor:"#3FC7FF",showIcon:!1,crossWide:!1},n=this;if(d["default"].extend(i,e),this.id=i.id,this.pageId=i.pageId,this.isZoomed=i.isZoomed,this.crossWide=i.crossWide,this.rect=i.rect,this.urls=i.urls,this.imageContainer=a["default"].createElement("div",{"class":"image"}),i.thumbnailUrl&&(this.imageThumbnail=a["default"].createElement("div",{"class":"image-inner scale-on-hover",styles:{"background-image":"url('"+this.presenter.getThumbnailUrl()+"')"}},this.imageContainer)),this.imageButton=a["default"].createElement("div",{"class":"playButton"+(i.showIcon?"":" hidden highlight-on-flip"),styles:{"will-change":i.browser.safari?"opacity, transform":""}},this.imageContainer),this.imageButton.innerHTML=y["default"],d["default"].isUndefined(i.zIndex)||(this.imageContainer.style.zIndex=i.zIndex),d["default"].isUndefined(i.rotation)||(l["default"].origin(this.imageContainer,0,0),l["default"].rotate(this.imageContainer,i.rotation+"rad",0,0,1,!0)),f["default"].addListener(this.imageContainer,"mousemove",function(t){t.stopPropagation()}),f["default"].addListener(this.imageContainer,"mousedown",function(t){t.stopPropagation()}),new t.Hammer(this.imageContainer,{}).on("tap",d["default"].bind(this._onImageClick,this)),this.crossWide&&!this.isZoomed){var o=(0,w["default"])().get(w["default"].WIDE_HIGHLIGHTER),r=o.pushLink(this,this.pageId,this.id);r&&(this.reflection=r,r.reflection=this),this.imageContainer.onmouseover=this.imageButton.onmouseover=function(){a["default"].addClass(n.imageButton,"highlighted"),a["default"].addClass(n.reflection.imageButton,"highlighted"),a["default"].addClass(n.reflection.imageContainer,"reflected")},this.imageContainer.onmouseout=this.imageButton.onmouseout=function(){a["default"].removeClass(n.imageButton,"highlighted"),a["default"].removeClass(n.reflection.imageButton,"highlighted"),a["default"].removeClass(n.reflection.imageContainer,"reflected")}}return this},o.prototype._onImageClick=function(t){if(this.urls&&this.urls.length){var e=document.createElement("img"),i=this;e.src=this.presenter.getImageUrls()[0],e.style.width="100%",this.width=146,this.height=146,this.maxSizes=!0,(0,m["default"])().showFrame(e,this),this.presenter.onImageClick(),e.onload=function(){(0,m["default"])().lightbox&&(i.width=e.naturalWidth,i.height=e.naturalHeight,i.width&&i.height&&(0,m["default"])()._sizing(!0),i.presenter.onImageLoaded())}}t.srcEvent.stopPropagation()},o.prototype.getDOMElement=function(){return this.imageContainer},o.prototype.scale=function(t){c["default"].prototype.scale.call(this,t),this._place()},o.prototype.offset=function(t){c["default"].prototype.offset.call(this,t),this._place()},o.prototype._place=function(){if(this.imageContainer.style.width=(this.rect.width*this.scaleFactor).toFixed(0)+"px",this.imageContainer.style.height=(this.rect.height*this.scaleFactor).toFixed(0)+"px",this.imageContainer.style.left=((this.rect.left+this.offsetFactor)*this.scaleFactor).toFixed(0)+"px",this.imageContainer.style.top=(this.rect.top*this.scaleFactor).toFixed(0)+"px",this.imageButton){var t=Math.min(.5*this.rect.width*this.scaleFactor,.5*this.rect.height*this.scaleFactor).toFixed(0)+"px";this.imageButton.style.maxWidth=t,this.imageButton.style.maxHeight=t}},e["default"]=o}).call(e,i(6))},function(t,e){t.exports=''},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){this.model=t,this.linkProps=e}Object.defineProperty(e,"__esModule",{value:!0});var r=i(5),a=n(r);o.prototype.getId=function(){return this.model.id},o.prototype.getCrossWide=function(){return this.model.crossWide},o.prototype.getPageId=function(){return this.model.pageId},o.prototype.isZoomed=function(){return this.model.isZoomed},o.prototype.getImageUrls=function(){for(var t=[],e=0,i=this.model.urls.length;e1)&&(o+=i.direction);var r=i.trail/100,a=1-o/r;if(a<0)return i.opacity;var s=1-i.opacity;return a*s+i.opacity}function r(t,e){if(void 0!==t.style[e])return e;var i="ms"+e.charAt(0).toUpperCase()+e.slice(1);return void 0!==t.style[i]?i:""}function a(t,e){for(var i in e)t.style[r(t,i)||i]=e[i];return t}function s(t,e){return"string"==typeof t?t:t[e%t.length]}function l(t,e){var i=Math.round(e.corners*e.width*500)/1e3+"px",n="none";e.shadow===!0?n="0 2px 4px #000":"string"==typeof e.shadow&&(n=e.shadow);for(var o=h(n),r=0;r1&&(h-=Math.floor(h)),e.el.childNodes.length===e.opts.lines)for(var a=0;a'},function(t,e){t.exports=''},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){this.model=t,this.linkProps=e}Object.defineProperty(e,"__esModule",{value:!0});var r=i(5),a=n(r);o.prototype.getId=function(){return this.model.id},o.prototype.getCrossWide=function(){return this.model.crossWide},o.prototype.getPageId=function(){return this.model.pageId},o.prototype.isZoomed=function(){return this.model.isZoomed},o.prototype.getGifUrl=function(){var t=this.model.loop===!1?"?rand="+(1e6*Math.random()).toFixed():"";return this.model.url?(0,a["default"])().translatePath("assets/common/pages-content/"+this.model.url+t):void 0},o.prototype.getPreviewUrl=function(){return this.model.previewUrl?(0,a["default"])().translatePath("assets/common/pages-content/"+this.model.previewUrl):void 0},o.prototype.getFileName=function(){return this.model.url},o.prototype.getRotation=function(){return this.model.rotation||0},o.prototype.getZIndex=function(){return this.model.zIndex||0},o.prototype.getRect=function(){return{width:this.model.rect[0],height:this.model.rect[1],left:this.model.rect[2],top:this.model.rect[3]}},o.prototype.getLoop=function(){return this.model.loop},o.prototype.getAutoplay=function(){return this.model.autoplay},o.prototype.getDuration=function(){return this.model.duration},o.prototype.getHighlightColor=function(){return this.linkProps.color},o.prototype.getBrowser=function(){return this.model.browser},e["default"]=o},function(t,e,i){"use strict";(function(t){function n(t){return t&&t.__esModule?t:{"default":t}}function o(t){a["default"].call(this,t)}Object.defineProperty(e,"__esModule",{value:!0});var r=i(27),a=n(r),s=i(4),l=n(s),h=i(2),d=n(h),u=i(0),c=n(u),p=i(3),f=n(p),g=i(86),m=i(8),v=n(m),y=i(5),b=n(y);o.prototype=new a["default"],o.prototype.constructor=o,o.prototype.init=function(t,e){var i=this;this.root=t;var n={startPage:1,totalPages:1,bookSizeProvider:null,contentProvider:null,rightToLeft:!1,hardcover:!1,coverColor:"red",flipCorner:!1,lightFlipCorner:!1,pageFlippingDuration:600,size:{width:640,height:480},notes:!0};c["default"].extend(n,e),this.options=n,this.elementId="flipbook",this.targetName="turnjs-flipping-book",this.lastPageNum=this.presenter.model.getPageTable().getPagesCount(),l["default"].renderTemplate(this.root,v["default"]["workspace-book"],{type:this.elementId,notesEnabled:n.notes,rtl:n.rightToLeft,localization:{addNote:(0,f["default"])().get(f["default"].LOCALE).get("NotesToolWindow.ADD_NOTE")}}),this.presenter.model.on("CHANGE_NOTES_COMPONENT",function(t){t?d["default"].hasClass("icon-right-note","disabled")&&!(0,b["default"])().getLocalStorage().isStub&&d["default"].removeClass("icon-right-note","disabled"):d["default"].addClass("icon-right-note","disabled")},this),this.flipbook=d["default"].id(this.elementId),this.viewport=d["default"].id(this.elementId+"-viewport"),this.central=d["default"].id(this.elementId+"-viewport-central"),this._jqueryFlipbook=(0,g.$)("#"+this.elementId);var o=function(t){i.options.hardcover&&(t>=2?(0,g.$)("#"+i.elementId+" .front.cover.inside").addClass("fixed"):(0,g.$)("#"+i.elementId+" .front.cover.inside").removeClass("fixed"),t0&&(r.push(1),o>1&&r.push(2),o>2&&(i._jqueryFlipbook.turn("pages")%2===0?(r.push(o-1),r.push(o)):r.push(o))),(0,f["default"])().get(f["default"].LOAD_MANAGER).setBookRange([e,n],r)}}}),this.options.hardcover){var a=this._jqueryFlipbook.turn("pages");a>0&&(this.addPageContent(1),a>1&&(this._frontInsideCover=this.addPageContent(2)),a>2&&(this._jqueryFlipbook.turn("pages")%2===0?(this._backInsideCover=this.addPageContent(a-1),this.addPageContent(a)):this._backInsideCover=this.addPageContent(a)),o(n.startPage))}this._initNavigationEvents(),this.zoomMode=!1,this.setFlipCorner(this.options.flipCorner)},o.prototype.setFlipCorner=function(t){this.options.flipCorner!==t&&(this.options.flipCorner=t,t?this._startCorner():this._stopCorner())},o.prototype._startCorner=function(){var t=this._jqueryFlipbook;if(this.options.flipCorner){clearTimeout(this.timeout),clearInterval(this.interval),clearInterval(this.interval2);var e=this;e._cornerActive!==!0&&(e._cornerActive=!0,e.timeout=setTimeout(function(){e.options.lightFlipCorner?e.interval=setInterval(function(){e._cornerActive!==!1&&((0,g.$)(t).turn("peel",e.isRightToLeft()?"bl":"br",void 0,!1),clearInterval(e.interval))},900):e.interval=setInterval(function(){e._cornerActive!==!1&&((0,g.$)(t).turn("peel",e.isRightToLeft()?"bl":"br"),e.interval2=setTimeout(function(){(0,g.$)(t).turn("peel",!1)},450))},900)},1100))}},o.prototype._stopCorner=function(){clearTimeout(this.timeout),clearInterval(this.interval),clearInterval(this.interval2),this._cornerActive=!1},o.prototype.getContainer=function(){return this.flipbook},o.prototype.goToPage=function(t){this._jqueryFlipbook.turn("page",t)},o.prototype.isFlipping=function(){return t.cornerClickSemafor===!0},o.prototype.isRightToLeft=function(){return"rtl"===this._jqueryFlipbook.turn("direction")},o.prototype.addPageContent=function(t){if(this._jqueryFlipbook.turn("hasPage",t))return(0,g.$)("#"+this.elementId+" .p"+t).get(0);var e=t%2!==0,i=d["default"].createElement("div",{});1===t&&d["default"].addClass(i,"first"),t===this._jqueryFlipbook.turn("pages")&&d["default"].addClass(i,"last");var n=this._jqueryFlipbook.turn("page"),o=[],r={},a=i;if(this.options.hardcover){switch(t){case 1:o=["hard","front","cover"];break;case 2:o=["hard","front","cover","inside"],n>=2&&o.push("fixed");break;case this._jqueryFlipbook.turn("pages")-1:e&&(o=["hard","back","cover","inside"],n=0){i=o;break}if(e.isRightToLeft()&&o.presenter.isWide()&&n.indexOf("Left")>=0){i=o;break}i=i?parseInt(o.presenter.model.getPageNumber())>parseInt(i.presenter.model.getPageNumber())?o:i:o}var r=e.presenter.model.getBookModel(),a=r.noteData.getNotesOnPage(i.presenter.model.getPageId());if(i.presenter.view.parentObject){for(var s=r.getProps(),h=parseInt(s.bookSize.width,10),d=parseInt(s.bookSize.height,10),u=i.presenter.isWide()&&!e.isRightToLeft()?h:0,c=[],p=0;p0&&i<=t._jqueryFlipbook.turn("pages")&&(e[i]=(0,g.$)(".page-wrapper .p"+i).get(0))}),e},o.prototype.setCoverColor=function(t){this.options.coverColor=t,this._backInsideCover&&(this._backInsideCover.style.backgroundColor=t),this._frontInsideCover&&(this._frontInsideCover.style.backgroundColor=t)},o.prototype.getNoteManager=function(){return(0,f["default"])().get(f["default"].NOTE_MANAGER)},e["default"]=o}).call(e,i(6))},function(t,e){"use strict";function i(t){var e,i,n=D[t]={};for(t=t.split(/\s+/),e=0,i=t.length;e=0===i})}function d(t){var e=gt.split("|"),i=t.createDocumentFragment();if(i.createElement)for(;e.length;)i.createElement(e.pop());return i}function u(t,e){return z.nodeName(t,"table")?t.getElementsByTagName("tbody")[0]||t.appendChild(t.ownerDocument.createElement("tbody")):t}function c(t,e){if(1===e.nodeType&&z.hasData(t)){var i,n,o,r=z._data(t),a=z._data(e,r),s=r.events;if(s){delete a.handle,a.events={};for(i in s)for(n=0,o=s[i].length;n0){if("border"!==i)for(;o").appendTo(e),n=i.css("display");i.remove(),"none"!==n&&""!==n||(ge||(ge=O.createElement("iframe"),ge.frameBorder=ge.width=ge.height=0),e.appendChild(ge),me&&ge.createElement||(me=(ge.contentWindow||ge.contentDocument).document,me.write((z.support.boxModel?"":"")+""),me.close()),i=me.createElement(t),me.body.appendChild(i),n=z.css(i,"display"),e.removeChild(ge)),be[t]=n}return be[t]}function L(t){return z.isWindow(t)?t:9===t.nodeType&&(t.defaultView||t.parentWindow)}Object.defineProperty(e,"__esModule",{value:!0});var M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},O=window.document,N=window.navigator,R=window.location,z=function(){function t(){if(!r.isReady){try{O.documentElement.doScroll("left")}catch(e){return void setTimeout(t,1)}r.ready()}}var e,i,n,o,r=function R(t,i){return new R.fn.init(t,i,e)},a=window.jQuery,s=window.$,l=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,h=/\S/,d=/^\s+/,u=/\s+$/,c=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,p=/^[\],:{}\s]*$/,f=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,g=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,m=/(?:^|:|,)(?:\s*\[)+/g,v=/(webkit)[ \/]([\w.]+)/,y=/(opera)(?:.*version)?[ \/]([\w.]+)/,b=/(msie) ([\w.]+)/,w=/(mozilla)(?:.*? rv:([\w.]+))?/,_=/-([a-z]|[0-9])/gi,P=/^-ms-/,T=function(t,e){return(e+"").toUpperCase()},E=N.userAgent,C=Object.prototype.toString,x=Object.prototype.hasOwnProperty,S=Array.prototype.push,k=Array.prototype.slice,A=String.prototype.trim,I=Array.prototype.indexOf,L={};return r.fn=r.prototype={constructor:r,init:function(t,e,i){var n,o,a,s;if(!t)return this;if(t.nodeType)return this.context=this[0]=t,this.length=1,this;if("body"===t&&!e&&O.body)return this.context=O,this[0]=O.body,this.selector=t,this.length=1,this;if("string"==typeof t){if(n="<"===t.charAt(0)&&">"===t.charAt(t.length-1)&&t.length>=3?[null,t,null]:l.exec(t),!n||!n[1]&&e)return!e||e.jquery?(e||i).find(t):this.constructor(e).find(t);if(n[1])return e=e instanceof r?e[0]:e,s=e?e.ownerDocument||e:O,a=c.exec(t),a?r.isPlainObject(e)?(t=[O.createElement(a[1])],r.fn.attr.call(t,e,!0)):t=[s.createElement(a[1])]:(a=r.buildFragment([n[1]],[s]),t=(a.cacheable?r.clone(a.fragment):a.fragment).childNodes),r.merge(this,t);if(o=O.getElementById(n[2]), o&&o.parentNode){if(o.id!==n[2])return i.find(t);this.length=1,this[0]=o}return this.context=O,this.selector=t,this}return r.isFunction(t)?i.ready(t):(void 0!==t.selector&&(this.selector=t.selector,this.context=t.context),r.makeArray(t,this))},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return k.call(this,0)},get:function(t){return null==t?this.toArray():t<0?this[this.length+t]:this[t]},pushStack:function(t,e,i){var n=this.constructor();return r.isArray(t)?S.apply(n,t):r.merge(n,t),n.prevObject=this,n.context=this.context,"find"===e?n.selector=this.selector+(this.selector?" ":"")+i:e&&(n.selector=this.selector+"."+e+"("+i+")"),n},each:function(t,e){return r.each(this,t,e)},ready:function(t){return r.bindReady(),n.add(t),this},eq:function(t){return t=+t,t===-1?this.slice(t):this.slice(t,t+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(k.apply(this,arguments),"slice",k.call(arguments).join(","))},map:function(t){return this.pushStack(r.map(this,function(e,i){return t.call(e,i,e)}))},end:function(){return this.prevObject||this.constructor(null)},push:S,sort:[].sort,splice:[].splice},r.fn.init.prototype=r.fn,r.extend=r.fn.extend=function(){var t,e,i,n,o,a,s=arguments[0]||{},l=1,h=arguments.length,d=!1;for("boolean"==typeof s&&(d=s,s=arguments[1]||{},l=2),"object"===("undefined"==typeof s?"undefined":M(s))||r.isFunction(s)||(s={}),h===l&&(s=this,--l);l0)return;n.fireWith(O,[r]),r.fn.trigger&&r(O).trigger("ready").off("ready")}},bindReady:function(){if(!n){if(n=r.Callbacks("once memory"),"complete"===O.readyState)return setTimeout(r.ready,1);if(O.addEventListener)O.addEventListener("DOMContentLoaded",o,!1),window.addEventListener("load",r.ready,!1);else if(O.attachEvent){O.attachEvent("onreadystatechange",o),window.attachEvent("onload",r.ready);var e=!1;try{e=null==window.frameElement}catch(i){}O.documentElement.doScroll&&e&&t()}}},isFunction:function(t){return"function"===r.type(t)},isArray:Array.isArray||function(t){return"array"===r.type(t)},isWindow:function(t){return null!=t&&t==t.window},isNumeric:function(t){return!isNaN(parseFloat(t))&&isFinite(t)},type:function(t){return null==t?String(t):L[C.call(t)]||"object"},isPlainObject:function(t){if(!t||"object"!==r.type(t)||t.nodeType||r.isWindow(t))return!1;try{if(t.constructor&&!x.call(t,"constructor")&&!x.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(e){return!1}var i;for(i in t);return void 0===i||x.call(t,i)},isEmptyObject:function(t){for(var e in t)return!1;return!0},error:function(t){throw new Error(t)},parseJSON:function(t){return"string"==typeof t&&t?(t=r.trim(t),window.JSON&&window.JSON.parse?window.JSON.parse(t):p.test(t.replace(f,"@").replace(g,"]").replace(m,""))?new Function("return "+t)():void r.error("Invalid JSON: "+t)):null},parseXML:function(t){if("string"!=typeof t||!t)return null;var e,i;try{window.DOMParser?(i=new DOMParser,e=i.parseFromString(t,"text/xml")):(e=new ActiveXObject("Microsoft.XMLDOM"),e.async="false",e.loadXML(t))}catch(n){e=void 0}return e&&e.documentElement&&!e.getElementsByTagName("parsererror").length||r.error("Invalid XML: "+t),e},noop:function(){},globalEval:function(t){t&&h.test(t)&&(window.execScript||function(t){window.eval.call(window,t)})(t)},camelCase:function(t){return t.replace(P,"ms-").replace(_,T)},nodeName:function(t,e){return t.nodeName&&t.nodeName.toUpperCase()===e.toUpperCase()},each:function(t,e,i){var n,o=0,a=t.length,s=void 0===a||r.isFunction(t);if(i)if(s){for(n in t)if(e.apply(t[n],i)===!1)break}else for(;o0&&t[0]&&t[l-1]||0===l||r.isArray(t));if(h)for(;s1?B.call(arguments,0):e,--s||l.resolveWith(l,n)}}function i(t){return function(e){a[t]=arguments.length>1?B.call(arguments,0):e,l.notifyWith(h,a)}}var n=B.call(arguments,0),o=0,r=n.length,a=new Array(r),s=r,l=r<=1&&t&&z.isFunction(t.promise)?t:z.Deferred(),h=l.promise();if(r>1){for(;o
a",e=u.getElementsByTagName("*"),i=u.getElementsByTagName("a")[0],!e||!e.length||!i)return{};n=O.createElement("select"),o=n.appendChild(O.createElement("option")),r=u.getElementsByTagName("input")[0],t={leadingWhitespace:3===u.firstChild.nodeType,tbody:!u.getElementsByTagName("tbody").length,htmlSerialize:!!u.getElementsByTagName("link").length,style:/top/.test(i.getAttribute("style")),hrefNormalized:"/a"===i.getAttribute("href"),opacity:/^0.55/.test(i.style.opacity),cssFloat:!!i.style.cssFloat,checkOn:"on"===r.value,optSelected:o.selected,getSetAttribute:"t"!==u.className,enctype:!!O.createElement("form").enctype,html5Clone:"<:nav>"!==O.createElement("nav").cloneNode(!0).outerHTML,submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},z.boxModel=t.boxModel="CSS1Compat"===O.compatMode,r.checked=!0,t.noCloneChecked=r.cloneNode(!0).checked,n.disabled=!0,t.optDisabled=!o.disabled;try{delete u.test}catch(c){t.deleteExpando=!1}if(!u.addEventListener&&u.attachEvent&&u.fireEvent&&(u.attachEvent("onclick",function(){t.noCloneEvent=!1}),u.cloneNode(!0).fireEvent("onclick")),r=O.createElement("input"),r.value="t",r.setAttribute("type","radio"),t.radioValue="t"===r.value,r.setAttribute("checked","checked"),r.setAttribute("name","t"),u.appendChild(r),a=O.createDocumentFragment(),a.appendChild(u.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=r.checked,a.removeChild(r),a.appendChild(u),u.attachEvent)for(h in{submit:1,change:1,focusin:1})l="on"+h,d=l in u,d||(u.setAttribute(l,"return;"),d="function"==typeof u[l]),t[h+"Bubbles"]=d;return a.removeChild(u),a=n=o=u=r=null,z(function(){var e,i,n,o,r,a,l,h,c,p,f,g,m=O.getElementsByTagName("body")[0];m&&(l=1,g="padding:0;margin:0;border:",p="position:absolute;top:0;left:0;width:1px;height:1px;",f=g+"0;visibility:hidden;",h="style='"+p+g+"5px solid #000;",c="
",e=O.createElement("div"),e.style.cssText=f+"width:0;height:0;position:static;top:0;margin-top:"+l+"px",m.insertBefore(e,m.firstChild),u=O.createElement("div"),e.appendChild(u),u.innerHTML="
t
",s=u.getElementsByTagName("td"),d=0===s[0].offsetHeight,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=d&&0===s[0].offsetHeight,window.getComputedStyle&&(u.innerHTML="",a=O.createElement("div"),a.style.width="0",a.style.marginRight="0",u.style.width="2px",u.appendChild(a),t.reliableMarginRight=0===(parseInt((window.getComputedStyle(a,null)||{marginRight:0}).marginRight,10)||0)),"undefined"!=typeof u.style.zoom&&(u.innerHTML="",u.style.width=u.style.padding="1px",u.style.border=0,u.style.overflow="hidden",u.style.display="inline",u.style.zoom=1,t.inlineBlockNeedsLayout=3===u.offsetWidth,u.style.display="block",u.style.overflow="visible",u.innerHTML="
",t.shrinkWrapBlocks=3!==u.offsetWidth),u.style.cssText=p+f,u.innerHTML=c,i=u.firstChild,n=i.firstChild,o=i.nextSibling.firstChild.firstChild,r={doesNotAddBorder:5!==n.offsetTop,doesAddBorderForTableAndCells:5===o.offsetTop},n.style.position="fixed",n.style.top="20px",r.fixedPosition=20===n.offsetTop||15===n.offsetTop,n.style.position=n.style.top="",i.style.overflow="hidden",i.style.position="relative",r.subtractsBorderForOverflowNotVisible=n.offsetTop===-5,r.doesNotIncludeMarginInBodyOffset=m.offsetTop!==l,window.getComputedStyle&&(u.style.marginTop="1%",t.pixelMargin="1%"!==(window.getComputedStyle(u,null)||{marginTop:0}).marginTop),"undefined"!=typeof e.style.zoom&&(e.style.zoom=1),m.removeChild(e),a=u=e=null,z.extend(t,r))}),t}();var F=/^(?:\{.*\}|\[.*\])$/,W=/([A-Z])/g;z.extend({cache:{},uuid:0,expando:"jQuery"+(z.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(t){return t=t.nodeType?z.cache[t[z.expando]]:t[z.expando],!!t&&!o(t)},data:function(t,e,i,n){if(z.acceptData(t)){var o,r,a,s=z.expando,l="string"==typeof e,h=t.nodeType,d=h?z.cache:t,u=h?t[s]:t[s]&&s,c="events"===e;if(u&&d[u]&&(c||n||d[u].data)||!l||void 0!==i)return u||(h?t[s]=u=++z.uuid:u=s),d[u]||(d[u]={},h||(d[u].toJSON=z.noop)),"object"!==("undefined"==typeof e?"undefined":M(e))&&"function"!=typeof e||(n?d[u]=z.extend(d[u],e):d[u].data=z.extend(d[u].data,e)),o=r=d[u],n||(r.data||(r.data={}),r=r.data),void 0!==i&&(r[z.camelCase(e)]=i),c&&!r[e]?o.events:(l?(a=r[e],null==a&&(a=r[z.camelCase(e)])):a=r,a)}},removeData:function(t,e,i){if(z.acceptData(t)){var n,r,a,s=z.expando,l=t.nodeType,h=l?z.cache:t,d=l?t[s]:s;if(h[d]){if(e&&(n=i?h[d]:h[d].data)){z.isArray(e)||(e in n?e=[e]:(e=z.camelCase(e),e=e in n?[e]:e.split(" ")));for(r=0,a=e.length;r1,null,!1))},removeData:function(t){return this.each(function(){z.removeData(this,t)})}}),z.extend({_mark:function(t,e){t&&(e=(e||"fx")+"mark",z._data(t,e,(z._data(t,e)||0)+1))},_unmark:function(t,e,i){if(t!==!0&&(i=e,e=t,t=!1),e){i=i||"fx";var n=i+"mark",o=t?0:(z._data(e,n)||1)-1;o?z._data(e,n,o):(z.removeData(e,n,!0),r(e,i,"mark"))}},queue:function(t,e,i){var n;if(t)return e=(e||"fx")+"queue",n=z._data(t,e),i&&(!n||z.isArray(i)?n=z._data(t,e,z.makeArray(i)):n.push(i)),n||[]},dequeue:function(t,e){e=e||"fx";var i=z.queue(t,e),n=i.shift(),o={};"inprogress"===n&&(n=i.shift()),n&&("fx"===e&&i.unshift("inprogress"),z._data(t,e+".run",o),n.call(t,function(){z.dequeue(t,e)},o)),i.length||(z.removeData(t,e+"queue "+e+".run",!0),r(t,e,"queue"))}}),z.fn.extend({queue:function(t,e){var i=2;return"string"!=typeof t&&(e=t,t="fx",i--),arguments.length1)},removeAttr:function(t){return this.each(function(){z.removeAttr(this,t)})},prop:function(t,e){return z.access(this,z.prop,t,e,arguments.length>1)},removeProp:function(t){return t=z.propFix[t]||t,this.each(function(){try{this[t]=void 0,delete this[t]}catch(e){}})},addClass:function(t){var e,i,n,o,r,a,s;if(z.isFunction(t))return this.each(function(e){z(this).addClass(t.call(this,e,this.className))});if(t&&"string"==typeof t)for(e=t.split(X),i=0,n=this.length;i-1)return!0;return!1},val:function(t){var e,i,n,o=this[0];{if(arguments.length)return n=z.isFunction(t),this.each(function(i){var o,r=z(this);1===this.nodeType&&(o=n?t.call(this,i,r.val()):t,null==o?o="":"number"==typeof o?o+="":z.isArray(o)&&(o=z.map(o,function(t){return null==t?"":t+""})),e=z.valHooks[this.type]||z.valHooks[this.nodeName.toLowerCase()],e&&"set"in e&&void 0!==e.set(this,o,"value")||(this.value=o))});if(o)return e=z.valHooks[o.type]||z.valHooks[o.nodeName.toLowerCase()],e&&"get"in e&&void 0!==(i=e.get(o,"value"))?i:(i=o.value,"string"==typeof i?i.replace(Y,""):null==i?"":i)}}}),z.extend({valHooks:{option:{get:function(t){var e=t.attributes.value;return!e||e.specified?t.value:t.text}},select:{get:function(t){var e,i,n,o,r=t.selectedIndex,a=[],s=t.options,l="select-one"===t.type;if(r<0)return null;for(i=l?r:0,n=l?r+1:s.length;i=0}),i.length||(t.selectedIndex=-1),i}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(t,e,i,n){var o,r,a,s=t.nodeType;if(t&&3!==s&&8!==s&&2!==s)return n&&e in z.attrFn?z(t)[e](i):"undefined"==typeof t.getAttribute?z.prop(t,e,i):(a=1!==s||!z.isXMLDoc(t),a&&(e=e.toLowerCase(),r=z.attrHooks[e]||(K.test(e)?j:H)),void 0!==i?null===i?void z.removeAttr(t,e):r&&"set"in r&&a&&void 0!==(o=r.set(t,i,e))?o:(t.setAttribute(e,""+i),i):r&&"get"in r&&a&&null!==(o=r.get(t,e))?o:(o=t.getAttribute(e),null===o?void 0:o))},removeAttr:function(t,e){var i,n,o,r,a,s=0;if(e&&1===t.nodeType)for(n=e.toLowerCase().split(X),r=n.length;s=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*)?(?:\.(.+))?$/,tt=/(?:^|\s)hover(\.\S+)?\b/,et=/^key/,it=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,ot=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,rt=function(t){var e=ot.exec(t);return e&&(e[1]=(e[1]||"").toLowerCase(),e[3]=e[3]&&new RegExp("(?:^|\\s)"+e[3]+"(?:\\s|$)")),e},at=function(t,e){var i=t.attributes||{};return(!e[1]||t.nodeName.toLowerCase()===e[1])&&(!e[2]||(i.id||{}).value===e[2])&&(!e[3]||e[3].test((i["class"]||{}).value))},st=function(t){return z.event.special.hover?t:t.replace(tt,"mouseenter$1 mouseleave$1")};z.event={add:function(t,e,i,n,o){var r,a,s,l,h,d,u,c,p,f,g;if(3!==t.nodeType&&8!==t.nodeType&&e&&i&&(r=z._data(t))){for(i.handler&&(p=i,i=p.handler,o=p.selector),i.guid||(i.guid=z.guid++),s=r.events,s||(r.events=s={}),a=r.handle,a||(r.handle=a=function(t){return"undefined"==typeof z||t&&z.event.triggered===t.type?void 0:z.event.dispatch.apply(a.elem,arguments)},a.elem=t),e=z.trim(st(e)).split(" "),l=0;l=0&&(f=f.slice(0,-1),r=!0),f.indexOf(".")>=0&&(g=f.split("."),f=g.shift(),g.sort()),i&&!z.event.customEvent[f]||z.event.global[f]))if(t="object"===("undefined"==typeof t?"undefined":M(t))?t[z.expando]?t:new z.Event(f,t):new z.Event(f),t.type=f,t.isTrigger=!0,t.exclusive=r,t.namespace=g.join("."),t.namespace_re=t.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,h=f.indexOf(":")<0?"on"+f:"",i){if(t.result=void 0,t.target||(t.target=i),e=null!=e?z.makeArray(e):[],e.unshift(t),d=z.event.special[f]||{},!d.trigger||d.trigger.apply(i,e)!==!1){if(c=[[i,d.bindType||f]],!n&&!d.noBubble&&!z.isWindow(i)){for(p=d.delegateType||f,s=nt.test(p+f)?i:i.parentNode,l=null;s;s=s.parentNode)c.push([s,p]),l=s;l&&l===i.ownerDocument&&c.push([l.defaultView||l.parentWindow||window,p])}for(a=0;ac&&m.push({elem:this,matches:u.slice(c)}),e=0;e0?this.on(e,null,t,i):this.trigger(e)},z.attrFn&&(z.attrFn[e]=!0),et.test(e)&&(z.event.fixHooks[e]=z.event.keyHooks),it.test(e)&&(z.event.fixHooks[e]=z.event.mouseHooks)}),function(){function t(t,e,i,o,r,a){for(var s=0,l=o.length;s0){d=h;break}h=h[t]}o[s]=d}}}var i=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,n="sizcache"+(Math.random()+"").replace(".",""),o=0,r=Object.prototype.toString,a=!1,s=!0,l=/\\/g,h=/\r\n/g,d=/\W/;[0,0].sort(function(){return s=!1,0});var u=function(t,e,n,o){n=n||[],e=e||O;var a=e;if(1!==e.nodeType&&9!==e.nodeType)return[];if(!t||"string"!=typeof t)return n;var s,l,h,d,c,g,m,y,b=!0,w=u.isXML(e),P=[],T=t;do if(i.exec(""),s=i.exec(T),s&&(T=s[3],P.push(s[1]),s[2])){d=s[3];break}while(s);if(P.length>1&&f.exec(t))if(2===P.length&&p.relative[P[0]])l=_(P[0]+P[1],e,o);else for(l=p.relative[P[0]]?[e]:u(P.shift(),e);P.length;)t=P.shift(),p.relative[t]&&(t+=P.shift()),l=_(t,l,o);else if(!o&&P.length>1&&9===e.nodeType&&!w&&p.match.ID.test(P[0])&&!p.match.ID.test(P[P.length-1])&&(c=u.find(P.shift(),e,w),e=c.expr?u.filter(c.expr,c.set)[0]:c.set[0]),e)for(c=o?{expr:P.pop(),set:v(o)}:u.find(P.pop(),1!==P.length||"~"!==P[0]&&"+"!==P[0]||!e.parentNode?e:e.parentNode,w),l=c.expr?u.filter(c.expr,c.set):c.set,P.length>0?h=v(l):b=!1;P.length;)g=P.pop(),m=g,p.relative[g]?m=P.pop():g="",null==m&&(m=e),p.relative[g](h,m,w);else h=P=[];if(h||(h=l),h||u.error(g||t),"[object Array]"===r.call(h))if(b)if(e&&1===e.nodeType)for(y=0;null!=h[y];y++)h[y]&&(h[y]===!0||1===h[y].nodeType&&u.contains(e,h[y]))&&n.push(l[y]);else for(y=0;null!=h[y];y++)h[y]&&1===h[y].nodeType&&n.push(l[y]);else n.push.apply(n,h);else v(h,n);return d&&(u(d,a,n,o),u.uniqueSort(n)),n};u.uniqueSort=function(t){if(b&&(a=s,t.sort(b),a))for(var e=1;e0},u.find=function(t,e,i){var n,o,r,a,s,h;if(!t)return[];for(o=0,r=p.order.length;o":function(t,e){var i,n="string"==typeof e,o=0,r=t.length;if(n&&!d.test(e)){for(e=e.toLowerCase();o=0)?i||n.push(a):i&&(e[s]=!1));return!1},ID:function(t){return t[1].replace(l,"")},TAG:function(t,e){return t[1].replace(l,"").toLowerCase()},CHILD:function(t){if("nth"===t[1]){t[2]||u.error(t[0]),t[2]=t[2].replace(/^\+|\s*/g,"");var e=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec("even"===t[2]&&"2n"||"odd"===t[2]&&"2n+1"||!/\D/.test(t[2])&&"0n+"+t[2]||t[2]);t[2]=e[1]+(e[2]||1)-0,t[3]=e[3]-0}else t[2]&&u.error(t[0]);return t[0]=o++,t},ATTR:function(t,e,i,n,o,r){var a=t[1]=t[1].replace(l,"");return!r&&p.attrMap[a]&&(t[1]=p.attrMap[a]),t[4]=(t[4]||t[5]||"").replace(l,""),"~="===t[2]&&(t[4]=" "+t[4]+" "),t},PSEUDO:function(t,e,n,o,r){if("not"===t[1]){if(!((i.exec(t[3])||"").length>1||/^\w/.test(t[3]))){var a=u.filter(t[3],e,n,!0^r);return n||o.push.apply(o,a),!1}t[3]=u(t[3],null,null,e)}else if(p.match.POS.test(t[0])||p.match.CHILD.test(t[0]))return!0;return t},POS:function(t){return t.unshift(!0),t}},filters:{enabled:function(t){return t.disabled===!1&&"hidden"!==t.type},disabled:function(t){return t.disabled===!0},checked:function(t){return t.checked===!0},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,t.selected===!0},parent:function(t){return!!t.firstChild},empty:function(t){return!t.firstChild},has:function(t,e,i){return!!u(i[3],t).length},header:function(t){return/h\d/i.test(t.nodeName)},text:function(t){var e=t.getAttribute("type"),i=t.type;return"input"===t.nodeName.toLowerCase()&&"text"===i&&(e===i||null===e)},radio:function(t){return"input"===t.nodeName.toLowerCase()&&"radio"===t.type},checkbox:function(t){return"input"===t.nodeName.toLowerCase()&&"checkbox"===t.type},file:function(t){return"input"===t.nodeName.toLowerCase()&&"file"===t.type},password:function(t){return"input"===t.nodeName.toLowerCase()&&"password"===t.type},submit:function(t){var e=t.nodeName.toLowerCase();return("input"===e||"button"===e)&&"submit"===t.type},image:function(t){return"input"===t.nodeName.toLowerCase()&&"image"===t.type},reset:function(t){var e=t.nodeName.toLowerCase();return("input"===e||"button"===e)&&"_reset"===t.type},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},input:function(t){return/input|select|textarea|button/i.test(t.nodeName)},focus:function(t){return t===t.ownerDocument.activeElement}},setFilters:{first:function(t,e){return 0===e},last:function(t,e,i,n){return e===n.length-1},even:function(t,e){return e%2===0},odd:function(t,e){return e%2===1},lt:function(t,e,i){return ei[3]-0},nth:function(t,e,i){return i[3]-0===e},eq:function(t,e,i){return i[3]-0===e}},filter:{PSEUDO:function(t,e,i,n){var o=e[1],r=p.filters[o];if(r)return r(t,i,e,n);if("contains"===o)return(t.textContent||t.innerText||c([t])||"").indexOf(e[3])>=0;if("not"===o){for(var a=e[3],s=0,l=a.length;s=0}},ID:function(t,e){return 1===t.nodeType&&t.getAttribute("id")===e},TAG:function(t,e){return"*"===e&&1===t.nodeType||!!t.nodeName&&t.nodeName.toLowerCase()===e},CLASS:function(t,e){return(" "+(t.className||t.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(t,e){var i=e[1],n=u.attr?u.attr(t,i):p.attrHandle[i]?p.attrHandle[i](t):null!=t[i]?t[i]:t.getAttribute(i),o=n+"",r=e[2],a=e[4];return null==n?"!="===r:!r&&u.attr?null!=n:"="===r?o===a:"*="===r?o.indexOf(a)>=0:"~="===r?(" "+o+" ").indexOf(a)>=0:a?"!="===r?o!==a:"^="===r?0===o.indexOf(a):"$="===r?o.substr(o.length-a.length)===a:"|="===r&&(o===a||o.substr(0,a.length+1)===a+"-"):o&&n!==!1},POS:function(t,e,i,n){var o=e[2],r=p.setFilters[o];if(r)return r(t,i,e,n)}}},f=p.match.POS,g=function(t,e){return"\\"+(e-0+1)};for(var m in p.match)p.match[m]=new RegExp(p.match[m].source+/(?![^\[]*\])(?![^\(]*\))/.source),p.leftMatch[m]=new RegExp(/(^(?:.|\r|\n)*?)/.source+p.match[m].source.replace(/\\(\d+)/g,g));p.match.globalPOS=f;var v=function(t,e){return t=Array.prototype.slice.call(t,0),e?(e.push.apply(e,t),e):t};try{Array.prototype.slice.call(O.documentElement.childNodes,0)[0].nodeType}catch(y){v=function(t,e){var i=0,n=e||[];if("[object Array]"===r.call(t))Array.prototype.push.apply(n,t);else if("number"==typeof t.length)for(var o=t.length;i",i.insertBefore(t,i.firstChild),O.getElementById(e)&&(p.find.ID=function(t,e,i){if("undefined"!=typeof e.getElementById&&!i){var n=e.getElementById(t[1]);return n?n.id===t[1]||"undefined"!=typeof n.getAttributeNode&&n.getAttributeNode("id").nodeValue===t[1]?[n]:void 0:[]}},p.filter.ID=function(t,e){var i="undefined"!=typeof t.getAttributeNode&&t.getAttributeNode("id");return 1===t.nodeType&&i&&i.nodeValue===e}),i.removeChild(t),i=t=null}(),function(){var t=O.createElement("div");t.appendChild(O.createComment("")),t.getElementsByTagName("*").length>0&&(p.find.TAG=function(t,e){var i=e.getElementsByTagName(t[1]);if("*"===t[1]){for(var n=[],o=0;i[o];o++)1===i[o].nodeType&&n.push(i[o]);i=n}return i}),t.innerHTML="",t.firstChild&&"undefined"!=typeof t.firstChild.getAttribute&&"#"!==t.firstChild.getAttribute("href")&&(p.attrHandle.href=function(t){return t.getAttribute("href",2)}),t=null}(),O.querySelectorAll&&!function(){var t=u,e=O.createElement("div"),i="__sizzle__";if(e.innerHTML="

",!e.querySelectorAll||0!==e.querySelectorAll(".TEST").length){u=function(e,n,o,r){if(n=n||O,!r&&!u.isXML(n)){var a=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(e);if(a&&(1===n.nodeType||9===n.nodeType)){if(a[1])return v(n.getElementsByTagName(e),o);if(a[2]&&p.find.CLASS&&n.getElementsByClassName)return v(n.getElementsByClassName(a[2]),o)}if(9===n.nodeType){if("body"===e&&n.body)return v([n.body],o);if(a&&a[3]){var s=n.getElementById(a[3]);if(!s||!s.parentNode)return v([],o);if(s.id===a[3])return v([s],o)}try{return v(n.querySelectorAll(e),o)}catch(l){}}else if(1===n.nodeType&&"object"!==n.nodeName.toLowerCase()){var h=n,d=n.getAttribute("id"),c=d||i,f=n.parentNode,g=/^\s*[+~]/.test(e);d?c=c.replace(/'/g,"\\$&"):n.setAttribute("id",c),g&&f&&(n=n.parentNode);try{if(!g||f)return v(n.querySelectorAll("[id='"+c+"'] "+e),o)}catch(m){}finally{d||h.removeAttribute("id")}}}return t(e,n,o,r)};for(var n in t)u[n]=t[n];e=null}}(),function(){var t=O.documentElement,e=t.matchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||t.msMatchesSelector;if(e){var i=!e.call(O.createElement("div"),"div"),n=!1;try{e.call(O.documentElement,"[test!='']:sizzle")}catch(o){n=!0}u.matchesSelector=function(t,o){if(o=o.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']"),!u.isXML(t))try{if(n||!p.match.PSEUDO.test(o)&&!/!=/.test(o)){var r=e.call(t,o);if(r||!i||t.document&&11!==t.document.nodeType)return r}}catch(a){}return u(o,null,null,[t]).length>0}}}(),function(){var t=O.createElement("div");t.innerHTML="
",t.getElementsByClassName&&0!==t.getElementsByClassName("e").length&&(t.lastChild.className="e",1!==t.getElementsByClassName("e").length&&(p.order.splice(1,0,"CLASS"),p.find.CLASS=function(t,e,i){if("undefined"!=typeof e.getElementsByClassName&&!i)return e.getElementsByClassName(t[1])},t=null))}(),O.documentElement.contains?u.contains=function(t,e){return t!==e&&(!t.contains||t.contains(e))}:O.documentElement.compareDocumentPosition?u.contains=function(t,e){return!!(16&t.compareDocumentPosition(e))}:u.contains=function(){return!1},u.isXML=function(t){var e=(t?t.ownerDocument||t:0).documentElement;return!!e&&"HTML"!==e.nodeName};var _=function(t,e,i){for(var n,o=[],r="",a=e.nodeType?[e]:e;n=p.match.PSEUDO.exec(t);)r+=n[0],t=t.replace(p.match.PSEUDO,"");t=p.relative[t]?t+"*":t;for(var s=0,l=a.length;s0)for(r=o;r=0:z.filter(t,this).length>0:this.filter(t).length>0)},closest:function(t,e){var i,n,o=[],r=this[0];if(z.isArray(t)){for(var a=1;r&&r.ownerDocument&&r!==e;){for(i=0;i-1:z.find.matchesSelector(r,t)){o.push(r);break}if(r=r.parentNode,!r||!r.ownerDocument||r===e||11===r.nodeType)break}return o=o.length>1?z.unique(o):o,this.pushStack(o,"closest",t)},index:function(t){return t?"string"==typeof t?z.inArray(this[0],z(t)):z.inArray(t.jquery?t[0]:t,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(t,e){var i="string"==typeof t?z(t,e):z.makeArray(t&&t.nodeType?[t]:t),n=z.merge(this.get(),i);return this.pushStack(l(i[0])||l(n[0])?n:z.unique(n))},andSelf:function(){return this.add(this.prevObject)}}),z.each({parent:function ke(t){var ke=t.parentNode;return ke&&11!==ke.nodeType?ke:null},parents:function(t){return z.dir(t,"parentNode")},parentsUntil:function(t,e,i){return z.dir(t,"parentNode",i)},next:function(t){return z.nth(t,2,"nextSibling")},prev:function(t){return z.nth(t,2,"previousSibling")},nextAll:function(t){return z.dir(t,"nextSibling")},prevAll:function(t){return z.dir(t,"previousSibling")},nextUntil:function(t,e,i){return z.dir(t,"nextSibling",i)},prevUntil:function(t,e,i){return z.dir(t,"previousSibling",i)},siblings:function(t){return z.sibling((t.parentNode||{}).firstChild,t)},children:function(t){return z.sibling(t.firstChild)},contents:function(t){return z.nodeName(t,"iframe")?t.contentDocument||t.contentWindow.document:z.makeArray(t.childNodes)}},function(t,e){z.fn[t]=function(i,n){var o=z.map(this,e,i);return lt.test(t)||(n=i),n&&"string"==typeof n&&(o=z.filter(n,o)),o=this.length>1&&!ft[t]?z.unique(o):o,(this.length>1||dt.test(n))&&ht.test(t)&&(o=o.reverse()),this.pushStack(o,t,ct.call(arguments).join(","))}}),z.extend({filter:function(t,e,i){return i&&(t=":not("+t+")"),1===e.length?z.find.matchesSelector(e[0],t)?[e[0]]:[]:z.find.matches(t,e)},dir:function(t,e,i){for(var n=[],o=t[e];o&&9!==o.nodeType&&(void 0===i||1!==o.nodeType||!z(o).is(i));)1===o.nodeType&&n.push(o),o=o[e];return n},nth:function(t,e,i,n){e=e||1;for(var o=0;t&&(1!==t.nodeType||++o!==e);t=t[i]);return t},sibling:function(t,e){for(var i=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&i.push(t);return i}});var gt="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",mt=/ jQuery\d+="(?:\d+|null)"/g,vt=/^\s+/,yt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,wt=/]","i"),Ct=/checked\s*(?:[^=]|=\s*.checked.)/i,xt=/\/(java|ecma)script/i,St=/^\s*",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},At=d(O);kt.optgroup=kt.option,kt.tbody=kt.tfoot=kt.colgroup=kt.caption=kt.thead,kt.th=kt.td,z.support.htmlSerialize||(kt._default=[1,"div
","
"]),z.fn.extend({text:function(t){return z.access(this,function(t){return void 0===t?z.text(this):this.empty().append((this[0]&&this[0].ownerDocument||O).createTextNode(t))},null,t,arguments.length)},wrapAll:function(t){if(z.isFunction(t))return this.each(function(e){z(this).wrapAll(t.call(this,e))});if(this[0]){var e=z(t,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var t=this;t.firstChild&&1===t.firstChild.nodeType;)t=t.firstChild;return t}).append(this)}return this},wrapInner:function(t){return z.isFunction(t)?this.each(function(e){z(this).wrapInner(t.call(this,e))}):this.each(function(){var e=z(this),i=e.contents();i.length?i.wrapAll(t):e.append(t)})},wrap:function(t){var e=z.isFunction(t);return this.each(function(i){z(this).wrapAll(e?t.call(this,i):t)})},unwrap:function(){return this.parent().each(function(){z.nodeName(this,"body")||z(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(t){1===this.nodeType&&this.appendChild(t)})},prepend:function(){return this.domManip(arguments,!0,function(t){1===this.nodeType&&this.insertBefore(t,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(t){this.parentNode.insertBefore(t,this)});if(arguments.length){var t=z.clean(arguments);return t.push.apply(t,this.toArray()),this.pushStack(t,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(t){this.parentNode.insertBefore(t,this.nextSibling)});if(arguments.length){var t=this.pushStack(this,"after",arguments);return t.push.apply(t,z.clean(arguments)),t}},remove:function(t,e){for(var i,n=0;null!=(i=this[n]);n++)t&&!z.filter(t,[i]).length||(e||1!==i.nodeType||(z.cleanData(i.getElementsByTagName("*")),z.cleanData([i])),i.parentNode&&i.parentNode.removeChild(i));return this},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)for(1===t.nodeType&&z.cleanData(t.getElementsByTagName("*"));t.firstChild;)t.removeChild(t.firstChild);return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map(function(){return z.clone(this,t,e)})},html:function(t){return z.access(this,function(t){var e=this[0]||{},i=0,n=this.length;if(void 0===t)return 1===e.nodeType?e.innerHTML.replace(mt,""):null;if("string"==typeof t&&!Pt.test(t)&&(z.support.leadingWhitespace||!vt.test(t))&&!kt[(bt.exec(t)||["",""])[1].toLowerCase()]){t=t.replace(yt,"<$1>");try{for(;i1&&h0?this.clone(!0):this).get();z(o[a])[e](l),n=n.concat(l)}return this.pushStack(n,t,o.selector)}}),z.extend({clone:function Ae(t,e,i){var n,o,r,Ae=z.support.html5Clone||z.isXMLDoc(t)||!Et.test("<"+t.nodeName+">")?t.cloneNode(!0):v(t);if(!(z.support.noCloneEvent&&z.support.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||z.isXMLDoc(t)))for(p(t,Ae),n=f(t),o=f(Ae),r=0;n[r];++r)o[r]&&p(n[r],o[r]);if(e&&(c(t,Ae),i))for(n=f(t),o=f(Ae),r=0;n[r];++r)c(n[r],o[r]);return n=o=null,Ae},clean:function(t,e,i,n){var o,r,a,s=[];e=e||O,"undefined"==typeof e.createElement&&(e=e.ownerDocument||e[0]&&e[0].ownerDocument||O);for(var l,h=0;null!=(l=t[h]);h++)if("number"==typeof l&&(l+=""),l){if("string"==typeof l)if(_t.test(l)){l=l.replace(yt,"<$1>");var u,c=(bt.exec(l)||["",""])[1].toLowerCase(),p=kt[c]||kt._default,f=p[0],g=e.createElement("div"),v=At.childNodes;for(e===O?At.appendChild(g):d(e).appendChild(g),g.innerHTML=p[1]+l+p[2];f--;)g=g.lastChild;if(!z.support.tbody){var y=wt.test(l),b="table"!==c||y?""!==p[1]||y?[]:g.childNodes:g.firstChild&&g.firstChild.childNodes;for(a=b.length-1;a>=0;--a)z.nodeName(b[a],"tbody")&&!b[a].childNodes.length&&b[a].parentNode.removeChild(b[a])}!z.support.leadingWhitespace&&vt.test(l)&&g.insertBefore(e.createTextNode(vt.exec(l)[0]),g.firstChild),l=g.childNodes,g&&(g.parentNode.removeChild(g),v.length>0&&(u=v[v.length-1],u&&u.parentNode&&u.parentNode.removeChild(u)))}else l=e.createTextNode(l);var w;if(!z.support.appendChecked)if(l[0]&&"number"==typeof(w=l.length))for(a=0;a1)},z.extend({cssHooks:{opacity:{get:function(t,e){if(e){var i=It(t,"opacity");return""===i?"1":i} return t.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":z.support.cssFloat?"cssFloat":"styleFloat"},style:function Ie(t,e,i,n){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var o,r,a=z.camelCase(e),Ie=t.style,s=z.cssHooks[a];if(e=z.cssProps[a]||a,void 0===i)return s&&"get"in s&&void 0!==(o=s.get(t,!1,n))?o:Ie[e];if(r="undefined"==typeof i?"undefined":M(i),"string"===r&&(o=Bt.exec(i))&&(i=+(o[1]+1)*+o[2]+parseFloat(z.css(t,e)),r="number"),!(null==i||"number"===r&&isNaN(i)||("number"!==r||z.cssNumber[a]||(i+="px"),s&&"set"in s&&void 0===(i=s.set(t,i)))))try{Ie[e]=i}catch(l){}}},css:function(t,e,i){var n,o;return e=z.camelCase(e),o=z.cssHooks[e],e=z.cssProps[e]||e,"cssFloat"===e&&(e="float"),o&&"get"in o&&void 0!==(n=o.get(t,!0,i))?n:It?It(t,e):void 0},swap:function(t,e,i){var n,o,r={};for(o in e)r[o]=t.style[o],t.style[o]=e[o];n=i.call(t);for(o in e)t.style[o]=r[o];return n}}),z.curCSS=z.css,O.defaultView&&O.defaultView.getComputedStyle&&(Lt=function(t,e){var i,n,o,r,a=t.style;return e=e.replace(Rt,"-$1").toLowerCase(),(n=t.ownerDocument.defaultView)&&(o=n.getComputedStyle(t,null))&&(i=o.getPropertyValue(e),""!==i||z.contains(t.ownerDocument.documentElement,t)||(i=z.style(t,e))),!z.support.pixelMargin&&o&&Ft.test(e)&&Dt.test(i)&&(r=a.width,a.width=i,i=o.width,a.width=r),i}),O.documentElement.currentStyle&&(Mt=function(t,e){var i,n,o,r=t.currentStyle&&t.currentStyle[e],a=t.style;return null==r&&a&&(o=a[e])&&(r=o),Dt.test(r)&&(i=a.left,n=t.runtimeStyle&&t.runtimeStyle.left,n&&(t.runtimeStyle.left=t.currentStyle.left),a.left="fontSize"===e?"1em":r,r=a.pixelLeft+"px",a.left=i,n&&(t.runtimeStyle.left=n)),""===r?"auto":r}),It=Lt||Mt,z.each(["height","width"],function(t,e){z.cssHooks[e]={get:function(t,i,n){if(i)return 0!==t.offsetWidth?y(t,e,n):z.swap(t,Wt,function(){return y(t,e,n)})},set:function(t,e){return zt.test(e)?e+"px":e}}}),z.support.opacity||(z.cssHooks.opacity={get:function(t,e){return Nt.test((e&&t.currentStyle?t.currentStyle.filter:t.style.filter)||"")?parseFloat(RegExp.$1)/100+"":e?"1":""},set:function(t,e){var i=t.style,n=t.currentStyle,o=z.isNumeric(e)?"alpha(opacity="+100*e+")":"",r=n&&n.filter||i.filter||"";i.zoom=1,e>=1&&""===z.trim(r.replace(Ot,""))&&(i.removeAttribute("filter"),n&&!n.filter)||(i.filter=Ot.test(r)?r.replace(Ot,o):r+" "+o)}}),z(function(){z.support.reliableMarginRight||(z.cssHooks.marginRight={get:function(t,e){return z.swap(t,{display:"inline-block"},function(){return e?It(t,"margin-right"):t.style.marginRight})}})}),z.expr&&z.expr.filters&&(z.expr.filters.hidden=function(t){var e=t.offsetWidth,i=t.offsetHeight;return 0===e&&0===i||!z.support.reliableHiddenOffsets&&"none"===(t.style&&t.style.display||z.css(t,"display"))},z.expr.filters.visible=function(t){return!z.expr.filters.hidden(t)}),z.each({margin:"",padding:"",border:"Width"},function(t,e){z.cssHooks[t+e]={expand:function(i){var n,o="string"==typeof i?i.split(" "):[i],r={};for(n=0;n<4;n++)r[t+Ht[n]+e]=o[n]||o[n-2]||o[0];return r}}});var jt,Ut,Vt=/%20/g,Xt=/\[\]$/,Yt=/\r?\n/g,Gt=/#.*$/,qt=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Zt=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,Kt=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,Qt=/^(?:GET|HEAD)$/,$t=/^\/\//,Jt=/\?/,te=/)<[^<]*)*<\/script>/gi,ee=/^(?:select|textarea)/i,ie=/\s+/,ne=/([?&])_=[^&]*/,oe=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,re=z.fn.load,ae={},se={},le=["*/"]+["*"];try{jt=R.href}catch(he){jt=O.createElement("a"),jt.href="",jt=jt.href}Ut=oe.exec(jt.toLowerCase())||[],z.fn.extend({load:function(t,e,i){if("string"!=typeof t&&re)return re.apply(this,arguments);if(!this.length)return this;var n=t.indexOf(" ");if(n>=0){var o=t.slice(n,t.length);t=t.slice(0,n)}var r="GET";e&&(z.isFunction(e)?(i=e,e=void 0):"object"===("undefined"==typeof e?"undefined":M(e))&&(e=z.param(e,z.ajaxSettings.traditional),r="POST"));var a=this;return z.ajax({url:t,type:r,dataType:"html",data:e,complete:function(t,e,n){n=t.responseText,t.isResolved()&&(t.done(function(t){n=t}),a.html(o?z("
").append(n.replace(te,"")).find(o):n)),i&&a.each(i,[n,e,t])}}),this},serialize:function(){return z.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?z.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ee.test(this.nodeName)||Zt.test(this.type))}).map(function(t,e){var i=z(this).val();return null==i?null:z.isArray(i)?z.map(i,function(t,i){return{name:e.name,value:t.replace(Yt,"\r\n")}}):{name:e.name,value:i.replace(Yt,"\r\n")}}).get()}}),z.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(t,e){z.fn[e]=function(t){return this.on(e,t)}}),z.each(["get","post"],function(t,e){z[e]=function(t,i,n,o){return z.isFunction(i)&&(o=o||n,n=i,i=void 0),z.ajax({type:e,url:t,data:i,success:n,dataType:o})}}),z.extend({getScript:function(t,e){return z.get(t,void 0,e,"script")},getJSON:function(t,e,i){return z.get(t,e,i,"json")},ajaxSetup:function(t,e){return e?_(t,z.ajaxSettings):(e=t,t=z.ajaxSettings),_(t,e),t},ajaxSettings:{url:jt,isLocal:Kt.test(Ut[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":le},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":window.String,"text html":!0,"text json":z.parseJSON,"text xml":z.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:b(ae),ajaxTransport:b(se),ajax:function(t,e){function i(t,e,i,r){if(2!==b){b=2,s&&clearTimeout(s),a=void 0,o=r||"",_.readyState=t>0?4:0;var l,d,v,y,w,P=e,C=i?T(u,_,i):void 0;if(t>=200&&t<300||304===t)if(u.ifModified&&((y=_.getResponseHeader("Last-Modified"))&&(z.lastModified[n]=y),(w=_.getResponseHeader("Etag"))&&(z.etag[n]=w)),304===t)P="notmodified",l=!0;else try{d=E(u,C),P="success",l=!0}catch(x){P="parsererror",v=x}else v=P,P&&!t||(P="error",t<0&&(t=0));_.status=t,_.statusText=""+(e||P),l?f.resolveWith(c,[d,P,_]):f.rejectWith(c,[_,P,v]),_.statusCode(m),m=void 0,h&&p.trigger("ajax"+(l?"Success":"Error"),[_,u,l?d:v]),g.fireWith(c,[_,P]),h&&(p.trigger("ajaxComplete",[_,u]),--z.active||z.event.trigger("ajaxStop"))}}"object"===("undefined"==typeof t?"undefined":M(t))&&(e=t,t=void 0),e=e||{};var n,o,r,a,s,l,h,d,u=z.ajaxSetup({},e),c=u.context||u,p=c!==u&&(c.nodeType||c instanceof z)?z(c):z.event,f=z.Deferred(),g=z.Callbacks("once memory"),m=u.statusCode||{},v={},y={},b=0,_={readyState:0,setRequestHeader:function(t,e){if(!b){var i=t.toLowerCase();t=y[i]=y[i]||t,v[t]=e}return this},getAllResponseHeaders:function(){return 2===b?o:null},getResponseHeader:function(t){var e;if(2===b){if(!r)for(r={};e=qt.exec(o);)r[e[1].toLowerCase()]=e[2];e=r[t.toLowerCase()]}return void 0===e?null:e},overrideMimeType:function(t){return b||(u.mimeType=t),this},abort:function(t){return t=t||"abort",a&&a.abort(t),i(0,t),this}};if(f.promise(_),_.success=_.done,_.error=_.fail,_.complete=g.add,_.statusCode=function(t){if(t){var e;if(b<2)for(e in t)m[e]=[m[e],t[e]];else e=t[_.status],_.then(e,e)}return this},u.url=((t||u.url)+"").replace(Gt,"").replace($t,Ut[1]+"//"),u.dataTypes=z.trim(u.dataType||"*").toLowerCase().split(ie),null==u.crossDomain&&(l=oe.exec(u.url.toLowerCase()),u.crossDomain=!(!l||l[1]==Ut[1]&&l[2]==Ut[2]&&(l[3]||("http:"===l[1]?80:443))==(Ut[3]||("http:"===Ut[1]?80:443)))),u.data&&u.processData&&"string"!=typeof u.data&&(u.data=z.param(u.data,u.traditional)),w(ae,u,e,_),2===b)return!1;if(h=u.global,u.type=u.type.toUpperCase(),u.hasContent=!Qt.test(u.type),h&&0===z.active++&&z.event.trigger("ajaxStart"),!u.hasContent&&(u.data&&(u.url+=(Jt.test(u.url)?"&":"?")+u.data,delete u.data),n=u.url,u.cache===!1)){var P=z.now(),C=u.url.replace(ne,"$1_="+P);u.url=C+(C===u.url?(Jt.test(u.url)?"&":"?")+"_="+P:"")}(u.data&&u.hasContent&&u.contentType!==!1||e.contentType)&&_.setRequestHeader("Content-Type",u.contentType),u.ifModified&&(n=n||u.url,z.lastModified[n]&&_.setRequestHeader("If-Modified-Since",z.lastModified[n]),z.etag[n]&&_.setRequestHeader("If-None-Match",z.etag[n])),_.setRequestHeader("Accept",u.dataTypes[0]&&u.accepts[u.dataTypes[0]]?u.accepts[u.dataTypes[0]]+("*"!==u.dataTypes[0]?", "+le+"; q=0.01":""):u.accepts["*"]);for(d in u.headers)_.setRequestHeader(d,u.headers[d]);if(u.beforeSend&&(u.beforeSend.call(c,_,u)===!1||2===b))return _.abort(),!1;for(d in{success:1,error:1,complete:1})_[d](u[d]);if(a=w(se,u,e,_)){_.readyState=1,h&&p.trigger("ajaxSend",[_,u]),u.async&&u.timeout>0&&(s=setTimeout(function(){_.abort("timeout")},u.timeout));try{b=1,a.send(v,i)}catch(x){if(!(b<2))throw x;i(-1,x)}}else i(-1,"No Transport");return _},param:function(t,e){var i=[],n=function(t,e){e=z.isFunction(e)?e():e,i[i.length]=encodeURIComponent(t)+"="+encodeURIComponent(e)};if(void 0===e&&(e=z.ajaxSettings.traditional),z.isArray(t)||t.jquery&&!z.isPlainObject(t))z.each(t,function(){n(this.name,this.value)});else for(var o in t)P(o,t[o],e,n);return i.join("&").replace(Vt,"+")}}),z.extend({active:0,lastModified:{},etag:{}});var de=z.now(),ue=/(\=)\?(&|$)|\?\?/i;z.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return z.expando+"_"+de++}}),z.ajaxPrefilter("json jsonp",function(t,e,i){var n="string"==typeof t.data&&/^application\/x\-www\-form\-urlencoded/.test(t.contentType);if("jsonp"===t.dataTypes[0]||t.jsonp!==!1&&(ue.test(t.url)||n&&ue.test(t.data))){var o,r=t.jsonpCallback=z.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a=window[r],s=t.url,l=t.data,h="$1"+r+"$2";return t.jsonp!==!1&&(s=s.replace(ue,h),t.url===s&&(n&&(l=l.replace(ue,h)),t.data===l&&(s+=(/\?/.test(s)?"&":"?")+t.jsonp+"="+r))),t.url=s,t.data=l,window[r]=function(t){o=[t]},i.always(function(){window[r]=a,o&&z.isFunction(a)&&window[r](o[0])}),t.converters["script json"]=function(){return o||z.error(r+" was not called"),o[0]},t.dataTypes[0]="json","script"}}),z.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(t){return z.globalEval(t),t}}}),z.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET",t.global=!1)}),z.ajaxTransport("script",function(t){if(t.crossDomain){var e,i=O.head||O.getElementsByTagName("head")[0]||O.documentElement;return{send:function(n,o){e=O.createElement("script"),e.async="async",t.scriptCharset&&(e.charset=t.scriptCharset),e.src=t.url,e.onload=e.onreadystatechange=function(t,n){(n||!e.readyState||/loaded|complete/.test(e.readyState))&&(e.onload=e.onreadystatechange=null,i&&e.parentNode&&i.removeChild(e),e=void 0,n||o(200,"success"))},i.insertBefore(e,i.firstChild)},abort:function(){e&&e.onload(0,1)}}}});var ce,pe=!!window.ActiveXObject&&function(){for(var t in ce)ce[t](0,1)},fe=0;z.ajaxSettings.xhr=window.ActiveXObject?function(){return!this.isLocal&&C()||x()}:C,function(t){z.extend(z.support,{ajax:!!t,cors:!!t&&"withCredentials"in t})}(z.ajaxSettings.xhr()),z.support.ajax&&z.ajaxTransport(function(t){if(!t.crossDomain||z.support.cors){var e;return{send:function(i,n){var o,r,a=t.xhr();if(t.username?a.open(t.type,t.url,t.async,t.username,t.password):a.open(t.type,t.url,t.async),t.xhrFields)for(r in t.xhrFields)a[r]=t.xhrFields[r];t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(r in i)a.setRequestHeader(r,i[r])}catch(s){}a.send(t.hasContent&&t.data||null),e=function(i,r){var s,l,h,d,u;try{if(e&&(r||4===a.readyState))if(e=void 0,o&&(a.onreadystatechange=z.noop,pe&&delete ce[o]),r)4!==a.readyState&&a.abort();else{s=a.status,h=a.getAllResponseHeaders(),d={},u=a.responseXML,u&&u.documentElement&&(d.xml=u);try{d.text=a.responseText}catch(i){}try{l=a.statusText}catch(c){l=""}s||!t.isLocal||t.crossDomain?1223===s&&(s=204):s=d.text?200:404}}catch(p){r||n(-1,p)}d&&n(s,l,d,h)},t.async&&4!==a.readyState?(o=++fe,pe&&(ce||(ce={},z(window).unload(pe)),ce[o]=e),a.onreadystatechange=e):e()},abort:function(){e&&e(0,1)}}}});var ge,me,ve,ye,be={},we=/^(?:toggle|show|hide)$/,_e=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,Pe=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];z.fn.extend({show:function(t,e,i){var n,o;if(t||0===t)return this.animate(A("show",3),t,e,i);for(var r=0,a=this.length;r=s.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),s.animatedProperties[this.prop]=!0;for(e in s.animatedProperties)s.animatedProperties[e]!==!0&&(r=!1);if(r){if(null==s.overflow||z.support.shrinkWrapBlocks||z.each(["","X","Y"],function(t,e){a.style["overflow"+e]=s.overflow[t]}),s.hide&&z(a).hide(),s.hide||s.show)for(e in s.animatedProperties)z.style(a,e,s.orig[e]),z.removeData(a,"fxshow"+e,!0),z.removeData(a,"toggle"+e,!0);n=s.complete,n&&(s.complete=!1,n.call(a))}return!1}return s.duration==1/0?this.now=o:(i=o-this.startTime,this.state=i/s.duration,this.pos=z.easing[s.animatedProperties[this.prop]](this.state,i,0,1,s.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update(),!0}},z.extend(z.fx,{tick:function(){for(var t,e=z.timers,i=0;i-1,u={},c={};d?(c=a.position(),o=c.top,r=c.left):(o=parseFloat(l)||0,r=parseFloat(h)||0),z.isFunction(e)&&(e=e.call(t,i,s)),null!=e.top&&(u.top=e.top-s.top+o),null!=e.left&&(u.left=e.left-s.left+r),"using"in e?e.using.call(t,u):a.css(u)}},z.fn.extend({position:function(){if(!this[0])return null;var t=this[0],e=this.offsetParent(),i=this.offset(),n=Ce.test(e[0].nodeName)?{top:0,left:0}:e.offset();return i.top-=parseFloat(z.css(t,"marginTop"))||0,i.left-=parseFloat(z.css(t,"marginLeft"))||0,n.top+=parseFloat(z.css(e[0],"borderTopWidth"))||0,n.left+=parseFloat(z.css(e[0],"borderLeftWidth"))||0,{top:i.top-n.top,left:i.left-n.left}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||O.body;t&&!Ce.test(t.nodeName)&&"static"===z.css(t,"position");)t=t.offsetParent;return t})}}),z.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,e){var i=/Y/.test(e);z.fn[t]=function(n){return z.access(this,function(t,n,o){var r=L(t);return void 0===o?r?e in r?r[e]:z.support.boxModel&&r.document.documentElement[n]||r.document.body[n]:t[n]:void(r?r.scrollTo(i?z(r).scrollLeft():o,i?o:z(r).scrollTop()):t[n]=o)},t,n,arguments.length,null)}}),z.each({Height:"height",Width:"width"},function(t,e){var i="client"+t,n="scroll"+t,o="offset"+t;z.fn["inner"+t]=function(){var t=this[0];return t?t.style?parseFloat(z.css(t,e,"padding")):this[e]():null},z.fn["outer"+t]=function(t){var i=this[0];return i?i.style?parseFloat(z.css(i,e,t?"margin":"border")):this[e]():null},z.fn[e]=function(t){return z.access(this,function(t,e,r){var a,s,l,h;return z.isWindow(t)?(a=t.document,s=a.documentElement[i],z.support.boxModel&&s||a.body&&a.body[i]||s):9===t.nodeType?(a=t.documentElement,a[i]>=a[n]?a[i]:Math.max(t.body[n],a[n],t.body[o],a[o])):void 0===r?(l=z.css(t,e),h=parseFloat(l),z.isNumeric(h)?h:l):void z(t).css(e,r)},e,t,arguments.length,null)}}),function(t){function e(t,e,i){if(i[0]&&"object"!=M(i[0])){if(e[i[0]])return e[i[0]].apply(t,Array.prototype.slice.call(i,1));throw f(i[0]+" is not a method or property")}return e.init.apply(t,i)}function i(t,e,i,n){return{css:{position:"absolute",top:t,left:e,overflow:n||"hidden",zIndex:i||"auto"}}}function n(t,e,i,n,o){var a=1-o,s=a*a*a,l=o*o*o;return r(Math.round(s*t.x+3*o*a*a*e.x+3*o*o*a*i.x+l*n.x),Math.round(s*t.y+3*o*a*a*e.y+3*o*o*a*i.y+l*n.y))}function o(t){return t/_*180}function r(t,e){return{x:t,y:e}}function a(){var t;if(t=/AppleWebkit\/([0-9\.]+)/i.exec(N.userAgent)){var e=parseFloat(t[1]);return e>534.3}return!0}function s(t,e,i){return v&&i?" translate3d("+t+"px,"+e+"px, 0px) ":" translate("+t+"px, "+e+"px) "}function l(t){return" rotate("+t+"deg) "}function h(t,e){return Object.prototype.hasOwnProperty.call(e,t)}function d(){for(var t=["Moz","Webkit","Khtml","O","ms"],e=t.length,i="";e--;)t[e]+"Transform"in O.body.style&&(i="-"+t[e].toLowerCase()+"-");return i}function u(){var t,e=O.createElement("fakeelement"),i={transition:"transitionend",OTransition:"oTransitionEnd",MSTransition:"transitionend",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(t in i)if(void 0!==e.style[t])return i[t]}function c(t,e,i,n,o){var a,s=[];if("-webkit-"==b){for(a=0;as)throw f('Page "'+i+'" cannot be inserted')}else i=s,r=!0;return i>=1&&i<=s&&(o="double"==a.display?i%2?" odd":" even":"",a.done&&this.turn("stop"),i in a.pageObjs&&L._movePages.call(this,i,1),r&&(a.totalPages=s),a.pageObjs[i]=t(e).css({"float":"left"}).addClass("page p"+i+o),!m()&&a.pageObjs[i].hasClass("hard")&&a.pageObjs[i].removeClass("hard"),L._addPageContent.call(this,i),L._removeFromDOM.call(this)),this},_addPageContent:function(e){var i=this.data(),n=i.pageObjs[e];if(n)if(L._necessPage.call(this,e)){if(!i.pageWrap[e]){i.pageWrap[e]=t("
",{"class":"page-wrapper",page:e,css:{position:"absolute",overflow:"hidden"}}),this.append(i.pageWrap[e]),i.pagePlace[e]||(i.pagePlace[e]=e,i.pageObjs[e].appendTo(i.pageWrap[e]));var o=L._pageSize.call(this,e,!0);n.css({width:o.width,height:o.height}),i.pageWrap[e].css(o)}i.pagePlace[e]==e&&L._makeFlip.call(this,e)}else i.pagePlace[e]=0,i.pageObjs[e]&&i.pageObjs[e].remove()},hasPage:function(t){return h(t,this.data().pageObjs)},center:function(e){var i=this.data(),n=t(this).turn("size"),o=0;if(!i.noCenter){if("double"==i.display){var r=this.turn("view",e||i.tpage||i.page);"ltr"==i.direction?r[0]?r[1]||(o+=n.width/4):o-=n.width/4:r[0]?r[1]||(o-=n.width/4):o+=n.width/4}o=Math.round(o),t(this).css({marginLeft:o})}return this},destroy:function(){var e=this,i=this.data(),n=["end","first","flip","last","pressed","released","start","turning","turned","zooming","missing"];if("prevented"!=p("destroying",this))return i.destroying=!0,t.each(n,function(t,i){e.unbind(i)}),i.eventHandlers&&i.eventHandlers.start&&this.parent().unbind("start",i.eventHandlers.start),i.eventHandlers&&i.eventHandlers.touchMove&&i.eventHandlers.touchEnd&&t(O).unbind(E.move,i.eventHandlers.touchMove).unbind(E.up,i.eventHandlers.touchEnd),this.turn("removePage","*"),i.fparent&&i.fparent.remove(),i.shadow&&i.shadow.remove(),this.removeData(),i=null,this},is:function(){return"object"==M(this.data().pages)},zoom:function(e){var i=this.data();if("number"==typeof e){if(e<.001||e>100)throw f(e+" is not a value for zoom");if("prevented"==p("zooming",this,[e,i.zoom]))return this;var n=this.turn("size"),o=this.turn("view"),r=1/i.zoom,a=Math.round(n.width*r*e),s=Math.round(n.height*r*e);i.zoom=e,t(this).turn("stop").turn("size",a,s),i.opts.autoCenter&&this.turn("center"),L._updateShadow.call(this);for(var l=0;lr.totalPages)throw f('"'+t+'" is not a valid page');return o[1]=o[1]||o[0],o[0]>=1&&o[1]<=r.totalPages?(e=Math.floor((I-2)/2),r.totalPages-o[1]>o[0]?(i=Math.min(o[0]-1,e),n=2*e-i):(n=Math.min(r.totalPages-o[1],e),i=2*e-n)):(i=I-1,n=I-1),[Math.max(1,o[0]-i),Math.min(r.totalPages,o[1]+n)]},_necessPage:function(t){if(0===t)return!0;var e=this.turn("range");return this.data().pageObjs[t].hasClass("fixed")||t>=e[0]&&t<=e[1]},_removeFromDOM:function(){var t,e=this.data();for(t in e.pageWrap)h(t,e.pageWrap)&&!L._necessPage.call(this,t)&&L._removePageFromDOM.call(this,t)},_removePageFromDOM:function(t){var e=this.data();if(e.pages[t]){var i=e.pages[t].data(); R._moveFoldingPage.call(e.pages[t],!1),i.f&&i.f.fwrapper&&i.f.fwrapper.remove(),e.pages[t].removeData(),e.pages[t].remove(),delete e.pages[t]}e.pageObjs[t]&&e.pageObjs[t].remove(),e.pageWrap[t]&&(e.pageWrap[t].remove(),delete e.pageWrap[t]),L._removeMv.call(this,t),delete e.pagePlace[t],delete e.pageZoom[t]},removePage:function(t){var e=this.data();if("*"==t){if(t=e.totalPages>0){for(this.turn("stop"),t=e.totalPages;t>0;t--)e.pageObjs[t]&&(L._removePageFromDOM.call(this,t),delete e.pageObjs[t]),L._movePages.call(this,t,-1),e.page=null;e.totalPages=0,L._makeRange.call(this),this.turn("update")}}else{if(t<1||t>e.totalPages)throw f("The page "+t+" doesn't exist");e.pageObjs[t]&&(this.turn("stop"),L._removePageFromDOM.call(this,t),delete e.pageObjs[t]),L._movePages.call(this,t,-1),e.totalPages=e.totalPages-1,e.page>e.totalPages?(e.page=null,L._fitPage.call(this,e.totalPages)):(L._makeRange.call(this),this.turn("update"))}return this},_movePages:function(t,e){var i,n=this,o=this.data(),r="single"==o.display,a=function(t){var i=t+e,a=i%2,s=a?" odd ":" even ";o.pageObjs[t]&&(o.pageObjs[i]=o.pageObjs[t].removeClass("p"+t+" odd even").addClass("p"+i+s)),o.pagePlace[t]&&o.pageWrap[t]&&(o.pagePlace[i]=i,o.pageObjs[i].hasClass("fixed")?o.pageWrap[i]=o.pageWrap[t].attr("page",i):o.pageWrap[i]=o.pageWrap[t].css(L._pageSize.call(n,i,!0)).attr("page",i),o.pages[t]&&(o.pages[i]=o.pages[t].flip("options",{page:i,next:r||a?i+1:i-1})),e&&(delete o.pages[t],delete o.pagePlace[t],delete o.pageZoom[t],delete o.pageObjs[t],delete o.pageWrap[t]))};if(e>0)for(i=o.totalPages;i>=t;i--)a(i);else for(i=t;i<=o.totalPages;i++)a(i)},display:function(e){var i=this.data(),n=i.display;if(void 0===e)return n;if(t.inArray(e,x)==-1)throw f('"'+e+'" is not a value for display');switch(e){case"single":i.pageObjs[0]||(this.turn("stop").css({overflow:"hidden"}),i.pageObjs[0]=t("
",{"class":"page p-temporal"}).css({width:this.width(),height:this.height()}).appendTo(this)),this.addClass("shadow");break;case"double":i.pageObjs[0]&&(this.turn("stop").css({overflow:""}),i.pageObjs[0].remove(),delete i.pageObjs[0]),this.removeClass("shadow")}if(i.display=e,n){var o=this.turn("size");L._movePages.call(this,1,0),this.turn("size",o.width,o.height).turn("update")}return this},direction:function(e){var i=this.data();if(void 0===e)return i.direction;if(e=e.toLowerCase(),t.inArray(e,S)==-1)throw f('"'+e+'" is not a value for direction');return"rtl"==e&&t(this).attr("dir","ltr").css({direction:"ltr"}),i.direction=e,i.done&&this.turn("size",t(this).width(),t(this).height()),this},animating:function(){return this.data().pageMv.length>0},corner:function z(){var z,t,e=this.data();for(t in e.pages)if(h(t,e.pages)&&(z=e.pages[t].flip("corner")))return z;return!1},data:function(){return this.data()},disable:function(e){var i,n=this.data(),o=this.turn("view");n.disabled=void 0===e||e===!0;for(i in n.pages)h(i,n.pages)&&n.pages[i].flip("disable",!!n.disabled||t.inArray(parseInt(i,10),o)==-1);return this},disabled:function(t){return void 0===t?this.data().disabled===!0:this.turn("disable",t)},size:function(t,e){if(void 0===t||void 0===e)return{width:this.width(),height:this.height()};this.turn("stop");var i,n,o=this.data(),r=Math.floor("double"==o.display)?t/2:t;this.css({width:t,height:e}),o.pageObjs[0]&&o.pageObjs[0].css({width:r,height:e});for(i in o.pageWrap)h(i,o.pageWrap)&&(n=L._pageSize.call(this,i,!0),o.pageObjs[i].css({width:n.width,height:n.height}),o.pageWrap[i].css(n),o.pages[i]&&o.pages[i].css({width:n.width,height:n.height}));return this.turn("resize"),this},resize:function(){var t,e=this.data();for(e.pages[0]&&(e.pageWrap[0].css({left:-this.width()}),e.pages[0].flip("resize",!0)),t=1;t<=e.totalPages;t++)e.pages[t]&&e.pages[t].flip("resize",!0);L._updateShadow.call(this),e.opts.autoCenter&&this.turn("center")},_removeMv:function(t){var e,i=this.data();for(e=0;e0?D[0]:0,D[1]<=e.totalPages?D[1]:0]:[D[0]>0&&D[0]<=e.totalPages?D[0]:0]},stop:function(t,e){if(this.turn("animating")){var i,n,o,r=this.data();for(r.tpage&&(r.page=r.tpage,delete r.tpage),i=0;it;i--)this.turn("removePage",i);return e.totalPages=t,L._fitPage.call(this,e.page),this}return e.totalPages},_missing:function(t){var e=this.data();if(!(e.totalPages<1)){var i,n=this.turn("range",t),o=[];for(i=n[0];i<=n[1];i++)e.pageObjs[i]||o.push(i);o.length>0&&this.trigger("missing",[o]),this.trigger("range",n)}},_fitPage:function(t){var e=this.data(),i=this.turn("view",t);if(L._missing.call(this,t),e.pageObjs[t]){e.page=t,this.turn("stop");for(var n=0;na[1]?(i=a[1],n=s[0]):a[0]&&ei?"r":"l"):o.pages[i].flip("turnPage",e>i?"l":"r"):"ltr"==o.direction?o.pages[i].flip("turnPage",h[e>i?1:0]):o.pages[i].flip("turnPage",h[e>i?0:1]))},page:function(e){var i=this.data();if(void 0===e)return i.page;if(!i.disabled&&!i.destroying){if(e=parseInt(e,10),e>0&&e<=i.totalPages)return e!=i.page&&(i.done&&t.inArray(e,this.turn("view"))==-1?L._turnPage.call(this,e):L._fitPage.call(this,e)),this;throw f("The page "+e+" does not exist")}},next:function(){return this.turn("page",Math.min(this.data().totalPages,L._view.call(this,this.data().page).pop()+1))},previous:function(){return this.turn("page",Math.max(1,L._view.call(this,this.data().page).shift()-1))},peel:function(t,e,i){var n=this.data(),o=this.turn("view");if(e=void 0===e||e===!0,i=i!==!1,t===!1)this.turn("stop",null,e);else if("single"==n.display)n.pages[n.page].flip("peel",t,e,i);else{var r;r="ltr"==n.direction?t.indexOf("l")!=-1?o[0]:o[1]:t.indexOf("l")!=-1?o[1]:o[0],n.pages[r]&&n.pages[r].flip("peel",t,e,i)}return this},_addMotionPage:function(){var e=t(this).data().f.opts,i=e.turn;i.data();L._addMv.call(i,e.page)},_eventStart:function(t,e,i){var n=e.turn.data(),o=n.pageZoom[e.page];return t.isDefaultPrevented()?void L._updateShadow.call(e.turn):(o&&o!=n.zoom&&(e.turn.trigger("zoomed",[e.page,e.turn.turn("view",e.page),o,n.zoom]),n.pageZoom[e.page]=n.zoom),"single"==n.display&&i&&("l"==i.charAt(1)&&"ltr"==n.direction||"r"==i.charAt(1)&&"rtl"==n.direction?(e.next=e.nexte.page?e.next:e.page+1),L._addMotionPage.call(t.target),void L._updateShadow.call(e.turn))},_eventEnd:function(e,i,n){var o=t(e.target),r=(o.data().f,i.turn),a=r.data();if(n){var s=a.tpage||a.page;s!=i.next&&s!=i.page||(delete a.tpage,L._fitPage.call(r,s||i.next,!0))}else L._removeMv.call(r,i.page),L._updateShadow.call(r),r.turn("update")},timeout:null,_eventPressed:function(e){window.cornerClickSemafor=!0,clearTimeout(this.timeout),this.timeout=setTimeout(function(){window.cornerClickSemafor=!1},600);var i=t(e.target).data().f,n=i.opts.turn,o=n.data();o.pages;return o.mouseAction=!0,n.turn("update"),i.time=(new Date).getTime()},_eventReleased:function(e,i){var n,o=t(e.target),r=o.data().f,a=r.opts.turn,s=a.data();n="single"==s.display?"br"==i.corner||"tr"==i.corner?i.xo.width()/2:i.x<0||i.x>o.width(),((new Date).getTime()-r.time<200||n)&&(e.preventDefault(),L._turnPage.call(a,r.opts.next)),s.mouseAction=!1},_flip:function(e){e.stopPropagation();var i=t(e.target).data().f.opts;i.turn.trigger("turn",[i.next]),i.turn.data().opts.autoCenter&&i.turn.turn("center",i.next)},_touchStart:function(){var t=this.data();for(var e in t.pages)if(h(e,t.pages)&&R._eventStart.apply(t.pages[e],arguments)===!1)return!1},_touchMove:function(){var t=this.data();for(var e in t.pages)h(e,t.pages)&&R._eventMove.apply(t.pages[e],arguments)},_touchEnd:function(){var t=this.data();for(var e in t.pages)h(e,t.pages)&&R._eventEnd.apply(t.pages[e],arguments)},calculateZ:function(t){var e,i,n,o,r,a=this,s=this.data(),l=this.turn("view"),h=l[0]||l[1],d=t.length-1,u={pageZ:{},partZ:{},pageV:{}},c=function(t){var e=a.turn("view",t);e[0]&&(u.pageV[e[0]]=!0),e[1]&&(u.pageV[e[1]]=!0)};for(e=0;e<=d;e++)i=t[e],n=s.pages[i].data().f.opts.next,o=s.pagePlace[i],c(i),c(n),r=s.pagePlace[n]==n?n:i,u.pageZ[r]=s.totalPages-Math.abs(h-r),u.partZ[o]=2*s.totalPages-d+e;return u},update:function(){var e,i=this.data();if(this.turn("animating")&&0!==i.pageMv[0]){var n,o,r=this.turn("calculateZ",i.pageMv),a=this.turn("corner"),s=this.turn("view"),l=this.turn("view",i.tpage);for(e in i.pageWrap)h(e,i.pageWrap)&&(o=i.pageObjs[e].hasClass("fixed"),i.pageWrap[e].css({display:r.pageV[e]||o?"":"none",zIndex:((i.pageObjs[e].hasClass("hard")?r.partZ[e]:r.pageZ[e])||(o?-1:0))+3}),(n=i.pages[e])&&(n.flip("z",r.partZ[e]||null),r.pageV[e]&&n.flip("resize"),i.tpage?n.flip("hover",!1).flip("disable",t.inArray(parseInt(e,10),i.pageMv)==-1&&e!=l[0]&&e!=l[1]):n.flip("hover",a===!1).flip("disable",e!=s[0]&&e!=s[1])))}else for(e in i.pageWrap)if(h(e,i.pageWrap)){var d=L._setPageLoc.call(this,e);i.pages[e]&&i.pages[e].flip("disable",i.disabled||1!=d).flip("hover",!0).flip("z",null)}return this},_updateShadow:function(){var e,n,o,r=this.data(),a=this.width(),s=this.height(),l="single"==r.display?a:Math.floor(a/2);e=this.turn("view"),r.shadow||(r.shadow=t("
",{"class":"shadow",css:i(0,0,0).css}).appendTo(this));for(var h=0;h=n||r.y>=o)return!1;var s=R._cAllowed.call(this);switch(i.effect){case"hard":if(r.x>n-a)r.corner="r";else{if(!(r.x=o-a))return!1;r.corner+="b"}if(r.x<=a)r.corner+="l";else{if(!(r.x>=n-a))return!1;r.corner+="r"}}return!(!r.corner||t.inArray(r.corner,s)==-1)&&r},_isIArea:function(t){var e=this.data().f.parent.offset();return t=T&&t.originalEvent?t.originalEvent.touches[0]:t,R._cornerActivated.call(this,{x:t.pageX-e.left,y:t.pageY-e.top})},_c:function(t,e,i){switch(e=e||0,i=i||e,t){case"tl":return r(e,i);case"tr":return r(this.width()-e,i);case"bl":return r(e,this.height()-i);case"br":return r(this.width()-e,this.height()-i);case"l":return r(e,0);case"r":return r(this.width()-e,0)}},_c2:function(t){switch(t){case"tl":return r(2*this.width(),0);case"tr":return r(-this.width(),0);case"bl":return r(2*this.width(),this.height());case"br":return r(-this.width(),this.height());case"l":return r(2*this.width(),0);case"r":return r(-this.width(),0)}},_foldingPage:function(){var t=this.data().f;if(t){var e=t.opts;return e.turn?(t=e.turn.data(),"single"==t.display?e.next>1||e.page>1?t.pageObjs[0]:null:t.pageObjs[e.next]):void 0}},_backGradient:function(){var e=this.data().f,n=e.opts.turn.data(),o=n.opts.gradients&&("single"==n.display||2!=e.opts.page&&e.opts.page!=n.totalPages-1);return o&&!e.bshadow&&(e.bshadow=t("
",i(0,0,1)).css({position:"",width:this.width(),height:this.height()}).appendTo(e.parent)),o},type:function(){return this.data().f.effect},resize:function(t){var e=this.data().f,i=e.opts.turn.data(),n=this.width(),o=this.height();switch(e.effect){case"hard":t&&(e.wrapper.css({width:n,height:o}),e.fpage.css({width:n,height:o}),i.opts.gradients&&(e.ashadow.css({width:n,height:o}),e.bshadow.css({width:n,height:o})));break;case"sheet":if(t){var r=Math.round(Math.sqrt(Math.pow(n,2)+Math.pow(o,2)));e.wrapper.css({width:r,height:r}),e.fwrapper.css({width:r,height:r}).children(":first-child").css({width:n,height:o}),e.fpage.css({width:n,height:o}),i.opts.gradients&&e.ashadow.css({transform:"translateZ(0)",width:n,height:o}),R._backGradient.call(this)&&e.bshadow.css({width:n,height:o})}if(e.parent.is(":visible")){var a=g(e.parent[0]);e.fwrapper.css({top:a.top,left:a.left}),a=g(e.opts.turn[0]),e.fparent.css({top:-a.top,left:-a.left})}this.flip("z",e.opts["z-index"])}},_addPageWrapper:function(){var e=this.data().f,n=e.opts.turn.data(),o=this.parent();if(e.parent=o,!e.wrapper)switch(e.effect){case"hard":var r={};r[b+"transform-style"]="preserve-3d",r[b+"backface-visibility"]="hidden",e.wrapper=t("
",i(0,0,2)).css(r).appendTo(o).prepend(this),e.fpage=t("
",i(0,0,1)).css(r).appendTo(o),n.opts.gradients&&(e.ashadow=t("
",i(0,0,0)).hide().appendTo(o),e.bshadow=t("
",i(0,0,0)));break;case"sheet":var a=this.width(),s=this.height();Math.round(Math.sqrt(Math.pow(a,2)+Math.pow(s,2)));if(e.fparent=e.opts.turn.data().fparent,!e.fparent){var l=t("
",{css:{"pointer-events":"none"}}).hide();l.data().flips=0,l.css(i(0,0,"auto","visible").css).appendTo(e.opts.turn),e.opts.turn.data().fparent=l,e.fparent=l}this.css({position:"absolute",top:0,left:0,bottom:"auto",right:"auto"}),e.wrapper=t("
",i(0,0,this.css("z-index"))).appendTo(o).prepend(this),e.fwrapper=t("
",i(o.offset().top,o.offset().left)).hide().appendTo(e.fparent),e.fpage=t("
",i(0,0,0,"visible")).css({cursor:"default",overflow:"hidden"}).appendTo(e.fwrapper),n.opts.gradients&&(e.ashadow=t("
",i(0,0,1)).appendTo(e.fpage)),R.setData.call(this,e)}R.resize.call(this,!0)},_fold:function(t){var e=this.data().f,i=e.opts.turn.data(),n=R._c.call(this,t.corner),a=this.width(),h=this.height();switch(e.effect){case"hard":"l"==t.corner?t.x=Math.min(Math.max(t.x,0),2*a):t.x=Math.max(Math.min(t.x,a),-a);var d,u,p,f,g,m=i.totalPages,v=e.opts["z-index"]||m,w={overflow:"visible"},T=n.x?(n.x-t.x)/a:t.x/a,E=90*T,C=E<90;switch(t.corner){case"l":f="0% 50%",g="100% 50%",C?(d=0,u=e.opts.next-1>0,p=1):(d="100%",u=e.opts.page+1P&&(F.x=F.x+Math.abs(F.y*e.y/e.x),F.y=0,Math.round(F.x*Math.tan(_-l))P){var c=_-l,p=j-h/Math.sin(c);D=r(Math.round(p*Math.cos(c)),Math.round(p*Math.sin(c))),V&&(D.x=-D.x),U&&(D.y=-D.y)}x=Math.round(F.y/Math.tan(l)+F.x);var f=a-x,g=f*Math.cos(2*l),m=f*Math.sin(2*l);if(B=r(Math.round(V?f-g:x+g),Math.round(U?m:h-m)),i.opts.gradients){I=f*Math.sin(l);var v=R._c2.call(O,t.corner),b=Math.sqrt(Math.pow(v.x-t.x,2)+Math.pow(v.y-t.y,2))/a;M=Math.sin(P*(b>1?2-b:b)),L=Math.min(b,1),A=I>100?(I-100)/I:0,S=r(I*Math.sin(l)/a*100,I*Math.cos(l)/h*100),R._backGradient.call(O)&&(k=r(1.2*I*Math.sin(l)/a*100,1.2*I*Math.cos(l)/h*100),V||(k.x=100-k.x),U||(k.y=100-k.y))}return F.x=Math.round(F.x),F.y=Math.round(F.y),!0},Y=function(t,n,o,d){var u=["0","auto"],p=(a-j)*o[0]/100,f=(h-j)*o[1]/100,g={left:u[n[0]],top:u[n[1]],right:u[n[2]],bottom:u[n[3]]},m={},v=90!=d&&d!=-90?V?-1:1:0,y=o[0]+"% "+o[1]+"%";O.css(g).transform(l(d)+s(t.x+v,t.y,H),y),e.fpage.css(g).transform(l(d)+s(t.x+B.x-D.x-a*o[0]/100,t.y+B.y-D.y-h*o[1]/100,H)+l((180/d-2)*d),y),e.wrapper.transform(s(-t.x+p-v,-t.y+f,H)+l(-d),y),e.fwrapper.transform(s(-t.x+D.x+p,-t.y+D.y+f,H)+l(-d),y),i.opts.gradients&&(o[0]&&(S.x=100-S.x),o[1]&&(S.y=100-S.y),m["box-shadow"]="0 0 20px rgba(0,0,0,"+.5*M+")",W.css(m),c(e.ashadow,r(V?100:0,U?0:100),r(S.x,S.y),[[A,"rgba(0,0,0,0)"],[.8*(1-A)+A,"rgba(0,0,0,"+.2*L+")"],[1,"rgba(255,255,255,"+.2*L+")"]],3,z),R._backGradient.call(O)&&c(e.bshadow,r(V?0:100,U?0:100),r(k.x,k.y),[[.6,"rgba(0,0,0,0)"],[.8,"rgba(0,0,0,"+.3*L+")"],[1,"rgba(0,0,0,0)"]],3))};switch(t.corner){case"l":break;case"r":break;case"tl":t.x=Math.max(t.x,1),X(),Y(F,[1,0,0,1],[100,0],N);break;case"tr":t.x=Math.min(t.x,a-1),X(),Y(r(-F.x,F.y),[0,0,0,1],[0,0],-N);break;case"bl":t.x=Math.max(t.x,1),X(),Y(r(F.x,-F.y),[1,1,0,0],[100,100],-N);break;case"br":t.x=Math.min(t.x,a-1),X(),Y(r(-F.x,-F.y),[0,1,1,0],[0,100],N)}}e.point=t},_moveFoldingPage:function(t){var e=this.data().f;if(e){var i=e.opts.turn,n=i.data(),o=n.pagePlace;if(t){var r=e.opts.next;if(o[r]!=e.opts.page){e.folding&&R._moveFoldingPage.call(this,!1);var a=R._foldingPage.call(this);a.appendTo(e.fpage),o[r]=e.opts.page,e.folding=r}i.turn("update")}else if(e.folding){if(n.pages[e.folding]){var s=n.pages[e.folding].data().f;n.pageObjs[e.folding].appendTo(s.wrapper)}else n.pageWrap[e.folding]&&n.pageObjs[e.folding].appendTo(n.pageWrap[e.folding]);e.folding in o&&(o[e.folding]=e.folding),delete e.folding}}},_showFoldedPage:function(t,e){this.context.classList.add("folded");var i=R._foldingPage.call(this),n=this.data(),o=n.f,r=o.visible;if(this.trigger("folded",[o.opts,!0]),i){if(!r||!o.point||o.point.corner!=t.corner){var a="hover"==o.status||"peel"==o.status||o.opts.turn.data().mouseAction?t.corner:null;if(r=!1,"prevented"==p("start",this,[o.opts,a]))return!1}if(e){var s=this,l=o.point&&o.point.corner==t.corner?o.point:R._c.call(this,t.corner,1);this.animatef({from:[l.x,l.y],to:[t.x,t.y],duration:400,frame:function(e){t.x=Math.round(e[0]),t.y=Math.round(e[1]),R._fold.call(s,t)}})}else R._fold.call(this,t),n.effect&&!n.effect.turning&&this.animatef(!1);if(!r)switch(o.effect){case"hard":o.visible=!0,R._moveFoldingPage.call(this,!0),o.fpage.show(),o.opts.shadows&&o.bshadow.show();break;case"sheet":o.visible=!0,o.fparent.show().data().flips++,R._moveFoldingPage.call(this,!0),o.fwrapper.show(),o.bshadow&&o.bshadow.show()}return!0}return!1},hide:function(){var t=this.data().f,e=t.opts.turn.data(),i=R._foldingPage.call(this);switch(t.effect){case"hard":e.opts.gradients&&(t.bshadowLoc=0,t.bshadow.remove(),t.ashadow.hide()),t.wrapper.transform(""),t.fpage.hide();break;case"sheet":0===--t.fparent.data().flips&&t.fparent.hide(),this.css({left:0,top:0,right:"auto",bottom:"auto"}).transform(""),t.wrapper.transform(""),t.fwrapper.hide(),t.bshadow&&t.bshadow.hide(),i.transform("")}return t.visible=!1,this},hideFoldedPage:function(t){var e=this.data().f;if(e.point){var i=this,o=e.point,a=function(){e.point=null,e.status="",i.flip("hide"),i.trigger("end",[e.opts,!1]),i.context.classList.remove("folded"),i.trigger("folded",[e.opts,!1])};if(t){var s=R._c.call(this,o.corner),l="t"==o.corner.substr(0,1),h=l?Math.min(0,o.y-s.y)/2:Math.max(0,o.y-s.y)/2,d=r(o.x,o.y+h),u=r(s.x,s.y-h);this.animatef({from:0,to:1,frame:function(t){var e=n(o,d,u,s,t);o.x=e.x,o.y=e.y,R._fold.call(i,o)},complete:a,duration:800,hiding:!0})}else this.animatef(!1),a()}},turnPage:function(t){var e=this,i=this.data().f,o=i.opts.turn.data();t={corner:i.corner?i.corner.corner:t||R._cAllowed.call(this)[0]};var r=i.point||R._c.call(this,t.corner,i.opts.turn?o.opts.elevation:0),a=R._c2.call(this,t.corner);this.trigger("flip").animatef({from:0,to:1,frame:function(i){var o=n(r,r,a,a,i);t.x=o.x,t.y=o.y,R._showFoldedPage.call(e,t)},complete:function(){e.trigger("end",[i.opts,!0])},duration:o.opts.duration,turning:!0}),i.corner=null},moving:function(){return"effect"in this.data()},isTurning:function(){return this.flip("moving")&&this.data().effect.turning},corner:function(){return this.data().f.corner},_eventStart:function(t){var e=this.data().f,i=e.opts.turn;if(!e.corner&&!e.disabled&&!this.flip("isTurning")&&e.opts.page==i.data().pagePlace[e.opts.page]){if(e.corner=R._isIArea.call(this,t),e.corner&&R._foldingPage.call(this))return this.trigger("pressed",[e.point]),R._showFoldedPage.call(this,e.corner),!1;e.corner=null}},_eventMove:function(t){var e=this.data().f;if(!e.disabled)if(t=T?t.originalEvent.touches:[t],e.corner){var i=e.parent.offset();e.corner.x=t[0].pageX-i.left,e.corner.y=t[0].pageY-i.top,R._showFoldedPage.call(this,e.corner)}else if(e.hover&&!this.data().effect&&this.is(":visible")){var n=R._isIArea.call(this,t[0]);if(n){if("sheet"==e.effect&&2==n.corner.length||"hard"==e.effect){e.status="hover";var o=R._c.call(this,n.corner,e.opts.cornerSize/2);n.x=o.x,n.y=o.y,R._showFoldedPage.call(this,n,!0)}p("overcorner",this,[this.data().pageId])}else"hover"==e.status&&(e.status="",R.hideFoldedPage.call(this,!0),p("outcorner",this,[this.data().pageId]))}},_eventEnd:function(){var t=this.data().f,e=t.corner;!t.disabled&&e&&"prevented"!=p("released",this,[t.point||e])&&R.hideFoldedPage.call(this,!0),t.corner=null},disable:function(t){return R.setData.call(this,{disabled:t}),this},hover:function(t){return R.setData.call(this,{hover:t}),this},peel:function(e,i,n){var o=this.data().f;if(e){if(t.inArray(e,C.all)==-1)throw f("Corner "+e+" is not permitted");if(t.inArray(e,R._cAllowed.call(this))!=-1){var r=60+15*(n?Math.random():1),a=.65*(o.opts.cornerSize/2*(n?Math.random():1)+o.opts.cornerSize/4),s=Math.round(a*Math.sin(r*Math.PI/180)),l=Math.round(a*Math.cos(r*Math.PI/180)),h=R._c.call(this,e,s,l);o.status="peel",R._showFoldedPage.call(this,{corner:e,x:h.x,y:h.y},i)}}else o.status="",R.hideFoldedPage.call(this,i);return this}};window.requestAnim=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}}(),t.extend(t.fn,{flip:function(){return e(t(this[0]),R,arguments)},turn:function(){return e(t(this[0]),L,arguments)},transform:function(t,e){var i={};return e&&(i[b+"transform-origin"]=e),i[b+"transform"]=t,this.css(i)},animatef:function(e){var i=this.data();if(i.effect&&i.effect.stop(),e){e.to.length||(e.to=[e.to]),e.from.length||(e.from=[e.from]);for(var n=[],o=e.to.length,r=!0,a=this,s=(new Date).getTime(),l=function d(){if(i.effect&&r){for(var t=[],l=Math.min(e.duration,(new Date).getTime()-s),h=0;h0){var e=this;this._generateTOCStructure(),this.generateTOCSubLevel(this.tocStructure.children,this.rootElement,0),this.scanTOCforCurrentPage(this.pager.getState()),this.setActiveCounter=0,h["default"].defer(function(){e.trigger("change:height")})}},r.prototype._goToPage=function(t,e){this._setActiveElement(t,!1);var i=this.pager.pageTable.getPageIdByIndex(e.page-1);this.getApiProvider().trigger("link",{type:"internal",pageToUrl:this.pager.pageTable.getUrlHeaderById(i),pageUrl:this.pager.pageTable.getUrlHeaderById(this.pager.state.leftPage||this.pager.state.rightPage),source:"toc"}),this.trigger("change:page",{pageIndex:e.page-1,target:"toc"})},r.prototype._openChild=function(e,i,n,o){if(e.querySelector(".toc-sub-item-ul")||this.generateTOCSubLevel(i.children,e,i.level),e.className.indexOf("opened")!==-1){if(o)return;s["default"].removeClass(e,"opened"),s["default"].removeClass(n,"icon-down-arrow"),s["default"].addClass(n,"icon-"+(t.RTL?"left":"right")+"-arrow")}else s["default"].addClass(e,"opened"),s["default"].removeClass(n,"icon-"+(t.RTL?"left":"right")+"-arrow"),s["default"].addClass(n,"icon-down-arrow");this.trigger("change:height")},r.prototype.generateTOCSubLevel=function(e,i,n){var o=this,r=s["default"].createElement("ul",{"class":0===n?"toc-item":"toc-sub-item-ul"},i);h["default"].each(e,function(e){var i=s["default"].createElement("li",{"class":"toc-item"},r),a={};a["padding-"+(t.RTL?"right":"left")]=n<=2?20*n+"px":"60px";var l=s["default"].createElement("p",{"class":"list-item toc-item-p p"+e.page+" "+e.id,styles:a},i),d=s["default"].createElement("span",{"class":"icon"},l),u=s["default"].createElement("span",{"class":"toc-item-title",styles:{width:n<=2?214-20*n+"px":"154px"}},l);s["default"].setText(u,g["default"].decodeEntities(e.title));var c=b["default"].getDirection(e.title);if("rtl"===c||"bidi"===c){var p=document.createAttribute("dir");p.value="rtl",u.setAttributeNode(p)}h["default"].isEmpty(e.children)?(0,v["default"])(l,{}).on("tap",function(){o._goToPage(l,e)}):(s["default"].addClass(d,"icon-"+(t.RTL?"left":"right")+"-arrow"),(0,v["default"])(d).on("tap",function(){o._openChild(i,e,d,!1)}),(0,v["default"])(u,{}).on("tap",function(){o._openChild(i,e,d,!0),o._goToPage(l,e)}))},this)},r.prototype.pageTurned=function(){this.scanTOCforCurrentPage(this.pager.getState())},r.prototype.scanTOCforCurrentPage=function(t,e,i,n){function o(t){if(!h["default"].isUndefined(t.page)){var e,i,n;h["default"].isUndefined(t.parent)||o(t.parent),n=a.rootElement.querySelector("."+t.id),n&&(e=n.parentNode,i=n.querySelector(".icon"),h["default"].isEmpty(t.children)||a._openChild(e,t,i,!0))}}function r(t){"Internet Explorer"!==a.browser.name&&o(t),a.rootElement.querySelector("."+t.id)&&a._setActiveElement(a.rootElement.querySelector("."+t.id),!0)}var a=this;if(e)return void(this.lastTarget=n);if(this.lastTarget){if(!h["default"].isUndefined(this.lastTarget)&&"toc"===this.lastTarget)return void(this.lastTarget=null);this.lastTarget=null}h["default"].defer(h["default"].bind(function(t){var e=h["default"].isUndefined(t.rightPage)?Number.MIN_SAFE_INTEGER:this.pager.pageTable.getPageIndexById(t.rightPage)+1,i=h["default"].isUndefined(t.leftPage)?Number.MIN_SAFE_INTEGER:this.pager.pageTable.getPageIndexById(t.leftPage)+1;t.zoomMode||e!==i||e===Number.MIN_SAFE_INTEGER||e++;var n=Math.max(e,i),o=!1;if(n!==Number.MIN_SAFE_INTEGER)for(var s=n;s>0;s--)if(!h["default"].isUndefined(this.dictionary[s])){ r(this.dictionary[s]),o=!0;break}o||a._setActiveElement()},this),t)},r.prototype._setActiveElement=function(t,e){for(var i=this,n=this.rootElement.querySelectorAll(".active"),o=!1,r=0,a=n.length;r-1&&t.indexOf(a)>-1)return h;if(t.indexOf(r)>-1)return s;if(t.indexOf(a)>-1)return l;var e=i(t,l),n=i(t,s);return e&&n?h:n?s:e?l:d}function i(t,e){var i,o,r,a,h=!1,d=!1,c=!1;for(c=t.search(/[0-9]/)>-1,t=t.replace(/[\s\n\0\f\t\v\'\"\-0-9\+\?\!]+/gm,""),i=0;io&&n=e.provider.getMinimumQueryLength()?t=setTimeout(function(){r()},500):l["default"].isEmpty(o.value)&&(e.off("scroll",e._onScroll),e.provider.query="",a["default"].addClass(e.searchResultsCountPanel,"empty-result"),a["default"].setText(e.searchResultsCount,""),a["default"].clear(e.listView),l["default"].defer(function(){e.trigger("change:height")}))}),new f["default"](n,{}).on("tap",r),this.provider.on("change:query",function(){o.value!==e.provider.query&&(o.value=e.provider.query)})},o.prototype.createSubHeader2=function(){this.searchResultsCountPanel=a["default"].createElement("div",{"class":"search-sub-header subheader"},this.toolHeader),this.searchResultsCount=a["default"].createElement("span",{"class":"search-results-count"},this.searchResultsCountPanel),this.livePreloader=a["default"].createElement("div",{"class":"search-live-preloader"},this.searchResultsCountPanel),a["default"].createElement("div",{"class":"dot"},this.livePreloader)},o.prototype.createPreloader=function(){this.preloader=a["default"].createElement("div",{"class":"search-preloader"},this.rootView);for(var t=a["default"].createElement("div",{"class":"preloader-dots"},this.preloader),e=0;e<5;e++)a["default"].createElement("div",{"class":"dot"},t)},o.prototype.createList=function(){this.listView=a["default"].createElement("ul",{"class":"search-ul"},this.rootView)},o.prototype.showResults=function(t){return a["default"].removeClass(this.searchResultsCountPanel,"empty-result"),this.provider.isQueryValid()?(l["default"].isUndefined(this.provider.getResultsCountSync())&&(this.resultsShown||a["default"].removeClass(this.preloader,"hidden"),a["default"].addClass(this.scrollView,"hidden"),a["default"].setText(this.searchResultsCount,this.getLocaleProvider().get("SearchToolWindow.SEARCH_IN_PROGRESS"))),this.renderResults(0,this.resultsOnPage,!0),void(this.resultsOffset=0)):(a["default"].addClass(this.preloader,"hidden"),a["default"].addClass(this.livePreloader,"hidden"),a["default"].removeClass(this.scrollView,"hidden"),void(l["default"].isEmpty(this.provider.query)&&t?(a["default"].addClass(this.searchResultsCountPanel,"empty-result"),a["default"].setText(this.searchResultsCount,"")):(a["default"].removeClass(this.searchResultsCountPanel,"empty-result"),a["default"].setText(this.searchResultsCount,this.getLocaleProvider().get("SearchToolWindow.MIN_WORD_ERRROR",{0:this.provider.getMinimumQueryLength()})))))},o.prototype.renderResults=function(t,e,i){function n(t,e){s.trigger("change:page",{pageId:t.pageId+"",target:"search"}),s.setElementActive(e)}function o(t,e){var i;i=l["default"].isUndefined(e)?a["default"].createElement("li",{"class":"search-item p"+t.pageId},s.listView):a["default"].createElement("li",{"class":"search-item p"+t.pageId},s.listView,"before",e);var o=a["default"].createElement("p",{"class":"list-item search-item-p p"+t.pageId},i),r=a["default"].createElement("span",{"class":"search-item-title",styles:{width:"214px"}},o);r.innerHTML=""+c["default"].cleanString(s.getLocaleProvider().get("SearchToolWindow.PAGE_NUMBER",{0:s.pager.pageTable.getPageCaptionById(t.pageId+"")}))+": "+t.text,(0,f["default"])(o,{}).on("tap",l["default"].partial(n,t,o))}function r(t){var e=a["default"].className("search-item p"+t.pageId,s.listView)[0],i=e.firstChild;(0,f["default"])(i,{}).off("tap",l["default"].partial(n,t,i)),a["default"].del(e)}var s=this;this.provider.getResultsAsync(t,e,function(t,e){i&&(a["default"].addClass(s.preloader,"hidden"),a["default"].removeClass(s.livePreloader,"hidden"),a["default"].removeClass(s.scrollView,"hidden")),s.off("scroll",s._onScroll),l["default"].isEmpty(t)&&(s.resultsShown=!1,a["default"].clear(s.listView),s.trigger("scroll:toTop"));var n=l["default"].difference(t,s.oldResults),h=l["default"].difference(s.oldResults,t);if(!s.resultsShown||n.length===t.length||n.length>s.resultsOnPage/2?(i&&(a["default"].clear(s.listView),s.trigger("scroll:toTop")),l["default"].each(t,function(t){o(t)})):(l["default"].each(n,function(e,i){var n,r=l["default"].indexOf(t,e);r0?a["default"].setText(s.searchResultsCount,s.getLocaleProvider().get("SearchToolWindow.PAGES_FOUND",{0:d})):a["default"].setText(s.searchResultsCount,s.getLocaleProvider().get("SearchToolWindow.NOTHING_FOUND"))}l["default"].defer(function(){s.trigger("change:height")})})},o.prototype._onScroll=function(){function t(t){var e=t.getBoundingClientRect();return e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)}var e=this.listView.childNodes,i=e[e.length-5];t(i)&&(this.resultsOffset++,this.renderResults(this.resultsOffset,this.resultsOnPage))},o.prototype.setElementActive=function(t){a["default"].removeClass(this.listView.querySelector(".active"),"active"),l["default"].defer(function(){a["default"].addClass(t,"active")})},e["default"]=o},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t,e,i,n,o){this.pager=e,this.slideshow=o,this.properties=i,this.sound=n,this.fullscreen=!1,this.rootElement=a["default"].createElement("div",{"class":"bottom-toolbar-frame"},t,"top"),this.getLocaleProvider().onAndChange("change:BottomMenu",this._initBottomMenu,this),this.pager.on("change:rtl",this._initBottomMenu,this),this.slideshow.on("change:isActive",this._toggleSlideshow,this);var r=this,s=function(t){t?a["default"].removeClass(r.rootElement,"hidden"):a["default"].addClass(r.rootElement,"hidden")};this.properties.onAndChange("change:components.bottomBar",function(t){s(t)})}Object.defineProperty(e,"__esModule",{value:!0});var r=i(2),a=n(r),s=i(1),l=n(s),h=i(0),d=n(h),u=i(7),c=n(u),p=i(3),f=n(p),g=i(8),m=n(g),v=i(5),y=n(v);o.prototype=new l["default"],o.constructor=o,o.prototype._initBottomMenu=function(){this.rootElement.innerHTML=m["default"]["workspace-bottom-menu"]({zoomIcon:this.pager.getState().zoomMode?"icon-zoomout":"icon-zoomin",slideshowIcon:this.pager.slideshow?"icon-slideshow-pause":"icon-slideshow",fullscreenIcon:this.fullscreen?"icon-fullscreen-out":"icon-fullscreen",localization:{toc:this.getLocaleProvider().get("BottomMenu.TOC_TIP"),thumbnails:this.getLocaleProvider().get("BottomMenu.THUMBNAILS_TIP"),social:this.getLocaleProvider().get("BottomMenu.PERMALINK_TIP"),textSelection:this.getLocaleProvider().get("BottomMenu.SELECT_BUTTON_TIP"),print:this.getLocaleProvider().get("BottomMenu.PRINT_TIP"),download:this.getLocaleProvider().get("BottomMenu.SAVE_TIP"),sound:this.getLocaleProvider().get("BottomMenu.SOUND_BUTTON_TIP"),notes:this.getLocaleProvider().get("BottomMenu.NOTES_BUTTON_TIP"),fullscreen:this.fullscreen?this.getLocaleProvider().get("BottomMenu.NORMAL_BUTTON_TIP"):this.getLocaleProvider().get("BottomMenu.FULLSCREEN_BUTTON_TIP"),zoom:this.pager.getState().zoomMode?this.getLocaleProvider().get("BottomMenu.UNZOOM_BUTTON_TIP"):this.getLocaleProvider().get("BottomMenu.ZOOM_BUTTON_TIP"),firstPage:this.pager.isRtl()?this.getLocaleProvider().get("NavigationPanel.LAST_PAGE_TIP"):this.getLocaleProvider().get("NavigationPanel.FIRST_PAGE_TIP"),lastPage:this.pager.isRtl()?this.getLocaleProvider().get("NavigationPanel.FIRST_PAGE_TIP"):this.getLocaleProvider().get("NavigationPanel.LAST_PAGE_TIP"),nextPage:this.pager.isRtl()?this.getLocaleProvider().get("NavigationPanel.PREV_PAGE_TIP"):this.getLocaleProvider().get("NavigationPanel.NEXT_PAGE_TIP"),previousPage:this.pager.isRtl()?this.getLocaleProvider().get("NavigationPanel.NEXT_PAGE_TIP"):this.getLocaleProvider().get("NavigationPanel.PREV_PAGE_TIP"),slideshow:this.slideshow.isActive?this.getLocaleProvider().get("NavigationPanel.PAUSE_PAGE_TIP"):this.getLocaleProvider().get("NavigationPanel.PLAY_PAGE_TIP")}}),this._initComponents()},o.prototype.getLocaleProvider=function(){return(0,f["default"])().get(f["default"].LOCALE)},o.prototype.getRootElement=function(){return this.rootElement},o.prototype._initComponents=function(){this._initButtons(),this._initNavigation(),this._initSlideshow()},o.prototype._initNavigation=function(){var t=a["default"].id("first-page"),e=a["default"].id("prev-page"),i=a["default"].id("next-page"),n=a["default"].id("last-page"),o=new c["default"](t,{}),r=new c["default"](e,{}),s=new c["default"](i,{}),l=new c["default"](n,{}),h=this;o.on("tap",d["default"].throttle(function(){h.pager.isRtl()?h.pager.goToLast():h.pager.goToFirst()},500)),r.on("tap",d["default"].throttle(function(){h.pager.isRtl()?h.pager.goForward():h.pager.goBackward()},500)),s.on("tap",d["default"].throttle(function(){h.pager.isRtl()?h.pager.goBackward():h.pager.goForward()},500)),l.on("tap",d["default"].throttle(function(){h.pager.isRtl()?h.pager.goToFirst():h.pager.goToLast()},500));var u=function(o){var r=[t,e,i,n],s=a["default"].id("icon-book-first"),l=a["default"].id("icon-book-last");if(o){a["default"].addClass(s,"hidden-component"),a["default"].addClass(l,"hidden-component");for(var h=0;h0)},this),E.on("tap",function(){t.trigger("tap:thumbnails")}),this.properties.onAndChange("change:components.thumbnails",function(t){f(i,t)}),_.on("tap",function(){t.trigger("tap:social")}),this.properties.on("change:components.share",function(t){f(n,t)}),f(n,this.properties.components.share),P.on("tap",function(){t.trigger("tap:notes")}),this.properties.on("change:components.notes",function(t){f(o,t&&!(0,y["default"])().getLocalStorage().isStub)}),f(o,this.properties.components.notes&&!(0,y["default"])().getLocalStorage().isStub),g.on("tap",function(){t.trigger("tap:textSelection")}),this.properties.onAndChange("change:components.textSelection",function(t){f(r,t)}),m.on("tap",function(){t.trigger("tap:print")}),this.properties.onAndChange("change:components.print",function(t){f(s,t)}),w.on("tap",function(){t.trigger("tap:download")}),this.properties.on("change:downloads",function(t){f(l,!d["default"].isUndefined(t)&&!d["default"].isEmpty(t)&&d["default"].has(t,"enabled")&&t.enabled)}),f(l,!d["default"].isUndefined(this.properties.downloads)&&!d["default"].isEmpty(this.properties.downloads)&&d["default"].has(this.properties.downloads,"enabled")&&this.properties.downloads.enabled),C.on("tap",function(){t.trigger("tap:sound")});var x=function(){var t=!!this.sound&&this.sound.canWork;f(h,t)};this.properties.cast("sound"),this.properties.sound.onAndChange("change:enabled",x,this),this.sound&&this.sound.on("change:canWork",x,this),b.on("tap",function(){t.trigger("tap:fullscreen")}),this.properties.onAndChange("change:components.fullscreen",function(t){f(u,t)}),v.on("tap",d["default"].throttle(function(){t.pager.toggleZoomMode()},1500,{leading:!0,trailing:!1})),this.pager.on("change:state",function(e){a["default"].removeClass(v.element,"icon-zoomout"),a["default"].removeClass(v.element,"icon-zoomin"),a["default"].addClass(v.element,e.zoomMode?"icon-zoomout":"icon-zoomin"),v.element.title=e.zoomMode?t.getLocaleProvider().get("BottomMenu.UNZOOM_BUTTON_TIP"):t.getLocaleProvider().get("BottomMenu.ZOOM_BUTTON_TIP")}),this.properties.on("change:components.zoom",function(t){f(p,t)}),f(p,this.properties.components.zoom),this._validateDividersVisibility()},o.prototype._validateDividersVisibility=function(){var t=a["default"].className("group1",this.rootElement),e=a["default"].className("group2",this.rootElement),i=a["default"].className("group3",this.rootElement),n=a["default"].className("group4",this.rootElement),o=a["default"].id("divider1"),r=a["default"].id("divider2"),s=a["default"].id("divider3"),l=function(t,e){if(0===t.length||0===e.length)return!1;for(var i,n=!1,o=!1,r=0;r=b&&t.height>=b?t:void 0}Object.defineProperty(e,"__esModule",{value:!0});var a=i(2),s=n(a),l=i(0),h=n(l),d=i(3),u=n(d),c=i(5),p=n(c),f=i(92),g=n(f),m=i(29),v=n(m),y=10,b=10;o.prototype.constructor=o,o.prototype.destructor=function(){t.removeEventListener("resize",this.windowSizeChange),(0,u["default"])().off("change:"+u["default"].CURRENT_PRESENTER,this.slideModeChange,this),(0,u["default"])().get(u["default"].CURRENT_PRESENTER).view.off("zoomAnimation:end",this.resetLogoPosition,this),(0,u["default"])().get(u["default"].CURRENT_PRESENTER).view.off("slideAnimation:end",this.resetLogoPosition,this),this.props.off("change:logoLink",this._onPropertiesChange,this),this.props.off("change:components.bottomBar change:components.topBar",this.resetLogoPosition,this),this.img.onload=null,this.slidePresenter=null,this.rootElement&&s["default"].del(this.rootElement)},o.prototype.slideModeChange=function(t,e){t&&t.constructor===v["default"]?this.slidePresenter=t:this.slidePresenter=null,e&&(e.view.off("zoomAnimation:end",this.resetLogoPosition,this),e.view.off("slideAnimation:end",this.resetLogoPosition,this)),t.view.on("zoomAnimation:end",this.resetLogoPosition,this),t.view.on("slideAnimation:end",this.resetLogoPosition,this)},o.prototype.windowSizeChange=function(){},o.prototype.getLocaleProvider=function(){return(0,u["default"])().get(u["default"].LOCALE)},o.prototype.getImage=function(){var t=this.properties.image;if(!t&&this.properties.url&&this.properties.url.toLowerCase().indexOf("flippingbook.com")!==-1){this.fbLogo=!0,this.top?(s["default"].addClass(this.bodyContainer,"logo-top"),s["default"].removeClass(this.bodyContainer,"logo-bottom")):(s["default"].addClass(this.bodyContainer,"logo-bottom"),s["default"].removeClass(this.bodyContainer,"logo-top"));var e=s["default"].createElement("div");e.innerHTML=g["default"];var i=e.childNodes[0],n=this.skinConfig[(this.top?"top":"bottom")+"-"+(this.left?"left":"right")+"-icon-color"],o=this.left?"":"translate(64.12)";i.querySelector("#made-with-group").setAttribute("transform",o),i.querySelector("#fb-logo-main").setAttribute("fill",n),i.querySelector("#fb-logo-main").setAttribute("fill-opacity","1"),this.fbLogo={width:i.width.baseVal.value,height:i.height.baseVal.value},t="data:image/svg+xml;base64,"+btoa(e.innerHTML),e=null}return t},o.prototype._onPropertiesChange=function(t){h["default"].isUndefined(t)||(this.properties=t),h["default"].isUndefined(this.properties.position)&&(this.properties.position="bottom-right"),this.top=this.properties.position.indexOf("top")!==-1,this.left=this.properties.position.indexOf("left")!==-1;var e=this.properties.url;h["default"].isEmpty(e)?(s["default"].removeClass(this.rootElement,"linked"),this.rootElement.appendChild(this.img),this.link.href="",this.img.removeAttribute("alt"),this.img.removeAttribute("title")):(s["default"].addClass(this.rootElement,"linked"),this.link.appendChild(this.img),this.link.href=e,this.getLocaleProvider().onAndChange("change:TopMenu.EXTERNAL_LINK_TIP",function(){var t=this.getLocaleProvider().get("TopMenu.EXTERNAL_LINK_TIP",{0:e}),i=t.indexOf("?");i>-1&&(t=t.substr(0,i)),this.img.alt=this.img.title=t},this)),this.link.target=this.properties.target;var i=this.getImage();if(h["default"].isEmpty(i))s["default"].addClass(this.rootElement,"hidden"),this.img.removeAttribute("src");else{var n=i.indexOf("data:image")!==-1?i:(0,p["default"])().translatePath(i);s["default"].removeClass(this.rootElement,"hidden"),this.img.src=n}},o.prototype.updateMenuClasses=function(t){this.isBottomOpaque=void 0!==h["default"].find(t,function(t){return"opaqueBottom"===t}),this.isBottomJustify=void 0!==h["default"].find(t,function(t){return"justifyBottom"===t}),this.resetLogoPosition()},o.prototype.resetLogoPosition=function(){var t=this._initRects(),e=t.filter(function(t){return"mini_mode"===t.placement}),i=this._sortRects(t),n=this.getImage();e.length>0&&!h["default"].isEmpty(n)?(this._placeLogo(e[0]),s["default"].removeClass(this.rootElement,"hidden")):i.length>0&&!h["default"].isEmpty(n)?(this._placeLogo(i[0]),s["default"].removeClass(this.rootElement,"hidden")):s["default"].addClass(this.rootElement,"hidden")},o.prototype._placeLogo=function(t){var e=this.img.naturalWidth,i=this.img.naturalHeight,n=this.rootElement.style;switch(!this.fbLogo||0!==e&&0!==i||(e=this.fbLogo.width,i=this.fbLogo.height),this.img.height=Math.floor(i*t.scale),this.img.width=Math.floor(e*t.scale),t.placement){case"corner":case"mini_mode":case"above_bottom_menu":n.top=t.rect.top?t.rect.top+"px":"",n.bottom=t.rect.bottom?t.rect.bottom+"px":"",n.left=t.rect.left?t.rect.left+"px":"",n.right=t.rect.right?t.rect.right+"px":"",n.zIndex=1;break;case"inside_bottom_menu":n.top=t.rect.top+Math.floor((t.rect.height-this.img.height)/2)+"px",n.bottom="",n.left=t.rect.left?t.rect.left+"px":"",n.right=t.rect.right?t.rect.right+"px":"",n.zIndex=4}},o.prototype._sortRects=function(t){return t.sort(function(t,e){var i=["inside_bottom_menu","corner","above_bottom_menu"];return t.scale===e.scale?i.indexOf(t.placement)-i.indexOf(e.placement):e.scale-t.scale})},o.prototype._initRects=function(){var t=this._getRect(this.bottomMenu),e=this._getRect(this.topBar),i=this._getRect(this.flipbookContainer),n=h["default"].findWhere(s["default"].className("bottom-toolbar"),{localName:"ul"}),o=this._getRect(n),r={x:0,y:0,width:i.width,height:i.height};r.y=e?e.height:r.y,r.width=Math.round(r.width/2),r.x=(i.width-r.width)/2;var a=[];if(s["default"].hasClass(this.bodyContainer,"mini")){var l=this._getMiniModeRect(i);if(!h["default"].isUndefined(l)){var d=this._calculateScale(l);a.push({rect:l,scale:d,placement:"mini_mode"})}return a}if(this.top)if(this.left){var u=this._getTopLeftRect(r,e);if(!h["default"].isUndefined(u)){var c=this._calculateScale(u);a.push({rect:u,scale:c,placement:"corner"})}}else{var p=this._getTopRightRect(r,e);if(!h["default"].isUndefined(p)){var f=this._calculateScale(p);a.push({rect:p,scale:f,placement:"corner"})}}else{var g=this._getAboveBottomMenuRect(r,t,i);if(!h["default"].isUndefined(g)){var m=this._calculateScale(g);a.push({rect:g,scale:m,placement:"above_bottom_menu"})}if(!this.isBottomOpaque&&!this.isBottomJustify||!this.props.components.bottomBar){if(this.left){var v=this._getBottomLeftRect(r,o);if(!h["default"].isUndefined(v)){var y=this._calculateScale(v);a.push({rect:v,scale:y,placement:"corner"})}}else{var b=this._getBottomRightRect(r,o,t);if(!h["default"].isUndefined(b)){var w=this._calculateScale(b);a.push({rect:b,scale:w,placement:"corner"})}}var _=this._getInsideBottomMenuRect(o,t);if(!h["default"].isUndefined(_)){var P=this._calculateScale(_);a.push({rect:_,scale:P,placement:"inside_bottom_menu"})}}}return a},o.prototype._calculateScale=function(t){var e=this.img.naturalHeight,i=this.img.naturalWidth,n=t.height,o=t.width,r=1,a=1;!this.fbLogo||0!==i&&0!==e||(i=this.fbLogo.width,e=this.fbLogo.height),e>n&&(r=n/e),i>o&&(a=o/i);var s=Math.min(a,r,1);return s},o.prototype._getBottomRightRect=function(t,e,i){var n=Math.floor(t.height/2)-y,o=i?i.width-Math.max(e.x+e.width,t.x+t.width)-y:t.x-y;return r({width:o,height:n,right:y,bottom:y})},o.prototype._getBottomLeftRect=function(t,e){var i=Math.floor(t.height/2)-y,n=e?Math.min(e.x,t.x)-y:t.x-y;return r({left:y,width:n,height:i,bottom:y})},o.prototype._getTopRightRect=function(t,e){var i=e?e.height+y:y,n=Math.floor(t.height/2)-y,o=t.x-y;return r({top:i,width:o,height:n,right:y})},o.prototype._getTopLeftRect=function(t,e){var i=e?e.height+y:y,n=Math.floor(t.height/2)-y,o=t.x-y;return r({left:y,top:i,width:o,height:n})},o.prototype._getInsideBottomMenuRect=function(t,e){if(!h["default"].isUndefined(e)){var i=e.y,n=e.height,o=(e.width-t.width)/2-2*y;if(this.left)var a=y;else var s=y;return r({width:o,height:n,top:i,left:a,right:s})}},o.prototype._getAboveBottomMenuRect=function(t,e,i){if(!h["default"].isUndefined(e)){var n=Math.floor(t.y+t.height/2+y),o=e.y-n-y,a=i.width-t.x-t.width-2*y,s=e.height+y;if(this.left)var l=y;else var d=y;return r({width:a,height:o,bottom:s,left:l,right:d})}},o.prototype._getMiniModeRect=function(t){var e={};switch(e.height=t.height-2*y,e.width=Math.floor(t.width/4-y),this.properties.position){case"top-left":e.top=e.left=y;break;case"top-right":e.top=e.right=y;break;case"bottom-right":e.right=e.bottom=y;break;case"bottom-left":e.left=e.bottom=y}return r(e)},o.prototype.getDataUrl=function(){return"data:image/svg+xml;base64,"+btoa(g["default"])},o.prototype._getRect=function(t,e){e=e||this.container;var i=t.getBoundingClientRect(),n=e.getBoundingClientRect();if(0!==i.width&&0!==n.width)return{x:i.left-n.left,y:i.top-n.top,width:i.width,height:i.height}},e["default"]=o}).call(e,i(6))},function(t,e){t.exports=''; },function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){this.x=t,this.y=e}function r(t){s["default"].call(this,t)}Object.defineProperty(e,"__esModule",{value:!0});var a=i(27),s=n(a),l=i(4),h=n(l),d=i(10),u=n(d),c=i(0),p=n(c),f=i(16),g=n(f),m=i(2),v=n(m),y=i(7),b=n(y),w=i(3),_=n(w),P={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",transition:"transitionend"};r.prototype=new s["default"],r.prototype.constructor=r,r.prototype.init=function(t,e){var i={contentProvider:null,unitSizeProvider:null,animate:null};if(p["default"].extend(i,e),this._genDOM(t),this.unitPageSizeProvider=i.unitSizeProvider,i.animate?this.zoomFactor=i.animate.from:this.zoomFactor=i.zoom||this._calcZoomFactorToFitWidth(this.unitPageSizeProvider.getUnitPageSize()),this.contentProvider=i.contentProvider,this.globalWidth=this.mainContainer.clientWidth,this.globalHeight=this.mainContainer.clientHeight,this.dragSliderCenter=!1,this.maxPullSize=this.globalWidth/7,this.currentPageCorner=new o(0,0),this.leftPageCorner=new o(0,0),this.rightPageCorner=new o(0,0),this.contentCorner=new o(0,0),this.leftContentCorner=new o(0,0),this.rightContentCorner=new o(0,0),this.contentCornerStore=new o(0,0),this.currentPageCornerStore=new o(0,0),this.on("slideAnimation:start",function(){this.presenter.onStartDrag()},this),this.on("slideAnimation:end",function(){this.presenter.onPageChanged()},this),this.on("zoomAnimation:start",function(){this.presenter.freeze()},this),this.on("zoomAnimation:end",function(){this.presenter.unfreeze()},this),this._newWrapper("current"),this._newWrapper("right"),this._newWrapper("left"),this._bindCurrentWrapperDOM(),this._setCurrentWrapperPosition(),this.container=t,i.animate){var n=i.animate.to||this._calcZoomFactorToFitWidth(this.unitPageSizeProvider.getUnitPageSize());this.setZoomValue(n,p["default"].isObject(i.animate.center)?i.animate.center:null,i.animate.duration)}},r.prototype.getDOMElement=function(){return this.zoomFrame},r.prototype.getZoomValue=function(){return this.zoomFactor},r.prototype.setZoomValue=function(t,e,i,n){if(i=i||0,this.zoomFactor!==t||p["default"].isObject(e)){var o=this.zoomFactor||1;n||(this.zoomFactor=t),this._scaleCurrentWrapper(t/o,p["default"].isObject(e)?e:null,i,n),this.trigger("zoom",t,o)}},r.prototype._genDOM=function(t){var e=this,i=v["default"].createElement("div",{id:"zoom-frame","class":"zoom-frame"},t);this.zoomFrame=i,this.mainContainer=v["default"].createElement("div",{id:"zoom-body","class":"zoom-body"},i),this.leftArrow=v["default"].createElement("span",{"class":"slide-arrow icon icon-book-prev"},"zoom-frame","top"),this.rightArrow=v["default"].createElement("span",{"class":"slide-arrow icon icon-book-next"},"zoom-frame"),(0,b["default"])(this.leftArrow).on("tap",p["default"].throttle(function(){e.presenter.goLeft(!0)},800,{leading:!0})),(0,b["default"])(this.rightArrow).on("tap",p["default"].throttle(function(){e.presenter.goRight(!0)},800,{leading:!0}))},r.prototype.setLeftArrowVisible=function(t){this.leftArrow.style.display=t?"inline-block":"none"},r.prototype.setRightArrowVisible=function(t){this.rightArrow.style.display=t?"inline-block":"none"},r.prototype.getContainer=function(){return this.mainContainer},r.prototype._newWrapper=function(t,e){e=e||null,t=t||"right";var i=v["default"].createElement("div",{"class":"wrapper"});i.dataset.position=t;var n;this.contentProvider&&(n=this.contentProvider.getContentForPage(t,e));var o=this.unitPageSizeProvider.getUnitPageSize(),r={width:o.width*this.zoomFactor,height:o.height*this.zoomFactor};n&&n.isWide()&&(r.height=r.height/2),r.height=Math.round(r.height),r.width=Math.round(r.width);var a=v["default"].createElement("div",{"class":"slide-content",styles:{width:r.width+"px",height:r.height+"px",position:"absolute",overflow:"hidden"}},i);n&&(a.appendChild(n.getViewElement()),n.resize(r),n.sendContentSizeThr1("zoomPage")),"left"===t?this.mainContainer.insertBefore(i,this.mainContainer.getElementsByTagName("div")[0]):this.mainContainer.appendChild(i),this[t+"Wrapper"]={container:i,content:a,contentObject:n,hammer:new b["default"](a,{prevent_default:!0})},this[t+"Wrapper"].hammer.add(new b["default"].Pan({direction:b["default"].DIRECTION_ALL,threshold:0})),n&&p["default"].defer(function(){var t=i.getBoundingClientRect();n.sendContentSizeThr2("zoomRect",t.width,t.height)})},r.prototype.getCurrentWrappers=function(){var t=this,e={};return p["default"].each(["left","current","right"],function(i){t[i+"Wrapper"]&&t[i+"Wrapper"].contentObject&&(e[i]=t[i+"Wrapper"].content)}),e},r.prototype._bindCurrentWrapperDOM=function(){this._bindCurrentWrapperDragEvent(),this._initSizes(0)},r.prototype._unbindCurrentWrapperDOM=function(){P[g["default"].prefixed("transition")]&&this.currentWrapper.container.removeEventListener(P[g["default"].prefixed("transition")],this._animationEnd),this._unbindCurrentWrapperDragEv()},r.prototype._setCurrentWrapperPosition=function(){var t=this.currentWrapper.content;this.leftWrapper&&this.leftWrapper.contentObject||v["default"].addClass(t,"left"),this.rightWrapper&&this.rightWrapper.contentObject||v["default"].addClass(t,"right")},r.prototype._bindCurrentWrapperDragEvent=function(){var t=this;this._tapStart=function(e){var i={deltaX:e.deltaX,deltaY:e.deltaY};t._startRender.call(t,i),i=null},this._tapMove=function(e){if(!window.FBPublication.moveLock){var i={deltaX:e.deltaX,deltaY:e.deltaY};t._render.call(t,i,0,e.noMomentum)}},this._tapEnd=function(e){var i={deltaX:e.deltaX,deltaY:e.deltaY};t._stopRender.call(t,i),i=null},this.currentWrapper.hammer.on("panstart",this._tapStart),this.currentWrapper.hammer.on("pan",this._tapMove),this.currentWrapper.hammer.on("panend",this._tapEnd);var e,i={deltaX:0,deltaY:0,noMomentum:!0};this._onWheel=function(n){n.preventDefault&&n.preventDefault();var o=h["default"].normalizeWheel(n);e||t._tapStart(i),clearTimeout(e),e=setTimeout(function(){t._tapEnd(i),e=void 0,i.deltaX=0,i.deltaY=0},250),i.deltaX-=o.pixelX,i.deltaY-=o.pixelY,t._tapMove(i)},h["default"].onWheel(this.currentWrapper.container,this._onWheel)},r.prototype._unbindCurrentWrapperDragEv=function(){this.currentWrapper.hammer.off("panstart",this._tapStart),this.currentWrapper.hammer.off("pan",this._tapMove),this.currentWrapper.hammer.off("panend",this._tapEnd),h["default"].removeOnWheel(this.currentWrapper.container,this._onWheel)},r.prototype._onWheel=function(){},r.prototype._tapStart=function(){},r.prototype._tapMove=function(){},r.prototype._tapEnd=function(){},r.prototype._calcZoomFactorToFitWidth=function(t){return this.mainContainer.getBoundingClientRect().width/t.width},r.prototype._calcZoomFactorToCoverScreen=function(t){var e=this.mainContainer.getBoundingClientRect(),i=e.width,n=e.height,o=i/n,r=t.width/t.height,a=o0?(t||(r.y=l.y),r.y=l.y+(i?0:r.y/3)):Math.abs(o)>d?(t||(r.y=l.y-d),r.y=l.y-d+(i?0:(r.y+d)/3)):l.y=s.y,h<0?(l.x=r.x-Math.abs(h)/2,r.x=Math.abs(h)/2):n>0?(l.x=r.x,r.x=0):Math.abs(n)>h?(l.x=r.x+h,r.x=-h):l.x=s.x,this.leftPageCorner.x=l.x-this.globalWidth,this.rightPageCorner.x=l.x+this.globalWidth,this.leftPageCorner.y=l.y,this.rightPageCorner.y=l.y,this._setStyles(e)},r.prototype._setStyles=function(t,e){t=t||0,e=e||"cubic-bezier(0,0,1,1)";var i=this.leftWrapper.container,n=this.currentWrapper.container,o=this.rightWrapper.container,r=this.currentWrapper.content,a=g["default"].prefixedCSS("transition-timing-function");u["default"].transition(i,t,"transform"),u["default"].transition(n,t,"transform"),u["default"].transition(o,t,"transform"),u["default"].transition(r,t,"transform"),i.style[a]=e,n.style[a]=e,o.style[a]=e,r.style[a]=e,u["default"].translate(i,this.leftPageCorner.x,this.leftPageCorner.y),u["default"].translate(n,this.currentPageCorner.x,this.currentPageCorner.y),u["default"].translate(o,this.rightPageCorner.x,this.rightPageCorner.y),u["default"].translate(r,Math.round(this.contentCorner.x),Math.round(this.contentCorner.y))},r.prototype._startRender=function(t){this.contentCornerStore.x=this.contentCorner.x,this.contentCornerStore.y=this.contentCorner.y,this.currentPageCornerStore.x=this.currentPageCorner.x,this.currentPageCornerStore.y=this.currentPageCorner.y,this.trigger("slideAnimation:start"),this._render(t)},r.prototype._stopRender=function(t,e,i){e="undefined"==typeof e?400:e,i=i||!1;var n=this;if("stop"!==i&&(this.currentPageCorner.x<0&&Math.abs(this.currentPageCorner.x)>this.maxPullSize||"left"===i)){var o=this.rightWrapper.content.childNodes.length;if(!i&&!o)return void this._render(!1,e);this._animationEnd=function(){i||n.presenter.goRight(),n._goToLeft.call(n),n.trigger("slideAnimation:end")},P[g["default"].prefixed("transition")]?this.currentWrapper.container.addEventListener(P[g["default"].prefixed("transition")],this._animationEnd):p["default"].delay(this._animationEnd,e),this.contentCorner.x=-(this.globalWidth+this.deltaWidth),this.deltaWidth<0&&(this.contentCorner.x+=this.deltaWidth/2)}else if("stop"!==i&&(this.currentPageCorner.x>0&&Math.abs(this.currentPageCorner.x)>this.maxPullSize||"right"===i)){var r=this.leftWrapper.content.childNodes.length;if(!i&&!r)return void this._render(!1,e);this._animationEnd=function(){i||n.presenter.goLeft(),n._goToRight.call(n),n.trigger("slideAnimation:end")},P[g["default"].prefixed("transition")]?this.currentWrapper.container.addEventListener(P[g["default"].prefixed("transition")],this._animationEnd):p["default"].delay(this._animationEnd,e),this.contentCorner.x=this.globalWidth,this.deltaWidth<0&&(this.contentCorner.x-=this.deltaWidth/2)}t&&this.presenter.onEndDrag(),this._render(!1,e)},r.prototype._comeOutCorrection=function(t,e,i){var n=this.currentWrapper.content.getBoundingClientRect(),r=this.currentWrapper.container.getBoundingClientRect(),a={width:n.width,height:n.height,top:n.top-r.top,left:n.left-r.left},s={width:n.width*i,height:n.height*i,top:a.top-(e*i-e),left:a.left-(t*i-t)};if(s.width0?t=a.left/(i-1):s.left+s.width0?e=a.top/(i-1):s.top+s.height0){if(1===e.length)return[this.pager.pageTable.getPageIndexById(e[0])];if(e[0]===e[1]){var n=this.pager.pageTable.getPageIndexById(e[0]);return[n,n+1]}return l["default"].map(e,function(t){return i.pager.pageTable.getPageIndexById(t)})}return[]},o.prototype.print=function(t){t&&(this.set("pagesForPrint",t),this.isReadyToPrint?this._print():this.once("change:isReadyToPrint",this._print,this))},o.prototype._print=function(){this.isReadyToPrint&&t.print()},o.prototype.reset=function(){this.set("isReadyToPrint",!1),a["default"].del("print-view"),this._onPagerStateChange(this.pager.getState())},o.prototype._preparePrintData=function(t){var e,i=this;if(0!==t.length){this.isReadyToPrint=!1,a["default"].id("print-view")?(e=a["default"].id("print-view"),e.innerHTML=""):e=a["default"].createElement("div",{"class":"print-view",id:"print-view"},this.container);var n=[],o=function(t,o){var r=t.getProperty("wide"),s=a["default"].createElement("div",{"class":"page-container"},e),l=function(t){n.push(t.id),n.length===i.pagesForPrint.length&&i.set("isReadyToPrint",!0)},h=a["default"].createElement("img",{styles:{width:r?"200%":"100%",height:"100%",display:"block","margin-left":r&&o?"-100%":"0"}},s);i.crossOrigin&&(h.crossOrigin=i.crossOrigin),h.onload=function(){if(t.getProperty("textLayer")){var e=a["default"].createElement("img",{styles:{width:r?"200%":"100%",position:"absolute",top:0,left:r&&o?"-100%":"0",display:"block"}},s,"after",h);i.crossOrigin&&(e.crossOrigin=i.crossOrigin),e.onload=function(){l(t)},e.src=t.getTextLayerUrl(!0)}else l(t)},h.src=t.getSubstrateUrl(!0),a["default"].createElement("div",{"class":"page-break"},s)};l["default"].each(t,function(t){var e=!1,n=i.pager.pageTable.getStructure()[t];l["default"].isNull(n)&&(e=!0,n=i.pager.pageTable.getPageIdByIndex(t)),o(i.pager.pageTable.getPageModel(n),e)})}},e["default"]=o}).call(e,i(6))},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t,e,i,n,o){this.noteData=o,window.noteData=this.noteData,this.props=t,this.workspaceProperties=e,this.flipDisabled=!this.workspaceProperties.components.book.flip,this.pager=i,this.zoomScaleValue=null,this.zoomChangeAnimation=!1,this.isReady=!1,this.searchQuery="",this.textSelectionMode=!1,this.isSearchActive=!1,this.searchCharactersLimit=e.search&&e.search.searchCharactersLimit?e.search.searchCharactersLimit:1,this.browser=n}Object.defineProperty(e,"__esModule",{value:!0});var r=i(1),a=n(r),s=i(0),l=n(s);o.prototype=new a["default"],o.prototype.constructor=o,o.prototype.getPageTable=function(){return this.getPager().pageTable},o.prototype.getPager=function(){return this.pager},o.prototype.hasPages=function(){var t=this.getPageTable().getStructure();return!l["default"].isUndefined(t)&&t.length>0},o.prototype.getProps=function(){return this.props},o.prototype.getWorkspaceProperties=function(){return this.workspaceProperties},o.prototype.setZoomScaleValue=function(t){this.set("zoomScaleValue",t)},o.prototype.setSearchQuery=function(t){this.set("textSelectionMode",!1),t=t||"",this.set("searchQuery",t),""!==t?this.set("isSearchActive",!0):this.set("isSearchActive",!1)},e["default"]=o},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t){this.model=t,this.model.getPager().on("change:state",this._onPagerStateChange,this),this.model.getProps().on("change:rightToLeft change:hardcover change:bookSize change:pageFlippingDuration",function(){this.currentPresenter&&(this.currentPresenter.destroy(),this._changePresenterTo(this._createPresenter().init(this.container)))},this),this.model.getWorkspaceProperties().on("change:bookSize",function(){this.currentPresenter&&(this.currentPresenter.destroy(),this._changePresenterTo(this._createPresenter().init(this.container)))},this)}Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=n(r),s=i(1),l=n(s),h=i(29),d=n(h),u=i(11),c=n(u),p=i(97),f=n(p),g=i(98),m=n(g),v=i(99),y=n(v),b=i(3),w=n(b);o.prototype=new l["default"],o.prototype.constructor=o,o.prototype.destructor=function(){a["default"].isFunction(this.currentPresenter.destructor)&&this.currentPresenter.destructor()},o.prototype.getBookState=function(){return(0,w["default"])().get(w["default"].BOOK_STATE)},o.prototype.init=function(t){this.container=t;var e=this;return this._onPageActivate=function(t){e._notify("onPageActivate",t)},this._onPageChanged=function(t){e._notify("onPageChanged",t),e.getBookState().endChangingPosition()},this._onPageChanging=function(t){e._notify("onPageChanging",t)},this._onStartDrag=function(t){e._notify("onStartDrag",t)},this._onEndDrag=function(t){e._notify("onEndDrag",t)},this.model.hasPages()&&(this.currentPresenter=this._initPresenter(this._createPresenter().init(t))),this},o.prototype.resize=function(t){this.currentPresenter&&this.currentPresenter.resize(t)},o.prototype._onPagerStateChange=function(t,e,i,n){if(this.currentPresenter){var o,r,s,l=this;t.zoomMode!==e.zoomMode?(this.getBookState().startChangingZoom(e,t),this.model.getPager().freeze(this),a["default"].each(a["default"].uniq([e.leftPage,e.rightPage]),function(t){t&&l.currentPresenter.onPageDeactivate(t)}),r=this._createPresenter(),t.zoomMode?(s={target:n},o=new y["default"](this.model.getPager(),this.currentPresenter,r)):(s={pageId:e.leftPage},o=new m["default"](this.model.getPager(),this.currentPresenter,r)),o.once("end",function(t){this.clear(),l.model.getPager().unfreeze(l),l._changePresenterTo(r.init(l.container,t)),l._notify("zoomTransitionEnd"),l.getBookState().endChangingZoom()}),o.start(this.container,s)):(this.getBookState().startChangingPosition(e,t),this.currentPresenter.onPagerStateChange(t,e,i,n))}},o.prototype._createPresenter=function(){var t;return t=this.model.getPager().getState().zoomMode||this.model.flipDisabled?new d["default"](this.model):new c["default"](new f["default"](this.model)),(0,w["default"])().set(w["default"].CURRENT_PRESENTER,t),t},o.prototype._notify=function(t,e){this.trigger(t,e)},o.prototype._changePresenterTo=function(t){this.currentPresenter&&this._destroyCurrentPresenter(),this._initPresenter(t),this.currentPresenter=t,this._notify("onPresenterChanged")},o.prototype._destroyCurrentPresenter=function(){this.currentPresenter&&(this.stopListening(this.currentPresenter,"onPageActivate",this._onPageActivate),this.stopListening(this.currentPresenter,"onPageChanged",this._onPageChanged),this.stopListening(this.currentPresenter,"onPageChanging",this._onPageChanging),this.stopListening(this.currentPresenter,"onStartDrag",this._onStartDrag),this.stopListening(this.currentPresenter,"onEndDrag",this._onEndDrag),a["default"].isFunction(this.currentPresenter.destructor)&&this.currentPresenter.destructor())},o.prototype._initPresenter=function(t){return this.listenTo(t,"onPageActivate",this._onPageActivate),this.listenTo(t,"onPageChanged",this._onPageChanged),this.listenTo(t,"onPageChanging",this._onPageChanging),this.listenTo(t,"onStartDrag",this._onStartDrag),this.listenTo(t,"onEndDrag",this._onEndDrag),t},e["default"]=o},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t){this.bookModel=t,this.bookModel.getProps().on("all",this._trigger,this),this.bookModel.getWorkspaceProperties().on("change:components.notes",this._triggerNotes,this)}Object.defineProperty(e,"__esModule",{value:!0});var r=i(1),a=n(r);o.prototype=Object.create(a["default"].prototype),o.prototype.getBookModel=function(){return this.bookModel},o.prototype.getPager=function(){return this.bookModel.getPager()},o.prototype.getPageTable=function(){return this.bookModel.getPageTable()},o.prototype.isHardcover=function(){return this.bookModel.props.hardcover},o.prototype.getHardcoverSize=function(){return this.isHardcover()?10:0},o.prototype.getCoverColor=function(){return this.bookModel.props.hardcoverColor},o.prototype.getPadding=function(){return(100-this.bookModel.workspaceProperties.bookSize)/100},o.prototype.getNotesEnabled=function(){return this.bookModel.workspaceProperties.components.notes===!0},o.prototype.getBookSize=function(){return this.bookModel.props.bookSize},o.prototype.getPagesCount=function(){return this.getPageTable().getPagesCount()},o.prototype.getFlippingDuration=function(){return 1e3*this.bookModel.props.pageFlippingDuration},o.prototype.getFlipCorner=function(){return this.bookModel.props.flipCorner},o.prototype.isFirstPageState=function(t){return this.getPager().isFirstPage(t)},o.prototype.isLastPageState=function(t){return this.getPager().isLastPage(t)},o.prototype.isFrontInsideCoverPageState=function(t){return!!this.isHardcover()&&(t=t||this.getPager().getState(),!!t.leftPage&&1===this.getPageTable().getPageIndexById(t.leftPage))},o.prototype.isBackInsideCoverPageState=function(t){if(!this.isHardcover())return!1;if(t=t||this.getPager().getState(),!t.leftPage)return!1;var e=this.getPageTable().getPageIndexById(t.leftPage),i=this.getPagesCount()-1;return e===i-1||e===i-2},o.prototype.hasBackOutsideCover=function(){return this.isHardcover()*this.getPagesCount()%2===0},o.prototype.getBrowser=function(){return this.bookModel.browser},o.prototype._triggerNotes=function(t){this._trigger("CHANGE_NOTES_COMPONENT",t)},o.prototype._trigger=function(t,e,i){this.trigger(t,e,i)},o.prototype.destroy=function(){this.bookModel.getProps().off("all",this._trigger,this),this.bookModel.getWorkspaceProperties().off("change:components.notes",this._triggerNotes,this)},e["default"]=o},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t,e,i){this.pager=t,this.turnJSPresenter=i,this.slidePresenter=e,this.zoomOutDuration=400,this.animationDuration=400,this.animationDelay=40}Object.defineProperty(e,"__esModule",{value:!0});var r=i(2),a=n(r),s=i(10),l=n(s),h=i(0),d=n(h),u=i(16),c=n(u),p=i(30),f=n(p);o.prototype=new f["default"],o.prototype.constructor=o,o.prototype.start=function(t,e){this.container=t,this.slidePresenter.pre_destroy();var i=this,n=e.pageId,o=this.pager.isRtl(),r=this.pager.pageTable.getPageModel(n),a=r.getProperty("wide"),s=this.pager.pageTable.getPageIndexById(n);this.turnJSPresenter.bookSizeProvider.setRect(t.getBoundingClientRect());var h=this.turnJSPresenter.bookSizeProvider.getPageSize(s+1),u=a?2:1;this.slidePresenter.setZoomValue(h.width/this.slidePresenter.getUnitPageSize().width*u,null,400,!a),d["default"].delay(function(){var e,r=i.pager.getState(),s=i.animationDelay;if(!a){var u=i.slidePresenter.getDataForTransitionStart();r.leftPage===n?(i.leftPage=i._clonePage(u.current,h),i.leftPage.style.zIndex=2,e=o?u.left:u.right,e&&(i.rightPage=i._clonePage(e,h,u.current.getBoundingClientRect()),i.rightPage.style.zIndex=1)):(e=o?u.right:u.left,e&&(i.leftPage=i._clonePage(e,h,u.current.getBoundingClientRect()),i.leftPage.style.zIndex=1),i.rightPage=i._clonePage(u.current,h),i.rightPage.style.zIndex=2),i.leftPage&&i.rightPage&&(t.appendChild(i.leftPage),t.appendChild(i.rightPage),d["default"].delay(function(){var t=o?-1:1;l["default"].changeOnlyTranslate(i.leftPage,.5*-h.width*t),l["default"].changeOnlyTranslate(i.rightPage,.5*h.width*t)},i.animationDelay),s=1.4*i.animationDuration)}d["default"].delay(function(){i._end()},s),d["default"].delay(function(){i.slidePresenter.destroy()},i.animationDelay)},1.25*this.zoomOutDuration)},o.prototype._clonePage=function(t,e,i){var i=i||t.getBoundingClientRect(),e=e||t.getBoundingClientRect(),n=this.container.getBoundingClientRect(),o=t.cloneNode(!0);return a["default"].css(o,{position:"absolute",top:i.top-n.top+"px",left:i.left-n.left+"px"}),o.style[c["default"].prefixedCSS("transform")]="translate3d(0px, 0px, 0px) scale("+e.width/t.offsetWidth+")",o.style.overflow="hidden",l["default"].origin(o,0,0),l["default"].transition(o,this.animationDuration,"transform"),o},o.prototype._end=function(){this.trigger("end",this.outputOpts)},o.prototype.clear=function(){this.leftPage&&this.leftPage.parentNode&&a["default"].del(this.leftPage),this.rightPage&&this.rightPage.parentNode&&a["default"].del(this.rightPage)},e["default"]=o},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t,e,i){this.pager=t,this.turnJSPresenter=e,this.slidePresenter=i,this.outputOpts={animate:{from:1,duration:500}},this.animationDelay=40,this.animationTime=400}Object.defineProperty(e,"__esModule",{value:!0});var r=i(2),a=n(r),s=i(10),l=n(s),h=i(30),d=n(h),u=i(0),c=n(u);o.prototype=new d["default"],o.prototype.constructor=o,o.prototype.start=function(t,e){this.container=t,e.target&&e.target.center&&(this.outputOpts.animate.center=e.target.center),this.startTransitionData=this.turnJSPresenter.getDataForTransitionStart();var i,n,o=this.turnJSPresenter.model.getPageTable(),r=this.turnJSPresenter.model.getPager(),a=o.getPageIndexById(r.getState().leftPage),s=o.getPageModel(r.getState().leftPage),h=s.getProperty("wide"),d=o.getPagesCount(),u=this;r.isRtl()?(i=a%2===0?a:a+1,n=a%2===0?a-1:a):(i=a%2===0?a-1:a,n=a%2===0?a:a+1);var p=this.turnJSPresenter.bookSizeProvider.getPageSize(a+1);this.outputOpts.animate.fromRect=p,0===a||a===d-1?c["default"].delay(function(){u._end()},this.animationDelay):(this.leftClone=this._clonePage(i),this.rightClone=this._clonePage(n),a===i?(this.leftClone.style.zIndex=2,this.rightClone.style.zIndex=1):(this.leftClone.style.zIndex=1,this.rightClone.style.zIndex=2),t.appendChild(this.leftClone),t.appendChild(this.rightClone),h?(p.width*=2,this.outputOpts.animate.fromRect=p):c["default"].delay(function(){l["default"].translate(u.leftClone,.5*p.width),l["default"].translate(u.rightClone,.5*-p.width)},this.animationDelay),c["default"].delay(function(){u._end()},1.4*this.animationTime)),c["default"].delay(function(){u.turnJSPresenter.destroy()},this.animationDelay)},o.prototype._clonePage=function(t){var e=this.startTransitionData[t],i=e.getBoundingClientRect(),n=this.container.getBoundingClientRect(),o=e.cloneNode(!0);return l["default"].transition(o,this.animationTime,"transform"),a["default"].css(o,{position:"absolute",top:i.top-n.top+"px",left:i.left-n.left+"px",backgroundColor:""}),o},o.prototype._end=function(){this.trigger("end",this.outputOpts)},o.prototype.clear=function(){this.leftClone&&a["default"].del(this.leftClone),this.rightClone&&a["default"].del(this.rightClone)},e["default"]=o},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=document.attachEvent,o=!1;if(!n){var r=function(){var t=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(t){return window.setTimeout(t,20)};return function(e){return t(e)}}(),a=function(){var t=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.clearTimeout;return function(e){return t(e)}}(),s=function(t){var e=t.__resizeTriggers__,i=e.firstElementChild,n=e.lastElementChild,o=i.firstElementChild; n.scrollLeft=n.scrollWidth,n.scrollTop=n.scrollHeight,o.style.width=i.offsetWidth+1+"px",o.style.height=i.offsetHeight+1+"px",i.scrollLeft=i.scrollWidth,i.scrollTop=i.scrollHeight},l=function(t){return t.offsetWidth!=t.__resizeLast__.width||t.offsetHeight!=t.__resizeLast__.height},h=function(t){var e=this;s(this),this.__resizeRAF__&&a(this.__resizeRAF__),this.__resizeRAF__=r(function(){l(e)&&(e.__resizeLast__.width=e.offsetWidth,e.__resizeLast__.height=e.offsetHeight,e.__resizeListeners__.forEach(function(i){i.call(e,t)}))})},d=!1,u="animation",c="",p="animationstart",f="Webkit Moz O ms".split(" "),g="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),m="",v=document.createElement("fakeelement");if(void 0!==v.style.animationName&&(d=!0),d===!1)for(var y=0;y div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',e=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t)),e.appendChild(i),o=!0}},T=function(t,e,i){if(n)t.attachEvent("onresize",e);else{if(!t.__resizeTriggers__){var o=getComputedStyle(t).position;"static"!=o||i||(t.style.position="relative"),P(),t.__resizeLast__={},t.__resizeListeners__=[],(t.__resizeTriggers__=document.createElement("div")).className="resize-triggers",t.__resizeTriggers__.innerHTML='
',t.appendChild(t.__resizeTriggers__),s(t),t.addEventListener("scroll",h,!0),p&&t.__resizeTriggers__.addEventListener(p,function(e){e.animationName==b&&s(t)})}t.__resizeListeners__.push(e)}},E=function(t,e){n?t.detachEvent("onresize",e):(t.__resizeListeners__.splice(t.__resizeListeners__.indexOf(e),1),t.__resizeListeners__.length||(t.removeEventListener("scroll",h),t.__resizeTriggers__=!t.removeChild(t.__resizeTriggers__)))};e.addResizeListener=T,e.removeResizeListener=E},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t,e,i){if(this.isActive=!1,this.pager=e,this.properties=t,this.bookPresenter=i,t.auto&&t.enabled){var n=this;this.on("change:isReady",function(){d["default"].defer(function(){n.start(!0)})})}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(1),a=n(r),s=i(3),l=n(s),h=i(0),d=n(h);o.prototype=new a["default"],o.prototype.constructor=o,o.prototype.getApiProvider=function(){return(0,l["default"])().get(l["default"].API)},o.prototype.next=function(t){if(this.isActive){var e=this.pager.getState();if(e.zoomMode!==this.zoomMode)return void this.stop();if(!this.pager.goForward("slideshow")){if(!this.properties.loop&&!t)return void this.stop();this.pager.goToFirst("slideshow")}this.bookPresenter.once("onPageChanged",function(){if(this.isActive){var t=this;this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(function(){t.next()},this.properties.interval)}},this)}},o.prototype.tryToStopByInteruptors=function(t){"slideshow"!=this.pager.initiator&&this.stop()},o.prototype.start=function(t){if(this.properties.enabled)if(this.zoomMode=this.pager.getState().zoomMode,this.pager.on("change:state",this.tryToStopByInteruptors,this),this.set("isActive",!0),this.getApiProvider().trigger("slideshow",{action:"start"}),t){var e=this;this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(function(){e.next()},this.properties.interval)}else this.next(!0)},o.prototype.stop=function(){this.timeout&&clearTimeout(this.timeout),this.pager.off("change:state",this.tryToStopByInteruptors,this),this.set("isActive",!1),this.getApiProvider().trigger("slideshow",{action:"stop"});this.pager.getState()},o.prototype.toggle=function(){this.isActive?this.stop():this.start()},e["default"]=o},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(){}Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=n(r),s=i(15),l=n(s),h=i(103),d=n(h);o.prototype=new l["default"],o.prototype.constructor=o,o.prototype.getNewLocale=function(t,e){var i=t?t:[],n=e?e:d["default"]?d["default"].locales:[],o=d["default"]?d["default"].substitutes:{},r="en";if(n&&n.length>0&&(r=n[0]),i){for(var s in o)if(o.hasOwnProperty(s)){var l=a["default"].indexOf(i,s);l>=0&&(i[l]=o[s])}for(var h=0;h=0){r=i[h];break}}return r},o.prototype.getFontConfig=function(){if(this.locale&&d["default"].fonts){var t=a["default"].filter(d["default"].fonts,function(t){return a["default"].indexOf(t.locales,this.locale)!==-1},this);if(t.length>0)return t[0]}},o.prototype.isLocaleRTL=function(){return!(!this.locale||!d["default"].rtl)&&a["default"].indexOf(d["default"].rtl,this.locale)!==-1},o.prototype.set=function(t,e,i){for(var n=t.split("."),o=this,r=0;r1?1:0},russian:function(t){return t%10===1&&t%100!==11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2},polish:function(t){return 1===t?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2}},d={chinese:["ar","ja","ko","tr","zh"],german:["de","en","es","fi","he","it","nl","no","pt","sv"],french:["fr"],russian:["ru"],polish:["pl"]};return null!==e&&t?(s=t.split("|"),l=s[o(this.locale,e)]||s[0],a=r(l)):a=t,a},e["default"]=o},function(t,e){t.exports={locales:["en","ar","de","es","fi","fr","he","it","ja","nl","no","pl","pt","ru","sv","tr","zh"],substitutes:{nb:"no",nn:"no",be:"ru"},rtl:["ar","he"],fonts:[{locales:["de","en","es","fi","fr","it","nl","no","pl","pt","sv","tr"],"font-family":"Open Sans",subset:"latin-ext","font-weight-bold":"800","font-weight-normal":"600"},{locales:["ar"],"font-family":"Cairo",subset:"arabic","font-weight-bold":"700","font-weight-normal":"600"},{locales:["he"],"font-family":"Rubik",subset:"hebrew","font-weight-bold":"700","font-weight-normal":"500"},{locales:["ru"],"font-family":"Open Sans",subset:"cyrillic,cyrillic-ext","font-weight-bold":"800","font-weight-normal":"600"}]}},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t,e,i,n){this._pager=t,this._pageTable=this._pager.pageTable,this._resourceProvider=e,this._maxLoadingCount=n||8,this._loaderQueue=new u["default"],this._pool=new h["default"](i),this._loaderDictionary=new p["default"],this._loadingCount=0;var o=this;this._onResourceStateChanged=function(t){o._resourceProvider.off(t.id);var e=o._loaderDictionary.get(t.id);o._updateModel(t);for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];n.preloaderHack=!1,n.getState()===s.LoaderState.UNREADY&&(t.state===g.READY?(n.ready(),o._loaderQueue.push(n),o._tryLoad()):n.setError("wrong resource state for "+n.hash()))}}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=n(r),s=i(9),l=i(105),h=n(l),d=i(106),u=n(d),c=i(107),p=n(c),f=window.FBPublication.PageResourceType,g=window.FBPublication.PageResourceState;o.prototype._hash=function(t,e,i){return t+"_"+e+"_"+i},o.prototype.destructor=function(){this._loaderDictionary.destructor(),this._loaderQueue.destructor()},o.prototype._updateModel=function(t){if(!a["default"].isEmpty(t.pageInfo)){var e=this._pageTable,i=e.getPageModel(t.id).getPropertyModel();a["default"].each(t.pageInfo,function(t,e){i.set(e,t)})}},o.prototype.getPageId=function(t){var e=this._pageTable;return e.getPageIdByIndex(t-1)},o.prototype.setBookRange=function(t,e,i){i=i!==!1;var n=this._pager.getState();if(this._currentPages=[],n.leftPage&&this._currentPages.push(n.leftPage),n.rightPage&&this._currentPages.push(n.rightPage),this._pageExclude=e,i&&(this._pageExclude=this._pageExclude.map(this.getPageId,this)),t&&2===t.length){var o,r=[];for(o=t[0];o<=t[1];o++){var s=i?this.getPageId(o):o;0!==r.length&&r[r.length-1]===s||r.push(s)}for(o=0;o0)&&(this._loaderQueue.setBookRange(this._pageExclude,this._currentPages),this._tryLoad()),this.lastRange=this._pageExclude},o.prototype.setVisibleThRange=function(t,e){t=t<0?0:t;var i=a["default"].range(t+1,e+2).map(this.getPageId,this);this._loaderQueue.sortVisibleTh(i)},o.prototype._getUrl=function(t,e,i){var n=this._pageTable.getPageModel(t);if(n){var o;switch(e){case f.SVG:n.getProperty("vectorText")&&(o=n.getSVGLayerUrl());break;case f.PAGE_TEXT:case f.ZOOM_PAGE_TEXT:n.getProperty("textLayer")&&(o=n.getTextLayerUrl(i));break;case f.PAGE_SUBSTRATE:case f.ZOOM_PAGE_SUBSTRATE:o=n.getSubstrateUrl(i);break;case f.THUMBNAIL:o=n.getThumbnailUrl()}return o}},o.prototype.getPageLoader=function(t,e,i){var n=this._loaderDictionary.get(t,e,i),o=this._hash(t,e,i),r=this._pageTable.getPageModel(t),a=this._getUrl(t,e,i);if(a){if(n){if(!n.url()||n.url()===a)return n.uses++,n;this._loaderDictionary.free(n),this._pool.free(n)}var s=this._resourceProvider.getInfo(t);switch(r.isStub()&&(s.state=g.READY),n=this._pool.get(),n.setHash(t,e,i),n.unready(),this._loaderDictionary.push(n),s.state){case g.UNREADY:this._resourceProvider.on(t,this._onResourceStateChanged);break;case g.READY:"undefined"!=typeof s.pageInfo||r.isStub()?(this._updateModel(s),n.ready(),this._loaderQueue.push(n),this._tryLoad()):(n.preloaderHack=!0,this._resourceProvider.on(t,this._onResourceStateChanged));break;default:throw this._loaderDictionary.free(n),this._pool.free(n),new Error("resource "+o+" has "+s+"state")}return n.uses++,n}},o.prototype.freeze=function(){if(!a["default"].isUndefined(this._isFreezed))throw new Error("Publication is freezed already");this._isFreezed=!0},o.prototype.unfreeze=function(){if(this._isFreezed!==!0)throw new Error("Publication is not freezed yet");delete this._isFreezed,this._tryLoad()},o.prototype._tryLoad=function(){if(this._loadingCount0)return this._currentFifo.shift();if(this._thumbFifo.length>0)return this._thumbFifo.shift();if(this._bookFifo.length>0)return this._bookFifo.shift();if(this._otherFifo.length>0)return this._otherFifo.shift();throw new Error("LoaderQueue is empty.")},o.prototype.sortVisibleTh=function(t){function e(e){var i=e.id();return t.indexOf(i)>=0}function i(t){return!e(t)}var n=this._thumbFifo.filter(e);this._thumbFifo=this._thumbFifo.filter(i);var o=this._otherFifo.filter(e);this._otherFifo=this._otherFifo.filter(i),this._thumbFifo=[].concat(n,o,this._thumbFifo)},o.prototype.setBookRange=function(t,e){function i(e){var i=e.id(),n=t.indexOf(i);return n>=0}function n(e){if(e.type()!==s.THUMBNAIL)return!0;var i=e.id(),n=t.indexOf(i);return n>=0}function o(t){var i=t.id(),n=e.indexOf(i);return n>=0}function r(t){if(t.type()!==s.THUMBNAIL)return!0;var i=t.id(),n=e.indexOf(i);return n>=0}function a(t){return!i(t)}function l(t){return!n(t)}function h(t){return!o(t)}function d(t){return!r(t)}var u=this._currentFifo.filter(d);this._currentFifo=this._currentFifo.filter(r),this._otherFifo=this._otherFifo.concat(u);var c=this._otherFifo.filter(n);this._otherFifo=this._otherFifo.filter(l),this._thumbFifo=this._thumbFifo.concat(c);var p=this._thumbFifo.filter(l);this._thumbFifo=this._thumbFifo.filter(n),this._otherFifo=this._otherFifo.concat(p);var f=this._thumbFifo.filter(r);this._thumbFifo=this._thumbFifo.filter(d),this._currentFifo=this._currentFifo.concat(f);var g=this._currentFifo.filter(h);this._currentFifo=this._currentFifo.filter(o),this._waitingBookFifo=this._waitingBookFifo.concat(g);var m=this._waitingBookFifo.filter(i);this._waitingBookFifo=this._waitingBookFifo.filter(a),this._bookFifo=this._bookFifo.concat(m);var v=this._bookFifo.filter(a);this._bookFifo=this._bookFifo.filter(i),this._waitingBookFifo=this._waitingBookFifo.concat(v);var y=this._bookFifo.filter(o);this._bookFifo=this._bookFifo.filter(h),this._currentFifo=this._currentFifo.concat(y)},o.prototype.log=function(t){console.info(t+"-log: \ncur: "+this._currentFifo.toString()+"; \nth: "+this._thumbFifo.toString()+"; \nwait: "+this._waitingBookFifo.toString()+"; \nbook: "+this._bookFifo.toString()+"; \nother: "+this._otherFifo.toString()+"\n\n")},e["default"]=o},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(){this._dictionary={}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=n(r);o.prototype.constructor=o,o.prototype.destructor=function(){for(var t in this._dictionary){var e=this._dictionary[t];a["default"].isFunction(e.destructor)&&e.destructor()}},o.prototype.push=function(t){this._dictionary.hasOwnProperty(t.id())||(this._dictionary[t.id()]={}),this._dictionary[t.id()][t.type()+"_"+t.size()]=t},o.prototype.free=function(t){this._dictionary.hasOwnProperty(t.id())||(this._dictionary[t.id()]={}),this._dictionary[t.id()].hasOwnProperty(t.type()+"_"+t.size())&&delete this._dictionary[t.id()][t.type()+"_"+t.size()]},o.prototype.get=function(t,e,i){if(this._dictionary.hasOwnProperty(t)){var n=this._dictionary[t];return i=i||0,a["default"].isUndefined(e)?n:a["default"].isUndefined(i)?n[e]:n[e+"_"+i]}},e["default"]=o},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(){this.containers={},this.unlockCorners()}Object.defineProperty(e,"__esModule",{value:!0});var r=i(1),a=n(r);o.prototype=new a["default"],o.prototype.constructor=o,o.TOP_LEFT="tl",o.TOP_RIGHT="tr",o.BOTTOM_LEFT="bl",o.BOTTOM_RIGHT="br",o.prototype.unlockCorners=function(){window.FBPublication.hasOwnProperty("lockedCorner")||(window.FBPublication.lockedCorner={}),window.FBPublication.lockedCorner[o.TOP_LEFT]=!1,window.FBPublication.lockedCorner[o.TOP_RIGHT]=!1,window.FBPublication.lockedCorner[o.BOTTOM_LEFT]=!1,window.FBPublication.lockedCorner[o.BOTTOM_RIGHT]=!1},o.prototype.lockCorner=function(t){console.log("lockCorner",t),window.FBPublication.lockedCorner[t]=!0},o.prototype.clickOnWindowItem=function(t,e){this.trigger("clickOnWindowItem:"+t+":"+e)},o.prototype.clickOnIconItem=function(t,e){this.trigger("clickOnIconItem",{pageId:t,noteId:e})},o.prototype.registerContentContainer=function(t,e,i,n){this.containers[t+e]={pageId:t,container:i,presenter:n}},o.prototype.unregisterContentContainer=function(t,e){delete this.containers[t+e]},e["default"]=o},function(t,e){t.exports={toc:{enabled:!0},downloads:{enabled:!1,allPagesVisible:!0,currentPagesVisible:!1},sound:{background:{loop:!0,volume:30},flip:{enabled:!0,volume:25,hard:["blow.mp3"],soft:["flip2.mp3","flip3.mp3","flip4.mp3"]},enabled:!0},print:{currentPagesVisible:!0,selectedPagesVisible:!0},search:{path:"/searchtext.xml",exactMatch:!1,searchCharactersLimit:1,enabled:!1},bookSize:95,components:{book:{flip:!0,slide:!0},notes:!0,bottomBar:!0,zoom:!0,navigation:!1,topBar:!0,embed:!1,fullscreen:!0,print:!0,thumbnails:!0,share:!0,textSelection:!1,slideshow:{enabled:!1,auto:!1,loop:!1,interval:3e3},paginator:{enabled:!0,totalPagesVisible:!0},copyright:{enabled:!1,url:"",target:"_blank",label:""}},thumbType:"AUTO",cookieNotice:{enabled:!1}}},function(t,e){t.exports={links:{color:"#40C6FF",target:"_blank",highlightOnFlip:!0,highlightOnHover:!0},search:{color:"#FFE921"},hardcover:!1,hardcoverColor:"#5a5f63",flipCorner:!0,rightToLeft:!1,numerationOffset:0,pageFlippingDuration:.8,pages:{defaults:{width:0,height:0,thFormat:"",textLayer:!0,substrateFormat:"",substrateZoomFormat:"",stub:!1,slideDelay:2,backgroundColor:"#FFFFFF",wide:!1,pageResize:"FIT",shadowDepth:2}}}},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(){a["default"].constructor.call(this)}Object.defineProperty(e,"__esModule",{value:!0});var r=i(9),a=n(r),s=i(5),l=n(s);o.prototype=Object.create(a["default"].prototype),o.prototype.constructor=o,o.prototype.load=function(){if(!this.destructed){if(this._state!==r.LoaderState.READY)throw new Error(this.hash()+this._history+"Can't load loader with status "+this._state);this._state=r.LoaderState.LOADING;var t=this,e=new Image,i=(0,l["default"])().getCrossOrigin();i&&(e.crossOrigin=i),e.onload=function(){t.destructed||(t._state=r.LoaderState.LOADED,t.trigger(r.LoaderEvent.DATA_IS_READY),t.trigger(r.LoaderEvent.LOADED,t),e=null)},e.onerror=function(i){t.destructed||(t._state=r.LoaderState.ERROR,t.trigger(r.LoaderEvent.ERROR,{url:t._url,errorMsg:i}),e=null)},e.src=this._url,this._loadedData=this._url,this.trigger(r.LoaderEvent.LOADING)}},o.prototype.isDataReady=function(){return this._state>=r.LoaderState.LOADED},o.prototype.toString=function(){return this.hash()},e["default"]=o},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){this.browser=t,a["default"].isUndefined(e)||a["default"].extend(this.params,e)}Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=n(r),s=i(1),l=n(s);o.prototype.constructor=o,o.prototype=new l["default"],o.prototype._formatSize=function(t){var e=t/1048576;return e=e<1?e<.1?(1024*e).toFixed(0)+" KB":e.toFixed(2)+" MB":e<100?e.toFixed(1)+" MB":e.toFixed(0)+" MB"},o.prototype.params={maxWidth:800,honorMarginPadding:!0,honorColor:!1,properties:null,showModal:!0,frameId:"vpJS",border:!0,htmlData:""},o.prototype.PDF="pdf",o.prototype.IMAGE="image",o.prototype.print=function(t,e){function i(){n.focus(),n.contentWindow.print(),e(!0)}document.getElementsByTagName("body")[0].appendChild(this.printFrame);var n=document.getElementById(this.params.frameId);this.printFrame.onload=function(){i()}},o.prototype.setPdfPrintingSupport=function(t){this.pdfSupported=t},o.prototype.isPdfPrintingSupport=function(){return this.pdfSupported!==!1&&!this.browser.firefox&&!this.browser.ie&&!this.browser.msedge},o.prototype.printPdf=function(t,e){if(!a["default"].isFunction(e))return void console.error("callback must be a function");this.init(this.PDF);var i=this;this.xmlHTTP&&this.xmlHTTP.abort(),this.xmlHTTP=new XMLHttpRequest,this.xmlHTTP.open("GET",t),this.xmlHTTP.responseType="arraybuffer","onprogress"in this.xmlHTTP&&(i.xmlHTTP.onprogress=function(t){t.lengthComputable&&i.trigger("progress",t)}),this.xmlHTTP.onload=function(t){i.trigger("loaded",t);var n=new Blob([this.response],{type:"application/pdf"}),o=window.URL.createObjectURL(n);i.printFrame.setAttribute("src",o),i.print(i.PDF,e),i.xmlHTTP=null},this.xmlHTTP.send()},o.prototype.reset=function(){this.xmlHTTP&&this.xmlHTTP.abort(),this.xmlHTTP=void 0},o.prototype.init=function(t){var e=document.getElementById(this.params.frameId);e&&e.parentNode.removeChild(e),this.printFrame=document.createElement("iframe"),this.printFrame.setAttribute("style","display:none;"),this.printFrame.setAttribute("id",this.params.frameId),t!==this.PDF&&(this.printFrame.srcdoc=""),this.printFriendlyElement="max-width: "+this.params.maxWidth+"px !important;"+this.params.font_size+" !important;",this.bodyStyle="font-family:"+this.params.font+" !important; font-size: "+this.params.font_size+" !important; width:100%;",this.headerStyle="font-weight:300;"},e["default"]=o},function(t,e,i){"use strict";function n(){this.wideLinks=[]}Object.defineProperty(e,"__esModule",{value:!0}),n.prototype.constructor=n,n.prototype.pushContent=function(t){if(this.content&&t&&this.content.presenter.model.pageModel.id===t.presenter.model.pageModel.id){var e=this.content;return this.content=null,e}return this.content=t,null},n.prototype.pushLink=function(t,e,i){var n=e+"-"+i;if(this.wideLinks[n]&&t){var o=this.wideLinks[n];return delete this.wideLinks[n],o}return this.wideLinks[n]=t,null},e["default"]=n}]);