@schukai/monster 1.14.1 → 1.15.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG +14 -0
- package/README.md +5 -5
- package/dist/modules/constants.js +2 -2
- package/dist/modules/constraints/abstract.js +2 -2
- package/dist/modules/constraints/abstractoperator.js +2 -2
- package/dist/modules/constraints/andoperator.js +2 -2
- package/dist/modules/constraints/invalid.js +2 -2
- package/dist/modules/constraints/isarray.js +2 -2
- package/dist/modules/constraints/isobject.js +2 -2
- package/dist/modules/constraints/namespace.js +1 -1
- package/dist/modules/constraints/oroperator.js +2 -2
- package/dist/modules/constraints/valid.js +2 -2
- package/dist/modules/data/buildmap.js +2 -2
- package/dist/modules/data/diff.js +2 -2
- package/dist/modules/data/extend.js +2 -2
- package/dist/modules/data/namespace.js +1 -1
- package/dist/modules/data/pathfinder.js +2 -2
- package/dist/modules/data/pipe.js +2 -2
- package/dist/modules/data/transformer.js +2 -2
- package/dist/modules/dom/assembler.js +2 -2
- package/dist/modules/dom/attributes.js +2 -2
- package/dist/modules/dom/constants.js +2 -2
- package/dist/modules/dom/customcontrol.js +2 -2
- package/dist/modules/dom/customelement.js +2 -2
- package/dist/modules/dom/events.js +2 -2
- package/dist/modules/dom/locale.js +2 -2
- package/dist/modules/dom/namespace.js +1 -1
- package/dist/modules/dom/template.js +2 -2
- package/dist/modules/dom/theme.js +2 -2
- package/dist/modules/dom/updater.js +2 -2
- package/dist/modules/dom/util.js +2 -2
- package/dist/modules/i18n/locale.js +2 -2
- package/dist/modules/i18n/namespace.js +1 -1
- package/dist/modules/i18n/provider.js +2 -2
- package/dist/modules/i18n/providers/fetch.js +2 -2
- package/dist/modules/i18n/providers/namespace.js +1 -1
- package/dist/modules/i18n/translations.js +2 -2
- package/dist/modules/logging/handler/console.js +2 -2
- package/dist/modules/logging/handler/namespace.js +1 -1
- package/dist/modules/logging/handler.js +2 -2
- package/dist/modules/logging/logentry.js +2 -2
- package/dist/modules/logging/logger.js +2 -2
- package/dist/modules/logging/namespace.js +1 -1
- package/dist/modules/math/namespace.js +1 -1
- package/dist/modules/math/random.js +2 -2
- package/dist/modules/monster.js +1 -1
- package/dist/modules/namespace.js +1 -1
- package/dist/modules/text/formatter.js +2 -2
- package/dist/modules/text/namespace.js +1 -1
- package/dist/modules/types/base.js +2 -2
- package/dist/modules/types/basewithoptions.js +2 -2
- package/dist/modules/types/global.js +2 -2
- package/dist/modules/types/id.js +2 -2
- package/dist/modules/types/is.js +2 -2
- package/dist/modules/types/namespace.js +1 -1
- package/dist/modules/types/observer.js +2 -2
- package/dist/modules/types/observerlist.js +2 -2
- package/dist/modules/types/proxyobserver.js +2 -2
- package/dist/modules/types/queue.js +2 -2
- package/dist/modules/types/randomid.js +2 -2
- package/dist/modules/types/stack.js +2 -2
- package/dist/modules/types/tokenlist.js +2 -2
- package/dist/modules/types/typeof.js +2 -2
- package/dist/modules/types/uniquequeue.js +2 -2
- package/dist/modules/types/validate.js +2 -2
- package/dist/modules/types/version.js +2 -2
- package/dist/modules/util/clone.js +2 -2
- package/dist/modules/util/comparator.js +2 -2
- package/dist/modules/util/freeze.js +2 -2
- package/dist/modules/util/namespace.js +1 -1
- package/dist/monster.dev.js +1096 -844
- package/dist/monster.dev.js.map +1 -1
- package/dist/monster.js +3 -3
- package/package.json +1 -1
- package/source/constants.js +6 -5
- package/source/constraints/abstract.js +2 -2
- package/source/constraints/abstractoperator.js +3 -3
- package/source/constraints/andoperator.js +7 -7
- package/source/constraints/invalid.js +6 -6
- package/source/constraints/isarray.js +6 -6
- package/source/constraints/isobject.js +6 -6
- package/source/constraints/oroperator.js +8 -8
- package/source/constraints/valid.js +6 -6
- package/source/data/buildmap.js +15 -15
- package/source/data/diff.js +6 -6
- package/source/data/extend.js +55 -13
- package/source/data/pathfinder.js +6 -7
- package/source/data/pipe.js +5 -5
- package/source/data/transformer.js +5 -6
- package/source/dom/assembler.js +5 -5
- package/source/dom/attributes.js +26 -26
- package/source/dom/constants.js +1 -2
- package/source/dom/customcontrol.js +14 -50
- package/source/dom/customelement.js +125 -28
- package/source/dom/events.js +7 -7
- package/source/dom/locale.js +5 -5
- package/source/dom/template.js +7 -7
- package/source/dom/theme.js +6 -6
- package/source/dom/updater.js +35 -13
- package/source/dom/util.js +9 -9
- package/source/i18n/locale.js +7 -7
- package/source/i18n/provider.js +5 -5
- package/source/i18n/providers/fetch.js +10 -10
- package/source/i18n/translations.js +5 -5
- package/source/logging/handler/console.js +4 -4
- package/source/logging/handler.js +4 -4
- package/source/logging/logentry.js +4 -4
- package/source/logging/logger.js +4 -4
- package/source/math/random.js +5 -5
- package/source/namespace.js +1 -1
- package/source/text/formatter.js +4 -5
- package/source/types/base.js +4 -5
- package/source/types/basewithoptions.js +9 -8
- package/source/types/global.js +6 -6
- package/source/types/id.js +6 -6
- package/source/types/is.js +22 -22
- package/source/types/observer.js +5 -5
- package/source/types/observerlist.js +4 -4
- package/source/types/proxyobserver.js +32 -26
- package/source/types/queue.js +13 -7
- package/source/types/randomid.js +5 -5
- package/source/types/stack.js +11 -4
- package/source/types/tokenlist.js +4 -4
- package/source/types/typeof.js +5 -5
- package/source/types/uniquequeue.js +11 -4
- package/source/types/validate.js +22 -22
- package/source/types/version.js +9 -9
- package/source/util/clone.js +4 -4
- package/source/util/comparator.js +6 -6
- package/source/util/freeze.js +4 -4
- package/test/cases/data/extend.js +66 -13
- package/test/cases/dom/customcontrol.js +16 -2
- package/test/cases/dom/customelement.js +64 -6
- package/test/cases/monster.js +1 -1
- package/test/cases/types/proxyobserver.js +9 -0
- package/test/web/monster-dev.html +3 -3
- package/test/web/monster.html +2 -2
- package/test/web/test.html +3 -3
- package/test/web/tests.js +3 -3
package/dist/monster.js
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
/** Monster 1.
|
2
|
-
!function webpackUniversalModuleDefinition(root,factory){"object"==typeof exports&&"object"==typeof module?module.exports=factory():"function"==typeof define&&define.amd?define([],factory):"object"==typeof exports?exports.window=factory():root.window=factory()}(self,(function(){return function(){var __webpack_require__={d:function(exports,definition){for(var key in definition)__webpack_require__.o(definition,key)&&!__webpack_require__.o(exports,key)&&Object.defineProperty(exports,key,{enumerable:!0,get:definition[key]})},o:function(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)},r:function(exports){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(exports,"__esModule",{value:!0})}},__webpack_exports__={};function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Monster:function(){return Monster}});var Namespace=function(){function Namespace(namespace){if(function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Namespace),void 0===namespace||"string"!=typeof namespace)throw new Error("namespace is not a string");this.namespace=namespace}return function _createClass(Constructor,protoProps,staticProps){return protoProps&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Constructor}(Namespace,[{key:"getNamespace",value:function getNamespace(){return this.namespace}},{key:"toString",value:function toString(){return this.getNamespace()}}]),Namespace}(),Monster=new Namespace("Monster");function assignToNamespace(ns){var current=namespaceFor(ns.split("."));if(0==(arguments.length<=1?0:arguments.length-1))throw new Error("no functions have been passed.");for(var i=0,l=arguments.length<=1?0:arguments.length-1;i<l;i++)current[objectName(i+1<1||arguments.length<=i+1?void 0:arguments[i+1])]=i+1<1||arguments.length<=i+1?void 0:arguments[i+1];return current}function objectName(fn){try{if("function"!=typeof fn)throw new Error("the first argument is not a function or class.");if(fn.hasOwnProperty("name"))return fn.name;if("function"==typeof fn.toString){var s=fn.toString(),f=s.match(/^\s*function\s+([^\s(]+)/);if(Array.isArray(f)&&"string"==typeof f[1])return f[1];var c=s.match(/^\s*class\s+([^\s(]+)/);if(Array.isArray(c)&&"string"==typeof c[1])return c[1]}}catch(e){throw new Error("exception "+e)}throw new Error("the name of the class or function cannot be resolved.")}function namespaceFor(parts){for(var space=Monster,ns="Monster",i=0;i<parts.length;i++)"Monster"!==parts[i]&&(ns+="."+parts[i],space.hasOwnProperty(parts[i])||(space[parts[i]]=new Namespace(ns)),space=space[parts[i]]);return space}function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function base_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function base_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _possibleConstructorReturn(self,call){if(call&&("object"===_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function _wrapNativeSuper(Class){var _cache="function"==typeof Map?new Map:void 0;return(_wrapNativeSuper=function _wrapNativeSuper(Class){if(null===Class||!function _isNativeFunction(fn){return-1!==Function.toString.call(fn).indexOf("[native code]")}(Class))return Class;if("function"!=typeof Class)throw new TypeError("Super expression must either be null or a function");if(void 0!==_cache){if(_cache.has(Class))return _cache.get(Class);_cache.set(Class,Wrapper)}function Wrapper(){return _construct(Class,arguments,_getPrototypeOf(this).constructor)}return Wrapper.prototype=Object.create(Class.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(Wrapper,Class)})(Class)}function _construct(Parent,args,Class){return(_construct=_isNativeReflectConstruct()?Reflect.construct:function _construct(Parent,args,Class){var a=[null];a.push.apply(a,args);var instance=new(Function.bind.apply(Parent,a));return Class&&_setPrototypeOf(instance,Class.prototype),instance}).apply(null,arguments)}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 _setPrototypeOf(o,p){return(_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function _getPrototypeOf(o){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster",assignToNamespace);var Base=function(_Object){!function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_setPrototypeOf(subClass,superClass)}(Base,_Object);var _super=function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var result,Super=_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return _possibleConstructorReturn(this,result)}}(Base);function Base(){return base_classCallCheck(this,Base),_super.apply(this,arguments)}return function base_createClass(Constructor,protoProps,staticProps){return protoProps&&base_defineProperties(Constructor.prototype,protoProps),staticProps&&base_defineProperties(Constructor,staticProps),Constructor}(Base,[{key:"toString",value:function toString(){return JSON.stringify(this)}}]),Base}(_wrapNativeSuper(Object));function abstract_typeof(obj){return(abstract_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function abstract_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function abstract_setPrototypeOf(o,p){return(abstract_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function abstract_createSuper(Derived){var hasNativeReflectConstruct=function abstract_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}}();return function _createSuperInternal(){var result,Super=abstract_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=abstract_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return abstract_possibleConstructorReturn(this,result)}}function abstract_possibleConstructorReturn(self,call){if(call&&("object"===abstract_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function abstract_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function abstract_getPrototypeOf(o){return(abstract_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}Monster.assignToNamespace("Monster.Types",Base);var AbstractConstraint=function(_Base){!function abstract_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&abstract_setPrototypeOf(subClass,superClass)}(AbstractConstraint,_Base);var _super=abstract_createSuper(AbstractConstraint);function AbstractConstraint(){return function abstract_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,AbstractConstraint),_super.call(this)}return function abstract_createClass(Constructor,protoProps,staticProps){return protoProps&&abstract_defineProperties(Constructor.prototype,protoProps),staticProps&&abstract_defineProperties(Constructor,staticProps),Constructor}(AbstractConstraint,[{key:"isValid",value:function isValid(value){return Promise.reject(value)}}]),AbstractConstraint}(Base);function is_typeof(obj){return(is_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function isIterable(value){return void 0!==value&&(null!==value&&"function"==typeof(null==value?void 0:value[Symbol.iterator]))}function isPrimitive(value){var type;return null==value||NaN===value||("string"===(type=is_typeof(value))||"number"===type||"boolean"===type||"symbol"===type)}function isSymbol(value){return"symbol"===is_typeof(value)}function isBoolean(value){return!0===value||!1===value}function isString(value){return void 0!==value&&"string"==typeof value}function isObject(value){return!isArray(value)&&(!isPrimitive(value)&&"object"===is_typeof(value))}function isInstance(value,instance){return!!isObject(value)&&(!!isFunction(instance)&&(!!instance.hasOwnProperty("prototype")&&value instanceof instance))}function isArray(value){return!!Array.isArray(value)}function isFunction(value){return!isArray(value)&&(!isPrimitive(value)&&"function"==typeof value)}function isInteger(value){return Number.isInteger(value)}function isobject_typeof(obj){return(isobject_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function isobject_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function isobject_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function isobject_setPrototypeOf(o,p){return(isobject_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function isobject_createSuper(Derived){var hasNativeReflectConstruct=function isobject_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}}();return function _createSuperInternal(){var result,Super=isobject_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=isobject_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return isobject_possibleConstructorReturn(this,result)}}function isobject_possibleConstructorReturn(self,call){if(call&&("object"===isobject_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function isobject_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function isobject_getPrototypeOf(o){return(isobject_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}Monster.assignToNamespace("Monster.Constraints",AbstractConstraint),Monster.assignToNamespace("Monster.Types",isPrimitive,isBoolean,isString,isObject,isArray,isFunction,isIterable,isInteger,isSymbol);var IsObject=function(_AbstractConstraint){!function isobject_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&isobject_setPrototypeOf(subClass,superClass)}(IsObject,_AbstractConstraint);var _super=isobject_createSuper(IsObject);function IsObject(){return isobject_classCallCheck(this,IsObject),_super.apply(this,arguments)}return function isobject_createClass(Constructor,protoProps,staticProps){return protoProps&&isobject_defineProperties(Constructor.prototype,protoProps),staticProps&&isobject_defineProperties(Constructor,staticProps),Constructor}(IsObject,[{key:"isValid",value:function isValid(value){return isObject(value)?Promise.resolve(value):Promise.reject(value)}}]),IsObject}(AbstractConstraint);function valid_typeof(obj){return(valid_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function valid_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function valid_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function valid_setPrototypeOf(o,p){return(valid_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function valid_createSuper(Derived){var hasNativeReflectConstruct=function valid_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}}();return function _createSuperInternal(){var result,Super=valid_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=valid_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return valid_possibleConstructorReturn(this,result)}}function valid_possibleConstructorReturn(self,call){if(call&&("object"===valid_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function valid_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function valid_getPrototypeOf(o){return(valid_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}Monster.assignToNamespace("Monster.Constraints",IsObject);var Valid=function(_AbstractConstraint){!function valid_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&valid_setPrototypeOf(subClass,superClass)}(Valid,_AbstractConstraint);var _super=valid_createSuper(Valid);function Valid(){return valid_classCallCheck(this,Valid),_super.apply(this,arguments)}return function valid_createClass(Constructor,protoProps,staticProps){return protoProps&&valid_defineProperties(Constructor.prototype,protoProps),staticProps&&valid_defineProperties(Constructor,staticProps),Constructor}(Valid,[{key:"isValid",value:function isValid(value){return Promise.resolve(value)}}]),Valid}(AbstractConstraint);function invalid_typeof(obj){return(invalid_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function invalid_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function invalid_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function invalid_setPrototypeOf(o,p){return(invalid_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function invalid_createSuper(Derived){var hasNativeReflectConstruct=function invalid_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}}();return function _createSuperInternal(){var result,Super=invalid_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=invalid_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return invalid_possibleConstructorReturn(this,result)}}function invalid_possibleConstructorReturn(self,call){if(call&&("object"===invalid_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function invalid_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function invalid_getPrototypeOf(o){return(invalid_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}Monster.assignToNamespace("Monster.Constraints",Valid);var Invalid=function(_AbstractConstraint){!function invalid_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&invalid_setPrototypeOf(subClass,superClass)}(Invalid,_AbstractConstraint);var _super=invalid_createSuper(Invalid);function Invalid(){return invalid_classCallCheck(this,Invalid),_super.apply(this,arguments)}return function invalid_createClass(Constructor,protoProps,staticProps){return protoProps&&invalid_defineProperties(Constructor.prototype,protoProps),staticProps&&invalid_defineProperties(Constructor,staticProps),Constructor}(Invalid,[{key:"isValid",value:function isValid(value){return Promise.reject(value)}}]),Invalid}(AbstractConstraint);function abstractoperator_typeof(obj){return(abstractoperator_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function abstractoperator_setPrototypeOf(o,p){return(abstractoperator_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function abstractoperator_createSuper(Derived){var hasNativeReflectConstruct=function abstractoperator_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}}();return function _createSuperInternal(){var result,Super=abstractoperator_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=abstractoperator_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return abstractoperator_possibleConstructorReturn(this,result)}}function abstractoperator_possibleConstructorReturn(self,call){if(call&&("object"===abstractoperator_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function abstractoperator_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function abstractoperator_getPrototypeOf(o){return(abstractoperator_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}Monster.assignToNamespace("Monster.Constraints",Invalid);var AbstractOperator=function(_AbstractConstraint){!function abstractoperator_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&abstractoperator_setPrototypeOf(subClass,superClass)}(AbstractOperator,_AbstractConstraint);var _super=abstractoperator_createSuper(AbstractOperator);function AbstractOperator(operantA,operantB){var _this;if(function abstractoperator_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,AbstractOperator),_this=_super.call(this),!(operantA instanceof AbstractConstraint&&operantB instanceof AbstractConstraint))throw new TypeError("parameters must be from type AbstractConstraint");return _this.operantA=operantA,_this.operantB=operantB,_this}return AbstractOperator}(AbstractConstraint);function oroperator_typeof(obj){return(oroperator_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function oroperator_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function oroperator_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function oroperator_setPrototypeOf(o,p){return(oroperator_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function oroperator_createSuper(Derived){var hasNativeReflectConstruct=function oroperator_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}}();return function _createSuperInternal(){var result,Super=oroperator_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=oroperator_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return oroperator_possibleConstructorReturn(this,result)}}function oroperator_possibleConstructorReturn(self,call){if(call&&("object"===oroperator_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function oroperator_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function oroperator_getPrototypeOf(o){return(oroperator_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}Monster.assignToNamespace("Monster.Constraints",AbstractOperator);var OrOperator=function(_AbstractOperator){!function oroperator_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&oroperator_setPrototypeOf(subClass,superClass)}(OrOperator,_AbstractOperator);var _super=oroperator_createSuper(OrOperator);function OrOperator(){return oroperator_classCallCheck(this,OrOperator),_super.apply(this,arguments)}return function oroperator_createClass(Constructor,protoProps,staticProps){return protoProps&&oroperator_defineProperties(Constructor.prototype,protoProps),staticProps&&oroperator_defineProperties(Constructor,staticProps),Constructor}(OrOperator,[{key:"isValid",value:function isValid(value){var self=this;return new Promise((function(resolve,reject){var a,b;self.operantA.isValid(value).then((function(){resolve()})).catch((function(){a=!1,!1===b&&reject()})),self.operantB.isValid(value).then((function(){resolve()})).catch((function(){b=!1,!1===a&&reject()}))}))}}]),OrOperator}(AbstractOperator);function andoperator_typeof(obj){return(andoperator_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function andoperator_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function andoperator_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function andoperator_setPrototypeOf(o,p){return(andoperator_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function andoperator_createSuper(Derived){var hasNativeReflectConstruct=function andoperator_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}}();return function _createSuperInternal(){var result,Super=andoperator_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=andoperator_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return andoperator_possibleConstructorReturn(this,result)}}function andoperator_possibleConstructorReturn(self,call){if(call&&("object"===andoperator_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function andoperator_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function andoperator_getPrototypeOf(o){return(andoperator_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}Monster.assignToNamespace("Monster.Constraints",OrOperator);var AndOperator=function(_AbstractOperator){!function andoperator_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&andoperator_setPrototypeOf(subClass,superClass)}(AndOperator,_AbstractOperator);var _super=andoperator_createSuper(AndOperator);function AndOperator(){return andoperator_classCallCheck(this,AndOperator),_super.apply(this,arguments)}return function andoperator_createClass(Constructor,protoProps,staticProps){return protoProps&&andoperator_defineProperties(Constructor.prototype,protoProps),staticProps&&andoperator_defineProperties(Constructor,staticProps),Constructor}(AndOperator,[{key:"isValid",value:function isValid(value){return Promise.all([this.operantA.isValid(value),this.operantB.isValid(value)])}}]),AndOperator}(AbstractOperator);function isarray_typeof(obj){return(isarray_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function isarray_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function isarray_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function isarray_setPrototypeOf(o,p){return(isarray_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function isarray_createSuper(Derived){var hasNativeReflectConstruct=function isarray_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}}();return function _createSuperInternal(){var result,Super=isarray_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=isarray_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return isarray_possibleConstructorReturn(this,result)}}function isarray_possibleConstructorReturn(self,call){if(call&&("object"===isarray_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function isarray_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function isarray_getPrototypeOf(o){return(isarray_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}Monster.assignToNamespace("Monster.Constraints",AndOperator);var IsArray=function(_AbstractConstraint){!function isarray_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&isarray_setPrototypeOf(subClass,superClass)}(IsArray,_AbstractConstraint);var _super=isarray_createSuper(IsArray);function IsArray(){return isarray_classCallCheck(this,IsArray),_super.apply(this,arguments)}return function isarray_createClass(Constructor,protoProps,staticProps){return protoProps&&isarray_defineProperties(Constructor.prototype,protoProps),staticProps&&isarray_defineProperties(Constructor,staticProps),Constructor}(IsArray,[{key:"isValid",value:function isValid(value){return isArray(value)?Promise.resolve(value):Promise.reject(value)}}]),IsArray}(AbstractConstraint);function validatePrimitive(value){if(!isPrimitive(value))throw new TypeError("value is not a primitive");return value}function validateString(value){if(!isString(value))throw new TypeError("value is not a string");return value}function validateObject(value){if(!isObject(value))throw new TypeError("value is not a object");return value}function validateInstance(value,instance){if(!isInstance(value,instance)){var n="";throw(isObject(instance)||isFunction(instance))&&(n=null==instance?void 0:instance.name),n&&(n=" "+n),new TypeError("value is not an instance of"+n)}return value}function validateArray(value){if(!isArray(value))throw new TypeError("value is not an array");return value}function validateSymbol(value){if(!isSymbol(value))throw new TypeError("value is not an symbol");return value}function validateFunction(value){if(!isFunction(value))throw new TypeError("value is not a function");return value}function validateInteger(value){if(!isInteger(value))throw new TypeError("value is not an integer");return value}function logentry_typeof(obj){return(logentry_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function logentry_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function logentry_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function logentry_setPrototypeOf(o,p){return(logentry_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function logentry_createSuper(Derived){var hasNativeReflectConstruct=function logentry_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}}();return function _createSuperInternal(){var result,Super=logentry_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=logentry_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return logentry_possibleConstructorReturn(this,result)}}function logentry_possibleConstructorReturn(self,call){if(call&&("object"===logentry_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function logentry_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function logentry_getPrototypeOf(o){return(logentry_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}Monster.assignToNamespace("Monster.Constraints",IsArray),Monster.assignToNamespace("Monster.Types",validatePrimitive,(function validateBoolean(value){if(!isBoolean(value))throw new TypeError("value is not a boolean");return value}),validateString,validateObject,validateArray,validateFunction,(function validateIterable(value){if(!isIterable(value))throw new TypeError("value is not iterable");return value}),validateInteger);var LogEntry=function(_Base){!function logentry_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&logentry_setPrototypeOf(subClass,superClass)}(LogEntry,_Base);var _super=logentry_createSuper(LogEntry);function LogEntry(loglevel){var _this;logentry_classCallCheck(this,LogEntry),_this=_super.call(this),validateInteger(loglevel),_this.loglevel=loglevel;for(var _len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)args[_key-1]=arguments[_key];return _this.arguments=args,_this}return function logentry_createClass(Constructor,protoProps,staticProps){return protoProps&&logentry_defineProperties(Constructor.prototype,protoProps),staticProps&&logentry_defineProperties(Constructor,staticProps),Constructor}(LogEntry,[{key:"getLogLevel",value:function getLogLevel(){return this.loglevel}},{key:"getArguments",value:function getArguments(){return this.arguments}}]),LogEntry}(Base);function handler_typeof(obj){return(handler_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function handler_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function handler_setPrototypeOf(o,p){return(handler_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function handler_createSuper(Derived){var hasNativeReflectConstruct=function handler_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}}();return function _createSuperInternal(){var result,Super=handler_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=handler_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return handler_possibleConstructorReturn(this,result)}}function handler_possibleConstructorReturn(self,call){if(call&&("object"===handler_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function handler_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function handler_getPrototypeOf(o){return(handler_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}Monster.assignToNamespace("Monster.Logging",LogEntry);var Handler=function(_Base){!function handler_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&handler_setPrototypeOf(subClass,superClass)}(Handler,_Base);var _super=handler_createSuper(Handler);function Handler(){var _this;return function handler_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Handler),(_this=_super.call(this)).loglevel=OFF,_this}return function handler_createClass(Constructor,protoProps,staticProps){return protoProps&&handler_defineProperties(Constructor.prototype,protoProps),staticProps&&handler_defineProperties(Constructor,staticProps),Constructor}(Handler,[{key:"log",value:function log(entry){return validateInstance(entry,LogEntry),!(this.loglevel<entry.getLogLevel())}},{key:"setLogLevel",value:function setLogLevel(loglevel){return validateInteger(loglevel),this.loglevel=loglevel,this}},{key:"getLogLevel",value:function getLogLevel(){return this.loglevel}},{key:"setAll",value:function setAll(){return this.setLogLevel(ALL),this}},{key:"setTrace",value:function setTrace(){return this.setLogLevel(TRACE),this}},{key:"setDebug",value:function setDebug(){return this.setLogLevel(DEBUG),this}},{key:"setInfo",value:function setInfo(){return this.setLogLevel(INFO),this}},{key:"setWarn",value:function setWarn(){return this.setLogLevel(WARN),this}},{key:"setError",value:function setError(){return this.setLogLevel(ERROR),this}},{key:"setFatal",value:function setFatal(){return this.setLogLevel(FATAL),this}},{key:"setOff",value:function setOff(){return this.setLogLevel(OFF),this}}]),Handler}(Base);function logger_typeof(obj){return(logger_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function _createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function _unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function logger_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function logger_setPrototypeOf(o,p){return(logger_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function logger_createSuper(Derived){var hasNativeReflectConstruct=function logger_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}}();return function _createSuperInternal(){var result,Super=logger_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=logger_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return logger_possibleConstructorReturn(this,result)}}function logger_possibleConstructorReturn(self,call){if(call&&("object"===logger_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function logger_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function logger_getPrototypeOf(o){return(logger_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}Monster.assignToNamespace("Monster.Logging",Handler);var ALL=255,TRACE=64,DEBUG=32,INFO=16,WARN=8,ERROR=4,FATAL=2,OFF=0,Logger=function(_Base){!function logger_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&logger_setPrototypeOf(subClass,superClass)}(Logger,_Base);var _super=logger_createSuper(Logger);function Logger(){var _this;return function logger_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Logger),(_this=_super.call(this)).handler=new Set,_this}return function logger_createClass(Constructor,protoProps,staticProps){return protoProps&&logger_defineProperties(Constructor.prototype,protoProps),staticProps&&logger_defineProperties(Constructor,staticProps),Constructor}(Logger,[{key:"addHandler",value:function addHandler(handler){if(validateObject(handler),!(handler instanceof Handler))throw new Error("the handler must be an instance of Handler");return this.handler.add(handler),this}},{key:"removeHandler",value:function removeHandler(handler){if(validateObject(handler),!(handler instanceof Handler))throw new Error("the handler must be an instance of Handler");return this.handler.delete(handler),this}},{key:"logTrace",value:function logTrace(){return triggerLog.apply(this,[TRACE].concat(Array.prototype.slice.call(arguments))),this}},{key:"logDebug",value:function logDebug(){return triggerLog.apply(this,[DEBUG].concat(Array.prototype.slice.call(arguments))),this}},{key:"logInfo",value:function logInfo(){return triggerLog.apply(this,[INFO].concat(Array.prototype.slice.call(arguments))),this}},{key:"logWarn",value:function logWarn(){return triggerLog.apply(this,[WARN].concat(Array.prototype.slice.call(arguments))),this}},{key:"logError",value:function logError(){return triggerLog.apply(this,[ERROR].concat(Array.prototype.slice.call(arguments))),this}},{key:"logFatal",value:function logFatal(){return triggerLog.apply(this,[FATAL].concat(Array.prototype.slice.call(arguments))),this}},{key:"getLabel",value:function getLabel(level){return validateInteger(level),level===ALL?"ALL":level===TRACE?"TRACE":level===DEBUG?"DEBUG":level===INFO?"INFO":level===WARN?"WARN":level===ERROR?"ERROR":level===FATAL?"FATAL":level===OFF?"OFF":"unknown"}},{key:"getLevel",value:function getLevel(label){return validateString(label),"ALL"===label?ALL:"TRACE"===label?TRACE:"DEBUG"===label?DEBUG:"INFO"===label?INFO:"WARN"===label?WARN:"ERROR"===label?ERROR:"FATAL"===label?FATAL:"OFF"===label?OFF:0}}]),Logger}(Base);function triggerLog(loglevel){for(var logger=this,_len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)args[_key-1]=arguments[_key];var _step,_iterator=_createForOfIteratorHelper(logger.handler);try{for(_iterator.s();!(_step=_iterator.n()).done;){var handler=_step.value;handler.log(new LogEntry(loglevel,args))}}catch(err){_iterator.e(err)}finally{_iterator.f()}return logger}function console_typeof(obj){return(console_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function console_setPrototypeOf(o,p){return(console_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function console_createSuper(Derived){var hasNativeReflectConstruct=function console_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}}();return function _createSuperInternal(){var result,Super=console_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=console_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return console_possibleConstructorReturn(this,result)}}function console_possibleConstructorReturn(self,call){if(call&&("object"===console_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function console_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function console_getPrototypeOf(o){return(console_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}Monster.assignToNamespace("Monster.Logging",Logger);var globalReference,ConsoleHandler=function(_Base){!function console_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&console_setPrototypeOf(subClass,superClass)}(ConsoleHandler,_Base);var _super=console_createSuper(ConsoleHandler);function ConsoleHandler(){return function console_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ConsoleHandler),_super.call(this)}return ConsoleHandler}(Base);function global_typeof(obj){return(global_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function getGlobal(){return globalReference}function getGlobalObject(name){var _globalReference;validateString(name);var o=null===(_globalReference=globalReference)||void 0===_globalReference?void 0:_globalReference[name];if(void 0===o)throw new Error("the object "+name+" is not defined");return validateObject(o),o}function getGlobalFunction(name){var _globalReference2;validateString(name);var f=null===(_globalReference2=globalReference)||void 0===_globalReference2?void 0:_globalReference2[name];if(void 0===f)throw new Error("the function "+name+" is not defined");return validateFunction(f),f}function id_typeof(obj){return(id_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function id_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function id_setPrototypeOf(o,p){return(id_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function id_createSuper(Derived){var hasNativeReflectConstruct=function id_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}}();return function _createSuperInternal(){var result,Super=id_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=id_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return id_possibleConstructorReturn(this,result)}}function id_possibleConstructorReturn(self,call){if(call&&("object"===id_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function id_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function id_getPrototypeOf(o){return(id_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}Monster.assignToNamespace("Monster.Logging",ConsoleHandler),function(){if("object"!==("undefined"==typeof globalThis?"undefined":global_typeof(globalThis)))if("undefined"==typeof self){if("undefined"==typeof window){if(Object.defineProperty(Object.prototype,"__monster__",{get:function get(){return this},configurable:!0}),"object"===("undefined"==typeof __monster__?"undefined":global_typeof(__monster__)))return __monster__.globalThis=__monster__,delete Object.prototype.__monster__,void(globalReference=globalThis);try{globalReference=Function("return this")()}catch(e){}throw new Error("unsupported environment.")}globalReference=window}else globalReference=self;else globalReference=globalThis}(),Monster.assignToNamespace("Monster.Types",getGlobal,getGlobalObject,getGlobalFunction);var internalCounter=new Map,ID=function(_Base){!function id_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&id_setPrototypeOf(subClass,superClass)}(ID,_Base);var _super=id_createSuper(ID);function ID(prefix){var _this;!function id_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ID),_this=_super.call(this),void 0===prefix&&(prefix="id"),validateString(prefix),internalCounter.has(prefix)||internalCounter.set(prefix,1);var count=internalCounter.get(prefix);return _this.id=prefix+count,internalCounter.set(prefix,++count),_this}return function id_createClass(Constructor,protoProps,staticProps){return protoProps&&id_defineProperties(Constructor.prototype,protoProps),staticProps&&id_defineProperties(Constructor,staticProps),Constructor}(ID,[{key:"toString",value:function toString(){return this.id}}]),ID}(Base);function clone_typeof(obj){return(clone_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function clone(obj){if(null===obj)return obj;if(isPrimitive(obj))return obj;if(isFunction(obj))return obj;if(isArray(obj)){for(var copy=[],i=0,len=obj.length;i<len;i++)copy[i]=clone(obj[i]);return copy}if(isObject(obj)){if(obj instanceof Date){var _copy=new Date;return _copy.setTime(obj.getTime()),_copy}if("undefined"!=typeof Element&&obj instanceof Element)return obj;if("undefined"!=typeof HTMLDocument&&obj instanceof HTMLDocument)return obj;if("undefined"!=typeof DocumentFragment&&obj instanceof DocumentFragment)return obj;if(obj===getGlobal())return obj;if("undefined"!=typeof globalContext&&obj===globalContext)return obj;if("undefined"!=typeof window&&obj===window)return obj;if("undefined"!=typeof document&&obj===document)return obj;if("undefined"!=typeof navigator&&obj===navigator)return obj;if("undefined"!=typeof JSON&&obj===JSON)return obj;try{if(obj instanceof Proxy)return obj}catch(e){}return function cloneObject(obj){var copy;if(clone_typeof(obj.hasOwnProperty("getClone"))&&"function"===obj.getClone)return obj.getClone();copy={},"function"==typeof obj.constructor&&"function"==typeof obj.constructor.call&&(copy=new obj.constructor);for(var key in obj)obj.hasOwnProperty(key)&&(Monster.Types.isPrimitive(obj[key])?copy[key]=obj[key]:copy[key]=clone(obj[key]));return copy}(obj)}throw new Error("unable to clone obj! its type isn't supported.")}function stack_typeof(obj){return(stack_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function stack_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function stack_setPrototypeOf(o,p){return(stack_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function stack_createSuper(Derived){var hasNativeReflectConstruct=function stack_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}}();return function _createSuperInternal(){var result,Super=stack_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=stack_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return stack_possibleConstructorReturn(this,result)}}function stack_possibleConstructorReturn(self,call){if(call&&("object"===stack_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function stack_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function stack_getPrototypeOf(o){return(stack_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}Monster.assignToNamespace("Monster.Types",ID),Monster.assignToNamespace("Monster.Util",clone);var Stack=function(_Base){!function stack_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&stack_setPrototypeOf(subClass,superClass)}(Stack,_Base);var _super=stack_createSuper(Stack);function Stack(){var _this;return function stack_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Stack),(_this=_super.call(this)).data=[],_this}return function stack_createClass(Constructor,protoProps,staticProps){return protoProps&&stack_defineProperties(Constructor.prototype,protoProps),staticProps&&stack_defineProperties(Constructor,staticProps),Constructor}(Stack,[{key:"isEmpty",value:function isEmpty(){return 0===this.data.length}},{key:"peek",value:function peek(){var _this$data;if(!this.isEmpty())return null===(_this$data=this.data)||void 0===_this$data?void 0:_this$data[this.data.length-1]}},{key:"push",value:function push(value){return this.data.push(value),this}},{key:"clear",value:function clear(){return this.data=[],this}},{key:"pop",value:function pop(){if(!this.isEmpty())return this.data.pop()}}]),Stack}(Base);function pathfinder_typeof(obj){return(pathfinder_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function _toConsumableArray(arr){return function _arrayWithoutHoles(arr){if(Array.isArray(arr))return pathfinder_arrayLikeToArray(arr)}(arr)||function _iterableToArray(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}(arr)||pathfinder_unsupportedIterableToArray(arr)||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 _slicedToArray(arr,i){return function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function _iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||pathfinder_unsupportedIterableToArray(arr,i)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pathfinder_unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return pathfinder_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pathfinder_arrayLikeToArray(o,minLen):void 0}}function pathfinder_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function pathfinder_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function pathfinder_setPrototypeOf(o,p){return(pathfinder_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function pathfinder_createSuper(Derived){var hasNativeReflectConstruct=function pathfinder_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}}();return function _createSuperInternal(){var result,Super=pathfinder_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=pathfinder_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return pathfinder_possibleConstructorReturn(this,result)}}function pathfinder_possibleConstructorReturn(self,call){if(call&&("object"===pathfinder_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function pathfinder_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function pathfinder_getPrototypeOf(o){return(pathfinder_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}Monster.assignToNamespace("Monster.Types",Stack);var Pathfinder=function(_Base){!function pathfinder_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&pathfinder_setPrototypeOf(subClass,superClass)}(Pathfinder,_Base);var _super=pathfinder_createSuper(Pathfinder);function Pathfinder(object){var _this;return function pathfinder_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Pathfinder),(_this=_super.call(this)).object=object,_this.wildCard="*",_this}return function pathfinder_createClass(Constructor,protoProps,staticProps){return protoProps&&pathfinder_defineProperties(Constructor.prototype,protoProps),staticProps&&pathfinder_defineProperties(Constructor,staticProps),Constructor}(Pathfinder,[{key:"setWildCard",value:function setWildCard(wildcard){return validateString(wildcard),this.wildCard=wildcard,this}},{key:"getVia",value:function getVia(path){return getValueViaPath.call(this,this.object,validateString(path))}},{key:"setVia",value:function setVia(path,value){return validateString(path),setValueViaPath.call(this,this.object,path,value),this}},{key:"deleteVia",value:function deleteVia(path){return validateString(path),deleteValueViaPath.call(this,this.object,path),this}},{key:"exists",value:function exists(path){validateString(path);try{return getValueViaPath.call(this,this.object,path,!0),!0}catch(e){}return!1}}]),Pathfinder}(Base);function iterate(subject,path,check){var result=new Map;if(isObject(subject)||isArray(subject))for(var _i=0,_Object$entries=Object.entries(subject);_i<_Object$entries.length;_i++){var _Object$entries$_i=_slicedToArray(_Object$entries[_i],2),key=_Object$entries$_i[0],value=_Object$entries$_i[1];result.set(key,getValueViaPath.call(this,value,path,check))}else{var _key=path.split(".").shift();result.set(_key,getValueViaPath.call(this,subject,path,check))}return result}function getValueViaPath(subject,path,check){if(""===path)return subject;var parts=path.split("."),current=parts.shift();if(current===this.wildCard)return iterate.call(this,subject,parts.join("."),check);if(isObject(subject)||isArray(subject)){var anchor;if(subject instanceof Map||subject instanceof WeakMap)anchor=subject.get(current);else if(subject instanceof Set||subject instanceof WeakSet){var _ref;validateInteger(current=parseInt(current)),anchor=null===(_ref=_toConsumableArray(subject))||void 0===_ref?void 0:_ref[current]}else{if("function"==typeof WeakRef&&subject instanceof WeakRef)throw Error("unsupported action for this data type");isArray(subject)?(validateInteger(current=parseInt(current)),anchor=null==subject?void 0:subject[current]):anchor=null==subject?void 0:subject[current]}if(isObject(anchor)||isArray(anchor))return getValueViaPath.call(this,anchor,parts.join("."),check);if(parts.length>0)throw Error("the journey is not at its end ("+parts.join(".")+")");if(!0===check&&!subject.hasOwnProperty(current))throw Error("unknown value");return anchor}throw TypeError("unsupported type "+pathfinder_typeof(subject))}function setValueViaPath(object,path,value){validateString(path);for(var parts=path.split("."),last=parts.pop(),subpath=parts.join("."),stack=new Stack,current=subpath;;){try{getValueViaPath.call(this,object,current,!0);break}catch(e){}if(stack.push(current),parts.pop(),""===(current=parts.join(".")))break}for(;!stack.isEmpty();){current=stack.pop();var obj={};if(!stack.isEmpty()){var n=stack.peek().split(".").pop();isInteger(parseInt(n))&&(obj=[])}setValueViaPath.call(this,object,current,obj)}var anchor=getValueViaPath.call(this,object,subpath);if(!isObject(object)&&!isArray(object))throw TypeError("unsupported type: "+pathfinder_typeof(object));if(anchor instanceof Map||anchor instanceof WeakMap)anchor.set(last,value);else if(anchor instanceof Set||anchor instanceof WeakSet)anchor.append(value);else{if("function"==typeof WeakRef&&anchor instanceof WeakRef)throw Error("unsupported action for this data type");isArray(anchor)?(validateInteger(last=parseInt(last)),assignProperty(anchor,last,value)):assignProperty(anchor,last,value)}}function assignProperty(object,key,value){object.hasOwnProperty(key)?(void 0===value&&delete object[key],object[key]=value):object[key]=value}function deleteValueViaPath(object,path){var parts=path.split("."),last=parts.pop(),subpath=parts.join("."),anchor=getValueViaPath.call(this,object,subpath);if(anchor instanceof Map)anchor.delete(last);else{if(anchor instanceof Set||anchor instanceof WeakMap||anchor instanceof WeakSet||"function"==typeof WeakRef&&anchor instanceof WeakRef)throw Error("unsupported action for this data type");isArray(anchor)?(validateInteger(last=parseInt(last)),delete anchor[last]):delete anchor[last]}}function transformer_toConsumableArray(arr){return function transformer_arrayWithoutHoles(arr){if(Array.isArray(arr))return transformer_arrayLikeToArray(arr)}(arr)||function transformer_iterableToArray(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}(arr)||transformer_unsupportedIterableToArray(arr)||function transformer_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 transformer_typeof(obj){return(transformer_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function transformer_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=transformer_unsupportedIterableToArray(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function transformer_unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return transformer_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?transformer_arrayLikeToArray(o,minLen):void 0}}function transformer_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _wrapRegExp(){_wrapRegExp=function _wrapRegExp(re,groups){return new BabelRegExp(re,void 0,groups)};var _super=RegExp.prototype,_groups=new WeakMap;function BabelRegExp(re,flags,groups){var _this=new RegExp(re,flags);return _groups.set(_this,groups||_groups.get(re)),transformer_setPrototypeOf(_this,BabelRegExp.prototype)}function buildGroups(result,re){var g=_groups.get(re);return Object.keys(g).reduce((function(groups,name){return groups[name]=result[g[name]],groups}),Object.create(null))}return transformer_inherits(BabelRegExp,RegExp),BabelRegExp.prototype.exec=function(str){var result=_super.exec.call(this,str);return result&&(result.groups=buildGroups(result,this)),result},BabelRegExp.prototype[Symbol.replace]=function(str,substitution){if("string"==typeof substitution){var groups=_groups.get(this);return _super[Symbol.replace].call(this,str,substitution.replace(/\$<([^>]+)>/g,(function(_,name){return"$"+groups[name]})))}if("function"==typeof substitution){var _this=this;return _super[Symbol.replace].call(this,str,(function(){var args=arguments;return"object"!==transformer_typeof(args[args.length-1])&&(args=[].slice.call(args)).push(buildGroups(args,_this)),substitution.apply(this,args)}))}return _super[Symbol.replace].call(this,str,substitution)},_wrapRegExp.apply(this,arguments)}function transformer_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function transformer_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&transformer_setPrototypeOf(subClass,superClass)}function transformer_setPrototypeOf(o,p){return(transformer_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function transformer_createSuper(Derived){var hasNativeReflectConstruct=function transformer_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}}();return function _createSuperInternal(){var result,Super=transformer_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=transformer_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return transformer_possibleConstructorReturn(this,result)}}function transformer_possibleConstructorReturn(self,call){if(call&&("object"===transformer_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function transformer_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function transformer_getPrototypeOf(o){return(transformer_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}Monster.assignToNamespace("Monster.Data",Pathfinder);var Transformer=function(_Base){transformer_inherits(Transformer,_Base);var _super=transformer_createSuper(Transformer);function Transformer(definition){var _this;return function transformer_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Transformer),_this=_super.call(this),validateString(definition),_this.args=function disassemble(command){validateString(command);var _step,placeholder=new Map,regex=_wrapRegExp(/((\\(.)){1})/gim,{pattern:2,char:3}),_iterator=transformer_createForOfIteratorHelper(command.matchAll(regex));try{for(_iterator.s();!(_step=_iterator.n()).done;){var m=_step.value,g=null==m?void 0:m.groups;if(isObject(g)){var p=null==g?void 0:g.pattern,c=null==g?void 0:g.char;if(p&&c){var r="__"+(new ID).toString()+"__";placeholder.set(r,c),command=command.replace(p,r)}}}}catch(err){_iterator.e(err)}finally{_iterator.f()}var parts=command.split(":");return parts=parts.map((function(value){var _step2,v=value.trim(),_iterator2=transformer_createForOfIteratorHelper(placeholder);try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var k=_step2.value;v=v.replace(k[0],k[1])}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}return v}))}(definition),_this.command=_this.args.shift(),_this.callbacks=new Map,_this}return function transformer_createClass(Constructor,protoProps,staticProps){return protoProps&&transformer_defineProperties(Constructor.prototype,protoProps),staticProps&&transformer_defineProperties(Constructor,staticProps),Constructor}(Transformer,[{key:"setCallback",value:function setCallback(name,callback,context){return validateString(name),validateFunction(callback),void 0!==context&&validateObject(context),this.callbacks.set(name,{callback:callback,context:context}),this}},{key:"run",value:function run(value){return transform.apply(this,[value])}}]),Transformer}(Base);function transform(value){var _callback,key,args=clone(this.args);switch(this.command){case"static":return this.args.join(":");case"tolower":case"strtolower":case"tolowercase":return validateString(value),value.toLowerCase();case"toupper":case"strtoupper":case"touppercase":return validateString(value),value.toUpperCase();case"tostring":return""+value;case"tointeger":var n=parseInt(value);return validateInteger(n),n;case"tojson":return JSON.stringify(value);case"fromjson":return JSON.parse(value);case"trim":return validateString(value),value.trim();case"rawurlencode":return validateString(value),encodeURIComponent(value).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A");case"call":var callback,callbackName=args.shift(),context=getGlobal();if(isObject(value)&&value.hasOwnProperty(callbackName))callback=value[callbackName];else if(this.callbacks.has(callbackName)){var s=this.callbacks.get(callbackName);callback=null==s?void 0:s.callback,context=null==s?void 0:s.context}else"object"===("undefined"==typeof window?"undefined":transformer_typeof(window))&&window.hasOwnProperty(callbackName)&&(callback=window[callbackName]);return validateFunction(callback),args.unshift(value),(_callback=callback).call.apply(_callback,[context].concat(transformer_toConsumableArray(args)));case"plain":case"plaintext":return validateString(value),(new DOMParser).parseFromString(value,"text/html").body.textContent||"";case"if":case"?":validatePrimitive(value);var trueStatement=args.shift()||void 0,falseStatement=args.shift()||void 0;return"value"===trueStatement&&(trueStatement=value),"\\value"===trueStatement&&(trueStatement="value"),"value"===falseStatement&&(falseStatement=value),"\\value"===falseStatement&&(falseStatement="value"),void 0!==value&&""!==value&&"off"!==value&&"false"!==value&&!1!==value||"on"===value||"true"===value||!0===value?trueStatement:falseStatement;case"ucfirst":return validateString(value),value.charAt(0).toUpperCase()+value.substr(1);case"ucwords":return validateString(value),value.replace(/^([a-z\u00E0-\u00FC])|\s+([a-z\u00E0-\u00FC])/g,(function(v){return v.toUpperCase()}));case"count":case"length":if((isString(value)||isObject(value)||isArray(value))&&value.hasOwnProperty("length"))return value.length;throw new TypeError("unsupported type "+transformer_typeof(value));case"base64":return function convertToString(value){return isObject(value)&&value.hasOwnProperty("toString")&&(value=value.toString()),validateString(value),value}(value),btoa(value);case"empty":return"";case"undefined":return;case"prefix":return validateString(value),(null==args?void 0:args[0])+value;case"suffix":return validateString(value),value+(null==args?void 0:args[0]);case"uniqid":return(new ID).toString();case"key":case"property":case"index":key=args.shift()||"undefined";var defaultValue=args.shift()||"";if(value instanceof Map)return value.has(key)?value.get(key):defaultValue;if(isObject(value)||isArray(value))return null!=value&&value[key]?null==value?void 0:value[key]:defaultValue;throw new Error("type not supported");case"path":return key=args.shift()||"undefined",new Pathfinder(value).getVia(key);case"substring":validateString(value);var start=parseInt(args[0])||0,end=(parseInt(args[1])||0)+start;return value.substring(start,end);case"nop":return value;case"default":return void 0!==value?value:args[0];default:throw new Error("unknown command "+this.command)}return value}function pipe_typeof(obj){return(pipe_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function pipe_slicedToArray(arr,i){return function pipe_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function pipe_iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function pipe_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return pipe_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pipe_arrayLikeToArray(o,minLen)}(arr,i)||function pipe_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pipe_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function pipe_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function pipe_setPrototypeOf(o,p){return(pipe_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function pipe_createSuper(Derived){var hasNativeReflectConstruct=function pipe_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}}();return function _createSuperInternal(){var result,Super=pipe_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=pipe_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return pipe_possibleConstructorReturn(this,result)}}function pipe_possibleConstructorReturn(self,call){if(call&&("object"===pipe_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function pipe_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function pipe_getPrototypeOf(o){return(pipe_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}Monster.assignToNamespace("Monster.Data",Transformer);var Pipe=function(_Base){!function pipe_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&pipe_setPrototypeOf(subClass,superClass)}(Pipe,_Base);var _super=pipe_createSuper(Pipe);function Pipe(pipe){var _this;return function pipe_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Pipe),_this=_super.call(this),validateString(pipe),_this.pipe=pipe.split("|").map((function(v){return new Transformer(v)})),_this}return function pipe_createClass(Constructor,protoProps,staticProps){return protoProps&&pipe_defineProperties(Constructor.prototype,protoProps),staticProps&&pipe_defineProperties(Constructor,staticProps),Constructor}(Pipe,[{key:"setCallback",value:function setCallback(name,callback,context){for(var _i=0,_Object$entries=Object.entries(this.pipe);_i<_Object$entries.length;_i++){pipe_slicedToArray(_Object$entries[_i],2)[1].setCallback(name,callback,context)}return this}},{key:"run",value:function run(value){return this.pipe.reduce((function(accumulator,transformer,currentIndex,array){return transformer.run(accumulator)}),value)}}]),Pipe}(Base);function formatter_typeof(obj){return(formatter_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function formatter_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function formatter_setPrototypeOf(o,p){return(formatter_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function formatter_createSuper(Derived){var hasNativeReflectConstruct=function formatter_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}}();return function _createSuperInternal(){var result,Super=formatter_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=formatter_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return formatter_possibleConstructorReturn(this,result)}}function formatter_possibleConstructorReturn(self,call){if(call&&("object"===formatter_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function formatter_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function formatter_getPrototypeOf(o){return(formatter_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}Monster.assignToNamespace("Monster.Data",Pipe);var Formatter=function(_Base){!function formatter_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&formatter_setPrototypeOf(subClass,superClass)}(Formatter,_Base);var _super=formatter_createSuper(Formatter);function Formatter(object){var _this;return function formatter_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Formatter),(_this=_super.call(this)).object=validateObject(object),_this.openMarker="${",_this.closeMarker="}",_this}return function formatter_createClass(Constructor,protoProps,staticProps){return protoProps&&formatter_defineProperties(Constructor.prototype,protoProps),staticProps&&formatter_defineProperties(Constructor,staticProps),Constructor}(Formatter,[{key:"setMarker",value:function setMarker(open,close){return void 0===close&&(close=open),this.openMarker=validateString(open),this.closeMarker=validateString(close),this}},{key:"format",value:function format(text){return tokenizer.call(this,validateString(text))}}]),Formatter}(Base);function tokenizer(text){for(var formatted=[];;){var startIndex=text.indexOf(this.openMarker);if(-1===startIndex){formatted.push(text);break}startIndex>0&&(formatted.push(text.substring(0,startIndex)),text=text.substring(startIndex));var endIndex=text.substring(this.openMarker.length).indexOf(this.closeMarker)+this.openMarker.length;if(-1===endIndex)throw new Error("syntax error in formatter template");var command="path:"+text.substring(this.openMarker.length,endIndex);formatted.push(validateString(new Pipe(command).run(this.object))),text=text.substring(endIndex+this.closeMarker.length)}return formatted.join("")}function tokenlist_typeof(obj){return(tokenlist_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function tokenlist_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function tokenlist_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return tokenlist_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tokenlist_arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function tokenlist_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function tokenlist_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function tokenlist_setPrototypeOf(o,p){return(tokenlist_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function tokenlist_createSuper(Derived){var hasNativeReflectConstruct=function tokenlist_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}}();return function _createSuperInternal(){var result,Super=tokenlist_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=tokenlist_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return tokenlist_possibleConstructorReturn(this,result)}}function tokenlist_possibleConstructorReturn(self,call){if(call&&("object"===tokenlist_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function tokenlist_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function tokenlist_getPrototypeOf(o){return(tokenlist_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}Monster.assignToNamespace("Monster.Text",Formatter);var TokenList=function(_Base,_Symbol$iterator){!function tokenlist_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&tokenlist_setPrototypeOf(subClass,superClass)}(TokenList,_Base);var _super=tokenlist_createSuper(TokenList);function TokenList(init){var _this;return function tokenlist_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,TokenList),(_this=_super.call(this)).tokens=new Set,void 0!==init&&_this.add(init),_this}return function tokenlist_createClass(Constructor,protoProps,staticProps){return protoProps&&tokenlist_defineProperties(Constructor.prototype,protoProps),staticProps&&tokenlist_defineProperties(Constructor,staticProps),Constructor}(TokenList,[{key:"getIterator",value:function getIterator(){return this[Symbol.iterator]()}},{key:_Symbol$iterator,value:function value(){var index=0,entries=this.entries();return{next:function next(){return index<entries.length?{value:null==entries?void 0:entries[index++],done:!1}:{done:!0}}}}},{key:"contains",value:function contains(value){var _this2=this;if(isString(value)){value=value.trim();var counter=0;return value.split(" ").forEach((function(token){if(!1===_this2.tokens.has(token.trim()))return!1;counter++})),counter>0}if(isIterable(value)){var _step,_counter=0,_iterator=tokenlist_createForOfIteratorHelper(value);try{for(_iterator.s();!(_step=_iterator.n()).done;){var token=_step.value;if(validateString(token),!1===this.tokens.has(token.trim()))return!1;_counter++}}catch(err){_iterator.e(err)}finally{_iterator.f()}return _counter>0}return!1}},{key:"add",value:function add(value){var _this3=this;if(isString(value))value.split(" ").forEach((function(token){_this3.tokens.add(token.trim())}));else if(isIterable(value)){var _step2,_iterator2=tokenlist_createForOfIteratorHelper(value);try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var token=_step2.value;validateString(token),this.tokens.add(token.trim())}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}}else if(void 0!==value)throw new TypeError("unsupported value");return this}},{key:"clear",value:function clear(){return this.tokens.clear(),this}},{key:"remove",value:function remove(value){var _this4=this;if(isString(value))value.split(" ").forEach((function(token){_this4.tokens.delete(token.trim())}));else if(isIterable(value)){var _step3,_iterator3=tokenlist_createForOfIteratorHelper(value);try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var token=_step3.value;validateString(token),this.tokens.delete(token.trim())}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}}else if(void 0!==value)throw new TypeError("unsupported value");return this}},{key:"replace",value:function replace(token,newToken){if(validateString(token),validateString(newToken),!this.contains(token))return this;var a=Array.from(this.tokens),i=a.indexOf(token);return-1===i||(a.splice(i,1,newToken),this.tokens=new Set,this.add(a)),this}},{key:"toggle",value:function toggle(value){var _this5=this;if(isString(value))value.split(" ").forEach((function(token){toggleValue.call(_this5,token)}));else if(isIterable(value)){var _step4,_iterator4=tokenlist_createForOfIteratorHelper(value);try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var token=_step4.value;toggleValue.call(this,token)}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}}else if(void 0!==value)throw new TypeError("unsupported value");return this}},{key:"entries",value:function entries(){return Array.from(this.tokens)}},{key:"forEach",value:function forEach(callback){return validateFunction(callback),this.tokens.forEach(callback),this}},{key:"toString",value:function toString(){return this.entries().join(" ")}}]),TokenList}(Base,Symbol.iterator);function toggleValue(token){if(!(this instanceof TokenList))throw Error("must be called with TokenList.call");return validateString(token),token=token.trim(),this.contains(token)?(this.remove(token),this):(this.add(token),this)}function queue_typeof(obj){return(queue_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function queue_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function queue_setPrototypeOf(o,p){return(queue_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function queue_createSuper(Derived){var hasNativeReflectConstruct=function queue_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}}();return function _createSuperInternal(){var result,Super=queue_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=queue_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return queue_possibleConstructorReturn(this,result)}}function queue_possibleConstructorReturn(self,call){if(call&&("object"===queue_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function queue_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function queue_getPrototypeOf(o){return(queue_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}Monster.assignToNamespace("Monster.Types",TokenList);var Queue=function(_Base){!function queue_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&queue_setPrototypeOf(subClass,superClass)}(Queue,_Base);var _super=queue_createSuper(Queue);function Queue(){var _this;return function queue_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Queue),(_this=_super.call(this)).data=[],_this}return function queue_createClass(Constructor,protoProps,staticProps){return protoProps&&queue_defineProperties(Constructor.prototype,protoProps),staticProps&&queue_defineProperties(Constructor,staticProps),Constructor}(Queue,[{key:"isEmpty",value:function isEmpty(){return 0===this.data.length}},{key:"peek",value:function peek(){if(!this.isEmpty())return this.data[0]}},{key:"add",value:function add(value){return this.data.push(value),this}},{key:"clear",value:function clear(){return this.data=[],this}},{key:"poll",value:function poll(){if(!this.isEmpty())return this.data.shift()}}]),Queue}(Base);function uniquequeue_typeof(obj){return(uniquequeue_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function uniquequeue_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _get(target,property,receiver){return(_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(target,property,receiver){var base=function _superPropBase(object,property){for(;!Object.prototype.hasOwnProperty.call(object,property)&&null!==(object=uniquequeue_getPrototypeOf(object)););return object}(target,property);if(base){var desc=Object.getOwnPropertyDescriptor(base,property);return desc.get?desc.get.call(receiver):desc.value}})(target,property,receiver||target)}function uniquequeue_setPrototypeOf(o,p){return(uniquequeue_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function uniquequeue_createSuper(Derived){var hasNativeReflectConstruct=function uniquequeue_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}}();return function _createSuperInternal(){var result,Super=uniquequeue_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=uniquequeue_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return uniquequeue_possibleConstructorReturn(this,result)}}function uniquequeue_possibleConstructorReturn(self,call){if(call&&("object"===uniquequeue_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function uniquequeue_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function uniquequeue_getPrototypeOf(o){return(uniquequeue_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}Monster.assignToNamespace("Monster.Types",Queue);var UniqueQueue=function(_Queue){!function uniquequeue_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&uniquequeue_setPrototypeOf(subClass,superClass)}(UniqueQueue,_Queue);var _super=uniquequeue_createSuper(UniqueQueue);function UniqueQueue(){var _this;return function uniquequeue_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,UniqueQueue),(_this=_super.call(this)).unique=new WeakSet,_this}return function uniquequeue_createClass(Constructor,protoProps,staticProps){return protoProps&&uniquequeue_defineProperties(Constructor.prototype,protoProps),staticProps&&uniquequeue_defineProperties(Constructor,staticProps),Constructor}(UniqueQueue,[{key:"add",value:function add(value){return validateObject(value),this.unique.has(value)||(this.unique.add(value),_get(uniquequeue_getPrototypeOf(UniqueQueue.prototype),"add",this).call(this,value)),this}},{key:"clear",value:function clear(){return _get(uniquequeue_getPrototypeOf(UniqueQueue.prototype),"clear",this).call(this),this.unique=new WeakSet,this}},{key:"poll",value:function poll(){if(!this.isEmpty()){var value=this.data.shift();return this.unique.delete(value),value}}}]),UniqueQueue}(Queue);function observer_typeof(obj){return(observer_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function observer_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function observer_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function observer_setPrototypeOf(o,p){return(observer_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function observer_createSuper(Derived){var hasNativeReflectConstruct=function observer_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}}();return function _createSuperInternal(){var result,Super=observer_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=observer_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return observer_possibleConstructorReturn(this,result)}}function observer_possibleConstructorReturn(self,call){if(call&&("object"===observer_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function observer_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function observer_getPrototypeOf(o){return(observer_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}Monster.assignToNamespace("Monster.Types",UniqueQueue);var Observer=function(_Base){!function observer_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&observer_setPrototypeOf(subClass,superClass)}(Observer,_Base);var _super=observer_createSuper(Observer);function Observer(callback){var _this;if(observer_classCallCheck(this,Observer),_this=_super.call(this),"function"!=typeof callback)throw new Error("observer callback must be a function");_this.callback=callback;for(var _len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)args[_key-1]=arguments[_key];return _this.arguments=args,_this.tags=new TokenList,_this.queue=new UniqueQueue,_this}return function observer_createClass(Constructor,protoProps,staticProps){return protoProps&&observer_defineProperties(Constructor.prototype,protoProps),staticProps&&observer_defineProperties(Constructor,staticProps),Constructor}(Observer,[{key:"addTag",value:function addTag(tag){return this.tags.add(tag),this}},{key:"removeTag",value:function removeTag(tag){return this.tags.remove(tag),this}},{key:"getTags",value:function getTags(){return this.tags.entries()}},{key:"hasTag",value:function hasTag(tag){return this.tags.contains(tag)}},{key:"update",value:function update(subject){var self=this;return new Promise((function(resolve,reject){isObject(subject)?(self.queue.add(subject),setTimeout((function(){try{if(self.queue.isEmpty())return void resolve();var s=self.queue.poll(),result=self.callback.apply(s,self.arguments);if(isObject(result)&&result instanceof Promise)return void result.then(resolve).catch(reject);resolve(result)}catch(e){reject(e)}}),0)):reject("subject must be an object")}))}}]),Observer}(Base);function observerlist_typeof(obj){return(observerlist_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function observerlist_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function observerlist_setPrototypeOf(o,p){return(observerlist_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function observerlist_createSuper(Derived){var hasNativeReflectConstruct=function observerlist_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}}();return function _createSuperInternal(){var result,Super=observerlist_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=observerlist_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return observerlist_possibleConstructorReturn(this,result)}}function observerlist_possibleConstructorReturn(self,call){if(call&&("object"===observerlist_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function observerlist_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function observerlist_getPrototypeOf(o){return(observerlist_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}Monster.assignToNamespace("Monster.Types",Observer);var ObserverList=function(_Base){!function observerlist_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&observerlist_setPrototypeOf(subClass,superClass)}(ObserverList,_Base);var _super=observerlist_createSuper(ObserverList);function ObserverList(){var _this;return function observerlist_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ObserverList),(_this=_super.call(this)).observers=[],_this}return function observerlist_createClass(Constructor,protoProps,staticProps){return protoProps&&observerlist_defineProperties(Constructor.prototype,protoProps),staticProps&&observerlist_defineProperties(Constructor,staticProps),Constructor}(ObserverList,[{key:"attach",value:function attach(observer){return validateInstance(observer,Observer),this.observers.push(observer),this}},{key:"detach",value:function detach(observer){validateInstance(observer,Observer);for(var i=0,l=this.observers.length;i<l;i++)this.observers[i]===observer&&this.observers.splice(i,1);return this}},{key:"contains",value:function contains(observer){validateInstance(observer,Observer);for(var i=0,l=this.observers.length;i<l;i++)if(this.observers[i]===observer)return!0;return!1}},{key:"notify",value:function notify(subject){for(var pomises=[],i=0,l=this.observers.length;i<l;i++)pomises.push(this.observers[i].update(subject));return Promise.all(pomises)}}]),ObserverList}(Base);function proxyobserver_typeof(obj){return(proxyobserver_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function proxyobserver_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function proxyobserver_setPrototypeOf(o,p){return(proxyobserver_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function proxyobserver_createSuper(Derived){var hasNativeReflectConstruct=function proxyobserver_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}}();return function _createSuperInternal(){var result,Super=proxyobserver_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=proxyobserver_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return proxyobserver_possibleConstructorReturn(this,result)}}function proxyobserver_possibleConstructorReturn(self,call){if(call&&("object"===proxyobserver_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return proxyobserver_assertThisInitialized(self)}function proxyobserver_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function proxyobserver_getPrototypeOf(o){return(proxyobserver_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}Monster.assignToNamespace("Monster.Types",ObserverList);var ProxyObserver=function(_Base){!function proxyobserver_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&proxyobserver_setPrototypeOf(subClass,superClass)}(ProxyObserver,_Base);var _super=proxyobserver_createSuper(ProxyObserver);function ProxyObserver(object){var _this;return function proxyobserver_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ProxyObserver),_this=_super.call(this),validateObject(object),_this.realSubject=object,_this.subject=new Proxy(object,getHandler.call(proxyobserver_assertThisInitialized(_this))),_this.objectMap=new WeakMap,_this.objectMap.set(_this.realSubject,_this.subject),_this.observers=new ObserverList,_this}return function proxyobserver_createClass(Constructor,protoProps,staticProps){return protoProps&&proxyobserver_defineProperties(Constructor.prototype,protoProps),staticProps&&proxyobserver_defineProperties(Constructor,staticProps),Constructor}(ProxyObserver,[{key:"getSubject",value:function getSubject(){return this.subject}},{key:"getRealSubject",value:function getRealSubject(){return this.realSubject}},{key:"attachObserver",value:function attachObserver(observer){return this.observers.attach(observer),this}},{key:"detachObserver",value:function detachObserver(observer){return this.observers.detach(observer),this}},{key:"notifyObservers",value:function notifyObservers(){return this.observers.notify(this)}},{key:"containsObserver",value:function containsObserver(observer){return this.observers.contains(observer)}}]),ProxyObserver}(Base);function getHandler(){var proxy=this,handler={get:function get(target,key,receiver){var value=Reflect.get(target,key,receiver);if("symbol"===proxyobserver_typeof(key))return value;if(isPrimitive(value))return value;if(isArray(value)||isObject(value)){if(proxy.objectMap.has(value))return proxy.objectMap.get(value);var p=new Proxy(value,handler);return proxy.objectMap.set(value,p),p}return value},set:function set(target,key,value,receiver){var result;if(Reflect.get(target,key,receiver)===value)return!0;var descriptor=Reflect.getOwnPropertyDescriptor(target,key);return void 0===descriptor&&(descriptor={writable:!0,enumerable:!0,configurable:!0}),descriptor.value=value,result=Reflect.defineProperty(target,key,descriptor),"symbol"!==proxyobserver_typeof(key)&&proxy.observers.notify(proxy),result},deleteProperty:function deleteProperty(target,key){return key in target&&(delete target[key],"symbol"!==proxyobserver_typeof(key)&&proxy.observers.notify(proxy),!0)},defineProperty:function defineProperty(target,key,descriptor){var result=Reflect.defineProperty(target,key,descriptor);return"symbol"!==proxyobserver_typeof(key)&&proxy.observers.notify(proxy),result},setPrototypeOf:function setPrototypeOf(target,key){var result=Reflect.setPrototypeOf(object1,key);return"symbol"!==proxyobserver_typeof(key)&&proxy.observers.notify(proxy),result}};return handler}function diff_typeof(obj){return(diff_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function Diff(first,second){return doDiff(first,second)}function doDiff(a,b,path,diff){var typeA=diff_typeof(a),typeB=diff_typeof(b),currPath=path||[],currDiff=diff||[];if(typeA===typeB&&"object"===typeA)(function getKeys(a,b,type){if(isArray(type)){var keys=a.length>b.length?new Array(a.length):new Array(b.length);return keys.fill(0),new Set(keys.map((function(_,i){return i})))}return new Set(Object.keys(a).concat(Object.keys(b)))})(a,b,typeA).forEach((function(v){Object.prototype.hasOwnProperty.call(a,v)?Object.prototype.hasOwnProperty.call(b,v)?doDiff(a[v],b[v],currPath.concat(v),currDiff):currDiff.push(buildResult(a[v],b[v],"delete",currPath.concat(v))):currDiff.push(buildResult(a[v],b[v],"add",currPath.concat(v)))}));else{var o=function getOperator(a,b){var operator,typeA=diff_typeof(a),typeB=diff_typeof(b);"undefined"===typeA&&"undefined"!==typeB?operator="add":"undefined"!==typeA&&"undefined"===typeB?operator="delete":function isNotEqual(a,b){if(diff_typeof(a)!==diff_typeof(b))return!0;if(a instanceof Date&&b instanceof Date)return a.getTime()!==b.getTime();return a!==b}(a,b)&&(operator="update");return operator}(a,b);void 0!==o&&currDiff.push(buildResult(a,b,o,path))}return currDiff}function buildResult(a,b,operator,path){var result={operator:operator,path:path};if("add"!==operator&&(result.first={value:a,type:diff_typeof(a)},isObject(a))){var _Object$getPrototypeO,_Object$getPrototypeO2,name=null===(_Object$getPrototypeO=Object.getPrototypeOf(a))||void 0===_Object$getPrototypeO||null===(_Object$getPrototypeO2=_Object$getPrototypeO.constructor)||void 0===_Object$getPrototypeO2?void 0:_Object$getPrototypeO2.name;void 0!==name&&(result.first.instance=name)}if(("add"===operator||"update"===operator)&&(result.second={value:b,type:diff_typeof(b)},isObject(b))){var _Object$getPrototypeO3,_Object$getPrototypeO4,_name=null===(_Object$getPrototypeO3=Object.getPrototypeOf(b))||void 0===_Object$getPrototypeO3||null===(_Object$getPrototypeO4=_Object$getPrototypeO3.constructor)||void 0===_Object$getPrototypeO4?void 0:_Object$getPrototypeO4.name;void 0!==_name&&(result.second.instance=_name)}return result}Monster.assignToNamespace("Monster.Types",ProxyObserver),Monster.assignToNamespace("Monster.Data",Diff);function theme_typeof(obj){return(theme_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function theme_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function theme_setPrototypeOf(o,p){return(theme_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function theme_createSuper(Derived){var hasNativeReflectConstruct=function theme_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}}();return function _createSuperInternal(){var result,Super=theme_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=theme_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return theme_possibleConstructorReturn(this,result)}}function theme_possibleConstructorReturn(self,call){if(call&&("object"===theme_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function theme_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function theme_getPrototypeOf(o){return(theme_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}var Theme=function(_Base){!function theme_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&theme_setPrototypeOf(subClass,superClass)}(Theme,_Base);var _super=theme_createSuper(Theme);function Theme(name){var _this;return function theme_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Theme),_this=_super.call(this),validateString(name),_this.name=name,_this}return function theme_createClass(Constructor,protoProps,staticProps){return protoProps&&theme_defineProperties(Constructor.prototype,protoProps),staticProps&&theme_defineProperties(Constructor,staticProps),Constructor}(Theme,[{key:"getName",value:function getName(){return this.name}}]),Theme}(Base);function getDocumentTheme(){var name="monster",element=getGlobalObject("document").querySelector("html");if(element instanceof HTMLElement){var theme=element.getAttribute("data-monster-theme-name");theme&&(name=theme)}return new Theme(name)}function template_typeof(obj){return(template_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function template_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function template_setPrototypeOf(o,p){return(template_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function template_createSuper(Derived){var hasNativeReflectConstruct=function template_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}}();return function _createSuperInternal(){var result,Super=template_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=template_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return template_possibleConstructorReturn(this,result)}}function template_possibleConstructorReturn(self,call){if(call&&("object"===template_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function template_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function template_getPrototypeOf(o){return(template_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}Monster.assignToNamespace("Monster.DOM",Theme,getDocumentTheme);var Template=function(_Base){!function template_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&template_setPrototypeOf(subClass,superClass)}(Template,_Base);var _super=template_createSuper(Template);function Template(template){var _this;return function template_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Template),_this=_super.call(this),validateInstance(template,getGlobalFunction("HTMLTemplateElement")),_this.template=template,_this}return function template_createClass(Constructor,protoProps,staticProps){return protoProps&&template_defineProperties(Constructor.prototype,protoProps),staticProps&&template_defineProperties(Constructor,staticProps),Constructor}(Template,[{key:"getTemplateElement",value:function getTemplateElement(){return this.template}},{key:"createDocumentFragment",value:function createDocumentFragment(){return this.template.content.cloneNode(!0)}}]),Template}(Base);function findDocumentTemplate(id,root){validateString(id),root instanceof Node||(root=getGlobalObject("document"));var HTMLTemplateElement=getGlobalFunction("HTMLTemplateElement"),themedID=id+"-"+getDocumentTheme().getName(),template=root.getElementById(themedID);if(template instanceof HTMLTemplateElement)return new Template(template);if((template=root.getElementById(id))instanceof HTMLTemplateElement)return new Template(template);if(root!==getGlobalObject("document"))return findDocumentTemplate(id);throw new Error("template "+id+" not found.")}function util_typeof(obj){return(util_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function getDocument(){var _getGlobal,document=null===(_getGlobal=getGlobal())||void 0===_getGlobal?void 0:_getGlobal.document;if("object"!==util_typeof(document))throw new Error("not supported environment");return document}function updater_typeof(obj){return(updater_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function updater_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=updater_unsupportedIterableToArray(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e2){throw _e2},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e3){didErr=!0,err=_e3},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function updater_slicedToArray(arr,i){return function updater_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function updater_iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||updater_unsupportedIterableToArray(arr,i)||function updater_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function updater_unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return updater_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?updater_arrayLikeToArray(o,minLen):void 0}}function updater_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function updater_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function updater_setPrototypeOf(o,p){return(updater_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function updater_createSuper(Derived){var hasNativeReflectConstruct=function updater_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}}();return function _createSuperInternal(){var result,Super=updater_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=updater_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return updater_possibleConstructorReturn(this,result)}}function updater_possibleConstructorReturn(self,call){if(call&&("object"===updater_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return updater_assertThisInitialized(self)}function updater_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function updater_getPrototypeOf(o){return(updater_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}Monster.assignToNamespace("Monster.DOM",Template,findDocumentTemplate),Monster.assignToNamespace("Monster.DOM",(function getWindow(){var _getGlobal2,window=null===(_getGlobal2=getGlobal())||void 0===_getGlobal2?void 0:_getGlobal2.window;if("object"!==util_typeof(window))throw new Error("not supported environment");return window}),getDocument,(function getDocumentFragmentFromString(html){validateString(html);var template=getDocument().createElement("template");return template.innerHTML=html,template.content}));var Updater=function(_Base){!function updater_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&updater_setPrototypeOf(subClass,superClass)}(Updater,_Base);var _super=updater_createSuper(Updater);function Updater(element,subject){var _this;return function updater_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Updater),(_this=_super.call(this)).element=validateInstance(element,HTMLElement),void 0===subject&&(subject={}),isInstance(subject,ProxyObserver)||(subject=new ProxyObserver(subject)),_this.last={},_this.callbacks=new Map,_this.callbacks.set("checkstate",getCheckStateCallback.call(updater_assertThisInitialized(_this))),_this.subject=subject.attachObserver(new Observer((function(){var s=_this.subject.getRealSubject(),diff=Diff(_this.last,s);_this.last=clone(s);for(var _i=0,_Object$entries=Object.entries(diff);_i<_Object$entries.length;_i++){var change=updater_slicedToArray(_Object$entries[_i],2)[1];removeElement.call(updater_assertThisInitialized(_this),change),insertElement.call(updater_assertThisInitialized(_this),change),updateContent.call(updater_assertThisInitialized(_this),change),updateAttributes.call(updater_assertThisInitialized(_this),change)}}))),_this.eventTypes=["keyup","click","change","drop","touchend","input"],_this}return function updater_createClass(Constructor,protoProps,staticProps){return protoProps&&updater_defineProperties(Constructor.prototype,protoProps),staticProps&&updater_defineProperties(Constructor,staticProps),Constructor}(Updater,[{key:"setEventTypes",value:function setEventTypes(types){return this.eventTypes=validateArray(types),this}},{key:"enableEventProcessing",value:function enableEventProcessing(){this.disableEventProcessing();var _step,_iterator=updater_createForOfIteratorHelper(this.eventTypes);try{for(_iterator.s();!(_step=_iterator.n()).done;){var type=_step.value;this.element.addEventListener(type,getControlEventHandler.call(this))}}catch(err){_iterator.e(err)}finally{_iterator.f()}return this}},{key:"disableEventProcessing",value:function disableEventProcessing(){var _step2,_iterator2=updater_createForOfIteratorHelper(this.eventTypes);try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var type=_step2.value;this.element.removeEventListener(type,getControlEventHandler.call(this))}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}return this}},{key:"run",value:function run(){return this.last={__init__:!0},this.subject.notifyObservers()}},{key:"getSubject",value:function getSubject(){return this.subject.getSubject()}},{key:"setCallback",value:function setCallback(name,callback){return this.callbacks.set(name,callback),this}}]),Updater}(Base);function getCheckStateCallback(){return function(current){if(this instanceof HTMLInputElement){if(-1!==["radio","checkbox"].indexOf(this.type))return this.value+""==current+""?"true":void 0}else if(this instanceof HTMLOptionElement)return isArray(current)&&-1!==current.indexOf(this.value)?"true":void 0}}var symbol=Symbol("EventHandler");function getControlEventHandler(){var self=this;if(self[symbol])return self[symbol];var pathfinder=new Pathfinder(this.subject.getSubject());return self[symbol]=function(event){var _element$constructor,_Object$getOwnPropert,element=event.target;if(element.hasAttribute("data-monster-bind")){var value,path=element.getAttribute("data-monster-bind");if(0!==path.indexOf("path:"))throw new Error("the bind argument must start as a value with a path.");if(path=path.substr(5),element instanceof HTMLInputElement)switch(element.type){case"checkbox":value=element.checked?element.value:void 0;break;default:value=element.value}else if(element instanceof HTMLTextAreaElement)value=element.value;else if(element instanceof HTMLSelectElement)switch(element.type){case"select-one":value=element.value;break;case"select-multiple":value=element.value;var options=null==element?void 0:element.selectedOptions;void 0===options&&(options=element.querySelectorAll(":scope option:checked")),value=Array.from(options).map((function(_ref){return _ref.value}))}else{if(!(null!=element&&null!==(_element$constructor=element.constructor)&&void 0!==_element$constructor&&_element$constructor.prototype&&null!==(_Object$getOwnPropert=Object.getOwnPropertyDescriptor(element.constructor.prototype,"value"))&&void 0!==_Object$getOwnPropert&&_Object$getOwnPropert.get||element.hasOwnProperty("value")))throw console.log(element),new Error("unsupported object");value=null==element?void 0:element.value}var copy=clone(self.subject.getRealSubject());new Pathfinder(copy).setVia(path,value),new Diff(copy,self.subject.getRealSubject()).length>0&&pathfinder.setVia(path,value)}},self[symbol]}function removeElement(change){var _step3,_iterator3=updater_createForOfIteratorHelper(this.element.querySelectorAll(":scope [data-monster-remove]").entries());try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var element=updater_slicedToArray(_step3.value,2)[1];element.parentNode.removeChild(element)}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}}function insertElement(change){for(var _this2=this,subject=this.subject.getRealSubject(),mem=(getDocument(),new WeakSet),wd=0;;){var found=!1;wd++;var p=clone(null==change?void 0:change.path);if(!isArray(p))return this;for(;p.length>0;){var _step4,current=p.join("."),_iterator4=updater_createForOfIteratorHelper(this.element.querySelectorAll(':scope [data-monster-insert*="path:'+current+'"]').entries());try{var _loop=function _loop(){var containerElement=updater_slicedToArray(_step4.value,2)[1];if(mem.has(containerElement))return"continue";mem.add(containerElement),found=!0;var def=containerElement.getAttribute("data-monster-insert").trim(),i=def.indexOf(" "),key=def.substr(0,i).trim(),refPrefix=key+"-",cmd=def.substr(i).trim();if(cmd.indexOf("|")>0)throw new Error("pipes are not allowed when cloning a node.");var pipe=new Pipe(cmd);_this2.callbacks.forEach((function(f,n){pipe.setCallback(n,f)}));var value=pipe.run(subject),dataPath=cmd.split(":").pop();if(containerElement.hasChildNodes()&&containerElement.lastChild,!isArray(value))throw new Error("the value is not iterable");for(var available=new Set,_i2=0,_Object$entries2=Object.entries(value);_i2<_Object$entries2.length;_i2++){var _Object$entries2$_i=updater_slicedToArray(_Object$entries2[_i2],2),_i3=_Object$entries2$_i[0],ref=(_Object$entries2$_i[1],refPrefix+_i3),currentPath=dataPath+"."+_i3;available.add(ref);var refElement=containerElement.querySelector('[data-monster-insert-reference="'+ref+'"]');refElement instanceof HTMLElement?refElement:appendNewDocumentFragment(containerElement,key,ref,currentPath)}for(var nodes=containerElement.querySelectorAll('[data-monster-insert-reference*="'+refPrefix+'"]'),_i4=0,_Object$entries3=Object.entries(nodes);_i4<_Object$entries3.length;_i4++){var node=updater_slicedToArray(_Object$entries3[_i4],2)[1];available.has(node.getAttribute("data-monster-insert-reference"))||containerElement.removeChild(node)}};for(_iterator4.s();!(_step4=_iterator4.n()).done;)_loop()}catch(err){_iterator4.e(err)}finally{_iterator4.f()}p.pop()}if(!1===found)break;if(wd++>200)throw new Error("the maximum depth for the recursion is reached.")}}function appendNewDocumentFragment(container,key,ref,path){var rootNode=container.getRootNode();rootNode||(rootNode=getDocument());for(var nodes=findDocumentTemplate(key,rootNode).createDocumentFragment(),_i5=0,_Object$entries4=Object.entries(nodes.childNodes);_i5<_Object$entries4.length;_i5++){var node=updater_slicedToArray(_Object$entries4[_i5],2)[1];node instanceof HTMLElement&&(applyRecursive(node,key,path),node.setAttribute("data-monster-insert-reference",ref)),container.appendChild(node)}}function applyRecursive(node,key,path){if(node instanceof HTMLElement){if(node.hasAttribute("data-monster-replace")){var value=node.getAttribute("data-monster-replace");node.setAttribute("data-monster-replace",value.replace("path:"+key,"path:"+path))}if(node.hasAttribute("data-monster-attributes")){var _value=node.getAttribute("data-monster-attributes");node.setAttribute("data-monster-attributes",_value.replace("path:"+key,"path:"+path))}for(var _i6=0,_Object$entries5=Object.entries(node.childNodes);_i6<_Object$entries5.length;_i6++){applyRecursive(updater_slicedToArray(_Object$entries5[_i6],2)[1],key,path)}}}function updateContent(change){var subject=this.subject.getRealSubject(),p=clone(null==change?void 0:change.path);runUpdateContent.call(this,this.element,p,subject)}function runUpdateContent(container,parts,subject){var _this3=this;if(isArray(parts)){parts=clone(parts);for(var mem=new WeakSet;parts.length>0;){var current=parts.join(".");parts.pop();var _step5,_iterator5=updater_createForOfIteratorHelper(container.querySelectorAll(':scope [data-monster-replace^="path:'+current+'"], [data-monster-replace^="static:"]').entries());try{var _loop2=function _loop2(){var element=updater_slicedToArray(_step5.value,2)[1];if(mem.has(element))return"continue";mem.add(element);var cmd=element.getAttribute("data-monster-replace").trim(),pipe=new Pipe(cmd);_this3.callbacks.forEach((function(f,n){pipe.setCallback(n,f)}));var value=pipe.run(subject);if(value instanceof HTMLElement){for(;element.firstChild;)element.removeChild(element.firstChild);element.addNode(value)}else element.innerHTML=value};for(_iterator5.s();!(_step5=_iterator5.n()).done;)_loop2()}catch(err){_iterator5.e(err)}finally{_iterator5.f()}}}}function updateAttributes(change){var subject=this.subject.getRealSubject(),p=clone(null==change?void 0:change.path);runUpdateAttributes.call(this,this.element,p,subject)}function runUpdateAttributes(container,parts,subject){var _this4=this,self=this;if(isArray(parts)){parts=clone(parts);for(var mem=new WeakSet;parts.length>0;){var current=parts.join(".");parts.pop();var _step6,_iterator6=updater_createForOfIteratorHelper(container.querySelectorAll(':scope [data-monster-attributes*="path:'+current+'"]').entries());try{var _loop3=function _loop3(){var element=updater_slicedToArray(_step6.value,2)[1];if(mem.has(element))return"continue";mem.add(element);for(var attributes=element.getAttribute("data-monster-attributes"),_loop4=function _loop4(){var def=updater_slicedToArray(_Object$entries6[_i7],2)[1],i=(def=def.trim()).indexOf(" "),name=def.substr(0,i).trim(),cmd=def.substr(i).trim(),pipe=new Pipe(cmd);self.callbacks.forEach((function(f,n){pipe.setCallback(n,f,element)}));var value=pipe.run(subject);void 0===value?element.removeAttribute(name):element.getAttribute(name)!==value&&element.setAttribute(name,value),handleInputControlAttributeUpdate.call(_this4,element,name,value)},_i7=0,_Object$entries6=Object.entries(attributes.split(","));_i7<_Object$entries6.length;_i7++)_loop4()};for(_iterator6.s();!(_step6=_iterator6.n()).done;)_loop3()}catch(err){_iterator6.e(err)}finally{_iterator6.f()}}}}function handleInputControlAttributeUpdate(element,name,value){if(element instanceof HTMLSelectElement)switch(element.type){case"select-multiple":for(var _i8=0,_Object$entries7=Object.entries(element.options);_i8<_Object$entries7.length;_i8++){var _Object$entries7$_i=updater_slicedToArray(_Object$entries7[_i8],2),opt=(_Object$entries7$_i[0],_Object$entries7$_i[1]);-1!==value.indexOf(opt.value)?opt.selected=!0:opt.selected=!1}break;case"select-one":for(var _i9=0,_Object$entries8=Object.entries(element.options);_i9<_Object$entries8.length;_i9++){var _Object$entries8$_i=updater_slicedToArray(_Object$entries8[_i9],2),_index=_Object$entries8$_i[0];if(_Object$entries8$_i[1].value===value){element.selectedIndex=_index;break}}}else if(element instanceof HTMLInputElement)switch(element.type){case"radio":case"checkbox":element.checked="checked"===name&&void 0!==value;break;case"text":default:"value"===name&&(element.value=void 0===value?"":value)}else element instanceof HTMLTextAreaElement&&"value"===name&&(element.value=void 0===value?"":value)}function addToObjectLink(element,symbol,object){return validateInstance(element,HTMLElement),validateSymbol(symbol),void 0===(null==element?void 0:element[symbol])&&(element[symbol]=new Set),addAttributeToken(element,"data-monster-objectlink",symbol.toString()),element[symbol].add(object),element}function hasObjectLink(element,symbol){return validateInstance(element,HTMLElement),validateSymbol(symbol),void 0!==(null==element?void 0:element[symbol])&&containsAttributeToken(element,"data-monster-objectlink",symbol.toString())}function getLinkedObjects(element,symbol){if(validateInstance(element,HTMLElement),validateSymbol(symbol),void 0===(null==element?void 0:element[symbol]))throw new Error("there is no object link for "+symbol.toString());return null==element?void 0:element[symbol][Symbol.iterator]()}function addAttributeToken(element,key,token){return validateInstance(element,HTMLElement),validateString(token),validateString(key),element.hasAttribute(key)?(element.setAttribute(key,new TokenList(element.getAttribute(key)).add(token).toString()),element):(element.setAttribute(key,token),element)}function removeAttributeToken(element,key,token){return validateInstance(element,HTMLElement),validateString(token),validateString(key),element.hasAttribute(key)?(element.setAttribute(key,new TokenList(element.getAttribute(key)).remove(token).toString()),element):element}function containsAttributeToken(element,key,token){return validateInstance(element,HTMLElement),validateString(token),validateString(key),!!element.hasAttribute(key)&&new TokenList(element.getAttribute(key)).contains(token)}function findClosestByAttribute(element,key,value){if(validateInstance(element,getGlobalFunction("HTMLElement")),element.hasAttribute(key)&&element.getAttribute(key)===value)return element;var selector=validateString(key);void 0!==value&&(selector+="="+validateString(value));var result=element.closest("["+selector+"]");return result instanceof HTMLElement?result:void 0}function locale_typeof(obj){return(locale_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function locale_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function locale_setPrototypeOf(o,p){return(locale_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function locale_createSuper(Derived){var hasNativeReflectConstruct=function locale_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}}();return function _createSuperInternal(){var result,Super=locale_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=locale_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return locale_possibleConstructorReturn(this,result)}}function locale_possibleConstructorReturn(self,call){if(call&&("object"===locale_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function locale_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function locale_getPrototypeOf(o){return(locale_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}Monster.assignToNamespace("Monster.DOM",Updater),Monster.assignToNamespace("Monster.DOM",getLinkedObjects,addToObjectLink,(function removeObjectLink(element,symbol){return validateInstance(element,HTMLElement),validateSymbol(symbol),void 0===(null==element?void 0:element[symbol])||(removeAttributeToken(element,"data-monster-objectlink",symbol.toString()),delete element[symbol]),element}),findClosestByAttribute,hasObjectLink,(function clearAttributeTokens(element,key){return validateInstance(element,HTMLElement),validateString(key),element.hasAttribute(key)?(element.setAttribute(key,""),element):element}),(function replaceAttributeToken(element,key,from,to){return validateInstance(element,HTMLElement),validateString(from),validateString(to),validateString(key),element.hasAttribute(key)?(element.setAttribute(key,new TokenList(element.getAttribute(key)).replace(from,to).toString()),element):element}),containsAttributeToken,removeAttributeToken,addAttributeToken,(function toggleAttributeToken(element,key,token){return validateInstance(element,HTMLElement),validateString(token),validateString(key),element.hasAttribute(key)?(element.setAttribute(key,new TokenList(element.getAttribute(key)).toggle(token).toString()),element):(element.setAttribute(key,token),element)}));var propertiesSymbol=Symbol("properties"),localeStringSymbol=Symbol("localeString"),Locale=function(_Base){!function locale_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&locale_setPrototypeOf(subClass,superClass)}(Locale,_Base);var _super=locale_createSuper(Locale);function Locale(language,region,script,variants,extlang,privateUse){var _this;!function locale_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Locale),(_this=_super.call(this))[propertiesSymbol]={language:void 0===language?void 0:validateString(language),script:void 0===script?void 0:validateString(script),region:void 0===region?void 0:validateString(region),variants:void 0===variants?void 0:validateString(variants),extlang:void 0===extlang?void 0:validateString(extlang),privateUse:void 0===privateUse?void 0:validateString(privateUse)};var s=[];if(void 0!==language&&s.push(language),void 0!==script&&s.push(script),void 0!==region&&s.push(region),void 0!==variants&&s.push(variants),void 0!==extlang&&s.push(extlang),void 0!==privateUse&&s.push(privateUse),0===s.length)throw new Error("unsupported locale");return _this[localeStringSymbol]=s.join("-"),_this}return function locale_createClass(Constructor,protoProps,staticProps){return protoProps&&locale_defineProperties(Constructor.prototype,protoProps),staticProps&&locale_defineProperties(Constructor,staticProps),Constructor}(Locale,[{key:"localeString",get:function get(){return this[localeStringSymbol]}},{key:"language",get:function get(){return this[propertiesSymbol].language}},{key:"region",get:function get(){return this[propertiesSymbol].region}},{key:"script",get:function get(){return this[propertiesSymbol].script}},{key:"variants",get:function get(){return this[propertiesSymbol].variants}},{key:"extlang",get:function get(){return this[propertiesSymbol].extlang}},{key:"privateUse",get:function get(){return this[propertiesSymbol].privateValue}},{key:"toString",value:function toString(){return""+this.localeString}},{key:"getMap",value:function getMap(){return clone(this[propertiesSymbol])}}]),Locale}(Base);function parseLocale(locale){locale=validateString(locale).replace(/_/g,"-");var language,region,variants,parts,script,extlang,match,regex=new RegExp("^(((en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang))|((([A-Za-z]{2,3}(-([A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4}|[A-Za-z]{5,8})(-([A-Za-z]{4}))?(-([A-Za-z]{2}|[0-9]{3}))?(-([A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-([0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(x(-[A-Za-z0-9]{1,8})+))?)|(x(-[A-Za-z0-9]{1,8})+))$");if(null!==(match=regex.exec(locale))&&match.index===regex.lastIndex&®ex.lastIndex++,null==match)throw new Error("unsupported locale");return void 0!==match[6]&&(parts=(language=match[6]).split("-")).length>1&&(language=parts[0],extlang=parts[1]),void 0!==match[14]&&(region=match[14]),void 0!==match[12]&&(script=match[12]),void 0!==match[16]&&(variants=match[16]),new Locale(language,region,script,variants,extlang)}Monster.assignToNamespace("Monster.I18n",Locale,parseLocale);function extend(){for(var o={},i=0;i<arguments.length;i++)if(isObject(o))for(var k in arguments[i])arguments[i].hasOwnProperty(k)&&(o[k]=isObject(arguments[i][k])?extend(o[k]||{},arguments[i][k]):arguments[i][k]);return o}Monster.assignToNamespace("Monster.DOM",(function getLocaleOfDocument(){var html=getDocument().querySelector("html");if(html instanceof HTMLElement&&html.hasAttribute("lang")){var locale=html.getAttribute("lang");if(locale)return new parseLocale(locale)}return parseLocale("en")})),Monster.assignToNamespace("Monster.Data",extend);function customelement_typeof(obj){return(customelement_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function customelement_slicedToArray(arr,i){return function customelement_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function customelement_iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||customelement_unsupportedIterableToArray(arr,i)||function customelement_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function customelement_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=customelement_unsupportedIterableToArray(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e2){throw _e2},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e3){didErr=!0,err=_e3},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function customelement_unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return customelement_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?customelement_arrayLikeToArray(o,minLen):void 0}}function customelement_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function customelement_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function customelement_possibleConstructorReturn(self,call){if(call&&("object"===customelement_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return customelement_assertThisInitialized(self)}function customelement_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function customelement_wrapNativeSuper(Class){var _cache="function"==typeof Map?new Map:void 0;return(customelement_wrapNativeSuper=function _wrapNativeSuper(Class){if(null===Class||!function customelement_isNativeFunction(fn){return-1!==Function.toString.call(fn).indexOf("[native code]")}(Class))return Class;if("function"!=typeof Class)throw new TypeError("Super expression must either be null or a function");if(void 0!==_cache){if(_cache.has(Class))return _cache.get(Class);_cache.set(Class,Wrapper)}function Wrapper(){return customelement_construct(Class,arguments,customelement_getPrototypeOf(this).constructor)}return Wrapper.prototype=Object.create(Class.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),customelement_setPrototypeOf(Wrapper,Class)})(Class)}function customelement_construct(Parent,args,Class){return(customelement_construct=customelement_isNativeReflectConstruct()?Reflect.construct:function _construct(Parent,args,Class){var a=[null];a.push.apply(a,args);var instance=new(Function.bind.apply(Parent,a));return Class&&customelement_setPrototypeOf(instance,Class.prototype),instance}).apply(null,arguments)}function customelement_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 customelement_setPrototypeOf(o,p){return(customelement_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function customelement_getPrototypeOf(o){return(customelement_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}var optionsSymbol=Symbol.for("monsterOptions"),objectLinkSymbol=Symbol.for("monsterUpdater"),initMethodSymbol=Symbol("initMethodSymbol"),assembleMethodSymbol=Symbol("assembleMethodSymbol"),CustomElement=function(_HTMLElement){!function customelement_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&customelement_setPrototypeOf(subClass,superClass)}(CustomElement,_HTMLElement);var _super=function customelement_createSuper(Derived){var hasNativeReflectConstruct=customelement_isNativeReflectConstruct();return function _createSuperInternal(){var result,Super=customelement_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=customelement_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return customelement_possibleConstructorReturn(this,result)}}(CustomElement);function CustomElement(){var _this;return function customelement_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,CustomElement),(_this=_super.call(this))[optionsSymbol]=extend({},_this.defaults,getOptionsFromAttributes.call(customelement_assertThisInitialized(_this))),_this[initMethodSymbol](),_this}return function customelement_createClass(Constructor,protoProps,staticProps){return protoProps&&customelement_defineProperties(Constructor.prototype,protoProps),staticProps&&customelement_defineProperties(Constructor,staticProps),Constructor}(CustomElement,[{key:"defaults",get:function get(){return{shadowMode:"open",delegatesFocus:!0,templates:{main:void 0}}}},{key:"getOption",value:function getOption(path,defaultValue){var value;try{value=new Pathfinder(this[optionsSymbol]).getVia(path)}catch(e){}return void 0===value?defaultValue:value}},{key:"setOption",value:function setOption(path,value){var _step,_iterator=customelement_createForOfIteratorHelper(getLinkedObjects(this,Symbol.for("monsterUpdater")));try{for(_iterator.s();!(_step=_iterator.n()).done;){var _step2,_iterator2=customelement_createForOfIteratorHelper(_step.value);try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var updater=_step2.value;new Pathfinder(this[optionsSymbol]).setVia(path,!1),new Pathfinder(updater.getSubject()).setVia(path,value)}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}}}catch(err){_iterator.e(err)}finally{_iterator.f()}return this}},{key:initMethodSymbol,value:function value(){return this}},{key:assembleMethodSymbol,value:function value(){var elements,_this2=this;if(!1!==this.getOption("shadowMode",!1))try{initShadowRoot.call(this),elements=this.shadowRoot.childNodes}catch(e){}elements instanceof NodeList||(initHtmlContent.call(this),elements=this.childNodes);var updater=new Set;addToObjectLink(this,objectLinkSymbol,updater);for(var _loop=function _loop(){var element=customelement_slicedToArray(_Object$entries[_i],2)[1];if(!(element instanceof HTMLElement))return"continue";var u=new Updater(element,_this2[optionsSymbol]);updater.add(u),u.run().then((function(){u.enableEventProcessing()}))},_i=0,_Object$entries=Object.entries(elements);_i<_Object$entries.length;_i++)_loop();return this}},{key:"connectedCallback",value:function connectedCallback(){var self=this;hasObjectLink(self,objectLinkSymbol)||setTimeout((function(){self[assembleMethodSymbol]()}),0)}},{key:"disconnectedCallback",value:function disconnectedCallback(){}},{key:"adoptedCallback",value:function adoptedCallback(){}},{key:"attributeChangedCallback",value:function attributeChangedCallback(attrName,oldVal,newVal){}}],[{key:"getTag",value:function getTag(){throw new Error("the method getTag must be overwritten by the derived class.")}},{key:"getCSSStyleSheet",value:function getCSSStyleSheet(){}}]),CustomElement}(customelement_wrapNativeSuper(HTMLElement));function getOptionsFromAttributes(){if(this.hasAttribute("data-monster-options"))try{var obj=JSON.parse(this.getAttribute("data-monster-options"));return validateObject(obj),obj}catch(e){throw new Error("the options attribute data-monster-options does not contain a valid json definition (actual: "+this.getAttribute("data-monster-options")+").")}return{}}function initHtmlContent(){try{var template=findDocumentTemplate(this.constructor.getTag());this.appendChild(template.createDocumentFragment())}catch(e){var html=this.getOption("templates.main","");isString(html)&&html.length>0&&(this.innerHTML=html)}return this}function initShadowRoot(){var template,html;try{template=findDocumentTemplate(this.constructor.getTag())}catch(e){if(!isString(html=this.getOption("templates.main",""))||void 0===html||""===html)throw new Error("html is not set.")}this.attachShadow({mode:this.getOption("shadowMode","open"),delegatesFocus:this.getOption("delegatesFocus",!0)});var styleSheet=this.constructor.getCSSStyleSheet();return styleSheet instanceof CSSStyleSheet&&(this.shadowRoot.adoptedStyleSheets=[styleSheet]),template instanceof Template?(this.shadowRoot.appendChild(template.createDocumentFragment()),this):(this.shadowRoot.innerHTML=html,this)}function customcontrol_typeof(obj){return(customcontrol_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function customcontrol_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function customcontrol_get(target,property,receiver){return(customcontrol_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(target,property,receiver){var base=function customcontrol_superPropBase(object,property){for(;!Object.prototype.hasOwnProperty.call(object,property)&&null!==(object=customcontrol_getPrototypeOf(object)););return object}(target,property);if(base){var desc=Object.getOwnPropertyDescriptor(base,property);return desc.get?desc.get.call(receiver):desc.value}})(target,property,receiver||target)}function customcontrol_setPrototypeOf(o,p){return(customcontrol_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function customcontrol_createSuper(Derived){var hasNativeReflectConstruct=function customcontrol_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}}();return function _createSuperInternal(){var result,Super=customcontrol_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=customcontrol_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return customcontrol_possibleConstructorReturn(this,result)}}function customcontrol_possibleConstructorReturn(self,call){if(call&&("object"===customcontrol_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function customcontrol_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function customcontrol_getPrototypeOf(o){return(customcontrol_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}Monster.assignToNamespace("Monster.DOM",CustomElement,(function registerCustomElement(element){validateFunction(element),getGlobalObject("customElements").define(element.getTag(),element)}));var internalSymbol=Symbol("internalSymbol"),CustomControl=function(_CustomElement){!function customcontrol_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&customcontrol_setPrototypeOf(subClass,superClass)}(CustomControl,_CustomElement);var _super=customcontrol_createSuper(CustomControl);function CustomControl(){var _this;return function customcontrol_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,CustomControl),"function"==typeof(_this=_super.call(this)).attachInternals&&!0===_this.getOption("formAssociated")&&(_this[internalSymbol]=_this.attachInternals()),_this}return function customcontrol_createClass(Constructor,protoProps,staticProps){return protoProps&&customcontrol_defineProperties(Constructor.prototype,protoProps),staticProps&&customcontrol_defineProperties(Constructor,staticProps),Constructor}(CustomControl,[{key:"defaults",get:function get(){return Object.assign({},customcontrol_get(customcontrol_getPrototypeOf(CustomControl.prototype),"defaults",this),{formAssociated:!0})}},{key:"attributeChangedCallback",value:function attributeChangedCallback(name,oldValue,newValue){var a=this.constructor.observedAttributes();if(!a||isArray(a)&&a.length>0)throw new Error("attributes but no handles have been defined")}},{key:"value",get:function get(){throw Error("the value getter must be overwritten by the derived class")},set:function set(value){throw Error("the value setter must be overwritten by the derived class")}},{key:"setFormValue",value:function setFormValue(value,state){getInternal.call(this).setFormValue(value,state)}},{key:"setValidity",value:function setValidity(flags,message,anchor){getInternal.call(this).setValidity(flags,message,anchor)}},{key:"checkValidity",value:function checkValidity(){var _getInternal$call;return null===(_getInternal$call=getInternal.call(this))||void 0===_getInternal$call?void 0:_getInternal$call.checkValidity()}},{key:"reportValidity",value:function reportValidity(){var _getInternal$call2;return null===(_getInternal$call2=getInternal.call(this))||void 0===_getInternal$call2?void 0:_getInternal$call2.reportValidity()}},{key:"labels",get:function get(){var _getInternal$call3;return null===(_getInternal$call3=getInternal.call(this))||void 0===_getInternal$call3?void 0:_getInternal$call3.labels}},{key:"name",get:function get(){return this.getAttribute("name")}},{key:"type",get:function get(){return this.constructor.getTag()}},{key:"validity",get:function get(){var _getInternal$call4;return null===(_getInternal$call4=getInternal.call(this))||void 0===_getInternal$call4?void 0:_getInternal$call4.validity}},{key:"validationMessage",get:function get(){var _getInternal$call5;return null===(_getInternal$call5=getInternal.call(this))||void 0===_getInternal$call5?void 0:_getInternal$call5.validationMessage}},{key:"willValidate",get:function get(){var _getInternal$call6;return null===(_getInternal$call6=getInternal.call(this))||void 0===_getInternal$call6?void 0:_getInternal$call6.willValidate}},{key:"states",get:function get(){var _getInternal$call7;return null===(_getInternal$call7=getInternal.call(this))||void 0===_getInternal$call7?void 0:_getInternal$call7.states}},{key:"form",get:function get(){var _getInternal$call8;return null===(_getInternal$call8=getInternal.call(this))||void 0===_getInternal$call8?void 0:_getInternal$call8.form}}],[{key:"observedAttributes",get:function get(){return[]}},{key:"formAssociated",get:function get(){return!0}}]),CustomControl}(CustomElement);function getInternal(){if(!(internalSymbol in this))throw new Error("the ElementInternals is not supported and a polyfill is necessary");return this[internalSymbol]}function assembler_typeof(obj){return(assembler_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function assembler_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function assembler_setPrototypeOf(o,p){return(assembler_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function assembler_createSuper(Derived){var hasNativeReflectConstruct=function assembler_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}}();return function _createSuperInternal(){var result,Super=assembler_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=assembler_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return assembler_possibleConstructorReturn(this,result)}}function assembler_possibleConstructorReturn(self,call){if(call&&("object"===assembler_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function assembler_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function assembler_getPrototypeOf(o){return(assembler_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}Monster.assignToNamespace("Monster.DOM",CustomControl);var Assembler=function(_Base){!function assembler_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&assembler_setPrototypeOf(subClass,superClass)}(Assembler,_Base);var _super=assembler_createSuper(Assembler);function Assembler(fragment){var _this;return function assembler_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Assembler),(_this=_super.call(this)).attributePrefix="data-monster-",validateInstance(fragment,getGlobalFunction("DocumentFragment")),_this.fragment=fragment,_this}return function assembler_createClass(Constructor,protoProps,staticProps){return protoProps&&assembler_defineProperties(Constructor.prototype,protoProps),staticProps&&assembler_defineProperties(Constructor,staticProps),Constructor}(Assembler,[{key:"setAttributePrefix",value:function setAttributePrefix(prefix){return validateString(prefix),this.attributePrefix=prefix,this}},{key:"getAttributePrefix",value:function getAttributePrefix(){return this.attributePrefix}},{key:"createDocumentFragment",value:function createDocumentFragment(data){return void 0===data&&(data=new ProxyObserver({})),validateInstance(data,ProxyObserver),this.fragment.cloneNode(!0)}}]),Assembler}(Base);function events_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function events_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return events_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return events_arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function events_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function basewithoptions_typeof(obj){return(basewithoptions_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function basewithoptions_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function basewithoptions_setPrototypeOf(o,p){return(basewithoptions_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function basewithoptions_createSuper(Derived){var hasNativeReflectConstruct=function basewithoptions_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}}();return function _createSuperInternal(){var result,Super=basewithoptions_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=basewithoptions_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return basewithoptions_possibleConstructorReturn(this,result)}}function basewithoptions_possibleConstructorReturn(self,call){if(call&&("object"===basewithoptions_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function basewithoptions_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function basewithoptions_getPrototypeOf(o){return(basewithoptions_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}Monster.assignToNamespace("Monster.DOM",Assembler),Monster.assignToNamespace("Monster.DOM",(function findTargetElementFromEvent(event,attributeName,attributeValue){if(validateInstance(event,Event),"function"!=typeof event.composedPath)throw new Error("unsupported event");var path=event.composedPath(),element=null==path?void 0:path[0];if(element instanceof HTMLElement)return findClosestByAttribute(element,attributeName,attributeValue)}),(function fireEvent(element,type){if(getDocument(),element instanceof HTMLElement){if("click"===type)return void element.click();var event=new Event(validateString(type),{bubbles:!0,cancelable:!0});element.dispatchEvent(event)}else{if(!(element instanceof HTMLCollection||element instanceof NodeList))throw new TypeError("value is not an instance of HTMLElement or HTMLCollection");var _step,_iterator=events_createForOfIteratorHelper(element);try{for(_iterator.s();!(_step=_iterator.n()).done;){fireEvent(_step.value,type)}}catch(err){_iterator.e(err)}finally{_iterator.f()}}}));var basewithoptions_optionsSymbol=Symbol.for("monsterOptions"),BaseWithOptions=function(_Base){!function basewithoptions_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&basewithoptions_setPrototypeOf(subClass,superClass)}(BaseWithOptions,_Base);var _super=basewithoptions_createSuper(BaseWithOptions);function BaseWithOptions(options){var _this;return function basewithoptions_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,BaseWithOptions),void 0===options&&(options={}),(_this=_super.call(this))[basewithoptions_optionsSymbol]=Object.assign({},_this.defaults,validateObject(options)),_this}return function basewithoptions_createClass(Constructor,protoProps,staticProps){return protoProps&&basewithoptions_defineProperties(Constructor.prototype,protoProps),staticProps&&basewithoptions_defineProperties(Constructor,staticProps),Constructor}(BaseWithOptions,[{key:"defaults",get:function get(){return{}}},{key:"getOption",value:function getOption(path,defaultValue){var value;try{value=new Pathfinder(this[basewithoptions_optionsSymbol]).getVia(path)}catch(e){}return void 0===value?defaultValue:value}}]),BaseWithOptions}(Base);function translations_typeof(obj){return(translations_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function translations_slicedToArray(arr,i){return function translations_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function translations_iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function translations_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return translations_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return translations_arrayLikeToArray(o,minLen)}(arr,i)||function translations_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function translations_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function translations_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function translations_setPrototypeOf(o,p){return(translations_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function translations_createSuper(Derived){var hasNativeReflectConstruct=function translations_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}}();return function _createSuperInternal(){var result,Super=translations_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=translations_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return translations_possibleConstructorReturn(this,result)}}function translations_possibleConstructorReturn(self,call){if(call&&("object"===translations_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function translations_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function translations_getPrototypeOf(o){return(translations_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}Monster.assignToNamespace("Monster.Types",BaseWithOptions);var Translations=function(_Base){!function translations_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&translations_setPrototypeOf(subClass,superClass)}(Translations,_Base);var _super=translations_createSuper(Translations);function Translations(locale){var _this;return function translations_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Translations),_this=_super.call(this),isString(locale)&&(locale=parseLocale(locale)),_this.locale=validateInstance(locale,Locale),_this.storage=new Map,_this}return function translations_createClass(Constructor,protoProps,staticProps){return protoProps&&translations_defineProperties(Constructor.prototype,protoProps),staticProps&&translations_defineProperties(Constructor,staticProps),Constructor}(Translations,[{key:"getText",value:function getText(key,defaultText){if(!this.storage.has(key)){if(void 0===defaultText)throw new Error("key "+key+" not found");return validateString(defaultText)}return isObject(this.storage.get(key))?this.getPluralRuleText(key,"other",defaultText):this.storage.get(key)}},{key:"getPluralRuleText",value:function getPluralRuleText(key,count,defaultText){if(!this.storage.has(key))return validateString(defaultText);var keyword,r=validateObject(this.storage.get(key));if(isString(count))keyword=count.toLocaleString();else{if(0===(count=validateInteger(count))&&r.hasOwnProperty("zero"))return validateString(r.zero);keyword=new Intl.PluralRules(this.locale.toString()).select(validateInteger(count))}return r.hasOwnProperty(keyword)?validateString(r[keyword]):r.hasOwnProperty(DEFAULT_KEY)?validateString(r[DEFAULT_KEY]):validateString(defaultText)}},{key:"setText",value:function setText(key,text){if(isString(text)||isObject(text))return this.storage.set(validateString(key),text),this;throw new TypeError("value is not a string or object")}},{key:"assignTranslations",value:function assignTranslations(translations){validateObject(translations);for(var _i=0,_Object$entries=Object.entries(translations);_i<_Object$entries.length;_i++){var _Object$entries$_i=translations_slicedToArray(_Object$entries[_i],2),k=_Object$entries$_i[0],v=_Object$entries$_i[1];this.setText(k,v)}return this}}]),Translations}(Base);function provider_typeof(obj){return(provider_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function provider_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function provider_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function provider_setPrototypeOf(o,p){return(provider_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function provider_createSuper(Derived){var hasNativeReflectConstruct=function provider_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}}();return function _createSuperInternal(){var result,Super=provider_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=provider_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return provider_possibleConstructorReturn(this,result)}}function provider_possibleConstructorReturn(self,call){if(call&&("object"===provider_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function provider_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function provider_getPrototypeOf(o){return(provider_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}Monster.assignToNamespace("Monster.I18n",Translations);var Provider=function(_BaseWithOptions){!function provider_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&provider_setPrototypeOf(subClass,superClass)}(Provider,_BaseWithOptions);var _super=provider_createSuper(Provider);function Provider(){return provider_classCallCheck(this,Provider),_super.apply(this,arguments)}return function provider_createClass(Constructor,protoProps,staticProps){return protoProps&&provider_defineProperties(Constructor.prototype,protoProps),staticProps&&provider_defineProperties(Constructor,staticProps),Constructor}(Provider,[{key:"getTranslations",value:function getTranslations(locale){return new Promise((function(resolve,reject){try{resolve(new Translations(locale))}catch(e){reject(e)}}))}}]),Provider}(BaseWithOptions);function fetch_typeof(obj){return(fetch_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function fetch_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function fetch_setPrototypeOf(o,p){return(fetch_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function fetch_createSuper(Derived){var hasNativeReflectConstruct=function fetch_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}}();return function _createSuperInternal(){var result,Super=fetch_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=fetch_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return fetch_possibleConstructorReturn(this,result)}}function fetch_possibleConstructorReturn(self,call){if(call&&("object"===fetch_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return fetch_assertThisInitialized(self)}function fetch_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function fetch_get(target,property,receiver){return(fetch_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(target,property,receiver){var base=function fetch_superPropBase(object,property){for(;!Object.prototype.hasOwnProperty.call(object,property)&&null!==(object=fetch_getPrototypeOf(object)););return object}(target,property);if(base){var desc=Object.getOwnPropertyDescriptor(base,property);return desc.get?desc.get.call(receiver):desc.value}})(target,property,receiver||target)}function fetch_getPrototypeOf(o){return(fetch_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}Monster.assignToNamespace("Monster.I18n",Provider);var fetch_optionsSymbol=Symbol.for("monsterOptions"),Fetch=function(_Provider){!function fetch_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&fetch_setPrototypeOf(subClass,superClass)}(Fetch,_Provider);var _super=fetch_createSuper(Fetch);function Fetch(url,options){var _thisSuper,_this;return function fetch_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Fetch),_this=_super.call(this,options),isInstance(url,URL)&&(url=url.toString()),void 0===options&&(options={}),validateString(url),_this.url=url,_this[fetch_optionsSymbol]=Object.assign({},fetch_get((_thisSuper=fetch_assertThisInitialized(_this),fetch_getPrototypeOf(Fetch.prototype)),"defaults",_thisSuper),_this.defaults,validateObject(options)),_this}return function fetch_createClass(Constructor,protoProps,staticProps){return protoProps&&fetch_defineProperties(Constructor.prototype,protoProps),staticProps&&fetch_defineProperties(Constructor,staticProps),Constructor}(Fetch,[{key:"defaults",get:function get(){return{fetch:{method:"GET",mode:"cors",cache:"no-cache",credentials:"omit",redirect:"follow",referrerPolicy:"no-referrer"}}}},{key:"getTranslations",value:function getTranslations(locale){isString(locale)&&(locale=parseLocale(locale));var formatter=new Formatter(locale.getMap());return getGlobalFunction("fetch")(formatter.format(this.url),this.getOption("fetch",{})).then((function(response){return response.json()})).then((function(data){return new Translations(locale).assignTranslations(data)}))}}]),Fetch}(Provider);function version_typeof(obj){return(version_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function version_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function version_setPrototypeOf(o,p){return(version_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function version_createSuper(Derived){var hasNativeReflectConstruct=function version_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}}();return function _createSuperInternal(){var result,Super=version_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=version_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return version_possibleConstructorReturn(this,result)}}function version_possibleConstructorReturn(self,call){if(call&&("object"===version_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function version_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function version_getPrototypeOf(o){return(version_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}Monster.assignToNamespace("Monster.I18n.Providers",Fetch),Monster.assignToNamespace("Monster.Types",(function typeOf(value){var type={}.toString.call(value).match(/\s([a-zA-Z]+)/)[1];if("Object"===type){var results=/^(class|function)\s+(\w+)/.exec(value.constructor.toString());type=results&&results.length>2?results[2]:""}return type.toLowerCase()}));var monsterVersion,Version=function(_Base){!function version_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&version_setPrototypeOf(subClass,superClass)}(Version,_Base);var _super=version_createSuper(Version);function Version(major,minor,patch){var _this;if(function version_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Version),_this=_super.call(this),"string"==typeof major&&void 0===minor&&void 0===patch){var parts=major.toString().split(".");major=parseInt(parts[0]||0),minor=parseInt(parts[1]||0),patch=parseInt(parts[2]||0)}if(void 0===major)throw new Error("major version is undefined");if(void 0===minor&&(minor=0),void 0===patch&&(patch=0),_this.major=parseInt(major),_this.minor=parseInt(minor),_this.patch=parseInt(patch),isNaN(_this.major))throw new Error("major is not a number");if(isNaN(_this.minor))throw new Error("minor is not a number");if(isNaN(_this.patch))throw new Error("patch is not a number");return _this}return function version_createClass(Constructor,protoProps,staticProps){return protoProps&&version_defineProperties(Constructor.prototype,protoProps),staticProps&&version_defineProperties(Constructor,staticProps),Constructor}(Version,[{key:"toString",value:function toString(){return this.major+"."+this.minor+"."+this.patch}},{key:"compareTo",value:function compareTo(version){if(version instanceof Version&&(version=version.toString()),"string"!=typeof version)throw new Error("type exception");if(version===this.toString())return 0;for(var a=[this.major,this.minor,this.patch],b=version.split("."),len=Math.max(a.length,b.length),i=0;i<len;i+=1){if(a[i]&&!b[i]&&parseInt(a[i])>0||parseInt(a[i])>parseInt(b[i]))return 1;if(b[i]&&!a[i]&&parseInt(b[i])>0||parseInt(a[i])<parseInt(b[i]))return-1}return 0}}]),Version}(Base);function random(min,max){if(void 0===min&&(min=0),void 0===max&&(max=MAX),max<min)throw new Error("max must be greater than min");return Math.round(create(min,max))}Monster.assignToNamespace("Monster.Types",Version),Monster.assignToNamespace("Monster",(function getVersion(){return monsterVersion instanceof Version?monsterVersion:monsterVersion=new Version("1.14.1")}));var MAX=1e9;function create(min,max){var crypt,globalReference=getGlobal();if(void 0===(crypt=(null==globalReference?void 0:globalReference.crypto)||(null==globalReference?void 0:globalReference.msCrypto)||(null==globalReference?void 0:globalReference.crypto)||void 0))throw new Error("missing crypt");var rval=0,range=max-min;if(range<2)throw new Error("the distance is too small to create a random number.");var bitsNeeded=Math.ceil(Math.log2(range));if(bitsNeeded>53)throw new Error("we cannot generate numbers larger than 53 bits.");var bytesNeeded=Math.ceil(bitsNeeded/8),mask=Math.pow(2,bitsNeeded)-1,byteArray=new Uint8Array(bytesNeeded);crypt.getRandomValues(byteArray);for(var p=8*(bytesNeeded-1),i=0;i<bytesNeeded;i++)rval+=byteArray[i]*Math.pow(2,p),p-=8;return(rval&=mask)>=range?create(min,max):min+rval}function randomid_typeof(obj){return(randomid_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function randomid_setPrototypeOf(o,p){return(randomid_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function randomid_createSuper(Derived){var hasNativeReflectConstruct=function randomid_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}}();return function _createSuperInternal(){var result,Super=randomid_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=randomid_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return randomid_possibleConstructorReturn(this,result)}}function randomid_possibleConstructorReturn(self,call){if(call&&("object"===randomid_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function randomid_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function randomid_getPrototypeOf(o){return(randomid_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}Math.log2=Math.log2||function(n){return Math.log(n)/Math.log(2)},Monster.assignToNamespace("Monster.Math",random);var randomid_internalCounter=0,RandomID=function(_ID){!function randomid_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&randomid_setPrototypeOf(subClass,superClass)}(RandomID,_ID);var _super=randomid_createSuper(RandomID);function RandomID(){var _this;return function randomid_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,RandomID),_this=_super.call(this),randomid_internalCounter+=1,_this.id=getGlobal().btoa(random(1,1e4)).replace(/=/g,"").replace(/^[0-9]+/,"X")+randomid_internalCounter,_this}return RandomID}(ID);function comparator_typeof(obj){return(comparator_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function comparator_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function comparator_setPrototypeOf(o,p){return(comparator_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function comparator_createSuper(Derived){var hasNativeReflectConstruct=function comparator_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}}();return function _createSuperInternal(){var result,Super=comparator_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=comparator_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return comparator_possibleConstructorReturn(this,result)}}function comparator_possibleConstructorReturn(self,call){if(call&&("object"===comparator_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function comparator_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function comparator_getPrototypeOf(o){return(comparator_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}Monster.assignToNamespace("Monster.Types",RandomID);var rootName,Comparator=function(_Base){!function comparator_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&comparator_setPrototypeOf(subClass,superClass)}(Comparator,_Base);var _super=comparator_createSuper(Comparator);function Comparator(callback){var _this;if(function comparator_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Comparator),_this=_super.call(this),isFunction(callback))_this.compare=callback;else{if(void 0!==callback)throw new TypeError("unsupported type");_this.compare=function(a,b){if(comparator_typeof(a)!==comparator_typeof(b))throw new TypeError("impractical comparison");return a===b?0:a<b?-1:1}}return _this}return function comparator_createClass(Constructor,protoProps,staticProps){return protoProps&&comparator_defineProperties(Constructor.prototype,protoProps),staticProps&&comparator_defineProperties(Constructor,staticProps),Constructor}(Comparator,[{key:"reverse",value:function reverse(){var original=this.compare;return this.compare=function(a,b){return original(b,a)},this}},{key:"equal",value:function equal(a,b){return 0===this.compare(a,b)}},{key:"greaterThan",value:function greaterThan(a,b){return this.compare(a,b)>0}},{key:"greaterThanOrEqual",value:function greaterThanOrEqual(a,b){return this.greaterThan(a,b)||this.equal(a,b)}},{key:"lessThanOrEqual",value:function lessThanOrEqual(a,b){return this.lessThan(a,b)||this.equal(a,b)}},{key:"lessThan",value:function lessThan(a,b){return this.compare(a,b)<0}}]),Comparator}(Base);function freeze_typeof(obj){return(freeze_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function freeze_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function freeze_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return freeze_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return freeze_arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function freeze_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function buildmap_typeof(obj){return(buildmap_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function buildmap_toConsumableArray(arr){return function buildmap_arrayWithoutHoles(arr){if(Array.isArray(arr))return buildmap_arrayLikeToArray(arr)}(arr)||function buildmap_iterableToArray(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}(arr)||function buildmap_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return buildmap_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return buildmap_arrayLikeToArray(o,minLen)}(arr)||function buildmap_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 buildmap_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function buildmap_wrapRegExp(){buildmap_wrapRegExp=function _wrapRegExp(re,groups){return new BabelRegExp(re,void 0,groups)};var _super=RegExp.prototype,_groups=new WeakMap;function BabelRegExp(re,flags,groups){var _this=new RegExp(re,flags);return _groups.set(_this,groups||_groups.get(re)),buildmap_setPrototypeOf(_this,BabelRegExp.prototype)}function buildGroups(result,re){var g=_groups.get(re);return Object.keys(g).reduce((function(groups,name){return groups[name]=result[g[name]],groups}),Object.create(null))}return buildmap_inherits(BabelRegExp,RegExp),BabelRegExp.prototype.exec=function(str){var result=_super.exec.call(this,str);return result&&(result.groups=buildGroups(result,this)),result},BabelRegExp.prototype[Symbol.replace]=function(str,substitution){if("string"==typeof substitution){var groups=_groups.get(this);return _super[Symbol.replace].call(this,str,substitution.replace(/\$<([^>]+)>/g,(function(_,name){return"$"+groups[name]})))}if("function"==typeof substitution){var _this=this;return _super[Symbol.replace].call(this,str,(function(){var args=arguments;return"object"!==buildmap_typeof(args[args.length-1])&&(args=[].slice.call(args)).push(buildGroups(args,_this)),substitution.apply(this,args)}))}return _super[Symbol.replace].call(this,str,substitution)},buildmap_wrapRegExp.apply(this,arguments)}function buildmap_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&buildmap_setPrototypeOf(subClass,superClass)}function buildmap_setPrototypeOf(o,p){return(buildmap_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function build(subject,definition,defaultValue){if(void 0===definition)return defaultValue||subject;validateString(definition);var regexp=buildmap_wrapRegExp(/(\$\{([\.-_a-z]*)\})/gm,{placeholder:1,path:2}),array=buildmap_toConsumableArray(definition.matchAll(regexp)),finder=new Pathfinder(subject);return 0===array.length?finder.getVia(definition):(array.forEach((function(a){var groups=null==a?void 0:a.groups,placeholder=null==groups?void 0:groups.placeholder;if(void 0!==placeholder){var path=null==groups?void 0:groups.path,v=finder.getVia(path);definition=definition.replaceAll(placeholder,v)}})),definition)}Monster.assignToNamespace("Monster.Util",Comparator),Monster.assignToNamespace("Monster.Util",(function deepFreeze(object){validateObject(object);var _step,_iterator=freeze_createForOfIteratorHelper(Object.getOwnPropertyNames(object));try{for(_iterator.s();!(_step=_iterator.n()).done;){var name=_step.value,value=object[name];object[name]=value&&"object"===freeze_typeof(value)?deepFreeze(value):value}}catch(err){_iterator.e(err)}finally{_iterator.f()}return Object.freeze(object)})),Monster.assignToNamespace("Monster.Data",(function buildMap(subject,selector,valuePath,keyPath,filter){validateString(selector);var result=new Map,map=new Pathfinder(subject).getVia(selector);return map instanceof Map?(map.forEach((function(v,k,m){isFunction(filter)&&!0!==filter.call(m,v,k)||(k=build(v,keyPath,k),v=build(v,valuePath),result.set(k,v))})),result):result})),
|
1
|
+
/** Monster 1.15.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
|
2
|
+
!function webpackUniversalModuleDefinition(root,factory){"object"==typeof exports&&"object"==typeof module?module.exports=factory():"function"==typeof define&&define.amd?define([],factory):"object"==typeof exports?exports.window=factory():root.window=factory()}(self,(function(){return function(){var __webpack_modules__={64:function(){}},__webpack_module_cache__={};function __webpack_require__(moduleId){var cachedModule=__webpack_module_cache__[moduleId];if(void 0!==cachedModule)return cachedModule.exports;var module=__webpack_module_cache__[moduleId]={exports:{}};return __webpack_modules__[moduleId](module,module.exports,__webpack_require__),module.exports}__webpack_require__.d=function(exports,definition){for(var key in definition)__webpack_require__.o(definition,key)&&!__webpack_require__.o(exports,key)&&Object.defineProperty(exports,key,{enumerable:!0,get:definition[key]})},__webpack_require__.o=function(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)},__webpack_require__.r=function(exports){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(exports,"__esModule",{value:!0})};var __webpack_exports__={};return function(){function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Monster:function(){return Monster}});var Namespace=function(){function Namespace(namespace){if(function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Namespace),void 0===namespace||"string"!=typeof namespace)throw new Error("namespace is not a string");this.namespace=namespace}return function _createClass(Constructor,protoProps,staticProps){return protoProps&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Constructor}(Namespace,[{key:"getNamespace",value:function getNamespace(){return this.namespace}},{key:"toString",value:function toString(){return this.getNamespace()}}]),Namespace}(),Monster=new Namespace("Monster");function assignToNamespace(ns){var current=namespaceFor(ns.split("."));if(0==(arguments.length<=1?0:arguments.length-1))throw new Error("no functions have been passed.");for(var i=0,l=arguments.length<=1?0:arguments.length-1;i<l;i++)current[objectName(i+1<1||arguments.length<=i+1?void 0:arguments[i+1])]=i+1<1||arguments.length<=i+1?void 0:arguments[i+1];return current}function objectName(fn){try{if("function"!=typeof fn)throw new Error("the first argument is not a function or class.");if(fn.hasOwnProperty("name"))return fn.name;if("function"==typeof fn.toString){var s=fn.toString(),f=s.match(/^\s*function\s+([^\s(]+)/);if(Array.isArray(f)&&"string"==typeof f[1])return f[1];var c=s.match(/^\s*class\s+([^\s(]+)/);if(Array.isArray(c)&&"string"==typeof c[1])return c[1]}}catch(e){throw new Error("exception "+e)}throw new Error("the name of the class or function cannot be resolved.")}function namespaceFor(parts){for(var space=Monster,ns="Monster",i=0;i<parts.length;i++)"Monster"!==parts[i]&&(ns+="."+parts[i],space.hasOwnProperty(parts[i])||(space[parts[i]]=new Namespace(ns)),space=space[parts[i]]);return space}function _typeof(obj){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function base_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function base_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _possibleConstructorReturn(self,call){if(call&&("object"===_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function _wrapNativeSuper(Class){var _cache="function"==typeof Map?new Map:void 0;return(_wrapNativeSuper=function _wrapNativeSuper(Class){if(null===Class||!function _isNativeFunction(fn){return-1!==Function.toString.call(fn).indexOf("[native code]")}(Class))return Class;if("function"!=typeof Class)throw new TypeError("Super expression must either be null or a function");if(void 0!==_cache){if(_cache.has(Class))return _cache.get(Class);_cache.set(Class,Wrapper)}function Wrapper(){return _construct(Class,arguments,_getPrototypeOf(this).constructor)}return Wrapper.prototype=Object.create(Class.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(Wrapper,Class)})(Class)}function _construct(Parent,args,Class){return(_construct=_isNativeReflectConstruct()?Reflect.construct:function _construct(Parent,args,Class){var a=[null];a.push.apply(a,args);var instance=new(Function.bind.apply(Parent,a));return Class&&_setPrototypeOf(instance,Class.prototype),instance}).apply(null,arguments)}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 _setPrototypeOf(o,p){return(_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function _getPrototypeOf(o){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster",assignToNamespace);var Base=function(_Object){!function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_setPrototypeOf(subClass,superClass)}(Base,_Object);var _super=function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var result,Super=_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return _possibleConstructorReturn(this,result)}}(Base);function Base(){return base_classCallCheck(this,Base),_super.apply(this,arguments)}return function base_createClass(Constructor,protoProps,staticProps){return protoProps&&base_defineProperties(Constructor.prototype,protoProps),staticProps&&base_defineProperties(Constructor,staticProps),Constructor}(Base,[{key:"toString",value:function toString(){return JSON.stringify(this)}}]),Base}(_wrapNativeSuper(Object));function abstract_typeof(obj){return(abstract_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function abstract_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function abstract_setPrototypeOf(o,p){return(abstract_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function abstract_createSuper(Derived){var hasNativeReflectConstruct=function abstract_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}}();return function _createSuperInternal(){var result,Super=abstract_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=abstract_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return abstract_possibleConstructorReturn(this,result)}}function abstract_possibleConstructorReturn(self,call){if(call&&("object"===abstract_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function abstract_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function abstract_getPrototypeOf(o){return(abstract_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",Base);var AbstractConstraint=function(_Base){!function abstract_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&abstract_setPrototypeOf(subClass,superClass)}(AbstractConstraint,_Base);var _super=abstract_createSuper(AbstractConstraint);function AbstractConstraint(){return function abstract_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,AbstractConstraint),_super.call(this)}return function abstract_createClass(Constructor,protoProps,staticProps){return protoProps&&abstract_defineProperties(Constructor.prototype,protoProps),staticProps&&abstract_defineProperties(Constructor,staticProps),Constructor}(AbstractConstraint,[{key:"isValid",value:function isValid(value){return Promise.reject(value)}}]),AbstractConstraint}(Base);function is_typeof(obj){return(is_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function isIterable(value){return void 0!==value&&(null!==value&&"function"==typeof(null==value?void 0:value[Symbol.iterator]))}function isPrimitive(value){var type;return null==value||NaN===value||("string"===(type=is_typeof(value))||"number"===type||"boolean"===type||"symbol"===type)}function isSymbol(value){return"symbol"===is_typeof(value)}function isBoolean(value){return!0===value||!1===value}function isString(value){return void 0!==value&&"string"==typeof value}function isObject(value){return!isArray(value)&&(!isPrimitive(value)&&"object"===is_typeof(value))}function isInstance(value,instance){return!!isObject(value)&&(!!isFunction(instance)&&(!!instance.hasOwnProperty("prototype")&&value instanceof instance))}function isArray(value){return!!Array.isArray(value)}function isFunction(value){return!isArray(value)&&(!isPrimitive(value)&&"function"==typeof value)}function isInteger(value){return Number.isInteger(value)}function isobject_typeof(obj){return(isobject_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function isobject_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function isobject_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function isobject_setPrototypeOf(o,p){return(isobject_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function isobject_createSuper(Derived){var hasNativeReflectConstruct=function isobject_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}}();return function _createSuperInternal(){var result,Super=isobject_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=isobject_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return isobject_possibleConstructorReturn(this,result)}}function isobject_possibleConstructorReturn(self,call){if(call&&("object"===isobject_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function isobject_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function isobject_getPrototypeOf(o){return(isobject_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function valid_typeof(obj){return(valid_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function valid_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function valid_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function valid_setPrototypeOf(o,p){return(valid_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function valid_createSuper(Derived){var hasNativeReflectConstruct=function valid_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}}();return function _createSuperInternal(){var result,Super=valid_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=valid_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return valid_possibleConstructorReturn(this,result)}}function valid_possibleConstructorReturn(self,call){if(call&&("object"===valid_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function valid_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function valid_getPrototypeOf(o){return(valid_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function invalid_typeof(obj){return(invalid_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function invalid_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function invalid_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function invalid_setPrototypeOf(o,p){return(invalid_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function invalid_createSuper(Derived){var hasNativeReflectConstruct=function invalid_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}}();return function _createSuperInternal(){var result,Super=invalid_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=invalid_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return invalid_possibleConstructorReturn(this,result)}}function invalid_possibleConstructorReturn(self,call){if(call&&("object"===invalid_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function invalid_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function invalid_getPrototypeOf(o){return(invalid_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function abstractoperator_typeof(obj){return(abstractoperator_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function abstractoperator_setPrototypeOf(o,p){return(abstractoperator_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function abstractoperator_createSuper(Derived){var hasNativeReflectConstruct=function abstractoperator_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}}();return function _createSuperInternal(){var result,Super=abstractoperator_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=abstractoperator_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return abstractoperator_possibleConstructorReturn(this,result)}}function abstractoperator_possibleConstructorReturn(self,call){if(call&&("object"===abstractoperator_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function abstractoperator_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function abstractoperator_getPrototypeOf(o){return(abstractoperator_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Constraints",AbstractConstraint),assignToNamespace("Monster.Types",isPrimitive,isBoolean,isString,isObject,isArray,isFunction,isIterable,isInteger,isSymbol),assignToNamespace("Monster.Constraints",function(_AbstractConstraint){!function isobject_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&isobject_setPrototypeOf(subClass,superClass)}(IsObject,_AbstractConstraint);var _super=isobject_createSuper(IsObject);function IsObject(){return isobject_classCallCheck(this,IsObject),_super.apply(this,arguments)}return function isobject_createClass(Constructor,protoProps,staticProps){return protoProps&&isobject_defineProperties(Constructor.prototype,protoProps),staticProps&&isobject_defineProperties(Constructor,staticProps),Constructor}(IsObject,[{key:"isValid",value:function isValid(value){return isObject(value)?Promise.resolve(value):Promise.reject(value)}}]),IsObject}(AbstractConstraint)),assignToNamespace("Monster.Constraints",function(_AbstractConstraint){!function valid_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&valid_setPrototypeOf(subClass,superClass)}(Valid,_AbstractConstraint);var _super=valid_createSuper(Valid);function Valid(){return valid_classCallCheck(this,Valid),_super.apply(this,arguments)}return function valid_createClass(Constructor,protoProps,staticProps){return protoProps&&valid_defineProperties(Constructor.prototype,protoProps),staticProps&&valid_defineProperties(Constructor,staticProps),Constructor}(Valid,[{key:"isValid",value:function isValid(value){return Promise.resolve(value)}}]),Valid}(AbstractConstraint)),assignToNamespace("Monster.Constraints",function(_AbstractConstraint){!function invalid_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&invalid_setPrototypeOf(subClass,superClass)}(Invalid,_AbstractConstraint);var _super=invalid_createSuper(Invalid);function Invalid(){return invalid_classCallCheck(this,Invalid),_super.apply(this,arguments)}return function invalid_createClass(Constructor,protoProps,staticProps){return protoProps&&invalid_defineProperties(Constructor.prototype,protoProps),staticProps&&invalid_defineProperties(Constructor,staticProps),Constructor}(Invalid,[{key:"isValid",value:function isValid(value){return Promise.reject(value)}}]),Invalid}(AbstractConstraint));var AbstractOperator=function(_AbstractConstraint){!function abstractoperator_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&abstractoperator_setPrototypeOf(subClass,superClass)}(AbstractOperator,_AbstractConstraint);var _super=abstractoperator_createSuper(AbstractOperator);function AbstractOperator(operantA,operantB){var _this;if(function abstractoperator_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,AbstractOperator),_this=_super.call(this),!(operantA instanceof AbstractConstraint&&operantB instanceof AbstractConstraint))throw new TypeError("parameters must be from type AbstractConstraint");return _this.operantA=operantA,_this.operantB=operantB,_this}return AbstractOperator}(AbstractConstraint);function oroperator_typeof(obj){return(oroperator_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function oroperator_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function oroperator_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function oroperator_setPrototypeOf(o,p){return(oroperator_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function oroperator_createSuper(Derived){var hasNativeReflectConstruct=function oroperator_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}}();return function _createSuperInternal(){var result,Super=oroperator_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=oroperator_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return oroperator_possibleConstructorReturn(this,result)}}function oroperator_possibleConstructorReturn(self,call){if(call&&("object"===oroperator_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function oroperator_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function oroperator_getPrototypeOf(o){return(oroperator_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function andoperator_typeof(obj){return(andoperator_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function andoperator_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function andoperator_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function andoperator_setPrototypeOf(o,p){return(andoperator_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function andoperator_createSuper(Derived){var hasNativeReflectConstruct=function andoperator_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}}();return function _createSuperInternal(){var result,Super=andoperator_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=andoperator_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return andoperator_possibleConstructorReturn(this,result)}}function andoperator_possibleConstructorReturn(self,call){if(call&&("object"===andoperator_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function andoperator_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function andoperator_getPrototypeOf(o){return(andoperator_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function isarray_typeof(obj){return(isarray_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function isarray_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function isarray_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function isarray_setPrototypeOf(o,p){return(isarray_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function isarray_createSuper(Derived){var hasNativeReflectConstruct=function isarray_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}}();return function _createSuperInternal(){var result,Super=isarray_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=isarray_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return isarray_possibleConstructorReturn(this,result)}}function isarray_possibleConstructorReturn(self,call){if(call&&("object"===isarray_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function isarray_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function isarray_getPrototypeOf(o){return(isarray_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function validatePrimitive(value){if(!isPrimitive(value))throw new TypeError("value is not a primitive");return value}function validateString(value){if(!isString(value))throw new TypeError("value is not a string");return value}function validateObject(value){if(!isObject(value))throw new TypeError("value is not a object");return value}function validateInstance(value,instance){if(!isInstance(value,instance)){var n="";throw(isObject(instance)||isFunction(instance))&&(n=null==instance?void 0:instance.name),n&&(n=" "+n),new TypeError("value is not an instance of"+n)}return value}function validateArray(value){if(!isArray(value))throw new TypeError("value is not an array");return value}function validateSymbol(value){if(!isSymbol(value))throw new TypeError("value is not an symbol");return value}function validateFunction(value){if(!isFunction(value))throw new TypeError("value is not a function");return value}function validateInteger(value){if(!isInteger(value))throw new TypeError("value is not an integer");return value}function logentry_typeof(obj){return(logentry_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function logentry_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function logentry_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function logentry_setPrototypeOf(o,p){return(logentry_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function logentry_createSuper(Derived){var hasNativeReflectConstruct=function logentry_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}}();return function _createSuperInternal(){var result,Super=logentry_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=logentry_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return logentry_possibleConstructorReturn(this,result)}}function logentry_possibleConstructorReturn(self,call){if(call&&("object"===logentry_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function logentry_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function logentry_getPrototypeOf(o){return(logentry_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Constraints",AbstractOperator),assignToNamespace("Monster.Constraints",function(_AbstractOperator){!function oroperator_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&oroperator_setPrototypeOf(subClass,superClass)}(OrOperator,_AbstractOperator);var _super=oroperator_createSuper(OrOperator);function OrOperator(){return oroperator_classCallCheck(this,OrOperator),_super.apply(this,arguments)}return function oroperator_createClass(Constructor,protoProps,staticProps){return protoProps&&oroperator_defineProperties(Constructor.prototype,protoProps),staticProps&&oroperator_defineProperties(Constructor,staticProps),Constructor}(OrOperator,[{key:"isValid",value:function isValid(value){var self=this;return new Promise((function(resolve,reject){var a,b;self.operantA.isValid(value).then((function(){resolve()})).catch((function(){a=!1,!1===b&&reject()})),self.operantB.isValid(value).then((function(){resolve()})).catch((function(){b=!1,!1===a&&reject()}))}))}}]),OrOperator}(AbstractOperator)),assignToNamespace("Monster.Constraints",function(_AbstractOperator){!function andoperator_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&andoperator_setPrototypeOf(subClass,superClass)}(AndOperator,_AbstractOperator);var _super=andoperator_createSuper(AndOperator);function AndOperator(){return andoperator_classCallCheck(this,AndOperator),_super.apply(this,arguments)}return function andoperator_createClass(Constructor,protoProps,staticProps){return protoProps&&andoperator_defineProperties(Constructor.prototype,protoProps),staticProps&&andoperator_defineProperties(Constructor,staticProps),Constructor}(AndOperator,[{key:"isValid",value:function isValid(value){return Promise.all([this.operantA.isValid(value),this.operantB.isValid(value)])}}]),AndOperator}(AbstractOperator)),assignToNamespace("Monster.Constraints",function(_AbstractConstraint){!function isarray_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&isarray_setPrototypeOf(subClass,superClass)}(IsArray,_AbstractConstraint);var _super=isarray_createSuper(IsArray);function IsArray(){return isarray_classCallCheck(this,IsArray),_super.apply(this,arguments)}return function isarray_createClass(Constructor,protoProps,staticProps){return protoProps&&isarray_defineProperties(Constructor.prototype,protoProps),staticProps&&isarray_defineProperties(Constructor,staticProps),Constructor}(IsArray,[{key:"isValid",value:function isValid(value){return isArray(value)?Promise.resolve(value):Promise.reject(value)}}]),IsArray}(AbstractConstraint)),assignToNamespace("Monster.Types",validatePrimitive,(function validateBoolean(value){if(!isBoolean(value))throw new TypeError("value is not a boolean");return value}),validateString,validateObject,validateArray,validateFunction,(function validateIterable(value){if(!isIterable(value))throw new TypeError("value is not iterable");return value}),validateInteger);var LogEntry=function(_Base){!function logentry_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&logentry_setPrototypeOf(subClass,superClass)}(LogEntry,_Base);var _super=logentry_createSuper(LogEntry);function LogEntry(loglevel){var _this;logentry_classCallCheck(this,LogEntry),_this=_super.call(this),validateInteger(loglevel),_this.loglevel=loglevel;for(var _len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)args[_key-1]=arguments[_key];return _this.arguments=args,_this}return function logentry_createClass(Constructor,protoProps,staticProps){return protoProps&&logentry_defineProperties(Constructor.prototype,protoProps),staticProps&&logentry_defineProperties(Constructor,staticProps),Constructor}(LogEntry,[{key:"getLogLevel",value:function getLogLevel(){return this.loglevel}},{key:"getArguments",value:function getArguments(){return this.arguments}}]),LogEntry}(Base);function handler_typeof(obj){return(handler_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function handler_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function handler_setPrototypeOf(o,p){return(handler_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function handler_createSuper(Derived){var hasNativeReflectConstruct=function handler_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}}();return function _createSuperInternal(){var result,Super=handler_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=handler_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return handler_possibleConstructorReturn(this,result)}}function handler_possibleConstructorReturn(self,call){if(call&&("object"===handler_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function handler_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function handler_getPrototypeOf(o){return(handler_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Logging",LogEntry);var Handler=function(_Base){!function handler_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&handler_setPrototypeOf(subClass,superClass)}(Handler,_Base);var _super=handler_createSuper(Handler);function Handler(){var _this;return function handler_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Handler),(_this=_super.call(this)).loglevel=OFF,_this}return function handler_createClass(Constructor,protoProps,staticProps){return protoProps&&handler_defineProperties(Constructor.prototype,protoProps),staticProps&&handler_defineProperties(Constructor,staticProps),Constructor}(Handler,[{key:"log",value:function log(entry){return validateInstance(entry,LogEntry),!(this.loglevel<entry.getLogLevel())}},{key:"setLogLevel",value:function setLogLevel(loglevel){return validateInteger(loglevel),this.loglevel=loglevel,this}},{key:"getLogLevel",value:function getLogLevel(){return this.loglevel}},{key:"setAll",value:function setAll(){return this.setLogLevel(ALL),this}},{key:"setTrace",value:function setTrace(){return this.setLogLevel(TRACE),this}},{key:"setDebug",value:function setDebug(){return this.setLogLevel(DEBUG),this}},{key:"setInfo",value:function setInfo(){return this.setLogLevel(INFO),this}},{key:"setWarn",value:function setWarn(){return this.setLogLevel(WARN),this}},{key:"setError",value:function setError(){return this.setLogLevel(ERROR),this}},{key:"setFatal",value:function setFatal(){return this.setLogLevel(FATAL),this}},{key:"setOff",value:function setOff(){return this.setLogLevel(OFF),this}}]),Handler}(Base);function logger_typeof(obj){return(logger_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function _createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function _unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function logger_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function logger_setPrototypeOf(o,p){return(logger_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function logger_createSuper(Derived){var hasNativeReflectConstruct=function logger_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}}();return function _createSuperInternal(){var result,Super=logger_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=logger_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return logger_possibleConstructorReturn(this,result)}}function logger_possibleConstructorReturn(self,call){if(call&&("object"===logger_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function logger_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function logger_getPrototypeOf(o){return(logger_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Logging",Handler);var ALL=255,TRACE=64,DEBUG=32,INFO=16,WARN=8,ERROR=4,FATAL=2,OFF=0;function triggerLog(loglevel){for(var logger=this,_len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)args[_key-1]=arguments[_key];var _step,_iterator=_createForOfIteratorHelper(logger.handler);try{for(_iterator.s();!(_step=_iterator.n()).done;){var handler=_step.value;handler.log(new LogEntry(loglevel,args))}}catch(err){_iterator.e(err)}finally{_iterator.f()}return logger}assignToNamespace("Monster.Logging",function(_Base){!function logger_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&logger_setPrototypeOf(subClass,superClass)}(Logger,_Base);var _super=logger_createSuper(Logger);function Logger(){var _this;return function logger_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Logger),(_this=_super.call(this)).handler=new Set,_this}return function logger_createClass(Constructor,protoProps,staticProps){return protoProps&&logger_defineProperties(Constructor.prototype,protoProps),staticProps&&logger_defineProperties(Constructor,staticProps),Constructor}(Logger,[{key:"addHandler",value:function addHandler(handler){if(validateObject(handler),!(handler instanceof Handler))throw new Error("the handler must be an instance of Handler");return this.handler.add(handler),this}},{key:"removeHandler",value:function removeHandler(handler){if(validateObject(handler),!(handler instanceof Handler))throw new Error("the handler must be an instance of Handler");return this.handler.delete(handler),this}},{key:"logTrace",value:function logTrace(){return triggerLog.apply(this,[TRACE].concat(Array.prototype.slice.call(arguments))),this}},{key:"logDebug",value:function logDebug(){return triggerLog.apply(this,[DEBUG].concat(Array.prototype.slice.call(arguments))),this}},{key:"logInfo",value:function logInfo(){return triggerLog.apply(this,[INFO].concat(Array.prototype.slice.call(arguments))),this}},{key:"logWarn",value:function logWarn(){return triggerLog.apply(this,[WARN].concat(Array.prototype.slice.call(arguments))),this}},{key:"logError",value:function logError(){return triggerLog.apply(this,[ERROR].concat(Array.prototype.slice.call(arguments))),this}},{key:"logFatal",value:function logFatal(){return triggerLog.apply(this,[FATAL].concat(Array.prototype.slice.call(arguments))),this}},{key:"getLabel",value:function getLabel(level){return validateInteger(level),level===ALL?"ALL":level===TRACE?"TRACE":level===DEBUG?"DEBUG":level===INFO?"INFO":level===WARN?"WARN":level===ERROR?"ERROR":level===FATAL?"FATAL":level===OFF?"OFF":"unknown"}},{key:"getLevel",value:function getLevel(label){return validateString(label),"ALL"===label?ALL:"TRACE"===label?TRACE:"DEBUG"===label?DEBUG:"INFO"===label?INFO:"WARN"===label?WARN:"ERROR"===label?ERROR:"FATAL"===label?FATAL:"OFF"===label?OFF:0}}]),Logger}(Base));var namespace=__webpack_require__(64);function console_typeof(obj){return(console_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function console_setPrototypeOf(o,p){return(console_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function console_createSuper(Derived){var hasNativeReflectConstruct=function console_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}}();return function _createSuperInternal(){var result,Super=console_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=console_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return console_possibleConstructorReturn(this,result)}}function console_possibleConstructorReturn(self,call){if(call&&("object"===console_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function console_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function console_getPrototypeOf(o){return(console_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}var globalReference,ConsoleHandler=function(_Base){!function console_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&console_setPrototypeOf(subClass,superClass)}(ConsoleHandler,_Base);var _super=console_createSuper(ConsoleHandler);function ConsoleHandler(){return function console_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ConsoleHandler),_super.call(this)}return ConsoleHandler}(Base);function global_typeof(obj){return(global_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function getGlobal(){return globalReference}function getGlobalObject(name){var _globalReference;validateString(name);var o=null===(_globalReference=globalReference)||void 0===_globalReference?void 0:_globalReference[name];if(void 0===o)throw new Error("the object "+name+" is not defined");return validateObject(o),o}function getGlobalFunction(name){var _globalReference2;validateString(name);var f=null===(_globalReference2=globalReference)||void 0===_globalReference2?void 0:_globalReference2[name];if(void 0===f)throw new Error("the function "+name+" is not defined");return validateFunction(f),f}function id_typeof(obj){return(id_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function id_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function id_setPrototypeOf(o,p){return(id_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function id_createSuper(Derived){var hasNativeReflectConstruct=function id_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}}();return function _createSuperInternal(){var result,Super=id_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=id_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return id_possibleConstructorReturn(this,result)}}function id_possibleConstructorReturn(self,call){if(call&&("object"===id_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function id_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function id_getPrototypeOf(o){return(id_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}(0,namespace.assignToNamespace)("Monster.Logging",ConsoleHandler),function(){if("object"!==("undefined"==typeof globalThis?"undefined":global_typeof(globalThis)))if("undefined"==typeof self){if("undefined"==typeof window){if(Object.defineProperty(Object.prototype,"__monster__",{get:function get(){return this},configurable:!0}),"object"===("undefined"==typeof __monster__?"undefined":global_typeof(__monster__)))return __monster__.globalThis=__monster__,delete Object.prototype.__monster__,void(globalReference=globalThis);try{globalReference=Function("return this")()}catch(e){}throw new Error("unsupported environment.")}globalReference=window}else globalReference=self;else globalReference=globalThis}(),assignToNamespace("Monster.Types",getGlobal,getGlobalObject,getGlobalFunction);var internalCounter=new Map,ID=function(_Base){!function id_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&id_setPrototypeOf(subClass,superClass)}(ID,_Base);var _super=id_createSuper(ID);function ID(prefix){var _this;!function id_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ID),_this=_super.call(this),void 0===prefix&&(prefix="id"),validateString(prefix),internalCounter.has(prefix)||internalCounter.set(prefix,1);var count=internalCounter.get(prefix);return _this.id=prefix+count,internalCounter.set(prefix,++count),_this}return function id_createClass(Constructor,protoProps,staticProps){return protoProps&&id_defineProperties(Constructor.prototype,protoProps),staticProps&&id_defineProperties(Constructor,staticProps),Constructor}(ID,[{key:"toString",value:function toString(){return this.id}}]),ID}(Base);function clone_typeof(obj){return(clone_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function clone(obj){if(null===obj)return obj;if(isPrimitive(obj))return obj;if(isFunction(obj))return obj;if(isArray(obj)){for(var copy=[],i=0,len=obj.length;i<len;i++)copy[i]=clone(obj[i]);return copy}if(isObject(obj)){if(obj instanceof Date){var _copy=new Date;return _copy.setTime(obj.getTime()),_copy}if("undefined"!=typeof Element&&obj instanceof Element)return obj;if("undefined"!=typeof HTMLDocument&&obj instanceof HTMLDocument)return obj;if("undefined"!=typeof DocumentFragment&&obj instanceof DocumentFragment)return obj;if(obj===getGlobal())return obj;if("undefined"!=typeof globalContext&&obj===globalContext)return obj;if("undefined"!=typeof window&&obj===window)return obj;if("undefined"!=typeof document&&obj===document)return obj;if("undefined"!=typeof navigator&&obj===navigator)return obj;if("undefined"!=typeof JSON&&obj===JSON)return obj;try{if(obj instanceof Proxy)return obj}catch(e){}return function cloneObject(obj){var copy;if(clone_typeof(obj.hasOwnProperty("getClone"))&&"function"===obj.getClone)return obj.getClone();copy={},"function"==typeof obj.constructor&&"function"==typeof obj.constructor.call&&(copy=new obj.constructor);for(var key in obj)obj.hasOwnProperty(key)&&(Monster.Types.isPrimitive(obj[key])?copy[key]=obj[key]:copy[key]=clone(obj[key]));return copy}(obj)}throw new Error("unable to clone obj! its type isn't supported.")}function stack_typeof(obj){return(stack_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function stack_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function stack_setPrototypeOf(o,p){return(stack_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function stack_createSuper(Derived){var hasNativeReflectConstruct=function stack_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}}();return function _createSuperInternal(){var result,Super=stack_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=stack_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return stack_possibleConstructorReturn(this,result)}}function stack_possibleConstructorReturn(self,call){if(call&&("object"===stack_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function stack_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function stack_getPrototypeOf(o){return(stack_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",ID),assignToNamespace("Monster.Util",clone);var Stack=function(_Base){!function stack_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&stack_setPrototypeOf(subClass,superClass)}(Stack,_Base);var _super=stack_createSuper(Stack);function Stack(){var _this;return function stack_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Stack),(_this=_super.call(this)).data=[],_this}return function stack_createClass(Constructor,protoProps,staticProps){return protoProps&&stack_defineProperties(Constructor.prototype,protoProps),staticProps&&stack_defineProperties(Constructor,staticProps),Constructor}(Stack,[{key:"isEmpty",value:function isEmpty(){return 0===this.data.length}},{key:"peek",value:function peek(){var _this$data;if(!this.isEmpty())return null===(_this$data=this.data)||void 0===_this$data?void 0:_this$data[this.data.length-1]}},{key:"push",value:function push(value){return this.data.push(value),this}},{key:"clear",value:function clear(){return this.data=[],this}},{key:"pop",value:function pop(){if(!this.isEmpty())return this.data.pop()}}]),Stack}(Base);function pathfinder_typeof(obj){return(pathfinder_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function _toConsumableArray(arr){return function _arrayWithoutHoles(arr){if(Array.isArray(arr))return pathfinder_arrayLikeToArray(arr)}(arr)||function _iterableToArray(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}(arr)||pathfinder_unsupportedIterableToArray(arr)||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 _slicedToArray(arr,i){return function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function _iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||pathfinder_unsupportedIterableToArray(arr,i)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pathfinder_unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return pathfinder_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pathfinder_arrayLikeToArray(o,minLen):void 0}}function pathfinder_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function pathfinder_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function pathfinder_setPrototypeOf(o,p){return(pathfinder_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function pathfinder_createSuper(Derived){var hasNativeReflectConstruct=function pathfinder_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}}();return function _createSuperInternal(){var result,Super=pathfinder_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=pathfinder_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return pathfinder_possibleConstructorReturn(this,result)}}function pathfinder_possibleConstructorReturn(self,call){if(call&&("object"===pathfinder_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function pathfinder_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function pathfinder_getPrototypeOf(o){return(pathfinder_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",Stack);var Pathfinder=function(_Base){!function pathfinder_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&pathfinder_setPrototypeOf(subClass,superClass)}(Pathfinder,_Base);var _super=pathfinder_createSuper(Pathfinder);function Pathfinder(object){var _this;return function pathfinder_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Pathfinder),(_this=_super.call(this)).object=object,_this.wildCard="*",_this}return function pathfinder_createClass(Constructor,protoProps,staticProps){return protoProps&&pathfinder_defineProperties(Constructor.prototype,protoProps),staticProps&&pathfinder_defineProperties(Constructor,staticProps),Constructor}(Pathfinder,[{key:"setWildCard",value:function setWildCard(wildcard){return validateString(wildcard),this.wildCard=wildcard,this}},{key:"getVia",value:function getVia(path){return getValueViaPath.call(this,this.object,validateString(path))}},{key:"setVia",value:function setVia(path,value){return validateString(path),setValueViaPath.call(this,this.object,path,value),this}},{key:"deleteVia",value:function deleteVia(path){return validateString(path),deleteValueViaPath.call(this,this.object,path),this}},{key:"exists",value:function exists(path){validateString(path);try{return getValueViaPath.call(this,this.object,path,!0),!0}catch(e){}return!1}}]),Pathfinder}(Base);function iterate(subject,path,check){var result=new Map;if(isObject(subject)||isArray(subject))for(var _i=0,_Object$entries=Object.entries(subject);_i<_Object$entries.length;_i++){var _Object$entries$_i=_slicedToArray(_Object$entries[_i],2),key=_Object$entries$_i[0],value=_Object$entries$_i[1];result.set(key,getValueViaPath.call(this,value,path,check))}else{var _key=path.split(".").shift();result.set(_key,getValueViaPath.call(this,subject,path,check))}return result}function getValueViaPath(subject,path,check){if(""===path)return subject;var parts=path.split("."),current=parts.shift();if(current===this.wildCard)return iterate.call(this,subject,parts.join("."),check);if(isObject(subject)||isArray(subject)){var anchor;if(subject instanceof Map||subject instanceof WeakMap)anchor=subject.get(current);else if(subject instanceof Set||subject instanceof WeakSet){var _ref;validateInteger(current=parseInt(current)),anchor=null===(_ref=_toConsumableArray(subject))||void 0===_ref?void 0:_ref[current]}else{if("function"==typeof WeakRef&&subject instanceof WeakRef)throw Error("unsupported action for this data type");isArray(subject)?(validateInteger(current=parseInt(current)),anchor=null==subject?void 0:subject[current]):anchor=null==subject?void 0:subject[current]}if(isObject(anchor)||isArray(anchor))return getValueViaPath.call(this,anchor,parts.join("."),check);if(parts.length>0)throw Error("the journey is not at its end ("+parts.join(".")+")");if(!0===check&&!subject.hasOwnProperty(current))throw Error("unknown value");return anchor}throw TypeError("unsupported type "+pathfinder_typeof(subject))}function setValueViaPath(object,path,value){validateString(path);for(var parts=path.split("."),last=parts.pop(),subpath=parts.join("."),stack=new Stack,current=subpath;;){try{getValueViaPath.call(this,object,current,!0);break}catch(e){}if(stack.push(current),parts.pop(),""===(current=parts.join(".")))break}for(;!stack.isEmpty();){current=stack.pop();var obj={};if(!stack.isEmpty()){var n=stack.peek().split(".").pop();isInteger(parseInt(n))&&(obj=[])}setValueViaPath.call(this,object,current,obj)}var anchor=getValueViaPath.call(this,object,subpath);if(!isObject(object)&&!isArray(object))throw TypeError("unsupported type: "+pathfinder_typeof(object));if(anchor instanceof Map||anchor instanceof WeakMap)anchor.set(last,value);else if(anchor instanceof Set||anchor instanceof WeakSet)anchor.append(value);else{if("function"==typeof WeakRef&&anchor instanceof WeakRef)throw Error("unsupported action for this data type");isArray(anchor)?(validateInteger(last=parseInt(last)),assignProperty(anchor,last,value)):assignProperty(anchor,last,value)}}function assignProperty(object,key,value){object.hasOwnProperty(key)?(void 0===value&&delete object[key],object[key]=value):object[key]=value}function deleteValueViaPath(object,path){var parts=path.split("."),last=parts.pop(),subpath=parts.join("."),anchor=getValueViaPath.call(this,object,subpath);if(anchor instanceof Map)anchor.delete(last);else{if(anchor instanceof Set||anchor instanceof WeakMap||anchor instanceof WeakSet||"function"==typeof WeakRef&&anchor instanceof WeakRef)throw Error("unsupported action for this data type");isArray(anchor)?(validateInteger(last=parseInt(last)),delete anchor[last]):delete anchor[last]}}function transformer_toConsumableArray(arr){return function transformer_arrayWithoutHoles(arr){if(Array.isArray(arr))return transformer_arrayLikeToArray(arr)}(arr)||function transformer_iterableToArray(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}(arr)||transformer_unsupportedIterableToArray(arr)||function transformer_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 transformer_typeof(obj){return(transformer_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function transformer_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=transformer_unsupportedIterableToArray(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function transformer_unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return transformer_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?transformer_arrayLikeToArray(o,minLen):void 0}}function transformer_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _wrapRegExp(){_wrapRegExp=function _wrapRegExp(re,groups){return new BabelRegExp(re,void 0,groups)};var _super=RegExp.prototype,_groups=new WeakMap;function BabelRegExp(re,flags,groups){var _this=new RegExp(re,flags);return _groups.set(_this,groups||_groups.get(re)),transformer_setPrototypeOf(_this,BabelRegExp.prototype)}function buildGroups(result,re){var g=_groups.get(re);return Object.keys(g).reduce((function(groups,name){return groups[name]=result[g[name]],groups}),Object.create(null))}return transformer_inherits(BabelRegExp,RegExp),BabelRegExp.prototype.exec=function(str){var result=_super.exec.call(this,str);return result&&(result.groups=buildGroups(result,this)),result},BabelRegExp.prototype[Symbol.replace]=function(str,substitution){if("string"==typeof substitution){var groups=_groups.get(this);return _super[Symbol.replace].call(this,str,substitution.replace(/\$<([^>]+)>/g,(function(_,name){return"$"+groups[name]})))}if("function"==typeof substitution){var _this=this;return _super[Symbol.replace].call(this,str,(function(){var args=arguments;return"object"!==transformer_typeof(args[args.length-1])&&(args=[].slice.call(args)).push(buildGroups(args,_this)),substitution.apply(this,args)}))}return _super[Symbol.replace].call(this,str,substitution)},_wrapRegExp.apply(this,arguments)}function transformer_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function transformer_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&transformer_setPrototypeOf(subClass,superClass)}function transformer_setPrototypeOf(o,p){return(transformer_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function transformer_createSuper(Derived){var hasNativeReflectConstruct=function transformer_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}}();return function _createSuperInternal(){var result,Super=transformer_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=transformer_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return transformer_possibleConstructorReturn(this,result)}}function transformer_possibleConstructorReturn(self,call){if(call&&("object"===transformer_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function transformer_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function transformer_getPrototypeOf(o){return(transformer_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Data",Pathfinder);var Transformer=function(_Base){transformer_inherits(Transformer,_Base);var _super=transformer_createSuper(Transformer);function Transformer(definition){var _this;return function transformer_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Transformer),_this=_super.call(this),validateString(definition),_this.args=function disassemble(command){validateString(command);var _step,placeholder=new Map,regex=_wrapRegExp(/((\\(.)){1})/gim,{pattern:2,char:3}),_iterator=transformer_createForOfIteratorHelper(command.matchAll(regex));try{for(_iterator.s();!(_step=_iterator.n()).done;){var m=_step.value,g=null==m?void 0:m.groups;if(isObject(g)){var p=null==g?void 0:g.pattern,c=null==g?void 0:g.char;if(p&&c){var r="__"+(new ID).toString()+"__";placeholder.set(r,c),command=command.replace(p,r)}}}}catch(err){_iterator.e(err)}finally{_iterator.f()}var parts=command.split(":");return parts=parts.map((function(value){var _step2,v=value.trim(),_iterator2=transformer_createForOfIteratorHelper(placeholder);try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var k=_step2.value;v=v.replace(k[0],k[1])}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}return v}))}(definition),_this.command=_this.args.shift(),_this.callbacks=new Map,_this}return function transformer_createClass(Constructor,protoProps,staticProps){return protoProps&&transformer_defineProperties(Constructor.prototype,protoProps),staticProps&&transformer_defineProperties(Constructor,staticProps),Constructor}(Transformer,[{key:"setCallback",value:function setCallback(name,callback,context){return validateString(name),validateFunction(callback),void 0!==context&&validateObject(context),this.callbacks.set(name,{callback:callback,context:context}),this}},{key:"run",value:function run(value){return transform.apply(this,[value])}}]),Transformer}(Base);function transform(value){var _callback,key,args=clone(this.args);switch(this.command){case"static":return this.args.join(":");case"tolower":case"strtolower":case"tolowercase":return validateString(value),value.toLowerCase();case"toupper":case"strtoupper":case"touppercase":return validateString(value),value.toUpperCase();case"tostring":return""+value;case"tointeger":var n=parseInt(value);return validateInteger(n),n;case"tojson":return JSON.stringify(value);case"fromjson":return JSON.parse(value);case"trim":return validateString(value),value.trim();case"rawurlencode":return validateString(value),encodeURIComponent(value).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A");case"call":var callback,callbackName=args.shift(),context=getGlobal();if(isObject(value)&&value.hasOwnProperty(callbackName))callback=value[callbackName];else if(this.callbacks.has(callbackName)){var s=this.callbacks.get(callbackName);callback=null==s?void 0:s.callback,context=null==s?void 0:s.context}else"object"===("undefined"==typeof window?"undefined":transformer_typeof(window))&&window.hasOwnProperty(callbackName)&&(callback=window[callbackName]);return validateFunction(callback),args.unshift(value),(_callback=callback).call.apply(_callback,[context].concat(transformer_toConsumableArray(args)));case"plain":case"plaintext":return validateString(value),(new DOMParser).parseFromString(value,"text/html").body.textContent||"";case"if":case"?":validatePrimitive(value);var trueStatement=args.shift()||void 0,falseStatement=args.shift()||void 0;return"value"===trueStatement&&(trueStatement=value),"\\value"===trueStatement&&(trueStatement="value"),"value"===falseStatement&&(falseStatement=value),"\\value"===falseStatement&&(falseStatement="value"),void 0!==value&&""!==value&&"off"!==value&&"false"!==value&&!1!==value||"on"===value||"true"===value||!0===value?trueStatement:falseStatement;case"ucfirst":return validateString(value),value.charAt(0).toUpperCase()+value.substr(1);case"ucwords":return validateString(value),value.replace(/^([a-z\u00E0-\u00FC])|\s+([a-z\u00E0-\u00FC])/g,(function(v){return v.toUpperCase()}));case"count":case"length":if((isString(value)||isObject(value)||isArray(value))&&value.hasOwnProperty("length"))return value.length;throw new TypeError("unsupported type "+transformer_typeof(value));case"base64":return function convertToString(value){return isObject(value)&&value.hasOwnProperty("toString")&&(value=value.toString()),validateString(value),value}(value),btoa(value);case"empty":return"";case"undefined":return;case"prefix":return validateString(value),(null==args?void 0:args[0])+value;case"suffix":return validateString(value),value+(null==args?void 0:args[0]);case"uniqid":return(new ID).toString();case"key":case"property":case"index":key=args.shift()||"undefined";var defaultValue=args.shift()||"";if(value instanceof Map)return value.has(key)?value.get(key):defaultValue;if(isObject(value)||isArray(value))return null!=value&&value[key]?null==value?void 0:value[key]:defaultValue;throw new Error("type not supported");case"path":return key=args.shift()||"undefined",new Pathfinder(value).getVia(key);case"substring":validateString(value);var start=parseInt(args[0])||0,end=(parseInt(args[1])||0)+start;return value.substring(start,end);case"nop":return value;case"default":return void 0!==value?value:args[0];default:throw new Error("unknown command "+this.command)}return value}function pipe_typeof(obj){return(pipe_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function pipe_slicedToArray(arr,i){return function pipe_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function pipe_iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function pipe_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return pipe_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pipe_arrayLikeToArray(o,minLen)}(arr,i)||function pipe_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pipe_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function pipe_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function pipe_setPrototypeOf(o,p){return(pipe_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function pipe_createSuper(Derived){var hasNativeReflectConstruct=function pipe_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}}();return function _createSuperInternal(){var result,Super=pipe_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=pipe_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return pipe_possibleConstructorReturn(this,result)}}function pipe_possibleConstructorReturn(self,call){if(call&&("object"===pipe_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function pipe_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function pipe_getPrototypeOf(o){return(pipe_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Data",Transformer);var Pipe=function(_Base){!function pipe_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&pipe_setPrototypeOf(subClass,superClass)}(Pipe,_Base);var _super=pipe_createSuper(Pipe);function Pipe(pipe){var _this;return function pipe_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Pipe),_this=_super.call(this),validateString(pipe),_this.pipe=pipe.split("|").map((function(v){return new Transformer(v)})),_this}return function pipe_createClass(Constructor,protoProps,staticProps){return protoProps&&pipe_defineProperties(Constructor.prototype,protoProps),staticProps&&pipe_defineProperties(Constructor,staticProps),Constructor}(Pipe,[{key:"setCallback",value:function setCallback(name,callback,context){for(var _i=0,_Object$entries=Object.entries(this.pipe);_i<_Object$entries.length;_i++){pipe_slicedToArray(_Object$entries[_i],2)[1].setCallback(name,callback,context)}return this}},{key:"run",value:function run(value){return this.pipe.reduce((function(accumulator,transformer,currentIndex,array){return transformer.run(accumulator)}),value)}}]),Pipe}(Base);function formatter_typeof(obj){return(formatter_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function formatter_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function formatter_setPrototypeOf(o,p){return(formatter_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function formatter_createSuper(Derived){var hasNativeReflectConstruct=function formatter_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}}();return function _createSuperInternal(){var result,Super=formatter_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=formatter_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return formatter_possibleConstructorReturn(this,result)}}function formatter_possibleConstructorReturn(self,call){if(call&&("object"===formatter_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function formatter_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function formatter_getPrototypeOf(o){return(formatter_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Data",Pipe);var Formatter=function(_Base){!function formatter_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&formatter_setPrototypeOf(subClass,superClass)}(Formatter,_Base);var _super=formatter_createSuper(Formatter);function Formatter(object){var _this;return function formatter_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Formatter),(_this=_super.call(this)).object=validateObject(object),_this.openMarker="${",_this.closeMarker="}",_this}return function formatter_createClass(Constructor,protoProps,staticProps){return protoProps&&formatter_defineProperties(Constructor.prototype,protoProps),staticProps&&formatter_defineProperties(Constructor,staticProps),Constructor}(Formatter,[{key:"setMarker",value:function setMarker(open,close){return void 0===close&&(close=open),this.openMarker=validateString(open),this.closeMarker=validateString(close),this}},{key:"format",value:function format(text){return tokenizer.call(this,validateString(text))}}]),Formatter}(Base);function tokenizer(text){for(var formatted=[];;){var startIndex=text.indexOf(this.openMarker);if(-1===startIndex){formatted.push(text);break}startIndex>0&&(formatted.push(text.substring(0,startIndex)),text=text.substring(startIndex));var endIndex=text.substring(this.openMarker.length).indexOf(this.closeMarker)+this.openMarker.length;if(-1===endIndex)throw new Error("syntax error in formatter template");var command="path:"+text.substring(this.openMarker.length,endIndex);formatted.push(validateString(new Pipe(command).run(this.object))),text=text.substring(endIndex+this.closeMarker.length)}return formatted.join("")}function tokenlist_typeof(obj){return(tokenlist_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function tokenlist_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function tokenlist_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return tokenlist_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tokenlist_arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function tokenlist_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function tokenlist_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function tokenlist_setPrototypeOf(o,p){return(tokenlist_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function tokenlist_createSuper(Derived){var hasNativeReflectConstruct=function tokenlist_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}}();return function _createSuperInternal(){var result,Super=tokenlist_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=tokenlist_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return tokenlist_possibleConstructorReturn(this,result)}}function tokenlist_possibleConstructorReturn(self,call){if(call&&("object"===tokenlist_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function tokenlist_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function tokenlist_getPrototypeOf(o){return(tokenlist_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Text",Formatter);var TokenList=function(_Base,_Symbol$iterator){!function tokenlist_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&tokenlist_setPrototypeOf(subClass,superClass)}(TokenList,_Base);var _super=tokenlist_createSuper(TokenList);function TokenList(init){var _this;return function tokenlist_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,TokenList),(_this=_super.call(this)).tokens=new Set,void 0!==init&&_this.add(init),_this}return function tokenlist_createClass(Constructor,protoProps,staticProps){return protoProps&&tokenlist_defineProperties(Constructor.prototype,protoProps),staticProps&&tokenlist_defineProperties(Constructor,staticProps),Constructor}(TokenList,[{key:"getIterator",value:function getIterator(){return this[Symbol.iterator]()}},{key:_Symbol$iterator,value:function value(){var index=0,entries=this.entries();return{next:function next(){return index<entries.length?{value:null==entries?void 0:entries[index++],done:!1}:{done:!0}}}}},{key:"contains",value:function contains(value){var _this2=this;if(isString(value)){value=value.trim();var counter=0;return value.split(" ").forEach((function(token){if(!1===_this2.tokens.has(token.trim()))return!1;counter++})),counter>0}if(isIterable(value)){var _step,_counter=0,_iterator=tokenlist_createForOfIteratorHelper(value);try{for(_iterator.s();!(_step=_iterator.n()).done;){var token=_step.value;if(validateString(token),!1===this.tokens.has(token.trim()))return!1;_counter++}}catch(err){_iterator.e(err)}finally{_iterator.f()}return _counter>0}return!1}},{key:"add",value:function add(value){var _this3=this;if(isString(value))value.split(" ").forEach((function(token){_this3.tokens.add(token.trim())}));else if(isIterable(value)){var _step2,_iterator2=tokenlist_createForOfIteratorHelper(value);try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var token=_step2.value;validateString(token),this.tokens.add(token.trim())}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}}else if(void 0!==value)throw new TypeError("unsupported value");return this}},{key:"clear",value:function clear(){return this.tokens.clear(),this}},{key:"remove",value:function remove(value){var _this4=this;if(isString(value))value.split(" ").forEach((function(token){_this4.tokens.delete(token.trim())}));else if(isIterable(value)){var _step3,_iterator3=tokenlist_createForOfIteratorHelper(value);try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var token=_step3.value;validateString(token),this.tokens.delete(token.trim())}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}}else if(void 0!==value)throw new TypeError("unsupported value");return this}},{key:"replace",value:function replace(token,newToken){if(validateString(token),validateString(newToken),!this.contains(token))return this;var a=Array.from(this.tokens),i=a.indexOf(token);return-1===i||(a.splice(i,1,newToken),this.tokens=new Set,this.add(a)),this}},{key:"toggle",value:function toggle(value){var _this5=this;if(isString(value))value.split(" ").forEach((function(token){toggleValue.call(_this5,token)}));else if(isIterable(value)){var _step4,_iterator4=tokenlist_createForOfIteratorHelper(value);try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var token=_step4.value;toggleValue.call(this,token)}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}}else if(void 0!==value)throw new TypeError("unsupported value");return this}},{key:"entries",value:function entries(){return Array.from(this.tokens)}},{key:"forEach",value:function forEach(callback){return validateFunction(callback),this.tokens.forEach(callback),this}},{key:"toString",value:function toString(){return this.entries().join(" ")}}]),TokenList}(Base,Symbol.iterator);function toggleValue(token){if(!(this instanceof TokenList))throw Error("must be called with TokenList.call");return validateString(token),token=token.trim(),this.contains(token)?(this.remove(token),this):(this.add(token),this)}function queue_typeof(obj){return(queue_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function queue_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function queue_setPrototypeOf(o,p){return(queue_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function queue_createSuper(Derived){var hasNativeReflectConstruct=function queue_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}}();return function _createSuperInternal(){var result,Super=queue_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=queue_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return queue_possibleConstructorReturn(this,result)}}function queue_possibleConstructorReturn(self,call){if(call&&("object"===queue_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function queue_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function queue_getPrototypeOf(o){return(queue_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",TokenList);var Queue=function(_Base){!function queue_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&queue_setPrototypeOf(subClass,superClass)}(Queue,_Base);var _super=queue_createSuper(Queue);function Queue(){var _this;return function queue_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Queue),(_this=_super.call(this)).data=[],_this}return function queue_createClass(Constructor,protoProps,staticProps){return protoProps&&queue_defineProperties(Constructor.prototype,protoProps),staticProps&&queue_defineProperties(Constructor,staticProps),Constructor}(Queue,[{key:"isEmpty",value:function isEmpty(){return 0===this.data.length}},{key:"peek",value:function peek(){if(!this.isEmpty())return this.data[0]}},{key:"add",value:function add(value){return this.data.push(value),this}},{key:"clear",value:function clear(){return this.data=[],this}},{key:"poll",value:function poll(){if(!this.isEmpty())return this.data.shift()}}]),Queue}(Base);function uniquequeue_typeof(obj){return(uniquequeue_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function uniquequeue_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _get(target,property,receiver){return(_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(target,property,receiver){var base=function _superPropBase(object,property){for(;!Object.prototype.hasOwnProperty.call(object,property)&&null!==(object=uniquequeue_getPrototypeOf(object)););return object}(target,property);if(base){var desc=Object.getOwnPropertyDescriptor(base,property);return desc.get?desc.get.call(receiver):desc.value}})(target,property,receiver||target)}function uniquequeue_setPrototypeOf(o,p){return(uniquequeue_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function uniquequeue_createSuper(Derived){var hasNativeReflectConstruct=function uniquequeue_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}}();return function _createSuperInternal(){var result,Super=uniquequeue_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=uniquequeue_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return uniquequeue_possibleConstructorReturn(this,result)}}function uniquequeue_possibleConstructorReturn(self,call){if(call&&("object"===uniquequeue_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function uniquequeue_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function uniquequeue_getPrototypeOf(o){return(uniquequeue_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",Queue);var UniqueQueue=function(_Queue){!function uniquequeue_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&uniquequeue_setPrototypeOf(subClass,superClass)}(UniqueQueue,_Queue);var _super=uniquequeue_createSuper(UniqueQueue);function UniqueQueue(){var _this;return function uniquequeue_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,UniqueQueue),(_this=_super.call(this)).unique=new WeakSet,_this}return function uniquequeue_createClass(Constructor,protoProps,staticProps){return protoProps&&uniquequeue_defineProperties(Constructor.prototype,protoProps),staticProps&&uniquequeue_defineProperties(Constructor,staticProps),Constructor}(UniqueQueue,[{key:"add",value:function add(value){return validateObject(value),this.unique.has(value)||(this.unique.add(value),_get(uniquequeue_getPrototypeOf(UniqueQueue.prototype),"add",this).call(this,value)),this}},{key:"clear",value:function clear(){return _get(uniquequeue_getPrototypeOf(UniqueQueue.prototype),"clear",this).call(this),this.unique=new WeakSet,this}},{key:"poll",value:function poll(){if(!this.isEmpty()){var value=this.data.shift();return this.unique.delete(value),value}}}]),UniqueQueue}(Queue);function observer_typeof(obj){return(observer_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function observer_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function observer_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function observer_setPrototypeOf(o,p){return(observer_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function observer_createSuper(Derived){var hasNativeReflectConstruct=function observer_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}}();return function _createSuperInternal(){var result,Super=observer_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=observer_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return observer_possibleConstructorReturn(this,result)}}function observer_possibleConstructorReturn(self,call){if(call&&("object"===observer_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function observer_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function observer_getPrototypeOf(o){return(observer_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",UniqueQueue);var Observer=function(_Base){!function observer_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&observer_setPrototypeOf(subClass,superClass)}(Observer,_Base);var _super=observer_createSuper(Observer);function Observer(callback){var _this;if(observer_classCallCheck(this,Observer),_this=_super.call(this),"function"!=typeof callback)throw new Error("observer callback must be a function");_this.callback=callback;for(var _len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)args[_key-1]=arguments[_key];return _this.arguments=args,_this.tags=new TokenList,_this.queue=new UniqueQueue,_this}return function observer_createClass(Constructor,protoProps,staticProps){return protoProps&&observer_defineProperties(Constructor.prototype,protoProps),staticProps&&observer_defineProperties(Constructor,staticProps),Constructor}(Observer,[{key:"addTag",value:function addTag(tag){return this.tags.add(tag),this}},{key:"removeTag",value:function removeTag(tag){return this.tags.remove(tag),this}},{key:"getTags",value:function getTags(){return this.tags.entries()}},{key:"hasTag",value:function hasTag(tag){return this.tags.contains(tag)}},{key:"update",value:function update(subject){var self=this;return new Promise((function(resolve,reject){isObject(subject)?(self.queue.add(subject),setTimeout((function(){try{if(self.queue.isEmpty())return void resolve();var s=self.queue.poll(),result=self.callback.apply(s,self.arguments);if(isObject(result)&&result instanceof Promise)return void result.then(resolve).catch(reject);resolve(result)}catch(e){reject(e)}}),0)):reject("subject must be an object")}))}}]),Observer}(Base);function observerlist_typeof(obj){return(observerlist_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function observerlist_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function observerlist_setPrototypeOf(o,p){return(observerlist_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function observerlist_createSuper(Derived){var hasNativeReflectConstruct=function observerlist_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}}();return function _createSuperInternal(){var result,Super=observerlist_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=observerlist_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return observerlist_possibleConstructorReturn(this,result)}}function observerlist_possibleConstructorReturn(self,call){if(call&&("object"===observerlist_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function observerlist_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function observerlist_getPrototypeOf(o){return(observerlist_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",Observer);var ObserverList=function(_Base){!function observerlist_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&observerlist_setPrototypeOf(subClass,superClass)}(ObserverList,_Base);var _super=observerlist_createSuper(ObserverList);function ObserverList(){var _this;return function observerlist_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ObserverList),(_this=_super.call(this)).observers=[],_this}return function observerlist_createClass(Constructor,protoProps,staticProps){return protoProps&&observerlist_defineProperties(Constructor.prototype,protoProps),staticProps&&observerlist_defineProperties(Constructor,staticProps),Constructor}(ObserverList,[{key:"attach",value:function attach(observer){return validateInstance(observer,Observer),this.observers.push(observer),this}},{key:"detach",value:function detach(observer){validateInstance(observer,Observer);for(var i=0,l=this.observers.length;i<l;i++)this.observers[i]===observer&&this.observers.splice(i,1);return this}},{key:"contains",value:function contains(observer){validateInstance(observer,Observer);for(var i=0,l=this.observers.length;i<l;i++)if(this.observers[i]===observer)return!0;return!1}},{key:"notify",value:function notify(subject){for(var pomises=[],i=0,l=this.observers.length;i<l;i++)pomises.push(this.observers[i].update(subject));return Promise.all(pomises)}}]),ObserverList}(Base);function proxyobserver_typeof(obj){return(proxyobserver_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function proxyobserver_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function proxyobserver_setPrototypeOf(o,p){return(proxyobserver_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function proxyobserver_createSuper(Derived){var hasNativeReflectConstruct=function proxyobserver_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}}();return function _createSuperInternal(){var result,Super=proxyobserver_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=proxyobserver_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return proxyobserver_possibleConstructorReturn(this,result)}}function proxyobserver_possibleConstructorReturn(self,call){if(call&&("object"===proxyobserver_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return proxyobserver_assertThisInitialized(self)}function proxyobserver_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function proxyobserver_getPrototypeOf(o){return(proxyobserver_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",ObserverList);var ProxyObserver=function(_Base){!function proxyobserver_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&proxyobserver_setPrototypeOf(subClass,superClass)}(ProxyObserver,_Base);var _super=proxyobserver_createSuper(ProxyObserver);function ProxyObserver(object){var _this;return function proxyobserver_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,ProxyObserver),(_this=_super.call(this)).realSubject=validateObject(object),_this.subject=new Proxy(object,getHandler.call(proxyobserver_assertThisInitialized(_this))),_this.objectMap=new WeakMap,_this.objectMap.set(_this.realSubject,_this.subject),_this.proxyMap=new WeakMap,_this.proxyMap.set(_this.subject,_this.realSubject),_this.observers=new ObserverList,_this}return function proxyobserver_createClass(Constructor,protoProps,staticProps){return protoProps&&proxyobserver_defineProperties(Constructor.prototype,protoProps),staticProps&&proxyobserver_defineProperties(Constructor,staticProps),Constructor}(ProxyObserver,[{key:"getSubject",value:function getSubject(){return this.subject}},{key:"getRealSubject",value:function getRealSubject(){return this.realSubject}},{key:"attachObserver",value:function attachObserver(observer){return this.observers.attach(observer),this}},{key:"detachObserver",value:function detachObserver(observer){return this.observers.detach(observer),this}},{key:"notifyObservers",value:function notifyObservers(){return this.observers.notify(this)}},{key:"containsObserver",value:function containsObserver(observer){return this.observers.contains(observer)}}]),ProxyObserver}(Base);function getHandler(){var proxy=this,handler={get:function get(target,key,receiver){var value=Reflect.get(target,key,receiver);if("symbol"===proxyobserver_typeof(key))return value;if(isPrimitive(value))return value;if(isArray(value)||isObject(value)){if(proxy.objectMap.has(value))return proxy.objectMap.get(value);if(proxy.proxyMap.has(value))return value;var p=new Proxy(value,handler);return proxy.objectMap.set(value,p),proxy.proxyMap.set(p,value),p}return value},set:function set(target,key,value,receiver){proxy.proxyMap.has(value)&&(value=proxy.proxyMap.get(value)),proxy.proxyMap.has(target)&&(target=proxy.proxyMap.get(target));var result,current=Reflect.get(target,key,receiver);if(proxy.proxyMap.has(current)&&(current=proxy.proxyMap.get(current)),current===value)return!0;var descriptor=Reflect.getOwnPropertyDescriptor(target,key);return void 0===descriptor&&(descriptor={writable:!0,enumerable:!0,configurable:!0}),descriptor.value=value,result=Reflect.defineProperty(target,key,descriptor),"symbol"!==proxyobserver_typeof(key)&&proxy.observers.notify(proxy),result},deleteProperty:function deleteProperty(target,key){return key in target&&(delete target[key],"symbol"!==proxyobserver_typeof(key)&&proxy.observers.notify(proxy),!0)},defineProperty:function defineProperty(target,key,descriptor){var result=Reflect.defineProperty(target,key,descriptor);return"symbol"!==proxyobserver_typeof(key)&&proxy.observers.notify(proxy),result},setPrototypeOf:function setPrototypeOf(target,key){var result=Reflect.setPrototypeOf(object1,key);return"symbol"!==proxyobserver_typeof(key)&&proxy.observers.notify(proxy),result}};return handler}function diff_typeof(obj){return(diff_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function Diff(first,second){return doDiff(first,second)}function doDiff(a,b,path,diff){var typeA=diff_typeof(a),typeB=diff_typeof(b),currPath=path||[],currDiff=diff||[];if(typeA===typeB&&"object"===typeA)(function getKeys(a,b,type){if(isArray(type)){var keys=a.length>b.length?new Array(a.length):new Array(b.length);return keys.fill(0),new Set(keys.map((function(_,i){return i})))}return new Set(Object.keys(a).concat(Object.keys(b)))})(a,b,typeA).forEach((function(v){Object.prototype.hasOwnProperty.call(a,v)?Object.prototype.hasOwnProperty.call(b,v)?doDiff(a[v],b[v],currPath.concat(v),currDiff):currDiff.push(buildResult(a[v],b[v],"delete",currPath.concat(v))):currDiff.push(buildResult(a[v],b[v],"add",currPath.concat(v)))}));else{var o=function getOperator(a,b){var operator,typeA=diff_typeof(a),typeB=diff_typeof(b);"undefined"===typeA&&"undefined"!==typeB?operator="add":"undefined"!==typeA&&"undefined"===typeB?operator="delete":function isNotEqual(a,b){if(diff_typeof(a)!==diff_typeof(b))return!0;if(a instanceof Date&&b instanceof Date)return a.getTime()!==b.getTime();return a!==b}(a,b)&&(operator="update");return operator}(a,b);void 0!==o&&currDiff.push(buildResult(a,b,o,path))}return currDiff}function buildResult(a,b,operator,path){var result={operator:operator,path:path};if("add"!==operator&&(result.first={value:a,type:diff_typeof(a)},isObject(a))){var _Object$getPrototypeO,_Object$getPrototypeO2,name=null===(_Object$getPrototypeO=Object.getPrototypeOf(a))||void 0===_Object$getPrototypeO||null===(_Object$getPrototypeO2=_Object$getPrototypeO.constructor)||void 0===_Object$getPrototypeO2?void 0:_Object$getPrototypeO2.name;void 0!==name&&(result.first.instance=name)}if(("add"===operator||"update"===operator)&&(result.second={value:b,type:diff_typeof(b)},isObject(b))){var _Object$getPrototypeO3,_Object$getPrototypeO4,_name=null===(_Object$getPrototypeO3=Object.getPrototypeOf(b))||void 0===_Object$getPrototypeO3||null===(_Object$getPrototypeO4=_Object$getPrototypeO3.constructor)||void 0===_Object$getPrototypeO4?void 0:_Object$getPrototypeO4.name;void 0!==_name&&(result.second.instance=_name)}return result}assignToNamespace("Monster.Types",ProxyObserver),assignToNamespace("Monster.Data",Diff);function theme_typeof(obj){return(theme_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function theme_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function theme_setPrototypeOf(o,p){return(theme_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function theme_createSuper(Derived){var hasNativeReflectConstruct=function theme_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}}();return function _createSuperInternal(){var result,Super=theme_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=theme_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return theme_possibleConstructorReturn(this,result)}}function theme_possibleConstructorReturn(self,call){if(call&&("object"===theme_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function theme_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function theme_getPrototypeOf(o){return(theme_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}var Theme=function(_Base){!function theme_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&theme_setPrototypeOf(subClass,superClass)}(Theme,_Base);var _super=theme_createSuper(Theme);function Theme(name){var _this;return function theme_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Theme),_this=_super.call(this),validateString(name),_this.name=name,_this}return function theme_createClass(Constructor,protoProps,staticProps){return protoProps&&theme_defineProperties(Constructor.prototype,protoProps),staticProps&&theme_defineProperties(Constructor,staticProps),Constructor}(Theme,[{key:"getName",value:function getName(){return this.name}}]),Theme}(Base);function getDocumentTheme(){var name="monster",element=getGlobalObject("document").querySelector("html");if(element instanceof HTMLElement){var theme=element.getAttribute("data-monster-theme-name");theme&&(name=theme)}return new Theme(name)}function template_typeof(obj){return(template_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function template_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function template_setPrototypeOf(o,p){return(template_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function template_createSuper(Derived){var hasNativeReflectConstruct=function template_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}}();return function _createSuperInternal(){var result,Super=template_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=template_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return template_possibleConstructorReturn(this,result)}}function template_possibleConstructorReturn(self,call){if(call&&("object"===template_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function template_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function template_getPrototypeOf(o){return(template_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.DOM",Theme,getDocumentTheme);var Template=function(_Base){!function template_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&template_setPrototypeOf(subClass,superClass)}(Template,_Base);var _super=template_createSuper(Template);function Template(template){var _this;return function template_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Template),_this=_super.call(this),validateInstance(template,getGlobalFunction("HTMLTemplateElement")),_this.template=template,_this}return function template_createClass(Constructor,protoProps,staticProps){return protoProps&&template_defineProperties(Constructor.prototype,protoProps),staticProps&&template_defineProperties(Constructor,staticProps),Constructor}(Template,[{key:"getTemplateElement",value:function getTemplateElement(){return this.template}},{key:"createDocumentFragment",value:function createDocumentFragment(){return this.template.content.cloneNode(!0)}}]),Template}(Base);function findDocumentTemplate(id,root){validateString(id),root instanceof Node||(root=getGlobalObject("document"));var HTMLTemplateElement=getGlobalFunction("HTMLTemplateElement"),themedID=id+"-"+getDocumentTheme().getName(),template=root.getElementById(themedID);if(template instanceof HTMLTemplateElement)return new Template(template);if((template=root.getElementById(id))instanceof HTMLTemplateElement)return new Template(template);if(root!==getGlobalObject("document"))return findDocumentTemplate(id);throw new Error("template "+id+" not found.")}function util_typeof(obj){return(util_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function getDocument(){var _getGlobal,document=null===(_getGlobal=getGlobal())||void 0===_getGlobal?void 0:_getGlobal.document;if("object"!==util_typeof(document))throw new Error("not supported environment");return document}function updater_typeof(obj){return(updater_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function updater_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=updater_unsupportedIterableToArray(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e2){throw _e2},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e3){didErr=!0,err=_e3},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function updater_slicedToArray(arr,i){return function updater_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function updater_iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||updater_unsupportedIterableToArray(arr,i)||function updater_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function updater_unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return updater_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?updater_arrayLikeToArray(o,minLen):void 0}}function updater_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function updater_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function updater_setPrototypeOf(o,p){return(updater_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function updater_createSuper(Derived){var hasNativeReflectConstruct=function updater_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}}();return function _createSuperInternal(){var result,Super=updater_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=updater_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return updater_possibleConstructorReturn(this,result)}}function updater_possibleConstructorReturn(self,call){if(call&&("object"===updater_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return updater_assertThisInitialized(self)}function updater_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function updater_getPrototypeOf(o){return(updater_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.DOM",Template,findDocumentTemplate),assignToNamespace("Monster.DOM",(function getWindow(){var _getGlobal2,window=null===(_getGlobal2=getGlobal())||void 0===_getGlobal2?void 0:_getGlobal2.window;if("object"!==util_typeof(window))throw new Error("not supported environment");return window}),getDocument,(function getDocumentFragmentFromString(html){validateString(html);var template=getDocument().createElement("template");return template.innerHTML=html,template.content}));var Updater=function(_Base){!function updater_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&updater_setPrototypeOf(subClass,superClass)}(Updater,_Base);var _super=updater_createSuper(Updater);function Updater(element,subject){var _this;!function updater_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Updater),(_this=_super.call(this)).element=validateInstance(element,HTMLElement),void 0===subject&&(subject={});return isInstance(subject,ProxyObserver)||(subject=new ProxyObserver(subject)),_this.last={},_this.callbacks=new Map,_this.callbacks.set("checkstate",getCheckStateCallback.call(updater_assertThisInitialized(_this))),_this.subject=subject.attachObserver(new Observer((function(){var s=_this.subject.getRealSubject(),diff=Diff(_this.last,s);_this.last=clone(s);for(var _i=0,_Object$entries=Object.entries(diff);_i<_Object$entries.length;_i++){var change=updater_slicedToArray(_Object$entries[_i],2)[1];removeElement.call(updater_assertThisInitialized(_this),change),insertElement.call(updater_assertThisInitialized(_this),change),updateContent.call(updater_assertThisInitialized(_this),change),updateAttributes.call(updater_assertThisInitialized(_this),change)}}))),_this.eventTypes=["keyup","click","change","drop","touchend","input"],_this}return function updater_createClass(Constructor,protoProps,staticProps){return protoProps&&updater_defineProperties(Constructor.prototype,protoProps),staticProps&&updater_defineProperties(Constructor,staticProps),Constructor}(Updater,[{key:"setEventTypes",value:function setEventTypes(types){return this.eventTypes=validateArray(types),this}},{key:"enableEventProcessing",value:function enableEventProcessing(){this.disableEventProcessing();var _step,_iterator=updater_createForOfIteratorHelper(this.eventTypes);try{for(_iterator.s();!(_step=_iterator.n()).done;){var type=_step.value;this.element.addEventListener(type,getControlEventHandler.call(this))}}catch(err){_iterator.e(err)}finally{_iterator.f()}return this}},{key:"disableEventProcessing",value:function disableEventProcessing(){var _step2,_iterator2=updater_createForOfIteratorHelper(this.eventTypes);try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var type=_step2.value;this.element.removeEventListener(type,getControlEventHandler.call(this))}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}return this}},{key:"run",value:function run(){return this.last={__init__:!0},this.subject.notifyObservers()}},{key:"getSubject",value:function getSubject(){return this.subject.getSubject()}},{key:"setCallback",value:function setCallback(name,callback){return this.callbacks.set(name,callback),this}}]),Updater}(Base);function getCheckStateCallback(){return function(current){if(this instanceof HTMLInputElement){if(-1!==["radio","checkbox"].indexOf(this.type))return this.value+""==current+""?"true":void 0}else if(this instanceof HTMLOptionElement)return isArray(current)&&-1!==current.indexOf(this.value)?"true":void 0}}var symbol=Symbol("EventHandler");function getControlEventHandler(){var self=this;if(self[symbol])return self[symbol];var pathfinder=new Pathfinder(this.subject.getSubject());return self[symbol]=function(event){var _element$constructor,_Object$getOwnPropert,element=event.target;if(element.hasAttribute("data-monster-bind")){var value,path=element.getAttribute("data-monster-bind");if(0!==path.indexOf("path:"))throw new Error("the bind argument must start as a value with a path.");if(path=path.substr(5),element instanceof HTMLInputElement)switch(element.type){case"checkbox":value=element.checked?element.value:void 0;break;default:value=element.value}else if(element instanceof HTMLTextAreaElement)value=element.value;else if(element instanceof HTMLSelectElement)switch(element.type){case"select-one":value=element.value;break;case"select-multiple":value=element.value;var options=null==element?void 0:element.selectedOptions;void 0===options&&(options=element.querySelectorAll(":scope option:checked")),value=Array.from(options).map((function(_ref){return _ref.value}))}else{if(!(null!=element&&null!==(_element$constructor=element.constructor)&&void 0!==_element$constructor&&_element$constructor.prototype&&null!==(_Object$getOwnPropert=Object.getOwnPropertyDescriptor(element.constructor.prototype,"value"))&&void 0!==_Object$getOwnPropert&&_Object$getOwnPropert.get||element.hasOwnProperty("value")))throw new Error("unsupported object");value=null==element?void 0:element.value}var copy=clone(self.subject.getRealSubject());new Pathfinder(copy).setVia(path,value),new Diff(copy,self.subject.getRealSubject()).length>0&&pathfinder.setVia(path,value)}},self[symbol]}function removeElement(change){var _step3,_iterator3=updater_createForOfIteratorHelper(this.element.querySelectorAll(":scope [data-monster-remove]").entries());try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var element=updater_slicedToArray(_step3.value,2)[1];element.parentNode.removeChild(element)}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}}function insertElement(change){for(var _this2=this,subject=this.subject.getRealSubject(),mem=(getDocument(),new WeakSet),wd=0;;){var found=!1;wd++;var p=clone(null==change?void 0:change.path);if(!isArray(p))return this;for(;p.length>0;){var _step4,current=p.join("."),_iterator4=updater_createForOfIteratorHelper(this.element.querySelectorAll(':scope [data-monster-insert*="path:'+current+'"]').entries());try{var _loop=function _loop(){var containerElement=updater_slicedToArray(_step4.value,2)[1];if(mem.has(containerElement))return"continue";mem.add(containerElement),found=!0;var def=containerElement.getAttribute("data-monster-insert").trim(),i=def.indexOf(" "),key=def.substr(0,i).trim(),refPrefix=key+"-",cmd=def.substr(i).trim();if(cmd.indexOf("|")>0)throw new Error("pipes are not allowed when cloning a node.");var pipe=new Pipe(cmd);_this2.callbacks.forEach((function(f,n){pipe.setCallback(n,f)}));var value=pipe.run(subject),dataPath=cmd.split(":").pop();if(containerElement.hasChildNodes()&&containerElement.lastChild,!isIterable(value))throw new Error("the value is not iterable");for(var available=new Set,_i2=0,_Object$entries2=Object.entries(value);_i2<_Object$entries2.length;_i2++){var _Object$entries2$_i=updater_slicedToArray(_Object$entries2[_i2],2),_i3=_Object$entries2$_i[0],ref=(_Object$entries2$_i[1],refPrefix+_i3),currentPath=dataPath+"."+_i3;available.add(ref);var refElement=containerElement.querySelector('[data-monster-insert-reference="'+ref+'"]');refElement instanceof HTMLElement?refElement:appendNewDocumentFragment(containerElement,key,ref,currentPath)}for(var nodes=containerElement.querySelectorAll('[data-monster-insert-reference*="'+refPrefix+'"]'),_i4=0,_Object$entries3=Object.entries(nodes);_i4<_Object$entries3.length;_i4++){var node=updater_slicedToArray(_Object$entries3[_i4],2)[1];available.has(node.getAttribute("data-monster-insert-reference"))||containerElement.removeChild(node)}};for(_iterator4.s();!(_step4=_iterator4.n()).done;)_loop()}catch(err){_iterator4.e(err)}finally{_iterator4.f()}p.pop()}if(!1===found)break;if(wd++>200)throw new Error("the maximum depth for the recursion is reached.")}}function appendNewDocumentFragment(container,key,ref,path){var rootNode=container.getRootNode();rootNode||(rootNode=getDocument());for(var nodes=findDocumentTemplate(key,rootNode).createDocumentFragment(),_i5=0,_Object$entries4=Object.entries(nodes.childNodes);_i5<_Object$entries4.length;_i5++){var node=updater_slicedToArray(_Object$entries4[_i5],2)[1];node instanceof HTMLElement&&(applyRecursive(node,key,path),node.setAttribute("data-monster-insert-reference",ref)),container.appendChild(node)}}function applyRecursive(node,key,path){if(node instanceof HTMLElement){if(node.hasAttribute("data-monster-replace")){var value=node.getAttribute("data-monster-replace");node.setAttribute("data-monster-replace",value.replace("path:"+key,"path:"+path))}if(node.hasAttribute("data-monster-attributes")){var _value=node.getAttribute("data-monster-attributes");node.setAttribute("data-monster-attributes",_value.replace("path:"+key,"path:"+path))}for(var _i6=0,_Object$entries5=Object.entries(node.childNodes);_i6<_Object$entries5.length;_i6++){applyRecursive(updater_slicedToArray(_Object$entries5[_i6],2)[1],key,path)}}}function updateContent(change){var subject=this.subject.getRealSubject(),p=clone(null==change?void 0:change.path);runUpdateContent.call(this,this.element,p,subject)}function runUpdateContent(container,parts,subject){var _this3=this;if(isArray(parts)){parts=clone(parts);for(var mem=new WeakSet;parts.length>0;){var current=parts.join(".");parts.pop();var _step5,_iterator5=updater_createForOfIteratorHelper(container.querySelectorAll(':scope [data-monster-replace^="path:'+current+'"], [data-monster-replace^="static:"]').entries());try{var _loop2=function _loop2(){var element=updater_slicedToArray(_step5.value,2)[1];if(mem.has(element))return"continue";mem.add(element);var cmd=element.getAttribute("data-monster-replace").trim(),pipe=new Pipe(cmd);_this3.callbacks.forEach((function(f,n){pipe.setCallback(n,f)}));var value=pipe.run(subject);if(value instanceof HTMLElement){for(;element.firstChild;)element.removeChild(element.firstChild);element.addNode(value)}else element.innerHTML=value};for(_iterator5.s();!(_step5=_iterator5.n()).done;)_loop2()}catch(err){_iterator5.e(err)}finally{_iterator5.f()}}}}function updateAttributes(change){var subject=this.subject.getRealSubject(),p=clone(null==change?void 0:change.path);runUpdateAttributes.call(this,this.element,p,subject)}function runUpdateAttributes(container,parts,subject){var _this4=this,self=this;if(isArray(parts)){parts=clone(parts);for(var mem=new WeakSet;parts.length>0;){var current=parts.join(".");parts.pop();var _step6,_iterator6=updater_createForOfIteratorHelper(container.querySelectorAll(':scope [data-monster-attributes*="path:'+current+'"]').entries());try{var _loop3=function _loop3(){var element=updater_slicedToArray(_step6.value,2)[1];if(mem.has(element))return"continue";mem.add(element);for(var attributes=element.getAttribute("data-monster-attributes"),_loop4=function _loop4(){var def=updater_slicedToArray(_Object$entries6[_i7],2)[1],i=(def=def.trim()).indexOf(" "),name=def.substr(0,i).trim(),cmd=def.substr(i).trim(),pipe=new Pipe(cmd);self.callbacks.forEach((function(f,n){pipe.setCallback(n,f,element)}));var value=pipe.run(subject);void 0===value?element.removeAttribute(name):element.getAttribute(name)!==value&&element.setAttribute(name,value),handleInputControlAttributeUpdate.call(_this4,element,name,value)},_i7=0,_Object$entries6=Object.entries(attributes.split(","));_i7<_Object$entries6.length;_i7++)_loop4()};for(_iterator6.s();!(_step6=_iterator6.n()).done;)_loop3()}catch(err){_iterator6.e(err)}finally{_iterator6.f()}}}}function handleInputControlAttributeUpdate(element,name,value){if(element instanceof HTMLSelectElement)switch(element.type){case"select-multiple":for(var _i8=0,_Object$entries7=Object.entries(element.options);_i8<_Object$entries7.length;_i8++){var _Object$entries7$_i=updater_slicedToArray(_Object$entries7[_i8],2),opt=(_Object$entries7$_i[0],_Object$entries7$_i[1]);-1!==value.indexOf(opt.value)?opt.selected=!0:opt.selected=!1}break;case"select-one":for(var _i9=0,_Object$entries8=Object.entries(element.options);_i9<_Object$entries8.length;_i9++){var _Object$entries8$_i=updater_slicedToArray(_Object$entries8[_i9],2),_index=_Object$entries8$_i[0];if(_Object$entries8$_i[1].value===value){element.selectedIndex=_index;break}}}else if(element instanceof HTMLInputElement)switch(element.type){case"radio":case"checkbox":element.checked="checked"===name&&void 0!==value;break;case"text":default:"value"===name&&(element.value=void 0===value?"":value)}else element instanceof HTMLTextAreaElement&&"value"===name&&(element.value=void 0===value?"":value)}function addToObjectLink(element,symbol,object){return validateInstance(element,HTMLElement),validateSymbol(symbol),void 0===(null==element?void 0:element[symbol])&&(element[symbol]=new Set),addAttributeToken(element,"data-monster-objectlink",symbol.toString()),element[symbol].add(object),element}function hasObjectLink(element,symbol){return validateInstance(element,HTMLElement),validateSymbol(symbol),void 0!==(null==element?void 0:element[symbol])&&containsAttributeToken(element,"data-monster-objectlink",symbol.toString())}function getLinkedObjects(element,symbol){if(validateInstance(element,HTMLElement),validateSymbol(symbol),void 0===(null==element?void 0:element[symbol]))throw new Error("there is no object link for "+symbol.toString());return null==element?void 0:element[symbol][Symbol.iterator]()}function addAttributeToken(element,key,token){return validateInstance(element,HTMLElement),validateString(token),validateString(key),element.hasAttribute(key)?(element.setAttribute(key,new TokenList(element.getAttribute(key)).add(token).toString()),element):(element.setAttribute(key,token),element)}function removeAttributeToken(element,key,token){return validateInstance(element,HTMLElement),validateString(token),validateString(key),element.hasAttribute(key)?(element.setAttribute(key,new TokenList(element.getAttribute(key)).remove(token).toString()),element):element}function containsAttributeToken(element,key,token){return validateInstance(element,HTMLElement),validateString(token),validateString(key),!!element.hasAttribute(key)&&new TokenList(element.getAttribute(key)).contains(token)}function findClosestByAttribute(element,key,value){if(validateInstance(element,getGlobalFunction("HTMLElement")),element.hasAttribute(key)&&element.getAttribute(key)===value)return element;var selector=validateString(key);void 0!==value&&(selector+="="+validateString(value));var result=element.closest("["+selector+"]");return result instanceof HTMLElement?result:void 0}function locale_typeof(obj){return(locale_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function locale_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function locale_setPrototypeOf(o,p){return(locale_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function locale_createSuper(Derived){var hasNativeReflectConstruct=function locale_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}}();return function _createSuperInternal(){var result,Super=locale_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=locale_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return locale_possibleConstructorReturn(this,result)}}function locale_possibleConstructorReturn(self,call){if(call&&("object"===locale_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function locale_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function locale_getPrototypeOf(o){return(locale_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.DOM",Updater),assignToNamespace("Monster.DOM",getLinkedObjects,addToObjectLink,(function removeObjectLink(element,symbol){return validateInstance(element,HTMLElement),validateSymbol(symbol),void 0===(null==element?void 0:element[symbol])||(removeAttributeToken(element,"data-monster-objectlink",symbol.toString()),delete element[symbol]),element}),findClosestByAttribute,hasObjectLink,(function clearAttributeTokens(element,key){return validateInstance(element,HTMLElement),validateString(key),element.hasAttribute(key)?(element.setAttribute(key,""),element):element}),(function replaceAttributeToken(element,key,from,to){return validateInstance(element,HTMLElement),validateString(from),validateString(to),validateString(key),element.hasAttribute(key)?(element.setAttribute(key,new TokenList(element.getAttribute(key)).replace(from,to).toString()),element):element}),containsAttributeToken,removeAttributeToken,addAttributeToken,(function toggleAttributeToken(element,key,token){return validateInstance(element,HTMLElement),validateString(token),validateString(key),element.hasAttribute(key)?(element.setAttribute(key,new TokenList(element.getAttribute(key)).toggle(token).toString()),element):(element.setAttribute(key,token),element)}));var propertiesSymbol=Symbol("properties"),localeStringSymbol=Symbol("localeString"),Locale=function(_Base){!function locale_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&locale_setPrototypeOf(subClass,superClass)}(Locale,_Base);var _super=locale_createSuper(Locale);function Locale(language,region,script,variants,extlang,privateUse){var _this;!function locale_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Locale),(_this=_super.call(this))[propertiesSymbol]={language:void 0===language?void 0:validateString(language),script:void 0===script?void 0:validateString(script),region:void 0===region?void 0:validateString(region),variants:void 0===variants?void 0:validateString(variants),extlang:void 0===extlang?void 0:validateString(extlang),privateUse:void 0===privateUse?void 0:validateString(privateUse)};var s=[];if(void 0!==language&&s.push(language),void 0!==script&&s.push(script),void 0!==region&&s.push(region),void 0!==variants&&s.push(variants),void 0!==extlang&&s.push(extlang),void 0!==privateUse&&s.push(privateUse),0===s.length)throw new Error("unsupported locale");return _this[localeStringSymbol]=s.join("-"),_this}return function locale_createClass(Constructor,protoProps,staticProps){return protoProps&&locale_defineProperties(Constructor.prototype,protoProps),staticProps&&locale_defineProperties(Constructor,staticProps),Constructor}(Locale,[{key:"localeString",get:function get(){return this[localeStringSymbol]}},{key:"language",get:function get(){return this[propertiesSymbol].language}},{key:"region",get:function get(){return this[propertiesSymbol].region}},{key:"script",get:function get(){return this[propertiesSymbol].script}},{key:"variants",get:function get(){return this[propertiesSymbol].variants}},{key:"extlang",get:function get(){return this[propertiesSymbol].extlang}},{key:"privateUse",get:function get(){return this[propertiesSymbol].privateValue}},{key:"toString",value:function toString(){return""+this.localeString}},{key:"getMap",value:function getMap(){return clone(this[propertiesSymbol])}}]),Locale}(Base);function parseLocale(locale){locale=validateString(locale).replace(/_/g,"-");var language,region,variants,parts,script,extlang,match,regex=new RegExp("^(((en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang))|((([A-Za-z]{2,3}(-([A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4}|[A-Za-z]{5,8})(-([A-Za-z]{4}))?(-([A-Za-z]{2}|[0-9]{3}))?(-([A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-([0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(x(-[A-Za-z0-9]{1,8})+))?)|(x(-[A-Za-z0-9]{1,8})+))$");if(null!==(match=regex.exec(locale))&&match.index===regex.lastIndex&®ex.lastIndex++,null==match)throw new Error("unsupported locale");return void 0!==match[6]&&(parts=(language=match[6]).split("-")).length>1&&(language=parts[0],extlang=parts[1]),void 0!==match[14]&&(region=match[14]),void 0!==match[12]&&(script=match[12]),void 0!==match[16]&&(variants=match[16]),new Locale(language,region,script,variants,extlang)}assignToNamespace("Monster.I18n",Locale,parseLocale);function typeOf(value){var type={}.toString.call(value).match(/\s([a-zA-Z]+)/)[1];if("Object"===type){var results=/^(class|function)\s+(\w+)/.exec(value.constructor.toString());type=results&&results.length>2?results[2]:""}return type.toLowerCase()}function extend(){var o,i;for(i=0;i<arguments.length;i++){var a=arguments[i];if(!isObject(a)&&!isArray(a))throw new Error("unsuported argument "+JSON.stringify(a));if(void 0!==o)for(var k in a){var _o,v=null==a?void 0:a[k];if(v!==(null===(_o=o)||void 0===_o?void 0:_o[k]))if(isObject(v)||isArray(v)){if(void 0===o[k]&&(isArray(v)?o[k]=[]:o[k]={}),typeOf(o[k])!==typeOf(v))throw new Error("type mismatch: "+JSON.stringify(o[k])+" != "+JSON.stringify(v));o[k]=extend(o[k],v)}else o[k]=v}else o=a}return o}assignToNamespace("Monster.DOM",(function getLocaleOfDocument(){var html=getDocument().querySelector("html");if(html instanceof HTMLElement&&html.hasAttribute("lang")){var locale=html.getAttribute("lang");if(locale)return new parseLocale(locale)}return parseLocale("en")})),assignToNamespace("Monster.Types",typeOf),assignToNamespace("Monster.Data",extend);function customelement_typeof(obj){return(customelement_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function customelement_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=customelement_unsupportedIterableToArray(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e2){throw _e2},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e3){didErr=!0,err=_e3},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function customelement_slicedToArray(arr,i){return function customelement_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function customelement_iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||customelement_unsupportedIterableToArray(arr,i)||function customelement_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function customelement_unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return customelement_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?customelement_arrayLikeToArray(o,minLen):void 0}}function customelement_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function customelement_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function customelement_possibleConstructorReturn(self,call){if(call&&("object"===customelement_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return customelement_assertThisInitialized(self)}function customelement_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function customelement_wrapNativeSuper(Class){var _cache="function"==typeof Map?new Map:void 0;return(customelement_wrapNativeSuper=function _wrapNativeSuper(Class){if(null===Class||!function customelement_isNativeFunction(fn){return-1!==Function.toString.call(fn).indexOf("[native code]")}(Class))return Class;if("function"!=typeof Class)throw new TypeError("Super expression must either be null or a function");if(void 0!==_cache){if(_cache.has(Class))return _cache.get(Class);_cache.set(Class,Wrapper)}function Wrapper(){return customelement_construct(Class,arguments,customelement_getPrototypeOf(this).constructor)}return Wrapper.prototype=Object.create(Class.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),customelement_setPrototypeOf(Wrapper,Class)})(Class)}function customelement_construct(Parent,args,Class){return(customelement_construct=customelement_isNativeReflectConstruct()?Reflect.construct:function _construct(Parent,args,Class){var a=[null];a.push.apply(a,args);var instance=new(Function.bind.apply(Parent,a));return Class&&customelement_setPrototypeOf(instance,Class.prototype),instance}).apply(null,arguments)}function customelement_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 customelement_setPrototypeOf(o,p){return(customelement_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function customelement_getPrototypeOf(o){return(customelement_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}var internalDataSymbol=Symbol.for("monsterInternalData"),objectLinkSymbol=Symbol.for("monsterUpdater"),initMethodSymbol=Symbol("initMethodSymbol"),assembleMethodSymbol=Symbol("assembleMethodSymbol"),CustomElement=function(_HTMLElement){!function customelement_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&customelement_setPrototypeOf(subClass,superClass)}(CustomElement,_HTMLElement);var _super=function customelement_createSuper(Derived){var hasNativeReflectConstruct=customelement_isNativeReflectConstruct();return function _createSuperInternal(){var result,Super=customelement_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=customelement_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return customelement_possibleConstructorReturn(this,result)}}(CustomElement);function CustomElement(){var _this;return function customelement_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,CustomElement),(_this=_super.call(this))[internalDataSymbol]=new ProxyObserver({options:extend({},_this.defaults,getOptionsFromAttributes.call(customelement_assertThisInitialized(_this)))}),initOptionObserver.call(customelement_assertThisInitialized(_this)),_this[initMethodSymbol](),_this}return function customelement_createClass(Constructor,protoProps,staticProps){return protoProps&&customelement_defineProperties(Constructor.prototype,protoProps),staticProps&&customelement_defineProperties(Constructor,staticProps),Constructor}(CustomElement,[{key:"attachObserver",value:function attachObserver(observer){return this[internalDataSymbol].attachObserver(observer),this}},{key:"detachObserver",value:function detachObserver(observer){return this[internalDataSymbol].detachObserver(observer),this}},{key:"containsObserver",value:function containsObserver(observer){return this[internalDataSymbol].containsObserver(observer)}},{key:"defaults",get:function get(){return{shadowMode:"open",delegatesFocus:!0,templates:{main:void 0}}}},{key:"getOption",value:function getOption(path,defaultValue){var value;try{value=new Pathfinder(this[internalDataSymbol].getRealSubject().options).getVia(path)}catch(e){}return void 0===value?defaultValue:value}},{key:"setOption",value:function setOption(path,value){return new Pathfinder(this[internalDataSymbol].getSubject().options).setVia(path,value),this}},{key:"setOptions",value:function setOptions(options){isString(options)&&(options=parseOptionsJSON(options));return extend(this[internalDataSymbol].getSubject().options,this.defaults,options),this}},{key:initMethodSymbol,value:function value(){return this}},{key:assembleMethodSymbol,value:function value(){var elements,self=this;if(!1!==this.getOption("shadowMode",!1))try{initShadowRoot.call(this),elements=this.shadowRoot.childNodes}catch(e){}elements instanceof NodeList||(initHtmlContent.call(this),elements=this.childNodes);var updater=new Set;addToObjectLink(this,objectLinkSymbol,updater);for(var _loop=function _loop(){var element=customelement_slicedToArray(_Object$entries[_i],2)[1];if(!(element instanceof HTMLElement))return"continue";if(element instanceof HTMLTemplateElement)return"continue";var u=new Updater(element,clone(self[internalDataSymbol].getRealSubject().options));updater.add(u),u.run().then((function(){u.enableEventProcessing()}))},_i=0,_Object$entries=Object.entries(elements);_i<_Object$entries.length;_i++)_loop();return this}},{key:"connectedCallback",value:function connectedCallback(){var self=this;hasObjectLink(self,objectLinkSymbol)||setTimeout((function(){self[assembleMethodSymbol]()}),0)}},{key:"disconnectedCallback",value:function disconnectedCallback(){}},{key:"adoptedCallback",value:function adoptedCallback(){}},{key:"attributeChangedCallback",value:function attributeChangedCallback(attrName,oldVal,newVal){"data-monster-options"===attrName&&this.setOptions(newVal)}}],[{key:"observedAttributes",get:function get(){return["data-monster-options"]}},{key:"getTag",value:function getTag(){throw new Error("the method getTag must be overwritten by the derived class.")}},{key:"getCSSStyleSheet",value:function getCSSStyleSheet(){}}]),CustomElement}(customelement_wrapNativeSuper(HTMLElement));function initOptionObserver(){var self=this;self.attachObserver(new Observer((function(){if(hasObjectLink(self,Symbol.for("monsterUpdater"))){var _step,_iterator=customelement_createForOfIteratorHelper(getLinkedObjects(self,Symbol.for("monsterUpdater")));try{for(_iterator.s();!(_step=_iterator.n()).done;){var _step2,_iterator2=customelement_createForOfIteratorHelper(_step.value);try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var updater=_step2.value,d=clone(self[internalDataSymbol].getRealSubject().options);Object.assign(updater.getSubject(),d)}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}}}catch(err){_iterator.e(err)}finally{_iterator.f()}}})))}function getOptionsFromAttributes(){if(this.hasAttribute("data-monster-options"))try{return parseOptionsJSON(this.getAttribute("data-monster-options"))}catch(e){throw new Error("the options attribute data-monster-options does not contain a valid json definition (actual: "+this.getAttribute("data-monster-options")+").")}return{}}function parseOptionsJSON(data){if(isString(data))try{var obj=JSON.parse(data);return validateObject(obj),obj}catch(e){throw new Error("the options does not contain a valid json definition (actual: "+data+").")}return{}}function initHtmlContent(){try{var template=findDocumentTemplate(this.constructor.getTag());this.appendChild(template.createDocumentFragment())}catch(e){var html=this.getOption("templates.main","");isString(html)&&html.length>0&&(this.innerHTML=html)}return this}function initShadowRoot(){var template,html;try{template=findDocumentTemplate(this.constructor.getTag())}catch(e){if(!isString(html=this.getOption("templates.main",""))||void 0===html||""===html)throw new Error("html is not set.")}this.attachShadow({mode:this.getOption("shadowMode","open"),delegatesFocus:this.getOption("delegatesFocus",!0)});var styleSheet=this.constructor.getCSSStyleSheet();return styleSheet instanceof CSSStyleSheet&&(this.shadowRoot.adoptedStyleSheets=[styleSheet]),template instanceof Template?(this.shadowRoot.appendChild(template.createDocumentFragment()),this):(this.shadowRoot.innerHTML=html,this)}function customcontrol_typeof(obj){return(customcontrol_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function customcontrol_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function customcontrol_get(target,property,receiver){return(customcontrol_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(target,property,receiver){var base=function customcontrol_superPropBase(object,property){for(;!Object.prototype.hasOwnProperty.call(object,property)&&null!==(object=customcontrol_getPrototypeOf(object)););return object}(target,property);if(base){var desc=Object.getOwnPropertyDescriptor(base,property);return desc.get?desc.get.call(receiver):desc.value}})(target,property,receiver||target)}function customcontrol_setPrototypeOf(o,p){return(customcontrol_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function customcontrol_createSuper(Derived){var hasNativeReflectConstruct=function customcontrol_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}}();return function _createSuperInternal(){var result,Super=customcontrol_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=customcontrol_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return customcontrol_possibleConstructorReturn(this,result)}}function customcontrol_possibleConstructorReturn(self,call){if(call&&("object"===customcontrol_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function customcontrol_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function customcontrol_getPrototypeOf(o){return(customcontrol_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.DOM",CustomElement,(function registerCustomElement(element){validateFunction(element),getGlobalObject("customElements").define(element.getTag(),element)}));var internalSymbol=Symbol("internalSymbol");function getInternal(){if(!(internalSymbol in this))throw new Error("ElementInternals is not supported and a polyfill is necessary");return this[internalSymbol]}function assembler_typeof(obj){return(assembler_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function assembler_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function assembler_setPrototypeOf(o,p){return(assembler_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function assembler_createSuper(Derived){var hasNativeReflectConstruct=function assembler_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}}();return function _createSuperInternal(){var result,Super=assembler_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=assembler_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return assembler_possibleConstructorReturn(this,result)}}function assembler_possibleConstructorReturn(self,call){if(call&&("object"===assembler_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function assembler_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function assembler_getPrototypeOf(o){return(assembler_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.DOM",function(_CustomElement){!function customcontrol_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&customcontrol_setPrototypeOf(subClass,superClass)}(CustomControl,_CustomElement);var _super=customcontrol_createSuper(CustomControl);function CustomControl(){var _this;return function customcontrol_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,CustomControl),"function"==typeof(_this=_super.call(this)).attachInternals&&(_this[internalSymbol]=_this.attachInternals()),_this}return function customcontrol_createClass(Constructor,protoProps,staticProps){return protoProps&&customcontrol_defineProperties(Constructor.prototype,protoProps),staticProps&&customcontrol_defineProperties(Constructor,staticProps),Constructor}(CustomControl,[{key:"defaults",get:function get(){return extend({},customcontrol_get(customcontrol_getPrototypeOf(CustomControl.prototype),"defaults",this))}},{key:"value",get:function get(){throw Error("the value getter must be overwritten by the derived class")},set:function set(value){throw Error("the value setter must be overwritten by the derived class")}},{key:"setFormValue",value:function setFormValue(value,state){getInternal.call(this).setFormValue(value,state)}},{key:"setValidity",value:function setValidity(flags,message,anchor){getInternal.call(this).setValidity(flags,message,anchor)}},{key:"checkValidity",value:function checkValidity(){var _getInternal$call;return null===(_getInternal$call=getInternal.call(this))||void 0===_getInternal$call?void 0:_getInternal$call.checkValidity()}},{key:"reportValidity",value:function reportValidity(){var _getInternal$call2;return null===(_getInternal$call2=getInternal.call(this))||void 0===_getInternal$call2?void 0:_getInternal$call2.reportValidity()}},{key:"labels",get:function get(){var _getInternal$call3;return null===(_getInternal$call3=getInternal.call(this))||void 0===_getInternal$call3?void 0:_getInternal$call3.labels}},{key:"name",get:function get(){return this.getAttribute("name")}},{key:"type",get:function get(){return this.constructor.getTag()}},{key:"validity",get:function get(){var _getInternal$call4;return null===(_getInternal$call4=getInternal.call(this))||void 0===_getInternal$call4?void 0:_getInternal$call4.validity}},{key:"validationMessage",get:function get(){var _getInternal$call5;return null===(_getInternal$call5=getInternal.call(this))||void 0===_getInternal$call5?void 0:_getInternal$call5.validationMessage}},{key:"willValidate",get:function get(){var _getInternal$call6;return null===(_getInternal$call6=getInternal.call(this))||void 0===_getInternal$call6?void 0:_getInternal$call6.willValidate}},{key:"states",get:function get(){var _getInternal$call7;return null===(_getInternal$call7=getInternal.call(this))||void 0===_getInternal$call7?void 0:_getInternal$call7.states}},{key:"form",get:function get(){var _getInternal$call8;return null===(_getInternal$call8=getInternal.call(this))||void 0===_getInternal$call8?void 0:_getInternal$call8.form}}],[{key:"formAssociated",get:function get(){return!0}}]),CustomControl}(CustomElement));function events_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function events_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return events_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return events_arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function events_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function basewithoptions_typeof(obj){return(basewithoptions_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function basewithoptions_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function basewithoptions_setPrototypeOf(o,p){return(basewithoptions_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function basewithoptions_createSuper(Derived){var hasNativeReflectConstruct=function basewithoptions_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}}();return function _createSuperInternal(){var result,Super=basewithoptions_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=basewithoptions_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return basewithoptions_possibleConstructorReturn(this,result)}}function basewithoptions_possibleConstructorReturn(self,call){if(call&&("object"===basewithoptions_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function basewithoptions_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function basewithoptions_getPrototypeOf(o){return(basewithoptions_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.DOM",function(_Base){!function assembler_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&assembler_setPrototypeOf(subClass,superClass)}(Assembler,_Base);var _super=assembler_createSuper(Assembler);function Assembler(fragment){var _this;return function assembler_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Assembler),(_this=_super.call(this)).attributePrefix="data-monster-",validateInstance(fragment,getGlobalFunction("DocumentFragment")),_this.fragment=fragment,_this}return function assembler_createClass(Constructor,protoProps,staticProps){return protoProps&&assembler_defineProperties(Constructor.prototype,protoProps),staticProps&&assembler_defineProperties(Constructor,staticProps),Constructor}(Assembler,[{key:"setAttributePrefix",value:function setAttributePrefix(prefix){return validateString(prefix),this.attributePrefix=prefix,this}},{key:"getAttributePrefix",value:function getAttributePrefix(){return this.attributePrefix}},{key:"createDocumentFragment",value:function createDocumentFragment(data){return void 0===data&&(data=new ProxyObserver({})),validateInstance(data,ProxyObserver),this.fragment.cloneNode(!0)}}]),Assembler}(Base)),assignToNamespace("Monster.DOM",(function findTargetElementFromEvent(event,attributeName,attributeValue){if(validateInstance(event,Event),"function"!=typeof event.composedPath)throw new Error("unsupported event");var path=event.composedPath(),element=null==path?void 0:path[0];if(element instanceof HTMLElement)return findClosestByAttribute(element,attributeName,attributeValue)}),(function fireEvent(element,type){if(getDocument(),element instanceof HTMLElement){if("click"===type)return void element.click();var event=new Event(validateString(type),{bubbles:!0,cancelable:!0});element.dispatchEvent(event)}else{if(!(element instanceof HTMLCollection||element instanceof NodeList))throw new TypeError("value is not an instance of HTMLElement or HTMLCollection");var _step,_iterator=events_createForOfIteratorHelper(element);try{for(_iterator.s();!(_step=_iterator.n()).done;){fireEvent(_step.value,type)}}catch(err){_iterator.e(err)}finally{_iterator.f()}}}));var optionsSymbol=Symbol.for("monsterInternalData"),BaseWithOptions=function(_Base){!function basewithoptions_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&basewithoptions_setPrototypeOf(subClass,superClass)}(BaseWithOptions,_Base);var _super=basewithoptions_createSuper(BaseWithOptions);function BaseWithOptions(options){var _this;return function basewithoptions_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,BaseWithOptions),void 0===options&&(options={}),(_this=_super.call(this))[optionsSymbol]=extend({},_this.defaults,validateObject(options)),_this}return function basewithoptions_createClass(Constructor,protoProps,staticProps){return protoProps&&basewithoptions_defineProperties(Constructor.prototype,protoProps),staticProps&&basewithoptions_defineProperties(Constructor,staticProps),Constructor}(BaseWithOptions,[{key:"defaults",get:function get(){return{}}},{key:"getOption",value:function getOption(path,defaultValue){var value;try{value=new Pathfinder(this[optionsSymbol]).getVia(path)}catch(e){}return void 0===value?defaultValue:value}}]),BaseWithOptions}(Base);function translations_typeof(obj){return(translations_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function translations_slicedToArray(arr,i){return function translations_arrayWithHoles(arr){if(Array.isArray(arr))return arr}(arr)||function translations_iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null==_i)return;var _s,_e,_arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i)||function translations_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return translations_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return translations_arrayLikeToArray(o,minLen)}(arr,i)||function translations_nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function translations_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function translations_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function translations_setPrototypeOf(o,p){return(translations_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function translations_createSuper(Derived){var hasNativeReflectConstruct=function translations_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}}();return function _createSuperInternal(){var result,Super=translations_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=translations_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return translations_possibleConstructorReturn(this,result)}}function translations_possibleConstructorReturn(self,call){if(call&&("object"===translations_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function translations_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function translations_getPrototypeOf(o){return(translations_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.Types",BaseWithOptions);var Translations=function(_Base){!function translations_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&translations_setPrototypeOf(subClass,superClass)}(Translations,_Base);var _super=translations_createSuper(Translations);function Translations(locale){var _this;return function translations_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Translations),_this=_super.call(this),isString(locale)&&(locale=parseLocale(locale)),_this.locale=validateInstance(locale,Locale),_this.storage=new Map,_this}return function translations_createClass(Constructor,protoProps,staticProps){return protoProps&&translations_defineProperties(Constructor.prototype,protoProps),staticProps&&translations_defineProperties(Constructor,staticProps),Constructor}(Translations,[{key:"getText",value:function getText(key,defaultText){if(!this.storage.has(key)){if(void 0===defaultText)throw new Error("key "+key+" not found");return validateString(defaultText)}return isObject(this.storage.get(key))?this.getPluralRuleText(key,"other",defaultText):this.storage.get(key)}},{key:"getPluralRuleText",value:function getPluralRuleText(key,count,defaultText){if(!this.storage.has(key))return validateString(defaultText);var keyword,r=validateObject(this.storage.get(key));if(isString(count))keyword=count.toLocaleString();else{if(0===(count=validateInteger(count))&&r.hasOwnProperty("zero"))return validateString(r.zero);keyword=new Intl.PluralRules(this.locale.toString()).select(validateInteger(count))}return r.hasOwnProperty(keyword)?validateString(r[keyword]):r.hasOwnProperty(DEFAULT_KEY)?validateString(r[DEFAULT_KEY]):validateString(defaultText)}},{key:"setText",value:function setText(key,text){if(isString(text)||isObject(text))return this.storage.set(validateString(key),text),this;throw new TypeError("value is not a string or object")}},{key:"assignTranslations",value:function assignTranslations(translations){validateObject(translations);for(var _i=0,_Object$entries=Object.entries(translations);_i<_Object$entries.length;_i++){var _Object$entries$_i=translations_slicedToArray(_Object$entries[_i],2),k=_Object$entries$_i[0],v=_Object$entries$_i[1];this.setText(k,v)}return this}}]),Translations}(Base);function provider_typeof(obj){return(provider_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function provider_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function provider_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function provider_setPrototypeOf(o,p){return(provider_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function provider_createSuper(Derived){var hasNativeReflectConstruct=function provider_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}}();return function _createSuperInternal(){var result,Super=provider_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=provider_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return provider_possibleConstructorReturn(this,result)}}function provider_possibleConstructorReturn(self,call){if(call&&("object"===provider_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function provider_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function provider_getPrototypeOf(o){return(provider_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.I18n",Translations);var Provider=function(_BaseWithOptions){!function provider_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&provider_setPrototypeOf(subClass,superClass)}(Provider,_BaseWithOptions);var _super=provider_createSuper(Provider);function Provider(){return provider_classCallCheck(this,Provider),_super.apply(this,arguments)}return function provider_createClass(Constructor,protoProps,staticProps){return protoProps&&provider_defineProperties(Constructor.prototype,protoProps),staticProps&&provider_defineProperties(Constructor,staticProps),Constructor}(Provider,[{key:"getTranslations",value:function getTranslations(locale){return new Promise((function(resolve,reject){try{resolve(new Translations(locale))}catch(e){reject(e)}}))}}]),Provider}(BaseWithOptions);function fetch_typeof(obj){return(fetch_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function fetch_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function fetch_setPrototypeOf(o,p){return(fetch_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function fetch_createSuper(Derived){var hasNativeReflectConstruct=function fetch_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}}();return function _createSuperInternal(){var result,Super=fetch_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=fetch_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return fetch_possibleConstructorReturn(this,result)}}function fetch_possibleConstructorReturn(self,call){if(call&&("object"===fetch_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return fetch_assertThisInitialized(self)}function fetch_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function fetch_get(target,property,receiver){return(fetch_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(target,property,receiver){var base=function fetch_superPropBase(object,property){for(;!Object.prototype.hasOwnProperty.call(object,property)&&null!==(object=fetch_getPrototypeOf(object)););return object}(target,property);if(base){var desc=Object.getOwnPropertyDescriptor(base,property);return desc.get?desc.get.call(receiver):desc.value}})(target,property,receiver||target)}function fetch_getPrototypeOf(o){return(fetch_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.I18n",Provider);var fetch_optionsSymbol=Symbol.for("monsterInternalData");function version_typeof(obj){return(version_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function version_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function version_setPrototypeOf(o,p){return(version_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function version_createSuper(Derived){var hasNativeReflectConstruct=function version_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}}();return function _createSuperInternal(){var result,Super=version_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=version_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return version_possibleConstructorReturn(this,result)}}function version_possibleConstructorReturn(self,call){if(call&&("object"===version_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function version_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function version_getPrototypeOf(o){return(version_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}assignToNamespace("Monster.I18n.Providers",function(_Provider){!function fetch_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&fetch_setPrototypeOf(subClass,superClass)}(Fetch,_Provider);var _super=fetch_createSuper(Fetch);function Fetch(url,options){var _thisSuper,_this;return function fetch_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Fetch),_this=_super.call(this,options),isInstance(url,URL)&&(url=url.toString()),void 0===options&&(options={}),validateString(url),_this.url=url,_this[fetch_optionsSymbol]=extend({},fetch_get((_thisSuper=fetch_assertThisInitialized(_this),fetch_getPrototypeOf(Fetch.prototype)),"defaults",_thisSuper),_this.defaults,validateObject(options)),_this}return function fetch_createClass(Constructor,protoProps,staticProps){return protoProps&&fetch_defineProperties(Constructor.prototype,protoProps),staticProps&&fetch_defineProperties(Constructor,staticProps),Constructor}(Fetch,[{key:"defaults",get:function get(){return{fetch:{method:"GET",mode:"cors",cache:"no-cache",credentials:"omit",redirect:"follow",referrerPolicy:"no-referrer"}}}},{key:"getTranslations",value:function getTranslations(locale){isString(locale)&&(locale=parseLocale(locale));var formatter=new Formatter(locale.getMap());return getGlobalFunction("fetch")(formatter.format(this.url),this.getOption("fetch",{})).then((function(response){return response.json()})).then((function(data){return new Translations(locale).assignTranslations(data)}))}}]),Fetch}(Provider));var monsterVersion,Version=function(_Base){!function version_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&version_setPrototypeOf(subClass,superClass)}(Version,_Base);var _super=version_createSuper(Version);function Version(major,minor,patch){var _this;if(function version_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Version),_this=_super.call(this),"string"==typeof major&&void 0===minor&&void 0===patch){var parts=major.toString().split(".");major=parseInt(parts[0]||0),minor=parseInt(parts[1]||0),patch=parseInt(parts[2]||0)}if(void 0===major)throw new Error("major version is undefined");if(void 0===minor&&(minor=0),void 0===patch&&(patch=0),_this.major=parseInt(major),_this.minor=parseInt(minor),_this.patch=parseInt(patch),isNaN(_this.major))throw new Error("major is not a number");if(isNaN(_this.minor))throw new Error("minor is not a number");if(isNaN(_this.patch))throw new Error("patch is not a number");return _this}return function version_createClass(Constructor,protoProps,staticProps){return protoProps&&version_defineProperties(Constructor.prototype,protoProps),staticProps&&version_defineProperties(Constructor,staticProps),Constructor}(Version,[{key:"toString",value:function toString(){return this.major+"."+this.minor+"."+this.patch}},{key:"compareTo",value:function compareTo(version){if(version instanceof Version&&(version=version.toString()),"string"!=typeof version)throw new Error("type exception");if(version===this.toString())return 0;for(var a=[this.major,this.minor,this.patch],b=version.split("."),len=Math.max(a.length,b.length),i=0;i<len;i+=1){if(a[i]&&!b[i]&&parseInt(a[i])>0||parseInt(a[i])>parseInt(b[i]))return 1;if(b[i]&&!a[i]&&parseInt(b[i])>0||parseInt(a[i])<parseInt(b[i]))return-1}return 0}}]),Version}(Base);function random(min,max){if(void 0===min&&(min=0),void 0===max&&(max=MAX),max<min)throw new Error("max must be greater than min");return Math.round(create(min,max))}assignToNamespace("Monster.Types",Version),assignToNamespace("Monster",(function getVersion(){return monsterVersion instanceof Version?monsterVersion:monsterVersion=new Version("1.15.0")}));var MAX=1e9;function create(min,max){var crypt,globalReference=getGlobal();if(void 0===(crypt=(null==globalReference?void 0:globalReference.crypto)||(null==globalReference?void 0:globalReference.msCrypto)||(null==globalReference?void 0:globalReference.crypto)||void 0))throw new Error("missing crypt");var rval=0,range=max-min;if(range<2)throw new Error("the distance is too small to create a random number.");var bitsNeeded=Math.ceil(Math.log2(range));if(bitsNeeded>53)throw new Error("we cannot generate numbers larger than 53 bits.");var bytesNeeded=Math.ceil(bitsNeeded/8),mask=Math.pow(2,bitsNeeded)-1,byteArray=new Uint8Array(bytesNeeded);crypt.getRandomValues(byteArray);for(var p=8*(bytesNeeded-1),i=0;i<bytesNeeded;i++)rval+=byteArray[i]*Math.pow(2,p),p-=8;return(rval&=mask)>=range?create(min,max):min+rval}function randomid_typeof(obj){return(randomid_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function randomid_setPrototypeOf(o,p){return(randomid_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function randomid_createSuper(Derived){var hasNativeReflectConstruct=function randomid_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}}();return function _createSuperInternal(){var result,Super=randomid_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=randomid_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return randomid_possibleConstructorReturn(this,result)}}function randomid_possibleConstructorReturn(self,call){if(call&&("object"===randomid_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function randomid_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function randomid_getPrototypeOf(o){return(randomid_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}Math.log2=Math.log2||function(n){return Math.log(n)/Math.log(2)},assignToNamespace("Monster.Math",random);var rootName,randomid_internalCounter=0;function comparator_typeof(obj){return(comparator_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function comparator_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function comparator_setPrototypeOf(o,p){return(comparator_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function comparator_createSuper(Derived){var hasNativeReflectConstruct=function comparator_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}}();return function _createSuperInternal(){var result,Super=comparator_getPrototypeOf(Derived);if(hasNativeReflectConstruct){var NewTarget=comparator_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return comparator_possibleConstructorReturn(this,result)}}function comparator_possibleConstructorReturn(self,call){if(call&&("object"===comparator_typeof(call)||"function"==typeof call))return call;if(void 0!==call)throw new TypeError("Derived constructors may only return object or undefined");return function comparator_assertThisInitialized(self){if(void 0===self)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}(self)}function comparator_getPrototypeOf(o){return(comparator_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function freeze_typeof(obj){return(freeze_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function freeze_createForOfIteratorHelper(o,allowArrayLike){var it="undefined"!=typeof Symbol&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=function freeze_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return freeze_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return freeze_arrayLikeToArray(o,minLen)}(o))||allowArrayLike&&o&&"number"==typeof o.length){it&&(o=it);var i=0,F=function F(){};return{s:F,n:function n(){return i>=o.length?{done:!0}:{done:!1,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var err,normalCompletion=!0,didErr=!1;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();return normalCompletion=step.done,step},e:function e(_e2){didErr=!0,err=_e2},f:function f(){try{normalCompletion||null==it.return||it.return()}finally{if(didErr)throw err}}}}function freeze_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function buildmap_typeof(obj){return(buildmap_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(obj){return typeof obj}:function _typeof(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj})(obj)}function buildmap_toConsumableArray(arr){return function buildmap_arrayWithoutHoles(arr){if(Array.isArray(arr))return buildmap_arrayLikeToArray(arr)}(arr)||function buildmap_iterableToArray(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}(arr)||function buildmap_unsupportedIterableToArray(o,minLen){if(!o)return;if("string"==typeof o)return buildmap_arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);"Object"===n&&o.constructor&&(n=o.constructor.name);if("Map"===n||"Set"===n)return Array.from(o);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return buildmap_arrayLikeToArray(o,minLen)}(arr)||function buildmap_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 buildmap_arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function buildmap_wrapRegExp(){buildmap_wrapRegExp=function _wrapRegExp(re,groups){return new BabelRegExp(re,void 0,groups)};var _super=RegExp.prototype,_groups=new WeakMap;function BabelRegExp(re,flags,groups){var _this=new RegExp(re,flags);return _groups.set(_this,groups||_groups.get(re)),buildmap_setPrototypeOf(_this,BabelRegExp.prototype)}function buildGroups(result,re){var g=_groups.get(re);return Object.keys(g).reduce((function(groups,name){return groups[name]=result[g[name]],groups}),Object.create(null))}return buildmap_inherits(BabelRegExp,RegExp),BabelRegExp.prototype.exec=function(str){var result=_super.exec.call(this,str);return result&&(result.groups=buildGroups(result,this)),result},BabelRegExp.prototype[Symbol.replace]=function(str,substitution){if("string"==typeof substitution){var groups=_groups.get(this);return _super[Symbol.replace].call(this,str,substitution.replace(/\$<([^>]+)>/g,(function(_,name){return"$"+groups[name]})))}if("function"==typeof substitution){var _this=this;return _super[Symbol.replace].call(this,str,(function(){var args=arguments;return"object"!==buildmap_typeof(args[args.length-1])&&(args=[].slice.call(args)).push(buildGroups(args,_this)),substitution.apply(this,args)}))}return _super[Symbol.replace].call(this,str,substitution)},buildmap_wrapRegExp.apply(this,arguments)}function buildmap_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&buildmap_setPrototypeOf(subClass,superClass)}function buildmap_setPrototypeOf(o,p){return(buildmap_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function build(subject,definition,defaultValue){if(void 0===definition)return defaultValue||subject;validateString(definition);var regexp=buildmap_wrapRegExp(/(\$\{([\.-_a-z]*)\})/gm,{placeholder:1,path:2}),array=buildmap_toConsumableArray(definition.matchAll(regexp)),finder=new Pathfinder(subject);return 0===array.length?finder.getVia(definition):(array.forEach((function(a){var groups=null==a?void 0:a.groups,placeholder=null==groups?void 0:groups.placeholder;if(void 0!==placeholder){var path=null==groups?void 0:groups.path,v=finder.getVia(path);definition=definition.replaceAll(placeholder,v)}})),definition)}assignToNamespace("Monster.Types",function(_ID){!function randomid_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&randomid_setPrototypeOf(subClass,superClass)}(RandomID,_ID);var _super=randomid_createSuper(RandomID);function RandomID(){var _this;return function randomid_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,RandomID),_this=_super.call(this),randomid_internalCounter+=1,_this.id=getGlobal().btoa(random(1,1e4)).replace(/=/g,"").replace(/^[0-9]+/,"X")+randomid_internalCounter,_this}return RandomID}(ID)),assignToNamespace("Monster.Util",function(_Base){!function comparator_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&comparator_setPrototypeOf(subClass,superClass)}(Comparator,_Base);var _super=comparator_createSuper(Comparator);function Comparator(callback){var _this;if(function comparator_classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,Comparator),_this=_super.call(this),isFunction(callback))_this.compare=callback;else{if(void 0!==callback)throw new TypeError("unsupported type");_this.compare=function(a,b){if(comparator_typeof(a)!==comparator_typeof(b))throw new TypeError("impractical comparison");return a===b?0:a<b?-1:1}}return _this}return function comparator_createClass(Constructor,protoProps,staticProps){return protoProps&&comparator_defineProperties(Constructor.prototype,protoProps),staticProps&&comparator_defineProperties(Constructor,staticProps),Constructor}(Comparator,[{key:"reverse",value:function reverse(){var original=this.compare;return this.compare=function(a,b){return original(b,a)},this}},{key:"equal",value:function equal(a,b){return 0===this.compare(a,b)}},{key:"greaterThan",value:function greaterThan(a,b){return this.compare(a,b)>0}},{key:"greaterThanOrEqual",value:function greaterThanOrEqual(a,b){return this.greaterThan(a,b)||this.equal(a,b)}},{key:"lessThanOrEqual",value:function lessThanOrEqual(a,b){return this.lessThan(a,b)||this.equal(a,b)}},{key:"lessThan",value:function lessThan(a,b){return this.compare(a,b)<0}}]),Comparator}(Base)),assignToNamespace("Monster.Util",(function deepFreeze(object){validateObject(object);var _step,_iterator=freeze_createForOfIteratorHelper(Object.getOwnPropertyNames(object));try{for(_iterator.s();!(_step=_iterator.n()).done;){var name=_step.value,value=object[name];object[name]=value&&"object"===freeze_typeof(value)?deepFreeze(value):value}}catch(err){_iterator.e(err)}finally{_iterator.f()}return Object.freeze(object)})),assignToNamespace("Monster.Data",(function buildMap(subject,selector,valueTemplate,keyTemplate,filter){validateString(selector);var result=new Map,map=new Pathfinder(subject).getVia(selector);return map instanceof Map?(map.forEach((function(v,k,m){isFunction(filter)&&!0!==filter.call(m,v,k)||(k=build(v,keyTemplate,k),v=build(v,valueTemplate),result.set(k,v))})),result):result})),
|
3
3
|
/**
|
4
4
|
* @license
|
5
5
|
* Copyright 2021 schukai GmbH
|
6
6
|
* SPDX-License-Identifier: AGPL-3.0-only or COMMERCIAL
|
7
7
|
* @author schukai GmbH
|
8
8
|
*/
|
9
|
-
Monster.Util.deepFreeze(Monster);try{rootName=Monster.Types.getGlobalObject("__MonsterRootName__")}catch(e){}
|
9
|
+
Monster.Util.deepFreeze(Monster);try{rootName=Monster.Types.getGlobalObject("__MonsterRootName__")}catch(e){}rootName||(rootName="Monster"),Monster.Types.getGlobal()[rootName]=Monster}(),__webpack_exports__}()}));
|