1(self.webpackChunk=self.webpackChunk||[]).push([[736],{4080:function(e,n,t){"use strict";var a=t(3992),o=t(1971),r=t.n(o),i=t(6109),s=t.n(i),l=t(90),S=t.n(l),c=t(9363),u=t(866),d=t.n(u),f=t(4377),C=t.n(f),h=t(7557),j=t.n(h),I=t(3301),T=t(9644),E=t(6801),P=t(6730),k=t(5747),O=t(3848),A=t(8640),D=t(4162),L=t(8420),R=t(6475),M=t(9904),z=t(3599),p=t(7218),F=t.n(p),g=t(9203),H=t.n(g),m=t(8362),$=t.n(m),b=t(6082),N=t.n(b),v=t(8628),B=t.n(v),y=t(73),U=t.n(y),w=t(9113),W=t.n(w),_=t(341),V=t.n(_),x=t(1095),q=t.n(x);window.Popper=a.default,window._=r(),window.moment=s(),window.echarts=c,window.postscribe=d()},4125:function(e,n,t){var a={"./af":8328,"./af.js":8328,"./ar":275,"./ar-dz":2253,"./ar-dz.js":2253,"./ar-kw":20,"./ar-kw.js":20,"./ar-ly":9312,"./ar-ly.js":9312,"./ar-ma":8384,"./ar-ma.js":8384,"./ar-ps":6836,"./ar-ps.js":6836,"./ar-sa":9753,"./ar-sa.js":9753,"./ar-tn":8991,"./ar-tn.js":8991,"./ar.js":275,"./az":724,"./az.js":724,"./be":962,"./be.js":962,"./bg":4980,"./bg.js":4980,"./bm":3927,"./bm.js":3927,"./bn":9829,"./bn-bd":676,"./bn-bd.js":676,"./bn.js":9829,"./bo":9244,"./bo.js":9244,"./br":4024,"./br.js":4024,"./bs":977,"./bs.js":977,"./ca":2103,"./ca.js":2103,"./cs":3920,"./cs.js":3920,"./cv":6636,"./cv.js":6636,"./cy":6003,"./cy.js":6003,"./da":1382,"./da.js":1382,"./de":5810,"./de-at":1026,"./de-at.js":1026,"./de-ch":9961,"./de-ch.js":9961,"./de.js":5810,"./dv":5050,"./dv.js":5050,"./el":7565,"./el.js":7565,"./en-au":4057,"./en-au.js":4057,"./en-ca":6871,"./en-ca.js":6871,"./en-gb":2844,"./en-gb.js":2844,"./en-ie":1477,"./en-ie.js":1477,"./en-il":4386,"./en-il.js":4386,"./en-in":8199,"./en-in.js":8199,"./en-nz":3397,"./en-nz.js":3397,"./en-sg":81,"./en-sg.js":81,"./eo":6749,"./eo.js":6749,"./es":908,"./es-do":9735,"./es-do.js":9735,"./es-mx":8857,"./es-mx.js":8857,"./es-us":2767,"./es-us.js":2767,"./es.js":908,"./et":120,"./et.js":120,"./eu":9679,"./eu.js":9679,"./fa":9066,"./fa.js":9066,"./fi":9694,"./fi.js":9694,"./fil":7606,"./fil.js":7606,"./fo":1805,"./fo.js":1805,"./fr":4655,"./fr-ca":7490,"./fr-ca.js":7490,"./fr-ch":4596,"./fr-ch.js":4596,"./fr.js":4655,"./fy":8946,"./fy.js":8946,"./ga":5786,"./ga.js":5786,"./gd":4954,"./gd.js":4954,"./gl":505,"./gl.js":505,"./gom-deva":5339,"./gom-deva.js":5339,"./gom-latn":9526,"./gom-latn.js":9526,"./gu":8663,"./gu.js":8663,"./he":1490,"./he.js":1490,"./hi":6755,"./hi.js":6755,"./hr":5929,"./hr.js":5929,"./hu":3241,"./hu.js":3241,"./hy-am":1323,"./hy-am.js":1323,"./id":5482,"./id.js":5482,"./is":8390,"./is.js":8390,"./it":4627,"./it-ch":5766,"./it-ch.js":5766,"./it.js":4627,"./ja":6121,"./ja.js":6121,"./jv":8045,"./jv.js":8045,"./ka":5837,"./ka.js":5837,"./kk":7936,"./kk.js":7936,"./km":9026,"./km.js":9026,"./kn":9012,"./kn.js":9012,"./ko":4149,"./ko.js":4149,"./ku":2463,"./ku-kmr":5037,"./ku-kmr.js":5037,"./ku.js":2463,"./ky":8964,"./ky.js":8964,"./lb":4990,"./lb.js":4990,"./lo":4848,"./lo.js":4848,"./lt":2024,"./lt.js":2024,"./lv":9128,"./lv.js":9128,"./me":2407,"./me.js":2407,"./mi":3746,"./mi.js":3746,"./mk":6155,"./mk.js":6155,"./ml":1231,"./ml.js":1231,"./mn":4645,"./mn.js":4645,"./mr":1586,"./mr.js":1586,"./ms":3644,"./ms-my":8835,"./ms-my.js":8835,"./ms.js":3644,"./mt":8915,"./mt.js":8915,"./my":2666,"./my.js":2666,"./nb":7738,"./nb.js":7738,"./ne":841,"./ne.js":841,"./nl":8893,"./nl-be":8002,"./nl-be.js":8002,"./nl.js":8893,"./nn":7801,"./nn.js":7801,"./oc-lnc":1630,"./oc-lnc.js":1630,"./pa-in":8404,"./pa-in.js":8404,"./pl":4265,"./pl.js":4265,"./pt":8908,"./pt-br":4243,"./pt-br.js":4243,"./pt.js":8908,"./ro":8726,"./ro.js":8726,"./ru":6021,"./ru.js":6021,"./sd":2597,"./sd.js":2597,"./se":8344,"./se.js":8344,"./si":6907,"./si.js":6907,"./sk":9457,"./sk.js":9457,"./sl":5730,"./sl.js":5730,"./sq":1574,"./sq.js":1574,"./sr":8990,"./sr-cyrl":4389,"./sr-cyrl.js":4389,"./sr.js":8990,"./ss":9971,"./ss.js":9971,"./sv":5042,"./sv.js":5042,"./sw":4383,"./sw.js":4383,"./ta":4577,"./ta.js":4577,"./te":6178,"./te.js":6178,"./tet":3772,"./tet.js":3772,"./tg":1051,"./tg.js":1051,"./th":5366,"./th.js":5366,"./tk":5025,"./tk.js":5025,"./tl-ph":162,"./tl-ph.js":162,"./tlh":1838,"./tlh.js":1838,"./tr":486,"./tr.js":486,"./tzl":3405,"./tzl.js":3405,"./tzm":1942,"./tzm-latn":5785,"./tzm-latn.js":5785,"./tzm.js":1942,"./ug-cn":7277,"./ug-cn.js":7277,"./uk":329,"./uk.js":329,"./ur":1700,"./ur.js":1700,"./uz":6104,"./uz-latn":5429,"./uz-latn.js":5429,"./uz.js":6104,"./vi":791,"./vi.js":791,"./x-pseudo":7929,"./x-pseudo.js":7929,"./yo":7574,"./yo.js":7574,"./zh-cn":189,"./zh-cn.js":189,"./zh-hk":8954,"./zh-hk.js":8954,"./zh-mo":4285,"./zh-mo.js":4285,"./zh-tw":8274,"./zh-tw.js":8274};function o(i){var s=r(i);return t(s)}function r(i){if(!t.o(a,i)){var s=new Error("Cannot find module '"+i+"'");throw s.code="MODULE_NOT_FOUND",s}return a[i]}o.keys=function(){return Object.keys(a)},o.resolve=r,e.exports=o,o.id=4125},2906:function(e){e.exports='!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exp
vendor: 7,042 bytes, line 1
1orts.AOS=t():e.AOS=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={exports:{},id:o,loaded:!1};return e[o].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="dist/",t(0)}([function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},r=n(1),a=(o(r),n(6)),u=o(a),c=n(7),f=o(c),s=n(8),d=o(s),l=n(9),p=o(l),m=n(10),b=o(m),v=n(11),y=o(v),g=n(14),h=o(g),w=[],k=!1,x={offset:120,delay:0,easing:"ease",duration:400,disable:!1,once:!1,startEvent:"DOMContentLoaded",throttleDelay:99,debounceDelay:50,disableMutationObserver:!1},j=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e&&(k=!0),k)return w=(0,y.default)(w,x),(0,b.default)(w,x.once),w},O=function(){w=(0,h.default)(),j()},_=function(){w.forEach(function(e,t){e.node.removeAttribute("data-aos"),e.node.removeAttribute("data-aos-easing"),e.node.removeAttribute("data-aos-duration"),e.node.removeAttribute("data-aos-delay")})},S=function(e){return e===!0||"mobile"===e&&p.default.mobile()||"phone"===e&&p.default.phone()||"tablet"===e&&p.default.tablet()||"function"==typeof e&&e()===!0},z=function(e){x=i(x,e),w=(0,h.default)();var t=document.all&&!window.atob;return S(x.disable)||t?_():(document.querySelector("body").setAttribute("data-aos-easing",x.easing),document.querySelector("body").setAttribute("data-aos-duration",x.duration),document.querySelector("body").setAttribute("data-aos-delay",x.delay),"DOMContentLoaded"===x.startEvent&&["complete","interactive"].indexOf(document.readyState)>-1?j(!0):"load"===x.startEvent?window.addEventListener(x.startEvent,function(){j(!0)}):document.addEventListener(x.startEvent,function(){j(!0)}),window.addEventListener("resize",(0,f.default)(j,x.debounceDelay,!0)),window.addEventListener("orientationchange",(0,f.default)(j,x.debounceDelay,!0)),window.addEventListener("scroll",(0,u.default)(function(){(0,b.default)(w,x.once)},x.throttleDelay)),x.disableMutationObserver||(0,d.default)("[data-aos]",O),w)};e.exports={init:z,refresh:j,refreshHard:O}},function(e,t){},,,,,function(e,t){(function(t){"use strict";function n(e,t,n){function o(t){var n=b,o=v;return b=v=void 0,k=t,g=e.apply(o,n)}function r(e){return k=e,h=setTimeout(s,t),_?o(e):g}function a(e){var n=e-w,o=e-k,i=t-n;return S?j(i,y-o):i}function c(e){var n=e-w,o=e-k;return void 0===w||n>=t||n<0||S&&o>=y}function s(){var e=O();return c(e)?d(e):void(h=setTimeout(s,a(e)))}function d(e){return h=void 0,z&&b?o(e):(b=v=void 0,g)}function l(){void 0!==h&&clearTimeout(h),k=0,b=w=v=h=void 0}function p(){return void 0===h?g:d(O())}function m(){var e=O(),n=c(e);if(b=arguments,v=this,w=e,n){if(void 0===h)return r(w);if(S)return h=setTimeout(s,t),o(w)}return void 0===h&&(h=setTimeout(s,t)),g}var b,v,y,g,h,w,k=0,_=!1,S=!1,z=!0;if("function"!=typeof e)throw new TypeError(f);return t=u(t)||0,i(n)&&(_=!!n.leading,S="maxWait"in n,y=S?x(u(n.maxWait)||0,t):y,z="trailing"in n?!!n.trailing:z),m.cancel=l,m.flush=p,m}function o(e,t,o){var r=!0,a=!0;if("function"!=typeof e)throw new TypeError(f);return i(o)&&(r="leading"in o?!!o.leading:r,a="trailing"in o?!!o.trailing:a),n(e,t,{leading:r,maxWait:t,trailing:a})}function i(e){var t="undefined"==typeof e?"undefined":c(e);return!!e&&("object"==t||"function"==t)}function r(e){return!!e&&"object"==("undefined"==typeof e?"undefined":c(e))}function a(e){return"symbol"==("undefined"==typeof e?"undefined":c(e))||r(e)&&k.call(e)==d}function u(e){if("number"==typeof e)return e;if(a(e))return s;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(l,"");var n=m.test(e);return n||b.test(e)?v(e.slice(2),n?2:8):p.test(e)?s:+e}var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f="Expected a function",s=NaN,d="[object Symbol]",l=/^\\s+|\\s+$/g,p=/^[-+]0x[0-9a-f]+$/i,m=/^0b[01]+$/i,b=/^0o[0-7]+$/i,v=parseInt,y="object"==("undefined"==typeof t?"undefined":c(t))&&t&&t.Object===Object&&t,g="object"==("undefined"==typeof self?"undefined":c(self))&&self&&self.Object===Object&&self,h=y||g||Function("return this")(),w=Object.prototype,k=w.toString,x=Math.max,j=Math.min,O=function(){return h.Date.now()};e.exports=o}).call(t,function(){return this}())},function(e,t){(function(t){"use strict";function n(e,t,n){function i(t){var n=b,o=v;return b=v=void 0,O=t,g=e.apply(o,n)}function r(e){return O=e,h=setTimeout(s,t),_?i(e):g}function u(e){var n=e-w,o=e-O,i=t-n;return S?x(i,y-o):i}function f(e){var n=e-w,o=e-O;return void 0===w||n>=t||n<0||S&&o>=y}function s(){var e=j();return f(e)?d(e):void(h=setTimeout(s,u(e)))}function d(e){return h=void 0,z&&b?i(e):(b=v=void 0,g)}function l(){void 0!==h&&clearTimeout(h),O=0,b=w=v=h=void 0}function p(){return void 0===h?g:d(j())}function m(){var e=j(),n=f(e);if(b=arguments,v=this,w=e,n){if(void 0===h)return r(w);if(S)return h=setTimeout(s,t),i(w)}return void 0===h&&(h=setTimeout(s,t)),g}var b,v,y,g,h,w,O=0,_=!1,S=!1,z=!0;if("function"!=typeof e)throw new TypeError(c);return t=a(t)||0,o(n)&&(_=!!n.leading,S="maxWait"in n,y=S?k(a(n.maxWait)||0,t):y,z="trailing"in n?!!n.trailing:z),m.cancel=l,m.flush=p,m}function o(e){var t="undefined"==typeof e?"undefined":u(e);return!!e&&("object"==t||"function"==t)}function i(e){return!!e&&"object"==("undefined"==typeof e?"undefined":u(e))}function r(e){return"symbol"==("undefined"==typeof e?"undefined":u(e))||i(e)&&w.call(e)==s}function a(e){if("number"==typeof e)return e;if(r(e))return f;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(d,"");var n=p.test(e);return n||m.test(e)?b(e.slice(2),n?2:8):l.test(e)?f:+e}var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c="Expected a function",f=NaN,s="[object Symbol]",d=/^\\s+|\\s+$/g,l=/^[-+]0x[0-9a-f]+$/i,p=/^0b[01]+$/i,m=/^0o[0-7]+$/i,b=parseInt,v="object"==("undefined"==typeof t?"undefined":u(t))&&t&&t.Object===Object&&t,y="object"==("undefined"==typeof self?"undefined":u(self))&&self&&self.Object===Object&&self,g=v||y||Function("return this")(),h=Object.prototype,w=h.toString,k=Math.max,x=Math.min,j=function(){return g.Date.now()};e.exports=n}).call(t,function(){return this}())},function(e,t){"use strict";function n(e,t){var n=window.document,r=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,a=new r(o);i=t,a.observe(n.documentElement,{childList:!0,subtree:!0,removedNodes:!0})}function o(e){e&&e.forEach(function(e){var t=Array.prototype.slice.call(e.addedNodes),n=Array.prototype.slice.call(e.removedNodes
1),o=t.concat(n).filter(function(e){return e.hasAttribute&&e.hasAttribute("data-aos")}).length;o&&i()})}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){};t.default=n},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(){return navigator.userAgent||navigator.vendor||window.opera||""}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i,a=/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i,u=/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i,c=/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-
1)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i,f=function(){function e(){n(this,e)}return i(e,[{key:"phone",value:function(){var e=o();return!(!r.test(e)&&!a.test(e.substr(0,4)))}},{key:"mobile",value:function(){var e=o();return!(!u.test(e)&&!c.test(e.substr(0,4)))}},{key:"tablet",value:function(){return this.mobile()&&!this.phone()}}]),e}();t.default=new f},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t,n){var o=e.node.getAttribute("data-aos-once");t>e.position?e.node.classList.add("aos-animate"):"undefined"!=typeof o&&("false"===o||!n&&"true"!==o)&&e.node.classList.remove("aos-animate")},o=function(e,t){var o=window.pageYOffset,i=window.innerHeight;e.forEach(function(e,r){n(e,i+o,t)})};t.default=o},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(12),r=o(i),a=function(e,t){return e.forEach(function(e,n){e.node.classList.add("aos-init"),e.position=(0,r.default)(e.node,t.offset)}),e};t.default=a},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(13),r=o(i),a=function(e,t){var n=0,o=0,i=window.innerHeight,a={offset:e.getAttribute("data-aos-offset"),anchor:e.getAttribute("data-aos-anchor"),anchorPlacement:e.getAttribute("data-aos-anchor-placement")};switch(a.offset&&!isNaN(a.offset)&&(o=parseInt(a.offset)),a.anchor&&document.querySelectorAll(a.anchor)&&(e=document.querySelectorAll(a.anchor)[0]),n=(0,r.default)(e).top,a.anchorPlacement){case"top-bottom":break;case"center-bottom":n+=e.offsetHeight/2;break;case"bottom-bottom":n+=e.offsetHeight;break;case"top-center":n+=i/2;break;case"bottom-center":n+=i/2+e.offsetHeight;break;case"center-center":n+=i/2+e.offsetHeight/2;break;case"top-top":n+=i;break;case"bottom-top":n+=e.offsetHeight+i;break;case"center-top":n+=e.offsetHeight/2+i}return a.anchorPlacement||a.offset||isNaN(t)||(o=t),n+o};t.default=a},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){for(var t=0,n=0;e&&!isNaN(e.offsetLeft)&&!isNaN(e.offsetTop);)t+=e.offsetLeft-("BODY"!=e.tagName?e.scrollLeft:0),n+=e.offsetTop-("BODY"!=e.tagName?e.scrollTop:0),e=e.offsetParent;return{top:n,left:t}};t.default=n},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){return e=e||document.querySelectorAll("[data-aos]"),Array.prototype.map.call(e,function(e){return{node:e}})};t.default=n}])});'},5423:function(e){e.exports=`(function (root, factory) { 2 if (typeof define === 'function' && define.amd) { 3 // AMD. Register as an anonymous module unless amdModuleId is set 4 define(["jquery"], function (a0) { 5 return (root['Intercooler'] = factory(a0)); 6 }); 7 } else if (typeof module === 'object' && module.exports) { 8 // Node. Does not work with strict CommonJS, but 9 // only CommonJS-like environments that support module.exports, 10 // like Node. 11 module.exports = factory(require("jquery")); 12 } else { 13 root['Intercooler'] = factory(root["jQuery"]); 14 } 15}(this, function ($) { 16 17//////////////////////////////////// 18 19/** 20 * Intercooler.js - there is no need to be upset. 21 */ 22var Intercooler = Intercooler || (function() { 23 'use strict'; // inside function for better merging 24 25 // work around zepto build issue TODO - fix me 26 if((typeof Zepto !== "undefined") && ($ == null)) { 27 window["$"] = Zepto 28 } 29 30 //-------------------------------------------------- 31 // Vars 32 //-------------------------------------------------- 33 var USE_DATA = $('meta[name="intercoolerjs:use-data-prefix"]').attr("content") == "true"; 34 var USE_ACTUAL_HTTP_METHOD = $('meta[name="intercoolerjs:use-actual-http-method"]').attr("content") == "true"; 35 36 var _MACROS = $.map(['ic-get-from', 'ic-post-to', 'ic-put-to', 'ic-patch-to', 'ic-delete-from', 37 'ic-style-src', 'ic-attr-src', 'ic-prepend-from', 'ic-append-from', 'ic-action'], 38 function(elt){ return fixICAttributeName(elt) }); 39 40 var _scrollHandler = null; 41 var _UUID = 1; 42 var _readyHandlers = []; 43 44 var _isDependentFunction = function(src, dest) { 45 if (!src || !dest) { 46 return false;
vendor: 11,397 bytes, lines 47-406
47 } 48 49 // For two urls to be considered dependant, either one must contain all 50 // of the path arguments the other has, like so: 51 // - chomp off everything after ? or #. This is a design decision, so this 52 // function will fail to determine dependencies for sites that store 53 // their model IDs in query/hash params. If your usecase is not covered 54 // by this you need to implement this function yourself by overriding 55 // Intercooler.setIsDependentFunction(function(src, dest) { return bool; }); 56 // - split by / to get the individual path elements, clear out empty values, 57 // then simply compare them 58 var asrc = src.split(/[\\?#]/, 1)[0].split("/").filter(function(e) { 59 return e != ""; 60 }); 61 62 var adest = dest.split(/[\\?#]/, 1)[0].split("/").filter(function(e) { 63 return e != ""; 64 }); 65 66 // ignore purely local tags (local transport) 67 if (asrc == "" || adest == "") { 68 return false; 69 } 70 return adest.slice(0, asrc.length).join("/") == asrc.join("/") || 71 asrc.slice(0, adest.length).join("/") == adest.join("/"); 72 }; 73 74 //============================================================ 75 // Base Swap Definitions 76 //============================================================ 77 function remove(elt) { 78 elt.remove(); 79 } 80 81 function showIndicator(elt) { 82 if (elt.closest('.ic-use-transition').length > 0) { 83 elt.data('ic-use-transition', true); 84 elt.removeClass('ic-use-transition'); 85 } else { 86 elt.show(); 87 } 88 } 89 90 function hideIndicator(elt) { 91 if (elt.data('ic-use-transition') || elt.data('ic-indicator-cleared')) { 92 elt.data('ic-use-transition', null); 93 elt.addClass('ic-use-transition'); 94 elt.data('ic-indicator-cleared', true); 95 } else { 96 elt.hide(); 97 } 98 } 99 100 function fixICAttributeName(s) { 101 if (USE_DATA) { 102 return 'data-' + s; 103 } else { 104 return s; 105 } 106 } 107 108 function getICAttribute(element, attributeName) { 109 return element.attr(fixICAttributeName(attributeName)); 110 } 111 112 function setICAttribute(element, attributeName, attributeValue) { 113 element.attr(fixICAttributeName(attributeName), attributeValue); 114 } 115 116 function prepend(parent, responseContent) { 117 try { 118 parent.prepend(responseContent); 119 } catch (e) { 120 log(parent, formatError(e), "ERROR"); 121 } 122 if (getICAttribute(parent, 'ic-limit-children')) { 123 var limit = parseInt(getICAttribute(parent, 'ic-limit-children')); 124 if (parent.children().length > limit) { 125 parent.children().slice(limit, parent.children().length).remove(); 126 } 127 } 128 } 129 130 function append(parent, responseContent) { 131 try { 132 parent.append(responseContent); 133 } catch (e) { 134 log(parent, formatError(e), "ERROR"); 135 } 136 if (getICAttribute(parent, 'ic-limit-children')) { 137 var limit = parseInt(getICAttribute(parent, 'ic-limit-children')); 138 if (parent.children().length > limit) { 139 parent.children().slice(0, parent.children().length - limit).remove(); 140 } 141 } 142 } 143 144 //============================================================ 145 // Utility Methods 146 //============================================================ 147 function triggerEvent(elt, event, args){ 148 if($.zepto) { 149 event = event.split(".").reverse().join(":"); 150 } 151 elt.trigger(event, args); 152 } 153 154 function log(elt, msg, level) { 155 if (elt == null) { 156 elt = $('body'); 157 } 158 triggerEvent(elt, "log.ic", [msg, level, elt]); 159 if (level == "ERROR") { 160 if (window.console) { 161 window.console.log("Intercooler Error : " + msg); 162 } 163 var errorUrl = closestAttrValue($('body'), 'ic-post-errors-to'); 164 if (errorUrl) { 165 $.post(errorUrl, {'error': msg}); 166 } 167 } 168 } 169 170 function uuid() { 171 return _UUID++; 172 } 173 174 function icSelectorFor(elt) { 175 return getICAttributeSelector("ic-id='" + getIntercoolerId(elt) + "'"); 176 } 177 178 function parseInterval(str) { 179 log(null, "POLL: Parsing interval string " + str, 'DEBUG'); 180 if (str == "null" || str == "false" || str == "") { 181 return null; 182 } else if (str.lastIndexOf("ms") == str.length - 2) { 183 return parseFloat(str.substr(0, str.length - 2)); 184 } else if (str.lastIndexOf("s") == str.length - 1) { 185 return parseFloat(str.substr(0, str.length - 1)) * 1000; 186 } else { 187 return 1000; 188 } 189 } 190 191 function getICAttributeSelector(attribute) { 192 return "[" + fixICAttributeName(attribute) + "]"; 193 } 194 195 function initScrollHandler() { 196 if (_scrollHandler == null) { 197 _scrollHandler = function() { 198 $(getICAttributeSelector("ic-trigger-on='scrolled-into-view'")).each(function() { 199 var _this = $(this); 200 if (isScrolledIntoView(getTriggeredElement(_this)) && _this.data('ic-scrolled-into-view-loaded') != true) { 201 _this.data('ic-scrolled-into-view-loaded', true); 202 fireICRequest(_this); 203 } 204 }); 205 }; 206 $(window).scroll(_scrollHandler); 207 } 208 } 209 210 function currentUrl() { 211 return window.location.pathname + window.location.search + window.location.hash; 212 } 213 214 // taken from turbolinks.js 215 function createDocument(html) { 216 var doc = null; 217 if (/<(html|body)/i.test(html)) { 218 doc = document.documentElement.cloneNode(); 219 doc.innerHTML = html; 220 } else { 221 doc = document.documentElement.cloneNode(true); 222 doc.querySelector('body').innerHTML = html; 223 } 224 return $(doc); 225 } 226 227 //============================================================ 228 // Request/Parameter/Include Processing 229 //============================================================ 230 function getTarget(elt) { 231 return getTargetImpl(elt, 'ic-target') 232 } 233 234 function getTargetImpl(elt, attibuteName) { 235 var closest = $(elt).closest(getICAttributeSelector(attibuteName)); 236 var targetValue = getICAttribute(closest, attibuteName); 237 if (targetValue == 'this') { 238 return closest; 239 } else if (targetValue && targetValue.indexOf('this.') != 0) { 240 if (targetValue.indexOf('closest ') == 0) { 241 return elt.closest(targetValue.substr(8)); 242 } else if (targetValue.indexOf('find ') == 0) { 243 return elt.find(targetValue.substr(5)); 244 } else { 245 return $(targetValue); 246 } 247 } else { 248 return elt; 249 } 250 } 251 252 function processHeaders(elt, xhr) { 253 elt = $(elt); 254 triggerEvent(elt, "beforeHeaders.ic", [elt, xhr]); 255 log(elt, "response headers: " + xhr.getAllResponseHeaders(), "DEBUG"); 256 var target = null; 257 258 // set page title by header 259 if (xhr.getResponseHeader("X-IC-Title")) { 260 document.title = xhr.getResponseHeader("X-IC-Title"); 261 } 262 263 if (xhr.getResponseHeader("X-IC-Title-Encoded")) { 264 var decodedTitle = decodeURIComponent((xhr.getResponseHeader("X-IC-Title-Encoded")).replace(/\\+/g, '%20')); 265 document.title = decodedTitle; 266 } 267 268 if (xhr.getResponseHeader("X-IC-Refresh")) { 269 var pathsToRefresh = xhr.getResponseHeader("X-IC-Refresh").split(","); 270 log(elt, "X-IC-Refresh: refreshing " + pathsToRefresh, "DEBUG"); 271 $.each(pathsToRefresh, function(i, str) { 272 refreshDependencies(str.replace(/ /g, ""), elt); 273 }); 274 } 275 276 if (xhr.getResponseHeader("X-IC-Script")) { 277 log(elt, "X-IC-Script: evaling " + xhr.getResponseHeader("X-IC-Script"), "DEBUG"); 278 globalEval(xhr.getResponseHeader("X-IC-Script"), [["elt", elt]]); 279 } 280 281 if (xhr.getResponseHeader("X-IC-Redirect")) { 282 log(elt, "X-IC-Redirect: redirecting to " + xhr.getResponseHeader("X-IC-Redirect"), "DEBUG"); 283 window.location = xhr.getResponseHeader("X-IC-Redirect"); 284 } 285 286 if (xhr.getResponseHeader("X-IC-CancelPolling") == "true") { 287 cancelPolling(elt.closest(getICAttributeSelector('ic-poll'))); 288 } 289 290 if (xhr.getResponseHeader("X-IC-ResumePolling") == "true") { 291 var pollingElt = elt.closest(getICAttributeSelector('ic-poll')); 292 setICAttribute(pollingElt, 'ic-pause-polling', null); 293 startPolling(pollingElt); 294 } 295 296 if (xhr.getResponseHeader("X-IC-SetPollInterval")) { 297 var pollingElt = elt.closest(getICAttributeSelector('ic-poll')); 298 cancelPolling(pollingElt); 299 setICAttribute(pollingElt, 'ic-poll', xhr.getResponseHeader("X-IC-SetPollInterval")); 300 startPolling(pollingElt); 301 } 302 303 if (xhr.getResponseHeader("X-IC-Open")) { 304 log(elt, "X-IC-Open: opening " + xhr.getResponseHeader("X-IC-Open"), "DEBUG"); 305 window.open(xhr.getResponseHeader("X-IC-Open")); 306 } 307 308 var triggerValue = xhr.getResponseHeader("X-IC-Trigger"); 309 if (triggerValue) { 310 log(elt, "X-IC-Trigger: found trigger " + triggerValue, "DEBUG"); 311 target = getTarget(elt); 312 // Deprecated API 313 if (xhr.getResponseHeader("X-IC-Trigger-Data")) { 314 var triggerArgs = $.parseJSON(xhr.getResponseHeader("X-IC-Trigger-Data")); 315 triggerEvent(target, triggerValue, triggerArgs); 316 } else { 317 if (triggerValue.indexOf("{") >= 0) { 318 $.each($.parseJSON(triggerValue), function(event, args) { 319 triggerEvent(target, event, args); 320 }); 321 } else { 322 triggerEvent(target, triggerValue, []); 323 } 324 } 325 } 326 327 var localVars = xhr.getResponseHeader("X-IC-Set-Local-Vars"); 328 if (localVars) { 329 $.each($.parseJSON(localVars), function(key, val) { 330 localStorage.setItem(key, val); 331 }); 332 } 333 334 if (xhr.getResponseHeader("X-IC-Remove")) { 335 if (elt) { 336 var removeVal = xhr.getResponseHeader("X-IC-Remove"); 337 removeVal += ''; // normalize as string for zapto 338 var removeValAsInterval = parseInterval(removeVal); 339 log(elt, "X-IC-Remove header found.", "DEBUG"); 340 target = getTarget(elt); 341 if(removeVal == "true" || removeValAsInterval == null) { 342 remove(target); 343 } else { 344 target.addClass('ic-removing'); 345 setTimeout(function () { 346 remove(target); 347 }, removeValAsInterval); 348 } 349 } 350 } 351 352 triggerEvent(elt, "afterHeaders.ic", [elt, xhr]); 353 354 return true; 355 } 356 357 358 function beforeRequest(elt) { 359 elt.addClass('disabled'); 360 elt.addClass('ic-request-in-flight'); 361 elt.data('ic-request-in-flight', true); 362 } 363 364 function requestCleanup(indicator, globalIndicator, elt) { 365 if (indicator.length > 0) { 366 hideIndicator(indicator); 367 } 368 if (globalIndicator.length > 0) { 369 hideIndicator(globalIndicator); 370 } 371 elt.removeClass('disabled'); 372 elt.removeClass('ic-request-in-flight'); 373 elt.data('ic-request-in-flight', false); 374 if (elt.data('ic-next-request')) { 375 elt.data('ic-next-request')["req"](); 376 elt.data('ic-next-request', null); 377 } 378 } 379 380 function replaceOrAddMethod(data, actualMethod) { 381 if ($.type(data) === "string") { 382 var regex = /(&|^)_method=[^&]*/; 383 var content = "&_method=" + actualMethod; 384 if (regex.test(data)) { 385 return data.replace(regex, content) 386 } else { 387 return data + content; 388 } 389 } else { 390 data.append("_method", actualMethod); 391 return data; 392 } 393 } 394 395 /* 396 Is the provided text a valid JavaScript identifier path? 397 398 We should also probably check if an identifier is a JavaScript keyword here. 399 */ 400 function isIdentifier(txt) { 401 return /^[$A-Z_][0-9A-Z_$]*$/i.test(txt); 402 } 403 404 /* 405 Evaluate a script snippet provided by the user. 406
407 script: A string. If this is an identifier, it is assumed to be a callable, retrieved from the 408 global namespace, and called. If it is a compound statement, it is evaluated using eval. 409 args: A list of [name, value] tuples. These will be injected into the namespace of evaluated 410 scripts, and be passed as arguments to safe evaluations. 411 */ 412 // It would be nice to use the spread operator here globalEval(script, ...args) - but it breaks 413 // uglify and isn't supported in some older browsers. 414 function globalEval(script, args) { 415 var names = []; 416 var values = []; 417 if (args) { 418 for (var i = 0; i < args.length; i++) { 419 names.push(args[i][0]); 420 values.push(args[i][1]); 421 } 422 } 423 if (isIdentifier(script)) { 424 return window[script].apply(this, values); 425 } else { 426 var outerfunc = window["eval"].call( 427 window, 428 '(function (' + names.join(", ") + ') {' + script + '})' 429 ); 430 return outerfunc.apply(this, values); 431 } 432 } 433 434 function closestAttrValue(elt, attr) { 435 var closestElt = $(elt).closest(getICAttributeSelector(attr)); 436 if (closestElt.length > 0) { 437 return getICAttribute(closestElt, attr); 438 } else { 439 return null; 440 } 441 } 442 443 function formatError(e) { 444 var msg = e.toString() + "\\n"; 445 try { 446 msg += e.stack; 447 } catch (e) { 448 // ignore 449 } 450 return msg; 451 } 452 453 function getLocalURL(baseURL, paramsToPush, data) { 454 if (paramsToPush) { 455 baseURL = baseURL + "?"; 456 var vars = {}; 457 data.replace(/([^=&]+)=([^&]*)/gi, function(m,key,value) { 458 vars[key] = value; 459 }); 460 $(paramsToPush.split(",")).each(function(index) { 461 var param = $.trim(this); 462 var value = vars[param] || ""; 463 baseURL += (index == 0) ? "" : "&"; 464 baseURL += param + "=" + value;
vendor: 40,702 bytes, lines 464-1719
464 465 }); 466 } 467 return baseURL; 468 } 469 470 function handleRemoteRequest(elt, type, url, data, success) { 471 472 beforeRequest(elt); 473 474 data = replaceOrAddMethod(data, type); 475 476 // Global spinner support 477 var globalIndicator = findGlobalIndicator(elt); 478 if (globalIndicator && globalIndicator.length > 0) { 479 showIndicator(globalIndicator); 480 } 481 482 // Spinner support 483 var indicator = findIndicator(elt); 484 if (indicator.length > 0) { 485 showIndicator(indicator); 486 } 487 488 var requestId = uuid(); 489 var requestStart = new Date(); 490 var actualRequestType; 491 if(USE_ACTUAL_HTTP_METHOD) { 492 actualRequestType = type; 493 } else { 494 actualRequestType = type == 'GET' ? 'GET' : 'POST'; 495 } 496 497 var ajaxSetup = { 498 type: actualRequestType, 499 url: url, 500 data: data, 501 dataType: 'text', 502 headers: { 503 "Accept": "text/html-partial, */*; q=0.9", 504 "X-IC-Request": true, 505 "X-HTTP-Method-Override": type 506 }, 507 beforeSend: function(xhr, settings) { 508 triggerEvent(elt, "beforeSend.ic", [elt, data, settings, xhr, requestId]); 509 log(elt, "before AJAX request " + requestId + ": " + type + " to " + url, "DEBUG"); 510 var onBeforeSend = closestAttrValue(elt, 'ic-on-beforeSend'); 511 if (onBeforeSend) { 512 globalEval(onBeforeSend, [["elt", elt], ["data", data], ["settings", settings], ["xhr", xhr]]); 513 } 514 maybeInvokeLocalAction(elt, "-beforeSend"); 515 }, 516 success: function(responseData, textStatus, xhr) { 517 triggerEvent(elt, "success.ic", [elt, responseData, textStatus, xhr, requestId]); 518 log(elt, "AJAX request " + requestId + " was successful.", "DEBUG"); 519 var onSuccess = closestAttrValue(elt, 'ic-on-success'); 520 if (onSuccess) { 521 if (globalEval(onSuccess, [["elt", elt], ["data", responseData], ["textStatus", textStatus], ["xhr", xhr]]) == false) { 522 return; 523 } 524 } 525 526 var beforeHeaders = new Date(); 527 var oldTitle = document.title; 528 try { 529 if (processHeaders(elt, xhr)) { 530 log(elt, "Processed headers for request " + requestId + " in " + (new Date() - beforeHeaders) + "ms", "DEBUG"); 531 var beforeSuccess = new Date(); 532 533 if (xhr.getResponseHeader("X-IC-PushURL") || closestAttrValue(elt, 'ic-push-url') == "true") { 534 try { 535 requestCleanup(indicator, globalIndicator, elt); // clean up before snap-shotting HTML 536 var baseURL = closestAttrValue(elt, 'ic-src'); 537 var paramsToPush = closestAttrValue(elt, 'ic-push-params'); 538 var newUrl = xhr.getResponseHeader("X-IC-PushURL") || getLocalURL(baseURL, paramsToPush, data); 539 if(_history) { 540 _history.snapshotForHistory(newUrl, oldTitle); 541 } else { 542 throw "History support not enabled"; 543 } 544 } catch (e) { 545 log(elt, "Error during history snapshot for " + requestId + ": " + formatError(e), "ERROR"); 546 } 547 } 548 549 success(responseData, textStatus, elt, xhr); 550 551 log(elt, "Process content for request " + requestId + " in " + (new Date() - beforeSuccess) + "ms", "DEBUG"); 552 } 553 triggerEvent(elt, "after.success.ic", [elt, responseData, textStatus, xhr, requestId]); 554 maybeInvokeLocalAction(elt, "-success"); 555 } catch (e) { 556 log(elt, "Error processing successful request " + requestId + " : " + formatError(e), "ERROR"); 557 } 558 }, 559 error: function(xhr, status, str) { 560 triggerEvent(elt, "error.ic", [elt, status, str, xhr]); 561 var onError = closestAttrValue(elt, 'ic-on-error'); 562 if (onError) { 563 globalEval(onError, [["elt", elt], ["status", status], ["str", str], ["xhr", xhr]]); 564 } 565 processHeaders(elt, xhr); 566 maybeInvokeLocalAction(elt, "-error"); 567 log(elt, "AJAX request " + requestId + " to " + url + " experienced an error: " + str, "ERROR"); 568 }, 569 complete: function(xhr, status) { 570 log(elt, "AJAX request " + requestId + " completed in " + (new Date() - requestStart) + "ms", "DEBUG"); 571 requestCleanup(indicator, globalIndicator, elt); 572 try { 573 if ($.contains(document, elt[0])) { 574 triggerEvent(elt, "complete.ic", [elt, data, status, xhr, requestId]); 575 } else { 576 triggerEvent($('body'), "complete.ic", [elt, data, status, xhr, requestId]); 577 } 578 } catch (e) { 579 log(elt, "Error during complete.ic event for " + requestId + " : " + formatError(e), "ERROR"); 580 } 581 var onComplete = closestAttrValue(elt, 'ic-on-complete'); 582 if (onComplete) { 583 globalEval(onComplete, [["elt", elt], ["xhr", xhr], ["status", status]]); 584 } 585 maybeInvokeLocalAction(elt, "-complete"); 586 } 587 }; 588 if ($.type(data) != "string") { 589 ajaxSetup.dataType = null; 590 ajaxSetup.processData = false; 591 ajaxSetup.contentType = false; 592 } 593 594 triggerEvent($(document), "beforeAjaxSend.ic", [ajaxSetup, elt]); 595 596 if(ajaxSetup.cancel) { 597 requestCleanup(indicator, globalIndicator, elt); 598 } else { 599 $.ajax(ajaxSetup) 600 } 601 } 602 603 function findGlobalIndicator(elt) { 604 var indicator = $([]); 605 elt = $(elt); 606 var attr = closestAttrValue(elt, 'ic-global-indicator'); 607 if (attr && attr !== "false") { 608 indicator = $(attr).first(); 609 } 610 return indicator; 611 } 612 613 function findIndicator(elt) { 614 var indicator = $([]); 615 elt = $(elt); 616 if (getICAttribute(elt, 'ic-indicator')) { 617 indicator = $(getICAttribute(elt, 'ic-indicator')).first(); 618 } else { 619 indicator = elt.find(".ic-indicator").first(); 620 if (indicator.length == 0) { 621 var parent = closestAttrValue(elt, 'ic-indicator'); 622 if (parent) { 623 indicator = $(parent).first(); 624 } else { 625 if (elt.next().is('.ic-indicator')) { 626 indicator = elt.next(); 627 } 628 } 629 } 630 } 631 return indicator; 632 } 633 634 function processIncludes(data, str) { 635 if ($.trim(str).indexOf("{") == 0) { 636 var obj = $.parseJSON(str); 637 $.each(obj, function(name, value) { 638 data = appendData(data, name, value); 639 }); 640 } else { 641 $(str).each(function() { 642 var obj = $(this).serializeArray(); 643 $.each(obj, function(i, input) { 644 data = appendData(data, input.name, input.value); 645 }); 646 }); 647 } 648 return data; 649 } 650 651 function processLocalVars(data, str) { 652 $(str.split(",")).each(function() { 653 var key = $.trim(this); 654 var item = localStorage.getItem(key); 655 if(item) { 656 data = appendData(data, key, item); 657 } 658 }); 659 return data; 660 } 661 662 function appendData(data, key, value) { 663 if ($.type(data) === "string") { 664 if($.type(value) !== "string") { 665 value = JSON.stringify(value); 666 } 667 return data + "&" + key + "=" + encodeURIComponent(value); 668 } else { 669 data.append(key, value); 670 return data; 671 } 672 } 673 674 function getParametersForElement(verb, elt, triggerOrigin) { 675 var target = getTarget(elt); 676 var data = null; 677 678 if (elt.is('form') && elt.attr('enctype') == 'multipart/form-data') { 679 data = new FormData(elt[0]); 680 data = appendData(data, 'ic-request', true); 681 } else { 682 data = "ic-request=true"; 683 // if the element is in a form, include the entire form 684 var closestForm = elt.closest('form'); 685 if (elt.is('form') || (verb != "GET" && closestForm.length > 0)) { 686 data += "&" + closestForm.serialize(); 687 // include data from a focused button (to capture clicked button value) 688 var buttonData = elt.data('ic-last-clicked-button'); 689 if(buttonData) { 690 data = appendData(data, buttonData.name, buttonData.value); 691 } 692 } else { // otherwise include the element 693 data += "&" + elt.serialize(); 694 } 695 } 696 697 var promptText = closestAttrValue(elt, 'ic-prompt'); 698 if (promptText) { 699 var promptVal = prompt(promptText); 700 if (promptVal) { 701 var promptParamName = closestAttrValue(elt, 'ic-prompt-name') || 'ic-prompt-value'; 702 data = appendData(data, promptParamName, promptVal); 703 } else { 704 return null; 705 } 706 } 707 708 if (elt.attr('id')) { 709 data = appendData(data, 'ic-element-id', elt.attr('id')); 710 } 711 if (elt.attr('name')) { 712 data = appendData(data, 'ic-element-name', elt.attr('name')); 713 } 714 if (getICAttribute(target, 'ic-id')) { 715 data = appendData(data, 'ic-id', getICAttribute(target, 'ic-id')); 716 } 717 if (target.attr('id')) { 718 data = appendData(data, 'ic-target-id', target.attr('id')); 719 } 720 if (triggerOrigin && triggerOrigin.attr('id')) { 721 data = appendData(data, 'ic-trigger-id', triggerOrigin.attr('id')); 722 } 723 if (triggerOrigin && triggerOrigin.attr('name')) { 724 data = appendData(data, 'ic-trigger-name', triggerOrigin.attr('name')); 725 } 726 var includeAttr = closestAttrValue(elt, 'ic-include'); 727 if (includeAttr) { 728 data = processIncludes(data, includeAttr); 729 } 730 var localVars = closestAttrValue(elt, 'ic-local-vars'); 731 if (localVars) { 732 data = processLocalVars(data, localVars); 733 } 734 $(getICAttributeSelector('ic-global-include')).each(function() { 735 data = processIncludes(data, getICAttribute($(this), 'ic-global-include')); 736 }); 737 data = appendData(data, 'ic-current-url', currentUrl()); 738 739 var selectFromResp = closestAttrValue(elt, 'ic-select-from-response'); 740 if(selectFromResp) { 741 data = appendData(data, 'ic-select-from-response', selectFromResp); 742 } 743 744 log(elt, "request parameters " + data, "DEBUG"); 745 746 return data; 747 } 748 749 function maybeSetIntercoolerInfo(elt) { 750 var target = getTarget(elt); 751 getIntercoolerId(target); 752 if (elt.data('elementAdded.ic') != true) { 753 elt.data('elementAdded.ic', true); 754 triggerEvent(elt, "elementAdded.ic"); 755 } 756 } 757 758 function getIntercoolerId(elt) { 759 if (!getICAttribute(elt, 'ic-id')) { 760 setICAttribute(elt, 'ic-id', uuid()); 761 } 762 return getICAttribute(elt, 'ic-id'); 763 } 764 765 //============================================================ 766 // Tree Processing 767 //============================================================ 768 769 function processNodes(elt) { 770 elt = $(elt); 771 if (elt.length > 1) { 772 elt.each(function() { 773 processNodes(this); 774 }); 775 } else { 776 processMacros(elt); 777 processEnhancement(elt); 778 processSources(elt); 779 processPolling(elt); 780 processEventSources(elt); 781 processTriggerOn(elt); 782 processRemoveAfter(elt); 783 processAddClasses(elt); 784 processRemoveClasses(elt); 785 } 786 } 787 788 function fireReadyStuff(elt) { 789 triggerEvent(elt, 'nodesProcessed.ic'); 790 $.each(_readyHandlers, function(i, handler) { 791 try { 792 handler(elt); 793 } catch (e) { 794 log(elt, formatError(e), "ERROR"); 795 } 796 }); 797 } 798 799 function autoFocus(elt) { 800 elt.find('[autofocus]').last().focus(); 801 } 802 803 function processMacros(elt) { 804 $.each(_MACROS, function(i, macro) { 805 if (elt.closest('.ic-ignore').length == 0) { 806 if (elt.is('[' + macro + ']')) { 807 processMacro(macro, elt); 808 } 809 elt.find('[' + macro + ']').each(function() { 810 var _this = $(this); 811 if (_this.closest('.ic-ignore').length == 0) { 812 processMacro(macro, _this); 813 } 814 }); 815 } 816 }); 817 } 818 819 function processSources(elt) { 820 if (elt.closest('.ic-ignore').length == 0) { 821 if (elt.is(getICAttributeSelector("ic-src"))) { 822 maybeSetIntercoolerInfo(elt); 823 } 824 elt.find(getICAttributeSelector("ic-src")).each(function() { 825 var _this = $(this); 826 if (_this.closest('.ic-ignore').length == 0) { 827 maybeSetIntercoolerInfo(_this); 828 } 829 }); 830 } 831 } 832 833 function processPolling(elt) { 834 if (elt.closest('.ic-ignore').length == 0) { 835 if (elt.is(getICAttributeSelector("ic-poll"))) { 836 maybeSetIntercoolerInfo(elt); 837 startPolling(elt); 838 } 839 elt.find(getICAttributeSelector("ic-poll")).each(function() { 840 var _this = $(this); 841 if (_this.closest('.ic-ignore').length == 0) { 842 maybeSetIntercoolerInfo(_this); 843 startPolling(_this); 844 } 845 }); 846 } 847 } 848 849 function processTriggerOn(elt) { 850 if (elt.closest('.ic-ignore').length == 0) { 851 handleTriggerOn(elt); 852 elt.find(getICAttributeSelector('ic-trigger-on')).each(function() { 853 var _this = $(this); 854 if (_this.closest('.ic-ignore').length == 0) { 855 handleTriggerOn(_this); 856 } 857 }); 858 } 859 } 860 861 function processRemoveAfter(elt) { 862 if (elt.closest('.ic-ignore').length == 0) { 863 handleRemoveAfter(elt); 864 elt.find(getICAttributeSelector('ic-remove-after')).each(function() { 865 var _this = $(this); 866 if (_this.closest('.ic-ignore').length == 0) { 867 handleRemoveAfter(_this); 868 } 869 }); 870 } 871 } 872 873 function processAddClasses(elt) { 874 if (elt.closest('.ic-ignore').length == 0) { 875 handleAddClasses(elt); 876 elt.find(getICAttributeSelector('ic-add-class')).each(function() { 877 var _this = $(this); 878 if (_this.closest('.ic-ignore').length == 0) { 879 handleAddClasses(_this); 880 } 881 }); 882 } 883 } 884 885 function processRemoveClasses(elt) { 886 if (elt.closest('.ic-ignore').length == 0) { 887 handleRemoveClasses(elt); 888 elt.find(getICAttributeSelector('ic-remove-class')).each(function() { 889 var _this = $(this); 890 if (_this.closest('.ic-ignore').length == 0) { 891 handleRemoveClasses(_this); 892 } 893 }); 894 } 895 } 896 897 function processEnhancement(elt) { 898 if (elt.closest('.ic-ignore').length == 0) { 899 if(closestAttrValue(elt, 'ic-enhance') === 'true') { 900 enhanceDomTree(elt); 901 } else { 902 elt.find(getICAttributeSelector('ic-enhance')).each(function(){ 903 enhanceDomTree($(this)); 904 }); 905 } 906 } 907 } 908 909 function processEventSources(elt) { 910 if (elt.closest('.ic-ignore').length == 0) { 911 handleEventSource(elt); 912 elt.find(getICAttributeSelector('ic-sse-src')).each(function() { 913 var _this = $(this); 914 if (_this.closest('.ic-ignore').length == 0) { 915 handleEventSource(_this); 916 } 917 }); 918 } 919 } 920 921 //============================================================ 922 // Polling support 923 //============================================================ 924 925 function startPolling(elt) { 926 if (elt.data('ic-poll-interval-id') == null && getICAttribute(elt, 'ic-pause-polling') != 'true') { 927 var interval = parseInterval(getICAttribute(elt, 'ic-poll')); 928 if (interval != null) { 929 var selector = icSelectorFor(elt); 930 var repeats = parseInt(getICAttribute(elt, 'ic-poll-repeats')) || -1; 931 var currentIteration = 0; 932 log(elt, "POLL: Starting poll for element " + selector, "DEBUG"); 933 var timerId = setInterval(function() { 934 var target = $(selector); 935 triggerEvent(elt, "onPoll.ic", target); 936 if ((target.length == 0) || (currentIteration == repeats) || elt.data('ic-poll-interval-id') != timerId) { 937 log(elt, "POLL: Clearing poll for element " + selector, "DEBUG"); 938 clearTimeout(timerId); 939 } else { 940 fireICRequest(target); 941 } 942 currentIteration++; 943 }, interval); 944 elt.data('ic-poll-interval-id', timerId); 945 } 946 } 947 } 948 949 function cancelPolling(elt) { 950 if (elt.data('ic-poll-interval-id') != null) { 951 clearTimeout(elt.data('ic-poll-interval-id')); 952 elt.data('ic-poll-interval-id', null); 953 } 954 } 955 956 //============================================================---- 957 // Dependency support 958 //============================================================---- 959 960 function refreshDependencies(dest, src) { 961 log(src, "refreshing dependencies for path " + dest, "DEBUG"); 962 $(getICAttributeSelector('ic-src')).each(function() { 963 var fired = false; 964 var _this = $(this); 965 if (verbFor(_this) == "GET" && getICAttribute(_this, 'ic-deps') != 'ignore' ) { 966 if (isDependent(dest, getICAttribute(_this, 'ic-src'))) { 967 if (src == null || $(src)[0] != _this[0]) { 968 fireICRequest(_this); 969 fired = true; 970 } 971 } else if (isICDepsDependent(dest, getICAttribute(_this, 'ic-deps')) || getICAttribute(_this, 'ic-deps') == "*") { 972 if (src == null || $(src)[0] != _this[0]) { 973 fireICRequest(_this); 974 fired = true; 975 } 976 } 977 } 978 if (fired) { 979 log(_this, "depends on path " + dest + ", refreshing...", "DEBUG") 980 } 981 }); 982 } 983 984 function isICDepsDependent(src, dest) { 985 if(dest) { 986 var paths = dest.split(","); 987 for (var i = 0; i < paths.length; i++) { 988 var str = paths[i].trim(); 989 if(isDependent(src, str)) { 990 return true; 991 } 992 } 993 } 994 return false; 995 } 996 997 function isDependent(src, dest) { 998 return !!_isDependentFunction(src, dest); 999 } 1000 1001 //============================================================---- 1002 // Trigger-On support 1003 //============================================================---- 1004 1005 function verbFor(elt) { 1006 elt = $(elt); 1007 if (getICAttribute(elt, 'ic-verb')) { 1008 return getICAttribute(elt, 'ic-verb').toUpperCase(); 1009 } 1010 return "GET"; 1011 } 1012 1013 function eventFor(attr, elt) { 1014 if (attr == "default") { 1015 elt = $(elt); 1016 if (elt.is('button')) { 1017 return 'click'; 1018 } else if (elt.is('form')) { 1019 return 'submit'; 1020 } else if (elt.is('input, textarea, select, button')) { 1021 return 'change'; 1022 } else { 1023 return 'click'; 1024 } 1025 } else { 1026 return attr; 1027 } 1028 } 1029 1030 function preventDefault(elt, evt) { 1031 return elt.is('form') || 1032 (elt.is('input[type="submit"], button') && elt.closest('form').length == 1) || 1033 (elt.is('a') && elt.is('[href]') && elt.attr('href').indexOf('#') != 0); 1034 } 1035 1036 function handleRemoveAfter(elt) { 1037 elt = $(elt); 1038 if (getICAttribute(elt, 'ic-remove-after')) { 1039 var interval = parseInterval(getICAttribute(elt, 'ic-remove-after')); 1040 setTimeout(function() { 1041 remove(elt); 1042 }, interval); 1043 } 1044 } 1045 1046 function parseAndApplyClass(classInfo, elt, operation) { 1047 var cssClass = ""; 1048 var delay = 50; 1049 if (classInfo.indexOf(":") > 0) { 1050 var split = classInfo.split(':'); 1051 cssClass = split[0]; 1052 delay = parseInterval(split[1]); 1053 } else { 1054 cssClass = classInfo; 1055 } 1056 setTimeout(function() { 1057 elt[operation](cssClass) 1058 }, delay); 1059 } 1060 1061 function handleAddClasses(elt) { 1062 elt = $(elt); 1063 if (getICAttribute(elt, 'ic-add-class')) { 1064 var values = getICAttribute(elt, 'ic-add-class').split(","); 1065 var arrayLength = values.length; 1066 for (var i = 0; i < arrayLength; i++) { 1067 parseAndApplyClass($.trim(values[i]), elt, 'addClass'); 1068 } 1069 } 1070 } 1071 1072 function handleRemoveClasses(elt) { 1073 elt = $(elt); 1074 if (getICAttribute(elt, 'ic-remove-class')) { 1075 var values = getICAttribute(elt, 'ic-remove-class').split(","); 1076 var arrayLength = values.length; 1077 for (var i = 0; i < arrayLength; i++) { 1078 parseAndApplyClass($.trim(values[i]), elt, 'removeClass'); 1079 } 1080 } 1081 } 1082 1083 function handleEventSource(elt) { 1084 elt = $(elt); 1085 if (getICAttribute(elt, 'ic-sse-src')) { 1086 var evtSrcUrl = getICAttribute(elt, 'ic-sse-src'); 1087 var evtSrcWithCredentials = getICAttribute(elt, 'ic-sse-with-credentials') === 'true'; 1088 var eventSource = initEventSource(elt, evtSrcUrl, evtSrcWithCredentials); 1089 elt.data('ic-event-sse-source', eventSource); 1090 elt.data('ic-event-sse-map', {}); 1091 } 1092 } 1093 1094 function initEventSource(elt, evtSrcUrl, evtSrcWithCredentials) { 1095 var eventSource = Intercooler._internal.initEventSource(evtSrcUrl, evtSrcWithCredentials); 1096 eventSource.onmessage = function(e) { 1097 processICResponse(e.data, elt, false); 1098 }; 1099 return eventSource; 1100 } 1101 1102 function registerSSE(sourceElement, event) { 1103 var source = sourceElement.data('ic-event-sse-source'); 1104 var eventMap = sourceElement.data('ic-event-sse-map'); 1105 if(source.addEventListener && eventMap[event] != true) { 1106 source.addEventListener(event, function(){ 1107 sourceElement.find(getICAttributeSelector('ic-trigger-on')).each(function(){ 1108 var _that = $(this); 1109 if(_that.attr('ic-trigger-on') == "sse:" + event) { 1110 fireICRequest(_that); 1111 } 1112 }); 1113 }) 1114 } 1115 } 1116 1117 function getTriggeredElement(elt) { 1118 var triggerFrom = getICAttribute(elt, 'ic-trigger-from'); 1119 if(triggerFrom) { 1120 if (triggerFrom == "document") { 1121 return $(document); 1122 } else if (triggerFrom == "window") { 1123 return $(window); 1124 } else { 1125 return $(triggerFrom); 1126 } 1127 } else { 1128 return elt; 1129 } 1130 } 1131 1132 function handleTriggerOn(elt) { 1133 1134 var triggerOnValue = getICAttribute(elt, 'ic-trigger-on'); 1135 if (triggerOnValue) { 1136 // record button or submit input click info 1137 if(elt.is('form')) { 1138 elt.on('click focus', 'input, button, select, textarea', function(e){ 1139 if($(this).is('input[type="submit"], button') && $(this).is("[name]")) { 1140 elt.data('ic-last-clicked-button', {name:$(this).attr("name"), value:$(this).val()}) 1141 } else { 1142 elt.data('ic-last-clicked-button', null) 1143 } 1144 }); 1145 } 1146 var triggerOnArray = triggerOnValue.split(","); 1147 for (var i = 0; i < triggerOnArray.length; i++) { 1148 var triggerOn = $.trim(triggerOnArray[i]); 1149 var splitTriggerOn = triggerOn.split(" "); 1150 var eventString = eventFor(splitTriggerOn[0], $(elt)); 1151 var eventModifier = splitTriggerOn[1]; 1152 1153 if (triggerOn == 'load') { 1154 fireICRequest(elt); 1155 } else if (triggerOn == 'scrolled-into-view') { 1156 initScrollHandler(); 1157 setTimeout(function() { 1158 triggerEvent($(window), 'scroll'); 1159 }, 100); // Trigger a scroll in case element is already viewable 1160 } else { 1161 if(eventString.indexOf("sse:") == 0) { 1162 //Server-sent event, find closest event source and register for it 1163 var sourceElt = elt.closest(getICAttributeSelector('ic-sse-src')); 1164 if(sourceElt.length > 0) { 1165 registerSSE(sourceElt, splitTriggerOn[0].substr(4)) 1166 } 1167 } else { 1168 $(getTriggeredElement(elt)).on(eventString, function(e) { 1169 var onBeforeTrigger = closestAttrValue(elt, 'ic-on-beforeTrigger'); 1170 if (onBeforeTrigger) { 1171 if (globalEval(onBeforeTrigger, [["elt", elt], ["evt", e], ["elt", elt]]) == false) { 1172 log(elt, "ic-trigger cancelled by ic-on-beforeTrigger", "DEBUG"); 1173 return false; 1174 } 1175 } 1176 1177 if (eventModifier == 'changed') { 1178 var currentVal = elt.val(); 1179 var previousVal = elt.data('ic-previous-val'); 1180 elt.data('ic-previous-val', currentVal); 1181 if (currentVal != previousVal) { 1182 fireICRequest(elt); 1183 } 1184 } else if (eventModifier == 'once') { 1185 var alreadyTriggered = elt.data('ic-already-triggered'); 1186 elt.data('ic-already-triggered', true); 1187 if (alreadyTriggered !== true) { 1188 fireICRequest(elt); 1189 } 1190 } else { 1191 fireICRequest(elt); 1192 } 1193 if (preventDefault(elt, e)) { 1194 e.preventDefault(); 1195 return false; 1196 } 1197 return true; 1198 }); 1199 if(eventString && (eventString.indexOf("timeout:") == 0)) { 1200 var timeout = parseInterval(eventString.split(":")[1]); 1201 setTimeout(function () { 1202 $(getTriggeredElement(elt)).trigger(eventString); 1203 }, timeout); 1204 } 1205 } 1206 } 1207 } 1208 } 1209 } 1210 1211 //============================================================---- 1212 // Macro support 1213 //============================================================---- 1214 1215 function macroIs(macro, constant) { 1216 return macro == fixICAttributeName(constant); 1217 } 1218 1219 function processMacro(macro, elt) { 1220 // action attributes 1221 if (macroIs(macro, 'ic-post-to')) { 1222 setIfAbsent(elt, 'ic-src', getICAttribute(elt, 'ic-post-to')); 1223 setIfAbsent(elt, 'ic-verb', 'POST'); 1224 setIfAbsent(elt, 'ic-trigger-on', 'default'); 1225 setIfAbsent(elt, 'ic-deps', 'ignore'); 1226 } 1227 if (macroIs(macro, 'ic-put-to')) { 1228 setIfAbsent(elt, 'ic-src', getICAttribute(elt, 'ic-put-to')); 1229 setIfAbsent(elt, 'ic-verb', 'PUT'); 1230 setIfAbsent(elt, 'ic-trigger-on', 'default'); 1231 setIfAbsent(elt, 'ic-deps', 'ignore'); 1232 } 1233 if (macroIs(macro, 'ic-patch-to')) { 1234 setIfAbsent(elt, 'ic-src', getICAttribute(elt, 'ic-patch-to')); 1235 setIfAbsent(elt, 'ic-verb', 'PATCH'); 1236 setIfAbsent(elt, 'ic-trigger-on', 'default'); 1237 setIfAbsent(elt, 'ic-deps', 'ignore'); 1238 } 1239 if (macroIs(macro, 'ic-get-from')) { 1240 setIfAbsent(elt, 'ic-src', getICAttribute(elt, 'ic-get-from')); 1241 setIfAbsent(elt, 'ic-trigger-on', 'default'); 1242 setIfAbsent(elt, 'ic-deps', 'ignore'); 1243 } 1244 if (macroIs(macro, 'ic-delete-from')) { 1245 setIfAbsent(elt, 'ic-src', getICAttribute(elt, 'ic-delete-from')); 1246 setIfAbsent(elt, 'ic-verb', 'DELETE'); 1247 setIfAbsent(elt, 'ic-trigger-on', 'default'); 1248 setIfAbsent(elt, 'ic-deps', 'ignore'); 1249 } 1250 1251 if (macroIs(macro, 'ic-action')) { 1252 setIfAbsent(elt, 'ic-trigger-on', 'default'); 1253 } 1254 1255 // non-action attributes 1256 var value = null; 1257 var url = null; 1258 if (macroIs(macro, 'ic-style-src')) { 1259 value = getICAttribute(elt, 'ic-style-src').split(":"); 1260 var styleAttribute = value[0]; 1261 url = value[1]; 1262 setIfAbsent(elt, 'ic-src', url); 1263 setIfAbsent(elt, 'ic-target', 'this.style.' + styleAttribute); 1264 } 1265 if (macroIs(macro, 'ic-attr-src')) { 1266 value = getICAttribute(elt, 'ic-attr-src').split(":"); 1267 var attribute = value[0]; 1268 url = value[1]; 1269 setIfAbsent(elt, 'ic-src', url); 1270 setIfAbsent(elt, 'ic-target', 'this.' + attribute); 1271 } 1272 if (macroIs(macro, 'ic-prepend-from')) { 1273 setIfAbsent(elt, 'ic-src', getICAttribute(elt, 'ic-prepend-from')); 1274 setIfAbsent(elt, 'ic-swap-style', 'prepend'); 1275 } 1276 if (macroIs(macro, 'ic-append-from')) { 1277 setIfAbsent(elt, 'ic-src', getICAttribute(elt, 'ic-append-from')); 1278 setIfAbsent(elt, 'ic-swap-style', 'append'); 1279 } 1280 } 1281 1282 function isLocalLink(anchor) { 1283 return location.hostname === anchor[0].hostname && 1284 anchor.attr('href') && 1285 !anchor.attr('href').startsWith("#") 1286 } 1287 1288 function enhanceAnchor(anchor) { 1289 if (closestAttrValue(anchor, 'ic-enhance') === "true") { 1290 if (isLocalLink(anchor)) { 1291 setIfAbsent(anchor, 'ic-src', anchor.attr('href')); 1292 setIfAbsent(anchor, 'ic-trigger-on', 'default'); 1293 setIfAbsent(anchor, 'ic-deps', 'ignore'); 1294 setIfAbsent(anchor, 'ic-push-url', 'true'); 1295 } 1296 } 1297 } 1298 1299 function determineFormVerb(form) { 1300 return form.find('input[name="_method"]').val() || form.attr('method') || form[0].method; 1301 } 1302 1303 function enhanceForm(form) { 1304 if (closestAttrValue(form, 'ic-enhance') === "true") { 1305 setIfAbsent(form, 'ic-src', form.attr('action')); 1306 setIfAbsent(form, 'ic-trigger-on', 'default'); 1307 setIfAbsent(form, 'ic-deps', 'ignore'); 1308 setIfAbsent(form, 'ic-verb', determineFormVerb(form)); 1309 } 1310 } 1311 1312 function enhanceDomTree(elt) { 1313 if(elt.is('a')) { 1314 enhanceAnchor(elt); 1315 } 1316 elt.find('a').each(function(){ 1317 enhanceAnchor($(this)); 1318 }); 1319 if(elt.is('form')){ 1320 enhanceForm(elt); 1321 } 1322 elt.find('form').each(function(){ 1323 enhanceForm($(this)); 1324 }); 1325 } 1326 1327 function setIfAbsent(elt, attr, value) { 1328 if (getICAttribute(elt, attr) == null) { 1329 setICAttribute(elt, attr, value); 1330 } 1331 } 1332 1333 //============================================================---- 1334 // Utilities 1335 //============================================================---- 1336 1337 function isScrolledIntoView(elem) { 1338 elem = $(elem); 1339 if (elem.height() == 0 && elem.width() == 0) { 1340 return false; 1341 } 1342 var docViewTop = $(window).scrollTop(); 1343 var docViewBottom = docViewTop + $(window).height(); 1344 1345 var elemTop = elem.offset().top; 1346 var elemBottom = elemTop + elem.height(); 1347 1348 return ((elemBottom >= docViewTop) && (elemTop <= docViewBottom) 1349 && (elemBottom <= docViewBottom) && (elemTop >= docViewTop)); 1350 } 1351 1352 function maybeScrollToTarget(elt, target) { 1353 if (closestAttrValue(elt, 'ic-scroll-to-target') != "false" && 1354 (closestAttrValue(elt, 'ic-scroll-to-target') == 'true' || 1355 closestAttrValue(target, 'ic-scroll-to-target') == 'true')) { 1356 var offset = -50; // -50 px default offset padding 1357 if (closestAttrValue(elt, 'ic-scroll-offset')) { 1358 offset = parseInt(closestAttrValue(elt, 'ic-scroll-offset')); 1359 } else if (closestAttrValue(target, 'ic-scroll-offset')) { 1360 offset = parseInt(closestAttrValue(target, 'ic-scroll-offset')); 1361 } 1362 var currentPosition = target.offset().top; 1363 var portalTop = $(window).scrollTop(); 1364 var portalEnd = portalTop + window.innerHeight; 1365 //if the current top of this element is not visible, scroll it to the top position 1366 if (currentPosition < portalTop || currentPosition > portalEnd) { 1367 offset += currentPosition; 1368 $('html,body').animate({scrollTop: offset}, 400); 1369 } 1370 } 1371 } 1372 1373 function getTransitionDuration(elt, target) { 1374 var transitionDuration = closestAttrValue(elt, 'ic-transition-duration'); 1375 if (transitionDuration) { 1376 return parseInterval(transitionDuration); 1377 } 1378 transitionDuration = closestAttrValue(target, 'ic-transition-duration'); 1379 if (transitionDuration) { 1380 return parseInterval(transitionDuration); 1381 } 1382 target = $(target); 1383 var duration = 0; 1384 var durationStr = target.css('transition-duration'); 1385 if (durationStr) { 1386 duration += parseInterval(durationStr); 1387 } 1388 var delayStr = target.css('transition-delay'); 1389 if (delayStr) { 1390 duration += parseInterval(delayStr); 1391 } 1392 return duration; 1393 } 1394 1395 function closeSSESource(elt) { 1396 var src = elt.data('ic-event-sse-source'); 1397 try { 1398 if(src) { 1399 src.close(); 1400 } 1401 } catch (e) { 1402 log(elt, "Error closing ServerSentEvent source" + e, "ERROR"); 1403 } 1404 } 1405 1406 function beforeSwapCleanup(target) { 1407 target.find(getICAttributeSelector('ic-sse-src')).each(function() { 1408 closeSSESource($(this)); 1409 }); 1410 triggerEvent(target, 'beforeSwap.ic'); 1411 } 1412 1413 function processICResponse(responseContent, elt, forHistory, url) { 1414 if (responseContent && responseContent != "" && responseContent != " ") { 1415 1416 log(elt, "response content: \\n" + responseContent, "DEBUG"); 1417 var target = getTarget(elt); 1418 1419 var transformer = closestAttrValue(elt, 'ic-transform-response'); 1420 if(transformer) { 1421 responseContent = globalEval(transformer, [["content", responseContent], ["url", url], ["elt", elt]]); 1422 } 1423 1424 var contentToSwap = maybeFilter(responseContent, closestAttrValue(elt, 'ic-select-from-response')); 1425 1426 if (closestAttrValue(elt, 'ic-fix-ids') == "true") { 1427 fixIDs(contentToSwap); 1428 } 1429 1430 var doSwap = function() { 1431 if (closestAttrValue(elt, 'ic-replace-target') == "true") { 1432 try { 1433 beforeSwapCleanup(target); 1434 closeSSESource(target); 1435 target.replaceWith(contentToSwap); 1436 target = contentToSwap; 1437 } catch (e) { 1438 log(elt, formatError(e), "ERROR"); 1439 } 1440 processNodes(contentToSwap); 1441 fireReadyStuff(target); 1442 autoFocus(target); 1443 } else { 1444 if (getICAttribute(elt, 'ic-swap-style') == "prepend") { 1445 prepend(target, contentToSwap); 1446 processNodes(contentToSwap); 1447 fireReadyStuff(target); 1448 autoFocus(target); 1449 } else if (getICAttribute(elt, 'ic-swap-style') == "append") { 1450 append(target, contentToSwap); 1451 processNodes(contentToSwap); 1452 fireReadyStuff(target); 1453 autoFocus(target); 1454 } else { 1455 try { 1456 beforeSwapCleanup(target); 1457 target.empty().append(contentToSwap); 1458 } catch (e) { 1459 log(elt, formatError(e), "ERROR"); 1460 } 1461 target.children().each(function() { 1462 processNodes(this); 1463 }); 1464 fireReadyStuff(target); 1465 autoFocus(target); 1466 } 1467 if (forHistory != true) { 1468 maybeScrollToTarget(elt, target); 1469 } 1470 1471 var switchClass = elt.closest(getICAttributeSelector('ic-switch-class')); 1472 var classToSwitch = switchClass.attr(fixICAttributeName('ic-switch-class')); 1473 if(classToSwitch) { 1474 switchClass.children().removeClass(classToSwitch); 1475 switchClass.children().each(function(){ 1476 if($.contains($(this)[0], $(elt)[0]) || $(this)[0] == $(elt)[0]) { 1477 $(this).addClass(classToSwitch); 1478 $(this).addClass(classToSwitch); 1479 } 1480 }) 1481 } 1482 1483 } 1484 }; 1485 1486 if (target.length == 0) { 1487 //TODO cgross - refactor getTarget to return printable string here 1488 log(elt, "Invalid target for element: " + getICAttribute(elt.closest(getICAttributeSelector('ic-target')), 'ic-target'), "ERROR"); 1489 return; 1490 } 1491 1492 var delay = getTransitionDuration(elt, target); 1493 target.addClass('ic-transitioning'); 1494 setTimeout(function() { 1495 try { 1496 doSwap(); 1497 } catch (e) { 1498 log(elt, "Error during content swap : " + formatError(e), "ERROR"); 1499 } 1500 setTimeout(function() { 1501 try { 1502 target.removeClass('ic-transitioning'); 1503 if(_history) { 1504 _history.updateHistory(); 1505 } 1506 triggerEvent(target, "complete_transition.ic", [target]); 1507 } catch (e) { 1508 log(elt, "Error during transition complete : " + formatError(e), "ERROR"); 1509 } 1510 }, 20); 1511 }, delay); 1512 } else { 1513 log(elt, "Empty response, nothing to do here.", "DEBUG"); 1514 } 1515 } 1516 1517 function maybeFilter(newContent, filter) { 1518 var asQuery; 1519 if ($.zepto) { 1520 var newDoc = createDocument(newContent); 1521 asQuery = $(newDoc).find('body').contents(); 1522 } else { 1523 asQuery = $($.parseHTML(newContent, null, true)); 1524 } 1525 if (filter) { 1526 return walkTree(asQuery, filter).contents(); 1527 } else { 1528 return asQuery; 1529 } 1530 } 1531 1532 function walkTree(elt, filter) { 1533 return elt.filter(filter).add(elt.find(filter)); 1534 } 1535 1536 function fixIDs(contentToSwap) { 1537 var fixedIDs = {}; 1538 walkTree(contentToSwap, "[id]").each(function() { 1539 var originalID = $(this).attr("id"); 1540 var fixedID; 1541 do { 1542 fixedID = "ic-fixed-id-" + uuid(); 1543 } while ($("#" + fixedID).length > 0); 1544 fixedIDs[originalID] = fixedID; 1545 $(this).attr("id", fixedID); 1546 }); 1547 walkTree(contentToSwap, "label[for]").each(function () { 1548 var originalID = $(this).attr("for"); 1549 $(this).attr("for", fixedIDs[originalID] || originalID); 1550 }); 1551 walkTree(contentToSwap, "*").each(function () { 1552 $.each(this.attributes, function () { 1553 if (this.value.indexOf("#") !== -1) { 1554 this.value = this.value.replace(/#([-_A-Za-z0-9]+)/g, function(match, originalID) { 1555 return "#" + (fixedIDs[originalID] || originalID); 1556 }); 1557 } 1558 }) 1559 }); 1560 } 1561 1562 function getStyleTarget(elt) { 1563 var val = closestAttrValue(elt, 'ic-target'); 1564 if (val && val.indexOf("this.style.") == 0) { 1565 return val.substr(11) 1566 } else { 1567 return null; 1568 } 1569 } 1570 1571 function getAttrTarget(elt) { 1572 var val = closestAttrValue(elt, 'ic-target'); 1573 if (val && val.indexOf("this.") == 0) { 1574 return val.substr(5) 1575 } else { 1576 return null; 1577 } 1578 } 1579 1580 function fireICRequest(elt, alternateHandler) { 1581 elt = $(elt); 1582 1583 var triggerOrigin = elt; 1584 if (!elt.is(getICAttributeSelector('ic-src')) && getICAttribute(elt, 'ic-action') == undefined) { 1585 elt = elt.closest(getICAttributeSelector('ic-src')); 1586 } 1587 1588 var confirmText = closestAttrValue(elt, 'ic-confirm'); 1589 if (confirmText) { 1590 if (!confirm(confirmText)) { 1591 return; 1592 } 1593 } 1594 1595 if("true" == closestAttrValue(elt, 'ic-disable-when-doc-hidden')) { 1596 if(document['hidden']) { 1597 return; 1598 } 1599 } 1600 1601 if("true" == closestAttrValue(elt, 'ic-disable-when-doc-inactive')) { 1602 if(!document.hasFocus()) { 1603 return; 1604 } 1605 } 1606 1607 if (elt.length > 0) { 1608 var icEventId = uuid(); 1609 elt.data('ic-event-id', icEventId); 1610 var invokeRequest = function() { 1611 1612 // if an existing request is in flight for this element, push this request as the next to be executed 1613 if (elt.data('ic-request-in-flight') == true) { 1614 elt.data('ic-next-request', {"req" : invokeRequest}); 1615 return; 1616 } 1617 1618 if (elt.data('ic-event-id') == icEventId) { 1619 var styleTarget = getStyleTarget(elt); 1620 var attrTarget = styleTarget ? null : getAttrTarget(elt); 1621 var verb = verbFor(elt); 1622 var url = getICAttribute(elt, 'ic-src'); 1623 if (url) { 1624 var success = alternateHandler || function(data) { 1625 if (styleTarget) { 1626 elt.css(styleTarget, data); 1627 } else if (attrTarget) { 1628 elt.attr(attrTarget, data); 1629 } else { 1630 processICResponse(data, elt, false, url); 1631 if (verb != 'GET') { 1632 refreshDependencies(getICAttribute(elt, 'ic-src'), elt); 1633 } 1634 } 1635 }; 1636 var data = getParametersForElement(verb, elt, triggerOrigin); 1637 if(data) { 1638 handleRemoteRequest(elt, verb, url, data, success); 1639 } 1640 } 1641 maybeInvokeLocalAction(elt, ""); 1642 } 1643 }; 1644 1645 var triggerDelay = closestAttrValue(elt, 'ic-trigger-delay'); 1646 if (triggerDelay) { 1647 setTimeout(invokeRequest, parseInterval(triggerDelay)); 1648 } else { 1649 invokeRequest(); 1650 } 1651 } 1652 } 1653 1654 function maybeInvokeLocalAction(elt, modifier) { 1655 var actions = getICAttribute(elt, 'ic' + modifier + '-action'); 1656 if (actions) { 1657 invokeLocalAction(elt, actions, modifier); 1658 } 1659 } 1660 1661 function invokeLocalAction(elt, actions, modifier) { 1662 var actionTargetVal = closestAttrValue(elt, 'ic' + modifier + '-action-target'); 1663 if(actionTargetVal === null && modifier !== "") { 1664 actionTargetVal = closestAttrValue(elt, 'ic-action-target'); 1665 } 1666 1667 var target = null; 1668 if(actionTargetVal) { 1669 target = getTargetImpl(elt, 'ic-action-target'); 1670 } else { 1671 target = getTarget(elt); 1672 } 1673 var actionArr = actions.split(";"); 1674 1675 var actionsArr = []; 1676 var delay = 0; 1677 1678 $.each(actionArr, function(i, actionStr) { 1679 var actionDef = $.trim(actionStr); 1680 var action = actionDef; 1681 var actionArgs = []; 1682 if (actionDef.indexOf(":") > 0) { 1683 action = actionDef.substr(0, actionDef.indexOf(":")); 1684 actionArgs = computeArgs(actionDef.substr(actionDef.indexOf(":") + 1, actionDef.length)); 1685 } 1686 if (action == "") { 1687 // ignore blanks 1688 } else if (action == "delay") { 1689 if (delay == null) { 1690 delay = 0; 1691 } 1692 delay += parseInterval(actionArgs[0] + ""); // custom interval increase 1693 } else { 1694 if (delay == null) { 1695 delay = 420; // 420ms default interval increase (400ms jQuery default + 20ms slop) 1696 } 1697 actionsArr.push([delay, makeApplyAction(target, action, actionArgs)]); 1698 delay = null; 1699 } 1700 }); 1701 1702 delay = 0; 1703 $.each(actionsArr, function(i, action) { 1704 delay += action[0]; 1705 setTimeout(action[1], delay); 1706 }); 1707 } 1708 1709 function computeArgs(args) { 1710 try { 1711 return eval("[" + args + "]") 1712 } catch (e) { 1713 return [$.trim(args)]; 1714 } 1715 } 1716 1717 function makeApplyAction(target, action, args) { 1718 return function() { 1719 var
vendor: 7,531 bytes, lines 1719-1946
1719func = target[action] || window[action]; 1720 if (func) { 1721 func.apply(target, args); 1722 } else { 1723 log(target, "Action " + action + " was not found", "ERROR"); 1724 } 1725 }; 1726 } 1727 1728 //============================================================ 1729 // History Support 1730 //============================================================ 1731 1732 function newIntercoolerHistory(storage, history, slotLimit, historyVersion) { 1733 1734 /* Constants */ 1735 var HISTORY_SUPPORT_SLOT = 'ic-history-support'; 1736 var HISTORY_SLOT_PREFIX = "ic-hist-elt-"; 1737 1738 /* Instance Vars */ 1739 var historySupportData = JSON.parse(storage.getItem(HISTORY_SUPPORT_SLOT)); 1740 var _snapshot = null; 1741 1742 // Reset history if the history config has changed 1743 if (historyConfigHasChanged(historySupportData)) { 1744 log(getTargetForHistory($('body')), "Intercooler History configuration changed, clearing history", "INFO"); 1745 clearHistory(); 1746 } 1747 1748 if (historySupportData == null) { 1749 historySupportData = { 1750 slotLimit: slotLimit, 1751 historyVersion: historyVersion, 1752 lruList: [] 1753 }; 1754 } 1755 1756 /* Instance Methods */ 1757 function historyConfigHasChanged(historySupportData) { 1758 return historySupportData == null || 1759 historySupportData.slotLimit != slotLimit || 1760 historySupportData.historyVersion != historyVersion || 1761 historySupportData.lruList == null 1762 } 1763 1764 function clearHistory() { 1765 var keys = []; 1766 for (var i = 0; i < storage.length; i++) { 1767 if (storage.key(i).indexOf(HISTORY_SLOT_PREFIX) == 0) { 1768 keys.push(storage.key(i)); 1769 } 1770 } 1771 for (var j = 0; j < keys.length; j++) { 1772 storage.removeItem(keys[j]); 1773 } 1774 storage.removeItem(HISTORY_SUPPORT_SLOT); 1775 historySupportData = { 1776 slotLimit: slotLimit, 1777 historyVersion: historyVersion, 1778 lruList: [] 1779 }; 1780 } 1781 1782 function updateLRUList(url) { 1783 var lruList = historySupportData.lruList; 1784 var currentIndex = lruList.indexOf(url); 1785 var t = getTargetForHistory($('body')); 1786 // found in current list, shift it to the end 1787 if (currentIndex >= 0) { 1788 log(t, "URL found in LRU list, moving to end", "INFO"); 1789 lruList.splice(currentIndex, 1); 1790 lruList.push(url); 1791 } else { 1792 // not found, add and shift if necessary 1793 log(t, "URL not found in LRU list, adding", "INFO"); 1794 lruList.push(url); 1795 if (lruList.length > historySupportData.slotLimit) { 1796 var urlToDelete = lruList.shift(); 1797 log(t, "History overflow, removing local history for " + urlToDelete, "INFO"); 1798 storage.removeItem(HISTORY_SLOT_PREFIX + urlToDelete); 1799 } 1800 } 1801 1802 // save history metadata 1803 storage.setItem(HISTORY_SUPPORT_SLOT, JSON.stringify(historySupportData)); 1804 return lruList; 1805 } 1806 1807 function saveHistoryData(restorationData) { 1808 var content = JSON.stringify(restorationData); 1809 try { 1810 storage.setItem(restorationData.id, content); 1811 } catch (e) { 1812 //quota error, nuke local cache 1813 try { 1814 clearHistory(); 1815 storage.setItem(restorationData.id, content); 1816 } catch (e) { 1817 log(getTargetForHistory($('body')), "Unable to save intercooler history with entire history cleared, is something else eating " + 1818 "local storage? History Limit:" + slotLimit, "ERROR"); 1819 } 1820 } 1821 } 1822 1823 function makeHistoryEntry(html, yOffset, url, title) { 1824 var restorationData = { 1825 "url": url, 1826 "id": HISTORY_SLOT_PREFIX + url, 1827 "content": html, 1828 "yOffset": yOffset, 1829 "timestamp": new Date().getTime(), 1830 "title": title 1831 }; 1832 updateLRUList(url); 1833 // save to the history slot 1834 saveHistoryData(restorationData); 1835 return restorationData; 1836 } 1837 1838 function addPopStateHandler(windowToAdd) { 1839 if (windowToAdd.onpopstate == null || windowToAdd.onpopstate['ic-on-pop-state-handler'] != true) { 1840 var currentOnPopState = windowToAdd.onpopstate; 1841 windowToAdd.onpopstate = function(event) { 1842 triggerEvent(getTargetForHistory($('body')), 'handle.onpopstate.ic'); 1843 if (!handleHistoryNavigation(event)) { 1844 if (currentOnPopState) { 1845 currentOnPopState(event); 1846 } 1847 } 1848 triggerEvent(getTargetForHistory($('body')), 'pageLoad.ic'); 1849 }; 1850 windowToAdd.onpopstate['ic-on-pop-state-handler'] = true; 1851 } 1852 } 1853 1854 function updateHistory() { 1855 if (_snapshot) { 1856 pushUrl(_snapshot.newUrl, currentUrl(), _snapshot.oldHtml, _snapshot.yOffset, _snapshot.oldTitle); 1857 _snapshot = null; 1858 } 1859 } 1860 1861 function pushUrl(newUrl, originalUrl, originalHtml, yOffset, originalTitle) { 1862 1863 var historyEntry = makeHistoryEntry(originalHtml, yOffset, originalUrl, originalTitle); 1864 history.replaceState({"ic-id": historyEntry.id}, "", ""); 1865 1866 var t = getTargetForHistory($('body')); 1867 var restorationData = makeHistoryEntry(t.html(), window.pageYOffset, newUrl, document.title); 1868 history.pushState({'ic-id': restorationData.id}, "", newUrl); 1869 1870 triggerEvent(t, "pushUrl.ic", [t, restorationData]); 1871 } 1872 1873 function handleHistoryNavigation(event) { 1874 var data = event.state; 1875 if (data && data['ic-id']) { 1876 var historyData = JSON.parse(storage.getItem(data['ic-id'])); 1877 if (historyData) { 1878 processICResponse(historyData["content"], getTargetForHistory($('body')), true); 1879 if (historyData["yOffset"]) { 1880 setTimeout(function () { 1881 window.scrollTo(0, historyData["yOffset"]); 1882 }, 100); 1883 } 1884 if (historyData["title"]) { 1885 document.title = historyData["title"]; 1886 } 1887 return true; 1888 } else { 1889 $.get(currentUrl(), {'ic-restore-history': true}, function(data, status) { 1890 var newDoc = createDocument(data); 1891 var replacementHtml = getTargetForHistory(newDoc).html(); 1892 processICResponse(replacementHtml, getTargetForHistory($('body')), true); 1893 }); 1894 } 1895 } 1896 return false; 1897 } 1898 1899 function getTargetForHistory(elt) { 1900 var explicitHistoryTarget = elt.find(getICAttributeSelector('ic-history-elt')); 1901 if (explicitHistoryTarget.length > 0) { 1902 return explicitHistoryTarget; 1903 } else { 1904 return elt; 1905 } 1906 } 1907 1908 function snapshotForHistory(newUrl, oldTitle) { 1909 var t = getTargetForHistory($('body')); 1910 triggerEvent(t, "beforeHistorySnapshot.ic", [t]); 1911 _snapshot = { 1912 newUrl: newUrl, 1913 oldHtml: t.html(), 1914 yOffset: window.pageYOffset, 1915 oldTitle: oldTitle 1916 }; 1917 } 1918 1919 function dumpLocalStorage() { 1920 var str = ""; 1921 var keys = []; 1922 for (var x in storage) { 1923 keys.push(x); 1924 } 1925 keys.sort(); 1926 var total = 0; 1927 for (var i in keys) { 1928 var size = (storage[keys[i]].length * 2); 1929 total += size; 1930 str += keys[i] + "=" + (size / 1024 / 1024).toFixed(2) + " MB\\n"; 1931 } 1932 return str + "\\nTOTAL LOCAL STORAGE: " + (total / 1024 / 1024).toFixed(2) + " MB"; 1933 } 1934 1935 function supportData() { 1936 return historySupportData; 1937 } 1938 1939 /* API */ 1940 return { 1941 clearHistory: clearHistory, 1942 updateHistory: updateHistory, 1943 addPopStateHandler: addPopStateHandler, 1944 snapshotForHistory: snapshotForHistory, 1945 _internal: { 1946 addPopStateHandler: addPopStateHandler,
1947 supportData: supportData, 1948 dumpLocalStorage: dumpLocalStorage, 1949 updateLRUList: updateLRUList 1950 } 1951 }; 1952 } 1953 1954 function getSlotLimit() { 1955 return 20; 1956 } 1957 1958 function refresh(val) { 1959 if (typeof val == 'string' || val instanceof String) { 1960 refreshDependencies(val); 1961 } else { 1962 fireICRequest(val); 1963 } 1964 return Intercooler; 1965 } 1966 1967 var _history = null; 1968 try { 1969 _history = newIntercoolerHistory(localStorage, window.history, getSlotLimit(), .1); 1970 } catch(e) { 1971 log($('body'), "Could not initialize history", "WARN"); 1972 } 1973 1974 //============================================================ 1975 // Local references transport 1976 //============================================================ 1977 1978 if($.ajaxTransport) { 1979 $.ajaxTransport("text", function(options, origOptions) { 1980 if (origOptions.url[0] == "#") { 1981 var ltAttr = fixICAttributeName("ic-local-"); 1982 var src = $(origOptions.url); 1983 var rsphdr = []; 1984 var status = 200; 1985 var statusText = "OK"; 1986 src.each(function(i, el) { 1987 $.each(el.attributes, function(j, attr) { 1988 if (attr.name.substr(0, ltAttr.length) == ltAttr) { 1989 var lhName = attr.name.substring(ltAttr.length); 1990 if (lhName == "status") { 1991 var statusLine = attr.value.match(/(\\d+)\\s?(.*)/); 1992 if (statusLine != null) { 1993 status = statusLine[1]; 1994 statusText = statusLine[2]; 1995 } else { 1996 status = "500"; 1997 statusText = "Attribute Error"; 1998 } 1999 } else { 2000 rsphdr.push(lhName + ": " + attr.value); 2001 } 2002 } 2003 }); 2004 }); 2005 var rsp = src.length > 0 ? src.html() : ""; 2006 return { 2007 send: function(reqhdr, completeCallback) { 2008 completeCallback(status, statusText, {html: rsp}, rsphdr.join("\\n")); 2009 }, 2010 abort: function() { 2011 } 2012 }; 2013 } else { 2014 return null; 2015 } 2016 } 2017 ); 2018 2019 } 2020 2021 //============================================================ 2022 // Bootstrap 2023 //============================================================ 2024 2025 function init() { 2026 var elt = $('body'); 2027 processNodes(elt); 2028 fireReadyStuff(elt); 2029 if(_history) { 2030 _history.addPopStateHandler(window); 2031 } 2032 if($.zepto) { 2033 $('body').data('zeptoDataTest', {}); 2034 if(typeof($('body').data('zeptoDataTest')) == "string") { 2035 log(null, 2036 "!!!! Please include the data module with Zepto! Intercooler requires full data support to function !!!!", 2037 "ERROR") 2038 } 2039 } 2040 } 2041 2042 $(function() { 2043 init(); 2044 }); 2045 2046 /* =================================================== 2047 * API 2048 * =================================================== */ 2049 return { 2050 refresh: refresh, 2051 history: _history, 2052 triggerRequest: fireICRequest, 2053 processNodes: processNodes, 2054 closestAttrValue: closestAttrValue, 2055 verbFor: verbFor, 2056 isDependent: isDependent, 2057 getTarget: getTarget, 2058 processHeaders: processHeaders, 2059 startPolling: startPolling, 2060 cancelPolling: cancelPolling, 2061 setIsDependentFunction: function(func) { 2062 _isDependentFunction = func; 2063 }, 2064 ready: function(readyHandler) { 2065 _readyHandlers.push(readyHandler); 2066 }, 2067 _internal: { 2068 init: init, 2069 replaceOrAddMethod: replaceOrAddMethod, 2070 initEventSource: function(url, withCredentials) { 2071 return new EventSource(url, {withCredentials: withCredentials}); 2072 }, 2073 globalEval: globalEval, 2074 getLocalURL: getLocalURL 2075 } 2076 }; 2077})(); 2078 2079return Intercooler; 2080 2081})); 2082`},9923:function(e){e.exports=`/* 2083 * Lightcase - jQuery Plugin 2084 * The smart and flexible Lightbox Plugin. 2085 * 2086 * @author Cornel Boppart <[email protected]> 2087 * @copyright Author 2088 * 2089 * @version 2.5.0 (11/03/2018) 2090 */ 2091 2092;(function ($) { 2093 2094 'use strict'; 2095 2096 var _self = { 2097 cache: {}, 2098 2099 support: {}, 2100 2101 objects: {}, 2102 2103 /** 2104 * Initializes the plugin 2105 * 2106 * @param {object} options 2107 * @return {object} 2108 */ 2109 init: function (options) { 2110 return this.each(function () { 2111 $(this).unbind('click.lightcase').bind('click.lightcase', function (event) { 2112 event.preventDefault(); 2113 $(this).lightcase('start', options); 2114 }); 2115 }); 2116 }, 2117 2118 /** 2119 * Starts the plugin 2120 * 2121 * @param {object} options 2122 * @return {void} 2123 */ 2124 start: function (options) { 2125 _self.origin = lightcase.origin = this; 2126 2127 _self.settings = lightcase.settings = $.extend(true, { 2128 idPrefix: 'lightcase-', 2129 classPrefix: 'lightcase-', 2130 attrPrefix: 'lc-', 2131 transition: 'elastic', 2132 transitionOpen: null, 2133 transitionClose: null, 2134 transitionIn: null, 2135 transitionOut: null, 2136 cssTransitions: true, 2137 speedIn: 250, 2138 speedOut: 250, 2139 width: null, 2140 height: null, 2141 maxWidth: 800, 2142 maxHeight: 500, 2143 forceWidth: false, 2144 forceHeight: false, 2145 liveResize: true, 2146 fullScreenModeForMobile: true, 2147 mobileMatchExpression: /(iphone|ipod|ipad|android|blackberry|symbian)/, 2148 disableShrink: false, 2149 fixedRatio: true, 2150 shrinkFactor: .75, 2151 overlayOpacity: .9, 2152 slideshow: false, 2153 slideshowAutoStart: true, 2154 breakBeforeShow: false, 2155 timeout: 5000, 2156 swipe: true, 2157 useKeys: true, 2158 useCategories: true, 2159 useAsCollection: false, 2160 navigateEndless: true, 2161 closeOnOverlayClick: true, 2162 title: null, 2163 caption: null, 2164 showTitle: true, 2165 showCaption: true, 2166 showSequenceInfo: true, 2167 inline: { 2168 width: 'auto', 2169 height: 'auto' 2170 }, 2171 ajax: { 2172 width: 'auto', 2173 height: 'auto', 2174 type: 'get', 2175 dataType: 'html', 2176 data: {} 2177 }, 2178 iframe: { 2179 width: 800, 2180 height: 500, 2181 frameborder: 0 2182 }, 2183 flash: { 2184 width: 400, 2185 height: 205, 2186 wmode: 'transparent' 2187 }, 2188 video: { 2189 width: 400, 2190 height: 225, 2191 poster: '', 2192 preload: 'auto', 2193 controls: true, 2194 autobuffer: true, 2195 autoplay: true, 2196 loop: false 2197 }, 2198 attr: 'data-rel', 2199 href: null, 2200 type: null, 2201 typeMapping: { 2202 'image': 'jpg,jpeg,gif,png,bmp', 2203 'flash': 'swf', 2204 'video': 'mp4,mov,ogv,ogg,webm', 2205 'iframe': 'html,php', 2206 'ajax': 'json,txt', 2207 'inline': '#' 2208 }, 2209 errorMessage: function () { 2210 return '<p class="' + _self.settings.classPrefix + 'error">' + _self.settings.labels['errorMessage'] + '</p>'; 2211 }, 2212 labels: { 2213 'errorMessage': 'Source could not be found...', 2214 'sequenceInfo.of': ' of ', 2215 'close': 'Close', 2216 'navigator.prev': 'Prev', 2217 'navigator.next': 'Next', 2218 'navigator.play': 'Play', 2219 'navigator.pause': 'Pause' 2220 }, 2221 markup: function () { 2222 _self.objects.body.append(
2223 _self.objects.overlay = $('<div id="' + _self.settings.idPrefix + 'overlay"></div>'), 2224 _self.objects.loading = $('<div id="' + _self.settings.idPrefix + 'loading" class="' + _self.settings.classPrefix + 'icon-spin"></div>'), 2225 _self.objects.case = $('<div id="' + _self.settings.idPrefix + 'case" aria-hidden="true" role="dialog"></div>') 2226 ); 2227 _self.objects.case.after( 2228 _self.objects.close = $('<a href="#" class="' + _self.settings.classPrefix + 'icon-close"><span>' + _self.settings.labels['close'] + '</span></a>'), 2229 _self.objects.nav = $('<div id="' + _self.settings.idPrefix + 'nav"></div>') 2230 ); 2231 _self.objects.nav.append( 2232 _self.objects.prev = $('<a href="#" class="' + _self.settings.classPrefix + 'icon-prev"><span>' + _self.settings.labels['navigator.prev'] + '</span></a>').hide(), 2233 _self.objects.next = $('<a href="#" class="' + _self.settings.classPrefix + 'icon-next"><span>' + _self.settings.labels['navigator.next'] + '</span></a>').hide(), 2234 _self.objects.play = $('<a href="#" class="' + _self.settings.classPrefix + 'icon-play"><span>' + _self.settings.labels['navigator.play'] + '</span></a>').hide(), 2235 _self.objects.pause = $('<a href="#" class="' + _self.settings.classPrefix + 'icon-pause"><span>' + _self.settings.labels['navigator.pause'] + '</span></a>').hide() 2236 ); 2237 _self.objects.case.append( 2238 _self.objects.content = $('<div id="' + _self.settings.idPrefix + 'content"></div>'), 2239 _self.objects.info = $('<div id="' + _self.settings.idPrefix + 'info"></div>') 2240 ); 2241 _self.objects.content.append(
2242 _self.objects.contentInner = $('<div class="' + _self.settings.classPrefix + 'contentInner"></div>') 2243 ); 2244 _self.objects.info.append( 2245 _self.objects.sequenceInfo = $('<div id="' + _self.settings.idPrefix + 'sequenceInfo"></div>'), 2246 _self.objects.title = $('<h4 id="' + _self.settings.idPrefix + 'title"></h4>'), 2247 _self.objects.caption = $('<p id="' + _self.settings.idPrefix + 'caption"></p>') 2248 ); 2249 }, 2250 onInit: {}, 2251 onStart: {}, 2252 onBeforeCalculateDimensions: {}, 2253 onAfterCalculateDimensions: {}, 2254 onBeforeShow: {}, 2255 onFinish: {}, 2256 onResize: {}, 2257 onClose: {}, 2258 onCleanup: {} 2259 }, 2260 options, 2261 // Load options from data-lc-options attribute 2262 _self.origin.data ? _self.origin.data('lc-options') : {}); 2263 2264 _self.objects.document = $('html'); 2265 _self.objects.body = $('body'); 2266 2267 // Call onInit hook functions 2268 _self._callHooks(_self.settings.onInit); 2269 2270 _self.objectData = _self._setObjectData(this); 2271 2272 _self._addElements(); 2273 _self._open(); 2274 2275 _self.dimensions = _self.getViewportDimensions(); 2276 }, 2277 2278 /** 2279 * Getter method for objects 2280 * 2281 * @param {string} name 2282 * @return {object} 2283 */ 2284 get: function (name) { 2285 return _self.objects[name]; 2286 }, 2287 2288 /** 2289 * Getter method for objectData 2290 * 2291 * @return {object} 2292 */ 2293 getObjectData: function () { 2294 return _self.objectData; 2295 }, 2296 2297 /** 2298 * Sets the object data 2299 * 2300 * @param {object} object 2301 * @return {object} objectData 2302 */ 2303 _setObjectData: function (object) { 2304 var $object = $(object), 2305 objectData = { 2306 this: $(object), 2307 title: _self.settings.title || $object.attr(_self._prefixAttributeName('title')) || $object.attr('title'), 2308 caption: _self.settings.caption || $object.attr(_self._prefixAttributeName('caption')) || $object.children('img').attr('alt'), 2309 url: _self._determineUrl(), 2310 requestType: _self.settings.ajax.type, 2311 requestData: _self.settings.ajax.data, 2312 requestDataType: _self.settings.ajax.dataType, 2313 rel: $object.attr(_self._determineAttributeSelector()), 2314 type: _self.settings.type || _self._verifyDataType(_self._determineUrl()), 2315 isPartOfSequence: _self.settings.useAsCollection || _self._isPartOfSequence($object.attr(_self.settings.attr), ':'), 2316 isPartOfSequenceWithSlideshow: _self._isPartOfSequence($object.attr(_self.settings.attr), ':slideshow'), 2317 currentIndex: $(_self._determineAttributeSelector()).index($object), 2318 sequenceLength: $(_self._determineAttributeSelector()).length 2319 }; 2320 2321 // Add sequence info to objectData 2322 objectData.sequenceInfo = (objectData.currentIndex + 1) + _self.settings.labels['sequenceInfo.of'] + objectData.sequenceLength; 2323 2324 // Add next/prev index 2325 objectData.prevIndex = objectData.currentIndex - 1; 2326 objectData.nextIndex = objectData.currentIndex + 1; 2327 2328 return objectData; 2329 }, 2330 2331 /** 2332 * Prefixes a data attribute name with defined name from 'settings.attrPrefix' 2333 * to ensure more uniqueness for all lightcase related/used attributes. 2334 * 2335 * @param {string} name 2336 * @return {string} 2337 */ 2338 _prefixAttributeName: function (name) { 2339 return 'data-' + _self.settings.attrPrefix + name; 2340 }, 2341 2342 /** 2343 * Determines the link target considering 'settings.href' and data attributes 2344 * but also with a fallback to the default 'href' value. 2345 * 2346 * @return {string} 2347 */ 2348 _determineLinkTarget: function () { 2349 return _self.settings.href || $(_self.origin).attr(_self._prefixAttributeName('href')) || $(_self.origin).attr('href'); 2350 }, 2351 2352 /** 2353 * Determines the attribute selector to use, depending on 2354 * whether categorized collections are beeing used or not. 2355 * 2356 * @return {string} selector 2357 */ 2358 _determineAttributeSelector: function () { 2359 var $origin = $(_self.origin), 2360 selector = ''; 2361 2362 if (typeof _self.cache.selector !== 'undefined') { 2363 selector = _self.cache.selector; 2364 } else if (_self.settings.useCategories === true && $origin.attr(_self._prefixAttributeName('categories'))) { 2365 var categories = $origin.attr(_self._prefixAttributeName('categories')).split(' '); 2366 2367 $.each(categories, function (index, category) { 2368 if (index > 0) { 2369 selector += ','; 2370 } 2371 selector += '[' + _self._prefixAttributeName('categories') + '~="' + category + '"]'; 2372 }); 2373 } else { 2374 selector = '[' + _self.settings.attr + '="' + $origin.attr(_self.settings.attr) + '"]'; 2375 } 2376 2377 _self.cache.selector = selector; 2378 2379 return selector; 2380 }, 2381 2382 /** 2383 * Determines the correct resource according to the 2384 * current viewport and density. 2385 * 2386 * @return {string} url 2387 */ 2388 _determineUrl: function () { 2389 var dataUrl = _self._verifyDataUrl(_self._determineLinkTarget()), 2390 width = 0, 2391 density = 0, 2392 supportLevel = '', 2393 url; 2394 2395 $.each(dataUrl, function (index, src) { 2396 switch (_self._verifyDataType(src.url)) { 2397 case 'video': 2398 var video = document.createElement('video'), 2399 videoType = _self._verifyDataType(src.url) + '/' + _self._getFileUrlSuffix(src.url); 2400 2401 // Check if browser can play this type of video format 2402 if (supportLevel !== 'probably' && supportLevel !== video.canPlayType(videoType) && video.canPlayType(videoType) !== '') { 2403 supportLevel = video.canPlayType(videoType); 2404 url = src.url; 2405 } 2406 break; 2407 default: 2408 if ( 2409 // Check density 2410 _self._devicePixelRatio() >= src.density && 2411 src.density >= density && 2412 // Check viewport width 2413 _self._matchMedia()('screen and (min-width:' + src.width + 'px)').matches && 2414 src.width >= width 2415 ) { 2416 width = src.width; 2417 density = src.density; 2418 url = src.url; 2419 } 2420 break; 2421 } 2422 }); 2423 2424 return url; 2425 }, 2426 2427 /** 2428 * Normalizes an url and returns information about the resource path, 2429 * the viewport width as well as density if defined. 2430 * 2431 * @param {string} url Path to resource in format of an url or srcset 2432 * @return {object} 2433 */ 2434 _normalizeUrl: function (url) { 2435 var srcExp = /^\\d+$/; 2436 2437 return url.split(',').map(function (str) { 2438 var src = { 2439 width: 0, 2440 density: 0 2441 }; 2442
2443 str.trim().split(/\\s+/).forEach(function (url, i) { 2444 if (i === 0) { 2445 return src.url = url; 2446 } 2447 2448 var value = url.substring(0, url.length - 1), 2449 lastChar = url[url.length - 1], 2450 intVal = parseInt(value, 10), 2451 floatVal = parseFloat(value); 2452 if (lastChar === 'w' && srcExp.test(value)) { 2453 src.width = intVal; 2454 } else if (lastChar === 'h' && srcExp.test(value)) { 2455 src.height = intVal; 2456 } else if (lastChar === 'x' && !isNaN(floatVal)) { 2457 src.density = floatVal; 2458 } 2459 }); 2460 2461 return src; 2462 }); 2463 }, 2464 2465 /** 2466 * Verifies if the link is part of a sequence 2467 * 2468 * @param {string} rel 2469 * @param {string} expression 2470 * @return {boolean} 2471 */ 2472 _isPartOfSequence: function (rel, expression) { 2473 var getSimilarLinks = $('[' + _self.settings.attr + '="' + rel + '"]'), 2474 regexp = new RegExp(expression); 2475 2476 return (regexp.test(rel) && getSimilarLinks.length > 1); 2477 }, 2478 2479 /** 2480 * Verifies if the slideshow should be enabled 2481 * 2482 * @return {boolean} 2483 */ 2484 isSlideshowEnabled: function () { 2485 return (_self.objectData.isPartOfSequence && (_self.settings.slideshow === true || _self.objectData.isPartOfSequenceWithSlideshow === true)); 2486 }, 2487 2488 /** 2489 * Loads the new content to show 2490 * 2491 * @return {void} 2492 */ 2493 _loadContent: function () { 2494 if (_self.cache.originalObject) { 2495 _self._restoreObject(); 2496 } 2497 2498 _self._createObject(); 2499 }, 2500 2501 /** 2502 * Creates a new object 2503 * 2504 * @return {void} 2505 */ 2506 _createObject: function () { 2507 var $object; 2508 2509 // Create object 2510 switch (_self.objectData.type) { 2511 case 'image': 2512 $object = $(new Image()); 2513 $object.attr({ 2514 // The time expression is required to prevent the binding of an image load 2515 'src': _self.objectData.url, 2516 'alt': _self.objectData.title 2517 }); 2518 break; 2519 case 'inline': 2520 $object = $('<div class="' + _self.settings.classPrefix + 'inlineWrap"></div>'); 2521 $object.html(_self._cloneObject($(_self.objectData.url))); 2522 2523 // Add custom attributes from _self.settings 2524 $.each(_self.settings.inline, function (name, value) { 2525 $object.attr(_self._prefixAttributeName(name), value); 2526 }); 2527 break; 2528 case 'ajax': 2529 $object = $('<div class="' + _self.settings.classPrefix + 'inlineWrap"></div>'); 2530 2531 // Add custom attributes from _self.settings 2532 $.each(_self.settings.ajax, function (name, value) { 2533 if (name !== 'data') { 2534 $object.attr(_self._prefixAttributeName(name), value); 2535 } 2536 }); 2537 break; 2538 case 'flash': 2539 $object = $('<embed src="' + _self.objectData.url + '" type="application/x-shockwave-flash"></embed>'); 2540 2541 // Add custom attributes from _self.settings 2542 $.each(_self.settings.flash, function (name, value) { 2543 $object.attr(name, value); 2544 }); 2545 break; 2546 case 'video': 2547 $object = $('<video></video>'); 2548 $object.attr('src', _self.objectData.url); 2549 2550 // Add custom attributes from _self.settings 2551 $.each(_self.settings.video, function (name, value) { 2552 $object.attr(name, value); 2553 }); 2554 break; 2555 default: 2556 $object = $('<iframe></iframe>'); 2557 $object.attr({ 2558 'src': _self.objectData.url 2559 }); 2560 2561 // Add custom attributes from _self.settings 2562 $.each(_self.settings.iframe, function (name, value) { 2563 $object.attr(name, value); 2564 }); 2565 break; 2566 } 2567 2568 _self._addObject($object); 2569 _self._loadObject($object); 2570 }, 2571 2572 /** 2573 * Adds the new object to the markup 2574 * 2575 * @param {object} $object 2576 * @return {void} 2577 */ 2578 _addObject: function ($object) { 2579 // Add object to content holder 2580 _self.objects.contentInner.html($object); 2581 2582 // Start loading 2583 _self._loading('start'); 2584 2585 // Call onStart hook functions 2586 _self._callHooks(_self.settings.onStart); 2587 2588 // Add sequenceInfo to the content holder or hide if its empty 2589 if (_self.settings.showSequenceInfo === true && _self.objectData.isPartOfSequence) { 2590 _self.objects.sequenceInfo.html(_self.objectData.sequenceInfo); 2591 _self.objects.sequenceInfo.show(); 2592 } else { 2593 _self.objects.sequenceInfo.empty(); 2594 _self.objects.sequenceInfo.hide(); 2595 } 2596 // Add title to the content holder or hide if its empty 2597 if (_self.settings.showTitle === true && _self.objectData.title !== undefined && _self.objectData.title !== '') { 2598 _self.objects.title.html(_self.objectData.title); 2599 _self.objects.title.show(); 2600 } else { 2601 _self.objects.title.empty(); 2602 _self.objects.title.hide(); 2603 } 2604 // Add caption to the content holder or hide if its empty 2605 if (_self.settings.showCaption === true && _self.objectData.caption !== undefined && _self.objectData.caption !== '') { 2606 _self.objects.caption.html(_self.objectData.caption); 2607 _self.objects.caption.show(); 2608 } else { 2609 _self.objects.caption.empty(); 2610 _self.objects.caption.hide(); 2611 } 2612 }, 2613 2614 /** 2615 * Loads the new object 2616 * 2617 * @param {object} $object 2618 * @return {void} 2619 */ 2620 _loadObject: function ($object) { 2621 // Load the object 2622 switch (_self.objectData.type) { 2623 case 'inline': 2624 if ($(_self.objectData.url)) { 2625 _self._showContent($object); 2626 } else { 2627 _self.error(); 2628 } 2629 break; 2630 case 'ajax': 2631 $.ajax( 2632 $.extend({}, _self.settings.ajax, { 2633 url: _self.objectData.url, 2634 type: _self.objectData.requestType, 2635 dataType: _self.objectData.requestDataType, 2636 data: _self.objectData.requestData, 2637 success: function (data, textStatus, jqXHR) { 2638 // Check for X-Ajax-Location 2639 if (jqXHR.getResponseHeader('X-Ajax-Location')) { 2640 _self.objectData.url = jqXHR.getResponseHeader('X-Ajax-Location'); 2641 _self._loadObject($object); 2642 } 2643 else { 2644 // Unserialize if data is transferred as json 2645 if (_self.objectData.requestDataType === 'json') { 2646 _self.objectData.data = data; 2647 } else { 2648 $object.html(data); 2649 } 2650 _self._showContent($object); 2651 } 2652 }, 2653 error: function (jqXHR, textStatus, errorThrown) { 2654 _self.error(); 2655 } 2656 }) 2657 ); 2658 break; 2659 case 'flash': 2660 _self._showContent($object); 2661 break; 2662 case 'video': 2663 if (typeof($object.get(0).canPlayType) === 'function' || _self.objects.case.find('video').length === 0) { 2664 _self._showContent($object); 2665 } else { 2666 _self.error(); 2667 } 2668 break; 2669 default: 2670 if (_self.objectData.url) { 2671 $object.on('load', function () { 2672 _self._showContent($object); 2673 }); 2674 $object.on('error', function () { 2675 _self.error(); 2676 }); 2677 } else { 2678 _self.error(); 2679 } 2680 break; 2681 } 2682 }, 2683 2684 /** 2685 * Throws an error message if something went wrong 2686 * 2687 * @return {void} 2688 */ 2689 error: function () { 2690 _self.objectData.type = 'error'; 2691 var $object = $('<div class="' + _self.settings.classPrefix + 'inlineWrap"></div>'); 2692 2693 $object.html(_self.settings.errorMessage); 2694 _self.objects.contentInner.html($object); 2695 2696 _self._showContent(_self.objects.contentInner); 2697 }, 2698 2699 /** 2700 * Calculates the dimensions to fit content 2701 * 2702 * @param {object} $object 2703 * @return {void} 2704 */ 2705 _calculateDimensions: function ($object) { 2706 _self._cleanupDimensions(); 2707 2708 if (!$object) return; 2709 2710 // Set default dimensions 2711 var dimensions = { 2712 ratio: 1, 2713 objectWidth: $object.attr('width') ? $object.attr('width') : $object.attr(_self._prefixAttributeName('width')), 2714 objectHeight: $object.attr('height') ? $object.attr('height') : $object.attr(_self._prefixAttributeName('height')) 2715 }; 2716 2717 if (!_self.settings.disableShrink) { 2718 // Add calculated maximum width/height to dimensions 2719 dimensions.maxWidth = parseInt(_self.dimensions.windowWidth * _self.settings.shrinkFactor); 2720 dimensions.maxHeight = parseInt(_self.dimensions.windowHeight * _self.settings.shrinkFactor); 2721 2722 // If the auto calculated maxWidth/maxHeight greather than the user-defined one, use that. 2723 if (dimensions.maxWidth > _self.settings.maxWidth) { 2724 dimensions.maxWidth = _self.settings.maxWidth; 2725 } 2726 if (dimensions.maxHeight > _self.settings.maxHeight) { 2727 dimensions.maxHeight = _self.settings.maxHeight; 2728 } 2729 2730 // Calculate the difference between screen width/height and image width/height 2731 dimensions.differenceWidthAsPercent = parseInt(100 / dimensions.maxWidth * dimensions.objectWidth); 2732 dimensions.differenceHeightAsPercent = parseInt(100 / dimensions.maxHeight * dimensions.objectHeight); 2733 2734 switch (_self.objectData.type) { 2735 case 'image': 2736 case 'flash': 2737 case 'video': 2738 case 'iframe': 2739 case 'ajax': 2740 case 'inline': 2741 if (_self.objectData.type === 'image' || _self.settings.fixedRatio === true) { 2742 if (dimensions.differenceWidthAsPercent > 100 && dimensions.differenceWidthAsPercent > dimensions.differenceHeightAsPercent) { 2743 dimensions.objectWidth = dimensions.maxWidth; 2744 dimensions.objectHeight = parseInt(dimensions.objectHeight / dimensions.differenceWidthAsPercent * 100); 2745 } 2746 if (dimensions.differenceHeightAsPercent > 100 && dimensions.differenceHeightAsPercent > dimensions.differenceWidthAsPercent) { 2747 dimensions.objectWidth = parseInt(dimensions.objectWidth / dimensions.differenceHeightAsPercent * 100); 2748 dimensions.objectHeight = dimensions.maxHeight; 2749 } 2750 if (dimensions.differenceHeightAsPercent > 100 && dimensions.differenceWidthAsPercent < dimensions.differenceHeightAsPercent) { 2751 dimensions.objectWidth = parseInt(dimensions.maxWidth / dimensions.differenceHeightAsPercent * dimensions.differenceWidthAsPercent); 2752 dimensions.objectHeight = dimensions.maxHeight; 2753 } 2754 break; 2755 } 2756 case 'error': 2757 if (!isNaN(dimensions.objectWidth) && dimensions.objectWidth > dimensions.maxWidth) { 2758 dimensions.objectWidth = dimensions.maxWidth; 2759 } 2760 break; 2761 default: 2762 if ((isNaN(dimensions.objectWidth) || dimensions.objectWidth > dimensions.maxWidth) && !_self.settings.forceWidth) { 2763 dimensions.objectWidth = dimensions.maxWidth; 2764 } 2765 if (((isNaN(dimensions.objectHeight) && dimensions.objectHeight !== 'auto') || dimensions.objectHeight > dimensions.maxHeight) && !_self.settings.forceHeight) { 2766 dimensions.objectHeight = dimensions.maxHeight; 2767 } 2768 break; 2769 } 2770 } 2771 2772 if (_self.settings.forceWidth) { 2773 try { 2774 dimensions.objectWidth = _self.settings[_self.objectData.type].width; 2775 } catch (e) { 2776 dimensions.objectWidth = _self.settings.width || dimensions.objectWidth; 2777 } 2778 2779 dimensions.maxWidth = null; 2780 } 2781 if ($object.attr(_self._prefixAttributeName('max-width'))) { 2782 dimensions.maxWidth = $object.attr(_self._prefixAttributeName('max-width')); 2783 } 2784 2785 if (_self.settings.forceHeight) { 2786 try { 2787 dimensions.objectHeight = _self.settings[_self.objectData.type].height; 2788 } catch (e) { 2789 dimensions.objectHeight = _self.settings.height || dimensions.objectHeight; 2790 } 2791 2792 dimensions.maxHeight = null; 2793 } 2794 if ($object.attr(_self._prefixAttributeName('max-height'))) { 2795 dimensions.maxHeight = $object.attr(_self._prefixAttributeName('max-height')); 2796 } 2797 _self._adjustDimensions($object, dimensions); 2798 }, 2799 2800 /** 2801 * Adjusts the dimensions 2802 * 2803 * @param {object} $object 2804 * @param {object} dimensions 2805 * @return {void} 2806 */
2807 _adjustDimensions: function ($object, dimensions) { 2808 // Adjust width and height 2809 $object.css({ 2810 'width': dimensions.objectWidth, 2811 'height': dimensions.objectHeight, 2812 'max-width': dimensions.maxWidth, 2813 'max-height': dimensions.maxHeight 2814 }); 2815 2816 _self.objects.contentInner.css({ 2817 'width': $object.outerWidth(), 2818 'height': $object.outerHeight(), 2819 'max-width': '100%' 2820 }); 2821 2822 _self.objects.case.css({ 2823 'width': _self.objects.contentInner.outerWidth(), 2824 'max-width': '100%' 2825 }); 2826 2827 // Adjust margin 2828 _self.objects.case.css({ 2829 'margin-top': parseInt(-(_self.objects.case.outerHeight() / 2)), 2830 'margin-left': parseInt(-(_self.objects.case.outerWidth() / 2)) 2831 }); 2832 }, 2833 2834 /** 2835 * Handles the _loading 2836 * 2837 * @param {string} process 2838 * @return {void} 2839 */ 2840 _loading: function (process) { 2841 if (process === 'start') { 2842 _self.objects.case.addClass(_self.settings.classPrefix + 'loading'); 2843 _self.objects.loading.show(); 2844 } else if (process === 'end') { 2845 _self.objects.case.removeClass(_self.settings.classPrefix + 'loading'); 2846 _self.objects.loading.hide(); 2847 } 2848 }, 2849 2850 2851 /** 2852 * Gets the client screen dimensions 2853 * 2854 * @return {object} dimensions 2855 */ 2856 getViewportDimensions: function () { 2857 return { 2858 windowWidth: $(window).innerWidth(), 2859 windowHeight: $(window).innerHeight() 2860 }; 2861 }, 2862 2863 /** 2864 * Verifies the url 2865 * 2866 * @param {string} dataUrl 2867 * @return {object} dataUrl Clean url for processing content 2868 */ 2869 _verifyDataUrl: function (dataUrl) { 2870 if (!dataUrl || dataUrl === undefined || dataUrl === '') { 2871 return false; 2872 } 2873 2874 if (dataUrl.indexOf('#') > -1) { 2875 dataUrl = dataUrl.split('#'); 2876 dataUrl = '#' + dataUrl[dataUrl.length - 1]; 2877 } 2878 2879 return _self._normalizeUrl(dataUrl.toString()); 2880 }, 2881 2882 // 2883 /** 2884 * Tries to get the (file) suffix of an url 2885 * 2886 * @param {string} url 2887 * @return {string} 2888 */ 2889 _getFileUrlSuffix: function (url) { 2890 var re = /(?:\\.([^.]+))?$/; 2891 return re.exec(url.toLowerCase())[1]; 2892 }, 2893 2894 /** 2895 * Verifies the data type of the content to load 2896 * 2897 * @param {string} url 2898 * @return {string|boolean} Array key if expression matched, else false 2899 */ 2900 _verifyDataType: function (url) { 2901 var typeMapping = _self.settings.typeMapping; 2902 2903 // Early abort if dataUrl couldn't be verified 2904 if (!url) { 2905 return false; 2906 } 2907 2908 // Verify the dataType of url according to typeMapping which 2909 // has been defined in settings. 2910 for (var key in typeMapping) { 2911 if (typeMapping.hasOwnProperty(key)) { 2912 var suffixArr = typeMapping[key].split(','); 2913 2914 for (var i = 0; i < suffixArr.length; i++) { 2915 var suffix = suffixArr[i].toLowerCase(), 2916 regexp = new RegExp('\\.(' + suffix + ')$', 'i'), 2917 str = url.toLowerCase().split('?')[0].substr(-5); 2918 2919 if (regexp.test(str) === true || (key === 'inline' && (url.indexOf(suffix) > -1))) { 2920 return key; 2921 } 2922 } 2923 } 2924 } 2925 2926 // If no expression matched, return 'iframe'. 2927 return 'iframe'; 2928 }, 2929 2930 /** 2931 * Extends html markup with the essential tags 2932 * 2933 * @return {void} 2934 */ 2935 _addElements: function () { 2936 if (typeof _self.objects.case !== 'undefined' && $('#' + _self.objects.case.attr('id')).length) { 2937 return; 2938 } 2939 2940 _self.settings.markup(); 2941 }, 2942 2943 /** 2944 * Shows the loaded content 2945 * 2946 * @param {object} $object 2947 * @return {void} 2948 */ 2949 _showContent: function ($object) { 2950 // Add data attribute with the object type 2951 _self.objects.document.attr(_self._prefixAttributeName('type'), _self.objectData.type); 2952 2953 _self.cache.object = $object; 2954 2955 // Call onBeforeShow hook functions 2956 _self._callHooks(_self.settings.onBeforeShow); 2957 2958 if (_self.settings.breakBeforeShow) return; 2959 _self.show(); 2960 }, 2961 2962 /** 2963 * Starts the 'inTransition' 2964 * @return {void} 2965 */ 2966 _startInTransition: function () { 2967 switch (_self.transition.in()) { 2968 case 'scrollTop': 2969 case 'scrollRight': 2970 case 'scrollBottom': 2971 case 'scrollLeft': 2972 case 'scrollHorizontal': 2973 case 'scrollVertical': 2974 _self.transition.scroll(_self.objects.case, 'in', _self.settings.speedIn); 2975 _self.transition.fade(_self.objects.contentInner, 'in', _self.settings.speedIn); 2976 break; 2977 case 'elastic': 2978 if (_self.objects.case.css('opacity') < 1) { 2979 _self.transition.zoom(_self.objects.case, 'in', _self.settings.speedIn); 2980 _self.transition.fade(_self.objects.contentInner, 'in', _self.settings.speedIn); 2981 } 2982 case 'fade': 2983 case 'fadeInline': 2984 _self.transition.fade(_self.objects.case, 'in', _self.settings.speedIn); 2985 _self.transition.fade(_self.objects.contentInner, 'in', _self.settings.speedIn); 2986 break; 2987 default: 2988 _self.transition.fade(_self.objects.case, 'in', 0); 2989 break; 2990 } 2991 2992 // End loading. 2993 _self._loading('end'); 2994 _self.isBusy = false;
2995 2996 // Set index of the first item opened 2997 if (!_self.cache.firstOpened) { 2998 _self.cache.firstOpened = _self.objectData.this; 2999 } 3000 3001 // Fade in the info with delay 3002 _self.objects.info.hide(); 3003 setTimeout(function () { 3004 _self.transition.fade(_self.objects.info, 'in', _self.settings.speedIn); 3005 }, _self.settings.speedIn); 3006 3007 // Call onFinish hook functions 3008 _self._callHooks(_self.settings.onFinish); 3009 }, 3010 3011 /** 3012 * Processes the content to show 3013 * 3014 * @return {void} 3015 */ 3016 _processContent: function () { 3017 _self.isBusy = true; 3018 3019 // Fade out the info at first 3020 _self.transition.fade(_self.objects.info, 'out', 0); 3021 3022 switch (_self.settings.transitionOut) { 3023 case 'scrollTop': 3024 case 'scrollRight': 3025 case 'scrollBottom': 3026 case 'scrollLeft': 3027 case 'scrollVertical': 3028 case 'scrollHorizontal': 3029 if (_self.objects.case.is(':hidden')) { 3030 _self.transition.fade(_self.objects.contentInner, 'out', 0); 3031 _self.transition.fade(_self.objects.case, 'out', 0, 0, function () { 3032 _self._loadContent(); 3033 }); 3034 } else { 3035 _self.transition.scroll(_self.objects.case, 'out', _self.settings.speedOut, function () { 3036 _self._loadContent(); 3037 }); 3038 } 3039 break; 3040 case 'fade': 3041 if (_self.objects.case.is(':hidden')) { 3042 _self.transition.fade(_self.objects.case, 'out', 0, 0, function () { 3043 _self._loadContent(); 3044 }); 3045 } else { 3046 _self.transition.fade(_self.objects.case, 'out', _self.settings.speedOut, 0, function () { 3047 _self._loadContent(); 3048 }); 3049 } 3050 break; 3051 case 'fadeInline': 3052 case 'elastic': 3053 if (_self.objects.case.is(':hidden')) { 3054 _self.transition.fade(_self.objects.case, 'out', 0, 0, function () { 3055 _self._loadContent(); 3056 }); 3057 } else { 3058 _self.transition.fade(_self.objects.contentInner, 'out', _self.settings.speedOut, 0, function () { 3059 _self._loadContent(); 3060 }); 3061 } 3062 break; 3063 default: 3064 _self.transition.fade(_self.objects.case, 'out', 0, 0, function () { 3065 _self._loadContent(); 3066 }); 3067 break; 3068 } 3069 }, 3070 3071 /** 3072 * Handles events for gallery buttons 3073 * 3074 * @return {void} 3075 */ 3076 _handleEvents: function () { 3077 _self._unbindEvents(); 3078 3079 _self.objects.nav.children().not(_self.objects.close).hide(); 3080 3081 // If slideshow is enabled, show play/pause and start timeout. 3082 if (_self.isSlideshowEnabled()) { 3083 // Only start the timeout if slideshow autostart is enabled and slideshow is not pausing 3084 if ( 3085 (_self.settings.slideshowAutoStart === true || _self.isSlideshowStarted) && 3086 !_self.objects.nav.hasClass(_self.settings.classPrefix + 'paused') 3087 ) { 3088 _self._startTimeout(); 3089 } else { 3090 _self._stopTimeout(); 3091 } 3092 } 3093 3094 if (_self.settings.liveResize) { 3095 _self._watchResizeInteraction(); 3096 } 3097 3098 _self.objects.close.click(function (event) { 3099 event.preventDefault(); 3100 _self.close(); 3101 }); 3102 3103 if (_self.settings.closeOnOverlayClick === true) { 3104 _self.objects.overlay.css('cursor', 'pointer').click(function (event) { 3105 event.preventDefault(); 3106 3107 _self.close(); 3108 }); 3109 } 3110 3111 if (_self.settings.useKeys === true) { 3112 _self._addKeyEvents(); 3113 } 3114 3115 if (_self.objectData.isPartOfSequence) { 3116 _self.objects.nav.attr(_self._prefixAttributeName('ispartofsequence'), true); 3117 _self.objects.nav.data('items', _self._setNavigation()); 3118 3119 _self.objects.prev.click(function (event) { 3120 event.preventDefault(); 3121 3122 if (_self.settings.navigateEndless === true || !_self.item.isFirst()) { 3123 _self.objects.prev.unbind('click'); 3124 _self.cache.action = 'prev'; 3125 _self.objects.nav.data('items').prev.click(); 3126 3127 if (_self.isSlideshowEnabled()) { 3128 _self._stopTimeout(); 3129 } 3130 } 3131 }); 3132 3133 _self.objects.next.click(function (event) { 3134 event.preventDefault(); 3135 3136 if (_self.settings.navigateEndless === true || !_self.item.isLast()) { 3137 _self.objects.next.unbind('click'); 3138 _self.cache.action = 'next'; 3139 _self.objects.nav.data('items').next.click(); 3140 3141 if (_self.isSlideshowEnabled()) { 3142 _self._stopTimeout(); 3143 } 3144 } 3145 }); 3146 3147 if (_self.isSlideshowEnabled()) { 3148 _self.objects.play.click(function (event) { 3149 event.preventDefault(); 3150 _self._startTimeout(); 3151 }); 3152 _self.objects.pause.click(function (event) { 3153 event.preventDefault(); 3154 _self._stopTimeout(); 3155 }); 3156 } 3157 3158 // Enable swiping if activated 3159 if (_self.settings.swipe === true) { 3160 if ($.isPlainObject($.event.special.swipeleft)) { 3161 _self.objects.case.on('swipeleft', function (event) { 3162 event.preventDefault(); 3163 _self.objects.next.click(); 3164 if (_self.isSlideshowEnabled()) { 3165 _self._stopTimeout(); 3166 } 3167 }); 3168 } 3169 if ($.isPlainObject($.event.special.swiperight)) { 3170 _self.objects.case.on('swiperight', function (event) { 3171 event.preventDefault(); 3172 _self.objects.prev.click(); 3173 if (_self.isSlideshowEnabled()) { 3174 _self._stopTimeout(); 3175 } 3176 }); 3177 } 3178 } 3179 } 3180 }, 3181 3182 /** 3183 * Adds the key events 3184 * 3185 * @return {void} 3186 */ 3187 _addKeyEvents: function () { 3188 $(document).bind('keyup.lightcase', function (event) {
3189 // Do nothing if lightcase is in process 3190 if (_self.isBusy) { 3191 return; 3192 } 3193 3194 switch (event.keyCode) { 3195 // Escape key 3196 case 27: 3197 _self.objects.close.click(); 3198 break; 3199 // Backward key 3200 case 37: 3201 if (_self.objectData.isPartOfSequence) { 3202 _self.objects.prev.click(); 3203 } 3204 break; 3205 // Forward key 3206 case 39: 3207 if (_self.objectData.isPartOfSequence) { 3208 _self.objects.next.click(); 3209 } 3210 break; 3211 } 3212 }); 3213 }, 3214 3215 /** 3216 * Starts the slideshow timeout 3217 * 3218 * @return {void} 3219 */ 3220 _startTimeout: function () { 3221 _self.isSlideshowStarted = true; 3222 3223 _self.objects.play.hide(); 3224 _self.objects.pause.show(); 3225 3226 _self.cache.action = 'next'; 3227 _self.objects.nav.removeClass(_self.settings.classPrefix + 'paused'); 3228 3229 _self.timeout = setTimeout(function () { 3230 _self.objects.nav.data('items').next.click(); 3231 }, _self.settings.timeout); 3232 }, 3233 3234 /** 3235 * Stops the slideshow timeout 3236 * 3237 * @return {void} 3238 */ 3239 _stopTimeout: function () { 3240 _self.objects.play.show(); 3241 _self.objects.pause.hide(); 3242 3243 _self.objects.nav.addClass(_self.settings.classPrefix + 'paused'); 3244 3245 clearTimeout(_self.timeout); 3246 }, 3247 3248 /** 3249 * Sets the navigator buttons (prev/next) 3250 * 3251 * @return {object} items 3252 */ 3253 _setNavigation: function () { 3254 var $links = $((_self.cache.selector || _self.settings.attr)), 3255 sequenceLength = _self.objectData.sequenceLength - 1, 3256 items = { 3257 prev: $links.eq(_self.objectData.prevIndex), 3258 next: $links.eq(_self.objectData.nextIndex) 3259 }; 3260 3261 if (_self.objectData.currentIndex > 0) { 3262 _self.objects.prev.show(); 3263 } else { 3264 items.prevItem = $links.eq(sequenceLength); 3265 } 3266 if (_self.objectData.nextIndex <= sequenceLength) { 3267 _self.objects.next.show(); 3268 } else { 3269 items.next = $links.eq(0); 3270 } 3271 3272 if (_self.settings.navigateEndless === true) { 3273 _self.objects.prev.show(); 3274 _self.objects.next.show(); 3275 } 3276 3277 return items; 3278 }, 3279 3280 /** 3281 * Item information/status 3282 * 3283 */ 3284 item: { 3285 /** 3286 * Verifies if the current item is first item. 3287 * 3288 * @return {boolean} 3289 */ 3290 isFirst: function () { 3291 return (_self.objectData.currentIndex === 0); 3292 }, 3293 3294 /** 3295 * Verifies if the current item is first item opened. 3296 * 3297 * @return {boolean} 3298 */ 3299 isFirstOpened: function () { 3300 return _self.objectData.this.is(_self.cache.firstOpened); 3301 }, 3302 3303 /** 3304 * Verifies if the current item is last item. 3305 * 3306 * @return {boolean} 3307 */ 3308 isLast: function () { 3309 return (_self.objectData.currentIndex === (_self.objectData.sequenceLength - 1)); 3310 } 3311 }, 3312 3313 /** 3314 * Clones the object for inline elements 3315 * 3316 * @param {object} $object 3317 * @return {object} $clone 3318 */ 3319 _cloneObject: function ($object) { 3320 var $clone = $object.clone(), 3321 objectId = $object.attr('id'); 3322 3323 // If element is hidden, cache the object and remove 3324 if ($object.is(':hidden')) { 3325 _self._cacheObjectData($object); 3326 $object.attr('id', _self.settings.idPrefix + 'temp-' + objectId).empty(); 3327 } else { 3328 // Prevent duplicated id's 3329 $clone.removeAttr('id'); 3330 } 3331 3332 return $clone.show(); 3333 }, 3334 3335 /** 3336 * Verifies if it is a mobile device 3337 * 3338 * @return {boolean} 3339 */ 3340 isMobileDevice: function () { 3341 var deviceAgent = navigator.userAgent.toLowerCase(), 3342 agentId = deviceAgent.match(_self.settings.mobileMatchExpression); 3343 3344 return agentId ? true : false; 3345 }, 3346 3347 /** 3348 * Verifies if css transitions are supported 3349 * 3350 * @return {string|boolean} The transition prefix if supported, else false. 3351 */ 3352 isTransitionSupported: function () { 3353 var body = _self.objects.body.get(0), 3354 isTransitionSupported = false, 3355 transitionMapping = { 3356 'transition': '', 3357 'WebkitTransition': '-webkit-', 3358 'MozTransition': '-moz-', 3359 'OTransition': '-o-', 3360 'MsTransition': '-ms-' 3361 }; 3362 3363 for (var key in transitionMapping) { 3364 if (transitionMapping.hasOwnProperty(key) && key in body.style) { 3365 _self.support.transition = transitionMapping[key]; 3366 isTransitionSupported = true; 3367 } 3368 } 3369 3370 return isTransitionSupported; 3371 }, 3372 3373 /** 3374 * Transition types 3375 * 3376 */ 3377 transition: { 3378 /** 3379 * Returns the correct transition type according to the status of interaction. 3380 * 3381 * @return {string} Transition type 3382 */ 3383 in: function () { 3384 if (_self.settings.transitionOpen && !_self.cache.firstOpened) { 3385 return _self.settings.transitionOpen; 3386 } 3387 return _self.settings.transitionIn; 3388 }, 3389 3390 /** 3391 * Fades in/out the object 3392 * 3393 * @param {object} $object 3394 * @param {string} type 3395 * @param {number} speed 3396 * @param {number} opacity 3397 * @param {function} callback 3398 * @return {void} Animates an object 3399 */ 3400 fade: function ($object, type, speed, opacity, callback) { 3401 var isInTransition = type === 'in', 3402 startTransition = {}, 3403 startOpacity = $object.css('opacity'), 3404 endTransition = {}, 3405 endOpacity = opacity ? opacity: isInTransition ? 1 : 0; 3406 3407 if (!_self.isOpen && isInTransition) return; 3408 3409 startTransition['opacity'] = startOpacity; 3410 endTransition['opacity'] = endOpacity; 3411 3412 $object.css(_self.support.transition + 'transition', 'none'); 3413 $object.css(startTransition).show(); 3414 3415 // Css transition 3416 if (_self.support.transitions) { 3417 endTransition[_self.support.transition + 'transition'] = speed + 'ms ease'; 3418 3419 setTimeout(function () { 3420 $object.css(endTransition); 3421 3422 setTimeout(function () { 3423 $object.css(_self.support.transition + 'transition', ''); 3424 3425 if (callback && (_self.isOpen || !isInTransition)) { 3426 callback(); 3427 } 3428 }, speed); 3429 }, 15); 3430 } else { 3431 // Fallback to js transition 3432 $object.stop(); 3433 $object.animate(endTransition, speed, callback); 3434 } 3435 }, 3436 3437 /** 3438 * Scrolls in/out the object 3439 * 3440 * @param {object} $object 3441 * @param {string} type 3442 * @param {number} speed 3443 * @param {function} callback 3444 * @return {void} Animates an object 3445 */ 3446 scroll: function ($object, type, speed, callback) { 3447 var isInTransition = type === 'in', 3448 transition = isInTransition ? _self.settings.transitionIn : _self.settings.transitionOut, 3449 direction = 'left', 3450 startTransition = {}, 3451 startOpacity = isInTransition ? 0 : 1, 3452 startOffset = isInTransition ? '-50%' : '50%', 3453 endTransition = {}, 3454 endOpacity = isInTransition ? 1 : 0, 3455 endOffset = isInTransition ? '50%' : '-50%'; 3456 3457 if (!_self.isOpen && isInTransition) return; 3458 3459 switch (transition) { 3460 case 'scrollTop': 3461 direction = 'top'; 3462 break; 3463 case 'scrollRight': 3464 startOffset = isInTransition ? '150%' : '50%'; 3465 endOffset = isInTransition ? '50%' : '150%'; 3466 break; 3467 case 'scrollBottom': 3468 direction = 'top'; 3469 startOffset = isInTransition ? '150%' : '50%'; 3470 endOffset = isInTransition ? '50%' : '150%'; 3471 break; 3472 case 'scrollHorizontal': 3473 startOffset = isInTransition ? '150%' : '50%'; 3474 endOffset = isInTransition ? '50%' : '-50%'; 3475 break; 3476 case 'scrollVertical': 3477 direction = 'top'; 3478 startOffset = isInTransition ? '-50%' : '50%'; 3479 endOffset = isInTransition ? '50%' : '150%'; 3480 break; 3481 } 3482 3483 if (_self.cache.action === 'prev') { 3484 switch (transition) { 3485 case 'scrollHorizontal': 3486 startOffset = isInTransition ? '-50%' : '50%'; 3487 endOffset = isInTransition ? '50%' : '150%'; 3488 break; 3489 case 'scrollVertical': 3490 startOffset = isInTransition ? '150%' : '50%'; 3491 endOffset = isInTransition ? '50%' : '-50%'; 3492 break; 3493 } 3494 } 3495 3496 startTransition['opacity'] = startOpacity; 3497 startTransition[direction] = startOffset; 3498 3499 endTransition['opacity'] = endOpacity; 3500 endTransition[direction] = endOffset; 3501 3502 $object.css(_self.support.transition + 'transition', 'none'); 3503 $object.css(startTransition).show(); 3504 3505 // Css transition 3506 if (_self.support.transitions) { 3507 endTransition[_self.support.transition + 'transition'] = speed + 'ms ease'; 3508 3509 setTimeout(function () { 3510 $object.css(endTransition); 3511 3512 setTimeout(function () { 3513 $object.css(_self.support.transition + 'transition', ''); 3514 3515 if (callback && (_self.isOpen || !isInTransition)) { 3516 callback(); 3517 } 3518 }, speed); 3519 }, 15); 3520 } else { 3521 // Fallback to js transition 3522 $object.stop(); 3523 $object.animate(endTransition, speed, callback); 3524 } 3525 }, 3526 3527 /** 3528 * Zooms in/out the object 3529 * 3530 * @param {object} $object 3531 * @param {string} type 3532 * @param {number} speed 3533 * @param {function} callback 3534 * @return {void} Animates an object 3535 */ 3536 zoom: function ($object, type, speed, callback) { 3537 var isInTransition = type === 'in', 3538 startTransition = {}, 3539 startOpacity = $object.css('opacity'), 3540 startScale = isInTransition ? 'scale(0.75)' : 'scale(1)', 3541 endTransition = {}, 3542 endOpacity = isInTransition ? 1 : 0, 3543 endScale = isInTransition ? 'scale(1)' : 'scale(0.75)'; 3544 3545 if (!_self.isOpen && isInTransition) return; 3546 3547 startTransition['opacity'] = startOpacity; 3548 startTransition[_self.support.transition + 'transform'] = startScale; 3549 3550 endTransition['opacity'] = endOpacity; 3551 3552 $object.css(_self.support.transition + 'transition', 'none'); 3553 $object.css(startTransition).show(); 3554 3555 // Css transition 3556 if (_self.support.transitions) { 3557 endTransition[_self.support.transition + 'transform'] = endScale; 3558 endTransition[_self.support.transition + 'transition'] = speed + 'ms ease'; 3559 3560 setTimeout(function () { 3561 $object.css(endTransition); 3562 3563 setTimeout(function () { 3564 $object.css(_self.support.transition + 'transform', ''); 3565 $object.css(_self.support.transition + 'transition', ''); 3566 3567 if (callback && (_self.isOpen || !isInTransition)) { 3568 callback(); 3569 } 3570 }, speed); 3571 }, 15); 3572 } else { 3573 // Fallback to js transition 3574 $object.stop(); 3575 $object.animate(endTransition, speed, callback); 3576 } 3577 } 3578 }, 3579 3580 /** 3581 * Calls all the registered functions of a specific hook 3582 * 3583 * @param {object} hooks 3584 * @return {void} 3585 */ 3586 _callHooks: function (hooks) { 3587 if (typeof(hooks) === 'object') { 3588 $.each(hooks, function(index, hook) { 3589 if (typeof(hook) === 'function') { 3590 hook.call(_self.origin); 3591 } 3592 }); 3593 } 3594 }, 3595 3596 /** 3597 * Caches the object data 3598 * 3599 * @param {object} $object 3600 * @return {void} 3601 */ 3602 _cacheObjectData: function ($object) { 3603 $.data($object, 'cache', { 3604 id: $object.attr('id'), 3605 content: $object.html() 3606 }); 3607 3608 _self.cache.originalObject = $object; 3609 }, 3610 3611 /** 3612 * Restores the object from cache 3613 * 3614 * @return void 3615 */ 3616 _restoreObject: function () { 3617 var $object = $('[id^="' + _self.settings.idPrefix + 'temp-"]'); 3618 3619 $object.attr('id', $.data(_self.cache.originalObject, 'cache').id); 3620 $object.html($.data(_self.cache.originalObject, 'cache').content); 3621 }, 3622 3623 /** 3624 * Executes functions for a window resize. 3625 * It stops an eventual timeout and recalculates dimensions. 3626 * 3627 * @param {object} dimensions 3628 * @return {void} 3629 */ 3630 resize: function (event, dimensions) { 3631 if (!_self.isOpen) return; 3632 3633 if (_self.isSlideshowEnabled()) { 3634 _self._stopTimeout(); 3635 } 3636 3637 if (typeof dimensions === 'object' && dimensions !== null) { 3638 if (dimensions.width) { 3639 _self.cache.object.attr( 3640 _self._prefixAttributeName('width'), 3641 dimensions.width 3642 ); 3643 } 3644 if (dimensions.maxWidth) { 3645 _self.cache.object.attr( 3646 _self._prefixAttributeName('max-width'), 3647 dimensions.maxWidth 3648 ); 3649 } 3650 if (dimensions.height) { 3651 _self.cache.object.attr( 3652 _self._prefixAttributeName('height'), 3653 dimensions.height 3654 ); 3655 } 3656 if (dimensions.maxHeight) { 3657 _self.cache.object.attr( 3658 _self._prefixAttributeName('max-height'), 3659 dimensions.maxHeight 3660 ); 3661 } 3662 } 3663 3664 _self.dimensions = _self.getViewportDimensions(); 3665 _self._calculateDimensions(_self.cache.object); 3666 3667 // Call onResize hook functions 3668 _self._callHooks(_self.settings.onResize); 3669 }, 3670 3671 /** 3672 * Watches for any resize interaction and caches the new sizes. 3673 * 3674 * @return {void} 3675 */ 3676 _watchResizeInteraction: function () { 3677 $(window).resize(_self.resize); 3678 }, 3679 3680 /** 3681 * Stop watching any resize interaction related to _self. 3682 * 3683 * @return {void} 3684 */ 3685 _unwatchResizeInteraction: function () { 3686 $(window).off('resize', _self.resize); 3687 }, 3688 3689 /** 3690 * Switches to the fullscreen mode 3691 * 3692 * @return {void} 3693 */ 3694 _switchToFullScreenMode: function () { 3695 _self.settings.shrinkFactor = 1; 3696 _self.settings.overlayOpacity = 1; 3697 3698 $('html').addClass(_self.settings.classPrefix + 'fullScreenMode'); 3699 }, 3700 3701 /** 3702 * Enters into the lightcase view 3703 * 3704 * @return {void} 3705 */ 3706 _open: function () { 3707 _self.isOpen = true; 3708 3709 _self.support.transitions = _self.settings.cssTransitions ? _self.isTransitionSupported() : false;
3710 _self.support.mobileDevice = _self.isMobileDevice(); 3711 3712 if (_self.support.mobileDevice) { 3713 $('html').addClass(_self.settings.classPrefix + 'isMobileDevice'); 3714 3715 if (_self.settings.fullScreenModeForMobile) { 3716 _self._switchToFullScreenMode(); 3717 } 3718 } 3719 3720 if (!_self.settings.transitionIn) { 3721 _self.settings.transitionIn = _self.settings.transition; 3722 } 3723 if (!_self.settings.transitionOut) { 3724 _self.settings.transitionOut = _self.settings.transition; 3725 } 3726 3727 switch (_self.transition.in()) { 3728 case 'fade': 3729 case 'fadeInline': 3730 case 'elastic': 3731 case 'scrollTop': 3732 case 'scrollRight': 3733 case 'scrollBottom': 3734 case 'scrollLeft': 3735 case 'scrollVertical': 3736 case 'scrollHorizontal': 3737 if (_self.objects.case.is(':hidden')) { 3738 _self.objects.close.css('opacity', 0); 3739 _self.objects.overlay.css('opacity', 0); 3740 _self.objects.case.css('opacity', 0); 3741 _self.objects.contentInner.css('opacity', 0); 3742 } 3743 _self.transition.fade(_self.objects.overlay, 'in', _self.settings.speedIn, _self.settings.overlayOpacity, function () { 3744 _self.transition.fade(_self.objects.close, 'in', _self.settings.speedIn); 3745 _self._handleEvents(); 3746 _self._processContent(); 3747 }); 3748 break; 3749 default: 3750 _self.transition.fade(_self.objects.overlay, 'in', 0, _self.settings.overlayOpacity, function () { 3751 _self.transition.fade(_self.objects.close, 'in', 0); 3752 _self._handleEvents(); 3753 _self._processContent(); 3754 }); 3755 break; 3756 } 3757 3758 _self.objects.document.addClass(_self.settings.classPrefix + 'open'); 3759 _self.objects.case.attr('aria-hidden', 'false'); 3760 }, 3761 3762 /** 3763 * Shows the lightcase by starting the transition 3764 */ 3765 show: function () { 3766 // Call onCalculateDimensions hook functions 3767 _self._callHooks(_self.settings.onBeforeCalculateDimensions); 3768 3769 _self._calculateDimensions(_self.cache.object); 3770 3771 // Call onAfterCalculateDimensions hook functions 3772 _self._callHooks(_self.settings.onAfterCalculateDimensions); 3773 3774 _self._startInTransition(); 3775 }, 3776 3777 /** 3778 * Escapes from the lightcase view 3779 * 3780 * @return {void} 3781 */ 3782 close: function () { 3783 _self.isOpen = false; 3784 3785 if (_self.isSlideshowEnabled()) { 3786 _self._stopTimeout(); 3787 _self.isSlideshowStarted = false; 3788 _self.objects.nav.removeClass(_self.settings.classPrefix + 'paused'); 3789 } 3790 3791 _self.objects.loading.hide(); 3792 3793 _self._unbindEvents(); 3794 3795 _self._unwatchResizeInteraction(); 3796 3797 $('html').removeClass(_self.settings.classPrefix + 'open'); 3798 _self.objects.case.attr('aria-hidden', 'true'); 3799 3800 _self.objects.nav.children().hide(); 3801 _self.objects.close.hide(); 3802 3803 // Call onClose hook functions 3804 _self._callHooks(_self.settings.onClose); 3805 3806 // Fade out the info at first 3807 _self.transition.fade(_self.objects.info, 'out', 0); 3808 3809 switch (_self.settings.transitionClose || _self.settings.transitionOut) { 3810 case 'fade': 3811 case 'fadeInline': 3812 case 'scrollTop': 3813 case 'scrollRight': 3814 case 'scrollBottom': 3815 case 'scrollLeft': 3816 case 'scrollHorizontal': 3817 case 'scrollVertical': 3818 _self.transition.fade(_self.objects.case, 'out', _self.settings.speedOut, 0, function () { 3819 _self.transition.fade(_self.objects.overlay, 'out', _self.settings.speedOut, 0, function () { 3820 _self.cleanup(); 3821 }); 3822 }); 3823 break; 3824 case 'elastic': 3825 _self.transition.zoom(_self.objects.case, 'out', _self.settings.speedOut, function () { 3826 _self.transition.fade(_self.objects.overlay, 'out', _self.settings.speedOut, 0, function () { 3827 _self.cleanup(); 3828 }); 3829 }); 3830 break; 3831 default: 3832 _self.cleanup(); 3833 break; 3834 } 3835 }, 3836 3837 /** 3838 * Unbinds all given events 3839 * 3840 * @return {void} 3841 */ 3842 _unbindEvents: function () { 3843 // Unbind overlay event 3844 _self.objects.overlay.unbind('click'); 3845 3846 // Unbind key events 3847 $(document).unbind('keyup.lightcase'); 3848 3849 // Unbind swipe events 3850 _self.objects.case.unbind('swipeleft').unbind('swiperight'); 3851 3852 // Unbind navigator events 3853 _self.objects.prev.unbind('click'); 3854 _self.objects.next.unbind('click'); 3855 _self.objects.play.unbind('click'); 3856 _self.objects.pause.unbind('click'); 3857 3858 // Unbind close event 3859 _self.objects.close.unbind('click'); 3860 }, 3861 3862 /** 3863 * Cleans up the dimensions 3864 * 3865 * @return {void} 3866 */ 3867 _cleanupDimensions: function () { 3868 var opacity = _self.objects.contentInner.css('opacity'); 3869 3870 _self.objects.case.css({ 3871 'width': '', 3872 'height': '', 3873 'top': '', 3874 'left': '', 3875 'margin-top': '', 3876 'margin-left': '' 3877 }); 3878 3879 _self.objects.contentInner.removeAttr('style').css('opacity', opacity); 3880 _self.objects.contentInner.children().removeAttr('style'); 3881 }, 3882 3883 /** 3884 * Cleanup after aborting lightcase 3885 * 3886 * @return {void} 3887 */ 3888 cleanup: function () { 3889 _self._cleanupDimensions(); 3890 3891 _self.objects.loading.hide(); 3892 _self.objects.overlay.hide(); 3893 _self.objects.case.hide(); 3894 _self.objects.prev.hide(); 3895 _self.objects.next.hide(); 3896 _self.objects.play.hide(); 3897 _self.objects.pause.hide(); 3898 3899 _self.objects.document.removeAttr(_self._prefixAttributeName('type')); 3900 _self.objects.nav.removeAttr(_self._prefixAttributeName('ispartofsequence')); 3901 3902 _self.objects.contentInner.empty().hide(); 3903 _self.objects.info.children().empty(); 3904 3905 if (_self.cache.originalObject) { 3906 _self._restoreObject(); 3907 } 3908 3909 // Call onCleanup hook functions 3910 _self._callHooks(_self.settings.onCleanup); 3911 3912 // Restore cache 3913 _self.cache = {}; 3914 }, 3915 3916 /** 3917 * Returns the supported match media or undefined if the browser 3918 * doesn't support match media. 3919 * 3920 * @return {mixed} 3921 */ 3922 _matchMedia: function () { 3923 return window.matchMedia || window.msMatchMedia; 3924 }, 3925 3926 /** 3927 * Returns the devicePixelRatio if supported. Else, it simply returns 3928 * 1 as the default. 3929 * 3930 * @return {number} 3931 */ 3932 _devicePixelRatio: function () { 3933 return window.devicePixelRatio || 1; 3934 }, 3935 3936 /** 3937 * Checks if method is public 3938 * 3939 * @return {boolean} 3940 */ 3941 _isPublicMethod: function (method) { 3942 return (typeof _self[method] === 'function' && method.charAt(0) !== '_'); 3943 }, 3944 3945 /** 3946 * Exports all public methods to be accessible, callable 3947 * from global scope. 3948 * 3949 * @return {void} 3950 */ 3951 _export: function () { 3952 window.lightcase = {}; 3953 3954 $.each(_self, function (property) { 3955 if (_self._isPublicMethod(property)) { 3956 lightcase[property] = _self[property]; 3957 } 3958 }); 3959 } 3960 }; 3961 3962 _self._export(); 3963 3964 $.fn.lightcase = function (method) { 3965 // Method calling logic (only public methods are applied)
3966 if (_self._isPublicMethod(method)) { 3967 return _self[method].apply(this, Array.prototype.slice.call(arguments, 1)); 3968 } else if (typeof method === 'object' || !method) { 3969 return _self.init.apply(this, arguments); 3970 } else { 3971 $.error('Method ' + method + ' does not exist on jQuery.lightcase'); 3972 } 3973 }; 3974})(jQuery); 3975`},3054:function(e){e.exports=`'use strict';var pdfflip=pdfflip||{},PRESENTATION=pdfflip;!function(e,t){e.version="1.4.31",e.PAGE_MODE={SINGLE:1,DOUBLE:2,AUTO:null},e.SINGLE_PAGE_MODE={ZOOM:1,BOOKLET:2,AUTO:null},e.CONTROLSPOSITION={HIDDEN:"hide",TOP:"top",BOTTOM:"bottom"},e.DIRECTION={LTR:1,RTL:2},e.CORNERS={TL:"tl",TR:"tr",BL:"bl",BR:"br",L:"l",R:"r",NONE:null},e.SOURCE_TYPE={IMAGE:"image",PDF:"pdf",HTML:"html"},e.DISPLAY_TYPE={WEBGL:"3D",HTML:"2D"},e.PAGE_SIZE={AUTO:0,SINGLE:1,DOUBLEINTERNAL:2};var n,i,o,a,r=e.defaults={webgl:!0,webglShadow:!0,enableSound:!0,height:"100%",autoEnableOutline:!1,autoEnableThumbnail:!1,overwritePDFOutline:!0,downloadEnable:!0,duration:800,direction:e.DIRECTION.LTR,pageMode:e.PAGE_MODE.AUTO,singlePageMode:e.SINGLE_PAGE_MODE.AUTO,backgroundColor:"#fff",forceFit:!0,transparent:!1,hard:"none",openPage:1,annotationClass:"",autoPlay:!0,autoPlayDuration:3e3,autoPlayStart:!1,maxTextureSize:1600,minTextureSize:256,rangeChunkSize:524288,icons:{altnext:"ti-angle-right",altprev:"ti-angle-right",next:"fa fa-chevron-right",prev:"fa fa-chevron-left",end:"ti-angle-double-right",start:"ti-angle-double-left",share:"fa fa-share",help:"ti-help-alt",more:"ti-more-alt",download:"fa fa-file-ppdff-o",zoomin:"ti-zoom-in",zoomout:"ti-zoom-out",fullscreen:"fa fa-arrows-alt",fitscreen:"ti-arrows-corner",thumbnail:"ti-layout-grid2",outline:"ti-menu-alt",close:"ti-close",doublepage:"ti-book",singlepage:"ti-file",sound:"ti-volume",facebook:"ti-facebook",google:"ti-google",twitter:"ti-twitter-alt",mail:"ti-email",play:"ti-control-play",pause:"ti-control-pause"},text:{toggleSound:"Sound",toggleThumbnails:"Thumbnails",toggleOutline:"Contents",previousPage:"Previous Page",nextPage:"Next Page",toggleFullscreen:"Fullscreen",zoomIn:"Zoom In",zoomOut:"Zoom Out",downloadPDFFile:"Download PDF",gotoFirstPage:"First Page",gotoLastPage:"Last Page",play:"AutoPlay On",pause:"AutoPlay Off",share:"Share"},allControls:"startPage,altPrev,pageNumber,altNext,endPage,play,outline,thumbnail,zoomIn,zoomOut,fullScreen,share,download,sound",moreControls:"",hideControls:"",controlsPosition:e.CONTROLSPOSITION.BOTTOM,paddingTop:15,paddingLeft:15,paddingRight:15,paddingBottom:-10,scrollWheel:!0,onCreate:function(e){},onCreateUI:function(e){},onFlip:function(e){},beforeFlip:function(e){},onReady:function(e){},zoomRatio:1.5,pageSize:e.PAGE_SIZE.AUTO,pdfjsSrc:"js/libs/pdf.min.js",pdfjsCompatibilitySrc:"js/libs/compatibility.js",pdfjsWorkerSrc:"js/libs/pdf.worker.min.js",threejsSrc:"js/libs/three.min.js",utilsSrc:"js/libs/utils.min.js",soundFile:"sound/turn.mp3",imagesLocation:"images",imageResourcesPath:"images/pdfjs/",cMapUrl:"cmaps/",enableDebugLog:!1,canvasToBlob:!1,enableAnnotation:!0,pdfRenderQuality:.9,textureLoadFallback:"blank",stiffness:3,backgroundImage:"pflip/background.jpg",pageRatio:null,pixelRatio:window.devicePixelRatio||1,thumbElement:"div",spotLightIntensity:.22,ambientLightColor:"#fff",ambientLightIntensity:.8,shadowOpacity:.08},s="WebKitCSSMatrix"in window||document.body&&"MozPerspective"in document.body.style,l="onmousedown"in window,c=(window,navigator.userAgent),d=e.utils={drag:{left:0,right:1,none:-1},mouseEvents:l?{type:"mouse",start:"mousedown",move:"mousemove",end:"mouseup"}:{type:"touch",start:"touchstart",move:"touchmove",end:"touchend"},html:{div:"<div/>",img:"<img/>",a:"<a>",input:"<input type='text'/>"},toRad:function(e){return e*Math.PI/180},isset:function(e,t){return null==e?t:e},isnull:function(e){return null==e||null==e},toDeg:function(e){return 180*e/Math.PI},transition:function(e,t){return e?t/1e3+"s ease-out":"0s none"},display:function(e){return e?"block":"none"},resetTranslate:function(){return b(0,0)},translateStr:function(e,t){return s?" translate3d("+e+"px,"+t+"px, 0px) ":" translate("+e+"px, "+t+"px) "},httpsCorrection:function(e){var t=window.location;return t.href.indexOf("https://")>-1&&e.indexOf(t.hostname)>-1&&(e=e.replace("http://","https://")),e},resetBoxShadow:function(){return"rgba(0, 0, 0, 0) 0px 0px 20px"},rotateStr:function(e){return" rotateZ("+e+"deg) "},bg:function(e){return"#fff"+y(e)},bgImage:function(e){return null==e||"blank"==e?"":" url("+e+")"},src:function(e){return null!=e?""+e:""},limitAt:function(e,t,n){return e<t?t:e>n?n:e},distOrigin:function(e,t){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2))},distPoints:function(e,t,n,i){return Math.sqrt(Math.pow(n-e,2)+Math.pow(i-t,2))},calculateScale:function(e,t){var n=C(e[0].x,e[0].y,e[1].x,e[1].y);return C(t[0].x,t[0].y,t[1].x,t[1].y)/n},getVectorAvg:function(e){return{x:e.map(function(e){return e.x}).reduce(d.sum)/e.length,y:e.map(function(e){return e.y}).reduce(d.sum)/e.length}},sum:function(e,t){return e+t},getTouches:function(e,t){return t=t||{left:0,top:0},Array.prototype.slice.call(e.touches).map(function(e){return{x:e.pageX-t.left,y:e.pageY-t.top}})},angleByDistance:function(e,t){var n=t/2,i=P(e,0,t);return i<n?v(Math.asin(i/n)):90+v(Math.asin((i-n)/n))},log:function(e){1==r.enableDebugLog&&window.console&&console.log(e)},lowerPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},nearestPowerOfTwo:function(e,t){return Math.min(t||2048,Math.pow(2,Math.ceil(Math.log(e)/Math.LN2)))},zoomStops:function(e,t,n,i,o){null==i&&(i=256),null==o&&(o=2048);var a=Math.log(e/i)/Math.log(t);return i*Math.pow(t,null==n?Math.round(a):1==n?Math.ceil(a):Math.floor(a))},extendOptions:function(e,n){return t.extend(!0,{},e,n)},getFullscreenElement:function(){return document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement},hasFullscreenEnabled:function(){return document.fullscreenEnabled||document.mozFullScreenEnabled||document.webkitFullscreenEnabled||document.msFullscreenEnabled},getBasePage:function(e){return 2*Math.floor(e/2)},loadResources:function(e,t,n){var i=document,o=i.createElement(e),a=i.getElementsByTagName(e)[0];o.async=!0,n&&o.addEventListener("load",function(e){n(null,e)},!1),o.src=t,a.parentNode.insertBefore(o,a)},getScript:function(e,t,n){var i=document.createElement("script"),o=document.body.getElementsByTagName("script")[0];function a(e,o){null!=i&&(o||!i.readyState||/loaded|complete/.test(i.readyState))&&(i.onload=i.onreadystatechange=null,i=null,i=null,o||(t&&t(),t=null,n=null))}i.async=1,i.setAttribute("data-cfasync",!1),null!=o?(o.parentNode.insertBefore(i,o),o=null):document.body.appendChild(i),i.addEventListener("load",a,!1),i.addEventListener("readystatechange",a,!1),i.addEventListener("complete",a,!1),n&&i.addEventListener("error",n,!1),i.src=e+("MS"==R.dom?"?"+Math.random(1):"")},isHardPage:function(e,t,n,i){if(null!=e){if("cover"==e)return 0==t||i&&1==t||t==Math.floor(n/(i?1:2))-(i?0:1);if("all"==e)return!0;var o=(","+e+",").indexOf(","+(2*t+1)+",")>-1,a=(","+e+",").indexOf(","+(2*t+2)+",")>-1;return o||a}return!1},fixMouseEvent:function(e){if(e){var n=e.originalEvent||e;if(n.changedTouches&&n.changedTouches.length>0){var i=t.event.fix(e),o=n.changedTouches[0];return i.clientX=o.clientX,i.clientY=o.clientY,i.pageX=o.pageX,i.touches=n.touches,i.pageY=o.pageY,
3975i.movementX=o.movementX,i.movementY=o.movementY,i}return e}return e},hasWebgl:function(){try{var e=document.createElement("canvas");return!(!window.WebGLRenderingContext||!e.getContext("webgl")&&!e.getContext("experimental-webgl"))}catch(e){return!1}}(),isBookletMode:function(t){return t.pageMode==e.PAGE_MODE.SINGLE&&t.singlePageMode==e.SINGLE_PAGE_MODE.BOOKLET},isRTLMode:function(t){return t.direction==e.DIRECTION.RTL},isMobile:(a=!1,o=c||navigator.vendor||window.opera,(/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(o)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(o.substr(0,4)))&&(a=!0),a),isIOS:/(iPad|iPhone|iPod)/g.test(c),isSafari:/constructor/i.test(window.HTMLElement)||"[object SafariRemoteNotification]"===(!window.safari||safari.pushNotification).toString(),prefix:(n=window.getComputedStyle(document.documentElement,""),i=Array.prototype.slice.call(n).join("").match(/-(moz|webkit|ms)-/)[1],{dom:"WebKit|Moz|MS".match(new RegExp("("+i+")","i"))[1],lowercase:i,css:"-"+i+"-",js:i[0].toUpperCase()+i.substr(1)}),__extends:function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);function i(){this.constructor=e}return i.prototype=t.prototype,e.prototype=new i,e.__super=t.prototype,e}},u=e.SOURCE_TYPE,p=(e.DISPLAY_TYPE,d.drag),h=d.mouseEvents,f=d.html,g=d.isset,m=(d.isnull,d.toRad),v=d.toDeg,b=(d.transition,d.translateStr),w=(d.resetBoxShadow,d.rotateStr),y=(d.bg,d.bgImage),P=(d.src,d.limitAt),x=d.distOrigin,C=d.distPoints,E=d.angleByDistance,S=d.log,k=d.nearestPowerOfTwo,T=d.extendOptions,L=d.getBasePage,O=d.getScript,I=d.fixMouseEvent,R=d.prefix,M=d.isBookletMode,D=d.isRTLMode,F=d.isMobile,z=d.hasWebgl,N=d.isSafari,A=d.isIOS,B=d.__extends;!function(){if(window.CanvasPixelArray)"function"!=typeof window.CanvasPixelArray.prototype.set&&(window.CanvasPixelArray.prototype.set=function(e){for(var t=0,n=this.length;t<n;t++)this[t]=e[t]});else{var e,t=!1;if(N&&(t=(e=c.match(/Version\\/([0-9]+)\\.([0-9]+)\\.([0-9]+) Safari\\//))&&parseInt(e[1])<6),t){var n=window.CanvasRenderingContext2D.prototype,i=n.createImageData;n.createImageData=function(e,t){var n=i.call(this,e,t);return n.data.set=function(e){for(var t=0,n=this.length;t<n;t++)this[t]=e[t]},n},n=null}}}(),"requestAnimationFrame"in window||(window.requestAnimationFrame=window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(e){window.setTimeout(e,20)}),function(){if("undefined"!=typeof Uint8Array)return void 0===Uint8Array.prototype.subarray&&(Uint8Array.prototype.subarray=function(e,t){return new Uint8Array(this.slice(e,t))},Float32Array.prototype.subarray=function(e,t){return new Float32Array(this.slice(e,t))}),void("undefined"==typeof Float64Array&&(window.Float64Array=Float32Array));function e(e,t){return new n(this.slice(e,t))}function t(e,t){arguments.length<2&&(t=0);for(var n=0,i=e.length;n<i;++n,++t)this[t]=255&e[n]}function n(n){var i,o,a;if("number"==typeof n)for(i=[],o=0;o<n;++o)i[o]=0;else if("slice"in n)i=n.slice(0);else for(i=[],o=0,a=n.length;o<a;++o)i[o]=n[o];return i.subarray=e,i.buffer=i,i.byteLength=i.length,i.set=t,"object"==typeof n&&n.buffer&&(i.buffer=n.buffer),i}window.Uint8Array=n,window.Int8Array=n,window.Uint32Array=n,window.Int32Array=n,window.Uint16Array=n,window.Float32Array=n,window.Float64Array=n}();
3975var j=function(n,i){var o="pdff-ui",a="pdff-ui-wrapper",r=o+"-btn",s=i.ui=t(f.div,{class:o}),l=i.options;s.dispose=function(){n.find("."+r).each(function(){t(this).off()}),y.off(),u.off(),p.off(),h.off(),g.off(),m.off(),v.off(),b.off(),P.off(),x.off(),T.off(),L.off(),I.off(),R.off(),M.off(),D.off(),F.off(),z.off(),N.off(),A.off(),O.remove(),w.remove(),p.remove(),u.remove(),g.remove(),s.shareBox&&(s.shareBox.dispose&&s.shareBox.dispose(),s.shareBox=null),document.removeEventListener("keyup",X,!1),window.removeEventListener("click",C,!1),s.update=null,i=null};var c=function(e){return isNaN(e)?e=i.target._activePage:e<1?e=1:e>i.target.pageCount&&(e=i.target.pageCount),e},u=s.next=t(f.div,{class:r+" "+o+"-next "+l.icons.next,title:l.text.nextPage,html:"<span>"+l.text.nextPage+"</span>"}).on("click",function(){i.next()}),p=s.prev=t(f.div,{class:r+" "+o+"-prev "+l.icons.prev,title:l.text.previousPage,html:"<span>"+l.text.previousPage+"</span>"}).on("click",function(){i.prev()}),h=t(f.div,{class:r+" "+o+"-play "+l.icons.play,title:l.text.play,html:"<span>"+l.text.play+"</span>"}).on("click",function(){var e=t(this);i.setAutoPlay(!e.hasClass(l.icons.pause))});1==l.autoPlay&&(s.play=h,i.setAutoPlay(l.autoPlayStart));var g=t(f.div,{class:a+" "+o+"-zoom"}),m=s.zoomIn=t(f.div,{class:r+" "+o+"-zoomin "+l.icons.zoomin,title:l.text.zoomIn,html:"<span>"+l.text.zoomIn+"</span>"}).on("click",function(){i.zoom(1),s.update(),i.target.startPoint&&i.target.pan&&i.target.pan(i.target.startPoint)}),v=s.zoomOut=t(f.div,{class:r+" "+o+"-zoomout "+l.icons.zoomout,title:l.text.zoomOut,html:"<span>"+l.text.zoomOut+"</span>"}).on("click",function(){i.zoom(-1),s.update(),i.target.startPoint&&i.target.pan&&i.target.pan(i.target.startPoint)});g.append(m).append(v);var b=s.pageNumber=t(f.div,{class:r+" "+o+"-page"}).on("change",function(){var e=parseInt(s.pageInput.val(),10);e=c(e),i.gotoPage(e)}).on("keyup",function(e){if(13==e.keyCode){var t=parseInt(s.pageInput.val(),10);(t=c(t))!==c(i.target._activePage||i._activePage)&&i.gotoPage(t)}});s.pageInput=t('<input id="df_book_page_number" type="text"/>').appendTo(b),s.pageLabel=t('<label for="df_book_page_number"/>').appendTo(b);var w=t(f.div,{class:a+" "+o+"-size"}),y=t(f.div,{class:r+" "+o+"-help "+l.icons.help,title:l.text.toggleHelp,html:"<span>"+l.text.toggleHelp+"</span>"}).on("click",function(){}),P=s.sound=t(f.div,{class:r+" "+o+"-sound "+l.icons.sound,title:l.text.toggleSound,html:"<span>"+l.text.toggleSound+"</span>"}).on("click",function(){l.enableSound=!l.enableSound,s.updateSound()});s.updateSound=function(){0==l.enableSound||"false"==l.enableSound?P.addClass("disabled"):P.removeClass("disabled")},s.updateSound();var x=s.more=t(f.div,{class:r+" "+o+"-more "+l.icons.more}).on("click",function(e){x.hasClass("pdff-active")||(t(this).addClass("pdff-active"),e.stopPropagation())});function C(e){x.removeClass("pdff-active")}window.addEventListener("click",C,!1);var E=t(f.div,{class:"more-container"});if(x.append(E),"string"==typeof l.source&&1==l.downloadEnable){var k=r+" "+o+"-download "+l.icons.download;(s.download=t('<a download target="_blank" class="'+k+'"><span>'+l.text.downloadPDFFile+"</span></a>")).attr("href",l.source).attr("title",l.text.downloadPDFFile)}d.hasFullscreenEnabled()||n.addClass("pdff-custom-fullscreen"),s.switchFullscreen=function(){d.getFullscreenElement();var e=i.container[0];1!=s.isFullscreen?(i.container.addClass("pdff-fullscreen"),e.requestFullscreen?e.requestFullscreen():e.msRequestFullscreen?e.msRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen(),s.isFullscreen=!0):(i.container.removeClass("pdff-fullscreen"),s.isFullscreen=!1,document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()),d.hasFullscreenEnabled()||setTimeout(function(){i.resize()},50)};var T=s.fullScreen=t(f.div,{class:r+" "+o+"-fullscreen "+l.icons.fullscreen,title:l.text.toggleFullscreen,html:"<span>"+l.text.toggleFullscreen+"</span>"}
3975).on("click",s.switchFullscreen),L=s.fit=t(f.div,{class:r+" "+o+"-fit "+l.icons.fitscreen}).on("click",function(){t(this).toggleClass("pdff-button-fit-active")});w.append(T);var O=t(f.div,{class:a+" "+o+"-controls"}),I=(s.shareBox=new e.Share(n,l),s.share=t(f.div,{class:r+" "+o+"-share "+l.icons.share,title:l.text.share,html:"<span>"+l.text.share+"</span>"}).on("click",function(e){1==s.shareBox.isOpen?s.shareBox.close():(s.shareBox.update(i.getURLHash()),s.shareBox.show())})),R=s.startPage=t(f.div,{class:r+" "+o+"-start "+l.icons.start,title:l.text.gotoFirstPage,html:"<span>"+l.text.gotoFirstPage+"</span>"}).on("click",function(){i.start()}),M=s.endPage=t(f.div,{class:r+" "+o+"-end "+l.icons.end,title:l.text.gotoLastPage,html:"<span>"+l.text.gotoLastPage+"</span>"}).on("click",function(){i.end()}),D=s.pageMode=t(f.div,{class:r+" "+o+"-pagemode "+l.icons.singlepage,html:"<span>"+l.text.singlePageMode+"</span>"}).on("click",function(){var e=t(this);i.setPageMode(!e.hasClass(l.icons.doublepage))});i.setPageMode(i.target.pageMode==e.PAGE_MODE.SINGLE);for(var F=s.altPrev=t(f.div,{class:r+" "+o+"-prev "+o+"-alt "+l.icons.prev,title:l.text.previousPage,html:"<span>"+l.text.previousPage+"</span>"}).on("click",function(){i.prev()}),z=s.altNext=t(f.div,{class:r+" "+o+"-next "+o+"-alt "+l.icons.next,title:l.text.nextPage,html:"<span>"+l.text.nextPage+"</span>"}).on("click",function(){i.next()}),N=s.thumbnail=t(f.div,{class:r+" "+o+"-thumbnail "+l.icons.thumbnail,title:l.text.toggleThumbnails,html:"<span>"+l.text.toggleThumbnails+"</span>"}).on("click",function(){var e=t(this);i.target.thumbContainer?(i.target.thumbContainer.toggleClass("pdff-sidemenu-visible"),e.toggleClass("pdff-active")):(i.contentProvider.initThumbs(),e.toggleClass("pdff-active")),e.hasClass("pdff-active")&&e.siblings(".pdff-active").trigger("click"),s.update(!0)}),A=s.outline=t(f.div,{class:r+" "+o+"-outline "+l.icons.outline,title:l.text.toggleOutline,html:"<span>"+l.text.toggleOutline+"</span>"}).on("click",function(){var e=t(this);if(i.target.outlineContainer){var n=i.target.outlineContainer;e.toggleClass("pdff-active"),n.toggleClass("pdff-sidemenu-visible"),e.hasClass("pdff-active")&&e.siblings(".pdff-active").trigger("click"),s.update(!0)}}),B=l.allControls.replace(/ /g,"").split(","),j=","+l.moreControls.replace(/ /g,"")+",",_=","+l.hideControls.replace(/ /g,"")+",",U=(j.split(","),0);U<B.length;U++){var H=B[U];if(_.indexOf(","+H+",")<0){var W=s[H];null!=W&&(j.indexOf(","+H+",")>-1&&"more"!==H&&"pageNumber"!==H?E.append(W):O.append(W))}}n.append(O).append(p).append(u).append(g);var G=16,V=17,q=18,Z=39,Y=37,K=27;function X(e){switch(e.keyCode){case K:1==s.isFullscreen&&s.fullScreen.trigger("click");break;case G:case V:case q:break;case Y:i.prev();break;case Z:i.next()}}document.addEventListener("keyup",X,!1),s.update=function(t){S("ui update");var o=i.target,a=c(o._activePage||i._activePage),r=o.pageCount||i.pageCount,l=o.direction==e.DIRECTION.RTL,d=1==a||0==a,u=a==r;s.next.show(),s.prev.show(),s.altNext.removeClass("disabled"),s.altPrev.removeClass("disabled"),(d&&!l||u&&l)&&(s.prev.hide(),s.altPrev.addClass("disabled")),(u&&!l||d&&l)&&(s.next.hide(),s.altNext.addClass("disabled")),s.pageInput.val(a),s.pageLabel.html(a+"/"+r),n.find(".pdff-sidemenu-visible").length>0?n.addClass("pdff-sidemenu-open"):n.removeClass("pdff-sidemenu-open"),1==t&&i.resize(),o.contentProvider.zoomScale==o.contentProvider.maxZoom?s.zoomIn.addClass("disabled"):s.zoomIn.removeClass("disabled"),1==o.contentProvider.zoomScale?s.zoomOut.addClass("disabled"):s.zoomOut.removeClass("disabled")},null!=i.target&&(i.target.ui=s),null!=l.onCreateUI&&l.onCreateUI(i)},_=null;var U=function(n){function i(t){t=t||{},this.type="PreviewObject";var n=this;function i(){setTimeout(function(){n.resize()},50)}n.zoomValue=1,window.addEventListener("resize",i,!1),this.sound=document.createElement("audio"),this.sound.setAttribute("src",t.soundFile+"?ver="+e.version),this.sound.setAttribute("type","audio/mpeg"),this.autoPlayFunction=function(){n&&n.target.autoPlay&&(n.target.direction==e.DIRECTION.RTL?n.target.prev():n.target.next())},this.dispose=function(){if(clearInterval(this.autoPlayTimer),this.autoPlayTimer=null,this.autoPlayFunction=null,this.target&&this.target.children)for(var e=0;e<this.target.children.length;e++){var t=this.target.children[e];t&&t.currentTween&&t.currentTween.stop()}this.zoomTween&&(this.zoomTween.stop&&this.zoomTween.stop(),this.zoomTween=null),this.container&&this.container.info&&this.container.info.remove&&this.container.info.remove(),this.target&&this.target.dispose&&this.target.dispose(),this.target=null,this.stage&&this.stage.dispose&&this.stage.dispose(),this.stage=null,this.ui&&this.ui.dispose&&this.ui.dispose(),this.ui=null,this.contentProvider&&this.contentProvider.dispose&&this.contentProvider.dispose(),this.contentProvider=null,window.removeEventListener("resize",i)}}return i.prototype={start:function(){this.target.gotoPage(this.target.startPage)},end:function(){this.target.gotoPage(this.target.endPage)},next:function(){},prev:function(){},zoom:function(e){this.pendingZoom=!0,this.zoomDelta=e,this.resize(),this.ui.update()},resize:function(){var n=this;if(null!=n.target&&null!=n.target.ui&&null!=n.target.contentProvider&&null!=n.target.contentProvider.viewport&&null!=n.target.stage){this.ui&&1==this.ui.isFullscreen&&1==d.hasFullscreenEnabled()&&null==d.getFullscreenElement()&&this.ui.switchFullscreen();var i,o,a,r,s,l,c=n.target,p=n.container,h=n.options,f=c.stage,g=c.contentProvider,m=g.pageRatio,v=(g.zoomViewport,D(c)),b="css"!==c.mode,w=(g.pageRatio,p.hasClass("pdff-sidemenu-open")?220:0),y=this.target.pageMode==e.PAGE_MODE.SINGLE;p.height(h.height);var C=Math.min(p.height(),t(window).height());p.height(C);var E=p.width();E<400?n.container.addClass("pdff-xs"):n.container.removeClass("pdff-xs");var S=p.find(".pdff-ui-controls").height(),k=h.paddingTop+(h.controlsPosition==e.CONTROLSPOSITION.TOP?S:0),T=h.paddingRight,L=h.paddingBottom+(h.controlsPosition==e.CONTROLSPOSITION.BOTTOM?S:0),O
3975=h.paddingLeft,I=E-w,R=C,M=(k=isNaN(k)?0:P(k,0,k))+(L=isNaN(L)?0:P(L,0,L)),F=(O=isNaN(O)?0:P(O,0,O))+(T=isNaN(T)?0:P(T,0,T)),z=I-F,N=R-M;if(a=Math.floor(y?z:z/2),(i=(o=Math.floor(a/m))>N)&&(a=(o=N)*m),l=g.maxZoom=g.zoomViewport.height/o,null==n.zoomValue&&(n.zoomValue=1),null==g.zoomScale&&(g.zoomScale=1),1==n.pendingZoom&&null!=n.zoomDelta){n.zoomDelta;var A,B=Math.max(o,a);n.zoomValue=n.zoomDelta>0?n.zoomValue*n.options.zoomRatio:n.zoomValue/n.options.zoomRatio,n.zoomValue=P(n.zoomValue,1,l),1==n.zoomValue?g.zoomScale=1:(A=o*n.zoomValue,A=d.zoomStops(A,n.options.zoomRatio,n.zoomDelta>0,Math.max(a,o)),g.zoomScale=P(A/B,1,l))}s=g.zoomScale,g.checkViewportSize(a,o,s),g.contentSourceType==u.PDF&&(a=g.imageViewport.width/s,o=g.imageViewport.height/s),1!=g.zoomScale&&this.target.container.addClass("pdff-zoom-enabled");var j=c.zoomWidth=Math.floor(a*s),_=c.zoomHeight=Math.floor(o*s),U=2*j;if(b){var H=_/c.height,W=i?s*(o+M)/H:s*(a*(y?1:2)+F)/H/(I/R);f.resizeCanvas(I,R),r=1/(2*Math.tan(Math.PI*f.camera.fov*.5/180)/(W/s))+2.2,f.camera.updateProjectionMatrix(),f.renderRequestPending=!0;var G=(k-L)*(c.height/o)/s/2,V=1==g.zoomScale;f.camera.position.z!==r&&1==n.pendingZoom?(null!=n.zoomTween&&n.zoomTween.stop(),n.zoomTween=new TWEEN.Tween({campos:f.camera.position.z,otx:f.orbitControl.target.x,oty:f.orbitControl.target.y,otz:f.orbitControl.target.z}).delay(0).to({campos:r,otx:0,oty:G,otz:0}
3975,100).onUpdate(function(){f.camera.position.z=this.campos,V&&(f.camera.position.y=this.oty,f.orbitControl.target=new THREE.Vector3(this.otx,this.oty,this.otz)),f.orbitControl.update()}).easing(TWEEN.Easing.Linear.None).onComplete(function(){f.camera.position.z=r,1==g.zoomScale&&(f.camera.position.set(0,G,r),f.orbitControl.target=new THREE.Vector3(0,G,0)),f.orbitControl.update()}).start()):(1==g.zoomScale&&(f.camera.position.set(0,G,r),f.orbitControl.target=new THREE.Vector3(0,G,0)),f.orbitControl.update()),f.orbitControl.update(),f.orbitControl.mouseButtons.ORBIT=1!=s?-1:THREE.MOUSE.RIGHT,f.orbitControl.mouseButtons.PAN=1!=s?THREE.MOUSE.LEFT:-1}else{c.pageWidth=Math.round(a),c.fullWidth=2*c.pageWidth,c.height=Math.round(o);var q=c.shiftHeight=Math.round(P((_-R+M)/2,0,_)),Z=c.shiftWidth=Math.round(P((U-I+F)/2,0,U));1==s&&(c.left=0,c.top=0),c.stage.css({top:-q,bottom:-q,right:-Z+(v?w:0),left:-Z+(v?0:w),paddingTop:k,paddingRight:T,paddingBottom:L,paddingLeft:O,transform:"translate3d("+c.left+"px,"+c.top+"px,0)"}),c.stageHeight=f.height(),c.wrapper.css({width:U,height:_,marginTop:C-_-M>0?(C-M-_)/2:0});var Y=Math.floor(x(a,o)*s);c.stage.find(".pdff-page-wrapper").width(Y).height(Y),c.stage.find(".ppdff-flipbook-page, .pdff-page-front , .pdff-page-back, .pdff-page-fold-inner-shadow").height(_).width(j)}n.checkCenter({type:"resize"}),1==g.zoomScale&&this.target.container.removeClass("pdff-zoom-enabled"),c.thumblist&&c.thumblist.reset(t(c.thumblist.container).height()),n.pendingZoom=!1}},playSound:function(){try{this.options&&1==this.options.enableSound&&(this.sound.currentTime=0,this.sound.play())}catch(e){}},setPageMode:function(t){1==t?(this.ui.pageMode.addClass(this.options.icons.doublepage),this.ui.pageMode.html("<span>"+this.options.text.doublePageMode+"</span>"),this.ui.pageMode.attr("title",this.options.text.doublePageMode),this.target.pageMode=e.PAGE_MODE.SINGLE):(this.ui.pageMode.removeClass(this.options.icons.doublepage),this.ui.pageMode.html("<span>"+this.options.text.singlePageMode+"</span>"),this.ui.pageMode.attr("title",this.options.text.singlePageMode),this.target.pageMode=e.PAGE_MODE.DOUBLE),this.target&&this.target.singlePageMode==e.SINGLE_PAGE_MODE.BOOKLET&&this.target.reset(),this.resize()},setAutoPlay:function(e){if(this.options.autoPlay){var t=(e=1==e)?this.options.text.pause:this.options.text.play;this.ui.play.toggleClass(this.options.icons.pause,e),this.ui.play.html("<span>"+t+"</span>"),this.ui.play.attr("title",t),clearInterval(this.autoPlayTimer),e&&(this.autoPlayTimer=setInterval(this.autoPlayFunction,this.options.autoPlayDuration)),this.target.autoPlay=e}},height:function(e){if(null==e)return this.container.height();this.options.height=e,this.container.height(e),this.resize()},checkCenter:function(t){t=null==t?{}:t,this.centerType=this.centerType||"start";var n,i=this.target,o=0,a=0,r=0,s=d.getBasePage(i._activePage),l=i._activePage%2==0,c=i.direction==e.DIRECTION.RTL,u=i.pageMode==e.PAGE_MODE.SINGLE,p=u&&i.singlePageMode==e.SINGLE_PAGE_MODE.BOOKLET,h=i.stage.width();if("css"==i.mode)n=i.wrapper.width(),o=Math.max((n-h)/2,0),a=-n/4,r=n/4,0==s||p?(i.wrapper.css({left:u?c?r-o:a-o:c?r:a}),i.shadow.css({width:"50%",left:c?0:"50%",transitionDelay:""})):s==i.pageCount?(i.wrapper.css({left:u?c?a-o:r-o:c?a:r}),i.shadow.css({width:"50%",left:c?"50%":0,transitionDelay:""})):(i.wrapper.css({left:u?c?l?a-o:r-o:l?r-o:a-o:0}),i.shadow.css({width:"100%",left:0,transitionDelay:parseInt(i.duration,10)+50+"ms"})),i.wrapper.css({transition:"resize"==t.type?"none":""});else if(null!=i.stage){var f,g=i.position.x;o=i.width/4,a=-(n=i.width)/2,r=n/2,(f=0==s||p?c?r:a:s==i.pageCount?c?a:r:u?c?l?a:r:l?r:a:0)!==this.centerEnd&&(this.centerTween=new TWEEN.Tween({x:g}).delay(0).to({x:f},i.duration).onUpdate(function(){i.position.x=this.x,i.stage.cssScene.position.x=this.x}).easing(i.ease).start(),this.centerEnd=f)}},width:function(e){if(null==e)return this.container.width();this.options.width=e,this.container.width(e),this.resize()}},i}();e.PreviewObject=U;var H=function(n){function i(n,i,o,a){o=o||{};var s=this;if(s.contentRawSource=n||[r.textureLoadFallback],s.contentSource=s.contentRawSource,s.contentSourceType=null,s.minDimension=o.minTextureSize||256,s.maxDimension=o.maxTextureSize||2048,s.pdfRenderQuality=o.pdfRenderQuality||e.defaults.pdfRenderQuality,s.flipbook=a,s.waitPerio
3975d=50,s.maxLength=297,s.enableDebug=!1,s.zoomScale=1,s.maxZoom=2,s.options=o,s.outline=o.outline,s.links=o.links,s.html=o.html,s.isCrossOrigin=o.isCrossOrigin,s.normalViewport={height:297,width:210,scale:1},s.viewport={height:297,width:210,scale:1},s.imageViewport={height:297,width:210,scale:1},s.bookSize={height:297,width:210},s.zoomViewport={height:297,width:210},s.thumbsize=128,s.cacheIndex=256,s.cache=[],s.pageRatio=o.pageRatio||s.viewport.width/s.viewport.height,s.textureLoadTimeOut=null,s.type="TextureLibrary",Array===s.contentSource.constructor||Array.isArray(s.contentSource)||s.contentSource instanceof Array)s.contentSourceType=u.IMAGE,s.pageCount=s.contentSource.length,t("<img/>").attr("src",s.contentSource[0]).on("load",function(){s.viewport.height=this.height,s.viewport.width=this.width,s.pageRatio=s.viewport.width/s.viewport.height,s.bookSize={width:(s.pageRatio>1?1:s.pageRatio)*s.maxLength,height:s.maxLength/(s.pageRatio<1?1:s.pageRatio)},s.zoomViewport={width:(s.pageRatio>1?1:s.pageRatio)*s.maxDimension,height:s.maxDimension/(s.pageRatio<1?1:s.pageRatio)},s.linkService=new PDFLinkService,t(this).off(),s.options.pageSize==e.PAGE_SIZE.DOUBLEINTERNAL&&(s.pageCount=2*s.contentSource.length-2,1==s.options.webgl&&(s.requiresImageTextureScaling=!0)),null!=i&&(i(s),i=null),S(this.height+":"+this.width)});else if("string"==typeof s.contentSource||s.contentSource instanceof String){var l=function(){if(s){PDFJS.workerSrc=r.pdfjsWorkerSrc,s.contentSourceType=u.PDF,PDFJS.disableAutoFetch=!0,PDFJS.disableStream=!0,(N||A||1==s.options.disableFontFace)&&(PDFJS.disableFontFace=N||A||1==s.options.disableFontFace),PDFJS.imageResourcesPath=r.imageResourcesPath,PDFJS.cMapUrl=r.cMapUrl,PDFJS.cMapPacked=!0,PDFJS.externalLinkTarget=PDFJS.LinkTarget.BLANK;var t=s.loading=PDFJS.getDocument(s.options.docParameters?s.options.docParameters:{url:d.httpsCorrection(n),rangeChunkSize:isNaN(e.defaults.rangeChunkSize)?524288:e.defaults.rangeChunkSize});t.then(function(t){s.pdfDocument=t,t.getPage(1).then(function(n){s.normalViewport=n.getViewport(1),s.viewport=n.getViewport(1),s.viewport.height=s.viewport.height/10,s.viewport.width=s.viewport.width/10,s.pageRatio=s.viewport.width/s.viewport.height,s.bookSize={width:(s.pageRatio>1?1:s.pageRatio)*s.maxLength,height:s.maxLength/(s.pageRatio<1?1:s.pageRatio)},s.zoomViewport={width:(s.pageRatio>1?1:s.pageRatio)*s.maxDimension,height:s.maxDimension/(s.pageRatio<1?1:s.pageRatio)},s.refPage=n,t.numPages>1?t.getPage(2).then(function(n){if(s.options.pageSize==e.PAGE_SIZE.AUTO){var o=n.getViewport(1);o.width/o.height>1.5*s.pageRatio?(s.options.pageSize=e.PAGE_SIZE.DOUBLEINTERNAL,s.pageCount=2*t.numPages-2):s.options.pageSize=e.PAGE_SIZE.SINGLE}null!=i&&(i(s),i=null)}):null!=i&&(i(s),i=null)}),s.linkService=new PDFLinkService,s.linkService.setDocument(t,null),s.pageCount=t.numPages,s.contentSource=t},function(e){if(s){var t="",n=document.createElement("a");n.href=s.contentSource,n.hostname!==window.location.hostname&&(t="CROSS ORIGIN!! "),s.updateInfo(t+"Error Loading File - "+s.contentSource)}}),t.onProgress=function(e){if(s){var t=100*e.loaded/e.total;isNaN(t)?e&&e.loaded?s.updateInfo("Loading Pages "+(Math.ceil(e.loaded/1e4)/100).toString()+"MB ..."):s.updateInfo("Loading Pages ..."):s.updateInfo("Loading Pages "+t.toString().split(".")[0]+"% ...")}}}},c=function(){if(s){r.pdfjsWorkerSrc+="?ver="+e.version,s.updateInfo("Loading Interface ...");var n=document.createElement("a");n.href=r.pdfjsWorkerSrc,n.hostname!==window.location.hostname?(s.updateInfo("Loading Interface ..."),t.ajax({url:r.pdfjsWorkerSrc,cache:!0,success:function(t){r.pdfjsWorkerSrc=e.createObjectURL(t,"text/javascript"),l()}})):l()}};null==window.PDFJS?s&&(s.updateInfo("Loading Interface ..."),O(r.pdfjsSrc+"?ver="+e.version,function(){"function"==typeof define&&define.amd?(s.updateInfo("Loading Interface ..."),require.config({paths:{"pdfjs-dist/build/pdf.worker":r.pdfjsWorkerSrc.replace(".js","")}}),require(["pdfjs-dist/build/pdf"],function(e){c()})):c()},function(){s.updateInfo("Unable to load Interface ..")})):l()}else console.error("Unsupported source type. Please load a valid PDF file.");return this.dispose=function(){s.loading&&s.loading.destroy&&s.loading.destroy(),s.loading=null,s.textureLoadTimeOut&&(clearTimeout(s.textureLoadTimeOut),s.textureLoadTimeOut=null),this.targetObject&&(this.targetObject.thumbContainer&&this.targetObject.thumbContainer.remove&&this.targetObject.thumbContainer.remove(),this.targetObject.outlineContainer&&this.targetObject.outlineContainer.remove&&this.targetObject.outlineContainer.remove(),this.targetObject.dispose&&this.targetObject.dispose(),this.targetObject.processPage=null,this.targetObject.requestPage=null,this.targetObject.container&&this.targetObject.container.off&&this.targetObject.container.off()),this.pdfDocument&&this.pdfDocument.destroy&&this.pdfDocument.destroy(),this.linkService&&this.linkService.dispose&&this.linkService.dispose(),this.outlineViewer&&this.outlineViewer.dispose&&this.outlineViewer.dispose(),this.thumblist&&this.thumblist.dispose&&(this.thumblist.review=null,this.thumblist.dispose()),this.activeThumb=null,this.targetObject=null,this.pdfDocument=null,this.linkService=null,this.outlineViewer=null,this.thumblist=null,s=null},this}return B(i,{}),i.prototype.updateInfo=function(e){this.flipbook&&this.flipbook.updateInfo&&this.flipbook.updateInfo(e)},i.prototype.initThumbs=function(){var e,n=this;null==n.cache[n.thumbsize]&&(n.cache[n.thumbsize]=[]);var i=function(){clearTimeout(e),e=setTimeout(function(){e=setTimeout(o,n.waitPerio
3975d/2)},n.waitPeriod)},o=function(){var o=0;if(Date.now()-n.thumblist.lastScrolled<100?o=1:(n.targetObject.container.find(".pdff-thumb-container .pdff-vrow").each(function(){var e=t(this);if(!e.hasClass("pdff-thumb-loaded")){o++;var a=t(this).attr("id").replace("pdff-thumb","");return n.getPage(a,i,!0),e.addClass("pdff-thumb-loaded"),!1}}),0==o&&clearTimeout(e)),o>0&&i(),n.activeThumb!=n.targetObject._activePage&&null!=n.targetObject.thumbContainer&&n.targetObject.thumbContainer.hasClass("pdff-sidemenu-visible")){var a=n.thumblist.container,r=a.scrollTop,s=a.getBoundingClientRect().height,l=n.targetObject.thumbContainer.find("#pdff-thumb"+n.targetObject._activePage);l.length>0?(n.targetObject.thumbContainer.find(".pdff-selected").removeClass("pdff-selected"),l.addClass("pdff-selected"),r+s<(l=l[0]).offsetTop+l.scrollHeight?l.scrollIntoView(!1):r>l.offsetTop&&l.scrollIntoView(),n.activeThumb=n.targetObject._activePage):(t(a).scrollTop(124*n.targetObject._activePage),i())}};n.thumblist=n.targetObject.thumblist=new ThumbList({h:500,addFn:function(e){},scrollFn:i,itemHeight:128,totalRows:n.pageCount,generatorFn:function(e){var t=document.createElement("div"),n=e+1;t.id="pdff-thumb"+n;var i=document.createElement("div");return i.innerHTML=n,t.appendChild(i),t}}),n.thumblist.lastScrolled=Date.now(),n.thumblist.review=i,i();var a=t("<div>").addClass("pdff-thumb-container pdff-sidemenu-visible pdff-sidemenu");a.append(t(n.thumblist.container).addClass("pdff-thumb-wrapper")),n.targetObject.thumbContainer=a,n.targetObject.container.append(a);var r=t(f.div,{class:"pdff-ui-btn pdff-ui-sidemenu-close ti-close"});a.append(r),n.thumblist.reset(t(n.thumblist.container).height()),n.targetObject.container.on("click",".pdff-thumb-container .pdff-vrow",function(e){e.stopPropagation();var i=t(this).attr("id").replace("pdff-thumb","");n.targetObject.gotoPage(parseInt(i,10))})},i.prototype.initOutline=function(){var e=this,n=t("<div>").addClass("pdff-outline-container pdff-sidemenu"),i=t("<div>").addClass("pdff-outline-wrapper"),o=t(f.div,{class:"pdff-ui-btn pdff-ui-sidemenu-close ti-close"});function a(t){if(1==e.options.overwritePDFOutline&&(t=[]),t=t||[],e.outline)for(var n=0;n<e.outline.length;n++)e.outline[n].custom=!0,t&&t.push(e.outline[n]);e.outlineViewer.render({outline:t})}n.append(o).append(i),e.targetObject.container.append(n),e.targetObject.outlineContainer=n,e.outlineViewer=new BookMarkViewer({container:i[0],linkService:e.linkService,outlineItemClass:"pdff-outline-item",outlineToggleClass:"pdff-outline-toggle",outlineToggleHiddenClass:"pdff-outlines-hidden"}),e.pdfDocument?e.pdfDocument.getOutline().then(function(e){a(e)}):a([]),1==e.options.autoEnableOutline&&e.targetObject.ui.outline.trigger("click"),1==e.options.autoEnableThumbnail&&e.targetObject.ui.thumbnail.trigger("click")},i.prototype.checkViewportSize=function(e,t,n){var i=this,o=i.targetObject,a=e*n,s=t*n,l=i.cacheIndex;if(i.contentSourceType==u.PDF){if(i.cacheIndex=Math.ceil(Math.max(a,s)),i.cacheIndex=Math.floor(Math.max(a,s)),i.cacheIndex=P(i.cacheIndex*r.pixelRatio,i.minDimension,i.maxDimension),null==i.cache[i.cacheIndex]&&(i.cache[i.cacheIndex]=[]),l!==i.cacheIndex){for(var c=0;c<o.children.length;c++)o.children[c];o.refresh()}i.imageViewport=i.refPage.getViewport(s/i.normalViewport.height),i.viewport="css"==o.mode?i.imageViewport:i.refPage.getViewport(i.bookSize.height/i.normalViewport.height),S(i.cacheIndex);var d=o.container.find(".linkAnnotation"),p=i.viewport.clone({dontFlip:!0});d.css({transform:"matrix("+p.transform.join(",")+")"})}else null==i.cache[i.cacheIndex]&&(i.cache[i.cacheIndex]=[])},i.prototype.getCache=function(e,t){return 1==t?null==this.cache[this.thumbsize]?null:this.cache[this.thumbsize][e]:null==this.cache[this.cacheIndex]?null:this.cache[this.cacheIndex][e]},i.prototype.setCache=function(e,t,n,i){if(1==n)null!=this.cache[this.thumbsize]&&(this.cache[this.thumbsize][e]=t);else{var o=null==i?this.cacheIndex:i;
3975null!=this.cache[o]&&(this.cache[o][e]=t)}},i.prototype.setTarget=function(e){var t=this;if(null==e)return this.targetObject;this.targetObject=e,e.contentProvider=this,e.container.removeClass("pdff-loading pdff-init"),null!=t.linkService&&(t.linkService.setViewer(e),t.initOutline()),e.processPage=function(e,n){e>0&&e<=t.pageCount?t.getPage(e,n):t.setPage(e,r.textureLoadFallback,n)},e.requestPage=function(){t.review("Request")},null!=e.resize&&e.resize()},i.prototype.review=function(e){var t=this;e=e||"timer review",clearTimeout(t.textureLoadTimeOut),t.textureLoadTimeOut=setTimeout(function(){t.textureLoadTimeOut=setTimeout(t.reviewPages,t.waitPeriod/2,t,e)},t.waitPeriod)},i.prototype.reviewPages=function(e,n){var i=(e=e||this).targetObject;if(null!=i){var o=M(i);null!=n&&S(n);var a,r=!1;for(a=0;a<e.targetObject.children.length;a++)if(1==i.children[a].isFlipping){r=!0;break}if(0==r){var s=i.children.length>3?3:i.children.length,l=o?i._activePage:L(i._activePage);for(e.baseNumber=l,e.zoomScale>1&&(s=1),a=0;a<s;a++){var c=Math.floor(a/2),d=a%2==0?-c*(o?1:2):(0==c?1:c)*(o?1:2),u=l+d,p=l+d+1,h=i.getPageByNumber(u),f=i.getPageByNumber(p),g=u+"|"+e.cacheIndex,m=p+"|"+e.cacheIndex,v=0;if(null!=h&&h.frontPageStamp!=g&&1==h.visible&&(h.frontTextureLoaded=!1,i.processPage(u,function(){e.review("Batch Call")}),h.frontPageStamp=g,v++),null==f||f.backPageStamp==m||1!=f.visible||o||(f.backTextureLoaded=!1,i.processPage(p,function(){e.review("Batch Call")}),f.backPageStamp=m,v++),0==d&&e.annotedPage!==l&&(e.getAnnotations(u),o||e.getAnnotations(p),e.annotedPage=l),v>0)break}0==v&&"css"!==i.mode&&e.setLoading(l)}else if(e.review("Revisit request"),null!=e.annotedPage&&"css"!==i.mode){var b=L(i._activePage);t(i.getContentLayer(b)).html(""),t(i.getContentLayer(b+1)).html(""),e.annotedPage=null}}},i.prototype.getPage=function(t,n,i){var o,a,s,l,c=this,d=t=parseInt(t,10),p=c.contentSource;t<=0&&t>=c.pageCount?c.setPage(t,r.textureLoadFallback,n,i):c.contentSourceType==u.PDF?null!=c.getCache(t,i)?(c.setPage(t,c.getCache(t,i),n,i),S("Page "+t+" loaded from cache")):(!0!==i&&c.setLoading(t,!0),c.options.pageSize==e.PAGE_SIZE.DOUBLEINTERNAL&&t>2&&(d=Math.ceil((t-1)/2)+1),p.getPage(d,i).then(function(o){!function(t,n,i,o){var a=c.options.forceFit,r=c.options.pageSize==e.PAGE_SIZE.DOUBLEINTERNAL&&n>1&&n<c.pageCount,s=r&&a?2:1,l=a?t.getViewport(1):c.normalViewport,d=c.cacheIndex/Math.max(l.width/s,l.height);1==c.webgl&&(d=k(c.cacheIndex)/(c.pageRatio>1?l.width/s:l.height));var u=document.createElement("canvas"),p=performance.now(),h=c.cacheIndex,f=u.getContext("2d");1==o&&(d=c.thumbsize/c.normalViewport.height),u.height=Math.round(l.height*d),u.width=Math.round(l.width/s*d),"css"==c.targetObject.mode&&Math.abs(c.targetObject.zoomHeight-u.height)<2&&(u.height=c.targetObject.zoomHeight+0,u.width=c.targetObject.zoomWidth+0),l=t.getViewport(d),S("rendering "+n+" at "+u.width+"x"+u.height),r&&(D(c.targetObject)?n%2==0&&(l.transform[4]=-u.width):n%2==1&&(l.transform[4]=-u.width));var g={canvasContext:f,viewport:l};t.cleanupAfterRender=!0,t.render(g).promise.then(function(){S(performance.now()-p),p=performance.now(),1==o||1==c.options.canvasToBlob&&!0!==c.webgl?u.toBlob(function(t){var a=e.createObjectURL(t,"image/jpeg");S(performance.now()-p),c.setCache(n,a,o,h),c.setPage(n,a,i,o)},"image/jpeg",c.pdfRenderQuality):(S("Setting Page "+n),c.setPage(n,u,i,o)),g=null})}(o,t,n,i)})):c.contentSourceType!=u.IMAGE&&c.contentSourceType!=u.HTML||(null!=c.getCache(t,i)?(c.setPage(t,c.getCache(t,i),n,i),S("Page "+t+" loaded from cache")):(!0!==i&&c.setLoading(t,!0),c.options.pageSize==e.PAGE_SIZE.DOUBLEINTERNAL&&t>2&&(d=Math.ceil((t-1)/2)+1),o=p[d-1],a=function(e){c.setCache(t,e,i,c.cacheIndex),c.setPage(t,e,n,i),null!=n&&n()},s=c.isCrossOrigin,(l=new Image).crossOrigin="Anonymous",l.onload=function(){if(1==s){var t=document.createElement("canvas"),n=t.getContext("2d");t.width=l.width,t.height=l.height,n.drawImage(l,0,0),1==r.canvasToBlob?t.toBlob(function(t){var n=e.createObjectURL(t,"image/jpeg");null!=a&&a(n)},"image/jpeg",.85):null!=a&&a(t)}else null!=a&&a(o);l.onload=null,l=null},l.src=o,(l.complete||void 0===l.complete)&&(l.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",l.src=o)))},i.prototype.getTargetPage=function(e){},i.prototype.setLoading=function(e,n){if(null!=this.targetObject)if(1==this.webgl){var i=this.targetObject.container;1==n?!0!==i.isLoading&&(i.addClass("pdff-loading"),i.isLoading=!0,S("Loading icon at "+e+" as "+n)):null!=i.isLoading&&(i.removeClass("pdff-loading"),i.isLoading=null,S("Loading icon at "+e+" as "+n))}else{var o=t(this.targetObject.getContentLayer(e));null!=o&&(1==n?o.addClass("pdff-page-loading"):o.removeClass("pdff-page-loading"),S("Loading icon at "+e+" as "+n))}},i.prototype.getAnnotations=function(n){var i=this;if(0!=i.options.enableAnnotation){var o=i.targetObject;n=parseInt(n,10);var a=i.contentSource,r=t(o.getContentLayer(n));if(r.empty(),n>0&&n<=i.pageCount){if(i.contentSourceType==u.PDF){L(n);var s=n;i.options.pageSize==e.PAGE_SIZE.DOUBLEINTERNAL&&n>2&&(s=Math.ceil((n-1)/2)+1),a.getPage(s).then(function(e){null!=r&&r.length>0&&i.setupAnnotations(e,i.viewport,r,n)})}if(null!=i.links&&null!=i.links[n])for(var l=i.links[n],c=0;c<l.length;c++){var d,p=l[c];p.dest&&p.dest.indexOf&&0==p.dest.indexOf("[html]")?((d=document.createElement("div")).innerHTML=p.dest.substr(6),d.className="
3975customHtmlAnnotation"):((d=document.createElement("a")).setAttribute("dest",p.dest),d.className="customLinkAnnotation",d.href="#"+p.dest,d.onclick=function(){var e=this.getAttribute("dest");return e&&i.linkService.customNavigateTo(e),!1}),d.style.left=p.x+"%",d.style.top=p.y+"%",d.style.width=p.w+"%",d.style.height=p.h+"%",r[0].appendChild(d)}if(null!=i.html&&null!=i.html[n]){var h=i.html[n];r.append(t("<div class='customHTMLAnnotation'>").html(h))}}}},i.prototype.setPage=function(e,t,n,i){var o=this,a=o.targetObject,s=D(a),l=M(a);if(1==i)o.targetObject.container.find("#pdff-thumb"+e).css({backgroundImage:y(t)});else{t==r.textureLoadFallback&&S("Fallback on "+e);var c=a.getPageByNumber(e);null!=c?e%2!=0&&!s||e%2!=1&&s&&!l||l&&!s?(S(e+"rendered to back of "+c.color),c.backImage(t,function(t,i){c.backTextureLoaded=!0,o.setLoading(e),o.requiresImageTextureScaling&&i&&1!=e&&e!=o.pageCount&&(i.repeat.x=.5,i.offset.x=.5),null!=n&&n()})):(S(e+"rendered to front of "+c.color),c.frontImage(t,function(t,i){c.frontTextureLoaded=!0,o.setLoading(e),o.requiresImageTextureScaling&&i&&1!=e&&e!=o.pageCount&&(i.repeat.x=.5),null!=n&&n()})):S("Invalid set request on Page "+e)}},i.prototype.setupAnnotations=function(n,i,o,a){if(null!=o&&0!=t(o).length){var r=this;return n.getAnnotations().then(function(s){if(i=i.clone({dontFlip:!0}),r.options.pageSize,e.PAGE_SIZE.DOUBLEINTERNAL,null!=o){0==(o=t(o)).find(".annotationDiv").length&&o.append(t("<div class='annotationDiv'>"));var l=o.find(".annotationDiv");l.empty(),r.options.pageSize==e.PAGE_SIZE.DOUBLEINTERNAL&&a>2&&a%2==1?l.css({left:"-100%"}):1==a&&l.css({left:""}),PDFJS.AnnotationLayer.render({annotations:s,div:l[0],page:n,viewport:i,linkService:r.linkService}),r.options.annotationClass&&""!==r.options.annotationClass&&l.find(" > section").addClass(r.options.annotationClass)}})}},i}(),W=function(){function n(e){this.angles=e.angles||[0,0,0,0,0,0],this.stiffness=e.angles||.1,this.segments=e.segments||1,this.canvasMode=e.contentSourceType!==u.IMAGE&&0==e.canvasToBlob,this.initDOM()}function i(e){var n=e.contentLayer=t(f.div,{class:"pdff-page-content"});e.append(n)}return n.prototype={initDOM:function(){var e=this.element=t(f.div,{class:"ppdff-flipbook-page"}),n=this.wrapper=t(f.div,{class:"pdff-page-wrapper"}),o=this.front=t(f.div,{class:"pdff-page-front"}),a=this.back=t(f.div,{class:"pdff-page-back"}),r=this.foldInnerShadow=t(f.div,{class:"pdff-page-fold-inner-shadow"}),s=this.foldOuterShadow=t(f.div,{class:"pdff-page-fold-outer-shadow"});this.frontIMG=new Image,this.backIMG=new Image,i(o,this.segments),i(a,this.segments),e.append(n).append(s),n.append(o).append(a).append(r)},updatePoint:function(t){if(null!=t){var n=null!=this.parent.dragPage?this.parent.dragPage:null!=t.page?t.page:this,i=n.element.width(),o=n.element.height(),a=null!=this.parent.corner?this.parent.corner:t.corner,r=e.CORNERS,s=n.side==p.right,l=a==r.BL||a==r.BR;t.rx=1==s?2*i-t.x:t.x,t.ry=1==l?o-t.y:t.y;var c=Math.atan2(t.ry,t.rx);c=Math.PI/2-P(c,0,m(90));var d=s?t.x/2:i-t.x/2,u=t.ry/2,h=Math.max(0,Math.sin(c-Math.atan2(u,d))*x(d,u)),f=.5*x(t.rx,t.ry),g=Math.round(i-h*Math.sin(c)),y=Math.round(h*Math.cos(c)),C=v(c),E=l?s?90-C+180:180+C:s?C:90-C,S=l?s?90-C+180:C:s?C+180:E,k=l?s?90-C:C+90:s?E-90:E+180,T=s?i-g:g,L=l?o+y:-y,O=s?-g:g-i,I=l?-o-y:y,M=P(.5*t.distance/i,0,.5),D=P(.5*(2*i-t.rx)/i,.05,.3);n.element.addClass("pdff-folding");var F=s?n.back:n.front,z=s?n.front:n.back,N=n.foldOuterShadow,A=n.foldInnerShadow;n.wrapper.css({transform:b(T,L)+w(E)}),F.css({transform:w(-E)+b(-T,-L)}),z.css({transform:w(S)+b(O,I),boxShadow:"rgba(0, 0, 0, "+M+") 0px 0px 20px"}),A.css({transform:w(S)+b(O,I),opacity:D/2,backgroundImage:R.css+"linear-gradient( "+k+"deg, rgba(0, 0, 0, 0.25) , rgb(0, 0, 0) "+.7*f+"px, rgb(255, 255, 255) "+f+"px)"}),N.css({opacity:D/2,left:s?"auto":0,right:s?0:"auto",backgroundImage:R.css+"linear-gradient( "+(180-k)+"deg, rgba(0, 0, 0,0) "+f/3+"px, rgb(0, 0, 0) "+f+"px)"})}},updateAngle:function(e,t){var n=5*this.element.width();this.wrapper.css({perspective:n,perspectiveOrigin:1==t?"0% 50%":"100% 50%"}),this.front.css({display:1==t?e<=-90?"block":"none":e<90?"block":"none",transform:("MfS"!==R.dom?"":"perspective("+n+"px) ")+(1==t?"translateX(-100%) ":"")+"rotateY("+((1==t?180:0)+e)+"deg)"}),this.back.css({display:1==t?e>-90?"block":"none":e>=90?"block":"none",transform:("MSd"!==R.dom?"":"perspective("+n+"px) ")+(0==t?"translateX(100%) ":"")+"rotateY("+((0==t?-180:0)+e)+"deg)"})},tween:function(t){var n=this;if(null!=n&&null!=n.parent){var i,o=M(n.parent),a=n.side==p.right,r=n.parent.direction==e.DIRECTION.RTL,s=n.parent.corner==e.CORNERS.BL||n.parent.corner==e.CORNERS.BR,l=1==n.magnetic,c=s?n.parent.height:0,d=0,u=n.end=n&&1==n.animateToReset?{x:a?n.parent.fullWidth:0,y:c}:{x:a?0:n.parent.fullWidth,y:c};n.ease=n.isHard?TWEEN.Easing.Quadratic.InOut:TWEEN.Easing.Linear.None;var h=n.parent.duration;1==n.isHard?(null!=t&&(d=E(t.distance,t.fullWidth)),i=n.init={angle:d*(a?-1:1)},u=n.end=n&&1==n.animateToReset?{angle:a?0:-0}:{angle:a?-180:180}):null==t?(i=n.init=n&&1==n.animateToReset?{x:a?0:n.parent.fullWidth,y:0}:{x:a?n.parent.fullWidth:0,y:0},n.first={x:(a?3:1)*n.parent.fullWidth/4,y:0},n.mid={x:(a?1:3)*n.parent.fullWidth/4,y:0}):(i=n.init={x:t.x,y:t.y,opacity:1},n.first={x:3*t.x/4,y:3*t.y/4,opacity:1},n.mid={x:t.x/4,y:t.y/4,opacity:1},h=n.parent.duration*C(i.x,i.y,u.x,u.y)/n.parent.fullWidth,h=P(h,n.parent.duration/3,n.parent.duration)),i.index=0,u.index=1,n.isFlipping=!0;var f=function(e){1==n.isHard?(n.updateAngle(e.angle,a),n.angle=e.angle):(n.updatePoint({x:e.x,y:e.y}),n.x=e.x,n.y=e.y),o&&!l&&(n.element[0].style.opacity=a&&!r||!a&&r?e.index>.5?2*(1-e.index):1:e.index<.5?2*e.index:1)};o&&(!a&&!r||a&&r)&&(n.element[0].style.opacity=0),n.completeTween=n.completeTween||function(t){n.isFlipping=!1,1==n.isHard?(n.updateAngle(n.end.angle),n.back.css({display:"block"}),n.front.css({display:"block"})):n.updatePoint({x:n.end.x,y:n.end.y}),n.element[0].style.opacity=1,!0!==n.animateToReset?n.side=n.side==p.right?p.left:p.right:n.animateToReset=null,n.currentTween=null,n.pendingPoint=null,n.magnetic=!1,n.parent.dragPage=null,n.parent.corner=e.CORNERS.NONE,1!=t&&n.parent.refresh()},1==n.isHard?n.currentTween=new TWEEN.Tween(i).delay(0).to(u,n.parent.duration).onUp
3975date(function(){f(this)}).easing(n.ease).onComplete(n.completeTween).start():null==t?n.currentTween=new TWEEN.Tween(i).delay(0).to(u,n.parent.duration).onUpdate(function(){f(this)}).easing(TWEEN.Easing.Sinusoidal.Out).onComplete(n.completeTween).start():(n.currentTween=new TWEEN.Tween(i).delay(0).to(u,h).onUpdate(function(){f(this)}).easing(TWEEN.Easing.Sinusoidal.Out).onComplete(n.completeTween),n.currentTween.start())}},frontImage:function(e,n){var i=this;function o(){i.front.css({backgroundImage:y(e)}),null!=n&&n()}1==i.canvasMode?(i.front.find(">canvas").remove(),e!==r.textureLoadFallback&&i.front.append(t(e)),null!=n&&n()):e==r.textureLoadFallback?o():(i.frontIMG.onload=o,i.frontIMG.src=e)},backImage:function(e,n){var i=this;function o(){i.back.css({backgroundImage:y(e)}),null!=n&&n()}1==i.canvasMode?(i.back.find(">canvas").remove(),e!==r.textureLoadFallback&&i.back.append(t(e)),null!=n&&n()):e==r.textureLoadFallback?o():(i.backIMG.onload=o,i.backIMG.src=e)},updateCSS:function(e){this.element.css(e)},resetCSS:function(){this.wrapper.css({transform:""}),this.front.css({transform:"",boxShadow:""}),this.back.css({transform:"",boxShadow:""})},clearTween:function(e){this.currentTween.stop(),this.completeTween(1==e),this.resetCSS()}},n}(),G=function(n){function i(e){for(var t=!1,n=0;n<e.pages.length;n++)if(1==e.pages[n].isFlipping){t=!0;break}return t}function o(n,o){var a=this;function r(e){a.dragPage!=e.page&&1==e.page.visible&&(a.dragPage.clearTween(!0),a.dragPage=e.page,a.corner=e.corner,a.dragPage.pendingPoint=e)}a.type="BookCSS",a.images=n.images||[],a.pageCount=n.pageCount||2,a.foldSense=50,a.stackCount=4,a.mode="css",a.pages=[],a.duration=n.duration,a.container=t(o),a.options=n,a.drag=p.none,a.pageCount=1==a.pageCount?a.pageCount:2*Math.ceil(a.pageCount/2),a.pageMode=n.pageMode||(F||a.pageCount<=2?e.PAGE_MODE.SINGLE:e.PAGE_MODE.DOUBLE),a.singlePageMode=n.singlePageMode||(F?e.SINGLE_PAGE_MODE.BOOKLET:e.SINGLE_PAGE_MODE.ZOOM),a.swipe_threshold=F?15:50,a.direction=n.direction||e.DIRECTION.LTR,a.startPage=1,a.endPage=a.pageCount,a._activePage=n.openPage||a.startPage,a.hardConfig=n.hard,s="WebKitCSSMatrix"in window||document.body&&"MozPerspective"in document.body.style,a.animateF=function(){TWEEN.getAll().length>0?TWEEN.update():clearInterval(a.animate)},a.init(n),a.skipDrag=!1;var l=function(t){var n=a.eventToPoint(t);if(null!=t.touches&&2==t.touches.length&&null!=a.startTouches){a.zoomDirty=!0;var o=d.getVectorAvg(d.getTouches(t,a.container.offset())),r=d.calculateScale(a.startTouches,d.getTouches(t));a.lastScale,a.contentProvider.zoomScale,o.x,o.y,a.stage.css({transform:"translate3d("+a.left+"px,"+a.top+"px,0) scale3d("+r+","+r+",1)"}),a.lastScale=r,a.lastZoomCenter=o,t.preventDefault()}if(!(null!=t.touches&&t.touches.length>1||null==a.startPoint||null!=a.startTouches)){var s=a.dragPage||n.page;if(1!==a.contentProvider.zoomScale)null==t.touches&&1!=a.isPanning||(a.pan(n),t.preventDefault());else if(!0!==a.skipDrag&&(n.distance,!i(a))){if(null!=a.dragPage||1==n.isInside){null!=a.dragPage?S("set mouse down move"):(n.y=P(n.y,1,a.height-1),n.x=P(n.x,1,n.fullWidth-1));var l=a.corner||n.corner;if(s.isHard){var c=l==e.CORNERS.BR||l==e.CORNERS.TR,u=E(n.distance,n.fullWidth);s.updateAngle(u*(c?-1:1),c)}else s.updatePoint(n,a);s.magnetic=!0,s.magneticCorner=n.corner,t.preventDefault()}if(null==a.dragPage&&null!=s&&0==n.isInside&&1==s.magnetic&&(s.pendingPoint=n,s.animateToReset=!0,a.corner=s.magneticCorner,a.animatePage(s),s.pendingPoint=null,s.magnetic=!1,s.magneticCorner=null),1==a.isPanning&&null==a.dragPage&&1==a.contentProvider.zoomScale){var h=n.x-a.lastPos;performance.now(),a.lastTime,Math.abs(h)>a.swipe_threshold&&(h<0?a.next():a.prev(),a.drag=p.none,a.isPanning=!1,t.preventDefault()),a.lastPos=n.x,a.lastTime=performance.now()}}}},c=function(t){if(null!=t.touches&&0==t.touches.length&&(a.contentProvider.zoomScale,1==a.zoomDirty&&(a.previewObject.contentProvider.zoomScale=d.limitAt(a.previewObject.contentProvider.zoomScale*a.lastScale,1,a.previewObject.contentProvider.maxZoom),a.previewObject.zoomValue=1*a.previewObject.contentProvider.zoomScale,a.previewObject.resize(),a.zoomDirty=!1),a.wrapper.css({transform:""}),a.lastScale=null,a.startTouches=null),a.isPanning=!1,!(null!=t.touches&&t.touches.length>1)&&!0!==a.skipDrag){var n=a.eventToPoint(t);a.dragPage&&(t.preventDefault(),a.dragPage.pendingPoint=n,n.x==a.startPoint.x&&n.y==a.startPoint.y&&1==n.isInside?a.corner==e.CORNERS.BR||a.corner==e.CORNERS.TR?(r(n),!0!==a.dragPage.isFlipping&&a.next()):a.corner!=e.CORNERS.BL&&a.corner!=e.CORNERS.TL||(r(n),!0!==a.dragPage.isFlipping&&a.prev()):!0!==a.dragPage.isFlipping&&(n.distance>n.fullWidth/2?n.x>n.fullWidth/2?a.prev():a.next():(a.dragPage.animateToReset=!0,a.animatePage(a.dragPage))),a.dragPage&&(a.dragPage.pendingPoint=null,a.dragPage.magnetic=!1)),a.drag=p.none}},u=function(t){var n=a.eventToPoint(t),i=t.srcElement||t.originalTarget;a.dragPage&&a.dragPage.magnetic||a.wrapper[0].contains(t.target)&&1==a.contentProvider.zoomScale&&n.x==a.startPoint.x&&n.y==a.startPoint.y&&n.isInsidePage&&a.startPoint.page==n.page&&!n.page.isFlipping&&"A"!==i.nodeName&&(0==a.startPoint.page.side?(a.corner=e.CORNERS.TL,a.prev(),a.startPoint.page=null):(a.corner=e.CORNERS.TR,a.next(),a.startPoint.page=null),a.isPanning=!1)},h=function(t){if(null!=t.touches&&2==t.touches.length&&null==a.startTouches&&(a.startTouches=d.getTouches(t),a.lastScale=1),!(null!=t.touches&&t.touches.length>1||null==t.touches&&0!==t.button)){var n,o=a.eventToPoint(t);a.startPoint=o,a.left=a.left||0,a.top=a.top||0,a.isPanning=!0,a.lastPos=o.x,a.lastTime=performance.now(),!0!==a.skipDrag&&(1!=o.isInside||i(a)||(a.startPoint=o,a.drag=o.drag,a.dragPage=o.page,a.corner=o.corner,S(a.corner),(n=a.dragPage).parent.container.find(".pdff-folding").removeClass("pdff-folding"),n.element.addClass("pdff-folding"),o.page.isHard||o.page.updatePoint(o,a),"0"==o.page.name?a.shadow.css({width:"50%",left:a.direction==e.DIRECTION.RTL?0:"50%",transitionDelay:""}):o.page.name==Math.ceil(a.pageCount/2)-1&&a.shadow.css({width:"50%",left:a.direction==e.DIRECTION.RTL?"50%":0,transitionDelay:""})))}},f=function(e){var t=0;null!=e.wheelDelta?t=e.wheelDelta/120:null!=e.detail&&(t=-e.detail/3);var n=a.contentProvider.zoomScale,i=a.contentProvider.maxZoom;if(t&&(t>0&&n<i||t<0&&n>1)){e.stopPropagation(),e.preventDefault();var o=a.eventToPoint(e),r=a.eventToPoint(e),s=a.container.width()/2,l=a.container.height()/2-23;a.previewObject.zoom(t);var c=a.contentProvider.zoomScale;if(n!==c){var d=c/n;1==c?(a.left=0,a.top=0):(a.left*=d,a.top*=d);var u=(o.raw.x-s)*d,p=(o.raw.y-l)*d;r.raw.x=s+u,r.raw.y=l+p,a.startPoint=r,a.pan(o);var h=a.dragPage||o.page;null==a.dragPage&&null!=h&&1==o.isInside&&1==h.magnetic&&(h.pendingPoint=o,h.animateToReset=!0,a.corner=h.magneticCorner,a.animatePage(h),h.pendingPoint=null,h.magnetic=!1,h.magneticCorner=null)}}},g=a.container[0],m=a.stage[0];g&&(m.addEventListener("mousemove",l,!1),m.addEventListener("touchmove",l,!1),m.addEventListener("mousedown",h,!1),m.addEventListener("click",u,!1),m.addEventListener("mouseup",c,!1),m.addEventListener("touchend",c,!1),m.addEventListener("touchstart",h,!1),1==a.options.scrollWheel&&(m.addEventListener("mousewheel",f,!1),m.addEventListener("DOMMouseScroll",f,!1))),this.dispose=function(){m.removeEventListener("mousemove",l,!1),m.removeEventListener("touchmove",l,!1),m.removeEventListener("mousedown",h,!1),m.removeEventListener("click",u,!1),m.removeEventListener("mouseup",c,!1),m.removeEventListener("touchend",c,!1),m.removeEventListener("touchstart",h,!1),1==a.options.scrollWheel&&(m.removeEventListener("mousewheel",f,!1),m.removeEventListener("DOMMouseScroll",f,!1)),a.updatePageCallback=null,a.flipCallback=null,a.animateF=null,a.stage.remove()}}return B(o,{}),o.prototype={add:function(e){e instanceof W?this.container.append(t(e.element)):this.container.append(t(e))},pan:function(e){var t=this.startPoint,n=this.contentProvider.zoomScale,i=this.left+(e.raw.x-t.raw.x),o=this.top+(e.raw.y-t.raw.y);this.left=Math.round(P(i,-this.shiftWidth,this.shiftWidth)),this.top=Math.round(P(o,-this.shiftHeight,this.shiftHeight)),1==n&&(this.left=0,this.top=0),this.startPoint=e,this.stage.css({transform:"translate3d("+this.left+"px,"+this.top+"px,0)"})},getPageByNumber:function(e){for(var t,n=M(this)?D(this)?e+1:e:Math.floor((e-1)/2),i=0;i<this.pages.length;i++)n==parseInt(this.pages[i].name,10)&&(t=this.pages[i]);return t},getPageSide:function(t){var n=this.direction==e.DIRECTION.RTL,i=this.getPageByNumber(t);if(null!=i)return M(this)?n?i.front:i.back:t%2==0?n?i.back:i.front:n?i.front:i.back},getContentLayer:function(e){var t=this.getPageSide(e);return null==t?null:t.contentLayer}},o.prototype.init=function(e){var n=this;
3975n.stage=t(f.div,{class:"ppdff-flipbook-stage"}),n.wrapper=t(f.div,{class:"ppdff-flipbook-wrapper"}),n.shadow=t(f.div,{class:"ppdff-flipbook-shadow"}),n.container.append(n.stage),n.stage.append(n.wrapper),n.wrapper.append(n.shadow),n.createStack(e)},o.prototype.createStack=function(e){for(var t="red,green,blue,yellow,orange,black".split(","),n=0;n<this.stackCount;n++){e.angles=[,this.stackCount-n],e.stiffness=(this.stackCount-n)/100;var i=new W(e);i.angles[1]=180,i.index=n,i.parent=this,i.textureReady=!1,i.textureRequested=!1,this.wrapper.append(i.element),i.isFlipping=!1,this.pages.push(i),i.color=t[n]}this.children=this.pages},o.prototype.isPageHard=function(e){return d.isHardPage(this.hardConfig,e,this.pageCount,M(this))},o.prototype.setDuration=function(e){this.duration=e},o.prototype.moveBy=function(e){var t=this._activePage+e;t=P(t,this.startPage,this.endPage),this.gotoPage(t)},o.prototype.next=function(t){null==t&&(t=this.direction==e.DIRECTION.RTL?-this.pageMode:this.pageMode),this.moveBy(t)},o.prototype.prev=function(t){null==t&&(t=this.direction==e.DIRECTION.RTL?this.pageMode:-this.pageMode),this.moveBy(t)},o.prototype.eventToPoint=function(n){n=I(n);var i=this.wrapper,o=this.pages,a=this.pageWidth,r=this.fullWidth,s=this.height,l=(t(window),{x:n.clientX,y:n.clientY}),c=l.x-i[0].getBoundingClientRect().left,d=l.y-i[0].getBoundingClientRect().top;l.x=l.x-this.container[0].getBoundingClientRect().left,l.y=l.y-this.container[0].getBoundingClientRect().top;var u,h=this.drag==p.none?c<a?c:r-c:this.drag==p.left?c:r-c,f=c<a?o[this.stackCount/2-1]:o[this.stackCount/2],g=c<this.foldSense?p.left:c>r-this.foldSense?p.right:p.none,m=c,v=d,b=s,w=r,y=this.foldSense,P=e.CORNERS;return u=m>=0&&m<y?v>=0&&v<=y?P.TL:v>=b-y&&v<=b?P.BL:v>y&&v<b-y?P.L:P.NONE:m>=w-y&&m<=w?v>=0&&v<=y?P.TR:v>=b-y&&v<=b?P.BR:v>y&&v<b-y?P.R:P.NONE:P.NONE,{isInsidePage:m>=0&&m<=w&&v>=0&&v<=b,isInside:u!==P.NONE&&u!==P.L&&u!==P.R,x:c,y:d,fullWidth:r,rawDistance:r-c,distance:h,page:f,drag:g,foldSense:this.foldSense,event:n,raw:l,corner:u}},o.prototype.gotoPage=function(e){e=parseInt(e,10),this._activePage=e,1==this.autoPlay&&this.previewObject.setAutoPlay(this.autoPlay),this.updatePage(e),this&&this.thumblist&&this.thumblist.review&&this.thumblist.review()},o.prototype.refresh=function(){this.updatePage(this._activePage),null!=this.flipCallback&&this.flipCallback()},o.prototype.updatePage=function(n){var i=this.direction==e.DIRECTION.RTL,o=M(this),a=(L(n),o?1:2);n=Math.floor(n/a),i&&(n=this.pageCount/a-n);var s=this.oldBaseNumber||0,l=this.pageCount/a,c=this.stackCount,d=Math.floor(c/2);s>n?(this.children[c-1].skipFlip=!0,this.children.unshift(this.children.pop())):s<n&&(this.children[0].skipFlip=!0,this.children.push(this.children.shift()));for(var u=0;u<c;u++){var h=this.children[u];s!==n&&null!=h.currentTween&&h.clearTween(!0);var f,g=h.side,m=n-d+u;i&&(m=o?this.pageCount-m:Math.floor(this.pageCount/2)-m-1);var v=h.name;h.isHard=this.isPageHard(m),h.isHard?h.element.addClass("pdff-hard-page"):(h.element.removeClass("pdff-hard-page"),h.front.css({display:"block"}),h.back.css({display:"block"})),0==m||m==l?h.element.addClass("pdff-cover-page"):h.element.removeClass("pdff-cover-page"),t(h.element).attr("pageNumber")!=m&&(h.front.contentLayer.empty(),h.back.contentLayer.empty()),t(h.element).attr("pageNumber",m),h.isEdge=!1,0==u||u==c-1||(h.isEdge=!1),f=u<d?p.left:p.right,0==h.isFlipping&&(f!==g&&0==h.skipFlip?(this.animatePage(h),null!=this.preFlipCallback&&this.preFlipCallback()):(h.skipFlip=!1,h.element.removeClass("pdff-flipping pdff-quick-turn pdff-folding pdff-left-side pdff-right-side"),h.element.addClass(u<d?"pdff-left-side":"pdff-right-side"),h.side=f)),h.visible=o?i?u<d||h.isFlipping:u>=d||h.isFlipping:m>=0&&m<l||o&&m==l,null!=this.requestPage&&1==h.visible&&(h.name=m.toString(),h.name!=v&&(h.backTextureLoaded=!1,h.frontTextureLoaded=!1,h.backPageStamp="-1",h.frontPageStamp="-1",h.thumbLoaded=!1,h.front.contentLayer.html(""),h.back.contentLayer.html(""),h.frontImage(r.textureLoadFallback),h.backImage(r.textureLoadFallback),this.requestPage())),h.oldDepth=h.depth,h.updateCSS({display:1==h.visible?"block":"none",zIndex:6+(u<d?u-d:d-u),transform:""}),null==h.pendingPoint&&0==h.isFlipping&&h.resetCSS()}0==TWEEN.getAll().length&&clearInterval(this.animate),t(".quick-hint").html(n),this.oldBaseNumber=n,this.updatePageCallback&&this.updatePageCallback()},o.prototype.animatePage=function(e){e.element.addClass("pdff-flipping"),e.isFlipping=!0,null!=this.animate&&clearInterval(this.animate),this.animate=setInterval(this.animateF,30),e.tween(e.pendingPoint)},o}(),V=function(n){function i(i,o,a){n.call(this,a);var r=this;r.type="FlipBook",r.container=i,r.options=a,r.options.source=o,r.contentSource=o,null!=a.height&&a.height.toString().indexOf("%")<0?r.container.height(Math.min(a.height,t(window).height())):r.container.height(a.height),r.options.isLightBox&&window.dfLightBox.closeButton.addClass(r.options.icons.close),r.options.pageSize==e.PAGE_SIZE.DOUBLEINTERNAL&&((Array===r.contentSource.constructor||Array.isArray(r.contentSource)||r.contentSource instanceof Array)&&(r.options.singlePageMode=e.SINGLE_PAGE_MODE.ZOOM),r.container.addClass("pdff-double-internal")),r.options.isLightBox||null==r.container.attr("id")||(r.options.id=r.container.attr("id")),!0!==r.options.parsed&&null!=r.options.links&&e.parseLinks(r.options.links);var s=r.webgl=1==a.webgl&&1==z;
3975if(i.addClass("pdff-container pdff-loading pdff-init pdff-floating pdff-controls-"+r.options.controlsPosition),1==r.options.transparent&&i.addClass("pdff-transparent"),r.options.direction==e.DIRECTION.RTL&&i.addClass("pdff-rtl"),r.container.info=t(f.div,{class:"loading-info"}).appendTo(r.container).html("Loading..."),(-1!==c.indexOf("MSIE")||navigator.appVersion.indexOf("Trident/")>0||N&&!A)&&(r.options.webgl=!1),c.match(/msie\\s[5-9]/i))return r.container.info.html("Your browser (Internet Explorer) is out of date to run pdfflip Flipbook Plugin. <br><a href='http://browsehappy.com/'>Upgrade to a new one</a>").addClass("pdff-old-browser"),i.removeClass("pdff-loading"),r;var l=null==a.backgroundImage||""==a.backgroundImage?"":"url('"+a.backgroundImage+"')";return r.container.css({position:"relative",overflow:"hidden",backgroundColor:a.backgroundColor,backgroundImage:l}),r.init(s,o),null!=r.options.onCreate&&r.options.onCreate(r),r}return B(i,n),i.prototype.init=function(n){var i,o,a=this,s=a.target,l=a.options;1==n?(i=function(){a.container.css({minHeight:300,minWidth:300}),a.stage=new _(T(a.options,{container:a.container})),a.stage.previewObject=a,a.contentProvider=new H(a.contentSource,function(i){var o={pageCount:i.pageCount,stackCount:6,segments:20,width:i.bookSize.width,height:i.bookSize.height};a.checkOpenPage(),a.target=s=a.stage.target=new MOCKUP.Book(T(a.options,o),a.stage),a.extendtarget(),j(a.container,a),s.ui=a.ui,s.container=a.container,i.webgl=n,i.setTarget(a.target),s.getContentLayer=function(t){var n=s.direction==e.DIRECTION.RTL,i=a.stage.cssScene.divLeft.element,o=a.stage.cssScene.divRight.element;return L(s._activePage),M(s)?n?i:o:t%2==0?n?o:i:n?i:o},s.stage=a.stage,s.flipCallback=function(){if(a.contentProvider){a.contentProvider.review("flipCallback");var n,i,o=L(s._activePage),r=s.getPageByNumber(o),l=s.getPageByNumber(o+1),c=s.parent.cssScene.divLeft,d=s.parent.cssScene.divRight;s.pageMode,e.PAGE_MODE.SINGLE,s.direction,e.DIRECTION.RTL,null!=r&&null!=c&&(n=Math.abs(r.geometry.boundingBox.max.x-r.geometry.boundingBox.min.x),i=Math.abs(r.geometry.boundingBox.max.z-r.geometry.boundingBox.min.z),c.rotation.y=.9*-Math.atan2(i,n),c.position.z=.8*i,c.position.x=i/2.5,t(c.element).css({width:n,left:-n/2})),null!=l&&null!=d&&(n=Math.abs(l.geometry.boundingBox.max.x-l.geometry.boundingBox.min.x),i=Math.abs(l.geometry.boundingBox.max.z-l.geometry.boundingBox.min.z),d.rotation.y=.9*Math.atan2(i,n),d.position.z=.8*i,d.position.x=-i/2.5,t(d.element).css({width:n,left:n/2})),null!=a.options.onFlip&&a.options.onFlip(a)}},s.resize=void a.resize(),s.updatePageCallback=function(){a.ui.update(),a.checkCenter(),a.stage.renderRequestPending=!0};var r=t(a.stage.cssScene.divLeft.element),l=t(a.stage.cssScene.divRight.element);s.preFlipCallback=function(){r.empty(),l.empty(),null!=a.options.beforeFlip&&a.options.beforeFlip(a),a.playSound()},t(window).trigger("resize"),r.css({width:i.bookSize.width,height:i.bookSize.height,left:-i.bookSize.width/2}),l.css({width:i.bookSize.width,height:i.bookSize.height,left:i.bookSize.width/2}),s.ease=TWEEN.Easing.Cubic.InOut,s.contentProvider=i,s.duration=a.options.duration,s.gotoPage(s._activePage),s.flipCallback(),null!=a.options.onReady&&a.options.onReady(a)},l,a)},o=function(){MOCKUP.defaults.anisotropy=0,MOCKUP.defaults.groundTexture="blank",THREE.skipPowerOfTwo=!0,function(){_=function(e){function n(n){n=n||{};var i=this;e.call(this,n),i.options=n,i.canvas=t(i.renderer.domElement).addClass("pdff-3dcanvas"),i.container=n.container,i.container.append(i.canvas),i.type="PreviewStage",i.mouse=new THREE.Vector2,i.raycaster=new THREE.Raycaster,i.camera.position.set(0,20,600),i.camera.lookAt(new THREE.Vector3(0,0,0)),i.spotLight.position.set(-220,330,550),i.spotLight.castShadow=!F&&n.webglShadow,i.spotLight.shadow&&(i.spotLight.shadow.bias=-8e-4),i.spotLight.intensity=g(n.spotLightIntensity,r.spotLightIntensity),i.ambientLight.color=new THREE.Color(g(n.ambientLightColor,r.ambientLightColor)),i.ambientLight.intensity=g(n.ambientLightIntensity,r.ambientLightIntensity);var o=new THREE.ShadowMaterial;o.opacity=g(n.shadowOpacity,r.shadowOpacity),i.ground.material=o,i.ground.position.z=-2,i.orbitControl.maxAzimuthAngle=0,i.orbitControl.minAzimuthAngle=0,i.orbitControl.minPolarAngle=1.57,i.orbitControl.maxPolarAngle=1.57,i.orbitControl.mouseButtons.ORBIT=THREE.MOUSE.RIGHT,i.orbitControl.mouseButtons.PAN=-1,i.orbitControl.maxDistance=5e3,i.orbitControl.minDistance=50,i.orbitControl.noZoom=!0,i.selectiveRendering=!0,i.orbitControl.zoomSpeed=5,i.orbitControl.ke
3975yPanSpeed=0,i.orbitControl.center.set(0,0,0),i.orbitControl.update(),i.swipe_threshold=F?15:20;var a=i.cssRenderer=new THREE.CSS3DRenderer;t(a.domElement).css({position:"absolute",top:0,pointerEvents:"none"}).addClass("pdff-3dcanvas pdff-csscanvas"),i.container[0].appendChild(a.domElement);var s=i.cssScene=new THREE.Scene,l=document.createElement("div");l.className="pdff-page-content pdff-page-content-left";var c=document.createElement("div");c.className="pdff-page-content pdff-page-content-right";var u=s.divLeft=new THREE.CSS3DObject(l),p=s.divRight=new THREE.CSS3DObject(c);function f(){i.renderRequestPending=!0}s.add(u),s.add(p),i.resizeCallback=function(){a.setSize(i.canvas.width(),i.canvas.height())},window.addEventListener(h.move,f,!1),window.addEventListener("keyup",f,!1),i.dispose=function(){i.clearChild(),i.render(),window.removeEventListener(h.move,f,!1),1==i.options.scrollWheel&&(i.renderer.domElement.removeEventListener("mousewheel",m,!1),i.renderer.domElement.removeEventListener("DOMMouseScroll",m,!1)),window.removeEventListener("keyup",f,!1),i.renderer.domElement.removeEventListener("mousemove",v,!1),i.renderer.domElement.removeEventListener("touchmove",v,!1),i.renderer.domElement.removeEventListener("mousedown",b,!1),i.renderer.domElement.removeEventListener("touchstart",b,!1),i.renderer.domElement.removeEventListener("mouseup",w,!1),i.renderer.domElement.removeEventListener("touchend",w,!1),i.canvas.remove(),a.domElement.parentNode.removeChild(a.domElement),a=null,i.renderCallback=null,i.renderCallback=null,i.orbitControl.dispose(),i.orbitControl=null,i.renderer.dispose(),i.cancelRAF()},i.renderCallback=function(){TWEEN.getAll().length>0&&(i.renderRequestPending=!0),TWEEN.update(),a.render(s,i.camera)};var m=function(e){var t=0;if(null!=e.wheelDelta?t=e.wheelDelta:null!=e.detail&&(t=-e.detail),t){var n=i.previewObject.contentProvider.zoomScale;(t>0&&1==n||t<0&&n>1)&&e.preventDefault(),i.previewObject.zoom(t>0?1:-1)}f()},v=function(e){if(i.renderRequestPending=!0,e=I(e),i.isMouseDown&&0!=e.movementX&&0!=e.movementY&&(i.isMouseMoving=!0),null!=e.touches&&2==e.touches.length&&null!=i.startTouches){i.zoomDirty=!0;var t=d.getVectorAvg(d.getTouches(e,i.container.offset())),n=d.calculateScale(i.startTouches,d.getTouches(e));return i.lastScale,i.previewObject.contentProvider.zoomScale,t.x,t.y,i.camera.position.z=i.originalZ/n,i.lastScale=n,i.lastZoomCenter=t,void e.preventDefault()}if(1==i.isMouseDown&&1==i.previewObject.contentProvider.zoomScale){var o=e.pageX-i.lastPos;performance.now(),i.lastTime,Math.abs(o)>i.swipe_threshold&&(o<0?i.target.next():i.target.prev(),e.preventDefault(),i.isMouseDown=!1),i.lastPos=e.pageX,i.lastTime=performance.now()}},b=function(e){null!=(e=I(e)).touches&&2==e.touches.length&&null==i.startTouches&&(i.startTouches=d.getTouches(e),i.lastScale=1,i.originalZ=1*i.camera.position.z),document.activeElement.blur(),i.mouseValue=e.pageX+","+e.pageY,i.isMouseMoving=!1,i.isMouseDown=!0,i.lastPos=e.pageX,i.lastTime=performance.now()},w=function(e){null!=(e=I(e)).touches&&0==e.touches.length&&(i.previewObject.contentProvider.zoomScale,1==i.zoomDirty&&(i.previewObject.contentProvider.zoomScale=d.limitAt(i.previewObject.contentProvider.zoomScale*i.lastScale,1,i.previewObject.contentProvider.maxZoom),i.previewObject.zoomValue=1*i.previewObject.contentProvider.zoomScale,i.previewObject.resize(),i.zoomDirty=!1),i.lastScale=null,i.startTouches=null),null!=e.touches&&e.touches.length>1||function(e){if(i.isMouseDown=!1,0!==e.button)return this;var n=e.pageX+","+e.pageY;if(i.isMouseMoving);else if(n==i.mouseValue){e=e||window.event,e=t.event.fix(e);var o=i.mouse,a=i.raycaster;o.x=e.offsetX/i.canvas.innerWidth()*2-1,o.y=1-e.offsetY/i.canvas.innerHeight()*2,a.setFromCamera(o,i.camera);var r=a.intersectObjects(i.target instanceof MOCKUP.Bundle?i.target.children:[i.target],!0);if(r.length>0){var s,l=0;do{s=null!=r[l]?r[l].object:null,l++}while((s instanceof THREE.BoxHelper||!(s instanceof MOCKUP.Paper)||1==s.isFlipping)&&l<r.length);null!=s.userData.object||(s.angles[1]>90?1!=s.isEdge&&i.target.next():1!=s.isEdge&&i.target.prev())}}}(e)};return i.renderer.domElement.addEventListener("mousemove",v,!1),i.renderer.domElement.addEventListener("touchmove",v,!1),i.renderer.domElement.addEventListener("mousedown",b,!1),i.renderer.domElement.addEventListener("touchstart",b,!1),i.renderer.domElement.addEventListener("mouseup",w,!1),i.renderer.domElement.addEventListener("touchend",w,!1),1==i.options.scrollWheel&&(i.renderer.domElement.addEventListener("mousewheel",m,!1),i.renderer.domElement.addEventListener("DOMMouseScroll",m,!1)),t(i.renderer.domElement).css({display:"block"}),t(window).trigger("resize"),this}return B(n,e),n.prototype.width=function(){return this.container.width()},n.prototype.height=function(){return this.container.height()},n}(MOCKUP.Stage),MOCKUP.PreviewStage=_;var n=function(t){function n(e,n){(e=e||{}).folds=1,t.call(this,e,n),this.angle=0,this.isFlipping=!1,this.material.materials[5].transparent=!0,this.material.materials[4].transparent=!0,this.type="BookPaper"}return B(n,t),n.prototype.tween=function(t,n){var i=this;i.originalStiff=i.stiffness;
3975var o=i.newStiffness,a=M(i.parent),r=n-t,s=t>90,l=i.parent.direction==e.DIRECTION.RTL;i.init={angle:t,angle2:t<90?0:180,stiff:i.originalStiff,index:s&&!l||!s&&l?1:0},i.first={angle:t+r/4,angle2:90,stiff:i.originalStiff,index:s&&!l||!s&&l?1:.25},i.mid={angle:t+2*r/4,angle2:t<90?135:45,stiff:i.newStiffness,index:.5},i.mid2={angle:t+3*r/4,angle2:t<90?180:0,stiff:i.newStiffness,index:s&&!l||!s&&l?.25:1},i.end={angle:n,angle2:t<90?180:0,stiff:i.newStiffness,index:s&&!l||!s&&l?0:1},i.isFlipping=!0,a&&(!s&&!l||s&&l)&&(i.material.materials[5].opacity=i.material.materials[4].opacity=0,i.castShadow=!1),i.currentTween=new TWEEN.Tween(i.init).to({angle:[i.first.angle,i.mid.angle,i.mid2.angle,i.end.angle],angle2:[i.first.angle2,i.mid.angle2,i.mid2.angle2,i.end.angle2],stiff:[i.first.stiff,i.mid.stiff,i.mid2.stiff,i.end.stiff],index:[i.first.index,i.mid.index,i.mid2.index,i.end.index]},i.parent.duration).onUpdate(function(e){var t;t=this,i.angles[1]=t.angle,i.angles[4]=i.isHard?t.angle:t.angle2,1==i.isHard?i.stiffness=0:(i.stiffness=t.stiff/(o+1e-5)*(i.newStiffness+1e-5),i.stiffness=isNaN(i.stiffness)?0:t.stiff),a&&(i.material.materials[5].opacity=i.material.materials[4].opacity=t.index,i.castShadow=t.index>.5),i.updateAngle(!0)}).easing(TWEEN.Easing.Sinusoidal.Out).onComplete(function(e){i.stiffness=i.newStiffness,i.updateAngle(),i.material.materials[5].opacity=i.material.materials[4].opacity=1,i.castShadow=!0,i.isFlipping=!1,i.parent&&i.parent.refresh&&i.parent.refresh()}).start()},n}(MOCKUP.FlexBoxPaper);MOCKUP.BookPaper=n;var i=function(t){function n(n,i){(n=n||{}).segments=n.segments||50,this.pageCount=n.pageCount,this.height=n.height,this.width=n.width,this.pageCount=1==this.pageCount?this.pageCount:2*Math.ceil(this.pageCount/2),this.direction=n.direction||e.DIRECTION.LTR,this.startPage=1,this.endPage=this.pageCount,this.stackCount=n.stackCount||6,this.materials=[],t.call(this,n,i),this.angles=[0,0,0,0,0,0],this.stiffness=null==n.stiffness?1.5:n.stiffness,this.hardConfig=n.hard,this._activePage=n.openPage||this.startPage,this.createStack(n),this.pageMode=n.pageMode||(F||this.pageCount<=2?e.PAGE_MODE.SINGLE:e.PAGE_MODE.DOUBLE),this.singlePageMode=n.singlePageMode||(F?e.SINGLE_PAGE_MODE.BOOKLET:e.SINGLE_PAGE_MODE.ZOOM),this.type="Book"}return B(n,t),n.prototype.getPageByNumber=function(e){var t=M(this)?D(this)?e+1:e:Math.floor((e-1)/2);return this.getObjectByName(t.toString())},n.prototype.isPageHard=function(e){return d.isHardPage(this.hardConfig,e,this.pageCount)},n.prototype.activePage=function(e){if(null==e)return this._activePage;this.gotoPage(e)},n.prototype.gotoPage=function(e){e=parseInt(e,10),this._activePage=e,1==this.autoPlay&&this.previewObject.setAutoPlay(this.autoPlay),this.updatePage(e),this&&this.thumblist&&this.thumblist.review&&this.thumblist.review()},n.prototype.moveBy=function(e){var t=this._activePage+e;t=P(t,this.startPage,this.endPage),this.gotoPage(t)},n.prototype.next=function(t){null==t&&(t=this.direction==e.DIRECTION.RTL?-this.pageMode:this.pageMode),this.moveBy(t)},n.prototype.prev=function(t){null==t&&(t=this.direction==e.DIRECTION.RTL?this.pageMode:-this.pageMode),this.moveBy(t)},n.prototype.updateAngle=function(){for(var e=this.angles[1],t=this.angles[4]-e,n=this.stackCount,i=0;i<n;i++){var o=this.children[i];o.angles[1]=e+i*t/(100*n),o.stiffness=this.stiffness,o.updateAngle()}},n.prototype.refresh=function(){this.updatePage(this._activePage),null!=this.flipCallback&&this.flipCallback()},n.prototype.updatePage=function(t){var n=this.direction==e.DIRECTION.RTL,i=M(this),o=(L(t),i?1:2);t=Math.floor(t/o),n&&(t=this.pageCount/o-t);var a=this.oldBaseNumber||0,s=this.pageCount/o,l=this.stackCount,c=i?0:(.5-Math.abs(s/2-t)/s)/this.stiffness,d=Math.floor(l/2),u=!1;a>t?(u=!0,this.children[l-1].skipFlip=!0,this.children.unshift(this.children.pop())):a<t&&(this.children[0].skipFlip=!0,this.children.push(this.children.shift()));for(var p=5/s,h=p*t/2,f=p*(s-t)/2,g=h<f?f:h,m=0;m<l;m++){var v,b=this.children[m],w=(b.color,b.angles[1]),y=t-d+m;n&&(y=i?this.pageCount-y:Math.floor(this.pageCount/2)-y-1);var P=b.isHard=this.isPageHard(y),x=b.name;b.isEdge=!1,0==m?b.depth=h<.4?.4:h:m==l-1?b.depth=f<.4?.4:f:(b.depth=.4,b.isEdge=!1),1==b.isFlipping&&(b.depth=.4),b.position.x=0;var C=.02*m,E=180-.02*(m-d)+.02*m;if(m<d?(b.newStiffness=P||0==this.stiffness?0:c/(t/s)/4,v=C,b.position.z=g-.4*(-m+d),1==u&&(b.position.z-=.4)):(v=E,b.newStiffness=P||0==this.stiffness?0:c/(Math.abs(s-t)/s)/4,b.position.z=g-.4*(-l+m+d+1)-b.depth),0==b.isFlipping)if(Math.abs(w-v)>20&&0==b.skipFlip){b.depth=.4;var S=b.stiffness;S=w>v?c/(Math.abs(s-t)/s)/4:c/(t/s)/4,b.position.z+=.4,b.stiffness=isNaN(S)?b.stiffness:S,b.updateAngle(!0),b.targetStiffness=P?0:m<t?c/(Math.abs(s-t)/s)/4:c/(t/s)/4,b.targetStiffness=P?0:isNaN(b.targetStiffness)?b.stiffness:b.targetStiffness,b.isFlipping=!0,b.tween(w,v),null!=this.preFlipCallback&&this.preFlipCallback()}else b.skipFlip=!1,b.newStiffness=isNaN(b.newStiffness)?0:b.newStiffness,b.angles[1]==v&&b.stiffness==b.newStiffness&&b.depth==b.oldDepth||(b.angles[1]=b.angles[4]=v,b.stiffness=b.newStiffness,b.updateAngle(!0));b.visible=i?n?m<d||b.isFlipping:m>=d||b.isFlipping:y>=0&&y<s||i&&y==s,null!=this.requestPage&&1==b.visible&&(b.name=y.toString(),b.name!=x&&(b.textureLoaded=!1,b.frontImage(r.textureLoadFallback),b.frontPageStamp="-1",b.frontTextureLoaded=!1,b.thumbLoaded=!1,b.backImage(r.textureLoadFallback),b.backPageStamp="-1",b.backTextureLoaded=!1,this.requestPage())),b.oldDepth=b.depth;var k=Math.abs(b.geometry.boundingBox.max.x)<Math.abs(b.geometry.boundingBox.min.x)?b.geometry.boundingBox.max.x:b.geometry.boundingBox.min.x;b.position.x=1==b.isEdge&&0==b.isFlipping?m<d?k:-k:0}this.oldBaseNumber=t,null!=this.updatePageCallback&&this.updatePageCallback()},n.prototype.createCover=function(e){e.width=2*e.width,this.cover=new MOCKUP.BiFold(e),this.add(this.cover)},n.prototype.createStack=function(e){for(var t="red,green,blue,yellow,orange,black".split(","),n=0;n<this.stackCount;n++){e.angles=[,this.stackCount-n],e.stiffness=(this.stackCount-n)/100;var i=new MOCKUP.BookPaper(e);i.angles[1]=180,i.index=n,i.updateAngle(),i.textureReady=!1,i.textureRequested=!1,this.add(i),i.color=t[n],i.position.z=-1*n}},n.prototype.shininess=function(e){if(null==e)return this.mainObject.
3975shininess();this.mainObject.shininess(e)},n.prototype.bumpScale=function(e){if(null==e)return this.mainObject.bumpScale();this.mainObject.bumpScale(e)},n.prototype.frontImage=function(e){if(null==e)return this.mainObject.frontImage();this.mainObject.frontImage(e)},n.prototype.backImage=function(e){if(null==e)return this.mainObject.backImage();this.mainObject.backImage(e)},n}(MOCKUP.Bundle);MOCKUP.Book=i}(),null!=i&&i()},null==window.MOCKUP?(a.updateInfo("Loading Interface ..."),"function"==typeof define&&define.amd?(requirejs.config({paths:{three:r.threejsSrc.replace(".js","")},shim:{three:{exports:"THREE"}}}),require(["three"],function(t){return window.THREE=t,O(r.utilsSrc+"?ver="+e.version,function(){o()}),t})):O(r.threejsSrc+"?ver="+e.version,function(){O(r.utilsSrc+"?ver="+e.version,function(){o()})})):o()):a.contentProvider=new H(a.contentSource,function(e){var i={pageCount:e.pageCount,contentSourceType:e.contentSourceType};a.checkOpenPage(),a.target=s=new G(T(a.options,i),a.container),a.target.previewObject=a,a.extendtarget(),j(a.container,a),e.webgl=n,e.setTarget(a.target),e.waitPerio
3975d=2,s.ease=TWEEN.Easing.Quadratic.InOut,s.duration=a.options.duration,s.container=a.container,s.updatePageCallback=function(){a.ui.update(),a.checkCenter()},s.resize=void a.resize(),t(window).trigger("resize"),s.flipCallback=function(){a.contentProvider&&(a.contentProvider.review("flipCallback"),null!=a.options.onFlip&&a.options.onFlip(a))},s.preFlipCallback=function(){null!=a.options.beforeFlip&&a.options.beforeFlip(a),a.playSound()},s.gotoPage(s._activePage),s.flipCallback(),null!=a.options.onReady&&a.options.onReady(a)},l,a)},i.prototype.extendtarget=function(){var e=this;e.target.previewObject=e,e.target.reset=function(){for(var t=0;t<e.target.children.length;t++){var n=e.target.children[t];n.skipFlip=!0,n.name="-2"}e.contentProvider.annotedPage="-2",e.target.refresh()}},i.prototype.getURLHash=function(){if(null!=this.options.id){var e="pdfflip-"+(null!=this.options.slug?this.options.slug:this.options.id)+"/";null!=this.target&&null!=this.target._activePage&&(e+=this.target._activePage+"/"),window.location.hash=e}return window.location.href},i.prototype.checkOpenPage=function(){if(null!=this.options.id){var e=t("#"+this.options.id);if(e.length>0&&null!=e.data("page")){var n=parseInt(e.data("page"),10);isNaN(n)||(this.options.openPage=n)}}},i.prototype.end=function(){this.target.gotoPage(this.target.endPage)},i.prototype.gotoPage=function(e){this.target.gotoPage(e),null!=this.ui&&this.ui.update()},i.prototype.prev=function(){this.target.prev()},i.prototype.next=function(){this.target.next()},i.prototype.updateInfo=function(e){this.container&&this.container.info&&this.container.info.html&&this.container.info.html(e)},i}(U);t.fn.extend({shelf:function(){},flipBook:function(e,n){return new V(t(this),e,(i=n,t.extend(!0,{},r,i)));var i}})}(pdfflip,jQuery),function(e){if(e.URL=e.URL||e.webkitURL,e.Blob&&e.URL)try{return void new Blob}catch(e){}var t=e.BlobBuilder||e.WebKitBlobBuilder||e.MozBlobBuilder||function(e){var t=function(e){return Object.prototype.toString.call(e).match(/^\\[object\\s(.*)\\]$/)[1]},n=function(){this.data=[]},i=function(e,t,n){this.data=e,this.size=e.length,this.type=t,this.encoding=n},o=n.prototype,a=i.prototype,r=e.FileReaderSync,s=function(e){this.code=this[this.name=e]},l="NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR".split(" "),c=l.length,d=e.URL||e.webkitURL||e,u=d.createObjectURL,p=d.revokeObjectURL,h=d,f=e.btoa,g=e.atob,m=e.ArrayBuffer,v=e.Uint8Array,b=/^[\\w-]+:\\/*\\[?[\\w\\.:-]+\\]?(?::[0-9]+)?/;for(i.fake=a.fake=!0;c--;)s.prototype[l[c]]=c+1;return d.createObjectURL||(h=e.URL=function(e){var t,n=document.createElementNS("http://www.w3.org/1999/xhtml","a");return n.href=e,"origin"in n||("data:"===n.protocol.toLowerCase()?n.origin=null:(t=e.match(b),n.origin=t&&t[1])),n}),h.createObjectURL=function(e){var t,n=e.type;return null===n&&(n="application/octet-stream"),e instanceof i?(t="data:"+n,"base64"===e.encoding?t+";base64,"+e.data:"URI"===e.encoding?t+","+decodeURIComponent(e.data):f?t+";base64,"+f(e.data):t+","+encodeURIComponent(e.data)):u?u.call(d,e):void 0},h.revokeObjectURL=function(e){"data:"!==e.substring(0,5)&&p&&p.call(d,e)},o.append=function(e){var n=this.data;if(v&&(e instanceof m||e instanceof v)){for(var o="",a=new v(e),l=0,c=a.length;l<c;l++)o+=String.fromCharCode(a[l]);n.push(o)}else if("Blob"===t(e)||"File"===t(e)){if(!r)throw new s("NOT_READABLE_ERR");var d=new r;n.push(d.readAsBinaryString(e))}else e instanceof i?"base64"===e.encoding&&g?n.push(g(e.data)):"URI"===e.encoding?n.push(decodeURIComponent(e.data)):"raw"===e.encoding&&n.push(e.data):("string"!=typeof e&&(e+=""),n.push(unescape(encodeURIComponent(e))))},o.getBlob=function(e){return arguments.length||(e=null),new i(this.data.join(""),e,"raw")},o.toString=function(){return"[object BlobBuilder]"},a.slice=function(e,t,n){var o=arguments.length;return o<3&&(n=null),new i(this.data.slice(e,o>1?t:this.data.length),n,this.encoding)},a.toString=function(){return"[object Blob]"},a.close=function(){this.size=0,delete this.data},n}(e);e.Blob=function(e,n){var i=n&&n.type||"",o=new t;if(e)for(var a=0,r=e.length;a<r;a++)Uint8Array&&e[a]instanceof Uint8Array?o.append(e[a].buffer):o.append(e[a]);var s=o.getBlob(i);
3975return!s.slice&&s.webkitSlice&&(s.slice=s.webkitSlice),s};var n=Object.getPrototypeOf||function(e){return e.__proto__};e.Blob.prototype=n(new e.Blob)}(window),function(e){var t,n=e.Uint8Array,i=e.HTMLCanvasElement,o=i&&i.prototype,a=/\\s*;\\s*base64\\s*(?:;|$)/i,r="toDataURL";n&&(t=new n([62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,0,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51])),i&&!o.toBlob&&(o.toBlob=function(e,i){if(i||(i="image/png"),this.mozGetAsFile)e(this.mozGetAsFile("canvas",i));else if(this.msToBlob&&/^\\s*image\\/png\\s*(?:$|;)/i.test(i))e(this.msToBlob());else{var o,s=Array.prototype.slice.call(arguments,1),l=this[r].apply(this,s),c=l.indexOf(","),d=l.substring(c+1),u=a.test(l.substring(0,c));Blob.fake?((o=new Blob).encoding=u?"base64":"URI",o.data=d,o.size=d.length):n&&(o=u?new Blob([function(e){for(var i,o,a=e.length,r=new n(a/4*3|0),s=0,l=0,c=[0,0],d=0,u=0;a--;)o=e.charCodeAt(s++),255!==(i=t[o-43])&&null!=i&&(c[1]=c[0],c[0]=o,u=u<<6|i,4==++d&&(r[l++]=u>>>16,61!==c[1]&&(r[l++]=u>>>8),61!==c[0]&&(r[l++]=u),d=0));return r}(d)],{type:i}):new Blob([decodeURIComponent(d)],{type:i})),e(o)}},o.toDataURLHD?o.toBlobHD=function(){r="toDataURLHD";var e=this.toBlob();return r="toDataURL",e}:o.toBlobHD=o.toBlob)}(window),function(){if("performance"in window==0&&(window.performance={}),Date.now=Date.now||function(){return(new Date).getTime()},"now"in window.performance==0){var e=window.performance.timing&&window.performance.timing.navigationStart?window.performance.timing.navigationStart:Date.now();window.performance.now=function(){return Date.now()-e}}}(),function(){var e,t,n=n||(e=[],{getAll:function(){return e},removeAll:function(){e=[]},add:function(t){e.push(t)},remove:function(t){var n=e.indexOf(t);-1!==n&&e.splice(n,1)},update:function(t){if(0===e.length)return!1;var n=0;for(t=null!=t?t:window.performance.now();n<e.length;)e[n].update(t)?n++:e.splice(n,1);return!0}});n.Tween=function(e){var t=e,i={},o={},a={},r=1e3,s=0,l=!1,c=!1,d=!1,u=0,p=null,h=n.Easing.Linear.None,f=n.Interpolation.Linear,g=[],m=null,v=!1,b=null,w=null,y=null;for(var P in e)i[P]=parseFloat(e[P],10);this.to=function(e,t){return null!=t&&(r=t),o=e,this},this.start=function(e){n.add(this),c=!0,v=!1,p=null!=e?e:window.performance.now(),p+=u;for(var r in o){if(o[r]instanceof Array){if(0===o[r].length)continue;o[r]=[t[r]].concat(o[r])}null!==i[r]&&(i[r]=t[r],i[r]instanceof Array==0&&(i[r]*=1),a[r]=i[r]||0)}return this},this.stop=function(){return c?(n.remove(this),c=!1,null!==y&&y.call(t),this.stopChainedTweens(),this):this},this.stopChainedTweens=function(){for(var e=0,t=g.length;e<t;e++)g[e].stop()},this.complete=function(){return c?(n.remove(this),c=!1,null!==w&&w.call(t),this.completeChainedTweens(),this):this},this.completeChainedTweens=function(){for(var e=0,t=g.length;e<t;e++)g[e].complete()},this.delay=function(e){return u=e,this},this.repeat=function(e){return s=e,this},this.yoyo=function(e){return l=e,this},this.easing=function(e){return h=null==e?h:e,this},this.interpolation=function(e){return f=e,this},this.chain=function(){return g=arguments,this},this.onStart=function(e){return m=e,this},this.onUpdate=function(e){return b=e,this},this.onComplete=function(e){return w=e,this},this.onStop=function(e){return y=e,this},this.update=function(e){var n,c,y;if(e<p)return!0;!1===v&&(null!==m&&m.call(t),v=!0),y=h(c=(c=(e-p)/r)>1?1:c);for(n in o)if(null!==i[n]){var P=i[n]||0,x=o[n];x instanceof Array?t[n]=f(x,y):("string"==typeof x&&(x=x.startsWith("+")||x.startsWith("-")?P+parseFloat(x,10):parseFloat(x,10)),"number"==typeof x&&(t[n]=P+(x-P)*y))}if(null!==b&&b.call(t,y),1===c){if(s>0){isFinite(s)&&s--;for(n in a){if("string"==typeof o[n]&&(a[n]=a[n]+parseFloat(o[n],10)),l){var C=a[n];a[n]=o[n],o[n]=C}i[n]=a[n]}return l&&(d=!d),p=e+u,!0}null!==w&&w.call(t);for(var E=0,S=g.length;E<S;E++)g[E].start(p+r);return!1}return!0}},n.Easing={Linear:{None:function(e){return e}},Quadratic:{In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}},Quartic:{In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}},Sinusoidal:{In:function(e){return 1-Math.cos(e*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return.5*(1-Math.cos(Math.PI*e))}}
3975,Cubic:{In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}},n.Interpolation={Linear:function(e,t){var i=e.length-1,o=i*t,a=Math.floor(o),r=n.Interpolation.Utils.Linear;return t<0?r(e[0],e[1],o):t>1?r(e[i],e[i-1],i-o):r(e[a],e[a+1>i?i:a+1],o-a)},Bezier:function(e,t){for(var i=0,o=e.length-1,a=Math.pow,r=n.Interpolation.Utils.Bernstein,s=0;s<=o;s++)i+=a(1-t,o-s)*a(t,s)*e[s]*r(o,s);return i},Utils:{Linear:function(e,t,n){return(t-e)*n+e},Bernstein:function(e,t){var i=n.Interpolation.Utils.Factorial;return i(e)/i(t)/i(e-t)},Factorial:(t=[1],function(e){var n=1;if(t[e])return t[e];for(var i=e;i>1;i--)n*=i;return t[e]=n,n}),CatmullRom:function(e,t,n,i,o){var a=.5*(n-e),r=.5*(i-t),s=o*o;return(2*t-2*n+a+r)*(o*s)+(-3*t+3*n-2*a-r)*s+a*o+t}}},window.TWEEN=n}(),pdfflip.createBlob=function(e,t){if("undefined"!=typeof Blob)return new Blob([e],{type:t});var n=new MozBlobBuilder;return n.append(e),n.getBlob(t)},pdfflip.createObjectURL=function(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return function(t,n){if("undefined"!=typeof URL&&URL.createObjectURL){var i=pdfflip.createBlob(t,n);return URL.createObjectURL(i)}for(var o="data:"+n+";base64,",a=0,r=t.length;a<r;a+=3){var s=255&t[a],l=255&t[a+1],c=255&t[a+2];o+=e[s>>2]+e[(3&s)<<4|l>>4]+e[a+1<r?(15&l)<<2|c>>6:64]+e[a+2<r?63&c:64]}return o}}();var ThumbList=function(){function e(t){var n=t&&t.w+"px"||"100%",i=t&&t.h+"px"||"100%",o=this.itemHeight=t.itemHeight;this.items=t.items,this.generatorFn=t.generatorFn,this.totalRows=t.totalRows||t.items&&t.items.length,this.addFn=t.addFn,this.scrollFn=t.scrollFn;var a=e.createScroller(o*this.totalRows);this.container=e.createContainer(n,i),this.container.appendChild(a),this.screenItemsLen=Math.ceil(t.h/o),this.offsetItems=this.screenItemsLen,this.cachedItemsLen=this.screenItemsLen+2*this.offsetItems,this._renderChunk(this.container,0);var r=this;function s(e){var t=e.target.scrollTop;if(!r.lastRepaintY||Math.abs(t-r.lastRepaintY)>=r.offsetItems*r.itemHeight){var n=parseInt(t/o,10)-r.offsetItems;r._renderChunk(r.container,n<0?0:n),r.lastRepaintY=t}r.lastScrolled=Date.now(),null!=r.scrollFn&&r.scrollFn(),e.preventDefault&&e.preventDefault()}r.lastRepaintY=0,this.screenItemsLen,r.dispose=function(){r.container&&r.container.parentNode&&r.container.parentNode.removeChild(r.container),r.container.removeEventListener("scroll",s)},r.container.addEventListener("scroll",s)}return e.prototype.reset=function(e){this.screenItemsLen=Math.ceil(e/this.itemHeight),this.cachedItemsLen=this.screenItemsLen+2*this.offsetItems;var t=parseInt(this.lastRepaintY/this.itemHeight,10)-this.offsetItems;this.needReset=!0,this._renderChunk(this.container,Math.max(t,0))},e.prototype.createRow=function(e){var t;return this.generatorFn&&((t=this.generatorFn(e)).classList.add("pdff-vrow"),t.style.position="absolute",t.style.top=e*this.itemHeight+"px",t.setAttribute("index",e)),t},e.prototype._renderChunk=function(e,t){var n=null==this.range;this.range=this.range||{min:0,max:this.cachedItemsLen};var i=this.range,o=i.min,a=i.max,r=!!n||t>=o;if(n||t!=o||0!=this.needReset){var s,l=n?o:r?a:t;l=l>this.totalRows?this.totalRows:l<0?0:l;var c=t+this.cachedItemsLen;for(c=c>this.totalRows?this.totalRows:c,s=l;s<c;s++)r?e.appendChild(this.createRow(s)):e.insertBefore(this.createRow(s),e.childNodes[1+s-l]),null!=this.addFn&&this.addFn(s);if(Math.abs(t-o),this.needReset=!1,!n&&e.childNodes.length>this.cachedItemsLen+1)for(var d=r?1:1+this.cachedItemsLen,u=d+(c-l);u>d;u--)e.childNodes[d]&&this.container.removeChild(e.childNodes[d]);this.range.min=t,this.range.max=c}},e.createContainer=function(e,t){var n=document.createElement("div");return n.style.width=e,n.style.height=t,n.style.overflow="auto",n.style.position="relative",n.style.padding=0,n},e.createScroller=function(e){var t=document.createElement("div");return t.style.opacity=0,t.style.position="absolute",t.style.top=0,t.style.left=0,t.style.width="1px",t.style.height=e+"px",t},e}(),BookMarkViewer=function(){function e(e){this.outline=null,this.lastToggleIsShow=!0,this.container=e.container,this.linkService=e.linkService,this.outlineItemClass=e.outlineItemClass||"outlineItem",this.outlineToggleClass=e.outlineToggleClass||"outlineItemToggler",this.outlineToggleHiddenClass=e.outlineToggleHiddenClass||"outlineItemsHidden"}return e.prototype={dispose:function(){this.container&&this.container.parentNode&&this.container.parentNode.removeChild(this.container),this.linkService=null},reset:function(){this.outline=null,this.lastToggleIsShow=!0;for(var e=this.container;e.firstChild;)e.removeChild(e.firstChild)},_dispatchEvent:function(e){var t=document.createEvent("CustomEvent");t.initCustomEvent("outlineloaded",!0,!0,{outlineCount:e}
3975),this.container.dispatchEvent(t)},_bindLink:function(e,t){var n=this.linkService;if(1==t.custom)e.href=n.getCustomDestinationHash(t.dest),e.onclick=function(e){return n.customNavigateTo(t.dest),!1};else{if(t.url)return void PDFJS.addLinkAttributes(e,{url:t.url});e.href=n.getDestinationHash(t.dest),e.onclick=function(e){return n.navigateTo(t.dest),!1}}},_addToggleButton:function(e){var t=document.createElement("div");t.className=this.outlineToggleClass+" "+this.outlineToggleHiddenClass,t.onclick=function(n){if(n.stopPropagation(),t.classList.toggle(this.outlineToggleHiddenClass),n.shiftKey){var i=!t.classList.contains(this.outlineToggleHiddenClass);this._toggleOutlineItem(e,i)}}.bind(this),e.insertBefore(t,e.firstChild)},_toggleOutlineItem:function(e,t){this.lastToggleIsShow=t;for(var n=e.querySelectorAll("."+this.outlineToggleClass),i=0,o=n.length;i<o;++i)n[i].classList[t?"remove":"add"](this.outlineToggleHiddenClass)},toggleOutlineTree:function(){this.outline&&this._toggleOutlineItem(this.container,!this.lastToggleIsShow)},render:function(e){var t=e&&e.outline||null,n=0;if(this.outline&&this.reset(),this.outline=t,t){for(var i=document.createDocumentFragment(),o=[{parent:i,items:this.outline}],a=!1;o.length>0;)for(var r=o.shift(),s=r.custom,l=0,c=r.items.length;l<c;l++){var d=r.items[l],u=document.createElement("div");u.className=this.outlineItemClass;var p=document.createElement("a");if(null==d.custom&&null!=s&&(d.custom=s),this._bindLink(p,d),p.textContent=d.title.replace(/\\x00/g,""),u.appendChild(p),d.items&&d.items.length>0){a=!0,this._addToggleButton(u);var h=document.createElement("div");h.className=this.outlineItemClass+"s",u.appendChild(h),o.push({parent:h,custom:d.custom,items:d.items})}r.parent.appendChild(u),n++}a&&(null!=this.container.classList?this.container.classList.add(this.outlineItemClass+"s"):null!=this.container.className&&(this.container.className+=" picWindow")),this.container.appendChild(i),this._dispatchEvent(n)}}},e}(),DFLightBox=function(e){function t(t,n){this.duration=300;var i=this;return i.lightboxWrapper=e("<div>").addClass("pdff-lightbox-wrapper"),i.container=e("<div>").addClass("pdff-container").appendTo(i.lightboxWrapper),i.controls=e("<div>").addClass("pdff-lightbox-controls").appendTo(i.lightboxWrapper),i.closeButton=e("<div>").addClass("pdff-lightbox-close pdff-ui-btn").on("click",function(){$("body").css("overflow","visible"),i.close(t)}).appendTo(i.controls),i.lightboxWrapper.append(i.container),i}return t.prototype.show=function(t){return 0==this.lightboxWrapper.parent().length&&e("body").append(this.lightboxWrapper),this.lightboxWrapper.fadeIn(this.duration,t),this},t.prototype.close=function(e){return this.lightboxWrapper.fadeOut(this.duration),setTimeout(e,this.duration),this},t}(jQuery);pdfflip.Share=function(e){function t(t,n){var i=this,o="<div>",a="pdff-share-button",r="width=500,height=400";i.isOpen=!1,i.shareUrl="",i.wrapper=e('<div class="pdff-share-wrapper" style="display: none;">').on("click",function(e){i.close()}),i.box=e('<div class="pdff-share-box">').on("click",function(e){e.preventDefault(),e.stopPropagation()}).appendTo(i.wrapper).html('<span class="pdff-share-title">'+n.text.share+"</span>"),i.urlInput=e('<textarea class="pdff-share-url">').on("click",function(){e(this).select()}),i.facebook=e(o,{class:a+" pdff-share-facebook "+n.icons.facebook}).on("click",function(e){window.open("https://www.facebook.com/sharer/sharer.php?u="+encodeURIComponent(i.shareUrl),"Sharer",r)}),i.google=e(o,{class:a+" pdff-share-google "+n.icons.google}).on("click",function(e){window.open("https://plus.google.com/share?url="+encodeURIComponent(i.shareUrl),"Sharer",r)}),i.twitter=e(o,{class:a+" pdff-share-twitter "+n.icons.twitter}).on("click",function(e){window.open("http://twitter.com/share?url="+encodeURIComponent(i.shareUrl),"Sharer",r)}),i.mail=e("<a>",{class:a+" pdff-share-mail "+n.icons.mail,href:"mailto:?subject=I wanted you to see this FlipBook&body=Check out this site "+encodeURIComponent(i.shareUrl),target:"_blank"}).on("click",function(t){e(this).attr("href","mailto:?subject=I wanted y
3975ou to see this FlipBook&body=Check out this site "+encodeURIComponent(i.shareUrl)),t.stopPropagation()}),i.box.append(i.urlInput).append(i.facebook).append(i.google).append(i.twitter).append(i.mail),e(t).append(i.wrapper)}return t.prototype.show=function(){this.wrapper.fadeIn(300),this.urlInput.val(this.shareUrl),this.urlInput.trigger("click"),this.isOpen=!0},t.prototype.dispose=function(){var e=this;e.box.off(),e.google.off(),e.twitter.off(),e.facebook.off(),e.mail.off(),e.urlInput.off(),e.wrapper.off().remove()},t.prototype.close=function(){this.wrapper.fadeOut(300),this.isOpen=!1},t.prototype.update=function(e){this.shareUrl=e},t}(jQuery),pdfflip.Popup=function(e){function t(t,n){var i=this;i.isOpen=!1,i.wrapper=e('<div class="pdff-popup-wrapper" style="display: none;">').on("click",function(e){i.close()}),i.box=e('<div class="pdff-popup-box">').on("click",function(e){e.preventDefault(),e.stopPropagation()}).appendTo(i.wrapper),e(t).append(i.wrapper)}return t.prototype.show=function(){this.wrapper.fadeIn(300),this.isOpen=!0},t.prototype.dispose=function(){this.box.off(),this.wrapper.off().remove()},t.prototype.close=function(){this.wrapper.fadeOut(300),this.isOpen=!1},t}(jQuery);var PDFLinkService=function(){function e(){this.baseUrl=null,this.pdfDocument=null,this.pdfViewer=null,this.pdfHistory=null,this._pagesRefCache=null}return e.prototype={dispose:function(){this.baseUrl=null,this.pdfDocument=null,this.pdfViewer=null,this.pdfHistory=null,this._pagesRefCache=null},setDocument:function(e,t){this.baseUrl=t,this.pdfDocument=e,this._pagesRefCache=Object.create(null)},setViewer:function(e){this.pdfViewer=e},setHistory:function(e){this.pdfHistory=e},get pagesCount(){return this.pdfDocument.numPages},get page(){return this.pdfViewer.currentPageNumber},set page(e){this.pdfViewer.currentPageNumber=e},navigateTo:function(e){var t,n="",i=this,o=function(t){var a=t instanceof Object?i._pagesRefCache[t.num+" "+t.gen+" R"]:t+1;a?(i.pdfViewer.contentProvider.options.pageSize==pdfflip.PAGE_SIZE.DOUBLEINTERNAL&&a>2&&(a=2*a-1),a>i.pdfViewer.pageCount&&(a=i.pdfViewer.pageCount),i.pdfViewer.gotoPage(a),i.pdfHistory&&i.pdfHistory.push({dest:e,hash:n,page:a})):i.pdfDocument.getPageIndex(t).then(function(e){var n=e+1,a=t.num+" "+t.gen+" R";i._pagesRefCache[a]=n,o(t)})};"string"==typeof e?(n=e,t=this.pdfDocument.getDestination(e)):t=Promise.resolve(e),t.then(function(t){e=t,t instanceof Array&&o(t[0])})},customNavigateTo:function(e){if(""!=e&&null!=e&&"null"!=e){var t=null;if(isNaN(Math.round(e))){if("string"==typeof e&&(t=parseInt(e.replace("#",""),10),isNaN(t)))return void window.open(e)}else t=e;null!=t&&this.pdfViewer.gotoPage(t)}},getDestinationHash:function(e){if("string"==typeof e)return this.getAnchorUrl("#"+escape(e));if(e instanceof Array){var t=e[0],n=t instanceof Object?this._pagesRefCache[t.num+" "+t.gen+" R"]:t+1;if(n){var i=this.getAnchorUrl("#page="+n),o=e[1];if("object"==typeof o&&"name"in o&&"XYZ"===o.name){var a=e[4]||this.pdfViewer.currentScaleValue,r=parseFloat(a);r&&(a=100*r),i+="&zoom="+a,(e[2]||e[3])&&(i+=","+(e[2]||0)+","+(e[3]||0))}return i}}return this.getAnchorUrl("")},getCustomDestinationHash:function(e){return"#"+escape(e)},getAnchorUrl:function(e){return(this.baseUrl||"")+e},setHash:function(e){if(e.indexOf("=")>=0){var t,n,i=parseQueryString(e);if("nameddest"in i)return this.pdfHistory&&this.pdfHistory.updateNextHashParam(i.nameddest),void this.navigateTo(i.nameddest);if("page"in i&&(t=0|i.page||1),"zoom"in i){var o=i.zoom.split(","),a=o[0],r=parseFloat(a);-1===a.indexOf("Fit")?n=[null,{name:"XYZ"},o.length>1?0|o[1]:null,o.length>2?0|o[2]:null,r?r/100:a]:"Fit"===a||"FitB"===a?n=[null,{name:a}]:"FitH"===a||"FitBH"===a||"FitV"===a||"FitBV"===a?n=[null,{name:a},o.length>1?0|o[1]:null]:"FitR"===a?5!==o.length?console.error("PDFLinkService_setHash: Not enough parameters for 'FitR'."):n=[null,{name:a},0|o[1],0|o[2],0|o[3],0|o[4]]:console.error("PDFLinkService_setHash: '"+a+"' is not a valid zoom value.")}if(n?this.pdfViewer.scrollPageIntoView(t||this.page,n):t&&(this.page=t),"pagemode"in i){var s=document.createEvent("CustomEvent");s.initCustomEvent("pagemode",!0,!0,{mode:i.pagemode}
3975),this.pdfViewer.container.dispatchEvent(s)}}else/^\\d+$/.test(e)?this.page=e:(this.pdfHistory&&this.pdfHistory.updateNextHashParam(unescape(e)),this.navigateTo(unescape(e)))},executeNamedAction:function(e){switch(e){case"GoBack":this.pdfHistory&&this.pdfHistory.back();break;case"GoForward":this.pdfHistory&&this.pdfHistory.forward();break;case"NextPage":this.page++;break;case"PrevPage":this.page--;break;case"LastPage":this.page=this.pagesCount;break;case"FirstPage":this.page=1}var t=document.createEvent("CustomEvent");t.initCustomEvent("namedaction",!0,!0,{action:e}),this.pdfViewer.container.dispatchEvent(t)},cachePageRef:function(e,t){var n=t.num+" "+t.gen+" R";this._pagesRefCache[n]=e}},e}();pdfflip.TextLayerBuilder=function(){function e(e){this.textLayerDiv=e.textLayerDiv,this.renderingDone=!1,this.divContentDone=!1,this.pageIdx=e.pageIndex,this.pageNumber=this.pageIdx+1,this.matches=[],this.viewport=e.viewport,this.textDivs=[],this.findController=e.findController||null,this.textLayerRenderTask=null,this.enhanceTextSelection=e.enhanceTextSelection,this._bindMouse()}return e.prototype={_finishRendering:function(){if(this.renderingDone=!0,!this.enhanceTextSelection){var e=document.createElement("div");e.className="endOfContent",this.textLayerDiv.appendChild(e)}},render:function(e){if(this.divContentDone&&!this.renderingDone){this.textLayerRenderTask&&(this.textLayerRenderTask.cancel(),this.textLayerRenderTask=null),this.textDivs=[];var t=document.createDocumentFragment();this.textLayerRenderTask=PDFJS.renderTextLayer({textContent:this.textContent,container:t,viewport:this.viewport,textDivs:this.textDivs,timeout:e,enhanceTextSelection:this.enhanceTextSelection}),this.textLayerRenderTask.promise.then(function(){this.textLayerDiv.appendChild(t),this._finishRendering(),this.updateMatches()}.bind(this),function(e){})}},setTextContent:function(e){this.textLayerRenderTask&&(this.textLayerRenderTask.cancel(),this.textLayerRenderTask=null),this.textContent=e,this.divContentDone=!0},convertMatches:function(e,t){var n=0,i=0,o=this.textContent.items,a=o.length-1,r=null===this.findController?0:this.findController.state.query.length,s=[];if(!e)return s;for(var l=0,c=e.length;l<c;l++){for(var d=e[l];n!==a&&d>=i+o[n].str.length;)i+=o[n].str.length,n++;n===o.length&&console.error("Could not find a matching mapping");var u={begin:{divIdx:n,offset:d-i}};for(d+=t?t[l]:r;n!==a&&d>i+o[n].str.length;)i+=o[n].str.length,n++;u.end={divIdx:n,offset:d-i},s.push(u)}return s},renderMatches:function(e){if(0!==e.length){var t=this.textContent.items,n=this.textDivs,i=null,o=this.pageIdx,a=null!==this.findController&&o===this.findController.selected.pageIdx,r=null===this.findController?-1:this.findController.selected.matchIdx,s=void 0,l=r,c=l+1;if(null!==this.findController&&this.findController.state.highlightAll)l=0,c=e.length;else if(!a)return;for(var d=l;d<c;d++){var u=e[d],p=u.begin,h=u.end,f=a&&d===r?" selected":"";if(this.findController&&this.findController.updateMatchPosition(o,d,n,p.divIdx),i&&p.divIdx===i.divIdx?b(i.divIdx,i.offset,p.offset):(null!==i&&b(i.divIdx,i.offset,s),v(p)),p.divIdx===h.divIdx)b(p.divIdx,p.offset,h.offset,"highlight"+f);else{b(p.divIdx,p.offset,s,"highlight begin"+f);for(var g=p.divIdx+1,m=h.divIdx;g<m;g++)n[g].className="highlight middle"+f;v(h,"highlight end"+f)}i=h}i&&b(i.divIdx,i.offset,s)}function v(e,t){var i=e.divIdx;n[i].textContent="",b(i,0,e.offset,t)}function b(e,i,o,a){var r=n[e],s=t[e].str.substring(i,o),l=document.createTextNode(s);if(a){var c=document.createElement("span");return c.className=a,c.appendChild(l),void r.appendChild(c)}r.appendChild(l)}},updateMatches:function(){if(this.renderingDone){for(var e,t,n=this.matches,i=this.textDivs,o=this.textContent.items,a=-1,r=0,s=n.length;r<s;r++){for(var l=n[r],c=Math.max(a,l.begin.divIdx),d=l.end.divIdx;c<=d;c++){var u=i[c];u.textContent=o[c].str,u.className=""}a=l.end.divIdx+1}null!==this.findController&&this.findController.active&&(null!==this.findController&&(e=this.findController.pageMatches[this.pageIdx]||null,t=this.findController.pageMatchesLength&&this.findController.pageMatchesLength[this.pageIdx]||null),this.matches=this.convertMatches(e,t),this.renderMatches(this.matches))}},_bindMouse:function(){var e=this.textLayerDiv,t=this;e.addEventListener("mousedown",function(n){if(t.enhanceTextSelection&&t.textLayerRenderTask)t.textLayerRenderTask.expandTextDivs(!0);else{var i=e.querySelector(".endOfContent");
3975if(i){var o=n.target!==e;if(o=o&&"none"!==window.getComputedStyle(i).getPropertyValue("-moz-user-select")){var a=e.getBoundingClientRect(),r=Math.max(0,(n.pageY-a.top)/a.height);i.style.top=(100*r).toFixed(2)+"%"}i.classList.add("active")}}}),e.addEventListener("mouseup",function(n){if(t.enhanceTextSelection&&t.textLayerRenderTask)t.textLayerRenderTask.expandTextDivs(!1);else{var i=e.querySelector(".endOfContent");i&&(i.style.top="",i.classList.remove("active"))}})}},e}(),pdfflip.ConvertPageLinks=function(){for(var e,t=arguments[0]/100,n=arguments[1]/100,i=function(e,i,o,a,r){return{x:e/t,y:i/n,w:o/t,h:a/n,dest:r}},o=[],a=2;a<arguments.length;a++)e=arguments[a],o[a-2]=i.apply(this,e);return o},pdfflip.parseLinks=function(e){var t;if(null!=e&&e.length>0)for(var n=0;n<e.length;n++)null!=(t=e[n])&&null!=t[0]&&null==t[0].dest&&(t=pdfflip.ConvertPageLinks.apply(this,t),e[n]=t);return e},function(e){function t(e){return"true"==e||1==e}function n(e){null!=e.webgl&&(e.webgl=t(e.webgl)),null!=e.downloadEnable&&(e.downloadEnable=t(e.downloadEnable)),null!=e.scrollWheel&&(e.scrollWheel=t(e.scrollWheel)),null!=e.autoEnableOutline&&(e.autoEnableOutline=t(e.autoEnableOutline)),null!=e.autoEnableThumbnail&&(e.autoEnableThumbnail=t(e.autoEnableThumbnail)),null!=e.transparent&&(e.transparent=t(e.transparent)),null!=e.overwritePDFOutline&&(e.overwritePDFOutline=t(e.overwritePDFOutline)),null!=e.enableSound&&(e.enableSound=t(e.enableSound)),null!=e.forceFit&&(e.forceFit=t(e.forceFit)),null!=e.enableAnnotation&&(e.enableAnnotation=t(e.enableAnnotation)),null!=e.webglShadow&&(e.webglShadow=t(e.webglShadow)),null!=e.autoPlay&&(e.autoPlay=t(e.autoPlay)),null!=e.autoPlayStart&&(e.autoPlayStart=t(e.autoPlayStart)),null!=e.paddingTop&&(e.paddingTop=parseInt(e.paddingTop,10)),null!=e.paddingRight&&(e.paddingRight=parseInt(e.paddingRight,10)),null!=e.paddingBottom&&(e.paddingBottom=parseInt(e.paddingBottom,10)),null!=e.paddingLeft&&(e.paddingLeft=parseInt(e.paddingLeft,10)),null!=e.zoomRatio&&(e.zoomRatio=parseFloat(e.zoomRatio,10)),null!=e.stiffness&&(e.stiffness=parseFloat(e.stiffness,10)),null!=e.autoPlayDuration&&(e.autoPlayDuration=parseInt(e.autoPlayDuration,10)),0!=e.pageMode&&"0"!=e.pageMode||(e.pageMode=null),0!=e.singlePageMode&&"0"!=e.singlePageMode||(e.singlePageMode=null)}pdfflip.getOptions=function(t){var i="option_"+(t=e(t)).attr("id"),o=t.attr("source")||t.attr("pdff-source");(i=null==i||""==i||null==window[i]?{}:window[i]).source=null==o||""==o?i.source:o;var a={webgl:t.attr("webgl"),height:t.attr("height"),enableSound:t.attr("sound"),transparent:t.attr("transparent"),downloadEnable:t.attr("download"),duration:t.attr("duration"),hard:t.attr("hard"),pageMode:t.attr("pagemode"),direction:t.attr("direction"),backgroundColor:t.attr("backgroundcolor"),scrollWheel:t.attr("scrollwheel"),backgroundImage:t.attr("backgroundimage"),paddingTop:t.attr("paddingtop"),paddingRight:t.attr("paddingright"),paddingBottom:t.attr("paddingbottom"),paddingLeft:t.attr("paddingleft"),wpOptions:t.attr("wpoptions")};return function(e){if(1!=e.parsed){e.parsed=!0;var t=[];if(n(e),"undefined"!=typeof pdfflipWPGlobal&&"true"==e.wpOptions){try{for(var i in e.links){for(var o=e.links[i],a=[100,100],r=0;r<o.length;r++){for(var s=o[r].substr(1).slice(0,-1).split(","),l=[],c=0;c<5;c++)l[c]=s[c];a.push(l)}t[parseInt(i,10)+1]=a}}catch(e){console.error(e.stack)}e.links=pdfflip.parseLinks(t)}else e.links=pdfflip.parseLinks(e.links)}}(i=e.extend(!0,{},i,a)),i},pdfflip.parseBooks=function(){e("._PDFF_btt, ._pdff_thumb, ._PDFF_link, .PDFFlip").each(function(){var t=e(this);if("true"!==(t.attr("parsed")||t.attr("pdff-parsed")))if(t.attr("pdff-parsed","true"),t.hasClass("PDFFlip")){var n=t.attr("id"),i=t.attr("slug"),o=pdfflip.getOptions(t);o.id=n,null!=i&&(o.slug=i),n?window[n.toString()]=e(t).flipBook(o.source,o):e(t).flipBook(o.source,o)}else if(t.hasClass("_pdff_thumb")){var a=e("<div class='PDFFlip-cover'>"),r=t.html().trim();t.html(""),e("<span class='PDFFlip-title'>").html(r).appendTo(a);var s=t.attr("thumb")||t.attr("pdff-thumb"),l=t.attr("thumbtype")||pdfflip.defaults.thumbElement||"div",c=t.attr("tags")||t.attr("pdff-tags");if(c&&(c=c.split(",")).length>0)for(var d=0;d<c.length;d++)t.append("<span class='PDFFlip-tag'>"+c[d]+"</span>");null!=s&&""!=s.toString().trim()?"img"==l?(a.append('<img src="'+s+'" alt="'+r+'"/>'),t.attr("thumb-type","img")):a.css({backgroundImage:"url("+s+")"}):a.addClass("_pdff_thumb-not-found"),t.append(a)}})},e(document).ready(function(){if("undefined"==typeof pdfflipLocation&&0!=pdfflip.autoDetectLocation&&e("script").each(function(){var t=e(this)[0].src;if((t.indexOf("/pdfflip.js")>-1||t.indexOf("/pdfflip.min.js")>-1)&&(t.indexOf("https://")>-1||t.indexOf("http://")>-1)&&t.indexOf("js/pdfflip.")>-1){var n=t.split("/");window.pdfflipLocation=n.slice(0,-2).join("/")}}),"undefined"!=typeof pdfflipLocation&&(pdfflipLocation.length>2&&"/"!==pdfflipLocation.slice(-1)&&(window.pdfflipLocation+="/"),pdfflip.defaults.utilsSrc=pdfflipLocation+"js/libs/utils.min.js",pdfflip.defaults.pdfjsSrc=pdfflipLocation+"js/libs/pdf.min.js",pdfflip.defaults.pdfjsCompatibilitySrc=pdfflipLocation+"js/libs/compatibility.js",pdfflip.defaults.threejsSrc=pdfflipLocation+"js/libs/three.min.js",pdfflip.defaults.pdfjsWorkerSrc=pdfflipLocation+"js/libs/pdf.worker.min.js",pdfflip.defaults.soundFile=pdfflipLocation+"sound/turn.mp3",pdfflip.defaults.imagesLocation=pdfflipLocation+"images",pdfflip.defaults.imageResourcesPath=
3975pdfflipLocation+"images/pdfjs/",pdfflip.defaults.cMapUrl=pdfflipLocation+"js/libs/cmaps/","undefined"!=typeof pdfflipWPGlobal&&(n(pdfflipWPGlobal),e.extend(pdfflip.defaults,pdfflipWPGlobal))),pdfflip.preParseHash=window.location.hash,pdfflip.parseBooks(),e("body").on("click","._PDFF_btt, ._pdff_thumb, ._PDFF_link",function(){$("body").css("overflow","hidden");var t=e(this);window.dfLightBox||(window.dfLightBox=new DFLightBox(function(){0==window.location.hash.indexOf("#pdfflip-")&&(window.location.hash="#_"),window.dfActiveLightBoxBook.dispose(),window.dfActiveLightBoxBook=null})),window.dfLightBox.duration=500,window.dfActiveLightBoxBook&&window.dfActiveLightBoxBook.dispose?window.dfActiveLightBoxBook.dispose():window.dfLightBox.show(function(){var n=pdfflip.getOptions(t);n.transparent=!1,n.id=t.attr("id");var i=t.attr("slug");null!=i&&(n.slug=i),n.isLightBox=!0,window.dfActiveLightBoxBook=e(window.dfLightBox.container).flipBook(n.source,n)})}),(pdfflip.utils.isSafari||pdfflip.utils.isIOS)&&e("body").addClass("pdff-webkit"),pdfflip.preParseHash&&pdfflip.preParseHash.indexOf("pdfflip-")>=0){var t,i=pdfflip.preParseHash.split("pdfflip-")[1].split("/")[0],o=pdfflip.preParseHash.split("pdfflip-")[1].split("/")[1];null!=o&&(o=o.split("/")[0]),0==(t=e("[slug="+i+"]")).length&&(t=e("#"+i)),t.length>0&&(null!=o&&t.data("page",o),t.is("._PDFF_btt, ._pdff_thumb, ._PDFF_link")&&t.trigger("click"))}e("body").on("click",".pdff-ui-sidemenu-close",function(){e(this).closest(".pdff-container").find(".pdff-ui-outline.pdff-active , .pdff-ui-thumbnail.pdff-active").trigger("click")})})}(jQuery); 3976`},6713:function(e){e.exports=`//override original pdf-flip setting 3977 3978var option_PDFF = { 3979 3980 /* BASIC SETTINGS */ 3981 openPage: 1, 3982 height: '100%', 3983 enableSound: false, 3984 downloadEnable: true, 3985 direction: 1, // LTR = 1, RTL = 2 3986 autoPlay: true, 3987 autoPlayStart: false, 3988 autoPlayDuration: 3000, 3989 autoEnableOutline: false, 3990 autoEnableThumbnail: false, 3991 3992 3993 /* TRANSLATE INTERFACE */ 3994 3995 text: { 3996 toggleSound: "Sound", 3997 toggleThumbnails: "Thumbnails", 3998 toggleOutline: "Contents", 3999 previousPage: "Previous Page", 4000 nextPage: "Next Page", 4001 toggleFullscreen: "Fullscreen", 4002 zoomIn: "Zoom In", 4003 zoomOut: "Zoom Out", 4004 downloadPDFFile: "Download PDF", 4005 gotoFirstPage: "First Page", 4006 gotoLastPage: "Last Page", 4007 play: "AutoPlay On", 4008 pause: "AutoPlay Off", 4009 share: "Share" 4010 }, 4011 4012 /* ADVANCED SETTINGS */ 4013 4014 hard: "none", 4015 overwritePDFOutline: true, 4016 duration: 1000, 4017 pageMode: null, //single = 1, double = 2, auto = null 4018 singlePageMode: null, // zoom = 1, booklet = 2, auto = null 4019 transparent: false, 4020 scrollWheel: true, 4021 zoomRatio: 1.5, 4022 maxTextureSize: 1600, 4023 backgroundImage: "/assets/flipbook/background.jpg", 4024 backgroundColor: "#fff", 4025 controlsPosition: 'bottom', //hidden= 'hide', top: 'top', bottom: 'bottom' 4026 allControls: "thumbnail,play,altPrev,pageNumber,altNext,zoomIn,zoomOut,fullScreen,download,sound", 4027 hideControls: "outline,startPage,endPage", 4028 4029}; 4030var pdfflipLocation = "/assets/flipbook/"; 4031 4032`},7088:function(e){e.exports=`
vendor: 19,461 bytes, lines 4032-4051
4032/*! 4033 * perfect-scrollbar v1.5.0 4034 * Copyright 2020 Hyunje Jun, MDBootstrap and Contributors 4035 * Licensed under MIT 4036 */(function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):(a=a||self,a.PerfectScrollbar=b())})(this,function(){'use strict';var u=Math.abs,v=Math.floor;function a(a){return getComputedStyle(a)}function b(a,b){for(var c in b){var d=b[c];"number"==typeof d&&(d+="px"),a.style[c]=d}return a}function c(a){var b=document.createElement("div");return b.className=a,b}function d(a,b){if(!w)throw new Error("No element matching method supported");return w.call(a,b)}function e(a){a.remove?a.remove():a.parentNode&&a.parentNode.removeChild(a)}function f(a,b){return Array.prototype.filter.call(a.children,function(a){return d(a,b)})}function g(a,b){var c=a.element.classList,d=z.state.scrolling(b);c.contains(d)?clearTimeout(A[b]):c.add(d)}function h(a,b){A[b]=setTimeout(function(){return a.isAlive&&a.element.classList.remove(z.state.scrolling(b))},a.settings.scrollingThreshold)}function j(a,b){g(a,b),h(a,b)}function k(a){if("function"==typeof window.CustomEvent)return new CustomEvent(a);var b=document.createEvent("CustomEvent");return b.initCustomEvent(a,!1,!1,void 0),b}function l(a,b,c,d,e){void 0===d&&(d=!0),void 0===e&&(e=!1);var f;if("top"===b)f=["contentHeight","containerHeight","scrollTop","y","up","down"];else if("left"===b)f=["contentWidth","containerWidth","scrollLeft","x","left","right"];else throw new Error("A proper axis should be provided");m(a,c,f,d,e)}function m(a,b,c,d,e){var f=c[0],g=c[1],h=c[2],i=c[3],l=c[4],m=c[5];void 0===d&&(d=!0),void 0===e&&(e=!1);var n=a.element;// reset reach 4037a.reach[i]=null,1>n[h]&&(a.reach[i]="start"),n[h]>a[f]-a[g]-1&&(a.reach[i]="end"),b&&(n.dispatchEvent(k("ps-scroll-"+i)),0>b?n.dispatchEvent(k("ps-scroll-"+l)):0<b&&n.dispatchEvent(k("ps-scroll-"+m)),d&&j(a,i)),a.reach[i]&&(b||e)&&n.dispatchEvent(k("ps-"+i+"-reach-"+a.reach[i]))}function n(a){return parseInt(a,10)||0}function o(a){return d(a,"input,[contenteditable]")||d(a,"select,[contenteditable]")||d(a,"textarea,[contenteditable]")||d(a,"button,[contenteditable]")}function p(b){var c=a(b);return n(c.width)+n(c.paddingLeft)+n(c.paddingRight)+n(c.borderLeftWidth)+n(c.borderRightWidth)}function q(a){var b=Math.ceil,c=a.element,d=v(c.scrollTop),g=c.getBoundingClientRect();a.containerWidth=b(g.width),a.containerHeight=b(g.height),a.contentWidth=c.scrollWidth,a.contentHeight=c.scrollHeight,c.contains(a.scrollbarXRail)||(f(c,z.element.rail("x")).forEach(function(a){return e(a)}),c.appendChild(a.scrollbarXRail)),c.contains(a.scrollbarYRail)||(f(c,z.element.rail("y")).forEach(function(a){return e(a)}),c.appendChild(a.scrollbarYRail)),!a.settings.suppressScrollX&&a.containerWidth+a.settings.scrollXMarginOffset<a.contentWidth?(a.scrollbarXActive=!0,a.railXWidth=a.containerWidth-a.railXMarginWidth,a.railXRatio=a.containerWidth/a.railXWidth,a.scrollbarXWidth=r(a,n(a.railXWidth*a.containerWidth/a.contentWidth)),a.scrollbarXLeft=n((a.negativeScrollAdjustment+c.scrollLeft)*(a.railXWidth-a.scrollbarXWidth)/(a.contentWidth-a.containerWidth))):a.scrollbarXActive=!1,!a.settings.suppressScrollY&&a.containerHeight+a.settings.scrollYMarginOffset<a.contentHeight?(a.scrollbarYActive=!0,a.railYHeight=a.containerHeight-a.railYMarginHeight,a.railYRatio=a.containerHeight/a.railYHeight,a.scrollbarYHeight=r(a,n(a.railYHeight*a.containerHeight/a.contentHeight)),a.scrollbarYTop=n(d*(a.railYHeight-a.scrollbarYHeight)/(a.contentHeight-a.containerHeight))):a.scrollbarYActive=!1,a.scrollbarXLeft>=a.railXWidth-a.scrollbarXWidth&&(a.scrollbarXLeft=a.railXWidth-a.scrollbarXWidth),a.scrollbarYTop>=a.railYHeight-a.scrollbarYHeight&&(a.scrollbarYTop=a.railYHeight-a.scrollbarYHeight),s(c,a),a.scrollbarXActive?c.classList.add(z.state.active("x")):(c.classList.remove(z.state.active("x")),a.scrollbarXWidth=0,a.scrollbarXLeft=0,c.scrollLeft=!0===a.isRtl?a.contentWidth:0),a.scrollbarYActive?c.classList.add(z.state.active("y")):(c.classList.remove(z.state.active("y")),a.scrollbarYHeight=0,a.scrollbarYTop=0,c.scrollTop=0)}function r(a,b){var c=Math.min,d=Math.max;return a.settings.minScrollbarLength&&(b=d(b,a.settings.minScrollbarLength)),a.settings.maxScrollbarLength&&(b=c(b,a.settings.maxScrollbarLength)),b}function s(a,c){var d={width:c.railXWidth},e=v(a.scrollTop);d.left=c.isRtl?c.negativeScrollAdjustment+a.scrollLeft+c.containerWidth-c.contentWidth:a.scrollLeft,c.isScrollbarXUsingBottom?d.bottom=c.scrollbarXBottom-e:d.top=c.scrollbarXTop+e,b(c.scrollbarXRail,d);var f={top:e,height:c.railYHeight};c.isScrollbarYUsingRight?c.isRtl?f.right=c.contentWidth-(c.negativeScrollAdjustment+a.scrollLeft)-c.scrollbarYRight-c.scrollbarYOuterWidth-9:f.right=c.scrollbarYRight-a.scrollLeft:c.isRtl?f.left=c.negativeScrollAdjustment+a.scrollLeft+2*c.containerWidth-c.contentWidth-c.scrollbarYLeft-c.scrollbarYOuterWidth:f.left=c.scrollbarYLeft+a.scrollLeft,b(c.scrollbarYRail,f),b(c.scrollbarX,{left:c.scrollbarXLeft,width:c.scrollbarXWidth-c.railBorderXWidth}),b(c.scrollbarY,{top:c.scrollbarYTop,height:c.scrollbarYHeight-c.railBorderYWidth})}function t(a,b){function c(b){b.touches&&b.touches[0]&&(b[k]=b.touches[0].pageY),s[o]=t+v*(b[k]-u),g(a,p),q(a),b.stopPropagation(),b.preventDefault()}function d(){h(a,p),a[r].classList.remove(z.state.clicking),a.event.unbind(a.ownerDocument,"mousemove",c)}function f(b,e){t=s[o],e&&b.touches&&(b[k]=b.touches[0].pageY),u=b[k],v=(a[j]-a[i])/(a[l]-a[n]),e?a.event.bind(a.ownerDocument,"touchmove",c):(a.event.bind(a.ownerDocument,"mousemove",c),a.event.once(a.ownerDocument,"mouseup",d),b.preventDefault()),a[r].classList.add(z.state.clicking),b.stopPropagation()}var i=b[0],j=b[1],k=b[2],l=b[3],m=b[4],n=b[5],o=b[6],p=b[7],r=b[8],s=a.element,t=null,u=null,v=null;a.event.bind(a[m],"mousedown",function(a){f(a)}),a.event.bind(a[m],"touchstart",function(a){f(a,!0)})}var w="undefined"!=typeof Element&&(Element.prototype.matches||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector),z={main:"ps",rtl:"ps__rtl",element:{thumb:function(a){return"ps__thumb-"+a},rail:function(a){return"ps__rail-"+a},consuming:"ps__child--consume"},state:{focus:"ps--focus",clicking:"ps--clicking",active:function(a){return"ps--active-"+a},scrolling:function(a){return"ps--scrolling-"+a}}},A={x:null,y:null},B=function(a){this.element=a,this.handlers={}},C={isEmpty:{configurable:!0}};B.prototype.bind=function(a,b){"undefined"==typeof this.handlers[a]&&(this.handlers[a]=[]),this.handlers[a].push(b),this.element.addEventListener(a,b,!1)},B.prototype.unbind=function(a,b){var c=this;this.handlers[a]=this.handlers[a].filter(function(d){return!!(b&&d!==b)||(c.element.removeEventListener(a,d,!1),!1)})},B.prototype.unbindAll=function(){for(var a in this.handlers)this.unbind(a)},C.isEmpty.get=function(){var a=this;return Object.keys(this.handlers).every(function(b){return 0===a.handlers[b].length})},Object.defineProperties(B.prototype,C);var D=function(){this.eventElements=[]};D.prototype.eventElement=function(a){var b=this.eventElements.filter(function(b){return b.element===a})[0];return b||(b=new B(a),this.eventElements.push(b)),b},D.prototype.bind=function(a,b,c){this.eventElement(a).bind(b,c)},D.prototype.unbind=function(a,b,c){var d=this.eventElement(a);d.unbind(b,c),d.isEmpty&&this.eventElements.splice(this.eventElements.indexOf(d),1)},D.prototype.unbindAll=function(){this.eventElements.forEach(function(a){return a.unbindAll()}),this.eventElements=[]},D.prototype.once=function(a,b,c){var d=this.eventElement(a),e=function(a){d.unbind(b,e),c(a)};d.bind(b,e)};var E={isWebKit:"undefined"!=typeof document&&"WebkitAppearance"in document.documentElement.style,supportsTouch:"undefined"!=typeof window&&("ontouchstart"in window||"maxTouchPoints"in window.navigator&&0<window.navigator.maxTouchPoints||window.DocumentTouch&&document instanceof window.DocumentTouch),supportsIePointer:"undefined"!=typeof navigator&&navigator.msMaxTouchPoints,isChrome:"undefined"!=typeof navigator&&/Chrome/i.test(navigator&&navigator.userAgent)},F=function(){return{handlers:["click-rail","drag-thumb","keyboard","wheel","touch"],maxScrollbarLength:null,minScrollbarLength:null,scrollingThreshold:1e3,scrollXMarginOffset:0,scrollYMarginOffset:0,suppressScrollX:!1,suppressScrollY:!1,swipeEasing:!0,useBothWheelAxes:!1,wheelPropagation:!0,wheelSpeed:1}},G={"click-rail":function(a){a.element;a.event.bind(a.scrollbarY,"mousedown",function(a){return a.stopPropagation()}),a.event.bind(a.scrollbarYRail,"mousedown",function(b){var c=b.pageY-window.pageYOffset-a.scrollbarYRail.getBoundingClientRect().top,d=c>a.scrollbarYTop?1:-1;a.element.scrollTop+=d*a.containerHeight,q(a),b.stopPropagation()}),a.event.bind(a.scrollbarX,"mousedown",function(a){return a.stopPropagation()}),a.event.bind(a.scrollbarXRail,"mousedown",function(b){var c=b.pageX-window.pageXOffset-a.scrollbarXRail.getBoundingClientRect().left,d=c>a.scrollbarXLeft?1:-1;a.element.scrollLeft+=d*a.containerWidth,q(a),b.stopPropagation()})},"drag-thumb":function(a){t(a,["containerWidth","contentWidth","pageX","railXWidth","scrollbarX","scrollbarXWidth","scrollLeft","x","scrollbarXRail"]),t(a,["containerHeight","contentHeight","pageY","railYHeight","scrollbarY","scrollbarYHeight","scrollTop","y","scrollbarYRail"])},keyboard:function(a){function b(b,d){var e=v(c.scrollTop);if(0===b){if(!a.scrollbarYActive)return!1;if(0===e&&0<d||e>=a.contentHeight-a.containerHeight&&0>d)return!a.settings.wheelPropagation}var f=c.scrollLeft;if(0===d){if(!a.scrollbarXActive)return!1;if(0===f&&0>b||f>=a.contentWidth-a.containerWidth&&0<b)return!a.settings.wheelPropagation}return!0}var c=a.element,f=function(){return d(c,":hover")},g=function(){return d(a.scrollbarX,":focus")||d(a.scrollbarY,":focus")};a.event.bind(a.ownerDocument,"keydown",function(d){if(!(d.isDefaultPrevented&&d.isDefaultPrevented()||d.defaultPrevented)&&(f()||g())){var e=document.activeElement?document.activeElement:a.ownerDocument.activeElement;if(e){if("IFRAME"===e.tagName)e=e.contentDocument.activeElement;else// go deeper if element is a webcomponent 4038for(;e.shadowRoot;)e=e.shadowRoot.activeElement;if(o(e))return}var h=0,i=0;switch(d.which){case 37:h=d.metaKey?-a.contentWidth:d.altKey?-a.containerWidth:-30;break;case 38:i=d.metaKey?a.contentHeight:d.altKey?a.containerHeight:30;break;case 39:h=d.metaKey?a.contentWidth:d.altKey?a.containerWidth:30;break;case 40:i=d.metaKey?-a.contentHeight:d.altKey?-a.containerHeight:-30;break;case 32:i=d.shiftKey?a.containerHeight:-a.containerHeight;break;case 33:i=a.containerHeight;break;case 34:i=-a.containerHeight;break;case 36:i=a.contentHeight;break;case 35:i=-a.contentHeight;break;default:return;}a.settings.suppressScrollX&&0!==h||a.settings.suppressScrollY&&0!==i||(c.scrollTop-=i,c.scrollLeft+=h,q(a),b(h,i)&&d.preventDefault())}})},wheel:function(b){function c(a,c){var d,e=v(h.scrollTop),f=0===h.scrollTop,g=e+h.offsetHeight===h.scrollHeight,i=0===h.scrollLeft,j=h.scrollLeft+h.offsetWidth===h.scrollWidth;return d=u(c)>u(a)?f||g:i||j,!d||!b.settings.wheelPropagation}function d(a){var b=a.deltaX,c=-1*a.deltaY;return("undefined"==typeof b||"undefined"==typeof c)&&(b=-1*a.wheelDeltaX/6,c=a.wheelDeltaY/6),a.deltaMode&&1===a.deltaMode&&(b*=10,c*=10),b!==b&&c!==c/* NaN checks */&&(b=0,c=a.wheelDelta),a.shiftKey?[-c,-b]:[b,c]}function f(b,c,d){// FIXME: this is a workaround for <select> issue in FF and IE #571 4039if(!E.isWebKit&&h.querySelector("select:focus"))return!0;if(!h.contains(b))return!1;for(var e=b;e&&e!==h;){if(e.classList.contains(z.element.consuming))return!0;var f=a(e);// if deltaY && vertical scrollable 4040if(d&&f.overflowY.match(/(scroll|auto)/)){var g=e.scrollHeight-e.clientHeight;if(0<g&&(0<e.scrollTop&&0>d||e.scrollTop<g&&0<d))return!0}// if deltaX && horizontal scrollable 4041if(c&&f.overflowX.match(/(scroll|auto)/)){var i=e.scrollWidth-e.clientWidth;if(0<i&&(0<e.scrollLeft&&0>c||e.scrollLeft<i&&0<c))return!0}e=e.parentNode}return!1}function g(a){var e=d(a),g=e[0],i=e[1];if(!f(a.target,g,i)){var j=!1;b.settings.useBothWheelAxes?b.scrollbarYActive&&!b.scrollbarXActive?(i?h.scrollTop-=i*b.settings.wheelSpeed:h.scrollTop+=g*b.settings.wheelSpeed,j=!0):b.scrollbarXActive&&!b.scrollbarYActive&&(g?h.scrollLeft+=g*b.settings.wheelSpeed:h.scrollLeft-=i*b.settings.wheelSpeed,j=!0):(h.scrollTop-=i*b.settings.wheelSpeed,h.scrollLeft+=g*b.settings.wheelSpeed),q(b),j=j||c(g,i),j&&!a.ctrlKey&&(a.stopPropagation(),a.preventDefault())}}var h=b.element;"undefined"==typeof window.onwheel?"undefined"!=typeof window.onmousewheel&&b.event.bind(h,"mousewheel",g):b.event.bind(h,"wheel",g)},touch:function(b){function c(a,c){var d=v(l.scrollTop),e=l.scrollLeft,f=u(a),g=u(c);if(g>f){// user is perhaps trying to swipe up/down the page 4042if(0>c&&d===b.contentHeight-b.containerHeight||0<c&&0===d)// set prevent for mobile Chrome refresh 4043return 0===window.scrollY&&0<c&&E.isChrome;}else if(f>g&&(0>a&&e===b.contentWidth-b.containerWidth||0<a&&0===e))// user is perhaps trying to swipe left/right across the page 4044return!0;return!0}function d(a,c){l.scrollTop-=c,l.scrollLeft-=a,q(b)}function f(a){return a.targetTouches?a.targetTouches[0]:a}function g(a){return!(a.pointerType&&"pen"===a.pointerType&&0===a.buttons)&&(!!(a.targetTouches&&1===a.targetTouches.length)||!!(a.pointerType&&"mouse"!==a.pointerType&&a.pointerType!==a.MSPOINTER_TYPE_MOUSE))}function h(a){if(g(a)){var b=f(a);m.pageX=b.pageX,m.pageY=b.pageY,n=new Date().getTime(),null!==p&&clearInterval(p)}}function i(b,c,d){if(!l.contains(b))return!1;for(var e=b;e&&e!==l;){if(e.classList.contains(z.element.consuming))return!0;var f=a(e);// if deltaY && vertical scrollable 4045if(d&&f.overflowY.match(/(scroll|auto)/)){var g=e.scrollHeight-e.clientHeight;if(0<g&&(0<e.scrollTop&&0>d||e.scrollTop<g&&0<d))return!0}// if deltaX && horizontal scrollable 4046if(c&&f.overflowX.match(/(scroll|auto)/)){var h=e.scrollWidth-e.clientWidth;if(0<h&&(0<e.scrollLeft&&0>c||e.scrollLeft<h&&0<c))return!0}e=e.parentNode}return!1}function j(a){if(g(a)){var b=f(a),e={pageX:b.pageX,pageY:b.pageY},h=e.pageX-m.pageX,j=e.pageY-m.pageY;if(i(a.target,h,j))return;d(h,j),m=e;var k=new Date().getTime(),l=k-n;0<l&&(o.x=h/l,o.y=j/l,n=k),c(h,j)&&a.preventDefault()}}function k(){b.settings.swipeEasing&&(clearInterval(p),p=setInterval(function(){return b.isInitialized?void clearInterval(p):o.x||o.y?.01>u(o.x)&&.01>u(o.y)?void clearInterval(p):void(d(30*o.x,30*o.y),o.x*=.8,o.y*=.8):void clearInterval(p)},10))}if(E.supportsTouch||E.supportsIePointer){var l=b.element,m={},n=0,o={},p=null;E.supportsTouch?(b.event.bind(l,"touchstart",h),b.event.bind(l,"touchmove",j),b.event.bind(l,"touchend",k)):E.supportsIePointer&&(window.PointerEvent?(b.event.bind(l,"pointerdown",h),b.event.bind(l,"pointermove",j),b.event.bind(l,"pointerup",k)):window.MSPointerEvent&&(b.event.bind(l,"MSPointerDown",h),b.event.bind(l,"MSPointerMove",j),b.event.bind(l,"MSPointerUp",k)))}}},H=function(d,e){var f=this;if(void 0===e&&(e={}),"string"==typeof d&&(d=document.querySelector(d)),!d||!d.nodeName)throw new Error("no element is specified to initialize PerfectScrollbar");for(var g in this.element=d,d.classList.add(z.main),this.settings=F(),e)this.settings[g]=e[g];this.containerWidth=null,this.containerHeight=null,this.contentWidth=null,this.contentHeight=null;var h=function(){return d.classList.add(z.state.focus)},i=function(){return d.classList.remove(z.state.focus)};this.isRtl="rtl"===a(d).direction,!0===this.isRtl&&d.classList.add(z.rtl),this.isNegativeScroll=function(){var a=d.scrollLeft,b=null;return d.scrollLeft=-1,b=0>d.scrollLeft,d.scrollLeft=a,b}(),this.negativeScrollAdjustment=this.isNegativeScroll?d.scrollWidth-d.clientWidth:0,this.event=new D,this.ownerDocument=d.ownerDocument||document,this.scrollbarXRail=c(z.element.rail("x")),d.appendChild(this.scrollbarXRail),this.scrollbarX=c(z.element.thumb("x")),this.scrollbarXRail.appendChild(this.scrollbarX),this.scrollbarX.setAttribute("tabindex",0),this.event.bind(this.scrollbarX,"focus",h),this.event.bind(this.scrollbarX,"blur",i),this.scrollbarXActive=null,this.scrollbarXWidth=null,this.scrollbarXLeft=null;var j=a(this.scrollbarXRail);this.scrollbarXBottom=parseInt(j.bottom,10),isNaN(this.scrollbarXBottom)?(this.isScrollbarXUsingBottom=!1,this.scrollbarXTop=n(j.top)):this.isScrollbarXUsingBottom=!0,this.railBorderXWidth=n(j.borderLeftWidth)+n(j.borderRightWidth),b(this.scrollbarXRail,{display:"block"}),this.railXMarginWidth=n(j.marginLeft)+n(j.marginRight),b(this.scrollbarXRail,{display:""}),this.railXWidth=null,this.railXRatio=null,this.scrollbarYRail=c(z.element.rail("y")),d.appendChild(this.scrollbarYRail),this.scrollbarY=c(z.element.thumb("y")),this.scrollbarYRail.appendChild(this.scrollbarY),this.scrollbarY.setAttribute("tabindex",0),this.event.bind(this.scrollbarY,"focus",h),this.event.bind(this.scrollbarY,"blur",i),this.scrollbarYActive=null,this.scrollbarYHeight=null,this.scrollbarYTop=null;var k=a(this.scrollbarYRail);this.scrollbarYRight=parseInt(k.right,10),isNaN(this.scrollbarYRight)?(this.isScrollbarYUsingRight=!1,this.scrollbarYLeft=n(k.left)):this.isScrollbarYUsingRight=!0,this.scrollbarYOuterWidth=this.isRtl?p(this.scrollbarY):null,this.railBorderYWidth=n(k.borderTopWidth)+n(k.borderBottomWidth),b(this.scrollbarYRail,{display:"block"}),this.railYMarginHeight=n(k.marginTop)+n(k.marginBottom),b(this.scrollbarYRail,{display:""}),this.railYHeight=null,this.railYRatio=null,this.reach={x:0>=d.scrollLeft?"start":d.scrollLeft>=this.contentWidth-this.containerWidth?"end":null,y:0>=d.scrollTop?"start":d.scrollTop>=this.contentHeight-this.containerHeight?"end":null},this.isAlive=!0,this.settings.handlers.forEach(function(a){return G[a](f)}),this.lastScrollTop=v(d.scrollTop),this.lastScrollLeft=d.scrollLeft,this.event.bind(this.element,"scroll",function(a){return f.onScroll(a)}),q(this)};return H.prototype.update=function(){this.isAlive&&(// Recalcuate negative scrollLeft adjustment 4047// Recalculate rail margins 4048// Hide scrollbars not to affect scrollWidth and scrollHeight 4049this.negativeScrollAdjustment=this.isNegativeScroll?this.element.scrollWidth-this.element.clientWidth:0,b(this.scrollbarXRail,{display:"block"}),b(this.scrollbarYRail,{display:"block"}),this.railXMarginWidth=n(a(this.scrollbarXRail).marginLeft)+n(a(this.scrollbarXRail).marginRight),this.railYMarginHeight=n(a(this.scrollbarYRail).marginTop)+n(a(this.scrollbarYRail).marginBottom),b(this.scrollbarXRail,{display:"none"}),b(this.scrollbarYRail,{display:"none"}),q(this),l(this,"top",0,!1,!0),l(this,"left",0,!1,!0),b(this.scrollbarXRail,{display:""}),b(this.scrollbarYRail,{display:""}))},H.prototype.onScroll=function(){this.isAlive&&(q(this),l(this,"top",this.element.scrollTop-this.lastScrollTop),l(this,"left",this.element.scrollLeft-this.lastScrollLeft),this.lastScrollTop=v(this.element.scrollTop),this.lastScrollLeft=this.element.scrollLeft)},H.prototype.destroy=function(){this.isAlive&&(// unset elements 4050this.event.unbindAll(),e(this.scrollbarX),e(this.scrollbarY),e(this.scrollbarXRail),e(this.scrollbarYRail),this.removePsClasses(),this.element=null,this.scrollbarX=null,this.scrollbarY=null,this.scrollbarXRail=null,this.scrollbarYRail=null,this.isAlive=!1)},H.prototype.removePsClasses=function(){this.element.className=this.element.className.split(" ").filter(function(a){return!a.match(/^ps([-_].+|)$/)}).join(" ")},H}); 4051//# sourceMappingURL=perfect-scrollbar.min.js.map
vendor: 6,734 bytes, lines 4052-4064
4052`},8885:function(e){e.exports=`(function(q,g){"function"===typeof define&&define.amd?define([],g):"object"===typeof module&&module.exports?module.exports=g():q.Rellax=g()})("undefined"!==typeof window?window:global,function(){var q=function(g,u){function C(){if(3===a.options.breakpoints.length&&Array.isArray(a.options.breakpoints)){var f=!0,c=!0,b;a.options.breakpoints.forEach(function(a){"number"!==typeof a&&(c=!1);null!==b&&a<b&&(f=!1);b=a});if(f&&c)return}a.options.breakpoints=[576,768,1201];console.warn("Rellax: You must pass an array of 3 numbers in ascending order to the breakpoints option. Defaults reverted")} 4053var a=Object.create(q.prototype),l=0,v=0,m=0,n=0,d=[],w=!0,A=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||function(a){return setTimeout(a,1E3/60)},p=null,x=!1;try{var k=Object.defineProperty({},"passive",{get:function(){x=!0}});window.addEventListener("testPassive",null,k);window.removeEventListener("testPassive",null,k)}catch(f){}var D=window.cancelAnimationFrame||window.mozCancelAnimationFrame|| 4054clearTimeout,E=window.transformProp||function(){var a=document.createElement("div");if(null===a.style.transform){var c=["Webkit","Moz","ms"],b;for(b in c)if(void 0!==a.style[c[b]+"Transform"])return c[b]+"Transform"}return"transform"}();a.options={speed:-2,verticalSpeed:null,horizontalSpeed:null,breakpoints:[576,768,1201],center:!1,wrapper:null,relativeToWrapper:!1,round:!0,vertical:!0,horizontal:!1,verticalScrollAxis:"y",horizontalScrollAxis:"x",callback:function(){}};u&&Object.keys(u).forEach(function(d){a.options[d]= 4055u[d]});u&&u.breakpoints&&C();g||(g=".rellax");k="string"===typeof g?document.querySelectorAll(g):[g];if(0<k.length){a.elems=k;if(a.options.wrapper&&!a.options.wrapper.nodeType)if(k=document.querySelector(a.options.wrapper))a.options.wrapper=k;else{console.warn("Rellax: The wrapper you're trying to use doesn't exist.");return}var F,B=function(){for(var f=0;f<d.length;f++)a.elems[f].style.cssText=d[f].style;d=[];v=window.innerHeight;n=window.innerWidth;f=a.options.breakpoints;F=n<f[0]?"xs":n>=f[0]&&n< 4056f[1]?"sm":n>=f[1]&&n<f[2]?"md":"lg";H();for(f=0;f<a.elems.length;f++){var c=void 0,b=a.elems[f],e=b.getAttribute("data-rellax-percentage"),y=b.getAttribute("data-rellax-speed"),t=b.getAttribute("data-rellax-xs-speed"),g=b.getAttribute("data-rellax-mobile-speed"),h=b.getAttribute("data-rellax-tablet-speed"),k=b.getAttribute("data-rellax-desktop-speed"),l=b.getAttribute("data-rellax-vertical-speed"),m=b.getAttribute("data-rellax-horizontal-speed"),p=b.getAttribute("data-rellax-vertical-scroll-axis"), 4057q=b.getAttribute("data-rellax-horizontal-scroll-axis"),u=b.getAttribute("data-rellax-zindex")||0,x=b.getAttribute("data-rellax-min"),A=b.getAttribute("data-rellax-max"),C=b.getAttribute("data-rellax-min-x"),D=b.getAttribute("data-rellax-max-x"),E=b.getAttribute("data-rellax-min-y"),L=b.getAttribute("data-rellax-max-y"),r=!0;t||g||h||k?c={xs:t,sm:g,md:h,lg:k}:r=!1;t=a.options.wrapper?a.options.wrapper.scrollTop:window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop;a.options.relativeToWrapper&& 4058(t=(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop)-a.options.wrapper.offsetTop);var z=a.options.vertical?e||a.options.center?t:0:0,I=a.options.horizontal?e||a.options.center?a.options.wrapper?a.options.wrapper.scrollLeft:window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft:0:0;t=z+b.getBoundingClientRect().top;g=b.clientHeight||b.offsetHeight||b.scrollHeight;h=I+b.getBoundingClientRect().left;k=b.clientWidth||b.offsetWidth||b.scrollWidth; 4059z=e?e:(z-t+v)/(g+v);e=e?e:(I-h+n)/(k+n);a.options.center&&(z=e=.5);c=r&&null!==c[F]?Number(c[F]):y?y:a.options.speed;l=l?l:a.options.verticalSpeed;m=m?m:a.options.horizontalSpeed;p=p?p:a.options.verticalScrollAxis;q=q?q:a.options.horizontalScrollAxis;y=J(e,z,c,l,m);b=b.style.cssText;r="";if(e=/transform\\s*:/i.exec(b))r=b.slice(e.index),r=(e=r.indexOf(";"))?" "+r.slice(11,e).replace(/\\s/g,""):" "+r.slice(11).replace(/\\s/g,"");d.push({baseX:y.x,baseY:y.y,top:t,left:h,height:g,width:k,speed:c,verticalSpeed:l, 4060horizontalSpeed:m,verticalScrollAxis:p,horizontalScrollAxis:q,style:b,transform:r,zindex:u,min:x,max:A,minX:C,maxX:D,minY:E,maxY:L})}K();w&&(window.addEventListener("resize",B),w=!1,G())},H=function(){var d=l,c=m;l=a.options.wrapper?a.options.wrapper.scrollTop:(document.documentElement||document.body.parentNode||document.body).scrollTop||window.pageYOffset;m=a.options.wrapper?a.options.wrapper.scrollLeft:(document.documentElement||document.body.parentNode||document.body).scrollLeft||window.pageXOffset; 4061a.options.relativeToWrapper&&(l=((document.documentElement||document.body.parentNode||document.body).scrollTop||window.pageYOffset)-a.options.wrapper.offsetTop);return d!=l&&a.options.vertical||c!=m&&a.options.horizontal?!0:!1},J=function(d,c,b,e,g){var f={};d=100*(g?g:b)*(1-d);c=100*(e?e:b)*(1-c);f.x=a.options.round?Math.round(d):Math.round(100*d)/100;f.y=a.options.round?Math.round(c):Math.round(100*c)/100;return f},h=function(){window.removeEventListener("resize",h);window.removeEventListener("orientationchange", 4062h);(a.options.wrapper?a.options.wrapper:window).removeEventListener("scroll",h);(a.options.wrapper?a.options.wrapper:document).removeEventListener("touchmove",h);p=A(G)},G=function(){H()&&!1===w?(K(),p=A(G)):(p=null,window.addEventListener("resize",h),window.addEventListener("orientationchange",h),(a.options.wrapper?a.options.wrapper:window).addEventListener("scroll",h,x?{passive:!0}:!1),(a.options.wrapper?a.options.wrapper:document).addEventListener("touchmove",h,x?{passive:!0}:!1))},K=function(){for(var f, 4063c=0;c<a.elems.length;c++){var b=d[c].verticalScrollAxis.toLowerCase(),e=d[c].horizontalScrollAxis.toLowerCase();f=-1!=b.indexOf("x")?l:0;b=-1!=b.indexOf("y")?l:0;var g=-1!=e.indexOf("x")?m:0;e=-1!=e.indexOf("y")?m:0;f=J((f+g-d[c].left+n)/(d[c].width+n),(b+e-d[c].top+v)/(d[c].height+v),d[c].speed,d[c].verticalSpeed,d[c].horizontalSpeed);e=f.y-d[c].baseY;b=f.x-d[c].baseX;null!==d[c].min&&(a.options.vertical&&!a.options.horizontal&&(e=e<=d[c].min?d[c].min:e),a.options.horizontal&&!a.options.vertical&& 4064(b=b<=d[c].min?d[c].min:b));null!=d[c].minY&&(e=e<=d[c].minY?d[c].minY:e);null!=d[c].minX&&(b=b<=d[c].minX?d[c].minX:b);null!==d[c].max&&(a.options.vertical&&!a.options.horizontal&&(e=e>=d[c].max?d[c].max:e),a.options.horizontal&&!a.options.vertical&&(b=b>=d[c].max?d[c].max:b));null!=d[c].maxY&&(e=e>=d[c].maxY?d[c].maxY:e);null!=d[c].maxX&&(b=b>=d[c].maxX?d[c].maxX:b);a.elems[c].style[E]="translate3d("+(a.options.horizontal?b:"0")+"px,"+(a.options.vertical?e:"
vendor: 2,683 bytes, lines 4064-4072
40640")+"px,"+d[c].zindex+"px) "+d[c].transform}a.options.callback(f)}; 4065a.destroy=function(){for(var f=0;f<a.elems.length;f++)a.elems[f].style.cssText=d[f].style;w||(window.removeEventListener("resize",B),w=!0);D(p);p=null};B();a.refresh=B;return a}console.warn("Rellax: The elements you're trying to select don't exist.")};return q}); 4066`},1320:function(e){e.exports=`/*! 4067 * typeahead.js 0.11.1 4068 * https://github.com/twitter/typeahead.js 4069 * Copyright 2013-2015 Twitter, Inc. and other contributors; Licensed MIT 4070 */ 4071 4072!function(a,b){"function"==typeof define&&define.amd?define("bloodhound",["jquery"],function(c){return a.Bloodhound=b(c)}):"object"==typeof exports?module.exports=b(require("jquery")):a.Bloodhound=b(jQuery)}(this,function(a){var b=function(){"use strict";return{isMsie:function(){return/(msie|trident)/i.test(navigator.userAgent)?navigator.userAgent.match(/(msie |rv:)(\\d+(.\\d+)?)/i)[2]:!1},isBlankString:function(a){return!a||/^\\s*$/.test(a)},escapeRegExChars:function(a){return a.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g,"\\\\$&")},isString:function(a){return"string"==typeof a},isNumber:function(a){return"number"==typeof a},isArray:a.isArray,isFunction:a.isFunction,isObject:a.isPlainObject,isUndefined:function(a){return"undefined"==typeof a},isElement:function(a){return!(!a||1!==a.nodeType)},isJQuery:function(b){return b instanceof a},toStr:function(a){return b.isUndefined(a)||null===a?"":a+""},bind:a.proxy,each:function(b,c){function d(a,b){return c(b,a)}a.each(b,d)},map:a.map,filter:a.grep,every:function(b,c){var d=!0;return b?(a.each(b,function(a,e){return(d=c.call(null,e,a,b))?void 0:!1}),!!d):d},some:function(b,c){var d=!1;return b?(a.each(b,function(a,e){return(d=c.call(null,e,a,b))?!1:void 0}),!!d):d},mixin:a.extend,identity:function(a){return a},clone:function(b){return a.extend(!0,{},b)},getIdGenerator:function(){var a=0;return function(){return a++}},templatify:function(b){function c(){return String(b)}return a.isFunction(b)?b:c},defer:function(a){setTimeout(a,0)},debounce:function(a,b,c){var d,e;return function(){var f,g,h=this,i=arguments;return f=function(){d=null,c||(e=a.apply(h,i))},g=c&&!d,clearTimeout(d),d=setTimeout(f,b),g&&(e=a.apply(h,i)),e}},throttle:function(a,b){var c,d,e,f,g,h;return g=0,h=function(){g=new Date,e=null,f=a.apply(c,d)},function(){var i=new Date,j=b-(i-g);return c=this,d=arguments,0>=j?(clearTimeout(e),e=null,g=i,f=a.apply(c,d)):e||(e=setTimeout(h,j)),f}},stringify:function(a){return b.isString(a)?a:JSON.stringify(a)},noop:function(){}}}(),c="0.11.1",d=function(){"use strict";function a(a){return a=b.toStr(a),a?a.split(/\\s+/):[]}function c(a){return a=b.toStr(a),a?a.split(/\
vendor: 10,702 bytes, line 4072
4072\W+/):[]}function d(a){return function(c){return c=b.isArray(c)?c:[].slice.call(arguments,0),function(d){var e=[];return b.each(c,function(c){e=e.concat(a(b.toStr(d[c])))}),e}}}return{nonword:c,whitespace:a,obj:{nonword:d(c),whitespace:d(a)}}}(),e=function(){"use strict";function c(c){this.maxSize=b.isNumber(c)?c:100,this.reset(),this.maxSize<=0&&(this.set=this.get=a.noop)}function d(){this.head=this.tail=null}function e(a,b){this.key=a,this.val=b,this.prev=this.next=null}return b.mixin(c.prototype,{set:function(a,b){var c,d=this.list.tail;this.size>=this.maxSize&&(this.list.remove(d),delete this.hash[d.key],this.size--),(c=this.hash[a])?(c.val=b,this.list.moveToFront(c)):(c=new e(a,b),this.list.add(c),this.hash[a]=c,this.size++)},get:function(a){var b=this.hash[a];return b?(this.list.moveToFront(b),b.val):void 0},reset:function(){this.size=0,this.hash={},this.list=new d}}),b.mixin(d.prototype,{add:function(a){this.head&&(a.next=this.head,this.head.prev=a),this.head=a,this.tail=this.tail||a},remove:function(a){a.prev?a.prev.next=a.next:this.head=a.next,a.next?a.next.prev=a.prev:this.tail=a.prev},moveToFront:function(a){this.remove(a),this.add(a)}}),c}(),f=function(){"use strict";function c(a,c){this.prefix=["__",a,"__"].join(""),this.ttlKey="__ttl__",this.keyMatcher=new RegExp("^"+b.escapeRegExChars(this.prefix)),this.ls=c||h,!this.ls&&this._noop()}function d(){return(new Date).getTime()}function e(a){return JSON.stringify(b.isUndefined(a)?null:a)}function f(b){return a.parseJSON(b)}function g(a){var b,c,d=[],e=h.length;for(b=0;e>b;b++)(c=h.key(b)).match(a)&&d.push(c.replace(a,""));return d}var h;try{h=window.localStorage,h.setItem("~~~","!"),h.removeItem("~~~")}catch(i){h=null}return b.mixin(c.prototype,{_prefix:function(a){return this.prefix+a},_ttlKey:function(a){return this._prefix(a)+this.ttlKey},_noop:function(){this.get=this.set=this.remove=this.clear=this.isExpired=b.noop},_safeSet:function(a,b){try{this.ls.setItem(a,b)}catch(c){"QuotaExceededError"===c.name&&(this.clear(),this._noop())}},get:function(a){return this.isExpired(a)&&this.remove(a),f(this.ls.getItem(this._prefix(a)))},set:function(a,c,f){return b.isNumber(f)?this._safeSet(this._ttlKey(a),e(d()+f)):this.ls.removeItem(this._ttlKey(a)),this._safeSet(this._prefix(a),e(c))},remove:function(a){return this.ls.removeItem(this._ttlKey(a)),this.ls.removeItem(this._prefix(a)),this},clear:function(){var a,b=g(this.keyMatcher);for(a=b.length;a--;)this.remove(b[a]);return this},isExpired:function(a){var c=f(this.ls.getItem(this._ttlKey(a)));return b.isNumber(c)&&d()>c?!0:!1}}),c}(),g=function(){"use strict";function c(a){a=a||{},this.cancelled=!1,this.lastReq=null,this._send=a.transport,this._get=a.limiter?a.limiter(this._get):this._get,this._cache=a.cache===!1?new e(0):h}var d=0,f={},g=6,h=new e(10);return c.setMaxPendingRequests=function(a){g=a},c.resetCache=function(){h.reset()},b.mixin(c.prototype,{_fingerprint:function(b){return b=b||{},b.url+b.type+a.param(b.data||{})},_get:function(a,b){function c(a){b(null,a),k._cache.set(i,a)}function e(){b(!0)}function h(){d--,delete f[i],k.onDeckRequestArgs&&(k._get.apply(k,k.onDeckRequestArgs),k.onDeckRequestArgs=null)}var i,j,k=this;i=this._fingerprint(a),this.cancelled||i!==this.lastReq||((j=f[i])?j.done(c).fail(e):g>d?(d++,f[i]=this._send(a).done(c).fail(e).always(h)):this.onDeckRequestArgs=[].slice.call(arguments,0))},get:function(c,d){var e,f;d=d||a.noop,c=b.isString(c)?{url:c}:c||{},f=this._fingerprint(c),this.cancelled=!1,this.lastReq=f,(e=this._cache.get(f))?d(null,e):this._get(c,d)},cancel:function(){this.cancelled=!0}}),c}(),h=window.SearchIndex=function(){"use strict";function c(c){c=c||{},c.datumTokenizer&&c.queryTokenizer||a.error("datumTokenizer and queryTokenizer are both required"),this.identify=c.identify||b.stringify,this.datumTokenizer=c.datumTokenizer,this.queryTokenizer=c.queryTokenizer,this.reset()}function d(a){return a=b.filter(a,function(a){return!!a}),a=b.map(a,function(a){return a.toLowerCase()})}function e(){var a={};return a[i]=[],a[h]={},a}function f(a){for(var b={},c=[],d=0,e=a.length;e>d;d++)b[a[d]]||(b[a[d]]=!0,c.push(a[d]));return c}function g(a,b){var c=0,d=0,e=[];a=a.sort(),b=b.sort();for(var f=a.length,g=b.length;f>c&&g>d;)a[c]<b[d]?c++:a[c]>b[d]?d++:(e.push(a[c]),c++,d++);return e}var h="c",i="i";return b.mixin(c.prototype,{bootstrap:function(a){this.datums=a.datums,this.trie=a.trie},add:function(a){var c=this;a=b.isArray(a)?a:[a],b.each(a,function(a){var f,g;c.datums[f=c.identify(a)]=a,g=d(c.datumTokenizer(a)),b.each(g,function(a){var b,d,g;for(b=c.trie,d=a.split("");g=d.shift();)b=b[h][g]||(b[h][g]=e()),b[i].push(f)})})},get:function(a){var c=this;return b.map(a,function(a){return c.datums[a]})},search:function(a){var c,e,j=this;return c=d(this.queryTokenizer(a)),b.each(c,function(a){var b,c,d,f;if(e&&0===e.length)return!1;for(b=j.trie,c=a.split("");b&&(d=c.shift());)b=b[h][d];return b&&0===c.length?(f=b[i].slice(0),void(e=e?g(e,f):f)):(e=[],!1)}),e?b.map(f(e),function(a){return j.datums[a]}):[]},all:function(){var a=[];for(var b in this.datums)a.push(this.datums[b]);return a},reset:function(){this.datums={},this.trie=e()},serialize:function(){return{datums:this.datums,trie:this.trie}}}),c}(),i=function(){"use strict";function a(a){this.url=a.url,this.ttl=a.ttl,this.cache=a.cache,this.prepare=a.prepare,this.transform=a.transform,this.transport=a.transport,this.thumbprint=a.thumbprint,this.storage=new f(a.cacheKey)}var c;return c={data:"data",protocol:"protocol",thumbprint:"thumbprint"},b.mixin(a.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},store:function(a){this.cache&&(this.storage.set(c.data,a,this.ttl),this.storage.set(c.protocol,location.protocol,this.ttl),this.storage.set(c.thumbprint,this.thumbprint,this.ttl))},fromCache:function(){var a,b={};return this.cache?(b.data=this.storage.get(c.data),b.protocol=this.storage.get(c.protocol),b.thumbprint=this.storage.get(c.thumbprint),a=b.thumbprint!==this.thumbprint||b.protocol!==location.protocol,b.data&&!a?b.data:null):null},fromNetwork:function(a){function b(){a(!0)}function c(b){a(null,e.transform(b))}var d,e=this;a&&(d=this.prepare(this._settings()),this.transport(d).fail(b).done(c))},clear:function(){return this.storage.clear(),this}}),a}(),j=function(){"use strict";function a(a){this.url=a.url,this.prepare=a.prepare,this.transform=a.transform,this.transport=new g({cache:a.cache,limiter:a.limiter,transport:a.transport})}return b.mixin(a.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},get:function(a,b){function c(a,c){b(a?[]:e.transform(c))}var d,e=this;if(b)return a=a||"",d=this.prepare(a,this._settings()),this.transport.get(d,c)},cancelLastRequest:function(){this.transport.cancel()}}),a}(),k=function(){"use strict";function d(d){var e;return d?(e={url:null,ttl:864e5,cache:!0,cacheKey:null,thumbprint:"",prepare:b.identity,transform:b.identity,transport:null},d=b.isString(d)?{url:d}:d,d=b.mixin(e,d),!d.url&&a.error("prefetch requires url to be set"),d.transform=d.filter||d.transform,d.cacheKey=d.cacheKey||d.url,d.thumbprint=c+d.thumbprint,d.transport=d.transport?h(d.transport):a.ajax,d):null}function e(c){var d;if(c)return d={url:null,cache:!0,prepare:null,replace:null,wildcard:null,limiter:null,rateLimitBy:"debounce",rateLimitWait:300,transform:b.identity,transport:null},c=b.isString(c)?{url:c}:c,c=b.mixin(d,c),!c.url&&a.error("remote requires url to be set"),c.transform=c.filter||c.transform,c.prepare=f(c),c.limiter=g(c),c.transport=c.transport?h(c.transport):a.ajax,delete c.replace,delete c.wildcard,delete c.rateLimitBy,delete c.rateLimitWait,c}function f(a){function b(a,b){return b.url=f(b.url,a),b}function c(a,b){return b.url=b.url.replace(g,encodeURIComponent(a)),b}function d(a,b){return b}var e,f,g;return e=a.prepare,f=a.replace,g=a.wildcard,e?e:e=f?b:a.wildcard?c:d}function g(a){function c(a){return function(c){return b.debounce(c,a)}}function d(a){return function(c){return b.throttle(c,a)}}var e,f,g;return e=a.limiter,f=a.rateLimitBy,g=a.rateLimitWait,e||(e=/^throttle$/i.test(f)?d(g):c(g)),e}function h(c){return function(d){function e(a){b.defer(function(){g.resolve(a)})}function f(a){b.defer(function(){g.reject(a)})}var g=a.Deferred();return c(d,e,f),g}}return function(c){var f,g;return f={initialize:!0,identify:b.stringify,datumTokenizer:null,queryTokenizer:null,sufficient:5,sorter:null,local:[],prefetch:null,remote:null},c=b.mixin(f,c||{}),!c.datumTokenizer&&a.error("datumTokenizer is required"),!c.queryTokenizer&&a.error("queryTokenizer is required"),g=c.sorter,c.sorter=g?function(a){return a.sort(g)}:b.identity,c.local=b.isFunction(c.local)?c.local():c.local,c.prefetch=d(c.prefetch),c.remote=e(c.remote),c}}(),l=function(){"use strict";function c(a){a=k(a),this.sorter=a.sorter,this.identify=a.identify,this.sufficient=a.sufficient,this.local=a.local,this.remote=a.remote?new j(a.remote):null,this.prefetch=a.prefetch?new i(a.prefetch):null,this.index=new h({identify:this.identify,datumTokenizer:a.datumTokenizer,queryTokenizer:a.queryTokenizer}),a.initialize!==!1&&this.initialize()}var e;return e=window&&window.Bloodhound,c.noConflict=function(){return window&&(window.Bloodhound=e),c},c.tokenizers=d,b.mixin(c.prototype,{__ttAdapter:function(){function a(a,b,d){return c.search(a,b,d)}function b(a,b){return c.search(a,b)}var c=this;return this.remote?a:b},_loadPrefetch:function(){function b(a,b){return a?c.reject():(e.add(b),e.prefetch.store(e.index.serialize()),void c.resolve())}var c,d,e=this;return c=a.Deferred(),this.prefetch?(d=this.prefetch.fromCache())?(this.index.bootstrap(d),c.resolve()):this.prefetch.fromNetwork(b):c.resolve(),c.promise()},_initialize:function(){function a(){b.add(b.local)}var b=this;return this.clear(),(this.initPromise=this._loadPrefetch()).done(a),this.initPromise},initialize:function(a){return!this.initPromise||a?this._initialize():this.initPromise},add:function(a){return this.index.add(a),this},get:function(a){return a=b.isArray(a)?a:[].slice.call(arguments),this.index.get(a)},search:function(a,c,d){function e(a){var c=[];b.each(a,function(a){!b.some(f,function(b){return g.identify(a)===g.identify(b)})&&c.push(a)}),d&&d(c)}var f,g=this;return f=this.sorter(this.index.search(a)),c(this.remote?f.slice():f),this.remote&&f.length<this.sufficient?this.remote.get(a,e):this.remote&&this.remote.cancelLastRequest(),this},all:function(){return this.index.all()},clear:function(){return this.index.reset(),this},clearPrefetchCache:function(){return this.prefetch&&this.prefetch.clear(),this},clearRemoteCache:function(){return g.resetCache(),this},ttAdapter:function(){return this.__ttAdapter()}}),c}();return l});
vendor: 3,346 bytes, lines 4072-4079
4072 4073`},3622:function(e){e.exports=`/*! 4074 * typeahead.js 0.11.1 4075 * https://github.com/twitter/typeahead.js 4076 * Copyright 2013-2015 Twitter, Inc. and other contributors; Licensed MIT 4077 */ 4078 4079!function(a,b){"function"==typeof define&&define.amd?define("typeahead.js",["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(this,function(a){var b=function(){"use strict";return{isMsie:function(){return/(msie|trident)/i.test(navigator.userAgent)?navigator.userAgent.match(/(msie |rv:)(\\d+(.\\d+)?)/i)[2]:!1},isBlankString:function(a){return!a||/^\\s*$/.test(a)},escapeRegExChars:function(a){return a.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g,"\\\\$&")},isString:function(a){return"string"==typeof a},isNumber:function(a){return"number"==typeof a},isArray:a.isArray,isFunction:a.isFunction,isObject:a.isPlainObject,isUndefined:function(a){return"undefined"==typeof a},isElement:function(a){return!(!a||1!==a.nodeType)},isJQuery:function(b){return b instanceof a},toStr:function(a){return b.isUndefined(a)||null===a?"":a+""},bind:a.proxy,each:function(b,c){function d(a,b){return c(b,a)}a.each(b,d)},map:a.map,filter:a.grep,every:function(b,c){var d=!0;return b?(a.each(b,function(a,e){return(d=c.call(null,e,a,b))?void 0:!1}),!!d):d},some:function(b,c){var d=!1;return b?(a.each(b,function(a,e){return(d=c.call(null,e,a,b))?!1:void 0}),!!d):d},mixin:a.extend,identity:function(a){return a},clone:function(b){return a.extend(!0,{},b)},getIdGenerator:function(){var a=0;return function(){return a++}},templatify:function(b){function c(){return String(b)}return a.isFunction(b)?b:c},defer:function(a){setTimeout(a,0)},debounce:function(a,b,c){var d,e;return function(){var f,g,h=this,i=arguments;return f=function(){d=null,c||(e=a.apply(h,i))},g=c&&!d,clearTimeout(d),d=setTimeout(f,b),g&&(e=a.apply(h,i)),e}},throttle:function(a,b){var c,d,e,f,g,h;return g=0,h=function(){g=new Date,e=null,f=a.apply(c,d)},function(){var i=new Date,j=b-(i-g);return c=this,d=arguments,0>=j?(clearTimeout(e),e=null,g=i,f=a.apply(c,d)):e||(e=setTimeout(h,j)),f}},stringify:function(a){return b.isString(a)?a:JSON.stringify(a)},noop:function(){}}}(),c=function(){"use strict";function a(a){var g,h;return h=b.mixin({},f,a),g={css:e(),classes:h,html:c(h),selectors:d(h)},{css:g.css,html:g.html,classes:g.classes,selectors:g.selectors,mixin:function(a){b.mixin(a,g)}}}function c(a){return{wrapper:'<span class="'+a.wrapper+'"></span>',menu:'<div class="'+a.menu+'"></div>'}}function d(a){var c={};return b.each(a,function(a,b){c[b]="."+a}),c}function e(){var a={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none",opacity:"1"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},menu:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:" 0"}};return b.isMsie()&&b.mixin(a.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),a}var f={wrapper:"twitter-typeahead",input:"tt-input",hint:"tt-hint",menu:"tt-menu",dataset:"tt-dataset",suggestion:"tt-suggestion",selectable:"tt-selectable",empty:"tt-empty",open:"tt-
4079open",cursor:"tt-cursor",highlight:"tt-highlight"};return a}(),d=function(){"use strict";function c(b){b&&b.el||a.error("EventBus initialized without el"),this.$el=a(b.el)}var d,e;return d="typeahead:",e={render:"rendered",cursorchange:"cursorchanged",select:"selected",autocomplete:"autocompleted"},b.mixin(c.prototype,{_trigger:function(b,c){var e;return e=a.Event(d+b),(c=c||[]).unshift(e),this.$el.trigger.apply(this.$el,c),e},before:function(a){var b,c;return b=[].slice.call(arguments,1),c=this._trigger("before"+a,b),c.isDefaultPrevented()},trigger:function(a){var b;this._trigger(a,[].slice.call(arguments,1)),(b=e[a])&&this._trigger(b,[].slice.call(arguments,1))}}),c}(),e=function(){"use strict";function a(a,b,c,d){var e;if(!c)return this;for(b=b.split(i),c=d?h(c,d):c,this._callbacks=this._callbacks||{};e=b.shift();)this._callbacks[e]=this._callbacks[e]||{sync:[],async:[]},this._callbacks[e][a].push(c);return this}function b(b,c,d){return a.call(this,"async",b,c,d)}function c(b,c,d){return a.call(this,"sync",b,c,d)}function d(a){var b;if(!this._callbacks)return this;for(a=a.split(i);b=a.shift();)delete this._callbacks[b];return this}function e(a){var b,c,d,e,g;if(!this._callbacks)return this;for(a=a.split(i),d=[].slice.call(arguments,1);(b=a.shift())&&(c=this._callbacks[b]);)e=f(c.sync,this,[b].concat(d)),g=f(c.async,this,[b].concat(d)),e()&&j(g);return this}function f(a,b,c){function d(){for(var d,e=0,f=a.length;!d&&f>e;e+=1)d=a[e].apply(b,c)===!1;return!d}return d}function g(){var a;return a=window.setImmediate?function(a){setImmediate(function(){a()})}:function(a){setTimeout(function(){a()},0)}}function h(a,b){return a.bind?a.bind(b):function(){a.apply(b,[].slice.call(arguments,0))}}var i=/\\s+/,j=g();return{onSync:c,onAsync:b,off:d,trigger:e}}(),f=function(a){"use strict";function c(a,c,d){for(var e,f=[],g=0,h=a.length;h>g;g++)f.push(b.escapeRegExChars(a[g]));return e=d?"\\\\b("+f.join("|")+")\\\\b":"("+f.join("|")+")",c?new RegExp(e):new RegExp(e,"i")}var d={node:null,pattern:null,tagName:"strong",className:null,wordsOnly:!1,caseSensitive:!1};return function(e){function f(b){var c,d,f;return(c=h.exec(b.data))&&(f=a.createElement(e.tagName),e.className&&(f.className=e.className),d=b.splitText(c.index),d.splitText(c[0].length),f.appendChild(d.cloneNode(!0)),b.parentNode.replaceChild(f,d)),!!c}function g(a,b){for(var c,d=3,e=0;e<a.childNodes.length;e++)c=a.childNodes[e],c.nodeType===d?e+=b(c)?1:0:g(c,b)}var h;e=b.mixin({},d,e),e.node&&e.pattern&&(e.pattern=b.isArray(e.pattern)?e.pattern:[e.pattern],h=c(e.pattern,e.caseSensitive,e.wordsOnly),g(e.node,f))}}(window.document),g=function(){"use strict";function c(c,e){c=c||{},c.input||a.error("input is missing"),e.mixin(this),this.$hint=a(c.hint),this.$input=a(c.input),this.query=this.$input.val(),this.queryWhenFocused=this.hasFocus()?this.query:null,this.$overflowHelper=d(this.$input),this._checkLanguageDirection(),0===this.$hint.length&&(this.setHint=this.getHint=this.clearHint=this.clearHintIfInvalid=b.noop)}function d(b){return a('<pre aria-hidden="true"></pre>').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:b.css("font-family"),fontSize:b.css("font-size"),fontStyle:b.css("font-style"),fontVariant:b.css("font-variant"),fontWeight:b.css("font-weight"),wordSpacing:b.css("word-spacing"),letterSpacing:b.css("letter-spacing"),textIndent:b.css("text-indent"),textRendering:b.css("text-rendering"),textTransform:b.css("text-transform")}).insertAfter(b)}function f(a,b){return c.normalizeQuery(a)===c.normalizeQuery(b)}function g(a){return a.altKey||a.ctrlKey||a.metaKey||a.shiftKey}var h;return h={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"},c.normalizeQuery=function(a){return b.toStr(a).replace(/^\\s*/g,"").replace(/\
vendor: 8,525 bytes, line 4079
4079\s{2,}/g," ")},b.mixin(c.prototype,e,{_onBlur:function(){this.resetInputValue(),this.trigger("blurred")},_onFocus:function(){this.queryWhenFocused=this.query,this.trigger("focused")},_onKeydown:function(a){var b=h[a.which||a.keyCode];this._managePreventDefault(b,a),b&&this._shouldTrigger(b,a)&&this.trigger(b+"Keyed",a)},_onInput:function(){this._setQuery(this.getInputValue()),this.clearHintIfInvalid(),this._checkLanguageDirection()},_managePreventDefault:function(a,b){var c;switch(a){case"up":case"down":c=!g(b);break;default:c=!1}c&&b.preventDefault()},_shouldTrigger:function(a,b){var c;switch(a){case"tab":c=!g(b);break;default:c=!0}return c},_checkLanguageDirection:function(){var a=(this.$input.css("direction")||"ltr").toLowerCase();this.dir!==a&&(this.dir=a,this.$hint.attr("dir",a),this.trigger("langDirChanged",a))},_setQuery:function(a,b){var c,d;c=f(a,this.query),d=c?this.query.length!==a.length:!1,this.query=a,b||c?!b&&d&&this.trigger("whitespaceChanged",this.query):this.trigger("queryChanged",this.query)},bind:function(){var a,c,d,e,f=this;return a=b.bind(this._onBlur,this),c=b.bind(this._onFocus,this),d=b.bind(this._onKeydown,this),e=b.bind(this._onInput,this),this.$input.on("blur.tt",a).on("focus.tt",c).on("keydown.tt",d),!b.isMsie()||b.isMsie()>9?this.$input.on("input.tt",e):this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",function(a){h[a.which||a.keyCode]||b.defer(b.bind(f._onInput,f,a))}),this},focus:function(){this.$input.focus()},blur:function(){this.$input.blur()},getLangDir:function(){return this.dir},getQuery:function(){return this.query||""},setQuery:function(a,b){this.setInputValue(a),this._setQuery(a,b)},hasQueryChangedSinceLastFocus:function(){return this.query!==this.queryWhenFocused},getInputValue:function(){return this.$input.val()},setInputValue:function(a){this.$input.val(a),this.clearHintIfInvalid(),this._checkLanguageDirection()},resetInputValue:function(){this.setInputValue(this.query)},getHint:function(){return this.$hint.val()},setHint:function(a){this.$hint.val(a)},clearHint:function(){this.setHint("")},clearHintIfInvalid:function(){var a,b,c,d;a=this.getInputValue(),b=this.getHint(),c=a!==b&&0===b.indexOf(a),d=""!==a&&c&&!this.hasOverflow(),!d&&this.clearHint()},hasFocus:function(){return this.$input.is(":focus")},hasOverflow:function(){var a=this.$input.width()-2;return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>=a},isCursorAtEnd:function(){var a,c,d;return a=this.$input.val().length,c=this.$input[0].selectionStart,b.isNumber(c)?c===a:document.selection?(d=document.selection.createRange(),d.moveStart("character",-a),a===d.text.length):!0},destroy:function(){this.$hint.off(".tt"),this.$input.off(".tt"),this.$overflowHelper.remove(),this.$hint=this.$input=this.$overflowHelper=a("<div>")}}),c}(),h=function(){"use strict";function c(c,e){c=c||{},c.templates=c.templates||{},c.templates.notFound=c.templates.notFound||c.templates.empty,c.source||a.error("missing source"),c.node||a.error("missing node"),c.name&&!h(c.name)&&a.error("invalid dataset name: "+c.name),e.mixin(this),this.highlight=!!c.highlight,this.name=c.name||j(),this.limit=c.limit||5,this.displayFn=d(c.display||c.displayKey),this.templates=g(c.templates,this.displayFn),this.source=c.source.__ttAdapter?c.source.__ttAdapter():c.source,this.async=b.isUndefined(c.async)?this.source.length>2:!!c.async,this._resetLastSuggestion(),this.$el=a(c.node).addClass(this.classes.dataset).addClass(this.classes.dataset+"-"+this.name)}function d(a){function c(b){return b[a]}return a=a||b.stringify,b.isFunction(a)?a:c}function g(c,d){function e(b){return a("<div>").text(d(b))}return{notFound:c.notFound&&b.templatify(c.notFound),pending:c.pending&&b.templatify(c.pending),header:c.header&&b.templatify(c.header),footer:c.footer&&b.templatify(c.footer),suggestion:c.suggestion||e}}function h(a){return/^[_a-zA-Z0-9-]+$/.test(a)}var i,j;return i={val:"tt-selectable-display",obj:"tt-selectable-object"},j=b.getIdGenerator(),c.extractData=function(b){var c=a(b);return c.data(i.obj)?{val:c.data(i.val)||"",obj:c.data(i.obj)||null}:null},b.mixin(c.prototype,e,{_overwrite:function(a,b){b=b||[],b.length?this._renderSuggestions(a,b):this.async&&this.templates.pending?this._renderPending(a):!this.async&&this.templates.notFound?this._renderNotFound(a):this._empty(),this.trigger("rendered",this.name,b,!1)},_append:function(a,b){b=b||[],b.length&&this.$lastSuggestion.length?this._appendSuggestions(a,b):b.length?this._renderSuggestions(a,b):!this.$lastSuggestion.length&&this.templates.notFound&&this._renderNotFound(a),this.trigger("rendered",this.name,b,!0)},_renderSuggestions:function(a,b){var c;c=this._getSuggestionsFragment(a,b),this.$lastSuggestion=c.children().last(),this.$el.html(c).prepend(this._getHeader(a,b)).append(this._getFooter(a,b))},_appendSuggestions:function(a,b){var c,d;c=this._getSuggestionsFragment(a,b),d=c.children().last(),this.$lastSuggestion.after(c),this.$lastSuggestion=d},_renderPending:function(a){var b=this.templates.pending;this._resetLastSuggestion(),b&&this.$el.html(b({query:a,dataset:this.name}))},_renderNotFound:function(a){var b=this.templates.notFound;this._resetLastSuggestion(),b&&this.$el.html(b({query:a,dataset:this.name}))},_empty:function(){this.$el.empty(),this._resetLastSuggestion()},_getSuggestionsFragment:function(c,d){var e,g=this;return e=document.createDocumentFragment(),b.each(d,function(b){var d,f;f=g._injectQuery(c,b),d=a(g.templates.suggestion(f)).data(i.obj,b).data(i.val,g.displayFn(b)).addClass(g.classes.suggestion+" "+g.classes.selectable),e.appendChild(d[0])}),this.highlight&&f({className:this.classes.highlight,node:e,pattern:c}),a(e)},_getFooter:function(a,b){return this.templates.footer?this.templates.footer({query:a,suggestions:b,dataset:this.name}):null},_getHeader:function(a,b){return this.templates.header?this.templates.header({query:a,suggestions:b,dataset:this.name}):null},_resetLastSuggestion:function(){this.$lastSuggestion=a()},_injectQuery:function(a,c){return b.isObject(c)?b.mixin({_query:a},c):c},update:function(b){function c(a){g||(g=!0,a=(a||[]).slice(0,e.limit),h=a.length,e._overwrite(b,a),h<e.limit&&e.async&&e.trigger("asyncRequested",b))}function d(c){c=c||[],!f&&h<e.limit&&(e.cancel=a.noop,h+=c.length,e._append(b,c.slice(0,e.limit-h)),e.async&&e.trigger("asyncReceived",b))}var e=this,f=!1,g=!1,h=0;this.cancel(),this.cancel=function(){f=!0,e.cancel=a.noop,e.async&&e.trigger("asyncCanceled",b)},this.source(b,c,d),!g&&c([])},cancel:a.noop,clear:function(){this._empty(),this.cancel(),this.trigger("cleared")},isEmpty:function(){return this.$el.is(":empty")},destroy:function(){this.$el=a("<div>")}}),c}(),i=function(){"use strict";function c(c,d){function e(b){var c=f.$node.find(b.node).first();return b.node=c.length?c:a("<div>").appendTo(f.$node),new h(b,d)}var f=this;c=c||{},c.node||a.error("node is required"),d.mixin(this),this.$node=a(c.node),this.query=null,this.datasets=b.map(c.datasets,e)}return b.mixin(c.prototype,e,{_onSelectableClick:function(b){this.trigger("selectableClicked",a(b.currentTarget))},_onRendered:function(a,b,c,d){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty()),this.trigger("datasetRendered",b,c,d)},_onCleared:function(){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty()),this.trigger("datasetCleared")},_propagate:function(){this.trigger.apply(this,arguments)},_allDatasetsEmpty:function(){function a(a){return a.isEmpty()}return b.every(this.datasets,a)},_getSelectables:function(){return this.$node.find(this.selectors.selectable)},_removeCursor:function(){var a=this.getActiveSelectable();a&&a.removeClass(this.classes.cursor)},_ensureVisible:function(a){var b,c,d,e;b=a.position().top,c=b+a.outerHeight(!0),d=this.$node.scrollTop(),e=this.$node.height()+parseInt(this.$node.css("paddingTop"),10)+parseInt(this.$node.css("paddingBottom"),10),0>b?this.$node.scrollTop(d+b):c>e&&this.$node.scrollTop(d+(c-e))},bind:function(){var a,c=this;return a=b.bind(this._onSelectableClick,this),this.$node.on("click.tt",this.selectors.selectable,a),b.each(this.datasets,function(a){a.onSync("asyncRequested",c._propagate,c).onSync("asyncCanceled",c._propagate,c).onSync("asyncReceived",c._propagate,c).onSync("rendered",c._onRendered,c).onSync("cleared",c._onCleared,c)}),this},isOpen:function(){return this.$node.hasClass(this.classes.open)},open:function(){this.$node.addClass(this.classes.open)},close:function(){this.$node.removeClass(this.classes.open),this._removeCursor()}
vendor: 11,313 bytes, line 4079
4079,setLanguageDirection:function(a){this.$node.attr("dir",a)},selectableRelativeToCursor:function(a){var b,c,d,e;return c=this.getActiveSelectable(),b=this._getSelectables(),d=c?b.index(c):-1,e=d+a,e=(e+1)%(b.length+1)-1,e=-1>e?b.length-1:e,-1===e?null:b.eq(e)},setCursor:function(a){this._removeCursor(),(a=a&&a.first())&&(a.addClass(this.classes.cursor),this._ensureVisible(a))},getSelectableData:function(a){return a&&a.length?h.extractData(a):null},getActiveSelectable:function(){var a=this._getSelectables().filter(this.selectors.cursor).first();return a.length?a:null},getTopSelectable:function(){var a=this._getSelectables().first();return a.length?a:null},update:function(a){function c(b){b.update(a)}var d=a!==this.query;return d&&(this.query=a,b.each(this.datasets,c)),d},empty:function(){function a(a){a.clear()}b.each(this.datasets,a),this.query=null,this.$node.addClass(this.classes.empty)},destroy:function(){function c(a){a.destroy()}this.$node.off(".tt"),this.$node=a("<div>"),b.each(this.datasets,c)}}),c}(),j=function(){"use strict";function a(){i.apply(this,[].slice.call(arguments,0))}var c=i.prototype;return b.mixin(a.prototype,i.prototype,{open:function(){return!this._allDatasetsEmpty()&&this._show(),c.open.apply(this,[].slice.call(arguments,0))},close:function(){return this._hide(),c.close.apply(this,[].slice.call(arguments,0))},_onRendered:function(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),c._onRendered.apply(this,[].slice.call(arguments,0))},_onCleared:function(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),c._onCleared.apply(this,[].slice.call(arguments,0))},setLanguageDirection:function(a){return this.$node.css("ltr"===a?this.css.ltr:this.css.rtl),c.setLanguageDirection.apply(this,[].slice.call(arguments,0))},_hide:function(){this.$node.hide()},_show:function(){this.$node.css("display","block")}}),a}(),k=function(){"use strict";function c(c,e){var f,g,h,i,j,k,l,m,n,o,p;c=c||{},c.input||a.error("missing input"),c.menu||a.error("missing menu"),c.eventBus||a.error("missing event bus"),e.mixin(this),this.eventBus=c.eventBus,this.minLength=b.isNumber(c.minLength)?c.minLength:1,this.input=c.input,this.menu=c.menu,this.enabled=!0,this.active=!1,this.input.hasFocus()&&this.activate(),this.dir=this.input.getLangDir(),this._hacks(),this.menu.bind().onSync("selectableClicked",this._onSelectableClicked,this).onSync("asyncRequested",this._onAsyncRequested,this).onSync("asyncCanceled",this._onAsyncCanceled,this).onSync("asyncReceived",this._onAsyncReceived,this).onSync("datasetRendered",this._onDatasetRendered,this).onSync("datasetCleared",this._onDatasetCleared,this),f=d(this,"activate","open","_onFocused"),g=d(this,"deactivate","_onBlurred"),h=d(this,"isActive","isOpen","_onEnterKeyed"),i=d(this,"isActive","isOpen","_onTabKeyed"),j=d(this,"isActive","_onEscKeyed"),k=d(this,"isActive","open","_onUpKeyed"),l=d(this,"isActive","open","_onDownKeyed"),m=d(this,"isActive","isOpen","_onLeftKeyed"),n=d(this,"isActive","isOpen","_onRightKeyed"),o=d(this,"_openIfActive","_onQueryChanged"),p=d(this,"_openIfActive","_onWhitespaceChanged"),this.input.bind().onSync("focused",f,this).onSync("blurred",g,this).onSync("enterKeyed",h,this).onSync("tabKeyed",i,this).onSync("escKeyed",j,this).onSync("upKeyed",k,this).onSync("downKeyed",l,this).onSync("leftKeyed",m,this).onSync("rightKeyed",n,this).onSync("queryChanged",o,this).onSync("whitespaceChanged",p,this).onSync("langDirChanged",this._onLangDirChanged,this)}function d(a){var c=[].slice.call(arguments,1);return function(){var d=[].slice.call(arguments);b.each(c,function(b){return a[b].apply(a,d)})}}return b.mixin(c.prototype,{_hacks:function(){var c,d;c=this.input.$input||a("<div>"),d=this.menu.$node||a("<div>"),c.on("blur.tt",function(a){var e,f,g;e=document.activeElement,f=d.is(e),g=d.has(e).length>0,b.isMsie()&&(f||g)&&(a.preventDefault(),a.stopImmediatePropagation(),b.defer(function(){c.focus()}))}),d.on("mousedown.tt",function(a){a.preventDefault()})},_onSelectableClicked:function(a,b){this.select(b)},_onDatasetCleared:function(){this._updateHint()},_onDatasetRendered:function(a,b,c,d){this._updateHint(),this.eventBus.trigger("render",c,d,b)},_onAsyncRequested:function(a,b,c){this.eventBus.trigger("asyncrequest",c,b)},_onAsyncCanceled:function(a,b,c){this.eventBus.trigger("asynccancel",c,b)},_onAsyncReceived:function(a,b,c){this.eventBus.trigger("asyncreceive",c,b)},_onFocused:function(){this._minLengthMet()&&this.menu.update(this.input.getQuery())},_onBlurred:function(){this.input.hasQueryChangedSinceLastFocus()&&this.eventBus.trigger("change",this.input.getQuery())},_onEnterKeyed:function(a,b){var c;(c=this.menu.getActiveSelectable())&&this.select(c)&&b.preventDefault()},_onTabKeyed:function(a,b){var c;(c=this.menu.getActiveSelectable())?this.select(c)&&b.preventDefault():(c=this.menu.getTopSelectable())&&this.autocomplete(c)&&b.preventDefault()},_onEscKeyed:function(){this.close()},_onUpKeyed:function(){this.moveCursor(-1)},_onDownKeyed:function(){this.moveCursor(1)},_onLeftKeyed:function(){"rtl"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getTopSelectable())},_onRightKeyed:function(){"ltr"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getTopSelectable())},_onQueryChanged:function(a,b){this._minLengthMet(b)?this.menu.update(b):this.menu.empty()},_onWhitespaceChanged:function(){this._updateHint()},_onLangDirChanged:function(a,b){this.dir!==b&&(this.dir=b,this.menu.setLanguageDirection(b))},_openIfActive:function(){this.isActive()&&this.open()},_minLengthMet:function(a){return a=b.isString(a)?a:this.input.getQuery()||"",a.length>=this.minLength},_updateHint:function(){var a,c,d,e,f,h,i;a=this.menu.getTopSelectable(),c=this.menu.getSelectableData(a),d=this.input.getInputValue(),!c||b.isBlankString(d)||this.input.hasOverflow()?this.input.clearHint():(e=g.normalizeQuery(d),f=b.escapeRegExChars(e),h=new RegExp("^(?:"+f+")(.+$)","i"),i=h.exec(c.val),i&&this.input.setHint(d+i[1]))},isEnabled:function(){return this.enabled},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},isActive:function(){return this.active},activate:function(){return this.isActive()?!0:!this.isEnabled()||this.eventBus.before("active")?!1:(this.active=!0,this.eventBus.trigger("active"),!0)},deactivate:function(){return this.isActive()?this.eventBus.before("idle")?!1:(this.active=!1,this.close(),this.eventBus.trigger("idle"),!0):!0},isOpen:function(){return this.menu.isOpen()},open:function(){return this.isOpen()||this.eventBus.before("open")||(this.menu.open(),this._updateHint(),this.eventBus.trigger("open")),this.isOpen()},close:function(){return this.isOpen()&&!this.eventBus.before("close")&&(this.menu.close(),this.input.clearHint(),this.input.resetInputValue(),this.eventBus.trigger("close")),!this.isOpen()},setVal:function(a){this.input.setQuery(b.toStr(a))},getVal:function(){return this.input.getQuery()},select:function(a){var b=this.menu.getSelectableData(a);return b&&!this.eventBus.before("select",b.obj)?(this.input.setQuery(b.val,!0),this.eventBus.trigger("select",b.obj),this.close(),!0):!1},autocomplete:function(a){var b,c,d;return b=this.input.getQuery(),c=this.menu.getSelectableData(a),d=c&&b!==c.val,d&&!this.eventBus.before("autocomplete",c.obj)?(this.input.setQuery(c.val),this.eventBus.trigger("autocomplete",c.obj),!0):!1},moveCursor:function(a){var b,c,d,e,f;return b=this.input.getQuery(),c=this.menu.selectableRelativeToCursor(a),d=this.menu.getSelectableData(c),e=d?d.obj:null,f=this._minLengthMet()&&this.menu.update(b),f||this.eventBus.before("cursorchange",e)?!1:(this.menu.setCursor(c),d?this.input.setInputValue(d.val):(this.input.resetInputValue(),this._updateHint()),this.eventBus.trigger("cursorchange",e),!0)},destroy:function(){this.input.destroy(),this.menu.destroy()}}),c}();!function(){"use strict";function e(b,c){b.each(function(){var b,d=a(this);(b=d.data(p.typeahead))&&c(b,d)})}function f(a,b){return a.clone().addClass(b.classes.hint).removeData().css(b.css.hint).css(l(a)).prop("readonly",!0).removeAttr("id name placeholder required").attr({autocomplete:"off",spellcheck:"false",tabindex:-1})}function h(a,b){a.data(p.attrs,{dir:a.attr("dir"),autocomplete:a.attr("autocomplete"),spellcheck:a.attr("spellcheck"),style:a.attr("style")}),a.addClass(b.classes.input).attr({autocomplete:"off",spellcheck:!1});try{!a.attr("dir")&&a.attr("dir","auto")}catch(c){}return a}function l(a){return{backgroundAttachment:a.css("background-attachment"),backgroundClip:a.css("background-clip"),backgroundColor:a.css("background-color"),backgroundImage:a.css("background-image"),backgroundOrigin:a.css("background-origin"),backgroundPosition:a.css("background-position"),backgroundRepeat:a.css("background-repeat"),backgroundSize:a.css("background-size")}}function m(a){var c,d;c=a.data(p.www),d=a.parent().filter(c.selectors.wrapper),b.each(a.data(p.attrs),function(c,d){b.isUndefined(c)?a.removeAttr(d):a.attr(d,c)}),a.removeData(p.typeahead).removeData(p.www).removeData(p.attr).removeClass(c.classes.input),d.length&&(a.detach().insertAfter(d),d.remove())}function n(c){var d,e;return d=b.isJQuery(c)||b.isElement(c),e=d?a(c).first():[],e.length?e:null}var o,p,q;o=a.fn.typeahead,p={www:"tt-www",attrs:"tt-attrs",typeahead:"tt-typeahead"},q={initialize:function(e,l){function m(){var c,m,q,r,s,t,u,v,w,x,y;b.each(l,function(a){a.highlight=!!e.highlight}),c=a(this),m=a(o.html.wrapper),q=n(e.hint),r=n(e.menu),s=e.hint!==!1&&!q,t=e.menu!==!1&&!r,s&&(q=f(c,o)),t&&(r=a(o.html.menu).css(o.css.menu)),q&&q.val(""),c=h(c,o),(s||t)&&(m.css(o.css.wrapper),c.css(s?o.css.input:o.css.inputWithNoHint),c.wrap(m).parent().prepend(s?q:null).append(t?r:null)),y=t?j:i,u=new d({el:c}),v=new g({hint:q,input:c},o),w=new y({node:r,datasets:l},o),x=new k({input:v,menu:w,eventBus:u,minLength:e.minLength},o),c.data(p.www,o),c.data(p.typeahead,x)}var o;return l=b.isArray(l)?l:[].slice.call(arguments,1),e=e||{},o=c(e.classNames),this.each(m)},isEnabled:function(){var a;return e(this.first(),function(b){a=b.isEnabled()}),a},enable:function(){return e(this,function(a){a.enable()}),this},disable:function(){return e(this,function(a){a.disable()}),this},isActive:function(){var a;return e(this.first(),function(b){a=b.isActive()}),a},activate:function(){return e(this,function(a){a.activate()}),this},deactivate:function(){return e(this,function(a){a.deactivate()}),this},isOpen:function(){var a;return e(this.first(),function(b){a=b.isOpen()}),a},open:function(){return e(this,function(a){a.open()}),this},close:function(){return e(this,function(a){a.close()}),this},select:function(b){var c=!1,d=a(b);return e(this.first(),function(a){c=a.select(d)}),c},autocomplete:function(b){var c=!1,d=a(b);return e(this.first(),function(a){c=a.autocomplete(d)}),c},moveCursor:function(a){var b=!1;return e(this.first(),function(c){b=c.moveCursor(a)}),b},val:function(a){var b;return arguments.length?(e(this,function(b){b.setVal(a)}),this):(e(this.first(),function(a){b=a.getVal()}),b)},destroy:function(){return e(this,function(a,b){m(b),a.destroy()}),this}},a.fn.typeahead=function(a){return q[a]?q[a].apply(this,[].slice.call(arguments,1)):q.initialize.apply(this,arguments)},a.fn.typeahead.noConflict=function(){return a.fn.typeahead=o,this}}()});
4079 4080`},8628:function(e,n,t){t(5714)(t(2906))},9203:function(e,n,t){t(5714)(t(5423))},8362:function(e,n,t){t(5714)(t(9923))},4377:function(e,n,t){t(5714)(t(3054))},7557:function(e,n,t){t(5714)(t(6713))},1095:function(e,n,t){t(5714)(t(7088))},73:function(e,n,t){t(5714)(t(8885))},9113:function(e,n,t){t(5714)(t(1320))},341:function(e,n,t){t(5714)(t(3622))},5311:function(e){"use strict";e.exports=jQuery}},function(e){var n=function(a){return e(e.s=a)};e.O(0,[577],function(){return n(4080)});var t=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.