UNPKG

phaser4-rex-plugins

Version:
9 lines 67.8 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).rexdialogquest=e()}(void 0,(function(){var t={setEventEmitter(t,e){return void 0===e&&(e=Phaser.Events.EventEmitter),this._privateEE=!0===t||void 0===t,this._eventEmitter=this._privateEE?new e:t,this},destroyEventEmitter(){return this._eventEmitter&&this._privateEE&&this._eventEmitter.shutdown(),this},getEventEmitter(){return this._eventEmitter},on(){return this._eventEmitter&&this._eventEmitter.on.apply(this._eventEmitter,arguments),this},once(){return this._eventEmitter&&this._eventEmitter.once.apply(this._eventEmitter,arguments),this},off(){return this._eventEmitter&&this._eventEmitter.off.apply(this._eventEmitter,arguments),this},emit(t){return this._eventEmitter&&t&&this._eventEmitter.emit.apply(this._eventEmitter,arguments),this},addListener(){return this._eventEmitter&&this._eventEmitter.addListener.apply(this._eventEmitter,arguments),this},removeListener(){return this._eventEmitter&&this._eventEmitter.removeListener.apply(this._eventEmitter,arguments),this},removeAllListeners(){return this._eventEmitter&&this._eventEmitter.removeAllListeners.apply(this._eventEmitter,arguments),this},listenerCount(){return this._eventEmitter?this._eventEmitter.listenerCount.apply(this._eventEmitter,arguments):0},listeners(){return this._eventEmitter?this._eventEmitter.listeners.apply(this._eventEmitter,arguments):[]},eventNames(){return this._eventEmitter?this._eventEmitter.eventNames.apply(this._eventEmitter,arguments):[]}},e=function(t,e,n){if(!t||"number"==typeof t)return n;if("string"==typeof e){if(t.hasOwnProperty(e))return t[e];if(-1===e.indexOf("."))return n;e=e.split(".")}for(var i=e,r=t,s=n,o=0;o<i.length;o++){if(e=i[o],!r.hasOwnProperty(e)){s=n;break}r=s=r[e]}return s};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function n(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var i={exports:{}}; /* @license Papa Parse v5.4.1 https://github.com/mholt/PapaParse License: MIT */!function(t){t.exports=function t(){var e="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:{},n=!e.document&&!!e.postMessage,i=e.IS_PAPA_WORKER||!1,r={},s=0,o={parse:function(n,i){var a=(i=i||{}).dynamicTyping||!1;if(k(a)&&(i.dynamicTypingFunction=a,a={}),i.dynamicTyping=a,i.transform=!!k(i.transform)&&i.transform,i.worker&&o.WORKERS_SUPPORTED){var u=function(){if(!o.WORKERS_SUPPORTED)return!1;var n,i,a=(n=e.URL||e.webkitURL||null,i=t.toString(),o.BLOB_URL||(o.BLOB_URL=n.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",i,")();"],{type:"text/javascript"})))),u=new e.Worker(a);return u.onmessage=m,u.id=s++,r[u.id]=u}();return u.userStep=i.step,u.userChunk=i.chunk,u.userComplete=i.complete,u.userError=i.error,i.step=k(i.step),i.chunk=k(i.chunk),i.complete=k(i.complete),i.error=k(i.error),delete i.worker,void u.postMessage({input:n,config:i,workerId:u.id})}var f=null;return o.NODE_STREAM_INPUT,"string"==typeof n?(n=function(t){return 65279===t.charCodeAt(0)?t.slice(1):t}(n),f=i.download?new l(i):new h(i)):!0===n.readable&&k(n.read)&&k(n.on)?f=new p(i):(e.File&&n instanceof File||n instanceof Object)&&(f=new c(i)),f.stream(n)},unparse:function(t,e){var n=!1,i=!0,r=",",s="\r\n",a='"',u=a+a,l=!1,c=null,h=!1;!function(){if("object"==typeof e){if("string"!=typeof e.delimiter||o.BAD_DELIMITERS.filter((function(t){return-1!==e.delimiter.indexOf(t)})).length||(r=e.delimiter),("boolean"==typeof e.quotes||"function"==typeof e.quotes||Array.isArray(e.quotes))&&(n=e.quotes),"boolean"!=typeof e.skipEmptyLines&&"string"!=typeof e.skipEmptyLines||(l=e.skipEmptyLines),"string"==typeof e.newline&&(s=e.newline),"string"==typeof e.quoteChar&&(a=e.quoteChar),"boolean"==typeof e.header&&(i=e.header),Array.isArray(e.columns)){if(0===e.columns.length)throw new Error("Option columns is empty");c=e.columns}void 0!==e.escapeChar&&(u=e.escapeChar+a),("boolean"==typeof e.escapeFormulae||e.escapeFormulae instanceof RegExp)&&(h=e.escapeFormulae instanceof RegExp?e.escapeFormulae:/^[=+\-@\t\r].*$/)}}();var p=new RegExp(d(a),"g");if("string"==typeof t&&(t=JSON.parse(t)),Array.isArray(t)){if(!t.length||Array.isArray(t[0]))return f(null,t,l);if("object"==typeof t[0])return f(c||Object.keys(t[0]),t,l)}else if("object"==typeof t)return"string"==typeof t.data&&(t.data=JSON.parse(t.data)),Array.isArray(t.data)&&(t.fields||(t.fields=t.meta&&t.meta.fields||c),t.fields||(t.fields=Array.isArray(t.data[0])?t.fields:"object"==typeof t.data[0]?Object.keys(t.data[0]):[]),Array.isArray(t.data[0])||"object"==typeof t.data[0]||(t.data=[t.data])),f(t.fields||[],t.data||[],l);throw new Error("Unable to serialize unrecognized input");function f(t,e,n){var o="";"string"==typeof t&&(t=JSON.parse(t)),"string"==typeof e&&(e=JSON.parse(e));var a=Array.isArray(t)&&0<t.length,u=!Array.isArray(e[0]);if(a&&i){for(var l=0;l<t.length;l++)0<l&&(o+=r),o+=g(t[l],l);0<e.length&&(o+=s)}for(var c=0;c<e.length;c++){var h=a?t.length:e[c].length,p=!1,f=a?0===Object.keys(e[c]).length:0===e[c].length;if(n&&!a&&(p="greedy"===n?""===e[c].join("").trim():1===e[c].length&&0===e[c][0].length),"greedy"===n&&a){for(var d=[],m=0;m<h;m++){var y=u?t[m]:m;d.push(e[c][y])}p=""===d.join("").trim()}if(!p){for(var v=0;v<h;v++){0<v&&!f&&(o+=r);var b=a&&u?t[v]:v;o+=g(e[c][b],v)}c<e.length-1&&(!n||0<h&&!f)&&(o+=s)}}return o}function g(t,e){if(null==t)return"";if(t.constructor===Date)return JSON.stringify(t).slice(1,25);var i=!1;h&&"string"==typeof t&&h.test(t)&&(t="'"+t,i=!0);var s=t.toString().replace(p,u);return(i=i||!0===n||"function"==typeof n&&n(t,e)||Array.isArray(n)&&n[e]||function(t,e){for(var n=0;n<e.length;n++)if(-1<t.indexOf(e[n]))return!0;return!1}(s,o.BAD_DELIMITERS)||-1<s.indexOf(r)||" "===s.charAt(0)||" "===s.charAt(s.length-1))?a+s+a:s}}};if(o.RECORD_SEP=String.fromCharCode(30),o.UNIT_SEP=String.fromCharCode(31),o.BYTE_ORDER_MARK="\ufeff",o.BAD_DELIMITERS=["\r","\n",'"',o.BYTE_ORDER_MARK],o.WORKERS_SUPPORTED=!n&&!!e.Worker,o.NODE_STREAM_INPUT=1,o.LocalChunkSize=10485760,o.RemoteChunkSize=5242880,o.DefaultDelimiter=",",o.Parser=g,o.ParserHandle=f,o.NetworkStreamer=l,o.FileStreamer=c,o.StringStreamer=h,o.ReadableStreamStreamer=p,e.jQuery){var a=e.jQuery;a.fn.parse=function(t){var n=t.config||{},i=[];return this.each((function(t){if("INPUT"!==a(this).prop("tagName").toUpperCase()||"file"!==a(this).attr("type").toLowerCase()||!e.FileReader||!this.files||0===this.files.length)return!0;for(var r=0;r<this.files.length;r++)i.push({file:this.files[r],inputElem:this,instanceConfig:a.extend({},n)})})),r(),this;function r(){if(0!==i.length){var e,n,r,u,l=i[0];if(k(t.before)){var c=t.before(l.file,l.inputElem);if("object"==typeof c){if("abort"===c.action)return e="AbortError",n=l.file,r=l.inputElem,u=c.reason,void(k(t.error)&&t.error({name:e},n,r,u));if("skip"===c.action)return void s();"object"==typeof c.config&&(l.instanceConfig=a.extend(l.instanceConfig,c.config))}else if("skip"===c)return void s()}var h=l.instanceConfig.complete;l.instanceConfig.complete=function(t){k(h)&&h(t,l.file,l.inputElem),s()},o.parse(l.file,l.instanceConfig)}else k(t.complete)&&t.complete()}function s(){i.splice(0,1),r()}}}function u(t){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(t){var e=b(t);e.chunkSize=parseInt(e.chunkSize),t.step||t.chunk||(e.chunkSize=null),this._handle=new f(e),(this._handle.streamer=this)._config=e}.call(this,t),this.parseChunk=function(t,n){if(this.isFirstChunk&&k(this._config.beforeFirstChunk)){var r=this._config.beforeFirstChunk(t);void 0!==r&&(t=r)}this.isFirstChunk=!1,this._halted=!1;var s=this._partialLine+t;this._partialLine="";var a=this._handle.parse(s,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var u=a.meta.cursor;this._finished||(this._partialLine=s.substring(u-this._baseIndex),this._baseIndex=u),a&&a.data&&(this._rowCount+=a.data.length);var l=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(i)e.postMessage({results:a,workerId:o.WORKER_ID,finished:l});else if(k(this._config.chunk)&&!n){if(this._config.chunk(a,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);a=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(a.data),this._completeResults.errors=this._completeResults.errors.concat(a.errors),this._completeResults.meta=a.meta),this._completed||!l||!k(this._config.complete)||a&&a.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),l||a&&a.meta.paused||this._nextChunk(),a}this._halted=!0},this._sendError=function(t){k(this._config.error)?this._config.error(t):i&&this._config.error&&e.postMessage({workerId:o.WORKER_ID,error:t,finished:!1})}}function l(t){var e;(t=t||{}).chunkSize||(t.chunkSize=o.RemoteChunkSize),u.call(this,t),this._nextChunk=n?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(t){this._input=t,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(e=new XMLHttpRequest,this._config.withCredentials&&(e.withCredentials=this._config.withCredentials),n||(e.onload=_(this._chunkLoaded,this),e.onerror=_(this._chunkError,this)),e.open(this._config.downloadRequestBody?"POST":"GET",this._input,!n),this._config.downloadRequestHeaders){var t=this._config.downloadRequestHeaders;for(var i in t)e.setRequestHeader(i,t[i])}if(this._config.chunkSize){var r=this._start+this._config.chunkSize-1;e.setRequestHeader("Range","bytes="+this._start+"-"+r)}try{e.send(this._config.downloadRequestBody)}catch(t){this._chunkError(t.message)}n&&0===e.status&&this._chunkError()}},this._chunkLoaded=function(){4===e.readyState&&(e.status<200||400<=e.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:e.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(t){var e=t.getResponseHeader("Content-Range");return null===e?-1:parseInt(e.substring(e.lastIndexOf("/")+1))}(e),this.parseChunk(e.responseText)))},this._chunkError=function(t){var n=e.statusText||t;this._sendError(new Error(n))}}function c(t){var e,n;(t=t||{}).chunkSize||(t.chunkSize=o.LocalChunkSize),u.call(this,t);var i="undefined"!=typeof FileReader;this.stream=function(t){this._input=t,n=t.slice||t.webkitSlice||t.mozSlice,i?((e=new FileReader).onload=_(this._chunkLoaded,this),e.onerror=_(this._chunkError,this)):e=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var t=this._input;if(this._config.chunkSize){var r=Math.min(this._start+this._config.chunkSize,this._input.size);t=n.call(t,this._start,r)}var s=e.readAsText(t,this._config.encoding);i||this._chunkLoaded({target:{result:s}})},this._chunkLoaded=function(t){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(t.target.result)},this._chunkError=function(){this._sendError(e.error)}}function h(t){var e;u.call(this,t=t||{}),this.stream=function(t){return e=t,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var t,n=this._config.chunkSize;return n?(t=e.substring(0,n),e=e.substring(n)):(t=e,e=""),this._finished=!e,this.parseChunk(t)}}}function p(t){u.call(this,t=t||{});var e=[],n=!0,i=!1;this.pause=function(){u.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){u.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(t){this._input=t,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){i&&1===e.length&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),e.length?this.parseChunk(e.shift()):n=!0},this._streamData=_((function(t){try{e.push("string"==typeof t?t:t.toString(this._config.encoding)),n&&(n=!1,this._checkIsFinished(),this.parseChunk(e.shift()))}catch(t){this._streamError(t)}}),this),this._streamError=_((function(t){this._streamCleanUp(),this._sendError(t)}),this),this._streamEnd=_((function(){this._streamCleanUp(),i=!0,this._streamData("")}),this),this._streamCleanUp=_((function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)}),this)}function f(t){var e,n,i,r=Math.pow(2,53),s=-r,a=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,u=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,l=this,c=0,h=0,p=!1,f=!1,m=[],y={data:[],errors:[],meta:{}};if(k(t.step)){var v=t.step;t.step=function(e){if(y=e,A())w();else{if(w(),0===y.data.length)return;c+=e.data.length,t.preview&&c>t.preview?n.abort():(y.data=y.data[0],v(y,l))}}}function _(e){return"greedy"===t.skipEmptyLines?""===e.join("").trim():1===e.length&&0===e[0].length}function w(){return y&&i&&(x("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+o.DefaultDelimiter+"'"),i=!1),t.skipEmptyLines&&(y.data=y.data.filter((function(t){return!_(t)}))),A()&&function(){if(y)if(Array.isArray(y.data[0])){for(var e=0;A()&&e<y.data.length;e++)y.data[e].forEach(n);y.data.splice(0,1)}else y.data.forEach(n);function n(e,n){k(t.transformHeader)&&(e=t.transformHeader(e,n)),m.push(e)}}(),function(){if(!y||!t.header&&!t.dynamicTyping&&!t.transform)return y;function e(e,n){var i,r=t.header?{}:[];for(i=0;i<e.length;i++){var s=i,o=e[i];t.header&&(s=i>=m.length?"__parsed_extra":m[i]),t.transform&&(o=t.transform(o,s)),o=E(s,o),"__parsed_extra"===s?(r[s]=r[s]||[],r[s].push(o)):r[s]=o}return t.header&&(i>m.length?x("FieldMismatch","TooManyFields","Too many fields: expected "+m.length+" fields but parsed "+i,h+n):i<m.length&&x("FieldMismatch","TooFewFields","Too few fields: expected "+m.length+" fields but parsed "+i,h+n)),r}var n=1;return!y.data.length||Array.isArray(y.data[0])?(y.data=y.data.map(e),n=y.data.length):y.data=e(y.data,0),t.header&&y.meta&&(y.meta.fields=m),h+=n,y}()}function A(){return t.header&&0===m.length}function E(e,n){return i=e,t.dynamicTypingFunction&&void 0===t.dynamicTyping[i]&&(t.dynamicTyping[i]=t.dynamicTypingFunction(i)),!0===(t.dynamicTyping[i]||t.dynamicTyping)?"true"===n||"TRUE"===n||"false"!==n&&"FALSE"!==n&&(function(t){if(a.test(t)){var e=parseFloat(t);if(s<e&&e<r)return!0}return!1}(n)?parseFloat(n):u.test(n)?new Date(n):""===n?null:n):n;var i}function x(t,e,n,i){var r={type:t,code:e,message:n};void 0!==i&&(r.row=i),y.errors.push(r)}this.parse=function(r,s,a){var u=t.quoteChar||'"';if(t.newline||(t.newline=function(t,e){t=t.substring(0,1048576);var n=new RegExp(d(e)+"([^]*?)"+d(e),"gm"),i=(t=t.replace(n,"")).split("\r"),r=t.split("\n"),s=1<r.length&&r[0].length<i[0].length;if(1===i.length||s)return"\n";for(var o=0,a=0;a<i.length;a++)"\n"===i[a][0]&&o++;return o>=i.length/2?"\r\n":"\r"}(r,u)),i=!1,t.delimiter)k(t.delimiter)&&(t.delimiter=t.delimiter(r),y.meta.delimiter=t.delimiter);else{var l=function(e,n,i,r,s){var a,u,l,c;s=s||[",","\t","|",";",o.RECORD_SEP,o.UNIT_SEP];for(var h=0;h<s.length;h++){var p=s[h],f=0,d=0,m=0;l=void 0;for(var y=new g({comments:r,delimiter:p,newline:n,preview:10}).parse(e),v=0;v<y.data.length;v++)if(i&&_(y.data[v]))m++;else{var b=y.data[v].length;d+=b,void 0!==l?0<b&&(f+=Math.abs(b-l),l=b):l=b}0<y.data.length&&(d/=y.data.length-m),(void 0===u||f<=u)&&(void 0===c||c<d)&&1.99<d&&(u=f,a=p,c=d)}return{successful:!!(t.delimiter=a),bestDelimiter:a}}(r,t.newline,t.skipEmptyLines,t.comments,t.delimitersToGuess);l.successful?t.delimiter=l.bestDelimiter:(i=!0,t.delimiter=o.DefaultDelimiter),y.meta.delimiter=t.delimiter}var c=b(t);return t.preview&&t.header&&c.preview++,e=r,n=new g(c),y=n.parse(e,s,a),w(),p?{meta:{paused:!0}}:y||{meta:{paused:!1}}},this.paused=function(){return p},this.pause=function(){p=!0,n.abort(),e=k(t.chunk)?"":e.substring(n.getCharIndex())},this.resume=function(){l.streamer._halted?(p=!1,l.streamer.parseChunk(e,!0)):setTimeout(l.resume,3)},this.aborted=function(){return f},this.abort=function(){f=!0,n.abort(),y.meta.aborted=!0,k(t.complete)&&t.complete(y),e=""}}function d(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function g(t){var e,n=(t=t||{}).delimiter,i=t.newline,r=t.comments,s=t.step,a=t.preview,u=t.fastMode,l=e=void 0===t.quoteChar||null===t.quoteChar?'"':t.quoteChar;if(void 0!==t.escapeChar&&(l=t.escapeChar),("string"!=typeof n||-1<o.BAD_DELIMITERS.indexOf(n))&&(n=","),r===n)throw new Error("Comment character same as delimiter");!0===r?r="#":("string"!=typeof r||-1<o.BAD_DELIMITERS.indexOf(r))&&(r=!1),"\n"!==i&&"\r"!==i&&"\r\n"!==i&&(i="\n");var c=0,h=!1;this.parse=function(o,p,f){if("string"!=typeof o)throw new Error("Input must be a string");var g=o.length,m=n.length,y=i.length,v=r.length,b=k(s),_=[],w=[],A=[],E=c=0;if(!o)return Y();if(t.header&&!p){var x=o.split(i)[0].split(n),C=[],O={},S=!1;for(var I in x){var T=x[I];k(t.transformHeader)&&(T=t.transformHeader(T,I));var j=T,q=O[T]||0;for(0<q&&(S=!0,j=T+"_"+q),O[T]=q+1;C.includes(j);)j=j+"_"+q;C.push(j)}if(S){var M=o.split(i);M[0]=C.join(n),o=M.join(i)}}if(u||!1!==u&&-1===o.indexOf(e)){for(var D=o.split(i),L=0;L<D.length;L++){if(A=D[L],c+=A.length,L!==D.length-1)c+=i.length;else if(f)return Y();if(!r||A.substring(0,v)!==r){if(b){if(_=[],Q(A.split(n)),$(),h)return Y()}else Q(A.split(n));if(a&&a<=L)return _=_.slice(0,a),Y(!0)}}return Y()}for(var F=o.indexOf(n,c),R=o.indexOf(i,c),N=new RegExp(d(l)+d(e),"g"),U=o.indexOf(e,c);;)if(o[c]!==e)if(r&&0===A.length&&o.substring(c,c+v)===r){if(-1===R)return Y();c=R+y,R=o.indexOf(i,c),F=o.indexOf(n,c)}else if(-1!==F&&(F<R||-1===R))A.push(o.substring(c,F)),c=F+m,F=o.indexOf(n,c);else{if(-1===R)break;if(A.push(o.substring(c,R)),W(R+y),b&&($(),h))return Y();if(a&&_.length>=a)return Y(!0)}else for(U=c,c++;;){if(-1===(U=o.indexOf(e,U+1)))return f||w.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:_.length,index:c}),B();if(U===g-1)return B(o.substring(c,U).replace(N,e));if(e!==l||o[U+1]!==l){if(e===l||0===U||o[U-1]!==l){-1!==F&&F<U+1&&(F=o.indexOf(n,U+1)),-1!==R&&R<U+1&&(R=o.indexOf(i,U+1));var P=z(-1===R?F:Math.min(F,R));if(o.substr(U+1+P,m)===n){A.push(o.substring(c,U).replace(N,e)),o[c=U+1+P+m]!==e&&(U=o.indexOf(e,c)),F=o.indexOf(n,c),R=o.indexOf(i,c);break}var K=z(R);if(o.substring(U+1+K,U+1+K+y)===i){if(A.push(o.substring(c,U).replace(N,e)),W(U+1+K+y),F=o.indexOf(n,c),U=o.indexOf(e,c),b&&($(),h))return Y();if(a&&_.length>=a)return Y(!0);break}w.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:_.length,index:c}),U++}}else U++}return B();function Q(t){_.push(t),E=c}function z(t){var e=0;if(-1!==t){var n=o.substring(U+1,t);n&&""===n.trim()&&(e=n.length)}return e}function B(t){return f||(void 0===t&&(t=o.substring(c)),A.push(t),c=g,Q(A),b&&$()),Y()}function W(t){c=t,Q(A),A=[],R=o.indexOf(i,c)}function Y(t){return{data:_,errors:w,meta:{delimiter:n,linebreak:i,aborted:h,truncated:!!t,cursor:E+(p||0)}}}function $(){s(Y()),_=[],w=[]}},this.abort=function(){h=!0},this.getCharIndex=function(){return c}}function m(t){var e=t.data,n=r[e.workerId],i=!1;if(e.error)n.userError(e.error,e.file);else if(e.results&&e.results.data){var s={abort:function(){i=!0,y(e.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:v,resume:v};if(k(n.userStep)){for(var o=0;o<e.results.data.length&&(n.userStep({data:e.results.data[o],errors:e.results.errors,meta:e.results.meta},s),!i);o++);delete e.results}else k(n.userChunk)&&(n.userChunk(e.results,s,e.file),delete e.results)}e.finished&&!i&&y(e.workerId,e.results)}function y(t,e){var n=r[t];k(n.userComplete)&&n.userComplete(e),n.terminate(),delete r[t]}function v(){throw new Error("Not implemented.")}function b(t){if("object"!=typeof t||null===t)return t;var e=Array.isArray(t)?[]:{};for(var n in t)e[n]=b(t[n]);return e}function _(t,e){return function(){t.apply(e,arguments)}}function k(t){return"function"==typeof t}return i&&(e.onmessage=function(t){var n=t.data;if(void 0===o.WORKER_ID&&n&&(o.WORKER_ID=n.workerId),"string"==typeof n.input)e.postMessage({workerId:o.WORKER_ID,results:o.parse(n.input,n.config),finished:!0});else if(e.File&&n.input instanceof File||n.input instanceof Object){var i=o.parse(n.input,n.config);i&&e.postMessage({workerId:o.WORKER_ID,results:i,finished:!0})}}),(l.prototype=Object.create(u.prototype)).constructor=l,(c.prototype=Object.create(u.prototype)).constructor=c,(h.prototype=Object.create(h.prototype)).constructor=h,(p.prototype=Object.create(u.prototype)).constructor=p,o}()}(i);var r=n(i.exports),s=/^\s*-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?\s*$/i,o=/^0x[0-9A-F]+$/i,a=function(t){if("string"!=typeof t)return t;if(""===t)t=null;else if(s.test(t))t=parseFloat(t);else if(o.test(t))t=parseInt(t,16);else switch(t){case"false":t=!1;break;case"true":t=!0;break;case"null":t=null;break;case"undefined":t=void 0}return t},u=function(t,e){if(!e)return t;for(var n in t)t[n]=e(t[n],n);return t}; /*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */ function l(t){return null==t}var c={isNothing:l,isObject:function(t){return"object"==typeof t&&null!==t},toArray:function(t){return Array.isArray(t)?t:l(t)?[]:[t]},repeat:function(t,e){var n,i="";for(n=0;n<e;n+=1)i+=t;return i},isNegativeZero:function(t){return 0===t&&Number.NEGATIVE_INFINITY===1/t},extend:function(t,e){var n,i,r,s;if(e)for(n=0,i=(s=Object.keys(e)).length;n<i;n+=1)t[r=s[n]]=e[r];return t}};function h(t,e){var n="",i=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(n+='in "'+t.mark.name+'" '),n+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!e&&t.mark.snippet&&(n+="\n\n"+t.mark.snippet),i+" "+n):i}function p(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=h(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}p.prototype=Object.create(Error.prototype),p.prototype.constructor=p,p.prototype.toString=function(t){return this.name+": "+h(this,t)};var f=p;function d(t,e,n,i,r){var s="",o="",a=Math.floor(r/2)-1;return i-e>a&&(e=i-a+(s=" ... ").length),n-i>a&&(n=i+a-(o=" ...").length),{str:s+t.slice(e,n).replace(/\t/g,"→")+o,pos:i-e+s.length}}function g(t,e){return c.repeat(" ",e-t.length)+t}var m=function(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),"number"!=typeof e.indent&&(e.indent=1),"number"!=typeof e.linesBefore&&(e.linesBefore=3),"number"!=typeof e.linesAfter&&(e.linesAfter=2);for(var n,i=/\r?\n|\r|\0/g,r=[0],s=[],o=-1;n=i.exec(t.buffer);)s.push(n.index),r.push(n.index+n[0].length),t.position<=n.index&&o<0&&(o=r.length-2);o<0&&(o=r.length-1);var a,u,l="",h=Math.min(t.line+e.linesAfter,s.length).toString().length,p=e.maxLength-(e.indent+h+3);for(a=1;a<=e.linesBefore&&!(o-a<0);a++)u=d(t.buffer,r[o-a],s[o-a],t.position-(r[o]-r[o-a]),p),l=c.repeat(" ",e.indent)+g((t.line-a+1).toString(),h)+" | "+u.str+"\n"+l;for(u=d(t.buffer,r[o],s[o],t.position,p),l+=c.repeat(" ",e.indent)+g((t.line+1).toString(),h)+" | "+u.str+"\n",l+=c.repeat("-",e.indent+h+3+u.pos)+"^\n",a=1;a<=e.linesAfter&&!(o+a>=s.length);a++)u=d(t.buffer,r[o+a],s[o+a],t.position-(r[o]-r[o+a]),p),l+=c.repeat(" ",e.indent)+g((t.line+a+1).toString(),h)+" | "+u.str+"\n";return l.replace(/\n$/,"")},y=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],v=["scalar","sequence","mapping"];var b=function(t,e){if(e=e||{},Object.keys(e).forEach((function(e){if(-1===y.indexOf(e))throw new f('Unknown option "'+e+'" is met in definition of "'+t+'" YAML type.')})),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=function(t){var e={};return null!==t&&Object.keys(t).forEach((function(n){t[n].forEach((function(t){e[String(t)]=n}))})),e}(e.styleAliases||null),-1===v.indexOf(this.kind))throw new f('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')};function _(t,e){var n=[];return t[e].forEach((function(t){var e=n.length;n.forEach((function(n,i){n.tag===t.tag&&n.kind===t.kind&&n.multi===t.multi&&(e=i)})),n[e]=t})),n}function k(t){return this.extend(t)}k.prototype.extend=function(t){var e=[],n=[];if(t instanceof b)n.push(t);else if(Array.isArray(t))n=n.concat(t);else{if(!t||!Array.isArray(t.implicit)&&!Array.isArray(t.explicit))throw new f("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.implicit&&(e=e.concat(t.implicit)),t.explicit&&(n=n.concat(t.explicit))}e.forEach((function(t){if(!(t instanceof b))throw new f("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(t.loadKind&&"scalar"!==t.loadKind)throw new f("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(t.multi)throw new f("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")})),n.forEach((function(t){if(!(t instanceof b))throw new f("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var i=Object.create(k.prototype);return i.implicit=(this.implicit||[]).concat(e),i.explicit=(this.explicit||[]).concat(n),i.compiledImplicit=_(i,"implicit"),i.compiledExplicit=_(i,"explicit"),i.compiledTypeMap=function(){var t,e,n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function i(t){t.multi?(n.multi[t.kind].push(t),n.multi.fallback.push(t)):n[t.kind][t.tag]=n.fallback[t.tag]=t}for(t=0,e=arguments.length;t<e;t+=1)arguments[t].forEach(i);return n}(i.compiledImplicit,i.compiledExplicit),i};var w=k,A=new b("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return null!==t?t:""}}),E=new b("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return null!==t?t:[]}}),x=new b("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return null!==t?t:{}}}),C=new w({explicit:[A,E,x]});var O=new b("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(t){if(null===t)return!0;var e=t.length;return 1===e&&"~"===t||4===e&&("null"===t||"Null"===t||"NULL"===t)},construct:function(){return null},predicate:function(t){return null===t},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});var S=new b("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(t){if(null===t)return!1;var e=t.length;return 4===e&&("true"===t||"True"===t||"TRUE"===t)||5===e&&("false"===t||"False"===t||"FALSE"===t)},construct:function(t){return"true"===t||"True"===t||"TRUE"===t},predicate:function(t){return"[object Boolean]"===Object.prototype.toString.call(t)},represent:{lowercase:function(t){return t?"true":"false"},uppercase:function(t){return t?"TRUE":"FALSE"},camelcase:function(t){return t?"True":"False"}},defaultStyle:"lowercase"});function I(t){return 48<=t&&t<=55}function T(t){return 48<=t&&t<=57}var j=new b("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(t){if(null===t)return!1;var e,n,i=t.length,r=0,s=!1;if(!i)return!1;if("-"!==(e=t[r])&&"+"!==e||(e=t[++r]),"0"===e){if(r+1===i)return!0;if("b"===(e=t[++r])){for(r++;r<i;r++)if("_"!==(e=t[r])){if("0"!==e&&"1"!==e)return!1;s=!0}return s&&"_"!==e}if("x"===e){for(r++;r<i;r++)if("_"!==(e=t[r])){if(!(48<=(n=t.charCodeAt(r))&&n<=57||65<=n&&n<=70||97<=n&&n<=102))return!1;s=!0}return s&&"_"!==e}if("o"===e){for(r++;r<i;r++)if("_"!==(e=t[r])){if(!I(t.charCodeAt(r)))return!1;s=!0}return s&&"_"!==e}}if("_"===e)return!1;for(;r<i;r++)if("_"!==(e=t[r])){if(!T(t.charCodeAt(r)))return!1;s=!0}return!(!s||"_"===e)},construct:function(t){var e,n=t,i=1;if(-1!==n.indexOf("_")&&(n=n.replace(/_/g,"")),"-"!==(e=n[0])&&"+"!==e||("-"===e&&(i=-1),e=(n=n.slice(1))[0]),"0"===n)return 0;if("0"===e){if("b"===n[1])return i*parseInt(n.slice(2),2);if("x"===n[1])return i*parseInt(n.slice(2),16);if("o"===n[1])return i*parseInt(n.slice(2),8)}return i*parseInt(n,10)},predicate:function(t){return"[object Number]"===Object.prototype.toString.call(t)&&t%1==0&&!c.isNegativeZero(t)},represent:{binary:function(t){return t>=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),q=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var M=/^[-+]?[0-9]+e/;var D=new b("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(t){return null!==t&&!(!q.test(t)||"_"===t[t.length-1])},construct:function(t){var e,n;return n="-"===(e=t.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),".inf"===e?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===e?NaN:n*parseFloat(e,10)},predicate:function(t){return"[object Number]"===Object.prototype.toString.call(t)&&(t%1!=0||c.isNegativeZero(t))},represent:function(t,e){var n;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(c.isNegativeZero(t))return"-0.0";return n=t.toString(10),M.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"}),L=C.extend({implicit:[O,S,j,D]}),F=L,R=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),N=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");var U=new b("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(t){return null!==t&&(null!==R.exec(t)||null!==N.exec(t))},construct:function(t){var e,n,i,r,s,o,a,u,l=0,c=null;if(null===(e=R.exec(t))&&(e=N.exec(t)),null===e)throw new Error("Date resolve error");if(n=+e[1],i=+e[2]-1,r=+e[3],!e[4])return new Date(Date.UTC(n,i,r));if(s=+e[4],o=+e[5],a=+e[6],e[7]){for(l=e[7].slice(0,3);l.length<3;)l+="0";l=+l}return e[9]&&(c=6e4*(60*+e[10]+ +(e[11]||0)),"-"===e[9]&&(c=-c)),u=new Date(Date.UTC(n,i,r,s,o,a,l)),c&&u.setTime(u.getTime()-c),u},instanceOf:Date,represent:function(t){return t.toISOString()}});var P=new b("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(t){return"<<"===t||null===t}}),K="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";var Q=new b("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(t){if(null===t)return!1;var e,n,i=0,r=t.length,s=K;for(n=0;n<r;n++)if(!((e=s.indexOf(t.charAt(n)))>64)){if(e<0)return!1;i+=6}return i%8==0},construct:function(t){var e,n,i=t.replace(/[\r\n=]/g,""),r=i.length,s=K,o=0,a=[];for(e=0;e<r;e++)e%4==0&&e&&(a.push(o>>16&255),a.push(o>>8&255),a.push(255&o)),o=o<<6|s.indexOf(i.charAt(e));return 0===(n=r%4*6)?(a.push(o>>16&255),a.push(o>>8&255),a.push(255&o)):18===n?(a.push(o>>10&255),a.push(o>>2&255)):12===n&&a.push(o>>4&255),new Uint8Array(a)},predicate:function(t){return"[object Uint8Array]"===Object.prototype.toString.call(t)},represent:function(t){var e,n,i="",r=0,s=t.length,o=K;for(e=0;e<s;e++)e%3==0&&e&&(i+=o[r>>18&63],i+=o[r>>12&63],i+=o[r>>6&63],i+=o[63&r]),r=(r<<8)+t[e];return 0===(n=s%3)?(i+=o[r>>18&63],i+=o[r>>12&63],i+=o[r>>6&63],i+=o[63&r]):2===n?(i+=o[r>>10&63],i+=o[r>>4&63],i+=o[r<<2&63],i+=o[64]):1===n&&(i+=o[r>>2&63],i+=o[r<<4&63],i+=o[64],i+=o[64]),i}}),z=Object.prototype.hasOwnProperty,B=Object.prototype.toString;var W=new b("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(t){if(null===t)return!0;var e,n,i,r,s,o=[],a=t;for(e=0,n=a.length;e<n;e+=1){if(i=a[e],s=!1,"[object Object]"!==B.call(i))return!1;for(r in i)if(z.call(i,r)){if(s)return!1;s=!0}if(!s)return!1;if(-1!==o.indexOf(r))return!1;o.push(r)}return!0},construct:function(t){return null!==t?t:[]}}),Y=Object.prototype.toString;var $=new b("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function(t){if(null===t)return!0;var e,n,i,r,s,o=t;for(s=new Array(o.length),e=0,n=o.length;e<n;e+=1){if(i=o[e],"[object Object]"!==Y.call(i))return!1;if(1!==(r=Object.keys(i)).length)return!1;s[e]=[r[0],i[r[0]]]}return!0},construct:function(t){if(null===t)return[];var e,n,i,r,s,o=t;for(s=new Array(o.length),e=0,n=o.length;e<n;e+=1)i=o[e],r=Object.keys(i),s[e]=[r[0],i[r[0]]];return s}}),H=Object.prototype.hasOwnProperty;var J=new b("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(t){if(null===t)return!0;var e,n=t;for(e in n)if(H.call(n,e)&&null!==n[e])return!1;return!0},construct:function(t){return null!==t?t:{}}}),G=F.extend({implicit:[U,P],explicit:[Q,W,$,J]}),Z=Object.prototype.hasOwnProperty,V=1,X=2,tt=3,et=4,nt=1,it=2,rt=3,st=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,ot=/[\x85\u2028\u2029]/,at=/[,\[\]\{\}]/,ut=/^(?:!|!!|![a-z\-]+!)$/i,lt=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function ct(t){return Object.prototype.toString.call(t)}function ht(t){return 10===t||13===t}function pt(t){return 9===t||32===t}function ft(t){return 9===t||32===t||10===t||13===t}function dt(t){return 44===t||91===t||93===t||123===t||125===t}function gt(t){var e;return 48<=t&&t<=57?t-48:97<=(e=32|t)&&e<=102?e-97+10:-1}function mt(t){return 48===t?"\0":97===t?"":98===t?"\b":116===t||9===t?"\t":110===t?"\n":118===t?"\v":102===t?"\f":114===t?"\r":101===t?"":32===t?" ":34===t?'"':47===t?"/":92===t?"\\":78===t?"…":95===t?" ":76===t?"\u2028":80===t?"\u2029":""}function yt(t){return t<=65535?String.fromCharCode(t):String.fromCharCode(55296+(t-65536>>10),56320+(t-65536&1023))}for(var vt=new Array(256),bt=new Array(256),_t=0;_t<256;_t++)vt[_t]=mt(_t)?1:0,bt[_t]=mt(_t);function kt(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||G,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function wt(t,e){var n={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return n.snippet=m(n),new f(e,n)}function At(t,e){throw wt(t,e)}function Et(t,e){t.onWarning&&t.onWarning.call(null,wt(t,e))}var xt={YAML:function(t,e,n){var i,r,s;null!==t.version&&At(t,"duplication of %YAML directive"),1!==n.length&&At(t,"YAML directive accepts exactly one argument"),null===(i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&At(t,"ill-formed argument of the YAML directive"),r=parseInt(i[1],10),s=parseInt(i[2],10),1!==r&&At(t,"unacceptable YAML version of the document"),t.version=n[0],t.checkLineBreaks=s<2,1!==s&&2!==s&&Et(t,"unsupported YAML version of the document")},TAG:function(t,e,n){var i,r;2!==n.length&&At(t,"TAG directive accepts exactly two arguments"),i=n[0],r=n[1],ut.test(i)||At(t,"ill-formed tag handle (first argument) of the TAG directive"),Z.call(t.tagMap,i)&&At(t,'there is a previously declared suffix for "'+i+'" tag handle'),lt.test(r)||At(t,"ill-formed tag prefix (second argument) of the TAG directive");try{r=decodeURIComponent(r)}catch(e){At(t,"tag prefix is malformed: "+r)}t.tagMap[i]=r}};function Ct(t,e,n,i){var r,s,o,a;if(e<n){if(a=t.input.slice(e,n),i)for(r=0,s=a.length;r<s;r+=1)9===(o=a.charCodeAt(r))||32<=o&&o<=1114111||At(t,"expected valid JSON character");else st.test(a)&&At(t,"the stream contains non-printable characters");t.result+=a}}function Ot(t,e,n,i){var r,s,o,a;for(c.isObject(n)||At(t,"cannot merge mappings; the provided source object is unacceptable"),o=0,a=(r=Object.keys(n)).length;o<a;o+=1)s=r[o],Z.call(e,s)||(e[s]=n[s],i[s]=!0)}function St(t,e,n,i,r,s,o,a,u){var l,c;if(Array.isArray(r))for(l=0,c=(r=Array.prototype.slice.call(r)).length;l<c;l+=1)Array.isArray(r[l])&&At(t,"nested arrays are not supported inside keys"),"object"==typeof r&&"[object Object]"===ct(r[l])&&(r[l]="[object Object]");if("object"==typeof r&&"[object Object]"===ct(r)&&(r="[object Object]"),r=String(r),null===e&&(e={}),"tag:yaml.org,2002:merge"===i)if(Array.isArray(s))for(l=0,c=s.length;l<c;l+=1)Ot(t,e,s[l],n);else Ot(t,e,s,n);else t.json||Z.call(n,r)||!Z.call(e,r)||(t.line=o||t.line,t.lineStart=a||t.lineStart,t.position=u||t.position,At(t,"duplicated mapping key")),"__proto__"===r?Object.defineProperty(e,r,{configurable:!0,enumerable:!0,writable:!0,value:s}):e[r]=s,delete n[r];return e}function It(t){var e;10===(e=t.input.charCodeAt(t.position))?t.position++:13===e?(t.position++,10===t.input.charCodeAt(t.position)&&t.position++):At(t,"a line break is expected"),t.line+=1,t.lineStart=t.position,t.firstTabInLine=-1}function Tt(t,e,n){for(var i=0,r=t.input.charCodeAt(t.position);0!==r;){for(;pt(r);)9===r&&-1===t.firstTabInLine&&(t.firstTabInLine=t.position),r=t.input.charCodeAt(++t.position);if(e&&35===r)do{r=t.input.charCodeAt(++t.position)}while(10!==r&&13!==r&&0!==r);if(!ht(r))break;for(It(t),r=t.input.charCodeAt(t.position),i++,t.lineIndent=0;32===r;)t.lineIndent++,r=t.input.charCodeAt(++t.position)}return-1!==n&&0!==i&&t.lineIndent<n&&Et(t,"deficient indentation"),i}function jt(t){var e,n=t.position;return!(45!==(e=t.input.charCodeAt(n))&&46!==e||e!==t.input.charCodeAt(n+1)||e!==t.input.charCodeAt(n+2)||(n+=3,0!==(e=t.input.charCodeAt(n))&&!ft(e)))}function qt(t,e){1===e?t.result+=" ":e>1&&(t.result+=c.repeat("\n",e-1))}function Mt(t,e){var n,i,r=t.tag,s=t.anchor,o=[],a=!1;if(-1!==t.firstTabInLine)return!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=o),i=t.input.charCodeAt(t.position);0!==i&&(-1!==t.firstTabInLine&&(t.position=t.firstTabInLine,At(t,"tab characters must not be used in indentation")),45===i)&&ft(t.input.charCodeAt(t.position+1));)if(a=!0,t.position++,Tt(t,!0,-1)&&t.lineIndent<=e)o.push(null),i=t.input.charCodeAt(t.position);else if(n=t.line,Ft(t,e,tt,!1,!0),o.push(t.result),Tt(t,!0,-1),i=t.input.charCodeAt(t.position),(t.line===n||t.lineIndent>e)&&0!==i)At(t,"bad indentation of a sequence entry");else if(t.lineIndent<e)break;return!!a&&(t.tag=r,t.anchor=s,t.kind="sequence",t.result=o,!0)}function Dt(t){var e,n,i,r,s=!1,o=!1;if(33!==(r=t.input.charCodeAt(t.position)))return!1;if(null!==t.tag&&At(t,"duplication of a tag property"),60===(r=t.input.charCodeAt(++t.position))?(s=!0,r=t.input.charCodeAt(++t.position)):33===r?(o=!0,n="!!",r=t.input.charCodeAt(++t.position)):n="!",e=t.position,s){do{r=t.input.charCodeAt(++t.position)}while(0!==r&&62!==r);t.position<t.length?(i=t.input.slice(e,t.position),r=t.input.charCodeAt(++t.position)):At(t,"unexpected end of the stream within a verbatim tag")}else{for(;0!==r&&!ft(r);)33===r&&(o?At(t,"tag suffix cannot contain exclamation marks"):(n=t.input.slice(e-1,t.position+1),ut.test(n)||At(t,"named tag handle cannot contain such characters"),o=!0,e=t.position+1)),r=t.input.charCodeAt(++t.position);i=t.input.slice(e,t.position),at.test(i)&&At(t,"tag suffix cannot contain flow indicator characters")}i&&!lt.test(i)&&At(t,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch(e){At(t,"tag name is malformed: "+i)}return s?t.tag=i:Z.call(t.tagMap,n)?t.tag=t.tagMap[n]+i:"!"===n?t.tag="!"+i:"!!"===n?t.tag="tag:yaml.org,2002:"+i:At(t,'undeclared tag handle "'+n+'"'),!0}function Lt(t){var e,n;if(38!==(n=t.input.charCodeAt(t.position)))return!1;for(null!==t.anchor&&At(t,"duplication of an anchor property"),n=t.input.charCodeAt(++t.position),e=t.position;0!==n&&!ft(n)&&!dt(n);)n=t.input.charCodeAt(++t.position);return t.position===e&&At(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(e,t.position),!0}function Ft(t,e,n,i,r){var s,o,a,u,l,h,p,f,d,g=1,m=!1,y=!1;if(null!==t.listener&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null,s=o=a=et===n||tt===n,i&&Tt(t,!0,-1)&&(m=!0,t.lineIndent>e?g=1:t.lineIndent===e?g=0:t.lineIndent<e&&(g=-1)),1===g)for(;Dt(t)||Lt(t);)Tt(t,!0,-1)?(m=!0,a=s,t.lineIndent>e?g=1:t.lineIndent===e?g=0:t.lineIndent<e&&(g=-1)):a=!1;if(a&&(a=m||r),1!==g&&et!==n||(f=V===n||X===n?e:e+1,d=t.position-t.lineStart,1===g?a&&(Mt(t,d)||function(t,e,n){var i,r,s,o,a,u,l,c=t.tag,h=t.anchor,p={},f=Object.create(null),d=null,g=null,m=null,y=!1,v=!1;if(-1!==t.firstTabInLine)return!1;for(null!==t.anchor&&(t.anchorMap[t.anchor]=p),l=t.input.charCodeAt(t.position);0!==l;){if(y||-1===t.firstTabInLine||(t.position=t.firstTabInLine,At(t,"tab characters must not be used in indentation")),i=t.input.charCodeAt(t.position+1),s=t.line,63!==l&&58!==l||!ft(i)){if(o=t.line,a=t.lineStart,u=t.position,!Ft(t,n,X,!1,!0))break;if(t.line===s){for(l=t.input.charCodeAt(t.position);pt(l);)l=t.input.charCodeAt(++t.position);if(58===l)ft(l=t.input.charCodeAt(++t.position))||At(t,"a whitespace character is expected after the key-value separator within a block mapping"),y&&(St(t,p,f,d,g,null,o,a,u),d=g=m=null),v=!0,y=!1,r=!1,d=t.tag,g=t.result;else{if(!v)return t.tag=c,t.anchor=h,!0;At(t,"can not read an implicit mapping pair; a colon is missed")}}else{if(!v)return t.tag=c,t.anchor=h,!0;At(t,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===l?(y&&(St(t,p,f,d,g,null,o,a,u),d=g=m=null),v=!0,y=!0,r=!0):y?(y=!1,r=!0):At(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,l=i;if((t.line===s||t.lineIndent>e)&&(y&&(o=t.line,a=t.lineStart,u=t.position),Ft(t,e,et,!0,r)&&(y?g=t.result:m=t.result),y||(St(t,p,f,d,g,m,o,a,u),d=g=m=null),Tt(t,!0,-1),l=t.input.charCodeAt(t.position)),(t.line===s||t.lineIndent>e)&&0!==l)At(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return y&&St(t,p,f,d,g,null,o,a,u),v&&(t.tag=c,t.anchor=h,t.kind="mapping",t.result=p),v}(t,d,f))||function(t,e){var n,i,r,s,o,a,u,l,c,h,p,f,d=!0,g=t.tag,m=t.anchor,y=Object.create(null);if(91===(f=t.input.charCodeAt(t.position)))o=93,l=!1,s=[];else{if(123!==f)return!1;o=125,l=!0,s={}}for(null!==t.anchor&&(t.anchorMap[t.anchor]=s),f=t.input.charCodeAt(++t.position);0!==f;){if(Tt(t,!0,e),(f=t.input.charCodeAt(t.position))===o)return t.position++,t.tag=g,t.anchor=m,t.kind=l?"mapping":"sequence",t.result=s,!0;d?44===f&&At(t,"expected the node content, but found ','"):At(t,"missed comma between flow collection entries"),p=null,a=u=!1,63===f&&ft(t.input.charCodeAt(t.position+1))&&(a=u=!0,t.position++,Tt(t,!0,e)),n=t.line,i=t.lineStart,r=t.position,Ft(t,e,V,!1,!0),h=t.tag,c=t.result,Tt(t,!0,e),f=t.input.charCodeAt(t.position),!u&&t.line!==n||58!==f||(a=!0,f=t.input.charCodeAt(++t.position),Tt(t,!0,e),Ft(t,e,V,!1,!0),p=t.result),l?St(t,s,y,h,c,p,n,i,r):a?s.push(St(t,null,y,h,c,p,n,i,r)):s.push(c),Tt(t,!0,e),44===(f=t.input.charCodeAt(t.position))?(d=!0,f=t.input.charCodeAt(++t.position)):d=!1}At(t,"unexpected end of the stream within a flow collection")}(t,f)?y=!0:(o&&function(t,e){var n,i,r,s,o,a=nt,u=!1,l=!1,h=e,p=0,f=!1;if(124===(s=t.input.charCodeAt(t.position)))i=!1;else{if(62!==s)return!1;i=!0}for(t.kind="scalar",t.result="";0!==s;)if(43===(s=t.input.charCodeAt(++t.position))||45===s)nt===a?a=43===s?rt:it:At(t,"repeat of a chomping mode identifier");else{if(!((r=48<=(o=s)&&o<=57?o-48:-1)>=0))break;0===r?At(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?At(t,"repeat of an indentation width identifier"):(h=e+r-1,l=!0)}if(pt(s)){do{s=t.input.charCodeAt(++t.position)}while(pt(s));if(35===s)do{s=t.input.charCodeAt(++t.position)}while(!ht(s)&&0!==s)}for(;0!==s;){for(It(t),t.lineIndent=0,s=t.input.charCodeAt(t.position);(!l||t.lineIndent<h)&&32===s;)t.lineIndent++,s=t.input.charCodeAt(++t.position);if(!l&&t.lineIndent>h&&(h=t.lineIndent),ht(s))p++;else{if(t.lineIndent<h){a===rt?t.result+=c.repeat("\n",u?1+p:p):a===nt&&u&&(t.result+="\n");break}for(i?pt(s)?(f=!0,t.result+=c.repeat("\n",u?1+p:p)):f?(f=!1,t.result+=c.repeat("\n",p+1)):0===p?u&&(t.result+=" "):t.result+=c.repeat("\n",p):t.result+=c.repeat("\n",u?1+p:p),u=!0,l=!0,p=0,n=t.position;!ht(s)&&0!==s;)s=t.input.charCodeAt(++t.position);Ct(t,n,t.position,!1)}}return!0}(t,f)||function(t,e){var n,i,r;if(39!==(n=t.input.charCodeAt(t.position)))return!1;for(t.kind="scalar",t.result="",t.position++,i=r=t.position;0!==(n=t.input.charCodeAt(t.position));)if(39===n){if(Ct(t,i,t.position,!0),39!==(n=t.input.charCodeAt(++t.position)))return!0;i=t.position,t.position++,r=t.position}else ht(n)?(Ct(t,i,r,!0),qt(t,Tt(t,!1,e)),i=r=t.position):t.position===t.lineStart&&jt(t)?At(t,"unexpected end of the document within a single quoted scalar"):(t.position++,r=t.position);At(t,"unexpected end of the stream within a single quoted scalar")}(t,f)||function(t,e){var n,i,r,s,o,a,u;if(34!==(a=t.input.charCodeAt(t.position)))return!1;for(t.kind="scalar",t.result="",t.position++,n=i=t.position;0!==(a=t.input.charCodeAt(t.position));){if(34===a)return Ct(t,n,t.position,!0),t.position++,!0;if(92===a){if(Ct(t,n,t.position,!0),ht(a=t.input.charCodeAt(++t.position)))Tt(t,!1,e);else if(a<256&&vt[a])t.result+=bt[a],t.position++;else if((o=120===(u=a)?2:117===u?4:85===u?8:0)>0){for(r=o,s=0;r>0;r--)(o=gt(a=t.input.charCodeAt(++t.position)))>=0?s=(s<<4)+o:At(t,"expected hexadecimal character");t.result+=yt(s),t.position++}else At(t,"unknown escape sequence");n=i=t.position}else ht(a)?(Ct(t,n,i,!0),qt(t,Tt(t,!1,e)),n=i=t.position):t.position===t.lineStart&&jt(t)?At(t,"unexpected end of the document within a double quoted scalar"):(t.position++,i=t.position)}At(t,"unexpected end of the stream within a double quoted scalar")}(t,f)?y=!0:!function(t){var e,n,i;if(42!==(i=t.input.charCodeAt(t.position)))return!1;for(i=t.input.charCodeAt(++t.position),e=t.position;0!==i&&!ft(i)&&!dt(i);)i=t.input.charCodeAt(++t.position);return t.position===e&&At(t,"name of an alias node must contain at least one character"),n=t.input.slice(e,t.position),Z.call(t.anchorMap,n)||At(t,'unidentified alias "'+n+'"'),t.result=t.anchorMap[n],Tt(t,!0,-1),!0}(t)?function(t,e,n){var i,r,s,o,a,u,l,c,h=t.kind,p=t.result;if(ft(c=t.input.charCodeAt(t.position))||dt(c)||35===c||38===c||42===c||33===c||124===c||62===c||39===c||34===c||37===c||64===c||96===c)return!1;if((63===c||45===c)&&(ft(i=t.input.charCodeAt(t.position+1))||n&&dt(i)))return!1;for(t.kind="scalar",t.result="",r=s=t.position,o=!1;0!==c;){if(58===c){if(ft(i=t.input.charCodeAt(t.position+1))||n&&dt(i))break}else if(35===c){if(ft(t.input.charCodeAt(t.position-1)))break}else{if(t.position===t.lineStart&&jt(t)||n&&dt(c))break;if(ht(c)){if(a=t.line,u=t.lineStart,l=t.lineIndent,Tt(t,!1,-1),t.lineIndent>=e){o=!0,c=t.input.charCodeAt(t.position);continue}t.position=s,t.line=a,t.lineStart=u,t.lineIndent=l;break}}o&&(Ct(t,r,s,!1),qt(t,t.line-a),r=s=t.position,o=!1),pt(c)||(s=t.position+1),c=t.input.charCodeAt(++t.position)}return Ct(t,r,s,!1),!!t.result||(t.kind=h,t.result=p,!1)}(t,f,V===n)&&(y=!0,null===t.tag&&(t.tag="?")):(y=!0,null===t.tag&&null===t.anchor||At(t,"alias node should not have any properties")),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):0===g&&(y=a&&Mt(t,d))),null===t.tag)null!==t.anchor&&(t.anchorMap[t.anchor]=t.result);else if("?"===t.tag){for(null!==t.result&&"scalar"!==t.kind&&At(t,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+t.kind+'"'),u=0,l=t.implicitTypes.length;u<l;u+=1)if((p=t.implicitTypes[u]).resolve(t.result)){t.result=p.construct(t.result),t.tag=p.tag,null!==t.anchor&&(t.anchorMap[t.anchor]=t.result);break}}else if("!"!==t.tag){if(Z.call(t.typeMap[t.kind||"fallback"],t.tag))p=t.typeMap[t.kind||"fallback"][t.tag];else for(p=null,u=0,l=(h=t.typeMap.multi[t.kind||"fallback"]).length;u<l;u+=1)if(t.tag.slice(0,h[u].tag.length)===h[u].tag){p=h[u];break}p||At(t,"unknown tag !<"+t.tag+">"),null!==t.result&&p.kind!==t.kind&&At(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+p.kind+'", not "'+t.kind+'"'),p.resolve(t.result,t.tag)?(t.result=p.construct(t.result,t.tag),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):At(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return null!==t.listener&&t.listener("close",t),null!==t.tag||null!==t.anchor||y}function Rt(t){var e,n,i,r,s=t.position,o=!1;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);0!==(r=t.input.charCodeAt(t.position))&&(Tt(t,!0,-1),r=t.input.charCodeAt(t.positi