1(self.webpackChunk=self.webpackChunk||[]).push([[736],{4080:function(e,n,t){"use strict";var i=t(4377),b=t.n(i),a=t(7557),v=t.n(a),y=t(4652),w=t(4742),_=t(3946),I=t(8755),x=t(4818),S=t(1791),C=t(6796),T=t(2649),E=t(180),P=t(132),j=t(3865),A=t(6407),o=t(7218),k=t.n(o),r=t(9203),L=t.n(r),s=t(6082),R=t.n(s),l=t(9778),D=t.n(l),c=t(2993),O=t.n(c),u=t(1095),M=t.n(u),d=t(6543),z=t.n(d),f=t(7510),H=t.n(f),p=t(8362),N=t.n(p),h=t(400),$=t.n(h),g=t(9113),F=t.n(g),m=t(341),B=t.n(m)},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; 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 {
vendor: 9,146 bytes, lines 118-406
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`},6962:function(e){e.exports=`/*! 2083 * Name : Video Background Extension for Jarallax 2084 * Version : 1.0.1 2085 * Author : nK <https://nkdev.info> 2086 * GitHub : https://github.com/nk-o/jarallax 2087 */!function(){var o=[,function(e){e.exports=function(e){"complete"===document.readyState||"interactive"===document.readyState?e.call():document.attachEvent?document.attachEvent("onreadystatechange",function(){"interactive"===document.readyState&&e.call()}):document.addEventListener&&document.addEventListener("DOMContentLoaded",e)}},function(e,t,o){o="undefined"!=typeof window?window:void 0!==o.g?o.g:"undefined"!=typeof self?self:{};e.exports=o},,,function(e,t,o){"use strict";o.r(t),o.d(t,{default:function(){return v}});var t=o(2),d=o.n(t);function n(e){return(n="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})(e)}function a(e,t){for(var o=0;o<t.length;o++){var i=t[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function i(){this.doneCallbacks=[],this.failCallbacks=[]}i.prototype={execute:function(e,t){var o=e.length;for(t=Array.prototype.slice.call(t);o;)e[--o].apply(null,t)},resolve:function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];this.execute(this.doneCallbacks,t)},reject:function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];this.execute(this.failCallbacks,t)},done:function(e){this.doneCallbacks.push(e)},fail:function(e){this.failCallbacks.push(e)}};var r=0,l=0,s=0,p=0,u=0,c=new i,y=new i,v=function(){function i(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);var o=this;
2087o.url=e,o.options_default={autoplay:!1,loop:!1,mute:!1,volume:100,showControls:!0,accessibilityHidden:!1,startTime:0,endTime:0},o.options=o.extend({},o.options_default,t),void 0!==o.options.showContols&&(o.options.showControls=o.options.showContols,delete o.options.showContols),o.videoID=o.parseURL(e),o.videoID&&(o.ID=r,r+=1,o.loadAPI(),o.init())}var e,t,o;return e=i,(t=[{key:"extend",value:function(){for(var e=arguments.length,o=new Array(e),t=0;t<e;t++)o[t]=arguments[t];var i=o[0]||{};return Object.keys(o).forEach(function(t){o[t]&&Object.keys(o[t]).forEach(function(e){i[e]=o[t][e]})}),i}},{key:"parseURL",value:function(e){var t,o,i,n,a,r=!(!(t=(t=e).match(/.*(?:youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=)([^#\\&\\?]*).*/))||11!==t[1].length)&&t[1],l=!(!(o=(o=e).match(/https?:\\/\\/(?:www\\.|player\\.)?vimeo.com\\/(?:channels\\/(?:\\w+\\/)?|groups\\/([^\\/]*)\\/videos\\/|album\\/(\\d+)\\/video\\/|video\\/|)(\\d+)(?:$|\\/|\\?)/))||!o[3])&&o[3],s=(i=(i=e).split(/,(?=mp4\\:|webm\\:|ogv\\:|ogg\\:)/),n={},a=0,i.forEach(function(e){e=e.match(/^(mp4|webm|ogv|ogg)\\:(.*)/);e&&e[1]&&e[2]&&(n["ogv"===e[1]?"ogg":e[1]]=e[2],a=1)}),!!a&&n);return r?(this.type="youtube",r):l?(this.type="vimeo",l):!!s&&(this.type="local",s)}},{key:"isValid",value:function(){return!!this.videoID}},{key:"on",value:function(e,t){this.userEventsList=this.userEventsList||[],(this.userEventsList[e]||(this.userEventsList[e]=[])).push(t)}},{key:"off",value:function(o,i){var n=this;this.userEventsList&&this.userEventsList[o]&&(i?this.userEventsList[o].forEach(function(e,t){e===i&&(n.userEventsList[o][t]=!1)}):delete this.userEventsList[o])}},{key:"fire",value:function(e){for(var t=this,o=arguments.length,i=new Array(1<o?o-1:0),n=1;n<o;n++)i[n-1]=arguments[n];this.userEventsList&&void 0!==this.userEventsList[e]&&this.userEventsList[e].forEach(function(e){e&&e.apply(t,i)})}},{key:"play",value:function(e){var t=this;t.player&&("youtube"===t.type&&t.player.playVideo&&(void 0!==e&&t.player.seekTo(e||0),d().YT.PlayerState.PLAYING!==t.player.getPlayerState()&&t.player.playVideo()),"vimeo"===t.type&&(void 0!==e&&t.player.setCurrentTime(e),t.player.getPaused().then(function(e){e&&t.player.play()})),"local"===t.type&&(void 0!==e&&(t.player.currentTime=e),t.player.paused&&t.player.play()))}},{key:"pause",value:function(){var t=this;t.player&&("youtube"===t.type&&t.player.pauseVideo&&d().YT.PlayerState.PLAYING===t.player.getPlayerState()&&t.player.pauseVideo(),"vimeo"===t.type&&t.player.getPaused().then(function(e){e||t.player.pause()}),"local"===t.type&&(t.player.paused||t.player.pause()))}},{key:"mute",value:function(){var e=this;e.player&&("youtube"===e.type&&e.player.mute&&e.player.mute(),"vimeo"===e.type&&e.player.setVolume&&e.player.setVolume(0),"local"===e.type&&(e.$video.muted=!0))}},{key:"unmute",value:function(){var e=this;e.player&&("youtube"===e.type&&e.player.mute&&e.player.unMute(),"vimeo"===e.type&&e.player.setVolume&&e.player.setVolume(e.options.volume),"local"===e.type&&(e.$video.muted=!1))}},{key:"setVolume",value:function(){var e=0<arguments.length&&void 0!==arguments[0]&&arguments[0],t=this;t.player&&e&&("youtube"===t.type&&t.player.setVolume&&t.player.setVolume(e),"vimeo"===t.type&&t.player.setVolume&&t.player.setVolume(e),"local"===t.type&&(t.$video.volume=e/100))}},{key:"getVolume",value:function(t){var e=this;e.player?("youtube"===e.type&&e.player.getVolume&&t(e.player.getVolume()),"vimeo"===e.type&&e.player.getVolume&&e.player.getVolume().then(function(e){t(e)}),"local"===e.type&&t(100*e.$video.volume)):t(!1)}},{key:"getMuted",value:function(t){var e=this;e.player?("youtube"===e.type&&e.player.isMuted&&t(e.player.isMuted()),"vimeo"===e.type&&e.player.getVolume&&e.player.getVolume().then(function(e){t(!!e)}),"local"===e.type&&t(e.$video.muted)):t(null)}},{key:"getImageURL",value:function(t){var e,o,i,n=this;n.videoImage?t(n.videoImage):("youtube"===n.type&&(e=["maxresdefault","sddefault","hqdefault","0"],o=0,(i=new Image).onload=function(){120!==(this.naturalWidth||this.width)||o===e.length-1?(n.videoImage="https://img.youtube.com/vi/".concat(n.videoID,"/").concat(e[o],".jpg"),t(n.videoImage)):(o+=1,this.src="https://img.youtube.com/vi/".concat(n.videoID,"/").concat(e[o],".jpg"))},i.src="https://img.youtube.com/vi/".concat(n.videoID,"/").concat(e[o],".jpg")),"vimeo"===n.type&&((i=new XMLHttpRequest).open("GET","https://vimeo.com/api/v2/video/".concat(n.videoID,".json"),!0),i.onreadystatechange=function(){var e;4===this.readyState&&200<=this.status&&this.status<400&&(e=JSON.parse(this.responseText),n.videoImage=e[0].thumbnail_large,t(n.videoImage))},i.send()))}},{key:"getIframe",value:function(e){this.getVideo(e)}},{key:"getVideo",value:function(s){var p=this;p.$video?s(p.$video):p.onAPIready(function(){var e,t,o,i,n,a,r,l;p.$video||((e=document.createElement("div")).style.display="none"),"youtube"===p.type&&(p.playerOptions={host:"https://www.youtube-nocookie.com",videoId:p.videoID,playerVars:{autohide:1,rel:0,autoplay:0,playsinline:1}},p.options.showControls||(p.playerOptions.playerVars.iv_load_policy=3,p.playerOptions.playerVars.modestbranding=1,p.playerOptions.playerVars.controls=0,p.playerOptions.playerVars.showinfo=0,p.playerOptions.playerVars.disablekb=1),p.playerOptions.events={onReady:function(t){p.options.mute?t.target.mute():p.options.volume&&t.target.setVolume(p.options.volume),p.options.autoplay&&p.play(p.options.startTime),p.fire("ready",t),p.options.loop&&!p.options.endTime&&(p.options.endTime=p.player.getDuration()-.1),setInterval(function(){p.getVolume(function(e){p.options.volume!==e&&(p.options.volume=e,p.fire("volumechange",t))})},150)},onStateChange:function(e){p.options.loop&&e.data===d().YT.PlayerState.ENDED&&p.play(p.options.startTime),t||e.data!==d().YT.PlayerState.PLAYING||(t=1,p.fire("started",e)),e.data===d().YT.PlayerState.PLAYING&&p.fire("play",e),e.data===d().YT.PlayerState.PAUSED&&p.fire("pause",e),e.data===d().YT.PlayerState.ENDED&&p.fire("ended",e),e.data===d().YT.PlayerState.PLAYING?o=setInterval(function(){p.fire("timeupdate",e),p.options.endTime&&p.player.getCurrentTime()>=p.options.endTime&&(p.options.loop?p.play(p.options.startTime):p.pause())},150):clearInterval(o)},onError:function(e){p.fire("error",e)}},(i=!p.$video)&&((n=document.createElement("div")).setAttribute("id",p.playerID),e.appendChild(n),document.body.appendChild(e)),p.player=p.player||new(d().YT.Player)(p.playerID,p.playerOptions),i&&(p.$video=document.getElementById(p.playerID),p.options.accessibilityHidden&&(p.$video.setAttribute("tabindex","-1"),p.$video.setAttribute("aria-hidden","true")),p.videoWidth=parseInt(p.$video.getAttribute("width"),10)||1280,p.videoHeight=parseInt(p.$video.getAttribute("height"),10)||720)),"vimeo"===p.type&&(p.playerOptions={dnt:1,id:p.videoID,autopause:0,transparent:0,autoplay:p.options.autoplay?1:0,loop:p.options.loop?1:0,muted:p.options.mute?1:0},p.options.volume&&(p.playerOptions.volume=p.options.volume),p.options.showControls||(p.playerOptions.badge=0,p.playerOptions.byline=0,p.playerOptions.portrait=0,p.playerOptions.title=0,p.playerOptions.background=1),p.$video||(a="",Object.keys(p.playerOptions).forEac
2087h(function(e){""!==a&&(a+="&"),a+="".concat(e,"=").concat(encodeURIComponent(p.playerOptions[e]))}),p.$video=document.createElement("iframe"),p.$video.setAttribute("id",p.playerID),p.$video.setAttribute("src","https://player.vimeo.com/video/".concat(p.videoID,"?").concat(a)),p.$video.setAttribute("frameborder","0"),p.$video.setAttribute("mozallowfullscreen",""),p.$video.setAttribute("allowfullscreen",""),p.$video.setAttribute("title","Vimeo video player"),p.options.accessibilityHidden&&(p.$video.setAttribute("tabindex","-1"),p.$video.setAttribute("aria-hidden","true")),e.appendChild(p.$video),document.body.appendChild(e)),p.player=p.player||new(d().Vimeo.Player)(p.$video,p.playerOptions),p.options.startTime&&p.options.autoplay&&p.player.setCurrentTime(p.options.startTime),p.player.getVideoWidth().then(function(e){p.videoWidth=e||1280}),p.player.getVideoHeight().then(function(e){p.videoHeight=e||720}),p.player.on("timeupdate",function(e){r||(p.fire("started",e),r=1),p.fire("timeupdate",e),p.options.endTime&&p.options.endTime&&e.seconds>=p.options.endTime&&(p.options.loop?p.play(p.options.startTime):p.pause())}),p.player.on("play",function(e){p.fire("play",e),p.options.startTime&&0===e.seconds&&p.play(p.options.startTime)}),p.player.on("pause",function(e){p.fire("pause",e)}),p.player.on("ended",function(e){p.fire("ended",e)}),p.player.on("loaded",function(e){p.fire("ready",e)}),p.player.on("volumechange",function(e){p.fire("volumechange",e)}),p.player.on("error",function(e){p.fire("error",e)})),"local"===p.type&&(p.$video||(p.$video=document.createElement("video"),p.options.showControls&&(p.$video.controls=!0),p.options.mute?p.$video.muted=!0:p.$video.volume&&(p.$video.volume=p.options.volume/100),p.options.loop&&(p.$video.loop=!0),p.$video.setAttribute("playsinline",""),p.$video.setAttribute("webkit-playsinline",""),p.options.accessibilityHidden&&(p.$video.setAttribute("tabindex","-1"),p.$video.setAttribute("aria-hidden","true")),p.$video.setAttribute("id",p.playerID),e.appendChild(p.$video),document.body.appendChild(e),Object.keys(p.videoID).forEach(function(e){var t,o,i;t=p.$video,o=p.videoID[e],i="video/".concat(e),(e=document.createElement("source")).src=o,e.type=i,t.appendChild(e)})),p.player=p.player||p.$video,p.player.addEventListener("playing",function(e){l||p.fire("started",e),l=1}),p.player.addEventListener("timeupdate",function(e){p.fire("timeupdate",e),p.options.endTime&&p.options.endTime&&this.currentTime>=p.options.endTime&&(p.options.loop?p.play(p.options.startTime):p.pause())}),p.player.addEventListener("play",function(e){p.fire("play",e)}),p.player.addEventListener("pause",function(e){p.fire("pause",e)}),p.player.addEventListener("ended",function(e){p.fire("ended",e)}),p.player.addEventListener("loadedmetadata",function(){p.videoWidth=this.videoWidth||1280,p.videoHeight=this.videoHeight||720,p.fire("ready"),p.options.autoplay&&p.play(p.options.startTime)}),p.player.addEventListener("volumechange",function(e){p.getVolume(function(e){p.options.volume=e}),p.fire("volumechange",e)}),p.player.addEventListener("error",function(e){p.fire("error",e)})),s(p.$video)})}},{key:"init",value:function(){this.playerID="VideoWorker-".concat(this.ID)}},{key:"loadAPI",value:function(){if(!l||!s){var e,t,o="";if("youtube"!==this.type||l||(l=1,o="https://www.youtube.com/iframe_api"),"vimeo"===this.type&&!s){if(s=1,void 0!==d().Vimeo)return;o="https://player.vimeo.com/api/player.js"}o&&(e=document.createElement("script"),t=document.getElementsByTagName("head")[0],e.src=o,t.appendChild(e),t=null)}}},{key:"onAPIready",value:function(e){var t;"youtube"===this.type&&(void 0!==d().YT&&0!==d().YT.loaded||p?"object"===n(d().YT)&&1===d().YT.loaded?e():c.done(function(){e()}):(p=1,window.onYouTubeIframeAPIReady=function(){window.onYouTubeIframeAPIReady=null,c.resolve("done"),e()})),"vimeo"===this.type&&(void 0!==d().Vimeo||u?void 0!==d().Vimeo?e():y.done(function(){e()}):(u=1,t=setInterval(function(){void 0!==d().Vimeo&&(clearInterval(t),y.resolve("done"),e())},20))),"local"===this.type&&e()}}])&&a(e.prototype,t),o&&a(e,o),i}()},function(e,t,o){"use strict";o.r(t),o.d(t,{default:function(){return i}});var a=o(5),t=o(2),r=o.n(t);function i(){var e,l,o,n,t,i=0<arguments.length&&void 0!==arguments[0]?arguments[0]:r().jarallax;void 0!==i&&(i=i.constructor,e=i.prototype.onScroll,i.prototype.onScroll=function(){var o=this;e.apply(o),o.isVideoInserted||!o.video||o.options.videoLazyLoading&&!o.isElementInViewport||o.options.disableVideo()||(o.isVideoInserted=!0,o.video.getVideo(function(e){var t=e.parentNode;o.css(e,{position:o.image.position,top:"0px",left:"0px",right:"0px",bottom:"0px",width:"100%",height:"100%",maxWidth:"none",maxHeight:"none",pointerEvents:"none",transformStyle:"preserve-3d",backfaceVisibility:"hidden",
2087willChange:"transform,opacity",margin:0,zIndex:-1}),o.$video=e,"local"===o.video.type&&(o.image.src?o.$video.setAttribute("poster",o.image.src):o.image.$item&&"IMG"===o.image.$item.tagName&&o.image.$item.src&&o.$video.setAttribute("poster",o.image.$item.src)),o.image.$container.appendChild(e),t.parentNode.removeChild(t)}))},l=i.prototype.coverImage,i.prototype.coverImage=function(){var e,t,o,i,n=this,a=l.apply(n),r=!!n.image.$item&&n.image.$item.nodeName;return a&&n.video&&r&&("IFRAME"===r||"VIDEO"===r)&&(t=(e=a.image.height)*n.image.width/n.image.height,o=(a.container.width-t)/2,i=a.image.marginTop,a.container.width>t&&(e=(t=a.container.width)*n.image.height/n.image.width,o=0,i+=(a.image.height-e)/2),"IFRAME"===r&&(e+=400,i-=200),n.css(n.$video,{width:"".concat(t,"px"),marginLeft:"".concat(o,"px"),height:"".concat(e,"px"),marginTop:"".concat(i,"px")})),a},o=i.prototype.initImg,i.prototype.initImg=function(){var e=this,t=o.apply(e);return e.options.videoSrc||(e.options.videoSrc=e.$item.getAttribute("data-jarallax-video")||null),e.options.videoSrc?(e.defaultInitImgResult=t,!0):t},n=i.prototype.canInitParallax,i.prototype.canInitParallax=function(){var o=this,e=n.apply(o);if(!o.options.videoSrc)return e;var t=new a.default(o.options.videoSrc,{autoplay:!0,loop:o.options.videoLoop,showControls:!1,accessibilityHidden:!0,startTime:o.options.videoStartTime||0,endTime:o.options.videoEndTime||0,mute:o.options.videoVolume?0:1,volume:o.options.videoVolume||0});function i(){o.image.$default_item&&(o.image.$item=o.image.$default_item,o.image.$item.style.display="block",o.coverImage(),o.clipContainer(),o.onScroll())}if(t.isValid())if(this.options.disableParallax()&&(e=!0,o.image.position="absolute",o.options.type="scroll",o.options.speed=1),e){if(t.on("ready",function(){var e;o.options.videoPlayOnlyVisible?(e=o.onScroll,o.onScroll=function(){e.apply(o),o.videoError||!o.options.videoLoop&&(o.options.videoLoop||o.videoEnded)||(o.isVisible()?t.play():t.pause())}):t.play()}),t.on("started",function(){o.image.$default_item=o.image.$item,o.image.$item=o.$video,o.image.width=o.video.videoWidth||1280,o.image.height=o.video.videoHeight||720,o.coverImage(),o.clipContainer(),o.onScroll(),o.image.$default_item&&(o.image.$default_item.style.display="none")}),t.on("ended",function(){o.videoEnded=!0,o.options.videoLoop||i()}),t.on("error",function(){o.videoError=!0,i()}),o.video=t,!o.defaultInitImgResult&&(o.image.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7","local"!==t.type))return t.getImageURL(function(e){o.image.bgImage='url("'.concat(e,'")'),o.init()}),!1}else o.defaultInitImgResult||t.getImageURL(function(e){var t=o.$item.getAttribute("style");t&&o.$item.setAttribute("data-jarallax-original-styles",t),o.css(o.$item,{"background-image":'url("'.concat(e,'")'),"background-position":"center","background-size":"cover"})});return e},t=i.prototype.destroy,i.prototype.destroy=function(){var e=this;e.image.$default_item&&(e.image.$item=e.image.$default_item,delete e.image.$default_item),t.apply(e)})}}],i={};function n(e){var t=i[e];if(void 0!==t)return t.exports;t=i[e]={exports:{}};return o[e](t,t.exports,n),t.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};!function(){"use strict";n.r(a);var e=n(5),t=n(2),o=n.n(t),i=n(1),t=n.n(i),i=n(6);o().VideoWorker=o().VideoWorker||e.default,(0,i.default)(),t()(function(){void 0!==o().jarallax&&o().jarallax(document.querySelectorAll("[data-jarallax-video]"))})}()}(); 2088//# sourceMappingURL=jarallax-video.min.js.map 2089`},7651:function(e){e.exports=`/*! 2090 * Name : Just Another Parallax [Jarallax] 2091 * Version : 1.12.8 2092 * Author : nK <https://nkdev.info> 2093 * GitHub : https://github.com/nk-o/jarallax 2094 */!function(){var n={2:function(e,t,n){n="undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{};e.exports=n},1:function(e){e.exports=function(e){"complete"===document.readyState||"interactive"===document.readyState?e.call():document.attachEvent?document.attachEvent("onreadystatechange",function(){"interactive"===document.readyState&&e.call()}):document.addEventListener&&document.addEventListener("DOMContentLoaded",e)}},8:function(e,t,n){"use strict";n.r(t);var o=n(1),o=n.n(o),f=n(2);function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,i,a=[],r=!0,l=!1;try{for(n=n.call(e);!(r=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);r=!0);}catch(e){l=!0,i=e}finally{try{r||null==n.return||n.return()}finally{if(l)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(n="Object"===n&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}
2094(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function c(e){return(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})(e)}function a(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)}}var r,g,u=f.window.navigator,p=-1<u.userAgent.indexOf("MSIE ")||-1<u.userAgent.indexOf("Trident/")||-1<u.userAgent.indexOf("Edge/"),l=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(u.userAgent),m=function(){for(var e="transform WebkitTransform MozTransform".split(" "),t=document.createElement("div"),n=0;n<e.length;n+=1)if(t&&void 0!==t.style[e[n]])return e[n];return!1}();function d(){g=l?(!r&&document.body&&((r=document.createElement("div")).style.cssText="position: fixed; top: -9999px; left: 0; height: 100vh; width: 0;",document.body.appendChild(r)),(r?r.clientHeight:0)||f.window.innerHeight||document.documentElement.clientHeight):f.window.innerHeight||document.documentElement.clientHeight}d(),f.window.addEventListener("resize",d),f.window.addEventListener("orientationchange",d),f.window.addEventListener("load",d),o()(function(){d()});var y=[];function h(){y.length&&(y.forEach(function(e,t){var n=e.instance,o=e.oldData,i=n.$item.getBoundingClientRect(),e={width:i.width,height:i.height,top:i.top,bottom:i.bottom,wndW:f.window.innerWidth,wndH:g},i=!o||o.wndW!==e.wndW||o.wndH!==e.wndH||o.width!==e.width||o.height!==e.height,o=i||!o||o.top!==e.top||o.bottom!==e.bottom;y[t].oldData=e,i&&n.onResize(),o&&n.onScroll()}),f.window.requestAnimationFrame(h))}var b=0,v=function(){function l(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l);var n=this;n.instanceID=b,b+=1,n.$item=e,n.defaults={type:"scroll",speed:.5,imgSrc:null,imgElement:".jarallax-img",imgSize:"cover",imgPosition:"50% 50%",imgRepeat:"no-repeat",keepImg:!1,elementInViewport:null,zIndex:-100,disableParallax:!1,disableVideo:!1,videoSrc:null,videoStartTime:0,videoEndTime:0,videoVolume:0,videoLoop:!0,videoPlayOnlyVisible:!0,videoLazyLoading:!0,onScroll:null,onInit:null,onDestroy:null,onCoverImage:null};var o,i,a=n.$item.dataset||{},r={};Object.keys(a).forEach(function(e){var t=e.substr(0,1).toLowerCase()+e.substr(1);t&&void 0!==n.defaults[t]&&(r[t]=a[e])}),n.options=n.extend({},n.defaults,r,t),n.pureOptions=n.extend({},n.options),Object.keys(n.options).forEach(function(e){"true"===n.options[e]?n.options[e]=!0:"false"===n.options[e]&&(n.options[e]=!1)}),n.options.speed=Math.min(2,Math.max(-1,parseFloat(n.options.speed))),"string"==typeof n.options.disableParallax&&(n.options.disableParallax=new RegExp(n.options.disableParallax)),n.options.disableParallax instanceof RegExp&&(o=n.options.disableParallax,n.options.disableParallax=function(){return o.test(u.userAgent)}),"function"!=typeof n.options.disableParallax&&(n.options.disableParallax=function(){return!1}),"string"==typeof n.options.disableVideo&&(n.options.disableVideo=new RegExp(n.options.disableVideo)),n.options.disableVideo instanceof RegExp&&(i=n.options.disableVideo,n.options.disableVideo=function(){return i.test(u.userAgent)}),"function"!=typeof n.options.disableVideo&&(n.options.disableVideo=function(){return!1});t=n.options.elementInViewport;(t=t&&"object"===c(t)&&void 0!==t.length?s(t,1)[0]:t)instanceof Element||(t=null),n.options.elementInViewport=t,n.image={src:n.options.imgSrc||null,$container:null,useImgTag:!1,position:"fixed"},n.initImg()&&n.canInitParallax()&&n.init()}var e,t,n;return e=l,(t=[{key:"css",value:function(t,n){return"string"==typeof n?f.window.getComputedStyle(t).getPropertyValue(n):(n.transform&&m&&(n[m]=n.transform),Object.keys(n).forEach(function(e){t.style[e]=n[e]}),t)}},{key:"extend",value:function(n){for(var e=arguments.length,o=new Array(1<e?e-1:0),t=1;t<e;t++)o[t-1]=arguments[t];return n=n||{}
2094,Object.keys(o).forEach(function(t){o[t]&&Object.keys(o[t]).forEach(function(e){n[e]=o[t][e]})}),n}},{key:"getWindowData",value:function(){return{width:f.window.innerWidth||document.documentElement.clientWidth,height:g,y:document.documentElement.scrollTop}}},{key:"initImg",value:function(){var e=this,t=e.options.imgElement;return(t=t&&"string"==typeof t?e.$item.querySelector(t):t)instanceof Element||(e.options.imgSrc?(t=new Image).src=e.options.imgSrc:t=null),t&&(e.options.keepImg?e.image.$item=t.cloneNode(!0):(e.image.$item=t,e.image.$itemParent=t.parentNode),e.image.useImgTag=!0),!!e.image.$item||(null===e.image.src&&(e.image.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",e.image.bgImage=e.css(e.$item,"background-image")),!(!e.image.bgImage||"none"===e.image.bgImage))}},{key:"canInitParallax",value:function(){return m&&!this.options.disableParallax()}},{key:"init",value:function(){var e,t=this,n={position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"hidden"},o={pointerEvents:"none",transformStyle:"preserve-3d",backfaceVisibility:"hidden",willChange:"transform,opacity"};t.options.keepImg||((e=t.$item.getAttribute("style"))&&t.$item.setAttribute("data-jarallax-original-styles",e),!t.image.useImgTag||(e=t.image.$item.getAttribute("style"))&&t.image.$item.setAttribute("data-jarallax-original-styles",e)),"static"===t.css(t.$item,"position")&&t.css(t.$item,{position:"relative"}),"auto"===t.css(t.$item,"z-index")&&t.css(t.$item,{zIndex:0}),t.image.$container=document.createElement("div"),t.css(t.image.$container,n),t.css(t.image.$container,{"z-index":t.options.zIndex}),p&&t.css(t.image.$container,{opacity:.9999}),t.image.$container.setAttribute("id","jarallax-container-".concat(t.instanceID)),t.$item.appendChild(t.image.$container),t.image.useImgTag?o=t.extend({"object-fit":t.options.imgSize,"object-position":t.options.imgPosition,"font-family":"object-fit: ".concat(t.options.imgSize,"; object-position: ").concat(t.options.imgPosition,";"),"max-width":"none"},n,o):(t.image.$item=document.createElement("div"),t.image.src&&(o=t.extend({"background-position":t.options.imgPosition,"background-size":t.options.imgSize,"background-repeat":t.options.imgRepeat,"background-image":t.image.bgImage||'url("'.concat(t.image.src,'")')},n,o))),"opacity"!==t.options.type&&"scale"!==t.options.type&&"scale-opacity"!==t.options.type&&1!==t.options.speed||(t.image.position="absolute"),"fixed"===t.image.position&&(n=function(e){for(var t=[];null!==e.parentElement;)1===(e=e.parentElement).nodeType&&t.push(e);return t}(t.$item).filter(function(e){var t=f.window.getComputedStyle(e),e=t["-webkit-transform"]||t["-moz-transform"]||t.transform;return e&&"none"!==e||/(auto|scroll)/.test(t.overflow+t["overflow-y"]+t["overflow-x"])}),t.image.position=n.length?"absolute":"fixed"),o.position=t.image.position,t.css(t.image.$item,o),t.image.$container.appendChild(t.image.$item),t.onResize(),t.onScroll(!0),t.options.onInit&&t.options.onInit.call(t),"none"!==t.css(t.$item,"background-image")&&t.css(t.$item,{"background-image":"none"}),t.addToParallaxList()}},{key:"addToParallaxList",value:function(){y.push({instance:this}),1===y.length&&f.window.requestAnimationFrame(h)}},{key:"removeFromParallaxList",value:function(){var n=this;y.forEach(function(e,t){e.instance.instanceID===n.instanceID&&y.splice(t,1)})}},{key:"destroy",value:function(){var e=this;e.removeFromParallaxList();var t,n=e.$item.getAttribute("data-jarallax-original-styles");e.$item.removeAttribute("data-jarallax-original-styles"),n?e.$item.setAttribute("style",n):e.$item.removeAttribute("style"),e.image.useImgTag&&(t=e.image.$item.getAttribute("data-jarallax-original-styles"),e.image.$item.removeAttribute("data-jarallax-original-styles"),t?e.image.$item.setAttribute("style",n):e.image.$item.removeAttribute("style"),e.image.$itemParent&&e.image.$itemParent.appendChild(e.image.$item)),e.$clipStyles&&e.$clipStyles.parentNode.removeChild(e.$clipStyles),e.image.$container&&e.image.$container.parentNode.removeChild(e.image.$container),e.options.onDestroy&&e.options.onDestroy.call(e),delete e.$item.jarallax}},{key:"clipContainer",value:function(){var e,t,n;"fixed"===this.image.position&&(t=(n=(e=this).image.$container.getBoundingClientRect()).width,n=n.height,e.$clipStyles||(e.$clipStyles=document.createElement("style"),e.$clipStyles.setAttribute("type","text/css"),e.$clipStyles.setAttribute("id","jarallax-clip-".concat(e.instanceID)),(document.head||document.getElementsByTagName("head")[0]).appendChild(e.$clipStyles)),n="#jarallax-container-".concat(e.instanceID," {\\n clip: rect(0 ").concat(t,"px ").concat(n,"px 0);\\n clip: rect(0, ").concat(t,"px, ").concat(n,"px, 0);\\n -webkit-clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);\\n clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);\\n }"),e.$clipStyles.styleSheet?e.$clipStyles.styleSheet.cssText=n:e.$clipStyles.innerHTML=n)}},{key:"coverImage",value:function(){var e=this,t=e.image.$container.getBoundingClientRect(),n=t.height,o=e.options.speed,i="scroll"===e.options.type||"scroll-opacity"===e.options.type,a=0,r=n,l=0;return i&&(o<0?(a=o*Math.max(n,g),g<n&&(a-=o*(n-g))):a=o*(n+g),1<o?r=Math.abs(a-g):o<0?r=a/o+Math.abs(a):r+=(g-n)*(1-o),a/=2),e.parallaxScrollDistance=a,l=i?(g-r)/2:(n-r)/2,e.css(e.image.$item,{height:"".concat(r,"px"),marginTop:"".concat(l,"px"),left:"fixed"===e.image.position?"".concat(t.left,"px"):"0",width:"".concat(t.width,"px")}
2094),e.options.onCoverImage&&e.options.onCoverImage.call(e),{image:{height:r,marginTop:l},container:t}}},{key:"isVisible",value:function(){return this.isElementInViewport||!1}},{key:"onScroll",value:function(e){var t,n,o,i,a,r,l,s=this,c=s.$item.getBoundingClientRect(),u=c.top,p=c.height,m={},d=c;s.options.elementInViewport&&(d=s.options.elementInViewport.getBoundingClientRect()),s.isElementInViewport=0<=d.bottom&&0<=d.right&&d.top<=g&&d.left<=f.window.innerWidth,(e||s.isElementInViewport)&&(t=Math.max(0,u),n=Math.max(0,p+u),o=Math.max(0,-u),i=Math.max(0,u+p-g),a=Math.max(0,p-(u+p-g)),r=Math.max(0,-u+g-p),d=1-(g-u)/(g+p)*2,e=1,p<g?e=1-(o||i)/p:n<=g?e=n/g:a<=g&&(e=a/g),"opacity"!==s.options.type&&"scale-opacity"!==s.options.type&&"scroll-opacity"!==s.options.type||(m.transform="translate3d(0,0,0)",m.opacity=e),"scale"!==s.options.type&&"scale-opacity"!==s.options.type||(l=1,s.options.speed<0?l-=s.options.speed*e:l+=s.options.speed*(1-e),m.transform="scale(".concat(l,") translate3d(0,0,0)")),"scroll"!==s.options.type&&"scroll-opacity"!==s.options.type||(l=s.parallaxScrollDistance*d,"absolute"===s.image.position&&(l-=u),m.transform="translate3d(0,".concat(l,"px,0)")),s.css(s.image.$item,m),s.options.onScroll&&s.options.onScroll.call(s,{section:c,beforeTop:t,beforeTopEnd:n,afterTop:o,beforeBottom:i,beforeBottomEnd:a,afterBottom:r,visiblePercent:e,fromViewportCenter:d}))}},{key:"onResize",value:function(){this.coverImage(),this.clipContainer()}}])&&a(e.prototype,t),n&&a(e,n),l}(),o=function(e,t){for(var n,o=(e=("object"===("undefined"==typeof HTMLElement?"undefined":c(HTMLElement))?e instanceof HTMLElement:e&&"object"===c(e)&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName)?[e]:e).length,i=0,a=arguments.length,r=new Array(2<a?a-2:0),l=2;l<a;l++)r[l-2]=arguments[l];for(;i<o;i+=1)if("object"===c(t)||void 0===t?e[i].jarallax||(e[i].jarallax=new v(e[i],t)):e[i].jarallax&&(n=e[i].jarallax[t].apply(e[i].jarallax,r)),void 0!==n)return n;return e};o.constructor=v,t.default=o}},o={};function l(e){var t=o[e];if(void 0!==t)return t.exports;t=o[e]={exports:{}};return n[e](t,t.exports,l),t.exports}l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,{a:t}),t},l.d=function(e,t){for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},l.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};!function(){"use strict";l.r(s);var e=l(1),t=l.n(e),i=l(2),a=l(8);function r(e){return(r="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})(e)}var n,o=i.window.jarallax;i.window.jarallax=a.default,i.window.jarallax.noConflict=function(){return i.window.jarallax=o,this},void 0!==i.jQuery&&((e=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];Array.prototype.unshift.call(t,this);var o=a.default.apply(i.window,t);return"object"!==r(o)?o:this}).constructor=a.default.constructor,n=i.jQuery.fn.jarallax,i.jQuery.fn.jarallax=e,i.jQuery.fn.jarallax.noConflict=function(){return i.jQuery.fn.jarallax=n,this}),t()(function(){(0,a.default)(document.querySelectorAll("[data-jarallax]"))})}()}(); 2095//# sourceMappingURL=jarallax.min.js.map 2096`},9923:function(e){e.exports=`/* 2097 * Lightcase - jQuery Plugin 2098 * The smart and flexible Lightbox Plugin. 2099 * 2100 * @author Cornel Boppart <[email protected]> 2101 * @copyright Author 2102 * 2103 * @version 2.5.0 (11/03/2018) 2104 */ 2105 2106;(function ($) { 2107 2108 'use strict'; 2109 2110 var _self = { 2111 cache: {}, 2112 2113 support: {}, 2114 2115 objects: {}, 2116 2117 /** 2118 * Initializes the plugin 2119 * 2120 * @param {object} options 2121 * @return {object} 2122 */ 2123 init: function (options) { 2124 return this.each(function () { 2125 $(this).unbind('click.lightcase').bind('click.lightcase', function (event) { 2126 event.preventDefault(); 2127 $(this).lightcase('start', options); 2128 }); 2129 }); 2130 }, 2131 2132 /** 2133 * Starts the plugin 2134 * 2135 * @param {object} options 2136 * @return {void} 2137 */ 2138 start: function (options) { 2139 _self.origin = lightcase.origin = this; 2140 2141 _self.settings = lightcase.settings = $.extend(true, { 2142 idPrefix: 'lightcase-', 2143 classPrefix: 'lightcase-', 2144 attrPrefix: 'lc-', 2145 transition: 'elastic', 2146 transitionOpen: null, 2147 transitionClose: null, 2148 transitionIn: null, 2149 transitionOut: null, 2150 cssTransitions: true, 2151 speedIn: 250, 2152 speedOut: 250, 2153 width: null, 2154 height: null, 2155 maxWidth: 800, 2156 maxHeight: 500, 2157 forceWidth: false, 2158 forceHeight: false, 2159 liveResize: true, 2160 fullScreenModeForMobile: true, 2161 mobileMatchExpression: /(iphone|ipod|ipad|android|blackberry|symbian)/, 2162 disableShrink: false, 2163 fixedRatio: true, 2164 shrinkFactor: .75, 2165 overlayOpacity: .9, 2166 slideshow: false, 2167 slideshowAutoStart: true, 2168 breakBeforeShow: false, 2169 timeout: 5000, 2170 swipe: true, 2171 useKeys: true, 2172 useCategories: true, 2173 useAsCollection: false, 2174 navigateEndless: true, 2175 closeOnOverlayClick: true, 2176 title: null, 2177 caption: null, 2178 showTitle: true, 2179 showCaption: true, 2180 showSequenceInfo: true, 2181 inline: { 2182 width: 'auto', 2183 height: 'auto' 2184 }, 2185 ajax: { 2186 width: 'auto', 2187 height: 'auto', 2188 type: 'get', 2189 dataType: 'html', 2190 data: {} 2191 }, 2192 iframe: { 2193 width: 800, 2194 height: 500, 2195 frameborder: 0 2196 }, 2197 flash: { 2198 width: 400, 2199 height: 205, 2200 wmode: 'transparent' 2201 }, 2202 video: { 2203 width: 400, 2204 height: 225, 2205 poster: '', 2206 preload: 'auto', 2207 controls: true, 2208 autobuffer: true, 2209 autoplay: true, 2210 loop: false 2211 }, 2212 attr: 'data-rel', 2213 href: null, 2214 type: null, 2215 typeMapping: { 2216 'image': 'jpg,jpeg,gif,png,bmp', 2217 'flash': 'swf', 2218 'video': 'mp4,mov,ogv,ogg,webm', 2219 'iframe': 'html,php', 2220 'ajax': 'json,txt', 2221 'inline': '#' 2222 }, 2223 errorMessage: function () { 2224 return '<p class="' + _self.settings.classPrefix + 'error">' + _self.settings.labels['errorMessage'] + '</p>'; 2225 }, 2226 labels: { 2227 'errorMessage': 'Source could not be found...', 2228 'sequenceInfo.of': ' of ', 2229 'close': 'Close', 2230 'navigator.prev': 'Prev', 2231 'navigator.next': 'Next', 2232 'navigator.play': 'Play', 2233 'navigator.pause': 'Pause' 2234 }, 2235 markup: function () { 2236 _self.objects.body.append(
2237 _self.objects.overlay = $('<div id="' + _self.settings.idPrefix + 'overlay"></div>'), 2238 _self.objects.loading = $('<div id="' + _self.settings.idPrefix + 'loading" class="' + _self.settings.classPrefix + 'icon-spin"></div>'), 2239 _self.objects.case = $('<div id="' + _self.settings.idPrefix + 'case" aria-hidden="true" role="dialog"></div>') 2240 ); 2241 _self.objects.case.after( 2242 _self.objects.close = $('<a href="#" class="' + _self.settings.classPrefix + 'icon-close"><span>' + _self.settings.labels['close'] + '</span></a>'), 2243 _self.objects.nav = $('<div id="' + _self.settings.idPrefix + 'nav"></div>') 2244 ); 2245 _self.objects.nav.append( 2246 _self.objects.prev = $('<a href="#" class="' + _self.settings.classPrefix + 'icon-prev"><span>' + _self.settings.labels['navigator.prev'] + '</span></a>').hide(), 2247 _self.objects.next = $('<a href="#" class="' + _self.settings.classPrefix + 'icon-next"><span>' + _self.settings.labels['navigator.next'] + '</span></a>').hide(), 2248 _self.objects.play = $('<a href="#" class="' + _self.settings.classPrefix + 'icon-play"><span>' + _self.settings.labels['navigator.play'] + '</span></a>').hide(), 2249 _self.objects.pause = $('<a href="#" class="' + _self.settings.classPrefix + 'icon-pause"><span>' + _self.settings.labels['navigator.pause'] + '</span></a>').hide() 2250 ); 2251 _self.objects.case.append( 2252 _self.objects.content = $('<div id="' + _self.settings.idPrefix + 'content"></div>'), 2253 _self.objects.info = $('<div id="' + _self.settings.idPrefix + 'info"></div>') 2254 ); 2255 _self.objects.content.append(
2256 _self.objects.contentInner = $('<div class="' + _self.settings.classPrefix + 'contentInner"></div>') 2257 ); 2258 _self.objects.info.append( 2259 _self.objects.sequenceInfo = $('<div id="' + _self.settings.idPrefix + 'sequenceInfo"></div>'), 2260 _self.objects.title = $('<h4 id="' + _self.settings.idPrefix + 'title"></h4>'), 2261 _self.objects.caption = $('<p id="' + _self.settings.idPrefix + 'caption"></p>') 2262 ); 2263 }, 2264 onInit: {}, 2265 onStart: {}, 2266 onBeforeCalculateDimensions: {}, 2267 onAfterCalculateDimensions: {}, 2268 onBeforeShow: {}, 2269 onFinish: {}, 2270 onResize: {}, 2271 onClose: {}, 2272 onCleanup: {} 2273 }, 2274 options, 2275 // Load options from data-lc-options attribute 2276 _self.origin.data ? _self.origin.data('lc-options') : {}); 2277 2278 _self.objects.document = $('html'); 2279 _self.objects.body = $('body'); 2280 2281 // Call onInit hook functions 2282 _self._callHooks(_self.settings.onInit); 2283 2284 _self.objectData = _self._setObjectData(this); 2285 2286 _self._addElements(); 2287 _self._open(); 2288 2289 _self.dimensions = _self.getViewportDimensions(); 2290 }, 2291 2292 /** 2293 * Getter method for objects 2294 * 2295 * @param {string} name 2296 * @return {object} 2297 */ 2298 get: function (name) { 2299 return _self.objects[name]; 2300 }, 2301 2302 /** 2303 * Getter method for objectData 2304 * 2305 * @return {object} 2306 */ 2307 getObjectData: function () { 2308 return _self.objectData; 2309 }, 2310 2311 /** 2312 * Sets the object data 2313 * 2314 * @param {object} object 2315 * @return {object} objectData 2316 */ 2317 _setObjectData: function (object) { 2318 var $object = $(object), 2319 objectData = { 2320 this: $(object), 2321 title: _self.settings.title || $object.attr(_self._prefixAttributeName('title')) || $object.attr('title'), 2322 caption: _self.settings.caption || $object.attr(_self._prefixAttributeName('caption')) || $object.children('img').attr('alt'), 2323 url: _self._determineUrl(), 2324 requestType: _self.settings.ajax.type, 2325 requestData: _self.settings.ajax.data, 2326 requestDataType: _self.settings.ajax.dataType, 2327 rel: $object.attr(_self._determineAttributeSelector()), 2328 type: _self.settings.type || _self._verifyDataType(_self._determineUrl()), 2329 isPartOfSequence: _self.settings.useAsCollection || _self._isPartOfSequence($object.attr(_self.settings.attr), ':'), 2330 isPartOfSequenceWithSlideshow: _self._isPartOfSequence($object.attr(_self.settings.attr), ':slideshow'), 2331 currentIndex: $(_self._determineAttributeSelector()).index($object), 2332 sequenceLength: $(_self._determineAttributeSelector()).length 2333 }; 2334 2335 // Add sequence info to objectData 2336 objectData.sequenceInfo = (objectData.currentIndex + 1) + _self.settings.labels['sequenceInfo.of'] + objectData.sequenceLength; 2337 2338 // Add next/prev index 2339 objectData.prevIndex = objectData.currentIndex - 1; 2340 objectData.nextIndex = objectData.currentIndex + 1; 2341 2342 return objectData; 2343 }, 2344 2345 /** 2346 * Prefixes a data attribute name with defined name from 'settings.attrPrefix' 2347 * to ensure more uniqueness for all lightcase related/used attributes. 2348 * 2349 * @param {string} name 2350 * @return {string} 2351 */ 2352 _prefixAttributeName: function (name) { 2353 return 'data-' + _self.settings.attrPrefix + name; 2354 }, 2355 2356 /** 2357 * Determines the link target considering 'settings.href' and data attributes 2358 * but also with a fallback to the default 'href' value. 2359 * 2360 * @return {string} 2361 */ 2362 _determineLinkTarget: function () { 2363 return _self.settings.href || $(_self.origin).attr(_self._prefixAttributeName('href')) || $(_self.origin).attr('href'); 2364 }, 2365 2366 /** 2367 * Determines the attribute selector to use, depending on 2368 * whether categorized collections are beeing used or not. 2369 * 2370 * @return {string} selector 2371 */ 2372 _determineAttributeSelector: function () { 2373 var $origin = $(_self.origin), 2374 selector = ''; 2375 2376 if (typeof _self.cache.selector !== 'undefined') { 2377 selector = _self.cache.selector; 2378 } else if (_self.settings.useCategories === true && $origin.attr(_self._prefixAttributeName('categories'))) { 2379 var categories = $origin.attr(_self._prefixAttributeName('categories')).split(' '); 2380 2381 $.each(categories, function (index, category) { 2382 if (index > 0) { 2383 selector += ','; 2384 } 2385 selector += '[' + _self._prefixAttributeName('categories') + '~="' + category + '"]'; 2386 }); 2387 } else { 2388 selector = '[' + _self.settings.attr + '="' + $origin.attr(_self.settings.attr) + '"]'; 2389 } 2390 2391 _self.cache.selector = selector; 2392 2393 return selector; 2394 }, 2395 2396 /** 2397 * Determines the correct resource according to the 2398 * current viewport and density. 2399 * 2400 * @return {string} url 2401 */ 2402 _determineUrl: function () { 2403 var dataUrl = _self._verifyDataUrl(_self._determineLinkTarget()), 2404 width = 0, 2405 density = 0, 2406 supportLevel = '', 2407 url; 2408 2409 $.each(dataUrl, function (index, src) { 2410 switch (_self._verifyDataType(src.url)) { 2411 case 'video': 2412 var video = document.createElement('video'), 2413 videoType = _self._verifyDataType(src.url) + '/' + _self._getFileUrlSuffix(src.url); 2414 2415 // Check if browser can play this type of video format 2416 if (supportLevel !== 'probably' && supportLevel !== video.canPlayType(videoType) && video.canPlayType(videoType) !== '') { 2417 supportLevel = video.canPlayType(videoType); 2418 url = src.url; 2419 } 2420 break; 2421 default: 2422 if ( 2423 // Check density 2424 _self._devicePixelRatio() >= src.density && 2425 src.density >= density && 2426 // Check viewport width 2427 _self._matchMedia()('screen and (min-width:' + src.width + 'px)').matches && 2428 src.width >= width 2429 ) { 2430 width = src.width; 2431 density = src.density; 2432 url = src.url; 2433 } 2434 break; 2435 } 2436 }); 2437 2438 return url; 2439 }, 2440 2441 /** 2442 * Normalizes an url and returns information about the resource path, 2443 * the viewport width as well as density if defined. 2444 * 2445 * @param {string} url Path to resource in format of an url or srcset 2446 * @return {object} 2447 */ 2448 _normalizeUrl: function (url) { 2449 var srcExp = /^\\d+$/; 2450 2451 return url.split(',').map(function (str) { 2452 var src = { 2453 width: 0, 2454 density: 0 2455 }; 2456
2457 str.trim().split(/\\s+/).forEach(function (url, i) { 2458 if (i === 0) { 2459 return src.url = url; 2460 } 2461 2462 var value = url.substring(0, url.length - 1), 2463 lastChar = url[url.length - 1], 2464 intVal = parseInt(value, 10), 2465 floatVal = parseFloat(value); 2466 if (lastChar === 'w' && srcExp.test(value)) { 2467 src.width = intVal; 2468 } else if (lastChar === 'h' && srcExp.test(value)) { 2469 src.height = intVal; 2470 } else if (lastChar === 'x' && !isNaN(floatVal)) { 2471 src.density = floatVal; 2472 } 2473 }); 2474 2475 return src; 2476 }); 2477 }, 2478 2479 /** 2480 * Verifies if the link is part of a sequence 2481 * 2482 * @param {string} rel 2483 * @param {string} expression 2484 * @return {boolean} 2485 */ 2486 _isPartOfSequence: function (rel, expression) { 2487 var getSimilarLinks = $('[' + _self.settings.attr + '="' + rel + '"]'), 2488 regexp = new RegExp(expression); 2489 2490 return (regexp.test(rel) && getSimilarLinks.length > 1); 2491 }, 2492 2493 /** 2494 * Verifies if the slideshow should be enabled 2495 * 2496 * @return {boolean} 2497 */ 2498 isSlideshowEnabled: function () { 2499 return (_self.objectData.isPartOfSequence && (_self.settings.slideshow === true || _self.objectData.isPartOfSequenceWithSlideshow === true)); 2500 }, 2501 2502 /** 2503 * Loads the new content to show 2504 * 2505 * @return {void} 2506 */ 2507 _loadContent: function () { 2508 if (_self.cache.originalObject) { 2509 _self._restoreObject(); 2510 } 2511 2512 _self._createObject(); 2513 }, 2514 2515 /** 2516 * Creates a new object 2517 * 2518 * @return {void} 2519 */ 2520 _createObject: function () { 2521 var $object; 2522 2523 // Create object 2524 switch (_self.objectData.type) { 2525 case 'image': 2526 $object = $(new Image()); 2527 $object.attr({ 2528 // The time expression is required to prevent the binding of an image load 2529 'src': _self.objectData.url, 2530 'alt': _self.objectData.title 2531 }); 2532 break; 2533 case 'inline': 2534 $object = $('<div class="' + _self.settings.classPrefix + 'inlineWrap"></div>'); 2535 $object.html(_self._cloneObject($(_self.objectData.url))); 2536 2537 // Add custom attributes from _self.settings 2538 $.each(_self.settings.inline, function (name, value) { 2539 $object.attr(_self._prefixAttributeName(name), value); 2540 }); 2541 break; 2542 case 'ajax': 2543 $object = $('<div class="' + _self.settings.classPrefix + 'inlineWrap"></div>'); 2544 2545 // Add custom attributes from _self.settings 2546 $.each(_self.settings.ajax, function (name, value) { 2547 if (name !== 'data') { 2548 $object.attr(_self._prefixAttributeName(name), value); 2549 } 2550 }); 2551 break; 2552 case 'flash': 2553 $object = $('<embed src="' + _self.objectData.url + '" type="application/x-shockwave-flash"></embed>'); 2554 2555 // Add custom attributes from _self.settings 2556 $.each(_self.settings.flash, function (name, value) { 2557 $object.attr(name, value); 2558 }); 2559 break; 2560 case 'video': 2561 $object = $('<video></video>'); 2562 $object.attr('src', _self.objectData.url); 2563 2564 // Add custom attributes from _self.settings 2565 $.each(_self.settings.video, function (name, value) { 2566 $object.attr(name, value); 2567 }); 2568 break; 2569 default: 2570 $object = $('<iframe></iframe>'); 2571 $object.attr({ 2572 'src': _self.objectData.url 2573 }); 2574 2575 // Add custom attributes from _self.settings 2576 $.each(_self.settings.iframe, function (name, value) { 2577 $object.attr(name, value); 2578 }); 2579 break; 2580 } 2581 2582 _self._addObject($object); 2583 _self._loadObject($object); 2584 }, 2585 2586 /** 2587 * Adds the new object to the markup 2588 * 2589 * @param {object} $object 2590 * @return {void} 2591 */ 2592 _addObject: function ($object) { 2593 // Add object to content holder 2594 _self.objects.contentInner.html($object); 2595 2596 // Start loading 2597 _self._loading('start'); 2598 2599 // Call onStart hook functions 2600 _self._callHooks(_self.settings.onStart); 2601 2602 // Add sequenceInfo to the content holder or hide if its empty 2603 if (_self.settings.showSequenceInfo === true && _self.objectData.isPartOfSequence) { 2604 _self.objects.sequenceInfo.html(_self.objectData.sequenceInfo); 2605 _self.objects.sequenceInfo.show(); 2606 } else { 2607 _self.objects.sequenceInfo.empty(); 2608 _self.objects.sequenceInfo.hide(); 2609 } 2610 // Add title to the content holder or hide if its empty 2611 if (_self.settings.showTitle === true && _self.objectData.title !== undefined && _self.objectData.title !== '') { 2612 _self.objects.title.html(_self.objectData.title); 2613 _self.objects.title.show(); 2614 } else { 2615 _self.objects.title.empty(); 2616 _self.objects.title.hide(); 2617 } 2618 // Add caption to the content holder or hide if its empty 2619 if (_self.settings.showCaption === true && _self.objectData.caption !== undefined && _self.objectData.caption !== '') { 2620 _self.objects.caption.html(_self.objectData.caption); 2621 _self.objects.caption.show(); 2622 } else { 2623 _self.objects.caption.empty(); 2624 _self.objects.caption.hide(); 2625 } 2626 }, 2627 2628 /** 2629 * Loads the new object 2630 * 2631 * @param {object} $object 2632 * @return {void} 2633 */ 2634 _loadObject: function ($object) { 2635 // Load the object 2636 switch (_self.objectData.type) { 2637 case 'inline': 2638 if ($(_self.objectData.url)) { 2639 _self._showContent($object); 2640 } else { 2641 _self.error(); 2642 } 2643 break; 2644 case 'ajax': 2645 $.ajax( 2646 $.extend({}, _self.settings.ajax, { 2647 url: _self.objectData.url, 2648 type: _self.objectData.requestType, 2649 dataType: _self.objectData.requestDataType, 2650 data: _self.objectData.requestData, 2651 success: function (data, textStatus, jqXHR) { 2652 // Check for X-Ajax-Location 2653 if (jqXHR.getResponseHeader('X-Ajax-Location')) { 2654 _self.objectData.url = jqXHR.getResponseHeader('X-Ajax-Location'); 2655 _self._loadObject($object); 2656 } 2657 else { 2658 // Unserialize if data is transferred as json 2659 if (_self.objectData.requestDataType === 'json') { 2660 _self.objectData.data = data; 2661 } else { 2662 $object.html(data); 2663 } 2664 _self._showContent($object); 2665 } 2666 }, 2667 error: function (jqXHR, textStatus, errorThrown) { 2668 _self.error(); 2669 } 2670 }) 2671 ); 2672 break; 2673 case 'flash': 2674 _self._showContent($object); 2675 break; 2676 case 'video': 2677 if (typeof($object.get(0).canPlayType) === 'function' || _self.objects.case.find('video').length === 0) { 2678 _self._showContent($object); 2679 } else { 2680 _self.error(); 2681 } 2682 break; 2683 default: 2684 if (_self.objectData.url) { 2685 $object.on('load', function () { 2686 _self._showContent($object); 2687 }); 2688 $object.on('error', function () { 2689 _self.error(); 2690 }); 2691 } else { 2692 _self.error(); 2693 } 2694 break; 2695 } 2696 }, 2697 2698 /** 2699 * Throws an error message if something went wrong 2700 * 2701 * @return {void} 2702 */ 2703 error: function () { 2704 _self.objectData.type = 'error'; 2705 var $object = $('<div class="' + _self.settings.classPrefix + 'inlineWrap"></div>'); 2706 2707 $object.html(_self.settings.errorMessage); 2708 _self.objects.contentInner.html($object); 2709 2710 _self._showContent(_self.objects.contentInner); 2711 }, 2712 2713 /** 2714 * Calculates the dimensions to fit content 2715 * 2716 * @param {object} $object 2717 * @return {void} 2718 */ 2719 _calculateDimensions: function ($object) { 2720 _self._cleanupDimensions(); 2721 2722 if (!$object) return; 2723 2724 // Set default dimensions 2725 var dimensions = { 2726 ratio: 1, 2727 objectWidth: $object.attr('width') ? $object.attr('width') : $object.attr(_self._prefixAttributeName('width')), 2728 objectHeight: $object.attr('height') ? $object.attr('height') : $object.attr(_self._prefixAttributeName('height')) 2729 }; 2730 2731 if (!_self.settings.disableShrink) { 2732 // Add calculated maximum width/height to dimensions 2733 dimensions.maxWidth = parseInt(_self.dimensions.windowWidth * _self.settings.shrinkFactor); 2734 dimensions.maxHeight = parseInt(_self.dimensions.windowHeight * _self.settings.shrinkFactor); 2735 2736 // If the auto calculated maxWidth/maxHeight greather than the user-defined one, use that. 2737 if (dimensions.maxWidth > _self.settings.maxWidth) { 2738 dimensions.maxWidth = _self.settings.maxWidth; 2739 } 2740 if (dimensions.maxHeight > _self.settings.maxHeight) { 2741 dimensions.maxHeight = _self.settings.maxHeight; 2742 } 2743 2744 // Calculate the difference between screen width/height and image width/height 2745 dimensions.differenceWidthAsPercent = parseInt(100 / dimensions.maxWidth * dimensions.objectWidth); 2746 dimensions.differenceHeightAsPercent = parseInt(100 / dimensions.maxHeight * dimensions.objectHeight); 2747 2748 switch (_self.objectData.type) { 2749 case 'image': 2750 case 'flash': 2751 case 'video': 2752 case 'iframe': 2753 case 'ajax': 2754 case 'inline': 2755 if (_self.objectData.type === 'image' || _self.settings.fixedRatio === true) { 2756 if (dimensions.differenceWidthAsPercent > 100 && dimensions.differenceWidthAsPercent > dimensions.differenceHeightAsPercent) { 2757 dimensions.objectWidth = dimensions.maxWidth; 2758 dimensions.objectHeight = parseInt(dimensions.objectHeight / dimensions.differenceWidthAsPercent * 100); 2759 } 2760 if (dimensions.differenceHeightAsPercent > 100 && dimensions.differenceHeightAsPercent > dimensions.differenceWidthAsPercent) { 2761 dimensions.objectWidth = parseInt(dimensions.objectWidth / dimensions.differenceHeightAsPercent * 100); 2762 dimensions.objectHeight = dimensions.maxHeight; 2763 } 2764 if (dimensions.differenceHeightAsPercent > 100 && dimensions.differenceWidthAsPercent < dimensions.differenceHeightAsPercent) { 2765 dimensions.objectWidth = parseInt(dimensions.maxWidth / dimensions.differenceHeightAsPercent * dimensions.differenceWidthAsPercent); 2766 dimensions.objectHeight = dimensions.maxHeight; 2767 } 2768 break; 2769 } 2770 case 'error': 2771 if (!isNaN(dimensions.objectWidth) && dimensions.objectWidth > dimensions.maxWidth) { 2772 dimensions.objectWidth = dimensions.maxWidth; 2773 } 2774 break; 2775 default: 2776 if ((isNaN(dimensions.objectWidth) || dimensions.objectWidth > dimensions.maxWidth) && !_self.settings.forceWidth) { 2777 dimensions.objectWidth = dimensions.maxWidth; 2778 } 2779 if (((isNaN(dimensions.objectHeight) && dimensions.objectHeight !== 'auto') || dimensions.objectHeight > dimensions.maxHeight) && !_self.settings.forceHeight) { 2780 dimensions.objectHeight = dimensions.maxHeight; 2781 } 2782 break; 2783 } 2784 } 2785 2786 if (_self.settings.forceWidth) { 2787 try { 2788 dimensions.objectWidth = _self.settings[_self.objectData.type].width; 2789 } catch (e) { 2790 dimensions.objectWidth = _self.settings.width || dimensions.objectWidth; 2791 } 2792 2793 dimensions.maxWidth = null; 2794 } 2795 if ($object.attr(_self._prefixAttributeName('max-width'))) { 2796 dimensions.maxWidth = $object.attr(_self._prefixAttributeName('max-width')); 2797 } 2798 2799 if (_self.settings.forceHeight) { 2800 try { 2801 dimensions.objectHeight = _self.settings[_self.objectData.type].height; 2802 } catch (e) { 2803 dimensions.objectHeight = _self.settings.height || dimensions.objectHeight; 2804 } 2805 2806 dimensions.maxHeight = null; 2807 } 2808 if ($object.attr(_self._prefixAttributeName('max-height'))) { 2809 dimensions.maxHeight = $object.attr(_self._prefixAttributeName('max-height')); 2810 } 2811 _self._adjustDimensions($object, dimensions); 2812 }, 2813 2814 /** 2815 * Adjusts the dimensions 2816 * 2817 * @param {object} $object 2818 * @param {object} dimensions 2819 * @return {void} 2820 */
2821 _adjustDimensions: function ($object, dimensions) { 2822 // Adjust width and height 2823 $object.css({ 2824 'width': dimensions.objectWidth, 2825 'height': dimensions.objectHeight, 2826 'max-width': dimensions.maxWidth, 2827 'max-height': dimensions.maxHeight 2828 }); 2829 2830 _self.objects.contentInner.css({ 2831 'width': $object.outerWidth(), 2832 'height': $object.outerHeight(), 2833 'max-width': '100%' 2834 }); 2835 2836 _self.objects.case.css({ 2837 'width': _self.objects.contentInner.outerWidth(), 2838 'max-width': '100%' 2839 }); 2840 2841 // Adjust margin 2842 _self.objects.case.css({ 2843 'margin-top': parseInt(-(_self.objects.case.outerHeight() / 2)), 2844 'margin-left': parseInt(-(_self.objects.case.outerWidth() / 2)) 2845 }); 2846 }, 2847 2848 /** 2849 * Handles the _loading 2850 * 2851 * @param {string} process 2852 * @return {void} 2853 */ 2854 _loading: function (process) { 2855 if (process === 'start') { 2856 _self.objects.case.addClass(_self.settings.classPrefix + 'loading'); 2857 _self.objects.loading.show(); 2858 } else if (process === 'end') { 2859 _self.objects.case.removeClass(_self.settings.classPrefix + 'loading'); 2860 _self.objects.loading.hide(); 2861 } 2862 }, 2863 2864 2865 /** 2866 * Gets the client screen dimensions 2867 * 2868 * @return {object} dimensions 2869 */ 2870 getViewportDimensions: function () { 2871 return { 2872 windowWidth: $(window).innerWidth(), 2873 windowHeight: $(window).innerHeight() 2874 }; 2875 }, 2876 2877 /** 2878 * Verifies the url 2879 * 2880 * @param {string} dataUrl 2881 * @return {object} dataUrl Clean url for processing content 2882 */ 2883 _verifyDataUrl: function (dataUrl) { 2884 if (!dataUrl || dataUrl === undefined || dataUrl === '') { 2885 return false; 2886 } 2887 2888 if (dataUrl.indexOf('#') > -1) { 2889 dataUrl = dataUrl.split('#'); 2890 dataUrl = '#' + dataUrl[dataUrl.length - 1]; 2891 } 2892 2893 return _self._normalizeUrl(dataUrl.toString()); 2894 }, 2895 2896 // 2897 /** 2898 * Tries to get the (file) suffix of an url 2899 * 2900 * @param {string} url 2901 * @return {string} 2902 */ 2903 _getFileUrlSuffix: function (url) { 2904 var re = /(?:\\.([^.]+))?$/; 2905 return re.exec(url.toLowerCase())[1]; 2906 }, 2907 2908 /** 2909 * Verifies the data type of the content to load 2910 * 2911 * @param {string} url 2912 * @return {string|boolean} Array key if expression matched, else false 2913 */ 2914 _verifyDataType: function (url) { 2915 var typeMapping = _self.settings.typeMapping; 2916 2917 // Early abort if dataUrl couldn't be verified 2918 if (!url) { 2919 return false; 2920 } 2921 2922 // Verify the dataType of url according to typeMapping which 2923 // has been defined in settings. 2924 for (var key in typeMapping) { 2925 if (typeMapping.hasOwnProperty(key)) { 2926 var suffixArr = typeMapping[key].split(','); 2927 2928 for (var i = 0; i < suffixArr.length; i++) { 2929 var suffix = suffixArr[i].toLowerCase(), 2930 regexp = new RegExp('\\.(' + suffix + ')$', 'i'), 2931 str = url.toLowerCase().split('?')[0].substr(-5); 2932 2933 if (regexp.test(str) === true || (key === 'inline' && (url.indexOf(suffix) > -1))) { 2934 return key; 2935 } 2936 } 2937 } 2938 } 2939 2940 // If no expression matched, return 'iframe'. 2941 return 'iframe'; 2942 }, 2943 2944 /** 2945 * Extends html markup with the essential tags 2946 * 2947 * @return {void} 2948 */ 2949 _addElements: function () { 2950 if (typeof _self.objects.case !== 'undefined' && $('#' + _self.objects.case.attr('id')).length) { 2951 return; 2952 } 2953 2954 _self.settings.markup(); 2955 }, 2956 2957 /** 2958 * Shows the loaded content 2959 * 2960 * @param {object} $object 2961 * @return {void} 2962 */ 2963 _showContent: function ($object) { 2964 // Add data attribute with the object type 2965 _self.objects.document.attr(_self._prefixAttributeName('type'), _self.objectData.type); 2966 2967 _self.cache.object = $object; 2968 2969 // Call onBeforeShow hook functions 2970 _self._callHooks(_self.settings.onBeforeShow); 2971 2972 if (_self.settings.breakBeforeShow) return; 2973 _self.show(); 2974 }, 2975 2976 /** 2977 * Starts the 'inTransition' 2978 * @return {void} 2979 */ 2980 _startInTransition: function () { 2981 switch (_self.transition.in()) { 2982 case 'scrollTop': 2983 case 'scrollRight': 2984 case 'scrollBottom': 2985 case 'scrollLeft': 2986 case 'scrollHorizontal': 2987 case 'scrollVertical': 2988 _self.transition.scroll(_self.objects.case, 'in', _self.settings.speedIn); 2989 _self.transition.fade(_self.objects.contentInner, 'in', _self.settings.speedIn); 2990 break; 2991 case 'elastic': 2992 if (_self.objects.case.css('opacity') < 1) { 2993 _self.transition.zoom(_self.objects.case, 'in', _self.settings.speedIn); 2994 _self.transition.fade(_self.objects.contentInner, 'in', _self.settings.speedIn); 2995 } 2996 case 'fade': 2997 case 'fadeInline': 2998 _self.transition.fade(_self.objects.case, 'in', _self.settings.speedIn); 2999 _self.transition.fade(_self.objects.contentInner, 'in', _self.settings.speedIn); 3000 break; 3001 default: 3002 _self.transition.fade(_self.objects.case, 'in', 0); 3003 break; 3004 } 3005 3006 // End loading. 3007 _self._loading('end'); 3008 _self.isBusy = false;
3009 3010 // Set index of the first item opened 3011 if (!_self.cache.firstOpened) { 3012 _self.cache.firstOpened = _self.objectData.this; 3013 } 3014 3015 // Fade in the info with delay 3016 _self.objects.info.hide(); 3017 setTimeout(function () { 3018 _self.transition.fade(_self.objects.info, 'in', _self.settings.speedIn); 3019 }, _self.settings.speedIn); 3020 3021 // Call onFinish hook functions 3022 _self._callHooks(_self.settings.onFinish); 3023 }, 3024 3025 /** 3026 * Processes the content to show 3027 * 3028 * @return {void} 3029 */ 3030 _processContent: function () { 3031 _self.isBusy = true; 3032 3033 // Fade out the info at first 3034 _self.transition.fade(_self.objects.info, 'out', 0); 3035 3036 switch (_self.settings.transitionOut) { 3037 case 'scrollTop': 3038 case 'scrollRight': 3039 case 'scrollBottom': 3040 case 'scrollLeft': 3041 case 'scrollVertical': 3042 case 'scrollHorizontal': 3043 if (_self.objects.case.is(':hidden')) { 3044 _self.transition.fade(_self.objects.contentInner, 'out', 0); 3045 _self.transition.fade(_self.objects.case, 'out', 0, 0, function () { 3046 _self._loadContent(); 3047 }); 3048 } else { 3049 _self.transition.scroll(_self.objects.case, 'out', _self.settings.speedOut, function () { 3050 _self._loadContent(); 3051 }); 3052 } 3053 break; 3054 case 'fade': 3055 if (_self.objects.case.is(':hidden')) { 3056 _self.transition.fade(_self.objects.case, 'out', 0, 0, function () { 3057 _self._loadContent(); 3058 }); 3059 } else { 3060 _self.transition.fade(_self.objects.case, 'out', _self.settings.speedOut, 0, function () { 3061 _self._loadContent(); 3062 }); 3063 } 3064 break; 3065 case 'fadeInline': 3066 case 'elastic': 3067 if (_self.objects.case.is(':hidden')) { 3068 _self.transition.fade(_self.objects.case, 'out', 0, 0, function () { 3069 _self._loadContent(); 3070 }); 3071 } else { 3072 _self.transition.fade(_self.objects.contentInner, 'out', _self.settings.speedOut, 0, function () { 3073 _self._loadContent(); 3074 }); 3075 } 3076 break; 3077 default: 3078 _self.transition.fade(_self.objects.case, 'out', 0, 0, function () { 3079 _self._loadContent(); 3080 }); 3081 break; 3082 } 3083 }, 3084 3085 /** 3086 * Handles events for gallery buttons 3087 * 3088 * @return {void} 3089 */ 3090 _handleEvents: function () { 3091 _self._unbindEvents(); 3092 3093 _self.objects.nav.children().not(_self.objects.close).hide(); 3094 3095 // If slideshow is enabled, show play/pause and start timeout. 3096 if (_self.isSlideshowEnabled()) { 3097 // Only start the timeout if slideshow autostart is enabled and slideshow is not pausing 3098 if ( 3099 (_self.settings.slideshowAutoStart === true || _self.isSlideshowStarted) && 3100 !_self.objects.nav.hasClass(_self.settings.classPrefix + 'paused') 3101 ) { 3102 _self._startTimeout(); 3103 } else { 3104 _self._stopTimeout(); 3105 } 3106 } 3107 3108 if (_self.settings.liveResize) { 3109 _self._watchResizeInteraction(); 3110 } 3111 3112 _self.objects.close.click(function (event) { 3113 event.preventDefault(); 3114 _self.close(); 3115 }); 3116 3117 if (_self.settings.closeOnOverlayClick === true) { 3118 _self.objects.overlay.css('cursor', 'pointer').click(function (event) { 3119 event.preventDefault(); 3120 3121 _self.close(); 3122 }); 3123 } 3124 3125 if (_self.settings.useKeys === true) { 3126 _self._addKeyEvents(); 3127 } 3128 3129 if (_self.objectData.isPartOfSequence) { 3130 _self.objects.nav.attr(_self._prefixAttributeName('ispartofsequence'), true); 3131 _self.objects.nav.data('items', _self._setNavigation()); 3132 3133 _self.objects.prev.click(function (event) { 3134 event.preventDefault(); 3135 3136 if (_self.settings.navigateEndless === true || !_self.item.isFirst()) { 3137 _self.objects.prev.unbind('click'); 3138 _self.cache.action = 'prev'; 3139 _self.objects.nav.data('items').prev.click(); 3140 3141 if (_self.isSlideshowEnabled()) { 3142 _self._stopTimeout(); 3143 } 3144 } 3145 }); 3146 3147 _self.objects.next.click(function (event) { 3148 event.preventDefault(); 3149 3150 if (_self.settings.navigateEndless === true || !_self.item.isLast()) { 3151 _self.objects.next.unbind('click'); 3152 _self.cache.action = 'next'; 3153 _self.objects.nav.data('items').next.click(); 3154 3155 if (_self.isSlideshowEnabled()) { 3156 _self._stopTimeout(); 3157 } 3158 } 3159 }); 3160 3161 if (_self.isSlideshowEnabled()) { 3162 _self.objects.play.click(function (event) { 3163 event.preventDefault(); 3164 _self._startTimeout(); 3165 }); 3166 _self.objects.pause.click(function (event) { 3167 event.preventDefault(); 3168 _self._stopTimeout(); 3169 }); 3170 } 3171 3172 // Enable swiping if activated 3173 if (_self.settings.swipe === true) { 3174 if ($.isPlainObject($.event.special.swipeleft)) { 3175 _self.objects.case.on('swipeleft', function (event) { 3176 event.preventDefault(); 3177 _self.objects.next.click(); 3178 if (_self.isSlideshowEnabled()) { 3179 _self._stopTimeout(); 3180 } 3181 }); 3182 } 3183 if ($.isPlainObject($.event.special.swiperight)) { 3184 _self.objects.case.on('swiperight', function (event) { 3185 event.preventDefault(); 3186 _self.objects.prev.click(); 3187 if (_self.isSlideshowEnabled()) { 3188 _self._stopTimeout(); 3189 } 3190 }); 3191 } 3192 } 3193 } 3194 }, 3195 3196 /** 3197 * Adds the key events 3198 * 3199 * @return {void} 3200 */ 3201 _addKeyEvents: function () { 3202 $(document).bind('keyup.lightcase', function (event) {
3203 // Do nothing if lightcase is in process 3204 if (_self.isBusy) { 3205 return; 3206 } 3207 3208 switch (event.keyCode) { 3209 // Escape key 3210 case 27: 3211 _self.objects.close.click(); 3212 break; 3213 // Backward key 3214 case 37: 3215 if (_self.objectData.isPartOfSequence) { 3216 _self.objects.prev.click(); 3217 } 3218 break; 3219 // Forward key 3220 case 39: 3221 if (_self.objectData.isPartOfSequence) { 3222 _self.objects.next.click(); 3223 } 3224 break; 3225 } 3226 }); 3227 }, 3228 3229 /** 3230 * Starts the slideshow timeout 3231 * 3232 * @return {void} 3233 */ 3234 _startTimeout: function () { 3235 _self.isSlideshowStarted = true; 3236 3237 _self.objects.play.hide(); 3238 _self.objects.pause.show(); 3239 3240 _self.cache.action = 'next'; 3241 _self.objects.nav.removeClass(_self.settings.classPrefix + 'paused'); 3242 3243 _self.timeout = setTimeout(function () { 3244 _self.objects.nav.data('items').next.click(); 3245 }, _self.settings.timeout); 3246 }, 3247 3248 /** 3249 * Stops the slideshow timeout 3250 * 3251 * @return {void} 3252 */ 3253 _stopTimeout: function () { 3254 _self.objects.play.show(); 3255 _self.objects.pause.hide(); 3256 3257 _self.objects.nav.addClass(_self.settings.classPrefix + 'paused'); 3258 3259 clearTimeout(_self.timeout); 3260 }, 3261 3262 /** 3263 * Sets the navigator buttons (prev/next) 3264 * 3265 * @return {object} items 3266 */ 3267 _setNavigation: function () { 3268 var $links = $((_self.cache.selector || _self.settings.attr)), 3269 sequenceLength = _self.objectData.sequenceLength - 1, 3270 items = { 3271 prev: $links.eq(_self.objectData.prevIndex), 3272 next: $links.eq(_self.objectData.nextIndex) 3273 }; 3274 3275 if (_self.objectData.currentIndex > 0) { 3276 _self.objects.prev.show(); 3277 } else { 3278 items.prevItem = $links.eq(sequenceLength); 3279 } 3280 if (_self.objectData.nextIndex <= sequenceLength) { 3281 _self.objects.next.show(); 3282 } else { 3283 items.next = $links.eq(0); 3284 } 3285 3286 if (_self.settings.navigateEndless === true) { 3287 _self.objects.prev.show(); 3288 _self.objects.next.show(); 3289 } 3290 3291 return items; 3292 }, 3293 3294 /** 3295 * Item information/status 3296 * 3297 */ 3298 item: { 3299 /** 3300 * Verifies if the current item is first item. 3301 * 3302 * @return {boolean} 3303 */ 3304 isFirst: function () { 3305 return (_self.objectData.currentIndex === 0); 3306 }, 3307 3308 /** 3309 * Verifies if the current item is first item opened. 3310 * 3311 * @return {boolean} 3312 */ 3313 isFirstOpened: function () { 3314 return _self.objectData.this.is(_self.cache.firstOpened); 3315 }, 3316 3317 /** 3318 * Verifies if the current item is last item. 3319 * 3320 * @return {boolean} 3321 */ 3322 isLast: function () { 3323 return (_self.objectData.currentIndex === (_self.objectData.sequenceLength - 1)); 3324 } 3325 }, 3326 3327 /** 3328 * Clones the object for inline elements 3329 * 3330 * @param {object} $object 3331 * @return {object} $clone 3332 */ 3333 _cloneObject: function ($object) { 3334 var $clone = $object.clone(), 3335 objectId = $object.attr('id'); 3336 3337 // If element is hidden, cache the object and remove 3338 if ($object.is(':hidden')) { 3339 _self._cacheObjectData($object); 3340 $object.attr('id', _self.settings.idPrefix + 'temp-' + objectId).empty(); 3341 } else { 3342 // Prevent duplicated id's 3343 $clone.removeAttr('id'); 3344 } 3345 3346 return $clone.show(); 3347 }, 3348 3349 /** 3350 * Verifies if it is a mobile device 3351 * 3352 * @return {boolean} 3353 */ 3354 isMobileDevice: function () { 3355 var deviceAgent = navigator.userAgent.toLowerCase(), 3356 agentId = deviceAgent.match(_self.settings.mobileMatchExpression); 3357 3358 return agentId ? true : false; 3359 }, 3360 3361 /** 3362 * Verifies if css transitions are supported 3363 * 3364 * @return {string|boolean} The transition prefix if supported, else false. 3365 */ 3366 isTransitionSupported: function () { 3367 var body = _self.objects.body.get(0), 3368 isTransitionSupported = false, 3369 transitionMapping = { 3370 'transition': '', 3371 'WebkitTransition': '-webkit-', 3372 'MozTransition': '-moz-', 3373 'OTransition': '-o-', 3374 'MsTransition': '-ms-' 3375 }; 3376 3377 for (var key in transitionMapping) { 3378 if (transitionMapping.hasOwnProperty(key) && key in body.style) { 3379 _self.support.transition = transitionMapping[key]; 3380 isTransitionSupported = true; 3381 } 3382 } 3383 3384 return isTransitionSupported; 3385 }, 3386 3387 /** 3388 * Transition types 3389 * 3390 */ 3391 transition: { 3392 /** 3393 * Returns the correct transition type according to the status of interaction. 3394 * 3395 * @return {string} Transition type 3396 */ 3397 in: function () { 3398 if (_self.settings.transitionOpen && !_self.cache.firstOpened) { 3399 return _self.settings.transitionOpen; 3400 } 3401 return _self.settings.transitionIn; 3402 }, 3403 3404 /** 3405 * Fades in/out the object 3406 * 3407 * @param {object} $object 3408 * @param {string} type 3409 * @param {number} speed 3410 * @param {number} opacity 3411 * @param {function} callback 3412 * @return {void} Animates an object 3413 */ 3414 fade: function ($object, type, speed, opacity, callback) { 3415 var isInTransition = type === 'in', 3416 startTransition = {}, 3417 startOpacity = $object.css('opacity'), 3418 endTransition = {}, 3419 endOpacity = opacity ? opacity: isInTransition ? 1 : 0; 3420 3421 if (!_self.isOpen && isInTransition) return; 3422 3423 startTransition['opacity'] = startOpacity; 3424 endTransition['opacity'] = endOpacity; 3425 3426 $object.css(_self.support.transition + 'transition', 'none'); 3427 $object.css(startTransition).show(); 3428 3429 // Css transition 3430 if (_self.support.transitions) { 3431 endTransition[_self.support.transition + 'transition'] = speed + 'ms ease'; 3432 3433 setTimeout(function () { 3434 $object.css(endTransition); 3435 3436 setTimeout(function () { 3437 $object.css(_self.support.transition + 'transition', ''); 3438 3439 if (callback && (_self.isOpen || !isInTransition)) { 3440 callback(); 3441 } 3442 }, speed); 3443 }, 15); 3444 } else { 3445 // Fallback to js transition 3446 $object.stop(); 3447 $object.animate(endTransition, speed, callback); 3448 } 3449 }, 3450 3451 /** 3452 * Scrolls in/out the object 3453 * 3454 * @param {object} $object 3455 * @param {string} type 3456 * @param {number} speed 3457 * @param {function} callback 3458 * @return {void} Animates an object 3459 */ 3460 scroll: function ($object, type, speed, callback) { 3461 var isInTransition = type === 'in', 3462 transition = isInTransition ? _self.settings.transitionIn : _self.settings.transitionOut, 3463 direction = 'left', 3464 startTransition = {}, 3465 startOpacity = isInTransition ? 0 : 1, 3466 startOffset = isInTransition ? '-50%' : '50%', 3467 endTransition = {}, 3468 endOpacity = isInTransition ? 1 : 0, 3469 endOffset = isInTransition ? '50%' : '-50%'; 3470 3471 if (!_self.isOpen && isInTransition) return; 3472 3473 switch (transition) { 3474 case 'scrollTop': 3475 direction = 'top'; 3476 break; 3477 case 'scrollRight': 3478 startOffset = isInTransition ? '150%' : '50%'; 3479 endOffset = isInTransition ? '50%' : '150%'; 3480 break; 3481 case 'scrollBottom': 3482 direction = 'top'; 3483 startOffset = isInTransition ? '150%' : '50%'; 3484 endOffset = isInTransition ? '50%' : '150%'; 3485 break; 3486 case 'scrollHorizontal': 3487 startOffset = isInTransition ? '150%' : '50%'; 3488 endOffset = isInTransition ? '50%' : '-50%'; 3489 break; 3490 case 'scrollVertical': 3491 direction = 'top'; 3492 startOffset = isInTransition ? '-50%' : '50%'; 3493 endOffset = isInTransition ? '50%' : '150%'; 3494 break; 3495 } 3496 3497 if (_self.cache.action === 'prev') { 3498 switch (transition) { 3499 case 'scrollHorizontal': 3500 startOffset = isInTransition ? '-50%' : '50%'; 3501 endOffset = isInTransition ? '50%' : '150%'; 3502 break; 3503 case 'scrollVertical': 3504 startOffset = isInTransition ? '150%' : '50%'; 3505 endOffset = isInTransition ? '50%' : '-50%'; 3506 break; 3507 } 3508 } 3509 3510 startTransition['opacity'] = startOpacity; 3511 startTransition[direction] = startOffset; 3512 3513 endTransition['opacity'] = endOpacity; 3514 endTransition[direction] = endOffset; 3515 3516 $object.css(_self.support.transition + 'transition', 'none'); 3517 $object.css(startTransition).show(); 3518 3519 // Css transition 3520 if (_self.support.transitions) { 3521 endTransition[_self.support.transition + 'transition'] = speed + 'ms ease'; 3522 3523 setTimeout(function () { 3524 $object.css(endTransition); 3525 3526 setTimeout(function () { 3527 $object.css(_self.support.transition + 'transition', ''); 3528 3529 if (callback && (_self.isOpen || !isInTransition)) { 3530 callback(); 3531 } 3532 }, speed); 3533 }, 15); 3534 } else { 3535 // Fallback to js transition 3536 $object.stop(); 3537 $object.animate(endTransition, speed, callback); 3538 } 3539 }, 3540 3541 /** 3542 * Zooms in/out the object 3543 * 3544 * @param {object} $object 3545 * @param {string} type 3546 * @param {number} speed 3547 * @param {function} callback 3548 * @return {void} Animates an object 3549 */ 3550 zoom: function ($object, type, speed, callback) { 3551 var isInTransition = type === 'in', 3552 startTransition = {}, 3553 startOpacity = $object.css('opacity'), 3554 startScale = isInTransition ? 'scale(0.75)' : 'scale(1)', 3555 endTransition = {}, 3556 endOpacity = isInTransition ? 1 : 0, 3557 endScale = isInTransition ? 'scale(1)' : 'scale(0.75)'; 3558 3559 if (!_self.isOpen && isInTransition) return; 3560 3561 startTransition['opacity'] = startOpacity; 3562 startTransition[_self.support.transition + 'transform'] = startScale; 3563 3564 endTransition['opacity'] = endOpacity; 3565 3566 $object.css(_self.support.transition + 'transition', 'none'); 3567 $object.css(startTransition).show(); 3568 3569 // Css transition 3570 if (_self.support.transitions) { 3571 endTransition[_self.support.transition + 'transform'] = endScale; 3572 endTransition[_self.support.transition + 'transition'] = speed + 'ms ease'; 3573 3574 setTimeout(function () { 3575 $object.css(endTransition); 3576 3577 setTimeout(function () { 3578 $object.css(_self.support.transition + 'transform', ''); 3579 $object.css(_self.support.transition + 'transition', ''); 3580 3581 if (callback && (_self.isOpen || !isInTransition)) { 3582 callback(); 3583 } 3584 }, speed); 3585 }, 15); 3586 } else { 3587 // Fallback to js transition 3588 $object.stop(); 3589 $object.animate(endTransition, speed, callback); 3590 } 3591 } 3592 }, 3593 3594 /** 3595 * Calls all the registered functions of a specific hook 3596 * 3597 * @param {object} hooks 3598 * @return {void} 3599 */ 3600 _callHooks: function (hooks) { 3601 if (typeof(hooks) === 'object') { 3602 $.each(hooks, function(index, hook) { 3603 if (typeof(hook) === 'function') { 3604 hook.call(_self.origin); 3605 } 3606 }); 3607 } 3608 }, 3609 3610 /** 3611 * Caches the object data 3612 * 3613 * @param {object} $object 3614 * @return {void} 3615 */ 3616 _cacheObjectData: function ($object) { 3617 $.data($object, 'cache', { 3618 id: $object.attr('id'), 3619 content: $object.html() 3620 }); 3621 3622 _self.cache.originalObject = $object; 3623 }, 3624 3625 /** 3626 * Restores the object from cache 3627 * 3628 * @return void 3629 */ 3630 _restoreObject: function () { 3631 var $object = $('[id^="' + _self.settings.idPrefix + 'temp-"]'); 3632 3633 $object.attr('id', $.data(_self.cache.originalObject, 'cache').id); 3634 $object.html($.data(_self.cache.originalObject, 'cache').content); 3635 }, 3636 3637 /** 3638 * Executes functions for a window resize. 3639 * It stops an eventual timeout and recalculates dimensions. 3640 * 3641 * @param {object} dimensions 3642 * @return {void} 3643 */ 3644 resize: function (event, dimensions) { 3645 if (!_self.isOpen) return; 3646 3647 if (_self.isSlideshowEnabled()) { 3648 _self._stopTimeout(); 3649 } 3650 3651 if (typeof dimensions === 'object' && dimensions !== null) { 3652 if (dimensions.width) { 3653 _self.cache.object.attr( 3654 _self._prefixAttributeName('width'), 3655 dimensions.width 3656 ); 3657 } 3658 if (dimensions.maxWidth) { 3659 _self.cache.object.attr( 3660 _self._prefixAttributeName('max-width'), 3661 dimensions.maxWidth 3662 ); 3663 } 3664 if (dimensions.height) { 3665 _self.cache.object.attr( 3666 _self._prefixAttributeName('height'), 3667 dimensions.height 3668 ); 3669 } 3670 if (dimensions.maxHeight) { 3671 _self.cache.object.attr( 3672 _self._prefixAttributeName('max-height'), 3673 dimensions.maxHeight 3674 ); 3675 } 3676 } 3677 3678 _self.dimensions = _self.getViewportDimensions(); 3679 _self._calculateDimensions(_self.cache.object); 3680 3681 // Call onResize hook functions 3682 _self._callHooks(_self.settings.onResize); 3683 }, 3684 3685 /** 3686 * Watches for any resize interaction and caches the new sizes. 3687 * 3688 * @return {void} 3689 */ 3690 _watchResizeInteraction: function () { 3691 $(window).resize(_self.resize); 3692 }, 3693 3694 /** 3695 * Stop watching any resize interaction related to _self. 3696 * 3697 * @return {void} 3698 */ 3699 _unwatchResizeInteraction: function () { 3700 $(window).off('resize', _self.resize); 3701 }, 3702 3703 /** 3704 * Switches to the fullscreen mode 3705 * 3706 * @return {void} 3707 */ 3708 _switchToFullScreenMode: function () { 3709 _self.settings.shrinkFactor = 1; 3710 _self.settings.overlayOpacity = 1; 3711 3712 $('html').addClass(_self.settings.classPrefix + 'fullScreenMode'); 3713 }, 3714 3715 /** 3716 * Enters into the lightcase view 3717 * 3718 * @return {void} 3719 */ 3720 _open: function () { 3721 _self.isOpen = true; 3722 3723 _self.support.transitions = _self.settings.cssTransitions ? _self.isTransitionSupported() : false;
3724 _self.support.mobileDevice = _self.isMobileDevice(); 3725 3726 if (_self.support.mobileDevice) { 3727 $('html').addClass(_self.settings.classPrefix + 'isMobileDevice'); 3728 3729 if (_self.settings.fullScreenModeForMobile) { 3730 _self._switchToFullScreenMode(); 3731 } 3732 } 3733 3734 if (!_self.settings.transitionIn) { 3735 _self.settings.transitionIn = _self.settings.transition; 3736 } 3737 if (!_self.settings.transitionOut) { 3738 _self.settings.transitionOut = _self.settings.transition; 3739 } 3740 3741 switch (_self.transition.in()) { 3742 case 'fade': 3743 case 'fadeInline': 3744 case 'elastic': 3745 case 'scrollTop': 3746 case 'scrollRight': 3747 case 'scrollBottom': 3748 case 'scrollLeft': 3749 case 'scrollVertical': 3750 case 'scrollHorizontal': 3751 if (_self.objects.case.is(':hidden')) { 3752 _self.objects.close.css('opacity', 0); 3753 _self.objects.overlay.css('opacity', 0); 3754 _self.objects.case.css('opacity', 0); 3755 _self.objects.contentInner.css('opacity', 0); 3756 } 3757 _self.transition.fade(_self.objects.overlay, 'in', _self.settings.speedIn, _self.settings.overlayOpacity, function () { 3758 _self.transition.fade(_self.objects.close, 'in', _self.settings.speedIn); 3759 _self._handleEvents(); 3760 _self._processContent(); 3761 }); 3762 break; 3763 default: 3764 _self.transition.fade(_self.objects.overlay, 'in', 0, _self.settings.overlayOpacity, function () { 3765 _self.transition.fade(_self.objects.close, 'in', 0); 3766 _self._handleEvents(); 3767 _self._processContent(); 3768 }); 3769 break; 3770 } 3771 3772 _self.objects.document.addClass(_self.settings.classPrefix + 'open'); 3773 _self.objects.case.attr('aria-hidden', 'false'); 3774 }, 3775 3776 /** 3777 * Shows the lightcase by starting the transition 3778 */ 3779 show: function () { 3780 // Call onCalculateDimensions hook functions 3781 _self._callHooks(_self.settings.onBeforeCalculateDimensions); 3782 3783 _self._calculateDimensions(_self.cache.object); 3784 3785 // Call onAfterCalculateDimensions hook functions 3786 _self._callHooks(_self.settings.onAfterCalculateDimensions); 3787 3788 _self._startInTransition(); 3789 }, 3790 3791 /** 3792 * Escapes from the lightcase view 3793 * 3794 * @return {void} 3795 */ 3796 close: function () { 3797 _self.isOpen = false; 3798 3799 if (_self.isSlideshowEnabled()) { 3800 _self._stopTimeout(); 3801 _self.isSlideshowStarted = false; 3802 _self.objects.nav.removeClass(_self.settings.classPrefix + 'paused'); 3803 } 3804 3805 _self.objects.loading.hide(); 3806 3807 _self._unbindEvents(); 3808 3809 _self._unwatchResizeInteraction(); 3810 3811 $('html').removeClass(_self.settings.classPrefix + 'open'); 3812 _self.objects.case.attr('aria-hidden', 'true'); 3813 3814 _self.objects.nav.children().hide(); 3815 _self.objects.close.hide(); 3816 3817 // Call onClose hook functions 3818 _self._callHooks(_self.settings.onClose); 3819 3820 // Fade out the info at first 3821 _self.transition.fade(_self.objects.info, 'out', 0); 3822 3823 switch (_self.settings.transitionClose || _self.settings.transitionOut) { 3824 case 'fade': 3825 case 'fadeInline': 3826 case 'scrollTop': 3827 case 'scrollRight': 3828 case 'scrollBottom': 3829 case 'scrollLeft': 3830 case 'scrollHorizontal': 3831 case 'scrollVertical': 3832 _self.transition.fade(_self.objects.case, 'out', _self.settings.speedOut, 0, function () { 3833 _self.transition.fade(_self.objects.overlay, 'out', _self.settings.speedOut, 0, function () { 3834 _self.cleanup(); 3835 }); 3836 }); 3837 break; 3838 case 'elastic': 3839 _self.transition.zoom(_self.objects.case, 'out', _self.settings.speedOut, function () { 3840 _self.transition.fade(_self.objects.overlay, 'out', _self.settings.speedOut, 0, function () { 3841 _self.cleanup(); 3842 }); 3843 }); 3844 break; 3845 default: 3846 _self.cleanup(); 3847 break; 3848 } 3849 }, 3850 3851 /** 3852 * Unbinds all given events 3853 * 3854 * @return {void} 3855 */ 3856 _unbindEvents: function () { 3857 // Unbind overlay event 3858 _self.objects.overlay.unbind('click'); 3859 3860 // Unbind key events 3861 $(document).unbind('keyup.lightcase'); 3862 3863 // Unbind swipe events 3864 _self.objects.case.unbind('swipeleft').unbind('swiperight'); 3865 3866 // Unbind navigator events 3867 _self.objects.prev.unbind('click'); 3868 _self.objects.next.unbind('click'); 3869 _self.objects.play.unbind('click'); 3870 _self.objects.pause.unbind('click'); 3871 3872 // Unbind close event 3873 _self.objects.close.unbind('click'); 3874 }, 3875 3876 /** 3877 * Cleans up the dimensions 3878 * 3879 * @return {void} 3880 */ 3881 _cleanupDimensions: function () { 3882 var opacity = _self.objects.contentInner.css('opacity'); 3883 3884 _self.objects.case.css({ 3885 'width': '', 3886 'height': '', 3887 'top': '', 3888 'left': '', 3889 'margin-top': '', 3890 'margin-left': '' 3891 }); 3892 3893 _self.objects.contentInner.removeAttr('style').css('opacity', opacity); 3894 _self.objects.contentInner.children().removeAttr('style'); 3895 }, 3896 3897 /** 3898 * Cleanup after aborting lightcase 3899 * 3900 * @return {void} 3901 */ 3902 cleanup: function () { 3903 _self._cleanupDimensions(); 3904 3905 _self.objects.loading.hide(); 3906 _self.objects.overlay.hide(); 3907 _self.objects.case.hide(); 3908 _self.objects.prev.hide(); 3909 _self.objects.next.hide(); 3910 _self.objects.play.hide(); 3911 _self.objects.pause.hide(); 3912 3913 _self.objects.document.removeAttr(_self._prefixAttributeName('type')); 3914 _self.objects.nav.removeAttr(_self._prefixAttributeName('ispartofsequence')); 3915 3916 _self.objects.contentInner.empty().hide(); 3917 _self.objects.info.children().empty(); 3918 3919 if (_self.cache.originalObject) { 3920 _self._restoreObject(); 3921 } 3922 3923 // Call onCleanup hook functions 3924 _self._callHooks(_self.settings.onCleanup); 3925 3926 // Restore cache 3927 _self.cache = {}; 3928 }, 3929 3930 /** 3931 * Returns the supported match media or undefined if the browser 3932 * doesn't support match media. 3933 * 3934 * @return {mixed} 3935 */ 3936 _matchMedia: function () { 3937 return window.matchMedia || window.msMatchMedia; 3938 }, 3939 3940 /** 3941 * Returns the devicePixelRatio if supported. Else, it simply returns 3942 * 1 as the default. 3943 * 3944 * @return {number} 3945 */ 3946 _devicePixelRatio: function () { 3947 return window.devicePixelRatio || 1; 3948 }, 3949 3950 /** 3951 * Checks if method is public 3952 * 3953 * @return {boolean} 3954 */ 3955 _isPublicMethod: function (method) { 3956 return (typeof _self[method] === 'function' && method.charAt(0) !== '_'); 3957 }, 3958 3959 /** 3960 * Exports all public methods to be accessible, callable 3961 * from global scope. 3962 * 3963 * @return {void} 3964 */ 3965 _export: function () { 3966 window.lightcase = {}; 3967 3968 $.each(_self, function (property) { 3969 if (_self._isPublicMethod(property)) { 3970 lightcase[property] = _self[property]; 3971 } 3972 }); 3973 } 3974 }; 3975 3976 _self._export(); 3977 3978 $.fn.lightcase = function (method) { 3979 // Method calling logic (only public methods are applied)
3980 if (_self._isPublicMethod(method)) { 3981 return _self[method].apply(this, Array.prototype.slice.call(arguments, 1)); 3982 } else if (typeof method === 'object' || !method) { 3983 return _self.init.apply(this, arguments); 3984 } else { 3985 $.error('Method ' + method + ' does not exist on jQuery.lightcase'); 3986 } 3987 }; 3988})(jQuery); 3989`},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,
3989i.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}();
3989var 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>"}
3989).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
3989=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}
3989,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
3989d=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
3989d/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;
3989null!=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="
3989customHtmlAnnotation"):((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
3989date(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;
3989n.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;
3989if(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
3989yPanSpeed=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;
3989var 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.
3989shininess();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
3989d=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);
3989return!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))}}
3989,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}
3989),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
3989ou 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}
3989),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");
3989if(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=
3989pdfflipLocation+"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); 3990`},6713:function(e){e.exports=`//override original pdf-flip setting 3991 3992var option_PDFF = { 3993 3994 /* BASIC SETTINGS */ 3995 openPage: 1, 3996 height: '100%', 3997 enableSound: false, 3998 downloadEnable: true, 3999 direction: 1, // LTR = 1, RTL = 2 4000 autoPlay: true, 4001 autoPlayStart: false, 4002 autoPlayDuration: 3000, 4003 autoEnableOutline: false, 4004 autoEnableThumbnail: false, 4005 4006 4007 /* TRANSLATE INTERFACE */ 4008 4009 text: { 4010 toggleSound: "Sound", 4011 toggleThumbnails: "Thumbnails", 4012 toggleOutline: "Contents", 4013 previousPage: "Previous Page", 4014 nextPage: "Next Page", 4015 toggleFullscreen: "Fullscreen", 4016 zoomIn: "Zoom In", 4017 zoomOut: "Zoom Out", 4018 downloadPDFFile: "Download PDF", 4019 gotoFirstPage: "First Page", 4020 gotoLastPage: "Last Page", 4021 play: "AutoPlay On", 4022 pause: "AutoPlay Off", 4023 share: "Share" 4024 }, 4025 4026 /* ADVANCED SETTINGS */ 4027 4028 hard: "none", 4029 overwritePDFOutline: true, 4030 duration: 1000, 4031 pageMode: null, //single = 1, double = 2, auto = null 4032 singlePageMode: null, // zoom = 1, booklet = 2, auto = null 4033 transparent: false, 4034 scrollWheel: true, 4035 zoomRatio: 1.5, 4036 maxTextureSize: 1600, 4037 backgroundImage: "/assets/flipbook/background.jpg", 4038 backgroundColor: "#fff", 4039 controlsPosition: 'bottom', //hidden= 'hide', top: 'top', bottom: 'bottom' 4040 allControls: "thumbnail,play,altPrev,pageNumber,altNext,zoomIn,zoomOut,fullScreen,download,sound", 4041 hideControls: "outline,startPage,endPage", 4042 4043}; 4044var pdfflipLocation = "/assets/flipbook/"; 4045 4046`},7088:function(e){e.exports=`
vendor: 19,461 bytes, lines 4046-4065
4046/*! 4047 * perfect-scrollbar v1.5.0 4048 * Copyright 2020 Hyunje Jun, MDBootstrap and Contributors 4049 * Licensed under MIT 4050 */(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 4051a.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 4052for(;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 4053if(!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 4054if(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 4055if(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 4056if(0>c&&d===b.contentHeight-b.containerHeight||0<c&&0===d)// set prevent for mobile Chrome refresh 4057return 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 4058return!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 4059if(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 4060if(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 4061// Recalculate rail margins 4062// Hide scrollbars not to affect scrollWidth and scrollHeight 4063this.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 4064this.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}); 4065//# sourceMappingURL=perfect-scrollbar.min.js.map
vendor: 18,856 bytes, lines 4066-4068
4066`},8615:function(e){e.exports=`/*! ScrollMagic v2.0.8 | (c) 2020 Jan Paepke (@janpaepke) | license & info: http://scrollmagic.io */ 4067!function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.ScrollMagic=t()}(this,function(){"use strict";function _(){}_.version="2.0.8","undefined"!=typeof window&&window.addEventListener("mousewheel",void 0);var P="data-scrollmagic-pin-spacer";_.Controller=function(e){function t(){var e,t,n;v&&u&&(e=R.type.Array(u)?u:f.slice(0),u=!1,t=d,0!=(n=(d=l.scrollPos())-t)&&(h=0<n?"FORWARD":i),h===i&&e.reverse(),e.forEach(function(e,t){e.update(!0)}))}function r(){n=R.rAF(t)}var n,o,i="REVERSE",s="PAUSED",a=z.defaults,l=this,c=R.extend({},a,e),f=[],u=!1,d=0,h=s,p=!0,g=0,v=!0,m=function(){0<c.refreshInterval&&(o=window.setTimeout(E,c.refreshInterval))},w=function(){return c.vertical?R.get.scrollTop(c.container):R.get.scrollLeft(c.container)},y=function(){return c.vertical?R.get.height(c.container):R.get.width(c.container)},S=this._setScrollPos=function(e){c.vertical?p?window.scrollTo(R.get.scrollLeft(),e):c.container.scrollTop=e:p?window.scrollTo(e,R.get.scrollTop()):c.container.scrollLeft=e},b=function(e){"resize"==e.type&&(g=y(),h=s),!0!==u&&(u=!0,r())},E=function(){if(!p&&g!=y()){var t;try{t=new Event("resize",{bubbles:!1,cancelable:!1})}catch(e){(t=document.createEvent("Event")).initEvent("resize",!1,!1)}c.container.dispatchEvent(t)}f.forEach(function(e,t){e.refresh()}),m()};this._options=c;function x(e){if(e.length<=1)return e;var t=e.slice(0);return t.sort(function(e,t){return e.scrollOffset()>t.scrollOffset()?1:-1}),t}return this.addScene=function(e){if(R.type.Array(e))e.forEach(function(e,t){l.addScene(e)});else if(e instanceof _.Scene)if(e.controller()!==l)e.addTo(l);else if(!~f.indexOf(e))for(var t in f.push(e),f=x(f),e.on("shift.controller_sort",function(){f=x(f)}),c.globalSceneOptions)e[t]&&e[t].call(e,c.globalSceneOptions[t]);return l},this.removeScene=function(e){var t;return R.type.Array(e)?e.forEach(function(e,t){l.removeScene(e)}):-1<(t=f.indexOf(e))&&(e.off("shift.controller_sort"),f.splice(t,1),e.remove()),l},this.updateScene=function(e,n){return R.type.Array(e)?e.forEach(function(e,t){l.updateScene(e,n)}):n?e.update(!0):!0!==u&&e instanceof _.Scene&&(~(u=u||[]).indexOf(e)||u.push(e),u=x(u),r()),l},this.update=function(e){return b({type:"resize"}),e&&t(),l},this.scrollTo=function(e,t){if(R.type.Number(e))S.call(c.container,e,t);else if(e instanceof _.Scene)e.controller()===l&&l.scrollTo(e.scrollOffset(),t);else if(R.type.Function(e))S=e;else{var n=R.get.elements(e)[0];if(n){for(;n.parentNode.hasAttribute(P);)n=n.parentNode;var r=c.vertical?"top":"left",o=R.get.offset(c.container),i=R.get.offset(n);p||(o[r]-=l.scrollPos()),l.scrollTo(i[r]-o[r],t)}}return l},this.scrollPos=function(e){return arguments.length?(R.type.Function(e)&&(w=e),l):w.call(l)},this.info=function(e){var t={size:g,vertical:c.vertical,scrollPos:d,scrollDirection:h,container:c.container,isDocument:p};return arguments.length?void 0!==t[e]?t[e]:void 0:t},this.loglevel=function(e){return l},this.enabled=function(e){return arguments.length?(v!=e&&(v=!!e,l.updateScene(f,!0)),l):v},this.destroy=function(e){window.clearTimeout(o);for(var t=f.length;t--;)f[t].destroy(e);return c.container.removeEventListener("resize",b),c.container.removeEventListener("scroll",b),R.cAF(n),null},function(){for(var e in c)a.hasOwnProperty(e)||delete c[e];if(c.container=R.get.elements(c.container)[0],!c.container)throw"ScrollMagic.Controller init failed.";(p=c.container===window||c.container===document.body||!document.body.contains(c.container))&&(c.container=window),g=y(),c.container.addEventListener("resize",b),c.container.addEventListener("scroll",b);var t=parseInt(c.refreshInterval,10);c.refreshInterval=R.type.Number(t)?t:a.refreshInterval,m()}(),l};var z={defaults:{container:window,vertical:!0,globalSceneOptions:{},loglevel:2,refreshInterval:100}};_.Controller.addOption=function(e,t){z.defaults[e]=t},_.Controller.extend=function(e){var t=this;_.Controller=function(){return t.apply(this,arguments),this.$super=R.extend({},this),e.apply(this,arguments)||this},R.extend(_.Controller,t),_.Controller.prototype=t.prototype,_.Controller.prototype.constructor=_.Controller},_.Scene=function(e){var n,l,c="BEFORE",f="DURING",u="AFTER",r=D.defaults,d=this,h=R.extend({},r,e),p=c,g=0,a={start:0,end:0},v=0,o=!0,s={};this.on=function(e,o){return R.type.Function(o)&&(e=e.trim().split(" ")).forEach(function(e){var t=e.split("."),n=t[0],r=t[1];"*"!=n&&(s[n]||(s[n]=[]),s[n].push({namespace:r||"",callback:o}))}),d},this.off=function(e,i){return e&&(e=e.trim().split(" ")).forEach(function(e,t){var n=e.split("."),r=n[0],o=n[1]||"";("*"===r?Object.keys(s):[r]).forEach(function(e){for(var t=s[e]||[],n=t.length;n--;){var r=t[n];!r||o!==r.namespace&&"*"!==o||i&&i!=r.callback||t.splice(n,1)}t.length||delete s[e]})}),d},this.trigger=function(e,n){var t,r,o,i;return e&&(t=e.trim().split("."),r=t[0],o=t[1],(i=s[r])&&i.forEach(function(e,t){o&&o!==e.namespace||e.callback.call(d,new _.Event(r,e.namespace,d,n))})),d},d.on("change.internal",function(e){"loglevel"!==e.what&&"tweenChanges"!==e.what&&("triggerElement"===e.what?y():"reverse"===e.what&&d.update())}).on("shift.internal",function(e){t(),d.update()}),this.addTo=function(e){return e instanceof _.Controller&&l!=e&&(l&&l.removeScene(d),l=e,E(),i(!0),y(!0),t(),l.info("container").addEventListener("resize",S),e.addScene(d),d.trigger("add",{controller:l}),d.update()),d},this.enabled=function(e){return arguments.length?(o!=e&&(o=!!e,d.update(!0)),d):o},this.remove=function(){var e;return l&&(l.info("container").removeEventListener("resize",S),e=l,l=void 0,e.removeScene(d),d.trigger("remove")),d},this.destroy=function(e){return d.trigger("destroy",{reset:e}),d.remove(),d.off("*.*"),null},this.update=function(e){var t,n;return l&&(e?l.enabled()&&o?(t=l.info("scrollPos"),n=0<h.duration?(t-a.start)/(a.end-a.start):t>=a.start?1:0,d.trigger("update",{startPos:a.start,endPos:a.end,scrollPos:t}),d.progress(n)):m&&p===f&&T(!0):l.updateScene(d,!1)),d},this.refresh=function(){return i(),y(),d},this.progress=function(e){if(arguments.length){var t,n,r,o=!1,i=p,s=l?l.info("scrollDirection"):"PAUSED",a=h.reverse||g<=e;return 0===h.duration?(o=g!=e,p=0===(g=e<1&&a?0:1)?c:f):e<0&&p!==c&&a?(p=c,o=!(g=0)):0<=e&&e<1&&a?(g=e,p=f,o=!0):1<=e&&p!==u?(g=1,p=u,o=!0):p!==f||a||T(),o&&(t={progress:g,state:p,scrollDirection:s},r=function(e){d.trigger(e,t)},(n=p!=i)&&i!==f&&(r("enter"),r(i===c?"start":"end")),r("progress"),n&&p!==f&&(r(p===c?"start":"end"),r("leave"))),d}return g};var m,w,t=function(){a={start:v+h.offset},l&&h.triggerElement&&(a.start-=l.info("size")*h.triggerHook),a.end=a.start+h.duration},i=function(e){var t;!n||x(t="duration",n.call(d))&&!e&&(d.trigger("change",{what:t,newval:h[t]}),d.trigger("shift",{reason:t}))},y=function(e){var t=0,n=h.triggerElement;if(l&&(n||0<v)){if(n)if(n.parentNode){for(var r=l.info(),o=R.get.offset(r.container),i=r.vertical?"top":"left";n.parentNode.hasAttribute(P);)n=n.parentNode;var s=R.get.offset(n);r.isDocument||(o[i]-=l.scrollPos()),t=s[i]-o[i]}else d.triggerElement(void 0);var a=t!=v;v=t,a&&!e&&d.trigger("shift",{reason:"triggerElementPosition"})}},S=function(e){0<h.triggerHook&&d.trigger("shift",{reason:"containerResize"})},b=R.extend(D.validate,{duration:function(t){var e;if(R.type.String(t)&&t.match(/^(\\.|\\d)*\\d+%$/)&&(e=parseFloat(t)/100,t=function(){return l?l.info("size")*e:0}),R.type.Function(t)){n=t;try{t=parseFloat(n.call(d))}catch(e){t=-1}}if(t=parseFloat(t),!R.type.Number(t)||t<0)throw n=n&&void 0,0;return t}}),E=function(e){(e=arguments.length?[e]:Object.keys(b)).forEach(function(t,e){var n;if(b[t])try{n=b[t](h[t])}catch(e){n=r[t]}finally{h[t]=n}})},x=function(e,t){var n=!1,r=h[e];return h[e]!=t&&(h[e]=t,E(e),n=r!=h[e]),n},z=function(t){d[t]||(d[t]=function(e){return arguments.length?("duration"===t&&(n=void 0),x(t,e)&&(d.trigger("change",{what:t,newval:h[t]}),~D.shifts.indexOf(t)&&d.trigger("shift",{reason:t})),d):h[t]})};this.controller=function(){return l},this.state=function(){return p},this.scrollOffset=function(){return a.start},this.triggerPosition=function(){var e=h.offset;return l&&(h.triggerElement?e+=v:e+=l.info("size")*d.triggerHook()),e},d.on("shift.internal",function(e){var t="duration"===e.reason;(p===u&&t||p===f&&0===h.duration)&&T(),t&&A()}).on("progress.internal",function(e){T()}).on("add.internal",function(e){A()}).on("destroy.internal",function(e){d.removePin(e.reset)});function C(){l&&m&&p===f&&!l.info("isDocument")&&T()}function F(){l&&m&&p===f&&((w.relSize.width||w.relSize.autoFullWidth)&&R.get.width(window)!=R.get.width(w.spacer.parentNode)||w.relSize.height&&R.get.height(window)!=R.get.height(w.spacer.parentNode))&&A()}function L(e){l&&m&&p===f&&!l.info("isDocument")&&(e.preventDefault(),l._setScrollPos(l.info("scrollPos")-((e.wheelDelta||e[l.info("vertical")?"wheelDeltaY":"wheelDeltaX"])/3||30*-e.detail)))}var T=function(e){var t,n,r,o,i,s;m&&l&&(t=l.info(),n=w.spacer.firstChild,e||p!==f?(r={position:w.inFlow?"relative":"absolute",top:0,left:0},o=R.css(n,"position")!=r.position,w.pushFollowers?0<h.duration&&(p===u&&0===parseFloat(R.css(w.spacer,"padding-top"))||p===c&&0===parseFloat(R.css(w.spacer,"padding-bottom")))&&(o=!0):r[t.vertical?"top":"left"]=h.duration*g,R.css(n,r),o&&A()):("fixed"!=R.css(n,"position")&&(R.css(n,{position:"fixed"}),A()),i=R.get.offset(w.spacer,!0),s=h.reverse||0===h.duration?t.scrollPos-a.start:Math.round(g*h.duration*10)/10,i[t.vertical?"top":"left"]+=s,R.css(w.spacer.firstChild,{top:i.top,left:i.left})))},A=function(){var e,t,n,r,o;m&&l&&w.inFlow&&(e=p===f,t=l.info("vertical"),n=w.spacer.firstChild,r=R.isMarginCollapseType(R.css(w.spacer,"display")),o={},w.relSize.width||w.relSize.autoFullWidth?e?R.css(m,{width:R.get.width(w.spacer)}):R.css(m,{width:"100%"}):(o["min-width"]=R.get.width(t?m:n,!0,!0),o.width=e?o["min-width"]:"auto"),w.relSize.height?e?R.css(m,{height:R.get.height(w.spacer)-(w.pushFollowers?h.duration:0)}):R.css(m,{height:"100%"}):(o["min-height"]=R.get.height(t?n:m,!0,!r),o.height=e?o["min-height"]:"auto"),w.pushFollowers&&(o["padding"+(t?"Top":"Left")]=h.duration*g,o["padding"+(t?"Bottom":"Right")]=h.duration*(1-g)),R.css(w.spacer,o))};this.setPin=function(e,t){if(t=R.extend({},{pushFollowers:!0,spacerClass:"scrollmagic-pin-spacer"},t),!(e=R.get.elements(e)[0]))return d;if("fixed"===R.css(e,"position"))return d;if(m){if(m===e)return d;d.removePin()}var n=(m=e).parentNode.style.display,r=["top","left","bottom","right","margin","marginLeft","marginRight","marginTop","marginBottom"];m.parentNode.style.display="none";var o="absolute"!=R.css(m,"position"),i=R.css(m,r.concat(["display"])),s=R.css(m,["width","height"]);m.parentNode.style.display=n,!o&&t.pushFollowers&&(t.pushFollowers=!1);var a,l=m.parentNode.insertBefore(document.createElement("div"),m),c=R.extend(i,{position:o?"relative":"absolute",boxSizing:"content-box",mozBoxSizing:"content-box",webkitBoxSizing:"content-box"});return o||R.extend(c,R.css(m,["width","height"])),R.css(l,c),l.setAttribute(P,""),R.addClass(l,t.spacerClass),w={spacer:l,relSize:{width:"%"===s.width.slice(-1),height:"%"===s.height.slice(-1),autoFullWidth:"auto"===s.width&&o&&R.isMarginCollapseType(i.display)},pushFollowers:t.pushFollowers,inFlow:o},m.___origStyle||(m.___origStyle={},a=m.style,r.concat(["width","height","position","boxSizing","mozBoxSizing","webkitBoxSizing"]).forEach(function(e){m.___origStyle[e]=a[e]||""})),w.relSize.width&&R.css(l,{width:s.width}),w.relSize.height&&R.css(l,{height:s.height}),l.appendChild(m),R.css(m,{position:o?"relative":"absolute",margin:"auto",top:"auto",left:"auto",bottom:"auto",right:"auto"}),(w.relSize.width||w.relSize.autoFullWidth)&&R.css(m,{boxSizing:"border-box",mozBoxSizing:"border-box",webkitBoxSizing:"border-box"}),window.addEventListener("scroll",C),window.addEventListener("resize",C),window.addEventListener("resize",F),m.addEventListener("mousewheel",L),m.addEventListener("DOMMouseScroll",L),T(),d},this.removePin=function(e){var t,n,r;return m&&(p===f&&T(!0),!e&&l||((t=w.spacer.firstChild).hasAttribute(P)&&(n=w.spacer.style,r={},["margin","marginLeft","marginRight","marginTop","marginBottom"].forEach(function(e){r[e]=n[e]||""}),R.css(t,r)),w.spacer.parentNode.insertBefore(t,w.spacer),w.spacer.parentNode.removeChild(w.spacer),m.parentNode.hasAttribute(P)||(R.css(m,m.___origStyle),delete m.___origStyle)),window.removeEventListener("scroll",C),window.removeEventListener("resize",C),window.removeEventListener("resize",F),m.removeEventListener("mousewheel",L),m.removeEventListener("DOMMouseScroll",L),m=void 0),d};var N,O=[];return d.on("destroy.internal",function(e){d.removeClassToggle(e.reset)}),this.setClassToggle=function(e,t){var n=R.get.elements(e);return 0!==n.length&&R.type.String(t)&&(0<O.length&&d.removeClassToggle(),N=t,O=n,d.on("enter.internal_class leave.internal_class",function(e){var n="enter"===e.type?R.addClass:R.removeClass;O.forEach(function(e,t){n(e,N)})})),d},this.removeClassToggle=function(e){return e&&O.forEach(function(e,t){R.removeClass(e,N)}),d.off("start.internal_class end.internal_class"),N=void 0,O=[],d},function(){for(var e in h)r.hasOwnProperty(e)||delete h[e];for(var t in r)z(t);E()}(),d};var D={defaults:{duration:0,offset:0,triggerElement:void 0,triggerHook:.5,reverse:!0,loglevel:2},validate:{offset:function(e){if(e=parseFloat(e),!R.type.Number(e))throw 0;return e},triggerElement:function(e){if(e=e||void 0){var t=R.get.elements(e)[0];if(!t||!t.parentNode)throw 0;e=t}return e},triggerHook:function(e){var t={onCenter:.5,onEnter:1,onLeave:0};if(R.type.Number(e))e=Math.max(0,Math.min(parseFloat(e),1));else{if(!(e in t))throw 0;e=t[e]}return e},reverse:function(e){return!!e}},shifts:["duration","offset","triggerHook"]};_.Scene.addOption=function(e,t,n,r){e in D.defaults||(D.defaults[e]=t,D.validate[e]=n,r&&D.shifts.push(e))},_.Scene.extend=function(e){var t=this;_.Scene=function(){return t.apply(this,arguments),this.$super=R.extend({},this),e.apply(this,arguments)||this},R.extend(_.Scene,t),_.Scene.prototype=t.prototype,_.Scene.prototype.constructor=_.Scene},_.Event=function(e,t,n,r){for(var o in r=r||{})this[o]=r[o];return this.type=e,this.target=this.currentTarget=n,this.namespace=t||"",this.timeStamp=this.timestamp=Date.now(),this};var R=_._util=function(s){function a(e){return parseFloat(e)||0}function l(e){return e.currentStyle?e.currentStyle:s.getComputedStyle(e)}function r(e,t,n,r){if((t=t===document?s:t)===s)r=!1;else if(!u.DomElement(t))return 0;e=e[0].toUpperCase()+e.substr(1).toLowerCase();var o,i=(n?t["offset"+e]||t["outer"+e]:t["client"+e]||t["inner"+e])||0;return n&&r&&(o=l(t),i+="Height"===e?a(o.marginTop)+a(o.marginBottom):a(o.marginLeft)+a(o.marginRight)),i}function c(e){return e.replace(/^[^a-z]+([a-z])/g,"$1").replace(/-([a-z])/g,function(e){return e[1].toUpperCase()})}var e={};e.extend=function(e){for(e=e||{},f=1;f<arguments.length;f++)if(arguments[f])for(var t in arguments[f])arguments[f].hasOwnProperty(t)&&(e[t]=arguments[f][t]);return e},e.isMarginCollapseType=function(e){return!!~["block","flex","list-item","table","-webkit-box"].indexOf(e)};for(var o=0,t=["ms","moz","webkit","o"],n=s.requestAnimationFrame,i=s.cancelAnimationFrame,f=0;!n&&f<4;++f)n=s[t[f]+"RequestAnimationFrame"],i=s[t[f]+"CancelAnimationFrame"]||s[t[f]+"CancelRequestAnimationFrame"];n=n||function(e){var t=(new Date).getTime(),n=Math.max(0,16-(t-o)),r=s.setTimeout(function(){e(t+n)},n);return o=t+n,r},i=i||function(e){s.clearTimeout(e)},e.rAF=n.bind(s),e.cAF=i.bind(s);var u=e.type=function(e){return Object.prototype.toString.call(e).replace(/^\\[object (.+)\\]$/,"$1").toLowerCase()};u.String=function(e){return"string"===u(e)},u.Function=function(e){return"function"===u(e)},u.Array=function(e){return Array.isArray(e)},u.Number=function(e){return!u.Array(e)&&0<=e-parseFloat(e)+1},u.DomElement=function(e){return"object"==typeof HTMLElement||"function"==typeof HTMLElement?e instanceof HTMLElement||e instanceof SVGElement:e&&"object"==typeof e&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName};var d=e.get={};return d.elements=function(e){var t=[];if(u.String(e))try{e=document.querySelectorAll(e)}catch(e){return t}if("nodelist"===u(e)||u.Array(e)||e instanceof NodeList)for(var n=0,r=t.length=e.length;n<r;n++){var o=e[n];t[n]=u.DomElement(o)?o:d.elements(o)}else!u.DomElement(e)&&e!==document&&e!==s||(t=[e]);return t},d.scrollTop=function(e){return e&&"number"==typeof e.scrollTop?e.scrollTop:s.pageYOffset||0},d.scrollLeft=function(e){return e&&"number"==typeof e.scrollLeft?e.scrollLeft:s.pageXOffset||0},d.width=function(e,t,n){return r("width",e,t,n)},d.height=function(e,t,n){return r("height",e,t,n)},d.offset=function(e,t){var n,r={top:0,left:0};return e&&e.getBoundingClientRect&&(n=e.getBoundingClientRect(),r.top=n.top,r.left=n.left,t||(r.top+=d.scrollTop(),r.left+=d.scrollLeft())),r},e.addClass=function(e,t){t&&(e.classList?e.classList.add(t):e.className+=" "+t)},e.removeClass=function(e,t){t&&(e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp("(^|\\\\b)"+t.split(" ").join("|")+"(\\\\b|$)","gi")," "))},e.css=function(e,t){if(u.String(t))return l(e)[c(t)];if(u.Array(t)){var n={},r=l(e);return t.forEach(function(e,t){n[e]=r[c(e)]}),n}for(var o in t){var i=t[o];i==parseFloat(i)&&(i+="px"),e.style[c(o)]=i}},e}(window||{});return _});`},7419:function(e){e.exports=`/*! ScrollMagic v2.0.8 | (c) 2020 Jan Paepke (@janpaepke) | license & info: http://scrollmagic.io */ 4068!function(e,r){"function"==typeof define&&define.amd?define(["ScrollMagic"],r):"object"==typeof exports?r(require("scrollmagic")):r(e.ScrollMagic||e.jQuery&&e.jQuery.ScrollMagic)}(this,function(i){"use strict";var o="0.85em",n="9999",v=i._util,h=0;i.Scene.extend(function(){var t,i=this;i.addIndicators=function(e){var r;return t||(r={name:"",indent:0,parent:void 0,colorStart:"green",colorEnd:"red",colorTrigger:"blue"},e=v.extend({},r,e),h++,t=new s(i,e),i.on("add.plugin_addIndicators",t.add),i.on("remove.plugin_addIndicators",t.remove),i.on("destroy.plugin_addIndicators",i.removeIndicators),i.controller()&&t.add()),i},i.removeIndicators=function(){return t&&(t.remove(),this.off("*.plugin_addIndicators"),t=void 0),i}}),i.Controller.addOption("addIndicators",!1),i.Controller.extend(function(){var c=this,e=c.info(),l=e.container,f=e.isDocument,m=e.vertical,h={groups:[]};this._indicators=h;function r(){h.updateBoundsPositions()}function t(){h.updateTriggerGroupPositions()}return l.addEventListener("resize",t),f||(window.addEventListener("resize",t),window.addEventListener("scroll",t)),l.addEventListener("resize",r),l.addEventListener("scroll",r),this._indicators.updateBoundsPositions=function(e){for(var r,t,i,o=e?[v.extend({},e.triggerGroup,{members:[e]})]:h.groups,n=o.length,s={}
vendor: 7,171 bytes, lines 4068-4077
4068,d=m?"left":"top",a=m?"width":"height",g=m?v.get.scrollLeft(l)+v.get.width(l)-15:v.get.scrollTop(l)+v.get.height(l)-15;n--;)for(r=(i=o[n]).members.length,t=v.get[a](i.element.firstChild);r--;)s[d]=g-t,v.css(i.members[r].bounds,s)},this._indicators.updateTriggerGroupPositions=function(e){for(var r,t,i,o,n=e?[e]:h.groups,s=n.length,d=f?document.body:l,a=f?{top:0,left:0}:v.get.offset(d,!0),g=m?v.get.width(l)-15:v.get.height(l)-15,p=m?"width":"height",u=m?"Y":"X";s--;)t=(r=n[s]).element,i=r.triggerHook*c.info("size"),o=v.get[p](t.firstChild.firstChild)<i?"translate"+u+"(-100%)":"",v.css(t,{top:a.top+(m?i:g-r.members[0].options.indent),left:a.left+(m?g-r.members[0].options.indent:i)}),v.css(t.firstChild.firstChild,{"-ms-transform":o,"-webkit-transform":o,transform:o})},this._indicators.updateTriggerGroupLabel=function(e){var r="trigger"+(1<e.members.length?"":" "+e.members[0].options.name),t=e.element.firstChild.firstChild;t.textContent!==r&&(t.textContent=r,m&&h.updateBoundsPositions())},this.addScene=function(e){this._options.addIndicators&&e instanceof i.Scene&&e.controller()===c&&e.addIndicators(),this.$super.addScene.apply(this,arguments)},this.destroy=function(){l.removeEventListener("resize",t),f||(window.removeEventListener("resize",t),window.removeEventListener("scroll",t)),l.removeEventListener("resize",r),l.removeEventListener("scroll",r),this.$super.destroy.apply(this,arguments)},c});var s=function(o,n){var s,d,a=this,t=b.bounds(),i=b.start(n.colorStart),g=b.end(n.colorEnd),p=n.parent&&v.get.elements(n.parent)[0];n.name=n.name||h,i.firstChild.textContent+=" "+n.name,g.textContent+=" "+n.name,t.appendChild(i),t.appendChild(g),a.options=n,a.bounds=t,a.triggerGroup=void 0,this.add=function(){d=o.controller(),s=d.info("vertical");var e=d.info("isDocument");p=p||(e?document.body:d.info("container")),e||"static"!==v.css(p,"position")||v.css(p,{position:"relative"}),o.on("change.plugin_addIndicators",u),o.on("shift.plugin_addIndicators",r),m(),l(),setTimeout(function(){d._indicators.updateBoundsPositions(a)},0)},this.remove=function(){var e;a.triggerGroup&&(o.off("change.plugin_addIndicators",u),o.off("shift.plugin_addIndicators",r),1<a.triggerGroup.members.length?((e=a.triggerGroup).members.splice(e.members.indexOf(a),1),d._indicators.updateTriggerGroupLabel(e),d._indicators.updateTriggerGroupPositions(e),a.triggerGroup=void 0):f(),c())};var r=function(){l()},u=function(e){"triggerHook"===e.what&&m()},c=function(){t.parentNode.removeChild(t)},l=function(){var e;t.parentNode!==p&&(e=d.info("vertical"),v.css(i.firstChild,{"border-bottom-width":e?1:0,"border-right-width":e?0:1,bottom:e?-1:n.indent,right:e?n.indent:-1,padding:e?"0 8px":"2px 4px"}),v.css(g,{"border-top-width":e?1:0,"border-left-width":e?0:1,top:e?"100%":"",right:e?n.indent:"",bottom:e?"":n.indent,left:e?"":"100%",padding:e?"0 8px":"2px 4px"}),p.appendChild(t));var r={};r[s?"top":"left"]=o.triggerPosition(),r[s?"height":"width"]=o.duration(),v.css(t,r),v.css(g,{display:0<o.duration()?"":"none"})},f=function(){d._indicators.groups.splice(d._indicators.groups.indexOf(a.triggerGroup),1),a.triggerGroup.element.parentNode.removeChild(a.triggerGroup.element),a.triggerGroup=void 0},m=function(){var e=o.triggerHook();if(!(a.triggerGroup&&Math.abs(a.triggerGroup.triggerHook-e)<1e-4)){for(var r,t=d._indicators.groups,i=t.length;i--;)if(r=t[i],Math.abs(r.triggerHook-e)<1e-4)return a.triggerGroup&&(1===a.triggerGroup.members.length?f():(a.triggerGroup.members.splice(a.triggerGroup.members.indexOf(a),1),d._indicators.updateTriggerGroupLabel(a.triggerGroup),d._indicators.updateTriggerGroupPositions(a.triggerGroup))),r.members.push(a),a.triggerGroup=r,void d._indicators.updateTriggerGroupLabel(r);if(a.triggerGroup){if(1===a.triggerGroup.members.length)return a.triggerGroup.triggerHook=e,void d._indicators.updateTriggerGroupPositions(a.triggerGroup);a.triggerGroup.members.splice(a.triggerGroup.members.indexOf(a),1),d._indicators.updateTriggerGroupLabel(a.triggerGroup),d._indicators.updateTriggerGroupPositions(a.triggerGroup),a.triggerGroup=void 0}!function(){var e=b.trigger(n.colorTrigger),r={};r[s?"right":"bottom"]=0,r[s?"border-top-width":"border-left-width"]=1,v.css(e.firstChild,r),v.css(e.firstChild.firstChild,{padding:s?"0 8px 3px 8px":"3px 4px"}),document.body.appendChild(e);var t={triggerHook:o.triggerHook(),element:e,members:[a]};d._indicators.groups.push(t),a.triggerGroup=t,d._indicators.updateTriggerGroupLabel(t),d._indicators.updateTriggerGroupPositions(t)}()}}},b={start:function(e){var r=document.createElement("div");r.textContent="start",v.css(r,{position:"absolute",overflow:"visible","border-width":0,"border-style":"solid",color:e,"border-color":e});var t=document.createElement("div");return v.css(t,{position:"absolute",overflow:"visible",width:0,height:0}),t.appendChild(r),t},end:function(e){var r=document.createElement("div");return r.textContent="end",v.css(r,{position:"absolute",overflow:"visible","border-width":0,"border-style":"solid",color:e,"border-color":e}),r},bounds:function(){var e=document.createElement("div");return v.css(e,{position:"absolute",overflow:"visible","white-space":"nowrap","pointer-events":"none","font-size":o}),e.style.zIndex=n,e},trigger:function(e){var r=document.createElement("div");r.textContent="trigger",v.css(r,{position:"relative"});var t=document.createElement("div");v.css(t,{position:"absolute",overflow:"visible","border-width":0,"border-style":"solid",color:e,"border-color":e}),t.appendChild(r);var i=document.createElement("div");return v.css(i,{position:"fixed",overflow:"visible","white-space":"nowrap","pointer-events":"none","font-size":o}),i.style.zIndex=n,i.appendChild(t),i}}});`},1570:function(e){e.exports=`/** 4069 * Spotlight.js v0.6.3 (Bundle) 4070 * Copyright 2019 Nextapps GmbH 4071 * Author: Thomas Wilkerling 4072 * Licence: Apache-2.0 4073 * https://github.com/nextapps-de/spotlight 4074 */ 4075(function(){'use strict';var aa={};function ba(a){for(var b=a.classList,c={},d=0;d<b.length;d++)c[b[d]]=1;a.a=c;a.c=b}function f(a,b){a=g(a);var c="string"===typeof b;if(a.length)for(var d=0;d<a.length;d++)(c?ca:da)(a[d],b);else(c?ca:da)(a,b)}function da(a,b){for(var c=0;c<b.length;c++)ca(a,b[c])}function ca(a,b){a.a||ba(a);a.a[b]||(a.a[b]=1,a.c.add(b))}function h(a,b){a=g(a);var c="string"===typeof b;if(a.length)for(var d=0;d<a.length;d++)(c?ea:fa)(a[d],b);else(c?ea:fa)(a,b)} 4076function fa(a,b){for(var c=0;c<b.length;c++)ea(a,b[c])}function ea(a,b){a.a||ba(a);a.a[b]&&(a.a[b]=0,a.c.remove(b))}function l(a,b,c,d){a=g(a);var e="string"!==typeof b&&Object.keys(b);if(a.length)for(var k=0;k<a.length;k++)(e?ha:ia)(a[k],b,e||c,d);else(e?ha:ia)(a,b,e||c,d)}function ha(a,b,c,d){for(var e=0;e<c.length;e++){var k=c[e];ia(a,k,b[k],d)}} 4077function ia(a,b,c,d){var e=a.f;e||(a.f=e={});e[b]!==c&&(e[b]=c,(a.g||(a.g=a.style)).setProperty(aa[b]||(aa[b]=b.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()),c,d?"important":null))}var ja=0;function m(a,b,c){l(a,"transition","none");l(a,b,c);ja||(ja=a.clientTop&&0);l(a,"transition","")}function ka(a,b){b||(b="");a=g(a);if(a.length)for(var c=0;c<a.length;c++){var d=a[c],e=b;d.b!==e&&(d.b=e,d.textContent=e)}else a.b!==b&&(a.b=b,a.textContent=b)}
4078function g(a){return"string"===typeof a?document.querySelectorAll(a):a};function la(a,b,c,d){ma("add",a,b,c,d)}function na(a,b,c,d){ma("remove",a,b,c,d)}function ma(a,b,c,d,e){b[a+"EventListener"](c||"click",d,"undefined"===typeof e?!0:e)}function n(a,b){a||(a=window.event);a&&(b||a.preventDefault(),a.stopImmediatePropagation(),a.returnValue=!1);return!1};var oa=document.createElement("style");oa.innerHTML="@keyframes pulsate{0%,to{opacity:1}50%{opacity:.2}}#spotlight,#spotlight .preloader,#spotlight .scene{top:0;width:100%;height:100%}#spotlight .arrow,#spotlight .icon{cursor:pointer;background-repeat:no-repeat}#spotlight{position:fixed;z-index:99999;color:#fff;background-color:#000;visibility:hidden;opacity:0;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;transition:visibility .25s ease,opacity .25s ease;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;contain:layout size paint style;touch-action:none;-webkit-tap-highlight-color:transparent}#spotlight.show{opacity:1;visibility:visible;transition:none}#spotlight.show .pane,#spotlight.show .scene{will-change:transform}#spotlight.show .scene img{will-change:transform,opacity}#spotlight .preloader{position:absolute;background-position:center center;background-repeat:no-repeat;background-size:42px 42px;opacity:0}#spotlight .preloader.show{transition:opacity .1s linear .25s;opacity:1}#spotlight .scene{position:absolute;transition:transform 1s cubic-bezier(.1,1,.1,1);contain:layout size style;pointer-events:none}#spotlight .scene img{display:inline-block;position:absolute;width:auto;height:auto;max-width:100%;max-height:100%;left:50%;top:50%;opacity:1;margin:0;padding:0;border:0;transform:translate(-50%,-50%) scale(1) perspective(100vw);transition:transform 1s cubic-bezier(.1,1,.1,1),opacity 1s cubic-bezier(.3,1,.3,1);transform-style:preserve-3d;contain:layout paint style;visibility:hidden}#spotlight .header,#spotlight .pane{position:absolute;top:0;width:100%;height:100%;contain:layout size style}#spotlight .header{height:50px;text-align:right;background-color:rgba(0,0,0,.45);transform:translateY(-100px);transition:transform .35s ease-out;contain:layout size paint style}#spotlight .header:hover,#spotlight.menu .header{transform:translateY(0)}#spotlight .header div{display:inline-block;vertical-align:middle;white-space:nowrap;width:30px;height:50px;padding-right:20px;opacity:.5}#spotlight .progress{position:absolute;top:0;width:100%;height:3px;background-color:rgba(255,255,255,.45);transform:translateX(-100%);transition:transform 1s linear}#spotlight .arrow,#spotlight .footer{position:absolute;background-color:rgba(0,0,0,.45)}#spotlight .footer{bottom:0;line-height:1.35em;padding:20px 25px;text-align:left;pointer-events:none;contain:layout paint style}#spotlight .footer .title{font-size:125%;padding-bottom:10px}#spotlight .page{float:left;width:auto;padding-left:20px;line-height:50px}
4078#spotlight .icon{background-position:left center;background-size:21px 21px;transition:opacity .2s ease-out}#spotlight .fullscreen{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIj8+PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjI0IiBzdHJva2U9IiNmZmYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyLjUiIHZpZXdCb3g9Ii0xIC0xIDI2IDI2IiB3aWR0aD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTggM0g1YTIgMiAwIDAgMC0yIDJ2M20xOCAwVjVhMiAyIDAgMCAwLTItMmgtM20wIDE4aDNhMiAyIDAgMCAwIDItMnYtM00zIDE2djNhMiAyIDAgMCAwIDIgMmgzIi8+PC9zdmc+)}#spotlight .fullscreen.on{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIj8+PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjI0IiBzdHJva2U9IiNmZmYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyLjUiIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik04IDN2M2EyIDIgMCAwIDEtMiAySDNtMTggMGgtM2EyIDIgMCAwIDEtMi0yVjNtMCAxOHYtM2EyIDIgMCAwIDEgMi0yaDNNMyAxNmgzYTIgMiAwIDAgMSAyIDJ2MyIvPjwvc3ZnPg==)}#spotlight .autofit{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIj8+PHN2ZyBoZWlnaHQ9Ijk2cHgiIHZpZXdCb3g9IjAgMCA5NiA5NiIgd2lkdGg9Ijk2cHgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggdHJhbnNmb3JtPSJyb3RhdGUoOTAgNTAgNTApIiBmaWxsPSIjZmZmIiBkPSJNNzEuMzExLDgwQzY5LjY3LDg0LjY2LDY1LjIzLDg4LDYwLDg4SDIwYy02LjYzLDAtMTItNS4zNy0xMi0xMlYzNmMwLTUuMjMsMy4zNC05LjY3LDgtMTEuMzExVjc2YzAsMi4yMSwxLjc5LDQsNCw0SDcxLjMxMSAgeiIvPjxwYXRoIHRyYW5zZm9ybT0icm90YXRlKDkwIDUwIDUwKSIgZmlsbD0iI2ZmZiIgZD0iTTc2LDhIMzZjLTYuNjMsMC0xMiw1LjM3LTEyLDEydjQwYzAsNi42Myw1LjM3LDEyLDEyLDEyaDQwYzYuNjMsMCwxMi01LjM3LDEyLTEyVjIwQzg4LDEzLjM3LDgyLjYzLDgsNzYsOHogTTgwLDYwICBjMCwyLjIxLTEuNzksNC00LDRIMzZjLTIuMjEsMC00LTEuNzktNC00VjIwYzAtMi4yMSwxLjc5LTQsNC00aDQwYzIuMjEsMCw0LDEuNzksNCw0VjYweiIvPjwvc3ZnPg==)}#spotlight .zoom-out{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIj8+PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjI0IiBzdHJva2U9IiNmZmYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyIiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSIxMSIgY3k9IjExIiByPSI4Ii8+PGxpbmUgeDE9IjIxIiB4Mj0iMTYuNjUiIHkxPSIyMSIgeTI9IjE2LjY1Ii8+PGxpbmUgeDE9IjgiIHgyPSIxNCIgeTE9IjExIiB5Mj0iMTEiLz48L3N2Zz4=)}#spotlight .zoom-in{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIj8+PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjI0IiBzdHJva2U9IiNmZmYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyIiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSIxMSIgY3k9IjExIiByPSI4Ii8+PGxpbmUgeDE9IjIxIiB4Mj0iMTYuNjUiIHkxPSIyMSIgeTI9IjE2LjY1Ii8+PGxpbmUgeDE9IjExIiB4Mj0iMTEiIHkxPSI4IiB5Mj0iMTQiLz48bGluZSB4MT0iOCIgeDI9IjE0IiB5MT0iMTEiIHkyPSIxMSIvPjwvc3ZnPg==)}#spotlight .theme{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIj8+PHN2ZyBoZWlnaHQ9IjI0cHgiIHZlcnNpb249IjEuMiIgdmlld0JveD0iMiAyIDIwIDIwIiB3aWR0aD0iMjRweCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSIjZmZmIj48cGF0aCBkPSJNMTIsNGMtNC40MTgsMC04LDMuNTgyLTgsOHMzLjU4Miw4LDgsOHM4LTMuNTgyLDgtOFMxNi40MTgsNCwxMiw0eiBNMTIsMThjLTMuMzE0LDAtNi0yLjY4
4078Ni02LTZzMi42ODYtNiw2LTZzNiwyLjY4Niw2LDYgUzE1LjMxNCwxOCwxMiwxOHoiLz48cGF0aCBkPSJNMTIsN3YxMGMyLjc1NywwLDUtMi4yNDMsNS01UzE0Ljc1Nyw3LDEyLDd6Ii8+PC9nPjwvc3ZnPg==)}#spotlight .player{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIj8+PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjI0IiBzdHJva2U9IiNmZmYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyIiB2aWV3Qm94PSItMC41IC0wLjUgMjUgMjUiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIvPjxwb2x5Z29uIGZpbGw9IiNmZmYiIHBvaW50cz0iMTAgOCAxNiAxMiAxMCAxNiAxMCA4Ii8+PC9zdmc+)}#spotlight .player.on{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIj8+PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjI0IiBzdHJva2U9IiNmZmYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyIiB2aWV3Qm94PSItMC41IC0wLjUgMjUgMjUiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIvPjxsaW5lIHgxPSIxMCIgeDI9IjEwIiB5MT0iMTUiIHkyPSI5Ii8+PGxpbmUgeDE9IjE0IiB4Mj0iMTQiIHkxPSIxNSIgeTI9IjkiLz48L3N2Zz4=);animation:pulsate 1s ease infinite}#spotlight .close{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIj8+PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjI0IiBzdHJva2U9IiNmZmYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyIiB2aWV3Qm94PSIyIDIgMjAgMjAiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48bGluZSB4MT0iMTgiIHgyPSI2IiB5MT0iNiIgeTI9IjE4Ii8+PGxpbmUgeDE9IjYiIHgyPSIxOCIgeTE9IjYiIHkyPSIxOCIvPjwvc3ZnPg==)}#spotlight .preloader.show{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzgiIGhlaWdodD0iMzgiIHZpZXdCb3g9IjAgMCAzOCAzOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBzdHJva2U9IiNmZmYiPjxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMSAxKSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2Utb3BhY2l0eT0iLjY1Ij48Y2lyY2xlIHN0cm9rZS1vcGFjaXR5PSIuMTUiIGN4PSIxOCIgY3k9IjE4IiByPSIxOCIvPjxwYXRoIGQ9Ik0zNiAxOGMwLTkuOTQtOC4wNi0xOC0xOC0xOCI+PGFuaW1hdGVUcmFuc2Zvcm0gYXR0cmlidXRlTmFtZT0idHJhbnNmb3JtIiB0eXBlPSJyb3RhdGUiIGZyb209IjAgMTggMTgiIHRvPSIzNjAgMTggMTgiIGR1cj0iMXMiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIi8+PC9wYXRoPjwvZz48L2c+PC9zdmc+)}#spotlight .arrow{top:50%;left:20px;width:50px;height:50px;border-radius:100%;margin-top:-25px;padding:10px;transform:translateX(-100px);transition:transform .35s ease-out,opacity .2s ease-out;box-sizing:border-box;background-position:center center;background-size:30px 30px;opacity:.65;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIj8+PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjI0IiBzdHJva2U9IiNmZmYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyIiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cG9seWxpbmUgcG9pbnRzPSIxNSAxOCA5IDEyIDE1IDYiLz48L3N2Zz4=)}#spotlight .arrow-right{left:auto;right:20px;transform:translateX(100px) scaleX(-1)}#spotlight.menu .arrow-left{transform:translateX(0)}#spotlight.menu .arrow-right{transform:translateX(0) scaleX(-1)}#spotlight .arrow:active,#spotlight .arrow:hover,#spotlight .icon:active,#spotlight .icon:hover{opacity:1;animation:none}#spotlight.white{color:#fff;background-color:#fff}#spotlight.white .arrow,#spotlight.white .footer,#spotlight.white .header,#spotlight.white .preloader,#spotlight.white .progress{filter:invert(1)}.hide-scrollbars{overflow:-moz-hidden-unscrollable;-ms-overflow-style:none}.hide-scrollbars::-webkit-scrollbar{width:0}@media (max-width:800px){#spotlight .header div{width:20px}#spotlight .footer{font-size:12px}#spotlight .arrow{width:35px;height:35px;margin-top:-17.5px;background-size:15px 15px}#spotlight .preloader{background-size:30px 30px}}@media (max-width:400px),(max-height:400px){#spotlight .fullscreen{display:none!important}}"; 4079document.getElementsByTagName("head")[0].appendChild(oa);var p="theme fullscreen autofit zoom-in zoom-out page title description player progress".split(" "),q,r,pa,qa,u,v,y,z,A,B,C,D,E,F,ra,sa,G,H,I,J,ta,ua,va,K,L,M,wa,N,xa,ya,za,Aa,Ba,O,Ca,Da,Ea,P,Q,Fa,R,S,T,Ga;function V(a){return(N||document).getElementsByClassName(a)[0]} 4080function Ha(a,b){if(H=a.length){L||(L=(N||document).getElementsByClassName("pane"));var c=L.length,d=I.title,e=I.description;T=Array(H);for(var k=0;k<H;k++){var t=a[k],w=t.dataset;if(k>=c){var x=L[0].cloneNode(!1);l(x,"left",100*k+"%");L[0].parentNode.appendChild(x)}x=void 0;T[k]={src:w&&(w.href||w.src)||t.src||t.href,title:w&&w.title||t.title||(x=(t||document).getElementsByTagName("img")).length&&x[0].alt||d||"",description:w&&w.description||t.description||e||""}}G=b||1;Ia(!0);Ja()}} 4081function Ka(a,b,c,d){if(d||a[c])I[c]=b&&b[c]||d} 4082function La(a,b){I={};b&&Ma(b);Ma(a);Ka(a,b,"description");
4082Ka(a,b,"title");Ka(a,b,"prefetch",!0);Ka(a,b,"preloader",!0);ua=a.onchange;J=I.infinite;J="undefined"!==typeof J&&"false"!==J;ta="false"!==I.progress;va=1*I.player||7E3;if((a=I.zoom)||""===a)I["zoom-in"]=I["zoom-out"]=a,delete I.zoom;if((a=I.control)||""===a){a="string"===typeof a?a.split(","):a;for(b=0;b<p.length;b++)I[p[b]]="false";for(b=0;b<a.length;b++){var c=a[b].trim();"zoom"===c?I["zoom-in"]=I["zoom-out"]="true":I[c]="true"}}for(a= 40830;a<p.length;a++)b=p[a],l(V(b),"display","false"===I[b]?"none":"");(sa=I.theme)?Na():sa="white"}function Ma(a){for(var b=I,c=Object.keys(a),d=0;d<c.length;d++){var e=c[d];b[e]=""+a[e]}} 4084function Oa(){var a=G;K=L[a-1];M=K.firstElementChild;G=a;if(!M){var b="false"!==I.preloader;M=new Image;M.onload=function(){b&&h(P,"show");T&&(y=this.width,z=this.height,l(this,{visibility:"visible",opacity:1,transform:""}),"false"!==I.prefetch&&a<H&&((new Image).src=T[a].src))};M.onerror=function(){K.removeChild(this)};K.appendChild(M);M.src=T[a-1].src;b&&f(P,"show");return!b}return!0}la(document,"",Pa); 4085la(document,"DOMContentLoaded",function(){N=document.createElement("div");N.id="spotlight";N.innerHTML='<div class=preloader></div><div class=scene><div class=pane></div></div><div class=header><div class=page></div><div class="icon fullscreen"></div><div class="icon autofit"></div><div class="icon zoom-out"></div><div class="icon zoom-in"></div><div class="icon theme"></div><div class="icon player"></div><div class="icon close"></div></div><div class=progress></div><div class="arrow arrow-left"></div><div class="arrow arrow-right"></div><div class=footer><div class=title></div><div class=description></div></div>'; 4086l(N,"transition","none");document.body.appendChild(N);wa=V("scene");xa=V("footer");ya=V("title");za=V("description");Aa=V("arrow-left");Ba=V("arrow-right");O=V("fullscreen");Ca=V("page");Da=V("player");Ea=V("progress");P=V("preloader");S=document.documentElement||document.body;document.cancelFullScreen||(document.cancelFullScreen=document.exitFullscreen||document.webkitCancelFullScreen||document.webkitExitFullscreen||document.mozCancelFullScreen||function(){});S.requestFullScreen||(S.requestFullScreen= 4087S.webkitRequestFullScreen||S.msRequestFullScreen||S.mozRequestFullScreen||l(O,"display","none")||function(){});Ga=[[window,"keydown",Qa],[window,"wheel",Ra],[window,"hashchange",Sa],[window,"resize",Ta],[P,"mousedown",Ua],[P,"mouseleave",Va],[P,"mouseup",Va],[P,"mousemove",Wa],[P,"touchstart",Ua,{passive:!1}],[P,"touchcancel",Va],[P,"touchend",Va],[P,"touchmove",Wa,{passive:!0}],[O,"",Xa],[Aa,"",Ya],[Ba,"",W],[Da,"",Za],[V("autofit"),"",$a],[V("zoom-in"),"",ab],[V("zoom-out"),"",bb],[V("close"),"", 4088cb],[V("theme"),"",Na]]},{once:!0});function Ta(){u=N.clientWidth;v=N.clientHeight;M&&(y=M.width,z=M.height,db())}function db(){l(M,"transform","translate(-50%, -50%) scale("+A+")")}function X(a,b){l(K,"transform",a||b?"translate("+a+"px, "+b+"px)":"")}function Ia(a,b){(a?m:l)(wa,"transform","translateX("+(100*-(G-1)+(b||0))+"%)")}function eb(a){for(var b=0;b<Ga.length;b++){var c=Ga[b];(a?la:na)(c[0],c[1],c[2],c[3])}} 4089function Pa(a){var b=fb.call(a.target,".spotlight");if(b){var c=fb.call(b,".spotlight-group"),d=(c||document).getElementsByClassName("spotlight");La(b.dataset,c&&c.dataset);for(c=0;c<d.length;c++)if(d[c]===b){Ha(d,c+1);break}gb();return n(a)}}function Qa(a){if(K)switch(a.keyCode){case 8:$a();break;case 27:cb();break;case 32:"false"!==I.player&&Za();break;case 37:Ya();break;case 39:W();break;case 38:case 107:case 187:ab();break;case 40:case 109:case 189:bb()}} 4090function Ra(a){K&&(a=a.deltaY,0>.5*(0>a?1:a?-1:0)?bb():ab())}function Sa(){K&&"#spotlight"===location.hash&&cb(!0)}function Za(a){("boolean"===typeof a?a:!Q)?Q||(Q=setInterval(W,va),f(Da,"on"),ta&&hb()):Q&&(Q=clearInterval(Q),h(Da,"on"),ta&&m(Ea,"transform",""));return Q}function Y(){R?clearTimeout(R):f(N,"menu");var a=I.autohide;R="false"!==a?setTimeout(function(){h(N,"menu");R=null},1*a||3E3):1}function ib(a){"boolean"===typeof a&&(R=a?R:0);R?(R=clearTimeout(R),h(N,"menu")):Y();return n(a)} 4091function Ua(a){B=!0;C=!1;var b=jb(a);D=y*A<=u;pa=b.x;qa=b.y;return n(a,!0)}function Va(a){if(B&&!C)return B=!1,ib(a);D&&C&&(Ia(!0,q/u*100),q<-(v/10)&&W()||q>v/10&&Ya()||Ia(),q=0,D=!1,X());B=!1;return n(a)}function Wa(a){if(B){Fa||(Fa=requestAnimationFrame(kb));
4091var b=jb(a),c=(y*A-u)/2;C=!0;q-=pa-(pa=b.x);D?E=!0:q>c?q=c:0<u-q-y*A+c?q=u-y*A+c:E=!0;z*A>v&&(c=(z*A-v)/2,r-=qa-(qa=b.y),r>c?r=c:0<v-r-z*A+c?r=v-z*A+c:E=!0)}else Y();return n(a,!0)} 4092function jb(a){var b=a.touches;b&&(b=b[0]);return{x:b?b.clientX:a.pageX,y:b?b.clientY:a.pageY}}function kb(a){E?(a&&(Fa=requestAnimationFrame(kb)),X(q,r)):Fa=null;E=!1}function Xa(a){("boolean"===typeof a?a:document.isFullScreen||document.webkitIsFullScreen||document.mozFullScreen)?(document.cancelFullScreen(),h(O,"on")):(S.requestFullScreen(),f(O,"on"))} 4093function $a(a){"boolean"===typeof a&&(F=!a);F=1===A&&!F;l(M,{maxHeight:F?"none":"",maxWidth:F?"none":"",transform:""});y=M.width;z=M.height;A=1;r=q=0;E=!0;X();Y()}function ab(a){var b=A/.65;5>=b&&lb(A=b);a||Y()}function lb(a){A=a||1;db()}function bb(a){var b=.65*A;1<=b&&(lb(A=b),r=q=0,E=!0,X());a||Y()}function gb(){location.hash="spotlight";location.hash="show";l(N,"transition","");f(S,"hide-scrollbars");f(N,"show");eb(!0);Ta();Y()} 4094function cb(a){eb(!1);history.go(!0===a?-1:-2);h(S,"hide-scrollbars");h(N,"show");Q&&Za(!1);M.parentNode.removeChild(M);K=L=M=T=I=ua=null}function Ya(){if(1<G)return Z(G-1);if(Q||J)return Z(H)}function W(){if(G<H)return Z(G+1);if(Q||J)return Z(1)}function Z(a){if(!(Q&&B||a===G)){Q||Y();Q&&ta&&hb();var b=a>G;G=a;Ja(b);return!0}}function hb(){m(Ea,{transitionDuration:"",transform:""});l(Ea,{transitionDuration:va+"ms",transform:"translateX(0)"})} 4095function Na(a){"boolean"===typeof a?ra=a:(ra=!ra,Y());ra?f(N,sa):h(N,sa)} 4096function Ja(a){r=q=0;A=1;var b=I.animation,c=!0,d=!0,e=!0;if(b||""===b){c=d=e=!1;b="string"===typeof b?b.split(","):b;for(var k=0;k<b.length;k++){var t=b[k].trim();if("scale"===t)c=!0;else if("fade"===t)d=!0;else if("slide"===t)e=!0;else if("flip"===t)var w=!0;else if("false"!==t){c=d=e=w=!1;var x=t;break}}}l(wa,"transition",e?"":"none");Ia();K&&X();if(M){l(M,{opacity:d?0:1,transform:""});var U=M;setTimeout(function(){U&&M!==U&&U.parentNode&&U.parentNode.removeChild(U)},800)}e=Oa();x&&f(M,x);m(M, 4097{opacity:d?0:1,transform:"translate(-50%, -50%)"+(c?" scale(0.8)":"")+(w&&"undefined"!==typeof a?" rotateY("+(a?"":"-")+"90deg)":""),maxHeight:"",maxWidth:""});e&&l(M,{visibility:"visible",opacity:1,transform:""});x&&h(M,x);X();l(Aa,"visibility",J||1!==G?"":"hidden");l(Ba,"visibility",J||G!==H?"":"hidden");a=T[G-1];if(c=a.title||a.description)ka(ya,a.title),ka(za,a.description);l(xa,"visibility",c?"visible":"hidden");ka(Ca,G+" / "+H);ua&&ua(G)} 4098var fb=Element.prototype.closest||function(a){var b=this;for(a=a.substring(1);b&&1===b.nodeType;){if(b.classList.contains(a))return b;b=b.parentElement||b.parentNode}};window.Spotlight={theme:Na,fullscreen:Xa,autofit:$a,next:W,prev:Ya,"goto":Z,close:cb,zoom:lb,menu:ib,show:function(a,b){setTimeout(function(){a?(b?La(b):b={},Ha(a,b.index)):I={};gb()})},play:Za};}).call(this); 4099`},1320:function(e){e.exports=`/*! 4100 * typeahead.js 0.11.1 4101 * https://github.com/twitter/typeahead.js 4102 * Copyright 2013-2015 Twitter, Inc. and other contributors; Licensed MIT 4103 */ 4104 4105!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>
vendor: 9,528 bytes, line 4105
4105=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(/\\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}
vendor: 4,818 bytes, lines 4105-4112
4105,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}); 4106`},3622:function(e){e.exports=`/*! 4107 * typeahead.js 0.11.1 4108 * https://github.com/twitter/typeahead.js 4109 * Copyright 2013-2015 Twitter, Inc. and other contributors; Licensed MIT 4110 */ 4111 4112!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-
4112open",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 4112
4112\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 4112
4112,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}}()});
4112 4113`},9203:function(e,n,t){t(5714)(t(5423))},2993:function(e,n,t){t(5714)(t(6962))},9778:function(e,n,t){t(5714)(t(7651))},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))},6543:function(e,n,t){t(5714)(t(8615))},7510:function(e,n,t){t(5714)(t(7419))},400:function(e,n,t){t(5714)(t(1570))},9113:function(e,n,t){t(5714)(t(1320))},341:function(e,n,t){t(5714)(t(3622))},4286:function(e){"use strict";e.exports=Popper},5311:function(e){"use strict";e.exports=jQuery}},function(e){var n=function(i){return e(e.s=i)};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.