assets/themes/j1/core/js/template.js in j1-template-2021.2.3 vs assets/themes/j1/core/js/template.js in j1-template-2021.2.4

- old
+ new

@@ -1,47 +1,8530 @@ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/assets/themes/j1/core/js",n(n.s=2)}([function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){e.exports={EN:"English",DE:"German",FR:"French",ES:"Spanish",IT:"Italian",NL:"Dutch",PL:"Polish"}},function(e,t,n){window.Cookies=n(3),window.log4javascript=n(4),window.liteURL=n(5),window.platform=n(6),window.j1.adapter=n(8),window.j1.anime=n(9),window.j1.core=n(10),window.j1.core.navigator=n(11),window.j1.core.asciidoctor=n(12),window.j1.core.scrollSmooth=n(13),window.deeplTranslator=n(14);n(24),n(30)},function(e,t,n){var r,o; -/*! +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = "/assets/themes/j1/core/js"; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 2); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports) { + +var g; + +// This works in non-strict mode +g = (function() { + return this; +})(); + +try { + // This works if eval is allowed (see CSP) + g = g || new Function("return this")(); +} catch (e) { + // This works if the window reference is available + if (typeof window === "object") g = window; +} + +// g can still be undefined, but nothing to do about it... +// We return undefined, instead of nothing here, so it's +// easier to handle this case. if(!global) { ...} + +module.exports = g; + + +/***/ }), +/* 1 */ +/***/ (function(module, exports) { + +module.exports = { + EN: 'English', + DE: 'German', + FR: 'French', + ES: 'Spanish', + IT: 'Italian', + NL: 'Dutch', + PL: 'Polish' +}; + +/***/ }), +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { + +/* + # ----------------------------------------------------------------------------- + # ~/src/template.js + # J1 Template Javascript Core library + # + # Product/Info: + # https://jekyll.one + # + # Copyright (C) 2021 Juergen Adams + # + # J1 Template is licensed under the MIT License. + # See: https://github.com/jekyll-one-org/J1 Template/blob/master/LICENSE + # + # ----------------------------------------------------------------------------- +*/ +// ----------------------------------------------------------------------------- +// ESLint shimming +// ----------------------------------------------------------------------------- + +/* eslint-disable no-unused-vars */ + +/* global window */ +// ----------------------------------------------------------------------------- +// Import SASS sources for HMR +// ----------------------------------------------------------------------------- +// import '../100_template_css/scss/theme_uno/components/_footer.scss'; +// import '../100_template_css/theme_uno.css'; // <-- yes, also require (s)css. This is a Webpack thing +// Core Libraries - imported|required from NODE|NPM modules +// ----------------------------------------------------------------------------- +// +// Following objects (framework modules) are *conditionaly* forced to be +// exposed for run-time to the global namespace (window) by WP config +// file (expose-loader): +// jQuery +// Popper ('popper.js/dist/umd/popper', https://github.com/twbs/bootstrap/issues/23381) +// ----------------------------------------------------------------------------- +// Core Utilities (moved to modules) +// ----------------------------------------------------------------------------- +// Following objects (native node modules) are *explicitely* forced to be +// exposed for run-time to the global namespace (window). +// ----------------------------------------------------------------------------- +window.Cookies = __webpack_require__(3); +window.log4javascript = __webpack_require__(4); +window.liteURL = __webpack_require__(5); +window.platform = __webpack_require__(6); // Core Libraries - build|required from SOURCE +// ----------------------------------------------------------------------------- +// Following source objects|modules are *explicitely* forced to be +// exposed for run-time to the global namespace (window). +// ----------------------------------------------------------------------------- + +window.j1.adapter = __webpack_require__(8); +window.j1.anime = __webpack_require__(9); // added for fam + +window.j1.core = __webpack_require__(10); +window.j1.core.navigator = __webpack_require__(11); +window.j1.core.asciidoctor = __webpack_require__(12); +window.j1.core.scrollSmooth = __webpack_require__(13); +window.deeplTranslator = __webpack_require__(14); // window.j1.fam = require('./js/fam/fam.js'); // cannot used until NOT rewritten to jQuery +// Following source objects|modules are *implicetly* forced to be +// exposed for run-time to the global namespace (window). +// ----------------------------------------------------------------------------- +//const Bootstrap = require('./js/bootstrap/bootstrap.js'); +//const J1JekyllSearch = require('./js/jekyll_search/jekyll_search.js'); + +var J1Tocbot = __webpack_require__(24); + +var J1AttrChangeListener = __webpack_require__(30); //const J1ThemeSwitcher = require('./js/bs_theme_switcher/switcher.js'); +// const J1MmenuLight = require('./js/mmenu-light/mmenu.js'); +// Passing log data over Internet|SeeMe (currently NOT used) +// ----------------------------------------------------------------------------- +// window.j1.core.log4javascript = require('./js/logger/client/webhook.js'); +// BMD Libraries (moved to modules) +// ----------------------------------------------------------------------------- +// window.bootstrapMaterialDesign = require('./js/bmd/js/bmd.js'); +// Github Webhooks (currently NOT used) +// ----------------------------------------------------------------------------- +// window.j1.core.webhooks = require('./js/webhooks/octokit/client.js'); +// Test|Custom modules (currently NOT used) +// ----------------------------------------------------------------------------- +// window.j1promiseTest = require('./js/custom/test_promises.js'); +// window.j1Example = require('./js/custom/example_module.js'); +// BS Libraries (moved to modules) +// ----------------------------------------------------------------------------- +// Following source objects|modules are *implicetly* forced to be +// exposed for run-time to the global namespace (window). +// ----------------------------------------------------------------------------- +// const Bootstrap = require('./js/bootstrap/bootstrap.js'); +// const J1JekyllSearch = require('./js/jekyll_search/jekyll_search.js'); // Buffer Kack +// const J1Tocbot = require('./js/tocbot/tocbot.js'); +// Backstretch (moved to modules) +// ----------------------------------------------------------------------------- +// Following source objects|modules are *implicetly* forced to be +// exposed for run-time to the namespace of jQuery ($). +// ----------------------------------------------------------------------------- +// const J1Attics = require('./js/backstretch/backstretch.js'); +// Additional Vanilla JS helpers +// ----------------------------------------------------------------------------- + + +var J1AdocResultViewer = __webpack_require__(31); // const MSIEPolyfills = require('./js/polyfills/ms-ie.js'); +// HMR messages (currently NOT used) +// ----------------------------------------------------------------------------- +// if (module.hot) { +// var logtext; +// var stat; +// var stat=module.hot.status(); +// +// logtext='[INFO ] [HMR ] [Hot Module Replacement enabled]'; +// console.log(logtext); +// logtext='[INFO ] [HMR ] [Status: ' + stat + ']'; +// console.log(logtext); +// +// module.hot.accept('./template.js', function() { +// console.log('[HMR] Accepting the updated template.js module!'); +// }); +// +// module.hot.accept('../100_template_css/theme_uno.scss', function () { +// console.log('[HMR] Accepting the updated style.css module!'); +// require('../100_template_css/theme_uno.scss') +// }) +// +// React to the current status... +// module.hot.addStatusHandler(status => { +// stat=module.hot.status(); +// logtext='[INFO ] [HMR ] [Status: ' + stat + ']'; +// console.log(logtext); +// }); +//} +// ----------------------------------------------------------------------------- +// END + +/***/ }), +/* 3 */ +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! * JavaScript Cookie v2.2.1 * https://github.com/js-cookie/js-cookie * * Copyright 2006, 2015 Klaus Hartl & Fagner Brack * Released under the MIT license - */!function(i){if(void 0===(o="function"==typeof(r=i)?r.call(t,n,t,e):r)||(e.exports=o),!0,e.exports=i(),!!0){var a=window.Cookies,s=window.Cookies=i();s.noConflict=function(){return window.Cookies=a,s}}}((function(){function e(){for(var e=0,t={};e<arguments.length;e++){var n=arguments[e];for(var r in n)t[r]=n[r]}return t}function t(e){return e.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function n(r){function o(){}function i(t,n,i){if("undefined"!=typeof document){"number"==typeof(i=e({path:"/"},o.defaults,i)).expires&&(i.expires=new Date(1*new Date+864e5*i.expires)),i.expires=i.expires?i.expires.toUTCString():"";try{var a=JSON.stringify(n);/^[\{\[]/.test(a)&&(n=a)}catch(e){}n=r.write?r.write(n,t):encodeURIComponent(String(n)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var s="";for(var l in i)i[l]&&(s+="; "+l,!0!==i[l]&&(s+="="+i[l].split(";")[0]));return document.cookie=t+"="+n+s}}function a(e,n){if("undefined"!=typeof document){for(var o={},i=document.cookie?document.cookie.split("; "):[],a=0;a<i.length;a++){var s=i[a].split("="),l=s.slice(1).join("=");n||'"'!==l.charAt(0)||(l=l.slice(1,-1));try{var c=t(s[0]);if(l=(r.read||r)(l,c)||t(l),n)try{l=JSON.parse(l)}catch(e){}if(o[c]=l,e===c)break}catch(e){}}return e?o[e]:o}}return o.set=i,o.get=function(e){return a(e,!1)},o.getJSON=function(e){return a(e,!0)},o.remove=function(t,n){i(t,"",e(n,{expires:-1}))},o.defaults={},o.withConverter=n,o}((function(){}))}))},function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_RESULT__,factory;factory=function(){function isUndefined(e){return void 0===e}function EventSupport(){}Array.prototype.push||(Array.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)this[this.length]=arguments[e];return this.length}),Array.prototype.shift||(Array.prototype.shift=function(){if(this.length>0){for(var e=this[0],t=0,n=this.length-1;t<n;t++)this[t]=this[t+1];return this.length=this.length-1,e}}),Array.prototype.splice||(Array.prototype.splice=function(e,t){var n=this.slice(e+t),r=this.slice(e,e+t);this.length=e;for(var o=[],i=0,a=arguments.length;i<a;i++)o[i]=arguments[i];var s=o.length>2?n=o.slice(2).concat(n):n;for(i=0,a=s.length;i<a;i++)this.push(s[i]);return r}),EventSupport.prototype={eventTypes:[],eventListeners:{},setEventTypes:function(e){if(e instanceof Array){this.eventTypes=e,this.eventListeners={};for(var t=0,n=this.eventTypes.length;t<n;t++)this.eventListeners[this.eventTypes[t]]=[]}else handleError("log4javascript.EventSupport ["+this+"]: setEventTypes: eventTypes parameter must be an Array")},addEventListener:function(e,t){"function"==typeof t?(array_contains(this.eventTypes,e)||handleError("log4javascript.EventSupport ["+this+"]: addEventListener: no event called '"+e+"'"),this.eventListeners[e].push(t)):handleError("log4javascript.EventSupport ["+this+"]: addEventListener: listener must be a function")},removeEventListener:function(e,t){"function"==typeof t?(array_contains(this.eventTypes,e)||handleError("log4javascript.EventSupport ["+this+"]: removeEventListener: no event called '"+e+"'"),array_remove(this.eventListeners[e],t)):handleError("log4javascript.EventSupport ["+this+"]: removeEventListener: listener must be a function")},dispatchEvent:function(e,t){if(array_contains(this.eventTypes,e))for(var n=this.eventListeners[e],r=0,o=n.length;r<o;r++)n[r](this,e,t);else handleError("log4javascript.EventSupport ["+this+"]: dispatchEvent: no event called '"+e+"'")}};var applicationStartDate=new Date,uniqueId="log4javascript_"+applicationStartDate.getTime()+"_"+Math.floor(1e8*Math.random()),emptyFunction=function(){},newLine="\r\n",pageLoaded=!1;function Log4JavaScript(){}Log4JavaScript.prototype=new EventSupport;var log4javascript=new Log4JavaScript;function toStr(e){return e&&e.toString?e.toString():String(e)}function getExceptionMessage(e){return e.message?e.message:e.description?e.description:toStr(e)}function getUrlFileName(e){var t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return e.substr(t+1)}function getExceptionStringRep(e){if(e){var t="Exception: "+getExceptionMessage(e);try{e.lineNumber&&(t+=" on line number "+e.lineNumber),e.fileName&&(t+=" in file "+getUrlFileName(e.fileName))}catch(e){logLog.warn("Unable to obtain file and line information for error")}return showStackTraces&&e.stack&&(t+=newLine+"Stack trace:"+newLine+e.stack),t}return null}function bool(e){return Boolean(e)}function trim(e){return e.replace(/^\s+/,"").replace(/\s+$/,"")}function splitIntoLines(e){return e.replace(/\r\n/g,"\n").replace(/\r/g,"\n").split("\n")}log4javascript.version="1.4.13",log4javascript.edition="log4javascript";var urlEncode=void 0!==window.encodeURIComponent?function(e){return encodeURIComponent(e)}:function(e){return escape(e).replace(/\+/g,"%2B").replace(/"/g,"%22").replace(/'/g,"%27").replace(/\//g,"%2F").replace(/=/g,"%3D")};function array_remove(e,t){for(var n=-1,r=0,o=e.length;r<o;r++)if(e[r]===t){n=r;break}return n>=0&&(e.splice(n,1),!0)}function array_contains(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]==t)return!0;return!1}function extractBooleanFromParam(e,t){return isUndefined(e)?t:bool(e)}function extractStringFromParam(e,t){return isUndefined(e)?t:String(e)}function extractIntFromParam(e,t){if(isUndefined(e))return t;try{var n=parseInt(e,10);return isNaN(n)?t:n}catch(n){return logLog.warn("Invalid int param "+e,n),t}}function extractFunctionFromParam(e,t){return"function"==typeof e?e:t}function isError(e){return e instanceof Error}Function.prototype.apply||(Function.prototype.apply=function(obj,args){var methodName="__apply__";void 0!==obj[methodName]&&(methodName+=String(Math.random()).substr(2)),obj[methodName]=this;for(var argsStrings=[],i=0,len=args.length;i<len;i++)argsStrings[i]="args["+i+"]";var script="obj."+methodName+"("+argsStrings.join(",")+")",returnValue=eval(script);return delete obj[methodName],returnValue}),Function.prototype.call||(Function.prototype.call=function(e){for(var t=[],n=1,r=arguments.length;n<r;n++)t[n-1]=arguments[n];return this.apply(e,t)});var logLog={quietMode:!1,debugMessages:[],setQuietMode:function(e){this.quietMode=bool(e)},numberOfErrors:0,alertAllErrors:!1,setAlertAllErrors:function(e){this.alertAllErrors=e},debug:function(e){this.debugMessages.push(e)},displayDebug:function(){alert(this.debugMessages.join(newLine))},warn:function(e,t){},error:function(e,t){if((1==++this.numberOfErrors||this.alertAllErrors)&&!this.quietMode){var n="log4javascript error: "+e;t&&(n+=newLine+newLine+"Original error: "+getExceptionStringRep(t)),alert(n)}}};function handleError(e,t){logLog.error(e,t),log4javascript.dispatchEvent("error",{message:e,exception:t})}log4javascript.logLog=logLog,log4javascript.setEventTypes(["load","error"]),log4javascript.handleError=handleError;var enabled=!("undefined"!=typeof log4javascript_disabled&&log4javascript_disabled);log4javascript.setEnabled=function(e){enabled=bool(e)},log4javascript.isEnabled=function(){return enabled};var useTimeStampsInMilliseconds=!0;log4javascript.setTimeStampsInMilliseconds=function(e){useTimeStampsInMilliseconds=bool(e)},log4javascript.isTimeStampsInMilliseconds=function(){return useTimeStampsInMilliseconds},log4javascript.evalInScope=function(expr){return eval(expr)};var showStackTraces=!1;log4javascript.setShowStackTraces=function(e){showStackTraces=bool(e)};var Level=function(e,t){this.level=e,this.name=t};function Timer(e,t){this.name=e,this.level=isUndefined(t)?Level.INFO:t,this.start=new Date}Level.prototype={toString:function(){return this.name},equals:function(e){return this.level==e.level},isGreaterOrEqual:function(e){return this.level>=e.level}},Level.ALL=new Level(Number.MIN_VALUE,"ALL"),Level.TRACE=new Level(1e4,"TRACE"),Level.DEBUG=new Level(2e4,"DEBUG"),Level.INFO=new Level(3e4,"INFO"),Level.WARN=new Level(4e4,"WARN"),Level.ERROR=new Level(5e4,"ERROR"),Level.FATAL=new Level(6e4,"FATAL"),Level.OFF=new Level(Number.MAX_VALUE,"OFF"),log4javascript.Level=Level,Timer.prototype.getElapsedTime=function(){return(new Date).getTime()-this.start.getTime()};var anonymousLoggerName="[anonymous]",defaultLoggerName="[default]",nullLoggerName="[null]",rootLoggerName="root";function Logger(e){this.name=e,this.parent=null,this.children=[];var t=[],n=null,r=this.name===rootLoggerName,o=this.name===nullLoggerName,i=null,a=!1;this.addChild=function(e){this.children.push(e),e.parent=this,e.invalidateAppenderCache()};var s=!0;this.getAdditivity=function(){return s},this.setAdditivity=function(e){var t=s!=e;s=e,t&&this.invalidateAppenderCache()},this.addAppender=function(e){o?handleError("Logger.addAppender: you may not add an appender to the null logger"):e instanceof log4javascript.Appender?array_contains(t,e)||(t.push(e),e.setAddedToLogger(this),this.invalidateAppenderCache()):handleError("Logger.addAppender: appender supplied ('"+toStr(e)+"') is not a subclass of Appender")},this.removeAppender=function(e){array_remove(t,e),e.setRemovedFromLogger(this),this.invalidateAppenderCache()},this.removeAllAppenders=function(){var e=t.length;if(e>0){for(var n=0;n<e;n++)t[n].setRemovedFromLogger(this);t.length=0,this.invalidateAppenderCache()}},this.getEffectiveAppenders=function(){if(null===i||a){var e=r||!this.getAdditivity()?[]:this.parent.getEffectiveAppenders();i=e.concat(t),a=!1}return i},this.invalidateAppenderCache=function(){a=!0;for(var e=0,t=this.children.length;e<t;e++)this.children[e].invalidateAppenderCache()},this.log=function(e,t){if(enabled&&e.isGreaterOrEqual(this.getEffectiveLevel())){var n,r=t.length-1,o=t[r];t.length>1&&isError(o)&&(n=o,r--);for(var i=[],a=0;a<=r;a++)i[a]=t[a];var s=new LoggingEvent(this,new Date,e,i,n);this.callAppenders(s)}},this.callAppenders=function(e){for(var t=this.getEffectiveAppenders(),n=0,r=t.length;n<r;n++)t[n].doAppend(e)},this.setLevel=function(e){r&&null===e?handleError("Logger.setLevel: you cannot set the level of the root logger to null"):e instanceof Level?n=e:handleError("Logger.setLevel: level supplied to logger "+this.name+" is not an instance of log4javascript.Level")},this.getLevel=function(){return n},this.getEffectiveLevel=function(){for(var e=this;null!==e;e=e.parent){var t=e.getLevel();if(null!==t)return t}},this.group=function(e,t){if(enabled)for(var n=this.getEffectiveAppenders(),r=0,o=n.length;r<o;r++)n[r].group(e,t)},this.groupEnd=function(){if(enabled)for(var e=this.getEffectiveAppenders(),t=0,n=e.length;t<n;t++)e[t].groupEnd()};var l={};this.time=function(e,t){enabled&&(isUndefined(e)?handleError("Logger.time: a name for the timer must be supplied"):!t||t instanceof Level?l[e]=new Timer(e,t):handleError("Logger.time: level supplied to timer "+e+" is not an instance of log4javascript.Level"))},this.timeEnd=function(e){if(enabled)if(isUndefined(e))handleError("Logger.timeEnd: a name for the timer must be supplied");else if(l[e]){var t=l[e],n=t.getElapsedTime();this.log(t.level,["Timer "+toStr(e)+" completed in "+n+"ms"]),delete l[e]}else logLog.warn("Logger.timeEnd: no timer found with name "+e)},this.assert=function(e){if(enabled&&!e){for(var t=[],n=1,r=arguments.length;n<r;n++)t.push(arguments[n]);(t=t.length>0?t:["Assertion Failure"]).push(newLine),t.push(e),this.log(Level.ERROR,t)}},this.toString=function(){return"Logger["+this.name+"]"}}Logger.prototype={trace:function(){this.log(Level.TRACE,arguments)},debug:function(){this.log(Level.DEBUG,arguments)},info:function(){this.log(Level.INFO,arguments)},warn:function(){this.log(Level.WARN,arguments)},error:function(){this.log(Level.ERROR,arguments)},fatal:function(){this.log(Level.FATAL,arguments)},isEnabledFor:function(e){return e.isGreaterOrEqual(this.getEffectiveLevel())},isTraceEnabled:function(){return this.isEnabledFor(Level.TRACE)},isDebugEnabled:function(){return this.isEnabledFor(Level.DEBUG)},isInfoEnabled:function(){return this.isEnabledFor(Level.INFO)},isWarnEnabled:function(){return this.isEnabledFor(Level.WARN)},isErrorEnabled:function(){return this.isEnabledFor(Level.ERROR)},isFatalEnabled:function(){return this.isEnabledFor(Level.FATAL)}},Logger.prototype.trace.isEntryPoint=!0,Logger.prototype.debug.isEntryPoint=!0,Logger.prototype.info.isEntryPoint=!0,Logger.prototype.warn.isEntryPoint=!0,Logger.prototype.error.isEntryPoint=!0,Logger.prototype.fatal.isEntryPoint=!0;var loggers={},loggerNames=[],ROOT_LOGGER_DEFAULT_LEVEL=Level.DEBUG,rootLogger=new Logger(rootLoggerName);rootLogger.setLevel(ROOT_LOGGER_DEFAULT_LEVEL),log4javascript.getRootLogger=function(){return rootLogger},log4javascript.getLogger=function(e){if("string"!=typeof e&&(e=anonymousLoggerName,logLog.warn("log4javascript.getLogger: non-string logger name "+toStr(e)+" supplied, returning anonymous logger")),e==rootLoggerName&&handleError("log4javascript.getLogger: root logger may not be obtained by name"),!loggers[e]){var t=new Logger(e);loggers[e]=t,loggerNames.push(e);var n,r=e.lastIndexOf(".");if(r>-1){var o=e.substring(0,r);n=log4javascript.getLogger(o)}else n=rootLogger;n.addChild(t)}return loggers[e]};var defaultLogger=null;log4javascript.getDefaultLogger=function(){return defaultLogger||(defaultLogger=createDefaultLogger()),defaultLogger};var nullLogger=null;log4javascript.getNullLogger=function(){return nullLogger||(nullLogger=new Logger(nullLoggerName)).setLevel(Level.OFF),nullLogger},log4javascript.resetConfiguration=function(){rootLogger.setLevel(ROOT_LOGGER_DEFAULT_LEVEL),loggers={}};var LoggingEvent=function(e,t,n,r,o){this.logger=e,this.timeStamp=t,this.timeStampInMilliseconds=t.getTime(),this.timeStampInSeconds=Math.floor(this.timeStampInMilliseconds/1e3),this.milliseconds=this.timeStamp.getMilliseconds(),this.level=n,this.messages=r,this.exception=o};LoggingEvent.prototype={getThrowableStrRep:function(){return this.exception?getExceptionStringRep(this.exception):""},getCombinedMessages:function(){return 1==this.messages.length?this.messages[0]:this.messages.join(newLine)},toString:function(){return"LoggingEvent["+this.level+"]"}},log4javascript.LoggingEvent=LoggingEvent;var Layout=function(){};Layout.prototype={defaults:{loggerKey:"logger",timeStampKey:"timestamp",millisecondsKey:"milliseconds",levelKey:"level",messageKey:"message",exceptionKey:"exception",urlKey:"url"},loggerKey:"logger",timeStampKey:"timestamp",millisecondsKey:"milliseconds",levelKey:"level",messageKey:"message",exceptionKey:"exception",urlKey:"url",batchHeader:"",batchFooter:"",batchSeparator:"",returnsPostData:!1,overrideTimeStampsSetting:!1,useTimeStampsInMilliseconds:null,format:function(){handleError("Layout.format: layout supplied has no format() method")},ignoresThrowable:function(){handleError("Layout.ignoresThrowable: layout supplied has no ignoresThrowable() method")},getContentType:function(){return"text/plain"},allowBatching:function(){return!0},setTimeStampsInMilliseconds:function(e){this.overrideTimeStampsSetting=!0,this.useTimeStampsInMilliseconds=bool(e)},isTimeStampsInMilliseconds:function(){return this.overrideTimeStampsSetting?this.useTimeStampsInMilliseconds:useTimeStampsInMilliseconds},getTimeStampValue:function(e){return this.isTimeStampsInMilliseconds()?e.timeStampInMilliseconds:e.timeStampInSeconds},getDataValues:function(e,t){var n=[[this.loggerKey,e.logger.name],[this.timeStampKey,this.getTimeStampValue(e)],[this.levelKey,e.level.name],[this.urlKey,window.location.href],[this.messageKey,t?e.getCombinedMessages():e.messages]];if(this.isTimeStampsInMilliseconds()||n.push([this.millisecondsKey,e.milliseconds]),e.exception&&n.push([this.exceptionKey,getExceptionStringRep(e.exception)]),this.hasCustomFields())for(var r=0,o=this.customFields.length;r<o;r++){var i=this.customFields[r].value;"function"==typeof i&&(i=i(this,e)),n.push([this.customFields[r].name,i])}return n},setKeys:function(e,t,n,r,o,i,a){this.loggerKey=extractStringFromParam(e,this.defaults.loggerKey),this.timeStampKey=extractStringFromParam(t,this.defaults.timeStampKey),this.levelKey=extractStringFromParam(n,this.defaults.levelKey),this.messageKey=extractStringFromParam(r,this.defaults.messageKey),this.exceptionKey=extractStringFromParam(o,this.defaults.exceptionKey),this.urlKey=extractStringFromParam(i,this.defaults.urlKey),this.millisecondsKey=extractStringFromParam(a,this.defaults.millisecondsKey)},setCustomField:function(e,t){for(var n=!1,r=0,o=this.customFields.length;r<o;r++)this.customFields[r].name===e&&(this.customFields[r].value=t,n=!0);n||this.customFields.push({name:e,value:t})},hasCustomFields:function(){return this.customFields.length>0},formatWithException:function(e){var t=this.format(e);return e.exception&&this.ignoresThrowable()&&(t+=e.getThrowableStrRep()),t},toString:function(){handleError("Layout.toString: all layouts must override this method")}},log4javascript.Layout=Layout;var Appender=function(){},SimpleDateFormat;function SimpleLayout(){this.customFields=[]}function NullLayout(){this.customFields=[]}function XmlLayout(e){this.combineMessages=extractBooleanFromParam(e,!0),this.customFields=[]}function escapeNewLines(e){return e.replace(/\r\n|\r|\n/g,"\\r\\n")}function JsonLayout(e,t){this.readable=extractBooleanFromParam(e,!1),this.combineMessages=extractBooleanFromParam(t,!0),this.batchHeader=this.readable?"["+newLine:"[",this.batchFooter=this.readable?"]"+newLine:"]",this.batchSeparator=this.readable?","+newLine:",",this.setKeys(),this.colon=this.readable?": ":":",this.tab=this.readable?"\t":"",this.lineBreak=this.readable?newLine:"",this.customFields=[]}function HttpPostDataLayout(){this.setKeys(),this.customFields=[],this.returnsPostData=!0}function formatObjectExpansion(e,t,n){var r=[];return function e(t,n,o){var i,a,s,l,c,u,d;function p(e){for(var t=splitIntoLines(e),n=1,r=t.length;n<r;n++)t[n]=o+t[n];return t.join(newLine)}if(o||(o=""),null===t)return"null";if(void 0===t)return"undefined";if("string"==typeof t)return p(t);if("object"==typeof t&&array_contains(r,t)){try{u=toStr(t)}catch(e){u="Error formatting property. Details: "+getExceptionStringRep(e)}return u+" [already expanded]"}if(t instanceof Array&&n>0){for(r.push(t),u="["+newLine,s=n-1,l=o+" ",c=[],i=0,a=t.length;i<a;i++)try{d=e(t[i],s,l),c.push(l+d)}catch(e){c.push(l+"Error formatting array member. Details: "+getExceptionStringRep(e))}return u+=c.join(","+newLine)+newLine+o+"]"}if("[object Date]"==Object.prototype.toString.call(t))return t.toString();if("object"==typeof t&&n>0){for(i in r.push(t),u="{"+newLine,s=n-1,l=o+" ",c=[],t)try{d=e(t[i],s,l),c.push(l+i+": "+d)}catch(e){c.push(l+i+": Error formatting property. Details: "+getExceptionStringRep(e))}return u+=c.join(","+newLine)+newLine+o+"}"}return p(toStr(t))}(e,t,n)}function PatternLayout(e){this.pattern=e||PatternLayout.DEFAULT_CONVERSION_PATTERN,this.customFields=[]}function AlertAppender(){}function BrowserConsoleAppender(){}Appender.prototype=new EventSupport,Appender.prototype.layout=new PatternLayout,Appender.prototype.threshold=Level.ALL,Appender.prototype.loggers=[],Appender.prototype.doAppend=function(e){enabled&&e.level.level>=this.threshold.level&&this.append(e)},Appender.prototype.append=function(e){},Appender.prototype.setLayout=function(e){e instanceof Layout?this.layout=e:handleError("Appender.setLayout: layout supplied to "+this.toString()+" is not a subclass of Layout")},Appender.prototype.getLayout=function(){return this.layout},Appender.prototype.setThreshold=function(e){e instanceof Level?this.threshold=e:handleError("Appender.setThreshold: threshold supplied to "+this.toString()+" is not a subclass of Level")},Appender.prototype.getThreshold=function(){return this.threshold},Appender.prototype.setAddedToLogger=function(e){this.loggers.push(e)},Appender.prototype.setRemovedFromLogger=function(e){array_remove(this.loggers,e)},Appender.prototype.group=emptyFunction,Appender.prototype.groupEnd=emptyFunction,Appender.prototype.toString=function(){handleError("Appender.toString: all appenders must override this method")},log4javascript.Appender=Appender,SimpleLayout.prototype=new Layout,SimpleLayout.prototype.format=function(e){return e.level.name+" - "+e.getCombinedMessages()},SimpleLayout.prototype.ignoresThrowable=function(){return!0},SimpleLayout.prototype.toString=function(){return"SimpleLayout"},log4javascript.SimpleLayout=SimpleLayout,NullLayout.prototype=new Layout,NullLayout.prototype.format=function(e){return e.messages},NullLayout.prototype.ignoresThrowable=function(){return!0},NullLayout.prototype.formatWithException=function(e){var t=e.messages,n=e.exception;return n?t.concat([n]):t},NullLayout.prototype.toString=function(){return"NullLayout"},log4javascript.NullLayout=NullLayout,XmlLayout.prototype=new Layout,XmlLayout.prototype.isCombinedMessages=function(){return this.combineMessages},XmlLayout.prototype.getContentType=function(){return"text/xml"},XmlLayout.prototype.escapeCdata=function(e){return e.replace(/\]\]>/,"]]>]]&gt;<![CDATA[")},XmlLayout.prototype.format=function(e){var t,n,r=this;function o(e){return e="string"==typeof e?e:toStr(e),"<log4javascript:message><![CDATA["+r.escapeCdata(e)+"]]></log4javascript:message>"}var i='<log4javascript:event logger="'+e.logger.name+'" timestamp="'+this.getTimeStampValue(e)+'"';if(this.isTimeStampsInMilliseconds()||(i+=' milliseconds="'+e.milliseconds+'"'),i+=' level="'+e.level.name+'">'+newLine,this.combineMessages)i+=o(e.getCombinedMessages());else{for(i+="<log4javascript:messages>"+newLine,t=0,n=e.messages.length;t<n;t++)i+=o(e.messages[t])+newLine;i+="</log4javascript:messages>"+newLine}if(this.hasCustomFields())for(t=0,n=this.customFields.length;t<n;t++)i+='<log4javascript:customfield name="'+this.customFields[t].name+'"><![CDATA['+this.customFields[t].value.toString()+"]]></log4javascript:customfield>"+newLine;return e.exception&&(i+="<log4javascript:exception><![CDATA["+getExceptionStringRep(e.exception)+"]]></log4javascript:exception>"+newLine),i+="</log4javascript:event>"+newLine+newLine},XmlLayout.prototype.ignoresThrowable=function(){return!1},XmlLayout.prototype.toString=function(){return"XmlLayout"},log4javascript.XmlLayout=XmlLayout,JsonLayout.prototype=new Layout,JsonLayout.prototype.isReadable=function(){return this.readable},JsonLayout.prototype.isCombinedMessages=function(){return this.combineMessages},JsonLayout.prototype.format=function(e){var t,n,r=this,o=this.getDataValues(e,this.combineMessages),i="{"+this.lineBreak;function a(e,t,n){var o,i=typeof e;if(e instanceof Date)o=String(e.getTime());else if(n&&e instanceof Array){o="["+r.lineBreak;for(var s=0,l=e.length;s<l;s++){var c=t+r.tab;o+=c+a(e[s],c,!1),s<e.length-1&&(o+=","),o+=r.lineBreak}o+=t+"]"}else o="number"!==i&&"boolean"!==i?'"'+escapeNewLines(toStr(e).replace(/\"/g,'\\"'))+'"':e;return o}for(t=0,n=o.length-1;t<=n;t++)i+=this.tab+'"'+o[t][0]+'"'+this.colon+a(o[t][1],this.tab,!0),t<n&&(i+=","),i+=this.lineBreak;return i+="}"+this.lineBreak},JsonLayout.prototype.ignoresThrowable=function(){return!1},JsonLayout.prototype.toString=function(){return"JsonLayout"},JsonLayout.prototype.getContentType=function(){return"application/json"},log4javascript.JsonLayout=JsonLayout,HttpPostDataLayout.prototype=new Layout,HttpPostDataLayout.prototype.allowBatching=function(){return!1},HttpPostDataLayout.prototype.format=function(e){for(var t=this.getDataValues(e),n=[],r=0,o=t.length;r<o;r++){var i=t[r][1]instanceof Date?String(t[r][1].getTime()):t[r][1];n.push(urlEncode(t[r][0])+"="+urlEncode(i))}return n.join("&")},HttpPostDataLayout.prototype.ignoresThrowable=function(e){return!1},HttpPostDataLayout.prototype.toString=function(){return"HttpPostDataLayout"},log4javascript.HttpPostDataLayout=HttpPostDataLayout,function(){var e=/('[^']*')|(G+|y+|M+|w+|W+|D+|d+|F+|E+|a+|H+|k+|K+|h+|m+|s+|S+|Z+)|([a-zA-Z]+)|([^a-zA-Z']+)/,t=["January","February","March","April","May","June","July","August","September","October","November","December"],n=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],r={G:0,y:3,M:4,w:2,W:2,D:2,d:2,F:2,E:1,a:0,H:2,k:2,K:2,h:2,m:2,s:2,S:2,Z:5},o=function(e,t,n){var r=new Date(e,t,n,0,0,0);return r.setMilliseconds(0),r};Date.prototype.getDifference=function(e){return this.getTime()-e.getTime()},Date.prototype.isBefore=function(e){return this.getTime()<e.getTime()},Date.prototype.getUTCTime=function(){return Date.UTC(this.getFullYear(),this.getMonth(),this.getDate(),this.getHours(),this.getMinutes(),this.getSeconds(),this.getMilliseconds())},Date.prototype.getTimeSince=function(e){return this.getUTCTime()-e.getUTCTime()},Date.prototype.getPreviousSunday=function(){var e=new Date(this.getFullYear(),this.getMonth(),this.getDate(),12,0,0),t=new Date(e.getTime()-864e5*this.getDay());return o(t.getFullYear(),t.getMonth(),t.getDate())},Date.prototype.getWeekInYear=function(e){isUndefined(this.minimalDaysInFirstWeek)&&(e=1);var t=this.getPreviousSunday(),n=o(this.getFullYear(),0,1),r=t.isBefore(n)?0:1+Math.floor(t.getTimeSince(n)/6048e5);return 7-n.getDay()<e&&r--,r},Date.prototype.getWeekInMonth=function(e){isUndefined(this.minimalDaysInFirstWeek)&&(e=1);var t=this.getPreviousSunday(),n=o(this.getFullYear(),this.getMonth(),1),r=t.isBefore(n)?0:1+Math.floor(t.getTimeSince(n)/6048e5);return 7-n.getDay()>=e&&r++,r},Date.prototype.getDayInYear=function(){var e=o(this.getFullYear(),0,1);return 1+Math.floor(this.getTimeSince(e)/864e5)},(SimpleDateFormat=function(e){this.formatString=e}).prototype.setMinimalDaysInFirstWeek=function(e){this.minimalDaysInFirstWeek=e},SimpleDateFormat.prototype.getMinimalDaysInFirstWeek=function(){return isUndefined(this.minimalDaysInFirstWeek)?1:this.minimalDaysInFirstWeek};var i=function(e,t){for(;e.length<t;)e="0"+e;return e},a=function(e,t,n){return t>=4?e:e.substr(0,Math.max(n,t))},s=function(e,t){return i(""+e,t)};SimpleDateFormat.prototype.format=function(o){for(var l,c="",u=this.formatString;l=e.exec(u);){var d=l[1],p=l[2],h=l[3],f=l[4];if(d)c+="''"==d?"'":d.substring(1,d.length-1);else if(h);else if(f)c+=f;else if(p){var g=p.charAt(0),m=p.length,v="";switch(g){case"G":v="AD";break;case"y":v=o.getFullYear();break;case"M":v=o.getMonth();break;case"w":v=o.getWeekInYear(this.getMinimalDaysInFirstWeek());break;case"W":v=o.getWeekInMonth(this.getMinimalDaysInFirstWeek());break;case"D":v=o.getDayInYear();break;case"d":v=o.getDate();break;case"F":v=1+Math.floor((o.getDate()-1)/7);break;case"E":v=n[o.getDay()];break;case"a":v=o.getHours()>=12?"PM":"AM";break;case"H":v=o.getHours();break;case"k":v=o.getHours()||24;break;case"K":v=o.getHours()%12;break;case"h":v=o.getHours()%12||12;break;case"m":v=o.getMinutes();break;case"s":v=o.getSeconds();break;case"S":v=o.getMilliseconds();break;case"Z":v=o.getTimezoneOffset()}switch(r[g]){case 0:c+=a(v,m,2);break;case 1:c+=a(v,m,3);break;case 2:c+=s(v,m);break;case 3:c+=m<=3?(""+v).substr(2,2):s(v,m);break;case 4:c+=m>=3?a(t[v],m,m):s(v+1,m);break;case 5:var y=v>0?"-":"+",b=Math.abs(v),w=""+Math.floor(b/60),C=""+b%60;c+=y+(w=i(w,2))+(C=i(C,2))}}u=u.substr(l.index+l[0].length)}return c}}(),log4javascript.SimpleDateFormat=SimpleDateFormat,PatternLayout.TTCC_CONVERSION_PATTERN="%r %p %c - %m%n",PatternLayout.DEFAULT_CONVERSION_PATTERN="%m%n",PatternLayout.ISO8601_DATEFORMAT="yyyy-MM-dd HH:mm:ss,SSS",PatternLayout.DATETIME_DATEFORMAT="dd MMM yyyy HH:mm:ss,SSS",PatternLayout.ABSOLUTETIME_DATEFORMAT="HH:mm:ss,SSS",PatternLayout.prototype=new Layout,PatternLayout.prototype.format=function(e){for(var t,n=/%(-?[0-9]+)?(\.?[0-9]+)?([acdfmMnpr%])(\{([^\}]+)\})?|([^%]+)/,r="",o=this.pattern;t=n.exec(o);){var i=t[0],a=t[1],s=t[2],l=t[3],c=t[5],u=t[6];if(u)r+=""+u;else{var d,p="";switch(l){case"a":case"m":var h=0;c&&(h=parseInt(c,10),isNaN(h)&&(handleError("PatternLayout.format: invalid specifier '"+c+"' for conversion character '"+l+"' - should be a number"),h=0));for(var f="a"===l?e.messages[0]:e.messages,g=0,m=f.length;g<m;g++)g>0&&" "!==p.charAt(p.length-1)&&(p+=" "),p+=0===h?f[g]:formatObjectExpansion(f[g],h);break;case"c":var v=e.logger.name;if(c){var y=parseInt(c,10),b=e.logger.name.split(".");p=y>=b.length?v:b.slice(b.length-y).join(".")}else p=v;break;case"d":var w=PatternLayout.ISO8601_DATEFORMAT;c&&("ISO8601"==(w=c)?w=PatternLayout.ISO8601_DATEFORMAT:"ABSOLUTE"==w?w=PatternLayout.ABSOLUTETIME_DATEFORMAT:"DATE"==w&&(w=PatternLayout.DATETIME_DATEFORMAT)),p=new SimpleDateFormat(w).format(e.timeStamp);break;case"f":if(this.hasCustomFields()){var C=0;c&&(C=parseInt(c,10),isNaN(C)?handleError("PatternLayout.format: invalid specifier '"+c+"' for conversion character 'f' - should be a number"):0===C?handleError("PatternLayout.format: invalid specifier '"+c+"' for conversion character 'f' - must be greater than zero"):C>this.customFields.length?handleError("PatternLayout.format: invalid specifier '"+c+"' for conversion character 'f' - there aren't that many custom fields"):C-=1);var E=this.customFields[C].value;"function"==typeof E&&(E=E(this,e)),p=E}break;case"n":p=newLine;break;case"p":p=e.level.name;break;case"r":p=""+e.timeStamp.getDifference(applicationStartDate);break;case"%":p="%";break;default:p=i}if(s){d=parseInt(s.substr(1),10);var x=p.length;d<x&&(p=p.substring(x-d,x))}if(a)if("-"==a.charAt(0))for(d=parseInt(a.substr(1),10);p.length<d;)p+=" ";else for(d=parseInt(a,10);p.length<d;)p=" "+p;r+=p}o=o.substr(t.index+t[0].length)}return r},PatternLayout.prototype.ignoresThrowable=function(){return!0},PatternLayout.prototype.toString=function(){return"PatternLayout"},log4javascript.PatternLayout=PatternLayout,AlertAppender.prototype=new Appender,AlertAppender.prototype.layout=new SimpleLayout,AlertAppender.prototype.append=function(e){alert(this.getLayout().formatWithException(e))},AlertAppender.prototype.toString=function(){return"AlertAppender"},log4javascript.AlertAppender=AlertAppender,BrowserConsoleAppender.prototype=new log4javascript.Appender,BrowserConsoleAppender.prototype.layout=new NullLayout,BrowserConsoleAppender.prototype.threshold=Level.DEBUG,BrowserConsoleAppender.prototype.append=function(e){var t,n=this,r=function(t){var r=n.getLayout().formatWithException(e);return"string"==typeof r?t?r:[r]:t?r.join(" "):r},o=window.console;o&&o.log?"function"==typeof o[t=o.debug&&Level.DEBUG.isGreaterOrEqual(e.level)?"debug":o.info&&Level.INFO.equals(e.level)?"info":o.warn&&Level.WARN.equals(e.level)?"warn":o.error&&e.level.isGreaterOrEqual(Level.ERROR)?"error":"log"].apply?o[t].apply(o,r(!1)):o[t](r(!0)):"undefined"!=typeof opera&&opera.postError&&opera.postError(r(!0))},BrowserConsoleAppender.prototype.group=function(e){window.console&&window.console.group&&window.console.group(e)},BrowserConsoleAppender.prototype.groupEnd=function(){window.console&&window.console.groupEnd&&window.console.groupEnd()},BrowserConsoleAppender.prototype.toString=function(){return"BrowserConsoleAppender"},log4javascript.BrowserConsoleAppender=BrowserConsoleAppender;var xhrFactory=function(){return new XMLHttpRequest},xmlHttpFactories=[xhrFactory,function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}],withCredentialsSupported=!1,getXmlHttp=function(e){for(var t,n=null,r=0,o=xmlHttpFactories.length;r<o;r++){t=xmlHttpFactories[r];try{return n=t(),withCredentialsSupported=t==xhrFactory&&"withCredentials"in n,getXmlHttp=t,n}catch(e){}}e?e():handleError("getXmlHttp: unable to obtain XMLHttpRequest object")},ConsoleAppender;function isHttpRequestSuccessful(e){return isUndefined(e.status)||0===e.status||e.status>=200&&e.status<300||1223==e.status}function AjaxAppender(e,t){var n=this,r=!0;e||(handleError("AjaxAppender: URL must be specified in constructor"),r=!1);var o=this.defaults.timed,i=this.defaults.waitForResponse,a=this.defaults.batchSize,s=this.defaults.timerInterval,l=this.defaults.requestSuccessCallback,c=this.defaults.failCallback,u=this.defaults.postVarName,d=this.defaults.sendAllOnUnload,p=this.defaults.contentType,h=null,f=[],g=[],m=[],v=!1,y=!1;function b(e){return!y||(handleError("AjaxAppender: configuration option '"+e+"' may not be set after the appender has been initialized"),!1)}function w(){var e;if(r&&enabled)if(v=!0,i)g.length>0?S(E(e=g.shift()),w):(v=!1,o&&x());else{for(;e=g.shift();)S(E(e));v=!1,o&&x()}}function C(){var e=!1;if(r&&enabled){for(var t,s=n.getLayout().allowBatching()?a:1,l=[];t=f.shift();)l.push(t),f.length>=s&&(g.push(l),l=[]);l.length>0&&g.push(l),e=g.length>0,i=!1,o=!1,w()}return e}function E(e){for(var t,r=[],o="";t=e.shift();)r.push(n.getLayout().formatWithException(t));return o=1==e.length?r.join(""):n.getLayout().batchHeader+r.join(n.getLayout().batchSeparator)+n.getLayout().batchFooter,p==n.defaults.contentType&&((o=n.getLayout().returnsPostData?o:urlEncode(u)+"="+urlEncode(o)).length>0&&(o+="&"),o+="layout="+urlEncode(n.getLayout().toString())),o}function x(){window.setTimeout(w,s)}function L(){var e="AjaxAppender: could not create XMLHttpRequest object. AjaxAppender disabled";handleError(e),r=!1,c&&c(e)}function S(n,o){try{var i=getXmlHttp(L);if(r){i.onreadystatechange=function(){if(4==i.readyState){if(isHttpRequestSuccessful(i))l&&l(i),o&&o(i);else{var t="AjaxAppender.append: XMLHttpRequest request to URL "+e+" returned status code "+i.status;handleError(t),c&&c(t)}i.onreadystatechange=emptyFunction,i=null}},i.open("POST",e,!0),t&&withCredentialsSupported&&(i.withCredentials=!0);try{for(var a,s=0;a=m[s++];)i.setRequestHeader(a.name,a.value);i.setRequestHeader("Content-Type",p)}catch(e){var u="AjaxAppender.append: your browser's XMLHttpRequest implementation does not support setRequestHeader, therefore cannot post data. AjaxAppender disabled";return handleError(u),r=!1,void(c&&c(u))}i.send(n)}}catch(t){var d="AjaxAppender.append: error sending log message to "+e;handleError(d,t),r=!1,c&&c(d+". Details: "+getExceptionStringRep(t))}}this.getSessionId=function(){return h},this.setSessionId=function(e){h=extractStringFromParam(e,null),this.layout.setCustomField("sessionid",h)},this.setLayout=function(e){b("layout")&&(this.layout=e,null!==h&&this.setSessionId(h))},this.isTimed=function(){return o},this.setTimed=function(e){b("timed")&&(o=bool(e))},this.getTimerInterval=function(){return s},this.setTimerInterval=function(e){b("timerInterval")&&(s=extractIntFromParam(e,s))},this.isWaitForResponse=function(){return i},this.setWaitForResponse=function(e){b("waitForResponse")&&(i=bool(e))},this.getBatchSize=function(){return a},this.setBatchSize=function(e){b("batchSize")&&(a=extractIntFromParam(e,a))},this.isSendAllOnUnload=function(){return d},this.setSendAllOnUnload=function(e){b("sendAllOnUnload")&&(d=extractBooleanFromParam(e,d))},this.setRequestSuccessCallback=function(e){l=extractFunctionFromParam(e,l)},this.setFailCallback=function(e){c=extractFunctionFromParam(e,c)},this.getPostVarName=function(){return u},this.setPostVarName=function(e){b("postVarName")&&(u=extractStringFromParam(e,u))},this.getHeaders=function(){return m},this.addHeader=function(e,t){"content-type"==e.toLowerCase()?p=t:m.push({name:e,value:t})},this.sendAll=w,this.sendAllRemaining=C,this.append=function(e){if(r){y||function(){if(y=!0,d){var e=window.onbeforeunload;window.onbeforeunload=function(){e&&e(),C()}}o&&x()}(),f.push(e);var t=this.getLayout().allowBatching()?a:1;if(f.length>=t){for(var n,s=[];n=f.shift();)s.push(n);g.push(s),o||i&&(!i||v)||w()}}}}function setCookie(e,t,n,r){var o;if(r=r?"; path="+r:"",n){var i=new Date;i.setTime(i.getTime()+24*n*60*60*1e3),o="; expires="+i.toGMTString()}else o="";document.cookie=escape(e)+"="+escape(t)+o+r}function getCookie(e){for(var t=escape(e)+"=",n=document.cookie.split(";"),r=0,o=n.length;r<o;r++){for(var i=n[r];" "===i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return unescape(i.substring(t.length,i.length))}return null}function getBaseUrl(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t)if(-1!=e[t].src.indexOf("log4javascript")){var r=e[t].src.lastIndexOf("/");return-1==r?"":e[t].src.substr(0,r+1)}return null}function isLoaded(e){try{return bool(e.loaded)}catch(e){return!1}}function padWithSpaces(e,t){if(e.length<t){for(var n=[],r=Math.max(0,t-e.length),o=0;o<r;o++)n[o]=" ";e+=n.join("")}return e}function createDefaultLogger(){var e=log4javascript.getLogger(defaultLoggerName),t=new log4javascript.PopUpAppender;return e.addAppender(t),e}if(AjaxAppender.prototype=new Appender,AjaxAppender.prototype.defaults={waitForResponse:!1,timed:!1,timerInterval:1e3,batchSize:1,sendAllOnUnload:!1,requestSuccessCallback:null,failCallback:null,postVarName:"data",contentType:"application/x-www-form-urlencoded"},AjaxAppender.prototype.layout=new HttpPostDataLayout,AjaxAppender.prototype.toString=function(){return"AjaxAppender"},log4javascript.AjaxAppender=AjaxAppender,function(){var e=[],t=1;function n(e,t,n,r,o){this.create(!1,null,e,t,n,r,o,this.defaults.focusPopUp)}function r(e,t,n,r,o,i){this.create(!0,e,t,n,r,o,i,!1)}(ConsoleAppender=function(){}).prototype=new Appender,ConsoleAppender.prototype.create=function(n,r,o,i,a,s,l,c){var u=this,d=!1,p=!1,h=!1,f=!1,g=[],m=!0,v=t++;i=extractBooleanFromParam(i,this.defaults.initiallyMinimized),o=extractBooleanFromParam(o,this.defaults.lazyInit),a=extractBooleanFromParam(a,this.defaults.useDocumentWrite);var y=this.defaults.newestMessageAtTop,b=this.defaults.scrollToLatestMessage;s=s||this.defaults.width,l=l||this.defaults.height;var w,C,E,x,L,S=this.defaults.maxMessages,T=this.defaults.showCommandLine,A=this.defaults.commandLineObjectExpansionDepth,M=this.defaults.showHideButton,I=this.defaults.showCloseButton;this.setLayout(this.defaults.layout);var k=n?"InPageAppender":"PopUpAppender",R=function(e){return!p||(handleError(k+": configuration option '"+e+"' may not be set after the appender has been initialized"),!1)},D=function(){return h&&m&&!f};this.isNewestMessageAtTop=function(){return y},this.setNewestMessageAtTop=function(e){y=bool(e),D()&&x().setNewestAtTop(y)},this.isScrollToLatestMessage=function(){return b},this.setScrollToLatestMessage=function(e){b=bool(e),D()&&x().setScrollToLatest(b)},this.getWidth=function(){return s},this.setWidth=function(e){R("width")&&(s=extractStringFromParam(e,s))},this.getHeight=function(){return l},this.setHeight=function(e){R("height")&&(l=extractStringFromParam(e,l))},this.getMaxMessages=function(){return S},this.setMaxMessages=function(e){S=extractIntFromParam(e,S),D()&&x().setMaxMessages(S)},this.isShowCommandLine=function(){return T},this.setShowCommandLine=function(e){T=bool(e),D()&&x().setShowCommandLine(T)},this.isShowHideButton=function(){return M},this.setShowHideButton=function(e){M=bool(e),D()&&x().setShowHideButton(M)},this.isShowCloseButton=function(){return I},this.setShowCloseButton=function(e){I=bool(e),D()&&x().setShowCloseButton(I)},this.getCommandLineObjectExpansionDepth=function(){return A},this.setCommandLineObjectExpansionDepth=function(e){A=extractIntFromParam(e,A)};var _=i;function N(e,t){this.loggingEvent=e,this.levelName=e.level.name,this.formattedMessage=t}function P(e,t){this.name=e,this.initiallyExpanded=t}function O(){}this.isInitiallyMinimized=function(){return i},this.setInitiallyMinimized=function(e){R("initiallyMinimized")&&(i=bool(e),_=i)},this.isUseDocumentWrite=function(){return a},this.setUseDocumentWrite=function(e){R("useDocumentWrite")&&(a=bool(e))},N.prototype.append=function(){x().log(this.levelName,this.formattedMessage)},P.prototype.append=function(){x().group(this.name,this.initiallyExpanded)},O.prototype.append=function(){x().groupEnd()};var B=function(){E(),d?f&&ee&&C():w(),E()&&F()};this.append=function(e){if(m){var t=u.getLayout().formatWithException(e);g.push(new N(e,t)),B()}},this.group=function(e,t){m&&(g.push(new P(e,t)),B())},this.groupEnd=function(){m&&(g.push(new O),B())};var F=function(){for(;g.length>0;)g.shift().append();c&&x().focus()};this.setAddedToLogger=function(e){this.loggers.push(e),enabled&&!o&&w()},this.clear=function(){D()&&x().clearLog(),g.length=0},this.focus=function(){D()&&x().focus()},this.focusCommandLine=function(){D()&&x().focusCommandLine()},this.focusSearch=function(){D()&&x().focusSearch()};var j=window;this.getCommandWindow=function(){return j},this.setCommandWindow=function(e){j=e},this.executeLastCommand=function(){D()&&x().evalLastCommand()};var $=new PatternLayout("%m");this.getCommandLayout=function(){return $},this.setCommandLayout=function(e){$=e},this.evalCommandAndAppend=function(e){var t={appendResult:!0,isError:!1},n="";try{var r,o;!j.eval&&j.execScript&&j.execScript("null");var i={};for(o=0,len=U.length;o<len;o++)i[U[o][0]]=U[o][1];var a=[],s=function(e){a.push([e,j[e]])};s("appender"),j.appender=u,s("commandReturnValue"),j.commandReturnValue=t,s("commandLineFunctionsHash"),j.commandLineFunctionsHash=i;var l=function(e){s(e),j[e]=function(){return this.commandLineFunctionsHash[e](u,arguments,t)}};for(o=0,len=U.length;o<len;o++)l(U[o][0]);for(j===window&&j.execScript?(s("evalExpr"),s("result"),window.evalExpr=e,j.execScript("window.result=eval(window.evalExpr);"),r=window.result):r=j.eval(e),n=isUndefined(r)?r:formatObjectExpansion(r,A),o=0,len=a.length;o<len;o++)j[a[o][0]]=a[o][1]}catch(e){n="Error evaluating command: "+getExceptionStringRep(e),t.isError=!0}if(t.appendResult){var c=">>> "+e;isUndefined(n)||(c+=newLine+n);var d=t.isError?Level.ERROR:Level.INFO,p=new LoggingEvent(null,new Date,d,[c],null),h=this.getLayout();this.setLayout($),this.append(p),this.setLayout(h)}};var U=e.concat([]);this.addCommandLineFunction=function(e,t){U.push([e,t])},this.storeCommandHistory=function(e){setCookie("log4javascriptCommandHistory",e.join(","))};var H=function(e){var t=['<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">','<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">',"<head>","<title>log4javascript</title>",'<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />',"\x3c!-- Make IE8 behave like IE7, having gone to all the trouble of making IE work --\x3e",'<meta http-equiv="X-UA-Compatible" content="IE=7" />','<script type="text/javascript">var isIe = false, isIePre7 = false;<\/script>','\x3c!--[if IE]><script type="text/javascript">isIe = true<\/script><![endif]--\x3e','\x3c!--[if lt IE 7]><script type="text/javascript">isIePre7 = true<\/script><![endif]--\x3e','<script type="text/javascript">',"//<![CDATA[","var loggingEnabled=true;var logQueuedEventsTimer=null;var logEntries=[];var logEntriesAndSeparators=[];var logItems=[];var renderDelay=100;var unrenderedLogItemsExist=false;var rootGroup,currentGroup=null;var loaded=false;var currentLogItem=null;var logMainContainer;function copyProperties(obj,props){for(var i in props){obj[i]=props[i];}}","function LogItem(){}","LogItem.prototype={mainContainer:null,wrappedContainer:null,unwrappedContainer:null,group:null,appendToLog:function(){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].appendToLog();}","this.group.update();},doRemove:function(doUpdate,removeFromGroup){if(this.rendered){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].remove();}","this.unwrappedElementContainer=null;this.wrappedElementContainer=null;this.mainElementContainer=null;}","if(this.group&&removeFromGroup){this.group.removeChild(this,doUpdate);}","if(this===currentLogItem){currentLogItem=null;}},remove:function(doUpdate,removeFromGroup){this.doRemove(doUpdate,removeFromGroup);},render:function(){},accept:function(visitor){visitor.visit(this);},getUnwrappedDomContainer:function(){return this.group.unwrappedElementContainer.contentDiv;},getWrappedDomContainer:function(){return this.group.wrappedElementContainer.contentDiv;},getMainDomContainer:function(){return this.group.mainElementContainer.contentDiv;}};LogItem.serializedItemKeys={LOG_ENTRY:0,GROUP_START:1,GROUP_END:2};function LogItemContainerElement(){}",'LogItemContainerElement.prototype={appendToLog:function(){var insertBeforeFirst=(newestAtTop&&this.containerDomNode.hasChildNodes());if(insertBeforeFirst){this.containerDomNode.insertBefore(this.mainDiv,this.containerDomNode.firstChild);}else{this.containerDomNode.appendChild(this.mainDiv);}}};function SeparatorElementContainer(containerDomNode){this.containerDomNode=containerDomNode;this.mainDiv=document.createElement("div");this.mainDiv.className="separator";this.mainDiv.innerHTML="&nbsp;";}',"SeparatorElementContainer.prototype=new LogItemContainerElement();SeparatorElementContainer.prototype.remove=function(){this.mainDiv.parentNode.removeChild(this.mainDiv);this.mainDiv=null;};function Separator(){this.rendered=false;}","Separator.prototype=new LogItem();copyProperties(Separator.prototype,{render:function(){var containerDomNode=this.group.contentDiv;if(isIe){this.unwrappedElementContainer=new SeparatorElementContainer(this.getUnwrappedDomContainer());this.wrappedElementContainer=new SeparatorElementContainer(this.getWrappedDomContainer());this.elementContainers=[this.unwrappedElementContainer,this.wrappedElementContainer];}else{this.mainElementContainer=new SeparatorElementContainer(this.getMainDomContainer());this.elementContainers=[this.mainElementContainer];}",'this.content=this.formattedMessage;this.rendered=true;}});function GroupElementContainer(group,containerDomNode,isRoot,isWrapped){this.group=group;this.containerDomNode=containerDomNode;this.isRoot=isRoot;this.isWrapped=isWrapped;this.expandable=false;if(this.isRoot){if(isIe){this.contentDiv=logMainContainer.appendChild(document.createElement("div"));this.contentDiv.id=this.isWrapped?"log_wrapped":"log_unwrapped";}else{this.contentDiv=logMainContainer;}}else{var groupElementContainer=this;this.mainDiv=document.createElement("div");this.mainDiv.className="group";this.headingDiv=this.mainDiv.appendChild(document.createElement("div"));this.headingDiv.className="groupheading";this.expander=this.headingDiv.appendChild(document.createElement("span"));this.expander.className="expander unselectable greyedout";this.expander.unselectable=true;var expanderText=this.group.expanded?"-":"+";this.expanderTextNode=this.expander.appendChild(document.createTextNode(expanderText));this.headingDiv.appendChild(document.createTextNode(" "+this.group.name));this.contentDiv=this.mainDiv.appendChild(document.createElement("div"));var contentCssClass=this.group.expanded?"expanded":"collapsed";this.contentDiv.className="groupcontent "+contentCssClass;this.expander.onclick=function(){if(groupElementContainer.group.expandable){groupElementContainer.group.toggleExpanded();}};}}','GroupElementContainer.prototype=new LogItemContainerElement();copyProperties(GroupElementContainer.prototype,{toggleExpanded:function(){if(!this.isRoot){var oldCssClass,newCssClass,expanderText;if(this.group.expanded){newCssClass="expanded";oldCssClass="collapsed";expanderText="-";}else{newCssClass="collapsed";oldCssClass="expanded";expanderText="+";}',"replaceClass(this.contentDiv,newCssClass,oldCssClass);this.expanderTextNode.nodeValue=expanderText;}},remove:function(){if(!this.isRoot){this.headingDiv=null;this.expander.onclick=null;this.expander=null;this.expanderTextNode=null;this.contentDiv=null;this.containerDomNode=null;this.mainDiv.parentNode.removeChild(this.mainDiv);this.mainDiv=null;}},reverseChildren:function(){var node=null;var childDomNodes=[];while((node=this.contentDiv.firstChild)){this.contentDiv.removeChild(node);childDomNodes.push(node);}",'while((node=childDomNodes.pop())){this.contentDiv.appendChild(node);}},update:function(){if(!this.isRoot){if(this.group.expandable){removeClass(this.expander,"greyedout");}else{addClass(this.expander,"greyedout");}}},clear:function(){if(this.isRoot){this.contentDiv.innerHTML="";}}});function Group(name,isRoot,initiallyExpanded){this.name=name;this.group=null;this.isRoot=isRoot;this.initiallyExpanded=initiallyExpanded;this.elementContainers=[];this.children=[];this.expanded=initiallyExpanded;this.rendered=false;this.expandable=false;}',"Group.prototype=new LogItem();copyProperties(Group.prototype,{addChild:function(logItem){this.children.push(logItem);logItem.group=this;},render:function(){if(isIe){var unwrappedDomContainer,wrappedDomContainer;if(this.isRoot){unwrappedDomContainer=logMainContainer;wrappedDomContainer=logMainContainer;}else{unwrappedDomContainer=this.getUnwrappedDomContainer();wrappedDomContainer=this.getWrappedDomContainer();}","this.unwrappedElementContainer=new GroupElementContainer(this,unwrappedDomContainer,this.isRoot,false);this.wrappedElementContainer=new GroupElementContainer(this,wrappedDomContainer,this.isRoot,true);this.elementContainers=[this.unwrappedElementContainer,this.wrappedElementContainer];}else{var mainDomContainer=this.isRoot?logMainContainer:this.getMainDomContainer();this.mainElementContainer=new GroupElementContainer(this,mainDomContainer,this.isRoot,false);this.elementContainers=[this.mainElementContainer];}","this.rendered=true;},toggleExpanded:function(){this.expanded=!this.expanded;for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].toggleExpanded();}},expand:function(){if(!this.expanded){this.toggleExpanded();}},accept:function(visitor){visitor.visitGroup(this);},reverseChildren:function(){if(this.rendered){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].reverseChildren();}}},update:function(){var previouslyExpandable=this.expandable;this.expandable=(this.children.length!==0);if(this.expandable!==previouslyExpandable){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].update();}}},flatten:function(){var visitor=new GroupFlattener();this.accept(visitor);return visitor.logEntriesAndSeparators;},removeChild:function(child,doUpdate){array_remove(this.children,child);child.group=null;if(doUpdate){this.update();}},remove:function(doUpdate,removeFromGroup){for(var i=0,len=this.children.length;i<len;i++){this.children[i].remove(false,false);}","this.children=[];this.update();if(this===currentGroup){currentGroup=this.group;}","this.doRemove(doUpdate,removeFromGroup);},serialize:function(items){items.push([LogItem.serializedItemKeys.GROUP_START,this.name]);for(var i=0,len=this.children.length;i<len;i++){this.children[i].serialize(items);}","if(this!==currentGroup){items.push([LogItem.serializedItemKeys.GROUP_END]);}},clear:function(){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].clear();}}});function LogEntryElementContainer(){}",'LogEntryElementContainer.prototype=new LogItemContainerElement();copyProperties(LogEntryElementContainer.prototype,{remove:function(){this.doRemove();},doRemove:function(){this.mainDiv.parentNode.removeChild(this.mainDiv);this.mainDiv=null;this.contentElement=null;this.containerDomNode=null;},setContent:function(content,wrappedContent){if(content===this.formattedMessage){this.contentElement.innerHTML="";this.contentElement.appendChild(document.createTextNode(this.formattedMessage));}else{this.contentElement.innerHTML=content;}},setSearchMatch:function(isMatch){var oldCssClass=isMatch?"searchnonmatch":"searchmatch";var newCssClass=isMatch?"searchmatch":"searchnonmatch";replaceClass(this.mainDiv,newCssClass,oldCssClass);},clearSearch:function(){removeClass(this.mainDiv,"searchmatch");removeClass(this.mainDiv,"searchnonmatch");}});function LogEntryWrappedElementContainer(logEntry,containerDomNode){this.logEntry=logEntry;this.containerDomNode=containerDomNode;this.mainDiv=document.createElement("div");this.mainDiv.appendChild(document.createTextNode(this.logEntry.formattedMessage));this.mainDiv.className="logentry wrapped "+this.logEntry.level;this.contentElement=this.mainDiv;}','LogEntryWrappedElementContainer.prototype=new LogEntryElementContainer();LogEntryWrappedElementContainer.prototype.setContent=function(content,wrappedContent){if(content===this.formattedMessage){this.contentElement.innerHTML="";this.contentElement.appendChild(document.createTextNode(this.formattedMessage));}else{this.contentElement.innerHTML=wrappedContent;}};function LogEntryUnwrappedElementContainer(logEntry,containerDomNode){this.logEntry=logEntry;this.containerDomNode=containerDomNode;this.mainDiv=document.createElement("div");this.mainDiv.className="logentry unwrapped "+this.logEntry.level;this.pre=this.mainDiv.appendChild(document.createElement("pre"));this.pre.appendChild(document.createTextNode(this.logEntry.formattedMessage));this.pre.className="unwrapped";this.contentElement=this.pre;}','LogEntryUnwrappedElementContainer.prototype=new LogEntryElementContainer();LogEntryUnwrappedElementContainer.prototype.remove=function(){this.doRemove();this.pre=null;};function LogEntryMainElementContainer(logEntry,containerDomNode){this.logEntry=logEntry;this.containerDomNode=containerDomNode;this.mainDiv=document.createElement("div");this.mainDiv.className="logentry nonielogentry "+this.logEntry.level;this.contentElement=this.mainDiv.appendChild(document.createElement("span"));this.contentElement.appendChild(document.createTextNode(this.logEntry.formattedMessage));}',"LogEntryMainElementContainer.prototype=new LogEntryElementContainer();function LogEntry(level,formattedMessage){this.level=level;this.formattedMessage=formattedMessage;this.rendered=false;}",'LogEntry.prototype=new LogItem();copyProperties(LogEntry.prototype,{render:function(){var logEntry=this;var containerDomNode=this.group.contentDiv;if(isIe){this.formattedMessage=this.formattedMessage.replace(/\\r\\n/g,"\\r");this.unwrappedElementContainer=new LogEntryUnwrappedElementContainer(this,this.getUnwrappedDomContainer());this.wrappedElementContainer=new LogEntryWrappedElementContainer(this,this.getWrappedDomContainer());this.elementContainers=[this.unwrappedElementContainer,this.wrappedElementContainer];}else{this.mainElementContainer=new LogEntryMainElementContainer(this,this.getMainDomContainer());this.elementContainers=[this.mainElementContainer];}','this.content=this.formattedMessage;this.rendered=true;},setContent:function(content,wrappedContent){if(content!=this.content){if(isIe&&(content!==this.formattedMessage)){content=content.replace(/\\r\\n/g,"\\r");}',"for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].setContent(content,wrappedContent);}",'this.content=content;}},getSearchMatches:function(){var matches=[];var i,len;if(isIe){var unwrappedEls=getElementsByClass(this.unwrappedElementContainer.mainDiv,"searchterm","span");var wrappedEls=getElementsByClass(this.wrappedElementContainer.mainDiv,"searchterm","span");for(i=0,len=unwrappedEls.length;i<len;i++){matches[i]=new Match(this.level,null,unwrappedEls[i],wrappedEls[i]);}}else{var els=getElementsByClass(this.mainElementContainer.mainDiv,"searchterm","span");for(i=0,len=els.length;i<len;i++){matches[i]=new Match(this.level,els[i]);}}',"return matches;},setSearchMatch:function(isMatch){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].setSearchMatch(isMatch);}},clearSearch:function(){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].clearSearch();}},accept:function(visitor){visitor.visitLogEntry(this);},serialize:function(items){items.push([LogItem.serializedItemKeys.LOG_ENTRY,this.level,this.formattedMessage]);}});function LogItemVisitor(){}","LogItemVisitor.prototype={visit:function(logItem){},visitParent:function(logItem){if(logItem.group){logItem.group.accept(this);}},visitChildren:function(logItem){for(var i=0,len=logItem.children.length;i<len;i++){logItem.children[i].accept(this);}},visitLogEntry:function(logEntry){this.visit(logEntry);},visitSeparator:function(separator){this.visit(separator);},visitGroup:function(group){this.visit(group);}};function GroupFlattener(){this.logEntriesAndSeparators=[];}",'GroupFlattener.prototype=new LogItemVisitor();GroupFlattener.prototype.visitGroup=function(group){this.visitChildren(group);};GroupFlattener.prototype.visitLogEntry=function(logEntry){this.logEntriesAndSeparators.push(logEntry);};GroupFlattener.prototype.visitSeparator=function(separator){this.logEntriesAndSeparators.push(separator);};window.onload=function(){if(location.search){var queryBits=unescape(location.search).substr(1).split("&"),nameValueBits;for(var i=0,len=queryBits.length;i<len;i++){nameValueBits=queryBits[i].split("=");if(nameValueBits[0]=="log4javascript_domain"){document.domain=nameValueBits[1];break;}}}','logMainContainer=$("log");if(isIePre7){addClass(logMainContainer,"oldIe");}','rootGroup=new Group("root",true);rootGroup.render();currentGroup=rootGroup;setCommandInputWidth();setLogContainerHeight();toggleLoggingEnabled();toggleSearchEnabled();toggleSearchFilter();toggleSearchHighlight();applyFilters();checkAllLevels();toggleWrap();toggleNewestAtTop();toggleScrollToLatest();renderQueuedLogItems();loaded=true;$("command").value="";$("command").autocomplete="off";$("command").onkeydown=function(evt){evt=getEvent(evt);if(evt.keyCode==10||evt.keyCode==13){evalCommandLine();stopPropagation(evt);}else if(evt.keyCode==27){this.value="";this.focus();}else if(evt.keyCode==38&&commandHistory.length>0){currentCommandIndex=Math.max(0,currentCommandIndex-1);this.value=commandHistory[currentCommandIndex];moveCaretToEnd(this);}else if(evt.keyCode==40&&commandHistory.length>0){currentCommandIndex=Math.min(commandHistory.length-1,currentCommandIndex+1);this.value=commandHistory[currentCommandIndex];moveCaretToEnd(this);}};$("command").onkeypress=function(evt){evt=getEvent(evt);if(evt.keyCode==38&&commandHistory.length>0&&evt.preventDefault){evt.preventDefault();}};$("command").onkeyup=function(evt){evt=getEvent(evt);if(evt.keyCode==27&&evt.preventDefault){evt.preventDefault();this.focus();}};document.onkeydown=function keyEventHandler(evt){evt=getEvent(evt);switch(evt.keyCode){case 69:if(evt.shiftKey&&(evt.ctrlKey||evt.metaKey)){evalLastCommand();cancelKeyEvent(evt);return false;}',"break;case 75:if(evt.shiftKey&&(evt.ctrlKey||evt.metaKey)){focusSearch();cancelKeyEvent(evt);return false;}","break;case 40:case 76:if(evt.shiftKey&&(evt.ctrlKey||evt.metaKey)){focusCommandLine();cancelKeyEvent(evt);return false;}","break;}};setTimeout(setLogContainerHeight,20);setShowCommandLine(showCommandLine);doSearch();};window.onunload=function(){if(mainWindowExists()){appender.unload();}",'appender=null;};function toggleLoggingEnabled(){setLoggingEnabled($("enableLogging").checked);}',"function setLoggingEnabled(enable){loggingEnabled=enable;}","var appender=null;function setAppender(appenderParam){appender=appenderParam;}",'function setShowCloseButton(showCloseButton){$("closeButton").style.display=showCloseButton?"inline":"none";}','function setShowHideButton(showHideButton){$("hideButton").style.display=showHideButton?"inline":"none";}',"var newestAtTop=false;function LogItemContentReverser(){}","LogItemContentReverser.prototype=new LogItemVisitor();LogItemContentReverser.prototype.visitGroup=function(group){group.reverseChildren();this.visitChildren(group);};function setNewestAtTop(isNewestAtTop){var oldNewestAtTop=newestAtTop;var i,iLen,j,jLen;newestAtTop=Boolean(isNewestAtTop);if(oldNewestAtTop!=newestAtTop){var visitor=new LogItemContentReverser();rootGroup.accept(visitor);if(currentSearch){var currentMatch=currentSearch.matches[currentMatchIndex];var matchIndex=0;var matches=[];var actOnLogEntry=function(logEntry){var logEntryMatches=logEntry.getSearchMatches();for(j=0,jLen=logEntryMatches.length;j<jLen;j++){matches[matchIndex]=logEntryMatches[j];if(currentMatch&&logEntryMatches[j].equals(currentMatch)){currentMatchIndex=matchIndex;}","matchIndex++;}};if(newestAtTop){for(i=logEntries.length-1;i>=0;i--){actOnLogEntry(logEntries[i]);}}else{for(i=0,iLen=logEntries.length;i<iLen;i++){actOnLogEntry(logEntries[i]);}}","currentSearch.matches=matches;if(currentMatch){currentMatch.setCurrent();}}else if(scrollToLatest){doScrollToLatest();}}",'$("newestAtTop").checked=isNewestAtTop;}','function toggleNewestAtTop(){var isNewestAtTop=$("newestAtTop").checked;setNewestAtTop(isNewestAtTop);}',"var scrollToLatest=true;function setScrollToLatest(isScrollToLatest){scrollToLatest=isScrollToLatest;if(scrollToLatest){doScrollToLatest();}",'$("scrollToLatest").checked=isScrollToLatest;}','function toggleScrollToLatest(){var isScrollToLatest=$("scrollToLatest").checked;setScrollToLatest(isScrollToLatest);}','function doScrollToLatest(){var l=logMainContainer;if(typeof l.scrollTop!="undefined"){if(newestAtTop){l.scrollTop=0;}else{var latestLogEntry=l.lastChild;if(latestLogEntry){l.scrollTop=l.scrollHeight;}}}}',"var closeIfOpenerCloses=true;function setCloseIfOpenerCloses(isCloseIfOpenerCloses){closeIfOpenerCloses=isCloseIfOpenerCloses;}","var maxMessages=null;function setMaxMessages(max){maxMessages=max;pruneLogEntries();}",'var showCommandLine=false;function setShowCommandLine(isShowCommandLine){showCommandLine=isShowCommandLine;if(loaded){$("commandLine").style.display=showCommandLine?"block":"none";setCommandInputWidth();setLogContainerHeight();}}','function focusCommandLine(){if(loaded){$("command").focus();}}','function focusSearch(){if(loaded){$("searchBox").focus();}}',"function getLogItems(){var items=[];for(var i=0,len=logItems.length;i<len;i++){logItems[i].serialize(items);}","return items;}","function setLogItems(items){var loggingReallyEnabled=loggingEnabled;loggingEnabled=true;for(var i=0,len=items.length;i<len;i++){switch(items[i][0]){case LogItem.serializedItemKeys.LOG_ENTRY:log(items[i][1],items[i][2]);break;case LogItem.serializedItemKeys.GROUP_START:group(items[i][1]);break;case LogItem.serializedItemKeys.GROUP_END:groupEnd();break;}}","loggingEnabled=loggingReallyEnabled;}","function log(logLevel,formattedMessage){if(loggingEnabled){var logEntry=new LogEntry(logLevel,formattedMessage);logEntries.push(logEntry);logEntriesAndSeparators.push(logEntry);logItems.push(logEntry);currentGroup.addChild(logEntry);if(loaded){if(logQueuedEventsTimer!==null){clearTimeout(logQueuedEventsTimer);}","logQueuedEventsTimer=setTimeout(renderQueuedLogItems,renderDelay);unrenderedLogItemsExist=true;}}}","function renderQueuedLogItems(){logQueuedEventsTimer=null;var pruned=pruneLogEntries();var initiallyHasMatches=currentSearch?currentSearch.hasMatches():false;for(var i=0,len=logItems.length;i<len;i++){if(!logItems[i].rendered){logItems[i].render();logItems[i].appendToLog();if(currentSearch&&(logItems[i]instanceof LogEntry)){currentSearch.applyTo(logItems[i]);}}}","if(currentSearch){if(pruned){if(currentSearch.hasVisibleMatches()){if(currentMatchIndex===null){setCurrentMatchIndex(0);}","displayMatches();}else{displayNoMatches();}}else if(!initiallyHasMatches&&currentSearch.hasVisibleMatches()){setCurrentMatchIndex(0);displayMatches();}}","if(scrollToLatest){doScrollToLatest();}","unrenderedLogItemsExist=false;}","function pruneLogEntries(){if((maxMessages!==null)&&(logEntriesAndSeparators.length>maxMessages)){var numberToDelete=logEntriesAndSeparators.length-maxMessages;var prunedLogEntries=logEntriesAndSeparators.slice(0,numberToDelete);if(currentSearch){currentSearch.removeMatches(prunedLogEntries);}","var group;for(var i=0;i<numberToDelete;i++){group=logEntriesAndSeparators[i].group;array_remove(logItems,logEntriesAndSeparators[i]);array_remove(logEntries,logEntriesAndSeparators[i]);logEntriesAndSeparators[i].remove(true,true);if(group.children.length===0&&group!==currentGroup&&group!==rootGroup){array_remove(logItems,group);group.remove(true,true);}}","logEntriesAndSeparators=array_removeFromStart(logEntriesAndSeparators,numberToDelete);return true;}","return false;}",'function group(name,startExpanded){if(loggingEnabled){initiallyExpanded=(typeof startExpanded==="undefined")?true:Boolean(startExpanded);var newGroup=new Group(name,false,initiallyExpanded);currentGroup.addChild(newGroup);currentGroup=newGroup;logItems.push(newGroup);if(loaded){if(logQueuedEventsTimer!==null){clearTimeout(logQueuedEventsTimer);}',"logQueuedEventsTimer=setTimeout(renderQueuedLogItems,renderDelay);unrenderedLogItemsExist=true;}}}","function groupEnd(){currentGroup=(currentGroup===rootGroup)?rootGroup:currentGroup.group;}","function mainPageReloaded(){currentGroup=rootGroup;var separator=new Separator();logEntriesAndSeparators.push(separator);logItems.push(separator);currentGroup.addChild(separator);}","function closeWindow(){if(appender&&mainWindowExists()){appender.close(true);}else{window.close();}}","function hide(){if(appender&&mainWindowExists()){appender.hide();}}",'var mainWindow=window;var windowId="log4javascriptConsoleWindow_"+new Date().getTime()+"_"+(""+Math.random()).substr(2);function setMainWindow(win){mainWindow=win;mainWindow[windowId]=window;if(opener&&closeIfOpenerCloses){pollOpener();}}',"function pollOpener(){if(closeIfOpenerCloses){if(mainWindowExists()){setTimeout(pollOpener,500);}else{closeWindow();}}}","function mainWindowExists(){try{return(mainWindow&&!mainWindow.closed&&mainWindow[windowId]==window);}catch(ex){}","return false;}",'var logLevels=["TRACE","DEBUG","INFO","WARN","ERROR","FATAL"];function getCheckBox(logLevel){return $("switch_"+logLevel);}','function getIeWrappedLogContainer(){return $("log_wrapped");}','function getIeUnwrappedLogContainer(){return $("log_unwrapped");}',"function applyFilters(){for(var i=0;i<logLevels.length;i++){if(getCheckBox(logLevels[i]).checked){addClass(logMainContainer,logLevels[i]);}else{removeClass(logMainContainer,logLevels[i]);}}","updateSearchFromFilters();}",'function toggleAllLevels(){var turnOn=$("switch_ALL").checked;for(var i=0;i<logLevels.length;i++){getCheckBox(logLevels[i]).checked=turnOn;if(turnOn){addClass(logMainContainer,logLevels[i]);}else{removeClass(logMainContainer,logLevels[i]);}}}','function checkAllLevels(){for(var i=0;i<logLevels.length;i++){if(!getCheckBox(logLevels[i]).checked){getCheckBox("ALL").checked=false;return;}}','getCheckBox("ALL").checked=true;}',"function clearLog(){rootGroup.clear();currentGroup=rootGroup;logEntries=[];logItems=[];logEntriesAndSeparators=[];doSearch();}",'function toggleWrap(){var enable=$("wrap").checked;if(enable){addClass(logMainContainer,"wrap");}else{removeClass(logMainContainer,"wrap");}',"refreshCurrentMatch();}","var searchTimer=null;function scheduleSearch(){try{clearTimeout(searchTimer);}catch(ex){}","searchTimer=setTimeout(doSearch,500);}","function Search(searchTerm,isRegex,searchRegex,isCaseSensitive){this.searchTerm=searchTerm;this.isRegex=isRegex;this.searchRegex=searchRegex;this.isCaseSensitive=isCaseSensitive;this.matches=[];}","Search.prototype={hasMatches:function(){return this.matches.length>0;},hasVisibleMatches:function(){if(this.hasMatches()){for(var i=0;i<this.matches.length;i++){if(this.matches[i].isVisible()){return true;}}}","return false;},match:function(logEntry){var entryText=String(logEntry.formattedMessage);var matchesSearch=false;if(this.isRegex){matchesSearch=this.searchRegex.test(entryText);}else if(this.isCaseSensitive){matchesSearch=(entryText.indexOf(this.searchTerm)>-1);}else{matchesSearch=(entryText.toLowerCase().indexOf(this.searchTerm.toLowerCase())>-1);}","return matchesSearch;},getNextVisibleMatchIndex:function(){for(var i=currentMatchIndex+1;i<this.matches.length;i++){if(this.matches[i].isVisible()){return i;}}","for(i=0;i<=currentMatchIndex;i++){if(this.matches[i].isVisible()){return i;}}","return-1;},getPreviousVisibleMatchIndex:function(){for(var i=currentMatchIndex-1;i>=0;i--){if(this.matches[i].isVisible()){return i;}}","for(var i=this.matches.length-1;i>=currentMatchIndex;i--){if(this.matches[i].isVisible()){return i;}}",'return-1;},applyTo:function(logEntry){var doesMatch=this.match(logEntry);if(doesMatch){logEntry.group.expand();logEntry.setSearchMatch(true);var logEntryContent;var wrappedLogEntryContent;var searchTermReplacementStartTag="<span class=\\"searchterm\\">";var searchTermReplacementEndTag="<"+"/span>";var preTagName=isIe?"pre":"span";var preStartTag="<"+preTagName+" class=\\"pre\\">";var preEndTag="<"+"/"+preTagName+">";var startIndex=0;var searchIndex,matchedText,textBeforeMatch;if(this.isRegex){var flags=this.isCaseSensitive?"g":"gi";var capturingRegex=new RegExp("("+this.searchRegex.source+")",flags);var rnd=(""+Math.random()).substr(2);var startToken="%%s"+rnd+"%%";var endToken="%%e"+rnd+"%%";logEntryContent=logEntry.formattedMessage.replace(capturingRegex,startToken+"$1"+endToken);logEntryContent=escapeHtml(logEntryContent);var result;var searchString=logEntryContent;logEntryContent="";wrappedLogEntryContent="";while((searchIndex=searchString.indexOf(startToken,startIndex))>-1){var endTokenIndex=searchString.indexOf(endToken,searchIndex);matchedText=searchString.substring(searchIndex+startToken.length,endTokenIndex);textBeforeMatch=searchString.substring(startIndex,searchIndex);logEntryContent+=preStartTag+textBeforeMatch+preEndTag;logEntryContent+=searchTermReplacementStartTag+preStartTag+matchedText+',"preEndTag+searchTermReplacementEndTag;if(isIe){wrappedLogEntryContent+=textBeforeMatch+searchTermReplacementStartTag+","matchedText+searchTermReplacementEndTag;}","startIndex=endTokenIndex+endToken.length;}",'logEntryContent+=preStartTag+searchString.substr(startIndex)+preEndTag;if(isIe){wrappedLogEntryContent+=searchString.substr(startIndex);}}else{logEntryContent="";wrappedLogEntryContent="";var searchTermReplacementLength=searchTermReplacementStartTag.length+',"this.searchTerm.length+searchTermReplacementEndTag.length;var searchTermLength=this.searchTerm.length;var searchTermLowerCase=this.searchTerm.toLowerCase();var logTextLowerCase=logEntry.formattedMessage.toLowerCase();while((searchIndex=logTextLowerCase.indexOf(searchTermLowerCase,startIndex))>-1){matchedText=escapeHtml(logEntry.formattedMessage.substr(searchIndex,this.searchTerm.length));textBeforeMatch=escapeHtml(logEntry.formattedMessage.substring(startIndex,searchIndex));var searchTermReplacement=searchTermReplacementStartTag+","preStartTag+matchedText+preEndTag+searchTermReplacementEndTag;logEntryContent+=preStartTag+textBeforeMatch+preEndTag+searchTermReplacement;if(isIe){wrappedLogEntryContent+=textBeforeMatch+searchTermReplacementStartTag+","matchedText+searchTermReplacementEndTag;}","startIndex=searchIndex+searchTermLength;}","var textAfterLastMatch=escapeHtml(logEntry.formattedMessage.substr(startIndex));logEntryContent+=preStartTag+textAfterLastMatch+preEndTag;if(isIe){wrappedLogEntryContent+=textAfterLastMatch;}}","logEntry.setContent(logEntryContent,wrappedLogEntryContent);var logEntryMatches=logEntry.getSearchMatches();this.matches=this.matches.concat(logEntryMatches);}else{logEntry.setSearchMatch(false);logEntry.setContent(logEntry.formattedMessage,logEntry.formattedMessage);}","return doesMatch;},removeMatches:function(logEntries){var matchesToRemoveCount=0;var currentMatchRemoved=false;var matchesToRemove=[];var i,iLen,j,jLen;for(i=0,iLen=this.matches.length;i<iLen;i++){for(j=0,jLen=logEntries.length;j<jLen;j++){if(this.matches[i].belongsTo(logEntries[j])){matchesToRemove.push(this.matches[i]);if(i===currentMatchIndex){currentMatchRemoved=true;}}}}","var newMatch=currentMatchRemoved?null:this.matches[currentMatchIndex];if(currentMatchRemoved){for(i=currentMatchIndex,iLen=this.matches.length;i<iLen;i++){if(this.matches[i].isVisible()&&!array_contains(matchesToRemove,this.matches[i])){newMatch=this.matches[i];break;}}}","for(i=0,iLen=matchesToRemove.length;i<iLen;i++){array_remove(this.matches,matchesToRemove[i]);matchesToRemove[i].remove();}","if(this.hasVisibleMatches()){if(newMatch===null){setCurrentMatchIndex(0);}else{var newMatchIndex=0;for(i=0,iLen=this.matches.length;i<iLen;i++){if(newMatch===this.matches[i]){newMatchIndex=i;break;}}","setCurrentMatchIndex(newMatchIndex);}}else{currentMatchIndex=null;displayNoMatches();}}};function getPageOffsetTop(el,container){var currentEl=el;var y=0;while(currentEl&&currentEl!=container){y+=currentEl.offsetTop;currentEl=currentEl.offsetParent;}","return y;}",'function scrollIntoView(el){var logContainer=logMainContainer;if(!$("wrap").checked){var logContainerLeft=logContainer.scrollLeft;var logContainerRight=logContainerLeft+logContainer.offsetWidth;var elLeft=el.offsetLeft;var elRight=elLeft+el.offsetWidth;if(elLeft<logContainerLeft||elRight>logContainerRight){logContainer.scrollLeft=elLeft-(logContainer.offsetWidth-el.offsetWidth)/2;}}',"var logContainerTop=logContainer.scrollTop;var logContainerBottom=logContainerTop+logContainer.offsetHeight;var elTop=getPageOffsetTop(el)-getToolBarsHeight();var elBottom=elTop+el.offsetHeight;if(elTop<logContainerTop||elBottom>logContainerBottom){logContainer.scrollTop=elTop-(logContainer.offsetHeight-el.offsetHeight)/2;}}","function Match(logEntryLevel,spanInMainDiv,spanInUnwrappedPre,spanInWrappedDiv){this.logEntryLevel=logEntryLevel;this.spanInMainDiv=spanInMainDiv;if(isIe){this.spanInUnwrappedPre=spanInUnwrappedPre;this.spanInWrappedDiv=spanInWrappedDiv;}","this.mainSpan=isIe?spanInUnwrappedPre:spanInMainDiv;}",'Match.prototype={equals:function(match){return this.mainSpan===match.mainSpan;},setCurrent:function(){if(isIe){addClass(this.spanInUnwrappedPre,"currentmatch");addClass(this.spanInWrappedDiv,"currentmatch");var elementToScroll=$("wrap").checked?this.spanInWrappedDiv:this.spanInUnwrappedPre;scrollIntoView(elementToScroll);}else{addClass(this.spanInMainDiv,"currentmatch");scrollIntoView(this.spanInMainDiv);}},belongsTo:function(logEntry){if(isIe){return isDescendant(this.spanInUnwrappedPre,logEntry.unwrappedPre);}else{return isDescendant(this.spanInMainDiv,logEntry.mainDiv);}},setNotCurrent:function(){if(isIe){removeClass(this.spanInUnwrappedPre,"currentmatch");removeClass(this.spanInWrappedDiv,"currentmatch");}else{removeClass(this.spanInMainDiv,"currentmatch");}},isOrphan:function(){return isOrphan(this.mainSpan);},isVisible:function(){return getCheckBox(this.logEntryLevel).checked;},remove:function(){if(isIe){this.spanInUnwrappedPre=null;this.spanInWrappedDiv=null;}else{this.spanInMainDiv=null;}}};var currentSearch=null;var currentMatchIndex=null;function doSearch(){var searchBox=$("searchBox");var searchTerm=searchBox.value;var isRegex=$("searchRegex").checked;var isCaseSensitive=$("searchCaseSensitive").checked;var i;if(searchTerm===""){$("searchReset").disabled=true;$("searchNav").style.display="none";removeClass(document.body,"searching");removeClass(searchBox,"hasmatches");removeClass(searchBox,"nomatches");for(i=0;i<logEntries.length;i++){logEntries[i].clearSearch();logEntries[i].setContent(logEntries[i].formattedMessage,logEntries[i].formattedMessage);}','currentSearch=null;setLogContainerHeight();}else{$("searchReset").disabled=false;$("searchNav").style.display="block";var searchRegex;var regexValid;if(isRegex){try{searchRegex=isCaseSensitive?new RegExp(searchTerm,"g"):new RegExp(searchTerm,"gi");regexValid=true;replaceClass(searchBox,"validregex","invalidregex");searchBox.title="Valid regex";}catch(ex){regexValid=false;replaceClass(searchBox,"invalidregex","validregex");searchBox.title="Invalid regex: "+(ex.message?ex.message:(ex.description?ex.description:"unknown error"));return;}}else{searchBox.title="";removeClass(searchBox,"validregex");removeClass(searchBox,"invalidregex");}','addClass(document.body,"searching");currentSearch=new Search(searchTerm,isRegex,searchRegex,isCaseSensitive);for(i=0;i<logEntries.length;i++){currentSearch.applyTo(logEntries[i]);}',"setLogContainerHeight();if(currentSearch.hasVisibleMatches()){setCurrentMatchIndex(0);displayMatches();}else{displayNoMatches();}}}","function updateSearchFromFilters(){if(currentSearch){if(currentSearch.hasMatches()){if(currentMatchIndex===null){currentMatchIndex=0;}","var currentMatch=currentSearch.matches[currentMatchIndex];if(currentMatch.isVisible()){displayMatches();setCurrentMatchIndex(currentMatchIndex);}else{currentMatch.setNotCurrent();var nextVisibleMatchIndex=currentSearch.getNextVisibleMatchIndex();if(nextVisibleMatchIndex>-1){setCurrentMatchIndex(nextVisibleMatchIndex);displayMatches();}else{displayNoMatches();}}}else{displayNoMatches();}}}","function refreshCurrentMatch(){if(currentSearch&&currentSearch.hasVisibleMatches()){setCurrentMatchIndex(currentMatchIndex);}}",'function displayMatches(){replaceClass($("searchBox"),"hasmatches","nomatches");$("searchBox").title=""+currentSearch.matches.length+" matches found";$("searchNav").style.display="block";setLogContainerHeight();}','function displayNoMatches(){replaceClass($("searchBox"),"nomatches","hasmatches");$("searchBox").title="No matches found";$("searchNav").style.display="none";setLogContainerHeight();}','function toggleSearchEnabled(enable){enable=(typeof enable=="undefined")?!$("searchDisable").checked:enable;$("searchBox").disabled=!enable;$("searchReset").disabled=!enable;$("searchRegex").disabled=!enable;$("searchNext").disabled=!enable;$("searchPrevious").disabled=!enable;$("searchCaseSensitive").disabled=!enable;$("searchNav").style.display=(enable&&($("searchBox").value!=="")&&currentSearch&&currentSearch.hasVisibleMatches())?"block":"none";if(enable){removeClass($("search"),"greyedout");addClass(document.body,"searching");if($("searchHighlight").checked){addClass(logMainContainer,"searchhighlight");}else{removeClass(logMainContainer,"searchhighlight");}','if($("searchFilter").checked){addClass(logMainContainer,"searchfilter");}else{removeClass(logMainContainer,"searchfilter");}','$("searchDisable").checked=!enable;}else{addClass($("search"),"greyedout");removeClass(document.body,"searching");removeClass(logMainContainer,"searchhighlight");removeClass(logMainContainer,"searchfilter");}',"setLogContainerHeight();}",'function toggleSearchFilter(){var enable=$("searchFilter").checked;if(enable){addClass(logMainContainer,"searchfilter");}else{removeClass(logMainContainer,"searchfilter");}',"refreshCurrentMatch();}",'function toggleSearchHighlight(){var enable=$("searchHighlight").checked;if(enable){addClass(logMainContainer,"searchhighlight");}else{removeClass(logMainContainer,"searchhighlight");}}','function clearSearch(){$("searchBox").value="";doSearch();}','function searchNext(){if(currentSearch!==null&&currentMatchIndex!==null){currentSearch.matches[currentMatchIndex].setNotCurrent();var nextMatchIndex=currentSearch.getNextVisibleMatchIndex();if(nextMatchIndex>currentMatchIndex||confirm("Reached the end of the page. Start from the top?")){setCurrentMatchIndex(nextMatchIndex);}}}','function searchPrevious(){if(currentSearch!==null&&currentMatchIndex!==null){currentSearch.matches[currentMatchIndex].setNotCurrent();var previousMatchIndex=currentSearch.getPreviousVisibleMatchIndex();if(previousMatchIndex<currentMatchIndex||confirm("Reached the start of the page. Continue from the bottom?")){setCurrentMatchIndex(previousMatchIndex);}}}',"function setCurrentMatchIndex(index){currentMatchIndex=index;currentSearch.matches[currentMatchIndex].setCurrent();}",'function addClass(el,cssClass){if(!hasClass(el,cssClass)){if(el.className){el.className+=" "+cssClass;}else{el.className=cssClass;}}}','function hasClass(el,cssClass){if(el.className){var classNames=el.className.split(" ");return array_contains(classNames,cssClass);}',"return false;}",'function removeClass(el,cssClass){if(hasClass(el,cssClass)){var existingClasses=el.className.split(" ");var newClasses=[];for(var i=0,len=existingClasses.length;i<len;i++){if(existingClasses[i]!=cssClass){newClasses[newClasses.length]=existingClasses[i];}}','el.className=newClasses.join(" ");}}',"function replaceClass(el,newCssClass,oldCssClass){removeClass(el,oldCssClass);addClass(el,newCssClass);}","function getElementsByClass(el,cssClass,tagName){var elements=el.getElementsByTagName(tagName);var matches=[];for(var i=0,len=elements.length;i<len;i++){if(hasClass(elements[i],cssClass)){matches.push(elements[i]);}}","return matches;}","function $(id){return document.getElementById(id);}","function isDescendant(node,ancestorNode){while(node!=null){if(node===ancestorNode){return true;}","node=node.parentNode;}","return false;}","function isOrphan(node){var currentNode=node;while(currentNode){if(currentNode==document.body){return false;}","currentNode=currentNode.parentNode;}","return true;}",'function escapeHtml(str){return str.replace(/&/g,"&amp;").replace(/[<]/g,"&lt;").replace(/>/g,"&gt;");}',"function getWindowWidth(){if(window.innerWidth){return window.innerWidth;}else if(document.documentElement&&document.documentElement.clientWidth){return document.documentElement.clientWidth;}else if(document.body){return document.body.clientWidth;}","return 0;}","function getWindowHeight(){if(window.innerHeight){return window.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){return document.documentElement.clientHeight;}else if(document.body){return document.body.clientHeight;}","return 0;}",'function getToolBarsHeight(){return $("switches").offsetHeight;}','function getChromeHeight(){var height=getToolBarsHeight();if(showCommandLine){height+=$("commandLine").offsetHeight;}',"return height;}",'function setLogContainerHeight(){if(logMainContainer){var windowHeight=getWindowHeight();$("body").style.height=getWindowHeight()+"px";logMainContainer.style.height=""+','Math.max(0,windowHeight-getChromeHeight())+"px";}}','function setCommandInputWidth(){if(showCommandLine){$("command").style.width=""+Math.max(0,$("commandLineContainer").offsetWidth-','($("evaluateButton").offsetWidth+13))+"px";}}',"window.onresize=function(){setCommandInputWidth();setLogContainerHeight();};if(!Array.prototype.push){Array.prototype.push=function(){for(var i=0,len=arguments.length;i<len;i++){this[this.length]=arguments[i];}","return this.length;};}","if(!Array.prototype.pop){Array.prototype.pop=function(){if(this.length>0){var val=this[this.length-1];this.length=this.length-1;return val;}};}","if(!Array.prototype.shift){Array.prototype.shift=function(){if(this.length>0){var firstItem=this[0];for(var i=0,len=this.length-1;i<len;i++){this[i]=this[i+1];}","this.length=this.length-1;return firstItem;}};}","if(!Array.prototype.splice){Array.prototype.splice=function(startIndex,deleteCount){var itemsAfterDeleted=this.slice(startIndex+deleteCount);var itemsDeleted=this.slice(startIndex,startIndex+deleteCount);this.length=startIndex;var argumentsArray=[];for(var i=0,len=arguments.length;i<len;i++){argumentsArray[i]=arguments[i];}","var itemsToAppend=(argumentsArray.length>2)?itemsAfterDeleted=argumentsArray.slice(2).concat(itemsAfterDeleted):itemsAfterDeleted;for(i=0,len=itemsToAppend.length;i<len;i++){this.push(itemsToAppend[i]);}","return itemsDeleted;};}","function array_remove(arr,val){var index=-1;for(var i=0,len=arr.length;i<len;i++){if(arr[i]===val){index=i;break;}}","if(index>=0){arr.splice(index,1);return index;}else{return false;}}","function array_removeFromStart(array,numberToRemove){if(Array.prototype.splice){array.splice(0,numberToRemove);}else{for(var i=numberToRemove,len=array.length;i<len;i++){array[i-numberToRemove]=array[i];}","array.length=array.length-numberToRemove;}","return array;}","function array_contains(arr,val){for(var i=0,len=arr.length;i<len;i++){if(arr[i]==val){return true;}}","return false;}","function getErrorMessage(ex){if(ex.message){return ex.message;}else if(ex.description){return ex.description;}",'return""+ex;}',"function moveCaretToEnd(input){if(input.setSelectionRange){input.focus();var length=input.value.length;input.setSelectionRange(length,length);}else if(input.createTextRange){var range=input.createTextRange();range.collapse(false);range.select();}","input.focus();}",'function stopPropagation(evt){if(evt.stopPropagation){evt.stopPropagation();}else if(typeof evt.cancelBubble!="undefined"){evt.cancelBubble=true;}}',"function getEvent(evt){return evt?evt:event;}","function getTarget(evt){return evt.target?evt.target:evt.srcElement;}",'function getRelatedTarget(evt){if(evt.relatedTarget){return evt.relatedTarget;}else if(evt.srcElement){switch(evt.type){case"mouseover":return evt.fromElement;case"mouseout":return evt.toElement;default:return evt.srcElement;}}}',"function cancelKeyEvent(evt){evt.returnValue=false;stopPropagation(evt);}",'function evalCommandLine(){var expr=$("command").value;evalCommand(expr);$("command").value="";}',"function evalLastCommand(){if(lastCommand!=null){evalCommand(lastCommand);}}",'var lastCommand=null;var commandHistory=[];var currentCommandIndex=0;function evalCommand(expr){if(appender){appender.evalCommandAndAppend(expr);}else{var prefix=">>> "+expr+"\\r\\n";try{log("INFO",prefix+eval(expr));}catch(ex){log("ERROR",prefix+"Error: "+getErrorMessage(ex));}}',"if(expr!=commandHistory[commandHistory.length-1]){commandHistory.push(expr);if(appender){appender.storeCommandHistory(commandHistory);}}","currentCommandIndex=(expr==commandHistory[currentCommandIndex])?currentCommandIndex+1:commandHistory.length;lastCommand=expr;}","//]]>","<\/script>",'<style type="text/css">',"body{background-color:white;color:black;padding:0;margin:0;font-family:tahoma,verdana,arial,helvetica,sans-serif;overflow:hidden}div#switchesContainer input{margin-bottom:0}div.toolbar{border-top:solid #ffffff 1px;border-bottom:solid #aca899 1px;background-color:#f1efe7;padding:3px 5px;font-size:68.75%}div.toolbar,div#search input{font-family:tahoma,verdana,arial,helvetica,sans-serif}div.toolbar input.button{padding:0 5px;font-size:100%}div.toolbar input.hidden{display:none}div#switches input#clearButton{margin-left:20px}div#levels label{font-weight:bold}div#levels label,div#options label{margin-right:5px}div#levels label#wrapLabel{font-weight:normal}div#search label{margin-right:10px}div#search label.searchboxlabel{margin-right:0}div#search input{font-size:100%}div#search input.validregex{color:green}div#search input.invalidregex{color:red}div#search input.nomatches{color:white;background-color:#ff6666}div#search input.nomatches{color:white;background-color:#ff6666}div#searchNav{display:none}div#commandLine{display:none}div#commandLine input#command{font-size:100%;font-family:Courier New,Courier}div#commandLine input#evaluateButton{}*.greyedout{color:gray !important;border-color:gray !important}*.greyedout *.alwaysenabled{color:black}*.unselectable{-khtml-user-select:none;-moz-user-select:none;user-select:none}div#log{font-family:Courier New,Courier;font-size:75%;width:100%;overflow:auto;clear:both;position:relative}div.group{border-color:#cccccc;border-style:solid;border-width:1px 0 1px 1px;overflow:visible}div.oldIe div.group,div.oldIe div.group *,div.oldIe *.logentry{height:1%}div.group div.groupheading span.expander{border:solid black 1px;font-family:Courier New,Courier;font-size:0.833em;background-color:#eeeeee;position:relative;top:-1px;color:black;padding:0 2px;cursor:pointer;cursor:hand;height:1%}div.group div.groupcontent{margin-left:10px;padding-bottom:2px;overflow:visible}div.group div.expanded{display:block}div.group div.collapsed{display:none}*.logentry{overflow:visible;display:none;white-space:pre}span.pre{white-space:pre}pre.unwrapped{display:inline !important}pre.unwrapped pre.pre,div.wrapped pre.pre{display:inline}div.wrapped pre.pre{white-space:normal}div.wrapped{display:none}body.searching *.logentry span.currentmatch{color:white !important;background-color:green !important}body.searching div.searchhighlight *.logentry span.searchterm{color:black;background-color:yellow}div.wrap *.logentry{white-space:normal !important;border-width:0 0 1px 0;border-color:#dddddd;border-style:dotted}div.wrap #log_wrapped,#log_unwrapped{display:block}div.wrap #log_unwrapped,#log_wrapped{display:none}div.wrap *.logentry span.pre{overflow:visible;white-space:normal}div.wrap *.logentry pre.unwrapped{display:none}div.wrap *.logentry span.wrapped{display:inline}div.searchfilter *.searchnonmatch{display:none !important}div#log *.TRACE,label#label_TRACE{color:#666666}div#log *.DEBUG,label#label_DEBUG{color:green}div#log *.INFO,label#label_INFO{color:#000099}div#log *.WARN,label#label_WARN{color:#999900}div#log *.ERROR,label#label_ERROR{color:red}div#log *.FATAL,label#label_FATAL{color:#660066}div.TRACE#log *.TRACE,div.DEBUG#log *.DEBUG,div.INFO#log *.INFO,div.WARN#log *.WARN,div.ERROR#log *.ERROR,div.FATAL#log *.FATAL{display:block}div#log div.separator{background-color:#cccccc;margin:5px 0;line-height:1px}","</style>","</head>",'<body id="body">','<div id="switchesContainer">','<div id="switches">','<div id="levels" class="toolbar">',"Filters:",'<input type="checkbox" id="switch_TRACE" onclick="applyFilters(); checkAllLevels()" checked="checked" title="Show/hide trace messages" /><label for="switch_TRACE" id="label_TRACE">trace</label>','<input type="checkbox" id="switch_DEBUG" onclick="applyFilters(); checkAllLevels()" checked="checked" title="Show/hide debug messages" /><label for="switch_DEBUG" id="label_DEBUG">debug</label>','<input type="checkbox" id="switch_INFO" onclick="applyFilters(); checkAllLevels()" checked="checked" title="Show/hide info messages" /><label for="switch_INFO" id="label_INFO">info</label>','<input type="checkbox" id="switch_WARN" onclick="applyFilters(); checkAllLevels()" checked="checked" title="Show/hide warn messages" /><label for="switch_WARN" id="label_WARN">warn</label>','<input type="checkbox" id="switch_ERROR" onclick="applyFilters(); checkAllLevels()" checked="checked" title="Show/hide error messages" /><label for="switch_ERROR" id="label_ERROR">error</label>','<input type="checkbox" id="switch_FATAL" onclick="applyFilters(); checkAllLevels()" checked="checked" title="Show/hide fatal messages" /><label for="switch_FATAL" id="label_FATAL">fatal</label>','<input type="checkbox" id="switch_ALL" onclick="toggleAllLevels(); applyFilters()" checked="checked" title="Show/hide all messages" /><label for="switch_ALL" id="label_ALL">all</label>',"</div>",'<div id="search" class="toolbar">','<label for="searchBox" class="searchboxlabel">Search:</label> <input type="text" id="searchBox" onclick="toggleSearchEnabled(true)" onkeyup="scheduleSearch()" size="20" />','<input type="button" id="searchReset" disabled="disabled" value="Reset" onclick="clearSearch()" class="button" title="Reset the search" />','<input type="checkbox" id="searchRegex" onclick="doSearch()" title="If checked, search is treated as a regular expression" /><label for="searchRegex">Regex</label>','<input type="checkbox" id="searchCaseSensitive" onclick="doSearch()" title="If checked, search is case sensitive" /><label for="searchCaseSensitive">Match case</label>','<input type="checkbox" id="searchDisable" onclick="toggleSearchEnabled()" title="Enable/disable search" /><label for="searchDisable" class="alwaysenabled">Disable</label>','<div id="searchNav">','<input type="button" id="searchNext" disabled="disabled" value="Next" onclick="searchNext()" class="button" title="Go to the next matching log entry" />','<input type="button" id="searchPrevious" disabled="disabled" value="Previous" onclick="searchPrevious()" class="button" title="Go to the previous matching log entry" />','<input type="checkbox" id="searchFilter" onclick="toggleSearchFilter()" title="If checked, non-matching log entries are filtered out" /><label for="searchFilter">Filter</label>','<input type="checkbox" id="searchHighlight" onclick="toggleSearchHighlight()" title="Highlight matched search terms" /><label for="searchHighlight" class="alwaysenabled">Highlight all</label>',"</div>","</div>",'<div id="options" class="toolbar">',"Options:",'<input type="checkbox" id="enableLogging" onclick="toggleLoggingEnabled()" checked="checked" title="Enable/disable logging" /><label for="enableLogging" id="enableLoggingLabel">Log</label>','<input type="checkbox" id="wrap" onclick="toggleWrap()" title="Enable / disable word wrap" /><label for="wrap" id="wrapLabel">Wrap</label>','<input type="checkbox" id="newestAtTop" onclick="toggleNewestAtTop()" title="If checked, causes newest messages to appear at the top" /><label for="newestAtTop" id="newestAtTopLabel">Newest at the top</label>','<input type="checkbox" id="scrollToLatest" onclick="toggleScrollToLatest()" checked="checked" title="If checked, window automatically scrolls to a new message when it is added" /><label for="scrollToLatest" id="scrollToLatestLabel">Scroll to latest</label>','<input type="button" id="clearButton" value="Clear" onclick="clearLog()" class="button" title="Clear all log messages" />','<input type="button" id="hideButton" value="Hide" onclick="hide()" class="hidden button" title="Hide the console" />','<input type="button" id="closeButton" value="Close" onclick="closeWindow()" class="hidden button" title="Close the window" />',"</div>","</div>","</div>",'<div id="log" class="TRACE DEBUG INFO WARN ERROR FATAL"></div>','<div id="commandLine" class="toolbar">','<div id="commandLineContainer">','<input type="text" id="command" title="Enter a JavaScript command here and hit return or press \'Evaluate\'" />','<input type="button" id="evaluateButton" value="Evaluate" class="button" title="Evaluate the command" onclick="evalCommandLine()" />',"</div>","</div>","</body>","</html>",""];e.open();for(var n=0,r=t.length;n<r;n++)e.writeln(t[n]);e.close()};this.setEventTypes(["load","unload"]);var W=function(){var e=x();e.setAppender(u),e.setNewestAtTop(y),e.setScrollToLatest(b),e.setMaxMessages(S),e.setShowCommandLine(T),e.setShowHideButton(M),e.setShowCloseButton(I),e.setMainWindow(window);var t=getCookie("log4javascriptCommandHistory");t&&(e.commandHistory=t.split(","),e.currentCommandIndex=e.commandHistory.length),u.dispatchEvent("load",{win:e})};this.unload=function(){logLog.debug("unload "+this+", caller: "+this.unload.caller),f||(logLog.debug("really doing unload "+this),f=!0,h=!1,p=!1,u.dispatchEvent("unload",{}))};var G=function(e,t,n,r){var o=setInterval((function(){try{f&&clearInterval(o),e(x())&&(clearInterval(o),n())}catch(e){clearInterval(o),m=!1,handleError(r,e)}}),t)},q=function(){var e=document.domain!=location.hostname;return a?"":getBaseUrl()+"console.html"+(e?"?log4javascript_domain="+escape(document.domain):"")};if(n){var V=null,K=[];this.addCssProperty=function(e,t){R("cssProperties")&&K.push([e,t])};var z,Y=!1,X=uniqueId+"_InPageAppender_"+v;this.hide=function(){d&&p&&(D()&&x().$("command").blur(),z.style.display="none",_=!0)},this.show=function(){d&&(p?(z.style.display="block",this.setShowCommandLine(T),_=!1):Y||C(!0))},this.isVisible=function(){return!_&&!f},this.close=function(e){f||e&&!confirm("This will permanently remove the console from the page. No more messages will be logged. Do you wish to continue?")||(z.parentNode.removeChild(z),this.unload())},L=function(){var e="InPageAppender.open: unable to create console iframe";function t(){try{i||u.show(),W(),h=!0,F()}catch(t){m=!1,handleError(e,t)}}function n(){try{var n=function(e){return isLoaded(e)};a&&H(x().document),n(x())?t():G(n,100,t,e)}catch(t){m=!1,handleError(e,t)}}_=!1,(z=V.appendChild(document.createElement("div"))).style.width=s,z.style.height=l,z.style.border="solid gray 1px";for(var r=0,o=K.length;r<o;r++)z.style[K[r][0]]=K[r][1];var c=a?"":" src='"+q()+"'";z.innerHTML="<iframe id='"+X+"' name='"+X+"' width='100%' height='100%' frameborder='0'"+c+" scrolling='no'></iframe>",f=!1;var d=function(e){try{return bool(e)&&bool(e.document)}catch(e){return!1}};d(x())?n():G(d,100,n,e),p=!0},C=function(e){if(e||!i){var t=function(){if(r)try{var e=document.getElementById(r);1==e.nodeType&&(V=e),L()}catch(e){handleError("InPageAppender.init: invalid container element '"+r+"' supplied",e)}else(V=document.createElement("div")).style.position="fixed",V.style.left="0",V.style.right="0",V.style.bottom="0",document.body.appendChild(V),u.addCssProperty("borderWidth","1px 0 0 0"),u.addCssProperty("zIndex",1e6),L()};pageLoaded&&r&&r.appendChild?(V=r,L()):pageLoaded?t():log4javascript.addEventListener("load",t),Y=!0}},w=function(){C(),d=!0},x=function(){var e=window.frames[X];if(e)return e},E=function(){return!(!m||f)&&(p&&!h&&x()&&isLoaded(x())&&(h=!0),h)}}else{var J,Q=u.defaults.useOldPopUp,Z=u.defaults.complainAboutPopUpBlocking,ee=this.defaults.reopenWhenClosed;this.isUseOldPopUp=function(){return Q},this.setUseOldPopUp=function(e){R("useOldPopUp")&&(Q=bool(e))},this.isComplainAboutPopUpBlocking=function(){return Z},this.setComplainAboutPopUpBlocking=function(e){R("complainAboutPopUpBlocking")&&(Z=bool(e))},this.isFocusPopUp=function(){return c},this.setFocusPopUp=function(e){c=bool(e)},this.isReopenWhenClosed=function(){return ee},this.setReopenWhenClosed=function(e){ee=bool(e)},this.close=function(){logLog.debug("close "+this);try{J.close(),this.unload()}catch(e){}},this.hide=function(){logLog.debug("hide "+this),D()&&this.close()},this.show=function(){logLog.debug("show "+this),p||L()},this.isVisible=function(){return E()},L=function(){var e="width="+s+",height="+l+",status,resizable",t="";try{var n=window.frameElement;n&&(t="_"+n.tagName+"_"+(n.name||n.id||""))}catch(e){t="_inaccessibleParentFrame"}var r="PopUp_"+location.host.replace(/[^a-z0-9]/gi,"_")+"_"+v+t;Q&&a||(r=r+"_"+uniqueId);var o=function(e){if(f)return!0;try{return bool(e)&&e.closed}catch(e){}return!1},i=function(){f||u.unload()};function c(){x().setCloseIfOpenerCloses(!Q||!a),W(),h=!0,F(),G(o,500,i,"PopUpAppender.checkPopUpClosed: error checking pop-up window")}try{J=window.open(q(),r,e),f=!1,p=!0,J&&J.document?a&&Q&&isLoaded(J)?(J.mainPageReloaded(),c()):(a&&H(J.document),isLoaded(J)?c():G((function(e){return bool(e)&&isLoaded(e)}),100,c,"PopUpAppender.init: unable to create console window")):(m=!1,logLog.warn("PopUpAppender.init: pop-ups blocked, please unblock to use PopUpAppender"),Z&&handleError("log4javascript: pop-up windows appear to be blocked. Please unblock them to use pop-up logging."))}catch(e){handleError("PopUpAppender.init: error creating pop-up",e)}},C=function(){i||L()},w=function(){C(),d=!0},x=function(){return J},E=function(){if(m&&!isUndefined(J)&&!f){if(J.closed||h&&isUndefined(J.closed))return u.unload(),logLog.debug("PopUpAppender: pop-up closed"),!1;!h&&isLoaded(J)&&(h=!0)}return m&&h&&!f}}this.getConsoleWindow=x},ConsoleAppender.addGlobalCommandLineFunction=function(t,n){e.push([t,n])},n.prototype=new ConsoleAppender,n.prototype.defaults={layout:new PatternLayout("%d{HH:mm:ss} %-5p - %m{1}%n"),initiallyMinimized:!1,focusPopUp:!1,lazyInit:!0,useOldPopUp:!0,complainAboutPopUpBlocking:!0,newestMessageAtTop:!1,scrollToLatestMessage:!0,width:"600",height:"400",reopenWhenClosed:!1,maxMessages:null,showCommandLine:!0,commandLineObjectExpansionDepth:1,showHideButton:!1,showCloseButton:!0,useDocumentWrite:!0},n.prototype.toString=function(){return"PopUpAppender"},log4javascript.PopUpAppender=n,r.prototype=new ConsoleAppender,r.prototype.defaults={layout:new PatternLayout("%d{HH:mm:ss} %-5p - %m{1}%n"),initiallyMinimized:!1,lazyInit:!0,newestMessageAtTop:!1,scrollToLatestMessage:!0,width:"100%",height:"220px",maxMessages:null,showCommandLine:!0,commandLineObjectExpansionDepth:1,showHideButton:!1,showCloseButton:!1,showLogEntryDeleteButtons:!0,useDocumentWrite:!0},r.prototype.toString=function(){return"InPageAppender"},log4javascript.InPageAppender=r,log4javascript.InlineAppender=r}(),function(){function e(e){var t=0;for(var n in e)t=Math.max(toStr(n).length,t);var r=[];for(n in e){var o,i=" "+padWithSpaces(toStr(n),t+2);try{o=splitIntoLines(toStr(e[n])).join(padWithSpaces(newLine,t+6))}catch(e){o="[Error obtaining property. Details: "+getExceptionMessage(e)+"]"}r.push(i+o)}return r.join(newLine)}var t=1,n=3,r=4,o=9,i=11,a=["script","pre"],s=["br","img","hr","param","link","area","input","col","base","meta"];function l(e,c,u,d,p){var h,f,g,m,v;function y(e){for(var t=e.style.cssText.split(";"),n="",r=0,o=t.length;r<o;r++){var i=t[r].split(":"),a=[];/^\s*$/.test(i[0])||a.push(trim(i[0]).toLowerCase()+":"+trim(i[1])),n=a.join(";")}return n}if("string"!=typeof u&&(u=""),d=!!d,p=!!p,!(c=void 0===c||!!c)||e.nodeType==i){for(h="",f=0,g=e.childNodes.length;f<g;f++)h+=l(e.childNodes[f],!0,u+" ");return h}switch(e.nodeType){case t:var b=e.tagName.toLowerCase();h=d?newLine+u:"",h+="<";var w=(v=e).prefix?v.prefix:v.outerHTML&&new RegExp("<([^:]+):"+v.tagName+"[^>]*>","i").test(v.outerHTML)?RegExp.$1.toLowerCase():"",C=!!w;for(C&&(h+=w+":"),h+=b,f=0,g=e.attributes.length;f<g;f++){var E=e.attributes[f];E.specified&&null!==E.nodeValue&&"style"!==E.nodeName.toLowerCase()&&"string"==typeof E.nodeValue&&0!==E.nodeName.indexOf("_moz")&&(h+=" "+E.nodeName.toLowerCase()+'="',h+=E.nodeValue.toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;"),h+='"')}if(e.style.cssText&&""!==y(e)&&(h+=' style="'+y(e)+'"'),array_contains(s,b)||C&&!e.hasChildNodes())h+="/>";else{h+=">";var x=!(1===e.childNodes.length&&e.childNodes[0].nodeType===n),L=array_contains(a,b);for(f=0,g=e.childNodes.length;f<g;f++)h+=l(e.childNodes[f],!0,u+" ",x,L);var S="</"+b+">";h+=x?newLine+u+S:S}return h;case n:if((m=e).nodeType==n&&/^[ \t\r\n]*$/.test(m.nodeValue))h="";else{if(p)h=e.nodeValue;else{var T=splitIntoLines(trim(e.nodeValue)),A=[];for(f=0,g=T.length;f<g;f++)A[f]=trim(T[f]);h=A.join(newLine+u)}d&&(h=newLine+u+h)}return h;case r:return"<![CDATA["+e.nodeValue+"]]>"+newLine;case o:for(h="",f=0,g=e.childNodes.length;f<g;f++)h+=l(e.childNodes[f],!0,u);return h;default:return""}}ConsoleAppender.addGlobalCommandLineFunction("$",(function(e,t,n){return document.getElementById(t[0])})),ConsoleAppender.addGlobalCommandLineFunction("dir",(function(t,n,r){for(var o=[],i=0,a=n.length;i<a;i++)o[i]=e(n[i]);return o.join(newLine+newLine)})),ConsoleAppender.addGlobalCommandLineFunction("dirxml",(function(e,t,n){for(var r=[],o=0,i=t.length;o<i;o++)r[o]=l(t[o]);return r.join(newLine+newLine)})),ConsoleAppender.addGlobalCommandLineFunction("cd",(function(e,t,n){var r,o;return 0===t.length||""===t[0]?(r=window,o="Command line set to run in main window"):t[0].window==t[0]?(r=t[0],o="Command line set to run in frame '"+t[0].name+"'"):(r=window.frames[t[0]])?o="Command line set to run in frame '"+t[0]+"'":(n.isError=!0,o="Frame '"+t[0]+"' does not exist",r=e.getCommandWindow()),e.setCommandWindow(r),o})),ConsoleAppender.addGlobalCommandLineFunction("clear",(function(e,t,n){n.appendResult=!1,e.clear()})),ConsoleAppender.addGlobalCommandLineFunction("keys",(function(e,t,n){var r=[];for(var o in t[0])r.push(o);return r})),ConsoleAppender.addGlobalCommandLineFunction("values",(function(e,t,n){var r=[];for(var o in t[0])try{r.push(t[0][o])}catch(e){logLog.warn("values(): Unable to obtain value for key "+o+". Details: "+getExceptionMessage(e))}return r})),ConsoleAppender.addGlobalCommandLineFunction("expansionDepth",(function(e,t,n){var r=parseInt(t[0],10);return isNaN(r)||r<0?(n.isError=!0,t[0]+" is not a valid expansion depth"):(e.setCommandLineObjectExpansionDepth(r),"Object expansion depth set to "+r)}))}(),log4javascript.setDocumentReady=function(){pageLoaded=!0,log4javascript.dispatchEvent("load",{})},window.addEventListener)window.addEventListener("load",log4javascript.setDocumentReady,!1);else if(window.attachEvent)window.attachEvent("onload",log4javascript.setDocumentReady);else{var oldOnload=window.onload;"function"!=typeof window.onload?window.onload=log4javascript.setDocumentReady:window.onload=function(e){oldOnload&&oldOnload(e),log4javascript.setDocumentReady()}}return log4javascript},void 0===(__WEBPACK_AMD_DEFINE_RESULT__="function"==typeof(__WEBPACK_AMD_DEFINE_FACTORY__=factory)?__WEBPACK_AMD_DEFINE_FACTORY__.call(exports,__webpack_require__,exports,module):__WEBPACK_AMD_DEFINE_FACTORY__)||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)},function(e,t,n){ + */ +;(function (factory) { + var registeredInModuleLoader; + if (true) { + !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : + __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + registeredInModuleLoader = true; + } + if (true) { + module.exports = factory(); + registeredInModuleLoader = true; + } + if (!registeredInModuleLoader) { + var OldCookies = window.Cookies; + var api = window.Cookies = factory(); + api.noConflict = function () { + window.Cookies = OldCookies; + return api; + }; + } +}(function () { + function extend () { + var i = 0; + var result = {}; + for (; i < arguments.length; i++) { + var attributes = arguments[ i ]; + for (var key in attributes) { + result[key] = attributes[key]; + } + } + return result; + } + + function decode (s) { + return s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent); + } + + function init (converter) { + function api() {} + + function set (key, value, attributes) { + if (typeof document === 'undefined') { + return; + } + + attributes = extend({ + path: '/' + }, api.defaults, attributes); + + if (typeof attributes.expires === 'number') { + attributes.expires = new Date(new Date() * 1 + attributes.expires * 864e+5); + } + + // We're using "expires" because "max-age" is not supported by IE + attributes.expires = attributes.expires ? attributes.expires.toUTCString() : ''; + + try { + var result = JSON.stringify(value); + if (/^[\{\[]/.test(result)) { + value = result; + } + } catch (e) {} + + value = converter.write ? + converter.write(value, key) : + encodeURIComponent(String(value)) + .replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent); + + key = encodeURIComponent(String(key)) + .replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent) + .replace(/[\(\)]/g, escape); + + var stringifiedAttributes = ''; + for (var attributeName in attributes) { + if (!attributes[attributeName]) { + continue; + } + stringifiedAttributes += '; ' + attributeName; + if (attributes[attributeName] === true) { + continue; + } + + // Considers RFC 6265 section 5.2: + // ... + // 3. If the remaining unparsed-attributes contains a %x3B (";") + // character: + // Consume the characters of the unparsed-attributes up to, + // not including, the first %x3B (";") character. + // ... + stringifiedAttributes += '=' + attributes[attributeName].split(';')[0]; + } + + return (document.cookie = key + '=' + value + stringifiedAttributes); + } + + function get (key, json) { + if (typeof document === 'undefined') { + return; + } + + var jar = {}; + // To prevent the for loop in the first place assign an empty array + // in case there are no cookies at all. + var cookies = document.cookie ? document.cookie.split('; ') : []; + var i = 0; + + for (; i < cookies.length; i++) { + var parts = cookies[i].split('='); + var cookie = parts.slice(1).join('='); + + if (!json && cookie.charAt(0) === '"') { + cookie = cookie.slice(1, -1); + } + + try { + var name = decode(parts[0]); + cookie = (converter.read || converter)(cookie, name) || + decode(cookie); + + if (json) { + try { + cookie = JSON.parse(cookie); + } catch (e) {} + } + + jar[name] = cookie; + + if (key === name) { + break; + } + } catch (e) {} + } + + return key ? jar[key] : jar; + } + + api.set = set; + api.get = function (key) { + return get(key, false /* read as raw */); + }; + api.getJSON = function (key) { + return get(key, true /* read as json */); + }; + api.remove = function (key, attributes) { + set(key, '', extend(attributes, { + expires: -1 + })); + }; + + api.defaults = {}; + + api.withConverter = init; + + return api; + } + + return init(function () {}); +})); + + +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/** + * Copyright 2015 Tim Down. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +(function(factory,root){if(true){!(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : + __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));}else {}})(function(){if(!Array.prototype.push){Array.prototype.push=function(){for(var i=0,len=arguments.length;i<len;i++){this[this.length]=arguments[i];} +return this.length;};} +if(!Array.prototype.shift){Array.prototype.shift=function(){if(this.length>0){var firstItem=this[0];for(var i=0,len=this.length-1;i<len;i++){this[i]=this[i+1];} +this.length=this.length-1;return firstItem;}};} +if(!Array.prototype.splice){Array.prototype.splice=function(startIndex,deleteCount){var itemsAfterDeleted=this.slice(startIndex+deleteCount);var itemsDeleted=this.slice(startIndex,startIndex+deleteCount);this.length=startIndex;var argumentsArray=[];for(var i=0,len=arguments.length;i<len;i++){argumentsArray[i]=arguments[i];} +var itemsToAppend=(argumentsArray.length>2)?itemsAfterDeleted=argumentsArray.slice(2).concat(itemsAfterDeleted):itemsAfterDeleted;for(i=0,len=itemsToAppend.length;i<len;i++){this.push(itemsToAppend[i]);} +return itemsDeleted;};} +function isUndefined(obj){return typeof obj=="undefined";} +function EventSupport(){} +EventSupport.prototype={eventTypes:[],eventListeners:{},setEventTypes:function(eventTypesParam){if(eventTypesParam instanceof Array){this.eventTypes=eventTypesParam;this.eventListeners={};for(var i=0,len=this.eventTypes.length;i<len;i++){this.eventListeners[this.eventTypes[i]]=[];}}else{handleError("log4javascript.EventSupport ["+this+"]: setEventTypes: eventTypes parameter must be an Array");}},addEventListener:function(eventType,listener){if(typeof listener=="function"){if(!array_contains(this.eventTypes,eventType)){handleError("log4javascript.EventSupport ["+this+"]: addEventListener: no event called '"+eventType+"'");} +this.eventListeners[eventType].push(listener);}else{handleError("log4javascript.EventSupport ["+this+"]: addEventListener: listener must be a function");}},removeEventListener:function(eventType,listener){if(typeof listener=="function"){if(!array_contains(this.eventTypes,eventType)){handleError("log4javascript.EventSupport ["+this+"]: removeEventListener: no event called '"+eventType+"'");} +array_remove(this.eventListeners[eventType],listener);}else{handleError("log4javascript.EventSupport ["+this+"]: removeEventListener: listener must be a function");}},dispatchEvent:function(eventType,eventArgs){if(array_contains(this.eventTypes,eventType)){var listeners=this.eventListeners[eventType];for(var i=0,len=listeners.length;i<len;i++){listeners[i](this,eventType,eventArgs);}}else{handleError("log4javascript.EventSupport ["+this+"]: dispatchEvent: no event called '"+eventType+"'");}}};var applicationStartDate=new Date();var uniqueId="log4javascript_"+applicationStartDate.getTime()+"_"+ +Math.floor(Math.random()*100000000);var emptyFunction=function(){};var newLine="\r\n";var pageLoaded=false;function Log4JavaScript(){} +Log4JavaScript.prototype=new EventSupport();var log4javascript=new Log4JavaScript();log4javascript.version="1.4.13";log4javascript.edition="log4javascript";function toStr(obj){if(obj&&obj.toString){return obj.toString();}else{return String(obj);}} +function getExceptionMessage(ex){if(ex.message){return ex.message;}else if(ex.description){return ex.description;}else{return toStr(ex);}} +function getUrlFileName(url){var lastSlashIndex=Math.max(url.lastIndexOf("/"),url.lastIndexOf("\\"));return url.substr(lastSlashIndex+1);} +function getExceptionStringRep(ex){if(ex){var exStr="Exception: "+getExceptionMessage(ex);try{if(ex.lineNumber){exStr+=" on line number "+ex.lineNumber;} +if(ex.fileName){exStr+=" in file "+getUrlFileName(ex.fileName);}}catch(localEx){logLog.warn("Unable to obtain file and line information for error");} +if(showStackTraces&&ex.stack){exStr+=newLine+"Stack trace:"+newLine+ex.stack;} +return exStr;} +return null;} +function bool(obj){return Boolean(obj);} +function trim(str){return str.replace(/^\s+/,"").replace(/\s+$/,"");} +function splitIntoLines(text){var text2=text.replace(/\r\n/g,"\n").replace(/\r/g,"\n");return text2.split("\n");} +var urlEncode=(typeof window.encodeURIComponent!="undefined")?function(str){return encodeURIComponent(str);}:function(str){return escape(str).replace(/\+/g,"%2B").replace(/"/g,"%22").replace(/'/g,"%27").replace(/\//g,"%2F").replace(/=/g,"%3D");};function array_remove(arr,val){var index=-1;for(var i=0,len=arr.length;i<len;i++){if(arr[i]===val){index=i;break;}} +if(index>=0){arr.splice(index,1);return true;}else{return false;}} +function array_contains(arr,val){for(var i=0,len=arr.length;i<len;i++){if(arr[i]==val){return true;}} +return false;} +function extractBooleanFromParam(param,defaultValue){if(isUndefined(param)){return defaultValue;}else{return bool(param);}} +function extractStringFromParam(param,defaultValue){if(isUndefined(param)){return defaultValue;}else{return String(param);}} +function extractIntFromParam(param,defaultValue){if(isUndefined(param)){return defaultValue;}else{try{var value=parseInt(param,10);return isNaN(value)?defaultValue:value;}catch(ex){logLog.warn("Invalid int param "+param,ex);return defaultValue;}}} +function extractFunctionFromParam(param,defaultValue){if(typeof param=="function"){return param;}else{return defaultValue;}} +function isError(err){return(err instanceof Error);} +if(!Function.prototype.apply){Function.prototype.apply=function(obj,args){var methodName="__apply__";if(typeof obj[methodName]!="undefined"){methodName+=String(Math.random()).substr(2);} +obj[methodName]=this;var argsStrings=[];for(var i=0,len=args.length;i<len;i++){argsStrings[i]="args["+i+"]";} +var script="obj."+methodName+"("+argsStrings.join(",")+")";var returnValue=eval(script);delete obj[methodName];return returnValue;};} +if(!Function.prototype.call){Function.prototype.call=function(obj){var args=[];for(var i=1,len=arguments.length;i<len;i++){args[i-1]=arguments[i];} +return this.apply(obj,args);};} +var logLog={quietMode:false,debugMessages:[],setQuietMode:function(quietMode){this.quietMode=bool(quietMode);},numberOfErrors:0,alertAllErrors:false,setAlertAllErrors:function(alertAllErrors){this.alertAllErrors=alertAllErrors;},debug:function(message){this.debugMessages.push(message);},displayDebug:function(){alert(this.debugMessages.join(newLine));},warn:function(message,exception){},error:function(message,exception){if(++this.numberOfErrors==1||this.alertAllErrors){if(!this.quietMode){var alertMessage="log4javascript error: "+message;if(exception){alertMessage+=newLine+newLine+"Original error: "+getExceptionStringRep(exception);} +alert(alertMessage);}}}};log4javascript.logLog=logLog;log4javascript.setEventTypes(["load","error"]);function handleError(message,exception){logLog.error(message,exception);log4javascript.dispatchEvent("error",{"message":message,"exception":exception});} +log4javascript.handleError=handleError;var enabled=!((typeof log4javascript_disabled!="undefined")&&log4javascript_disabled);log4javascript.setEnabled=function(enable){enabled=bool(enable);};log4javascript.isEnabled=function(){return enabled;};var useTimeStampsInMilliseconds=true;log4javascript.setTimeStampsInMilliseconds=function(timeStampsInMilliseconds){useTimeStampsInMilliseconds=bool(timeStampsInMilliseconds);};log4javascript.isTimeStampsInMilliseconds=function(){return useTimeStampsInMilliseconds;};log4javascript.evalInScope=function(expr){return eval(expr);};var showStackTraces=false;log4javascript.setShowStackTraces=function(show){showStackTraces=bool(show);};var Level=function(level,name){this.level=level;this.name=name;};Level.prototype={toString:function(){return this.name;},equals:function(level){return this.level==level.level;},isGreaterOrEqual:function(level){return this.level>=level.level;}};Level.ALL=new Level(Number.MIN_VALUE,"ALL");Level.TRACE=new Level(10000,"TRACE");Level.DEBUG=new Level(20000,"DEBUG");Level.INFO=new Level(30000,"INFO");Level.WARN=new Level(40000,"WARN");Level.ERROR=new Level(50000,"ERROR");Level.FATAL=new Level(60000,"FATAL");Level.OFF=new Level(Number.MAX_VALUE,"OFF");log4javascript.Level=Level;function Timer(name,level){this.name=name;this.level=isUndefined(level)?Level.INFO:level;this.start=new Date();} +Timer.prototype.getElapsedTime=function(){return new Date().getTime()-this.start.getTime();};var anonymousLoggerName="[anonymous]";var defaultLoggerName="[default]";var nullLoggerName="[null]";var rootLoggerName="root";function Logger(name){this.name=name;this.parent=null;this.children=[];var appenders=[];var loggerLevel=null;var isRoot=(this.name===rootLoggerName);var isNull=(this.name===nullLoggerName);var appenderCache=null;var appenderCacheInvalidated=false;this.addChild=function(childLogger){this.children.push(childLogger);childLogger.parent=this;childLogger.invalidateAppenderCache();};var additive=true;this.getAdditivity=function(){return additive;};this.setAdditivity=function(additivity){var valueChanged=(additive!=additivity);additive=additivity;if(valueChanged){this.invalidateAppenderCache();}};this.addAppender=function(appender){if(isNull){handleError("Logger.addAppender: you may not add an appender to the null logger");}else{if(appender instanceof log4javascript.Appender){if(!array_contains(appenders,appender)){appenders.push(appender);appender.setAddedToLogger(this);this.invalidateAppenderCache();}}else{handleError("Logger.addAppender: appender supplied ('"+ +toStr(appender)+"') is not a subclass of Appender");}}};this.removeAppender=function(appender){array_remove(appenders,appender);appender.setRemovedFromLogger(this);this.invalidateAppenderCache();};this.removeAllAppenders=function(){var appenderCount=appenders.length;if(appenderCount>0){for(var i=0;i<appenderCount;i++){appenders[i].setRemovedFromLogger(this);} +appenders.length=0;this.invalidateAppenderCache();}};this.getEffectiveAppenders=function(){if(appenderCache===null||appenderCacheInvalidated){var parentEffectiveAppenders=(isRoot||!this.getAdditivity())?[]:this.parent.getEffectiveAppenders();appenderCache=parentEffectiveAppenders.concat(appenders);appenderCacheInvalidated=false;} +return appenderCache;};this.invalidateAppenderCache=function(){appenderCacheInvalidated=true;for(var i=0,len=this.children.length;i<len;i++){this.children[i].invalidateAppenderCache();}};this.log=function(level,params){if(enabled&&level.isGreaterOrEqual(this.getEffectiveLevel())){var exception;var finalParamIndex=params.length-1;var lastParam=params[finalParamIndex];if(params.length>1&&isError(lastParam)){exception=lastParam;finalParamIndex--;} +var messages=[];for(var i=0;i<=finalParamIndex;i++){messages[i]=params[i];} +var loggingEvent=new LoggingEvent(this,new Date(),level,messages,exception);this.callAppenders(loggingEvent);}};this.callAppenders=function(loggingEvent){var effectiveAppenders=this.getEffectiveAppenders();for(var i=0,len=effectiveAppenders.length;i<len;i++){effectiveAppenders[i].doAppend(loggingEvent);}};this.setLevel=function(level){if(isRoot&&level===null){handleError("Logger.setLevel: you cannot set the level of the root logger to null");}else if(level instanceof Level){loggerLevel=level;}else{handleError("Logger.setLevel: level supplied to logger "+ +this.name+" is not an instance of log4javascript.Level");}};this.getLevel=function(){return loggerLevel;};this.getEffectiveLevel=function(){for(var logger=this;logger!==null;logger=logger.parent){var level=logger.getLevel();if(level!==null){return level;}}};this.group=function(name,initiallyExpanded){if(enabled){var effectiveAppenders=this.getEffectiveAppenders();for(var i=0,len=effectiveAppenders.length;i<len;i++){effectiveAppenders[i].group(name,initiallyExpanded);}}};this.groupEnd=function(){if(enabled){var effectiveAppenders=this.getEffectiveAppenders();for(var i=0,len=effectiveAppenders.length;i<len;i++){effectiveAppenders[i].groupEnd();}}};var timers={};this.time=function(name,level){if(enabled){if(isUndefined(name)){handleError("Logger.time: a name for the timer must be supplied");}else if(level&&!(level instanceof Level)){handleError("Logger.time: level supplied to timer "+ +name+" is not an instance of log4javascript.Level");}else{timers[name]=new Timer(name,level);}}};this.timeEnd=function(name){if(enabled){if(isUndefined(name)){handleError("Logger.timeEnd: a name for the timer must be supplied");}else if(timers[name]){var timer=timers[name];var milliseconds=timer.getElapsedTime();this.log(timer.level,["Timer "+toStr(name)+" completed in "+milliseconds+"ms"]);delete timers[name];}else{logLog.warn("Logger.timeEnd: no timer found with name "+name);}}};this.assert=function(expr){if(enabled&&!expr){var args=[];for(var i=1,len=arguments.length;i<len;i++){args.push(arguments[i]);} +args=(args.length>0)?args:["Assertion Failure"];args.push(newLine);args.push(expr);this.log(Level.ERROR,args);}};this.toString=function(){return"Logger["+this.name+"]";};} +Logger.prototype={trace:function(){this.log(Level.TRACE,arguments);},debug:function(){this.log(Level.DEBUG,arguments);},info:function(){this.log(Level.INFO,arguments);},warn:function(){this.log(Level.WARN,arguments);},error:function(){this.log(Level.ERROR,arguments);},fatal:function(){this.log(Level.FATAL,arguments);},isEnabledFor:function(level){return level.isGreaterOrEqual(this.getEffectiveLevel());},isTraceEnabled:function(){return this.isEnabledFor(Level.TRACE);},isDebugEnabled:function(){return this.isEnabledFor(Level.DEBUG);},isInfoEnabled:function(){return this.isEnabledFor(Level.INFO);},isWarnEnabled:function(){return this.isEnabledFor(Level.WARN);},isErrorEnabled:function(){return this.isEnabledFor(Level.ERROR);},isFatalEnabled:function(){return this.isEnabledFor(Level.FATAL);}};Logger.prototype.trace.isEntryPoint=true;Logger.prototype.debug.isEntryPoint=true;Logger.prototype.info.isEntryPoint=true;Logger.prototype.warn.isEntryPoint=true;Logger.prototype.error.isEntryPoint=true;Logger.prototype.fatal.isEntryPoint=true;var loggers={};var loggerNames=[];var ROOT_LOGGER_DEFAULT_LEVEL=Level.DEBUG;var rootLogger=new Logger(rootLoggerName);rootLogger.setLevel(ROOT_LOGGER_DEFAULT_LEVEL);log4javascript.getRootLogger=function(){return rootLogger;};log4javascript.getLogger=function(loggerName){if(typeof loggerName!="string"){loggerName=anonymousLoggerName;logLog.warn("log4javascript.getLogger: non-string logger name "+ +toStr(loggerName)+" supplied, returning anonymous logger");} +if(loggerName==rootLoggerName){handleError("log4javascript.getLogger: root logger may not be obtained by name");} +if(!loggers[loggerName]){var logger=new Logger(loggerName);loggers[loggerName]=logger;loggerNames.push(loggerName);var lastDotIndex=loggerName.lastIndexOf(".");var parentLogger;if(lastDotIndex>-1){var parentLoggerName=loggerName.substring(0,lastDotIndex);parentLogger=log4javascript.getLogger(parentLoggerName);}else{parentLogger=rootLogger;} +parentLogger.addChild(logger);} +return loggers[loggerName];};var defaultLogger=null;log4javascript.getDefaultLogger=function(){if(!defaultLogger){defaultLogger=createDefaultLogger();} +return defaultLogger;};var nullLogger=null;log4javascript.getNullLogger=function(){if(!nullLogger){nullLogger=new Logger(nullLoggerName);nullLogger.setLevel(Level.OFF);} +return nullLogger;};log4javascript.resetConfiguration=function(){rootLogger.setLevel(ROOT_LOGGER_DEFAULT_LEVEL);loggers={};};var LoggingEvent=function(logger,timeStamp,level,messages,exception){this.logger=logger;this.timeStamp=timeStamp;this.timeStampInMilliseconds=timeStamp.getTime();this.timeStampInSeconds=Math.floor(this.timeStampInMilliseconds/1000);this.milliseconds=this.timeStamp.getMilliseconds();this.level=level;this.messages=messages;this.exception=exception;};LoggingEvent.prototype={getThrowableStrRep:function(){return this.exception?getExceptionStringRep(this.exception):"";},getCombinedMessages:function(){return(this.messages.length==1)?this.messages[0]:this.messages.join(newLine);},toString:function(){return"LoggingEvent["+this.level+"]";}};log4javascript.LoggingEvent=LoggingEvent;var Layout=function(){};Layout.prototype={defaults:{loggerKey:"logger",timeStampKey:"timestamp",millisecondsKey:"milliseconds",levelKey:"level",messageKey:"message",exceptionKey:"exception",urlKey:"url"},loggerKey:"logger",timeStampKey:"timestamp",millisecondsKey:"milliseconds",levelKey:"level",messageKey:"message",exceptionKey:"exception",urlKey:"url",batchHeader:"",batchFooter:"",batchSeparator:"",returnsPostData:false,overrideTimeStampsSetting:false,useTimeStampsInMilliseconds:null,format:function(){handleError("Layout.format: layout supplied has no format() method");},ignoresThrowable:function(){handleError("Layout.ignoresThrowable: layout supplied has no ignoresThrowable() method");},getContentType:function(){return"text/plain";},allowBatching:function(){return true;},setTimeStampsInMilliseconds:function(timeStampsInMilliseconds){this.overrideTimeStampsSetting=true;this.useTimeStampsInMilliseconds=bool(timeStampsInMilliseconds);},isTimeStampsInMilliseconds:function(){return this.overrideTimeStampsSetting?this.useTimeStampsInMilliseconds:useTimeStampsInMilliseconds;},getTimeStampValue:function(loggingEvent){return this.isTimeStampsInMilliseconds()?loggingEvent.timeStampInMilliseconds:loggingEvent.timeStampInSeconds;},getDataValues:function(loggingEvent,combineMessages){var dataValues=[[this.loggerKey,loggingEvent.logger.name],[this.timeStampKey,this.getTimeStampValue(loggingEvent)],[this.levelKey,loggingEvent.level.name],[this.urlKey,window.location.href],[this.messageKey,combineMessages?loggingEvent.getCombinedMessages():loggingEvent.messages]];if(!this.isTimeStampsInMilliseconds()){dataValues.push([this.millisecondsKey,loggingEvent.milliseconds]);} +if(loggingEvent.exception){dataValues.push([this.exceptionKey,getExceptionStringRep(loggingEvent.exception)]);} +if(this.hasCustomFields()){for(var i=0,len=this.customFields.length;i<len;i++){var val=this.customFields[i].value;if(typeof val==="function"){val=val(this,loggingEvent);} +dataValues.push([this.customFields[i].name,val]);}} +return dataValues;},setKeys:function(loggerKey,timeStampKey,levelKey,messageKey,exceptionKey,urlKey,millisecondsKey){this.loggerKey=extractStringFromParam(loggerKey,this.defaults.loggerKey);this.timeStampKey=extractStringFromParam(timeStampKey,this.defaults.timeStampKey);this.levelKey=extractStringFromParam(levelKey,this.defaults.levelKey);this.messageKey=extractStringFromParam(messageKey,this.defaults.messageKey);this.exceptionKey=extractStringFromParam(exceptionKey,this.defaults.exceptionKey);this.urlKey=extractStringFromParam(urlKey,this.defaults.urlKey);this.millisecondsKey=extractStringFromParam(millisecondsKey,this.defaults.millisecondsKey);},setCustomField:function(name,value){var fieldUpdated=false;for(var i=0,len=this.customFields.length;i<len;i++){if(this.customFields[i].name===name){this.customFields[i].value=value;fieldUpdated=true;}} +if(!fieldUpdated){this.customFields.push({"name":name,"value":value});}},hasCustomFields:function(){return(this.customFields.length>0);},formatWithException:function(loggingEvent){var formatted=this.format(loggingEvent);if(loggingEvent.exception&&this.ignoresThrowable()){formatted+=loggingEvent.getThrowableStrRep();} +return formatted;},toString:function(){handleError("Layout.toString: all layouts must override this method");}};log4javascript.Layout=Layout;var Appender=function(){};Appender.prototype=new EventSupport();Appender.prototype.layout=new PatternLayout();Appender.prototype.threshold=Level.ALL;Appender.prototype.loggers=[];Appender.prototype.doAppend=function(loggingEvent){if(enabled&&loggingEvent.level.level>=this.threshold.level){this.append(loggingEvent);}};Appender.prototype.append=function(loggingEvent){};Appender.prototype.setLayout=function(layout){if(layout instanceof Layout){this.layout=layout;}else{handleError("Appender.setLayout: layout supplied to "+ +this.toString()+" is not a subclass of Layout");}};Appender.prototype.getLayout=function(){return this.layout;};Appender.prototype.setThreshold=function(threshold){if(threshold instanceof Level){this.threshold=threshold;}else{handleError("Appender.setThreshold: threshold supplied to "+ +this.toString()+" is not a subclass of Level");}};Appender.prototype.getThreshold=function(){return this.threshold;};Appender.prototype.setAddedToLogger=function(logger){this.loggers.push(logger);};Appender.prototype.setRemovedFromLogger=function(logger){array_remove(this.loggers,logger);};Appender.prototype.group=emptyFunction;Appender.prototype.groupEnd=emptyFunction;Appender.prototype.toString=function(){handleError("Appender.toString: all appenders must override this method");};log4javascript.Appender=Appender;function SimpleLayout(){this.customFields=[];} +SimpleLayout.prototype=new Layout();SimpleLayout.prototype.format=function(loggingEvent){return loggingEvent.level.name+" - "+loggingEvent.getCombinedMessages();};SimpleLayout.prototype.ignoresThrowable=function(){return true;};SimpleLayout.prototype.toString=function(){return"SimpleLayout";};log4javascript.SimpleLayout=SimpleLayout;function NullLayout(){this.customFields=[];} +NullLayout.prototype=new Layout();NullLayout.prototype.format=function(loggingEvent){return loggingEvent.messages;};NullLayout.prototype.ignoresThrowable=function(){return true;};NullLayout.prototype.formatWithException=function(loggingEvent){var messages=loggingEvent.messages,ex=loggingEvent.exception;return ex?messages.concat([ex]):messages;};NullLayout.prototype.toString=function(){return"NullLayout";};log4javascript.NullLayout=NullLayout;function XmlLayout(combineMessages){this.combineMessages=extractBooleanFromParam(combineMessages,true);this.customFields=[];} +XmlLayout.prototype=new Layout();XmlLayout.prototype.isCombinedMessages=function(){return this.combineMessages;};XmlLayout.prototype.getContentType=function(){return"text/xml";};XmlLayout.prototype.escapeCdata=function(str){return str.replace(/\]\]>/,"]]>]]&gt;<![CDATA[");};XmlLayout.prototype.format=function(loggingEvent){var layout=this;var i,len;function formatMessage(message){message=(typeof message==="string")?message:toStr(message);return"<log4javascript:message><![CDATA["+ +layout.escapeCdata(message)+"]]></log4javascript:message>";} +var str="<log4javascript:event logger=\""+loggingEvent.logger.name+"\" timestamp=\""+this.getTimeStampValue(loggingEvent)+"\"";if(!this.isTimeStampsInMilliseconds()){str+=" milliseconds=\""+loggingEvent.milliseconds+"\"";} +str+=" level=\""+loggingEvent.level.name+"\">"+newLine;if(this.combineMessages){str+=formatMessage(loggingEvent.getCombinedMessages());}else{str+="<log4javascript:messages>"+newLine;for(i=0,len=loggingEvent.messages.length;i<len;i++){str+=formatMessage(loggingEvent.messages[i])+newLine;} +str+="</log4javascript:messages>"+newLine;} +if(this.hasCustomFields()){for(i=0,len=this.customFields.length;i<len;i++){str+="<log4javascript:customfield name=\""+ +this.customFields[i].name+"\"><![CDATA["+ +this.customFields[i].value.toString()+"]]></log4javascript:customfield>"+newLine;}} +if(loggingEvent.exception){str+="<log4javascript:exception><![CDATA["+ +getExceptionStringRep(loggingEvent.exception)+"]]></log4javascript:exception>"+newLine;} +str+="</log4javascript:event>"+newLine+newLine;return str;};XmlLayout.prototype.ignoresThrowable=function(){return false;};XmlLayout.prototype.toString=function(){return"XmlLayout";};log4javascript.XmlLayout=XmlLayout;function escapeNewLines(str){return str.replace(/\r\n|\r|\n/g,"\\r\\n");} +function JsonLayout(readable,combineMessages){this.readable=extractBooleanFromParam(readable,false);this.combineMessages=extractBooleanFromParam(combineMessages,true);this.batchHeader=this.readable?"["+newLine:"[";this.batchFooter=this.readable?"]"+newLine:"]";this.batchSeparator=this.readable?","+newLine:",";this.setKeys();this.colon=this.readable?": ":":";this.tab=this.readable?"\t":"";this.lineBreak=this.readable?newLine:"";this.customFields=[];} +JsonLayout.prototype=new Layout();JsonLayout.prototype.isReadable=function(){return this.readable;};JsonLayout.prototype.isCombinedMessages=function(){return this.combineMessages;};JsonLayout.prototype.format=function(loggingEvent){var layout=this;var dataValues=this.getDataValues(loggingEvent,this.combineMessages);var str="{"+this.lineBreak;var i,len;function formatValue(val,prefix,expand){var formattedValue;var valType=typeof val;if(val instanceof Date){formattedValue=String(val.getTime());}else if(expand&&(val instanceof Array)){formattedValue="["+layout.lineBreak;for(var i=0,len=val.length;i<len;i++){var childPrefix=prefix+layout.tab;formattedValue+=childPrefix+formatValue(val[i],childPrefix,false);if(i<val.length-1){formattedValue+=",";} +formattedValue+=layout.lineBreak;} +formattedValue+=prefix+"]";}else if(valType!=="number"&&valType!=="boolean"){formattedValue="\""+escapeNewLines(toStr(val).replace(/\"/g,"\\\""))+"\"";}else{formattedValue=val;} +return formattedValue;} +for(i=0,len=dataValues.length-1;i<=len;i++){str+=this.tab+"\""+dataValues[i][0]+"\""+this.colon+formatValue(dataValues[i][1],this.tab,true);if(i<len){str+=",";} +str+=this.lineBreak;} +str+="}"+this.lineBreak;return str;};JsonLayout.prototype.ignoresThrowable=function(){return false;};JsonLayout.prototype.toString=function(){return"JsonLayout";};JsonLayout.prototype.getContentType=function(){return"application/json";};log4javascript.JsonLayout=JsonLayout;function HttpPostDataLayout(){this.setKeys();this.customFields=[];this.returnsPostData=true;} +HttpPostDataLayout.prototype=new Layout();HttpPostDataLayout.prototype.allowBatching=function(){return false;};HttpPostDataLayout.prototype.format=function(loggingEvent){var dataValues=this.getDataValues(loggingEvent);var queryBits=[];for(var i=0,len=dataValues.length;i<len;i++){var val=(dataValues[i][1]instanceof Date)?String(dataValues[i][1].getTime()):dataValues[i][1];queryBits.push(urlEncode(dataValues[i][0])+"="+urlEncode(val));} +return queryBits.join("&");};HttpPostDataLayout.prototype.ignoresThrowable=function(loggingEvent){return false;};HttpPostDataLayout.prototype.toString=function(){return"HttpPostDataLayout";};log4javascript.HttpPostDataLayout=HttpPostDataLayout;function formatObjectExpansion(obj,depth,indentation){var objectsExpanded=[];function doFormat(obj,depth,indentation){var i,len,childDepth,childIndentation,childLines,expansion,childExpansion;if(!indentation){indentation="";} +function formatString(text){var lines=splitIntoLines(text);for(var j=1,jLen=lines.length;j<jLen;j++){lines[j]=indentation+lines[j];} +return lines.join(newLine);} +if(obj===null){return"null";}else if(typeof obj=="undefined"){return"undefined";}else if(typeof obj=="string"){return formatString(obj);}else if(typeof obj=="object"&&array_contains(objectsExpanded,obj)){try{expansion=toStr(obj);}catch(ex){expansion="Error formatting property. Details: "+getExceptionStringRep(ex);} +return expansion+" [already expanded]";}else if((obj instanceof Array)&&depth>0){objectsExpanded.push(obj);expansion="["+newLine;childDepth=depth-1;childIndentation=indentation+" ";childLines=[];for(i=0,len=obj.length;i<len;i++){try{childExpansion=doFormat(obj[i],childDepth,childIndentation);childLines.push(childIndentation+childExpansion);}catch(ex){childLines.push(childIndentation+"Error formatting array member. Details: "+ +getExceptionStringRep(ex)+"");}} +expansion+=childLines.join(","+newLine)+newLine+indentation+"]";return expansion;}else if(Object.prototype.toString.call(obj)=="[object Date]"){return obj.toString();}else if(typeof obj=="object"&&depth>0){objectsExpanded.push(obj);expansion="{"+newLine;childDepth=depth-1;childIndentation=indentation+" ";childLines=[];for(i in obj){try{childExpansion=doFormat(obj[i],childDepth,childIndentation);childLines.push(childIndentation+i+": "+childExpansion);}catch(ex){childLines.push(childIndentation+i+": Error formatting property. Details: "+ +getExceptionStringRep(ex));}} +expansion+=childLines.join(","+newLine)+newLine+indentation+"}";return expansion;}else{return formatString(toStr(obj));}} +return doFormat(obj,depth,indentation);} +var SimpleDateFormat;(function(){var regex=/('[^']*')|(G+|y+|M+|w+|W+|D+|d+|F+|E+|a+|H+|k+|K+|h+|m+|s+|S+|Z+)|([a-zA-Z]+)|([^a-zA-Z']+)/;var monthNames=["January","February","March","April","May","June","July","August","September","October","November","December"];var dayNames=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var TEXT2=0,TEXT3=1,NUMBER=2,YEAR=3,MONTH=4,TIMEZONE=5;var types={G:TEXT2,y:YEAR,M:MONTH,w:NUMBER,W:NUMBER,D:NUMBER,d:NUMBER,F:NUMBER,E:TEXT3,a:TEXT2,H:NUMBER,k:NUMBER,K:NUMBER,h:NUMBER,m:NUMBER,s:NUMBER,S:NUMBER,Z:TIMEZONE};var ONE_DAY=24*60*60*1000;var ONE_WEEK=7*ONE_DAY;var DEFAULT_MINIMAL_DAYS_IN_FIRST_WEEK=1;var newDateAtMidnight=function(year,month,day){var d=new Date(year,month,day,0,0,0);d.setMilliseconds(0);return d;};Date.prototype.getDifference=function(date){return this.getTime()-date.getTime();};Date.prototype.isBefore=function(d){return this.getTime()<d.getTime();};Date.prototype.getUTCTime=function(){return Date.UTC(this.getFullYear(),this.getMonth(),this.getDate(),this.getHours(),this.getMinutes(),this.getSeconds(),this.getMilliseconds());};Date.prototype.getTimeSince=function(d){return this.getUTCTime()-d.getUTCTime();};Date.prototype.getPreviousSunday=function(){var midday=new Date(this.getFullYear(),this.getMonth(),this.getDate(),12,0,0);var previousSunday=new Date(midday.getTime()-this.getDay()*ONE_DAY);return newDateAtMidnight(previousSunday.getFullYear(),previousSunday.getMonth(),previousSunday.getDate());};Date.prototype.getWeekInYear=function(minimalDaysInFirstWeek){if(isUndefined(this.minimalDaysInFirstWeek)){minimalDaysInFirstWeek=DEFAULT_MINIMAL_DAYS_IN_FIRST_WEEK;} +var previousSunday=this.getPreviousSunday();var startOfYear=newDateAtMidnight(this.getFullYear(),0,1);var numberOfSundays=previousSunday.isBefore(startOfYear)?0:1+Math.floor(previousSunday.getTimeSince(startOfYear)/ONE_WEEK);var numberOfDaysInFirstWeek=7-startOfYear.getDay();var weekInYear=numberOfSundays;if(numberOfDaysInFirstWeek<minimalDaysInFirstWeek){weekInYear--;} +return weekInYear;};Date.prototype.getWeekInMonth=function(minimalDaysInFirstWeek){if(isUndefined(this.minimalDaysInFirstWeek)){minimalDaysInFirstWeek=DEFAULT_MINIMAL_DAYS_IN_FIRST_WEEK;} +var previousSunday=this.getPreviousSunday();var startOfMonth=newDateAtMidnight(this.getFullYear(),this.getMonth(),1);var numberOfSundays=previousSunday.isBefore(startOfMonth)?0:1+Math.floor(previousSunday.getTimeSince(startOfMonth)/ONE_WEEK);var numberOfDaysInFirstWeek=7-startOfMonth.getDay();var weekInMonth=numberOfSundays;if(numberOfDaysInFirstWeek>=minimalDaysInFirstWeek){weekInMonth++;} +return weekInMonth;};Date.prototype.getDayInYear=function(){var startOfYear=newDateAtMidnight(this.getFullYear(),0,1);return 1+Math.floor(this.getTimeSince(startOfYear)/ONE_DAY);};SimpleDateFormat=function(formatString){this.formatString=formatString;};SimpleDateFormat.prototype.setMinimalDaysInFirstWeek=function(days){this.minimalDaysInFirstWeek=days;};SimpleDateFormat.prototype.getMinimalDaysInFirstWeek=function(){return isUndefined(this.minimalDaysInFirstWeek)?DEFAULT_MINIMAL_DAYS_IN_FIRST_WEEK:this.minimalDaysInFirstWeek;};var padWithZeroes=function(str,len){while(str.length<len){str="0"+str;} +return str;};var formatText=function(data,numberOfLetters,minLength){return(numberOfLetters>=4)?data:data.substr(0,Math.max(minLength,numberOfLetters));};var formatNumber=function(data,numberOfLetters){var dataString=""+data;return padWithZeroes(dataString,numberOfLetters);};SimpleDateFormat.prototype.format=function(date){var formattedString="";var result;var searchString=this.formatString;while((result=regex.exec(searchString))){var quotedString=result[1];var patternLetters=result[2];var otherLetters=result[3];var otherCharacters=result[4];if(quotedString){if(quotedString=="''"){formattedString+="'";}else{formattedString+=quotedString.substring(1,quotedString.length-1);}}else if(otherLetters){}else if(otherCharacters){formattedString+=otherCharacters;}else if(patternLetters){var patternLetter=patternLetters.charAt(0);var numberOfLetters=patternLetters.length;var rawData="";switch(patternLetter){case"G":rawData="AD";break;case"y":rawData=date.getFullYear();break;case"M":rawData=date.getMonth();break;case"w":rawData=date.getWeekInYear(this.getMinimalDaysInFirstWeek());break;case"W":rawData=date.getWeekInMonth(this.getMinimalDaysInFirstWeek());break;case"D":rawData=date.getDayInYear();break;case"d":rawData=date.getDate();break;case"F":rawData=1+Math.floor((date.getDate()-1)/7);break;case"E":rawData=dayNames[date.getDay()];break;case"a":rawData=(date.getHours()>=12)?"PM":"AM";break;case"H":rawData=date.getHours();break;case"k":rawData=date.getHours()||24;break;case"K":rawData=date.getHours()%12;break;case"h":rawData=(date.getHours()%12)||12;break;case"m":rawData=date.getMinutes();break;case"s":rawData=date.getSeconds();break;case"S":rawData=date.getMilliseconds();break;case"Z":rawData=date.getTimezoneOffset();break;} +switch(types[patternLetter]){case TEXT2:formattedString+=formatText(rawData,numberOfLetters,2);break;case TEXT3:formattedString+=formatText(rawData,numberOfLetters,3);break;case NUMBER:formattedString+=formatNumber(rawData,numberOfLetters);break;case YEAR:if(numberOfLetters<=3){var dataString=""+rawData;formattedString+=dataString.substr(2,2);}else{formattedString+=formatNumber(rawData,numberOfLetters);} +break;case MONTH:if(numberOfLetters>=3){formattedString+=formatText(monthNames[rawData],numberOfLetters,numberOfLetters);}else{formattedString+=formatNumber(rawData+1,numberOfLetters);} +break;case TIMEZONE:var isPositive=(rawData>0);var prefix=isPositive?"-":"+";var absData=Math.abs(rawData);var hours=""+Math.floor(absData/60);hours=padWithZeroes(hours,2);var minutes=""+(absData%60);minutes=padWithZeroes(minutes,2);formattedString+=prefix+hours+minutes;break;}} +searchString=searchString.substr(result.index+result[0].length);} +return formattedString;};})();log4javascript.SimpleDateFormat=SimpleDateFormat;function PatternLayout(pattern){if(pattern){this.pattern=pattern;}else{this.pattern=PatternLayout.DEFAULT_CONVERSION_PATTERN;} +this.customFields=[];} +PatternLayout.TTCC_CONVERSION_PATTERN="%r %p %c - %m%n";PatternLayout.DEFAULT_CONVERSION_PATTERN="%m%n";PatternLayout.ISO8601_DATEFORMAT="yyyy-MM-dd HH:mm:ss,SSS";PatternLayout.DATETIME_DATEFORMAT="dd MMM yyyy HH:mm:ss,SSS";PatternLayout.ABSOLUTETIME_DATEFORMAT="HH:mm:ss,SSS";PatternLayout.prototype=new Layout();PatternLayout.prototype.format=function(loggingEvent){var regex=/%(-?[0-9]+)?(\.?[0-9]+)?([acdfmMnpr%])(\{([^\}]+)\})?|([^%]+)/;var formattedString="";var result;var searchString=this.pattern;while((result=regex.exec(searchString))){var matchedString=result[0];var padding=result[1];var truncation=result[2];var conversionCharacter=result[3];var specifier=result[5];var text=result[6];if(text){formattedString+=""+text;}else{var replacement="";switch(conversionCharacter){case"a":case"m":var depth=0;if(specifier){depth=parseInt(specifier,10);if(isNaN(depth)){handleError("PatternLayout.format: invalid specifier '"+ +specifier+"' for conversion character '"+conversionCharacter+"' - should be a number");depth=0;}} +var messages=(conversionCharacter==="a")?loggingEvent.messages[0]:loggingEvent.messages;for(var i=0,len=messages.length;i<len;i++){if(i>0&&(replacement.charAt(replacement.length-1)!==" ")){replacement+=" ";} +if(depth===0){replacement+=messages[i];}else{replacement+=formatObjectExpansion(messages[i],depth);}} +break;case"c":var loggerName=loggingEvent.logger.name;if(specifier){var precision=parseInt(specifier,10);var loggerNameBits=loggingEvent.logger.name.split(".");if(precision>=loggerNameBits.length){replacement=loggerName;}else{replacement=loggerNameBits.slice(loggerNameBits.length-precision).join(".");}}else{replacement=loggerName;} +break;case"d":var dateFormat=PatternLayout.ISO8601_DATEFORMAT;if(specifier){dateFormat=specifier;if(dateFormat=="ISO8601"){dateFormat=PatternLayout.ISO8601_DATEFORMAT;}else if(dateFormat=="ABSOLUTE"){dateFormat=PatternLayout.ABSOLUTETIME_DATEFORMAT;}else if(dateFormat=="DATE"){dateFormat=PatternLayout.DATETIME_DATEFORMAT;}} +replacement=(new SimpleDateFormat(dateFormat)).format(loggingEvent.timeStamp);break;case"f":if(this.hasCustomFields()){var fieldIndex=0;if(specifier){fieldIndex=parseInt(specifier,10);if(isNaN(fieldIndex)){handleError("PatternLayout.format: invalid specifier '"+ +specifier+"' for conversion character 'f' - should be a number");}else if(fieldIndex===0){handleError("PatternLayout.format: invalid specifier '"+ +specifier+"' for conversion character 'f' - must be greater than zero");}else if(fieldIndex>this.customFields.length){handleError("PatternLayout.format: invalid specifier '"+ +specifier+"' for conversion character 'f' - there aren't that many custom fields");}else{fieldIndex=fieldIndex-1;}} +var val=this.customFields[fieldIndex].value;if(typeof val=="function"){val=val(this,loggingEvent);} +replacement=val;} +break;case"n":replacement=newLine;break;case"p":replacement=loggingEvent.level.name;break;case"r":replacement=""+loggingEvent.timeStamp.getDifference(applicationStartDate);break;case"%":replacement="%";break;default:replacement=matchedString;break;} +var l;if(truncation){l=parseInt(truncation.substr(1),10);var strLen=replacement.length;if(l<strLen){replacement=replacement.substring(strLen-l,strLen);}} +if(padding){if(padding.charAt(0)=="-"){l=parseInt(padding.substr(1),10);while(replacement.length<l){replacement+=" ";}}else{l=parseInt(padding,10);while(replacement.length<l){replacement=" "+replacement;}}} +formattedString+=replacement;} +searchString=searchString.substr(result.index+result[0].length);} +return formattedString;};PatternLayout.prototype.ignoresThrowable=function(){return true;};PatternLayout.prototype.toString=function(){return"PatternLayout";};log4javascript.PatternLayout=PatternLayout;function AlertAppender(){} +AlertAppender.prototype=new Appender();AlertAppender.prototype.layout=new SimpleLayout();AlertAppender.prototype.append=function(loggingEvent){alert(this.getLayout().formatWithException(loggingEvent));};AlertAppender.prototype.toString=function(){return"AlertAppender";};log4javascript.AlertAppender=AlertAppender;function BrowserConsoleAppender(){} +BrowserConsoleAppender.prototype=new log4javascript.Appender();BrowserConsoleAppender.prototype.layout=new NullLayout();BrowserConsoleAppender.prototype.threshold=Level.DEBUG;BrowserConsoleAppender.prototype.append=function(loggingEvent){var appender=this;var getFormattedMessage=function(concatenate){var formattedMessage=appender.getLayout().formatWithException(loggingEvent);return(typeof formattedMessage=="string")?(concatenate?formattedMessage:[formattedMessage]):(concatenate?formattedMessage.join(" "):formattedMessage);};var console=window.console;if(console&&console.log){var consoleMethodName;if(console.debug&&Level.DEBUG.isGreaterOrEqual(loggingEvent.level)){consoleMethodName="debug";}else if(console.info&&Level.INFO.equals(loggingEvent.level)){consoleMethodName="info";}else if(console.warn&&Level.WARN.equals(loggingEvent.level)){consoleMethodName="warn";}else if(console.error&&loggingEvent.level.isGreaterOrEqual(Level.ERROR)){consoleMethodName="error";}else{consoleMethodName="log";} +if(typeof console[consoleMethodName].apply=="function"){console[consoleMethodName].apply(console,getFormattedMessage(false));}else{console[consoleMethodName](getFormattedMessage(true));}}else if((typeof opera!="undefined")&&opera.postError){opera.postError(getFormattedMessage(true));}};BrowserConsoleAppender.prototype.group=function(name){if(window.console&&window.console.group){window.console.group(name);}};BrowserConsoleAppender.prototype.groupEnd=function(){if(window.console&&window.console.groupEnd){window.console.groupEnd();}};BrowserConsoleAppender.prototype.toString=function(){return"BrowserConsoleAppender";};log4javascript.BrowserConsoleAppender=BrowserConsoleAppender;var xhrFactory=function(){return new XMLHttpRequest();};var xmlHttpFactories=[xhrFactory,function(){return new ActiveXObject("Msxml2.XMLHTTP");},function(){return new ActiveXObject("Microsoft.XMLHTTP");}];var withCredentialsSupported=false;var getXmlHttp=function(errorHandler){var xmlHttp=null,factory;for(var i=0,len=xmlHttpFactories.length;i<len;i++){factory=xmlHttpFactories[i];try{xmlHttp=factory();withCredentialsSupported=(factory==xhrFactory&&("withCredentials"in xmlHttp));getXmlHttp=factory;return xmlHttp;}catch(e){}} +if(errorHandler){errorHandler();}else{handleError("getXmlHttp: unable to obtain XMLHttpRequest object");}};function isHttpRequestSuccessful(xmlHttp){return isUndefined(xmlHttp.status)||xmlHttp.status===0||(xmlHttp.status>=200&&xmlHttp.status<300)||xmlHttp.status==1223;} +function AjaxAppender(url,withCredentials){var appender=this;var isSupported=true;if(!url){handleError("AjaxAppender: URL must be specified in constructor");isSupported=false;} +var timed=this.defaults.timed;var waitForResponse=this.defaults.waitForResponse;var batchSize=this.defaults.batchSize;var timerInterval=this.defaults.timerInterval;var requestSuccessCallback=this.defaults.requestSuccessCallback;var failCallback=this.defaults.failCallback;var postVarName=this.defaults.postVarName;var sendAllOnUnload=this.defaults.sendAllOnUnload;var contentType=this.defaults.contentType;var sessionId=null;var queuedLoggingEvents=[];var queuedRequests=[];var headers=[];var sending=false;var initialized=false;function checkCanConfigure(configOptionName){if(initialized){handleError("AjaxAppender: configuration option '"+ +configOptionName+"' may not be set after the appender has been initialized");return false;} +return true;} +this.getSessionId=function(){return sessionId;};this.setSessionId=function(sessionIdParam){sessionId=extractStringFromParam(sessionIdParam,null);this.layout.setCustomField("sessionid",sessionId);};this.setLayout=function(layoutParam){if(checkCanConfigure("layout")){this.layout=layoutParam;if(sessionId!==null){this.setSessionId(sessionId);}}};this.isTimed=function(){return timed;};this.setTimed=function(timedParam){if(checkCanConfigure("timed")){timed=bool(timedParam);}};this.getTimerInterval=function(){return timerInterval;};this.setTimerInterval=function(timerIntervalParam){if(checkCanConfigure("timerInterval")){timerInterval=extractIntFromParam(timerIntervalParam,timerInterval);}};this.isWaitForResponse=function(){return waitForResponse;};this.setWaitForResponse=function(waitForResponseParam){if(checkCanConfigure("waitForResponse")){waitForResponse=bool(waitForResponseParam);}};this.getBatchSize=function(){return batchSize;};this.setBatchSize=function(batchSizeParam){if(checkCanConfigure("batchSize")){batchSize=extractIntFromParam(batchSizeParam,batchSize);}};this.isSendAllOnUnload=function(){return sendAllOnUnload;};this.setSendAllOnUnload=function(sendAllOnUnloadParam){if(checkCanConfigure("sendAllOnUnload")){sendAllOnUnload=extractBooleanFromParam(sendAllOnUnloadParam,sendAllOnUnload);}};this.setRequestSuccessCallback=function(requestSuccessCallbackParam){requestSuccessCallback=extractFunctionFromParam(requestSuccessCallbackParam,requestSuccessCallback);};this.setFailCallback=function(failCallbackParam){failCallback=extractFunctionFromParam(failCallbackParam,failCallback);};this.getPostVarName=function(){return postVarName;};this.setPostVarName=function(postVarNameParam){if(checkCanConfigure("postVarName")){postVarName=extractStringFromParam(postVarNameParam,postVarName);}};this.getHeaders=function(){return headers;};this.addHeader=function(name,value){if(name.toLowerCase()=="content-type"){contentType=value;}else{headers.push({name:name,value:value});}};function sendAll(){if(isSupported&&enabled){sending=true;var currentRequestBatch;if(waitForResponse){if(queuedRequests.length>0){currentRequestBatch=queuedRequests.shift();sendRequest(preparePostData(currentRequestBatch),sendAll);}else{sending=false;if(timed){scheduleSending();}}}else{while((currentRequestBatch=queuedRequests.shift())){sendRequest(preparePostData(currentRequestBatch));} +sending=false;if(timed){scheduleSending();}}}} +this.sendAll=sendAll;function sendAllRemaining(){var sendingAnything=false;if(isSupported&&enabled){var actualBatchSize=appender.getLayout().allowBatching()?batchSize:1;var currentLoggingEvent;var batchedLoggingEvents=[];while((currentLoggingEvent=queuedLoggingEvents.shift())){batchedLoggingEvents.push(currentLoggingEvent);if(queuedLoggingEvents.length>=actualBatchSize){queuedRequests.push(batchedLoggingEvents);batchedLoggingEvents=[];}} +if(batchedLoggingEvents.length>0){queuedRequests.push(batchedLoggingEvents);} +sendingAnything=(queuedRequests.length>0);waitForResponse=false;timed=false;sendAll();} +return sendingAnything;} +this.sendAllRemaining=sendAllRemaining;function preparePostData(batchedLoggingEvents){var formattedMessages=[];var currentLoggingEvent;var postData="";while((currentLoggingEvent=batchedLoggingEvents.shift())){formattedMessages.push(appender.getLayout().formatWithException(currentLoggingEvent));} +if(batchedLoggingEvents.length==1){postData=formattedMessages.join("");}else{postData=appender.getLayout().batchHeader+ +formattedMessages.join(appender.getLayout().batchSeparator)+ +appender.getLayout().batchFooter;} +if(contentType==appender.defaults.contentType){postData=appender.getLayout().returnsPostData?postData:urlEncode(postVarName)+"="+urlEncode(postData);if(postData.length>0){postData+="&";} +postData+="layout="+urlEncode(appender.getLayout().toString());} +return postData;} +function scheduleSending(){window.setTimeout(sendAll,timerInterval);} +function xmlHttpErrorHandler(){var msg="AjaxAppender: could not create XMLHttpRequest object. AjaxAppender disabled";handleError(msg);isSupported=false;if(failCallback){failCallback(msg);}} +function sendRequest(postData,successCallback){try{var xmlHttp=getXmlHttp(xmlHttpErrorHandler);if(isSupported){xmlHttp.onreadystatechange=function(){if(xmlHttp.readyState==4){if(isHttpRequestSuccessful(xmlHttp)){if(requestSuccessCallback){requestSuccessCallback(xmlHttp);} +if(successCallback){successCallback(xmlHttp);}}else{var msg="AjaxAppender.append: XMLHttpRequest request to URL "+ +url+" returned status code "+xmlHttp.status;handleError(msg);if(failCallback){failCallback(msg);}} +xmlHttp.onreadystatechange=emptyFunction;xmlHttp=null;}};xmlHttp.open("POST",url,true);if(withCredentials&&withCredentialsSupported){xmlHttp.withCredentials=true;} +try{for(var i=0,header;header=headers[i++];){xmlHttp.setRequestHeader(header.name,header.value);} +xmlHttp.setRequestHeader("Content-Type",contentType);}catch(headerEx){var msg="AjaxAppender.append: your browser's XMLHttpRequest implementation"+" does not support setRequestHeader, therefore cannot post data. AjaxAppender disabled";handleError(msg);isSupported=false;if(failCallback){failCallback(msg);} +return;} +xmlHttp.send(postData);}}catch(ex){var errMsg="AjaxAppender.append: error sending log message to "+url;handleError(errMsg,ex);isSupported=false;if(failCallback){failCallback(errMsg+". Details: "+getExceptionStringRep(ex));}}} +this.append=function(loggingEvent){if(isSupported){if(!initialized){init();} +queuedLoggingEvents.push(loggingEvent);var actualBatchSize=this.getLayout().allowBatching()?batchSize:1;if(queuedLoggingEvents.length>=actualBatchSize){var currentLoggingEvent;var batchedLoggingEvents=[];while((currentLoggingEvent=queuedLoggingEvents.shift())){batchedLoggingEvents.push(currentLoggingEvent);} +queuedRequests.push(batchedLoggingEvents);if(!timed&&(!waitForResponse||(waitForResponse&&!sending))){sendAll();}}}};function init(){initialized=true;if(sendAllOnUnload){var oldBeforeUnload=window.onbeforeunload;window.onbeforeunload=function(){if(oldBeforeUnload){oldBeforeUnload();} +sendAllRemaining();};} +if(timed){scheduleSending();}}} +AjaxAppender.prototype=new Appender();AjaxAppender.prototype.defaults={waitForResponse:false,timed:false,timerInterval:1000,batchSize:1,sendAllOnUnload:false,requestSuccessCallback:null,failCallback:null,postVarName:"data",contentType:"application/x-www-form-urlencoded"};AjaxAppender.prototype.layout=new HttpPostDataLayout();AjaxAppender.prototype.toString=function(){return"AjaxAppender";};log4javascript.AjaxAppender=AjaxAppender;function setCookie(name,value,days,path){var expires;path=path?"; path="+path:"";if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));expires="; expires="+date.toGMTString();}else{expires="";} +document.cookie=escape(name)+"="+escape(value)+expires+path;} +function getCookie(name){var nameEquals=escape(name)+"=";var ca=document.cookie.split(";");for(var i=0,len=ca.length;i<len;i++){var c=ca[i];while(c.charAt(0)===" "){c=c.substring(1,c.length);} +if(c.indexOf(nameEquals)===0){return unescape(c.substring(nameEquals.length,c.length));}} +return null;} +function getBaseUrl(){var scripts=document.getElementsByTagName("script");for(var i=0,len=scripts.length;i<len;++i){if(scripts[i].src.indexOf("log4javascript")!=-1){var lastSlash=scripts[i].src.lastIndexOf("/");return(lastSlash==-1)?"":scripts[i].src.substr(0,lastSlash+1);}} +return null;} +function isLoaded(win){try{return bool(win.loaded);}catch(ex){return false;}} +var ConsoleAppender;(function(){var getConsoleHtmlLines=function(){return['<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">','<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">','<head>','<title>log4javascript</title>','<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />','<!-- Make IE8 behave like IE7, having gone to all the trouble of making IE work -->','<meta http-equiv="X-UA-Compatible" content="IE=7" />','<script type="text/javascript">var isIe = false, isIePre7 = false;</script>','<!--[if IE]><script type="text/javascript">isIe = true</script><![endif]-->','<!--[if lt IE 7]><script type="text/javascript">isIePre7 = true</script><![endif]-->','<script type="text/javascript">','//<![CDATA[','var loggingEnabled=true;var logQueuedEventsTimer=null;var logEntries=[];var logEntriesAndSeparators=[];var logItems=[];var renderDelay=100;var unrenderedLogItemsExist=false;var rootGroup,currentGroup=null;var loaded=false;var currentLogItem=null;var logMainContainer;function copyProperties(obj,props){for(var i in props){obj[i]=props[i];}}','function LogItem(){}','LogItem.prototype={mainContainer:null,wrappedContainer:null,unwrappedContainer:null,group:null,appendToLog:function(){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].appendToLog();}','this.group.update();},doRemove:function(doUpdate,removeFromGroup){if(this.rendered){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].remove();}','this.unwrappedElementContainer=null;this.wrappedElementContainer=null;this.mainElementContainer=null;}','if(this.group&&removeFromGroup){this.group.removeChild(this,doUpdate);}','if(this===currentLogItem){currentLogItem=null;}},remove:function(doUpdate,removeFromGroup){this.doRemove(doUpdate,removeFromGroup);},render:function(){},accept:function(visitor){visitor.visit(this);},getUnwrappedDomContainer:function(){return this.group.unwrappedElementContainer.contentDiv;},getWrappedDomContainer:function(){return this.group.wrappedElementContainer.contentDiv;},getMainDomContainer:function(){return this.group.mainElementContainer.contentDiv;}};LogItem.serializedItemKeys={LOG_ENTRY:0,GROUP_START:1,GROUP_END:2};function LogItemContainerElement(){}','LogItemContainerElement.prototype={appendToLog:function(){var insertBeforeFirst=(newestAtTop&&this.containerDomNode.hasChildNodes());if(insertBeforeFirst){this.containerDomNode.insertBefore(this.mainDiv,this.containerDomNode.firstChild);}else{this.containerDomNode.appendChild(this.mainDiv);}}};function SeparatorElementContainer(containerDomNode){this.containerDomNode=containerDomNode;this.mainDiv=document.createElement("div");this.mainDiv.className="separator";this.mainDiv.innerHTML="&nbsp;";}','SeparatorElementContainer.prototype=new LogItemContainerElement();SeparatorElementContainer.prototype.remove=function(){this.mainDiv.parentNode.removeChild(this.mainDiv);this.mainDiv=null;};function Separator(){this.rendered=false;}','Separator.prototype=new LogItem();copyProperties(Separator.prototype,{render:function(){var containerDomNode=this.group.contentDiv;if(isIe){this.unwrappedElementContainer=new SeparatorElementContainer(this.getUnwrappedDomContainer());this.wrappedElementContainer=new SeparatorElementContainer(this.getWrappedDomContainer());this.elementContainers=[this.unwrappedElementContainer,this.wrappedElementContainer];}else{this.mainElementContainer=new SeparatorElementContainer(this.getMainDomContainer());this.elementContainers=[this.mainElementContainer];}','this.content=this.formattedMessage;this.rendered=true;}});function GroupElementContainer(group,containerDomNode,isRoot,isWrapped){this.group=group;this.containerDomNode=containerDomNode;this.isRoot=isRoot;this.isWrapped=isWrapped;this.expandable=false;if(this.isRoot){if(isIe){this.contentDiv=logMainContainer.appendChild(document.createElement("div"));this.contentDiv.id=this.isWrapped?"log_wrapped":"log_unwrapped";}else{this.contentDiv=logMainContainer;}}else{var groupElementContainer=this;this.mainDiv=document.createElement("div");this.mainDiv.className="group";this.headingDiv=this.mainDiv.appendChild(document.createElement("div"));this.headingDiv.className="groupheading";this.expander=this.headingDiv.appendChild(document.createElement("span"));this.expander.className="expander unselectable greyedout";this.expander.unselectable=true;var expanderText=this.group.expanded?"-":"+";this.expanderTextNode=this.expander.appendChild(document.createTextNode(expanderText));this.headingDiv.appendChild(document.createTextNode(" "+this.group.name));this.contentDiv=this.mainDiv.appendChild(document.createElement("div"));var contentCssClass=this.group.expanded?"expanded":"collapsed";this.contentDiv.className="groupcontent "+contentCssClass;this.expander.onclick=function(){if(groupElementContainer.group.expandable){groupElementContainer.group.toggleExpanded();}};}}','GroupElementContainer.prototype=new LogItemContainerElement();copyProperties(GroupElementContainer.prototype,{toggleExpanded:function(){if(!this.isRoot){var oldCssClass,newCssClass,expanderText;if(this.group.expanded){newCssClass="expanded";oldCssClass="collapsed";expanderText="-";}else{newCssClass="collapsed";oldCssClass="expanded";expanderText="+";}','replaceClass(this.contentDiv,newCssClass,oldCssClass);this.expanderTextNode.nodeValue=expanderText;}},remove:function(){if(!this.isRoot){this.headingDiv=null;this.expander.onclick=null;this.expander=null;this.expanderTextNode=null;this.contentDiv=null;this.containerDomNode=null;this.mainDiv.parentNode.removeChild(this.mainDiv);this.mainDiv=null;}},reverseChildren:function(){var node=null;var childDomNodes=[];while((node=this.contentDiv.firstChild)){this.contentDiv.removeChild(node);childDomNodes.push(node);}','while((node=childDomNodes.pop())){this.contentDiv.appendChild(node);}},update:function(){if(!this.isRoot){if(this.group.expandable){removeClass(this.expander,"greyedout");}else{addClass(this.expander,"greyedout");}}},clear:function(){if(this.isRoot){this.contentDiv.innerHTML="";}}});function Group(name,isRoot,initiallyExpanded){this.name=name;this.group=null;this.isRoot=isRoot;this.initiallyExpanded=initiallyExpanded;this.elementContainers=[];this.children=[];this.expanded=initiallyExpanded;this.rendered=false;this.expandable=false;}','Group.prototype=new LogItem();copyProperties(Group.prototype,{addChild:function(logItem){this.children.push(logItem);logItem.group=this;},render:function(){if(isIe){var unwrappedDomContainer,wrappedDomContainer;if(this.isRoot){unwrappedDomContainer=logMainContainer;wrappedDomContainer=logMainContainer;}else{unwrappedDomContainer=this.getUnwrappedDomContainer();wrappedDomContainer=this.getWrappedDomContainer();}','this.unwrappedElementContainer=new GroupElementContainer(this,unwrappedDomContainer,this.isRoot,false);this.wrappedElementContainer=new GroupElementContainer(this,wrappedDomContainer,this.isRoot,true);this.elementContainers=[this.unwrappedElementContainer,this.wrappedElementContainer];}else{var mainDomContainer=this.isRoot?logMainContainer:this.getMainDomContainer();this.mainElementContainer=new GroupElementContainer(this,mainDomContainer,this.isRoot,false);this.elementContainers=[this.mainElementContainer];}','this.rendered=true;},toggleExpanded:function(){this.expanded=!this.expanded;for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].toggleExpanded();}},expand:function(){if(!this.expanded){this.toggleExpanded();}},accept:function(visitor){visitor.visitGroup(this);},reverseChildren:function(){if(this.rendered){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].reverseChildren();}}},update:function(){var previouslyExpandable=this.expandable;this.expandable=(this.children.length!==0);if(this.expandable!==previouslyExpandable){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].update();}}},flatten:function(){var visitor=new GroupFlattener();this.accept(visitor);return visitor.logEntriesAndSeparators;},removeChild:function(child,doUpdate){array_remove(this.children,child);child.group=null;if(doUpdate){this.update();}},remove:function(doUpdate,removeFromGroup){for(var i=0,len=this.children.length;i<len;i++){this.children[i].remove(false,false);}','this.children=[];this.update();if(this===currentGroup){currentGroup=this.group;}','this.doRemove(doUpdate,removeFromGroup);},serialize:function(items){items.push([LogItem.serializedItemKeys.GROUP_START,this.name]);for(var i=0,len=this.children.length;i<len;i++){this.children[i].serialize(items);}','if(this!==currentGroup){items.push([LogItem.serializedItemKeys.GROUP_END]);}},clear:function(){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].clear();}}});function LogEntryElementContainer(){}','LogEntryElementContainer.prototype=new LogItemContainerElement();copyProperties(LogEntryElementContainer.prototype,{remove:function(){this.doRemove();},doRemove:function(){this.mainDiv.parentNode.removeChild(this.mainDiv);this.mainDiv=null;this.contentElement=null;this.containerDomNode=null;},setContent:function(content,wrappedContent){if(content===this.formattedMessage){this.contentElement.innerHTML="";this.contentElement.appendChild(document.createTextNode(this.formattedMessage));}else{this.contentElement.innerHTML=content;}},setSearchMatch:function(isMatch){var oldCssClass=isMatch?"searchnonmatch":"searchmatch";var newCssClass=isMatch?"searchmatch":"searchnonmatch";replaceClass(this.mainDiv,newCssClass,oldCssClass);},clearSearch:function(){removeClass(this.mainDiv,"searchmatch");removeClass(this.mainDiv,"searchnonmatch");}});function LogEntryWrappedElementContainer(logEntry,containerDomNode){this.logEntry=logEntry;this.containerDomNode=containerDomNode;this.mainDiv=document.createElement("div");this.mainDiv.appendChild(document.createTextNode(this.logEntry.formattedMessage));this.mainDiv.className="logentry wrapped "+this.logEntry.level;this.contentElement=this.mainDiv;}','LogEntryWrappedElementContainer.prototype=new LogEntryElementContainer();LogEntryWrappedElementContainer.prototype.setContent=function(content,wrappedContent){if(content===this.formattedMessage){this.contentElement.innerHTML="";this.contentElement.appendChild(document.createTextNode(this.formattedMessage));}else{this.contentElement.innerHTML=wrappedContent;}};function LogEntryUnwrappedElementContainer(logEntry,containerDomNode){this.logEntry=logEntry;this.containerDomNode=containerDomNode;this.mainDiv=document.createElement("div");this.mainDiv.className="logentry unwrapped "+this.logEntry.level;this.pre=this.mainDiv.appendChild(document.createElement("pre"));this.pre.appendChild(document.createTextNode(this.logEntry.formattedMessage));this.pre.className="unwrapped";this.contentElement=this.pre;}','LogEntryUnwrappedElementContainer.prototype=new LogEntryElementContainer();LogEntryUnwrappedElementContainer.prototype.remove=function(){this.doRemove();this.pre=null;};function LogEntryMainElementContainer(logEntry,containerDomNode){this.logEntry=logEntry;this.containerDomNode=containerDomNode;this.mainDiv=document.createElement("div");this.mainDiv.className="logentry nonielogentry "+this.logEntry.level;this.contentElement=this.mainDiv.appendChild(document.createElement("span"));this.contentElement.appendChild(document.createTextNode(this.logEntry.formattedMessage));}','LogEntryMainElementContainer.prototype=new LogEntryElementContainer();function LogEntry(level,formattedMessage){this.level=level;this.formattedMessage=formattedMessage;this.rendered=false;}','LogEntry.prototype=new LogItem();copyProperties(LogEntry.prototype,{render:function(){var logEntry=this;var containerDomNode=this.group.contentDiv;if(isIe){this.formattedMessage=this.formattedMessage.replace(/\\r\\n/g,"\\r");this.unwrappedElementContainer=new LogEntryUnwrappedElementContainer(this,this.getUnwrappedDomContainer());this.wrappedElementContainer=new LogEntryWrappedElementContainer(this,this.getWrappedDomContainer());this.elementContainers=[this.unwrappedElementContainer,this.wrappedElementContainer];}else{this.mainElementContainer=new LogEntryMainElementContainer(this,this.getMainDomContainer());this.elementContainers=[this.mainElementContainer];}','this.content=this.formattedMessage;this.rendered=true;},setContent:function(content,wrappedContent){if(content!=this.content){if(isIe&&(content!==this.formattedMessage)){content=content.replace(/\\r\\n/g,"\\r");}','for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].setContent(content,wrappedContent);}','this.content=content;}},getSearchMatches:function(){var matches=[];var i,len;if(isIe){var unwrappedEls=getElementsByClass(this.unwrappedElementContainer.mainDiv,"searchterm","span");var wrappedEls=getElementsByClass(this.wrappedElementContainer.mainDiv,"searchterm","span");for(i=0,len=unwrappedEls.length;i<len;i++){matches[i]=new Match(this.level,null,unwrappedEls[i],wrappedEls[i]);}}else{var els=getElementsByClass(this.mainElementContainer.mainDiv,"searchterm","span");for(i=0,len=els.length;i<len;i++){matches[i]=new Match(this.level,els[i]);}}','return matches;},setSearchMatch:function(isMatch){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].setSearchMatch(isMatch);}},clearSearch:function(){for(var i=0,len=this.elementContainers.length;i<len;i++){this.elementContainers[i].clearSearch();}},accept:function(visitor){visitor.visitLogEntry(this);},serialize:function(items){items.push([LogItem.serializedItemKeys.LOG_ENTRY,this.level,this.formattedMessage]);}});function LogItemVisitor(){}','LogItemVisitor.prototype={visit:function(logItem){},visitParent:function(logItem){if(logItem.group){logItem.group.accept(this);}},visitChildren:function(logItem){for(var i=0,len=logItem.children.length;i<len;i++){logItem.children[i].accept(this);}},visitLogEntry:function(logEntry){this.visit(logEntry);},visitSeparator:function(separator){this.visit(separator);},visitGroup:function(group){this.visit(group);}};function GroupFlattener(){this.logEntriesAndSeparators=[];}','GroupFlattener.prototype=new LogItemVisitor();GroupFlattener.prototype.visitGroup=function(group){this.visitChildren(group);};GroupFlattener.prototype.visitLogEntry=function(logEntry){this.logEntriesAndSeparators.push(logEntry);};GroupFlattener.prototype.visitSeparator=function(separator){this.logEntriesAndSeparators.push(separator);};window.onload=function(){if(location.search){var queryBits=unescape(location.search).substr(1).split("&"),nameValueBits;for(var i=0,len=queryBits.length;i<len;i++){nameValueBits=queryBits[i].split("=");if(nameValueBits[0]=="log4javascript_domain"){document.domain=nameValueBits[1];break;}}}','logMainContainer=$("log");if(isIePre7){addClass(logMainContainer,"oldIe");}','rootGroup=new Group("root",true);rootGroup.render();currentGroup=rootGroup;setCommandInputWidth();setLogContainerHeight();toggleLoggingEnabled();toggleSearchEnabled();toggleSearchFilter();toggleSearchHighlight();applyFilters();checkAllLevels();toggleWrap();toggleNewestAtTop();toggleScrollToLatest();renderQueuedLogItems();loaded=true;$("command").value="";$("command").autocomplete="off";$("command").onkeydown=function(evt){evt=getEvent(evt);if(evt.keyCode==10||evt.keyCode==13){evalCommandLine();stopPropagation(evt);}else if(evt.keyCode==27){this.value="";this.focus();}else if(evt.keyCode==38&&commandHistory.length>0){currentCommandIndex=Math.max(0,currentCommandIndex-1);this.value=commandHistory[currentCommandIndex];moveCaretToEnd(this);}else if(evt.keyCode==40&&commandHistory.length>0){currentCommandIndex=Math.min(commandHistory.length-1,currentCommandIndex+1);this.value=commandHistory[currentCommandIndex];moveCaretToEnd(this);}};$("command").onkeypress=function(evt){evt=getEvent(evt);if(evt.keyCode==38&&commandHistory.length>0&&evt.preventDefault){evt.preventDefault();}};$("command").onkeyup=function(evt){evt=getEvent(evt);if(evt.keyCode==27&&evt.preventDefault){evt.preventDefault();this.focus();}};document.onkeydown=function keyEventHandler(evt){evt=getEvent(evt);switch(evt.keyCode){case 69:if(evt.shiftKey&&(evt.ctrlKey||evt.metaKey)){evalLastCommand();cancelKeyEvent(evt);return false;}','break;case 75:if(evt.shiftKey&&(evt.ctrlKey||evt.metaKey)){focusSearch();cancelKeyEvent(evt);return false;}','break;case 40:case 76:if(evt.shiftKey&&(evt.ctrlKey||evt.metaKey)){focusCommandLine();cancelKeyEvent(evt);return false;}','break;}};setTimeout(setLogContainerHeight,20);setShowCommandLine(showCommandLine);doSearch();};window.onunload=function(){if(mainWindowExists()){appender.unload();}','appender=null;};function toggleLoggingEnabled(){setLoggingEnabled($("enableLogging").checked);}','function setLoggingEnabled(enable){loggingEnabled=enable;}','var appender=null;function setAppender(appenderParam){appender=appenderParam;}','function setShowCloseButton(showCloseButton){$("closeButton").style.display=showCloseButton?"inline":"none";}','function setShowHideButton(showHideButton){$("hideButton").style.display=showHideButton?"inline":"none";}','var newestAtTop=false;function LogItemContentReverser(){}','LogItemContentReverser.prototype=new LogItemVisitor();LogItemContentReverser.prototype.visitGroup=function(group){group.reverseChildren();this.visitChildren(group);};function setNewestAtTop(isNewestAtTop){var oldNewestAtTop=newestAtTop;var i,iLen,j,jLen;newestAtTop=Boolean(isNewestAtTop);if(oldNewestAtTop!=newestAtTop){var visitor=new LogItemContentReverser();rootGroup.accept(visitor);if(currentSearch){var currentMatch=currentSearch.matches[currentMatchIndex];var matchIndex=0;var matches=[];var actOnLogEntry=function(logEntry){var logEntryMatches=logEntry.getSearchMatches();for(j=0,jLen=logEntryMatches.length;j<jLen;j++){matches[matchIndex]=logEntryMatches[j];if(currentMatch&&logEntryMatches[j].equals(currentMatch)){currentMatchIndex=matchIndex;}','matchIndex++;}};if(newestAtTop){for(i=logEntries.length-1;i>=0;i--){actOnLogEntry(logEntries[i]);}}else{for(i=0,iLen=logEntries.length;i<iLen;i++){actOnLogEntry(logEntries[i]);}}','currentSearch.matches=matches;if(currentMatch){currentMatch.setCurrent();}}else if(scrollToLatest){doScrollToLatest();}}','$("newestAtTop").checked=isNewestAtTop;}','function toggleNewestAtTop(){var isNewestAtTop=$("newestAtTop").checked;setNewestAtTop(isNewestAtTop);}','var scrollToLatest=true;function setScrollToLatest(isScrollToLatest){scrollToLatest=isScrollToLatest;if(scrollToLatest){doScrollToLatest();}','$("scrollToLatest").checked=isScrollToLatest;}','function toggleScrollToLatest(){var isScrollToLatest=$("scrollToLatest").checked;setScrollToLatest(isScrollToLatest);}','function doScrollToLatest(){var l=logMainContainer;if(typeof l.scrollTop!="undefined"){if(newestAtTop){l.scrollTop=0;}else{var latestLogEntry=l.lastChild;if(latestLogEntry){l.scrollTop=l.scrollHeight;}}}}','var closeIfOpenerCloses=true;function setCloseIfOpenerCloses(isCloseIfOpenerCloses){closeIfOpenerCloses=isCloseIfOpenerCloses;}','var maxMessages=null;function setMaxMessages(max){maxMessages=max;pruneLogEntries();}','var showCommandLine=false;function setShowCommandLine(isShowCommandLine){showCommandLine=isShowCommandLine;if(loaded){$("commandLine").style.display=showCommandLine?"block":"none";setCommandInputWidth();setLogContainerHeight();}}','function focusCommandLine(){if(loaded){$("command").focus();}}','function focusSearch(){if(loaded){$("searchBox").focus();}}','function getLogItems(){var items=[];for(var i=0,len=logItems.length;i<len;i++){logItems[i].serialize(items);}','return items;}','function setLogItems(items){var loggingReallyEnabled=loggingEnabled;loggingEnabled=true;for(var i=0,len=items.length;i<len;i++){switch(items[i][0]){case LogItem.serializedItemKeys.LOG_ENTRY:log(items[i][1],items[i][2]);break;case LogItem.serializedItemKeys.GROUP_START:group(items[i][1]);break;case LogItem.serializedItemKeys.GROUP_END:groupEnd();break;}}','loggingEnabled=loggingReallyEnabled;}','function log(logLevel,formattedMessage){if(loggingEnabled){var logEntry=new LogEntry(logLevel,formattedMessage);logEntries.push(logEntry);logEntriesAndSeparators.push(logEntry);logItems.push(logEntry);currentGroup.addChild(logEntry);if(loaded){if(logQueuedEventsTimer!==null){clearTimeout(logQueuedEventsTimer);}','logQueuedEventsTimer=setTimeout(renderQueuedLogItems,renderDelay);unrenderedLogItemsExist=true;}}}','function renderQueuedLogItems(){logQueuedEventsTimer=null;var pruned=pruneLogEntries();var initiallyHasMatches=currentSearch?currentSearch.hasMatches():false;for(var i=0,len=logItems.length;i<len;i++){if(!logItems[i].rendered){logItems[i].render();logItems[i].appendToLog();if(currentSearch&&(logItems[i]instanceof LogEntry)){currentSearch.applyTo(logItems[i]);}}}','if(currentSearch){if(pruned){if(currentSearch.hasVisibleMatches()){if(currentMatchIndex===null){setCurrentMatchIndex(0);}','displayMatches();}else{displayNoMatches();}}else if(!initiallyHasMatches&&currentSearch.hasVisibleMatches()){setCurrentMatchIndex(0);displayMatches();}}','if(scrollToLatest){doScrollToLatest();}','unrenderedLogItemsExist=false;}','function pruneLogEntries(){if((maxMessages!==null)&&(logEntriesAndSeparators.length>maxMessages)){var numberToDelete=logEntriesAndSeparators.length-maxMessages;var prunedLogEntries=logEntriesAndSeparators.slice(0,numberToDelete);if(currentSearch){currentSearch.removeMatches(prunedLogEntries);}','var group;for(var i=0;i<numberToDelete;i++){group=logEntriesAndSeparators[i].group;array_remove(logItems,logEntriesAndSeparators[i]);array_remove(logEntries,logEntriesAndSeparators[i]);logEntriesAndSeparators[i].remove(true,true);if(group.children.length===0&&group!==currentGroup&&group!==rootGroup){array_remove(logItems,group);group.remove(true,true);}}','logEntriesAndSeparators=array_removeFromStart(logEntriesAndSeparators,numberToDelete);return true;}','return false;}','function group(name,startExpanded){if(loggingEnabled){initiallyExpanded=(typeof startExpanded==="undefined")?true:Boolean(startExpanded);var newGroup=new Group(name,false,initiallyExpanded);currentGroup.addChild(newGroup);currentGroup=newGroup;logItems.push(newGroup);if(loaded){if(logQueuedEventsTimer!==null){clearTimeout(logQueuedEventsTimer);}','logQueuedEventsTimer=setTimeout(renderQueuedLogItems,renderDelay);unrenderedLogItemsExist=true;}}}','function groupEnd(){currentGroup=(currentGroup===rootGroup)?rootGroup:currentGroup.group;}','function mainPageReloaded(){currentGroup=rootGroup;var separator=new Separator();logEntriesAndSeparators.push(separator);logItems.push(separator);currentGroup.addChild(separator);}','function closeWindow(){if(appender&&mainWindowExists()){appender.close(true);}else{window.close();}}','function hide(){if(appender&&mainWindowExists()){appender.hide();}}','var mainWindow=window;var windowId="log4javascriptConsoleWindow_"+new Date().getTime()+"_"+(""+Math.random()).substr(2);function setMainWindow(win){mainWindow=win;mainWindow[windowId]=window;if(opener&&closeIfOpenerCloses){pollOpener();}}','function pollOpener(){if(closeIfOpenerCloses){if(mainWindowExists()){setTimeout(pollOpener,500);}else{closeWindow();}}}','function mainWindowExists(){try{return(mainWindow&&!mainWindow.closed&&mainWindow[windowId]==window);}catch(ex){}','return false;}','var logLevels=["TRACE","DEBUG","INFO","WARN","ERROR","FATAL"];function getCheckBox(logLevel){return $("switch_"+logLevel);}','function getIeWrappedLogContainer(){return $("log_wrapped");}','function getIeUnwrappedLogContainer(){return $("log_unwrapped");}','function applyFilters(){for(var i=0;i<logLevels.length;i++){if(getCheckBox(logLevels[i]).checked){addClass(logMainContainer,logLevels[i]);}else{removeClass(logMainContainer,logLevels[i]);}}','updateSearchFromFilters();}','function toggleAllLevels(){var turnOn=$("switch_ALL").checked;for(var i=0;i<logLevels.length;i++){getCheckBox(logLevels[i]).checked=turnOn;if(turnOn){addClass(logMainContainer,logLevels[i]);}else{removeClass(logMainContainer,logLevels[i]);}}}','function checkAllLevels(){for(var i=0;i<logLevels.length;i++){if(!getCheckBox(logLevels[i]).checked){getCheckBox("ALL").checked=false;return;}}','getCheckBox("ALL").checked=true;}','function clearLog(){rootGroup.clear();currentGroup=rootGroup;logEntries=[];logItems=[];logEntriesAndSeparators=[];doSearch();}','function toggleWrap(){var enable=$("wrap").checked;if(enable){addClass(logMainContainer,"wrap");}else{removeClass(logMainContainer,"wrap");}','refreshCurrentMatch();}','var searchTimer=null;function scheduleSearch(){try{clearTimeout(searchTimer);}catch(ex){}','searchTimer=setTimeout(doSearch,500);}','function Search(searchTerm,isRegex,searchRegex,isCaseSensitive){this.searchTerm=searchTerm;this.isRegex=isRegex;this.searchRegex=searchRegex;this.isCaseSensitive=isCaseSensitive;this.matches=[];}','Search.prototype={hasMatches:function(){return this.matches.length>0;},hasVisibleMatches:function(){if(this.hasMatches()){for(var i=0;i<this.matches.length;i++){if(this.matches[i].isVisible()){return true;}}}','return false;},match:function(logEntry){var entryText=String(logEntry.formattedMessage);var matchesSearch=false;if(this.isRegex){matchesSearch=this.searchRegex.test(entryText);}else if(this.isCaseSensitive){matchesSearch=(entryText.indexOf(this.searchTerm)>-1);}else{matchesSearch=(entryText.toLowerCase().indexOf(this.searchTerm.toLowerCase())>-1);}','return matchesSearch;},getNextVisibleMatchIndex:function(){for(var i=currentMatchIndex+1;i<this.matches.length;i++){if(this.matches[i].isVisible()){return i;}}','for(i=0;i<=currentMatchIndex;i++){if(this.matches[i].isVisible()){return i;}}','return-1;},getPreviousVisibleMatchIndex:function(){for(var i=currentMatchIndex-1;i>=0;i--){if(this.matches[i].isVisible()){return i;}}','for(var i=this.matches.length-1;i>=currentMatchIndex;i--){if(this.matches[i].isVisible()){return i;}}','return-1;},applyTo:function(logEntry){var doesMatch=this.match(logEntry);if(doesMatch){logEntry.group.expand();logEntry.setSearchMatch(true);var logEntryContent;var wrappedLogEntryContent;var searchTermReplacementStartTag="<span class=\\\"searchterm\\\">";var searchTermReplacementEndTag="<"+"/span>";var preTagName=isIe?"pre":"span";var preStartTag="<"+preTagName+" class=\\\"pre\\\">";var preEndTag="<"+"/"+preTagName+">";var startIndex=0;var searchIndex,matchedText,textBeforeMatch;if(this.isRegex){var flags=this.isCaseSensitive?"g":"gi";var capturingRegex=new RegExp("("+this.searchRegex.source+")",flags);var rnd=(""+Math.random()).substr(2);var startToken="%%s"+rnd+"%%";var endToken="%%e"+rnd+"%%";logEntryContent=logEntry.formattedMessage.replace(capturingRegex,startToken+"$1"+endToken);logEntryContent=escapeHtml(logEntryContent);var result;var searchString=logEntryContent;logEntryContent="";wrappedLogEntryContent="";while((searchIndex=searchString.indexOf(startToken,startIndex))>-1){var endTokenIndex=searchString.indexOf(endToken,searchIndex);matchedText=searchString.substring(searchIndex+startToken.length,endTokenIndex);textBeforeMatch=searchString.substring(startIndex,searchIndex);logEntryContent+=preStartTag+textBeforeMatch+preEndTag;logEntryContent+=searchTermReplacementStartTag+preStartTag+matchedText+','preEndTag+searchTermReplacementEndTag;if(isIe){wrappedLogEntryContent+=textBeforeMatch+searchTermReplacementStartTag+','matchedText+searchTermReplacementEndTag;}','startIndex=endTokenIndex+endToken.length;}','logEntryContent+=preStartTag+searchString.substr(startIndex)+preEndTag;if(isIe){wrappedLogEntryContent+=searchString.substr(startIndex);}}else{logEntryContent="";wrappedLogEntryContent="";var searchTermReplacementLength=searchTermReplacementStartTag.length+','this.searchTerm.length+searchTermReplacementEndTag.length;var searchTermLength=this.searchTerm.length;var searchTermLowerCase=this.searchTerm.toLowerCase();var logTextLowerCase=logEntry.formattedMessage.toLowerCase();while((searchIndex=logTextLowerCase.indexOf(searchTermLowerCase,startIndex))>-1){matchedText=escapeHtml(logEntry.formattedMessage.substr(searchIndex,this.searchTerm.length));textBeforeMatch=escapeHtml(logEntry.formattedMessage.substring(startIndex,searchIndex));var searchTermReplacement=searchTermReplacementStartTag+','preStartTag+matchedText+preEndTag+searchTermReplacementEndTag;logEntryContent+=preStartTag+textBeforeMatch+preEndTag+searchTermReplacement;if(isIe){wrappedLogEntryContent+=textBeforeMatch+searchTermReplacementStartTag+','matchedText+searchTermReplacementEndTag;}','startIndex=searchIndex+searchTermLength;}','var textAfterLastMatch=escapeHtml(logEntry.formattedMessage.substr(startIndex));logEntryContent+=preStartTag+textAfterLastMatch+preEndTag;if(isIe){wrappedLogEntryContent+=textAfterLastMatch;}}','logEntry.setContent(logEntryContent,wrappedLogEntryContent);var logEntryMatches=logEntry.getSearchMatches();this.matches=this.matches.concat(logEntryMatches);}else{logEntry.setSearchMatch(false);logEntry.setContent(logEntry.formattedMessage,logEntry.formattedMessage);}','return doesMatch;},removeMatches:function(logEntries){var matchesToRemoveCount=0;var currentMatchRemoved=false;var matchesToRemove=[];var i,iLen,j,jLen;for(i=0,iLen=this.matches.length;i<iLen;i++){for(j=0,jLen=logEntries.length;j<jLen;j++){if(this.matches[i].belongsTo(logEntries[j])){matchesToRemove.push(this.matches[i]);if(i===currentMatchIndex){currentMatchRemoved=true;}}}}','var newMatch=currentMatchRemoved?null:this.matches[currentMatchIndex];if(currentMatchRemoved){for(i=currentMatchIndex,iLen=this.matches.length;i<iLen;i++){if(this.matches[i].isVisible()&&!array_contains(matchesToRemove,this.matches[i])){newMatch=this.matches[i];break;}}}','for(i=0,iLen=matchesToRemove.length;i<iLen;i++){array_remove(this.matches,matchesToRemove[i]);matchesToRemove[i].remove();}','if(this.hasVisibleMatches()){if(newMatch===null){setCurrentMatchIndex(0);}else{var newMatchIndex=0;for(i=0,iLen=this.matches.length;i<iLen;i++){if(newMatch===this.matches[i]){newMatchIndex=i;break;}}','setCurrentMatchIndex(newMatchIndex);}}else{currentMatchIndex=null;displayNoMatches();}}};function getPageOffsetTop(el,container){var currentEl=el;var y=0;while(currentEl&&currentEl!=container){y+=currentEl.offsetTop;currentEl=currentEl.offsetParent;}','return y;}','function scrollIntoView(el){var logContainer=logMainContainer;if(!$("wrap").checked){var logContainerLeft=logContainer.scrollLeft;var logContainerRight=logContainerLeft+logContainer.offsetWidth;var elLeft=el.offsetLeft;var elRight=elLeft+el.offsetWidth;if(elLeft<logContainerLeft||elRight>logContainerRight){logContainer.scrollLeft=elLeft-(logContainer.offsetWidth-el.offsetWidth)/2;}}','var logContainerTop=logContainer.scrollTop;var logContainerBottom=logContainerTop+logContainer.offsetHeight;var elTop=getPageOffsetTop(el)-getToolBarsHeight();var elBottom=elTop+el.offsetHeight;if(elTop<logContainerTop||elBottom>logContainerBottom){logContainer.scrollTop=elTop-(logContainer.offsetHeight-el.offsetHeight)/2;}}','function Match(logEntryLevel,spanInMainDiv,spanInUnwrappedPre,spanInWrappedDiv){this.logEntryLevel=logEntryLevel;this.spanInMainDiv=spanInMainDiv;if(isIe){this.spanInUnwrappedPre=spanInUnwrappedPre;this.spanInWrappedDiv=spanInWrappedDiv;}','this.mainSpan=isIe?spanInUnwrappedPre:spanInMainDiv;}','Match.prototype={equals:function(match){return this.mainSpan===match.mainSpan;},setCurrent:function(){if(isIe){addClass(this.spanInUnwrappedPre,"currentmatch");addClass(this.spanInWrappedDiv,"currentmatch");var elementToScroll=$("wrap").checked?this.spanInWrappedDiv:this.spanInUnwrappedPre;scrollIntoView(elementToScroll);}else{addClass(this.spanInMainDiv,"currentmatch");scrollIntoView(this.spanInMainDiv);}},belongsTo:function(logEntry){if(isIe){return isDescendant(this.spanInUnwrappedPre,logEntry.unwrappedPre);}else{return isDescendant(this.spanInMainDiv,logEntry.mainDiv);}},setNotCurrent:function(){if(isIe){removeClass(this.spanInUnwrappedPre,"currentmatch");removeClass(this.spanInWrappedDiv,"currentmatch");}else{removeClass(this.spanInMainDiv,"currentmatch");}},isOrphan:function(){return isOrphan(this.mainSpan);},isVisible:function(){return getCheckBox(this.logEntryLevel).checked;},remove:function(){if(isIe){this.spanInUnwrappedPre=null;this.spanInWrappedDiv=null;}else{this.spanInMainDiv=null;}}};var currentSearch=null;var currentMatchIndex=null;function doSearch(){var searchBox=$("searchBox");var searchTerm=searchBox.value;var isRegex=$("searchRegex").checked;var isCaseSensitive=$("searchCaseSensitive").checked;var i;if(searchTerm===""){$("searchReset").disabled=true;$("searchNav").style.display="none";removeClass(document.body,"searching");removeClass(searchBox,"hasmatches");removeClass(searchBox,"nomatches");for(i=0;i<logEntries.length;i++){logEntries[i].clearSearch();logEntries[i].setContent(logEntries[i].formattedMessage,logEntries[i].formattedMessage);}','currentSearch=null;setLogContainerHeight();}else{$("searchReset").disabled=false;$("searchNav").style.display="block";var searchRegex;var regexValid;if(isRegex){try{searchRegex=isCaseSensitive?new RegExp(searchTerm,"g"):new RegExp(searchTerm,"gi");regexValid=true;replaceClass(searchBox,"validregex","invalidregex");searchBox.title="Valid regex";}catch(ex){regexValid=false;replaceClass(searchBox,"invalidregex","validregex");searchBox.title="Invalid regex: "+(ex.message?ex.message:(ex.description?ex.description:"unknown error"));return;}}else{searchBox.title="";removeClass(searchBox,"validregex");removeClass(searchBox,"invalidregex");}','addClass(document.body,"searching");currentSearch=new Search(searchTerm,isRegex,searchRegex,isCaseSensitive);for(i=0;i<logEntries.length;i++){currentSearch.applyTo(logEntries[i]);}','setLogContainerHeight();if(currentSearch.hasVisibleMatches()){setCurrentMatchIndex(0);displayMatches();}else{displayNoMatches();}}}','function updateSearchFromFilters(){if(currentSearch){if(currentSearch.hasMatches()){if(currentMatchIndex===null){currentMatchIndex=0;}','var currentMatch=currentSearch.matches[currentMatchIndex];if(currentMatch.isVisible()){displayMatches();setCurrentMatchIndex(currentMatchIndex);}else{currentMatch.setNotCurrent();var nextVisibleMatchIndex=currentSearch.getNextVisibleMatchIndex();if(nextVisibleMatchIndex>-1){setCurrentMatchIndex(nextVisibleMatchIndex);displayMatches();}else{displayNoMatches();}}}else{displayNoMatches();}}}','function refreshCurrentMatch(){if(currentSearch&&currentSearch.hasVisibleMatches()){setCurrentMatchIndex(currentMatchIndex);}}','function displayMatches(){replaceClass($("searchBox"),"hasmatches","nomatches");$("searchBox").title=""+currentSearch.matches.length+" matches found";$("searchNav").style.display="block";setLogContainerHeight();}','function displayNoMatches(){replaceClass($("searchBox"),"nomatches","hasmatches");$("searchBox").title="No matches found";$("searchNav").style.display="none";setLogContainerHeight();}','function toggleSearchEnabled(enable){enable=(typeof enable=="undefined")?!$("searchDisable").checked:enable;$("searchBox").disabled=!enable;$("searchReset").disabled=!enable;$("searchRegex").disabled=!enable;$("searchNext").disabled=!enable;$("searchPrevious").disabled=!enable;$("searchCaseSensitive").disabled=!enable;$("searchNav").style.display=(enable&&($("searchBox").value!=="")&&currentSearch&&currentSearch.hasVisibleMatches())?"block":"none";if(enable){removeClass($("search"),"greyedout");addClass(document.body,"searching");if($("searchHighlight").checked){addClass(logMainContainer,"searchhighlight");}else{removeClass(logMainContainer,"searchhighlight");}','if($("searchFilter").checked){addClass(logMainContainer,"searchfilter");}else{removeClass(logMainContainer,"searchfilter");}','$("searchDisable").checked=!enable;}else{addClass($("search"),"greyedout");removeClass(document.body,"searching");removeClass(logMainContainer,"searchhighlight");removeClass(logMainContainer,"searchfilter");}','setLogContainerHeight();}','function toggleSearchFilter(){var enable=$("searchFilter").checked;if(enable){addClass(logMainContainer,"searchfilter");}else{removeClass(logMainContainer,"searchfilter");}','refreshCurrentMatch();}','function toggleSearchHighlight(){var enable=$("searchHighlight").checked;if(enable){addClass(logMainContainer,"searchhighlight");}else{removeClass(logMainContainer,"searchhighlight");}}','function clearSearch(){$("searchBox").value="";doSearch();}','function searchNext(){if(currentSearch!==null&&currentMatchIndex!==null){currentSearch.matches[currentMatchIndex].setNotCurrent();var nextMatchIndex=currentSearch.getNextVisibleMatchIndex();if(nextMatchIndex>currentMatchIndex||confirm("Reached the end of the page. Start from the top?")){setCurrentMatchIndex(nextMatchIndex);}}}','function searchPrevious(){if(currentSearch!==null&&currentMatchIndex!==null){currentSearch.matches[currentMatchIndex].setNotCurrent();var previousMatchIndex=currentSearch.getPreviousVisibleMatchIndex();if(previousMatchIndex<currentMatchIndex||confirm("Reached the start of the page. Continue from the bottom?")){setCurrentMatchIndex(previousMatchIndex);}}}','function setCurrentMatchIndex(index){currentMatchIndex=index;currentSearch.matches[currentMatchIndex].setCurrent();}','function addClass(el,cssClass){if(!hasClass(el,cssClass)){if(el.className){el.className+=" "+cssClass;}else{el.className=cssClass;}}}','function hasClass(el,cssClass){if(el.className){var classNames=el.className.split(" ");return array_contains(classNames,cssClass);}','return false;}','function removeClass(el,cssClass){if(hasClass(el,cssClass)){var existingClasses=el.className.split(" ");var newClasses=[];for(var i=0,len=existingClasses.length;i<len;i++){if(existingClasses[i]!=cssClass){newClasses[newClasses.length]=existingClasses[i];}}','el.className=newClasses.join(" ");}}','function replaceClass(el,newCssClass,oldCssClass){removeClass(el,oldCssClass);addClass(el,newCssClass);}','function getElementsByClass(el,cssClass,tagName){var elements=el.getElementsByTagName(tagName);var matches=[];for(var i=0,len=elements.length;i<len;i++){if(hasClass(elements[i],cssClass)){matches.push(elements[i]);}}','return matches;}','function $(id){return document.getElementById(id);}','function isDescendant(node,ancestorNode){while(node!=null){if(node===ancestorNode){return true;}','node=node.parentNode;}','return false;}','function isOrphan(node){var currentNode=node;while(currentNode){if(currentNode==document.body){return false;}','currentNode=currentNode.parentNode;}','return true;}','function escapeHtml(str){return str.replace(/&/g,"&amp;").replace(/[<]/g,"&lt;").replace(/>/g,"&gt;");}','function getWindowWidth(){if(window.innerWidth){return window.innerWidth;}else if(document.documentElement&&document.documentElement.clientWidth){return document.documentElement.clientWidth;}else if(document.body){return document.body.clientWidth;}','return 0;}','function getWindowHeight(){if(window.innerHeight){return window.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){return document.documentElement.clientHeight;}else if(document.body){return document.body.clientHeight;}','return 0;}','function getToolBarsHeight(){return $("switches").offsetHeight;}','function getChromeHeight(){var height=getToolBarsHeight();if(showCommandLine){height+=$("commandLine").offsetHeight;}','return height;}','function setLogContainerHeight(){if(logMainContainer){var windowHeight=getWindowHeight();$("body").style.height=getWindowHeight()+"px";logMainContainer.style.height=""+','Math.max(0,windowHeight-getChromeHeight())+"px";}}','function setCommandInputWidth(){if(showCommandLine){$("command").style.width=""+Math.max(0,$("commandLineContainer").offsetWidth-','($("evaluateButton").offsetWidth+13))+"px";}}','window.onresize=function(){setCommandInputWidth();setLogContainerHeight();};if(!Array.prototype.push){Array.prototype.push=function(){for(var i=0,len=arguments.length;i<len;i++){this[this.length]=arguments[i];}','return this.length;};}','if(!Array.prototype.pop){Array.prototype.pop=function(){if(this.length>0){var val=this[this.length-1];this.length=this.length-1;return val;}};}','if(!Array.prototype.shift){Array.prototype.shift=function(){if(this.length>0){var firstItem=this[0];for(var i=0,len=this.length-1;i<len;i++){this[i]=this[i+1];}','this.length=this.length-1;return firstItem;}};}','if(!Array.prototype.splice){Array.prototype.splice=function(startIndex,deleteCount){var itemsAfterDeleted=this.slice(startIndex+deleteCount);var itemsDeleted=this.slice(startIndex,startIndex+deleteCount);this.length=startIndex;var argumentsArray=[];for(var i=0,len=arguments.length;i<len;i++){argumentsArray[i]=arguments[i];}','var itemsToAppend=(argumentsArray.length>2)?itemsAfterDeleted=argumentsArray.slice(2).concat(itemsAfterDeleted):itemsAfterDeleted;for(i=0,len=itemsToAppend.length;i<len;i++){this.push(itemsToAppend[i]);}','return itemsDeleted;};}','function array_remove(arr,val){var index=-1;for(var i=0,len=arr.length;i<len;i++){if(arr[i]===val){index=i;break;}}','if(index>=0){arr.splice(index,1);return index;}else{return false;}}','function array_removeFromStart(array,numberToRemove){if(Array.prototype.splice){array.splice(0,numberToRemove);}else{for(var i=numberToRemove,len=array.length;i<len;i++){array[i-numberToRemove]=array[i];}','array.length=array.length-numberToRemove;}','return array;}','function array_contains(arr,val){for(var i=0,len=arr.length;i<len;i++){if(arr[i]==val){return true;}}','return false;}','function getErrorMessage(ex){if(ex.message){return ex.message;}else if(ex.description){return ex.description;}','return""+ex;}','function moveCaretToEnd(input){if(input.setSelectionRange){input.focus();var length=input.value.length;input.setSelectionRange(length,length);}else if(input.createTextRange){var range=input.createTextRange();range.collapse(false);range.select();}','input.focus();}','function stopPropagation(evt){if(evt.stopPropagation){evt.stopPropagation();}else if(typeof evt.cancelBubble!="undefined"){evt.cancelBubble=true;}}','function getEvent(evt){return evt?evt:event;}','function getTarget(evt){return evt.target?evt.target:evt.srcElement;}','function getRelatedTarget(evt){if(evt.relatedTarget){return evt.relatedTarget;}else if(evt.srcElement){switch(evt.type){case"mouseover":return evt.fromElement;case"mouseout":return evt.toElement;default:return evt.srcElement;}}}','function cancelKeyEvent(evt){evt.returnValue=false;stopPropagation(evt);}','function evalCommandLine(){var expr=$("command").value;evalCommand(expr);$("command").value="";}','function evalLastCommand(){if(lastCommand!=null){evalCommand(lastCommand);}}','var lastCommand=null;var commandHistory=[];var currentCommandIndex=0;function evalCommand(expr){if(appender){appender.evalCommandAndAppend(expr);}else{var prefix=">>> "+expr+"\\r\\n";try{log("INFO",prefix+eval(expr));}catch(ex){log("ERROR",prefix+"Error: "+getErrorMessage(ex));}}','if(expr!=commandHistory[commandHistory.length-1]){commandHistory.push(expr);if(appender){appender.storeCommandHistory(commandHistory);}}','currentCommandIndex=(expr==commandHistory[currentCommandIndex])?currentCommandIndex+1:commandHistory.length;lastCommand=expr;}','//]]>','</script>','<style type="text/css">','body{background-color:white;color:black;padding:0;margin:0;font-family:tahoma,verdana,arial,helvetica,sans-serif;overflow:hidden}div#switchesContainer input{margin-bottom:0}div.toolbar{border-top:solid #ffffff 1px;border-bottom:solid #aca899 1px;background-color:#f1efe7;padding:3px 5px;font-size:68.75%}div.toolbar,div#search input{font-family:tahoma,verdana,arial,helvetica,sans-serif}div.toolbar input.button{padding:0 5px;font-size:100%}div.toolbar input.hidden{display:none}div#switches input#clearButton{margin-left:20px}div#levels label{font-weight:bold}div#levels label,div#options label{margin-right:5px}div#levels label#wrapLabel{font-weight:normal}div#search label{margin-right:10px}div#search label.searchboxlabel{margin-right:0}div#search input{font-size:100%}div#search input.validregex{color:green}div#search input.invalidregex{color:red}div#search input.nomatches{color:white;background-color:#ff6666}div#search input.nomatches{color:white;background-color:#ff6666}div#searchNav{display:none}div#commandLine{display:none}div#commandLine input#command{font-size:100%;font-family:Courier New,Courier}div#commandLine input#evaluateButton{}*.greyedout{color:gray !important;border-color:gray !important}*.greyedout *.alwaysenabled{color:black}*.unselectable{-khtml-user-select:none;-moz-user-select:none;user-select:none}div#log{font-family:Courier New,Courier;font-size:75%;width:100%;overflow:auto;clear:both;position:relative}div.group{border-color:#cccccc;border-style:solid;border-width:1px 0 1px 1px;overflow:visible}div.oldIe div.group,div.oldIe div.group *,div.oldIe *.logentry{height:1%}div.group div.groupheading span.expander{border:solid black 1px;font-family:Courier New,Courier;font-size:0.833em;background-color:#eeeeee;position:relative;top:-1px;color:black;padding:0 2px;cursor:pointer;cursor:hand;height:1%}div.group div.groupcontent{margin-left:10px;padding-bottom:2px;overflow:visible}div.group div.expanded{display:block}div.group div.collapsed{display:none}*.logentry{overflow:visible;display:none;white-space:pre}span.pre{white-space:pre}pre.unwrapped{display:inline !important}pre.unwrapped pre.pre,div.wrapped pre.pre{display:inline}div.wrapped pre.pre{white-space:normal}div.wrapped{display:none}body.searching *.logentry span.currentmatch{color:white !important;background-color:green !important}body.searching div.searchhighlight *.logentry span.searchterm{color:black;background-color:yellow}div.wrap *.logentry{white-space:normal !important;border-width:0 0 1px 0;border-color:#dddddd;border-style:dotted}div.wrap #log_wrapped,#log_unwrapped{display:block}div.wrap #log_unwrapped,#log_wrapped{display:none}div.wrap *.logentry span.pre{overflow:visible;white-space:normal}div.wrap *.logentry pre.unwrapped{display:none}div.wrap *.logentry span.wrapped{display:inline}div.searchfilter *.searchnonmatch{display:none !important}div#log *.TRACE,label#label_TRACE{color:#666666}div#log *.DEBUG,label#label_DEBUG{color:green}div#log *.INFO,label#label_INFO{color:#000099}div#log *.WARN,label#label_WARN{color:#999900}div#log *.ERROR,label#label_ERROR{color:red}div#log *.FATAL,label#label_FATAL{color:#660066}div.TRACE#log *.TRACE,div.DEBUG#log *.DEBUG,div.INFO#log *.INFO,div.WARN#log *.WARN,div.ERROR#log *.ERROR,div.FATAL#log *.FATAL{display:block}div#log div.separator{background-color:#cccccc;margin:5px 0;line-height:1px}','</style>','</head>','<body id="body">','<div id="switchesContainer">','<div id="switches">','<div id="levels" class="toolbar">','Filters:','<input type="checkbox" id="switch_TRACE" onclick="applyFilters(); checkAllLevels()" checked="checked" title="Show/hide trace messages" /><label for="switch_TRACE" id="label_TRACE">trace</label>','<input type="checkbox" id="switch_DEBUG" onclick="applyFilters(); checkAllLevels()" checked="checked" title="Show/hide debug messages" /><label for="switch_DEBUG" id="label_DEBUG">debug</label>','<input type="checkbox" id="switch_INFO" onclick="applyFilters(); checkAllLevels()" checked="checked" title="Show/hide info messages" /><label for="switch_INFO" id="label_INFO">info</label>','<input type="checkbox" id="switch_WARN" onclick="applyFilters(); checkAllLevels()" checked="checked" title="Show/hide warn messages" /><label for="switch_WARN" id="label_WARN">warn</label>','<input type="checkbox" id="switch_ERROR" onclick="applyFilters(); checkAllLevels()" checked="checked" title="Show/hide error messages" /><label for="switch_ERROR" id="label_ERROR">error</label>','<input type="checkbox" id="switch_FATAL" onclick="applyFilters(); checkAllLevels()" checked="checked" title="Show/hide fatal messages" /><label for="switch_FATAL" id="label_FATAL">fatal</label>','<input type="checkbox" id="switch_ALL" onclick="toggleAllLevels(); applyFilters()" checked="checked" title="Show/hide all messages" /><label for="switch_ALL" id="label_ALL">all</label>','</div>','<div id="search" class="toolbar">','<label for="searchBox" class="searchboxlabel">Search:</label> <input type="text" id="searchBox" onclick="toggleSearchEnabled(true)" onkeyup="scheduleSearch()" size="20" />','<input type="button" id="searchReset" disabled="disabled" value="Reset" onclick="clearSearch()" class="button" title="Reset the search" />','<input type="checkbox" id="searchRegex" onclick="doSearch()" title="If checked, search is treated as a regular expression" /><label for="searchRegex">Regex</label>','<input type="checkbox" id="searchCaseSensitive" onclick="doSearch()" title="If checked, search is case sensitive" /><label for="searchCaseSensitive">Match case</label>','<input type="checkbox" id="searchDisable" onclick="toggleSearchEnabled()" title="Enable/disable search" /><label for="searchDisable" class="alwaysenabled">Disable</label>','<div id="searchNav">','<input type="button" id="searchNext" disabled="disabled" value="Next" onclick="searchNext()" class="button" title="Go to the next matching log entry" />','<input type="button" id="searchPrevious" disabled="disabled" value="Previous" onclick="searchPrevious()" class="button" title="Go to the previous matching log entry" />','<input type="checkbox" id="searchFilter" onclick="toggleSearchFilter()" title="If checked, non-matching log entries are filtered out" /><label for="searchFilter">Filter</label>','<input type="checkbox" id="searchHighlight" onclick="toggleSearchHighlight()" title="Highlight matched search terms" /><label for="searchHighlight" class="alwaysenabled">Highlight all</label>','</div>','</div>','<div id="options" class="toolbar">','Options:','<input type="checkbox" id="enableLogging" onclick="toggleLoggingEnabled()" checked="checked" title="Enable/disable logging" /><label for="enableLogging" id="enableLoggingLabel">Log</label>','<input type="checkbox" id="wrap" onclick="toggleWrap()" title="Enable / disable word wrap" /><label for="wrap" id="wrapLabel">Wrap</label>','<input type="checkbox" id="newestAtTop" onclick="toggleNewestAtTop()" title="If checked, causes newest messages to appear at the top" /><label for="newestAtTop" id="newestAtTopLabel">Newest at the top</label>','<input type="checkbox" id="scrollToLatest" onclick="toggleScrollToLatest()" checked="checked" title="If checked, window automatically scrolls to a new message when it is added" /><label for="scrollToLatest" id="scrollToLatestLabel">Scroll to latest</label>','<input type="button" id="clearButton" value="Clear" onclick="clearLog()" class="button" title="Clear all log messages" />','<input type="button" id="hideButton" value="Hide" onclick="hide()" class="hidden button" title="Hide the console" />','<input type="button" id="closeButton" value="Close" onclick="closeWindow()" class="hidden button" title="Close the window" />','</div>','</div>','</div>','<div id="log" class="TRACE DEBUG INFO WARN ERROR FATAL"></div>','<div id="commandLine" class="toolbar">','<div id="commandLineContainer">','<input type="text" id="command" title="Enter a JavaScript command here and hit return or press \'Evaluate\'" />','<input type="button" id="evaluateButton" value="Evaluate" class="button" title="Evaluate the command" onclick="evalCommandLine()" />','</div>','</div>','</body>','</html>',''];};var defaultCommandLineFunctions=[];ConsoleAppender=function(){};var consoleAppenderIdCounter=1;ConsoleAppender.prototype=new Appender();ConsoleAppender.prototype.create=function(inPage,container,lazyInit,initiallyMinimized,useDocumentWrite,width,height,focusConsoleWindow){var appender=this;var initialized=false;var consoleWindowCreated=false;var consoleWindowLoaded=false;var consoleClosed=false;var queuedLoggingEvents=[];var isSupported=true;var consoleAppenderId=consoleAppenderIdCounter++;initiallyMinimized=extractBooleanFromParam(initiallyMinimized,this.defaults.initiallyMinimized);lazyInit=extractBooleanFromParam(lazyInit,this.defaults.lazyInit);useDocumentWrite=extractBooleanFromParam(useDocumentWrite,this.defaults.useDocumentWrite);var newestMessageAtTop=this.defaults.newestMessageAtTop;var scrollToLatestMessage=this.defaults.scrollToLatestMessage;width=width?width:this.defaults.width;height=height?height:this.defaults.height;var maxMessages=this.defaults.maxMessages;var showCommandLine=this.defaults.showCommandLine;var commandLineObjectExpansionDepth=this.defaults.commandLineObjectExpansionDepth;var showHideButton=this.defaults.showHideButton;var showCloseButton=this.defaults.showCloseButton;this.setLayout(this.defaults.layout);var init,createWindow,safeToAppend,getConsoleWindow,open;var appenderName=inPage?"InPageAppender":"PopUpAppender";var checkCanConfigure=function(configOptionName){if(consoleWindowCreated){handleError(appenderName+": configuration option '"+configOptionName+"' may not be set after the appender has been initialized");return false;} +return true;};var consoleWindowExists=function(){return(consoleWindowLoaded&&isSupported&&!consoleClosed);};this.isNewestMessageAtTop=function(){return newestMessageAtTop;};this.setNewestMessageAtTop=function(newestMessageAtTopParam){newestMessageAtTop=bool(newestMessageAtTopParam);if(consoleWindowExists()){getConsoleWindow().setNewestAtTop(newestMessageAtTop);}};this.isScrollToLatestMessage=function(){return scrollToLatestMessage;};this.setScrollToLatestMessage=function(scrollToLatestMessageParam){scrollToLatestMessage=bool(scrollToLatestMessageParam);if(consoleWindowExists()){getConsoleWindow().setScrollToLatest(scrollToLatestMessage);}};this.getWidth=function(){return width;};this.setWidth=function(widthParam){if(checkCanConfigure("width")){width=extractStringFromParam(widthParam,width);}};this.getHeight=function(){return height;};this.setHeight=function(heightParam){if(checkCanConfigure("height")){height=extractStringFromParam(heightParam,height);}};this.getMaxMessages=function(){return maxMessages;};this.setMaxMessages=function(maxMessagesParam){maxMessages=extractIntFromParam(maxMessagesParam,maxMessages);if(consoleWindowExists()){getConsoleWindow().setMaxMessages(maxMessages);}};this.isShowCommandLine=function(){return showCommandLine;};this.setShowCommandLine=function(showCommandLineParam){showCommandLine=bool(showCommandLineParam);if(consoleWindowExists()){getConsoleWindow().setShowCommandLine(showCommandLine);}};this.isShowHideButton=function(){return showHideButton;};this.setShowHideButton=function(showHideButtonParam){showHideButton=bool(showHideButtonParam);if(consoleWindowExists()){getConsoleWindow().setShowHideButton(showHideButton);}};this.isShowCloseButton=function(){return showCloseButton;};this.setShowCloseButton=function(showCloseButtonParam){showCloseButton=bool(showCloseButtonParam);if(consoleWindowExists()){getConsoleWindow().setShowCloseButton(showCloseButton);}};this.getCommandLineObjectExpansionDepth=function(){return commandLineObjectExpansionDepth;};this.setCommandLineObjectExpansionDepth=function(commandLineObjectExpansionDepthParam){commandLineObjectExpansionDepth=extractIntFromParam(commandLineObjectExpansionDepthParam,commandLineObjectExpansionDepth);};var minimized=initiallyMinimized;this.isInitiallyMinimized=function(){return initiallyMinimized;};this.setInitiallyMinimized=function(initiallyMinimizedParam){if(checkCanConfigure("initiallyMinimized")){initiallyMinimized=bool(initiallyMinimizedParam);minimized=initiallyMinimized;}};this.isUseDocumentWrite=function(){return useDocumentWrite;};this.setUseDocumentWrite=function(useDocumentWriteParam){if(checkCanConfigure("useDocumentWrite")){useDocumentWrite=bool(useDocumentWriteParam);}};function QueuedLoggingEvent(loggingEvent,formattedMessage){this.loggingEvent=loggingEvent;this.levelName=loggingEvent.level.name;this.formattedMessage=formattedMessage;} +QueuedLoggingEvent.prototype.append=function(){getConsoleWindow().log(this.levelName,this.formattedMessage);};function QueuedGroup(name,initiallyExpanded){this.name=name;this.initiallyExpanded=initiallyExpanded;} +QueuedGroup.prototype.append=function(){getConsoleWindow().group(this.name,this.initiallyExpanded);};function QueuedGroupEnd(){} +QueuedGroupEnd.prototype.append=function(){getConsoleWindow().groupEnd();};var checkAndAppend=function(){safeToAppend();if(!initialized){init();}else if(consoleClosed&&reopenWhenClosed){createWindow();} +if(safeToAppend()){appendQueuedLoggingEvents();}};this.append=function(loggingEvent){if(isSupported){var formattedMessage=appender.getLayout().formatWithException(loggingEvent);queuedLoggingEvents.push(new QueuedLoggingEvent(loggingEvent,formattedMessage));checkAndAppend();}};this.group=function(name,initiallyExpanded){if(isSupported){queuedLoggingEvents.push(new QueuedGroup(name,initiallyExpanded));checkAndAppend();}};this.groupEnd=function(){if(isSupported){queuedLoggingEvents.push(new QueuedGroupEnd());checkAndAppend();}};var appendQueuedLoggingEvents=function(){while(queuedLoggingEvents.length>0){queuedLoggingEvents.shift().append();} +if(focusConsoleWindow){getConsoleWindow().focus();}};this.setAddedToLogger=function(logger){this.loggers.push(logger);if(enabled&&!lazyInit){init();}};this.clear=function(){if(consoleWindowExists()){getConsoleWindow().clearLog();} +queuedLoggingEvents.length=0;};this.focus=function(){if(consoleWindowExists()){getConsoleWindow().focus();}};this.focusCommandLine=function(){if(consoleWindowExists()){getConsoleWindow().focusCommandLine();}};this.focusSearch=function(){if(consoleWindowExists()){getConsoleWindow().focusSearch();}};var commandWindow=window;this.getCommandWindow=function(){return commandWindow;};this.setCommandWindow=function(commandWindowParam){commandWindow=commandWindowParam;};this.executeLastCommand=function(){if(consoleWindowExists()){getConsoleWindow().evalLastCommand();}};var commandLayout=new PatternLayout("%m");this.getCommandLayout=function(){return commandLayout;};this.setCommandLayout=function(commandLayoutParam){commandLayout=commandLayoutParam;};this.evalCommandAndAppend=function(expr){var commandReturnValue={appendResult:true,isError:false};var commandOutput="";try{var result,i;if(!commandWindow.eval&&commandWindow.execScript){commandWindow.execScript("null");} +var commandLineFunctionsHash={};for(i=0,len=commandLineFunctions.length;i<len;i++){commandLineFunctionsHash[commandLineFunctions[i][0]]=commandLineFunctions[i][1];} +var objectsToRestore=[];var addObjectToRestore=function(name){objectsToRestore.push([name,commandWindow[name]]);};addObjectToRestore("appender");commandWindow.appender=appender;addObjectToRestore("commandReturnValue");commandWindow.commandReturnValue=commandReturnValue;addObjectToRestore("commandLineFunctionsHash");commandWindow.commandLineFunctionsHash=commandLineFunctionsHash;var addFunctionToWindow=function(name){addObjectToRestore(name);commandWindow[name]=function(){return this.commandLineFunctionsHash[name](appender,arguments,commandReturnValue);};};for(i=0,len=commandLineFunctions.length;i<len;i++){addFunctionToWindow(commandLineFunctions[i][0]);} +if(commandWindow===window&&commandWindow.execScript){addObjectToRestore("evalExpr");addObjectToRestore("result");window.evalExpr=expr;commandWindow.execScript("window.result=eval(window.evalExpr);");result=window.result;}else{result=commandWindow.eval(expr);} +commandOutput=isUndefined(result)?result:formatObjectExpansion(result,commandLineObjectExpansionDepth);for(i=0,len=objectsToRestore.length;i<len;i++){commandWindow[objectsToRestore[i][0]]=objectsToRestore[i][1];}}catch(ex){commandOutput="Error evaluating command: "+getExceptionStringRep(ex);commandReturnValue.isError=true;} +if(commandReturnValue.appendResult){var message=">>> "+expr;if(!isUndefined(commandOutput)){message+=newLine+commandOutput;} +var level=commandReturnValue.isError?Level.ERROR:Level.INFO;var loggingEvent=new LoggingEvent(null,new Date(),level,[message],null);var mainLayout=this.getLayout();this.setLayout(commandLayout);this.append(loggingEvent);this.setLayout(mainLayout);}};var commandLineFunctions=defaultCommandLineFunctions.concat([]);this.addCommandLineFunction=function(functionName,commandLineFunction){commandLineFunctions.push([functionName,commandLineFunction]);};var commandHistoryCookieName="log4javascriptCommandHistory";this.storeCommandHistory=function(commandHistory){setCookie(commandHistoryCookieName,commandHistory.join(","));};var writeHtml=function(doc){var lines=getConsoleHtmlLines();doc.open();for(var i=0,len=lines.length;i<len;i++){doc.writeln(lines[i]);} +doc.close();};this.setEventTypes(["load","unload"]);var consoleWindowLoadHandler=function(){var win=getConsoleWindow();win.setAppender(appender);win.setNewestAtTop(newestMessageAtTop);win.setScrollToLatest(scrollToLatestMessage);win.setMaxMessages(maxMessages);win.setShowCommandLine(showCommandLine);win.setShowHideButton(showHideButton);win.setShowCloseButton(showCloseButton);win.setMainWindow(window);var storedValue=getCookie(commandHistoryCookieName);if(storedValue){win.commandHistory=storedValue.split(",");win.currentCommandIndex=win.commandHistory.length;} +appender.dispatchEvent("load",{"win":win});};this.unload=function(){logLog.debug("unload "+this+", caller: "+this.unload.caller);if(!consoleClosed){logLog.debug("really doing unload "+this);consoleClosed=true;consoleWindowLoaded=false;consoleWindowCreated=false;appender.dispatchEvent("unload",{});}};var pollConsoleWindow=function(windowTest,interval,successCallback,errorMessage){function doPoll(){try{if(consoleClosed){clearInterval(poll);} +if(windowTest(getConsoleWindow())){clearInterval(poll);successCallback();}}catch(ex){clearInterval(poll);isSupported=false;handleError(errorMessage,ex);}} +var poll=setInterval(doPoll,interval);};var getConsoleUrl=function(){var documentDomainSet=(document.domain!=location.hostname);return useDocumentWrite?"":getBaseUrl()+"console.html"+ +(documentDomainSet?"?log4javascript_domain="+escape(document.domain):"");};if(inPage){var containerElement=null;var cssProperties=[];this.addCssProperty=function(name,value){if(checkCanConfigure("cssProperties")){cssProperties.push([name,value]);}};var windowCreationStarted=false;var iframeContainerDiv;var iframeId=uniqueId+"_InPageAppender_"+consoleAppenderId;this.hide=function(){if(initialized&&consoleWindowCreated){if(consoleWindowExists()){getConsoleWindow().$("command").blur();} +iframeContainerDiv.style.display="none";minimized=true;}};this.show=function(){if(initialized){if(consoleWindowCreated){iframeContainerDiv.style.display="block";this.setShowCommandLine(showCommandLine);minimized=false;}else if(!windowCreationStarted){createWindow(true);}}};this.isVisible=function(){return!minimized&&!consoleClosed;};this.close=function(fromButton){if(!consoleClosed&&(!fromButton||confirm("This will permanently remove the console from the page. No more messages will be logged. Do you wish to continue?"))){iframeContainerDiv.parentNode.removeChild(iframeContainerDiv);this.unload();}};open=function(){var initErrorMessage="InPageAppender.open: unable to create console iframe";function finalInit(){try{if(!initiallyMinimized){appender.show();} +consoleWindowLoadHandler();consoleWindowLoaded=true;appendQueuedLoggingEvents();}catch(ex){isSupported=false;handleError(initErrorMessage,ex);}} +function writeToDocument(){try{var windowTest=function(win){return isLoaded(win);};if(useDocumentWrite){writeHtml(getConsoleWindow().document);} +if(windowTest(getConsoleWindow())){finalInit();}else{pollConsoleWindow(windowTest,100,finalInit,initErrorMessage);}}catch(ex){isSupported=false;handleError(initErrorMessage,ex);}} +minimized=false;iframeContainerDiv=containerElement.appendChild(document.createElement("div"));iframeContainerDiv.style.width=width;iframeContainerDiv.style.height=height;iframeContainerDiv.style.border="solid gray 1px";for(var i=0,len=cssProperties.length;i<len;i++){iframeContainerDiv.style[cssProperties[i][0]]=cssProperties[i][1];} +var iframeSrc=useDocumentWrite?"":" src='"+getConsoleUrl()+"'";iframeContainerDiv.innerHTML="<iframe id='"+iframeId+"' name='"+iframeId+"' width='100%' height='100%' frameborder='0'"+iframeSrc+" scrolling='no'></iframe>";consoleClosed=false;var iframeDocumentExistsTest=function(win){try{return bool(win)&&bool(win.document);}catch(ex){return false;}};if(iframeDocumentExistsTest(getConsoleWindow())){writeToDocument();}else{pollConsoleWindow(iframeDocumentExistsTest,100,writeToDocument,initErrorMessage);} +consoleWindowCreated=true;};createWindow=function(show){if(show||!initiallyMinimized){var pageLoadHandler=function(){if(!container){containerElement=document.createElement("div");containerElement.style.position="fixed";containerElement.style.left="0";containerElement.style.right="0";containerElement.style.bottom="0";document.body.appendChild(containerElement);appender.addCssProperty("borderWidth","1px 0 0 0");appender.addCssProperty("zIndex",1000000);open();}else{try{var el=document.getElementById(container);if(el.nodeType==1){containerElement=el;} +open();}catch(ex){handleError("InPageAppender.init: invalid container element '"+container+"' supplied",ex);}}};if(pageLoaded&&container&&container.appendChild){containerElement=container;open();}else if(pageLoaded){pageLoadHandler();}else{log4javascript.addEventListener("load",pageLoadHandler);} +windowCreationStarted=true;}};init=function(){createWindow();initialized=true;};getConsoleWindow=function(){var iframe=window.frames[iframeId];if(iframe){return iframe;}};safeToAppend=function(){if(isSupported&&!consoleClosed){if(consoleWindowCreated&&!consoleWindowLoaded&&getConsoleWindow()&&isLoaded(getConsoleWindow())){consoleWindowLoaded=true;} +return consoleWindowLoaded;} +return false;};}else{var useOldPopUp=appender.defaults.useOldPopUp;var complainAboutPopUpBlocking=appender.defaults.complainAboutPopUpBlocking;var reopenWhenClosed=this.defaults.reopenWhenClosed;this.isUseOldPopUp=function(){return useOldPopUp;};this.setUseOldPopUp=function(useOldPopUpParam){if(checkCanConfigure("useOldPopUp")){useOldPopUp=bool(useOldPopUpParam);}};this.isComplainAboutPopUpBlocking=function(){return complainAboutPopUpBlocking;};this.setComplainAboutPopUpBlocking=function(complainAboutPopUpBlockingParam){if(checkCanConfigure("complainAboutPopUpBlocking")){complainAboutPopUpBlocking=bool(complainAboutPopUpBlockingParam);}};this.isFocusPopUp=function(){return focusConsoleWindow;};this.setFocusPopUp=function(focusPopUpParam){focusConsoleWindow=bool(focusPopUpParam);};this.isReopenWhenClosed=function(){return reopenWhenClosed;};this.setReopenWhenClosed=function(reopenWhenClosedParam){reopenWhenClosed=bool(reopenWhenClosedParam);};this.close=function(){logLog.debug("close "+this);try{popUp.close();this.unload();}catch(ex){}};this.hide=function(){logLog.debug("hide "+this);if(consoleWindowExists()){this.close();}};this.show=function(){logLog.debug("show "+this);if(!consoleWindowCreated){open();}};this.isVisible=function(){return safeToAppend();};var popUp;open=function(){var windowProperties="width="+width+",height="+height+",status,resizable";var frameInfo="";try{var frameEl=window.frameElement;if(frameEl){frameInfo="_"+frameEl.tagName+"_"+(frameEl.name||frameEl.id||"");}}catch(e){frameInfo="_inaccessibleParentFrame";} +var windowName="PopUp_"+location.host.replace(/[^a-z0-9]/gi,"_")+"_"+consoleAppenderId+frameInfo;if(!useOldPopUp||!useDocumentWrite){windowName=windowName+"_"+uniqueId;} +var checkPopUpClosed=function(win){if(consoleClosed){return true;}else{try{return bool(win)&&win.closed;}catch(ex){}} +return false;};var popUpClosedCallback=function(){if(!consoleClosed){appender.unload();}};function finalInit(){getConsoleWindow().setCloseIfOpenerCloses(!useOldPopUp||!useDocumentWrite);consoleWindowLoadHandler();consoleWindowLoaded=true;appendQueuedLoggingEvents();pollConsoleWindow(checkPopUpClosed,500,popUpClosedCallback,"PopUpAppender.checkPopUpClosed: error checking pop-up window");} +try{popUp=window.open(getConsoleUrl(),windowName,windowProperties);consoleClosed=false;consoleWindowCreated=true;if(popUp&&popUp.document){if(useDocumentWrite&&useOldPopUp&&isLoaded(popUp)){popUp.mainPageReloaded();finalInit();}else{if(useDocumentWrite){writeHtml(popUp.document);} +var popUpLoadedTest=function(win){return bool(win)&&isLoaded(win);};if(isLoaded(popUp)){finalInit();}else{pollConsoleWindow(popUpLoadedTest,100,finalInit,"PopUpAppender.init: unable to create console window");}}}else{isSupported=false;logLog.warn("PopUpAppender.init: pop-ups blocked, please unblock to use PopUpAppender");if(complainAboutPopUpBlocking){handleError("log4javascript: pop-up windows appear to be blocked. Please unblock them to use pop-up logging.");}}}catch(ex){handleError("PopUpAppender.init: error creating pop-up",ex);}};createWindow=function(){if(!initiallyMinimized){open();}};init=function(){createWindow();initialized=true;};getConsoleWindow=function(){return popUp;};safeToAppend=function(){if(isSupported&&!isUndefined(popUp)&&!consoleClosed){if(popUp.closed||(consoleWindowLoaded&&isUndefined(popUp.closed))){appender.unload();logLog.debug("PopUpAppender: pop-up closed");return false;} +if(!consoleWindowLoaded&&isLoaded(popUp)){consoleWindowLoaded=true;}} +return isSupported&&consoleWindowLoaded&&!consoleClosed;};} +this.getConsoleWindow=getConsoleWindow;};ConsoleAppender.addGlobalCommandLineFunction=function(functionName,commandLineFunction){defaultCommandLineFunctions.push([functionName,commandLineFunction]);};function PopUpAppender(lazyInit,initiallyMinimized,useDocumentWrite,width,height){this.create(false,null,lazyInit,initiallyMinimized,useDocumentWrite,width,height,this.defaults.focusPopUp);} +PopUpAppender.prototype=new ConsoleAppender();PopUpAppender.prototype.defaults={layout:new PatternLayout("%d{HH:mm:ss} %-5p - %m{1}%n"),initiallyMinimized:false,focusPopUp:false,lazyInit:true,useOldPopUp:true,complainAboutPopUpBlocking:true,newestMessageAtTop:false,scrollToLatestMessage:true,width:"600",height:"400",reopenWhenClosed:false,maxMessages:null,showCommandLine:true,commandLineObjectExpansionDepth:1,showHideButton:false,showCloseButton:true,useDocumentWrite:true};PopUpAppender.prototype.toString=function(){return"PopUpAppender";};log4javascript.PopUpAppender=PopUpAppender;function InPageAppender(container,lazyInit,initiallyMinimized,useDocumentWrite,width,height){this.create(true,container,lazyInit,initiallyMinimized,useDocumentWrite,width,height,false);} +InPageAppender.prototype=new ConsoleAppender();InPageAppender.prototype.defaults={layout:new PatternLayout("%d{HH:mm:ss} %-5p - %m{1}%n"),initiallyMinimized:false,lazyInit:true,newestMessageAtTop:false,scrollToLatestMessage:true,width:"100%",height:"220px",maxMessages:null,showCommandLine:true,commandLineObjectExpansionDepth:1,showHideButton:false,showCloseButton:false,showLogEntryDeleteButtons:true,useDocumentWrite:true};InPageAppender.prototype.toString=function(){return"InPageAppender";};log4javascript.InPageAppender=InPageAppender;log4javascript.InlineAppender=InPageAppender;})();function padWithSpaces(str,len){if(str.length<len){var spaces=[];var numberOfSpaces=Math.max(0,len-str.length);for(var i=0;i<numberOfSpaces;i++){spaces[i]=" ";} +str+=spaces.join("");} +return str;} +(function(){function dir(obj){var maxLen=0;for(var p in obj){maxLen=Math.max(toStr(p).length,maxLen);} +var propList=[];for(p in obj){var propNameStr=" "+padWithSpaces(toStr(p),maxLen+2);var propVal;try{propVal=splitIntoLines(toStr(obj[p])).join(padWithSpaces(newLine,maxLen+6));}catch(ex){propVal="[Error obtaining property. Details: "+getExceptionMessage(ex)+"]";} +propList.push(propNameStr+propVal);} +return propList.join(newLine);} +var nodeTypes={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12};var preFormattedElements=["script","pre"];var emptyElements=["br","img","hr","param","link","area","input","col","base","meta"];var indentationUnit=" ";function getXhtml(rootNode,includeRootNode,indentation,startNewLine,preformatted){includeRootNode=(typeof includeRootNode=="undefined")?true:!!includeRootNode;if(typeof indentation!="string"){indentation="";} +startNewLine=!!startNewLine;preformatted=!!preformatted;var xhtml;function isWhitespace(node){return((node.nodeType==nodeTypes.TEXT_NODE)&&/^[ \t\r\n]*$/.test(node.nodeValue));} +function fixAttributeValue(attrValue){return attrValue.toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;");} +function getStyleAttributeValue(el){var stylePairs=el.style.cssText.split(";");var styleValue="";for(var j=0,len=stylePairs.length;j<len;j++){var nameValueBits=stylePairs[j].split(":");var props=[];if(!/^\s*$/.test(nameValueBits[0])){props.push(trim(nameValueBits[0]).toLowerCase()+":"+trim(nameValueBits[1]));} +styleValue=props.join(";");} +return styleValue;} +function getNamespace(el){if(el.prefix){return el.prefix;}else if(el.outerHTML){var regex=new RegExp("<([^:]+):"+el.tagName+"[^>]*>","i");if(regex.test(el.outerHTML)){return RegExp.$1.toLowerCase();}} +return"";} +var lt="<";var gt=">";var i,len;if(includeRootNode&&rootNode.nodeType!=nodeTypes.DOCUMENT_FRAGMENT_NODE){switch(rootNode.nodeType){case nodeTypes.ELEMENT_NODE:var tagName=rootNode.tagName.toLowerCase();xhtml=startNewLine?newLine+indentation:"";xhtml+=lt;var prefix=getNamespace(rootNode);var hasPrefix=!!prefix;if(hasPrefix){xhtml+=prefix+":";} +xhtml+=tagName;for(i=0,len=rootNode.attributes.length;i<len;i++){var currentAttr=rootNode.attributes[i];if(!currentAttr.specified||currentAttr.nodeValue===null||currentAttr.nodeName.toLowerCase()==="style"||typeof currentAttr.nodeValue!=="string"||currentAttr.nodeName.indexOf("_moz")===0){continue;} +xhtml+=" "+currentAttr.nodeName.toLowerCase()+"=\"";xhtml+=fixAttributeValue(currentAttr.nodeValue);xhtml+="\"";} +if(rootNode.style.cssText){var styleValue=getStyleAttributeValue(rootNode);if(styleValue!==""){xhtml+=" style=\""+getStyleAttributeValue(rootNode)+"\"";}} +if(array_contains(emptyElements,tagName)||(hasPrefix&&!rootNode.hasChildNodes())){xhtml+="/"+gt;}else{xhtml+=gt;var childStartNewLine=!(rootNode.childNodes.length===1&&rootNode.childNodes[0].nodeType===nodeTypes.TEXT_NODE);var childPreformatted=array_contains(preFormattedElements,tagName);for(i=0,len=rootNode.childNodes.length;i<len;i++){xhtml+=getXhtml(rootNode.childNodes[i],true,indentation+indentationUnit,childStartNewLine,childPreformatted);} +var endTag=lt+"/"+tagName+gt;xhtml+=childStartNewLine?newLine+indentation+endTag:endTag;} +return xhtml;case nodeTypes.TEXT_NODE:if(isWhitespace(rootNode)){xhtml="";}else{if(preformatted){xhtml=rootNode.nodeValue;}else{var lines=splitIntoLines(trim(rootNode.nodeValue));var trimmedLines=[];for(i=0,len=lines.length;i<len;i++){trimmedLines[i]=trim(lines[i]);} +xhtml=trimmedLines.join(newLine+indentation);} +if(startNewLine){xhtml=newLine+indentation+xhtml;}} +return xhtml;case nodeTypes.CDATA_SECTION_NODE:return"<![CDA"+"TA["+rootNode.nodeValue+"]"+"]>"+newLine;case nodeTypes.DOCUMENT_NODE:xhtml="";for(i=0,len=rootNode.childNodes.length;i<len;i++){xhtml+=getXhtml(rootNode.childNodes[i],true,indentation);} +return xhtml;default:return"";}}else{xhtml="";for(i=0,len=rootNode.childNodes.length;i<len;i++){xhtml+=getXhtml(rootNode.childNodes[i],true,indentation+indentationUnit);} +return xhtml;}} +function createCommandLineFunctions(){ConsoleAppender.addGlobalCommandLineFunction("$",function(appender,args,returnValue){return document.getElementById(args[0]);});ConsoleAppender.addGlobalCommandLineFunction("dir",function(appender,args,returnValue){var lines=[];for(var i=0,len=args.length;i<len;i++){lines[i]=dir(args[i]);} +return lines.join(newLine+newLine);});ConsoleAppender.addGlobalCommandLineFunction("dirxml",function(appender,args,returnValue){var lines=[];for(var i=0,len=args.length;i<len;i++){lines[i]=getXhtml(args[i]);} +return lines.join(newLine+newLine);});ConsoleAppender.addGlobalCommandLineFunction("cd",function(appender,args,returnValue){var win,message;if(args.length===0||args[0]===""){win=window;message="Command line set to run in main window";}else{if(args[0].window==args[0]){win=args[0];message="Command line set to run in frame '"+args[0].name+"'";}else{win=window.frames[args[0]];if(win){message="Command line set to run in frame '"+args[0]+"'";}else{returnValue.isError=true;message="Frame '"+args[0]+"' does not exist";win=appender.getCommandWindow();}}} +appender.setCommandWindow(win);return message;});ConsoleAppender.addGlobalCommandLineFunction("clear",function(appender,args,returnValue){returnValue.appendResult=false;appender.clear();});ConsoleAppender.addGlobalCommandLineFunction("keys",function(appender,args,returnValue){var keys=[];for(var k in args[0]){keys.push(k);} +return keys;});ConsoleAppender.addGlobalCommandLineFunction("values",function(appender,args,returnValue){var values=[];for(var k in args[0]){try{values.push(args[0][k]);}catch(ex){logLog.warn("values(): Unable to obtain value for key "+k+". Details: "+getExceptionMessage(ex));}} +return values;});ConsoleAppender.addGlobalCommandLineFunction("expansionDepth",function(appender,args,returnValue){var expansionDepth=parseInt(args[0],10);if(isNaN(expansionDepth)||expansionDepth<0){returnValue.isError=true;return""+args[0]+" is not a valid expansion depth";}else{appender.setCommandLineObjectExpansionDepth(expansionDepth);return"Object expansion depth set to "+expansionDepth;}});} +function init(){createCommandLineFunctions();} +init();})();function createDefaultLogger(){var logger=log4javascript.getLogger(defaultLoggerName);var a=new log4javascript.PopUpAppender();logger.addAppender(a);return logger;} +log4javascript.setDocumentReady=function(){pageLoaded=true;log4javascript.dispatchEvent("load",{});};if(window.addEventListener){window.addEventListener("load",log4javascript.setDocumentReady,false);}else if(window.attachEvent){window.attachEvent("onload",log4javascript.setDocumentReady);}else{var oldOnload=window.onload;if(typeof window.onload!="function"){window.onload=log4javascript.setDocumentReady;}else{window.onload=function(evt){if(oldOnload){oldOnload(evt);} +log4javascript.setDocumentReady();};}} +return log4javascript;},this); + + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + /** * lite-url - Small, JS lib that uses regex for parsing a URL into it's component parts. * @version v1.0.5 * @link https://github.com/sadams/lite-url * @license BSD-3-Clause */ -(function(){"use strict";function n(e,t,n){var r=e.split(t);return n(r.shift(),r.join(t))}function r(e){var t={hash:"",host:"",hostname:"",origin:"",pathname:"",protocol:"",search:"",password:"",username:"",port:""};return n(e,"#",(function(e,r){r&&(t.hash=r?"#"+r:""),n(e,"?",(function(e,r){r&&(t.search="?"+r),e&&n(e,"//",(function(e,r){t.protocol=e,n(r,"/",(function(e,r){t.pathname="/"+(r||""),(t.protocol||e)&&(t.origin=t.protocol+"//"+e),n(e,"@",(function(e,r){if(r){var o=e.split(":");t.username=o[0],t.password=o[1]}else r=e;t.host=r,n(r,":",(function(e,n){t.hostname=e,n&&(t.port=n)}))}))}))}))}))})),t.href=t.origin+t.pathname+t.search+t.hash,t}function o(e){var t={},n=e.search;if(n){var r=(n=n.replace(new RegExp("\\?"),"")).split("&");for(var o in r)if(r.hasOwnProperty(o)&&r[o]){var i=r[o].split("=");t[i[0]]=i[1]}}return t}function i(e){var t=a[e];return void 0!==t||((t=r(e)).params=o(t),a[e]=t),t}var a={};return i.changeQueryParser=function(e){o=e},e.exports&&(t=e.exports=i),t.liteURL=i,i}).call(this)},function(e,t,n){(function(e,r){var o; -/*! +(function(){"use strict";function r(r,n,t){var e=r.split(n),o=e.shift();return t(o,e.join(n))}function n(n){var t={hash:"",host:"",hostname:"",origin:"",pathname:"",protocol:"",search:"",password:"",username:"",port:""};return r(n,"#",function(n,e){e&&(t.hash=e?"#"+e:""),r(n,"?",function(n,e){e&&(t.search="?"+e),n&&r(n,"//",function(n,e){t.protocol=n,r(e,"/",function(n,e){t.pathname="/"+(e||""),(t.protocol||n)&&(t.origin=t.protocol+"//"+n),r(n,"@",function(n,e){if(e){var o=n.split(":");t.username=o[0],t.password=o[1]}else e=n;t.host=e,r(e,":",function(r,n){t.hostname=r,n&&(t.port=n)})})})})})}),t.href=t.origin+t.pathname+t.search+t.hash,t}function t(r){var n={},t=r.search;if(t){t=t.replace(new RegExp("\\?"),"");var e=t.split("&");for(var o in e)if(e.hasOwnProperty(o)&&e[o]){var i=e[o].split("=");n[i[0]]=i[1]}}return n}function e(r){var e=i[r];return"undefined"!=typeof e?e:(e=n(r),e.params=t(e),i[r]=e,e)}var o=this,i={};return e.changeQueryParser=function(r){t=r}, true?( true&&module.exports&&(exports=module.exports=e),exports.liteURL=e):undefined,e}).call(this); + + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(module, global) {var __WEBPACK_AMD_DEFINE_RESULT__;/*! * Platform.js v1.3.6 * Copyright 2014-2020 Benjamin Tan * Copyright 2011-2013 John-David Dalton * Available under MIT license - */(function(){"use strict";var i={function:!0,object:!0},a=i[typeof window]&&window||this,s=i[typeof t]&&t,l=i[typeof e]&&e&&!e.nodeType&&e,c=s&&l&&"object"==typeof r&&r;!c||c.global!==c&&c.window!==c&&c.self!==c||(a=c);var u=Math.pow(2,53)-1,d=/\bOpera/,p=Object.prototype,h=p.hasOwnProperty,f=p.toString;function g(e){return(e=String(e)).charAt(0).toUpperCase()+e.slice(1)}function m(e){return e=C(e),/^(?:webOS|i(?:OS|P))/.test(e)?e:g(e)}function v(e,t){for(var n in e)h.call(e,n)&&t(e[n],n,e)}function y(e){return null==e?g(e):f.call(e).slice(8,-1)}function b(e){return String(e).replace(/([ -])(?!$)/g,"$1?")}function w(e,t){var n=null;return function(e,t){var n=-1,r=e?e.length:0;if("number"==typeof r&&r>-1&&r<=u)for(;++n<r;)t(e[n],n,e);else v(e,t)}(e,(function(r,o){n=t(n,r,o,e)})),n}function C(e){return String(e).replace(/^ +| +$/g,"")}var E=function e(t){var n=a,r=t&&"object"==typeof t&&"String"!=y(t);r&&(n=t,t=null);var o=n.navigator||{},i=o.userAgent||"";t||(t=i);var s,l,c,u,p,h=r?!!o.likeChrome:/\bChrome\b/.test(t)&&!/internal|\n/i.test(f.toString()),g=r?"Object":"ScriptBridgingProxyObject",E=r?"Object":"Environment",x=r&&n.java?"JavaPackage":y(n.java),L=r?"Object":"RuntimeObject",S=/\bJava/.test(x)&&n.java,T=S&&y(n.environment)==E,A=S?"a":"α",M=S?"b":"β",I=n.document||{},k=n.operamini||n.opera,R=d.test(R=r&&k?k["[[Class]]"]:y(k))?R:k=null,D=t,_=[],N=null,P=t==i,O=P&&k&&"function"==typeof k.version&&k.version(),B=w([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"],(function(e,n){return e||RegExp("\\b"+(n.pattern||b(n))+"\\b","i").exec(t)&&(n.label||n)})),F=function(e){return w(e,(function(e,n){return e||RegExp("\\b"+(n.pattern||b(n))+"\\b","i").exec(t)&&(n.label||n)}))}(["Adobe AIR","Arora","Avant Browser","Breach","Camino","Electron","Epiphany","Fennec","Flock","Galeon","GreenBrowser","iCab","Iceweasel","K-Meleon","Konqueror","Lunascape","Maxthon",{label:"Microsoft Edge",pattern:"(?:Edge|Edg|EdgA|EdgiOS)"},"Midori","Nook Browser","PaleMoon","PhantomJS","Raven","Rekonq","RockMelt",{label:"Samsung Internet",pattern:"SamsungBrowser"},"SeaMonkey",{label:"Silk",pattern:"(?:Cloud9|Silk-Accelerated)"},"Sleipnir","SlimBrowser",{label:"SRWare Iron",pattern:"Iron"},"Sunrise","Swiftfox","Vivaldi","Waterfox","WebPositive",{label:"Yandex Browser",pattern:"YaBrowser"},{label:"UC Browser",pattern:"UCBrowser"},"Opera Mini",{label:"Opera Mini",pattern:"OPiOS"},"Opera",{label:"Opera",pattern:"OPR"},"Chromium","Chrome",{label:"Chrome",pattern:"(?:HeadlessChrome)"},{label:"Chrome Mobile",pattern:"(?:CriOS|CrMo)"},{label:"Firefox",pattern:"(?:Firefox|Minefield)"},{label:"Firefox for iOS",pattern:"FxiOS"},{label:"IE",pattern:"IEMobile"},{label:"IE",pattern:"MSIE"},"Safari"]),j=H([{label:"BlackBerry",pattern:"BB10"},"BlackBerry",{label:"Galaxy S",pattern:"GT-I9000"},{label:"Galaxy S2",pattern:"GT-I9100"},{label:"Galaxy S3",pattern:"GT-I9300"},{label:"Galaxy S4",pattern:"GT-I9500"},{label:"Galaxy S5",pattern:"SM-G900"},{label:"Galaxy S6",pattern:"SM-G920"},{label:"Galaxy S6 Edge",pattern:"SM-G925"},{label:"Galaxy S7",pattern:"SM-G930"},{label:"Galaxy S7 Edge",pattern:"SM-G935"},"Google TV","Lumia","iPad","iPod","iPhone","Kindle",{label:"Kindle Fire",pattern:"(?:Cloud9|Silk-Accelerated)"},"Nexus","Nook","PlayBook","PlayStation Vita","PlayStation","TouchPad","Transformer",{label:"Wii U",pattern:"WiiU"},"Wii","Xbox One",{label:"Xbox 360",pattern:"Xbox"},"Xoom"]),$=function(e){return w(e,(function(e,n,r){return e||(n[j]||n[/^[a-z]+(?: +[a-z]+\b)*/i.exec(j)]||RegExp("\\b"+b(r)+"(?:\\b|\\w*\\d)","i").exec(t))&&r}))}({Apple:{iPad:1,iPhone:1,iPod:1},Alcatel:{},Archos:{},Amazon:{Kindle:1,"Kindle Fire":1},Asus:{Transformer:1},"Barnes & Noble":{Nook:1},BlackBerry:{PlayBook:1},Google:{"Google TV":1,Nexus:1},HP:{TouchPad:1},HTC:{},Huawei:{},Lenovo:{},LG:{},Microsoft:{Xbox:1,"Xbox One":1},Motorola:{Xoom:1},Nintendo:{"Wii U":1,Wii:1},Nokia:{Lumia:1},Oppo:{},Samsung:{"Galaxy S":1,"Galaxy S2":1,"Galaxy S3":1,"Galaxy S4":1},Sony:{PlayStation:1,"PlayStation Vita":1},Xiaomi:{Mi:1,Redmi:1}}),U=function(e){return w(e,(function(e,n){var r=n.pattern||b(n);return!e&&(e=RegExp("\\b"+r+"(?:/[\\d.]+|[ \\w.]*)","i").exec(t))&&(e=function(e,t,n){var r={"10.0":"10",6.4:"10 Technical Preview",6.3:"8.1",6.2:"8",6.1:"Server 2008 R2 / 7","6.0":"Server 2008 / Vista",5.2:"Server 2003 / XP 64-bit",5.1:"XP",5.01:"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};return t&&n&&/^Win/i.test(e)&&!/^Windows Phone /i.test(e)&&(r=r[/[\d.]+$/.exec(e)])&&(e="Windows "+r),e=String(e),t&&n&&(e=e.replace(RegExp(t,"i"),n)),e=m(e.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0])}(e,r,n.label||n)),e}))}(["Windows Phone","KaiOS","Android","CentOS",{label:"Chrome OS",pattern:"CrOS"},"Debian",{label:"DragonFly BSD",pattern:"DragonFly"},"Fedora","FreeBSD","Gentoo","Haiku","Kubuntu","Linux Mint","OpenBSD","Red Hat","SuSE","Ubuntu","Xubuntu","Cygwin","Symbian OS","hpwOS","webOS ","webOS","Tablet OS","Tizen","Linux","Mac OS X","Macintosh","Mac","Windows 98;","Windows "]);function H(e){return w(e,(function(e,n){var r=n.pattern||b(n);return!e&&(e=RegExp("\\b"+r+" *\\d+[.\\w_]*","i").exec(t)||RegExp("\\b"+r+" *\\w+-[\\w]*","i").exec(t)||RegExp("\\b"+r+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(t))&&((e=String(n.label&&!RegExp(r,"i").test(n.label)?n.label:e).split("/"))[1]&&!/[\d.]+/.test(e[0])&&(e[0]+=" "+e[1]),n=n.label||n,e=m(e[0].replace(RegExp(r,"i"),n).replace(RegExp("; *(?:"+n+"[_-])?","i")," ").replace(RegExp("("+n+")[-_.]?(\\w)","i"),"$1 $2"))),e}))}function W(e){return w(e,(function(e,n){return e||(RegExp(n+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(t)||0)[1]||null}))}if(B&&(B=[B]),/\bAndroid\b/.test(U)&&!j&&(s=/\bAndroid[^;]*;(.*?)(?:Build|\) AppleWebKit)\b/i.exec(t))&&(j=C(s[1]).replace(/^[a-z]{2}-[a-z]{2};\s*/i,"")||null),$&&!j?j=H([$]):$&&j&&(j=j.replace(RegExp("^("+b($)+")[-_.\\s]","i"),$+" ").replace(RegExp("^("+b($)+")[-_.]?(\\w)","i"),$+" $2")),(s=/\bGoogle TV\b/.exec(j))&&(j=s[0]),/\bSimulator\b/i.test(t)&&(j=(j?j+" ":"")+"Simulator"),"Opera Mini"==F&&/\bOPiOS\b/.test(t)&&_.push("running in Turbo/Uncompressed mode"),"IE"==F&&/\blike iPhone OS\b/.test(t)?($=(s=e(t.replace(/like iPhone OS/,""))).manufacturer,j=s.product):/^iP/.test(j)?(F||(F="Safari"),U="iOS"+((s=/ OS ([\d_]+)/i.exec(t))?" "+s[1].replace(/_/g,"."):"")):"Konqueror"==F&&/^Linux\b/i.test(U)?U="Kubuntu":$&&"Google"!=$&&(/Chrome/.test(F)&&!/\bMobile Safari\b/i.test(t)||/\bVita\b/.test(j))||/\bAndroid\b/.test(U)&&/^Chrome/.test(F)&&/\bVersion\//i.test(t)?(F="Android Browser",U=/\bAndroid\b/.test(U)?U:"Android"):"Silk"==F?(/\bMobi/i.test(t)||(U="Android",_.unshift("desktop mode")),/Accelerated *= *true/i.test(t)&&_.unshift("accelerated")):"UC Browser"==F&&/\bUCWEB\b/.test(t)?_.push("speed mode"):"PaleMoon"==F&&(s=/\bFirefox\/([\d.]+)\b/.exec(t))?_.push("identifying as Firefox "+s[1]):"Firefox"==F&&(s=/\b(Mobile|Tablet|TV)\b/i.exec(t))?(U||(U="Firefox OS"),j||(j=s[1])):!F||(s=!/\bMinefield\b/i.test(t)&&/\b(?:Firefox|Safari)\b/.exec(F))?(F&&!j&&/[\/,]|^[^(]+?\)/.test(t.slice(t.indexOf(s+"/")+8))&&(F=null),(s=j||$||U)&&(j||$||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(U))&&(F=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(U)?U:s)+" Browser")):"Electron"==F&&(s=(/\bChrome\/([\d.]+)\b/.exec(t)||0)[1])&&_.push("Chromium "+s),O||(O=W(["(?:Cloud9|CriOS|CrMo|Edge|Edg|EdgA|EdgiOS|FxiOS|HeadlessChrome|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$)|UCBrowser|YaBrowser)","Version",b(F),"(?:Firefox|Minefield|NetFront)"])),(s=("iCab"==B&&parseFloat(O)>3?"WebKit":/\bOpera\b/.test(F)&&(/\bOPR\b/.test(t)?"Blink":"Presto"))||/\b(?:Midori|Nook|Safari)\b/i.test(t)&&!/^(?:Trident|EdgeHTML)$/.test(B)&&"WebKit"||!B&&/\bMSIE\b/i.test(t)&&("Mac OS"==U?"Tasman":"Trident")||"WebKit"==B&&/\bPlayStation\b(?! Vita\b)/i.test(F)&&"NetFront")&&(B=[s]),"IE"==F&&(s=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(t)||0)[1])?(F+=" Mobile",U="Windows Phone "+(/\+$/.test(s)?s:s+".x"),_.unshift("desktop mode")):/\bWPDesktop\b/i.test(t)?(F="IE Mobile",U="Windows Phone 8.x",_.unshift("desktop mode"),O||(O=(/\brv:([\d.]+)/.exec(t)||0)[1])):"IE"!=F&&"Trident"==B&&(s=/\brv:([\d.]+)/.exec(t))&&(F&&_.push("identifying as "+F+(O?" "+O:"")),F="IE",O=s[1]),P){if(u="global",p=null!=(c=n)?typeof c[u]:"number",/^(?:boolean|number|string|undefined)$/.test(p)||"object"==p&&!c[u])y(s=n.runtime)==g?(F="Adobe AIR",U=s.flash.system.Capabilities.os):y(s=n.phantom)==L?(F="PhantomJS",O=(s=s.version||null)&&s.major+"."+s.minor+"."+s.patch):"number"==typeof I.documentMode&&(s=/\bTrident\/(\d+)/i.exec(t))?(O=[O,I.documentMode],(s=+s[1]+4)!=O[1]&&(_.push("IE "+O[1]+" mode"),B&&(B[1]=""),O[1]=s),O="IE"==F?String(O[1].toFixed(1)):O[0]):"number"==typeof I.documentMode&&/^(?:Chrome|Firefox)\b/.test(F)&&(_.push("masking as "+F+" "+O),F="IE",O="11.0",B=["Trident"],U="Windows");else if(S&&(D=(s=S.lang.System).getProperty("os.arch"),U=U||s.getProperty("os.name")+" "+s.getProperty("os.version")),T){try{O=n.require("ringo/engine").version.join("."),F="RingoJS"}catch(e){(s=n.system)&&s.global.system==n.system&&(F="Narwhal",U||(U=s[0].os||null))}F||(F="Rhino")}else"object"==typeof n.process&&!n.process.browser&&(s=n.process)&&("object"==typeof s.versions&&("string"==typeof s.versions.electron?(_.push("Node "+s.versions.node),F="Electron",O=s.versions.electron):"string"==typeof s.versions.nw&&(_.push("Chromium "+O,"Node "+s.versions.node),F="NW.js",O=s.versions.nw)),F||(F="Node.js",D=s.arch,U=s.platform,O=(O=/[\d.]+/.exec(s.version))?O[0]:null));U=U&&m(U)}if(O&&(s=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(O)||/(?:alpha|beta)(?: ?\d)?/i.exec(t+";"+(P&&o.appMinorVersion))||/\bMinefield\b/i.test(t)&&"a")&&(N=/b/i.test(s)?"beta":"alpha",O=O.replace(RegExp(s+"\\+?$"),"")+("beta"==N?M:A)+(/\d+\+?/.exec(s)||"")),"Fennec"==F||"Firefox"==F&&/\b(?:Android|Firefox OS|KaiOS)\b/.test(U))F="Firefox Mobile";else if("Maxthon"==F&&O)O=O.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(j))"Xbox 360"==j&&(U=null),"Xbox 360"==j&&/\bIEMobile\b/.test(t)&&_.unshift("mobile mode");else if(!/^(?:Chrome|IE|Opera)$/.test(F)&&(!F||j||/Browser|Mobi/.test(F))||"Windows CE"!=U&&!/Mobi/i.test(t))if("IE"==F&&P)try{null===n.external&&_.unshift("platform preview")}catch(e){_.unshift("embedded")}else(/\bBlackBerry\b/.test(j)||/\bBB10\b/.test(t))&&(s=(RegExp(j.replace(/ +/g," *")+"/([.\\d]+)","i").exec(t)||0)[1]||O)?(U=((s=[s,/BB10/.test(t)])[1]?(j=null,$="BlackBerry"):"Device Software")+" "+s[0],O=null):this!=v&&"Wii"!=j&&(P&&k||/Opera/.test(F)&&/\b(?:MSIE|Firefox)\b/i.test(t)||"Firefox"==F&&/\bOS X (?:\d+\.){2,}/.test(U)||"IE"==F&&(U&&!/^Win/.test(U)&&O>5.5||/\bWindows XP\b/.test(U)&&O>8||8==O&&!/\bTrident\b/.test(t)))&&!d.test(s=e.call(v,t.replace(d,"")+";"))&&s.name&&(s="ing as "+s.name+((s=s.version)?" "+s:""),d.test(F)?(/\bIE\b/.test(s)&&"Mac OS"==U&&(U=null),s="identify"+s):(s="mask"+s,F=R?m(R.replace(/([a-z])([A-Z])/g,"$1 $2")):"Opera",/\bIE\b/.test(s)&&(U=null),P||(O=null)),B=["Presto"],_.push(s));else F+=" Mobile";(s=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(t)||0)[1])&&(s=[parseFloat(s.replace(/\.(\d)$/,".0$1")),s],"Safari"==F&&"+"==s[1].slice(-1)?(F="WebKit Nightly",N="alpha",O=s[1].slice(0,-1)):O!=s[1]&&O!=(s[2]=(/\bSafari\/([\d.]+\+?)/i.exec(t)||0)[1])||(O=null),s[1]=(/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(t)||0)[1],537.36==s[0]&&537.36==s[2]&&parseFloat(s[1])>=28&&"WebKit"==B&&(B=["Blink"]),P&&(h||s[1])?(B&&(B[1]="like Chrome"),s=s[1]||((s=s[0])<530?1:s<532?2:s<532.05?3:s<533?4:s<534.03?5:s<534.07?6:s<534.1?7:s<534.13?8:s<534.16?9:s<534.24?10:s<534.3?11:s<535.01?12:s<535.02?"13+":s<535.07?15:s<535.11?16:s<535.19?17:s<536.05?18:s<536.1?19:s<537.01?20:s<537.11?"21+":s<537.13?23:s<537.18?24:s<537.24?25:s<537.36?26:"Blink"!=B?"27":"28")):(B&&(B[1]="like Safari"),s=(s=s[0])<400?1:s<500?2:s<526?3:s<533?4:s<534?"4+":s<535?5:s<537?6:s<538?7:s<601?8:s<602?9:s<604?10:s<606?11:s<608?12:"12"),B&&(B[1]+=" "+(s+="number"==typeof s?".x":/[.+]/.test(s)?"":"+")),"Safari"==F&&(!O||parseInt(O)>45)?O=s:"Chrome"==F&&/\bHeadlessChrome/i.test(t)&&_.unshift("headless")),"Opera"==F&&(s=/\bzbov|zvav$/.exec(U))?(F+=" ",_.unshift("desktop mode"),"zvav"==s?(F+="Mini",O=null):F+="Mobile",U=U.replace(RegExp(" *"+s+"$"),"")):"Safari"==F&&/\bChrome\b/.exec(B&&B[1])?(_.unshift("desktop mode"),F="Chrome Mobile",O=null,/\bOS X\b/.test(U)?($="Apple",U="iOS 4.3+"):U=null):/\bSRWare Iron\b/.test(F)&&!O&&(O=W("Chrome")),O&&0==O.indexOf(s=/[\d.]+$/.exec(U))&&t.indexOf("/"+s+"-")>-1&&(U=C(U.replace(s,""))),U&&-1!=U.indexOf(F)&&!RegExp(F+" OS").test(U)&&(U=U.replace(RegExp(" *"+b(F)+" *"),"")),B&&!/\b(?:Avant|Nook)\b/.test(F)&&(/Browser|Lunascape|Maxthon/.test(F)||"Safari"!=F&&/^iOS/.test(U)&&/\bSafari\b/.test(B[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(F)&&B[1])&&(s=B[B.length-1])&&_.push(s),_.length&&(_=["("+_.join("; ")+")"]),$&&j&&j.indexOf($)<0&&_.push("on "+$),j&&_.push((/^on /.test(_[_.length-1])?"":"on ")+j),U&&(s=/ ([\d.+]+)$/.exec(U),l=s&&"/"==U.charAt(U.length-s[0].length-1),U={architecture:32,family:s&&!l?U.replace(s[0],""):U,version:s?s[1]:null,toString:function(){var e=this.version;return this.family+(e&&!l?" "+e:"")+(64==this.architecture?" 64-bit":"")}}),(s=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(D))&&!/\bi686\b/i.test(D)?(U&&(U.architecture=64,U.family=U.family.replace(RegExp(" *"+s),"")),F&&(/\bWOW64\b/i.test(t)||P&&/\w(?:86|32)$/.test(o.cpuClass||o.platform)&&!/\bWin64; x64\b/i.test(t))&&_.unshift("32-bit")):U&&/^OS X/.test(U.family)&&"Chrome"==F&&parseFloat(O)>=39&&(U.architecture=64),t||(t=null);var G={};return G.description=t,G.layout=B&&B[0],G.manufacturer=$,G.name=F,G.prerelease=N,G.product=j,G.ua=t,G.version=F&&O,G.os=U||{architecture:null,family:null,version:null,toString:function(){return"null"}},G.parse=e,G.toString=function(){return this.description||""},G.version&&_.unshift(O),G.name&&_.unshift(F),U&&F&&(U!=String(U).split(" ")[0]||U!=F.split(" ")[0]&&!j)&&_.push(j?"("+U+")":"on "+U),_.length&&(G.description=_.join(" ")),G}();a.platform=E,void 0===(o=function(){return E}.call(t,n,t,e))||(e.exports=o)}).call(this)}).call(this,n(7)(e),n(0))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict"; + */ +;(function() { + 'use strict'; + + /** Used to determine if values are of the language type `Object`. */ + var objectTypes = { + 'function': true, + 'object': true + }; + + /** Used as a reference to the global object. */ + var root = (objectTypes[typeof window] && window) || this; + + /** Backup possible global object. */ + var oldRoot = root; + + /** Detect free variable `exports`. */ + var freeExports = objectTypes[typeof exports] && exports; + + /** Detect free variable `module`. */ + var freeModule = objectTypes[typeof module] && module && !module.nodeType && module; + + /** Detect free variable `global` from Node.js or Browserified code and use it as `root`. */ + var freeGlobal = freeExports && freeModule && typeof global == 'object' && global; + if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal)) { + root = freeGlobal; + } + + /** + * Used as the maximum length of an array-like object. + * See the [ES6 spec](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength) + * for more details. + */ + var maxSafeInteger = Math.pow(2, 53) - 1; + + /** Regular expression to detect Opera. */ + var reOpera = /\bOpera/; + + /** Possible global object. */ + var thisBinding = this; + + /** Used for native method references. */ + var objectProto = Object.prototype; + + /** Used to check for own properties of an object. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** Used to resolve the internal `[[Class]]` of values. */ + var toString = objectProto.toString; + + /*--------------------------------------------------------------------------*/ + + /** + * Capitalizes a string value. + * + * @private + * @param {string} string The string to capitalize. + * @returns {string} The capitalized string. + */ + function capitalize(string) { + string = String(string); + return string.charAt(0).toUpperCase() + string.slice(1); + } + + /** + * A utility function to clean up the OS name. + * + * @private + * @param {string} os The OS name to clean up. + * @param {string} [pattern] A `RegExp` pattern matching the OS name. + * @param {string} [label] A label for the OS. + */ + function cleanupOS(os, pattern, label) { + // Platform tokens are defined at: + // http://msdn.microsoft.com/en-us/library/ms537503(VS.85).aspx + // http://web.archive.org/web/20081122053950/http://msdn.microsoft.com/en-us/library/ms537503(VS.85).aspx + var data = { + '10.0': '10', + '6.4': '10 Technical Preview', + '6.3': '8.1', + '6.2': '8', + '6.1': 'Server 2008 R2 / 7', + '6.0': 'Server 2008 / Vista', + '5.2': 'Server 2003 / XP 64-bit', + '5.1': 'XP', + '5.01': '2000 SP1', + '5.0': '2000', + '4.0': 'NT', + '4.90': 'ME' + }; + // Detect Windows version from platform tokens. + if (pattern && label && /^Win/i.test(os) && !/^Windows Phone /i.test(os) && + (data = data[/[\d.]+$/.exec(os)])) { + os = 'Windows ' + data; + } + // Correct character case and cleanup string. + os = String(os); + + if (pattern && label) { + os = os.replace(RegExp(pattern, 'i'), label); + } + + os = format( + os.replace(/ ce$/i, ' CE') + .replace(/\bhpw/i, 'web') + .replace(/\bMacintosh\b/, 'Mac OS') + .replace(/_PowerPC\b/i, ' OS') + .replace(/\b(OS X) [^ \d]+/i, '$1') + .replace(/\bMac (OS X)\b/, '$1') + .replace(/\/(\d)/, ' $1') + .replace(/_/g, '.') + .replace(/(?: BePC|[ .]*fc[ \d.]+)$/i, '') + .replace(/\bx86\.64\b/gi, 'x86_64') + .replace(/\b(Windows Phone) OS\b/, '$1') + .replace(/\b(Chrome OS \w+) [\d.]+\b/, '$1') + .split(' on ')[0] + ); + + return os; + } + + /** + * An iteration utility for arrays and objects. + * + * @private + * @param {Array|Object} object The object to iterate over. + * @param {Function} callback The function called per iteration. + */ + function each(object, callback) { + var index = -1, + length = object ? object.length : 0; + + if (typeof length == 'number' && length > -1 && length <= maxSafeInteger) { + while (++index < length) { + callback(object[index], index, object); + } + } else { + forOwn(object, callback); + } + } + + /** + * Trim and conditionally capitalize string values. + * + * @private + * @param {string} string The string to format. + * @returns {string} The formatted string. + */ + function format(string) { + string = trim(string); + return /^(?:webOS|i(?:OS|P))/.test(string) + ? string + : capitalize(string); + } + + /** + * Iterates over an object's own properties, executing the `callback` for each. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} callback The function executed per own property. + */ + function forOwn(object, callback) { + for (var key in object) { + if (hasOwnProperty.call(object, key)) { + callback(object[key], key, object); + } + } + } + + /** + * Gets the internal `[[Class]]` of a value. + * + * @private + * @param {*} value The value. + * @returns {string} The `[[Class]]`. + */ + function getClassOf(value) { + return value == null + ? capitalize(value) + : toString.call(value).slice(8, -1); + } + + /** + * Host objects can return type values that are different from their actual + * data type. The objects we are concerned with usually return non-primitive + * types of "object", "function", or "unknown". + * + * @private + * @param {*} object The owner of the property. + * @param {string} property The property to check. + * @returns {boolean} Returns `true` if the property value is a non-primitive, else `false`. + */ + function isHostType(object, property) { + var type = object != null ? typeof object[property] : 'number'; + return !/^(?:boolean|number|string|undefined)$/.test(type) && + (type == 'object' ? !!object[property] : true); + } + + /** + * Prepares a string for use in a `RegExp` by making hyphens and spaces optional. + * + * @private + * @param {string} string The string to qualify. + * @returns {string} The qualified string. + */ + function qualify(string) { + return String(string).replace(/([ -])(?!$)/g, '$1?'); + } + + /** + * A bare-bones `Array#reduce` like utility function. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function called per iteration. + * @returns {*} The accumulated result. + */ + function reduce(array, callback) { + var accumulator = null; + each(array, function(value, index) { + accumulator = callback(accumulator, value, index, array); + }); + return accumulator; + } + + /** + * Removes leading and trailing whitespace from a string. + * + * @private + * @param {string} string The string to trim. + * @returns {string} The trimmed string. + */ + function trim(string) { + return String(string).replace(/^ +| +$/g, ''); + } + + /*--------------------------------------------------------------------------*/ + + /** + * Creates a new platform object. + * + * @memberOf platform + * @param {Object|string} [ua=navigator.userAgent] The user agent string or + * context object. + * @returns {Object} A platform object. + */ + function parse(ua) { + + /** The environment context object. */ + var context = root; + + /** Used to flag when a custom context is provided. */ + var isCustomContext = ua && typeof ua == 'object' && getClassOf(ua) != 'String'; + + // Juggle arguments. + if (isCustomContext) { + context = ua; + ua = null; + } + + /** Browser navigator object. */ + var nav = context.navigator || {}; + + /** Browser user agent string. */ + var userAgent = nav.userAgent || ''; + + ua || (ua = userAgent); + + /** Used to flag when `thisBinding` is the [ModuleScope]. */ + var isModuleScope = isCustomContext || thisBinding == oldRoot; + + /** Used to detect if browser is like Chrome. */ + var likeChrome = isCustomContext + ? !!nav.likeChrome + : /\bChrome\b/.test(ua) && !/internal|\n/i.test(toString.toString()); + + /** Internal `[[Class]]` value shortcuts. */ + var objectClass = 'Object', + airRuntimeClass = isCustomContext ? objectClass : 'ScriptBridgingProxyObject', + enviroClass = isCustomContext ? objectClass : 'Environment', + javaClass = (isCustomContext && context.java) ? 'JavaPackage' : getClassOf(context.java), + phantomClass = isCustomContext ? objectClass : 'RuntimeObject'; + + /** Detect Java environments. */ + var java = /\bJava/.test(javaClass) && context.java; + + /** Detect Rhino. */ + var rhino = java && getClassOf(context.environment) == enviroClass; + + /** A character to represent alpha. */ + var alpha = java ? 'a' : '\u03b1'; + + /** A character to represent beta. */ + var beta = java ? 'b' : '\u03b2'; + + /** Browser document object. */ + var doc = context.document || {}; + + /** + * Detect Opera browser (Presto-based). + * http://www.howtocreate.co.uk/operaStuff/operaObject.html + * http://dev.opera.com/articles/view/opera-mini-web-content-authoring-guidelines/#operamini + */ + var opera = context.operamini || context.opera; + + /** Opera `[[Class]]`. */ + var operaClass = reOpera.test(operaClass = (isCustomContext && opera) ? opera['[[Class]]'] : getClassOf(opera)) + ? operaClass + : (opera = null); + + /*------------------------------------------------------------------------*/ + + /** Temporary variable used over the script's lifetime. */ + var data; + + /** The CPU architecture. */ + var arch = ua; + + /** Platform description array. */ + var description = []; + + /** Platform alpha/beta indicator. */ + var prerelease = null; + + /** A flag to indicate that environment features should be used to resolve the platform. */ + var useFeatures = ua == userAgent; + + /** The browser/environment version. */ + var version = useFeatures && opera && typeof opera.version == 'function' && opera.version(); + + /** A flag to indicate if the OS ends with "/ Version" */ + var isSpecialCasedOS; + + /* Detectable layout engines (order is important). */ + var layout = getLayout([ + { 'label': 'EdgeHTML', 'pattern': 'Edge' }, + 'Trident', + { 'label': 'WebKit', 'pattern': 'AppleWebKit' }, + 'iCab', + 'Presto', + 'NetFront', + 'Tasman', + 'KHTML', + 'Gecko' + ]); + + /* Detectable browser names (order is important). */ + var name = getName([ + 'Adobe AIR', + 'Arora', + 'Avant Browser', + 'Breach', + 'Camino', + 'Electron', + 'Epiphany', + 'Fennec', + 'Flock', + 'Galeon', + 'GreenBrowser', + 'iCab', + 'Iceweasel', + 'K-Meleon', + 'Konqueror', + 'Lunascape', + 'Maxthon', + { 'label': 'Microsoft Edge', 'pattern': '(?:Edge|Edg|EdgA|EdgiOS)' }, + 'Midori', + 'Nook Browser', + 'PaleMoon', + 'PhantomJS', + 'Raven', + 'Rekonq', + 'RockMelt', + { 'label': 'Samsung Internet', 'pattern': 'SamsungBrowser' }, + 'SeaMonkey', + { 'label': 'Silk', 'pattern': '(?:Cloud9|Silk-Accelerated)' }, + 'Sleipnir', + 'SlimBrowser', + { 'label': 'SRWare Iron', 'pattern': 'Iron' }, + 'Sunrise', + 'Swiftfox', + 'Vivaldi', + 'Waterfox', + 'WebPositive', + { 'label': 'Yandex Browser', 'pattern': 'YaBrowser' }, + { 'label': 'UC Browser', 'pattern': 'UCBrowser' }, + 'Opera Mini', + { 'label': 'Opera Mini', 'pattern': 'OPiOS' }, + 'Opera', + { 'label': 'Opera', 'pattern': 'OPR' }, + 'Chromium', + 'Chrome', + { 'label': 'Chrome', 'pattern': '(?:HeadlessChrome)' }, + { 'label': 'Chrome Mobile', 'pattern': '(?:CriOS|CrMo)' }, + { 'label': 'Firefox', 'pattern': '(?:Firefox|Minefield)' }, + { 'label': 'Firefox for iOS', 'pattern': 'FxiOS' }, + { 'label': 'IE', 'pattern': 'IEMobile' }, + { 'label': 'IE', 'pattern': 'MSIE' }, + 'Safari' + ]); + + /* Detectable products (order is important). */ + var product = getProduct([ + { 'label': 'BlackBerry', 'pattern': 'BB10' }, + 'BlackBerry', + { 'label': 'Galaxy S', 'pattern': 'GT-I9000' }, + { 'label': 'Galaxy S2', 'pattern': 'GT-I9100' }, + { 'label': 'Galaxy S3', 'pattern': 'GT-I9300' }, + { 'label': 'Galaxy S4', 'pattern': 'GT-I9500' }, + { 'label': 'Galaxy S5', 'pattern': 'SM-G900' }, + { 'label': 'Galaxy S6', 'pattern': 'SM-G920' }, + { 'label': 'Galaxy S6 Edge', 'pattern': 'SM-G925' }, + { 'label': 'Galaxy S7', 'pattern': 'SM-G930' }, + { 'label': 'Galaxy S7 Edge', 'pattern': 'SM-G935' }, + 'Google TV', + 'Lumia', + 'iPad', + 'iPod', + 'iPhone', + 'Kindle', + { 'label': 'Kindle Fire', 'pattern': '(?:Cloud9|Silk-Accelerated)' }, + 'Nexus', + 'Nook', + 'PlayBook', + 'PlayStation Vita', + 'PlayStation', + 'TouchPad', + 'Transformer', + { 'label': 'Wii U', 'pattern': 'WiiU' }, + 'Wii', + 'Xbox One', + { 'label': 'Xbox 360', 'pattern': 'Xbox' }, + 'Xoom' + ]); + + /* Detectable manufacturers. */ + var manufacturer = getManufacturer({ + 'Apple': { 'iPad': 1, 'iPhone': 1, 'iPod': 1 }, + 'Alcatel': {}, + 'Archos': {}, + 'Amazon': { 'Kindle': 1, 'Kindle Fire': 1 }, + 'Asus': { 'Transformer': 1 }, + 'Barnes & Noble': { 'Nook': 1 }, + 'BlackBerry': { 'PlayBook': 1 }, + 'Google': { 'Google TV': 1, 'Nexus': 1 }, + 'HP': { 'TouchPad': 1 }, + 'HTC': {}, + 'Huawei': {}, + 'Lenovo': {}, + 'LG': {}, + 'Microsoft': { 'Xbox': 1, 'Xbox One': 1 }, + 'Motorola': { 'Xoom': 1 }, + 'Nintendo': { 'Wii U': 1, 'Wii': 1 }, + 'Nokia': { 'Lumia': 1 }, + 'Oppo': {}, + 'Samsung': { 'Galaxy S': 1, 'Galaxy S2': 1, 'Galaxy S3': 1, 'Galaxy S4': 1 }, + 'Sony': { 'PlayStation': 1, 'PlayStation Vita': 1 }, + 'Xiaomi': { 'Mi': 1, 'Redmi': 1 } + }); + + /* Detectable operating systems (order is important). */ + var os = getOS([ + 'Windows Phone', + 'KaiOS', + 'Android', + 'CentOS', + { 'label': 'Chrome OS', 'pattern': 'CrOS' }, + 'Debian', + { 'label': 'DragonFly BSD', 'pattern': 'DragonFly' }, + 'Fedora', + 'FreeBSD', + 'Gentoo', + 'Haiku', + 'Kubuntu', + 'Linux Mint', + 'OpenBSD', + 'Red Hat', + 'SuSE', + 'Ubuntu', + 'Xubuntu', + 'Cygwin', + 'Symbian OS', + 'hpwOS', + 'webOS ', + 'webOS', + 'Tablet OS', + 'Tizen', + 'Linux', + 'Mac OS X', + 'Macintosh', + 'Mac', + 'Windows 98;', + 'Windows ' + ]); + + /*------------------------------------------------------------------------*/ + + /** + * Picks the layout engine from an array of guesses. + * + * @private + * @param {Array} guesses An array of guesses. + * @returns {null|string} The detected layout engine. + */ + function getLayout(guesses) { + return reduce(guesses, function(result, guess) { + return result || RegExp('\\b' + ( + guess.pattern || qualify(guess) + ) + '\\b', 'i').exec(ua) && (guess.label || guess); + }); + } + + /** + * Picks the manufacturer from an array of guesses. + * + * @private + * @param {Array} guesses An object of guesses. + * @returns {null|string} The detected manufacturer. + */ + function getManufacturer(guesses) { + return reduce(guesses, function(result, value, key) { + // Lookup the manufacturer by product or scan the UA for the manufacturer. + return result || ( + value[product] || + value[/^[a-z]+(?: +[a-z]+\b)*/i.exec(product)] || + RegExp('\\b' + qualify(key) + '(?:\\b|\\w*\\d)', 'i').exec(ua) + ) && key; + }); + } + + /** + * Picks the browser name from an array of guesses. + * + * @private + * @param {Array} guesses An array of guesses. + * @returns {null|string} The detected browser name. + */ + function getName(guesses) { + return reduce(guesses, function(result, guess) { + return result || RegExp('\\b' + ( + guess.pattern || qualify(guess) + ) + '\\b', 'i').exec(ua) && (guess.label || guess); + }); + } + + /** + * Picks the OS name from an array of guesses. + * + * @private + * @param {Array} guesses An array of guesses. + * @returns {null|string} The detected OS name. + */ + function getOS(guesses) { + return reduce(guesses, function(result, guess) { + var pattern = guess.pattern || qualify(guess); + if (!result && (result = + RegExp('\\b' + pattern + '(?:/[\\d.]+|[ \\w.]*)', 'i').exec(ua) + )) { + result = cleanupOS(result, pattern, guess.label || guess); + } + return result; + }); + } + + /** + * Picks the product name from an array of guesses. + * + * @private + * @param {Array} guesses An array of guesses. + * @returns {null|string} The detected product name. + */ + function getProduct(guesses) { + return reduce(guesses, function(result, guess) { + var pattern = guess.pattern || qualify(guess); + if (!result && (result = + RegExp('\\b' + pattern + ' *\\d+[.\\w_]*', 'i').exec(ua) || + RegExp('\\b' + pattern + ' *\\w+-[\\w]*', 'i').exec(ua) || + RegExp('\\b' + pattern + '(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)', 'i').exec(ua) + )) { + // Split by forward slash and append product version if needed. + if ((result = String((guess.label && !RegExp(pattern, 'i').test(guess.label)) ? guess.label : result).split('/'))[1] && !/[\d.]+/.test(result[0])) { + result[0] += ' ' + result[1]; + } + // Correct character case and cleanup string. + guess = guess.label || guess; + result = format(result[0] + .replace(RegExp(pattern, 'i'), guess) + .replace(RegExp('; *(?:' + guess + '[_-])?', 'i'), ' ') + .replace(RegExp('(' + guess + ')[-_.]?(\\w)', 'i'), '$1 $2')); + } + return result; + }); + } + + /** + * Resolves the version using an array of UA patterns. + * + * @private + * @param {Array} patterns An array of UA patterns. + * @returns {null|string} The detected version. + */ + function getVersion(patterns) { + return reduce(patterns, function(result, pattern) { + return result || (RegExp(pattern + + '(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)', 'i').exec(ua) || 0)[1] || null; + }); + } + + /** + * Returns `platform.description` when the platform object is coerced to a string. + * + * @name toString + * @memberOf platform + * @returns {string} Returns `platform.description` if available, else an empty string. + */ + function toStringPlatform() { + return this.description || ''; + } + + /*------------------------------------------------------------------------*/ + + // Convert layout to an array so we can add extra details. + layout && (layout = [layout]); + + // Detect Android products. + // Browsers on Android devices typically provide their product IDS after "Android;" + // up to "Build" or ") AppleWebKit". + // Example: + // "Mozilla/5.0 (Linux; Android 8.1.0; Moto G (5) Plus) AppleWebKit/537.36 + // (KHTML, like Gecko) Chrome/70.0.3538.80 Mobile Safari/537.36" + if (/\bAndroid\b/.test(os) && !product && + (data = /\bAndroid[^;]*;(.*?)(?:Build|\) AppleWebKit)\b/i.exec(ua))) { + product = trim(data[1]) + // Replace any language codes (eg. "en-US"). + .replace(/^[a-z]{2}-[a-z]{2};\s*/i, '') + || null; + } + // Detect product names that contain their manufacturer's name. + if (manufacturer && !product) { + product = getProduct([manufacturer]); + } else if (manufacturer && product) { + product = product + .replace(RegExp('^(' + qualify(manufacturer) + ')[-_.\\s]', 'i'), manufacturer + ' ') + .replace(RegExp('^(' + qualify(manufacturer) + ')[-_.]?(\\w)', 'i'), manufacturer + ' $2'); + } + // Clean up Google TV. + if ((data = /\bGoogle TV\b/.exec(product))) { + product = data[0]; + } + // Detect simulators. + if (/\bSimulator\b/i.test(ua)) { + product = (product ? product + ' ' : '') + 'Simulator'; + } + // Detect Opera Mini 8+ running in Turbo/Uncompressed mode on iOS. + if (name == 'Opera Mini' && /\bOPiOS\b/.test(ua)) { + description.push('running in Turbo/Uncompressed mode'); + } + // Detect IE Mobile 11. + if (name == 'IE' && /\blike iPhone OS\b/.test(ua)) { + data = parse(ua.replace(/like iPhone OS/, '')); + manufacturer = data.manufacturer; + product = data.product; + } + // Detect iOS. + else if (/^iP/.test(product)) { + name || (name = 'Safari'); + os = 'iOS' + ((data = / OS ([\d_]+)/i.exec(ua)) + ? ' ' + data[1].replace(/_/g, '.') + : ''); + } + // Detect Kubuntu. + else if (name == 'Konqueror' && /^Linux\b/i.test(os)) { + os = 'Kubuntu'; + } + // Detect Android browsers. + else if ((manufacturer && manufacturer != 'Google' && + ((/Chrome/.test(name) && !/\bMobile Safari\b/i.test(ua)) || /\bVita\b/.test(product))) || + (/\bAndroid\b/.test(os) && /^Chrome/.test(name) && /\bVersion\//i.test(ua))) { + name = 'Android Browser'; + os = /\bAndroid\b/.test(os) ? os : 'Android'; + } + // Detect Silk desktop/accelerated modes. + else if (name == 'Silk') { + if (!/\bMobi/i.test(ua)) { + os = 'Android'; + description.unshift('desktop mode'); + } + if (/Accelerated *= *true/i.test(ua)) { + description.unshift('accelerated'); + } + } + // Detect UC Browser speed mode. + else if (name == 'UC Browser' && /\bUCWEB\b/.test(ua)) { + description.push('speed mode'); + } + // Detect PaleMoon identifying as Firefox. + else if (name == 'PaleMoon' && (data = /\bFirefox\/([\d.]+)\b/.exec(ua))) { + description.push('identifying as Firefox ' + data[1]); + } + // Detect Firefox OS and products running Firefox. + else if (name == 'Firefox' && (data = /\b(Mobile|Tablet|TV)\b/i.exec(ua))) { + os || (os = 'Firefox OS'); + product || (product = data[1]); + } + // Detect false positives for Firefox/Safari. + else if (!name || (data = !/\bMinefield\b/i.test(ua) && /\b(?:Firefox|Safari)\b/.exec(name))) { + // Escape the `/` for Firefox 1. + if (name && !product && /[\/,]|^[^(]+?\)/.test(ua.slice(ua.indexOf(data + '/') + 8))) { + // Clear name of false positives. + name = null; + } + // Reassign a generic name. + if ((data = product || manufacturer || os) && + (product || manufacturer || /\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(os))) { + name = /[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(os) ? os : data) + ' Browser'; + } + } + // Add Chrome version to description for Electron. + else if (name == 'Electron' && (data = (/\bChrome\/([\d.]+)\b/.exec(ua) || 0)[1])) { + description.push('Chromium ' + data); + } + // Detect non-Opera (Presto-based) versions (order is important). + if (!version) { + version = getVersion([ + '(?:Cloud9|CriOS|CrMo|Edge|Edg|EdgA|EdgiOS|FxiOS|HeadlessChrome|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$)|UCBrowser|YaBrowser)', + 'Version', + qualify(name), + '(?:Firefox|Minefield|NetFront)' + ]); + } + // Detect stubborn layout engines. + if ((data = + layout == 'iCab' && parseFloat(version) > 3 && 'WebKit' || + /\bOpera\b/.test(name) && (/\bOPR\b/.test(ua) ? 'Blink' : 'Presto') || + /\b(?:Midori|Nook|Safari)\b/i.test(ua) && !/^(?:Trident|EdgeHTML)$/.test(layout) && 'WebKit' || + !layout && /\bMSIE\b/i.test(ua) && (os == 'Mac OS' ? 'Tasman' : 'Trident') || + layout == 'WebKit' && /\bPlayStation\b(?! Vita\b)/i.test(name) && 'NetFront' + )) { + layout = [data]; + } + // Detect Windows Phone 7 desktop mode. + if (name == 'IE' && (data = (/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(ua) || 0)[1])) { + name += ' Mobile'; + os = 'Windows Phone ' + (/\+$/.test(data) ? data : data + '.x'); + description.unshift('desktop mode'); + } + // Detect Windows Phone 8.x desktop mode. + else if (/\bWPDesktop\b/i.test(ua)) { + name = 'IE Mobile'; + os = 'Windows Phone 8.x'; + description.unshift('desktop mode'); + version || (version = (/\brv:([\d.]+)/.exec(ua) || 0)[1]); + } + // Detect IE 11 identifying as other browsers. + else if (name != 'IE' && layout == 'Trident' && (data = /\brv:([\d.]+)/.exec(ua))) { + if (name) { + description.push('identifying as ' + name + (version ? ' ' + version : '')); + } + name = 'IE'; + version = data[1]; + } + // Leverage environment features. + if (useFeatures) { + // Detect server-side environments. + // Rhino has a global function while others have a global object. + if (isHostType(context, 'global')) { + if (java) { + data = java.lang.System; + arch = data.getProperty('os.arch'); + os = os || data.getProperty('os.name') + ' ' + data.getProperty('os.version'); + } + if (rhino) { + try { + version = context.require('ringo/engine').version.join('.'); + name = 'RingoJS'; + } catch(e) { + if ((data = context.system) && data.global.system == context.system) { + name = 'Narwhal'; + os || (os = data[0].os || null); + } + } + if (!name) { + name = 'Rhino'; + } + } + else if ( + typeof context.process == 'object' && !context.process.browser && + (data = context.process) + ) { + if (typeof data.versions == 'object') { + if (typeof data.versions.electron == 'string') { + description.push('Node ' + data.versions.node); + name = 'Electron'; + version = data.versions.electron; + } else if (typeof data.versions.nw == 'string') { + description.push('Chromium ' + version, 'Node ' + data.versions.node); + name = 'NW.js'; + version = data.versions.nw; + } + } + if (!name) { + name = 'Node.js'; + arch = data.arch; + os = data.platform; + version = /[\d.]+/.exec(data.version); + version = version ? version[0] : null; + } + } + } + // Detect Adobe AIR. + else if (getClassOf((data = context.runtime)) == airRuntimeClass) { + name = 'Adobe AIR'; + os = data.flash.system.Capabilities.os; + } + // Detect PhantomJS. + else if (getClassOf((data = context.phantom)) == phantomClass) { + name = 'PhantomJS'; + version = (data = data.version || null) && (data.major + '.' + data.minor + '.' + data.patch); + } + // Detect IE compatibility modes. + else if (typeof doc.documentMode == 'number' && (data = /\bTrident\/(\d+)/i.exec(ua))) { + // We're in compatibility mode when the Trident version + 4 doesn't + // equal the document mode. + version = [version, doc.documentMode]; + if ((data = +data[1] + 4) != version[1]) { + description.push('IE ' + version[1] + ' mode'); + layout && (layout[1] = ''); + version[1] = data; + } + version = name == 'IE' ? String(version[1].toFixed(1)) : version[0]; + } + // Detect IE 11 masking as other browsers. + else if (typeof doc.documentMode == 'number' && /^(?:Chrome|Firefox)\b/.test(name)) { + description.push('masking as ' + name + ' ' + version); + name = 'IE'; + version = '11.0'; + layout = ['Trident']; + os = 'Windows'; + } + os = os && format(os); + } + // Detect prerelease phases. + if (version && (data = + /(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(version) || + /(?:alpha|beta)(?: ?\d)?/i.exec(ua + ';' + (useFeatures && nav.appMinorVersion)) || + /\bMinefield\b/i.test(ua) && 'a' + )) { + prerelease = /b/i.test(data) ? 'beta' : 'alpha'; + version = version.replace(RegExp(data + '\\+?$'), '') + + (prerelease == 'beta' ? beta : alpha) + (/\d+\+?/.exec(data) || ''); + } + // Detect Firefox Mobile. + if (name == 'Fennec' || name == 'Firefox' && /\b(?:Android|Firefox OS|KaiOS)\b/.test(os)) { + name = 'Firefox Mobile'; + } + // Obscure Maxthon's unreliable version. + else if (name == 'Maxthon' && version) { + version = version.replace(/\.[\d.]+/, '.x'); + } + // Detect Xbox 360 and Xbox One. + else if (/\bXbox\b/i.test(product)) { + if (product == 'Xbox 360') { + os = null; + } + if (product == 'Xbox 360' && /\bIEMobile\b/.test(ua)) { + description.unshift('mobile mode'); + } + } + // Add mobile postfix. + else if ((/^(?:Chrome|IE|Opera)$/.test(name) || name && !product && !/Browser|Mobi/.test(name)) && + (os == 'Windows CE' || /Mobi/i.test(ua))) { + name += ' Mobile'; + } + // Detect IE platform preview. + else if (name == 'IE' && useFeatures) { + try { + if (context.external === null) { + description.unshift('platform preview'); + } + } catch(e) { + description.unshift('embedded'); + } + } + // Detect BlackBerry OS version. + // http://docs.blackberry.com/en/developers/deliverables/18169/HTTP_headers_sent_by_BB_Browser_1234911_11.jsp + else if ((/\bBlackBerry\b/.test(product) || /\bBB10\b/.test(ua)) && (data = + (RegExp(product.replace(/ +/g, ' *') + '/([.\\d]+)', 'i').exec(ua) || 0)[1] || + version + )) { + data = [data, /BB10/.test(ua)]; + os = (data[1] ? (product = null, manufacturer = 'BlackBerry') : 'Device Software') + ' ' + data[0]; + version = null; + } + // Detect Opera identifying/masking itself as another browser. + // http://www.opera.com/support/kb/view/843/ + else if (this != forOwn && product != 'Wii' && ( + (useFeatures && opera) || + (/Opera/.test(name) && /\b(?:MSIE|Firefox)\b/i.test(ua)) || + (name == 'Firefox' && /\bOS X (?:\d+\.){2,}/.test(os)) || + (name == 'IE' && ( + (os && !/^Win/.test(os) && version > 5.5) || + /\bWindows XP\b/.test(os) && version > 8 || + version == 8 && !/\bTrident\b/.test(ua) + )) + ) && !reOpera.test((data = parse.call(forOwn, ua.replace(reOpera, '') + ';'))) && data.name) { + // When "identifying", the UA contains both Opera and the other browser's name. + data = 'ing as ' + data.name + ((data = data.version) ? ' ' + data : ''); + if (reOpera.test(name)) { + if (/\bIE\b/.test(data) && os == 'Mac OS') { + os = null; + } + data = 'identify' + data; + } + // When "masking", the UA contains only the other browser's name. + else { + data = 'mask' + data; + if (operaClass) { + name = format(operaClass.replace(/([a-z])([A-Z])/g, '$1 $2')); + } else { + name = 'Opera'; + } + if (/\bIE\b/.test(data)) { + os = null; + } + if (!useFeatures) { + version = null; + } + } + layout = ['Presto']; + description.push(data); + } + // Detect WebKit Nightly and approximate Chrome/Safari versions. + if ((data = (/\bAppleWebKit\/([\d.]+\+?)/i.exec(ua) || 0)[1])) { + // Correct build number for numeric comparison. + // (e.g. "532.5" becomes "532.05") + data = [parseFloat(data.replace(/\.(\d)$/, '.0$1')), data]; + // Nightly builds are postfixed with a "+". + if (name == 'Safari' && data[1].slice(-1) == '+') { + name = 'WebKit Nightly'; + prerelease = 'alpha'; + version = data[1].slice(0, -1); + } + // Clear incorrect browser versions. + else if (version == data[1] || + version == (data[2] = (/\bSafari\/([\d.]+\+?)/i.exec(ua) || 0)[1])) { + version = null; + } + // Use the full Chrome version when available. + data[1] = (/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(ua) || 0)[1]; + // Detect Blink layout engine. + if (data[0] == 537.36 && data[2] == 537.36 && parseFloat(data[1]) >= 28 && layout == 'WebKit') { + layout = ['Blink']; + } + // Detect JavaScriptCore. + // http://stackoverflow.com/questions/6768474/how-can-i-detect-which-javascript-engine-v8-or-jsc-is-used-at-runtime-in-androi + if (!useFeatures || (!likeChrome && !data[1])) { + layout && (layout[1] = 'like Safari'); + data = (data = data[0], data < 400 ? 1 : data < 500 ? 2 : data < 526 ? 3 : data < 533 ? 4 : data < 534 ? '4+' : data < 535 ? 5 : data < 537 ? 6 : data < 538 ? 7 : data < 601 ? 8 : data < 602 ? 9 : data < 604 ? 10 : data < 606 ? 11 : data < 608 ? 12 : '12'); + } else { + layout && (layout[1] = 'like Chrome'); + data = data[1] || (data = data[0], data < 530 ? 1 : data < 532 ? 2 : data < 532.05 ? 3 : data < 533 ? 4 : data < 534.03 ? 5 : data < 534.07 ? 6 : data < 534.10 ? 7 : data < 534.13 ? 8 : data < 534.16 ? 9 : data < 534.24 ? 10 : data < 534.30 ? 11 : data < 535.01 ? 12 : data < 535.02 ? '13+' : data < 535.07 ? 15 : data < 535.11 ? 16 : data < 535.19 ? 17 : data < 536.05 ? 18 : data < 536.10 ? 19 : data < 537.01 ? 20 : data < 537.11 ? '21+' : data < 537.13 ? 23 : data < 537.18 ? 24 : data < 537.24 ? 25 : data < 537.36 ? 26 : layout != 'Blink' ? '27' : '28'); + } + // Add the postfix of ".x" or "+" for approximate versions. + layout && (layout[1] += ' ' + (data += typeof data == 'number' ? '.x' : /[.+]/.test(data) ? '' : '+')); + // Obscure version for some Safari 1-2 releases. + if (name == 'Safari' && (!version || parseInt(version) > 45)) { + version = data; + } else if (name == 'Chrome' && /\bHeadlessChrome/i.test(ua)) { + description.unshift('headless'); + } + } + // Detect Opera desktop modes. + if (name == 'Opera' && (data = /\bzbov|zvav$/.exec(os))) { + name += ' '; + description.unshift('desktop mode'); + if (data == 'zvav') { + name += 'Mini'; + version = null; + } else { + name += 'Mobile'; + } + os = os.replace(RegExp(' *' + data + '$'), ''); + } + // Detect Chrome desktop mode. + else if (name == 'Safari' && /\bChrome\b/.exec(layout && layout[1])) { + description.unshift('desktop mode'); + name = 'Chrome Mobile'; + version = null; + + if (/\bOS X\b/.test(os)) { + manufacturer = 'Apple'; + os = 'iOS 4.3+'; + } else { + os = null; + } + } + // Newer versions of SRWare Iron uses the Chrome tag to indicate its version number. + else if (/\bSRWare Iron\b/.test(name) && !version) { + version = getVersion('Chrome'); + } + // Strip incorrect OS versions. + if (version && version.indexOf((data = /[\d.]+$/.exec(os))) == 0 && + ua.indexOf('/' + data + '-') > -1) { + os = trim(os.replace(data, '')); + } + // Ensure OS does not include the browser name. + if (os && os.indexOf(name) != -1 && !RegExp(name + ' OS').test(os)) { + os = os.replace(RegExp(' *' + qualify(name) + ' *'), ''); + } + // Add layout engine. + if (layout && !/\b(?:Avant|Nook)\b/.test(name) && ( + /Browser|Lunascape|Maxthon/.test(name) || + name != 'Safari' && /^iOS/.test(os) && /\bSafari\b/.test(layout[1]) || + /^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(name) && layout[1])) { + // Don't add layout details to description if they are falsey. + (data = layout[layout.length - 1]) && description.push(data); + } + // Combine contextual information. + if (description.length) { + description = ['(' + description.join('; ') + ')']; + } + // Append manufacturer to description. + if (manufacturer && product && product.indexOf(manufacturer) < 0) { + description.push('on ' + manufacturer); + } + // Append product to description. + if (product) { + description.push((/^on /.test(description[description.length - 1]) ? '' : 'on ') + product); + } + // Parse the OS into an object. + if (os) { + data = / ([\d.+]+)$/.exec(os); + isSpecialCasedOS = data && os.charAt(os.length - data[0].length - 1) == '/'; + os = { + 'architecture': 32, + 'family': (data && !isSpecialCasedOS) ? os.replace(data[0], '') : os, + 'version': data ? data[1] : null, + 'toString': function() { + var version = this.version; + return this.family + ((version && !isSpecialCasedOS) ? ' ' + version : '') + (this.architecture == 64 ? ' 64-bit' : ''); + } + }; + } + // Add browser/OS architecture. + if ((data = /\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(arch)) && !/\bi686\b/i.test(arch)) { + if (os) { + os.architecture = 64; + os.family = os.family.replace(RegExp(' *' + data), ''); + } + if ( + name && (/\bWOW64\b/i.test(ua) || + (useFeatures && /\w(?:86|32)$/.test(nav.cpuClass || nav.platform) && !/\bWin64; x64\b/i.test(ua))) + ) { + description.unshift('32-bit'); + } + } + // Chrome 39 and above on OS X is always 64-bit. + else if ( + os && /^OS X/.test(os.family) && + name == 'Chrome' && parseFloat(version) >= 39 + ) { + os.architecture = 64; + } + + ua || (ua = null); + + /*------------------------------------------------------------------------*/ + + /** + * The platform object. + * + * @name platform + * @type Object + */ + var platform = {}; + + /** + * The platform description. + * + * @memberOf platform + * @type string|null + */ + platform.description = ua; + + /** + * The name of the browser's layout engine. + * + * The list of common layout engines include: + * "Blink", "EdgeHTML", "Gecko", "Trident" and "WebKit" + * + * @memberOf platform + * @type string|null + */ + platform.layout = layout && layout[0]; + + /** + * The name of the product's manufacturer. + * + * The list of manufacturers include: + * "Apple", "Archos", "Amazon", "Asus", "Barnes & Noble", "BlackBerry", + * "Google", "HP", "HTC", "LG", "Microsoft", "Motorola", "Nintendo", + * "Nokia", "Samsung" and "Sony" + * + * @memberOf platform + * @type string|null + */ + platform.manufacturer = manufacturer; + + /** + * The name of the browser/environment. + * + * The list of common browser names include: + * "Chrome", "Electron", "Firefox", "Firefox for iOS", "IE", + * "Microsoft Edge", "PhantomJS", "Safari", "SeaMonkey", "Silk", + * "Opera Mini" and "Opera" + * + * Mobile versions of some browsers have "Mobile" appended to their name: + * eg. "Chrome Mobile", "Firefox Mobile", "IE Mobile" and "Opera Mobile" + * + * @memberOf platform + * @type string|null + */ + platform.name = name; + + /** + * The alpha/beta release indicator. + * + * @memberOf platform + * @type string|null + */ + platform.prerelease = prerelease; + + /** + * The name of the product hosting the browser. + * + * The list of common products include: + * + * "BlackBerry", "Galaxy S4", "Lumia", "iPad", "iPod", "iPhone", "Kindle", + * "Kindle Fire", "Nexus", "Nook", "PlayBook", "TouchPad" and "Transformer" + * + * @memberOf platform + * @type string|null + */ + platform.product = product; + + /** + * The browser's user agent string. + * + * @memberOf platform + * @type string|null + */ + platform.ua = ua; + + /** + * The browser/environment version. + * + * @memberOf platform + * @type string|null + */ + platform.version = name && version; + + /** + * The name of the operating system. + * + * @memberOf platform + * @type Object + */ + platform.os = os || { + + /** + * The CPU architecture the OS is built for. + * + * @memberOf platform.os + * @type number|null + */ + 'architecture': null, + + /** + * The family of the OS. + * + * Common values include: + * "Windows", "Windows Server 2008 R2 / 7", "Windows Server 2008 / Vista", + * "Windows XP", "OS X", "Linux", "Ubuntu", "Debian", "Fedora", "Red Hat", + * "SuSE", "Android", "iOS" and "Windows Phone" + * + * @memberOf platform.os + * @type string|null + */ + 'family': null, + + /** + * The version of the OS. + * + * @memberOf platform.os + * @type string|null + */ + 'version': null, + + /** + * Returns the OS string. + * + * @memberOf platform.os + * @returns {string} The OS string. + */ + 'toString': function() { return 'null'; } + }; + + platform.parse = parse; + platform.toString = toStringPlatform; + + if (platform.version) { + description.unshift(version); + } + if (platform.name) { + description.unshift(name); + } + if (os && name && !(os == String(os).split(' ')[0] && (os == name.split(' ')[0] || product))) { + description.push(product ? '(' + os + ')' : 'on ' + os); + } + if (description.length) { + platform.description = description.join(' '); + } + return platform; + } + + /*--------------------------------------------------------------------------*/ + + // Export platform. + var platform = parse(); + + // Some AMD build optimizers, like r.js, check for condition patterns like the following: + if (true) { + // Expose platform on the global object to prevent errors when platform is + // loaded by a script tag in the presence of an AMD loader. + // See http://requirejs.org/docs/errors.html#mismatch for more details. + root.platform = platform; + + // Define as an anonymous module so platform can be aliased through path mapping. + !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { + return platform; + }).call(exports, __webpack_require__, exports, module), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } + // Check for `exports` after `define` in case a build optimizer adds an `exports` object. + else {} +}.call(this)); + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(7)(module), __webpack_require__(0))) + +/***/ }), +/* 7 */ +/***/ (function(module, exports) { + +module.exports = function(module) { + if (!module.webpackPolyfill) { + module.deprecate = function() {}; + module.paths = []; + // module.parent = undefined by default + if (!module.children) module.children = []; + Object.defineProperty(module, "loaded", { + enumerable: true, + get: function() { + return module.l; + } + }); + Object.defineProperty(module, "id", { + enumerable: true, + get: function() { + return module.i; + } + }); + module.webpackPolyfill = 1; + } + return module; +}; + + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* + # ----------------------------------------------------------------------------- + # ~/js/adapter/adapter.js + # Provides an empty object for later loaded adapter objects + # + # Product/Info: + # https://jekyll.one + # + # Copyright (C) 2021 Juergen Adams + # + # J1 Template is licensed under MIT License. + # See: https://github.com/jekyll-one-org/J1 Template/blob/master/LICENSE + # ----------------------------------------------------------------------------- +*/ + // ----------------------------------------------------------------------------- +// ESLint shimming +// ----------------------------------------------------------------------------- + +/* eslint indent: "off" */ + +/* eslint no-unused-vars: "off" */ + +/* eslint no-undef: "off" */ +// ----------------------------------------------------------------------------- + /*! * J1 Adapter * Copyright (C) 2021 Juergen Adams * Licensed under MIT License. - */e.exports=(j1,window,{_init_:function(){}})},function(e,t,n){"use strict";var r={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0},o={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},i=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],a={CSS:{},springs:{}};function s(e,t,n){return Math.min(Math.max(e,t),n)}function l(e,t){return e.indexOf(t)>-1}function c(e,t){return e.apply(null,t)}var u={arr:function(e){return Array.isArray(e)},obj:function(e){return l(Object.prototype.toString.call(e),"Object")},pth:function(e){return u.obj(e)&&e.hasOwnProperty("totalLength")},svg:function(e){return e instanceof SVGElement},inp:function(e){return e instanceof HTMLInputElement},dom:function(e){return e.nodeType||u.svg(e)},str:function(e){return"string"==typeof e},fnc:function(e){return"function"==typeof e},und:function(e){return void 0===e},hex:function(e){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(e)},rgb:function(e){return/^rgb/.test(e)},hsl:function(e){return/^hsl/.test(e)},col:function(e){return u.hex(e)||u.rgb(e)||u.hsl(e)},key:function(e){return!r.hasOwnProperty(e)&&!o.hasOwnProperty(e)&&"targets"!==e&&"keyframes"!==e}};function d(e){var t=/\(([^)]+)\)/.exec(e);return t?t[1].split(",").map((function(e){return parseFloat(e)})):[]}function p(e,t){var n=d(e),r=s(u.und(n[0])?1:n[0],.1,100),o=s(u.und(n[1])?100:n[1],.1,100),i=s(u.und(n[2])?10:n[2],.1,100),l=s(u.und(n[3])?0:n[3],.1,100),c=Math.sqrt(o/r),p=i/(2*Math.sqrt(o*r)),h=p<1?c*Math.sqrt(1-p*p):0,f=p<1?(p*c-l)/h:-l+c;function g(e){var n=t?t*e/1e3:e;return n=p<1?Math.exp(-n*p*c)*(1*Math.cos(h*n)+f*Math.sin(h*n)):(1+f*n)*Math.exp(-n*c),0===e||1===e?e:1-n}return t?g:function(){var t=a.springs[e];if(t)return t;for(var n=0,r=0;;)if(1===g(n+=1/6)){if(++r>=16)break}else r=0;var o=n*(1/6)*1e3;return a.springs[e]=o,o}}function h(e){return void 0===e&&(e=10),function(t){return Math.ceil(s(t,1e-6,1)*e)*(1/e)}}var f,g,m=function(){function e(e,t){return 1-3*t+3*e}function t(e,t){return 3*t-6*e}function n(e){return 3*e}function r(r,o,i){return((e(o,i)*r+t(o,i))*r+n(o))*r}function o(r,o,i){return 3*e(o,i)*r*r+2*t(o,i)*r+n(o)}return function(e,t,n,i){if(0<=e&&e<=1&&0<=n&&n<=1){var a=new Float32Array(11);if(e!==t||n!==i)for(var s=0;s<11;++s)a[s]=r(.1*s,e,n);return function(o){return e===t&&n===i||0===o||1===o?o:r(l(o),t,i)}}function l(t){for(var i=0,s=1;10!==s&&a[s]<=t;++s)i+=.1;--s;var l=i+.1*((t-a[s])/(a[s+1]-a[s])),c=o(l,e,n);return c>=.001?function(e,t,n,i){for(var a=0;a<4;++a){var s=o(t,n,i);if(0===s)return t;t-=(r(t,n,i)-e)/s}return t}(t,l,e,n):0===c?l:function(e,t,n,o,i){var a,s,l=0;do{(a=r(s=t+(n-t)/2,o,i)-e)>0?n=s:t=s}while(Math.abs(a)>1e-7&&++l<10);return s}(t,i,i+.1,e,n)}}}(),v=(f={linear:function(){return function(e){return e}}},g={Sine:function(){return function(e){return 1-Math.cos(e*Math.PI/2)}},Circ:function(){return function(e){return 1-Math.sqrt(1-e*e)}},Back:function(){return function(e){return e*e*(3*e-2)}},Bounce:function(){return function(e){for(var t,n=4;e<((t=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*t-2)/22-e,2)}},Elastic:function(e,t){void 0===e&&(e=1),void 0===t&&(t=.5);var n=s(e,1,10),r=s(t,.1,2);return function(e){return 0===e||1===e?e:-n*Math.pow(2,10*(e-1))*Math.sin((e-1-r/(2*Math.PI)*Math.asin(1/n))*(2*Math.PI)/r)}}},["Quad","Cubic","Quart","Quint","Expo"].forEach((function(e,t){g[e]=function(){return function(e){return Math.pow(e,t+2)}}})),Object.keys(g).forEach((function(e){var t=g[e];f["easeIn"+e]=t,f["easeOut"+e]=function(e,n){return function(r){return 1-t(e,n)(1-r)}},f["easeInOut"+e]=function(e,n){return function(r){return r<.5?t(e,n)(2*r)/2:1-t(e,n)(-2*r+2)/2}}})),f);function y(e,t){if(u.fnc(e))return e;var n=e.split("(")[0],r=v[n],o=d(e);switch(n){case"spring":return p(e,t);case"cubicBezier":return c(m,o);case"steps":return c(h,o);default:return c(r,o)}}function b(e){try{return document.querySelectorAll(e)}catch(e){return}}function w(e,t){for(var n=e.length,r=arguments.length>=2?arguments[1]:void 0,o=[],i=0;i<n;i++)if(i in e){var a=e[i];t.call(r,a,i,e)&&o.push(a)}return o}function C(e){return e.reduce((function(e,t){return e.concat(u.arr(t)?C(t):t)}),[])}function E(e){return u.arr(e)?e:(u.str(e)&&(e=b(e)||e),e instanceof NodeList||e instanceof HTMLCollection?[].slice.call(e):[e])}function x(e,t){return e.some((function(e){return e===t}))}function L(e){var t={};for(var n in e)t[n]=e[n];return t}function S(e,t){var n=L(e);for(var r in e)n[r]=t.hasOwnProperty(r)?t[r]:e[r];return n}function T(e,t){var n=L(e);for(var r in t)n[r]=u.und(e[r])?t[r]:e[r];return n}function A(e){return u.rgb(e)?(n=/rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(t=e))?"rgba("+n[1]+",1)":t:u.hex(e)?function(e){var t=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(e,t,n,r){return t+t+n+n+r+r})),n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return"rgba("+parseInt(n[1],16)+","+parseInt(n[2],16)+","+parseInt(n[3],16)+",1)"}(e):u.hsl(e)?function(e){var t,n,r,o=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(e)||/hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(e),i=parseInt(o[1],10)/360,a=parseInt(o[2],10)/100,s=parseInt(o[3],10)/100,l=o[4]||1;function c(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(0==a)t=n=r=s;else{var u=s<.5?s*(1+a):s+a-s*a,d=2*s-u;t=c(d,u,i+1/3),n=c(d,u,i),r=c(d,u,i-1/3)}return"rgba("+255*t+","+255*n+","+255*r+","+l+")"}(e):void 0;var t,n}function M(e){var t=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(e);if(t)return t[1]}function I(e,t){return u.fnc(e)?e(t.target,t.id,t.total):e}function k(e,t){return e.getAttribute(t)}function R(e,t,n){if(x([n,"deg","rad","turn"],M(t)))return t;var r=a.CSS[t+n];if(!u.und(r))return r;var o=document.createElement(e.tagName),i=e.parentNode&&e.parentNode!==document?e.parentNode:document.body;i.appendChild(o),o.style.position="absolute",o.style.width=100+n;var s=100/o.offsetWidth;i.removeChild(o);var l=s*parseFloat(t);return a.CSS[t+n]=l,l}function D(e,t,n){if(t in e.style){var r=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),o=e.style[t]||getComputedStyle(e).getPropertyValue(r)||"0";return n?R(e,o,n):o}}function _(e,t){return u.dom(e)&&!u.inp(e)&&(k(e,t)||u.svg(e)&&e[t])?"attribute":u.dom(e)&&x(i,t)?"transform":u.dom(e)&&"transform"!==t&&D(e,t)?"css":null!=e[t]?"object":void 0}function N(e){if(u.dom(e)){for(var t,n=e.style.transform||"",r=/(\w+)\(([^)]*)\)/g,o=new Map;t=r.exec(n);)o.set(t[1],t[2]);return o}}function P(e,t,n,r){var o=l(t,"scale")?1:0+function(e){return l(e,"translate")||"perspective"===e?"px":l(e,"rotate")||l(e,"skew")?"deg":void 0}(t),i=N(e).get(t)||o;return n&&(n.transforms.list.set(t,i),n.transforms.last=t),r?R(e,i,r):i}function O(e,t,n,r){switch(_(e,t)){case"transform":return P(e,t,r,n);case"css":return D(e,t,n);case"attribute":return k(e,t);default:return e[t]||0}}function B(e,t){var n=/^(\*=|\+=|-=)/.exec(e);if(!n)return e;var r=M(e)||0,o=parseFloat(t),i=parseFloat(e.replace(n[0],""));switch(n[0][0]){case"+":return o+i+r;case"-":return o-i+r;case"*":return o*i+r}}function F(e,t){if(u.col(e))return A(e);if(/\s/g.test(e))return e;var n=M(e),r=n?e.substr(0,e.length-n.length):e;return t?r+t:r}function j(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function $(e){for(var t,n=e.points,r=0,o=0;o<n.numberOfItems;o++){var i=n.getItem(o);o>0&&(r+=j(t,i)),t=i}return r}function U(e){if(e.getTotalLength)return e.getTotalLength();switch(e.tagName.toLowerCase()){case"circle":return function(e){return 2*Math.PI*k(e,"r")}(e);case"rect":return function(e){return 2*k(e,"width")+2*k(e,"height")}(e);case"line":return function(e){return j({x:k(e,"x1"),y:k(e,"y1")},{x:k(e,"x2"),y:k(e,"y2")})}(e);case"polyline":return $(e);case"polygon":return function(e){var t=e.points;return $(e)+j(t.getItem(t.numberOfItems-1),t.getItem(0))}(e)}}function H(e,t){var n=t||{},r=n.el||function(e){for(var t=e.parentNode;u.svg(t)&&u.svg(t.parentNode);)t=t.parentNode;return t}(e),o=r.getBoundingClientRect(),i=k(r,"viewBox"),a=o.width,s=o.height,l=n.viewBox||(i?i.split(" "):[0,0,a,s]);return{el:r,viewBox:l,x:l[0]/1,y:l[1]/1,w:a/l[2],h:s/l[3]}}function W(e,t){function n(n){void 0===n&&(n=0);var r=t+n>=1?t+n:0;return e.el.getPointAtLength(r)}var r=H(e.el,e.svg),o=n(),i=n(-1),a=n(1);switch(e.property){case"x":return(o.x-r.x)*r.w;case"y":return(o.y-r.y)*r.h;case"angle":return 180*Math.atan2(a.y-i.y,a.x-i.x)/Math.PI}}function G(e,t){var n=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,r=F(u.pth(e)?e.totalLength:e,t)+"";return{original:r,numbers:r.match(n)?r.match(n).map(Number):[0],strings:u.str(e)||t?r.split(n):[]}}function q(e){return w(e?C(u.arr(e)?e.map(E):E(e)):[],(function(e,t,n){return n.indexOf(e)===t}))}function V(e){var t=q(e);return t.map((function(e,n){return{target:e,id:n,total:t.length,transforms:{list:N(e)}}}))}function K(e,t){var n=L(t);if(/^spring/.test(n.easing)&&(n.duration=p(n.easing)),u.arr(e)){var r=e.length;2===r&&!u.obj(e[0])?e={value:e}:u.fnc(t.duration)||(n.duration=t.duration/r)}var o=u.arr(e)?e:[e];return o.map((function(e,n){var r=u.obj(e)&&!u.pth(e)?e:{value:e};return u.und(r.delay)&&(r.delay=n?0:t.delay),u.und(r.endDelay)&&(r.endDelay=n===o.length-1?t.endDelay:0),r})).map((function(e){return T(e,n)}))}function z(e,t){var n=[],r=t.keyframes;for(var o in r&&(t=T(function(e){for(var t=w(C(e.map((function(e){return Object.keys(e)}))),(function(e){return u.key(e)})).reduce((function(e,t){return e.indexOf(t)<0&&e.push(t),e}),[]),n={},r=function(r){var o=t[r];n[o]=e.map((function(e){var t={};for(var n in e)u.key(n)?n==o&&(t.value=e[n]):t[n]=e[n];return t}))},o=0;o<t.length;o++)r(o);return n}(r),t)),t)u.key(o)&&n.push({name:o,tweens:K(t[o],e)});return n}function Y(e,t){var n;return e.tweens.map((function(r){var o=function(e,t){var n={};for(var r in e){var o=I(e[r],t);u.arr(o)&&1===(o=o.map((function(e){return I(e,t)}))).length&&(o=o[0]),n[r]=o}return n.duration=parseFloat(n.duration),n.delay=parseFloat(n.delay),n}(r,t),i=o.value,a=u.arr(i)?i[1]:i,s=M(a),l=O(t.target,e.name,s,t),c=n?n.to.original:l,d=u.arr(i)?i[0]:c,p=M(d)||M(l),h=s||p;return u.und(a)&&(a=c),o.from=G(d,h),o.to=G(B(a,d),h),o.start=n?n.end:0,o.end=o.start+o.delay+o.duration+o.endDelay,o.easing=y(o.easing,o.duration),o.isPath=u.pth(i),o.isColor=u.col(o.from.original),o.isColor&&(o.round=1),n=o,o}))}var X={css:function(e,t,n){return e.style[t]=n},attribute:function(e,t,n){return e.setAttribute(t,n)},object:function(e,t,n){return e[t]=n},transform:function(e,t,n,r,o){if(r.list.set(t,n),t===r.last||o){var i="";r.list.forEach((function(e,t){i+=t+"("+e+") "})),e.style.transform=i}}};function J(e,t){V(e).forEach((function(e){for(var n in t){var r=I(t[n],e),o=e.target,i=M(r),a=O(o,n,i,e),s=B(F(r,i||M(a)),a),l=_(o,n);X[l](o,n,s,e.transforms,!0)}}))}function Q(e,t){return w(C(e.map((function(e){return t.map((function(t){return function(e,t){var n=_(e.target,t.name);if(n){var r=Y(t,e),o=r[r.length-1];return{type:n,property:t.name,animatable:e,tweens:r,duration:o.end,delay:r[0].delay,endDelay:o.endDelay}}}(e,t)}))}))),(function(e){return!u.und(e)}))}function Z(e,t){var n=e.length,r=function(e){return e.timelineOffset?e.timelineOffset:0},o={};return o.duration=n?Math.max.apply(Math,e.map((function(e){return r(e)+e.duration}))):t.duration,o.delay=n?Math.min.apply(Math,e.map((function(e){return r(e)+e.delay}))):t.delay,o.endDelay=n?o.duration-Math.max.apply(Math,e.map((function(e){return r(e)+e.duration-e.endDelay}))):t.endDelay,o}var ee=0;var te,ne=[],re=[],oe=function(){function e(){te=requestAnimationFrame(t)}function t(t){var n=ne.length;if(n){for(var r=0;r<n;){var o=ne[r];if(o.paused){var i=ne.indexOf(o);i>-1&&(ne.splice(i,1),n=ne.length)}else o.tick(t);r++}e()}else te=cancelAnimationFrame(te)}return e}();function ie(e){void 0===e&&(e={});var t,n=0,i=0,a=0,l=0,c=null;function u(e){var t=window.Promise&&new Promise((function(e){return c=e}));return e.finished=t,t}var d=function(e){var t=S(r,e),n=S(o,e),i=z(n,e),a=V(e.targets),s=Q(a,i),l=Z(s,n),c=ee;return ee++,T(t,{id:c,children:[],animatables:a,animations:s,duration:l.duration,delay:l.delay,endDelay:l.endDelay})}(e);u(d);function p(){var e=d.direction;"alternate"!==e&&(d.direction="normal"!==e?"normal":"reverse"),d.reversed=!d.reversed,t.forEach((function(e){return e.reversed=d.reversed}))}function h(e){return d.reversed?d.duration-e:e}function f(){n=0,i=h(d.currentTime)*(1/ie.speed)}function g(e,t){t&&t.seek(e-t.timelineOffset)}function m(e){for(var t=0,n=d.animations,r=n.length;t<r;){var o=n[t],i=o.animatable,a=o.tweens,l=a.length-1,c=a[l];l&&(c=w(a,(function(t){return e<t.end}))[0]||c);for(var u=s(e-c.start-c.delay,0,c.duration)/c.duration,p=isNaN(u)?1:c.easing(u),h=c.to.strings,f=c.round,g=[],m=c.to.numbers.length,v=void 0,y=0;y<m;y++){var b=void 0,C=c.to.numbers[y],E=c.from.numbers[y]||0;b=c.isPath?W(c.value,p*C):E+p*(C-E),f&&(c.isColor&&y>2||(b=Math.round(b*f)/f)),g.push(b)}var x=h.length;if(x){v=h[0];for(var L=0;L<x;L++){h[L];var S=h[L+1],T=g[L];isNaN(T)||(v+=S?T+S:T+" ")}}else v=g[0];X[o.type](i.target,o.property,v,i.transforms),o.currentValue=v,t++}}function v(e){d[e]&&!d.passThrough&&d[e](d)}function y(e){var r=d.duration,o=d.delay,f=r-d.endDelay,y=h(e);d.progress=s(y/r*100,0,100),d.reversePlayback=y<d.currentTime,t&&function(e){if(d.reversePlayback)for(var n=l;n--;)g(e,t[n]);else for(var r=0;r<l;r++)g(e,t[r])}(y),!d.began&&d.currentTime>0&&(d.began=!0,v("begin")),!d.loopBegan&&d.currentTime>0&&(d.loopBegan=!0,v("loopBegin")),y<=o&&0!==d.currentTime&&m(0),(y>=f&&d.currentTime!==r||!r)&&m(r),y>o&&y<f?(d.changeBegan||(d.changeBegan=!0,d.changeCompleted=!1,v("changeBegin")),v("change"),m(y)):d.changeBegan&&(d.changeCompleted=!0,d.changeBegan=!1,v("changeComplete")),d.currentTime=s(y,0,r),d.began&&v("update"),e>=r&&(i=0,d.remaining&&!0!==d.remaining&&d.remaining--,d.remaining?(n=a,v("loopComplete"),d.loopBegan=!1,"alternate"===d.direction&&p()):(d.paused=!0,d.completed||(d.completed=!0,v("loopComplete"),v("complete"),!d.passThrough&&"Promise"in window&&(c(),u(d)))))}return d.reset=function(){var e=d.direction;d.passThrough=!1,d.currentTime=0,d.progress=0,d.paused=!0,d.began=!1,d.loopBegan=!1,d.changeBegan=!1,d.completed=!1,d.changeCompleted=!1,d.reversePlayback=!1,d.reversed="reverse"===e,d.remaining=d.loop,t=d.children;for(var n=l=t.length;n--;)d.children[n].reset();(d.reversed&&!0!==d.loop||"alternate"===e&&1===d.loop)&&d.remaining++,m(d.reversed?d.duration:0)},d.set=function(e,t){return J(e,t),d},d.tick=function(e){a=e,n||(n=a),y((a+(i-n))*ie.speed)},d.seek=function(e){y(h(e))},d.pause=function(){d.paused=!0,f()},d.play=function(){d.paused&&(d.completed&&d.reset(),d.paused=!1,ne.push(d),f(),te||oe())},d.reverse=function(){p(),d.completed=!d.reversed,f()},d.restart=function(){d.reset(),d.play()},d.reset(),d.autoplay&&d.play(),d}function ae(e,t){for(var n=t.length;n--;)x(e,t[n].animatable.target)&&t.splice(n,1)}"undefined"!=typeof document&&document.addEventListener("visibilitychange",(function(){document.hidden?(ne.forEach((function(e){return e.pause()})),re=ne.slice(0),ie.running=ne=[]):re.forEach((function(e){return e.play()}))})),ie.version="3.2.0",ie.speed=1,ie.running=ne,ie.remove=function(e){for(var t=q(e),n=ne.length;n--;){var r=ne[n],o=r.animations,i=r.children;ae(t,o);for(var a=i.length;a--;){var s=i[a],l=s.animations;ae(t,l),l.length||s.children.length||i.splice(a,1)}o.length||i.length||r.pause()}},ie.get=O,ie.set=J,ie.convertPx=R,ie.path=function(e,t){var n=u.str(e)?b(e)[0]:e,r=t||100;return function(e){return{property:e,el:n,svg:H(n),totalLength:U(n)*(r/100)}}},ie.setDashoffset=function(e){var t=U(e);return e.setAttribute("stroke-dasharray",t),t},ie.stagger=function(e,t){void 0===t&&(t={});var n=t.direction||"normal",r=t.easing?y(t.easing):null,o=t.grid,i=t.axis,a=t.from||0,s="first"===a,l="center"===a,c="last"===a,d=u.arr(e),p=d?parseFloat(e[0]):parseFloat(e),h=d?parseFloat(e[1]):0,f=M(d?e[1]:e)||0,g=t.start||0+(d?p:0),m=[],v=0;return function(e,t,u){if(s&&(a=0),l&&(a=(u-1)/2),c&&(a=u-1),!m.length){for(var y=0;y<u;y++){if(o){var b=l?(o[0]-1)/2:a%o[0],w=l?(o[1]-1)/2:Math.floor(a/o[0]),C=b-y%o[0],E=w-Math.floor(y/o[0]),x=Math.sqrt(C*C+E*E);"x"===i&&(x=-C),"y"===i&&(x=-E),m.push(x)}else m.push(Math.abs(a-y));v=Math.max.apply(Math,m)}r&&(m=m.map((function(e){return r(e/v)*v}))),"reverse"===n&&(m=m.map((function(e){return i?e<0?-1*e:-e:Math.abs(v-e)})))}return g+(d?(h-p)/v:p)*(Math.round(100*m[t])/100)+f}},ie.timeline=function(e){void 0===e&&(e={});var t=ie(e);return t.duration=0,t.add=function(n,r){var i=ne.indexOf(t),a=t.children;function s(e){e.passThrough=!0}i>-1&&ne.splice(i,1);for(var l=0;l<a.length;l++)s(a[l]);var c=T(n,S(o,e));c.targets=c.targets||e.targets;var d=t.duration;c.autoplay=!1,c.direction=t.direction,c.timelineOffset=u.und(r)?d:B(r,d),s(t),t.seek(c.timelineOffset);var p=ie(c);s(p),a.push(p);var h=Z(a,e);return t.delay=h.delay,t.endDelay=h.endDelay,t.duration=h.duration,t.seek(0),t.reset(),t.autoplay&&t.play(),t},t},ie.easing=y,ie.penner=v,ie.random=function(e,t){return Math.floor(Math.random()*(t-e+1))+e},e.exports=ie},function(e,t,n){"use strict"; + */ + +module.exports = function (j1, window) { + return { + // ------------------------------------------------------------------------- + // _init_ + // Global initializer for the adapter object + // ------------------------------------------------------------------------- + _init_: function _init_() { + return; + } // END _init_ + + }; // END return +}(j1, window); + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* + * anime.js v3.2.0 + * (c) 2020 Julian Garnier + * Released under the MIT license + * animejs.com + */ + // Defaults + +var defaultInstanceSettings = { + update: null, + begin: null, + loopBegin: null, + changeBegin: null, + change: null, + changeComplete: null, + loopComplete: null, + complete: null, + loop: 1, + direction: 'normal', + autoplay: true, + timelineOffset: 0 +}; +var defaultTweenSettings = { + duration: 1000, + delay: 0, + endDelay: 0, + easing: 'easeOutElastic(1, .5)', + round: 0 +}; +var validTransforms = ['translateX', 'translateY', 'translateZ', 'rotate', 'rotateX', 'rotateY', 'rotateZ', 'scale', 'scaleX', 'scaleY', 'scaleZ', 'skew', 'skewX', 'skewY', 'perspective', 'matrix', 'matrix3d']; // Caching + +var cache = { + CSS: {}, + springs: {} +}; // Utils + +function minMax(val, min, max) { + return Math.min(Math.max(val, min), max); +} + +function stringContains(str, text) { + return str.indexOf(text) > -1; +} + +function applyArguments(func, args) { + return func.apply(null, args); +} + +var is = { + arr: function arr(a) { + return Array.isArray(a); + }, + obj: function obj(a) { + return stringContains(Object.prototype.toString.call(a), 'Object'); + }, + pth: function pth(a) { + return is.obj(a) && a.hasOwnProperty('totalLength'); + }, + svg: function svg(a) { + return a instanceof SVGElement; + }, + inp: function inp(a) { + return a instanceof HTMLInputElement; + }, + dom: function dom(a) { + return a.nodeType || is.svg(a); + }, + str: function str(a) { + return typeof a === 'string'; + }, + fnc: function fnc(a) { + return typeof a === 'function'; + }, + und: function und(a) { + return typeof a === 'undefined'; + }, + hex: function hex(a) { + return /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(a); + }, + rgb: function rgb(a) { + return /^rgb/.test(a); + }, + hsl: function hsl(a) { + return /^hsl/.test(a); + }, + col: function col(a) { + return is.hex(a) || is.rgb(a) || is.hsl(a); + }, + key: function key(a) { + return !defaultInstanceSettings.hasOwnProperty(a) && !defaultTweenSettings.hasOwnProperty(a) && a !== 'targets' && a !== 'keyframes'; + } +}; // Easings + +function parseEasingParameters(string) { + var match = /\(([^)]+)\)/.exec(string); + return match ? match[1].split(',').map(function (p) { + return parseFloat(p); + }) : []; +} // Spring solver inspired by Webkit Copyright © 2016 Apple Inc. All rights reserved. https://webkit.org/demos/spring/spring.js + + +function spring(string, duration) { + var params = parseEasingParameters(string); + var mass = minMax(is.und(params[0]) ? 1 : params[0], .1, 100); + var stiffness = minMax(is.und(params[1]) ? 100 : params[1], .1, 100); + var damping = minMax(is.und(params[2]) ? 10 : params[2], .1, 100); + var velocity = minMax(is.und(params[3]) ? 0 : params[3], .1, 100); + var w0 = Math.sqrt(stiffness / mass); + var zeta = damping / (2 * Math.sqrt(stiffness * mass)); + var wd = zeta < 1 ? w0 * Math.sqrt(1 - zeta * zeta) : 0; + var a = 1; + var b = zeta < 1 ? (zeta * w0 + -velocity) / wd : -velocity + w0; + + function solver(t) { + var progress = duration ? duration * t / 1000 : t; + + if (zeta < 1) { + progress = Math.exp(-progress * zeta * w0) * (a * Math.cos(wd * progress) + b * Math.sin(wd * progress)); + } else { + progress = (a + b * progress) * Math.exp(-progress * w0); + } + + if (t === 0 || t === 1) { + return t; + } + + return 1 - progress; + } + + function getDuration() { + var cached = cache.springs[string]; + + if (cached) { + return cached; + } + + var frame = 1 / 6; + var elapsed = 0; + var rest = 0; + + while (true) { + elapsed += frame; + + if (solver(elapsed) === 1) { + rest++; + + if (rest >= 16) { + break; + } + } else { + rest = 0; + } + } + + var duration = elapsed * frame * 1000; + cache.springs[string] = duration; + return duration; + } + + return duration ? solver : getDuration; +} // Basic steps easing implementation https://developer.mozilla.org/fr/docs/Web/CSS/transition-timing-function + + +function steps(steps) { + if (steps === void 0) steps = 10; + return function (t) { + return Math.ceil(minMax(t, 0.000001, 1) * steps) * (1 / steps); + }; +} // BezierEasing https://github.com/gre/bezier-easing + + +var bezier = function () { + var kSplineTableSize = 11; + var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0); + + function A(aA1, aA2) { + return 1.0 - 3.0 * aA2 + 3.0 * aA1; + } + + function B(aA1, aA2) { + return 3.0 * aA2 - 6.0 * aA1; + } + + function C(aA1) { + return 3.0 * aA1; + } + + function calcBezier(aT, aA1, aA2) { + return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; + } + + function getSlope(aT, aA1, aA2) { + return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1); + } + + function binarySubdivide(aX, aA, aB, mX1, mX2) { + var currentX, + currentT, + i = 0; + + do { + currentT = aA + (aB - aA) / 2.0; + currentX = calcBezier(currentT, mX1, mX2) - aX; + + if (currentX > 0.0) { + aB = currentT; + } else { + aA = currentT; + } + } while (Math.abs(currentX) > 0.0000001 && ++i < 10); + + return currentT; + } + + function newtonRaphsonIterate(aX, aGuessT, mX1, mX2) { + for (var i = 0; i < 4; ++i) { + var currentSlope = getSlope(aGuessT, mX1, mX2); + + if (currentSlope === 0.0) { + return aGuessT; + } + + var currentX = calcBezier(aGuessT, mX1, mX2) - aX; + aGuessT -= currentX / currentSlope; + } + + return aGuessT; + } + + function bezier(mX1, mY1, mX2, mY2) { + if (!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) { + return; + } + + var sampleValues = new Float32Array(kSplineTableSize); + + if (mX1 !== mY1 || mX2 !== mY2) { + for (var i = 0; i < kSplineTableSize; ++i) { + sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2); + } + } + + function getTForX(aX) { + var intervalStart = 0; + var currentSample = 1; + var lastSample = kSplineTableSize - 1; + + for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) { + intervalStart += kSampleStepSize; + } + + --currentSample; + var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]); + var guessForT = intervalStart + dist * kSampleStepSize; + var initialSlope = getSlope(guessForT, mX1, mX2); + + if (initialSlope >= 0.001) { + return newtonRaphsonIterate(aX, guessForT, mX1, mX2); + } else if (initialSlope === 0.0) { + return guessForT; + } else { + return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2); + } + } + + return function (x) { + if (mX1 === mY1 && mX2 === mY2) { + return x; + } + + if (x === 0 || x === 1) { + return x; + } + + return calcBezier(getTForX(x), mY1, mY2); + }; + } + + return bezier; +}(); + +var penner = function () { + // Based on jQuery UI's implemenation of easing equations from Robert Penner (http://www.robertpenner.com/easing) + var eases = { + linear: function linear() { + return function (t) { + return t; + }; + } + }; + var functionEasings = { + Sine: function Sine() { + return function (t) { + return 1 - Math.cos(t * Math.PI / 2); + }; + }, + Circ: function Circ() { + return function (t) { + return 1 - Math.sqrt(1 - t * t); + }; + }, + Back: function Back() { + return function (t) { + return t * t * (3 * t - 2); + }; + }, + Bounce: function Bounce() { + return function (t) { + var pow2, + b = 4; + + while (t < ((pow2 = Math.pow(2, --b)) - 1) / 11) {} + + return 1 / Math.pow(4, 3 - b) - 7.5625 * Math.pow((pow2 * 3 - 2) / 22 - t, 2); + }; + }, + Elastic: function Elastic(amplitude, period) { + if (amplitude === void 0) amplitude = 1; + if (period === void 0) period = .5; + var a = minMax(amplitude, 1, 10); + var p = minMax(period, .1, 2); + return function (t) { + return t === 0 || t === 1 ? t : -a * Math.pow(2, 10 * (t - 1)) * Math.sin((t - 1 - p / (Math.PI * 2) * Math.asin(1 / a)) * (Math.PI * 2) / p); + }; + } + }; + var baseEasings = ['Quad', 'Cubic', 'Quart', 'Quint', 'Expo']; + baseEasings.forEach(function (name, i) { + functionEasings[name] = function () { + return function (t) { + return Math.pow(t, i + 2); + }; + }; + }); + Object.keys(functionEasings).forEach(function (name) { + var easeIn = functionEasings[name]; + eases['easeIn' + name] = easeIn; + + eases['easeOut' + name] = function (a, b) { + return function (t) { + return 1 - easeIn(a, b)(1 - t); + }; + }; + + eases['easeInOut' + name] = function (a, b) { + return function (t) { + return t < 0.5 ? easeIn(a, b)(t * 2) / 2 : 1 - easeIn(a, b)(t * -2 + 2) / 2; + }; + }; + }); + return eases; +}(); + +function parseEasings(easing, duration) { + if (is.fnc(easing)) { + return easing; + } + + var name = easing.split('(')[0]; + var ease = penner[name]; + var args = parseEasingParameters(easing); + + switch (name) { + case 'spring': + return spring(easing, duration); + + case 'cubicBezier': + return applyArguments(bezier, args); + + case 'steps': + return applyArguments(steps, args); + + default: + return applyArguments(ease, args); + } +} // Strings + + +function selectString(str) { + try { + var nodes = document.querySelectorAll(str); + return nodes; + } catch (e) { + return; + } +} // Arrays + + +function filterArray(arr, callback) { + var len = arr.length; + var thisArg = arguments.length >= 2 ? arguments[1] : void 0; + var result = []; + + for (var i = 0; i < len; i++) { + if (i in arr) { + var val = arr[i]; + + if (callback.call(thisArg, val, i, arr)) { + result.push(val); + } + } + } + + return result; +} + +function flattenArray(arr) { + return arr.reduce(function (a, b) { + return a.concat(is.arr(b) ? flattenArray(b) : b); + }, []); +} + +function toArray(o) { + if (is.arr(o)) { + return o; + } + + if (is.str(o)) { + o = selectString(o) || o; + } + + if (o instanceof NodeList || o instanceof HTMLCollection) { + return [].slice.call(o); + } + + return [o]; +} + +function arrayContains(arr, val) { + return arr.some(function (a) { + return a === val; + }); +} // Objects + + +function cloneObject(o) { + var clone = {}; + + for (var p in o) { + clone[p] = o[p]; + } + + return clone; +} + +function replaceObjectProps(o1, o2) { + var o = cloneObject(o1); + + for (var p in o1) { + o[p] = o2.hasOwnProperty(p) ? o2[p] : o1[p]; + } + + return o; +} + +function mergeObjects(o1, o2) { + var o = cloneObject(o1); + + for (var p in o2) { + o[p] = is.und(o1[p]) ? o2[p] : o1[p]; + } + + return o; +} // Colors + + +function rgbToRgba(rgbValue) { + var rgb = /rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(rgbValue); + return rgb ? "rgba(" + rgb[1] + ",1)" : rgbValue; +} + +function hexToRgba(hexValue) { + var rgx = /^#?([a-f\d])([a-f\d])([a-f\d])$/i; + var hex = hexValue.replace(rgx, function (m, r, g, b) { + return r + r + g + g + b + b; + }); + var rgb = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); + var r = parseInt(rgb[1], 16); + var g = parseInt(rgb[2], 16); + var b = parseInt(rgb[3], 16); + return "rgba(" + r + "," + g + "," + b + ",1)"; +} + +function hslToRgba(hslValue) { + var hsl = /hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(hslValue) || /hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(hslValue); + var h = parseInt(hsl[1], 10) / 360; + var s = parseInt(hsl[2], 10) / 100; + var l = parseInt(hsl[3], 10) / 100; + var a = hsl[4] || 1; + + function hue2rgb(p, q, t) { + if (t < 0) { + t += 1; + } + + if (t > 1) { + t -= 1; + } + + if (t < 1 / 6) { + return p + (q - p) * 6 * t; + } + + if (t < 1 / 2) { + return q; + } + + if (t < 2 / 3) { + return p + (q - p) * (2 / 3 - t) * 6; + } + + return p; + } + + var r, g, b; + + if (s == 0) { + r = g = b = l; + } else { + var q = l < 0.5 ? l * (1 + s) : l + s - l * s; + var p = 2 * l - q; + r = hue2rgb(p, q, h + 1 / 3); + g = hue2rgb(p, q, h); + b = hue2rgb(p, q, h - 1 / 3); + } + + return "rgba(" + r * 255 + "," + g * 255 + "," + b * 255 + "," + a + ")"; +} + +function colorToRgb(val) { + if (is.rgb(val)) { + return rgbToRgba(val); + } + + if (is.hex(val)) { + return hexToRgba(val); + } + + if (is.hsl(val)) { + return hslToRgba(val); + } +} // Units + + +function getUnit(val) { + var split = /[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(val); + + if (split) { + return split[1]; + } +} + +function getTransformUnit(propName) { + if (stringContains(propName, 'translate') || propName === 'perspective') { + return 'px'; + } + + if (stringContains(propName, 'rotate') || stringContains(propName, 'skew')) { + return 'deg'; + } +} // Values + + +function getFunctionValue(val, animatable) { + if (!is.fnc(val)) { + return val; + } + + return val(animatable.target, animatable.id, animatable.total); +} + +function getAttribute(el, prop) { + return el.getAttribute(prop); +} + +function convertPxToUnit(el, value, unit) { + var valueUnit = getUnit(value); + + if (arrayContains([unit, 'deg', 'rad', 'turn'], valueUnit)) { + return value; + } + + var cached = cache.CSS[value + unit]; + + if (!is.und(cached)) { + return cached; + } + + var baseline = 100; + var tempEl = document.createElement(el.tagName); + var parentEl = el.parentNode && el.parentNode !== document ? el.parentNode : document.body; + parentEl.appendChild(tempEl); + tempEl.style.position = 'absolute'; + tempEl.style.width = baseline + unit; + var factor = baseline / tempEl.offsetWidth; + parentEl.removeChild(tempEl); + var convertedUnit = factor * parseFloat(value); + cache.CSS[value + unit] = convertedUnit; + return convertedUnit; +} + +function getCSSValue(el, prop, unit) { + if (prop in el.style) { + var uppercasePropName = prop.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase(); + var value = el.style[prop] || getComputedStyle(el).getPropertyValue(uppercasePropName) || '0'; + return unit ? convertPxToUnit(el, value, unit) : value; + } +} + +function getAnimationType(el, prop) { + if (is.dom(el) && !is.inp(el) && (getAttribute(el, prop) || is.svg(el) && el[prop])) { + return 'attribute'; + } + + if (is.dom(el) && arrayContains(validTransforms, prop)) { + return 'transform'; + } + + if (is.dom(el) && prop !== 'transform' && getCSSValue(el, prop)) { + return 'css'; + } + + if (el[prop] != null) { + return 'object'; + } +} + +function getElementTransforms(el) { + if (!is.dom(el)) { + return; + } + + var str = el.style.transform || ''; + var reg = /(\w+)\(([^)]*)\)/g; + var transforms = new Map(); + var m; + + while (m = reg.exec(str)) { + transforms.set(m[1], m[2]); + } + + return transforms; +} + +function getTransformValue(el, propName, animatable, unit) { + var defaultVal = stringContains(propName, 'scale') ? 1 : 0 + getTransformUnit(propName); + var value = getElementTransforms(el).get(propName) || defaultVal; + + if (animatable) { + animatable.transforms.list.set(propName, value); + animatable.transforms['last'] = propName; + } + + return unit ? convertPxToUnit(el, value, unit) : value; +} + +function getOriginalTargetValue(target, propName, unit, animatable) { + switch (getAnimationType(target, propName)) { + case 'transform': + return getTransformValue(target, propName, animatable, unit); + + case 'css': + return getCSSValue(target, propName, unit); + + case 'attribute': + return getAttribute(target, propName); + + default: + return target[propName] || 0; + } +} + +function getRelativeValue(to, from) { + var operator = /^(\*=|\+=|-=)/.exec(to); + + if (!operator) { + return to; + } + + var u = getUnit(to) || 0; + var x = parseFloat(from); + var y = parseFloat(to.replace(operator[0], '')); + + switch (operator[0][0]) { + case '+': + return x + y + u; + + case '-': + return x - y + u; + + case '*': + return x * y + u; + } +} + +function validateValue(val, unit) { + if (is.col(val)) { + return colorToRgb(val); + } + + if (/\s/g.test(val)) { + return val; + } + + var originalUnit = getUnit(val); + var unitLess = originalUnit ? val.substr(0, val.length - originalUnit.length) : val; + + if (unit) { + return unitLess + unit; + } + + return unitLess; +} // getTotalLength() equivalent for circle, rect, polyline, polygon and line shapes +// adapted from https://gist.github.com/SebLambla/3e0550c496c236709744 + + +function getDistance(p1, p2) { + return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2)); +} + +function getCircleLength(el) { + return Math.PI * 2 * getAttribute(el, 'r'); +} + +function getRectLength(el) { + return getAttribute(el, 'width') * 2 + getAttribute(el, 'height') * 2; +} + +function getLineLength(el) { + return getDistance({ + x: getAttribute(el, 'x1'), + y: getAttribute(el, 'y1') + }, { + x: getAttribute(el, 'x2'), + y: getAttribute(el, 'y2') + }); +} + +function getPolylineLength(el) { + var points = el.points; + var totalLength = 0; + var previousPos; + + for (var i = 0; i < points.numberOfItems; i++) { + var currentPos = points.getItem(i); + + if (i > 0) { + totalLength += getDistance(previousPos, currentPos); + } + + previousPos = currentPos; + } + + return totalLength; +} + +function getPolygonLength(el) { + var points = el.points; + return getPolylineLength(el) + getDistance(points.getItem(points.numberOfItems - 1), points.getItem(0)); +} // Path animation + + +function getTotalLength(el) { + if (el.getTotalLength) { + return el.getTotalLength(); + } + + switch (el.tagName.toLowerCase()) { + case 'circle': + return getCircleLength(el); + + case 'rect': + return getRectLength(el); + + case 'line': + return getLineLength(el); + + case 'polyline': + return getPolylineLength(el); + + case 'polygon': + return getPolygonLength(el); + } +} + +function setDashoffset(el) { + var pathLength = getTotalLength(el); + el.setAttribute('stroke-dasharray', pathLength); + return pathLength; +} // Motion path + + +function getParentSvgEl(el) { + var parentEl = el.parentNode; + + while (is.svg(parentEl)) { + if (!is.svg(parentEl.parentNode)) { + break; + } + + parentEl = parentEl.parentNode; + } + + return parentEl; +} + +function getParentSvg(pathEl, svgData) { + var svg = svgData || {}; + var parentSvgEl = svg.el || getParentSvgEl(pathEl); + var rect = parentSvgEl.getBoundingClientRect(); + var viewBoxAttr = getAttribute(parentSvgEl, 'viewBox'); + var width = rect.width; + var height = rect.height; + var viewBox = svg.viewBox || (viewBoxAttr ? viewBoxAttr.split(' ') : [0, 0, width, height]); + return { + el: parentSvgEl, + viewBox: viewBox, + x: viewBox[0] / 1, + y: viewBox[1] / 1, + w: width / viewBox[2], + h: height / viewBox[3] + }; +} + +function getPath(path, percent) { + var pathEl = is.str(path) ? selectString(path)[0] : path; + var p = percent || 100; + return function (property) { + return { + property: property, + el: pathEl, + svg: getParentSvg(pathEl), + totalLength: getTotalLength(pathEl) * (p / 100) + }; + }; +} + +function getPathProgress(path, progress) { + function point(offset) { + if (offset === void 0) offset = 0; + var l = progress + offset >= 1 ? progress + offset : 0; + return path.el.getPointAtLength(l); + } + + var svg = getParentSvg(path.el, path.svg); + var p = point(); + var p0 = point(-1); + var p1 = point(+1); + + switch (path.property) { + case 'x': + return (p.x - svg.x) * svg.w; + + case 'y': + return (p.y - svg.y) * svg.h; + + case 'angle': + return Math.atan2(p1.y - p0.y, p1.x - p0.x) * 180 / Math.PI; + } +} // Decompose value + + +function decomposeValue(val, unit) { + // const rgx = /-?\d*\.?\d+/g; // handles basic numbers + // const rgx = /[+-]?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g; // handles exponents notation + var rgx = /[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g; // handles exponents notation + + var value = validateValue(is.pth(val) ? val.totalLength : val, unit) + ''; + return { + original: value, + numbers: value.match(rgx) ? value.match(rgx).map(Number) : [0], + strings: is.str(val) || unit ? value.split(rgx) : [] + }; +} // Animatables + + +function parseTargets(targets) { + var targetsArray = targets ? flattenArray(is.arr(targets) ? targets.map(toArray) : toArray(targets)) : []; + return filterArray(targetsArray, function (item, pos, self) { + return self.indexOf(item) === pos; + }); +} + +function getAnimatables(targets) { + var parsed = parseTargets(targets); + return parsed.map(function (t, i) { + return { + target: t, + id: i, + total: parsed.length, + transforms: { + list: getElementTransforms(t) + } + }; + }); +} // Properties + + +function normalizePropertyTweens(prop, tweenSettings) { + var settings = cloneObject(tweenSettings); // Override duration if easing is a spring + + if (/^spring/.test(settings.easing)) { + settings.duration = spring(settings.easing); + } + + if (is.arr(prop)) { + var l = prop.length; + var isFromTo = l === 2 && !is.obj(prop[0]); + + if (!isFromTo) { + // Duration divided by the number of tweens + if (!is.fnc(tweenSettings.duration)) { + settings.duration = tweenSettings.duration / l; + } + } else { + // Transform [from, to] values shorthand to a valid tween value + prop = { + value: prop + }; + } + } + + var propArray = is.arr(prop) ? prop : [prop]; + return propArray.map(function (v, i) { + var obj = is.obj(v) && !is.pth(v) ? v : { + value: v + }; // Default delay value should only be applied to the first tween + + if (is.und(obj.delay)) { + obj.delay = !i ? tweenSettings.delay : 0; + } // Default endDelay value should only be applied to the last tween + + + if (is.und(obj.endDelay)) { + obj.endDelay = i === propArray.length - 1 ? tweenSettings.endDelay : 0; + } + + return obj; + }).map(function (k) { + return mergeObjects(k, settings); + }); +} + +function flattenKeyframes(keyframes) { + var propertyNames = filterArray(flattenArray(keyframes.map(function (key) { + return Object.keys(key); + })), function (p) { + return is.key(p); + }).reduce(function (a, b) { + if (a.indexOf(b) < 0) { + a.push(b); + } + + return a; + }, []); + var properties = {}; + + var loop = function loop(i) { + var propName = propertyNames[i]; + properties[propName] = keyframes.map(function (key) { + var newKey = {}; + + for (var p in key) { + if (is.key(p)) { + if (p == propName) { + newKey.value = key[p]; + } + } else { + newKey[p] = key[p]; + } + } + + return newKey; + }); + }; + + for (var i = 0; i < propertyNames.length; i++) { + loop(i); + } + + return properties; +} + +function getProperties(tweenSettings, params) { + var properties = []; + var keyframes = params.keyframes; + + if (keyframes) { + params = mergeObjects(flattenKeyframes(keyframes), params); + } + + for (var p in params) { + if (is.key(p)) { + properties.push({ + name: p, + tweens: normalizePropertyTweens(params[p], tweenSettings) + }); + } + } + + return properties; +} // Tweens + + +function normalizeTweenValues(tween, animatable) { + var t = {}; + + for (var p in tween) { + var value = getFunctionValue(tween[p], animatable); + + if (is.arr(value)) { + value = value.map(function (v) { + return getFunctionValue(v, animatable); + }); + + if (value.length === 1) { + value = value[0]; + } + } + + t[p] = value; + } + + t.duration = parseFloat(t.duration); + t.delay = parseFloat(t.delay); + return t; +} + +function normalizeTweens(prop, animatable) { + var previousTween; + return prop.tweens.map(function (t) { + var tween = normalizeTweenValues(t, animatable); + var tweenValue = tween.value; + var to = is.arr(tweenValue) ? tweenValue[1] : tweenValue; + var toUnit = getUnit(to); + var originalValue = getOriginalTargetValue(animatable.target, prop.name, toUnit, animatable); + var previousValue = previousTween ? previousTween.to.original : originalValue; + var from = is.arr(tweenValue) ? tweenValue[0] : previousValue; + var fromUnit = getUnit(from) || getUnit(originalValue); + var unit = toUnit || fromUnit; + + if (is.und(to)) { + to = previousValue; + } + + tween.from = decomposeValue(from, unit); + tween.to = decomposeValue(getRelativeValue(to, from), unit); + tween.start = previousTween ? previousTween.end : 0; + tween.end = tween.start + tween.delay + tween.duration + tween.endDelay; + tween.easing = parseEasings(tween.easing, tween.duration); + tween.isPath = is.pth(tweenValue); + tween.isColor = is.col(tween.from.original); + + if (tween.isColor) { + tween.round = 1; + } + + previousTween = tween; + return tween; + }); +} // Tween progress + + +var setProgressValue = { + css: function css(t, p, v) { + return t.style[p] = v; + }, + attribute: function attribute(t, p, v) { + return t.setAttribute(p, v); + }, + object: function object(t, p, v) { + return t[p] = v; + }, + transform: function transform(t, p, v, transforms, manual) { + transforms.list.set(p, v); + + if (p === transforms.last || manual) { + var str = ''; + transforms.list.forEach(function (value, prop) { + str += prop + "(" + value + ") "; + }); + t.style.transform = str; + } + } +}; // Set Value helper + +function setTargetsValue(targets, properties) { + var animatables = getAnimatables(targets); + animatables.forEach(function (animatable) { + for (var property in properties) { + var value = getFunctionValue(properties[property], animatable); + var target = animatable.target; + var valueUnit = getUnit(value); + var originalValue = getOriginalTargetValue(target, property, valueUnit, animatable); + var unit = valueUnit || getUnit(originalValue); + var to = getRelativeValue(validateValue(value, unit), originalValue); + var animType = getAnimationType(target, property); + setProgressValue[animType](target, property, to, animatable.transforms, true); + } + }); +} // Animations + + +function createAnimation(animatable, prop) { + var animType = getAnimationType(animatable.target, prop.name); + + if (animType) { + var tweens = normalizeTweens(prop, animatable); + var lastTween = tweens[tweens.length - 1]; + return { + type: animType, + property: prop.name, + animatable: animatable, + tweens: tweens, + duration: lastTween.end, + delay: tweens[0].delay, + endDelay: lastTween.endDelay + }; + } +} + +function getAnimations(animatables, properties) { + return filterArray(flattenArray(animatables.map(function (animatable) { + return properties.map(function (prop) { + return createAnimation(animatable, prop); + }); + })), function (a) { + return !is.und(a); + }); +} // Create Instance + + +function getInstanceTimings(animations, tweenSettings) { + var animLength = animations.length; + + var getTlOffset = function getTlOffset(anim) { + return anim.timelineOffset ? anim.timelineOffset : 0; + }; + + var timings = {}; + timings.duration = animLength ? Math.max.apply(Math, animations.map(function (anim) { + return getTlOffset(anim) + anim.duration; + })) : tweenSettings.duration; + timings.delay = animLength ? Math.min.apply(Math, animations.map(function (anim) { + return getTlOffset(anim) + anim.delay; + })) : tweenSettings.delay; + timings.endDelay = animLength ? timings.duration - Math.max.apply(Math, animations.map(function (anim) { + return getTlOffset(anim) + anim.duration - anim.endDelay; + })) : tweenSettings.endDelay; + return timings; +} + +var instanceID = 0; + +function createNewInstance(params) { + var instanceSettings = replaceObjectProps(defaultInstanceSettings, params); + var tweenSettings = replaceObjectProps(defaultTweenSettings, params); + var properties = getProperties(tweenSettings, params); + var animatables = getAnimatables(params.targets); + var animations = getAnimations(animatables, properties); + var timings = getInstanceTimings(animations, tweenSettings); + var id = instanceID; + instanceID++; + return mergeObjects(instanceSettings, { + id: id, + children: [], + animatables: animatables, + animations: animations, + duration: timings.duration, + delay: timings.delay, + endDelay: timings.endDelay + }); +} // Core + + +var activeInstances = []; +var pausedInstances = []; +var raf; + +var engine = function () { + function play() { + raf = requestAnimationFrame(step); + } + + function step(t) { + var activeInstancesLength = activeInstances.length; + + if (activeInstancesLength) { + var i = 0; + + while (i < activeInstancesLength) { + var activeInstance = activeInstances[i]; + + if (!activeInstance.paused) { + activeInstance.tick(t); + } else { + var instanceIndex = activeInstances.indexOf(activeInstance); + + if (instanceIndex > -1) { + activeInstances.splice(instanceIndex, 1); + activeInstancesLength = activeInstances.length; + } + } + + i++; + } + + play(); + } else { + raf = cancelAnimationFrame(raf); + } + } + + return play; +}(); + +function handleVisibilityChange() { + if (document.hidden) { + activeInstances.forEach(function (ins) { + return ins.pause(); + }); + pausedInstances = activeInstances.slice(0); + anime.running = activeInstances = []; + } else { + pausedInstances.forEach(function (ins) { + return ins.play(); + }); + } +} + +if (typeof document !== 'undefined') { + document.addEventListener('visibilitychange', handleVisibilityChange); +} // Public Instance + + +function anime(params) { + if (params === void 0) params = {}; + var startTime = 0, + lastTime = 0, + now = 0; + var children, + childrenLength = 0; + var resolve = null; + + function makePromise(instance) { + var promise = window.Promise && new Promise(function (_resolve) { + return resolve = _resolve; + }); + instance.finished = promise; + return promise; + } + + var instance = createNewInstance(params); + var promise = makePromise(instance); + + function toggleInstanceDirection() { + var direction = instance.direction; + + if (direction !== 'alternate') { + instance.direction = direction !== 'normal' ? 'normal' : 'reverse'; + } + + instance.reversed = !instance.reversed; + children.forEach(function (child) { + return child.reversed = instance.reversed; + }); + } + + function adjustTime(time) { + return instance.reversed ? instance.duration - time : time; + } + + function resetTime() { + startTime = 0; + lastTime = adjustTime(instance.currentTime) * (1 / anime.speed); + } + + function seekChild(time, child) { + if (child) { + child.seek(time - child.timelineOffset); + } + } + + function syncInstanceChildren(time) { + if (!instance.reversePlayback) { + for (var i = 0; i < childrenLength; i++) { + seekChild(time, children[i]); + } + } else { + for (var i$1 = childrenLength; i$1--;) { + seekChild(time, children[i$1]); + } + } + } + + function setAnimationsProgress(insTime) { + var i = 0; + var animations = instance.animations; + var animationsLength = animations.length; + + while (i < animationsLength) { + var anim = animations[i]; + var animatable = anim.animatable; + var tweens = anim.tweens; + var tweenLength = tweens.length - 1; + var tween = tweens[tweenLength]; // Only check for keyframes if there is more than one tween + + if (tweenLength) { + tween = filterArray(tweens, function (t) { + return insTime < t.end; + })[0] || tween; + } + + var elapsed = minMax(insTime - tween.start - tween.delay, 0, tween.duration) / tween.duration; + var eased = isNaN(elapsed) ? 1 : tween.easing(elapsed); + var strings = tween.to.strings; + var round = tween.round; + var numbers = []; + var toNumbersLength = tween.to.numbers.length; + var progress = void 0; + + for (var n = 0; n < toNumbersLength; n++) { + var value = void 0; + var toNumber = tween.to.numbers[n]; + var fromNumber = tween.from.numbers[n] || 0; + + if (!tween.isPath) { + value = fromNumber + eased * (toNumber - fromNumber); + } else { + value = getPathProgress(tween.value, eased * toNumber); + } + + if (round) { + if (!(tween.isColor && n > 2)) { + value = Math.round(value * round) / round; + } + } + + numbers.push(value); + } // Manual Array.reduce for better performances + + + var stringsLength = strings.length; + + if (!stringsLength) { + progress = numbers[0]; + } else { + progress = strings[0]; + + for (var s = 0; s < stringsLength; s++) { + var a = strings[s]; + var b = strings[s + 1]; + var n$1 = numbers[s]; + + if (!isNaN(n$1)) { + if (!b) { + progress += n$1 + ' '; + } else { + progress += n$1 + b; + } + } + } + } + + setProgressValue[anim.type](animatable.target, anim.property, progress, animatable.transforms); + anim.currentValue = progress; + i++; + } + } + + function setCallback(cb) { + if (instance[cb] && !instance.passThrough) { + instance[cb](instance); + } + } + + function countIteration() { + if (instance.remaining && instance.remaining !== true) { + instance.remaining--; + } + } + + function setInstanceProgress(engineTime) { + var insDuration = instance.duration; + var insDelay = instance.delay; + var insEndDelay = insDuration - instance.endDelay; + var insTime = adjustTime(engineTime); + instance.progress = minMax(insTime / insDuration * 100, 0, 100); + instance.reversePlayback = insTime < instance.currentTime; + + if (children) { + syncInstanceChildren(insTime); + } + + if (!instance.began && instance.currentTime > 0) { + instance.began = true; + setCallback('begin'); + } + + if (!instance.loopBegan && instance.currentTime > 0) { + instance.loopBegan = true; + setCallback('loopBegin'); + } + + if (insTime <= insDelay && instance.currentTime !== 0) { + setAnimationsProgress(0); + } + + if (insTime >= insEndDelay && instance.currentTime !== insDuration || !insDuration) { + setAnimationsProgress(insDuration); + } + + if (insTime > insDelay && insTime < insEndDelay) { + if (!instance.changeBegan) { + instance.changeBegan = true; + instance.changeCompleted = false; + setCallback('changeBegin'); + } + + setCallback('change'); + setAnimationsProgress(insTime); + } else { + if (instance.changeBegan) { + instance.changeCompleted = true; + instance.changeBegan = false; + setCallback('changeComplete'); + } + } + + instance.currentTime = minMax(insTime, 0, insDuration); + + if (instance.began) { + setCallback('update'); + } + + if (engineTime >= insDuration) { + lastTime = 0; + countIteration(); + + if (!instance.remaining) { + instance.paused = true; + + if (!instance.completed) { + instance.completed = true; + setCallback('loopComplete'); + setCallback('complete'); + + if (!instance.passThrough && 'Promise' in window) { + resolve(); + promise = makePromise(instance); + } + } + } else { + startTime = now; + setCallback('loopComplete'); + instance.loopBegan = false; + + if (instance.direction === 'alternate') { + toggleInstanceDirection(); + } + } + } + } + + instance.reset = function () { + var direction = instance.direction; + instance.passThrough = false; + instance.currentTime = 0; + instance.progress = 0; + instance.paused = true; + instance.began = false; + instance.loopBegan = false; + instance.changeBegan = false; + instance.completed = false; + instance.changeCompleted = false; + instance.reversePlayback = false; + instance.reversed = direction === 'reverse'; + instance.remaining = instance.loop; + children = instance.children; + childrenLength = children.length; + + for (var i = childrenLength; i--;) { + instance.children[i].reset(); + } + + if (instance.reversed && instance.loop !== true || direction === 'alternate' && instance.loop === 1) { + instance.remaining++; + } + + setAnimationsProgress(instance.reversed ? instance.duration : 0); + }; // Set Value helper + + + instance.set = function (targets, properties) { + setTargetsValue(targets, properties); + return instance; + }; + + instance.tick = function (t) { + now = t; + + if (!startTime) { + startTime = now; + } + + setInstanceProgress((now + (lastTime - startTime)) * anime.speed); + }; + + instance.seek = function (time) { + setInstanceProgress(adjustTime(time)); + }; + + instance.pause = function () { + instance.paused = true; + resetTime(); + }; + + instance.play = function () { + if (!instance.paused) { + return; + } + + if (instance.completed) { + instance.reset(); + } + + instance.paused = false; + activeInstances.push(instance); + resetTime(); + + if (!raf) { + engine(); + } + }; + + instance.reverse = function () { + toggleInstanceDirection(); + instance.completed = instance.reversed ? false : true; + resetTime(); + }; + + instance.restart = function () { + instance.reset(); + instance.play(); + }; + + instance.reset(); + + if (instance.autoplay) { + instance.play(); + } + + return instance; +} // Remove targets from animation + + +function removeTargetsFromAnimations(targetsArray, animations) { + for (var a = animations.length; a--;) { + if (arrayContains(targetsArray, animations[a].animatable.target)) { + animations.splice(a, 1); + } + } +} + +function removeTargets(targets) { + var targetsArray = parseTargets(targets); + + for (var i = activeInstances.length; i--;) { + var instance = activeInstances[i]; + var animations = instance.animations; + var children = instance.children; + removeTargetsFromAnimations(targetsArray, animations); + + for (var c = children.length; c--;) { + var child = children[c]; + var childAnimations = child.animations; + removeTargetsFromAnimations(targetsArray, childAnimations); + + if (!childAnimations.length && !child.children.length) { + children.splice(c, 1); + } + } + + if (!animations.length && !children.length) { + instance.pause(); + } + } +} // Stagger helpers + + +function stagger(val, params) { + if (params === void 0) params = {}; + var direction = params.direction || 'normal'; + var easing = params.easing ? parseEasings(params.easing) : null; + var grid = params.grid; + var axis = params.axis; + var fromIndex = params.from || 0; + var fromFirst = fromIndex === 'first'; + var fromCenter = fromIndex === 'center'; + var fromLast = fromIndex === 'last'; + var isRange = is.arr(val); + var val1 = isRange ? parseFloat(val[0]) : parseFloat(val); + var val2 = isRange ? parseFloat(val[1]) : 0; + var unit = getUnit(isRange ? val[1] : val) || 0; + var start = params.start || 0 + (isRange ? val1 : 0); + var values = []; + var maxValue = 0; + return function (el, i, t) { + if (fromFirst) { + fromIndex = 0; + } + + if (fromCenter) { + fromIndex = (t - 1) / 2; + } + + if (fromLast) { + fromIndex = t - 1; + } + + if (!values.length) { + for (var index = 0; index < t; index++) { + if (!grid) { + values.push(Math.abs(fromIndex - index)); + } else { + var fromX = !fromCenter ? fromIndex % grid[0] : (grid[0] - 1) / 2; + var fromY = !fromCenter ? Math.floor(fromIndex / grid[0]) : (grid[1] - 1) / 2; + var toX = index % grid[0]; + var toY = Math.floor(index / grid[0]); + var distanceX = fromX - toX; + var distanceY = fromY - toY; + var value = Math.sqrt(distanceX * distanceX + distanceY * distanceY); + + if (axis === 'x') { + value = -distanceX; + } + + if (axis === 'y') { + value = -distanceY; + } + + values.push(value); + } + + maxValue = Math.max.apply(Math, values); + } + + if (easing) { + values = values.map(function (val) { + return easing(val / maxValue) * maxValue; + }); + } + + if (direction === 'reverse') { + values = values.map(function (val) { + return axis ? val < 0 ? val * -1 : -val : Math.abs(maxValue - val); + }); + } + } + + var spacing = isRange ? (val2 - val1) / maxValue : val1; + return start + spacing * (Math.round(values[i] * 100) / 100) + unit; + }; +} // Timeline + + +function timeline(params) { + if (params === void 0) params = {}; + var tl = anime(params); + tl.duration = 0; + + tl.add = function (instanceParams, timelineOffset) { + var tlIndex = activeInstances.indexOf(tl); + var children = tl.children; + + if (tlIndex > -1) { + activeInstances.splice(tlIndex, 1); + } + + function passThrough(ins) { + ins.passThrough = true; + } + + for (var i = 0; i < children.length; i++) { + passThrough(children[i]); + } + + var insParams = mergeObjects(instanceParams, replaceObjectProps(defaultTweenSettings, params)); + insParams.targets = insParams.targets || params.targets; + var tlDuration = tl.duration; + insParams.autoplay = false; + insParams.direction = tl.direction; + insParams.timelineOffset = is.und(timelineOffset) ? tlDuration : getRelativeValue(timelineOffset, tlDuration); + passThrough(tl); + tl.seek(insParams.timelineOffset); + var ins = anime(insParams); + passThrough(ins); + children.push(ins); + var timings = getInstanceTimings(children, params); + tl.delay = timings.delay; + tl.endDelay = timings.endDelay; + tl.duration = timings.duration; + tl.seek(0); + tl.reset(); + + if (tl.autoplay) { + tl.play(); + } + + return tl; + }; + + return tl; +} + +anime.version = '3.2.0'; +anime.speed = 1; +anime.running = activeInstances; +anime.remove = removeTargets; +anime.get = getOriginalTargetValue; +anime.set = setTargetsValue; +anime.convertPx = convertPxToUnit; +anime.path = getPath; +anime.setDashoffset = setDashoffset; +anime.stagger = stagger; +anime.timeline = timeline; +anime.easing = parseEasings; +anime.penner = penner; + +anime.random = function (min, max) { + return Math.floor(Math.random() * (max - min + 1)) + min; +}; + +module.exports = anime; + +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* + # ----------------------------------------------------------------------------- + # ~/js/j1_template/core.js + # Provides an empty object for later loaded core objects + # + # Product/Info: + # https://jekyll.one + # http://getbootstrap.com/ + # + # Copyright (C) 2021 Juergen Adams + # + # J1 Template is licensed under MIT License. + # See: https://github.com/jekyll-one-org/J1 Template/blob/master/LICENSE + # ----------------------------------------------------------------------------- +*/ + // ----------------------------------------------------------------------------- +// ESLint shimming +// ----------------------------------------------------------------------------- + +/* eslint indent: "off" */ + +/* eslint no-unused-vars: "off" */ + +/* eslint no-undef: "off" */ +// ----------------------------------------------------------------------------- +// module.exports = function core ( options ) { + /*! * J1 Core * Copyright (C) 2021 Juergen Adams * Licensed under MIT License. - */e.exports=function(e){$.extend({foo:"foo_option",bar:"bar_option"},void 0);return{_init_:function(e){},getState:function(){return"loaded"},isMobile:function(e){var t,n=!1;return t=navigator.userAgent||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/i.test(t)||/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|dcs|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|gf5|gmo|go(\.w|od)|gr(ad|un)|haie|hcit|hd(m|p|t)|hei|hi(pt|ta)|hp( i|ip)|hsc|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|m1w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|mcr|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)|pn2|po(ck|rt|se)|prox|psio|ptg|qaa|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)|sk0|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|tmo|to(pl|sh)|ts(70|m|m3|m5)|tx9|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(t.substr(0,4)))&&(n=!0),n},bsFormClearButton:function(){$(":input").on("keydown focus change mouseover",(function(){$(this).val().length>0&&$(this).nextAll(".form-clear").removeClass("d-none")})).on("keydown keyup blur",(function(){0===$(this).val().length&&$(this).nextAll(".form-clear").addClass("d-none")}))},createDropCap:function(){$(".paragraph.dropcap").children("p").addClass("dropcap"),$("p.dropcap").length&&$("p.dropcap").each((function(){var e=$(this),t=$.trim(e.text()),n=t[0],r='<span class="j1-dropcap">'+n+"</span>";e.html(t.replace(n,r))}))}}}()},function(e,t){e.exports=function(e){var t,n,r={};$.extend({foo:"bar",bar:"foo"},e);return{init:function(e,o){return t=log4javascript.getLogger("j1.core.navigator"),n="core is being initialized",t.info(n),this.manageDropdownMenu(e,o),this.navbarSticky(),this.eventHandler(e),r.type="command",r.action="core_initialized",r.text="navigator core initialized",j1.sendMessage("j1.core.navigator","j1.adapter.navigator",r),!0},eventHandler:function(e){var t=e,n=log4javascript.getLogger("j1.core.navigator.eventHandler"),r=$("nav.navbar.navigator");if($('a[href="#"]').click((function(e){e.preventDefault?e.preventDefault():e.returnValue=!1,n.info('bound click event to "#", suppress default action')})),r.hasClass("navbar-sticky")&&r.wrap("<div class='wrap-sticky'></div>"),r.hasClass("brand-center")){var o=new Array,i=$("nav.brand-center"),a=i.find("ul.navbar-nav");i.find("ul.navbar-nav > li").each((function(){o.push($(this).html())}));var s=o.splice(0,Math.round(o.length/2)),l=o,c="",u=function(e){c="";for(var t=0;t<e.length;t++)c+="<li>"+e[t]+"</li>"};u(s),a.html(c),i.find("ul.nav").first().addClass("navbar-left"),u(l),a.after('<ul class="nav navbar-nav"></ul>').next().html(c),i.find("ul.nav").last().addClass("navbar-right"),i.find("ul.nav.navbar-left").wrap("<div class='col_half left'></div>"),i.find("ul.nav.navbar-right").wrap("<div class='col_half right'></div>"),i.find("ul.navbar-nav > li").each((function(){var e=$("ul.dropdown-menu",this),t=$("ul.megamenu-content",this);e.closest("li").addClass("dropdown"),t.closest("li").addClass("megamenu-fw")}))}r.find("ul.nav").hasClass("navbar-center")&&r.addClass("menu-center"),r.hasClass("navbar-full")?($("nav.navbar.navigator").find("ul.nav").wrap("<div class='wrap-full-menu'></div>"),$(".wrap-full-menu").wrap("<div class='nav-full'></div>"),$("ul.nav.navbar-nav").prepend("<li class='close-full-menu'><a href='#'><i class='mdi mdi-close'></i></a></li>")):r.hasClass("navbar-mobile")?r.removeClass("no-full"):r.addClass("no-full"),r.hasClass("no-background")&&$(window).on("scroll",(function(){var e=$("nav.navbar").outerHeight();$(window).scrollTop()>e?$(".navbar-fixed").removeClass("no-background"):$(".navbar-fixed").addClass("no-background")})),r.hasClass("navbar-transparent")&&$(window).on("scroll",(function(){var e=$("nav.navbar").outerHeight();$(window).scrollTop()>e?($(".navbar-fixed").removeClass("navbar-transparent"),$(".navbar-fixed").addClass("navbar-scrolled")):($(".navbar-fixed").removeClass("navbar-scrolled"),$(".navbar-fixed").addClass("navbar-transparent"))})),$(".attr-nav").each((function(){n.debug("register OPEN event|s for QuickSearch"),$("li.search > a",this).on("click",(function(e){n.debug("manage search action OPEN"),$("html,body").animate({scrollTop:0},0),$(".top-search").slideToggle("slow","swing",(function(){$(".top-search").is(":visible")?($("body").addClass("stop-scrolling"),$("body").bind("touchmove",(function(e){e.preventDefault()})),$("#"+t.nav_bar.container_id).hide()):($("body").removeClass("stop-scrolling"),$("body").unbind("touchmove"),$("#"+t.nav_bar.container_id).show())}))}))})),n.debug("register CLOSE event|s for QuickSearch"),$(".input-group-addon.close-search").on("click",(function(e){e.preventDefault(),n.debug("manage search action CLOSE"),$(".top-search").slideUp("slow","swing"),$("html,body").animate({scrollTop:0},0),$("body").removeClass("stop-scrolling"),$("body").unbind("touchmove"),$("#"+t.nav_bar.container_id).show(),e.stopPropagation()})),$("nav.navbar.navigator .attr-nav").each((function(){n.debug("register SHOW|HIDE event|s for J1 Translator"),$("li.translator > a",this).on("click",(function(e){n.debug("toggle translator icon SHOW|HIDE"),$("#google_translate_element").toggle(),"none"!==$("#google_translate_element").css("display")&&$("html,body").animate({scrollTop:0},"slow")}))})),$("body").wrapInner("<div class='wrapper'></div>")},manageDropdownMenu:function(e,t){var n,r,o,i,a=e,s=t,l=$("nav.navbar.navigator"),c=(window.matchMedia("(orientation: landscape)").matches,$(window).width()),u=($("nav").width(),l.find("ul.nav").data("in")),d=l.find("ul.nav").data("out"),p="#"+s.xhr_container_id+".collapse",h=s.delay_menu_open;if(c<=(r="lg"===a.nav_bar.media_breakpoint?992:"md"===a.nav_bar.media_breakpoint?768:"sm"===a.nav_bar.media_breakpoint?576:992)?($(p).addClass("navbar-collapse"),$(p).removeClass("show"),$("#navigator_nav_quicklinks").addClass("show"),$("nav.navbar.navigator .attr-nav").each((function(){$(".dropdown-menu",this).removeClass("animated"),$("li.dropdown",this).off("mouseenter"),$("li.dropdown",this).off("mouseleave"),$("a.dropdown-toggle",this).off("click"),$("a.dropdown-toggle",this).on("click",(function(e){$(this).closest("li.dropdown").find(".dropdown-menu").first().stop().fadeToggle(),$(".navbar-toggle").each((function(){$(".mdi",this).removeClass("mdi-close"),$(".mdi",this).addClass("mdi-menu"),$(".navbar-collapse").removeClass("in"),$(".navbar-collapse").removeClass("open")}))})),$(this).on("mouseleave",(function(){$(".dropdown-menu",this).stop().fadeOut(),$("li.dropdown",this).removeClass("open")}))})),$("#desktop_menu").hide()):c>r&&($("#navigator_nav_quicklinks").removeClass("show"),$("#desktop_menu").show(),$(".dropdown-menu > li").on("mouseenter",(function(){if($("body").hasClass("stop-scrolling"))return!1;$("body").addClass("stop-scrolling")})),$(".dropdown-menu > li").on("mouseleave",(function(){$("body").hasClass("stop-scrolling")&&$("body").removeClass("stop-scrolling")})),$(".dropdown-menu > li").hover((function(){var e=$(this).find("ul");1==e.length&&e.addClass("scrollable-menu")})),$(p).removeClass("navbar-collapse"),$(p).addClass("show"),$("nav.navbar.navigator ul.nav").each((function(){$("a.dropdown-toggle",this).off("click"),$("a.dropdown-toggle",this).on("click",(function(e){})),$(".megamenu-fw",this).each((function(){$(".title",this).off("click"),$("a.dropdown-toggle",this).off("click"),$(".content").removeClass("animated")})),$(".dropdown-menu",this).addClass("animated"),$("li.dropdown",this).on("mouseenter",(function(){n=$(".dropdown-menu",this).eq(0),o=$(this),n.removeClass(d),n.removeClass("open"),o.addClass("open"),i=window.setTimeout((function(){o.hasClass("open")&&(n.stop().fadeIn().addClass(u),n.addClass("open"),o.addClass("open"))}),h)})),$("li.dropdown",this).on("mouseleave",(function(){window.clearTimeout(i),$(this).removeClass("open").removeClass("open"),$(".dropdown-menu",this).removeClass("open"),$(".dropdown-menu",this).eq(0).removeClass(u),$(".dropdown-menu",this).eq(0).stop().fadeOut().addClass(d)})),$(this).on("mouseleave",(function(){window.clearTimeout(i),$("li.dropdown",this).removeClass("open"),$(".dropdown-menu",this).removeClass("open"),$(".dropdown-menu",this).removeClass(u),$(".dropdown-menu",this).eq(0).stop().fadeOut().addClass(d)}))}))),$("nav.navbar.navigator .attr-nav").each((function(){$("a.dropdown-toggle",this).off("click"),$("a.dropdown-toggle",this).on("click",(function(e){})),$(".dropdown-menu",this).addClass("animated"),$("li.dropdown",this).on("mouseenter",(function(){$(".dropdown-menu",this).eq(0).removeClass(d),$(".dropdown-menu",this).eq(0).stop().fadeIn().addClass(u),$(this).addClass("open")})),$("li.dropdown",this).on("mouseleave",(function(){$(".dropdown-menu",this).eq(0).removeClass(u),$(".dropdown-menu",this).eq(0).stop().fadeOut().addClass(d),$(this).removeClass("open")})),$(this).on("mouseleave",(function(){$(".dropdown-menu",this).removeClass(u),$(".dropdown-menu",this).eq(0).stop().fadeOut().addClass(d),$("li.dropdown",this).removeClass("open")}))})),l.hasClass("navbar-full")){var f=$(window).height(),g=$(window).width();$(".nav-full").css("height",f+"px"),$(".wrap-full-menu").css("height",f+"px"),$(".wrap-full-menu").css("width",g+"px"),$(".navbar-collapse").addClass("animated"),$(".navbar-toggle").each((function(){var e=$(this).data("target");$(this).off("click"),$(this).on("click",(function(t){t.preventDefault(),$(e).removeClass(d),$(e).addClass("in"),$(e).addClass(u)})),$("li.close-full-menu").on("click",(function(t){t.preventDefault(),$(e).addClass(d),setTimeout((function(){$(e).removeClass("in"),$(e).removeClass(u)}),500)}))}))}},navbarSticky:function(){var e=$("nav.navbar.navigator");if(e.hasClass("navbar-sticky")){var t=e.height();$(".wrap-sticky").height(t);var n=$(".wrap-sticky").offset().top;$(window).on("scroll",(function(){$(window).scrollTop()>n?e.addClass("sticked"):e.removeClass("sticked")}))}},updateSidebar:function(e){var t,r=log4javascript.getLogger("j1.core.navigator.updateSidebar");return t=JSON.stringify(e),n="user state data: "+t,r.debug(n),j1.resolveMacros(e),j1.updateMacros(e),!0}}}(jQuery)},function(e,t){ + */ + +module.exports = function (options) { + // --------------------------------------------------------------------------- + // Global variables + // --------------------------------------------------------------------------- + // var messageCatalog = {}; + // var state; + // var logger; + // var logText; + // --------------------------------------------------------------------------- + // Default settings + // --------------------------------------------------------------------------- + var settings = $.extend({ + foo: 'foo_option', + bar: 'bar_option' + }, options); + var state = 'loaded'; + return { + // ------------------------------------------------------------------------- + // _init_ + // Global initializer for the core object + // ------------------------------------------------------------------------- + _init_: function _init_(options) { + // + // Place handling of options here + // + return; + }, + // END _init_ + // ------------------------------------------------------------------------- + // Returns the current (processing) state of the module + // ------------------------------------------------------------------------- + getState: function getState() { + return state; + }, + // END state + // ------------------------------------------------------------------------- + // isMobile + // Return true if the current platform is a mobile device + // ------------------------------------------------------------------------- + isMobile: function isMobile(ua_name) { + var mobile = false; + + (function (a) { + if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm|cell|chtm|cldc|cmd|co(mp|nd)|craw|da(it|ll|ng)|dbte|dcs|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|gf5|gmo|go(\.w|od)|gr(ad|un)|haie|hcit|hd(m|p|t)|hei|hi(pt|ta)|hp( i|ip)|hsc|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|m1w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|mcr|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)|pn2|po(ck|rt|se)|prox|psio|ptg|qaa|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)|sk0|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|tmo|to(pl|sh)|ts(70|m|m3|m5)|tx9|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(a.substr(0, 4))) mobile = true; + })(navigator.userAgent || navigator.vendor || window.opera); + + return mobile; + }, + // END isMobile + // ------------------------------------------------------------------------- + // Clear button for input fields (forms) + // ------------------------------------------------------------------------- + bsFormClearButton: function bsFormClearButton() { + // $('.position-relative :input').on('keydown focus', function() { + $(':input').on('keydown focus change mouseover', function () { + if ($(this).val().length > 0) { + $(this).nextAll('.form-clear').removeClass('d-none'); + } + }).on('keydown keyup blur', function () { + if ($(this).val().length === 0) { + $(this).nextAll('.form-clear').addClass('d-none'); + } + }); // $('.form-clear').on('click', function() { + // $(this).addClass('d-none').prevAll(':input').val(''); + // // hide|clear results from top search + // $('#search-results').hide(); + // $('#search-results').html(''); + // }); + }, + // END bsFormClearButton + // ------------------------------------------------------------------------- + // Initialize Backdrops on all <p> elements of class "dropcap" + // ------------------------------------------------------------------------- + createDropCap: function createDropCap() { + // add class dropcap + $('.paragraph.dropcap').children('p').addClass('dropcap'); // + + if ($('p.dropcap').length) { + $('p.dropcap').each(function () { + var $p = $(this); + var text = $.trim($p.text()); + var firstLetter = text[0]; + var marginalDropCap = '<span class="j1-dropcap">' + firstLetter + '</span>'; + $p.html(text.replace(firstLetter, marginalDropCap)); + }); + } + } // END createDropCap + + }; // end return (object) + //})( jQuery, window ); +}(); // END IFFE + +/***/ }), +/* 11 */ +/***/ (function(module, exports) { + +/* + # ----------------------------------------------------------------------------- + # ~/js/navigator/navigator.js + # Provides all JavaScript core functions for J1 Navigator + # + # Product/Info: + # https://jekyll.one + # https://github.com/adamnurdin01/navigator + # + # Copyright (C) 2021 Juergen Adams + # Copyright (C) 2016 adamnurdin01 + # + # J1 Template is licensed under MIT License. + # See: https://github.com/jekyll-one-org/J1 Template/blob/master/LICENSE + # Bootsnav is licensed under MIT License. + # See: https://github.com/adamnurdin01/navigator + # + # ----------------------------------------------------------------------------- + # NOTE: + # jadams, 2020-06-21: + # J1 Navigator needs a general revision on BS4 code and functionalities + # Current, only base function are tested with BS4 (was coded for BS3) + # ----------------------------------------------------------------------------- +*/ +// ----------------------------------------------------------------------------- +// ESLint shimming +// ----------------------------------------------------------------------------- + +/* eslint indent: "off" */ + +/* eslint no-unused-vars: "off" */ + +/* eslint no-undef: "off" */ +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// TODO: Height of dropdowns are to be limited in general +// ----------------------------------------------------------------------------- +// Navigator core registered as 'j1.core.navigator' +// ----------------------------------------------------------------------------- +module.exports = function navigator(options) { + // --------------------------------------------------------------------------- + // global vars + // --------------------------------------------------------------------------- + var message = {}; + var state; + var logger; + var logText; // ----------------------------------------------------------------------- + // default settings + // ----------------------------------------------------------------------- + + var settings = $.extend({ + foo: 'bar', + bar: 'foo' + }, options); // --------------------------------------------------------------------------- + // main object + // --------------------------------------------------------------------------- + + return { + // ------------------------------------------------------------------------- + // module initializer + // ------------------------------------------------------------------------- + init: function init(defaultOptions, menuOptions) { + logger = log4javascript.getLogger('j1.core.navigator'); + logText = 'core is being initialized'; + logger.info(logText); + this.manageDropdownMenu(defaultOptions, menuOptions); + this.navbarSticky(); + this.eventHandler(defaultOptions); // jadams, 2021-07-03: initialize events early + + message.type = 'command'; + message.action = 'core_initialized'; + message.text = 'navigator core initialized'; + j1.sendMessage('j1.core.navigator', 'j1.adapter.navigator', message); + return true; + }, + // ------------------------------------------------------------------------- + // event handler + // ------------------------------------------------------------------------- + eventHandler: function eventHandler(options) { + var defaultOptions = options; + var logger = log4javascript.getLogger('j1.core.navigator.eventHandler'); + var $getNav = $('nav.navbar.navigator'); + var json_data; // const seeMe = 'https://smee.io/wlNIFNiJN0GClm2'; + // const middleware = 'localhost:5000/state'; + // const web_server_dev = 'http://localhost:41000/status'; + // const utility_server = 'http://localhost:41001/git?request=pull'; + // var sender = seeMe; + // var payload; + // if (j1.checkUserAgent('IE') || j1.checkUserAgent('Edge')) { + // logger.warn('HTML5 server side events (SSE) not supported for: ' + userAgent); + // logger.warn('Middleware messages disabled'); + // } else { + // const middleware_status = new EventSource(sender); + // + // // ----------------------------------------------------------------------- + // // middleware event handler ( SSE currently NOT used) + // // ----------------------------------------------------------------------- + // middleware_status.onmessage = (event) => { + // const payload = JSON.parse(event.data); + // + // logger.debug('middleware: event received'); + // + // json_data = JSON.stringify(payload, undefined, 2); + // logText = 'payload: ' + json_data; + // logger.debug(logText); + // + // message.type = 'command'; + // message.action = 'status'; + // message.text = payload; + // j1.sendMessage( 'j1.core.navigator', 'j1.adapter.navigator', message ); + // + // return true; + // }; // END event onMessage + // } + // bind click event to all links with "#" to suppress default action + // See: https://stackoverflow.com/questions/134845/which-href-value-should-i-use-for-javascript-links-or-javascriptvoid0 + // + + $('a[href="#"]').click(function (e) { + e.preventDefault ? e.preventDefault() : e.returnValue = false; + logger.info('bound click event to "#", suppress default action'); + }); // ----------------------------------------------------------------------- + // Navbar Sticky + // ----------------------------------------------------------------------- + + var navSticky = $getNav.hasClass('navbar-sticky'); + + if (navSticky) { + // Wraped navigation + $getNav.wrap('<div class=\'wrap-sticky\'></div>'); + } // ----------------------------------------------------------------------- + // Navbar Center + // ----------------------------------------------------------------------- + + + if ($getNav.hasClass('brand-center')) { + var postsArr = new Array(); + var index = $('nav.brand-center'); + var $postsList = index.find('ul.navbar-nav'); //Create array of all posts in lists + + index.find('ul.navbar-nav > li').each(function () { + postsArr.push($(this).html()); + }); // Split the array at this point. The original array is altered. + + var firstList = postsArr.splice(0, Math.round(postsArr.length / 2)); + var secondList = postsArr; + var ListHTML = ''; + + var createHTML = function createHTML(list) { + ListHTML = ''; + + for (var i = 0; i < list.length; i++) { + ListHTML += '<li>' + list[i] + '</li>'; + } + }; // Generate HTML for first list + + + createHTML(firstList); + $postsList.html(ListHTML); + index.find('ul.nav').first().addClass('navbar-left'); // Generate HTML for second list + + createHTML(secondList); //Create new list after original one + + $postsList.after('<ul class="nav navbar-nav"></ul>').next().html(ListHTML); + index.find('ul.nav').last().addClass('navbar-right'); // Wrap navigation menu + + index.find('ul.nav.navbar-left').wrap('<div class=\'col_half left\'></div>'); + index.find('ul.nav.navbar-right').wrap('<div class=\'col_half right\'></div>'); // Selection Class + + index.find('ul.navbar-nav > li').each(function () { + var dropDown = $('ul.dropdown-menu', this), + megaMenu = $('ul.megamenu-content', this); + dropDown.closest('li').addClass('dropdown'); + megaMenu.closest('li').addClass('megamenu-fw'); + }); + } // ----------------------------------------------------------------------- + // Menu Center + // ----------------------------------------------------------------------- + + + if ($getNav.find('ul.nav').hasClass('navbar-center')) { + $getNav.addClass('menu-center'); + } // ----------------------------------------------------------------------- + // Navbar Full + // ----------------------------------------------------------------------- + + + if ($getNav.hasClass('navbar-full')) { + // Add Class to body + $('nav.navbar.navigator').find('ul.nav').wrap('<div class=\'wrap-full-menu\'></div>'); + $('.wrap-full-menu').wrap('<div class=\'nav-full\'></div>'); + $('ul.nav.navbar-nav').prepend('<li class=\'close-full-menu\'><a href=\'#\'><i class=\'mdi mdi-close\'></i></a></li>'); + } else if ($getNav.hasClass('navbar-mobile')) { + $getNav.removeClass('no-full'); + } else { + $getNav.addClass('no-full'); + } // ----------------------------------------------------------------------- + // Navbar Fixed + // ----------------------------------------------------------------------- + + + if ($getNav.hasClass('no-background')) { + $(window).on('scroll', function () { + var navbarHeighth = $('nav.navbar').outerHeight(); + var scrollPos = $(window).scrollTop(); + + if (scrollPos > navbarHeighth) { + $('.navbar-fixed').removeClass('no-background'); + } else { + $('.navbar-fixed').addClass('no-background'); + } + }); + } + + if ($getNav.hasClass('navbar-transparent')) { + $(window).on('scroll', function () { + var navbarHeighth = $('nav.navbar').outerHeight(); + var scrollPos = $(window).scrollTop(); + + if (scrollPos > navbarHeighth) { + $('.navbar-fixed').removeClass('navbar-transparent'); + $('.navbar-fixed').addClass('navbar-scrolled'); + } else { + $('.navbar-fixed').removeClass('navbar-scrolled'); + $('.navbar-fixed').addClass('navbar-transparent'); + } + }); + } // ----------------------------------------------------------------------- + // Toggle Search + // https://stackoverflow.com/questions/178325/how-do-i-check-if-an-element-is-hidden-in-jquery + // https://stackoverflow.com/questions/4770025/how-to-disable-scrolling-temporarily + // https://stackoverflow.com/questions/5963669/whats-the-difference-between-event-stoppropagation-and-event-preventdefault + // ----------------------------------------------------------------------- + // $('nav.navbar.navigator .attr-nav').each(function() { + + + $('.attr-nav').each(function () { + logger.debug('register OPEN event|s for QuickSearch'); + $('li.search > a', this).on('click', function (e) { + // e.preventDefault(); // don't do the default browser action + logger.debug('manage search action OPEN'); + $('html,body').animate({ + scrollTop: 0 + }, 0); + $('.top-search').slideToggle('slow', 'swing', function () { + if ($('.top-search').is(':visible')) { + // disable scrolling (desktop) + $('body').addClass('stop-scrolling'); // disable scrolling (mobile) + + $('body').bind('touchmove', function (e) { + e.preventDefault(); + }); // disable navbar + + $('#' + defaultOptions.nav_bar.container_id).hide(); + } else { + // enable scrolling (desktop) + $('body').removeClass('stop-scrolling'); // enable scrolling (mobile) + + $('body').unbind('touchmove'); // enable navbar + + $('#' + defaultOptions.nav_bar.container_id).show(); + } + }); // e.stopPropagation(); // don't bubble up the event + }); + }); + logger.debug('register CLOSE event|s for QuickSearch'); + $('.input-group-addon.close-search').on('click', function (e) { + e.preventDefault(); // don't do the default browser action + + logger.debug('manage search action CLOSE'); + $('.top-search').slideUp('slow', 'swing'); + $('html,body').animate({ + scrollTop: 0 + }, 0); // enable scrolling (desktop) + + $('body').removeClass('stop-scrolling'); // enable scrolling (mobile) + + $('body').unbind('touchmove'); // enable navbar + + $('#' + defaultOptions.nav_bar.container_id).show(); + e.stopPropagation(); // don't bubble up the event + }); // ----------------------------------------------------------------------- + // Toggle Translator SHOW|HIDE + // ----------------------------------------------------------------------- + + $('nav.navbar.navigator .attr-nav').each(function () { + logger.debug('register SHOW|HIDE event|s for J1 Translator'); + $('li.translator > a', this).on('click', function (e) { + // e.preventDefault(); // don't do the default browser action + // window.location.reload(true); + logger.debug('toggle translator icon SHOW|HIDE'); // See: https://api.jquery.com/toggle/ + // With no parameters, the .toggle() method simply toggles the visibility of elements + + $('#google_translate_element').toggle(); + + if ($('#google_translate_element').css('display') !== 'none') { + $('html,body').animate({ + scrollTop: 0 + }, 'slow'); + } // e.stopPropagation(); // don't bubble up the event + + }); + }); // ----------------------------------------------------------------------- + // Wrapper + // ----------------------------------------------------------------------- + + $('body').wrapInner('<div class=\'wrapper\'></div>'); + }, + // end event + // ------------------------------------------------------------------------- + // Manage the Menu Dropdowns for Desktop|Mobile + // ------------------------------------------------------------------------- + manageDropdownMenu: function manageDropdownMenu(defaultOptions, menuOptions) { + var navDefaultOptions = defaultOptions; + var navMenuOptions = menuOptions; + var $getNav = $('nav.navbar.navigator'); + var $windowOrientation = window.matchMedia('(orientation: landscape)').matches ? 'landscape' : 'portrait'; + var $getWindow = $(window).width(); + var $getNavWidth = $('nav').width(); + var $getIn = $getNav.find('ul.nav').data('in'); + var $getOut = $getNav.find('ul.nav').data('out'); + var menuSelector = '#' + navMenuOptions.xhr_container_id + '.collapse'; + var delayMenuOpen = navMenuOptions.delay_menu_open; + var $menu; + var breakPoint; + var $dropDown; + var timeoutHandle; // BS4 @media MAX breakpoints + // NOTE: a media query is always a range + // ----------------------------------------------------------------------- + + var gridBreakpoint_lg = 992; // bs-breakpoint-lg + + var gridBreakpoint_md = 768; // bs-breakpoint-md + + var gridBreakpoint_sm = 576; // bs-breakpoint-sm + // BS4 @media MIN breakpoints + // ----------------------------------------------------------------------- + // NOTE: a media query is always a range + // var gridBreakpoint_lg = 991; + // var gridBreakpoint_md = 767; + // var gridBreakpoint_sm = 575; + // @media ranges + // ----------------------------------------------------------------------- + + var small_range = { + min: '0em', + max: '40em' + }; + /* 0, 640px */ + + var medium_range = { + min: '40.063em', + max: '64em' + }; + /* 641px, 1024px */ + + var large_range = { + min: '64.063em', + max: '90em' + }; + /* 1025px, 1440px */ + + var xlarge_range = { + min: '90.063em', + max: '120em' + }; + /* 1441px, 1920px */ + + var xxlarge_range = { + min: '120.063em' + }; + /* 1921px */ + // jadams, 2019-05-01: Set Media Breakpoint for Desktop|Mobile Navigation + + if (navDefaultOptions.nav_bar.media_breakpoint === 'lg') { + breakPoint = gridBreakpoint_lg; + } else if (navDefaultOptions.nav_bar.media_breakpoint === 'md') { + breakPoint = gridBreakpoint_md; + } else if (navDefaultOptions.nav_bar.media_breakpoint === 'sm') { + breakPoint = gridBreakpoint_sm; + } else { + breakPoint = gridBreakpoint_lg; + } // ----------------------------------------------------------------------- + // Tablet or Mobile + // NOTE: + // Managing the mobile menu is moved to MMenu Plugin + // Only base functions like QuickLinks are managed by + // J1 Navigator + // ----------------------------------------------------------------------- + // MIN media breakpoint + + + if ($getWindow <= breakPoint) { + // Collapse Navbar + $(menuSelector).addClass('navbar-collapse'); + $(menuSelector).removeClass('show'); // + + $('#navigator_nav_quicklinks').addClass('show'); // Enable click Quicklink Navigation + + $('nav.navbar.navigator .attr-nav').each(function () { + $('.dropdown-menu', this).removeClass('animated'); + $('li.dropdown', this).off('mouseenter'); + $('li.dropdown', this).off('mouseleave'); + $('a.dropdown-toggle', this).off('click'); + $('a.dropdown-toggle', this).on('click', function (e) { + // e.stopPropagation(); // don't bubble up the event + $(this).closest('li.dropdown').find('.dropdown-menu').first().stop().fadeToggle(); + $('.navbar-toggle').each(function () { + $('.mdi', this).removeClass('mdi-close'); + $('.mdi', this).addClass('mdi-menu'); + $('.navbar-collapse').removeClass('in'); + $('.navbar-collapse').removeClass('open'); + }); + }); + $(this).on('mouseleave', function () { + $('.dropdown-menu', this).stop().fadeOut(); + $('li.dropdown', this).removeClass('open'); // return false; + }); + }); + $('#desktop_menu').hide(); // ----------------------------------------------------------------------- + // Desktop Navigation does NOT work on physical devices like iPad|Pro + // Config DISABLED + // + // } else if ( $getWindow > breakPoint || $getWindow <= 1024 && $windowOrientation == 'portrait' ) { + } else if ($getWindow > breakPoint) { + // ----------------------------------------------------------------------- + // Desktop + // ----------------------------------------------------------------------- + $('#navigator_nav_quicklinks').removeClass('show'); + $('#desktop_menu').show(); // jadams, 2021-03-05: manage dropdown menus + // --------------------------------------------------------------------- + + $('.dropdown-menu > li').on('mouseenter', function () { + if ($('body').hasClass('stop-scrolling')) { + return false; + } else { + $('body').addClass('stop-scrolling'); + } + }); + $('.dropdown-menu > li').on('mouseleave', function () { + // stop scrolling if top search or any (mmenu) drawer is opened + if ($('body').hasClass('stop-scrolling')) { + $('body').removeClass('stop-scrolling'); + } + }); // limit the dropdown menu lenght if needed + + $('.dropdown-menu > li').hover(function () { + var $container = $(this); + var $list = $container.find('ul'); // limit LAST menu ONLY + // + + if ($list.length == 1) { + $list.addClass('scrollable-menu'); + } + }); // jadams, 2021-03-06: Enable|Show Desktop Menu|s + // + + $(menuSelector).removeClass('navbar-collapse'); + $(menuSelector).addClass('show'); // Navbar Sidebar + // jadams, 2021-03-05: Sidebar NOT used anymore + // Open Desktop Menu|s on hover + // + + $('nav.navbar.navigator ul.nav').each(function () { + $('a.dropdown-toggle', this).off('click'); + $('a.dropdown-toggle', this).on('click', function (e) {// e.stopPropagation(); // don't bubble up the event + }); + $('.megamenu-fw', this).each(function () { + $('.title', this).off('click'); + $('a.dropdown-toggle', this).off('click'); + $('.content').removeClass('animated'); + }); + $('.dropdown-menu', this).addClass('animated'); + $('li.dropdown', this).on('mouseenter', function () { + $menu = $('.dropdown-menu', this).eq(0); + $dropDown = $(this); + $menu.removeClass($getOut); + $menu.removeClass('open'); + $dropDown.addClass('open'); // Get|Set the timeout object to delay the dropdown open + + timeoutHandle = window.setTimeout(function () { + if ($dropDown.hasClass('open')) { + $menu.stop().fadeIn().addClass($getIn); + $menu.addClass('open'); + $dropDown.addClass('open'); + } + }, delayMenuOpen); + }); + $('li.dropdown', this).on('mouseleave', function () { + window.clearTimeout(timeoutHandle); // Clear the timeout object + + $(this).removeClass('open').removeClass('open'); + $('.dropdown-menu', this).removeClass('open'); + $('.dropdown-menu', this).eq(0).removeClass($getIn); + $('.dropdown-menu', this).eq(0).stop().fadeOut().addClass($getOut); + }); + $(this).on('mouseleave', function () { + window.clearTimeout(timeoutHandle); + $('li.dropdown', this).removeClass('open'); + $('.dropdown-menu', this).removeClass('open'); + $('.dropdown-menu', this).removeClass($getIn); + $('.dropdown-menu', this).eq(0).stop().fadeOut().addClass($getOut); + }); + }); // END Desktop Menu + } // end Desktop + // ----------------------------------------------------------------------- + // Hover Open on Quicklink Navigation + // ----------------------------------------------------------------------- + + + $('nav.navbar.navigator .attr-nav').each(function () { + $('a.dropdown-toggle', this).off('click'); + $('a.dropdown-toggle', this).on('click', function (e) {// e.stopPropagation(); // don't bubble up the event + }); + $('.dropdown-menu', this).addClass('animated'); + $('li.dropdown', this).on('mouseenter', function () { + $('.dropdown-menu', this).eq(0).removeClass($getOut); + $('.dropdown-menu', this).eq(0).stop().fadeIn().addClass($getIn); + $(this).addClass('open'); //return false; + }); + $('li.dropdown', this).on('mouseleave', function () { + $('.dropdown-menu', this).eq(0).removeClass($getIn); + $('.dropdown-menu', this).eq(0).stop().fadeOut().addClass($getOut); + $(this).removeClass('open'); + }); + $(this).on('mouseleave', function () { + $('.dropdown-menu', this).removeClass($getIn); + $('.dropdown-menu', this).eq(0).stop().fadeOut().addClass($getOut); + $('li.dropdown', this).removeClass('open'); //return false; + }); + }); // ----------------------------------------------------------------------- + // Fullscreen Menu + // ----------------------------------------------------------------------- + + if ($getNav.hasClass('navbar-full')) { + var windowHeight = $(window).height(), + windowWidth = $(window).width(); + $('.nav-full').css('height', windowHeight + 'px'); + $('.wrap-full-menu').css('height', windowHeight + 'px'); + $('.wrap-full-menu').css('width', windowWidth + 'px'); + $('.navbar-collapse').addClass('animated'); + $('.navbar-toggle').each(function () { + var getId = $(this).data('target'); + $(this).off('click'); + $(this).on('click', function (e) { + e.preventDefault(); + $(getId).removeClass($getOut); + $(getId).addClass('in'); + $(getId).addClass($getIn); // e.stopPropagation(); // don't bubble up the event + // return false; + }); + $('li.close-full-menu').on('click', function (e) { + e.preventDefault(); + $(getId).addClass($getOut); + setTimeout(function () { + $(getId).removeClass('in'); + $(getId).removeClass($getIn); + }, 500); //e.stopPropagation(); // don't bubble up the event + // return false; + }); + }); + } + }, + // end manageDropdownMenu + // ------------------------------------------------------------------------- + // Sticky Navbar + // ------------------------------------------------------------------------- + navbarSticky: function navbarSticky() { + var $getNav = $('nav.navbar.navigator'), + navSticky = $getNav.hasClass('navbar-sticky'); + + if (navSticky) { + // Set Height Navigation + var $getHeight = $getNav.height(); + $('.wrap-sticky').height($getHeight); // Windown on scroll + + var getOffset = $('.wrap-sticky').offset().top; + $(window).on('scroll', function () { + var scrollTop = $(window).scrollTop(); + + if (scrollTop > getOffset) { + $getNav.addClass('sticked'); + } else { + $getNav.removeClass('sticked'); + } + }); + } + }, + // end navbarSticky + // ------------------------------------------------------------------------- + // updateSidebar + // Note: + // ------------------------------------------------------------------------- + updateSidebar: function updateSidebar(user_data) { + var logger = log4javascript.getLogger('j1.core.navigator.updateSidebar'); + var json_message; // json_message = JSON.stringify(user_data, undefined, 2); // multiline + + json_message = JSON.stringify(user_data); + logText = 'user state data: ' + json_message; + logger.debug(logText); // Replace Macro placeholders to values + + j1.resolveMacros(user_data); // Replace Macro values only + + j1.updateMacros(user_data); + return true; + } // END updateSidebar + + }; // end return (object) +}(jQuery); + +/***/ }), +/* 12 */ +/***/ (function(module, exports) { + +/* + # ----------------------------------------------------------------------------- + # ~200_template_js/js/asciidoctor/asciidoctor.js + # Provides JS functions to (dynamically) modify Asciidoctor HTML elements + # + # Product/Info: + # http://jekyll.one + # + # Copyright (C) 2021 Juergen Adams + # + # J1 Template is licensed under MIT License. + # See: https://github.com/jekyll-one/J1 Template/blob/master/LICENSE + # ----------------------------------------------------------------------------- + # NOTE: + # ----------------------------------------------------------------------------- +*/ +// ----------------------------------------------------------------------------- +// ESLint shimming +// ----------------------------------------------------------------------------- + +/* eslint no-unused-vars: "off" */ + +/* eslint no-undef: "off" */ + +/* eslint no-redeclare: "off" */ + +/* global window */ +// TODO: +// ----------------------------------------------------------------------------- +// J1 Asciidoctor registered as "asciidoctor" +// ----------------------------------------------------------------------------- + /*! * J1 Asciidoctor * Copyright (C) 2021 Juergen Adams * Licensed under MIT License. */ -e.exports=(jQuery,{init:function(e){var t=e,n=log4javascript.getLogger("j1.core.asciidoctor");e=$.extend({dummyOption:!1},t),logText="J1 Asciidoctor is being initialized",n.info(logText),this.callouts()},callouts:function(e){var t="";0==$(".colist > table > colgroup").length&&(t+="\x3c!-- [INFO ] [j1.core.asciidoctor ] [ place a colgroup dynamically ] --\x3e\n",t+='<colgroup> <col style="width: 5%;"> <col style="width: 95%;"> </colgroup>',$(".colist > table").prepend(t))},conums:function(e){var t=setInterval((function(){"finished"==j1.getState()&&0==$(".colist > table > colgroup").length&&($(".colist > table").prepend('<colgroup> <col style="width: 5%;"> <col style="width: 95%;"> </colgroup>'),clearInterval(t))}))}})},function(e,t,n){"use strict";e.exports=function(e){$.extend({foo:"foo_option",bar:"bar_option"},e);return{scroll:function(e,t){var n,r;r="run module scrollSmooth",(n=log4javascript.getLogger("j1.core.scrollSmooth")).info(r);var o=t.duration,i=t.offset;this.scrollTo(e,{duration:o,offset:i,callback:null}),r="scrollSmooth finished",n.info(r)},scrollTo:function(e,t){var n,r,o=window.pageYOffset,i={duration:t.duration,offset:t.offset||0,callback:t.callback,easing:t.easing||function(e,t,n,r){return(e/=r/2)<1?n/2*e*e+t:(e--,-n/2*(e*(e-2)-1)+t)}},a=document.querySelector('[id="'+decodeURI(e).split("#").join("")+'"]'),s="string"==typeof e?i.offset+(e?a&&a.getBoundingClientRect().top||0:-(document.documentElement.scrollTop||document.body.scrollTop)):e,l="function"==typeof i.duration?i.duration(s):i.duration;function c(e){r=e-n,window.scrollTo(0,i.easing(r,o,s,l)),r<l?requestAnimationFrame(c):(window.scrollTo(0,o+s),$(window).scrollTop($(window).scrollTop()+1),$(window).scrollTop($(window).scrollTop()-1),"function"==typeof i.callback&&i.callback())}requestAnimationFrame((function(e){n=e,c(e)}))}}}(jQuery)},function(e,t,n){e.exports=n(15)},function(e,t,n){const r=n(1),{validateText:o,validateSourceLanguage:i,validateTargetLanguage:a,validateSourceTargetLanguage:s,validateBeginning:l}=n(16),{splitSentences:c,getTranslation:u,getAlternatives:d}=n(17),{EOL:p}=n(23);function h(e){return Promise.all(e).then(e=>{const t=e.filter(e=>e).join("\n");return t.length?Promise.reject(new Error("Input parameter validation failed with error(s): "+t)):Promise.resolve("")})}function f(e,t,n="auto"){return h([o(e),i(n),a(t),s(n,t)]).then(t=>c(e.split(p),n)).then(m).then(([e,n])=>Promise.all(e.map(e=>0===e.length?[]:u(e,t,n||"auto").then(g))).then(e=>({targetLanguage:t,resolvedSourceLanguage:e.map(e=>e[1]).reduce((e,t)=>[...e,e.indexOf(t)<0&&t],[]).filter(e=>e).join(","),translation:e.map(([e])=>e||"").join(p)})))}function g(e){try{const{result:{target_lang:t,source_lang:n,translations:r}}=e;return[r.map(({beams:[{postprocessed_sentence:e}]})=>e).join(" "),n]}catch(t){throw new Error("Unexpected error when parsing deepl translation response: "+JSON.stringify(e))}}function m(e){try{const{result:{splitted_texts:t,lang_is_confident:n,lang:r}}=e;return[t,n&&r]}catch(t){throw new Error("Unexpected error when parsing deepl split sentence response: "+JSON.stringify(e))}}e.exports={translate:f,translateWithAlternatives:function(e,t,n="auto",r){return h([o(e),i(n),a(t),s(n,t)]).then(o=>u([e],t,n,r)).then(({result:{source_lang:e,translations:[{beams:n}]}})=>({targetLanguage:t,resolvedSourceLanguage:e,translation:n[0].postprocessed_sentence,translationAlternatives:n.map(({postprocessed_sentence:e})=>e)}))},detectLanguage:function(e){return f(e,"EN").then(({resolvedSourceLanguage:e})=>({languageCode:e,languageName:e.split(",").map(e=>r[e]).join(",")}))},wordAlternatives:function(e,t,n,r){return h([o(e),i(n),a(t),s(n,t),l(r)]).then(o=>d(e,t,n,r)).then(e=>({targetLanguage:e.result.target_lang,resolvedSourceLanguage:e.result.source_lang,alternatives:e.result.translations[0].beams.map(e=>e.postprocessed_sentence)}))}}},function(e,t,n){const r=n(1);e.exports={validateText:e=>Promise.resolve(("string"!=typeof e||0===e.trim().length)&&"Must provide valid text for translation"),validateTargetLanguage:e=>Promise.resolve(!r[e]&&"Invalid target language code "+e),validateSourceLanguage:e=>Promise.resolve("auto"!==e&&!r[e]&&"Invalid source language code "+e),validateSourceTargetLanguage:(e,t)=>Promise.resolve(t===e&&"Target and source language codes identical"),validateBeginning:e=>Promise.resolve(!e&&"Must provide valid text for beginning translation override")}},function(e,t,n){(function(t){const r=n(22);function o(e){return{hostname:"www2.deepl.com",port:443,protocol:"https:",path:"/jsonrpc",method:"POST",headers:{"Content-Type":"application/json","Content-Length":t.byteLength(JSON.stringify(e)),"Cache-Control":"no-cache"}}}e.exports={getTranslation:(e,t,n,i)=>{const a=function(e,t,n,r){return{jsonrpc:"2.0",method:"LMT_handle_jobs",params:{jobs:e.map(e=>({kind:"default",raw_en_sentence:e,de_sentence_beginning:r})),lang:{user_preferred_langs:["EN"],source_lang_user_selected:n,target_lang:t},priority:-1},id:1}}(e,t,n,i),s=o(a);return r(s,a)},splitSentences:(e,t)=>{const n=function(e,t){return{jsonrpc:"2.0",method:"LMT_split_into_sentences",params:{texts:e,lang:{lang_user_selected:t,user_preferred_langs:["EN"]}},id:1}}(e,t),i=o(n);return r(i,n)},getAlternatives:(e,t,n,i)=>{const a=function(e,t,n,r){return{jsonrpc:"2.0",method:"LMT_handle_jobs",params:{jobs:[{de_sentence_beginning:r,kind:"alternatives_at_position",raw_en_sentence:e}],lang:{source_lang_computed:n,target_lang:t},priority:1},id:1}}(e,t,n,i),s=o(a);return r(s,a)}}}).call(this,n(18).Buffer)},function(e,t,n){"use strict";(function(e){ -/*! +module.exports = function asciidoctor(options) { + return { + // ------------------------------------------------------------------------- + // module initializer + // ------------------------------------------------------------------------- + init: function init(options) { + var moduleOptions = options; + var logger = log4javascript.getLogger('j1.core.asciidoctor'); + var moduleDefaults = { + dummyOption: false // placeholder + + }; + var options = $.extend(moduleDefaults, moduleOptions); + logText = 'J1 Asciidoctor is being initialized'; + logger.info(logText); + this.callouts(); + }, + // end initializer + // ------------------------------------------------------------------------- + // manage callouts (HTML) + // ------------------------------------------------------------------------- + // see: https://stackoverflow.com/questions/19393493/add-colgroup-for-each-table-column + callouts: function callouts(options) { + var colgroupList = ''; // If the colist does not have a <colgroup> structure + // + + if ($('.colist > table > colgroup').length == 0) { + colgroupList += '<!-- [INFO ] [j1.core.asciidoctor ] [ place a colgroup dynamically ] -->' + '\n'; + colgroupList += '<colgroup> <col style="width: 5%;"> <col style="width: 95%;"> </colgroup>'; + $(".colist > table").prepend(colgroupList); + } + }, + // end callouts + // ------------------------------------------------------------------------- + // manage callouts (HTML) + // ------------------------------------------------------------------------- + conums: function conums(options) { + var dependencies_met_page_finished = setInterval(function () { + if (j1.getState() == 'finished') { + // If the colist does not have a <colgroup> structure + if ($('.colist > table > colgroup').length == 0) { + var colgroupList = ''; + colgroupList += '<colgroup> <col style="width: 5%;"> <col style="width: 95%;"> </colgroup>'; + $(".colist > table").prepend(colgroupList); + clearInterval(dependencies_met_page_finished); + } + } + }); + } // end conums + + }; // END return +}(jQuery); + +/***/ }), +/* 13 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* + # ----------------------------------------------------------------------------- + # ~/js/scroll-smooth/scroll-smooth.js + # Provides Javascript functions for smooth scrolling + # + # Product/Info: + # http://jekyll.one + # + # Copyright (C) 2020 Juergen Adams + # + # J1 Template is licensed under the MIT License. + # See: https://github.com/jekyll-one-org/J1 Template/blob/master/LICENSE + # ----------------------------------------------------------------------------- +*/ + // ----------------------------------------------------------------------------- +// ESLint shimming +// ----------------------------------------------------------------------------- + +/* eslint indent: "off" */ + +/* eslint no-unused-vars: "off" */ + +/* eslint no-undef: "off" */ + +/* eslint no-redeclare: "off" */ + +/* eslint indent: "off" */ +// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// scrollSmooth core registered as "scrollSmooth" +// ----------------------------------------------------------------------------- + +module.exports = function scrollSmooth(options) { + // Default settings + var settings = $.extend({ + foo: 'foo_option', + bar: 'bar_option' + }, options); // ----------------------------------------------------------------------- + // Helper functions + // ----------------------------------------------------------------------- + + function stripHash(url) { + return url.slice(0, url.lastIndexOf('#')); + } + + function isCssSmoothScrollSupported() { + return 'scrollBehavior' in document.documentElement.style; + } + + return { + // ------------------------------------------------------------------------- + // Initialize scrollSmooth + // ------------------------------------------------------------------------- + scroll: function scroll(target, options) { + var logger; + var logText; + logger = log4javascript.getLogger('j1.core.scrollSmooth'); // indicator|check currently NOT used + // if (isCssSmoothScrollSupported()) { } + + logText = 'run module scrollSmooth'; + logger.info(logText); + var duration = options.duration; + var offset = options.offset; // var pageUrl = options.location.hash + // ? stripHash(options.location.href) + // : options.location.href; + + this.scrollTo(target, { + duration: duration, + offset: offset, + callback: null + }); + logText = 'scrollSmooth finished'; + logger.info(logText); + }, + // ------------------------------------------------------------------------- + // scrollTo + // ------------------------------------------------------------------------- + scrollTo: function scrollTo(target, options) { + var start = window.pageYOffset; + var opt = { + duration: options.duration, + offset: options.offset || 0, + callback: options.callback, + easing: options.easing || easeInOutQuad + }; // This makes ids that start with a number work: ('[id="' + decodeURI(target).split('#').join('') + '"]') + // DecodeURI for nonASCII hashes, they was encoded, but id was not encoded, it lead to not finding the tgt element by id. + // And this is for IE: document.body.scrollTop + + var tgt = document.querySelector('[id="' + decodeURI(target).split('#').join('') + '"]'); + var distance = typeof target === 'string' ? opt.offset + (target ? tgt && tgt.getBoundingClientRect().top || 0 // handle non-existent links better. + : -(document.documentElement.scrollTop || document.body.scrollTop)) : target; + var duration = typeof opt.duration === 'function' ? opt.duration(distance) : opt.duration; + var timeStart; + var timeElapsed; + requestAnimationFrame(function (time) { + timeStart = time; + loop(time); + }); + + function loop(time) { + timeElapsed = time - timeStart; + window.scrollTo(0, opt.easing(timeElapsed, start, distance, duration)); + + if (timeElapsed < duration) { + requestAnimationFrame(loop); + } else { + end(); + } + } + + function end() { + window.scrollTo(0, start + distance); // jadams, 2020-07-04: on (some?) mobile devices, the navbar + // background is NOT switched (always?) correctly on a + // page RELOAD. + // + // Solution: scroll the page one pixel back and forth (trigger) + // to get the right position for the Toccer and adjust the + // Navigator to display the (tranparent) navbar correctly based + // on their onscroll events registered. + // + + $(window).scrollTop($(window).scrollTop() + 1); + $(window).scrollTop($(window).scrollTop() - 1); + + if (typeof opt.callback === 'function') { + opt.callback(); + } + } // Robert Penner's easeInOutQuad - http://robertpenner.com/easing/ + + + function easeInOutQuad(t, b, c, d) { + t /= d / 2; + if (t < 1) return c / 2 * t * t + b; + t--; + return -c / 2 * (t * (t - 2) - 1) + b; + } + } // END scrollTo + + }; // END return +}(jQuery); + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(15); + +/***/ }), +/* 15 */ +/***/ (function(module, exports, __webpack_require__) { + +const languages = __webpack_require__(1); + +const { + validateText, + validateSourceLanguage, + validateTargetLanguage, + validateSourceTargetLanguage, + validateBeginning +} = __webpack_require__(16); + +const { + splitSentences, + getTranslation, + getAlternatives +} = __webpack_require__(17); + +const { + EOL +} = __webpack_require__(23); + +function detectLanguage(text) { + return translate(text, 'EN').then(({ + resolvedSourceLanguage + }) => { + return { + languageCode: resolvedSourceLanguage, + languageName: resolvedSourceLanguage.split(',').map(code => languages[code]).join(',') + }; + }); +} + +function validateInputs(validationArray) { + return Promise.all(validationArray).then(validationResults => { + const errors = validationResults.filter(validationResult => validationResult).join('\n'); + return errors.length ? Promise.reject(new Error(`Input parameter validation failed with error(s): ${errors}`)) : Promise.resolve(''); + }); +} + +function translate(text, targetLanguage, sourceLanguage = 'auto') { + return validateInputs([validateText(text), validateSourceLanguage(sourceLanguage), validateTargetLanguage(targetLanguage), validateSourceTargetLanguage(sourceLanguage, targetLanguage)]).then(valid => splitSentences(text.split(EOL), sourceLanguage)).then(transformSplitSentencesResponse).then(([paragraphs, resolvedSourceLanguage]) => { + return Promise.all(paragraphs.map(paragraph => paragraph.length === 0 ? [] : getTranslation(paragraph, targetLanguage, resolvedSourceLanguage || 'auto').then(transformTranslationResponse))).then(translatedParagraphs => ({ + targetLanguage, + resolvedSourceLanguage: translatedParagraphs.map(paragraph => paragraph[1]).reduce((unique, current) => [...unique, unique.indexOf(current) < 0 && current], []).filter(lang => lang).join(','), + translation: translatedParagraphs.map(([paragraph]) => paragraph || '').join(EOL) + })); + }); +} + +function translateWithAlternatives(text, targetLanguage, sourceLanguage = 'auto', beginning) { + return validateInputs([validateText(text), validateSourceLanguage(sourceLanguage), validateTargetLanguage(targetLanguage), validateSourceTargetLanguage(sourceLanguage, targetLanguage)]).then(valid => getTranslation([text], targetLanguage, sourceLanguage, beginning)).then(({ + result: { + source_lang, + translations: [{ + beams + }] + } + }) => ({ + targetLanguage, + resolvedSourceLanguage: source_lang, + translation: beams[0].postprocessed_sentence, + translationAlternatives: beams.map(({ + postprocessed_sentence + }) => postprocessed_sentence) + })); +} + +function wordAlternatives(text, targetLanguage, sourceLanguage, beginning) { + return validateInputs([validateText(text), validateSourceLanguage(sourceLanguage), validateTargetLanguage(targetLanguage), validateSourceTargetLanguage(sourceLanguage, targetLanguage), validateBeginning(beginning)]).then(valid => getAlternatives(text, targetLanguage, sourceLanguage, beginning)).then(res => { + return { + targetLanguage: res.result.target_lang, + resolvedSourceLanguage: res.result.source_lang, + alternatives: res.result.translations[0].beams.map(alt => { + return alt.postprocessed_sentence; + }) + }; + }); +} + +function transformTranslationResponse(response) { + try { + const { + result: { + target_lang: targetLanguage, + source_lang: resolvedSourceLanguage, + translations + } + } = response; + const translatedSentences = translations.map(({ + beams: [{ + postprocessed_sentence: translation + }] + }) => translation); + return [translatedSentences.join(' '), resolvedSourceLanguage]; + } catch (error) { + throw new Error(`Unexpected error when parsing deepl translation response: ${JSON.stringify(response)}`); + } +} + +function transformSplitSentencesResponse(response) { + try { + const { + result: { + splitted_texts: texts, + lang_is_confident, + lang + } + } = response; + return [texts, lang_is_confident && lang]; + } catch (error) { + throw new Error(`Unexpected error when parsing deepl split sentence response: ${JSON.stringify(response)}`); + } +} + +module.exports = { + translate, + translateWithAlternatives, + detectLanguage, + wordAlternatives +}; + +/***/ }), +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { + +const languages = __webpack_require__(1); + +module.exports = { + validateText: text => Promise.resolve((typeof text !== 'string' || text.trim().length === 0) && 'Must provide valid text for translation'), + validateTargetLanguage: targetLanguage => Promise.resolve(!languages[targetLanguage] && `Invalid target language code ${targetLanguage}`), + validateSourceLanguage: sourceLanguage => Promise.resolve(sourceLanguage !== 'auto' && !languages[sourceLanguage] && `Invalid source language code ${sourceLanguage}`), + validateSourceTargetLanguage: (sourceLanguage, targetLanguage) => Promise.resolve(targetLanguage === sourceLanguage && `Target and source language codes identical`), + validateBeginning: beginning => Promise.resolve(!beginning && `Must provide valid text for beginning translation override`) +}; + +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(Buffer) {const request = __webpack_require__(22); + +const DEEPL_HOSTNAME = 'www2.deepl.com'; +const DEEPL_ENDPOINT = '/jsonrpc'; + +function getHandleJobsBody(texts, targetLanguage, sourceLanguage, beginning) { + return { + jsonrpc: '2.0', + method: 'LMT_handle_jobs', + params: { + jobs: texts.map(text => { + return { + kind: 'default', + raw_en_sentence: text, + de_sentence_beginning: beginning + }; + }), + lang: { + user_preferred_langs: ['EN'], + source_lang_user_selected: sourceLanguage, + target_lang: targetLanguage + }, + priority: -1 + }, + id: 1 + }; +} + +function getAlternativesBody(text, targetLanguage, sourceLanguage, beginning) { + return { + jsonrpc: '2.0', + method: 'LMT_handle_jobs', + params: { + jobs: [{ + de_sentence_beginning: beginning, + kind: 'alternatives_at_position', + raw_en_sentence: text + }], + lang: { + source_lang_computed: sourceLanguage, + target_lang: targetLanguage + }, + priority: 1 + }, + id: 1 + }; +} + +function getSplitSentencesBody(texts, sourceLanguage) { + return { + jsonrpc: '2.0', + method: 'LMT_split_into_sentences', + params: { + texts, + lang: { + lang_user_selected: sourceLanguage, + user_preferred_langs: ['EN'] + } + }, + id: 1 + }; +} + +function getRequestOptions(postBody) { + return { + hostname: DEEPL_HOSTNAME, + port: 443, + protocol: 'https:', + path: DEEPL_ENDPOINT, + method: 'POST', + headers: { + 'Content-Type': 'application/json', + 'Content-Length': Buffer.byteLength(JSON.stringify(postBody)), + 'Cache-Control': 'no-cache' + } + }; +} + +module.exports = { + getTranslation: (texts, targetLanguage, sourceLanguage, beginning) => { + const postBody = getHandleJobsBody(texts, targetLanguage, sourceLanguage, beginning); + const options = getRequestOptions(postBody); + return request(options, postBody); + }, + splitSentences: (texts, sourceLanguage) => { + const postBody = getSplitSentencesBody(texts, sourceLanguage); + const options = getRequestOptions(postBody); + return request(options, postBody); + }, + getAlternatives: (text, targetLanguage, sourceLanguage, beginning) => { + const postBody = getAlternativesBody(text, targetLanguage, sourceLanguage, beginning); + const options = getRequestOptions(postBody); + return request(options, postBody); + } +}; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(18).Buffer)) + +/***/ }), +/* 18 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) {/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh <http://feross.org> * @license MIT */ -var r=n(19),o=n(20),i=n(21);function a(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=l.prototype:(null===e&&(e=new l(t)),e.length=t),e}function l(e,t,n){if(!(l.TYPED_ARRAY_SUPPORT||this instanceof l))return new l(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return d(this,e)}return c(this,e,t,n)}function c(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);l.TYPED_ARRAY_SUPPORT?(e=t).__proto__=l.prototype:e=p(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!l.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|f(t,n),o=(e=s(e,r)).write(t,n);o!==r&&(e=e.slice(0,o));return e}(e,t,n):function(e,t){if(l.isBuffer(t)){var n=0|h(t.length);return 0===(e=s(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?s(e,0):p(e,t);if("Buffer"===t.type&&i(t.data))return p(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function d(e,t){if(u(t),e=s(e,t<0?0:0|h(t)),!l.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function p(e,t){var n=t.length<0?0:0|h(t.length);e=s(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function h(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function f(e,t){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return $(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return U(e).length;default:if(r)return $(e).length;t=(""+t).toLowerCase(),r=!0}}function g(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,n);case"utf8":case"utf-8":return T(this,t,n);case"ascii":return A(this,t,n);case"latin1":case"binary":return M(this,t,n);case"base64":return S(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function m(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function v(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=l.from(t,r)),l.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,o);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,o){var i,a=1,s=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,l/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var u=-1;for(i=n;i<s;i++)if(c(e,i)===c(t,-1===u?0:i-u)){if(-1===u&&(u=i),i-u+1===l)return u*a}else-1!==u&&(i-=i-u),u=-1}else for(n+l>s&&(n=s-l),i=n;i>=0;i--){for(var d=!0,p=0;p<l;p++)if(c(e,i+p)!==c(t,p)){d=!1;break}if(d)return i}return-1}function b(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[n+a]=s}return a}function w(e,t,n,r){return H($(t,e.length-n),e,n,r)}function C(e,t,n,r){return H(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function E(e,t,n,r){return C(e,t,n,r)}function x(e,t,n,r){return H(U(t),e,n,r)}function L(e,t,n,r){return H(function(e,t){for(var n,r,o,i=[],a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function S(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function T(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o<n;){var i,a,s,l,c=e[o],u=null,d=c>239?4:c>223?3:c>191?2:1;if(o+d<=n)switch(d){case 1:c<128&&(u=c);break;case 2:128==(192&(i=e[o+1]))&&(l=(31&c)<<6|63&i)>127&&(u=l);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(l=(15&c)<<12|(63&i)<<6|63&a)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:i=e[o+1],a=e[o+2],s=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(l=(15&c)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(u=l)}null===u?(u=65533,d=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),o+=d}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=4096));return n}(r)}t.Buffer=l,t.SlowBuffer=function(e){+e!=e&&(e=0);return l.alloc(+e)},t.INSPECT_MAX_BYTES=50,l.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=a(),l.poolSize=8192,l._augment=function(e){return e.__proto__=l.prototype,e},l.from=function(e,t,n){return c(null,e,t,n)},l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0})),l.alloc=function(e,t,n){return function(e,t,n,r){return u(t),t<=0?s(e,t):void 0!==n?"string"==typeof r?s(e,t).fill(n,r):s(e,t).fill(n):s(e,t)}(null,e,t,n)},l.allocUnsafe=function(e){return d(null,e)},l.allocUnsafeSlow=function(e){return d(null,e)},l.isBuffer=function(e){return!(null==e||!e._isBuffer)},l.compare=function(e,t){if(!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,o=0,i=Math.min(n,r);o<i;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!i(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=l.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){var a=e[n];if(!l.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,o),o+=a.length}return r},l.byteLength=f,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},l.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},l.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},l.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?T(this,0,e):g.apply(this,arguments)},l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},l.prototype.compare=function(e,t,n,r,o){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(i,a),c=this.slice(r,o),u=e.slice(t,n),d=0;d<s;++d)if(c[d]!==u[d]){i=c[d],a=u[d];break}return i<a?-1:a<i?1:0},l.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},l.prototype.indexOf=function(e,t,n){return v(this,e,t,n,!0)},l.prototype.lastIndexOf=function(e,t,n){return v(this,e,t,n,!1)},l.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":return C(this,e,t,n);case"latin1":case"binary":return E(this,e,t,n);case"base64":return x(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function A(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}function M(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}function I(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var o="",i=t;i<n;++i)o+=j(e[i]);return o}function k(e,t,n){for(var r=e.slice(t,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function R(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,n,r,o,i){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function _(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);o<i;++o)e[n+o]=(t&255<<8*(r?o:1-o))>>>8*(r?o:1-o)}function N(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o<i;++o)e[n+o]=t>>>8*(r?o:3-o)&255}function P(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function O(e,t,n,r,i){return i||P(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function B(e,t,n,r,i){return i||P(e,0,n,8),o.write(e,t,n,r,52,8),n+8}l.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),l.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=l.prototype;else{var o=t-e;n=new l(o,void 0);for(var i=0;i<o;++i)n[i]=this[i+e]}return n},l.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r},l.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e+--t],o=1;t>0&&(o*=256);)r+=this[e+--t]*o;return r},l.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*t)),r},l.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},l.prototype.readInt8=function(e,t){return t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||R(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(e,t){t||R(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(e,t){return t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return t||R(e,4,this.length),o.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),o.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),o.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||R(e,8,this.length),o.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||D(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i<n&&(o*=256);)this[t+i]=e/o&255;return t+n},l.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||D(this,e,t,n,Math.pow(2,8*n)-1,0);var o=n-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+n},l.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):_(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):_(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):N(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);D(this,e,t,n,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i<n&&(a*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},l.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);D(this,e,t,n,o-1,-o)}var i=n-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):_(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):_(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):N(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,n){return O(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return O(this,e,t,!1,n)},l.prototype.writeDoubleLE=function(e,t,n){return B(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return B(this,e,t,!1,n)},l.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var o,i=r-n;if(this===e&&n<t&&t<r)for(o=i-1;o>=0;--o)e[o+t]=this[o+n];else if(i<1e3||!l.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+i),t);return i},l.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!l.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{var a=l.isBuffer(e)?e:$(new l(e,r).toString()),s=a.length;for(i=0;i<n-t;++i)this[i+t]=a[i%s]}return this};var F=/[^+\/0-9A-Za-z-_]/g;function j(e){return e<16?"0"+e.toString(16):e.toString(16)}function $(e,t){var n;t=t||1/0;for(var r=e.length,o=null,i=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function U(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(F,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function H(e,t,n,r){for(var o=0;o<r&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}}).call(this,n(0))},function(e,t,n){"use strict";t.byteLength=function(e){var t=c(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,r=c(e),a=r[0],s=r[1],l=new i(function(e,t,n){return 3*(t+n)/4-n}(0,a,s)),u=0,d=s>0?a-4:a;for(n=0;n<d;n+=4)t=o[e.charCodeAt(n)]<<18|o[e.charCodeAt(n+1)]<<12|o[e.charCodeAt(n+2)]<<6|o[e.charCodeAt(n+3)],l[u++]=t>>16&255,l[u++]=t>>8&255,l[u++]=255&t;2===s&&(t=o[e.charCodeAt(n)]<<2|o[e.charCodeAt(n+1)]>>4,l[u++]=255&t);1===s&&(t=o[e.charCodeAt(n)]<<10|o[e.charCodeAt(n+1)]<<4|o[e.charCodeAt(n+2)]>>2,l[u++]=t>>8&255,l[u++]=255&t);return l},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=0,s=n-o;a<s;a+=16383)i.push(u(e,a,a+16383>s?s:a+16383));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=a.length;s<l;++s)r[s]=a[s],o[a.charCodeAt(s)]=s;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function u(e,t,n){for(var o,i,a=[],s=t;s<n;s+=3)o=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(e,t){ +/* eslint-disable no-proto */ + + + +var base64 = __webpack_require__(19) +var ieee754 = __webpack_require__(20) +var isArray = __webpack_require__(21) + +exports.Buffer = Buffer +exports.SlowBuffer = SlowBuffer +exports.INSPECT_MAX_BYTES = 50 + +/** + * If `Buffer.TYPED_ARRAY_SUPPORT`: + * === true Use Uint8Array implementation (fastest) + * === false Use Object implementation (most compatible, even IE6) + * + * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, + * Opera 11.6+, iOS 4.2+. + * + * Due to various browser bugs, sometimes the Object implementation will be used even + * when the browser supports typed arrays. + * + * Note: + * + * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances, + * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438. + * + * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function. + * + * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of + * incorrect length in some situations. + + * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they + * get the Object implementation, which is slower but behaves correctly. + */ +Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined + ? global.TYPED_ARRAY_SUPPORT + : typedArraySupport() + +/* + * Export kMaxLength after typed array support is determined. + */ +exports.kMaxLength = kMaxLength() + +function typedArraySupport () { + try { + var arr = new Uint8Array(1) + arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }} + return arr.foo() === 42 && // typed array instances can be augmented + typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray` + arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray` + } catch (e) { + return false + } +} + +function kMaxLength () { + return Buffer.TYPED_ARRAY_SUPPORT + ? 0x7fffffff + : 0x3fffffff +} + +function createBuffer (that, length) { + if (kMaxLength() < length) { + throw new RangeError('Invalid typed array length') + } + if (Buffer.TYPED_ARRAY_SUPPORT) { + // Return an augmented `Uint8Array` instance, for best performance + that = new Uint8Array(length) + that.__proto__ = Buffer.prototype + } else { + // Fallback: Return an object instance of the Buffer class + if (that === null) { + that = new Buffer(length) + } + that.length = length + } + + return that +} + +/** + * The Buffer constructor returns instances of `Uint8Array` that have their + * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of + * `Uint8Array`, so the returned instances will have all the node `Buffer` methods + * and the `Uint8Array` methods. Square bracket notation works as expected -- it + * returns a single octet. + * + * The `Uint8Array` prototype remains unmodified. + */ + +function Buffer (arg, encodingOrOffset, length) { + if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) { + return new Buffer(arg, encodingOrOffset, length) + } + + // Common case. + if (typeof arg === 'number') { + if (typeof encodingOrOffset === 'string') { + throw new Error( + 'If encoding is specified then the first argument must be a string' + ) + } + return allocUnsafe(this, arg) + } + return from(this, arg, encodingOrOffset, length) +} + +Buffer.poolSize = 8192 // not used by this implementation + +// TODO: Legacy, not needed anymore. Remove in next major version. +Buffer._augment = function (arr) { + arr.__proto__ = Buffer.prototype + return arr +} + +function from (that, value, encodingOrOffset, length) { + if (typeof value === 'number') { + throw new TypeError('"value" argument must not be a number') + } + + if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) { + return fromArrayBuffer(that, value, encodingOrOffset, length) + } + + if (typeof value === 'string') { + return fromString(that, value, encodingOrOffset) + } + + return fromObject(that, value) +} + +/** + * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError + * if value is a number. + * Buffer.from(str[, encoding]) + * Buffer.from(array) + * Buffer.from(buffer) + * Buffer.from(arrayBuffer[, byteOffset[, length]]) + **/ +Buffer.from = function (value, encodingOrOffset, length) { + return from(null, value, encodingOrOffset, length) +} + +if (Buffer.TYPED_ARRAY_SUPPORT) { + Buffer.prototype.__proto__ = Uint8Array.prototype + Buffer.__proto__ = Uint8Array + if (typeof Symbol !== 'undefined' && Symbol.species && + Buffer[Symbol.species] === Buffer) { + // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97 + Object.defineProperty(Buffer, Symbol.species, { + value: null, + configurable: true + }) + } +} + +function assertSize (size) { + if (typeof size !== 'number') { + throw new TypeError('"size" argument must be a number') + } else if (size < 0) { + throw new RangeError('"size" argument must not be negative') + } +} + +function alloc (that, size, fill, encoding) { + assertSize(size) + if (size <= 0) { + return createBuffer(that, size) + } + if (fill !== undefined) { + // Only pay attention to encoding if it's a string. This + // prevents accidentally sending in a number that would + // be interpretted as a start offset. + return typeof encoding === 'string' + ? createBuffer(that, size).fill(fill, encoding) + : createBuffer(that, size).fill(fill) + } + return createBuffer(that, size) +} + +/** + * Creates a new filled Buffer instance. + * alloc(size[, fill[, encoding]]) + **/ +Buffer.alloc = function (size, fill, encoding) { + return alloc(null, size, fill, encoding) +} + +function allocUnsafe (that, size) { + assertSize(size) + that = createBuffer(that, size < 0 ? 0 : checked(size) | 0) + if (!Buffer.TYPED_ARRAY_SUPPORT) { + for (var i = 0; i < size; ++i) { + that[i] = 0 + } + } + return that +} + +/** + * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. + * */ +Buffer.allocUnsafe = function (size) { + return allocUnsafe(null, size) +} +/** + * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. + */ +Buffer.allocUnsafeSlow = function (size) { + return allocUnsafe(null, size) +} + +function fromString (that, string, encoding) { + if (typeof encoding !== 'string' || encoding === '') { + encoding = 'utf8' + } + + if (!Buffer.isEncoding(encoding)) { + throw new TypeError('"encoding" must be a valid string encoding') + } + + var length = byteLength(string, encoding) | 0 + that = createBuffer(that, length) + + var actual = that.write(string, encoding) + + if (actual !== length) { + // Writing a hex string, for example, that contains invalid characters will + // cause everything after the first invalid character to be ignored. (e.g. + // 'abxxcd' will be treated as 'ab') + that = that.slice(0, actual) + } + + return that +} + +function fromArrayLike (that, array) { + var length = array.length < 0 ? 0 : checked(array.length) | 0 + that = createBuffer(that, length) + for (var i = 0; i < length; i += 1) { + that[i] = array[i] & 255 + } + return that +} + +function fromArrayBuffer (that, array, byteOffset, length) { + array.byteLength // this throws if `array` is not a valid ArrayBuffer + + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('\'offset\' is out of bounds') + } + + if (array.byteLength < byteOffset + (length || 0)) { + throw new RangeError('\'length\' is out of bounds') + } + + if (byteOffset === undefined && length === undefined) { + array = new Uint8Array(array) + } else if (length === undefined) { + array = new Uint8Array(array, byteOffset) + } else { + array = new Uint8Array(array, byteOffset, length) + } + + if (Buffer.TYPED_ARRAY_SUPPORT) { + // Return an augmented `Uint8Array` instance, for best performance + that = array + that.__proto__ = Buffer.prototype + } else { + // Fallback: Return an object instance of the Buffer class + that = fromArrayLike(that, array) + } + return that +} + +function fromObject (that, obj) { + if (Buffer.isBuffer(obj)) { + var len = checked(obj.length) | 0 + that = createBuffer(that, len) + + if (that.length === 0) { + return that + } + + obj.copy(that, 0, 0, len) + return that + } + + if (obj) { + if ((typeof ArrayBuffer !== 'undefined' && + obj.buffer instanceof ArrayBuffer) || 'length' in obj) { + if (typeof obj.length !== 'number' || isnan(obj.length)) { + return createBuffer(that, 0) + } + return fromArrayLike(that, obj) + } + + if (obj.type === 'Buffer' && isArray(obj.data)) { + return fromArrayLike(that, obj.data) + } + } + + throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.') +} + +function checked (length) { + // Note: cannot use `length < kMaxLength()` here because that fails when + // length is NaN (which is otherwise coerced to zero.) + if (length >= kMaxLength()) { + throw new RangeError('Attempt to allocate Buffer larger than maximum ' + + 'size: 0x' + kMaxLength().toString(16) + ' bytes') + } + return length | 0 +} + +function SlowBuffer (length) { + if (+length != length) { // eslint-disable-line eqeqeq + length = 0 + } + return Buffer.alloc(+length) +} + +Buffer.isBuffer = function isBuffer (b) { + return !!(b != null && b._isBuffer) +} + +Buffer.compare = function compare (a, b) { + if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { + throw new TypeError('Arguments must be Buffers') + } + + if (a === b) return 0 + + var x = a.length + var y = b.length + + for (var i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i] + y = b[i] + break + } + } + + if (x < y) return -1 + if (y < x) return 1 + return 0 +} + +Buffer.isEncoding = function isEncoding (encoding) { + switch (String(encoding).toLowerCase()) { + case 'hex': + case 'utf8': + case 'utf-8': + case 'ascii': + case 'latin1': + case 'binary': + case 'base64': + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return true + default: + return false + } +} + +Buffer.concat = function concat (list, length) { + if (!isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } + + if (list.length === 0) { + return Buffer.alloc(0) + } + + var i + if (length === undefined) { + length = 0 + for (i = 0; i < list.length; ++i) { + length += list[i].length + } + } + + var buffer = Buffer.allocUnsafe(length) + var pos = 0 + for (i = 0; i < list.length; ++i) { + var buf = list[i] + if (!Buffer.isBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } + buf.copy(buffer, pos) + pos += buf.length + } + return buffer +} + +function byteLength (string, encoding) { + if (Buffer.isBuffer(string)) { + return string.length + } + if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' && + (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) { + return string.byteLength + } + if (typeof string !== 'string') { + string = '' + string + } + + var len = string.length + if (len === 0) return 0 + + // Use a for loop to avoid recursion + var loweredCase = false + for (;;) { + switch (encoding) { + case 'ascii': + case 'latin1': + case 'binary': + return len + case 'utf8': + case 'utf-8': + case undefined: + return utf8ToBytes(string).length + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return len * 2 + case 'hex': + return len >>> 1 + case 'base64': + return base64ToBytes(string).length + default: + if (loweredCase) return utf8ToBytes(string).length // assume utf8 + encoding = ('' + encoding).toLowerCase() + loweredCase = true + } + } +} +Buffer.byteLength = byteLength + +function slowToString (encoding, start, end) { + var loweredCase = false + + // No need to verify that "this.length <= MAX_UINT32" since it's a read-only + // property of a typed array. + + // This behaves neither like String nor Uint8Array in that we set start/end + // to their upper/lower bounds if the value passed is out of range. + // undefined is handled specially as per ECMA-262 6th Edition, + // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. + if (start === undefined || start < 0) { + start = 0 + } + // Return early if start > this.length. Done here to prevent potential uint32 + // coercion fail below. + if (start > this.length) { + return '' + } + + if (end === undefined || end > this.length) { + end = this.length + } + + if (end <= 0) { + return '' + } + + // Force coersion to uint32. This will also coerce falsey/NaN values to 0. + end >>>= 0 + start >>>= 0 + + if (end <= start) { + return '' + } + + if (!encoding) encoding = 'utf8' + + while (true) { + switch (encoding) { + case 'hex': + return hexSlice(this, start, end) + + case 'utf8': + case 'utf-8': + return utf8Slice(this, start, end) + + case 'ascii': + return asciiSlice(this, start, end) + + case 'latin1': + case 'binary': + return latin1Slice(this, start, end) + + case 'base64': + return base64Slice(this, start, end) + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return utf16leSlice(this, start, end) + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = (encoding + '').toLowerCase() + loweredCase = true + } + } +} + +// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect +// Buffer instances. +Buffer.prototype._isBuffer = true + +function swap (b, n, m) { + var i = b[n] + b[n] = b[m] + b[m] = i +} + +Buffer.prototype.swap16 = function swap16 () { + var len = this.length + if (len % 2 !== 0) { + throw new RangeError('Buffer size must be a multiple of 16-bits') + } + for (var i = 0; i < len; i += 2) { + swap(this, i, i + 1) + } + return this +} + +Buffer.prototype.swap32 = function swap32 () { + var len = this.length + if (len % 4 !== 0) { + throw new RangeError('Buffer size must be a multiple of 32-bits') + } + for (var i = 0; i < len; i += 4) { + swap(this, i, i + 3) + swap(this, i + 1, i + 2) + } + return this +} + +Buffer.prototype.swap64 = function swap64 () { + var len = this.length + if (len % 8 !== 0) { + throw new RangeError('Buffer size must be a multiple of 64-bits') + } + for (var i = 0; i < len; i += 8) { + swap(this, i, i + 7) + swap(this, i + 1, i + 6) + swap(this, i + 2, i + 5) + swap(this, i + 3, i + 4) + } + return this +} + +Buffer.prototype.toString = function toString () { + var length = this.length | 0 + if (length === 0) return '' + if (arguments.length === 0) return utf8Slice(this, 0, length) + return slowToString.apply(this, arguments) +} + +Buffer.prototype.equals = function equals (b) { + if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') + if (this === b) return true + return Buffer.compare(this, b) === 0 +} + +Buffer.prototype.inspect = function inspect () { + var str = '' + var max = exports.INSPECT_MAX_BYTES + if (this.length > 0) { + str = this.toString('hex', 0, max).match(/.{2}/g).join(' ') + if (this.length > max) str += ' ... ' + } + return '<Buffer ' + str + '>' +} + +Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { + if (!Buffer.isBuffer(target)) { + throw new TypeError('Argument must be a Buffer') + } + + if (start === undefined) { + start = 0 + } + if (end === undefined) { + end = target ? target.length : 0 + } + if (thisStart === undefined) { + thisStart = 0 + } + if (thisEnd === undefined) { + thisEnd = this.length + } + + if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { + throw new RangeError('out of range index') + } + + if (thisStart >= thisEnd && start >= end) { + return 0 + } + if (thisStart >= thisEnd) { + return -1 + } + if (start >= end) { + return 1 + } + + start >>>= 0 + end >>>= 0 + thisStart >>>= 0 + thisEnd >>>= 0 + + if (this === target) return 0 + + var x = thisEnd - thisStart + var y = end - start + var len = Math.min(x, y) + + var thisCopy = this.slice(thisStart, thisEnd) + var targetCopy = target.slice(start, end) + + for (var i = 0; i < len; ++i) { + if (thisCopy[i] !== targetCopy[i]) { + x = thisCopy[i] + y = targetCopy[i] + break + } + } + + if (x < y) return -1 + if (y < x) return 1 + return 0 +} + +// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, +// OR the last index of `val` in `buffer` at offset <= `byteOffset`. +// +// Arguments: +// - buffer - a Buffer to search +// - val - a string, Buffer, or number +// - byteOffset - an index into `buffer`; will be clamped to an int32 +// - encoding - an optional encoding, relevant is val is a string +// - dir - true for indexOf, false for lastIndexOf +function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { + // Empty buffer means no match + if (buffer.length === 0) return -1 + + // Normalize byteOffset + if (typeof byteOffset === 'string') { + encoding = byteOffset + byteOffset = 0 + } else if (byteOffset > 0x7fffffff) { + byteOffset = 0x7fffffff + } else if (byteOffset < -0x80000000) { + byteOffset = -0x80000000 + } + byteOffset = +byteOffset // Coerce to Number. + if (isNaN(byteOffset)) { + // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer + byteOffset = dir ? 0 : (buffer.length - 1) + } + + // Normalize byteOffset: negative offsets start from the end of the buffer + if (byteOffset < 0) byteOffset = buffer.length + byteOffset + if (byteOffset >= buffer.length) { + if (dir) return -1 + else byteOffset = buffer.length - 1 + } else if (byteOffset < 0) { + if (dir) byteOffset = 0 + else return -1 + } + + // Normalize val + if (typeof val === 'string') { + val = Buffer.from(val, encoding) + } + + // Finally, search either indexOf (if dir is true) or lastIndexOf + if (Buffer.isBuffer(val)) { + // Special case: looking for empty string/buffer always fails + if (val.length === 0) { + return -1 + } + return arrayIndexOf(buffer, val, byteOffset, encoding, dir) + } else if (typeof val === 'number') { + val = val & 0xFF // Search for a byte value [0-255] + if (Buffer.TYPED_ARRAY_SUPPORT && + typeof Uint8Array.prototype.indexOf === 'function') { + if (dir) { + return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) + } else { + return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) + } + } + return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir) + } + + throw new TypeError('val must be string, number or Buffer') +} + +function arrayIndexOf (arr, val, byteOffset, encoding, dir) { + var indexSize = 1 + var arrLength = arr.length + var valLength = val.length + + if (encoding !== undefined) { + encoding = String(encoding).toLowerCase() + if (encoding === 'ucs2' || encoding === 'ucs-2' || + encoding === 'utf16le' || encoding === 'utf-16le') { + if (arr.length < 2 || val.length < 2) { + return -1 + } + indexSize = 2 + arrLength /= 2 + valLength /= 2 + byteOffset /= 2 + } + } + + function read (buf, i) { + if (indexSize === 1) { + return buf[i] + } else { + return buf.readUInt16BE(i * indexSize) + } + } + + var i + if (dir) { + var foundIndex = -1 + for (i = byteOffset; i < arrLength; i++) { + if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { + if (foundIndex === -1) foundIndex = i + if (i - foundIndex + 1 === valLength) return foundIndex * indexSize + } else { + if (foundIndex !== -1) i -= i - foundIndex + foundIndex = -1 + } + } + } else { + if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength + for (i = byteOffset; i >= 0; i--) { + var found = true + for (var j = 0; j < valLength; j++) { + if (read(arr, i + j) !== read(val, j)) { + found = false + break + } + } + if (found) return i + } + } + + return -1 +} + +Buffer.prototype.includes = function includes (val, byteOffset, encoding) { + return this.indexOf(val, byteOffset, encoding) !== -1 +} + +Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, true) +} + +Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, false) +} + +function hexWrite (buf, string, offset, length) { + offset = Number(offset) || 0 + var remaining = buf.length - offset + if (!length) { + length = remaining + } else { + length = Number(length) + if (length > remaining) { + length = remaining + } + } + + // must be an even number of digits + var strLen = string.length + if (strLen % 2 !== 0) throw new TypeError('Invalid hex string') + + if (length > strLen / 2) { + length = strLen / 2 + } + for (var i = 0; i < length; ++i) { + var parsed = parseInt(string.substr(i * 2, 2), 16) + if (isNaN(parsed)) return i + buf[offset + i] = parsed + } + return i +} + +function utf8Write (buf, string, offset, length) { + return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) +} + +function asciiWrite (buf, string, offset, length) { + return blitBuffer(asciiToBytes(string), buf, offset, length) +} + +function latin1Write (buf, string, offset, length) { + return asciiWrite(buf, string, offset, length) +} + +function base64Write (buf, string, offset, length) { + return blitBuffer(base64ToBytes(string), buf, offset, length) +} + +function ucs2Write (buf, string, offset, length) { + return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) +} + +Buffer.prototype.write = function write (string, offset, length, encoding) { + // Buffer#write(string) + if (offset === undefined) { + encoding = 'utf8' + length = this.length + offset = 0 + // Buffer#write(string, encoding) + } else if (length === undefined && typeof offset === 'string') { + encoding = offset + length = this.length + offset = 0 + // Buffer#write(string, offset[, length][, encoding]) + } else if (isFinite(offset)) { + offset = offset | 0 + if (isFinite(length)) { + length = length | 0 + if (encoding === undefined) encoding = 'utf8' + } else { + encoding = length + length = undefined + } + // legacy write(string, encoding, offset, length) - remove in v0.13 + } else { + throw new Error( + 'Buffer.write(string, encoding, offset[, length]) is no longer supported' + ) + } + + var remaining = this.length - offset + if (length === undefined || length > remaining) length = remaining + + if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { + throw new RangeError('Attempt to write outside buffer bounds') + } + + if (!encoding) encoding = 'utf8' + + var loweredCase = false + for (;;) { + switch (encoding) { + case 'hex': + return hexWrite(this, string, offset, length) + + case 'utf8': + case 'utf-8': + return utf8Write(this, string, offset, length) + + case 'ascii': + return asciiWrite(this, string, offset, length) + + case 'latin1': + case 'binary': + return latin1Write(this, string, offset, length) + + case 'base64': + // Warning: maxLength not taken into account in base64Write + return base64Write(this, string, offset, length) + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return ucs2Write(this, string, offset, length) + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = ('' + encoding).toLowerCase() + loweredCase = true + } + } +} + +Buffer.prototype.toJSON = function toJSON () { + return { + type: 'Buffer', + data: Array.prototype.slice.call(this._arr || this, 0) + } +} + +function base64Slice (buf, start, end) { + if (start === 0 && end === buf.length) { + return base64.fromByteArray(buf) + } else { + return base64.fromByteArray(buf.slice(start, end)) + } +} + +function utf8Slice (buf, start, end) { + end = Math.min(buf.length, end) + var res = [] + + var i = start + while (i < end) { + var firstByte = buf[i] + var codePoint = null + var bytesPerSequence = (firstByte > 0xEF) ? 4 + : (firstByte > 0xDF) ? 3 + : (firstByte > 0xBF) ? 2 + : 1 + + if (i + bytesPerSequence <= end) { + var secondByte, thirdByte, fourthByte, tempCodePoint + + switch (bytesPerSequence) { + case 1: + if (firstByte < 0x80) { + codePoint = firstByte + } + break + case 2: + secondByte = buf[i + 1] + if ((secondByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F) + if (tempCodePoint > 0x7F) { + codePoint = tempCodePoint + } + } + break + case 3: + secondByte = buf[i + 1] + thirdByte = buf[i + 2] + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F) + if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { + codePoint = tempCodePoint + } + } + break + case 4: + secondByte = buf[i + 1] + thirdByte = buf[i + 2] + fourthByte = buf[i + 3] + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F) + if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { + codePoint = tempCodePoint + } + } + } + } + + if (codePoint === null) { + // we did not generate a valid codePoint so insert a + // replacement char (U+FFFD) and advance only 1 byte + codePoint = 0xFFFD + bytesPerSequence = 1 + } else if (codePoint > 0xFFFF) { + // encode to utf16 (surrogate pair dance) + codePoint -= 0x10000 + res.push(codePoint >>> 10 & 0x3FF | 0xD800) + codePoint = 0xDC00 | codePoint & 0x3FF + } + + res.push(codePoint) + i += bytesPerSequence + } + + return decodeCodePointsArray(res) +} + +// Based on http://stackoverflow.com/a/22747272/680742, the browser with +// the lowest limit is Chrome, with 0x10000 args. +// We go 1 magnitude less, for safety +var MAX_ARGUMENTS_LENGTH = 0x1000 + +function decodeCodePointsArray (codePoints) { + var len = codePoints.length + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints) // avoid extra slice() + } + + // Decode in chunks to avoid "call stack size exceeded". + var res = '' + var i = 0 + while (i < len) { + res += String.fromCharCode.apply( + String, + codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) + ) + } + return res +} + +function asciiSlice (buf, start, end) { + var ret = '' + end = Math.min(buf.length, end) + + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i] & 0x7F) + } + return ret +} + +function latin1Slice (buf, start, end) { + var ret = '' + end = Math.min(buf.length, end) + + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i]) + } + return ret +} + +function hexSlice (buf, start, end) { + var len = buf.length + + if (!start || start < 0) start = 0 + if (!end || end < 0 || end > len) end = len + + var out = '' + for (var i = start; i < end; ++i) { + out += toHex(buf[i]) + } + return out +} + +function utf16leSlice (buf, start, end) { + var bytes = buf.slice(start, end) + var res = '' + for (var i = 0; i < bytes.length; i += 2) { + res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256) + } + return res +} + +Buffer.prototype.slice = function slice (start, end) { + var len = this.length + start = ~~start + end = end === undefined ? len : ~~end + + if (start < 0) { + start += len + if (start < 0) start = 0 + } else if (start > len) { + start = len + } + + if (end < 0) { + end += len + if (end < 0) end = 0 + } else if (end > len) { + end = len + } + + if (end < start) end = start + + var newBuf + if (Buffer.TYPED_ARRAY_SUPPORT) { + newBuf = this.subarray(start, end) + newBuf.__proto__ = Buffer.prototype + } else { + var sliceLen = end - start + newBuf = new Buffer(sliceLen, undefined) + for (var i = 0; i < sliceLen; ++i) { + newBuf[i] = this[i + start] + } + } + + return newBuf +} + +/* + * Need to make sure that buffer isn't trying to write out of bounds. + */ +function checkOffset (offset, ext, length) { + if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') + if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') +} + +Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + var val = this[offset] + var mul = 1 + var i = 0 + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul + } + + return val +} + +Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) { + checkOffset(offset, byteLength, this.length) + } + + var val = this[offset + --byteLength] + var mul = 1 + while (byteLength > 0 && (mul *= 0x100)) { + val += this[offset + --byteLength] * mul + } + + return val +} + +Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { + if (!noAssert) checkOffset(offset, 1, this.length) + return this[offset] +} + +Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + return this[offset] | (this[offset + 1] << 8) +} + +Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + return (this[offset] << 8) | this[offset + 1] +} + +Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + + return ((this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16)) + + (this[offset + 3] * 0x1000000) +} + +Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + + return (this[offset] * 0x1000000) + + ((this[offset + 1] << 16) | + (this[offset + 2] << 8) | + this[offset + 3]) +} + +Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + var val = this[offset] + var mul = 1 + var i = 0 + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul + } + mul *= 0x80 + + if (val >= mul) val -= Math.pow(2, 8 * byteLength) + + return val +} + +Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + var i = byteLength + var mul = 1 + var val = this[offset + --i] + while (i > 0 && (mul *= 0x100)) { + val += this[offset + --i] * mul + } + mul *= 0x80 + + if (val >= mul) val -= Math.pow(2, 8 * byteLength) + + return val +} + +Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { + if (!noAssert) checkOffset(offset, 1, this.length) + if (!(this[offset] & 0x80)) return (this[offset]) + return ((0xff - this[offset] + 1) * -1) +} + +Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + var val = this[offset] | (this[offset + 1] << 8) + return (val & 0x8000) ? val | 0xFFFF0000 : val +} + +Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + var val = this[offset + 1] | (this[offset] << 8) + return (val & 0x8000) ? val | 0xFFFF0000 : val +} + +Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + + return (this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16) | + (this[offset + 3] << 24) +} + +Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + + return (this[offset] << 24) | + (this[offset + 1] << 16) | + (this[offset + 2] << 8) | + (this[offset + 3]) +} + +Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + return ieee754.read(this, offset, true, 23, 4) +} + +Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + return ieee754.read(this, offset, false, 23, 4) +} + +Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 8, this.length) + return ieee754.read(this, offset, true, 52, 8) +} + +Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 8, this.length) + return ieee754.read(this, offset, false, 52, 8) +} + +function checkInt (buf, value, offset, ext, max, min) { + if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') + if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') + if (offset + ext > buf.length) throw new RangeError('Index out of range') +} + +Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1 + checkInt(this, value, offset, byteLength, maxBytes, 0) + } + + var mul = 1 + var i = 0 + this[offset] = value & 0xFF + while (++i < byteLength && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1 + checkInt(this, value, offset, byteLength, maxBytes, 0) + } + + var i = byteLength - 1 + var mul = 1 + this[offset + i] = value & 0xFF + while (--i >= 0 && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0) + if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) + this[offset] = (value & 0xff) + return offset + 1 +} + +function objectWriteUInt16 (buf, value, offset, littleEndian) { + if (value < 0) value = 0xffff + value + 1 + for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) { + buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>> + (littleEndian ? i : 1 - i) * 8 + } +} + +Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + } else { + objectWriteUInt16(this, value, offset, true) + } + return offset + 2 +} + +Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 8) + this[offset + 1] = (value & 0xff) + } else { + objectWriteUInt16(this, value, offset, false) + } + return offset + 2 +} + +function objectWriteUInt32 (buf, value, offset, littleEndian) { + if (value < 0) value = 0xffffffff + value + 1 + for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) { + buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff + } +} + +Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset + 3] = (value >>> 24) + this[offset + 2] = (value >>> 16) + this[offset + 1] = (value >>> 8) + this[offset] = (value & 0xff) + } else { + objectWriteUInt32(this, value, offset, true) + } + return offset + 4 +} + +Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 24) + this[offset + 1] = (value >>> 16) + this[offset + 2] = (value >>> 8) + this[offset + 3] = (value & 0xff) + } else { + objectWriteUInt32(this, value, offset, false) + } + return offset + 4 +} + +Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1) + + checkInt(this, value, offset, byteLength, limit - 1, -limit) + } + + var i = 0 + var mul = 1 + var sub = 0 + this[offset] = value & 0xFF + while (++i < byteLength && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { + sub = 1 + } + this[offset + i] = ((value / mul) >> 0) - sub & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1) + + checkInt(this, value, offset, byteLength, limit - 1, -limit) + } + + var i = byteLength - 1 + var mul = 1 + var sub = 0 + this[offset + i] = value & 0xFF + while (--i >= 0 && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { + sub = 1 + } + this[offset + i] = ((value / mul) >> 0) - sub & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80) + if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) + if (value < 0) value = 0xff + value + 1 + this[offset] = (value & 0xff) + return offset + 1 +} + +Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + } else { + objectWriteUInt16(this, value, offset, true) + } + return offset + 2 +} + +Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 8) + this[offset + 1] = (value & 0xff) + } else { + objectWriteUInt16(this, value, offset, false) + } + return offset + 2 +} + +Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + this[offset + 2] = (value >>> 16) + this[offset + 3] = (value >>> 24) + } else { + objectWriteUInt32(this, value, offset, true) + } + return offset + 4 +} + +Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) + if (value < 0) value = 0xffffffff + value + 1 + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 24) + this[offset + 1] = (value >>> 16) + this[offset + 2] = (value >>> 8) + this[offset + 3] = (value & 0xff) + } else { + objectWriteUInt32(this, value, offset, false) + } + return offset + 4 +} + +function checkIEEE754 (buf, value, offset, ext, max, min) { + if (offset + ext > buf.length) throw new RangeError('Index out of range') + if (offset < 0) throw new RangeError('Index out of range') +} + +function writeFloat (buf, value, offset, littleEndian, noAssert) { + if (!noAssert) { + checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38) + } + ieee754.write(buf, value, offset, littleEndian, 23, 4) + return offset + 4 +} + +Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert) +} + +function writeDouble (buf, value, offset, littleEndian, noAssert) { + if (!noAssert) { + checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308) + } + ieee754.write(buf, value, offset, littleEndian, 52, 8) + return offset + 8 +} + +Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert) +} + +// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) +Buffer.prototype.copy = function copy (target, targetStart, start, end) { + if (!start) start = 0 + if (!end && end !== 0) end = this.length + if (targetStart >= target.length) targetStart = target.length + if (!targetStart) targetStart = 0 + if (end > 0 && end < start) end = start + + // Copy 0 bytes; we're done + if (end === start) return 0 + if (target.length === 0 || this.length === 0) return 0 + + // Fatal error conditions + if (targetStart < 0) { + throw new RangeError('targetStart out of bounds') + } + if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds') + if (end < 0) throw new RangeError('sourceEnd out of bounds') + + // Are we oob? + if (end > this.length) end = this.length + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start + } + + var len = end - start + var i + + if (this === target && start < targetStart && targetStart < end) { + // descending copy from end + for (i = len - 1; i >= 0; --i) { + target[i + targetStart] = this[i + start] + } + } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) { + // ascending copy from start + for (i = 0; i < len; ++i) { + target[i + targetStart] = this[i + start] + } + } else { + Uint8Array.prototype.set.call( + target, + this.subarray(start, start + len), + targetStart + ) + } + + return len +} + +// Usage: +// buffer.fill(number[, offset[, end]]) +// buffer.fill(buffer[, offset[, end]]) +// buffer.fill(string[, offset[, end]][, encoding]) +Buffer.prototype.fill = function fill (val, start, end, encoding) { + // Handle string cases: + if (typeof val === 'string') { + if (typeof start === 'string') { + encoding = start + start = 0 + end = this.length + } else if (typeof end === 'string') { + encoding = end + end = this.length + } + if (val.length === 1) { + var code = val.charCodeAt(0) + if (code < 256) { + val = code + } + } + if (encoding !== undefined && typeof encoding !== 'string') { + throw new TypeError('encoding must be a string') + } + if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding) + } + } else if (typeof val === 'number') { + val = val & 255 + } + + // Invalid ranges are not set to a default, so can range check early. + if (start < 0 || this.length < start || this.length < end) { + throw new RangeError('Out of range index') + } + + if (end <= start) { + return this + } + + start = start >>> 0 + end = end === undefined ? this.length : end >>> 0 + + if (!val) val = 0 + + var i + if (typeof val === 'number') { + for (i = start; i < end; ++i) { + this[i] = val + } + } else { + var bytes = Buffer.isBuffer(val) + ? val + : utf8ToBytes(new Buffer(val, encoding).toString()) + var len = bytes.length + for (i = 0; i < end - start; ++i) { + this[i + start] = bytes[i % len] + } + } + + return this +} + +// HELPER FUNCTIONS +// ================ + +var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g + +function base64clean (str) { + // Node strips out invalid characters like \n and \t from the string, base64-js does not + str = stringtrim(str).replace(INVALID_BASE64_RE, '') + // Node converts strings with length < 2 to '' + if (str.length < 2) return '' + // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not + while (str.length % 4 !== 0) { + str = str + '=' + } + return str +} + +function stringtrim (str) { + if (str.trim) return str.trim() + return str.replace(/^\s+|\s+$/g, '') +} + +function toHex (n) { + if (n < 16) return '0' + n.toString(16) + return n.toString(16) +} + +function utf8ToBytes (string, units) { + units = units || Infinity + var codePoint + var length = string.length + var leadSurrogate = null + var bytes = [] + + for (var i = 0; i < length; ++i) { + codePoint = string.charCodeAt(i) + + // is surrogate component + if (codePoint > 0xD7FF && codePoint < 0xE000) { + // last char was a lead + if (!leadSurrogate) { + // no lead yet + if (codePoint > 0xDBFF) { + // unexpected trail + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + continue + } else if (i + 1 === length) { + // unpaired lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + continue + } + + // valid lead + leadSurrogate = codePoint + + continue + } + + // 2 leads in a row + if (codePoint < 0xDC00) { + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + leadSurrogate = codePoint + continue + } + + // valid surrogate pair + codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000 + } else if (leadSurrogate) { + // valid bmp char, but last char was a lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + } + + leadSurrogate = null + + // encode utf8 + if (codePoint < 0x80) { + if ((units -= 1) < 0) break + bytes.push(codePoint) + } else if (codePoint < 0x800) { + if ((units -= 2) < 0) break + bytes.push( + codePoint >> 0x6 | 0xC0, + codePoint & 0x3F | 0x80 + ) + } else if (codePoint < 0x10000) { + if ((units -= 3) < 0) break + bytes.push( + codePoint >> 0xC | 0xE0, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ) + } else if (codePoint < 0x110000) { + if ((units -= 4) < 0) break + bytes.push( + codePoint >> 0x12 | 0xF0, + codePoint >> 0xC & 0x3F | 0x80, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ) + } else { + throw new Error('Invalid code point') + } + } + + return bytes +} + +function asciiToBytes (str) { + var byteArray = [] + for (var i = 0; i < str.length; ++i) { + // Node's code seems to be doing this and not & 0x7F.. + byteArray.push(str.charCodeAt(i) & 0xFF) + } + return byteArray +} + +function utf16leToBytes (str, units) { + var c, hi, lo + var byteArray = [] + for (var i = 0; i < str.length; ++i) { + if ((units -= 2) < 0) break + + c = str.charCodeAt(i) + hi = c >> 8 + lo = c % 256 + byteArray.push(lo) + byteArray.push(hi) + } + + return byteArray +} + +function base64ToBytes (str) { + return base64.toByteArray(base64clean(str)) +} + +function blitBuffer (src, dst, offset, length) { + for (var i = 0; i < length; ++i) { + if ((i + offset >= dst.length) || (i >= src.length)) break + dst[i + offset] = src[i] + } + return i +} + +function isnan (val) { + return val !== val // eslint-disable-line no-self-compare +} + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0))) + +/***/ }), +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.byteLength = byteLength +exports.toByteArray = toByteArray +exports.fromByteArray = fromByteArray + +var lookup = [] +var revLookup = [] +var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array + +var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' +for (var i = 0, len = code.length; i < len; ++i) { + lookup[i] = code[i] + revLookup[code.charCodeAt(i)] = i +} + +// Support decoding URL-safe base64 strings, as Node.js does. +// See: https://en.wikipedia.org/wiki/Base64#URL_applications +revLookup['-'.charCodeAt(0)] = 62 +revLookup['_'.charCodeAt(0)] = 63 + +function getLens (b64) { + var len = b64.length + + if (len % 4 > 0) { + throw new Error('Invalid string. Length must be a multiple of 4') + } + + // Trim off extra bytes after placeholder bytes are found + // See: https://github.com/beatgammit/base64-js/issues/42 + var validLen = b64.indexOf('=') + if (validLen === -1) validLen = len + + var placeHoldersLen = validLen === len + ? 0 + : 4 - (validLen % 4) + + return [validLen, placeHoldersLen] +} + +// base64 is 4/3 + up to two characters of the original data +function byteLength (b64) { + var lens = getLens(b64) + var validLen = lens[0] + var placeHoldersLen = lens[1] + return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen +} + +function _byteLength (b64, validLen, placeHoldersLen) { + return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen +} + +function toByteArray (b64) { + var tmp + var lens = getLens(b64) + var validLen = lens[0] + var placeHoldersLen = lens[1] + + var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)) + + var curByte = 0 + + // if there are placeholders, only get up to the last complete 4 chars + var len = placeHoldersLen > 0 + ? validLen - 4 + : validLen + + var i + for (i = 0; i < len; i += 4) { + tmp = + (revLookup[b64.charCodeAt(i)] << 18) | + (revLookup[b64.charCodeAt(i + 1)] << 12) | + (revLookup[b64.charCodeAt(i + 2)] << 6) | + revLookup[b64.charCodeAt(i + 3)] + arr[curByte++] = (tmp >> 16) & 0xFF + arr[curByte++] = (tmp >> 8) & 0xFF + arr[curByte++] = tmp & 0xFF + } + + if (placeHoldersLen === 2) { + tmp = + (revLookup[b64.charCodeAt(i)] << 2) | + (revLookup[b64.charCodeAt(i + 1)] >> 4) + arr[curByte++] = tmp & 0xFF + } + + if (placeHoldersLen === 1) { + tmp = + (revLookup[b64.charCodeAt(i)] << 10) | + (revLookup[b64.charCodeAt(i + 1)] << 4) | + (revLookup[b64.charCodeAt(i + 2)] >> 2) + arr[curByte++] = (tmp >> 8) & 0xFF + arr[curByte++] = tmp & 0xFF + } + + return arr +} + +function tripletToBase64 (num) { + return lookup[num >> 18 & 0x3F] + + lookup[num >> 12 & 0x3F] + + lookup[num >> 6 & 0x3F] + + lookup[num & 0x3F] +} + +function encodeChunk (uint8, start, end) { + var tmp + var output = [] + for (var i = start; i < end; i += 3) { + tmp = + ((uint8[i] << 16) & 0xFF0000) + + ((uint8[i + 1] << 8) & 0xFF00) + + (uint8[i + 2] & 0xFF) + output.push(tripletToBase64(tmp)) + } + return output.join('') +} + +function fromByteArray (uint8) { + var tmp + var len = uint8.length + var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes + var parts = [] + var maxChunkLength = 16383 // must be multiple of 3 + + // go through the array every three bytes, we'll deal with trailing stuff later + for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { + parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength))) + } + + // pad the end with zeros, but make sure to not forget the extra bytes + if (extraBytes === 1) { + tmp = uint8[len - 1] + parts.push( + lookup[tmp >> 2] + + lookup[(tmp << 4) & 0x3F] + + '==' + ) + } else if (extraBytes === 2) { + tmp = (uint8[len - 2] << 8) + uint8[len - 1] + parts.push( + lookup[tmp >> 10] + + lookup[(tmp >> 4) & 0x3F] + + lookup[(tmp << 2) & 0x3F] + + '=' + ) + } + + return parts.join('') +} + + +/***/ }), +/* 20 */ +/***/ (function(module, exports) { + /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ -t.read=function(e,t,n,r,o){var i,a,s=8*o-r-1,l=(1<<s)-1,c=l>>1,u=-7,d=n?o-1:0,p=n?-1:1,h=e[t+d];for(d+=p,i=h&(1<<-u)-1,h>>=-u,u+=s;u>0;i=256*i+e[t+d],d+=p,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=r;u>0;a=256*a+e[t+d],d+=p,u-=8);if(0===i)i=1-c;else{if(i===l)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),i-=c}return(h?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,s,l,c=8*i-o-1,u=(1<<c)-1,d=u>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,f=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+d>=1?p/l:p*Math.pow(2,1-d))*l>=2&&(a++,l/=2),a+d>=u?(s=0,a=u):a+d>=1?(s=(t*l-1)*Math.pow(2,o),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,o),a=0));o>=8;e[n+h]=255&s,h+=f,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;e[n+h]=255&a,h+=f,a/=256,c-=8);e[n+h-f]|=128*g}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t){e.exports=({protocol:e,hostname:t,path:n},r)=>new Promise((o,i)=>{let a=new XMLHttpRequest;a.open("POST",`${e}//${t}${n}`,!0),a.setRequestHeader("Content-Type","application/json;charset=UTF-8"),a.setRequestHeader("Access-Control-Allow-Origin","*"),a.setRequestHeader("Accept","*/*"),a.onreadystatechange=()=>{4==a.readyState&&(200==a.status?o(JSON.parse(a.responseText)):i(a.status))},a.send(JSON.stringify(r))})},function(e,t){t.endianness=function(){return"LE"},t.hostname=function(){return"undefined"!=typeof location?location.hostname:""},t.loadavg=function(){return[]},t.uptime=function(){return 0},t.freemem=function(){return Number.MAX_VALUE},t.totalmem=function(){return Number.MAX_VALUE},t.cpus=function(){return[]},t.type=function(){return"Browser"},t.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},t.networkInterfaces=t.getNetworkInterfaces=function(){return{}},t.arch=function(){return"javascript"},t.platform=function(){return"browser"},t.tmpdir=t.tmpDir=function(){return"/tmp"},t.EOL="\n",t.homedir=function(){return"/"}},function(e,t,n){(function(r){var o,i,a,s;s=void 0!==r?r:this.window||this.global,i=[],o=function(e){"use strict";var t,r,o,i=n(25),a={},s={},l=n(26),c=n(27),u=n(28),d=!!(e&&e.document&&e.document.querySelector&&e.addEventListener);if("undefined"!=typeof window||d){var p=Object.prototype.hasOwnProperty;return s.destroy=function(){if(!a.skipRendering)try{document.querySelector(a.tocSelector).innerHTML=""}catch(e){console.warn("Element not found: "+a.tocSelector)}a.scrollContainer&&document.querySelector(a.scrollContainer)?(document.querySelector(a.scrollContainer).removeEventListener("scroll",this._scrollListener,!1),document.querySelector(a.scrollContainer).removeEventListener("resize",this._scrollListener,!1),t&&document.querySelector(a.scrollContainer).removeEventListener("click",this._clickListener,!1)):(document.removeEventListener("scroll",this._scrollListener,!1),document.removeEventListener("resize",this._scrollListener,!1),t&&document.removeEventListener("click",this._clickListener,!1))},s.init=function(e){if(d&&(a=function(){for(var e={},t=0;t<arguments.length;t++){var n=arguments[t];for(var r in n)p.call(n,r)&&(e[r]=n[r])}return e}(i,e||{}),this.options=a,this.state={},a.scrollSmooth&&(a.duration=a.scrollSmoothDuration,a.offset=a.scrollSmoothOffset,s.scrollSmooth=n(29).initSmoothScrolling(a)),t=l(a),r=c(a),this._buildHtml=t,this._parseContent=r,s.destroy(),null!==(o=r.selectHeadings(a.contentSelector,a.headingSelector)))){var f=r.nestHeadingsArray(o).nest;a.skipRendering||t.render(a.tocSelector,f),this._scrollListener=h((function(e){t.updateToc(o),!a.disableTocScrollSync&&u(a);var n=e&&e.target&&e.target.scrollingElement&&0===e.target.scrollingElement.scrollTop;(e&&(0===e.eventPhase||null===e.currentTarget)||n)&&(t.updateToc(o),a.scrollEndCallback&&a.scrollEndCallback(e))}),a.throttleTimeout),this._scrollListener(),a.scrollContainer&&document.querySelector(a.scrollContainer)?(document.querySelector(a.scrollContainer).addEventListener("scroll",this._scrollListener,!1),document.querySelector(a.scrollContainer).addEventListener("resize",this._scrollListener,!1)):(document.addEventListener("scroll",this._scrollListener,!1),document.addEventListener("resize",this._scrollListener,!1));var g=null;return this._clickListener=h((function(e){a.scrollSmooth&&t.disableTocAnimation(e),t.updateToc(o),g&&clearTimeout(g),g=setTimeout((function(){t.enableTocAnimation()}),a.scrollSmoothDuration)}),a.throttleTimeout),a.scrollContainer&&document.querySelector(a.scrollContainer)?document.querySelector(a.scrollContainer).addEventListener("click",this._clickListener,!1):document.addEventListener("click",this._clickListener,!1),this}},s.refresh=function(e){s.destroy(),s.init(e||this.options)},e.tocbot=s,s}function h(e,t,n){var r,o;return t||(t=250),function(){var i=n||this,a=+new Date,s=arguments;r&&a<r+t?(clearTimeout(o),o=setTimeout((function(){r=a,e.apply(i,s)}),t)):(r=a,e.apply(i,s))}}}(s),void 0===(a="function"==typeof o?o.apply(t,i):o)||(e.exports=a)}).call(this,n(0))},function(e,t){e.exports={tocSelector:".js-toc",contentSelector:".js-toc-content",headingSelector:"h1, h2, h3",ignoreSelector:".js-toc-ignore",hasInnerContainers:!1,linkClass:"toc-link",extraLinkClasses:"",activeLinkClass:"is-active-link",listClass:"toc-list",extraListClasses:"",isCollapsedClass:"is-collapsed",collapsibleClass:"is-collapsible",listItemClass:"toc-list-item",activeListItemClass:"is-active-li",collapseDepth:0,scrollSmooth:!0,scrollSmoothDuration:420,scrollSmoothOffset:0,scrollEndCallback:function(e){},headingsOffset:1,throttleTimeout:50,positionFixedSelector:null,positionFixedClass:"is-position-fixed",fixedSidebarOffset:"auto",includeHtml:!1,onClick:function(e){},orderedList:!0,scrollContainer:null,skipRendering:!1,headingLabelCallback:!1,ignoreHiddenElements:!1,headingObjectCallback:null,basePath:"",disableTocScrollSync:!1}},function(e,t){e.exports=function(e){var t=[].forEach,n=[].some,r=document.body,o=!0;function i(n,r){var o=r.appendChild(function(n){var r=document.createElement("li"),o=document.createElement("a");e.listItemClass&&r.setAttribute("class",e.listItemClass);e.onClick&&(o.onclick=e.onClick);e.includeHtml&&n.childNodes.length?t.call(n.childNodes,(function(e){o.appendChild(e.cloneNode(!0))})):o.textContent=n.textContent;return o.setAttribute("href",e.basePath+"#"+n.id),o.setAttribute("class",e.linkClass+" node-name--"+n.nodeName+" "+e.extraLinkClasses),r.appendChild(o),r}(n));if(n.children.length){var s=a(n.isCollapsed);n.children.forEach((function(e){i(e,s)})),o.appendChild(s)}}function a(t){var n=e.orderedList?"ol":"ul",r=document.createElement(n),o=e.listClass+" "+e.extraListClasses;return t&&(o+=" "+e.collapsibleClass,o+=" "+e.isCollapsedClass),r.setAttribute("class",o),r}return{enableTocAnimation:function(){o=!0},disableTocAnimation:function(t){var n=t.target||t.srcElement;"string"==typeof n.className&&-1!==n.className.indexOf(e.linkClass)&&(o=!1)},render:function(e,t){var n=a(!1);t.forEach((function(e){i(e,n)}));var r=document.querySelector(e);if(null!==r)return r.firstChild&&r.removeChild(r.firstChild),0===t.length?r:r.appendChild(n)},updateToc:function(i){var a;a=e.scrollContainer&&document.querySelector(e.scrollContainer)?document.querySelector(e.scrollContainer).scrollTop:document.documentElement.scrollTop||r.scrollTop,e.positionFixedSelector&&function(){var t;t=e.scrollContainer&&document.querySelector(e.scrollContainer)?document.querySelector(e.scrollContainer).scrollTop:document.documentElement.scrollTop||r.scrollTop;var n=document.querySelector(e.positionFixedSelector);"auto"===e.fixedSidebarOffset&&(e.fixedSidebarOffset=document.querySelector(e.tocSelector).offsetTop),t>e.fixedSidebarOffset?-1===n.className.indexOf(e.positionFixedClass)&&(n.className+=" "+e.positionFixedClass):n.className=n.className.split(" "+e.positionFixedClass).join("")}();var s,l=i;if(o&&null!==document.querySelector(e.tocSelector)&&l.length>0){n.call(l,(function(t,n){return function t(n){var r=0;return n!==document.querySelector(e.contentSelector&&null!=n)&&(r=n.offsetTop,e.hasInnerContainers&&(r+=t(n.offsetParent))),r}(t)>a+e.headingsOffset+10?(s=l[n],!0):n===l.length-1?(s=l[l.length-1],!0):void 0}));var c=document.querySelector(e.tocSelector).querySelectorAll("."+e.linkClass);t.call(c,(function(t){t.className=t.className.split(" "+e.activeLinkClass).join("")}));var u=document.querySelector(e.tocSelector).querySelectorAll("."+e.listItemClass);t.call(u,(function(t){t.className=t.className.split(" "+e.activeListItemClass).join("")}));var d=document.querySelector(e.tocSelector).querySelector("."+e.linkClass+".node-name--"+s.nodeName+'[href="'+e.basePath+"#"+s.id.replace(/([ #;&,.+*~':"!^$[\]()=>|/@])/g,"\\$1")+'"]');-1===d.className.indexOf(e.activeLinkClass)&&(d.className+=" "+e.activeLinkClass);var p=d.parentNode;p&&-1===p.className.indexOf(e.activeListItemClass)&&(p.className+=" "+e.activeListItemClass);var h=document.querySelector(e.tocSelector).querySelectorAll("."+e.listClass+"."+e.collapsibleClass);t.call(h,(function(t){-1===t.className.indexOf(e.isCollapsedClass)&&(t.className+=" "+e.isCollapsedClass)})),d.nextSibling&&-1!==d.nextSibling.className.indexOf(e.isCollapsedClass)&&(d.nextSibling.className=d.nextSibling.className.split(" "+e.isCollapsedClass).join("")),function t(n){if(-1!==n.className.indexOf(e.collapsibleClass)&&-1!==n.className.indexOf(e.isCollapsedClass))return n.className=n.className.split(" "+e.isCollapsedClass).join(""),t(n.parentNode.parentNode);return n}(d.parentNode.parentNode)}}}}},function(e,t){e.exports=function(e){var t=[].reduce;function n(e){return e[e.length-1]}function r(e){return+e.nodeName.split("H").join("")}function o(t){if(!(t instanceof window.HTMLElement))return t;if(e.ignoreHiddenElements&&(!t.offsetHeight||!t.offsetParent))return null;var n={id:t.id,children:[],nodeName:t.nodeName,headingLevel:r(t),textContent:e.headingLabelCallback?String(e.headingLabelCallback(t.textContent)):t.textContent.trim()};return e.includeHtml&&(n.childNodes=t.childNodes),e.headingObjectCallback?e.headingObjectCallback(n,t):n}return{nestHeadingsArray:function(r){return t.call(r,(function(t,r){var i=o(r);return i&&function(t,r){for(var i=o(t),a=i.headingLevel,s=r,l=n(s),c=a-(l?l.headingLevel:0);c>0;)(l=n(s))&&void 0!==l.children&&(s=l.children),c--;a>=e.collapseDepth&&(i.isCollapsed=!0),s.push(i)}(i,t.nest),t}),{nest:[]})},selectHeadings:function(t,n){var r=n;e.ignoreSelector&&(r=n.split(",").map((function(t){return t.trim()+":not("+e.ignoreSelector+")"})));try{return document.querySelector(t).querySelectorAll(r)}catch(e){return console.warn("Element not found: "+t),null}}}}},function(e,t){e.exports=function(e){var t=document.querySelector(e.tocSelector);if(t&&t.scrollHeight>t.clientHeight){var n=t.querySelector("."+e.activeListItemClass);n&&(t.scrollTop=n.offsetTop)}}},function(e,t){t.initSmoothScrolling=function(e){document.documentElement.style;var t=e.duration,n=e.offset,r=location.hash?o(location.href):location.href;function o(e){return e.slice(0,e.lastIndexOf("#"))}document.body.addEventListener("click",(function(i){var a;"a"!==(a=i.target).tagName.toLowerCase()||!(a.hash.length>0||"#"===a.href.charAt(a.href.length-1))||o(a.href)!==r&&o(a.href)+"#"!==r||i.target.className.indexOf("no-smooth-scroll")>-1||"#"===i.target.href.charAt(i.target.href.length-2)&&"!"===i.target.href.charAt(i.target.href.length-1)||-1===i.target.className.indexOf(e.linkClass)||function(e,t){var n,r,o=window.pageYOffset,i={duration:t.duration,offset:t.offset||0,callback:t.callback,easing:t.easing||function(e,t,n,r){return(e/=r/2)<1?n/2*e*e+t:(e--,-n/2*(e*(e-2)-1)+t)}},a=document.querySelector('[id="'+decodeURI(e).split("#").join("")+'"]'),s="string"==typeof e?i.offset+(e?a&&a.getBoundingClientRect().top||0:-(document.documentElement.scrollTop||document.body.scrollTop)):e,l="function"==typeof i.duration?i.duration(s):i.duration;function c(e){r=e-n,window.scrollTo(0,i.easing(r,o,s,l)),r<l?requestAnimationFrame(c):(window.scrollTo(0,o+s),"function"==typeof i.callback&&i.callback())}requestAnimationFrame((function(e){n=e,c(e)}))}(i.target.hash,{duration:t,offset:n,callback:function(){var e,t;e=i.target.hash,(t=document.getElementById(e.substring(1)))&&(/^(?:a|select|input|button|textarea)$/i.test(t.tagName)||(t.tabIndex=-1),t.focus())}})}),!1)}},function(e,t){var n=document.documentElement.lang;$((function(){$(".result").each((function(e,t){var r,o=$(t),i=o.prev().find(".title");r="en"==n?$('<div class="view-result j1-viewer"><span class="btn-viewer j1-tooltip" data-toggle="tooltip" data-placement="left" title="toggle results" data-original-title="toggle results">View</span></div>'):"de"==n?$('<div class="view-result j1-viewer"><span class="btn-viewer j1-tooltip" data-toggle="tooltip" data-placement="left" title="Anzeige umschalten" data-original-title="toggle results">Anzeige</span></div>'):$('<div class="view-result j1-viewer"><span class="btn-viewer j1-tooltip" data-toggle="tooltip" data-placement="left" title="toggle results" data-original-title="toggle results">View</span></div>'),i.append(r),r.on("click",(function(e){e.preventDefault(),function(e){window.clearTimeout(void 0),e.prev().toggleClass("stacked"),e.toggle()}(o)}))}))}))}]); -//# sourceMappingURL=template.js.map +exports.read = function (buffer, offset, isLE, mLen, nBytes) { + var e, m + var eLen = (nBytes * 8) - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var nBits = -7 + var i = isLE ? (nBytes - 1) : 0 + var d = isLE ? -1 : 1 + var s = buffer[offset + i] + + i += d + + e = s & ((1 << (-nBits)) - 1) + s >>= (-nBits) + nBits += eLen + for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {} + + m = e & ((1 << (-nBits)) - 1) + e >>= (-nBits) + nBits += mLen + for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {} + + if (e === 0) { + e = 1 - eBias + } else if (e === eMax) { + return m ? NaN : ((s ? -1 : 1) * Infinity) + } else { + m = m + Math.pow(2, mLen) + e = e - eBias + } + return (s ? -1 : 1) * m * Math.pow(2, e - mLen) +} + +exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c + var eLen = (nBytes * 8) - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) + var i = isLE ? 0 : (nBytes - 1) + var d = isLE ? 1 : -1 + var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0 + + value = Math.abs(value) + + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0 + e = eMax + } else { + e = Math.floor(Math.log(value) / Math.LN2) + if (value * (c = Math.pow(2, -e)) < 1) { + e-- + c *= 2 + } + if (e + eBias >= 1) { + value += rt / c + } else { + value += rt * Math.pow(2, 1 - eBias) + } + if (value * c >= 2) { + e++ + c /= 2 + } + + if (e + eBias >= eMax) { + m = 0 + e = eMax + } else if (e + eBias >= 1) { + m = ((value * c) - 1) * Math.pow(2, mLen) + e = e + eBias + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) + e = 0 + } + } + + for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} + + e = (e << mLen) | m + eLen += mLen + for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} + + buffer[offset + i - d] |= s * 128 +} + + +/***/ }), +/* 21 */ +/***/ (function(module, exports) { + +var toString = {}.toString; + +module.exports = Array.isArray || function (arr) { + return toString.call(arr) == '[object Array]'; +}; + + +/***/ }), +/* 22 */ +/***/ (function(module, exports) { + +module.exports = ({ + protocol, + hostname, + path +}, postBody) => { + return new Promise((resolve, reject) => { + let xhr = new XMLHttpRequest(); + xhr.open('POST', `${protocol}//${hostname}${path}`, true); + xhr.setRequestHeader('Content-Type', 'application/json;charset=UTF-8'); + xhr.setRequestHeader('Access-Control-Allow-Origin', '*'); + xhr.setRequestHeader("Accept", "*/*"); + + xhr.onreadystatechange = () => { + if (xhr.readyState == 4) { + xhr.status == 200 ? resolve(JSON.parse(xhr.responseText)) : reject(xhr.status); + } + }; + + xhr.send(JSON.stringify(postBody)); + }); +}; + +/***/ }), +/* 23 */ +/***/ (function(module, exports) { + +exports.endianness = function () { return 'LE' }; + +exports.hostname = function () { + if (typeof location !== 'undefined') { + return location.hostname + } + else return ''; +}; + +exports.loadavg = function () { return [] }; + +exports.uptime = function () { return 0 }; + +exports.freemem = function () { + return Number.MAX_VALUE; +}; + +exports.totalmem = function () { + return Number.MAX_VALUE; +}; + +exports.cpus = function () { return [] }; + +exports.type = function () { return 'Browser' }; + +exports.release = function () { + if (typeof navigator !== 'undefined') { + return navigator.appVersion; + } + return ''; +}; + +exports.networkInterfaces += exports.getNetworkInterfaces += function () { return {} }; + +exports.arch = function () { return 'javascript' }; + +exports.platform = function () { return 'browser' }; + +exports.tmpdir = exports.tmpDir = function () { + return '/tmp'; +}; + +exports.EOL = '\n'; + +exports.homedir = function () { + return '/' +}; + + +/***/ }), +/* 24 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(global) {var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +/* + # ----------------------------------------------------------------------------- + # ~/js/tocbot/tocbot.js + # Tocbot v4.12.0 implementation for J1 template + # + # Product/Info: + # https://jekyll.one + # https://tscanlin.github.io/tocbot + # https://github.com/tscanlin/tocbot + # + # Copyright (C) 2021 Juergen Adams + # Copyright (C) 2016 Tim Scanlin + # + # J1 Template is licensed under MIT License. + # See: https://github.com/jekyll-one-org/J1 Template/blob/master/LICENSE + # Tocbot is licensed under the MIT License. + # For details, https://github.com/tscanlin/tocbot/blob/master/LICENSE + # ----------------------------------------------------------------------------- + # rules: + # "eslint:tocbot": "eslint --ignore-path .eslintignore src/tocbot/js" + # ----------------------------------------------------------------------------- +*/ +// ----------------------------------------------------------------------------- +// ESLint shimming +// ----------------------------------------------------------------------------- + +/* eslint indent: "off" */ + +/* eslint no-undef: "off" */ + +/* eslint semi: "off" */ +// ----------------------------------------------------------------------------- + +/** + * Tocbot + * Tocbot creates a toble of contents based on HTML headings on a page, + * this allows users to easily jump to different sections of the document. + * Tocbot was inspired by tocify (http://gregfranko.com/jquery.tocify.js/). + * The main differences are that it works natively without any need for jquery or jquery UI). + * + * @author Tim Scanlin + */ + +/* globals define */ +(function (root, factory) { + if (true) { + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory(root)), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} +})(typeof global !== 'undefined' ? global : this.window || this.global, function (root) { + 'use strict'; // Default options. + + var defaultOptions = __webpack_require__(25); // Object to store current options. + + + var options = {}; // Object for public APIs. + + var tocbot = {}; + + var BuildHtml = __webpack_require__(26); + + var ParseContent = __webpack_require__(27); + + var updateTocScroll = __webpack_require__(28); // Keep these variables at top scope once options are passed in. + + + var buildHtml; + var parseContent; // Just return if its not a browser. + + var supports = !!root && !!root.document && !!root.document.querySelector && !!root.addEventListener; // Feature test + + if (typeof window === 'undefined' && !supports) { + return; + } + + var headingsArray; // From: https://github.com/Raynos/xtend + + var hasOwnProperty = Object.prototype.hasOwnProperty; + + function extend() { + var target = {}; + + for (var i = 0; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; + } // From: https://remysharp.com/2010/07/21/throttling-function-calls + + + function throttle(fn, threshold, scope) { + threshold || (threshold = 250); + var last; + var deferTimer; + return function () { + var context = scope || this; + var now = +new Date(); + var args = arguments; + + if (last && now < last + threshold) { + // hold on to it + clearTimeout(deferTimer); + deferTimer = setTimeout(function () { + last = now; + fn.apply(context, args); + }, threshold); + } else { + last = now; + fn.apply(context, args); + } + }; + } + /** + * Destroy tocbot. + */ + + + tocbot.destroy = function () { + if (!options.skipRendering) { + // Clear HTML. + try { + document.querySelector(options.tocSelector).innerHTML = ''; + } catch (e) { + console.warn('Element not found: ' + options.tocSelector); // eslint-disable-line + } + } // Remove event listeners. + + + if (options.scrollContainer && document.querySelector(options.scrollContainer)) { + document.querySelector(options.scrollContainer).removeEventListener('scroll', this._scrollListener, false); + document.querySelector(options.scrollContainer).removeEventListener('resize', this._scrollListener, false); + + if (buildHtml) { + document.querySelector(options.scrollContainer).removeEventListener('click', this._clickListener, false); + } + } else { + document.removeEventListener('scroll', this._scrollListener, false); + document.removeEventListener('resize', this._scrollListener, false); + + if (buildHtml) { + document.removeEventListener('click', this._clickListener, false); + } + } + }; + /** + * Initialize tocbot. + * @param {object} customOptions + */ + + + tocbot.init = function (customOptions) { + // feature test + if (!supports) { + return; + } // Merge defaults with user options. + // Set to options variable at the top. + + + options = extend(defaultOptions, customOptions || {}); + this.options = options; + this.state = {}; // Init smooth scroll if enabled (default). + + if (options.scrollSmooth) { + options.duration = options.scrollSmoothDuration; + options.offset = options.scrollSmoothOffset; + tocbot.scrollSmooth = __webpack_require__(29).initSmoothScrolling(options); + } // Pass options to these modules. + + + buildHtml = BuildHtml(options); + parseContent = ParseContent(options); // For testing purposes. + + this._buildHtml = buildHtml; + this._parseContent = parseContent; // Destroy it if it exists first. + + tocbot.destroy(); // Get headings array. + + headingsArray = parseContent.selectHeadings(options.contentSelector, options.headingSelector); // Return if no headings are found. + + if (headingsArray === null) { + return; + } // Build nested headings array. + + + var nestedHeadingsObj = parseContent.nestHeadingsArray(headingsArray); + var nestedHeadings = nestedHeadingsObj.nest; // Render. + + if (!options.skipRendering) { + buildHtml.render(options.tocSelector, nestedHeadings); + } // Update Sidebar and bind listeners. + + + this._scrollListener = throttle(function (e) { + buildHtml.updateToc(headingsArray); + !options.disableTocScrollSync && updateTocScroll(options); + var isTop = e && e.target && e.target.scrollingElement && e.target.scrollingElement.scrollTop === 0; + + if (e && (e.eventPhase === 0 || e.currentTarget === null) || isTop) { + buildHtml.updateToc(headingsArray); + + if (options.scrollEndCallback) { + options.scrollEndCallback(e); + } + } + }, options.throttleTimeout); + + this._scrollListener(); + + if (options.scrollContainer && document.querySelector(options.scrollContainer)) { + document.querySelector(options.scrollContainer).addEventListener('scroll', this._scrollListener, false); + document.querySelector(options.scrollContainer).addEventListener('resize', this._scrollListener, false); + } else { + document.addEventListener('scroll', this._scrollListener, false); + document.addEventListener('resize', this._scrollListener, false); + } // Bind click listeners to disable animation. + + + var timeout = null; + this._clickListener = throttle(function (event) { + if (options.scrollSmooth) { + buildHtml.disableTocAnimation(event); + } + + buildHtml.updateToc(headingsArray); // Timeout to re-enable the animation. + + timeout && clearTimeout(timeout); + timeout = setTimeout(function () { + buildHtml.enableTocAnimation(); + }, options.scrollSmoothDuration); + }, options.throttleTimeout); + + if (options.scrollContainer && document.querySelector(options.scrollContainer)) { + document.querySelector(options.scrollContainer).addEventListener('click', this._clickListener, false); + } else { + document.addEventListener('click', this._clickListener, false); + } + + return this; + }; + /** + * Refresh tocbot. + */ + + + tocbot.refresh = function (customOptions) { + tocbot.destroy(); + tocbot.init(customOptions || this.options); + }; // Make tocbot available globally. + + + root.tocbot = tocbot; + return tocbot; +}); +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(0))) + +/***/ }), +/* 25 */ +/***/ (function(module, exports) { + +// ----------------------------------------------------------------------------- +// ESLint shimming +// ----------------------------------------------------------------------------- + +/* eslint indent: "off" */ + +/* eslint no-undef: "off" */ + +/* eslint no-unused-vars: "off" */ +// ----------------------------------------------------------------------------- +module.exports = { + // Where to render the table of contents. + tocSelector: '.js-toc', + // Where to grab the headings to build the table of contents. + contentSelector: '.js-toc-content', + // Which headings to grab inside of the contentSelector element. + headingSelector: 'h1, h2, h3', + // Headings that match the ignoreSelector will be skipped. + ignoreSelector: '.js-toc-ignore', + // For headings inside relative or absolute positioned containers within content + hasInnerContainers: false, + // Main class to add to links. + linkClass: 'toc-link', + // Extra classes to add to links. + extraLinkClasses: '', + // Class to add to active links, + // the link corresponding to the top most heading on the page. + activeLinkClass: 'is-active-link', + // Main class to add to lists. + listClass: 'toc-list', + // Extra classes to add to lists. + extraListClasses: '', + // Class that gets added when a list should be collapsed. + isCollapsedClass: 'is-collapsed', + // Class that gets added when a list should be able + // to be collapsed but isn't necessarily collapsed. + collapsibleClass: 'is-collapsible', + // Class to add to list items. + listItemClass: 'toc-list-item', + // Class to add to active list items. + activeListItemClass: 'is-active-li', + // How many heading levels should not be collapsed. + // For example, number 6 will show everything since + // there are only 6 heading levels and number 0 will collapse them all. + // The sections that are hidden will open + // and close as you scroll to headings within them. + collapseDepth: 0, + // Smooth scrolling enabled. + scrollSmooth: true, + // Smooth scroll duration. + scrollSmoothDuration: 420, + // Smooth scroll offset. + scrollSmoothOffset: 0, + // Callback for scroll end. + scrollEndCallback: function scrollEndCallback(e) {}, + // Headings offset between the headings and the top of the document (this is meant for minor adjustments). + headingsOffset: 1, + // Timeout between events firing to make sure it's + // not too rapid (for performance reasons). + throttleTimeout: 50, + // Element to add the positionFixedClass to. + positionFixedSelector: null, + // Fixed position class to add to make sidebar fixed after scrolling + // down past the fixedSidebarOffset. + positionFixedClass: 'is-position-fixed', + // fixedSidebarOffset can be any number but by default is set + // to auto which sets the fixedSidebarOffset to the sidebar + // element's offsetTop from the top of the document on init. + fixedSidebarOffset: 'auto', + // includeHtml can be set to true to include the HTML markup from the + // heading node instead of just including the textContent. + includeHtml: false, + // onclick function to apply to all links in toc. will be called with + // the event as the first parameter, and this can be used to stop, + // propagation, prevent default or perform action + onClick: function onClick(e) {}, + // orderedList can be set to false to generate unordered lists (ul) + // instead of ordered lists (ol) + orderedList: true, + // If there is a fixed article scroll container, set to calculate titles' offset + scrollContainer: null, + // prevent ToC DOM rendering if it's already rendered by an external system + skipRendering: false, + // Optional callback to change heading labels. + // For example it can be used to cut down and put ellipses on multiline headings you deem too long. + // Called each time a heading is parsed. Expects a string in return, the modified label to display. + // function (string) => string + headingLabelCallback: false, + // ignore headings that are hidden in DOM + ignoreHiddenElements: false, + // Optional callback to modify properties of parsed headings. + // The heading element is passed in node parameter and information parsed by default parser is provided in obj parameter. + // Function has to return the same or modified obj. + // The heading will be excluded from TOC if nothing is returned. + // function (object, HTMLElement) => object | void + headingObjectCallback: null, + // Set the base path, useful if you use a `base` tag in `head`. + basePath: '', + // Only takes affect when `tocSelector` is scrolling, + // keep the toc scroll position in sync with the content. + disableTocScrollSync: false +}; + +/***/ }), +/* 26 */ +/***/ (function(module, exports) { + +/** + * This file is responsible for building the DOM and updating DOM state. + * + * @author Tim Scanlin + */ +// ----------------------------------------------------------------------------- +// ESLint shimming +// ----------------------------------------------------------------------------- + +/* eslint indent: "off" */ + +/* eslint no-undef: "off" */ + +/* eslint semi: "off" */ +// ----------------------------------------------------------------------------- +module.exports = function (options) { + var forEach = [].forEach; + var some = [].some; + var body = document.body; + var currentlyHighlighting = true; + var SPACE_CHAR = ' '; + /** + * Create link and list elements. + * @param {Object} d + * @param {HTMLElement} container + * @return {HTMLElement} + */ + + function createEl(d, container) { + var link = container.appendChild(createLink(d)); + + if (d.children.length) { + var list = createList(d.isCollapsed); + d.children.forEach(function (child) { + createEl(child, list); + }); + link.appendChild(list); + } + } + /** + * Render nested heading array data into a given selector. + * @param {String} selector + * @param {Array} data + * @return {HTMLElement} + */ + + + function render(selector, data) { + var collapsed = false; + var container = createList(collapsed); + data.forEach(function (d) { + createEl(d, container); + }); + var parent = document.querySelector(selector); // Return if no parent is found. + + if (parent === null) { + return; + } // Remove existing child if it exists. + + + if (parent.firstChild) { + parent.removeChild(parent.firstChild); + } // Just return the parent and don't append the list if no links are found. + + + if (data.length === 0) { + return parent; + } // Append the Elements that have been created + + + return parent.appendChild(container); + } + /** + * Create link element. + * @param {Object} data + * @return {HTMLElement} + */ + + + function createLink(data) { + var item = document.createElement('li'); + var a = document.createElement('a'); + + if (options.listItemClass) { + item.setAttribute('class', options.listItemClass); + } + + if (options.onClick) { + a.onclick = options.onClick; + } + + if (options.includeHtml && data.childNodes.length) { + forEach.call(data.childNodes, function (node) { + a.appendChild(node.cloneNode(true)); + }); + } else { + // Default behavior. + a.textContent = data.textContent; + } + + a.setAttribute('href', options.basePath + '#' + data.id); + a.setAttribute('class', options.linkClass + SPACE_CHAR + 'node-name--' + data.nodeName + SPACE_CHAR + options.extraLinkClasses); + item.appendChild(a); + return item; + } + /** + * Create list element. + * @param {Boolean} isCollapsed + * @return {HTMLElement} + */ + + + function createList(isCollapsed) { + var listElement = options.orderedList ? 'ol' : 'ul'; + var list = document.createElement(listElement); + var classes = options.listClass + SPACE_CHAR + options.extraListClasses; + + if (isCollapsed) { + classes += SPACE_CHAR + options.collapsibleClass; + classes += SPACE_CHAR + options.isCollapsedClass; + } + + list.setAttribute('class', classes); + return list; + } + /** + * Update fixed sidebar class. + * @return {HTMLElement} + */ + + + function updateFixedSidebarClass() { + if (options.scrollContainer && document.querySelector(options.scrollContainer)) { + var top; + top = document.querySelector(options.scrollContainer).scrollTop; + } else { + top = document.documentElement.scrollTop || body.scrollTop; + } + + var posFixedEl = document.querySelector(options.positionFixedSelector); + + if (options.fixedSidebarOffset === 'auto') { + options.fixedSidebarOffset = document.querySelector(options.tocSelector).offsetTop; + } + + if (top > options.fixedSidebarOffset) { + if (posFixedEl.className.indexOf(options.positionFixedClass) === -1) { + posFixedEl.className += SPACE_CHAR + options.positionFixedClass; + } + } else { + posFixedEl.className = posFixedEl.className.split(SPACE_CHAR + options.positionFixedClass).join(''); + } + } + /** + * Get top position of heading + * @param {HTMLElement} + * @return {integer} position + */ + + + function getHeadingTopPos(obj) { + var position = 0; + + if (obj !== document.querySelector(options.contentSelector && obj != null)) { + position = obj.offsetTop; + + if (options.hasInnerContainers) { + position += getHeadingTopPos(obj.offsetParent); + } + } + + return position; + } + /** + * Update TOC highlighting and collapsed groups + */ + + + function updateToc(headingsArray) { + // If a fixed content container was set + if (options.scrollContainer && document.querySelector(options.scrollContainer)) { + var top; + top = document.querySelector(options.scrollContainer).scrollTop; + } else { + top = document.documentElement.scrollTop || body.scrollTop; + } // Add fixed class at offset + + + if (options.positionFixedSelector) { + updateFixedSidebarClass(); + } // Get the most TOP heading currently visible on the page to + // identify what element to be highlighted + + + var headings = headingsArray; + var topHeader; + var headingTopPos; // Using some instead of each so that we can escape early + + if (currentlyHighlighting && document.querySelector(options.tocSelector) !== null && headings.length > 0) { + some.call(headings, function (heading, i) { + headingTopPos = getHeadingTopPos(heading); + + if (headingTopPos > top + options.headingsOffset + 10) { + // Don't allow negative index value + // var index = (i === 0) ? i : i - 1; + // topHeader = headings[index]; + // jadams, index correction seems NOT needed + topHeader = headings[i]; + return true; + } else if (i === headings.length - 1) { + // This allows scrolling for the last heading on the page + topHeader = headings[headings.length - 1]; + return true; + } + }); // Remove the active class from the other tocLinks. + + var tocLinks = document.querySelector(options.tocSelector).querySelectorAll('.' + options.linkClass); + forEach.call(tocLinks, function (tocLink) { + tocLink.className = tocLink.className.split(SPACE_CHAR + options.activeLinkClass).join(''); + }); + var tocLis = document.querySelector(options.tocSelector).querySelectorAll('.' + options.listItemClass); + forEach.call(tocLis, function (tocLi) { + tocLi.className = tocLi.className.split(SPACE_CHAR + options.activeListItemClass).join(''); + }); // Add the active class to the active tocLink. + + var activeTocLink = document.querySelector(options.tocSelector).querySelector('.' + options.linkClass + '.node-name--' + topHeader.nodeName + '[href="' + options.basePath + '#' + topHeader.id.replace(/([ #;&,.+*~':"!^$[\]()=>|/@])/g, '\\$1') + '"]'); + + if (activeTocLink.className.indexOf(options.activeLinkClass) === -1) { + activeTocLink.className += SPACE_CHAR + options.activeLinkClass; + } + + var li = activeTocLink.parentNode; + + if (li && li.className.indexOf(options.activeListItemClass) === -1) { + li.className += SPACE_CHAR + options.activeListItemClass; + } + + var tocLists = document.querySelector(options.tocSelector).querySelectorAll('.' + options.listClass + '.' + options.collapsibleClass); // Collapse the other collapsible lists. + + forEach.call(tocLists, function (list) { + if (list.className.indexOf(options.isCollapsedClass) === -1) { + list.className += SPACE_CHAR + options.isCollapsedClass; + } + }); // Expand the active link's collapsible list and its sibling if applicable. + + if (activeTocLink.nextSibling && activeTocLink.nextSibling.className.indexOf(options.isCollapsedClass) !== -1) { + activeTocLink.nextSibling.className = activeTocLink.nextSibling.className.split(SPACE_CHAR + options.isCollapsedClass).join(''); + } + + removeCollapsedFromParents(activeTocLink.parentNode.parentNode); + } + } + /** + * Remove collpased class from parent elements. + * @param {HTMLElement} element + * @return {HTMLElement} + */ + + + function removeCollapsedFromParents(element) { + if (element.className.indexOf(options.collapsibleClass) !== -1 && element.className.indexOf(options.isCollapsedClass) !== -1) { + element.className = element.className.split(SPACE_CHAR + options.isCollapsedClass).join(''); + return removeCollapsedFromParents(element.parentNode.parentNode); + } + + return element; + } + /** + * Disable TOC Animation when a link is clicked. + * @param {Event} event + */ + + + function disableTocAnimation(event) { + var target = event.target || event.srcElement; + + if (typeof target.className !== 'string' || target.className.indexOf(options.linkClass) === -1) { + return; + } // Bind to tocLink clicks to temporarily disable highlighting + // while smoothScroll is animating. + + + currentlyHighlighting = false; + } + /** + * Enable TOC Animation. + */ + + + function enableTocAnimation() { + currentlyHighlighting = true; + } + + return { + enableTocAnimation: enableTocAnimation, + disableTocAnimation: disableTocAnimation, + render: render, + updateToc: updateToc + }; +}; + +/***/ }), +/* 27 */ +/***/ (function(module, exports) { + +/** + * This file is responsible for parsing the content from the DOM and making + * sure data is nested properly. + * + * @author Tim Scanlin + */ +// ----------------------------------------------------------------------------- +// ESLint shimming +// ----------------------------------------------------------------------------- + +/* eslint indent: "off" */ + +/* eslint no-undef: "off" */ + +/* eslint semi: "off" */ +// ----------------------------------------------------------------------------- +module.exports = function parseContent(options) { + var reduce = [].reduce; + /** + * Get the last item in an array and return a reference to it. + * @param {Array} array + * @return {Object} + */ + + function getLastItem(array) { + return array[array.length - 1]; + } + /** + * Get heading level for a heading dom node. + * @param {HTMLElement} heading + * @return {Number} + */ + + + function getHeadingLevel(heading) { + return +heading.nodeName.split('H').join(''); + } + /** + * Get important properties from a heading element and store in a plain object. + * @param {HTMLElement} heading + * @return {Object} + */ + + + function getHeadingObject(heading) { + // each node is processed twice by this method because nestHeadingsArray() and addNode() calls it + // first time heading is real DOM node element, second time it is obj + // that is causing problem so I am processing only original DOM node + if (!(heading instanceof window.HTMLElement)) return heading; + + if (options.ignoreHiddenElements && (!heading.offsetHeight || !heading.offsetParent)) { + return null; + } + + var obj = { + id: heading.id, + children: [], + nodeName: heading.nodeName, + headingLevel: getHeadingLevel(heading), + textContent: options.headingLabelCallback ? String(options.headingLabelCallback(heading.textContent)) : heading.textContent.trim() + }; + + if (options.includeHtml) { + obj.childNodes = heading.childNodes; + } + + if (options.headingObjectCallback) { + return options.headingObjectCallback(obj, heading); + } + + return obj; + } + /** + * Add a node to the nested array. + * @param {Object} node + * @param {Array} nest + * @return {Array} + */ + + + function addNode(node, nest) { + var obj = getHeadingObject(node); + var level = obj.headingLevel; + var array = nest; + var lastItem = getLastItem(array); + var lastItemLevel = lastItem ? lastItem.headingLevel : 0; + var counter = level - lastItemLevel; + + while (counter > 0) { + lastItem = getLastItem(array); + + if (lastItem && lastItem.children !== undefined) { + array = lastItem.children; + } + + counter--; + } + + if (level >= options.collapseDepth) { + obj.isCollapsed = true; + } + + array.push(obj); + return array; + } + /** + * Select headings in content area, exclude any selector in options.ignoreSelector + * @param {String} contentSelector + * @param {Array} headingSelector + * @return {Array} + */ + + + function selectHeadings(contentSelector, headingSelector) { + var selectors = headingSelector; + + if (options.ignoreSelector) { + selectors = headingSelector.split(',').map(function mapSelectors(selector) { + return selector.trim() + ':not(' + options.ignoreSelector + ')'; + }); + } + + try { + return document.querySelector(contentSelector).querySelectorAll(selectors); + } catch (e) { + console.warn('Element not found: ' + contentSelector); // eslint-disable-line + + return null; + } + } + /** + * Nest headings array into nested arrays with 'children' property. + * @param {Array} headingsArray + * @return {Object} + */ + + + function nestHeadingsArray(headingsArray) { + return reduce.call(headingsArray, function reducer(prev, curr) { + var currentHeading = getHeadingObject(curr); + + if (currentHeading) { + addNode(currentHeading, prev.nest); + } + + return prev; + }, { + nest: [] + }); + } + + return { + nestHeadingsArray: nestHeadingsArray, + selectHeadings: selectHeadings + }; +}; + +/***/ }), +/* 28 */ +/***/ (function(module, exports) { + +// ----------------------------------------------------------------------------- +// ESLint shimming +// ----------------------------------------------------------------------------- + +/* eslint indent: "off" */ + +/* eslint no-undef: "off" */ + +/* eslint semi: "off" */ +// ----------------------------------------------------------------------------- +module.exports = function updateTocScroll(options) { + var toc = document.querySelector(options.tocSelector); + + if (toc && toc.scrollHeight > toc.clientHeight) { + var activeItem = toc.querySelector('.' + options.activeListItemClass); + + if (activeItem) { + toc.scrollTop = activeItem.offsetTop; + } + } +}; + +/***/ }), +/* 29 */ +/***/ (function(module, exports) { + +/* + # ----------------------------------------------------------------------------- + # ~/js/tocbot/scroll-smooth/index.js + # Scroll-Smooth (Tocbot v4.12.0) implementation for J1 template + # + # Product/Info: + # https://jekyll.one + # https://tscanlin.github.io/tocbot + # https://github.com/tscanlin/tocbot + # + # Copyright (C) 2021 Juergen Adams + # Copyright (C) 2016 Tim Scanlin + # + # J1 Template is licensed under MIT License. + # See: https://github.com/jekyll-one-org/J1 Template/blob/master/LICENSE + # Tocbot is licensed under the MIT License. + # For details, https://github.com/tscanlin/tocbot/blob/master/LICENSE + # ----------------------------------------------------------------------------- +*/ +// ----------------------------------------------------------------------------- +// ESLint shimming +// ----------------------------------------------------------------------------- + +/* eslint no-redeclare: "off" */ + +/* eslint no-undef: "off" */ + +/* eslint no-empty: "off" */ + +/* eslint semi: "off" */ +// ----------------------------------------------------------------------------- + +/* globals location, requestAnimationFrame */ +exports.initSmoothScrolling = initSmoothScrolling; + +function initSmoothScrolling(options) { + if (isCssSmoothSCrollSupported()) {} + + var duration = options.duration; + var offset = options.offset; + var pageUrl = location.hash ? stripHash(location.href) : location.href; + delegatedLinkHijacking(); + + function delegatedLinkHijacking() { + document.body.addEventListener('click', onClick, false); + + function onClick(e) { + if (!isInPageLink(e.target) || e.target.className.indexOf('no-smooth-scroll') > -1 || e.target.href.charAt(e.target.href.length - 2) === '#' && e.target.href.charAt(e.target.href.length - 1) === '!' || e.target.className.indexOf(options.linkClass) === -1) { + return; + } // Don't prevent default or hash doesn't change. + // e.preventDefault() + + + jump(e.target.hash, { + duration: duration, + offset: offset, + callback: function callback() { + setFocus(e.target.hash); + } + }); + } + } + + function isInPageLink(n) { + return n.tagName.toLowerCase() === 'a' && (n.hash.length > 0 || n.href.charAt(n.href.length - 1) === '#') && (stripHash(n.href) === pageUrl || stripHash(n.href) + '#' === pageUrl); + } + + function stripHash(url) { + return url.slice(0, url.lastIndexOf('#')); + } + + function isCssSmoothSCrollSupported() { + return 'scrollBehavior' in document.documentElement.style; + } // Adapted from: + // https://www.nczonline.net/blog/2013/01/15/fixing-skip-to-content-links/ + + + function setFocus(hash) { + var element = document.getElementById(hash.substring(1)); + + if (element) { + if (!/^(?:a|select|input|button|textarea)$/i.test(element.tagName)) { + element.tabIndex = -1; + } + + element.focus(); + } + } +} + +function jump(target, options) { + var start = window.pageYOffset; + var opt = { + duration: options.duration, + offset: options.offset || 0, + callback: options.callback, + easing: options.easing || easeInOutQuad + }; // This makes ids that start with a number work: ('[id="' + decodeURI(target).split('#').join('') + '"]') + // DecodeURI for nonASCII hashes, they was encoded, but id was not encoded, it lead to not finding the tgt element by id. + // And this is for IE: document.body.scrollTop + + var tgt = document.querySelector('[id="' + decodeURI(target).split('#').join('') + '"]'); + var distance = typeof target === 'string' ? opt.offset + (target ? tgt && tgt.getBoundingClientRect().top || 0 // handle non-existent links better. + : -(document.documentElement.scrollTop || document.body.scrollTop)) : target; + var duration = typeof opt.duration === 'function' ? opt.duration(distance) : opt.duration; + var timeStart; + var timeElapsed; + requestAnimationFrame(function (time) { + timeStart = time; + loop(time); + }); + + function loop(time) { + timeElapsed = time - timeStart; + window.scrollTo(0, opt.easing(timeElapsed, start, distance, duration)); + + if (timeElapsed < duration) { + requestAnimationFrame(loop); + } else { + end(); + } + } + + function end() { + window.scrollTo(0, start + distance); + + if (typeof opt.callback === 'function') { + opt.callback(); + } + } // Robert Penner's easeInOutQuad - http://robertpenner.com/easing/ + + + function easeInOutQuad(t, b, c, d) { + t /= d / 2; + if (t < 1) return c / 2 * t * t + b; + t--; + return -c / 2 * (t * (t - 2) - 1) + b; + } +} + +/***/ }), +/* 30 */ +/***/ (function(module, exports) { + +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +/* + A simple jQuery function that can add listeners on attribute change. + http://meetselva.github.io/attrchange/ + + About License: + Copyright (C) 2013-2014 Selvakumar Arumugam + You may use attrchange plugin under the terms of the MIT Licese. + https://github.com/meetselva/attrchange/blob/master/MIT-License.txt +*/ +; + +(function ($) { + function isDOMAttrModifiedSupported() { + var p = document.createElement('p'); + var flag = false; + + if (p.addEventListener) { + p.addEventListener('DOMAttrModified', function () { + flag = true; + }, false); + } else if (p.attachEvent) { + p.attachEvent('onDOMAttrModified', function () { + flag = true; + }); + } else { + return false; + } + + p.setAttribute('id', 'target'); + return flag; + } + + function checkAttributes(chkAttr, e) { + if (chkAttr) { + var attributes = this.data('attr-old-value'); + + if (e.attributeName.indexOf('style') >= 0) { + if (!attributes['style']) attributes['style'] = {}; //initialize + + var keys = e.attributeName.split('.'); + e.attributeName = keys[0]; + e.oldValue = attributes['style'][keys[1]]; //old value + + e.newValue = keys[1] + ':' + this.prop("style")[$.camelCase(keys[1])]; //new value + + attributes['style'][keys[1]] = e.newValue; + } else { + e.oldValue = attributes[e.attributeName]; + e.newValue = this.attr(e.attributeName); + attributes[e.attributeName] = e.newValue; + } + + this.data('attr-old-value', attributes); //update the old value object + } + } //initialize Mutation Observer + + + var MutationObserver = window.MutationObserver || window.WebKitMutationObserver; + + $.fn.attrchange = function (a, b) { + if (_typeof(a) == 'object') { + //core + var cfg = { + trackValues: false, + callback: $.noop + }; //backward compatibility + + if (typeof a === "function") { + cfg.callback = a; + } else { + $.extend(cfg, a); + } + + if (cfg.trackValues) { + //get attributes old value + this.each(function (i, el) { + var attributes = {}; + + for (var attr, i = 0, attrs = el.attributes, l = attrs.length; i < l; i++) { + attr = attrs.item(i); + attributes[attr.nodeName] = attr.value; + } + + $(this).data('attr-old-value', attributes); + }); + } + + if (MutationObserver) { + //Modern Browsers supporting MutationObserver + var mOptions = { + subtree: false, + attributes: true, + attributeOldValue: cfg.trackValues + }; + var observer = new MutationObserver(function (mutations) { + mutations.forEach(function (e) { + var _this = e.target; //get new value if trackValues is true + + if (cfg.trackValues) { + e.newValue = $(_this).attr(e.attributeName); + } + + if ($(_this).data('attrchange-status') === 'connected') { + //execute if connected + cfg.callback.call(_this, e); + } + }); + }); + return this.data('attrchange-method', 'Mutation Observer').data('attrchange-status', 'connected').data('attrchange-obs', observer).each(function () { + observer.observe(this, mOptions); + }); + } else if (isDOMAttrModifiedSupported()) { + //Opera + //Good old Mutation Events + return this.data('attrchange-method', 'DOMAttrModified').data('attrchange-status', 'connected').on('DOMAttrModified', function (event) { + if (event.originalEvent) { + event = event.originalEvent; + } //jQuery normalization is not required + + + event.attributeName = event.attrName; //property names to be consistent with MutationObserver + + event.oldValue = event.prevValue; //property names to be consistent with MutationObserver + + if ($(this).data('attrchange-status') === 'connected') { + //disconnected logically + cfg.callback.call(this, event); + } + }); + } else if ('onpropertychange' in document.body) { + //works only in IE + return this.data('attrchange-method', 'propertychange').data('attrchange-status', 'connected').on('propertychange', function (e) { + e.attributeName = window.event.propertyName; //to set the attr old value + + checkAttributes.call($(this), cfg.trackValues, e); + + if ($(this).data('attrchange-status') === 'connected') { + //disconnected logically + cfg.callback.call(this, e); + } + }); + } + + return this; + } else if (typeof a == 'string' && $.fn.attrchange.hasOwnProperty('extensions') && $.fn.attrchange['extensions'].hasOwnProperty(a)) { + //extensions/options + return $.fn.attrchange['extensions'][a].call(this, b); + } + }; + + $.fn.attrchange.extensions = { + /*attrchange option/extension*/ + disconnect: function disconnect(o) { + if (typeof o !== 'undefined' && o.isPhysicalDisconnect) { + return this.each(function () { + var attrchangeMethod = $(this).data('attrchange-method'); + + if (attrchangeMethod == 'propertychange' || attrchangeMethod == 'DOMAttrModified') { + $(this).off(attrchangeMethod); + } else if (attrchangeMethod == 'Mutation Observer') { + $(this).data('attrchange-obs').disconnect(); + } else if (attrchangeMethod == 'polling') { + clearInterval($(this).data('attrchange-polling-timer')); + } + }).removeData(['attrchange-method', 'attrchange-status']); + } else { + //logical disconnect + return this.data('attrchange-status', 'disconnected'); //set a flag that prevents triggering callback onattrchange + } + }, + remove: function remove(o) { + return $.fn.attrchange.extensions['disconnect'].call(this, { + isPhysicalDisconnect: true + }); + }, + getProperties: function getProperties(o) { + var attrchangeMethod = $(this).data('attrchange-method'); + var pollInterval = $(this).data('attrchange-pollInterval'); + return { + method: attrchangeMethod, + isPolling: attrchangeMethod == 'polling', + pollingInterval: typeof pollInterval === 'undefined' ? 0 : parseInt(pollInterval, 10), + status: typeof attrchangeMethod === 'undefined' ? 'removed' : $(this).data('attrchange-status') + }; + }, + reconnect: function reconnect(o) { + //reconnect possible only when there is a logical disconnect + return this.data('attrchange-status', 'connected'); + }, + polling: function polling(o) { + if (o.hasOwnProperty('isComputedStyle') && o.isComputedStyle == 'true') { + /* extensive and slow - polling to check on computed style properties */ + return this.each(function (i, _this) { + if (!o.hasOwnProperty('properties') || Object.prototype.toString.call(o.properties) !== '[object Array]' || o.properties.length == 0) { + return false; + } //return if no properties found + + + var attributes = {}; //store computed properties + + for (var i = 0; i < o.properties.length; i++) { + attributes[o.properties[i]] = $(this).css(o.properties[i]); + } + + var _this = this; + + $(this).data('attrchange-polling-timer', setInterval(function () { + var changes = {}, + hasChanges = false; // attrName: { oldValue: xxx, newValue: yyy} + + for (var comuptedVal, i = 0; i < o.properties.length; i++) { + comuptedVal = $(_this).css(o.properties[i]); + + if (attributes[o.properties[i]] !== comuptedVal) { + hasChanges = true; + changes[o.properties[i]] = { + oldValue: attributes[o.properties[i]], + newValue: comuptedVal + }; + attributes[o.properties[i]] = comuptedVal; //add the attribute to the orig + } + } + + if (hasChanges && $(_this).data('attrchange-status') === 'connected') { + //disconnected logically + o.callback.call(_this, changes); + } + }, o.pollInterval ? o.pollInterval : 1000)).data('attrchange-method', 'polling').data('attrchange-pollInterval', o.pollInterval).data('attrchange-status', 'connected'); + }); + } else { + return this.each(function (i, _this) { + /* this one is programmatic polling */ + var attributes = {}; + + for (var attr, i = 0, attrs = _this.attributes, l = attrs.length; i < l; i++) { + attr = attrs.item(i); + attributes[attr.nodeName] = attr.nodeValue; + } + + $(_this).data('attrchange-polling-timer', setInterval(function () { + var changes = {}, + hasChanges = false; // attrName: { oldValue: xxx, newValue: yyy} + + for (var attr, i = 0, attrs = _this.attributes, l = attrs.length; i < l; i++) { + attr = attrs.item(i); + + if (attributes.hasOwnProperty(attr.nodeName) && attributes[attr.nodeName] != attr.nodeValue) { + //check the values + changes[attr.nodeName] = { + oldValue: attributes[attr.nodeName], + newValue: attr.nodeValue + }; + hasChanges = true; + } else if (!attributes.hasOwnProperty(attr.nodeName)) { + //new attribute + changes[attr.nodeName] = { + oldValue: '', + newValue: attr.nodeValue + }; + hasChanges = true; + } + + attributes[attr.nodeName] = attr.nodeValue; //add the attribute to the orig + } + + if (hasChanges && $(_this).data('attrchange-status') === 'connected') { + //disconnected logically + o.callback.call(_this, changes); + } + }, o.pollInterval ? o.pollInterval : 1000)).data('attrchange-method', 'polling').data('attrchange-pollInterval', o.pollInterval).data('attrchange-status', 'connected'); + }); + } + } + }; +})(jQuery); + +/***/ }), +/* 31 */ +/***/ (function(module, exports) { + +/* + # ----------------------------------------------------------------------------- + # ~/js/adoc_result_viewer/view_results.js + # Provides JavaScript functions displaying results for Asciidoctor + # example block + # + # Product/Info: + # https://jekyll.one + # + # Copyright (C) 2021 Juergen Adams + # + # J1 Template is licensed under MIT License. + # See: https://github.com/jekyll-one-org/J1 Template/blob/master/LICENSE + # ----------------------------------------------------------------------------- + # TODO: Improve lanuage settings + # TODO: Improve auto-hide functionality for the results block + # ----------------------------------------------------------------------------- +*/ +// ----------------------------------------------------------------------------- +// ESLint shimming +// ----------------------------------------------------------------------------- + +/* eslint indent: "off" */ + +/* global $ */ +// ----------------------------------------------------------------------------- +var timeoutHandle; // var language = 'de'; + +var language = document.documentElement.lang; + +function toggle_result_block(result_block) { + window.clearTimeout(timeoutHandle); // Clear the timeout object + + result_block.prev().toggleClass('stacked'); + result_block.toggle(); // jadams: Improve auto-hide functionality for the results block + // + // timeoutHandle = window.setTimeout(function () { + // result_block.hide(); + // }, 5000); +} + +function insert_result_links() { + $('.result').each(function (idx, node) { + var view_result_link; + var result_block = $(node); + var title_div = result_block.prev().find('.title'); + + if (language == 'en') { + view_result_link = $('<div class="view-result j1-viewer"><span class="btn-viewer j1-tooltip" data-toggle="tooltip" data-placement="left" title="toggle results" data-original-title="toggle results">View</span></div>'); + } else if (language == 'de') { + view_result_link = $('<div class="view-result j1-viewer"><span class="btn-viewer j1-tooltip" data-toggle="tooltip" data-placement="left" title="Anzeige umschalten" data-original-title="toggle results">Anzeige</span></div>'); + } else { + view_result_link = $('<div class="view-result j1-viewer"><span class="btn-viewer j1-tooltip" data-toggle="tooltip" data-placement="left" title="toggle results" data-original-title="toggle results">View</span></div>'); + } + + title_div.append(view_result_link); + view_result_link.on('click', function (event) { + event.preventDefault(); + toggle_result_block(result_block); + }); + }); +} + +$(insert_result_links); + +/***/ }) +/******/ ]); \ No newline at end of file