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