@wiotp/sdk 0.8.2-alpha.2 → 0.8.2-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -38,4 +38,4 @@
38
38
  * @license MIT
39
39
  */module.exports=function(obj){return obj!=null&&(isBuffer(obj)||isSlowBuffer(obj)||!!obj._isBuffer)};function isBuffer(obj){return!!obj.constructor&&typeof obj.constructor.isBuffer==="function"&&obj.constructor.isBuffer(obj)}function isSlowBuffer(obj){return typeof obj.readFloatLE==="function"&&typeof obj.slice==="function"&&isBuffer(obj.slice(0,0))}},{}],114:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}var fnToStr=Function.prototype.toString;var reflectApply=(typeof Reflect==="undefined"?"undefined":_typeof(Reflect))==="object"&&Reflect!==null&&Reflect.apply;var badArrayLike;var isCallableMarker;if(typeof reflectApply==="function"&&typeof Object.defineProperty==="function"){try{badArrayLike=Object.defineProperty({},"length",{get:function get(){throw isCallableMarker}});isCallableMarker={};reflectApply((function(){throw 42}),null,badArrayLike)}catch(_){if(_!==isCallableMarker){reflectApply=null}}}else{reflectApply=null}var constructorRegex=/^\s*class\b/;var isES6ClassFn=function isES6ClassFunction(value){try{var fnStr=fnToStr.call(value);return constructorRegex.test(fnStr)}catch(e){return false}};var tryFunctionObject=function tryFunctionToStr(value){try{if(isES6ClassFn(value)){return false}fnToStr.call(value);return true}catch(e){return false}};var toStr=Object.prototype.toString;var objectClass="[object Object]";var fnClass="[object Function]";var genClass="[object GeneratorFunction]";var ddaClass="[object HTMLAllCollection]";var ddaClass2="[object HTML document.all class]";var ddaClass3="[object HTMLCollection]";var hasToStringTag=typeof Symbol==="function"&&!!Symbol.toStringTag;var isIE68=!(0 in[,]);var isDDA=function isDocumentDotAll(){return false};if((typeof document==="undefined"?"undefined":_typeof(document))==="object"){var all=document.all;if(toStr.call(all)===toStr.call(document.all)){isDDA=function isDocumentDotAll(value){if((isIE68||!value)&&(typeof value==="undefined"||_typeof(value)==="object")){try{var str=toStr.call(value);return(str===ddaClass||str===ddaClass2||str===ddaClass3||str===objectClass)&&value("")==null}catch(e){}}return false}}}module.exports=reflectApply?function isCallable(value){if(isDDA(value)){return true}if(!value){return false}if(typeof value!=="function"&&_typeof(value)!=="object"){return false}try{reflectApply(value,null,badArrayLike)}catch(e){if(e!==isCallableMarker){return false}}return!isES6ClassFn(value)&&tryFunctionObject(value)}:function isCallable(value){if(isDDA(value)){return true}if(!value){return false}if(typeof value!=="function"&&_typeof(value)!=="object"){return false}if(hasToStringTag){return tryFunctionObject(value)}if(isES6ClassFn(value)){return false}var strClass=toStr.call(value);if(strClass!==fnClass&&strClass!==genClass&&!/^\[object HTML/.test(strClass)){return false}return tryFunctionObject(value)}},{}],115:[function(require,module,exports){"use strict";var toStr=Object.prototype.toString;var fnToStr=Function.prototype.toString;var isFnRegex=/^\s*(?:function)?\*/;var hasToStringTag=require("has-tostringtag/shams")();var getProto=Object.getPrototypeOf;var getGeneratorFunc=function getGeneratorFunc(){if(!hasToStringTag){return false}try{return Function("return function*() {}")()}catch(e){}};var GeneratorFunction;module.exports=function isGeneratorFunction(fn){if(typeof fn!=="function"){return false}if(isFnRegex.test(fnToStr.call(fn))){return true}if(!hasToStringTag){var str=toStr.call(fn);return str==="[object GeneratorFunction]"}if(!getProto){return false}if(typeof GeneratorFunction==="undefined"){var generatorFunc=getGeneratorFunc();GeneratorFunction=generatorFunc?getProto(generatorFunc):false}return getProto(fn)===GeneratorFunction}},{"has-tostringtag/shams":108}],116:[function(require,module,exports){"use strict";var whichTypedArray=require("which-typed-array");module.exports=function isTypedArray(value){return!!whichTypedArray(value)}},{"which-typed-array":220}],117:[function(require,module,exports){"use strict";function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}Object.defineProperty(exports,"t",{value:true});exports.ContainerIterator=exports.Container=exports.Base=void 0;var ContainerIterator=function(){function ContainerIterator(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;_classCallCheck(this,ContainerIterator);this.iteratorType=t}return _createClass(ContainerIterator,[{key:"equals",value:function equals(t){return this.o===t.o}}])}();exports.ContainerIterator=ContainerIterator;var Base=function(){function Base(){_classCallCheck(this,Base);this.i=0}return _createClass(Base,[{key:"length",get:function get(){return this.i}},{key:"size",value:function size(){return this.i}},{key:"empty",value:function empty(){return this.i===0}}])}();exports.Base=Base;var Container=function(_Base){function Container(){_classCallCheck(this,Container);return _callSuper(this,Container,arguments)}_inherits(Container,_Base);return _createClass(Container)}(Base);exports.Container=Container},{}],118:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}Object.defineProperty(exports,"t",{value:true});exports.HashContainerIterator=exports.HashContainer=void 0;var _ContainerBase=require("../../ContainerBase");var _checkObject=_interopRequireDefault(require("../../../utils/checkObject"));var _throwError=require("../../../utils/throwError");function _interopRequireDefault(t){return t&&t.t?t:{default:t}}var HashContainerIterator=function(_ContainerBase$Contai){function HashContainerIterator(t,e,i){var _this;_classCallCheck(this,HashContainerIterator);_this=_callSuper(this,HashContainerIterator,[i]);_this.o=t;_this.h=e;if(_this.iteratorType===0){_this.pre=function(){if(this.o.L===this.h){(0,_throwError.throwIteratorAccessError)()}this.o=this.o.L;return this};_this.next=function(){if(this.o===this.h){(0,_throwError.throwIteratorAccessError)()}this.o=this.o.B;return this}}else{_this.pre=function(){if(this.o.B===this.h){(0,_throwError.throwIteratorAccessError)()}this.o=this.o.B;return this};_this.next=function(){if(this.o===this.h){(0,_throwError.throwIteratorAccessError)()}this.o=this.o.L;return this}}return _this}_inherits(HashContainerIterator,_ContainerBase$Contai);return _createClass(HashContainerIterator)}(_ContainerBase.ContainerIterator);exports.HashContainerIterator=HashContainerIterator;var HashContainer=function(_ContainerBase$Contai2){function HashContainer(){var _this2;_classCallCheck(this,HashContainer);_this2=_callSuper(this,HashContainer);_this2.H=[];_this2.g={};_this2.HASH_TAG=Symbol("@@HASH_TAG");Object.setPrototypeOf(_this2.g,null);_this2.h={};_this2.h.L=_this2.h.B=_this2.p=_this2._=_this2.h;return _this2}_inherits(HashContainer,_ContainerBase$Contai2);return _createClass(HashContainer,[{key:"V",value:function V(t){var e=t.L,i=t.B;e.B=i;i.L=e;if(t===this.p){this.p=i}if(t===this._){this._=e}this.i-=1}},{key:"M",value:function M(t,e,i){if(i===undefined)i=(0,_checkObject["default"])(t);var s;if(i){var _i=t[this.HASH_TAG];if(_i!==undefined){this.H[_i].l=e;return this.i}Object.defineProperty(t,this.HASH_TAG,{value:this.H.length,configurable:true});s={u:t,l:e,L:this._,B:this.h};this.H.push(s)}else{var _i2=this.g[t];if(_i2){_i2.l=e;return this.i}s={u:t,l:e,L:this._,B:this.h};this.g[t]=s}if(this.i===0){this.p=s;this.h.B=s}else{this._.B=s}this._=s;this.h.L=s;return++this.i}},{key:"I",value:function I(t,e){if(e===undefined)e=(0,_checkObject["default"])(t);if(e){var _e=t[this.HASH_TAG];if(_e===undefined)return this.h;return this.H[_e]}else{return this.g[t]||this.h}}},{key:"clear",value:function clear(){var t=this.HASH_TAG;this.H.forEach((function(e){delete e.u[t]}));this.H=[];this.g={};Object.setPrototypeOf(this.g,null);this.i=0;this.p=this._=this.h.L=this.h.B=this.h}},{key:"eraseElementByKey",value:function eraseElementByKey(t,e){var i;if(e===undefined)e=(0,_checkObject["default"])(t);if(e){var _e2=t[this.HASH_TAG];if(_e2===undefined)return false;delete t[this.HASH_TAG];i=this.H[_e2];delete this.H[_e2]}else{i=this.g[t];if(i===undefined)return false;delete this.g[t]}this.V(i);return true}},{key:"eraseElementByIterator",value:function eraseElementByIterator(t){var e=t.o;if(e===this.h){(0,_throwError.throwIteratorAccessError)()}this.V(e);return t.next()}},{key:"eraseElementByPos",value:function eraseElementByPos(t){if(t<0||t>this.i-1){throw new RangeError}var e=this.p;while(t--){e=e.B}this.V(e);return this.i}}])}(_ContainerBase.Container);exports.HashContainer=HashContainer},{"../../../utils/checkObject":135,"../../../utils/throwError":136,"../../ContainerBase":117}],119:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{define({},"")}catch(t){define=function define(t,e,r){return t[e]=r}}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,(function(){return this}));var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach((function(e){define(t,e,(function(t){return this._invoke(e,t)}))}))}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){invoke("next",t,i,a)}),(function(t){invoke("throw",t,i,a)})):e.resolve(h).then((function(t){u.value=t,i(u)}),(function(t){return invoke("throw",t,i,a)}))}a(c.arg)}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e((function(e,r){invoke(t,n,e,r)}))}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done}}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg)}}}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next};return i.next=i}}throw new TypeError(_typeof(e)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t},e.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,(function(){return this})),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,(function(){return this})),define(g,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next}return next.done=!0,next}},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y}},catch:function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}Object.defineProperty(exports,"t",{value:true});exports["default"]=void 0;var _Base=require("./Base");var _checkObject=_interopRequireDefault(require("../../utils/checkObject"));var _throwError=require("../../utils/throwError");function _interopRequireDefault(t){return t&&t.t?t:{default:t}}var HashMapIterator=function(_Base$HashContainerIt){function HashMapIterator(t,e,r,s){var _this;_classCallCheck(this,HashMapIterator);_this=_callSuper(this,HashMapIterator,[t,e,s]);_this.container=r;return _this}_inherits(HashMapIterator,_Base$HashContainerIt);return _createClass(HashMapIterator,[{key:"pointer",get:function get(){if(this.o===this.h){(0,_throwError.throwIteratorAccessError)()}var t=this;return new Proxy([],{get:function get(e,r){if(r==="0")return t.o.u;else if(r==="1")return t.o.l},set:function set(e,r,s){if(r!=="1"){throw new TypeError("props must be 1")}t.o.l=s;return true}})}},{key:"copy",value:function copy(){return new HashMapIterator(this.o,this.h,this.container,this.iteratorType)}}])}(_Base.HashContainerIterator);var HashMap=function(_Base$HashContainer){function HashMap(){var _this2;var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];_classCallCheck(this,HashMap);_this2=_callSuper(this,HashMap);var e=_this2;t.forEach((function(t){e.setElement(t[0],t[1])}));return _this2}_inherits(HashMap,_Base$HashContainer);return _createClass(HashMap,[{key:"begin",value:function begin(){return new HashMapIterator(this.p,this.h,this)}},{key:"end",value:function end(){return new HashMapIterator(this.h,this.h,this)}},{key:"rBegin",value:function rBegin(){return new HashMapIterator(this._,this.h,this,1)}},{key:"rEnd",value:function rEnd(){return new HashMapIterator(this.h,this.h,this,1)}},{key:"front",value:function front(){if(this.i===0)return;return[this.p.u,this.p.l]}},{key:"back",value:function back(){if(this.i===0)return;return[this._.u,this._.l]}},{key:"setElement",value:function setElement(t,e,r){return this.M(t,e,r)}},{key:"getElementByKey",value:function getElementByKey(t,e){if(e===undefined)e=(0,_checkObject["default"])(t);if(e){var _e=t[this.HASH_TAG];return _e!==undefined?this.H[_e].l:undefined}var r=this.g[t];return r?r.l:undefined}},{key:"getElementByPos",value:function getElementByPos(t){if(t<0||t>this.i-1){throw new RangeError}var e=this.p;while(t--){e=e.B}return[e.u,e.l]}},{key:"find",value:function find(t,e){var r=this.I(t,e);return new HashMapIterator(r,this.h,this)}},{key:"forEach",value:function forEach(t){var e=0;var r=this.p;while(r!==this.h){t([r.u,r.l],e++,this);r=r.B}}},{key:Symbol.iterator,value:function value(){return _regeneratorRuntime().mark((function _callee(){var t;return _regeneratorRuntime().wrap((function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:t=this.p;case 1:if(!(t!==this.h)){_context.next=7;break}_context.next=4;return[t.u,t.l];case 4:t=t.B;_context.next=1;break;case 7:case"end":return _context.stop()}}),_callee,this)})).bind(this)()}}])}(_Base.HashContainer);var _default=HashMap;exports["default"]=_default},{"../../utils/checkObject":135,"../../utils/throwError":136,"./Base":118}],120:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{define({},"")}catch(t){define=function define(t,e,r){return t[e]=r}}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,(function(){return this}));var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach((function(e){define(t,e,(function(t){return this._invoke(e,t)}))}))}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){invoke("next",t,i,a)}),(function(t){invoke("throw",t,i,a)})):e.resolve(h).then((function(t){u.value=t,i(u)}),(function(t){return invoke("throw",t,i,a)}))}a(c.arg)}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e((function(e,r){invoke(t,n,e,r)}))}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done}}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg)}}}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next};return i.next=i}}throw new TypeError(_typeof(e)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t},e.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,(function(){return this})),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,(function(){return this})),define(g,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next}return next.done=!0,next}},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y}},catch:function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}Object.defineProperty(exports,"t",{value:true});exports["default"]=void 0;var _Base=require("./Base");var _throwError=require("../../utils/throwError");var HashSetIterator=function(_Base$HashContainerIt){function HashSetIterator(t,e,r,s){var _this;_classCallCheck(this,HashSetIterator);_this=_callSuper(this,HashSetIterator,[t,e,s]);_this.container=r;return _this}_inherits(HashSetIterator,_Base$HashContainerIt);return _createClass(HashSetIterator,[{key:"pointer",get:function get(){if(this.o===this.h){(0,_throwError.throwIteratorAccessError)()}return this.o.u}},{key:"copy",value:function copy(){return new HashSetIterator(this.o,this.h,this.container,this.iteratorType)}}])}(_Base.HashContainerIterator);var HashSet=function(_Base$HashContainer){function HashSet(){var _this2;var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];_classCallCheck(this,HashSet);_this2=_callSuper(this,HashSet);var e=_this2;t.forEach((function(t){e.insert(t)}));return _this2}_inherits(HashSet,_Base$HashContainer);return _createClass(HashSet,[{key:"begin",value:function begin(){return new HashSetIterator(this.p,this.h,this)}},{key:"end",value:function end(){return new HashSetIterator(this.h,this.h,this)}},{key:"rBegin",value:function rBegin(){return new HashSetIterator(this._,this.h,this,1)}},{key:"rEnd",value:function rEnd(){return new HashSetIterator(this.h,this.h,this,1)}},{key:"front",value:function front(){return this.p.u}},{key:"back",value:function back(){return this._.u}},{key:"insert",value:function insert(t,e){return this.M(t,undefined,e)}},{key:"getElementByPos",value:function getElementByPos(t){if(t<0||t>this.i-1){throw new RangeError}var e=this.p;while(t--){e=e.B}return e.u}},{key:"find",value:function find(t,e){var r=this.I(t,e);return new HashSetIterator(r,this.h,this)}},{key:"forEach",value:function forEach(t){var e=0;var r=this.p;while(r!==this.h){t(r.u,e++,this);r=r.B}}},{key:Symbol.iterator,value:function value(){return _regeneratorRuntime().mark((function _callee(){var t;return _regeneratorRuntime().wrap((function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:t=this.p;case 1:if(!(t!==this.h)){_context.next=7;break}_context.next=4;return t.u;case 4:t=t.B;_context.next=1;break;case 7:case"end":return _context.stop()}}),_callee,this)})).bind(this)()}}])}(_Base.HashContainer);var _default=HashSet;exports["default"]=_default},{"../../utils/throwError":136,"./Base":118}],121:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r)}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}Object.defineProperty(exports,"t",{value:true});exports["default"]=void 0;var _ContainerBase=require("../ContainerBase");var PriorityQueue=function(_ContainerBase$Base){function PriorityQueue(){var _this;var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var s=arguments.length>1&&arguments[1]!==undefined?arguments[1]:function(t,s){if(t>s)return-1;if(t<s)return 1;return 0};var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;_classCallCheck(this,PriorityQueue);_this=_callSuper(this,PriorityQueue);_this.v=s;if(Array.isArray(t)){_this.C=i?_toConsumableArray(t):t}else{_this.C=[];var _s=_this;t.forEach((function(t){_s.C.push(t)}))}_this.i=_this.C.length;var e=_this.i>>1;for(var _t=_this.i-1>>1;_t>=0;--_t){_this.k(_t,e)}return _this}_inherits(PriorityQueue,_ContainerBase$Base);return _createClass(PriorityQueue,[{key:"m",value:function m(t){var s=this.C[t];while(t>0){var i=t-1>>1;var e=this.C[i];if(this.v(e,s)<=0)break;this.C[t]=e;t=i}this.C[t]=s}},{key:"k",value:function k(t,s){var i=this.C[t];while(t<s){var _s2=t<<1|1;var e=_s2+1;var h=this.C[_s2];if(e<this.i&&this.v(h,this.C[e])>0){_s2=e;h=this.C[e]}if(this.v(h,i)>=0)break;this.C[t]=h;t=_s2}this.C[t]=i}},{key:"clear",value:function clear(){this.i=0;this.C.length=0}},{key:"push",value:function push(t){this.C.push(t);this.m(this.i);this.i+=1}},{key:"pop",value:function pop(){if(this.i===0)return;var t=this.C[0];var s=this.C.pop();this.i-=1;if(this.i){this.C[0]=s;this.k(0,this.i>>1)}return t}},{key:"top",value:function top(){return this.C[0]}},{key:"find",value:function find(t){return this.C.indexOf(t)>=0}},{key:"remove",value:function remove(t){var s=this.C.indexOf(t);if(s<0)return false;if(s===0){this.pop()}else if(s===this.i-1){this.C.pop();this.i-=1}else{this.C.splice(s,1,this.C.pop());this.i-=1;this.m(s);this.k(s,this.i>>1)}return true}},{key:"updateItem",value:function updateItem(t){var s=this.C.indexOf(t);if(s<0)return false;this.m(s);this.k(s,this.i>>1);return true}},{key:"toArray",value:function toArray(){return _toConsumableArray(this.C)}}])}(_ContainerBase.Base);var _default=PriorityQueue;exports["default"]=_default},{"../ContainerBase":117}],122:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}Object.defineProperty(exports,"t",{value:true});exports["default"]=void 0;var _ContainerBase=require("../ContainerBase");var Queue=function(_ContainerBase$Base){function Queue(){var _this;var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];_classCallCheck(this,Queue);_this=_callSuper(this,Queue);_this.j=0;_this.q=[];var s=_this;t.forEach((function(t){s.push(t)}));return _this}_inherits(Queue,_ContainerBase$Base);return _createClass(Queue,[{key:"clear",value:function clear(){this.q=[];this.i=this.j=0}},{key:"push",value:function push(t){var s=this.q.length;if(this.j/s>.5&&this.j+this.i>=s&&s>4096){var _s=this.i;for(var _t=0;_t<_s;++_t){this.q[_t]=this.q[this.j+_t]}this.j=0;this.q[this.i]=t}else this.q[this.j+this.i]=t;return++this.i}},{key:"pop",value:function pop(){if(this.i===0)return;var t=this.q[this.j++];this.i-=1;return t}},{key:"front",value:function front(){if(this.i===0)return;return this.q[this.j]}}])}(_ContainerBase.Base);var _default=Queue;exports["default"]=_default},{"../ContainerBase":117}],123:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}Object.defineProperty(exports,"t",{value:true});exports["default"]=void 0;var _ContainerBase=require("../ContainerBase");var Stack=function(_ContainerBase$Base){function Stack(){var _this;var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];_classCallCheck(this,Stack);_this=_callSuper(this,Stack);_this.S=[];var s=_this;t.forEach((function(t){s.push(t)}));return _this}_inherits(Stack,_ContainerBase$Base);return _createClass(Stack,[{key:"clear",value:function clear(){this.i=0;this.S=[]}},{key:"push",value:function push(t){this.S.push(t);this.i+=1;return this.i}},{key:"pop",value:function pop(){if(this.i===0)return;this.i-=1;return this.S.pop()}},{key:"top",value:function top(){return this.S[this.i-1]}}])}(_ContainerBase.Base);var _default=Stack;exports["default"]=_default},{"../ContainerBase":117}],124:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}Object.defineProperty(exports,"t",{value:true});exports.RandomIterator=void 0;var _ContainerBase=require("../../ContainerBase");var _throwError=require("../../../utils/throwError");var RandomIterator=function(_ContainerBase$Contai){function RandomIterator(t,r){var _this;_classCallCheck(this,RandomIterator);_this=_callSuper(this,RandomIterator,[r]);_this.o=t;if(_this.iteratorType===0){_this.pre=function(){if(this.o===0){(0,_throwError.throwIteratorAccessError)()}this.o-=1;return this};_this.next=function(){if(this.o===this.container.size()){(0,_throwError.throwIteratorAccessError)()}this.o+=1;return this}}else{_this.pre=function(){if(this.o===this.container.size()-1){(0,_throwError.throwIteratorAccessError)()}this.o+=1;return this};_this.next=function(){if(this.o===-1){(0,_throwError.throwIteratorAccessError)()}this.o-=1;return this}}return _this}_inherits(RandomIterator,_ContainerBase$Contai);return _createClass(RandomIterator,[{key:"pointer",get:function get(){return this.container.getElementByPos(this.o)},set:function set(t){this.container.setElementByPos(this.o,t)}}])}(_ContainerBase.ContainerIterator);exports.RandomIterator=RandomIterator},{"../../../utils/throwError":136,"../../ContainerBase":117}],125:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}Object.defineProperty(exports,"t",{value:true});exports["default"]=void 0;var _ContainerBase=require("../../ContainerBase");var SequentialContainer=function(_ContainerBase$Contai){function SequentialContainer(){_classCallCheck(this,SequentialContainer);return _callSuper(this,SequentialContainer,arguments)}_inherits(SequentialContainer,_ContainerBase$Contai);return _createClass(SequentialContainer)}(_ContainerBase.Container);var _default=SequentialContainer;exports["default"]=_default},{"../../ContainerBase":117}],126:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{define({},"")}catch(t){define=function define(t,e,r){return t[e]=r}}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,(function(){return this}));var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach((function(e){define(t,e,(function(t){return this._invoke(e,t)}))}))}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){invoke("next",t,i,a)}),(function(t){invoke("throw",t,i,a)})):e.resolve(h).then((function(t){u.value=t,i(u)}),(function(t){return invoke("throw",t,i,a)}))}a(c.arg)}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e((function(e,r){invoke(t,n,e,r)}))}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done}}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg)}}}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next};return i.next=i}}throw new TypeError(_typeof(e)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t},e.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,(function(){return this})),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,(function(){return this})),define(g,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next}return next.done=!0,next}},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y}},catch:function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r)}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}Object.defineProperty(exports,"t",{value:true});exports["default"]=void 0;var _Base=_interopRequireDefault(require("./Base"));var _RandomIterator=require("./Base/RandomIterator");function _interopRequireDefault(t){return t&&t.t?t:{default:t}}var DequeIterator=function(_RandomIterator$Rando){function DequeIterator(t,i,s){var _this;_classCallCheck(this,DequeIterator);_this=_callSuper(this,DequeIterator,[t,s]);_this.container=i;return _this}_inherits(DequeIterator,_RandomIterator$Rando);return _createClass(DequeIterator,[{key:"copy",value:function copy(){return new DequeIterator(this.o,this.container,this.iteratorType)}}])}(_RandomIterator.RandomIterator);var Deque=function(_Base$default){function Deque(){var _this2;var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1<<12;_classCallCheck(this,Deque);_this2=_callSuper(this,Deque);_this2.j=0;_this2.D=0;_this2.R=0;_this2.N=0;_this2.P=0;_this2.A=[];var s=function(){if(typeof t.length==="number")return t.length;if(typeof t.size==="number")return t.size;if(typeof t.size==="function")return t.size();throw new TypeError("Cannot get the length or size of the container")}();_this2.F=i;_this2.P=Math.max(Math.ceil(s/_this2.F),1);for(var _t=0;_t<_this2.P;++_t){_this2.A.push(new Array(_this2.F))}var h=Math.ceil(s/_this2.F);_this2.j=_this2.R=(_this2.P>>1)-(h>>1);_this2.D=_this2.N=_this2.F-s%_this2.F>>1;var e=_this2;t.forEach((function(t){e.pushBack(t)}));return _this2}_inherits(Deque,_Base$default);return _createClass(Deque,[{key:"T",value:function T(){var t=[];var i=Math.max(this.P>>1,1);for(var s=0;s<i;++s){t[s]=new Array(this.F)}for(var _i=this.j;_i<this.P;++_i){t[t.length]=this.A[_i]}for(var _i2=0;_i2<this.R;++_i2){t[t.length]=this.A[_i2]}t[t.length]=_toConsumableArray(this.A[this.R]);this.j=i;this.R=t.length-1;for(var _s=0;_s<i;++_s){t[t.length]=new Array(this.F)}this.A=t;this.P=t.length}},{key:"O",value:function O(t){var i=this.D+t+1;var s=i%this.F;var h=s-1;var e=this.j+(i-s)/this.F;if(s===0)e-=1;e%=this.P;if(h<0)h+=this.F;return{curNodeBucketIndex:e,curNodePointerIndex:h}}},{key:"clear",value:function clear(){this.A=[new Array(this.F)];this.P=1;this.j=this.R=this.i=0;this.D=this.N=this.F>>1}},{key:"begin",value:function begin(){return new DequeIterator(0,this)}},{key:"end",value:function end(){return new DequeIterator(this.i,this)}},{key:"rBegin",value:function rBegin(){return new DequeIterator(this.i-1,this,1)}},{key:"rEnd",value:function rEnd(){return new DequeIterator(-1,this,1)}},{key:"front",value:function front(){if(this.i===0)return;return this.A[this.j][this.D]}},{key:"back",value:function back(){if(this.i===0)return;return this.A[this.R][this.N]}},{key:"pushBack",value:function pushBack(t){if(this.i){if(this.N<this.F-1){this.N+=1}else if(this.R<this.P-1){this.R+=1;this.N=0}else{this.R=0;this.N=0}if(this.R===this.j&&this.N===this.D)this.T()}this.i+=1;this.A[this.R][this.N]=t;return this.i}},{key:"popBack",value:function popBack(){if(this.i===0)return;var t=this.A[this.R][this.N];if(this.i!==1){if(this.N>0){this.N-=1}else if(this.R>0){this.R-=1;this.N=this.F-1}else{this.R=this.P-1;this.N=this.F-1}}this.i-=1;return t}},{key:"pushFront",value:function pushFront(t){if(this.i){if(this.D>0){this.D-=1}else if(this.j>0){this.j-=1;this.D=this.F-1}else{this.j=this.P-1;this.D=this.F-1}if(this.j===this.R&&this.D===this.N)this.T()}this.i+=1;this.A[this.j][this.D]=t;return this.i}},{key:"popFront",value:function popFront(){if(this.i===0)return;var t=this.A[this.j][this.D];if(this.i!==1){if(this.D<this.F-1){this.D+=1}else if(this.j<this.P-1){this.j+=1;this.D=0}else{this.j=0;this.D=0}}this.i-=1;return t}},{key:"getElementByPos",value:function getElementByPos(t){if(t<0||t>this.i-1){throw new RangeError}var _this$O=this.O(t),i=_this$O.curNodeBucketIndex,s=_this$O.curNodePointerIndex;return this.A[i][s]}},{key:"setElementByPos",value:function setElementByPos(t,i){if(t<0||t>this.i-1){throw new RangeError}var _this$O2=this.O(t),s=_this$O2.curNodeBucketIndex,h=_this$O2.curNodePointerIndex;this.A[s][h]=i}},{key:"insert",value:function insert(t,i){var s=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;if(t<0||t>this.i){throw new RangeError}if(t===0){while(s--)this.pushFront(i)}else if(t===this.i){while(s--)this.pushBack(i)}else{var h=[];for(var _i3=t;_i3<this.i;++_i3){h.push(this.getElementByPos(_i3))}this.cut(t-1);for(var _t2=0;_t2<s;++_t2)this.pushBack(i);for(var _t3=0;_t3<h.length;++_t3)this.pushBack(h[_t3])}return this.i}},{key:"cut",value:function cut(t){if(t<0){this.clear();return 0}var _this$O3=this.O(t),i=_this$O3.curNodeBucketIndex,s=_this$O3.curNodePointerIndex;this.R=i;this.N=s;this.i=t+1;return this.i}},{key:"eraseElementByPos",value:function eraseElementByPos(t){if(t<0||t>this.i-1){throw new RangeError}if(t===0)this.popFront();else if(t===this.i-1)this.popBack();else{var i=[];for(var _s2=t+1;_s2<this.i;++_s2){i.push(this.getElementByPos(_s2))}this.cut(t);this.popBack();var s=this;i.forEach((function(t){s.pushBack(t)}))}return this.i}},{key:"eraseElementByValue",value:function eraseElementByValue(t){if(this.i===0)return 0;var i=[];for(var _s3=0;_s3<this.i;++_s3){var h=this.getElementByPos(_s3);if(h!==t)i.push(h)}var s=i.length;for(var _t4=0;_t4<s;++_t4)this.setElementByPos(_t4,i[_t4]);return this.cut(s-1)}},{key:"eraseElementByIterator",value:function eraseElementByIterator(t){var i=t.o;this.eraseElementByPos(i);t=t.next();return t}},{key:"find",value:function find(t){for(var i=0;i<this.i;++i){if(this.getElementByPos(i)===t){return new DequeIterator(i,this)}}return this.end()}},{key:"reverse",value:function reverse(){var t=0;var i=this.i-1;while(t<i){var s=this.getElementByPos(t);this.setElementByPos(t,this.getElementByPos(i));this.setElementByPos(i,s);t+=1;i-=1}}},{key:"unique",value:function unique(){if(this.i<=1){return this.i}var t=1;var i=this.getElementByPos(0);for(var s=1;s<this.i;++s){var h=this.getElementByPos(s);if(h!==i){i=h;this.setElementByPos(t++,h)}}while(this.i>t)this.popBack();return this.i}},{key:"sort",value:function sort(t){var i=[];for(var _t5=0;_t5<this.i;++_t5){i.push(this.getElementByPos(_t5))}i.sort(t);for(var _t6=0;_t6<this.i;++_t6)this.setElementByPos(_t6,i[_t6])}},{key:"shrinkToFit",value:function shrinkToFit(){if(this.i===0)return;var t=[];this.forEach((function(i){t.push(i)}));this.P=Math.max(Math.ceil(this.i/this.F),1);this.i=this.j=this.R=this.D=this.N=0;this.A=[];for(var _t7=0;_t7<this.P;++_t7){this.A.push(new Array(this.F))}for(var i=0;i<t.length;++i)this.pushBack(t[i])}},{key:"forEach",value:function forEach(t){for(var i=0;i<this.i;++i){t(this.getElementByPos(i),i,this)}}},{key:Symbol.iterator,value:function value(){return _regeneratorRuntime().mark((function _callee(){var t;return _regeneratorRuntime().wrap((function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:t=0;case 1:if(!(t<this.i)){_context.next=7;break}_context.next=4;return this.getElementByPos(t);case 4:++t;_context.next=1;break;case 7:case"end":return _context.stop()}}),_callee,this)})).bind(this)()}}])}(_Base["default"]);var _default=Deque;exports["default"]=_default},{"./Base":125,"./Base/RandomIterator":124}],127:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{define({},"")}catch(t){define=function define(t,e,r){return t[e]=r}}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,(function(){return this}));var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach((function(e){define(t,e,(function(t){return this._invoke(e,t)}))}))}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){invoke("next",t,i,a)}),(function(t){invoke("throw",t,i,a)})):e.resolve(h).then((function(t){u.value=t,i(u)}),(function(t){return invoke("throw",t,i,a)}))}a(c.arg)}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e((function(e,r){invoke(t,n,e,r)}))}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done}}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg)}}}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next};return i.next=i}}throw new TypeError(_typeof(e)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t},e.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,(function(){return this})),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,(function(){return this})),define(g,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next}return next.done=!0,next}},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y}},catch:function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}Object.defineProperty(exports,"t",{value:true});exports["default"]=void 0;var _Base=_interopRequireDefault(require("./Base"));var _ContainerBase=require("../ContainerBase");var _throwError=require("../../utils/throwError");function _interopRequireDefault(t){return t&&t.t?t:{default:t}}var LinkListIterator=function(_ContainerBase$Contai){function LinkListIterator(t,i,s,r){var _this;_classCallCheck(this,LinkListIterator);_this=_callSuper(this,LinkListIterator,[r]);_this.o=t;_this.h=i;_this.container=s;if(_this.iteratorType===0){_this.pre=function(){if(this.o.L===this.h){(0,_throwError.throwIteratorAccessError)()}this.o=this.o.L;return this};_this.next=function(){if(this.o===this.h){(0,_throwError.throwIteratorAccessError)()}this.o=this.o.B;return this}}else{_this.pre=function(){if(this.o.B===this.h){(0,_throwError.throwIteratorAccessError)()}this.o=this.o.B;return this};_this.next=function(){if(this.o===this.h){(0,_throwError.throwIteratorAccessError)()}this.o=this.o.L;return this}}return _this}_inherits(LinkListIterator,_ContainerBase$Contai);return _createClass(LinkListIterator,[{key:"pointer",get:function get(){if(this.o===this.h){(0,_throwError.throwIteratorAccessError)()}return this.o.l},set:function set(t){if(this.o===this.h){(0,_throwError.throwIteratorAccessError)()}this.o.l=t}},{key:"copy",value:function copy(){return new LinkListIterator(this.o,this.h,this.container,this.iteratorType)}}])}(_ContainerBase.ContainerIterator);var LinkList=function(_Base$default){function LinkList(){var _this2;var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];_classCallCheck(this,LinkList);_this2=_callSuper(this,LinkList);_this2.h={};_this2.p=_this2._=_this2.h.L=_this2.h.B=_this2.h;var i=_this2;t.forEach((function(t){i.pushBack(t)}));return _this2}_inherits(LinkList,_Base$default);return _createClass(LinkList,[{key:"V",value:function V(t){var i=t.L,s=t.B;i.B=s;s.L=i;if(t===this.p){this.p=s}if(t===this._){this._=i}this.i-=1}},{key:"G",value:function G(t,i){var s=i.B;var r={l:t,L:i,B:s};i.B=r;s.L=r;if(i===this.h){this.p=r}if(s===this.h){this._=r}this.i+=1}},{key:"clear",value:function clear(){this.i=0;this.p=this._=this.h.L=this.h.B=this.h}},{key:"begin",value:function begin(){return new LinkListIterator(this.p,this.h,this)}},{key:"end",value:function end(){return new LinkListIterator(this.h,this.h,this)}},{key:"rBegin",value:function rBegin(){return new LinkListIterator(this._,this.h,this,1)}},{key:"rEnd",value:function rEnd(){return new LinkListIterator(this.h,this.h,this,1)}},{key:"front",value:function front(){return this.p.l}},{key:"back",value:function back(){return this._.l}},{key:"getElementByPos",value:function getElementByPos(t){if(t<0||t>this.i-1){throw new RangeError}var i=this.p;while(t--){i=i.B}return i.l}},{key:"eraseElementByPos",value:function eraseElementByPos(t){if(t<0||t>this.i-1){throw new RangeError}var i=this.p;while(t--){i=i.B}this.V(i);return this.i}},{key:"eraseElementByValue",value:function eraseElementByValue(t){var i=this.p;while(i!==this.h){if(i.l===t){this.V(i)}i=i.B}return this.i}},{key:"eraseElementByIterator",value:function eraseElementByIterator(t){var i=t.o;if(i===this.h){(0,_throwError.throwIteratorAccessError)()}t=t.next();this.V(i);return t}},{key:"pushBack",value:function pushBack(t){this.G(t,this._);return this.i}},{key:"popBack",value:function popBack(){if(this.i===0)return;var t=this._.l;this.V(this._);return t}},{key:"pushFront",value:function pushFront(t){this.G(t,this.h);return this.i}},{key:"popFront",value:function popFront(){if(this.i===0)return;var t=this.p.l;this.V(this.p);return t}},{key:"setElementByPos",value:function setElementByPos(t,i){if(t<0||t>this.i-1){throw new RangeError}var s=this.p;while(t--){s=s.B}s.l=i}},{key:"insert",value:function insert(t,i){var s=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;if(t<0||t>this.i){throw new RangeError}if(s<=0)return this.i;if(t===0){while(s--)this.pushFront(i)}else if(t===this.i){while(s--)this.pushBack(i)}else{var r=this.p;for(var _i=1;_i<t;++_i){r=r.B}var e=r.B;this.i+=s;while(s--){r.B={l:i,L:r};r.B.L=r;r=r.B}r.B=e;e.L=r}return this.i}},{key:"find",value:function find(t){var i=this.p;while(i!==this.h){if(i.l===t){return new LinkListIterator(i,this.h,this)}i=i.B}return this.end()}},{key:"reverse",value:function reverse(){if(this.i<=1)return;var t=this.p;var i=this._;var s=0;while(s<<1<this.i){var r=t.l;t.l=i.l;i.l=r;t=t.B;i=i.L;s+=1}}},{key:"unique",value:function unique(){if(this.i<=1){return this.i}var t=this.p;while(t!==this.h){var i=t;while(i.B!==this.h&&i.l===i.B.l){i=i.B;this.i-=1}t.B=i.B;t.B.L=t;t=t.B}return this.i}},{key:"sort",value:function sort(t){if(this.i<=1)return;var i=[];this.forEach((function(t){i.push(t)}));i.sort(t);var s=this.p;i.forEach((function(t){s.l=t;s=s.B}))}},{key:"merge",value:function merge(t){var i=this;if(this.i===0){t.forEach((function(t){i.pushBack(t)}))}else{var s=this.p;t.forEach((function(t){while(s!==i.h&&s.l<=t){s=s.B}i.G(t,s.L)}))}return this.i}},{key:"forEach",value:function forEach(t){var i=this.p;var s=0;while(i!==this.h){t(i.l,s++,this);i=i.B}}},{key:Symbol.iterator,value:function value(){return _regeneratorRuntime().mark((function _callee(){var t;return _regeneratorRuntime().wrap((function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:if(!(this.i===0)){_context.next=2;break}return _context.abrupt("return");case 2:t=this.p;case 3:if(!(t!==this.h)){_context.next=9;break}_context.next=6;return t.l;case 6:t=t.B;_context.next=3;break;case 9:case"end":return _context.stop()}}),_callee,this)})).bind(this)()}}])}(_Base["default"]);var _default=LinkList;exports["default"]=_default},{"../../utils/throwError":136,"../ContainerBase":117,"./Base":125}],128:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{define({},"")}catch(t){define=function define(t,e,r){return t[e]=r}}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,(function(){return this}));var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach((function(e){define(t,e,(function(t){return this._invoke(e,t)}))}))}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){invoke("next",t,i,a)}),(function(t){invoke("throw",t,i,a)})):e.resolve(h).then((function(t){u.value=t,i(u)}),(function(t){return invoke("throw",t,i,a)}))}a(c.arg)}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e((function(e,r){invoke(t,n,e,r)}))}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done}}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg)}}}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next};return i.next=i}}throw new TypeError(_typeof(e)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t},e.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,(function(){return this})),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,(function(){return this})),define(g,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next}return next.done=!0,next}},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y}},catch:function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r)}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}Object.defineProperty(exports,"t",{value:true});exports["default"]=void 0;var _Base=_interopRequireDefault(require("./Base"));var _RandomIterator=require("./Base/RandomIterator");function _interopRequireDefault(t){return t&&t.t?t:{default:t}}var VectorIterator=function(_RandomIterator$Rando){function VectorIterator(t,r,e){var _this;_classCallCheck(this,VectorIterator);_this=_callSuper(this,VectorIterator,[t,e]);_this.container=r;return _this}_inherits(VectorIterator,_RandomIterator$Rando);return _createClass(VectorIterator,[{key:"copy",value:function copy(){return new VectorIterator(this.o,this.container,this.iteratorType)}}])}(_RandomIterator.RandomIterator);var Vector=function(_Base$default){function Vector(){var _this2;var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;_classCallCheck(this,Vector);_this2=_callSuper(this,Vector);if(Array.isArray(t)){_this2.J=r?_toConsumableArray(t):t;_this2.i=t.length}else{_this2.J=[];var _r=_this2;t.forEach((function(t){_r.pushBack(t)}))}return _this2}_inherits(Vector,_Base$default);return _createClass(Vector,[{key:"clear",value:function clear(){this.i=0;this.J.length=0}},{key:"begin",value:function begin(){return new VectorIterator(0,this)}},{key:"end",value:function end(){return new VectorIterator(this.i,this)}},{key:"rBegin",value:function rBegin(){return new VectorIterator(this.i-1,this,1)}},{key:"rEnd",value:function rEnd(){return new VectorIterator(-1,this,1)}},{key:"front",value:function front(){return this.J[0]}},{key:"back",value:function back(){return this.J[this.i-1]}},{key:"getElementByPos",value:function getElementByPos(t){if(t<0||t>this.i-1){throw new RangeError}return this.J[t]}},{key:"eraseElementByPos",value:function eraseElementByPos(t){if(t<0||t>this.i-1){throw new RangeError}this.J.splice(t,1);this.i-=1;return this.i}},{key:"eraseElementByValue",value:function eraseElementByValue(t){var r=0;for(var e=0;e<this.i;++e){if(this.J[e]!==t){this.J[r++]=this.J[e]}}this.i=this.J.length=r;return this.i}},{key:"eraseElementByIterator",value:function eraseElementByIterator(t){var r=t.o;t=t.next();this.eraseElementByPos(r);return t}},{key:"pushBack",value:function pushBack(t){this.J.push(t);this.i+=1;return this.i}},{key:"popBack",value:function popBack(){if(this.i===0)return;this.i-=1;return this.J.pop()}},{key:"setElementByPos",value:function setElementByPos(t,r){if(t<0||t>this.i-1){throw new RangeError}this.J[t]=r}},{key:"insert",value:function insert(t,r){var _this$J;var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;if(t<0||t>this.i){throw new RangeError}(_this$J=this.J).splice.apply(_this$J,[t,0].concat(_toConsumableArray(new Array(e).fill(r))));this.i+=e;return this.i}},{key:"find",value:function find(t){for(var r=0;r<this.i;++r){if(this.J[r]===t){return new VectorIterator(r,this)}}return this.end()}},{key:"reverse",value:function reverse(){this.J.reverse()}},{key:"unique",value:function unique(){var t=1;for(var r=1;r<this.i;++r){if(this.J[r]!==this.J[r-1]){this.J[t++]=this.J[r]}}this.i=this.J.length=t;return this.i}},{key:"sort",value:function sort(t){this.J.sort(t)}},{key:"forEach",value:function forEach(t){for(var r=0;r<this.i;++r){t(this.J[r],r,this)}}},{key:Symbol.iterator,value:function value(){return _regeneratorRuntime().mark((function _callee(){return _regeneratorRuntime().wrap((function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:return _context.delegateYield(this.J,"t0",1);case 1:case"end":return _context.stop()}}),_callee,this)})).bind(this)()}}])}(_Base["default"]);var _default=Vector;exports["default"]=_default},{"./Base":125,"./Base/RandomIterator":124}],129:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}Object.defineProperty(exports,"t",{value:true});exports["default"]=void 0;var _ContainerBase=require("../../ContainerBase");var _throwError=require("../../../utils/throwError");var TreeIterator=function(_ContainerBase$Contai){function TreeIterator(t,r,i){var _this;_classCallCheck(this,TreeIterator);_this=_callSuper(this,TreeIterator,[i]);_this.o=t;_this.h=r;if(_this.iteratorType===0){_this.pre=function(){if(this.o===this.h.U){(0,_throwError.throwIteratorAccessError)()}this.o=this.o.L();return this};_this.next=function(){if(this.o===this.h){(0,_throwError.throwIteratorAccessError)()}this.o=this.o.B();return this}}else{_this.pre=function(){if(this.o===this.h.W){(0,_throwError.throwIteratorAccessError)()}this.o=this.o.B();return this};_this.next=function(){if(this.o===this.h){(0,_throwError.throwIteratorAccessError)()}this.o=this.o.L();return this}}return _this}_inherits(TreeIterator,_ContainerBase$Contai);return _createClass(TreeIterator,[{key:"index",get:function get(){var t=this.o;var r=this.h.tt;if(t===this.h){if(r){return r.rt-1}return 0}var i=0;if(t.U){i+=t.U.rt}while(t!==r){var _r=t.tt;if(t===_r.W){i+=1;if(_r.U){i+=_r.U.rt}}t=_r}return i}}])}(_ContainerBase.ContainerIterator);var _default=TreeIterator;exports["default"]=_default},{"../../../utils/throwError":136,"../../ContainerBase":117}],130:[function(require,module,exports){"use strict";function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t)}:p}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value}},_get.apply(null,arguments)}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}Object.defineProperty(exports,"t",{value:true});exports.TreeNodeEnableIndex=exports.TreeNode=void 0;var TreeNode=function(){function TreeNode(e,t){_classCallCheck(this,TreeNode);this.ee=1;this.u=undefined;this.l=undefined;this.U=undefined;this.W=undefined;this.tt=undefined;this.u=e;this.l=t}return _createClass(TreeNode,[{key:"L",value:function L(){var e=this;if(e.ee===1&&e.tt.tt===e){e=e.W}else if(e.U){e=e.U;while(e.W){e=e.W}}else{var t=e.tt;while(t.U===e){e=t;t=e.tt}e=t}return e}},{key:"B",value:function B(){var e=this;if(e.W){e=e.W;while(e.U){e=e.U}return e}else{var t=e.tt;while(t.W===e){e=t;t=e.tt}if(e.W!==t){return t}else return e}}},{key:"te",value:function te(){var e=this.tt;var t=this.W;var s=t.U;if(e.tt===this)e.tt=t;else if(e.U===this)e.U=t;else e.W=t;t.tt=e;t.U=this;this.tt=t;this.W=s;if(s)s.tt=this;return t}},{key:"se",value:function se(){var e=this.tt;var t=this.U;var s=t.W;if(e.tt===this)e.tt=t;else if(e.U===this)e.U=t;else e.W=t;t.tt=e;t.W=this;this.tt=t;this.U=s;if(s)s.tt=this;return t}}])}();exports.TreeNode=TreeNode;var TreeNodeEnableIndex=function(_TreeNode){function TreeNodeEnableIndex(){var _this;_classCallCheck(this,TreeNodeEnableIndex);_this=_callSuper(this,TreeNodeEnableIndex,arguments);_this.rt=1;return _this}_inherits(TreeNodeEnableIndex,_TreeNode);return _createClass(TreeNodeEnableIndex,[{key:"te",value:function te(){var e=_superPropGet(TreeNodeEnableIndex,"te",this,3)([]);this.ie();e.ie();return e}},{key:"se",value:function se(){var e=_superPropGet(TreeNodeEnableIndex,"se",this,3)([]);this.ie();e.ie();return e}},{key:"ie",value:function ie(){this.rt=1;if(this.U){this.rt+=this.U.rt}if(this.W){this.rt+=this.W.rt}}}])}(TreeNode);exports.TreeNodeEnableIndex=TreeNodeEnableIndex},{}],131:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n3=0,F=function F(){};return{s:F,n:function n(){return _n3>=r.length?{done:!0}:{done:!1,value:r[_n3++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}Object.defineProperty(exports,"t",{value:true});exports["default"]=void 0;var _TreeNode=require("./TreeNode");var _ContainerBase=require("../../ContainerBase");var _throwError=require("../../../utils/throwError");var TreeContainer=function(_ContainerBase$Contai){function TreeContainer(){var _this;var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:function(e,t){if(e<t)return-1;if(e>t)return 1;return 0};var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;_classCallCheck(this,TreeContainer);_this=_callSuper(this,TreeContainer);_this.Y=undefined;_this.v=e;if(t){_this.re=_TreeNode.TreeNodeEnableIndex;_this.M=function(e,t,i){var s=this.ne(e,t,i);if(s){var _e=s.tt;while(_e!==this.h){_e.rt+=1;_e=_e.tt}var _t=this.he(s);if(_t){var _e2=_t.parentNode,_i=_t.grandParent,_s=_t.curNode;_e2.ie();_i.ie();_s.ie()}}return this.i};_this.V=function(e){var t=this.fe(e);while(t!==this.h){t.rt-=1;t=t.tt}}}else{_this.re=_TreeNode.TreeNode;_this.M=function(e,t,i){var s=this.ne(e,t,i);if(s)this.he(s);return this.i};_this.V=_this.fe}_this.h=new _this.re;return _this}_inherits(TreeContainer,_ContainerBase$Contai);return _createClass(TreeContainer,[{key:"X",value:function X(e,t){var i=this.h;while(e){var s=this.v(e.u,t);if(s<0){e=e.W}else if(s>0){i=e;e=e.U}else return e}return i}},{key:"Z",value:function Z(e,t){var i=this.h;while(e){var s=this.v(e.u,t);if(s<=0){e=e.W}else{i=e;e=e.U}}return i}},{key:"$",value:function $(e,t){var i=this.h;while(e){var s=this.v(e.u,t);if(s<0){i=e;e=e.W}else if(s>0){e=e.U}else return e}return i}},{key:"rr",value:function rr(e,t){var i=this.h;while(e){var s=this.v(e.u,t);if(s<0){i=e;e=e.W}else{e=e.U}}return i}},{key:"ue",value:function ue(e){while(true){var t=e.tt;if(t===this.h)return;if(e.ee===1){e.ee=0;return}if(e===t.U){var i=t.W;if(i.ee===1){i.ee=0;t.ee=1;if(t===this.Y){this.Y=t.te()}else t.te()}else{if(i.W&&i.W.ee===1){i.ee=t.ee;t.ee=0;i.W.ee=0;if(t===this.Y){this.Y=t.te()}else t.te();return}else if(i.U&&i.U.ee===1){i.ee=1;i.U.ee=0;i.se()}else{i.ee=1;e=t}}}else{var _i2=t.U;if(_i2.ee===1){_i2.ee=0;t.ee=1;if(t===this.Y){this.Y=t.se()}else t.se()}else{if(_i2.U&&_i2.U.ee===1){_i2.ee=t.ee;t.ee=0;_i2.U.ee=0;if(t===this.Y){this.Y=t.se()}else t.se();return}else if(_i2.W&&_i2.W.ee===1){_i2.ee=1;_i2.W.ee=0;_i2.te()}else{_i2.ee=1;e=t}}}}}},{key:"fe",value:function fe(e){if(this.i===1){this.clear();return this.h}var t=e;while(t.U||t.W){if(t.W){t=t.W;while(t.U)t=t.U}else{t=t.U}var _ref=[t.u,e.u];e.u=_ref[0];t.u=_ref[1];var _ref2=[t.l,e.l];e.l=_ref2[0];t.l=_ref2[1];e=t}if(this.h.U===t){this.h.U=t.tt}else if(this.h.W===t){this.h.W=t.tt}this.ue(t);var i=t.tt;if(t===i.U){i.U=undefined}else i.W=undefined;this.i-=1;this.Y.ee=0;return i}},{key:"oe",value:function oe(e,t){if(e===undefined)return false;var i=this.oe(e.U,t);if(i)return true;if(t(e))return true;return this.oe(e.W,t)}},{key:"he",value:function he(e){while(true){var t=e.tt;if(t.ee===0)return;var i=t.tt;if(t===i.U){var s=i.W;if(s&&s.ee===1){s.ee=t.ee=0;if(i===this.Y)return;i.ee=1;e=i;continue}else if(e===t.W){e.ee=0;if(e.U)e.U.tt=t;if(e.W)e.W.tt=i;t.W=e.U;i.U=e.W;e.U=t;e.W=i;if(i===this.Y){this.Y=e;this.h.tt=e}else{var _t2=i.tt;if(_t2.U===i){_t2.U=e}else _t2.W=e}e.tt=i.tt;t.tt=e;i.tt=e;i.ee=1;return{parentNode:t,grandParent:i,curNode:e}}else{t.ee=0;if(i===this.Y){this.Y=i.se()}else i.se();i.ee=1}}else{var _s2=i.U;if(_s2&&_s2.ee===1){_s2.ee=t.ee=0;if(i===this.Y)return;i.ee=1;e=i;continue}else if(e===t.U){e.ee=0;if(e.U)e.U.tt=i;if(e.W)e.W.tt=t;i.W=e.U;t.U=e.W;e.U=i;e.W=t;if(i===this.Y){this.Y=e;this.h.tt=e}else{var _t3=i.tt;if(_t3.U===i){_t3.U=e}else _t3.W=e}e.tt=i.tt;t.tt=e;i.tt=e;i.ee=1;return{parentNode:t,grandParent:i,curNode:e}}else{t.ee=0;if(i===this.Y){this.Y=i.te()}else i.te();i.ee=1}}return}}},{key:"ne",value:function ne(e,t,i){if(this.Y===undefined){this.i+=1;this.Y=new this.re(e,t);this.Y.ee=0;this.Y.tt=this.h;this.h.tt=this.Y;this.h.U=this.Y;this.h.W=this.Y;return}var s;var r=this.h.U;var n=this.v(r.u,e);if(n===0){r.l=t;return}else if(n>0){r.U=new this.re(e,t);r.U.tt=r;s=r.U;this.h.U=s}else{var _r=this.h.W;var _n=this.v(_r.u,e);if(_n===0){_r.l=t;return}else if(_n<0){_r.W=new this.re(e,t);_r.W.tt=_r;s=_r.W;this.h.W=s}else{if(i!==undefined){var _r2=i.o;if(_r2!==this.h){var _i3=this.v(_r2.u,e);if(_i3===0){_r2.l=t;return}else if(_i3>0){var _i4=_r2.L();var _n2=this.v(_i4.u,e);if(_n2===0){_i4.l=t;return}else if(_n2<0){s=new this.re(e,t);if(_i4.W===undefined){_i4.W=s;s.tt=_i4}else{_r2.U=s;s.tt=_r2}}}}}if(s===undefined){s=this.Y;while(true){var _i5=this.v(s.u,e);if(_i5>0){if(s.U===undefined){s.U=new this.re(e,t);s.U.tt=s;s=s.U;break}s=s.U}else if(_i5<0){if(s.W===undefined){s.W=new this.re(e,t);s.W.tt=s;s=s.W;break}s=s.W}else{s.l=t;return}}}}}this.i+=1;return s}},{key:"I",value:function I(e,t){while(e){var i=this.v(e.u,t);if(i<0){e=e.W}else if(i>0){e=e.U}else return e}return e||this.h}},{key:"clear",value:function clear(){this.i=0;this.Y=undefined;this.h.tt=undefined;this.h.U=this.h.W=undefined}},{key:"updateKeyByIterator",value:function updateKeyByIterator(e,t){var i=e.o;if(i===this.h){(0,_throwError.throwIteratorAccessError)()}if(this.i===1){i.u=t;return true}if(i===this.h.U){if(this.v(i.B().u,t)>0){i.u=t;return true}return false}if(i===this.h.W){if(this.v(i.L().u,t)<0){i.u=t;return true}return false}var s=i.L().u;if(this.v(s,t)>=0)return false;var r=i.B().u;if(this.v(r,t)<=0)return false;i.u=t;return true}},{key:"eraseElementByPos",value:function eraseElementByPos(e){if(e<0||e>this.i-1){throw new RangeError}var t=0;var i=this;this.oe(this.Y,(function(s){if(e===t){i.V(s);return true}t+=1;return false}));return this.i}},{key:"eraseElementByKey",value:function eraseElementByKey(e){if(this.i===0)return false;var t=this.I(this.Y,e);if(t===this.h)return false;this.V(t);return true}},{key:"eraseElementByIterator",value:function eraseElementByIterator(e){var t=e.o;if(t===this.h){(0,_throwError.throwIteratorAccessError)()}var i=t.W===undefined;var s=e.iteratorType===0;if(s){if(i)e.next()}else{if(!i||t.U===undefined)e.next()}this.V(t);return e}},{key:"forEach",value:function forEach(e){var t=0;var _iterator=_createForOfIteratorHelper(this),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var i=_step.value;e(i,t++,this)}}catch(err){_iterator.e(err)}finally{_iterator.f()}}},{key:"getElementByPos",value:function getElementByPos(e){if(e<0||e>this.i-1){throw new RangeError}var t;var i=0;var _iterator2=_createForOfIteratorHelper(this),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var s=_step2.value;if(i===e){t=s;break}i+=1}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}return t}},{key:"getHeight",value:function getHeight(){if(this.i===0)return 0;var _traversal=function traversal(e){if(!e)return 0;return Math.max(_traversal(e.U),_traversal(e.W))+1};return _traversal(this.Y)}}])}(_ContainerBase.Container);var _default=TreeContainer;exports["default"]=_default},{"../../../utils/throwError":136,"../../ContainerBase":117,"./TreeNode":130}],132:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{define({},"")}catch(t){define=function define(t,e,r){return t[e]=r}}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,(function(){return this}));var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach((function(e){define(t,e,(function(t){return this._invoke(e,t)}))}))}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){invoke("next",t,i,a)}),(function(t){invoke("throw",t,i,a)})):e.resolve(h).then((function(t){u.value=t,i(u)}),(function(t){return invoke("throw",t,i,a)}))}a(c.arg)}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e((function(e,r){invoke(t,n,e,r)}))}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done}}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg)}}}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next};return i.next=i}}throw new TypeError(_typeof(e)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t},e.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,(function(){return this})),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,(function(){return this})),define(g,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next}return next.done=!0,next}},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y}},catch:function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}Object.defineProperty(exports,"t",{value:true});exports["default"]=void 0;var _Base=_interopRequireDefault(require("./Base"));var _TreeIterator=_interopRequireDefault(require("./Base/TreeIterator"));var _throwError=require("../../utils/throwError");function _interopRequireDefault(r){return r&&r.t?r:{default:r}}var OrderedMapIterator=function(_TreeIterator$default){function OrderedMapIterator(r,t,e,s){var _this;_classCallCheck(this,OrderedMapIterator);_this=_callSuper(this,OrderedMapIterator,[r,t,s]);_this.container=e;return _this}_inherits(OrderedMapIterator,_TreeIterator$default);return _createClass(OrderedMapIterator,[{key:"pointer",get:function get(){if(this.o===this.h){(0,_throwError.throwIteratorAccessError)()}var r=this;return new Proxy([],{get:function get(t,e){if(e==="0")return r.o.u;else if(e==="1")return r.o.l},set:function set(t,e,s){if(e!=="1"){throw new TypeError("props must be 1")}r.o.l=s;return true}})}},{key:"copy",value:function copy(){return new OrderedMapIterator(this.o,this.h,this.container,this.iteratorType)}}])}(_TreeIterator["default"]);var OrderedMap=function(_Base$default){function OrderedMap(){var _this2;var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var t=arguments.length>1?arguments[1]:undefined;var e=arguments.length>2?arguments[2]:undefined;_classCallCheck(this,OrderedMap);_this2=_callSuper(this,OrderedMap,[t,e]);var s=_this2;r.forEach((function(r){s.setElement(r[0],r[1])}));return _this2}_inherits(OrderedMap,_Base$default);return _createClass(OrderedMap,[{key:"K",value:_regeneratorRuntime().mark((function K(r){return _regeneratorRuntime().wrap((function K$(_context){while(1)switch(_context.prev=_context.next){case 0:if(!(r===undefined)){_context.next=2;break}return _context.abrupt("return");case 2:return _context.delegateYield(this.K(r.U),"t0",3);case 3:_context.next=5;return[r.u,r.l];case 5:return _context.delegateYield(this.K(r.W),"t1",6);case 6:case"end":return _context.stop()}}),K,this)}))},{key:"begin",value:function begin(){return new OrderedMapIterator(this.h.U||this.h,this.h,this)}},{key:"end",value:function end(){return new OrderedMapIterator(this.h,this.h,this)}},{key:"rBegin",value:function rBegin(){return new OrderedMapIterator(this.h.W||this.h,this.h,this,1)}},{key:"rEnd",value:function rEnd(){return new OrderedMapIterator(this.h,this.h,this,1)}},{key:"front",value:function front(){if(this.i===0)return;var r=this.h.U;return[r.u,r.l]}},{key:"back",value:function back(){if(this.i===0)return;var r=this.h.W;return[r.u,r.l]}},{key:"lowerBound",value:function lowerBound(r){var t=this.X(this.Y,r);return new OrderedMapIterator(t,this.h,this)}},{key:"upperBound",value:function upperBound(r){var t=this.Z(this.Y,r);return new OrderedMapIterator(t,this.h,this)}},{key:"reverseLowerBound",value:function reverseLowerBound(r){var t=this.$(this.Y,r);return new OrderedMapIterator(t,this.h,this)}},{key:"reverseUpperBound",value:function reverseUpperBound(r){var t=this.rr(this.Y,r);return new OrderedMapIterator(t,this.h,this)}},{key:"setElement",value:function setElement(r,t,e){return this.M(r,t,e)}},{key:"find",value:function find(r){var t=this.I(this.Y,r);return new OrderedMapIterator(t,this.h,this)}},{key:"getElementByKey",value:function getElementByKey(r){var t=this.I(this.Y,r);return t.l}},{key:"union",value:function union(r){var t=this;r.forEach((function(r){t.setElement(r[0],r[1])}));return this.i}},{key:Symbol.iterator,value:function value(){return this.K(this.Y)}}])}(_Base["default"]);var _default=OrderedMap;exports["default"]=_default},{"../../utils/throwError":136,"./Base":131,"./Base/TreeIterator":129}],133:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{define({},"")}catch(t){define=function define(t,e,r){return t[e]=r}}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,(function(){return this}));var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach((function(e){define(t,e,(function(t){return this._invoke(e,t)}))}))}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){invoke("next",t,i,a)}),(function(t){invoke("throw",t,i,a)})):e.resolve(h).then((function(t){u.value=t,i(u)}),(function(t){return invoke("throw",t,i,a)}))}a(c.arg)}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e((function(e,r){invoke(t,n,e,r)}))}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done}}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg)}}}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next};return i.next=i}}throw new TypeError(_typeof(e)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t},e.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,(function(){return this})),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,(function(){return this})),define(g,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next}return next.done=!0,next}},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y}},catch:function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}Object.defineProperty(exports,"t",{value:true});exports["default"]=void 0;var _Base=_interopRequireDefault(require("./Base"));var _TreeIterator=_interopRequireDefault(require("./Base/TreeIterator"));var _throwError=require("../../utils/throwError");function _interopRequireDefault(e){return e&&e.t?e:{default:e}}var OrderedSetIterator=function(_TreeIterator$default){function OrderedSetIterator(e,t,r,i){var _this;_classCallCheck(this,OrderedSetIterator);_this=_callSuper(this,OrderedSetIterator,[e,t,i]);_this.container=r;return _this}_inherits(OrderedSetIterator,_TreeIterator$default);return _createClass(OrderedSetIterator,[{key:"pointer",get:function get(){if(this.o===this.h){(0,_throwError.throwIteratorAccessError)()}return this.o.u}},{key:"copy",value:function copy(){return new OrderedSetIterator(this.o,this.h,this.container,this.iteratorType)}}])}(_TreeIterator["default"]);var OrderedSet=function(_Base$default){function OrderedSet(){var _this2;var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var t=arguments.length>1?arguments[1]:undefined;var r=arguments.length>2?arguments[2]:undefined;_classCallCheck(this,OrderedSet);_this2=_callSuper(this,OrderedSet,[t,r]);var i=_this2;e.forEach((function(e){i.insert(e)}));return _this2}_inherits(OrderedSet,_Base$default);return _createClass(OrderedSet,[{key:"K",value:_regeneratorRuntime().mark((function K(e){return _regeneratorRuntime().wrap((function K$(_context){while(1)switch(_context.prev=_context.next){case 0:if(!(e===undefined)){_context.next=2;break}return _context.abrupt("return");case 2:return _context.delegateYield(this.K(e.U),"t0",3);case 3:_context.next=5;return e.u;case 5:return _context.delegateYield(this.K(e.W),"t1",6);case 6:case"end":return _context.stop()}}),K,this)}))},{key:"begin",value:function begin(){return new OrderedSetIterator(this.h.U||this.h,this.h,this)}},{key:"end",value:function end(){return new OrderedSetIterator(this.h,this.h,this)}},{key:"rBegin",value:function rBegin(){return new OrderedSetIterator(this.h.W||this.h,this.h,this,1)}},{key:"rEnd",value:function rEnd(){return new OrderedSetIterator(this.h,this.h,this,1)}},{key:"front",value:function front(){return this.h.U?this.h.U.u:undefined}},{key:"back",value:function back(){return this.h.W?this.h.W.u:undefined}},{key:"insert",value:function insert(e,t){return this.M(e,undefined,t)}},{key:"find",value:function find(e){var t=this.I(this.Y,e);return new OrderedSetIterator(t,this.h,this)}},{key:"lowerBound",value:function lowerBound(e){var t=this.X(this.Y,e);return new OrderedSetIterator(t,this.h,this)}},{key:"upperBound",value:function upperBound(e){var t=this.Z(this.Y,e);return new OrderedSetIterator(t,this.h,this)}},{key:"reverseLowerBound",value:function reverseLowerBound(e){var t=this.$(this.Y,e);return new OrderedSetIterator(t,this.h,this)}},{key:"reverseUpperBound",value:function reverseUpperBound(e){var t=this.rr(this.Y,e);return new OrderedSetIterator(t,this.h,this)}},{key:"union",value:function union(e){var t=this;e.forEach((function(e){t.insert(e)}));return this.i}},{key:Symbol.iterator,value:function value(){return this.K(this.Y)}}])}(_Base["default"]);var _default=OrderedSet;exports["default"]=_default},{"../../utils/throwError":136,"./Base":131,"./Base/TreeIterator":129}],134:[function(require,module,exports){"use strict";Object.defineProperty(exports,"t",{value:true});Object.defineProperty(exports,"Deque",{enumerable:true,get:function get(){return _Deque["default"]}});Object.defineProperty(exports,"HashMap",{enumerable:true,get:function get(){return _HashMap["default"]}});Object.defineProperty(exports,"HashSet",{enumerable:true,get:function get(){return _HashSet["default"]}});Object.defineProperty(exports,"LinkList",{enumerable:true,get:function get(){return _LinkList["default"]}});Object.defineProperty(exports,"OrderedMap",{enumerable:true,get:function get(){return _OrderedMap["default"]}});Object.defineProperty(exports,"OrderedSet",{enumerable:true,get:function get(){return _OrderedSet["default"]}});Object.defineProperty(exports,"PriorityQueue",{enumerable:true,get:function get(){return _PriorityQueue["default"]}});Object.defineProperty(exports,"Queue",{enumerable:true,get:function get(){return _Queue["default"]}});Object.defineProperty(exports,"Stack",{enumerable:true,get:function get(){return _Stack["default"]}});Object.defineProperty(exports,"Vector",{enumerable:true,get:function get(){return _Vector["default"]}});var _Stack=_interopRequireDefault(require("./container/OtherContainer/Stack"));var _Queue=_interopRequireDefault(require("./container/OtherContainer/Queue"));var _PriorityQueue=_interopRequireDefault(require("./container/OtherContainer/PriorityQueue"));var _Vector=_interopRequireDefault(require("./container/SequentialContainer/Vector"));var _LinkList=_interopRequireDefault(require("./container/SequentialContainer/LinkList"));var _Deque=_interopRequireDefault(require("./container/SequentialContainer/Deque"));var _OrderedSet=_interopRequireDefault(require("./container/TreeContainer/OrderedSet"));var _OrderedMap=_interopRequireDefault(require("./container/TreeContainer/OrderedMap"));var _HashSet=_interopRequireDefault(require("./container/HashContainer/HashSet"));var _HashMap=_interopRequireDefault(require("./container/HashContainer/HashMap"));function _interopRequireDefault(e){return e&&e.t?e:{default:e}}},{"./container/HashContainer/HashMap":119,"./container/HashContainer/HashSet":120,"./container/OtherContainer/PriorityQueue":121,"./container/OtherContainer/Queue":122,"./container/OtherContainer/Stack":123,"./container/SequentialContainer/Deque":126,"./container/SequentialContainer/LinkList":127,"./container/SequentialContainer/Vector":128,"./container/TreeContainer/OrderedMap":132,"./container/TreeContainer/OrderedSet":133}],135:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}Object.defineProperty(exports,"t",{value:true});exports["default"]=checkObject;function checkObject(e){var t=_typeof(e);return t==="object"&&e!==null||t==="function"}},{}],136:[function(require,module,exports){"use strict";Object.defineProperty(exports,"t",{value:true});exports.throwIteratorAccessError=throwIteratorAccessError;function throwIteratorAccessError(){throw new RangeError("Iterator access denied!")}},{}],137:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}module.exports=sizeof;function sizeof(object){var objects=[object];var processed=[];var size=0;for(var index=0;index<objects.length;++index){var _object=objects[index];switch(_typeof(_object)){case"boolean":size+=4;break;case"number":size+=8;break;case"string":size+=2*_object.length;break;case"object":if(_object===null){size+=4;break}var keySizeFactor=Array.isArray(_object)?0:1;for(var key in _object){size+=keySizeFactor*2*key.length;if(processed.indexOf(_object[key])===-1){objects.push(_object[key]);if(_typeof(_object[key])==="object"){processed.push(_object[key])}}}break}}return size}},{}],138:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}(function(root,definition){"use strict";if(typeof define==="function"&&define.amd){define(definition)}else if((typeof module==="undefined"?"undefined":_typeof(module))==="object"&&module.exports){module.exports=definition()}else{root.log=definition()}})(void 0,(function(){"use strict";var noop=function noop(){};var undefinedType="undefined";var isIE=(typeof window==="undefined"?"undefined":_typeof(window))!==undefinedType&&_typeof(window.navigator)!==undefinedType&&/Trident\/|MSIE /.test(window.navigator.userAgent);var logMethods=["trace","debug","info","warn","error"];var _loggersByName={};var defaultLogger=null;function bindMethod(obj,methodName){var method=obj[methodName];if(typeof method.bind==="function"){return method.bind(obj)}else{try{return Function.prototype.bind.call(method,obj)}catch(e){return function(){return Function.prototype.apply.apply(method,[obj,arguments])}}}}function traceForIE(){if(console.log){if(console.log.apply){console.log.apply(console,arguments)}else{Function.prototype.apply.apply(console.log,[console,arguments])}}if(console.trace)console.trace()}function realMethod(methodName){if(methodName==="debug"){methodName="log"}if((typeof console==="undefined"?"undefined":_typeof(console))===undefinedType){return false}else if(methodName==="trace"&&isIE){return traceForIE}else if(console[methodName]!==undefined){return bindMethod(console,methodName)}else if(console.log!==undefined){return bindMethod(console,"log")}else{return noop}}function replaceLoggingMethods(){var level=this.getLevel();for(var i=0;i<logMethods.length;i++){var methodName=logMethods[i];this[methodName]=i<level?noop:this.methodFactory(methodName,level,this.name)}this.log=this.debug;if((typeof console==="undefined"?"undefined":_typeof(console))===undefinedType&&level<this.levels.SILENT){return"No console available for logging"}}function enableLoggingWhenConsoleArrives(methodName){return function(){if((typeof console==="undefined"?"undefined":_typeof(console))!==undefinedType){replaceLoggingMethods.call(this);this[methodName].apply(this,arguments)}}}function defaultMethodFactory(methodName,_level,_loggerName){return realMethod(methodName)||enableLoggingWhenConsoleArrives.apply(this,arguments)}function Logger(name,factory){var self=this;var inheritedLevel;var defaultLevel;var userLevel;var storageKey="loglevel";if(typeof name==="string"){storageKey+=":"+name}else if(_typeof(name)==="symbol"){storageKey=undefined}function persistLevelIfPossible(levelNum){var levelName=(logMethods[levelNum]||"silent").toUpperCase();if((typeof window==="undefined"?"undefined":_typeof(window))===undefinedType||!storageKey)return;try{window.localStorage[storageKey]=levelName;return}catch(ignore){}try{window.document.cookie=encodeURIComponent(storageKey)+"="+levelName+";"}catch(ignore){}}function getPersistedLevel(){var storedLevel;if((typeof window==="undefined"?"undefined":_typeof(window))===undefinedType||!storageKey)return;try{storedLevel=window.localStorage[storageKey]}catch(ignore){}if(_typeof(storedLevel)===undefinedType){try{var cookie=window.document.cookie;var cookieName=encodeURIComponent(storageKey);var location=cookie.indexOf(cookieName+"=");if(location!==-1){storedLevel=/^([^;]+)/.exec(cookie.slice(location+cookieName.length+1))[1]}}catch(ignore){}}if(self.levels[storedLevel]===undefined){storedLevel=undefined}return storedLevel}function clearPersistedLevel(){if((typeof window==="undefined"?"undefined":_typeof(window))===undefinedType||!storageKey)return;try{window.localStorage.removeItem(storageKey)}catch(ignore){}try{window.document.cookie=encodeURIComponent(storageKey)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(ignore){}}function normalizeLevel(input){var level=input;if(typeof level==="string"&&self.levels[level.toUpperCase()]!==undefined){level=self.levels[level.toUpperCase()]}if(typeof level==="number"&&level>=0&&level<=self.levels.SILENT){return level}else{throw new TypeError("log.setLevel() called with invalid level: "+input)}}self.name=name;self.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5};self.methodFactory=factory||defaultMethodFactory;self.getLevel=function(){if(userLevel!=null){return userLevel}else if(defaultLevel!=null){return defaultLevel}else{return inheritedLevel}};self.setLevel=function(level,persist){userLevel=normalizeLevel(level);if(persist!==false){persistLevelIfPossible(userLevel)}return replaceLoggingMethods.call(self)};self.setDefaultLevel=function(level){defaultLevel=normalizeLevel(level);if(!getPersistedLevel()){self.setLevel(level,false)}};self.resetLevel=function(){userLevel=null;clearPersistedLevel();replaceLoggingMethods.call(self)};self.enableAll=function(persist){self.setLevel(self.levels.TRACE,persist)};self.disableAll=function(persist){self.setLevel(self.levels.SILENT,persist)};self.rebuild=function(){if(defaultLogger!==self){inheritedLevel=normalizeLevel(defaultLogger.getLevel())}replaceLoggingMethods.call(self);if(defaultLogger===self){for(var childName in _loggersByName){_loggersByName[childName].rebuild()}}};inheritedLevel=normalizeLevel(defaultLogger?defaultLogger.getLevel():"WARN");var initialLevel=getPersistedLevel();if(initialLevel!=null){userLevel=normalizeLevel(initialLevel)}replaceLoggingMethods.call(self)}defaultLogger=new Logger;defaultLogger.getLogger=function getLogger(name){if(_typeof(name)!=="symbol"&&typeof name!=="string"||name===""){throw new TypeError("You must supply a name when creating a logger.")}var logger=_loggersByName[name];if(!logger){logger=_loggersByName[name]=new Logger(name,defaultLogger.methodFactory)}return logger};var _log=(typeof window==="undefined"?"undefined":_typeof(window))!==undefinedType?window.log:undefined;defaultLogger.noConflict=function(){if((typeof window==="undefined"?"undefined":_typeof(window))!==undefinedType&&window.log===defaultLogger){window.log=_log}return defaultLogger};defaultLogger.getLoggers=function getLoggers(){return _loggersByName};defaultLogger["default"]=defaultLogger;return defaultLogger}))},{}],139:[function(require,module,exports){(function(Buffer){(function(){"use strict";var protocol=module.exports;protocol.types={0:"reserved",1:"connect",2:"connack",3:"publish",4:"puback",5:"pubrec",6:"pubrel",7:"pubcomp",8:"subscribe",9:"suback",10:"unsubscribe",11:"unsuback",12:"pingreq",13:"pingresp",14:"disconnect",15:"auth"};protocol.codes={};for(var k in protocol.types){var v=protocol.types[k];protocol.codes[v]=k}protocol.CMD_SHIFT=4;protocol.CMD_MASK=240;protocol.DUP_MASK=8;protocol.QOS_MASK=3;protocol.QOS_SHIFT=1;protocol.RETAIN_MASK=1;protocol.VARBYTEINT_MASK=127;protocol.VARBYTEINT_FIN_MASK=128;protocol.VARBYTEINT_MAX=268435455;protocol.SESSIONPRESENT_MASK=1;protocol.SESSIONPRESENT_HEADER=Buffer.from([protocol.SESSIONPRESENT_MASK]);protocol.CONNACK_HEADER=Buffer.from([protocol.codes.connack<<protocol.CMD_SHIFT]);protocol.USERNAME_MASK=128;protocol.PASSWORD_MASK=64;protocol.WILL_RETAIN_MASK=32;protocol.WILL_QOS_MASK=24;protocol.WILL_QOS_SHIFT=3;protocol.WILL_FLAG_MASK=4;protocol.CLEAN_SESSION_MASK=2;protocol.CONNECT_HEADER=Buffer.from([protocol.codes.connect<<protocol.CMD_SHIFT]);protocol.properties={sessionExpiryInterval:17,willDelayInterval:24,receiveMaximum:33,maximumPacketSize:39,topicAliasMaximum:34,requestResponseInformation:25,requestProblemInformation:23,userProperties:38,authenticationMethod:21,authenticationData:22,payloadFormatIndicator:1,messageExpiryInterval:2,contentType:3,responseTopic:8,correlationData:9,maximumQoS:36,retainAvailable:37,assignedClientIdentifier:18,reasonString:31,wildcardSubscriptionAvailable:40,subscriptionIdentifiersAvailable:41,sharedSubscriptionAvailable:42,serverKeepAlive:19,responseInformation:26,serverReference:28,topicAlias:35,subscriptionIdentifier:11};protocol.propertiesCodes={};for(var prop in protocol.properties){var id=protocol.properties[prop];protocol.propertiesCodes[id]=prop}protocol.propertiesTypes={sessionExpiryInterval:"int32",willDelayInterval:"int32",receiveMaximum:"int16",maximumPacketSize:"int32",topicAliasMaximum:"int16",requestResponseInformation:"byte",requestProblemInformation:"byte",userProperties:"pair",authenticationMethod:"string",authenticationData:"binary",payloadFormatIndicator:"byte",messageExpiryInterval:"int32",contentType:"string",responseTopic:"string",correlationData:"binary",maximumQoS:"int8",retainAvailable:"byte",assignedClientIdentifier:"string",reasonString:"string",wildcardSubscriptionAvailable:"byte",subscriptionIdentifiersAvailable:"byte",sharedSubscriptionAvailable:"byte",serverKeepAlive:"int16",responseInformation:"string",serverReference:"string",topicAlias:"int16",subscriptionIdentifier:"var"};function genHeader(type){return[0,1,2].map((function(qos){return[0,1].map((function(dup){return[0,1].map((function(retain){var buf=Buffer.alloc(1);buf.writeUInt8(protocol.codes[type]<<protocol.CMD_SHIFT|(dup?protocol.DUP_MASK:0)|qos<<protocol.QOS_SHIFT|retain,0,true);return buf}))}))}))}protocol.PUBLISH_HEADER=genHeader("publish");protocol.SUBSCRIBE_HEADER=genHeader("subscribe");protocol.SUBSCRIBE_OPTIONS_QOS_MASK=3;protocol.SUBSCRIBE_OPTIONS_NL_MASK=1;protocol.SUBSCRIBE_OPTIONS_NL_SHIFT=2;protocol.SUBSCRIBE_OPTIONS_RAP_MASK=1;protocol.SUBSCRIBE_OPTIONS_RAP_SHIFT=3;protocol.SUBSCRIBE_OPTIONS_RH_MASK=3;protocol.SUBSCRIBE_OPTIONS_RH_SHIFT=4;protocol.SUBSCRIBE_OPTIONS_RH=[0,16,32];protocol.SUBSCRIBE_OPTIONS_NL=4;protocol.SUBSCRIBE_OPTIONS_RAP=8;protocol.SUBSCRIBE_OPTIONS_QOS=[0,1,2];protocol.UNSUBSCRIBE_HEADER=genHeader("unsubscribe");protocol.ACKS={unsuback:genHeader("unsuback"),puback:genHeader("puback"),pubcomp:genHeader("pubcomp"),pubrel:genHeader("pubrel"),pubrec:genHeader("pubrec")};protocol.SUBACK_HEADER=Buffer.from([protocol.codes.suback<<protocol.CMD_SHIFT]);protocol.VERSION3=Buffer.from([3]);protocol.VERSION4=Buffer.from([4]);protocol.VERSION5=Buffer.from([5]);protocol.VERSION131=Buffer.from([131]);protocol.VERSION132=Buffer.from([132]);protocol.QOS=[0,1,2].map((function(qos){return Buffer.from([qos])}));protocol.EMPTY={pingreq:Buffer.from([protocol.codes.pingreq<<4,0]),pingresp:Buffer.from([protocol.codes.pingresp<<4,0]),disconnect:Buffer.from([protocol.codes.disconnect<<4,0])}}).call(this)}).call(this,require("buffer").Buffer)},{buffer:74}],140:[function(require,module,exports){(function(Buffer){(function(){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}var writeToStream=require("./writeToStream");var EventEmitter=require("events");function generate(packet,opts){var stream=new Accumulator;writeToStream(packet,stream,opts);return stream.concat()}var Accumulator=function(_EventEmitter){function Accumulator(){var _this;_classCallCheck(this,Accumulator);_this=_callSuper(this,Accumulator);_this._array=new Array(20);_this._i=0;return _this}_inherits(Accumulator,_EventEmitter);return _createClass(Accumulator,[{key:"write",value:function write(chunk){this._array[this._i++]=chunk;return true}},{key:"concat",value:function concat(){var length=0;var lengths=new Array(this._array.length);var list=this._array;var pos=0;var i;for(i=0;i<list.length&&list[i]!==undefined;i++){if(typeof list[i]!=="string")lengths[i]=list[i].length;else lengths[i]=Buffer.byteLength(list[i]);length+=lengths[i]}var result=Buffer.allocUnsafe(length);for(i=0;i<list.length&&list[i]!==undefined;i++){if(typeof list[i]!=="string"){list[i].copy(result,pos);pos+=lengths[i]}else{result.write(list[i],pos);pos+=lengths[i]}}return result}}])}(EventEmitter);module.exports=generate}).call(this)}).call(this,require("buffer").Buffer)},{"./writeToStream":145,buffer:74,events:97}],141:[function(require,module,exports){"use strict";exports.parser=require("./parser").parser;exports.generate=require("./generate");exports.writeToStream=require("./writeToStream")},{"./generate":140,"./parser":144,"./writeToStream":145}],142:[function(require,module,exports){(function(Buffer){(function(){"use strict";var max=65536;var cache={};var SubOk=Buffer.isBuffer(Buffer.from([1,2]).subarray(0,1));function generateBuffer(i){var buffer=Buffer.allocUnsafe(2);buffer.writeUInt8(i>>8,0);buffer.writeUInt8(i&255,0+1);return buffer}function generateCache(){for(var i=0;i<max;i++){cache[i]=generateBuffer(i)}}function genBufVariableByteInt(num){var maxLength=4;var digit=0;var pos=0;var buffer=Buffer.allocUnsafe(maxLength);do{digit=num%128|0;num=num/128|0;if(num>0)digit=digit|128;buffer.writeUInt8(digit,pos++)}while(num>0&&pos<maxLength);if(num>0){pos=0}return SubOk?buffer.subarray(0,pos):buffer.slice(0,pos)}function generate4ByteBuffer(num){var buffer=Buffer.allocUnsafe(4);buffer.writeUInt32BE(num,0);return buffer}module.exports={cache:cache,generateCache:generateCache,generateNumber:generateBuffer,genBufVariableByteInt:genBufVariableByteInt,generate4ByteBuffer:generate4ByteBuffer}}).call(this)}).call(this,require("buffer").Buffer)},{buffer:74}],143:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}var Packet=_createClass((function Packet(){_classCallCheck(this,Packet);this.cmd=null;this.retain=false;this.qos=0;this.dup=false;this.length=-1;this.topic=null;this.payload=null}));module.exports=Packet},{}],144:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}var bl=require("bl");var EventEmitter=require("events");var Packet=require("./packet");var constants=require("./constants");var debug=require("debug")("mqtt-packet:parser");var Parser=function(_EventEmitter){function Parser(){var _this;_classCallCheck(this,Parser);_this=_callSuper(this,Parser);_this.parser=_this.constructor.parser;return _this}_inherits(Parser,_EventEmitter);return _createClass(Parser,[{key:"_resetState",value:function _resetState(){debug("_resetState: resetting packet, error, _list, and _stateCounter");this.packet=new Packet;this.error=null;this._list=bl();this._stateCounter=0}},{key:"parse",value:function parse(buf){if(this.error)this._resetState();this._list.append(buf);debug("parse: current state: %s",this._states[this._stateCounter]);while((this.packet.length!==-1||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error){this._stateCounter++;debug("parse: state complete. _stateCounter is now: %d",this._stateCounter);debug("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length);if(this._stateCounter>=this._states.length)this._stateCounter=0}debug("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length);return this._list.length}},{key:"_parseHeader",value:function _parseHeader(){var zero=this._list.readUInt8(0);this.packet.cmd=constants.types[zero>>constants.CMD_SHIFT];this.packet.retain=(zero&constants.RETAIN_MASK)!==0;this.packet.qos=zero>>constants.QOS_SHIFT&constants.QOS_MASK;this.packet.dup=(zero&constants.DUP_MASK)!==0;debug("_parseHeader: packet: %o",this.packet);this._list.consume(1);return true}},{key:"_parseLength",value:function _parseLength(){var result=this._parseVarByteNum(true);if(result){this.packet.length=result.value;this._list.consume(result.bytes)}debug("_parseLength %d",result.value);return!!result}},{key:"_parsePayload",value:function _parsePayload(){debug("_parsePayload: payload %O",this._list);var result=false;if(this.packet.length===0||this._list.length>=this.packet.length){this._pos=0;switch(this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseConfirmation();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":break;case"disconnect":this._parseDisconnect();break;case"auth":this._parseAuth();break;default:this._emitError(new Error("Not supported"))}result=true}debug("_parsePayload complete result: %s",result);return result}},{key:"_parseConnect",value:function _parseConnect(){debug("_parseConnect");var topic;var payload;var password;var username;var flags={};var packet=this.packet;var protocolId=this._parseString();if(protocolId===null)return this._emitError(new Error("Cannot parse protocolId"));if(protocolId!=="MQTT"&&protocolId!=="MQIsdp"){return this._emitError(new Error("Invalid protocolId"))}packet.protocolId=protocolId;if(this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));packet.protocolVersion=this._list.readUInt8(this._pos);if(packet.protocolVersion>=128){packet.bridgeMode=true;packet.protocolVersion=packet.protocolVersion-128}if(packet.protocolVersion!==3&&packet.protocolVersion!==4&&packet.protocolVersion!==5){return this._emitError(new Error("Invalid protocol version"))}this._pos++;if(this._pos>=this._list.length){return this._emitError(new Error("Packet too short"))}flags.username=this._list.readUInt8(this._pos)&constants.USERNAME_MASK;flags.password=this._list.readUInt8(this._pos)&constants.PASSWORD_MASK;flags.will=this._list.readUInt8(this._pos)&constants.WILL_FLAG_MASK;if(flags.will){packet.will={};packet.will.retain=(this._list.readUInt8(this._pos)&constants.WILL_RETAIN_MASK)!==0;packet.will.qos=(this._list.readUInt8(this._pos)&constants.WILL_QOS_MASK)>>constants.WILL_QOS_SHIFT}packet.clean=(this._list.readUInt8(this._pos)&constants.CLEAN_SESSION_MASK)!==0;this._pos++;packet.keepalive=this._parseNum();if(packet.keepalive===-1)return this._emitError(new Error("Packet too short"));if(packet.protocolVersion===5){var properties=this._parseProperties();if(Object.getOwnPropertyNames(properties).length){packet.properties=properties}}var clientId=this._parseString();if(clientId===null)return this._emitError(new Error("Packet too short"));packet.clientId=clientId;debug("_parseConnect: packet.clientId: %s",packet.clientId);if(flags.will){if(packet.protocolVersion===5){var willProperties=this._parseProperties();if(Object.getOwnPropertyNames(willProperties).length){packet.will.properties=willProperties}}topic=this._parseString();if(topic===null)return this._emitError(new Error("Cannot parse will topic"));packet.will.topic=topic;debug("_parseConnect: packet.will.topic: %s",packet.will.topic);payload=this._parseBuffer();if(payload===null)return this._emitError(new Error("Cannot parse will payload"));packet.will.payload=payload;debug("_parseConnect: packet.will.paylaod: %s",packet.will.payload)}if(flags.username){username=this._parseString();if(username===null)return this._emitError(new Error("Cannot parse username"));packet.username=username;debug("_parseConnect: packet.username: %s",packet.username)}if(flags.password){password=this._parseBuffer();if(password===null)return this._emitError(new Error("Cannot parse password"));packet.password=password}this.settings=packet;debug("_parseConnect: complete");return packet}},{key:"_parseConnack",value:function _parseConnack(){debug("_parseConnack");var packet=this.packet;if(this._list.length<1)return null;packet.sessionPresent=!!(this._list.readUInt8(this._pos++)&constants.SESSIONPRESENT_MASK);if(this.settings.protocolVersion===5){if(this._list.length>=2){packet.reasonCode=this._list.readUInt8(this._pos++)}else{packet.reasonCode=0}}else{if(this._list.length<2)return null;packet.returnCode=this._list.readUInt8(this._pos++)}if(packet.returnCode===-1||packet.reasonCode===-1)return this._emitError(new Error("Cannot parse return code"));if(this.settings.protocolVersion===5){var properties=this._parseProperties();if(Object.getOwnPropertyNames(properties).length){packet.properties=properties}}debug("_parseConnack: complete")}},{key:"_parsePublish",value:function _parsePublish(){debug("_parsePublish");var packet=this.packet;packet.topic=this._parseString();if(packet.topic===null)return this._emitError(new Error("Cannot parse topic"));if(packet.qos>0)if(!this._parseMessageId()){return}if(this.settings.protocolVersion===5){var properties=this._parseProperties();if(Object.getOwnPropertyNames(properties).length){packet.properties=properties}}packet.payload=this._list.slice(this._pos,packet.length);debug("_parsePublish: payload from buffer list: %o",packet.payload)}},{key:"_parseSubscribe",value:function _parseSubscribe(){debug("_parseSubscribe");var packet=this.packet;var topic;var options;var qos;var rh;var rap;var nl;var subscription;if(packet.qos!==1){return this._emitError(new Error("Wrong subscribe header"))}packet.subscriptions=[];if(!this._parseMessageId()){return}if(this.settings.protocolVersion===5){var properties=this._parseProperties();if(Object.getOwnPropertyNames(properties).length){packet.properties=properties}}while(this._pos<packet.length){topic=this._parseString();if(topic===null)return this._emitError(new Error("Cannot parse topic"));if(this._pos>=packet.length)return this._emitError(new Error("Malformed Subscribe Payload"));options=this._parseByte();qos=options&constants.SUBSCRIBE_OPTIONS_QOS_MASK;nl=(options>>constants.SUBSCRIBE_OPTIONS_NL_SHIFT&constants.SUBSCRIBE_OPTIONS_NL_MASK)!==0;rap=(options>>constants.SUBSCRIBE_OPTIONS_RAP_SHIFT&constants.SUBSCRIBE_OPTIONS_RAP_MASK)!==0;rh=options>>constants.SUBSCRIBE_OPTIONS_RH_SHIFT&constants.SUBSCRIBE_OPTIONS_RH_MASK;subscription={topic:topic,qos:qos};if(this.settings.protocolVersion===5){subscription.nl=nl;subscription.rap=rap;subscription.rh=rh}else if(this.settings.bridgeMode){subscription.rh=0;subscription.rap=true;subscription.nl=true}debug("_parseSubscribe: push subscription `%s` to subscription",subscription);packet.subscriptions.push(subscription)}}},{key:"_parseSuback",value:function _parseSuback(){debug("_parseSuback");var packet=this.packet;this.packet.granted=[];if(!this._parseMessageId()){return}if(this.settings.protocolVersion===5){var properties=this._parseProperties();if(Object.getOwnPropertyNames(properties).length){packet.properties=properties}}while(this._pos<this.packet.length){this.packet.granted.push(this._list.readUInt8(this._pos++))}}},{key:"_parseUnsubscribe",value:function _parseUnsubscribe(){debug("_parseUnsubscribe");var packet=this.packet;packet.unsubscriptions=[];if(!this._parseMessageId()){return}if(this.settings.protocolVersion===5){var properties=this._parseProperties();if(Object.getOwnPropertyNames(properties).length){packet.properties=properties}}while(this._pos<packet.length){var topic=this._parseString();if(topic===null)return this._emitError(new Error("Cannot parse topic"));debug("_parseUnsubscribe: push topic `%s` to unsubscriptions",topic);packet.unsubscriptions.push(topic)}}},{key:"_parseUnsuback",value:function _parseUnsuback(){debug("_parseUnsuback");var packet=this.packet;if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"));if(this.settings.protocolVersion===5){var properties=this._parseProperties();if(Object.getOwnPropertyNames(properties).length){packet.properties=properties}packet.granted=[];while(this._pos<this.packet.length){this.packet.granted.push(this._list.readUInt8(this._pos++))}}}},{key:"_parseConfirmation",value:function _parseConfirmation(){debug("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);var packet=this.packet;this._parseMessageId();if(this.settings.protocolVersion===5){if(packet.length>2){packet.reasonCode=this._parseByte();debug("_parseConfirmation: packet.reasonCode `%d`",packet.reasonCode)}else{packet.reasonCode=0}if(packet.length>3){var properties=this._parseProperties();if(Object.getOwnPropertyNames(properties).length){packet.properties=properties}}}return true}},{key:"_parseDisconnect",value:function _parseDisconnect(){var packet=this.packet;debug("_parseDisconnect");if(this.settings.protocolVersion===5){if(this._list.length>0){packet.reasonCode=this._parseByte()}else{packet.reasonCode=0}var properties=this._parseProperties();if(Object.getOwnPropertyNames(properties).length){packet.properties=properties}}debug("_parseDisconnect result: true");return true}},{key:"_parseAuth",value:function _parseAuth(){debug("_parseAuth");var packet=this.packet;if(this.settings.protocolVersion!==5){return this._emitError(new Error("Not supported auth packet for this version MQTT"))}packet.reasonCode=this._parseByte();var properties=this._parseProperties();if(Object.getOwnPropertyNames(properties).length){packet.properties=properties}debug("_parseAuth: result: true");return true}},{key:"_parseMessageId",value:function _parseMessageId(){var packet=this.packet;packet.messageId=this._parseNum();if(packet.messageId===null){this._emitError(new Error("Cannot parse messageId"));return false}debug("_parseMessageId: packet.messageId %d",packet.messageId);return true}},{key:"_parseString",value:function _parseString(maybeBuffer){var length=this._parseNum();var end=length+this._pos;if(length===-1||end>this._list.length||end>this.packet.length)return null;var result=this._list.toString("utf8",this._pos,end);this._pos+=length;debug("_parseString: result: %s",result);return result}},{key:"_parseStringPair",value:function _parseStringPair(){debug("_parseStringPair");return{name:this._parseString(),value:this._parseString()}}},{key:"_parseBuffer",value:function _parseBuffer(){var length=this._parseNum();var end=length+this._pos;if(length===-1||end>this._list.length||end>this.packet.length)return null;var result=this._list.slice(this._pos,end);this._pos+=length;debug("_parseBuffer: result: %o",result);return result}},{key:"_parseNum",value:function _parseNum(){if(this._list.length-this._pos<2)return-1;var result=this._list.readUInt16BE(this._pos);this._pos+=2;debug("_parseNum: result: %s",result);return result}},{key:"_parse4ByteNum",value:function _parse4ByteNum(){if(this._list.length-this._pos<4)return-1;var result=this._list.readUInt32BE(this._pos);this._pos+=4;debug("_parse4ByteNum: result: %s",result);return result}},{key:"_parseVarByteNum",value:function _parseVarByteNum(fullInfoFlag){debug("_parseVarByteNum");var maxBytes=4;var bytes=0;var mul=1;var value=0;var result=false;var current;var padding=this._pos?this._pos:0;while(bytes<maxBytes&&padding+bytes<this._list.length){current=this._list.readUInt8(padding+bytes++);value+=mul*(current&constants.VARBYTEINT_MASK);mul*=128;if((current&constants.VARBYTEINT_FIN_MASK)===0){result=true;break}if(this._list.length<=bytes){break}}if(!result&&bytes===maxBytes&&this._list.length>=bytes){this._emitError(new Error("Invalid variable byte integer"))}if(padding){this._pos+=bytes}result=result?fullInfoFlag?{bytes:bytes,value:value}:value:false;debug("_parseVarByteNum: result: %o",result);return result}},{key:"_parseByte",value:function _parseByte(){var result;if(this._pos<this._list.length){result=this._list.readUInt8(this._pos);this._pos++}debug("_parseByte: result: %o",result);return result}},{key:"_parseByType",value:function _parseByType(type){debug("_parseByType: type: %s",type);switch(type){case"byte":{return this._parseByte()!==0}case"int8":{return this._parseByte()}case"int16":{return this._parseNum()}case"int32":{return this._parse4ByteNum()}case"var":{return this._parseVarByteNum()}case"string":{return this._parseString()}case"pair":{return this._parseStringPair()}case"binary":{return this._parseBuffer()}}}},{key:"_parseProperties",value:function _parseProperties(){debug("_parseProperties");var length=this._parseVarByteNum();var start=this._pos;var end=start+length;var result={};while(this._pos<end){var type=this._parseByte();if(!type){this._emitError(new Error("Cannot parse property code type"));return false}var name=constants.propertiesCodes[type];if(!name){this._emitError(new Error("Unknown property"));return false}if(name==="userProperties"){if(!result[name]){result[name]=Object.create(null)}var currentUserProperty=this._parseByType(constants.propertiesTypes[name]);if(result[name][currentUserProperty.name]){if(Array.isArray(result[name][currentUserProperty.name])){result[name][currentUserProperty.name].push(currentUserProperty.value)}else{var currentValue=result[name][currentUserProperty.name];result[name][currentUserProperty.name]=[currentValue];result[name][currentUserProperty.name].push(currentUserProperty.value)}}else{result[name][currentUserProperty.name]=currentUserProperty.value}continue}if(result[name]){if(Array.isArray(result[name])){result[name].push(this._parseByType(constants.propertiesTypes[name]))}else{result[name]=[result[name]];result[name].push(this._parseByType(constants.propertiesTypes[name]))}}else{result[name]=this._parseByType(constants.propertiesTypes[name])}}return result}},{key:"_newPacket",value:function _newPacket(){debug("_newPacket");if(this.packet){this._list.consume(this.packet.length);debug("_newPacket: parser emit packet: packet.cmd: %s, packet.payload: %s, packet.length: %d",this.packet.cmd,this.packet.payload,this.packet.length);this.emit("packet",this.packet)}debug("_newPacket: new packet");this.packet=new Packet;this._pos=0;return true}},{key:"_emitError",value:function _emitError(err){debug("_emitError");this.error=err;this.emit("error",err)}}],[{key:"parser",value:function parser(opt){if(!(this instanceof Parser))return(new Parser).parser(opt);this.settings=opt||{};this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"];this._resetState();return this}}])}(EventEmitter);module.exports=Parser},{"./constants":139,"./packet":143,bl:54,debug:77,events:97}],145:[function(require,module,exports){(function(Buffer){(function(){"use strict";function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}var protocol=require("./constants");var empty=Buffer.allocUnsafe(0);var zeroBuf=Buffer.from([0]);var numbers=require("./numbers");var nextTick=require("process-nextick-args").nextTick;var debug=require("debug")("mqtt-packet:writeToStream");var numCache=numbers.cache;var generateNumber=numbers.generateNumber;var generateCache=numbers.generateCache;var genBufVariableByteInt=numbers.genBufVariableByteInt;var generate4ByteBuffer=numbers.generate4ByteBuffer;var writeNumber=writeNumberCached;var toGenerate=true;function generate(packet,stream,opts){debug("generate called");if(stream.cork){stream.cork();nextTick(uncork,stream)}if(toGenerate){toGenerate=false;generateCache()}debug("generate: packet.cmd: %s",packet.cmd);switch(packet.cmd){case"connect":return connect(packet,stream,opts);case"connack":return connack(packet,stream,opts);case"publish":return publish(packet,stream,opts);case"puback":case"pubrec":case"pubrel":case"pubcomp":return confirmation(packet,stream,opts);case"subscribe":return subscribe(packet,stream,opts);case"suback":return suback(packet,stream,opts);case"unsubscribe":return unsubscribe(packet,stream,opts);case"unsuback":return unsuback(packet,stream,opts);case"pingreq":case"pingresp":return emptyPacket(packet,stream,opts);case"disconnect":return disconnect(packet,stream,opts);case"auth":return auth(packet,stream,opts);default:stream.emit("error",new Error("Unknown command"));return false}}Object.defineProperty(generate,"cacheNumbers",{get:function get(){return writeNumber===writeNumberCached},set:function set(value){if(value){if(!numCache||Object.keys(numCache).length===0)toGenerate=true;writeNumber=writeNumberCached}else{toGenerate=false;writeNumber=writeNumberGenerated}}});function uncork(stream){stream.uncork()}function connect(packet,stream,opts){var settings=packet||{};var protocolId=settings.protocolId||"MQTT";var protocolVersion=settings.protocolVersion||4;var will=settings.will;var clean=settings.clean;var keepalive=settings.keepalive||0;var clientId=settings.clientId||"";var username=settings.username;var password=settings.password;var properties=settings.properties;if(clean===undefined)clean=true;var length=0;if(!protocolId||typeof protocolId!=="string"&&!Buffer.isBuffer(protocolId)){stream.emit("error",new Error("Invalid protocolId"));return false}else length+=protocolId.length+2;if(protocolVersion!==3&&protocolVersion!==4&&protocolVersion!==5){stream.emit("error",new Error("Invalid protocol version"));return false}else length+=1;if((typeof clientId==="string"||Buffer.isBuffer(clientId))&&(clientId||protocolVersion>=4)&&(clientId||clean)){length+=Buffer.byteLength(clientId)+2}else{if(protocolVersion<4){stream.emit("error",new Error("clientId must be supplied before 3.1.1"));return false}if(clean*1===0){stream.emit("error",new Error("clientId must be given if cleanSession set to 0"));return false}}if(typeof keepalive!=="number"||keepalive<0||keepalive>65535||keepalive%1!==0){stream.emit("error",new Error("Invalid keepalive"));return false}else length+=2;length+=1;if(protocolVersion===5){var propertiesData=getProperties(stream,properties);if(!propertiesData){return false}length+=propertiesData.length}if(will){if(_typeof(will)!=="object"){stream.emit("error",new Error("Invalid will"));return false}if(!will.topic||typeof will.topic!=="string"){stream.emit("error",new Error("Invalid will topic"));return false}else{length+=Buffer.byteLength(will.topic)+2}length+=2;if(will.payload){if(will.payload.length>=0){if(typeof will.payload==="string"){length+=Buffer.byteLength(will.payload)}else{length+=will.payload.length}}else{stream.emit("error",new Error("Invalid will payload"));return false}}var willProperties={};if(protocolVersion===5){willProperties=getProperties(stream,will.properties);if(!willProperties){return false}length+=willProperties.length}}var providedUsername=false;if(username!=null){if(isStringOrBuffer(username)){providedUsername=true;length+=Buffer.byteLength(username)+2}else{stream.emit("error",new Error("Invalid username"));return false}}if(password!=null){if(!providedUsername){stream.emit("error",new Error("Username is required to use password"));return false}if(isStringOrBuffer(password)){length+=byteLength(password)+2}else{stream.emit("error",new Error("Invalid password"));return false}}stream.write(protocol.CONNECT_HEADER);writeVarByteInt(stream,length);writeStringOrBuffer(stream,protocolId);if(settings.bridgeMode){protocolVersion+=128}stream.write(protocolVersion===131?protocol.VERSION131:protocolVersion===132?protocol.VERSION132:protocolVersion===4?protocol.VERSION4:protocolVersion===5?protocol.VERSION5:protocol.VERSION3);var flags=0;flags|=username!=null?protocol.USERNAME_MASK:0;flags|=password!=null?protocol.PASSWORD_MASK:0;flags|=will&&will.retain?protocol.WILL_RETAIN_MASK:0;flags|=will&&will.qos?will.qos<<protocol.WILL_QOS_SHIFT:0;flags|=will?protocol.WILL_FLAG_MASK:0;flags|=clean?protocol.CLEAN_SESSION_MASK:0;stream.write(Buffer.from([flags]));writeNumber(stream,keepalive);if(protocolVersion===5){propertiesData.write()}writeStringOrBuffer(stream,clientId);if(will){if(protocolVersion===5){willProperties.write()}writeString(stream,will.topic);writeStringOrBuffer(stream,will.payload)}if(username!=null){writeStringOrBuffer(stream,username)}if(password!=null){writeStringOrBuffer(stream,password)}return true}function connack(packet,stream,opts){var version=opts?opts.protocolVersion:4;var settings=packet||{};var rc=version===5?settings.reasonCode:settings.returnCode;var properties=settings.properties;var length=2;if(typeof rc!=="number"){stream.emit("error",new Error("Invalid return code"));return false}var propertiesData=null;if(version===5){propertiesData=getProperties(stream,properties);if(!propertiesData){return false}length+=propertiesData.length}stream.write(protocol.CONNACK_HEADER);writeVarByteInt(stream,length);stream.write(settings.sessionPresent?protocol.SESSIONPRESENT_HEADER:zeroBuf);stream.write(Buffer.from([rc]));if(propertiesData!=null){propertiesData.write()}return true}function publish(packet,stream,opts){debug("publish: packet: %o",packet);var version=opts?opts.protocolVersion:4;var settings=packet||{};var qos=settings.qos||0;var retain=settings.retain?protocol.RETAIN_MASK:0;var topic=settings.topic;var payload=settings.payload||empty;var id=settings.messageId;var properties=settings.properties;var length=0;if(typeof topic==="string")length+=Buffer.byteLength(topic)+2;else if(Buffer.isBuffer(topic))length+=topic.length+2;else{stream.emit("error",new Error("Invalid topic"));return false}if(!Buffer.isBuffer(payload))length+=Buffer.byteLength(payload);else length+=payload.length;if(qos&&typeof id!=="number"){stream.emit("error",new Error("Invalid messageId"));return false}else if(qos)length+=2;var propertiesData=null;if(version===5){propertiesData=getProperties(stream,properties);if(!propertiesData){return false}length+=propertiesData.length}stream.write(protocol.PUBLISH_HEADER[qos][settings.dup?1:0][retain?1:0]);writeVarByteInt(stream,length);writeNumber(stream,byteLength(topic));stream.write(topic);if(qos>0)writeNumber(stream,id);if(propertiesData!=null){propertiesData.write()}debug("publish: payload: %o",payload);return stream.write(payload)}function confirmation(packet,stream,opts){var version=opts?opts.protocolVersion:4;var settings=packet||{};var type=settings.cmd||"puback";var id=settings.messageId;var dup=settings.dup&&type==="pubrel"?protocol.DUP_MASK:0;var qos=0;var reasonCode=settings.reasonCode;var properties=settings.properties;var length=version===5?3:2;if(type==="pubrel")qos=1;if(typeof id!=="number"){stream.emit("error",new Error("Invalid messageId"));return false}var propertiesData=null;if(version===5){if(_typeof(properties)==="object"){propertiesData=getPropertiesByMaximumPacketSize(stream,properties,opts,length);if(!propertiesData){return false}length+=propertiesData.length}}stream.write(protocol.ACKS[type][qos][dup][0]);writeVarByteInt(stream,length);writeNumber(stream,id);if(version===5){stream.write(Buffer.from([reasonCode]))}if(propertiesData!==null){propertiesData.write()}return true}function subscribe(packet,stream,opts){debug("subscribe: packet: ");var version=opts?opts.protocolVersion:4;var settings=packet||{};var dup=settings.dup?protocol.DUP_MASK:0;var id=settings.messageId;var subs=settings.subscriptions;var properties=settings.properties;var length=0;if(typeof id!=="number"){stream.emit("error",new Error("Invalid messageId"));return false}else length+=2;var propertiesData=null;if(version===5){propertiesData=getProperties(stream,properties);if(!propertiesData){return false}length+=propertiesData.length}if(_typeof(subs)==="object"&&subs.length){for(var i=0;i<subs.length;i+=1){var itopic=subs[i].topic;var iqos=subs[i].qos;if(typeof itopic!=="string"){stream.emit("error",new Error("Invalid subscriptions - invalid topic"));return false}if(typeof iqos!=="number"){stream.emit("error",new Error("Invalid subscriptions - invalid qos"));return false}if(version===5){var nl=subs[i].nl||false;if(typeof nl!=="boolean"){stream.emit("error",new Error("Invalid subscriptions - invalid No Local"));return false}var rap=subs[i].rap||false;if(typeof rap!=="boolean"){stream.emit("error",new Error("Invalid subscriptions - invalid Retain as Published"));return false}var rh=subs[i].rh||0;if(typeof rh!=="number"||rh>2){stream.emit("error",new Error("Invalid subscriptions - invalid Retain Handling"));return false}}length+=Buffer.byteLength(itopic)+2+1}}else{stream.emit("error",new Error("Invalid subscriptions"));return false}debug("subscribe: writing to stream: %o",protocol.SUBSCRIBE_HEADER);stream.write(protocol.SUBSCRIBE_HEADER[1][dup?1:0][0]);writeVarByteInt(stream,length);writeNumber(stream,id);if(propertiesData!==null){propertiesData.write()}var result=true;var _iterator=_createForOfIteratorHelper(subs),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var sub=_step.value;var jtopic=sub.topic;var jqos=sub.qos;var jnl=+sub.nl;var jrap=+sub.rap;var jrh=sub.rh;var joptions=void 0;writeString(stream,jtopic);joptions=protocol.SUBSCRIBE_OPTIONS_QOS[jqos];if(version===5){joptions|=jnl?protocol.SUBSCRIBE_OPTIONS_NL:0;joptions|=jrap?protocol.SUBSCRIBE_OPTIONS_RAP:0;joptions|=jrh?protocol.SUBSCRIBE_OPTIONS_RH[jrh]:0}result=stream.write(Buffer.from([joptions]))}}catch(err){_iterator.e(err)}finally{_iterator.f()}return result}function suback(packet,stream,opts){var version=opts?opts.protocolVersion:4;var settings=packet||{};var id=settings.messageId;var granted=settings.granted;var properties=settings.properties;var length=0;if(typeof id!=="number"){stream.emit("error",new Error("Invalid messageId"));return false}else length+=2;if(_typeof(granted)==="object"&&granted.length){for(var i=0;i<granted.length;i+=1){if(typeof granted[i]!=="number"){stream.emit("error",new Error("Invalid qos vector"));return false}length+=1}}else{stream.emit("error",new Error("Invalid qos vector"));return false}var propertiesData=null;if(version===5){propertiesData=getPropertiesByMaximumPacketSize(stream,properties,opts,length);if(!propertiesData){return false}length+=propertiesData.length}stream.write(protocol.SUBACK_HEADER);writeVarByteInt(stream,length);writeNumber(stream,id);if(propertiesData!==null){propertiesData.write()}return stream.write(Buffer.from(granted))}function unsubscribe(packet,stream,opts){var version=opts?opts.protocolVersion:4;var settings=packet||{};var id=settings.messageId;var dup=settings.dup?protocol.DUP_MASK:0;var unsubs=settings.unsubscriptions;var properties=settings.properties;var length=0;if(typeof id!=="number"){stream.emit("error",new Error("Invalid messageId"));return false}else{length+=2}if(_typeof(unsubs)==="object"&&unsubs.length){for(var i=0;i<unsubs.length;i+=1){if(typeof unsubs[i]!=="string"){stream.emit("error",new Error("Invalid unsubscriptions"));return false}length+=Buffer.byteLength(unsubs[i])+2}}else{stream.emit("error",new Error("Invalid unsubscriptions"));return false}var propertiesData=null;if(version===5){propertiesData=getProperties(stream,properties);if(!propertiesData){return false}length+=propertiesData.length}stream.write(protocol.UNSUBSCRIBE_HEADER[1][dup?1:0][0]);writeVarByteInt(stream,length);writeNumber(stream,id);if(propertiesData!==null){propertiesData.write()}var result=true;for(var j=0;j<unsubs.length;j++){result=writeString(stream,unsubs[j])}return result}function unsuback(packet,stream,opts){var version=opts?opts.protocolVersion:4;var settings=packet||{};var id=settings.messageId;var dup=settings.dup?protocol.DUP_MASK:0;var granted=settings.granted;var properties=settings.properties;var type=settings.cmd;var qos=0;var length=2;if(typeof id!=="number"){stream.emit("error",new Error("Invalid messageId"));return false}if(version===5){if(_typeof(granted)==="object"&&granted.length){for(var i=0;i<granted.length;i+=1){if(typeof granted[i]!=="number"){stream.emit("error",new Error("Invalid qos vector"));return false}length+=1}}else{stream.emit("error",new Error("Invalid qos vector"));return false}}var propertiesData=null;if(version===5){propertiesData=getPropertiesByMaximumPacketSize(stream,properties,opts,length);if(!propertiesData){return false}length+=propertiesData.length}stream.write(protocol.ACKS[type][qos][dup][0]);writeVarByteInt(stream,length);writeNumber(stream,id);if(propertiesData!==null){propertiesData.write()}if(version===5){stream.write(Buffer.from(granted))}return true}function emptyPacket(packet,stream,opts){return stream.write(protocol.EMPTY[packet.cmd])}function disconnect(packet,stream,opts){var version=opts?opts.protocolVersion:4;var settings=packet||{};var reasonCode=settings.reasonCode;var properties=settings.properties;var length=version===5?1:0;var propertiesData=null;if(version===5){propertiesData=getPropertiesByMaximumPacketSize(stream,properties,opts,length);if(!propertiesData){return false}length+=propertiesData.length}stream.write(Buffer.from([protocol.codes.disconnect<<4]));writeVarByteInt(stream,length);if(version===5){stream.write(Buffer.from([reasonCode]))}if(propertiesData!==null){propertiesData.write()}return true}function auth(packet,stream,opts){var version=opts?opts.protocolVersion:4;var settings=packet||{};var reasonCode=settings.reasonCode;var properties=settings.properties;var length=version===5?1:0;if(version!==5)stream.emit("error",new Error("Invalid mqtt version for auth packet"));var propertiesData=getPropertiesByMaximumPacketSize(stream,properties,opts,length);if(!propertiesData){return false}length+=propertiesData.length;stream.write(Buffer.from([protocol.codes.auth<<4]));writeVarByteInt(stream,length);stream.write(Buffer.from([reasonCode]));if(propertiesData!==null){propertiesData.write()}return true}var varByteIntCache={};function writeVarByteInt(stream,num){if(num>protocol.VARBYTEINT_MAX){stream.emit("error",new Error("Invalid variable byte integer: ".concat(num)));return false}var buffer=varByteIntCache[num];if(!buffer){buffer=genBufVariableByteInt(num);if(num<16384)varByteIntCache[num]=buffer}debug("writeVarByteInt: writing to stream: %o",buffer);return stream.write(buffer)}function writeString(stream,string){var strlen=Buffer.byteLength(string);writeNumber(stream,strlen);debug("writeString: %s",string);return stream.write(string,"utf8")}function writeStringPair(stream,name,value){writeString(stream,name);writeString(stream,value)}function writeNumberCached(stream,number){debug("writeNumberCached: number: %d",number);debug("writeNumberCached: %o",numCache[number]);return stream.write(numCache[number])}function writeNumberGenerated(stream,number){var generatedNumber=generateNumber(number);debug("writeNumberGenerated: %o",generatedNumber);return stream.write(generatedNumber)}function write4ByteNumber(stream,number){var generated4ByteBuffer=generate4ByteBuffer(number);debug("write4ByteNumber: %o",generated4ByteBuffer);return stream.write(generated4ByteBuffer)}function writeStringOrBuffer(stream,toWrite){if(typeof toWrite==="string"){writeString(stream,toWrite)}else if(toWrite){writeNumber(stream,toWrite.length);stream.write(toWrite)}else writeNumber(stream,0)}function getProperties(stream,properties){if(_typeof(properties)!=="object"||properties.length!=null){return{length:1,write:function write(){writeProperties(stream,{},0)}}}var propertiesLength=0;function getLengthProperty(name,value){var type=protocol.propertiesTypes[name];var length=0;switch(type){case"byte":{if(typeof value!=="boolean"){stream.emit("error",new Error("Invalid ".concat(name,": ").concat(value)));return false}length+=1+1;break}case"int8":{if(typeof value!=="number"||value<0||value>255){stream.emit("error",new Error("Invalid ".concat(name,": ").concat(value)));return false}length+=1+1;break}case"binary":{if(value&&value===null){stream.emit("error",new Error("Invalid ".concat(name,": ").concat(value)));return false}length+=1+Buffer.byteLength(value)+2;break}case"int16":{if(typeof value!=="number"||value<0||value>65535){stream.emit("error",new Error("Invalid ".concat(name,": ").concat(value)));return false}length+=1+2;break}case"int32":{if(typeof value!=="number"||value<0||value>4294967295){stream.emit("error",new Error("Invalid ".concat(name,": ").concat(value)));return false}length+=1+4;break}case"var":{if(typeof value!=="number"||value<0||value>268435455){stream.emit("error",new Error("Invalid ".concat(name,": ").concat(value)));return false}length+=1+Buffer.byteLength(genBufVariableByteInt(value));break}case"string":{if(typeof value!=="string"){stream.emit("error",new Error("Invalid ".concat(name,": ").concat(value)));return false}length+=1+2+Buffer.byteLength(value.toString());break}case"pair":{if(_typeof(value)!=="object"){stream.emit("error",new Error("Invalid ".concat(name,": ").concat(value)));return false}length+=Object.getOwnPropertyNames(value).reduce((function(result,name){var currentValue=value[name];if(Array.isArray(currentValue)){result+=currentValue.reduce((function(currentLength,value){currentLength+=1+2+Buffer.byteLength(name.toString())+2+Buffer.byteLength(value.toString());return currentLength}),0)}else{result+=1+2+Buffer.byteLength(name.toString())+2+Buffer.byteLength(value[name].toString())}return result}),0);break}default:{stream.emit("error",new Error("Invalid property ".concat(name,": ").concat(value)));return false}}return length}if(properties){for(var propName in properties){var propLength=0;var propValueLength=0;var propValue=properties[propName];if(Array.isArray(propValue)){for(var valueIndex=0;valueIndex<propValue.length;valueIndex++){propValueLength=getLengthProperty(propName,propValue[valueIndex]);if(!propValueLength){return false}propLength+=propValueLength}}else{propValueLength=getLengthProperty(propName,propValue);if(!propValueLength){return false}propLength=propValueLength}if(!propLength)return false;propertiesLength+=propLength}}var propertiesLengthLength=Buffer.byteLength(genBufVariableByteInt(propertiesLength));return{length:propertiesLengthLength+propertiesLength,write:function write(){writeProperties(stream,properties,propertiesLength)}}}function getPropertiesByMaximumPacketSize(stream,properties,opts,length){var mayEmptyProps=["reasonString","userProperties"];var maximumPacketSize=opts&&opts.properties&&opts.properties.maximumPacketSize?opts.properties.maximumPacketSize:0;var propertiesData=getProperties(stream,properties);if(maximumPacketSize){while(length+propertiesData.length>maximumPacketSize){var currentMayEmptyProp=mayEmptyProps.shift();if(currentMayEmptyProp&&properties[currentMayEmptyProp]){delete properties[currentMayEmptyProp];propertiesData=getProperties(stream,properties)}else{return false}}}return propertiesData}function writeProperty(stream,propName,value){var type=protocol.propertiesTypes[propName];switch(type){case"byte":{stream.write(Buffer.from([protocol.properties[propName]]));stream.write(Buffer.from([+value]));break}case"int8":{stream.write(Buffer.from([protocol.properties[propName]]));stream.write(Buffer.from([value]));break}case"binary":{stream.write(Buffer.from([protocol.properties[propName]]));writeStringOrBuffer(stream,value);break}case"int16":{stream.write(Buffer.from([protocol.properties[propName]]));writeNumber(stream,value);break}case"int32":{stream.write(Buffer.from([protocol.properties[propName]]));write4ByteNumber(stream,value);break}case"var":{stream.write(Buffer.from([protocol.properties[propName]]));writeVarByteInt(stream,value);break}case"string":{stream.write(Buffer.from([protocol.properties[propName]]));writeString(stream,value);break}case"pair":{Object.getOwnPropertyNames(value).forEach((function(name){var currentValue=value[name];if(Array.isArray(currentValue)){currentValue.forEach((function(value){stream.write(Buffer.from([protocol.properties[propName]]));writeStringPair(stream,name.toString(),value.toString())}))}else{stream.write(Buffer.from([protocol.properties[propName]]));writeStringPair(stream,name.toString(),currentValue.toString())}}));break}default:{stream.emit("error",new Error("Invalid property ".concat(propName," value: ").concat(value)));return false}}}function writeProperties(stream,properties,propertiesLength){writeVarByteInt(stream,propertiesLength);for(var propName in properties){if(Object.prototype.hasOwnProperty.call(properties,propName)&&properties[propName]!==null){var value=properties[propName];if(Array.isArray(value)){for(var valueIndex=0;valueIndex<value.length;valueIndex++){writeProperty(stream,propName,value[valueIndex])}}else{writeProperty(stream,propName,value)}}}}function byteLength(bufOrString){if(!bufOrString)return 0;else if(bufOrString instanceof Buffer)return bufOrString.length;else return Buffer.byteLength(bufOrString)}function isStringOrBuffer(field){return typeof field==="string"||field instanceof Buffer}module.exports=generate}).call(this)}).call(this,require("buffer").Buffer)},{"./constants":139,"./numbers":142,buffer:74,debug:77,"process-nextick-args":181}],146:[function(require,module,exports){(function(process,global){(function(){"use strict";function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach((function(r){_defineProperty(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var EventEmitter=require("events").EventEmitter;var Store=require("./store");var TopicAliasRecv=require("./topic-alias-recv");var TopicAliasSend=require("./topic-alias-send");var mqttPacket=require("mqtt-packet");var DefaultMessageIdProvider=require("./default-message-id-provider");var Writable=require("readable-stream").Writable;var inherits=require("inherits");var reInterval=require("reinterval");var clone=require("rfdc/default");var validations=require("./validations");var xtend=require("xtend");var debug=require("debug")("mqttjs:client");var nextTick=process?process.nextTick:function(callback){setTimeout(callback,0)};var setImmediate=global.setImmediate||function(callback){nextTick(callback)};var defaultConnectOptions={keepalive:60,reschedulePings:true,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:30*1e3,clean:true,resubscribe:true};var errors={0:"",1:"Unacceptable protocol version",2:"Identifier rejected",3:"Server unavailable",4:"Bad username or password",5:"Not authorized",16:"No matching subscribers",17:"No subscription existed",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",132:"Unsupported Protocol Version",133:"Client Identifier not valid",134:"Bad User Name or Password",135:"Not authorized",136:"Server unavailable",137:"Server busy",138:"Banned",139:"Server shutting down",140:"Bad authentication method",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",145:"Packet identifier in use",146:"Packet Identifier not found",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"};function defaultId(){return"mqttjs_"+Math.random().toString(16).substr(2,8)}function applyTopicAlias(client,packet){if(client.options.protocolVersion===5){if(packet.cmd==="publish"){var alias;if(packet.properties){alias=packet.properties.topicAlias}var topic=packet.topic.toString();if(client.topicAliasSend){if(alias){if(topic.length!==0){debug("applyTopicAlias :: register topic: %s - alias: %d",topic,alias);if(!client.topicAliasSend.put(topic,alias)){debug("applyTopicAlias :: error out of range. topic: %s - alias: %d",topic,alias);return new Error("Sending Topic Alias out of range")}}}else{if(topic.length!==0){if(client.options.autoAssignTopicAlias){alias=client.topicAliasSend.getAliasByTopic(topic);if(alias){packet.topic="";packet.properties=_objectSpread(_objectSpread({},packet.properties),{},{topicAlias:alias});debug("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",topic,alias)}else{alias=client.topicAliasSend.getLruAlias();client.topicAliasSend.put(topic,alias);packet.properties=_objectSpread(_objectSpread({},packet.properties),{},{topicAlias:alias});debug("applyTopicAlias :: auto assign topic: %s - alias: %d",topic,alias)}}else if(client.options.autoUseTopicAlias){alias=client.topicAliasSend.getAliasByTopic(topic);if(alias){packet.topic="";packet.properties=_objectSpread(_objectSpread({},packet.properties),{},{topicAlias:alias});debug("applyTopicAlias :: auto use topic: %s - alias: %d",topic,alias)}}}}}else if(alias){debug("applyTopicAlias :: error out of range. topic: %s - alias: %d",topic,alias);return new Error("Sending Topic Alias out of range")}}}}function removeTopicAliasAndRecoverTopicName(client,packet){var alias;if(packet.properties){alias=packet.properties.topicAlias}var topic=packet.topic.toString();if(topic.length===0){if(typeof alias==="undefined"){return new Error("Unregistered Topic Alias")}else{topic=client.topicAliasSend.getTopicByAlias(alias);if(typeof topic==="undefined"){return new Error("Unregistered Topic Alias")}else{packet.topic=topic}}}if(alias){delete packet.properties.topicAlias}}function sendPacket(client,packet,cb){debug("sendPacket :: packet: %O",packet);debug("sendPacket :: emitting `packetsend`");client.emit("packetsend",packet);debug("sendPacket :: writing to stream");var result=mqttPacket.writeToStream(packet,client.stream,client.options);debug("sendPacket :: writeToStream result %s",result);if(!result&&cb&&cb!==nop){debug("sendPacket :: handle events on `drain` once through callback.");client.stream.once("drain",cb)}else if(cb){debug("sendPacket :: invoking cb");cb()}}function flush(queue){if(queue){debug("flush: queue exists? %b",!!queue);Object.keys(queue).forEach((function(messageId){if(typeof queue[messageId].cb==="function"){queue[messageId].cb(new Error("Connection closed"));delete queue[messageId]}}))}}function flushVolatile(queue){if(queue){debug("flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function");Object.keys(queue).forEach((function(messageId){if(queue[messageId]["volatile"]&&typeof queue[messageId].cb==="function"){queue[messageId].cb(new Error("Connection closed"));delete queue[messageId]}}))}}function storeAndSend(client,packet,cb,cbStorePut){debug("storeAndSend :: store packet with cmd %s to outgoingStore",packet.cmd);var storePacket=packet;var err;if(storePacket.cmd==="publish"){storePacket=clone(packet);err=removeTopicAliasAndRecoverTopicName(client,storePacket);if(err){return cb&&cb(err)}}client.outgoingStore.put(storePacket,(function storedPacket(err){if(err){return cb&&cb(err)}cbStorePut();sendPacket(client,packet,cb)}))}function nop(error){debug("nop ::",error)}function MqttClient(streamBuilder,options){var k;var that=this;if(!(this instanceof MqttClient)){return new MqttClient(streamBuilder,options)}this.options=options||{};for(k in defaultConnectOptions){if(typeof this.options[k]==="undefined"){this.options[k]=defaultConnectOptions[k]}else{this.options[k]=options[k]}}debug("MqttClient :: options.protocol",options.protocol);debug("MqttClient :: options.protocolVersion",options.protocolVersion);debug("MqttClient :: options.username",options.username);debug("MqttClient :: options.keepalive",options.keepalive);debug("MqttClient :: options.reconnectPeriod",options.reconnectPeriod);debug("MqttClient :: options.rejectUnauthorized",options.rejectUnauthorized);debug("MqttClient :: options.topicAliasMaximum",options.topicAliasMaximum);this.options.clientId=typeof options.clientId==="string"?options.clientId:defaultId();debug("MqttClient :: clientId",this.options.clientId);this.options.customHandleAcks=options.protocolVersion===5&&options.customHandleAcks?options.customHandleAcks:function(){arguments[3](0)};this.streamBuilder=streamBuilder;this.messageIdProvider=typeof this.options.messageIdProvider==="undefined"?new DefaultMessageIdProvider:this.options.messageIdProvider;this.outgoingStore=options.outgoingStore||new Store;this.incomingStore=options.incomingStore||new Store;this.queueQoSZero=options.queueQoSZero===undefined?true:options.queueQoSZero;this._resubscribeTopics={};this.messageIdToTopic={};this.pingTimer=null;this.connected=false;this.disconnecting=false;this.queue=[];this.connackTimer=null;this.reconnectTimer=null;this._storeProcessing=false;this._packetIdsDuringStoreProcessing={};this._storeProcessingQueue=[];this.outgoing={};this._firstConnection=true;if(options.topicAliasMaximum>0){if(options.topicAliasMaximum>65535){debug("MqttClient :: options.topicAliasMaximum is out of range")}else{this.topicAliasRecv=new TopicAliasRecv(options.topicAliasMaximum)}}this.on("connect",(function(){var queue=this.queue;function deliver(){var entry=queue.shift();debug("deliver :: entry %o",entry);var packet=null;if(!entry){that._resubscribe();return}packet=entry.packet;debug("deliver :: call _sendPacket for %o",packet);var send=true;if(packet.messageId&&packet.messageId!==0){if(!that.messageIdProvider.register(packet.messageId)){send=false}}if(send){that._sendPacket(packet,(function(err){if(entry.cb){entry.cb(err)}deliver()}))}else{debug("messageId: %d has already used. The message is skipped and removed.",packet.messageId);deliver()}}debug("connect :: sending queued packets");deliver()}));this.on("close",(function(){debug("close :: connected set to `false`");this.connected=false;debug("close :: clearing connackTimer");clearTimeout(this.connackTimer);debug("close :: clearing ping timer");if(that.pingTimer!==null){that.pingTimer.clear();that.pingTimer=null}if(this.topicAliasRecv){this.topicAliasRecv.clear()}debug("close :: calling _setupReconnect");this._setupReconnect()}));EventEmitter.call(this);debug("MqttClient :: setting up stream");this._setupStream()}inherits(MqttClient,EventEmitter);MqttClient.prototype._setupStream=function(){var _this=this;var that=this;var writable=new Writable;var parser=mqttPacket.parser(this.options);var completeParse=null;var packets=[];debug("_setupStream :: calling method to clear reconnect");this._clearReconnect();debug("_setupStream :: using streamBuilder provided to client to create stream");this.stream=this.streamBuilder(this);parser.on("packet",(function(packet){debug("parser :: on packet push to packets array.");packets.push(packet)}));function nextTickWork(){if(packets.length){nextTick(work)}else{var done=completeParse;completeParse=null;done()}}function work(){debug("work :: getting next packet in queue");var packet=packets.shift();if(packet){debug("work :: packet pulled from queue");that._handlePacket(packet,nextTickWork)}else{debug("work :: no packets in queue");var done=completeParse;completeParse=null;debug("work :: done flag is %s",!!done);if(done)done()}}writable._write=function(buf,enc,done){completeParse=done;debug("writable stream :: parsing buffer");parser.parse(buf);work()};function streamErrorHandler(error){debug("streamErrorHandler :: error",error.message);if(error.code){debug("streamErrorHandler :: emitting error");that.emit("error",error)}else{nop(error)}}debug("_setupStream :: pipe stream to writable stream");this.stream.pipe(writable);this.stream.on("error",streamErrorHandler);this.stream.on("close",(function(){debug("(%s)stream :: on close",that.options.clientId);flushVolatile(that.outgoing);debug("stream: emit close to MqttClient");that.emit("close")}));debug("_setupStream: sending packet `connect`");var connectPacket=Object.create(this.options);connectPacket.cmd="connect";if(this.topicAliasRecv){if(!connectPacket.properties){connectPacket.properties={}}if(this.topicAliasRecv){connectPacket.properties.topicAliasMaximum=this.topicAliasRecv.max}}sendPacket(this,connectPacket);parser.on("error",this.emit.bind(this,"error"));if(this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData){that.end((function(){return _this.emit("error",new Error("Packet has no Authentication Method"))}));return this}if(this.options.properties.authenticationMethod&&this.options.authPacket&&_typeof(this.options.authPacket)==="object"){var authPacket=xtend({cmd:"auth",reasonCode:0},this.options.authPacket);sendPacket(this,authPacket)}}this.stream.setMaxListeners(1e3);clearTimeout(this.connackTimer);this.connackTimer=setTimeout((function(){debug("!!connectTimeout hit!! Calling _cleanUp with force `true`");that._cleanUp(true)}),this.options.connectTimeout)};MqttClient.prototype._handlePacket=function(packet,done){var options=this.options;if(options.protocolVersion===5&&options.properties&&options.properties.maximumPacketSize&&options.properties.maximumPacketSize<packet.length){this.emit("error",new Error("exceeding packets size "+packet.cmd));this.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}});return this}debug("_handlePacket :: emitting packetreceive");this.emit("packetreceive",packet);switch(packet.cmd){case"publish":this._handlePublish(packet,done);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":this._handleAck(packet);done();break;case"pubrel":this._handlePubrel(packet,done);break;case"connack":this._handleConnack(packet);done();break;case"auth":this._handleAuth(packet);done();break;case"pingresp":this._handlePingresp(packet);done();break;case"disconnect":this._handleDisconnect(packet);done();break;default:break}};MqttClient.prototype._checkDisconnecting=function(callback){if(this.disconnecting){if(callback&&callback!==nop){callback(new Error("client disconnecting"))}else{this.emit("error",new Error("client disconnecting"))}}return this.disconnecting};MqttClient.prototype.publish=function(topic,message,opts,callback){debug("publish :: message `%s` to topic `%s`",message,topic);var options=this.options;if(typeof opts==="function"){callback=opts;opts=null}var defaultOpts={qos:0,retain:false,dup:false};opts=xtend(defaultOpts,opts);if(this._checkDisconnecting(callback)){return this}var that=this;var publishProc=function publishProc(){var messageId=0;if(opts.qos===1||opts.qos===2){messageId=that._nextId();if(messageId===null){debug("No messageId left");return false}}var packet={cmd:"publish",topic:topic,payload:message,qos:opts.qos,retain:opts.retain,messageId:messageId,dup:opts.dup};if(options.protocolVersion===5){packet.properties=opts.properties}debug("publish :: qos",opts.qos);switch(opts.qos){case 1:case 2:that.outgoing[packet.messageId]={volatile:false,cb:callback||nop};debug("MqttClient:publish: packet cmd: %s",packet.cmd);that._sendPacket(packet,undefined,opts.cbStorePut);break;default:debug("MqttClient:publish: packet cmd: %s",packet.cmd);that._sendPacket(packet,callback,opts.cbStorePut);break}return true};if(this._storeProcessing||this._storeProcessingQueue.length>0||!publishProc()){this._storeProcessingQueue.push({invoke:publishProc,cbStorePut:opts.cbStorePut,callback:callback})}return this};MqttClient.prototype.subscribe=function(){var that=this;var args=new Array(arguments.length);for(var i=0;i<arguments.length;i++){args[i]=arguments[i]}var subs=[];var obj=args.shift();var resubscribe=obj.resubscribe;var callback=args.pop()||nop;var opts=args.pop();var version=this.options.protocolVersion;delete obj.resubscribe;if(typeof obj==="string"){obj=[obj]}if(typeof callback!=="function"){opts=callback;callback=nop}var invalidTopic=validations.validateTopics(obj);if(invalidTopic!==null){setImmediate(callback,new Error("Invalid topic "+invalidTopic));return this}if(this._checkDisconnecting(callback)){debug("subscribe: discconecting true");return this}var defaultOpts={qos:0};if(version===5){defaultOpts.nl=false;defaultOpts.rap=false;defaultOpts.rh=0}opts=xtend(defaultOpts,opts);if(Array.isArray(obj)){obj.forEach((function(topic){debug("subscribe: array topic %s",topic);if(!Object.prototype.hasOwnProperty.call(that._resubscribeTopics,topic)||that._resubscribeTopics[topic].qos<opts.qos||resubscribe){var currentOpts={topic:topic,qos:opts.qos};if(version===5){currentOpts.nl=opts.nl;currentOpts.rap=opts.rap;currentOpts.rh=opts.rh;currentOpts.properties=opts.properties}debug("subscribe: pushing topic `%s` and qos `%s` to subs list",currentOpts.topic,currentOpts.qos);subs.push(currentOpts)}}))}else{Object.keys(obj).forEach((function(k){debug("subscribe: object topic %s",k);if(!Object.prototype.hasOwnProperty.call(that._resubscribeTopics,k)||that._resubscribeTopics[k].qos<obj[k].qos||resubscribe){var currentOpts={topic:k,qos:obj[k].qos};if(version===5){currentOpts.nl=obj[k].nl;currentOpts.rap=obj[k].rap;currentOpts.rh=obj[k].rh;currentOpts.properties=opts.properties}debug("subscribe: pushing `%s` to subs list",currentOpts);subs.push(currentOpts)}}))}if(!subs.length){callback(null,[]);return this}var subscribeProc=function subscribeProc(){var messageId=that._nextId();if(messageId===null){debug("No messageId left");return false}var packet={cmd:"subscribe",subscriptions:subs,qos:1,retain:false,dup:false,messageId:messageId};if(opts.properties){packet.properties=opts.properties}if(that.options.resubscribe){debug("subscribe :: resubscribe true");var topics=[];subs.forEach((function(sub){if(that.options.reconnectPeriod>0){var topic={qos:sub.qos};if(version===5){topic.nl=sub.nl||false;topic.rap=sub.rap||false;topic.rh=sub.rh||0;topic.properties=sub.properties}that._resubscribeTopics[sub.topic]=topic;topics.push(sub.topic)}}));that.messageIdToTopic[packet.messageId]=topics}that.outgoing[packet.messageId]={volatile:true,cb:function cb(err,packet){if(!err){var granted=packet.granted;for(var _i=0;_i<granted.length;_i+=1){subs[_i].qos=granted[_i]}}callback(err,subs)}};debug("subscribe :: call _sendPacket");that._sendPacket(packet);return true};if(this._storeProcessing||this._storeProcessingQueue.length>0||!subscribeProc()){this._storeProcessingQueue.push({invoke:subscribeProc,callback:callback})}return this};MqttClient.prototype.unsubscribe=function(){var that=this;var args=new Array(arguments.length);for(var i=0;i<arguments.length;i++){args[i]=arguments[i]}var topic=args.shift();var callback=args.pop()||nop;var opts=args.pop();if(typeof topic==="string"){topic=[topic]}if(typeof callback!=="function"){opts=callback;callback=nop}var invalidTopic=validations.validateTopics(topic);if(invalidTopic!==null){setImmediate(callback,new Error("Invalid topic "+invalidTopic));return this}if(that._checkDisconnecting(callback)){return this}var unsubscribeProc=function unsubscribeProc(){var messageId=that._nextId();if(messageId===null){debug("No messageId left");return false}var packet={cmd:"unsubscribe",qos:1,messageId:messageId};if(typeof topic==="string"){packet.unsubscriptions=[topic]}else if(Array.isArray(topic)){packet.unsubscriptions=topic}if(that.options.resubscribe){packet.unsubscriptions.forEach((function(topic){delete that._resubscribeTopics[topic]}))}if(_typeof(opts)==="object"&&opts.properties){packet.properties=opts.properties}that.outgoing[packet.messageId]={volatile:true,cb:callback};debug("unsubscribe: call _sendPacket");that._sendPacket(packet);return true};if(this._storeProcessing||this._storeProcessingQueue.length>0||!unsubscribeProc()){this._storeProcessingQueue.push({invoke:unsubscribeProc,callback:callback})}return this};MqttClient.prototype.end=function(force,opts,cb){var that=this;debug("end :: (%s)",this.options.clientId);if(force==null||typeof force!=="boolean"){cb=opts||nop;opts=force;force=false;if(_typeof(opts)!=="object"){cb=opts;opts=null;if(typeof cb!=="function"){cb=nop}}}if(_typeof(opts)!=="object"){cb=opts;opts=null}debug("end :: cb? %s",!!cb);cb=cb||nop;function closeStores(){debug("end :: closeStores: closing incoming and outgoing stores");that.disconnected=true;that.incomingStore.close((function(e1){that.outgoingStore.close((function(e2){debug("end :: closeStores: emitting end");that.emit("end");if(cb){var err=e1||e2;debug("end :: closeStores: invoking callback with args");cb(err)}}))}));if(that._deferredReconnect){that._deferredReconnect()}}function finish(){debug("end :: (%s) :: finish :: calling _cleanUp with force %s",that.options.clientId,force);that._cleanUp(force,(function(){debug("end :: finish :: calling process.nextTick on closeStores");nextTick(closeStores.bind(that))}),opts)}if(this.disconnecting){cb();return this}this._clearReconnect();this.disconnecting=true;if(!force&&Object.keys(this.outgoing).length>0){debug("end :: (%s) :: calling finish in 10ms once outgoing is empty",that.options.clientId);this.once("outgoingEmpty",setTimeout.bind(null,finish,10))}else{debug("end :: (%s) :: immediately calling finish",that.options.clientId);finish()}return this};MqttClient.prototype.removeOutgoingMessage=function(messageId){var cb=this.outgoing[messageId]?this.outgoing[messageId].cb:null;delete this.outgoing[messageId];this.outgoingStore.del({messageId:messageId},(function(){cb(new Error("Message removed"))}));return this};MqttClient.prototype.reconnect=function(opts){debug("client reconnect");var that=this;var f=function f(){if(opts){that.options.incomingStore=opts.incomingStore;that.options.outgoingStore=opts.outgoingStore}else{that.options.incomingStore=null;that.options.outgoingStore=null}that.incomingStore=that.options.incomingStore||new Store;that.outgoingStore=that.options.outgoingStore||new Store;that.disconnecting=false;that.disconnected=false;that._deferredReconnect=null;that._reconnect()};if(this.disconnecting&&!this.disconnected){this._deferredReconnect=f}else{f()}return this};MqttClient.prototype._reconnect=function(){var _this2=this;debug("_reconnect: emitting reconnect to client");this.emit("reconnect");if(this.connected){this.end((function(){_this2._setupStream()}));debug("client already connected. disconnecting first.")}else{debug("_reconnect: calling _setupStream");this._setupStream()}};MqttClient.prototype._setupReconnect=function(){var that=this;if(!that.disconnecting&&!that.reconnectTimer&&that.options.reconnectPeriod>0){if(!this.reconnecting){debug("_setupReconnect :: emit `offline` state");this.emit("offline");debug("_setupReconnect :: set `reconnecting` to `true`");this.reconnecting=true}debug("_setupReconnect :: setting reconnectTimer for %d ms",that.options.reconnectPeriod);that.reconnectTimer=setInterval((function(){debug("reconnectTimer :: reconnect triggered!");that._reconnect()}),that.options.reconnectPeriod)}else{debug("_setupReconnect :: doing nothing...")}};MqttClient.prototype._clearReconnect=function(){debug("_clearReconnect : clearing reconnect timer");if(this.reconnectTimer){clearInterval(this.reconnectTimer);this.reconnectTimer=null}};MqttClient.prototype._cleanUp=function(forced,done){var opts=arguments[2];if(done){debug("_cleanUp :: done callback provided for on stream close");this.stream.on("close",done)}debug("_cleanUp :: forced? %s",forced);if(forced){if(this.options.reconnectPeriod===0&&this.options.clean){flush(this.outgoing)}debug("_cleanUp :: (%s) :: destroying stream",this.options.clientId);this.stream.destroy()}else{var packet=xtend({cmd:"disconnect"},opts);debug("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId);this._sendPacket(packet,setImmediate.bind(null,this.stream.end.bind(this.stream)))}if(!this.disconnecting){debug("_cleanUp :: client not disconnecting. Clearing and resetting reconnect.");this._clearReconnect();this._setupReconnect()}if(this.pingTimer!==null){debug("_cleanUp :: clearing pingTimer");this.pingTimer.clear();this.pingTimer=null}if(done&&!this.connected){debug("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId);this.stream.removeListener("close",done);done()}};MqttClient.prototype._sendPacket=function(packet,cb,cbStorePut){debug("_sendPacket :: (%s) :: start",this.options.clientId);cbStorePut=cbStorePut||nop;cb=cb||nop;var err=applyTopicAlias(this,packet);if(err){cb(err);return}if(!this.connected){if(packet.cmd==="auth"){this._shiftPingInterval();sendPacket(this,packet,cb);return}debug("_sendPacket :: client not connected. Storing packet offline.");this._storePacket(packet,cb,cbStorePut);return}this._shiftPingInterval();switch(packet.cmd){case"publish":break;case"pubrel":storeAndSend(this,packet,cb,cbStorePut);return;default:sendPacket(this,packet,cb);return}switch(packet.qos){case 2:case 1:storeAndSend(this,packet,cb,cbStorePut);break;case 0:default:sendPacket(this,packet,cb);break}debug("_sendPacket :: (%s) :: end",this.options.clientId)};MqttClient.prototype._storePacket=function(packet,cb,cbStorePut){debug("_storePacket :: packet: %o",packet);debug("_storePacket :: cb? %s",!!cb);cbStorePut=cbStorePut||nop;var storePacket=packet;if(storePacket.cmd==="publish"){storePacket=clone(packet);var err=removeTopicAliasAndRecoverTopicName(this,storePacket);if(err){return cb&&cb(err)}}if((storePacket.qos||0)===0&&this.queueQoSZero||storePacket.cmd!=="publish"){this.queue.push({packet:storePacket,cb:cb})}else if(storePacket.qos>0){cb=this.outgoing[storePacket.messageId]?this.outgoing[storePacket.messageId].cb:null;this.outgoingStore.put(storePacket,(function(err){if(err){return cb&&cb(err)}cbStorePut()}))}else if(cb){cb(new Error("No connection to broker"))}};MqttClient.prototype._setupPingTimer=function(){debug("_setupPingTimer :: keepalive %d (seconds)",this.options.keepalive);var that=this;if(!this.pingTimer&&this.options.keepalive){this.pingResp=true;this.pingTimer=reInterval((function(){that._checkPing()}),this.options.keepalive*1e3)}};MqttClient.prototype._shiftPingInterval=function(){if(this.pingTimer&&this.options.keepalive&&this.options.reschedulePings){this.pingTimer.reschedule(this.options.keepalive*1e3)}};MqttClient.prototype._checkPing=function(){debug("_checkPing :: checking ping...");if(this.pingResp){debug("_checkPing :: ping response received. Clearing flag and sending `pingreq`");this.pingResp=false;this._sendPacket({cmd:"pingreq"})}else{debug("_checkPing :: calling _cleanUp with force true");this._cleanUp(true)}};MqttClient.prototype._handlePingresp=function(){this.pingResp=true};MqttClient.prototype._handleConnack=function(packet){debug("_handleConnack");var options=this.options;var version=options.protocolVersion;var rc=version===5?packet.reasonCode:packet.returnCode;clearTimeout(this.connackTimer);delete this.topicAliasSend;if(packet.properties){if(packet.properties.topicAliasMaximum){if(packet.properties.topicAliasMaximum>65535){this.emit("error",new Error("topicAliasMaximum from broker is out of range"));return}if(packet.properties.topicAliasMaximum>0){this.topicAliasSend=new TopicAliasSend(packet.properties.topicAliasMaximum)}}if(packet.properties.serverKeepAlive&&options.keepalive){options.keepalive=packet.properties.serverKeepAlive;this._shiftPingInterval()}if(packet.properties.maximumPacketSize){if(!options.properties){options.properties={}}options.properties.maximumPacketSize=packet.properties.maximumPacketSize}}if(rc===0){this.reconnecting=false;this._onConnect(packet)}else if(rc>0){var err=new Error("Connection refused: "+errors[rc]);err.code=rc;this.emit("error",err)}};MqttClient.prototype._handleAuth=function(packet){var options=this.options;var version=options.protocolVersion;var rc=version===5?packet.reasonCode:packet.returnCode;if(version!==5){var err=new Error("Protocol error: Auth packets are only supported in MQTT 5. Your version:"+version);err.code=rc;this.emit("error",err);return}var that=this;this.handleAuth(packet,(function(err,packet){if(err){that.emit("error",err);return}if(rc===24){that.reconnecting=false;that._sendPacket(packet)}else{var error=new Error("Connection refused: "+errors[rc]);err.code=rc;that.emit("error",error)}}))};MqttClient.prototype.handleAuth=function(packet,callback){callback()};MqttClient.prototype._handlePublish=function(packet,done){debug("_handlePublish: packet %o",packet);done=typeof done!=="undefined"?done:nop;var topic=packet.topic.toString();var message=packet.payload;var qos=packet.qos;var messageId=packet.messageId;var that=this;var options=this.options;var validReasonCodes=[0,16,128,131,135,144,145,151,153];if(this.options.protocolVersion===5){var alias;if(packet.properties){alias=packet.properties.topicAlias}if(typeof alias!=="undefined"){if(topic.length===0){if(alias>0&&alias<=65535){var gotTopic=this.topicAliasRecv.getTopicByAlias(alias);if(gotTopic){topic=gotTopic;debug("_handlePublish :: topic complemented by alias. topic: %s - alias: %d",topic,alias)}else{debug("_handlePublish :: unregistered topic alias. alias: %d",alias);this.emit("error",new Error("Received unregistered Topic Alias"));return}}else{debug("_handlePublish :: topic alias out of range. alias: %d",alias);this.emit("error",new Error("Received Topic Alias is out of range"));return}}else{if(this.topicAliasRecv.put(topic,alias)){debug("_handlePublish :: registered topic: %s - alias: %d",topic,alias)}else{debug("_handlePublish :: topic alias out of range. alias: %d",alias);this.emit("error",new Error("Received Topic Alias is out of range"));return}}}}debug("_handlePublish: qos %d",qos);switch(qos){case 2:{options.customHandleAcks(topic,message,packet,(function(error,code){if(!(error instanceof Error)){code=error;error=null}if(error){return that.emit("error",error)}if(validReasonCodes.indexOf(code)===-1){return that.emit("error",new Error("Wrong reason code for pubrec"))}if(code){that._sendPacket({cmd:"pubrec",messageId:messageId,reasonCode:code},done)}else{that.incomingStore.put(packet,(function(){that._sendPacket({cmd:"pubrec",messageId:messageId},done)}))}}));break}case 1:{options.customHandleAcks(topic,message,packet,(function(error,code){if(!(error instanceof Error)){code=error;error=null}if(error){return that.emit("error",error)}if(validReasonCodes.indexOf(code)===-1){return that.emit("error",new Error("Wrong reason code for puback"))}if(!code){that.emit("message",topic,message,packet)}that.handleMessage(packet,(function(err){if(err){return done&&done(err)}that._sendPacket({cmd:"puback",messageId:messageId,reasonCode:code},done)}))}));break}case 0:this.emit("message",topic,message,packet);this.handleMessage(packet,done);break;default:debug("_handlePublish: unknown QoS. Doing nothing.");break}};MqttClient.prototype.handleMessage=function(packet,callback){callback()};MqttClient.prototype._handleAck=function(packet){var messageId=packet.messageId;var type=packet.cmd;var response=null;var cb=this.outgoing[messageId]?this.outgoing[messageId].cb:null;var that=this;var err;if(!cb){debug("_handleAck :: Server sent an ack in error. Ignoring.");return}debug("_handleAck :: packet type",type);switch(type){case"pubcomp":case"puback":{var pubackRC=packet.reasonCode;if(pubackRC&&pubackRC>0&&pubackRC!==16){err=new Error("Publish error: "+errors[pubackRC]);err.code=pubackRC;cb(err,packet)}delete this.outgoing[messageId];this.outgoingStore.del(packet,cb);this.messageIdProvider.deallocate(messageId);this._invokeStoreProcessingQueue();break}case"pubrec":{response={cmd:"pubrel",qos:2,messageId:messageId};var pubrecRC=packet.reasonCode;if(pubrecRC&&pubrecRC>0&&pubrecRC!==16){err=new Error("Publish error: "+errors[pubrecRC]);err.code=pubrecRC;cb(err,packet)}else{this._sendPacket(response)}break}case"suback":{delete this.outgoing[messageId];this.messageIdProvider.deallocate(messageId);for(var grantedI=0;grantedI<packet.granted.length;grantedI++){if((packet.granted[grantedI]&128)!==0){var topics=this.messageIdToTopic[messageId];if(topics){topics.forEach((function(topic){delete that._resubscribeTopics[topic]}))}}}this._invokeStoreProcessingQueue();cb(null,packet);break}case"unsuback":{delete this.outgoing[messageId];this.messageIdProvider.deallocate(messageId);this._invokeStoreProcessingQueue();cb(null);break}default:that.emit("error",new Error("unrecognized packet type"))}if(this.disconnecting&&Object.keys(this.outgoing).length===0){this.emit("outgoingEmpty")}};MqttClient.prototype._handlePubrel=function(packet,callback){debug("handling pubrel packet");callback=typeof callback!=="undefined"?callback:nop;var messageId=packet.messageId;var that=this;var comp={cmd:"pubcomp",messageId:messageId};that.incomingStore.get(packet,(function(err,pub){if(!err){that.emit("message",pub.topic,pub.payload,pub);that.handleMessage(pub,(function(err){if(err){return callback(err)}that.incomingStore.del(pub,nop);that._sendPacket(comp,callback)}))}else{that._sendPacket(comp,callback)}}))};MqttClient.prototype._handleDisconnect=function(packet){this.emit("disconnect",packet)};MqttClient.prototype._nextId=function(){return this.messageIdProvider.allocate()};MqttClient.prototype.getLastMessageId=function(){return this.messageIdProvider.getLastAllocated()};MqttClient.prototype._resubscribe=function(){debug("_resubscribe");var _resubscribeTopicsKeys=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||this.options.protocolVersion===5&&!this.connackPacket.sessionPresent)&&_resubscribeTopicsKeys.length>0){if(this.options.resubscribe){if(this.options.protocolVersion===5){debug("_resubscribe: protocolVersion 5");for(var topicI=0;topicI<_resubscribeTopicsKeys.length;topicI++){var resubscribeTopic={};resubscribeTopic[_resubscribeTopicsKeys[topicI]]=this._resubscribeTopics[_resubscribeTopicsKeys[topicI]];resubscribeTopic.resubscribe=true;this.subscribe(resubscribeTopic,{properties:resubscribeTopic[_resubscribeTopicsKeys[topicI]].properties})}}else{this._resubscribeTopics.resubscribe=true;this.subscribe(this._resubscribeTopics)}}else{this._resubscribeTopics={}}}this._firstConnection=false};MqttClient.prototype._onConnect=function(packet){if(this.disconnected){this.emit("connect",packet);return}var that=this;this.connackPacket=packet;this.messageIdProvider.clear();this._setupPingTimer();this.connected=true;function startStreamProcess(){var outStore=that.outgoingStore.createStream();function clearStoreProcessing(){that._storeProcessing=false;that._packetIdsDuringStoreProcessing={}}that.once("close",remove);outStore.on("error",(function(err){clearStoreProcessing();that._flushStoreProcessingQueue();that.removeListener("close",remove);that.emit("error",err)}));function remove(){outStore.destroy();outStore=null;that._flushStoreProcessingQueue();clearStoreProcessing()}function storeDeliver(){if(!outStore){return}that._storeProcessing=true;var packet=outStore.read(1);var _cb;if(!packet){outStore.once("readable",storeDeliver);return}if(that._packetIdsDuringStoreProcessing[packet.messageId]){storeDeliver();return}if(!that.disconnecting&&!that.reconnectTimer){_cb=that.outgoing[packet.messageId]?that.outgoing[packet.messageId].cb:null;that.outgoing[packet.messageId]={volatile:false,cb:function cb(err,status){if(_cb){_cb(err,status)}storeDeliver()}};that._packetIdsDuringStoreProcessing[packet.messageId]=true;if(that.messageIdProvider.register(packet.messageId)){that._sendPacket(packet)}else{debug("messageId: %d has already used.",packet.messageId)}}else if(outStore.destroy){outStore.destroy()}}outStore.on("end",(function(){var allProcessed=true;for(var id in that._packetIdsDuringStoreProcessing){if(!that._packetIdsDuringStoreProcessing[id]){allProcessed=false;break}}if(allProcessed){clearStoreProcessing();that.removeListener("close",remove);that._invokeAllStoreProcessingQueue();that.emit("connect",packet)}else{startStreamProcess()}}));storeDeliver()}startStreamProcess()};MqttClient.prototype._invokeStoreProcessingQueue=function(){if(this._storeProcessingQueue.length>0){var f=this._storeProcessingQueue[0];if(f&&f.invoke()){this._storeProcessingQueue.shift();return true}}return false};MqttClient.prototype._invokeAllStoreProcessingQueue=function(){while(this._invokeStoreProcessingQueue()){}};MqttClient.prototype._flushStoreProcessingQueue=function(){var _iterator=_createForOfIteratorHelper(this._storeProcessingQueue),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var f=_step.value;if(f.cbStorePut)f.cbStorePut(new Error("Connection closed"));if(f.callback)f.callback(new Error("Connection closed"))}}catch(err){_iterator.e(err)}finally{_iterator.f()}this._storeProcessingQueue.splice(0)};module.exports=MqttClient}).call(this)}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./default-message-id-provider":153,"./store":154,"./topic-alias-recv":155,"./topic-alias-send":156,"./validations":157,_process:182,debug:77,events:97,inherits:111,"mqtt-packet":141,"readable-stream":173,reinterval:184,"rfdc/default":185,xtend:223}],147:[function(require,module,exports){"use strict";var _require=require("buffer"),Buffer=_require.Buffer;var Transform=require("readable-stream").Transform;var duplexify=require("duplexify");var my;var proxy;var stream;var isInitialized=false;function buildProxy(){var proxy=new Transform;proxy._write=function(chunk,encoding,next){my.sendSocketMessage({data:chunk.buffer,success:function success(){next()},fail:function fail(){next(new Error)}})};proxy._flush=function socketEnd(done){my.closeSocket({success:function success(){done()}})};return proxy}function setDefaultOpts(opts){if(!opts.hostname){opts.hostname="localhost"}if(!opts.path){opts.path="/"}if(!opts.wsOptions){opts.wsOptions={}}}function buildUrl(opts,client){var protocol=opts.protocol==="alis"?"wss":"ws";var url=protocol+"://"+opts.hostname+opts.path;if(opts.port&&opts.port!==80&&opts.port!==443){url=protocol+"://"+opts.hostname+":"+opts.port+opts.path}if(typeof opts.transformWsUrl==="function"){url=opts.transformWsUrl(url,opts,client)}return url}function bindEventHandler(){if(isInitialized)return;isInitialized=true;my.onSocketOpen((function(){stream.setReadable(proxy);stream.setWritable(proxy);stream.emit("connect")}));my.onSocketMessage((function(res){if(typeof res.data==="string"){var buffer=Buffer.from(res.data,"base64");proxy.push(buffer)}else{var reader=new FileReader;reader.addEventListener("load",(function(){var data=reader.result;if(data instanceof ArrayBuffer)data=Buffer.from(data);else data=Buffer.from(data,"utf8");proxy.push(data)}));reader.readAsArrayBuffer(res.data)}}));my.onSocketClose((function(){stream.end();stream.destroy()}));my.onSocketError((function(res){stream.destroy(res)}))}function buildStream(client,opts){opts.hostname=opts.hostname||opts.host;if(!opts.hostname){throw new Error("Could not determine host. Specify host manually.")}var websocketSubProtocol=opts.protocolId==="MQIsdp"&&opts.protocolVersion===3?"mqttv3.1":"mqtt";setDefaultOpts(opts);var url=buildUrl(opts,client);my=opts.my;my.connectSocket({url:url,protocols:websocketSubProtocol});proxy=buildProxy();stream=duplexify.obj();bindEventHandler();return stream}module.exports=buildStream},{buffer:74,duplexify:80,"readable-stream":173}],148:[function(require,module,exports){(function(process){(function(){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}var MqttClient=require("../client");var Store=require("../store");var url=require("url");var xtend=require("xtend");var debug=require("debug")("mqttjs");var protocols={};if(typeof process!=="undefined"&&process.title!=="browser"||typeof __webpack_require__!=="function"){protocols.mqtt=require("./tcp");protocols.tcp=require("./tcp");protocols.ssl=require("./tls");protocols.tls=require("./tls");protocols.mqtts=require("./tls")}else{protocols.wx=require("./wx");protocols.wxs=require("./wx");protocols.ali=require("./ali");protocols.alis=require("./ali")}protocols.ws=require("./ws");protocols.wss=require("./ws");function parseAuthOptions(opts){var matches;if(opts.auth){matches=opts.auth.match(/^(.+):(.+)$/);if(matches){opts.username=matches[1];opts.password=matches[2]}else{opts.username=opts.auth}}}function connect(brokerUrl,opts){debug("connecting to an MQTT broker...");if(_typeof(brokerUrl)==="object"&&!opts){opts=brokerUrl;brokerUrl=null}opts=opts||{};if(brokerUrl){var parsed=url.parse(brokerUrl,true);if(parsed.port!=null){parsed.port=Number(parsed.port)}opts=xtend(parsed,opts);if(opts.protocol===null){throw new Error("Missing protocol")}opts.protocol=opts.protocol.replace(/:$/,"")}parseAuthOptions(opts);if(opts.query&&typeof opts.query.clientId==="string"){opts.clientId=opts.query.clientId}if(opts.cert&&opts.key){if(opts.protocol){if(["mqtts","wss","wxs","alis"].indexOf(opts.protocol)===-1){switch(opts.protocol){case"mqtt":opts.protocol="mqtts";break;case"ws":opts.protocol="wss";break;case"wx":opts.protocol="wxs";break;case"ali":opts.protocol="alis";break;default:throw new Error('Unknown protocol for secure connection: "'+opts.protocol+'"!')}}}else{throw new Error("Missing secure protocol key")}}if(!protocols[opts.protocol]){var isSecure=["mqtts","wss"].indexOf(opts.protocol)!==-1;opts.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter((function(key,index){if(isSecure&&index%2===0){return false}return typeof protocols[key]==="function"}))[0]}if(opts.clean===false&&!opts.clientId){throw new Error("Missing clientId for unclean clients")}if(opts.protocol){opts.defaultProtocol=opts.protocol}function wrapper(client){if(opts.servers){if(!client._reconnectCount||client._reconnectCount===opts.servers.length){client._reconnectCount=0}opts.host=opts.servers[client._reconnectCount].host;opts.port=opts.servers[client._reconnectCount].port;opts.protocol=!opts.servers[client._reconnectCount].protocol?opts.defaultProtocol:opts.servers[client._reconnectCount].protocol;opts.hostname=opts.host;client._reconnectCount++}debug("calling streambuilder for",opts.protocol);return protocols[opts.protocol](client,opts)}var client=new MqttClient(wrapper,opts);client.on("error",(function(){}));return client}module.exports=connect;module.exports.connect=connect;module.exports.MqttClient=MqttClient;module.exports.Store=Store}).call(this)}).call(this,require("_process"))},{"../client":146,"../store":154,"./ali":147,"./tcp":149,"./tls":150,"./ws":151,"./wx":152,_process:182,debug:77,url:199,xtend:223}],149:[function(require,module,exports){"use strict";var net=require("net");var debug=require("debug")("mqttjs:tcp");function streamBuilder(client,opts){opts.port=opts.port||1883;opts.hostname=opts.hostname||opts.host||"localhost";var port=opts.port;var host=opts.hostname;debug("port %d and host %s",port,host);return net.createConnection(port,host)}module.exports=streamBuilder},{debug:77,net:71}],150:[function(require,module,exports){"use strict";var tls=require("tls");var net=require("net");var debug=require("debug")("mqttjs:tls");function buildBuilder(mqttClient,opts){opts.port=opts.port||8883;opts.host=opts.hostname||opts.host||"localhost";if(net.isIP(opts.host)===0){opts.servername=opts.host}opts.rejectUnauthorized=opts.rejectUnauthorized!==false;delete opts.path;debug("port %d host %s rejectUnauthorized %b",opts.port,opts.host,opts.rejectUnauthorized);var connection=tls.connect(opts);connection.on("secureConnect",(function(){if(opts.rejectUnauthorized&&!connection.authorized){connection.emit("error",new Error("TLS not authorized"))}else{connection.removeListener("error",handleTLSerrors)}}));function handleTLSerrors(err){if(opts.rejectUnauthorized){mqttClient.emit("error",err)}connection.end()}connection.on("error",handleTLSerrors);return connection}module.exports=buildBuilder},{debug:77,net:71,tls:71}],151:[function(require,module,exports){(function(process){(function(){"use strict";var _require=require("buffer"),Buffer=_require.Buffer;var WS=require("ws");var debug=require("debug")("mqttjs:ws");var duplexify=require("duplexify");var Transform=require("readable-stream").Transform;var WSS_OPTIONS=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];var IS_BROWSER=typeof process!=="undefined"&&process.title==="browser"||typeof __webpack_require__==="function";function buildUrl(opts,client){var url=opts.protocol+"://"+opts.hostname+":"+opts.port+opts.path;if(typeof opts.transformWsUrl==="function"){url=opts.transformWsUrl(url,opts,client)}return url}function setDefaultOpts(opts){var options=opts;if(!opts.hostname){options.hostname="localhost"}if(!opts.port){if(opts.protocol==="wss"){options.port=443}else{options.port=80}}if(!opts.path){options.path="/"}if(!opts.wsOptions){options.wsOptions={}}if(!IS_BROWSER&&opts.protocol==="wss"){WSS_OPTIONS.forEach((function(prop){if(Object.prototype.hasOwnProperty.call(opts,prop)&&!Object.prototype.hasOwnProperty.call(opts.wsOptions,prop)){options.wsOptions[prop]=opts[prop]}}))}return options}function setDefaultBrowserOpts(opts){var options=setDefaultOpts(opts);if(!options.hostname){options.hostname=options.host}if(!options.hostname){if(typeof document==="undefined"){throw new Error("Could not determine host. Specify host manually.")}var parsed=new URL(document.URL);options.hostname=parsed.hostname;if(!options.port){options.port=parsed.port}}if(options.objectMode===undefined){options.objectMode=!(options.binary===true||options.binary===undefined)}return options}function createWebSocket(client,url,opts){debug("createWebSocket");debug("protocol: "+opts.protocolId+" "+opts.protocolVersion);var websocketSubProtocol=opts.protocolId==="MQIsdp"&&opts.protocolVersion===3?"mqttv3.1":"mqtt";debug("creating new Websocket for url: "+url+" and protocol: "+websocketSubProtocol);var socket=new WS(url,[websocketSubProtocol],opts.wsOptions);return socket}function createBrowserWebSocket(client,opts){var websocketSubProtocol=opts.protocolId==="MQIsdp"&&opts.protocolVersion===3?"mqttv3.1":"mqtt";var url=buildUrl(opts,client);var socket=new WebSocket(url,[websocketSubProtocol]);socket.binaryType="arraybuffer";return socket}function streamBuilder(client,opts){debug("streamBuilder");var options=setDefaultOpts(opts);var url=buildUrl(options,client);var socket=createWebSocket(client,url,options);var webSocketStream=WS.createWebSocketStream(socket,options.wsOptions);webSocketStream.url=url;socket.on("close",(function(){webSocketStream.destroy()}));return webSocketStream}function browserStreamBuilder(client,opts){debug("browserStreamBuilder");var stream;var options=setDefaultBrowserOpts(opts);var bufferSize=options.browserBufferSize||1024*512;var bufferTimeout=opts.browserBufferTimeout||1e3;var coerceToBuffer=!opts.objectMode;var socket=createBrowserWebSocket(client,opts);var proxy=buildProxy(opts,socketWriteBrowser,socketEndBrowser);if(!opts.objectMode){proxy._writev=writev}proxy.on("close",(function(){socket.close()}));var eventListenerSupport=typeof socket.addEventListener!=="undefined";if(socket.readyState===socket.OPEN){stream=proxy}else{stream=stream=duplexify(undefined,undefined,opts);if(!opts.objectMode){stream._writev=writev}if(eventListenerSupport){socket.addEventListener("open",onopen)}else{socket.onopen=onopen}}stream.socket=socket;if(eventListenerSupport){socket.addEventListener("close",onclose);socket.addEventListener("error",onerror);socket.addEventListener("message",onmessage)}else{socket.onclose=onclose;socket.onerror=onerror;socket.onmessage=onmessage}function buildProxy(options,socketWrite,socketEnd){var proxy=new Transform({objectModeMode:options.objectMode});proxy._write=socketWrite;proxy._flush=socketEnd;return proxy}function onopen(){stream.setReadable(proxy);stream.setWritable(proxy);stream.emit("connect")}function onclose(){stream.end();stream.destroy()}function onerror(err){stream.destroy(err)}function onmessage(event){var data=event.data;if(data instanceof ArrayBuffer)data=Buffer.from(data);else data=Buffer.from(data,"utf8");proxy.push(data)}function writev(chunks,cb){var buffers=new Array(chunks.length);for(var i=0;i<chunks.length;i++){if(typeof chunks[i].chunk==="string"){buffers[i]=Buffer.from(chunks[i],"utf8")}else{buffers[i]=chunks[i].chunk}}this._write(Buffer.concat(buffers),"binary",cb)}function socketWriteBrowser(chunk,enc,next){if(socket.bufferedAmount>bufferSize){setTimeout(socketWriteBrowser,bufferTimeout,chunk,enc,next)}if(coerceToBuffer&&typeof chunk==="string"){chunk=Buffer.from(chunk,"utf8")}try{socket.send(chunk)}catch(err){return next(err)}next()}function socketEndBrowser(done){socket.close();done()}return stream}if(IS_BROWSER){module.exports=browserStreamBuilder}else{module.exports=streamBuilder}}).call(this)}).call(this,require("_process"))},{_process:182,buffer:74,debug:77,duplexify:80,"readable-stream":173,ws:222}],152:[function(require,module,exports){"use strict";var _require=require("buffer"),Buffer=_require.Buffer;var Transform=require("readable-stream").Transform;var duplexify=require("duplexify");var socketTask,proxy,stream;function buildProxy(){var proxy=new Transform;proxy._write=function(chunk,encoding,next){socketTask.send({data:chunk.buffer,success:function success(){next()},fail:function fail(errMsg){next(new Error(errMsg))}})};proxy._flush=function socketEnd(done){socketTask.close({success:function success(){done()}})};return proxy}function setDefaultOpts(opts){if(!opts.hostname){opts.hostname="localhost"}if(!opts.path){opts.path="/"}if(!opts.wsOptions){opts.wsOptions={}}}function buildUrl(opts,client){var protocol=opts.protocol==="wxs"?"wss":"ws";var url=protocol+"://"+opts.hostname+opts.path;if(opts.port&&opts.port!==80&&opts.port!==443){url=protocol+"://"+opts.hostname+":"+opts.port+opts.path}if(typeof opts.transformWsUrl==="function"){url=opts.transformWsUrl(url,opts,client)}return url}function bindEventHandler(){socketTask.onOpen((function(){stream.setReadable(proxy);stream.setWritable(proxy);stream.emit("connect")}));socketTask.onMessage((function(res){var data=res.data;if(data instanceof ArrayBuffer)data=Buffer.from(data);else data=Buffer.from(data,"utf8");proxy.push(data)}));socketTask.onClose((function(){stream.end();stream.destroy()}));socketTask.onError((function(res){stream.destroy(new Error(res.errMsg))}))}function buildStream(client,opts){opts.hostname=opts.hostname||opts.host;if(!opts.hostname){throw new Error("Could not determine host. Specify host manually.")}var websocketSubProtocol=opts.protocolId==="MQIsdp"&&opts.protocolVersion===3?"mqttv3.1":"mqtt";setDefaultOpts(opts);var url=buildUrl(opts,client);socketTask=wx.connectSocket({url:url,protocols:[websocketSubProtocol]});proxy=buildProxy();stream=duplexify.obj();stream._destroy=function(err,cb){socketTask.close({success:function success(){cb&&cb(err)}})};var destroyRef=stream.destroy;stream.destroy=function(){stream.destroy=destroyRef;var self=this;setTimeout((function(){socketTask.close({fail:function fail(){self._destroy(new Error)}})}),0)}.bind(stream);bindEventHandler();return stream}module.exports=buildStream},{buffer:74,duplexify:80,"readable-stream":173}],153:[function(require,module,exports){"use strict";function DefaultMessageIdProvider(){if(!(this instanceof DefaultMessageIdProvider)){return new DefaultMessageIdProvider}this.nextId=Math.max(1,Math.floor(Math.random()*65535))}DefaultMessageIdProvider.prototype.allocate=function(){var id=this.nextId++;if(this.nextId===65536){this.nextId=1}return id};DefaultMessageIdProvider.prototype.getLastAllocated=function(){return this.nextId===1?65535:this.nextId-1};DefaultMessageIdProvider.prototype.register=function(messageId){return true};DefaultMessageIdProvider.prototype.deallocate=function(messageId){};DefaultMessageIdProvider.prototype.clear=function(){};module.exports=DefaultMessageIdProvider},{}],154:[function(require,module,exports){"use strict";var xtend=require("xtend");var Readable=require("readable-stream").Readable;var streamsOpts={objectMode:true};var defaultStoreOptions={clean:true};function Store(options){if(!(this instanceof Store)){return new Store(options)}this.options=options||{};this.options=xtend(defaultStoreOptions,options);this._inflights=new Map}Store.prototype.put=function(packet,cb){this._inflights.set(packet.messageId,packet);if(cb){cb()}return this};Store.prototype.createStream=function(){var stream=new Readable(streamsOpts);var values=[];var destroyed=false;var i=0;this._inflights.forEach((function(value,key){values.push(value)}));stream._read=function(){if(!destroyed&&i<values.length){this.push(values[i++])}else{this.push(null)}};stream.destroy=function(){if(destroyed){return}var self=this;destroyed=true;setTimeout((function(){self.emit("close")}),0)};return stream};Store.prototype.del=function(packet,cb){packet=this._inflights.get(packet.messageId);if(packet){this._inflights["delete"](packet.messageId);cb(null,packet)}else if(cb){cb(new Error("missing packet"))}return this};Store.prototype.get=function(packet,cb){packet=this._inflights.get(packet.messageId);if(packet){cb(null,packet)}else if(cb){cb(new Error("missing packet"))}return this};Store.prototype.close=function(cb){if(this.options.clean){this._inflights=null}if(cb){cb()}};module.exports=Store},{"readable-stream":173,xtend:223}],155:[function(require,module,exports){"use strict";function TopicAliasRecv(max){if(!(this instanceof TopicAliasRecv)){return new TopicAliasRecv(max)}this.aliasToTopic={};this.max=max}TopicAliasRecv.prototype.put=function(topic,alias){if(alias===0||alias>this.max){return false}this.aliasToTopic[alias]=topic;this.length=Object.keys(this.aliasToTopic).length;return true};TopicAliasRecv.prototype.getTopicByAlias=function(alias){return this.aliasToTopic[alias]};TopicAliasRecv.prototype.clear=function(){this.aliasToTopic={}};module.exports=TopicAliasRecv},{}],156:[function(require,module,exports){"use strict";var LruMap=require("lru-cache");var NumberAllocator=require("number-allocator").NumberAllocator;function TopicAliasSend(max){if(!(this instanceof TopicAliasSend)){return new TopicAliasSend(max)}if(max>0){this.aliasToTopic=new LruMap({max:max});this.topicToAlias={};this.numberAllocator=new NumberAllocator(1,max);this.max=max;this.length=0}}TopicAliasSend.prototype.put=function(topic,alias){if(alias===0||alias>this.max){return false}var entry=this.aliasToTopic.get(alias);if(entry){delete this.topicToAlias[entry]}this.aliasToTopic.set(alias,topic);this.topicToAlias[topic]=alias;this.numberAllocator.use(alias);this.length=this.aliasToTopic.length;return true};TopicAliasSend.prototype.getTopicByAlias=function(alias){return this.aliasToTopic.get(alias)};TopicAliasSend.prototype.getAliasByTopic=function(topic){var alias=this.topicToAlias[topic];if(typeof alias!=="undefined"){this.aliasToTopic.get(alias)}return alias};TopicAliasSend.prototype.clear=function(){this.aliasToTopic.reset();this.topicToAlias={};this.numberAllocator.clear();this.length=0};TopicAliasSend.prototype.getLruAlias=function(){var alias=this.numberAllocator.firstVacant();if(alias)return alias;return this.aliasToTopic.keys()[this.aliasToTopic.length-1]};module.exports=TopicAliasSend},{"lru-cache":158,"number-allocator":177}],157:[function(require,module,exports){"use strict";function validateTopic(topic){var parts=topic.split("/");for(var i=0;i<parts.length;i++){if(parts[i]==="+"){continue}if(parts[i]==="#"){return i===parts.length-1}if(parts[i].indexOf("+")!==-1||parts[i].indexOf("#")!==-1){return false}}return true}function validateTopics(topics){if(topics.length===0){return"empty_topic_list"}for(var i=0;i<topics.length;i++){if(!validateTopic(topics[i])){return topics[i]}}return null}module.exports={validateTopics:validateTopics}},{}],158:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var Yallist=require("yallist");var MAX=Symbol("max");var LENGTH=Symbol("length");var LENGTH_CALCULATOR=Symbol("lengthCalculator");var ALLOW_STALE=Symbol("allowStale");var MAX_AGE=Symbol("maxAge");var DISPOSE=Symbol("dispose");var NO_DISPOSE_ON_SET=Symbol("noDisposeOnSet");var LRU_LIST=Symbol("lruList");var CACHE=Symbol("cache");var UPDATE_AGE_ON_GET=Symbol("updateAgeOnGet");var naiveLength=function naiveLength(){return 1};var LRUCache=function(){function LRUCache(options){_classCallCheck(this,LRUCache);if(typeof options==="number")options={max:options};if(!options)options={};if(options.max&&(typeof options.max!=="number"||options.max<0))throw new TypeError("max must be a non-negative number");var max=this[MAX]=options.max||Infinity;var lc=options.length||naiveLength;this[LENGTH_CALCULATOR]=typeof lc!=="function"?naiveLength:lc;this[ALLOW_STALE]=options.stale||false;if(options.maxAge&&typeof options.maxAge!=="number")throw new TypeError("maxAge must be a number");this[MAX_AGE]=options.maxAge||0;this[DISPOSE]=options.dispose;this[NO_DISPOSE_ON_SET]=options.noDisposeOnSet||false;this[UPDATE_AGE_ON_GET]=options.updateAgeOnGet||false;this.reset()}return _createClass(LRUCache,[{key:"max",get:function get(){return this[MAX]},set:function set(mL){if(typeof mL!=="number"||mL<0)throw new TypeError("max must be a non-negative number");this[MAX]=mL||Infinity;trim(this)}},{key:"allowStale",get:function get(){return this[ALLOW_STALE]},set:function set(allowStale){this[ALLOW_STALE]=!!allowStale}},{key:"maxAge",get:function get(){return this[MAX_AGE]},set:function set(mA){if(typeof mA!=="number")throw new TypeError("maxAge must be a non-negative number");this[MAX_AGE]=mA;trim(this)}},{key:"lengthCalculator",get:function get(){return this[LENGTH_CALCULATOR]},set:function set(lC){var _this=this;if(typeof lC!=="function")lC=naiveLength;if(lC!==this[LENGTH_CALCULATOR]){this[LENGTH_CALCULATOR]=lC;this[LENGTH]=0;this[LRU_LIST].forEach((function(hit){hit.length=_this[LENGTH_CALCULATOR](hit.value,hit.key);_this[LENGTH]+=hit.length}))}trim(this)}},{key:"length",get:function get(){return this[LENGTH]}},{key:"itemCount",get:function get(){return this[LRU_LIST].length}},{key:"rforEach",value:function rforEach(fn,thisp){thisp=thisp||this;for(var walker=this[LRU_LIST].tail;walker!==null;){var prev=walker.prev;forEachStep(this,fn,walker,thisp);walker=prev}}},{key:"forEach",value:function forEach(fn,thisp){thisp=thisp||this;for(var walker=this[LRU_LIST].head;walker!==null;){var next=walker.next;forEachStep(this,fn,walker,thisp);walker=next}}},{key:"keys",value:function keys(){return this[LRU_LIST].toArray().map((function(k){return k.key}))}},{key:"values",value:function values(){return this[LRU_LIST].toArray().map((function(k){return k.value}))}},{key:"reset",value:function reset(){var _this2=this;if(this[DISPOSE]&&this[LRU_LIST]&&this[LRU_LIST].length){this[LRU_LIST].forEach((function(hit){return _this2[DISPOSE](hit.key,hit.value)}))}this[CACHE]=new Map;this[LRU_LIST]=new Yallist;this[LENGTH]=0}},{key:"dump",value:function dump(){var _this3=this;return this[LRU_LIST].map((function(hit){return isStale(_this3,hit)?false:{k:hit.key,v:hit.value,e:hit.now+(hit.maxAge||0)}})).toArray().filter((function(h){return h}))}},{key:"dumpLru",value:function dumpLru(){return this[LRU_LIST]}},{key:"set",value:function set(key,value,maxAge){maxAge=maxAge||this[MAX_AGE];if(maxAge&&typeof maxAge!=="number")throw new TypeError("maxAge must be a number");var now=maxAge?Date.now():0;var len=this[LENGTH_CALCULATOR](value,key);if(this[CACHE].has(key)){if(len>this[MAX]){_del(this,this[CACHE].get(key));return false}var node=this[CACHE].get(key);var item=node.value;if(this[DISPOSE]){if(!this[NO_DISPOSE_ON_SET])this[DISPOSE](key,item.value)}item.now=now;item.maxAge=maxAge;item.value=value;this[LENGTH]+=len-item.length;item.length=len;this.get(key);trim(this);return true}var hit=new Entry(key,value,len,now,maxAge);if(hit.length>this[MAX]){if(this[DISPOSE])this[DISPOSE](key,value);return false}this[LENGTH]+=hit.length;this[LRU_LIST].unshift(hit);this[CACHE].set(key,this[LRU_LIST].head);trim(this);return true}},{key:"has",value:function has(key){if(!this[CACHE].has(key))return false;var hit=this[CACHE].get(key).value;return!isStale(this,hit)}},{key:"get",value:function get(key){return _get(this,key,true)}},{key:"peek",value:function peek(key){return _get(this,key,false)}},{key:"pop",value:function pop(){var node=this[LRU_LIST].tail;if(!node)return null;_del(this,node);return node.value}},{key:"del",value:function del(key){_del(this,this[CACHE].get(key))}},{key:"load",value:function load(arr){this.reset();var now=Date.now();for(var l=arr.length-1;l>=0;l--){var hit=arr[l];var expiresAt=hit.e||0;if(expiresAt===0)this.set(hit.k,hit.v);else{var maxAge=expiresAt-now;if(maxAge>0){this.set(hit.k,hit.v,maxAge)}}}}},{key:"prune",value:function prune(){var _this4=this;this[CACHE].forEach((function(value,key){return _get(_this4,key,false)}))}}])}();var _get=function _get(self,key,doUse){var node=self[CACHE].get(key);if(node){var hit=node.value;if(isStale(self,hit)){_del(self,node);if(!self[ALLOW_STALE])return undefined}else{if(doUse){if(self[UPDATE_AGE_ON_GET])node.value.now=Date.now();self[LRU_LIST].unshiftNode(node)}}return hit.value}};var isStale=function isStale(self,hit){if(!hit||!hit.maxAge&&!self[MAX_AGE])return false;var diff=Date.now()-hit.now;return hit.maxAge?diff>hit.maxAge:self[MAX_AGE]&&diff>self[MAX_AGE]};var trim=function trim(self){if(self[LENGTH]>self[MAX]){for(var walker=self[LRU_LIST].tail;self[LENGTH]>self[MAX]&&walker!==null;){var prev=walker.prev;_del(self,walker);walker=prev}}};var _del=function _del(self,node){if(node){var hit=node.value;if(self[DISPOSE])self[DISPOSE](hit.key,hit.value);self[LENGTH]-=hit.length;self[CACHE]["delete"](hit.key);self[LRU_LIST].removeNode(node)}};var Entry=_createClass((function Entry(key,value,length,now,maxAge){_classCallCheck(this,Entry);this.key=key;this.value=value;this.length=length;this.now=now;this.maxAge=maxAge||0}));var forEachStep=function forEachStep(self,fn,node,thisp){var hit=node.value;if(isStale(self,hit)){_del(self,node);if(!self[ALLOW_STALE])hit=undefined}if(hit)fn.call(thisp,hit.value,hit.key,self)};module.exports=LRUCache},{yallist:175}],159:[function(require,module,exports){arguments[4][55][0].apply(exports,arguments)},{dup:55}],160:[function(require,module,exports){arguments[4][56][0].apply(exports,arguments)},{"./_stream_readable":162,"./_stream_writable":164,_process:182,dup:56,inherits:111}],161:[function(require,module,exports){arguments[4][57][0].apply(exports,arguments)},{"./_stream_transform":163,dup:57,inherits:111}],162:[function(require,module,exports){arguments[4][58][0].apply(exports,arguments)},{"../errors":159,"./_stream_duplex":160,"./internal/streams/async_iterator":165,"./internal/streams/buffer_list":166,"./internal/streams/destroy":167,"./internal/streams/from":169,"./internal/streams/state":171,"./internal/streams/stream":172,_process:182,buffer:74,dup:58,events:97,inherits:111,"string_decoder/":191,util:71}],163:[function(require,module,exports){arguments[4][59][0].apply(exports,arguments)},{"../errors":159,"./_stream_duplex":160,dup:59,inherits:111}],164:[function(require,module,exports){arguments[4][60][0].apply(exports,arguments)},{"../errors":159,"./_stream_duplex":160,"./internal/streams/destroy":167,"./internal/streams/state":171,"./internal/streams/stream":172,_process:182,buffer:74,dup:60,inherits:111,"util-deprecate":200}],165:[function(require,module,exports){arguments[4][61][0].apply(exports,arguments)},{"./end-of-stream":168,_process:182,dup:61}],166:[function(require,module,exports){arguments[4][62][0].apply(exports,arguments)},{buffer:74,dup:62,util:71}],167:[function(require,module,exports){arguments[4][63][0].apply(exports,arguments)},{_process:182,dup:63}],168:[function(require,module,exports){arguments[4][64][0].apply(exports,arguments)},{"../../../errors":159,dup:64}],169:[function(require,module,exports){arguments[4][65][0].apply(exports,arguments)},{dup:65}],170:[function(require,module,exports){arguments[4][66][0].apply(exports,arguments)},{"../../../errors":159,"./end-of-stream":168,dup:66}],171:[function(require,module,exports){arguments[4][67][0].apply(exports,arguments)},{"../../../errors":159,dup:67}],172:[function(require,module,exports){arguments[4][68][0].apply(exports,arguments)},{dup:68,events:97}],173:[function(require,module,exports){arguments[4][69][0].apply(exports,arguments)},{"./lib/_stream_duplex.js":160,"./lib/_stream_passthrough.js":161,"./lib/_stream_readable.js":162,"./lib/_stream_transform.js":163,"./lib/_stream_writable.js":164,"./lib/internal/streams/end-of-stream.js":168,"./lib/internal/streams/pipeline.js":170,dup:69}],174:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{define({},"")}catch(t){define=function define(t,e,r){return t[e]=r}}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,(function(){return this}));var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach((function(e){define(t,e,(function(t){return this._invoke(e,t)}))}))}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){invoke("next",t,i,a)}),(function(t){invoke("throw",t,i,a)})):e.resolve(h).then((function(t){u.value=t,i(u)}),(function(t){return invoke("throw",t,i,a)}))}a(c.arg)}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e((function(e,r){invoke(t,n,e,r)}))}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done}}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg)}}}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next};return i.next=i}}throw new TypeError(_typeof(e)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t},e.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,(function(){return this})),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,(function(){return this})),define(g,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next}return next.done=!0,next}},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y}},catch:function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}module.exports=function(Yallist){Yallist.prototype[Symbol.iterator]=_regeneratorRuntime().mark((function _callee(){var walker;return _regeneratorRuntime().wrap((function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:walker=this.head;case 1:if(!walker){_context.next=7;break}_context.next=4;return walker.value;case 4:walker=walker.next;_context.next=1;break;case 7:case"end":return _context.stop()}}),_callee,this)}))}},{}],175:[function(require,module,exports){"use strict";module.exports=Yallist;Yallist.Node=Node;Yallist.create=Yallist;function Yallist(list){var self=this;if(!(self instanceof Yallist)){self=new Yallist}self.tail=null;self.head=null;self.length=0;if(list&&typeof list.forEach==="function"){list.forEach((function(item){self.push(item)}))}else if(arguments.length>0){for(var i=0,l=arguments.length;i<l;i++){self.push(arguments[i])}}return self}Yallist.prototype.removeNode=function(node){if(node.list!==this){throw new Error("removing node which does not belong to this list")}var next=node.next;var prev=node.prev;if(next){next.prev=prev}if(prev){prev.next=next}if(node===this.head){this.head=next}if(node===this.tail){this.tail=prev}node.list.length--;node.next=null;node.prev=null;node.list=null;return next};Yallist.prototype.unshiftNode=function(node){if(node===this.head){return}if(node.list){node.list.removeNode(node)}var head=this.head;node.list=this;node.next=head;if(head){head.prev=node}this.head=node;if(!this.tail){this.tail=node}this.length++};Yallist.prototype.pushNode=function(node){if(node===this.tail){return}if(node.list){node.list.removeNode(node)}var tail=this.tail;node.list=this;node.prev=tail;if(tail){tail.next=node}this.tail=node;if(!this.head){this.head=node}this.length++};Yallist.prototype.push=function(){for(var i=0,l=arguments.length;i<l;i++){push(this,arguments[i])}return this.length};Yallist.prototype.unshift=function(){for(var i=0,l=arguments.length;i<l;i++){unshift(this,arguments[i])}return this.length};Yallist.prototype.pop=function(){if(!this.tail){return undefined}var res=this.tail.value;this.tail=this.tail.prev;if(this.tail){this.tail.next=null}else{this.head=null}this.length--;return res};Yallist.prototype.shift=function(){if(!this.head){return undefined}var res=this.head.value;this.head=this.head.next;if(this.head){this.head.prev=null}else{this.tail=null}this.length--;return res};Yallist.prototype.forEach=function(fn,thisp){thisp=thisp||this;for(var walker=this.head,i=0;walker!==null;i++){fn.call(thisp,walker.value,i,this);walker=walker.next}};Yallist.prototype.forEachReverse=function(fn,thisp){thisp=thisp||this;for(var walker=this.tail,i=this.length-1;walker!==null;i--){fn.call(thisp,walker.value,i,this);walker=walker.prev}};Yallist.prototype.get=function(n){for(var i=0,walker=this.head;walker!==null&&i<n;i++){walker=walker.next}if(i===n&&walker!==null){return walker.value}};Yallist.prototype.getReverse=function(n){for(var i=0,walker=this.tail;walker!==null&&i<n;i++){walker=walker.prev}if(i===n&&walker!==null){return walker.value}};Yallist.prototype.map=function(fn,thisp){thisp=thisp||this;var res=new Yallist;for(var walker=this.head;walker!==null;){res.push(fn.call(thisp,walker.value,this));walker=walker.next}return res};Yallist.prototype.mapReverse=function(fn,thisp){thisp=thisp||this;var res=new Yallist;for(var walker=this.tail;walker!==null;){res.push(fn.call(thisp,walker.value,this));walker=walker.prev}return res};Yallist.prototype.reduce=function(fn,initial){var acc;var walker=this.head;if(arguments.length>1){acc=initial}else if(this.head){walker=this.head.next;acc=this.head.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var i=0;walker!==null;i++){acc=fn(acc,walker.value,i);walker=walker.next}return acc};Yallist.prototype.reduceReverse=function(fn,initial){var acc;var walker=this.tail;if(arguments.length>1){acc=initial}else if(this.tail){walker=this.tail.prev;acc=this.tail.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var i=this.length-1;walker!==null;i--){acc=fn(acc,walker.value,i);walker=walker.prev}return acc};Yallist.prototype.toArray=function(){var arr=new Array(this.length);for(var i=0,walker=this.head;walker!==null;i++){arr[i]=walker.value;walker=walker.next}return arr};Yallist.prototype.toArrayReverse=function(){var arr=new Array(this.length);for(var i=0,walker=this.tail;walker!==null;i++){arr[i]=walker.value;walker=walker.prev}return arr};Yallist.prototype.slice=function(from,to){to=to||this.length;if(to<0){to+=this.length}from=from||0;if(from<0){from+=this.length}var ret=new Yallist;if(to<from||to<0){return ret}if(from<0){from=0}if(to>this.length){to=this.length}for(var i=0,walker=this.head;walker!==null&&i<from;i++){walker=walker.next}for(;walker!==null&&i<to;i++,walker=walker.next){ret.push(walker.value)}return ret};Yallist.prototype.sliceReverse=function(from,to){to=to||this.length;if(to<0){to+=this.length}from=from||0;if(from<0){from+=this.length}var ret=new Yallist;if(to<from||to<0){return ret}if(from<0){from=0}if(to>this.length){to=this.length}for(var i=this.length,walker=this.tail;walker!==null&&i>to;i--){walker=walker.prev}for(;walker!==null&&i>from;i--,walker=walker.prev){ret.push(walker.value)}return ret};Yallist.prototype.splice=function(start,deleteCount){if(start>this.length){start=this.length-1}if(start<0){start=this.length+start}for(var i=0,walker=this.head;walker!==null&&i<start;i++){walker=walker.next}var ret=[];for(var i=0;walker&&i<deleteCount;i++){ret.push(walker.value);walker=this.removeNode(walker)}if(walker===null){walker=this.tail}if(walker!==this.head&&walker!==this.tail){walker=walker.prev}for(var i=0;i<(arguments.length<=2?0:arguments.length-2);i++){walker=insert(this,walker,i+2<2||arguments.length<=i+2?undefined:arguments[i+2])}return ret};Yallist.prototype.reverse=function(){var head=this.head;var tail=this.tail;for(var walker=head;walker!==null;walker=walker.prev){var p=walker.prev;walker.prev=walker.next;walker.next=p}this.head=tail;this.tail=head;return this};function insert(self,node,value){var inserted=node===self.head?new Node(value,null,node,self):new Node(value,node,node.next,self);if(inserted.next===null){self.tail=inserted}if(inserted.prev===null){self.head=inserted}self.length++;return inserted}function push(self,item){self.tail=new Node(item,self.tail,null,self);if(!self.head){self.head=self.tail}self.length++}function unshift(self,item){self.head=new Node(item,null,self.head,self);if(!self.tail){self.tail=self.head}self.length++}function Node(value,prev,next,list){if(!(this instanceof Node)){return new Node(value,prev,next,list)}this.list=list;this.value=value;if(prev){prev.next=this;this.prev=prev}else{this.prev=null}if(next){next.prev=this;this.next=next}else{this.next=null}}try{require("./iterator.js")(Yallist)}catch(er){}},{"./iterator.js":174}],176:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}var s=1e3;var m=s*60;var h=m*60;var d=h*24;var w=d*7;var y=d*365.25;module.exports=function(val,options){options=options||{};var type=_typeof(val);if(type==="string"&&val.length>0){return parse(val)}else if(type==="number"&&isFinite(val)){return options["long"]?fmtLong(val):fmtShort(val)}throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(val))};function parse(str){str=String(str);if(str.length>100){return}var match=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str);if(!match){return}var n=parseFloat(match[1]);var type=(match[2]||"ms").toLowerCase();switch(type){case"years":case"year":case"yrs":case"yr":case"y":return n*y;case"weeks":case"week":case"w":return n*w;case"days":case"day":case"d":return n*d;case"hours":case"hour":case"hrs":case"hr":case"h":return n*h;case"minutes":case"minute":case"mins":case"min":case"m":return n*m;case"seconds":case"second":case"secs":case"sec":case"s":return n*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return undefined}}function fmtShort(ms){var msAbs=Math.abs(ms);if(msAbs>=d){return Math.round(ms/d)+"d"}if(msAbs>=h){return Math.round(ms/h)+"h"}if(msAbs>=m){return Math.round(ms/m)+"m"}if(msAbs>=s){return Math.round(ms/s)+"s"}return ms+"ms"}function fmtLong(ms){var msAbs=Math.abs(ms);if(msAbs>=d){return plural(ms,msAbs,d,"day")}if(msAbs>=h){return plural(ms,msAbs,h,"hour")}if(msAbs>=m){return plural(ms,msAbs,m,"minute")}if(msAbs>=s){return plural(ms,msAbs,s,"second")}return ms+" ms"}function plural(ms,msAbs,n,name){var isPlural=msAbs>=n*1.5;return Math.round(ms/n)+" "+name+(isPlural?"s":"")}},{}],177:[function(require,module,exports){"use strict";var NumberAllocator=require("./lib/number-allocator.js");module.exports.NumberAllocator=NumberAllocator},{"./lib/number-allocator.js":178}],178:[function(require,module,exports){"use strict";function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}var SortedSet=require("js-sdsl").OrderedSet;var debugTrace=require("debug")("number-allocator:trace");var debugError=require("debug")("number-allocator:error");function Interval(low,high){this.low=low;this.high=high}Interval.prototype.equals=function(other){return this.low===other.low&&this.high===other.high};Interval.prototype.compare=function(other){if(this.low<other.low&&this.high<other.low)return-1;if(other.low<this.low&&other.high<this.low)return 1;return 0};function NumberAllocator(min,max){if(!(this instanceof NumberAllocator)){return new NumberAllocator(min,max)}this.min=min;this.max=max;this.ss=new SortedSet([],(function(lhs,rhs){return lhs.compare(rhs)}));debugTrace("Create");this.clear()}NumberAllocator.prototype.firstVacant=function(){if(this.ss.size()===0)return null;return this.ss.front().low};NumberAllocator.prototype.alloc=function(){if(this.ss.size()===0){debugTrace("alloc():empty");return null}var it=this.ss.begin();var low=it.pointer.low;var high=it.pointer.high;var num=low;if(num+1<=high){this.ss.updateKeyByIterator(it,new Interval(low+1,high))}else{this.ss.eraseElementByPos(0)}debugTrace("alloc():"+num);return num};NumberAllocator.prototype.use=function(num){var key=new Interval(num,num);var it=this.ss.lowerBound(key);if(!it.equals(this.ss.end())){var low=it.pointer.low;var high=it.pointer.high;if(it.pointer.equals(key)){this.ss.eraseElementByIterator(it);debugTrace("use():"+num);return true}if(low>num)return false;if(low===num){this.ss.updateKeyByIterator(it,new Interval(low+1,high));debugTrace("use():"+num);return true}if(high===num){this.ss.updateKeyByIterator(it,new Interval(low,high-1));debugTrace("use():"+num);return true}this.ss.updateKeyByIterator(it,new Interval(num+1,high));this.ss.insert(new Interval(low,num-1));debugTrace("use():"+num);return true}debugTrace("use():failed");return false};NumberAllocator.prototype.free=function(num){if(num<this.min||num>this.max){debugError("free():"+num+" is out of range");return}var key=new Interval(num,num);var it=this.ss.upperBound(key);if(it.equals(this.ss.end())){if(it.equals(this.ss.begin())){this.ss.insert(key);return}it.pre();var low=it.pointer.high;var high=it.pointer.high;if(high+1===num){this.ss.updateKeyByIterator(it,new Interval(low,num))}else{this.ss.insert(key)}}else{if(it.equals(this.ss.begin())){if(num+1===it.pointer.low){var _high=it.pointer.high;this.ss.updateKeyByIterator(it,new Interval(num,_high))}else{this.ss.insert(key)}}else{var rLow=it.pointer.low;var rHigh=it.pointer.high;it.pre();var lLow=it.pointer.low;var lHigh=it.pointer.high;if(lHigh+1===num){if(num+1===rLow){this.ss.eraseElementByIterator(it);this.ss.updateKeyByIterator(it,new Interval(lLow,rHigh))}else{this.ss.updateKeyByIterator(it,new Interval(lLow,num))}}else{if(num+1===rLow){this.ss.eraseElementByIterator(it.next());this.ss.insert(new Interval(num,rHigh))}else{this.ss.insert(key)}}}}debugTrace("free():"+num)};NumberAllocator.prototype.clear=function(){debugTrace("clear()");this.ss.clear();this.ss.insert(new Interval(this.min,this.max))};NumberAllocator.prototype.intervalCount=function(){return this.ss.size()};NumberAllocator.prototype.dump=function(){console.log("length:"+this.ss.size());var _iterator=_createForOfIteratorHelper(this.ss),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var element=_step.value;console.log(element)}}catch(err){_iterator.e(err)}finally{_iterator.f()}};module.exports=NumberAllocator},{debug:77,"js-sdsl":134}],179:[function(require,module,exports){(function(global){(function(){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}var hasMap=typeof Map==="function"&&Map.prototype;var mapSizeDescriptor=Object.getOwnPropertyDescriptor&&hasMap?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null;var mapSize=hasMap&&mapSizeDescriptor&&typeof mapSizeDescriptor.get==="function"?mapSizeDescriptor.get:null;var mapForEach=hasMap&&Map.prototype.forEach;var hasSet=typeof Set==="function"&&Set.prototype;var setSizeDescriptor=Object.getOwnPropertyDescriptor&&hasSet?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null;var setSize=hasSet&&setSizeDescriptor&&typeof setSizeDescriptor.get==="function"?setSizeDescriptor.get:null;var setForEach=hasSet&&Set.prototype.forEach;var hasWeakMap=typeof WeakMap==="function"&&WeakMap.prototype;var weakMapHas=hasWeakMap?WeakMap.prototype.has:null;var hasWeakSet=typeof WeakSet==="function"&&WeakSet.prototype;var weakSetHas=hasWeakSet?WeakSet.prototype.has:null;var hasWeakRef=typeof WeakRef==="function"&&WeakRef.prototype;var weakRefDeref=hasWeakRef?WeakRef.prototype.deref:null;var booleanValueOf=Boolean.prototype.valueOf;var objectToString=Object.prototype.toString;var functionToString=Function.prototype.toString;var $match=String.prototype.match;var $slice=String.prototype.slice;var $replace=String.prototype.replace;var $toUpperCase=String.prototype.toUpperCase;var $toLowerCase=String.prototype.toLowerCase;var $test=RegExp.prototype.test;var $concat=Array.prototype.concat;var $join=Array.prototype.join;var $arrSlice=Array.prototype.slice;var $floor=Math.floor;var bigIntValueOf=typeof BigInt==="function"?BigInt.prototype.valueOf:null;var gOPS=Object.getOwnPropertySymbols;var symToString=typeof Symbol==="function"&&_typeof(Symbol.iterator)==="symbol"?Symbol.prototype.toString:null;var hasShammedSymbols=typeof Symbol==="function"&&_typeof(Symbol.iterator)==="object";var toStringTag=typeof Symbol==="function"&&Symbol.toStringTag&&(_typeof(Symbol.toStringTag)===hasShammedSymbols?"object":"symbol")?Symbol.toStringTag:null;var isEnumerable=Object.prototype.propertyIsEnumerable;var gPO=(typeof Reflect==="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(O){return O.__proto__}:null);function addNumericSeparator(num,str){if(num===Infinity||num===-Infinity||num!==num||num&&num>-1e3&&num<1e3||$test.call(/e/,str)){return str}var sepRegex=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof num==="number"){var _int=num<0?-$floor(-num):$floor(num);if(_int!==num){var intStr=String(_int);var dec=$slice.call(str,intStr.length+1);return $replace.call(intStr,sepRegex,"$&_")+"."+$replace.call($replace.call(dec,/([0-9]{3})/g,"$&_"),/_$/,"")}}return $replace.call(str,sepRegex,"$&_")}var utilInspect=require("./util.inspect");var inspectCustom=utilInspect.custom;var inspectSymbol=isSymbol(inspectCustom)?inspectCustom:null;module.exports=function inspect_(obj,options,depth,seen){var opts=options||{};if(has(opts,"quoteStyle")&&opts.quoteStyle!=="single"&&opts.quoteStyle!=="double"){throw new TypeError('option "quoteStyle" must be "single" or "double"')}if(has(opts,"maxStringLength")&&(typeof opts.maxStringLength==="number"?opts.maxStringLength<0&&opts.maxStringLength!==Infinity:opts.maxStringLength!==null)){throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`')}var customInspect=has(opts,"customInspect")?opts.customInspect:true;if(typeof customInspect!=="boolean"&&customInspect!=="symbol"){throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`")}if(has(opts,"indent")&&opts.indent!==null&&opts.indent!=="\t"&&!(parseInt(opts.indent,10)===opts.indent&&opts.indent>0)){throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`')}if(has(opts,"numericSeparator")&&typeof opts.numericSeparator!=="boolean"){throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`')}var numericSeparator=opts.numericSeparator;if(typeof obj==="undefined"){return"undefined"}if(obj===null){return"null"}if(typeof obj==="boolean"){return obj?"true":"false"}if(typeof obj==="string"){return inspectString(obj,opts)}if(typeof obj==="number"){if(obj===0){return Infinity/obj>0?"0":"-0"}var str=String(obj);return numericSeparator?addNumericSeparator(obj,str):str}if(typeof obj==="bigint"){var bigIntStr=String(obj)+"n";return numericSeparator?addNumericSeparator(obj,bigIntStr):bigIntStr}var maxDepth=typeof opts.depth==="undefined"?5:opts.depth;if(typeof depth==="undefined"){depth=0}if(depth>=maxDepth&&maxDepth>0&&_typeof(obj)==="object"){return isArray(obj)?"[Array]":"[Object]"}var indent=getIndent(opts,depth);if(typeof seen==="undefined"){seen=[]}else if(indexOf(seen,obj)>=0){return"[Circular]"}function inspect(value,from,noIndent){if(from){seen=$arrSlice.call(seen);seen.push(from)}if(noIndent){var newOpts={depth:opts.depth};if(has(opts,"quoteStyle")){newOpts.quoteStyle=opts.quoteStyle}return inspect_(value,newOpts,depth+1,seen)}return inspect_(value,opts,depth+1,seen)}if(typeof obj==="function"&&!isRegExp(obj)){var name=nameOf(obj);var keys=arrObjKeys(obj,inspect);return"[Function"+(name?": "+name:" (anonymous)")+"]"+(keys.length>0?" { "+$join.call(keys,", ")+" }":"")}if(isSymbol(obj)){var symString=hasShammedSymbols?$replace.call(String(obj),/^(Symbol\(.*\))_[^)]*$/,"$1"):symToString.call(obj);return _typeof(obj)==="object"&&!hasShammedSymbols?markBoxed(symString):symString}if(isElement(obj)){var s="<"+$toLowerCase.call(String(obj.nodeName));var attrs=obj.attributes||[];for(var i=0;i<attrs.length;i++){s+=" "+attrs[i].name+"="+wrapQuotes(quote(attrs[i].value),"double",opts)}s+=">";if(obj.childNodes&&obj.childNodes.length){s+="..."}s+="</"+$toLowerCase.call(String(obj.nodeName))+">";return s}if(isArray(obj)){if(obj.length===0){return"[]"}var xs=arrObjKeys(obj,inspect);if(indent&&!singleLineValues(xs)){return"["+indentedJoin(xs,indent)+"]"}return"[ "+$join.call(xs,", ")+" ]"}if(isError(obj)){var parts=arrObjKeys(obj,inspect);if(!("cause"in Error.prototype)&&"cause"in obj&&!isEnumerable.call(obj,"cause")){return"{ ["+String(obj)+"] "+$join.call($concat.call("[cause]: "+inspect(obj.cause),parts),", ")+" }"}if(parts.length===0){return"["+String(obj)+"]"}return"{ ["+String(obj)+"] "+$join.call(parts,", ")+" }"}if(_typeof(obj)==="object"&&customInspect){if(inspectSymbol&&typeof obj[inspectSymbol]==="function"&&utilInspect){return utilInspect(obj,{depth:maxDepth-depth})}else if(customInspect!=="symbol"&&typeof obj.inspect==="function"){return obj.inspect()}}if(isMap(obj)){var mapParts=[];if(mapForEach){mapForEach.call(obj,(function(value,key){mapParts.push(inspect(key,obj,true)+" => "+inspect(value,obj))}))}return collectionOf("Map",mapSize.call(obj),mapParts,indent)}if(isSet(obj)){var setParts=[];if(setForEach){setForEach.call(obj,(function(value){setParts.push(inspect(value,obj))}))}return collectionOf("Set",setSize.call(obj),setParts,indent)}if(isWeakMap(obj)){return weakCollectionOf("WeakMap")}if(isWeakSet(obj)){return weakCollectionOf("WeakSet")}if(isWeakRef(obj)){return weakCollectionOf("WeakRef")}if(isNumber(obj)){return markBoxed(inspect(Number(obj)))}if(isBigInt(obj)){return markBoxed(inspect(bigIntValueOf.call(obj)))}if(isBoolean(obj)){return markBoxed(booleanValueOf.call(obj))}if(isString(obj)){return markBoxed(inspect(String(obj)))}if(typeof window!=="undefined"&&obj===window){return"{ [object Window] }"}if(obj===global){return"{ [object globalThis] }"}if(!isDate(obj)&&!isRegExp(obj)){var ys=arrObjKeys(obj,inspect);var isPlainObject=gPO?gPO(obj)===Object.prototype:obj instanceof Object||obj.constructor===Object;var protoTag=obj instanceof Object?"":"null prototype";var stringTag=!isPlainObject&&toStringTag&&Object(obj)===obj&&toStringTag in obj?$slice.call(toStr(obj),8,-1):protoTag?"Object":"";var constructorTag=isPlainObject||typeof obj.constructor!=="function"?"":obj.constructor.name?obj.constructor.name+" ":"";var tag=constructorTag+(stringTag||protoTag?"["+$join.call($concat.call([],stringTag||[],protoTag||[]),": ")+"] ":"");if(ys.length===0){return tag+"{}"}if(indent){return tag+"{"+indentedJoin(ys,indent)+"}"}return tag+"{ "+$join.call(ys,", ")+" }"}return String(obj)};function wrapQuotes(s,defaultStyle,opts){var quoteChar=(opts.quoteStyle||defaultStyle)==="double"?'"':"'";return quoteChar+s+quoteChar}function quote(s){return $replace.call(String(s),/"/g,"&quot;")}function isArray(obj){return toStr(obj)==="[object Array]"&&(!toStringTag||!(_typeof(obj)==="object"&&toStringTag in obj))}function isDate(obj){return toStr(obj)==="[object Date]"&&(!toStringTag||!(_typeof(obj)==="object"&&toStringTag in obj))}function isRegExp(obj){return toStr(obj)==="[object RegExp]"&&(!toStringTag||!(_typeof(obj)==="object"&&toStringTag in obj))}function isError(obj){return toStr(obj)==="[object Error]"&&(!toStringTag||!(_typeof(obj)==="object"&&toStringTag in obj))}function isString(obj){return toStr(obj)==="[object String]"&&(!toStringTag||!(_typeof(obj)==="object"&&toStringTag in obj))}function isNumber(obj){return toStr(obj)==="[object Number]"&&(!toStringTag||!(_typeof(obj)==="object"&&toStringTag in obj))}function isBoolean(obj){return toStr(obj)==="[object Boolean]"&&(!toStringTag||!(_typeof(obj)==="object"&&toStringTag in obj))}function isSymbol(obj){if(hasShammedSymbols){return obj&&_typeof(obj)==="object"&&obj instanceof Symbol}if(_typeof(obj)==="symbol"){return true}if(!obj||_typeof(obj)!=="object"||!symToString){return false}try{symToString.call(obj);return true}catch(e){}return false}function isBigInt(obj){if(!obj||_typeof(obj)!=="object"||!bigIntValueOf){return false}try{bigIntValueOf.call(obj);return true}catch(e){}return false}var hasOwn=Object.prototype.hasOwnProperty||function(key){return key in this};function has(obj,key){return hasOwn.call(obj,key)}function toStr(obj){return objectToString.call(obj)}function nameOf(f){if(f.name){return f.name}var m=$match.call(functionToString.call(f),/^function\s*([\w$]+)/);if(m){return m[1]}return null}function indexOf(xs,x){if(xs.indexOf){return xs.indexOf(x)}for(var i=0,l=xs.length;i<l;i++){if(xs[i]===x){return i}}return-1}function isMap(x){if(!mapSize||!x||_typeof(x)!=="object"){return false}try{mapSize.call(x);try{setSize.call(x)}catch(s){return true}return x instanceof Map}catch(e){}return false}function isWeakMap(x){if(!weakMapHas||!x||_typeof(x)!=="object"){return false}try{weakMapHas.call(x,weakMapHas);try{weakSetHas.call(x,weakSetHas)}catch(s){return true}return x instanceof WeakMap}catch(e){}return false}function isWeakRef(x){if(!weakRefDeref||!x||_typeof(x)!=="object"){return false}try{weakRefDeref.call(x);return true}catch(e){}return false}function isSet(x){if(!setSize||!x||_typeof(x)!=="object"){return false}try{setSize.call(x);try{mapSize.call(x)}catch(m){return true}return x instanceof Set}catch(e){}return false}function isWeakSet(x){if(!weakSetHas||!x||_typeof(x)!=="object"){return false}try{weakSetHas.call(x,weakSetHas);try{weakMapHas.call(x,weakMapHas)}catch(s){return true}return x instanceof WeakSet}catch(e){}return false}function isElement(x){if(!x||_typeof(x)!=="object"){return false}if(typeof HTMLElement!=="undefined"&&x instanceof HTMLElement){return true}return typeof x.nodeName==="string"&&typeof x.getAttribute==="function"}function inspectString(str,opts){if(str.length>opts.maxStringLength){var remaining=str.length-opts.maxStringLength;var trailer="... "+remaining+" more character"+(remaining>1?"s":"");return inspectString($slice.call(str,0,opts.maxStringLength),opts)+trailer}var s=$replace.call($replace.call(str,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,lowbyte);return wrapQuotes(s,"single",opts)}function lowbyte(c){var n=c.charCodeAt(0);var x={8:"b",9:"t",10:"n",12:"f",13:"r"}[n];if(x){return"\\"+x}return"\\x"+(n<16?"0":"")+$toUpperCase.call(n.toString(16))}function markBoxed(str){return"Object("+str+")"}function weakCollectionOf(type){return type+" { ? }"}function collectionOf(type,size,entries,indent){var joinedEntries=indent?indentedJoin(entries,indent):$join.call(entries,", ");return type+" ("+size+") {"+joinedEntries+"}"}function singleLineValues(xs){for(var i=0;i<xs.length;i++){if(indexOf(xs[i],"\n")>=0){return false}}return true}function getIndent(opts,depth){var baseIndent;if(opts.indent==="\t"){baseIndent="\t"}else if(typeof opts.indent==="number"&&opts.indent>0){baseIndent=$join.call(Array(opts.indent+1)," ")}else{return null}return{base:baseIndent,prev:$join.call(Array(depth+1),baseIndent)}}function indentedJoin(xs,indent){if(xs.length===0){return""}var lineJoiner="\n"+indent.prev+indent.base;return lineJoiner+$join.call(xs,","+lineJoiner)+"\n"+indent.prev}function arrObjKeys(obj,inspect){var isArr=isArray(obj);var xs=[];if(isArr){xs.length=obj.length;for(var i=0;i<obj.length;i++){xs[i]=has(obj,i)?inspect(obj[i],obj):""}}var syms=typeof gOPS==="function"?gOPS(obj):[];var symMap;if(hasShammedSymbols){symMap={};for(var k=0;k<syms.length;k++){symMap["$"+syms[k]]=syms[k]}}for(var key in obj){if(!has(obj,key)){continue}if(isArr&&String(Number(key))===key&&key<obj.length){continue}if(hasShammedSymbols&&symMap["$"+key]instanceof Symbol){continue}else if($test.call(/[^\w$]/,key)){xs.push(inspect(key,obj)+": "+inspect(obj[key],obj))}else{xs.push(key+": "+inspect(obj[key],obj))}}if(typeof gOPS==="function"){for(var j=0;j<syms.length;j++){if(isEnumerable.call(obj,syms[j])){xs.push("["+inspect(syms[j])+"]: "+inspect(obj[syms[j]],obj))}}}return xs}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./util.inspect":71}],180:[function(require,module,exports){"use strict";var wrappy=require("wrappy");module.exports=wrappy(once);module.exports.strict=wrappy(onceStrict);once.proto=once((function(){Object.defineProperty(Function.prototype,"once",{value:function value(){return once(this)},configurable:true});Object.defineProperty(Function.prototype,"onceStrict",{value:function value(){return onceStrict(this)},configurable:true})}));function once(fn){var _f=function f(){if(_f.called)return _f.value;_f.called=true;return _f.value=fn.apply(this,arguments)};_f.called=false;return _f}function onceStrict(fn){var _f2=function f(){if(_f2.called)throw new Error(_f2.onceError);_f2.called=true;return _f2.value=fn.apply(this,arguments)};var name=fn.name||"Function wrapped with `once`";_f2.onceError=name+" shouldn't be called more than once";_f2.called=false;return _f2}},{wrappy:221}],181:[function(require,module,exports){(function(process){(function(){"use strict";if(typeof process==="undefined"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0){module.exports={nextTick:nextTick}}else{module.exports=process}function nextTick(fn,arg1,arg2,arg3){if(typeof fn!=="function"){throw new TypeError('"callback" argument must be a function')}var len=arguments.length;var args,i;switch(len){case 0:case 1:return process.nextTick(fn);case 2:return process.nextTick((function afterTickOne(){fn.call(null,arg1)}));case 3:return process.nextTick((function afterTickTwo(){fn.call(null,arg1,arg2)}));case 4:return process.nextTick((function afterTickThree(){fn.call(null,arg1,arg2,arg3)}));default:args=new Array(len-1);i=0;while(i<args.length){args[i++]=arguments[i]}return process.nextTick((function afterTick(){fn.apply(null,args)}))}}}).call(this)}).call(this,require("_process"))},{_process:182}],182:[function(require,module,exports){"use strict";var process=module.exports={};var cachedSetTimeout;var cachedClearTimeout;function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}(function(){try{if(typeof setTimeout==="function"){cachedSetTimeout=setTimeout}else{cachedSetTimeout=defaultSetTimout}}catch(e){cachedSetTimeout=defaultSetTimout}try{if(typeof clearTimeout==="function"){cachedClearTimeout=clearTimeout}else{cachedClearTimeout=defaultClearTimeout}}catch(e){cachedClearTimeout=defaultClearTimeout}})();function runTimeout(fun){if(cachedSetTimeout===setTimeout){return setTimeout(fun,0)}if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout){cachedSetTimeout=setTimeout;return setTimeout(fun,0)}try{return cachedSetTimeout(fun,0)}catch(e){try{return cachedSetTimeout.call(null,fun,0)}catch(e){return cachedSetTimeout.call(this,fun,0)}}}function runClearTimeout(marker){if(cachedClearTimeout===clearTimeout){return clearTimeout(marker)}if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout){cachedClearTimeout=clearTimeout;return clearTimeout(marker)}try{return cachedClearTimeout(marker)}catch(e){try{return cachedClearTimeout.call(null,marker)}catch(e){return cachedClearTimeout.call(this,marker)}}}var queue=[];var draining=false;var currentQueue;var queueIndex=-1;function cleanUpNextTick(){if(!draining||!currentQueue){return}draining=false;if(currentQueue.length){queue=currentQueue.concat(queue)}else{queueIndex=-1}if(queue.length){drainQueue()}}function drainQueue(){if(draining){return}var timeout=runTimeout(cleanUpNextTick);draining=true;var len=queue.length;while(len){currentQueue=queue;queue=[];while(++queueIndex<len){if(currentQueue){currentQueue[queueIndex].run()}}queueIndex=-1;len=queue.length}currentQueue=null;draining=false;runClearTimeout(timeout)}process.nextTick=function(fun){var args=new Array(arguments.length-1);if(arguments.length>1){for(var i=1;i<arguments.length;i++){args[i-1]=arguments[i]}}queue.push(new Item(fun,args));if(queue.length===1&&!draining){runTimeout(drainQueue)}};function Item(fun,array){this.fun=fun;this.array=array}Item.prototype.run=function(){this.fun.apply(null,this.array)};process.title="browser";process.browser=true;process.env={};process.argv=[];process.version="";process.versions={};function noop(){}process.on=noop;process.addListener=noop;process.once=noop;process.off=noop;process.removeListener=noop;process.removeAllListeners=noop;process.emit=noop;process.prependListener=noop;process.prependOnceListener=noop;process.listeners=function(name){return[]};process.binding=function(name){throw new Error("process.binding is not supported")};process.cwd=function(){return"/"};process.chdir=function(dir){throw new Error("process.chdir is not supported")};process.umask=function(){return 0}},{}],183:[function(require,module,exports){(function(global){(function(){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)
40
40
  /*! https://mths.be/punycode v1.4.1 by @mathias */}(function(root){var freeExports=(typeof exports==="undefined"?"undefined":_typeof(exports))=="object"&&exports&&!exports.nodeType&&exports;var freeModule=(typeof module==="undefined"?"undefined":_typeof(module))=="object"&&module&&!module.nodeType&&module;var freeGlobal=(typeof global==="undefined"?"undefined":_typeof(global))=="object"&&global;if(freeGlobal.global===freeGlobal||freeGlobal.window===freeGlobal||freeGlobal.self===freeGlobal){root=freeGlobal}var punycode,maxInt=2147483647,base=36,tMin=1,tMax=26,skew=38,damp=700,initialBias=72,initialN=128,delimiter="-",regexPunycode=/^xn--/,regexNonASCII=/[^\x20-\x7E]/,regexSeparators=/[\x2E\u3002\uFF0E\uFF61]/g,errors={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},baseMinusTMin=base-tMin,floor=Math.floor,stringFromCharCode=String.fromCharCode,key;function error(type){throw new RangeError(errors[type])}function map(array,fn){var length=array.length;var result=[];while(length--){result[length]=fn(array[length])}return result}function mapDomain(string,fn){var parts=string.split("@");var result="";if(parts.length>1){result=parts[0]+"@";string=parts[1]}string=string.replace(regexSeparators,".");var labels=string.split(".");var encoded=map(labels,fn).join(".");return result+encoded}function ucs2decode(string){var output=[],counter=0,length=string.length,value,extra;while(counter<length){value=string.charCodeAt(counter++);if(value>=55296&&value<=56319&&counter<length){extra=string.charCodeAt(counter++);if((extra&64512)==56320){output.push(((value&1023)<<10)+(extra&1023)+65536)}else{output.push(value);counter--}}else{output.push(value)}}return output}function ucs2encode(array){return map(array,(function(value){var output="";if(value>65535){value-=65536;output+=stringFromCharCode(value>>>10&1023|55296);value=56320|value&1023}output+=stringFromCharCode(value);return output})).join("")}function basicToDigit(codePoint){if(codePoint-48<10){return codePoint-22}if(codePoint-65<26){return codePoint-65}if(codePoint-97<26){return codePoint-97}return base}function digitToBasic(digit,flag){return digit+22+75*(digit<26)-((flag!=0)<<5)}function adapt(delta,numPoints,firstTime){var k=0;delta=firstTime?floor(delta/damp):delta>>1;delta+=floor(delta/numPoints);for(;delta>baseMinusTMin*tMax>>1;k+=base){delta=floor(delta/baseMinusTMin)}return floor(k+(baseMinusTMin+1)*delta/(delta+skew))}function decode(input){var output=[],inputLength=input.length,out,i=0,n=initialN,bias=initialBias,basic,j,index,oldi,w,k,digit,t,baseMinusT;basic=input.lastIndexOf(delimiter);if(basic<0){basic=0}for(j=0;j<basic;++j){if(input.charCodeAt(j)>=128){error("not-basic")}output.push(input.charCodeAt(j))}for(index=basic>0?basic+1:0;index<inputLength;){for(oldi=i,w=1,k=base;;k+=base){if(index>=inputLength){error("invalid-input")}digit=basicToDigit(input.charCodeAt(index++));if(digit>=base||digit>floor((maxInt-i)/w)){error("overflow")}i+=digit*w;t=k<=bias?tMin:k>=bias+tMax?tMax:k-bias;if(digit<t){break}baseMinusT=base-t;if(w>floor(maxInt/baseMinusT)){error("overflow")}w*=baseMinusT}out=output.length+1;bias=adapt(i-oldi,out,oldi==0);if(floor(i/out)>maxInt-n){error("overflow")}n+=floor(i/out);i%=out;output.splice(i++,0,n)}return ucs2encode(output)}function encode(input){var n,delta,handledCPCount,basicLength,bias,j,m,q,k,t,currentValue,output=[],inputLength,handledCPCountPlusOne,baseMinusT,qMinusT;input=ucs2decode(input);inputLength=input.length;n=initialN;delta=0;bias=initialBias;for(j=0;j<inputLength;++j){currentValue=input[j];if(currentValue<128){output.push(stringFromCharCode(currentValue))}}handledCPCount=basicLength=output.length;if(basicLength){output.push(delimiter)}while(handledCPCount<inputLength){for(m=maxInt,j=0;j<inputLength;++j){currentValue=input[j];if(currentValue>=n&&currentValue<m){m=currentValue}}handledCPCountPlusOne=handledCPCount+1;if(m-n>floor((maxInt-delta)/handledCPCountPlusOne)){error("overflow")}delta+=(m-n)*handledCPCountPlusOne;n=m;for(j=0;j<inputLength;++j){currentValue=input[j];if(currentValue<n&&++delta>maxInt){error("overflow")}if(currentValue==n){for(q=delta,k=base;;k+=base){t=k<=bias?tMin:k>=bias+tMax?tMax:k-bias;if(q<t){break}qMinusT=q-t;baseMinusT=base-t;output.push(stringFromCharCode(digitToBasic(t+qMinusT%baseMinusT,0)));q=floor(qMinusT/baseMinusT)}output.push(stringFromCharCode(digitToBasic(q,0)));bias=adapt(delta,handledCPCountPlusOne,handledCPCount==basicLength);delta=0;++handledCPCount}}++delta;++n}return output.join("")}function toUnicode(input){return mapDomain(input,(function(string){return regexPunycode.test(string)?decode(string.slice(4).toLowerCase()):string}))}function toASCII(input){return mapDomain(input,(function(string){return regexNonASCII.test(string)?"xn--"+encode(string):string}))}punycode={version:"1.4.1",ucs2:{decode:ucs2decode,encode:ucs2encode},decode:decode,encode:encode,toASCII:toASCII,toUnicode:toUnicode};if(typeof define=="function"&&_typeof(define.amd)=="object"&&define.amd){define("punycode",(function(){return punycode}))}else if(freeExports&&freeModule){if(module.exports==freeExports){freeModule.exports=punycode}else{for(key in punycode){punycode.hasOwnProperty(key)&&(freeExports[key]=punycode[key])}}}else{root.punycode=punycode}})(void 0)}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],184:[function(require,module,exports){"use strict";function ReInterval(callback,interval,args){var self=this;this._callback=callback;this._args=args;this._interval=setInterval(callback,interval,this._args);this.reschedule=function(interval){if(!interval)interval=self._interval;if(self._interval)clearInterval(self._interval);self._interval=setInterval(self._callback,interval,self._args)};this.clear=function(){if(self._interval){clearInterval(self._interval);self._interval=undefined}};this.destroy=function(){if(self._interval){clearInterval(self._interval)}self._callback=undefined;self._interval=undefined;self._args=undefined}}function reInterval(){if(typeof arguments[0]!=="function")throw new Error("callback needed");if(typeof arguments[1]!=="number")throw new Error("interval needed");var args;if(arguments.length>0){args=new Array(arguments.length-2);for(var i=0;i<args.length;i++){args[i]=arguments[i+2]}}return new ReInterval(arguments[0],arguments[1],args)}module.exports=reInterval},{}],185:[function(require,module,exports){"use strict";module.exports=require("./index.js")()},{"./index.js":186}],186:[function(require,module,exports){(function(Buffer){(function(){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}module.exports=rfdc;function copyBuffer(cur){if(cur instanceof Buffer){return Buffer.from(cur)}return new cur.constructor(cur.buffer.slice(),cur.byteOffset,cur.length)}function rfdc(opts){opts=opts||{};if(opts.circles)return rfdcCircles(opts);return opts.proto?cloneProto:clone;function cloneArray(a,fn){var keys=Object.keys(a);var a2=new Array(keys.length);for(var i=0;i<keys.length;i++){var k=keys[i];var cur=a[k];if(_typeof(cur)!=="object"||cur===null){a2[k]=cur}else if(cur instanceof Date){a2[k]=new Date(cur)}else if(ArrayBuffer.isView(cur)){a2[k]=copyBuffer(cur)}else{a2[k]=fn(cur)}}return a2}function clone(o){if(_typeof(o)!=="object"||o===null)return o;if(o instanceof Date)return new Date(o);if(Array.isArray(o))return cloneArray(o,clone);if(o instanceof Map)return new Map(cloneArray(Array.from(o),clone));if(o instanceof Set)return new Set(cloneArray(Array.from(o),clone));var o2={};for(var k in o){if(Object.hasOwnProperty.call(o,k)===false)continue;var cur=o[k];if(_typeof(cur)!=="object"||cur===null){o2[k]=cur}else if(cur instanceof Date){o2[k]=new Date(cur)}else if(cur instanceof Map){o2[k]=new Map(cloneArray(Array.from(cur),clone))}else if(cur instanceof Set){o2[k]=new Set(cloneArray(Array.from(cur),clone))}else if(ArrayBuffer.isView(cur)){o2[k]=copyBuffer(cur)}else{o2[k]=clone(cur)}}return o2}function cloneProto(o){if(_typeof(o)!=="object"||o===null)return o;if(o instanceof Date)return new Date(o);if(Array.isArray(o))return cloneArray(o,cloneProto);if(o instanceof Map)return new Map(cloneArray(Array.from(o),cloneProto));if(o instanceof Set)return new Set(cloneArray(Array.from(o),cloneProto));var o2={};for(var k in o){var cur=o[k];if(_typeof(cur)!=="object"||cur===null){o2[k]=cur}else if(cur instanceof Date){o2[k]=new Date(cur)}else if(cur instanceof Map){o2[k]=new Map(cloneArray(Array.from(cur),cloneProto))}else if(cur instanceof Set){o2[k]=new Set(cloneArray(Array.from(cur),cloneProto))}else if(ArrayBuffer.isView(cur)){o2[k]=copyBuffer(cur)}else{o2[k]=cloneProto(cur)}}return o2}}function rfdcCircles(opts){var refs=[];var refsNew=[];return opts.proto?cloneProto:clone;function cloneArray(a,fn){var keys=Object.keys(a);var a2=new Array(keys.length);for(var i=0;i<keys.length;i++){var k=keys[i];var cur=a[k];if(_typeof(cur)!=="object"||cur===null){a2[k]=cur}else if(cur instanceof Date){a2[k]=new Date(cur)}else if(ArrayBuffer.isView(cur)){a2[k]=copyBuffer(cur)}else{var index=refs.indexOf(cur);if(index!==-1){a2[k]=refsNew[index]}else{a2[k]=fn(cur)}}}return a2}function clone(o){if(_typeof(o)!=="object"||o===null)return o;if(o instanceof Date)return new Date(o);if(Array.isArray(o))return cloneArray(o,clone);if(o instanceof Map)return new Map(cloneArray(Array.from(o),clone));if(o instanceof Set)return new Set(cloneArray(Array.from(o),clone));var o2={};refs.push(o);refsNew.push(o2);for(var k in o){if(Object.hasOwnProperty.call(o,k)===false)continue;var cur=o[k];if(_typeof(cur)!=="object"||cur===null){o2[k]=cur}else if(cur instanceof Date){o2[k]=new Date(cur)}else if(cur instanceof Map){o2[k]=new Map(cloneArray(Array.from(cur),clone))}else if(cur instanceof Set){o2[k]=new Set(cloneArray(Array.from(cur),clone))}else if(ArrayBuffer.isView(cur)){o2[k]=copyBuffer(cur)}else{var i=refs.indexOf(cur);if(i!==-1){o2[k]=refsNew[i]}else{o2[k]=clone(cur)}}}refs.pop();refsNew.pop();return o2}function cloneProto(o){if(_typeof(o)!=="object"||o===null)return o;if(o instanceof Date)return new Date(o);if(Array.isArray(o))return cloneArray(o,cloneProto);if(o instanceof Map)return new Map(cloneArray(Array.from(o),cloneProto));if(o instanceof Set)return new Set(cloneArray(Array.from(o),cloneProto));var o2={};refs.push(o);refsNew.push(o2);for(var k in o){var cur=o[k];if(_typeof(cur)!=="object"||cur===null){o2[k]=cur}else if(cur instanceof Date){o2[k]=new Date(cur)}else if(cur instanceof Map){o2[k]=new Map(cloneArray(Array.from(cur),cloneProto))}else if(cur instanceof Set){o2[k]=new Set(cloneArray(Array.from(cur),cloneProto))}else if(ArrayBuffer.isView(cur)){o2[k]=copyBuffer(cur)}else{var i=refs.indexOf(cur);if(i!==-1){o2[k]=refsNew[i]}else{o2[k]=cloneProto(cur)}}}refs.pop();refsNew.pop();return o2}}}).call(this)}).call(this,require("buffer").Buffer)},{buffer:74}],187:[function(require,module,exports){"use strict";
41
- /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var buffer=require("buffer");var Buffer=buffer.Buffer;function copyProps(src,dst){for(var key in src){dst[key]=src[key]}}if(Buffer.from&&Buffer.alloc&&Buffer.allocUnsafe&&Buffer.allocUnsafeSlow){module.exports=buffer}else{copyProps(buffer,exports);exports.Buffer=SafeBuffer}function SafeBuffer(arg,encodingOrOffset,length){return Buffer(arg,encodingOrOffset,length)}SafeBuffer.prototype=Object.create(Buffer.prototype);copyProps(Buffer,SafeBuffer);SafeBuffer.from=function(arg,encodingOrOffset,length){if(typeof arg==="number"){throw new TypeError("Argument must not be a number")}return Buffer(arg,encodingOrOffset,length)};SafeBuffer.alloc=function(size,fill,encoding){if(typeof size!=="number"){throw new TypeError("Argument must be a number")}var buf=Buffer(size);if(fill!==undefined){if(typeof encoding==="string"){buf.fill(fill,encoding)}else{buf.fill(fill)}}else{buf.fill(0)}return buf};SafeBuffer.allocUnsafe=function(size){if(typeof size!=="number"){throw new TypeError("Argument must be a number")}return Buffer(size)};SafeBuffer.allocUnsafeSlow=function(size){if(typeof size!=="number"){throw new TypeError("Argument must be a number")}return buffer.SlowBuffer(size)}},{buffer:74}],188:[function(require,module,exports){"use strict";var GetIntrinsic=require("get-intrinsic");var define=require("define-data-property");var hasDescriptors=require("has-property-descriptors")();var gOPD=require("gopd");var $TypeError=GetIntrinsic("%TypeError%");var $floor=GetIntrinsic("%Math.floor%");module.exports=function setFunctionLength(fn,length){if(typeof fn!=="function"){throw new $TypeError("`fn` is not a function")}if(typeof length!=="number"||length<0||length>4294967295||$floor(length)!==length){throw new $TypeError("`length` must be a positive 32-bit integer")}var loose=arguments.length>2&&!!arguments[2];var functionLengthIsConfigurable=true;var functionLengthIsWritable=true;if("length"in fn&&gOPD){var desc=gOPD(fn,"length");if(desc&&!desc.configurable){functionLengthIsConfigurable=false}if(desc&&!desc.writable){functionLengthIsWritable=false}}if(functionLengthIsConfigurable||functionLengthIsWritable||!loose){if(hasDescriptors){define(fn,"length",length,true,true)}else{define(fn,"length",length)}}return fn}},{"define-data-property":79,"get-intrinsic":102,gopd:103,"has-property-descriptors":104}],189:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}var GetIntrinsic=require("get-intrinsic");var callBound=require("call-bind/callBound");var inspect=require("object-inspect");var $TypeError=GetIntrinsic("%TypeError%");var $WeakMap=GetIntrinsic("%WeakMap%",true);var $Map=GetIntrinsic("%Map%",true);var $weakMapGet=callBound("WeakMap.prototype.get",true);var $weakMapSet=callBound("WeakMap.prototype.set",true);var $weakMapHas=callBound("WeakMap.prototype.has",true);var $mapGet=callBound("Map.prototype.get",true);var $mapSet=callBound("Map.prototype.set",true);var $mapHas=callBound("Map.prototype.has",true);var listGetNode=function listGetNode(list,key){for(var prev=list,curr;(curr=prev.next)!==null;prev=curr){if(curr.key===key){prev.next=curr.next;curr.next=list.next;list.next=curr;return curr}}};var listGet=function listGet(objects,key){var node=listGetNode(objects,key);return node&&node.value};var listSet=function listSet(objects,key,value){var node=listGetNode(objects,key);if(node){node.value=value}else{objects.next={key:key,next:objects.next,value:value}}};var listHas=function listHas(objects,key){return!!listGetNode(objects,key)};module.exports=function getSideChannel(){var $wm;var $m;var $o;var channel={assert:function assert(key){if(!channel.has(key)){throw new $TypeError("Side channel does not contain "+inspect(key))}},get:function get(key){if($WeakMap&&key&&(_typeof(key)==="object"||typeof key==="function")){if($wm){return $weakMapGet($wm,key)}}else if($Map){if($m){return $mapGet($m,key)}}else{if($o){return listGet($o,key)}}},has:function has(key){if($WeakMap&&key&&(_typeof(key)==="object"||typeof key==="function")){if($wm){return $weakMapHas($wm,key)}}else if($Map){if($m){return $mapHas($m,key)}}else{if($o){return listHas($o,key)}}return false},set:function set(key,value){if($WeakMap&&key&&(_typeof(key)==="object"||typeof key==="function")){if(!$wm){$wm=new $WeakMap}$weakMapSet($wm,key,value)}else if($Map){if(!$m){$m=new $Map}$mapSet($m,key,value)}else{if(!$o){$o={key:{},next:null}}listSet($o,key,value)}}};return channel}},{"call-bind/callBound":75,"get-intrinsic":102,"object-inspect":179}],190:[function(require,module,exports){"use strict";module.exports=shift;function shift(stream){var rs=stream._readableState;if(!rs)return null;return rs.objectMode||typeof stream._duplexState==="number"?stream.read():stream.read(getStateLength(rs))}function getStateLength(state){if(state.buffer.length){if(state.buffer.head){return state.buffer.head.data.length}else if(state.buffer.length>0&&state.buffer[0]){return state.buffer[0].length}}return state.length}},{}],191:[function(require,module,exports){"use strict";var Buffer=require("safe-buffer").Buffer;var isEncoding=Buffer.isEncoding||function(encoding){encoding=""+encoding;switch(encoding&&encoding.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function _normalizeEncoding(enc){if(!enc)return"utf8";var retried;while(true){switch(enc){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return enc;default:if(retried)return;enc=(""+enc).toLowerCase();retried=true}}}function normalizeEncoding(enc){var nenc=_normalizeEncoding(enc);if(typeof nenc!=="string"&&(Buffer.isEncoding===isEncoding||!isEncoding(enc)))throw new Error("Unknown encoding: "+enc);return nenc||enc}exports.StringDecoder=StringDecoder;function StringDecoder(encoding){this.encoding=normalizeEncoding(encoding);var nb;switch(this.encoding){case"utf16le":this.text=utf16Text;this.end=utf16End;nb=4;break;case"utf8":this.fillLast=utf8FillLast;nb=4;break;case"base64":this.text=base64Text;this.end=base64End;nb=3;break;default:this.write=simpleWrite;this.end=simpleEnd;return}this.lastNeed=0;this.lastTotal=0;this.lastChar=Buffer.allocUnsafe(nb)}StringDecoder.prototype.write=function(buf){if(buf.length===0)return"";var r;var i;if(this.lastNeed){r=this.fillLast(buf);if(r===undefined)return"";i=this.lastNeed;this.lastNeed=0}else{i=0}if(i<buf.length)return r?r+this.text(buf,i):this.text(buf,i);return r||""};StringDecoder.prototype.end=utf8End;StringDecoder.prototype.text=utf8Text;StringDecoder.prototype.fillLast=function(buf){if(this.lastNeed<=buf.length){buf.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}buf.copy(this.lastChar,this.lastTotal-this.lastNeed,0,buf.length);this.lastNeed-=buf.length};function utf8CheckByte(_byte){if(_byte<=127)return 0;else if(_byte>>5===6)return 2;else if(_byte>>4===14)return 3;else if(_byte>>3===30)return 4;return _byte>>6===2?-1:-2}function utf8CheckIncomplete(self,buf,i){var j=buf.length-1;if(j<i)return 0;var nb=utf8CheckByte(buf[j]);if(nb>=0){if(nb>0)self.lastNeed=nb-1;return nb}if(--j<i||nb===-2)return 0;nb=utf8CheckByte(buf[j]);if(nb>=0){if(nb>0)self.lastNeed=nb-2;return nb}if(--j<i||nb===-2)return 0;nb=utf8CheckByte(buf[j]);if(nb>=0){if(nb>0){if(nb===2)nb=0;else self.lastNeed=nb-3}return nb}return 0}function utf8CheckExtraBytes(self,buf,p){if((buf[0]&192)!==128){self.lastNeed=0;return"�"}if(self.lastNeed>1&&buf.length>1){if((buf[1]&192)!==128){self.lastNeed=1;return"�"}if(self.lastNeed>2&&buf.length>2){if((buf[2]&192)!==128){self.lastNeed=2;return"�"}}}}function utf8FillLast(buf){var p=this.lastTotal-this.lastNeed;var r=utf8CheckExtraBytes(this,buf,p);if(r!==undefined)return r;if(this.lastNeed<=buf.length){buf.copy(this.lastChar,p,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}buf.copy(this.lastChar,p,0,buf.length);this.lastNeed-=buf.length}function utf8Text(buf,i){var total=utf8CheckIncomplete(this,buf,i);if(!this.lastNeed)return buf.toString("utf8",i);this.lastTotal=total;var end=buf.length-(total-this.lastNeed);buf.copy(this.lastChar,0,end);return buf.toString("utf8",i,end)}function utf8End(buf){var r=buf&&buf.length?this.write(buf):"";if(this.lastNeed)return r+"�";return r}function utf16Text(buf,i){if((buf.length-i)%2===0){var r=buf.toString("utf16le",i);if(r){var c=r.charCodeAt(r.length-1);if(c>=55296&&c<=56319){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=buf[buf.length-2];this.lastChar[1]=buf[buf.length-1];return r.slice(0,-1)}}return r}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=buf[buf.length-1];return buf.toString("utf16le",i,buf.length-1)}function utf16End(buf){var r=buf&&buf.length?this.write(buf):"";if(this.lastNeed){var end=this.lastTotal-this.lastNeed;return r+this.lastChar.toString("utf16le",0,end)}return r}function base64Text(buf,i){var n=(buf.length-i)%3;if(n===0)return buf.toString("base64",i);this.lastNeed=3-n;this.lastTotal=3;if(n===1){this.lastChar[0]=buf[buf.length-1]}else{this.lastChar[0]=buf[buf.length-2];this.lastChar[1]=buf[buf.length-1]}return buf.toString("base64",i,buf.length-n)}function base64End(buf){var r=buf&&buf.length?this.write(buf):"";if(this.lastNeed)return r+this.lastChar.toString("base64",0,3-this.lastNeed);return r}function simpleWrite(buf){return buf.toString(this.encoding)}function simpleEnd(buf){return buf&&buf.length?this.write(buf):""}},{"safe-buffer":187}],192:[function(require,module,exports){(function(setImmediate,clearImmediate){(function(){"use strict";var nextTick=require("process/browser.js").nextTick;var apply=Function.prototype.apply;var slice=Array.prototype.slice;var immediateIds={};var nextImmediateId=0;exports.setTimeout=function(){return new Timeout(apply.call(setTimeout,window,arguments),clearTimeout)};exports.setInterval=function(){return new Timeout(apply.call(setInterval,window,arguments),clearInterval)};exports.clearTimeout=exports.clearInterval=function(timeout){timeout.close()};function Timeout(id,clearFn){this._id=id;this._clearFn=clearFn}Timeout.prototype.unref=Timeout.prototype.ref=function(){};Timeout.prototype.close=function(){this._clearFn.call(window,this._id)};exports.enroll=function(item,msecs){clearTimeout(item._idleTimeoutId);item._idleTimeout=msecs};exports.unenroll=function(item){clearTimeout(item._idleTimeoutId);item._idleTimeout=-1};exports._unrefActive=exports.active=function(item){clearTimeout(item._idleTimeoutId);var msecs=item._idleTimeout;if(msecs>=0){item._idleTimeoutId=setTimeout((function onTimeout(){if(item._onTimeout)item._onTimeout()}),msecs)}};exports.setImmediate=typeof setImmediate==="function"?setImmediate:function(fn){var id=nextImmediateId++;var args=arguments.length<2?false:slice.call(arguments,1);immediateIds[id]=true;nextTick((function onNextTick(){if(immediateIds[id]){if(args){fn.apply(null,args)}else{fn.call(null)}exports.clearImmediate(id)}}));return id};exports.clearImmediate=typeof clearImmediate==="function"?clearImmediate:function(id){delete immediateIds[id]}}).call(this)}).call(this,require("timers").setImmediate,require("timers").clearImmediate)},{"process/browser.js":182,timers:192}],193:[function(require,module,exports){"use strict";var sizeof=require("js-sizeof");var TinyCache=function TinyCache(){this._cache={};this._timeouts={};this._hits=0;this._misses=0;this._size=0;return this};TinyCache.prototype={get size(){return this._size},get memsize(){return sizeof(this._cache)},get hits(){return this._hits},get misses(){return this._misses},put:function put(key,value,time){if(this._timeouts[key]){clearTimeout(this._timeouts[key]);delete this._timeouts[key]}this._cache[key]=value;if(!isNaN(time)){this._timeouts[key]=setTimeout(this.del.bind(this,key),time)}++this._size},get:function get(key){if(typeof key==="undefined"){return this._cache}if(!(key in this._cache)){++this._misses;return null}++this._hits;return this._cache[key]},del:function del(key){clearTimeout(this._timeouts[key]);delete this._timeouts[key];if(!(key in this._cache)){return false}delete this._cache[key];--this._size;return true},clear:function clear(){for(var key in this._timeouts){clearTimeout(this._timeouts[key])}this._cache={};this._timeouts={};this._size=0}};TinyCache.shared=new TinyCache;if(typeof module!=="undefined"&&module.exports){module.exports=TinyCache}else if(typeof define==="function"&&define.amd){define([],(function(){return TinyCache}))}else{window.TinyCache=TinyCache}},{"js-sizeof":137}],194:[function(require,module,exports){"use strict";var replace=String.prototype.replace;var percentTwenties=/%20/g;var Format={RFC1738:"RFC1738",RFC3986:"RFC3986"};module.exports={default:Format.RFC3986,formatters:{RFC1738:function RFC1738(value){return replace.call(value,percentTwenties,"+")},RFC3986:function RFC3986(value){return String(value)}},RFC1738:Format.RFC1738,RFC3986:Format.RFC3986}},{}],195:[function(require,module,exports){"use strict";var stringify=require("./stringify");var parse=require("./parse");var formats=require("./formats");module.exports={formats:formats,parse:parse,stringify:stringify}},{"./formats":194,"./parse":196,"./stringify":197}],196:[function(require,module,exports){"use strict";var utils=require("./utils");var has=Object.prototype.hasOwnProperty;var isArray=Array.isArray;var defaults={allowDots:false,allowPrototypes:false,allowSparse:false,arrayLimit:20,charset:"utf-8",charsetSentinel:false,comma:false,decoder:utils.decode,delimiter:"&",depth:5,ignoreQueryPrefix:false,interpretNumericEntities:false,parameterLimit:1e3,parseArrays:true,plainObjects:false,strictNullHandling:false};var interpretNumericEntities=function interpretNumericEntities(str){return str.replace(/&#(\d+);/g,(function($0,numberStr){return String.fromCharCode(parseInt(numberStr,10))}))};var parseArrayValue=function parseArrayValue(val,options){if(val&&typeof val==="string"&&options.comma&&val.indexOf(",")>-1){return val.split(",")}return val};var isoSentinel="utf8=%26%2310003%3B";var charsetSentinel="utf8=%E2%9C%93";var parseValues=function parseQueryStringValues(str,options){var obj={__proto__:null};var cleanStr=options.ignoreQueryPrefix?str.replace(/^\?/,""):str;var limit=options.parameterLimit===Infinity?undefined:options.parameterLimit;var parts=cleanStr.split(options.delimiter,limit);var skipIndex=-1;var i;var charset=options.charset;if(options.charsetSentinel){for(i=0;i<parts.length;++i){if(parts[i].indexOf("utf8=")===0){if(parts[i]===charsetSentinel){charset="utf-8"}else if(parts[i]===isoSentinel){charset="iso-8859-1"}skipIndex=i;i=parts.length}}}for(i=0;i<parts.length;++i){if(i===skipIndex){continue}var part=parts[i];var bracketEqualsPos=part.indexOf("]=");var pos=bracketEqualsPos===-1?part.indexOf("="):bracketEqualsPos+1;var key,val;if(pos===-1){key=options.decoder(part,defaults.decoder,charset,"key");val=options.strictNullHandling?null:""}else{key=options.decoder(part.slice(0,pos),defaults.decoder,charset,"key");val=utils.maybeMap(parseArrayValue(part.slice(pos+1),options),(function(encodedVal){return options.decoder(encodedVal,defaults.decoder,charset,"value")}))}if(val&&options.interpretNumericEntities&&charset==="iso-8859-1"){val=interpretNumericEntities(val)}if(part.indexOf("[]=")>-1){val=isArray(val)?[val]:val}if(has.call(obj,key)){obj[key]=utils.combine(obj[key],val)}else{obj[key]=val}}return obj};var parseObject=function parseObject(chain,val,options,valuesParsed){var leaf=valuesParsed?val:parseArrayValue(val,options);for(var i=chain.length-1;i>=0;--i){var obj;var root=chain[i];if(root==="[]"&&options.parseArrays){obj=[].concat(leaf)}else{obj=options.plainObjects?Object.create(null):{};var cleanRoot=root.charAt(0)==="["&&root.charAt(root.length-1)==="]"?root.slice(1,-1):root;var index=parseInt(cleanRoot,10);if(!options.parseArrays&&cleanRoot===""){obj={0:leaf}}else if(!isNaN(index)&&root!==cleanRoot&&String(index)===cleanRoot&&index>=0&&options.parseArrays&&index<=options.arrayLimit){obj=[];obj[index]=leaf}else if(cleanRoot!=="__proto__"){obj[cleanRoot]=leaf}}leaf=obj}return leaf};var parseKeys=function parseQueryStringKeys(givenKey,val,options,valuesParsed){if(!givenKey){return}var key=options.allowDots?givenKey.replace(/\.([^.[]+)/g,"[$1]"):givenKey;var brackets=/(\[[^[\]]*])/;var child=/(\[[^[\]]*])/g;var segment=options.depth>0&&brackets.exec(key);var parent=segment?key.slice(0,segment.index):key;var keys=[];if(parent){if(!options.plainObjects&&has.call(Object.prototype,parent)){if(!options.allowPrototypes){return}}keys.push(parent)}var i=0;while(options.depth>0&&(segment=child.exec(key))!==null&&i<options.depth){i+=1;if(!options.plainObjects&&has.call(Object.prototype,segment[1].slice(1,-1))){if(!options.allowPrototypes){return}}keys.push(segment[1])}if(segment){keys.push("["+key.slice(segment.index)+"]")}return parseObject(keys,val,options,valuesParsed)};var normalizeParseOptions=function normalizeParseOptions(opts){if(!opts){return defaults}if(opts.decoder!==null&&opts.decoder!==undefined&&typeof opts.decoder!=="function"){throw new TypeError("Decoder has to be a function.")}if(typeof opts.charset!=="undefined"&&opts.charset!=="utf-8"&&opts.charset!=="iso-8859-1"){throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined")}var charset=typeof opts.charset==="undefined"?defaults.charset:opts.charset;return{allowDots:typeof opts.allowDots==="undefined"?defaults.allowDots:!!opts.allowDots,allowPrototypes:typeof opts.allowPrototypes==="boolean"?opts.allowPrototypes:defaults.allowPrototypes,allowSparse:typeof opts.allowSparse==="boolean"?opts.allowSparse:defaults.allowSparse,arrayLimit:typeof opts.arrayLimit==="number"?opts.arrayLimit:defaults.arrayLimit,charset:charset,charsetSentinel:typeof opts.charsetSentinel==="boolean"?opts.charsetSentinel:defaults.charsetSentinel,comma:typeof opts.comma==="boolean"?opts.comma:defaults.comma,decoder:typeof opts.decoder==="function"?opts.decoder:defaults.decoder,delimiter:typeof opts.delimiter==="string"||utils.isRegExp(opts.delimiter)?opts.delimiter:defaults.delimiter,depth:typeof opts.depth==="number"||opts.depth===false?+opts.depth:defaults.depth,ignoreQueryPrefix:opts.ignoreQueryPrefix===true,interpretNumericEntities:typeof opts.interpretNumericEntities==="boolean"?opts.interpretNumericEntities:defaults.interpretNumericEntities,parameterLimit:typeof opts.parameterLimit==="number"?opts.parameterLimit:defaults.parameterLimit,parseArrays:opts.parseArrays!==false,plainObjects:typeof opts.plainObjects==="boolean"?opts.plainObjects:defaults.plainObjects,strictNullHandling:typeof opts.strictNullHandling==="boolean"?opts.strictNullHandling:defaults.strictNullHandling}};module.exports=function(str,opts){var options=normalizeParseOptions(opts);if(str===""||str===null||typeof str==="undefined"){return options.plainObjects?Object.create(null):{}}var tempObj=typeof str==="string"?parseValues(str,options):str;var obj=options.plainObjects?Object.create(null):{};var keys=Object.keys(tempObj);for(var i=0;i<keys.length;++i){var key=keys[i];var newObj=parseKeys(key,tempObj[key],options,typeof str==="string");obj=utils.merge(obj,newObj,options)}if(options.allowSparse===true){return obj}return utils.compact(obj)}},{"./utils":198}],197:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}var getSideChannel=require("side-channel");var utils=require("./utils");var formats=require("./formats");var has=Object.prototype.hasOwnProperty;var arrayPrefixGenerators={brackets:function brackets(prefix){return prefix+"[]"},comma:"comma",indices:function indices(prefix,key){return prefix+"["+key+"]"},repeat:function repeat(prefix){return prefix}};var isArray=Array.isArray;var push=Array.prototype.push;var pushToArray=function pushToArray(arr,valueOrArray){push.apply(arr,isArray(valueOrArray)?valueOrArray:[valueOrArray])};var toISO=Date.prototype.toISOString;var defaultFormat=formats["default"];var defaults={addQueryPrefix:false,allowDots:false,charset:"utf-8",charsetSentinel:false,delimiter:"&",encode:true,encoder:utils.encode,encodeValuesOnly:false,format:defaultFormat,formatter:formats.formatters[defaultFormat],indices:false,serializeDate:function serializeDate(date){return toISO.call(date)},skipNulls:false,strictNullHandling:false};var isNonNullishPrimitive=function isNonNullishPrimitive(v){return typeof v==="string"||typeof v==="number"||typeof v==="boolean"||_typeof(v)==="symbol"||typeof v==="bigint"};var sentinel={};var stringify=function stringify(object,prefix,generateArrayPrefix,commaRoundTrip,strictNullHandling,skipNulls,encoder,filter,sort,allowDots,serializeDate,format,formatter,encodeValuesOnly,charset,sideChannel){var obj=object;var tmpSc=sideChannel;var step=0;var findFlag=false;while((tmpSc=tmpSc.get(sentinel))!==void undefined&&!findFlag){var pos=tmpSc.get(object);step+=1;if(typeof pos!=="undefined"){if(pos===step){throw new RangeError("Cyclic object value")}else{findFlag=true}}if(typeof tmpSc.get(sentinel)==="undefined"){step=0}}if(typeof filter==="function"){obj=filter(prefix,obj)}else if(obj instanceof Date){obj=serializeDate(obj)}else if(generateArrayPrefix==="comma"&&isArray(obj)){obj=utils.maybeMap(obj,(function(value){if(value instanceof Date){return serializeDate(value)}return value}))}if(obj===null){if(strictNullHandling){return encoder&&!encodeValuesOnly?encoder(prefix,defaults.encoder,charset,"key",format):prefix}obj=""}if(isNonNullishPrimitive(obj)||utils.isBuffer(obj)){if(encoder){var keyValue=encodeValuesOnly?prefix:encoder(prefix,defaults.encoder,charset,"key",format);return[formatter(keyValue)+"="+formatter(encoder(obj,defaults.encoder,charset,"value",format))]}return[formatter(prefix)+"="+formatter(String(obj))]}var values=[];if(typeof obj==="undefined"){return values}var objKeys;if(generateArrayPrefix==="comma"&&isArray(obj)){if(encodeValuesOnly&&encoder){obj=utils.maybeMap(obj,encoder)}objKeys=[{value:obj.length>0?obj.join(",")||null:void undefined}]}else if(isArray(filter)){objKeys=filter}else{var keys=Object.keys(obj);objKeys=sort?keys.sort(sort):keys}var adjustedPrefix=commaRoundTrip&&isArray(obj)&&obj.length===1?prefix+"[]":prefix;for(var j=0;j<objKeys.length;++j){var key=objKeys[j];var value=_typeof(key)==="object"&&typeof key.value!=="undefined"?key.value:obj[key];if(skipNulls&&value===null){continue}var keyPrefix=isArray(obj)?typeof generateArrayPrefix==="function"?generateArrayPrefix(adjustedPrefix,key):adjustedPrefix:adjustedPrefix+(allowDots?"."+key:"["+key+"]");sideChannel.set(object,step);var valueSideChannel=getSideChannel();valueSideChannel.set(sentinel,sideChannel);pushToArray(values,stringify(value,keyPrefix,generateArrayPrefix,commaRoundTrip,strictNullHandling,skipNulls,generateArrayPrefix==="comma"&&encodeValuesOnly&&isArray(obj)?null:encoder,filter,sort,allowDots,serializeDate,format,formatter,encodeValuesOnly,charset,valueSideChannel))}return values};var normalizeStringifyOptions=function normalizeStringifyOptions(opts){if(!opts){return defaults}if(opts.encoder!==null&&typeof opts.encoder!=="undefined"&&typeof opts.encoder!=="function"){throw new TypeError("Encoder has to be a function.")}var charset=opts.charset||defaults.charset;if(typeof opts.charset!=="undefined"&&opts.charset!=="utf-8"&&opts.charset!=="iso-8859-1"){throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined")}var format=formats["default"];if(typeof opts.format!=="undefined"){if(!has.call(formats.formatters,opts.format)){throw new TypeError("Unknown format option provided.")}format=opts.format}var formatter=formats.formatters[format];var filter=defaults.filter;if(typeof opts.filter==="function"||isArray(opts.filter)){filter=opts.filter}return{addQueryPrefix:typeof opts.addQueryPrefix==="boolean"?opts.addQueryPrefix:defaults.addQueryPrefix,allowDots:typeof opts.allowDots==="undefined"?defaults.allowDots:!!opts.allowDots,charset:charset,charsetSentinel:typeof opts.charsetSentinel==="boolean"?opts.charsetSentinel:defaults.charsetSentinel,delimiter:typeof opts.delimiter==="undefined"?defaults.delimiter:opts.delimiter,encode:typeof opts.encode==="boolean"?opts.encode:defaults.encode,encoder:typeof opts.encoder==="function"?opts.encoder:defaults.encoder,encodeValuesOnly:typeof opts.encodeValuesOnly==="boolean"?opts.encodeValuesOnly:defaults.encodeValuesOnly,filter:filter,format:format,formatter:formatter,serializeDate:typeof opts.serializeDate==="function"?opts.serializeDate:defaults.serializeDate,skipNulls:typeof opts.skipNulls==="boolean"?opts.skipNulls:defaults.skipNulls,sort:typeof opts.sort==="function"?opts.sort:null,strictNullHandling:typeof opts.strictNullHandling==="boolean"?opts.strictNullHandling:defaults.strictNullHandling}};module.exports=function(object,opts){var obj=object;var options=normalizeStringifyOptions(opts);var objKeys;var filter;if(typeof options.filter==="function"){filter=options.filter;obj=filter("",obj)}else if(isArray(options.filter)){filter=options.filter;objKeys=filter}var keys=[];if(_typeof(obj)!=="object"||obj===null){return""}var arrayFormat;if(opts&&opts.arrayFormat in arrayPrefixGenerators){arrayFormat=opts.arrayFormat}else if(opts&&"indices"in opts){arrayFormat=opts.indices?"indices":"repeat"}else{arrayFormat="indices"}var generateArrayPrefix=arrayPrefixGenerators[arrayFormat];if(opts&&"commaRoundTrip"in opts&&typeof opts.commaRoundTrip!=="boolean"){throw new TypeError("`commaRoundTrip` must be a boolean, or absent")}var commaRoundTrip=generateArrayPrefix==="comma"&&opts&&opts.commaRoundTrip;if(!objKeys){objKeys=Object.keys(obj)}if(options.sort){objKeys.sort(options.sort)}var sideChannel=getSideChannel();for(var i=0;i<objKeys.length;++i){var key=objKeys[i];if(options.skipNulls&&obj[key]===null){continue}pushToArray(keys,stringify(obj[key],key,generateArrayPrefix,commaRoundTrip,options.strictNullHandling,options.skipNulls,options.encode?options.encoder:null,options.filter,options.sort,options.allowDots,options.serializeDate,options.format,options.formatter,options.encodeValuesOnly,options.charset,sideChannel))}var joined=keys.join(options.delimiter);var prefix=options.addQueryPrefix===true?"?":"";if(options.charsetSentinel){if(options.charset==="iso-8859-1"){prefix+="utf8=%26%2310003%3B&"}else{prefix+="utf8=%E2%9C%93&"}}return joined.length>0?prefix+joined:""}},{"./formats":194,"./utils":198,"side-channel":189}],198:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}var formats=require("./formats");var has=Object.prototype.hasOwnProperty;var isArray=Array.isArray;var hexTable=function(){var array=[];for(var i=0;i<256;++i){array.push("%"+((i<16?"0":"")+i.toString(16)).toUpperCase())}return array}();var compactQueue=function compactQueue(queue){while(queue.length>1){var item=queue.pop();var obj=item.obj[item.prop];if(isArray(obj)){var compacted=[];for(var j=0;j<obj.length;++j){if(typeof obj[j]!=="undefined"){compacted.push(obj[j])}}item.obj[item.prop]=compacted}}};var arrayToObject=function arrayToObject(source,options){var obj=options&&options.plainObjects?Object.create(null):{};for(var i=0;i<source.length;++i){if(typeof source[i]!=="undefined"){obj[i]=source[i]}}return obj};var merge=function merge(target,source,options){if(!source){return target}if(_typeof(source)!=="object"){if(isArray(target)){target.push(source)}else if(target&&_typeof(target)==="object"){if(options&&(options.plainObjects||options.allowPrototypes)||!has.call(Object.prototype,source)){target[source]=true}}else{return[target,source]}return target}if(!target||_typeof(target)!=="object"){return[target].concat(source)}var mergeTarget=target;if(isArray(target)&&!isArray(source)){mergeTarget=arrayToObject(target,options)}if(isArray(target)&&isArray(source)){source.forEach((function(item,i){if(has.call(target,i)){var targetItem=target[i];if(targetItem&&_typeof(targetItem)==="object"&&item&&_typeof(item)==="object"){target[i]=merge(targetItem,item,options)}else{target.push(item)}}else{target[i]=item}}));return target}return Object.keys(source).reduce((function(acc,key){var value=source[key];if(has.call(acc,key)){acc[key]=merge(acc[key],value,options)}else{acc[key]=value}return acc}),mergeTarget)};var assign=function assignSingleSource(target,source){return Object.keys(source).reduce((function(acc,key){acc[key]=source[key];return acc}),target)};var decode=function decode(str,decoder,charset){var strWithoutPlus=str.replace(/\+/g," ");if(charset==="iso-8859-1"){return strWithoutPlus.replace(/%[0-9a-f]{2}/gi,unescape)}try{return decodeURIComponent(strWithoutPlus)}catch(e){return strWithoutPlus}};var encode=function encode(str,defaultEncoder,charset,kind,format){if(str.length===0){return str}var string=str;if(_typeof(str)==="symbol"){string=Symbol.prototype.toString.call(str)}else if(typeof str!=="string"){string=String(str)}if(charset==="iso-8859-1"){return escape(string).replace(/%u[0-9a-f]{4}/gi,(function($0){return"%26%23"+parseInt($0.slice(2),16)+"%3B"}))}var out="";for(var i=0;i<string.length;++i){var c=string.charCodeAt(i);if(c===45||c===46||c===95||c===126||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||format===formats.RFC1738&&(c===40||c===41)){out+=string.charAt(i);continue}if(c<128){out=out+hexTable[c];continue}if(c<2048){out=out+(hexTable[192|c>>6]+hexTable[128|c&63]);continue}if(c<55296||c>=57344){out=out+(hexTable[224|c>>12]+hexTable[128|c>>6&63]+hexTable[128|c&63]);continue}i+=1;c=65536+((c&1023)<<10|string.charCodeAt(i)&1023);out+=hexTable[240|c>>18]+hexTable[128|c>>12&63]+hexTable[128|c>>6&63]+hexTable[128|c&63]}return out};var compact=function compact(value){var queue=[{obj:{o:value},prop:"o"}];var refs=[];for(var i=0;i<queue.length;++i){var item=queue[i];var obj=item.obj[item.prop];var keys=Object.keys(obj);for(var j=0;j<keys.length;++j){var key=keys[j];var val=obj[key];if(_typeof(val)==="object"&&val!==null&&refs.indexOf(val)===-1){queue.push({obj:obj,prop:key});refs.push(val)}}}compactQueue(queue);return value};var isRegExp=function isRegExp(obj){return Object.prototype.toString.call(obj)==="[object RegExp]"};var isBuffer=function isBuffer(obj){if(!obj||_typeof(obj)!=="object"){return false}return!!(obj.constructor&&obj.constructor.isBuffer&&obj.constructor.isBuffer(obj))};var combine=function combine(a,b){return[].concat(a,b)};var maybeMap=function maybeMap(val,fn){if(isArray(val)){var mapped=[];for(var i=0;i<val.length;i+=1){mapped.push(fn(val[i]))}return mapped}return fn(val)};module.exports={arrayToObject:arrayToObject,assign:assign,combine:combine,compact:compact,decode:decode,encode:encode,isBuffer:isBuffer,isRegExp:isRegExp,maybeMap:maybeMap,merge:merge}},{"./formats":194}],199:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}var punycode=require("punycode");function Url(){this.protocol=null;this.slashes=null;this.auth=null;this.host=null;this.port=null;this.hostname=null;this.hash=null;this.search=null;this.query=null;this.pathname=null;this.path=null;this.href=null}var protocolPattern=/^([a-z0-9.+-]+:)/i,portPattern=/:[0-9]*$/,simplePathPattern=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,delims=["<",">",'"',"`"," ","\r","\n","\t"],unwise=["{","}","|","\\","^","`"].concat(delims),autoEscape=["'"].concat(unwise),nonHostChars=["%","/","?",";","#"].concat(autoEscape),hostEndingChars=["/","?","#"],hostnameMaxLen=255,hostnamePartPattern=/^[+a-z0-9A-Z_-]{0,63}$/,hostnamePartStart=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,unsafeProtocol={javascript:true,"javascript:":true},hostlessProtocol={javascript:true,"javascript:":true},slashedProtocol={http:true,https:true,ftp:true,gopher:true,file:true,"http:":true,"https:":true,"ftp:":true,"gopher:":true,"file:":true},querystring=require("qs");function urlParse(url,parseQueryString,slashesDenoteHost){if(url&&_typeof(url)==="object"&&url instanceof Url){return url}var u=new Url;u.parse(url,parseQueryString,slashesDenoteHost);return u}Url.prototype.parse=function(url,parseQueryString,slashesDenoteHost){if(typeof url!=="string"){throw new TypeError("Parameter 'url' must be a string, not "+_typeof(url))}var queryIndex=url.indexOf("?"),splitter=queryIndex!==-1&&queryIndex<url.indexOf("#")?"?":"#",uSplit=url.split(splitter),slashRegex=/\\/g;uSplit[0]=uSplit[0].replace(slashRegex,"/");url=uSplit.join(splitter);var rest=url;rest=rest.trim();if(!slashesDenoteHost&&url.split("#").length===1){var simplePath=simplePathPattern.exec(rest);if(simplePath){this.path=rest;this.href=rest;this.pathname=simplePath[1];if(simplePath[2]){this.search=simplePath[2];if(parseQueryString){this.query=querystring.parse(this.search.substr(1))}else{this.query=this.search.substr(1)}}else if(parseQueryString){this.search="";this.query={}}return this}}var proto=protocolPattern.exec(rest);if(proto){proto=proto[0];var lowerProto=proto.toLowerCase();this.protocol=lowerProto;rest=rest.substr(proto.length)}if(slashesDenoteHost||proto||rest.match(/^\/\/[^@/]+@[^@/]+/)){var slashes=rest.substr(0,2)==="//";if(slashes&&!(proto&&hostlessProtocol[proto])){rest=rest.substr(2);this.slashes=true}}if(!hostlessProtocol[proto]&&(slashes||proto&&!slashedProtocol[proto])){var hostEnd=-1;for(var i=0;i<hostEndingChars.length;i++){var hec=rest.indexOf(hostEndingChars[i]);if(hec!==-1&&(hostEnd===-1||hec<hostEnd)){hostEnd=hec}}var auth,atSign;if(hostEnd===-1){atSign=rest.lastIndexOf("@")}else{atSign=rest.lastIndexOf("@",hostEnd)}if(atSign!==-1){auth=rest.slice(0,atSign);rest=rest.slice(atSign+1);this.auth=decodeURIComponent(auth)}hostEnd=-1;for(var i=0;i<nonHostChars.length;i++){var hec=rest.indexOf(nonHostChars[i]);if(hec!==-1&&(hostEnd===-1||hec<hostEnd)){hostEnd=hec}}if(hostEnd===-1){hostEnd=rest.length}this.host=rest.slice(0,hostEnd);rest=rest.slice(hostEnd);this.parseHost();this.hostname=this.hostname||"";var ipv6Hostname=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!ipv6Hostname){var hostparts=this.hostname.split(/\./);for(var i=0,l=hostparts.length;i<l;i++){var part=hostparts[i];if(!part){continue}if(!part.match(hostnamePartPattern)){var newpart="";for(var j=0,k=part.length;j<k;j++){if(part.charCodeAt(j)>127){newpart+="x"}else{newpart+=part[j]}}if(!newpart.match(hostnamePartPattern)){var validParts=hostparts.slice(0,i);var notHost=hostparts.slice(i+1);var bit=part.match(hostnamePartStart);if(bit){validParts.push(bit[1]);notHost.unshift(bit[2])}if(notHost.length){rest="/"+notHost.join(".")+rest}this.hostname=validParts.join(".");break}}}}if(this.hostname.length>hostnameMaxLen){this.hostname=""}else{this.hostname=this.hostname.toLowerCase()}if(!ipv6Hostname){this.hostname=punycode.toASCII(this.hostname)}var p=this.port?":"+this.port:"";var h=this.hostname||"";this.host=h+p;this.href+=this.host;if(ipv6Hostname){this.hostname=this.hostname.substr(1,this.hostname.length-2);if(rest[0]!=="/"){rest="/"+rest}}}if(!unsafeProtocol[lowerProto]){for(var i=0,l=autoEscape.length;i<l;i++){var ae=autoEscape[i];if(rest.indexOf(ae)===-1){continue}var esc=encodeURIComponent(ae);if(esc===ae){esc=escape(ae)}rest=rest.split(ae).join(esc)}}var hash=rest.indexOf("#");if(hash!==-1){this.hash=rest.substr(hash);rest=rest.slice(0,hash)}var qm=rest.indexOf("?");if(qm!==-1){this.search=rest.substr(qm);this.query=rest.substr(qm+1);if(parseQueryString){this.query=querystring.parse(this.query)}rest=rest.slice(0,qm)}else if(parseQueryString){this.search="";this.query={}}if(rest){this.pathname=rest}if(slashedProtocol[lowerProto]&&this.hostname&&!this.pathname){this.pathname="/"}if(this.pathname||this.search){var p=this.pathname||"";var s=this.search||"";this.path=p+s}this.href=this.format();return this};function urlFormat(obj){if(typeof obj==="string"){obj=urlParse(obj)}if(!(obj instanceof Url)){return Url.prototype.format.call(obj)}return obj.format()}Url.prototype.format=function(){var auth=this.auth||"";if(auth){auth=encodeURIComponent(auth);auth=auth.replace(/%3A/i,":");auth+="@"}var protocol=this.protocol||"",pathname=this.pathname||"",hash=this.hash||"",host=false,query="";if(this.host){host=auth+this.host}else if(this.hostname){host=auth+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]");if(this.port){host+=":"+this.port}}if(this.query&&_typeof(this.query)==="object"&&Object.keys(this.query).length){query=querystring.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:false})}var search=this.search||query&&"?"+query||"";if(protocol&&protocol.substr(-1)!==":"){protocol+=":"}if(this.slashes||(!protocol||slashedProtocol[protocol])&&host!==false){host="//"+(host||"");if(pathname&&pathname.charAt(0)!=="/"){pathname="/"+pathname}}else if(!host){host=""}if(hash&&hash.charAt(0)!=="#"){hash="#"+hash}if(search&&search.charAt(0)!=="?"){search="?"+search}pathname=pathname.replace(/[?#]/g,(function(match){return encodeURIComponent(match)}));search=search.replace("#","%23");return protocol+host+pathname+search+hash};function urlResolve(source,relative){return urlParse(source,false,true).resolve(relative)}Url.prototype.resolve=function(relative){return this.resolveObject(urlParse(relative,false,true)).format()};function urlResolveObject(source,relative){if(!source){return relative}return urlParse(source,false,true).resolveObject(relative)}Url.prototype.resolveObject=function(relative){if(typeof relative==="string"){var rel=new Url;rel.parse(relative,false,true);relative=rel}var result=new Url;var tkeys=Object.keys(this);for(var tk=0;tk<tkeys.length;tk++){var tkey=tkeys[tk];result[tkey]=this[tkey]}result.hash=relative.hash;if(relative.href===""){result.href=result.format();return result}if(relative.slashes&&!relative.protocol){var rkeys=Object.keys(relative);for(var rk=0;rk<rkeys.length;rk++){var rkey=rkeys[rk];if(rkey!=="protocol"){result[rkey]=relative[rkey]}}if(slashedProtocol[result.protocol]&&result.hostname&&!result.pathname){result.pathname="/";result.path=result.pathname}result.href=result.format();return result}if(relative.protocol&&relative.protocol!==result.protocol){if(!slashedProtocol[relative.protocol]){var keys=Object.keys(relative);for(var v=0;v<keys.length;v++){var k=keys[v];result[k]=relative[k]}result.href=result.format();return result}result.protocol=relative.protocol;if(!relative.host&&!hostlessProtocol[relative.protocol]){var relPath=(relative.pathname||"").split("/");while(relPath.length&&!(relative.host=relPath.shift())){}if(!relative.host){relative.host=""}if(!relative.hostname){relative.hostname=""}if(relPath[0]!==""){relPath.unshift("")}if(relPath.length<2){relPath.unshift("")}result.pathname=relPath.join("/")}else{result.pathname=relative.pathname}result.search=relative.search;result.query=relative.query;result.host=relative.host||"";result.auth=relative.auth;result.hostname=relative.hostname||relative.host;result.port=relative.port;if(result.pathname||result.search){var p=result.pathname||"";var s=result.search||"";result.path=p+s}result.slashes=result.slashes||relative.slashes;result.href=result.format();return result}var isSourceAbs=result.pathname&&result.pathname.charAt(0)==="/",isRelAbs=relative.host||relative.pathname&&relative.pathname.charAt(0)==="/",mustEndAbs=isRelAbs||isSourceAbs||result.host&&relative.pathname,removeAllDots=mustEndAbs,srcPath=result.pathname&&result.pathname.split("/")||[],relPath=relative.pathname&&relative.pathname.split("/")||[],psychotic=result.protocol&&!slashedProtocol[result.protocol];if(psychotic){result.hostname="";result.port=null;if(result.host){if(srcPath[0]===""){srcPath[0]=result.host}else{srcPath.unshift(result.host)}}result.host="";if(relative.protocol){relative.hostname=null;relative.port=null;if(relative.host){if(relPath[0]===""){relPath[0]=relative.host}else{relPath.unshift(relative.host)}}relative.host=null}mustEndAbs=mustEndAbs&&(relPath[0]===""||srcPath[0]==="")}if(isRelAbs){result.host=relative.host||relative.host===""?relative.host:result.host;result.hostname=relative.hostname||relative.hostname===""?relative.hostname:result.hostname;result.search=relative.search;result.query=relative.query;srcPath=relPath}else if(relPath.length){if(!srcPath){srcPath=[]}srcPath.pop();srcPath=srcPath.concat(relPath);result.search=relative.search;result.query=relative.query}else if(relative.search!=null){if(psychotic){result.host=srcPath.shift();result.hostname=result.host;var authInHost=result.host&&result.host.indexOf("@")>0?result.host.split("@"):false;if(authInHost){result.auth=authInHost.shift();result.hostname=authInHost.shift();result.host=result.hostname}}result.search=relative.search;result.query=relative.query;if(result.pathname!==null||result.search!==null){result.path=(result.pathname?result.pathname:"")+(result.search?result.search:"")}result.href=result.format();return result}if(!srcPath.length){result.pathname=null;if(result.search){result.path="/"+result.search}else{result.path=null}result.href=result.format();return result}var last=srcPath.slice(-1)[0];var hasTrailingSlash=(result.host||relative.host||srcPath.length>1)&&(last==="."||last==="..")||last==="";var up=0;for(var i=srcPath.length;i>=0;i--){last=srcPath[i];if(last==="."){srcPath.splice(i,1)}else if(last===".."){srcPath.splice(i,1);up++}else if(up){srcPath.splice(i,1);up--}}if(!mustEndAbs&&!removeAllDots){for(;up--;up){srcPath.unshift("..")}}if(mustEndAbs&&srcPath[0]!==""&&(!srcPath[0]||srcPath[0].charAt(0)!=="/")){srcPath.unshift("")}if(hasTrailingSlash&&srcPath.join("/").substr(-1)!=="/"){srcPath.push("")}var isAbsolute=srcPath[0]===""||srcPath[0]&&srcPath[0].charAt(0)==="/";if(psychotic){result.hostname=isAbsolute?"":srcPath.length?srcPath.shift():"";result.host=result.hostname;var authInHost=result.host&&result.host.indexOf("@")>0?result.host.split("@"):false;if(authInHost){result.auth=authInHost.shift();result.hostname=authInHost.shift();result.host=result.hostname}}mustEndAbs=mustEndAbs||result.host&&srcPath.length;if(mustEndAbs&&!isAbsolute){srcPath.unshift("")}if(srcPath.length>0){result.pathname=srcPath.join("/")}else{result.pathname=null;result.path=null}if(result.pathname!==null||result.search!==null){result.path=(result.pathname?result.pathname:"")+(result.search?result.search:"")}result.auth=relative.auth||result.auth;result.slashes=result.slashes||relative.slashes;result.href=result.format();return result};Url.prototype.parseHost=function(){var host=this.host;var port=portPattern.exec(host);if(port){port=port[0];if(port!==":"){this.port=port.substr(1)}host=host.substr(0,host.length-port.length)}if(host){this.hostname=host}};exports.parse=urlParse;exports.resolve=urlResolve;exports.resolveObject=urlResolveObject;exports.format=urlFormat;exports.Url=Url},{punycode:183,qs:195}],200:[function(require,module,exports){(function(global){(function(){"use strict";module.exports=deprecate;function deprecate(fn,msg){if(config("noDeprecation")){return fn}var warned=false;function deprecated(){if(!warned){if(config("throwDeprecation")){throw new Error(msg)}else if(config("traceDeprecation")){console.trace(msg)}else{console.warn(msg)}warned=true}return fn.apply(this,arguments)}return deprecated}function config(name){try{if(!global.localStorage)return false}catch(_){return false}var val=global.localStorage[name];if(null==val)return false;return String(val).toLowerCase()==="true"}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],201:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}module.exports=function isBuffer(arg){return arg&&_typeof(arg)==="object"&&typeof arg.copy==="function"&&typeof arg.fill==="function"&&typeof arg.readUInt8==="function"}},{}],202:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}var isArgumentsObject=require("is-arguments");var isGeneratorFunction=require("is-generator-function");var whichTypedArray=require("which-typed-array");var isTypedArray=require("is-typed-array");function uncurryThis(f){return f.call.bind(f)}var BigIntSupported=typeof BigInt!=="undefined";var SymbolSupported=typeof Symbol!=="undefined";var ObjectToString=uncurryThis(Object.prototype.toString);var numberValue=uncurryThis(Number.prototype.valueOf);var stringValue=uncurryThis(String.prototype.valueOf);var booleanValue=uncurryThis(Boolean.prototype.valueOf);if(BigIntSupported){var bigIntValue=uncurryThis(BigInt.prototype.valueOf)}if(SymbolSupported){var symbolValue=uncurryThis(Symbol.prototype.valueOf)}function checkBoxedPrimitive(value,prototypeValueOf){if(_typeof(value)!=="object"){return false}try{prototypeValueOf(value);return true}catch(e){return false}}exports.isArgumentsObject=isArgumentsObject;exports.isGeneratorFunction=isGeneratorFunction;exports.isTypedArray=isTypedArray;function isPromise(input){return typeof Promise!=="undefined"&&input instanceof Promise||input!==null&&_typeof(input)==="object"&&typeof input.then==="function"&&typeof input["catch"]==="function"}exports.isPromise=isPromise;function isArrayBufferView(value){if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView){return ArrayBuffer.isView(value)}return isTypedArray(value)||isDataView(value)}exports.isArrayBufferView=isArrayBufferView;function isUint8Array(value){return whichTypedArray(value)==="Uint8Array"}exports.isUint8Array=isUint8Array;function isUint8ClampedArray(value){return whichTypedArray(value)==="Uint8ClampedArray"}exports.isUint8ClampedArray=isUint8ClampedArray;function isUint16Array(value){return whichTypedArray(value)==="Uint16Array"}exports.isUint16Array=isUint16Array;function isUint32Array(value){return whichTypedArray(value)==="Uint32Array"}exports.isUint32Array=isUint32Array;function isInt8Array(value){return whichTypedArray(value)==="Int8Array"}exports.isInt8Array=isInt8Array;function isInt16Array(value){return whichTypedArray(value)==="Int16Array"}exports.isInt16Array=isInt16Array;function isInt32Array(value){return whichTypedArray(value)==="Int32Array"}exports.isInt32Array=isInt32Array;function isFloat32Array(value){return whichTypedArray(value)==="Float32Array"}exports.isFloat32Array=isFloat32Array;function isFloat64Array(value){return whichTypedArray(value)==="Float64Array"}exports.isFloat64Array=isFloat64Array;function isBigInt64Array(value){return whichTypedArray(value)==="BigInt64Array"}exports.isBigInt64Array=isBigInt64Array;function isBigUint64Array(value){return whichTypedArray(value)==="BigUint64Array"}exports.isBigUint64Array=isBigUint64Array;function isMapToString(value){return ObjectToString(value)==="[object Map]"}isMapToString.working=typeof Map!=="undefined"&&isMapToString(new Map);function isMap(value){if(typeof Map==="undefined"){return false}return isMapToString.working?isMapToString(value):value instanceof Map}exports.isMap=isMap;function isSetToString(value){return ObjectToString(value)==="[object Set]"}isSetToString.working=typeof Set!=="undefined"&&isSetToString(new Set);function isSet(value){if(typeof Set==="undefined"){return false}return isSetToString.working?isSetToString(value):value instanceof Set}exports.isSet=isSet;function isWeakMapToString(value){return ObjectToString(value)==="[object WeakMap]"}isWeakMapToString.working=typeof WeakMap!=="undefined"&&isWeakMapToString(new WeakMap);function isWeakMap(value){if(typeof WeakMap==="undefined"){return false}return isWeakMapToString.working?isWeakMapToString(value):value instanceof WeakMap}exports.isWeakMap=isWeakMap;function isWeakSetToString(value){return ObjectToString(value)==="[object WeakSet]"}isWeakSetToString.working=typeof WeakSet!=="undefined"&&isWeakSetToString(new WeakSet);function isWeakSet(value){return isWeakSetToString(value)}exports.isWeakSet=isWeakSet;function isArrayBufferToString(value){return ObjectToString(value)==="[object ArrayBuffer]"}isArrayBufferToString.working=typeof ArrayBuffer!=="undefined"&&isArrayBufferToString(new ArrayBuffer);function isArrayBuffer(value){if(typeof ArrayBuffer==="undefined"){return false}return isArrayBufferToString.working?isArrayBufferToString(value):value instanceof ArrayBuffer}exports.isArrayBuffer=isArrayBuffer;function isDataViewToString(value){return ObjectToString(value)==="[object DataView]"}isDataViewToString.working=typeof ArrayBuffer!=="undefined"&&typeof DataView!=="undefined"&&isDataViewToString(new DataView(new ArrayBuffer(1),0,1));function isDataView(value){if(typeof DataView==="undefined"){return false}return isDataViewToString.working?isDataViewToString(value):value instanceof DataView}exports.isDataView=isDataView;var SharedArrayBufferCopy=typeof SharedArrayBuffer!=="undefined"?SharedArrayBuffer:undefined;function isSharedArrayBufferToString(value){return ObjectToString(value)==="[object SharedArrayBuffer]"}function isSharedArrayBuffer(value){if(typeof SharedArrayBufferCopy==="undefined"){return false}if(typeof isSharedArrayBufferToString.working==="undefined"){isSharedArrayBufferToString.working=isSharedArrayBufferToString(new SharedArrayBufferCopy)}return isSharedArrayBufferToString.working?isSharedArrayBufferToString(value):value instanceof SharedArrayBufferCopy}exports.isSharedArrayBuffer=isSharedArrayBuffer;function isAsyncFunction(value){return ObjectToString(value)==="[object AsyncFunction]"}exports.isAsyncFunction=isAsyncFunction;function isMapIterator(value){return ObjectToString(value)==="[object Map Iterator]"}exports.isMapIterator=isMapIterator;function isSetIterator(value){return ObjectToString(value)==="[object Set Iterator]"}exports.isSetIterator=isSetIterator;function isGeneratorObject(value){return ObjectToString(value)==="[object Generator]"}exports.isGeneratorObject=isGeneratorObject;function isWebAssemblyCompiledModule(value){return ObjectToString(value)==="[object WebAssembly.Module]"}exports.isWebAssemblyCompiledModule=isWebAssemblyCompiledModule;function isNumberObject(value){return checkBoxedPrimitive(value,numberValue)}exports.isNumberObject=isNumberObject;function isStringObject(value){return checkBoxedPrimitive(value,stringValue)}exports.isStringObject=isStringObject;function isBooleanObject(value){return checkBoxedPrimitive(value,booleanValue)}exports.isBooleanObject=isBooleanObject;function isBigIntObject(value){return BigIntSupported&&checkBoxedPrimitive(value,bigIntValue)}exports.isBigIntObject=isBigIntObject;function isSymbolObject(value){return SymbolSupported&&checkBoxedPrimitive(value,symbolValue)}exports.isSymbolObject=isSymbolObject;function isBoxedPrimitive(value){return isNumberObject(value)||isStringObject(value)||isBooleanObject(value)||isBigIntObject(value)||isSymbolObject(value)}exports.isBoxedPrimitive=isBoxedPrimitive;function isAnyArrayBuffer(value){return typeof Uint8Array!=="undefined"&&(isArrayBuffer(value)||isSharedArrayBuffer(value))}exports.isAnyArrayBuffer=isAnyArrayBuffer;["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(method){Object.defineProperty(exports,method,{enumerable:false,value:function value(){throw new Error(method+" is not supported in userland")}})}))},{"is-arguments":112,"is-generator-function":115,"is-typed-array":116,"which-typed-array":220}],203:[function(require,module,exports){(function(process){(function(){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}var getOwnPropertyDescriptors=Object.getOwnPropertyDescriptors||function getOwnPropertyDescriptors(obj){var keys=Object.keys(obj);var descriptors={};for(var i=0;i<keys.length;i++){descriptors[keys[i]]=Object.getOwnPropertyDescriptor(obj,keys[i])}return descriptors};var formatRegExp=/%[sdj%]/g;exports.format=function(f){if(!isString(f)){var objects=[];for(var i=0;i<arguments.length;i++){objects.push(inspect(arguments[i]))}return objects.join(" ")}var i=1;var args=arguments;var len=args.length;var str=String(f).replace(formatRegExp,(function(x){if(x==="%%")return"%";if(i>=len)return x;switch(x){case"%s":return String(args[i++]);case"%d":return Number(args[i++]);case"%j":try{return JSON.stringify(args[i++])}catch(_){return"[Circular]"}default:return x}}));for(var x=args[i];i<len;x=args[++i]){if(isNull(x)||!isObject(x)){str+=" "+x}else{str+=" "+inspect(x)}}return str};exports.deprecate=function(fn,msg){if(typeof process!=="undefined"&&process.noDeprecation===true){return fn}if(typeof process==="undefined"){return function(){return exports.deprecate(fn,msg).apply(this,arguments)}}var warned=false;function deprecated(){if(!warned){if(process.throwDeprecation){throw new Error(msg)}else if(process.traceDeprecation){console.trace(msg)}else{console.error(msg)}warned=true}return fn.apply(this,arguments)}return deprecated};var debugs={};var debugEnvRegex=/^$/;if(process.env.NODE_DEBUG){var debugEnv=process.env.NODE_DEBUG;debugEnv=debugEnv.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase();debugEnvRegex=new RegExp("^"+debugEnv+"$","i")}exports.debuglog=function(set){set=set.toUpperCase();if(!debugs[set]){if(debugEnvRegex.test(set)){var pid=process.pid;debugs[set]=function(){var msg=exports.format.apply(exports,arguments);console.error("%s %d: %s",set,pid,msg)}}else{debugs[set]=function(){}}}return debugs[set]};function inspect(obj,opts){var ctx={seen:[],stylize:stylizeNoColor};if(arguments.length>=3)ctx.depth=arguments[2];if(arguments.length>=4)ctx.colors=arguments[3];if(isBoolean(opts)){ctx.showHidden=opts}else if(opts){exports._extend(ctx,opts)}if(isUndefined(ctx.showHidden))ctx.showHidden=false;if(isUndefined(ctx.depth))ctx.depth=2;if(isUndefined(ctx.colors))ctx.colors=false;if(isUndefined(ctx.customInspect))ctx.customInspect=true;if(ctx.colors)ctx.stylize=stylizeWithColor;return formatValue(ctx,obj,ctx.depth)}exports.inspect=inspect;inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};inspect.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function stylizeWithColor(str,styleType){var style=inspect.styles[styleType];if(style){return"["+inspect.colors[style][0]+"m"+str+"["+inspect.colors[style][1]+"m"}else{return str}}function stylizeNoColor(str,styleType){return str}function arrayToHash(array){var hash={};array.forEach((function(val,idx){hash[val]=true}));return hash}function formatValue(ctx,value,recurseTimes){if(ctx.customInspect&&value&&isFunction(value.inspect)&&value.inspect!==exports.inspect&&!(value.constructor&&value.constructor.prototype===value)){var ret=value.inspect(recurseTimes,ctx);if(!isString(ret)){ret=formatValue(ctx,ret,recurseTimes)}return ret}var primitive=formatPrimitive(ctx,value);if(primitive){return primitive}var keys=Object.keys(value);var visibleKeys=arrayToHash(keys);if(ctx.showHidden){keys=Object.getOwnPropertyNames(value)}if(isError(value)&&(keys.indexOf("message")>=0||keys.indexOf("description")>=0)){return formatError(value)}if(keys.length===0){if(isFunction(value)){var name=value.name?": "+value.name:"";return ctx.stylize("[Function"+name+"]","special")}if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}if(isDate(value)){return ctx.stylize(Date.prototype.toString.call(value),"date")}if(isError(value)){return formatError(value)}}var base="",array=false,braces=["{","}"];if(isArray(value)){array=true;braces=["[","]"]}if(isFunction(value)){var n=value.name?": "+value.name:"";base=" [Function"+n+"]"}if(isRegExp(value)){base=" "+RegExp.prototype.toString.call(value)}if(isDate(value)){base=" "+Date.prototype.toUTCString.call(value)}if(isError(value)){base=" "+formatError(value)}if(keys.length===0&&(!array||value.length==0)){return braces[0]+base+braces[1]}if(recurseTimes<0){if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}else{return ctx.stylize("[Object]","special")}}ctx.seen.push(value);var output;if(array){output=formatArray(ctx,value,recurseTimes,visibleKeys,keys)}else{output=keys.map((function(key){return formatProperty(ctx,value,recurseTimes,visibleKeys,key,array)}))}ctx.seen.pop();return reduceToSingleString(output,base,braces)}function formatPrimitive(ctx,value){if(isUndefined(value))return ctx.stylize("undefined","undefined");if(isString(value)){var simple="'"+JSON.stringify(value).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return ctx.stylize(simple,"string")}if(isNumber(value))return ctx.stylize(""+value,"number");if(isBoolean(value))return ctx.stylize(""+value,"boolean");if(isNull(value))return ctx.stylize("null","null")}function formatError(value){return"["+Error.prototype.toString.call(value)+"]"}function formatArray(ctx,value,recurseTimes,visibleKeys,keys){var output=[];for(var i=0,l=value.length;i<l;++i){if(hasOwnProperty(value,String(i))){output.push(formatProperty(ctx,value,recurseTimes,visibleKeys,String(i),true))}else{output.push("")}}keys.forEach((function(key){if(!key.match(/^\d+$/)){output.push(formatProperty(ctx,value,recurseTimes,visibleKeys,key,true))}}));return output}function formatProperty(ctx,value,recurseTimes,visibleKeys,key,array){var name,str,desc;desc=Object.getOwnPropertyDescriptor(value,key)||{value:value[key]};if(desc.get){if(desc.set){str=ctx.stylize("[Getter/Setter]","special")}else{str=ctx.stylize("[Getter]","special")}}else{if(desc.set){str=ctx.stylize("[Setter]","special")}}if(!hasOwnProperty(visibleKeys,key)){name="["+key+"]"}if(!str){if(ctx.seen.indexOf(desc.value)<0){if(isNull(recurseTimes)){str=formatValue(ctx,desc.value,null)}else{str=formatValue(ctx,desc.value,recurseTimes-1)}if(str.indexOf("\n")>-1){if(array){str=str.split("\n").map((function(line){return" "+line})).join("\n").slice(2)}else{str="\n"+str.split("\n").map((function(line){return" "+line})).join("\n")}}}else{str=ctx.stylize("[Circular]","special")}}if(isUndefined(name)){if(array&&key.match(/^\d+$/)){return str}name=JSON.stringify(""+key);if(name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){name=name.slice(1,-1);name=ctx.stylize(name,"name")}else{name=name.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");name=ctx.stylize(name,"string")}}return name+": "+str}function reduceToSingleString(output,base,braces){var numLinesEst=0;var length=output.reduce((function(prev,cur){numLinesEst++;if(cur.indexOf("\n")>=0)numLinesEst++;return prev+cur.replace(/\u001b\[\d\d?m/g,"").length+1}),0);if(length>60){return braces[0]+(base===""?"":base+"\n ")+" "+output.join(",\n ")+" "+braces[1]}return braces[0]+base+" "+output.join(", ")+" "+braces[1]}exports.types=require("./support/types");function isArray(ar){return Array.isArray(ar)}exports.isArray=isArray;function isBoolean(arg){return typeof arg==="boolean"}exports.isBoolean=isBoolean;function isNull(arg){return arg===null}exports.isNull=isNull;function isNullOrUndefined(arg){return arg==null}exports.isNullOrUndefined=isNullOrUndefined;function isNumber(arg){return typeof arg==="number"}exports.isNumber=isNumber;function isString(arg){return typeof arg==="string"}exports.isString=isString;function isSymbol(arg){return _typeof(arg)==="symbol"}exports.isSymbol=isSymbol;function isUndefined(arg){return arg===void 0}exports.isUndefined=isUndefined;function isRegExp(re){return isObject(re)&&objectToString(re)==="[object RegExp]"}exports.isRegExp=isRegExp;exports.types.isRegExp=isRegExp;function isObject(arg){return _typeof(arg)==="object"&&arg!==null}exports.isObject=isObject;function isDate(d){return isObject(d)&&objectToString(d)==="[object Date]"}exports.isDate=isDate;exports.types.isDate=isDate;function isError(e){return isObject(e)&&(objectToString(e)==="[object Error]"||e instanceof Error)}exports.isError=isError;exports.types.isNativeError=isError;function isFunction(arg){return typeof arg==="function"}exports.isFunction=isFunction;function isPrimitive(arg){return arg===null||typeof arg==="boolean"||typeof arg==="number"||typeof arg==="string"||_typeof(arg)==="symbol"||typeof arg==="undefined"}exports.isPrimitive=isPrimitive;exports.isBuffer=require("./support/isBuffer");function objectToString(o){return Object.prototype.toString.call(o)}function pad(n){return n<10?"0"+n.toString(10):n.toString(10)}var months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function timestamp(){var d=new Date;var time=[pad(d.getHours()),pad(d.getMinutes()),pad(d.getSeconds())].join(":");return[d.getDate(),months[d.getMonth()],time].join(" ")}exports.log=function(){console.log("%s - %s",timestamp(),exports.format.apply(exports,arguments))};exports.inherits=require("inherits");exports._extend=function(origin,add){if(!add||!isObject(add))return origin;var keys=Object.keys(add);var i=keys.length;while(i--){origin[keys[i]]=add[keys[i]]}return origin};function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}var kCustomPromisifiedSymbol=typeof Symbol!=="undefined"?Symbol("util.promisify.custom"):undefined;exports.promisify=function promisify(original){if(typeof original!=="function")throw new TypeError('The "original" argument must be of type Function');if(kCustomPromisifiedSymbol&&original[kCustomPromisifiedSymbol]){var fn=original[kCustomPromisifiedSymbol];if(typeof fn!=="function"){throw new TypeError('The "util.promisify.custom" argument must be of type Function')}Object.defineProperty(fn,kCustomPromisifiedSymbol,{value:fn,enumerable:false,writable:false,configurable:true});return fn}function fn(){var promiseResolve,promiseReject;var promise=new Promise((function(resolve,reject){promiseResolve=resolve;promiseReject=reject}));var args=[];for(var i=0;i<arguments.length;i++){args.push(arguments[i])}args.push((function(err,value){if(err){promiseReject(err)}else{promiseResolve(value)}}));try{original.apply(this,args)}catch(err){promiseReject(err)}return promise}Object.setPrototypeOf(fn,Object.getPrototypeOf(original));if(kCustomPromisifiedSymbol)Object.defineProperty(fn,kCustomPromisifiedSymbol,{value:fn,enumerable:false,writable:false,configurable:true});return Object.defineProperties(fn,getOwnPropertyDescriptors(original))};exports.promisify.custom=kCustomPromisifiedSymbol;function callbackifyOnRejected(reason,cb){if(!reason){var newReason=new Error("Promise was rejected with a falsy value");newReason.reason=reason;reason=newReason}return cb(reason)}function callbackify(original){if(typeof original!=="function"){throw new TypeError('The "original" argument must be of type Function')}function callbackified(){var args=[];for(var i=0;i<arguments.length;i++){args.push(arguments[i])}var maybeCb=args.pop();if(typeof maybeCb!=="function"){throw new TypeError("The last argument must be of type Function")}var self=this;var cb=function cb(){return maybeCb.apply(self,arguments)};original.apply(this,args).then((function(ret){process.nextTick(cb.bind(null,null,ret))}),(function(rej){process.nextTick(callbackifyOnRejected.bind(null,rej,cb))}))}Object.setPrototypeOf(callbackified,Object.getPrototypeOf(original));Object.defineProperties(callbackified,getOwnPropertyDescriptors(original));return callbackified}exports.callbackify=callbackify}).call(this)}).call(this,require("_process"))},{"./support/isBuffer":201,"./support/types":202,_process:182,inherits:111}],204:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"NIL",{enumerable:true,get:function get(){return _nil["default"]}});Object.defineProperty(exports,"parse",{enumerable:true,get:function get(){return _parse["default"]}});Object.defineProperty(exports,"stringify",{enumerable:true,get:function get(){return _stringify["default"]}});Object.defineProperty(exports,"v1",{enumerable:true,get:function get(){return _v["default"]}});Object.defineProperty(exports,"v3",{enumerable:true,get:function get(){return _v2["default"]}});Object.defineProperty(exports,"v4",{enumerable:true,get:function get(){return _v3["default"]}});Object.defineProperty(exports,"v5",{enumerable:true,get:function get(){return _v4["default"]}});Object.defineProperty(exports,"validate",{enumerable:true,get:function get(){return _validate["default"]}});Object.defineProperty(exports,"version",{enumerable:true,get:function get(){return _version["default"]}});var _v=_interopRequireDefault(require("./v1.js"));var _v2=_interopRequireDefault(require("./v3.js"));var _v3=_interopRequireDefault(require("./v4.js"));var _v4=_interopRequireDefault(require("./v5.js"));var _nil=_interopRequireDefault(require("./nil.js"));var _version=_interopRequireDefault(require("./version.js"));var _validate=_interopRequireDefault(require("./validate.js"));var _stringify=_interopRequireDefault(require("./stringify.js"));var _parse=_interopRequireDefault(require("./parse.js"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}},{"./nil.js":207,"./parse.js":208,"./stringify.js":212,"./v1.js":213,"./v3.js":214,"./v4.js":216,"./v5.js":217,"./validate.js":218,"./version.js":219}],205:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;function md5(bytes){if(typeof bytes==="string"){var msg=unescape(encodeURIComponent(bytes));bytes=new Uint8Array(msg.length);for(var i=0;i<msg.length;++i){bytes[i]=msg.charCodeAt(i)}}return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes),bytes.length*8))}function md5ToHexEncodedArray(input){var output=[];var length32=input.length*32;var hexTab="0123456789abcdef";for(var i=0;i<length32;i+=8){var x=input[i>>5]>>>i%32&255;var hex=parseInt(hexTab.charAt(x>>>4&15)+hexTab.charAt(x&15),16);output.push(hex)}return output}function getOutputLength(inputLength8){return(inputLength8+64>>>9<<4)+14+1}function wordsToMd5(x,len){x[len>>5]|=128<<len%32;x[getOutputLength(len)-1]=len;var a=1732584193;var b=-271733879;var c=-1732584194;var d=271733878;for(var i=0;i<x.length;i+=16){var olda=a;var oldb=b;var oldc=c;var oldd=d;a=md5ff(a,b,c,d,x[i],7,-680876936);d=md5ff(d,a,b,c,x[i+1],12,-389564586);c=md5ff(c,d,a,b,x[i+2],17,606105819);b=md5ff(b,c,d,a,x[i+3],22,-1044525330);a=md5ff(a,b,c,d,x[i+4],7,-176418897);d=md5ff(d,a,b,c,x[i+5],12,1200080426);c=md5ff(c,d,a,b,x[i+6],17,-1473231341);b=md5ff(b,c,d,a,x[i+7],22,-45705983);a=md5ff(a,b,c,d,x[i+8],7,1770035416);d=md5ff(d,a,b,c,x[i+9],12,-1958414417);c=md5ff(c,d,a,b,x[i+10],17,-42063);b=md5ff(b,c,d,a,x[i+11],22,-1990404162);a=md5ff(a,b,c,d,x[i+12],7,1804603682);d=md5ff(d,a,b,c,x[i+13],12,-40341101);c=md5ff(c,d,a,b,x[i+14],17,-1502002290);b=md5ff(b,c,d,a,x[i+15],22,1236535329);a=md5gg(a,b,c,d,x[i+1],5,-165796510);d=md5gg(d,a,b,c,x[i+6],9,-1069501632);c=md5gg(c,d,a,b,x[i+11],14,643717713);b=md5gg(b,c,d,a,x[i],20,-373897302);a=md5gg(a,b,c,d,x[i+5],5,-701558691);d=md5gg(d,a,b,c,x[i+10],9,38016083);c=md5gg(c,d,a,b,x[i+15],14,-660478335);b=md5gg(b,c,d,a,x[i+4],20,-405537848);a=md5gg(a,b,c,d,x[i+9],5,568446438);d=md5gg(d,a,b,c,x[i+14],9,-1019803690);c=md5gg(c,d,a,b,x[i+3],14,-187363961);b=md5gg(b,c,d,a,x[i+8],20,1163531501);a=md5gg(a,b,c,d,x[i+13],5,-1444681467);d=md5gg(d,a,b,c,x[i+2],9,-51403784);c=md5gg(c,d,a,b,x[i+7],14,1735328473);b=md5gg(b,c,d,a,x[i+12],20,-1926607734);a=md5hh(a,b,c,d,x[i+5],4,-378558);d=md5hh(d,a,b,c,x[i+8],11,-2022574463);c=md5hh(c,d,a,b,x[i+11],16,1839030562);b=md5hh(b,c,d,a,x[i+14],23,-35309556);a=md5hh(a,b,c,d,x[i+1],4,-1530992060);d=md5hh(d,a,b,c,x[i+4],11,1272893353);c=md5hh(c,d,a,b,x[i+7],16,-155497632);b=md5hh(b,c,d,a,x[i+10],23,-1094730640);a=md5hh(a,b,c,d,x[i+13],4,681279174);d=md5hh(d,a,b,c,x[i],11,-358537222);c=md5hh(c,d,a,b,x[i+3],16,-722521979);b=md5hh(b,c,d,a,x[i+6],23,76029189);a=md5hh(a,b,c,d,x[i+9],4,-640364487);d=md5hh(d,a,b,c,x[i+12],11,-421815835);c=md5hh(c,d,a,b,x[i+15],16,530742520);b=md5hh(b,c,d,a,x[i+2],23,-995338651);a=md5ii(a,b,c,d,x[i],6,-198630844);d=md5ii(d,a,b,c,x[i+7],10,1126891415);c=md5ii(c,d,a,b,x[i+14],15,-1416354905);b=md5ii(b,c,d,a,x[i+5],21,-57434055);a=md5ii(a,b,c,d,x[i+12],6,1700485571);d=md5ii(d,a,b,c,x[i+3],10,-1894986606);c=md5ii(c,d,a,b,x[i+10],15,-1051523);b=md5ii(b,c,d,a,x[i+1],21,-2054922799);a=md5ii(a,b,c,d,x[i+8],6,1873313359);d=md5ii(d,a,b,c,x[i+15],10,-30611744);c=md5ii(c,d,a,b,x[i+6],15,-1560198380);b=md5ii(b,c,d,a,x[i+13],21,1309151649);a=md5ii(a,b,c,d,x[i+4],6,-145523070);d=md5ii(d,a,b,c,x[i+11],10,-1120210379);c=md5ii(c,d,a,b,x[i+2],15,718787259);b=md5ii(b,c,d,a,x[i+9],21,-343485551);a=safeAdd(a,olda);b=safeAdd(b,oldb);c=safeAdd(c,oldc);d=safeAdd(d,oldd)}return[a,b,c,d]}function bytesToWords(input){if(input.length===0){return[]}var length8=input.length*8;var output=new Uint32Array(getOutputLength(length8));for(var i=0;i<length8;i+=8){output[i>>5]|=(input[i/8]&255)<<i%32}return output}function safeAdd(x,y){var lsw=(x&65535)+(y&65535);var msw=(x>>16)+(y>>16)+(lsw>>16);return msw<<16|lsw&65535}function bitRotateLeft(num,cnt){return num<<cnt|num>>>32-cnt}function md5cmn(q,a,b,x,s,t){return safeAdd(bitRotateLeft(safeAdd(safeAdd(a,q),safeAdd(x,t)),s),b)}function md5ff(a,b,c,d,x,s,t){return md5cmn(b&c|~b&d,a,b,x,s,t)}function md5gg(a,b,c,d,x,s,t){return md5cmn(b&d|c&~d,a,b,x,s,t)}function md5hh(a,b,c,d,x,s,t){return md5cmn(b^c^d,a,b,x,s,t)}function md5ii(a,b,c,d,x,s,t){return md5cmn(c^(b|~d),a,b,x,s,t)}var _default=md5;exports["default"]=_default},{}],206:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var randomUUID=typeof crypto!=="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);var _default={randomUUID:randomUUID};exports["default"]=_default},{}],207:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _default="00000000-0000-0000-0000-000000000000";exports["default"]=_default},{}],208:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _validate=_interopRequireDefault(require("./validate.js"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function parse(uuid){if(!(0,_validate["default"])(uuid)){throw TypeError("Invalid UUID")}var v;var arr=new Uint8Array(16);arr[0]=(v=parseInt(uuid.slice(0,8),16))>>>24;arr[1]=v>>>16&255;arr[2]=v>>>8&255;arr[3]=v&255;arr[4]=(v=parseInt(uuid.slice(9,13),16))>>>8;arr[5]=v&255;arr[6]=(v=parseInt(uuid.slice(14,18),16))>>>8;arr[7]=v&255;arr[8]=(v=parseInt(uuid.slice(19,23),16))>>>8;arr[9]=v&255;arr[10]=(v=parseInt(uuid.slice(24,36),16))/1099511627776&255;arr[11]=v/4294967296&255;arr[12]=v>>>24&255;arr[13]=v>>>16&255;arr[14]=v>>>8&255;arr[15]=v&255;return arr}var _default=parse;exports["default"]=_default},{"./validate.js":218}],209:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;exports["default"]=_default},{}],210:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=rng;var getRandomValues;var rnds8=new Uint8Array(16);function rng(){if(!getRandomValues){getRandomValues=typeof crypto!=="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto);if(!getRandomValues){throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported")}}return getRandomValues(rnds8)}},{}],211:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;function f(s,x,y,z){switch(s){case 0:return x&y^~x&z;case 1:return x^y^z;case 2:return x&y^x&z^y&z;case 3:return x^y^z}}function ROTL(x,n){return x<<n|x>>>32-n}function sha1(bytes){var K=[1518500249,1859775393,2400959708,3395469782];var H=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof bytes==="string"){var msg=unescape(encodeURIComponent(bytes));bytes=[];for(var i=0;i<msg.length;++i){bytes.push(msg.charCodeAt(i))}}else if(!Array.isArray(bytes)){bytes=Array.prototype.slice.call(bytes)}bytes.push(128);var l=bytes.length/4+2;var N=Math.ceil(l/16);var M=new Array(N);for(var _i=0;_i<N;++_i){var arr=new Uint32Array(16);for(var j=0;j<16;++j){arr[j]=bytes[_i*64+j*4]<<24|bytes[_i*64+j*4+1]<<16|bytes[_i*64+j*4+2]<<8|bytes[_i*64+j*4+3]}M[_i]=arr}M[N-1][14]=(bytes.length-1)*8/Math.pow(2,32);M[N-1][14]=Math.floor(M[N-1][14]);M[N-1][15]=(bytes.length-1)*8&4294967295;for(var _i2=0;_i2<N;++_i2){var W=new Uint32Array(80);for(var t=0;t<16;++t){W[t]=M[_i2][t]}for(var _t=16;_t<80;++_t){W[_t]=ROTL(W[_t-3]^W[_t-8]^W[_t-14]^W[_t-16],1)}var a=H[0];var b=H[1];var c=H[2];var d=H[3];var e=H[4];for(var _t2=0;_t2<80;++_t2){var s=Math.floor(_t2/20);var T=ROTL(a,5)+f(s,b,c,d)+e+K[s]+W[_t2]>>>0;e=d;d=c;c=ROTL(b,30)>>>0;b=a;a=T}H[0]=H[0]+a>>>0;H[1]=H[1]+b>>>0;H[2]=H[2]+c>>>0;H[3]=H[3]+d>>>0;H[4]=H[4]+e>>>0}return[H[0]>>24&255,H[0]>>16&255,H[0]>>8&255,H[0]&255,H[1]>>24&255,H[1]>>16&255,H[1]>>8&255,H[1]&255,H[2]>>24&255,H[2]>>16&255,H[2]>>8&255,H[2]&255,H[3]>>24&255,H[3]>>16&255,H[3]>>8&255,H[3]&255,H[4]>>24&255,H[4]>>16&255,H[4]>>8&255,H[4]&255]}var _default=sha1;exports["default"]=_default},{}],212:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;exports.unsafeStringify=unsafeStringify;var _validate=_interopRequireDefault(require("./validate.js"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var byteToHex=[];for(var i=0;i<256;++i){byteToHex.push((i+256).toString(16).slice(1))}function unsafeStringify(arr){var offset=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;return byteToHex[arr[offset+0]]+byteToHex[arr[offset+1]]+byteToHex[arr[offset+2]]+byteToHex[arr[offset+3]]+"-"+byteToHex[arr[offset+4]]+byteToHex[arr[offset+5]]+"-"+byteToHex[arr[offset+6]]+byteToHex[arr[offset+7]]+"-"+byteToHex[arr[offset+8]]+byteToHex[arr[offset+9]]+"-"+byteToHex[arr[offset+10]]+byteToHex[arr[offset+11]]+byteToHex[arr[offset+12]]+byteToHex[arr[offset+13]]+byteToHex[arr[offset+14]]+byteToHex[arr[offset+15]]}function stringify(arr){var offset=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var uuid=unsafeStringify(arr,offset);if(!(0,_validate["default"])(uuid)){throw TypeError("Stringified UUID is invalid")}return uuid}var _default=stringify;exports["default"]=_default},{"./validate.js":218}],213:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _rng=_interopRequireDefault(require("./rng.js"));var _stringify=require("./stringify.js");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _nodeId;var _clockseq;var _lastMSecs=0;var _lastNSecs=0;function v1(options,buf,offset){var i=buf&&offset||0;var b=buf||new Array(16);options=options||{};var node=options.node||_nodeId;var clockseq=options.clockseq!==undefined?options.clockseq:_clockseq;if(node==null||clockseq==null){var seedBytes=options.random||(options.rng||_rng["default"])();if(node==null){node=_nodeId=[seedBytes[0]|1,seedBytes[1],seedBytes[2],seedBytes[3],seedBytes[4],seedBytes[5]]}if(clockseq==null){clockseq=_clockseq=(seedBytes[6]<<8|seedBytes[7])&16383}}var msecs=options.msecs!==undefined?options.msecs:Date.now();var nsecs=options.nsecs!==undefined?options.nsecs:_lastNSecs+1;var dt=msecs-_lastMSecs+(nsecs-_lastNSecs)/1e4;if(dt<0&&options.clockseq===undefined){clockseq=clockseq+1&16383}if((dt<0||msecs>_lastMSecs)&&options.nsecs===undefined){nsecs=0}if(nsecs>=1e4){throw new Error("uuid.v1(): Can't create more than 10M uuids/sec")}_lastMSecs=msecs;_lastNSecs=nsecs;_clockseq=clockseq;msecs+=122192928e5;var tl=((msecs&268435455)*1e4+nsecs)%4294967296;b[i++]=tl>>>24&255;b[i++]=tl>>>16&255;b[i++]=tl>>>8&255;b[i++]=tl&255;var tmh=msecs/4294967296*1e4&268435455;b[i++]=tmh>>>8&255;b[i++]=tmh&255;b[i++]=tmh>>>24&15|16;b[i++]=tmh>>>16&255;b[i++]=clockseq>>>8|128;b[i++]=clockseq&255;for(var n=0;n<6;++n){b[i+n]=node[n]}return buf||(0,_stringify.unsafeStringify)(b)}var _default=v1;exports["default"]=_default},{"./rng.js":210,"./stringify.js":212}],214:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _v=_interopRequireDefault(require("./v35.js"));var _md=_interopRequireDefault(require("./md5.js"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var v3=(0,_v["default"])("v3",48,_md["default"]);var _default=v3;exports["default"]=_default},{"./md5.js":205,"./v35.js":215}],215:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.URL=exports.DNS=void 0;exports["default"]=v35;var _stringify=require("./stringify.js");var _parse=_interopRequireDefault(require("./parse.js"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function stringToBytes(str){str=unescape(encodeURIComponent(str));var bytes=[];for(var i=0;i<str.length;++i){bytes.push(str.charCodeAt(i))}return bytes}var DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8";exports.DNS=DNS;var URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8";exports.URL=URL;function v35(name,version,hashfunc){function generateUUID(value,namespace,buf,offset){var _namespace;if(typeof value==="string"){value=stringToBytes(value)}if(typeof namespace==="string"){namespace=(0,_parse["default"])(namespace)}if(((_namespace=namespace)===null||_namespace===void 0?void 0:_namespace.length)!==16){throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)")}var bytes=new Uint8Array(16+value.length);bytes.set(namespace);bytes.set(value,namespace.length);bytes=hashfunc(bytes);bytes[6]=bytes[6]&15|version;bytes[8]=bytes[8]&63|128;if(buf){offset=offset||0;for(var i=0;i<16;++i){buf[offset+i]=bytes[i]}return buf}return(0,_stringify.unsafeStringify)(bytes)}try{generateUUID.name=name}catch(err){}generateUUID.DNS=DNS;generateUUID.URL=URL;return generateUUID}},{"./parse.js":208,"./stringify.js":212}],216:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _native=_interopRequireDefault(require("./native.js"));var _rng=_interopRequireDefault(require("./rng.js"));var _stringify=require("./stringify.js");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function v4(options,buf,offset){if(_native["default"].randomUUID&&!buf&&!options){return _native["default"].randomUUID()}options=options||{};var rnds=options.random||(options.rng||_rng["default"])();rnds[6]=rnds[6]&15|64;rnds[8]=rnds[8]&63|128;if(buf){offset=offset||0;for(var i=0;i<16;++i){buf[offset+i]=rnds[i]}return buf}return(0,_stringify.unsafeStringify)(rnds)}var _default=v4;exports["default"]=_default},{"./native.js":206,"./rng.js":210,"./stringify.js":212}],217:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _v=_interopRequireDefault(require("./v35.js"));var _sha=_interopRequireDefault(require("./sha1.js"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var v5=(0,_v["default"])("v5",80,_sha["default"]);var _default=v5;exports["default"]=_default},{"./sha1.js":211,"./v35.js":215}],218:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _regex=_interopRequireDefault(require("./regex.js"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function validate(uuid){return typeof uuid==="string"&&_regex["default"].test(uuid)}var _default=validate;exports["default"]=_default},{"./regex.js":209}],219:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _validate=_interopRequireDefault(require("./validate.js"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function version(uuid){if(!(0,_validate["default"])(uuid)){throw TypeError("Invalid UUID")}return parseInt(uuid.slice(14,15),16)}var _default=version;exports["default"]=_default},{"./validate.js":218}],220:[function(require,module,exports){(function(global){(function(){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}var forEach=require("for-each");var availableTypedArrays=require("available-typed-arrays");var callBind=require("call-bind");var callBound=require("call-bind/callBound");var gOPD=require("gopd");var $toString=callBound("Object.prototype.toString");var hasToStringTag=require("has-tostringtag/shams")();var g=typeof globalThis==="undefined"?global:globalThis;var typedArrays=availableTypedArrays();var $slice=callBound("String.prototype.slice");var getPrototypeOf=Object.getPrototypeOf;var $indexOf=callBound("Array.prototype.indexOf",true)||function indexOf(array,value){for(var i=0;i<array.length;i+=1){if(array[i]===value){return i}}return-1};var cache={__proto__:null};if(hasToStringTag&&gOPD&&getPrototypeOf){forEach(typedArrays,(function(typedArray){var arr=new g[typedArray];if(Symbol.toStringTag in arr){var proto=getPrototypeOf(arr);var descriptor=gOPD(proto,Symbol.toStringTag);if(!descriptor){var superProto=getPrototypeOf(proto);descriptor=gOPD(superProto,Symbol.toStringTag)}cache["$"+typedArray]=callBind(descriptor.get)}}))}else{forEach(typedArrays,(function(typedArray){var arr=new g[typedArray];var fn=arr.slice||arr.set;if(fn){cache["$"+typedArray]=callBind(fn)}}))}var tryTypedArrays=function tryAllTypedArrays(value){var found=false;forEach(cache,(function(getter,typedArray){if(!found){try{if("$"+getter(value)===typedArray){found=$slice(typedArray,1)}}catch(e){}}}));return found};var trySlices=function tryAllSlices(value){var found=false;forEach(cache,(function(getter,name){if(!found){try{getter(value);found=$slice(name,1)}catch(e){}}}));return found};module.exports=function whichTypedArray(value){if(!value||_typeof(value)!=="object"){return false}if(!hasToStringTag){var tag=$slice($toString(value),8,-1);if($indexOf(typedArrays,tag)>-1){return tag}if(tag!=="Object"){return false}return trySlices(value)}if(!gOPD){return null}return tryTypedArrays(value)}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"available-typed-arrays":1,"call-bind":76,"call-bind/callBound":75,"for-each":98,gopd:103,"has-tostringtag/shams":108}],221:[function(require,module,exports){"use strict";module.exports=wrappy;function wrappy(fn,cb){if(fn&&cb)return wrappy(fn)(cb);if(typeof fn!=="function")throw new TypeError("need wrapper function");Object.keys(fn).forEach((function(k){wrapper[k]=fn[k]}));return wrapper;function wrapper(){var args=new Array(arguments.length);for(var i=0;i<args.length;i++){args[i]=arguments[i]}var ret=fn.apply(this,args);var cb=args[args.length-1];if(typeof ret==="function"&&ret!==cb){Object.keys(cb).forEach((function(k){ret[k]=cb[k]}))}return ret}}},{}],222:[function(require,module,exports){"use strict";module.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native "+"WebSocket object")}},{}],223:[function(require,module,exports){"use strict";module.exports=extend;var hasOwnProperty=Object.prototype.hasOwnProperty;function extend(){var target={};for(var i=0;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(hasOwnProperty.call(source,key)){target[key]=source[key]}}}return target}},{}],224:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.composeCollection=composeCollection;var _identity=require("../nodes/identity.js");var _Scalar=require("../nodes/Scalar.js");var _YAMLMap=require("../nodes/YAMLMap.js");var _YAMLSeq=require("../nodes/YAMLSeq.js");var _resolveBlockMap=require("./resolve-block-map.js");var _resolveBlockSeq=require("./resolve-block-seq.js");var _resolveFlowCollection=require("./resolve-flow-collection.js");function resolveCollection(CN,ctx,token,onError,tagName,tag){var coll=token.type==="block-map"?(0,_resolveBlockMap.resolveBlockMap)(CN,ctx,token,onError,tag):token.type==="block-seq"?(0,_resolveBlockSeq.resolveBlockSeq)(CN,ctx,token,onError,tag):(0,_resolveFlowCollection.resolveFlowCollection)(CN,ctx,token,onError,tag);var Coll=coll.constructor;if(tagName==="!"||tagName===Coll.tagName){coll.tag=Coll.tagName;return coll}if(tagName)coll.tag=tagName;return coll}function composeCollection(CN,ctx,token,props,onError){var _tag$resolve,_tag$resolve2,_tag,_tag2;var tagToken=props.tag;var tagName=!tagToken?null:ctx.directives.tagName(tagToken.source,(function(msg){return onError(tagToken,"TAG_RESOLVE_FAILED",msg)}));if(token.type==="block-seq"){var anchor=props.anchor,nl=props.newlineAfterProp;var lastProp=anchor&&tagToken?anchor.offset>tagToken.offset?anchor:tagToken:anchor!==null&&anchor!==void 0?anchor:tagToken;if(lastProp&&(!nl||nl.offset<lastProp.offset)){var message="Missing newline after block sequence props";onError(lastProp,"MISSING_CHAR",message)}}var expType=token.type==="block-map"?"map":token.type==="block-seq"?"seq":token.start.source==="{"?"map":"seq";if(!tagToken||!tagName||tagName==="!"||tagName===_YAMLMap.YAMLMap.tagName&&expType==="map"||tagName===_YAMLSeq.YAMLSeq.tagName&&expType==="seq"){return resolveCollection(CN,ctx,token,onError,tagName)}var tag=ctx.schema.tags.find((function(t){return t.tag===tagName&&t.collection===expType}));if(!tag){var kt=ctx.schema.knownTags[tagName];if(kt&&kt.collection===expType){ctx.schema.tags.push(Object.assign({},kt,{default:false}));tag=kt}else{if(kt!==null&&kt!==void 0&&kt.collection){onError(tagToken,"BAD_COLLECTION_TYPE","".concat(kt.tag," used for ").concat(expType," collection, but expects ").concat(kt.collection),true)}else{onError(tagToken,"TAG_RESOLVE_FAILED","Unresolved tag: ".concat(tagName),true)}return resolveCollection(CN,ctx,token,onError,tagName)}}var coll=resolveCollection(CN,ctx,token,onError,tagName,tag);var res=(_tag$resolve=(_tag$resolve2=(_tag=tag).resolve)===null||_tag$resolve2===void 0?void 0:_tag$resolve2.call(_tag,coll,(function(msg){return onError(tagToken,"TAG_RESOLVE_FAILED",msg)}),ctx.options))!==null&&_tag$resolve!==void 0?_tag$resolve:coll;var node=(0,_identity.isNode)(res)?res:new _Scalar.Scalar(res);node.range=coll.range;node.tag=tagName;if((_tag2=tag)!==null&&_tag2!==void 0&&_tag2.format)node.format=tag.format;return node}},{"../nodes/Scalar.js":252,"../nodes/YAMLMap.js":253,"../nodes/YAMLSeq.js":254,"../nodes/identity.js":256,"./resolve-block-map.js":229,"./resolve-block-seq.js":231,"./resolve-flow-collection.js":233}],225:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.composeDoc=composeDoc;var _Document=require("../doc/Document.js");var _composeNode=require("./compose-node.js");var _resolveEnd=require("./resolve-end.js");var _resolveProps=require("./resolve-props.js");function composeDoc(options,directives,_ref,onError){var offset=_ref.offset,start=_ref.start,value=_ref.value,end=_ref.end;var opts=Object.assign({_directives:directives},options);var doc=new _Document.Document(undefined,opts);var ctx={atRoot:true,directives:doc.directives,options:doc.options,schema:doc.schema};var props=(0,_resolveProps.resolveProps)(start,{indicator:"doc-start",next:value!==null&&value!==void 0?value:end===null||end===void 0?void 0:end[0],offset:offset,onError:onError,parentIndent:0,startOnNewline:true});if(props.found){doc.directives.docStart=true;if(value&&(value.type==="block-map"||value.type==="block-seq")&&!props.hasNewline)onError(props.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}doc.contents=value?(0,_composeNode.composeNode)(ctx,value,props,onError):(0,_composeNode.composeEmptyNode)(ctx,props.end,start,null,props,onError);var contentEnd=doc.contents.range[2];var re=(0,_resolveEnd.resolveEnd)(end,contentEnd,false,onError);if(re.comment)doc.comment=re.comment;doc.range=[offset,contentEnd,re.offset];return doc}},{"../doc/Document.js":240,"./compose-node.js":226,"./resolve-end.js":232,"./resolve-props.js":235}],226:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.composeEmptyNode=composeEmptyNode;exports.composeNode=composeNode;var _Alias=require("../nodes/Alias.js");var _composeCollection=require("./compose-collection.js");var _composeScalar=require("./compose-scalar.js");var _resolveEnd=require("./resolve-end.js");var _utilEmptyScalarPosition=require("./util-empty-scalar-position.js");var CN={composeNode:composeNode,composeEmptyNode:composeEmptyNode};function composeNode(ctx,token,props,onError){var spaceBefore=props.spaceBefore,comment=props.comment,anchor=props.anchor,tag=props.tag;var node;var isSrcToken=true;switch(token.type){case"alias":node=composeAlias(ctx,token,onError);if(anchor||tag)onError(token,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":node=(0,_composeScalar.composeScalar)(ctx,token,tag,onError);if(anchor)node.anchor=anchor.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":node=(0,_composeCollection.composeCollection)(CN,ctx,token,props,onError);if(anchor)node.anchor=anchor.source.substring(1);break;default:{var message=token.type==="error"?token.message:"Unsupported token (type: ".concat(token.type,")");onError(token,"UNEXPECTED_TOKEN",message);node=composeEmptyNode(ctx,token.offset,undefined,null,props,onError);isSrcToken=false}}if(anchor&&node.anchor==="")onError(anchor,"BAD_ALIAS","Anchor cannot be an empty string");if(spaceBefore)node.spaceBefore=true;if(comment){if(token.type==="scalar"&&token.source==="")node.comment=comment;else node.commentBefore=comment}if(ctx.options.keepSourceTokens&&isSrcToken)node.srcToken=token;return node}function composeEmptyNode(ctx,offset,before,pos,_ref,onError){var spaceBefore=_ref.spaceBefore,comment=_ref.comment,anchor=_ref.anchor,tag=_ref.tag,end=_ref.end;var token={type:"scalar",offset:(0,_utilEmptyScalarPosition.emptyScalarPosition)(offset,before,pos),indent:-1,source:""};var node=(0,_composeScalar.composeScalar)(ctx,token,tag,onError);if(anchor){node.anchor=anchor.source.substring(1);if(node.anchor==="")onError(anchor,"BAD_ALIAS","Anchor cannot be an empty string")}if(spaceBefore)node.spaceBefore=true;if(comment){node.comment=comment;node.range[2]=end}return node}function composeAlias(_ref2,_ref3,onError){var options=_ref2.options;var offset=_ref3.offset,source=_ref3.source,end=_ref3.end;var alias=new _Alias.Alias(source.substring(1));if(alias.source==="")onError(offset,"BAD_ALIAS","Alias cannot be an empty string");if(alias.source.endsWith(":"))onError(offset+source.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",true);var valueEnd=offset+source.length;var re=(0,_resolveEnd.resolveEnd)(end,valueEnd,options.strict,onError);alias.range=[offset,valueEnd,re.offset];if(re.comment)alias.comment=re.comment;return alias}},{"../nodes/Alias.js":248,"./compose-collection.js":224,"./compose-scalar.js":227,"./resolve-end.js":232,"./util-empty-scalar-position.js":237}],227:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.composeScalar=composeScalar;var _identity=require("../nodes/identity.js");var _Scalar=require("../nodes/Scalar.js");var _resolveBlockScalar=require("./resolve-block-scalar.js");var _resolveFlowScalar=require("./resolve-flow-scalar.js");function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function composeScalar(ctx,token,tagToken,onError){var _ref=token.type==="block-scalar"?(0,_resolveBlockScalar.resolveBlockScalar)(ctx,token,onError):(0,_resolveFlowScalar.resolveFlowScalar)(token,ctx.options.strict,onError),value=_ref.value,type=_ref.type,comment=_ref.comment,range=_ref.range;var tagName=tagToken?ctx.directives.tagName(tagToken.source,(function(msg){return onError(tagToken,"TAG_RESOLVE_FAILED",msg)})):null;var tag=tagToken&&tagName?findScalarTagByName(ctx.schema,value,tagName,tagToken,onError):token.type==="scalar"?findScalarTagByTest(ctx,value,token,onError):ctx.schema[_identity.SCALAR];var scalar;try{var res=tag.resolve(value,(function(msg){return onError(tagToken!==null&&tagToken!==void 0?tagToken:token,"TAG_RESOLVE_FAILED",msg)}),ctx.options);scalar=(0,_identity.isScalar)(res)?res:new _Scalar.Scalar(res)}catch(error){var msg=error instanceof Error?error.message:String(error);onError(tagToken!==null&&tagToken!==void 0?tagToken:token,"TAG_RESOLVE_FAILED",msg);scalar=new _Scalar.Scalar(value)}scalar.range=range;scalar.source=value;if(type)scalar.type=type;if(tagName)scalar.tag=tagName;if(tag.format)scalar.format=tag.format;if(comment)scalar.comment=comment;return scalar}function findScalarTagByName(schema,value,tagName,tagToken,onError){if(tagName==="!")return schema[_identity.SCALAR];var matchWithTest=[];var _iterator=_createForOfIteratorHelper(schema.tags),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var _tag=_step.value;if(!_tag.collection&&_tag.tag===tagName){if(_tag["default"]&&_tag.test)matchWithTest.push(_tag);else return _tag}}}catch(err){_iterator.e(err)}finally{_iterator.f()}for(var _i=0,_matchWithTest=matchWithTest;_i<_matchWithTest.length;_i++){var _tag$test;var tag=_matchWithTest[_i];if((_tag$test=tag.test)!==null&&_tag$test!==void 0&&_tag$test.test(value))return tag}var kt=schema.knownTags[tagName];if(kt&&!kt.collection){schema.tags.push(Object.assign({},kt,{default:false,test:undefined}));return kt}onError(tagToken,"TAG_RESOLVE_FAILED","Unresolved tag: ".concat(tagName),tagName!=="tag:yaml.org,2002:str");return schema[_identity.SCALAR]}function findScalarTagByTest(_ref2,value,token,onError){var directives=_ref2.directives,schema=_ref2.schema;var tag=schema.tags.find((function(tag){var _tag$test2;return tag["default"]&&((_tag$test2=tag.test)===null||_tag$test2===void 0?void 0:_tag$test2.test(value))}))||schema[_identity.SCALAR];if(schema.compat){var _schema$compat$find;var compat=(_schema$compat$find=schema.compat.find((function(tag){var _tag$test3;return tag["default"]&&((_tag$test3=tag.test)===null||_tag$test3===void 0?void 0:_tag$test3.test(value))})))!==null&&_schema$compat$find!==void 0?_schema$compat$find:schema[_identity.SCALAR];if(tag.tag!==compat.tag){var ts=directives.tagString(tag.tag);var cs=directives.tagString(compat.tag);var msg="Value may be parsed as either ".concat(ts," or ").concat(cs);onError(token,"TAG_RESOLVE_FAILED",msg,true)}}return tag}},{"../nodes/Scalar.js":252,"../nodes/identity.js":256,"./resolve-block-scalar.js":230,"./resolve-flow-scalar.js":234}],228:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.Composer=void 0;var _directives=require("../doc/directives.js");var _Document=require("../doc/Document.js");var _errors=require("../errors.js");var _identity=require("../nodes/identity.js");var _composeDoc=require("./compose-doc.js");var _resolveEnd=require("./resolve-end.js");function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{define({},"")}catch(t){define=function define(t,e,r){return t[e]=r}}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,(function(){return this}));var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach((function(e){define(t,e,(function(t){return this._invoke(e,t)}))}))}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){invoke("next",t,i,a)}),(function(t){invoke("throw",t,i,a)})):e.resolve(h).then((function(t){u.value=t,i(u)}),(function(t){return invoke("throw",t,i,a)}))}a(c.arg)}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e((function(e,r){invoke(t,n,e,r)}))}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done}}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg)}}}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next};return i.next=i}}throw new TypeError(_typeof(e)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t},e.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,(function(){return this})),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,(function(){return this})),define(g,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next}return next.done=!0,next}},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y}},catch:function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function getErrorPos(src){if(typeof src==="number")return[src,src+1];if(Array.isArray(src))return src.length===2?src:[src[0],src[1]];var offset=src.offset,source=src.source;return[offset,offset+(typeof source==="string"?source.length:1)]}function parsePrelude(prelude){var _prelude;var comment="";var atComment=false;var afterEmptyLine=false;for(var i=0;i<prelude.length;++i){var source=prelude[i];switch(source[0]){case"#":comment+=(comment===""?"":afterEmptyLine?"\n\n":"\n")+(source.substring(1)||" ");atComment=true;afterEmptyLine=false;break;case"%":if(((_prelude=prelude[i+1])===null||_prelude===void 0?void 0:_prelude[0])!=="#")i+=1;atComment=false;break;default:if(!atComment)afterEmptyLine=true;atComment=false}}return{comment:comment,afterEmptyLine:afterEmptyLine}}var Composer=exports.Composer=function(){function Composer(){var _this=this;var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,Composer);this.doc=null;this.atDirectives=false;this.prelude=[];this.errors=[];this.warnings=[];this.onError=function(source,code,message,warning){var pos=getErrorPos(source);if(warning)_this.warnings.push(new _errors.YAMLWarning(pos,code,message));else _this.errors.push(new _errors.YAMLParseError(pos,code,message))};this.directives=new _directives.Directives({version:options.version||"1.2"});this.options=options}return _createClass(Composer,[{key:"decorate",value:function decorate(doc,afterDoc){var _parsePrelude=parsePrelude(this.prelude),comment=_parsePrelude.comment,afterEmptyLine=_parsePrelude.afterEmptyLine;if(comment){var dc=doc.contents;if(afterDoc){doc.comment=doc.comment?"".concat(doc.comment,"\n").concat(comment):comment}else if(afterEmptyLine||doc.directives.docStart||!dc){doc.commentBefore=comment}else if((0,_identity.isCollection)(dc)&&!dc.flow&&dc.items.length>0){var it=dc.items[0];if((0,_identity.isPair)(it))it=it.key;var cb=it.commentBefore;it.commentBefore=cb?"".concat(comment,"\n").concat(cb):comment}else{var _cb=dc.commentBefore;dc.commentBefore=_cb?"".concat(comment,"\n").concat(_cb):comment}}if(afterDoc){Array.prototype.push.apply(doc.errors,this.errors);Array.prototype.push.apply(doc.warnings,this.warnings)}else{doc.errors=this.errors;doc.warnings=this.warnings}this.prelude=[];this.errors=[];this.warnings=[]}},{key:"streamInfo",value:function streamInfo(){return{comment:parsePrelude(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}},{key:"compose",value:function compose(tokens){var _this2=this;var forceDoc=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var endOffset=arguments.length>2&&arguments[2]!==undefined?arguments[2]:-1;return _regeneratorRuntime().mark((function _callee(){var _iterator,_step,token;return _regeneratorRuntime().wrap((function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_iterator=_createForOfIteratorHelper(tokens);_context.prev=1;_iterator.s();case 3:if((_step=_iterator.n()).done){_context.next=8;break}token=_step.value;return _context.delegateYield(_this2.next(token),"t0",6);case 6:_context.next=3;break;case 8:_context.next=13;break;case 10:_context.prev=10;_context.t1=_context["catch"](1);_iterator.e(_context.t1);case 13:_context.prev=13;_iterator.f();return _context.finish(13);case 16:return _context.delegateYield(_this2.end(forceDoc,endOffset),"t2",17);case 17:case"end":return _context.stop()}}),_callee,null,[[1,10,13,16]])}))()}},{key:"next",value:_regeneratorRuntime().mark((function next(token){var _this3=this;var doc,msg,error,_msg,end,dc;return _regeneratorRuntime().wrap((function next$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.t0=token.type;_context2.next=_context2.t0==="directive"?3:_context2.t0==="document"?7:_context2.t0==="byte-order-mark"?16:_context2.t0==="space"?16:_context2.t0==="comment"?17:_context2.t0==="newline"?17:_context2.t0==="error"?19:_context2.t0==="doc-end"?23:33;break;case 3:this.directives.add(token.source,(function(offset,message,warning){var pos=getErrorPos(token);pos[0]+=offset;_this3.onError(pos,"BAD_DIRECTIVE",message,warning)}));this.prelude.push(token.source);this.atDirectives=true;return _context2.abrupt("break",34);case 7:doc=(0,_composeDoc.composeDoc)(this.options,this.directives,token,this.onError);if(this.atDirectives&&!doc.directives.docStart)this.onError(token,"MISSING_CHAR","Missing directives-end/doc-start indicator line");this.decorate(doc,false);if(!this.doc){_context2.next=13;break}_context2.next=13;return this.doc;case 13:this.doc=doc;this.atDirectives=false;return _context2.abrupt("break",34);case 16:return _context2.abrupt("break",34);case 17:this.prelude.push(token.source);return _context2.abrupt("break",34);case 19:msg=token.source?"".concat(token.message,": ").concat(JSON.stringify(token.source)):token.message;error=new _errors.YAMLParseError(getErrorPos(token),"UNEXPECTED_TOKEN",msg);if(this.atDirectives||!this.doc)this.errors.push(error);else this.doc.errors.push(error);return _context2.abrupt("break",34);case 23:if(this.doc){_context2.next=27;break}_msg="Unexpected doc-end without preceding document";this.errors.push(new _errors.YAMLParseError(getErrorPos(token),"UNEXPECTED_TOKEN",_msg));return _context2.abrupt("break",34);case 27:this.doc.directives.docEnd=true;end=(0,_resolveEnd.resolveEnd)(token.end,token.offset+token.source.length,this.doc.options.strict,this.onError);this.decorate(this.doc,true);if(end.comment){dc=this.doc.comment;this.doc.comment=dc?"".concat(dc,"\n").concat(end.comment):end.comment}this.doc.range[2]=end.offset;return _context2.abrupt("break",34);case 33:this.errors.push(new _errors.YAMLParseError(getErrorPos(token),"UNEXPECTED_TOKEN","Unsupported token ".concat(token.type)));case 34:case"end":return _context2.stop()}}),next,this)}))},{key:"end",value:function end(){var _this4=this;var forceDoc=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;var endOffset=arguments.length>1&&arguments[1]!==undefined?arguments[1]:-1;return _regeneratorRuntime().mark((function _callee2(){var opts,doc;return _regeneratorRuntime().wrap((function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:if(!_this4.doc){_context3.next=7;break}_this4.decorate(_this4.doc,true);_context3.next=4;return _this4.doc;case 4:_this4.doc=null;_context3.next=15;break;case 7:if(!forceDoc){_context3.next=15;break}opts=Object.assign({_directives:_this4.directives},_this4.options);doc=new _Document.Document(undefined,opts);if(_this4.atDirectives)_this4.onError(endOffset,"MISSING_CHAR","Missing directives-end indicator line");doc.range=[0,endOffset,endOffset];_this4.decorate(doc,false);_context3.next=15;return doc;case 15:case"end":return _context3.stop()}}),_callee2)}))()}}])}()},{"../doc/Document.js":240,"../doc/directives.js":244,"../errors.js":245,"../nodes/identity.js":256,"./compose-doc.js":225,"./resolve-end.js":232}],229:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.resolveBlockMap=resolveBlockMap;var _Pair=require("../nodes/Pair.js");var _YAMLMap=require("../nodes/YAMLMap.js");var _resolveProps=require("./resolve-props.js");var _utilContainsNewline=require("./util-contains-newline.js");var _utilFlowIndentCheck=require("./util-flow-indent-check.js");var _utilMapIncludes=require("./util-map-includes.js");function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}var startColMsg="All mapping items must start at the same column";function resolveBlockMap(_ref,ctx,bm,onError,tag){var _tag$nodeClass;var composeNode=_ref.composeNode,composeEmptyNode=_ref.composeEmptyNode;var NodeClass=(_tag$nodeClass=tag===null||tag===void 0?void 0:tag.nodeClass)!==null&&_tag$nodeClass!==void 0?_tag$nodeClass:_YAMLMap.YAMLMap;var map=new NodeClass(ctx.schema);if(ctx.atRoot)ctx.atRoot=false;var offset=bm.offset;var commentEnd=null;var _iterator=_createForOfIteratorHelper(bm.items),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var _keyProps$found;var collItem=_step.value;var start=collItem.start,key=collItem.key,sep=collItem.sep,value=collItem.value;var keyProps=(0,_resolveProps.resolveProps)(start,{indicator:"explicit-key-ind",next:key!==null&&key!==void 0?key:sep===null||sep===void 0?void 0:sep[0],offset:offset,onError:onError,parentIndent:bm.indent,startOnNewline:true});var implicitKey=!keyProps.found;if(implicitKey){if(key){if(key.type==="block-seq")onError(offset,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in key&&key.indent!==bm.indent)onError(offset,"BAD_INDENT",startColMsg)}if(!keyProps.anchor&&!keyProps.tag&&!sep){commentEnd=keyProps.end;if(keyProps.comment){if(map.comment)map.comment+="\n"+keyProps.comment;else map.comment=keyProps.comment}continue}if(keyProps.newlineAfterProp||(0,_utilContainsNewline.containsNewline)(key)){onError(key!==null&&key!==void 0?key:start[start.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}}else if(((_keyProps$found=keyProps.found)===null||_keyProps$found===void 0?void 0:_keyProps$found.indent)!==bm.indent){onError(offset,"BAD_INDENT",startColMsg)}var keyStart=keyProps.end;var keyNode=key?composeNode(ctx,key,keyProps,onError):composeEmptyNode(ctx,keyStart,start,null,keyProps,onError);if(ctx.schema.compat)(0,_utilFlowIndentCheck.flowIndentCheck)(bm.indent,key,onError);if((0,_utilMapIncludes.mapIncludes)(ctx,map.items,keyNode))onError(keyStart,"DUPLICATE_KEY","Map keys must be unique");var valueProps=(0,_resolveProps.resolveProps)(sep!==null&&sep!==void 0?sep:[],{indicator:"map-value-ind",next:value,offset:keyNode.range[2],onError:onError,parentIndent:bm.indent,startOnNewline:!key||key.type==="block-scalar"});offset=valueProps.end;if(valueProps.found){if(implicitKey){if((value===null||value===void 0?void 0:value.type)==="block-map"&&!valueProps.hasNewline)onError(offset,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(ctx.options.strict&&keyProps.start<valueProps.found.offset-1024)onError(keyNode.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}var valueNode=value?composeNode(ctx,value,valueProps,onError):composeEmptyNode(ctx,offset,sep,null,valueProps,onError);if(ctx.schema.compat)(0,_utilFlowIndentCheck.flowIndentCheck)(bm.indent,value,onError);offset=valueNode.range[2];var pair=new _Pair.Pair(keyNode,valueNode);if(ctx.options.keepSourceTokens)pair.srcToken=collItem;map.items.push(pair)}else{if(implicitKey)onError(keyNode.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(valueProps.comment){if(keyNode.comment)keyNode.comment+="\n"+valueProps.comment;else keyNode.comment=valueProps.comment}var _pair=new _Pair.Pair(keyNode);if(ctx.options.keepSourceTokens)_pair.srcToken=collItem;map.items.push(_pair)}}}catch(err){_iterator.e(err)}finally{_iterator.f()}if(commentEnd&&commentEnd<offset)onError(commentEnd,"IMPOSSIBLE","Map comment with trailing content");map.range=[bm.offset,offset,commentEnd!==null&&commentEnd!==void 0?commentEnd:offset];return map}},{"../nodes/Pair.js":251,"../nodes/YAMLMap.js":253,"./resolve-props.js":235,"./util-contains-newline.js":236,"./util-flow-indent-check.js":238,"./util-map-includes.js":239}],230:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.resolveBlockScalar=resolveBlockScalar;var _Scalar=require("../nodes/Scalar.js");function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}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 _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function resolveBlockScalar(ctx,scalar,onError){var start=scalar.offset;var header=parseBlockScalarHeader(scalar,ctx.options.strict,onError);if(!header)return{value:"",type:null,comment:"",range:[start,start,start]};var type=header.mode===">"?_Scalar.Scalar.BLOCK_FOLDED:_Scalar.Scalar.BLOCK_LITERAL;var lines=scalar.source?splitLines(scalar.source):[];var chompStart=lines.length;for(var i=lines.length-1;i>=0;--i){var content=lines[i][1];if(content===""||content==="\r")chompStart=i;else break}if(chompStart===0){var _value=header.chomp==="+"&&lines.length>0?"\n".repeat(Math.max(1,lines.length-1)):"";var _end=start+header.length;if(scalar.source)_end+=scalar.source.length;return{value:_value,type:type,comment:header.comment,range:[start,_end,_end]}}var trimIndent=scalar.indent+header.indent;var offset=scalar.offset+header.length;var contentStart=0;for(var _i=0;_i<chompStart;++_i){var _lines$_i=_slicedToArray(lines[_i],2),indent=_lines$_i[0],_content=_lines$_i[1];if(_content===""||_content==="\r"){if(header.indent===0&&indent.length>trimIndent)trimIndent=indent.length}else{if(indent.length<trimIndent){var message="Block scalars with more-indented leading empty lines must use an explicit indentation indicator";onError(offset+indent.length,"MISSING_CHAR",message)}if(header.indent===0)trimIndent=indent.length;contentStart=_i;if(trimIndent===0&&!ctx.atRoot){var _message="Block scalar values in collections must be indented";onError(offset,"BAD_INDENT",_message)}break}offset+=indent.length+_content.length+1}for(var _i2=lines.length-1;_i2>=chompStart;--_i2){if(lines[_i2][0].length>trimIndent)chompStart=_i2+1}var value="";var sep="";var prevMoreIndented=false;for(var _i3=0;_i3<contentStart;++_i3)value+=lines[_i3][0].slice(trimIndent)+"\n";for(var _i4=contentStart;_i4<chompStart;++_i4){var _lines$_i2=_slicedToArray(lines[_i4],2),_indent=_lines$_i2[0],_content2=_lines$_i2[1];offset+=_indent.length+_content2.length+1;var crlf=_content2[_content2.length-1]==="\r";if(crlf)_content2=_content2.slice(0,-1);if(_content2&&_indent.length<trimIndent){var src=header.indent?"explicit indentation indicator":"first line";var _message2="Block scalar lines must not be less indented than their ".concat(src);onError(offset-_content2.length-(crlf?2:1),"BAD_INDENT",_message2);_indent=""}if(type===_Scalar.Scalar.BLOCK_LITERAL){value+=sep+_indent.slice(trimIndent)+_content2;sep="\n"}else if(_indent.length>trimIndent||_content2[0]==="\t"){if(sep===" ")sep="\n";else if(!prevMoreIndented&&sep==="\n")sep="\n\n";value+=sep+_indent.slice(trimIndent)+_content2;sep="\n";prevMoreIndented=true}else if(_content2===""){if(sep==="\n")value+="\n";else sep="\n"}else{value+=sep+_content2;sep=" ";prevMoreIndented=false}}switch(header.chomp){case"-":break;case"+":for(var _i5=chompStart;_i5<lines.length;++_i5)value+="\n"+lines[_i5][0].slice(trimIndent);if(value[value.length-1]!=="\n")value+="\n";break;default:value+="\n"}var end=start+header.length+scalar.source.length;return{value:value,type:type,comment:header.comment,range:[start,end,end]}}function parseBlockScalarHeader(_ref,strict,onError){var offset=_ref.offset,props=_ref.props;if(props[0].type!=="block-scalar-header"){onError(props[0],"IMPOSSIBLE","Block scalar header not found");return null}var source=props[0].source;var mode=source[0];var indent=0;var chomp="";var error=-1;for(var i=1;i<source.length;++i){var ch=source[i];if(!chomp&&(ch==="-"||ch==="+"))chomp=ch;else{var n=Number(ch);if(!indent&&n)indent=n;else if(error===-1)error=offset+i}}if(error!==-1)onError(error,"UNEXPECTED_TOKEN","Block scalar header includes extra characters: ".concat(source));var hasSpace=false;var comment="";var length=source.length;for(var _i6=1;_i6<props.length;++_i6){var token=props[_i6];switch(token.type){case"space":hasSpace=true;case"newline":length+=token.source.length;break;case"comment":if(strict&&!hasSpace){var message="Comments must be separated from other tokens by white space characters";onError(token,"MISSING_CHAR",message)}length+=token.source.length;comment=token.source.substring(1);break;case"error":onError(token,"UNEXPECTED_TOKEN",token.message);length+=token.source.length;break;default:{var _message3="Unexpected token in block scalar header: ".concat(token.type);onError(token,"UNEXPECTED_TOKEN",_message3);var ts=token.source;if(ts&&typeof ts==="string")length+=ts.length}}}return{mode:mode,indent:indent,chomp:chomp,comment:comment,length:length}}function splitLines(source){var split=source.split(/\n( *)/);var first=split[0];var m=first.match(/^( *)/);var line0=m!==null&&m!==void 0&&m[1]?[m[1],first.slice(m[1].length)]:["",first];var lines=[line0];for(var i=1;i<split.length;i+=2)lines.push([split[i],split[i+1]]);return lines}},{"../nodes/Scalar.js":252}],231:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.resolveBlockSeq=resolveBlockSeq;var _YAMLSeq=require("../nodes/YAMLSeq.js");var _resolveProps=require("./resolve-props.js");var _utilFlowIndentCheck=require("./util-flow-indent-check.js");function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function resolveBlockSeq(_ref,ctx,bs,onError,tag){var _tag$nodeClass;var composeNode=_ref.composeNode,composeEmptyNode=_ref.composeEmptyNode;var NodeClass=(_tag$nodeClass=tag===null||tag===void 0?void 0:tag.nodeClass)!==null&&_tag$nodeClass!==void 0?_tag$nodeClass:_YAMLSeq.YAMLSeq;var seq=new NodeClass(ctx.schema);if(ctx.atRoot)ctx.atRoot=false;var offset=bs.offset;var commentEnd=null;var _iterator=_createForOfIteratorHelper(bs.items),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var _step$value=_step.value,start=_step$value.start,value=_step$value.value;var props=(0,_resolveProps.resolveProps)(start,{indicator:"seq-item-ind",next:value,offset:offset,onError:onError,parentIndent:bs.indent,startOnNewline:true});if(!props.found){if(props.anchor||props.tag||value){if(value&&value.type==="block-seq")onError(props.end,"BAD_INDENT","All sequence items must start at the same column");else onError(offset,"MISSING_CHAR","Sequence item without - indicator")}else{commentEnd=props.end;if(props.comment)seq.comment=props.comment;continue}}var node=value?composeNode(ctx,value,props,onError):composeEmptyNode(ctx,props.end,start,null,props,onError);if(ctx.schema.compat)(0,_utilFlowIndentCheck.flowIndentCheck)(bs.indent,value,onError);offset=node.range[2];seq.items.push(node)}}catch(err){_iterator.e(err)}finally{_iterator.f()}seq.range=[bs.offset,offset,commentEnd!==null&&commentEnd!==void 0?commentEnd:offset];return seq}},{"../nodes/YAMLSeq.js":254,"./resolve-props.js":235,"./util-flow-indent-check.js":238}],232:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.resolveEnd=resolveEnd;function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function resolveEnd(end,offset,reqSpace,onError){var comment="";if(end){var hasSpace=false;var sep="";var _iterator=_createForOfIteratorHelper(end),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var token=_step.value;var source=token.source,type=token.type;switch(type){case"space":hasSpace=true;break;case"comment":{if(reqSpace&&!hasSpace)onError(token,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");var cb=source.substring(1)||" ";if(!comment)comment=cb;else comment+=sep+cb;sep="";break}case"newline":if(comment)sep+=source;hasSpace=true;break;default:onError(token,"UNEXPECTED_TOKEN","Unexpected ".concat(type," at node end"))}offset+=source.length}}catch(err){_iterator.e(err)}finally{_iterator.f()}}return{comment:comment,offset:offset}}},{}],233:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.resolveFlowCollection=resolveFlowCollection;var _identity=require("../nodes/identity.js");var _Pair=require("../nodes/Pair.js");var _YAMLMap=require("../nodes/YAMLMap.js");var _YAMLSeq=require("../nodes/YAMLSeq.js");var _resolveEnd=require("./resolve-end.js");var _resolveProps=require("./resolve-props.js");var _utilContainsNewline=require("./util-contains-newline.js");var _utilMapIncludes=require("./util-map-includes.js");function _toArray(r){return _arrayWithHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableRest()}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 _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}function _arrayWithHoles(r){if(Array.isArray(r))return r}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}var blockMsg="Block collections are not allowed within flow collections";var isBlock=function isBlock(token){return token&&(token.type==="block-map"||token.type==="block-seq")};function resolveFlowCollection(_ref,ctx,fc,onError,tag){var _tag$nodeClass;var composeNode=_ref.composeNode,composeEmptyNode=_ref.composeEmptyNode;var isMap=fc.start.source==="{";var fcName=isMap?"flow map":"flow sequence";var NodeClass=(_tag$nodeClass=tag===null||tag===void 0?void 0:tag.nodeClass)!==null&&_tag$nodeClass!==void 0?_tag$nodeClass:isMap?_YAMLMap.YAMLMap:_YAMLSeq.YAMLSeq;var coll=new NodeClass(ctx.schema);coll.flow=true;var atRoot=ctx.atRoot;if(atRoot)ctx.atRoot=false;var offset=fc.offset+fc.start.source.length;for(var i=0;i<fc.items.length;++i){var collItem=fc.items[i];var start=collItem.start,key=collItem.key,sep=collItem.sep,value=collItem.value;var props=(0,_resolveProps.resolveProps)(start,{flow:fcName,indicator:"explicit-key-ind",next:key!==null&&key!==void 0?key:sep===null||sep===void 0?void 0:sep[0],offset:offset,onError:onError,parentIndent:fc.indent,startOnNewline:false});if(!props.found){if(!props.anchor&&!props.tag&&!sep&&!value){if(i===0&&props.comma)onError(props.comma,"UNEXPECTED_TOKEN","Unexpected , in ".concat(fcName));else if(i<fc.items.length-1)onError(props.start,"UNEXPECTED_TOKEN","Unexpected empty item in ".concat(fcName));if(props.comment){if(coll.comment)coll.comment+="\n"+props.comment;else coll.comment=props.comment}offset=props.end;continue}if(!isMap&&ctx.options.strict&&(0,_utilContainsNewline.containsNewline)(key))onError(key,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(i===0){if(props.comma)onError(props.comma,"UNEXPECTED_TOKEN","Unexpected , in ".concat(fcName))}else{if(!props.comma)onError(props.start,"MISSING_CHAR","Missing , between ".concat(fcName," items"));if(props.comment){var prevItemComment="";var _iterator=_createForOfIteratorHelper(start),_step;try{loop:for(_iterator.s();!(_step=_iterator.n()).done;){var st=_step.value;switch(st.type){case"comma":case"space":break;case"comment":prevItemComment=st.source.substring(1);break loop;default:break loop}}}catch(err){_iterator.e(err)}finally{_iterator.f()}if(prevItemComment){var _prev$value;var prev=coll.items[coll.items.length-1];if((0,_identity.isPair)(prev))prev=(_prev$value=prev.value)!==null&&_prev$value!==void 0?_prev$value:prev.key;if(prev.comment)prev.comment+="\n"+prevItemComment;else prev.comment=prevItemComment;props.comment=props.comment.substring(prevItemComment.length+1)}}}if(!isMap&&!sep&&!props.found){var valueNode=value?composeNode(ctx,value,props,onError):composeEmptyNode(ctx,props.end,sep,null,props,onError);coll.items.push(valueNode);offset=valueNode.range[2];if(isBlock(value))onError(valueNode.range,"BLOCK_IN_FLOW",blockMsg)}else{var keyStart=props.end;var keyNode=key?composeNode(ctx,key,props,onError):composeEmptyNode(ctx,keyStart,start,null,props,onError);if(isBlock(key))onError(keyNode.range,"BLOCK_IN_FLOW",blockMsg);var valueProps=(0,_resolveProps.resolveProps)(sep!==null&&sep!==void 0?sep:[],{flow:fcName,indicator:"map-value-ind",next:value,offset:keyNode.range[2],onError:onError,parentIndent:fc.indent,startOnNewline:false});if(valueProps.found){if(!isMap&&!props.found&&ctx.options.strict){if(sep){var _iterator2=_createForOfIteratorHelper(sep),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var _st=_step2.value;if(_st===valueProps.found)break;if(_st.type==="newline"){onError(_st,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}}if(props.start<valueProps.found.offset-1024)onError(valueProps.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(value){if("source"in value&&value.source&&value.source[0]===":")onError(value,"MISSING_CHAR","Missing space after : in ".concat(fcName));else onError(valueProps.start,"MISSING_CHAR","Missing , or : between ".concat(fcName," items"))}var _valueNode=value?composeNode(ctx,value,valueProps,onError):valueProps.found?composeEmptyNode(ctx,valueProps.end,sep,null,valueProps,onError):null;if(_valueNode){if(isBlock(value))onError(_valueNode.range,"BLOCK_IN_FLOW",blockMsg)}else if(valueProps.comment){if(keyNode.comment)keyNode.comment+="\n"+valueProps.comment;else keyNode.comment=valueProps.comment}var pair=new _Pair.Pair(keyNode,_valueNode);if(ctx.options.keepSourceTokens)pair.srcToken=collItem;if(isMap){var map=coll;if((0,_utilMapIncludes.mapIncludes)(ctx,map.items,keyNode))onError(keyStart,"DUPLICATE_KEY","Map keys must be unique");map.items.push(pair)}else{var _map=new _YAMLMap.YAMLMap(ctx.schema);_map.flow=true;_map.items.push(pair);coll.items.push(_map)}offset=_valueNode?_valueNode.range[2]:valueProps.end}}var expectedEnd=isMap?"}":"]";var _fc$end=_toArray(fc.end),ce=_fc$end[0],ee=_fc$end.slice(1);var cePos=offset;if(ce&&ce.source===expectedEnd)cePos=ce.offset+ce.source.length;else{var name=fcName[0].toUpperCase()+fcName.substring(1);var msg=atRoot?"".concat(name," must end with a ").concat(expectedEnd):"".concat(name," in block collection must be sufficiently indented and end with a ").concat(expectedEnd);onError(offset,atRoot?"MISSING_CHAR":"BAD_INDENT",msg);if(ce&&ce.source.length!==1)ee.unshift(ce)}if(ee.length>0){var end=(0,_resolveEnd.resolveEnd)(ee,cePos,ctx.options.strict,onError);if(end.comment){if(coll.comment)coll.comment+="\n"+end.comment;else coll.comment=end.comment}coll.range=[fc.offset,cePos,end.offset]}else{coll.range=[fc.offset,cePos,cePos]}return coll}},{"../nodes/Pair.js":251,"../nodes/YAMLMap.js":253,"../nodes/YAMLSeq.js":254,"../nodes/identity.js":256,"./resolve-end.js":232,"./resolve-props.js":235,"./util-contains-newline.js":236,"./util-map-includes.js":239}],234:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.resolveFlowScalar=resolveFlowScalar;var _Scalar=require("../nodes/Scalar.js");var _resolveEnd=require("./resolve-end.js");function resolveFlowScalar(scalar,strict,onError){var offset=scalar.offset,type=scalar.type,source=scalar.source,end=scalar.end;var _type;var value;var _onError=function _onError(rel,code,msg){return onError(offset+rel,code,msg)};switch(type){case"scalar":_type=_Scalar.Scalar.PLAIN;value=plainValue(source,_onError);break;case"single-quoted-scalar":_type=_Scalar.Scalar.QUOTE_SINGLE;value=singleQuotedValue(source,_onError);break;case"double-quoted-scalar":_type=_Scalar.Scalar.QUOTE_DOUBLE;value=doubleQuotedValue(source,_onError);break;default:onError(scalar,"UNEXPECTED_TOKEN","Expected a flow scalar value, but found: ".concat(type));return{value:"",type:null,comment:"",range:[offset,offset+source.length,offset+source.length]}}var valueEnd=offset+source.length;var re=(0,_resolveEnd.resolveEnd)(end,valueEnd,strict,onError);return{value:value,type:_type,comment:re.comment,range:[offset,valueEnd,re.offset]}}function plainValue(source,onError){var badChar="";switch(source[0]){case"\t":badChar="a tab character";break;case",":badChar="flow indicator character ,";break;case"%":badChar="directive indicator character %";break;case"|":case">":{badChar="block scalar indicator ".concat(source[0]);break}case"@":case"`":{badChar="reserved character ".concat(source[0]);break}}if(badChar)onError(0,"BAD_SCALAR_START","Plain value cannot start with ".concat(badChar));return foldLines(source)}function singleQuotedValue(source,onError){if(source[source.length-1]!=="'"||source.length===1)onError(source.length,"MISSING_CHAR","Missing closing 'quote");return foldLines(source.slice(1,-1)).replace(/''/g,"'")}function foldLines(source){var _match$,_match;var first,line;try{first=new RegExp("(.*?)(?<![ \t])[ \t]*\r?\n","sy");line=new RegExp("[ \t]*(.*?)(?:(?<![ \t])[ \t]*)?\r?\n","sy")}catch(_){first=new RegExp("([^]*?)[ \\t]*\\r?\\n","y");line=new RegExp("[ \\t]*([^]*?)[ \\t]*\\r?\\n","y")}var match=first.exec(source);if(!match)return source;var res=match[1];var sep=" ";var pos=first.lastIndex;line.lastIndex=pos;while(match=line.exec(source)){if(match[1]===""){if(sep==="\n")res+=sep;else sep="\n"}else{res+=sep+match[1];sep=" "}pos=line.lastIndex}var last=new RegExp("[ \\t]*([^]*)","y");last.lastIndex=pos;match=last.exec(source);return res+sep+((_match$=(_match=match)===null||_match===void 0?void 0:_match[1])!==null&&_match$!==void 0?_match$:"")}function doubleQuotedValue(source,onError){var res="";for(var i=1;i<source.length-1;++i){var ch=source[i];if(ch==="\r"&&source[i+1]==="\n")continue;if(ch==="\n"){var _foldNewline=foldNewline(source,i),fold=_foldNewline.fold,offset=_foldNewline.offset;res+=fold;i=offset}else if(ch==="\\"){var next=source[++i];var cc=escapeCodes[next];if(cc)res+=cc;else if(next==="\n"){next=source[i+1];while(next===" "||next==="\t")next=source[++i+1]}else if(next==="\r"&&source[i+1]==="\n"){next=source[++i+1];while(next===" "||next==="\t")next=source[++i+1]}else if(next==="x"||next==="u"||next==="U"){var length={x:2,u:4,U:8}[next];res+=parseCharCode(source,i+1,length,onError);i+=length}else{var raw=source.substr(i-1,2);onError(i-1,"BAD_DQ_ESCAPE","Invalid escape sequence ".concat(raw));res+=raw}}else if(ch===" "||ch==="\t"){var wsStart=i;var _next=source[i+1];while(_next===" "||_next==="\t")_next=source[++i+1];if(_next!=="\n"&&!(_next==="\r"&&source[i+2]==="\n"))res+=i>wsStart?source.slice(wsStart,i+1):ch}else{res+=ch}}if(source[source.length-1]!=='"'||source.length===1)onError(source.length,"MISSING_CHAR",'Missing closing "quote');return res}function foldNewline(source,offset){var fold="";var ch=source[offset+1];while(ch===" "||ch==="\t"||ch==="\n"||ch==="\r"){if(ch==="\r"&&source[offset+2]!=="\n")break;if(ch==="\n")fold+="\n";offset+=1;ch=source[offset+1]}if(!fold)fold=" ";return{fold:fold,offset:offset}}var escapeCodes={0:"\0",a:"",b:"\b",e:"",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function parseCharCode(source,offset,length,onError){var cc=source.substr(offset,length);var ok=cc.length===length&&/^[0-9a-fA-F]+$/.test(cc);var code=ok?parseInt(cc,16):NaN;if(isNaN(code)){var raw=source.substr(offset-2,length+2);onError(offset-2,"BAD_DQ_ESCAPE","Invalid escape sequence ".concat(raw));return raw}return String.fromCodePoint(code)}},{"../nodes/Scalar.js":252,"./resolve-end.js":232}],235:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.resolveProps=resolveProps;function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function resolveProps(tokens,_ref){var flow=_ref.flow,indicator=_ref.indicator,next=_ref.next,offset=_ref.offset,onError=_ref.onError,parentIndent=_ref.parentIndent,startOnNewline=_ref.startOnNewline;var spaceBefore=false;var atNewline=startOnNewline;var hasSpace=startOnNewline;var comment="";var commentSep="";var hasNewline=false;var reqSpace=false;var tab=null;var anchor=null;var tag=null;var newlineAfterProp=null;var comma=null;var found=null;var start=null;var _iterator=_createForOfIteratorHelper(tokens),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var token=_step.value;if(reqSpace){if(token.type!=="space"&&token.type!=="newline"&&token.type!=="comma")onError(token.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");reqSpace=false}if(tab){if(atNewline&&token.type!=="comment"&&token.type!=="newline"){onError(tab,"TAB_AS_INDENT","Tabs are not allowed as indentation")}tab=null}switch(token.type){case"space":if(!flow&&(indicator!=="doc-start"||(next===null||next===void 0?void 0:next.type)!=="flow-collection")&&token.source.includes("\t")){tab=token}hasSpace=true;break;case"comment":{if(!hasSpace)onError(token,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");var cb=token.source.substring(1)||" ";if(!comment)comment=cb;else comment+=commentSep+cb;commentSep="";atNewline=false;break}case"newline":if(atNewline){if(comment)comment+=token.source;else spaceBefore=true}else commentSep+=token.source;atNewline=true;hasNewline=true;if(anchor||tag)newlineAfterProp=token;hasSpace=true;break;case"anchor":if(anchor)onError(token,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(token.source.endsWith(":"))onError(token.offset+token.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",true);anchor=token;if(start===null)start=token.offset;atNewline=false;hasSpace=false;reqSpace=true;break;case"tag":{if(tag)onError(token,"MULTIPLE_TAGS","A node can have at most one tag");tag=token;if(start===null)start=token.offset;atNewline=false;hasSpace=false;reqSpace=true;break}case indicator:if(anchor||tag)onError(token,"BAD_PROP_ORDER","Anchors and tags must be after the ".concat(token.source," indicator"));if(found)onError(token,"UNEXPECTED_TOKEN","Unexpected ".concat(token.source," in ").concat(flow!==null&&flow!==void 0?flow:"collection"));found=token;atNewline=indicator==="seq-item-ind"||indicator==="explicit-key-ind";hasSpace=false;break;case"comma":if(flow){if(comma)onError(token,"UNEXPECTED_TOKEN","Unexpected , in ".concat(flow));comma=token;atNewline=false;hasSpace=false;break}default:onError(token,"UNEXPECTED_TOKEN","Unexpected ".concat(token.type," token"));atNewline=false;hasSpace=false}}}catch(err){_iterator.e(err)}finally{_iterator.f()}var last=tokens[tokens.length-1];var end=last?last.offset+last.source.length:offset;if(reqSpace&&next&&next.type!=="space"&&next.type!=="newline"&&next.type!=="comma"&&(next.type!=="scalar"||next.source!=="")){onError(next.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space")}if(tab&&(atNewline&&tab.indent<=parentIndent||(next===null||next===void 0?void 0:next.type)==="block-map"||(next===null||next===void 0?void 0:next.type)==="block-seq"))onError(tab,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:comma,found:found,spaceBefore:spaceBefore,comment:comment,hasNewline:hasNewline,anchor:anchor,tag:tag,newlineAfterProp:newlineAfterProp,end:end,start:start!==null&&start!==void 0?start:end}}},{}],236:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.containsNewline=containsNewline;function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function containsNewline(key){if(!key)return null;switch(key.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(key.source.includes("\n"))return true;if(key.end){var _iterator=_createForOfIteratorHelper(key.end),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var st=_step.value;if(st.type==="newline")return true}}catch(err){_iterator.e(err)}finally{_iterator.f()}}return false;case"flow-collection":var _iterator2=_createForOfIteratorHelper(key.items),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var it=_step2.value;var _iterator3=_createForOfIteratorHelper(it.start),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var _st2=_step3.value;if(_st2.type==="newline")return true}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}if(it.sep){var _iterator4=_createForOfIteratorHelper(it.sep),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var _st=_step4.value;if(_st.type==="newline")return true}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}}if(containsNewline(it.key)||containsNewline(it.value))return true}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}return false;default:return true}}},{}],237:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.emptyScalarPosition=emptyScalarPosition;function emptyScalarPosition(offset,before,pos){if(before){if(pos===null)pos=before.length;for(var i=pos-1;i>=0;--i){var st=before[i];switch(st.type){case"space":case"comment":case"newline":offset-=st.source.length;continue}st=before[++i];while(((_st=st)===null||_st===void 0?void 0:_st.type)==="space"){var _st;offset+=st.source.length;st=before[++i]}break}}return offset}},{}],238:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.flowIndentCheck=flowIndentCheck;var _utilContainsNewline=require("./util-contains-newline.js");function flowIndentCheck(indent,fc,onError){if((fc===null||fc===void 0?void 0:fc.type)==="flow-collection"){var end=fc.end[0];if(end.indent===indent&&(end.source==="]"||end.source==="}")&&(0,_utilContainsNewline.containsNewline)(fc)){var msg="Flow end indicator should be more indented than parent";onError(end,"BAD_INDENT",msg,true)}}}},{"./util-contains-newline.js":236}],239:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.mapIncludes=mapIncludes;var _identity=require("../nodes/identity.js");function mapIncludes(ctx,items,search){var uniqueKeys=ctx.options.uniqueKeys;if(uniqueKeys===false)return false;var isEqual=typeof uniqueKeys==="function"?uniqueKeys:function(a,b){return a===b||(0,_identity.isScalar)(a)&&(0,_identity.isScalar)(b)&&a.value===b.value&&!(a.value==="<<"&&ctx.schema.merge)};return items.some((function(pair){return isEqual(pair.key,search)}))}},{"../nodes/identity.js":256}],240:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.Document=void 0;var _Alias=require("../nodes/Alias.js");var _Collection=require("../nodes/Collection.js");var _identity=require("../nodes/identity.js");var _Pair=require("../nodes/Pair.js");var _toJS2=require("../nodes/toJS.js");var _Schema=require("../schema/Schema.js");var _stringifyDocument=require("../stringify/stringifyDocument.js");var _anchors=require("./anchors.js");var _applyReviver=require("./applyReviver.js");var _createNode2=require("./createNode.js");var _directives=require("./directives.js");function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var Document=exports.Document=function(){function Document(value,replacer,options){var _options;_classCallCheck(this,Document);this.commentBefore=null;this.comment=null;this.errors=[];this.warnings=[];Object.defineProperty(this,_identity.NODE_TYPE,{value:_identity.DOC});var _replacer=null;if(typeof replacer==="function"||Array.isArray(replacer)){_replacer=replacer}else if(options===undefined&&replacer){options=replacer;replacer=undefined}var opt=Object.assign({intAsBigInt:false,keepSourceTokens:false,logLevel:"warn",prettyErrors:true,strict:true,uniqueKeys:true,version:"1.2"},options);this.options=opt;var version=opt.version;if((_options=options)!==null&&_options!==void 0&&_options._directives){this.directives=options._directives.atDocument();if(this.directives.yaml.explicit)version=this.directives.yaml.version}else this.directives=new _directives.Directives({version:version});this.setSchema(version,options);this.contents=value===undefined?null:this.createNode(value,_replacer,options)}return _createClass(Document,[{key:"clone",value:function clone(){var copy=Object.create(Document.prototype,_defineProperty({},_identity.NODE_TYPE,{value:_identity.DOC}));copy.commentBefore=this.commentBefore;copy.comment=this.comment;copy.errors=this.errors.slice();copy.warnings=this.warnings.slice();copy.options=Object.assign({},this.options);if(this.directives)copy.directives=this.directives.clone();copy.schema=this.schema.clone();copy.contents=(0,_identity.isNode)(this.contents)?this.contents.clone(copy.schema):this.contents;if(this.range)copy.range=this.range.slice();return copy}},{key:"add",value:function add(value){if(assertCollection(this.contents))this.contents.add(value)}},{key:"addIn",value:function addIn(path,value){if(assertCollection(this.contents))this.contents.addIn(path,value)}},{key:"createAlias",value:function createAlias(node,name){if(!node.anchor){var prev=(0,_anchors.anchorNames)(this);node.anchor=!name||prev.has(name)?(0,_anchors.findNewAnchor)(name||"a",prev):name}return new _Alias.Alias(node.anchor)}},{key:"createNode",value:function createNode(value,replacer,options){var _replacer=undefined;if(typeof replacer==="function"){value=replacer.call({"":value},"",value);_replacer=replacer}else if(Array.isArray(replacer)){var keyToStr=function keyToStr(v){return typeof v==="number"||v instanceof String||v instanceof Number};var asStr=replacer.filter(keyToStr).map(String);if(asStr.length>0)replacer=replacer.concat(asStr);_replacer=replacer}else if(options===undefined&&replacer){options=replacer;replacer=undefined}var _ref=options!==null&&options!==void 0?options:{},aliasDuplicateObjects=_ref.aliasDuplicateObjects,anchorPrefix=_ref.anchorPrefix,flow=_ref.flow,keepUndefined=_ref.keepUndefined,onTagObj=_ref.onTagObj,tag=_ref.tag;var _createNodeAnchors=(0,_anchors.createNodeAnchors)(this,anchorPrefix||"a"),onAnchor=_createNodeAnchors.onAnchor,setAnchors=_createNodeAnchors.setAnchors,sourceObjects=_createNodeAnchors.sourceObjects;var ctx={aliasDuplicateObjects:aliasDuplicateObjects!==null&&aliasDuplicateObjects!==void 0?aliasDuplicateObjects:true,keepUndefined:keepUndefined!==null&&keepUndefined!==void 0?keepUndefined:false,onAnchor:onAnchor,onTagObj:onTagObj,replacer:_replacer,schema:this.schema,sourceObjects:sourceObjects};var node=(0,_createNode2.createNode)(value,tag,ctx);if(flow&&(0,_identity.isCollection)(node))node.flow=true;setAnchors();return node}},{key:"createPair",value:function createPair(key,value){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var k=this.createNode(key,null,options);var v=this.createNode(value,null,options);return new _Pair.Pair(k,v)}},{key:"delete",value:function _delete(key){return assertCollection(this.contents)?this.contents["delete"](key):false}},{key:"deleteIn",value:function deleteIn(path){if((0,_Collection.isEmptyPath)(path)){if(this.contents==null)return false;this.contents=null;return true}return assertCollection(this.contents)?this.contents.deleteIn(path):false}},{key:"get",value:function get(key,keepScalar){return(0,_identity.isCollection)(this.contents)?this.contents.get(key,keepScalar):undefined}},{key:"getIn",value:function getIn(path,keepScalar){if((0,_Collection.isEmptyPath)(path))return!keepScalar&&(0,_identity.isScalar)(this.contents)?this.contents.value:this.contents;return(0,_identity.isCollection)(this.contents)?this.contents.getIn(path,keepScalar):undefined}},{key:"has",value:function has(key){return(0,_identity.isCollection)(this.contents)?this.contents.has(key):false}},{key:"hasIn",value:function hasIn(path){if((0,_Collection.isEmptyPath)(path))return this.contents!==undefined;return(0,_identity.isCollection)(this.contents)?this.contents.hasIn(path):false}},{key:"set",value:function set(key,value){if(this.contents==null){this.contents=(0,_Collection.collectionFromPath)(this.schema,[key],value)}else if(assertCollection(this.contents)){this.contents.set(key,value)}}},{key:"setIn",value:function setIn(path,value){if((0,_Collection.isEmptyPath)(path)){this.contents=value}else if(this.contents==null){this.contents=(0,_Collection.collectionFromPath)(this.schema,Array.from(path),value)}else if(assertCollection(this.contents)){this.contents.setIn(path,value)}}},{key:"setSchema",value:function setSchema(version){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(typeof version==="number")version=String(version);var opt;switch(version){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new _directives.Directives({version:"1.1"});opt={merge:true,resolveKnownTags:false,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=version;else this.directives=new _directives.Directives({version:version});opt={merge:false,resolveKnownTags:true,schema:"core"};break;case null:if(this.directives)delete this.directives;opt=null;break;default:{var sv=JSON.stringify(version);throw new Error("Expected '1.1', '1.2' or null as first argument, but found: ".concat(sv))}}if(options.schema instanceof Object)this.schema=options.schema;else if(opt)this.schema=new _Schema.Schema(Object.assign(opt,options));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}},{key:"toJS",value:function toJS(){var _ref2=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},json=_ref2.json,jsonArg=_ref2.jsonArg,mapAsMap=_ref2.mapAsMap,maxAliasCount=_ref2.maxAliasCount,onAnchor=_ref2.onAnchor,reviver=_ref2.reviver;var ctx={anchors:new Map,doc:this,keep:!json,mapAsMap:mapAsMap===true,mapKeyWarned:false,maxAliasCount:typeof maxAliasCount==="number"?maxAliasCount:100};var res=(0,_toJS2.toJS)(this.contents,jsonArg!==null&&jsonArg!==void 0?jsonArg:"",ctx);if(typeof onAnchor==="function"){var _iterator=_createForOfIteratorHelper(ctx.anchors.values()),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var _step$value=_step.value,count=_step$value.count,_res=_step$value.res;onAnchor(_res,count)}}catch(err){_iterator.e(err)}finally{_iterator.f()}}return typeof reviver==="function"?(0,_applyReviver.applyReviver)(reviver,{"":res},"",res):res}},{key:"toJSON",value:function toJSON(jsonArg,onAnchor){return this.toJS({json:true,jsonArg:jsonArg,mapAsMap:false,onAnchor:onAnchor})}},{key:"toString",value:function toString(){var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in options&&(!Number.isInteger(options.indent)||Number(options.indent)<=0)){var s=JSON.stringify(options.indent);throw new Error('"indent" option must be a positive integer, not '.concat(s))}return(0,_stringifyDocument.stringifyDocument)(this,options)}}])}();function assertCollection(contents){if((0,_identity.isCollection)(contents))return true;throw new Error("Expected a YAML collection as document contents")}},{"../nodes/Alias.js":248,"../nodes/Collection.js":249,"../nodes/Pair.js":251,"../nodes/identity.js":256,"../nodes/toJS.js":257,"../schema/Schema.js":266,"../stringify/stringifyDocument.js":290,"./anchors.js":241,"./applyReviver.js":242,"./createNode.js":243,"./directives.js":244}],241:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.anchorIsValid=anchorIsValid;exports.anchorNames=anchorNames;exports.createNodeAnchors=createNodeAnchors;exports.findNewAnchor=findNewAnchor;var _identity=require("../nodes/identity.js");var _visit=require("../visit.js");function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function anchorIsValid(anchor){if(/[\x00-\x19\s,[\]{}]/.test(anchor)){var sa=JSON.stringify(anchor);var msg="Anchor must not contain whitespace or control characters: ".concat(sa);throw new Error(msg)}return true}function anchorNames(root){var anchors=new Set;(0,_visit.visit)(root,{Value:function Value(_key,node){if(node.anchor)anchors.add(node.anchor)}});return anchors}function findNewAnchor(prefix,exclude){for(var i=1;true;++i){var name="".concat(prefix).concat(i);if(!exclude.has(name))return name}}function createNodeAnchors(doc,prefix){var aliasObjects=[];var sourceObjects=new Map;var prevAnchors=null;return{onAnchor:function onAnchor(source){aliasObjects.push(source);if(!prevAnchors)prevAnchors=anchorNames(doc);var anchor=findNewAnchor(prefix,prevAnchors);prevAnchors.add(anchor);return anchor},setAnchors:function setAnchors(){for(var _i=0,_aliasObjects=aliasObjects;_i<_aliasObjects.length;_i++){var source=_aliasObjects[_i];var ref=sourceObjects.get(source);if(_typeof(ref)==="object"&&ref.anchor&&((0,_identity.isScalar)(ref.node)||(0,_identity.isCollection)(ref.node))){ref.node.anchor=ref.anchor}else{var error=new Error("Failed to resolve repeated object (this should not happen)");error.source=source;throw error}}},sourceObjects:sourceObjects}}},{"../nodes/identity.js":256,"../visit.js":294}],242:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.applyReviver=applyReviver;function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}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 _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function applyReviver(reviver,obj,key,val){if(val&&_typeof(val)==="object"){if(Array.isArray(val)){for(var i=0,len=val.length;i<len;++i){var v0=val[i];var v1=applyReviver(reviver,val,String(i),v0);if(v1===undefined)delete val[i];else if(v1!==v0)val[i]=v1}}else if(val instanceof Map){for(var _i=0,_Array$from=Array.from(val.keys());_i<_Array$from.length;_i++){var k=_Array$from[_i];var _v=val.get(k);var _v2=applyReviver(reviver,val,k,_v);if(_v2===undefined)val["delete"](k);else if(_v2!==_v)val.set(k,_v2)}}else if(val instanceof Set){for(var _i2=0,_Array$from2=Array.from(val);_i2<_Array$from2.length;_i2++){var _v3=_Array$from2[_i2];var _v4=applyReviver(reviver,val,_v3,_v3);if(_v4===undefined)val["delete"](_v3);else if(_v4!==_v3){val["delete"](_v3);val.add(_v4)}}}else{for(var _i3=0,_Object$entries=Object.entries(val);_i3<_Object$entries.length;_i3++){var _Object$entries$_i=_slicedToArray(_Object$entries[_i3],2),_k=_Object$entries$_i[0],_v5=_Object$entries$_i[1];var _v6=applyReviver(reviver,val,_k,_v5);if(_v6===undefined)delete val[_k];else if(_v6!==_v5)val[_k]=_v6}}}return reviver.call(obj,key,val)}},{}],243:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.createNode=createNode;var _Alias=require("../nodes/Alias.js");var _identity=require("../nodes/identity.js");var _Scalar=require("../nodes/Scalar.js");function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}var defaultTagPrefix="tag:yaml.org,2002:";function findTagObject(value,tagName,tags){if(tagName){var _match$find;var match=tags.filter((function(t){return t.tag===tagName}));var tagObj=(_match$find=match.find((function(t){return!t.format})))!==null&&_match$find!==void 0?_match$find:match[0];if(!tagObj)throw new Error("Tag ".concat(tagName," not found"));return tagObj}return tags.find((function(t){var _t$identify;return((_t$identify=t.identify)===null||_t$identify===void 0?void 0:_t$identify.call(t,value))&&!t.format}))}function createNode(value,tagName,ctx){var _tagName,_tagObj,_tagObj2;if((0,_identity.isDocument)(value))value=value.contents;if((0,_identity.isNode)(value))return value;if((0,_identity.isPair)(value)){var _ctx$schema$MAP$creat,_ctx$schema$MAP;var map=(_ctx$schema$MAP$creat=(_ctx$schema$MAP=ctx.schema[_identity.MAP]).createNode)===null||_ctx$schema$MAP$creat===void 0?void 0:_ctx$schema$MAP$creat.call(_ctx$schema$MAP,ctx.schema,null,ctx);map.items.push(value);return map}if(value instanceof String||value instanceof Number||value instanceof Boolean||typeof BigInt!=="undefined"&&value instanceof BigInt){value=value.valueOf()}var aliasDuplicateObjects=ctx.aliasDuplicateObjects,onAnchor=ctx.onAnchor,onTagObj=ctx.onTagObj,schema=ctx.schema,sourceObjects=ctx.sourceObjects;var ref=undefined;if(aliasDuplicateObjects&&value&&_typeof(value)==="object"){ref=sourceObjects.get(value);if(ref){if(!ref.anchor)ref.anchor=onAnchor(value);return new _Alias.Alias(ref.anchor)}else{ref={anchor:null,node:null};sourceObjects.set(value,ref)}}if((_tagName=tagName)!==null&&_tagName!==void 0&&_tagName.startsWith("!!"))tagName=defaultTagPrefix+tagName.slice(2);var tagObj=findTagObject(value,tagName,schema.tags);if(!tagObj){if(value&&typeof value.toJSON==="function"){value=value.toJSON()}if(!value||_typeof(value)!=="object"){var _node=new _Scalar.Scalar(value);if(ref)ref.node=_node;return _node}tagObj=value instanceof Map?schema[_identity.MAP]:Symbol.iterator in Object(value)?schema[_identity.SEQ]:schema[_identity.MAP]}if(onTagObj){onTagObj(tagObj);delete ctx.onTagObj}var node=(_tagObj=tagObj)!==null&&_tagObj!==void 0&&_tagObj.createNode?tagObj.createNode(ctx.schema,value,ctx):typeof((_tagObj2=tagObj)===null||_tagObj2===void 0||(_tagObj2=_tagObj2.nodeClass)===null||_tagObj2===void 0?void 0:_tagObj2.from)==="function"?tagObj.nodeClass.from(ctx.schema,value,ctx):new _Scalar.Scalar(value);if(tagName)node.tag=tagName;else if(!tagObj["default"])node.tag=tagObj.tag;if(ref)ref.node=node;return node}},{"../nodes/Alias.js":248,"../nodes/Scalar.js":252,"../nodes/identity.js":256}],244:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.Directives=void 0;var _identity=require("../nodes/identity.js");var _visit=require("../visit.js");function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}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 _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var escapeChars={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"};var escapeTagName=function escapeTagName(tn){return tn.replace(/[!,[\]{}]/g,(function(ch){return escapeChars[ch]}))};var Directives=exports.Directives=function(){function Directives(yaml,tags){_classCallCheck(this,Directives);this.docStart=null;this.docEnd=false;this.yaml=Object.assign({},Directives.defaultYaml,yaml);this.tags=Object.assign({},Directives.defaultTags,tags)}return _createClass(Directives,[{key:"clone",value:function clone(){var copy=new Directives(this.yaml,this.tags);copy.docStart=this.docStart;return copy}},{key:"atDocument",value:function atDocument(){var res=new Directives(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=true;break;case"1.2":this.atNextDocument=false;this.yaml={explicit:Directives.defaultYaml.explicit,version:"1.2"};this.tags=Object.assign({},Directives.defaultTags);break}return res}},{key:"add",value:function add(line,onError){if(this.atNextDocument){this.yaml={explicit:Directives.defaultYaml.explicit,version:"1.1"};this.tags=Object.assign({},Directives.defaultTags);this.atNextDocument=false}var parts=line.trim().split(/[ \t]+/);var name=parts.shift();switch(name){case"%TAG":{if(parts.length!==2){onError(0,"%TAG directive should contain exactly two parts");if(parts.length<2)return false}var _parts=_slicedToArray(parts,2),handle=_parts[0],prefix=_parts[1];this.tags[handle]=prefix;return true}case"%YAML":{this.yaml.explicit=true;if(parts.length!==1){onError(0,"%YAML directive should contain exactly one part");return false}var _parts2=_slicedToArray(parts,1),version=_parts2[0];if(version==="1.1"||version==="1.2"){this.yaml.version=version;return true}else{var isValid=/^\d+\.\d+$/.test(version);onError(6,"Unsupported YAML version ".concat(version),isValid);return false}}default:onError(0,"Unknown directive ".concat(name),true);return false}}},{key:"tagName",value:function tagName(source,onError){if(source==="!")return"!";if(source[0]!=="!"){onError("Not a valid tag: ".concat(source));return null}if(source[1]==="<"){var verbatim=source.slice(2,-1);if(verbatim==="!"||verbatim==="!!"){onError("Verbatim tags aren't resolved, so ".concat(source," is invalid."));return null}if(source[source.length-1]!==">")onError("Verbatim tags must end with a >");return verbatim}var _source$match=source.match(/^([^]*!)([^!]*)$/),_source$match2=_slicedToArray(_source$match,3),handle=_source$match2[1],suffix=_source$match2[2];if(!suffix)onError("The ".concat(source," tag has no suffix"));var prefix=this.tags[handle];if(prefix){try{return prefix+decodeURIComponent(suffix)}catch(error){onError(String(error));return null}}if(handle==="!")return source;onError("Could not resolve tag: ".concat(source));return null}},{key:"tagString",value:function tagString(tag){for(var _i=0,_Object$entries=Object.entries(this.tags);_i<_Object$entries.length;_i++){var _Object$entries$_i=_slicedToArray(_Object$entries[_i],2),handle=_Object$entries$_i[0],prefix=_Object$entries$_i[1];if(tag.startsWith(prefix))return handle+escapeTagName(tag.substring(prefix.length))}return tag[0]==="!"?tag:"!<".concat(tag,">")}},{key:"toString",value:function toString(doc){var lines=this.yaml.explicit?["%YAML ".concat(this.yaml.version||"1.2")]:[];var tagEntries=Object.entries(this.tags);var tagNames;if(doc&&tagEntries.length>0&&(0,_identity.isNode)(doc.contents)){var tags={};(0,_visit.visit)(doc.contents,(function(_key,node){if((0,_identity.isNode)(node)&&node.tag)tags[node.tag]=true}));tagNames=Object.keys(tags)}else tagNames=[];var _loop=function _loop(){var _tagEntries$_i=_slicedToArray(_tagEntries[_i2],2),handle=_tagEntries$_i[0],prefix=_tagEntries$_i[1];if(handle==="!!"&&prefix==="tag:yaml.org,2002:")return 1;if(!doc||tagNames.some((function(tn){return tn.startsWith(prefix)})))lines.push("%TAG ".concat(handle," ").concat(prefix))};for(var _i2=0,_tagEntries=tagEntries;_i2<_tagEntries.length;_i2++){if(_loop())continue}return lines.join("\n")}}])}();Directives.defaultYaml={explicit:false,version:"1.2"};Directives.defaultTags={"!!":"tag:yaml.org,2002:"}},{"../nodes/identity.js":256,"../visit.js":294}],245:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}Object.defineProperty(exports,"__esModule",{value:true});exports.prettifyError=exports.YAMLWarning=exports.YAMLParseError=exports.YAMLError=void 0;function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _wrapNativeSuper(t){var r="function"==typeof Map?new Map:void 0;return _wrapNativeSuper=function _wrapNativeSuper(t){if(null===t||!_isNativeFunction(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,Wrapper)}function Wrapper(){return _construct(t,arguments,_getPrototypeOf(this).constructor)}return Wrapper.prototype=Object.create(t.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(Wrapper,t)},_wrapNativeSuper(t)}function _construct(t,e,r){if(_isNativeReflectConstruct())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,e);var p=new(t.bind.apply(t,o));return r&&_setPrototypeOf(p,r.prototype),p}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _isNativeFunction(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(n){return"function"==typeof t}}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}var YAMLError=exports.YAMLError=function(_Error){function YAMLError(name,pos,code,message){var _this;_classCallCheck(this,YAMLError);_this=_callSuper(this,YAMLError);_this.name=name;_this.code=code;_this.message=message;_this.pos=pos;return _this}_inherits(YAMLError,_Error);return _createClass(YAMLError)}(_wrapNativeSuper(Error));var YAMLParseError=exports.YAMLParseError=function(_YAMLError){function YAMLParseError(pos,code,message){_classCallCheck(this,YAMLParseError);return _callSuper(this,YAMLParseError,["YAMLParseError",pos,code,message])}_inherits(YAMLParseError,_YAMLError);return _createClass(YAMLParseError)}(YAMLError);var YAMLWarning=exports.YAMLWarning=function(_YAMLError2){function YAMLWarning(pos,code,message){_classCallCheck(this,YAMLWarning);return _callSuper(this,YAMLWarning,["YAMLWarning",pos,code,message])}_inherits(YAMLWarning,_YAMLError2);return _createClass(YAMLWarning)}(YAMLError);var prettifyError=exports.prettifyError=function prettifyError(src,lc){return function(error){if(error.pos[0]===-1)return;error.linePos=error.pos.map((function(pos){return lc.linePos(pos)}));var _error$linePos$=error.linePos[0],line=_error$linePos$.line,col=_error$linePos$.col;error.message+=" at line ".concat(line,", column ").concat(col);var ci=col-1;var lineStr=src.substring(lc.lineStarts[line-1],lc.lineStarts[line]).replace(/[\n\r]+$/,"");if(ci>=60&&lineStr.length>80){var trimStart=Math.min(ci-39,lineStr.length-79);lineStr="…"+lineStr.substring(trimStart);ci-=trimStart-1}if(lineStr.length>80)lineStr=lineStr.substring(0,79)+"…";if(line>1&&/^ *$/.test(lineStr.substring(0,ci))){var prev=src.substring(lc.lineStarts[line-2],lc.lineStarts[line-1]);if(prev.length>80)prev=prev.substring(0,79)+"…\n";lineStr=prev+lineStr}if(/[^ ]/.test(lineStr)){var count=1;var end=error.linePos[1];if(end&&end.line===line&&end.col>col){count=Math.max(1,Math.min(end.col-col,80-ci))}var pointer=" ".repeat(ci)+"^".repeat(count);error.message+=":\n\n".concat(lineStr,"\n").concat(pointer,"\n")}}}},{}],246:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"Alias",{enumerable:true,get:function get(){return _Alias.Alias}});exports.CST=void 0;Object.defineProperty(exports,"Composer",{enumerable:true,get:function get(){return _composer.Composer}});Object.defineProperty(exports,"Document",{enumerable:true,get:function get(){return _Document.Document}});Object.defineProperty(exports,"Lexer",{enumerable:true,get:function get(){return _lexer.Lexer}});Object.defineProperty(exports,"LineCounter",{enumerable:true,get:function get(){return _lineCounter.LineCounter}});Object.defineProperty(exports,"Pair",{enumerable:true,get:function get(){return _Pair.Pair}});Object.defineProperty(exports,"Parser",{enumerable:true,get:function get(){return _parser.Parser}});Object.defineProperty(exports,"Scalar",{enumerable:true,get:function get(){return _Scalar.Scalar}});Object.defineProperty(exports,"Schema",{enumerable:true,get:function get(){return _Schema.Schema}});Object.defineProperty(exports,"YAMLError",{enumerable:true,get:function get(){return _errors.YAMLError}});Object.defineProperty(exports,"YAMLMap",{enumerable:true,get:function get(){return _YAMLMap.YAMLMap}});Object.defineProperty(exports,"YAMLParseError",{enumerable:true,get:function get(){return _errors.YAMLParseError}});Object.defineProperty(exports,"YAMLSeq",{enumerable:true,get:function get(){return _YAMLSeq.YAMLSeq}});Object.defineProperty(exports,"YAMLWarning",{enumerable:true,get:function get(){return _errors.YAMLWarning}});Object.defineProperty(exports,"isAlias",{enumerable:true,get:function get(){return _identity.isAlias}});Object.defineProperty(exports,"isCollection",{enumerable:true,get:function get(){return _identity.isCollection}});Object.defineProperty(exports,"isDocument",{enumerable:true,get:function get(){return _identity.isDocument}});Object.defineProperty(exports,"isMap",{enumerable:true,get:function get(){return _identity.isMap}});Object.defineProperty(exports,"isNode",{enumerable:true,get:function get(){return _identity.isNode}});Object.defineProperty(exports,"isPair",{enumerable:true,get:function get(){return _identity.isPair}});Object.defineProperty(exports,"isScalar",{enumerable:true,get:function get(){return _identity.isScalar}});Object.defineProperty(exports,"isSeq",{enumerable:true,get:function get(){return _identity.isSeq}});Object.defineProperty(exports,"parse",{enumerable:true,get:function get(){return _publicApi.parse}});Object.defineProperty(exports,"parseAllDocuments",{enumerable:true,get:function get(){return _publicApi.parseAllDocuments}});Object.defineProperty(exports,"parseDocument",{enumerable:true,get:function get(){return _publicApi.parseDocument}});Object.defineProperty(exports,"stringify",{enumerable:true,get:function get(){return _publicApi.stringify}});Object.defineProperty(exports,"visit",{enumerable:true,get:function get(){return _visit.visit}});Object.defineProperty(exports,"visitAsync",{enumerable:true,get:function get(){return _visit.visitAsync}});var _composer=require("./compose/composer.js");var _Document=require("./doc/Document.js");var _Schema=require("./schema/Schema.js");var _errors=require("./errors.js");var _Alias=require("./nodes/Alias.js");var _identity=require("./nodes/identity.js");var _Pair=require("./nodes/Pair.js");var _Scalar=require("./nodes/Scalar.js");var _YAMLMap=require("./nodes/YAMLMap.js");var _YAMLSeq=require("./nodes/YAMLSeq.js");var cst=_interopRequireWildcard(require("./parse/cst.js"));exports.CST=cst;var _lexer=require("./parse/lexer.js");var _lineCounter=require("./parse/line-counter.js");var _parser=require("./parse/parser.js");var _publicApi=require("./public-api.js");var _visit=require("./visit.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=_typeof(e)&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u]}return n["default"]=e,t&&t.set(e,n),n}},{"./compose/composer.js":228,"./doc/Document.js":240,"./errors.js":245,"./nodes/Alias.js":248,"./nodes/Pair.js":251,"./nodes/Scalar.js":252,"./nodes/YAMLMap.js":253,"./nodes/YAMLSeq.js":254,"./nodes/identity.js":256,"./parse/cst.js":261,"./parse/lexer.js":262,"./parse/line-counter.js":263,"./parse/parser.js":264,"./public-api.js":265,"./schema/Schema.js":266,"./visit.js":294}],247:[function(require,module,exports){(function(process){(function(){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.debug=debug;exports.warn=warn;function debug(logLevel){var _console;for(var _len=arguments.length,messages=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){messages[_key-1]=arguments[_key]}if(logLevel==="debug")(_console=console).log.apply(_console,messages)}function warn(logLevel,warning){if(logLevel==="debug"||logLevel==="warn"){if(typeof process!=="undefined"&&process.emitWarning)process.emitWarning(warning);else console.warn(warning)}}}).call(this)}).call(this,require("_process"))},{_process:182}],248:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}Object.defineProperty(exports,"__esModule",{value:true});exports.Alias=void 0;var _anchors=require("../doc/anchors.js");var _visit=require("../visit.js");var _identity=require("./identity.js");var _Node=require("./Node.js");var _toJS=require("./toJS.js");function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}var Alias=exports.Alias=function(_NodeBase){function Alias(source){var _this;_classCallCheck(this,Alias);_this=_callSuper(this,Alias,[_identity.ALIAS]);_this.source=source;Object.defineProperty(_this,"tag",{set:function set(){throw new Error("Alias nodes cannot have tags")}});return _this}_inherits(Alias,_NodeBase);return _createClass(Alias,[{key:"resolve",value:function resolve(doc){var _this2=this;var found=undefined;(0,_visit.visit)(doc,{Node:function Node(_key,node){if(node===_this2)return _visit.visit.BREAK;if(node.anchor===_this2.source)found=node}});return found}},{key:"toJSON",value:function toJSON(_arg,ctx){if(!ctx)return{source:this.source};var anchors=ctx.anchors,doc=ctx.doc,maxAliasCount=ctx.maxAliasCount;var source=this.resolve(doc);if(!source){var msg="Unresolved alias (the anchor must be set before the alias): ".concat(this.source);throw new ReferenceError(msg)}var data=anchors.get(source);if(!data){(0,_toJS.toJS)(source,null,ctx);data=anchors.get(source)}if(!data||data.res===undefined){var _msg="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(_msg)}if(maxAliasCount>=0){data.count+=1;if(data.aliasCount===0)data.aliasCount=getAliasCount(doc,source,anchors);if(data.count*data.aliasCount>maxAliasCount){var _msg2="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(_msg2)}}return data.res}},{key:"toString",value:function toString(ctx,_onComment,_onChompKeep){var src="*".concat(this.source);if(ctx){(0,_anchors.anchorIsValid)(this.source);if(ctx.options.verifyAliasOrder&&!ctx.anchors.has(this.source)){var msg="Unresolved alias (the anchor must be set before the alias): ".concat(this.source);throw new Error(msg)}if(ctx.implicitKey)return"".concat(src," ")}return src}}])}(_Node.NodeBase);function getAliasCount(doc,node,anchors){if((0,_identity.isAlias)(node)){var source=node.resolve(doc);var anchor=anchors&&source&&anchors.get(source);return anchor?anchor.count*anchor.aliasCount:0}else if((0,_identity.isCollection)(node)){var count=0;var _iterator=_createForOfIteratorHelper(node.items),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var item=_step.value;var c=getAliasCount(doc,item,anchors);if(c>count)count=c}}catch(err){_iterator.e(err)}finally{_iterator.f()}return count}else if((0,_identity.isPair)(node)){var kc=getAliasCount(doc,node.key,anchors);var vc=getAliasCount(doc,node.value,anchors);return Math.max(kc,vc)}return 1}},{"../doc/anchors.js":241,"../visit.js":294,"./Node.js":250,"./identity.js":256,"./toJS.js":257}],249:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.Collection=void 0;exports.collectionFromPath=collectionFromPath;exports.isEmptyPath=void 0;var _createNode=require("../doc/createNode.js");var _identity=require("./identity.js");var _Node=require("./Node.js");function _toArray(r){return _arrayWithHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableRest()}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 _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}function _arrayWithHoles(r){if(Array.isArray(r))return r}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function collectionFromPath(schema,path,value){var v=value;for(var i=path.length-1;i>=0;--i){var k=path[i];if(typeof k==="number"&&Number.isInteger(k)&&k>=0){var a=[];a[k]=v;v=a}else{v=new Map([[k,v]])}}return(0,_createNode.createNode)(v,undefined,{aliasDuplicateObjects:false,keepUndefined:false,onAnchor:function onAnchor(){throw new Error("This should not happen, please report a bug.")},schema:schema,sourceObjects:new Map})}var isEmptyPath=exports.isEmptyPath=function isEmptyPath(path){return path==null||_typeof(path)==="object"&&!!path[Symbol.iterator]().next().done};var Collection=exports.Collection=function(_NodeBase){function Collection(type,schema){var _this;_classCallCheck(this,Collection);_this=_callSuper(this,Collection,[type]);Object.defineProperty(_this,"schema",{value:schema,configurable:true,enumerable:false,writable:true});return _this}_inherits(Collection,_NodeBase);return _createClass(Collection,[{key:"clone",value:function clone(schema){var copy=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(schema)copy.schema=schema;copy.items=copy.items.map((function(it){return(0,_identity.isNode)(it)||(0,_identity.isPair)(it)?it.clone(schema):it}));if(this.range)copy.range=this.range.slice();return copy}},{key:"addIn",value:function addIn(path,value){if(isEmptyPath(path))this.add(value);else{var _path=_toArray(path),key=_path[0],rest=_path.slice(1);var node=this.get(key,true);if((0,_identity.isCollection)(node))node.addIn(rest,value);else if(node===undefined&&this.schema)this.set(key,collectionFromPath(this.schema,rest,value));else throw new Error("Expected YAML collection at ".concat(key,". Remaining path: ").concat(rest))}}},{key:"deleteIn",value:function deleteIn(path){var _path2=_toArray(path),key=_path2[0],rest=_path2.slice(1);if(rest.length===0)return this["delete"](key);var node=this.get(key,true);if((0,_identity.isCollection)(node))return node.deleteIn(rest);else throw new Error("Expected YAML collection at ".concat(key,". Remaining path: ").concat(rest))}},{key:"getIn",value:function getIn(path,keepScalar){var _path3=_toArray(path),key=_path3[0],rest=_path3.slice(1);var node=this.get(key,true);if(rest.length===0)return!keepScalar&&(0,_identity.isScalar)(node)?node.value:node;else return(0,_identity.isCollection)(node)?node.getIn(rest,keepScalar):undefined}},{key:"hasAllNullValues",value:function hasAllNullValues(allowScalar){return this.items.every((function(node){if(!(0,_identity.isPair)(node))return false;var n=node.value;return n==null||allowScalar&&(0,_identity.isScalar)(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag}))}},{key:"hasIn",value:function hasIn(path){var _path4=_toArray(path),key=_path4[0],rest=_path4.slice(1);if(rest.length===0)return this.has(key);var node=this.get(key,true);return(0,_identity.isCollection)(node)?node.hasIn(rest):false}},{key:"setIn",value:function setIn(path,value){var _path5=_toArray(path),key=_path5[0],rest=_path5.slice(1);if(rest.length===0){this.set(key,value)}else{var node=this.get(key,true);if((0,_identity.isCollection)(node))node.setIn(rest,value);else if(node===undefined&&this.schema)this.set(key,collectionFromPath(this.schema,rest,value));else throw new Error("Expected YAML collection at ".concat(key,". Remaining path: ").concat(rest))}}}])}(_Node.NodeBase)},{"../doc/createNode.js":243,"./Node.js":250,"./identity.js":256}],250:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.NodeBase=void 0;var _applyReviver=require("../doc/applyReviver.js");var _identity=require("./identity.js");var _toJS2=require("./toJS.js");function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var NodeBase=exports.NodeBase=function(){function NodeBase(type){_classCallCheck(this,NodeBase);Object.defineProperty(this,_identity.NODE_TYPE,{value:type})}return _createClass(NodeBase,[{key:"clone",value:function clone(){var copy=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)copy.range=this.range.slice();return copy}},{key:"toJS",value:function toJS(doc){var _ref=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},mapAsMap=_ref.mapAsMap,maxAliasCount=_ref.maxAliasCount,onAnchor=_ref.onAnchor,reviver=_ref.reviver;if(!(0,_identity.isDocument)(doc))throw new TypeError("A document argument is required");var ctx={anchors:new Map,doc:doc,keep:true,mapAsMap:mapAsMap===true,mapKeyWarned:false,maxAliasCount:typeof maxAliasCount==="number"?maxAliasCount:100};var res=(0,_toJS2.toJS)(this,"",ctx);if(typeof onAnchor==="function"){var _iterator=_createForOfIteratorHelper(ctx.anchors.values()),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var _step$value=_step.value,count=_step$value.count,_res=_step$value.res;onAnchor(_res,count)}}catch(err){_iterator.e(err)}finally{_iterator.f()}}return typeof reviver==="function"?(0,_applyReviver.applyReviver)(reviver,{"":res},"",res):res}}])}()},{"../doc/applyReviver.js":242,"./identity.js":256,"./toJS.js":257}],251:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.Pair=void 0;exports.createPair=createPair;var _createNode=require("../doc/createNode.js");var _stringifyPair=require("../stringify/stringifyPair.js");var _addPairToJSMap=require("./addPairToJSMap.js");var _identity=require("./identity.js");function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function createPair(key,value,ctx){var k=(0,_createNode.createNode)(key,undefined,ctx);var v=(0,_createNode.createNode)(value,undefined,ctx);return new Pair(k,v)}var Pair=exports.Pair=function(){function Pair(key){var value=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;_classCallCheck(this,Pair);Object.defineProperty(this,_identity.NODE_TYPE,{value:_identity.PAIR});this.key=key;this.value=value}return _createClass(Pair,[{key:"clone",value:function clone(schema){var key=this.key,value=this.value;if((0,_identity.isNode)(key))key=key.clone(schema);if((0,_identity.isNode)(value))value=value.clone(schema);return new Pair(key,value)}},{key:"toJSON",value:function toJSON(_,ctx){var pair=ctx!==null&&ctx!==void 0&&ctx.mapAsMap?new Map:{};return(0,_addPairToJSMap.addPairToJSMap)(ctx,pair,this)}},{key:"toString",value:function toString(ctx,onComment,onChompKeep){return ctx!==null&&ctx!==void 0&&ctx.doc?(0,_stringifyPair.stringifyPair)(this,ctx,onComment,onChompKeep):JSON.stringify(this)}}])}()},{"../doc/createNode.js":243,"../stringify/stringifyPair.js":292,"./addPairToJSMap.js":255,"./identity.js":256}],252:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.isScalarValue=exports.Scalar=void 0;var _identity=require("./identity.js");var _Node=require("./Node.js");var _toJS=require("./toJS.js");function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}var isScalarValue=exports.isScalarValue=function isScalarValue(value){return!value||typeof value!=="function"&&_typeof(value)!=="object"};var Scalar=exports.Scalar=function(_NodeBase){function Scalar(value){var _this;_classCallCheck(this,Scalar);_this=_callSuper(this,Scalar,[_identity.SCALAR]);_this.value=value;return _this}_inherits(Scalar,_NodeBase);return _createClass(Scalar,[{key:"toJSON",value:function toJSON(arg,ctx){return ctx!==null&&ctx!==void 0&&ctx.keep?this.value:(0,_toJS.toJS)(this.value,arg,ctx)}},{key:"toString",value:function toString(){return String(this.value)}}])}(_Node.NodeBase);Scalar.BLOCK_FOLDED="BLOCK_FOLDED";Scalar.BLOCK_LITERAL="BLOCK_LITERAL";Scalar.PLAIN="PLAIN";Scalar.QUOTE_DOUBLE="QUOTE_DOUBLE";Scalar.QUOTE_SINGLE="QUOTE_SINGLE"},{"./Node.js":250,"./identity.js":256,"./toJS.js":257}],253:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.YAMLMap=void 0;exports.findPair=findPair;var _stringifyCollection=require("../stringify/stringifyCollection.js");var _addPairToJSMap=require("./addPairToJSMap.js");var _Collection2=require("./Collection.js");var _identity=require("./identity.js");var _Pair=require("./Pair.js");var _Scalar=require("./Scalar.js");function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}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 _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function findPair(items,key){var k=(0,_identity.isScalar)(key)?key.value:key;var _iterator=_createForOfIteratorHelper(items),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var it=_step.value;if((0,_identity.isPair)(it)){if(it.key===key||it.key===k)return it;if((0,_identity.isScalar)(it.key)&&it.key.value===k)return it}}}catch(err){_iterator.e(err)}finally{_iterator.f()}return undefined}var YAMLMap=exports.YAMLMap=function(_Collection){function YAMLMap(schema){var _this;_classCallCheck(this,YAMLMap);_this=_callSuper(this,YAMLMap,[_identity.MAP,schema]);_this.items=[];return _this}_inherits(YAMLMap,_Collection);return _createClass(YAMLMap,[{key:"add",value:function add(pair,overwrite){var _this$schema;var _pair;if((0,_identity.isPair)(pair))_pair=pair;else if(!pair||_typeof(pair)!=="object"||!("key"in pair)){_pair=new _Pair.Pair(pair,pair===null||pair===void 0?void 0:pair.value)}else _pair=new _Pair.Pair(pair.key,pair.value);var prev=findPair(this.items,_pair.key);var sortEntries=(_this$schema=this.schema)===null||_this$schema===void 0?void 0:_this$schema.sortMapEntries;if(prev){if(!overwrite)throw new Error("Key ".concat(_pair.key," already set"));if((0,_identity.isScalar)(prev.value)&&(0,_Scalar.isScalarValue)(_pair.value))prev.value.value=_pair.value;else prev.value=_pair.value}else if(sortEntries){var i=this.items.findIndex((function(item){return sortEntries(_pair,item)<0}));if(i===-1)this.items.push(_pair);else this.items.splice(i,0,_pair)}else{this.items.push(_pair)}}},{key:"delete",value:function _delete(key){var it=findPair(this.items,key);if(!it)return false;var del=this.items.splice(this.items.indexOf(it),1);return del.length>0}},{key:"get",value:function get(key,keepScalar){var _ref;var it=findPair(this.items,key);var node=it===null||it===void 0?void 0:it.value;return(_ref=!keepScalar&&(0,_identity.isScalar)(node)?node.value:node)!==null&&_ref!==void 0?_ref:undefined}},{key:"has",value:function has(key){return!!findPair(this.items,key)}},{key:"set",value:function set(key,value){this.add(new _Pair.Pair(key,value),true)}},{key:"toJSON",value:function toJSON(_,ctx,Type){var map=Type?new Type:ctx!==null&&ctx!==void 0&&ctx.mapAsMap?new Map:{};if(ctx!==null&&ctx!==void 0&&ctx.onCreate)ctx.onCreate(map);var _iterator2=_createForOfIteratorHelper(this.items),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var item=_step2.value;(0,_addPairToJSMap.addPairToJSMap)(ctx,map,item)}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}return map}},{key:"toString",value:function toString(ctx,onComment,onChompKeep){if(!ctx)return JSON.stringify(this);var _iterator3=_createForOfIteratorHelper(this.items),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var item=_step3.value;if(!(0,_identity.isPair)(item))throw new Error("Map items must all be pairs; found ".concat(JSON.stringify(item)," instead"))}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}if(!ctx.allNullValues&&this.hasAllNullValues(false))ctx=Object.assign({},ctx,{allNullValues:true});return(0,_stringifyCollection.stringifyCollection)(this,ctx,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:ctx.indent||"",onChompKeep:onChompKeep,onComment:onComment})}}],[{key:"tagName",get:function get(){return"tag:yaml.org,2002:map"}},{key:"from",value:function from(schema,obj,ctx){var keepUndefined=ctx.keepUndefined,replacer=ctx.replacer;var map=new this(schema);var add=function add(key,value){if(typeof replacer==="function")value=replacer.call(obj,key,value);else if(Array.isArray(replacer)&&!replacer.includes(key))return;if(value!==undefined||keepUndefined)map.items.push((0,_Pair.createPair)(key,value,ctx))};if(obj instanceof Map){var _iterator4=_createForOfIteratorHelper(obj),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var _step4$value=_slicedToArray(_step4.value,2),key=_step4$value[0],value=_step4$value[1];add(key,value)}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}}else if(obj&&_typeof(obj)==="object"){for(var _i=0,_Object$keys=Object.keys(obj);_i<_Object$keys.length;_i++){var _key=_Object$keys[_i];add(_key,obj[_key])}}if(typeof schema.sortMapEntries==="function"){map.items.sort(schema.sortMapEntries)}return map}}])}(_Collection2.Collection)},{"../stringify/stringifyCollection.js":288,"./Collection.js":249,"./Pair.js":251,"./Scalar.js":252,"./addPairToJSMap.js":255,"./identity.js":256}],254:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}Object.defineProperty(exports,"__esModule",{value:true});exports.YAMLSeq=void 0;var _createNode=require("../doc/createNode.js");var _stringifyCollection=require("../stringify/stringifyCollection.js");var _Collection2=require("./Collection.js");var _identity=require("./identity.js");var _Scalar=require("./Scalar.js");var _toJS=require("./toJS.js");function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}var YAMLSeq=exports.YAMLSeq=function(_Collection){function YAMLSeq(schema){var _this;_classCallCheck(this,YAMLSeq);_this=_callSuper(this,YAMLSeq,[_identity.SEQ,schema]);_this.items=[];return _this}_inherits(YAMLSeq,_Collection);return _createClass(YAMLSeq,[{key:"add",value:function add(value){this.items.push(value)}},{key:"delete",value:function _delete(key){var idx=asItemIndex(key);if(typeof idx!=="number")return false;var del=this.items.splice(idx,1);return del.length>0}},{key:"get",value:function get(key,keepScalar){var idx=asItemIndex(key);if(typeof idx!=="number")return undefined;var it=this.items[idx];return!keepScalar&&(0,_identity.isScalar)(it)?it.value:it}},{key:"has",value:function has(key){var idx=asItemIndex(key);return typeof idx==="number"&&idx<this.items.length}},{key:"set",value:function set(key,value){var idx=asItemIndex(key);if(typeof idx!=="number")throw new Error("Expected a valid index, not ".concat(key,"."));var prev=this.items[idx];if((0,_identity.isScalar)(prev)&&(0,_Scalar.isScalarValue)(value))prev.value=value;else this.items[idx]=value}},{key:"toJSON",value:function toJSON(_,ctx){var seq=[];if(ctx!==null&&ctx!==void 0&&ctx.onCreate)ctx.onCreate(seq);var i=0;var _iterator=_createForOfIteratorHelper(this.items),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var item=_step.value;seq.push((0,_toJS.toJS)(item,String(i++),ctx))}}catch(err){_iterator.e(err)}finally{_iterator.f()}return seq}},{key:"toString",value:function toString(ctx,onComment,onChompKeep){if(!ctx)return JSON.stringify(this);return(0,_stringifyCollection.stringifyCollection)(this,ctx,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(ctx.indent||"")+" ",onChompKeep:onChompKeep,onComment:onComment})}}],[{key:"tagName",get:function get(){return"tag:yaml.org,2002:seq"}},{key:"from",value:function from(schema,obj,ctx){var replacer=ctx.replacer;var seq=new this(schema);if(obj&&Symbol.iterator in Object(obj)){var i=0;var _iterator2=_createForOfIteratorHelper(obj),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var it=_step2.value;if(typeof replacer==="function"){var key=obj instanceof Set?it:String(i++);it=replacer.call(obj,key,it)}seq.items.push((0,_createNode.createNode)(it,undefined,ctx))}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}}return seq}}])}(_Collection2.Collection);function asItemIndex(key){var idx=(0,_identity.isScalar)(key)?key.value:key;if(idx&&typeof idx==="string")idx=Number(idx);return typeof idx==="number"&&Number.isInteger(idx)&&idx>=0?idx:null}},{"../doc/createNode.js":243,"../stringify/stringifyCollection.js":288,"./Collection.js":249,"./Scalar.js":252,"./identity.js":256,"./toJS.js":257}],255:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.addPairToJSMap=addPairToJSMap;var _log=require("../log.js");var _stringify=require("../stringify/stringify.js");var _identity=require("./identity.js");var _Scalar=require("./Scalar.js");var _toJS=require("./toJS.js");function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}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 _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}var MERGE_KEY="<<";function addPairToJSMap(ctx,map,_ref){var key=_ref.key,value=_ref.value;if(ctx!==null&&ctx!==void 0&&ctx.doc.schema.merge&&isMergeKey(key)){value=(0,_identity.isAlias)(value)?value.resolve(ctx.doc):value;if((0,_identity.isSeq)(value)){var _iterator=_createForOfIteratorHelper(value.items),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var it=_step.value;mergeToJSMap(ctx,map,it)}}catch(err){_iterator.e(err)}finally{_iterator.f()}}else if(Array.isArray(value)){var _iterator2=_createForOfIteratorHelper(value),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var _it=_step2.value;mergeToJSMap(ctx,map,_it)}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}}else mergeToJSMap(ctx,map,value)}else{var jsKey=(0,_toJS.toJS)(key,"",ctx);if(map instanceof Map){map.set(jsKey,(0,_toJS.toJS)(value,jsKey,ctx))}else if(map instanceof Set){map.add(jsKey)}else{var stringKey=stringifyKey(key,jsKey,ctx);var jsValue=(0,_toJS.toJS)(value,stringKey,ctx);if(stringKey in map)Object.defineProperty(map,stringKey,{value:jsValue,writable:true,enumerable:true,configurable:true});else map[stringKey]=jsValue}}return map}var isMergeKey=function isMergeKey(key){return key===MERGE_KEY||(0,_identity.isScalar)(key)&&key.value===MERGE_KEY&&(!key.type||key.type===_Scalar.Scalar.PLAIN)};function mergeToJSMap(ctx,map,value){var source=ctx&&(0,_identity.isAlias)(value)?value.resolve(ctx.doc):value;if(!(0,_identity.isMap)(source))throw new Error("Merge sources must be maps or map aliases");var srcMap=source.toJSON(null,ctx,Map);var _iterator3=_createForOfIteratorHelper(srcMap),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var _step3$value=_slicedToArray(_step3.value,2),key=_step3$value[0],_value=_step3$value[1];if(map instanceof Map){if(!map.has(key))map.set(key,_value)}else if(map instanceof Set){map.add(key)}else if(!Object.prototype.hasOwnProperty.call(map,key)){Object.defineProperty(map,key,{value:_value,writable:true,enumerable:true,configurable:true})}}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}return map}function stringifyKey(key,jsKey,ctx){if(jsKey===null)return"";if(_typeof(jsKey)!=="object")return String(jsKey);if((0,_identity.isNode)(key)&&ctx!==null&&ctx!==void 0&&ctx.doc){var strCtx=(0,_stringify.createStringifyContext)(ctx.doc,{});strCtx.anchors=new Set;var _iterator4=_createForOfIteratorHelper(ctx.anchors.keys()),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var node=_step4.value;strCtx.anchors.add(node.anchor)}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}strCtx.inFlow=true;strCtx.inStringifyKey=true;var strKey=key.toString(strCtx);if(!ctx.mapKeyWarned){var jsonStr=JSON.stringify(strKey);if(jsonStr.length>40)jsonStr=jsonStr.substring(0,36)+'..."';(0,_log.warn)(ctx.doc.options.logLevel,"Keys with collection values will be stringified due to JS Object restrictions: ".concat(jsonStr,". Set mapAsMap: true to use object keys."));ctx.mapKeyWarned=true}return strKey}return JSON.stringify(jsKey)}},{"../log.js":247,"../stringify/stringify.js":287,"./Scalar.js":252,"./identity.js":256,"./toJS.js":257}],256:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.isAlias=exports.hasAnchor=exports.SEQ=exports.SCALAR=exports.PAIR=exports.NODE_TYPE=exports.MAP=exports.DOC=exports.ALIAS=void 0;exports.isCollection=isCollection;exports.isMap=exports.isDocument=void 0;exports.isNode=isNode;exports.isSeq=exports.isScalar=exports.isPair=void 0;function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}var ALIAS=exports.ALIAS=Symbol["for"]("yaml.alias");var DOC=exports.DOC=Symbol["for"]("yaml.document");var MAP=exports.MAP=Symbol["for"]("yaml.map");var PAIR=exports.PAIR=Symbol["for"]("yaml.pair");var SCALAR=exports.SCALAR=Symbol["for"]("yaml.scalar");var SEQ=exports.SEQ=Symbol["for"]("yaml.seq");var NODE_TYPE=exports.NODE_TYPE=Symbol["for"]("yaml.node.type");var isAlias=exports.isAlias=function isAlias(node){return!!node&&_typeof(node)==="object"&&node[NODE_TYPE]===ALIAS};var isDocument=exports.isDocument=function isDocument(node){return!!node&&_typeof(node)==="object"&&node[NODE_TYPE]===DOC};var isMap=exports.isMap=function isMap(node){return!!node&&_typeof(node)==="object"&&node[NODE_TYPE]===MAP};var isPair=exports.isPair=function isPair(node){return!!node&&_typeof(node)==="object"&&node[NODE_TYPE]===PAIR};var isScalar=exports.isScalar=function isScalar(node){return!!node&&_typeof(node)==="object"&&node[NODE_TYPE]===SCALAR};var isSeq=exports.isSeq=function isSeq(node){return!!node&&_typeof(node)==="object"&&node[NODE_TYPE]===SEQ};function isCollection(node){if(node&&_typeof(node)==="object")switch(node[NODE_TYPE]){case MAP:case SEQ:return true}return false}function isNode(node){if(node&&_typeof(node)==="object")switch(node[NODE_TYPE]){case ALIAS:case MAP:case SCALAR:case SEQ:return true}return false}var hasAnchor=exports.hasAnchor=function hasAnchor(node){return(isScalar(node)||isCollection(node))&&!!node.anchor}},{}],257:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.toJS=toJS;var _identity=require("./identity.js");function toJS(value,arg,ctx){if(Array.isArray(value))return value.map((function(v,i){return toJS(v,String(i),ctx)}));if(value&&typeof value.toJSON==="function"){if(!ctx||!(0,_identity.hasAnchor)(value))return value.toJSON(arg,ctx);var data={aliasCount:0,count:1,res:undefined};ctx.anchors.set(value,data);ctx.onCreate=function(res){data.res=res;delete ctx.onCreate};var res=value.toJSON(arg,ctx);if(ctx.onCreate)ctx.onCreate(res);return res}if(typeof value==="bigint"&&!(ctx!==null&&ctx!==void 0&&ctx.keep))return Number(value);return value}},{"./identity.js":256}],258:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.createScalarToken=createScalarToken;exports.resolveAsScalar=resolveAsScalar;exports.setScalarValue=setScalarValue;var _resolveBlockScalar=require("../compose/resolve-block-scalar.js");var _resolveFlowScalar=require("../compose/resolve-flow-scalar.js");var _errors=require("../errors.js");var _stringifyString=require("../stringify/stringifyString.js");function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function resolveAsScalar(token){var strict=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;var onError=arguments.length>2?arguments[2]:undefined;if(token){var _onError=function _onError(pos,code,message){var offset=typeof pos==="number"?pos:Array.isArray(pos)?pos[0]:pos.offset;if(onError)onError(offset,code,message);else throw new _errors.YAMLParseError([offset,offset+1],code,message)};switch(token.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return(0,_resolveFlowScalar.resolveFlowScalar)(token,strict,_onError);case"block-scalar":return(0,_resolveBlockScalar.resolveBlockScalar)({options:{strict:strict}},token,_onError)}}return null}function createScalarToken(value,context){var _context$end;var _context$implicitKey=context.implicitKey,implicitKey=_context$implicitKey===void 0?false:_context$implicitKey,indent=context.indent,_context$inFlow=context.inFlow,inFlow=_context$inFlow===void 0?false:_context$inFlow,_context$offset=context.offset,offset=_context$offset===void 0?-1:_context$offset,_context$type=context.type,type=_context$type===void 0?"PLAIN":_context$type;var source=(0,_stringifyString.stringifyString)({type:type,value:value},{implicitKey:implicitKey,indent:indent>0?" ".repeat(indent):"",inFlow:inFlow,options:{blockQuote:true,lineWidth:-1}});var end=(_context$end=context.end)!==null&&_context$end!==void 0?_context$end:[{type:"newline",offset:-1,indent:indent,source:"\n"}];switch(source[0]){case"|":case">":{var he=source.indexOf("\n");var head=source.substring(0,he);var body=source.substring(he+1)+"\n";var props=[{type:"block-scalar-header",offset:offset,indent:indent,source:head}];if(!addEndtoBlockProps(props,end))props.push({type:"newline",offset:-1,indent:indent,source:"\n"});return{type:"block-scalar",offset:offset,indent:indent,props:props,source:body}}case'"':return{type:"double-quoted-scalar",offset:offset,indent:indent,source:source,end:end};case"'":return{type:"single-quoted-scalar",offset:offset,indent:indent,source:source,end:end};default:return{type:"scalar",offset:offset,indent:indent,source:source,end:end}}}function setScalarValue(token,value){var context=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var _context$afterKey=context.afterKey,afterKey=_context$afterKey===void 0?false:_context$afterKey,_context$implicitKey2=context.implicitKey,implicitKey=_context$implicitKey2===void 0?false:_context$implicitKey2,_context$inFlow2=context.inFlow,inFlow=_context$inFlow2===void 0?false:_context$inFlow2,type=context.type;var indent="indent"in token?token.indent:null;if(afterKey&&typeof indent==="number")indent+=2;if(!type)switch(token.type){case"single-quoted-scalar":type="QUOTE_SINGLE";break;case"double-quoted-scalar":type="QUOTE_DOUBLE";break;case"block-scalar":{var header=token.props[0];if(header.type!=="block-scalar-header")throw new Error("Invalid block scalar header");type=header.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:type="PLAIN"}var source=(0,_stringifyString.stringifyString)({type:type,value:value},{implicitKey:implicitKey||indent===null,indent:indent!==null&&indent>0?" ".repeat(indent):"",inFlow:inFlow,options:{blockQuote:true,lineWidth:-1}});switch(source[0]){case"|":case">":setBlockScalarValue(token,source);break;case'"':setFlowScalarValue(token,source,"double-quoted-scalar");break;case"'":setFlowScalarValue(token,source,"single-quoted-scalar");break;default:setFlowScalarValue(token,source,"scalar")}}function setBlockScalarValue(token,source){var he=source.indexOf("\n");var head=source.substring(0,he);var body=source.substring(he+1)+"\n";if(token.type==="block-scalar"){var header=token.props[0];if(header.type!=="block-scalar-header")throw new Error("Invalid block scalar header");header.source=head;token.source=body}else{var offset=token.offset;var indent="indent"in token?token.indent:-1;var props=[{type:"block-scalar-header",offset:offset,indent:indent,source:head}];if(!addEndtoBlockProps(props,"end"in token?token.end:undefined))props.push({type:"newline",offset:-1,indent:indent,source:"\n"});for(var _i=0,_Object$keys=Object.keys(token);_i<_Object$keys.length;_i++){var key=_Object$keys[_i];if(key!=="type"&&key!=="offset")delete token[key]}Object.assign(token,{type:"block-scalar",indent:indent,props:props,source:body})}}function addEndtoBlockProps(props,end){if(end){var _iterator=_createForOfIteratorHelper(end),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var st=_step.value;switch(st.type){case"space":case"comment":props.push(st);break;case"newline":props.push(st);return true}}}catch(err){_iterator.e(err)}finally{_iterator.f()}}return false}function setFlowScalarValue(token,source,type){switch(token.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":token.type=type;token.source=source;break;case"block-scalar":{var end=token.props.slice(1);var oa=source.length;if(token.props[0].type==="block-scalar-header")oa-=token.props[0].source.length;var _iterator2=_createForOfIteratorHelper(end),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var tok=_step2.value;tok.offset+=oa}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}delete token.props;Object.assign(token,{type:type,source:source,end:end});break}case"block-map":case"block-seq":{var offset=token.offset+source.length;var nl={type:"newline",offset:offset,indent:token.indent,source:"\n"};delete token.items;Object.assign(token,{type:type,source:source,end:[nl]});break}default:{var indent="indent"in token?token.indent:-1;var _end="end"in token&&Array.isArray(token.end)?token.end.filter((function(st){return st.type==="space"||st.type==="comment"||st.type==="newline"})):[];for(var _i2=0,_Object$keys2=Object.keys(token);_i2<_Object$keys2.length;_i2++){var key=_Object$keys2[_i2];if(key!=="type"&&key!=="offset")delete token[key]}Object.assign(token,{type:type,indent:indent,source:source,end:_end})}}}},{"../compose/resolve-block-scalar.js":230,"../compose/resolve-flow-scalar.js":234,"../errors.js":245,"../stringify/stringifyString.js":293}],259:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.stringify=void 0;function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}var stringify=exports.stringify=function stringify(cst){return"type"in cst?stringifyToken(cst):stringifyItem(cst)};function stringifyToken(token){switch(token.type){case"block-scalar":{var res="";var _iterator=_createForOfIteratorHelper(token.props),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var tok=_step.value;res+=stringifyToken(tok)}}catch(err){_iterator.e(err)}finally{_iterator.f()}return res+token.source}case"block-map":case"block-seq":{var _res="";var _iterator2=_createForOfIteratorHelper(token.items),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var item=_step2.value;_res+=stringifyItem(item)}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}return _res}case"flow-collection":{var _res2=token.start.source;var _iterator3=_createForOfIteratorHelper(token.items),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var _item=_step3.value;_res2+=stringifyItem(_item)}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}var _iterator4=_createForOfIteratorHelper(token.end),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var st=_step4.value;_res2+=st.source}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}return _res2}case"document":{var _res3=stringifyItem(token);if(token.end){var _iterator5=_createForOfIteratorHelper(token.end),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var _st=_step5.value;_res3+=_st.source}}catch(err){_iterator5.e(err)}finally{_iterator5.f()}}return _res3}default:{var _res4=token.source;if("end"in token&&token.end){var _iterator6=_createForOfIteratorHelper(token.end),_step6;try{for(_iterator6.s();!(_step6=_iterator6.n()).done;){var _st2=_step6.value;_res4+=_st2.source}}catch(err){_iterator6.e(err)}finally{_iterator6.f()}}return _res4}}}function stringifyItem(_ref){var start=_ref.start,key=_ref.key,sep=_ref.sep,value=_ref.value;var res="";var _iterator7=_createForOfIteratorHelper(start),_step7;try{for(_iterator7.s();!(_step7=_iterator7.n()).done;){var _st3=_step7.value;res+=_st3.source}}catch(err){_iterator7.e(err)}finally{_iterator7.f()}if(key)res+=stringifyToken(key);if(sep){var _iterator8=_createForOfIteratorHelper(sep),_step8;try{for(_iterator8.s();!(_step8=_iterator8.n()).done;){var st=_step8.value;res+=st.source}}catch(err){_iterator8.e(err)}finally{_iterator8.f()}}if(value)res+=stringifyToken(value);return res}},{}],260:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.visit=visit;function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}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 _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}var BREAK=Symbol("break visit");var SKIP=Symbol("skip children");var REMOVE=Symbol("remove item");function visit(cst,visitor){if("type"in cst&&cst.type==="document")cst={start:cst.start,value:cst.value};_visit(Object.freeze([]),cst,visitor)}visit.BREAK=BREAK;visit.SKIP=SKIP;visit.REMOVE=REMOVE;visit.itemAtPath=function(cst,path){var item=cst;var _iterator=_createForOfIteratorHelper(path),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var _item;var _step$value=_slicedToArray(_step.value,2),field=_step$value[0],index=_step$value[1];var tok=(_item=item)===null||_item===void 0?void 0:_item[field];if(tok&&"items"in tok){item=tok.items[index]}else return undefined}}catch(err){_iterator.e(err)}finally{_iterator.f()}return item};visit.parentCollection=function(cst,path){var parent=visit.itemAtPath(cst,path.slice(0,-1));var field=path[path.length-1][0];var coll=parent===null||parent===void 0?void 0:parent[field];if(coll&&"items"in coll)return coll;throw new Error("Parent collection not found")};function _visit(path,item,visitor){var ctrl=visitor(item,path);if(_typeof(ctrl)==="symbol")return ctrl;for(var _i=0,_arr=["key","value"];_i<_arr.length;_i++){var field=_arr[_i];var token=item[field];if(token&&"items"in token){for(var i=0;i<token.items.length;++i){var ci=_visit(Object.freeze(path.concat([[field,i]])),token.items[i],visitor);if(typeof ci==="number")i=ci-1;else if(ci===BREAK)return BREAK;else if(ci===REMOVE){token.items.splice(i,1);i-=1}}if(typeof ctrl==="function"&&field==="key")ctrl=ctrl(item,path)}}return typeof ctrl==="function"?ctrl(item,path):ctrl}},{}],261:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.SCALAR=exports.FLOW_END=exports.DOCUMENT=exports.BOM=void 0;Object.defineProperty(exports,"createScalarToken",{enumerable:true,get:function get(){return _cstScalar.createScalarToken}});exports.isScalar=exports.isCollection=void 0;exports.prettyToken=prettyToken;Object.defineProperty(exports,"resolveAsScalar",{enumerable:true,get:function get(){return _cstScalar.resolveAsScalar}});Object.defineProperty(exports,"setScalarValue",{enumerable:true,get:function get(){return _cstScalar.setScalarValue}});Object.defineProperty(exports,"stringify",{enumerable:true,get:function get(){return _cstStringify.stringify}});exports.tokenType=tokenType;Object.defineProperty(exports,"visit",{enumerable:true,get:function get(){return _cstVisit.visit}});var _cstScalar=require("./cst-scalar.js");var _cstStringify=require("./cst-stringify.js");var _cstVisit=require("./cst-visit.js");var BOM=exports.BOM="\ufeff";var DOCUMENT=exports.DOCUMENT="";var FLOW_END=exports.FLOW_END="";var SCALAR=exports.SCALAR="";var isCollection=exports.isCollection=function isCollection(token){return!!token&&"items"in token};var isScalar=exports.isScalar=function isScalar(token){return!!token&&(token.type==="scalar"||token.type==="single-quoted-scalar"||token.type==="double-quoted-scalar"||token.type==="block-scalar")};function prettyToken(token){switch(token){case BOM:return"<BOM>";case DOCUMENT:return"<DOC>";case FLOW_END:return"<FLOW_END>";case SCALAR:return"<SCALAR>";default:return JSON.stringify(token)}}function tokenType(source){switch(source){case BOM:return"byte-order-mark";case DOCUMENT:return"doc-mode";case FLOW_END:return"flow-error-end";case SCALAR:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case"\n":case"\r\n":return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(source[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}},{"./cst-scalar.js":258,"./cst-stringify.js":259,"./cst-visit.js":260}],262:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.Lexer=void 0;var _cst=require("./cst.js");function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}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 _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{define({},"")}catch(t){define=function define(t,e,r){return t[e]=r}}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,(function(){return this}));var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach((function(e){define(t,e,(function(t){return this._invoke(e,t)}))}))}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){invoke("next",t,i,a)}),(function(t){invoke("throw",t,i,a)})):e.resolve(h).then((function(t){u.value=t,i(u)}),(function(t){return invoke("throw",t,i,a)}))}a(c.arg)}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e((function(e,r){invoke(t,n,e,r)}))}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done}}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg)}}}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next};return i.next=i}}throw new TypeError(_typeof(e)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t},e.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,(function(){return this})),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,(function(){return this})),define(g,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next}return next.done=!0,next}},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y}},catch:function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function isEmpty(ch){switch(ch){case undefined:case" ":case"\n":case"\r":case"\t":return true;default:return false}}var hexDigits=new Set("0123456789ABCDEFabcdef");var tagChars=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()");var flowIndicatorChars=new Set(",[]{}");var invalidAnchorChars=new Set(" ,[]{}\n\r\t");var isNotAnchorChar=function isNotAnchorChar(ch){return!ch||invalidAnchorChars.has(ch)};var Lexer=exports.Lexer=function(){function Lexer(){_classCallCheck(this,Lexer);this.atEnd=false;this.blockScalarIndent=-1;this.blockScalarKeep=false;this.buffer="";this.flowKey=false;this.flowLevel=0;this.indentNext=0;this.indentValue=0;this.lineEndPos=null;this.next=null;this.pos=0}return _createClass(Lexer,[{key:"lex",value:function lex(source){var _this=this;var incomplete=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;return _regeneratorRuntime().mark((function _callee(_this$next){var next;return _regeneratorRuntime().wrap((function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:if(!source){_context.next=5;break}if(!(typeof source!=="string")){_context.next=3;break}throw TypeError("source is not a string");case 3:_this.buffer=_this.buffer?_this.buffer+source:source;_this.lineEndPos=null;case 5:_this.atEnd=!incomplete;next=(_this$next=_this.next)!==null&&_this$next!==void 0?_this$next:"stream";case 7:if(!(next&&(incomplete||_this.hasChars(1)))){_context.next=12;break}return _context.delegateYield(_this.parseNext(next),"t0",9);case 9:next=_context.t0;_context.next=7;break;case 12:case"end":return _context.stop()}}),_callee)}))()}},{key:"atLineEnd",value:function atLineEnd(){var i=this.pos;var ch=this.buffer[i];while(ch===" "||ch==="\t")ch=this.buffer[++i];if(!ch||ch==="#"||ch==="\n")return true;if(ch==="\r")return this.buffer[i+1]==="\n";return false}},{key:"charAt",value:function charAt(n){return this.buffer[this.pos+n]}},{key:"continueScalar",value:function continueScalar(offset){var ch=this.buffer[offset];if(this.indentNext>0){var indent=0;while(ch===" ")ch=this.buffer[++indent+offset];if(ch==="\r"){var next=this.buffer[indent+offset+1];if(next==="\n"||!next&&!this.atEnd)return offset+indent+1}return ch==="\n"||indent>=this.indentNext||!ch&&!this.atEnd?offset+indent:-1}if(ch==="-"||ch==="."){var dt=this.buffer.substr(offset,3);if((dt==="---"||dt==="...")&&isEmpty(this.buffer[offset+3]))return-1}return offset}},{key:"getLine",value:function getLine(){var end=this.lineEndPos;if(typeof end!=="number"||end!==-1&&end<this.pos){end=this.buffer.indexOf("\n",this.pos);this.lineEndPos=end}if(end===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[end-1]==="\r")end-=1;return this.buffer.substring(this.pos,end)}},{key:"hasChars",value:function hasChars(n){return this.pos+n<=this.buffer.length}},{key:"setNext",value:function setNext(state){this.buffer=this.buffer.substring(this.pos);this.pos=0;this.lineEndPos=null;this.next=state;return null}},{key:"peek",value:function peek(n){return this.buffer.substr(this.pos,n)}},{key:"parseNext",value:_regeneratorRuntime().mark((function parseNext(next){return _regeneratorRuntime().wrap((function parseNext$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.t0=next;_context2.next=_context2.t0==="stream"?3:_context2.t0==="line-start"?5:_context2.t0==="block-start"?7:_context2.t0==="doc"?9:_context2.t0==="flow"?11:_context2.t0==="quoted-scalar"?13:_context2.t0==="block-scalar"?15:_context2.t0==="plain-scalar"?17:19;break;case 3:return _context2.delegateYield(this.parseStream(),"t1",4);case 4:return _context2.abrupt("return",_context2.t1);case 5:return _context2.delegateYield(this.parseLineStart(),"t2",6);case 6:return _context2.abrupt("return",_context2.t2);case 7:return _context2.delegateYield(this.parseBlockStart(),"t3",8);case 8:return _context2.abrupt("return",_context2.t3);case 9:return _context2.delegateYield(this.parseDocument(),"t4",10);case 10:return _context2.abrupt("return",_context2.t4);case 11:return _context2.delegateYield(this.parseFlowCollection(),"t5",12);case 12:return _context2.abrupt("return",_context2.t5);case 13:return _context2.delegateYield(this.parseQuotedScalar(),"t6",14);case 14:return _context2.abrupt("return",_context2.t6);case 15:return _context2.delegateYield(this.parseBlockScalar(),"t7",16);case 16:return _context2.abrupt("return",_context2.t7);case 17:return _context2.delegateYield(this.parsePlainScalar(),"t8",18);case 18:return _context2.abrupt("return",_context2.t8);case 19:case"end":return _context2.stop()}}),parseNext,this)}))},{key:"parseStream",value:_regeneratorRuntime().mark((function parseStream(){var line,dirEnd,cs,ch,_ch,n,sp;return _regeneratorRuntime().wrap((function parseStream$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:line=this.getLine();if(!(line===null)){_context3.next=3;break}return _context3.abrupt("return",this.setNext("stream"));case 3:if(!(line[0]===_cst.BOM)){_context3.next=6;break}return _context3.delegateYield(this.pushCount(1),"t0",5);case 5:line=line.substring(1);case 6:if(!(line[0]==="%")){_context3.next=36;break}dirEnd=line.length;cs=line.indexOf("#");case 9:if(!(cs!==-1)){_context3.next=19;break}ch=line[cs-1];if(!(ch===" "||ch==="\t")){_context3.next=16;break}dirEnd=cs-1;return _context3.abrupt("break",19);case 16:cs=line.indexOf("#",cs+1);case 17:_context3.next=9;break;case 19:if(!true){_context3.next=28;break}_ch=line[dirEnd-1];if(!(_ch===" "||_ch==="\t")){_context3.next=25;break}dirEnd-=1;_context3.next=26;break;case 25:return _context3.abrupt("break",28);case 26:_context3.next=19;break;case 28:return _context3.delegateYield(this.pushCount(dirEnd),"t1",29);case 29:_context3.t2=_context3.t1;return _context3.delegateYield(this.pushSpaces(true),"t3",31);case 31:_context3.t4=_context3.t3;n=_context3.t2+_context3.t4;return _context3.delegateYield(this.pushCount(line.length-n),"t5",34);case 34:this.pushNewline();return _context3.abrupt("return","stream");case 36:if(!this.atLineEnd()){_context3.next=42;break}return _context3.delegateYield(this.pushSpaces(true),"t6",38);case 38:sp=_context3.t6;return _context3.delegateYield(this.pushCount(line.length-sp),"t7",40);case 40:return _context3.delegateYield(this.pushNewline(),"t8",41);case 41:return _context3.abrupt("return","stream");case 42:_context3.next=44;return _cst.DOCUMENT;case 44:return _context3.delegateYield(this.parseLineStart(),"t9",45);case 45:return _context3.abrupt("return",_context3.t9);case 46:case"end":return _context3.stop()}}),parseStream,this)}))},{key:"parseLineStart",value:_regeneratorRuntime().mark((function parseLineStart(){var ch,s;return _regeneratorRuntime().wrap((function parseLineStart$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:ch=this.charAt(0);if(!(!ch&&!this.atEnd)){_context4.next=3;break}return _context4.abrupt("return",this.setNext("line-start"));case 3:if(!(ch==="-"||ch===".")){_context4.next=12;break}if(!(!this.atEnd&&!this.hasChars(4))){_context4.next=6;break}return _context4.abrupt("return",this.setNext("line-start"));case 6:s=this.peek(3);if(!((s==="---"||s==="...")&&isEmpty(this.charAt(3)))){_context4.next=12;break}return _context4.delegateYield(this.pushCount(3),"t0",9);case 9:this.indentValue=0;this.indentNext=0;return _context4.abrupt("return",s==="---"?"doc":"stream");case 12:return _context4.delegateYield(this.pushSpaces(false),"t1",13);case 13:this.indentValue=_context4.t1;if(this.indentNext>this.indentValue&&!isEmpty(this.charAt(1)))this.indentNext=this.indentValue;return _context4.delegateYield(this.parseBlockStart(),"t2",16);case 16:return _context4.abrupt("return",_context4.t2);case 17:case"end":return _context4.stop()}}),parseLineStart,this)}))},{key:"parseBlockStart",value:_regeneratorRuntime().mark((function parseBlockStart(){var _this$peek,_this$peek2,ch0,ch1,n;return _regeneratorRuntime().wrap((function parseBlockStart$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:_this$peek=this.peek(2),_this$peek2=_slicedToArray(_this$peek,2),ch0=_this$peek2[0],ch1=_this$peek2[1];if(!(!ch1&&!this.atEnd)){_context5.next=3;break}return _context5.abrupt("return",this.setNext("block-start"));case 3:if(!((ch0==="-"||ch0==="?"||ch0===":")&&isEmpty(ch1))){_context5.next=13;break}return _context5.delegateYield(this.pushCount(1),"t0",5);case 5:_context5.t1=_context5.t0;return _context5.delegateYield(this.pushSpaces(true),"t2",7);case 7:_context5.t3=_context5.t2;n=_context5.t1+_context5.t3;this.indentNext=this.indentValue+1;this.indentValue+=n;return _context5.delegateYield(this.parseBlockStart(),"t4",12);case 12:return _context5.abrupt("return",_context5.t4);case 13:return _context5.abrupt("return","doc");case 14:case"end":return _context5.stop()}}),parseBlockStart,this)}))},{key:"parseDocument",value:_regeneratorRuntime().mark((function parseDocument(){var line,n;return _regeneratorRuntime().wrap((function parseDocument$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:return _context6.delegateYield(this.pushSpaces(true),"t0",1);case 1:line=this.getLine();if(!(line===null)){_context6.next=4;break}return _context6.abrupt("return",this.setNext("doc"));case 4:return _context6.delegateYield(this.pushIndicators(),"t1",5);case 5:n=_context6.t1;_context6.t2=line[n];_context6.next=_context6.t2==="#"?9:_context6.t2===undefined?10:_context6.t2==="{"?13:_context6.t2==="["?13:_context6.t2==="}"?17:_context6.t2==="]"?17:_context6.t2==="*"?19:_context6.t2==='"'?21:_context6.t2==="'"?21:_context6.t2==="|"?23:_context6.t2===">"?23:33;break;case 9:return _context6.delegateYield(this.pushCount(line.length-n),"t3",10);case 10:return _context6.delegateYield(this.pushNewline(),"t4",11);case 11:return _context6.delegateYield(this.parseLineStart(),"t5",12);case 12:return _context6.abrupt("return",_context6.t5);case 13:return _context6.delegateYield(this.pushCount(1),"t6",14);case 14:this.flowKey=false;this.flowLevel=1;return _context6.abrupt("return","flow");case 17:return _context6.delegateYield(this.pushCount(1),"t7",18);case 18:return _context6.abrupt("return","doc");case 19:return _context6.delegateYield(this.pushUntil(isNotAnchorChar),"t8",20);case 20:return _context6.abrupt("return","doc");case 21:return _context6.delegateYield(this.parseQuotedScalar(),"t9",22);case 22:return _context6.abrupt("return",_context6.t9);case 23:_context6.t10=n;return _context6.delegateYield(this.parseBlockScalarHeader(),"t11",25);case 25:n=_context6.t10+=_context6.t11;_context6.t12=n;return _context6.delegateYield(this.pushSpaces(true),"t13",28);case 28:n=_context6.t12+=_context6.t13;return _context6.delegateYield(this.pushCount(line.length-n),"t14",30);case 30:return _context6.delegateYield(this.pushNewline(),"t15",31);case 31:return _context6.delegateYield(this.parseBlockScalar(),"t16",32);case 32:return _context6.abrupt("return",_context6.t16);case 33:return _context6.delegateYield(this.parsePlainScalar(),"t17",34);case 34:return _context6.abrupt("return",_context6.t17);case 35:case"end":return _context6.stop()}}),parseDocument,this)}))},{key:"parseFlowCollection",value:_regeneratorRuntime().mark((function parseFlowCollection(){var nl,sp,indent,line,atFlowEndMarker,n,next;return _regeneratorRuntime().wrap((function parseFlowCollection$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:indent=-1;case 1:return _context7.delegateYield(this.pushNewline(),"t0",2);case 2:nl=_context7.t0;if(!(nl>0)){_context7.next=9;break}return _context7.delegateYield(this.pushSpaces(false),"t1",5);case 5:sp=_context7.t1;this.indentValue=indent=sp;_context7.next=10;break;case 9:sp=0;case 10:_context7.t2=sp;return _context7.delegateYield(this.pushSpaces(true),"t3",12);case 12:sp=_context7.t2+=_context7.t3;case 13:if(nl+sp>0){_context7.next=1;break}case 14:line=this.getLine();if(!(line===null)){_context7.next=17;break}return _context7.abrupt("return",this.setNext("flow"));case 17:if(!(indent!==-1&&indent<this.indentNext&&line[0]!=="#"||indent===0&&(line.startsWith("---")||line.startsWith("..."))&&isEmpty(line[3]))){_context7.next=25;break}atFlowEndMarker=indent===this.indentNext-1&&this.flowLevel===1&&(line[0]==="]"||line[0]==="}");if(atFlowEndMarker){_context7.next=25;break}this.flowLevel=0;_context7.next=23;return _cst.FLOW_END;case 23:return _context7.delegateYield(this.parseLineStart(),"t4",24);case 24:return _context7.abrupt("return",_context7.t4);case 25:n=0;case 26:if(!(line[n]===",")){_context7.next=36;break}_context7.t5=n;return _context7.delegateYield(this.pushCount(1),"t6",29);case 29:n=_context7.t5+=_context7.t6;_context7.t7=n;return _context7.delegateYield(this.pushSpaces(true),"t8",32);case 32:n=_context7.t7+=_context7.t8;this.flowKey=false;_context7.next=26;break;case 36:_context7.t9=n;return _context7.delegateYield(this.pushIndicators(),"t10",38);case 38:n=_context7.t9+=_context7.t10;_context7.t11=line[n];_context7.next=_context7.t11===undefined?42:_context7.t11==="#"?43:_context7.t11==="{"?45:_context7.t11==="["?45:_context7.t11==="}"?49:_context7.t11==="]"?49:_context7.t11==="*"?53:_context7.t11==='"'?55:_context7.t11==="'"?55:_context7.t11===":"?58:64;break;case 42:return _context7.abrupt("return","flow");case 43:return _context7.delegateYield(this.pushCount(line.length-n),"t12",44);case 44:return _context7.abrupt("return","flow");case 45:return _context7.delegateYield(this.pushCount(1),"t13",46);case 46:this.flowKey=false;this.flowLevel+=1;return _context7.abrupt("return","flow");case 49:return _context7.delegateYield(this.pushCount(1),"t14",50);case 50:this.flowKey=true;this.flowLevel-=1;return _context7.abrupt("return",this.flowLevel?"flow":"doc");case 53:return _context7.delegateYield(this.pushUntil(isNotAnchorChar),"t15",54);case 54:return _context7.abrupt("return","flow");case 55:this.flowKey=true;return _context7.delegateYield(this.parseQuotedScalar(),"t16",57);case 57:return _context7.abrupt("return",_context7.t16);case 58:next=this.charAt(1);if(!(this.flowKey||isEmpty(next)||next===",")){_context7.next=64;break}this.flowKey=false;return _context7.delegateYield(this.pushCount(1),"t17",62);case 62:return _context7.delegateYield(this.pushSpaces(true),"t18",63);case 63:return _context7.abrupt("return","flow");case 64:this.flowKey=false;return _context7.delegateYield(this.parsePlainScalar(),"t19",66);case 66:return _context7.abrupt("return",_context7.t19);case 67:case"end":return _context7.stop()}}),parseFlowCollection,this)}))},{key:"parseQuotedScalar",value:_regeneratorRuntime().mark((function parseQuotedScalar(){var quote,end,n,qb,nl,cs;return _regeneratorRuntime().wrap((function parseQuotedScalar$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:quote=this.charAt(0);end=this.buffer.indexOf(quote,this.pos+1);if(!(quote==="'")){_context8.next=6;break}while(end!==-1&&this.buffer[end+1]==="'")end=this.buffer.indexOf("'",end+2);_context8.next=14;break;case 6:if(!(end!==-1)){_context8.next=14;break}n=0;while(this.buffer[end-1-n]==="\\")n+=1;if(!(n%2===0)){_context8.next=11;break}return _context8.abrupt("break",14);case 11:end=this.buffer.indexOf('"',end+1);_context8.next=6;break;case 14:qb=this.buffer.substring(0,end);nl=qb.indexOf("\n",this.pos);if(!(nl!==-1)){_context8.next=25;break}case 17:if(!(nl!==-1)){_context8.next=24;break}cs=this.continueScalar(nl+1);if(!(cs===-1)){_context8.next=21;break}return _context8.abrupt("break",24);case 21:nl=qb.indexOf("\n",cs);_context8.next=17;break;case 24:if(nl!==-1){end=nl-(qb[nl-1]==="\r"?2:1)}case 25:if(!(end===-1)){_context8.next=29;break}if(this.atEnd){_context8.next=28;break}return _context8.abrupt("return",this.setNext("quoted-scalar"));case 28:end=this.buffer.length;case 29:return _context8.delegateYield(this.pushToIndex(end+1,false),"t0",30);case 30:return _context8.abrupt("return",this.flowLevel?"flow":"doc");case 31:case"end":return _context8.stop()}}),parseQuotedScalar,this)}))},{key:"parseBlockScalarHeader",value:_regeneratorRuntime().mark((function parseBlockScalarHeader(){var i,ch;return _regeneratorRuntime().wrap((function parseBlockScalarHeader$(_context9){while(1)switch(_context9.prev=_context9.next){case 0:this.blockScalarIndent=-1;this.blockScalarKeep=false;i=this.pos;case 3:if(!true){_context9.next=17;break}ch=this.buffer[++i];if(!(ch==="+")){_context9.next=9;break}this.blockScalarKeep=true;_context9.next=15;break;case 9:if(!(ch>"0"&&ch<="9")){_context9.next=13;break}this.blockScalarIndent=Number(ch)-1;_context9.next=15;break;case 13:if(!(ch!=="-")){_context9.next=15;break}return _context9.abrupt("break",17);case 15:_context9.next=3;break;case 17:return _context9.delegateYield(this.pushUntil((function(ch){return isEmpty(ch)||ch==="#"})),"t0",18);case 18:return _context9.abrupt("return",_context9.t0);case 19:case"end":return _context9.stop()}}),parseBlockScalarHeader,this)}))},{key:"parseBlockScalar",value:_regeneratorRuntime().mark((function parseBlockScalar(){var nl,indent,ch,_i,next,cs,i,_i2,_ch2,lastChar;return _regeneratorRuntime().wrap((function parseBlockScalar$(_context10){while(1)switch(_context10.prev=_context10.next){case 0:nl=this.pos-1;indent=0;_i=this.pos;case 3:if(!(ch=this.buffer[_i])){_context10.next=21;break}_context10.t0=ch;_context10.next=_context10.t0===" "?7:_context10.t0==="\n"?9:_context10.t0==="\r"?12:17;break;case 7:indent+=1;return _context10.abrupt("break",18);case 9:nl=_i;indent=0;return _context10.abrupt("break",18);case 12:next=this.buffer[_i+1];if(!(!next&&!this.atEnd)){_context10.next=15;break}return _context10.abrupt("return",this.setNext("block-scalar"));case 15:if(!(next==="\n")){_context10.next=17;break}return _context10.abrupt("break",18);case 17:return _context10.abrupt("break",21);case 18:++_i;_context10.next=3;break;case 21:if(!(!ch&&!this.atEnd)){_context10.next=23;break}return _context10.abrupt("return",this.setNext("block-scalar"));case 23:if(!(indent>=this.indentNext)){_context10.next=34;break}if(this.blockScalarIndent===-1)this.indentNext=indent;else{this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext)}case 25:cs=this.continueScalar(nl+1);if(!(cs===-1)){_context10.next=28;break}return _context10.abrupt("break",30);case 28:nl=this.buffer.indexOf("\n",cs);case 29:if(nl!==-1){_context10.next=25;break}case 30:if(!(nl===-1)){_context10.next=34;break}if(this.atEnd){_context10.next=33;break}return _context10.abrupt("return",this.setNext("block-scalar"));case 33:nl=this.buffer.length;case 34:i=nl+1;ch=this.buffer[i];while(ch===" ")ch=this.buffer[++i];if(!(ch==="\t")){_context10.next=42;break}while(ch==="\t"||ch===" "||ch==="\r"||ch==="\n")ch=this.buffer[++i];nl=i-1;_context10.next=54;break;case 42:if(this.blockScalarKeep){_context10.next=54;break}case 43:_i2=nl-1;_ch2=this.buffer[_i2];if(_ch2==="\r")_ch2=this.buffer[--_i2];lastChar=_i2;while(_ch2===" ")_ch2=this.buffer[--_i2];if(!(_ch2==="\n"&&_i2>=this.pos&&_i2+1+indent>lastChar)){_context10.next=52;break}nl=_i2;_context10.next=53;break;case 52:return _context10.abrupt("break",54);case 53:if(true){_context10.next=43;break}case 54:_context10.next=56;return _cst.SCALAR;case 56:return _context10.delegateYield(this.pushToIndex(nl+1,true),"t1",57);case 57:return _context10.delegateYield(this.parseLineStart(),"t2",58);case 58:return _context10.abrupt("return",_context10.t2);case 59:case"end":return _context10.stop()}}),parseBlockScalar,this)}))},{key:"parsePlainScalar",value:_regeneratorRuntime().mark((function parsePlainScalar(){var inFlow,end,i,ch,next,_next,cs;return _regeneratorRuntime().wrap((function parsePlainScalar$(_context11){while(1)switch(_context11.prev=_context11.next){case 0:inFlow=this.flowLevel>0;end=this.pos-1;i=this.pos-1;case 3:if(!(ch=this.buffer[++i])){_context11.next=28;break}if(!(ch===":")){_context11.next=11;break}next=this.buffer[i+1];if(!(isEmpty(next)||inFlow&&flowIndicatorChars.has(next))){_context11.next=8;break}return _context11.abrupt("break",28);case 8:end=i;_context11.next=26;break;case 11:if(!isEmpty(ch)){_context11.next=23;break}_next=this.buffer[i+1];if(ch==="\r"){if(_next==="\n"){i+=1;ch="\n";_next=this.buffer[i+1]}else end=i}if(!(_next==="#"||inFlow&&flowIndicatorChars.has(_next))){_context11.next=16;break}return _context11.abrupt("break",28);case 16:if(!(ch==="\n")){_context11.next=21;break}cs=this.continueScalar(i+1);if(!(cs===-1)){_context11.next=20;break}return _context11.abrupt("break",28);case 20:i=Math.max(i,cs-2);case 21:_context11.next=26;break;case 23:if(!(inFlow&&flowIndicatorChars.has(ch))){_context11.next=25;break}return _context11.abrupt("break",28);case 25:end=i;case 26:_context11.next=3;break;case 28:if(!(!ch&&!this.atEnd)){_context11.next=30;break}return _context11.abrupt("return",this.setNext("plain-scalar"));case 30:_context11.next=32;return _cst.SCALAR;case 32:return _context11.delegateYield(this.pushToIndex(end+1,true),"t0",33);case 33:return _context11.abrupt("return",inFlow?"flow":"doc");case 34:case"end":return _context11.stop()}}),parsePlainScalar,this)}))},{key:"pushCount",value:_regeneratorRuntime().mark((function pushCount(n){return _regeneratorRuntime().wrap((function pushCount$(_context12){while(1)switch(_context12.prev=_context12.next){case 0:if(!(n>0)){_context12.next=5;break}_context12.next=3;return this.buffer.substr(this.pos,n);case 3:this.pos+=n;return _context12.abrupt("return",n);case 5:return _context12.abrupt("return",0);case 6:case"end":return _context12.stop()}}),pushCount,this)}))},{key:"pushToIndex",value:_regeneratorRuntime().mark((function pushToIndex(i,allowEmpty){var s;return _regeneratorRuntime().wrap((function pushToIndex$(_context13){while(1)switch(_context13.prev=_context13.next){case 0:s=this.buffer.slice(this.pos,i);if(!s){_context13.next=8;break}_context13.next=4;return s;case 4:this.pos+=s.length;return _context13.abrupt("return",s.length);case 8:if(!allowEmpty){_context13.next=11;break}_context13.next=11;return"";case 11:return _context13.abrupt("return",0);case 12:case"end":return _context13.stop()}}),pushToIndex,this)}))},{key:"pushIndicators",value:_regeneratorRuntime().mark((function pushIndicators(){var inFlow,ch1;return _regeneratorRuntime().wrap((function pushIndicators$(_context14){while(1)switch(_context14.prev=_context14.next){case 0:_context14.t0=this.charAt(0);_context14.next=_context14.t0==="!"?3:_context14.t0==="&"?11:_context14.t0==="-"?19:_context14.t0==="?"?19:_context14.t0===":"?19:31;break;case 3:return _context14.delegateYield(this.pushTag(),"t1",4);case 4:_context14.t2=_context14.t1;return _context14.delegateYield(this.pushSpaces(true),"t3",6);case 6:_context14.t4=_context14.t3;_context14.t5=_context14.t2+_context14.t4;return _context14.delegateYield(this.pushIndicators(),"t6",9);case 9:_context14.t7=_context14.t6;return _context14.abrupt("return",_context14.t5+_context14.t7);case 11:return _context14.delegateYield(this.pushUntil(isNotAnchorChar),"t8",12);case 12:_context14.t9=_context14.t8;return _context14.delegateYield(this.pushSpaces(true),"t10",14);case 14:_context14.t11=_context14.t10;_context14.t12=_context14.t9+_context14.t11;return _context14.delegateYield(this.pushIndicators(),"t13",17);case 17:_context14.t14=_context14.t13;return _context14.abrupt("return",_context14.t12+_context14.t14);case 19:inFlow=this.flowLevel>0;ch1=this.charAt(1);if(!(isEmpty(ch1)||inFlow&&flowIndicatorChars.has(ch1))){_context14.next=31;break}if(!inFlow)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=false;return _context14.delegateYield(this.pushCount(1),"t15",24);case 24:_context14.t16=_context14.t15;return _context14.delegateYield(this.pushSpaces(true),"t17",26);case 26:_context14.t18=_context14.t17;_context14.t19=_context14.t16+_context14.t18;return _context14.delegateYield(this.pushIndicators(),"t20",29);case 29:_context14.t21=_context14.t20;return _context14.abrupt("return",_context14.t19+_context14.t21);case 31:return _context14.abrupt("return",0);case 32:case"end":return _context14.stop()}}),pushIndicators,this)}))},{key:"pushTag",value:_regeneratorRuntime().mark((function pushTag(){var i,ch,_i3,_ch3;return _regeneratorRuntime().wrap((function pushTag$(_context15){while(1)switch(_context15.prev=_context15.next){case 0:if(!(this.charAt(1)==="<")){_context15.next=8;break}i=this.pos+2;ch=this.buffer[i];while(!isEmpty(ch)&&ch!==">")ch=this.buffer[++i];return _context15.delegateYield(this.pushToIndex(ch===">"?i+1:i,false),"t0",5);case 5:return _context15.abrupt("return",_context15.t0);case 8:_i3=this.pos+1;_ch3=this.buffer[_i3];case 10:if(!_ch3){_context15.next=22;break}if(!tagChars.has(_ch3)){_context15.next=15;break}_ch3=this.buffer[++_i3];_context15.next=20;break;case 15:if(!(_ch3==="%"&&hexDigits.has(this.buffer[_i3+1])&&hexDigits.has(this.buffer[_i3+2]))){_context15.next=19;break}_ch3=this.buffer[_i3+=3];_context15.next=20;break;case 19:return _context15.abrupt("break",22);case 20:_context15.next=10;break;case 22:return _context15.delegateYield(this.pushToIndex(_i3,false),"t1",23);case 23:return _context15.abrupt("return",_context15.t1);case 24:case"end":return _context15.stop()}}),pushTag,this)}))},{key:"pushNewline",value:_regeneratorRuntime().mark((function pushNewline(){var ch;return _regeneratorRuntime().wrap((function pushNewline$(_context16){while(1)switch(_context16.prev=_context16.next){case 0:ch=this.buffer[this.pos];if(!(ch==="\n")){_context16.next=6;break}return _context16.delegateYield(this.pushCount(1),"t0",3);case 3:return _context16.abrupt("return",_context16.t0);case 6:if(!(ch==="\r"&&this.charAt(1)==="\n")){_context16.next=11;break}return _context16.delegateYield(this.pushCount(2),"t1",8);case 8:return _context16.abrupt("return",_context16.t1);case 11:return _context16.abrupt("return",0);case 12:case"end":return _context16.stop()}}),pushNewline,this)}))},{key:"pushSpaces",value:_regeneratorRuntime().mark((function pushSpaces(allowTabs){var i,ch,n;return _regeneratorRuntime().wrap((function pushSpaces$(_context17){while(1)switch(_context17.prev=_context17.next){case 0:i=this.pos-1;do{ch=this.buffer[++i]}while(ch===" "||allowTabs&&ch==="\t");n=i-this.pos;if(!(n>0)){_context17.next=7;break}_context17.next=6;return this.buffer.substr(this.pos,n);case 6:this.pos=i;case 7:return _context17.abrupt("return",n);case 8:case"end":return _context17.stop()}}),pushSpaces,this)}))},{key:"pushUntil",value:_regeneratorRuntime().mark((function pushUntil(test){var i,ch;return _regeneratorRuntime().wrap((function pushUntil$(_context18){while(1)switch(_context18.prev=_context18.next){case 0:i=this.pos;ch=this.buffer[i];while(!test(ch))ch=this.buffer[++i];return _context18.delegateYield(this.pushToIndex(i,false),"t0",4);case 4:return _context18.abrupt("return",_context18.t0);case 5:case"end":return _context18.stop()}}),pushUntil,this)}))}])}()},{"./cst.js":261}],263:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}Object.defineProperty(exports,"__esModule",{value:true});exports.LineCounter=void 0;function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}var LineCounter=exports.LineCounter=_createClass((function LineCounter(){var _this=this;_classCallCheck(this,LineCounter);this.lineStarts=[];this.addNewLine=function(offset){return _this.lineStarts.push(offset)};this.linePos=function(offset){var low=0;var high=_this.lineStarts.length;while(low<high){var mid=low+high>>1;if(_this.lineStarts[mid]<offset)low=mid+1;else high=mid}if(_this.lineStarts[low]===offset)return{line:low+1,col:1};if(low===0)return{line:0,col:offset};var start=_this.lineStarts[low-1];return{line:low,col:offset-start+1}}}))},{}],264:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}Object.defineProperty(exports,"__esModule",{value:true});exports.Parser=void 0;var _cst=require("./cst.js");var _lexer=require("./lexer.js");function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{define({},"")}catch(t){define=function define(t,e,r){return t[e]=r}}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,(function(){return this}));var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach((function(e){define(t,e,(function(t){return this._invoke(e,t)}))}))}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){invoke("next",t,i,a)}),(function(t){invoke("throw",t,i,a)})):e.resolve(h).then((function(t){u.value=t,i(u)}),(function(t){return invoke("throw",t,i,a)}))}a(c.arg)}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e((function(e,r){invoke(t,n,e,r)}))}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done}}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg)}}}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next};return i.next=i}}throw new TypeError(_typeof(e)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t},e.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,(function(){return this})),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,(function(){return this})),define(g,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next}return next.done=!0,next}},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y}},catch:function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function includesToken(list,type){for(var i=0;i<list.length;++i)if(list[i].type===type)return true;return false}function findNonEmptyIndex(list){for(var i=0;i<list.length;++i){switch(list[i].type){case"space":case"comment":case"newline":break;default:return i}}return-1}function isFlowToken(token){switch(token===null||token===void 0?void 0:token.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return true;default:return false}}function getPrevProps(parent){switch(parent.type){case"document":return parent.start;case"block-map":{var _it$sep;var it=parent.items[parent.items.length-1];return(_it$sep=it.sep)!==null&&_it$sep!==void 0?_it$sep:it.start}case"block-seq":return parent.items[parent.items.length-1].start;default:return[]}}function getFirstKeyStartProps(prev){if(prev.length===0)return[];var i=prev.length;loop:while(--i>=0){switch(prev[i].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break loop}}while(((_prev$i=prev[++i])===null||_prev$i===void 0?void 0:_prev$i.type)==="space"){var _prev$i}return prev.splice(i,prev.length)}function fixFlowSeqItems(fc){if(fc.start.type==="flow-seq-start"){var _iterator=_createForOfIteratorHelper(fc.items),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var it=_step.value;if(it.sep&&!it.value&&!includesToken(it.start,"explicit-key-ind")&&!includesToken(it.sep,"map-value-ind")){if(it.key)it.value=it.key;delete it.key;if(isFlowToken(it.value)){if(it.value.end)Array.prototype.push.apply(it.value.end,it.sep);else it.value.end=it.sep}else Array.prototype.push.apply(it.start,it.sep);delete it.sep}}}catch(err){_iterator.e(err)}finally{_iterator.f()}}}var Parser=exports.Parser=function(){function Parser(onNewLine){_classCallCheck(this,Parser);this.atNewLine=true;this.atScalar=false;this.indent=0;this.offset=0;this.onKeyLine=false;this.stack=[];this.source="";this.type="";this.lexer=new _lexer.Lexer;this.onNewLine=onNewLine}return _createClass(Parser,[{key:"parse",value:function parse(source){var _this=this;var incomplete=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;return _regeneratorRuntime().mark((function _callee(){var _iterator2,_step2,lexeme;return _regeneratorRuntime().wrap((function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:if(_this.onNewLine&&_this.offset===0)_this.onNewLine(0);_iterator2=_createForOfIteratorHelper(_this.lexer.lex(source,incomplete));_context.prev=2;_iterator2.s();case 4:if((_step2=_iterator2.n()).done){_context.next=9;break}lexeme=_step2.value;return _context.delegateYield(_this.next(lexeme),"t0",7);case 7:_context.next=4;break;case 9:_context.next=14;break;case 11:_context.prev=11;_context.t1=_context["catch"](2);_iterator2.e(_context.t1);case 14:_context.prev=14;_iterator2.f();return _context.finish(14);case 17:if(incomplete){_context.next=19;break}return _context.delegateYield(_this.end(),"t2",19);case 19:case"end":return _context.stop()}}),_callee,null,[[2,11,14,17]])}))()}},{key:"next",value:_regeneratorRuntime().mark((function next(source){var type,message;return _regeneratorRuntime().wrap((function next$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:this.source=source;if(!this.atScalar){_context2.next=6;break}this.atScalar=false;return _context2.delegateYield(this.step(),"t0",4);case 4:this.offset+=source.length;return _context2.abrupt("return");case 6:type=(0,_cst.tokenType)(source);if(type){_context2.next=13;break}message="Not a YAML token: ".concat(source);return _context2.delegateYield(this.pop({type:"error",offset:this.offset,message:message,source:source}),"t1",10);case 10:this.offset+=source.length;_context2.next=35;break;case 13:if(!(type==="scalar")){_context2.next=19;break}this.atNewLine=false;this.atScalar=true;this.type="scalar";_context2.next=35;break;case 19:this.type=type;return _context2.delegateYield(this.step(),"t2",21);case 21:_context2.t3=type;_context2.next=_context2.t3==="newline"?24:_context2.t3==="space"?28:_context2.t3==="explicit-key-ind"?30:_context2.t3==="map-value-ind"?30:_context2.t3==="seq-item-ind"?30:_context2.t3==="doc-mode"?32:_context2.t3==="flow-error-end"?32:33;break;case 24:this.atNewLine=true;this.indent=0;if(this.onNewLine)this.onNewLine(this.offset+source.length);return _context2.abrupt("break",34);case 28:if(this.atNewLine&&source[0]===" ")this.indent+=source.length;return _context2.abrupt("break",34);case 30:if(this.atNewLine)this.indent+=source.length;return _context2.abrupt("break",34);case 32:return _context2.abrupt("return");case 33:this.atNewLine=false;case 34:this.offset+=source.length;case 35:case"end":return _context2.stop()}}),next,this)}))},{key:"end",value:_regeneratorRuntime().mark((function end(){return _regeneratorRuntime().wrap((function end$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:if(!(this.stack.length>0)){_context3.next=4;break}return _context3.delegateYield(this.pop(),"t0",2);case 2:_context3.next=0;break;case 4:case"end":return _context3.stop()}}),end,this)}))},{key:"sourceToken",get:function get(){var st={type:this.type,offset:this.offset,indent:this.indent,source:this.source};return st}},{key:"step",value:_regeneratorRuntime().mark((function step(){var top;return _regeneratorRuntime().wrap((function step$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:top=this.peek(1);if(!(this.type==="doc-end"&&(!top||top.type!=="doc-end"))){_context4.next=8;break}case 2:if(!(this.stack.length>0)){_context4.next=6;break}return _context4.delegateYield(this.pop(),"t0",4);case 4:_context4.next=2;break;case 6:this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return _context4.abrupt("return");case 8:if(top){_context4.next=11;break}return _context4.delegateYield(this.stream(),"t1",10);case 10:return _context4.abrupt("return",_context4.t1);case 11:_context4.t2=top.type;_context4.next=_context4.t2==="document"?14:_context4.t2==="alias"?16:_context4.t2==="scalar"?16:_context4.t2==="single-quoted-scalar"?16:_context4.t2==="double-quoted-scalar"?16:_context4.t2==="block-scalar"?18:_context4.t2==="block-map"?20:_context4.t2==="block-seq"?22:_context4.t2==="flow-collection"?24:_context4.t2==="doc-end"?26:28;break;case 14:return _context4.delegateYield(this.document(top),"t3",15);case 15:return _context4.abrupt("return",_context4.t3);case 16:return _context4.delegateYield(this.scalar(top),"t4",17);case 17:return _context4.abrupt("return",_context4.t4);case 18:return _context4.delegateYield(this.blockScalar(top),"t5",19);case 19:return _context4.abrupt("return",_context4.t5);case 20:return _context4.delegateYield(this.blockMap(top),"t6",21);case 21:return _context4.abrupt("return",_context4.t6);case 22:return _context4.delegateYield(this.blockSequence(top),"t7",23);case 23:return _context4.abrupt("return",_context4.t7);case 24:return _context4.delegateYield(this.flowCollection(top),"t8",25);case 25:return _context4.abrupt("return",_context4.t8);case 26:return _context4.delegateYield(this.documentEnd(top),"t9",27);case 27:return _context4.abrupt("return",_context4.t9);case 28:return _context4.delegateYield(this.pop(),"t10",29);case 29:case"end":return _context4.stop()}}),step,this)}))},{key:"peek",value:function peek(n){return this.stack[this.stack.length-n]}},{key:"pop",value:_regeneratorRuntime().mark((function pop(error){var token,message,top,it,_it,_it2,last;return _regeneratorRuntime().wrap((function pop$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:token=error!==null&&error!==void 0?error:this.stack.pop();if(token){_context5.next=7;break}message="Tried to pop an empty stack";_context5.next=5;return{type:"error",offset:this.offset,source:"",message:message};case 5:_context5.next=46;break;case 7:if(!(this.stack.length===0)){_context5.next=12;break}_context5.next=10;return token;case 10:_context5.next=46;break;case 12:top=this.peek(1);if(token.type==="block-scalar"){token.indent="indent"in top?top.indent:0}else if(token.type==="flow-collection"&&top.type==="document"){token.indent=0}if(token.type==="flow-collection")fixFlowSeqItems(token);_context5.t0=top.type;_context5.next=_context5.t0==="document"?18:_context5.t0==="block-scalar"?20:_context5.t0==="block-map"?22:_context5.t0==="block-seq"?37:_context5.t0==="flow-collection"?40:43;break;case 18:top.value=token;return _context5.abrupt("break",45);case 20:top.props.push(token);return _context5.abrupt("break",45);case 22:it=top.items[top.items.length-1];if(!it.value){_context5.next=29;break}top.items.push({start:[],key:token,sep:[]});this.onKeyLine=true;return _context5.abrupt("return");case 29:if(!it.sep){_context5.next=33;break}it.value=token;_context5.next=36;break;case 33:Object.assign(it,{key:token,sep:[]});this.onKeyLine=!it.explicitKey;return _context5.abrupt("return");case 36:return _context5.abrupt("break",45);case 37:_it=top.items[top.items.length-1];if(_it.value)top.items.push({start:[],value:token});else _it.value=token;return _context5.abrupt("break",45);case 40:_it2=top.items[top.items.length-1];if(!_it2||_it2.value)top.items.push({start:[],key:token,sep:[]});else if(_it2.sep)_it2.value=token;else Object.assign(_it2,{key:token,sep:[]});return _context5.abrupt("return");case 43:return _context5.delegateYield(this.pop(),"t1",44);case 44:return _context5.delegateYield(this.pop(token),"t2",45);case 45:if((top.type==="document"||top.type==="block-map"||top.type==="block-seq")&&(token.type==="block-map"||token.type==="block-seq")){last=token.items[token.items.length-1];if(last&&!last.sep&&!last.value&&last.start.length>0&&findNonEmptyIndex(last.start)===-1&&(token.indent===0||last.start.every((function(st){return st.type!=="comment"||st.indent<token.indent})))){if(top.type==="document")top.end=last.start;else top.items.push({start:last.start});token.items.splice(-1,1)}}case 46:case"end":return _context5.stop()}}),pop,this)}))},{key:"stream",value:_regeneratorRuntime().mark((function stream(){var doc;return _regeneratorRuntime().wrap((function stream$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:_context6.t0=this.type;_context6.next=_context6.t0==="directive-line"?3:_context6.t0==="byte-order-mark"?6:_context6.t0==="space"?6:_context6.t0==="comment"?6:_context6.t0==="newline"?6:_context6.t0==="doc-mode"?9:_context6.t0==="doc-start"?9:13;break;case 3:_context6.next=5;return{type:"directive",offset:this.offset,source:this.source};case 5:return _context6.abrupt("return");case 6:_context6.next=8;return this.sourceToken;case 8:return _context6.abrupt("return");case 9:doc={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")doc.start.push(this.sourceToken);this.stack.push(doc);return _context6.abrupt("return");case 13:_context6.next=15;return{type:"error",offset:this.offset,message:"Unexpected ".concat(this.type," token in YAML stream"),source:this.source};case 15:case"end":return _context6.stop()}}),stream,this)}))},{key:"document",value:_regeneratorRuntime().mark((function document(doc){var bv;return _regeneratorRuntime().wrap((function document$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:if(!doc.value){_context7.next=3;break}return _context7.delegateYield(this.lineEnd(doc),"t0",2);case 2:return _context7.abrupt("return",_context7.t0);case 3:_context7.t1=this.type;_context7.next=_context7.t1==="doc-start"?6:_context7.t1==="anchor"?13:_context7.t1==="tag"?13:_context7.t1==="space"?13:_context7.t1==="comment"?13:_context7.t1==="newline"?13:15;break;case 6:if(!(findNonEmptyIndex(doc.start)!==-1)){_context7.next=11;break}return _context7.delegateYield(this.pop(),"t2",8);case 8:return _context7.delegateYield(this.step(),"t3",9);case 9:_context7.next=12;break;case 11:doc.start.push(this.sourceToken);case 12:return _context7.abrupt("return");case 13:doc.start.push(this.sourceToken);return _context7.abrupt("return");case 15:bv=this.startBlockValue(doc);if(!bv){_context7.next=20;break}this.stack.push(bv);_context7.next=22;break;case 20:_context7.next=22;return{type:"error",offset:this.offset,message:"Unexpected ".concat(this.type," token in YAML document"),source:this.source};case 22:case"end":return _context7.stop()}}),document,this)}))},{key:"scalar",value:_regeneratorRuntime().mark((function scalar(_scalar){var prev,start,sep,map;return _regeneratorRuntime().wrap((function scalar$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:if(!(this.type==="map-value-ind")){_context8.next=9;break}prev=getPrevProps(this.peek(2));start=getFirstKeyStartProps(prev);if(_scalar.end){sep=_scalar.end;sep.push(this.sourceToken);delete _scalar.end}else sep=[this.sourceToken];map={type:"block-map",offset:_scalar.offset,indent:_scalar.indent,items:[{start:start,key:_scalar,sep:sep}]};this.onKeyLine=true;this.stack[this.stack.length-1]=map;_context8.next=10;break;case 9:return _context8.delegateYield(this.lineEnd(_scalar),"t0",10);case 10:case"end":return _context8.stop()}}),scalar,this)}))},{key:"blockScalar",value:_regeneratorRuntime().mark((function blockScalar(scalar){var nl;return _regeneratorRuntime().wrap((function blockScalar$(_context9){while(1)switch(_context9.prev=_context9.next){case 0:_context9.t0=this.type;_context9.next=_context9.t0==="space"?3:_context9.t0==="comment"?3:_context9.t0==="newline"?3:_context9.t0==="scalar"?5:11;break;case 3:scalar.props.push(this.sourceToken);return _context9.abrupt("return");case 5:scalar.source=this.source;this.atNewLine=true;this.indent=0;if(this.onNewLine){nl=this.source.indexOf("\n")+1;while(nl!==0){this.onNewLine(this.offset+nl);nl=this.source.indexOf("\n",nl)+1}}return _context9.delegateYield(this.pop(),"t1",10);case 10:return _context9.abrupt("break",13);case 11:return _context9.delegateYield(this.pop(),"t2",12);case 12:return _context9.delegateYield(this.step(),"t3",13);case 13:case"end":return _context9.stop()}}),blockScalar,this)}))},{key:"blockMap",value:_regeneratorRuntime().mark((function blockMap(map){var it,end,last,_prev$value,prev,_end,atMapIndent,atNextItem,start,nl,i,st,_start,_start2,key,sep,fs,bv;return _regeneratorRuntime().wrap((function blockMap$(_context10){while(1)switch(_context10.prev=_context10.next){case 0:it=map.items[map.items.length-1];_context10.t0=this.type;_context10.next=_context10.t0==="newline"?4:_context10.t0==="space"?7:_context10.t0==="comment"?7:25;break;case 4:this.onKeyLine=false;if(it.value){end="end"in it.value?it.value.end:undefined;last=Array.isArray(end)?end[end.length-1]:undefined;if((last===null||last===void 0?void 0:last.type)==="comment")end===null||end===void 0||end.push(this.sourceToken);else map.items.push({start:[this.sourceToken]})}else if(it.sep){it.sep.push(this.sourceToken)}else{it.start.push(this.sourceToken)}return _context10.abrupt("return");case 7:if(!it.value){_context10.next=11;break}map.items.push({start:[this.sourceToken]});_context10.next=24;break;case 11:if(!it.sep){_context10.next=15;break}it.sep.push(this.sourceToken);_context10.next=24;break;case 15:if(!this.atIndentedComment(it.start,map.indent)){_context10.next=23;break}prev=map.items[map.items.length-2];_end=prev===null||prev===void 0||(_prev$value=prev.value)===null||_prev$value===void 0?void 0:_prev$value.end;if(!Array.isArray(_end)){_context10.next=23;break}Array.prototype.push.apply(_end,it.start);_end.push(this.sourceToken);map.items.pop();return _context10.abrupt("return");case 23:it.start.push(this.sourceToken);case 24:return _context10.abrupt("return");case 25:if(!(this.indent>=map.indent)){_context10.next=66;break}atMapIndent=!this.onKeyLine&&this.indent===map.indent;atNextItem=atMapIndent&&(it.sep||it.explicitKey)&&this.type!=="seq-item-ind";start=[];if(!(atNextItem&&it.sep&&!it.value)){_context10.next=47;break}nl=[];i=0;case 32:if(!(i<it.sep.length)){_context10.next=46;break}st=it.sep[i];_context10.t1=st.type;_context10.next=_context10.t1==="newline"?37:_context10.t1==="space"?39:_context10.t1==="comment"?40:42;break;case 37:nl.push(i);return _context10.abrupt("break",43);case 39:return _context10.abrupt("break",43);case 40:if(st.indent>map.indent)nl.length=0;return _context10.abrupt("break",43);case 42:nl.length=0;case 43:++i;_context10.next=32;break;case 46:if(nl.length>=2)start=it.sep.splice(nl[1]);case 47:_context10.t2=this.type;_context10.next=_context10.t2==="anchor"?50:_context10.t2==="tag"?50:_context10.t2==="explicit-key-ind"?52:_context10.t2==="map-value-ind"?55:_context10.t2==="alias"?58:_context10.t2==="scalar"?58:_context10.t2==="single-quoted-scalar"?58:_context10.t2==="double-quoted-scalar"?58:61;break;case 50:if(atNextItem||it.value){start.push(this.sourceToken);map.items.push({start:start});this.onKeyLine=true}else if(it.sep){it.sep.push(this.sourceToken)}else{it.start.push(this.sourceToken)}return _context10.abrupt("return");case 52:if(!it.sep&&!it.explicitKey){it.start.push(this.sourceToken);it.explicitKey=true}else if(atNextItem||it.value){start.push(this.sourceToken);map.items.push({start:start,explicitKey:true})}else{this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:true}]})}this.onKeyLine=true;return _context10.abrupt("return");case 55:if(it.explicitKey){if(!it.sep){if(includesToken(it.start,"newline")){Object.assign(it,{key:null,sep:[this.sourceToken]})}else{_start=getFirstKeyStartProps(it.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:_start,key:null,sep:[this.sourceToken]}]})}}else if(it.value){map.items.push({start:[],key:null,sep:[this.sourceToken]})}else if(includesToken(it.sep,"map-value-ind")){this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:start,key:null,sep:[this.sourceToken]}]})}else if(isFlowToken(it.key)&&!includesToken(it.sep,"newline")){_start2=getFirstKeyStartProps(it.start);key=it.key;sep=it.sep;sep.push(this.sourceToken);delete it.key,delete it.sep;this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:_start2,key:key,sep:sep}]})}else if(start.length>0){it.sep=it.sep.concat(start,this.sourceToken)}else{it.sep.push(this.sourceToken)}}else{if(!it.sep){Object.assign(it,{key:null,sep:[this.sourceToken]})}else if(it.value||atNextItem){map.items.push({start:start,key:null,sep:[this.sourceToken]})}else if(includesToken(it.sep,"map-value-ind")){this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]})}else{it.sep.push(this.sourceToken)}}this.onKeyLine=true;return _context10.abrupt("return");case 58:fs=this.flowScalar(this.type);if(atNextItem||it.value){map.items.push({start:start,key:fs,sep:[]});this.onKeyLine=true}else if(it.sep){this.stack.push(fs)}else{Object.assign(it,{key:fs,sep:[]});this.onKeyLine=true}return _context10.abrupt("return");case 61:bv=this.startBlockValue(map);if(!bv){_context10.next=66;break}if(atMapIndent&&bv.type!=="block-seq"){map.items.push({start:start})}this.stack.push(bv);return _context10.abrupt("return");case 66:return _context10.delegateYield(this.pop(),"t3",67);case 67:return _context10.delegateYield(this.step(),"t4",68);case 68:case"end":return _context10.stop()}}),blockMap,this)}))},{key:"blockSequence",value:_regeneratorRuntime().mark((function blockSequence(seq){var it,end,last,_prev$value2,prev,_end2,bv;return _regeneratorRuntime().wrap((function blockSequence$(_context11){while(1)switch(_context11.prev=_context11.next){case 0:it=seq.items[seq.items.length-1];_context11.t0=this.type;_context11.next=_context11.t0==="newline"?4:_context11.t0==="space"?6:_context11.t0==="comment"?6:_context11.t0==="anchor"?20:_context11.t0==="tag"?20:_context11.t0==="seq-item-ind"?24:28;break;case 4:if(it.value){end="end"in it.value?it.value.end:undefined;last=Array.isArray(end)?end[end.length-1]:undefined;if((last===null||last===void 0?void 0:last.type)==="comment")end===null||end===void 0||end.push(this.sourceToken);else seq.items.push({start:[this.sourceToken]})}else it.start.push(this.sourceToken);return _context11.abrupt("return");case 6:if(!it.value){_context11.next=10;break}seq.items.push({start:[this.sourceToken]});_context11.next=19;break;case 10:if(!this.atIndentedComment(it.start,seq.indent)){_context11.next=18;break}prev=seq.items[seq.items.length-2];_end2=prev===null||prev===void 0||(_prev$value2=prev.value)===null||_prev$value2===void 0?void 0:_prev$value2.end;if(!Array.isArray(_end2)){_context11.next=18;break}Array.prototype.push.apply(_end2,it.start);_end2.push(this.sourceToken);seq.items.pop();return _context11.abrupt("return");case 18:it.start.push(this.sourceToken);case 19:return _context11.abrupt("return");case 20:if(!(it.value||this.indent<=seq.indent)){_context11.next=22;break}return _context11.abrupt("break",28);case 22:it.start.push(this.sourceToken);return _context11.abrupt("return");case 24:if(!(this.indent!==seq.indent)){_context11.next=26;break}return _context11.abrupt("break",28);case 26:if(it.value||includesToken(it.start,"seq-item-ind"))seq.items.push({start:[this.sourceToken]});else it.start.push(this.sourceToken);return _context11.abrupt("return");case 28:if(!(this.indent>seq.indent)){_context11.next=33;break}bv=this.startBlockValue(seq);if(!bv){_context11.next=33;break}this.stack.push(bv);return _context11.abrupt("return");case 33:return _context11.delegateYield(this.pop(),"t1",34);case 34:return _context11.delegateYield(this.step(),"t2",35);case 35:case"end":return _context11.stop()}}),blockSequence,this)}))},{key:"flowCollection",value:_regeneratorRuntime().mark((function flowCollection(fc){var it,top,fs,bv,parent,prev,start,sep,map;return _regeneratorRuntime().wrap((function flowCollection$(_context12){while(1)switch(_context12.prev=_context12.next){case 0:it=fc.items[fc.items.length-1];if(!(this.type==="flow-error-end")){_context12.next=7;break}case 2:return _context12.delegateYield(this.pop(),"t0",3);case 3:top=this.peek(1);case 4:if(top&&top.type==="flow-collection"){_context12.next=2;break}case 5:_context12.next=49;break;case 7:if(!(fc.end.length===0)){_context12.next=31;break}_context12.t1=this.type;_context12.next=_context12.t1==="comma"?11:_context12.t1==="explicit-key-ind"?11:_context12.t1==="map-value-ind"?13:_context12.t1==="space"?15:_context12.t1==="comment"?15:_context12.t1==="newline"?15:_context12.t1==="anchor"?15:_context12.t1==="tag"?15:_context12.t1==="alias"?17:_context12.t1==="scalar"?17:_context12.t1==="single-quoted-scalar"?17:_context12.t1==="double-quoted-scalar"?17:_context12.t1==="flow-map-end"?20:_context12.t1==="flow-seq-end"?20:22;break;case 11:if(!it||it.sep)fc.items.push({start:[this.sourceToken]});else it.start.push(this.sourceToken);return _context12.abrupt("return");case 13:if(!it||it.value)fc.items.push({start:[],key:null,sep:[this.sourceToken]});else if(it.sep)it.sep.push(this.sourceToken);else Object.assign(it,{key:null,sep:[this.sourceToken]});return _context12.abrupt("return");case 15:if(!it||it.value)fc.items.push({start:[this.sourceToken]});else if(it.sep)it.sep.push(this.sourceToken);else it.start.push(this.sourceToken);return _context12.abrupt("return");case 17:fs=this.flowScalar(this.type);if(!it||it.value)fc.items.push({start:[],key:fs,sep:[]});else if(it.sep)this.stack.push(fs);else Object.assign(it,{key:fs,sep:[]});return _context12.abrupt("return");case 20:fc.end.push(this.sourceToken);return _context12.abrupt("return");case 22:bv=this.startBlockValue(fc);if(!bv){_context12.next=27;break}this.stack.push(bv);_context12.next=29;break;case 27:return _context12.delegateYield(this.pop(),"t2",28);case 28:return _context12.delegateYield(this.step(),"t3",29);case 29:_context12.next=49;break;case 31:parent=this.peek(2);if(!(parent.type==="block-map"&&(this.type==="map-value-ind"&&parent.indent===fc.indent||this.type==="newline"&&!parent.items[parent.items.length-1].sep))){_context12.next=37;break}return _context12.delegateYield(this.pop(),"t4",34);case 34:return _context12.delegateYield(this.step(),"t5",35);case 35:_context12.next=49;break;case 37:if(!(this.type==="map-value-ind"&&parent.type!=="flow-collection")){_context12.next=48;break}prev=getPrevProps(parent);start=getFirstKeyStartProps(prev);fixFlowSeqItems(fc);sep=fc.end.splice(1,fc.end.length);sep.push(this.sourceToken);map={type:"block-map",offset:fc.offset,indent:fc.indent,items:[{start:start,key:fc,sep:sep}]};this.onKeyLine=true;this.stack[this.stack.length-1]=map;_context12.next=49;break;case 48:return _context12.delegateYield(this.lineEnd(fc),"t6",49);case 49:case"end":return _context12.stop()}}),flowCollection,this)}))},{key:"flowScalar",value:function flowScalar(type){if(this.onNewLine){var nl=this.source.indexOf("\n")+1;while(nl!==0){this.onNewLine(this.offset+nl);nl=this.source.indexOf("\n",nl)+1}}return{type:type,offset:this.offset,indent:this.indent,source:this.source}}},{key:"startBlockValue",value:function startBlockValue(parent){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=true;var prev=getPrevProps(parent);var start=getFirstKeyStartProps(prev);start.push(this.sourceToken);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:start,explicitKey:true}]}}case"map-value-ind":{this.onKeyLine=true;var _prev=getPrevProps(parent);var _start3=getFirstKeyStartProps(_prev);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:_start3,key:null,sep:[this.sourceToken]}]}}}return null}},{key:"atIndentedComment",value:function atIndentedComment(start,indent){if(this.type!=="comment")return false;if(this.indent<=indent)return false;return start.every((function(st){return st.type==="newline"||st.type==="space"}))}},{key:"documentEnd",value:_regeneratorRuntime().mark((function documentEnd(docEnd){return _regeneratorRuntime().wrap((function documentEnd$(_context13){while(1)switch(_context13.prev=_context13.next){case 0:if(!(this.type!=="doc-mode")){_context13.next=4;break}if(docEnd.end)docEnd.end.push(this.sourceToken);else docEnd.end=[this.sourceToken];if(!(this.type==="newline")){_context13.next=4;break}return _context13.delegateYield(this.pop(),"t0",4);case 4:case"end":return _context13.stop()}}),documentEnd,this)}))},{key:"lineEnd",value:_regeneratorRuntime().mark((function lineEnd(token){return _regeneratorRuntime().wrap((function lineEnd$(_context14){while(1)switch(_context14.prev=_context14.next){case 0:_context14.t0=this.type;_context14.next=_context14.t0==="comma"?3:_context14.t0==="doc-start"?3:_context14.t0==="doc-end"?3:_context14.t0==="flow-seq-end"?3:_context14.t0==="flow-map-end"?3:_context14.t0==="map-value-ind"?3:_context14.t0==="newline"?6:_context14.t0==="space"?7:_context14.t0==="comment"?7:7;break;case 3:return _context14.delegateYield(this.pop(),"t1",4);case 4:return _context14.delegateYield(this.step(),"t2",5);case 5:return _context14.abrupt("break",10);case 6:this.onKeyLine=false;case 7:if(token.end)token.end.push(this.sourceToken);else token.end=[this.sourceToken];if(!(this.type==="newline")){_context14.next=10;break}return _context14.delegateYield(this.pop(),"t3",10);case 10:case"end":return _context14.stop()}}),lineEnd,this)}))}])}()},{"./cst.js":261,"./lexer.js":262}],265:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.parse=parse;exports.parseAllDocuments=parseAllDocuments;exports.parseDocument=parseDocument;exports.stringify=stringify;var _composer=require("./compose/composer.js");var _Document=require("./doc/Document.js");var _errors=require("./errors.js");var _log=require("./log.js");var _lineCounter=require("./parse/line-counter.js");var _parser=require("./parse/parser.js");function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function parseOptions(options){var prettyErrors=options.prettyErrors!==false;var lineCounter=options.lineCounter||prettyErrors&&new _lineCounter.LineCounter||null;return{lineCounter:lineCounter,prettyErrors:prettyErrors}}function parseAllDocuments(source){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var _parseOptions=parseOptions(options),lineCounter=_parseOptions.lineCounter,prettyErrors=_parseOptions.prettyErrors;var parser=new _parser.Parser(lineCounter===null||lineCounter===void 0?void 0:lineCounter.addNewLine);var composer=new _composer.Composer(options);var docs=Array.from(composer.compose(parser.parse(source)));if(prettyErrors&&lineCounter){var _iterator=_createForOfIteratorHelper(docs),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var doc=_step.value;doc.errors.forEach((0,_errors.prettifyError)(source,lineCounter));doc.warnings.forEach((0,_errors.prettifyError)(source,lineCounter))}}catch(err){_iterator.e(err)}finally{_iterator.f()}}if(docs.length>0)return docs;return Object.assign([],{empty:true},composer.streamInfo())}function parseDocument(source){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var _parseOptions2=parseOptions(options),lineCounter=_parseOptions2.lineCounter,prettyErrors=_parseOptions2.prettyErrors;var parser=new _parser.Parser(lineCounter===null||lineCounter===void 0?void 0:lineCounter.addNewLine);var composer=new _composer.Composer(options);var doc=null;var _iterator2=_createForOfIteratorHelper(composer.compose(parser.parse(source),true,source.length)),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var _doc=_step2.value;if(!doc)doc=_doc;else if(doc.options.logLevel!=="silent"){doc.errors.push(new _errors.YAMLParseError(_doc.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}if(prettyErrors&&lineCounter){doc.errors.forEach((0,_errors.prettifyError)(source,lineCounter));doc.warnings.forEach((0,_errors.prettifyError)(source,lineCounter))}return doc}function parse(src,reviver,options){var _reviver=undefined;if(typeof reviver==="function"){_reviver=reviver}else if(options===undefined&&reviver&&_typeof(reviver)==="object"){options=reviver}var doc=parseDocument(src,options);if(!doc)return null;doc.warnings.forEach((function(warning){return(0,_log.warn)(doc.options.logLevel,warning)}));if(doc.errors.length>0){if(doc.options.logLevel!=="silent")throw doc.errors[0];else doc.errors=[]}return doc.toJS(Object.assign({reviver:_reviver},options))}function stringify(value,replacer,options){var _replacer=null;if(typeof replacer==="function"||Array.isArray(replacer)){_replacer=replacer}else if(options===undefined&&replacer){options=replacer}if(typeof options==="string")options=options.length;if(typeof options==="number"){var indent=Math.round(options);options=indent<1?undefined:indent>8?{indent:8}:{indent:indent}}if(value===undefined){var _ref2;var _ref=(_ref2=options!==null&&options!==void 0?options:replacer)!==null&&_ref2!==void 0?_ref2:{},keepUndefined=_ref.keepUndefined;if(!keepUndefined)return undefined}return new _Document.Document(value,_replacer,options).toString(options)}},{"./compose/composer.js":228,"./doc/Document.js":240,"./errors.js":245,"./log.js":247,"./parse/line-counter.js":263,"./parse/parser.js":264}],266:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.Schema=void 0;var _identity=require("../nodes/identity.js");var _map=require("./common/map.js");var _seq=require("./common/seq.js");var _string=require("./common/string.js");var _tags=require("./tags.js");function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var sortMapEntriesByKey=function sortMapEntriesByKey(a,b){return a.key<b.key?-1:a.key>b.key?1:0};var Schema=exports.Schema=function(){function Schema(_ref){var compat=_ref.compat,customTags=_ref.customTags,merge=_ref.merge,resolveKnownTags=_ref.resolveKnownTags,schema=_ref.schema,sortMapEntries=_ref.sortMapEntries,toStringDefaults=_ref.toStringDefaults;_classCallCheck(this,Schema);this.compat=Array.isArray(compat)?(0,_tags.getTags)(compat,"compat"):compat?(0,_tags.getTags)(null,compat):null;this.merge=!!merge;this.name=typeof schema==="string"&&schema||"core";this.knownTags=resolveKnownTags?_tags.coreKnownTags:{};this.tags=(0,_tags.getTags)(customTags,this.name);this.toStringOptions=toStringDefaults!==null&&toStringDefaults!==void 0?toStringDefaults:null;Object.defineProperty(this,_identity.MAP,{value:_map.map});Object.defineProperty(this,_identity.SCALAR,{value:_string.string});Object.defineProperty(this,_identity.SEQ,{value:_seq.seq});this.sortMapEntries=typeof sortMapEntries==="function"?sortMapEntries:sortMapEntries===true?sortMapEntriesByKey:null}return _createClass(Schema,[{key:"clone",value:function clone(){var copy=Object.create(Schema.prototype,Object.getOwnPropertyDescriptors(this));copy.tags=this.tags.slice();return copy}}])}()},{"../nodes/identity.js":256,"./common/map.js":267,"./common/seq.js":269,"./common/string.js":270,"./tags.js":276}],267:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.map=void 0;var _identity=require("../../nodes/identity.js");var _YAMLMap=require("../../nodes/YAMLMap.js");var map=exports.map={collection:"map",default:true,nodeClass:_YAMLMap.YAMLMap,tag:"tag:yaml.org,2002:map",resolve:function resolve(map,onError){if(!(0,_identity.isMap)(map))onError("Expected a mapping for this tag");return map},createNode:function createNode(schema,obj,ctx){return _YAMLMap.YAMLMap.from(schema,obj,ctx)}}},{"../../nodes/YAMLMap.js":253,"../../nodes/identity.js":256}],268:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.nullTag=void 0;var _Scalar=require("../../nodes/Scalar.js");var nullTag=exports.nullTag={identify:function identify(value){return value==null},createNode:function createNode(){return new _Scalar.Scalar(null)},default:true,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:function resolve(){return new _Scalar.Scalar(null)},stringify:function stringify(_ref,ctx){var source=_ref.source;return typeof source==="string"&&nullTag.test.test(source)?source:ctx.options.nullStr}}},{"../../nodes/Scalar.js":252}],269:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.seq=void 0;var _identity=require("../../nodes/identity.js");var _YAMLSeq=require("../../nodes/YAMLSeq.js");var seq=exports.seq={collection:"seq",default:true,nodeClass:_YAMLSeq.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve:function resolve(seq,onError){if(!(0,_identity.isSeq)(seq))onError("Expected a sequence for this tag");return seq},createNode:function createNode(schema,obj,ctx){return _YAMLSeq.YAMLSeq.from(schema,obj,ctx)}}},{"../../nodes/YAMLSeq.js":254,"../../nodes/identity.js":256}],270:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.string=void 0;var _stringifyString=require("../../stringify/stringifyString.js");var string=exports.string={identify:function identify(value){return typeof value==="string"},default:true,tag:"tag:yaml.org,2002:str",resolve:function resolve(str){return str},stringify:function stringify(item,ctx,onComment,onChompKeep){ctx=Object.assign({actualString:true},ctx);return(0,_stringifyString.stringifyString)(item,ctx,onComment,onChompKeep)}}},{"../../stringify/stringifyString.js":293}],271:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.boolTag=void 0;var _Scalar=require("../../nodes/Scalar.js");var boolTag=exports.boolTag={identify:function identify(value){return typeof value==="boolean"},default:true,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:function resolve(str){return new _Scalar.Scalar(str[0]==="t"||str[0]==="T")},stringify:function stringify(_ref,ctx){var source=_ref.source,value=_ref.value;if(source&&boolTag.test.test(source)){var sv=source[0]==="t"||source[0]==="T";if(value===sv)return source}return value?ctx.options.trueStr:ctx.options.falseStr}}},{"../../nodes/Scalar.js":252}],272:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.floatNaN=exports.floatExp=exports["float"]=void 0;var _Scalar=require("../../nodes/Scalar.js");var _stringifyNumber=require("../../stringify/stringifyNumber.js");var floatNaN=exports.floatNaN={identify:function identify(value){return typeof value==="number"},default:true,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:function resolve(str){return str.slice(-3).toLowerCase()==="nan"?NaN:str[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY},stringify:_stringifyNumber.stringifyNumber};var floatExp=exports.floatExp={identify:function identify(value){return typeof value==="number"},default:true,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:function resolve(str){return parseFloat(str)},stringify:function stringify(node){var num=Number(node.value);return isFinite(num)?num.toExponential():(0,_stringifyNumber.stringifyNumber)(node)}};var _float=exports["float"]={identify:function identify(value){return typeof value==="number"},default:true,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve:function resolve(str){var node=new _Scalar.Scalar(parseFloat(str));var dot=str.indexOf(".");if(dot!==-1&&str[str.length-1]==="0")node.minFractionDigits=str.length-dot-1;return node},stringify:_stringifyNumber.stringifyNumber}},{"../../nodes/Scalar.js":252,"../../stringify/stringifyNumber.js":291}],273:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.intOct=exports.intHex=exports["int"]=void 0;var _stringifyNumber=require("../../stringify/stringifyNumber.js");var intIdentify=function intIdentify(value){return typeof value==="bigint"||Number.isInteger(value)};var intResolve=function intResolve(str,offset,radix,_ref){var intAsBigInt=_ref.intAsBigInt;return intAsBigInt?BigInt(str):parseInt(str.substring(offset),radix)};function intStringify(node,radix,prefix){var value=node.value;if(intIdentify(value)&&value>=0)return prefix+value.toString(radix);return(0,_stringifyNumber.stringifyNumber)(node)}var intOct=exports.intOct={identify:function identify(value){return intIdentify(value)&&value>=0},default:true,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:function resolve(str,_onError,opt){return intResolve(str,2,8,opt)},stringify:function stringify(node){return intStringify(node,8,"0o")}};var _int=exports["int"]={identify:intIdentify,default:true,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:function resolve(str,_onError,opt){return intResolve(str,0,10,opt)},stringify:_stringifyNumber.stringifyNumber};var intHex=exports.intHex={identify:function identify(value){return intIdentify(value)&&value>=0},default:true,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:function resolve(str,_onError,opt){return intResolve(str,2,16,opt)},stringify:function stringify(node){return intStringify(node,16,"0x")}}},{"../../stringify/stringifyNumber.js":291}],274:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.schema=void 0;var _map=require("../common/map.js");var _null=require("../common/null.js");var _seq=require("../common/seq.js");var _string=require("../common/string.js");var _bool=require("./bool.js");var _float2=require("./float.js");var _int2=require("./int.js");var schema=exports.schema=[_map.map,_seq.seq,_string.string,_null.nullTag,_bool.boolTag,_int2.intOct,_int2["int"],_int2.intHex,_float2.floatNaN,_float2.floatExp,_float2["float"]]},{"../common/map.js":267,"../common/null.js":268,"../common/seq.js":269,"../common/string.js":270,"./bool.js":271,"./float.js":272,"./int.js":273}],275:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.schema=void 0;var _Scalar=require("../../nodes/Scalar.js");var _map=require("../common/map.js");var _seq=require("../common/seq.js");function intIdentify(value){return typeof value==="bigint"||Number.isInteger(value)}var stringifyJSON=function stringifyJSON(_ref){var value=_ref.value;return JSON.stringify(value)};var jsonScalars=[{identify:function identify(value){return typeof value==="string"},default:true,tag:"tag:yaml.org,2002:str",resolve:function resolve(str){return str},stringify:stringifyJSON},{identify:function identify(value){return value==null},createNode:function createNode(){return new _Scalar.Scalar(null)},default:true,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:function resolve(){return null},stringify:stringifyJSON},{identify:function identify(value){return typeof value==="boolean"},default:true,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:function resolve(str){return str==="true"},stringify:stringifyJSON},{identify:intIdentify,default:true,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:function resolve(str,_onError,_ref2){var intAsBigInt=_ref2.intAsBigInt;return intAsBigInt?BigInt(str):parseInt(str,10)},stringify:function stringify(_ref3){var value=_ref3.value;return intIdentify(value)?value.toString():JSON.stringify(value)}},{identify:function identify(value){return typeof value==="number"},default:true,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:function resolve(str){return parseFloat(str)},stringify:stringifyJSON}];var jsonError={default:true,tag:"",test:/^/,resolve:function resolve(str,onError){onError("Unresolved plain scalar ".concat(JSON.stringify(str)));return str}};var schema=exports.schema=[_map.map,_seq.seq].concat(jsonScalars,jsonError)},{"../../nodes/Scalar.js":252,"../common/map.js":267,"../common/seq.js":269}],276:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.coreKnownTags=void 0;exports.getTags=getTags;var _map=require("./common/map.js");var _null=require("./common/null.js");var _seq=require("./common/seq.js");var _string=require("./common/string.js");var _bool=require("./core/bool.js");var _float2=require("./core/float.js");var _int2=require("./core/int.js");var _schema=require("./core/schema.js");var _schema2=require("./json/schema.js");var _binary=require("./yaml-1.1/binary.js");var _omap=require("./yaml-1.1/omap.js");var _pairs=require("./yaml-1.1/pairs.js");var _schema3=require("./yaml-1.1/schema.js");var _set=require("./yaml-1.1/set.js");var _timestamp=require("./yaml-1.1/timestamp.js");function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}var schemas=new Map([["core",_schema.schema],["failsafe",[_map.map,_seq.seq,_string.string]],["json",_schema2.schema],["yaml11",_schema3.schema],["yaml-1.1",_schema3.schema]]);var tagsByName={binary:_binary.binary,bool:_bool.boolTag,float:_float2["float"],floatExp:_float2.floatExp,floatNaN:_float2.floatNaN,floatTime:_timestamp.floatTime,int:_int2["int"],intHex:_int2.intHex,intOct:_int2.intOct,intTime:_timestamp.intTime,map:_map.map,null:_null.nullTag,omap:_omap.omap,pairs:_pairs.pairs,seq:_seq.seq,set:_set.set,timestamp:_timestamp.timestamp};var coreKnownTags=exports.coreKnownTags={"tag:yaml.org,2002:binary":_binary.binary,"tag:yaml.org,2002:omap":_omap.omap,"tag:yaml.org,2002:pairs":_pairs.pairs,"tag:yaml.org,2002:set":_set.set,"tag:yaml.org,2002:timestamp":_timestamp.timestamp};function getTags(customTags,schemaName){var tags=schemas.get(schemaName);if(!tags){if(Array.isArray(customTags))tags=[];else{var keys=Array.from(schemas.keys()).filter((function(key){return key!=="yaml11"})).map((function(key){return JSON.stringify(key)})).join(", ");throw new Error('Unknown schema "'.concat(schemaName,'"; use one of ').concat(keys," or define customTags array"))}}if(Array.isArray(customTags)){var _iterator=_createForOfIteratorHelper(customTags),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var tag=_step.value;tags=tags.concat(tag)}}catch(err){_iterator.e(err)}finally{_iterator.f()}}else if(typeof customTags==="function"){tags=customTags(tags.slice())}return tags.map((function(tag){if(typeof tag!=="string")return tag;var tagObj=tagsByName[tag];if(tagObj)return tagObj;var keys=Object.keys(tagsByName).map((function(key){return JSON.stringify(key)})).join(", ");throw new Error('Unknown custom tag "'.concat(tag,'"; use one of ').concat(keys))}))}},{"./common/map.js":267,"./common/null.js":268,"./common/seq.js":269,"./common/string.js":270,"./core/bool.js":271,"./core/float.js":272,"./core/int.js":273,"./core/schema.js":274,"./json/schema.js":275,"./yaml-1.1/binary.js":277,"./yaml-1.1/omap.js":281,"./yaml-1.1/pairs.js":282,"./yaml-1.1/schema.js":283,"./yaml-1.1/set.js":284,"./yaml-1.1/timestamp.js":285}],277:[function(require,module,exports){(function(Buffer){(function(){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.binary=void 0;var _Scalar=require("../../nodes/Scalar.js");var _stringifyString=require("../../stringify/stringifyString.js");var binary=exports.binary={identify:function identify(value){return value instanceof Uint8Array},default:false,tag:"tag:yaml.org,2002:binary",resolve:function resolve(src,onError){if(typeof Buffer==="function"){return Buffer.from(src,"base64")}else if(typeof atob==="function"){var str=atob(src.replace(/[\n\r]/g,""));var buffer=new Uint8Array(str.length);for(var i=0;i<str.length;++i)buffer[i]=str.charCodeAt(i);return buffer}else{onError("This environment does not support reading binary tags; either Buffer or atob is required");return src}},stringify:function stringify(_ref,ctx,onComment,onChompKeep){var comment=_ref.comment,type=_ref.type,value=_ref.value;var buf=value;var str;if(typeof Buffer==="function"){str=buf instanceof Buffer?buf.toString("base64"):Buffer.from(buf.buffer).toString("base64")}else if(typeof btoa==="function"){var s="";for(var i=0;i<buf.length;++i)s+=String.fromCharCode(buf[i]);str=btoa(s)}else{throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required")}if(!type)type=_Scalar.Scalar.BLOCK_LITERAL;if(type!==_Scalar.Scalar.QUOTE_DOUBLE){var lineWidth=Math.max(ctx.options.lineWidth-ctx.indent.length,ctx.options.minContentWidth);var n=Math.ceil(str.length/lineWidth);var lines=new Array(n);for(var _i=0,o=0;_i<n;++_i,o+=lineWidth){lines[_i]=str.substr(o,lineWidth)}str=lines.join(type===_Scalar.Scalar.BLOCK_LITERAL?"\n":" ")}return(0,_stringifyString.stringifyString)({comment:comment,type:type,value:str},ctx,onComment,onChompKeep)}}}).call(this)}).call(this,require("buffer").Buffer)},{"../../nodes/Scalar.js":252,"../../stringify/stringifyString.js":293,buffer:74}],278:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.trueTag=exports.falseTag=void 0;var _Scalar=require("../../nodes/Scalar.js");function boolStringify(_ref,ctx){var value=_ref.value,source=_ref.source;var boolObj=value?trueTag:falseTag;if(source&&boolObj.test.test(source))return source;return value?ctx.options.trueStr:ctx.options.falseStr}var trueTag=exports.trueTag={identify:function identify(value){return value===true},default:true,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:function resolve(){return new _Scalar.Scalar(true)},stringify:boolStringify};var falseTag=exports.falseTag={identify:function identify(value){return value===false},default:true,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:function resolve(){return new _Scalar.Scalar(false)},stringify:boolStringify}},{"../../nodes/Scalar.js":252}],279:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.floatNaN=exports.floatExp=exports["float"]=void 0;var _Scalar=require("../../nodes/Scalar.js");var _stringifyNumber=require("../../stringify/stringifyNumber.js");var floatNaN=exports.floatNaN={identify:function identify(value){return typeof value==="number"},default:true,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:function resolve(str){return str.slice(-3).toLowerCase()==="nan"?NaN:str[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY},stringify:_stringifyNumber.stringifyNumber};var floatExp=exports.floatExp={identify:function identify(value){return typeof value==="number"},default:true,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:function resolve(str){return parseFloat(str.replace(/_/g,""))},stringify:function stringify(node){var num=Number(node.value);return isFinite(num)?num.toExponential():(0,_stringifyNumber.stringifyNumber)(node)}};var _float=exports["float"]={identify:function identify(value){return typeof value==="number"},default:true,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve:function resolve(str){var node=new _Scalar.Scalar(parseFloat(str.replace(/_/g,"")));var dot=str.indexOf(".");if(dot!==-1){var f=str.substring(dot+1).replace(/_/g,"");if(f[f.length-1]==="0")node.minFractionDigits=f.length}return node},stringify:_stringifyNumber.stringifyNumber}},{"../../nodes/Scalar.js":252,"../../stringify/stringifyNumber.js":291}],280:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.intOct=exports.intHex=exports.intBin=exports["int"]=void 0;var _stringifyNumber=require("../../stringify/stringifyNumber.js");var intIdentify=function intIdentify(value){return typeof value==="bigint"||Number.isInteger(value)};function intResolve(str,offset,radix,_ref){var intAsBigInt=_ref.intAsBigInt;var sign=str[0];if(sign==="-"||sign==="+")offset+=1;str=str.substring(offset).replace(/_/g,"");if(intAsBigInt){switch(radix){case 2:str="0b".concat(str);break;case 8:str="0o".concat(str);break;case 16:str="0x".concat(str);break}var _n=BigInt(str);return sign==="-"?BigInt(-1)*_n:_n}var n=parseInt(str,radix);return sign==="-"?-1*n:n}function intStringify(node,radix,prefix){var value=node.value;if(intIdentify(value)){var str=value.toString(radix);return value<0?"-"+prefix+str.substr(1):prefix+str}return(0,_stringifyNumber.stringifyNumber)(node)}var intBin=exports.intBin={identify:intIdentify,default:true,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:function resolve(str,_onError,opt){return intResolve(str,2,2,opt)},stringify:function stringify(node){return intStringify(node,2,"0b")}};var intOct=exports.intOct={identify:intIdentify,default:true,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:function resolve(str,_onError,opt){return intResolve(str,1,8,opt)},stringify:function stringify(node){return intStringify(node,8,"0")}};var _int=exports["int"]={identify:intIdentify,default:true,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:function resolve(str,_onError,opt){return intResolve(str,0,10,opt)},stringify:_stringifyNumber.stringifyNumber};var intHex=exports.intHex={identify:intIdentify,default:true,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:function resolve(str,_onError,opt){return intResolve(str,2,16,opt)},stringify:function stringify(node){return intStringify(node,16,"0x")}}},{"../../stringify/stringifyNumber.js":291}],281:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}Object.defineProperty(exports,"__esModule",{value:true});exports.omap=exports.YAMLOMap=void 0;var _identity=require("../../nodes/identity.js");var _toJS=require("../../nodes/toJS.js");var _YAMLMap=require("../../nodes/YAMLMap.js");var _YAMLSeq2=require("../../nodes/YAMLSeq.js");var _pairs=require("./pairs.js");function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t)}:p}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value}},_get.apply(null,arguments)}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}var YAMLOMap=exports.YAMLOMap=function(_YAMLSeq){function YAMLOMap(){var _this;_classCallCheck(this,YAMLOMap);_this=_callSuper(this,YAMLOMap);_this.add=_YAMLMap.YAMLMap.prototype.add.bind(_this);_this["delete"]=_YAMLMap.YAMLMap.prototype["delete"].bind(_this);_this.get=_YAMLMap.YAMLMap.prototype.get.bind(_this);_this.has=_YAMLMap.YAMLMap.prototype.has.bind(_this);_this.set=_YAMLMap.YAMLMap.prototype.set.bind(_this);_this.tag=YAMLOMap.tag;return _this}_inherits(YAMLOMap,_YAMLSeq);return _createClass(YAMLOMap,[{key:"toJSON",value:function toJSON(_,ctx){if(!ctx)return _superPropGet(YAMLOMap,"toJSON",this,3)([_]);var map=new Map;if(ctx!==null&&ctx!==void 0&&ctx.onCreate)ctx.onCreate(map);var _iterator=_createForOfIteratorHelper(this.items),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var pair=_step.value;var key=void 0,value=void 0;if((0,_identity.isPair)(pair)){key=(0,_toJS.toJS)(pair.key,"",ctx);value=(0,_toJS.toJS)(pair.value,key,ctx)}else{key=(0,_toJS.toJS)(pair,"",ctx)}if(map.has(key))throw new Error("Ordered maps must not include duplicate keys");map.set(key,value)}}catch(err){_iterator.e(err)}finally{_iterator.f()}return map}}],[{key:"from",value:function from(schema,iterable,ctx){var pairs=(0,_pairs.createPairs)(schema,iterable,ctx);var omap=new this;omap.items=pairs.items;return omap}}])}(_YAMLSeq2.YAMLSeq);YAMLOMap.tag="tag:yaml.org,2002:omap";var omap=exports.omap={collection:"seq",identify:function identify(value){return value instanceof Map},nodeClass:YAMLOMap,default:false,tag:"tag:yaml.org,2002:omap",resolve:function resolve(seq,onError){var pairs=(0,_pairs.resolvePairs)(seq,onError);var seenKeys=[];var _iterator2=_createForOfIteratorHelper(pairs.items),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var key=_step2.value.key;if((0,_identity.isScalar)(key)){if(seenKeys.includes(key.value)){onError("Ordered maps must not include duplicate keys: ".concat(key.value))}else{seenKeys.push(key.value)}}}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}return Object.assign(new YAMLOMap,pairs)},createNode:function createNode(schema,iterable,ctx){return YAMLOMap.from(schema,iterable,ctx)}}},{"../../nodes/YAMLMap.js":253,"../../nodes/YAMLSeq.js":254,"../../nodes/identity.js":256,"../../nodes/toJS.js":257,"./pairs.js":282}],282:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.createPairs=createPairs;exports.pairs=void 0;exports.resolvePairs=resolvePairs;var _identity=require("../../nodes/identity.js");var _Pair=require("../../nodes/Pair.js");var _Scalar=require("../../nodes/Scalar.js");var _YAMLSeq=require("../../nodes/YAMLSeq.js");function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function resolvePairs(seq,onError){if((0,_identity.isSeq)(seq)){for(var i=0;i<seq.items.length;++i){var item=seq.items[i];if((0,_identity.isPair)(item))continue;else if((0,_identity.isMap)(item)){if(item.items.length>1)onError("Each pair must have its own sequence indicator");var pair=item.items[0]||new _Pair.Pair(new _Scalar.Scalar(null));if(item.commentBefore)pair.key.commentBefore=pair.key.commentBefore?"".concat(item.commentBefore,"\n").concat(pair.key.commentBefore):item.commentBefore;if(item.comment){var _pair$value;var cn=(_pair$value=pair.value)!==null&&_pair$value!==void 0?_pair$value:pair.key;cn.comment=cn.comment?"".concat(item.comment,"\n").concat(cn.comment):item.comment}item=pair}seq.items[i]=(0,_identity.isPair)(item)?item:new _Pair.Pair(item)}}else onError("Expected a sequence for this tag");return seq}function createPairs(schema,iterable,ctx){var replacer=ctx.replacer;var pairs=new _YAMLSeq.YAMLSeq(schema);pairs.tag="tag:yaml.org,2002:pairs";var i=0;if(iterable&&Symbol.iterator in Object(iterable)){var _iterator=_createForOfIteratorHelper(iterable),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var it=_step.value;if(typeof replacer==="function")it=replacer.call(iterable,String(i++),it);var key=void 0,value=void 0;if(Array.isArray(it)){if(it.length===2){key=it[0];value=it[1]}else throw new TypeError("Expected [key, value] tuple: ".concat(it))}else if(it&&it instanceof Object){var keys=Object.keys(it);if(keys.length===1){key=keys[0];value=it[key]}else{throw new TypeError("Expected tuple with one key, not ".concat(keys.length," keys"))}}else{key=it}pairs.items.push((0,_Pair.createPair)(key,value,ctx))}}catch(err){_iterator.e(err)}finally{_iterator.f()}}return pairs}var pairs=exports.pairs={collection:"seq",default:false,tag:"tag:yaml.org,2002:pairs",resolve:resolvePairs,createNode:createPairs}},{"../../nodes/Pair.js":251,"../../nodes/Scalar.js":252,"../../nodes/YAMLSeq.js":254,"../../nodes/identity.js":256}],283:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.schema=void 0;var _map=require("../common/map.js");var _null=require("../common/null.js");var _seq=require("../common/seq.js");var _string=require("../common/string.js");var _binary=require("./binary.js");var _bool=require("./bool.js");var _float2=require("./float.js");var _int2=require("./int.js");var _omap=require("./omap.js");var _pairs=require("./pairs.js");var _set=require("./set.js");var _timestamp=require("./timestamp.js");var schema=exports.schema=[_map.map,_seq.seq,_string.string,_null.nullTag,_bool.trueTag,_bool.falseTag,_int2.intBin,_int2.intOct,_int2["int"],_int2.intHex,_float2.floatNaN,_float2.floatExp,_float2["float"],_binary.binary,_omap.omap,_pairs.pairs,_set.set,_timestamp.intTime,_timestamp.floatTime,_timestamp.timestamp]},{"../common/map.js":267,"../common/null.js":268,"../common/seq.js":269,"../common/string.js":270,"./binary.js":277,"./bool.js":278,"./float.js":279,"./int.js":280,"./omap.js":281,"./pairs.js":282,"./set.js":284,"./timestamp.js":285}],284:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.set=exports.YAMLSet=void 0;var _identity=require("../../nodes/identity.js");var _Pair=require("../../nodes/Pair.js");var _YAMLMap2=require("../../nodes/YAMLMap.js");function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t)}:p}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value}},_get.apply(null,arguments)}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}var YAMLSet=exports.YAMLSet=function(_YAMLMap){function YAMLSet(schema){var _this;_classCallCheck(this,YAMLSet);_this=_callSuper(this,YAMLSet,[schema]);_this.tag=YAMLSet.tag;return _this}_inherits(YAMLSet,_YAMLMap);return _createClass(YAMLSet,[{key:"add",value:function add(key){var pair;if((0,_identity.isPair)(key))pair=key;else if(key&&_typeof(key)==="object"&&"key"in key&&"value"in key&&key.value===null)pair=new _Pair.Pair(key.key,null);else pair=new _Pair.Pair(key,null);var prev=(0,_YAMLMap2.findPair)(this.items,pair.key);if(!prev)this.items.push(pair)}},{key:"get",value:function get(key,keepPair){var pair=(0,_YAMLMap2.findPair)(this.items,key);return!keepPair&&(0,_identity.isPair)(pair)?(0,_identity.isScalar)(pair.key)?pair.key.value:pair.key:pair}},{key:"set",value:function set(key,value){if(typeof value!=="boolean")throw new Error("Expected boolean value for set(key, value) in a YAML set, not ".concat(_typeof(value)));var prev=(0,_YAMLMap2.findPair)(this.items,key);if(prev&&!value){this.items.splice(this.items.indexOf(prev),1)}else if(!prev&&value){this.items.push(new _Pair.Pair(key))}}},{key:"toJSON",value:function toJSON(_,ctx){return _superPropGet(YAMLSet,"toJSON",this,3)([_,ctx,Set])}},{key:"toString",value:function toString(ctx,onComment,onChompKeep){if(!ctx)return JSON.stringify(this);if(this.hasAllNullValues(true))return _superPropGet(YAMLSet,"toString",this,3)([Object.assign({},ctx,{allNullValues:true}),onComment,onChompKeep]);else throw new Error("Set items must all have null values")}}],[{key:"from",value:function from(schema,iterable,ctx){var replacer=ctx.replacer;var set=new this(schema);if(iterable&&Symbol.iterator in Object(iterable)){var _iterator=_createForOfIteratorHelper(iterable),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var value=_step.value;if(typeof replacer==="function")value=replacer.call(iterable,value,value);set.items.push((0,_Pair.createPair)(value,null,ctx))}}catch(err){_iterator.e(err)}finally{_iterator.f()}}return set}}])}(_YAMLMap2.YAMLMap);YAMLSet.tag="tag:yaml.org,2002:set";var set=exports.set={collection:"map",identify:function identify(value){return value instanceof Set},nodeClass:YAMLSet,default:false,tag:"tag:yaml.org,2002:set",createNode:function createNode(schema,iterable,ctx){return YAMLSet.from(schema,iterable,ctx)},resolve:function resolve(map,onError){if((0,_identity.isMap)(map)){if(map.hasAllNullValues(true))return Object.assign(new YAMLSet,map);else onError("Set items must all have null values")}else onError("Expected a mapping for this tag");return map}}},{"../../nodes/Pair.js":251,"../../nodes/YAMLMap.js":253,"../../nodes/identity.js":256}],285:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.timestamp=exports.intTime=exports.floatTime=void 0;var _stringifyNumber=require("../../stringify/stringifyNumber.js");function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}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 _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function parseSexagesimal(str,asBigInt){var sign=str[0];var parts=sign==="-"||sign==="+"?str.substring(1):str;var num=function num(n){return asBigInt?BigInt(n):Number(n)};var res=parts.replace(/_/g,"").split(":").reduce((function(res,p){return res*num(60)+num(p)}),num(0));return sign==="-"?num(-1)*res:res}function stringifySexagesimal(node){var value=node.value;var num=function num(n){return n};if(typeof value==="bigint")num=function num(n){return BigInt(n)};else if(isNaN(value)||!isFinite(value))return(0,_stringifyNumber.stringifyNumber)(node);var sign="";if(value<0){sign="-";value*=num(-1)}var _60=num(60);var parts=[value%_60];if(value<60){parts.unshift(0)}else{value=(value-parts[0])/_60;parts.unshift(value%_60);if(value>=60){value=(value-parts[0])/_60;parts.unshift(value)}}return sign+parts.map((function(n){return String(n).padStart(2,"0")})).join(":").replace(/000000\d*$/,"")}var intTime=exports.intTime={identify:function identify(value){return typeof value==="bigint"||Number.isInteger(value)},default:true,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:function resolve(str,_onError,_ref){var intAsBigInt=_ref.intAsBigInt;return parseSexagesimal(str,intAsBigInt)},stringify:stringifySexagesimal};var floatTime=exports.floatTime={identify:function identify(value){return typeof value==="number"},default:true,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:function resolve(str){return parseSexagesimal(str,false)},stringify:stringifySexagesimal};var timestamp=exports.timestamp={identify:function identify(value){return value instanceof Date},default:true,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})"+"(?:"+"(?:t|T|[ \\t]+)"+"([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)"+"(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?"+")?$"),resolve:function resolve(str){var match=str.match(timestamp.test);if(!match)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");var _match$map=match.map(Number),_match$map2=_slicedToArray(_match$map,7),year=_match$map2[1],month=_match$map2[2],day=_match$map2[3],hour=_match$map2[4],minute=_match$map2[5],second=_match$map2[6];var millisec=match[7]?Number((match[7]+"00").substr(1,3)):0;var date=Date.UTC(year,month-1,day,hour||0,minute||0,second||0,millisec);var tz=match[8];if(tz&&tz!=="Z"){var d=parseSexagesimal(tz,false);if(Math.abs(d)<30)d*=60;date-=6e4*d}return new Date(date)},stringify:function stringify(_ref2){var value=_ref2.value;return value.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")}}},{"../../stringify/stringifyNumber.js":291}],286:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.FOLD_QUOTED=exports.FOLD_FLOW=exports.FOLD_BLOCK=void 0;exports.foldFlowLines=foldFlowLines;var FOLD_FLOW=exports.FOLD_FLOW="flow";var FOLD_BLOCK=exports.FOLD_BLOCK="block";var FOLD_QUOTED=exports.FOLD_QUOTED="quoted";function foldFlowLines(text,indent){var mode=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"flow";var _ref=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{},indentAtStart=_ref.indentAtStart,_ref$lineWidth=_ref.lineWidth,lineWidth=_ref$lineWidth===void 0?80:_ref$lineWidth,_ref$minContentWidth=_ref.minContentWidth,minContentWidth=_ref$minContentWidth===void 0?20:_ref$minContentWidth,onFold=_ref.onFold,onOverflow=_ref.onOverflow;if(!lineWidth||lineWidth<0)return text;if(lineWidth<minContentWidth)minContentWidth=0;var endStep=Math.max(1+minContentWidth,1+lineWidth-indent.length);if(text.length<=endStep)return text;var folds=[];var escapedFolds={};var end=lineWidth-indent.length;if(typeof indentAtStart==="number"){if(indentAtStart>lineWidth-Math.max(2,minContentWidth))folds.push(0);else end=lineWidth-indentAtStart}var split=undefined;var prev=undefined;var overflow=false;var i=-1;var escStart=-1;var escEnd=-1;if(mode===FOLD_BLOCK){i=consumeMoreIndentedLines(text,i,indent.length);if(i!==-1)end=i+endStep}for(var ch;ch=text[i+=1];){if(mode===FOLD_QUOTED&&ch==="\\"){escStart=i;switch(text[i+1]){case"x":i+=3;break;case"u":i+=5;break;case"U":i+=9;break;default:i+=1}escEnd=i}if(ch==="\n"){if(mode===FOLD_BLOCK)i=consumeMoreIndentedLines(text,i,indent.length);end=i+indent.length+endStep;split=undefined}else{if(ch===" "&&prev&&prev!==" "&&prev!=="\n"&&prev!=="\t"){var next=text[i+1];if(next&&next!==" "&&next!=="\n"&&next!=="\t")split=i}if(i>=end){if(split){folds.push(split);end=split+endStep;split=undefined}else if(mode===FOLD_QUOTED){while(prev===" "||prev==="\t"){prev=ch;ch=text[i+=1];overflow=true}var j=i>escEnd+1?i-2:escStart-1;if(escapedFolds[j])return text;folds.push(j);escapedFolds[j]=true;end=j+endStep;split=undefined}else{overflow=true}}}prev=ch}if(overflow&&onOverflow)onOverflow();if(folds.length===0)return text;if(onFold)onFold();var res=text.slice(0,folds[0]);for(var _i=0;_i<folds.length;++_i){var fold=folds[_i];var _end=folds[_i+1]||text.length;if(fold===0)res="\n".concat(indent).concat(text.slice(0,_end));else{if(mode===FOLD_QUOTED&&escapedFolds[fold])res+="".concat(text[fold],"\\");res+="\n".concat(indent).concat(text.slice(fold+1,_end))}}return res}function consumeMoreIndentedLines(text,i,indent){var end=i;var start=i+1;var ch=text[start];while(ch===" "||ch==="\t"){if(i<start+indent){ch=text[++i]}else{do{ch=text[++i]}while(ch&&ch!=="\n");end=i;start=i+1;ch=text[start]}}return end}},{}],287:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.createStringifyContext=createStringifyContext;exports.stringify=stringify;var _anchors=require("../doc/anchors.js");var _identity=require("../nodes/identity.js");var _stringifyComment=require("./stringifyComment.js");var _stringifyString=require("./stringifyString.js");function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function createStringifyContext(doc,options){var opt=Object.assign({blockQuote:true,commentString:_stringifyComment.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:false,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:true,indentSeq:true,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:false,singleQuote:null,trueStr:"true",verifyAliasOrder:true},doc.schema.toStringOptions,options);var inFlow;switch(opt.collectionStyle){case"block":inFlow=false;break;case"flow":inFlow=true;break;default:inFlow=null}return{anchors:new Set,doc:doc,flowCollectionPadding:opt.flowCollectionPadding?" ":"",indent:"",indentStep:typeof opt.indent==="number"?" ".repeat(opt.indent):" ",inFlow:inFlow,options:opt}}function getTagObject(tags,item){if(item.tag){var _match$find;var match=tags.filter((function(t){return t.tag===item.tag}));if(match.length>0)return(_match$find=match.find((function(t){return t.format===item.format})))!==null&&_match$find!==void 0?_match$find:match[0]}var tagObj=undefined;var obj;if((0,_identity.isScalar)(item)){var _match$find2;obj=item.value;var _match=tags.filter((function(t){var _t$identify;return(_t$identify=t.identify)===null||_t$identify===void 0?void 0:_t$identify.call(t,obj)}));tagObj=(_match$find2=_match.find((function(t){return t.format===item.format})))!==null&&_match$find2!==void 0?_match$find2:_match.find((function(t){return!t.format}))}else{obj=item;tagObj=tags.find((function(t){return t.nodeClass&&obj instanceof t.nodeClass}))}if(!tagObj){var _obj$constructor$name,_obj;var name=(_obj$constructor$name=(_obj=obj)===null||_obj===void 0||(_obj=_obj.constructor)===null||_obj===void 0?void 0:_obj.name)!==null&&_obj$constructor$name!==void 0?_obj$constructor$name:_typeof(obj);throw new Error("Tag not resolved for ".concat(name," value"))}return tagObj}function stringifyProps(node,tagObj,_ref){var anchors=_ref.anchors,doc=_ref.doc;if(!doc.directives)return"";var props=[];var anchor=((0,_identity.isScalar)(node)||(0,_identity.isCollection)(node))&&node.anchor;if(anchor&&(0,_anchors.anchorIsValid)(anchor)){anchors.add(anchor);props.push("&".concat(anchor))}var tag=node.tag?node.tag:tagObj["default"]?null:tagObj.tag;if(tag)props.push(doc.directives.tagString(tag));return props.join(" ")}function stringify(item,ctx,onComment,onChompKeep){var _ctx$indentAtStart;if((0,_identity.isPair)(item))return item.toString(ctx,onComment,onChompKeep);if((0,_identity.isAlias)(item)){var _ctx$resolvedAliases;if(ctx.doc.directives)return item.toString(ctx);if((_ctx$resolvedAliases=ctx.resolvedAliases)!==null&&_ctx$resolvedAliases!==void 0&&_ctx$resolvedAliases.has(item)){throw new TypeError("Cannot stringify circular structure without alias nodes")}else{if(ctx.resolvedAliases)ctx.resolvedAliases.add(item);else ctx.resolvedAliases=new Set([item]);item=item.resolve(ctx.doc)}}var tagObj=undefined;var node=(0,_identity.isNode)(item)?item:ctx.doc.createNode(item,{onTagObj:function onTagObj(o){return tagObj=o}});if(!tagObj)tagObj=getTagObject(ctx.doc.schema.tags,node);var props=stringifyProps(node,tagObj,ctx);if(props.length>0)ctx.indentAtStart=((_ctx$indentAtStart=ctx.indentAtStart)!==null&&_ctx$indentAtStart!==void 0?_ctx$indentAtStart:0)+props.length+1;var str=typeof tagObj.stringify==="function"?tagObj.stringify(node,ctx,onComment,onChompKeep):(0,_identity.isScalar)(node)?(0,_stringifyString.stringifyString)(node,ctx,onComment,onChompKeep):node.toString(ctx,onComment,onChompKeep);if(!props)return str;return(0,_identity.isScalar)(node)||str[0]==="{"||str[0]==="["?"".concat(props," ").concat(str):"".concat(props,"\n").concat(ctx.indent).concat(str)}},{"../doc/anchors.js":241,"../nodes/identity.js":256,"./stringifyComment.js":289,"./stringifyString.js":293}],288:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.stringifyCollection=stringifyCollection;var _identity=require("../nodes/identity.js");var _stringify=require("./stringify.js");var _stringifyComment=require("./stringifyComment.js");function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function stringifyCollection(collection,ctx,options){var _ctx$inFlow;var flow=(_ctx$inFlow=ctx.inFlow)!==null&&_ctx$inFlow!==void 0?_ctx$inFlow:collection.flow;var stringify=flow?stringifyFlowCollection:stringifyBlockCollection;return stringify(collection,ctx,options)}function stringifyBlockCollection(_ref,ctx,_ref2){var comment=_ref.comment,items=_ref.items;var blockItemPrefix=_ref2.blockItemPrefix,flowChars=_ref2.flowChars,itemIndent=_ref2.itemIndent,onChompKeep=_ref2.onChompKeep,onComment=_ref2.onComment;var indent=ctx.indent,commentString=ctx.options.commentString;var itemCtx=Object.assign({},ctx,{indent:itemIndent,type:null});var chompKeep=false;var lines=[];var _loop=function _loop(){var item=items[i];var comment=null;if((0,_identity.isNode)(item)){if(!chompKeep&&item.spaceBefore)lines.push("");addCommentBefore(ctx,lines,item.commentBefore,chompKeep);if(item.comment)comment=item.comment}else if((0,_identity.isPair)(item)){var ik=(0,_identity.isNode)(item.key)?item.key:null;if(ik){if(!chompKeep&&ik.spaceBefore)lines.push("");addCommentBefore(ctx,lines,ik.commentBefore,chompKeep)}}chompKeep=false;var str=(0,_stringify.stringify)(item,itemCtx,(function(){return comment=null}),(function(){return chompKeep=true}));if(comment)str+=(0,_stringifyComment.lineComment)(str,itemIndent,commentString(comment));if(chompKeep&&comment)chompKeep=false;lines.push(blockItemPrefix+str)};for(var i=0;i<items.length;++i){_loop()}var str;if(lines.length===0){str=flowChars.start+flowChars.end}else{str=lines[0];for(var _i=1;_i<lines.length;++_i){var line=lines[_i];str+=line?"\n".concat(indent).concat(line):"\n"}}if(comment){str+="\n"+(0,_stringifyComment.indentComment)(commentString(comment),indent);if(onComment)onComment()}else if(chompKeep&&onChompKeep)onChompKeep();return str}function stringifyFlowCollection(_ref3,ctx,_ref4){var items=_ref3.items;var flowChars=_ref4.flowChars,itemIndent=_ref4.itemIndent;var indent=ctx.indent,indentStep=ctx.indentStep,fcPadding=ctx.flowCollectionPadding,commentString=ctx.options.commentString;itemIndent+=indentStep;var itemCtx=Object.assign({},ctx,{indent:itemIndent,inFlow:true,type:null});var reqNewline=false;var linesAtValue=0;var lines=[];var _loop2=function _loop2(){var item=items[i];var comment=null;if((0,_identity.isNode)(item)){if(item.spaceBefore)lines.push("");addCommentBefore(ctx,lines,item.commentBefore,false);if(item.comment)comment=item.comment}else if((0,_identity.isPair)(item)){var ik=(0,_identity.isNode)(item.key)?item.key:null;if(ik){if(ik.spaceBefore)lines.push("");addCommentBefore(ctx,lines,ik.commentBefore,false);if(ik.comment)reqNewline=true}var iv=(0,_identity.isNode)(item.value)?item.value:null;if(iv){if(iv.comment)comment=iv.comment;if(iv.commentBefore)reqNewline=true}else if(item.value==null&&ik!==null&&ik!==void 0&&ik.comment){comment=ik.comment}}if(comment)reqNewline=true;var str=(0,_stringify.stringify)(item,itemCtx,(function(){return comment=null}));if(i<items.length-1)str+=",";if(comment)str+=(0,_stringifyComment.lineComment)(str,itemIndent,commentString(comment));if(!reqNewline&&(lines.length>linesAtValue||str.includes("\n")))reqNewline=true;lines.push(str);linesAtValue=lines.length};for(var i=0;i<items.length;++i){_loop2()}var start=flowChars.start,end=flowChars.end;if(lines.length===0){return start+end}else{if(!reqNewline){var len=lines.reduce((function(sum,line){return sum+line.length+2}),2);reqNewline=ctx.options.lineWidth>0&&len>ctx.options.lineWidth}if(reqNewline){var str=start;var _iterator=_createForOfIteratorHelper(lines),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var line=_step.value;str+=line?"\n".concat(indentStep).concat(indent).concat(line):"\n"}}catch(err){_iterator.e(err)}finally{_iterator.f()}return"".concat(str,"\n").concat(indent).concat(end)}else{return"".concat(start).concat(fcPadding).concat(lines.join(" ")).concat(fcPadding).concat(end)}}}function addCommentBefore(_ref5,lines,comment,chompKeep){var indent=_ref5.indent,commentString=_ref5.options.commentString;if(comment&&chompKeep)comment=comment.replace(/^\n+/,"");if(comment){var ic=(0,_stringifyComment.indentComment)(commentString(comment),indent);lines.push(ic.trimStart())}}},{"../nodes/identity.js":256,"./stringify.js":287,"./stringifyComment.js":289}],289:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.indentComment=indentComment;exports.stringifyComment=exports.lineComment=void 0;var stringifyComment=exports.stringifyComment=function stringifyComment(str){return str.replace(/^(?!$)(?: $)?/gm,"#")};function indentComment(comment,indent){if(/^\n+$/.test(comment))return comment.substring(1);return indent?comment.replace(/^(?! *$)/gm,indent):comment}var lineComment=exports.lineComment=function lineComment(str,indent,comment){return str.endsWith("\n")?indentComment(comment,indent):comment.includes("\n")?"\n"+indentComment(comment,indent):(str.endsWith(" ")?"":" ")+comment}},{}],290:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.stringifyDocument=stringifyDocument;var _identity=require("../nodes/identity.js");var _stringify=require("./stringify.js");var _stringifyComment=require("./stringifyComment.js");function stringifyDocument(doc,options){var _doc$directives;var lines=[];var hasDirectives=options.directives===true;if(options.directives!==false&&doc.directives){var dir=doc.directives.toString(doc);if(dir){lines.push(dir);hasDirectives=true}else if(doc.directives.docStart)hasDirectives=true}if(hasDirectives)lines.push("---");var ctx=(0,_stringify.createStringifyContext)(doc,options);var commentString=ctx.options.commentString;if(doc.commentBefore){if(lines.length!==1)lines.unshift("");var cs=commentString(doc.commentBefore);lines.unshift((0,_stringifyComment.indentComment)(cs,""))}var chompKeep=false;var contentComment=null;if(doc.contents){if((0,_identity.isNode)(doc.contents)){if(doc.contents.spaceBefore&&hasDirectives)lines.push("");if(doc.contents.commentBefore){var _cs=commentString(doc.contents.commentBefore);lines.push((0,_stringifyComment.indentComment)(_cs,""))}ctx.forceBlockIndent=!!doc.comment;contentComment=doc.contents.comment}var onChompKeep=contentComment?undefined:function(){return chompKeep=true};var body=(0,_stringify.stringify)(doc.contents,ctx,(function(){return contentComment=null}),onChompKeep);if(contentComment)body+=(0,_stringifyComment.lineComment)(body,"",commentString(contentComment));if((body[0]==="|"||body[0]===">")&&lines[lines.length-1]==="---"){lines[lines.length-1]="--- ".concat(body)}else lines.push(body)}else{lines.push((0,_stringify.stringify)(doc.contents,ctx))}if((_doc$directives=doc.directives)!==null&&_doc$directives!==void 0&&_doc$directives.docEnd){if(doc.comment){var _cs2=commentString(doc.comment);if(_cs2.includes("\n")){lines.push("...");lines.push((0,_stringifyComment.indentComment)(_cs2,""))}else{lines.push("... ".concat(_cs2))}}else{lines.push("...")}}else{var dc=doc.comment;if(dc&&chompKeep)dc=dc.replace(/^\n+/,"");if(dc){if((!chompKeep||contentComment)&&lines[lines.length-1]!=="")lines.push("");lines.push((0,_stringifyComment.indentComment)(commentString(dc),""))}}return lines.join("\n")+"\n"}},{"../nodes/identity.js":256,"./stringify.js":287,"./stringifyComment.js":289}],291:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.stringifyNumber=stringifyNumber;function stringifyNumber(_ref){var format=_ref.format,minFractionDigits=_ref.minFractionDigits,tag=_ref.tag,value=_ref.value;if(typeof value==="bigint")return String(value);var num=typeof value==="number"?value:Number(value);if(!isFinite(num))return isNaN(num)?".nan":num<0?"-.inf":".inf";var n=JSON.stringify(value);if(!format&&minFractionDigits&&(!tag||tag==="tag:yaml.org,2002:float")&&/^\d/.test(n)){var i=n.indexOf(".");if(i<0){i=n.length;n+="."}var d=minFractionDigits-(n.length-i-1);while(d-- >0)n+="0"}return n}},{}],292:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.stringifyPair=stringifyPair;var _identity=require("../nodes/identity.js");var _Scalar=require("../nodes/Scalar.js");var _stringify=require("./stringify.js");var _stringifyComment=require("./stringifyComment.js");function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function stringifyPair(_ref,ctx,onComment,onChompKeep){var key=_ref.key,value=_ref.value;var _ctx=ctx,allNullValues=_ctx.allNullValues,doc=_ctx.doc,indent=_ctx.indent,indentStep=_ctx.indentStep,_ctx$options=_ctx.options,commentString=_ctx$options.commentString,indentSeq=_ctx$options.indentSeq,simpleKeys=_ctx$options.simpleKeys;var keyComment=(0,_identity.isNode)(key)&&key.comment||null;if(simpleKeys){if(keyComment){throw new Error("With simple keys, key nodes cannot have comments")}if((0,_identity.isCollection)(key)||!(0,_identity.isNode)(key)&&_typeof(key)==="object"){var msg="With simple keys, collection cannot be used as a key value";throw new Error(msg)}}var explicitKey=!simpleKeys&&(!key||keyComment&&value==null&&!ctx.inFlow||(0,_identity.isCollection)(key)||((0,_identity.isScalar)(key)?key.type===_Scalar.Scalar.BLOCK_FOLDED||key.type===_Scalar.Scalar.BLOCK_LITERAL:_typeof(key)==="object"));ctx=Object.assign({},ctx,{allNullValues:false,implicitKey:!explicitKey&&(simpleKeys||!allNullValues),indent:indent+indentStep});var keyCommentDone=false;var chompKeep=false;var str=(0,_stringify.stringify)(key,ctx,(function(){return keyCommentDone=true}),(function(){return chompKeep=true}));if(!explicitKey&&!ctx.inFlow&&str.length>1024){if(simpleKeys)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");explicitKey=true}if(ctx.inFlow){if(allNullValues||value==null){if(keyCommentDone&&onComment)onComment();return str===""?"?":explicitKey?"? ".concat(str):str}}else if(allNullValues&&!simpleKeys||value==null&&explicitKey){str="? ".concat(str);if(keyComment&&!keyCommentDone){str+=(0,_stringifyComment.lineComment)(str,ctx.indent,commentString(keyComment))}else if(chompKeep&&onChompKeep)onChompKeep();return str}if(keyCommentDone)keyComment=null;if(explicitKey){if(keyComment)str+=(0,_stringifyComment.lineComment)(str,ctx.indent,commentString(keyComment));str="? ".concat(str,"\n").concat(indent,":")}else{str="".concat(str,":");if(keyComment)str+=(0,_stringifyComment.lineComment)(str,ctx.indent,commentString(keyComment))}var vsb,vcb,valueComment;if((0,_identity.isNode)(value)){vsb=!!value.spaceBefore;vcb=value.commentBefore;valueComment=value.comment}else{vsb=false;vcb=null;valueComment=null;if(value&&_typeof(value)==="object")value=doc.createNode(value)}ctx.implicitKey=false;if(!explicitKey&&!keyComment&&(0,_identity.isScalar)(value))ctx.indentAtStart=str.length+1;chompKeep=false;if(!indentSeq&&indentStep.length>=2&&!ctx.inFlow&&!explicitKey&&(0,_identity.isSeq)(value)&&!value.flow&&!value.tag&&!value.anchor){ctx.indent=ctx.indent.substring(2)}var valueCommentDone=false;var valueStr=(0,_stringify.stringify)(value,ctx,(function(){return valueCommentDone=true}),(function(){return chompKeep=true}));var ws=" ";if(keyComment||vsb||vcb){ws=vsb?"\n":"";if(vcb){var cs=commentString(vcb);ws+="\n".concat((0,_stringifyComment.indentComment)(cs,ctx.indent))}if(valueStr===""&&!ctx.inFlow){if(ws==="\n")ws="\n\n"}else{ws+="\n".concat(ctx.indent)}}else if(!explicitKey&&(0,_identity.isCollection)(value)){var _ref2,_ctx$inFlow;var vs0=valueStr[0];var nl0=valueStr.indexOf("\n");var hasNewline=nl0!==-1;var flow=(_ref2=(_ctx$inFlow=ctx.inFlow)!==null&&_ctx$inFlow!==void 0?_ctx$inFlow:value.flow)!==null&&_ref2!==void 0?_ref2:value.items.length===0;if(hasNewline||!flow){var hasPropsLine=false;if(hasNewline&&(vs0==="&"||vs0==="!")){var sp0=valueStr.indexOf(" ");if(vs0==="&"&&sp0!==-1&&sp0<nl0&&valueStr[sp0+1]==="!"){sp0=valueStr.indexOf(" ",sp0+1)}if(sp0===-1||nl0<sp0)hasPropsLine=true}if(!hasPropsLine)ws="\n".concat(ctx.indent)}}else if(valueStr===""||valueStr[0]==="\n"){ws=""}str+=ws+valueStr;if(ctx.inFlow){if(valueCommentDone&&onComment)onComment()}else if(valueComment&&!valueCommentDone){str+=(0,_stringifyComment.lineComment)(str,ctx.indent,commentString(valueComment))}else if(chompKeep&&onChompKeep){onChompKeep()}return str}},{"../nodes/Scalar.js":252,"../nodes/identity.js":256,"./stringify.js":287,"./stringifyComment.js":289}],293:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.stringifyString=stringifyString;var _Scalar=require("../nodes/Scalar.js");var _foldFlowLines=require("./foldFlowLines.js");var getFoldOptions=function getFoldOptions(ctx,isBlock){return{indentAtStart:isBlock?ctx.indent.length:ctx.indentAtStart,lineWidth:ctx.options.lineWidth,minContentWidth:ctx.options.minContentWidth}};var containsDocumentMarker=function containsDocumentMarker(str){return/^(%|---|\.\.\.)/m.test(str)};function lineLengthOverLimit(str,lineWidth,indentLength){if(!lineWidth||lineWidth<0)return false;var limit=lineWidth-indentLength;var strLen=str.length;if(strLen<=limit)return false;for(var i=0,start=0;i<strLen;++i){if(str[i]==="\n"){if(i-start>limit)return true;start=i+1;if(strLen-start<=limit)return false}}return true}function doubleQuotedString(value,ctx){var json=JSON.stringify(value);if(ctx.options.doubleQuotedAsJSON)return json;var implicitKey=ctx.implicitKey;var minMultiLineLength=ctx.options.doubleQuotedMinMultiLineLength;var indent=ctx.indent||(containsDocumentMarker(value)?" ":"");var str="";var start=0;for(var i=0,ch=json[i];ch;ch=json[++i]){if(ch===" "&&json[i+1]==="\\"&&json[i+2]==="n"){str+=json.slice(start,i)+"\\ ";i+=1;start=i;ch="\\"}if(ch==="\\")switch(json[i+1]){case"u":{str+=json.slice(start,i);var code=json.substr(i+2,4);switch(code){case"0000":str+="\\0";break;case"0007":str+="\\a";break;case"000b":str+="\\v";break;case"001b":str+="\\e";break;case"0085":str+="\\N";break;case"00a0":str+="\\_";break;case"2028":str+="\\L";break;case"2029":str+="\\P";break;default:if(code.substr(0,2)==="00")str+="\\x"+code.substr(2);else str+=json.substr(i,6)}i+=5;start=i+1}break;case"n":if(implicitKey||json[i+2]==='"'||json.length<minMultiLineLength){i+=1}else{str+=json.slice(start,i)+"\n\n";while(json[i+2]==="\\"&&json[i+3]==="n"&&json[i+4]!=='"'){str+="\n";i+=2}str+=indent;if(json[i+2]===" ")str+="\\";i+=1;start=i+1}break;default:i+=1}}str=start?str+json.slice(start):json;return implicitKey?str:(0,_foldFlowLines.foldFlowLines)(str,indent,_foldFlowLines.FOLD_QUOTED,getFoldOptions(ctx,false))}function singleQuotedString(value,ctx){if(ctx.options.singleQuote===false||ctx.implicitKey&&value.includes("\n")||/[ \t]\n|\n[ \t]/.test(value))return doubleQuotedString(value,ctx);var indent=ctx.indent||(containsDocumentMarker(value)?" ":"");var res="'"+value.replace(/'/g,"''").replace(/\n+/g,"$&\n".concat(indent))+"'";return ctx.implicitKey?res:(0,_foldFlowLines.foldFlowLines)(res,indent,_foldFlowLines.FOLD_FLOW,getFoldOptions(ctx,false))}function quotedString(value,ctx){var singleQuote=ctx.options.singleQuote;var qs;if(singleQuote===false)qs=doubleQuotedString;else{var hasDouble=value.includes('"');var hasSingle=value.includes("'");if(hasDouble&&!hasSingle)qs=singleQuotedString;else if(hasSingle&&!hasDouble)qs=doubleQuotedString;else qs=singleQuote?singleQuotedString:doubleQuotedString}return qs(value,ctx)}var blockEndNewlines;try{blockEndNewlines=new RegExp("(^|(?<!\n))\n+(?!\n|$)","g")}catch(_unused){blockEndNewlines=/\n+(?!\n|$)/g}function blockString(_ref,ctx,onComment,onChompKeep){var comment=_ref.comment,type=_ref.type,value=_ref.value;var _ctx$options=ctx.options,blockQuote=_ctx$options.blockQuote,commentString=_ctx$options.commentString,lineWidth=_ctx$options.lineWidth;if(!blockQuote||/\n[\t ]+$/.test(value)||/^\s*$/.test(value)){return quotedString(value,ctx)}var indent=ctx.indent||(ctx.forceBlockIndent||containsDocumentMarker(value)?" ":"");var literal=blockQuote==="literal"?true:blockQuote==="folded"||type===_Scalar.Scalar.BLOCK_FOLDED?false:type===_Scalar.Scalar.BLOCK_LITERAL?true:!lineLengthOverLimit(value,lineWidth,indent.length);if(!value)return literal?"|\n":">\n";var chomp;var endStart;for(endStart=value.length;endStart>0;--endStart){var ch=value[endStart-1];if(ch!=="\n"&&ch!=="\t"&&ch!==" ")break}var end=value.substring(endStart);var endNlPos=end.indexOf("\n");if(endNlPos===-1){chomp="-"}else if(value===end||endNlPos!==end.length-1){chomp="+";if(onChompKeep)onChompKeep()}else{chomp=""}if(end){value=value.slice(0,-end.length);if(end[end.length-1]==="\n")end=end.slice(0,-1);end=end.replace(blockEndNewlines,"$&".concat(indent))}var startWithSpace=false;var startEnd;var startNlPos=-1;for(startEnd=0;startEnd<value.length;++startEnd){var _ch=value[startEnd];if(_ch===" ")startWithSpace=true;else if(_ch==="\n")startNlPos=startEnd;else break}var start=value.substring(0,startNlPos<startEnd?startNlPos+1:startEnd);if(start){value=value.substring(start.length);start=start.replace(/\n+/g,"$&".concat(indent))}var indentSize=indent?"2":"1";var header=(literal?"|":">")+(startWithSpace?indentSize:"")+chomp;if(comment){header+=" "+commentString(comment.replace(/ ?[\r\n]+/g," "));if(onComment)onComment()}if(literal){value=value.replace(/\n+/g,"$&".concat(indent));return"".concat(header,"\n").concat(indent).concat(start).concat(value).concat(end)}value=value.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,"$&".concat(indent));var body=(0,_foldFlowLines.foldFlowLines)("".concat(start).concat(value).concat(end),indent,_foldFlowLines.FOLD_BLOCK,getFoldOptions(ctx,true));return"".concat(header,"\n").concat(indent).concat(body)}function plainString(item,ctx,onComment,onChompKeep){var type=item.type,value=item.value;var actualString=ctx.actualString,implicitKey=ctx.implicitKey,indent=ctx.indent,indentStep=ctx.indentStep,inFlow=ctx.inFlow;if(implicitKey&&value.includes("\n")||inFlow&&/[[\]{},]/.test(value)){return quotedString(value,ctx)}if(!value||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)){return implicitKey||inFlow||!value.includes("\n")?quotedString(value,ctx):blockString(item,ctx,onComment,onChompKeep)}if(!implicitKey&&!inFlow&&type!==_Scalar.Scalar.PLAIN&&value.includes("\n")){return blockString(item,ctx,onComment,onChompKeep)}if(containsDocumentMarker(value)){if(indent===""){ctx.forceBlockIndent=true;return blockString(item,ctx,onComment,onChompKeep)}else if(implicitKey&&indent===indentStep){return quotedString(value,ctx)}}var str=value.replace(/\n+/g,"$&\n".concat(indent));if(actualString){var test=function test(tag){var _tag$test;return tag["default"]&&tag.tag!=="tag:yaml.org,2002:str"&&((_tag$test=tag.test)===null||_tag$test===void 0?void 0:_tag$test.test(str))};var _ctx$doc$schema=ctx.doc.schema,compat=_ctx$doc$schema.compat,tags=_ctx$doc$schema.tags;if(tags.some(test)||compat!==null&&compat!==void 0&&compat.some(test))return quotedString(value,ctx)}return implicitKey?str:(0,_foldFlowLines.foldFlowLines)(str,indent,_foldFlowLines.FOLD_FLOW,getFoldOptions(ctx,false))}function stringifyString(item,ctx,onComment,onChompKeep){var implicitKey=ctx.implicitKey,inFlow=ctx.inFlow;var ss=typeof item.value==="string"?item:Object.assign({},item,{value:String(item.value)});var type=item.type;if(type!==_Scalar.Scalar.QUOTE_DOUBLE){if(/(?:[\0-\x08\x0B-\x1F\x7F-\x9F]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/.test(ss.value))type=_Scalar.Scalar.QUOTE_DOUBLE}var _stringify=function _stringify(_type){switch(_type){case _Scalar.Scalar.BLOCK_FOLDED:case _Scalar.Scalar.BLOCK_LITERAL:return implicitKey||inFlow?quotedString(ss.value,ctx):blockString(ss,ctx,onComment,onChompKeep);case _Scalar.Scalar.QUOTE_DOUBLE:return doubleQuotedString(ss.value,ctx);case _Scalar.Scalar.QUOTE_SINGLE:return singleQuotedString(ss.value,ctx);case _Scalar.Scalar.PLAIN:return plainString(ss,ctx,onComment,onChompKeep);default:return null}};var res=_stringify(type);if(res===null){var _ctx$options2=ctx.options,defaultKeyType=_ctx$options2.defaultKeyType,defaultStringType=_ctx$options2.defaultStringType;var t=implicitKey&&defaultKeyType||defaultStringType;res=_stringify(t);if(res===null)throw new Error("Unsupported default string type ".concat(t))}return res}},{"../nodes/Scalar.js":252,"./foldFlowLines.js":286}],294:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.visit=visit;exports.visitAsync=visitAsync;var _identity=require("./nodes/identity.js");function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{define({},"")}catch(t){define=function define(t,e,r){return t[e]=r}}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,(function(){return this}));var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach((function(e){define(t,e,(function(t){return this._invoke(e,t)}))}))}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){invoke("next",t,i,a)}),(function(t){invoke("throw",t,i,a)})):e.resolve(h).then((function(t){u.value=t,i(u)}),(function(t){return invoke("throw",t,i,a)}))}a(c.arg)}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e((function(e,r){invoke(t,n,e,r)}))}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done}}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg)}}}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next};return i.next=i}}throw new TypeError(_typeof(e)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t},e.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,(function(){return this})),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,(function(){return this})),define(g,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next}return next.done=!0,next}},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y}},catch:function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value}catch(n){return void e(n)}i.done?t(u):Promise.resolve(u).then(r,o)}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise((function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n)}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n)}_next(void 0)}))}}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}var BREAK=Symbol("break visit");var SKIP=Symbol("skip children");var REMOVE=Symbol("remove node");function visit(node,visitor){var visitor_=initVisitor(visitor);if((0,_identity.isDocument)(node)){var cd=visit_(null,node.contents,visitor_,Object.freeze([node]));if(cd===REMOVE)node.contents=null}else visit_(null,node,visitor_,Object.freeze([]))}visit.BREAK=BREAK;visit.SKIP=SKIP;visit.REMOVE=REMOVE;function visit_(key,node,visitor,path){var ctrl=callVisitor(key,node,visitor,path);if((0,_identity.isNode)(ctrl)||(0,_identity.isPair)(ctrl)){replaceNode(key,path,ctrl);return visit_(key,ctrl,visitor,path)}if(_typeof(ctrl)!=="symbol"){if((0,_identity.isCollection)(node)){path=Object.freeze(path.concat(node));for(var i=0;i<node.items.length;++i){var ci=visit_(i,node.items[i],visitor,path);if(typeof ci==="number")i=ci-1;else if(ci===BREAK)return BREAK;else if(ci===REMOVE){node.items.splice(i,1);i-=1}}}else if((0,_identity.isPair)(node)){path=Object.freeze(path.concat(node));var ck=visit_("key",node.key,visitor,path);if(ck===BREAK)return BREAK;else if(ck===REMOVE)node.key=null;var cv=visit_("value",node.value,visitor,path);if(cv===BREAK)return BREAK;else if(cv===REMOVE)node.value=null}}return ctrl}function visitAsync(_x,_x2){return _visitAsync.apply(this,arguments)}function _visitAsync(){_visitAsync=_asyncToGenerator(_regeneratorRuntime().mark((function _callee(node,visitor){var visitor_,cd;return _regeneratorRuntime().wrap((function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:visitor_=initVisitor(visitor);if(!(0,_identity.isDocument)(node)){_context.next=8;break}_context.next=4;return visitAsync_(null,node.contents,visitor_,Object.freeze([node]));case 4:cd=_context.sent;if(cd===REMOVE)node.contents=null;_context.next=10;break;case 8:_context.next=10;return visitAsync_(null,node,visitor_,Object.freeze([]));case 10:case"end":return _context.stop()}}),_callee)})));return _visitAsync.apply(this,arguments)}visitAsync.BREAK=BREAK;visitAsync.SKIP=SKIP;visitAsync.REMOVE=REMOVE;function visitAsync_(_x3,_x4,_x5,_x6){return _visitAsync_.apply(this,arguments)}function _visitAsync_(){_visitAsync_=_asyncToGenerator(_regeneratorRuntime().mark((function _callee2(key,node,visitor,path){var ctrl,i,ci,ck,cv;return _regeneratorRuntime().wrap((function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return callVisitor(key,node,visitor,path);case 2:ctrl=_context2.sent;if(!((0,_identity.isNode)(ctrl)||(0,_identity.isPair)(ctrl))){_context2.next=6;break}replaceNode(key,path,ctrl);return _context2.abrupt("return",visitAsync_(key,ctrl,visitor,path));case 6:if(!(_typeof(ctrl)!=="symbol")){_context2.next=46;break}if(!(0,_identity.isCollection)(node)){_context2.next=28;break}path=Object.freeze(path.concat(node));i=0;case 10:if(!(i<node.items.length)){_context2.next=26;break}_context2.next=13;return visitAsync_(i,node.items[i],visitor,path);case 13:ci=_context2.sent;if(!(typeof ci==="number")){_context2.next=18;break}i=ci-1;_context2.next=23;break;case 18:if(!(ci===BREAK)){_context2.next=22;break}return _context2.abrupt("return",BREAK);case 22:if(ci===REMOVE){node.items.splice(i,1);i-=1}case 23:++i;_context2.next=10;break;case 26:_context2.next=46;break;case 28:if(!(0,_identity.isPair)(node)){_context2.next=46;break}path=Object.freeze(path.concat(node));_context2.next=32;return visitAsync_("key",node.key,visitor,path);case 32:ck=_context2.sent;if(!(ck===BREAK)){_context2.next=37;break}return _context2.abrupt("return",BREAK);case 37:if(ck===REMOVE)node.key=null;case 38:_context2.next=40;return visitAsync_("value",node.value,visitor,path);case 40:cv=_context2.sent;if(!(cv===BREAK)){_context2.next=45;break}return _context2.abrupt("return",BREAK);case 45:if(cv===REMOVE)node.value=null;case 46:return _context2.abrupt("return",ctrl);case 47:case"end":return _context2.stop()}}),_callee2)})));return _visitAsync_.apply(this,arguments)}function initVisitor(visitor){if(_typeof(visitor)==="object"&&(visitor.Collection||visitor.Node||visitor.Value)){return Object.assign({Alias:visitor.Node,Map:visitor.Node,Scalar:visitor.Node,Seq:visitor.Node},visitor.Value&&{Map:visitor.Value,Scalar:visitor.Value,Seq:visitor.Value},visitor.Collection&&{Map:visitor.Collection,Seq:visitor.Collection},visitor)}return visitor}function callVisitor(key,node,visitor,path){var _visitor$Map,_visitor$Seq,_visitor$Pair,_visitor$Scalar,_visitor$Alias;if(typeof visitor==="function")return visitor(key,node,path);if((0,_identity.isMap)(node))return(_visitor$Map=visitor.Map)===null||_visitor$Map===void 0?void 0:_visitor$Map.call(visitor,key,node,path);if((0,_identity.isSeq)(node))return(_visitor$Seq=visitor.Seq)===null||_visitor$Seq===void 0?void 0:_visitor$Seq.call(visitor,key,node,path);if((0,_identity.isPair)(node))return(_visitor$Pair=visitor.Pair)===null||_visitor$Pair===void 0?void 0:_visitor$Pair.call(visitor,key,node,path);if((0,_identity.isScalar)(node))return(_visitor$Scalar=visitor.Scalar)===null||_visitor$Scalar===void 0?void 0:_visitor$Scalar.call(visitor,key,node,path);if((0,_identity.isAlias)(node))return(_visitor$Alias=visitor.Alias)===null||_visitor$Alias===void 0?void 0:_visitor$Alias.call(visitor,key,node,path);return undefined}function replaceNode(key,path,node){var parent=path[path.length-1];if((0,_identity.isCollection)(parent)){parent.items[key]=node}else if((0,_identity.isPair)(parent)){if(key==="key")parent.key=node;else parent.value=node}else if((0,_identity.isDocument)(parent)){parent.contents=node}else{var pt=(0,_identity.isAlias)(parent)?"alias":"scalar";throw new Error("Cannot replace node with ".concat(pt," parent"))}}},{"./nodes/identity.js":256}],295:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}Object.defineProperty(exports,"__esModule",{value:true});var _exportNames={};exports["default"]=void 0;var YAML=_interopRequireWildcard(require("./dist/index.js"));Object.keys(YAML).forEach((function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===YAML[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return YAML[key]}})}));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=_typeof(e)&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u]}return n["default"]=e,t&&t.set(e,n),n}var _default=exports["default"]=YAML},{"./dist/index.js":246}],296:[function(require,module,exports){(function(Buffer){(function(){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _events=_interopRequireDefault(require("events"));var _mqtt=_interopRequireDefault(require("mqtt"));var _loglevel=_interopRequireDefault(require("loglevel"));var _tinycache=_interopRequireDefault(require("tinycache"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}var _require=require("uuid"),uuidv4=_require.v4;var BaseClient=exports["default"]=function(_events$EventEmitter){function BaseClient(config){var _this;_classCallCheck(this,BaseClient);_this=_callSuper(this,BaseClient);_this.log=_loglevel["default"];_this.log.setDefaultLevel(config.options.logLevel);_this.config=config;_this.reconnectLog=0;_this.mqtt=null;_this.lostConnectionLog=new _tinycache["default"];return _this}_inherits(BaseClient,_events$EventEmitter);return _createClass(BaseClient,[{key:"isConnected",value:function isConnected(){if(this.mqtt==null){return false}return this.mqtt.connected}},{key:"connect",value:function connect(){var _this2=this;if(this.mqtt!=null){this.log.info("[BaseClient:connect] Reconnecting to "+this.config.getMqttHost()+" as "+this.config.getClientId());this.mqtt.reconnect();return}this.log.info("[BaseClient:connect] Connecting to "+this.config.getMqttHost()+" as "+this.config.getClientId());this.mqtt=_mqtt["default"].connect(this.config.getMqttHost(),this.config.getMqttConfig());this.mqtt.on("connect",(function(){_this2.log.info("[BaseClient:onConnect] MQTT client is connected.");_this2.emit("connect");var connectionLostCount=_this2.lostConnectionLog.size;var reconnectPeriod=1e3;if(connectionLostCount>=9){reconnectPeriod=2e4;_this2.log.warn("[BaseClient:onOffline] This client is likely suffering from clientId stealing (where two connections try to use the same client Id).");_this2.emit("error","Exceeded 9 connection losses in a 5 minute period. Check for clientId conflict with another connection.")}else if(connectionLostCount>=6){reconnectPeriod=5e3}else if(connectionLostCount>=3){reconnectPeriod=2e3}if(reconnectPeriod!=_this2.mqtt.options.reconnectPeriod){_this2.log.info("[BaseClient:onOffline] Client has lost connection "+connectionLostCount+" times during the last 5 minutes, reconnect delay adjusted to "+reconnectPeriod+" ms");_this2.mqtt.options.reconnectPeriod=reconnectPeriod}}));this.mqtt.on("reconnect",(function(){_this2.log.info("[BaseClient:onReconnect] MQTT client is reconnecting.");_this2.emit("reconnect")}));this.mqtt.on("close",(function(){_this2.log.info("[BaseClient:onClose] MQTT client connection was closed.");_this2.emit("close")}));this.mqtt.on("offline",(function(){var newId=uuidv4();_this2.log.info("[BaseClient:onOffline] MQTT client connection is offline. ["+newId+"]");_this2.emit("offline");_this2.lostConnectionLog.put(newId,"1",3e5);var connectionLostCount=_this2.lostConnectionLog.size;_this2.log.info("[BaseClient:onOffline] Connection losses in the last 5 minutes: "+connectionLostCount)}));this.mqtt.on("error",(function(error){_this2.log.error("[BaseClient:onError] "+error);var errorMsg=""+error;if(errorMsg.indexOf("Not authorized")>-1){_this2.log.error("[BaseClient:onError] One or more configuration parameters are wrong. Modify the configuration before trying to reconnect.");_this2.mqtt.end(false,(function(){_this2.log.info("[BaseClient:onError] Closed the MQTT connection due to client misconfiguration")}))}_this2.emit("error",error)}))}},{key:"disconnect",value:function disconnect(){var _this3=this;if(this.mqtt==null){this.log.info("[BaseClient:disconnect] Client was never connected");return}this.mqtt.end(false,(function(){_this3.log.info("[BaseClient:disconnect] Closed the MQTT connection due to disconnect() call")}))}},{key:"_subscribe",value:function _subscribe(topic,QoS,callback){if(this.mqtt==null){this.emit("error","[BaseClient:_subscribe] MQTT Client is not initialized - call connect() first");return}if(!this.mqtt.connected){this.emit("error","[BaseClient:_subscribe] MQTT Client is not connected - call connect() first");return}QoS=QoS||0;callback=callback||function(err,granted){if(err==null){for(var index in granted){var grant=granted[index];this.log.debug("[BaseClient:_subscribe] Subscribed to "+grant.topic+" at QoS "+grant.qos)}}else{this.log.error("[BaseClient:_subscribe] "+err);this.emit("error",err)}}.bind(this);this.log.debug("[BaseClient:_subscribe] Subscribing to topic "+topic+" with QoS "+QoS);this.mqtt.subscribe(topic,{qos:parseInt(QoS)},callback)}},{key:"_unsubscribe",value:function _unsubscribe(topic,callback){if(this.mqtt==null){this.emit("error","[BaseClient:_unsubscribe] MQTT Client is not initialized - call connect() first");return}if(!this.mqtt.connected){this.emit("error","[BaseClient:_unsubscribe] MQTT Client is not connected - call connect() first");return}callback=callback||function(err){if(err==null){this.log.debug("[BaseClient:_unsubscribe] Unsubscribed from: "+topic)}else{this.log.error("[BaseClient:_unsubscribe] "+err);this.emit("error",err)}}.bind(this);this.log.debug("[BaseClient:_unsubscribe] Unsubscribe: "+topic);this.mqtt.unsubscribe(topic,callback)}},{key:"_publish",value:function _publish(topic,msg,QoS,callback){QoS=QoS||0;if(this.mqtt==null){this.emit("error","[BaseClient:_unsubscribe] MQTT Client is not initialized - call connect() first");return}if(!this.mqtt.connected){this.emit("error","[BaseClient:_unsubscribe] MQTT Client is not connected - call connect() first");return}if((_typeof(msg)==="object"||typeof msg==="boolean"||typeof msg==="number")&&!Buffer.isBuffer(msg)){msg=JSON.stringify(msg)}this.log.debug("[BaseClient:_publish] Publish: "+topic+", "+msg+", QoS : "+QoS);this.mqtt.publish(topic,msg,{qos:parseInt(QoS)},callback)}}])}(_events["default"].EventEmitter)}).call(this)}).call(this,{isBuffer:require("../node_modules/is-buffer/index.js")})},{"../node_modules/is-buffer/index.js":113,events:97,loglevel:138,mqtt:148,tinycache:193,uuid:204}],297:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var BaseConfig=exports["default"]=function(){function BaseConfig(identity,auth,options){_classCallCheck(this,BaseConfig);this.identity=identity;this.auth=auth;this.options=options;if(this.options!=null&&"mqtt"in this.options){if("port"in this.options.mqtt&&this.options.mqtt.port!=null){if(isNaN(this.options.mqtt.port)){throw new Error("Optional setting options.mqtt.port must be a number if provided")}}if("cleanStart"in this.options.mqtt&&typeof this.options.mqtt.cleanStart!="boolean"){throw new Error("Optional setting options.mqtt.cleanStart must be a boolean if provided")}}if(this.options==null){this.options={}}if(!("domain"in this.options)||this.options.domain==null){this.options.domain="internetofthings.ibmcloud.com"}if(!("logLevel"in this.options)||this.options.logLevel==null){this.options.logLevel="info"}if(!("mqtt"in this.options)){this.options.mqtt={}}if(!("port"in this.options.mqtt)||this.options.mqtt.port==null){this.options.mqtt.port=8883}if(!("transport"in this.options.mqtt)||this.options.mqtt.transport==null){this.options.mqtt.transport="tcp"}if(!("cleanStart"in this.options.mqtt)){this.options.mqtt.cleanStart=true}if(!("sessionExpiry"in this.options.mqtt)){this.options.mqtt.sessionExpiry=3600}if(!("keepAlive"in this.options.mqtt)){this.options.mqtt.keepAlive=60}if(!("caFile"in this.options.mqtt)){this.options.mqtt.caFile=null}}return _createClass(BaseConfig,[{key:"getOrgId",value:function getOrgId(){throw new Error("Sub class must implement getOrgId()")}},{key:"isQuickstart",value:function isQuickstart(){return this.getOrgId()=="quickstart"}},{key:"getClientId",value:function getClientId(){throw new Error("Sub class must implement getClientId()")}},{key:"getMqttUsername",value:function getMqttUsername(){throw new Error("Sub class must implement getMqttUsername()")}},{key:"getMqttPassword",value:function getMqttPassword(){throw new Error("Sub class must implement getMqttPassowrd()")}},{key:"getMqttConfig",value:function getMqttConfig(){var mqttConfig={clientId:this.getClientId(),keepalive:this.options.mqtt.keepAlive,connectTimeout:90*1e3,reconnectPeriod:1e3,queueQoSZero:true,resubscribe:true,clean:this.options.mqtt.cleanStart,username:this.getMqttUsername(),password:this.getMqttPassword(),rejectUnauthorized:true};return mqttConfig}},{key:"getMqttHost",value:function getMqttHost(){var server=this.getOrgId()+".messaging."+this.options.domain+":"+this.options.mqtt.port;if(this.options.mqtt.port==80||this.options.mqtt.port==1883){if(this.options.mqtt.transport=="tcp"){return"tcp://"+server}if(this.options.mqtt.transport=="websockets"){return"ws://"+server}}if(this.options.mqtt.port==443||this.options.mqtt.port==8883){if(this.options.mqtt.transport=="tcp"){return"ssl://"+server}if(this.options.mqtt.transport=="websockets"){return"wss://"+server}}return"ssl://"+server}}],[{key:"parseEnvVars",value:function parseEnvVars(){throw new Error("Sub class must implement parseEnvVars()")}},{key:"parseConfigFile",value:function parseConfigFile(){throw new Error("Sub class must implement parseConfigFile()")}}])}()},{}],298:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _axios=_interopRequireDefault(require("axios"));var _bluebird=_interopRequireDefault(require("bluebird"));var _btoa=_interopRequireDefault(require("btoa"));var _formData=_interopRequireDefault(require("form-data"));var _loglevel=_interopRequireDefault(require("loglevel"));var _util=require("../util");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach((function(r){_defineProperty(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var ApiClient=exports["default"]=function(){function ApiClient(config){_classCallCheck(this,ApiClient);this.log=_loglevel["default"];this.log.setDefaultLevel(config.options.logLevel);this.config=config;this.useLtpa=this.config.auth&&this.config.auth.useLtpa;this.log.debug("[ApiClient:constructor] ApiClient initialized for "+this.config.getApiBaseUri())}return _createClass(ApiClient,[{key:"parseSortSpec",value:function parseSortSpec(sortSpec){return sortSpec?sortSpec.map((function(s){var e=Object.entries(s)[0];return"".concat(e[1]?"-":"").concat(e[0])})).join(","):undefined}},{key:"callApi",value:function callApi(method,expectedHttpCode,expectJsonContent,paths,body,params){var _this=this;return new _bluebird["default"]((function(resolve,reject){var uri=_this.config.getApiBaseUri();if(Array.isArray(paths)){for(var i=0,l=paths.length;i<l;i++){uri+="/"+paths[i]}}var xhrConfig={url:uri,method:method,headers:{"Content-Type":"application/json"},validateStatus:function validateStatus(status){if(Array.isArray(expectedHttpCode)){return expectedHttpCode.includes(status)}else{return status===expectedHttpCode}}};if(_this.useLtpa){xhrConfig.withCredentials=true}else{xhrConfig.headers["Authorization"]="Basic "+(0,_btoa["default"])(_this.config.auth.key+":"+_this.config.auth.token)}if(body){xhrConfig.data=body}if(params){xhrConfig.params=params}if(_this.config.getAdditionalHeaders()){xhrConfig.headers=_objectSpread(_objectSpread({},xhrConfig.headers),_this.config.getAdditionalHeaders())}function transformResponse(response){if(expectJsonContent&&!(_typeof(response.data)==="object")){try{resolve(JSON.parse(response.data))}catch(e){reject(e)}}else{resolve(response.data)}}_this.log.debug("[ApiClient:transformResponse] "+xhrConfig);(0,_axios["default"])(xhrConfig).then(transformResponse,reject)}))}},{key:"getOrganizationDetails",value:function getOrganizationDetails(){this.log.debug("[ApiClient] getOrganizationDetails()");return this.callApi("GET",200,true,null,null)}},{key:"getServiceStatus",value:function getServiceStatus(){this.log.debug("[ApiClient] getServiceStatus()");return this.callApi("GET",200,true,["service-status"],null)}},{key:"getActiveDevices",value:function getActiveDevices(start,end,detail){this.log.debug("[ApiClient] getActiveDevices("+start+", "+end+")");detail=detail|false;var params={start:start,end:end,detail:detail};return this.callApi("GET",200,true,["usage","active-devices"],null,params)}},{key:"getHistoricalDataUsage",value:function getHistoricalDataUsage(start,end,detail){this.log.debug("[ApiClient] getHistoricalDataUsage("+start+", "+end+")");detail=detail|false;var params={start:start,end:end,detail:detail};return this.callApi("GET",200,true,["usage","historical-data"],null,params)}},{key:"getDataUsage",value:function getDataUsage(start,end,detail){this.log.debug("[ApiClient] getDataUsage("+start+", "+end+")");detail=detail|false;var params={start:start,end:end,detail:detail};return this.callApi("GET",200,true,["usage","data-traffic"],null,params)}},{key:"getConnectionStates",value:function getConnectionStates(){this.log.debug("[ApiClient] getConnectionStates() - client connectivity");return this.callApi("GET",200,true,["clientconnectionstates"],null)}},{key:"getConnectionState",value:function getConnectionState(id){this.log.debug("[ApiClient] getConnectionState() - client connectivity");return this.callApi("GET",200,true,["clientconnectionstates/"+id],null)}},{key:"getConnectedClientsConnectionStates",value:function getConnectedClientsConnectionStates(){this.log.debug("[ApiClient] getConnectedClientsConnectionStates() - client connectivity");return this.callApi("GET",200,true,["clientconnectionstates?connectionStatus=connected"],null)}},{key:"getRecentConnectionStates",value:function getRecentConnectionStates(date){this.log.debug("[ApiClient] getRecentConnectionStates() - client connectivity");return this.callApi("GET",200,true,["clientconnectionstates?connectedAfter="+date],null)}},{key:"getCustomConnectionState",value:function getCustomConnectionState(query){this.log.debug("[ApiClient] getCustomConnectionStates() - client connectivity");return this.callApi("GET",200,true,["clientconnectionstates"+query],null)}},{key:"getAllDevices",value:function getAllDevices(params){this.log.debug("[ApiClient] getAllDevices() - BULK");return this.callApi("GET",200,true,["bulk","devices"],null,params)}},{key:"getGroupIdsForDevice",value:function getGroupIdsForDevice(deviceId){this.log.debug("[ApiClient] getGroupIdsForDevice("+deviceId+")");return this.callApi("GET",200,true,["authorization","devices",deviceId],null)}},{key:"updateDeviceRoles",value:function updateDeviceRoles(deviceId,roles){this.log.debug("[ApiClient] updateDeviceRoles("+deviceId+","+roles+")");return this.callApi("PUT",200,false,["authorization","devices",deviceId,"roles"],roles)}},{key:"getAllDevicesInGroup",value:function getAllDevicesInGroup(groupId){this.log.debug("[ApiClient] getAllDevicesInGropu("+groupId+")");return this.callApi("GET",200,true,["bulk","devices",groupId],null)}},{key:"addDevicesToGroup",value:function addDevicesToGroup(groupId,deviceList){this.log.debug("[ApiClient] addDevicesToGroup("+groupId+","+deviceList+")");return this.callApi("PUT",200,false,["bulk","devices",groupId,"add"],deviceList)}},{key:"removeDevicesFromGroup",value:function removeDevicesFromGroup(groupId,deviceList){this.log.debug("[ApiClient] removeDevicesFromGroup("+groupId+","+deviceList+")");return this.callApi("PUT",200,false,["bulk","devices",groupId,"remove"],deviceList)}},{key:"getAllGroups",value:function getAllGroups(){this.log.debug("[ApiClient] getAllGroups()");return this.callApi("GET",200,true,["groups"],null)}},{key:"getAllDeviceIdsInGroup",value:function getAllDeviceIdsInGroup(groupId){this.log.debug("[ApiClient] getAllDeviceIdsInGroup("+groupId+")");return this.callApi("GET",200,true,["bulk","devices",groupId,"ids"],null)}},{key:"getGroup",value:function getGroup(groupId){this.log.debug("[ApiClient] getGroup("+groupId+")");return this.callApi("GET",200,true,["groups",groupId],null)}},{key:"createGroup",value:function createGroup(groupInfo){this.log.debug("[ApiClient] createGroup()");return this.callApi("POST",201,true,["groups"],groupInfo)}},{key:"deleteGroup",value:function deleteGroup(groupId){this.log.debug("[ApiClient] deleteGroup("+groupId+")");return this.callApi("DELETE",200,false,["groups",groupId],null)}},{key:"getAllDeviceAccessControlProperties",value:function getAllDeviceAccessControlProperties(){this.log.debug("[ApiClient] getAllDeviceAccessControlProperties()");return this.callApi("GET",200,true,["authorization","devices"],null)}},{key:"getDeviceAccessControlProperties",value:function getDeviceAccessControlProperties(deviceId){this.log.debug("[ApiClient] getDeviceAccessControlProperties("+deviceId+")");return this.callApi("GET",200,true,["authorization","devices",deviceId,"roles"],null)}},{key:"updateDeviceAccessControlProperties",value:function updateDeviceAccessControlProperties(deviceId,deviceProps){this.log.debug("[ApiClient] updateDeviceAccessControlProperties("+deviceId+")");return this.callApi("PUT",200,true,["authorization","devices",deviceId],deviceProps)}},{key:"updateDeviceAccessControlPropertiesWithRoles",value:function updateDeviceAccessControlPropertiesWithRoles(deviceId,devicePropsWithRoles){this.log.debug("[ApiClient] updateDeviceAccessControlPropertiesWithRoles("+deviceId+","+devicePropsWithRoles+")");return this.callApi("PUT",200,true,["authorization","devices",deviceId,"withroles"],devicePropsWithRoles)}},{key:"updateGatewayRoles",value:function updateGatewayRoles(gatewayId,roles){this.log.debug("[ApiClient] updateGatewayRoles("+gatewayId+","+roles+")");return this.callApi("PUT",200,false,["authorization","devices",gatewayId,"roles"],roles)}},{key:"getGroups",value:function getGroups(groupId){this.log.debug("[ApiClient] getGroups("+groupId+")");return this.callApi("GET",200,true,["groups",groupId],null)}},{key:"callFormDataApi",value:function callFormDataApi(method,expectedHttpCode,expectJsonContent,paths,body,params){var _this2=this;return new _bluebird["default"]((function(resolve,reject){var uri=_this2.config.getApiBaseUri();if(Array.isArray(paths)){for(var i=0,l=paths.length;i<l;i++){uri+="/"+paths[i]}}var xhrConfig={url:uri,method:method,headers:{"Content-Type":"multipart/form-data"}};if(_this2.useLtpa){xhrConfig.withCredentials=true}else{xhrConfig.headers["Authorization"]="Basic "+(0,_btoa["default"])(_this2.apiKey+":"+_this2.apiToken)}if(body){xhrConfig.data=body;if((0,_util.isBrowser)()){xhrConfig.transformRequest=[function(data){var formData=new _formData["default"];if(xhrConfig.method=="POST"){if(data.schemaFile){var blob=new Blob([data.schemaFile],{type:"application/json"});var schemaFileName="".concat(data.name||"schema",".json");formData.append("schemaFile",blob,schemaFileName)}if(data.name){formData.append("name",data.name)}if(data.schemaType){formData.append("schemaType","json-schema")}if(data.description){formData.append("description",data.description)}}else if(xhrConfig.method=="PUT"){if(data.schemaFile){var blob=new Blob([data.schemaFile],{type:"application/json",name:data.name});var schemaFileName="".concat(data.name||"schema",".json");formData.append("schemaFile",blob,schemaFileName)}}return formData}]}}if(params){xhrConfig.params=params}if(_this2.config.getAdditionalHeaders()){xhrConfig.headers=_objectSpread(_objectSpread({},xhrConfig.headers),_this2.config.getAdditionalHeaders())}function transformResponse(response){if(response.status===expectedHttpCode){if(expectJsonContent&&!(_typeof(response.data)==="object")){try{resolve(JSON.parse(response.data))}catch(e){reject(e)}}else{resolve(response.data)}}else{reject(new Error(method+" "+uri+": Expected HTTP "+expectedHttpCode+" from server but got HTTP "+response.status+". Error Body: "+JSON.stringify(response.data)))}}_this2.log.debug("[ApiClient:transformResponse] "+xhrConfig);if((0,_util.isBrowser)()){(0,_axios["default"])(xhrConfig).then(transformResponse,reject)}else{var formData=null;var config={url:uri,method:method,headers:{"Content-Type":"multipart/form-data"},auth:{user:_this2.apiKey,pass:_this2.apiToken},formData:{},rejectUnauthorized:false};if(xhrConfig.method=="POST"){formData={schemaFile:{value:body.schemaFile,options:{contentType:"application/json",filename:body.name}},schemaType:"json-schema",name:body.name};config.formData=formData}else if(xhrConfig.method=="PUT"){formData={schemaFile:{value:body.schemaFile,options:{contentType:"application/json",filename:body.name}}};config.formData=formData}request(config,(function optionalCallback(err,response,body){if(response.statusCode===expectedHttpCode){if(expectJsonContent&&!(_typeof(response.data)==="object")){try{resolve(JSON.parse(body))}catch(e){reject(e)}}else{resolve(body)}}else{reject(new Error(method+" "+uri+": Expected HTTP "+expectedHttpCode+" from server but got HTTP "+response.statusCode+". Error Body: "+err))}}))}}))}},{key:"invalidOperation",value:function invalidOperation(message){return new _bluebird["default"]((function(resolve,reject){resolve(message)}))}}])}()},{"../util":312,axios:2,bluebird:70,btoa:73,"form-data":99,loglevel:138}],299:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}Object.defineProperty(exports,"__esModule",{value:true});exports.handleError=exports["default"]=exports.WiotpError=exports.ServiceNotFound=exports.InvalidServiceCredentials=exports.DestinationAlreadyExists=void 0;function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _wrapNativeSuper(t){var r="function"==typeof Map?new Map:void 0;return _wrapNativeSuper=function _wrapNativeSuper(t){if(null===t||!_isNativeFunction(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,Wrapper)}function Wrapper(){return _construct(t,arguments,_getPrototypeOf(this).constructor)}return Wrapper.prototype=Object.create(t.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(Wrapper,t)},_wrapNativeSuper(t)}function _construct(t,e,r){if(_isNativeReflectConstruct())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,e);var p=new(t.bind.apply(t,o));return r&&_setPrototypeOf(p,r.prototype),p}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _isNativeFunction(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(n){return"function"==typeof t}}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}var WiotpError=exports.WiotpError=function(_Error){function WiotpError(message,cause){var _this;_classCallCheck(this,WiotpError);_this=_callSuper(this,WiotpError,[message]);_this.cause=cause;_this.name=_this.constructor.name;return _this}_inherits(WiotpError,_Error);return _createClass(WiotpError)}(_wrapNativeSuper(Error));var InvalidServiceCredentials=exports.InvalidServiceCredentials=function(_WiotpError){function InvalidServiceCredentials(){_classCallCheck(this,InvalidServiceCredentials);return _callSuper(this,InvalidServiceCredentials,arguments)}_inherits(InvalidServiceCredentials,_WiotpError);return _createClass(InvalidServiceCredentials)}(WiotpError);var DestinationAlreadyExists=exports.DestinationAlreadyExists=function(_WiotpError2){function DestinationAlreadyExists(){_classCallCheck(this,DestinationAlreadyExists);return _callSuper(this,DestinationAlreadyExists,arguments)}_inherits(DestinationAlreadyExists,_WiotpError2);return _createClass(DestinationAlreadyExists)}(WiotpError);var ServiceNotFound=exports.ServiceNotFound=function(_WiotpError3){function ServiceNotFound(){_classCallCheck(this,ServiceNotFound);return _callSuper(this,ServiceNotFound,arguments)}_inherits(ServiceNotFound,_WiotpError3);return _createClass(ServiceNotFound)}(WiotpError);var handleError=exports.handleError=function handleError(err,errorMappings){if(err&&err.response&&err.response.data&&err.response.data.exception&&err.response.data.exception.id){if(errorMappings&&errorMappings[err.response.data.exception.id]){throw new errorMappings[err.response.data.exception.id](err.response.data.message,err)}else{throw new WiotpError(err.response.data.message,err)}}else{throw err}};var _default=exports["default"]={WiotpError:WiotpError,InvalidServiceCredentials:InvalidServiceCredentials,DestinationAlreadyExists:DestinationAlreadyExists,ServiceNotFound:ServiceNotFound}},{}],300:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _loglevel=_interopRequireDefault(require("loglevel"));var errors=_interopRequireWildcard(require("./ApiErrors"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=_typeof(e)&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u]}return n["default"]=e,t&&t.set(e,n),n}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var DscClient=exports["default"]=function(){function DscClient(apiClient){_classCallCheck(this,DscClient);this.log=_loglevel["default"];this.apiClient=apiClient}return _createClass(DscClient,[{key:"createService",value:function createService(service){return this.apiClient.callApi("POST",201,true,["s2s","services"],service)["catch"]((function(err){return errors.handleError(err,{CUDSS0026E:errors.InvalidServiceCredentials})}))}},{key:"createCloudantService",value:function createCloudantService(_ref){var name=_ref.name,description=_ref.description,username=_ref.username,password=_ref.password,_ref$host=_ref.host,host=_ref$host===void 0?"".concat(username,".cloudant.com"):_ref$host,_ref$port=_ref.port,port=_ref$port===void 0?443:_ref$port,_ref$url=_ref.url,url=_ref$url===void 0?"https://".concat(username,":").concat(password,"@").concat(host):_ref$url,apikey=_ref.apikey,iam_apikey_name=_ref.iam_apikey_name,iam_apikey_description=_ref.iam_apikey_description,iam_role_crn=_ref.iam_role_crn,iam_serviceid_crn=_ref.iam_serviceid_crn;return this.createService({name:name,description:description,type:"cloudant",credentials:{username:username,password:password,host:host,port:port,url:url,apikey:apikey,iam_apikey_name:iam_apikey_name,iam_apikey_description:iam_apikey_description,iam_role_crn:iam_role_crn,iam_serviceid_crn:iam_serviceid_crn}})}},{key:"createEventstreamsService",value:function createEventstreamsService(_ref2){var name=_ref2.name,description=_ref2.description,api_key=_ref2.api_key,kafka_admin_url=_ref2.kafka_admin_url,kafka_brokers_sasl=_ref2.kafka_brokers_sasl,user=_ref2.user,password=_ref2.password,apikey=_ref2.apikey,iam_apikey_name=_ref2.iam_apikey_name,iam_apikey_description=_ref2.iam_apikey_description,iam_role_crn=_ref2.iam_role_crn,iam_serviceid_crn=_ref2.iam_serviceid_crn;return this.createService({name:name,description:description,type:"eventstreams",credentials:{api_key:api_key,kafka_admin_url:kafka_admin_url,kafka_brokers_sasl:kafka_brokers_sasl,user:user,password:password,apikey:apikey,iam_apikey_name:iam_apikey_name,iam_apikey_description:iam_apikey_description,iam_role_crn:iam_role_crn,iam_serviceid_crn:iam_serviceid_crn}})}},{key:"getService",value:function getService(serviceId){return this.apiClient.callApi("GET",200,true,["s2s","services",serviceId])["catch"]((function(err){return errors.handleError(err,{CUDSS0019E:errors.ServiceNotFound})}))}},{key:"getServices",value:function getServices(serviceType){return this.apiClient.callApi("GET",200,true,["s2s","services"],null,{bindingMode:"manual",serviceType:serviceType})["catch"]((function(err){return errors.handleError(err,{})}))}},{key:"deleteService",value:function deleteService(serviceId){return this.apiClient.callApi("DELETE",204,false,["s2s","services",serviceId])["catch"]((function(err){return errors.handleError(err,{})}))}},{key:"createConnector",value:function createConnector(_ref3){var name=_ref3.name,type=_ref3.type,_ref3$description=_ref3.description,description=_ref3$description===void 0?undefined:_ref3$description,serviceId=_ref3.serviceId,_ref3$timezone=_ref3.timezone,timezone=_ref3$timezone===void 0?"UTC":_ref3$timezone,_ref3$enabled=_ref3.enabled,enabled=_ref3$enabled===void 0?true:_ref3$enabled;return this.apiClient.callApi("POST",201,true,["historianconnectors"],{name:name,description:description,type:type,serviceId:serviceId,timezone:timezone,enabled:enabled})["catch"]((function(err){return errors.handleError(err,{})}))}},{key:"updateConnector",value:function updateConnector(_ref4){var id=_ref4.id,name=_ref4.name,description=_ref4.description,serviceId=_ref4.serviceId,type=_ref4.type,enabled=_ref4.enabled,timezone=_ref4.timezone;return this.apiClient.callApi("PUT",200,true,["historianconnectors",id],{id:id,name:name,description:description,serviceId:serviceId,type:type,enabled:enabled,timezone:timezone})["catch"]((function(err){return errors.handleError(err,{})}))}},{key:"getConnectors",value:function getConnectors(_ref5){var name=_ref5.name,serviceType=_ref5.serviceType,enabled=_ref5.enabled,serviceId=_ref5.serviceId;return this.apiClient.callApi("GET",200,true,["historianconnectors"],null,{name:name?name:undefined,type:serviceType?serviceType:undefined,enabled:enabled===undefined?undefined:enabled,serviceId:serviceId?serviceId:undefined})["catch"]((function(err){return errors.handleError(err,{})}))}},{key:"deleteConnector",value:function deleteConnector(connectorId){return this.apiClient.callApi("DELETE",204,false,["historianconnectors",connectorId])["catch"]((function(err){return errors.handleError(err,{})}))}},{key:"createDestination",value:function createDestination(connectorId,destination){return this.apiClient.callApi("POST",201,true,["historianconnectors",connectorId,"destinations"],destination)["catch"]((function(err){return errors.handleError(err,{CUDDSC0103E:errors.DestinationAlreadyExists})}))}},{key:"createCloudantDestination",value:function createCloudantDestination(connectorId,_ref6){var name=_ref6.name,bucketInterval=_ref6.bucketInterval;return this.createDestination(connectorId,{name:name,type:"cloudant",configuration:{bucketInterval:bucketInterval}})}},{key:"createEventstreamsDestination",value:function createEventstreamsDestination(connectorId,_ref7){var name=_ref7.name,_ref7$partitions=_ref7.partitions,partitions=_ref7$partitions===void 0?1:_ref7$partitions;return this.createDestination(connectorId,{name:name,type:"eventstreams",configuration:{partitions:partitions}})}},{key:"getDestinations",value:function getDestinations(connectorId){var params=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{name:undefined};var name=params.name;return this.apiClient.callApi("GET",200,true,["historianconnectors",connectorId,"destinations"],null,{name:name?name:undefined})["catch"]((function(err){return errors.handleError(err,{})}))}},{key:"deleteDestination",value:function deleteDestination(connectorId,destinationName){return this.apiClient.callApi("DELETE",[200,204],false,["historianconnectors",connectorId,"destinations",destinationName])["catch"]((function(err){return errors.handleError(err,{})}))}},{key:"createForwardingRule",value:function createForwardingRule(connectorId,forwardingrule){return this.apiClient.callApi("POST",201,true,["historianconnectors",connectorId,"forwardingrules"],forwardingrule)["catch"]((function(err){return errors.handleError(err,{})}))}},{key:"createEventForwardingRule",value:function createEventForwardingRule(connectorId,_ref8){var name=_ref8.name,destinationName=_ref8.destinationName,_ref8$deviceType=_ref8.deviceType,deviceType=_ref8$deviceType===void 0?"*":_ref8$deviceType,_ref8$eventId=_ref8.eventId,eventId=_ref8$eventId===void 0?"*":_ref8$eventId;return this.createForwardingRule(connectorId,{name:name,destinationName:destinationName,type:"event",selector:{deviceType:deviceType,eventId:eventId}})}},{key:"getForwardingRules",value:function getForwardingRules(connectorId){return this.apiClient.callApi("GET",200,true,["historianconnectors",connectorId,"forwardingrules"])["catch"]((function(err){return errors.handleError(err,{})}))}},{key:"deleteForwardingRule",value:function deleteForwardingRule(connectorId,forwardingRuleId){return this.apiClient.callApi("DELETE",204,false,["historianconnectors",connectorId,"forwardingrules",forwardingRuleId])["catch"]((function(err){return errors.handleError(err,{})}))}}])}()},{"./ApiErrors":299,loglevel:138}],301:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _loglevel=_interopRequireDefault(require("loglevel"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var LecClient=exports["default"]=function(){function LecClient(apiClient){_classCallCheck(this,LecClient);this.log=_loglevel["default"];this.apiClient=apiClient;this.callApi=this.apiClient.callApi.bind(this.apiClient)}return _createClass(LecClient,[{key:"getLastEvents",value:function getLastEvents(type,id){this.log.debug("[ApiClient] getLastEvents() - event cache");return this.callApi("GET",200,true,["device","types",type,"devices",id,"events"],null)}},{key:"getLastEventsByEventType",value:function getLastEventsByEventType(type,id,eventType){this.log.debug("[ApiClient] getLastEventsByEventType() - event cache");return this.callApi("GET",200,true,["device","types",type,"devices",id,"events",eventType],null)}}])}()},{loglevel:138}],302:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _loglevel=_interopRequireDefault(require("loglevel"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var MgmtClient=exports["default"]=function(){function MgmtClient(apiClient){_classCallCheck(this,MgmtClient);this.log=_loglevel["default"];this.apiClient=apiClient;this.callApi=this.apiClient.callApi.bind(this.apiClient)}return _createClass(MgmtClient,[{key:"getAllDeviceManagementRequests",value:function getAllDeviceManagementRequests(){this.log.debug("[ApiClient] getAllDeviceManagementRequests()");return this.callApi("GET",200,true,["mgmt","requests"],null)}},{key:"initiateDeviceManagementRequest",value:function initiateDeviceManagementRequest(action,parameters,devices){this.log.debug("[ApiClient] initiateDeviceManagementRequest("+action+", "+parameters+", "+devices+")");var body={action:action,parameters:parameters,devices:devices};return this.callApi("POST",202,true,["mgmt","requests"],JSON.stringify(body))}},{key:"getDeviceManagementRequest",value:function getDeviceManagementRequest(requestId){this.log.debug("[ApiClient] getDeviceManagementRequest("+requestId+")");return this.callApi("GET",200,true,["mgmt","requests",requestId],null)}},{key:"deleteDeviceManagementRequest",value:function deleteDeviceManagementRequest(requestId){this.log.debug("[ApiClient] deleteDeviceManagementRequest("+requestId+")");return this.callApi("DELETE",204,false,["mgmt","requests",requestId],null)}},{key:"getDeviceManagementRequestStatus",value:function getDeviceManagementRequestStatus(requestId){this.log.debug("[ApiClient] getDeviceManagementRequestStatus("+requestId+")");return this.callApi("GET",200,true,["mgmt","requests",requestId,"deviceStatus"],null)}},{key:"getDeviceManagementRequestStatusByDevice",value:function getDeviceManagementRequestStatusByDevice(requestId,typeId,deviceId){this.log.debug("[ApiClient] getDeviceManagementRequestStatusByDevice("+requestId+", "+typeId+", "+deviceId+")");return this.callApi("GET",200,true,["mgmt","requests",requestId,"deviceStatus",typeId,deviceId],null)}}])}()},{loglevel:138}],303:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var RegistryClient=exports["default"]=function(){function RegistryClient(apiClient){_classCallCheck(this,RegistryClient);this.apiClient=apiClient}return _createClass(RegistryClient,[{key:"listAllDevicesOfType",value:function listAllDevicesOfType(type){this.apiClient.log.debug("[ApiClient] listAllDevicesOfType("+type+")");return this.apiClient.callApi("GET",200,true,["device","types",type,"devices"],null)}},{key:"deleteDeviceType",value:function deleteDeviceType(type){this.apiClient.log.debug("[ApiClient] deleteDeviceType("+type+")");return this.apiClient.callApi("DELETE",204,false,["device","types",type],null)}},{key:"getDeviceType",value:function getDeviceType(type){this.apiClient.log.debug("[ApiClient] getDeviceType("+type+")");return this.apiClient.callApi("GET",200,true,["device","types",type],null)}},{key:"getAllDeviceTypes",value:function getAllDeviceTypes(){this.apiClient.log.debug("[ApiClient] getAllDeviceTypes()");return this.apiClient.callApi("GET",200,true,["device","types"],null)}},{key:"updateDeviceType",value:function updateDeviceType(type,description,deviceInfo,metadata){this.apiClient.log.debug("[ApiClient] updateDeviceType("+type+", "+description+", "+deviceInfo+", "+metadata+")");var body={deviceInfo:deviceInfo,description:description,metadata:metadata};return this.apiClient.callApi("PUT",200,true,["device","types",type],JSON.stringify(body))}},{key:"registerDeviceType",value:function registerDeviceType(typeId,description,deviceInfo,metadata,classId){this.apiClient.log.debug("[ApiClient] registerDeviceType("+typeId+", "+description+", "+deviceInfo+", "+metadata+", "+classId+")");classId=classId||"Device";var body={id:typeId,classId:classId,deviceInfo:deviceInfo,description:description,metadata:metadata};return this.apiClient.callApi("POST",201,true,["device","types"],JSON.stringify(body))}},{key:"registerDevice",value:function registerDevice(type,deviceId,authToken,deviceInfo,location,metadata){this.apiClient.log.debug("[ApiClient] registerDevice("+type+", "+deviceId+", "+deviceInfo+", "+location+", "+metadata+")");var body={deviceId:deviceId,authToken:authToken,deviceInfo:deviceInfo,location:location,metadata:metadata};return this.apiClient.callApi("POST",201,true,["device","types",type,"devices"],JSON.stringify(body))}},{key:"unregisterDevice",value:function unregisterDevice(type,deviceId){this.apiClient.log.debug("[ApiClient] unregisterDevice("+type+", "+deviceId+")");return this.apiClient.callApi("DELETE",204,false,["device","types",type,"devices",deviceId],null)}},{key:"updateDevice",value:function updateDevice(type,deviceId,deviceInfo,status,metadata,extensions){this.apiClient.log.debug("[ApiClient] updateDevice("+type+", "+deviceId+", "+deviceInfo+", "+status+", "+metadata+")");var body={deviceInfo:deviceInfo,status:status,metadata:metadata,extensions:extensions};return this.apiClient.callApi("PUT",200,true,["device","types",type,"devices",deviceId],JSON.stringify(body))}},{key:"getDevice",value:function getDevice(type,deviceId){this.apiClient.log.debug("[ApiClient] getDevice("+type+", "+deviceId+")");return this.apiClient.callApi("GET",200,true,["device","types",type,"devices",deviceId],null)}},{key:"registerMultipleDevices",value:function registerMultipleDevices(arryOfDevicesToBeAdded){this.apiClient.log.debug("[ApiClient] arryOfDevicesToBeAdded() - BULK");return this.apiClient.callApi("POST",201,true,["bulk","devices","add"],JSON.stringify(arryOfDevicesToBeAdded))}},{key:"deleteMultipleDevices",value:function deleteMultipleDevices(arryOfDevicesToBeDeleted){this.apiClient.log.debug("[ApiClient] deleteMultipleDevices() - BULK");return this.apiClient.callApi("POST",201,true,["bulk","devices","remove"],JSON.stringify(arryOfDevicesToBeDeleted))}},{key:"getDeviceLocation",value:function getDeviceLocation(type,deviceId){this.apiClient.log.debug("[ApiClient] getDeviceLocation("+type+", "+deviceId+")");return this.apiClient.callApi("GET",200,true,["device","types",type,"devices",deviceId,"location"],null)}},{key:"updateDeviceLocation",value:function updateDeviceLocation(type,deviceId,location){this.apiClient.log.debug("[ApiClient] updateDeviceLocation("+type+", "+deviceId+", "+location+")");return this.apiClient.callApi("PUT",200,true,["device","types",type,"devices",deviceId,"location"],JSON.stringify(location))}},{key:"getDeviceManagementInformation",value:function getDeviceManagementInformation(type,deviceId){this.apiClient.log.debug("[ApiClient] getDeviceManagementInformation("+type+", "+deviceId+")");return this.apiClient.callApi("GET",200,true,["device","types",type,"devices",deviceId,"mgmt"],null)}},{key:"getAllDiagnosticLogs",value:function getAllDiagnosticLogs(type,deviceId){this.apiClient.log.debug("[ApiClient] getAllDiagnosticLogs("+type+", "+deviceId+")");return this.apiClient.callApi("GET",200,true,["device","types",type,"devices",deviceId,"diag","logs"],null)}},{key:"clearAllDiagnosticLogs",value:function clearAllDiagnosticLogs(type,deviceId){this.apiClient.log.debug("[ApiClient] clearAllDiagnosticLogs("+type+", "+deviceId+")");return this.apiClient.callApi("DELETE",204,false,["device","types",type,"devices",deviceId,"diag","logs"],null)}},{key:"addDeviceDiagLogs",value:function addDeviceDiagLogs(type,deviceId,log){this.apiClient.log.debug("[ApiClient] addDeviceDiagLogs("+type+", "+deviceId+", "+log+")");return this.apiClient.callApi("POST",201,false,["device","types",type,"devices",deviceId,"diag","logs"],JSON.stringify(log))}},{key:"getDiagnosticLog",value:function getDiagnosticLog(type,deviceId,logId){this.apiClient.log.debug("[ApiClient] getAllDiagnosticLogs("+type+", "+deviceId+", "+logId+")");return this.apiClient.callApi("GET",200,true,["device","types",type,"devices",deviceId,"diag","logs",logId],null)}},{key:"deleteDiagnosticLog",value:function deleteDiagnosticLog(type,deviceId,logId){this.apiClient.log.debug("[ApiClient] deleteDiagnosticLog("+type+", "+deviceId+", "+logId+")");return this.apiClient.callApi("DELETE",204,false,["device","types",type,"devices",deviceId,"diag","logs",logId],null)}},{key:"getDeviceErrorCodes",value:function getDeviceErrorCodes(type,deviceId){this.apiClient.log.debug("[ApiClient] getDeviceErrorCodes("+type+", "+deviceId+")");return this.apiClient.callApi("GET",200,true,["device","types",type,"devices",deviceId,"diag","errorCodes"],null)}},{key:"clearDeviceErrorCodes",value:function clearDeviceErrorCodes(type,deviceId){this.apiClient.log.debug("[ApiClient] clearDeviceErrorCodes("+type+", "+deviceId+")");return this.apiClient.callApi("DELETE",204,false,["device","types",type,"devices",deviceId,"diag","errorCodes"],null)}},{key:"addErrorCode",value:function addErrorCode(type,deviceId,log){this.apiClient.log.debug("[ApiClient] addErrorCode("+type+", "+deviceId+", "+log+")");return this.apiClient.callApi("POST",201,false,["device","types",type,"devices",deviceId,"diag","errorCodes"],JSON.stringify(log))}},{key:"getDeviceConnectionLogs",value:function getDeviceConnectionLogs(typeId,deviceId){this.apiClient.log.debug("[ApiClient] getDeviceConnectionLogs("+typeId+", "+deviceId+")");var params={typeId:typeId,deviceId:deviceId};return this.apiClient.callApi("GET",200,true,["logs","connection"],null,params)}}])}()},{}],304:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _loglevel=_interopRequireDefault(require("loglevel"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var RulesClient=exports["default"]=function(){function RulesClient(apiClient){_classCallCheck(this,RulesClient);this.log=_loglevel["default"];this.apiClient=apiClient;this.callApi=this.apiClient.callApi.bind(this.apiClient)}return _createClass(RulesClient,[{key:"getRulesForLogicalInterface",value:function getRulesForLogicalInterface(logicalInterfaceId){if(this.draftMode){return this.getRulesForLogicalInterface(logicalInterfaceId)}else{return this.getActiveRulesForLogicalInterface(logicalInterfaceId)}}},{key:"getDraftRulesForLogicalInterface",value:function getDraftRulesForLogicalInterface(logicalInterfaceId){return this.callApi("GET",200,true,["draft","logicalinterfaces",logicalInterfaceId,"rules"])}},{key:"getActiveRulesForLogicalInterface",value:function getActiveRulesForLogicalInterface(logicalInterfaceId){return this.callApi("GET",200,true,["logicalinterfaces",logicalInterfaceId,"rules"])}},{key:"createRule",value:function createRule(logicalInterfaceId,name,condition){var description=arguments.length>3&&arguments[3]!==undefined?arguments[3]:undefined;var notificationStrategy=arguments.length>4&&arguments[4]!==undefined?arguments[4]:RulesClient.RuleNotificationStrategy.EVERY_TIME();var body={name:name,condition:condition,notificationStrategy:notificationStrategy};if(description)body["description"]=description;var base=this.draftMode?["draft","logicalinterfaces",logicalInterfaceId,"rules"]:["logicalinterfaces",logicalInterfaceId,"rules"];return this.callApi("POST",201,true,base,JSON.stringify(body))}},{key:"updateRule",value:function updateRule(rule){var base=this.draftMode?["draft","logicalinterfaces",rule.logicalInterfaceId,"rules",rule.id]:["logicalinterfaces",rule.logicalInterfaceId,"rules",rule.id];return this.callApi("PUT",200,true,base,JSON.stringify(rule))}},{key:"deleteRule",value:function deleteRule(logicalInterfaceId,ruleId){var base=this.draftMode?["draft","logicalinterfaces",logicalInterfaceId,"rules",ruleId]:["logicalinterfaces",logicalInterfaceId,"rules",ruleId];return this.callApi("DELETE",204,false,base)}}])}();RulesClient.RuleNotificationStrategy={EVERY_TIME:function EVERY_TIME(){return{when:"every-time"}},BECOMES_TRUE:function BECOMES_TRUE(){return{when:"becomes-true"}},X_IN_Y:function X_IN_Y(count){return{when:"x-in-y",count:count}},PERSISTS:function PERSISTS(count,timePeriod){return{when:"persists",count:count,timePeriod:timePeriod}}}},{loglevel:138}],305:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _loglevel=_interopRequireDefault(require("loglevel"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var StateClient=exports["default"]=function(){function StateClient(apiClient){_classCallCheck(this,StateClient);this.log=_loglevel["default"];this.apiClient=apiClient;this.draftMode=true;this.callApi=this.apiClient.callApi.bind(this.apiClient);this.parseSortSpec=this.apiClient.parseSortSpec.bind(this.apiClient);this.callFormDataApi=this.apiClient.callFormDataApi.bind(this.apiClient);this.invalidOperation=this.apiClient.invalidOperation.bind(this.apiClient)}return _createClass(StateClient,[{key:"workWithActive",value:function workWithActive(){this.draftMode=false}},{key:"workWithDraft",value:function workWithDraft(){this.draftMode=true}},{key:"createSchema",value:function createSchema(schemaContents,name,description){var body={schemaFile:schemaContents,schemaType:"json-schema",name:name};if(description){body.description=description}var base=this.draftMode?["draft","schemas"]:["schemas"];return this.callFormDataApi("POST",201,true,base,body,null)}},{key:"getSchema",value:function getSchema(schemaId){var base=this.draftMode?["draft","schemas",schemaId]:["schemas",schemaId];return this.callApi("GET",200,true,base)}},{key:"getActiveSchema",value:function getActiveSchema(schemaId){return this.callApi("GET",200,true,["schemas",schemaId])}},{key:"getSchemas",value:function getSchemas(){var base=this.draftMode?["draft","schemas"]:["schemas"];return this.callApi("GET",200,true,base)}},{key:"getActiveSchemas",value:function getActiveSchemas(){return this.callApi("GET",200,true,["schemas"])}},{key:"updateSchema",value:function updateSchema(schemaId,name,description){var body={id:schemaId,name:name,description:description};var base=this.draftMode?["draft","schemas",schemaId]:["schemas",schemaId];return this.callApi("PUT",200,true,base,body)}},{key:"updateSchemaContent",value:function updateSchemaContent(schemaId,schemaContents,filename){var body={schemaFile:schemaContents,name:filename};var base=this.draftMode?["draft","schemas",schemaId,"content"]:["schemas",schemaId,"content"];return this.callFormDataApi("PUT",204,false,base,body,null)}},{key:"getSchemaContent",value:function getSchemaContent(schemaId){var base=this.draftMode?["draft","schemas",schemaId,"content"]:["schemas",schemaId,"content"];return this.callApi("GET",200,true,base)}},{key:"getActiveSchemaContent",value:function getActiveSchemaContent(schemaId){return this.callApi("GET",200,true,["schemas",schemaId,"content"])}},{key:"deleteSchema",value:function deleteSchema(schemaId){var base=this.draftMode?["draft","schemas",schemaId]:["schemas",schemaId];return this.callApi("DELETE",204,false,base,null)}},{key:"createEventType",value:function createEventType(name,description,schemaId){var body={name:name,description:description,schemaId:schemaId};var base=this.draftMode?["draft","event","types"]:["event","types"];return this.callApi("POST",201,true,base,JSON.stringify(body))}},{key:"getEventType",value:function getEventType(eventTypeId){var base=this.draftMode?["draft","event","types",eventTypeId]:["event","types",eventTypeId];return this.callApi("GET",200,true,base)}},{key:"getActiveEventType",value:function getActiveEventType(eventTypeId){return this.callApi("GET",200,true,["event","types",eventTypeId])}},{key:"deleteEventType",value:function deleteEventType(eventTypeId){var base=this.draftMode?["draft","event","types",eventTypeId]:["event","types",eventTypeId];return this.callApi("DELETE",204,false,base)}},{key:"updateEventType",value:function updateEventType(eventTypeId,name,description,schemaId){var body={id:eventTypeId,name:name,description:description,schemaId:schemaId};var base=this.draftMode?["draft","event","types",eventTypeId]:["event","types",eventTypeId];return this.callApi("PUT",200,true,base,body)}},{key:"getEventTypes",value:function getEventTypes(){var base=this.draftMode?["draft","event","types"]:["event","types"];return this.callApi("GET",200,true,base)}},{key:"getActiveEventTypes",value:function getActiveEventTypes(){return this.callApi("GET",200,true,["event","types"])}},{key:"createPhysicalInterface",value:function createPhysicalInterface(name,description){var body={name:name,description:description};var base=this.draftMode?["draft","physicalinterfaces"]:["physicalinterfaces"];return this.callApi("POST",201,true,base,body)}},{key:"getPhysicalInterface",value:function getPhysicalInterface(physicalInterfaceId){var base=this.draftMode?["draft","physicalinterfaces",physicalInterfaceId]:["physicalinterfaces",physicalInterfaceId];return this.callApi("GET",200,true,base)}},{key:"getActivePhysicalInterface",value:function getActivePhysicalInterface(physicalInterfaceId){return this.callApi("GET",200,true,["physicalinterfaces",physicalInterfaceId])}},{key:"deletePhysicalInterface",value:function deletePhysicalInterface(physicalInterfaceId){var base=this.draftMode?["draft","physicalinterfaces",physicalInterfaceId]:["physicalinterfaces",physicalInterfaceId];return this.callApi("DELETE",204,false,base)}},{key:"updatePhysicalInterface",value:function updatePhysicalInterface(physicalInterfaceId,name,description){var body={id:physicalInterfaceId,name:name,description:description};var base=this.draftMode?["draft","physicalinterfaces",physicalInterfaceId]:["physicalinterfaces",physicalInterfaceId];return this.callApi("PUT",200,true,base,body)}},{key:"getPhysicalInterfaces",value:function getPhysicalInterfaces(){var base=this.draftMode?["draft","physicalinterfaces"]:["physicalinterfaces"];return this.callApi("GET",200,true,base)}},{key:"getActivePhysicalInterfaces",value:function getActivePhysicalInterfaces(){return this.callApi("GET",200,true,["physicalinterfaces"])}},{key:"createPhysicalInterfaceEventMapping",value:function createPhysicalInterfaceEventMapping(physicalInterfaceId,eventId,eventTypeId){var body={eventId:eventId,eventTypeId:eventTypeId};var base=this.draftMode?["draft","physicalinterfaces",physicalInterfaceId,"events"]:["physicalinterfaces",physicalInterfaceId,"events"];return this.callApi("POST",201,true,base,body)}},{key:"getPhysicalInterfaceEventMappings",value:function getPhysicalInterfaceEventMappings(physicalInterfaceId){var base=this.draftMode?["draft","physicalinterfaces",physicalInterfaceId,"events"]:["physicalinterfaces",physicalInterfaceId,"events"];return this.callApi("GET",200,true,base)}},{key:"getActivePhysicalInterfaceEventMappings",value:function getActivePhysicalInterfaceEventMappings(physicalInterfaceId){return this.callApi("GET",200,true,["physicalinterfaces",physicalInterfaceId,"events"])}},{key:"deletePhysicalInterfaceEventMapping",value:function deletePhysicalInterfaceEventMapping(physicalInterfaceId,eventId){var base=this.draftMode?["draft","physicalinterfaces",physicalInterfaceId,"events",eventId]:["physicalinterfaces",physicalInterfaceId,"events",eventId];return this.callApi("DELETE",204,false,base)}},{key:"createLogicalInterface",value:function createLogicalInterface(name,description,schemaId,alias){var body={name:name,description:description,schemaId:schemaId};if(alias!==undefined){body.alias=alias}var base=this.draftMode?["draft","logicalinterfaces"]:["applicationinterfaces"];return this.callApi("POST",201,true,base,body)}},{key:"getLogicalInterface",value:function getLogicalInterface(logicalInterfaceId){var base=this.draftMode?["draft","logicalinterfaces",logicalInterfaceId]:["applicationinterfaces",logicalInterfaceId];return this.callApi("GET",200,true,base)}},{key:"getActiveLogicalInterface",value:function getActiveLogicalInterface(logicalInterfaceId){return this.callApi("GET",200,true,["logicalinterfaces",logicalInterfaceId])}},{key:"deleteLogicalInterface",value:function deleteLogicalInterface(logicalInterfaceId){var base=this.draftMode?["draft","logicalinterfaces",logicalInterfaceId]:["applicationinterfaces",logicalInterfaceId];return this.callApi("DELETE",204,false,base)}},{key:"updateLogicalInterface",value:function updateLogicalInterface(logicalInterfaceId,name,description,schemaId,alias){var body={id:logicalInterfaceId,name:name,description:description,schemaId:schemaId};if(alias!==undefined){body.alias=alias}var base=this.draftMode?["draft","logicalinterfaces",logicalInterfaceId]:["applicationinterfaces",logicalInterfaceId];return this.callApi("PUT",200,true,base,body)}},{key:"getLogicalInterfaces",value:function getLogicalInterfaces(bookmark,limit,sort,name){var base=this.draftMode?["draft","logicalinterfaces"]:["logicalinterfaces"];var _sort=this.parseSortSpec(sort);return this.callApi("GET",200,true,base,undefined,{_bookmark:bookmark,_limit:limit,_sort:_sort,name:name?name:undefined})}},{key:"getActiveLogicalInterfaces",value:function getActiveLogicalInterfaces(){return this.callApi("GET",200,true,["logicalinterfaces"])}},{key:"patchOperationLogicalInterface",value:function patchOperationLogicalInterface(logicalInterfaceId,operationId){var body={operation:operationId};if(this.draftMode){switch(operationId){case"validate-configuration":return this.callApi("PATCH",200,true,["draft","logicalinterfaces",logicalInterfaceId],body);case"activate-configuration":return this.callApi("PATCH",202,true,["draft","logicalinterfaces",logicalInterfaceId],body);case"deactivate-configuration":return this.callApi("PATCH",202,true,["draft","logicalinterfaces",logicalInterfaceId],body);case"list-differences":return this.callApi("PATCH",200,true,["draft","logicalinterfaces",logicalInterfaceId],body);default:return this.callApi("PATCH",200,true,["draft","logicalinterfaces",logicalInterfaceId],body)}}else{return this.invalidOperation("PATCH operation not allowed on active logical interface")}}},{key:"patchOperationActiveLogicalInterface",value:function patchOperationActiveLogicalInterface(logicalInterfaceId,operationId){var body={operation:operationId};if(this.draftMode){return this.callApi("PATCH",202,true,["logicalinterfaces",logicalInterfaceId],body)}else{return this.invalidOperation("PATCH operation 'deactivate-configuration' not allowed on logical interface")}}},{key:"patchOperationDeviceType",value:function patchOperationDeviceType(typeId,operationId){if(!operationId){return invalidOperation("PATCH operation is not allowed. Operation id is expected")}var body={operation:operationId};var base=this.draftMode?["draft","device","types",typeId]:["device","types",typeId];if(this.draftMode){switch(operationId){case"validate-configuration":return this.callApi("PATCH",200,true,base,body);break;case"activate-configuration":return this.callApi("PATCH",202,true,base,body);break;case"deactivate-configuration":return this.callApi("PATCH",202,true,base,body);break;case"list-differences":return this.callApi("PATCH",200,true,base,body);break;default:return this.invalidOperation("PATCH operation is not allowed. Invalid operation id")}}else{switch(operationId){case"validate-configuration":return this.callApi("PATCH",200,true,base,body);break;case"deploy-configuration":return this.callApi("PATCH",202,true,base,body);break;case"remove-deployed-configuration":return this.callApi("PATCH",202,true,base,body);break;case"list-differences":return this.invalidOperation("PATCH operation 'list-differences' is not allowed");break;default:return this.invalidOperation("PATCH operation is not allowed. Invalid operation id")}}}},{key:"createDeviceType",value:function createDeviceType(typeId,description,deviceInfo,metadata,classId,physicalInterfaceId){this.log.debug("[ApiClient] registerDeviceType("+typeId+", "+description+", "+deviceInfo+", "+metadata+", "+classId+", "+physicalInterfaceId+")");classId=classId||"Device";var body={id:typeId,classId:classId,deviceInfo:deviceInfo,description:description,metadata:metadata,physicalInterfaceId:physicalInterfaceId};return this.callApi("POST",201,true,["device","types"],JSON.stringify(body))}},{key:"getDeviceTypesByLogicalInterfaceId",value:function getDeviceTypesByLogicalInterfaceId(logicalInterfaceId){var bookmark=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var limit=arguments.length>2&&arguments[2]!==undefined?arguments[2]:10;if(this.draftMode){return this.callApi("GET",200,true,["draft","device","types"],null,{logicalInterfaceId:logicalInterfaceId,_bookmark:bookmark,_limit:limit})}else{return this.callApi("GET",200,true,["device","types"],null,{_bookmark:bookmark,_limit:limit})}}},{key:"createDeviceTypePhysicalInterfaceAssociation",value:function createDeviceTypePhysicalInterfaceAssociation(typeId,physicalInterfaceId){var body={id:physicalInterfaceId};if(this.draftMode){return this.callApi("POST",201,true,["draft","device","types",typeId,"physicalinterface"],JSON.stringify(body))}else{return this.callApi("PUT",200,true,["device","types",typeId],JSON.stringify({physicalInterfaceId:physicalInterfaceId}))}}},{key:"getDeviceTypePhysicalInterfaces",value:function getDeviceTypePhysicalInterfaces(typeId){if(this.draftMode){return this.callApi("GET",200,true,["draft","device","types",typeId,"physicalinterface"])}else{return this.invalidOperation("GET Device type's physical interface is not allowed")}}},{key:"getActiveDeviceTypePhysicalInterfaces",value:function getActiveDeviceTypePhysicalInterfaces(typeId){return this.callApi("GET",200,true,["device","types",typeId,"physicalinterface"])}},{key:"deleteDeviceTypePhysicalInterfaceAssociation",value:function deleteDeviceTypePhysicalInterfaceAssociation(typeId){if(this.draftMode){return this.callApi("DELETE",204,false,["draft","device","types",typeId,"physicalinterface"])}else{return this.invalidOperation("DELETE Device type's physical interface is not allowed")}}},{key:"createDeviceTypeLogicalInterfaceAssociation",value:function createDeviceTypeLogicalInterfaceAssociation(typeId,logicalInterfaceId){var body={id:logicalInterfaceId};var base=this.draftMode?["draft","device","types",typeId,"logicalinterfaces"]:["device","types",typeId,"applicationinterfaces"];return this.callApi("POST",201,true,base,body)}},{key:"getDeviceTypeLogicalInterfaces",value:function getDeviceTypeLogicalInterfaces(typeId){var base=this.draftMode?["draft","device","types",typeId,"logicalinterfaces"]:["device","types",typeId,"applicationinterfaces"];return this.callApi("GET",200,true,base)}},{key:"getActiveDeviceTypeLogicalInterfaces",value:function getActiveDeviceTypeLogicalInterfaces(typeId){return this.callApi("GET",200,true,["device","types",typeId,"logicalinterfaces"])}},{key:"createDeviceTypeLogicalInterfacePropertyMappings",value:function createDeviceTypeLogicalInterfacePropertyMappings(typeId,logicalInterfaceId,mappings,notificationStrategy){var body=null,base=null;if(this.draftMode){body={logicalInterfaceId:logicalInterfaceId,propertyMappings:mappings,notificationStrategy:"never"};if(notificationStrategy){body.notificationStrategy=notificationStrategy}base=["draft","device","types",typeId,"mappings"]}else{body={applicationInterfaceId:logicalInterfaceId,propertyMappings:mappings};base=["device","types",typeId,"mappings"]}return this.callApi("POST",201,true,base,body)}},{key:"getDeviceTypePropertyMappings",value:function getDeviceTypePropertyMappings(typeId){var base=this.draftMode?["draft","device","types",typeId,"mappings"]:["device","types",typeId,"mappings"];return this.callApi("GET",200,true,base)}},{key:"getActiveDeviceTypePropertyMappings",value:function getActiveDeviceTypePropertyMappings(typeId){return this.callApi("GET",200,true,["device","types",typeId,"mappings"])}},{key:"getDeviceTypeLogicalInterfacePropertyMappings",value:function getDeviceTypeLogicalInterfacePropertyMappings(typeId,logicalInterfaceId){var base=this.draftMode?["draft","device","types",typeId,"mappings",logicalInterfaceId]:["device","types",typeId,"mappings",logicalInterfaceId];return this.callApi("GET",200,true,base)}},{key:"getActiveDeviceTypeLogicalInterfacePropertyMappings",value:function getActiveDeviceTypeLogicalInterfacePropertyMappings(typeId,logicalInterfaceId){return this.callApi("GET",200,true,["device","types",typeId,"mappings",logicalInterfaceId])}},{key:"updateDeviceTypeLogicalInterfacePropertyMappings",value:function updateDeviceTypeLogicalInterfacePropertyMappings(typeId,logicalInterfaceId,mappings,notificationStrategy){var body=null,base=null;if(this.draftMode){body={logicalInterfaceId:logicalInterfaceId,propertyMappings:mappings,notificationStrategy:"never"};if(notificationStrategy){body.notificationStrategy=notificationStrategy}base=["draft","device","types",typeId,"mappings",logicalInterfaceId]}else{body={applicationInterfaceId:logicalInterfaceId,propertyMappings:mappings};base=["device","types",typeId,"mappings",logicalInterfaceId]}return this.callApi("PUT",200,false,base,body)}},{key:"deleteDeviceTypeLogicalInterfacePropertyMappings",value:function deleteDeviceTypeLogicalInterfacePropertyMappings(typeId,logicalInterfaceId){var base=this.draftMode?["draft","device","types",typeId,"mappings",logicalInterfaceId]:["device","types",typeId,"mappings",logicalInterfaceId];return this.callApi("DELETE",204,false,base)}},{key:"deleteDeviceTypeLogicalInterfaceAssociation",value:function deleteDeviceTypeLogicalInterfaceAssociation(typeId,logicalInterfaceId){var base=this.draftMode?["draft","device","types",typeId,"logicalinterfaces",logicalInterfaceId]:["device","types",typeId,"applicationinterfaces",logicalInterfaceId];return this.callApi("DELETE",204,false,base)}},{key:"patchOperationActiveDeviceType",value:function patchOperationActiveDeviceType(typeId,operationId){var body={operation:operationId};if(this.draftMode){return this.callApi("PATCH",202,true,["device","types",typeId],body)}else{return this.invalidOperation("PATCH operation 'deactivate-configuration' is not allowed")}}},{key:"getDeviceTypeDeployedConfiguration",value:function getDeviceTypeDeployedConfiguration(typeId){if(this.draftMode){return this.invalidOperation("GET deployed configuration is not allowed")}else{return this.callApi("GET",200,true,["device","types",typeId,"deployedconfiguration"])}}},{key:"getDeviceState",value:function getDeviceState(typeId,deviceId,logicalInterfaceId){return this.callApi("GET",200,true,["device","types",typeId,"devices",deviceId,"state",logicalInterfaceId])}},{key:"createSchemaAndEventType",value:function createSchemaAndEventType(schemaContents,schemaFileName,eventTypeName,eventDescription){var _this=this;var body={schemaFile:schemaContents,schemaType:"json-schema",name:schemaFileName};var createSchema=new Promise((function(resolve,reject){var base=_this.draftMode?["draft","schemas"]:["schemas"];_this.callFormDataApi("POST",201,true,base,body,null).then((function(result){resolve(result)}),(function(error){reject(error)}))}));return createSchema.then((function(value){var schemaId=value["id"];return _this.createEventType(eventTypeName,eventDescription,schemaId)}))}},{key:"createSchemaAndLogicalInterface",value:function createSchemaAndLogicalInterface(schemaContents,schemaFileName,appInterfaceName,appInterfaceDescription,appInterfaceAlias){var _this2=this;var body={schemaFile:schemaContents,schemaType:"json-schema",name:schemaFileName};var createSchema=new Promise((function(resolve,reject){var base=_this2.draftMode?["draft","schemas"]:["schemas"];_this2.callFormDataApi("POST",201,true,base,body,null).then((function(result){resolve(result)}),(function(error){reject(error)}))}));return createSchema.then((function(value){var schemaId=value.id;return _this2.createLogicalInterface(appInterfaceName,appInterfaceDescription,schemaId,appInterfaceAlias)}))}},{key:"createPhysicalInterfaceWithEventMapping",value:function createPhysicalInterfaceWithEventMapping(physicalInterfaceName,description,eventId,eventTypeId){var _this3=this;var createPhysicalInterface=new Promise((function(resolve,reject){_this3.createPhysicalInterface(physicalInterfaceName,description).then((function(result){resolve(result)}),(function(error){reject(error)}))}));return createPhysicalInterface.then((function(value){var physicalInterface=value;var PhysicalInterfaceEventMapping=new Promise((function(resolve,reject){_this3.createPhysicalInterfaceEventMapping(physicalInterface.id,eventId,eventTypeId).then((function(result){resolve([physicalInterface,result])}),(function(error){reject(error)}))}));return PhysicalInterfaceEventMapping.then((function(result){return result}))}))}},{key:"createDeviceTypeLogicalInterfaceEventMapping",value:function createDeviceTypeLogicalInterfaceEventMapping(deviceTypeName,description,logicalInterfaceId,eventMapping,notificationStrategy){var _this4=this;var createDeviceType=new Promise((function(resolve,reject){_this4.createDeviceType(deviceTypeName,description).then((function(result){resolve(result)}),(function(error){reject(error)}))}));return createDeviceType.then((function(result){var deviceObject=result;var deviceTypeLogicalInterface=null;var deviceTypeLogicalInterface=new Promise((function(resolve,reject){_this4.createDeviceTypeLogicalInterfaceAssociation(deviceObject.id,logicalInterfaceId).then((function(result){resolve(result)}),(function(error){reject(error)}))}));return deviceTypeLogicalInterface.then((function(result){deviceTypeLogicalInterface=result;var deviceTypeLogicalInterfacePropertyMappings=new Promise((function(resolve,reject){var notificationstrategy="never";if(notificationStrategy){notificationstrategy=notificationStrategy}_this4.createDeviceTypeLogicalInterfacePropertyMappings(deviceObject.id,logicalInterfaceId,eventMapping,notificationstrategy).then((function(result){var arr=[deviceObject,deviceTypeLogicalInterface,result];resolve(arr)}),(function(error){reject(error)}))}));return deviceTypeLogicalInterfacePropertyMappings.then((function(result){return result}))}))}))}}])}()},{loglevel:138}],306:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _util=require("../util");var _BaseClient2=_interopRequireDefault(require("../BaseClient"));var _ApiClient=_interopRequireDefault(require("../api/ApiClient"));var _RegistryClient=_interopRequireDefault(require("../api/RegistryClient"));var _MgmtClient=_interopRequireDefault(require("../api/MgmtClient"));var _LecClient=_interopRequireDefault(require("../api/LecClient"));var _DscClient=_interopRequireDefault(require("../api/DscClient"));var _RulesClient=_interopRequireDefault(require("../api/RulesClient"));var _StateClient=_interopRequireDefault(require("../api/StateClient"));var _ApplicationConfig=_interopRequireDefault(require("./ApplicationConfig"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t)}:p}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value}},_get.apply(null,arguments)}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}var DEVICE_EVT_RE=/^iot-2\/type\/(.+)\/id\/(.+)\/evt\/(.+)\/fmt\/(.+)$/;var DEVICE_CMD_RE=/^iot-2\/type\/(.+)\/id\/(.+)\/cmd\/(.+)\/fmt\/(.+)$/;var DEVICE_STATE_RE=/^iot-2\/type\/(.+)\/id\/(.+)\/intf\/(.+)\/evt\/state$/;var DEVICE_STATE_ERROR_RE=/^iot-2\/type\/(.+)\/id\/(.+)\/err\/data$/;var RULE_TRIGGER_RE=/^iot-2\/intf\/(.+)\/rule\/(.+)\/evt\/trigger$/;var RULE_ERROR_RE=/^iot-2\/intf\/(.+)\/rule\/(.+)\/err\/data$/;var DEVICE_MON_RE=/^iot-2\/type\/(.+)\/id\/(.+)\/mon$/;var APP_MON_RE=/^iot-2\/app\/(.+)\/mon$/;var ApplicationClient=exports["default"]=function(_BaseClient){function ApplicationClient(config){var _this;_classCallCheck(this,ApplicationClient);if(!config instanceof _ApplicationConfig["default"]){throw new Error("Config must be an instance of ApplicationConfig")}_this=_callSuper(this,ApplicationClient,[config]);_this.useLtpa=config.auth&&config.auth.useLtpa;if(config.auth&&config.auth.useLtpa||config.getOrgId()!="quickstart"){_this._apiClient=new _ApiClient["default"](_this.config);_this.dsc=new _DscClient["default"](_this._apiClient);_this.lec=new _LecClient["default"](_this._apiClient);_this.mgmt=new _MgmtClient["default"](_this._apiClient);_this.registry=new _RegistryClient["default"](_this._apiClient);_this.rules=new _RulesClient["default"](_this._apiClient);_this.state=new _StateClient["default"](_this._apiClient)}_this.log.debug("[ApplicationClient:constructor] ApplicationClient initialized for organization : "+config.getOrgId());return _this}_inherits(ApplicationClient,_BaseClient);return _createClass(ApplicationClient,[{key:"connect",value:function connect(){var _this2=this;_superPropGet(ApplicationClient,"connect",this,3)([]);this.mqtt.on("message",(function(topic,payload){_this2.log.trace("[ApplicationClient:onMessage] mqtt: ",topic,payload.toString());var match=DEVICE_EVT_RE.exec(topic);if(match){_this2.emit("deviceEvent",match[1],match[2],match[3],match[4],payload,topic);return}var match=DEVICE_CMD_RE.exec(topic);if(match){_this2.emit("deviceCommand",match[1],match[2],match[3],match[4],payload,topic);return}var match=DEVICE_STATE_RE.exec(topic);if(match){_this2.emit("deviceState",match[1],match[2],match[3],payload,topic);return}var match=DEVICE_STATE_ERROR_RE.exec(topic);if(match){_this2.emit("deviceStateError",match[1],match[2],payload,topic);return}var match=RULE_TRIGGER_RE.exec(topic);if(match){_this2.emit("ruleTrigger",match[1],match[2],payload,topic);return}var match=RULE_ERROR_RE.exec(topic);if(match){_this2.emit("ruleError",match[1],match[2],payload,topic);return}var match=DEVICE_MON_RE.exec(topic);if(match){_this2.emit("deviceStatus",match[1],match[2],payload,topic);return}var match=APP_MON_RE.exec(topic);if(match){_this2.emit("appStatus",match[1],payload,topic);return}_this2.log.warn("[ApplicationClient:onMessage] Message received on unexpected topic"+", "+topic+", "+payload)}))}},{key:"publishEvent",value:function publishEvent(typeId,deviceId,eventId,format,data,qos,callback){qos=qos||0;if(!(0,_util.isDefined)(typeId)||!(0,_util.isDefined)(deviceId)||!(0,_util.isDefined)(eventId)||!(0,_util.isDefined)(format)){this.log.error("[ApplicationClient:publishDeviceEvent] Required params for publishDeviceEvent not present");this.emit("error","[ApplicationClient:publishDeviceEvent] Required params for publishDeviceEvent not present");return}var topic="iot-2/type/"+typeId+"/id/"+deviceId+"/evt/"+eventId+"/fmt/"+format;this._publish(topic,data,qos,callback);return this}},{key:"subscribeToEvents",value:function subscribeToEvents(typeId,deviceId,eventId,format,qos,callback){typeId=typeId||"+";deviceId=deviceId||"+";eventId=eventId||"+";format=format||"+";qos=qos||0;var topic="iot-2/type/"+typeId+"/id/"+deviceId+"/evt/"+eventId+"/fmt/"+format;this._subscribe(topic,qos,callback);return this}},{key:"unsubscribeFromEvents",value:function unsubscribeFromEvents(typeId,deviceId,eventId,format,callback){typeId=typeId||"+";deviceId=deviceId||"+";eventId=eventId||"+";format=format||"+";var topic="iot-2/type/"+typeId+"/id/"+deviceId+"/evt/"+eventId+"/fmt/"+format;this._unsubscribe(topic,callback);return this}},{key:"publishCommand",value:function publishCommand(typeId,deviceId,commandId,format,data,qos,callback){qos=qos||0;if(!(0,_util.isDefined)(typeId)||!(0,_util.isDefined)(deviceId)||!(0,_util.isDefined)(commandId)||!(0,_util.isDefined)(format)){this.log.error("[ApplicationClient:publishDeviceCommand] Required params for publishDeviceCommand not present");this.emit("error","[ApplicationClient:publishDeviceCommand] Required params for publishDeviceCommand not present");return}var topic="iot-2/type/"+typeId+"/id/"+deviceId+"/cmd/"+commandId+"/fmt/"+format;this._publish(topic,data,qos,callback);return this}},{key:"subscribeToCommands",value:function subscribeToCommands(typeId,deviceId,commandId,format,qos,callback){typeId=typeId||"+";deviceId=deviceId||"+";commandId=commandId||"+";format=format||"+";qos=qos||0;var topic="iot-2/type/"+typeId+"/id/"+deviceId+"/cmd/"+commandId+"/fmt/"+format;this.log.debug("[ApplicationClient:subscribeToDeviceCommands] Calling subscribe with QoS "+qos);this._subscribe(topic,qos,callback);return this}},{key:"unsubscribeFromCommands",value:function unsubscribeFromCommands(typeId,deviceId,commandId,format,callback){typeId=typeId||"+";deviceId=deviceId||"+";commandId=commandId||"+";format=format||"+";var topic="iot-2/type/"+typeId+"/id/"+deviceId+"/cmd/"+commandId+"/fmt/"+format;this._unsubscribe(topic,callback);return this}},{key:"subscribeToDeviceState",value:function subscribeToDeviceState(type,id,interfaceId,qos){type=type||"+";id=id||"+";interfaceId=interfaceId||"+";qos=qos||0;var topic="iot-2/type/"+type+"/id/"+id+"/intf/"+interfaceId+"/evt/state";this.log.debug("[ApplicationClient:subscribeToDeviceState] Calling subscribe with QoS "+qos);this._subscribe(topic,qos);return this}},{key:"unsubscribeToDeviceState",value:function unsubscribeToDeviceState(type,id,interfaceId){type=type||"+";id=id||"+";interfaceId=interfaceId||"+";var topic="iot-2/type/"+type+"/id/"+id+"/intf/"+interfaceId+"/evt/state";this._unsubscribe(topic);return this}},{key:"subscribeToDeviceErrors",value:function subscribeToDeviceErrors(type,id,qos){type=type||"+";id=id||"+";qos=qos||0;var topic="iot-2/type/"+type+"/id/"+id+"/err/data";this.log.debug("[ApplicationClient:subscribeToDeviceErrors] Calling subscribe with QoS "+qos);this._subscribe(topic,qos);return this}},{key:"unsubscribeToDeviceErrors",value:function unsubscribeToDeviceErrors(type,id){type=type||"+";id=id||"+";var topic="iot-2/type/"+type+"/id/"+id+"/err/data";this._unsubscribe(topic);return this}},{key:"subscribeToRuleTriggers",value:function subscribeToRuleTriggers(interfaceId,ruleId,qos){interfaceId=interfaceId||"+";ruleId=ruleId||"+";qos=qos||0;var topic="iot-2/intf/"+interfaceId+"/rule/"+ruleId+"/evt/trigger";this.log.debug("[ApplicationClient:subscribeToRuleTriggers] Calling subscribe with QoS "+qos);this._subscribe(topic,qos);return this}},{key:"unsubscribeToRuleTriggers",value:function unsubscribeToRuleTriggers(interfaceId,ruleId){interfaceId=interfaceId||"+";ruleId=ruleId||"+";var topic="iot-2/intf/"+interfaceId+"/rule/"+ruleId+"/evt/trigger";this._unsubscribe(topic);return this}},{key:"subscribeToRuleErrors",value:function subscribeToRuleErrors(interfaceId,ruleId,qos){interfaceId=interfaceId||"+";ruleId=ruleId||"+";qos=qos||0;var topic="iot-2/intf/"+interfaceId+"/rule/"+ruleId+"/err/data";this.log.debug("[ApplicationClient:subscribeToRuleErrors] Calling subscribe with QoS "+qos);this._subscribe(topic,qos);return this}},{key:"unsubscribeToRuleErrors",value:function unsubscribeToRuleErrors(interfaceId,ruleId){interfaceId=interfaceId||"+";ruleId=ruleId||"+";var topic="iot-2/intf/"+interfaceId+"/rule/"+ruleId+"/err/data";this._unsubscribe(topic);return this}},{key:"subscribeToDeviceStatus",value:function subscribeToDeviceStatus(type,id,qos){type=type||"+";id=id||"+";qos=qos||0;var topic="iot-2/type/"+type+"/id/"+id+"/mon";this.log.debug("[ApplicationClient:subscribeToDeviceStatus] Calling subscribe with QoS "+qos);this._subscribe(topic,qos);return this}},{key:"unsubscribeToDeviceStatus",value:function unsubscribeToDeviceStatus(type,id){type=type||"+";id=id||"+";var topic="iot-2/type/"+type+"/id/"+id+"/mon";this._unsubscribe(topic);return this}},{key:"subscribeToAppStatus",value:function subscribeToAppStatus(id,qos){id=id||"+";qos=qos||0;var topic="iot-2/app/"+id+"/mon";this.log.debug("[ApplicationClient:subscribeToAppStatus] Calling subscribe with QoS "+qos);this._subscribe(topic,qos);return this}},{key:"unsubscribeToAppStatus",value:function unsubscribeToAppStatus(id){id=id||"+";var topic="iot-2/app/"+id+"/mon";this._unsubscribe(topic);return this}}])}(_BaseClient2["default"])},{"../BaseClient":296,"../api/ApiClient":298,"../api/DscClient":300,"../api/LecClient":301,"../api/MgmtClient":302,"../api/RegistryClient":303,"../api/RulesClient":304,"../api/StateClient":305,"../util":312,"./ApplicationConfig":307}],307:[function(require,module,exports){(function(process){(function(){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _BaseConfig2=_interopRequireDefault(require("../BaseConfig"));var _loglevel=_interopRequireDefault(require("loglevel"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}var YAML=require("yaml");var fs=require("fs");var _require=require("uuid"),uuidv4=_require.v4;var ApplicationConfig=exports["default"]=function(_BaseConfig){function ApplicationConfig(identity,auth,options){var _this;_classCallCheck(this,ApplicationConfig);_this=_callSuper(this,ApplicationConfig,[identity,auth,options]);if(_this.auth!=null&&!_this.auth.useLtpa){if(!("key"in _this.auth)||_this.auth.key==null){throw new Error("Missing auth.key from configuration")}if(!("token"in _this.auth)||_this.auth.token==null){throw new Error("Missing auth.token from configuration")}}if(_this.identity==null){_this.identity={}}if(!("appId"in _this.identity)){_this.identity.appId=uuidv4()}if(!("sharedSubscription"in _this.options.mqtt)){_this.options.mqtt.sharedSubscription=false}return _this}_inherits(ApplicationConfig,_BaseConfig);return _createClass(ApplicationConfig,[{key:"getOrgId",value:function getOrgId(){if(this.auth==null){return"quickstart"}else if(this.auth.key){return this.auth.key.split("-")[1]}else{return null}}},{key:"getApiRoot",value:function getApiRoot(){return this.options.apiRoot||"api/v0002"}},{key:"getApiBaseUri",value:function getApiBaseUri(){return this.auth&&this.auth.useLtpa?"/".concat(this.getApiRoot()):"https://".concat(this.getOrgId(),".").concat(this.options.domain,"/").concat(this.getApiRoot())}},{key:"getClientId",value:function getClientId(){var clientIdPrefix="a";if(this.options.mqtt.sharedSubscription==true){clientIdPrefix="A"}return clientIdPrefix+":"+this.getOrgId()+":"+this.identity.appId}},{key:"getMqttUsername",value:function getMqttUsername(){return this.auth.key}},{key:"getMqttPassword",value:function getMqttPassword(){return this.auth.token}},{key:"getAdditionalHeaders",value:function getAdditionalHeaders(){return this.options&&this.options.http?this.options.http.additionalHeaders:[]}},{key:"setAdditionalHeader",value:function setAdditionalHeader(key,value){if(!this.options.http)this.options.http={};if(!this.options.http.additionalHeaders)this.options.http.additionalHeaders={};this.options.http.additionalHeaders[key]=value}}],[{key:"parseEnvVars",value:function parseEnvVars(){var authKey=process.env.WIOTP_AUTH_KEY||null;var authToken=process.env.WIOTP_AUTH_TOKEN||null;if(authKey==null&&authToken==null){authKey=process.env.WIOTP_API_KEY||null;authToken=process.env.WIOTP_API_TOKEN||null}var appId=process.env.WIOTP_IDENTITY_APPID||uuidv4();var domain=process.env.WIOTP_OPTIONS_DOMAIN||null;var apiRoot=process.env.WIOTP_OPTIONS_API_ROOT||null;var logLevel=process.env.WIOTP_OPTIONS_LOGLEVEL||"info";var port=process.env.WIOTP_OPTIONS_MQTT_PORT||null;var transport=process.env.WIOTP_OPTIONS_MQTT_TRANSPORT||null;var caFile=process.env.WIOTP_OPTIONS_MQTT_CAFILE||null;var cleanStart=process.env.WIOTP_OPTIONS_MQTT_CLEANSTART||"true";var sessionExpiry=process.env.WIOTP_OPTIONS_MQTT_SESSIONEXPIRY||3600;var keepAlive=process.env.WIOTP_OPTIONS_MQTT_KEEPALIVE||60;var sharedSubs=process.env.WIOTP_OPTIONS_MQTT_SHAREDSUBSCRIPTION||"false";var verifyCert=process.env.WIOTP_OPTIONS_HTTP_VERIFY||"true";if(port!=null){port=parseInt(port)}sessionExpiry=parseInt(sessionExpiry);keepAlive=parseInt(keepAlive);var identity={appId:appId};var options={domain:domain,apiRoot:apiRoot,logLevel:logLevel,mqtt:{port:port,transport:transport,cleanStart:["True","true","1"].includes(cleanStart),sessionExpiry:sessionExpiry,keepAlive:keepAlive,sharedSubscription:["True","true","1"].includes(sharedSubs),caFile:caFile},http:{verify:["True","true","1"].includes(verifyCert)}};var auth=null;if(authToken!=null){auth={key:authKey,token:authToken}}return new ApplicationConfig(identity,auth,options)}},{key:"parseConfigFile",value:function parseConfigFile(configFilePath){var configFile=fs.readFileSync(configFilePath,"utf8");var data=YAML.parse(configFile);if(!fs.existsSync(configFilePath)){throw new Error("File not found")}else{try{var _configFile=fs.readFileSync(configFilePath,"utf8");var data=YAML.parse(_configFile)}catch(err){throw new Error("Error reading device configuration file: "+err.code)}}if("options"in data&"logLevel"in data["options"]){var validLevels=["error","warning","info","debug"];if(!validLevels.includes(data["options"]["logLevel"])){throw new Error("Optional setting options.logLevel (Currently: "+data["options"]["logLevel"]+") must be one of error, warning, info, debug")}}else{data["options"]["logLevel"]=_loglevel["default"].GetLogger(data["options"]["logLevel"].toUpperCase())}return new ApplicationConfig(data["identity"],data["auth"],data["options"])}}])}(_BaseConfig2["default"])}).call(this)}).call(this,require("_process"))},{"../BaseConfig":297,_process:182,fs:72,loglevel:138,uuid:204,yaml:295}],308:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _util=require("../util");var _BaseClient2=_interopRequireDefault(require("../BaseClient"));var _DeviceConfig=_interopRequireDefault(require("./DeviceConfig"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t)}:p}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value}},_get.apply(null,arguments)}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}var WILDCARD_TOPIC="iot-2/cmd/+/fmt/+";var CMD_RE=/^iot-2\/cmd\/(.+)\/fmt\/(.+)$/;var util=require("util");var DeviceClient=exports["default"]=function(_BaseClient){function DeviceClient(config){var _this;_classCallCheck(this,DeviceClient);if(!config instanceof _DeviceConfig["default"]){throw new Error("Config must be an instance of DeviceConfig")}_this=_callSuper(this,DeviceClient,[config]);_this.log.debug("[DeviceClient:constructor] DeviceClient initialized for "+config.getClientId());return _this}_inherits(DeviceClient,_BaseClient);return _createClass(DeviceClient,[{key:"_commandSubscriptionCallback",value:function _commandSubscriptionCallback(err,granted){if(err==null){for(var index in granted){var grant=granted[index];this.log.debug("[DeviceClient:connect] Subscribed to device commands on "+grant.topic+" at QoS "+grant.qos)}}else{this.log.error("[DeviceClient:connect] Unable to establish subscription for device commands: "+err);this.emit("error",new Error("Unable to establish subscription for device commands: "+err))}}},{key:"connect",value:function connect(){var _this2=this;_superPropGet(DeviceClient,"connect",this,3)([]);this.mqtt.on("connect",(function(){if(!_this2.config.isQuickstart()){_this2.mqtt.subscribe(WILDCARD_TOPIC,{qos:1},_this2._commandSubscriptionCallback.bind(_this2))}}));this.mqtt.on("message",(function(topic,payload){_this2.log.debug("[DeviceClient:onMessage] Message received on topic : "+topic+" with payload : "+payload);var match=CMD_RE.exec(topic);if(match){_this2.emit("command",match[1],match[2],payload,topic)}}))}},{key:"publishEvent",value:function publishEvent(eventId,format,data,qos,callback){qos=qos||0;if(!(0,_util.isDefined)(eventId)||!(0,_util.isDefined)(format)){this.log.error("[DeviceClient:publishEvent] Required params for publishEvent not present");this.emit("error","[DeviceClient:publishEvent] Required params for publishEvent not present");return}var topic=util.format("iot-2/evt/%s/fmt/%s",eventId,format);this._publish(topic,data,qos,callback);return this}}])}(_BaseClient2["default"])},{"../BaseClient":296,"../util":312,"./DeviceConfig":309,util:203}],309:[function(require,module,exports){(function(process){(function(){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _BaseConfig2=_interopRequireDefault(require("../BaseConfig"));var _loglevel=_interopRequireDefault(require("loglevel"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}var YAML=require("yaml");var fs=require("fs");var DeviceConfig=exports["default"]=function(_BaseConfig){function DeviceConfig(identity,auth,options){var _this;_classCallCheck(this,DeviceConfig);_this=_callSuper(this,DeviceConfig,[identity,auth,options]);if(_this.identity==null){throw new Error("Missing identity from configuration")}if(!("orgId"in _this.identity)||_this.identity.orgId==null){throw new Error("Missing identity.orgId from configuration")}if(!("typeId"in _this.identity)||_this.identity.typeId==null){throw new Error("Missing identity.typeId from configuration")}if(!("deviceId"in _this.identity)||_this.identity.deviceId==null){throw new Error("Missing identity.deviceId from configuration")}if(_this.identity.orgId=="quickstart"){if(_this.auth!=null){throw new Error("Quickstart service does not support device authentication")}}else{if(_this.auth==null){throw new Error("Missing auth from configuration")}if(!("token"in _this.auth)||_this.auth.token==null){throw new Error("Missing auth.token from configuration")}}return _this}_inherits(DeviceConfig,_BaseConfig);return _createClass(DeviceConfig,[{key:"getOrgId",value:function getOrgId(){return this.identity.orgId}},{key:"getClientId",value:function getClientId(){return"d:"+this.identity.orgId+":"+this.identity.typeId+":"+this.identity.deviceId}},{key:"getMqttUsername",value:function getMqttUsername(){return"use-token-auth"}},{key:"getMqttPassword",value:function getMqttPassword(){if(this.identity.orgId!="quickstart"){return this.auth.token}else{return null}}}],[{key:"parseEnvVars",value:function parseEnvVars(){var orgId=process.env.WIOTP_IDENTITY_ORGID||null;var typeId=process.env.WIOTP_IDENTITY_TYPEID||null;var deviceId=process.env.WIOTP_IDENTITY_DEVICEID||null;var authToken=process.env.WIOTP_AUTH_TOKEN||null;if(authToken==null){authToken=process.env.WIOTP_API_TOKEN||null}var domain=process.env.WIOTP_OPTIONS_DOMAIN||null;var logLevel=process.env.WIOTP_OPTIONS_LOGLEVEL||"info";var port=process.env.WIOTP_OPTIONS_MQTT_PORT||null;var transport=process.env.WIOTP_OPTIONS_MQTT_TRANSPORT||null;var caFile=process.env.WIOTP_OPTIONS_MQTT_CAFILE||null;var cleanStart=process.env.WIOTP_OPTIONS_MQTT_CLEANSTART||"true";var sessionExpiry=process.env.WIOTP_OPTIONS_MQTT_SESSIONEXPIRY||3600;var keepAlive=process.env.WIOTP_OPTIONS_MQTT_KEEPALIVE||60;var sharedSubs=process.env.WIOTP_OPTIONS_MQTT_SHAREDSUBSCRIPTION||"false";if(port!=null){port=parseInt(port)}sessionExpiry=parseInt(sessionExpiry);keepAlive=parseInt(keepAlive);var identity={orgId:orgId,typeId:typeId,deviceId:deviceId};var options={domain:domain,logLevel:logLevel,mqtt:{port:port,transport:transport,cleanStart:["True","true","1"].includes(cleanStart),sessionExpiry:sessionExpiry,keepAlive:keepAlive,sharedSubscription:["True","true","1"].includes(sharedSubs),caFile:caFile}};var auth=null;if(authToken!=null){auth={token:authToken}}return new DeviceConfig(identity,auth,options)}},{key:"parseConfigFile",value:function parseConfigFile(configFilePath){var configFile=fs.readFileSync(configFilePath,"utf8");var data=YAML.parse(configFile);if(!fs.existsSync(configFilePath)){throw new Error("File not found")}else{try{var _configFile=fs.readFileSync(configFilePath,"utf8");var data=YAML.parse(_configFile)}catch(err){throw new Error("Error reading device configuration file: "+err.code)}}if("options"in data&"logLevel"in data["options"]){var validLevels=["error","warning","info","debug"];if(!validLevels.includes(data["options"]["logLevel"])){throw new Error("Optional setting options.logLevel (Currently: "+data["options"]["logLevel"]+") must be one of error, warning, info, debug")}}else{data["options"]["logLevel"]=_loglevel["default"].GetLogger(data["options"]["logLevel"].toUpperCase())}return new DeviceConfig(data["identity"],data["auth"],data["options"])}}])}(_BaseConfig2["default"])}).call(this)}).call(this,require("_process"))},{"../BaseConfig":297,_process:182,fs:72,loglevel:138,yaml:295}],310:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _BaseClient2=_interopRequireDefault(require("../BaseClient"));var _GatewayConfig=_interopRequireDefault(require("./GatewayConfig"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t)}:p}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value}},_get.apply(null,arguments)}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}var CMD_RE=/^iot-2\/type\/(.+)\/id\/(.+)\/cmd\/(.+)\/fmt\/(.+)$/;var util=require("util");var GatewayClient=exports["default"]=function(_BaseClient){function GatewayClient(config){var _this;_classCallCheck(this,GatewayClient);if(!config instanceof _GatewayConfig["default"]){throw new Error("Config must be an instance of GatewayConfig")}if(config.isQuickstart()){throw new Error("[GatewayClient:constructor] Quickstart not supported in Gateways")}_this=_callSuper(this,GatewayClient,[config]);_this.log.debug("[GatewayClient:constructor] GatewayClient initialized for "+config.getClientId());return _this}_inherits(GatewayClient,_BaseClient);return _createClass(GatewayClient,[{key:"connect",value:function connect(){var _this2=this;_superPropGet(GatewayClient,"connect",this,3)([]);this.mqtt.on("connect",(function(){}));this.mqtt.on("message",(function(topic,payload){_this2.log.debug("[GatewayClient:onMessage] Message received on topic : "+topic+" with payload : "+payload);var match=CMD_RE.exec(topic);if(match){_this2.emit("command",match[1],match[2],match[3],match[4],payload,topic)}}))}},{key:"publishEvent",value:function publishEvent(eventId,format,payload,qos,callback){return this._publishEvent(this.config.identity.typeId,this.config.identity.deviceId,eventId,format,payload,qos,callback)}},{key:"publishDeviceEvent",value:function publishDeviceEvent(typeid,deviceId,eventid,format,payload,qos,callback){return this._publishEvent(typeId,deviceId,eventid,format,payload,qos,callback)}},{key:"_publishEvent",value:function _publishEvent(typeId,deviceId,eventId,format,data,qos,callback){var topic=util.format("iot-2/type/%s/id/%s/evt/%s/fmt/%s",typeId,deviceId,eventId,format);qos=qos||0;this._publish(topic,data,qos,callback);return this}},{key:"subscribeToDeviceCommands",value:function subscribeToDeviceCommands(typeId,deviceId,commandId,format,qos,callback){typeId=typeId||"+";deviceId=deviceId||"+";commandId=commandid||"+";format=format||"+";qos=qos||0;var topic="iot-2/type/"+typeId+"/id/"+deviceId+"/cmd/"+commandId+"/fmt/"+format;this._subscribe(topic,qos,callback);return this}},{key:"unsubscribeFromDeviceCommands",value:function unsubscribeFromDeviceCommands(typeId,deviceId,commandId,format,callback){typeId=typeId||"+";deviceId=deviceId||"+";commandId=commandId||"+";format=format||"+";var topic="iot-2/type/"+typeId+"/id/"+deviceId+"/cmd/"+commandId+"/fmt/"+format;this._unsubscribe(topic,callback);return this}},{key:"subscribeToCommands",value:function subscribeToCommands(commandId,format,qos,callback){commandId=commandId||"+";format=format||"+";qos=qos||0;var topic="iot-2/type/"+this.config.identity.typeId+"/id/"+this.config.identity.deviceId+"/cmd/"+commandId+"/fmt/"+format;this._subscribe(topic,qos,callback);return this}},{key:"unsubscribeFromCommands",value:function unsubscribeFromCommands(commandId,format,callback){commandId=commandId||"+";format=format||"+";var topic="iot-2/type/"+this.config.identity.typeId+"/id/"+this.config.identity.deviceId+"/cmd/"+commandId+"/fmt/"+format;this._unsubscribe(topic,callback);return this}}])}(_BaseClient2["default"])},{"../BaseClient":296,"./GatewayConfig":311,util:203}],311:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _DeviceConfig2=_interopRequireDefault(require("../device/DeviceConfig"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}var GatewayConfig=exports["default"]=function(_DeviceConfig){function GatewayConfig(identity,auth,options){_classCallCheck(this,GatewayConfig);return _callSuper(this,GatewayConfig,[identity,auth,options])}_inherits(GatewayConfig,_DeviceConfig);return _createClass(GatewayConfig,[{key:"getClientId",value:function getClientId(){return"g:"+this.identity.orgId+":"+this.identity.typeId+":"+this.identity.deviceId}}])}(_DeviceConfig2["default"])},{"../device/DeviceConfig":309}],312:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.generateUUID=generateUUID;exports.isBoolean=isBoolean;exports.isBrowser=void 0;exports.isDefined=isDefined;exports.isNode=void 0;exports.isNumber=isNumber;exports.isString=isString;function isString(value){return typeof value==="string"}function isNumber(value){return typeof value==="number"}function isBoolean(value){return typeof value==="boolean"}function isDefined(value){return value!==undefined&&value!==null}var isBrowser=exports.isBrowser=new Function("try {return this===window;}catch(e){ return false;}");var isNode=exports.isNode=new Function("try {return this===global;}catch(e){return false;}");function generateUUID(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(c){var r=Math.random()*16|0,v=c=="x"?r:r&3|8;return v.toString(16)}))}},{}],313:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"ApiClient",{enumerable:true,get:function get(){return _ApiClient["default"]}});Object.defineProperty(exports,"ApiErrors",{enumerable:true,get:function get(){return _ApiErrors["default"]}});Object.defineProperty(exports,"ApplicationClient",{enumerable:true,get:function get(){return _ApplicationClient["default"]}});Object.defineProperty(exports,"ApplicationConfig",{enumerable:true,get:function get(){return _ApplicationConfig["default"]}});Object.defineProperty(exports,"DeviceClient",{enumerable:true,get:function get(){return _DeviceClient["default"]}});Object.defineProperty(exports,"DeviceConfig",{enumerable:true,get:function get(){return _DeviceConfig["default"]}});Object.defineProperty(exports,"DscClient",{enumerable:true,get:function get(){return _DscClient["default"]}});Object.defineProperty(exports,"GatewayClient",{enumerable:true,get:function get(){return _GatewayClient["default"]}});Object.defineProperty(exports,"LecClient",{enumerable:true,get:function get(){return _LecClient["default"]}});Object.defineProperty(exports,"MgmtClient",{enumerable:true,get:function get(){return _MgmtClient["default"]}});Object.defineProperty(exports,"RegistryClient",{enumerable:true,get:function get(){return _RegistryClient["default"]}});Object.defineProperty(exports,"RulesClient",{enumerable:true,get:function get(){return _RulesClient["default"]}});Object.defineProperty(exports,"StateClient",{enumerable:true,get:function get(){return _StateClient["default"]}});var _ApplicationClient=_interopRequireDefault(require("./application/ApplicationClient"));var _DeviceClient=_interopRequireDefault(require("./device/DeviceClient"));var _GatewayClient=_interopRequireDefault(require("./gateway/GatewayClient"));var _ApplicationConfig=_interopRequireDefault(require("./application/ApplicationConfig"));var _DeviceConfig=_interopRequireDefault(require("./device/DeviceConfig"));var _ApiClient=_interopRequireDefault(require("./api/ApiClient"));var _ApiErrors=_interopRequireDefault(require("./api/ApiErrors"));var _DscClient=_interopRequireDefault(require("./api/DscClient"));var _LecClient=_interopRequireDefault(require("./api/LecClient"));var _MgmtClient=_interopRequireDefault(require("./api/MgmtClient"));var _RegistryClient=_interopRequireDefault(require("./api/RegistryClient"));var _RulesClient=_interopRequireDefault(require("./api/RulesClient"));var _StateClient=_interopRequireDefault(require("./api/StateClient"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}},{"./api/ApiClient":298,"./api/ApiErrors":299,"./api/DscClient":300,"./api/LecClient":301,"./api/MgmtClient":302,"./api/RegistryClient":303,"./api/RulesClient":304,"./api/StateClient":305,"./application/ApplicationClient":306,"./application/ApplicationConfig":307,"./device/DeviceClient":308,"./device/DeviceConfig":309,"./gateway/GatewayClient":310}]},{},[313]);
41
+ /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var buffer=require("buffer");var Buffer=buffer.Buffer;function copyProps(src,dst){for(var key in src){dst[key]=src[key]}}if(Buffer.from&&Buffer.alloc&&Buffer.allocUnsafe&&Buffer.allocUnsafeSlow){module.exports=buffer}else{copyProps(buffer,exports);exports.Buffer=SafeBuffer}function SafeBuffer(arg,encodingOrOffset,length){return Buffer(arg,encodingOrOffset,length)}SafeBuffer.prototype=Object.create(Buffer.prototype);copyProps(Buffer,SafeBuffer);SafeBuffer.from=function(arg,encodingOrOffset,length){if(typeof arg==="number"){throw new TypeError("Argument must not be a number")}return Buffer(arg,encodingOrOffset,length)};SafeBuffer.alloc=function(size,fill,encoding){if(typeof size!=="number"){throw new TypeError("Argument must be a number")}var buf=Buffer(size);if(fill!==undefined){if(typeof encoding==="string"){buf.fill(fill,encoding)}else{buf.fill(fill)}}else{buf.fill(0)}return buf};SafeBuffer.allocUnsafe=function(size){if(typeof size!=="number"){throw new TypeError("Argument must be a number")}return Buffer(size)};SafeBuffer.allocUnsafeSlow=function(size){if(typeof size!=="number"){throw new TypeError("Argument must be a number")}return buffer.SlowBuffer(size)}},{buffer:74}],188:[function(require,module,exports){"use strict";var GetIntrinsic=require("get-intrinsic");var define=require("define-data-property");var hasDescriptors=require("has-property-descriptors")();var gOPD=require("gopd");var $TypeError=GetIntrinsic("%TypeError%");var $floor=GetIntrinsic("%Math.floor%");module.exports=function setFunctionLength(fn,length){if(typeof fn!=="function"){throw new $TypeError("`fn` is not a function")}if(typeof length!=="number"||length<0||length>4294967295||$floor(length)!==length){throw new $TypeError("`length` must be a positive 32-bit integer")}var loose=arguments.length>2&&!!arguments[2];var functionLengthIsConfigurable=true;var functionLengthIsWritable=true;if("length"in fn&&gOPD){var desc=gOPD(fn,"length");if(desc&&!desc.configurable){functionLengthIsConfigurable=false}if(desc&&!desc.writable){functionLengthIsWritable=false}}if(functionLengthIsConfigurable||functionLengthIsWritable||!loose){if(hasDescriptors){define(fn,"length",length,true,true)}else{define(fn,"length",length)}}return fn}},{"define-data-property":79,"get-intrinsic":102,gopd:103,"has-property-descriptors":104}],189:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}var GetIntrinsic=require("get-intrinsic");var callBound=require("call-bind/callBound");var inspect=require("object-inspect");var $TypeError=GetIntrinsic("%TypeError%");var $WeakMap=GetIntrinsic("%WeakMap%",true);var $Map=GetIntrinsic("%Map%",true);var $weakMapGet=callBound("WeakMap.prototype.get",true);var $weakMapSet=callBound("WeakMap.prototype.set",true);var $weakMapHas=callBound("WeakMap.prototype.has",true);var $mapGet=callBound("Map.prototype.get",true);var $mapSet=callBound("Map.prototype.set",true);var $mapHas=callBound("Map.prototype.has",true);var listGetNode=function listGetNode(list,key){for(var prev=list,curr;(curr=prev.next)!==null;prev=curr){if(curr.key===key){prev.next=curr.next;curr.next=list.next;list.next=curr;return curr}}};var listGet=function listGet(objects,key){var node=listGetNode(objects,key);return node&&node.value};var listSet=function listSet(objects,key,value){var node=listGetNode(objects,key);if(node){node.value=value}else{objects.next={key:key,next:objects.next,value:value}}};var listHas=function listHas(objects,key){return!!listGetNode(objects,key)};module.exports=function getSideChannel(){var $wm;var $m;var $o;var channel={assert:function assert(key){if(!channel.has(key)){throw new $TypeError("Side channel does not contain "+inspect(key))}},get:function get(key){if($WeakMap&&key&&(_typeof(key)==="object"||typeof key==="function")){if($wm){return $weakMapGet($wm,key)}}else if($Map){if($m){return $mapGet($m,key)}}else{if($o){return listGet($o,key)}}},has:function has(key){if($WeakMap&&key&&(_typeof(key)==="object"||typeof key==="function")){if($wm){return $weakMapHas($wm,key)}}else if($Map){if($m){return $mapHas($m,key)}}else{if($o){return listHas($o,key)}}return false},set:function set(key,value){if($WeakMap&&key&&(_typeof(key)==="object"||typeof key==="function")){if(!$wm){$wm=new $WeakMap}$weakMapSet($wm,key,value)}else if($Map){if(!$m){$m=new $Map}$mapSet($m,key,value)}else{if(!$o){$o={key:{},next:null}}listSet($o,key,value)}}};return channel}},{"call-bind/callBound":75,"get-intrinsic":102,"object-inspect":179}],190:[function(require,module,exports){"use strict";module.exports=shift;function shift(stream){var rs=stream._readableState;if(!rs)return null;return rs.objectMode||typeof stream._duplexState==="number"?stream.read():stream.read(getStateLength(rs))}function getStateLength(state){if(state.buffer.length){if(state.buffer.head){return state.buffer.head.data.length}else if(state.buffer.length>0&&state.buffer[0]){return state.buffer[0].length}}return state.length}},{}],191:[function(require,module,exports){"use strict";var Buffer=require("safe-buffer").Buffer;var isEncoding=Buffer.isEncoding||function(encoding){encoding=""+encoding;switch(encoding&&encoding.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function _normalizeEncoding(enc){if(!enc)return"utf8";var retried;while(true){switch(enc){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return enc;default:if(retried)return;enc=(""+enc).toLowerCase();retried=true}}}function normalizeEncoding(enc){var nenc=_normalizeEncoding(enc);if(typeof nenc!=="string"&&(Buffer.isEncoding===isEncoding||!isEncoding(enc)))throw new Error("Unknown encoding: "+enc);return nenc||enc}exports.StringDecoder=StringDecoder;function StringDecoder(encoding){this.encoding=normalizeEncoding(encoding);var nb;switch(this.encoding){case"utf16le":this.text=utf16Text;this.end=utf16End;nb=4;break;case"utf8":this.fillLast=utf8FillLast;nb=4;break;case"base64":this.text=base64Text;this.end=base64End;nb=3;break;default:this.write=simpleWrite;this.end=simpleEnd;return}this.lastNeed=0;this.lastTotal=0;this.lastChar=Buffer.allocUnsafe(nb)}StringDecoder.prototype.write=function(buf){if(buf.length===0)return"";var r;var i;if(this.lastNeed){r=this.fillLast(buf);if(r===undefined)return"";i=this.lastNeed;this.lastNeed=0}else{i=0}if(i<buf.length)return r?r+this.text(buf,i):this.text(buf,i);return r||""};StringDecoder.prototype.end=utf8End;StringDecoder.prototype.text=utf8Text;StringDecoder.prototype.fillLast=function(buf){if(this.lastNeed<=buf.length){buf.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}buf.copy(this.lastChar,this.lastTotal-this.lastNeed,0,buf.length);this.lastNeed-=buf.length};function utf8CheckByte(_byte){if(_byte<=127)return 0;else if(_byte>>5===6)return 2;else if(_byte>>4===14)return 3;else if(_byte>>3===30)return 4;return _byte>>6===2?-1:-2}function utf8CheckIncomplete(self,buf,i){var j=buf.length-1;if(j<i)return 0;var nb=utf8CheckByte(buf[j]);if(nb>=0){if(nb>0)self.lastNeed=nb-1;return nb}if(--j<i||nb===-2)return 0;nb=utf8CheckByte(buf[j]);if(nb>=0){if(nb>0)self.lastNeed=nb-2;return nb}if(--j<i||nb===-2)return 0;nb=utf8CheckByte(buf[j]);if(nb>=0){if(nb>0){if(nb===2)nb=0;else self.lastNeed=nb-3}return nb}return 0}function utf8CheckExtraBytes(self,buf,p){if((buf[0]&192)!==128){self.lastNeed=0;return"�"}if(self.lastNeed>1&&buf.length>1){if((buf[1]&192)!==128){self.lastNeed=1;return"�"}if(self.lastNeed>2&&buf.length>2){if((buf[2]&192)!==128){self.lastNeed=2;return"�"}}}}function utf8FillLast(buf){var p=this.lastTotal-this.lastNeed;var r=utf8CheckExtraBytes(this,buf,p);if(r!==undefined)return r;if(this.lastNeed<=buf.length){buf.copy(this.lastChar,p,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}buf.copy(this.lastChar,p,0,buf.length);this.lastNeed-=buf.length}function utf8Text(buf,i){var total=utf8CheckIncomplete(this,buf,i);if(!this.lastNeed)return buf.toString("utf8",i);this.lastTotal=total;var end=buf.length-(total-this.lastNeed);buf.copy(this.lastChar,0,end);return buf.toString("utf8",i,end)}function utf8End(buf){var r=buf&&buf.length?this.write(buf):"";if(this.lastNeed)return r+"�";return r}function utf16Text(buf,i){if((buf.length-i)%2===0){var r=buf.toString("utf16le",i);if(r){var c=r.charCodeAt(r.length-1);if(c>=55296&&c<=56319){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=buf[buf.length-2];this.lastChar[1]=buf[buf.length-1];return r.slice(0,-1)}}return r}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=buf[buf.length-1];return buf.toString("utf16le",i,buf.length-1)}function utf16End(buf){var r=buf&&buf.length?this.write(buf):"";if(this.lastNeed){var end=this.lastTotal-this.lastNeed;return r+this.lastChar.toString("utf16le",0,end)}return r}function base64Text(buf,i){var n=(buf.length-i)%3;if(n===0)return buf.toString("base64",i);this.lastNeed=3-n;this.lastTotal=3;if(n===1){this.lastChar[0]=buf[buf.length-1]}else{this.lastChar[0]=buf[buf.length-2];this.lastChar[1]=buf[buf.length-1]}return buf.toString("base64",i,buf.length-n)}function base64End(buf){var r=buf&&buf.length?this.write(buf):"";if(this.lastNeed)return r+this.lastChar.toString("base64",0,3-this.lastNeed);return r}function simpleWrite(buf){return buf.toString(this.encoding)}function simpleEnd(buf){return buf&&buf.length?this.write(buf):""}},{"safe-buffer":187}],192:[function(require,module,exports){(function(setImmediate,clearImmediate){(function(){"use strict";var nextTick=require("process/browser.js").nextTick;var apply=Function.prototype.apply;var slice=Array.prototype.slice;var immediateIds={};var nextImmediateId=0;exports.setTimeout=function(){return new Timeout(apply.call(setTimeout,window,arguments),clearTimeout)};exports.setInterval=function(){return new Timeout(apply.call(setInterval,window,arguments),clearInterval)};exports.clearTimeout=exports.clearInterval=function(timeout){timeout.close()};function Timeout(id,clearFn){this._id=id;this._clearFn=clearFn}Timeout.prototype.unref=Timeout.prototype.ref=function(){};Timeout.prototype.close=function(){this._clearFn.call(window,this._id)};exports.enroll=function(item,msecs){clearTimeout(item._idleTimeoutId);item._idleTimeout=msecs};exports.unenroll=function(item){clearTimeout(item._idleTimeoutId);item._idleTimeout=-1};exports._unrefActive=exports.active=function(item){clearTimeout(item._idleTimeoutId);var msecs=item._idleTimeout;if(msecs>=0){item._idleTimeoutId=setTimeout((function onTimeout(){if(item._onTimeout)item._onTimeout()}),msecs)}};exports.setImmediate=typeof setImmediate==="function"?setImmediate:function(fn){var id=nextImmediateId++;var args=arguments.length<2?false:slice.call(arguments,1);immediateIds[id]=true;nextTick((function onNextTick(){if(immediateIds[id]){if(args){fn.apply(null,args)}else{fn.call(null)}exports.clearImmediate(id)}}));return id};exports.clearImmediate=typeof clearImmediate==="function"?clearImmediate:function(id){delete immediateIds[id]}}).call(this)}).call(this,require("timers").setImmediate,require("timers").clearImmediate)},{"process/browser.js":182,timers:192}],193:[function(require,module,exports){"use strict";var sizeof=require("js-sizeof");var TinyCache=function TinyCache(){this._cache={};this._timeouts={};this._hits=0;this._misses=0;this._size=0;return this};TinyCache.prototype={get size(){return this._size},get memsize(){return sizeof(this._cache)},get hits(){return this._hits},get misses(){return this._misses},put:function put(key,value,time){if(this._timeouts[key]){clearTimeout(this._timeouts[key]);delete this._timeouts[key]}this._cache[key]=value;if(!isNaN(time)){this._timeouts[key]=setTimeout(this.del.bind(this,key),time)}++this._size},get:function get(key){if(typeof key==="undefined"){return this._cache}if(!(key in this._cache)){++this._misses;return null}++this._hits;return this._cache[key]},del:function del(key){clearTimeout(this._timeouts[key]);delete this._timeouts[key];if(!(key in this._cache)){return false}delete this._cache[key];--this._size;return true},clear:function clear(){for(var key in this._timeouts){clearTimeout(this._timeouts[key])}this._cache={};this._timeouts={};this._size=0}};TinyCache.shared=new TinyCache;if(typeof module!=="undefined"&&module.exports){module.exports=TinyCache}else if(typeof define==="function"&&define.amd){define([],(function(){return TinyCache}))}else{window.TinyCache=TinyCache}},{"js-sizeof":137}],194:[function(require,module,exports){"use strict";var replace=String.prototype.replace;var percentTwenties=/%20/g;var Format={RFC1738:"RFC1738",RFC3986:"RFC3986"};module.exports={default:Format.RFC3986,formatters:{RFC1738:function RFC1738(value){return replace.call(value,percentTwenties,"+")},RFC3986:function RFC3986(value){return String(value)}},RFC1738:Format.RFC1738,RFC3986:Format.RFC3986}},{}],195:[function(require,module,exports){"use strict";var stringify=require("./stringify");var parse=require("./parse");var formats=require("./formats");module.exports={formats:formats,parse:parse,stringify:stringify}},{"./formats":194,"./parse":196,"./stringify":197}],196:[function(require,module,exports){"use strict";var utils=require("./utils");var has=Object.prototype.hasOwnProperty;var isArray=Array.isArray;var defaults={allowDots:false,allowPrototypes:false,allowSparse:false,arrayLimit:20,charset:"utf-8",charsetSentinel:false,comma:false,decoder:utils.decode,delimiter:"&",depth:5,ignoreQueryPrefix:false,interpretNumericEntities:false,parameterLimit:1e3,parseArrays:true,plainObjects:false,strictNullHandling:false};var interpretNumericEntities=function interpretNumericEntities(str){return str.replace(/&#(\d+);/g,(function($0,numberStr){return String.fromCharCode(parseInt(numberStr,10))}))};var parseArrayValue=function parseArrayValue(val,options){if(val&&typeof val==="string"&&options.comma&&val.indexOf(",")>-1){return val.split(",")}return val};var isoSentinel="utf8=%26%2310003%3B";var charsetSentinel="utf8=%E2%9C%93";var parseValues=function parseQueryStringValues(str,options){var obj={__proto__:null};var cleanStr=options.ignoreQueryPrefix?str.replace(/^\?/,""):str;var limit=options.parameterLimit===Infinity?undefined:options.parameterLimit;var parts=cleanStr.split(options.delimiter,limit);var skipIndex=-1;var i;var charset=options.charset;if(options.charsetSentinel){for(i=0;i<parts.length;++i){if(parts[i].indexOf("utf8=")===0){if(parts[i]===charsetSentinel){charset="utf-8"}else if(parts[i]===isoSentinel){charset="iso-8859-1"}skipIndex=i;i=parts.length}}}for(i=0;i<parts.length;++i){if(i===skipIndex){continue}var part=parts[i];var bracketEqualsPos=part.indexOf("]=");var pos=bracketEqualsPos===-1?part.indexOf("="):bracketEqualsPos+1;var key,val;if(pos===-1){key=options.decoder(part,defaults.decoder,charset,"key");val=options.strictNullHandling?null:""}else{key=options.decoder(part.slice(0,pos),defaults.decoder,charset,"key");val=utils.maybeMap(parseArrayValue(part.slice(pos+1),options),(function(encodedVal){return options.decoder(encodedVal,defaults.decoder,charset,"value")}))}if(val&&options.interpretNumericEntities&&charset==="iso-8859-1"){val=interpretNumericEntities(val)}if(part.indexOf("[]=")>-1){val=isArray(val)?[val]:val}if(has.call(obj,key)){obj[key]=utils.combine(obj[key],val)}else{obj[key]=val}}return obj};var parseObject=function parseObject(chain,val,options,valuesParsed){var leaf=valuesParsed?val:parseArrayValue(val,options);for(var i=chain.length-1;i>=0;--i){var obj;var root=chain[i];if(root==="[]"&&options.parseArrays){obj=[].concat(leaf)}else{obj=options.plainObjects?Object.create(null):{};var cleanRoot=root.charAt(0)==="["&&root.charAt(root.length-1)==="]"?root.slice(1,-1):root;var index=parseInt(cleanRoot,10);if(!options.parseArrays&&cleanRoot===""){obj={0:leaf}}else if(!isNaN(index)&&root!==cleanRoot&&String(index)===cleanRoot&&index>=0&&options.parseArrays&&index<=options.arrayLimit){obj=[];obj[index]=leaf}else if(cleanRoot!=="__proto__"){obj[cleanRoot]=leaf}}leaf=obj}return leaf};var parseKeys=function parseQueryStringKeys(givenKey,val,options,valuesParsed){if(!givenKey){return}var key=options.allowDots?givenKey.replace(/\.([^.[]+)/g,"[$1]"):givenKey;var brackets=/(\[[^[\]]*])/;var child=/(\[[^[\]]*])/g;var segment=options.depth>0&&brackets.exec(key);var parent=segment?key.slice(0,segment.index):key;var keys=[];if(parent){if(!options.plainObjects&&has.call(Object.prototype,parent)){if(!options.allowPrototypes){return}}keys.push(parent)}var i=0;while(options.depth>0&&(segment=child.exec(key))!==null&&i<options.depth){i+=1;if(!options.plainObjects&&has.call(Object.prototype,segment[1].slice(1,-1))){if(!options.allowPrototypes){return}}keys.push(segment[1])}if(segment){keys.push("["+key.slice(segment.index)+"]")}return parseObject(keys,val,options,valuesParsed)};var normalizeParseOptions=function normalizeParseOptions(opts){if(!opts){return defaults}if(opts.decoder!==null&&opts.decoder!==undefined&&typeof opts.decoder!=="function"){throw new TypeError("Decoder has to be a function.")}if(typeof opts.charset!=="undefined"&&opts.charset!=="utf-8"&&opts.charset!=="iso-8859-1"){throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined")}var charset=typeof opts.charset==="undefined"?defaults.charset:opts.charset;return{allowDots:typeof opts.allowDots==="undefined"?defaults.allowDots:!!opts.allowDots,allowPrototypes:typeof opts.allowPrototypes==="boolean"?opts.allowPrototypes:defaults.allowPrototypes,allowSparse:typeof opts.allowSparse==="boolean"?opts.allowSparse:defaults.allowSparse,arrayLimit:typeof opts.arrayLimit==="number"?opts.arrayLimit:defaults.arrayLimit,charset:charset,charsetSentinel:typeof opts.charsetSentinel==="boolean"?opts.charsetSentinel:defaults.charsetSentinel,comma:typeof opts.comma==="boolean"?opts.comma:defaults.comma,decoder:typeof opts.decoder==="function"?opts.decoder:defaults.decoder,delimiter:typeof opts.delimiter==="string"||utils.isRegExp(opts.delimiter)?opts.delimiter:defaults.delimiter,depth:typeof opts.depth==="number"||opts.depth===false?+opts.depth:defaults.depth,ignoreQueryPrefix:opts.ignoreQueryPrefix===true,interpretNumericEntities:typeof opts.interpretNumericEntities==="boolean"?opts.interpretNumericEntities:defaults.interpretNumericEntities,parameterLimit:typeof opts.parameterLimit==="number"?opts.parameterLimit:defaults.parameterLimit,parseArrays:opts.parseArrays!==false,plainObjects:typeof opts.plainObjects==="boolean"?opts.plainObjects:defaults.plainObjects,strictNullHandling:typeof opts.strictNullHandling==="boolean"?opts.strictNullHandling:defaults.strictNullHandling}};module.exports=function(str,opts){var options=normalizeParseOptions(opts);if(str===""||str===null||typeof str==="undefined"){return options.plainObjects?Object.create(null):{}}var tempObj=typeof str==="string"?parseValues(str,options):str;var obj=options.plainObjects?Object.create(null):{};var keys=Object.keys(tempObj);for(var i=0;i<keys.length;++i){var key=keys[i];var newObj=parseKeys(key,tempObj[key],options,typeof str==="string");obj=utils.merge(obj,newObj,options)}if(options.allowSparse===true){return obj}return utils.compact(obj)}},{"./utils":198}],197:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}var getSideChannel=require("side-channel");var utils=require("./utils");var formats=require("./formats");var has=Object.prototype.hasOwnProperty;var arrayPrefixGenerators={brackets:function brackets(prefix){return prefix+"[]"},comma:"comma",indices:function indices(prefix,key){return prefix+"["+key+"]"},repeat:function repeat(prefix){return prefix}};var isArray=Array.isArray;var push=Array.prototype.push;var pushToArray=function pushToArray(arr,valueOrArray){push.apply(arr,isArray(valueOrArray)?valueOrArray:[valueOrArray])};var toISO=Date.prototype.toISOString;var defaultFormat=formats["default"];var defaults={addQueryPrefix:false,allowDots:false,charset:"utf-8",charsetSentinel:false,delimiter:"&",encode:true,encoder:utils.encode,encodeValuesOnly:false,format:defaultFormat,formatter:formats.formatters[defaultFormat],indices:false,serializeDate:function serializeDate(date){return toISO.call(date)},skipNulls:false,strictNullHandling:false};var isNonNullishPrimitive=function isNonNullishPrimitive(v){return typeof v==="string"||typeof v==="number"||typeof v==="boolean"||_typeof(v)==="symbol"||typeof v==="bigint"};var sentinel={};var stringify=function stringify(object,prefix,generateArrayPrefix,commaRoundTrip,strictNullHandling,skipNulls,encoder,filter,sort,allowDots,serializeDate,format,formatter,encodeValuesOnly,charset,sideChannel){var obj=object;var tmpSc=sideChannel;var step=0;var findFlag=false;while((tmpSc=tmpSc.get(sentinel))!==void undefined&&!findFlag){var pos=tmpSc.get(object);step+=1;if(typeof pos!=="undefined"){if(pos===step){throw new RangeError("Cyclic object value")}else{findFlag=true}}if(typeof tmpSc.get(sentinel)==="undefined"){step=0}}if(typeof filter==="function"){obj=filter(prefix,obj)}else if(obj instanceof Date){obj=serializeDate(obj)}else if(generateArrayPrefix==="comma"&&isArray(obj)){obj=utils.maybeMap(obj,(function(value){if(value instanceof Date){return serializeDate(value)}return value}))}if(obj===null){if(strictNullHandling){return encoder&&!encodeValuesOnly?encoder(prefix,defaults.encoder,charset,"key",format):prefix}obj=""}if(isNonNullishPrimitive(obj)||utils.isBuffer(obj)){if(encoder){var keyValue=encodeValuesOnly?prefix:encoder(prefix,defaults.encoder,charset,"key",format);return[formatter(keyValue)+"="+formatter(encoder(obj,defaults.encoder,charset,"value",format))]}return[formatter(prefix)+"="+formatter(String(obj))]}var values=[];if(typeof obj==="undefined"){return values}var objKeys;if(generateArrayPrefix==="comma"&&isArray(obj)){if(encodeValuesOnly&&encoder){obj=utils.maybeMap(obj,encoder)}objKeys=[{value:obj.length>0?obj.join(",")||null:void undefined}]}else if(isArray(filter)){objKeys=filter}else{var keys=Object.keys(obj);objKeys=sort?keys.sort(sort):keys}var adjustedPrefix=commaRoundTrip&&isArray(obj)&&obj.length===1?prefix+"[]":prefix;for(var j=0;j<objKeys.length;++j){var key=objKeys[j];var value=_typeof(key)==="object"&&typeof key.value!=="undefined"?key.value:obj[key];if(skipNulls&&value===null){continue}var keyPrefix=isArray(obj)?typeof generateArrayPrefix==="function"?generateArrayPrefix(adjustedPrefix,key):adjustedPrefix:adjustedPrefix+(allowDots?"."+key:"["+key+"]");sideChannel.set(object,step);var valueSideChannel=getSideChannel();valueSideChannel.set(sentinel,sideChannel);pushToArray(values,stringify(value,keyPrefix,generateArrayPrefix,commaRoundTrip,strictNullHandling,skipNulls,generateArrayPrefix==="comma"&&encodeValuesOnly&&isArray(obj)?null:encoder,filter,sort,allowDots,serializeDate,format,formatter,encodeValuesOnly,charset,valueSideChannel))}return values};var normalizeStringifyOptions=function normalizeStringifyOptions(opts){if(!opts){return defaults}if(opts.encoder!==null&&typeof opts.encoder!=="undefined"&&typeof opts.encoder!=="function"){throw new TypeError("Encoder has to be a function.")}var charset=opts.charset||defaults.charset;if(typeof opts.charset!=="undefined"&&opts.charset!=="utf-8"&&opts.charset!=="iso-8859-1"){throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined")}var format=formats["default"];if(typeof opts.format!=="undefined"){if(!has.call(formats.formatters,opts.format)){throw new TypeError("Unknown format option provided.")}format=opts.format}var formatter=formats.formatters[format];var filter=defaults.filter;if(typeof opts.filter==="function"||isArray(opts.filter)){filter=opts.filter}return{addQueryPrefix:typeof opts.addQueryPrefix==="boolean"?opts.addQueryPrefix:defaults.addQueryPrefix,allowDots:typeof opts.allowDots==="undefined"?defaults.allowDots:!!opts.allowDots,charset:charset,charsetSentinel:typeof opts.charsetSentinel==="boolean"?opts.charsetSentinel:defaults.charsetSentinel,delimiter:typeof opts.delimiter==="undefined"?defaults.delimiter:opts.delimiter,encode:typeof opts.encode==="boolean"?opts.encode:defaults.encode,encoder:typeof opts.encoder==="function"?opts.encoder:defaults.encoder,encodeValuesOnly:typeof opts.encodeValuesOnly==="boolean"?opts.encodeValuesOnly:defaults.encodeValuesOnly,filter:filter,format:format,formatter:formatter,serializeDate:typeof opts.serializeDate==="function"?opts.serializeDate:defaults.serializeDate,skipNulls:typeof opts.skipNulls==="boolean"?opts.skipNulls:defaults.skipNulls,sort:typeof opts.sort==="function"?opts.sort:null,strictNullHandling:typeof opts.strictNullHandling==="boolean"?opts.strictNullHandling:defaults.strictNullHandling}};module.exports=function(object,opts){var obj=object;var options=normalizeStringifyOptions(opts);var objKeys;var filter;if(typeof options.filter==="function"){filter=options.filter;obj=filter("",obj)}else if(isArray(options.filter)){filter=options.filter;objKeys=filter}var keys=[];if(_typeof(obj)!=="object"||obj===null){return""}var arrayFormat;if(opts&&opts.arrayFormat in arrayPrefixGenerators){arrayFormat=opts.arrayFormat}else if(opts&&"indices"in opts){arrayFormat=opts.indices?"indices":"repeat"}else{arrayFormat="indices"}var generateArrayPrefix=arrayPrefixGenerators[arrayFormat];if(opts&&"commaRoundTrip"in opts&&typeof opts.commaRoundTrip!=="boolean"){throw new TypeError("`commaRoundTrip` must be a boolean, or absent")}var commaRoundTrip=generateArrayPrefix==="comma"&&opts&&opts.commaRoundTrip;if(!objKeys){objKeys=Object.keys(obj)}if(options.sort){objKeys.sort(options.sort)}var sideChannel=getSideChannel();for(var i=0;i<objKeys.length;++i){var key=objKeys[i];if(options.skipNulls&&obj[key]===null){continue}pushToArray(keys,stringify(obj[key],key,generateArrayPrefix,commaRoundTrip,options.strictNullHandling,options.skipNulls,options.encode?options.encoder:null,options.filter,options.sort,options.allowDots,options.serializeDate,options.format,options.formatter,options.encodeValuesOnly,options.charset,sideChannel))}var joined=keys.join(options.delimiter);var prefix=options.addQueryPrefix===true?"?":"";if(options.charsetSentinel){if(options.charset==="iso-8859-1"){prefix+="utf8=%26%2310003%3B&"}else{prefix+="utf8=%E2%9C%93&"}}return joined.length>0?prefix+joined:""}},{"./formats":194,"./utils":198,"side-channel":189}],198:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}var formats=require("./formats");var has=Object.prototype.hasOwnProperty;var isArray=Array.isArray;var hexTable=function(){var array=[];for(var i=0;i<256;++i){array.push("%"+((i<16?"0":"")+i.toString(16)).toUpperCase())}return array}();var compactQueue=function compactQueue(queue){while(queue.length>1){var item=queue.pop();var obj=item.obj[item.prop];if(isArray(obj)){var compacted=[];for(var j=0;j<obj.length;++j){if(typeof obj[j]!=="undefined"){compacted.push(obj[j])}}item.obj[item.prop]=compacted}}};var arrayToObject=function arrayToObject(source,options){var obj=options&&options.plainObjects?Object.create(null):{};for(var i=0;i<source.length;++i){if(typeof source[i]!=="undefined"){obj[i]=source[i]}}return obj};var merge=function merge(target,source,options){if(!source){return target}if(_typeof(source)!=="object"){if(isArray(target)){target.push(source)}else if(target&&_typeof(target)==="object"){if(options&&(options.plainObjects||options.allowPrototypes)||!has.call(Object.prototype,source)){target[source]=true}}else{return[target,source]}return target}if(!target||_typeof(target)!=="object"){return[target].concat(source)}var mergeTarget=target;if(isArray(target)&&!isArray(source)){mergeTarget=arrayToObject(target,options)}if(isArray(target)&&isArray(source)){source.forEach((function(item,i){if(has.call(target,i)){var targetItem=target[i];if(targetItem&&_typeof(targetItem)==="object"&&item&&_typeof(item)==="object"){target[i]=merge(targetItem,item,options)}else{target.push(item)}}else{target[i]=item}}));return target}return Object.keys(source).reduce((function(acc,key){var value=source[key];if(has.call(acc,key)){acc[key]=merge(acc[key],value,options)}else{acc[key]=value}return acc}),mergeTarget)};var assign=function assignSingleSource(target,source){return Object.keys(source).reduce((function(acc,key){acc[key]=source[key];return acc}),target)};var decode=function decode(str,decoder,charset){var strWithoutPlus=str.replace(/\+/g," ");if(charset==="iso-8859-1"){return strWithoutPlus.replace(/%[0-9a-f]{2}/gi,unescape)}try{return decodeURIComponent(strWithoutPlus)}catch(e){return strWithoutPlus}};var encode=function encode(str,defaultEncoder,charset,kind,format){if(str.length===0){return str}var string=str;if(_typeof(str)==="symbol"){string=Symbol.prototype.toString.call(str)}else if(typeof str!=="string"){string=String(str)}if(charset==="iso-8859-1"){return escape(string).replace(/%u[0-9a-f]{4}/gi,(function($0){return"%26%23"+parseInt($0.slice(2),16)+"%3B"}))}var out="";for(var i=0;i<string.length;++i){var c=string.charCodeAt(i);if(c===45||c===46||c===95||c===126||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||format===formats.RFC1738&&(c===40||c===41)){out+=string.charAt(i);continue}if(c<128){out=out+hexTable[c];continue}if(c<2048){out=out+(hexTable[192|c>>6]+hexTable[128|c&63]);continue}if(c<55296||c>=57344){out=out+(hexTable[224|c>>12]+hexTable[128|c>>6&63]+hexTable[128|c&63]);continue}i+=1;c=65536+((c&1023)<<10|string.charCodeAt(i)&1023);out+=hexTable[240|c>>18]+hexTable[128|c>>12&63]+hexTable[128|c>>6&63]+hexTable[128|c&63]}return out};var compact=function compact(value){var queue=[{obj:{o:value},prop:"o"}];var refs=[];for(var i=0;i<queue.length;++i){var item=queue[i];var obj=item.obj[item.prop];var keys=Object.keys(obj);for(var j=0;j<keys.length;++j){var key=keys[j];var val=obj[key];if(_typeof(val)==="object"&&val!==null&&refs.indexOf(val)===-1){queue.push({obj:obj,prop:key});refs.push(val)}}}compactQueue(queue);return value};var isRegExp=function isRegExp(obj){return Object.prototype.toString.call(obj)==="[object RegExp]"};var isBuffer=function isBuffer(obj){if(!obj||_typeof(obj)!=="object"){return false}return!!(obj.constructor&&obj.constructor.isBuffer&&obj.constructor.isBuffer(obj))};var combine=function combine(a,b){return[].concat(a,b)};var maybeMap=function maybeMap(val,fn){if(isArray(val)){var mapped=[];for(var i=0;i<val.length;i+=1){mapped.push(fn(val[i]))}return mapped}return fn(val)};module.exports={arrayToObject:arrayToObject,assign:assign,combine:combine,compact:compact,decode:decode,encode:encode,isBuffer:isBuffer,isRegExp:isRegExp,maybeMap:maybeMap,merge:merge}},{"./formats":194}],199:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}var punycode=require("punycode");function Url(){this.protocol=null;this.slashes=null;this.auth=null;this.host=null;this.port=null;this.hostname=null;this.hash=null;this.search=null;this.query=null;this.pathname=null;this.path=null;this.href=null}var protocolPattern=/^([a-z0-9.+-]+:)/i,portPattern=/:[0-9]*$/,simplePathPattern=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,delims=["<",">",'"',"`"," ","\r","\n","\t"],unwise=["{","}","|","\\","^","`"].concat(delims),autoEscape=["'"].concat(unwise),nonHostChars=["%","/","?",";","#"].concat(autoEscape),hostEndingChars=["/","?","#"],hostnameMaxLen=255,hostnamePartPattern=/^[+a-z0-9A-Z_-]{0,63}$/,hostnamePartStart=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,unsafeProtocol={javascript:true,"javascript:":true},hostlessProtocol={javascript:true,"javascript:":true},slashedProtocol={http:true,https:true,ftp:true,gopher:true,file:true,"http:":true,"https:":true,"ftp:":true,"gopher:":true,"file:":true},querystring=require("qs");function urlParse(url,parseQueryString,slashesDenoteHost){if(url&&_typeof(url)==="object"&&url instanceof Url){return url}var u=new Url;u.parse(url,parseQueryString,slashesDenoteHost);return u}Url.prototype.parse=function(url,parseQueryString,slashesDenoteHost){if(typeof url!=="string"){throw new TypeError("Parameter 'url' must be a string, not "+_typeof(url))}var queryIndex=url.indexOf("?"),splitter=queryIndex!==-1&&queryIndex<url.indexOf("#")?"?":"#",uSplit=url.split(splitter),slashRegex=/\\/g;uSplit[0]=uSplit[0].replace(slashRegex,"/");url=uSplit.join(splitter);var rest=url;rest=rest.trim();if(!slashesDenoteHost&&url.split("#").length===1){var simplePath=simplePathPattern.exec(rest);if(simplePath){this.path=rest;this.href=rest;this.pathname=simplePath[1];if(simplePath[2]){this.search=simplePath[2];if(parseQueryString){this.query=querystring.parse(this.search.substr(1))}else{this.query=this.search.substr(1)}}else if(parseQueryString){this.search="";this.query={}}return this}}var proto=protocolPattern.exec(rest);if(proto){proto=proto[0];var lowerProto=proto.toLowerCase();this.protocol=lowerProto;rest=rest.substr(proto.length)}if(slashesDenoteHost||proto||rest.match(/^\/\/[^@/]+@[^@/]+/)){var slashes=rest.substr(0,2)==="//";if(slashes&&!(proto&&hostlessProtocol[proto])){rest=rest.substr(2);this.slashes=true}}if(!hostlessProtocol[proto]&&(slashes||proto&&!slashedProtocol[proto])){var hostEnd=-1;for(var i=0;i<hostEndingChars.length;i++){var hec=rest.indexOf(hostEndingChars[i]);if(hec!==-1&&(hostEnd===-1||hec<hostEnd)){hostEnd=hec}}var auth,atSign;if(hostEnd===-1){atSign=rest.lastIndexOf("@")}else{atSign=rest.lastIndexOf("@",hostEnd)}if(atSign!==-1){auth=rest.slice(0,atSign);rest=rest.slice(atSign+1);this.auth=decodeURIComponent(auth)}hostEnd=-1;for(var i=0;i<nonHostChars.length;i++){var hec=rest.indexOf(nonHostChars[i]);if(hec!==-1&&(hostEnd===-1||hec<hostEnd)){hostEnd=hec}}if(hostEnd===-1){hostEnd=rest.length}this.host=rest.slice(0,hostEnd);rest=rest.slice(hostEnd);this.parseHost();this.hostname=this.hostname||"";var ipv6Hostname=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!ipv6Hostname){var hostparts=this.hostname.split(/\./);for(var i=0,l=hostparts.length;i<l;i++){var part=hostparts[i];if(!part){continue}if(!part.match(hostnamePartPattern)){var newpart="";for(var j=0,k=part.length;j<k;j++){if(part.charCodeAt(j)>127){newpart+="x"}else{newpart+=part[j]}}if(!newpart.match(hostnamePartPattern)){var validParts=hostparts.slice(0,i);var notHost=hostparts.slice(i+1);var bit=part.match(hostnamePartStart);if(bit){validParts.push(bit[1]);notHost.unshift(bit[2])}if(notHost.length){rest="/"+notHost.join(".")+rest}this.hostname=validParts.join(".");break}}}}if(this.hostname.length>hostnameMaxLen){this.hostname=""}else{this.hostname=this.hostname.toLowerCase()}if(!ipv6Hostname){this.hostname=punycode.toASCII(this.hostname)}var p=this.port?":"+this.port:"";var h=this.hostname||"";this.host=h+p;this.href+=this.host;if(ipv6Hostname){this.hostname=this.hostname.substr(1,this.hostname.length-2);if(rest[0]!=="/"){rest="/"+rest}}}if(!unsafeProtocol[lowerProto]){for(var i=0,l=autoEscape.length;i<l;i++){var ae=autoEscape[i];if(rest.indexOf(ae)===-1){continue}var esc=encodeURIComponent(ae);if(esc===ae){esc=escape(ae)}rest=rest.split(ae).join(esc)}}var hash=rest.indexOf("#");if(hash!==-1){this.hash=rest.substr(hash);rest=rest.slice(0,hash)}var qm=rest.indexOf("?");if(qm!==-1){this.search=rest.substr(qm);this.query=rest.substr(qm+1);if(parseQueryString){this.query=querystring.parse(this.query)}rest=rest.slice(0,qm)}else if(parseQueryString){this.search="";this.query={}}if(rest){this.pathname=rest}if(slashedProtocol[lowerProto]&&this.hostname&&!this.pathname){this.pathname="/"}if(this.pathname||this.search){var p=this.pathname||"";var s=this.search||"";this.path=p+s}this.href=this.format();return this};function urlFormat(obj){if(typeof obj==="string"){obj=urlParse(obj)}if(!(obj instanceof Url)){return Url.prototype.format.call(obj)}return obj.format()}Url.prototype.format=function(){var auth=this.auth||"";if(auth){auth=encodeURIComponent(auth);auth=auth.replace(/%3A/i,":");auth+="@"}var protocol=this.protocol||"",pathname=this.pathname||"",hash=this.hash||"",host=false,query="";if(this.host){host=auth+this.host}else if(this.hostname){host=auth+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]");if(this.port){host+=":"+this.port}}if(this.query&&_typeof(this.query)==="object"&&Object.keys(this.query).length){query=querystring.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:false})}var search=this.search||query&&"?"+query||"";if(protocol&&protocol.substr(-1)!==":"){protocol+=":"}if(this.slashes||(!protocol||slashedProtocol[protocol])&&host!==false){host="//"+(host||"");if(pathname&&pathname.charAt(0)!=="/"){pathname="/"+pathname}}else if(!host){host=""}if(hash&&hash.charAt(0)!=="#"){hash="#"+hash}if(search&&search.charAt(0)!=="?"){search="?"+search}pathname=pathname.replace(/[?#]/g,(function(match){return encodeURIComponent(match)}));search=search.replace("#","%23");return protocol+host+pathname+search+hash};function urlResolve(source,relative){return urlParse(source,false,true).resolve(relative)}Url.prototype.resolve=function(relative){return this.resolveObject(urlParse(relative,false,true)).format()};function urlResolveObject(source,relative){if(!source){return relative}return urlParse(source,false,true).resolveObject(relative)}Url.prototype.resolveObject=function(relative){if(typeof relative==="string"){var rel=new Url;rel.parse(relative,false,true);relative=rel}var result=new Url;var tkeys=Object.keys(this);for(var tk=0;tk<tkeys.length;tk++){var tkey=tkeys[tk];result[tkey]=this[tkey]}result.hash=relative.hash;if(relative.href===""){result.href=result.format();return result}if(relative.slashes&&!relative.protocol){var rkeys=Object.keys(relative);for(var rk=0;rk<rkeys.length;rk++){var rkey=rkeys[rk];if(rkey!=="protocol"){result[rkey]=relative[rkey]}}if(slashedProtocol[result.protocol]&&result.hostname&&!result.pathname){result.pathname="/";result.path=result.pathname}result.href=result.format();return result}if(relative.protocol&&relative.protocol!==result.protocol){if(!slashedProtocol[relative.protocol]){var keys=Object.keys(relative);for(var v=0;v<keys.length;v++){var k=keys[v];result[k]=relative[k]}result.href=result.format();return result}result.protocol=relative.protocol;if(!relative.host&&!hostlessProtocol[relative.protocol]){var relPath=(relative.pathname||"").split("/");while(relPath.length&&!(relative.host=relPath.shift())){}if(!relative.host){relative.host=""}if(!relative.hostname){relative.hostname=""}if(relPath[0]!==""){relPath.unshift("")}if(relPath.length<2){relPath.unshift("")}result.pathname=relPath.join("/")}else{result.pathname=relative.pathname}result.search=relative.search;result.query=relative.query;result.host=relative.host||"";result.auth=relative.auth;result.hostname=relative.hostname||relative.host;result.port=relative.port;if(result.pathname||result.search){var p=result.pathname||"";var s=result.search||"";result.path=p+s}result.slashes=result.slashes||relative.slashes;result.href=result.format();return result}var isSourceAbs=result.pathname&&result.pathname.charAt(0)==="/",isRelAbs=relative.host||relative.pathname&&relative.pathname.charAt(0)==="/",mustEndAbs=isRelAbs||isSourceAbs||result.host&&relative.pathname,removeAllDots=mustEndAbs,srcPath=result.pathname&&result.pathname.split("/")||[],relPath=relative.pathname&&relative.pathname.split("/")||[],psychotic=result.protocol&&!slashedProtocol[result.protocol];if(psychotic){result.hostname="";result.port=null;if(result.host){if(srcPath[0]===""){srcPath[0]=result.host}else{srcPath.unshift(result.host)}}result.host="";if(relative.protocol){relative.hostname=null;relative.port=null;if(relative.host){if(relPath[0]===""){relPath[0]=relative.host}else{relPath.unshift(relative.host)}}relative.host=null}mustEndAbs=mustEndAbs&&(relPath[0]===""||srcPath[0]==="")}if(isRelAbs){result.host=relative.host||relative.host===""?relative.host:result.host;result.hostname=relative.hostname||relative.hostname===""?relative.hostname:result.hostname;result.search=relative.search;result.query=relative.query;srcPath=relPath}else if(relPath.length){if(!srcPath){srcPath=[]}srcPath.pop();srcPath=srcPath.concat(relPath);result.search=relative.search;result.query=relative.query}else if(relative.search!=null){if(psychotic){result.host=srcPath.shift();result.hostname=result.host;var authInHost=result.host&&result.host.indexOf("@")>0?result.host.split("@"):false;if(authInHost){result.auth=authInHost.shift();result.hostname=authInHost.shift();result.host=result.hostname}}result.search=relative.search;result.query=relative.query;if(result.pathname!==null||result.search!==null){result.path=(result.pathname?result.pathname:"")+(result.search?result.search:"")}result.href=result.format();return result}if(!srcPath.length){result.pathname=null;if(result.search){result.path="/"+result.search}else{result.path=null}result.href=result.format();return result}var last=srcPath.slice(-1)[0];var hasTrailingSlash=(result.host||relative.host||srcPath.length>1)&&(last==="."||last==="..")||last==="";var up=0;for(var i=srcPath.length;i>=0;i--){last=srcPath[i];if(last==="."){srcPath.splice(i,1)}else if(last===".."){srcPath.splice(i,1);up++}else if(up){srcPath.splice(i,1);up--}}if(!mustEndAbs&&!removeAllDots){for(;up--;up){srcPath.unshift("..")}}if(mustEndAbs&&srcPath[0]!==""&&(!srcPath[0]||srcPath[0].charAt(0)!=="/")){srcPath.unshift("")}if(hasTrailingSlash&&srcPath.join("/").substr(-1)!=="/"){srcPath.push("")}var isAbsolute=srcPath[0]===""||srcPath[0]&&srcPath[0].charAt(0)==="/";if(psychotic){result.hostname=isAbsolute?"":srcPath.length?srcPath.shift():"";result.host=result.hostname;var authInHost=result.host&&result.host.indexOf("@")>0?result.host.split("@"):false;if(authInHost){result.auth=authInHost.shift();result.hostname=authInHost.shift();result.host=result.hostname}}mustEndAbs=mustEndAbs||result.host&&srcPath.length;if(mustEndAbs&&!isAbsolute){srcPath.unshift("")}if(srcPath.length>0){result.pathname=srcPath.join("/")}else{result.pathname=null;result.path=null}if(result.pathname!==null||result.search!==null){result.path=(result.pathname?result.pathname:"")+(result.search?result.search:"")}result.auth=relative.auth||result.auth;result.slashes=result.slashes||relative.slashes;result.href=result.format();return result};Url.prototype.parseHost=function(){var host=this.host;var port=portPattern.exec(host);if(port){port=port[0];if(port!==":"){this.port=port.substr(1)}host=host.substr(0,host.length-port.length)}if(host){this.hostname=host}};exports.parse=urlParse;exports.resolve=urlResolve;exports.resolveObject=urlResolveObject;exports.format=urlFormat;exports.Url=Url},{punycode:183,qs:195}],200:[function(require,module,exports){(function(global){(function(){"use strict";module.exports=deprecate;function deprecate(fn,msg){if(config("noDeprecation")){return fn}var warned=false;function deprecated(){if(!warned){if(config("throwDeprecation")){throw new Error(msg)}else if(config("traceDeprecation")){console.trace(msg)}else{console.warn(msg)}warned=true}return fn.apply(this,arguments)}return deprecated}function config(name){try{if(!global.localStorage)return false}catch(_){return false}var val=global.localStorage[name];if(null==val)return false;return String(val).toLowerCase()==="true"}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],201:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}module.exports=function isBuffer(arg){return arg&&_typeof(arg)==="object"&&typeof arg.copy==="function"&&typeof arg.fill==="function"&&typeof arg.readUInt8==="function"}},{}],202:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}var isArgumentsObject=require("is-arguments");var isGeneratorFunction=require("is-generator-function");var whichTypedArray=require("which-typed-array");var isTypedArray=require("is-typed-array");function uncurryThis(f){return f.call.bind(f)}var BigIntSupported=typeof BigInt!=="undefined";var SymbolSupported=typeof Symbol!=="undefined";var ObjectToString=uncurryThis(Object.prototype.toString);var numberValue=uncurryThis(Number.prototype.valueOf);var stringValue=uncurryThis(String.prototype.valueOf);var booleanValue=uncurryThis(Boolean.prototype.valueOf);if(BigIntSupported){var bigIntValue=uncurryThis(BigInt.prototype.valueOf)}if(SymbolSupported){var symbolValue=uncurryThis(Symbol.prototype.valueOf)}function checkBoxedPrimitive(value,prototypeValueOf){if(_typeof(value)!=="object"){return false}try{prototypeValueOf(value);return true}catch(e){return false}}exports.isArgumentsObject=isArgumentsObject;exports.isGeneratorFunction=isGeneratorFunction;exports.isTypedArray=isTypedArray;function isPromise(input){return typeof Promise!=="undefined"&&input instanceof Promise||input!==null&&_typeof(input)==="object"&&typeof input.then==="function"&&typeof input["catch"]==="function"}exports.isPromise=isPromise;function isArrayBufferView(value){if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView){return ArrayBuffer.isView(value)}return isTypedArray(value)||isDataView(value)}exports.isArrayBufferView=isArrayBufferView;function isUint8Array(value){return whichTypedArray(value)==="Uint8Array"}exports.isUint8Array=isUint8Array;function isUint8ClampedArray(value){return whichTypedArray(value)==="Uint8ClampedArray"}exports.isUint8ClampedArray=isUint8ClampedArray;function isUint16Array(value){return whichTypedArray(value)==="Uint16Array"}exports.isUint16Array=isUint16Array;function isUint32Array(value){return whichTypedArray(value)==="Uint32Array"}exports.isUint32Array=isUint32Array;function isInt8Array(value){return whichTypedArray(value)==="Int8Array"}exports.isInt8Array=isInt8Array;function isInt16Array(value){return whichTypedArray(value)==="Int16Array"}exports.isInt16Array=isInt16Array;function isInt32Array(value){return whichTypedArray(value)==="Int32Array"}exports.isInt32Array=isInt32Array;function isFloat32Array(value){return whichTypedArray(value)==="Float32Array"}exports.isFloat32Array=isFloat32Array;function isFloat64Array(value){return whichTypedArray(value)==="Float64Array"}exports.isFloat64Array=isFloat64Array;function isBigInt64Array(value){return whichTypedArray(value)==="BigInt64Array"}exports.isBigInt64Array=isBigInt64Array;function isBigUint64Array(value){return whichTypedArray(value)==="BigUint64Array"}exports.isBigUint64Array=isBigUint64Array;function isMapToString(value){return ObjectToString(value)==="[object Map]"}isMapToString.working=typeof Map!=="undefined"&&isMapToString(new Map);function isMap(value){if(typeof Map==="undefined"){return false}return isMapToString.working?isMapToString(value):value instanceof Map}exports.isMap=isMap;function isSetToString(value){return ObjectToString(value)==="[object Set]"}isSetToString.working=typeof Set!=="undefined"&&isSetToString(new Set);function isSet(value){if(typeof Set==="undefined"){return false}return isSetToString.working?isSetToString(value):value instanceof Set}exports.isSet=isSet;function isWeakMapToString(value){return ObjectToString(value)==="[object WeakMap]"}isWeakMapToString.working=typeof WeakMap!=="undefined"&&isWeakMapToString(new WeakMap);function isWeakMap(value){if(typeof WeakMap==="undefined"){return false}return isWeakMapToString.working?isWeakMapToString(value):value instanceof WeakMap}exports.isWeakMap=isWeakMap;function isWeakSetToString(value){return ObjectToString(value)==="[object WeakSet]"}isWeakSetToString.working=typeof WeakSet!=="undefined"&&isWeakSetToString(new WeakSet);function isWeakSet(value){return isWeakSetToString(value)}exports.isWeakSet=isWeakSet;function isArrayBufferToString(value){return ObjectToString(value)==="[object ArrayBuffer]"}isArrayBufferToString.working=typeof ArrayBuffer!=="undefined"&&isArrayBufferToString(new ArrayBuffer);function isArrayBuffer(value){if(typeof ArrayBuffer==="undefined"){return false}return isArrayBufferToString.working?isArrayBufferToString(value):value instanceof ArrayBuffer}exports.isArrayBuffer=isArrayBuffer;function isDataViewToString(value){return ObjectToString(value)==="[object DataView]"}isDataViewToString.working=typeof ArrayBuffer!=="undefined"&&typeof DataView!=="undefined"&&isDataViewToString(new DataView(new ArrayBuffer(1),0,1));function isDataView(value){if(typeof DataView==="undefined"){return false}return isDataViewToString.working?isDataViewToString(value):value instanceof DataView}exports.isDataView=isDataView;var SharedArrayBufferCopy=typeof SharedArrayBuffer!=="undefined"?SharedArrayBuffer:undefined;function isSharedArrayBufferToString(value){return ObjectToString(value)==="[object SharedArrayBuffer]"}function isSharedArrayBuffer(value){if(typeof SharedArrayBufferCopy==="undefined"){return false}if(typeof isSharedArrayBufferToString.working==="undefined"){isSharedArrayBufferToString.working=isSharedArrayBufferToString(new SharedArrayBufferCopy)}return isSharedArrayBufferToString.working?isSharedArrayBufferToString(value):value instanceof SharedArrayBufferCopy}exports.isSharedArrayBuffer=isSharedArrayBuffer;function isAsyncFunction(value){return ObjectToString(value)==="[object AsyncFunction]"}exports.isAsyncFunction=isAsyncFunction;function isMapIterator(value){return ObjectToString(value)==="[object Map Iterator]"}exports.isMapIterator=isMapIterator;function isSetIterator(value){return ObjectToString(value)==="[object Set Iterator]"}exports.isSetIterator=isSetIterator;function isGeneratorObject(value){return ObjectToString(value)==="[object Generator]"}exports.isGeneratorObject=isGeneratorObject;function isWebAssemblyCompiledModule(value){return ObjectToString(value)==="[object WebAssembly.Module]"}exports.isWebAssemblyCompiledModule=isWebAssemblyCompiledModule;function isNumberObject(value){return checkBoxedPrimitive(value,numberValue)}exports.isNumberObject=isNumberObject;function isStringObject(value){return checkBoxedPrimitive(value,stringValue)}exports.isStringObject=isStringObject;function isBooleanObject(value){return checkBoxedPrimitive(value,booleanValue)}exports.isBooleanObject=isBooleanObject;function isBigIntObject(value){return BigIntSupported&&checkBoxedPrimitive(value,bigIntValue)}exports.isBigIntObject=isBigIntObject;function isSymbolObject(value){return SymbolSupported&&checkBoxedPrimitive(value,symbolValue)}exports.isSymbolObject=isSymbolObject;function isBoxedPrimitive(value){return isNumberObject(value)||isStringObject(value)||isBooleanObject(value)||isBigIntObject(value)||isSymbolObject(value)}exports.isBoxedPrimitive=isBoxedPrimitive;function isAnyArrayBuffer(value){return typeof Uint8Array!=="undefined"&&(isArrayBuffer(value)||isSharedArrayBuffer(value))}exports.isAnyArrayBuffer=isAnyArrayBuffer;["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(method){Object.defineProperty(exports,method,{enumerable:false,value:function value(){throw new Error(method+" is not supported in userland")}})}))},{"is-arguments":112,"is-generator-function":115,"is-typed-array":116,"which-typed-array":220}],203:[function(require,module,exports){(function(process){(function(){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}var getOwnPropertyDescriptors=Object.getOwnPropertyDescriptors||function getOwnPropertyDescriptors(obj){var keys=Object.keys(obj);var descriptors={};for(var i=0;i<keys.length;i++){descriptors[keys[i]]=Object.getOwnPropertyDescriptor(obj,keys[i])}return descriptors};var formatRegExp=/%[sdj%]/g;exports.format=function(f){if(!isString(f)){var objects=[];for(var i=0;i<arguments.length;i++){objects.push(inspect(arguments[i]))}return objects.join(" ")}var i=1;var args=arguments;var len=args.length;var str=String(f).replace(formatRegExp,(function(x){if(x==="%%")return"%";if(i>=len)return x;switch(x){case"%s":return String(args[i++]);case"%d":return Number(args[i++]);case"%j":try{return JSON.stringify(args[i++])}catch(_){return"[Circular]"}default:return x}}));for(var x=args[i];i<len;x=args[++i]){if(isNull(x)||!isObject(x)){str+=" "+x}else{str+=" "+inspect(x)}}return str};exports.deprecate=function(fn,msg){if(typeof process!=="undefined"&&process.noDeprecation===true){return fn}if(typeof process==="undefined"){return function(){return exports.deprecate(fn,msg).apply(this,arguments)}}var warned=false;function deprecated(){if(!warned){if(process.throwDeprecation){throw new Error(msg)}else if(process.traceDeprecation){console.trace(msg)}else{console.error(msg)}warned=true}return fn.apply(this,arguments)}return deprecated};var debugs={};var debugEnvRegex=/^$/;if(process.env.NODE_DEBUG){var debugEnv=process.env.NODE_DEBUG;debugEnv=debugEnv.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase();debugEnvRegex=new RegExp("^"+debugEnv+"$","i")}exports.debuglog=function(set){set=set.toUpperCase();if(!debugs[set]){if(debugEnvRegex.test(set)){var pid=process.pid;debugs[set]=function(){var msg=exports.format.apply(exports,arguments);console.error("%s %d: %s",set,pid,msg)}}else{debugs[set]=function(){}}}return debugs[set]};function inspect(obj,opts){var ctx={seen:[],stylize:stylizeNoColor};if(arguments.length>=3)ctx.depth=arguments[2];if(arguments.length>=4)ctx.colors=arguments[3];if(isBoolean(opts)){ctx.showHidden=opts}else if(opts){exports._extend(ctx,opts)}if(isUndefined(ctx.showHidden))ctx.showHidden=false;if(isUndefined(ctx.depth))ctx.depth=2;if(isUndefined(ctx.colors))ctx.colors=false;if(isUndefined(ctx.customInspect))ctx.customInspect=true;if(ctx.colors)ctx.stylize=stylizeWithColor;return formatValue(ctx,obj,ctx.depth)}exports.inspect=inspect;inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};inspect.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function stylizeWithColor(str,styleType){var style=inspect.styles[styleType];if(style){return"["+inspect.colors[style][0]+"m"+str+"["+inspect.colors[style][1]+"m"}else{return str}}function stylizeNoColor(str,styleType){return str}function arrayToHash(array){var hash={};array.forEach((function(val,idx){hash[val]=true}));return hash}function formatValue(ctx,value,recurseTimes){if(ctx.customInspect&&value&&isFunction(value.inspect)&&value.inspect!==exports.inspect&&!(value.constructor&&value.constructor.prototype===value)){var ret=value.inspect(recurseTimes,ctx);if(!isString(ret)){ret=formatValue(ctx,ret,recurseTimes)}return ret}var primitive=formatPrimitive(ctx,value);if(primitive){return primitive}var keys=Object.keys(value);var visibleKeys=arrayToHash(keys);if(ctx.showHidden){keys=Object.getOwnPropertyNames(value)}if(isError(value)&&(keys.indexOf("message")>=0||keys.indexOf("description")>=0)){return formatError(value)}if(keys.length===0){if(isFunction(value)){var name=value.name?": "+value.name:"";return ctx.stylize("[Function"+name+"]","special")}if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}if(isDate(value)){return ctx.stylize(Date.prototype.toString.call(value),"date")}if(isError(value)){return formatError(value)}}var base="",array=false,braces=["{","}"];if(isArray(value)){array=true;braces=["[","]"]}if(isFunction(value)){var n=value.name?": "+value.name:"";base=" [Function"+n+"]"}if(isRegExp(value)){base=" "+RegExp.prototype.toString.call(value)}if(isDate(value)){base=" "+Date.prototype.toUTCString.call(value)}if(isError(value)){base=" "+formatError(value)}if(keys.length===0&&(!array||value.length==0)){return braces[0]+base+braces[1]}if(recurseTimes<0){if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}else{return ctx.stylize("[Object]","special")}}ctx.seen.push(value);var output;if(array){output=formatArray(ctx,value,recurseTimes,visibleKeys,keys)}else{output=keys.map((function(key){return formatProperty(ctx,value,recurseTimes,visibleKeys,key,array)}))}ctx.seen.pop();return reduceToSingleString(output,base,braces)}function formatPrimitive(ctx,value){if(isUndefined(value))return ctx.stylize("undefined","undefined");if(isString(value)){var simple="'"+JSON.stringify(value).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return ctx.stylize(simple,"string")}if(isNumber(value))return ctx.stylize(""+value,"number");if(isBoolean(value))return ctx.stylize(""+value,"boolean");if(isNull(value))return ctx.stylize("null","null")}function formatError(value){return"["+Error.prototype.toString.call(value)+"]"}function formatArray(ctx,value,recurseTimes,visibleKeys,keys){var output=[];for(var i=0,l=value.length;i<l;++i){if(hasOwnProperty(value,String(i))){output.push(formatProperty(ctx,value,recurseTimes,visibleKeys,String(i),true))}else{output.push("")}}keys.forEach((function(key){if(!key.match(/^\d+$/)){output.push(formatProperty(ctx,value,recurseTimes,visibleKeys,key,true))}}));return output}function formatProperty(ctx,value,recurseTimes,visibleKeys,key,array){var name,str,desc;desc=Object.getOwnPropertyDescriptor(value,key)||{value:value[key]};if(desc.get){if(desc.set){str=ctx.stylize("[Getter/Setter]","special")}else{str=ctx.stylize("[Getter]","special")}}else{if(desc.set){str=ctx.stylize("[Setter]","special")}}if(!hasOwnProperty(visibleKeys,key)){name="["+key+"]"}if(!str){if(ctx.seen.indexOf(desc.value)<0){if(isNull(recurseTimes)){str=formatValue(ctx,desc.value,null)}else{str=formatValue(ctx,desc.value,recurseTimes-1)}if(str.indexOf("\n")>-1){if(array){str=str.split("\n").map((function(line){return" "+line})).join("\n").slice(2)}else{str="\n"+str.split("\n").map((function(line){return" "+line})).join("\n")}}}else{str=ctx.stylize("[Circular]","special")}}if(isUndefined(name)){if(array&&key.match(/^\d+$/)){return str}name=JSON.stringify(""+key);if(name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){name=name.slice(1,-1);name=ctx.stylize(name,"name")}else{name=name.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");name=ctx.stylize(name,"string")}}return name+": "+str}function reduceToSingleString(output,base,braces){var numLinesEst=0;var length=output.reduce((function(prev,cur){numLinesEst++;if(cur.indexOf("\n")>=0)numLinesEst++;return prev+cur.replace(/\u001b\[\d\d?m/g,"").length+1}),0);if(length>60){return braces[0]+(base===""?"":base+"\n ")+" "+output.join(",\n ")+" "+braces[1]}return braces[0]+base+" "+output.join(", ")+" "+braces[1]}exports.types=require("./support/types");function isArray(ar){return Array.isArray(ar)}exports.isArray=isArray;function isBoolean(arg){return typeof arg==="boolean"}exports.isBoolean=isBoolean;function isNull(arg){return arg===null}exports.isNull=isNull;function isNullOrUndefined(arg){return arg==null}exports.isNullOrUndefined=isNullOrUndefined;function isNumber(arg){return typeof arg==="number"}exports.isNumber=isNumber;function isString(arg){return typeof arg==="string"}exports.isString=isString;function isSymbol(arg){return _typeof(arg)==="symbol"}exports.isSymbol=isSymbol;function isUndefined(arg){return arg===void 0}exports.isUndefined=isUndefined;function isRegExp(re){return isObject(re)&&objectToString(re)==="[object RegExp]"}exports.isRegExp=isRegExp;exports.types.isRegExp=isRegExp;function isObject(arg){return _typeof(arg)==="object"&&arg!==null}exports.isObject=isObject;function isDate(d){return isObject(d)&&objectToString(d)==="[object Date]"}exports.isDate=isDate;exports.types.isDate=isDate;function isError(e){return isObject(e)&&(objectToString(e)==="[object Error]"||e instanceof Error)}exports.isError=isError;exports.types.isNativeError=isError;function isFunction(arg){return typeof arg==="function"}exports.isFunction=isFunction;function isPrimitive(arg){return arg===null||typeof arg==="boolean"||typeof arg==="number"||typeof arg==="string"||_typeof(arg)==="symbol"||typeof arg==="undefined"}exports.isPrimitive=isPrimitive;exports.isBuffer=require("./support/isBuffer");function objectToString(o){return Object.prototype.toString.call(o)}function pad(n){return n<10?"0"+n.toString(10):n.toString(10)}var months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function timestamp(){var d=new Date;var time=[pad(d.getHours()),pad(d.getMinutes()),pad(d.getSeconds())].join(":");return[d.getDate(),months[d.getMonth()],time].join(" ")}exports.log=function(){console.log("%s - %s",timestamp(),exports.format.apply(exports,arguments))};exports.inherits=require("inherits");exports._extend=function(origin,add){if(!add||!isObject(add))return origin;var keys=Object.keys(add);var i=keys.length;while(i--){origin[keys[i]]=add[keys[i]]}return origin};function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}var kCustomPromisifiedSymbol=typeof Symbol!=="undefined"?Symbol("util.promisify.custom"):undefined;exports.promisify=function promisify(original){if(typeof original!=="function")throw new TypeError('The "original" argument must be of type Function');if(kCustomPromisifiedSymbol&&original[kCustomPromisifiedSymbol]){var fn=original[kCustomPromisifiedSymbol];if(typeof fn!=="function"){throw new TypeError('The "util.promisify.custom" argument must be of type Function')}Object.defineProperty(fn,kCustomPromisifiedSymbol,{value:fn,enumerable:false,writable:false,configurable:true});return fn}function fn(){var promiseResolve,promiseReject;var promise=new Promise((function(resolve,reject){promiseResolve=resolve;promiseReject=reject}));var args=[];for(var i=0;i<arguments.length;i++){args.push(arguments[i])}args.push((function(err,value){if(err){promiseReject(err)}else{promiseResolve(value)}}));try{original.apply(this,args)}catch(err){promiseReject(err)}return promise}Object.setPrototypeOf(fn,Object.getPrototypeOf(original));if(kCustomPromisifiedSymbol)Object.defineProperty(fn,kCustomPromisifiedSymbol,{value:fn,enumerable:false,writable:false,configurable:true});return Object.defineProperties(fn,getOwnPropertyDescriptors(original))};exports.promisify.custom=kCustomPromisifiedSymbol;function callbackifyOnRejected(reason,cb){if(!reason){var newReason=new Error("Promise was rejected with a falsy value");newReason.reason=reason;reason=newReason}return cb(reason)}function callbackify(original){if(typeof original!=="function"){throw new TypeError('The "original" argument must be of type Function')}function callbackified(){var args=[];for(var i=0;i<arguments.length;i++){args.push(arguments[i])}var maybeCb=args.pop();if(typeof maybeCb!=="function"){throw new TypeError("The last argument must be of type Function")}var self=this;var cb=function cb(){return maybeCb.apply(self,arguments)};original.apply(this,args).then((function(ret){process.nextTick(cb.bind(null,null,ret))}),(function(rej){process.nextTick(callbackifyOnRejected.bind(null,rej,cb))}))}Object.setPrototypeOf(callbackified,Object.getPrototypeOf(original));Object.defineProperties(callbackified,getOwnPropertyDescriptors(original));return callbackified}exports.callbackify=callbackify}).call(this)}).call(this,require("_process"))},{"./support/isBuffer":201,"./support/types":202,_process:182,inherits:111}],204:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"NIL",{enumerable:true,get:function get(){return _nil["default"]}});Object.defineProperty(exports,"parse",{enumerable:true,get:function get(){return _parse["default"]}});Object.defineProperty(exports,"stringify",{enumerable:true,get:function get(){return _stringify["default"]}});Object.defineProperty(exports,"v1",{enumerable:true,get:function get(){return _v["default"]}});Object.defineProperty(exports,"v3",{enumerable:true,get:function get(){return _v2["default"]}});Object.defineProperty(exports,"v4",{enumerable:true,get:function get(){return _v3["default"]}});Object.defineProperty(exports,"v5",{enumerable:true,get:function get(){return _v4["default"]}});Object.defineProperty(exports,"validate",{enumerable:true,get:function get(){return _validate["default"]}});Object.defineProperty(exports,"version",{enumerable:true,get:function get(){return _version["default"]}});var _v=_interopRequireDefault(require("./v1.js"));var _v2=_interopRequireDefault(require("./v3.js"));var _v3=_interopRequireDefault(require("./v4.js"));var _v4=_interopRequireDefault(require("./v5.js"));var _nil=_interopRequireDefault(require("./nil.js"));var _version=_interopRequireDefault(require("./version.js"));var _validate=_interopRequireDefault(require("./validate.js"));var _stringify=_interopRequireDefault(require("./stringify.js"));var _parse=_interopRequireDefault(require("./parse.js"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}},{"./nil.js":207,"./parse.js":208,"./stringify.js":212,"./v1.js":213,"./v3.js":214,"./v4.js":216,"./v5.js":217,"./validate.js":218,"./version.js":219}],205:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;function md5(bytes){if(typeof bytes==="string"){var msg=unescape(encodeURIComponent(bytes));bytes=new Uint8Array(msg.length);for(var i=0;i<msg.length;++i){bytes[i]=msg.charCodeAt(i)}}return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes),bytes.length*8))}function md5ToHexEncodedArray(input){var output=[];var length32=input.length*32;var hexTab="0123456789abcdef";for(var i=0;i<length32;i+=8){var x=input[i>>5]>>>i%32&255;var hex=parseInt(hexTab.charAt(x>>>4&15)+hexTab.charAt(x&15),16);output.push(hex)}return output}function getOutputLength(inputLength8){return(inputLength8+64>>>9<<4)+14+1}function wordsToMd5(x,len){x[len>>5]|=128<<len%32;x[getOutputLength(len)-1]=len;var a=1732584193;var b=-271733879;var c=-1732584194;var d=271733878;for(var i=0;i<x.length;i+=16){var olda=a;var oldb=b;var oldc=c;var oldd=d;a=md5ff(a,b,c,d,x[i],7,-680876936);d=md5ff(d,a,b,c,x[i+1],12,-389564586);c=md5ff(c,d,a,b,x[i+2],17,606105819);b=md5ff(b,c,d,a,x[i+3],22,-1044525330);a=md5ff(a,b,c,d,x[i+4],7,-176418897);d=md5ff(d,a,b,c,x[i+5],12,1200080426);c=md5ff(c,d,a,b,x[i+6],17,-1473231341);b=md5ff(b,c,d,a,x[i+7],22,-45705983);a=md5ff(a,b,c,d,x[i+8],7,1770035416);d=md5ff(d,a,b,c,x[i+9],12,-1958414417);c=md5ff(c,d,a,b,x[i+10],17,-42063);b=md5ff(b,c,d,a,x[i+11],22,-1990404162);a=md5ff(a,b,c,d,x[i+12],7,1804603682);d=md5ff(d,a,b,c,x[i+13],12,-40341101);c=md5ff(c,d,a,b,x[i+14],17,-1502002290);b=md5ff(b,c,d,a,x[i+15],22,1236535329);a=md5gg(a,b,c,d,x[i+1],5,-165796510);d=md5gg(d,a,b,c,x[i+6],9,-1069501632);c=md5gg(c,d,a,b,x[i+11],14,643717713);b=md5gg(b,c,d,a,x[i],20,-373897302);a=md5gg(a,b,c,d,x[i+5],5,-701558691);d=md5gg(d,a,b,c,x[i+10],9,38016083);c=md5gg(c,d,a,b,x[i+15],14,-660478335);b=md5gg(b,c,d,a,x[i+4],20,-405537848);a=md5gg(a,b,c,d,x[i+9],5,568446438);d=md5gg(d,a,b,c,x[i+14],9,-1019803690);c=md5gg(c,d,a,b,x[i+3],14,-187363961);b=md5gg(b,c,d,a,x[i+8],20,1163531501);a=md5gg(a,b,c,d,x[i+13],5,-1444681467);d=md5gg(d,a,b,c,x[i+2],9,-51403784);c=md5gg(c,d,a,b,x[i+7],14,1735328473);b=md5gg(b,c,d,a,x[i+12],20,-1926607734);a=md5hh(a,b,c,d,x[i+5],4,-378558);d=md5hh(d,a,b,c,x[i+8],11,-2022574463);c=md5hh(c,d,a,b,x[i+11],16,1839030562);b=md5hh(b,c,d,a,x[i+14],23,-35309556);a=md5hh(a,b,c,d,x[i+1],4,-1530992060);d=md5hh(d,a,b,c,x[i+4],11,1272893353);c=md5hh(c,d,a,b,x[i+7],16,-155497632);b=md5hh(b,c,d,a,x[i+10],23,-1094730640);a=md5hh(a,b,c,d,x[i+13],4,681279174);d=md5hh(d,a,b,c,x[i],11,-358537222);c=md5hh(c,d,a,b,x[i+3],16,-722521979);b=md5hh(b,c,d,a,x[i+6],23,76029189);a=md5hh(a,b,c,d,x[i+9],4,-640364487);d=md5hh(d,a,b,c,x[i+12],11,-421815835);c=md5hh(c,d,a,b,x[i+15],16,530742520);b=md5hh(b,c,d,a,x[i+2],23,-995338651);a=md5ii(a,b,c,d,x[i],6,-198630844);d=md5ii(d,a,b,c,x[i+7],10,1126891415);c=md5ii(c,d,a,b,x[i+14],15,-1416354905);b=md5ii(b,c,d,a,x[i+5],21,-57434055);a=md5ii(a,b,c,d,x[i+12],6,1700485571);d=md5ii(d,a,b,c,x[i+3],10,-1894986606);c=md5ii(c,d,a,b,x[i+10],15,-1051523);b=md5ii(b,c,d,a,x[i+1],21,-2054922799);a=md5ii(a,b,c,d,x[i+8],6,1873313359);d=md5ii(d,a,b,c,x[i+15],10,-30611744);c=md5ii(c,d,a,b,x[i+6],15,-1560198380);b=md5ii(b,c,d,a,x[i+13],21,1309151649);a=md5ii(a,b,c,d,x[i+4],6,-145523070);d=md5ii(d,a,b,c,x[i+11],10,-1120210379);c=md5ii(c,d,a,b,x[i+2],15,718787259);b=md5ii(b,c,d,a,x[i+9],21,-343485551);a=safeAdd(a,olda);b=safeAdd(b,oldb);c=safeAdd(c,oldc);d=safeAdd(d,oldd)}return[a,b,c,d]}function bytesToWords(input){if(input.length===0){return[]}var length8=input.length*8;var output=new Uint32Array(getOutputLength(length8));for(var i=0;i<length8;i+=8){output[i>>5]|=(input[i/8]&255)<<i%32}return output}function safeAdd(x,y){var lsw=(x&65535)+(y&65535);var msw=(x>>16)+(y>>16)+(lsw>>16);return msw<<16|lsw&65535}function bitRotateLeft(num,cnt){return num<<cnt|num>>>32-cnt}function md5cmn(q,a,b,x,s,t){return safeAdd(bitRotateLeft(safeAdd(safeAdd(a,q),safeAdd(x,t)),s),b)}function md5ff(a,b,c,d,x,s,t){return md5cmn(b&c|~b&d,a,b,x,s,t)}function md5gg(a,b,c,d,x,s,t){return md5cmn(b&d|c&~d,a,b,x,s,t)}function md5hh(a,b,c,d,x,s,t){return md5cmn(b^c^d,a,b,x,s,t)}function md5ii(a,b,c,d,x,s,t){return md5cmn(c^(b|~d),a,b,x,s,t)}var _default=md5;exports["default"]=_default},{}],206:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var randomUUID=typeof crypto!=="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);var _default={randomUUID:randomUUID};exports["default"]=_default},{}],207:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _default="00000000-0000-0000-0000-000000000000";exports["default"]=_default},{}],208:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _validate=_interopRequireDefault(require("./validate.js"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function parse(uuid){if(!(0,_validate["default"])(uuid)){throw TypeError("Invalid UUID")}var v;var arr=new Uint8Array(16);arr[0]=(v=parseInt(uuid.slice(0,8),16))>>>24;arr[1]=v>>>16&255;arr[2]=v>>>8&255;arr[3]=v&255;arr[4]=(v=parseInt(uuid.slice(9,13),16))>>>8;arr[5]=v&255;arr[6]=(v=parseInt(uuid.slice(14,18),16))>>>8;arr[7]=v&255;arr[8]=(v=parseInt(uuid.slice(19,23),16))>>>8;arr[9]=v&255;arr[10]=(v=parseInt(uuid.slice(24,36),16))/1099511627776&255;arr[11]=v/4294967296&255;arr[12]=v>>>24&255;arr[13]=v>>>16&255;arr[14]=v>>>8&255;arr[15]=v&255;return arr}var _default=parse;exports["default"]=_default},{"./validate.js":218}],209:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;exports["default"]=_default},{}],210:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=rng;var getRandomValues;var rnds8=new Uint8Array(16);function rng(){if(!getRandomValues){getRandomValues=typeof crypto!=="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto);if(!getRandomValues){throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported")}}return getRandomValues(rnds8)}},{}],211:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;function f(s,x,y,z){switch(s){case 0:return x&y^~x&z;case 1:return x^y^z;case 2:return x&y^x&z^y&z;case 3:return x^y^z}}function ROTL(x,n){return x<<n|x>>>32-n}function sha1(bytes){var K=[1518500249,1859775393,2400959708,3395469782];var H=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof bytes==="string"){var msg=unescape(encodeURIComponent(bytes));bytes=[];for(var i=0;i<msg.length;++i){bytes.push(msg.charCodeAt(i))}}else if(!Array.isArray(bytes)){bytes=Array.prototype.slice.call(bytes)}bytes.push(128);var l=bytes.length/4+2;var N=Math.ceil(l/16);var M=new Array(N);for(var _i=0;_i<N;++_i){var arr=new Uint32Array(16);for(var j=0;j<16;++j){arr[j]=bytes[_i*64+j*4]<<24|bytes[_i*64+j*4+1]<<16|bytes[_i*64+j*4+2]<<8|bytes[_i*64+j*4+3]}M[_i]=arr}M[N-1][14]=(bytes.length-1)*8/Math.pow(2,32);M[N-1][14]=Math.floor(M[N-1][14]);M[N-1][15]=(bytes.length-1)*8&4294967295;for(var _i2=0;_i2<N;++_i2){var W=new Uint32Array(80);for(var t=0;t<16;++t){W[t]=M[_i2][t]}for(var _t=16;_t<80;++_t){W[_t]=ROTL(W[_t-3]^W[_t-8]^W[_t-14]^W[_t-16],1)}var a=H[0];var b=H[1];var c=H[2];var d=H[3];var e=H[4];for(var _t2=0;_t2<80;++_t2){var s=Math.floor(_t2/20);var T=ROTL(a,5)+f(s,b,c,d)+e+K[s]+W[_t2]>>>0;e=d;d=c;c=ROTL(b,30)>>>0;b=a;a=T}H[0]=H[0]+a>>>0;H[1]=H[1]+b>>>0;H[2]=H[2]+c>>>0;H[3]=H[3]+d>>>0;H[4]=H[4]+e>>>0}return[H[0]>>24&255,H[0]>>16&255,H[0]>>8&255,H[0]&255,H[1]>>24&255,H[1]>>16&255,H[1]>>8&255,H[1]&255,H[2]>>24&255,H[2]>>16&255,H[2]>>8&255,H[2]&255,H[3]>>24&255,H[3]>>16&255,H[3]>>8&255,H[3]&255,H[4]>>24&255,H[4]>>16&255,H[4]>>8&255,H[4]&255]}var _default=sha1;exports["default"]=_default},{}],212:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;exports.unsafeStringify=unsafeStringify;var _validate=_interopRequireDefault(require("./validate.js"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var byteToHex=[];for(var i=0;i<256;++i){byteToHex.push((i+256).toString(16).slice(1))}function unsafeStringify(arr){var offset=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;return byteToHex[arr[offset+0]]+byteToHex[arr[offset+1]]+byteToHex[arr[offset+2]]+byteToHex[arr[offset+3]]+"-"+byteToHex[arr[offset+4]]+byteToHex[arr[offset+5]]+"-"+byteToHex[arr[offset+6]]+byteToHex[arr[offset+7]]+"-"+byteToHex[arr[offset+8]]+byteToHex[arr[offset+9]]+"-"+byteToHex[arr[offset+10]]+byteToHex[arr[offset+11]]+byteToHex[arr[offset+12]]+byteToHex[arr[offset+13]]+byteToHex[arr[offset+14]]+byteToHex[arr[offset+15]]}function stringify(arr){var offset=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var uuid=unsafeStringify(arr,offset);if(!(0,_validate["default"])(uuid)){throw TypeError("Stringified UUID is invalid")}return uuid}var _default=stringify;exports["default"]=_default},{"./validate.js":218}],213:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _rng=_interopRequireDefault(require("./rng.js"));var _stringify=require("./stringify.js");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var _nodeId;var _clockseq;var _lastMSecs=0;var _lastNSecs=0;function v1(options,buf,offset){var i=buf&&offset||0;var b=buf||new Array(16);options=options||{};var node=options.node||_nodeId;var clockseq=options.clockseq!==undefined?options.clockseq:_clockseq;if(node==null||clockseq==null){var seedBytes=options.random||(options.rng||_rng["default"])();if(node==null){node=_nodeId=[seedBytes[0]|1,seedBytes[1],seedBytes[2],seedBytes[3],seedBytes[4],seedBytes[5]]}if(clockseq==null){clockseq=_clockseq=(seedBytes[6]<<8|seedBytes[7])&16383}}var msecs=options.msecs!==undefined?options.msecs:Date.now();var nsecs=options.nsecs!==undefined?options.nsecs:_lastNSecs+1;var dt=msecs-_lastMSecs+(nsecs-_lastNSecs)/1e4;if(dt<0&&options.clockseq===undefined){clockseq=clockseq+1&16383}if((dt<0||msecs>_lastMSecs)&&options.nsecs===undefined){nsecs=0}if(nsecs>=1e4){throw new Error("uuid.v1(): Can't create more than 10M uuids/sec")}_lastMSecs=msecs;_lastNSecs=nsecs;_clockseq=clockseq;msecs+=122192928e5;var tl=((msecs&268435455)*1e4+nsecs)%4294967296;b[i++]=tl>>>24&255;b[i++]=tl>>>16&255;b[i++]=tl>>>8&255;b[i++]=tl&255;var tmh=msecs/4294967296*1e4&268435455;b[i++]=tmh>>>8&255;b[i++]=tmh&255;b[i++]=tmh>>>24&15|16;b[i++]=tmh>>>16&255;b[i++]=clockseq>>>8|128;b[i++]=clockseq&255;for(var n=0;n<6;++n){b[i+n]=node[n]}return buf||(0,_stringify.unsafeStringify)(b)}var _default=v1;exports["default"]=_default},{"./rng.js":210,"./stringify.js":212}],214:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _v=_interopRequireDefault(require("./v35.js"));var _md=_interopRequireDefault(require("./md5.js"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var v3=(0,_v["default"])("v3",48,_md["default"]);var _default=v3;exports["default"]=_default},{"./md5.js":205,"./v35.js":215}],215:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.URL=exports.DNS=void 0;exports["default"]=v35;var _stringify=require("./stringify.js");var _parse=_interopRequireDefault(require("./parse.js"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function stringToBytes(str){str=unescape(encodeURIComponent(str));var bytes=[];for(var i=0;i<str.length;++i){bytes.push(str.charCodeAt(i))}return bytes}var DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8";exports.DNS=DNS;var URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8";exports.URL=URL;function v35(name,version,hashfunc){function generateUUID(value,namespace,buf,offset){var _namespace;if(typeof value==="string"){value=stringToBytes(value)}if(typeof namespace==="string"){namespace=(0,_parse["default"])(namespace)}if(((_namespace=namespace)===null||_namespace===void 0?void 0:_namespace.length)!==16){throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)")}var bytes=new Uint8Array(16+value.length);bytes.set(namespace);bytes.set(value,namespace.length);bytes=hashfunc(bytes);bytes[6]=bytes[6]&15|version;bytes[8]=bytes[8]&63|128;if(buf){offset=offset||0;for(var i=0;i<16;++i){buf[offset+i]=bytes[i]}return buf}return(0,_stringify.unsafeStringify)(bytes)}try{generateUUID.name=name}catch(err){}generateUUID.DNS=DNS;generateUUID.URL=URL;return generateUUID}},{"./parse.js":208,"./stringify.js":212}],216:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _native=_interopRequireDefault(require("./native.js"));var _rng=_interopRequireDefault(require("./rng.js"));var _stringify=require("./stringify.js");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function v4(options,buf,offset){if(_native["default"].randomUUID&&!buf&&!options){return _native["default"].randomUUID()}options=options||{};var rnds=options.random||(options.rng||_rng["default"])();rnds[6]=rnds[6]&15|64;rnds[8]=rnds[8]&63|128;if(buf){offset=offset||0;for(var i=0;i<16;++i){buf[offset+i]=rnds[i]}return buf}return(0,_stringify.unsafeStringify)(rnds)}var _default=v4;exports["default"]=_default},{"./native.js":206,"./rng.js":210,"./stringify.js":212}],217:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _v=_interopRequireDefault(require("./v35.js"));var _sha=_interopRequireDefault(require("./sha1.js"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var v5=(0,_v["default"])("v5",80,_sha["default"]);var _default=v5;exports["default"]=_default},{"./sha1.js":211,"./v35.js":215}],218:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _regex=_interopRequireDefault(require("./regex.js"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function validate(uuid){return typeof uuid==="string"&&_regex["default"].test(uuid)}var _default=validate;exports["default"]=_default},{"./regex.js":209}],219:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _validate=_interopRequireDefault(require("./validate.js"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function version(uuid){if(!(0,_validate["default"])(uuid)){throw TypeError("Invalid UUID")}return parseInt(uuid.slice(14,15),16)}var _default=version;exports["default"]=_default},{"./validate.js":218}],220:[function(require,module,exports){(function(global){(function(){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}var forEach=require("for-each");var availableTypedArrays=require("available-typed-arrays");var callBind=require("call-bind");var callBound=require("call-bind/callBound");var gOPD=require("gopd");var $toString=callBound("Object.prototype.toString");var hasToStringTag=require("has-tostringtag/shams")();var g=typeof globalThis==="undefined"?global:globalThis;var typedArrays=availableTypedArrays();var $slice=callBound("String.prototype.slice");var getPrototypeOf=Object.getPrototypeOf;var $indexOf=callBound("Array.prototype.indexOf",true)||function indexOf(array,value){for(var i=0;i<array.length;i+=1){if(array[i]===value){return i}}return-1};var cache={__proto__:null};if(hasToStringTag&&gOPD&&getPrototypeOf){forEach(typedArrays,(function(typedArray){var arr=new g[typedArray];if(Symbol.toStringTag in arr){var proto=getPrototypeOf(arr);var descriptor=gOPD(proto,Symbol.toStringTag);if(!descriptor){var superProto=getPrototypeOf(proto);descriptor=gOPD(superProto,Symbol.toStringTag)}cache["$"+typedArray]=callBind(descriptor.get)}}))}else{forEach(typedArrays,(function(typedArray){var arr=new g[typedArray];var fn=arr.slice||arr.set;if(fn){cache["$"+typedArray]=callBind(fn)}}))}var tryTypedArrays=function tryAllTypedArrays(value){var found=false;forEach(cache,(function(getter,typedArray){if(!found){try{if("$"+getter(value)===typedArray){found=$slice(typedArray,1)}}catch(e){}}}));return found};var trySlices=function tryAllSlices(value){var found=false;forEach(cache,(function(getter,name){if(!found){try{getter(value);found=$slice(name,1)}catch(e){}}}));return found};module.exports=function whichTypedArray(value){if(!value||_typeof(value)!=="object"){return false}if(!hasToStringTag){var tag=$slice($toString(value),8,-1);if($indexOf(typedArrays,tag)>-1){return tag}if(tag!=="Object"){return false}return trySlices(value)}if(!gOPD){return null}return tryTypedArrays(value)}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"available-typed-arrays":1,"call-bind":76,"call-bind/callBound":75,"for-each":98,gopd:103,"has-tostringtag/shams":108}],221:[function(require,module,exports){"use strict";module.exports=wrappy;function wrappy(fn,cb){if(fn&&cb)return wrappy(fn)(cb);if(typeof fn!=="function")throw new TypeError("need wrapper function");Object.keys(fn).forEach((function(k){wrapper[k]=fn[k]}));return wrapper;function wrapper(){var args=new Array(arguments.length);for(var i=0;i<args.length;i++){args[i]=arguments[i]}var ret=fn.apply(this,args);var cb=args[args.length-1];if(typeof ret==="function"&&ret!==cb){Object.keys(cb).forEach((function(k){ret[k]=cb[k]}))}return ret}}},{}],222:[function(require,module,exports){"use strict";module.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native "+"WebSocket object")}},{}],223:[function(require,module,exports){"use strict";module.exports=extend;var hasOwnProperty=Object.prototype.hasOwnProperty;function extend(){var target={};for(var i=0;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(hasOwnProperty.call(source,key)){target[key]=source[key]}}}return target}},{}],224:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.composeCollection=composeCollection;var _identity=require("../nodes/identity.js");var _Scalar=require("../nodes/Scalar.js");var _YAMLMap=require("../nodes/YAMLMap.js");var _YAMLSeq=require("../nodes/YAMLSeq.js");var _resolveBlockMap=require("./resolve-block-map.js");var _resolveBlockSeq=require("./resolve-block-seq.js");var _resolveFlowCollection=require("./resolve-flow-collection.js");function resolveCollection(CN,ctx,token,onError,tagName,tag){var coll=token.type==="block-map"?(0,_resolveBlockMap.resolveBlockMap)(CN,ctx,token,onError,tag):token.type==="block-seq"?(0,_resolveBlockSeq.resolveBlockSeq)(CN,ctx,token,onError,tag):(0,_resolveFlowCollection.resolveFlowCollection)(CN,ctx,token,onError,tag);var Coll=coll.constructor;if(tagName==="!"||tagName===Coll.tagName){coll.tag=Coll.tagName;return coll}if(tagName)coll.tag=tagName;return coll}function composeCollection(CN,ctx,token,props,onError){var _tag$resolve,_tag$resolve2,_tag,_tag2;var tagToken=props.tag;var tagName=!tagToken?null:ctx.directives.tagName(tagToken.source,(function(msg){return onError(tagToken,"TAG_RESOLVE_FAILED",msg)}));if(token.type==="block-seq"){var anchor=props.anchor,nl=props.newlineAfterProp;var lastProp=anchor&&tagToken?anchor.offset>tagToken.offset?anchor:tagToken:anchor!==null&&anchor!==void 0?anchor:tagToken;if(lastProp&&(!nl||nl.offset<lastProp.offset)){var message="Missing newline after block sequence props";onError(lastProp,"MISSING_CHAR",message)}}var expType=token.type==="block-map"?"map":token.type==="block-seq"?"seq":token.start.source==="{"?"map":"seq";if(!tagToken||!tagName||tagName==="!"||tagName===_YAMLMap.YAMLMap.tagName&&expType==="map"||tagName===_YAMLSeq.YAMLSeq.tagName&&expType==="seq"){return resolveCollection(CN,ctx,token,onError,tagName)}var tag=ctx.schema.tags.find((function(t){return t.tag===tagName&&t.collection===expType}));if(!tag){var kt=ctx.schema.knownTags[tagName];if(kt&&kt.collection===expType){ctx.schema.tags.push(Object.assign({},kt,{default:false}));tag=kt}else{if(kt!==null&&kt!==void 0&&kt.collection){onError(tagToken,"BAD_COLLECTION_TYPE","".concat(kt.tag," used for ").concat(expType," collection, but expects ").concat(kt.collection),true)}else{onError(tagToken,"TAG_RESOLVE_FAILED","Unresolved tag: ".concat(tagName),true)}return resolveCollection(CN,ctx,token,onError,tagName)}}var coll=resolveCollection(CN,ctx,token,onError,tagName,tag);var res=(_tag$resolve=(_tag$resolve2=(_tag=tag).resolve)===null||_tag$resolve2===void 0?void 0:_tag$resolve2.call(_tag,coll,(function(msg){return onError(tagToken,"TAG_RESOLVE_FAILED",msg)}),ctx.options))!==null&&_tag$resolve!==void 0?_tag$resolve:coll;var node=(0,_identity.isNode)(res)?res:new _Scalar.Scalar(res);node.range=coll.range;node.tag=tagName;if((_tag2=tag)!==null&&_tag2!==void 0&&_tag2.format)node.format=tag.format;return node}},{"../nodes/Scalar.js":252,"../nodes/YAMLMap.js":253,"../nodes/YAMLSeq.js":254,"../nodes/identity.js":256,"./resolve-block-map.js":229,"./resolve-block-seq.js":231,"./resolve-flow-collection.js":233}],225:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.composeDoc=composeDoc;var _Document=require("../doc/Document.js");var _composeNode=require("./compose-node.js");var _resolveEnd=require("./resolve-end.js");var _resolveProps=require("./resolve-props.js");function composeDoc(options,directives,_ref,onError){var offset=_ref.offset,start=_ref.start,value=_ref.value,end=_ref.end;var opts=Object.assign({_directives:directives},options);var doc=new _Document.Document(undefined,opts);var ctx={atKey:false,atRoot:true,directives:doc.directives,options:doc.options,schema:doc.schema};var props=(0,_resolveProps.resolveProps)(start,{indicator:"doc-start",next:value!==null&&value!==void 0?value:end===null||end===void 0?void 0:end[0],offset:offset,onError:onError,parentIndent:0,startOnNewline:true});if(props.found){doc.directives.docStart=true;if(value&&(value.type==="block-map"||value.type==="block-seq")&&!props.hasNewline)onError(props.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}doc.contents=value?(0,_composeNode.composeNode)(ctx,value,props,onError):(0,_composeNode.composeEmptyNode)(ctx,props.end,start,null,props,onError);var contentEnd=doc.contents.range[2];var re=(0,_resolveEnd.resolveEnd)(end,contentEnd,false,onError);if(re.comment)doc.comment=re.comment;doc.range=[offset,contentEnd,re.offset];return doc}},{"../doc/Document.js":240,"./compose-node.js":226,"./resolve-end.js":232,"./resolve-props.js":235}],226:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.composeEmptyNode=composeEmptyNode;exports.composeNode=composeNode;var _Alias=require("../nodes/Alias.js");var _identity=require("../nodes/identity.js");var _composeCollection=require("./compose-collection.js");var _composeScalar=require("./compose-scalar.js");var _resolveEnd=require("./resolve-end.js");var _utilEmptyScalarPosition=require("./util-empty-scalar-position.js");var CN={composeNode:composeNode,composeEmptyNode:composeEmptyNode};function composeNode(ctx,token,props,onError){var atKey=ctx.atKey;var spaceBefore=props.spaceBefore,comment=props.comment,anchor=props.anchor,tag=props.tag;var node;var isSrcToken=true;switch(token.type){case"alias":node=composeAlias(ctx,token,onError);if(anchor||tag)onError(token,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":node=(0,_composeScalar.composeScalar)(ctx,token,tag,onError);if(anchor)node.anchor=anchor.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":node=(0,_composeCollection.composeCollection)(CN,ctx,token,props,onError);if(anchor)node.anchor=anchor.source.substring(1);break;default:{var message=token.type==="error"?token.message:"Unsupported token (type: ".concat(token.type,")");onError(token,"UNEXPECTED_TOKEN",message);node=composeEmptyNode(ctx,token.offset,undefined,null,props,onError);isSrcToken=false}}if(anchor&&node.anchor==="")onError(anchor,"BAD_ALIAS","Anchor cannot be an empty string");if(atKey&&ctx.options.stringKeys&&(!(0,_identity.isScalar)(node)||typeof node.value!=="string"||node.tag&&node.tag!=="tag:yaml.org,2002:str")){var msg="With stringKeys, all keys must be strings";onError(tag!==null&&tag!==void 0?tag:token,"NON_STRING_KEY",msg)}if(spaceBefore)node.spaceBefore=true;if(comment){if(token.type==="scalar"&&token.source==="")node.comment=comment;else node.commentBefore=comment}if(ctx.options.keepSourceTokens&&isSrcToken)node.srcToken=token;return node}function composeEmptyNode(ctx,offset,before,pos,_ref,onError){var spaceBefore=_ref.spaceBefore,comment=_ref.comment,anchor=_ref.anchor,tag=_ref.tag,end=_ref.end;var token={type:"scalar",offset:(0,_utilEmptyScalarPosition.emptyScalarPosition)(offset,before,pos),indent:-1,source:""};var node=(0,_composeScalar.composeScalar)(ctx,token,tag,onError);if(anchor){node.anchor=anchor.source.substring(1);if(node.anchor==="")onError(anchor,"BAD_ALIAS","Anchor cannot be an empty string")}if(spaceBefore)node.spaceBefore=true;if(comment){node.comment=comment;node.range[2]=end}return node}function composeAlias(_ref2,_ref3,onError){var options=_ref2.options;var offset=_ref3.offset,source=_ref3.source,end=_ref3.end;var alias=new _Alias.Alias(source.substring(1));if(alias.source==="")onError(offset,"BAD_ALIAS","Alias cannot be an empty string");if(alias.source.endsWith(":"))onError(offset+source.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",true);var valueEnd=offset+source.length;var re=(0,_resolveEnd.resolveEnd)(end,valueEnd,options.strict,onError);alias.range=[offset,valueEnd,re.offset];if(re.comment)alias.comment=re.comment;return alias}},{"../nodes/Alias.js":248,"../nodes/identity.js":256,"./compose-collection.js":224,"./compose-scalar.js":227,"./resolve-end.js":232,"./util-empty-scalar-position.js":237}],227:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.composeScalar=composeScalar;var _identity=require("../nodes/identity.js");var _Scalar=require("../nodes/Scalar.js");var _resolveBlockScalar=require("./resolve-block-scalar.js");var _resolveFlowScalar=require("./resolve-flow-scalar.js");function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function composeScalar(ctx,token,tagToken,onError){var _ref=token.type==="block-scalar"?(0,_resolveBlockScalar.resolveBlockScalar)(ctx,token,onError):(0,_resolveFlowScalar.resolveFlowScalar)(token,ctx.options.strict,onError),value=_ref.value,type=_ref.type,comment=_ref.comment,range=_ref.range;var tagName=tagToken?ctx.directives.tagName(tagToken.source,(function(msg){return onError(tagToken,"TAG_RESOLVE_FAILED",msg)})):null;var tag;if(ctx.options.stringKeys&&ctx.atKey){tag=ctx.schema[_identity.SCALAR]}else if(tagName)tag=findScalarTagByName(ctx.schema,value,tagName,tagToken,onError);else if(token.type==="scalar")tag=findScalarTagByTest(ctx,value,token,onError);else tag=ctx.schema[_identity.SCALAR];var scalar;try{var res=tag.resolve(value,(function(msg){return onError(tagToken!==null&&tagToken!==void 0?tagToken:token,"TAG_RESOLVE_FAILED",msg)}),ctx.options);scalar=(0,_identity.isScalar)(res)?res:new _Scalar.Scalar(res)}catch(error){var msg=error instanceof Error?error.message:String(error);onError(tagToken!==null&&tagToken!==void 0?tagToken:token,"TAG_RESOLVE_FAILED",msg);scalar=new _Scalar.Scalar(value)}scalar.range=range;scalar.source=value;if(type)scalar.type=type;if(tagName)scalar.tag=tagName;if(tag.format)scalar.format=tag.format;if(comment)scalar.comment=comment;return scalar}function findScalarTagByName(schema,value,tagName,tagToken,onError){if(tagName==="!")return schema[_identity.SCALAR];var matchWithTest=[];var _iterator=_createForOfIteratorHelper(schema.tags),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var _tag=_step.value;if(!_tag.collection&&_tag.tag===tagName){if(_tag["default"]&&_tag.test)matchWithTest.push(_tag);else return _tag}}}catch(err){_iterator.e(err)}finally{_iterator.f()}for(var _i=0,_matchWithTest=matchWithTest;_i<_matchWithTest.length;_i++){var _tag$test;var tag=_matchWithTest[_i];if((_tag$test=tag.test)!==null&&_tag$test!==void 0&&_tag$test.test(value))return tag}var kt=schema.knownTags[tagName];if(kt&&!kt.collection){schema.tags.push(Object.assign({},kt,{default:false,test:undefined}));return kt}onError(tagToken,"TAG_RESOLVE_FAILED","Unresolved tag: ".concat(tagName),tagName!=="tag:yaml.org,2002:str");return schema[_identity.SCALAR]}function findScalarTagByTest(_ref2,value,token,onError){var atKey=_ref2.atKey,directives=_ref2.directives,schema=_ref2.schema;var tag=schema.tags.find((function(tag){var _tag$test2;return(tag["default"]===true||atKey&&tag["default"]==="key")&&((_tag$test2=tag.test)===null||_tag$test2===void 0?void 0:_tag$test2.test(value))}))||schema[_identity.SCALAR];if(schema.compat){var _schema$compat$find;var compat=(_schema$compat$find=schema.compat.find((function(tag){var _tag$test3;return tag["default"]&&((_tag$test3=tag.test)===null||_tag$test3===void 0?void 0:_tag$test3.test(value))})))!==null&&_schema$compat$find!==void 0?_schema$compat$find:schema[_identity.SCALAR];if(tag.tag!==compat.tag){var ts=directives.tagString(tag.tag);var cs=directives.tagString(compat.tag);var msg="Value may be parsed as either ".concat(ts," or ").concat(cs);onError(token,"TAG_RESOLVE_FAILED",msg,true)}}return tag}},{"../nodes/Scalar.js":252,"../nodes/identity.js":256,"./resolve-block-scalar.js":230,"./resolve-flow-scalar.js":234}],228:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.Composer=void 0;var _directives=require("../doc/directives.js");var _Document=require("../doc/Document.js");var _errors=require("../errors.js");var _identity=require("../nodes/identity.js");var _composeDoc=require("./compose-doc.js");var _resolveEnd=require("./resolve-end.js");function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{define({},"")}catch(t){define=function define(t,e,r){return t[e]=r}}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,(function(){return this}));var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach((function(e){define(t,e,(function(t){return this._invoke(e,t)}))}))}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){invoke("next",t,i,a)}),(function(t){invoke("throw",t,i,a)})):e.resolve(h).then((function(t){u.value=t,i(u)}),(function(t){return invoke("throw",t,i,a)}))}a(c.arg)}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e((function(e,r){invoke(t,n,e,r)}))}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done}}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg)}}}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next};return i.next=i}}throw new TypeError(_typeof(e)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t},e.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,(function(){return this})),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,(function(){return this})),define(g,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next}return next.done=!0,next}},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y}},catch:function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function getErrorPos(src){if(typeof src==="number")return[src,src+1];if(Array.isArray(src))return src.length===2?src:[src[0],src[1]];var offset=src.offset,source=src.source;return[offset,offset+(typeof source==="string"?source.length:1)]}function parsePrelude(prelude){var _prelude;var comment="";var atComment=false;var afterEmptyLine=false;for(var i=0;i<prelude.length;++i){var source=prelude[i];switch(source[0]){case"#":comment+=(comment===""?"":afterEmptyLine?"\n\n":"\n")+(source.substring(1)||" ");atComment=true;afterEmptyLine=false;break;case"%":if(((_prelude=prelude[i+1])===null||_prelude===void 0?void 0:_prelude[0])!=="#")i+=1;atComment=false;break;default:if(!atComment)afterEmptyLine=true;atComment=false}}return{comment:comment,afterEmptyLine:afterEmptyLine}}var Composer=exports.Composer=function(){function Composer(){var _this=this;var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,Composer);this.doc=null;this.atDirectives=false;this.prelude=[];this.errors=[];this.warnings=[];this.onError=function(source,code,message,warning){var pos=getErrorPos(source);if(warning)_this.warnings.push(new _errors.YAMLWarning(pos,code,message));else _this.errors.push(new _errors.YAMLParseError(pos,code,message))};this.directives=new _directives.Directives({version:options.version||"1.2"});this.options=options}return _createClass(Composer,[{key:"decorate",value:function decorate(doc,afterDoc){var _parsePrelude=parsePrelude(this.prelude),comment=_parsePrelude.comment,afterEmptyLine=_parsePrelude.afterEmptyLine;if(comment){var dc=doc.contents;if(afterDoc){doc.comment=doc.comment?"".concat(doc.comment,"\n").concat(comment):comment}else if(afterEmptyLine||doc.directives.docStart||!dc){doc.commentBefore=comment}else if((0,_identity.isCollection)(dc)&&!dc.flow&&dc.items.length>0){var it=dc.items[0];if((0,_identity.isPair)(it))it=it.key;var cb=it.commentBefore;it.commentBefore=cb?"".concat(comment,"\n").concat(cb):comment}else{var _cb=dc.commentBefore;dc.commentBefore=_cb?"".concat(comment,"\n").concat(_cb):comment}}if(afterDoc){Array.prototype.push.apply(doc.errors,this.errors);Array.prototype.push.apply(doc.warnings,this.warnings)}else{doc.errors=this.errors;doc.warnings=this.warnings}this.prelude=[];this.errors=[];this.warnings=[]}},{key:"streamInfo",value:function streamInfo(){return{comment:parsePrelude(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}},{key:"compose",value:function compose(tokens){var _this2=this;var forceDoc=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var endOffset=arguments.length>2&&arguments[2]!==undefined?arguments[2]:-1;return _regeneratorRuntime().mark((function _callee(){var _iterator,_step,token;return _regeneratorRuntime().wrap((function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_iterator=_createForOfIteratorHelper(tokens);_context.prev=1;_iterator.s();case 3:if((_step=_iterator.n()).done){_context.next=8;break}token=_step.value;return _context.delegateYield(_this2.next(token),"t0",6);case 6:_context.next=3;break;case 8:_context.next=13;break;case 10:_context.prev=10;_context.t1=_context["catch"](1);_iterator.e(_context.t1);case 13:_context.prev=13;_iterator.f();return _context.finish(13);case 16:return _context.delegateYield(_this2.end(forceDoc,endOffset),"t2",17);case 17:case"end":return _context.stop()}}),_callee,null,[[1,10,13,16]])}))()}},{key:"next",value:_regeneratorRuntime().mark((function next(token){var _this3=this;var doc,msg,error,_msg,end,dc;return _regeneratorRuntime().wrap((function next$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.t0=token.type;_context2.next=_context2.t0==="directive"?3:_context2.t0==="document"?7:_context2.t0==="byte-order-mark"?16:_context2.t0==="space"?16:_context2.t0==="comment"?17:_context2.t0==="newline"?17:_context2.t0==="error"?19:_context2.t0==="doc-end"?23:33;break;case 3:this.directives.add(token.source,(function(offset,message,warning){var pos=getErrorPos(token);pos[0]+=offset;_this3.onError(pos,"BAD_DIRECTIVE",message,warning)}));this.prelude.push(token.source);this.atDirectives=true;return _context2.abrupt("break",34);case 7:doc=(0,_composeDoc.composeDoc)(this.options,this.directives,token,this.onError);if(this.atDirectives&&!doc.directives.docStart)this.onError(token,"MISSING_CHAR","Missing directives-end/doc-start indicator line");this.decorate(doc,false);if(!this.doc){_context2.next=13;break}_context2.next=13;return this.doc;case 13:this.doc=doc;this.atDirectives=false;return _context2.abrupt("break",34);case 16:return _context2.abrupt("break",34);case 17:this.prelude.push(token.source);return _context2.abrupt("break",34);case 19:msg=token.source?"".concat(token.message,": ").concat(JSON.stringify(token.source)):token.message;error=new _errors.YAMLParseError(getErrorPos(token),"UNEXPECTED_TOKEN",msg);if(this.atDirectives||!this.doc)this.errors.push(error);else this.doc.errors.push(error);return _context2.abrupt("break",34);case 23:if(this.doc){_context2.next=27;break}_msg="Unexpected doc-end without preceding document";this.errors.push(new _errors.YAMLParseError(getErrorPos(token),"UNEXPECTED_TOKEN",_msg));return _context2.abrupt("break",34);case 27:this.doc.directives.docEnd=true;end=(0,_resolveEnd.resolveEnd)(token.end,token.offset+token.source.length,this.doc.options.strict,this.onError);this.decorate(this.doc,true);if(end.comment){dc=this.doc.comment;this.doc.comment=dc?"".concat(dc,"\n").concat(end.comment):end.comment}this.doc.range[2]=end.offset;return _context2.abrupt("break",34);case 33:this.errors.push(new _errors.YAMLParseError(getErrorPos(token),"UNEXPECTED_TOKEN","Unsupported token ".concat(token.type)));case 34:case"end":return _context2.stop()}}),next,this)}))},{key:"end",value:function end(){var _this4=this;var forceDoc=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;var endOffset=arguments.length>1&&arguments[1]!==undefined?arguments[1]:-1;return _regeneratorRuntime().mark((function _callee2(){var opts,doc;return _regeneratorRuntime().wrap((function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:if(!_this4.doc){_context3.next=7;break}_this4.decorate(_this4.doc,true);_context3.next=4;return _this4.doc;case 4:_this4.doc=null;_context3.next=15;break;case 7:if(!forceDoc){_context3.next=15;break}opts=Object.assign({_directives:_this4.directives},_this4.options);doc=new _Document.Document(undefined,opts);if(_this4.atDirectives)_this4.onError(endOffset,"MISSING_CHAR","Missing directives-end indicator line");doc.range=[0,endOffset,endOffset];_this4.decorate(doc,false);_context3.next=15;return doc;case 15:case"end":return _context3.stop()}}),_callee2)}))()}}])}()},{"../doc/Document.js":240,"../doc/directives.js":244,"../errors.js":245,"../nodes/identity.js":256,"./compose-doc.js":225,"./resolve-end.js":232}],229:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.resolveBlockMap=resolveBlockMap;var _Pair=require("../nodes/Pair.js");var _YAMLMap=require("../nodes/YAMLMap.js");var _resolveProps=require("./resolve-props.js");var _utilContainsNewline=require("./util-contains-newline.js");var _utilFlowIndentCheck=require("./util-flow-indent-check.js");var _utilMapIncludes=require("./util-map-includes.js");function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}var startColMsg="All mapping items must start at the same column";function resolveBlockMap(_ref,ctx,bm,onError,tag){var _tag$nodeClass;var composeNode=_ref.composeNode,composeEmptyNode=_ref.composeEmptyNode;var NodeClass=(_tag$nodeClass=tag===null||tag===void 0?void 0:tag.nodeClass)!==null&&_tag$nodeClass!==void 0?_tag$nodeClass:_YAMLMap.YAMLMap;var map=new NodeClass(ctx.schema);if(ctx.atRoot)ctx.atRoot=false;var offset=bm.offset;var commentEnd=null;var _iterator=_createForOfIteratorHelper(bm.items),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var _keyProps$found;var collItem=_step.value;var start=collItem.start,key=collItem.key,sep=collItem.sep,value=collItem.value;var keyProps=(0,_resolveProps.resolveProps)(start,{indicator:"explicit-key-ind",next:key!==null&&key!==void 0?key:sep===null||sep===void 0?void 0:sep[0],offset:offset,onError:onError,parentIndent:bm.indent,startOnNewline:true});var implicitKey=!keyProps.found;if(implicitKey){if(key){if(key.type==="block-seq")onError(offset,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in key&&key.indent!==bm.indent)onError(offset,"BAD_INDENT",startColMsg)}if(!keyProps.anchor&&!keyProps.tag&&!sep){commentEnd=keyProps.end;if(keyProps.comment){if(map.comment)map.comment+="\n"+keyProps.comment;else map.comment=keyProps.comment}continue}if(keyProps.newlineAfterProp||(0,_utilContainsNewline.containsNewline)(key)){onError(key!==null&&key!==void 0?key:start[start.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}}else if(((_keyProps$found=keyProps.found)===null||_keyProps$found===void 0?void 0:_keyProps$found.indent)!==bm.indent){onError(offset,"BAD_INDENT",startColMsg)}ctx.atKey=true;var keyStart=keyProps.end;var keyNode=key?composeNode(ctx,key,keyProps,onError):composeEmptyNode(ctx,keyStart,start,null,keyProps,onError);if(ctx.schema.compat)(0,_utilFlowIndentCheck.flowIndentCheck)(bm.indent,key,onError);ctx.atKey=false;if((0,_utilMapIncludes.mapIncludes)(ctx,map.items,keyNode))onError(keyStart,"DUPLICATE_KEY","Map keys must be unique");var valueProps=(0,_resolveProps.resolveProps)(sep!==null&&sep!==void 0?sep:[],{indicator:"map-value-ind",next:value,offset:keyNode.range[2],onError:onError,parentIndent:bm.indent,startOnNewline:!key||key.type==="block-scalar"});offset=valueProps.end;if(valueProps.found){if(implicitKey){if((value===null||value===void 0?void 0:value.type)==="block-map"&&!valueProps.hasNewline)onError(offset,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(ctx.options.strict&&keyProps.start<valueProps.found.offset-1024)onError(keyNode.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}var valueNode=value?composeNode(ctx,value,valueProps,onError):composeEmptyNode(ctx,offset,sep,null,valueProps,onError);if(ctx.schema.compat)(0,_utilFlowIndentCheck.flowIndentCheck)(bm.indent,value,onError);offset=valueNode.range[2];var pair=new _Pair.Pair(keyNode,valueNode);if(ctx.options.keepSourceTokens)pair.srcToken=collItem;map.items.push(pair)}else{if(implicitKey)onError(keyNode.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(valueProps.comment){if(keyNode.comment)keyNode.comment+="\n"+valueProps.comment;else keyNode.comment=valueProps.comment}var _pair=new _Pair.Pair(keyNode);if(ctx.options.keepSourceTokens)_pair.srcToken=collItem;map.items.push(_pair)}}}catch(err){_iterator.e(err)}finally{_iterator.f()}if(commentEnd&&commentEnd<offset)onError(commentEnd,"IMPOSSIBLE","Map comment with trailing content");map.range=[bm.offset,offset,commentEnd!==null&&commentEnd!==void 0?commentEnd:offset];return map}},{"../nodes/Pair.js":251,"../nodes/YAMLMap.js":253,"./resolve-props.js":235,"./util-contains-newline.js":236,"./util-flow-indent-check.js":238,"./util-map-includes.js":239}],230:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.resolveBlockScalar=resolveBlockScalar;var _Scalar=require("../nodes/Scalar.js");function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}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 _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function resolveBlockScalar(ctx,scalar,onError){var start=scalar.offset;var header=parseBlockScalarHeader(scalar,ctx.options.strict,onError);if(!header)return{value:"",type:null,comment:"",range:[start,start,start]};var type=header.mode===">"?_Scalar.Scalar.BLOCK_FOLDED:_Scalar.Scalar.BLOCK_LITERAL;var lines=scalar.source?splitLines(scalar.source):[];var chompStart=lines.length;for(var i=lines.length-1;i>=0;--i){var content=lines[i][1];if(content===""||content==="\r")chompStart=i;else break}if(chompStart===0){var _value=header.chomp==="+"&&lines.length>0?"\n".repeat(Math.max(1,lines.length-1)):"";var _end=start+header.length;if(scalar.source)_end+=scalar.source.length;return{value:_value,type:type,comment:header.comment,range:[start,_end,_end]}}var trimIndent=scalar.indent+header.indent;var offset=scalar.offset+header.length;var contentStart=0;for(var _i=0;_i<chompStart;++_i){var _lines$_i=_slicedToArray(lines[_i],2),indent=_lines$_i[0],_content=_lines$_i[1];if(_content===""||_content==="\r"){if(header.indent===0&&indent.length>trimIndent)trimIndent=indent.length}else{if(indent.length<trimIndent){var message="Block scalars with more-indented leading empty lines must use an explicit indentation indicator";onError(offset+indent.length,"MISSING_CHAR",message)}if(header.indent===0)trimIndent=indent.length;contentStart=_i;if(trimIndent===0&&!ctx.atRoot){var _message="Block scalar values in collections must be indented";onError(offset,"BAD_INDENT",_message)}break}offset+=indent.length+_content.length+1}for(var _i2=lines.length-1;_i2>=chompStart;--_i2){if(lines[_i2][0].length>trimIndent)chompStart=_i2+1}var value="";var sep="";var prevMoreIndented=false;for(var _i3=0;_i3<contentStart;++_i3)value+=lines[_i3][0].slice(trimIndent)+"\n";for(var _i4=contentStart;_i4<chompStart;++_i4){var _lines$_i2=_slicedToArray(lines[_i4],2),_indent=_lines$_i2[0],_content2=_lines$_i2[1];offset+=_indent.length+_content2.length+1;var crlf=_content2[_content2.length-1]==="\r";if(crlf)_content2=_content2.slice(0,-1);if(_content2&&_indent.length<trimIndent){var src=header.indent?"explicit indentation indicator":"first line";var _message2="Block scalar lines must not be less indented than their ".concat(src);onError(offset-_content2.length-(crlf?2:1),"BAD_INDENT",_message2);_indent=""}if(type===_Scalar.Scalar.BLOCK_LITERAL){value+=sep+_indent.slice(trimIndent)+_content2;sep="\n"}else if(_indent.length>trimIndent||_content2[0]==="\t"){if(sep===" ")sep="\n";else if(!prevMoreIndented&&sep==="\n")sep="\n\n";value+=sep+_indent.slice(trimIndent)+_content2;sep="\n";prevMoreIndented=true}else if(_content2===""){if(sep==="\n")value+="\n";else sep="\n"}else{value+=sep+_content2;sep=" ";prevMoreIndented=false}}switch(header.chomp){case"-":break;case"+":for(var _i5=chompStart;_i5<lines.length;++_i5)value+="\n"+lines[_i5][0].slice(trimIndent);if(value[value.length-1]!=="\n")value+="\n";break;default:value+="\n"}var end=start+header.length+scalar.source.length;return{value:value,type:type,comment:header.comment,range:[start,end,end]}}function parseBlockScalarHeader(_ref,strict,onError){var offset=_ref.offset,props=_ref.props;if(props[0].type!=="block-scalar-header"){onError(props[0],"IMPOSSIBLE","Block scalar header not found");return null}var source=props[0].source;var mode=source[0];var indent=0;var chomp="";var error=-1;for(var i=1;i<source.length;++i){var ch=source[i];if(!chomp&&(ch==="-"||ch==="+"))chomp=ch;else{var n=Number(ch);if(!indent&&n)indent=n;else if(error===-1)error=offset+i}}if(error!==-1)onError(error,"UNEXPECTED_TOKEN","Block scalar header includes extra characters: ".concat(source));var hasSpace=false;var comment="";var length=source.length;for(var _i6=1;_i6<props.length;++_i6){var token=props[_i6];switch(token.type){case"space":hasSpace=true;case"newline":length+=token.source.length;break;case"comment":if(strict&&!hasSpace){var message="Comments must be separated from other tokens by white space characters";onError(token,"MISSING_CHAR",message)}length+=token.source.length;comment=token.source.substring(1);break;case"error":onError(token,"UNEXPECTED_TOKEN",token.message);length+=token.source.length;break;default:{var _message3="Unexpected token in block scalar header: ".concat(token.type);onError(token,"UNEXPECTED_TOKEN",_message3);var ts=token.source;if(ts&&typeof ts==="string")length+=ts.length}}}return{mode:mode,indent:indent,chomp:chomp,comment:comment,length:length}}function splitLines(source){var split=source.split(/\n( *)/);var first=split[0];var m=first.match(/^( *)/);var line0=m!==null&&m!==void 0&&m[1]?[m[1],first.slice(m[1].length)]:["",first];var lines=[line0];for(var i=1;i<split.length;i+=2)lines.push([split[i],split[i+1]]);return lines}},{"../nodes/Scalar.js":252}],231:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.resolveBlockSeq=resolveBlockSeq;var _YAMLSeq=require("../nodes/YAMLSeq.js");var _resolveProps=require("./resolve-props.js");var _utilFlowIndentCheck=require("./util-flow-indent-check.js");function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function resolveBlockSeq(_ref,ctx,bs,onError,tag){var _tag$nodeClass;var composeNode=_ref.composeNode,composeEmptyNode=_ref.composeEmptyNode;var NodeClass=(_tag$nodeClass=tag===null||tag===void 0?void 0:tag.nodeClass)!==null&&_tag$nodeClass!==void 0?_tag$nodeClass:_YAMLSeq.YAMLSeq;var seq=new NodeClass(ctx.schema);if(ctx.atRoot)ctx.atRoot=false;if(ctx.atKey)ctx.atKey=false;var offset=bs.offset;var commentEnd=null;var _iterator=_createForOfIteratorHelper(bs.items),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var _step$value=_step.value,start=_step$value.start,value=_step$value.value;var props=(0,_resolveProps.resolveProps)(start,{indicator:"seq-item-ind",next:value,offset:offset,onError:onError,parentIndent:bs.indent,startOnNewline:true});if(!props.found){if(props.anchor||props.tag||value){if(value&&value.type==="block-seq")onError(props.end,"BAD_INDENT","All sequence items must start at the same column");else onError(offset,"MISSING_CHAR","Sequence item without - indicator")}else{commentEnd=props.end;if(props.comment)seq.comment=props.comment;continue}}var node=value?composeNode(ctx,value,props,onError):composeEmptyNode(ctx,props.end,start,null,props,onError);if(ctx.schema.compat)(0,_utilFlowIndentCheck.flowIndentCheck)(bs.indent,value,onError);offset=node.range[2];seq.items.push(node)}}catch(err){_iterator.e(err)}finally{_iterator.f()}seq.range=[bs.offset,offset,commentEnd!==null&&commentEnd!==void 0?commentEnd:offset];return seq}},{"../nodes/YAMLSeq.js":254,"./resolve-props.js":235,"./util-flow-indent-check.js":238}],232:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.resolveEnd=resolveEnd;function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function resolveEnd(end,offset,reqSpace,onError){var comment="";if(end){var hasSpace=false;var sep="";var _iterator=_createForOfIteratorHelper(end),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var token=_step.value;var source=token.source,type=token.type;switch(type){case"space":hasSpace=true;break;case"comment":{if(reqSpace&&!hasSpace)onError(token,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");var cb=source.substring(1)||" ";if(!comment)comment=cb;else comment+=sep+cb;sep="";break}case"newline":if(comment)sep+=source;hasSpace=true;break;default:onError(token,"UNEXPECTED_TOKEN","Unexpected ".concat(type," at node end"))}offset+=source.length}}catch(err){_iterator.e(err)}finally{_iterator.f()}}return{comment:comment,offset:offset}}},{}],233:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.resolveFlowCollection=resolveFlowCollection;var _identity=require("../nodes/identity.js");var _Pair=require("../nodes/Pair.js");var _YAMLMap=require("../nodes/YAMLMap.js");var _YAMLSeq=require("../nodes/YAMLSeq.js");var _resolveEnd=require("./resolve-end.js");var _resolveProps=require("./resolve-props.js");var _utilContainsNewline=require("./util-contains-newline.js");var _utilMapIncludes=require("./util-map-includes.js");function _toArray(r){return _arrayWithHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableRest()}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 _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}function _arrayWithHoles(r){if(Array.isArray(r))return r}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}var blockMsg="Block collections are not allowed within flow collections";var isBlock=function isBlock(token){return token&&(token.type==="block-map"||token.type==="block-seq")};function resolveFlowCollection(_ref,ctx,fc,onError,tag){var _tag$nodeClass;var composeNode=_ref.composeNode,composeEmptyNode=_ref.composeEmptyNode;var isMap=fc.start.source==="{";var fcName=isMap?"flow map":"flow sequence";var NodeClass=(_tag$nodeClass=tag===null||tag===void 0?void 0:tag.nodeClass)!==null&&_tag$nodeClass!==void 0?_tag$nodeClass:isMap?_YAMLMap.YAMLMap:_YAMLSeq.YAMLSeq;var coll=new NodeClass(ctx.schema);coll.flow=true;var atRoot=ctx.atRoot;if(atRoot)ctx.atRoot=false;if(ctx.atKey)ctx.atKey=false;var offset=fc.offset+fc.start.source.length;for(var i=0;i<fc.items.length;++i){var collItem=fc.items[i];var start=collItem.start,key=collItem.key,sep=collItem.sep,value=collItem.value;var props=(0,_resolveProps.resolveProps)(start,{flow:fcName,indicator:"explicit-key-ind",next:key!==null&&key!==void 0?key:sep===null||sep===void 0?void 0:sep[0],offset:offset,onError:onError,parentIndent:fc.indent,startOnNewline:false});if(!props.found){if(!props.anchor&&!props.tag&&!sep&&!value){if(i===0&&props.comma)onError(props.comma,"UNEXPECTED_TOKEN","Unexpected , in ".concat(fcName));else if(i<fc.items.length-1)onError(props.start,"UNEXPECTED_TOKEN","Unexpected empty item in ".concat(fcName));if(props.comment){if(coll.comment)coll.comment+="\n"+props.comment;else coll.comment=props.comment}offset=props.end;continue}if(!isMap&&ctx.options.strict&&(0,_utilContainsNewline.containsNewline)(key))onError(key,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(i===0){if(props.comma)onError(props.comma,"UNEXPECTED_TOKEN","Unexpected , in ".concat(fcName))}else{if(!props.comma)onError(props.start,"MISSING_CHAR","Missing , between ".concat(fcName," items"));if(props.comment){var prevItemComment="";var _iterator=_createForOfIteratorHelper(start),_step;try{loop:for(_iterator.s();!(_step=_iterator.n()).done;){var st=_step.value;switch(st.type){case"comma":case"space":break;case"comment":prevItemComment=st.source.substring(1);break loop;default:break loop}}}catch(err){_iterator.e(err)}finally{_iterator.f()}if(prevItemComment){var _prev$value;var prev=coll.items[coll.items.length-1];if((0,_identity.isPair)(prev))prev=(_prev$value=prev.value)!==null&&_prev$value!==void 0?_prev$value:prev.key;if(prev.comment)prev.comment+="\n"+prevItemComment;else prev.comment=prevItemComment;props.comment=props.comment.substring(prevItemComment.length+1)}}}if(!isMap&&!sep&&!props.found){var valueNode=value?composeNode(ctx,value,props,onError):composeEmptyNode(ctx,props.end,sep,null,props,onError);coll.items.push(valueNode);offset=valueNode.range[2];if(isBlock(value))onError(valueNode.range,"BLOCK_IN_FLOW",blockMsg)}else{ctx.atKey=true;var keyStart=props.end;var keyNode=key?composeNode(ctx,key,props,onError):composeEmptyNode(ctx,keyStart,start,null,props,onError);if(isBlock(key))onError(keyNode.range,"BLOCK_IN_FLOW",blockMsg);ctx.atKey=false;var valueProps=(0,_resolveProps.resolveProps)(sep!==null&&sep!==void 0?sep:[],{flow:fcName,indicator:"map-value-ind",next:value,offset:keyNode.range[2],onError:onError,parentIndent:fc.indent,startOnNewline:false});if(valueProps.found){if(!isMap&&!props.found&&ctx.options.strict){if(sep){var _iterator2=_createForOfIteratorHelper(sep),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var _st=_step2.value;if(_st===valueProps.found)break;if(_st.type==="newline"){onError(_st,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}}if(props.start<valueProps.found.offset-1024)onError(valueProps.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(value){if("source"in value&&value.source&&value.source[0]===":")onError(value,"MISSING_CHAR","Missing space after : in ".concat(fcName));else onError(valueProps.start,"MISSING_CHAR","Missing , or : between ".concat(fcName," items"))}var _valueNode=value?composeNode(ctx,value,valueProps,onError):valueProps.found?composeEmptyNode(ctx,valueProps.end,sep,null,valueProps,onError):null;if(_valueNode){if(isBlock(value))onError(_valueNode.range,"BLOCK_IN_FLOW",blockMsg)}else if(valueProps.comment){if(keyNode.comment)keyNode.comment+="\n"+valueProps.comment;else keyNode.comment=valueProps.comment}var pair=new _Pair.Pair(keyNode,_valueNode);if(ctx.options.keepSourceTokens)pair.srcToken=collItem;if(isMap){var map=coll;if((0,_utilMapIncludes.mapIncludes)(ctx,map.items,keyNode))onError(keyStart,"DUPLICATE_KEY","Map keys must be unique");map.items.push(pair)}else{var _map=new _YAMLMap.YAMLMap(ctx.schema);_map.flow=true;_map.items.push(pair);var endRange=(_valueNode!==null&&_valueNode!==void 0?_valueNode:keyNode).range;_map.range=[keyNode.range[0],endRange[1],endRange[2]];coll.items.push(_map)}offset=_valueNode?_valueNode.range[2]:valueProps.end}}var expectedEnd=isMap?"}":"]";var _fc$end=_toArray(fc.end),ce=_fc$end[0],ee=_fc$end.slice(1);var cePos=offset;if(ce&&ce.source===expectedEnd)cePos=ce.offset+ce.source.length;else{var name=fcName[0].toUpperCase()+fcName.substring(1);var msg=atRoot?"".concat(name," must end with a ").concat(expectedEnd):"".concat(name," in block collection must be sufficiently indented and end with a ").concat(expectedEnd);onError(offset,atRoot?"MISSING_CHAR":"BAD_INDENT",msg);if(ce&&ce.source.length!==1)ee.unshift(ce)}if(ee.length>0){var end=(0,_resolveEnd.resolveEnd)(ee,cePos,ctx.options.strict,onError);if(end.comment){if(coll.comment)coll.comment+="\n"+end.comment;else coll.comment=end.comment}coll.range=[fc.offset,cePos,end.offset]}else{coll.range=[fc.offset,cePos,cePos]}return coll}},{"../nodes/Pair.js":251,"../nodes/YAMLMap.js":253,"../nodes/YAMLSeq.js":254,"../nodes/identity.js":256,"./resolve-end.js":232,"./resolve-props.js":235,"./util-contains-newline.js":236,"./util-map-includes.js":239}],234:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.resolveFlowScalar=resolveFlowScalar;var _Scalar=require("../nodes/Scalar.js");var _resolveEnd=require("./resolve-end.js");function resolveFlowScalar(scalar,strict,onError){var offset=scalar.offset,type=scalar.type,source=scalar.source,end=scalar.end;var _type;var value;var _onError=function _onError(rel,code,msg){return onError(offset+rel,code,msg)};switch(type){case"scalar":_type=_Scalar.Scalar.PLAIN;value=plainValue(source,_onError);break;case"single-quoted-scalar":_type=_Scalar.Scalar.QUOTE_SINGLE;value=singleQuotedValue(source,_onError);break;case"double-quoted-scalar":_type=_Scalar.Scalar.QUOTE_DOUBLE;value=doubleQuotedValue(source,_onError);break;default:onError(scalar,"UNEXPECTED_TOKEN","Expected a flow scalar value, but found: ".concat(type));return{value:"",type:null,comment:"",range:[offset,offset+source.length,offset+source.length]}}var valueEnd=offset+source.length;var re=(0,_resolveEnd.resolveEnd)(end,valueEnd,strict,onError);return{value:value,type:_type,comment:re.comment,range:[offset,valueEnd,re.offset]}}function plainValue(source,onError){var badChar="";switch(source[0]){case"\t":badChar="a tab character";break;case",":badChar="flow indicator character ,";break;case"%":badChar="directive indicator character %";break;case"|":case">":{badChar="block scalar indicator ".concat(source[0]);break}case"@":case"`":{badChar="reserved character ".concat(source[0]);break}}if(badChar)onError(0,"BAD_SCALAR_START","Plain value cannot start with ".concat(badChar));return foldLines(source)}function singleQuotedValue(source,onError){if(source[source.length-1]!=="'"||source.length===1)onError(source.length,"MISSING_CHAR","Missing closing 'quote");return foldLines(source.slice(1,-1)).replace(/''/g,"'")}function foldLines(source){var _match$,_match;var first,line;try{first=new RegExp("(.*?)(?<![ \t])[ \t]*\r?\n","sy");line=new RegExp("[ \t]*(.*?)(?:(?<![ \t])[ \t]*)?\r?\n","sy")}catch(_unused){first=new RegExp("([^]*?)[ \\t]*\\r?\\n","y");line=new RegExp("[ \\t]*([^]*?)[ \\t]*\\r?\\n","y")}var match=first.exec(source);if(!match)return source;var res=match[1];var sep=" ";var pos=first.lastIndex;line.lastIndex=pos;while(match=line.exec(source)){if(match[1]===""){if(sep==="\n")res+=sep;else sep="\n"}else{res+=sep+match[1];sep=" "}pos=line.lastIndex}var last=new RegExp("[ \\t]*([^]*)","y");last.lastIndex=pos;match=last.exec(source);return res+sep+((_match$=(_match=match)===null||_match===void 0?void 0:_match[1])!==null&&_match$!==void 0?_match$:"")}function doubleQuotedValue(source,onError){var res="";for(var i=1;i<source.length-1;++i){var ch=source[i];if(ch==="\r"&&source[i+1]==="\n")continue;if(ch==="\n"){var _foldNewline=foldNewline(source,i),fold=_foldNewline.fold,offset=_foldNewline.offset;res+=fold;i=offset}else if(ch==="\\"){var next=source[++i];var cc=escapeCodes[next];if(cc)res+=cc;else if(next==="\n"){next=source[i+1];while(next===" "||next==="\t")next=source[++i+1]}else if(next==="\r"&&source[i+1]==="\n"){next=source[++i+1];while(next===" "||next==="\t")next=source[++i+1]}else if(next==="x"||next==="u"||next==="U"){var length={x:2,u:4,U:8}[next];res+=parseCharCode(source,i+1,length,onError);i+=length}else{var raw=source.substr(i-1,2);onError(i-1,"BAD_DQ_ESCAPE","Invalid escape sequence ".concat(raw));res+=raw}}else if(ch===" "||ch==="\t"){var wsStart=i;var _next=source[i+1];while(_next===" "||_next==="\t")_next=source[++i+1];if(_next!=="\n"&&!(_next==="\r"&&source[i+2]==="\n"))res+=i>wsStart?source.slice(wsStart,i+1):ch}else{res+=ch}}if(source[source.length-1]!=='"'||source.length===1)onError(source.length,"MISSING_CHAR",'Missing closing "quote');return res}function foldNewline(source,offset){var fold="";var ch=source[offset+1];while(ch===" "||ch==="\t"||ch==="\n"||ch==="\r"){if(ch==="\r"&&source[offset+2]!=="\n")break;if(ch==="\n")fold+="\n";offset+=1;ch=source[offset+1]}if(!fold)fold=" ";return{fold:fold,offset:offset}}var escapeCodes={0:"\0",a:"",b:"\b",e:"",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function parseCharCode(source,offset,length,onError){var cc=source.substr(offset,length);var ok=cc.length===length&&/^[0-9a-fA-F]+$/.test(cc);var code=ok?parseInt(cc,16):NaN;if(isNaN(code)){var raw=source.substr(offset-2,length+2);onError(offset-2,"BAD_DQ_ESCAPE","Invalid escape sequence ".concat(raw));return raw}return String.fromCodePoint(code)}},{"../nodes/Scalar.js":252,"./resolve-end.js":232}],235:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.resolveProps=resolveProps;function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function resolveProps(tokens,_ref){var flow=_ref.flow,indicator=_ref.indicator,next=_ref.next,offset=_ref.offset,onError=_ref.onError,parentIndent=_ref.parentIndent,startOnNewline=_ref.startOnNewline;var spaceBefore=false;var atNewline=startOnNewline;var hasSpace=startOnNewline;var comment="";var commentSep="";var hasNewline=false;var reqSpace=false;var tab=null;var anchor=null;var tag=null;var newlineAfterProp=null;var comma=null;var found=null;var start=null;var _iterator=_createForOfIteratorHelper(tokens),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var token=_step.value;if(reqSpace){if(token.type!=="space"&&token.type!=="newline"&&token.type!=="comma")onError(token.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");reqSpace=false}if(tab){if(atNewline&&token.type!=="comment"&&token.type!=="newline"){onError(tab,"TAB_AS_INDENT","Tabs are not allowed as indentation")}tab=null}switch(token.type){case"space":if(!flow&&(indicator!=="doc-start"||(next===null||next===void 0?void 0:next.type)!=="flow-collection")&&token.source.includes("\t")){tab=token}hasSpace=true;break;case"comment":{if(!hasSpace)onError(token,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");var cb=token.source.substring(1)||" ";if(!comment)comment=cb;else comment+=commentSep+cb;commentSep="";atNewline=false;break}case"newline":if(atNewline){if(comment)comment+=token.source;else spaceBefore=true}else commentSep+=token.source;atNewline=true;hasNewline=true;if(anchor||tag)newlineAfterProp=token;hasSpace=true;break;case"anchor":if(anchor)onError(token,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(token.source.endsWith(":"))onError(token.offset+token.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",true);anchor=token;if(start===null)start=token.offset;atNewline=false;hasSpace=false;reqSpace=true;break;case"tag":{if(tag)onError(token,"MULTIPLE_TAGS","A node can have at most one tag");tag=token;if(start===null)start=token.offset;atNewline=false;hasSpace=false;reqSpace=true;break}case indicator:if(anchor||tag)onError(token,"BAD_PROP_ORDER","Anchors and tags must be after the ".concat(token.source," indicator"));if(found)onError(token,"UNEXPECTED_TOKEN","Unexpected ".concat(token.source," in ").concat(flow!==null&&flow!==void 0?flow:"collection"));found=token;atNewline=indicator==="seq-item-ind"||indicator==="explicit-key-ind";hasSpace=false;break;case"comma":if(flow){if(comma)onError(token,"UNEXPECTED_TOKEN","Unexpected , in ".concat(flow));comma=token;atNewline=false;hasSpace=false;break}default:onError(token,"UNEXPECTED_TOKEN","Unexpected ".concat(token.type," token"));atNewline=false;hasSpace=false}}}catch(err){_iterator.e(err)}finally{_iterator.f()}var last=tokens[tokens.length-1];var end=last?last.offset+last.source.length:offset;if(reqSpace&&next&&next.type!=="space"&&next.type!=="newline"&&next.type!=="comma"&&(next.type!=="scalar"||next.source!=="")){onError(next.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space")}if(tab&&(atNewline&&tab.indent<=parentIndent||(next===null||next===void 0?void 0:next.type)==="block-map"||(next===null||next===void 0?void 0:next.type)==="block-seq"))onError(tab,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:comma,found:found,spaceBefore:spaceBefore,comment:comment,hasNewline:hasNewline,anchor:anchor,tag:tag,newlineAfterProp:newlineAfterProp,end:end,start:start!==null&&start!==void 0?start:end}}},{}],236:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.containsNewline=containsNewline;function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function containsNewline(key){if(!key)return null;switch(key.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(key.source.includes("\n"))return true;if(key.end){var _iterator=_createForOfIteratorHelper(key.end),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var st=_step.value;if(st.type==="newline")return true}}catch(err){_iterator.e(err)}finally{_iterator.f()}}return false;case"flow-collection":var _iterator2=_createForOfIteratorHelper(key.items),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var it=_step2.value;var _iterator3=_createForOfIteratorHelper(it.start),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var _st2=_step3.value;if(_st2.type==="newline")return true}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}if(it.sep){var _iterator4=_createForOfIteratorHelper(it.sep),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var _st=_step4.value;if(_st.type==="newline")return true}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}}if(containsNewline(it.key)||containsNewline(it.value))return true}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}return false;default:return true}}},{}],237:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.emptyScalarPosition=emptyScalarPosition;function emptyScalarPosition(offset,before,pos){if(before){if(pos===null)pos=before.length;for(var i=pos-1;i>=0;--i){var st=before[i];switch(st.type){case"space":case"comment":case"newline":offset-=st.source.length;continue}st=before[++i];while(((_st=st)===null||_st===void 0?void 0:_st.type)==="space"){var _st;offset+=st.source.length;st=before[++i]}break}}return offset}},{}],238:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.flowIndentCheck=flowIndentCheck;var _utilContainsNewline=require("./util-contains-newline.js");function flowIndentCheck(indent,fc,onError){if((fc===null||fc===void 0?void 0:fc.type)==="flow-collection"){var end=fc.end[0];if(end.indent===indent&&(end.source==="]"||end.source==="}")&&(0,_utilContainsNewline.containsNewline)(fc)){var msg="Flow end indicator should be more indented than parent";onError(end,"BAD_INDENT",msg,true)}}}},{"./util-contains-newline.js":236}],239:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.mapIncludes=mapIncludes;var _identity=require("../nodes/identity.js");function mapIncludes(ctx,items,search){var uniqueKeys=ctx.options.uniqueKeys;if(uniqueKeys===false)return false;var isEqual=typeof uniqueKeys==="function"?uniqueKeys:function(a,b){return a===b||(0,_identity.isScalar)(a)&&(0,_identity.isScalar)(b)&&a.value===b.value};return items.some((function(pair){return isEqual(pair.key,search)}))}},{"../nodes/identity.js":256}],240:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.Document=void 0;var _Alias=require("../nodes/Alias.js");var _Collection=require("../nodes/Collection.js");var _identity=require("../nodes/identity.js");var _Pair=require("../nodes/Pair.js");var _toJS2=require("../nodes/toJS.js");var _Schema=require("../schema/Schema.js");var _stringifyDocument=require("../stringify/stringifyDocument.js");var _anchors=require("./anchors.js");var _applyReviver=require("./applyReviver.js");var _createNode2=require("./createNode.js");var _directives=require("./directives.js");function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var Document=exports.Document=function(){function Document(value,replacer,options){var _options;_classCallCheck(this,Document);this.commentBefore=null;this.comment=null;this.errors=[];this.warnings=[];Object.defineProperty(this,_identity.NODE_TYPE,{value:_identity.DOC});var _replacer=null;if(typeof replacer==="function"||Array.isArray(replacer)){_replacer=replacer}else if(options===undefined&&replacer){options=replacer;replacer=undefined}var opt=Object.assign({intAsBigInt:false,keepSourceTokens:false,logLevel:"warn",prettyErrors:true,strict:true,stringKeys:false,uniqueKeys:true,version:"1.2"},options);this.options=opt;var version=opt.version;if((_options=options)!==null&&_options!==void 0&&_options._directives){this.directives=options._directives.atDocument();if(this.directives.yaml.explicit)version=this.directives.yaml.version}else this.directives=new _directives.Directives({version:version});this.setSchema(version,options);this.contents=value===undefined?null:this.createNode(value,_replacer,options)}return _createClass(Document,[{key:"clone",value:function clone(){var copy=Object.create(Document.prototype,_defineProperty({},_identity.NODE_TYPE,{value:_identity.DOC}));copy.commentBefore=this.commentBefore;copy.comment=this.comment;copy.errors=this.errors.slice();copy.warnings=this.warnings.slice();copy.options=Object.assign({},this.options);if(this.directives)copy.directives=this.directives.clone();copy.schema=this.schema.clone();copy.contents=(0,_identity.isNode)(this.contents)?this.contents.clone(copy.schema):this.contents;if(this.range)copy.range=this.range.slice();return copy}},{key:"add",value:function add(value){if(assertCollection(this.contents))this.contents.add(value)}},{key:"addIn",value:function addIn(path,value){if(assertCollection(this.contents))this.contents.addIn(path,value)}},{key:"createAlias",value:function createAlias(node,name){if(!node.anchor){var prev=(0,_anchors.anchorNames)(this);node.anchor=!name||prev.has(name)?(0,_anchors.findNewAnchor)(name||"a",prev):name}return new _Alias.Alias(node.anchor)}},{key:"createNode",value:function createNode(value,replacer,options){var _replacer=undefined;if(typeof replacer==="function"){value=replacer.call({"":value},"",value);_replacer=replacer}else if(Array.isArray(replacer)){var keyToStr=function keyToStr(v){return typeof v==="number"||v instanceof String||v instanceof Number};var asStr=replacer.filter(keyToStr).map(String);if(asStr.length>0)replacer=replacer.concat(asStr);_replacer=replacer}else if(options===undefined&&replacer){options=replacer;replacer=undefined}var _ref=options!==null&&options!==void 0?options:{},aliasDuplicateObjects=_ref.aliasDuplicateObjects,anchorPrefix=_ref.anchorPrefix,flow=_ref.flow,keepUndefined=_ref.keepUndefined,onTagObj=_ref.onTagObj,tag=_ref.tag;var _createNodeAnchors=(0,_anchors.createNodeAnchors)(this,anchorPrefix||"a"),onAnchor=_createNodeAnchors.onAnchor,setAnchors=_createNodeAnchors.setAnchors,sourceObjects=_createNodeAnchors.sourceObjects;var ctx={aliasDuplicateObjects:aliasDuplicateObjects!==null&&aliasDuplicateObjects!==void 0?aliasDuplicateObjects:true,keepUndefined:keepUndefined!==null&&keepUndefined!==void 0?keepUndefined:false,onAnchor:onAnchor,onTagObj:onTagObj,replacer:_replacer,schema:this.schema,sourceObjects:sourceObjects};var node=(0,_createNode2.createNode)(value,tag,ctx);if(flow&&(0,_identity.isCollection)(node))node.flow=true;setAnchors();return node}},{key:"createPair",value:function createPair(key,value){var options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var k=this.createNode(key,null,options);var v=this.createNode(value,null,options);return new _Pair.Pair(k,v)}},{key:"delete",value:function _delete(key){return assertCollection(this.contents)?this.contents["delete"](key):false}},{key:"deleteIn",value:function deleteIn(path){if((0,_Collection.isEmptyPath)(path)){if(this.contents==null)return false;this.contents=null;return true}return assertCollection(this.contents)?this.contents.deleteIn(path):false}},{key:"get",value:function get(key,keepScalar){return(0,_identity.isCollection)(this.contents)?this.contents.get(key,keepScalar):undefined}},{key:"getIn",value:function getIn(path,keepScalar){if((0,_Collection.isEmptyPath)(path))return!keepScalar&&(0,_identity.isScalar)(this.contents)?this.contents.value:this.contents;return(0,_identity.isCollection)(this.contents)?this.contents.getIn(path,keepScalar):undefined}},{key:"has",value:function has(key){return(0,_identity.isCollection)(this.contents)?this.contents.has(key):false}},{key:"hasIn",value:function hasIn(path){if((0,_Collection.isEmptyPath)(path))return this.contents!==undefined;return(0,_identity.isCollection)(this.contents)?this.contents.hasIn(path):false}},{key:"set",value:function set(key,value){if(this.contents==null){this.contents=(0,_Collection.collectionFromPath)(this.schema,[key],value)}else if(assertCollection(this.contents)){this.contents.set(key,value)}}},{key:"setIn",value:function setIn(path,value){if((0,_Collection.isEmptyPath)(path)){this.contents=value}else if(this.contents==null){this.contents=(0,_Collection.collectionFromPath)(this.schema,Array.from(path),value)}else if(assertCollection(this.contents)){this.contents.setIn(path,value)}}},{key:"setSchema",value:function setSchema(version){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(typeof version==="number")version=String(version);var opt;switch(version){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new _directives.Directives({version:"1.1"});opt={resolveKnownTags:false,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=version;else this.directives=new _directives.Directives({version:version});opt={resolveKnownTags:true,schema:"core"};break;case null:if(this.directives)delete this.directives;opt=null;break;default:{var sv=JSON.stringify(version);throw new Error("Expected '1.1', '1.2' or null as first argument, but found: ".concat(sv))}}if(options.schema instanceof Object)this.schema=options.schema;else if(opt)this.schema=new _Schema.Schema(Object.assign(opt,options));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}},{key:"toJS",value:function toJS(){var _ref2=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},json=_ref2.json,jsonArg=_ref2.jsonArg,mapAsMap=_ref2.mapAsMap,maxAliasCount=_ref2.maxAliasCount,onAnchor=_ref2.onAnchor,reviver=_ref2.reviver;var ctx={anchors:new Map,doc:this,keep:!json,mapAsMap:mapAsMap===true,mapKeyWarned:false,maxAliasCount:typeof maxAliasCount==="number"?maxAliasCount:100};var res=(0,_toJS2.toJS)(this.contents,jsonArg!==null&&jsonArg!==void 0?jsonArg:"",ctx);if(typeof onAnchor==="function"){var _iterator=_createForOfIteratorHelper(ctx.anchors.values()),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var _step$value=_step.value,count=_step$value.count,_res=_step$value.res;onAnchor(_res,count)}}catch(err){_iterator.e(err)}finally{_iterator.f()}}return typeof reviver==="function"?(0,_applyReviver.applyReviver)(reviver,{"":res},"",res):res}},{key:"toJSON",value:function toJSON(jsonArg,onAnchor){return this.toJS({json:true,jsonArg:jsonArg,mapAsMap:false,onAnchor:onAnchor})}},{key:"toString",value:function toString(){var options=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in options&&(!Number.isInteger(options.indent)||Number(options.indent)<=0)){var s=JSON.stringify(options.indent);throw new Error('"indent" option must be a positive integer, not '.concat(s))}return(0,_stringifyDocument.stringifyDocument)(this,options)}}])}();function assertCollection(contents){if((0,_identity.isCollection)(contents))return true;throw new Error("Expected a YAML collection as document contents")}},{"../nodes/Alias.js":248,"../nodes/Collection.js":249,"../nodes/Pair.js":251,"../nodes/identity.js":256,"../nodes/toJS.js":257,"../schema/Schema.js":266,"../stringify/stringifyDocument.js":291,"./anchors.js":241,"./applyReviver.js":242,"./createNode.js":243,"./directives.js":244}],241:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.anchorIsValid=anchorIsValid;exports.anchorNames=anchorNames;exports.createNodeAnchors=createNodeAnchors;exports.findNewAnchor=findNewAnchor;var _identity=require("../nodes/identity.js");var _visit=require("../visit.js");function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function anchorIsValid(anchor){if(/[\x00-\x19\s,[\]{}]/.test(anchor)){var sa=JSON.stringify(anchor);var msg="Anchor must not contain whitespace or control characters: ".concat(sa);throw new Error(msg)}return true}function anchorNames(root){var anchors=new Set;(0,_visit.visit)(root,{Value:function Value(_key,node){if(node.anchor)anchors.add(node.anchor)}});return anchors}function findNewAnchor(prefix,exclude){for(var i=1;true;++i){var name="".concat(prefix).concat(i);if(!exclude.has(name))return name}}function createNodeAnchors(doc,prefix){var aliasObjects=[];var sourceObjects=new Map;var prevAnchors=null;return{onAnchor:function onAnchor(source){aliasObjects.push(source);if(!prevAnchors)prevAnchors=anchorNames(doc);var anchor=findNewAnchor(prefix,prevAnchors);prevAnchors.add(anchor);return anchor},setAnchors:function setAnchors(){for(var _i=0,_aliasObjects=aliasObjects;_i<_aliasObjects.length;_i++){var source=_aliasObjects[_i];var ref=sourceObjects.get(source);if(_typeof(ref)==="object"&&ref.anchor&&((0,_identity.isScalar)(ref.node)||(0,_identity.isCollection)(ref.node))){ref.node.anchor=ref.anchor}else{var error=new Error("Failed to resolve repeated object (this should not happen)");error.source=source;throw error}}},sourceObjects:sourceObjects}}},{"../nodes/identity.js":256,"../visit.js":295}],242:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.applyReviver=applyReviver;function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}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 _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function applyReviver(reviver,obj,key,val){if(val&&_typeof(val)==="object"){if(Array.isArray(val)){for(var i=0,len=val.length;i<len;++i){var v0=val[i];var v1=applyReviver(reviver,val,String(i),v0);if(v1===undefined)delete val[i];else if(v1!==v0)val[i]=v1}}else if(val instanceof Map){for(var _i=0,_Array$from=Array.from(val.keys());_i<_Array$from.length;_i++){var k=_Array$from[_i];var _v=val.get(k);var _v2=applyReviver(reviver,val,k,_v);if(_v2===undefined)val["delete"](k);else if(_v2!==_v)val.set(k,_v2)}}else if(val instanceof Set){for(var _i2=0,_Array$from2=Array.from(val);_i2<_Array$from2.length;_i2++){var _v3=_Array$from2[_i2];var _v4=applyReviver(reviver,val,_v3,_v3);if(_v4===undefined)val["delete"](_v3);else if(_v4!==_v3){val["delete"](_v3);val.add(_v4)}}}else{for(var _i3=0,_Object$entries=Object.entries(val);_i3<_Object$entries.length;_i3++){var _Object$entries$_i=_slicedToArray(_Object$entries[_i3],2),_k=_Object$entries$_i[0],_v5=_Object$entries$_i[1];var _v6=applyReviver(reviver,val,_k,_v5);if(_v6===undefined)delete val[_k];else if(_v6!==_v5)val[_k]=_v6}}}return reviver.call(obj,key,val)}},{}],243:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.createNode=createNode;var _Alias=require("../nodes/Alias.js");var _identity=require("../nodes/identity.js");var _Scalar=require("../nodes/Scalar.js");function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}var defaultTagPrefix="tag:yaml.org,2002:";function findTagObject(value,tagName,tags){if(tagName){var _match$find;var match=tags.filter((function(t){return t.tag===tagName}));var tagObj=(_match$find=match.find((function(t){return!t.format})))!==null&&_match$find!==void 0?_match$find:match[0];if(!tagObj)throw new Error("Tag ".concat(tagName," not found"));return tagObj}return tags.find((function(t){var _t$identify;return((_t$identify=t.identify)===null||_t$identify===void 0?void 0:_t$identify.call(t,value))&&!t.format}))}function createNode(value,tagName,ctx){var _tagName,_tagObj,_tagObj2;if((0,_identity.isDocument)(value))value=value.contents;if((0,_identity.isNode)(value))return value;if((0,_identity.isPair)(value)){var _ctx$schema$MAP$creat,_ctx$schema$MAP;var map=(_ctx$schema$MAP$creat=(_ctx$schema$MAP=ctx.schema[_identity.MAP]).createNode)===null||_ctx$schema$MAP$creat===void 0?void 0:_ctx$schema$MAP$creat.call(_ctx$schema$MAP,ctx.schema,null,ctx);map.items.push(value);return map}if(value instanceof String||value instanceof Number||value instanceof Boolean||typeof BigInt!=="undefined"&&value instanceof BigInt){value=value.valueOf()}var aliasDuplicateObjects=ctx.aliasDuplicateObjects,onAnchor=ctx.onAnchor,onTagObj=ctx.onTagObj,schema=ctx.schema,sourceObjects=ctx.sourceObjects;var ref=undefined;if(aliasDuplicateObjects&&value&&_typeof(value)==="object"){ref=sourceObjects.get(value);if(ref){if(!ref.anchor)ref.anchor=onAnchor(value);return new _Alias.Alias(ref.anchor)}else{ref={anchor:null,node:null};sourceObjects.set(value,ref)}}if((_tagName=tagName)!==null&&_tagName!==void 0&&_tagName.startsWith("!!"))tagName=defaultTagPrefix+tagName.slice(2);var tagObj=findTagObject(value,tagName,schema.tags);if(!tagObj){if(value&&typeof value.toJSON==="function"){value=value.toJSON()}if(!value||_typeof(value)!=="object"){var _node=new _Scalar.Scalar(value);if(ref)ref.node=_node;return _node}tagObj=value instanceof Map?schema[_identity.MAP]:Symbol.iterator in Object(value)?schema[_identity.SEQ]:schema[_identity.MAP]}if(onTagObj){onTagObj(tagObj);delete ctx.onTagObj}var node=(_tagObj=tagObj)!==null&&_tagObj!==void 0&&_tagObj.createNode?tagObj.createNode(ctx.schema,value,ctx):typeof((_tagObj2=tagObj)===null||_tagObj2===void 0||(_tagObj2=_tagObj2.nodeClass)===null||_tagObj2===void 0?void 0:_tagObj2.from)==="function"?tagObj.nodeClass.from(ctx.schema,value,ctx):new _Scalar.Scalar(value);if(tagName)node.tag=tagName;else if(!tagObj["default"])node.tag=tagObj.tag;if(ref)ref.node=node;return node}},{"../nodes/Alias.js":248,"../nodes/Scalar.js":252,"../nodes/identity.js":256}],244:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.Directives=void 0;var _identity=require("../nodes/identity.js");var _visit=require("../visit.js");function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}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 _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var escapeChars={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"};var escapeTagName=function escapeTagName(tn){return tn.replace(/[!,[\]{}]/g,(function(ch){return escapeChars[ch]}))};var Directives=exports.Directives=function(){function Directives(yaml,tags){_classCallCheck(this,Directives);this.docStart=null;this.docEnd=false;this.yaml=Object.assign({},Directives.defaultYaml,yaml);this.tags=Object.assign({},Directives.defaultTags,tags)}return _createClass(Directives,[{key:"clone",value:function clone(){var copy=new Directives(this.yaml,this.tags);copy.docStart=this.docStart;return copy}},{key:"atDocument",value:function atDocument(){var res=new Directives(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=true;break;case"1.2":this.atNextDocument=false;this.yaml={explicit:Directives.defaultYaml.explicit,version:"1.2"};this.tags=Object.assign({},Directives.defaultTags);break}return res}},{key:"add",value:function add(line,onError){if(this.atNextDocument){this.yaml={explicit:Directives.defaultYaml.explicit,version:"1.1"};this.tags=Object.assign({},Directives.defaultTags);this.atNextDocument=false}var parts=line.trim().split(/[ \t]+/);var name=parts.shift();switch(name){case"%TAG":{if(parts.length!==2){onError(0,"%TAG directive should contain exactly two parts");if(parts.length<2)return false}var _parts=_slicedToArray(parts,2),handle=_parts[0],prefix=_parts[1];this.tags[handle]=prefix;return true}case"%YAML":{this.yaml.explicit=true;if(parts.length!==1){onError(0,"%YAML directive should contain exactly one part");return false}var _parts2=_slicedToArray(parts,1),version=_parts2[0];if(version==="1.1"||version==="1.2"){this.yaml.version=version;return true}else{var isValid=/^\d+\.\d+$/.test(version);onError(6,"Unsupported YAML version ".concat(version),isValid);return false}}default:onError(0,"Unknown directive ".concat(name),true);return false}}},{key:"tagName",value:function tagName(source,onError){if(source==="!")return"!";if(source[0]!=="!"){onError("Not a valid tag: ".concat(source));return null}if(source[1]==="<"){var verbatim=source.slice(2,-1);if(verbatim==="!"||verbatim==="!!"){onError("Verbatim tags aren't resolved, so ".concat(source," is invalid."));return null}if(source[source.length-1]!==">")onError("Verbatim tags must end with a >");return verbatim}var _source$match=source.match(/^([^]*!)([^!]*)$/),_source$match2=_slicedToArray(_source$match,3),handle=_source$match2[1],suffix=_source$match2[2];if(!suffix)onError("The ".concat(source," tag has no suffix"));var prefix=this.tags[handle];if(prefix){try{return prefix+decodeURIComponent(suffix)}catch(error){onError(String(error));return null}}if(handle==="!")return source;onError("Could not resolve tag: ".concat(source));return null}},{key:"tagString",value:function tagString(tag){for(var _i=0,_Object$entries=Object.entries(this.tags);_i<_Object$entries.length;_i++){var _Object$entries$_i=_slicedToArray(_Object$entries[_i],2),handle=_Object$entries$_i[0],prefix=_Object$entries$_i[1];if(tag.startsWith(prefix))return handle+escapeTagName(tag.substring(prefix.length))}return tag[0]==="!"?tag:"!<".concat(tag,">")}},{key:"toString",value:function toString(doc){var lines=this.yaml.explicit?["%YAML ".concat(this.yaml.version||"1.2")]:[];var tagEntries=Object.entries(this.tags);var tagNames;if(doc&&tagEntries.length>0&&(0,_identity.isNode)(doc.contents)){var tags={};(0,_visit.visit)(doc.contents,(function(_key,node){if((0,_identity.isNode)(node)&&node.tag)tags[node.tag]=true}));tagNames=Object.keys(tags)}else tagNames=[];var _loop=function _loop(){var _tagEntries$_i=_slicedToArray(_tagEntries[_i2],2),handle=_tagEntries$_i[0],prefix=_tagEntries$_i[1];if(handle==="!!"&&prefix==="tag:yaml.org,2002:")return 1;if(!doc||tagNames.some((function(tn){return tn.startsWith(prefix)})))lines.push("%TAG ".concat(handle," ").concat(prefix))};for(var _i2=0,_tagEntries=tagEntries;_i2<_tagEntries.length;_i2++){if(_loop())continue}return lines.join("\n")}}])}();Directives.defaultYaml={explicit:false,version:"1.2"};Directives.defaultTags={"!!":"tag:yaml.org,2002:"}},{"../nodes/identity.js":256,"../visit.js":295}],245:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}Object.defineProperty(exports,"__esModule",{value:true});exports.prettifyError=exports.YAMLWarning=exports.YAMLParseError=exports.YAMLError=void 0;function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _wrapNativeSuper(t){var r="function"==typeof Map?new Map:void 0;return _wrapNativeSuper=function _wrapNativeSuper(t){if(null===t||!_isNativeFunction(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,Wrapper)}function Wrapper(){return _construct(t,arguments,_getPrototypeOf(this).constructor)}return Wrapper.prototype=Object.create(t.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(Wrapper,t)},_wrapNativeSuper(t)}function _construct(t,e,r){if(_isNativeReflectConstruct())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,e);var p=new(t.bind.apply(t,o));return r&&_setPrototypeOf(p,r.prototype),p}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _isNativeFunction(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(n){return"function"==typeof t}}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}var YAMLError=exports.YAMLError=function(_Error){function YAMLError(name,pos,code,message){var _this;_classCallCheck(this,YAMLError);_this=_callSuper(this,YAMLError);_this.name=name;_this.code=code;_this.message=message;_this.pos=pos;return _this}_inherits(YAMLError,_Error);return _createClass(YAMLError)}(_wrapNativeSuper(Error));var YAMLParseError=exports.YAMLParseError=function(_YAMLError){function YAMLParseError(pos,code,message){_classCallCheck(this,YAMLParseError);return _callSuper(this,YAMLParseError,["YAMLParseError",pos,code,message])}_inherits(YAMLParseError,_YAMLError);return _createClass(YAMLParseError)}(YAMLError);var YAMLWarning=exports.YAMLWarning=function(_YAMLError2){function YAMLWarning(pos,code,message){_classCallCheck(this,YAMLWarning);return _callSuper(this,YAMLWarning,["YAMLWarning",pos,code,message])}_inherits(YAMLWarning,_YAMLError2);return _createClass(YAMLWarning)}(YAMLError);var prettifyError=exports.prettifyError=function prettifyError(src,lc){return function(error){if(error.pos[0]===-1)return;error.linePos=error.pos.map((function(pos){return lc.linePos(pos)}));var _error$linePos$=error.linePos[0],line=_error$linePos$.line,col=_error$linePos$.col;error.message+=" at line ".concat(line,", column ").concat(col);var ci=col-1;var lineStr=src.substring(lc.lineStarts[line-1],lc.lineStarts[line]).replace(/[\n\r]+$/,"");if(ci>=60&&lineStr.length>80){var trimStart=Math.min(ci-39,lineStr.length-79);lineStr="…"+lineStr.substring(trimStart);ci-=trimStart-1}if(lineStr.length>80)lineStr=lineStr.substring(0,79)+"…";if(line>1&&/^ *$/.test(lineStr.substring(0,ci))){var prev=src.substring(lc.lineStarts[line-2],lc.lineStarts[line-1]);if(prev.length>80)prev=prev.substring(0,79)+"…\n";lineStr=prev+lineStr}if(/[^ ]/.test(lineStr)){var count=1;var end=error.linePos[1];if(end&&end.line===line&&end.col>col){count=Math.max(1,Math.min(end.col-col,80-ci))}var pointer=" ".repeat(ci)+"^".repeat(count);error.message+=":\n\n".concat(lineStr,"\n").concat(pointer,"\n")}}}},{}],246:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"Alias",{enumerable:true,get:function get(){return _Alias.Alias}});exports.CST=void 0;Object.defineProperty(exports,"Composer",{enumerable:true,get:function get(){return _composer.Composer}});Object.defineProperty(exports,"Document",{enumerable:true,get:function get(){return _Document.Document}});Object.defineProperty(exports,"Lexer",{enumerable:true,get:function get(){return _lexer.Lexer}});Object.defineProperty(exports,"LineCounter",{enumerable:true,get:function get(){return _lineCounter.LineCounter}});Object.defineProperty(exports,"Pair",{enumerable:true,get:function get(){return _Pair.Pair}});Object.defineProperty(exports,"Parser",{enumerable:true,get:function get(){return _parser.Parser}});Object.defineProperty(exports,"Scalar",{enumerable:true,get:function get(){return _Scalar.Scalar}});Object.defineProperty(exports,"Schema",{enumerable:true,get:function get(){return _Schema.Schema}});Object.defineProperty(exports,"YAMLError",{enumerable:true,get:function get(){return _errors.YAMLError}});Object.defineProperty(exports,"YAMLMap",{enumerable:true,get:function get(){return _YAMLMap.YAMLMap}});Object.defineProperty(exports,"YAMLParseError",{enumerable:true,get:function get(){return _errors.YAMLParseError}});Object.defineProperty(exports,"YAMLSeq",{enumerable:true,get:function get(){return _YAMLSeq.YAMLSeq}});Object.defineProperty(exports,"YAMLWarning",{enumerable:true,get:function get(){return _errors.YAMLWarning}});Object.defineProperty(exports,"isAlias",{enumerable:true,get:function get(){return _identity.isAlias}});Object.defineProperty(exports,"isCollection",{enumerable:true,get:function get(){return _identity.isCollection}});Object.defineProperty(exports,"isDocument",{enumerable:true,get:function get(){return _identity.isDocument}});Object.defineProperty(exports,"isMap",{enumerable:true,get:function get(){return _identity.isMap}});Object.defineProperty(exports,"isNode",{enumerable:true,get:function get(){return _identity.isNode}});Object.defineProperty(exports,"isPair",{enumerable:true,get:function get(){return _identity.isPair}});Object.defineProperty(exports,"isScalar",{enumerable:true,get:function get(){return _identity.isScalar}});Object.defineProperty(exports,"isSeq",{enumerable:true,get:function get(){return _identity.isSeq}});Object.defineProperty(exports,"parse",{enumerable:true,get:function get(){return _publicApi.parse}});Object.defineProperty(exports,"parseAllDocuments",{enumerable:true,get:function get(){return _publicApi.parseAllDocuments}});Object.defineProperty(exports,"parseDocument",{enumerable:true,get:function get(){return _publicApi.parseDocument}});Object.defineProperty(exports,"stringify",{enumerable:true,get:function get(){return _publicApi.stringify}});Object.defineProperty(exports,"visit",{enumerable:true,get:function get(){return _visit.visit}});Object.defineProperty(exports,"visitAsync",{enumerable:true,get:function get(){return _visit.visitAsync}});var _composer=require("./compose/composer.js");var _Document=require("./doc/Document.js");var _Schema=require("./schema/Schema.js");var _errors=require("./errors.js");var _Alias=require("./nodes/Alias.js");var _identity=require("./nodes/identity.js");var _Pair=require("./nodes/Pair.js");var _Scalar=require("./nodes/Scalar.js");var _YAMLMap=require("./nodes/YAMLMap.js");var _YAMLSeq=require("./nodes/YAMLSeq.js");var cst=_interopRequireWildcard(require("./parse/cst.js"));exports.CST=cst;var _lexer=require("./parse/lexer.js");var _lineCounter=require("./parse/line-counter.js");var _parser=require("./parse/parser.js");var _publicApi=require("./public-api.js");var _visit=require("./visit.js");function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=_typeof(e)&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u]}return n["default"]=e,t&&t.set(e,n),n}},{"./compose/composer.js":228,"./doc/Document.js":240,"./errors.js":245,"./nodes/Alias.js":248,"./nodes/Pair.js":251,"./nodes/Scalar.js":252,"./nodes/YAMLMap.js":253,"./nodes/YAMLSeq.js":254,"./nodes/identity.js":256,"./parse/cst.js":261,"./parse/lexer.js":262,"./parse/line-counter.js":263,"./parse/parser.js":264,"./public-api.js":265,"./schema/Schema.js":266,"./visit.js":295}],247:[function(require,module,exports){(function(process){(function(){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.debug=debug;exports.warn=warn;function debug(logLevel){var _console;for(var _len=arguments.length,messages=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){messages[_key-1]=arguments[_key]}if(logLevel==="debug")(_console=console).log.apply(_console,messages)}function warn(logLevel,warning){if(logLevel==="debug"||logLevel==="warn"){if(typeof process!=="undefined"&&process.emitWarning)process.emitWarning(warning);else console.warn(warning)}}}).call(this)}).call(this,require("_process"))},{_process:182}],248:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}Object.defineProperty(exports,"__esModule",{value:true});exports.Alias=void 0;var _anchors=require("../doc/anchors.js");var _visit=require("../visit.js");var _identity=require("./identity.js");var _Node=require("./Node.js");var _toJS=require("./toJS.js");function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}var Alias=exports.Alias=function(_NodeBase){function Alias(source){var _this;_classCallCheck(this,Alias);_this=_callSuper(this,Alias,[_identity.ALIAS]);_this.source=source;Object.defineProperty(_this,"tag",{set:function set(){throw new Error("Alias nodes cannot have tags")}});return _this}_inherits(Alias,_NodeBase);return _createClass(Alias,[{key:"resolve",value:function resolve(doc){var _this2=this;var found=undefined;(0,_visit.visit)(doc,{Node:function Node(_key,node){if(node===_this2)return _visit.visit.BREAK;if(node.anchor===_this2.source)found=node}});return found}},{key:"toJSON",value:function toJSON(_arg,ctx){if(!ctx)return{source:this.source};var anchors=ctx.anchors,doc=ctx.doc,maxAliasCount=ctx.maxAliasCount;var source=this.resolve(doc);if(!source){var msg="Unresolved alias (the anchor must be set before the alias): ".concat(this.source);throw new ReferenceError(msg)}var data=anchors.get(source);if(!data){(0,_toJS.toJS)(source,null,ctx);data=anchors.get(source)}if(!data||data.res===undefined){var _msg="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(_msg)}if(maxAliasCount>=0){data.count+=1;if(data.aliasCount===0)data.aliasCount=getAliasCount(doc,source,anchors);if(data.count*data.aliasCount>maxAliasCount){var _msg2="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(_msg2)}}return data.res}},{key:"toString",value:function toString(ctx,_onComment,_onChompKeep){var src="*".concat(this.source);if(ctx){(0,_anchors.anchorIsValid)(this.source);if(ctx.options.verifyAliasOrder&&!ctx.anchors.has(this.source)){var msg="Unresolved alias (the anchor must be set before the alias): ".concat(this.source);throw new Error(msg)}if(ctx.implicitKey)return"".concat(src," ")}return src}}])}(_Node.NodeBase);function getAliasCount(doc,node,anchors){if((0,_identity.isAlias)(node)){var source=node.resolve(doc);var anchor=anchors&&source&&anchors.get(source);return anchor?anchor.count*anchor.aliasCount:0}else if((0,_identity.isCollection)(node)){var count=0;var _iterator=_createForOfIteratorHelper(node.items),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var item=_step.value;var c=getAliasCount(doc,item,anchors);if(c>count)count=c}}catch(err){_iterator.e(err)}finally{_iterator.f()}return count}else if((0,_identity.isPair)(node)){var kc=getAliasCount(doc,node.key,anchors);var vc=getAliasCount(doc,node.value,anchors);return Math.max(kc,vc)}return 1}},{"../doc/anchors.js":241,"../visit.js":295,"./Node.js":250,"./identity.js":256,"./toJS.js":257}],249:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.Collection=void 0;exports.collectionFromPath=collectionFromPath;exports.isEmptyPath=void 0;var _createNode=require("../doc/createNode.js");var _identity=require("./identity.js");var _Node=require("./Node.js");function _toArray(r){return _arrayWithHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableRest()}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 _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}function _arrayWithHoles(r){if(Array.isArray(r))return r}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function collectionFromPath(schema,path,value){var v=value;for(var i=path.length-1;i>=0;--i){var k=path[i];if(typeof k==="number"&&Number.isInteger(k)&&k>=0){var a=[];a[k]=v;v=a}else{v=new Map([[k,v]])}}return(0,_createNode.createNode)(v,undefined,{aliasDuplicateObjects:false,keepUndefined:false,onAnchor:function onAnchor(){throw new Error("This should not happen, please report a bug.")},schema:schema,sourceObjects:new Map})}var isEmptyPath=exports.isEmptyPath=function isEmptyPath(path){return path==null||_typeof(path)==="object"&&!!path[Symbol.iterator]().next().done};var Collection=exports.Collection=function(_NodeBase){function Collection(type,schema){var _this;_classCallCheck(this,Collection);_this=_callSuper(this,Collection,[type]);Object.defineProperty(_this,"schema",{value:schema,configurable:true,enumerable:false,writable:true});return _this}_inherits(Collection,_NodeBase);return _createClass(Collection,[{key:"clone",value:function clone(schema){var copy=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(schema)copy.schema=schema;copy.items=copy.items.map((function(it){return(0,_identity.isNode)(it)||(0,_identity.isPair)(it)?it.clone(schema):it}));if(this.range)copy.range=this.range.slice();return copy}},{key:"addIn",value:function addIn(path,value){if(isEmptyPath(path))this.add(value);else{var _path=_toArray(path),key=_path[0],rest=_path.slice(1);var node=this.get(key,true);if((0,_identity.isCollection)(node))node.addIn(rest,value);else if(node===undefined&&this.schema)this.set(key,collectionFromPath(this.schema,rest,value));else throw new Error("Expected YAML collection at ".concat(key,". Remaining path: ").concat(rest))}}},{key:"deleteIn",value:function deleteIn(path){var _path2=_toArray(path),key=_path2[0],rest=_path2.slice(1);if(rest.length===0)return this["delete"](key);var node=this.get(key,true);if((0,_identity.isCollection)(node))return node.deleteIn(rest);else throw new Error("Expected YAML collection at ".concat(key,". Remaining path: ").concat(rest))}},{key:"getIn",value:function getIn(path,keepScalar){var _path3=_toArray(path),key=_path3[0],rest=_path3.slice(1);var node=this.get(key,true);if(rest.length===0)return!keepScalar&&(0,_identity.isScalar)(node)?node.value:node;else return(0,_identity.isCollection)(node)?node.getIn(rest,keepScalar):undefined}},{key:"hasAllNullValues",value:function hasAllNullValues(allowScalar){return this.items.every((function(node){if(!(0,_identity.isPair)(node))return false;var n=node.value;return n==null||allowScalar&&(0,_identity.isScalar)(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag}))}},{key:"hasIn",value:function hasIn(path){var _path4=_toArray(path),key=_path4[0],rest=_path4.slice(1);if(rest.length===0)return this.has(key);var node=this.get(key,true);return(0,_identity.isCollection)(node)?node.hasIn(rest):false}},{key:"setIn",value:function setIn(path,value){var _path5=_toArray(path),key=_path5[0],rest=_path5.slice(1);if(rest.length===0){this.set(key,value)}else{var node=this.get(key,true);if((0,_identity.isCollection)(node))node.setIn(rest,value);else if(node===undefined&&this.schema)this.set(key,collectionFromPath(this.schema,rest,value));else throw new Error("Expected YAML collection at ".concat(key,". Remaining path: ").concat(rest))}}}])}(_Node.NodeBase)},{"../doc/createNode.js":243,"./Node.js":250,"./identity.js":256}],250:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.NodeBase=void 0;var _applyReviver=require("../doc/applyReviver.js");var _identity=require("./identity.js");var _toJS2=require("./toJS.js");function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var NodeBase=exports.NodeBase=function(){function NodeBase(type){_classCallCheck(this,NodeBase);Object.defineProperty(this,_identity.NODE_TYPE,{value:type})}return _createClass(NodeBase,[{key:"clone",value:function clone(){var copy=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)copy.range=this.range.slice();return copy}},{key:"toJS",value:function toJS(doc){var _ref=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},mapAsMap=_ref.mapAsMap,maxAliasCount=_ref.maxAliasCount,onAnchor=_ref.onAnchor,reviver=_ref.reviver;if(!(0,_identity.isDocument)(doc))throw new TypeError("A document argument is required");var ctx={anchors:new Map,doc:doc,keep:true,mapAsMap:mapAsMap===true,mapKeyWarned:false,maxAliasCount:typeof maxAliasCount==="number"?maxAliasCount:100};var res=(0,_toJS2.toJS)(this,"",ctx);if(typeof onAnchor==="function"){var _iterator=_createForOfIteratorHelper(ctx.anchors.values()),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var _step$value=_step.value,count=_step$value.count,_res=_step$value.res;onAnchor(_res,count)}}catch(err){_iterator.e(err)}finally{_iterator.f()}}return typeof reviver==="function"?(0,_applyReviver.applyReviver)(reviver,{"":res},"",res):res}}])}()},{"../doc/applyReviver.js":242,"./identity.js":256,"./toJS.js":257}],251:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.Pair=void 0;exports.createPair=createPair;var _createNode=require("../doc/createNode.js");var _stringifyPair=require("../stringify/stringifyPair.js");var _addPairToJSMap=require("./addPairToJSMap.js");var _identity=require("./identity.js");function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function createPair(key,value,ctx){var k=(0,_createNode.createNode)(key,undefined,ctx);var v=(0,_createNode.createNode)(value,undefined,ctx);return new Pair(k,v)}var Pair=exports.Pair=function(){function Pair(key){var value=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;_classCallCheck(this,Pair);Object.defineProperty(this,_identity.NODE_TYPE,{value:_identity.PAIR});this.key=key;this.value=value}return _createClass(Pair,[{key:"clone",value:function clone(schema){var key=this.key,value=this.value;if((0,_identity.isNode)(key))key=key.clone(schema);if((0,_identity.isNode)(value))value=value.clone(schema);return new Pair(key,value)}},{key:"toJSON",value:function toJSON(_,ctx){var pair=ctx!==null&&ctx!==void 0&&ctx.mapAsMap?new Map:{};return(0,_addPairToJSMap.addPairToJSMap)(ctx,pair,this)}},{key:"toString",value:function toString(ctx,onComment,onChompKeep){return ctx!==null&&ctx!==void 0&&ctx.doc?(0,_stringifyPair.stringifyPair)(this,ctx,onComment,onChompKeep):JSON.stringify(this)}}])}()},{"../doc/createNode.js":243,"../stringify/stringifyPair.js":293,"./addPairToJSMap.js":255,"./identity.js":256}],252:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.isScalarValue=exports.Scalar=void 0;var _identity=require("./identity.js");var _Node=require("./Node.js");var _toJS=require("./toJS.js");function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}var isScalarValue=exports.isScalarValue=function isScalarValue(value){return!value||typeof value!=="function"&&_typeof(value)!=="object"};var Scalar=exports.Scalar=function(_NodeBase){function Scalar(value){var _this;_classCallCheck(this,Scalar);_this=_callSuper(this,Scalar,[_identity.SCALAR]);_this.value=value;return _this}_inherits(Scalar,_NodeBase);return _createClass(Scalar,[{key:"toJSON",value:function toJSON(arg,ctx){return ctx!==null&&ctx!==void 0&&ctx.keep?this.value:(0,_toJS.toJS)(this.value,arg,ctx)}},{key:"toString",value:function toString(){return String(this.value)}}])}(_Node.NodeBase);Scalar.BLOCK_FOLDED="BLOCK_FOLDED";Scalar.BLOCK_LITERAL="BLOCK_LITERAL";Scalar.PLAIN="PLAIN";Scalar.QUOTE_DOUBLE="QUOTE_DOUBLE";Scalar.QUOTE_SINGLE="QUOTE_SINGLE"},{"./Node.js":250,"./identity.js":256,"./toJS.js":257}],253:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.YAMLMap=void 0;exports.findPair=findPair;var _stringifyCollection=require("../stringify/stringifyCollection.js");var _addPairToJSMap=require("./addPairToJSMap.js");var _Collection2=require("./Collection.js");var _identity=require("./identity.js");var _Pair=require("./Pair.js");var _Scalar=require("./Scalar.js");function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}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 _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function findPair(items,key){var k=(0,_identity.isScalar)(key)?key.value:key;var _iterator=_createForOfIteratorHelper(items),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var it=_step.value;if((0,_identity.isPair)(it)){if(it.key===key||it.key===k)return it;if((0,_identity.isScalar)(it.key)&&it.key.value===k)return it}}}catch(err){_iterator.e(err)}finally{_iterator.f()}return undefined}var YAMLMap=exports.YAMLMap=function(_Collection){function YAMLMap(schema){var _this;_classCallCheck(this,YAMLMap);_this=_callSuper(this,YAMLMap,[_identity.MAP,schema]);_this.items=[];return _this}_inherits(YAMLMap,_Collection);return _createClass(YAMLMap,[{key:"add",value:function add(pair,overwrite){var _this$schema;var _pair;if((0,_identity.isPair)(pair))_pair=pair;else if(!pair||_typeof(pair)!=="object"||!("key"in pair)){_pair=new _Pair.Pair(pair,pair===null||pair===void 0?void 0:pair.value)}else _pair=new _Pair.Pair(pair.key,pair.value);var prev=findPair(this.items,_pair.key);var sortEntries=(_this$schema=this.schema)===null||_this$schema===void 0?void 0:_this$schema.sortMapEntries;if(prev){if(!overwrite)throw new Error("Key ".concat(_pair.key," already set"));if((0,_identity.isScalar)(prev.value)&&(0,_Scalar.isScalarValue)(_pair.value))prev.value.value=_pair.value;else prev.value=_pair.value}else if(sortEntries){var i=this.items.findIndex((function(item){return sortEntries(_pair,item)<0}));if(i===-1)this.items.push(_pair);else this.items.splice(i,0,_pair)}else{this.items.push(_pair)}}},{key:"delete",value:function _delete(key){var it=findPair(this.items,key);if(!it)return false;var del=this.items.splice(this.items.indexOf(it),1);return del.length>0}},{key:"get",value:function get(key,keepScalar){var _ref;var it=findPair(this.items,key);var node=it===null||it===void 0?void 0:it.value;return(_ref=!keepScalar&&(0,_identity.isScalar)(node)?node.value:node)!==null&&_ref!==void 0?_ref:undefined}},{key:"has",value:function has(key){return!!findPair(this.items,key)}},{key:"set",value:function set(key,value){this.add(new _Pair.Pair(key,value),true)}},{key:"toJSON",value:function toJSON(_,ctx,Type){var map=Type?new Type:ctx!==null&&ctx!==void 0&&ctx.mapAsMap?new Map:{};if(ctx!==null&&ctx!==void 0&&ctx.onCreate)ctx.onCreate(map);var _iterator2=_createForOfIteratorHelper(this.items),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var item=_step2.value;(0,_addPairToJSMap.addPairToJSMap)(ctx,map,item)}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}return map}},{key:"toString",value:function toString(ctx,onComment,onChompKeep){if(!ctx)return JSON.stringify(this);var _iterator3=_createForOfIteratorHelper(this.items),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var item=_step3.value;if(!(0,_identity.isPair)(item))throw new Error("Map items must all be pairs; found ".concat(JSON.stringify(item)," instead"))}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}if(!ctx.allNullValues&&this.hasAllNullValues(false))ctx=Object.assign({},ctx,{allNullValues:true});return(0,_stringifyCollection.stringifyCollection)(this,ctx,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:ctx.indent||"",onChompKeep:onChompKeep,onComment:onComment})}}],[{key:"tagName",get:function get(){return"tag:yaml.org,2002:map"}},{key:"from",value:function from(schema,obj,ctx){var keepUndefined=ctx.keepUndefined,replacer=ctx.replacer;var map=new this(schema);var add=function add(key,value){if(typeof replacer==="function")value=replacer.call(obj,key,value);else if(Array.isArray(replacer)&&!replacer.includes(key))return;if(value!==undefined||keepUndefined)map.items.push((0,_Pair.createPair)(key,value,ctx))};if(obj instanceof Map){var _iterator4=_createForOfIteratorHelper(obj),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var _step4$value=_slicedToArray(_step4.value,2),key=_step4$value[0],value=_step4$value[1];add(key,value)}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}}else if(obj&&_typeof(obj)==="object"){for(var _i=0,_Object$keys=Object.keys(obj);_i<_Object$keys.length;_i++){var _key=_Object$keys[_i];add(_key,obj[_key])}}if(typeof schema.sortMapEntries==="function"){map.items.sort(schema.sortMapEntries)}return map}}])}(_Collection2.Collection)},{"../stringify/stringifyCollection.js":289,"./Collection.js":249,"./Pair.js":251,"./Scalar.js":252,"./addPairToJSMap.js":255,"./identity.js":256}],254:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}Object.defineProperty(exports,"__esModule",{value:true});exports.YAMLSeq=void 0;var _createNode=require("../doc/createNode.js");var _stringifyCollection=require("../stringify/stringifyCollection.js");var _Collection2=require("./Collection.js");var _identity=require("./identity.js");var _Scalar=require("./Scalar.js");var _toJS=require("./toJS.js");function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}var YAMLSeq=exports.YAMLSeq=function(_Collection){function YAMLSeq(schema){var _this;_classCallCheck(this,YAMLSeq);_this=_callSuper(this,YAMLSeq,[_identity.SEQ,schema]);_this.items=[];return _this}_inherits(YAMLSeq,_Collection);return _createClass(YAMLSeq,[{key:"add",value:function add(value){this.items.push(value)}},{key:"delete",value:function _delete(key){var idx=asItemIndex(key);if(typeof idx!=="number")return false;var del=this.items.splice(idx,1);return del.length>0}},{key:"get",value:function get(key,keepScalar){var idx=asItemIndex(key);if(typeof idx!=="number")return undefined;var it=this.items[idx];return!keepScalar&&(0,_identity.isScalar)(it)?it.value:it}},{key:"has",value:function has(key){var idx=asItemIndex(key);return typeof idx==="number"&&idx<this.items.length}},{key:"set",value:function set(key,value){var idx=asItemIndex(key);if(typeof idx!=="number")throw new Error("Expected a valid index, not ".concat(key,"."));var prev=this.items[idx];if((0,_identity.isScalar)(prev)&&(0,_Scalar.isScalarValue)(value))prev.value=value;else this.items[idx]=value}},{key:"toJSON",value:function toJSON(_,ctx){var seq=[];if(ctx!==null&&ctx!==void 0&&ctx.onCreate)ctx.onCreate(seq);var i=0;var _iterator=_createForOfIteratorHelper(this.items),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var item=_step.value;seq.push((0,_toJS.toJS)(item,String(i++),ctx))}}catch(err){_iterator.e(err)}finally{_iterator.f()}return seq}},{key:"toString",value:function toString(ctx,onComment,onChompKeep){if(!ctx)return JSON.stringify(this);return(0,_stringifyCollection.stringifyCollection)(this,ctx,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(ctx.indent||"")+" ",onChompKeep:onChompKeep,onComment:onComment})}}],[{key:"tagName",get:function get(){return"tag:yaml.org,2002:seq"}},{key:"from",value:function from(schema,obj,ctx){var replacer=ctx.replacer;var seq=new this(schema);if(obj&&Symbol.iterator in Object(obj)){var i=0;var _iterator2=_createForOfIteratorHelper(obj),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var it=_step2.value;if(typeof replacer==="function"){var key=obj instanceof Set?it:String(i++);it=replacer.call(obj,key,it)}seq.items.push((0,_createNode.createNode)(it,undefined,ctx))}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}}return seq}}])}(_Collection2.Collection);function asItemIndex(key){var idx=(0,_identity.isScalar)(key)?key.value:key;if(idx&&typeof idx==="string")idx=Number(idx);return typeof idx==="number"&&Number.isInteger(idx)&&idx>=0?idx:null}},{"../doc/createNode.js":243,"../stringify/stringifyCollection.js":289,"./Collection.js":249,"./Scalar.js":252,"./identity.js":256,"./toJS.js":257}],255:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.addPairToJSMap=addPairToJSMap;var _log=require("../log.js");var _merge=require("../schema/yaml-1.1/merge.js");var _stringify=require("../stringify/stringify.js");var _identity=require("./identity.js");var _toJS=require("./toJS.js");function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function addPairToJSMap(ctx,map,_ref){var key=_ref.key,value=_ref.value;if((0,_identity.isNode)(key)&&key.addToJSMap)key.addToJSMap(ctx,map,value);else if((0,_merge.isMergeKey)(ctx,key))(0,_merge.addMergeToJSMap)(ctx,map,value);else{var jsKey=(0,_toJS.toJS)(key,"",ctx);if(map instanceof Map){map.set(jsKey,(0,_toJS.toJS)(value,jsKey,ctx))}else if(map instanceof Set){map.add(jsKey)}else{var stringKey=stringifyKey(key,jsKey,ctx);var jsValue=(0,_toJS.toJS)(value,stringKey,ctx);if(stringKey in map)Object.defineProperty(map,stringKey,{value:jsValue,writable:true,enumerable:true,configurable:true});else map[stringKey]=jsValue}}return map}function stringifyKey(key,jsKey,ctx){if(jsKey===null)return"";if(_typeof(jsKey)!=="object")return String(jsKey);if((0,_identity.isNode)(key)&&ctx!==null&&ctx!==void 0&&ctx.doc){var strCtx=(0,_stringify.createStringifyContext)(ctx.doc,{});strCtx.anchors=new Set;var _iterator=_createForOfIteratorHelper(ctx.anchors.keys()),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var node=_step.value;strCtx.anchors.add(node.anchor)}}catch(err){_iterator.e(err)}finally{_iterator.f()}strCtx.inFlow=true;strCtx.inStringifyKey=true;var strKey=key.toString(strCtx);if(!ctx.mapKeyWarned){var jsonStr=JSON.stringify(strKey);if(jsonStr.length>40)jsonStr=jsonStr.substring(0,36)+'..."';(0,_log.warn)(ctx.doc.options.logLevel,"Keys with collection values will be stringified due to JS Object restrictions: ".concat(jsonStr,". Set mapAsMap: true to use object keys."));ctx.mapKeyWarned=true}return strKey}return JSON.stringify(jsKey)}},{"../log.js":247,"../schema/yaml-1.1/merge.js":281,"../stringify/stringify.js":288,"./identity.js":256,"./toJS.js":257}],256:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.isAlias=exports.hasAnchor=exports.SEQ=exports.SCALAR=exports.PAIR=exports.NODE_TYPE=exports.MAP=exports.DOC=exports.ALIAS=void 0;exports.isCollection=isCollection;exports.isMap=exports.isDocument=void 0;exports.isNode=isNode;exports.isSeq=exports.isScalar=exports.isPair=void 0;function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}var ALIAS=exports.ALIAS=Symbol["for"]("yaml.alias");var DOC=exports.DOC=Symbol["for"]("yaml.document");var MAP=exports.MAP=Symbol["for"]("yaml.map");var PAIR=exports.PAIR=Symbol["for"]("yaml.pair");var SCALAR=exports.SCALAR=Symbol["for"]("yaml.scalar");var SEQ=exports.SEQ=Symbol["for"]("yaml.seq");var NODE_TYPE=exports.NODE_TYPE=Symbol["for"]("yaml.node.type");var isAlias=exports.isAlias=function isAlias(node){return!!node&&_typeof(node)==="object"&&node[NODE_TYPE]===ALIAS};var isDocument=exports.isDocument=function isDocument(node){return!!node&&_typeof(node)==="object"&&node[NODE_TYPE]===DOC};var isMap=exports.isMap=function isMap(node){return!!node&&_typeof(node)==="object"&&node[NODE_TYPE]===MAP};var isPair=exports.isPair=function isPair(node){return!!node&&_typeof(node)==="object"&&node[NODE_TYPE]===PAIR};var isScalar=exports.isScalar=function isScalar(node){return!!node&&_typeof(node)==="object"&&node[NODE_TYPE]===SCALAR};var isSeq=exports.isSeq=function isSeq(node){return!!node&&_typeof(node)==="object"&&node[NODE_TYPE]===SEQ};function isCollection(node){if(node&&_typeof(node)==="object")switch(node[NODE_TYPE]){case MAP:case SEQ:return true}return false}function isNode(node){if(node&&_typeof(node)==="object")switch(node[NODE_TYPE]){case ALIAS:case MAP:case SCALAR:case SEQ:return true}return false}var hasAnchor=exports.hasAnchor=function hasAnchor(node){return(isScalar(node)||isCollection(node))&&!!node.anchor}},{}],257:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.toJS=toJS;var _identity=require("./identity.js");function toJS(value,arg,ctx){if(Array.isArray(value))return value.map((function(v,i){return toJS(v,String(i),ctx)}));if(value&&typeof value.toJSON==="function"){if(!ctx||!(0,_identity.hasAnchor)(value))return value.toJSON(arg,ctx);var data={aliasCount:0,count:1,res:undefined};ctx.anchors.set(value,data);ctx.onCreate=function(res){data.res=res;delete ctx.onCreate};var res=value.toJSON(arg,ctx);if(ctx.onCreate)ctx.onCreate(res);return res}if(typeof value==="bigint"&&!(ctx!==null&&ctx!==void 0&&ctx.keep))return Number(value);return value}},{"./identity.js":256}],258:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.createScalarToken=createScalarToken;exports.resolveAsScalar=resolveAsScalar;exports.setScalarValue=setScalarValue;var _resolveBlockScalar=require("../compose/resolve-block-scalar.js");var _resolveFlowScalar=require("../compose/resolve-flow-scalar.js");var _errors=require("../errors.js");var _stringifyString=require("../stringify/stringifyString.js");function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function resolveAsScalar(token){var strict=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;var onError=arguments.length>2?arguments[2]:undefined;if(token){var _onError=function _onError(pos,code,message){var offset=typeof pos==="number"?pos:Array.isArray(pos)?pos[0]:pos.offset;if(onError)onError(offset,code,message);else throw new _errors.YAMLParseError([offset,offset+1],code,message)};switch(token.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return(0,_resolveFlowScalar.resolveFlowScalar)(token,strict,_onError);case"block-scalar":return(0,_resolveBlockScalar.resolveBlockScalar)({options:{strict:strict}},token,_onError)}}return null}function createScalarToken(value,context){var _context$end;var _context$implicitKey=context.implicitKey,implicitKey=_context$implicitKey===void 0?false:_context$implicitKey,indent=context.indent,_context$inFlow=context.inFlow,inFlow=_context$inFlow===void 0?false:_context$inFlow,_context$offset=context.offset,offset=_context$offset===void 0?-1:_context$offset,_context$type=context.type,type=_context$type===void 0?"PLAIN":_context$type;var source=(0,_stringifyString.stringifyString)({type:type,value:value},{implicitKey:implicitKey,indent:indent>0?" ".repeat(indent):"",inFlow:inFlow,options:{blockQuote:true,lineWidth:-1}});var end=(_context$end=context.end)!==null&&_context$end!==void 0?_context$end:[{type:"newline",offset:-1,indent:indent,source:"\n"}];switch(source[0]){case"|":case">":{var he=source.indexOf("\n");var head=source.substring(0,he);var body=source.substring(he+1)+"\n";var props=[{type:"block-scalar-header",offset:offset,indent:indent,source:head}];if(!addEndtoBlockProps(props,end))props.push({type:"newline",offset:-1,indent:indent,source:"\n"});return{type:"block-scalar",offset:offset,indent:indent,props:props,source:body}}case'"':return{type:"double-quoted-scalar",offset:offset,indent:indent,source:source,end:end};case"'":return{type:"single-quoted-scalar",offset:offset,indent:indent,source:source,end:end};default:return{type:"scalar",offset:offset,indent:indent,source:source,end:end}}}function setScalarValue(token,value){var context=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var _context$afterKey=context.afterKey,afterKey=_context$afterKey===void 0?false:_context$afterKey,_context$implicitKey2=context.implicitKey,implicitKey=_context$implicitKey2===void 0?false:_context$implicitKey2,_context$inFlow2=context.inFlow,inFlow=_context$inFlow2===void 0?false:_context$inFlow2,type=context.type;var indent="indent"in token?token.indent:null;if(afterKey&&typeof indent==="number")indent+=2;if(!type)switch(token.type){case"single-quoted-scalar":type="QUOTE_SINGLE";break;case"double-quoted-scalar":type="QUOTE_DOUBLE";break;case"block-scalar":{var header=token.props[0];if(header.type!=="block-scalar-header")throw new Error("Invalid block scalar header");type=header.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:type="PLAIN"}var source=(0,_stringifyString.stringifyString)({type:type,value:value},{implicitKey:implicitKey||indent===null,indent:indent!==null&&indent>0?" ".repeat(indent):"",inFlow:inFlow,options:{blockQuote:true,lineWidth:-1}});switch(source[0]){case"|":case">":setBlockScalarValue(token,source);break;case'"':setFlowScalarValue(token,source,"double-quoted-scalar");break;case"'":setFlowScalarValue(token,source,"single-quoted-scalar");break;default:setFlowScalarValue(token,source,"scalar")}}function setBlockScalarValue(token,source){var he=source.indexOf("\n");var head=source.substring(0,he);var body=source.substring(he+1)+"\n";if(token.type==="block-scalar"){var header=token.props[0];if(header.type!=="block-scalar-header")throw new Error("Invalid block scalar header");header.source=head;token.source=body}else{var offset=token.offset;var indent="indent"in token?token.indent:-1;var props=[{type:"block-scalar-header",offset:offset,indent:indent,source:head}];if(!addEndtoBlockProps(props,"end"in token?token.end:undefined))props.push({type:"newline",offset:-1,indent:indent,source:"\n"});for(var _i=0,_Object$keys=Object.keys(token);_i<_Object$keys.length;_i++){var key=_Object$keys[_i];if(key!=="type"&&key!=="offset")delete token[key]}Object.assign(token,{type:"block-scalar",indent:indent,props:props,source:body})}}function addEndtoBlockProps(props,end){if(end){var _iterator=_createForOfIteratorHelper(end),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var st=_step.value;switch(st.type){case"space":case"comment":props.push(st);break;case"newline":props.push(st);return true}}}catch(err){_iterator.e(err)}finally{_iterator.f()}}return false}function setFlowScalarValue(token,source,type){switch(token.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":token.type=type;token.source=source;break;case"block-scalar":{var end=token.props.slice(1);var oa=source.length;if(token.props[0].type==="block-scalar-header")oa-=token.props[0].source.length;var _iterator2=_createForOfIteratorHelper(end),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var tok=_step2.value;tok.offset+=oa}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}delete token.props;Object.assign(token,{type:type,source:source,end:end});break}case"block-map":case"block-seq":{var offset=token.offset+source.length;var nl={type:"newline",offset:offset,indent:token.indent,source:"\n"};delete token.items;Object.assign(token,{type:type,source:source,end:[nl]});break}default:{var indent="indent"in token?token.indent:-1;var _end="end"in token&&Array.isArray(token.end)?token.end.filter((function(st){return st.type==="space"||st.type==="comment"||st.type==="newline"})):[];for(var _i2=0,_Object$keys2=Object.keys(token);_i2<_Object$keys2.length;_i2++){var key=_Object$keys2[_i2];if(key!=="type"&&key!=="offset")delete token[key]}Object.assign(token,{type:type,indent:indent,source:source,end:_end})}}}},{"../compose/resolve-block-scalar.js":230,"../compose/resolve-flow-scalar.js":234,"../errors.js":245,"../stringify/stringifyString.js":294}],259:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.stringify=void 0;function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}var stringify=exports.stringify=function stringify(cst){return"type"in cst?stringifyToken(cst):stringifyItem(cst)};function stringifyToken(token){switch(token.type){case"block-scalar":{var res="";var _iterator=_createForOfIteratorHelper(token.props),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var tok=_step.value;res+=stringifyToken(tok)}}catch(err){_iterator.e(err)}finally{_iterator.f()}return res+token.source}case"block-map":case"block-seq":{var _res="";var _iterator2=_createForOfIteratorHelper(token.items),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var item=_step2.value;_res+=stringifyItem(item)}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}return _res}case"flow-collection":{var _res2=token.start.source;var _iterator3=_createForOfIteratorHelper(token.items),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var _item=_step3.value;_res2+=stringifyItem(_item)}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}var _iterator4=_createForOfIteratorHelper(token.end),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var st=_step4.value;_res2+=st.source}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}return _res2}case"document":{var _res3=stringifyItem(token);if(token.end){var _iterator5=_createForOfIteratorHelper(token.end),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var _st=_step5.value;_res3+=_st.source}}catch(err){_iterator5.e(err)}finally{_iterator5.f()}}return _res3}default:{var _res4=token.source;if("end"in token&&token.end){var _iterator6=_createForOfIteratorHelper(token.end),_step6;try{for(_iterator6.s();!(_step6=_iterator6.n()).done;){var _st2=_step6.value;_res4+=_st2.source}}catch(err){_iterator6.e(err)}finally{_iterator6.f()}}return _res4}}}function stringifyItem(_ref){var start=_ref.start,key=_ref.key,sep=_ref.sep,value=_ref.value;var res="";var _iterator7=_createForOfIteratorHelper(start),_step7;try{for(_iterator7.s();!(_step7=_iterator7.n()).done;){var _st3=_step7.value;res+=_st3.source}}catch(err){_iterator7.e(err)}finally{_iterator7.f()}if(key)res+=stringifyToken(key);if(sep){var _iterator8=_createForOfIteratorHelper(sep),_step8;try{for(_iterator8.s();!(_step8=_iterator8.n()).done;){var st=_step8.value;res+=st.source}}catch(err){_iterator8.e(err)}finally{_iterator8.f()}}if(value)res+=stringifyToken(value);return res}},{}],260:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.visit=visit;function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}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 _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}var BREAK=Symbol("break visit");var SKIP=Symbol("skip children");var REMOVE=Symbol("remove item");function visit(cst,visitor){if("type"in cst&&cst.type==="document")cst={start:cst.start,value:cst.value};_visit(Object.freeze([]),cst,visitor)}visit.BREAK=BREAK;visit.SKIP=SKIP;visit.REMOVE=REMOVE;visit.itemAtPath=function(cst,path){var item=cst;var _iterator=_createForOfIteratorHelper(path),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var _item;var _step$value=_slicedToArray(_step.value,2),field=_step$value[0],index=_step$value[1];var tok=(_item=item)===null||_item===void 0?void 0:_item[field];if(tok&&"items"in tok){item=tok.items[index]}else return undefined}}catch(err){_iterator.e(err)}finally{_iterator.f()}return item};visit.parentCollection=function(cst,path){var parent=visit.itemAtPath(cst,path.slice(0,-1));var field=path[path.length-1][0];var coll=parent===null||parent===void 0?void 0:parent[field];if(coll&&"items"in coll)return coll;throw new Error("Parent collection not found")};function _visit(path,item,visitor){var ctrl=visitor(item,path);if(_typeof(ctrl)==="symbol")return ctrl;for(var _i=0,_arr=["key","value"];_i<_arr.length;_i++){var field=_arr[_i];var token=item[field];if(token&&"items"in token){for(var i=0;i<token.items.length;++i){var ci=_visit(Object.freeze(path.concat([[field,i]])),token.items[i],visitor);if(typeof ci==="number")i=ci-1;else if(ci===BREAK)return BREAK;else if(ci===REMOVE){token.items.splice(i,1);i-=1}}if(typeof ctrl==="function"&&field==="key")ctrl=ctrl(item,path)}}return typeof ctrl==="function"?ctrl(item,path):ctrl}},{}],261:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.SCALAR=exports.FLOW_END=exports.DOCUMENT=exports.BOM=void 0;Object.defineProperty(exports,"createScalarToken",{enumerable:true,get:function get(){return _cstScalar.createScalarToken}});exports.isScalar=exports.isCollection=void 0;exports.prettyToken=prettyToken;Object.defineProperty(exports,"resolveAsScalar",{enumerable:true,get:function get(){return _cstScalar.resolveAsScalar}});Object.defineProperty(exports,"setScalarValue",{enumerable:true,get:function get(){return _cstScalar.setScalarValue}});Object.defineProperty(exports,"stringify",{enumerable:true,get:function get(){return _cstStringify.stringify}});exports.tokenType=tokenType;Object.defineProperty(exports,"visit",{enumerable:true,get:function get(){return _cstVisit.visit}});var _cstScalar=require("./cst-scalar.js");var _cstStringify=require("./cst-stringify.js");var _cstVisit=require("./cst-visit.js");var BOM=exports.BOM="\ufeff";var DOCUMENT=exports.DOCUMENT="";var FLOW_END=exports.FLOW_END="";var SCALAR=exports.SCALAR="";var isCollection=exports.isCollection=function isCollection(token){return!!token&&"items"in token};var isScalar=exports.isScalar=function isScalar(token){return!!token&&(token.type==="scalar"||token.type==="single-quoted-scalar"||token.type==="double-quoted-scalar"||token.type==="block-scalar")};function prettyToken(token){switch(token){case BOM:return"<BOM>";case DOCUMENT:return"<DOC>";case FLOW_END:return"<FLOW_END>";case SCALAR:return"<SCALAR>";default:return JSON.stringify(token)}}function tokenType(source){switch(source){case BOM:return"byte-order-mark";case DOCUMENT:return"doc-mode";case FLOW_END:return"flow-error-end";case SCALAR:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case"\n":case"\r\n":return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(source[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}},{"./cst-scalar.js":258,"./cst-stringify.js":259,"./cst-visit.js":260}],262:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.Lexer=void 0;var _cst=require("./cst.js");function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}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 _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{define({},"")}catch(t){define=function define(t,e,r){return t[e]=r}}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,(function(){return this}));var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach((function(e){define(t,e,(function(t){return this._invoke(e,t)}))}))}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){invoke("next",t,i,a)}),(function(t){invoke("throw",t,i,a)})):e.resolve(h).then((function(t){u.value=t,i(u)}),(function(t){return invoke("throw",t,i,a)}))}a(c.arg)}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e((function(e,r){invoke(t,n,e,r)}))}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done}}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg)}}}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next};return i.next=i}}throw new TypeError(_typeof(e)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t},e.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,(function(){return this})),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,(function(){return this})),define(g,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next}return next.done=!0,next}},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y}},catch:function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function isEmpty(ch){switch(ch){case undefined:case" ":case"\n":case"\r":case"\t":return true;default:return false}}var hexDigits=new Set("0123456789ABCDEFabcdef");var tagChars=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()");var flowIndicatorChars=new Set(",[]{}");var invalidAnchorChars=new Set(" ,[]{}\n\r\t");var isNotAnchorChar=function isNotAnchorChar(ch){return!ch||invalidAnchorChars.has(ch)};var Lexer=exports.Lexer=function(){function Lexer(){_classCallCheck(this,Lexer);this.atEnd=false;this.blockScalarIndent=-1;this.blockScalarKeep=false;this.buffer="";this.flowKey=false;this.flowLevel=0;this.indentNext=0;this.indentValue=0;this.lineEndPos=null;this.next=null;this.pos=0}return _createClass(Lexer,[{key:"lex",value:function lex(source){var _this=this;var incomplete=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;return _regeneratorRuntime().mark((function _callee(_this$next){var next;return _regeneratorRuntime().wrap((function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:if(!source){_context.next=5;break}if(!(typeof source!=="string")){_context.next=3;break}throw TypeError("source is not a string");case 3:_this.buffer=_this.buffer?_this.buffer+source:source;_this.lineEndPos=null;case 5:_this.atEnd=!incomplete;next=(_this$next=_this.next)!==null&&_this$next!==void 0?_this$next:"stream";case 7:if(!(next&&(incomplete||_this.hasChars(1)))){_context.next=12;break}return _context.delegateYield(_this.parseNext(next),"t0",9);case 9:next=_context.t0;_context.next=7;break;case 12:case"end":return _context.stop()}}),_callee)}))()}},{key:"atLineEnd",value:function atLineEnd(){var i=this.pos;var ch=this.buffer[i];while(ch===" "||ch==="\t")ch=this.buffer[++i];if(!ch||ch==="#"||ch==="\n")return true;if(ch==="\r")return this.buffer[i+1]==="\n";return false}},{key:"charAt",value:function charAt(n){return this.buffer[this.pos+n]}},{key:"continueScalar",value:function continueScalar(offset){var ch=this.buffer[offset];if(this.indentNext>0){var indent=0;while(ch===" ")ch=this.buffer[++indent+offset];if(ch==="\r"){var next=this.buffer[indent+offset+1];if(next==="\n"||!next&&!this.atEnd)return offset+indent+1}return ch==="\n"||indent>=this.indentNext||!ch&&!this.atEnd?offset+indent:-1}if(ch==="-"||ch==="."){var dt=this.buffer.substr(offset,3);if((dt==="---"||dt==="...")&&isEmpty(this.buffer[offset+3]))return-1}return offset}},{key:"getLine",value:function getLine(){var end=this.lineEndPos;if(typeof end!=="number"||end!==-1&&end<this.pos){end=this.buffer.indexOf("\n",this.pos);this.lineEndPos=end}if(end===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[end-1]==="\r")end-=1;return this.buffer.substring(this.pos,end)}},{key:"hasChars",value:function hasChars(n){return this.pos+n<=this.buffer.length}},{key:"setNext",value:function setNext(state){this.buffer=this.buffer.substring(this.pos);this.pos=0;this.lineEndPos=null;this.next=state;return null}},{key:"peek",value:function peek(n){return this.buffer.substr(this.pos,n)}},{key:"parseNext",value:_regeneratorRuntime().mark((function parseNext(next){return _regeneratorRuntime().wrap((function parseNext$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.t0=next;_context2.next=_context2.t0==="stream"?3:_context2.t0==="line-start"?5:_context2.t0==="block-start"?7:_context2.t0==="doc"?9:_context2.t0==="flow"?11:_context2.t0==="quoted-scalar"?13:_context2.t0==="block-scalar"?15:_context2.t0==="plain-scalar"?17:19;break;case 3:return _context2.delegateYield(this.parseStream(),"t1",4);case 4:return _context2.abrupt("return",_context2.t1);case 5:return _context2.delegateYield(this.parseLineStart(),"t2",6);case 6:return _context2.abrupt("return",_context2.t2);case 7:return _context2.delegateYield(this.parseBlockStart(),"t3",8);case 8:return _context2.abrupt("return",_context2.t3);case 9:return _context2.delegateYield(this.parseDocument(),"t4",10);case 10:return _context2.abrupt("return",_context2.t4);case 11:return _context2.delegateYield(this.parseFlowCollection(),"t5",12);case 12:return _context2.abrupt("return",_context2.t5);case 13:return _context2.delegateYield(this.parseQuotedScalar(),"t6",14);case 14:return _context2.abrupt("return",_context2.t6);case 15:return _context2.delegateYield(this.parseBlockScalar(),"t7",16);case 16:return _context2.abrupt("return",_context2.t7);case 17:return _context2.delegateYield(this.parsePlainScalar(),"t8",18);case 18:return _context2.abrupt("return",_context2.t8);case 19:case"end":return _context2.stop()}}),parseNext,this)}))},{key:"parseStream",value:_regeneratorRuntime().mark((function parseStream(){var line,dirEnd,cs,ch,_ch,n,sp;return _regeneratorRuntime().wrap((function parseStream$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:line=this.getLine();if(!(line===null)){_context3.next=3;break}return _context3.abrupt("return",this.setNext("stream"));case 3:if(!(line[0]===_cst.BOM)){_context3.next=6;break}return _context3.delegateYield(this.pushCount(1),"t0",5);case 5:line=line.substring(1);case 6:if(!(line[0]==="%")){_context3.next=36;break}dirEnd=line.length;cs=line.indexOf("#");case 9:if(!(cs!==-1)){_context3.next=19;break}ch=line[cs-1];if(!(ch===" "||ch==="\t")){_context3.next=16;break}dirEnd=cs-1;return _context3.abrupt("break",19);case 16:cs=line.indexOf("#",cs+1);case 17:_context3.next=9;break;case 19:if(!true){_context3.next=28;break}_ch=line[dirEnd-1];if(!(_ch===" "||_ch==="\t")){_context3.next=25;break}dirEnd-=1;_context3.next=26;break;case 25:return _context3.abrupt("break",28);case 26:_context3.next=19;break;case 28:return _context3.delegateYield(this.pushCount(dirEnd),"t1",29);case 29:_context3.t2=_context3.t1;return _context3.delegateYield(this.pushSpaces(true),"t3",31);case 31:_context3.t4=_context3.t3;n=_context3.t2+_context3.t4;return _context3.delegateYield(this.pushCount(line.length-n),"t5",34);case 34:this.pushNewline();return _context3.abrupt("return","stream");case 36:if(!this.atLineEnd()){_context3.next=42;break}return _context3.delegateYield(this.pushSpaces(true),"t6",38);case 38:sp=_context3.t6;return _context3.delegateYield(this.pushCount(line.length-sp),"t7",40);case 40:return _context3.delegateYield(this.pushNewline(),"t8",41);case 41:return _context3.abrupt("return","stream");case 42:_context3.next=44;return _cst.DOCUMENT;case 44:return _context3.delegateYield(this.parseLineStart(),"t9",45);case 45:return _context3.abrupt("return",_context3.t9);case 46:case"end":return _context3.stop()}}),parseStream,this)}))},{key:"parseLineStart",value:_regeneratorRuntime().mark((function parseLineStart(){var ch,s;return _regeneratorRuntime().wrap((function parseLineStart$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:ch=this.charAt(0);if(!(!ch&&!this.atEnd)){_context4.next=3;break}return _context4.abrupt("return",this.setNext("line-start"));case 3:if(!(ch==="-"||ch===".")){_context4.next=12;break}if(!(!this.atEnd&&!this.hasChars(4))){_context4.next=6;break}return _context4.abrupt("return",this.setNext("line-start"));case 6:s=this.peek(3);if(!((s==="---"||s==="...")&&isEmpty(this.charAt(3)))){_context4.next=12;break}return _context4.delegateYield(this.pushCount(3),"t0",9);case 9:this.indentValue=0;this.indentNext=0;return _context4.abrupt("return",s==="---"?"doc":"stream");case 12:return _context4.delegateYield(this.pushSpaces(false),"t1",13);case 13:this.indentValue=_context4.t1;if(this.indentNext>this.indentValue&&!isEmpty(this.charAt(1)))this.indentNext=this.indentValue;return _context4.delegateYield(this.parseBlockStart(),"t2",16);case 16:return _context4.abrupt("return",_context4.t2);case 17:case"end":return _context4.stop()}}),parseLineStart,this)}))},{key:"parseBlockStart",value:_regeneratorRuntime().mark((function parseBlockStart(){var _this$peek,_this$peek2,ch0,ch1,n;return _regeneratorRuntime().wrap((function parseBlockStart$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:_this$peek=this.peek(2),_this$peek2=_slicedToArray(_this$peek,2),ch0=_this$peek2[0],ch1=_this$peek2[1];if(!(!ch1&&!this.atEnd)){_context5.next=3;break}return _context5.abrupt("return",this.setNext("block-start"));case 3:if(!((ch0==="-"||ch0==="?"||ch0===":")&&isEmpty(ch1))){_context5.next=13;break}return _context5.delegateYield(this.pushCount(1),"t0",5);case 5:_context5.t1=_context5.t0;return _context5.delegateYield(this.pushSpaces(true),"t2",7);case 7:_context5.t3=_context5.t2;n=_context5.t1+_context5.t3;this.indentNext=this.indentValue+1;this.indentValue+=n;return _context5.delegateYield(this.parseBlockStart(),"t4",12);case 12:return _context5.abrupt("return",_context5.t4);case 13:return _context5.abrupt("return","doc");case 14:case"end":return _context5.stop()}}),parseBlockStart,this)}))},{key:"parseDocument",value:_regeneratorRuntime().mark((function parseDocument(){var line,n;return _regeneratorRuntime().wrap((function parseDocument$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:return _context6.delegateYield(this.pushSpaces(true),"t0",1);case 1:line=this.getLine();if(!(line===null)){_context6.next=4;break}return _context6.abrupt("return",this.setNext("doc"));case 4:return _context6.delegateYield(this.pushIndicators(),"t1",5);case 5:n=_context6.t1;_context6.t2=line[n];_context6.next=_context6.t2==="#"?9:_context6.t2===undefined?10:_context6.t2==="{"?13:_context6.t2==="["?13:_context6.t2==="}"?17:_context6.t2==="]"?17:_context6.t2==="*"?19:_context6.t2==='"'?21:_context6.t2==="'"?21:_context6.t2==="|"?23:_context6.t2===">"?23:33;break;case 9:return _context6.delegateYield(this.pushCount(line.length-n),"t3",10);case 10:return _context6.delegateYield(this.pushNewline(),"t4",11);case 11:return _context6.delegateYield(this.parseLineStart(),"t5",12);case 12:return _context6.abrupt("return",_context6.t5);case 13:return _context6.delegateYield(this.pushCount(1),"t6",14);case 14:this.flowKey=false;this.flowLevel=1;return _context6.abrupt("return","flow");case 17:return _context6.delegateYield(this.pushCount(1),"t7",18);case 18:return _context6.abrupt("return","doc");case 19:return _context6.delegateYield(this.pushUntil(isNotAnchorChar),"t8",20);case 20:return _context6.abrupt("return","doc");case 21:return _context6.delegateYield(this.parseQuotedScalar(),"t9",22);case 22:return _context6.abrupt("return",_context6.t9);case 23:_context6.t10=n;return _context6.delegateYield(this.parseBlockScalarHeader(),"t11",25);case 25:n=_context6.t10+=_context6.t11;_context6.t12=n;return _context6.delegateYield(this.pushSpaces(true),"t13",28);case 28:n=_context6.t12+=_context6.t13;return _context6.delegateYield(this.pushCount(line.length-n),"t14",30);case 30:return _context6.delegateYield(this.pushNewline(),"t15",31);case 31:return _context6.delegateYield(this.parseBlockScalar(),"t16",32);case 32:return _context6.abrupt("return",_context6.t16);case 33:return _context6.delegateYield(this.parsePlainScalar(),"t17",34);case 34:return _context6.abrupt("return",_context6.t17);case 35:case"end":return _context6.stop()}}),parseDocument,this)}))},{key:"parseFlowCollection",value:_regeneratorRuntime().mark((function parseFlowCollection(){var nl,sp,indent,line,atFlowEndMarker,n,next;return _regeneratorRuntime().wrap((function parseFlowCollection$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:indent=-1;case 1:return _context7.delegateYield(this.pushNewline(),"t0",2);case 2:nl=_context7.t0;if(!(nl>0)){_context7.next=9;break}return _context7.delegateYield(this.pushSpaces(false),"t1",5);case 5:sp=_context7.t1;this.indentValue=indent=sp;_context7.next=10;break;case 9:sp=0;case 10:_context7.t2=sp;return _context7.delegateYield(this.pushSpaces(true),"t3",12);case 12:sp=_context7.t2+=_context7.t3;case 13:if(nl+sp>0){_context7.next=1;break}case 14:line=this.getLine();if(!(line===null)){_context7.next=17;break}return _context7.abrupt("return",this.setNext("flow"));case 17:if(!(indent!==-1&&indent<this.indentNext&&line[0]!=="#"||indent===0&&(line.startsWith("---")||line.startsWith("..."))&&isEmpty(line[3]))){_context7.next=25;break}atFlowEndMarker=indent===this.indentNext-1&&this.flowLevel===1&&(line[0]==="]"||line[0]==="}");if(atFlowEndMarker){_context7.next=25;break}this.flowLevel=0;_context7.next=23;return _cst.FLOW_END;case 23:return _context7.delegateYield(this.parseLineStart(),"t4",24);case 24:return _context7.abrupt("return",_context7.t4);case 25:n=0;case 26:if(!(line[n]===",")){_context7.next=36;break}_context7.t5=n;return _context7.delegateYield(this.pushCount(1),"t6",29);case 29:n=_context7.t5+=_context7.t6;_context7.t7=n;return _context7.delegateYield(this.pushSpaces(true),"t8",32);case 32:n=_context7.t7+=_context7.t8;this.flowKey=false;_context7.next=26;break;case 36:_context7.t9=n;return _context7.delegateYield(this.pushIndicators(),"t10",38);case 38:n=_context7.t9+=_context7.t10;_context7.t11=line[n];_context7.next=_context7.t11===undefined?42:_context7.t11==="#"?43:_context7.t11==="{"?45:_context7.t11==="["?45:_context7.t11==="}"?49:_context7.t11==="]"?49:_context7.t11==="*"?53:_context7.t11==='"'?55:_context7.t11==="'"?55:_context7.t11===":"?58:64;break;case 42:return _context7.abrupt("return","flow");case 43:return _context7.delegateYield(this.pushCount(line.length-n),"t12",44);case 44:return _context7.abrupt("return","flow");case 45:return _context7.delegateYield(this.pushCount(1),"t13",46);case 46:this.flowKey=false;this.flowLevel+=1;return _context7.abrupt("return","flow");case 49:return _context7.delegateYield(this.pushCount(1),"t14",50);case 50:this.flowKey=true;this.flowLevel-=1;return _context7.abrupt("return",this.flowLevel?"flow":"doc");case 53:return _context7.delegateYield(this.pushUntil(isNotAnchorChar),"t15",54);case 54:return _context7.abrupt("return","flow");case 55:this.flowKey=true;return _context7.delegateYield(this.parseQuotedScalar(),"t16",57);case 57:return _context7.abrupt("return",_context7.t16);case 58:next=this.charAt(1);if(!(this.flowKey||isEmpty(next)||next===",")){_context7.next=64;break}this.flowKey=false;return _context7.delegateYield(this.pushCount(1),"t17",62);case 62:return _context7.delegateYield(this.pushSpaces(true),"t18",63);case 63:return _context7.abrupt("return","flow");case 64:this.flowKey=false;return _context7.delegateYield(this.parsePlainScalar(),"t19",66);case 66:return _context7.abrupt("return",_context7.t19);case 67:case"end":return _context7.stop()}}),parseFlowCollection,this)}))},{key:"parseQuotedScalar",value:_regeneratorRuntime().mark((function parseQuotedScalar(){var quote,end,n,qb,nl,cs;return _regeneratorRuntime().wrap((function parseQuotedScalar$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:quote=this.charAt(0);end=this.buffer.indexOf(quote,this.pos+1);if(!(quote==="'")){_context8.next=6;break}while(end!==-1&&this.buffer[end+1]==="'")end=this.buffer.indexOf("'",end+2);_context8.next=14;break;case 6:if(!(end!==-1)){_context8.next=14;break}n=0;while(this.buffer[end-1-n]==="\\")n+=1;if(!(n%2===0)){_context8.next=11;break}return _context8.abrupt("break",14);case 11:end=this.buffer.indexOf('"',end+1);_context8.next=6;break;case 14:qb=this.buffer.substring(0,end);nl=qb.indexOf("\n",this.pos);if(!(nl!==-1)){_context8.next=25;break}case 17:if(!(nl!==-1)){_context8.next=24;break}cs=this.continueScalar(nl+1);if(!(cs===-1)){_context8.next=21;break}return _context8.abrupt("break",24);case 21:nl=qb.indexOf("\n",cs);_context8.next=17;break;case 24:if(nl!==-1){end=nl-(qb[nl-1]==="\r"?2:1)}case 25:if(!(end===-1)){_context8.next=29;break}if(this.atEnd){_context8.next=28;break}return _context8.abrupt("return",this.setNext("quoted-scalar"));case 28:end=this.buffer.length;case 29:return _context8.delegateYield(this.pushToIndex(end+1,false),"t0",30);case 30:return _context8.abrupt("return",this.flowLevel?"flow":"doc");case 31:case"end":return _context8.stop()}}),parseQuotedScalar,this)}))},{key:"parseBlockScalarHeader",value:_regeneratorRuntime().mark((function parseBlockScalarHeader(){var i,ch;return _regeneratorRuntime().wrap((function parseBlockScalarHeader$(_context9){while(1)switch(_context9.prev=_context9.next){case 0:this.blockScalarIndent=-1;this.blockScalarKeep=false;i=this.pos;case 3:if(!true){_context9.next=17;break}ch=this.buffer[++i];if(!(ch==="+")){_context9.next=9;break}this.blockScalarKeep=true;_context9.next=15;break;case 9:if(!(ch>"0"&&ch<="9")){_context9.next=13;break}this.blockScalarIndent=Number(ch)-1;_context9.next=15;break;case 13:if(!(ch!=="-")){_context9.next=15;break}return _context9.abrupt("break",17);case 15:_context9.next=3;break;case 17:return _context9.delegateYield(this.pushUntil((function(ch){return isEmpty(ch)||ch==="#"})),"t0",18);case 18:return _context9.abrupt("return",_context9.t0);case 19:case"end":return _context9.stop()}}),parseBlockScalarHeader,this)}))},{key:"parseBlockScalar",value:_regeneratorRuntime().mark((function parseBlockScalar(){var nl,indent,ch,_i,next,cs,i,_i2,_ch2,lastChar;return _regeneratorRuntime().wrap((function parseBlockScalar$(_context10){while(1)switch(_context10.prev=_context10.next){case 0:nl=this.pos-1;indent=0;_i=this.pos;case 3:if(!(ch=this.buffer[_i])){_context10.next=21;break}_context10.t0=ch;_context10.next=_context10.t0===" "?7:_context10.t0==="\n"?9:_context10.t0==="\r"?12:17;break;case 7:indent+=1;return _context10.abrupt("break",18);case 9:nl=_i;indent=0;return _context10.abrupt("break",18);case 12:next=this.buffer[_i+1];if(!(!next&&!this.atEnd)){_context10.next=15;break}return _context10.abrupt("return",this.setNext("block-scalar"));case 15:if(!(next==="\n")){_context10.next=17;break}return _context10.abrupt("break",18);case 17:return _context10.abrupt("break",21);case 18:++_i;_context10.next=3;break;case 21:if(!(!ch&&!this.atEnd)){_context10.next=23;break}return _context10.abrupt("return",this.setNext("block-scalar"));case 23:if(!(indent>=this.indentNext)){_context10.next=34;break}if(this.blockScalarIndent===-1)this.indentNext=indent;else{this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext)}case 25:cs=this.continueScalar(nl+1);if(!(cs===-1)){_context10.next=28;break}return _context10.abrupt("break",30);case 28:nl=this.buffer.indexOf("\n",cs);case 29:if(nl!==-1){_context10.next=25;break}case 30:if(!(nl===-1)){_context10.next=34;break}if(this.atEnd){_context10.next=33;break}return _context10.abrupt("return",this.setNext("block-scalar"));case 33:nl=this.buffer.length;case 34:i=nl+1;ch=this.buffer[i];while(ch===" ")ch=this.buffer[++i];if(!(ch==="\t")){_context10.next=42;break}while(ch==="\t"||ch===" "||ch==="\r"||ch==="\n")ch=this.buffer[++i];nl=i-1;_context10.next=54;break;case 42:if(this.blockScalarKeep){_context10.next=54;break}case 43:_i2=nl-1;_ch2=this.buffer[_i2];if(_ch2==="\r")_ch2=this.buffer[--_i2];lastChar=_i2;while(_ch2===" ")_ch2=this.buffer[--_i2];if(!(_ch2==="\n"&&_i2>=this.pos&&_i2+1+indent>lastChar)){_context10.next=52;break}nl=_i2;_context10.next=53;break;case 52:return _context10.abrupt("break",54);case 53:if(true){_context10.next=43;break}case 54:_context10.next=56;return _cst.SCALAR;case 56:return _context10.delegateYield(this.pushToIndex(nl+1,true),"t1",57);case 57:return _context10.delegateYield(this.parseLineStart(),"t2",58);case 58:return _context10.abrupt("return",_context10.t2);case 59:case"end":return _context10.stop()}}),parseBlockScalar,this)}))},{key:"parsePlainScalar",value:_regeneratorRuntime().mark((function parsePlainScalar(){var inFlow,end,i,ch,next,_next,cs;return _regeneratorRuntime().wrap((function parsePlainScalar$(_context11){while(1)switch(_context11.prev=_context11.next){case 0:inFlow=this.flowLevel>0;end=this.pos-1;i=this.pos-1;case 3:if(!(ch=this.buffer[++i])){_context11.next=28;break}if(!(ch===":")){_context11.next=11;break}next=this.buffer[i+1];if(!(isEmpty(next)||inFlow&&flowIndicatorChars.has(next))){_context11.next=8;break}return _context11.abrupt("break",28);case 8:end=i;_context11.next=26;break;case 11:if(!isEmpty(ch)){_context11.next=23;break}_next=this.buffer[i+1];if(ch==="\r"){if(_next==="\n"){i+=1;ch="\n";_next=this.buffer[i+1]}else end=i}if(!(_next==="#"||inFlow&&flowIndicatorChars.has(_next))){_context11.next=16;break}return _context11.abrupt("break",28);case 16:if(!(ch==="\n")){_context11.next=21;break}cs=this.continueScalar(i+1);if(!(cs===-1)){_context11.next=20;break}return _context11.abrupt("break",28);case 20:i=Math.max(i,cs-2);case 21:_context11.next=26;break;case 23:if(!(inFlow&&flowIndicatorChars.has(ch))){_context11.next=25;break}return _context11.abrupt("break",28);case 25:end=i;case 26:_context11.next=3;break;case 28:if(!(!ch&&!this.atEnd)){_context11.next=30;break}return _context11.abrupt("return",this.setNext("plain-scalar"));case 30:_context11.next=32;return _cst.SCALAR;case 32:return _context11.delegateYield(this.pushToIndex(end+1,true),"t0",33);case 33:return _context11.abrupt("return",inFlow?"flow":"doc");case 34:case"end":return _context11.stop()}}),parsePlainScalar,this)}))},{key:"pushCount",value:_regeneratorRuntime().mark((function pushCount(n){return _regeneratorRuntime().wrap((function pushCount$(_context12){while(1)switch(_context12.prev=_context12.next){case 0:if(!(n>0)){_context12.next=5;break}_context12.next=3;return this.buffer.substr(this.pos,n);case 3:this.pos+=n;return _context12.abrupt("return",n);case 5:return _context12.abrupt("return",0);case 6:case"end":return _context12.stop()}}),pushCount,this)}))},{key:"pushToIndex",value:_regeneratorRuntime().mark((function pushToIndex(i,allowEmpty){var s;return _regeneratorRuntime().wrap((function pushToIndex$(_context13){while(1)switch(_context13.prev=_context13.next){case 0:s=this.buffer.slice(this.pos,i);if(!s){_context13.next=8;break}_context13.next=4;return s;case 4:this.pos+=s.length;return _context13.abrupt("return",s.length);case 8:if(!allowEmpty){_context13.next=11;break}_context13.next=11;return"";case 11:return _context13.abrupt("return",0);case 12:case"end":return _context13.stop()}}),pushToIndex,this)}))},{key:"pushIndicators",value:_regeneratorRuntime().mark((function pushIndicators(){var inFlow,ch1;return _regeneratorRuntime().wrap((function pushIndicators$(_context14){while(1)switch(_context14.prev=_context14.next){case 0:_context14.t0=this.charAt(0);_context14.next=_context14.t0==="!"?3:_context14.t0==="&"?11:_context14.t0==="-"?19:_context14.t0==="?"?19:_context14.t0===":"?19:31;break;case 3:return _context14.delegateYield(this.pushTag(),"t1",4);case 4:_context14.t2=_context14.t1;return _context14.delegateYield(this.pushSpaces(true),"t3",6);case 6:_context14.t4=_context14.t3;_context14.t5=_context14.t2+_context14.t4;return _context14.delegateYield(this.pushIndicators(),"t6",9);case 9:_context14.t7=_context14.t6;return _context14.abrupt("return",_context14.t5+_context14.t7);case 11:return _context14.delegateYield(this.pushUntil(isNotAnchorChar),"t8",12);case 12:_context14.t9=_context14.t8;return _context14.delegateYield(this.pushSpaces(true),"t10",14);case 14:_context14.t11=_context14.t10;_context14.t12=_context14.t9+_context14.t11;return _context14.delegateYield(this.pushIndicators(),"t13",17);case 17:_context14.t14=_context14.t13;return _context14.abrupt("return",_context14.t12+_context14.t14);case 19:inFlow=this.flowLevel>0;ch1=this.charAt(1);if(!(isEmpty(ch1)||inFlow&&flowIndicatorChars.has(ch1))){_context14.next=31;break}if(!inFlow)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=false;return _context14.delegateYield(this.pushCount(1),"t15",24);case 24:_context14.t16=_context14.t15;return _context14.delegateYield(this.pushSpaces(true),"t17",26);case 26:_context14.t18=_context14.t17;_context14.t19=_context14.t16+_context14.t18;return _context14.delegateYield(this.pushIndicators(),"t20",29);case 29:_context14.t21=_context14.t20;return _context14.abrupt("return",_context14.t19+_context14.t21);case 31:return _context14.abrupt("return",0);case 32:case"end":return _context14.stop()}}),pushIndicators,this)}))},{key:"pushTag",value:_regeneratorRuntime().mark((function pushTag(){var i,ch,_i3,_ch3;return _regeneratorRuntime().wrap((function pushTag$(_context15){while(1)switch(_context15.prev=_context15.next){case 0:if(!(this.charAt(1)==="<")){_context15.next=8;break}i=this.pos+2;ch=this.buffer[i];while(!isEmpty(ch)&&ch!==">")ch=this.buffer[++i];return _context15.delegateYield(this.pushToIndex(ch===">"?i+1:i,false),"t0",5);case 5:return _context15.abrupt("return",_context15.t0);case 8:_i3=this.pos+1;_ch3=this.buffer[_i3];case 10:if(!_ch3){_context15.next=22;break}if(!tagChars.has(_ch3)){_context15.next=15;break}_ch3=this.buffer[++_i3];_context15.next=20;break;case 15:if(!(_ch3==="%"&&hexDigits.has(this.buffer[_i3+1])&&hexDigits.has(this.buffer[_i3+2]))){_context15.next=19;break}_ch3=this.buffer[_i3+=3];_context15.next=20;break;case 19:return _context15.abrupt("break",22);case 20:_context15.next=10;break;case 22:return _context15.delegateYield(this.pushToIndex(_i3,false),"t1",23);case 23:return _context15.abrupt("return",_context15.t1);case 24:case"end":return _context15.stop()}}),pushTag,this)}))},{key:"pushNewline",value:_regeneratorRuntime().mark((function pushNewline(){var ch;return _regeneratorRuntime().wrap((function pushNewline$(_context16){while(1)switch(_context16.prev=_context16.next){case 0:ch=this.buffer[this.pos];if(!(ch==="\n")){_context16.next=6;break}return _context16.delegateYield(this.pushCount(1),"t0",3);case 3:return _context16.abrupt("return",_context16.t0);case 6:if(!(ch==="\r"&&this.charAt(1)==="\n")){_context16.next=11;break}return _context16.delegateYield(this.pushCount(2),"t1",8);case 8:return _context16.abrupt("return",_context16.t1);case 11:return _context16.abrupt("return",0);case 12:case"end":return _context16.stop()}}),pushNewline,this)}))},{key:"pushSpaces",value:_regeneratorRuntime().mark((function pushSpaces(allowTabs){var i,ch,n;return _regeneratorRuntime().wrap((function pushSpaces$(_context17){while(1)switch(_context17.prev=_context17.next){case 0:i=this.pos-1;do{ch=this.buffer[++i]}while(ch===" "||allowTabs&&ch==="\t");n=i-this.pos;if(!(n>0)){_context17.next=7;break}_context17.next=6;return this.buffer.substr(this.pos,n);case 6:this.pos=i;case 7:return _context17.abrupt("return",n);case 8:case"end":return _context17.stop()}}),pushSpaces,this)}))},{key:"pushUntil",value:_regeneratorRuntime().mark((function pushUntil(test){var i,ch;return _regeneratorRuntime().wrap((function pushUntil$(_context18){while(1)switch(_context18.prev=_context18.next){case 0:i=this.pos;ch=this.buffer[i];while(!test(ch))ch=this.buffer[++i];return _context18.delegateYield(this.pushToIndex(i,false),"t0",4);case 4:return _context18.abrupt("return",_context18.t0);case 5:case"end":return _context18.stop()}}),pushUntil,this)}))}])}()},{"./cst.js":261}],263:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}Object.defineProperty(exports,"__esModule",{value:true});exports.LineCounter=void 0;function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}var LineCounter=exports.LineCounter=_createClass((function LineCounter(){var _this=this;_classCallCheck(this,LineCounter);this.lineStarts=[];this.addNewLine=function(offset){return _this.lineStarts.push(offset)};this.linePos=function(offset){var low=0;var high=_this.lineStarts.length;while(low<high){var mid=low+high>>1;if(_this.lineStarts[mid]<offset)low=mid+1;else high=mid}if(_this.lineStarts[low]===offset)return{line:low+1,col:1};if(low===0)return{line:0,col:offset};var start=_this.lineStarts[low-1];return{line:low,col:offset-start+1}}}))},{}],264:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}Object.defineProperty(exports,"__esModule",{value:true});exports.Parser=void 0;var _cst=require("./cst.js");var _lexer=require("./lexer.js");function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{define({},"")}catch(t){define=function define(t,e,r){return t[e]=r}}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,(function(){return this}));var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach((function(e){define(t,e,(function(t){return this._invoke(e,t)}))}))}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){invoke("next",t,i,a)}),(function(t){invoke("throw",t,i,a)})):e.resolve(h).then((function(t){u.value=t,i(u)}),(function(t){return invoke("throw",t,i,a)}))}a(c.arg)}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e((function(e,r){invoke(t,n,e,r)}))}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done}}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg)}}}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next};return i.next=i}}throw new TypeError(_typeof(e)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t},e.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,(function(){return this})),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,(function(){return this})),define(g,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next}return next.done=!0,next}},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y}},catch:function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function includesToken(list,type){for(var i=0;i<list.length;++i)if(list[i].type===type)return true;return false}function findNonEmptyIndex(list){for(var i=0;i<list.length;++i){switch(list[i].type){case"space":case"comment":case"newline":break;default:return i}}return-1}function isFlowToken(token){switch(token===null||token===void 0?void 0:token.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return true;default:return false}}function getPrevProps(parent){switch(parent.type){case"document":return parent.start;case"block-map":{var _it$sep;var it=parent.items[parent.items.length-1];return(_it$sep=it.sep)!==null&&_it$sep!==void 0?_it$sep:it.start}case"block-seq":return parent.items[parent.items.length-1].start;default:return[]}}function getFirstKeyStartProps(prev){if(prev.length===0)return[];var i=prev.length;loop:while(--i>=0){switch(prev[i].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break loop}}while(((_prev$i=prev[++i])===null||_prev$i===void 0?void 0:_prev$i.type)==="space"){var _prev$i}return prev.splice(i,prev.length)}function fixFlowSeqItems(fc){if(fc.start.type==="flow-seq-start"){var _iterator=_createForOfIteratorHelper(fc.items),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var it=_step.value;if(it.sep&&!it.value&&!includesToken(it.start,"explicit-key-ind")&&!includesToken(it.sep,"map-value-ind")){if(it.key)it.value=it.key;delete it.key;if(isFlowToken(it.value)){if(it.value.end)Array.prototype.push.apply(it.value.end,it.sep);else it.value.end=it.sep}else Array.prototype.push.apply(it.start,it.sep);delete it.sep}}}catch(err){_iterator.e(err)}finally{_iterator.f()}}}var Parser=exports.Parser=function(){function Parser(onNewLine){_classCallCheck(this,Parser);this.atNewLine=true;this.atScalar=false;this.indent=0;this.offset=0;this.onKeyLine=false;this.stack=[];this.source="";this.type="";this.lexer=new _lexer.Lexer;this.onNewLine=onNewLine}return _createClass(Parser,[{key:"parse",value:function parse(source){var _this=this;var incomplete=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;return _regeneratorRuntime().mark((function _callee(){var _iterator2,_step2,lexeme;return _regeneratorRuntime().wrap((function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:if(_this.onNewLine&&_this.offset===0)_this.onNewLine(0);_iterator2=_createForOfIteratorHelper(_this.lexer.lex(source,incomplete));_context.prev=2;_iterator2.s();case 4:if((_step2=_iterator2.n()).done){_context.next=9;break}lexeme=_step2.value;return _context.delegateYield(_this.next(lexeme),"t0",7);case 7:_context.next=4;break;case 9:_context.next=14;break;case 11:_context.prev=11;_context.t1=_context["catch"](2);_iterator2.e(_context.t1);case 14:_context.prev=14;_iterator2.f();return _context.finish(14);case 17:if(incomplete){_context.next=19;break}return _context.delegateYield(_this.end(),"t2",19);case 19:case"end":return _context.stop()}}),_callee,null,[[2,11,14,17]])}))()}},{key:"next",value:_regeneratorRuntime().mark((function next(source){var type,message;return _regeneratorRuntime().wrap((function next$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:this.source=source;if(!this.atScalar){_context2.next=6;break}this.atScalar=false;return _context2.delegateYield(this.step(),"t0",4);case 4:this.offset+=source.length;return _context2.abrupt("return");case 6:type=(0,_cst.tokenType)(source);if(type){_context2.next=13;break}message="Not a YAML token: ".concat(source);return _context2.delegateYield(this.pop({type:"error",offset:this.offset,message:message,source:source}),"t1",10);case 10:this.offset+=source.length;_context2.next=35;break;case 13:if(!(type==="scalar")){_context2.next=19;break}this.atNewLine=false;this.atScalar=true;this.type="scalar";_context2.next=35;break;case 19:this.type=type;return _context2.delegateYield(this.step(),"t2",21);case 21:_context2.t3=type;_context2.next=_context2.t3==="newline"?24:_context2.t3==="space"?28:_context2.t3==="explicit-key-ind"?30:_context2.t3==="map-value-ind"?30:_context2.t3==="seq-item-ind"?30:_context2.t3==="doc-mode"?32:_context2.t3==="flow-error-end"?32:33;break;case 24:this.atNewLine=true;this.indent=0;if(this.onNewLine)this.onNewLine(this.offset+source.length);return _context2.abrupt("break",34);case 28:if(this.atNewLine&&source[0]===" ")this.indent+=source.length;return _context2.abrupt("break",34);case 30:if(this.atNewLine)this.indent+=source.length;return _context2.abrupt("break",34);case 32:return _context2.abrupt("return");case 33:this.atNewLine=false;case 34:this.offset+=source.length;case 35:case"end":return _context2.stop()}}),next,this)}))},{key:"end",value:_regeneratorRuntime().mark((function end(){return _regeneratorRuntime().wrap((function end$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:if(!(this.stack.length>0)){_context3.next=4;break}return _context3.delegateYield(this.pop(),"t0",2);case 2:_context3.next=0;break;case 4:case"end":return _context3.stop()}}),end,this)}))},{key:"sourceToken",get:function get(){var st={type:this.type,offset:this.offset,indent:this.indent,source:this.source};return st}},{key:"step",value:_regeneratorRuntime().mark((function step(){var top;return _regeneratorRuntime().wrap((function step$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:top=this.peek(1);if(!(this.type==="doc-end"&&(!top||top.type!=="doc-end"))){_context4.next=8;break}case 2:if(!(this.stack.length>0)){_context4.next=6;break}return _context4.delegateYield(this.pop(),"t0",4);case 4:_context4.next=2;break;case 6:this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return _context4.abrupt("return");case 8:if(top){_context4.next=11;break}return _context4.delegateYield(this.stream(),"t1",10);case 10:return _context4.abrupt("return",_context4.t1);case 11:_context4.t2=top.type;_context4.next=_context4.t2==="document"?14:_context4.t2==="alias"?16:_context4.t2==="scalar"?16:_context4.t2==="single-quoted-scalar"?16:_context4.t2==="double-quoted-scalar"?16:_context4.t2==="block-scalar"?18:_context4.t2==="block-map"?20:_context4.t2==="block-seq"?22:_context4.t2==="flow-collection"?24:_context4.t2==="doc-end"?26:28;break;case 14:return _context4.delegateYield(this.document(top),"t3",15);case 15:return _context4.abrupt("return",_context4.t3);case 16:return _context4.delegateYield(this.scalar(top),"t4",17);case 17:return _context4.abrupt("return",_context4.t4);case 18:return _context4.delegateYield(this.blockScalar(top),"t5",19);case 19:return _context4.abrupt("return",_context4.t5);case 20:return _context4.delegateYield(this.blockMap(top),"t6",21);case 21:return _context4.abrupt("return",_context4.t6);case 22:return _context4.delegateYield(this.blockSequence(top),"t7",23);case 23:return _context4.abrupt("return",_context4.t7);case 24:return _context4.delegateYield(this.flowCollection(top),"t8",25);case 25:return _context4.abrupt("return",_context4.t8);case 26:return _context4.delegateYield(this.documentEnd(top),"t9",27);case 27:return _context4.abrupt("return",_context4.t9);case 28:return _context4.delegateYield(this.pop(),"t10",29);case 29:case"end":return _context4.stop()}}),step,this)}))},{key:"peek",value:function peek(n){return this.stack[this.stack.length-n]}},{key:"pop",value:_regeneratorRuntime().mark((function pop(error){var token,message,top,it,_it,_it2,last;return _regeneratorRuntime().wrap((function pop$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:token=error!==null&&error!==void 0?error:this.stack.pop();if(token){_context5.next=7;break}message="Tried to pop an empty stack";_context5.next=5;return{type:"error",offset:this.offset,source:"",message:message};case 5:_context5.next=46;break;case 7:if(!(this.stack.length===0)){_context5.next=12;break}_context5.next=10;return token;case 10:_context5.next=46;break;case 12:top=this.peek(1);if(token.type==="block-scalar"){token.indent="indent"in top?top.indent:0}else if(token.type==="flow-collection"&&top.type==="document"){token.indent=0}if(token.type==="flow-collection")fixFlowSeqItems(token);_context5.t0=top.type;_context5.next=_context5.t0==="document"?18:_context5.t0==="block-scalar"?20:_context5.t0==="block-map"?22:_context5.t0==="block-seq"?37:_context5.t0==="flow-collection"?40:43;break;case 18:top.value=token;return _context5.abrupt("break",45);case 20:top.props.push(token);return _context5.abrupt("break",45);case 22:it=top.items[top.items.length-1];if(!it.value){_context5.next=29;break}top.items.push({start:[],key:token,sep:[]});this.onKeyLine=true;return _context5.abrupt("return");case 29:if(!it.sep){_context5.next=33;break}it.value=token;_context5.next=36;break;case 33:Object.assign(it,{key:token,sep:[]});this.onKeyLine=!it.explicitKey;return _context5.abrupt("return");case 36:return _context5.abrupt("break",45);case 37:_it=top.items[top.items.length-1];if(_it.value)top.items.push({start:[],value:token});else _it.value=token;return _context5.abrupt("break",45);case 40:_it2=top.items[top.items.length-1];if(!_it2||_it2.value)top.items.push({start:[],key:token,sep:[]});else if(_it2.sep)_it2.value=token;else Object.assign(_it2,{key:token,sep:[]});return _context5.abrupt("return");case 43:return _context5.delegateYield(this.pop(),"t1",44);case 44:return _context5.delegateYield(this.pop(token),"t2",45);case 45:if((top.type==="document"||top.type==="block-map"||top.type==="block-seq")&&(token.type==="block-map"||token.type==="block-seq")){last=token.items[token.items.length-1];if(last&&!last.sep&&!last.value&&last.start.length>0&&findNonEmptyIndex(last.start)===-1&&(token.indent===0||last.start.every((function(st){return st.type!=="comment"||st.indent<token.indent})))){if(top.type==="document")top.end=last.start;else top.items.push({start:last.start});token.items.splice(-1,1)}}case 46:case"end":return _context5.stop()}}),pop,this)}))},{key:"stream",value:_regeneratorRuntime().mark((function stream(){var doc;return _regeneratorRuntime().wrap((function stream$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:_context6.t0=this.type;_context6.next=_context6.t0==="directive-line"?3:_context6.t0==="byte-order-mark"?6:_context6.t0==="space"?6:_context6.t0==="comment"?6:_context6.t0==="newline"?6:_context6.t0==="doc-mode"?9:_context6.t0==="doc-start"?9:13;break;case 3:_context6.next=5;return{type:"directive",offset:this.offset,source:this.source};case 5:return _context6.abrupt("return");case 6:_context6.next=8;return this.sourceToken;case 8:return _context6.abrupt("return");case 9:doc={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")doc.start.push(this.sourceToken);this.stack.push(doc);return _context6.abrupt("return");case 13:_context6.next=15;return{type:"error",offset:this.offset,message:"Unexpected ".concat(this.type," token in YAML stream"),source:this.source};case 15:case"end":return _context6.stop()}}),stream,this)}))},{key:"document",value:_regeneratorRuntime().mark((function document(doc){var bv;return _regeneratorRuntime().wrap((function document$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:if(!doc.value){_context7.next=3;break}return _context7.delegateYield(this.lineEnd(doc),"t0",2);case 2:return _context7.abrupt("return",_context7.t0);case 3:_context7.t1=this.type;_context7.next=_context7.t1==="doc-start"?6:_context7.t1==="anchor"?13:_context7.t1==="tag"?13:_context7.t1==="space"?13:_context7.t1==="comment"?13:_context7.t1==="newline"?13:15;break;case 6:if(!(findNonEmptyIndex(doc.start)!==-1)){_context7.next=11;break}return _context7.delegateYield(this.pop(),"t2",8);case 8:return _context7.delegateYield(this.step(),"t3",9);case 9:_context7.next=12;break;case 11:doc.start.push(this.sourceToken);case 12:return _context7.abrupt("return");case 13:doc.start.push(this.sourceToken);return _context7.abrupt("return");case 15:bv=this.startBlockValue(doc);if(!bv){_context7.next=20;break}this.stack.push(bv);_context7.next=22;break;case 20:_context7.next=22;return{type:"error",offset:this.offset,message:"Unexpected ".concat(this.type," token in YAML document"),source:this.source};case 22:case"end":return _context7.stop()}}),document,this)}))},{key:"scalar",value:_regeneratorRuntime().mark((function scalar(_scalar){var prev,start,sep,map;return _regeneratorRuntime().wrap((function scalar$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:if(!(this.type==="map-value-ind")){_context8.next=9;break}prev=getPrevProps(this.peek(2));start=getFirstKeyStartProps(prev);if(_scalar.end){sep=_scalar.end;sep.push(this.sourceToken);delete _scalar.end}else sep=[this.sourceToken];map={type:"block-map",offset:_scalar.offset,indent:_scalar.indent,items:[{start:start,key:_scalar,sep:sep}]};this.onKeyLine=true;this.stack[this.stack.length-1]=map;_context8.next=10;break;case 9:return _context8.delegateYield(this.lineEnd(_scalar),"t0",10);case 10:case"end":return _context8.stop()}}),scalar,this)}))},{key:"blockScalar",value:_regeneratorRuntime().mark((function blockScalar(scalar){var nl;return _regeneratorRuntime().wrap((function blockScalar$(_context9){while(1)switch(_context9.prev=_context9.next){case 0:_context9.t0=this.type;_context9.next=_context9.t0==="space"?3:_context9.t0==="comment"?3:_context9.t0==="newline"?3:_context9.t0==="scalar"?5:11;break;case 3:scalar.props.push(this.sourceToken);return _context9.abrupt("return");case 5:scalar.source=this.source;this.atNewLine=true;this.indent=0;if(this.onNewLine){nl=this.source.indexOf("\n")+1;while(nl!==0){this.onNewLine(this.offset+nl);nl=this.source.indexOf("\n",nl)+1}}return _context9.delegateYield(this.pop(),"t1",10);case 10:return _context9.abrupt("break",13);case 11:return _context9.delegateYield(this.pop(),"t2",12);case 12:return _context9.delegateYield(this.step(),"t3",13);case 13:case"end":return _context9.stop()}}),blockScalar,this)}))},{key:"blockMap",value:_regeneratorRuntime().mark((function blockMap(map){var it,end,last,_prev$value,prev,_end,atMapIndent,atNextItem,start,nl,i,st,_start,_start2,key,sep,fs,bv;return _regeneratorRuntime().wrap((function blockMap$(_context10){while(1)switch(_context10.prev=_context10.next){case 0:it=map.items[map.items.length-1];_context10.t0=this.type;_context10.next=_context10.t0==="newline"?4:_context10.t0==="space"?7:_context10.t0==="comment"?7:25;break;case 4:this.onKeyLine=false;if(it.value){end="end"in it.value?it.value.end:undefined;last=Array.isArray(end)?end[end.length-1]:undefined;if((last===null||last===void 0?void 0:last.type)==="comment")end===null||end===void 0||end.push(this.sourceToken);else map.items.push({start:[this.sourceToken]})}else if(it.sep){it.sep.push(this.sourceToken)}else{it.start.push(this.sourceToken)}return _context10.abrupt("return");case 7:if(!it.value){_context10.next=11;break}map.items.push({start:[this.sourceToken]});_context10.next=24;break;case 11:if(!it.sep){_context10.next=15;break}it.sep.push(this.sourceToken);_context10.next=24;break;case 15:if(!this.atIndentedComment(it.start,map.indent)){_context10.next=23;break}prev=map.items[map.items.length-2];_end=prev===null||prev===void 0||(_prev$value=prev.value)===null||_prev$value===void 0?void 0:_prev$value.end;if(!Array.isArray(_end)){_context10.next=23;break}Array.prototype.push.apply(_end,it.start);_end.push(this.sourceToken);map.items.pop();return _context10.abrupt("return");case 23:it.start.push(this.sourceToken);case 24:return _context10.abrupt("return");case 25:if(!(this.indent>=map.indent)){_context10.next=66;break}atMapIndent=!this.onKeyLine&&this.indent===map.indent;atNextItem=atMapIndent&&(it.sep||it.explicitKey)&&this.type!=="seq-item-ind";start=[];if(!(atNextItem&&it.sep&&!it.value)){_context10.next=47;break}nl=[];i=0;case 32:if(!(i<it.sep.length)){_context10.next=46;break}st=it.sep[i];_context10.t1=st.type;_context10.next=_context10.t1==="newline"?37:_context10.t1==="space"?39:_context10.t1==="comment"?40:42;break;case 37:nl.push(i);return _context10.abrupt("break",43);case 39:return _context10.abrupt("break",43);case 40:if(st.indent>map.indent)nl.length=0;return _context10.abrupt("break",43);case 42:nl.length=0;case 43:++i;_context10.next=32;break;case 46:if(nl.length>=2)start=it.sep.splice(nl[1]);case 47:_context10.t2=this.type;_context10.next=_context10.t2==="anchor"?50:_context10.t2==="tag"?50:_context10.t2==="explicit-key-ind"?52:_context10.t2==="map-value-ind"?55:_context10.t2==="alias"?58:_context10.t2==="scalar"?58:_context10.t2==="single-quoted-scalar"?58:_context10.t2==="double-quoted-scalar"?58:61;break;case 50:if(atNextItem||it.value){start.push(this.sourceToken);map.items.push({start:start});this.onKeyLine=true}else if(it.sep){it.sep.push(this.sourceToken)}else{it.start.push(this.sourceToken)}return _context10.abrupt("return");case 52:if(!it.sep&&!it.explicitKey){it.start.push(this.sourceToken);it.explicitKey=true}else if(atNextItem||it.value){start.push(this.sourceToken);map.items.push({start:start,explicitKey:true})}else{this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:true}]})}this.onKeyLine=true;return _context10.abrupt("return");case 55:if(it.explicitKey){if(!it.sep){if(includesToken(it.start,"newline")){Object.assign(it,{key:null,sep:[this.sourceToken]})}else{_start=getFirstKeyStartProps(it.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:_start,key:null,sep:[this.sourceToken]}]})}}else if(it.value){map.items.push({start:[],key:null,sep:[this.sourceToken]})}else if(includesToken(it.sep,"map-value-ind")){this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:start,key:null,sep:[this.sourceToken]}]})}else if(isFlowToken(it.key)&&!includesToken(it.sep,"newline")){_start2=getFirstKeyStartProps(it.start);key=it.key;sep=it.sep;sep.push(this.sourceToken);delete it.key;delete it.sep;this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:_start2,key:key,sep:sep}]})}else if(start.length>0){it.sep=it.sep.concat(start,this.sourceToken)}else{it.sep.push(this.sourceToken)}}else{if(!it.sep){Object.assign(it,{key:null,sep:[this.sourceToken]})}else if(it.value||atNextItem){map.items.push({start:start,key:null,sep:[this.sourceToken]})}else if(includesToken(it.sep,"map-value-ind")){this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]})}else{it.sep.push(this.sourceToken)}}this.onKeyLine=true;return _context10.abrupt("return");case 58:fs=this.flowScalar(this.type);if(atNextItem||it.value){map.items.push({start:start,key:fs,sep:[]});this.onKeyLine=true}else if(it.sep){this.stack.push(fs)}else{Object.assign(it,{key:fs,sep:[]});this.onKeyLine=true}return _context10.abrupt("return");case 61:bv=this.startBlockValue(map);if(!bv){_context10.next=66;break}if(atMapIndent&&bv.type!=="block-seq"){map.items.push({start:start})}this.stack.push(bv);return _context10.abrupt("return");case 66:return _context10.delegateYield(this.pop(),"t3",67);case 67:return _context10.delegateYield(this.step(),"t4",68);case 68:case"end":return _context10.stop()}}),blockMap,this)}))},{key:"blockSequence",value:_regeneratorRuntime().mark((function blockSequence(seq){var it,end,last,_prev$value2,prev,_end2,bv;return _regeneratorRuntime().wrap((function blockSequence$(_context11){while(1)switch(_context11.prev=_context11.next){case 0:it=seq.items[seq.items.length-1];_context11.t0=this.type;_context11.next=_context11.t0==="newline"?4:_context11.t0==="space"?6:_context11.t0==="comment"?6:_context11.t0==="anchor"?20:_context11.t0==="tag"?20:_context11.t0==="seq-item-ind"?24:28;break;case 4:if(it.value){end="end"in it.value?it.value.end:undefined;last=Array.isArray(end)?end[end.length-1]:undefined;if((last===null||last===void 0?void 0:last.type)==="comment")end===null||end===void 0||end.push(this.sourceToken);else seq.items.push({start:[this.sourceToken]})}else it.start.push(this.sourceToken);return _context11.abrupt("return");case 6:if(!it.value){_context11.next=10;break}seq.items.push({start:[this.sourceToken]});_context11.next=19;break;case 10:if(!this.atIndentedComment(it.start,seq.indent)){_context11.next=18;break}prev=seq.items[seq.items.length-2];_end2=prev===null||prev===void 0||(_prev$value2=prev.value)===null||_prev$value2===void 0?void 0:_prev$value2.end;if(!Array.isArray(_end2)){_context11.next=18;break}Array.prototype.push.apply(_end2,it.start);_end2.push(this.sourceToken);seq.items.pop();return _context11.abrupt("return");case 18:it.start.push(this.sourceToken);case 19:return _context11.abrupt("return");case 20:if(!(it.value||this.indent<=seq.indent)){_context11.next=22;break}return _context11.abrupt("break",28);case 22:it.start.push(this.sourceToken);return _context11.abrupt("return");case 24:if(!(this.indent!==seq.indent)){_context11.next=26;break}return _context11.abrupt("break",28);case 26:if(it.value||includesToken(it.start,"seq-item-ind"))seq.items.push({start:[this.sourceToken]});else it.start.push(this.sourceToken);return _context11.abrupt("return");case 28:if(!(this.indent>seq.indent)){_context11.next=33;break}bv=this.startBlockValue(seq);if(!bv){_context11.next=33;break}this.stack.push(bv);return _context11.abrupt("return");case 33:return _context11.delegateYield(this.pop(),"t1",34);case 34:return _context11.delegateYield(this.step(),"t2",35);case 35:case"end":return _context11.stop()}}),blockSequence,this)}))},{key:"flowCollection",value:_regeneratorRuntime().mark((function flowCollection(fc){var it,top,fs,bv,parent,prev,start,sep,map;return _regeneratorRuntime().wrap((function flowCollection$(_context12){while(1)switch(_context12.prev=_context12.next){case 0:it=fc.items[fc.items.length-1];if(!(this.type==="flow-error-end")){_context12.next=7;break}case 2:return _context12.delegateYield(this.pop(),"t0",3);case 3:top=this.peek(1);case 4:if(top&&top.type==="flow-collection"){_context12.next=2;break}case 5:_context12.next=49;break;case 7:if(!(fc.end.length===0)){_context12.next=31;break}_context12.t1=this.type;_context12.next=_context12.t1==="comma"?11:_context12.t1==="explicit-key-ind"?11:_context12.t1==="map-value-ind"?13:_context12.t1==="space"?15:_context12.t1==="comment"?15:_context12.t1==="newline"?15:_context12.t1==="anchor"?15:_context12.t1==="tag"?15:_context12.t1==="alias"?17:_context12.t1==="scalar"?17:_context12.t1==="single-quoted-scalar"?17:_context12.t1==="double-quoted-scalar"?17:_context12.t1==="flow-map-end"?20:_context12.t1==="flow-seq-end"?20:22;break;case 11:if(!it||it.sep)fc.items.push({start:[this.sourceToken]});else it.start.push(this.sourceToken);return _context12.abrupt("return");case 13:if(!it||it.value)fc.items.push({start:[],key:null,sep:[this.sourceToken]});else if(it.sep)it.sep.push(this.sourceToken);else Object.assign(it,{key:null,sep:[this.sourceToken]});return _context12.abrupt("return");case 15:if(!it||it.value)fc.items.push({start:[this.sourceToken]});else if(it.sep)it.sep.push(this.sourceToken);else it.start.push(this.sourceToken);return _context12.abrupt("return");case 17:fs=this.flowScalar(this.type);if(!it||it.value)fc.items.push({start:[],key:fs,sep:[]});else if(it.sep)this.stack.push(fs);else Object.assign(it,{key:fs,sep:[]});return _context12.abrupt("return");case 20:fc.end.push(this.sourceToken);return _context12.abrupt("return");case 22:bv=this.startBlockValue(fc);if(!bv){_context12.next=27;break}this.stack.push(bv);_context12.next=29;break;case 27:return _context12.delegateYield(this.pop(),"t2",28);case 28:return _context12.delegateYield(this.step(),"t3",29);case 29:_context12.next=49;break;case 31:parent=this.peek(2);if(!(parent.type==="block-map"&&(this.type==="map-value-ind"&&parent.indent===fc.indent||this.type==="newline"&&!parent.items[parent.items.length-1].sep))){_context12.next=37;break}return _context12.delegateYield(this.pop(),"t4",34);case 34:return _context12.delegateYield(this.step(),"t5",35);case 35:_context12.next=49;break;case 37:if(!(this.type==="map-value-ind"&&parent.type!=="flow-collection")){_context12.next=48;break}prev=getPrevProps(parent);start=getFirstKeyStartProps(prev);fixFlowSeqItems(fc);sep=fc.end.splice(1,fc.end.length);sep.push(this.sourceToken);map={type:"block-map",offset:fc.offset,indent:fc.indent,items:[{start:start,key:fc,sep:sep}]};this.onKeyLine=true;this.stack[this.stack.length-1]=map;_context12.next=49;break;case 48:return _context12.delegateYield(this.lineEnd(fc),"t6",49);case 49:case"end":return _context12.stop()}}),flowCollection,this)}))},{key:"flowScalar",value:function flowScalar(type){if(this.onNewLine){var nl=this.source.indexOf("\n")+1;while(nl!==0){this.onNewLine(this.offset+nl);nl=this.source.indexOf("\n",nl)+1}}return{type:type,offset:this.offset,indent:this.indent,source:this.source}}},{key:"startBlockValue",value:function startBlockValue(parent){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=true;var prev=getPrevProps(parent);var start=getFirstKeyStartProps(prev);start.push(this.sourceToken);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:start,explicitKey:true}]}}case"map-value-ind":{this.onKeyLine=true;var _prev=getPrevProps(parent);var _start3=getFirstKeyStartProps(_prev);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:_start3,key:null,sep:[this.sourceToken]}]}}}return null}},{key:"atIndentedComment",value:function atIndentedComment(start,indent){if(this.type!=="comment")return false;if(this.indent<=indent)return false;return start.every((function(st){return st.type==="newline"||st.type==="space"}))}},{key:"documentEnd",value:_regeneratorRuntime().mark((function documentEnd(docEnd){return _regeneratorRuntime().wrap((function documentEnd$(_context13){while(1)switch(_context13.prev=_context13.next){case 0:if(!(this.type!=="doc-mode")){_context13.next=4;break}if(docEnd.end)docEnd.end.push(this.sourceToken);else docEnd.end=[this.sourceToken];if(!(this.type==="newline")){_context13.next=4;break}return _context13.delegateYield(this.pop(),"t0",4);case 4:case"end":return _context13.stop()}}),documentEnd,this)}))},{key:"lineEnd",value:_regeneratorRuntime().mark((function lineEnd(token){return _regeneratorRuntime().wrap((function lineEnd$(_context14){while(1)switch(_context14.prev=_context14.next){case 0:_context14.t0=this.type;_context14.next=_context14.t0==="comma"?3:_context14.t0==="doc-start"?3:_context14.t0==="doc-end"?3:_context14.t0==="flow-seq-end"?3:_context14.t0==="flow-map-end"?3:_context14.t0==="map-value-ind"?3:_context14.t0==="newline"?6:_context14.t0==="space"?7:_context14.t0==="comment"?7:7;break;case 3:return _context14.delegateYield(this.pop(),"t1",4);case 4:return _context14.delegateYield(this.step(),"t2",5);case 5:return _context14.abrupt("break",10);case 6:this.onKeyLine=false;case 7:if(token.end)token.end.push(this.sourceToken);else token.end=[this.sourceToken];if(!(this.type==="newline")){_context14.next=10;break}return _context14.delegateYield(this.pop(),"t3",10);case 10:case"end":return _context14.stop()}}),lineEnd,this)}))}])}()},{"./cst.js":261,"./lexer.js":262}],265:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.parse=parse;exports.parseAllDocuments=parseAllDocuments;exports.parseDocument=parseDocument;exports.stringify=stringify;var _composer=require("./compose/composer.js");var _Document=require("./doc/Document.js");var _errors=require("./errors.js");var _log=require("./log.js");var _identity=require("./nodes/identity.js");var _lineCounter=require("./parse/line-counter.js");var _parser=require("./parse/parser.js");function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function parseOptions(options){var prettyErrors=options.prettyErrors!==false;var lineCounter=options.lineCounter||prettyErrors&&new _lineCounter.LineCounter||null;return{lineCounter:lineCounter,prettyErrors:prettyErrors}}function parseAllDocuments(source){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var _parseOptions=parseOptions(options),lineCounter=_parseOptions.lineCounter,prettyErrors=_parseOptions.prettyErrors;var parser=new _parser.Parser(lineCounter===null||lineCounter===void 0?void 0:lineCounter.addNewLine);var composer=new _composer.Composer(options);var docs=Array.from(composer.compose(parser.parse(source)));if(prettyErrors&&lineCounter){var _iterator=_createForOfIteratorHelper(docs),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var doc=_step.value;doc.errors.forEach((0,_errors.prettifyError)(source,lineCounter));doc.warnings.forEach((0,_errors.prettifyError)(source,lineCounter))}}catch(err){_iterator.e(err)}finally{_iterator.f()}}if(docs.length>0)return docs;return Object.assign([],{empty:true},composer.streamInfo())}function parseDocument(source){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var _parseOptions2=parseOptions(options),lineCounter=_parseOptions2.lineCounter,prettyErrors=_parseOptions2.prettyErrors;var parser=new _parser.Parser(lineCounter===null||lineCounter===void 0?void 0:lineCounter.addNewLine);var composer=new _composer.Composer(options);var doc=null;var _iterator2=_createForOfIteratorHelper(composer.compose(parser.parse(source),true,source.length)),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var _doc=_step2.value;if(!doc)doc=_doc;else if(doc.options.logLevel!=="silent"){doc.errors.push(new _errors.YAMLParseError(_doc.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}if(prettyErrors&&lineCounter){doc.errors.forEach((0,_errors.prettifyError)(source,lineCounter));doc.warnings.forEach((0,_errors.prettifyError)(source,lineCounter))}return doc}function parse(src,reviver,options){var _reviver=undefined;if(typeof reviver==="function"){_reviver=reviver}else if(options===undefined&&reviver&&_typeof(reviver)==="object"){options=reviver}var doc=parseDocument(src,options);if(!doc)return null;doc.warnings.forEach((function(warning){return(0,_log.warn)(doc.options.logLevel,warning)}));if(doc.errors.length>0){if(doc.options.logLevel!=="silent")throw doc.errors[0];else doc.errors=[]}return doc.toJS(Object.assign({reviver:_reviver},options))}function stringify(value,replacer,options){var _replacer=null;if(typeof replacer==="function"||Array.isArray(replacer)){_replacer=replacer}else if(options===undefined&&replacer){options=replacer}if(typeof options==="string")options=options.length;if(typeof options==="number"){var indent=Math.round(options);options=indent<1?undefined:indent>8?{indent:8}:{indent:indent}}if(value===undefined){var _ref2;var _ref=(_ref2=options!==null&&options!==void 0?options:replacer)!==null&&_ref2!==void 0?_ref2:{},keepUndefined=_ref.keepUndefined;if(!keepUndefined)return undefined}if((0,_identity.isDocument)(value)&&!_replacer)return value.toString(options);return new _Document.Document(value,_replacer,options).toString(options)}},{"./compose/composer.js":228,"./doc/Document.js":240,"./errors.js":245,"./log.js":247,"./nodes/identity.js":256,"./parse/line-counter.js":263,"./parse/parser.js":264}],266:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.Schema=void 0;var _identity=require("../nodes/identity.js");var _map=require("./common/map.js");var _seq=require("./common/seq.js");var _string=require("./common/string.js");var _tags=require("./tags.js");function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var sortMapEntriesByKey=function sortMapEntriesByKey(a,b){return a.key<b.key?-1:a.key>b.key?1:0};var Schema=exports.Schema=function(){function Schema(_ref){var compat=_ref.compat,customTags=_ref.customTags,merge=_ref.merge,resolveKnownTags=_ref.resolveKnownTags,schema=_ref.schema,sortMapEntries=_ref.sortMapEntries,toStringDefaults=_ref.toStringDefaults;_classCallCheck(this,Schema);this.compat=Array.isArray(compat)?(0,_tags.getTags)(compat,"compat"):compat?(0,_tags.getTags)(null,compat):null;this.name=typeof schema==="string"&&schema||"core";this.knownTags=resolveKnownTags?_tags.coreKnownTags:{};this.tags=(0,_tags.getTags)(customTags,this.name,merge);this.toStringOptions=toStringDefaults!==null&&toStringDefaults!==void 0?toStringDefaults:null;Object.defineProperty(this,_identity.MAP,{value:_map.map});Object.defineProperty(this,_identity.SCALAR,{value:_string.string});Object.defineProperty(this,_identity.SEQ,{value:_seq.seq});this.sortMapEntries=typeof sortMapEntries==="function"?sortMapEntries:sortMapEntries===true?sortMapEntriesByKey:null}return _createClass(Schema,[{key:"clone",value:function clone(){var copy=Object.create(Schema.prototype,Object.getOwnPropertyDescriptors(this));copy.tags=this.tags.slice();return copy}}])}()},{"../nodes/identity.js":256,"./common/map.js":267,"./common/seq.js":269,"./common/string.js":270,"./tags.js":276}],267:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.map=void 0;var _identity=require("../../nodes/identity.js");var _YAMLMap=require("../../nodes/YAMLMap.js");var map=exports.map={collection:"map",default:true,nodeClass:_YAMLMap.YAMLMap,tag:"tag:yaml.org,2002:map",resolve:function resolve(map,onError){if(!(0,_identity.isMap)(map))onError("Expected a mapping for this tag");return map},createNode:function createNode(schema,obj,ctx){return _YAMLMap.YAMLMap.from(schema,obj,ctx)}}},{"../../nodes/YAMLMap.js":253,"../../nodes/identity.js":256}],268:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.nullTag=void 0;var _Scalar=require("../../nodes/Scalar.js");var nullTag=exports.nullTag={identify:function identify(value){return value==null},createNode:function createNode(){return new _Scalar.Scalar(null)},default:true,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:function resolve(){return new _Scalar.Scalar(null)},stringify:function stringify(_ref,ctx){var source=_ref.source;return typeof source==="string"&&nullTag.test.test(source)?source:ctx.options.nullStr}}},{"../../nodes/Scalar.js":252}],269:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.seq=void 0;var _identity=require("../../nodes/identity.js");var _YAMLSeq=require("../../nodes/YAMLSeq.js");var seq=exports.seq={collection:"seq",default:true,nodeClass:_YAMLSeq.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve:function resolve(seq,onError){if(!(0,_identity.isSeq)(seq))onError("Expected a sequence for this tag");return seq},createNode:function createNode(schema,obj,ctx){return _YAMLSeq.YAMLSeq.from(schema,obj,ctx)}}},{"../../nodes/YAMLSeq.js":254,"../../nodes/identity.js":256}],270:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.string=void 0;var _stringifyString=require("../../stringify/stringifyString.js");var string=exports.string={identify:function identify(value){return typeof value==="string"},default:true,tag:"tag:yaml.org,2002:str",resolve:function resolve(str){return str},stringify:function stringify(item,ctx,onComment,onChompKeep){ctx=Object.assign({actualString:true},ctx);return(0,_stringifyString.stringifyString)(item,ctx,onComment,onChompKeep)}}},{"../../stringify/stringifyString.js":294}],271:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.boolTag=void 0;var _Scalar=require("../../nodes/Scalar.js");var boolTag=exports.boolTag={identify:function identify(value){return typeof value==="boolean"},default:true,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:function resolve(str){return new _Scalar.Scalar(str[0]==="t"||str[0]==="T")},stringify:function stringify(_ref,ctx){var source=_ref.source,value=_ref.value;if(source&&boolTag.test.test(source)){var sv=source[0]==="t"||source[0]==="T";if(value===sv)return source}return value?ctx.options.trueStr:ctx.options.falseStr}}},{"../../nodes/Scalar.js":252}],272:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.floatNaN=exports.floatExp=exports["float"]=void 0;var _Scalar=require("../../nodes/Scalar.js");var _stringifyNumber=require("../../stringify/stringifyNumber.js");var floatNaN=exports.floatNaN={identify:function identify(value){return typeof value==="number"},default:true,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:function resolve(str){return str.slice(-3).toLowerCase()==="nan"?NaN:str[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY},stringify:_stringifyNumber.stringifyNumber};var floatExp=exports.floatExp={identify:function identify(value){return typeof value==="number"},default:true,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:function resolve(str){return parseFloat(str)},stringify:function stringify(node){var num=Number(node.value);return isFinite(num)?num.toExponential():(0,_stringifyNumber.stringifyNumber)(node)}};var _float=exports["float"]={identify:function identify(value){return typeof value==="number"},default:true,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve:function resolve(str){var node=new _Scalar.Scalar(parseFloat(str));var dot=str.indexOf(".");if(dot!==-1&&str[str.length-1]==="0")node.minFractionDigits=str.length-dot-1;return node},stringify:_stringifyNumber.stringifyNumber}},{"../../nodes/Scalar.js":252,"../../stringify/stringifyNumber.js":292}],273:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.intOct=exports.intHex=exports["int"]=void 0;var _stringifyNumber=require("../../stringify/stringifyNumber.js");var intIdentify=function intIdentify(value){return typeof value==="bigint"||Number.isInteger(value)};var intResolve=function intResolve(str,offset,radix,_ref){var intAsBigInt=_ref.intAsBigInt;return intAsBigInt?BigInt(str):parseInt(str.substring(offset),radix)};function intStringify(node,radix,prefix){var value=node.value;if(intIdentify(value)&&value>=0)return prefix+value.toString(radix);return(0,_stringifyNumber.stringifyNumber)(node)}var intOct=exports.intOct={identify:function identify(value){return intIdentify(value)&&value>=0},default:true,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:function resolve(str,_onError,opt){return intResolve(str,2,8,opt)},stringify:function stringify(node){return intStringify(node,8,"0o")}};var _int=exports["int"]={identify:intIdentify,default:true,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:function resolve(str,_onError,opt){return intResolve(str,0,10,opt)},stringify:_stringifyNumber.stringifyNumber};var intHex=exports.intHex={identify:function identify(value){return intIdentify(value)&&value>=0},default:true,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:function resolve(str,_onError,opt){return intResolve(str,2,16,opt)},stringify:function stringify(node){return intStringify(node,16,"0x")}}},{"../../stringify/stringifyNumber.js":292}],274:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.schema=void 0;var _map=require("../common/map.js");var _null=require("../common/null.js");var _seq=require("../common/seq.js");var _string=require("../common/string.js");var _bool=require("./bool.js");var _float2=require("./float.js");var _int2=require("./int.js");var schema=exports.schema=[_map.map,_seq.seq,_string.string,_null.nullTag,_bool.boolTag,_int2.intOct,_int2["int"],_int2.intHex,_float2.floatNaN,_float2.floatExp,_float2["float"]]},{"../common/map.js":267,"../common/null.js":268,"../common/seq.js":269,"../common/string.js":270,"./bool.js":271,"./float.js":272,"./int.js":273}],275:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.schema=void 0;var _Scalar=require("../../nodes/Scalar.js");var _map=require("../common/map.js");var _seq=require("../common/seq.js");function intIdentify(value){return typeof value==="bigint"||Number.isInteger(value)}var stringifyJSON=function stringifyJSON(_ref){var value=_ref.value;return JSON.stringify(value)};var jsonScalars=[{identify:function identify(value){return typeof value==="string"},default:true,tag:"tag:yaml.org,2002:str",resolve:function resolve(str){return str},stringify:stringifyJSON},{identify:function identify(value){return value==null},createNode:function createNode(){return new _Scalar.Scalar(null)},default:true,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:function resolve(){return null},stringify:stringifyJSON},{identify:function identify(value){return typeof value==="boolean"},default:true,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:function resolve(str){return str==="true"},stringify:stringifyJSON},{identify:intIdentify,default:true,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:function resolve(str,_onError,_ref2){var intAsBigInt=_ref2.intAsBigInt;return intAsBigInt?BigInt(str):parseInt(str,10)},stringify:function stringify(_ref3){var value=_ref3.value;return intIdentify(value)?value.toString():JSON.stringify(value)}},{identify:function identify(value){return typeof value==="number"},default:true,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:function resolve(str){return parseFloat(str)},stringify:stringifyJSON}];var jsonError={default:true,tag:"",test:/^/,resolve:function resolve(str,onError){onError("Unresolved plain scalar ".concat(JSON.stringify(str)));return str}};var schema=exports.schema=[_map.map,_seq.seq].concat(jsonScalars,jsonError)},{"../../nodes/Scalar.js":252,"../common/map.js":267,"../common/seq.js":269}],276:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.coreKnownTags=void 0;exports.getTags=getTags;var _map=require("./common/map.js");var _null=require("./common/null.js");var _seq=require("./common/seq.js");var _string=require("./common/string.js");var _bool=require("./core/bool.js");var _float2=require("./core/float.js");var _int2=require("./core/int.js");var _schema=require("./core/schema.js");var _schema2=require("./json/schema.js");var _binary=require("./yaml-1.1/binary.js");var _merge=require("./yaml-1.1/merge.js");var _omap=require("./yaml-1.1/omap.js");var _pairs=require("./yaml-1.1/pairs.js");var _schema3=require("./yaml-1.1/schema.js");var _set=require("./yaml-1.1/set.js");var _timestamp=require("./yaml-1.1/timestamp.js");function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}var schemas=new Map([["core",_schema.schema],["failsafe",[_map.map,_seq.seq,_string.string]],["json",_schema2.schema],["yaml11",_schema3.schema],["yaml-1.1",_schema3.schema]]);var tagsByName={binary:_binary.binary,bool:_bool.boolTag,float:_float2["float"],floatExp:_float2.floatExp,floatNaN:_float2.floatNaN,floatTime:_timestamp.floatTime,int:_int2["int"],intHex:_int2.intHex,intOct:_int2.intOct,intTime:_timestamp.intTime,map:_map.map,merge:_merge.merge,null:_null.nullTag,omap:_omap.omap,pairs:_pairs.pairs,seq:_seq.seq,set:_set.set,timestamp:_timestamp.timestamp};var coreKnownTags=exports.coreKnownTags={"tag:yaml.org,2002:binary":_binary.binary,"tag:yaml.org,2002:merge":_merge.merge,"tag:yaml.org,2002:omap":_omap.omap,"tag:yaml.org,2002:pairs":_pairs.pairs,"tag:yaml.org,2002:set":_set.set,"tag:yaml.org,2002:timestamp":_timestamp.timestamp};function getTags(customTags,schemaName,addMergeTag){var schemaTags=schemas.get(schemaName);if(schemaTags&&!customTags){return addMergeTag&&!schemaTags.includes(_merge.merge)?schemaTags.concat(_merge.merge):schemaTags.slice()}var tags=schemaTags;if(!tags){if(Array.isArray(customTags))tags=[];else{var keys=Array.from(schemas.keys()).filter((function(key){return key!=="yaml11"})).map((function(key){return JSON.stringify(key)})).join(", ");throw new Error('Unknown schema "'.concat(schemaName,'"; use one of ').concat(keys," or define customTags array"))}}if(Array.isArray(customTags)){var _iterator=_createForOfIteratorHelper(customTags),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var tag=_step.value;tags=tags.concat(tag)}}catch(err){_iterator.e(err)}finally{_iterator.f()}}else if(typeof customTags==="function"){tags=customTags(tags.slice())}if(addMergeTag)tags=tags.concat(_merge.merge);return tags.reduce((function(tags,tag){var tagObj=typeof tag==="string"?tagsByName[tag]:tag;if(!tagObj){var tagName=JSON.stringify(tag);var _keys=Object.keys(tagsByName).map((function(key){return JSON.stringify(key)})).join(", ");throw new Error("Unknown custom tag ".concat(tagName,"; use one of ").concat(_keys))}if(!tags.includes(tagObj))tags.push(tagObj);return tags}),[])}},{"./common/map.js":267,"./common/null.js":268,"./common/seq.js":269,"./common/string.js":270,"./core/bool.js":271,"./core/float.js":272,"./core/int.js":273,"./core/schema.js":274,"./json/schema.js":275,"./yaml-1.1/binary.js":277,"./yaml-1.1/merge.js":281,"./yaml-1.1/omap.js":282,"./yaml-1.1/pairs.js":283,"./yaml-1.1/schema.js":284,"./yaml-1.1/set.js":285,"./yaml-1.1/timestamp.js":286}],277:[function(require,module,exports){(function(Buffer){(function(){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.binary=void 0;var _Scalar=require("../../nodes/Scalar.js");var _stringifyString=require("../../stringify/stringifyString.js");var binary=exports.binary={identify:function identify(value){return value instanceof Uint8Array},default:false,tag:"tag:yaml.org,2002:binary",resolve:function resolve(src,onError){if(typeof Buffer==="function"){return Buffer.from(src,"base64")}else if(typeof atob==="function"){var str=atob(src.replace(/[\n\r]/g,""));var buffer=new Uint8Array(str.length);for(var i=0;i<str.length;++i)buffer[i]=str.charCodeAt(i);return buffer}else{onError("This environment does not support reading binary tags; either Buffer or atob is required");return src}},stringify:function stringify(_ref,ctx,onComment,onChompKeep){var comment=_ref.comment,type=_ref.type,value=_ref.value;var buf=value;var str;if(typeof Buffer==="function"){str=buf instanceof Buffer?buf.toString("base64"):Buffer.from(buf.buffer).toString("base64")}else if(typeof btoa==="function"){var s="";for(var i=0;i<buf.length;++i)s+=String.fromCharCode(buf[i]);str=btoa(s)}else{throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required")}if(!type)type=_Scalar.Scalar.BLOCK_LITERAL;if(type!==_Scalar.Scalar.QUOTE_DOUBLE){var lineWidth=Math.max(ctx.options.lineWidth-ctx.indent.length,ctx.options.minContentWidth);var n=Math.ceil(str.length/lineWidth);var lines=new Array(n);for(var _i=0,o=0;_i<n;++_i,o+=lineWidth){lines[_i]=str.substr(o,lineWidth)}str=lines.join(type===_Scalar.Scalar.BLOCK_LITERAL?"\n":" ")}return(0,_stringifyString.stringifyString)({comment:comment,type:type,value:str},ctx,onComment,onChompKeep)}}}).call(this)}).call(this,require("buffer").Buffer)},{"../../nodes/Scalar.js":252,"../../stringify/stringifyString.js":294,buffer:74}],278:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.trueTag=exports.falseTag=void 0;var _Scalar=require("../../nodes/Scalar.js");function boolStringify(_ref,ctx){var value=_ref.value,source=_ref.source;var boolObj=value?trueTag:falseTag;if(source&&boolObj.test.test(source))return source;return value?ctx.options.trueStr:ctx.options.falseStr}var trueTag=exports.trueTag={identify:function identify(value){return value===true},default:true,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:function resolve(){return new _Scalar.Scalar(true)},stringify:boolStringify};var falseTag=exports.falseTag={identify:function identify(value){return value===false},default:true,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:function resolve(){return new _Scalar.Scalar(false)},stringify:boolStringify}},{"../../nodes/Scalar.js":252}],279:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.floatNaN=exports.floatExp=exports["float"]=void 0;var _Scalar=require("../../nodes/Scalar.js");var _stringifyNumber=require("../../stringify/stringifyNumber.js");var floatNaN=exports.floatNaN={identify:function identify(value){return typeof value==="number"},default:true,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:function resolve(str){return str.slice(-3).toLowerCase()==="nan"?NaN:str[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY},stringify:_stringifyNumber.stringifyNumber};var floatExp=exports.floatExp={identify:function identify(value){return typeof value==="number"},default:true,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:function resolve(str){return parseFloat(str.replace(/_/g,""))},stringify:function stringify(node){var num=Number(node.value);return isFinite(num)?num.toExponential():(0,_stringifyNumber.stringifyNumber)(node)}};var _float=exports["float"]={identify:function identify(value){return typeof value==="number"},default:true,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve:function resolve(str){var node=new _Scalar.Scalar(parseFloat(str.replace(/_/g,"")));var dot=str.indexOf(".");if(dot!==-1){var f=str.substring(dot+1).replace(/_/g,"");if(f[f.length-1]==="0")node.minFractionDigits=f.length}return node},stringify:_stringifyNumber.stringifyNumber}},{"../../nodes/Scalar.js":252,"../../stringify/stringifyNumber.js":292}],280:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.intOct=exports.intHex=exports.intBin=exports["int"]=void 0;var _stringifyNumber=require("../../stringify/stringifyNumber.js");var intIdentify=function intIdentify(value){return typeof value==="bigint"||Number.isInteger(value)};function intResolve(str,offset,radix,_ref){var intAsBigInt=_ref.intAsBigInt;var sign=str[0];if(sign==="-"||sign==="+")offset+=1;str=str.substring(offset).replace(/_/g,"");if(intAsBigInt){switch(radix){case 2:str="0b".concat(str);break;case 8:str="0o".concat(str);break;case 16:str="0x".concat(str);break}var _n=BigInt(str);return sign==="-"?BigInt(-1)*_n:_n}var n=parseInt(str,radix);return sign==="-"?-1*n:n}function intStringify(node,radix,prefix){var value=node.value;if(intIdentify(value)){var str=value.toString(radix);return value<0?"-"+prefix+str.substr(1):prefix+str}return(0,_stringifyNumber.stringifyNumber)(node)}var intBin=exports.intBin={identify:intIdentify,default:true,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:function resolve(str,_onError,opt){return intResolve(str,2,2,opt)},stringify:function stringify(node){return intStringify(node,2,"0b")}};var intOct=exports.intOct={identify:intIdentify,default:true,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:function resolve(str,_onError,opt){return intResolve(str,1,8,opt)},stringify:function stringify(node){return intStringify(node,8,"0")}};var _int=exports["int"]={identify:intIdentify,default:true,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:function resolve(str,_onError,opt){return intResolve(str,0,10,opt)},stringify:_stringifyNumber.stringifyNumber};var intHex=exports.intHex={identify:intIdentify,default:true,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:function resolve(str,_onError,opt){return intResolve(str,2,16,opt)},stringify:function stringify(node){return intStringify(node,16,"0x")}}},{"../../stringify/stringifyNumber.js":292}],281:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.addMergeToJSMap=addMergeToJSMap;exports.merge=exports.isMergeKey=void 0;var _identity=require("../../nodes/identity.js");var _Scalar=require("../../nodes/Scalar.js");function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}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 _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}var MERGE_KEY="<<";var merge=exports.merge={identify:function identify(value){return value===MERGE_KEY||_typeof(value)==="symbol"&&value.description===MERGE_KEY},default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:function resolve(){return Object.assign(new _Scalar.Scalar(Symbol(MERGE_KEY)),{addToJSMap:addMergeToJSMap})},stringify:function stringify(){return MERGE_KEY}};var isMergeKey=exports.isMergeKey=function isMergeKey(ctx,key){return(merge.identify(key)||(0,_identity.isScalar)(key)&&(!key.type||key.type===_Scalar.Scalar.PLAIN)&&merge.identify(key.value))&&(ctx===null||ctx===void 0?void 0:ctx.doc.schema.tags.some((function(tag){return tag.tag===merge.tag&&tag["default"]})))};function addMergeToJSMap(ctx,map,value){value=ctx&&(0,_identity.isAlias)(value)?value.resolve(ctx.doc):value;if((0,_identity.isSeq)(value)){var _iterator=_createForOfIteratorHelper(value.items),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var it=_step.value;mergeValue(ctx,map,it)}}catch(err){_iterator.e(err)}finally{_iterator.f()}}else if(Array.isArray(value)){var _iterator2=_createForOfIteratorHelper(value),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var _it=_step2.value;mergeValue(ctx,map,_it)}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}}else mergeValue(ctx,map,value)}function mergeValue(ctx,map,value){var source=ctx&&(0,_identity.isAlias)(value)?value.resolve(ctx.doc):value;if(!(0,_identity.isMap)(source))throw new Error("Merge sources must be maps or map aliases");var srcMap=source.toJSON(null,ctx,Map);var _iterator3=_createForOfIteratorHelper(srcMap),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var _step3$value=_slicedToArray(_step3.value,2),key=_step3$value[0],_value=_step3$value[1];if(map instanceof Map){if(!map.has(key))map.set(key,_value)}else if(map instanceof Set){map.add(key)}else if(!Object.prototype.hasOwnProperty.call(map,key)){Object.defineProperty(map,key,{value:_value,writable:true,enumerable:true,configurable:true})}}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}return map}},{"../../nodes/Scalar.js":252,"../../nodes/identity.js":256}],282:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}Object.defineProperty(exports,"__esModule",{value:true});exports.omap=exports.YAMLOMap=void 0;var _identity=require("../../nodes/identity.js");var _toJS=require("../../nodes/toJS.js");var _YAMLMap=require("../../nodes/YAMLMap.js");var _YAMLSeq2=require("../../nodes/YAMLSeq.js");var _pairs=require("./pairs.js");function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t)}:p}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value}},_get.apply(null,arguments)}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}var YAMLOMap=exports.YAMLOMap=function(_YAMLSeq){function YAMLOMap(){var _this;_classCallCheck(this,YAMLOMap);_this=_callSuper(this,YAMLOMap);_this.add=_YAMLMap.YAMLMap.prototype.add.bind(_this);_this["delete"]=_YAMLMap.YAMLMap.prototype["delete"].bind(_this);_this.get=_YAMLMap.YAMLMap.prototype.get.bind(_this);_this.has=_YAMLMap.YAMLMap.prototype.has.bind(_this);_this.set=_YAMLMap.YAMLMap.prototype.set.bind(_this);_this.tag=YAMLOMap.tag;return _this}_inherits(YAMLOMap,_YAMLSeq);return _createClass(YAMLOMap,[{key:"toJSON",value:function toJSON(_,ctx){if(!ctx)return _superPropGet(YAMLOMap,"toJSON",this,3)([_]);var map=new Map;if(ctx!==null&&ctx!==void 0&&ctx.onCreate)ctx.onCreate(map);var _iterator=_createForOfIteratorHelper(this.items),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var pair=_step.value;var key=void 0,value=void 0;if((0,_identity.isPair)(pair)){key=(0,_toJS.toJS)(pair.key,"",ctx);value=(0,_toJS.toJS)(pair.value,key,ctx)}else{key=(0,_toJS.toJS)(pair,"",ctx)}if(map.has(key))throw new Error("Ordered maps must not include duplicate keys");map.set(key,value)}}catch(err){_iterator.e(err)}finally{_iterator.f()}return map}}],[{key:"from",value:function from(schema,iterable,ctx){var pairs=(0,_pairs.createPairs)(schema,iterable,ctx);var omap=new this;omap.items=pairs.items;return omap}}])}(_YAMLSeq2.YAMLSeq);YAMLOMap.tag="tag:yaml.org,2002:omap";var omap=exports.omap={collection:"seq",identify:function identify(value){return value instanceof Map},nodeClass:YAMLOMap,default:false,tag:"tag:yaml.org,2002:omap",resolve:function resolve(seq,onError){var pairs=(0,_pairs.resolvePairs)(seq,onError);var seenKeys=[];var _iterator2=_createForOfIteratorHelper(pairs.items),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var key=_step2.value.key;if((0,_identity.isScalar)(key)){if(seenKeys.includes(key.value)){onError("Ordered maps must not include duplicate keys: ".concat(key.value))}else{seenKeys.push(key.value)}}}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}return Object.assign(new YAMLOMap,pairs)},createNode:function createNode(schema,iterable,ctx){return YAMLOMap.from(schema,iterable,ctx)}}},{"../../nodes/YAMLMap.js":253,"../../nodes/YAMLSeq.js":254,"../../nodes/identity.js":256,"../../nodes/toJS.js":257,"./pairs.js":283}],283:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.createPairs=createPairs;exports.pairs=void 0;exports.resolvePairs=resolvePairs;var _identity=require("../../nodes/identity.js");var _Pair=require("../../nodes/Pair.js");var _Scalar=require("../../nodes/Scalar.js");var _YAMLSeq=require("../../nodes/YAMLSeq.js");function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function resolvePairs(seq,onError){if((0,_identity.isSeq)(seq)){for(var i=0;i<seq.items.length;++i){var item=seq.items[i];if((0,_identity.isPair)(item))continue;else if((0,_identity.isMap)(item)){if(item.items.length>1)onError("Each pair must have its own sequence indicator");var pair=item.items[0]||new _Pair.Pair(new _Scalar.Scalar(null));if(item.commentBefore)pair.key.commentBefore=pair.key.commentBefore?"".concat(item.commentBefore,"\n").concat(pair.key.commentBefore):item.commentBefore;if(item.comment){var _pair$value;var cn=(_pair$value=pair.value)!==null&&_pair$value!==void 0?_pair$value:pair.key;cn.comment=cn.comment?"".concat(item.comment,"\n").concat(cn.comment):item.comment}item=pair}seq.items[i]=(0,_identity.isPair)(item)?item:new _Pair.Pair(item)}}else onError("Expected a sequence for this tag");return seq}function createPairs(schema,iterable,ctx){var replacer=ctx.replacer;var pairs=new _YAMLSeq.YAMLSeq(schema);pairs.tag="tag:yaml.org,2002:pairs";var i=0;if(iterable&&Symbol.iterator in Object(iterable)){var _iterator=_createForOfIteratorHelper(iterable),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var it=_step.value;if(typeof replacer==="function")it=replacer.call(iterable,String(i++),it);var key=void 0,value=void 0;if(Array.isArray(it)){if(it.length===2){key=it[0];value=it[1]}else throw new TypeError("Expected [key, value] tuple: ".concat(it))}else if(it&&it instanceof Object){var keys=Object.keys(it);if(keys.length===1){key=keys[0];value=it[key]}else{throw new TypeError("Expected tuple with one key, not ".concat(keys.length," keys"))}}else{key=it}pairs.items.push((0,_Pair.createPair)(key,value,ctx))}}catch(err){_iterator.e(err)}finally{_iterator.f()}}return pairs}var pairs=exports.pairs={collection:"seq",default:false,tag:"tag:yaml.org,2002:pairs",resolve:resolvePairs,createNode:createPairs}},{"../../nodes/Pair.js":251,"../../nodes/Scalar.js":252,"../../nodes/YAMLSeq.js":254,"../../nodes/identity.js":256}],284:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.schema=void 0;var _map=require("../common/map.js");var _null=require("../common/null.js");var _seq=require("../common/seq.js");var _string=require("../common/string.js");var _binary=require("./binary.js");var _bool=require("./bool.js");var _float2=require("./float.js");var _int2=require("./int.js");var _merge=require("./merge.js");var _omap=require("./omap.js");var _pairs=require("./pairs.js");var _set=require("./set.js");var _timestamp=require("./timestamp.js");var schema=exports.schema=[_map.map,_seq.seq,_string.string,_null.nullTag,_bool.trueTag,_bool.falseTag,_int2.intBin,_int2.intOct,_int2["int"],_int2.intHex,_float2.floatNaN,_float2.floatExp,_float2["float"],_binary.binary,_merge.merge,_omap.omap,_pairs.pairs,_set.set,_timestamp.intTime,_timestamp.floatTime,_timestamp.timestamp]},{"../common/map.js":267,"../common/null.js":268,"../common/seq.js":269,"../common/string.js":270,"./binary.js":277,"./bool.js":278,"./float.js":279,"./int.js":280,"./merge.js":281,"./omap.js":282,"./pairs.js":283,"./set.js":285,"./timestamp.js":286}],285:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.set=exports.YAMLSet=void 0;var _identity=require("../../nodes/identity.js");var _Pair=require("../../nodes/Pair.js");var _YAMLMap2=require("../../nodes/YAMLMap.js");function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t)}:p}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value}},_get.apply(null,arguments)}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}var YAMLSet=exports.YAMLSet=function(_YAMLMap){function YAMLSet(schema){var _this;_classCallCheck(this,YAMLSet);_this=_callSuper(this,YAMLSet,[schema]);_this.tag=YAMLSet.tag;return _this}_inherits(YAMLSet,_YAMLMap);return _createClass(YAMLSet,[{key:"add",value:function add(key){var pair;if((0,_identity.isPair)(key))pair=key;else if(key&&_typeof(key)==="object"&&"key"in key&&"value"in key&&key.value===null)pair=new _Pair.Pair(key.key,null);else pair=new _Pair.Pair(key,null);var prev=(0,_YAMLMap2.findPair)(this.items,pair.key);if(!prev)this.items.push(pair)}},{key:"get",value:function get(key,keepPair){var pair=(0,_YAMLMap2.findPair)(this.items,key);return!keepPair&&(0,_identity.isPair)(pair)?(0,_identity.isScalar)(pair.key)?pair.key.value:pair.key:pair}},{key:"set",value:function set(key,value){if(typeof value!=="boolean")throw new Error("Expected boolean value for set(key, value) in a YAML set, not ".concat(_typeof(value)));var prev=(0,_YAMLMap2.findPair)(this.items,key);if(prev&&!value){this.items.splice(this.items.indexOf(prev),1)}else if(!prev&&value){this.items.push(new _Pair.Pair(key))}}},{key:"toJSON",value:function toJSON(_,ctx){return _superPropGet(YAMLSet,"toJSON",this,3)([_,ctx,Set])}},{key:"toString",value:function toString(ctx,onComment,onChompKeep){if(!ctx)return JSON.stringify(this);if(this.hasAllNullValues(true))return _superPropGet(YAMLSet,"toString",this,3)([Object.assign({},ctx,{allNullValues:true}),onComment,onChompKeep]);else throw new Error("Set items must all have null values")}}],[{key:"from",value:function from(schema,iterable,ctx){var replacer=ctx.replacer;var set=new this(schema);if(iterable&&Symbol.iterator in Object(iterable)){var _iterator=_createForOfIteratorHelper(iterable),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var value=_step.value;if(typeof replacer==="function")value=replacer.call(iterable,value,value);set.items.push((0,_Pair.createPair)(value,null,ctx))}}catch(err){_iterator.e(err)}finally{_iterator.f()}}return set}}])}(_YAMLMap2.YAMLMap);YAMLSet.tag="tag:yaml.org,2002:set";var set=exports.set={collection:"map",identify:function identify(value){return value instanceof Set},nodeClass:YAMLSet,default:false,tag:"tag:yaml.org,2002:set",createNode:function createNode(schema,iterable,ctx){return YAMLSet.from(schema,iterable,ctx)},resolve:function resolve(map,onError){if((0,_identity.isMap)(map)){if(map.hasAllNullValues(true))return Object.assign(new YAMLSet,map);else onError("Set items must all have null values")}else onError("Expected a mapping for this tag");return map}}},{"../../nodes/Pair.js":251,"../../nodes/YAMLMap.js":253,"../../nodes/identity.js":256}],286:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.timestamp=exports.intTime=exports.floatTime=void 0;var _stringifyNumber=require("../../stringify/stringifyNumber.js");function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}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 _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function parseSexagesimal(str,asBigInt){var sign=str[0];var parts=sign==="-"||sign==="+"?str.substring(1):str;var num=function num(n){return asBigInt?BigInt(n):Number(n)};var res=parts.replace(/_/g,"").split(":").reduce((function(res,p){return res*num(60)+num(p)}),num(0));return sign==="-"?num(-1)*res:res}function stringifySexagesimal(node){var value=node.value;var num=function num(n){return n};if(typeof value==="bigint")num=function num(n){return BigInt(n)};else if(isNaN(value)||!isFinite(value))return(0,_stringifyNumber.stringifyNumber)(node);var sign="";if(value<0){sign="-";value*=num(-1)}var _60=num(60);var parts=[value%_60];if(value<60){parts.unshift(0)}else{value=(value-parts[0])/_60;parts.unshift(value%_60);if(value>=60){value=(value-parts[0])/_60;parts.unshift(value)}}return sign+parts.map((function(n){return String(n).padStart(2,"0")})).join(":").replace(/000000\d*$/,"")}var intTime=exports.intTime={identify:function identify(value){return typeof value==="bigint"||Number.isInteger(value)},default:true,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:function resolve(str,_onError,_ref){var intAsBigInt=_ref.intAsBigInt;return parseSexagesimal(str,intAsBigInt)},stringify:stringifySexagesimal};var floatTime=exports.floatTime={identify:function identify(value){return typeof value==="number"},default:true,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:function resolve(str){return parseSexagesimal(str,false)},stringify:stringifySexagesimal};var timestamp=exports.timestamp={identify:function identify(value){return value instanceof Date},default:true,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})"+"(?:"+"(?:t|T|[ \\t]+)"+"([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)"+"(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?"+")?$"),resolve:function resolve(str){var match=str.match(timestamp.test);if(!match)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");var _match$map=match.map(Number),_match$map2=_slicedToArray(_match$map,7),year=_match$map2[1],month=_match$map2[2],day=_match$map2[3],hour=_match$map2[4],minute=_match$map2[5],second=_match$map2[6];var millisec=match[7]?Number((match[7]+"00").substr(1,3)):0;var date=Date.UTC(year,month-1,day,hour||0,minute||0,second||0,millisec);var tz=match[8];if(tz&&tz!=="Z"){var d=parseSexagesimal(tz,false);if(Math.abs(d)<30)d*=60;date-=6e4*d}return new Date(date)},stringify:function stringify(_ref2){var value=_ref2.value;return value.toISOString().replace(/(T00:00:00)?\.000Z$/,"")}}},{"../../stringify/stringifyNumber.js":292}],287:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.FOLD_QUOTED=exports.FOLD_FLOW=exports.FOLD_BLOCK=void 0;exports.foldFlowLines=foldFlowLines;var FOLD_FLOW=exports.FOLD_FLOW="flow";var FOLD_BLOCK=exports.FOLD_BLOCK="block";var FOLD_QUOTED=exports.FOLD_QUOTED="quoted";function foldFlowLines(text,indent){var mode=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"flow";var _ref=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{},indentAtStart=_ref.indentAtStart,_ref$lineWidth=_ref.lineWidth,lineWidth=_ref$lineWidth===void 0?80:_ref$lineWidth,_ref$minContentWidth=_ref.minContentWidth,minContentWidth=_ref$minContentWidth===void 0?20:_ref$minContentWidth,onFold=_ref.onFold,onOverflow=_ref.onOverflow;if(!lineWidth||lineWidth<0)return text;if(lineWidth<minContentWidth)minContentWidth=0;var endStep=Math.max(1+minContentWidth,1+lineWidth-indent.length);if(text.length<=endStep)return text;var folds=[];var escapedFolds={};var end=lineWidth-indent.length;if(typeof indentAtStart==="number"){if(indentAtStart>lineWidth-Math.max(2,minContentWidth))folds.push(0);else end=lineWidth-indentAtStart}var split=undefined;var prev=undefined;var overflow=false;var i=-1;var escStart=-1;var escEnd=-1;if(mode===FOLD_BLOCK){i=consumeMoreIndentedLines(text,i,indent.length);if(i!==-1)end=i+endStep}for(var ch;ch=text[i+=1];){if(mode===FOLD_QUOTED&&ch==="\\"){escStart=i;switch(text[i+1]){case"x":i+=3;break;case"u":i+=5;break;case"U":i+=9;break;default:i+=1}escEnd=i}if(ch==="\n"){if(mode===FOLD_BLOCK)i=consumeMoreIndentedLines(text,i,indent.length);end=i+indent.length+endStep;split=undefined}else{if(ch===" "&&prev&&prev!==" "&&prev!=="\n"&&prev!=="\t"){var next=text[i+1];if(next&&next!==" "&&next!=="\n"&&next!=="\t")split=i}if(i>=end){if(split){folds.push(split);end=split+endStep;split=undefined}else if(mode===FOLD_QUOTED){while(prev===" "||prev==="\t"){prev=ch;ch=text[i+=1];overflow=true}var j=i>escEnd+1?i-2:escStart-1;if(escapedFolds[j])return text;folds.push(j);escapedFolds[j]=true;end=j+endStep;split=undefined}else{overflow=true}}}prev=ch}if(overflow&&onOverflow)onOverflow();if(folds.length===0)return text;if(onFold)onFold();var res=text.slice(0,folds[0]);for(var _i=0;_i<folds.length;++_i){var fold=folds[_i];var _end=folds[_i+1]||text.length;if(fold===0)res="\n".concat(indent).concat(text.slice(0,_end));else{if(mode===FOLD_QUOTED&&escapedFolds[fold])res+="".concat(text[fold],"\\");res+="\n".concat(indent).concat(text.slice(fold+1,_end))}}return res}function consumeMoreIndentedLines(text,i,indent){var end=i;var start=i+1;var ch=text[start];while(ch===" "||ch==="\t"){if(i<start+indent){ch=text[++i]}else{do{ch=text[++i]}while(ch&&ch!=="\n");end=i;start=i+1;ch=text[start]}}return end}},{}],288:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.createStringifyContext=createStringifyContext;exports.stringify=stringify;var _anchors=require("../doc/anchors.js");var _identity=require("../nodes/identity.js");var _stringifyComment=require("./stringifyComment.js");var _stringifyString=require("./stringifyString.js");function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function createStringifyContext(doc,options){var opt=Object.assign({blockQuote:true,commentString:_stringifyComment.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:false,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:true,indentSeq:true,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:false,singleQuote:null,trueStr:"true",verifyAliasOrder:true},doc.schema.toStringOptions,options);var inFlow;switch(opt.collectionStyle){case"block":inFlow=false;break;case"flow":inFlow=true;break;default:inFlow=null}return{anchors:new Set,doc:doc,flowCollectionPadding:opt.flowCollectionPadding?" ":"",indent:"",indentStep:typeof opt.indent==="number"?" ".repeat(opt.indent):" ",inFlow:inFlow,options:opt}}function getTagObject(tags,item){if(item.tag){var _match$find;var match=tags.filter((function(t){return t.tag===item.tag}));if(match.length>0)return(_match$find=match.find((function(t){return t.format===item.format})))!==null&&_match$find!==void 0?_match$find:match[0]}var tagObj=undefined;var obj;if((0,_identity.isScalar)(item)){var _match$find2;obj=item.value;var _match=tags.filter((function(t){var _t$identify;return(_t$identify=t.identify)===null||_t$identify===void 0?void 0:_t$identify.call(t,obj)}));if(_match.length>1){var testMatch=_match.filter((function(t){return t.test}));if(testMatch.length>0)_match=testMatch}tagObj=(_match$find2=_match.find((function(t){return t.format===item.format})))!==null&&_match$find2!==void 0?_match$find2:_match.find((function(t){return!t.format}))}else{obj=item;tagObj=tags.find((function(t){return t.nodeClass&&obj instanceof t.nodeClass}))}if(!tagObj){var _obj$constructor$name,_obj;var name=(_obj$constructor$name=(_obj=obj)===null||_obj===void 0||(_obj=_obj.constructor)===null||_obj===void 0?void 0:_obj.name)!==null&&_obj$constructor$name!==void 0?_obj$constructor$name:_typeof(obj);throw new Error("Tag not resolved for ".concat(name," value"))}return tagObj}function stringifyProps(node,tagObj,_ref){var anchors=_ref.anchors,doc=_ref.doc;if(!doc.directives)return"";var props=[];var anchor=((0,_identity.isScalar)(node)||(0,_identity.isCollection)(node))&&node.anchor;if(anchor&&(0,_anchors.anchorIsValid)(anchor)){anchors.add(anchor);props.push("&".concat(anchor))}var tag=node.tag?node.tag:tagObj["default"]?null:tagObj.tag;if(tag)props.push(doc.directives.tagString(tag));return props.join(" ")}function stringify(item,ctx,onComment,onChompKeep){var _ctx$indentAtStart;if((0,_identity.isPair)(item))return item.toString(ctx,onComment,onChompKeep);if((0,_identity.isAlias)(item)){var _ctx$resolvedAliases;if(ctx.doc.directives)return item.toString(ctx);if((_ctx$resolvedAliases=ctx.resolvedAliases)!==null&&_ctx$resolvedAliases!==void 0&&_ctx$resolvedAliases.has(item)){throw new TypeError("Cannot stringify circular structure without alias nodes")}else{if(ctx.resolvedAliases)ctx.resolvedAliases.add(item);else ctx.resolvedAliases=new Set([item]);item=item.resolve(ctx.doc)}}var tagObj=undefined;var node=(0,_identity.isNode)(item)?item:ctx.doc.createNode(item,{onTagObj:function onTagObj(o){return tagObj=o}});if(!tagObj)tagObj=getTagObject(ctx.doc.schema.tags,node);var props=stringifyProps(node,tagObj,ctx);if(props.length>0)ctx.indentAtStart=((_ctx$indentAtStart=ctx.indentAtStart)!==null&&_ctx$indentAtStart!==void 0?_ctx$indentAtStart:0)+props.length+1;var str=typeof tagObj.stringify==="function"?tagObj.stringify(node,ctx,onComment,onChompKeep):(0,_identity.isScalar)(node)?(0,_stringifyString.stringifyString)(node,ctx,onComment,onChompKeep):node.toString(ctx,onComment,onChompKeep);if(!props)return str;return(0,_identity.isScalar)(node)||str[0]==="{"||str[0]==="["?"".concat(props," ").concat(str):"".concat(props,"\n").concat(ctx.indent).concat(str)}},{"../doc/anchors.js":241,"../nodes/identity.js":256,"./stringifyComment.js":290,"./stringifyString.js":294}],289:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.stringifyCollection=stringifyCollection;var _identity=require("../nodes/identity.js");var _stringify=require("./stringify.js");var _stringifyComment=require("./stringifyComment.js");function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},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 o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function stringifyCollection(collection,ctx,options){var _ctx$inFlow;var flow=(_ctx$inFlow=ctx.inFlow)!==null&&_ctx$inFlow!==void 0?_ctx$inFlow:collection.flow;var stringify=flow?stringifyFlowCollection:stringifyBlockCollection;return stringify(collection,ctx,options)}function stringifyBlockCollection(_ref,ctx,_ref2){var comment=_ref.comment,items=_ref.items;var blockItemPrefix=_ref2.blockItemPrefix,flowChars=_ref2.flowChars,itemIndent=_ref2.itemIndent,onChompKeep=_ref2.onChompKeep,onComment=_ref2.onComment;var indent=ctx.indent,commentString=ctx.options.commentString;var itemCtx=Object.assign({},ctx,{indent:itemIndent,type:null});var chompKeep=false;var lines=[];var _loop=function _loop(){var item=items[i];var comment=null;if((0,_identity.isNode)(item)){if(!chompKeep&&item.spaceBefore)lines.push("");addCommentBefore(ctx,lines,item.commentBefore,chompKeep);if(item.comment)comment=item.comment}else if((0,_identity.isPair)(item)){var ik=(0,_identity.isNode)(item.key)?item.key:null;if(ik){if(!chompKeep&&ik.spaceBefore)lines.push("");addCommentBefore(ctx,lines,ik.commentBefore,chompKeep)}}chompKeep=false;var str=(0,_stringify.stringify)(item,itemCtx,(function(){return comment=null}),(function(){return chompKeep=true}));if(comment)str+=(0,_stringifyComment.lineComment)(str,itemIndent,commentString(comment));if(chompKeep&&comment)chompKeep=false;lines.push(blockItemPrefix+str)};for(var i=0;i<items.length;++i){_loop()}var str;if(lines.length===0){str=flowChars.start+flowChars.end}else{str=lines[0];for(var _i=1;_i<lines.length;++_i){var line=lines[_i];str+=line?"\n".concat(indent).concat(line):"\n"}}if(comment){str+="\n"+(0,_stringifyComment.indentComment)(commentString(comment),indent);if(onComment)onComment()}else if(chompKeep&&onChompKeep)onChompKeep();return str}function stringifyFlowCollection(_ref3,ctx,_ref4){var items=_ref3.items;var flowChars=_ref4.flowChars,itemIndent=_ref4.itemIndent;var indent=ctx.indent,indentStep=ctx.indentStep,fcPadding=ctx.flowCollectionPadding,commentString=ctx.options.commentString;itemIndent+=indentStep;var itemCtx=Object.assign({},ctx,{indent:itemIndent,inFlow:true,type:null});var reqNewline=false;var linesAtValue=0;var lines=[];var _loop2=function _loop2(){var item=items[i];var comment=null;if((0,_identity.isNode)(item)){if(item.spaceBefore)lines.push("");addCommentBefore(ctx,lines,item.commentBefore,false);if(item.comment)comment=item.comment}else if((0,_identity.isPair)(item)){var ik=(0,_identity.isNode)(item.key)?item.key:null;if(ik){if(ik.spaceBefore)lines.push("");addCommentBefore(ctx,lines,ik.commentBefore,false);if(ik.comment)reqNewline=true}var iv=(0,_identity.isNode)(item.value)?item.value:null;if(iv){if(iv.comment)comment=iv.comment;if(iv.commentBefore)reqNewline=true}else if(item.value==null&&ik!==null&&ik!==void 0&&ik.comment){comment=ik.comment}}if(comment)reqNewline=true;var str=(0,_stringify.stringify)(item,itemCtx,(function(){return comment=null}));if(i<items.length-1)str+=",";if(comment)str+=(0,_stringifyComment.lineComment)(str,itemIndent,commentString(comment));if(!reqNewline&&(lines.length>linesAtValue||str.includes("\n")))reqNewline=true;lines.push(str);linesAtValue=lines.length};for(var i=0;i<items.length;++i){_loop2()}var start=flowChars.start,end=flowChars.end;if(lines.length===0){return start+end}else{if(!reqNewline){var len=lines.reduce((function(sum,line){return sum+line.length+2}),2);reqNewline=ctx.options.lineWidth>0&&len>ctx.options.lineWidth}if(reqNewline){var str=start;var _iterator=_createForOfIteratorHelper(lines),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var line=_step.value;str+=line?"\n".concat(indentStep).concat(indent).concat(line):"\n"}}catch(err){_iterator.e(err)}finally{_iterator.f()}return"".concat(str,"\n").concat(indent).concat(end)}else{return"".concat(start).concat(fcPadding).concat(lines.join(" ")).concat(fcPadding).concat(end)}}}function addCommentBefore(_ref5,lines,comment,chompKeep){var indent=_ref5.indent,commentString=_ref5.options.commentString;if(comment&&chompKeep)comment=comment.replace(/^\n+/,"");if(comment){var ic=(0,_stringifyComment.indentComment)(commentString(comment),indent);lines.push(ic.trimStart())}}},{"../nodes/identity.js":256,"./stringify.js":288,"./stringifyComment.js":290}],290:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.indentComment=indentComment;exports.stringifyComment=exports.lineComment=void 0;var stringifyComment=exports.stringifyComment=function stringifyComment(str){return str.replace(/^(?!$)(?: $)?/gm,"#")};function indentComment(comment,indent){if(/^\n+$/.test(comment))return comment.substring(1);return indent?comment.replace(/^(?! *$)/gm,indent):comment}var lineComment=exports.lineComment=function lineComment(str,indent,comment){return str.endsWith("\n")?indentComment(comment,indent):comment.includes("\n")?"\n"+indentComment(comment,indent):(str.endsWith(" ")?"":" ")+comment}},{}],291:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.stringifyDocument=stringifyDocument;var _identity=require("../nodes/identity.js");var _stringify=require("./stringify.js");var _stringifyComment=require("./stringifyComment.js");function stringifyDocument(doc,options){var _doc$directives;var lines=[];var hasDirectives=options.directives===true;if(options.directives!==false&&doc.directives){var dir=doc.directives.toString(doc);if(dir){lines.push(dir);hasDirectives=true}else if(doc.directives.docStart)hasDirectives=true}if(hasDirectives)lines.push("---");var ctx=(0,_stringify.createStringifyContext)(doc,options);var commentString=ctx.options.commentString;if(doc.commentBefore){if(lines.length!==1)lines.unshift("");var cs=commentString(doc.commentBefore);lines.unshift((0,_stringifyComment.indentComment)(cs,""))}var chompKeep=false;var contentComment=null;if(doc.contents){if((0,_identity.isNode)(doc.contents)){if(doc.contents.spaceBefore&&hasDirectives)lines.push("");if(doc.contents.commentBefore){var _cs=commentString(doc.contents.commentBefore);lines.push((0,_stringifyComment.indentComment)(_cs,""))}ctx.forceBlockIndent=!!doc.comment;contentComment=doc.contents.comment}var onChompKeep=contentComment?undefined:function(){return chompKeep=true};var body=(0,_stringify.stringify)(doc.contents,ctx,(function(){return contentComment=null}),onChompKeep);if(contentComment)body+=(0,_stringifyComment.lineComment)(body,"",commentString(contentComment));if((body[0]==="|"||body[0]===">")&&lines[lines.length-1]==="---"){lines[lines.length-1]="--- ".concat(body)}else lines.push(body)}else{lines.push((0,_stringify.stringify)(doc.contents,ctx))}if((_doc$directives=doc.directives)!==null&&_doc$directives!==void 0&&_doc$directives.docEnd){if(doc.comment){var _cs2=commentString(doc.comment);if(_cs2.includes("\n")){lines.push("...");lines.push((0,_stringifyComment.indentComment)(_cs2,""))}else{lines.push("... ".concat(_cs2))}}else{lines.push("...")}}else{var dc=doc.comment;if(dc&&chompKeep)dc=dc.replace(/^\n+/,"");if(dc){if((!chompKeep||contentComment)&&lines[lines.length-1]!=="")lines.push("");lines.push((0,_stringifyComment.indentComment)(commentString(dc),""))}}return lines.join("\n")+"\n"}},{"../nodes/identity.js":256,"./stringify.js":288,"./stringifyComment.js":290}],292:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.stringifyNumber=stringifyNumber;function stringifyNumber(_ref){var format=_ref.format,minFractionDigits=_ref.minFractionDigits,tag=_ref.tag,value=_ref.value;if(typeof value==="bigint")return String(value);var num=typeof value==="number"?value:Number(value);if(!isFinite(num))return isNaN(num)?".nan":num<0?"-.inf":".inf";var n=JSON.stringify(value);if(!format&&minFractionDigits&&(!tag||tag==="tag:yaml.org,2002:float")&&/^\d/.test(n)){var i=n.indexOf(".");if(i<0){i=n.length;n+="."}var d=minFractionDigits-(n.length-i-1);while(d-- >0)n+="0"}return n}},{}],293:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.stringifyPair=stringifyPair;var _identity=require("../nodes/identity.js");var _Scalar=require("../nodes/Scalar.js");var _stringify=require("./stringify.js");var _stringifyComment=require("./stringifyComment.js");function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function stringifyPair(_ref,ctx,onComment,onChompKeep){var key=_ref.key,value=_ref.value;var _ctx=ctx,allNullValues=_ctx.allNullValues,doc=_ctx.doc,indent=_ctx.indent,indentStep=_ctx.indentStep,_ctx$options=_ctx.options,commentString=_ctx$options.commentString,indentSeq=_ctx$options.indentSeq,simpleKeys=_ctx$options.simpleKeys;var keyComment=(0,_identity.isNode)(key)&&key.comment||null;if(simpleKeys){if(keyComment){throw new Error("With simple keys, key nodes cannot have comments")}if((0,_identity.isCollection)(key)||!(0,_identity.isNode)(key)&&_typeof(key)==="object"){var msg="With simple keys, collection cannot be used as a key value";throw new Error(msg)}}var explicitKey=!simpleKeys&&(!key||keyComment&&value==null&&!ctx.inFlow||(0,_identity.isCollection)(key)||((0,_identity.isScalar)(key)?key.type===_Scalar.Scalar.BLOCK_FOLDED||key.type===_Scalar.Scalar.BLOCK_LITERAL:_typeof(key)==="object"));ctx=Object.assign({},ctx,{allNullValues:false,implicitKey:!explicitKey&&(simpleKeys||!allNullValues),indent:indent+indentStep});var keyCommentDone=false;var chompKeep=false;var str=(0,_stringify.stringify)(key,ctx,(function(){return keyCommentDone=true}),(function(){return chompKeep=true}));if(!explicitKey&&!ctx.inFlow&&str.length>1024){if(simpleKeys)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");explicitKey=true}if(ctx.inFlow){if(allNullValues||value==null){if(keyCommentDone&&onComment)onComment();return str===""?"?":explicitKey?"? ".concat(str):str}}else if(allNullValues&&!simpleKeys||value==null&&explicitKey){str="? ".concat(str);if(keyComment&&!keyCommentDone){str+=(0,_stringifyComment.lineComment)(str,ctx.indent,commentString(keyComment))}else if(chompKeep&&onChompKeep)onChompKeep();return str}if(keyCommentDone)keyComment=null;if(explicitKey){if(keyComment)str+=(0,_stringifyComment.lineComment)(str,ctx.indent,commentString(keyComment));str="? ".concat(str,"\n").concat(indent,":")}else{str="".concat(str,":");if(keyComment)str+=(0,_stringifyComment.lineComment)(str,ctx.indent,commentString(keyComment))}var vsb,vcb,valueComment;if((0,_identity.isNode)(value)){vsb=!!value.spaceBefore;vcb=value.commentBefore;valueComment=value.comment}else{vsb=false;vcb=null;valueComment=null;if(value&&_typeof(value)==="object")value=doc.createNode(value)}ctx.implicitKey=false;if(!explicitKey&&!keyComment&&(0,_identity.isScalar)(value))ctx.indentAtStart=str.length+1;chompKeep=false;if(!indentSeq&&indentStep.length>=2&&!ctx.inFlow&&!explicitKey&&(0,_identity.isSeq)(value)&&!value.flow&&!value.tag&&!value.anchor){ctx.indent=ctx.indent.substring(2)}var valueCommentDone=false;var valueStr=(0,_stringify.stringify)(value,ctx,(function(){return valueCommentDone=true}),(function(){return chompKeep=true}));var ws=" ";if(keyComment||vsb||vcb){ws=vsb?"\n":"";if(vcb){var cs=commentString(vcb);ws+="\n".concat((0,_stringifyComment.indentComment)(cs,ctx.indent))}if(valueStr===""&&!ctx.inFlow){if(ws==="\n")ws="\n\n"}else{ws+="\n".concat(ctx.indent)}}else if(!explicitKey&&(0,_identity.isCollection)(value)){var _ref2,_ctx$inFlow;var vs0=valueStr[0];var nl0=valueStr.indexOf("\n");var hasNewline=nl0!==-1;var flow=(_ref2=(_ctx$inFlow=ctx.inFlow)!==null&&_ctx$inFlow!==void 0?_ctx$inFlow:value.flow)!==null&&_ref2!==void 0?_ref2:value.items.length===0;if(hasNewline||!flow){var hasPropsLine=false;if(hasNewline&&(vs0==="&"||vs0==="!")){var sp0=valueStr.indexOf(" ");if(vs0==="&"&&sp0!==-1&&sp0<nl0&&valueStr[sp0+1]==="!"){sp0=valueStr.indexOf(" ",sp0+1)}if(sp0===-1||nl0<sp0)hasPropsLine=true}if(!hasPropsLine)ws="\n".concat(ctx.indent)}}else if(valueStr===""||valueStr[0]==="\n"){ws=""}str+=ws+valueStr;if(ctx.inFlow){if(valueCommentDone&&onComment)onComment()}else if(valueComment&&!valueCommentDone){str+=(0,_stringifyComment.lineComment)(str,ctx.indent,commentString(valueComment))}else if(chompKeep&&onChompKeep){onChompKeep()}return str}},{"../nodes/Scalar.js":252,"../nodes/identity.js":256,"./stringify.js":288,"./stringifyComment.js":290}],294:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.stringifyString=stringifyString;var _Scalar=require("../nodes/Scalar.js");var _foldFlowLines=require("./foldFlowLines.js");var getFoldOptions=function getFoldOptions(ctx,isBlock){return{indentAtStart:isBlock?ctx.indent.length:ctx.indentAtStart,lineWidth:ctx.options.lineWidth,minContentWidth:ctx.options.minContentWidth}};var containsDocumentMarker=function containsDocumentMarker(str){return/^(%|---|\.\.\.)/m.test(str)};function lineLengthOverLimit(str,lineWidth,indentLength){if(!lineWidth||lineWidth<0)return false;var limit=lineWidth-indentLength;var strLen=str.length;if(strLen<=limit)return false;for(var i=0,start=0;i<strLen;++i){if(str[i]==="\n"){if(i-start>limit)return true;start=i+1;if(strLen-start<=limit)return false}}return true}function doubleQuotedString(value,ctx){var json=JSON.stringify(value);if(ctx.options.doubleQuotedAsJSON)return json;var implicitKey=ctx.implicitKey;var minMultiLineLength=ctx.options.doubleQuotedMinMultiLineLength;var indent=ctx.indent||(containsDocumentMarker(value)?" ":"");var str="";var start=0;for(var i=0,ch=json[i];ch;ch=json[++i]){if(ch===" "&&json[i+1]==="\\"&&json[i+2]==="n"){str+=json.slice(start,i)+"\\ ";i+=1;start=i;ch="\\"}if(ch==="\\")switch(json[i+1]){case"u":{str+=json.slice(start,i);var code=json.substr(i+2,4);switch(code){case"0000":str+="\\0";break;case"0007":str+="\\a";break;case"000b":str+="\\v";break;case"001b":str+="\\e";break;case"0085":str+="\\N";break;case"00a0":str+="\\_";break;case"2028":str+="\\L";break;case"2029":str+="\\P";break;default:if(code.substr(0,2)==="00")str+="\\x"+code.substr(2);else str+=json.substr(i,6)}i+=5;start=i+1}break;case"n":if(implicitKey||json[i+2]==='"'||json.length<minMultiLineLength){i+=1}else{str+=json.slice(start,i)+"\n\n";while(json[i+2]==="\\"&&json[i+3]==="n"&&json[i+4]!=='"'){str+="\n";i+=2}str+=indent;if(json[i+2]===" ")str+="\\";i+=1;start=i+1}break;default:i+=1}}str=start?str+json.slice(start):json;return implicitKey?str:(0,_foldFlowLines.foldFlowLines)(str,indent,_foldFlowLines.FOLD_QUOTED,getFoldOptions(ctx,false))}function singleQuotedString(value,ctx){if(ctx.options.singleQuote===false||ctx.implicitKey&&value.includes("\n")||/[ \t]\n|\n[ \t]/.test(value))return doubleQuotedString(value,ctx);var indent=ctx.indent||(containsDocumentMarker(value)?" ":"");var res="'"+value.replace(/'/g,"''").replace(/\n+/g,"$&\n".concat(indent))+"'";return ctx.implicitKey?res:(0,_foldFlowLines.foldFlowLines)(res,indent,_foldFlowLines.FOLD_FLOW,getFoldOptions(ctx,false))}function quotedString(value,ctx){var singleQuote=ctx.options.singleQuote;var qs;if(singleQuote===false)qs=doubleQuotedString;else{var hasDouble=value.includes('"');var hasSingle=value.includes("'");if(hasDouble&&!hasSingle)qs=singleQuotedString;else if(hasSingle&&!hasDouble)qs=doubleQuotedString;else qs=singleQuote?singleQuotedString:doubleQuotedString}return qs(value,ctx)}var blockEndNewlines;try{blockEndNewlines=new RegExp("(^|(?<!\n))\n+(?!\n|$)","g")}catch(_unused){blockEndNewlines=/\n+(?!\n|$)/g}function blockString(_ref,ctx,onComment,onChompKeep){var comment=_ref.comment,type=_ref.type,value=_ref.value;var _ctx$options=ctx.options,blockQuote=_ctx$options.blockQuote,commentString=_ctx$options.commentString,lineWidth=_ctx$options.lineWidth;if(!blockQuote||/\n[\t ]+$/.test(value)||/^\s*$/.test(value)){return quotedString(value,ctx)}var indent=ctx.indent||(ctx.forceBlockIndent||containsDocumentMarker(value)?" ":"");var literal=blockQuote==="literal"?true:blockQuote==="folded"||type===_Scalar.Scalar.BLOCK_FOLDED?false:type===_Scalar.Scalar.BLOCK_LITERAL?true:!lineLengthOverLimit(value,lineWidth,indent.length);if(!value)return literal?"|\n":">\n";var chomp;var endStart;for(endStart=value.length;endStart>0;--endStart){var ch=value[endStart-1];if(ch!=="\n"&&ch!=="\t"&&ch!==" ")break}var end=value.substring(endStart);var endNlPos=end.indexOf("\n");if(endNlPos===-1){chomp="-"}else if(value===end||endNlPos!==end.length-1){chomp="+";if(onChompKeep)onChompKeep()}else{chomp=""}if(end){value=value.slice(0,-end.length);if(end[end.length-1]==="\n")end=end.slice(0,-1);end=end.replace(blockEndNewlines,"$&".concat(indent))}var startWithSpace=false;var startEnd;var startNlPos=-1;for(startEnd=0;startEnd<value.length;++startEnd){var _ch=value[startEnd];if(_ch===" ")startWithSpace=true;else if(_ch==="\n")startNlPos=startEnd;else break}var start=value.substring(0,startNlPos<startEnd?startNlPos+1:startEnd);if(start){value=value.substring(start.length);start=start.replace(/\n+/g,"$&".concat(indent))}var indentSize=indent?"2":"1";var header=(startWithSpace?indentSize:"")+chomp;if(comment){header+=" "+commentString(comment.replace(/ ?[\r\n]+/g," "));if(onComment)onComment()}if(!literal){var foldedValue=value.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,"$&".concat(indent));var literalFallback=false;var foldOptions=getFoldOptions(ctx,true);if(blockQuote!=="folded"&&type!==_Scalar.Scalar.BLOCK_FOLDED){foldOptions.onOverflow=function(){literalFallback=true}}var body=(0,_foldFlowLines.foldFlowLines)("".concat(start).concat(foldedValue).concat(end),indent,_foldFlowLines.FOLD_BLOCK,foldOptions);if(!literalFallback)return">".concat(header,"\n").concat(indent).concat(body)}value=value.replace(/\n+/g,"$&".concat(indent));return"|".concat(header,"\n").concat(indent).concat(start).concat(value).concat(end)}function plainString(item,ctx,onComment,onChompKeep){var type=item.type,value=item.value;var actualString=ctx.actualString,implicitKey=ctx.implicitKey,indent=ctx.indent,indentStep=ctx.indentStep,inFlow=ctx.inFlow;if(implicitKey&&value.includes("\n")||inFlow&&/[[\]{},]/.test(value)){return quotedString(value,ctx)}if(!value||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)){return implicitKey||inFlow||!value.includes("\n")?quotedString(value,ctx):blockString(item,ctx,onComment,onChompKeep)}if(!implicitKey&&!inFlow&&type!==_Scalar.Scalar.PLAIN&&value.includes("\n")){return blockString(item,ctx,onComment,onChompKeep)}if(containsDocumentMarker(value)){if(indent===""){ctx.forceBlockIndent=true;return blockString(item,ctx,onComment,onChompKeep)}else if(implicitKey&&indent===indentStep){return quotedString(value,ctx)}}var str=value.replace(/\n+/g,"$&\n".concat(indent));if(actualString){var test=function test(tag){var _tag$test;return tag["default"]&&tag.tag!=="tag:yaml.org,2002:str"&&((_tag$test=tag.test)===null||_tag$test===void 0?void 0:_tag$test.test(str))};var _ctx$doc$schema=ctx.doc.schema,compat=_ctx$doc$schema.compat,tags=_ctx$doc$schema.tags;if(tags.some(test)||compat!==null&&compat!==void 0&&compat.some(test))return quotedString(value,ctx)}return implicitKey?str:(0,_foldFlowLines.foldFlowLines)(str,indent,_foldFlowLines.FOLD_FLOW,getFoldOptions(ctx,false))}function stringifyString(item,ctx,onComment,onChompKeep){var implicitKey=ctx.implicitKey,inFlow=ctx.inFlow;var ss=typeof item.value==="string"?item:Object.assign({},item,{value:String(item.value)});var type=item.type;if(type!==_Scalar.Scalar.QUOTE_DOUBLE){if(/(?:[\0-\x08\x0B-\x1F\x7F-\x9F]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/.test(ss.value))type=_Scalar.Scalar.QUOTE_DOUBLE}var _stringify=function _stringify(_type){switch(_type){case _Scalar.Scalar.BLOCK_FOLDED:case _Scalar.Scalar.BLOCK_LITERAL:return implicitKey||inFlow?quotedString(ss.value,ctx):blockString(ss,ctx,onComment,onChompKeep);case _Scalar.Scalar.QUOTE_DOUBLE:return doubleQuotedString(ss.value,ctx);case _Scalar.Scalar.QUOTE_SINGLE:return singleQuotedString(ss.value,ctx);case _Scalar.Scalar.PLAIN:return plainString(ss,ctx,onComment,onChompKeep);default:return null}};var res=_stringify(type);if(res===null){var _ctx$options2=ctx.options,defaultKeyType=_ctx$options2.defaultKeyType,defaultStringType=_ctx$options2.defaultStringType;var t=implicitKey&&defaultKeyType||defaultStringType;res=_stringify(t);if(res===null)throw new Error("Unsupported default string type ".concat(t))}return res}},{"../nodes/Scalar.js":252,"./foldFlowLines.js":287}],295:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.visit=visit;exports.visitAsync=visitAsync;var _identity=require("./nodes/identity.js");function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{define({},"")}catch(t){define=function define(t,e,r){return t[e]=r}}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,(function(){return this}));var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach((function(e){define(t,e,(function(t){return this._invoke(e,t)}))}))}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){invoke("next",t,i,a)}),(function(t){invoke("throw",t,i,a)})):e.resolve(h).then((function(t){u.value=t,i(u)}),(function(t){return invoke("throw",t,i,a)}))}a(c.arg)}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e((function(e,r){invoke(t,n,e,r)}))}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done}}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg)}}}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next};return i.next=i}}throw new TypeError(_typeof(e)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t},e.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,(function(){return this})),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,(function(){return this})),define(g,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next}return next.done=!0,next}},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y}},catch:function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value}catch(n){return void e(n)}i.done?t(u):Promise.resolve(u).then(r,o)}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise((function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n)}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n)}_next(void 0)}))}}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}var BREAK=Symbol("break visit");var SKIP=Symbol("skip children");var REMOVE=Symbol("remove node");function visit(node,visitor){var visitor_=initVisitor(visitor);if((0,_identity.isDocument)(node)){var cd=visit_(null,node.contents,visitor_,Object.freeze([node]));if(cd===REMOVE)node.contents=null}else visit_(null,node,visitor_,Object.freeze([]))}visit.BREAK=BREAK;visit.SKIP=SKIP;visit.REMOVE=REMOVE;function visit_(key,node,visitor,path){var ctrl=callVisitor(key,node,visitor,path);if((0,_identity.isNode)(ctrl)||(0,_identity.isPair)(ctrl)){replaceNode(key,path,ctrl);return visit_(key,ctrl,visitor,path)}if(_typeof(ctrl)!=="symbol"){if((0,_identity.isCollection)(node)){path=Object.freeze(path.concat(node));for(var i=0;i<node.items.length;++i){var ci=visit_(i,node.items[i],visitor,path);if(typeof ci==="number")i=ci-1;else if(ci===BREAK)return BREAK;else if(ci===REMOVE){node.items.splice(i,1);i-=1}}}else if((0,_identity.isPair)(node)){path=Object.freeze(path.concat(node));var ck=visit_("key",node.key,visitor,path);if(ck===BREAK)return BREAK;else if(ck===REMOVE)node.key=null;var cv=visit_("value",node.value,visitor,path);if(cv===BREAK)return BREAK;else if(cv===REMOVE)node.value=null}}return ctrl}function visitAsync(_x,_x2){return _visitAsync.apply(this,arguments)}function _visitAsync(){_visitAsync=_asyncToGenerator(_regeneratorRuntime().mark((function _callee(node,visitor){var visitor_,cd;return _regeneratorRuntime().wrap((function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:visitor_=initVisitor(visitor);if(!(0,_identity.isDocument)(node)){_context.next=8;break}_context.next=4;return visitAsync_(null,node.contents,visitor_,Object.freeze([node]));case 4:cd=_context.sent;if(cd===REMOVE)node.contents=null;_context.next=10;break;case 8:_context.next=10;return visitAsync_(null,node,visitor_,Object.freeze([]));case 10:case"end":return _context.stop()}}),_callee)})));return _visitAsync.apply(this,arguments)}visitAsync.BREAK=BREAK;visitAsync.SKIP=SKIP;visitAsync.REMOVE=REMOVE;function visitAsync_(_x3,_x4,_x5,_x6){return _visitAsync_.apply(this,arguments)}function _visitAsync_(){_visitAsync_=_asyncToGenerator(_regeneratorRuntime().mark((function _callee2(key,node,visitor,path){var ctrl,i,ci,ck,cv;return _regeneratorRuntime().wrap((function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return callVisitor(key,node,visitor,path);case 2:ctrl=_context2.sent;if(!((0,_identity.isNode)(ctrl)||(0,_identity.isPair)(ctrl))){_context2.next=6;break}replaceNode(key,path,ctrl);return _context2.abrupt("return",visitAsync_(key,ctrl,visitor,path));case 6:if(!(_typeof(ctrl)!=="symbol")){_context2.next=46;break}if(!(0,_identity.isCollection)(node)){_context2.next=28;break}path=Object.freeze(path.concat(node));i=0;case 10:if(!(i<node.items.length)){_context2.next=26;break}_context2.next=13;return visitAsync_(i,node.items[i],visitor,path);case 13:ci=_context2.sent;if(!(typeof ci==="number")){_context2.next=18;break}i=ci-1;_context2.next=23;break;case 18:if(!(ci===BREAK)){_context2.next=22;break}return _context2.abrupt("return",BREAK);case 22:if(ci===REMOVE){node.items.splice(i,1);i-=1}case 23:++i;_context2.next=10;break;case 26:_context2.next=46;break;case 28:if(!(0,_identity.isPair)(node)){_context2.next=46;break}path=Object.freeze(path.concat(node));_context2.next=32;return visitAsync_("key",node.key,visitor,path);case 32:ck=_context2.sent;if(!(ck===BREAK)){_context2.next=37;break}return _context2.abrupt("return",BREAK);case 37:if(ck===REMOVE)node.key=null;case 38:_context2.next=40;return visitAsync_("value",node.value,visitor,path);case 40:cv=_context2.sent;if(!(cv===BREAK)){_context2.next=45;break}return _context2.abrupt("return",BREAK);case 45:if(cv===REMOVE)node.value=null;case 46:return _context2.abrupt("return",ctrl);case 47:case"end":return _context2.stop()}}),_callee2)})));return _visitAsync_.apply(this,arguments)}function initVisitor(visitor){if(_typeof(visitor)==="object"&&(visitor.Collection||visitor.Node||visitor.Value)){return Object.assign({Alias:visitor.Node,Map:visitor.Node,Scalar:visitor.Node,Seq:visitor.Node},visitor.Value&&{Map:visitor.Value,Scalar:visitor.Value,Seq:visitor.Value},visitor.Collection&&{Map:visitor.Collection,Seq:visitor.Collection},visitor)}return visitor}function callVisitor(key,node,visitor,path){var _visitor$Map,_visitor$Seq,_visitor$Pair,_visitor$Scalar,_visitor$Alias;if(typeof visitor==="function")return visitor(key,node,path);if((0,_identity.isMap)(node))return(_visitor$Map=visitor.Map)===null||_visitor$Map===void 0?void 0:_visitor$Map.call(visitor,key,node,path);if((0,_identity.isSeq)(node))return(_visitor$Seq=visitor.Seq)===null||_visitor$Seq===void 0?void 0:_visitor$Seq.call(visitor,key,node,path);if((0,_identity.isPair)(node))return(_visitor$Pair=visitor.Pair)===null||_visitor$Pair===void 0?void 0:_visitor$Pair.call(visitor,key,node,path);if((0,_identity.isScalar)(node))return(_visitor$Scalar=visitor.Scalar)===null||_visitor$Scalar===void 0?void 0:_visitor$Scalar.call(visitor,key,node,path);if((0,_identity.isAlias)(node))return(_visitor$Alias=visitor.Alias)===null||_visitor$Alias===void 0?void 0:_visitor$Alias.call(visitor,key,node,path);return undefined}function replaceNode(key,path,node){var parent=path[path.length-1];if((0,_identity.isCollection)(parent)){parent.items[key]=node}else if((0,_identity.isPair)(parent)){if(key==="key")parent.key=node;else parent.value=node}else if((0,_identity.isDocument)(parent)){parent.contents=node}else{var pt=(0,_identity.isAlias)(parent)?"alias":"scalar";throw new Error("Cannot replace node with ".concat(pt," parent"))}}},{"./nodes/identity.js":256}],296:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}Object.defineProperty(exports,"__esModule",{value:true});var _exportNames={};exports["default"]=void 0;var YAML=_interopRequireWildcard(require("./dist/index.js"));Object.keys(YAML).forEach((function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===YAML[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return YAML[key]}})}));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=_typeof(e)&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u]}return n["default"]=e,t&&t.set(e,n),n}var _default=exports["default"]=YAML},{"./dist/index.js":246}],297:[function(require,module,exports){(function(Buffer){(function(){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _events=_interopRequireDefault(require("events"));var _mqtt=_interopRequireDefault(require("mqtt"));var _loglevel=_interopRequireDefault(require("loglevel"));var _tinycache=_interopRequireDefault(require("tinycache"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}var _require=require("uuid"),uuidv4=_require.v4;var BaseClient=exports["default"]=function(_events$EventEmitter){function BaseClient(config){var _this;_classCallCheck(this,BaseClient);_this=_callSuper(this,BaseClient);_this.log=_loglevel["default"];_this.log.setDefaultLevel(config.options.logLevel);_this.config=config;_this.reconnectLog=0;_this.mqtt=null;_this.lostConnectionLog=new _tinycache["default"];return _this}_inherits(BaseClient,_events$EventEmitter);return _createClass(BaseClient,[{key:"isConnected",value:function isConnected(){if(this.mqtt==null){return false}return this.mqtt.connected}},{key:"connect",value:function connect(){var _this2=this;if(this.mqtt!=null){this.log.info("[BaseClient:connect] Reconnecting to "+this.config.getMqttHost()+" as "+this.config.getClientId());this.mqtt.reconnect();return}this.log.info("[BaseClient:connect] Connecting to "+this.config.getMqttHost()+" as "+this.config.getClientId());this.mqtt=_mqtt["default"].connect(this.config.getMqttHost(),this.config.getMqttConfig());this.mqtt.on("connect",(function(){_this2.log.info("[BaseClient:onConnect] MQTT client is connected.");_this2.emit("connect");var connectionLostCount=_this2.lostConnectionLog.size;var reconnectPeriod=1e3;if(connectionLostCount>=9){reconnectPeriod=2e4;_this2.log.warn("[BaseClient:onOffline] This client is likely suffering from clientId stealing (where two connections try to use the same client Id).");_this2.emit("error","Exceeded 9 connection losses in a 5 minute period. Check for clientId conflict with another connection.")}else if(connectionLostCount>=6){reconnectPeriod=5e3}else if(connectionLostCount>=3){reconnectPeriod=2e3}if(reconnectPeriod!=_this2.mqtt.options.reconnectPeriod){_this2.log.info("[BaseClient:onOffline] Client has lost connection "+connectionLostCount+" times during the last 5 minutes, reconnect delay adjusted to "+reconnectPeriod+" ms");_this2.mqtt.options.reconnectPeriod=reconnectPeriod}}));this.mqtt.on("reconnect",(function(){_this2.log.info("[BaseClient:onReconnect] MQTT client is reconnecting.");_this2.emit("reconnect")}));this.mqtt.on("close",(function(){_this2.log.info("[BaseClient:onClose] MQTT client connection was closed.");_this2.emit("close")}));this.mqtt.on("offline",(function(){var newId=uuidv4();_this2.log.info("[BaseClient:onOffline] MQTT client connection is offline. ["+newId+"]");_this2.emit("offline");_this2.lostConnectionLog.put(newId,"1",3e5);var connectionLostCount=_this2.lostConnectionLog.size;_this2.log.info("[BaseClient:onOffline] Connection losses in the last 5 minutes: "+connectionLostCount)}));this.mqtt.on("error",(function(error){_this2.log.error("[BaseClient:onError] "+error);var errorMsg=""+error;if(errorMsg.indexOf("Not authorized")>-1){_this2.log.error("[BaseClient:onError] One or more configuration parameters are wrong. Modify the configuration before trying to reconnect.");_this2.mqtt.end(false,(function(){_this2.log.info("[BaseClient:onError] Closed the MQTT connection due to client misconfiguration")}))}_this2.emit("error",error)}))}},{key:"disconnect",value:function disconnect(){var _this3=this;if(this.mqtt==null){this.log.info("[BaseClient:disconnect] Client was never connected");return}this.mqtt.end(false,(function(){_this3.log.info("[BaseClient:disconnect] Closed the MQTT connection due to disconnect() call")}))}},{key:"_subscribe",value:function _subscribe(topic,QoS,callback){if(this.mqtt==null){this.emit("error","[BaseClient:_subscribe] MQTT Client is not initialized - call connect() first");return}if(!this.mqtt.connected){this.emit("error","[BaseClient:_subscribe] MQTT Client is not connected - call connect() first");return}QoS=QoS||0;callback=callback||function(err,granted){if(err==null){for(var index in granted){var grant=granted[index];this.log.debug("[BaseClient:_subscribe] Subscribed to "+grant.topic+" at QoS "+grant.qos)}}else{this.log.error("[BaseClient:_subscribe] "+err);this.emit("error",err)}}.bind(this);this.log.debug("[BaseClient:_subscribe] Subscribing to topic "+topic+" with QoS "+QoS);this.mqtt.subscribe(topic,{qos:parseInt(QoS)},callback)}},{key:"_unsubscribe",value:function _unsubscribe(topic,callback){if(this.mqtt==null){this.emit("error","[BaseClient:_unsubscribe] MQTT Client is not initialized - call connect() first");return}if(!this.mqtt.connected){this.emit("error","[BaseClient:_unsubscribe] MQTT Client is not connected - call connect() first");return}callback=callback||function(err){if(err==null){this.log.debug("[BaseClient:_unsubscribe] Unsubscribed from: "+topic)}else{this.log.error("[BaseClient:_unsubscribe] "+err);this.emit("error",err)}}.bind(this);this.log.debug("[BaseClient:_unsubscribe] Unsubscribe: "+topic);this.mqtt.unsubscribe(topic,callback)}},{key:"_publish",value:function _publish(topic,msg,QoS,callback){QoS=QoS||0;if(this.mqtt==null){this.emit("error","[BaseClient:_unsubscribe] MQTT Client is not initialized - call connect() first");return}if(!this.mqtt.connected){this.emit("error","[BaseClient:_unsubscribe] MQTT Client is not connected - call connect() first");return}if((_typeof(msg)==="object"||typeof msg==="boolean"||typeof msg==="number")&&!Buffer.isBuffer(msg)){msg=JSON.stringify(msg)}this.log.debug("[BaseClient:_publish] Publish: "+topic+", "+msg+", QoS : "+QoS);this.mqtt.publish(topic,msg,{qos:parseInt(QoS)},callback)}}])}(_events["default"].EventEmitter)}).call(this)}).call(this,{isBuffer:require("../node_modules/is-buffer/index.js")})},{"../node_modules/is-buffer/index.js":113,events:97,loglevel:138,mqtt:148,tinycache:193,uuid:204}],298:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var BaseConfig=exports["default"]=function(){function BaseConfig(identity,auth,options){_classCallCheck(this,BaseConfig);this.identity=identity;this.auth=auth;this.options=options;if(this.options!=null&&"mqtt"in this.options){if("port"in this.options.mqtt&&this.options.mqtt.port!=null){if(isNaN(this.options.mqtt.port)){throw new Error("Optional setting options.mqtt.port must be a number if provided")}}if("cleanStart"in this.options.mqtt&&typeof this.options.mqtt.cleanStart!="boolean"){throw new Error("Optional setting options.mqtt.cleanStart must be a boolean if provided")}}if(this.options==null){this.options={}}if(!("domain"in this.options)||this.options.domain==null){this.options.domain="internetofthings.ibmcloud.com"}if(!("logLevel"in this.options)||this.options.logLevel==null){this.options.logLevel="info"}if(!("mqtt"in this.options)){this.options.mqtt={}}if(!("port"in this.options.mqtt)||this.options.mqtt.port==null){this.options.mqtt.port=8883}if(!("transport"in this.options.mqtt)||this.options.mqtt.transport==null){this.options.mqtt.transport="tcp"}if(!("cleanStart"in this.options.mqtt)){this.options.mqtt.cleanStart=true}if(!("sessionExpiry"in this.options.mqtt)){this.options.mqtt.sessionExpiry=3600}if(!("keepAlive"in this.options.mqtt)){this.options.mqtt.keepAlive=60}if(!("caFile"in this.options.mqtt)){this.options.mqtt.caFile=null}}return _createClass(BaseConfig,[{key:"getOrgId",value:function getOrgId(){throw new Error("Sub class must implement getOrgId()")}},{key:"isQuickstart",value:function isQuickstart(){return this.getOrgId()=="quickstart"}},{key:"getClientId",value:function getClientId(){throw new Error("Sub class must implement getClientId()")}},{key:"getMqttUsername",value:function getMqttUsername(){throw new Error("Sub class must implement getMqttUsername()")}},{key:"getMqttPassword",value:function getMqttPassword(){throw new Error("Sub class must implement getMqttPassowrd()")}},{key:"getMqttConfig",value:function getMqttConfig(){var mqttConfig={clientId:this.getClientId(),keepalive:this.options.mqtt.keepAlive,connectTimeout:90*1e3,reconnectPeriod:1e3,queueQoSZero:true,resubscribe:true,clean:this.options.mqtt.cleanStart,username:this.getMqttUsername(),password:this.getMqttPassword(),rejectUnauthorized:true};return mqttConfig}},{key:"getMqttHost",value:function getMqttHost(){var server=this.getOrgId()+".messaging."+this.options.domain+":"+this.options.mqtt.port;if(this.options.mqtt.port==80||this.options.mqtt.port==1883){if(this.options.mqtt.transport=="tcp"){return"tcp://"+server}if(this.options.mqtt.transport=="websockets"){return"ws://"+server}}if(this.options.mqtt.port==443||this.options.mqtt.port==8883){if(this.options.mqtt.transport=="tcp"){return"ssl://"+server}if(this.options.mqtt.transport=="websockets"){return"wss://"+server}}return"ssl://"+server}}],[{key:"parseEnvVars",value:function parseEnvVars(){throw new Error("Sub class must implement parseEnvVars()")}},{key:"parseConfigFile",value:function parseConfigFile(){throw new Error("Sub class must implement parseConfigFile()")}}])}()},{}],299:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _axios=_interopRequireDefault(require("axios"));var _bluebird=_interopRequireDefault(require("bluebird"));var _btoa=_interopRequireDefault(require("btoa"));var _formData=_interopRequireDefault(require("form-data"));var _loglevel=_interopRequireDefault(require("loglevel"));var _util=require("../util");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach((function(r){_defineProperty(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var ApiClient=exports["default"]=function(){function ApiClient(config){_classCallCheck(this,ApiClient);this.log=_loglevel["default"];this.log.setDefaultLevel(config.options.logLevel);this.config=config;this.useLtpa=this.config.auth&&this.config.auth.useLtpa;this.log.debug("[ApiClient:constructor] ApiClient initialized for "+this.config.getApiBaseUri())}return _createClass(ApiClient,[{key:"parseSortSpec",value:function parseSortSpec(sortSpec){return sortSpec?sortSpec.map((function(s){var e=Object.entries(s)[0];return"".concat(e[1]?"-":"").concat(e[0])})).join(","):undefined}},{key:"callApi",value:function callApi(method,expectedHttpCode,expectJsonContent,paths,body,params){var _this=this;return new _bluebird["default"]((function(resolve,reject){var uri=_this.config.getApiBaseUri();if(Array.isArray(paths)){for(var i=0,l=paths.length;i<l;i++){uri+="/"+paths[i]}}var xhrConfig={url:uri,method:method,headers:{"Content-Type":"application/json"},validateStatus:function validateStatus(status){if(Array.isArray(expectedHttpCode)){return expectedHttpCode.includes(status)}else{return status===expectedHttpCode}}};if(_this.useLtpa){xhrConfig.withCredentials=true}else{xhrConfig.headers["Authorization"]="Basic "+(0,_btoa["default"])(_this.config.auth.key+":"+_this.config.auth.token)}if(body){xhrConfig.data=body}if(params){xhrConfig.params=params}if(_this.config.getAdditionalHeaders()){xhrConfig.headers=_objectSpread(_objectSpread({},xhrConfig.headers),_this.config.getAdditionalHeaders())}function transformResponse(response){if(expectJsonContent&&!(_typeof(response.data)==="object")){try{resolve(JSON.parse(response.data))}catch(e){reject(e)}}else{resolve(response.data)}}_this.log.debug("[ApiClient:transformResponse] "+xhrConfig);(0,_axios["default"])(xhrConfig).then(transformResponse,reject)}))}},{key:"getOrganizationDetails",value:function getOrganizationDetails(){this.log.debug("[ApiClient] getOrganizationDetails()");return this.callApi("GET",200,true,null,null)}},{key:"getServiceStatus",value:function getServiceStatus(){this.log.debug("[ApiClient] getServiceStatus()");return this.callApi("GET",200,true,["service-status"],null)}},{key:"getActiveDevices",value:function getActiveDevices(start,end,detail){this.log.debug("[ApiClient] getActiveDevices("+start+", "+end+")");detail=detail|false;var params={start:start,end:end,detail:detail};return this.callApi("GET",200,true,["usage","active-devices"],null,params)}},{key:"getHistoricalDataUsage",value:function getHistoricalDataUsage(start,end,detail){this.log.debug("[ApiClient] getHistoricalDataUsage("+start+", "+end+")");detail=detail|false;var params={start:start,end:end,detail:detail};return this.callApi("GET",200,true,["usage","historical-data"],null,params)}},{key:"getDataUsage",value:function getDataUsage(start,end,detail){this.log.debug("[ApiClient] getDataUsage("+start+", "+end+")");detail=detail|false;var params={start:start,end:end,detail:detail};return this.callApi("GET",200,true,["usage","data-traffic"],null,params)}},{key:"getConnectionStates",value:function getConnectionStates(){this.log.debug("[ApiClient] getConnectionStates() - client connectivity");return this.callApi("GET",200,true,["clientconnectionstates"],null)}},{key:"getConnectionState",value:function getConnectionState(id){this.log.debug("[ApiClient] getConnectionState() - client connectivity");return this.callApi("GET",200,true,["clientconnectionstates/"+id],null)}},{key:"getConnectedClientsConnectionStates",value:function getConnectedClientsConnectionStates(){this.log.debug("[ApiClient] getConnectedClientsConnectionStates() - client connectivity");return this.callApi("GET",200,true,["clientconnectionstates?connectionStatus=connected"],null)}},{key:"getRecentConnectionStates",value:function getRecentConnectionStates(date){this.log.debug("[ApiClient] getRecentConnectionStates() - client connectivity");return this.callApi("GET",200,true,["clientconnectionstates?connectedAfter="+date],null)}},{key:"getCustomConnectionState",value:function getCustomConnectionState(query){this.log.debug("[ApiClient] getCustomConnectionStates() - client connectivity");return this.callApi("GET",200,true,["clientconnectionstates"+query],null)}},{key:"getAllDevices",value:function getAllDevices(params){this.log.debug("[ApiClient] getAllDevices() - BULK");return this.callApi("GET",200,true,["bulk","devices"],null,params)}},{key:"getGroupIdsForDevice",value:function getGroupIdsForDevice(deviceId){this.log.debug("[ApiClient] getGroupIdsForDevice("+deviceId+")");return this.callApi("GET",200,true,["authorization","devices",deviceId],null)}},{key:"updateDeviceRoles",value:function updateDeviceRoles(deviceId,roles){this.log.debug("[ApiClient] updateDeviceRoles("+deviceId+","+roles+")");return this.callApi("PUT",200,false,["authorization","devices",deviceId,"roles"],roles)}},{key:"getAllDevicesInGroup",value:function getAllDevicesInGroup(groupId){this.log.debug("[ApiClient] getAllDevicesInGropu("+groupId+")");return this.callApi("GET",200,true,["bulk","devices",groupId],null)}},{key:"addDevicesToGroup",value:function addDevicesToGroup(groupId,deviceList){this.log.debug("[ApiClient] addDevicesToGroup("+groupId+","+deviceList+")");return this.callApi("PUT",200,false,["bulk","devices",groupId,"add"],deviceList)}},{key:"removeDevicesFromGroup",value:function removeDevicesFromGroup(groupId,deviceList){this.log.debug("[ApiClient] removeDevicesFromGroup("+groupId+","+deviceList+")");return this.callApi("PUT",200,false,["bulk","devices",groupId,"remove"],deviceList)}},{key:"getAllGroups",value:function getAllGroups(){this.log.debug("[ApiClient] getAllGroups()");return this.callApi("GET",200,true,["groups"],null)}},{key:"getAllDeviceIdsInGroup",value:function getAllDeviceIdsInGroup(groupId){this.log.debug("[ApiClient] getAllDeviceIdsInGroup("+groupId+")");return this.callApi("GET",200,true,["bulk","devices",groupId,"ids"],null)}},{key:"getGroup",value:function getGroup(groupId){this.log.debug("[ApiClient] getGroup("+groupId+")");return this.callApi("GET",200,true,["groups",groupId],null)}},{key:"createGroup",value:function createGroup(groupInfo){this.log.debug("[ApiClient] createGroup()");return this.callApi("POST",201,true,["groups"],groupInfo)}},{key:"deleteGroup",value:function deleteGroup(groupId){this.log.debug("[ApiClient] deleteGroup("+groupId+")");return this.callApi("DELETE",200,false,["groups",groupId],null)}},{key:"getAllDeviceAccessControlProperties",value:function getAllDeviceAccessControlProperties(){this.log.debug("[ApiClient] getAllDeviceAccessControlProperties()");return this.callApi("GET",200,true,["authorization","devices"],null)}},{key:"getDeviceAccessControlProperties",value:function getDeviceAccessControlProperties(deviceId){this.log.debug("[ApiClient] getDeviceAccessControlProperties("+deviceId+")");return this.callApi("GET",200,true,["authorization","devices",deviceId,"roles"],null)}},{key:"updateDeviceAccessControlProperties",value:function updateDeviceAccessControlProperties(deviceId,deviceProps){this.log.debug("[ApiClient] updateDeviceAccessControlProperties("+deviceId+")");return this.callApi("PUT",200,true,["authorization","devices",deviceId],deviceProps)}},{key:"updateDeviceAccessControlPropertiesWithRoles",value:function updateDeviceAccessControlPropertiesWithRoles(deviceId,devicePropsWithRoles){this.log.debug("[ApiClient] updateDeviceAccessControlPropertiesWithRoles("+deviceId+","+devicePropsWithRoles+")");return this.callApi("PUT",200,true,["authorization","devices",deviceId,"withroles"],devicePropsWithRoles)}},{key:"updateGatewayRoles",value:function updateGatewayRoles(gatewayId,roles){this.log.debug("[ApiClient] updateGatewayRoles("+gatewayId+","+roles+")");return this.callApi("PUT",200,false,["authorization","devices",gatewayId,"roles"],roles)}},{key:"getGroups",value:function getGroups(groupId){this.log.debug("[ApiClient] getGroups("+groupId+")");return this.callApi("GET",200,true,["groups",groupId],null)}},{key:"callFormDataApi",value:function callFormDataApi(method,expectedHttpCode,expectJsonContent,paths,body,params){var _this2=this;return new _bluebird["default"]((function(resolve,reject){var uri=_this2.config.getApiBaseUri();if(Array.isArray(paths)){for(var i=0,l=paths.length;i<l;i++){uri+="/"+paths[i]}}var xhrConfig={url:uri,method:method,headers:{"Content-Type":"multipart/form-data"}};if(_this2.useLtpa){xhrConfig.withCredentials=true}else{xhrConfig.headers["Authorization"]="Basic "+(0,_btoa["default"])(_this2.apiKey+":"+_this2.apiToken)}if(body){xhrConfig.data=body;if((0,_util.isBrowser)()){xhrConfig.transformRequest=[function(data){var formData=new _formData["default"];if(xhrConfig.method=="POST"){if(data.schemaFile){var blob=new Blob([data.schemaFile],{type:"application/json"});var schemaFileName="".concat(data.name||"schema",".json");formData.append("schemaFile",blob,schemaFileName)}if(data.name){formData.append("name",data.name)}if(data.schemaType){formData.append("schemaType","json-schema")}if(data.description){formData.append("description",data.description)}}else if(xhrConfig.method=="PUT"){if(data.schemaFile){var blob=new Blob([data.schemaFile],{type:"application/json",name:data.name});var schemaFileName="".concat(data.name||"schema",".json");formData.append("schemaFile",blob,schemaFileName)}}return formData}]}}if(params){xhrConfig.params=params}if(_this2.config.getAdditionalHeaders()){xhrConfig.headers=_objectSpread(_objectSpread({},xhrConfig.headers),_this2.config.getAdditionalHeaders())}function transformResponse(response){if(response.status===expectedHttpCode){if(expectJsonContent&&!(_typeof(response.data)==="object")){try{resolve(JSON.parse(response.data))}catch(e){reject(e)}}else{resolve(response.data)}}else{reject(new Error(method+" "+uri+": Expected HTTP "+expectedHttpCode+" from server but got HTTP "+response.status+". Error Body: "+JSON.stringify(response.data)))}}_this2.log.debug("[ApiClient:transformResponse] "+xhrConfig);if((0,_util.isBrowser)()){(0,_axios["default"])(xhrConfig).then(transformResponse,reject)}else{var formData=null;var config={url:uri,method:method,headers:{"Content-Type":"multipart/form-data"},auth:{user:_this2.apiKey,pass:_this2.apiToken},formData:{},rejectUnauthorized:false};if(xhrConfig.method=="POST"){formData={schemaFile:{value:body.schemaFile,options:{contentType:"application/json",filename:body.name}},schemaType:"json-schema",name:body.name};config.formData=formData}else if(xhrConfig.method=="PUT"){formData={schemaFile:{value:body.schemaFile,options:{contentType:"application/json",filename:body.name}}};config.formData=formData}request(config,(function optionalCallback(err,response,body){if(response.statusCode===expectedHttpCode){if(expectJsonContent&&!(_typeof(response.data)==="object")){try{resolve(JSON.parse(body))}catch(e){reject(e)}}else{resolve(body)}}else{reject(new Error(method+" "+uri+": Expected HTTP "+expectedHttpCode+" from server but got HTTP "+response.statusCode+". Error Body: "+err))}}))}}))}},{key:"invalidOperation",value:function invalidOperation(message){return new _bluebird["default"]((function(resolve,reject){resolve(message)}))}}])}()},{"../util":313,axios:2,bluebird:70,btoa:73,"form-data":99,loglevel:138}],300:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}Object.defineProperty(exports,"__esModule",{value:true});exports.handleError=exports["default"]=exports.WiotpError=exports.ServiceNotFound=exports.InvalidServiceCredentials=exports.DestinationAlreadyExists=void 0;function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _wrapNativeSuper(t){var r="function"==typeof Map?new Map:void 0;return _wrapNativeSuper=function _wrapNativeSuper(t){if(null===t||!_isNativeFunction(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,Wrapper)}function Wrapper(){return _construct(t,arguments,_getPrototypeOf(this).constructor)}return Wrapper.prototype=Object.create(t.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(Wrapper,t)},_wrapNativeSuper(t)}function _construct(t,e,r){if(_isNativeReflectConstruct())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,e);var p=new(t.bind.apply(t,o));return r&&_setPrototypeOf(p,r.prototype),p}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _isNativeFunction(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(n){return"function"==typeof t}}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}var WiotpError=exports.WiotpError=function(_Error){function WiotpError(message,cause){var _this;_classCallCheck(this,WiotpError);_this=_callSuper(this,WiotpError,[message]);_this.cause=cause;_this.name=_this.constructor.name;return _this}_inherits(WiotpError,_Error);return _createClass(WiotpError)}(_wrapNativeSuper(Error));var InvalidServiceCredentials=exports.InvalidServiceCredentials=function(_WiotpError){function InvalidServiceCredentials(){_classCallCheck(this,InvalidServiceCredentials);return _callSuper(this,InvalidServiceCredentials,arguments)}_inherits(InvalidServiceCredentials,_WiotpError);return _createClass(InvalidServiceCredentials)}(WiotpError);var DestinationAlreadyExists=exports.DestinationAlreadyExists=function(_WiotpError2){function DestinationAlreadyExists(){_classCallCheck(this,DestinationAlreadyExists);return _callSuper(this,DestinationAlreadyExists,arguments)}_inherits(DestinationAlreadyExists,_WiotpError2);return _createClass(DestinationAlreadyExists)}(WiotpError);var ServiceNotFound=exports.ServiceNotFound=function(_WiotpError3){function ServiceNotFound(){_classCallCheck(this,ServiceNotFound);return _callSuper(this,ServiceNotFound,arguments)}_inherits(ServiceNotFound,_WiotpError3);return _createClass(ServiceNotFound)}(WiotpError);var handleError=exports.handleError=function handleError(err,errorMappings){if(err&&err.response&&err.response.data&&err.response.data.exception&&err.response.data.exception.id){if(errorMappings&&errorMappings[err.response.data.exception.id]){throw new errorMappings[err.response.data.exception.id](err.response.data.message,err)}else{throw new WiotpError(err.response.data.message,err)}}else{throw err}};var _default=exports["default"]={WiotpError:WiotpError,InvalidServiceCredentials:InvalidServiceCredentials,DestinationAlreadyExists:DestinationAlreadyExists,ServiceNotFound:ServiceNotFound}},{}],301:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _loglevel=_interopRequireDefault(require("loglevel"));var errors=_interopRequireWildcard(require("./ApiErrors"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r})(e)}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=_typeof(e)&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u]}return n["default"]=e,t&&t.set(e,n),n}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var DscClient=exports["default"]=function(){function DscClient(apiClient){_classCallCheck(this,DscClient);this.log=_loglevel["default"];this.apiClient=apiClient}return _createClass(DscClient,[{key:"createService",value:function createService(service){return this.apiClient.callApi("POST",201,true,["s2s","services"],service)["catch"]((function(err){return errors.handleError(err,{CUDSS0026E:errors.InvalidServiceCredentials})}))}},{key:"createCloudantService",value:function createCloudantService(_ref){var name=_ref.name,description=_ref.description,username=_ref.username,password=_ref.password,_ref$host=_ref.host,host=_ref$host===void 0?"".concat(username,".cloudant.com"):_ref$host,_ref$port=_ref.port,port=_ref$port===void 0?443:_ref$port,_ref$url=_ref.url,url=_ref$url===void 0?"https://".concat(username,":").concat(password,"@").concat(host):_ref$url,apikey=_ref.apikey,iam_apikey_name=_ref.iam_apikey_name,iam_apikey_description=_ref.iam_apikey_description,iam_role_crn=_ref.iam_role_crn,iam_serviceid_crn=_ref.iam_serviceid_crn;return this.createService({name:name,description:description,type:"cloudant",credentials:{username:username,password:password,host:host,port:port,url:url,apikey:apikey,iam_apikey_name:iam_apikey_name,iam_apikey_description:iam_apikey_description,iam_role_crn:iam_role_crn,iam_serviceid_crn:iam_serviceid_crn}})}},{key:"createEventstreamsService",value:function createEventstreamsService(_ref2){var name=_ref2.name,description=_ref2.description,api_key=_ref2.api_key,kafka_admin_url=_ref2.kafka_admin_url,kafka_brokers_sasl=_ref2.kafka_brokers_sasl,user=_ref2.user,password=_ref2.password,apikey=_ref2.apikey,iam_apikey_name=_ref2.iam_apikey_name,iam_apikey_description=_ref2.iam_apikey_description,iam_role_crn=_ref2.iam_role_crn,iam_serviceid_crn=_ref2.iam_serviceid_crn;return this.createService({name:name,description:description,type:"eventstreams",credentials:{api_key:api_key,kafka_admin_url:kafka_admin_url,kafka_brokers_sasl:kafka_brokers_sasl,user:user,password:password,apikey:apikey,iam_apikey_name:iam_apikey_name,iam_apikey_description:iam_apikey_description,iam_role_crn:iam_role_crn,iam_serviceid_crn:iam_serviceid_crn}})}},{key:"getService",value:function getService(serviceId){return this.apiClient.callApi("GET",200,true,["s2s","services",serviceId])["catch"]((function(err){return errors.handleError(err,{CUDSS0019E:errors.ServiceNotFound})}))}},{key:"getServices",value:function getServices(serviceType){return this.apiClient.callApi("GET",200,true,["s2s","services"],null,{bindingMode:"manual",serviceType:serviceType})["catch"]((function(err){return errors.handleError(err,{})}))}},{key:"deleteService",value:function deleteService(serviceId){return this.apiClient.callApi("DELETE",204,false,["s2s","services",serviceId])["catch"]((function(err){return errors.handleError(err,{})}))}},{key:"createConnector",value:function createConnector(_ref3){var name=_ref3.name,type=_ref3.type,_ref3$description=_ref3.description,description=_ref3$description===void 0?undefined:_ref3$description,serviceId=_ref3.serviceId,_ref3$timezone=_ref3.timezone,timezone=_ref3$timezone===void 0?"UTC":_ref3$timezone,_ref3$enabled=_ref3.enabled,enabled=_ref3$enabled===void 0?true:_ref3$enabled;return this.apiClient.callApi("POST",201,true,["historianconnectors"],{name:name,description:description,type:type,serviceId:serviceId,timezone:timezone,enabled:enabled})["catch"]((function(err){return errors.handleError(err,{})}))}},{key:"updateConnector",value:function updateConnector(_ref4){var id=_ref4.id,name=_ref4.name,description=_ref4.description,serviceId=_ref4.serviceId,type=_ref4.type,enabled=_ref4.enabled,timezone=_ref4.timezone;return this.apiClient.callApi("PUT",200,true,["historianconnectors",id],{id:id,name:name,description:description,serviceId:serviceId,type:type,enabled:enabled,timezone:timezone})["catch"]((function(err){return errors.handleError(err,{})}))}},{key:"getConnectors",value:function getConnectors(_ref5){var name=_ref5.name,serviceType=_ref5.serviceType,enabled=_ref5.enabled,serviceId=_ref5.serviceId;return this.apiClient.callApi("GET",200,true,["historianconnectors"],null,{name:name?name:undefined,type:serviceType?serviceType:undefined,enabled:enabled===undefined?undefined:enabled,serviceId:serviceId?serviceId:undefined})["catch"]((function(err){return errors.handleError(err,{})}))}},{key:"deleteConnector",value:function deleteConnector(connectorId){return this.apiClient.callApi("DELETE",204,false,["historianconnectors",connectorId])["catch"]((function(err){return errors.handleError(err,{})}))}},{key:"createDestination",value:function createDestination(connectorId,destination){return this.apiClient.callApi("POST",201,true,["historianconnectors",connectorId,"destinations"],destination)["catch"]((function(err){return errors.handleError(err,{CUDDSC0103E:errors.DestinationAlreadyExists})}))}},{key:"createCloudantDestination",value:function createCloudantDestination(connectorId,_ref6){var name=_ref6.name,bucketInterval=_ref6.bucketInterval;return this.createDestination(connectorId,{name:name,type:"cloudant",configuration:{bucketInterval:bucketInterval}})}},{key:"createEventstreamsDestination",value:function createEventstreamsDestination(connectorId,_ref7){var name=_ref7.name,_ref7$partitions=_ref7.partitions,partitions=_ref7$partitions===void 0?1:_ref7$partitions;return this.createDestination(connectorId,{name:name,type:"eventstreams",configuration:{partitions:partitions}})}},{key:"getDestinations",value:function getDestinations(connectorId){var params=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{name:undefined};var name=params.name;return this.apiClient.callApi("GET",200,true,["historianconnectors",connectorId,"destinations"],null,{name:name?name:undefined})["catch"]((function(err){return errors.handleError(err,{})}))}},{key:"deleteDestination",value:function deleteDestination(connectorId,destinationName){return this.apiClient.callApi("DELETE",[200,204],false,["historianconnectors",connectorId,"destinations",destinationName])["catch"]((function(err){return errors.handleError(err,{})}))}},{key:"createForwardingRule",value:function createForwardingRule(connectorId,forwardingrule){return this.apiClient.callApi("POST",201,true,["historianconnectors",connectorId,"forwardingrules"],forwardingrule)["catch"]((function(err){return errors.handleError(err,{})}))}},{key:"createEventForwardingRule",value:function createEventForwardingRule(connectorId,_ref8){var name=_ref8.name,destinationName=_ref8.destinationName,_ref8$deviceType=_ref8.deviceType,deviceType=_ref8$deviceType===void 0?"*":_ref8$deviceType,_ref8$eventId=_ref8.eventId,eventId=_ref8$eventId===void 0?"*":_ref8$eventId;return this.createForwardingRule(connectorId,{name:name,destinationName:destinationName,type:"event",selector:{deviceType:deviceType,eventId:eventId}})}},{key:"getForwardingRules",value:function getForwardingRules(connectorId){return this.apiClient.callApi("GET",200,true,["historianconnectors",connectorId,"forwardingrules"])["catch"]((function(err){return errors.handleError(err,{})}))}},{key:"deleteForwardingRule",value:function deleteForwardingRule(connectorId,forwardingRuleId){return this.apiClient.callApi("DELETE",204,false,["historianconnectors",connectorId,"forwardingrules",forwardingRuleId])["catch"]((function(err){return errors.handleError(err,{})}))}}])}()},{"./ApiErrors":300,loglevel:138}],302:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _loglevel=_interopRequireDefault(require("loglevel"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var LecClient=exports["default"]=function(){function LecClient(apiClient){_classCallCheck(this,LecClient);this.log=_loglevel["default"];this.apiClient=apiClient;this.callApi=this.apiClient.callApi.bind(this.apiClient)}return _createClass(LecClient,[{key:"getLastEvents",value:function getLastEvents(type,id){this.log.debug("[ApiClient] getLastEvents() - event cache");return this.callApi("GET",200,true,["device","types",type,"devices",id,"events"],null)}},{key:"getLastEventsByEventType",value:function getLastEventsByEventType(type,id,eventType){this.log.debug("[ApiClient] getLastEventsByEventType() - event cache");return this.callApi("GET",200,true,["device","types",type,"devices",id,"events",eventType],null)}}])}()},{loglevel:138}],303:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _loglevel=_interopRequireDefault(require("loglevel"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var MgmtClient=exports["default"]=function(){function MgmtClient(apiClient){_classCallCheck(this,MgmtClient);this.log=_loglevel["default"];this.apiClient=apiClient;this.callApi=this.apiClient.callApi.bind(this.apiClient)}return _createClass(MgmtClient,[{key:"getAllDeviceManagementRequests",value:function getAllDeviceManagementRequests(){this.log.debug("[ApiClient] getAllDeviceManagementRequests()");return this.callApi("GET",200,true,["mgmt","requests"],null)}},{key:"initiateDeviceManagementRequest",value:function initiateDeviceManagementRequest(action,parameters,devices){this.log.debug("[ApiClient] initiateDeviceManagementRequest("+action+", "+parameters+", "+devices+")");var body={action:action,parameters:parameters,devices:devices};return this.callApi("POST",202,true,["mgmt","requests"],JSON.stringify(body))}},{key:"getDeviceManagementRequest",value:function getDeviceManagementRequest(requestId){this.log.debug("[ApiClient] getDeviceManagementRequest("+requestId+")");return this.callApi("GET",200,true,["mgmt","requests",requestId],null)}},{key:"deleteDeviceManagementRequest",value:function deleteDeviceManagementRequest(requestId){this.log.debug("[ApiClient] deleteDeviceManagementRequest("+requestId+")");return this.callApi("DELETE",204,false,["mgmt","requests",requestId],null)}},{key:"getDeviceManagementRequestStatus",value:function getDeviceManagementRequestStatus(requestId){this.log.debug("[ApiClient] getDeviceManagementRequestStatus("+requestId+")");return this.callApi("GET",200,true,["mgmt","requests",requestId,"deviceStatus"],null)}},{key:"getDeviceManagementRequestStatusByDevice",value:function getDeviceManagementRequestStatusByDevice(requestId,typeId,deviceId){this.log.debug("[ApiClient] getDeviceManagementRequestStatusByDevice("+requestId+", "+typeId+", "+deviceId+")");return this.callApi("GET",200,true,["mgmt","requests",requestId,"deviceStatus",typeId,deviceId],null)}}])}()},{loglevel:138}],304:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var RegistryClient=exports["default"]=function(){function RegistryClient(apiClient){_classCallCheck(this,RegistryClient);this.apiClient=apiClient}return _createClass(RegistryClient,[{key:"listAllDevicesOfType",value:function listAllDevicesOfType(type){this.apiClient.log.debug("[ApiClient] listAllDevicesOfType("+type+")");return this.apiClient.callApi("GET",200,true,["device","types",type,"devices"],null)}},{key:"deleteDeviceType",value:function deleteDeviceType(type){this.apiClient.log.debug("[ApiClient] deleteDeviceType("+type+")");return this.apiClient.callApi("DELETE",204,false,["device","types",type],null)}},{key:"getDeviceType",value:function getDeviceType(type){this.apiClient.log.debug("[ApiClient] getDeviceType("+type+")");return this.apiClient.callApi("GET",200,true,["device","types",type],null)}},{key:"getAllDeviceTypes",value:function getAllDeviceTypes(){this.apiClient.log.debug("[ApiClient] getAllDeviceTypes()");return this.apiClient.callApi("GET",200,true,["device","types"],null)}},{key:"updateDeviceType",value:function updateDeviceType(type,description,deviceInfo,metadata){this.apiClient.log.debug("[ApiClient] updateDeviceType("+type+", "+description+", "+deviceInfo+", "+metadata+")");var body={deviceInfo:deviceInfo,description:description,metadata:metadata};return this.apiClient.callApi("PUT",200,true,["device","types",type],JSON.stringify(body))}},{key:"registerDeviceType",value:function registerDeviceType(typeId,description,deviceInfo,metadata,classId){this.apiClient.log.debug("[ApiClient] registerDeviceType("+typeId+", "+description+", "+deviceInfo+", "+metadata+", "+classId+")");classId=classId||"Device";var body={id:typeId,classId:classId,deviceInfo:deviceInfo,description:description,metadata:metadata};return this.apiClient.callApi("POST",201,true,["device","types"],JSON.stringify(body))}},{key:"registerDevice",value:function registerDevice(type,deviceId,authToken,deviceInfo,location,metadata){this.apiClient.log.debug("[ApiClient] registerDevice("+type+", "+deviceId+", "+deviceInfo+", "+location+", "+metadata+")");var body={deviceId:deviceId,authToken:authToken,deviceInfo:deviceInfo,location:location,metadata:metadata};return this.apiClient.callApi("POST",201,true,["device","types",type,"devices"],JSON.stringify(body))}},{key:"unregisterDevice",value:function unregisterDevice(type,deviceId){this.apiClient.log.debug("[ApiClient] unregisterDevice("+type+", "+deviceId+")");return this.apiClient.callApi("DELETE",204,false,["device","types",type,"devices",deviceId],null)}},{key:"updateDevice",value:function updateDevice(type,deviceId,deviceInfo,status,metadata,extensions){this.apiClient.log.debug("[ApiClient] updateDevice("+type+", "+deviceId+", "+deviceInfo+", "+status+", "+metadata+")");var body={deviceInfo:deviceInfo,status:status,metadata:metadata,extensions:extensions};return this.apiClient.callApi("PUT",200,true,["device","types",type,"devices",deviceId],JSON.stringify(body))}},{key:"getDevice",value:function getDevice(type,deviceId){this.apiClient.log.debug("[ApiClient] getDevice("+type+", "+deviceId+")");return this.apiClient.callApi("GET",200,true,["device","types",type,"devices",deviceId],null)}},{key:"registerMultipleDevices",value:function registerMultipleDevices(arryOfDevicesToBeAdded){this.apiClient.log.debug("[ApiClient] arryOfDevicesToBeAdded() - BULK");return this.apiClient.callApi("POST",201,true,["bulk","devices","add"],JSON.stringify(arryOfDevicesToBeAdded))}},{key:"deleteMultipleDevices",value:function deleteMultipleDevices(arryOfDevicesToBeDeleted){this.apiClient.log.debug("[ApiClient] deleteMultipleDevices() - BULK");return this.apiClient.callApi("POST",201,true,["bulk","devices","remove"],JSON.stringify(arryOfDevicesToBeDeleted))}},{key:"getDeviceLocation",value:function getDeviceLocation(type,deviceId){this.apiClient.log.debug("[ApiClient] getDeviceLocation("+type+", "+deviceId+")");return this.apiClient.callApi("GET",200,true,["device","types",type,"devices",deviceId,"location"],null)}},{key:"updateDeviceLocation",value:function updateDeviceLocation(type,deviceId,location){this.apiClient.log.debug("[ApiClient] updateDeviceLocation("+type+", "+deviceId+", "+location+")");return this.apiClient.callApi("PUT",200,true,["device","types",type,"devices",deviceId,"location"],JSON.stringify(location))}},{key:"getDeviceManagementInformation",value:function getDeviceManagementInformation(type,deviceId){this.apiClient.log.debug("[ApiClient] getDeviceManagementInformation("+type+", "+deviceId+")");return this.apiClient.callApi("GET",200,true,["device","types",type,"devices",deviceId,"mgmt"],null)}},{key:"getAllDiagnosticLogs",value:function getAllDiagnosticLogs(type,deviceId){this.apiClient.log.debug("[ApiClient] getAllDiagnosticLogs("+type+", "+deviceId+")");return this.apiClient.callApi("GET",200,true,["device","types",type,"devices",deviceId,"diag","logs"],null)}},{key:"clearAllDiagnosticLogs",value:function clearAllDiagnosticLogs(type,deviceId){this.apiClient.log.debug("[ApiClient] clearAllDiagnosticLogs("+type+", "+deviceId+")");return this.apiClient.callApi("DELETE",204,false,["device","types",type,"devices",deviceId,"diag","logs"],null)}},{key:"addDeviceDiagLogs",value:function addDeviceDiagLogs(type,deviceId,log){this.apiClient.log.debug("[ApiClient] addDeviceDiagLogs("+type+", "+deviceId+", "+log+")");return this.apiClient.callApi("POST",201,false,["device","types",type,"devices",deviceId,"diag","logs"],JSON.stringify(log))}},{key:"getDiagnosticLog",value:function getDiagnosticLog(type,deviceId,logId){this.apiClient.log.debug("[ApiClient] getAllDiagnosticLogs("+type+", "+deviceId+", "+logId+")");return this.apiClient.callApi("GET",200,true,["device","types",type,"devices",deviceId,"diag","logs",logId],null)}},{key:"deleteDiagnosticLog",value:function deleteDiagnosticLog(type,deviceId,logId){this.apiClient.log.debug("[ApiClient] deleteDiagnosticLog("+type+", "+deviceId+", "+logId+")");return this.apiClient.callApi("DELETE",204,false,["device","types",type,"devices",deviceId,"diag","logs",logId],null)}},{key:"getDeviceErrorCodes",value:function getDeviceErrorCodes(type,deviceId){this.apiClient.log.debug("[ApiClient] getDeviceErrorCodes("+type+", "+deviceId+")");return this.apiClient.callApi("GET",200,true,["device","types",type,"devices",deviceId,"diag","errorCodes"],null)}},{key:"clearDeviceErrorCodes",value:function clearDeviceErrorCodes(type,deviceId){this.apiClient.log.debug("[ApiClient] clearDeviceErrorCodes("+type+", "+deviceId+")");return this.apiClient.callApi("DELETE",204,false,["device","types",type,"devices",deviceId,"diag","errorCodes"],null)}},{key:"addErrorCode",value:function addErrorCode(type,deviceId,log){this.apiClient.log.debug("[ApiClient] addErrorCode("+type+", "+deviceId+", "+log+")");return this.apiClient.callApi("POST",201,false,["device","types",type,"devices",deviceId,"diag","errorCodes"],JSON.stringify(log))}},{key:"getDeviceConnectionLogs",value:function getDeviceConnectionLogs(typeId,deviceId){this.apiClient.log.debug("[ApiClient] getDeviceConnectionLogs("+typeId+", "+deviceId+")");var params={typeId:typeId,deviceId:deviceId};return this.apiClient.callApi("GET",200,true,["logs","connection"],null,params)}}])}()},{}],305:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _loglevel=_interopRequireDefault(require("loglevel"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var RulesClient=exports["default"]=function(){function RulesClient(apiClient){_classCallCheck(this,RulesClient);this.log=_loglevel["default"];this.apiClient=apiClient;this.callApi=this.apiClient.callApi.bind(this.apiClient)}return _createClass(RulesClient,[{key:"getRulesForLogicalInterface",value:function getRulesForLogicalInterface(logicalInterfaceId){if(this.draftMode){return this.getRulesForLogicalInterface(logicalInterfaceId)}else{return this.getActiveRulesForLogicalInterface(logicalInterfaceId)}}},{key:"getDraftRulesForLogicalInterface",value:function getDraftRulesForLogicalInterface(logicalInterfaceId){return this.callApi("GET",200,true,["draft","logicalinterfaces",logicalInterfaceId,"rules"])}},{key:"getActiveRulesForLogicalInterface",value:function getActiveRulesForLogicalInterface(logicalInterfaceId){return this.callApi("GET",200,true,["logicalinterfaces",logicalInterfaceId,"rules"])}},{key:"createRule",value:function createRule(logicalInterfaceId,name,condition){var description=arguments.length>3&&arguments[3]!==undefined?arguments[3]:undefined;var notificationStrategy=arguments.length>4&&arguments[4]!==undefined?arguments[4]:RulesClient.RuleNotificationStrategy.EVERY_TIME();var body={name:name,condition:condition,notificationStrategy:notificationStrategy};if(description)body["description"]=description;var base=this.draftMode?["draft","logicalinterfaces",logicalInterfaceId,"rules"]:["logicalinterfaces",logicalInterfaceId,"rules"];return this.callApi("POST",201,true,base,JSON.stringify(body))}},{key:"updateRule",value:function updateRule(rule){var base=this.draftMode?["draft","logicalinterfaces",rule.logicalInterfaceId,"rules",rule.id]:["logicalinterfaces",rule.logicalInterfaceId,"rules",rule.id];return this.callApi("PUT",200,true,base,JSON.stringify(rule))}},{key:"deleteRule",value:function deleteRule(logicalInterfaceId,ruleId){var base=this.draftMode?["draft","logicalinterfaces",logicalInterfaceId,"rules",ruleId]:["logicalinterfaces",logicalInterfaceId,"rules",ruleId];return this.callApi("DELETE",204,false,base)}}])}();RulesClient.RuleNotificationStrategy={EVERY_TIME:function EVERY_TIME(){return{when:"every-time"}},BECOMES_TRUE:function BECOMES_TRUE(){return{when:"becomes-true"}},X_IN_Y:function X_IN_Y(count){return{when:"x-in-y",count:count}},PERSISTS:function PERSISTS(count,timePeriod){return{when:"persists",count:count,timePeriod:timePeriod}}}},{loglevel:138}],306:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _loglevel=_interopRequireDefault(require("loglevel"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}var StateClient=exports["default"]=function(){function StateClient(apiClient){_classCallCheck(this,StateClient);this.log=_loglevel["default"];this.apiClient=apiClient;this.draftMode=true;this.callApi=this.apiClient.callApi.bind(this.apiClient);this.parseSortSpec=this.apiClient.parseSortSpec.bind(this.apiClient);this.callFormDataApi=this.apiClient.callFormDataApi.bind(this.apiClient);this.invalidOperation=this.apiClient.invalidOperation.bind(this.apiClient)}return _createClass(StateClient,[{key:"workWithActive",value:function workWithActive(){this.draftMode=false}},{key:"workWithDraft",value:function workWithDraft(){this.draftMode=true}},{key:"createSchema",value:function createSchema(schemaContents,name,description){var body={schemaFile:schemaContents,schemaType:"json-schema",name:name};if(description){body.description=description}var base=this.draftMode?["draft","schemas"]:["schemas"];return this.callFormDataApi("POST",201,true,base,body,null)}},{key:"getSchema",value:function getSchema(schemaId){var base=this.draftMode?["draft","schemas",schemaId]:["schemas",schemaId];return this.callApi("GET",200,true,base)}},{key:"getActiveSchema",value:function getActiveSchema(schemaId){return this.callApi("GET",200,true,["schemas",schemaId])}},{key:"getSchemas",value:function getSchemas(){var base=this.draftMode?["draft","schemas"]:["schemas"];return this.callApi("GET",200,true,base)}},{key:"getActiveSchemas",value:function getActiveSchemas(){return this.callApi("GET",200,true,["schemas"])}},{key:"updateSchema",value:function updateSchema(schemaId,name,description){var body={id:schemaId,name:name,description:description};var base=this.draftMode?["draft","schemas",schemaId]:["schemas",schemaId];return this.callApi("PUT",200,true,base,body)}},{key:"updateSchemaContent",value:function updateSchemaContent(schemaId,schemaContents,filename){var body={schemaFile:schemaContents,name:filename};var base=this.draftMode?["draft","schemas",schemaId,"content"]:["schemas",schemaId,"content"];return this.callFormDataApi("PUT",204,false,base,body,null)}},{key:"getSchemaContent",value:function getSchemaContent(schemaId){var base=this.draftMode?["draft","schemas",schemaId,"content"]:["schemas",schemaId,"content"];return this.callApi("GET",200,true,base)}},{key:"getActiveSchemaContent",value:function getActiveSchemaContent(schemaId){return this.callApi("GET",200,true,["schemas",schemaId,"content"])}},{key:"deleteSchema",value:function deleteSchema(schemaId){var base=this.draftMode?["draft","schemas",schemaId]:["schemas",schemaId];return this.callApi("DELETE",204,false,base,null)}},{key:"createEventType",value:function createEventType(name,description,schemaId){var body={name:name,description:description,schemaId:schemaId};var base=this.draftMode?["draft","event","types"]:["event","types"];return this.callApi("POST",201,true,base,JSON.stringify(body))}},{key:"getEventType",value:function getEventType(eventTypeId){var base=this.draftMode?["draft","event","types",eventTypeId]:["event","types",eventTypeId];return this.callApi("GET",200,true,base)}},{key:"getActiveEventType",value:function getActiveEventType(eventTypeId){return this.callApi("GET",200,true,["event","types",eventTypeId])}},{key:"deleteEventType",value:function deleteEventType(eventTypeId){var base=this.draftMode?["draft","event","types",eventTypeId]:["event","types",eventTypeId];return this.callApi("DELETE",204,false,base)}},{key:"updateEventType",value:function updateEventType(eventTypeId,name,description,schemaId){var body={id:eventTypeId,name:name,description:description,schemaId:schemaId};var base=this.draftMode?["draft","event","types",eventTypeId]:["event","types",eventTypeId];return this.callApi("PUT",200,true,base,body)}},{key:"getEventTypes",value:function getEventTypes(){var base=this.draftMode?["draft","event","types"]:["event","types"];return this.callApi("GET",200,true,base)}},{key:"getActiveEventTypes",value:function getActiveEventTypes(){return this.callApi("GET",200,true,["event","types"])}},{key:"createPhysicalInterface",value:function createPhysicalInterface(name,description){var body={name:name,description:description};var base=this.draftMode?["draft","physicalinterfaces"]:["physicalinterfaces"];return this.callApi("POST",201,true,base,body)}},{key:"getPhysicalInterface",value:function getPhysicalInterface(physicalInterfaceId){var base=this.draftMode?["draft","physicalinterfaces",physicalInterfaceId]:["physicalinterfaces",physicalInterfaceId];return this.callApi("GET",200,true,base)}},{key:"getActivePhysicalInterface",value:function getActivePhysicalInterface(physicalInterfaceId){return this.callApi("GET",200,true,["physicalinterfaces",physicalInterfaceId])}},{key:"deletePhysicalInterface",value:function deletePhysicalInterface(physicalInterfaceId){var base=this.draftMode?["draft","physicalinterfaces",physicalInterfaceId]:["physicalinterfaces",physicalInterfaceId];return this.callApi("DELETE",204,false,base)}},{key:"updatePhysicalInterface",value:function updatePhysicalInterface(physicalInterfaceId,name,description){var body={id:physicalInterfaceId,name:name,description:description};var base=this.draftMode?["draft","physicalinterfaces",physicalInterfaceId]:["physicalinterfaces",physicalInterfaceId];return this.callApi("PUT",200,true,base,body)}},{key:"getPhysicalInterfaces",value:function getPhysicalInterfaces(){var base=this.draftMode?["draft","physicalinterfaces"]:["physicalinterfaces"];return this.callApi("GET",200,true,base)}},{key:"getActivePhysicalInterfaces",value:function getActivePhysicalInterfaces(){return this.callApi("GET",200,true,["physicalinterfaces"])}},{key:"createPhysicalInterfaceEventMapping",value:function createPhysicalInterfaceEventMapping(physicalInterfaceId,eventId,eventTypeId){var body={eventId:eventId,eventTypeId:eventTypeId};var base=this.draftMode?["draft","physicalinterfaces",physicalInterfaceId,"events"]:["physicalinterfaces",physicalInterfaceId,"events"];return this.callApi("POST",201,true,base,body)}},{key:"getPhysicalInterfaceEventMappings",value:function getPhysicalInterfaceEventMappings(physicalInterfaceId){var base=this.draftMode?["draft","physicalinterfaces",physicalInterfaceId,"events"]:["physicalinterfaces",physicalInterfaceId,"events"];return this.callApi("GET",200,true,base)}},{key:"getActivePhysicalInterfaceEventMappings",value:function getActivePhysicalInterfaceEventMappings(physicalInterfaceId){return this.callApi("GET",200,true,["physicalinterfaces",physicalInterfaceId,"events"])}},{key:"deletePhysicalInterfaceEventMapping",value:function deletePhysicalInterfaceEventMapping(physicalInterfaceId,eventId){var base=this.draftMode?["draft","physicalinterfaces",physicalInterfaceId,"events",eventId]:["physicalinterfaces",physicalInterfaceId,"events",eventId];return this.callApi("DELETE",204,false,base)}},{key:"createLogicalInterface",value:function createLogicalInterface(name,description,schemaId,alias){var body={name:name,description:description,schemaId:schemaId};if(alias!==undefined){body.alias=alias}var base=this.draftMode?["draft","logicalinterfaces"]:["applicationinterfaces"];return this.callApi("POST",201,true,base,body)}},{key:"getLogicalInterface",value:function getLogicalInterface(logicalInterfaceId){var base=this.draftMode?["draft","logicalinterfaces",logicalInterfaceId]:["applicationinterfaces",logicalInterfaceId];return this.callApi("GET",200,true,base)}},{key:"getActiveLogicalInterface",value:function getActiveLogicalInterface(logicalInterfaceId){return this.callApi("GET",200,true,["logicalinterfaces",logicalInterfaceId])}},{key:"deleteLogicalInterface",value:function deleteLogicalInterface(logicalInterfaceId){var base=this.draftMode?["draft","logicalinterfaces",logicalInterfaceId]:["applicationinterfaces",logicalInterfaceId];return this.callApi("DELETE",204,false,base)}},{key:"updateLogicalInterface",value:function updateLogicalInterface(logicalInterfaceId,name,description,schemaId,alias){var body={id:logicalInterfaceId,name:name,description:description,schemaId:schemaId};if(alias!==undefined){body.alias=alias}var base=this.draftMode?["draft","logicalinterfaces",logicalInterfaceId]:["applicationinterfaces",logicalInterfaceId];return this.callApi("PUT",200,true,base,body)}},{key:"getLogicalInterfaces",value:function getLogicalInterfaces(bookmark,limit,sort,name){var base=this.draftMode?["draft","logicalinterfaces"]:["logicalinterfaces"];var _sort=this.parseSortSpec(sort);return this.callApi("GET",200,true,base,undefined,{_bookmark:bookmark,_limit:limit,_sort:_sort,name:name?name:undefined})}},{key:"getActiveLogicalInterfaces",value:function getActiveLogicalInterfaces(){return this.callApi("GET",200,true,["logicalinterfaces"])}},{key:"patchOperationLogicalInterface",value:function patchOperationLogicalInterface(logicalInterfaceId,operationId){var body={operation:operationId};if(this.draftMode){switch(operationId){case"validate-configuration":return this.callApi("PATCH",200,true,["draft","logicalinterfaces",logicalInterfaceId],body);case"activate-configuration":return this.callApi("PATCH",202,true,["draft","logicalinterfaces",logicalInterfaceId],body);case"deactivate-configuration":return this.callApi("PATCH",202,true,["draft","logicalinterfaces",logicalInterfaceId],body);case"list-differences":return this.callApi("PATCH",200,true,["draft","logicalinterfaces",logicalInterfaceId],body);default:return this.callApi("PATCH",200,true,["draft","logicalinterfaces",logicalInterfaceId],body)}}else{return this.invalidOperation("PATCH operation not allowed on active logical interface")}}},{key:"patchOperationActiveLogicalInterface",value:function patchOperationActiveLogicalInterface(logicalInterfaceId,operationId){var body={operation:operationId};if(this.draftMode){return this.callApi("PATCH",202,true,["logicalinterfaces",logicalInterfaceId],body)}else{return this.invalidOperation("PATCH operation 'deactivate-configuration' not allowed on logical interface")}}},{key:"patchOperationDeviceType",value:function patchOperationDeviceType(typeId,operationId){if(!operationId){return invalidOperation("PATCH operation is not allowed. Operation id is expected")}var body={operation:operationId};var base=this.draftMode?["draft","device","types",typeId]:["device","types",typeId];if(this.draftMode){switch(operationId){case"validate-configuration":return this.callApi("PATCH",200,true,base,body);break;case"activate-configuration":return this.callApi("PATCH",202,true,base,body);break;case"deactivate-configuration":return this.callApi("PATCH",202,true,base,body);break;case"list-differences":return this.callApi("PATCH",200,true,base,body);break;default:return this.invalidOperation("PATCH operation is not allowed. Invalid operation id")}}else{switch(operationId){case"validate-configuration":return this.callApi("PATCH",200,true,base,body);break;case"deploy-configuration":return this.callApi("PATCH",202,true,base,body);break;case"remove-deployed-configuration":return this.callApi("PATCH",202,true,base,body);break;case"list-differences":return this.invalidOperation("PATCH operation 'list-differences' is not allowed");break;default:return this.invalidOperation("PATCH operation is not allowed. Invalid operation id")}}}},{key:"createDeviceType",value:function createDeviceType(typeId,description,deviceInfo,metadata,classId,physicalInterfaceId){this.log.debug("[ApiClient] registerDeviceType("+typeId+", "+description+", "+deviceInfo+", "+metadata+", "+classId+", "+physicalInterfaceId+")");classId=classId||"Device";var body={id:typeId,classId:classId,deviceInfo:deviceInfo,description:description,metadata:metadata,physicalInterfaceId:physicalInterfaceId};return this.callApi("POST",201,true,["device","types"],JSON.stringify(body))}},{key:"getDeviceTypesByLogicalInterfaceId",value:function getDeviceTypesByLogicalInterfaceId(logicalInterfaceId){var bookmark=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var limit=arguments.length>2&&arguments[2]!==undefined?arguments[2]:10;if(this.draftMode){return this.callApi("GET",200,true,["draft","device","types"],null,{logicalInterfaceId:logicalInterfaceId,_bookmark:bookmark,_limit:limit})}else{return this.callApi("GET",200,true,["device","types"],null,{_bookmark:bookmark,_limit:limit})}}},{key:"createDeviceTypePhysicalInterfaceAssociation",value:function createDeviceTypePhysicalInterfaceAssociation(typeId,physicalInterfaceId){var body={id:physicalInterfaceId};if(this.draftMode){return this.callApi("POST",201,true,["draft","device","types",typeId,"physicalinterface"],JSON.stringify(body))}else{return this.callApi("PUT",200,true,["device","types",typeId],JSON.stringify({physicalInterfaceId:physicalInterfaceId}))}}},{key:"getDeviceTypePhysicalInterfaces",value:function getDeviceTypePhysicalInterfaces(typeId){if(this.draftMode){return this.callApi("GET",200,true,["draft","device","types",typeId,"physicalinterface"])}else{return this.invalidOperation("GET Device type's physical interface is not allowed")}}},{key:"getActiveDeviceTypePhysicalInterfaces",value:function getActiveDeviceTypePhysicalInterfaces(typeId){return this.callApi("GET",200,true,["device","types",typeId,"physicalinterface"])}},{key:"deleteDeviceTypePhysicalInterfaceAssociation",value:function deleteDeviceTypePhysicalInterfaceAssociation(typeId){if(this.draftMode){return this.callApi("DELETE",204,false,["draft","device","types",typeId,"physicalinterface"])}else{return this.invalidOperation("DELETE Device type's physical interface is not allowed")}}},{key:"createDeviceTypeLogicalInterfaceAssociation",value:function createDeviceTypeLogicalInterfaceAssociation(typeId,logicalInterfaceId){var body={id:logicalInterfaceId};var base=this.draftMode?["draft","device","types",typeId,"logicalinterfaces"]:["device","types",typeId,"applicationinterfaces"];return this.callApi("POST",201,true,base,body)}},{key:"getDeviceTypeLogicalInterfaces",value:function getDeviceTypeLogicalInterfaces(typeId){var base=this.draftMode?["draft","device","types",typeId,"logicalinterfaces"]:["device","types",typeId,"applicationinterfaces"];return this.callApi("GET",200,true,base)}},{key:"getActiveDeviceTypeLogicalInterfaces",value:function getActiveDeviceTypeLogicalInterfaces(typeId){return this.callApi("GET",200,true,["device","types",typeId,"logicalinterfaces"])}},{key:"createDeviceTypeLogicalInterfacePropertyMappings",value:function createDeviceTypeLogicalInterfacePropertyMappings(typeId,logicalInterfaceId,mappings,notificationStrategy){var body=null,base=null;if(this.draftMode){body={logicalInterfaceId:logicalInterfaceId,propertyMappings:mappings,notificationStrategy:"never"};if(notificationStrategy){body.notificationStrategy=notificationStrategy}base=["draft","device","types",typeId,"mappings"]}else{body={applicationInterfaceId:logicalInterfaceId,propertyMappings:mappings};base=["device","types",typeId,"mappings"]}return this.callApi("POST",201,true,base,body)}},{key:"getDeviceTypePropertyMappings",value:function getDeviceTypePropertyMappings(typeId){var base=this.draftMode?["draft","device","types",typeId,"mappings"]:["device","types",typeId,"mappings"];return this.callApi("GET",200,true,base)}},{key:"getActiveDeviceTypePropertyMappings",value:function getActiveDeviceTypePropertyMappings(typeId){return this.callApi("GET",200,true,["device","types",typeId,"mappings"])}},{key:"getDeviceTypeLogicalInterfacePropertyMappings",value:function getDeviceTypeLogicalInterfacePropertyMappings(typeId,logicalInterfaceId){var base=this.draftMode?["draft","device","types",typeId,"mappings",logicalInterfaceId]:["device","types",typeId,"mappings",logicalInterfaceId];return this.callApi("GET",200,true,base)}},{key:"getActiveDeviceTypeLogicalInterfacePropertyMappings",value:function getActiveDeviceTypeLogicalInterfacePropertyMappings(typeId,logicalInterfaceId){return this.callApi("GET",200,true,["device","types",typeId,"mappings",logicalInterfaceId])}},{key:"updateDeviceTypeLogicalInterfacePropertyMappings",value:function updateDeviceTypeLogicalInterfacePropertyMappings(typeId,logicalInterfaceId,mappings,notificationStrategy){var body=null,base=null;if(this.draftMode){body={logicalInterfaceId:logicalInterfaceId,propertyMappings:mappings,notificationStrategy:"never"};if(notificationStrategy){body.notificationStrategy=notificationStrategy}base=["draft","device","types",typeId,"mappings",logicalInterfaceId]}else{body={applicationInterfaceId:logicalInterfaceId,propertyMappings:mappings};base=["device","types",typeId,"mappings",logicalInterfaceId]}return this.callApi("PUT",200,false,base,body)}},{key:"deleteDeviceTypeLogicalInterfacePropertyMappings",value:function deleteDeviceTypeLogicalInterfacePropertyMappings(typeId,logicalInterfaceId){var base=this.draftMode?["draft","device","types",typeId,"mappings",logicalInterfaceId]:["device","types",typeId,"mappings",logicalInterfaceId];return this.callApi("DELETE",204,false,base)}},{key:"deleteDeviceTypeLogicalInterfaceAssociation",value:function deleteDeviceTypeLogicalInterfaceAssociation(typeId,logicalInterfaceId){var base=this.draftMode?["draft","device","types",typeId,"logicalinterfaces",logicalInterfaceId]:["device","types",typeId,"applicationinterfaces",logicalInterfaceId];return this.callApi("DELETE",204,false,base)}},{key:"patchOperationActiveDeviceType",value:function patchOperationActiveDeviceType(typeId,operationId){var body={operation:operationId};if(this.draftMode){return this.callApi("PATCH",202,true,["device","types",typeId],body)}else{return this.invalidOperation("PATCH operation 'deactivate-configuration' is not allowed")}}},{key:"getDeviceTypeDeployedConfiguration",value:function getDeviceTypeDeployedConfiguration(typeId){if(this.draftMode){return this.invalidOperation("GET deployed configuration is not allowed")}else{return this.callApi("GET",200,true,["device","types",typeId,"deployedconfiguration"])}}},{key:"getDeviceState",value:function getDeviceState(typeId,deviceId,logicalInterfaceId){return this.callApi("GET",200,true,["device","types",typeId,"devices",deviceId,"state",logicalInterfaceId])}},{key:"createSchemaAndEventType",value:function createSchemaAndEventType(schemaContents,schemaFileName,eventTypeName,eventDescription){var _this=this;var body={schemaFile:schemaContents,schemaType:"json-schema",name:schemaFileName};var createSchema=new Promise((function(resolve,reject){var base=_this.draftMode?["draft","schemas"]:["schemas"];_this.callFormDataApi("POST",201,true,base,body,null).then((function(result){resolve(result)}),(function(error){reject(error)}))}));return createSchema.then((function(value){var schemaId=value["id"];return _this.createEventType(eventTypeName,eventDescription,schemaId)}))}},{key:"createSchemaAndLogicalInterface",value:function createSchemaAndLogicalInterface(schemaContents,schemaFileName,appInterfaceName,appInterfaceDescription,appInterfaceAlias){var _this2=this;var body={schemaFile:schemaContents,schemaType:"json-schema",name:schemaFileName};var createSchema=new Promise((function(resolve,reject){var base=_this2.draftMode?["draft","schemas"]:["schemas"];_this2.callFormDataApi("POST",201,true,base,body,null).then((function(result){resolve(result)}),(function(error){reject(error)}))}));return createSchema.then((function(value){var schemaId=value.id;return _this2.createLogicalInterface(appInterfaceName,appInterfaceDescription,schemaId,appInterfaceAlias)}))}},{key:"createPhysicalInterfaceWithEventMapping",value:function createPhysicalInterfaceWithEventMapping(physicalInterfaceName,description,eventId,eventTypeId){var _this3=this;var createPhysicalInterface=new Promise((function(resolve,reject){_this3.createPhysicalInterface(physicalInterfaceName,description).then((function(result){resolve(result)}),(function(error){reject(error)}))}));return createPhysicalInterface.then((function(value){var physicalInterface=value;var PhysicalInterfaceEventMapping=new Promise((function(resolve,reject){_this3.createPhysicalInterfaceEventMapping(physicalInterface.id,eventId,eventTypeId).then((function(result){resolve([physicalInterface,result])}),(function(error){reject(error)}))}));return PhysicalInterfaceEventMapping.then((function(result){return result}))}))}},{key:"createDeviceTypeLogicalInterfaceEventMapping",value:function createDeviceTypeLogicalInterfaceEventMapping(deviceTypeName,description,logicalInterfaceId,eventMapping,notificationStrategy){var _this4=this;var createDeviceType=new Promise((function(resolve,reject){_this4.createDeviceType(deviceTypeName,description).then((function(result){resolve(result)}),(function(error){reject(error)}))}));return createDeviceType.then((function(result){var deviceObject=result;var deviceTypeLogicalInterface=null;var deviceTypeLogicalInterface=new Promise((function(resolve,reject){_this4.createDeviceTypeLogicalInterfaceAssociation(deviceObject.id,logicalInterfaceId).then((function(result){resolve(result)}),(function(error){reject(error)}))}));return deviceTypeLogicalInterface.then((function(result){deviceTypeLogicalInterface=result;var deviceTypeLogicalInterfacePropertyMappings=new Promise((function(resolve,reject){var notificationstrategy="never";if(notificationStrategy){notificationstrategy=notificationStrategy}_this4.createDeviceTypeLogicalInterfacePropertyMappings(deviceObject.id,logicalInterfaceId,eventMapping,notificationstrategy).then((function(result){var arr=[deviceObject,deviceTypeLogicalInterface,result];resolve(arr)}),(function(error){reject(error)}))}));return deviceTypeLogicalInterfacePropertyMappings.then((function(result){return result}))}))}))}}])}()},{loglevel:138}],307:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _util=require("../util");var _BaseClient2=_interopRequireDefault(require("../BaseClient"));var _ApiClient=_interopRequireDefault(require("../api/ApiClient"));var _RegistryClient=_interopRequireDefault(require("../api/RegistryClient"));var _MgmtClient=_interopRequireDefault(require("../api/MgmtClient"));var _LecClient=_interopRequireDefault(require("../api/LecClient"));var _DscClient=_interopRequireDefault(require("../api/DscClient"));var _RulesClient=_interopRequireDefault(require("../api/RulesClient"));var _StateClient=_interopRequireDefault(require("../api/StateClient"));var _ApplicationConfig=_interopRequireDefault(require("./ApplicationConfig"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t)}:p}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value}},_get.apply(null,arguments)}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}var DEVICE_EVT_RE=/^iot-2\/type\/(.+)\/id\/(.+)\/evt\/(.+)\/fmt\/(.+)$/;var DEVICE_CMD_RE=/^iot-2\/type\/(.+)\/id\/(.+)\/cmd\/(.+)\/fmt\/(.+)$/;var DEVICE_STATE_RE=/^iot-2\/type\/(.+)\/id\/(.+)\/intf\/(.+)\/evt\/state$/;var DEVICE_STATE_ERROR_RE=/^iot-2\/type\/(.+)\/id\/(.+)\/err\/data$/;var RULE_TRIGGER_RE=/^iot-2\/intf\/(.+)\/rule\/(.+)\/evt\/trigger$/;var RULE_ERROR_RE=/^iot-2\/intf\/(.+)\/rule\/(.+)\/err\/data$/;var DEVICE_MON_RE=/^iot-2\/type\/(.+)\/id\/(.+)\/mon$/;var APP_MON_RE=/^iot-2\/app\/(.+)\/mon$/;var ApplicationClient=exports["default"]=function(_BaseClient){function ApplicationClient(config){var _this;_classCallCheck(this,ApplicationClient);if(!config instanceof _ApplicationConfig["default"]){throw new Error("Config must be an instance of ApplicationConfig")}_this=_callSuper(this,ApplicationClient,[config]);_this.useLtpa=config.auth&&config.auth.useLtpa;if(config.auth&&config.auth.useLtpa||config.getOrgId()!="quickstart"){_this._apiClient=new _ApiClient["default"](_this.config);_this.dsc=new _DscClient["default"](_this._apiClient);_this.lec=new _LecClient["default"](_this._apiClient);_this.mgmt=new _MgmtClient["default"](_this._apiClient);_this.registry=new _RegistryClient["default"](_this._apiClient);_this.rules=new _RulesClient["default"](_this._apiClient);_this.state=new _StateClient["default"](_this._apiClient)}_this.log.debug("[ApplicationClient:constructor] ApplicationClient initialized for organization : "+config.getOrgId());return _this}_inherits(ApplicationClient,_BaseClient);return _createClass(ApplicationClient,[{key:"connect",value:function connect(){var _this2=this;_superPropGet(ApplicationClient,"connect",this,3)([]);this.mqtt.on("message",(function(topic,payload){_this2.log.trace("[ApplicationClient:onMessage] mqtt: ",topic,payload.toString());var match=DEVICE_EVT_RE.exec(topic);if(match){_this2.emit("deviceEvent",match[1],match[2],match[3],match[4],payload,topic);return}var match=DEVICE_CMD_RE.exec(topic);if(match){_this2.emit("deviceCommand",match[1],match[2],match[3],match[4],payload,topic);return}var match=DEVICE_STATE_RE.exec(topic);if(match){_this2.emit("deviceState",match[1],match[2],match[3],payload,topic);return}var match=DEVICE_STATE_ERROR_RE.exec(topic);if(match){_this2.emit("deviceStateError",match[1],match[2],payload,topic);return}var match=RULE_TRIGGER_RE.exec(topic);if(match){_this2.emit("ruleTrigger",match[1],match[2],payload,topic);return}var match=RULE_ERROR_RE.exec(topic);if(match){_this2.emit("ruleError",match[1],match[2],payload,topic);return}var match=DEVICE_MON_RE.exec(topic);if(match){_this2.emit("deviceStatus",match[1],match[2],payload,topic);return}var match=APP_MON_RE.exec(topic);if(match){_this2.emit("appStatus",match[1],payload,topic);return}_this2.log.warn("[ApplicationClient:onMessage] Message received on unexpected topic"+", "+topic+", "+payload)}))}},{key:"publishEvent",value:function publishEvent(typeId,deviceId,eventId,format,data,qos,callback){qos=qos||0;if(!(0,_util.isDefined)(typeId)||!(0,_util.isDefined)(deviceId)||!(0,_util.isDefined)(eventId)||!(0,_util.isDefined)(format)){this.log.error("[ApplicationClient:publishDeviceEvent] Required params for publishDeviceEvent not present");this.emit("error","[ApplicationClient:publishDeviceEvent] Required params for publishDeviceEvent not present");return}var topic="iot-2/type/"+typeId+"/id/"+deviceId+"/evt/"+eventId+"/fmt/"+format;this._publish(topic,data,qos,callback);return this}},{key:"subscribeToEvents",value:function subscribeToEvents(typeId,deviceId,eventId,format,qos,callback){typeId=typeId||"+";deviceId=deviceId||"+";eventId=eventId||"+";format=format||"+";qos=qos||0;var topic="iot-2/type/"+typeId+"/id/"+deviceId+"/evt/"+eventId+"/fmt/"+format;this._subscribe(topic,qos,callback);return this}},{key:"unsubscribeFromEvents",value:function unsubscribeFromEvents(typeId,deviceId,eventId,format,callback){typeId=typeId||"+";deviceId=deviceId||"+";eventId=eventId||"+";format=format||"+";var topic="iot-2/type/"+typeId+"/id/"+deviceId+"/evt/"+eventId+"/fmt/"+format;this._unsubscribe(topic,callback);return this}},{key:"publishCommand",value:function publishCommand(typeId,deviceId,commandId,format,data,qos,callback){qos=qos||0;if(!(0,_util.isDefined)(typeId)||!(0,_util.isDefined)(deviceId)||!(0,_util.isDefined)(commandId)||!(0,_util.isDefined)(format)){this.log.error("[ApplicationClient:publishDeviceCommand] Required params for publishDeviceCommand not present");this.emit("error","[ApplicationClient:publishDeviceCommand] Required params for publishDeviceCommand not present");return}var topic="iot-2/type/"+typeId+"/id/"+deviceId+"/cmd/"+commandId+"/fmt/"+format;this._publish(topic,data,qos,callback);return this}},{key:"subscribeToCommands",value:function subscribeToCommands(typeId,deviceId,commandId,format,qos,callback){typeId=typeId||"+";deviceId=deviceId||"+";commandId=commandId||"+";format=format||"+";qos=qos||0;var topic="iot-2/type/"+typeId+"/id/"+deviceId+"/cmd/"+commandId+"/fmt/"+format;this.log.debug("[ApplicationClient:subscribeToDeviceCommands] Calling subscribe with QoS "+qos);this._subscribe(topic,qos,callback);return this}},{key:"unsubscribeFromCommands",value:function unsubscribeFromCommands(typeId,deviceId,commandId,format,callback){typeId=typeId||"+";deviceId=deviceId||"+";commandId=commandId||"+";format=format||"+";var topic="iot-2/type/"+typeId+"/id/"+deviceId+"/cmd/"+commandId+"/fmt/"+format;this._unsubscribe(topic,callback);return this}},{key:"subscribeToDeviceState",value:function subscribeToDeviceState(type,id,interfaceId,qos){type=type||"+";id=id||"+";interfaceId=interfaceId||"+";qos=qos||0;var topic="iot-2/type/"+type+"/id/"+id+"/intf/"+interfaceId+"/evt/state";this.log.debug("[ApplicationClient:subscribeToDeviceState] Calling subscribe with QoS "+qos);this._subscribe(topic,qos);return this}},{key:"unsubscribeToDeviceState",value:function unsubscribeToDeviceState(type,id,interfaceId){type=type||"+";id=id||"+";interfaceId=interfaceId||"+";var topic="iot-2/type/"+type+"/id/"+id+"/intf/"+interfaceId+"/evt/state";this._unsubscribe(topic);return this}},{key:"subscribeToDeviceErrors",value:function subscribeToDeviceErrors(type,id,qos){type=type||"+";id=id||"+";qos=qos||0;var topic="iot-2/type/"+type+"/id/"+id+"/err/data";this.log.debug("[ApplicationClient:subscribeToDeviceErrors] Calling subscribe with QoS "+qos);this._subscribe(topic,qos);return this}},{key:"unsubscribeToDeviceErrors",value:function unsubscribeToDeviceErrors(type,id){type=type||"+";id=id||"+";var topic="iot-2/type/"+type+"/id/"+id+"/err/data";this._unsubscribe(topic);return this}},{key:"subscribeToRuleTriggers",value:function subscribeToRuleTriggers(interfaceId,ruleId,qos){interfaceId=interfaceId||"+";ruleId=ruleId||"+";qos=qos||0;var topic="iot-2/intf/"+interfaceId+"/rule/"+ruleId+"/evt/trigger";this.log.debug("[ApplicationClient:subscribeToRuleTriggers] Calling subscribe with QoS "+qos);this._subscribe(topic,qos);return this}},{key:"unsubscribeToRuleTriggers",value:function unsubscribeToRuleTriggers(interfaceId,ruleId){interfaceId=interfaceId||"+";ruleId=ruleId||"+";var topic="iot-2/intf/"+interfaceId+"/rule/"+ruleId+"/evt/trigger";this._unsubscribe(topic);return this}},{key:"subscribeToRuleErrors",value:function subscribeToRuleErrors(interfaceId,ruleId,qos){interfaceId=interfaceId||"+";ruleId=ruleId||"+";qos=qos||0;var topic="iot-2/intf/"+interfaceId+"/rule/"+ruleId+"/err/data";this.log.debug("[ApplicationClient:subscribeToRuleErrors] Calling subscribe with QoS "+qos);this._subscribe(topic,qos);return this}},{key:"unsubscribeToRuleErrors",value:function unsubscribeToRuleErrors(interfaceId,ruleId){interfaceId=interfaceId||"+";ruleId=ruleId||"+";var topic="iot-2/intf/"+interfaceId+"/rule/"+ruleId+"/err/data";this._unsubscribe(topic);return this}},{key:"subscribeToDeviceStatus",value:function subscribeToDeviceStatus(type,id,qos){type=type||"+";id=id||"+";qos=qos||0;var topic="iot-2/type/"+type+"/id/"+id+"/mon";this.log.debug("[ApplicationClient:subscribeToDeviceStatus] Calling subscribe with QoS "+qos);this._subscribe(topic,qos);return this}},{key:"unsubscribeToDeviceStatus",value:function unsubscribeToDeviceStatus(type,id){type=type||"+";id=id||"+";var topic="iot-2/type/"+type+"/id/"+id+"/mon";this._unsubscribe(topic);return this}},{key:"subscribeToAppStatus",value:function subscribeToAppStatus(id,qos){id=id||"+";qos=qos||0;var topic="iot-2/app/"+id+"/mon";this.log.debug("[ApplicationClient:subscribeToAppStatus] Calling subscribe with QoS "+qos);this._subscribe(topic,qos);return this}},{key:"unsubscribeToAppStatus",value:function unsubscribeToAppStatus(id){id=id||"+";var topic="iot-2/app/"+id+"/mon";this._unsubscribe(topic);return this}}])}(_BaseClient2["default"])},{"../BaseClient":297,"../api/ApiClient":299,"../api/DscClient":301,"../api/LecClient":302,"../api/MgmtClient":303,"../api/RegistryClient":304,"../api/RulesClient":305,"../api/StateClient":306,"../util":313,"./ApplicationConfig":308}],308:[function(require,module,exports){(function(process){(function(){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _BaseConfig2=_interopRequireDefault(require("../BaseConfig"));var _loglevel=_interopRequireDefault(require("loglevel"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}var YAML=require("yaml");var fs=require("fs");var _require=require("uuid"),uuidv4=_require.v4;var ApplicationConfig=exports["default"]=function(_BaseConfig){function ApplicationConfig(identity,auth,options){var _this;_classCallCheck(this,ApplicationConfig);_this=_callSuper(this,ApplicationConfig,[identity,auth,options]);if(_this.auth!=null&&!_this.auth.useLtpa){if(!("key"in _this.auth)||_this.auth.key==null){throw new Error("Missing auth.key from configuration")}if(!("token"in _this.auth)||_this.auth.token==null){throw new Error("Missing auth.token from configuration")}}if(_this.identity==null){_this.identity={}}if(!("appId"in _this.identity)){_this.identity.appId=uuidv4()}if(!("sharedSubscription"in _this.options.mqtt)){_this.options.mqtt.sharedSubscription=false}return _this}_inherits(ApplicationConfig,_BaseConfig);return _createClass(ApplicationConfig,[{key:"getOrgId",value:function getOrgId(){if(this.auth==null){return"quickstart"}else if(this.auth.key){return this.auth.key.split("-")[1]}else{return null}}},{key:"getApiRoot",value:function getApiRoot(){return this.options.apiRoot||"api/v0002"}},{key:"getApiBaseUri",value:function getApiBaseUri(){return this.auth&&this.auth.useLtpa?"/".concat(this.getApiRoot()):"https://".concat(this.getOrgId(),".").concat(this.options.domain,"/").concat(this.getApiRoot())}},{key:"getClientId",value:function getClientId(){var clientIdPrefix="a";if(this.options.mqtt.sharedSubscription==true){clientIdPrefix="A"}return clientIdPrefix+":"+this.getOrgId()+":"+this.identity.appId}},{key:"getMqttUsername",value:function getMqttUsername(){return this.auth.key}},{key:"getMqttPassword",value:function getMqttPassword(){return this.auth.token}},{key:"getAdditionalHeaders",value:function getAdditionalHeaders(){return this.options&&this.options.http?this.options.http.additionalHeaders:[]}},{key:"setAdditionalHeader",value:function setAdditionalHeader(key,value){if(!this.options.http)this.options.http={};if(!this.options.http.additionalHeaders)this.options.http.additionalHeaders={};this.options.http.additionalHeaders[key]=value}}],[{key:"parseEnvVars",value:function parseEnvVars(){var authKey=process.env.WIOTP_AUTH_KEY||null;var authToken=process.env.WIOTP_AUTH_TOKEN||null;if(authKey==null&&authToken==null){authKey=process.env.WIOTP_API_KEY||null;authToken=process.env.WIOTP_API_TOKEN||null}var appId=process.env.WIOTP_IDENTITY_APPID||uuidv4();var domain=process.env.WIOTP_OPTIONS_DOMAIN||null;var apiRoot=process.env.WIOTP_OPTIONS_API_ROOT||null;var logLevel=process.env.WIOTP_OPTIONS_LOGLEVEL||"info";var port=process.env.WIOTP_OPTIONS_MQTT_PORT||null;var transport=process.env.WIOTP_OPTIONS_MQTT_TRANSPORT||null;var caFile=process.env.WIOTP_OPTIONS_MQTT_CAFILE||null;var cleanStart=process.env.WIOTP_OPTIONS_MQTT_CLEANSTART||"true";var sessionExpiry=process.env.WIOTP_OPTIONS_MQTT_SESSIONEXPIRY||3600;var keepAlive=process.env.WIOTP_OPTIONS_MQTT_KEEPALIVE||60;var sharedSubs=process.env.WIOTP_OPTIONS_MQTT_SHAREDSUBSCRIPTION||"false";var verifyCert=process.env.WIOTP_OPTIONS_HTTP_VERIFY||"true";if(port!=null){port=parseInt(port)}sessionExpiry=parseInt(sessionExpiry);keepAlive=parseInt(keepAlive);var identity={appId:appId};var options={domain:domain,apiRoot:apiRoot,logLevel:logLevel,mqtt:{port:port,transport:transport,cleanStart:["True","true","1"].includes(cleanStart),sessionExpiry:sessionExpiry,keepAlive:keepAlive,sharedSubscription:["True","true","1"].includes(sharedSubs),caFile:caFile},http:{verify:["True","true","1"].includes(verifyCert)}};var auth=null;if(authToken!=null){auth={key:authKey,token:authToken}}return new ApplicationConfig(identity,auth,options)}},{key:"parseConfigFile",value:function parseConfigFile(configFilePath){var configFile=fs.readFileSync(configFilePath,"utf8");var data=YAML.parse(configFile);if(!fs.existsSync(configFilePath)){throw new Error("File not found")}else{try{var _configFile=fs.readFileSync(configFilePath,"utf8");var data=YAML.parse(_configFile)}catch(err){throw new Error("Error reading device configuration file: "+err.code)}}if("options"in data&"logLevel"in data["options"]){var validLevels=["error","warning","info","debug"];if(!validLevels.includes(data["options"]["logLevel"])){throw new Error("Optional setting options.logLevel (Currently: "+data["options"]["logLevel"]+") must be one of error, warning, info, debug")}}else{data["options"]["logLevel"]=_loglevel["default"].GetLogger(data["options"]["logLevel"].toUpperCase())}return new ApplicationConfig(data["identity"],data["auth"],data["options"])}}])}(_BaseConfig2["default"])}).call(this)}).call(this,require("_process"))},{"../BaseConfig":298,_process:182,fs:72,loglevel:138,uuid:204,yaml:296}],309:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _util=require("../util");var _BaseClient2=_interopRequireDefault(require("../BaseClient"));var _DeviceConfig=_interopRequireDefault(require("./DeviceConfig"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t)}:p}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value}},_get.apply(null,arguments)}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}var WILDCARD_TOPIC="iot-2/cmd/+/fmt/+";var CMD_RE=/^iot-2\/cmd\/(.+)\/fmt\/(.+)$/;var util=require("util");var DeviceClient=exports["default"]=function(_BaseClient){function DeviceClient(config){var _this;_classCallCheck(this,DeviceClient);if(!config instanceof _DeviceConfig["default"]){throw new Error("Config must be an instance of DeviceConfig")}_this=_callSuper(this,DeviceClient,[config]);_this.log.debug("[DeviceClient:constructor] DeviceClient initialized for "+config.getClientId());return _this}_inherits(DeviceClient,_BaseClient);return _createClass(DeviceClient,[{key:"_commandSubscriptionCallback",value:function _commandSubscriptionCallback(err,granted){if(err==null){for(var index in granted){var grant=granted[index];this.log.debug("[DeviceClient:connect] Subscribed to device commands on "+grant.topic+" at QoS "+grant.qos)}}else{this.log.error("[DeviceClient:connect] Unable to establish subscription for device commands: "+err);this.emit("error",new Error("Unable to establish subscription for device commands: "+err))}}},{key:"connect",value:function connect(){var _this2=this;_superPropGet(DeviceClient,"connect",this,3)([]);this.mqtt.on("connect",(function(){if(!_this2.config.isQuickstart()){_this2.mqtt.subscribe(WILDCARD_TOPIC,{qos:1},_this2._commandSubscriptionCallback.bind(_this2))}}));this.mqtt.on("message",(function(topic,payload){_this2.log.debug("[DeviceClient:onMessage] Message received on topic : "+topic+" with payload : "+payload);var match=CMD_RE.exec(topic);if(match){_this2.emit("command",match[1],match[2],payload,topic)}}))}},{key:"publishEvent",value:function publishEvent(eventId,format,data,qos,callback){qos=qos||0;if(!(0,_util.isDefined)(eventId)||!(0,_util.isDefined)(format)){this.log.error("[DeviceClient:publishEvent] Required params for publishEvent not present");this.emit("error","[DeviceClient:publishEvent] Required params for publishEvent not present");return}var topic=util.format("iot-2/evt/%s/fmt/%s",eventId,format);this._publish(topic,data,qos,callback);return this}}])}(_BaseClient2["default"])},{"../BaseClient":297,"../util":313,"./DeviceConfig":310,util:203}],310:[function(require,module,exports){(function(process){(function(){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _BaseConfig2=_interopRequireDefault(require("../BaseConfig"));var _loglevel=_interopRequireDefault(require("loglevel"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}var YAML=require("yaml");var fs=require("fs");var DeviceConfig=exports["default"]=function(_BaseConfig){function DeviceConfig(identity,auth,options){var _this;_classCallCheck(this,DeviceConfig);_this=_callSuper(this,DeviceConfig,[identity,auth,options]);if(_this.identity==null){throw new Error("Missing identity from configuration")}if(!("orgId"in _this.identity)||_this.identity.orgId==null){throw new Error("Missing identity.orgId from configuration")}if(!("typeId"in _this.identity)||_this.identity.typeId==null){throw new Error("Missing identity.typeId from configuration")}if(!("deviceId"in _this.identity)||_this.identity.deviceId==null){throw new Error("Missing identity.deviceId from configuration")}if(_this.identity.orgId=="quickstart"){if(_this.auth!=null){throw new Error("Quickstart service does not support device authentication")}}else{if(_this.auth==null){throw new Error("Missing auth from configuration")}if(!("token"in _this.auth)||_this.auth.token==null){throw new Error("Missing auth.token from configuration")}}return _this}_inherits(DeviceConfig,_BaseConfig);return _createClass(DeviceConfig,[{key:"getOrgId",value:function getOrgId(){return this.identity.orgId}},{key:"getClientId",value:function getClientId(){return"d:"+this.identity.orgId+":"+this.identity.typeId+":"+this.identity.deviceId}},{key:"getMqttUsername",value:function getMqttUsername(){return"use-token-auth"}},{key:"getMqttPassword",value:function getMqttPassword(){if(this.identity.orgId!="quickstart"){return this.auth.token}else{return null}}}],[{key:"parseEnvVars",value:function parseEnvVars(){var orgId=process.env.WIOTP_IDENTITY_ORGID||null;var typeId=process.env.WIOTP_IDENTITY_TYPEID||null;var deviceId=process.env.WIOTP_IDENTITY_DEVICEID||null;var authToken=process.env.WIOTP_AUTH_TOKEN||null;if(authToken==null){authToken=process.env.WIOTP_API_TOKEN||null}var domain=process.env.WIOTP_OPTIONS_DOMAIN||null;var logLevel=process.env.WIOTP_OPTIONS_LOGLEVEL||"info";var port=process.env.WIOTP_OPTIONS_MQTT_PORT||null;var transport=process.env.WIOTP_OPTIONS_MQTT_TRANSPORT||null;var caFile=process.env.WIOTP_OPTIONS_MQTT_CAFILE||null;var cleanStart=process.env.WIOTP_OPTIONS_MQTT_CLEANSTART||"true";var sessionExpiry=process.env.WIOTP_OPTIONS_MQTT_SESSIONEXPIRY||3600;var keepAlive=process.env.WIOTP_OPTIONS_MQTT_KEEPALIVE||60;var sharedSubs=process.env.WIOTP_OPTIONS_MQTT_SHAREDSUBSCRIPTION||"false";if(port!=null){port=parseInt(port)}sessionExpiry=parseInt(sessionExpiry);keepAlive=parseInt(keepAlive);var identity={orgId:orgId,typeId:typeId,deviceId:deviceId};var options={domain:domain,logLevel:logLevel,mqtt:{port:port,transport:transport,cleanStart:["True","true","1"].includes(cleanStart),sessionExpiry:sessionExpiry,keepAlive:keepAlive,sharedSubscription:["True","true","1"].includes(sharedSubs),caFile:caFile}};var auth=null;if(authToken!=null){auth={token:authToken}}return new DeviceConfig(identity,auth,options)}},{key:"parseConfigFile",value:function parseConfigFile(configFilePath){var configFile=fs.readFileSync(configFilePath,"utf8");var data=YAML.parse(configFile);if(!fs.existsSync(configFilePath)){throw new Error("File not found")}else{try{var _configFile=fs.readFileSync(configFilePath,"utf8");var data=YAML.parse(_configFile)}catch(err){throw new Error("Error reading device configuration file: "+err.code)}}if("options"in data&"logLevel"in data["options"]){var validLevels=["error","warning","info","debug"];if(!validLevels.includes(data["options"]["logLevel"])){throw new Error("Optional setting options.logLevel (Currently: "+data["options"]["logLevel"]+") must be one of error, warning, info, debug")}}else{data["options"]["logLevel"]=_loglevel["default"].GetLogger(data["options"]["logLevel"].toUpperCase())}return new DeviceConfig(data["identity"],data["auth"],data["options"])}}])}(_BaseConfig2["default"])}).call(this)}).call(this,require("_process"))},{"../BaseConfig":298,_process:182,fs:72,loglevel:138,yaml:296}],311:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _BaseClient2=_interopRequireDefault(require("../BaseClient"));var _GatewayConfig=_interopRequireDefault(require("./GatewayConfig"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t)}:p}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value}},_get.apply(null,arguments)}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}var CMD_RE=/^iot-2\/type\/(.+)\/id\/(.+)\/cmd\/(.+)\/fmt\/(.+)$/;var util=require("util");var GatewayClient=exports["default"]=function(_BaseClient){function GatewayClient(config){var _this;_classCallCheck(this,GatewayClient);if(!config instanceof _GatewayConfig["default"]){throw new Error("Config must be an instance of GatewayConfig")}if(config.isQuickstart()){throw new Error("[GatewayClient:constructor] Quickstart not supported in Gateways")}_this=_callSuper(this,GatewayClient,[config]);_this.log.debug("[GatewayClient:constructor] GatewayClient initialized for "+config.getClientId());return _this}_inherits(GatewayClient,_BaseClient);return _createClass(GatewayClient,[{key:"connect",value:function connect(){var _this2=this;_superPropGet(GatewayClient,"connect",this,3)([]);this.mqtt.on("connect",(function(){}));this.mqtt.on("message",(function(topic,payload){_this2.log.debug("[GatewayClient:onMessage] Message received on topic : "+topic+" with payload : "+payload);var match=CMD_RE.exec(topic);if(match){_this2.emit("command",match[1],match[2],match[3],match[4],payload,topic)}}))}},{key:"publishEvent",value:function publishEvent(eventId,format,payload,qos,callback){return this._publishEvent(this.config.identity.typeId,this.config.identity.deviceId,eventId,format,payload,qos,callback)}},{key:"publishDeviceEvent",value:function publishDeviceEvent(typeid,deviceId,eventid,format,payload,qos,callback){return this._publishEvent(typeId,deviceId,eventid,format,payload,qos,callback)}},{key:"_publishEvent",value:function _publishEvent(typeId,deviceId,eventId,format,data,qos,callback){var topic=util.format("iot-2/type/%s/id/%s/evt/%s/fmt/%s",typeId,deviceId,eventId,format);qos=qos||0;this._publish(topic,data,qos,callback);return this}},{key:"subscribeToDeviceCommands",value:function subscribeToDeviceCommands(typeId,deviceId,commandId,format,qos,callback){typeId=typeId||"+";deviceId=deviceId||"+";commandId=commandid||"+";format=format||"+";qos=qos||0;var topic="iot-2/type/"+typeId+"/id/"+deviceId+"/cmd/"+commandId+"/fmt/"+format;this._subscribe(topic,qos,callback);return this}},{key:"unsubscribeFromDeviceCommands",value:function unsubscribeFromDeviceCommands(typeId,deviceId,commandId,format,callback){typeId=typeId||"+";deviceId=deviceId||"+";commandId=commandId||"+";format=format||"+";var topic="iot-2/type/"+typeId+"/id/"+deviceId+"/cmd/"+commandId+"/fmt/"+format;this._unsubscribe(topic,callback);return this}},{key:"subscribeToCommands",value:function subscribeToCommands(commandId,format,qos,callback){commandId=commandId||"+";format=format||"+";qos=qos||0;var topic="iot-2/type/"+this.config.identity.typeId+"/id/"+this.config.identity.deviceId+"/cmd/"+commandId+"/fmt/"+format;this._subscribe(topic,qos,callback);return this}},{key:"unsubscribeFromCommands",value:function unsubscribeFromCommands(commandId,format,callback){commandId=commandId||"+";format=format||"+";var topic="iot-2/type/"+this.config.identity.typeId+"/id/"+this.config.identity.deviceId+"/cmd/"+commandId+"/fmt/"+format;this._unsubscribe(topic,callback);return this}}])}(_BaseClient2["default"])},{"../BaseClient":297,"./GatewayConfig":312,util:203}],312:[function(require,module,exports){"use strict";function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _DeviceConfig2=_interopRequireDefault(require("../device/DeviceConfig"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}var GatewayConfig=exports["default"]=function(_DeviceConfig){function GatewayConfig(identity,auth,options){_classCallCheck(this,GatewayConfig);return _callSuper(this,GatewayConfig,[identity,auth,options])}_inherits(GatewayConfig,_DeviceConfig);return _createClass(GatewayConfig,[{key:"getClientId",value:function getClientId(){return"g:"+this.identity.orgId+":"+this.identity.typeId+":"+this.identity.deviceId}}])}(_DeviceConfig2["default"])},{"../device/DeviceConfig":310}],313:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.generateUUID=generateUUID;exports.isBoolean=isBoolean;exports.isBrowser=void 0;exports.isDefined=isDefined;exports.isNode=void 0;exports.isNumber=isNumber;exports.isString=isString;function isString(value){return typeof value==="string"}function isNumber(value){return typeof value==="number"}function isBoolean(value){return typeof value==="boolean"}function isDefined(value){return value!==undefined&&value!==null}var isBrowser=exports.isBrowser=new Function("try {return this===window;}catch(e){ return false;}");var isNode=exports.isNode=new Function("try {return this===global;}catch(e){return false;}");function generateUUID(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(c){var r=Math.random()*16|0,v=c=="x"?r:r&3|8;return v.toString(16)}))}},{}],314:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"ApiClient",{enumerable:true,get:function get(){return _ApiClient["default"]}});Object.defineProperty(exports,"ApiErrors",{enumerable:true,get:function get(){return _ApiErrors["default"]}});Object.defineProperty(exports,"ApplicationClient",{enumerable:true,get:function get(){return _ApplicationClient["default"]}});Object.defineProperty(exports,"ApplicationConfig",{enumerable:true,get:function get(){return _ApplicationConfig["default"]}});Object.defineProperty(exports,"DeviceClient",{enumerable:true,get:function get(){return _DeviceClient["default"]}});Object.defineProperty(exports,"DeviceConfig",{enumerable:true,get:function get(){return _DeviceConfig["default"]}});Object.defineProperty(exports,"DscClient",{enumerable:true,get:function get(){return _DscClient["default"]}});Object.defineProperty(exports,"GatewayClient",{enumerable:true,get:function get(){return _GatewayClient["default"]}});Object.defineProperty(exports,"LecClient",{enumerable:true,get:function get(){return _LecClient["default"]}});Object.defineProperty(exports,"MgmtClient",{enumerable:true,get:function get(){return _MgmtClient["default"]}});Object.defineProperty(exports,"RegistryClient",{enumerable:true,get:function get(){return _RegistryClient["default"]}});Object.defineProperty(exports,"RulesClient",{enumerable:true,get:function get(){return _RulesClient["default"]}});Object.defineProperty(exports,"StateClient",{enumerable:true,get:function get(){return _StateClient["default"]}});var _ApplicationClient=_interopRequireDefault(require("./application/ApplicationClient"));var _DeviceClient=_interopRequireDefault(require("./device/DeviceClient"));var _GatewayClient=_interopRequireDefault(require("./gateway/GatewayClient"));var _ApplicationConfig=_interopRequireDefault(require("./application/ApplicationConfig"));var _DeviceConfig=_interopRequireDefault(require("./device/DeviceConfig"));var _ApiClient=_interopRequireDefault(require("./api/ApiClient"));var _ApiErrors=_interopRequireDefault(require("./api/ApiErrors"));var _DscClient=_interopRequireDefault(require("./api/DscClient"));var _LecClient=_interopRequireDefault(require("./api/LecClient"));var _MgmtClient=_interopRequireDefault(require("./api/MgmtClient"));var _RegistryClient=_interopRequireDefault(require("./api/RegistryClient"));var _RulesClient=_interopRequireDefault(require("./api/RulesClient"));var _StateClient=_interopRequireDefault(require("./api/StateClient"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}},{"./api/ApiClient":299,"./api/ApiErrors":300,"./api/DscClient":301,"./api/LecClient":302,"./api/MgmtClient":303,"./api/RegistryClient":304,"./api/RulesClient":305,"./api/StateClient":306,"./application/ApplicationClient":307,"./application/ApplicationConfig":308,"./device/DeviceClient":309,"./device/DeviceConfig":310,"./gateway/GatewayClient":311}]},{},[314]);