pict 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc +3 -0
- package/.browserslistrc +1 -0
- package/.browserslistrc_compatible +1 -0
- package/.browserslistrc_default +1 -0
- package/.config/code-server/config.yaml +4 -0
- package/.config/configstore/update-notifier-npm-check-updates.json +4 -0
- package/.config/configstore/update-notifier-npm.json +4 -0
- package/.config/installation/UI-Requirements.md +32 -0
- package/.config/installation/install_luxury_code.js +105 -0
- package/.config/installation/install_luxury_default_configuration.json +45 -0
- package/.config/installation/install_luxury_interaction.json +3 -0
- package/.config/installation/precedent.1.0.5.js +339 -0
- package/.config/luxury-extras/.vscode/launch.json +46 -0
- package/.config/luxury-extras/Dockerfile_LUXURYCode +39 -0
- package/.config/luxury-extras/MySQL/Dockerfile_LUXURYCODE_MySQL +65 -0
- package/.config/luxury-extras/MySQL/MySQL-Laden-Entry.sh +17 -0
- package/.config/luxury-extras/MySQL/MySQL-Security.sql +5 -0
- package/.travis.yml +14 -0
- package/.vscode/launch.json +46 -0
- package/Dockerfile_LUXURYCode +39 -0
- package/LICENSE +22 -0
- package/README.md +79 -0
- package/bower.json +25 -0
- package/debug/Harness.js +35 -0
- package/debug/examples/informary/Harness.js +19 -0
- package/debug/examples/informary/README.md +43 -0
- package/debug/examples/informary/bootstrap/css/bootstrap.css +10259 -0
- package/debug/examples/informary/bootstrap/js/bootstrap.min.js +7 -0
- package/debug/examples/informary/index.html +379 -0
- package/debug/examples/simpleApp/index.html +66 -0
- package/dist/pict.compatible.js +5705 -0
- package/dist/pict.compatible.min.js +246 -0
- package/dist/pict.compatible.min.js.map +1 -0
- package/dist/pict.js +5705 -0
- package/dist/pict.min.js +238 -0
- package/dist/pict.min.js.map +1 -0
- package/gulpfile-config.json +11 -0
- package/gulpfile-config_compatible.json +11 -0
- package/gulpfile-config_default.json +11 -0
- package/gulpfile.js +164 -0
- package/package.json +66 -0
- package/site_prototype/index.html +23 -0
- package/source/Pict-Browser-Shim.js +15 -0
- package/source/Pict-Fable-Service-Elucidator.js +17 -0
- package/source/Pict-Fable-Service-Informary.js +17 -0
- package/source/Pict-Fable-Service-Manyfest.js +24 -0
- package/source/Pict-Template-Provider.js +105 -0
- package/source/Pict.js +141 -0
- package/test/Pict_tests.js +139 -0
- package/test/data/SampleRecord-Quantity.json +13 -0
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
"use strict";function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=_superPropBase(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},_get.apply(this,arguments)}function _superPropBase(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf(e)););return e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_setPrototypeOf(e,t)}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var n,r=_getPrototypeOf(e);if(t){var i=_getPrototypeOf(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _possibleConstructorReturn(e,t){if(t&&("object"===_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _getPrototypeOf(e){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_getPrototypeOf(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_toPropertyKey(r.key),r)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}!function(e){if("object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Pict=e()}}((function(){return function e(t,n,r){function i(a,s){if(!n[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[a]={exports:{}};t[a][0].call(l.exports,(function(e){return i(t[a][1][e]||e)}),l,l.exports,e,t,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(e,t,n){var r=e("async.util.eachoflimit"),i=e("async.util.withoutindex");t.exports=function(e,t,n,o){return r(t)(e,i(n),o)}},{"async.util.eachoflimit":3,"async.util.withoutindex":14}],2:[function(e,t,n){t.exports=function(e){return function t(n){function r(){return e.length&&e[n].apply(null,arguments),r.next()}return r.next=function(){return n<e.length-1?t(n+1):null},r}(0)}},{}],3:[function(e,t,n){var r=e("async.util.once"),i=e("async.util.noop"),o=e("async.util.onlyonce"),a=e("async.util.keyiterator");t.exports=function(e){return function(t,n,s){s=r(s||i);var u=a(t=t||[]);if(e<=0)return s(null);var c=!1,l=0,p=!1;!function r(){if(c&&l<=0)return s(null);for(;l<e&&!p;){var i=u();if(null===i)return c=!0,void(l<=0&&s(null));l+=1,n(t[i],i,o((function(e){l-=1,e?(s(e),p=!0):r()})))}}()}}},{"async.util.keyiterator":7,"async.util.noop":9,"async.util.once":10,"async.util.onlyonce":11}],4:[function(e,t,n){var r=e("async.util.setimmediate"),i=e("async.util.restparam");t.exports=function(e){return i((function(t){var n=t.pop();t.push((function(){var e=arguments;i?r((function(){n.apply(null,e)})):n.apply(null,e)}));var i=!0;e.apply(this,t),i=!1}))}},{"async.util.restparam":12,"async.util.setimmediate":13}],5:[function(e,t,n){t.exports=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],6:[function(e,t,n){var r=e("async.util.isarray");t.exports=function(e){return r(e)||"number"==typeof e.length&&e.length>=0&&e.length%1==0}},{"async.util.isarray":5}],7:[function(e,t,n){var r=e("async.util.keys"),i=e("async.util.isarraylike");t.exports=function(e){var t,n,o=-1;return i(e)?(t=e.length,function(){return++o<t?o:null}):(n=r(e),t=n.length,function(){return++o<t?n[o]:null})}},{"async.util.isarraylike":6,"async.util.keys":8}],8:[function(e,t,n){t.exports=Object.keys||function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t}},{}],9:[function(e,t,n){t.exports=function(){}},{}],10:[function(e,t,n){t.exports=function(e){return function(){null!==e&&(e.apply(this,arguments),e=null)}}},{}],11:[function(e,t,n){t.exports=function(e){return function(){if(null===e)throw new Error("Callback was already called.");e.apply(this,arguments),e=null}}},{}],12:[function(e,t,n){t.exports=function(e,t){return t=null==t?e.length-1:+t,function(){for(var n=Math.max(arguments.length-t,0),r=new Array(n),i=0;i<n;i++)r[i]=arguments[i+t];switch(t){case 0:return e.call(this,r);case 1:return e.call(this,arguments[0],r)}}}},{}],13:[function(e,t,n){(function(e){(function(){var n="function"==typeof e&&e,r=function(e){setTimeout(e,0)};t.exports=function(e){return(n||r)(e)}}).call(this)}).call(this,e("timers").setImmediate)},{timers:99}],14:[function(e,t,n){t.exports=function(e){return function(t,n,r){return e(t,r)}}},{}],15:[function(e,t,n){var r=e("async.util.once"),i=e("async.util.noop"),o=e("async.util.isarray"),a=e("async.util.restparam"),s=e("async.util.ensureasync"),u=e("async.iterator");t.exports=function(e,t){if(t=r(t||i),!o(e))return t(new Error("First argument to waterfall must be an array of functions"));if(!e.length)return t();!function e(n){return a((function(r,i){if(r)t.apply(null,[r].concat(i));else{var o=n.next();o?i.push(e(o)):i.push(t),s(n).apply(null,i)}}))}(u(e))()}},{"async.iterator":2,"async.util.ensureasync":4,"async.util.isarray":5,"async.util.noop":9,"async.util.once":10,"async.util.restparam":12}],16:[function(e,t,n){},{}],17:[function(e,t,n){
|
|
2
|
+
/**
|
|
3
|
+
* Cache data structure with:
|
|
4
|
+
* - enumerable items
|
|
5
|
+
* - unique hash item access (if none is passed in, one is generated)
|
|
6
|
+
* - size (length) expiration
|
|
7
|
+
* - controllable expiration (e.g. keep in cache longer if older/less likely to change)
|
|
8
|
+
* - time-based expiration
|
|
9
|
+
* - custom expiration based on passed-in function
|
|
10
|
+
*
|
|
11
|
+
* Also:
|
|
12
|
+
* - built to work well with browserify
|
|
13
|
+
* - no dependencies at all
|
|
14
|
+
* - pet friendly
|
|
15
|
+
*
|
|
16
|
+
* @license MIT
|
|
17
|
+
*
|
|
18
|
+
* @author Steven Velozo <steven@velozo.com>
|
|
19
|
+
* @module CashMoney
|
|
20
|
+
*/
|
|
21
|
+
var r=e("./LinkedList.js"),i=function(){function e(){_classCallCheck(this,e),this._HashMap={},this._List=new r,this.maxLength=0,this.maxAge=0}return _createClass(e,[{key:"put",value:function(e,t){if(this._HashMap.hasOwnProperty(t))return this._HashMap[t].Datum=e,this._HashMap[t].Datum;var n=this._List.push(e,t);return this._HashMap[n.Hash]=n,this.maxLength>0&&this._List.length>this.maxLength&&(n=this._List.pop(),delete this._HashMap[n.Hash]),n.Metadata.Created=+new Date,n.Datum}},{key:"touch",value:function(e){if(!this._HashMap.hasOwnProperty(e))return!1;var t=this._List.remove(this._HashMap[e]);return delete this._HashMap[e],this.put(t.Datum,t.Hash)}},{key:"expire",value:function(e){if(!this._HashMap.hasOwnProperty(e))return!1;var t=this._HashMap[e];return t=this._List.remove(t),delete this._HashMap[t.Hash],t}},{key:"pruneBasedOnExpiration",value:function(e,t){var n=void 0===t?[]:t;if(this.maxAge<1)return e(n);for(var r=+new Date,i=Object.keys(this._HashMap),o=0;o<i.length;o++)r-this._HashMap[i[o]].Metadata.Created>=this.maxAge&&n.push(this.expire(i[o]));e(n)}},{key:"pruneBasedOnLength",value:function(e,t){var n=void 0===t?[]:t;if(this.maxLength>0)for(;this._List.length>this.maxLength;)n.push(this._List.pop());return e(n)}},{key:"pruneCustom",value:function(e,t,n){for(var r=void 0===n?[]:n,i=Object.keys(this._HashMap),o=0;o<i.length;o++){var a=this._HashMap[i[o]];t(a.Datum,a.Hash,a)&&r.push(this.expire(i[o]))}e(r)}},{key:"prune",value:function(e){var t=this,n=[];if(this._List.length<1)return e(n);this.pruneBasedOnExpiration((function(r){t.pruneBasedOnLength(e,n)}),n)}},{key:"read",value:function(e){return!!this._HashMap.hasOwnProperty(e)&&this._HashMap[e].Datum}},{key:"getNode",value:function(e){return!!this._HashMap.hasOwnProperty(e)&&this._HashMap[e]}}]),e}();t.exports=i},{"./LinkedList.js":19}],18:[function(e,t,n){var r=_createClass((function e(){_classCallCheck(this,e),this.Hash=!1,this.Datum=!1,this.Metadata={},this.LeftNode=!1,this.RightNode=!1,this.__ISNODE=!0}));t.exports=r},{}],19:[function(e,t,n){var r=e("./LinkedList-Node.js"),i=function(){function e(){_classCallCheck(this,e),this.totalNodes=0,this.length=0,this.head=!1,this.tail=!1}return _createClass(e,[{key:"initializeNode",value:function(e,t){if(void 0===e)return!1;this.totalNodes++;var n=void 0!==t?t:"NODE[".concat(this.totalNodes,"]"),i=new r;return i.Hash=n,i.Datum=e,i}},{key:"append",value:function(e,t){var n=this.initializeNode(e,t);return!!n&&(this.length++,1==this.length?(this.head=n,this.tail=n,n):(this.tail.RightNode=n,n.LeftNode=this.tail,this.tail=n,n))}},{key:"push",value:function(e,t){return this.append(e,t)}},{key:"prepend",value:function(e,t){var n=this.initializeNode(e,t);return!!n&&(this.length++,1==this.length?(this.head=n,this.tail=n,n):(this.head.LeftNode=n,n.RightNode=this.head,this.head=n,n))}},{key:"remove",value:function(e){return void 0!==e&&(!!e.__ISNODE&&(this.length--,this.length<1?(this.head=!1,this.tail=!1,e):e.LeftNode&&e.RightNode?(e.LeftNode.RightNode=e.RightNode,e.RightNode.LeftNode=e.LeftNode,e.RightNode=!1,e.LeftNode=!1,e):e.LeftNode?(e.LeftNode.RightNode=!1,this.tail=e.LeftNode,e.LeftNode=!1,e):(e.RightNode.LeftNode=!1,this.head=e.RightNode,e.RightNode=!1,e)))}},{key:"pop",value:function(){return this.remove(this.head)}},{key:"each",value:function(e,t){var n=this;if(this.length<1)return t();var r=!1;return function i(o){if(o)return t(o);if(r){if(!r.RightNode)return t();r=r.RightNode}else r=n.head;e(r.Datum,r.Hash,i)}()}},{key:"seek",value:function(e){if(!e)return!1;if(this.length<1)return!1;if(e>=this.length)return!1;for(var t=this.head,n=0;n<e;n++)t=t.RightNode;return t}}]),e}();t.exports=i},{"./LinkedList-Node.js":18}],20:[function(e,t,n){
|
|
22
|
+
/**
|
|
23
|
+
* @license MIT
|
|
24
|
+
* @author <steven@velozo.com>
|
|
25
|
+
*/
|
|
26
|
+
var r=function(){function e(){_classCallCheck(this,e),this._Regex_formatterInsertCommas=/.{1,3}/g,this._Regex_formatterAddCommasToNumber=/^([-+]?)(0?)(\d+)(.?)(\d+)$/g,this._Regex_formatterDollarsRemoveCommas=/,/gi,this._Regex_formatterCleanNonAlpha=/[^a-z0-9]/gi,this._Value_MoneySign_Currency="$",this._Value_NaN_Currency="--",this._Value_GroupSeparator_Number=",",this._Value_Prefix_StringHash="HSH",this._Value_Clean_formatterCleanNonAlpha="_",this._UseEngineStringStartsWith="function"==typeof String.prototype.startsWith,this._UseEngineStringEndsWith="function"==typeof String.prototype.endsWith}return _createClass(e,[{key:"stringReverse",value:function(e){return e.split("").reverse().join("")}},{key:"stringStartsWith",value:function(e,t,n){return this._UseEngineStringStartsWith?e.startsWith(t,n):this.stringStartsWith_Polyfill.call(e,t,n)}},{key:"stringStartsWith_Polyfill",value:function(e,t){return this.slice(t||0,e.length)===e}},{key:"stringEndsWith",value:function(e,t,n){return this._UseEngineStringEndsWith?e.endsWith(t,n):this.stringEndsWith_Polyfill.call(e,t,n)}},{key:"stringEndsWith_Polyfill",value:function(e,t){return t<this.length?t|=0:t=this.length,this.substr(t-e.length,e.length)===e}},{key:"insecureStringHash",value:function(e){for(var t=0,n=e.length,r=0;r<n;)t=(t<<5)-t+e.charCodeAt(r++)|0;return"".concat(this._Value_Prefix_StringHash).concat(t)}},{key:"cleanEnclosureWrapCharacters",value:function(e,t){return t.startsWith(e)&&t.endsWith(e)?t.substring(1,t.length-1):t}},{key:"cleanNonAlphaCharacters",value:function(e){if("string"==typeof e&&""!=e)return e.replace(this._Regex_formatterCleanNonAlpha,this._Value_Clean_formatterCleanNonAlpha)}},{key:"formatterInsertCommas",value:function(e){var t=this.stringReverse(e).match(this._Regex_formatterInsertCommas).join(",");return this.stringReverse(t)}},{key:"processAddCommasToNumberRegex",value:function(e,t,n,r,i,o){return t+(i?this.formatterInsertCommas(r)+i+o:this.formatterInsertCommas(r+o))}},{key:"formatterAddCommasToNumber",value:function(e){return e.toString().replace(this._Regex_formatterAddCommasToNumber,this.processAddCommasToNumberRegex.bind(this))}},{key:"formatterDollars",value:function(e){var t=parseFloat(e).toFixed(2);return isNaN(t)&&("string"==typeof e&&(t=parseFloat(e.replace(this._Value_MoneySign_Currency,"").replace(this._Regex_formatterDollarsRemoveCommas,"")).toFixed(2)),isNaN(t))?this._Value_NaN_Currency:"$".concat(this.formatterAddCommasToNumber(t))}},{key:"formatterRoundNumber",value:function(e,t){var n=void 0===t?2:t,r=parseFloat(e).toFixed(n);if(isNaN(r)){return(0).toFixed(n)}return r}},{key:"stringBeforeMatch",value:function(e,t){return e.split(t)[0]}},{key:"stringAfterMatch",value:function(e,t){var n=e.indexOf(t);return n<0||n+t.length>=e.length?"":e.substring(n+t.length)}},{key:"stringCountEnclosures",value:function(e,t,n){for(var r="string"==typeof e?e:"",i="string"==typeof t?t:"(",o="string"==typeof n?n:")",a=0,s=0,u=0;u<r.length;u++)r[u]==i?(0==s&&a++,s++):r[u]==o&&s--;return a}},{key:"stringGetEnclosureValueByIndex",value:function(e,t,n,r){for(var i="string"==typeof e?e:"",o="number"==typeof t?t:0,a="string"==typeof n?n:"(",s="string"==typeof r?r:")",u=0,c=0,l=!1,p=0,f=0,h=0;h<i.length;h++)i[h]==a?1==++c&&o==++u-1&&(l=!0,p=h):i[h]==s&&0==--c&&l&&f<=p&&(f=h,l=!1);return u<=o?"":f>0&&f>p?i.substring(p+1,f):i.substring(p+1)}},{key:"stringRemoveEnclosureByIndex",value:function(e,t,n,r){for(var i="string"==typeof e?e:"",o="number"==typeof t?t:0,a="string"==typeof n?n:"(",s="string"==typeof r?r:")",u=0,c=0,l=!1,p=0,f=0,h=0;h<i.length;h++)i[h]==a?1==++c&&o==++u-1&&(l=!0,p=h):i[h]==s&&0==--c&&l&&f<=p&&(f=h,l=!1);if(u<=o)return i;var d="";return p>1&&(d=i.substring(0,p)),i.length>f+1&&f>p&&(d+=i.substring(f+1)),d}}]),e}();t.exports=r},{}],21:[function(e,t,n){!function(e){
|
|
27
|
+
/*!
|
|
28
|
+
* decimal.js v10.4.3
|
|
29
|
+
* An arbitrary-precision Decimal type for JavaScript.
|
|
30
|
+
* https://github.com/MikeMcl/decimal.js
|
|
31
|
+
* Copyright (c) 2022 Michael Mclaughlin <M8ch88l@gmail.com>
|
|
32
|
+
* MIT Licence
|
|
33
|
+
*/
|
|
34
|
+
var n,r,i,o,a=9e15,s=1e9,u="0123456789abcdef",c="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",l="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",p={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-a,maxE:a,crypto:!1},f=!0,h="[DecimalError] ",d=h+"Invalid argument: ",g=h+"Precision limit exceeded",y=h+"crypto unavailable",v="[object Decimal]",m=Math.floor,b=Math.pow,O=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,S=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,x=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,w=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,_=1e7,j=7,N=c.length-1,D=l.length-1,T={toStringTag:v};function k(e){var t,n,r,i=e.length-1,o="",a=e[0];if(i>0){for(o+=a,t=1;t<i;t++)r=e[t]+"",(n=j-r.length)&&(o+=F(n)),o+=r;a=e[t],(n=j-(r=a+"").length)&&(o+=F(n))}else if(0===a)return"0";for(;a%10==0;)a/=10;return o+a}function I(e,t,n){if(e!==~~e||e<t||e>n)throw Error(d+e)}function C(e,t,n,r){var i,o,a,s;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=j,i=0):(i=Math.ceil((t+1)/j),t%=j),o=b(10,j-t),s=e[i]%o|0,null==r?t<3?(0==t?s=s/100|0:1==t&&(s=s/10|0),a=n<4&&99999==s||n>3&&49999==s||5e4==s||0==s):a=(n<4&&s+1==o||n>3&&s+1==o/2)&&(e[i+1]/o/100|0)==b(10,t-2)-1||(s==o/2||0==s)&&0==(e[i+1]/o/100|0):t<4?(0==t?s=s/1e3|0:1==t?s=s/100|0:2==t&&(s=s/10|0),a=(r||n<4)&&9999==s||!r&&n>3&&4999==s):a=((r||n<4)&&s+1==o||!r&&n>3&&s+1==o/2)&&(e[i+1]/o/1e3|0)==b(10,t-3)-1,a}function A(e,t,n){for(var r,i,o=[0],a=0,s=e.length;a<s;){for(i=o.length;i--;)o[i]*=t;for(o[0]+=u.indexOf(e.charAt(a++)),r=0;r<o.length;r++)o[r]>n-1&&(void 0===o[r+1]&&(o[r+1]=0),o[r+1]+=o[r]/n|0,o[r]%=n)}return o.reverse()}T.absoluteValue=T.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),E(e)},T.ceil=function(){return E(new this.constructor(this),this.e+1,2)},T.clampedTo=T.clamp=function(e,t){var n=this,r=n.constructor;if(e=new r(e),t=new r(t),!e.s||!t.s)return new r(NaN);if(e.gt(t))throw Error(d+t);return n.cmp(e)<0?e:n.cmp(t)>0?t:new r(n)},T.comparedTo=T.cmp=function(e){var t,n,r,i,o=this,a=o.d,s=(e=new o.constructor(e)).d,u=o.s,c=e.s;if(!a||!s)return u&&c?u!==c?u:a===s?0:!a^u<0?1:-1:NaN;if(!a[0]||!s[0])return a[0]?u:s[0]?-c:0;if(u!==c)return u;if(o.e!==e.e)return o.e>e.e^u<0?1:-1;for(t=0,n=(r=a.length)<(i=s.length)?r:i;t<n;++t)if(a[t]!==s[t])return a[t]>s[t]^u<0?1:-1;return r===i?0:r>i^u<0?1:-1},T.cosine=T.cos=function(){var e,t,n=this,r=n.constructor;return n.d?n.d[0]?(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+j,r.rounding=1,n=function(e,t){var n,r,i;if(t.isZero())return t;r=t.d.length,r<32?i=(1/X(4,n=Math.ceil(r/3))).toString():(n=16,i="2.3283064365386962890625e-10");e.precision+=n,t=K(e,1,t.times(i),new e(1));for(var o=n;o--;){var a=t.times(t);t=a.times(a).minus(a).times(8).plus(1)}return e.precision-=n,t}(r,Z(r,n)),r.precision=e,r.rounding=t,E(2==o||3==o?n.neg():n,e,t,!0)):new r(1):new r(NaN)},T.cubeRoot=T.cbrt=function(){var e,t,n,r,i,o,a,s,u,c,l=this,p=l.constructor;if(!l.isFinite()||l.isZero())return new p(l);for(f=!1,(o=l.s*b(l.s*l,1/3))&&Math.abs(o)!=1/0?r=new p(o.toString()):(n=k(l.d),(o=((e=l.e)-n.length+1)%3)&&(n+=1==o||-2==o?"0":"00"),o=b(n,1/3),e=m((e+1)/3)-(e%3==(e<0?-1:2)),(r=new p(n=o==1/0?"5e"+e:(n=o.toExponential()).slice(0,n.indexOf("e")+1)+e)).s=l.s),a=(e=p.precision)+3;;)if(c=(u=(s=r).times(s).times(s)).plus(l),r=P(c.plus(l).times(s),c.plus(u),a+2,1),k(s.d).slice(0,a)===(n=k(r.d)).slice(0,a)){if("9999"!=(n=n.slice(a-3,a+1))&&(i||"4999"!=n)){+n&&(+n.slice(1)||"5"!=n.charAt(0))||(E(r,e+1,1),t=!r.times(r).times(r).eq(l));break}if(!i&&(E(s,e+1,0),s.times(s).times(s).eq(l))){r=s;break}a+=4,i=1}return f=!0,E(r,e,p.rounding,t)},T.decimalPlaces=T.dp=function(){var e,t=this.d,n=NaN;if(t){if(n=((e=t.length-1)-m(this.e/j))*j,e=t[e])for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n},T.dividedBy=T.div=function(e){return P(this,new this.constructor(e))},T.dividedToIntegerBy=T.divToInt=function(e){var t=this.constructor;return E(P(this,new t(e),0,1,1),t.precision,t.rounding)},T.equals=T.eq=function(e){return 0===this.cmp(e)},T.floor=function(){return E(new this.constructor(this),this.e+1,3)},T.greaterThan=T.gt=function(e){return this.cmp(e)>0},T.greaterThanOrEqualTo=T.gte=function(e){var t=this.cmp(e);return 1==t||0===t},T.hyperbolicCosine=T.cosh=function(){var e,t,n,r,i,o=this,a=o.constructor,s=new a(1);if(!o.isFinite())return new a(o.s?1/0:NaN);if(o.isZero())return s;n=a.precision,r=a.rounding,a.precision=n+Math.max(o.e,o.sd())+4,a.rounding=1,(i=o.d.length)<32?t=(1/X(4,e=Math.ceil(i/3))).toString():(e=16,t="2.3283064365386962890625e-10"),o=K(a,1,o.times(t),new a(1),!0);for(var u,c=e,l=new a(8);c--;)u=o.times(o),o=s.minus(u.times(l.minus(u.times(l))));return E(o,a.precision=n,a.rounding=r,!0)},T.hyperbolicSine=T.sinh=function(){var e,t,n,r,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,n=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,(r=i.d.length)<3)i=K(o,2,i,i,!0);else{e=(e=1.4*Math.sqrt(r))>16?16:0|e,i=K(o,2,i=i.times(1/X(5,e)),i,!0);for(var a,s=new o(5),u=new o(16),c=new o(20);e--;)a=i.times(i),i=i.times(s.plus(a.times(u.times(a).plus(c))))}return o.precision=t,o.rounding=n,E(i,t,n,!0)},T.hyperbolicTangent=T.tanh=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+7,r.rounding=1,P(n.sinh(),n.cosh(),r.precision=e,r.rounding=t)):new r(n.s)},T.inverseCosine=T.acos=function(){var e,t=this,n=t.constructor,r=t.abs().cmp(1),i=n.precision,o=n.rounding;return-1!==r?0===r?t.isNeg()?R(n,i,o):new n(0):new n(NaN):t.isZero()?R(n,i+4,o).times(.5):(n.precision=i+6,n.rounding=1,t=t.asin(),e=R(n,i+4,o).times(.5),n.precision=i,n.rounding=o,e.minus(t))},T.inverseHyperbolicCosine=T.acosh=function(){var e,t,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(e=r.precision,t=r.rounding,r.precision=e+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,f=!1,n=n.times(n).minus(1).sqrt().plus(n),f=!0,r.precision=e,r.rounding=t,n.ln()):new r(n)},T.inverseHyperbolicSine=T.asinh=function(){var e,t,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,f=!1,n=n.times(n).plus(1).sqrt().plus(n),f=!0,r.precision=e,r.rounding=t,n.ln())},T.inverseHyperbolicTangent=T.atanh=function(){var e,t,n,r,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,r=i.sd(),Math.max(r,e)<2*-i.e-1?E(new o(i),e,t,!0):(o.precision=n=r-i.e,i=P(i.plus(1),new o(1).minus(i),n+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)},T.inverseSine=T.asin=function(){var e,t,n,r,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),n=o.precision,r=o.rounding,-1!==t?0===t?((e=R(o,n+4,r).times(.5)).s=i.s,e):new o(NaN):(o.precision=n+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=n,o.rounding=r,i.times(2)))},T.inverseTangent=T.atan=function(){var e,t,n,r,i,o,a,s,u,c=this,l=c.constructor,p=l.precision,h=l.rounding;if(c.isFinite()){if(c.isZero())return new l(c);if(c.abs().eq(1)&&p+4<=D)return(a=R(l,p+4,h).times(.25)).s=c.s,a}else{if(!c.s)return new l(NaN);if(p+4<=D)return(a=R(l,p+4,h).times(.5)).s=c.s,a}for(l.precision=s=p+10,l.rounding=1,e=n=Math.min(28,s/j+2|0);e;--e)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(f=!1,t=Math.ceil(s/j),r=1,u=c.times(c),a=new l(c),i=c;-1!==e;)if(i=i.times(u),o=a.minus(i.div(r+=2)),i=i.times(u),void 0!==(a=o.plus(i.div(r+=2))).d[t])for(e=t;a.d[e]===o.d[e]&&e--;);return n&&(a=a.times(2<<n-1)),f=!0,E(a,l.precision=p,l.rounding=h,!0)},T.isFinite=function(){return!!this.d},T.isInteger=T.isInt=function(){return!!this.d&&m(this.e/j)>this.d.length-2},T.isNaN=function(){return!this.s},T.isNegative=T.isNeg=function(){return this.s<0},T.isPositive=T.isPos=function(){return this.s>0},T.isZero=function(){return!!this.d&&0===this.d[0]},T.lessThan=T.lt=function(e){return this.cmp(e)<0},T.lessThanOrEqualTo=T.lte=function(e){return this.cmp(e)<1},T.logarithm=T.log=function(e){var t,n,r,i,o,a,s,u,c=this,l=c.constructor,p=l.precision,h=l.rounding;if(null==e)e=new l(10),t=!0;else{if(n=(e=new l(e)).d,e.s<0||!n||!n[0]||e.eq(1))return new l(NaN);t=e.eq(10)}if(n=c.d,c.s<0||!n||!n[0]||c.eq(1))return new l(n&&!n[0]?-1/0:1!=c.s?NaN:n?0:1/0);if(t)if(n.length>1)o=!0;else{for(i=n[0];i%10==0;)i/=10;o=1!==i}if(f=!1,a=G(c,s=p+5),r=t?H(l,s+10):G(e,s),C((u=P(a,r,s,1)).d,i=p,h))do{if(a=G(c,s+=10),r=t?H(l,s+10):G(e,s),u=P(a,r,s,1),!o){+k(u.d).slice(i+1,i+15)+1==1e14&&(u=E(u,p+1,0));break}}while(C(u.d,i+=10,h));return f=!0,E(u,p,h)},T.minus=T.sub=function(e){var t,n,r,i,o,a,s,u,c,l,p,h,d=this,g=d.constructor;if(e=new g(e),!d.d||!e.d)return d.s&&e.s?d.d?e.s=-e.s:e=new g(e.d||d.s!==e.s?d:NaN):e=new g(NaN),e;if(d.s!=e.s)return e.s=-e.s,d.plus(e);if(c=d.d,h=e.d,s=g.precision,u=g.rounding,!c[0]||!h[0]){if(h[0])e.s=-e.s;else{if(!c[0])return new g(3===u?-0:0);e=new g(d)}return f?E(e,s,u):e}if(n=m(e.e/j),l=m(d.e/j),c=c.slice(),o=l-n){for((p=o<0)?(t=c,o=-o,a=h.length):(t=h,n=l,a=c.length),o>(r=Math.max(Math.ceil(s/j),a)+2)&&(o=r,t.length=1),t.reverse(),r=o;r--;)t.push(0);t.reverse()}else{for((p=(r=c.length)<(a=h.length))&&(a=r),r=0;r<a;r++)if(c[r]!=h[r]){p=c[r]<h[r];break}o=0}for(p&&(t=c,c=h,h=t,e.s=-e.s),a=c.length,r=h.length-a;r>0;--r)c[a++]=0;for(r=h.length;r>o;){if(c[--r]<h[r]){for(i=r;i&&0===c[--i];)c[i]=_-1;--c[i],c[r]+=_}c[r]-=h[r]}for(;0===c[--a];)c.pop();for(;0===c[0];c.shift())--n;return c[0]?(e.d=c,e.e=L(c,n),f?E(e,s,u):e):new g(3===u?-0:0)},T.modulo=T.mod=function(e){var t,n=this,r=n.constructor;return e=new r(e),!n.d||!e.s||e.d&&!e.d[0]?new r(NaN):!e.d||n.d&&!n.d[0]?E(new r(n),r.precision,r.rounding):(f=!1,9==r.modulo?(t=P(n,e.abs(),0,3,1)).s*=e.s:t=P(n,e,0,r.modulo,1),t=t.times(e),f=!0,n.minus(t))},T.naturalExponential=T.exp=function(){return W(this)},T.naturalLogarithm=T.ln=function(){return G(this)},T.negated=T.neg=function(){var e=new this.constructor(this);return e.s=-e.s,E(e)},T.plus=T.add=function(e){var t,n,r,i,o,a,s,u,c,l,p=this,h=p.constructor;if(e=new h(e),!p.d||!e.d)return p.s&&e.s?p.d||(e=new h(e.d||p.s===e.s?p:NaN)):e=new h(NaN),e;if(p.s!=e.s)return e.s=-e.s,p.minus(e);if(c=p.d,l=e.d,s=h.precision,u=h.rounding,!c[0]||!l[0])return l[0]||(e=new h(p)),f?E(e,s,u):e;if(o=m(p.e/j),r=m(e.e/j),c=c.slice(),i=o-r){for(i<0?(n=c,i=-i,a=l.length):(n=l,r=o,a=c.length),i>(a=(o=Math.ceil(s/j))>a?o+1:a+1)&&(i=a,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for((a=c.length)-(i=l.length)<0&&(i=a,n=l,l=c,c=n),t=0;i;)t=(c[--i]=c[i]+l[i]+t)/_|0,c[i]%=_;for(t&&(c.unshift(t),++r),a=c.length;0==c[--a];)c.pop();return e.d=c,e.e=L(c,r),f?E(e,s,u):e},T.precision=T.sd=function(e){var t,n=this;if(void 0!==e&&e!==!!e&&1!==e&&0!==e)throw Error(d+e);return n.d?(t=V(n.d),e&&n.e+1>t&&(t=n.e+1)):t=NaN,t},T.round=function(){var e=this,t=e.constructor;return E(new t(e),e.e+1,t.rounding)},T.sine=T.sin=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+j,r.rounding=1,n=function(e,t){var n,r=t.d.length;if(r<3)return t.isZero()?t:K(e,2,t,t);n=(n=1.4*Math.sqrt(r))>16?16:0|n,t=t.times(1/X(5,n)),t=K(e,2,t,t);for(var i,o=new e(5),a=new e(16),s=new e(20);n--;)i=t.times(t),t=t.times(o.plus(i.times(a.times(i).minus(s))));return t}(r,Z(r,n)),r.precision=e,r.rounding=t,E(o>2?n.neg():n,e,t,!0)):new r(NaN)},T.squareRoot=T.sqrt=function(){var e,t,n,r,i,o,a=this,s=a.d,u=a.e,c=a.s,l=a.constructor;if(1!==c||!s||!s[0])return new l(!c||c<0&&(!s||s[0])?NaN:s?a:1/0);for(f=!1,0==(c=Math.sqrt(+a))||c==1/0?(((t=k(s)).length+u)%2==0&&(t+="0"),c=Math.sqrt(t),u=m((u+1)/2)-(u<0||u%2),r=new l(t=c==1/0?"5e"+u:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+u)):r=new l(c.toString()),n=(u=l.precision)+3;;)if(r=(o=r).plus(P(a,o,n+2,1)).times(.5),k(o.d).slice(0,n)===(t=k(r.d)).slice(0,n)){if("9999"!=(t=t.slice(n-3,n+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(E(r,u+1,1),e=!r.times(r).eq(a));break}if(!i&&(E(o,u+1,0),o.times(o).eq(a))){r=o;break}n+=4,i=1}return f=!0,E(r,u,l.rounding,e)},T.tangent=T.tan=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+10,r.rounding=1,(n=n.sin()).s=1,n=P(n,new r(1).minus(n.times(n)).sqrt(),e+10,0),r.precision=e,r.rounding=t,E(2==o||4==o?n.neg():n,e,t,!0)):new r(NaN)},T.times=T.mul=function(e){var t,n,r,i,o,a,s,u,c,l=this,p=l.constructor,h=l.d,d=(e=new p(e)).d;if(e.s*=l.s,!(h&&h[0]&&d&&d[0]))return new p(!e.s||h&&!h[0]&&!d||d&&!d[0]&&!h?NaN:h&&d?0*e.s:e.s/0);for(n=m(l.e/j)+m(e.e/j),(u=h.length)<(c=d.length)&&(o=h,h=d,d=o,a=u,u=c,c=a),o=[],r=a=u+c;r--;)o.push(0);for(r=c;--r>=0;){for(t=0,i=u+r;i>r;)s=o[i]+d[r]*h[i-r-1]+t,o[i--]=s%_|0,t=s/_|0;o[i]=(o[i]+t)%_|0}for(;!o[--a];)o.pop();return t?++n:o.shift(),e.d=o,e.e=L(o,n),f?E(e,p.precision,p.rounding):e},T.toBinary=function(e,t){return Y(this,2,e,t)},T.toDecimalPlaces=T.toDP=function(e,t){var n=this,r=n.constructor;return n=new r(n),void 0===e?n:(I(e,0,s),void 0===t?t=r.rounding:I(t,0,8),E(n,e+n.e+1,t))},T.toExponential=function(e,t){var n,r=this,i=r.constructor;return void 0===e?n=M(r,!0):(I(e,0,s),void 0===t?t=i.rounding:I(t,0,8),n=M(r=E(new i(r),e+1,t),!0,e+1)),r.isNeg()&&!r.isZero()?"-"+n:n},T.toFixed=function(e,t){var n,r,i=this,o=i.constructor;return void 0===e?n=M(i):(I(e,0,s),void 0===t?t=o.rounding:I(t,0,8),n=M(r=E(new o(i),e+i.e+1,t),!1,e+r.e+1)),i.isNeg()&&!i.isZero()?"-"+n:n},T.toFraction=function(e){var t,n,r,i,o,a,s,u,c,l,p,h,g=this,y=g.d,v=g.constructor;if(!y)return new v(g);if(c=n=new v(1),r=u=new v(0),a=(o=(t=new v(r)).e=V(y)-g.e-1)%j,t.d[0]=b(10,a<0?j+a:a),null==e)e=o>0?t:c;else{if(!(s=new v(e)).isInt()||s.lt(c))throw Error(d+s);e=s.gt(t)?o>0?t:c:s}for(f=!1,s=new v(k(y)),l=v.precision,v.precision=o=y.length*j*2;p=P(s,t,0,1,1),1!=(i=n.plus(p.times(r))).cmp(e);)n=r,r=i,i=c,c=u.plus(p.times(i)),u=i,i=t,t=s.minus(p.times(i)),s=i;return i=P(e.minus(n),r,0,1,1),u=u.plus(i.times(c)),n=n.plus(i.times(r)),u.s=c.s=g.s,h=P(c,r,o,1).minus(g).abs().cmp(P(u,n,o,1).minus(g).abs())<1?[c,r]:[u,n],v.precision=l,f=!0,h},T.toHexadecimal=T.toHex=function(e,t){return Y(this,16,e,t)},T.toNearest=function(e,t){var n=this,r=n.constructor;if(n=new r(n),null==e){if(!n.d)return n;e=new r(1),t=r.rounding}else{if(e=new r(e),void 0===t?t=r.rounding:I(t,0,8),!n.d)return e.s?n:e;if(!e.d)return e.s&&(e.s=n.s),e}return e.d[0]?(f=!1,n=P(n,e,0,t,1).times(e),f=!0,E(n)):(e.s=n.s,n=e),n},T.toNumber=function(){return+this},T.toOctal=function(e,t){return Y(this,8,e,t)},T.toPower=T.pow=function(e){var t,n,r,i,o,a,s=this,u=s.constructor,c=+(e=new u(e));if(!(s.d&&e.d&&s.d[0]&&e.d[0]))return new u(b(+s,c));if((s=new u(s)).eq(1))return s;if(r=u.precision,o=u.rounding,e.eq(1))return E(s,r,o);if((t=m(e.e/j))>=e.d.length-1&&(n=c<0?-c:c)<=9007199254740991)return i=U(u,s,n,r),e.s<0?new u(1).div(i):E(i,r,o);if((a=s.s)<0){if(t<e.d.length-1)return new u(NaN);if(0==(1&e.d[t])&&(a=1),0==s.e&&1==s.d[0]&&1==s.d.length)return s.s=a,s}return(t=0!=(n=b(+s,c))&&isFinite(n)?new u(n+"").e:m(c*(Math.log("0."+k(s.d))/Math.LN10+s.e+1)))>u.maxE+1||t<u.minE-1?new u(t>0?a/0:0):(f=!1,u.rounding=s.s=1,n=Math.min(12,(t+"").length),(i=W(e.times(G(s,r+n)),r)).d&&C((i=E(i,r+5,1)).d,r,o)&&(t=r+10,+k((i=E(W(e.times(G(s,t+n)),t),t+5,1)).d).slice(r+1,r+15)+1==1e14&&(i=E(i,r+1,0))),i.s=a,f=!0,u.rounding=o,E(i,r,o))},T.toPrecision=function(e,t){var n,r=this,i=r.constructor;return void 0===e?n=M(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(I(e,1,s),void 0===t?t=i.rounding:I(t,0,8),n=M(r=E(new i(r),e,t),e<=r.e||r.e<=i.toExpNeg,e)),r.isNeg()&&!r.isZero()?"-"+n:n},T.toSignificantDigits=T.toSD=function(e,t){var n=this.constructor;return void 0===e?(e=n.precision,t=n.rounding):(I(e,1,s),void 0===t?t=n.rounding:I(t,0,8)),E(new n(this),e,t)},T.toString=function(){var e=this,t=e.constructor,n=M(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+n:n},T.truncated=T.trunc=function(){return E(new this.constructor(this),this.e+1,1)},T.valueOf=T.toJSON=function(){var e=this,t=e.constructor,n=M(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+n:n};var P=function(){function e(e,t,n){var r,i=0,o=e.length;for(e=e.slice();o--;)r=e[o]*t+i,e[o]=r%n|0,i=r/n|0;return i&&e.unshift(i),e}function t(e,t,n,r){var i,o;if(n!=r)o=n>r?1:-1;else for(i=o=0;i<n;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=e[n]<t[n]?1:0,e[n]=i*r+e[n]-t[n];for(;!e[0]&&e.length>1;)e.shift()}return function(i,o,a,s,u,c){var l,p,f,h,d,g,y,v,b,O,S,x,w,N,D,T,k,I,C,A,P=i.constructor,M=i.s==o.s?1:-1,L=i.d,H=o.d;if(!(L&&L[0]&&H&&H[0]))return new P(i.s&&o.s&&(L?!H||L[0]!=H[0]:H)?L&&0==L[0]||!H?0*M:M/0:NaN);for(c?(d=1,p=i.e-o.e):(c=_,d=j,p=m(i.e/d)-m(o.e/d)),C=H.length,k=L.length,O=(b=new P(M)).d=[],f=0;H[f]==(L[f]||0);f++);if(H[f]>(L[f]||0)&&p--,null==a?(N=a=P.precision,s=P.rounding):N=u?a+(i.e-o.e)+1:a,N<0)O.push(1),g=!0;else{if(N=N/d+2|0,f=0,1==C){for(h=0,H=H[0],N++;(f<k||h)&&N--;f++)D=h*c+(L[f]||0),O[f]=D/H|0,h=D%H|0;g=h||f<k}else{for((h=c/(H[0]+1)|0)>1&&(H=e(H,h,c),L=e(L,h,c),C=H.length,k=L.length),T=C,x=(S=L.slice(0,C)).length;x<C;)S[x++]=0;(A=H.slice()).unshift(0),I=H[0],H[1]>=c/2&&++I;do{h=0,(l=t(H,S,C,x))<0?(w=S[0],C!=x&&(w=w*c+(S[1]||0)),(h=w/I|0)>1?(h>=c&&(h=c-1),1==(l=t(y=e(H,h,c),S,v=y.length,x=S.length))&&(h--,n(y,C<v?A:H,v,c))):(0==h&&(l=h=1),y=H.slice()),(v=y.length)<x&&y.unshift(0),n(S,y,x,c),-1==l&&(l=t(H,S,C,x=S.length))<1&&(h++,n(S,C<x?A:H,x,c)),x=S.length):0===l&&(h++,S=[0]),O[f++]=h,l&&S[0]?S[x++]=L[T]||0:(S=[L[T]],x=1)}while((T++<k||void 0!==S[0])&&N--);g=void 0!==S[0]}O[0]||O.shift()}if(1==d)b.e=p,r=g;else{for(f=1,h=O[0];h>=10;h/=10)f++;b.e=f+p*d-1,E(b,u?a+b.e+1:a,s,g)}return b}}();function E(e,t,n,r){var i,o,a,s,u,c,l,p,h,d=e.constructor;e:if(null!=t){if(!(p=e.d))return e;for(i=1,s=p[0];s>=10;s/=10)i++;if((o=t-i)<0)o+=j,a=t,u=(l=p[h=0])/b(10,i-a-1)%10|0;else if((h=Math.ceil((o+1)/j))>=(s=p.length)){if(!r)break e;for(;s++<=h;)p.push(0);l=u=0,i=1,a=(o%=j)-j+1}else{for(l=s=p[h],i=1;s>=10;s/=10)i++;u=(a=(o%=j)-j+i)<0?0:l/b(10,i-a-1)%10|0}if(r=r||t<0||void 0!==p[h+1]||(a<0?l:l%b(10,i-a-1)),c=n<4?(u||r)&&(0==n||n==(e.s<0?3:2)):u>5||5==u&&(4==n||r||6==n&&(o>0?a>0?l/b(10,i-a):0:p[h-1])%10&1||n==(e.s<0?8:7)),t<1||!p[0])return p.length=0,c?(t-=e.e+1,p[0]=b(10,(j-t%j)%j),e.e=-t||0):p[0]=e.e=0,e;if(0==o?(p.length=h,s=1,h--):(p.length=h+1,s=b(10,j-o),p[h]=a>0?(l/b(10,i-a)%b(10,a)|0)*s:0),c)for(;;){if(0==h){for(o=1,a=p[0];a>=10;a/=10)o++;for(a=p[0]+=s,s=1;a>=10;a/=10)s++;o!=s&&(e.e++,p[0]==_&&(p[0]=1));break}if(p[h]+=s,p[h]!=_)break;p[h--]=0,s=1}for(o=p.length;0===p[--o];)p.pop()}return f&&(e.e>d.maxE?(e.d=null,e.e=NaN):e.e<d.minE&&(e.e=0,e.d=[0])),e}function M(e,t,n){if(!e.isFinite())return J(e);var r,i=e.e,o=k(e.d),a=o.length;return t?(n&&(r=n-a)>0?o=o.charAt(0)+"."+o.slice(1)+F(r):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+F(-i-1)+o,n&&(r=n-a)>0&&(o+=F(r))):i>=a?(o+=F(i+1-a),n&&(r=n-i-1)>0&&(o=o+"."+F(r))):((r=i+1)<a&&(o=o.slice(0,r)+"."+o.slice(r)),n&&(r=n-a)>0&&(i+1===a&&(o+="."),o+=F(r))),o}function L(e,t){var n=e[0];for(t*=j;n>=10;n/=10)t++;return t}function H(e,t,n){if(t>N)throw f=!0,n&&(e.precision=n),Error(g);return E(new e(c),t,1,!0)}function R(e,t,n){if(t>D)throw Error(g);return E(new e(l),t,n,!0)}function V(e){var t=e.length-1,n=t*j+1;if(t=e[t]){for(;t%10==0;t/=10)n--;for(t=e[0];t>=10;t/=10)n++}return n}function F(e){for(var t="";e--;)t+="0";return t}function U(e,t,n,r){var i,o=new e(1),a=Math.ceil(r/j+4);for(f=!1;;){if(n%2&&Q((o=o.times(t)).d,a)&&(i=!0),0===(n=m(n/2))){n=o.d.length-1,i&&0===o.d[n]&&++o.d[n];break}Q((t=t.times(t)).d,a)}return f=!0,o}function B(e){return 1&e.d[e.d.length-1]}function q(e,t,n){for(var r,i=new e(t[0]),o=0;++o<t.length;){if(!(r=new e(t[o])).s){i=r;break}i[n](r)&&(i=r)}return i}function W(e,t){var n,r,i,o,a,s,u,c=0,l=0,p=0,h=e.constructor,d=h.rounding,g=h.precision;if(!e.d||!e.d[0]||e.e>17)return new h(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(null==t?(f=!1,u=g):u=t,s=new h(.03125);e.e>-2;)e=e.times(s),p+=5;for(u+=r=Math.log(b(2,p))/Math.LN10*2+5|0,n=o=a=new h(1),h.precision=u;;){if(o=E(o.times(e),u,1),n=n.times(++l),k((s=a.plus(P(o,n,u,1))).d).slice(0,u)===k(a.d).slice(0,u)){for(i=p;i--;)a=E(a.times(a),u,1);if(null!=t)return h.precision=g,a;if(!(c<3&&C(a.d,u-r,d,c)))return E(a,h.precision=g,d,f=!0);h.precision=u+=10,n=o=s=new h(1),l=0,c++}a=s}}function G(e,t){var n,r,i,o,a,s,u,c,l,p,h,d=1,g=e,y=g.d,v=g.constructor,m=v.rounding,b=v.precision;if(g.s<0||!y||!y[0]||!g.e&&1==y[0]&&1==y.length)return new v(y&&!y[0]?-1/0:1!=g.s?NaN:y?0:g);if(null==t?(f=!1,l=b):l=t,v.precision=l+=10,r=(n=k(y)).charAt(0),!(Math.abs(o=g.e)<15e14))return c=H(v,l+2,b).times(o+""),g=G(new v(r+"."+n.slice(1)),l-10).plus(c),v.precision=b,null==t?E(g,b,m,f=!0):g;for(;r<7&&1!=r||1==r&&n.charAt(1)>3;)r=(n=k((g=g.times(e)).d)).charAt(0),d++;for(o=g.e,r>1?(g=new v("0."+n),o++):g=new v(r+"."+n.slice(1)),p=g,u=a=g=P(g.minus(1),g.plus(1),l,1),h=E(g.times(g),l,1),i=3;;){if(a=E(a.times(h),l,1),k((c=u.plus(P(a,new v(i),l,1))).d).slice(0,l)===k(u.d).slice(0,l)){if(u=u.times(2),0!==o&&(u=u.plus(H(v,l+2,b).times(o+""))),u=P(u,new v(d),l,1),null!=t)return v.precision=b,u;if(!C(u.d,l-10,m,s))return E(u,v.precision=b,m,f=!0);v.precision=l+=10,c=a=g=P(p.minus(1),p.plus(1),l,1),h=E(g.times(g),l,1),i=s=1}u=c,i+=2}}function J(e){return String(e.s*e.s/0)}function z(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;48===t.charCodeAt(r);r++);for(i=t.length;48===t.charCodeAt(i-1);--i);if(t=t.slice(r,i)){if(i-=r,e.e=n=n-r-1,e.d=[],r=(n+1)%j,n<0&&(r+=j),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=j;r<i;)e.d.push(+t.slice(r,r+=j));t=t.slice(r),r=j-t.length}else r-=i;for(;r--;)t+="0";e.d.push(+t),f&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function $(e,t){var r,i,o,a,s,u,c,l,p;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),w.test(t))return z(e,t)}else if("Infinity"===t||"NaN"===t)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(S.test(t))r=16,t=t.toLowerCase();else if(O.test(t))r=2;else{if(!x.test(t))throw Error(d+t);r=8}for((a=t.search(/p/i))>0?(c=+t.slice(a+1),t=t.substring(2,a)):t=t.slice(2),s=(a=t.indexOf("."))>=0,i=e.constructor,s&&(a=(u=(t=t.replace(".","")).length)-a,o=U(i,new i(r),a,2*a)),a=p=(l=A(t,r,_)).length-1;0===l[a];--a)l.pop();return a<0?new i(0*e.s):(e.e=L(l,p),e.d=l,f=!1,s&&(e=P(e,o,4*u)),c&&(e=e.times(Math.abs(c)<54?b(2,c):n.pow(2,c))),f=!0,e)}function K(e,t,n,r,i){var o,a,s,u,c=e.precision,l=Math.ceil(c/j);for(f=!1,u=n.times(n),s=new e(r);;){if(a=P(s.times(u),new e(t++*t++),c,1),s=i?r.plus(a):r.minus(a),r=P(a.times(u),new e(t++*t++),c,1),void 0!==(a=s.plus(r)).d[l]){for(o=l;a.d[o]===s.d[o]&&o--;);if(-1==o)break}o=s,s=r,r=a,a=o}return f=!0,a.d.length=l+1,a}function X(e,t){for(var n=e;--t;)n*=e;return n}function Z(e,t){var n,r=t.s<0,i=R(e,e.precision,1),a=i.times(.5);if((t=t.abs()).lte(a))return o=r?4:1,t;if((n=t.divToInt(i)).isZero())o=r?3:2;else{if((t=t.minus(n.times(i))).lte(a))return o=B(n)?r?2:3:r?4:1,t;o=B(n)?r?1:4:r?3:2}return t.minus(i).abs()}function Y(e,t,n,i){var o,a,c,l,p,f,h,d,g,y=e.constructor,v=void 0!==n;if(v?(I(n,1,s),void 0===i?i=y.rounding:I(i,0,8)):(n=y.precision,i=y.rounding),e.isFinite()){for(v?(o=2,16==t?n=4*n-3:8==t&&(n=3*n-2)):o=t,(c=(h=M(e)).indexOf("."))>=0&&(h=h.replace(".",""),(g=new y(1)).e=h.length-c,g.d=A(M(g),10,o),g.e=g.d.length),a=p=(d=A(h,10,o)).length;0==d[--p];)d.pop();if(d[0]){if(c<0?a--:((e=new y(e)).d=d,e.e=a,d=(e=P(e,g,n,i,0,o)).d,a=e.e,f=r),c=d[n],l=o/2,f=f||void 0!==d[n+1],f=i<4?(void 0!==c||f)&&(0===i||i===(e.s<0?3:2)):c>l||c===l&&(4===i||f||6===i&&1&d[n-1]||i===(e.s<0?8:7)),d.length=n,f)for(;++d[--n]>o-1;)d[n]=0,n||(++a,d.unshift(1));for(p=d.length;!d[p-1];--p);for(c=0,h="";c<p;c++)h+=u.charAt(d[c]);if(v){if(p>1)if(16==t||8==t){for(c=16==t?4:3,--p;p%c;p++)h+="0";for(p=(d=A(h,o,t)).length;!d[p-1];--p);for(c=1,h="1.";c<p;c++)h+=u.charAt(d[c])}else h=h.charAt(0)+"."+h.slice(1);h=h+(a<0?"p":"p+")+a}else if(a<0){for(;++a;)h="0"+h;h="0."+h}else if(++a>p)for(a-=p;a--;)h+="0";else a<p&&(h=h.slice(0,a)+"."+h.slice(a))}else h=v?"0p+0":"0";h=(16==t?"0x":2==t?"0b":8==t?"0o":"")+h}else h=J(e);return e.s<0?"-"+h:h}function Q(e,t){if(e.length>t)return e.length=t,!0}function ee(e){return new this(e).abs()}function te(e){return new this(e).acos()}function ne(e){return new this(e).acosh()}function re(e,t){return new this(e).plus(t)}function ie(e){return new this(e).asin()}function oe(e){return new this(e).asinh()}function ae(e){return new this(e).atan()}function se(e){return new this(e).atanh()}function ue(e,t){e=new this(e),t=new this(t);var n,r=this.precision,i=this.rounding,o=r+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(n=t.s<0?R(this,r,i):new this(0)).s=e.s:!e.d||t.isZero()?(n=R(this,o,1).times(.5)).s=e.s:t.s<0?(this.precision=o,this.rounding=1,n=this.atan(P(e,t,o,1)),t=R(this,o,1),this.precision=r,this.rounding=i,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(P(e,t,o,1)):(n=R(this,o,1).times(t.s>0?.25:.75)).s=e.s:n=new this(NaN),n}function ce(e){return new this(e).cbrt()}function le(e){return E(e=new this(e),e.e+1,2)}function pe(e,t,n){return new this(e).clamp(t,n)}function fe(e){if(!e||"object"!==_typeof(e))throw Error(h+"Object expected");var t,n,r,i=!0===e.defaults,o=["precision",1,s,"rounding",0,8,"toExpNeg",-a,0,"toExpPos",0,a,"maxE",0,a,"minE",-a,0,"modulo",0,9];for(t=0;t<o.length;t+=3)if(n=o[t],i&&(this[n]=p[n]),void 0!==(r=e[n])){if(!(m(r)===r&&r>=o[t+1]&&r<=o[t+2]))throw Error(d+n+": "+r);this[n]=r}if(n="crypto",i&&(this[n]=p[n]),void 0!==(r=e[n])){if(!0!==r&&!1!==r&&0!==r&&1!==r)throw Error(d+n+": "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(y);this[n]=!0}else this[n]=!1}return this}function he(e){return new this(e).cos()}function de(e){return new this(e).cosh()}function ge(e,t){return new this(e).div(t)}function ye(e){return new this(e).exp()}function ve(e){return E(e=new this(e),e.e+1,3)}function me(){var e,t,n=new this(0);for(f=!1,e=0;e<arguments.length;)if((t=new this(arguments[e++])).d)n.d&&(n=n.plus(t.times(t)));else{if(t.s)return f=!0,new this(1/0);n=t}return f=!0,n.sqrt()}function be(e){return e instanceof n||e&&e.toStringTag===v||!1}function Oe(e){return new this(e).ln()}function Se(e,t){return new this(e).log(t)}function xe(e){return new this(e).log(2)}function we(e){return new this(e).log(10)}function _e(){return q(this,arguments,"lt")}function je(){return q(this,arguments,"gt")}function Ne(e,t){return new this(e).mod(t)}function De(e,t){return new this(e).mul(t)}function Te(e,t){return new this(e).pow(t)}function ke(e){var t,n,r,i,o=0,a=new this(1),u=[];if(void 0===e?e=this.precision:I(e,1,s),r=Math.ceil(e/j),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(r));o<r;)(i=t[o])>=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:u[o++]=i%1e7;else{if(!crypto.randomBytes)throw Error(y);for(t=crypto.randomBytes(r*=4);o<r;)(i=t[o]+(t[o+1]<<8)+(t[o+2]<<16)+((127&t[o+3])<<24))>=214e7?crypto.randomBytes(4).copy(t,o):(u.push(i%1e7),o+=4);o=r/4}else for(;o<r;)u[o++]=1e7*Math.random()|0;for(r=u[--o],e%=j,r&&e&&(i=b(10,j-e),u[o]=(r/i|0)*i);0===u[o];o--)u.pop();if(o<0)n=0,u=[0];else{for(n=-1;0===u[0];n-=j)u.shift();for(r=1,i=u[0];i>=10;i/=10)r++;r<j&&(n-=j-r)}return a.e=n,a.d=u,a}function Ie(e){return E(e=new this(e),e.e+1,this.rounding)}function Ce(e){return(e=new this(e)).d?e.d[0]?e.s:0*e.s:e.s||NaN}function Ae(e){return new this(e).sin()}function Pe(e){return new this(e).sinh()}function Ee(e){return new this(e).sqrt()}function Me(e,t){return new this(e).sub(t)}function Le(){var e=0,t=arguments,n=new this(t[e]);for(f=!1;n.s&&++e<t.length;)n=n.plus(t[e]);return f=!0,E(n,this.precision,this.rounding)}function He(e){return new this(e).tan()}function Re(e){return new this(e).tanh()}function Ve(e){return E(e=new this(e),e.e+1,1)}n=function e(t){var n,r,i;function o(e){var t,n,r,i=this;if(!(i instanceof o))return new o(e);if(i.constructor=o,be(e))return i.s=e.s,void(f?!e.d||e.e>o.maxE?(i.e=NaN,i.d=null):e.e<o.minE?(i.e=0,i.d=[0]):(i.e=e.e,i.d=e.d.slice()):(i.e=e.e,i.d=e.d?e.d.slice():e.d));if("number"===(r=_typeof(e))){if(0===e)return i.s=1/e<0?-1:1,i.e=0,void(i.d=[0]);if(e<0?(e=-e,i.s=-1):i.s=1,e===~~e&&e<1e7){for(t=0,n=e;n>=10;n/=10)t++;return void(f?t>o.maxE?(i.e=NaN,i.d=null):t<o.minE?(i.e=0,i.d=[0]):(i.e=t,i.d=[e]):(i.e=t,i.d=[e]))}return 0*e!=0?(e||(i.s=NaN),i.e=NaN,void(i.d=null)):z(i,e.toString())}if("string"!==r)throw Error(d+e);return 45===(n=e.charCodeAt(0))?(e=e.slice(1),i.s=-1):(43===n&&(e=e.slice(1)),i.s=1),w.test(e)?z(i,e):$(i,e)}if(o.prototype=T,o.ROUND_UP=0,o.ROUND_DOWN=1,o.ROUND_CEIL=2,o.ROUND_FLOOR=3,o.ROUND_HALF_UP=4,o.ROUND_HALF_DOWN=5,o.ROUND_HALF_EVEN=6,o.ROUND_HALF_CEIL=7,o.ROUND_HALF_FLOOR=8,o.EUCLID=9,o.config=o.set=fe,o.clone=e,o.isDecimal=be,o.abs=ee,o.acos=te,o.acosh=ne,o.add=re,o.asin=ie,o.asinh=oe,o.atan=ae,o.atanh=se,o.atan2=ue,o.cbrt=ce,o.ceil=le,o.clamp=pe,o.cos=he,o.cosh=de,o.div=ge,o.exp=ye,o.floor=ve,o.hypot=me,o.ln=Oe,o.log=Se,o.log10=we,o.log2=xe,o.max=_e,o.min=je,o.mod=Ne,o.mul=De,o.pow=Te,o.random=ke,o.round=Ie,o.sign=Ce,o.sin=Ae,o.sinh=Pe,o.sqrt=Ee,o.sub=Me,o.sum=Le,o.tan=He,o.tanh=Re,o.trunc=Ve,void 0===t&&(t={}),t&&!0!==t.defaults)for(i=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],n=0;n<i.length;)t.hasOwnProperty(r=i[n++])||(t[r]=this[r]);return o.config(t),o}(p),n.prototype.constructor=n,n.default=n.Decimal=n,c=new n(c),l=new n(l),void 0!==t&&t.exports?("function"==typeof Symbol&&"symbol"==_typeof(Symbol.iterator)&&(T[Symbol.for("nodejs.util.inspect.custom")]=T.toString,T[Symbol.toStringTag]="Decimal"),t.exports=n):(e||(e="undefined"!=typeof self&&self&&self.self==self?self:window),i=e.Decimal,n.noConflict=function(){return e.Decimal=i,n},e.Decimal=n)}(this)},{}],22:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=e("./utils.js"),i=function e(t,n){return t!==n&&(0,r.isObject)(t)&&(0,r.isObject)(n)?Object.keys(n).reduce((function(i,o){if((0,r.hasOwnProperty)(t,o)){var a=e(t[o],n[o]);return(0,r.isObject)(a)&&(0,r.isEmpty)(a)||(i[o]=a),i}return i[o]=n[o],i}),(0,r.makeObjectWithoutPrototype)()):{}};n.default=i},{"./utils.js":28}],23:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=e("./utils.js"),i=function e(t,n){return t!==n&&(0,r.isObject)(t)&&(0,r.isObject)(n)?Object.keys(t).reduce((function(i,o){if((0,r.hasOwnProperty)(n,o)){var a=e(t[o],n[o]);return(0,r.isObject)(a)&&(0,r.isEmpty)(a)||(i[o]=a),i}return i[o]=void 0,i}),(0,r.makeObjectWithoutPrototype)()):{}};n.default=i},{"./utils.js":28}],24:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=a(e("./added.js")),i=a(e("./deleted.js")),o=a(e("./updated.js"));function a(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t){return{added:(0,r.default)(e,t),deleted:(0,i.default)(e,t),updated:(0,o.default)(e,t)}};n.default=s},{"./added.js":22,"./deleted.js":23,"./updated.js":27}],25:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=e("./utils.js"),i=function e(t,n){if(t===n)return{};if(!(0,r.isObject)(t)||!(0,r.isObject)(n))return n;var i=Object.keys(t).reduce((function(e,t){return(0,r.hasOwnProperty)(n,t)||(e[t]=void 0),e}),(0,r.makeObjectWithoutPrototype)());return(0,r.isDate)(t)||(0,r.isDate)(n)?t.valueOf()==n.valueOf()?{}:n:Object.keys(n).reduce((function(i,o){if(!(0,r.hasOwnProperty)(t,o))return i[o]=n[o],i;var a=e(t[o],n[o]);return!(0,r.isEmptyObject)(a)||(0,r.isDate)(a)||!(0,r.isEmptyObject)(t[o])&&(0,r.isEmptyObject)(n[o])?(i[o]=a,i):i}),i)};n.default=i},{"./utils.js":28}],26:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"addedDiff",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(n,"deletedDiff",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(n,"detailedDiff",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(n,"diff",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(n,"updatedDiff",{enumerable:!0,get:function(){return a.default}});var r=u(e("./diff.js")),i=u(e("./added.js")),o=u(e("./deleted.js")),a=u(e("./updated.js")),s=u(e("./detailed.js"));function u(e){return e&&e.__esModule?e:{default:e}}},{"./added.js":22,"./deleted.js":23,"./detailed.js":24,"./diff.js":25,"./updated.js":27}],27:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=e("./utils.js"),i=function e(t,n){return t===n?{}:(0,r.isObject)(t)&&(0,r.isObject)(n)?(0,r.isDate)(t)||(0,r.isDate)(n)?t.valueOf()==n.valueOf()?{}:n:Object.keys(n).reduce((function(i,o){if((0,r.hasOwnProperty)(t,o)){var a=e(t[o],n[o]);return!(0,r.isEmptyObject)(a)||(0,r.isDate)(a)||!(0,r.isEmptyObject)(t[o])&&(0,r.isEmptyObject)(n[o])?(i[o]=a,i):i}return i}),(0,r.makeObjectWithoutPrototype)()):n};n.default=i},{"./utils.js":28}],28:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.makeObjectWithoutPrototype=n.isObject=n.isEmptyObject=n.isEmpty=n.isDate=n.hasOwnProperty=void 0;n.isDate=function(e){return e instanceof Date};var r=function(e){return 0===Object.keys(e).length};n.isEmpty=r;var i=function(e){return null!=e&&"object"===_typeof(e)};n.isObject=i;n.hasOwnProperty=function(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return(t=Object.prototype.hasOwnProperty).call.apply(t,[e].concat(r))};n.isEmptyObject=function(e){return i(e)&&r(e)};n.makeObjectWithoutPrototype=function(){return Object.create(null)}},{}],29:[function(e,t,n){
|
|
35
|
+
/**
|
|
36
|
+
* @license MIT
|
|
37
|
+
* @author <steven@velozo.com>
|
|
38
|
+
*/
|
|
39
|
+
var r=function(){function e(t){_classCallCheck(this,e),this.elucidator=t,this.namespace="default"}return _createClass(e,[{key:"initializeNamespace",value:function(e){"string"==typeof e&&(this.namespace=e),this.elucidator.instructionSets.hasOwnProperty(this.namespace)||(this.elucidator.instructionSets[this.namespace.toLowerCase()]={}),this.elucidator.operationSets.hasOwnProperty(this.namespace)||(this.elucidator.operationSets[this.namespace.toLowerCase()]={})}},{key:"addInstruction",value:function(e,t){return"string"!=typeof e?(this.elucidator.logError("Attempted to add an instruction with an invalid hash; expected a string but the instruction hash type was ".concat(_typeof(e))),!1):"function"!=typeof t?(this.elucidator.logError("Attempted to add an instruction with an invalid function; expected a function but type was ".concat(_typeof(t))),!1):(this.elucidator.instructionSets[this.namespace.toLowerCase()][e]=t,!0)}},{key:"initializeInstructions",value:function(){return this.addInstruction("noop",(function(e){return e.logInfo("Executing a no-operation operation."),!0})),!0}},{key:"addOperation",value:function(e,t){if("string"!=typeof e)return this.elucidator.logError("Attempted to add an operation with an invalid hash; expected a string but the operation hash type was ".concat(_typeof(e)),t),!1;if("object"!=_typeof(t))return this.elucidator.logError("Attempted to add an invalid operation; expected an object data type but the type was ".concat(_typeof(t)),t),!1;if(!t.hasOwnProperty("Description"))return this.elucidator.logError("Attempted to add an operation with an invalid description; no Description subobject set.",t),!1;if("object"!=_typeof(t.Description))return this.elucidator.logError("Attempted to add an operation with an invalid description; Description subobject was not an object. The type was ".concat(_typeof(t.Description),"."),t),!1;if("string"!=typeof t.Description.Hash){if("string"!=typeof t.Description.Operation)return this.elucidator.logError("Attempted to add an operation with an invalid description; Description subobject did not contain a valid Hash which is required to call the operation.",t),!1;t.Description.Hash=t.Description.Operation}return"string"==typeof t.Description.Namespace&&t.Description.Namespace==this.namespace||(t.Description.Namespace=this.namespace),"string"!=typeof t.Description.Summary&&(t.Description.Summary="[".concat(t.Description.Namespace,"] [").concat(t.Description.Hash,"] operation.")),t.hasOwnProperty("Inputs")||(t.Inputs={}),t.hasOwnProperty("Outputs")||(t.Outputs={}),t.hasOwnProperty("Steps")||(t.Steps=[]),"object"!==_typeof(t.Inputs)?(this.elucidator.logError("Attempted to add an operation with an invalid Inputs object.",t),!1):"object"!==_typeof(t.Outputs)?(this.elucidator.logError("Attempted to add an operation with an invalid Outputs object.",t),!1):Array.isArray(t.Steps)?(this.elucidator.operationSets[this.namespace.toLowerCase()][e.toLowerCase()]=t,!0):(this.elucidator.logError("Attempted to add an operation with an invalid Steps array.",t),!1)}},{key:"initializeOperations",value:function(){return this.addOperation("noop",{Description:{Operation:"noop",Description:"No operation - no affect on any data."}}),!0}}]),e}();t.exports=r},{}],30:[function(e,t,n){
|
|
40
|
+
/**
|
|
41
|
+
* @license MIT
|
|
42
|
+
* @author <steven@velozo.com>
|
|
43
|
+
*/
|
|
44
|
+
var r=function(e,t,n){var r="string"==typeof e?e:"",i="string"==typeof n?n:"INFO";console.log("[Elucidator:".concat(i,"] ").concat(r)),t&&console.log(JSON.stringify(t,null,4)+"\n")};t.exports={logToConsole:r,info:function(e,t){r(e,t,"Info")},warning:function(e,t){r(e,t,"Warning")},error:function(e,t){r(e,t,"Error")}}},{}],31:[function(e,t,n){
|
|
45
|
+
/**
|
|
46
|
+
* @license MIT
|
|
47
|
+
* @author <steven@velozo.com>
|
|
48
|
+
*/
|
|
49
|
+
var r=e("./Elucidator-LogToConsole.js"),i=e("manyfest"),o=e("precedent"),a=e("./Elucidator-InstructionSet.js"),s=function(){function t(e,n,i){if(_classCallCheck(this,t),this.logInfo="function"==typeof n?n:r.info,this.logWarning="function"==typeof fWarningLog?fWarningLog:r.warning,this.logError="function"==typeof i?i:r.error,this.instructionSets={},this.operationSets={},this.UUID=0,this.loadDefaultInstructionSets(),e)for(var o=Object.keys(e),a=0;a<o.length;a++)this.addOperation("Custom",o[a],e[o[a]])}return _createClass(t,[{key:"loadInstructionSet",value:function(e){var t=new e(this);t.initializeNamespace(),t.initializeInstructions(),t.initializeOperations()}},{key:"loadDefaultInstructionSets",value:function(){this.loadInstructionSet(e("./InstructionSets/Math-Javascript.js")),this.loadInstructionSet(e("./InstructionSets/PreciseMath-Decimal.js")),this.loadInstructionSet(e("./InstructionSets/Geometry.js")),this.loadInstructionSet(e("./InstructionSets/Logic.js")),this.loadInstructionSet(e("./InstructionSets/String.js")),this.loadInstructionSet(e("./InstructionSets/Set.js"))}},{key:"operationExists",value:function(e,t){if("string"!=typeof e||"string"!=typeof t)return!1;var n=e.toLowerCase();return this.operationSets.hasOwnProperty(n)&&this.operationSets[n].hasOwnProperty(t.toLowerCase())}},{key:"addOperation",value:function(e,t,n){if("string"!=typeof e)return this.logError("Attempted to add an operation at runtime via Elucidator.addOperation with an invalid namespace; expected a string but the type was ".concat(_typeof(e)),n),!1;var r=new a(this);return r.initializeNamespace(e),r.addOperation(t,n)}},{key:"solveInternalOperation",value:function(e,t,n,r,i,o,a,s){if(!this.operationExists(e,t))return this.logError("Attempted to solveInternalOperation for namespace ".concat(e," operationHash ").concat(t," but the operation was not found.")),!1;var u=this.operationSets[e.toLowerCase()][t.toLowerCase()];return this.solveOperation(u,n,r,i,o,a,s)}},{key:"solveOperation",value:function(e,t,n,r,a,s,u){var c=this,l=JSON.parse(JSON.stringify(e));if("object"!=_typeof(t))return this.logError("Attempted to run a solve but the passed in Input was not an object. The type was ".concat(_typeof(t),".")),!1;var p=t,f=p,h=u;void 0===h&&(h={SolutionGUID:"Solution-".concat(this.UUID++),SolutionBaseNamespace:e.Description.Namespace,SolutionBaseOperation:e.Description.Operation,SolutionLog:[]},l.hasOwnProperty("Inputs")||(l.Inputs={}),l.hasOwnProperty("Outputs")||(l.Outputs={}),l.hasOwnProperty("InputHashTranslationTable")?h.InputHashMapping=JSON.parse(JSON.stringify(l.InputHashTranslationTable)):h.InputHashMapping={},l.hasOwnProperty("OutputHashTranslationTable")&&(h.OutputHashMapping=JSON.parse(JSON.stringify(l.OutputHashTranslationTable))),"object"!=_typeof(n)&&"undefined"==typeof tmpOutputHashMapping&&"undefined"!=typeof tmpInputHashMapping&&(h.OutputHashMapping=h.InputHashMapping)),"object"==_typeof(n)&&(f=n);var d=!1;if(void 0===r)(d=new i).schemaManipulations.mergeAddressMappings(l.Inputs,l.Outputs);else d=r.clone();a&&d.schemaManipulations.resolveAddressMappings(l.Inputs,a),s&&d.schemaManipulations.resolveAddressMappings(l.Inputs,s),h.InputHashMapping&&d.hashTranslations.addTranslation(h.InputHashMapping),h.OutputHashMapping&&d.hashTranslations.addTranslation(h.OutputHashMapping),l.UUID=this.UUID++,l.SolutionContext=h,l.Description.Synopsys&&h.SolutionLog.push("[".concat(l.UUID,"]: Solver running operation ").concat(l.Description.Synopsys));var g=new o;if(g.addPattern("{{Name:","}}",(function(e){var t=e.trim(),n=d.getDescriptorByHash(t);return"object"==_typeof(n)&&n.hasOwnProperty("Name")?n.Name:t})),g.addPattern("{{InputValue:","}}",(function(e){var t=e.trim();return d.getValueByHash(p,t)})),g.addPattern("{{OutputValue:","}}",(function(e){var t=e.trim();return d.getValueByHash(f,t)})),l.hasOwnProperty("Log")&&l.Log.hasOwnProperty("PreOperation"))if("string"==typeof l.Log.PreOperation)l.SolutionContext.SolutionLog.push(g.parseString(l.Log.PreOperation));else if(Array.isArray(l.Log.PreOperation))for(var y=0;y<l.Log.PreOperation.length;y++)"string"==typeof l.Log.PreOperation[y]&&l.SolutionContext.SolutionLog.push(g.parseString(l.Log.PreOperation[y]));for(var v=function(e){var t=l.Steps[e];if(t.hasOwnProperty("Instruction")){var n={Scope:"InputObject",Descriptors:JSON.parse(JSON.stringify(l.Inputs))};d.schemaManipulations.resolveAddressMappings(n.Descriptors,t.InputHashAddressMap);var r=new i(n);h.InputHashMapping&&r.hashTranslations.addTranslation(h.InputHashMapping);var o={Scope:"OutputObject",Descriptors:JSON.parse(JSON.stringify(l.Outputs))};d.schemaManipulations.resolveAddressMappings(o.Descriptors,t.OutputHashAddressMap);var a=new i(o);h.OutputHashMapping&&a.hashTranslations.addTranslation(h.OutputHashMapping);var s={Elucidator:c,Namespace:t.Namespace.toLowerCase(),Instruction:t.Instruction.toLowerCase(),Operation:l,SolutionContext:h,DescriptionManyfest:d,InputObject:p,InputManyfest:r,OutputObject:f,OutputManyfest:a};if(s.logError=function(n){h.SolutionLog.push("[ERROR][Operation ".concat(s.Operation.Description.Namespace,":").concat(s.Operation.Description.Hash," - Step #").concat(e,":").concat(t.Namespace,":").concat(t.Instruction,"] ").concat(n))},s.logInfo=function(n){h.SolutionLog.push("[INFO][Operation ".concat(s.Operation.Description.Namespace,":").concat(s.Operation.Description.Hash," - Step #").concat(e,":").concat(t.Namespace,":").concat(t.Instruction,"] ").concat(n))},c.instructionSets[s.Namespace].hasOwnProperty(s.Instruction))(0,c.instructionSets[s.Namespace][s.Instruction])(s)}t.hasOwnProperty("Operation")&&("string"==typeof t.Operation?c.solveInternalOperation(t.Namespace,t.Operation,p,f,d,t.InputHashAddressMap,t.OutputHashAddressMap,h):"object"==_typeof(t.Operation)&&c.solveOperation(t.Operation,p,f,d,t.InputHashAddressMap,t.OutputHashAddressMap,h))},m=0;m<l.Steps.length;m++)v(m);if(l.hasOwnProperty("Log")&&l.Log.hasOwnProperty("PostOperation"))if("string"==typeof l.Log.PostOperation)l.SolutionContext.SolutionLog.push(g.parseString(l.Log.PostOperation));else if(Array.isArray(l.Log.PreOperation))for(var b=0;b<l.Log.PostOperation.length;b++)"string"==typeof l.Log.PostOperation[b]&&l.SolutionContext.SolutionLog.push(g.parseString(l.Log.PostOperation[b]));return h}}]),t}();t.exports=s},{"./Elucidator-InstructionSet.js":29,"./Elucidator-LogToConsole.js":30,"./InstructionSets/Geometry.js":32,"./InstructionSets/Logic.js":33,"./InstructionSets/Math-Javascript.js":34,"./InstructionSets/PreciseMath-Decimal.js":58,"./InstructionSets/Set.js":59,"./InstructionSets/String.js":60,manyfest:92,precedent:95}],32:[function(e,t,n){var r=function(t){_inherits(r,t);var n=_createSuper(r);function r(e){var t;return _classCallCheck(this,r),(t=n.call(this,e)).namespace="Geometry",t}return _createClass(r,[{key:"initializeInstructions",value:function(){return!0}},{key:"initializeOperations",value:function(){return this.addOperation("rectanglearea",e("./Operations/Geometry-RectangleArea.json")),!0}}]),r}(e("../Elucidator-InstructionSet.js"));t.exports=r},{"../Elucidator-InstructionSet.js":29,"./Operations/Geometry-RectangleArea.json":35}],33:[function(e,t,n){var r=e("../Elucidator-InstructionSet.js"),i=function(e){var t=e.InputManyfest.getValueByHash(e.InputObject,"leftValue"),n=e.InputManyfest.getValueByHash(e.InputObject,"rightValue"),r=e.InputManyfest.getValueByHash(e.InputObject,"comparator").toString().toLowerCase(),i="equal",o={"==":"equal",eq:"equal",equal:"equal","!=":"notequal",noteq:"notequal",notequal:"notequal","===":"identity",id:"identity",identity:"identity",">":"greaterthan",gt:"greaterthan",greaterthan:"greaterthan",">=":"greaterthanorequal",gte:"greaterthanorequal",greaterthanorequal:"greaterthanorequal","<":"lessthan",lt:"lessthan",lessthan:"lessthan","<=":"lessthanorequal",lte:"lessthanorequal",lessthanorequal:"lessthanorequal"};o.hasOwnProperty(r)&&(i=o[r]);var a=e.InputManyfest.getValueByHash(e.InputObject,"trueNamespace"),s=e.InputManyfest.getValueByHash(e.InputObject,"trueOperation"),u=e.InputManyfest.getValueByHash(e.InputObject,"falseNamespace"),c=e.InputManyfest.getValueByHash(e.InputObject,"falseOperation"),l=null;switch(i){case"equal":l=t==n;break;case"identity":l=t===n;break;case"notequal":l=t!=n;break;case"greaterthan":l=t>n;break;case"greaterthanorequal":l=t>=n;break;case"lessthan":l=t<n;break;case"lessthanorequal":l=t<=n}return e.OutputManyfest.setValueByHash(e.OutputObject,"truthinessResult",l),l&&"string"==typeof a&&"string"==typeof s&&"noop"!=s?e.Elucidator.solveInternalOperation(a,s,e.InputObject,e.OutputObject,e.DescriptionManyfest,e.SolutionContext.InputHashMapping,e.SolutionContext.OutputHashMapping,e.SolutionContext):"string"==typeof u&&"string"==typeof c&&"noop"!=c&&e.Elucidator.solveInternalOperation(u,c,e.InputObject,e.OutputObject,e.DescriptionManyfest,e.SolutionContext.InputHashMapping,e.SolutionContext.OutputHashMapping,e.SolutionContext),!0},o=function(e){var t=e.InputManyfest.getValueByHash(e.InputObject,"namespace"),n=e.InputManyfest.getValueByHash(e.InputObject,"operation");return e.Elucidator.solveInternalOperation(t,n,e.InputObject,e.OutputObject,e.DescriptionManyfest,e.SolutionContext.InputHashMapping,e.SolutionContext.OutputHashMapping,e.SolutionContext),!0},a=function(t){_inherits(r,t);var n=_createSuper(r);function r(e){var t;return _classCallCheck(this,r),(t=n.call(this,e)).namespace="Logic",t}return _createClass(r,[{key:"initializeInstructions",value:function(){return _get(_getPrototypeOf(r.prototype),"initializeInstructions",this).call(this),this.addInstruction("if",i),this.addInstruction("execute",o),!0}},{key:"initializeOperations",value:function(){return this.addOperation("if",e("./Operations/Logic-If.json")),this.addOperation("execute",e("./Operations/Logic-Execute.json")),!0}}]),r}(r);t.exports=a},{"../Elucidator-InstructionSet.js":29,"./Operations/Logic-Execute.json":36,"./Operations/Logic-If.json":37}],34:[function(e,t,n){var r=e("../Elucidator-InstructionSet.js"),i=function(e){var t=e.InputManyfest.getValueByHash(e.InputObject,"a"),n=e.InputManyfest.getValueByHash(e.InputObject,"b");return e.OutputManyfest.setValueByHash(e.OutputObject,"x",t+n),!0},o=function(e){var t=e.InputManyfest.getValueByHash(e.InputObject,"a"),n=e.InputManyfest.getValueByHash(e.InputObject,"b");return e.OutputManyfest.setValueByHash(e.OutputObject,"x",t-n),!0},a=function(e){var t=e.InputManyfest.getValueByHash(e.InputObject,"a"),n=e.InputManyfest.getValueByHash(e.InputObject,"b");return e.OutputManyfest.setValueByHash(e.OutputObject,"x",t*n),!0},s=function(e){var t=e.InputManyfest.getValueByHash(e.InputObject,"a"),n=e.InputManyfest.getValueByHash(e.InputObject,"b");return e.OutputManyfest.setValueByHash(e.OutputObject,"x",t/n),!0},u=function(e){var t=e.InputManyfest.getValueByHash(e.InputObject,"a"),n=0;if("object"==_typeof(t))if(Array.isArray(t))for(var r=0;r<t.length;r++){var i=parseInt(t[r]);isNaN(i)?e.logError("Array element index [".concat(r,"] could not be parsed as a number; skipping. (").concat(t[r],")")):(n+=i,e.logInfo("Adding element [".concat(r,"] value ").concat(i," totaling: ").concat(n)))}else for(var o=Object.keys(t),a=0;a<o.length;a++){var s=parseInt(t[o[a]]);isNaN(s)?e.logError("Object property [".concat(o[a],"] could not be parsed as a number; skipping. (").concat(t[o[a]],")")):(n+=s,e.logInfo("Adding object property [".concat(o[a],"] value ").concat(s," totaling: ").concat(n)))}else{var u=parseInt(t);isNaN(u)?e.logError("Direct value could not be parsed as a number; skipping. (".concat(t,")")):n+=u}return e.OutputManyfest.setValueByHash(e.OutputObject,"x",n),!0},c=function(t){_inherits(r,t);var n=_createSuper(r);function r(e){var t;return _classCallCheck(this,r),(t=n.call(this,e)).namespace="Math",t}return _createClass(r,[{key:"initializeInstructions",value:function(){return this.addInstruction("add",i),this.addInstruction("subtract",o),this.addInstruction("sub",o),this.addInstruction("multiply",a),this.addInstruction("mul",a),this.addInstruction("divide",s),this.addInstruction("div",s),this.addInstruction("aggregate",u),!0}},{key:"initializeOperations",value:function(){return this.addOperation("add",e("./Operations/Math-Add.json")),this.addOperation("subtract",e("./Operations/Math-Subtract.json")),this.addOperation("multiply",e("./Operations/Math-Multiply.json")),this.addOperation("divide",e("./Operations/Math-Divide.json")),this.addOperation("aggregate",e("./Operations/Math-Aggregate.json")),!0}}]),r}(r);t.exports=c},{"../Elucidator-InstructionSet.js":29,"./Operations/Math-Add.json":38,"./Operations/Math-Aggregate.json":39,"./Operations/Math-Divide.json":40,"./Operations/Math-Multiply.json":41,"./Operations/Math-Subtract.json":42}],35:[function(e,t,n){t.exports={Description:{Namespace:"Geometry",Operation:"RectangleArea",Synopsis:"Solve for the area of a rectangle: Area = Width * Height"},Inputs:{Width:{Hash:"Width",Type:"Number"},Height:{Hash:"Height",Type:"Number"}},Outputs:{Area:{Hash:"Area",Name:"Area of the Rectangle"},Ratio:{Hash:"Ratio",Name:"The Ratio between the Width and the Height"}},Log:{PreOperation:"Solve for [ {{Name:Area}} ] based on [ {{Name:Width}} ] and [ {{Name:Height}} ].",PostOperation:"Operation complete; [ {{Name:Area}} ] = {{InputValue:Width}} * {{InputValue:Height}} = {{OutputValue:Area}}"},Steps:[{Namespace:"PreciseMath",Instruction:"multiply",InputHashAddressMap:{a:"Width",b:"Height"},OutputHashAddressMap:{x:"Area"}},{Namespace:"PreciseMath",Instruction:"divide",InputHashAddressMap:{a:"Width",b:"Height"},OutputHashAddressMap:{x:"Ratio"}}]}},{}],36:[function(e,t,n){t.exports={Description:{Namespace:"Logic",Operation:"Execute",Synopsis:"Execute an operation based on namespace and operation."},Inputs:{namespace:{Hash:"namespace",Type:"string",Default:"logic"},operation:{Hash:"operation",Type:"string",Default:"noop"}},Outputs:{},Log:{PreOperation:"Execute the {{InputValue:operation}} operation in namespace {{InputValue:namespace}}.",PostOperation:"Operation [{{InputValue:namespace}}:{{InputValue:operation}}] execution complete."},Steps:[{Namespace:"Logic",Instruction:"execute"}]}},{}],37:[function(e,t,n){t.exports={Description:{Namespace:"Logic",Operation:"If",Synopsis:"Comparison-based if of leftValue and RightValue based on comparator. Executes trueNamespace:trueOperation or falseNamespace:falseOperation based on truthiness of result. Also outputs a true or false to truthinessResult."},Inputs:{leftValue:{Hash:"leftValue",Type:"Any"},rightValue:{Hash:"rightValue",Type:"Any",Default:!0},comparator:{Hash:"comparator",Type:"String",Default:"=="},trueNamespace:{Hash:"trueNamespace",Type:"String",Default:"logic"},trueOperation:{Hash:"trueOperation",Type:"String",Default:"noop"},falseNamespace:{Hash:"falseNamespace",Type:"String",Default:"logic"},falseOperation:{Hash:"falseOperation",Type:"String",Default:"noop"}},Outputs:{truthinessResult:{Hash:"truthinessResult",Type:"Boolean"}},Log:{PreOperation:"Compare {{Name:leftValue}} and {{Name:rightValue}} with the {{InputValue:comparator}} operator, storing the truthiness in {{Name:truthinessResult}}.",PostOperation:"Operation complete: {{InputValue:leftValue}} {{InputValue:comparator}} {{InputValue:rightValue}} evaluated to {{OutputValue:truthinessResult}}"},Steps:[{Namespace:"Logic",Instruction:"If"}]}},{}],38:[function(e,t,n){t.exports={Description:{Namespace:"Math",Operation:"Add",Synopsis:"Add two numbers: x = a + b"},Inputs:{a:{Hash:"a",Type:"Number"},b:{Hash:"b",Type:"Number"}},Outputs:{x:{Hash:"x",Type:"Number"}},Log:{PreOperation:"Add {{Name:a}} and {{Name:b}}, storing the value in {{Name:x}}.",PostOperation:"Operation complete: {{Name:x}} = {{InputValue:a}} + {{InputValue:b}} = {{OutputValue:x}}"},Steps:[{Namespace:"Math",Instruction:"add"}]}},{}],39:[function(e,t,n){t.exports={Description:{Namespace:"Math",Operation:"Aggregate",Synopsis:"Aggregate a set of numbers (from array or object address): x = a + b + ... + z"},Inputs:{a:{Hash:"a",Type:"Set"}},Outputs:{x:{Hash:"x",Type:"Number"}},Log:{PreOperation:"Aggregate all numeric values in {{Name:a}}, storing the resultant in {{Name:x}}.",PostOperation:"Operation complete: {{Name:x}} = {{OutputValue:x}}"},Steps:[{Namespace:"Math",Instruction:"aggregate"}]}},{}],40:[function(e,t,n){t.exports={Description:{Namespace:"Math",Operation:"Divide",Synopsis:"Divide two numbers: x = a / b"},Inputs:{a:{Hash:"a",Type:"Number"},b:{Hash:"b",Type:"Number"}},Outputs:{x:{Hash:"x",Type:"Number"}},Log:{PreOperation:"Divide {{Name:a}} over {{Name:b}}, storing the value in {{Name:x}}.",PostOperation:"Operation complete: {{Name:x}} = {{InputValue:a}} / {{InputValue:b}} = {{OutputValue:x}}"},Steps:[{Namespace:"Math",Instruction:"divide"}]}},{}],41:[function(e,t,n){t.exports={Description:{Namespace:"Math",Operation:"Multiply",Synopsis:"Multiply two numbers: x = a * b"},Inputs:{a:{Hash:"a",Type:"Number"},b:{Hash:"b",Type:"Number"}},Outputs:{x:{Hash:"x",Type:"Number"}},Log:{PreOperation:"Multiply {{Name:a}} and {{Name:b}}, storing the value in {{Name:x}}.",PostOperation:"Operation complete: {{Name:x}} = {{InputValue:a}} * {{InputValue:b}} = {{OutputValue:x}}"},Steps:[{Namespace:"Math",Instruction:"multiply"}]}},{}],42:[function(e,t,n){t.exports={Description:{Namespace:"Math",Operation:"Subtract",Synopsis:"Subtract two numbers: x = a - b"},Inputs:{a:{Hash:"a",Type:"Number"},b:{Hash:"b",Type:"Number"}},Outputs:{x:{Hash:"x",Type:"Number"}},Log:{PreOperation:"Subtract {{Name:a}} and {{Name:b}}, storing the value in {{Name:x}}.",PostOperation:"Operation complete: {{Name:x}} = {{InputValue:a}} - {{InputValue:b}} = {{OutputValue:x}}"},Steps:[{Namespace:"Math",Instruction:"subtract"}]}},{}],43:[function(e,t,n){t.exports={Description:{Namespace:"PreciseMath",Operation:"Add",Synopsis:"Precisely add two numbers: x = a + b"},Inputs:{a:{Hash:"a",Type:"Number"},b:{Hash:"b",Type:"Number"}},Outputs:{x:{Hash:"x",Type:"Number"}},Log:{PreOperation:"Add {{Name:a}} and {{Name:b}}, storing the value in {{Name:x}}.",PostOperation:"Operation complete: {{Name:x}} = {{InputValue:a}} + {{InputValue:b}} = {{OutputValue:x}}"},Steps:[{Namespace:"PreciseMath",Instruction:"add"}]}},{}],44:[function(e,t,n){t.exports={Description:{Namespace:"PreciseMath",Operation:"Aggregate",Synopsis:"Precisely aggregate a set of numbers (from array or object address): x = a + b + ... + z"},Inputs:{a:{Hash:"a",Type:"Set"},ValueNames:{Hash:"ValueNames",Type:"Set"}},Outputs:{x:{Hash:"x",Type:"Number"}},Log:{PreOperation:"Aggregate all numeric values in {{Name:a}}, storing the resultant in {{Name:x}}.",PostOperation:"Operation complete: {{Name:x}} = {{OutputValue:x}}"},Steps:[{Namespace:"PreciseMath",Instruction:"aggregate"}]}},{}],45:[function(e,t,n){t.exports={Description:{Namespace:"PreciseMath",Operation:"Divide",Synopsis:"Precisely divide two numbers: x = a / b"},Inputs:{a:{Hash:"a",Type:"Number"},b:{Hash:"b",Type:"Number"}},Outputs:{x:{Hash:"x",Type:"Number"}},Log:{PreOperation:"Divide {{Name:a}} over {{Name:b}}, storing the value in {{Name:x}}.",PostOperation:"Operation complete: {{Name:x}} = {{InputValue:a}} / {{InputValue:b}} = {{OutputValue:x}}"},Steps:[{Namespace:"PreciseMath",Instruction:"divide"}]}},{}],46:[function(e,t,n){t.exports={Description:{Namespace:"PreciseMath",Operation:"GroupValuesAndAggregate",Synopsis:"Group values in a set and aggregate the set of numbers (from array or object addresses)"},Inputs:{inputDataSet:{Hash:"inputDataSet",Type:"Set"},groupByProperty:{Hash:"groupByProperty",Type:"Any"},groupValueProperty:{Hash:"groupValueProperty",Type:"Any"},recordIndicatorProperty:{Hash:"recordIndicatorProperty",Type:"String",Default:!1}},Outputs:{outputDataSet:{Hash:"outputDataSet",Type:"Set"}},Log:{PreOperation:"Group {{Name:inputDataSet}} by {{Name:groupByProperty}} and create a map, storing the resultant in {{Name:outputDataSet}}.",PostOperation:"Operation complete: Grouping {{Name:inputDataSet}} by {{Name:groupByProperty}} into aggregated values in {{Name:outputDataSet}}"},Steps:[{Namespace:"PreciseMath",Instruction:"groupvaluesandaggregate"}]}},{}],47:[function(e,t,n){t.exports={Description:{Namespace:"PreciseMath",Operation:"Multiply",Synopsis:"Precisely multiply two numbers: x = a * b"},Inputs:{a:{Hash:"a",Type:"Number"},b:{Hash:"b",Type:"Number"}},Outputs:{x:{Hash:"x",Type:"Number"}},Log:{PreOperation:"Multiply {{Name:a}} and {{Name:b}}, storing the value in {{Name:x}}.",PostOperation:"Operation complete: {{Name:x}} = {{InputValue:a}} * {{InputValue:b}} = {{OutputValue:x}}"},Steps:[{Namespace:"PreciseMath",Instruction:"multiply"}]}},{}],48:[function(e,t,n){t.exports={Description:{Namespace:"PreciseMath",Operation:"Round",Synopsis:"Precisely round a number."},Inputs:{a:{Hash:"a",Type:"Number"},precision:{Hash:"precision",Type:"Number"},roundingmode:{Hash:"roundingmode",Type:"String"}},Outputs:{x:{Hash:"x",Type:"Number"}},Log:{PreOperation:"Round {{Name:a}}, storing the value in {{Name:x}}.",PostOperation:"Operation complete: {{Name:x}} = Round({{InputValue:a}}) = {{OutputValue:x}}"},Steps:[{Namespace:"PreciseMath",Instruction:"round"}]}},{}],49:[function(e,t,n){t.exports={Description:{Namespace:"PreciseMath",Operation:"SetPrecision",Synopsis:"Set the precision."},Inputs:{precision:{Hash:"precision",Type:"Number",Default:2}},Outputs:{},Log:{PreOperation:"Set precision to {{InputValue:precision}}.",PostOperation:"Operation complete: Default precision set to {{InputValue:precision}}."},Steps:[{Namespace:"PreciseMath",Instruction:"setprecision"}]}},{}],50:[function(e,t,n){t.exports={Description:{Namespace:"PreciseMath",Operation:"SetRoundingMode",Synopsis:"Set the rounding mode."},Inputs:{roundingmode:{Hash:"roundingmode",Type:"String",Default:"ROUND_HALF_UP"}},Outputs:{},Log:{PreOperation:"Set rounding mode to {{InputValue:roundingmode}}.",PostOperation:"Operation complete: Default rounding mode set to {{InputValue:roundingmode}}."},Steps:[{Namespace:"PreciseMath",Instruction:"setroundingmode"}]}},{}],51:[function(e,t,n){t.exports={Description:{Namespace:"PreciseMath",Operation:"Subtract",Synopsis:"Precisely subtract two numbers: x = a - b"},Inputs:{a:{Hash:"a",Type:"Number"},b:{Hash:"b",Type:"Number"}},Outputs:{x:{Hash:"x",Type:"Number"}},Log:{PreOperation:"Subtract {{Name:a}} and {{Name:b}}, storing the value in {{Name:x}}.",PostOperation:"Operation complete: {{Name:x}} = {{InputValue:a}} - {{InputValue:b}} = {{OutputValue:x}}"},Steps:[{Namespace:"PreciseMath",Instruction:"subtract"}]}},{}],52:[function(e,t,n){t.exports={Description:{Namespace:"PreciseMath",Operation:"ToDecimalPlaces",Synopsis:"Precisely round a number to a certain number of decimal places."},Inputs:{a:{Hash:"a",Type:"Number"},decimalplaces:{Hash:"decimalplaces",Type:"Number",Default:2},roundingmode:{Hash:"roundingmode",Type:"String"}},Outputs:{x:{Hash:"x",Type:"Number"}},Log:{PreOperation:"Round {{Name:a}} to {{Value:decimalplaces}} decimal places, storing the value in {{Name:x}}.",PostOperation:"Operation complete: {{Name:x}} = Round({{InputValue:a}} TO {{Value:decimalplaces}} decimal places) = {{OutputValue:x}}"},Steps:[{Namespace:"PreciseMath",Instruction:"todecimalplaces"}]}},{}],53:[function(e,t,n){t.exports={Description:{Namespace:"PreciseMath",Operation:"ToSignificantDigits",Synopsis:"Precisely round a number to a specific number of significant digits."},Inputs:{a:{Hash:"a",Type:"Number"},digits:{Hash:"digits",Type:"Number",Default:12},roundingmode:{Hash:"roundingmode",Type:"String"}},Outputs:{x:{Hash:"x",Type:"Number"}},Log:{PreOperation:"Round {{Name:a}} to {{InputValue:digits}}, storing the value in {{Name:x}}.",PostOperation:"Operation complete: {{Name:x}} = Round({{InputValue:a}} TO {{InputValue:digits}}) = {{OutputValue:x}}"},Steps:[{Namespace:"PreciseMath",Instruction:"tosignificantdigits"}]}},{}],54:[function(e,t,n){t.exports={Description:{Namespace:"Set",Operation:"GroupValuesBy",Synopsis:"Group set of Sub object values by another property in the objects."},Inputs:{inputDataSet:{Hash:"inputDataSet",Type:"Set"},groupByProperty:{Hash:"groupByProperty",Type:"Any"},groupValueProperty:{Hash:"groupValueProperty",Type:"Any"}},Outputs:{outputDataSet:{Hash:"outputDataSet",Type:"Set"}},Log:{PreOperation:"Group {{Name:inputDataSet}} by {{Name:groupByProperty}} and create a mapped result set into {{Name:outputDataSet}}.",PostOperation:"Operation complete: Grouping {{Name:inputDataSet}} by {{Name:groupByProperty}} into {{Name:outputDataSet}}"},Steps:[{Namespace:"Set",Instruction:"GroupValuesBy"}]}},{}],55:[function(e,t,n){t.exports={Description:{Namespace:"String",Operation:"Replace",Synopsis:"Replace all instances of searchFor with replaceWith in inputString"},Inputs:{inputString:{Hash:"inputString",Type:"String"},searchFor:{Hash:"searchFor",Type:"String"},replaceWith:{Hash:"replaceWith",Type:"String"}},Outputs:{outputString:{Hash:"outputString",Type:"String"}},Log:{PreOperation:"Search for [{{InputValue:searchFor}}] and replace it with [{{InputValue:replaceWith}}] in [{{InputValue:inputString}}].",PostOperation:"Operation complete: {{Name:outputString}} = [{{OutputValue:outputString}}] from [{{InputValue:inputString}}] replacing [{{InputValue:searchFor}}] with [{{InputValue:replaceWith}}]."},Steps:[{Namespace:"String",Instruction:"replace"}]}},{}],56:[function(e,t,n){t.exports={Description:{Namespace:"String",Operation:"Substring",Synopsis:"Get all characters between indexStart and indexEnd (optional) for a given inputString."},Inputs:{inputString:{Hash:"inputString",Type:"String"},indexStart:{Hash:"indexStart",Type:"Number",Default:0},indexEnd:{Hash:"indexEnd",Type:"String",Default:null}},Outputs:{outputString:{Hash:"outputString",Type:"String"}},Log:{PreOperation:"Get all characters between {{InputValue:indexStart}} and {{InputValue:indexEnd}} in [{{InputValue:inputString}}].",PostOperation:"Operation complete: {{Name:outputString}} = [{{OutputValue:outputString}}] from [{{InputValue:inputString}}] between {{InputValue:indexStart}} and {{InputValue:indexEnd}}."},Steps:[{Namespace:"String",Instruction:"substring"}]}},{}],57:[function(e,t,n){t.exports={Description:{Namespace:"String",Operation:"Trim",Synopsis:"Trim whitespace off the end of string in inputString, putting the result in outputString"},Inputs:{inputString:{Hash:"inputString",Type:"String"}},Outputs:{outputString:{Hash:"outputString",Type:"String"}},Log:{PreOperation:"Trim the whitespace from value [{{InputValue:inputString}}].",PostOperation:"Operation complete: {{Name:outputString}} = [{{OutputValue:outputString}}] from [{{InputValue:inputString}}]"},Steps:[{Namespace:"String",Instruction:"trim"}]}},{}],58:[function(e,t,n){var r=e("../Elucidator-InstructionSet.js"),i=e("decimal.js"),o=function(e){var t=new i(e.InputManyfest.getValueByHash(e.InputObject,"a")),n=new i(e.InputManyfest.getValueByHash(e.InputObject,"b"));return e.OutputManyfest.setValueByHash(e.OutputObject,"x",t.plus(n).toString()),!0},a=function(e){var t=new i(e.InputManyfest.getValueByHash(e.InputObject,"a")),n=new i(e.InputManyfest.getValueByHash(e.InputObject,"b"));return e.OutputManyfest.setValueByHash(e.OutputObject,"x",t.sub(n).toString()),!0},s=function(e){var t=new i(e.InputManyfest.getValueByHash(e.InputObject,"a")),n=new i(e.InputManyfest.getValueByHash(e.InputObject,"b"));return e.OutputManyfest.setValueByHash(e.OutputObject,"x",t.mul(n).toString()),!0},u=function(e){var t=new i(e.InputManyfest.getValueByHash(e.InputObject,"a")),n=new i(e.InputManyfest.getValueByHash(e.InputObject,"b"));return e.OutputManyfest.setValueByHash(e.OutputObject,"x",t.div(n).toString()),!0},c=function(e){var t=new i(e.InputManyfest.getValueByHash(e.InputObject,"a")),n=parseInt(e.InputManyfest.getValueByHash(e.InputObject,"precision")),r=e.InputManyfest.getValueByHash(e.InputObject,"roundingmode");if(r)switch(r.toString().toLowerCase()){case"round_up":i.set({rounding:i.ROUND_UP});break;case"round_down":i.set({rounding:i.ROUND_DOWN});break;case"round_ceil":i.set({rounding:i.ROUND_CEIL});break;case"round_floor":i.set({rounding:i.ROUND_FLOOR});break;default:case"round_half_up":i.set({rounding:i.ROUND_HALF_UP});break;case"round_half_down":i.set({rounding:i.ROUND_HALF_DOWN});break;case"round_half_even":i.set({rounding:i.ROUND_HALF_EVEN});break;case"round_half_ceil":i.set({rounding:i.ROUND_HALF_CEIL});break;case"round_half_floor":i.set({rounding:i.ROUND_HALF_FLOOR});break;case"euclid":i.set({rounding:i.EUCLID})}isNaN(n)||i.set({precision:n}),e.OutputManyfest.setValueByHash(e.OutputObject,"x",i.round(t).toString())},l=function(e){var t=new i(e.InputManyfest.getValueByHash(e.InputObject,"a")),n=parseInt(e.InputManyfest.getValueByHash(e.InputObject,"digits")),r=e.InputManyfest.getValueByHash(e.InputObject,"roundingmode");if(r)switch(r.toString().toLowerCase()){case"round_up":i.set({rounding:i.ROUND_UP});break;case"round_down":i.set({rounding:i.ROUND_DOWN});break;case"round_ceil":i.set({rounding:i.ROUND_CEIL});break;case"round_floor":i.set({rounding:i.ROUND_FLOOR});break;default:case"round_half_up":i.set({rounding:i.ROUND_HALF_UP});break;case"round_half_down":i.set({rounding:i.ROUND_HALF_DOWN});break;case"round_half_even":i.set({rounding:i.ROUND_HALF_EVEN});break;case"round_half_ceil":i.set({rounding:i.ROUND_HALF_CEIL});break;case"round_half_floor":i.set({rounding:i.ROUND_HALF_FLOOR});break;case"euclid":i.set({rounding:i.EUCLID})}isNaN(n)&&(n=12),e.OutputManyfest.setValueByHash(e.OutputObject,"x",t.toSignificantDigits(n).toString())},p=function(e){var t=new i(e.InputManyfest.getValueByHash(e.InputObject,"a")),n=parseInt(e.InputManyfest.getValueByHash(e.InputObject,"decimalplaces")),r=e.InputManyfest.getValueByHash(e.InputObject,"roundingmode");if(r)switch(r.toString().toLowerCase()){case"round_up":i.set({rounding:i.ROUND_UP});break;case"round_down":i.set({rounding:i.ROUND_DOWN});break;case"round_ceil":i.set({rounding:i.ROUND_CEIL});break;case"round_floor":i.set({rounding:i.ROUND_FLOOR});break;default:case"round_half_up":i.set({rounding:i.ROUND_HALF_UP});break;case"round_half_down":i.set({rounding:i.ROUND_HALF_DOWN});break;case"round_half_even":i.set({rounding:i.ROUND_HALF_EVEN});break;case"round_half_ceil":i.set({rounding:i.ROUND_HALF_CEIL});break;case"round_half_floor":i.set({rounding:i.ROUND_HALF_FLOOR});break;case"euclid":i.set({rounding:i.EUCLID})}isNaN(n)&&(n=2),e.OutputManyfest.setValueByHash(e.OutputObject,"x",t.toDecimalPlaces(n).toString())},f=function(e){var t=parseInt(e.InputManyfest.getValueByHash(e.InputObject,"precision"));console.log(t),isNaN(t)||i.set({precision:t})},h=function(e){var t=e.InputManyfest.getValueByHash(e.InputObject,"roundingmode");if(t)switch(t.toString().toLowerCase()){case"round_up":i.set({rounding:i.ROUND_UP});break;case"round_down":i.set({rounding:i.ROUND_DOWN});break;case"round_ceil":i.set({rounding:i.ROUND_CEIL});break;case"round_floor":i.set({rounding:i.ROUND_FLOOR});break;default:case"round_half_up":i.set({rounding:i.ROUND_HALF_UP});break;case"round_half_down":i.set({rounding:i.ROUND_HALF_DOWN});break;case"round_half_even":i.set({rounding:i.ROUND_HALF_EVEN});break;case"round_half_ceil":i.set({rounding:i.ROUND_HALF_CEIL});break;case"round_half_floor":i.set({rounding:i.ROUND_HALF_FLOOR});break;case"euclid":i.set({rounding:i.EUCLID})}},d=function(e){var t=e.InputManyfest.getValueByHash(e.InputObject,"a"),n=_typeof(t),r=new i(0);if("object"==n)if(Array.isArray(t))for(var o=0;o<t.length;o++){var a=new i(t[o]);isNaN(a)?e.logError("Array element index [".concat(o,"] could not be parsed as a number by Decimal.js; skipping. (").concat(t[o],")")):(r=r.plus(a),e.logInfo("Adding element [".concat(o,"] value ").concat(a," totaling: ").concat(r)))}else for(var s=Object.keys(t),u=0;u<s.length;u++){var c=new i(t[s[u]]);isNaN(c)?e.logError("Object property [".concat(s[u],"] could not be parsed as a number; skipping. (").concat(t[s[u]],")")):(r=r.plus(c),e.logInfo("Adding object property [".concat(s[u],"] value ").concat(c," totaling: ").concat(r)))}else{var l=new i(t);isNaN(l)?e.logError("Direct value could not be parsed as a number; skipping. (".concat(t,")")):r=l}return e.OutputManyfest.setValueByHash(e.OutputObject,"x",r.toString()),!0},g=function(e){var t=e.InputManyfest.getValueByHash(e.InputObject,"inputDataSet"),n=e.InputManyfest.getValueByHash(e.InputObject,"groupByProperty"),r=e.InputManyfest.getValueByHash(e.InputObject,"groupValueProperty"),o={},a={};if("object"==_typeof(t)){if(Array.isArray(t))for(var s=0;s<t.length;s++)if("object"!==_typeof(t[s]))e.logInfo("Element [".concat(s,"] was not an object; skipping group operation."));else{var u=t[s],c=u[n];if(u.hasOwnProperty(n)||(e.logInfo("Element [".concat(s,"] doesn't have the group by property [").concat(n,"]; setting group to [__NO_GROUP].")),c="__NO_GROUP"),u.hasOwnProperty(r)){var l=new i(u[r]);isNaN(l)?e.logError("Object property [".concat(s,"] could not be parsed as a number; skipping. (").concat(u[r],")")):(o.hasOwnProperty(c)?o[c]=o[c].plus(l):o[c]=l,e.logInfo("Adding object property [".concat(s,"] value ").concat(l," totaling: ").concat(o[c])))}else e.logInfo("Element [".concat(s,"] doesn't have the group value property [").concat(r,"]; skipping group operation."))}else for(var p=Object.keys(t),f=0;f<p.length;f++)if("object"!==_typeof(t[p[f]]))e.logInfo("Element [".concat(f,"] was not an object; skipping group operation."));else{var h=t[p[f]],d=h[n];if(h.hasOwnProperty(n)||(e.logInfo("Element [".concat(p[f],"][").concat(f,"] doesn't have the group by property [").concat(n,"]; setting group to [__NO_GROUP].")),d="__NO_GROUP"),h.hasOwnProperty(r)){var g=new i(h[r]);isNaN(g)?e.logError("Object property [".concat(p[f],"][").concat(f,"] to group ").concat(d," could not be parsed as a number; skipping. (").concat(h[r],")")):(o.hasOwnProperty(d)?o[d]=o[d].plus(g):o[d]=g,e.logInfo("Adding object property [".concat(p[f],"][").concat(f,"] to group ").concat(d," value ").concat(g," totaling: ").concat(o[d])))}else e.logInfo("Element [".concat(p[f],"][").concat(f,"] doesn't have the group value property [").concat(r,"]; skipping group operation."))}for(var y=Object.keys(o),v=0;v<y.length;v++)a[y[v]]=o[y[v]].toString()}else e.logError("Input set is neither an Array nor an Object");return e.OutputManyfest.setValueByHash(e.OutputObject,"outputDataSet",a),!0},y=function(e){var t=new i(e.InputManyfest.getValueByHash(e.InputObject,"a"));return e.OutputManyfest.setValueByHash(e.OutputObject,"x",t.toFraction().toString()),!0},v=function(t){_inherits(r,t);var n=_createSuper(r);function r(e){var t;return _classCallCheck(this,r),(t=n.call(this,e)).namespace="PreciseMath",t}return _createClass(r,[{key:"initializeInstructions",value:function(){return this.addInstruction("add",o),this.addInstruction("subtract",a),this.addInstruction("sub",a),this.addInstruction("multiply",s),this.addInstruction("mul",s),this.addInstruction("divide",u),this.addInstruction("div",u),this.addInstruction("aggregate",d),this.addInstruction("groupvaluesandaggregate",g),this.addInstruction("setprecision",f),this.addInstruction("setroundingmode",h),this.addInstruction("todecimalplaces",p),this.addInstruction("tosignificantdigits",l),this.addInstruction("round",c),this.addInstruction("tofraction",y),!0}},{key:"initializeOperations",value:function(){return this.addOperation("add",e("./Operations/PreciseMath-Add.json")),this.addOperation("subtract",e("./Operations/PreciseMath-Subtract.json")),this.addOperation("multiply",e("./Operations/PreciseMath-Multiply.json")),this.addOperation("divide",e("./Operations/PreciseMath-Divide.json")),this.addOperation("aggregate",e("./Operations/PreciseMath-Aggregate.json")),this.addOperation("groupvaluesandaggregate",e("./Operations/PreciseMath-GroupValuesAndAggregate.json")),this.addOperation("setprecision",e("./Operations/PreciseMath-SetPrecision.json")),this.addOperation("setroundingmode",e("./Operations/PreciseMath-SetRoundingMode.json")),this.addOperation("tosignificantdigits",e("./Operations/PreciseMath-ToSignificantDigits.json")),this.addOperation("todecimalplaces",e("./Operations/PreciseMath-ToDecimalPlaces.json")),this.addOperation("round",e("./Operations/PreciseMath-Round.json")),!0}}]),r}(r);t.exports=v},{"../Elucidator-InstructionSet.js":29,"./Operations/PreciseMath-Add.json":43,"./Operations/PreciseMath-Aggregate.json":44,"./Operations/PreciseMath-Divide.json":45,"./Operations/PreciseMath-GroupValuesAndAggregate.json":46,"./Operations/PreciseMath-Multiply.json":47,"./Operations/PreciseMath-Round.json":48,"./Operations/PreciseMath-SetPrecision.json":49,"./Operations/PreciseMath-SetRoundingMode.json":50,"./Operations/PreciseMath-Subtract.json":51,"./Operations/PreciseMath-ToDecimalPlaces.json":52,"./Operations/PreciseMath-ToSignificantDigits.json":53,"decimal.js":21}],59:[function(e,t,n){var r=e("../Elucidator-InstructionSet.js"),i=function(e){var t=e.InputManyfest.getValueByHash(e.InputObject,"inputDataSet"),n=e.InputManyfest.getValueByHash(e.InputObject,"groupByProperty"),r=e.InputManyfest.getValueByHash(e.InputObject,"groupValueProperty"),i={};if("object"==_typeof(t))if(Array.isArray(t))for(var o=0;o<t.length;o++)if("object"!==_typeof(t[o]))e.logInfo("Element [".concat(o,"] was not an object; skipping group operation."));else{var a=t[o],s=a[n];a.hasOwnProperty(n)||(e.logInfo("Element [".concat(o,"] doesn't have the group by property [").concat(n,"]; setting group to [__NO_GROUP].")),s="__NO_GROUP"),a.hasOwnProperty(r)?(i.hasOwnProperty(s)||(e.logInfo("Creating a new group [".concat(s,"] for element [").concat(o,"].")),i[s]=[]),i[s].push(a[r])):e.logInfo("Element [".concat(o,"] doesn't have the group value property [").concat(r,"]; skipping group operation."))}else for(var u=Object.keys(t),c=0;c<u.length;c++)if("object"!==_typeof(t[u[c]]))e.logInfo("Element [".concat(c,"] was not an object; skipping group operation."));else{var l=t[u[c]],p=l[n];l.hasOwnProperty(n)||(e.logInfo("Element [".concat(u[c],"][").concat(c,"] doesn't have the group by property [").concat(n,"]; setting group to [__NO_GROUP].")),p="__NO_GROUP"),l.hasOwnProperty(r)?(i.hasOwnProperty(p)||(e.logInfo("Creating a new group [".concat(p,"] for element [").concat(u[c],"][").concat(c,"].")),i[p]=[]),i[p].push(l[r])):e.logInfo("Element [".concat(u[c],"][").concat(c,"] doesn't have the group value property [").concat(r,"]; skipping group operation."))}else e.logError("Input set is neither an Array nor an Object");return e.OutputManyfest.setValueByHash(e.OutputObject,"outputDataSet",i),!0},o=function(t){_inherits(r,t);var n=_createSuper(r);function r(e){var t;return _classCallCheck(this,r),(t=n.call(this,e)).namespace="Set",t}return _createClass(r,[{key:"initializeInstructions",value:function(){return _get(_getPrototypeOf(r.prototype),"initializeInstructions",this).call(this),this.addInstruction("groupvaluesby",i),!0}},{key:"initializeOperations",value:function(){return this.addOperation("groupvaluesby",e("./Operations/Set-GroupValuesBy.json")),!0}}]),r}(r);t.exports=o},{"../Elucidator-InstructionSet.js":29,"./Operations/Set-GroupValuesBy.json":54}],60:[function(e,t,n){var r=e("../Elucidator-InstructionSet.js"),i=function(e){var t=e.InputManyfest.getValueByHash(e.InputObject,"inputString");return e.OutputManyfest.setValueByHash(e.OutputObject,"outputString",t.trim()),!0},o=function(e){var t=e.InputManyfest.getValueByHash(e.InputObject,"inputString"),n=e.InputManyfest.getValueByHash(e.InputObject,"searchFor"),r=e.InputManyfest.getValueByHash(e.InputObject,"replaceWith");return e.OutputManyfest.setValueByHash(e.OutputObject,"outputString",t.replace(n,r)),!0},a=function(e){var t=e.InputManyfest.getValueByHash(e.InputObject,"inputString"),n=e.InputManyfest.getValueByHash(e.InputObject,"indexStart"),r=e.InputManyfest.getValueByHash(e.InputObject,"indexEnd");return null!=r?e.OutputManyfest.setValueByHash(e.OutputObject,"outputString",t.substring(n,r)):e.OutputManyfest.setValueByHash(e.OutputObject,"outputString",t.substring(n)),!0},s=function(t){_inherits(r,t);var n=_createSuper(r);function r(e){var t;return _classCallCheck(this,r),(t=n.call(this,e)).namespace="String",t}return _createClass(r,[{key:"initializeInstructions",value:function(){return this.addInstruction("trim",i),this.addInstruction("replace",o),this.addInstruction("substring",a),!0}},{key:"initializeOperations",value:function(){return this.addOperation("trim",e("./Operations/String-Trim.json")),this.addOperation("replace",e("./Operations/String-Replace.json")),this.addOperation("substring",e("./Operations/String-Substring.json")),!0}}]),r}(r);t.exports=s},{"../Elucidator-InstructionSet.js":29,"./Operations/String-Replace.json":55,"./Operations/String-Substring.json":56,"./Operations/String-Trim.json":57}],61:[function(e,t,n){
|
|
50
|
+
/**
|
|
51
|
+
* Base Logger Class
|
|
52
|
+
*
|
|
53
|
+
* @license MIT
|
|
54
|
+
*
|
|
55
|
+
* @author Steven Velozo <steven@velozo.com>
|
|
56
|
+
*/
|
|
57
|
+
var r=function(){function e(t,n){_classCallCheck(this,e),this._Settings="object"==_typeof(t)?t:{},this.loggerUUID=this.generateInsecureUUID(),this.levels=["trace","debug","info","warn","error","fatal"]}return _createClass(e,[{key:"generateInsecureUUID",value:function(){var e=(new Date).getTime();return"LOGSTREAM-xxxxxx-yxxxxx".replace(/[xy]/g,(function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?n:3&n|8).toString(16)}))}},{key:"initialize",value:function(){}},{key:"trace",value:function(e,t){this.write("trace",e,t)}},{key:"debug",value:function(e,t){this.write("debug",e,t)}},{key:"info",value:function(e,t){this.write("info",e,t)}},{key:"warn",value:function(e,t){this.write("warn",e,t)}},{key:"error",value:function(e,t){this.write("error",e,t)}},{key:"fatal",value:function(e,t){this.write("fatal",e,t)}},{key:"write",value:function(e,t,n){return!0}}]),e}();t.exports=r},{}],62:[function(e,t,n){
|
|
58
|
+
/**
|
|
59
|
+
* Default Logger Provider Function
|
|
60
|
+
*
|
|
61
|
+
* @license MIT
|
|
62
|
+
*
|
|
63
|
+
* @author Steven Velozo <steven@velozo.com>
|
|
64
|
+
*/
|
|
65
|
+
var r;t.exports=((r={}).console=e("./Fable-Log-Logger-Console.js"),r.default=r.console,r)},{"./Fable-Log-Logger-Console.js":64}],63:[function(e,t,n){t.exports=[{loggertype:"console",streamtype:"console",level:"trace"}]},{}],64:[function(e,t,n){var r=function(e){_inherits(n,e);var t=_createSuper(n);function n(e,r){var i;_classCallCheck(this,n),(i=t.call(this,e))._ShowTimeStamps=!i._Settings.hasOwnProperty("showtimestamps")||1==i._Settings.showtimestamps,i._FormattedTimeStamps=!i._Settings.hasOwnProperty("formattedtimestamps")||1==i._Settings.formattedtimestamps,i._ContextMessage=i._Settings.hasOwnProperty("Context")?"(".concat(i._Settings.Context,")"):r._Settings.hasOwnProperty("Product")?"(".concat(r._Settings.Product,")"):"Unnamed_Log_Context",i._OutputLogLinesToConsole=!i._Settings.hasOwnProperty("outputloglinestoconsole")||i._Settings.outputloglinestoconsole,i._OutputObjectsToConsole=!i._Settings.hasOwnProperty("outputobjectstoconsole")||i._Settings.outputobjectstoconsole,i.prefixCache={};for(var o=0;o<=i.levels.length;o++)i.prefixCache[i.levels[o]]="[".concat(i.levels[o],"] ").concat(i._ContextMessage,": "),i._ShowTimeStamps&&(i.prefixCache[i.levels[o]]=" "+i.prefixCache[i.levels[o]]);return i}return _createClass(n,[{key:"write",value:function(e,t,n){var r="";this._ShowTimeStamps&&this._FormattedTimeStamps?r=(new Date).toISOString():this._ShowTimeStamps&&(r=+new Date);var i="".concat(r).concat(this.prefixCache[e]).concat(t);return this._OutputLogLinesToConsole&&console.log(i),this._OutputObjectsToConsole&&void 0!==n&&console.log(JSON.stringify(n,null,2)),i}}]),n}(e("./Fable-Log-BaseLogger.js"));t.exports=r},{"./Fable-Log-BaseLogger.js":61}],65:[function(e,t,n){var r=e("./Fable-Log-Logger-Console.js"),i=e("fs"),o=e("path"),a=function(e){_inherits(n,e);var t=_createSuper(n);function n(e,r){var a;return _classCallCheck(this,n),(a=t.call(this,e,r)).logFileRawPath=a._Settings.hasOwnProperty("path")?a._Settings.path:"./".concat(a._ContextMessage,".log"),a.logFilePath=o.normalize(a.logFileRawPath),a.logFileStreamOptions=a._Settings.hasOwnProperty("fileStreamoptions")?a._Settings.fileStreamOptions:{flags:"a",encoding:"utf8"},a.fileWriter=i.createWriteStream(a.logFilePath,a.logFileStreamOptions),a.activelyWriting=!1,a.logLineStrings=[],a.logObjectStrings=[],a.defaultWriteCompleteCallback=function(){},a.defaultBufferFlushCallback=function(){},a}return _createClass(n,[{key:"closeWriter",value:function(e){var t="function"==typeof e?e:function(){};if(this.fileWriter)return this.fileWriter.end("\n"),this.fileWriter.once("finish",t.bind(this))}},{key:"completeBufferFlushToLogFile",value:function(e){this.activelyWriting=!1;var t="function"==typeof e?e:this.defaultBufferFlushCallback;if(!(this.logLineStrings.length>0))return t();this.flushBufferToLogFile(t)}},{key:"flushBufferToLogFile",value:function(e){if(!this.activelyWriting){this.activelyWriting=!0;var t="function"==typeof e?e:this.defaultBufferFlushCallback,n=this.logLineStrings,r=this.logObjectStrings;this.logLineStrings=[],this.logObjectStrings=[];for(var i="",o=0;o<n.length;o++)i+="".concat(n[o],"\n"),!1!==r[o]&&(i+="".concat(r[o],"\n"));if(this.fileWriter.write(i,"utf8"))return this.completeBufferFlushToLogFile(t);this.fileWriter.once("drain",this.completeBufferFlushToLogFile.bind(this,t))}}},{key:"write",value:function(e,t,r){var i=_get(_getPrototypeOf(n.prototype),"write",this).call(this,e,t,r);this.logLineStrings.push(i),void 0!==r?this.logObjectStrings.push(JSON.stringify(r,null,4)):this.logObjectStrings.push(!1),this.flushBufferToLogFile()}}]),n}(r);t.exports=a},{"./Fable-Log-Logger-Console.js":64,fs:16,path:94}],66:[function(e,t,n){
|
|
66
|
+
/**
|
|
67
|
+
* Fable Logging Add-on
|
|
68
|
+
*
|
|
69
|
+
* @license MIT
|
|
70
|
+
*
|
|
71
|
+
* @author Steven Velozo <steven@velozo.com>
|
|
72
|
+
* @module Fable Logger
|
|
73
|
+
*/
|
|
74
|
+
var r=function(){function t(n,r){_classCallCheck(this,t);var i="object"===_typeof(n)?n:{};this._Settings=i,this._Providers=e("./Fable-Log-DefaultProviders-Node.js"),this._StreamDefinitions=i.hasOwnProperty("LogStreams")?i.LogStreams:e("./Fable-Log-DefaultStreams.json"),this.logStreams=[],this.logProviders={},this.activeLogStreams={},this.logStreamsTrace=[],this.logStreamsDebug=[],this.logStreamsInfo=[],this.logStreamsWarn=[],this.logStreamsError=[],this.logStreamsFatal=[],this.datumDecorator=function(e){return e},this.uuid="string"==typeof i.Product?i.Product:"Default"}return _createClass(t,[{key:"addLogger",value:function(e,t){if(this.activeLogStreams.hasOwnProperty(e.loggerUUID))return!1;switch(this.logStreams.push(e),this.activeLogStreams[e.loggerUUID]=!0,t){case"trace":this.logStreamsTrace.push(e);case"debug":this.logStreamsDebug.push(e);case"info":this.logStreamsInfo.push(e);case"warn":this.logStreamsWarn.push(e);case"error":this.logStreamsError.push(e);case"fatal":this.logStreamsFatal.push(e)}return!0}},{key:"setDatumDecorator",value:function(e){this.datumDecorator="function"==typeof e?e:function(e){return e}}},{key:"trace",value:function(e,t){for(var n=this.datumDecorator(t),r=0;r<this.logStreamsTrace.length;r++)this.logStreamsTrace[r].trace(e,n)}},{key:"debug",value:function(e,t){for(var n=this.datumDecorator(t),r=0;r<this.logStreamsDebug.length;r++)this.logStreamsDebug[r].debug(e,n)}},{key:"info",value:function(e,t){for(var n=this.datumDecorator(t),r=0;r<this.logStreamsInfo.length;r++)this.logStreamsInfo[r].info(e,n)}},{key:"warn",value:function(e,t){for(var n=this.datumDecorator(t),r=0;r<this.logStreamsWarn.length;r++)this.logStreamsWarn[r].warn(e,n)}},{key:"error",value:function(e,t){for(var n=this.datumDecorator(t),r=0;r<this.logStreamsError.length;r++)this.logStreamsError[r].error(e,n)}},{key:"fatal",value:function(e,t){for(var n=this.datumDecorator(t),r=0;r<this.logStreamsFatal.length;r++)this.logStreamsFatal[r].fatal(e,n)}},{key:"initialize",value:function(){for(var e=0;e<this._StreamDefinitions.length;e++){var t=Object.assign({loggertype:"default",streamtype:"console",level:"info"},this._StreamDefinitions[e]);this._Providers.hasOwnProperty(t.loggertype)?this.addLogger(new this._Providers[t.loggertype](t,this),t.level):console.log("Error initializing log stream: bad loggertype in stream definition ".concat(JSON.stringify(t)))}for(var n=0;n<this.logStreams.length;n++)this.logStreams[n].initialize()}},{key:"logTime",value:function(e,t){var n=void 0!==e?e:"Time",r=new Date;this.info("".concat(n," ").concat(r," (epoch ").concat(+r,")"),t)}},{key:"getTimeStamp",value:function(){return+new Date}},{key:"getTimeDelta",value:function(e){return+new Date-e}},{key:"logTimeDelta",value:function(e,t,n){var r=void 0!==t?t:"Time Measurement",i=(_typeof(n),+new Date);this.info("".concat(r," logged at (epoch ").concat(+i,") took (").concat(e,"ms)"),n)}},{key:"logTimeDeltaHuman",value:function(e,t,n){var r=void 0!==t?t:"Time Measurement",i=+new Date,o=parseInt(e%1e3),a=parseInt(e/1e3%60),s=parseInt(e/6e4%60),u=parseInt(e/36e5);o=o<10?"00"+o:o<100?"0"+o:o,a=a<10?"0"+a:a,s=s<10?"0"+s:s,u=u<10?"0"+u:u,this.info("".concat(r," logged at (epoch ").concat(+i,") took (").concat(e,"ms) or (").concat(u,":").concat(s,":").concat(a,".").concat(o,")"),n)}},{key:"logTimeDeltaRelative",value:function(e,t,n){this.logTimeDelta(this.getTimeDelta(e),t,n)}},{key:"logTimeDeltaRelativeHuman",value:function(e,t,n){this.logTimeDeltaHuman(this.getTimeDelta(e),t,n)}}]),t}();t.exports=r,t.exports.new=function(e){return new r(e)},t.exports.LogProviderBase=e("./Fable-Log-BaseLogger.js"),t.exports.LogProviderConsole=e("./Fable-Log-Logger-Console.js"),t.exports.LogProviderConsole=e("./Fable-Log-Logger-SimpleFlatFile.js")},{"./Fable-Log-BaseLogger.js":61,"./Fable-Log-DefaultProviders-Node.js":62,"./Fable-Log-DefaultStreams.json":63,"./Fable-Log-Logger-Console.js":64,"./Fable-Log-Logger-SimpleFlatFile.js":65}],67:[function(e,t,n){t.exports={Product:"ApplicationNameHere",ProductVersion:"0.0.0",ConfigFile:!1,LogStreams:[{level:"trace"}]}},{}],68:[function(e,t,n){(function(e){(function(){
|
|
75
|
+
/**
|
|
76
|
+
* Fable Settings Template Processor
|
|
77
|
+
*
|
|
78
|
+
* This class allows environment variables to come in via templated expressions, and defaults to be set.
|
|
79
|
+
*
|
|
80
|
+
* @license MIT
|
|
81
|
+
*
|
|
82
|
+
* @author Steven Velozo <steven@velozo.com>
|
|
83
|
+
* @module Fable Settings
|
|
84
|
+
*/
|
|
85
|
+
var n=function(){function t(n){_classCallCheck(this,t),this.templateProcessor=new n.precedent,this.templateProcessor.addPattern("${","}",(function(t){var n=t.trim(),r=n.indexOf("|"),i=n.substring(r+1),o=r>-1?n.substring(0,r):n;return e.env.hasOwnProperty(o)?e.env[o]:i}))}return _createClass(t,[{key:"parseSetting",value:function(e){return this.templateProcessor.parseString(e)}}]),t}();t.exports=n}).call(this)}).call(this,e("_process"))},{_process:98}],69:[function(e,t,n){
|
|
86
|
+
/**
|
|
87
|
+
* Fable Settings Add-on
|
|
88
|
+
*
|
|
89
|
+
* @license MIT
|
|
90
|
+
*
|
|
91
|
+
* @author Steven Velozo <steven@velozo.com>
|
|
92
|
+
* @module Fable Settings
|
|
93
|
+
*/
|
|
94
|
+
var r=e("precedent"),i=e("./Fable-Settings-TemplateProcessor.js"),o=function(){function t(n){_classCallCheck(this,t),this.dependencies={precedent:r},this.settingsTemplateProcessor=new i(this.dependencies),this._configureEnvTemplating(n),this.default=this.buildDefaultSettings();var o=this.merge(n,this.buildDefaultSettings());if(this.base=JSON.parse(JSON.stringify(o)),o.DefaultConfigFile)try{o=this.merge(e(o.DefaultConfigFile),o)}catch(e){console.log("Fable-Settings Warning: Default configuration file specified but there was a problem loading it. Falling back to base."),console.log(" Loading Exception: "+e)}if(o.ConfigFile)try{o=this.merge(e(o.ConfigFile),o)}catch(e){console.log("Fable-Settings Warning: Configuration file specified but there was a problem loading it. Falling back to base."),console.log(" Loading Exception: "+e)}this.settings=o}return _createClass(t,[{key:"buildDefaultSettings",value:function(){return JSON.parse(JSON.stringify(e("./Fable-Settings-Default")))}},{key:"_configureEnvTemplating",value:function(e){this._PerformEnvTemplating=!e||!0!==e.NoEnvReplacement}},{key:"_resolveEnv",value:function(e){for(var t in e)"object"===_typeof(e[t])?this._resolveEnv(e[t]):"string"==typeof e[t]&&(e[t]=this.settingsTemplateProcessor.parseSetting(e[t]))}},{key:"_isObject",value:function(e){return"object"===_typeof(e)&&!Array.isArray(e)}},{key:"_deepMergeObjects",value:function(e,t){var n=this;if(t&&this._isObject(t))return Object.keys(t).forEach((function(r){var i=t[r];if(n._isObject(i)){var o=e[r];if(o&&n._isObject(o))return void n._deepMergeObjects(o,i)}e[r]=i})),e}},{key:"merge",value:function(e,t){var n="object"===_typeof(e)?e:{},r="object"===_typeof(t)?t:this.settings,i=JSON.parse(JSON.stringify(n));return r=this._deepMergeObjects(r,i),this._PerformEnvTemplating&&this._resolveEnv(r),this._configureEnvTemplating(r),r}},{key:"fill",value:function(e){var t="object"===_typeof(e)?e:{},n=JSON.parse(JSON.stringify(t));return this.settings=this._deepMergeObjects(n,this.settings),this.settings}}]),t}();t.exports=o,t.exports.new=function(e){return new o(e)},t.exports.precedent=r},{"./Fable-Settings-Default":67,"./Fable-Settings-TemplateProcessor.js":68,precedent:95}],70:[function(e,t,n){
|
|
95
|
+
/**
|
|
96
|
+
* Random Byte Generator - Browser version
|
|
97
|
+
*
|
|
98
|
+
* @license MIT
|
|
99
|
+
*
|
|
100
|
+
* @author Steven Velozo <steven@velozo.com>
|
|
101
|
+
*/
|
|
102
|
+
var r=function(){function e(){_classCallCheck(this,e),this.getRandomValues="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)}return _createClass(e,[{key:"generateWhatWGBytes",value:function(){var e=new Uint8Array(16);return this.getRandomValues(e),e}},{key:"generateRandomBytes",value:function(){for(var e,t=new Uint8Array(16),n=0;n<16;n++)0==(3&n)&&(e=4294967296*Math.random()),t[n]=e>>>((3&n)<<3)&255;return t}},{key:"generate",value:function(){return this.getRandomValues?this.generateWhatWGBytes():this.generateRandomBytes()}}]),e}();t.exports=r},{}],71:[function(e,t,n){
|
|
103
|
+
/**
|
|
104
|
+
* Fable UUID Generator
|
|
105
|
+
*
|
|
106
|
+
* @license MIT
|
|
107
|
+
*
|
|
108
|
+
* @author Steven Velozo <steven@velozo.com>
|
|
109
|
+
* @module Fable UUID
|
|
110
|
+
*/
|
|
111
|
+
var r=e("./Fable-UUID-Random.js"),i=function(){function e(t){_classCallCheck(this,e),this._UUIDModeRandom=!("object"!==_typeof(t)||!t.hasOwnProperty("UUIDModeRandom"))&&1==t.UUIDModeRandom,this._UUIDLength="object"===_typeof(t)&&t.hasOwnProperty("UUIDLength")?t.UUIDLength+0:8,this._UUIDRandomDictionary="object"===_typeof(t)&&t.hasOwnProperty("UUIDDictionary")?t.UUIDDictionary+0:"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",this.randomByteGenerator=new r,this._HexLookup=[];for(var n=0;n<256;++n)this._HexLookup[n]=(n+256).toString(16).substr(1)}return _createClass(e,[{key:"bytesToUUID",value:function(e){var t=0;return[this._HexLookup[e[t++]],this._HexLookup[e[t++]],this._HexLookup[e[t++]],this._HexLookup[e[t++]],"-",this._HexLookup[e[t++]],this._HexLookup[e[t++]],"-",this._HexLookup[e[t++]],this._HexLookup[e[t++]],"-",this._HexLookup[e[t++]],this._HexLookup[e[t++]],"-",this._HexLookup[e[t++]],this._HexLookup[e[t++]],this._HexLookup[e[t++]],this._HexLookup[e[t++]],this._HexLookup[e[t++]],this._HexLookup[e[t++]]].join("")}},{key:"generateUUIDv4",value:function(){new Array(16);var e=this.randomByteGenerator.generate();return e[6]=15&e[6]|64,e[8]=63&e[8]|128,this.bytesToUUID(e)}},{key:"generateRandom",value:function(){for(var e="",t=0;t<this._UUIDLength;t++)e+=this._UUIDRandomDictionary.charAt(Math.floor(Math.random()*(this._UUIDRandomDictionary.length-1)));return e}},{key:"getUUID",value:function(){return this._UUIDModeRandom?this.generateRandom():this.generateUUIDv4()}}]),e}();t.exports=i,t.exports.new=function(e){return new i(e)}},{"./Fable-UUID-Random.js":70}],72:[function(e,t,n){var r=JSON.stringify({Metadata:{GUID:!1,Hash:!1,Title:"",Summary:"",Version:0},Status:{Completed:!1,CompletionProgress:0,CompletionTimeElapsed:0,Steps:1,StepsCompleted:0,StartTime:0,EndTime:0},Errors:[],Log:[]}),i=function(){function e(t,n,i){_classCallCheck(this,e),this.fable=t,this.name=n,this.state=JSON.parse(r),this.state.Metadata.GUID=this.fable.getUUID(),this.state.Metadata.Hash=this.state.GUID,"string"==typeof i&&(this.state.Metadata.Hash=i)}return _createClass(e,[{key:"GUID",get:function(){return this.state.Metadata.GUID}},{key:"Hash",get:function(){return this.state.Metadata.Hash}},{key:"log",get:function(){return this}},{key:"writeOperationLog",value:function(e,t,n){this.state.Log.push("".concat((new Date).toUTCString()," [").concat(e,"]: ").concat(t)),"object"==_typeof(n)&&this.state.Log.push(JSON.stringify(n))}},{key:"writeOperationErrors",value:function(e,t){this.state.Errors.push("".concat(e)),"object"==_typeof(t)&&this.state.Errors.push(JSON.stringify(t))}},{key:"trace",value:function(e,t){this.writeOperationLog("TRACE",e,t),this.fable.log.trace(e,t)}},{key:"debug",value:function(e,t){this.writeOperationLog("DEBUG",e,t),this.fable.log.debug(e,t)}},{key:"info",value:function(e,t){this.writeOperationLog("INFO",e,t),this.fable.log.info(e,t)}},{key:"warn",value:function(e,t){this.writeOperationLog("WARN",e,t),this.fable.log.warn(e,t)}},{key:"error",value:function(e,t){this.writeOperationLog("ERROR",e,t),this.writeOperationErrors(e,t),this.fable.log.error(e,t)}},{key:"fatal",value:function(e,t){this.writeOperationLog("FATAL",e,t),this.writeOperationErrors(e,t),this.fable.log.fatal(e,t)}}]),e}();t.exports=i},{}],73:[function(e,t,n){var r=e("./Fable-ServiceProviderBase.js"),i=e("data-arithmatic"),o=function(e){_inherits(n,e);var t=_createSuper(n);function n(e,r,o){var a;return _classCallCheck(this,n),(a=t.call(this,e,r,o)).serviceType="DataArithmatic",a._DataArithmaticLibrary=new i,a}return _createClass(n)}(r);t.exports=o},{"./Fable-ServiceProviderBase.js":78,"data-arithmatic":20}],74:[function(e,t,n){var r=e("./Fable-ServiceProviderBase.js"),i=e("precedent"),o=function(e){_inherits(n,e);var t=_createSuper(n);function n(e,r,o){var a;return _classCallCheck(this,n),(a=t.call(this,e,r,o)).serviceType="MetaTemplate",a._MetaTemplateLibrary=new i(a.options),a}return _createClass(n,[{key:"addPattern",value:function(e,t,n){return this._MetaTemplateLibrary.addPattern(e,t,n)}},{key:"parseString",value:function(e,t){return this._MetaTemplateLibrary.parseString(e,t)}}]),n}(r);t.exports=o},{"./Fable-ServiceProviderBase.js":78,precedent:95}],75:[function(e,t,n){var r=function(e){_inherits(n,e);var t=_createSuper(n);function n(e,r,i){var o;return _classCallCheck(this,n),(o=t.call(this,e,r,i)).serviceType="Template",o.Matchers={Evaluate:/<%([\s\S]+?)%>/g,Interpolate:/<%=([\s\S]+?)%>/g,Escaper:/\\|'|\r|\n|\t|\u2028|\u2029/g,Unescaper:/\\(\\|'|r|n|t|u2028|u2029)/g,GuaranteedNonMatch:/.^/},o.templateEscapes={"\\":"\\","'":"'",r:"\r","\r":"r",n:"\n","\n":"n",t:"\t","\t":"t",u2028:"\u2028","\u2028":"u2028",u2029:"\u2029","\u2029":"u2029"},o.renderFunction=!1,o.templateString=!1,o}return _createClass(n,[{key:"renderTemplate",value:function(e){return this.renderFunction(e)}},{key:"templateFunction",value:function(e){return this.renderTemplate.bind(this)}},{key:"buildTemplateFunction",value:function(e,t){var n=this;return this.TemplateSource="__p+='"+e.replace(this.Matchers.Escaper,(function(e){return"\\".concat(n.templateEscapes[e])})).replace(this.Matchers.Interpolate||this.Matchers.GuaranteedNonMatch,(function(e,t){return"'+\n(".concat(decodeURIComponent(t),")+\n'")})).replace(this.Matchers.Evaluate||this.Matchers.GuaranteedNonMatch,(function(e,t){return"';\n".concat(decodeURIComponent(t),"\n;__p+='")}))+"';\n",this.TemplateSource="with(pTemplateDataObject||{}){\n".concat(this.TemplateSource,"}\n"),this.TemplateSource="var __p='';var print=function(){__p+=Array.prototype.join.call(arguments, '')};\n".concat(this.TemplateSource,"return __p;\n"),this.renderFunction=new Function("pTemplateDataObject",this.TemplateSource),void 0!==t?this.renderFunction(t):(this.TemplateSourceCompiled="function(obj){\n"+this.TemplateSource+"}",this.templateFunction())}}]),n}(e("./Fable-ServiceProviderBase.js"));t.exports=r},{"./Fable-ServiceProviderBase.js":78}],76:[function(e,t,n){var r=e("./Fable-ServiceProviderBase.js"),i=e("async.waterfall"),o=e("async.eachlimit"),a=function(e){_inherits(n,e);var t=_createSuper(n);function n(e,r,a){var s;return _classCallCheck(this,n),(s=t.call(this,e,r,a)).templates={},s.waterfall=i,s.eachLimit=o,s}return _createClass(n,[{key:"extend",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Object.assign.apply(Object,[e].concat(n))}},{key:"template",value:function(e,t){return this.fable.serviceManager.instantiateServiceProviderWithoutRegistration("Template").buildTemplateFunction(e,t)}},{key:"buildHashedTemplate",value:function(e,t,n){var r=this.fable.serviceManager.instantiateServiceProvider("Template",{},e);return this.templates[e]=r.buildTemplateFunction(t,n),this.templates[e]}},{key:"chunk",value:function(e,t,n){var r=_toConsumableArray(e),i="number"==typeof t?t:0,o=void 0!==n?n:[];if(i<=0)return o;for(;r.length;)o.push(r.splice(0,i));return o}}]),n}(r);t.exports=a},{"./Fable-ServiceProviderBase.js":78,"async.eachlimit":1,"async.waterfall":15}],77:[function(e,t,n){
|
|
112
|
+
/**
|
|
113
|
+
* Fable Application Services Management
|
|
114
|
+
* @license MIT
|
|
115
|
+
* @author <steven@velozo.com>
|
|
116
|
+
*/
|
|
117
|
+
var r=e("./Fable-ServiceProviderBase.js"),i=function(){function e(t){_classCallCheck(this,e),this.fable=t,this.serviceTypes=[],this.services={},this.defaultServices={},this.serviceClasses={}}return _createClass(e,[{key:"addServiceType",value:function(e,t){this.serviceTypes.push(e),this.services[e]={},"function"==typeof t&&t.prototype instanceof r?this.serviceClasses[e]=t:this.serviceClasses[e]=r}},{key:"instantiateServiceProvider",value:function(e,t,n){var r=this.instantiateServiceProviderWithoutRegistration(e,t,n);return this.services[e][r.Hash]=r,this.defaultServices.hasOwnProperty(e)||(this.defaultServices[e]=r),r}},{key:"instantiateServiceProviderWithoutRegistration",value:function(e,t,n){return new this.serviceClasses[e](this.fable,t,n)}},{key:"setDefaultServiceInstantiation",value:function(e,t){return!!this.services[e].hasOwnProperty(t)&&(this.defaultServices[e]=this.services[e][t],!0)}}]),e}();t.exports=i,t.exports.ServiceProviderBase=r},{"./Fable-ServiceProviderBase.js":78}],78:[function(e,t,n){
|
|
118
|
+
/**
|
|
119
|
+
* Fable Service Base
|
|
120
|
+
* @license MIT
|
|
121
|
+
* @author <steven@velozo.com>
|
|
122
|
+
*/
|
|
123
|
+
var r=_createClass((function e(t,n,r){_classCallCheck(this,e),this.fable=t,this.options="object"===_typeof(n)?n:{},this.serviceType="Unknown",this.UUID=t.getUUID(),this.Hash="string"==typeof r?r:"".concat(this.UUID)}));t.exports=r},{}],79:[function(e,t,n){
|
|
124
|
+
/**
|
|
125
|
+
* Fable Application Services Support Library
|
|
126
|
+
* @license MIT
|
|
127
|
+
* @author <steven@velozo.com>
|
|
128
|
+
*/
|
|
129
|
+
var r=e("fable-settings"),i=e("fable-uuid"),o=e("fable-log"),a=e("./Fable-ServiceManager.js"),s=e("./Fable-Service-DataArithmatic.js"),u=e("./Fable-Service-Template.js"),c=e("./Fable-Service-MetaTemplate.js"),l=e("./Fable-Service-Utility.js"),p=e("./Fable-Operation.js"),f=function(){function e(t){_classCallCheck(this,e);var n=new r(t);this.settingsManager=n,this.libUUID=new i(this.settingsManager.settings),this.log=new o(this.settingsManager.settings),this.log.initialize(),this.Dependencies={precedent:r.precedent},this.Operations={},this.serviceManager=new a(this),this.serviceManager.addServiceType("DataArithmatic",s),this.fable.serviceManager.instantiateServiceProvider("DataArithmatic",{},"Default-Service-DataArithmatic"),this.DataArithmatic=this.serviceManager.defaultServices.DataArithmatic._DataArithmaticLibrary,this.serviceManager.addServiceType("Template",u),this.serviceManager.addServiceType("MetaTemplate",c),this.serviceManager.addServiceType("Utility",l),this.fable.serviceManager.instantiateServiceProvider("Utility",{},"Default-Service-Utility"),this.Utility=this.serviceManager.defaultServices.Utility,this.services=this.serviceManager.services,this.defaultServices=this.serviceManager.defaultServices}return _createClass(e,[{key:"settings",get:function(){return this.settingsManager.settings}},{key:"fable",get:function(){return this}},{key:"getUUID",value:function(){return this.libUUID.getUUID()}},{key:"createOperation",value:function(e,t){var n=new p(this,e,t);return this.Operations.hasOwnProperty(n.Hash)||(this.Operations[n.Hash]=n),n}},{key:"getOperation",value:function(e){return!!this.Operations.hasOwnProperty(e)&&this.Operations[e]}}]),e}();t.exports=f,t.exports.new=function(e){return new f(e)},t.exports.LogProviderBase=o.LogProviderBase,t.exports.ServiceProviderBase=a.ServiceProviderBase,t.exports.precedent=r.precedent},{"./Fable-Operation.js":72,"./Fable-Service-DataArithmatic.js":73,"./Fable-Service-MetaTemplate.js":74,"./Fable-Service-Template.js":75,"./Fable-Service-Utility.js":76,"./Fable-ServiceManager.js":77,"fable-log":66,"fable-settings":69,"fable-uuid":71}],80:[function(e,t,n){
|
|
130
|
+
/**
|
|
131
|
+
* @license MIT
|
|
132
|
+
* @author <steven@velozo.com>
|
|
133
|
+
*/
|
|
134
|
+
var r=function(){function e(t){_classCallCheck(this,e),this._Settings=t}return _createClass(e,[{key:"writeConsole",value:function(e,t,n){console.log("["+e+"] ("+this._Settings.Form+") "+t),void 0!==n&&console.log(JSON.stringify(n,null,4))}},{key:"trace",value:function(e,t){this.writeConsole("TRACE",e,t)}},{key:"debug",value:function(e,t){this.writeConsole("DEBUG",e,t)}},{key:"info",value:function(e,t){this.writeConsole("INFO",e,t)}},{key:"warning",value:function(e,t){this.writeConsole("WARNING",e,t)}},{key:"error",value:function(e,t){this.writeConsole("ERROR",e,t)}},{key:"logTime",value:function(e){var t=void 0!==e?e:"Time",n=new Date;this.info(t+": "+n.toString())}},{key:"getTimeStamp",value:function(){return+new Date}},{key:"getTimeDelta",value:function(e){return+new Date-e}},{key:"logTimeDelta",value:function(e,t){var n=void 0!==t?t:"Time Measurement",r=+new Date-e;this.info(n+" ("+r+"ms)")}}]),e}();t.exports=r},{}],81:[function(e,t,n){
|
|
135
|
+
/**
|
|
136
|
+
* @license MIT
|
|
137
|
+
* @author <steven@velozo.com>
|
|
138
|
+
*/
|
|
139
|
+
var r=e("deep-object-diff"),i=e("cachetrax"),o=function(){function t(n,r,o){_classCallCheck(this,t),this._Dependencies={},this._Dependencies.jqueryLibrary=e("jquery"),this._NonHTMLState={},this._NonHTMLStateProperty="__InformaryNonHTMLState",this._Settings="object"===_typeof(n)?n:{Form:"UNSET_HTML_FORM_ID",User:0,UndoLevels:25,DebugLog:!1},this._Settings.__VirtualDOM?this._Dependencies.jquery=this._Dependencies.jqueryLibrary(this._Settings.__VirtualDOM):this._Dependencies.jquery=this._Dependencies.jqueryLibrary,this._Settings.User||(this._Settings.User=0),this._Settings.Form||(this._Settings.Form="UNSET_HTML_FORM_ID"),this._Log=new(e("./Informary-Log.js"))(this._Settings),this.log=this._Log,this._LocalStorage=null,this._UndoKeys=[],this._UndoBuffer=new i,this._UndoBuffer.maxLength=this._Settings.UndoLevels?this._Settings.UndoLevels:25,this._RedoKeys=[],this._RedoBuffer=new i,this._RedoBuffer.maxLength=this._UndoBuffer.maxLength,this._SourceDocumentState=!1,this._CurrentDocumentState=!1,this._Context=r?r.toString():"InformaryDefaultContext",this._ContextGUID=o?o.toString():"0x000000001"}return _createClass(t,[{key:"setStorageProvider",value:function(e){this._LocalStorage=e}},{key:"checkStorageProvider",value:function(){if(!this._LocalStorage&&(this._LocalStorage=window.localStorage,!this._LocalStorage)){var e={};this._LocalStorage={setItem:function(t,n){e[t]=n},getItem:function(t){return e[t]},removeItem:function(t){delete e[t]}}}}},{key:"getIndexKey",value:function(e){return"Informary_Index_User[".concat(this._Settings.User.toString(),"]_ValueType[").concat(e,"]")}},{key:"getStorageKey",value:function(e){return"Informary_Data_User[".concat(this._Settings.User.toString(),"]_ValueType[").concat(e,"]_Context[").concat(this._Context,"]_ContextGUID[").concat(this._ContextGUID,"]")}},{key:"readIndex",value:function(e){this.checkStorageProvider();var t=!1,n=this._LocalStorage.getItem(this.getIndexKey(e));if(n)try{t=JSON.parse(n)}catch(t){this.log.error("Error parsing local storage index key [".concat(this.getIndexKey(e),"]"))}return t||(t={IndexCreateTime:Date.now(),IndexUser:this._Settings.User}),t.IndexLastReadTime=Date.now(),t}},{key:"readIndexValue",value:function(e){var t=this.readIndex(e)[this.getStorageKey(e)];return t||!1}},{key:"touchIndex",value:function(e){this.checkStorageProvider();var t=this.readIndex(e);t[this.getStorageKey(e)]={Time:Date.now(),ValueType:e,User:this._Settings.User,Context:this._Context,ContextGUID:this._ContextGUID},this._LocalStorage.setItem(this.getIndexKey(e),JSON.stringify(t))}},{key:"readData",value:function(e){this.checkStorageProvider();var t=this._LocalStorage.getItem(this.getStorageKey(e));if(t)try{t=JSON.parse(t)}catch(n){this.log.error("Error parsing local storage key [".concat(this.getStorageKey(e),"]")),t=!1}else t=!1;return t}},{key:"writeData",value:function(e,t){this.checkStorageProvider(),this.touchIndex(e),this._LocalStorage.setItem(this.getStorageKey(e),JSON.stringify(t))}},{key:"deleteData",value:function(e){this.checkStorageProvider(),this.touchIndex(e),this._LocalStorage.removeItem(this.getStorageKey(e))}},{key:"getValueAtAddress",value:function(e,t){if("object"===!_typeof(e))return!1;if("string"===!_typeof(t))return!1;var n=t.indexOf(".");if(-1===n)return e[t];var r=t.substring(0,n),i=t.substring(n+1);return(!e.hasOwnProperty(r)||"object"===_typeof(e[r]))&&(e.hasOwnProperty(r)||(e[r]={}),this.getValueAtAddress(e[r],i))}},{key:"setValueAtAddress",value:function(e,t,n){if("object"===!_typeof(e))return!1;if("string"===!_typeof(t))return!1;var r=t.indexOf(".");if(-1===r)return e[t]=n,!0;var i=t.substring(0,r),o=t.substring(r+1);return e.hasOwnProperty(i)&&"object"!==_typeof(e[i])?(e.hasOwnProperty("__ERROR")||(e.__ERROR={}),e.__ERROR[t]=n,!1):(e.hasOwnProperty(i)||(e[i]={}),this.setValueAtAddress(e[i],o,n))}},{key:"setValueAtAddressInContainer",value:function(e,t,n,r,i){var o=this.getValueAtAddress(e,t);if("string"!=typeof t)return!1;var a=parseInt(n,10);if(isNaN(a))return!1;"object"===_typeof(o)&&Array.isArray(o)||(o=[],this.setValueAtAddress(e,t,o));for(var s=0;o.length+s<=a+1;s++)o.push({});return this.setValueAtAddress(o[a],r,i)}},{key:"storeSourceData",value:function(e){return this.writeData("Source",e)}},{key:"storeRecoveryData",value:function(e){var t=this,n="function"==typeof e?e:function(){},r={};this.marshalFormToData(r,(function(){return t._RecoveryDocumentState=r,n(t.writeData("Recovery",t._RecoveryDocumentState))}))}},{key:"snapshotData",value:function(){var e=this,t=Date.now().toString(),n=JSON.stringify(this._RecoveryDocumentState);this.storeRecoveryData((function(){if(n!=JSON.stringify(e._RecoveryDocumentState)){for(e._Settings.DebugLog&&e.log.debug("Creating recovery snapshot at [".concat(t,"]..."));e._RedoKeys.length>0;){var r=e._RedoKeys.pop();e._RedoBuffer.expire(r)}e._UndoKeys.push(t),e._UndoBuffer.put(e._RecoveryDocumentState,t)}else e._Settings.DebugLog&&e.log.debug("Skipped creating recovery snapshot at [".concat(t,"] because there were no changes to the recovery state..."))}))}},{key:"snapshotDataInitial",value:function(){var e=this,t=Date.now().toString();return this._UndoKeys.length>0?(this.log.info("Skipping creation of initial snapshot because one already exists."),!1):(this.storeRecoveryData((function(){e._Settings.DebugLog&&e.log.debug("Creating recovery snapshot at [".concat(t,"]...")),e._UndoKeys.push(t),e._UndoBuffer.put(e._RecoveryDocumentState,t)})),!0)}},{key:"undoSnapshotCount",value:function(){return this._UndoKeys.length}},{key:"redoSnapshotCount",value:function(){return this._RedoKeys.length}},{key:"revertToPreviousSnapshot",value:function(e){var t=this,n="function"==typeof e?e:function(){};if(this._UndoKeys.length<1)return this.log.info("Not enough undo snapshots; skipping undo."),n(!1);var r=this._UndoKeys.pop(),i=this._UndoBuffer.read(r);if(i){this._RedoKeys.push(r),this._RedoBuffer.put(i,r);var o={};this.marshalFormToData(o,(function(){t._UndoBuffer.expire(r),t.marshalDataToForm(i,(function(){return t._RecoveryDocumentState=i,t.log.info("Informary reverted to snapshot ID ".concat(r)),JSON.stringify(o)==JSON.stringify(i)&&t._UndoKeys.length>0?t.revertToPreviousSnapshot(n):(0==t._UndoKeys.length&&(t.log.info("Snapshot Data Depleted -- Creating Extra Undo Snapshot"),t.snapshotDataInitial()),n(!0))}))}))}return n(!1)}},{key:"reapplyNextRevertedSnapshot",value:function(e){var t=this,n="function"==typeof e?e:function(){},r=this._RedoKeys.pop(),i=this._RedoBuffer.read(r);if(i){this._UndoKeys.push(r),this._UndoBuffer.put(i,r),this._RedoBuffer.expire(r);var o={};this.marshalFormToData(o,(function(){t.marshalDataToForm(i,(function(){return t._RecoveryDocumentState=i,t.log.info("Informary reapplied snapshot ID ".concat(r)),JSON.stringify(o)==JSON.stringify(i)&&t._RedoKeys.length>0?t.reapplyNextRevertedSnapshot(n):n(!0)}))}))}return n(!1)}},{key:"clearRecoveryData",value:function(){return this.deleteData("Recovery")}},{key:"readRecoveryData",value:function(){return this.readData("Recovery")}},{key:"restoreRecoveryScenarioData",value:function(e){var t=this,n="function"==typeof e?e:function(){},r=this.readRecoveryScenario();return r&&r.ExistingRecovery&&this.marshalDataToForm(r.ExistingRecovery,(function(){return t.clearRecoveryScenarioData(),n(!0)})),n(!1)}},{key:"clearRecoveryScenarioData",value:function(){return this.deleteData("RecoveryScenario")}},{key:"storeRecoveryScenarioData",value:function(e){return this.writeData("RecoveryScenario",e)}},{key:"readRecoveryScenario",value:function(){return this.readData("RecoveryScenario")}},{key:"checkRecoveryState",value:function(e){var t={NewSource:e,ExistingSource:this.readData("Source"),ExistingRecovery:this.readData("Recovery")};if(t.ExistingSource&&t.ExistingRecovery){var n=r.detailedDiff(t.ExistingSource,t.ExistingRecovery);return JSON.stringify(n)!=JSON.stringify(r.detailedDiff({},{}))&&(this._Log.info("Informary found recovery data at ".concat(this.getStorageKey("Recovery"),"!")),t.Diffs={},t.Diffs.ExistingRecovery_ExistingSource=n,t.Diffs.ExistingSource_NewSource=r.detailedDiff(t.ExistingSource,t.NewSource),t.Diffs.ExistingRecovery_NewSource=r.detailedDiff(t.ExistingRecovery,t.NewSource),t.Index={},t.Index.ExistingSource=this.readIndexValue("Source"),t.Index.ExistingRecovery=this.readIndexValue("Recovery"),this.writeData("RecoveryScenario",t),t)}return!1}},{key:"compareCurrentStateToUndoAndRedo",value:function(e){var t=this,n="function"==typeof e?e:function(){},i={},o={},a={};this.marshalFormToData(i,(function(){var e=JSON.stringify(i);if(t._UndoKeys.length>0){var s=t._UndoKeys[t._UndoKeys.length-1];o=t._UndoBuffer.read(s)}if(t._RedoKeys.length>0){for(var u=t._RedoKeys.length-1,c=t._RedoKeys.length-1;c>=0;c--){if(JSON.stringify(t._RedoBuffer.read(t._RedoKeys[c]))!=e){u=c;break}}a=t._RedoBuffer.read(t._RedoKeys[u])}var l={UndoDelta:r.detailedDiff(i,o),UndoGUIDDelta:{Added:[],Deleted:[]},RedoDelta:r.detailedDiff(i,a),RedoGUIDDelta:{Added:[],Deleted:[]}},p=[],f=0;i.hasOwnProperty("__GUID")&&(p=Object.keys(i.__GUID).sort());var h=[];o.hasOwnProperty("__GUID")&&(h=Object.keys(o.__GUID).sort());var d=0,g=h.length-1;for(f=0;f<p.length;f++){for(;d<=g&&h[d]!=p[f]&&h[d]<p[f];)l.UndoGUIDDelta.Added.push(h[d]),d++;d<=g&&h[d]==p[f]?d++:l.UndoGUIDDelta.Deleted.push(p[f])}for(var y=d;y<=g;y++)l.UndoGUIDDelta.Added.push(h[y]);var v=[];a.hasOwnProperty("__GUID")&&(v=Object.keys(a.__GUID).sort());var m=0,b=v.length-1;for(f=0;f<p.length;f++){for(;m<=b&&v[m]!=p[f]&&v[m]<p[f];)l.RedoGUIDDelta.Added.push(v[m]),m++;m<=b&&v[m]==p[f]?m++:l.RedoGUIDDelta.Deleted.push(p[f])}for(var O=m;O<=b;O++)l.RedoGUIDDelta.Added.push(v[O]);n(l)}))}},{key:"createArrayContainers",value:function(e,t,n){this._Settings.DebugLog&&this.log.debug("Informary Data->Form marshalling recursive entry...")}},{key:"nonFormData",get:function(){return this._NonHTMLState}},{key:"marshalDataToForm",value:function(e,t,n,r,i){var o=this;if(this._Settings.DebugLog&&this.log.debug("Informary Data->Form marshalling recursive entry..."),"object"!==_typeof(e))return this.log.error("Invalid record object passed in!"),t("Invalid record object passed in!");if(null===e)return t();if(void 0===e)return t();var a=void 0!==n&&n,s=void 0!==n?n:"JSON OBJECT ROOT",u=void 0!==r&&r,c=void 0!==i&&i;return this._Settings.DebugLog&&this.log.debug("Informary Data->Form found parent address [".concat(a,"] and is parsing properties")),"JSON OBJECT ROOT"==s&&e.hasOwnProperty(this._NonHTMLStateProperty)&&"object"===_typeof(e[this._NonHTMLStateProperty])&&(this._NonHTMLState=e[this._NonHTMLStateProperty]),Object.keys(e).forEach((function(t){var r=e[t],i=a.length>0?"".concat(n,".").concat(t):t;switch(o._Settings.DebugLog&&o.log.debug("Informary Data->Form parent address [".concat(s,"] parsing property [").concat(i,"]")),_typeof(r)){case"object":if(!Array.isArray(r))return o.marshalDataToForm(r,(function(){}),i,u,c.toString());for(var l=0;l<r.length;l++)o.marshalDataToForm(r[l],(function(){}),void 0,i,l.toString());break;case"undefined":break;default:var p=[];if((p=u&&c?o._Dependencies.jquery('\n\t\t\t\t\t\t\t\tinput[data-i-form="'.concat(o._Settings.Form,'"][data-i-datum="').concat(i,'"][data-i-container="').concat(u,'"][data-i-index="').concat(c,'"],\n\t\t\t\t\t\t\t\tselect[data-i-form="').concat(o._Settings.Form,'"][data-i-datum="').concat(i,'"][data-i-container="').concat(u,'"][data-i-index="').concat(c,'"],\n\t\t\t\t\t\t\t\ttextarea[data-i-form="').concat(o._Settings.Form,'"][data-i-datum="').concat(i,'"][data-i-container="').concat(u,'"][data-i-index="').concat(c,'"]\n\t\t\t\t\t\t\t')):o._Dependencies.jquery('\n\t\t\t\t\t\t\t\tinput[data-i-form="'.concat(o._Settings.Form,'"][data-i-datum="').concat(i,'"],\n\t\t\t\t\t\t\t\tselect[data-i-form="').concat(o._Settings.Form,'"][data-i-datum="').concat(i,'"],\n\t\t\t\t\t\t\t\ttextarea[data-i-form="').concat(o._Settings.Form,'"][data-i-datum="').concat(i,'"]\n\t\t\t\t\t\t\t'))).length>0){"TEXTAREA"===o._Dependencies.jquery(p)[0].tagName?o._Dependencies.jquery(p)[0].textContent=r:"SELECT"===o._Dependencies.jquery(p)[0].tagName?o._Dependencies.jquery('select[data-i-form="'.concat(o._Settings.Form,'"][data-i-datum="').concat(i,'"] option[value="').concat(r,'"]')).prop("selected",!0):o._Dependencies.jquery(p).val(r);var f=o._Dependencies.jquery(o).attr("data-i-guid");void 0!==f&&!1!==f&&o._Dependencies.jquery(p).attr("data-i-guid",r)}}})),n?t():t(!1)}},{key:"marshalFormToData",value:function(e,t){var n=this;if(this._Settings.DebugLog&&this.log.debug("Informary Form->Data marshalling recursive entry..."),"object"!==_typeof(e))return this.log.error("Invalid record object passed in! Informary needs a Javascript object to put values into."),t("Invalid record object passed in! Informary needs a Javascript object to put values into.");var r=this._Dependencies.jquery("\n\t\t\t\tinput[data-i-form=".concat(this._Settings.Form,"],\n\t\t\t\tselect[data-i-form=").concat(this._Settings.Form,"],\n\t\t\t\ttextarea[data-i-form=").concat(this._Settings.Form,"]\n\t\t\t")),i=0;return e[this._NonHTMLStateProperty]=this._NonHTMLState,this._Dependencies.jquery.each(r,(function(t,r){var o,a=n._Dependencies.jquery(r).attr("data-i-datum"),s=n._Dependencies.jquery(r).attr("data-i-container"),u=n._Dependencies.jquery(r).attr("data-i-index"),c=n._Dependencies.jquery(r).attr("data-i-guid");if(void 0===(o="TEXTAREA"===n._Dependencies.jquery(r).tagName?n._Dependencies.jquery(r).textContent:n._Dependencies.jquery(r).val())&&(o=null),void 0===a&&(a="__ERROR.UnsetDatum."+i,i++),c){var l="__GUID."+c;n.setValueAtAddress(e,l,c)}s&&u?n.setValueAtAddressInContainer(e,s,u,a,o):n.setValueAtAddress(e,a,o)})),t()}}]),t}();t.exports=o},{"./Informary-Log.js":80,cachetrax:17,"deep-object-diff":26,jquery:82}],82:[function(e,t,n){
|
|
140
|
+
/*!
|
|
141
|
+
* jQuery JavaScript Library v3.6.4
|
|
142
|
+
* https://jquery.com/
|
|
143
|
+
*
|
|
144
|
+
* Includes Sizzle.js
|
|
145
|
+
* https://sizzlejs.com/
|
|
146
|
+
*
|
|
147
|
+
* Copyright OpenJS Foundation and other contributors
|
|
148
|
+
* Released under the MIT license
|
|
149
|
+
* https://jquery.org/license
|
|
150
|
+
*
|
|
151
|
+
* Date: 2023-03-08T15:28Z
|
|
152
|
+
*/
|
|
153
|
+
!function(e,n){"object"===_typeof(t)&&"object"===_typeof(t.exports)?t.exports=e.document?n(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}:n(e)}("undefined"!=typeof window?window:this,(function(e,t){var n=[],r=Object.getPrototypeOf,i=n.slice,o=n.flat?function(e){return n.flat.call(e)}:function(e){return n.concat.apply([],e)},a=n.push,s=n.indexOf,u={},c=u.toString,l=u.hasOwnProperty,p=l.toString,f=p.call(Object),h={},d=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},g=function(e){return null!=e&&e===e.window},y=e.document,v={type:!0,src:!0,nonce:!0,noModule:!0};function m(e,t,n){var r,i,o=(n=n||y).createElement("script");if(o.text=e,t)for(r in v)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function b(e){return null==e?e+"":"object"===_typeof(e)||"function"==typeof e?u[c.call(e)]||"object":_typeof(e)}var O="3.6.4",S=function e(t,n){return new e.fn.init(t,n)};function x(e){var t=!!e&&"length"in e&&e.length,n=b(e);return!d(e)&&!g(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}S.fn=S.prototype={jquery:O,constructor:S,length:0,toArray:function(){return i.call(this)},get:function(e){return null==e?i.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(e){return this.pushStack(S.map(this,(function(t,n){return e.call(t,n,t)})))},slice:function(){return this.pushStack(i.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,(function(e,t){return(t+1)%2})))},odd:function(){return this.pushStack(S.grep(this,(function(e,t){return t%2})))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:a,sort:n.sort,splice:n.splice},S.extend=S.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,c=!1;for("boolean"==typeof a&&(c=a,a=arguments[s]||{},s++),"object"===_typeof(a)||d(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(c&&r&&(S.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||S.isPlainObject(n)?n:{},i=!1,a[t]=S.extend(c,o,r)):void 0!==r&&(a[t]=r));return a},S.extend({expando:"jQuery"+(O+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==c.call(e))&&(!(t=r(e))||"function"==typeof(n=l.call(t,"constructor")&&t.constructor)&&p.call(n)===f)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){m(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(x(e))for(n=e.length;r<n&&!1!==t.call(e[r],r,e[r]);r++);else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(x(Object(e))?S.merge(n,"string"==typeof e?[e]:e):a.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:s.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,a=0,s=[];if(x(e))for(r=e.length;a<r;a++)null!=(i=t(e[a],a,n))&&s.push(i);else for(a in e)null!=(i=t(e[a],a,n))&&s.push(i);return o(s)},guid:1,support:h}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=n[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(e,t){u["[object "+t+"]"]=t.toLowerCase()}));var w=
|
|
154
|
+
/*!
|
|
155
|
+
* Sizzle CSS Selector Engine v2.3.10
|
|
156
|
+
* https://sizzlejs.com/
|
|
157
|
+
*
|
|
158
|
+
* Copyright JS Foundation and other contributors
|
|
159
|
+
* Released under the MIT license
|
|
160
|
+
* https://js.foundation/
|
|
161
|
+
*
|
|
162
|
+
* Date: 2023-02-14
|
|
163
|
+
*/
|
|
164
|
+
function(e){var t,n,r,i,o,a,s,u,c,l,p,f,h,d,g,y,v,m,b,O="sizzle"+1*new Date,S=e.document,x=0,w=0,_=ue(),j=ue(),N=ue(),D=ue(),T=function(e,t){return e===t&&(p=!0),0},k={}.hasOwnProperty,I=[],C=I.pop,A=I.push,P=I.push,E=I.slice,M=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",H="[\\x20\\t\\r\\n\\f]",R="(?:\\\\[\\da-fA-F]{1,6}"+H+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",V="\\["+H+"*("+R+")(?:"+H+"*([*^$|!~]?=)"+H+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+R+"))|)"+H+"*\\]",F=":("+R+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+V+")*)|.*)\\)|)",U=new RegExp(H+"+","g"),B=new RegExp("^"+H+"+|((?:^|[^\\\\])(?:\\\\.)*)"+H+"+$","g"),q=new RegExp("^"+H+"*,"+H+"*"),W=new RegExp("^"+H+"*([>+~]|"+H+")"+H+"*"),G=new RegExp(H+"|>"),J=new RegExp(F),z=new RegExp("^"+R+"$"),$={ID:new RegExp("^#("+R+")"),CLASS:new RegExp("^\\.("+R+")"),TAG:new RegExp("^("+R+"|[*])"),ATTR:new RegExp("^"+V),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+H+"*(even|odd|(([+-]|)(\\d*)n|)"+H+"*(?:([+-]|)"+H+"*(\\d+)|))"+H+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+H+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+H+"*((?:-\\d)?\\d*)"+H+"*\\)|)(?=[^-]|$)","i")},K=/HTML$/i,X=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Q=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+H+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){f()},ae=Oe((function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{P.apply(I=E.call(S.childNodes),S.childNodes),I[S.childNodes.length].nodeType}catch(e){P={apply:I.length?function(e,t){A.apply(e,E.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function se(e,t,r,i){var o,s,c,l,p,d,v,m=t&&t.ownerDocument,S=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==S&&9!==S&&11!==S)return r;if(!i&&(f(t),t=t||h,g)){if(11!==S&&(p=Q.exec(e)))if(o=p[1]){if(9===S){if(!(c=t.getElementById(o)))return r;if(c.id===o)return r.push(c),r}else if(m&&(c=m.getElementById(o))&&b(t,c)&&c.id===o)return r.push(c),r}else{if(p[2])return P.apply(r,t.getElementsByTagName(e)),r;if((o=p[3])&&n.getElementsByClassName&&t.getElementsByClassName)return P.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!D[e+" "]&&(!y||!y.test(e))&&(1!==S||"object"!==t.nodeName.toLowerCase())){if(v=e,m=t,1===S&&(G.test(e)||W.test(e))){for((m=ee.test(e)&&ve(t.parentNode)||t)===t&&n.scope||((l=t.getAttribute("id"))?l=l.replace(re,ie):t.setAttribute("id",l=O)),s=(d=a(e)).length;s--;)d[s]=(l?"#"+l:":scope")+" "+be(d[s]);v=d.join(",")}try{return P.apply(r,m.querySelectorAll(v)),r}catch(t){D(e,!0)}finally{l===O&&t.removeAttribute("id")}}}return u(e.replace(B,"$1"),t,r,i)}function ue(){var e=[];return function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function ce(e){return e[O]=!0,e}function le(e){var t=h.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function pe(e,t){for(var n=e.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=t}function fe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function he(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function de(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ge(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ae(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function ye(e){return ce((function(t){return t=+t,ce((function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))}))}))}function ve(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=se.support={},o=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!K.test(t||n&&n.nodeName||"HTML")},f=se.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:S;return a!=h&&9===a.nodeType&&a.documentElement?(d=(h=a).documentElement,g=!o(h),S!=h&&(i=h.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",oe,!1):i.attachEvent&&i.attachEvent("onunload",oe)),n.scope=le((function(e){return d.appendChild(e).appendChild(h.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length})),n.cssHas=le((function(){try{return h.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}})),n.attributes=le((function(e){return e.className="i",!e.getAttribute("className")})),n.getElementsByTagName=le((function(e){return e.appendChild(h.createComment("")),!e.getElementsByTagName("*").length})),n.getElementsByClassName=Y.test(h.getElementsByClassName),n.getById=le((function(e){return d.appendChild(e).id=O,!h.getElementsByName||!h.getElementsByName(O).length})),n.getById?(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&g)return t.getElementsByClassName(e)},v=[],y=[],(n.qsa=Y.test(h.querySelectorAll))&&(le((function(e){var t;d.appendChild(e).innerHTML="<a id='"+O+"'></a><select id='"+O+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&y.push("[*^$]="+H+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||y.push("\\["+H+"*(?:value|"+L+")"),e.querySelectorAll("[id~="+O+"-]").length||y.push("~="),(t=h.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||y.push("\\["+H+"*name"+H+"*="+H+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||y.push(":checked"),e.querySelectorAll("a#"+O+"+*").length||y.push(".#.+[+~]"),e.querySelectorAll("\\\f"),y.push("[\\r\\n\\f]")})),le((function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=h.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&y.push("name"+H+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&y.push(":enabled",":disabled"),d.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&y.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),y.push(",.*:")}))),(n.matchesSelector=Y.test(m=d.matches||d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&le((function(e){n.disconnectedMatch=m.call(e,"*"),m.call(e,"[s!='']:x"),v.push("!=",F)})),n.cssHas||y.push(":has"),y=y.length&&new RegExp(y.join("|")),v=v.length&&new RegExp(v.join("|")),t=Y.test(d.compareDocumentPosition),b=t||Y.test(d.contains)?function(e,t){var n=9===e.nodeType&&e.documentElement||e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},T=t?function(e,t){if(e===t)return p=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e==h||e.ownerDocument==S&&b(S,e)?-1:t==h||t.ownerDocument==S&&b(S,t)?1:l?M(l,e)-M(l,t):0:4&r?-1:1)}:function(e,t){if(e===t)return p=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==h?-1:t==h?1:i?-1:o?1:l?M(l,e)-M(l,t):0;if(i===o)return fe(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;a[r]===s[r];)r++;return r?fe(a[r],s[r]):a[r]==S?-1:s[r]==S?1:0},h):h},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(f(e),n.matchesSelector&&g&&!D[t+" "]&&(!v||!v.test(t))&&(!y||!y.test(t)))try{var r=m.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){D(t,!0)}return se(t,h,null,[e]).length>0},se.contains=function(e,t){return(e.ownerDocument||e)!=h&&f(e),b(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!=h&&f(e);var i=r.attrHandle[t.toLowerCase()],o=i&&k.call(r.attrHandle,t.toLowerCase())?i(e,t,!g):void 0;return void 0!==o?o:n.attributes||!g?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},se.escape=function(e){return(e+"").replace(re,ie)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,r=[],i=0,o=0;if(p=!n.detectDuplicates,l=!n.sortStable&&e.slice(0),e.sort(T),p){for(;t=e[o++];)t===e[o]&&(i=r.push(o));for(;i--;)e.splice(r[i],1)}return l=null,e},i=se.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=i(t);return n},r=se.selectors={cacheLength:50,createPseudo:ce,match:$,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return $.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&J.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=_[e+" "];return t||(t=new RegExp("(^|"+H+")"+e+"("+H+"|$)"))&&_(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(r){var i=se.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(U," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var c,l,p,f,h,d,g=o!==a?"nextSibling":"previousSibling",y=t.parentNode,v=s&&t.nodeName.toLowerCase(),m=!u&&!s,b=!1;if(y){if(o){for(;g;){for(f=t;f=f[g];)if(s?f.nodeName.toLowerCase()===v:1===f.nodeType)return!1;d=g="only"===e&&!d&&"nextSibling"}return!0}if(d=[a?y.firstChild:y.lastChild],a&&m){for(b=(h=(c=(l=(p=(f=y)[O]||(f[O]={}))[f.uniqueID]||(p[f.uniqueID]={}))[e]||[])[0]===x&&c[1])&&c[2],f=h&&y.childNodes[h];f=++h&&f&&f[g]||(b=h=0)||d.pop();)if(1===f.nodeType&&++b&&f===t){l[e]=[x,h,b];break}}else if(m&&(b=h=(c=(l=(p=(f=t)[O]||(f[O]={}))[f.uniqueID]||(p[f.uniqueID]={}))[e]||[])[0]===x&&c[1]),!1===b)for(;(f=++h&&f&&f[g]||(b=h=0)||d.pop())&&((s?f.nodeName.toLowerCase()!==v:1!==f.nodeType)||!++b||(m&&((l=(p=f[O]||(f[O]={}))[f.uniqueID]||(p[f.uniqueID]={}))[e]=[x,b]),f!==t)););return(b-=i)===r||b%r==0&&b/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return i[O]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?ce((function(e,n){for(var r,o=i(e,t),a=o.length;a--;)e[r=M(e,o[a])]=!(n[r]=o[a])})):function(e){return i(e,0,n)}):i}},pseudos:{not:ce((function(e){var t=[],n=[],r=s(e.replace(B,"$1"));return r[O]?ce((function(e,t,n,i){for(var o,a=r(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))})):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}})),has:ce((function(e){return function(t){return se(e,t).length>0}})),contains:ce((function(e){return e=e.replace(te,ne),function(t){return(t.textContent||i(t)).indexOf(e)>-1}})),lang:ce((function(e){return z.test(e||"")||se.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=g?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===h.activeElement&&(!h.hasFocus||h.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ge(!1),disabled:ge(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return Z.test(e.nodeName)},input:function(e){return X.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ye((function(){return[0]})),last:ye((function(e,t){return[t-1]})),eq:ye((function(e,t,n){return[n<0?n+t:n]})),even:ye((function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e})),odd:ye((function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e})),lt:ye((function(e,t,n){for(var r=n<0?n+t:n>t?t:n;--r>=0;)e.push(r);return e})),gt:ye((function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e}))}},r.pseudos.nth=r.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=he(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=de(t);function me(){}function be(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function Oe(e,t,n){var r=t.dir,i=t.next,o=i||r,a=n&&"parentNode"===o,s=w++;return t.first?function(t,n,i){for(;t=t[r];)if(1===t.nodeType||a)return e(t,n,i);return!1}:function(t,n,u){var c,l,p,f=[x,s];if(u){for(;t=t[r];)if((1===t.nodeType||a)&&e(t,n,u))return!0}else for(;t=t[r];)if(1===t.nodeType||a)if(l=(p=t[O]||(t[O]={}))[t.uniqueID]||(p[t.uniqueID]={}),i&&i===t.nodeName.toLowerCase())t=t[r]||t;else{if((c=l[o])&&c[0]===x&&c[1]===s)return f[2]=c[2];if(l[o]=f,f[2]=e(t,n,u))return!0}return!1}}function Se(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xe(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,c=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),c&&t.push(s)));return a}function we(e,t,n,r,i,o){return r&&!r[O]&&(r=we(r)),i&&!i[O]&&(i=we(i,o)),ce((function(o,a,s,u){var c,l,p,f=[],h=[],d=a.length,g=o||function(e,t,n){for(var r=0,i=t.length;r<i;r++)se(e,t[r],n);return n}(t||"*",s.nodeType?[s]:s,[]),y=!e||!o&&t?g:xe(g,f,e,s,u),v=n?i||(o?e:d||r)?[]:a:y;if(n&&n(y,v,s,u),r)for(c=xe(v,h),r(c,[],s,u),l=c.length;l--;)(p=c[l])&&(v[h[l]]=!(y[h[l]]=p));if(o){if(i||e){if(i){for(c=[],l=v.length;l--;)(p=v[l])&&c.push(y[l]=p);i(null,v=[],c,u)}for(l=v.length;l--;)(p=v[l])&&(c=i?M(o,p):f[l])>-1&&(o[c]=!(a[c]=p))}}else v=xe(v===a?v.splice(d,v.length):v),i?i(null,a,v,u):P.apply(a,v)}))}function _e(e){for(var t,n,i,o=e.length,a=r.relative[e[0].type],s=a||r.relative[" "],u=a?1:0,l=Oe((function(e){return e===t}),s,!0),p=Oe((function(e){return M(t,e)>-1}),s,!0),f=[function(e,n,r){var i=!a&&(r||n!==c)||((t=n).nodeType?l(e,n,r):p(e,n,r));return t=null,i}];u<o;u++)if(n=r.relative[e[u].type])f=[Oe(Se(f),n)];else{if((n=r.filter[e[u].type].apply(null,e[u].matches))[O]){for(i=++u;i<o&&!r.relative[e[i].type];i++);return we(u>1&&Se(f),u>1&&be(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(B,"$1"),n,u<i&&_e(e.slice(u,i)),i<o&&_e(e=e.slice(i)),i<o&&be(e))}f.push(n)}return Se(f)}return me.prototype=r.filters=r.pseudos,r.setFilters=new me,a=se.tokenize=function(e,t){var n,i,o,a,s,u,c,l=j[e+" "];if(l)return t?0:l.slice(0);for(s=e,u=[],c=r.preFilter;s;){for(a in n&&!(i=q.exec(s))||(i&&(s=s.slice(i[0].length)||s),u.push(o=[])),n=!1,(i=W.exec(s))&&(n=i.shift(),o.push({value:n,type:i[0].replace(B," ")}),s=s.slice(n.length)),r.filter)!(i=$[a].exec(s))||c[a]&&!(i=c[a](i))||(n=i.shift(),o.push({value:n,type:a,matches:i}),s=s.slice(n.length));if(!n)break}return t?s.length:s?se.error(e):j(e,u).slice(0)},s=se.compile=function(e,t){var n,i=[],o=[],s=N[e+" "];if(!s){for(t||(t=a(e)),n=t.length;n--;)(s=_e(t[n]))[O]?i.push(s):o.push(s);s=N(e,function(e,t){var n=t.length>0,i=e.length>0,o=function(o,a,s,u,l){var p,d,y,v=0,m="0",b=o&&[],O=[],S=c,w=o||i&&r.find.TAG("*",l),_=x+=null==S?1:Math.random()||.1,j=w.length;for(l&&(c=a==h||a||l);m!==j&&null!=(p=w[m]);m++){if(i&&p){for(d=0,a||p.ownerDocument==h||(f(p),s=!g);y=e[d++];)if(y(p,a||h,s)){u.push(p);break}l&&(x=_)}n&&((p=!y&&p)&&v--,o&&b.push(p))}if(v+=m,n&&m!==v){for(d=0;y=t[d++];)y(b,O,a,s);if(o){if(v>0)for(;m--;)b[m]||O[m]||(O[m]=C.call(u));O=xe(O)}P.apply(u,O),l&&!o&&O.length>0&&v+t.length>1&&se.uniqueSort(u)}return l&&(x=_,c=S),b};return n?ce(o):o}(o,i)),s.selector=e}return s},u=se.select=function(e,t,n,i){var o,u,c,l,p,f="function"==typeof e&&e,h=!i&&a(e=f.selector||e);if(n=n||[],1===h.length){if((u=h[0]=h[0].slice(0)).length>2&&"ID"===(c=u[0]).type&&9===t.nodeType&&g&&r.relative[u[1].type]){if(!(t=(r.find.ID(c.matches[0].replace(te,ne),t)||[])[0]))return n;f&&(t=t.parentNode),e=e.slice(u.shift().value.length)}for(o=$.needsContext.test(e)?0:u.length;o--&&(c=u[o],!r.relative[l=c.type]);)if((p=r.find[l])&&(i=p(c.matches[0].replace(te,ne),ee.test(u[0].type)&&ve(t.parentNode)||t))){if(u.splice(o,1),!(e=i.length&&be(u)))return P.apply(n,i),n;break}}return(f||s(e,h))(i,t,!g,n,!t||ee.test(e)&&ve(t.parentNode)||t),n},n.sortStable=O.split("").sort(T).join("")===O,n.detectDuplicates=!!p,f(),n.sortDetached=le((function(e){return 1&e.compareDocumentPosition(h.createElement("fieldset"))})),le((function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")}))||pe("type|href|height|width",(function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)})),n.attributes&&le((function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}))||pe("value",(function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue})),le((function(e){return null==e.getAttribute("disabled")}))||pe(L,(function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null})),se}(e);S.find=w,S.expr=w.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=w.uniqueSort,S.text=w.getText,S.isXMLDoc=w.isXML,S.contains=w.contains,S.escapeSelector=w.escape;var _=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&S(e).is(n))break;r.push(e)}return r},j=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},N=S.expr.match.needsContext;function D(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var T=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function k(e,t,n){return d(t)?S.grep(e,(function(e,r){return!!t.call(e,r,e)!==n})):t.nodeType?S.grep(e,(function(e){return e===t!==n})):"string"!=typeof t?S.grep(e,(function(e){return s.call(t,e)>-1!==n})):S.filter(t,e,n)}S.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?S.find.matchesSelector(r,e)?[r]:[]:S.find.matches(e,S.grep(t,(function(e){return 1===e.nodeType})))},S.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(S(e).filter((function(){for(t=0;t<r;t++)if(S.contains(i[t],this))return!0})));for(n=this.pushStack([]),t=0;t<r;t++)S.find(e,i[t],n);return r>1?S.uniqueSort(n):n},filter:function(e){return this.pushStack(k(this,e||[],!1))},not:function(e){return this.pushStack(k(this,e||[],!0))},is:function(e){return!!k(this,"string"==typeof e&&N.test(e)?S(e):e||[],!1).length}});var I,C=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||I,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:C.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:y,!0)),T.test(r[1])&&S.isPlainObject(t))for(r in t)d(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=y.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):d(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,I=S(y);var A=/^(?:parents|prev(?:Until|All))/,P={children:!0,contents:!0,next:!0,prev:!0};function E(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter((function(){for(var e=0;e<n;e++)if(S.contains(this,t[e]))return!0}))},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&S(e);if(!N.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&S.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?S.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?s.call(S(e),this[0]):s.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),S.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return _(e,"parentNode")},parentsUntil:function(e,t,n){return _(e,"parentNode",n)},next:function(e){return E(e,"nextSibling")},prev:function(e){return E(e,"previousSibling")},nextAll:function(e){return _(e,"nextSibling")},prevAll:function(e){return _(e,"previousSibling")},nextUntil:function(e,t,n){return _(e,"nextSibling",n)},prevUntil:function(e,t,n){return _(e,"previousSibling",n)},siblings:function(e){return j((e.parentNode||{}).firstChild,e)},children:function(e){return j(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(D(e,"template")&&(e=e.content||e),S.merge([],e.childNodes))}},(function(e,t){S.fn[e]=function(n,r){var i=S.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=S.filter(r,i)),this.length>1&&(P[e]||S.uniqueSort(i),A.test(e)&&i.reverse()),this.pushStack(i)}}));var M=/[^\x20\t\r\n\f]+/g;function L(e){return e}function H(e){throw e}function R(e,t,n,r){var i;try{e&&d(i=e.promise)?i.call(e).done(t).fail(n):e&&d(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}S.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return S.each(e.match(M)||[],(function(e,n){t[n]=!0})),t}(e):S.extend({},e);var t,n,r,i,o=[],a=[],s=-1,u=function(){for(i=i||e.once,r=t=!0;a.length;s=-1)for(n=a.shift();++s<o.length;)!1===o[s].apply(n[0],n[1])&&e.stopOnFalse&&(s=o.length,n=!1);e.memory||(n=!1),t=!1,i&&(o=n?[]:"")},c={add:function(){return o&&(n&&!t&&(s=o.length-1,a.push(n)),function t(n){S.each(n,(function(n,r){d(r)?e.unique&&c.has(r)||o.push(r):r&&r.length&&"string"!==b(r)&&t(r)}))}(arguments),n&&!t&&u()),this},remove:function(){return S.each(arguments,(function(e,t){for(var n;(n=S.inArray(t,o,n))>-1;)o.splice(n,1),n<=s&&s--})),this},has:function(e){return e?S.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||u()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},S.extend({Deferred:function(t){var n=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return S.Deferred((function(t){S.each(n,(function(n,r){var i=d(e[r[4]])&&e[r[4]];o[r[1]]((function(){var e=i&&i.apply(this,arguments);e&&d(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,i?[e]:arguments)}))})),e=null})).promise()},then:function(t,r,i){var o=0;function a(t,n,r,i){return function(){var s=this,u=arguments,c=function(){var e,c;if(!(t<o)){if((e=r.apply(s,u))===n.promise())throw new TypeError("Thenable self-resolution");c=e&&("object"===_typeof(e)||"function"==typeof e)&&e.then,d(c)?i?c.call(e,a(o,n,L,i),a(o,n,H,i)):(o++,c.call(e,a(o,n,L,i),a(o,n,H,i),a(o,n,L,n.notifyWith))):(r!==L&&(s=void 0,u=[e]),(i||n.resolveWith)(s,u))}},l=i?c:function(){try{c()}catch(e){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(e,l.stackTrace),t+1>=o&&(r!==H&&(s=void 0,u=[e]),n.rejectWith(s,u))}};t?l():(S.Deferred.getStackHook&&(l.stackTrace=S.Deferred.getStackHook()),e.setTimeout(l))}}return S.Deferred((function(e){n[0][3].add(a(0,e,d(i)?i:L,e.notifyWith)),n[1][3].add(a(0,e,d(t)?t:L)),n[2][3].add(a(0,e,d(r)?r:H))})).promise()},promise:function(e){return null!=e?S.extend(e,i):i}},o={};return S.each(n,(function(e,t){var a=t[2],s=t[5];i[t[1]]=a.add,s&&a.add((function(){r=s}),n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),a.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=a.fireWith})),i.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),o=i.call(arguments),a=S.Deferred(),s=function(e){return function(n){r[e]=this,o[e]=arguments.length>1?i.call(arguments):n,--t||a.resolveWith(r,o)}};if(t<=1&&(R(e,a.done(s(n)).resolve,a.reject,!t),"pending"===a.state()||d(o[n]&&o[n].then)))return a.then();for(;n--;)R(o[n],s(n),a.reject);return a.promise()}});var V=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&V.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},S.readyException=function(t){e.setTimeout((function(){throw t}))};var F=S.Deferred();function U(){y.removeEventListener("DOMContentLoaded",U),e.removeEventListener("load",U),S.ready()}S.fn.ready=function(e){return F.then(e).catch((function(e){S.readyException(e)})),this},S.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--S.readyWait:S.isReady)||(S.isReady=!0,!0!==e&&--S.readyWait>0||F.resolveWith(y,[S]))}}),S.ready.then=F.then,"complete"===y.readyState||"loading"!==y.readyState&&!y.documentElement.doScroll?e.setTimeout(S.ready):(y.addEventListener("DOMContentLoaded",U),e.addEventListener("load",U));var B=function e(t,n,r,i,o,a,s){var u=0,c=t.length,l=null==r;if("object"===b(r))for(u in o=!0,r)e(t,n,u,r[u],!0,a,s);else if(void 0!==i&&(o=!0,d(i)||(s=!0),l&&(s?(n.call(t,i),n=null):(l=n,n=function(e,t,n){return l.call(S(e),n)})),n))for(;u<c;u++)n(t[u],r,s?i:i.call(t[u],u,n(t[u],r)));return o?t:l?n.call(t):c?n(t[0],r):a},q=/^-ms-/,W=/-([a-z])/g;function G(e,t){return t.toUpperCase()}function J(e){return e.replace(q,"ms-").replace(W,G)}var z=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function $(){this.expando=S.expando+$.uid++}$.uid=1,$.prototype={cache:function(e){var t=e[this.expando];return t||(t={},z(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[J(t)]=n;else for(r in t)i[J(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][J(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(J):(t=J(t))in r?[t]:t.match(M)||[]).length;for(;n--;)delete r[t[n]]}(void 0===t||S.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!S.isEmptyObject(t)}};var K=new $,X=new $,Z=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Y=/[A-Z]/g;function Q(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(Y,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n=function(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:Z.test(e)?JSON.parse(e):e)}(n)}catch(e){}X.set(e,t,n)}else n=void 0;return n}S.extend({hasData:function(e){return X.hasData(e)||K.hasData(e)},data:function(e,t,n){return X.access(e,t,n)},removeData:function(e,t){X.remove(e,t)},_data:function(e,t,n){return K.access(e,t,n)},_removeData:function(e,t){K.remove(e,t)}}),S.fn.extend({data:function(e,t){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=X.get(o),1===o.nodeType&&!K.get(o,"hasDataAttrs"))){for(n=a.length;n--;)a[n]&&0===(r=a[n].name).indexOf("data-")&&(r=J(r.slice(5)),Q(o,r,i[r]));K.set(o,"hasDataAttrs",!0)}return i}return"object"===_typeof(e)?this.each((function(){X.set(this,e)})):B(this,(function(t){var n;if(o&&void 0===t)return void 0!==(n=X.get(o,e))||void 0!==(n=Q(o,e))?n:void 0;this.each((function(){X.set(this,e,t)}))}),null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each((function(){X.remove(this,e)}))}}),S.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=K.get(e,t),n&&(!r||Array.isArray(n)?r=K.access(e,t,S.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=S.queue(e,t),r=n.length,i=n.shift(),o=S._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,(function(){S.dequeue(e,t)}),o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return K.get(e,n)||K.access(e,n,{empty:S.Callbacks("once memory").add((function(){K.remove(e,[t+"queue",n])}))})}}),S.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?S.queue(this[0],e):void 0===t?this:this.each((function(){var n=S.queue(this,e,t);S._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&S.dequeue(this,e)}))},dequeue:function(e){return this.each((function(){S.dequeue(this,e)}))},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=S.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";a--;)(n=K.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var ee=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,te=new RegExp("^(?:([+-])=|)("+ee+")([a-z%]*)$","i"),ne=["Top","Right","Bottom","Left"],re=y.documentElement,ie=function(e){return S.contains(e.ownerDocument,e)},oe={composed:!0};re.getRootNode&&(ie=function(e){return S.contains(e.ownerDocument,e)||e.getRootNode(oe)===e.ownerDocument});var ae=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&ie(e)&&"none"===S.css(e,"display")};function se(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return S.css(e,t,"")},u=s(),c=n&&n[3]||(S.cssNumber[t]?"":"px"),l=e.nodeType&&(S.cssNumber[t]||"px"!==c&&+u)&&te.exec(S.css(e,t));if(l&&l[3]!==c){for(u/=2,c=c||l[3],l=+u||1;a--;)S.style(e,t,l+c),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),l/=o;l*=2,S.style(e,t,l+c),n=n||[]}return n&&(l=+l||+u||0,i=n[1]?l+(n[1]+1)*n[2]:+n[2],r&&(r.unit=c,r.start=l,r.end=i)),i}var ue={};function ce(e){var t,n=e.ownerDocument,r=e.nodeName,i=ue[r];return i||(t=n.body.appendChild(n.createElement(r)),i=S.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),ue[r]=i,i)}function le(e,t){for(var n,r,i=[],o=0,a=e.length;o<a;o++)(r=e[o]).style&&(n=r.style.display,t?("none"===n&&(i[o]=K.get(r,"display")||null,i[o]||(r.style.display="")),""===r.style.display&&ae(r)&&(i[o]=ce(r))):"none"!==n&&(i[o]="none",K.set(r,"display",n)));for(o=0;o<a;o++)null!=i[o]&&(e[o].style.display=i[o]);return e}S.fn.extend({show:function(){return le(this,!0)},hide:function(){return le(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each((function(){ae(this)?S(this).show():S(this).hide()}))}});var pe,fe,he=/^(?:checkbox|radio)$/i,de=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,ge=/^$|^module$|\/(?:java|ecma)script/i;pe=y.createDocumentFragment().appendChild(y.createElement("div")),(fe=y.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),pe.appendChild(fe),h.checkClone=pe.cloneNode(!0).cloneNode(!0).lastChild.checked,pe.innerHTML="<textarea>x</textarea>",h.noCloneChecked=!!pe.cloneNode(!0).lastChild.defaultValue,pe.innerHTML="<option></option>",h.option=!!pe.lastChild;var ye={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function ve(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&D(e,t)?S.merge([e],n):n}function me(e,t){for(var n=0,r=e.length;n<r;n++)K.set(e[n],"globalEval",!t||K.get(t[n],"globalEval"))}ye.tbody=ye.tfoot=ye.colgroup=ye.caption=ye.thead,ye.th=ye.td,h.option||(ye.optgroup=ye.option=[1,"<select multiple='multiple'>","</select>"]);var be=/<|&#?\w+;/;function Oe(e,t,n,r,i){for(var o,a,s,u,c,l,p=t.createDocumentFragment(),f=[],h=0,d=e.length;h<d;h++)if((o=e[h])||0===o)if("object"===b(o))S.merge(f,o.nodeType?[o]:o);else if(be.test(o)){for(a=a||p.appendChild(t.createElement("div")),s=(de.exec(o)||["",""])[1].toLowerCase(),u=ye[s]||ye._default,a.innerHTML=u[1]+S.htmlPrefilter(o)+u[2],l=u[0];l--;)a=a.lastChild;S.merge(f,a.childNodes),(a=p.firstChild).textContent=""}else f.push(t.createTextNode(o));for(p.textContent="",h=0;o=f[h++];)if(r&&S.inArray(o,r)>-1)i&&i.push(o);else if(c=ie(o),a=ve(p.appendChild(o),"script"),c&&me(a),n)for(l=0;o=a[l++];)ge.test(o.type||"")&&n.push(o);return p}var Se=/^([^.]*)(?:\.(.+)|)/;function xe(){return!0}function we(){return!1}function _e(e,t){return e===function(){try{return y.activeElement}catch(e){}}()==("focus"===t)}function je(e,t,n,r,i,o){var a,s;if("object"===_typeof(t)){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)je(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=we;else if(!i)return e;return 1===o&&(a=i,i=function(e){return S().off(e),a.apply(this,arguments)},i.guid=a.guid||(a.guid=S.guid++)),e.each((function(){S.event.add(this,t,i,r,n)}))}function Ne(e,t,n){n?(K.set(e,t,!1),S.event.add(e,t,{namespace:!1,handler:function(e){var r,o,a=K.get(this,t);if(1&e.isTrigger&&this[t]){if(a.length)(S.event.special[t]||{}).delegateType&&e.stopPropagation();else if(a=i.call(arguments),K.set(this,t,a),r=n(this,t),this[t](),a!==(o=K.get(this,t))||r?K.set(this,t,!1):o={},a!==o)return e.stopImmediatePropagation(),e.preventDefault(),o&&o.value}else a.length&&(K.set(this,t,{value:S.event.trigger(S.extend(a[0],S.Event.prototype),a.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===K.get(e,t)&&S.event.add(e,t,xe)}S.event={global:{},add:function(e,t,n,r,i){var o,a,s,u,c,l,p,f,h,d,g,y=K.get(e);if(z(e))for(n.handler&&(n=(o=n).handler,i=o.selector),i&&S.find.matchesSelector(re,i),n.guid||(n.guid=S.guid++),(u=y.events)||(u=y.events=Object.create(null)),(a=y.handle)||(a=y.handle=function(t){return void 0!==S&&S.event.triggered!==t.type?S.event.dispatch.apply(e,arguments):void 0}),c=(t=(t||"").match(M)||[""]).length;c--;)h=g=(s=Se.exec(t[c])||[])[1],d=(s[2]||"").split(".").sort(),h&&(p=S.event.special[h]||{},h=(i?p.delegateType:p.bindType)||h,p=S.event.special[h]||{},l=S.extend({type:h,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&S.expr.match.needsContext.test(i),namespace:d.join(".")},o),(f=u[h])||((f=u[h]=[]).delegateCount=0,p.setup&&!1!==p.setup.call(e,r,d,a)||e.addEventListener&&e.addEventListener(h,a)),p.add&&(p.add.call(e,l),l.handler.guid||(l.handler.guid=n.guid)),i?f.splice(f.delegateCount++,0,l):f.push(l),S.event.global[h]=!0)},remove:function(e,t,n,r,i){var o,a,s,u,c,l,p,f,h,d,g,y=K.hasData(e)&&K.get(e);if(y&&(u=y.events)){for(c=(t=(t||"").match(M)||[""]).length;c--;)if(h=g=(s=Se.exec(t[c])||[])[1],d=(s[2]||"").split(".").sort(),h){for(p=S.event.special[h]||{},f=u[h=(r?p.delegateType:p.bindType)||h]||[],s=s[2]&&new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=f.length;o--;)l=f[o],!i&&g!==l.origType||n&&n.guid!==l.guid||s&&!s.test(l.namespace)||r&&r!==l.selector&&("**"!==r||!l.selector)||(f.splice(o,1),l.selector&&f.delegateCount--,p.remove&&p.remove.call(e,l));a&&!f.length&&(p.teardown&&!1!==p.teardown.call(e,d,y.handle)||S.removeEvent(e,h,y.handle),delete u[h])}else for(h in u)S.event.remove(e,h+t[c],n,r,!0);S.isEmptyObject(u)&&K.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),u=S.event.fix(e),c=(K.get(this,"events")||Object.create(null))[u.type]||[],l=S.event.special[u.type]||{};for(s[0]=u,t=1;t<arguments.length;t++)s[t]=arguments[t];if(u.delegateTarget=this,!l.preDispatch||!1!==l.preDispatch.call(this,u)){for(a=S.event.handlers.call(this,u,c),t=0;(i=a[t++])&&!u.isPropagationStopped();)for(u.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!u.isImmediatePropagationStopped();)u.rnamespace&&!1!==o.namespace&&!u.rnamespace.test(o.namespace)||(u.handleObj=o,u.data=o.data,void 0!==(r=((S.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s))&&!1===(u.result=r)&&(u.preventDefault(),u.stopPropagation()));return l.postDispatch&&l.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,c=e.target;if(u&&c.nodeType&&!("click"===e.type&&e.button>=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==e.type||!0!==c.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?S(i,this).index(c)>-1:S.find(i,this,null,[c]).length),a[i]&&o.push(r);o.length&&s.push({elem:c,handlers:o})}return c=this,u<t.length&&s.push({elem:c,handlers:t.slice(u)}),s},addProp:function(e,t){Object.defineProperty(S.Event.prototype,e,{enumerable:!0,configurable:!0,get:d(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[S.expando]?e:new S.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return he.test(t.type)&&t.click&&D(t,"input")&&Ne(t,"click",xe),!1},trigger:function(e){var t=this||e;return he.test(t.type)&&t.click&&D(t,"input")&&Ne(t,"click"),!0},_default:function(e){var t=e.target;return he.test(t.type)&&t.click&&D(t,"input")&&K.get(t,"click")||D(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},S.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},S.Event=function(e,t){if(!(this instanceof S.Event))return new S.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?xe:we,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&S.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:we,isPropagationStopped:we,isImmediatePropagationStopped:we,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=xe,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=xe,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=xe,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},S.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},S.event.addProp),S.each({focus:"focusin",blur:"focusout"},(function(e,t){S.event.special[e]={setup:function(){return Ne(this,e,_e),!1},trigger:function(){return Ne(this,e),!0},_default:function(t){return K.get(t.target,e)},delegateType:t}})),S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(e,t){S.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=e.relatedTarget,i=e.handleObj;return r&&(r===this||S.contains(this,r))||(e.type=i.origType,n=i.handler.apply(this,arguments),e.type=t),n}}})),S.fn.extend({on:function(e,t,n,r){return je(this,e,t,n,r)},one:function(e,t,n,r){return je(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,S(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"===_typeof(e)){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=we),this.each((function(){S.event.remove(this,e,n,t)}))}});var De=/<script|<style|<link/i,Te=/checked\s*(?:[^=]|=\s*.checked.)/i,ke=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function Ie(e,t){return D(e,"table")&&D(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Ce(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Ae(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Pe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(K.hasData(e)&&(s=K.get(e).events))for(i in K.remove(t,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)S.event.add(t,i,s[i][n]);X.hasData(e)&&(o=X.access(e),a=S.extend({},o),X.set(t,a))}}function Ee(e,t){var n=t.nodeName.toLowerCase();"input"===n&&he.test(e.type)?t.checked=e.checked:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}function Me(e,t,n,r){t=o(t);var i,a,s,u,c,l,p=0,f=e.length,g=f-1,y=t[0],v=d(y);if(v||f>1&&"string"==typeof y&&!h.checkClone&&Te.test(y))return e.each((function(i){var o=e.eq(i);v&&(t[0]=y.call(this,i,o.html())),Me(o,t,n,r)}));if(f&&(a=(i=Oe(t,e[0].ownerDocument,!1,e,r)).firstChild,1===i.childNodes.length&&(i=a),a||r)){for(u=(s=S.map(ve(i,"script"),Ce)).length;p<f;p++)c=i,p!==g&&(c=S.clone(c,!0,!0),u&&S.merge(s,ve(c,"script"))),n.call(e[p],c,p);if(u)for(l=s[s.length-1].ownerDocument,S.map(s,Ae),p=0;p<u;p++)c=s[p],ge.test(c.type||"")&&!K.access(c,"globalEval")&&S.contains(l,c)&&(c.src&&"module"!==(c.type||"").toLowerCase()?S._evalUrl&&!c.noModule&&S._evalUrl(c.src,{nonce:c.nonce||c.getAttribute("nonce")},l):m(c.textContent.replace(ke,""),c,l))}return e}function Le(e,t,n){for(var r,i=t?S.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||S.cleanData(ve(r)),r.parentNode&&(n&&ie(r)&&me(ve(r,"script")),r.parentNode.removeChild(r));return e}S.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s=e.cloneNode(!0),u=ie(e);if(!(h.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||S.isXMLDoc(e)))for(a=ve(s),r=0,i=(o=ve(e)).length;r<i;r++)Ee(o[r],a[r]);if(t)if(n)for(o=o||ve(e),a=a||ve(s),r=0,i=o.length;r<i;r++)Pe(o[r],a[r]);else Pe(e,s);return(a=ve(s,"script")).length>0&&me(a,!u&&ve(e,"script")),s},cleanData:function(e){for(var t,n,r,i=S.event.special,o=0;void 0!==(n=e[o]);o++)if(z(n)){if(t=n[K.expando]){if(t.events)for(r in t.events)i[r]?S.event.remove(n,r):S.removeEvent(n,r,t.handle);n[K.expando]=void 0}n[X.expando]&&(n[X.expando]=void 0)}}}),S.fn.extend({detach:function(e){return Le(this,e,!0)},remove:function(e){return Le(this,e)},text:function(e){return B(this,(function(e){return void 0===e?S.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return Me(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Ie(this,e).appendChild(e)}))},prepend:function(){return Me(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Ie(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return Me(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return Me(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(S.cleanData(ve(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return S.clone(this,e,t)}))},html:function(e){return B(this,(function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!De.test(e)&&!ye[(de.exec(e)||["",""])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(S.cleanData(ve(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)}),null,e,arguments.length)},replaceWith:function(){var e=[];return Me(this,arguments,(function(t){var n=this.parentNode;S.inArray(this,e)<0&&(S.cleanData(ve(this)),n&&n.replaceChild(t,this))}),e)}}),S.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(e,t){S.fn[e]=function(e){for(var n,r=[],i=S(e),o=i.length-1,s=0;s<=o;s++)n=s===o?this:this.clone(!0),S(i[s])[t](n),a.apply(r,n.get());return this.pushStack(r)}}));var He=new RegExp("^("+ee+")(?!px)[a-z%]+$","i"),Re=/^--/,Ve=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},Fe=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},Ue=new RegExp(ne.join("|"),"i"),Be="[\\x20\\t\\r\\n\\f]",qe=new RegExp("^"+Be+"+|((?:^|[^\\\\])(?:\\\\.)*)"+Be+"+$","g");function We(e,t,n){var r,i,o,a,s=Re.test(t),u=e.style;return(n=n||Ve(e))&&(a=n.getPropertyValue(t)||n[t],s&&a&&(a=a.replace(qe,"$1")||void 0),""!==a||ie(e)||(a=S.style(e,t)),!h.pixelBoxStyles()&&He.test(a)&&Ue.test(t)&&(r=u.width,i=u.minWidth,o=u.maxWidth,u.minWidth=u.maxWidth=u.width=a,a=n.width,u.width=r,u.minWidth=i,u.maxWidth=o)),void 0!==a?a+"":a}function Ge(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function t(){if(l){c.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",l.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",re.appendChild(c).appendChild(l);var t=e.getComputedStyle(l);r="1%"!==t.top,u=12===n(t.marginLeft),l.style.right="60%",a=36===n(t.right),i=36===n(t.width),l.style.position="absolute",o=12===n(l.offsetWidth/3),re.removeChild(c),l=null}}function n(e){return Math.round(parseFloat(e))}var r,i,o,a,s,u,c=y.createElement("div"),l=y.createElement("div");l.style&&(l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",h.clearCloneStyle="content-box"===l.style.backgroundClip,S.extend(h,{boxSizingReliable:function(){return t(),i},pixelBoxStyles:function(){return t(),a},pixelPosition:function(){return t(),r},reliableMarginLeft:function(){return t(),u},scrollboxSize:function(){return t(),o},reliableTrDimensions:function(){var t,n,r,i;return null==s&&(t=y.createElement("table"),n=y.createElement("tr"),r=y.createElement("div"),t.style.cssText="position:absolute;left:-11111px;border-collapse:separate",n.style.cssText="border:1px solid",n.style.height="1px",r.style.height="9px",r.style.display="block",re.appendChild(t).appendChild(n).appendChild(r),i=e.getComputedStyle(n),s=parseInt(i.height,10)+parseInt(i.borderTopWidth,10)+parseInt(i.borderBottomWidth,10)===n.offsetHeight,re.removeChild(t)),s}}))}();var Je=["Webkit","Moz","ms"],ze=y.createElement("div").style,$e={};function Ke(e){var t=S.cssProps[e]||$e[e];return t||(e in ze?e:$e[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=Je.length;n--;)if((e=Je[n]+t)in ze)return e}(e)||e)}var Xe=/^(none|table(?!-c[ea]).+)/,Ze={position:"absolute",visibility:"hidden",display:"block"},Ye={letterSpacing:"0",fontWeight:"400"};function Qe(e,t,n){var r=te.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function et(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=S.css(e,n+ne[a],!0,i)),r?("content"===n&&(u-=S.css(e,"padding"+ne[a],!0,i)),"margin"!==n&&(u-=S.css(e,"border"+ne[a]+"Width",!0,i))):(u+=S.css(e,"padding"+ne[a],!0,i),"padding"!==n?u+=S.css(e,"border"+ne[a]+"Width",!0,i):s+=S.css(e,"border"+ne[a]+"Width",!0,i));return!r&&o>=0&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u}function tt(e,t,n){var r=Ve(e),i=(!h.boxSizingReliable()||n)&&"border-box"===S.css(e,"boxSizing",!1,r),o=i,a=We(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(He.test(a)){if(!n)return a;a="auto"}return(!h.boxSizingReliable()&&i||!h.reliableTrDimensions()&&D(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===S.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===S.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+et(e,t,n||(i?"border":"content"),o,r,a)+"px"}function nt(e,t,n,r,i){return new nt.prototype.init(e,t,n,r,i)}S.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=We(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=J(t),u=Re.test(t),c=e.style;if(u||(t=Ke(s)),a=S.cssHooks[t]||S.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:c[t];"string"===(o=_typeof(n))&&(i=te.exec(n))&&i[1]&&(n=se(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(S.cssNumber[s]?"":"px")),h.clearCloneStyle||""!==n||0!==t.indexOf("background")||(c[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?c.setProperty(t,n):c[t]=n))}},css:function(e,t,n,r){var i,o,a,s=J(t);return Re.test(t)||(t=Ke(s)),(a=S.cssHooks[t]||S.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=We(e,t,r)),"normal"===i&&t in Ye&&(i=Ye[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),S.each(["height","width"],(function(e,t){S.cssHooks[t]={get:function(e,n,r){if(n)return!Xe.test(S.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?tt(e,t,r):Fe(e,Ze,(function(){return tt(e,t,r)}))},set:function(e,n,r){var i,o=Ve(e),a=!h.scrollboxSize()&&"absolute"===o.position,s=(a||r)&&"border-box"===S.css(e,"boxSizing",!1,o),u=r?et(e,t,r,s,o):0;return s&&a&&(u-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-et(e,t,"border",!1,o)-.5)),u&&(i=te.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=S.css(e,t)),Qe(0,n,u)}}})),S.cssHooks.marginLeft=Ge(h.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(We(e,"marginLeft"))||e.getBoundingClientRect().left-Fe(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),S.each({margin:"",padding:"",border:"Width"},(function(e,t){S.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+ne[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(S.cssHooks[e+t].set=Qe)})),S.fn.extend({css:function(e,t){return B(this,(function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Ve(e),i=t.length;a<i;a++)o[t[a]]=S.css(e,t[a],!1,r);return o}return void 0!==n?S.style(e,t,n):S.css(e,t)}),e,t,arguments.length>1)}}),S.Tween=nt,nt.prototype={constructor:nt,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||S.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(S.cssNumber[n]?"":"px")},cur:function(){var e=nt.propHooks[this.prop];return e&&e.get?e.get(this):nt.propHooks._default.get(this)},run:function(e){var t,n=nt.propHooks[this.prop];return this.options.duration?this.pos=t=S.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):nt.propHooks._default.set(this),this}},nt.prototype.init.prototype=nt.prototype,nt.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=S.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){S.fx.step[e.prop]?S.fx.step[e.prop](e):1!==e.elem.nodeType||!S.cssHooks[e.prop]&&null==e.elem.style[Ke(e.prop)]?e.elem[e.prop]=e.now:S.style(e.elem,e.prop,e.now+e.unit)}}},nt.propHooks.scrollTop=nt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},S.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},S.fx=nt.prototype.init,S.fx.step={};var rt,it,ot=/^(?:toggle|show|hide)$/,at=/queueHooks$/;function st(){it&&(!1===y.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(st):e.setTimeout(st,S.fx.interval),S.fx.tick())}function ut(){return e.setTimeout((function(){rt=void 0})),rt=Date.now()}function ct(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=ne[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function lt(e,t,n){for(var r,i=(pt.tweeners[t]||[]).concat(pt.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function pt(e,t,n){var r,i,o=0,a=pt.prefilters.length,s=S.Deferred().always((function(){delete u.elem})),u=function(){if(i)return!1;for(var t=rt||ut(),n=Math.max(0,c.startTime+c.duration-t),r=1-(n/c.duration||0),o=0,a=c.tweens.length;o<a;o++)c.tweens[o].run(r);return s.notifyWith(e,[c,r,n]),r<1&&a?n:(a||s.notifyWith(e,[c,1,0]),s.resolveWith(e,[c]),!1)},c=s.promise({elem:e,props:S.extend({},t),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},n),originalProperties:t,originalOptions:n,startTime:rt||ut(),duration:n.duration,tweens:[],createTween:function(t,n){var r=S.Tween(e,c.opts,t,n,c.opts.specialEasing[t]||c.opts.easing);return c.tweens.push(r),r},stop:function(t){var n=0,r=t?c.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)c.tweens[n].run(1);return t?(s.notifyWith(e,[c,1,0]),s.resolveWith(e,[c,t])):s.rejectWith(e,[c,t]),this}}),l=c.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=J(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=S.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(l,c.opts.specialEasing);o<a;o++)if(r=pt.prefilters[o].call(c,e,l,c.opts))return d(r.stop)&&(S._queueHooks(c.elem,c.opts.queue).stop=r.stop.bind(r)),r;return S.map(l,lt,c),d(c.opts.start)&&c.opts.start.call(e,c),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always),S.fx.timer(S.extend(u,{elem:e,anim:c,queue:c.opts.queue})),c}S.Animation=S.extend(pt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return se(n.elem,e,te.exec(t),n),n}]},tweener:function(e,t){d(e)?(t=e,e=["*"]):e=e.match(M);for(var n,r=0,i=e.length;r<i;r++)n=e[r],pt.tweeners[n]=pt.tweeners[n]||[],pt.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,c,l,p="width"in t||"height"in t,f=this,h={},d=e.style,g=e.nodeType&&ae(e),y=K.get(e,"fxshow");for(r in n.queue||(null==(a=S._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,f.always((function(){f.always((function(){a.unqueued--,S.queue(e,"fx").length||a.empty.fire()}))}))),t)if(i=t[r],ot.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!y||void 0===y[r])continue;g=!0}h[r]=y&&y[r]||S.style(e,r)}if((u=!S.isEmptyObject(t))||!S.isEmptyObject(h))for(r in p&&1===e.nodeType&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],null==(c=y&&y.display)&&(c=K.get(e,"display")),"none"===(l=S.css(e,"display"))&&(c?l=c:(le([e],!0),c=e.style.display||c,l=S.css(e,"display"),le([e]))),("inline"===l||"inline-block"===l&&null!=c)&&"none"===S.css(e,"float")&&(u||(f.done((function(){d.display=c})),null==c&&(l=d.display,c="none"===l?"":l)),d.display="inline-block")),n.overflow&&(d.overflow="hidden",f.always((function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]}))),u=!1,h)u||(y?"hidden"in y&&(g=y.hidden):y=K.access(e,"fxshow",{display:c}),o&&(y.hidden=!g),g&&le([e],!0),f.done((function(){for(r in g||le([e]),K.remove(e,"fxshow"),h)S.style(e,r,h[r])}))),u=lt(g?y[r]:0,r,f),r in y||(y[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?pt.prefilters.unshift(e):pt.prefilters.push(e)}}),S.speed=function(e,t,n){var r=e&&"object"===_typeof(e)?S.extend({},e):{complete:n||!n&&t||d(e)&&e,duration:e,easing:n&&t||t&&!d(t)&&t};return S.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in S.fx.speeds?r.duration=S.fx.speeds[r.duration]:r.duration=S.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){d(r.old)&&r.old.call(this),r.queue&&S.dequeue(this,r.queue)},r},S.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ae).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=S.isEmptyObject(e),o=S.speed(t,n,r),a=function(){var t=pt(this,S.extend({},e),o);(i||K.get(this,"finish"))&&t.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&this.queue(e||"fx",[]),this.each((function(){var t=!0,i=null!=e&&e+"queueHooks",o=S.timers,a=K.get(this);if(i)a[i]&&a[i].stop&&r(a[i]);else for(i in a)a[i]&&a[i].stop&&at.test(i)&&r(a[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));!t&&n||S.dequeue(this,e)}))},finish:function(e){return!1!==e&&(e=e||"fx"),this.each((function(){var t,n=K.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=S.timers,a=r?r.length:0;for(n.finish=!0,S.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;t<a;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish}))}}),S.each(["toggle","show","hide"],(function(e,t){var n=S.fn[t];S.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ct(t,!0),e,r,i)}})),S.each({slideDown:ct("show"),slideUp:ct("hide"),slideToggle:ct("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(e,t){S.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}})),S.timers=[],S.fx.tick=function(){var e,t=0,n=S.timers;for(rt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||S.fx.stop(),rt=void 0},S.fx.timer=function(e){S.timers.push(e),S.fx.start()},S.fx.interval=13,S.fx.start=function(){it||(it=!0,st())},S.fx.stop=function(){it=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(t,n){return t=S.fx&&S.fx.speeds[t]||t,n=n||"fx",this.queue(n,(function(n,r){var i=e.setTimeout(n,t);r.stop=function(){e.clearTimeout(i)}}))},function(){var e=y.createElement("input"),t=y.createElement("select").appendChild(y.createElement("option"));e.type="checkbox",h.checkOn=""!==e.value,h.optSelected=t.selected,(e=y.createElement("input")).value="t",e.type="radio",h.radioValue="t"===e.value}();var ft,ht=S.expr.attrHandle;S.fn.extend({attr:function(e,t){return B(this,S.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each((function(){S.removeAttr(this,e)}))}}),S.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?S.prop(e,t,n):(1===o&&S.isXMLDoc(e)||(i=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?ft:void 0)),void 0!==n?null===n?void S.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=S.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!h.radioValue&&"radio"===t&&D(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(M);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),ft={set:function(e,t,n){return!1===t?S.removeAttr(e,n):e.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),(function(e,t){var n=ht[t]||S.find.attr;ht[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=ht[a],ht[a]=i,i=null!=n(e,t,r)?a:null,ht[a]=o),i}}));var dt=/^(?:input|select|textarea|button)$/i,gt=/^(?:a|area)$/i;function yt(e){return(e.match(M)||[]).join(" ")}function vt(e){return e.getAttribute&&e.getAttribute("class")||""}function mt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(M)||[]}S.fn.extend({prop:function(e,t){return B(this,S.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[S.propFix[e]||e]}))}}),S.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(e)||(t=S.propFix[t]||t,i=S.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=S.find.attr(e,"tabindex");return t?parseInt(t,10):dt.test(e.nodeName)||gt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),h.optSelected||(S.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){S.propFix[this.toLowerCase()]=this})),S.fn.extend({addClass:function(e){var t,n,r,i,o,a;return d(e)?this.each((function(t){S(this).addClass(e.call(this,t,vt(this)))})):(t=mt(e)).length?this.each((function(){if(r=vt(this),n=1===this.nodeType&&" "+yt(r)+" "){for(o=0;o<t.length;o++)i=t[o],n.indexOf(" "+i+" ")<0&&(n+=i+" ");a=yt(n),r!==a&&this.setAttribute("class",a)}})):this},removeClass:function(e){var t,n,r,i,o,a;return d(e)?this.each((function(t){S(this).removeClass(e.call(this,t,vt(this)))})):arguments.length?(t=mt(e)).length?this.each((function(){if(r=vt(this),n=1===this.nodeType&&" "+yt(r)+" "){for(o=0;o<t.length;o++)for(i=t[o];n.indexOf(" "+i+" ")>-1;)n=n.replace(" "+i+" "," ");a=yt(n),r!==a&&this.setAttribute("class",a)}})):this:this.attr("class","")},toggleClass:function(e,t){var n,r,i,o,a=_typeof(e),s="string"===a||Array.isArray(e);return d(e)?this.each((function(n){S(this).toggleClass(e.call(this,n,vt(this),t),t)})):"boolean"==typeof t&&s?t?this.addClass(e):this.removeClass(e):(n=mt(e),this.each((function(){if(s)for(o=S(this),i=0;i<n.length;i++)r=n[i],o.hasClass(r)?o.removeClass(r):o.addClass(r);else void 0!==e&&"boolean"!==a||((r=vt(this))&&K.set(this,"__className__",r),this.setAttribute&&this.setAttribute("class",r||!1===e?"":K.get(this,"__className__")||""))})))},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+yt(vt(n))+" ").indexOf(t)>-1)return!0;return!1}});var bt=/\r/g;S.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=d(e),this.each((function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,S(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=S.map(i,(function(e){return null==e?"":e+""}))),(t=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))}))):i?(t=S.valHooks[i.type]||S.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(bt,""):null==n?"":n:void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,"value");return null!=t?t:yt(S.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!D(n.parentNode,"optgroup"))){if(t=S(n).val(),a)return t;s.push(t)}return s},set:function(e,t){for(var n,r,i=e.options,o=S.makeArray(t),a=i.length;a--;)((r=i[a]).selected=S.inArray(S.valHooks.option.get(r),o)>-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),S.each(["radio","checkbox"],(function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=S.inArray(S(e).val(),t)>-1}},h.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})})),h.focusin="onfocusin"in e;var Ot=/^(?:focusinfocus|focusoutblur)$/,St=function(e){e.stopPropagation()};S.extend(S.event,{trigger:function(t,n,r,i){var o,a,s,u,c,p,f,h,v=[r||y],m=l.call(t,"type")?t.type:t,b=l.call(t,"namespace")?t.namespace.split("."):[];if(a=h=s=r=r||y,3!==r.nodeType&&8!==r.nodeType&&!Ot.test(m+S.event.triggered)&&(m.indexOf(".")>-1&&(b=m.split("."),m=b.shift(),b.sort()),c=m.indexOf(":")<0&&"on"+m,(t=t[S.expando]?t:new S.Event(m,"object"===_typeof(t)&&t)).isTrigger=i?2:3,t.namespace=b.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:S.makeArray(n,[t]),f=S.event.special[m]||{},i||!f.trigger||!1!==f.trigger.apply(r,n))){if(!i&&!f.noBubble&&!g(r)){for(u=f.delegateType||m,Ot.test(u+m)||(a=a.parentNode);a;a=a.parentNode)v.push(a),s=a;s===(r.ownerDocument||y)&&v.push(s.defaultView||s.parentWindow||e)}for(o=0;(a=v[o++])&&!t.isPropagationStopped();)h=a,t.type=o>1?u:f.bindType||m,(p=(K.get(a,"events")||Object.create(null))[t.type]&&K.get(a,"handle"))&&p.apply(a,n),(p=c&&a[c])&&p.apply&&z(a)&&(t.result=p.apply(a,n),!1===t.result&&t.preventDefault());return t.type=m,i||t.isDefaultPrevented()||f._default&&!1!==f._default.apply(v.pop(),n)||!z(r)||c&&d(r[m])&&!g(r)&&((s=r[c])&&(r[c]=null),S.event.triggered=m,t.isPropagationStopped()&&h.addEventListener(m,St),r[m](),t.isPropagationStopped()&&h.removeEventListener(m,St),S.event.triggered=void 0,s&&(r[c]=s)),t.result}},simulate:function(e,t,n){var r=S.extend(new S.Event,n,{type:e,isSimulated:!0});S.event.trigger(r,null,t)}}),S.fn.extend({trigger:function(e,t){return this.each((function(){S.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var n=this[0];if(n)return S.event.trigger(e,t,n,!0)}}),h.focusin||S.each({focus:"focusin",blur:"focusout"},(function(e,t){var n=function(e){S.event.simulate(t,e.target,S.event.fix(e))};S.event.special[t]={setup:function(){var r=this.ownerDocument||this.document||this,i=K.access(r,t);i||r.addEventListener(e,n,!0),K.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,i=K.access(r,t)-1;i?K.access(r,t,i):(r.removeEventListener(e,n,!0),K.remove(r,t))}}}));var xt=e.location,wt={guid:Date.now()},_t=/\?/;S.parseXML=function(t){var n,r;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){}return r=n&&n.getElementsByTagName("parsererror")[0],n&&!r||S.error("Invalid XML: "+(r?S.map(r.childNodes,(function(e){return e.textContent})).join("\n"):t)),n};var jt=/\[\]$/,Nt=/\r?\n/g,Dt=/^(?:submit|button|image|reset|file)$/i,Tt=/^(?:input|select|textarea|keygen)/i;function kt(e,t,n,r){var i;if(Array.isArray(t))S.each(t,(function(t,i){n||jt.test(e)?r(e,i):kt(e+"["+("object"===_typeof(i)&&null!=i?t:"")+"]",i,n,r)}));else if(n||"object"!==b(t))r(e,t);else for(i in t)kt(e+"["+i+"]",t[i],n,r)}S.param=function(e,t){var n,r=[],i=function(e,t){var n=d(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,(function(){i(this.name,this.value)}));else for(n in e)kt(n,e[n],t,i);return r.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=S.prop(this,"elements");return e?S.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!S(this).is(":disabled")&&Tt.test(this.nodeName)&&!Dt.test(e)&&(this.checked||!he.test(e))})).map((function(e,t){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,(function(e){return{name:t.name,value:e.replace(Nt,"\r\n")}})):{name:t.name,value:n.replace(Nt,"\r\n")}})).get()}});var It=/%20/g,Ct=/#.*$/,At=/([?&])_=[^&]*/,Pt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Et=/^(?:GET|HEAD)$/,Mt=/^\/\//,Lt={},Ht={},Rt="*/".concat("*"),Vt=y.createElement("a");function Ft(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(M)||[];if(d(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Ut(e,t,n,r){var i={},o=e===Ht;function a(s){var u;return i[s]=!0,S.each(e[s]||[],(function(e,s){var c=s(t,n,r);return"string"!=typeof c||o||i[c]?o?!(u=c):void 0:(t.dataTypes.unshift(c),a(c),!1)})),u}return a(t.dataTypes[0])||!i["*"]&&a("*")}function Bt(e,t){var n,r,i=S.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&S.extend(!0,e,r),e}Vt.href=xt.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:xt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(xt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Rt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Bt(Bt(e,S.ajaxSettings),t):Bt(S.ajaxSettings,e)},ajaxPrefilter:Ft(Lt),ajaxTransport:Ft(Ht),ajax:function(t,n){"object"===_typeof(t)&&(n=t,t=void 0),n=n||{};var r,i,o,a,s,u,c,l,p,f,h=S.ajaxSetup({},n),d=h.context||h,g=h.context&&(d.nodeType||d.jquery)?S(d):S.event,v=S.Deferred(),m=S.Callbacks("once memory"),b=h.statusCode||{},O={},x={},w="canceled",_={readyState:0,getResponseHeader:function(e){var t;if(c){if(!a)for(a={};t=Pt.exec(o);)a[t[1].toLowerCase()+" "]=(a[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=a[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return c?o:null},setRequestHeader:function(e,t){return null==c&&(e=x[e.toLowerCase()]=x[e.toLowerCase()]||e,O[e]=t),this},overrideMimeType:function(e){return null==c&&(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)_.always(e[_.status]);else for(t in e)b[t]=[b[t],e[t]];return this},abort:function(e){var t=e||w;return r&&r.abort(t),j(0,t),this}};if(v.promise(_),h.url=((t||h.url||xt.href)+"").replace(Mt,xt.protocol+"//"),h.type=n.method||n.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(M)||[""],null==h.crossDomain){u=y.createElement("a");try{u.href=h.url,u.href=u.href,h.crossDomain=Vt.protocol+"//"+Vt.host!=u.protocol+"//"+u.host}catch(e){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=S.param(h.data,h.traditional)),Ut(Lt,h,n,_),c)return _;for(p in(l=S.event&&h.global)&&0==S.active++&&S.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!Et.test(h.type),i=h.url.replace(Ct,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(It,"+")):(f=h.url.slice(i.length),h.data&&(h.processData||"string"==typeof h.data)&&(i+=(_t.test(i)?"&":"?")+h.data,delete h.data),!1===h.cache&&(i=i.replace(At,"$1"),f=(_t.test(i)?"&":"?")+"_="+wt.guid+++f),h.url=i+f),h.ifModified&&(S.lastModified[i]&&_.setRequestHeader("If-Modified-Since",S.lastModified[i]),S.etag[i]&&_.setRequestHeader("If-None-Match",S.etag[i])),(h.data&&h.hasContent&&!1!==h.contentType||n.contentType)&&_.setRequestHeader("Content-Type",h.contentType),_.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+Rt+"; q=0.01":""):h.accepts["*"]),h.headers)_.setRequestHeader(p,h.headers[p]);if(h.beforeSend&&(!1===h.beforeSend.call(d,_,h)||c))return _.abort();if(w="abort",m.add(h.complete),_.done(h.success),_.fail(h.error),r=Ut(Ht,h,n,_)){if(_.readyState=1,l&&g.trigger("ajaxSend",[_,h]),c)return _;h.async&&h.timeout>0&&(s=e.setTimeout((function(){_.abort("timeout")}),h.timeout));try{c=!1,r.send(O,j)}catch(e){if(c)throw e;j(-1,e)}}else j(-1,"No Transport");function j(t,n,a,u){var p,f,y,O,x,w=n;c||(c=!0,s&&e.clearTimeout(s),r=void 0,o=u||"",_.readyState=t>0?4:0,p=t>=200&&t<300||304===t,a&&(O=function(e,t,n){for(var r,i,o,a,s=e.contents,u=e.dataTypes;"*"===u[0];)u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(h,_,a)),!p&&S.inArray("script",h.dataTypes)>-1&&S.inArray("json",h.dataTypes)<0&&(h.converters["text script"]=function(){}),O=function(e,t,n,r){var i,o,a,s,u,c={},l=e.dataTypes.slice();if(l[1])for(a in e.converters)c[a.toLowerCase()]=e.converters[a];for(o=l.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=l.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=c[u+" "+o]||c["* "+o]))for(i in c)if((s=i.split(" "))[1]===o&&(a=c[u+" "+s[0]]||c["* "+s[0]])){!0===a?a=c[i]:!0!==c[i]&&(o=s[0],l.unshift(s[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(h,O,_,p),p?(h.ifModified&&((x=_.getResponseHeader("Last-Modified"))&&(S.lastModified[i]=x),(x=_.getResponseHeader("etag"))&&(S.etag[i]=x)),204===t||"HEAD"===h.type?w="nocontent":304===t?w="notmodified":(w=O.state,f=O.data,p=!(y=O.error))):(y=w,!t&&w||(w="error",t<0&&(t=0))),_.status=t,_.statusText=(n||w)+"",p?v.resolveWith(d,[f,w,_]):v.rejectWith(d,[_,w,y]),_.statusCode(b),b=void 0,l&&g.trigger(p?"ajaxSuccess":"ajaxError",[_,h,p?f:y]),m.fireWith(d,[_,w]),l&&(g.trigger("ajaxComplete",[_,h]),--S.active||S.event.trigger("ajaxStop")))}return _},getJSON:function(e,t,n){return S.get(e,t,n,"json")},getScript:function(e,t){return S.get(e,void 0,t,"script")}}),S.each(["get","post"],(function(e,t){S[t]=function(e,n,r,i){return d(n)&&(i=i||r,r=n,n=void 0),S.ajax(S.extend({url:e,type:t,dataType:i,data:n,success:r},S.isPlainObject(e)&&e))}})),S.ajaxPrefilter((function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")})),S._evalUrl=function(e,t,n){return S.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){S.globalEval(e,t,n)}})},S.fn.extend({wrapAll:function(e){var t;return this[0]&&(d(e)&&(e=e.call(this[0])),t=S(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this},wrapInner:function(e){return d(e)?this.each((function(t){S(this).wrapInner(e.call(this,t))})):this.each((function(){var t=S(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)}))},wrap:function(e){var t=d(e);return this.each((function(n){S(this).wrapAll(t?e.call(this,n):e)}))},unwrap:function(e){return this.parent(e).not("body").each((function(){S(this).replaceWith(this.childNodes)})),this}}),S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)},S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var qt={0:200,1223:204},Wt=S.ajaxSettings.xhr();h.cors=!!Wt&&"withCredentials"in Wt,h.ajax=Wt=!!Wt,S.ajaxTransport((function(t){var n,r;if(h.cors||Wt&&!t.crossDomain)return{send:function(i,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];for(a in t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)s.setRequestHeader(a,i[a]);n=function(e){return function(){n&&(n=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(qt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=n(),r=s.onerror=s.ontimeout=n("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&e.setTimeout((function(){n&&r()}))},n=n("abort");try{s.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}})),S.ajaxPrefilter((function(e){e.crossDomain&&(e.contents.script=!1)})),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return S.globalEval(e),e}}}),S.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")})),S.ajaxTransport("script",(function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(r,i){t=S("<script>").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),y.head.appendChild(t[0])},abort:function(){n&&n()}}}));var Gt,Jt=[],zt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Jt.pop()||S.expando+"_"+wt.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",(function(t,n,r){var i,o,a,s=!1!==t.jsonp&&(zt.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&zt.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=d(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(zt,"$1"+i):!1!==t.jsonp&&(t.url+=(_t.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return a||S.error(i+" was not called"),a[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){a=arguments},r.always((function(){void 0===o?S(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,Jt.push(i)),a&&d(o)&&o(a[0]),a=o=void 0})),"script"})),h.createHTMLDocument=((Gt=y.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Gt.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(h.createHTMLDocument?((r=(t=y.implementation.createHTMLDocument("")).createElement("base")).href=y.location.href,t.head.appendChild(r)):t=y),o=!n&&[],(i=T.exec(e))?[t.createElement(i[1])]:(i=Oe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return s>-1&&(r=yt(e.slice(s)),e=e.slice(0,s)),d(t)?(n=t,t=void 0):t&&"object"===_typeof(t)&&(i="POST"),a.length>0&&S.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done((function(e){o=arguments,a.html(r?S("<div>").append(S.parseHTML(e)).find(r):e)})).always(n&&function(e,t){a.each((function(){n.apply(this,o||[e.responseText,t,e])}))}),this},S.expr.pseudos.animated=function(e){return S.grep(S.timers,(function(t){return e===t.elem})).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,c=S.css(e,"position"),l=S(e),p={};"static"===c&&(e.style.position="relative"),s=l.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===c||"fixed"===c)&&(o+u).indexOf("auto")>-1?(a=(r=l.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),d(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(p.top=t.top-s.top+a),null!=t.left&&(p.left=t.left-s.left+i),"using"in t?t.using.call(e,p):l.css(p)}},S.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each((function(t){S.offset.setOffset(this,e,t)}));var t,n,r=this[0];return r?r.getClientRects().length?(t=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{for(t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position");)e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var e=this.offsetParent;e&&"static"===S.css(e,"position");)e=e.offsetParent;return e||re}))}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(e,t){var n="pageYOffset"===t;S.fn[e]=function(r){return B(this,(function(e,r,i){var o;if(g(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===i)return o?o[t]:e[r];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):e[r]=i}),e,r,arguments.length)}})),S.each(["top","left"],(function(e,t){S.cssHooks[t]=Ge(h.pixelPosition,(function(e,n){if(n)return n=We(e,t),He.test(n)?S(e).position()[t]+"px":n}))})),S.each({Height:"height",Width:"width"},(function(e,t){S.each({padding:"inner"+e,content:t,"":"outer"+e},(function(n,r){S.fn[r]=function(i,o){var a=arguments.length&&(n||"boolean"!=typeof i),s=n||(!0===i||!0===o?"margin":"border");return B(this,(function(t,n,i){var o;return g(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===i?S.css(t,n,s):S.style(t,n,i,s)}),t,a?i:void 0,a)}}))})),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(e,t){S.fn[t]=function(e){return this.on(t,e)}})),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(e,t){S.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}));var $t=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;S.proxy=function(e,t){var n,r,o;if("string"==typeof t&&(n=e[t],t=e,e=n),d(e))return r=i.call(arguments,2),o=function(){return e.apply(t||this,r.concat(i.call(arguments)))},o.guid=e.guid=e.guid||S.guid++,o},S.holdReady=function(e){e?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=D,S.isFunction=d,S.isWindow=g,S.camelCase=J,S.type=b,S.now=Date.now,S.isNumeric=function(e){var t=S.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},S.trim=function(e){return null==e?"":(e+"").replace($t,"$1")};var Kt=e.jQuery,Xt=e.$;return S.noConflict=function(t){return e.$===S&&(e.$=Xt),t&&e.jQuery===S&&(e.jQuery=Kt),S},void 0===t&&(e.jQuery=e.$=S),S}))},{}],83:[function(e,t,n){t.exports=function(e,t){return t.startsWith(e)&&t.endsWith(e)?t.substring(1,t.length-1):t}},{}],84:[function(e,t,n){
|
|
165
|
+
/**
|
|
166
|
+
* @license MIT
|
|
167
|
+
* @author <steven@velozo.com>
|
|
168
|
+
*/
|
|
169
|
+
var r=e("./Manyfest-LogToConsole.js"),i=function(){function e(t,n){_classCallCheck(this,e),this.logInfo="function"==typeof t?t:r,this.logError="function"==typeof n?n:r,this.translationTable={}}return _createClass(e,[{key:"translationCount",value:function(){return Object.keys(this.translationTable).length}},{key:"addTranslation",value:function(e){var t=this;if("object"!=_typeof(e))return this.logError("Hash translation addTranslation expected a translation be type object but was passed in ".concat(_typeof(e))),!1;Object.keys(e).forEach((function(n){"string"!=typeof e[n]?t.logError("Hash translation addTranslation expected a translation destination hash for [".concat(n,"] to be a string but the referrant was a ").concat(_typeof(e[n]))):t.translationTable[n]=e[n]}))}},{key:"removeTranslationHash",value:function(e){this.translationTable.hasOwnProperty(e)&&delete this.translationTable[e]}},{key:"removeTranslation",value:function(e){var t=this;return"string"==typeof e?(this.removeTranslationHash(e),!0):"object"==_typeof(e)?(Object.keys(e).forEach((function(e){t.removeTranslation(e)})),!0):(this.logError("Hash translation removeTranslation expected either a string or an object but the passed-in translation was type ".concat(_typeof(e))),!1)}},{key:"clearTranslations",value:function(){this.translationTable={}}},{key:"translate",value:function(e){return this.translationTable.hasOwnProperty(e)?this.translationTable[e]:e}}]),e}();t.exports=i},{"./Manyfest-LogToConsole.js":85}],85:[function(e,t,n){t.exports=function(e,t){var n="string"==typeof e?e:"";console.log("[Manyfest] ".concat(n)),t&&console.log(JSON.stringify(t))}},{}],86:[function(e,t,n){
|
|
170
|
+
/**
|
|
171
|
+
* @license MIT
|
|
172
|
+
* @author <steven@velozo.com>
|
|
173
|
+
*/
|
|
174
|
+
var r=e("./Manyfest-LogToConsole.js"),i=function(){function e(t,n){_classCallCheck(this,e),this.logInfo="function"==typeof t?t:r,this.logError="function"==typeof n?n:r,this.elucidatorSolver=!1,this.elucidatorSolverState={}}return _createClass(e,[{key:"checkAddressExists",value:function(e,t){if("object"!=_typeof(e))return!1;if("string"!=typeof t)return!1;var n=t.indexOf(".");if(-1==n){var r=t.indexOf("["),i=t.indexOf("]");if(r>0&&i>r&&i-r>1){var o=t.substring(0,r).trim();if("object"!==_typeof(e[o]))return!1;var a=t.substring(r+1,i).trim(),s=parseInt(a,10);return Array.isArray(e[o])!=isNaN(s)&&(isNaN(s)?(a=this.cleanWrapCharacters('"',a),a=this.cleanWrapCharacters("`",a),a=this.cleanWrapCharacters("'",a),e[o].hasOwnProperty(a)):s in e[o])}return e.hasOwnProperty(t)}var u=t.substring(0,n),c=t.substring(n+1),l=u.indexOf("["),p=u.indexOf("]");if(l>0&&p>l&&p-l>1){var f=u.substring(0,l).trim(),h=u.substring(l+1,p).trim(),d=parseInt(h,10);return Array.isArray(e[f])!=isNaN(d)&&(isNaN(d)?(h=this.cleanWrapCharacters('"',h),h=this.cleanWrapCharacters("`",h),h=this.cleanWrapCharacters("'",h),this.checkAddressExists(e[f][h],c)):this.checkAddressExists(e[f][d],c))}return(!e.hasOwnProperty(u)||"object"===_typeof(e[u]))&&(e.hasOwnProperty(u)||(e[u]={}),this.checkAddressExists(e[u],c))}}]),e}();t.exports=i},{"./Manyfest-LogToConsole.js":85}],87:[function(e,t,n){
|
|
175
|
+
/**
|
|
176
|
+
* @license MIT
|
|
177
|
+
* @author <steven@velozo.com>
|
|
178
|
+
*/
|
|
179
|
+
var r=e("./Manyfest-LogToConsole.js"),i=e("precedent"),o=e("./Manyfest-CleanWrapCharacters.js"),a=function(){function t(e,n){_classCallCheck(this,t),this.logInfo="function"==typeof e?e:r,this.logError="function"==typeof n?n:r,this.elucidatorSolver=!1,this.elucidatorSolverState={},this.cleanWrapCharacters=o}return _createClass(t,[{key:"checkFilters",value:function(t,n){var r=this,o=new i,a=t;if(!this.elucidatorSolver){var s=e("elucidator");this.elucidatorSolver=new s({},this.logInfo,this.logError)}if(this.elucidatorSolver){var u={Record:n,keepRecord:!0};return o.addPattern("<<~~","~~>>",(function(e){r.elucidatorSolverState.hasOwnProperty(e)&&(u.SolutionState=r.elucidatorSolverState[e]),r.elucidatorSolver.solveInternalOperation("Custom",e,u)})),o.addPattern("<<~?","?~>>",(function(e){if("string"!=typeof e)return!1;var t=e.split(","),n=t[0],i=t[1],o=t[2];u.ComparisonState={SearchAddress:n,Comparator:i,SearchTerm:o},r.elucidatorSolver.solveOperation({Description:{Operation:"Simple_If",Synopsis:"Test for "},Steps:[{Namespace:"Logic",Instruction:"if",InputHashAddressMap:{leftValue:"Record.".concat(n),rightValue:"ComparisonState.SearchTerm",comparator:"ComparisonState.Comparator"},OutputHashAddressMap:{truthinessResult:"keepRecord"}}]},u)})),o.parseString(a),u.keepRecord}return!0}},{key:"deleteValueAtAddress",value:function(e,t,n){if("object"==_typeof(e)&&"string"==typeof t){var r="";"string"==typeof n&&(r=n);var i=t.indexOf(".");if(-1==i){var o=t.indexOf("["),a=t.indexOf("]"),s=t.indexOf("{}");if(o>0&&a>o&&a-o>1){var u=t.substring(0,o).trim();if("object"!==_typeof(e[u]))return!1;var c=t.substring(o+1,a).trim(),l=parseInt(c,10);return Array.isArray(e[u])!=isNaN(l)&&(isNaN(l)?(c=this.cleanWrapCharacters('"',c),c=this.cleanWrapCharacters("`",c),c=this.cleanWrapCharacters("'",c),delete e[u][c],!0):(delete e[u][l],!0))}if(o>0&&a>o&&a-o==1){var p=t.substring(0,o).trim();if(!Array.isArray(e[p]))return!1;for(var f=e[p],h=f.length-1;h>=0;h--){this.checkFilters(t,f[h])&&f.splice(h,1)}return!0}if(s>0){var d=t.substring(0,s).trim();return"object"==_typeof(e[d])&&(delete e[d],!0)}return delete e[t],!0}var g=t.substring(0,i),y=t.substring(i+1),v=g.indexOf("["),m=g.indexOf("]");if(v>0&&m>v&&m-v>1){var b=g.substring(0,v).trim(),O=g.substring(v+1,m).trim(),S=parseInt(O,10);return Array.isArray(e[b])!=isNaN(S)&&("object"==_typeof(e[b])&&(isNaN(S)?(O=this.cleanWrapCharacters('"',O),O=this.cleanWrapCharacters("`",O),O=this.cleanWrapCharacters("'",O),r="".concat(r).concat(r.length>0?".":"").concat(g),this.deleteValueAtAddress(e[b][O],y,r)):(r="".concat(r).concat(r.length>0?".":"").concat(g),this.deleteValueAtAddress(e[b][S],y,r))))}if(v>0&&m>v&&m-v==1){var x=t.substring(0,v).trim();if(!Array.isArray(e[x]))return!1;var w=e[x];r="".concat(r).concat(r.length>0?".":"").concat(x);for(var _={},j=0;j<w.length;j++){var N="".concat(r,"[").concat(j,"]"),D=this.deleteValueAtAddress(e[x][j],y,N);_["".concat(N,".").concat(y)]=D}return _}var T=t.indexOf("{}");if(T>0){var k=t.substring(0,T).trim();if("object"!=_typeof(e[k]))return!1;var I=e[k],C=Object.keys(I);r="".concat(r).concat(r.length>0?".":"").concat(k);for(var A={},P=0;P<C.length;P++){var E="".concat(r,".").concat(C[P]),M=this.deleteValueAtAddress(e[k][C[P]],y,E);this.checkFilters(t,M)&&(A["".concat(E,".").concat(y)]=M)}return A}return e.hasOwnProperty(g)&&"object"!==_typeof(e[g])?void 0:e.hasOwnProperty(g)?(r="".concat(r).concat(r.length>0?".":"").concat(g),this.deleteValueAtAddress(e[g],y,r)):(r="".concat(r).concat(r.length>0?".":"").concat(g),e[g]={},this.deleteValueAtAddress(e[g],y,r))}}}]),t}();t.exports=a},{"./Manyfest-CleanWrapCharacters.js":83,"./Manyfest-LogToConsole.js":85,elucidator:31,precedent:95}],88:[function(e,t,n){
|
|
180
|
+
/**
|
|
181
|
+
* @license MIT
|
|
182
|
+
* @author <steven@velozo.com>
|
|
183
|
+
*/
|
|
184
|
+
var r=e("./Manyfest-LogToConsole.js"),i=e("precedent"),o=e("./Manyfest-CleanWrapCharacters.js"),a=function(){function t(e,n){_classCallCheck(this,t),this.logInfo="function"==typeof e?e:r,this.logError="function"==typeof n?n:r,this.elucidatorSolver=!1,this.elucidatorSolverState={},this.cleanWrapCharacters=o}return _createClass(t,[{key:"checkFilters",value:function(t,n){var r=this,o=new i,a=t;if(!this.elucidatorSolver){var s=e("elucidator");this.elucidatorSolver=new s({},this.logInfo,this.logError)}if(this.elucidatorSolver){var u={Record:n,keepRecord:!0};return o.addPattern("<<~~","~~>>",(function(e){r.elucidatorSolverState.hasOwnProperty(e)&&(u.SolutionState=r.elucidatorSolverState[e]),r.elucidatorSolver.solveInternalOperation("Custom",e,u)})),o.addPattern("<<~?","?~>>",(function(e){if("string"!=typeof e)return!1;var t=e.split(","),n=t[0],i=t[1],o=t[2];u.ComparisonState={SearchAddress:n,Comparator:i,SearchTerm:o},r.elucidatorSolver.solveOperation({Description:{Operation:"Simple_If",Synopsis:"Test for "},Steps:[{Namespace:"Logic",Instruction:"if",InputHashAddressMap:{leftValue:"Record.".concat(n),rightValue:"ComparisonState.SearchTerm",comparator:"ComparisonState.Comparator"},OutputHashAddressMap:{truthinessResult:"keepRecord"}}]},u)})),o.parseString(a),u.keepRecord}return!0}},{key:"getValueAtAddress",value:function(e,t,n){if("object"==_typeof(e)&&"string"==typeof t){var r="";"string"==typeof n&&(r=n);var i=t.indexOf(".");if(-1==i){var o=t.indexOf("["),a=t.indexOf("]"),s=t.indexOf("{}");if(o>0&&a>o&&a-o>1){var u=t.substring(0,o).trim();if("object"!==_typeof(e[u]))return;var c=t.substring(o+1,a).trim(),l=parseInt(c,10);if(Array.isArray(e[u])==isNaN(l))return;return isNaN(l)?(c=this.cleanWrapCharacters('"',c),c=this.cleanWrapCharacters("`",c),c=this.cleanWrapCharacters("'",c),e[u][c]):e[u][l]}if(o>0&&a>o&&a-o==1){var p=t.substring(0,o).trim();if(!Array.isArray(e[p]))return!1;for(var f=e[p],h=[],d=0;d<f.length;d++){this.checkFilters(t,f[d])&&h.push(f[d])}return h}if(s>0){var g=t.substring(0,s).trim();return"object"==_typeof(e[g])&&e[g]}return e[t]}var y=t.substring(0,i),v=t.substring(i+1),m=y.indexOf("["),b=y.indexOf("]");if(m>0&&b>m&&b-m>1){var O=y.substring(0,m).trim(),S=y.substring(m+1,b).trim(),x=parseInt(S,10);if(Array.isArray(e[O])==isNaN(x))return;if("object"!=_typeof(e[O]))return;return isNaN(x)?(S=this.cleanWrapCharacters('"',S),S=this.cleanWrapCharacters("`",S),S=this.cleanWrapCharacters("'",S),r="".concat(r).concat(r.length>0?".":"").concat(y),this.getValueAtAddress(e[O][S],v,r)):(r="".concat(r).concat(r.length>0?".":"").concat(y),this.getValueAtAddress(e[O][x],v,r))}if(m>0&&b>m&&b-m==1){var w=t.substring(0,m).trim();if(!Array.isArray(e[w]))return!1;var _=e[w];r="".concat(r).concat(r.length>0?".":"").concat(w);for(var j={},N=0;N<_.length;N++){var D="".concat(r,"[").concat(N,"]"),T=this.getValueAtAddress(e[w][N],v,D);j["".concat(D,".").concat(v)]=T}return j}var k=t.indexOf("{}");if(k>0){var I=t.substring(0,k).trim();if("object"!=_typeof(e[I]))return!1;var C=e[I],A=Object.keys(C);r="".concat(r).concat(r.length>0?".":"").concat(I);for(var P={},E=0;E<A.length;E++){var M="".concat(r,".").concat(A[E]),L=this.getValueAtAddress(e[I][A[E]],v,M);this.checkFilters(t,L)&&(P["".concat(M,".").concat(v)]=L)}return P}return e.hasOwnProperty(y)&&"object"!==_typeof(e[y])?void 0:e.hasOwnProperty(y)?(r="".concat(r).concat(r.length>0?".":"").concat(y),this.getValueAtAddress(e[y],v,r)):(r="".concat(r).concat(r.length>0?".":"").concat(y),e[y]={},this.getValueAtAddress(e[y],v,r))}}}]),t}();t.exports=a},{"./Manyfest-CleanWrapCharacters.js":83,"./Manyfest-LogToConsole.js":85,elucidator:31,precedent:95}],89:[function(e,t,n){
|
|
185
|
+
/**
|
|
186
|
+
* @license MIT
|
|
187
|
+
* @author <steven@velozo.com>
|
|
188
|
+
*/
|
|
189
|
+
var r=e("./Manyfest-LogToConsole.js"),i=(e("precedent"),e("./Manyfest-CleanWrapCharacters.js")),o=function(){function e(t,n){_classCallCheck(this,e),this.logInfo="function"==typeof t?t:r,this.logError="function"==typeof n?n:r,this.elucidatorSolver=!1,this.elucidatorSolverState={},this.cleanWrapCharacters=i}return _createClass(e,[{key:"setValueAtAddress",value:function(e,t,n){if("object"!=_typeof(e))return!1;if("string"!=typeof t)return!1;var r=t.indexOf(".");if(-1==r){var i=t.indexOf("["),o=t.indexOf("]");if(i>0&&o>i&&o-i>1){var a=t.substring(0,i).trim();if("object"!==_typeof(e[a]))return!1;var s=t.substring(i+1,o).trim(),u=parseInt(s,10);return Array.isArray(e[a])!=isNaN(u)&&(isNaN(u)?(s=this.cleanWrapCharacters('"',s),s=this.cleanWrapCharacters("`",s),s=this.cleanWrapCharacters("'",s),e[a][s]=n,!0):(e[a][u]=n,!0))}return e[t]=n,!0}var c=t.substring(0,r),l=t.substring(r+1),p=c.indexOf("["),f=c.indexOf("]");if(p>0&&f>p&&f-p>1){var h=c.substring(0,p).trim(),d=c.substring(p+1,f).trim(),g=parseInt(d,10);return Array.isArray(e[h])!=isNaN(g)&&(isNaN(g)?(d=this.cleanWrapCharacters('"',d),d=this.cleanWrapCharacters("`",d),d=this.cleanWrapCharacters("'",d),this.setValueAtAddress(e[h][d],l,n)):this.setValueAtAddress(e[h][g],l,n))}return e.hasOwnProperty(c)&&"object"!==_typeof(e[c])?(e.hasOwnProperty("__ERROR")||(e.__ERROR={}),e.__ERROR[t]=n,!1):(e.hasOwnProperty(c)||(e[c]={}),this.setValueAtAddress(e[c],l,n))}}]),e}();t.exports=o},{"./Manyfest-CleanWrapCharacters.js":83,"./Manyfest-LogToConsole.js":85,precedent:95}],90:[function(e,t,n){
|
|
190
|
+
/**
|
|
191
|
+
* @license MIT
|
|
192
|
+
* @author <steven@velozo.com>
|
|
193
|
+
*/
|
|
194
|
+
var r=e("./Manyfest-LogToConsole.js"),i=function(){function e(t,n){_classCallCheck(this,e),this.logInfo="function"==typeof t?t:r,this.logError="function"==typeof n?n:r}return _createClass(e,[{key:"generateAddressses",value:function(e,t,n){var r="string"==typeof t?t:"",i="object"==_typeof(n)?n:{},o=_typeof(e),a={Address:r,Hash:r,Name:r,InSchema:!1};switch("object"==o&&null==e&&(o="null"),o){case"string":a.DataType="String",a.Default=e,i[r]=a;break;case"number":case"bigint":a.DataType="Number",a.Default=e,i[r]=a;break;case"undefined":case"null":a.DataType="Any",a.Default=e,i[r]=a;break;case"object":if(Array.isArray(e)){a.DataType="Array",""!=r&&(i[r]=a);for(var s=0;s<e.length;s++)this.generateAddressses(e[s],"".concat(r,"[").concat(s,"]"),i)}else{a.DataType="Object",""!=r&&(i[r]=a,r+=".");for(var u=Object.keys(e),c=0;c<u.length;c++)this.generateAddressses(e[u[c]],"".concat(r).concat(u[c]),i)}}return i}}]),e}();t.exports=i},{"./Manyfest-LogToConsole.js":85}],91:[function(e,t,n){
|
|
195
|
+
/**
|
|
196
|
+
* @license MIT
|
|
197
|
+
* @author <steven@velozo.com>
|
|
198
|
+
*/
|
|
199
|
+
var r=e("./Manyfest-LogToConsole.js"),i=function(){function e(t,n){_classCallCheck(this,e),this.logInfo="function"==typeof t?t:r,this.logError="function"==typeof n?n:r}return _createClass(e,[{key:"resolveAddressMappings",value:function(e,t){if("object"!=_typeof(e))return this.logError("Attempted to resolve address mapping but the descriptor was not an object."),!1;if("object"!=_typeof(t))return!0;var n=Object.keys(e),r={};return n.forEach((function(t){e[t].hasOwnProperty("Hash")&&(r[e[t].Hash]=t)})),Object.keys(t).forEach((function(n){var i=t[n],o=!1,a=!1;e.hasOwnProperty(n)?o=n:r.hasOwnProperty(n)&&(o=r[n]),o?(a=e[o],delete e[o]):a={Hash:n},e[i]=a})),!0}},{key:"safeResolveAddressMappings",value:function(e,t){var n=JSON.parse(JSON.stringify(e));return this.resolveAddressMappings(n,t),n}},{key:"mergeAddressMappings",value:function(e,t){if("object"!=_typeof(t)||"object"!=_typeof(e))return this.logError("Attempted to merge two schema descriptors but both were not objects."),!1;var n=JSON.parse(JSON.stringify(t)),r=JSON.parse(JSON.stringify(e));return Object.keys(n).forEach((function(e){r.hasOwnProperty(e)||(r[e]=n[e])})),r}}]),e}();t.exports=i},{"./Manyfest-LogToConsole.js":85}],92:[function(e,t,n){
|
|
200
|
+
/**
|
|
201
|
+
* @license MIT
|
|
202
|
+
* @author <steven@velozo.com>
|
|
203
|
+
*/
|
|
204
|
+
var r=e("./Manyfest-LogToConsole.js"),i=(e("precedent"),e("./Manyfest-HashTranslation.js")),o=e("./Manyfest-ObjectAddress-CheckAddressExists.js"),a=e("./Manyfest-ObjectAddress-GetValue.js"),s=e("./Manyfest-ObjectAddress-SetValue.js"),u=e("./Manyfest-ObjectAddress-DeleteValue.js"),c=e("./Manyfest-ObjectAddressGeneration.js"),l=e("./Manyfest-SchemaManipulation.js"),p=function(){function t(e,n,p,f){_classCallCheck(this,t),this.logInfo="function"==typeof n?n:r,this.logError="function"==typeof p?p:r,this.objectAddressCheckAddressExists=new o(this.logInfo,this.logError),this.objectAddressGetValue=new a(this.logInfo,this.logError),this.objectAddressSetValue=new s(this.logInfo,this.logError),this.objectAddressDeleteValue=new u(this.logInfo,this.logError),this.options={strict:!1,defaultValues:{String:"",Number:0,Float:0,Integer:0,Boolean:!1,Binary:0,DateTime:0,Array:[],Object:{},Null:null}},this.scope=void 0,this.elementAddresses=void 0,this.elementHashes=void 0,this.elementDescriptors=void 0,this.dataSolvers=void 0,this.dataSolverState=void 0,this.reset(),"object"===_typeof(e)&&this.loadManifest(e),this.schemaManipulations=new l(this.logInfo,this.logError),this.objectAddressGeneration=new c(this.logInfo,this.logError),this.hashTranslations=new i(this.logInfo,this.logError)}return _createClass(t,[{key:"reset",value:function(){this.scope="DEFAULT",this.elementAddresses=[],this.elementHashes={},this.elementDescriptors={},this.dataSolvers=void 0,this.dataSolverState={},this.libElucidator=void 0}},{key:"setElucidatorSolvers",value:function(e,t){this.objectAddressCheckAddressExists.elucidatorSolver=e,this.objectAddressGetValue.elucidatorSolver=e,this.objectAddressSetValue.elucidatorSolver=e,this.objectAddressDeleteValue.elucidatorSolver=e,this.objectAddressCheckAddressExists.elucidatorSolverState=t,this.objectAddressGetValue.elucidatorSolverState=t,this.objectAddressSetValue.elucidatorSolverState=t,this.objectAddressDeleteValue.elucidatorSolverState=t}},{key:"clone",value:function(){var e=JSON.parse(JSON.stringify(this.options)),n=new t(this.getManifest(),this.logInfo,this.logError,e);return n.hashTranslations.addTranslation(this.hashTranslations.translationTable),n}},{key:"deserialize",value:function(e){return this.loadManifest(JSON.parse(e))}},{key:"loadManifest",value:function(t){"object"!==_typeof(t)&&this.logError("(".concat(this.scope,") Error loading manifest; expecting an object but parameter was type ").concat(_typeof(t),"."));var n="object"==_typeof(t)?t:{};if(n.hasOwnProperty("Scope")?"string"==typeof n.Scope?this.scope=n.Scope:this.logError("(".concat(this.scope,") Error loading scope from manifest; expecting a string but property was type ").concat(_typeof(n.Scope),"."),n):this.logError("(".concat(this.scope,') Error loading scope from manifest object. Property "Scope" does not exist in the root of the object.'),n),n.hasOwnProperty("Descriptors"))if("object"===_typeof(n.Descriptors))for(var r=Object.keys(n.Descriptors),i=0;i<r.length;i++)this.addDescriptor(r[i],n.Descriptors[r[i]]);else this.logError("(".concat(this.scope,") Error loading description object from manifest object. Expecting an object in 'Manifest.Descriptors' but the property was type ").concat(_typeof(n.Descriptors),"."),n);else this.logError("(".concat(this.scope,') Error loading object description from manifest object. Property "Descriptors" does not exist in the root of the Manifest object.'),n);if(n.hasOwnProperty("Solvers")&&"object"==_typeof(n.Solvers)){var o=e("elucidator");this.dataSolvers=new o(n.Solvers,this.logInfo,this.logError);for(var a=Object.keys(n.Solvers),s=0;s<a.length;s++)this.dataSolverState[a]=n.Solvers[a[s]];this.setElucidatorSolvers(this.dataSolvers,this.dataSolverState)}}},{key:"serialize",value:function(){return JSON.stringify(this.getManifest())}},{key:"getManifest",value:function(){return{Scope:this.scope,Descriptors:JSON.parse(JSON.stringify(this.elementDescriptors))}}},{key:"addDescriptor",value:function(e,t){return"object"===_typeof(t)?(t.hasOwnProperty("Address")||(t.Address=e),this.elementDescriptors.hasOwnProperty(e)||this.elementAddresses.push(e),this.elementDescriptors[e]=t,this.elementHashes[e]=e,t.hasOwnProperty("Hash")?this.elementHashes[t.Hash]=e:t.Hash=e,!0):(this.logError("(".concat(this.scope,") Error loading object descriptor for address '").concat(e,"' from manifest object. Expecting an object but property was type ").concat(_typeof(t),".")),!1)}},{key:"getDescriptorByHash",value:function(e){return this.getDescriptor(this.resolveHashAddress(e))}},{key:"getDescriptor",value:function(e){return this.elementDescriptors[e]}},{key:"eachDescriptor",value:function(e){for(var t=Object.keys(this.elementDescriptors),n=0;n<t.length;n++)e(this.elementDescriptors[t[n]])}},{key:"checkAddressExistsByHash",value:function(e,t){return this.checkAddressExists(e,this.resolveHashAddress(t))}},{key:"checkAddressExists",value:function(e,t){return this.objectAddressCheckAddressExists.checkAddressExists(e,t)}},{key:"resolveHashAddress",value:function(e){var t=this.elementHashes.hasOwnProperty(e),n=this.hashTranslations.translationTable.hasOwnProperty(e);return t&&!n?this.elementHashes[e]:n&&this.elementHashes.hasOwnProperty(this.hashTranslations.translate(e))?this.elementHashes[this.hashTranslations.translate(e)]:n?this.hashTranslations.translate(e):e}},{key:"getValueByHash",value:function(e,t){var n=this.getValueAtAddress(e,this.resolveHashAddress(t));return void 0===n&&(n=this.getDefaultValue(this.getDescriptorByHash(t))),n}},{key:"getValueAtAddress",value:function(e,t){var n=this.objectAddressGetValue.getValueAtAddress(e,t);return void 0===n&&(n=this.getDefaultValue(this.getDescriptor(t))),n}},{key:"setValueByHash",value:function(e,t,n){return this.setValueAtAddress(e,this.resolveHashAddress(t),n)}},{key:"setValueAtAddress",value:function(e,t,n){return this.objectAddressSetValue.setValueAtAddress(e,t,n)}},{key:"deleteValueByHash",value:function(e,t,n){return this.deleteValueAtAddress(e,this.resolveHashAddress(t),n)}},{key:"deleteValueAtAddress",value:function(e,t,n){return this.objectAddressDeleteValue.deleteValueAtAddress(e,t,n)}},{key:"validate",value:function(e){var t={Error:null,Errors:[],MissingElements:[]};"object"!==_typeof(e)&&(t.Error=!0,t.Errors.push("Expected passed in object to be type object but was passed in ".concat(_typeof(e))));for(var n=function(e,n){t.Error=!0,t.Errors.push('Element at address "'.concat(e,'" ').concat(n,"."))},r=0;r<this.elementAddresses.length;r++){var i=this.getDescriptor(this.elementAddresses[r]),o=this.checkAddressExists(e,i.Address),a=this.getValueAtAddress(e,i.Address);if(void 0!==a&&o||(t.MissingElements.push(i.Address),(i.Required||this.options.strict)&&n(i.Address,"is flagged REQUIRED but is not set in the object")),i.DataType){var s=_typeof(a);switch(i.DataType.toString().trim().toLowerCase()){case"string":"string"!=s&&n(i.Address,"has a DataType ".concat(i.DataType," but is of the type ").concat(s));break;case"number":"number"!=s&&n(i.Address,"has a DataType ".concat(i.DataType," but is of the type ").concat(s));break;case"integer":if("number"!=s)n(i.Address,"has a DataType ".concat(i.DataType," but is of the type ").concat(s));else a.toString().indexOf(".")>-1&&n(i.Address,"has a DataType ".concat(i.DataType," but has a decimal point in the number."));break;case"float":"number"!=s&&n(i.Address,"has a DataType ".concat(i.DataType," but is of the type ").concat(s));break;case"DateTime":"Invalid Date"==new Date(a).toString()&&n(i.Address,"has a DataType ".concat(i.DataType," but is not parsable as a Date by Javascript"));default:"string"!=s&&n(i.Address,"has a DataType ".concat(i.DataType," (which auto-converted to String because it was unrecognized) but is of the type ").concat(s))}}}return t}},{key:"getDefaultValue",value:function(e){if("object"==_typeof(e)){if(e.hasOwnProperty("Default"))return e.Default;var t=e.hasOwnProperty("DataType")?e.DataType:"String";return this.options.defaultValues.hasOwnProperty(t)?this.options.defaultValues[t]:null}}},{key:"populateDefaults",value:function(e,t){return this.populateObject(e,t,(function(e){return e.hasOwnProperty("Default")}))}},{key:"populateObject",value:function(e,t,n){var r=this,i="object"===_typeof(e)?e:{},o=void 0!==t&&t,a="function"==typeof n?n:function(e){return!0};return this.elementAddresses.forEach((function(e){var t=r.getDescriptor(e);a(t)&&(!o&&r.checkAddressExists(i,e)||r.setValueAtAddress(i,e,r.getDefaultValue(t)))})),i}}]),t}();t.exports=p},{"./Manyfest-HashTranslation.js":84,"./Manyfest-LogToConsole.js":85,"./Manyfest-ObjectAddress-CheckAddressExists.js":86,"./Manyfest-ObjectAddress-DeleteValue.js":87,"./Manyfest-ObjectAddress-GetValue.js":88,"./Manyfest-ObjectAddress-SetValue.js":89,"./Manyfest-ObjectAddressGeneration.js":90,"./Manyfest-SchemaManipulation.js":91,elucidator:31,precedent:95}],93:[function(e,t,n){!function(e,n,r){if(e){for(var i,o={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},a={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},s={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},u={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},c=1;c<20;++c)o[111+c]="f"+c;for(c=0;c<=9;++c)o[c+96]=c.toString();y.prototype.bind=function(e,t,n){var r=this;return e=e instanceof Array?e:[e],r._bindMultiple.call(r,e,t,n),r},y.prototype.unbind=function(e,t){return this.bind.call(this,e,(function(){}),t)},y.prototype.trigger=function(e,t){var n=this;return n._directMap[e+":"+t]&&n._directMap[e+":"+t]({},e),n},y.prototype.reset=function(){var e=this;return e._callbacks={},e._directMap={},e},y.prototype.stopCallback=function(e,t){if((" "+t.className+" ").indexOf(" mousetrap ")>-1)return!1;if(g(t,this.target))return!1;if("composedPath"in e&&"function"==typeof e.composedPath){var n=e.composedPath()[0];n!==e.target&&(t=n)}return"INPUT"==t.tagName||"SELECT"==t.tagName||"TEXTAREA"==t.tagName||t.isContentEditable},y.prototype.handleKey=function(){return this._handleKey.apply(this,arguments)},y.addKeycodes=function(e){for(var t in e)e.hasOwnProperty(t)&&(o[t]=e[t]);i=null},y.init=function(){var e=y(n);for(var t in e)"_"!==t.charAt(0)&&(y[t]=function(t){return function(){return e[t].apply(e,arguments)}}(t))},y.init(),e.Mousetrap=y,void 0!==t&&t.exports&&(t.exports=y)}function l(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function p(e){if("keypress"==e.type){var t=String.fromCharCode(e.which);return e.shiftKey||(t=t.toLowerCase()),t}return o[e.which]?o[e.which]:a[e.which]?a[e.which]:String.fromCharCode(e.which).toLowerCase()}function f(e){return"shift"==e||"ctrl"==e||"alt"==e||"meta"==e}function h(e,t,n){return n||(n=function(){if(!i)for(var e in i={},o)e>95&&e<112||o.hasOwnProperty(e)&&(i[o[e]]=e);return i}()[e]?"keydown":"keypress"),"keypress"==n&&t.length&&(n="keydown"),n}function d(e,t){var n,r,i,o=[];for(n=function(e){return"+"===e?["+"]:(e=e.replace(/\+{2}/g,"+plus")).split("+")}(e),i=0;i<n.length;++i)r=n[i],u[r]&&(r=u[r]),t&&"keypress"!=t&&s[r]&&(r=s[r],o.push("shift")),f(r)&&o.push(r);return{key:r,modifiers:o,action:t=h(r,o,t)}}function g(e,t){return null!==e&&e!==n&&(e===t||g(e.parentNode,t))}function y(e){var t=this;if(e=e||n,!(t instanceof y))return new y(e);t.target=e,t._callbacks={},t._directMap={};var r,i={},o=!1,a=!1,s=!1;function u(e){e=e||{};var t,n=!1;for(t in i)e[t]?n=!0:i[t]=0;n||(s=!1)}function c(e,n,r,o,a,s){var u,c,l,p,h=[],d=r.type;if(!t._callbacks[e])return[];for("keyup"==d&&f(e)&&(n=[e]),u=0;u<t._callbacks[e].length;++u)if(c=t._callbacks[e][u],(o||!c.seq||i[c.seq]==c.level)&&d==c.action&&("keypress"==d&&!r.metaKey&&!r.ctrlKey||(l=n,p=c.modifiers,l.sort().join(",")===p.sort().join(",")))){var g=!o&&c.combo==a,y=o&&c.seq==o&&c.level==s;(g||y)&&t._callbacks[e].splice(u,1),h.push(c)}return h}function h(e,n,r,i){t.stopCallback(n,n.target||n.srcElement,r,i)||!1===e(n,r)&&(function(e){e.preventDefault?e.preventDefault():e.returnValue=!1}(n),function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}(n))}function g(e){"number"!=typeof e.which&&(e.which=e.keyCode);var n=p(e);n&&("keyup"!=e.type||o!==n?t.handleKey(n,function(e){var t=[];return e.shiftKey&&t.push("shift"),e.altKey&&t.push("alt"),e.ctrlKey&&t.push("ctrl"),e.metaKey&&t.push("meta"),t}(e),e):o=!1)}function v(e,t,n,a){function c(t){return function(){s=t,++i[e],clearTimeout(r),r=setTimeout(u,1e3)}}function l(t){h(n,t,e),"keyup"!==a&&(o=p(t)),setTimeout(u,10)}i[e]=0;for(var f=0;f<t.length;++f){var g=f+1===t.length?l:c(a||d(t[f+1]).action);m(t[f],g,a,e,f)}}function m(e,n,r,i,o){t._directMap[e+":"+r]=n;var a,s=(e=e.replace(/\s+/g," ")).split(" ");s.length>1?v(e,s,n,r):(a=d(e,r),t._callbacks[a.key]=t._callbacks[a.key]||[],c(a.key,a.modifiers,{type:a.action},i,e,o),t._callbacks[a.key][i?"unshift":"push"]({callback:n,modifiers:a.modifiers,action:a.action,seq:i,level:o,combo:e}))}t._handleKey=function(e,t,n){var r,i=c(e,t,n),o={},l=0,p=!1;for(r=0;r<i.length;++r)i[r].seq&&(l=Math.max(l,i[r].level));for(r=0;r<i.length;++r)if(i[r].seq){if(i[r].level!=l)continue;p=!0,o[i[r].seq]=1,h(i[r].callback,n,i[r].combo,i[r].seq)}else p||h(i[r].callback,n,i[r].combo);var d="keypress"==n.type&&a;n.type!=s||f(e)||d||u(o),a=p&&"keydown"==n.type},t._bindMultiple=function(e,t,n){for(var r=0;r<e.length;++r)m(e[r],t,n)},l(e,"keypress",g),l(e,"keydown",g),l(e,"keyup",g)}}("undefined"!=typeof window?window:null,"undefined"!=typeof window?document:null)},{}],94:[function(e,t,n){(function(e){(function(){function n(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function r(e,t){for(var n,r="",i=0,o=-1,a=0,s=0;s<=e.length;++s){if(s<e.length)n=e.charCodeAt(s);else{if(47===n)break;n=47}if(47===n){if(o===s-1||1===a);else if(o!==s-1&&2===a){if(r.length<2||2!==i||46!==r.charCodeAt(r.length-1)||46!==r.charCodeAt(r.length-2))if(r.length>2){var u=r.lastIndexOf("/");if(u!==r.length-1){-1===u?(r="",i=0):i=(r=r.slice(0,u)).length-1-r.lastIndexOf("/"),o=s,a=0;continue}}else if(2===r.length||1===r.length){r="",i=0,o=s,a=0;continue}t&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+e.slice(o+1,s):r=e.slice(o+1,s),i=s-o-1;o=s,a=0}else 46===n&&-1!==a?++a:a=-1}return r}var i={resolve:function(){for(var t,i="",o=!1,a=arguments.length-1;a>=-1&&!o;a--){var s;a>=0?s=arguments[a]:(void 0===t&&(t=e.cwd()),s=t),n(s),0!==s.length&&(i=s+"/"+i,o=47===s.charCodeAt(0))}return i=r(i,!o),o?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(e){if(n(e),0===e.length)return".";var t=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return 0!==(e=r(e,!t)).length||t||(e="."),e.length>0&&i&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return n(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,t=0;t<arguments.length;++t){var r=arguments[t];n(r),r.length>0&&(void 0===e?e=r:e+="/"+r)}return void 0===e?".":i.normalize(e)},relative:function(e,t){if(n(e),n(t),e===t)return"";if((e=i.resolve(e))===(t=i.resolve(t)))return"";for(var r=1;r<e.length&&47===e.charCodeAt(r);++r);for(var o=e.length,a=o-r,s=1;s<t.length&&47===t.charCodeAt(s);++s);for(var u=t.length-s,c=a<u?a:u,l=-1,p=0;p<=c;++p){if(p===c){if(u>c){if(47===t.charCodeAt(s+p))return t.slice(s+p+1);if(0===p)return t.slice(s+p)}else a>c&&(47===e.charCodeAt(r+p)?l=p:0===p&&(l=0));break}var f=e.charCodeAt(r+p);if(f!==t.charCodeAt(s+p))break;47===f&&(l=p)}var h="";for(p=r+l+1;p<=o;++p)p!==o&&47!==e.charCodeAt(p)||(0===h.length?h+="..":h+="/..");return h.length>0?h+t.slice(s+l):(s+=l,47===t.charCodeAt(s)&&++s,t.slice(s))},_makeLong:function(e){return e},dirname:function(e){if(n(e),0===e.length)return".";for(var t=e.charCodeAt(0),r=47===t,i=-1,o=!0,a=e.length-1;a>=1;--a)if(47===(t=e.charCodeAt(a))){if(!o){i=a;break}}else o=!1;return-1===i?r?"/":".":r&&1===i?"//":e.slice(0,i)},basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');n(e);var r,i=0,o=-1,a=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var s=t.length-1,u=-1;for(r=e.length-1;r>=0;--r){var c=e.charCodeAt(r);if(47===c){if(!a){i=r+1;break}}else-1===u&&(a=!1,u=r+1),s>=0&&(c===t.charCodeAt(s)?-1==--s&&(o=r):(s=-1,o=u))}return i===o?o=u:-1===o&&(o=e.length),e.slice(i,o)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!a){i=r+1;break}}else-1===o&&(a=!1,o=r+1);return-1===o?"":e.slice(i,o)},extname:function(e){n(e);for(var t=-1,r=0,i=-1,o=!0,a=0,s=e.length-1;s>=0;--s){var u=e.charCodeAt(s);if(47!==u)-1===i&&(o=!1,i=s+1),46===u?-1===t?t=s:1!==a&&(a=1):-1!==t&&(a=-1);else if(!o){r=s+1;break}}return-1===t||-1===i||0===a||1===a&&t===i-1&&t===r+1?"":e.slice(t,i)},format:function(e){if(null===e||"object"!==_typeof(e))throw new TypeError('The "pathObject" argument must be of type Object. Received type '+_typeof(e));return function(e,t){var n=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+r:n+e+r:r}("/",e)},parse:function(e){n(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var r,i=e.charCodeAt(0),o=47===i;o?(t.root="/",r=1):r=0;for(var a=-1,s=0,u=-1,c=!0,l=e.length-1,p=0;l>=r;--l)if(47!==(i=e.charCodeAt(l)))-1===u&&(c=!1,u=l+1),46===i?-1===a?a=l:1!==p&&(p=1):-1!==a&&(p=-1);else if(!c){s=l+1;break}return-1===a||-1===u||0===p||1===p&&a===u-1&&a===s+1?-1!==u&&(t.base=t.name=0===s&&o?e.slice(1,u):e.slice(s,u)):(0===s&&o?(t.name=e.slice(1,a),t.base=e.slice(1,u)):(t.name=e.slice(s,a),t.base=e.slice(s,u)),t.ext=e.slice(a,u)),s>0?t.dir=e.slice(0,s-1):o&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};i.posix=i,t.exports=i}).call(this)}).call(this,e("_process"))},{_process:98}],95:[function(e,t,n){
|
|
205
|
+
/**
|
|
206
|
+
* Precedent Meta-Templating
|
|
207
|
+
*
|
|
208
|
+
* @license MIT
|
|
209
|
+
*
|
|
210
|
+
* @author Steven Velozo <steven@velozo.com>
|
|
211
|
+
*
|
|
212
|
+
* @description Process text streams, parsing out meta-template expressions.
|
|
213
|
+
*/
|
|
214
|
+
var r=e("./WordTree.js"),i=e("./StringParser.js"),o=function(){function e(){_classCallCheck(this,e),this.WordTree=new r,this.StringParser=new i,this.ParseTree=this.WordTree.ParseTree}return _createClass(e,[{key:"addPattern",value:function(e,t,n){return this.WordTree.addPattern(e,t,n)}},{key:"parseString",value:function(e,t){return this.StringParser.parseString(e,this.ParseTree,t)}}]),e}();t.exports=o},{"./StringParser.js":96,"./WordTree.js":97}],96:[function(e,t,n){
|
|
215
|
+
/**
|
|
216
|
+
* String Parser
|
|
217
|
+
*
|
|
218
|
+
* @license MIT
|
|
219
|
+
*
|
|
220
|
+
* @author Steven Velozo <steven@velozo.com>
|
|
221
|
+
*
|
|
222
|
+
* @description Parse a string, properly processing each matched token in the word tree.
|
|
223
|
+
*/
|
|
224
|
+
var r=function(){function e(){_classCallCheck(this,e)}return _createClass(e,[{key:"newParserState",value:function(e){return{ParseTree:e,Output:"",OutputBuffer:"",Pattern:!1,PatternMatch:!1,PatternMatchOutputBuffer:""}}},{key:"assignNode",value:function(e,t){t.PatternMatch=e,t.PatternMatch.hasOwnProperty("PatternEnd")&&(t.Pattern=t.PatternMatch)}},{key:"appendOutputBuffer",value:function(e,t){t.OutputBuffer+=e}},{key:"flushOutputBuffer",value:function(e){e.Output+=e.OutputBuffer,e.OutputBuffer=""}},{key:"checkPatternEnd",value:function(e,t){e.OutputBuffer.length>=e.Pattern.PatternEnd.length+e.Pattern.PatternStart.length&&e.OutputBuffer.substr(-e.Pattern.PatternEnd.length)===e.Pattern.PatternEnd&&(e.OutputBuffer=e.Pattern.Parse(e.OutputBuffer.substr(e.Pattern.PatternStart.length,e.OutputBuffer.length-(e.Pattern.PatternStart.length+e.Pattern.PatternEnd.length)),t),this.flushOutputBuffer(e),e.Pattern=!1,e.PatternMatch=!1)}},{key:"parseCharacter",value:function(e,t,n){!t.PatternMatch&&t.ParseTree.hasOwnProperty(e)?(this.assignNode(t.ParseTree[e],t),this.appendOutputBuffer(e,t)):t.PatternMatch?(t.PatternMatch.hasOwnProperty(e)&&this.assignNode(t.PatternMatch[e],t),this.appendOutputBuffer(e,t),t.Pattern&&this.checkPatternEnd(t,n)):t.Output+=e}},{key:"parseString",value:function(e,t,n){for(var r=this.newParserState(t),i=0;i<e.length;i++)this.parseCharacter(e[i],r,n);return this.flushOutputBuffer(r),r.Output}}]),e}();t.exports=r},{}],97:[function(e,t,n){
|
|
225
|
+
/**
|
|
226
|
+
* Word Tree
|
|
227
|
+
*
|
|
228
|
+
* @license MIT
|
|
229
|
+
*
|
|
230
|
+
* @author Steven Velozo <steven@velozo.com>
|
|
231
|
+
*
|
|
232
|
+
* @description Create a tree (directed graph) of Javascript objects, one character per object.
|
|
233
|
+
*/
|
|
234
|
+
var r=function(){function e(){_classCallCheck(this,e),this.ParseTree={}}return _createClass(e,[{key:"addChild",value:function(e,t,n){return e.hasOwnProperty(t[n])||(e[t[n]]={}),e[t[n]]}},{key:"addPattern",value:function(e,t,n){if(e.length<1)return!1;if("string"==typeof t&&t.length<1)return!1;for(var r=this.ParseTree,i=0;i<e.length;i++)r=this.addChild(r,e,i);return r.PatternStart=e,r.PatternEnd="string"==typeof t&&t.length>0?t:e,r.Parse="function"==typeof n?n:"string"==typeof n?function(){return n}:function(e){return e},!0}}]),e}();t.exports=r},{}],98:[function(e,t,n){var r,i,o=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function u(e){if(r===setTimeout)return setTimeout(e,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(e){r=a}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(e){i=s}}();var c,l=[],p=!1,f=-1;function h(){p&&c&&(p=!1,c.length?l=c.concat(l):f=-1,l.length&&d())}function d(){if(!p){var e=u(h);p=!0;for(var t=l.length;t;){for(c=l,l=[];++f<t;)c&&c[f].run();f=-1,t=l.length}c=null,p=!1,function(e){if(i===clearTimeout)return clearTimeout(e);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{return i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}(e)}}function g(e,t){this.fun=e,this.array=t}function y(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new g(e,t)),1!==l.length||p||u(d)},g.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],99:[function(e,t,n){(function(t,r){(function(){var i=e("process/browser.js").nextTick,o=Function.prototype.apply,a=Array.prototype.slice,s={},u=0;function c(e,t){this._id=e,this._clearFn=t}n.setTimeout=function(){return new c(o.call(setTimeout,window,arguments),clearTimeout)},n.setInterval=function(){return new c(o.call(setInterval,window,arguments),clearInterval)},n.clearTimeout=n.clearInterval=function(e){e.close()},c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(window,this._id)},n.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},n.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},n._unrefActive=n.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n.setImmediate="function"==typeof t?t:function(e){var t=u++,r=!(arguments.length<2)&&a.call(arguments,1);return s[t]=!0,i((function(){s[t]&&(r?e.apply(null,r):e.call(null),n.clearImmediate(t))})),t},n.clearImmediate="function"==typeof r?r:function(e){delete s[e]}}).call(this)}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":98,timers:99}],100:[function(e,t,n){
|
|
235
|
+
/**
|
|
236
|
+
* Pict browser shim loader
|
|
237
|
+
* @license MIT
|
|
238
|
+
* @author <steven@velozo.com>
|
|
239
|
+
*/
|
|
240
|
+
var r=e("./Pict.js");"object"===("undefined"==typeof window?"undefined":_typeof(window))&&(window.Pict=r),t.exports=r},{"./Pict.js":105}],101:[function(e,t,n){var r=e("fable").ServiceProviderBase,i=e("elucidator"),o=function(e){_inherits(n,e);var t=_createSuper(n);function n(e,r,o){var a;return _classCallCheck(this,n),(a=t.call(this,e,r,o)).serviceType="Solver",a.solver=new i(a.options),a}return _createClass(n)}(r);t.exports=o},{elucidator:31,fable:79}],102:[function(e,t,n){var r=e("fable").ServiceProviderBase,i=e("informary"),o=function(e){_inherits(n,e);var t=_createSuper(n);function n(e,r,o){var a;return _classCallCheck(this,n),(a=t.call(this,e,r,o)).serviceType="Informary",a.informary=new i(a.options.Settings,a.options.Context,a.options.ContextGUID),a}return _createClass(n)}(r);t.exports=o},{fable:79,informary:81}],103:[function(e,t,n){var r=e("fable").ServiceProviderBase,i=e("manyfest"),o=function(e){_inherits(n,e);var t=_createSuper(n);function n(e,r,o){var a;return _classCallCheck(this,n),(a=t.call(this,e,r,o)).serviceType="Manifest","{}"==JSON.stringify(a.options)&&(a.options={Scope:"PictDefault",Descriptors:{}}),a.manyfest=new i(a.options),a.manifest=a.manyfest,a}return _createClass(n)}(r);t.exports=o},{fable:79,manyfest:92}],104:[function(e,t,n){var r=function(e){_inherits(n,e);var t=_createSuper(n);function n(e,r,i){var o;return _classCallCheck(this,n),(o=t.call(this,e,r,i)).serviceType="PictTemplateProvider",o.templates={},o.defaultTemplates={},o.defaultTemplateHashes=[],o.loadTemplateFunction=function(e){return!1},o}return _createClass(n,[{key:"addTemplate",value:function(e,t){this.templates[e]=t}},{key:"addDefaultTemplate",value:function(e,t){"string"!=typeof t&&this.log.error("PictTemplateProvider.addDefaultTemplate: pTemplate is not a string."),this.defaultTemplates[e]=t,this.defaultTemplateHashes=Object.keys(this.defaultTemplates).sort((function(e,t){return t.length-e.length}))}},{key:"checkDefaultTemplateHash",value:function(e){for(var t=e.length,n=0;n<this.defaultTemplateHashes.length;n++)if(e.indexOf(this.defaultTemplateHashes[n])==t-this.defaultTemplateHashes[n].length)return this.templates[e]=this.defaultTemplates[this.defaultTemplateHashes[n]],this.templates[e];return!1}},{key:"getTemplate",value:function(e){return this.templates.hasOwnProperty(e)||this.loadTemplate(e),this.templates.hasOwnProperty(e)||this.checkDefaultTemplateHash(e),!!this.templates.hasOwnProperty(e)&&this.templates[e]}},{key:"loadTemplate",value:function(e){var t=this.loadTemplateFunction(e);return t&&(this.templates[e]=t),t}}]),n}(e("fable").ServiceProviderBase);t.exports=r},{fable:79}],105:[function(e,t,n){
|
|
241
|
+
/**
|
|
242
|
+
* @license MIT
|
|
243
|
+
* @author <steven@velozo.com>
|
|
244
|
+
*/
|
|
245
|
+
var r=e("fable"),i=e("./Pict-Template-Provider.js"),o=e("./Pict-Fable-Service-Manyfest.js"),a=e("./Pict-Fable-Service-Elucidator.js"),s=e("./Pict-Fable-Service-Informary.js"),u=(e("mousetrap"),function(){function e(t){_classCallCheck(this,e),this.fable=new r(t),this.log=this.fable.log,this.settings=this.fable.settings,this.serviceManager=this.fable.serviceManager,this.fable.serviceManager.addServiceType("TemplateProvider",i),this.fable.serviceManager.addServiceType("Manifest",o),this.fable.serviceManager.addServiceType("Solver",a),this.fable.serviceManager.addServiceType("Informary",s),this.templateProvider=this.fable.serviceManager.instantiateServiceProvider("TemplateProvider",{},"defaultTemplateProvider"),this.defaultTemplateProcessor=this.fable.serviceManager.instantiateServiceProvider("MetaTemplate",{},"defaultTemplateProcessor"),this._DefaultTemplateMethodsInitialized=!1,this.manifestServiceProvider=this.fable.serviceManager.instantiateServiceProvider("Manifest",{},"defaultManifest"),this.manifest=this.manifestServiceProvider.manifest,this.appData={}}return _createClass(e,[{key:"initializeTemplateMethods",value:function(e){var t=this;this._DefaultTemplateMethodsInitialized||(this.defaultTemplateProcessor.addPattern("{~Data:","~}",(function(e,n){var r=e.trim(),i=t.manifest.getValueAtAddress({AppData:t.appData,Record:n},r);return null==i||"undefined"==i||void 0===i?"":i})),this.defaultTemplateProcessor.addPattern("{~Dollars:","~}",(function(e,n){var r=e.trim(),i=t.manifest.getValueAtAddress({AppData:t.appData,Record:n},r);return t.fable.DataArithmatic.formatterDollars(i)})),this.defaultTemplateProcessor.addPattern("{~Digits:","~}",(function(e,n){var r=e.trim(),i=t.manifest.getValueAtAddress({AppData:t.appData,Record:n},r);return t.fable.DataArithmatic.formatterAddCommasToNumber(t.fable.DataArithmatic.formatterRoundNumber(i,2))})),this.defaultTemplateProcessor.addPattern("{~NotEmpty:","~}",(function(e,n){var r=e.trim().split("|");if(2!=r.length)return"";var i="";return t.manifest.getValueAtAddress({AppData:t.appData,Record:n},r[0])&&(i=r[1]),i})),this._DefaultTemplateMethodsInitialized=!0)}},{key:"parseTemplate",value:function(e,t){return this.defaultTemplateProcessor.parseString(e,t)}},{key:"parseTemplateByHash",value:function(e,t){var n=this.templateProvider.getTemplate(e);return n?this.parseTemplate(n,t):""}}]),e}());t.exports=u},{"./Pict-Fable-Service-Elucidator.js":101,"./Pict-Fable-Service-Informary.js":102,"./Pict-Fable-Service-Manyfest.js":103,"./Pict-Template-Provider.js":104,fable:79,mousetrap:93}]},{},[100])(100)}));
|
|
246
|
+
//# sourceMappingURL=pict.compatible.min.js.map
|