@actual-app/web 23.8.1 → 23.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/README.md +42 -1
  2. package/build/apple-touch-icon.png +0 -0
  3. package/build/asset-manifest.json +25 -25
  4. package/build/index.html +1 -1
  5. package/build/kcab/kcab.worker.b835d2cdcf8004c363da.js +250 -0
  6. package/build/kcab/kcab.worker.b835d2cdcf8004c363da.js.map +1 -0
  7. package/build/kcab/xfo.xfo.kcab.worker.2ee5d7175d50b7896f28.js +1 -0
  8. package/build/static/css/main.476f35a5.css +359 -0
  9. package/build/static/css/main.476f35a5.css.map +1 -0
  10. package/build/static/js/231.370f17f8.chunk.js +2 -0
  11. package/build/static/js/231.370f17f8.chunk.js.map +1 -0
  12. package/build/static/js/389.c8f94185.chunk.js +2 -0
  13. package/build/static/js/389.c8f94185.chunk.js.map +1 -0
  14. package/build/static/js/473.02c273e8.chunk.js +2 -0
  15. package/build/static/js/473.02c273e8.chunk.js.map +1 -0
  16. package/build/static/js/678.bf349f5d.chunk.js +2 -0
  17. package/build/static/js/678.bf349f5d.chunk.js.map +1 -0
  18. package/build/static/js/713.1731d555.chunk.js +15 -0
  19. package/build/static/js/713.1731d555.chunk.js.map +1 -0
  20. package/build/static/js/main.7e6eedd0.js +188 -0
  21. package/build/static/js/main.7e6eedd0.js.map +1 -0
  22. package/build/static/js/narrow-components.11cf3591.chunk.js +2 -0
  23. package/build/static/js/narrow-components.11cf3591.chunk.js.map +1 -0
  24. package/build/static/js/reports.39b7254a.chunk.js +2 -0
  25. package/build/static/js/reports.39b7254a.chunk.js.map +1 -0
  26. package/build/static/js/resize-observer-polyfill.98a18736.chunk.js +2 -0
  27. package/build/static/js/resize-observer-polyfill.98a18736.chunk.js.map +1 -0
  28. package/build/static/js/wide-components.fd8595f4.chunk.js +2 -0
  29. package/build/static/js/wide-components.fd8595f4.chunk.js.map +1 -0
  30. package/build/static/media/browser-server.20abc230cfc504c53fa0.js +1 -0
  31. package/package.json +25 -19
  32. package/build/kcab/kcab.worker.61dd77d50c3de3a5c965.js +0 -3
  33. package/build/kcab/kcab.worker.61dd77d50c3de3a5c965.js.LICENSE.txt +0 -24
  34. package/build/kcab/kcab.worker.61dd77d50c3de3a5c965.js.map +0 -1
  35. package/build/kcab/xfo.xfo.kcab.worker.e800a4a41b9557f2726d.js +0 -1
  36. package/build/static/css/main.90cc2688.css +0 -7
  37. package/build/static/css/main.90cc2688.css.map +0 -1
  38. package/build/static/js/281.6bb03bd1.chunk.js +0 -2
  39. package/build/static/js/281.6bb03bd1.chunk.js.map +0 -1
  40. package/build/static/js/383.1b04bac1.chunk.js +0 -2
  41. package/build/static/js/383.1b04bac1.chunk.js.map +0 -1
  42. package/build/static/js/457.4c255aed.chunk.js +0 -2
  43. package/build/static/js/457.4c255aed.chunk.js.map +0 -1
  44. package/build/static/js/876.00fe0e63.chunk.js +0 -2
  45. package/build/static/js/876.00fe0e63.chunk.js.map +0 -1
  46. package/build/static/js/969.b56f4e53.chunk.js +0 -2
  47. package/build/static/js/969.b56f4e53.chunk.js.map +0 -1
  48. package/build/static/js/main.b9496410.js +0 -3
  49. package/build/static/js/main.b9496410.js.LICENSE.txt +0 -178
  50. package/build/static/js/main.b9496410.js.map +0 -1
  51. package/build/static/js/narrow-components.55a3b7fd.chunk.js +0 -2
  52. package/build/static/js/narrow-components.55a3b7fd.chunk.js.map +0 -1
  53. package/build/static/js/reports.689f3940.chunk.js +0 -2
  54. package/build/static/js/reports.689f3940.chunk.js.map +0 -1
  55. package/build/static/js/resize-observer-polyfill.68c3249b.chunk.js +0 -2
  56. package/build/static/js/resize-observer-polyfill.68c3249b.chunk.js.map +0 -1
  57. package/build/static/js/wide-components.e3cfa9ca.chunk.js +0 -2
  58. package/build/static/js/wide-components.e3cfa9ca.chunk.js.map +0 -1
  59. package/build/static/media/browser-server.14ed34b8682d7b10163f.js +0 -1
@@ -0,0 +1,250 @@
1
+ var backend;(()=>{var __webpack_modules__={9298:($,ee,et)=>{var en="/";$=et.nmd($);var ei=et(4155);var eo=et(8764)["Buffer"];var es=undefined;var eu=function(ee){if(es){return es}es=new Promise(function(es,eu){var el=typeof ee!=="undefined"?ee:{};var ef=el["onAbort"];el["onAbort"]=function($){eu(new Error($));if(ef){ef($)}};el["postRun"]=el["postRun"]||[];el["postRun"].push(function(){es(el)});$=undefined;var el;el||(el=typeof el!=="undefined"?el:{});null;el.onRuntimeInitialized=function(){function $($,ee){this.Qa=$;this.db=ee;this.Pa=1;this.wb=[]}function ee($,ee){this.db=ee;ee=eK($)+1;this.hb=t0(ee);if(null===this.hb)throw Error("Unable to allocate memory for the SQL string");eY($,eQ,this.hb,ee);this.sb=this.hb;this.eb=this.Mb=null}function et($,{filename:ee=!1}={}){!1===ee?(this.filename="dbfile_"+(4294967295*Math.random()>>>0),this.Xc=!0,null!=$&&tU.zb("/",this.filename,$,!0,!0)):this.filename=$;this.handleError(eo(this.filename,en));this.db=eP(en,"i32");e3(this.db);this.nb={};this.Xa={}}var en=t7(4),ei=el.cwrap,eo=ei("sqlite3_open","number",["string","number"]),es=ei("sqlite3_close_v2","number",["number"]),eu=ei("sqlite3_exec","number",["number","string","number","number","number"]),ef=ei("sqlite3_changes","number",["number"]),ed=ei("sqlite3_prepare_v2","number",["number","string","number","number","number"]),ep=ei("sqlite3_sql","string",["number"]),eh=ei("sqlite3_normalized_sql","string",["number"]),ey=ei("sqlite3_prepare_v2","number",["number","number","number","number","number"]),eg=ei("sqlite3_bind_text","number",["number","number","number","number","number"]),em=ei("sqlite3_bind_blob","number",["number","number","number","number","number"]),e_=ei("sqlite3_bind_double","number",["number","number","number"]),ew=ei("sqlite3_bind_int","number",["number","number","number"]),eE=ei("sqlite3_bind_parameter_index","number",["number","string"]),eS=ei("sqlite3_step","number",["number"]),eT=ei("sqlite3_errmsg","string",["number"]),eO=ei("sqlite3_column_count","number",["number"]),eA=ei("sqlite3_data_count","number",["number"]),eI=ei("sqlite3_column_double","number",["number","number"]),eN=ei("sqlite3_column_text","string",["number","number"]),eD=ei("sqlite3_column_blob","number",["number","number"]),ek=ei("sqlite3_column_bytes","number",["number","number"]),eM=ei("sqlite3_column_type","number",["number","number"]),eF=ei("sqlite3_column_name","string",["number","number"]),eB=ei("sqlite3_reset","number",["number"]),eU=ei("sqlite3_clear_bindings","number",["number"]),ej=ei("sqlite3_finalize","number",["number"]),eW=ei("sqlite3_create_function_v2","number","number string number number number number number number number".split(" ")),eH=ei("sqlite3_value_type","number",["number"]),ez=ei("sqlite3_value_bytes","number",["number"]),e$=ei("sqlite3_value_text","string",["number"]),eq=ei("sqlite3_value_blob","number",["number"]),eZ=ei("sqlite3_value_double","number",["number"]),eJ=ei("sqlite3_result_double","",["number","number"]),e0=ei("sqlite3_result_null","",["number"]),e1=ei("sqlite3_result_text","",["number","string","number","number"]),e2=ei("sqlite3_result_blob","",["number","number","number","number"]),e6=ei("sqlite3_result_int","",["number","number"]),e4=ei("sqlite3_result_error","",["number","string","number"]),e3=ei("RegisterExtensionFunctions","number",["number"]);$.prototype.bind=function($){if(!this.Qa)throw"Statement closed";this.reset();return Array.isArray($)?this.vc($):null!=$&&"object"===typeof $?this.wc($):!0};$.prototype.step=function(){if(!this.Qa)throw"Statement closed";this.Pa=1;var $=eS(this.Qa);switch($){case 100:return!0;case 101:return!1;default:throw this.db.handleError($)}};$.prototype.Pc=function($){null==$&&($=this.Pa,this.Pa+=1);return eI(this.Qa,$)};$.prototype.Qc=function($){null==$&&($=this.Pa,this.Pa+=1);return eN(this.Qa,$)};$.prototype.getBlob=function($){null==$&&($=this.Pa,this.Pa+=1);var ee=ek(this.Qa,$);$=eD(this.Qa,$);for(var et=new Uint8Array(ee),en=0;en<ee;en+=1)et[en]=eX[$+en];return et};$.prototype.get=function($){null!=$&&this.bind($)&&this.step();$=[];for(var ee=eA(this.Qa),et=0;et<ee;et+=1)switch(eM(this.Qa,et)){case 1:case 2:$.push(this.Pc(et));break;case 3:$.push(this.Qc(et));break;case 4:$.push(this.getBlob(et));break;default:$.push(null)}return $};$.prototype.getColumnNames=function(){for(var $=[],ee=eO(this.Qa),et=0;et<ee;et+=1)$.push(eF(this.Qa,et));return $};$.prototype.getAsObject=function($){$=this.get($);for(var ee=this.getColumnNames(),et={},en=0;en<ee.length;en+=1)et[ee[en]]=$[en];return et};$.prototype.getSQL=function(){return ep(this.Qa)};$.prototype.getNormalizedSQL=function(){return eh(this.Qa)};$.prototype.run=function($){null!=$&&this.bind($);this.step();return this.reset()};$.prototype.zc=function($,ee){null==ee&&(ee=this.Pa,this.Pa+=1);$=tJ($);var et=eV($);this.wb.push(et);this.db.handleError(eg(this.Qa,ee,et,$.length-1,0))};$.prototype.uc=function($,ee){null==ee&&(ee=this.Pa,this.Pa+=1);var et=eV($);this.wb.push(et);this.db.handleError(em(this.Qa,ee,et,$.length,0))};$.prototype.yc=function($,ee){null==ee&&(ee=this.Pa,this.Pa+=1);this.db.handleError(($===($|0)?ew:e_)(this.Qa,ee,$))};$.prototype.xc=function($){null==$&&($=this.Pa,this.Pa+=1);em(this.Qa,$,0,0,0)};$.prototype.Tb=function($,ee){null==ee&&(ee=this.Pa,this.Pa+=1);switch(typeof $){case"string":this.zc($,ee);return;case"number":case"boolean":this.yc($+0,ee);return;case"object":if(null===$){this.xc(ee);return}if(null!=$.length){this.uc($,ee);return}}throw"Wrong API use : tried to bind a value of an unknown type ("+$+")."};$.prototype.wc=function($){var ee=this;Object.keys($).forEach(function(et){var en=eE(ee.Qa,et);0!==en&&ee.Tb($[et],en)});return!0};$.prototype.vc=function($){for(var ee=0;ee<$.length;ee+=1)this.Tb($[ee],ee+1);return!0};$.prototype.reset=function(){return 0===eU(this.Qa)&&0===eB(this.Qa)};$.prototype.freemem=function(){for(var $;void 0!==($=this.wb.pop());)t6($)};$.prototype.free=function(){var $=0===ej(this.Qa);delete this.db.nb[this.Qa];this.Qa=0;return $};ee.prototype.next=function(){if(null===this.hb)return{done:!0};null!==this.eb&&(this.eb.free(),this.eb=null);if(!this.db.db)throw this.Bb(),Error("Database closed");var ee=t5(),et=t7(4);eL(en);eL(et);try{this.db.handleError(ey(this.db.db,this.sb,-1,en,et));this.sb=eP(et,"i32");var ei=eP(en,"i32");if(0===ei)return this.Bb(),{done:!0};this.eb=new $(ei,this.db);this.db.nb[ei]=this.eb;return{value:this.eb,done:!1}}catch($){throw this.Mb=eG(this.sb),this.Bb(),$}finally{t9(ee)}};ee.prototype.Bb=function(){t6(this.hb);this.hb=null};ee.prototype.getRemainingSQL=function(){return null!==this.Mb?this.Mb:eG(this.sb)};"function"===typeof Symbol&&"symbol"===typeof Symbol.iterator&&(ee.prototype[Symbol.iterator]=function(){return this});et.prototype.run=function($,ee){if(!this.db)throw"Database closed";if(ee){$=this.prepare($,ee);try{$.step()}finally{$.free()}}else this.handleError(eu(this.db,$,0,0,en));return this};et.prototype.exec=function(ee,et){if(!this.db)throw"Database closed";var ei=t5(),eo=null;try{var es=eK(ee)+1,eu=t7(es);eY(ee,eX,eu,es);var el=eu;var ef=t7(4);for(ee=[];0!==eP(el,"i8");){eL(en);eL(ef);this.handleError(ey(this.db,el,-1,en,ef));var ed=eP(en,"i32");el=eP(ef,"i32");if(0!==ed){es=null;eo=new $(ed,this);for(null!=et&&eo.bind(et);eo.step();)null===es&&(es={columns:eo.getColumnNames(),values:[]},ee.push(es)),es.values.push(eo.get());eo.free()}}return ee}catch($){throw eo&&eo.free(),$}finally{t9(ei)}};et.prototype.each=function($,ee,et,en){"function"===typeof ee&&(en=et,et=ee,ee=void 0);$=this.prepare($,ee);try{for(;$.step();)et($.getAsObject())}finally{$.free()}if("function"===typeof en)return en()};et.prototype.prepare=function(ee,et){eL(en);this.handleError(ed(this.db,ee,-1,en,0));ee=eP(en,"i32");if(0===ee)throw"Nothing to prepare";var ei=new $(ee,this);null!=et&&ei.bind(et);return this.nb[ee]=ei};et.prototype.iterateStatements=function($){return new ee($,this)};et.prototype["export"]=function(){Object.values(this.nb).forEach(function($){$.free()});Object.values(this.Xa).forEach(eR);this.Xa={};this.handleError(es(this.db));var $=tU.readFile(this.filename,{encoding:"binary"});this.handleError(eo(this.filename,en));this.db=eP(en,"i32");return $};et.prototype.close=function(){null!==this.db&&(Object.values(this.nb).forEach(function($){$.free()}),Object.values(this.Xa).forEach(eR),this.Xa={},this.handleError(es(this.db)),this.Xc&&tU.unlink("/"+this.filename),this.db=null)};et.prototype.handleError=function($){if(0===$)return null;$=eT(this.db);throw Error($)};et.prototype.getRowsModified=function(){return ef(this.db)};et.prototype.create_function=function($,ee){Object.prototype.hasOwnProperty.call(this.Xa,$)&&(eR(this.Xa[$]),delete this.Xa[$]);var et=eC(function($,et,en){for(var ei,eo=[],es=0;es<et;es+=1){var eu=eP(en+4*es,"i32"),el=eH(eu);if(1===el||2===el)eu=eZ(eu);else if(3===el)eu=e$(eu);else if(4===el){el=eu;eu=ez(el);el=eq(el);for(var ef=new Uint8Array(eu),ed=0;ed<eu;ed+=1)ef[ed]=eX[el+ed];eu=ef}else eu=null;eo.push(eu)}try{ei=ee.apply(null,eo)}catch(ee){e4($,ee,-1);return}switch(typeof ei){case"boolean":e6($,ei?1:0);break;case"number":eJ($,ei);break;case"string":e1($,ei,-1,-1);break;case"object":null===ei?e0($):null!=ei.length?(et=eV(ei),e2($,et,ei.length,-1),t6(et)):e4($,"Wrong API use : tried to return a value of an unknown type ("+ei+").",-1);break;default:e0($)}},"viii");this.Xa[$]=et;this.handleError(eW(this.db,$,ee.length,1,0,et,0,0,0));return this};el.Database=et;var e8=new Map;el.register_for_idb=$=>{let ee=eC(function(ee,et){ee=e8.get(ee);return $.lock(ee,et)?0:5},"iii"),et=eC(function(ee,et){ee=e8.get(ee);$.unlock(ee,et);return 0},"iii"),en=eC(function($,ee){$=eG($);e8.set(ee,$)},"vii");el._register_for_idb(ee,et,en)};el.cleanup_file=$=>{let ee=[...e8.entries()].find(ee=>ee[1]===$);e8.delete(ee[0])};el.reset_filesystem=()=>{tU.root=null;tU.lc()}};var ed={},ep;for(ep in el)el.hasOwnProperty(ep)&&(ed[ep]=el[ep]);var eh="./this.program",ey="object"===typeof window,eg="function"===typeof importScripts,em="object"===typeof ei&&"object"===typeof ei.versions&&"string"===typeof ei.versions.node,e_="",ew,eE,eS,eT,eO;if(em)e_=eg?et(6470).dirname(e_)+"/":en+"/",ew=function($,ee){eT||(eT=et(6551));eO||(eO=et(6470));$=eO.normalize($);return eT.readFileSync($,ee?null:"utf8")},eS=function($){$=ew($,!0);$.buffer||($=new Uint8Array($));eU($.buffer);return $},eE=function($,ee,en){eT||(eT=et(6551));eO||(eO=et(6470));$=eO.normalize($);eT.readFile($,function($,et){$?en($):ee(et.buffer)})},1<ei.argv.length&&(eh=ei.argv[1].replace(/\\/g,"/")),ei.argv.slice(2),true&&($.exports=el),el.inspect=function(){return"[Emscripten Module object]"};else if(ey||eg)eg?e_=self.location.href:"undefined"!==typeof document&&document.currentScript&&(e_=document.currentScript.src),e_=0!==e_.indexOf("blob:")?e_.substr(0,e_.lastIndexOf("/")+1):"",ew=function($){var ee=new XMLHttpRequest;ee.open("GET",$,!1);ee.send(null);return ee.responseText},eg&&(eS=function($){var ee=new XMLHttpRequest;ee.open("GET",$,!1);ee.responseType="arraybuffer";ee.send(null);return new Uint8Array(ee.response)}),eE=function($,ee,et){var en=new XMLHttpRequest;en.open("GET",$,!0);en.responseType="arraybuffer";en.onload=function(){200==en.status||0==en.status&&en.response?ee(en.response):et()};en.onerror=et;en.send(null)};var eA=el.print||console.log.bind(console),eI=el.printErr||console.warn.bind(console);for(ep in ed)ed.hasOwnProperty(ep)&&(el[ep]=ed[ep]);ed=null;el.thisProgram&&(eh=el.thisProgram);var eN=[],eD;function eR($){eD.delete(e3.get($));eN.push($)}function eC($,ee){if(!eD){eD=new WeakMap;for(var et=0;et<e3.length;et++){var en=e3.get(et);en&&eD.set(en,et)}}if(eD.has($))$=eD.get($);else{if(eN.length)et=eN.pop();else{try{e3.grow(1)}catch($){if(!($ instanceof RangeError))throw $;throw"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH."}et=e3.length-1}try{e3.set(et,$)}catch(eu){if(!(eu instanceof TypeError))throw eu;if("function"===typeof WebAssembly.Function){var ei={i:"i32",j:"i64",f:"f32",d:"f64"},eo={parameters:[],results:"v"==ee[0]?[]:[ei[ee[0]]]};for(en=1;en<ee.length;++en)eo.parameters.push(ei[ee[en]]);ee=new WebAssembly.Function(eo,$)}else{ei=[1,0,1,96];eo=ee.slice(0,1);ee=ee.slice(1);var es={i:127,j:126,f:125,d:124};ei.push(ee.length);for(en=0;en<ee.length;++en)ei.push(es[ee[en]]);"v"==eo?ei.push(0):ei=ei.concat([1,es[eo]]);ei[1]=ei.length-2;ee=new Uint8Array([0,97,115,109,1,0,0,0].concat(ei,[2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0]));ee=new WebAssembly.Module(ee);ee=new WebAssembly.Instance(ee,{e:{f:$}}).exports.f}e3.set(et,ee)}eD.set($,et);$=et}return $}var ek;el.wasmBinary&&(ek=el.wasmBinary);var eM=el.noExitRuntime||!0;"object"!==typeof WebAssembly&&tu("no native wasm support detected");function eL($){var ee="i32";"*"===ee.charAt(ee.length-1)&&(ee="i32");switch(ee){case"i1":eX[$>>0]=0;break;case"i8":eX[$>>0]=0;break;case"i16":e0[$>>1]=0;break;case"i32":e1[$>>2]=0;break;case"i64":tm=[0,(ty=0,1<=+Math.abs(ty)?0<ty?(Math.min(+Math.floor(ty/4294967296),4294967295)|0)>>>0:~~+Math.ceil((ty-+(~~ty>>>0))/4294967296)>>>0:0)];e1[$>>2]=tm[0];e1[$+4>>2]=tm[1];break;case"float":e2[$>>2]=0;break;case"double":e6[$>>3]=0;break;default:tu("invalid type for setValue: "+ee)}}function eP($,ee){ee=ee||"i8";"*"===ee.charAt(ee.length-1)&&(ee="i32");switch(ee){case"i1":return eX[$>>0];case"i8":return eX[$>>0];case"i16":return e0[$>>1];case"i32":return e1[$>>2];case"i64":return e1[$>>2];case"float":return e2[$>>2];case"double":return e6[$>>3];default:tu("invalid type for getValue: "+ee)}return null}var eF,eB=!1;function eU($,ee){$||tu("Assertion failed: "+ee)}function ej($){var ee=el["_"+$];eU(ee,"Cannot call unknown function "+$+", make sure it is exported");return ee}function eW($,ee,et,en){var ei={string:function($){var ee=0;if(null!==$&&void 0!==$&&0!==$){var et=($.length<<2)+1;ee=t7(et);eY($,eQ,ee,et)}return ee},array:function($){var ee=t7($.length);eX.set($,ee);return ee}},eo=ej($),es=[];$=0;if(en)for(var eu=0;eu<en.length;eu++){var el=ei[et[eu]];el?(0===$&&($=t5()),es[eu]=el(en[eu])):es[eu]=en[eu]}et=eo.apply(null,es);et=function($){return"string"===ee?eG($):"boolean"===ee?!!$:$}(et);0!==$&&t9($);return et}var eH=0,ez=1;function eV($){var ee=eH==ez?t7($.length):t0($.length);$.subarray||$.slice?eQ.set($,ee):eQ.set(new Uint8Array($),ee);return ee}var e$="undefined"!==typeof TextDecoder?new TextDecoder("utf8"):void 0;function eq($,ee,et){var en=ee+et;for(et=ee;$[et]&&!(et>=en);)++et;if(16<et-ee&&$.subarray&&e$)return e$.decode($.subarray(ee,et));for(en="";ee<et;){var ei=$[ee++];if(ei&128){var eo=$[ee++]&63;if(192==(ei&224))en+=String.fromCharCode((ei&31)<<6|eo);else{var es=$[ee++]&63;ei=224==(ei&240)?(ei&15)<<12|eo<<6|es:(ei&7)<<18|eo<<12|es<<6|$[ee++]&63;65536>ei?en+=String.fromCharCode(ei):(ei-=65536,en+=String.fromCharCode(55296|ei>>10,56320|ei&1023))}}else en+=String.fromCharCode(ei)}return en}function eG($,ee){return $?eq(eQ,$,ee):""}function eY($,ee,et,en){if(!(0<en))return 0;var ei=et;en=et+en-1;for(var eo=0;eo<$.length;++eo){var es=$.charCodeAt(eo);if(55296<=es&&57343>=es){var eu=$.charCodeAt(++eo);es=65536+((es&1023)<<10)|eu&1023}if(127>=es){if(et>=en)break;ee[et++]=es}else{if(2047>=es){if(et+1>=en)break;ee[et++]=192|es>>6}else{if(65535>=es){if(et+2>=en)break;ee[et++]=224|es>>12}else{if(et+3>=en)break;ee[et++]=240|es>>18;ee[et++]=128|es>>12&63}ee[et++]=128|es>>6&63}ee[et++]=128|es&63}}ee[et]=0;return et-ei}function eK($){for(var ee=0,et=0;et<$.length;++et){var en=$.charCodeAt(et);55296<=en&&57343>=en&&(en=65536+((en&1023)<<10)|$.charCodeAt(++et)&1023);127>=en?++ee:ee=2047>=en?ee+2:65535>=en?ee+3:ee+4}return ee}function eZ($){var ee=eK($)+1,et=t0(ee);et&&eY($,eX,et,ee);return et}var eJ,eX,eQ,e0,e1,e2,e6;function e4(){var $=eF.buffer;eJ=$;el.HEAP8=eX=new Int8Array($);el.HEAP16=e0=new Int16Array($);el.HEAP32=e1=new Int32Array($);el.HEAPU8=eQ=new Uint8Array($);el.HEAPU16=new Uint16Array($);el.HEAPU32=new Uint32Array($);el.HEAPF32=e2=new Float32Array($);el.HEAPF64=e6=new Float64Array($)}var e3,e8=[],e5=[],e9=[];function e7(){var $=el.preRun.shift();e8.unshift($)}var te=0,tt=null,tr=null;function tn(){te++;el.monitorRunDependencies&&el.monitorRunDependencies(te)}function ti(){te--;el.monitorRunDependencies&&el.monitorRunDependencies(te);if(0==te&&(null!==tt&&(clearInterval(tt),tt=null),tr)){var $=tr;tr=null;$()}}el.preloadedImages={};el.preloadedAudios={};function tu($){if(el.onAbort)el.onAbort($);eI($);eB=!0;throw new WebAssembly.RuntimeError("abort("+$+"). Build with -s ASSERTIONS=1 for more info.")}function tc(){return tf.startsWith("data:application/octet-stream;base64,")}var tf;tf="sql-wasm.wasm";if(!tc()){var td=tf;tf=el.locateFile?el.locateFile(td,e_):e_+td}function tp(){var $=tf;try{if($==tf&&ek)return new Uint8Array(ek);if(eS)return eS($);throw"both async and sync fetching of the wasm failed"}catch($){tu($)}}function th(){if(!ek&&(ey||eg)){if("function"===typeof fetch&&!tf.startsWith("file://"))return fetch(tf,{credentials:"same-origin"}).then(function($){if(!$.ok)throw"failed to load wasm binary file at '"+tf+"'";return $.arrayBuffer()}).catch(function(){return tp()});if(eE)return new Promise(function($,ee){eE(tf,function(ee){$(new Uint8Array(ee))},ee)})}return Promise.resolve().then(function(){return tp()})}var ty,tm;function t_($){for(;0<$.length;){var ee=$.shift();if("function"==typeof ee)ee(el);else{var et=ee.pd;"number"===typeof et?void 0===ee.yb?e3.get(et)():e3.get(et)(ee.yb):et(void 0===ee.yb?null:ee.yb)}}}function tv($){return $.replace(/\b_Z[\w\d_]+/g,function($){return $===$?$:$+" ["+$+"]"})}function tw(){function $($){return($=$.toTimeString().match(/\(([A-Za-z ]+)\)$/))?$[1]:"GMT"}if(!tE){tE=!0;var ee=(new Date).getFullYear(),et=new Date(ee,0,1),en=new Date(ee,6,1);ee=et.getTimezoneOffset();var ei=en.getTimezoneOffset(),eo=Math.max(ee,ei);e1[t8()>>2]=60*eo;e1[t3()>>2]=Number(ee!=ei);et=$(et);en=$(en);et=eZ(et);en=eZ(en);ei<ee?(e1[t4()>>2]=et,e1[t4()+4>>2]=en):(e1[t4()>>2]=en,e1[t4()+4>>2]=et)}}var tE;function tS($,ee){for(var et=0,en=$.length-1;0<=en;en--){var ei=$[en];"."===ei?$.splice(en,1):".."===ei?($.splice(en,1),et++):et&&($.splice(en,1),et--)}if(ee)for(;et;et--)$.unshift("..");return $}function tT($){var ee="/"===$.charAt(0),et="/"===$.substr(-1);($=tS($.split("/").filter(function($){return!!$}),!ee).join("/"))||ee||($=".");$&&et&&($+="/");return(ee?"/":"")+$}function tO($){var ee=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec($).slice(1);$=ee[0];ee=ee[1];if(!$&&!ee)return".";ee&&(ee=ee.substr(0,ee.length-1));return $+ee}function tA($){if("/"===$)return"/";$=tT($);$=$.replace(/\/$/,"");var ee=$.lastIndexOf("/");return-1===ee?$:$.substr(ee+1)}function tI($,ee){return tT($+"/"+ee)}function tN(){if("object"===typeof crypto&&"function"===typeof crypto.getRandomValues){var $=new Uint8Array(1);return function(){crypto.getRandomValues($);return $[0]}}if(em)try{var ee=et(2074);return function(){return ee.randomBytes(1)[0]}}catch($){}return function(){tu("randomDevice")}}function tD(){for(var $="",ee=!1,et=arguments.length-1;-1<=et&&!ee;et--){ee=0<=et?arguments[et]:tU.cwd();if("string"!==typeof ee)throw new TypeError("Arguments to path.resolve must be strings");if(!ee)return"";$=ee+"/"+$;ee="/"===ee.charAt(0)}$=tS($.split("/").filter(function($){return!!$}),!ee).join("/");return(ee?"/":"")+$||"."}function tR($,ee){function et($){for(var ee=0;ee<$.length&&""===$[ee];ee++);for(var et=$.length-1;0<=et&&""===$[et];et--);return ee>et?[]:$.slice(ee,et-ee+1)}$=tD($).substr(1);ee=tD(ee).substr(1);$=et($.split("/"));ee=et(ee.split("/"));for(var en=Math.min($.length,ee.length),ei=en,eo=0;eo<en;eo++)if($[eo]!==ee[eo]){ei=eo;break}en=[];for(eo=ei;eo<$.length;eo++)en.push("..");en=en.concat(ee.slice(ei));return en.join("/")}var tC=[];function tk($,ee){tC[$]={input:[],output:[],gb:ee};tU.Qb($,tM)}var tM={open:function($){var ee=tC[$.node.rdev];if(!ee)throw new tU.ErrnoError(43);$.tty=ee;$.seekable=!1},close:function($){$.tty.gb.flush($.tty)},flush:function($){$.tty.gb.flush($.tty)},read:function($,ee,et,en){if(!$.tty||!$.tty.gb.cc)throw new tU.ErrnoError(60);for(var ei=0,eo=0;eo<en;eo++){try{var es=$.tty.gb.cc($.tty)}catch($){throw new tU.ErrnoError(29)}if(void 0===es&&0===ei)throw new tU.ErrnoError(6);if(null===es||void 0===es)break;ei++;ee[et+eo]=es}ei&&($.node.timestamp=Date.now());return ei},write:function($,ee,et,en){if(!$.tty||!$.tty.gb.Nb)throw new tU.ErrnoError(60);try{for(var ei=0;ei<en;ei++)$.tty.gb.Nb($.tty,ee[et+ei])}catch($){throw new tU.ErrnoError(29)}en&&($.node.timestamp=Date.now());return ei}},tL={cc:function($){if(!$.input.length){var ee=null;if(em){var et=eo.alloc(256),en=0;try{en=eT.readSync(ei.stdin.fd,et,0,256,null)}catch($){if($.toString().includes("EOF"))en=0;else throw $}0<en?ee=et.slice(0,en).toString("utf-8"):ee=null}else"undefined"!=typeof window&&"function"==typeof window.prompt?(ee=window.prompt("Input: "),null!==ee&&(ee+="\n")):"function"==typeof readline&&(ee=readline(),null!==ee&&(ee+="\n"));if(!ee)return null;$.input=tJ(ee,!0)}return $.input.shift()},Nb:function($,ee){null===ee||10===ee?(eA(eq($.output,0)),$.output=[]):0!=ee&&$.output.push(ee)},flush:function($){$.output&&0<$.output.length&&(eA(eq($.output,0)),$.output=[])}},tx={Nb:function($,ee){null===ee||10===ee?(eI(eq($.output,0)),$.output=[]):0!=ee&&$.output.push(ee)},flush:function($){$.output&&0<$.output.length&&(eI(eq($.output,0)),$.output=[])}};function tP($){$=65536*Math.ceil($/65536);var ee=rr(65536,$);if(!ee)return 0;eQ.fill(0,ee,ee+$);return ee}var tF={Va:null,mount:function(){return tF.createNode(null,"/",16895,0)},createNode:function($,ee,et,en){if(tU.Rc(et)||tU.isFIFO(et))throw new tU.ErrnoError(63);tF.Va||(tF.Va={dir:{node:{getattr:tF.node_ops.getattr,setattr:tF.node_ops.setattr,lookup:tF.node_ops.lookup,mknod:tF.node_ops.mknod,rename:tF.node_ops.rename,unlink:tF.node_ops.unlink,rmdir:tF.node_ops.rmdir,readdir:tF.node_ops.readdir,symlink:tF.node_ops.symlink},stream:{llseek:tF.stream_ops.llseek}},file:{node:{getattr:tF.node_ops.getattr,setattr:tF.node_ops.setattr},stream:{llseek:tF.stream_ops.llseek,read:tF.stream_ops.read,write:tF.stream_ops.write,allocate:tF.stream_ops.allocate,mmap:tF.stream_ops.mmap,msync:tF.stream_ops.msync}},link:{node:{getattr:tF.node_ops.getattr,setattr:tF.node_ops.setattr,readlink:tF.node_ops.readlink},stream:{}},Vb:{node:{getattr:tF.node_ops.getattr,setattr:tF.node_ops.setattr},stream:tU.Cc}});et=tU.createNode($,ee,et,en);tU.isDir(et.mode)?(et.node_ops=tF.Va.dir.node,et.stream_ops=tF.Va.dir.stream,et.Na={}):tU.isFile(et.mode)?(et.node_ops=tF.Va.file.node,et.stream_ops=tF.Va.file.stream,et.Ra=0,et.Na=null):tU.fb(et.mode)?(et.node_ops=tF.Va.link.node,et.stream_ops=tF.Va.link.stream):tU.pb(et.mode)&&(et.node_ops=tF.Va.Vb.node,et.stream_ops=tF.Va.Vb.stream);et.timestamp=Date.now();$&&($.Na[ee]=et,$.timestamp=et.timestamp);return et},qd:function($){return $.Na?$.Na.subarray?$.Na.subarray(0,$.Ra):new Uint8Array($.Na):new Uint8Array(0)},Zb:function($,ee){var et=$.Na?$.Na.length:0;et>=ee||(ee=Math.max(ee,et*(1048576>et?2:1.125)>>>0),0!=et&&(ee=Math.max(ee,256)),et=$.Na,$.Na=new Uint8Array(ee),0<$.Ra&&$.Na.set(et.subarray(0,$.Ra),0))},gd:function($,ee){if($.Ra!=ee)if(0==ee)$.Na=null,$.Ra=0;else{var et=$.Na;$.Na=new Uint8Array(ee);et&&$.Na.set(et.subarray(0,Math.min(ee,$.Ra)));$.Ra=ee}},node_ops:{getattr:function($){var ee={};ee.dev=tU.pb($.mode)?$.id:1;ee.ino=$.id;ee.mode=$.mode;ee.nlink=1;ee.uid=0;ee.gid=0;ee.rdev=$.rdev;tU.isDir($.mode)?ee.size=4096:tU.isFile($.mode)?ee.size=$.Ra:tU.fb($.mode)?ee.size=$.link.length:ee.size=0;ee.atime=new Date($.timestamp);ee.mtime=new Date($.timestamp);ee.ctime=new Date($.timestamp);ee.Ac=4096;ee.blocks=Math.ceil(ee.size/ee.Ac);return ee},setattr:function($,ee){void 0!==ee.mode&&($.mode=ee.mode);void 0!==ee.timestamp&&($.timestamp=ee.timestamp);void 0!==ee.size&&tF.gd($,ee.size)},lookup:function(){throw tU.Db[44]},mknod:function($,ee,et,en){return tF.createNode($,ee,et,en)},rename:function($,ee,et){if(tU.isDir($.mode)){try{var en=tU.lookupNode(ee,et)}catch($){}if(en)for(var ei in en.Na)throw new tU.ErrnoError(55)}delete $.parent.Na[$.name];$.parent.timestamp=Date.now();$.name=et;ee.Na[et]=$;ee.timestamp=$.parent.timestamp;$.parent=ee},unlink:function($,ee){delete $.Na[ee];$.timestamp=Date.now()},rmdir:function($,ee){var et=tU.lookupNode($,ee),en;for(en in et.Na)throw new tU.ErrnoError(55);delete $.Na[ee];$.timestamp=Date.now()},readdir:function($){var ee=[".",".."],et;for(et in $.Na)$.Na.hasOwnProperty(et)&&ee.push(et);return ee},symlink:function($,ee,et){$=tF.createNode($,ee,41471,0);$.link=et;return $},readlink:function($){if(!tU.fb($.mode))throw new tU.ErrnoError(28);return $.link}},stream_ops:{read:function($,ee,et,en,ei){var eo=$.node.Na;if(ei>=$.node.Ra)return 0;$=Math.min($.node.Ra-ei,en);if(8<$&&eo.subarray)ee.set(eo.subarray(ei,ei+$),et);else for(en=0;en<$;en++)ee[et+en]=eo[ei+en];return $},write:function($,ee,et,en,ei,eo){ee.buffer===eX.buffer&&(eo=!1);if(!en)return 0;$=$.node;$.timestamp=Date.now();if(ee.subarray&&(!$.Na||$.Na.subarray)){if(eo)return $.Na=ee.subarray(et,et+en),$.Ra=en;if(0===$.Ra&&0===ei)return $.Na=ee.slice(et,et+en),$.Ra=en;if(ei+en<=$.Ra)return $.Na.set(ee.subarray(et,et+en),ei),en}tF.Zb($,ei+en);if($.Na.subarray&&ee.subarray)$.Na.set(ee.subarray(et,et+en),ei);else for(eo=0;eo<en;eo++)$.Na[ei+eo]=ee[et+eo];$.Ra=Math.max($.Ra,ei+en);return en},llseek:function($,ee,et){1===et?ee+=$.position:2===et&&tU.isFile($.node.mode)&&(ee+=$.node.Ra);if(0>ee)throw new tU.ErrnoError(28);return ee},allocate:function($,ee,et){tF.Zb($.node,ee+et);$.node.Ra=Math.max($.node.Ra,ee+et)},mmap:function($,ee,et,en,ei,eo){if(0!==ee)throw new tU.ErrnoError(28);if(!tU.isFile($.node.mode))throw new tU.ErrnoError(43);$=$.node.Na;if(eo&2||$.buffer!==eJ){if(0<en||en+et<$.length)$.subarray?$=$.subarray(en,en+et):$=Array.prototype.slice.call($,en,en+et);en=!0;et=tP(et);if(!et)throw new tU.ErrnoError(48);eX.set($,et)}else en=!1,et=$.byteOffset;return{ed:et,vb:en}},msync:function($,ee,et,en,ei){if(!tU.isFile($.node.mode))throw new tU.ErrnoError(43);if(ei&2)return 0;tF.stream_ops.write($,ee,0,en,et,!1);return 0}}};function tB($,ee,et){var en="al "+$;eE($,function(et){eU(et,'Loading data file "'+$+'" failed (no arrayBuffer).');ee(new Uint8Array(et));en&&ti()},function(){if(et)et();else throw'Loading data file "'+$+'" failed.'});en&&tn()}var tU={root:null,mb:[],Xb:{},streams:[],Zc:1,Ua:null,Wb:"/",Hb:!1,hc:!0,Sa:{},nc:{kc:{qc:1,rc:2}},ErrnoError:null,Db:{},Lc:null,tb:0,lookupPath:function($,ee){$=tD(tU.cwd(),$);ee=ee||{};if(!$)return{path:"",node:null};var et={Cb:!0,Pb:0},en;for(en in et)void 0===ee[en]&&(ee[en]=et[en]);if(8<ee.Pb)throw new tU.ErrnoError(32);$=tS($.split("/").filter(function($){return!!$}),!1);var ei=tU.root;et="/";for(en=0;en<$.length;en++){var eo=en===$.length-1;if(eo&&ee.parent)break;ei=tU.lookupNode(ei,$[en]);et=tI(et,$[en]);tU.ab(ei)&&(!eo||eo&&ee.Cb)&&(ei=ei.lb.root);if(!eo||ee.Ta){for(eo=0;tU.fb(ei.mode);)if(ei=tU.readlink(et),et=tD(tO(et),ei),ei=tU.lookupPath(et,{Pb:ee.Pb}).node,40<eo++)throw new tU.ErrnoError(32)}}return{path:et,node:ei}},Ya:function($){for(var ee;;){if(tU.isRoot($))return $=$.mount.jc,ee?"/"!==$[$.length-1]?$+"/"+ee:$+ee:$;ee=ee?$.name+"/"+ee:$.name;$=$.parent}},Gb:function($,ee){for(var et=0,en=0;en<ee.length;en++)et=(et<<5)-et+ee.charCodeAt(en)|0;return($+et>>>0)%tU.Ua.length},ec:function($){var ee=tU.Gb($.parent.id,$.name);$.cb=tU.Ua[ee];tU.Ua[ee]=$},fc:function($){var ee=tU.Gb($.parent.id,$.name);if(tU.Ua[ee]===$)tU.Ua[ee]=$.cb;else for(ee=tU.Ua[ee];ee;){if(ee.cb===$){ee.cb=$.cb;break}ee=ee.cb}},lookupNode:function($,ee){var et=tU.Vc($);if(et)throw new tU.ErrnoError(et,$);for(et=tU.Ua[tU.Gb($.id,ee)];et;et=et.cb){var en=et.name;if(et.parent.id===$.id&&en===ee)return et}return tU.lookup($,ee)},createNode:function($,ee,et,en){$=new tU.FSNode($,ee,et,en);tU.ec($);return $},Ab:function($){tU.fc($)},isRoot:function($){return $===$.parent},ab:function($){return!!$.lb},isFile:function($){return 32768===($&61440)},isDir:function($){return 16384===($&61440)},fb:function($){return 40960===($&61440)},pb:function($){return 8192===($&61440)},Rc:function($){return 24576===($&61440)},isFIFO:function($){return 4096===($&61440)},isSocket:function($){return 49152===($&49152)},Mc:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},Yc:function($){var ee=tU.Mc[$];if("undefined"===typeof ee)throw Error("Unknown file open mode: "+$);return ee},$b:function($){var ee=["r","w","rw"][$&3];$&512&&(ee+="w");return ee},Za:function($,ee){if(tU.hc)return 0;if(!ee.includes("r")||$.mode&292){if(ee.includes("w")&&!($.mode&146)||ee.includes("x")&&!($.mode&73))return 2}else return 2;return 0},Vc:function($){var ee=tU.Za($,"x");return ee?ee:$.node_ops.lookup?0:2},Lb:function($,ee){try{return tU.lookupNode($,ee),20}catch($){}return tU.Za($,"wx")},qb:function($,ee,et){try{var en=tU.lookupNode($,ee)}catch($){return $.Oa}if($=tU.Za($,"wx"))return $;if(et){if(!tU.isDir(en.mode))return 54;if(tU.isRoot(en)||tU.Ya(en)===tU.cwd())return 10}else if(tU.isDir(en.mode))return 31;return 0},Wc:function($,ee){return $?tU.fb($.mode)?32:tU.isDir($.mode)&&("r"!==tU.$b(ee)||ee&512)?31:tU.Za($,tU.$b(ee)):44},oc:4096,$c:function($,ee){ee=ee||tU.oc;for($=$||0;$<=ee;$++)if(!tU.streams[$])return $;throw new tU.ErrnoError(33)},$a:function($){return tU.streams[$]},Jc:function($,ee,et){tU.ub||(tU.ub=function(){},tU.ub.prototype={object:{get:function(){return this.node},set:function($){this.node=$}}});var en=new tU.ub,ei;for(ei in $)en[ei]=$[ei];$=en;ee=tU.$c(ee,et);$.fd=ee;return tU.streams[ee]=$},Dc:function($){tU.streams[$]=null},Cc:{open:function($){$.stream_ops=tU.Oc($.node.rdev).stream_ops;$.stream_ops.open&&$.stream_ops.open($)},llseek:function(){throw new tU.ErrnoError(70)}},Kb:function($){return $>>8},sd:function($){return $&255},bb:function($,ee){return $<<8|ee},Qb:function($,ee){tU.Xb[$]={stream_ops:ee}},Oc:function($){return tU.Xb[$]},bc:function($){var ee=[];for($=[$];$.length;){var et=$.pop();ee.push(et);$.push.apply($,et.mb)}return ee},mc:function($,ee){function et($){tU.tb--;return ee($)}function en($){if($){if(!en.Kc)return en.Kc=!0,et($)}else++eo>=ei.length&&et(null)}"function"===typeof $&&(ee=$,$=!1);tU.tb++;1<tU.tb&&eI("warning: "+tU.tb+" FS.syncfs operations in flight at once, probably just doing extra work");var ei=tU.bc(tU.root.mount),eo=0;ei.forEach(function(ee){if(!ee.type.mc)return en(null);ee.type.mc(ee,$,en)})},mount:function($,ee,et){var en="/"===et,ei=!et;if(en&&tU.root)throw new tU.ErrnoError(10);if(!en&&!ei){var eo=tU.lookupPath(et,{Cb:!1});et=eo.path;eo=eo.node;if(tU.ab(eo))throw new tU.ErrnoError(10);if(!tU.isDir(eo.mode))throw new tU.ErrnoError(54)}ee={type:$,vd:ee,jc:et,mb:[]};$=$.mount(ee);$.mount=ee;ee.root=$;en?tU.root=$:eo&&(eo.lb=ee,eo.mount&&eo.mount.mb.push(ee));return $},yd:function($){$=tU.lookupPath($,{Cb:!1});if(!tU.ab($.node))throw new tU.ErrnoError(28);$=$.node;var ee=$.lb,et=tU.bc(ee);Object.keys(tU.Ua).forEach(function($){for($=tU.Ua[$];$;){var ee=$.cb;et.includes($.mount)&&tU.Ab($);$=ee}});$.lb=null;$.mount.mb.splice($.mount.mb.indexOf(ee),1)},lookup:function($,ee){return $.node_ops.lookup($,ee)},mknod:function($,ee,et){var en=tU.lookupPath($,{parent:!0}).node;$=tA($);if(!$||"."===$||".."===$)throw new tU.ErrnoError(28);var ei=tU.Lb(en,$);if(ei)throw new tU.ErrnoError(ei);if(!en.node_ops.mknod)throw new tU.ErrnoError(63);return en.node_ops.mknod(en,$,ee,et)},create:function($,ee){return tU.mknod($,(void 0!==ee?ee:438)&4095|32768,0)},mkdir:function($,ee){return tU.mknod($,(void 0!==ee?ee:511)&1023|16384,0)},td:function($,ee){$=$.split("/");for(var et="",en=0;en<$.length;++en)if($[en]){et+="/"+$[en];try{tU.mkdir(et,ee)}catch($){if(20!=$.Oa)throw $}}},rb:function($,ee,et){"undefined"===typeof et&&(et=ee,ee=438);return tU.mknod($,ee|8192,et)},symlink:function($,ee){if(!tD($))throw new tU.ErrnoError(44);var et=tU.lookupPath(ee,{parent:!0}).node;if(!et)throw new tU.ErrnoError(44);ee=tA(ee);var en=tU.Lb(et,ee);if(en)throw new tU.ErrnoError(en);if(!et.node_ops.symlink)throw new tU.ErrnoError(63);return et.node_ops.symlink(et,ee,$)},rename:function($,ee){var et=tO($),en=tO(ee),ei=tA($),eo=tA(ee);var es=tU.lookupPath($,{parent:!0});var eu=es.node;es=tU.lookupPath(ee,{parent:!0});es=es.node;if(!eu||!es)throw new tU.ErrnoError(44);if(eu.mount!==es.mount)throw new tU.ErrnoError(75);var el=tU.lookupNode(eu,ei);en=tR($,en);if("."!==en.charAt(0))throw new tU.ErrnoError(28);en=tR(ee,et);if("."!==en.charAt(0))throw new tU.ErrnoError(55);try{var ef=tU.lookupNode(es,eo)}catch($){}if(el!==ef){et=tU.isDir(el.mode);if(ei=tU.qb(eu,ei,et))throw new tU.ErrnoError(ei);if(ei=ef?tU.qb(es,eo,et):tU.Lb(es,eo))throw new tU.ErrnoError(ei);if(!eu.node_ops.rename)throw new tU.ErrnoError(63);if(tU.ab(el)||ef&&tU.ab(ef))throw new tU.ErrnoError(10);if(es!==eu&&(ei=tU.Za(eu,"w")))throw new tU.ErrnoError(ei);try{tU.Sa.willMovePath&&tU.Sa.willMovePath($,ee)}catch(et){eI("FS.trackingDelegate['willMovePath']('"+$+"', '"+ee+"') threw an exception: "+et.message)}tU.fc(el);try{eu.node_ops.rename(el,es,eo)}catch($){throw $}finally{tU.ec(el)}try{if(tU.Sa.onMovePath)tU.Sa.onMovePath($,ee)}catch(et){eI("FS.trackingDelegate['onMovePath']('"+$+"', '"+ee+"') threw an exception: "+et.message)}}},rmdir:function($){var ee=tU.lookupPath($,{parent:!0}).node,et=tA($),en=tU.lookupNode(ee,et),ei=tU.qb(ee,et,!0);if(ei)throw new tU.ErrnoError(ei);if(!ee.node_ops.rmdir)throw new tU.ErrnoError(63);if(tU.ab(en))throw new tU.ErrnoError(10);try{tU.Sa.willDeletePath&&tU.Sa.willDeletePath($)}catch(ee){eI("FS.trackingDelegate['willDeletePath']('"+$+"') threw an exception: "+ee.message)}ee.node_ops.rmdir(ee,et);tU.Ab(en);try{if(tU.Sa.onDeletePath)tU.Sa.onDeletePath($)}catch(ee){eI("FS.trackingDelegate['onDeletePath']('"+$+"') threw an exception: "+ee.message)}},readdir:function($){$=tU.lookupPath($,{Ta:!0}).node;if(!$.node_ops.readdir)throw new tU.ErrnoError(54);return $.node_ops.readdir($)},unlink:function($){var ee=tU.lookupPath($,{parent:!0}).node,et=tA($),en=tU.lookupNode(ee,et),ei=tU.qb(ee,et,!1);if(ei)throw new tU.ErrnoError(ei);if(!ee.node_ops.unlink)throw new tU.ErrnoError(63);if(tU.ab(en))throw new tU.ErrnoError(10);try{tU.Sa.willDeletePath&&tU.Sa.willDeletePath($)}catch(ee){eI("FS.trackingDelegate['willDeletePath']('"+$+"') threw an exception: "+ee.message)}ee.node_ops.unlink(ee,et);tU.Ab(en);try{if(tU.Sa.onDeletePath)tU.Sa.onDeletePath($)}catch(ee){eI("FS.trackingDelegate['onDeletePath']('"+$+"') threw an exception: "+ee.message)}},readlink:function($){$=tU.lookupPath($).node;if(!$)throw new tU.ErrnoError(44);if(!$.node_ops.readlink)throw new tU.ErrnoError(28);return tD(tU.Ya($.parent),$.node_ops.readlink($))},stat:function($,ee){$=tU.lookupPath($,{Ta:!ee}).node;if(!$)throw new tU.ErrnoError(44);if(!$.node_ops.getattr)throw new tU.ErrnoError(63);return $.node_ops.getattr($)},lstat:function($){return tU.stat($,!0)},chmod:function($,ee,et){$="string"===typeof $?tU.lookupPath($,{Ta:!et}).node:$;if(!$.node_ops.setattr)throw new tU.ErrnoError(63);$.node_ops.setattr($,{mode:ee&4095|$.mode&-4096,timestamp:Date.now()})},lchmod:function($,ee){tU.chmod($,ee,!0)},fchmod:function($,ee){$=tU.$a($);if(!$)throw new tU.ErrnoError(8);tU.chmod($.node,ee)},chown:function($,ee,et,en){$="string"===typeof $?tU.lookupPath($,{Ta:!en}).node:$;if(!$.node_ops.setattr)throw new tU.ErrnoError(63);$.node_ops.setattr($,{timestamp:Date.now()})},lchown:function($,ee,et){tU.chown($,ee,et,!0)},fchown:function($,ee,et){$=tU.$a($);if(!$)throw new tU.ErrnoError(8);tU.chown($.node,ee,et)},truncate:function($,ee){if(0>ee)throw new tU.ErrnoError(28);$="string"===typeof $?tU.lookupPath($,{Ta:!0}).node:$;if(!$.node_ops.setattr)throw new tU.ErrnoError(63);if(tU.isDir($.mode))throw new tU.ErrnoError(31);if(!tU.isFile($.mode))throw new tU.ErrnoError(28);var et=tU.Za($,"w");if(et)throw new tU.ErrnoError(et);$.node_ops.setattr($,{size:ee,timestamp:Date.now()})},Nc:function($,ee){$=tU.$a($);if(!$)throw new tU.ErrnoError(8);if(0===($.flags&2097155))throw new tU.ErrnoError(28);tU.truncate($.node,ee)},kd:function($,ee,et){$=tU.lookupPath($,{Ta:!0}).node;$.node_ops.setattr($,{timestamp:Math.max(ee,et)})},open:function($,ee,et,en,ei){if(""===$)throw new tU.ErrnoError(44);ee="string"===typeof ee?tU.Yc(ee):ee;et=ee&64?("undefined"===typeof et?438:et)&4095|32768:0;if("object"===typeof $)var eo=$;else{$=tT($);try{eo=tU.lookupPath($,{Ta:!(ee&131072)}).node}catch($){}}var es=!1;if(ee&64)if(eo){if(ee&128)throw new tU.ErrnoError(20)}else eo=tU.mknod($,et,0),es=!0;if(!eo)throw new tU.ErrnoError(44);tU.pb(eo.mode)&&(ee&=-513);if(ee&65536&&!tU.isDir(eo.mode))throw new tU.ErrnoError(54);if(!es&&(et=tU.Wc(eo,ee)))throw new tU.ErrnoError(et);ee&512&&tU.truncate(eo,0);ee&=-131713;en=tU.Jc({node:eo,path:tU.Ya(eo),flags:ee,seekable:!0,position:0,stream_ops:eo.stream_ops,jd:[],error:!1},en,ei);en.stream_ops.open&&en.stream_ops.open(en);!el.logReadFiles||ee&1||(tU.Ob||(tU.Ob={}),$ in tU.Ob||(tU.Ob[$]=1,eI("FS.trackingDelegate error on read file: "+$)));try{tU.Sa.onOpenFile&&(ei=0,1!==(ee&2097155)&&(ei|=tU.nc.kc.qc),0!==(ee&2097155)&&(ei|=tU.nc.kc.rc),tU.Sa.onOpenFile($,ei))}catch(ee){eI("FS.trackingDelegate['onOpenFile']('"+$+"', flags) threw an exception: "+ee.message)}return en},close:function($){if(tU.kb($))throw new tU.ErrnoError(8);$.Fb&&($.Fb=null);try{$.stream_ops.close&&$.stream_ops.close($)}catch($){throw $}finally{tU.Dc($.fd)}$.fd=null},kb:function($){return null===$.fd},llseek:function($,ee,et){if(tU.kb($))throw new tU.ErrnoError(8);if(!$.seekable||!$.stream_ops.llseek)throw new tU.ErrnoError(70);if(0!=et&&1!=et&&2!=et)throw new tU.ErrnoError(28);$.position=$.stream_ops.llseek($,ee,et);$.jd=[];return $.position},read:function($,ee,et,en,ei){if(0>en||0>ei)throw new tU.ErrnoError(28);if(tU.kb($))throw new tU.ErrnoError(8);if(1===($.flags&2097155))throw new tU.ErrnoError(8);if(tU.isDir($.node.mode))throw new tU.ErrnoError(31);if(!$.stream_ops.read)throw new tU.ErrnoError(28);var eo="undefined"!==typeof ei;if(!eo)ei=$.position;else if(!$.seekable)throw new tU.ErrnoError(70);ee=$.stream_ops.read($,ee,et,en,ei);eo||($.position+=ee);return ee},write:function($,ee,et,en,ei,eo){if(0>en||0>ei)throw new tU.ErrnoError(28);if(tU.kb($))throw new tU.ErrnoError(8);if(0===($.flags&2097155))throw new tU.ErrnoError(8);if(tU.isDir($.node.mode))throw new tU.ErrnoError(31);if(!$.stream_ops.write)throw new tU.ErrnoError(28);$.seekable&&$.flags&1024&&tU.llseek($,0,2);var es="undefined"!==typeof ei;if(!es)ei=$.position;else if(!$.seekable)throw new tU.ErrnoError(70);ee=$.stream_ops.write($,ee,et,en,ei,eo);es||($.position+=ee);try{if($.path&&tU.Sa.onWriteToFile)tU.Sa.onWriteToFile($.path)}catch(ee){eI("FS.trackingDelegate['onWriteToFile']('"+$.path+"') threw an exception: "+ee.message)}return ee},allocate:function($,ee,et){if(tU.kb($))throw new tU.ErrnoError(8);if(0>ee||0>=et)throw new tU.ErrnoError(28);if(0===($.flags&2097155))throw new tU.ErrnoError(8);if(!tU.isFile($.node.mode)&&!tU.isDir($.node.mode))throw new tU.ErrnoError(43);if(!$.stream_ops.allocate)throw new tU.ErrnoError(138);$.stream_ops.allocate($,ee,et)},mmap:function($,ee,et,en,ei,eo){if(0!==(ei&2)&&0===(eo&2)&&2!==($.flags&2097155))throw new tU.ErrnoError(2);if(1===($.flags&2097155))throw new tU.ErrnoError(2);if(!$.stream_ops.mmap)throw new tU.ErrnoError(43);return $.stream_ops.mmap($,ee,et,en,ei,eo)},msync:function($,ee,et,en,ei){return $&&$.stream_ops.msync?$.stream_ops.msync($,ee,et,en,ei):0},ud:function(){return 0},ic:function($,ee,et){if(!$.stream_ops.ic)throw new tU.ErrnoError(59);return $.stream_ops.ic($,ee,et)},readFile:function($,ee){ee=ee||{};ee.flags=ee.flags||0;ee.encoding=ee.encoding||"binary";if("utf8"!==ee.encoding&&"binary"!==ee.encoding)throw Error('Invalid encoding type "'+ee.encoding+'"');var et,en=tU.open($,ee.flags);$=tU.stat($).size;var ei=new Uint8Array($);tU.read(en,ei,0,$,0);"utf8"===ee.encoding?et=eq(ei,0):"binary"===ee.encoding&&(et=ei);tU.close(en);return et},writeFile:function($,ee,et){et=et||{};et.flags=et.flags||577;$=tU.open($,et.flags,et.mode);if("string"===typeof ee){var en=new Uint8Array(eK(ee)+1);ee=eY(ee,en,0,en.length);tU.write($,en,0,ee,void 0,et.Bc)}else if(ArrayBuffer.isView(ee))tU.write($,ee,0,ee.byteLength,void 0,et.Bc);else throw Error("Unsupported data type");tU.close($)},cwd:function(){return tU.Wb},chdir:function($){$=tU.lookupPath($,{Ta:!0});if(null===$.node)throw new tU.ErrnoError(44);if(!tU.isDir($.node.mode))throw new tU.ErrnoError(54);var ee=tU.Za($.node,"x");if(ee)throw new tU.ErrnoError(ee);tU.Wb=$.path},Fc:function(){tU.mkdir("/tmp");tU.mkdir("/home");tU.mkdir("/home/web_user")},Ec:function(){tU.mkdir("/dev");tU.Qb(tU.bb(1,3),{read:function(){return 0},write:function($,ee,et,en){return en}});tU.rb("/dev/null",tU.bb(1,3));tk(tU.bb(5,0),tL);tk(tU.bb(6,0),tx);tU.rb("/dev/tty",tU.bb(5,0));tU.rb("/dev/tty1",tU.bb(6,0));var $=tN();tU.Wa("/dev","random",$);tU.Wa("/dev","urandom",$);tU.mkdir("/dev/shm");tU.mkdir("/dev/shm/tmp")},Hc:function(){tU.mkdir("/proc");var $=tU.mkdir("/proc/self");tU.mkdir("/proc/self/fd");tU.mount({mount:function(){var ee=tU.createNode($,"fd",16895,73);ee.node_ops={lookup:function($,ee){var et=tU.$a(+ee);if(!et)throw new tU.ErrnoError(8);$={parent:null,mount:{jc:"fake"},node_ops:{readlink:function(){return et.path}}};return $.parent=$}};return ee}},{},"/proc/self/fd")},Ic:function(){el.stdin?tU.Wa("/dev","stdin",el.stdin):tU.symlink("/dev/tty","/dev/stdin");el.stdout?tU.Wa("/dev","stdout",null,el.stdout):tU.symlink("/dev/tty","/dev/stdout");el.stderr?tU.Wa("/dev","stderr",null,el.stderr):tU.symlink("/dev/tty1","/dev/stderr");tU.open("/dev/stdin",0);tU.open("/dev/stdout",1);tU.open("/dev/stderr",1)},Yb:function(){tU.ErrnoError||(tU.ErrnoError=function($,ee){this.node=ee;this.hd=function($){this.Oa=$};this.hd($);this.message="FS error"},tU.ErrnoError.prototype=Error(),tU.ErrnoError.prototype.constructor=tU.ErrnoError,[44].forEach(function($){tU.Db[$]=new tU.ErrnoError($);tU.Db[$].stack="<generic error, no stack>"}))},lc:function(){tU.Yb();tU.Ua=Array(4096);tU.mount(tF,{},"/");tU.Fc();tU.Ec();tU.Hc();tU.Lc={MEMFS:tF}},jb:function($,ee,et){tU.jb.Hb=!0;tU.Yb();el.stdin=$||el.stdin;el.stdout=ee||el.stdout;el.stderr=et||el.stderr;tU.Ic()},wd:function(){tU.jb.Hb=!1;var $=el._fflush;$&&$(0);for($=0;$<tU.streams.length;$++){var ee=tU.streams[$];ee&&tU.close(ee)}},Eb:function($,ee){var et=0;$&&(et|=365);ee&&(et|=146);return et},od:function($,ee){$=tU.xb($,ee);return $.exists?$.object:null},xb:function($,ee){try{var et=tU.lookupPath($,{Ta:!ee});$=et.path}catch($){}var en={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,ad:!1,cd:null,bd:null};try{et=tU.lookupPath($,{parent:!0}),en.ad=!0,en.cd=et.path,en.bd=et.node,en.name=tA($),et=tU.lookupPath($,{Ta:!ee}),en.exists=!0,en.path=et.path,en.object=et.node,en.name=et.node.name,en.isRoot="/"===et.path}catch($){en.error=$.Oa}return en},md:function($,ee){$="string"===typeof $?$:tU.Ya($);for(ee=ee.split("/").reverse();ee.length;){var et=ee.pop();if(et){var en=tI($,et);try{tU.mkdir(en)}catch($){}$=en}}return en},Gc:function($,ee,et,en,ei){$=tI("string"===typeof $?$:tU.Ya($),ee);return tU.create($,tU.Eb(en,ei))},zb:function($,ee,et,en,ei,eo){$=ee?tI("string"===typeof $?$:tU.Ya($),ee):$;en=tU.Eb(en,ei);ei=tU.create($,en);if(et){if("string"===typeof et){$=Array(et.length);ee=0;for(var es=et.length;ee<es;++ee)$[ee]=et.charCodeAt(ee);et=$}tU.chmod(ei,en|146);$=tU.open(ei,577);tU.write($,et,0,et.length,0,eo);tU.close($);tU.chmod(ei,en)}return ei},Wa:function($,ee,et,en){$=tI("string"===typeof $?$:tU.Ya($),ee);ee=tU.Eb(!!et,!!en);tU.Wa.Kb||(tU.Wa.Kb=64);var ei=tU.bb(tU.Wa.Kb++,0);tU.Qb(ei,{open:function($){$.seekable=!1},close:function(){en&&en.buffer&&en.buffer.length&&en(10)},read:function($,ee,en,ei){for(var eo=0,es=0;es<ei;es++){try{var eu=et()}catch($){throw new tU.ErrnoError(29)}if(void 0===eu&&0===eo)throw new tU.ErrnoError(6);if(null===eu||void 0===eu)break;eo++;ee[en+es]=eu}eo&&($.node.timestamp=Date.now());return eo},write:function($,ee,et,ei){for(var eo=0;eo<ei;eo++)try{en(ee[et+eo])}catch($){throw new tU.ErrnoError(29)}ei&&($.node.timestamp=Date.now());return eo}});return tU.rb($,ee,ei)},ac:function($){if($.Ib||$.Sc||$.link||$.Na)return!0;if("undefined"!==typeof XMLHttpRequest)throw Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(ew)try{$.Na=tJ(ew($.url),!0),$.Ra=$.Na.length}catch($){throw new tU.ErrnoError(29)}else throw Error("Cannot load without read() or XMLHttpRequest.")},ld:function($,ee,et,en,ei){function eo(){this.Jb=!1;this.ob=[]}eo.prototype.get=function($){if(!($>this.length-1||0>$)){var ee=$%this.chunkSize;return this.dc($/this.chunkSize|0)[ee]}};eo.prototype.pc=function($){this.dc=$};eo.prototype.Ub=function(){var $=new XMLHttpRequest;$.open("HEAD",et,!1);$.send(null);if(!(200<=$.status&&300>$.status||304===$.status))throw Error("Couldn't load "+et+". Status: "+$.status);var ee=Number($.getResponseHeader("Content-length")),en,ei=(en=$.getResponseHeader("Accept-Ranges"))&&"bytes"===en;$=(en=$.getResponseHeader("Content-Encoding"))&&"gzip"===en;var eo=1048576;ei||(eo=ee);var es=this;es.pc(function($){var en=$*eo,ei=($+1)*eo-1;ei=Math.min(ei,ee-1);if("undefined"===typeof es.ob[$]){var eu=es.ob;if(en>ei)throw Error("invalid range ("+en+", "+ei+") or no bytes requested!");if(ei>ee-1)throw Error("only "+ee+" bytes available! programmer error!");var el=new XMLHttpRequest;el.open("GET",et,!1);ee!==eo&&el.setRequestHeader("Range","bytes="+en+"-"+ei);"undefined"!=typeof Uint8Array&&(el.responseType="arraybuffer");el.overrideMimeType&&el.overrideMimeType("text/plain; charset=x-user-defined");el.send(null);if(!(200<=el.status&&300>el.status||304===el.status))throw Error("Couldn't load "+et+". Status: "+el.status);en=void 0!==el.response?new Uint8Array(el.response||[]):tJ(el.responseText||"",!0);eu[$]=en}if("undefined"===typeof es.ob[$])throw Error("doXHR failed!");return es.ob[$]});if($||!ee)eo=ee=1,eo=ee=this.dc(0).length,eA("LazyFiles on gzip forces download of the whole file when length is accessed");this.tc=ee;this.sc=eo;this.Jb=!0};if("undefined"!==typeof XMLHttpRequest){if(!eg)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var es=new eo;Object.defineProperties(es,{length:{get:function(){this.Jb||this.Ub();return this.tc}},chunkSize:{get:function(){this.Jb||this.Ub();return this.sc}}});es={Ib:!1,Na:es}}else es={Ib:!1,url:et};var eu=tU.Gc($,ee,es,en,ei);es.Na?eu.Na=es.Na:es.url&&(eu.Na=null,eu.url=es.url);Object.defineProperties(eu,{Ra:{get:function(){return this.Na.length}}});var el={};Object.keys(eu.stream_ops).forEach(function($){var ee=eu.stream_ops[$];el[$]=function(){tU.ac(eu);return ee.apply(null,arguments)}});el.read=function($,ee,et,en,ei){tU.ac(eu);$=$.node.Na;if(ei>=$.length)return 0;en=Math.min($.length-ei,en);if($.slice)for(var eo=0;eo<en;eo++)ee[et+eo]=$[ei+eo];else for(eo=0;eo<en;eo++)ee[et+eo]=$.get(ei+eo);return en};eu.stream_ops=el;return eu},nd:function($,ee,et,en,ei,eo,es,eu,ef,ed){function ep(et){function ep(et){ed&&ed();eu||tU.zb($,ee,et,en,ei,ef);eo&&eo();ti()}var ey=!1;el.preloadPlugins.forEach(function($){!ey&&$.canHandle(eh)&&($.handle(et,eh,ep,function(){es&&es();ti()}),ey=!0)});ey||ep(et)}tZ.jb();var eh=ee?tD(tI($,ee)):$;tn();"string"==typeof et?tB(et,function($){ep($)},es):ep(et)},indexedDB:function(){return window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB},Rb:function(){return"EM_FS_"+window.location.pathname},Sb:20,ib:"FILE_DATA",xd:function($,ee,et){ee=ee||function(){};et=et||function(){};var en=tU.indexedDB();try{var ei=en.open(tU.Rb(),tU.Sb)}catch($){return et($)}ei.onupgradeneeded=function(){eA("creating db");ei.result.createObjectStore(tU.ib)};ei.onsuccess=function(){var en=ei.result.transaction([tU.ib],"readwrite"),eo=en.objectStore(tU.ib),es=0,eu=0,el=$.length;$.forEach(function($){$=eo.put(tU.xb($).object.Na,$);$.onsuccess=function(){es++;es+eu==el&&(0==eu?ee():et())};$.onerror=function(){eu++;es+eu==el&&(0==eu?ee():et())}});en.onerror=et};ei.onerror=et},rd:function($,ee,et){ee=ee||function(){};et=et||function(){};var en=tU.indexedDB();try{var ei=en.open(tU.Rb(),tU.Sb)}catch($){return et($)}ei.onupgradeneeded=et;ei.onsuccess=function(){var en=ei.result;try{var eo=en.transaction([tU.ib],"readonly")}catch($){et($);return}var es=eo.objectStore(tU.ib),eu=0,el=0,ef=$.length;$.forEach(function($){var en=es.get($);en.onsuccess=function(){tU.xb($).exists&&tU.unlink($);tU.zb(tO($),tA($),en.result,!0,!0,!0);eu++;eu+el==ef&&(0==el?ee():et())};en.onerror=function(){el++;eu+el==ef&&(0==el?ee():et())}});eo.onerror=et};ei.onerror=et}},tj={};function tW($,ee,et){try{var en=$(ee)}catch($){if($&&$.node&&tT(ee)!==tT(tU.Ya($.node)))return-54;throw $}e1[et>>2]=en.dev;e1[et+4>>2]=0;e1[et+8>>2]=en.ino;e1[et+12>>2]=en.mode;e1[et+16>>2]=en.nlink;e1[et+20>>2]=en.uid;e1[et+24>>2]=en.gid;e1[et+28>>2]=en.rdev;e1[et+32>>2]=0;tm=[en.size>>>0,(ty=en.size,1<=+Math.abs(ty)?0<ty?(Math.min(+Math.floor(ty/4294967296),4294967295)|0)>>>0:~~+Math.ceil((ty-+(~~ty>>>0))/4294967296)>>>0:0)];e1[et+40>>2]=tm[0];e1[et+44>>2]=tm[1];e1[et+48>>2]=4096;e1[et+52>>2]=en.blocks;e1[et+56>>2]=en.atime.getTime()/1e3|0;e1[et+60>>2]=0;e1[et+64>>2]=en.mtime.getTime()/1e3|0;e1[et+68>>2]=0;e1[et+72>>2]=en.ctime.getTime()/1e3|0;e1[et+76>>2]=0;tm=[en.ino>>>0,(ty=en.ino,1<=+Math.abs(ty)?0<ty?(Math.min(+Math.floor(ty/4294967296),4294967295)|0)>>>0:~~+Math.ceil((ty-+(~~ty>>>0))/4294967296)>>>0:0)];e1[et+80>>2]=tm[0];e1[et+84>>2]=tm[1];return 0}var tH=void 0;function tz(){tH+=4;return e1[tH-4>>2]}function tV($){$=tU.$a($);if(!$)throw new tU.ErrnoError(8);return $}var t$;t$=em?function(){var $=ei.hrtime();return 1e3*$[0]+$[1]/1e6}:function(){return performance.now()};var tq={};function tG(){if(!tY){var $={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"===typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:eh||"./this.program"},ee;for(ee in tq)void 0===tq[ee]?delete $[ee]:$[ee]=tq[ee];var et=[];for(ee in $)et.push(ee+"="+$[ee]);tY=et}return tY}var tY;function tK($,ee,et,en){$||($=this);this.parent=$;this.mount=$.mount;this.lb=null;this.id=tU.Zc++;this.name=ee;this.mode=et;this.node_ops={};this.stream_ops={};this.rdev=en}Object.defineProperties(tK.prototype,{read:{get:function(){return 365===(this.mode&365)},set:function($){$?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146===(this.mode&146)},set:function($){$?this.mode|=146:this.mode&=-147}},Sc:{get:function(){return tU.isDir(this.mode)}},Ib:{get:function(){return tU.pb(this.mode)}}});tU.FSNode=tK;tU.lc();var tZ;function tJ($,ee){var et=Array(eK($)+1);$=eY($,et,0,et.length);ee&&(et.length=$);return et}var tX={a:function($,ee,et,en){tu("Assertion failed: "+eG($)+", at: "+[ee?eG(ee):"unknown filename",et,en?eG(en):"unknown function"])},u:function($,ee){tw();$=new Date(1e3*e1[$>>2]);e1[ee>>2]=$.getSeconds();e1[ee+4>>2]=$.getMinutes();e1[ee+8>>2]=$.getHours();e1[ee+12>>2]=$.getDate();e1[ee+16>>2]=$.getMonth();e1[ee+20>>2]=$.getFullYear()-1900;e1[ee+24>>2]=$.getDay();var et=new Date($.getFullYear(),0,1);e1[ee+28>>2]=($.getTime()-et.getTime())/864e5|0;e1[ee+36>>2]=-(60*$.getTimezoneOffset());var en=new Date($.getFullYear(),6,1).getTimezoneOffset();et=et.getTimezoneOffset();$=(en!=et&&$.getTimezoneOffset()==Math.min(et,en))|0;e1[ee+32>>2]=$;$=e1[t4()+($?4:0)>>2];e1[ee+40>>2]=$;return ee},m:function($,ee){try{$=eG($);if(ee&-8)var et=-28;else{var en;(en=tU.lookupPath($,{Ta:!0}).node)?($="",ee&4&&($+="r"),ee&2&&($+="w"),ee&1&&($+="x"),et=$&&tU.Za(en,$)?-2:0):et=-44}return et}catch($){return"undefined"!==typeof tU&&$ instanceof tU.ErrnoError||tu($),-$.Oa}},A:function($,ee){try{return $=eG($),tU.chmod($,ee),0}catch($){return"undefined"!==typeof tU&&$ instanceof tU.ErrnoError||tu($),-$.Oa}},H:function($,ee,et){try{return $=eG($),tU.chown($,ee,et),0}catch($){return"undefined"!==typeof tU&&$ instanceof tU.ErrnoError||tu($),-$.Oa}},B:function($,ee){try{return tU.fchmod($,ee),0}catch($){return"undefined"!==typeof tU&&$ instanceof tU.ErrnoError||tu($),-$.Oa}},I:function($,ee,et){try{return tU.fchown($,ee,et),0}catch($){return"undefined"!==typeof tU&&$ instanceof tU.ErrnoError||tu($),-$.Oa}},b:function($,ee,et){tH=et;try{var en=tV($);switch(ee){case 0:var ei=tz();return 0>ei?-28:tU.open(en.path,en.flags,0,ei).fd;case 1:case 2:return 0;case 3:return en.flags;case 4:return ei=tz(),en.flags|=ei,0;case 12:return ei=tz(),e0[ei+0>>1]=2,0;case 13:case 14:return 0;case 16:case 8:return-28;case 9:return e1[tQ()>>2]=28,-1;default:return-28}}catch($){return"undefined"!==typeof tU&&$ instanceof tU.ErrnoError||tu($),-$.Oa}},E:function($,ee){try{var et=tV($);return tW(tU.stat,et.path,ee)}catch($){return"undefined"!==typeof tU&&$ instanceof tU.ErrnoError||tu($),-$.Oa}},n:function($,ee,et){try{return tU.Nc($,et),0}catch($){return"undefined"!==typeof tU&&$ instanceof tU.ErrnoError||tu($),-$.Oa}},l:function($,ee){try{if(0===ee)return-28;var et=tU.cwd();if(ee<eK(et)+1)return-68;eY(et,eQ,$,ee);return $}catch($){return"undefined"!==typeof tU&&$ instanceof tU.ErrnoError||tu($),-$.Oa}},G:function(){return 0},d:function(){return 42},z:function($,ee){try{return $=eG($),tW(tU.lstat,$,ee)}catch($){return"undefined"!==typeof tU&&$ instanceof tU.ErrnoError||tu($),-$.Oa}},C:function($,ee){try{return $=eG($),$=tT($),"/"===$[$.length-1]&&($=$.substr(0,$.length-1)),tU.mkdir($,ee,0),0}catch($){return"undefined"!==typeof tU&&$ instanceof tU.ErrnoError||tu($),-$.Oa}},y:function($,ee,et,en,ei,eo){try{e:{eo<<=12;var es=!1;if(0!==(en&16)&&0!==$%65536)var eu=-28;else{if(0!==(en&32)){var el=tP(ee);if(!el){eu=-48;break e}es=!0}else{var ef=tU.$a(ei);if(!ef){eu=-8;break e}var ed=tU.mmap(ef,$,ee,eo,et,en);el=ed.ed;es=ed.vb}tj[el]={Uc:el,Tc:ee,vb:es,fd:ei,dd:et,flags:en,offset:eo};eu=el}}return eu}catch($){return"undefined"!==typeof tU&&$ instanceof tU.ErrnoError||tu($),-$.Oa}},x:function($,ee){try{var et=tj[$];if(0!==ee&&et){if(ee===et.Tc){var en=tU.$a(et.fd);if(en&&et.dd&2){var ei=et.flags,eo=et.offset,es=eQ.slice($,$+ee);tU.msync(en,es,eo,ee,ei)}tj[$]=null;et.vb&&t6(et.Uc)}var eu=0}else eu=-28;return eu}catch($){return"undefined"!==typeof tU&&$ instanceof tU.ErrnoError||tu($),-$.Oa}},w:function($,ee,et){tH=et;try{var en=eG($),ei=et?tz():0;return tU.open(en,ee,ei).fd}catch($){return"undefined"!==typeof tU&&$ instanceof tU.ErrnoError||tu($),-$.Oa}},J:function($,ee,et){try{$=eG($);if(0>=et)var en=-28;else{var ei=tU.readlink($),eo=Math.min(et,eK(ei)),es=eX[ee+eo];eY(ei,eQ,ee,et+1);eX[ee+eo]=es;en=eo}return en}catch($){return"undefined"!==typeof tU&&$ instanceof tU.ErrnoError||tu($),-$.Oa}},F:function($){try{return $=eG($),tU.rmdir($),0}catch($){return"undefined"!==typeof tU&&$ instanceof tU.ErrnoError||tu($),-$.Oa}},e:function($,ee){try{return $=eG($),tW(tU.stat,$,ee)}catch($){return"undefined"!==typeof tU&&$ instanceof tU.ErrnoError||tu($),-$.Oa}},i:function($){try{return $=eG($),tU.unlink($),0}catch($){return"undefined"!==typeof tU&&$ instanceof tU.ErrnoError||tu($),-$.Oa}},v:function(){return 2147483648},p:function($,ee,et){eQ.copyWithin($,ee,ee+et)},c:function($){var ee=eQ.length;$>>>=0;if(2147483648<$)return!1;for(var et=1;4>=et;et*=2){var en=ee*(1+.2/et);en=Math.min(en,$+100663296);en=Math.max($,en);0<en%65536&&(en+=65536-en%65536);e:{try{eF.grow(Math.min(2147483648,en)-eJ.byteLength+65535>>>16);e4();var ei=1;break e}catch($){}ei=void 0}if(ei)return!0}return!1},t:function($){for(var ee=t$();t$()-ee<$;);},r:function($,ee){try{var et=0;tG().forEach(function(en,ei){var eo=ee+et;ei=e1[$+4*ei>>2]=eo;for(eo=0;eo<en.length;++eo)eX[ei++>>0]=en.charCodeAt(eo);eX[ei>>0]=0;et+=en.length+1});return 0}catch($){return"undefined"!==typeof tU&&$ instanceof tU.ErrnoError||tu($),$.Oa}},s:function($,ee){try{var et=tG();e1[$>>2]=et.length;var en=0;et.forEach(function($){en+=$.length+1});e1[ee>>2]=en;return 0}catch($){return"undefined"!==typeof tU&&$ instanceof tU.ErrnoError||tu($),$.Oa}},f:function($){try{var ee=tV($);tU.close(ee);return 0}catch($){return"undefined"!==typeof tU&&$ instanceof tU.ErrnoError||tu($),$.Oa}},q:function($,ee){try{var et=tV($),en=et.tty?2:tU.isDir(et.mode)?3:tU.fb(et.mode)?7:4;eX[ee>>0]=en;return 0}catch($){return"undefined"!==typeof tU&&$ instanceof tU.ErrnoError||tu($),$.Oa}},j:function($,ee,et,en){try{e:{for(var ei=tV($),eo=$=0;eo<et;eo++){var es=e1[ee+(8*eo+4)>>2],eu=tU.read(ei,eX,e1[ee+8*eo>>2],es,void 0);if(0>eu){var el=-1;break e}$+=eu;if(eu<es)break}el=$}e1[en>>2]=el;return 0}catch($){return"undefined"!==typeof tU&&$ instanceof tU.ErrnoError||tu($),$.Oa}},o:function($,ee,et,en,ei){try{var eo=tV($);$=4294967296*et+(ee>>>0);if(-9007199254740992>=$||9007199254740992<=$)return-61;tU.llseek(eo,$,en);tm=[eo.position>>>0,(ty=eo.position,1<=+Math.abs(ty)?0<ty?(Math.min(+Math.floor(ty/4294967296),4294967295)|0)>>>0:~~+Math.ceil((ty-+(~~ty>>>0))/4294967296)>>>0:0)];e1[ei>>2]=tm[0];e1[ei+4>>2]=tm[1];eo.Fb&&0===$&&0===en&&(eo.Fb=null);return 0}catch($){return"undefined"!==typeof tU&&$ instanceof tU.ErrnoError||tu($),$.Oa}},k:function($){try{var ee=tV($);return ee.stream_ops&&ee.stream_ops.fsync?-ee.stream_ops.fsync(ee):0}catch($){return"undefined"!==typeof tU&&$ instanceof tU.ErrnoError||tu($),$.Oa}},g:function($,ee,et,en){try{e:{for(var ei=tV($),eo=$=0;eo<et;eo++){var es=tU.write(ei,eX,e1[ee+8*eo>>2],e1[ee+(8*eo+4)>>2],void 0);if(0>es){var eu=-1;break e}$+=es}eu=$}e1[en>>2]=eu;return 0}catch($){return"undefined"!==typeof tU&&$ instanceof tU.ErrnoError||tu($),$.Oa}},h:function($){var ee=Date.now();e1[$>>2]=ee/1e3|0;e1[$+4>>2]=ee%1e3*1e3|0;return 0},K:function($){var ee=Date.now()/1e3|0;$&&(e1[$>>2]=ee);return ee},D:function($,ee){if(ee){var et=ee+8;ee=1e3*e1[et>>2];ee+=e1[et+4>>2]/1e3}else ee=Date.now();$=eG($);try{tU.kd($,ee,ee);var en=0}catch($){if(!($ instanceof tU.ErrnoError)){t:{en=Error();if(!en.stack){try{throw Error()}catch($){en=$}if(!en.stack){en="(no stack trace available)";break t}}en=en.stack.toString()}el.extraStackTrace&&(en+="\n"+el.extraStackTrace());en=tv(en);throw $+" : "+en}en=$.Oa;e1[tQ()>>2]=en;en=-1}return en}};(function(){function $($){el.asm=$.exports;eF=el.asm.L;e4();e3=el.asm.Da;e5.unshift(el.asm.M);ti()}function ee(ee){$(ee.instance)}function et($){return th().then(function($){return WebAssembly.instantiate($,en)}).then($,function($){eI("failed to asynchronously prepare wasm: "+$);tu($)})}var en={a:tX};tn();if(el.instantiateWasm)try{return el.instantiateWasm(en,$)}catch($){return eI("Module.instantiateWasm callback failed with error: "+$),!1}(function(){return ek||"function"!==typeof WebAssembly.instantiateStreaming||tc()||tf.startsWith("file://")||"function"!==typeof fetch?et(ee):fetch(tf,{credentials:"same-origin"}).then(function($){return WebAssembly.instantiateStreaming($,en).then(ee,function($){eI("wasm streaming compile failed: "+$);eI("falling back to ArrayBuffer instantiation");return et(ee)})})})();return{}})();el.___wasm_call_ctors=function(){return(el.___wasm_call_ctors=el.asm.M).apply(null,arguments)};el._sqlite3_vfs_find=function(){return(el._sqlite3_vfs_find=el.asm.N).apply(null,arguments)};el._sqlite3_free=function(){return(el._sqlite3_free=el.asm.O).apply(null,arguments)};var tQ=el.___errno_location=function(){return(tQ=el.___errno_location=el.asm.P).apply(null,arguments)};el._sqlite3_finalize=function(){return(el._sqlite3_finalize=el.asm.Q).apply(null,arguments)};el._sqlite3_reset=function(){return(el._sqlite3_reset=el.asm.R).apply(null,arguments)};el._sqlite3_clear_bindings=function(){return(el._sqlite3_clear_bindings=el.asm.S).apply(null,arguments)};el._sqlite3_value_blob=function(){return(el._sqlite3_value_blob=el.asm.T).apply(null,arguments)};el._sqlite3_value_text=function(){return(el._sqlite3_value_text=el.asm.U).apply(null,arguments)};el._sqlite3_value_bytes=function(){return(el._sqlite3_value_bytes=el.asm.V).apply(null,arguments)};el._sqlite3_value_double=function(){return(el._sqlite3_value_double=el.asm.W).apply(null,arguments)};el._sqlite3_value_int=function(){return(el._sqlite3_value_int=el.asm.X).apply(null,arguments)};el._sqlite3_value_type=function(){return(el._sqlite3_value_type=el.asm.Y).apply(null,arguments)};el._sqlite3_result_blob=function(){return(el._sqlite3_result_blob=el.asm.Z).apply(null,arguments)};el._sqlite3_result_double=function(){return(el._sqlite3_result_double=el.asm._).apply(null,arguments)};el._sqlite3_result_error=function(){return(el._sqlite3_result_error=el.asm.$).apply(null,arguments)};el._sqlite3_result_int=function(){return(el._sqlite3_result_int=el.asm.aa).apply(null,arguments)};el._sqlite3_result_int64=function(){return(el._sqlite3_result_int64=el.asm.ba).apply(null,arguments)};el._sqlite3_result_null=function(){return(el._sqlite3_result_null=el.asm.ca).apply(null,arguments)};el._sqlite3_result_text=function(){return(el._sqlite3_result_text=el.asm.da).apply(null,arguments)};el._sqlite3_step=function(){return(el._sqlite3_step=el.asm.ea).apply(null,arguments)};el._sqlite3_column_count=function(){return(el._sqlite3_column_count=el.asm.fa).apply(null,arguments)};el._sqlite3_data_count=function(){return(el._sqlite3_data_count=el.asm.ga).apply(null,arguments)};el._sqlite3_column_blob=function(){return(el._sqlite3_column_blob=el.asm.ha).apply(null,arguments)};el._sqlite3_column_bytes=function(){return(el._sqlite3_column_bytes=el.asm.ia).apply(null,arguments)};el._sqlite3_column_double=function(){return(el._sqlite3_column_double=el.asm.ja).apply(null,arguments)};el._sqlite3_column_text=function(){return(el._sqlite3_column_text=el.asm.ka).apply(null,arguments)};el._sqlite3_column_type=function(){return(el._sqlite3_column_type=el.asm.la).apply(null,arguments)};el._sqlite3_column_name=function(){return(el._sqlite3_column_name=el.asm.ma).apply(null,arguments)};el._sqlite3_bind_blob=function(){return(el._sqlite3_bind_blob=el.asm.na).apply(null,arguments)};el._sqlite3_bind_double=function(){return(el._sqlite3_bind_double=el.asm.oa).apply(null,arguments)};el._sqlite3_bind_int=function(){return(el._sqlite3_bind_int=el.asm.pa).apply(null,arguments)};el._sqlite3_bind_text=function(){return(el._sqlite3_bind_text=el.asm.qa).apply(null,arguments)};el._sqlite3_bind_parameter_index=function(){return(el._sqlite3_bind_parameter_index=el.asm.ra).apply(null,arguments)};el._sqlite3_sql=function(){return(el._sqlite3_sql=el.asm.sa).apply(null,arguments)};el._sqlite3_normalized_sql=function(){return(el._sqlite3_normalized_sql=el.asm.ta).apply(null,arguments)};el._sqlite3_errmsg=function(){return(el._sqlite3_errmsg=el.asm.ua).apply(null,arguments)};el._sqlite3_exec=function(){return(el._sqlite3_exec=el.asm.va).apply(null,arguments)};el._sqlite3_prepare_v2=function(){return(el._sqlite3_prepare_v2=el.asm.wa).apply(null,arguments)};el._sqlite3_changes=function(){return(el._sqlite3_changes=el.asm.xa).apply(null,arguments)};el._sqlite3_close_v2=function(){return(el._sqlite3_close_v2=el.asm.ya).apply(null,arguments)};el._sqlite3_create_function_v2=function(){return(el._sqlite3_create_function_v2=el.asm.za).apply(null,arguments)};el._sqlite3_open=function(){return(el._sqlite3_open=el.asm.Aa).apply(null,arguments)};var t0=el._malloc=function(){return(t0=el._malloc=el.asm.Ba).apply(null,arguments)},t6=el._free=function(){return(t6=el._free=el.asm.Ca).apply(null,arguments)};el._RegisterExtensionFunctions=function(){return(el._RegisterExtensionFunctions=el.asm.Ea).apply(null,arguments)};el._register_for_idb=function(){return(el._register_for_idb=el.asm.Fa).apply(null,arguments)};var t4=el.__get_tzname=function(){return(t4=el.__get_tzname=el.asm.Ga).apply(null,arguments)},t3=el.__get_daylight=function(){return(t3=el.__get_daylight=el.asm.Ha).apply(null,arguments)},t8=el.__get_timezone=function(){return(t8=el.__get_timezone=el.asm.Ia).apply(null,arguments)},t5=el.stackSave=function(){return(t5=el.stackSave=el.asm.Ja).apply(null,arguments)},t9=el.stackRestore=function(){return(t9=el.stackRestore=el.asm.Ka).apply(null,arguments)},t7=el.stackAlloc=function(){return(t7=el.stackAlloc=el.asm.La).apply(null,arguments)},rr=el._memalign=function(){return(rr=el._memalign=el.asm.Ma).apply(null,arguments)};el.cwrap=function($,ee,et,en){et=et||[];var ei=et.every(function($){return"number"===$});return"string"!==ee&&ei&&!en?ej($):function(){return eW($,ee,et,arguments)}};el.UTF8ToString=eG;el.FS=tU;el.stackSave=t5;el.stackRestore=t9;el.stackAlloc=t7;var rn;tr=function $(){rn||ri();rn||(tr=$)};function ri(){function $(){if(!rn&&(rn=!0,el.calledRun=!0,!eB)){el.noFSInit||tU.jb.Hb||tU.jb();tU.hc=!1;t_(e5);if(el.onRuntimeInitialized)el.onRuntimeInitialized();if(el.postRun)for("function"==typeof el.postRun&&(el.postRun=[el.postRun]);el.postRun.length;){var $=el.postRun.shift();e9.unshift($)}t_(e9)}}if(!(0<te)){if(el.preRun)for("function"==typeof el.preRun&&(el.preRun=[el.preRun]);el.preRun.length;)e7();t_(e8);0<te||(el.setStatus?(el.setStatus("Running..."),setTimeout(function(){setTimeout(function(){el.setStatus("")},1);$()},1)):$())}}el.run=ri;if(el.preInit)for("function"==typeof el.preInit&&(el.preInit=[el.preInit]);0<el.preInit.length;)el.preInit.pop()();ri();return el});return es};if(true){$.exports=eu;$.exports["default"]=eu}else{}},5285:($,ee,et)=>{var en=et(8764)["Buffer"];var ei=et(4155);const eo=et(5173);const es=et(6470);const eu=et(7396);const el=et(6333);const ef=($,ee)=>typeof $==="boolean"?$:ee;const ed=($,ee)=>typeof $==="string"?$:ee;const ep={noSort:false,readEntries:false,method:eo.Constants.NONE,fs:null};$.exports=function($,ee){let et=null;const eh=Object.assign(Object.create(null),ep);if($&&"object"===typeof $){if(!($ instanceof Uint8Array)){Object.assign(eh,$);$=eh.input?eh.input:undefined;if(eh.input)delete eh.input}if(en.isBuffer($)){et=$;eh.method=eo.Constants.BUFFER;$=undefined}}Object.assign(eh,ee);const ey=new eo(eh);if($&&"string"===typeof $){if(ey.fs.existsSync($)){eh.method=eo.Constants.FILE;eh.filename=$;et=ey.fs.readFileSync($)}else{throw new Error(eo.Errors.INVALID_FILENAME)}}const eg=new el(et,eh);const{canonical:em,sanitize:e_}=eo;function ew($){if($&&eg){var ee;if(typeof $==="string")ee=eg.getEntry($);if(typeof $==="object"&&typeof $.entryName!=="undefined"&&typeof $.header!=="undefined")ee=eg.getEntry($.entryName);if(ee){return ee}}return null}function eE($){const{join:ee,normalize:et,sep:en}=es.posix;return ee(".",et(en+$.split("\\").join(en)+en))}return{readFile:function($,ee){var et=ew($);return et&&et.getData(ee)||null},readFileAsync:function($,ee){var et=ew($);if(et){et.getDataAsync(ee)}else{ee(null,"getEntry failed for:"+$)}},readAsText:function($,ee){var et=ew($);if(et){var en=et.getData();if(en&&en.length){return en.toString(ee||"utf8")}}return""},readAsTextAsync:function($,ee,et){var en=ew($);if(en){en.getDataAsync(function($,en){if(en){ee($,en);return}if($&&$.length){ee($.toString(et||"utf8"))}else{ee("")}})}else{ee("")}},deleteFile:function($){var ee=ew($);if(ee){eg.deleteEntry(ee.entryName)}},addZipComment:function($){eg.comment=$},getZipComment:function(){return eg.comment||""},addZipEntryComment:function($,ee){var et=ew($);if(et){et.comment=ee}},getZipEntryComment:function($){var ee=ew($);if(ee){return ee.comment||""}return""},updateFile:function($,ee){var et=ew($);if(et){et.setData(ee)}},addLocalFile:function($,ee,et,en){if(ey.fs.existsSync($)){ee=ee?eE(ee):"";var ei=$.split("\\").join("/").split("/").pop();ee+=et?et:ei;const eo=ey.fs.statSync($);this.addFile(ee,ey.fs.readFileSync($),en,eo)}else{throw new Error(eo.Errors.FILE_NOT_FOUND.replace("%s",$))}},addLocalFolder:function($,ee,et,ei){if(et instanceof RegExp){et=function($){return function(ee){return $.test(ee)}}(et)}else if("function"!==typeof et){et=function(){return true}}ee=ee?eE(ee):"";$=es.normalize($);if(ey.fs.existsSync($)){const eo=ey.findFiles($);const eu=this;if(eo.length){eo.forEach(function(eo){var el=es.relative($,eo).split("\\").join("/");if(et(el)){var ef=ey.fs.statSync(eo);if(ef.isFile()){eu.addFile(ee+el,ey.fs.readFileSync(eo),"",ei?ei:ef)}else{eu.addFile(ee+el+"/",en.alloc(0),"",ei?ei:ef)}}})}}else{throw new Error(eo.Errors.FILE_NOT_FOUND.replace("%s",$))}},addLocalFolderAsync:function($,ee,et,eu){if(eu instanceof RegExp){eu=function($){return function(ee){return $.test(ee)}}(eu)}else if("function"!==typeof eu){eu=function(){return true}}et=et?eE(et):"";$=es.normalize($);var el=this;ey.fs.open($,"r",function(ef){if(ef&&ef.code==="ENOENT"){ee(undefined,eo.Errors.FILE_NOT_FOUND.replace("%s",$))}else if(ef){ee(undefined,ef)}else{var ed=ey.findFiles($);var ep=-1;var eh=function(){ep+=1;if(ep<ed.length){var eo=ed[ep];var ef=es.relative($,eo).split("\\").join("/");ef=ef.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,"");if(eu(ef)){ey.fs.stat(eo,function($,ei){if($)ee(undefined,$);if(ei.isFile()){ey.fs.readFile(eo,function($,en){if($){ee(undefined,$)}else{el.addFile(et+ef,en,"",ei);eh()}})}else{el.addFile(et+ef+"/",en.alloc(0),"",ei);eh()}})}else{ei.nextTick(()=>{eh()})}}else{ee(true,undefined)}};eh()}})},addLocalFolderPromise:function($,ee){return new Promise((et,en)=>{const{filter:ei,zipPath:eo}=Object.assign({},ee);this.addLocalFolderAsync($,($,ee)=>{if(ee)en(ee);if($)et(this)},eo,ei)})},addFile:function($,ee,et,en){let ei=ew($);const eo=ei!=null;if(!eo){ei=new eu;ei.entryName=$}ei.comment=et||"";const es="object"===typeof en&&en instanceof ey.fs.Stats;if(es){ei.header.time=en.mtime}var el=ei.isDirectory?16:0;let ef=ei.isDirectory?16384:32768;if(es){ef|=4095&en.mode}else if("number"===typeof en){ef|=4095&en}else{ef|=ei.isDirectory?493:420}el=(el|ef<<16)>>>0;ei.attr=el;ei.setData(ee);if(!eo)eg.setEntry(ei)},getEntries:function(){return eg?eg.entries:[]},getEntry:function($){return ew($)},getEntryCount:function(){return eg.getEntryCount()},forEach:function($){return eg.forEach($)},extractEntryTo:function($,ee,et,en,ei,eu){en=ef(en,false);ei=ef(ei,false);et=ef(et,true);eu=ed(eu,ed(ei,undefined));var el=ew($);if(!el){throw new Error(eo.Errors.NO_ENTRY)}var ep=em(el.entryName);var eh=e_(ee,eu&&!el.isDirectory?eu:et?ep:es.basename(ep));if(el.isDirectory){var eE=eg.getEntryChildren(el);eE.forEach(function($){if($.isDirectory)return;var eu=$.getData();if(!eu){throw new Error(eo.Errors.CANT_EXTRACT_FILE)}var el=em($.entryName);var ef=e_(ee,et?el:es.basename(el));const ed=ei?$.header.fileAttr:undefined;ey.writeFileTo(ef,eu,en,ed)});return true}var eS=el.getData();if(!eS)throw new Error(eo.Errors.CANT_EXTRACT_FILE);if(ey.fs.existsSync(eh)&&!en){throw new Error(eo.Errors.CANT_OVERRIDE)}const eT=ei?$.header.fileAttr:undefined;ey.writeFileTo(eh,eS,en,eT);return true},test:function($){if(!eg){return false}for(var ee in eg.entries){try{if(ee.isDirectory){continue}var et=eg.entries[ee].getData($);if(!et){return false}}catch($){return false}}return true},extractAllTo:function($,ee,et,en){ee=ef(ee,false);en=ed(et,en);et=ef(et,false);if(!eg){throw new Error(eo.Errors.NO_ZIP)}eg.entries.forEach(function(ei){var es=e_($,em(ei.entryName.toString()));if(ei.isDirectory){ey.makeDir(es);return}var eu=ei.getData(en);if(!eu){throw new Error(eo.Errors.CANT_EXTRACT_FILE)}const el=et?ei.header.fileAttr:undefined;ey.writeFileTo(es,eu,ee,el);try{ey.fs.utimesSync(es,ei.header.time,ei.header.time)}catch($){throw new Error(eo.Errors.CANT_EXTRACT_FILE)}})},extractAllToAsync:function($,ee,et,en){ee=ef(ee,false);if(typeof et==="function"&&!en)en=et;et=ef(et,false);if(!en){en=function($){throw new Error($)}}if(!eg){en(new Error(eo.Errors.NO_ZIP));return}$=es.resolve($);const ei=ee=>e_($,es.normalize(em(ee.entryName.toString())));const eu=($,ee)=>new Error($+': "'+ee+'"');const el=[];const ed=new Set;eg.entries.forEach($=>{if($.isDirectory){el.push($)}else{ed.add($)}});for(const $ of el){const ee=ei($);const eo=et?$.header.fileAttr:undefined;try{ey.makeDir(ee);if(eo)ey.fs.chmodSync(ee,eo);ey.fs.utimesSync(ee,$.header.time,$.header.time)}catch($){en(eu("Unable to create folder",ee))}}const ep=()=>{if(ed.size===0){en()}};for(const ei of ed.values()){const el=es.normalize(em(ei.entryName.toString()));const ef=e_($,el);ei.getDataAsync(function($,es){if(es){en(new Error(es));return}if(!$){en(new Error(eo.Errors.CANT_EXTRACT_FILE))}else{const eo=et?ei.header.fileAttr:undefined;ey.writeFileToAsync(ef,$,ee,eo,function($){if(!$){en(eu("Unable to write file",ef));return}ey.fs.utimes(ef,ei.header.time,ei.header.time,function($){if($){en(eu("Unable to set times",ef));return}ed.delete(ei);ep()})})}})}ep()},writeZip:function($,ee){if(arguments.length===1){if(typeof $==="function"){ee=$;$=""}}if(!$&&eh.filename){$=eh.filename}if(!$)return;var et=eg.compressToBuffer();if(et){var en=ey.writeFileTo($,et,true);if(typeof ee==="function")ee(!en?new Error("failed"):null,"")}},writeZipPromise:function($,ee){const{overwrite:et,perm:en}=Object.assign({overwrite:true},ee);return new Promise((ee,ei)=>{if(!$&&eh.filename)$=eh.filename;if(!$)ei("ADM-ZIP: ZIP File Name Missing");this.toBufferPromise().then(eo=>{const es=$=>$?ee($):ei("ADM-ZIP: Wasn't able to write zip file");ey.writeFileToAsync($,eo,et,en,es)},ei)})},toBufferPromise:function(){return new Promise(($,ee)=>{eg.toAsyncBuffer($,ee)})},toBuffer:function($,ee,et,en){this.valueOf=2;if(typeof $==="function"){eg.toAsyncBuffer($,ee,et,en);return null}return eg.compressToBuffer()}}}},2907:($,ee,et)=>{var en=et(8764)["Buffer"];var ei=et(5173),eo=ei.Constants;$.exports=function(){var $=20,ee=10,et=0,es=0,eu=0,el=0,ef=0,ed=0,ep=0,eh=0,ey=0,eg=0,em=0,e_=0,ew=0;$|=ei.isWin?2560:768;et|=eo.FLG_EFS;var eE={};function eS($){$=new Date($);eu=($.getFullYear()-1980&127)<<25|$.getMonth()+1<<21|$.getDate()<<16|$.getHours()<<11|$.getMinutes()<<5|$.getSeconds()>>1}eS(+new Date);return{get made(){return $},set made(val){$=val},get version(){return ee},set version(val){ee=val},get flags(){return et},set flags(val){et=val},get method(){return es},set method(val){switch(val){case eo.STORED:this.version=10;case eo.DEFLATED:default:this.version=20}es=val},get time(){return new Date((eu>>25&127)+1980,(eu>>21&15)-1,eu>>16&31,eu>>11&31,eu>>5&63,(eu&31)<<1)},set time(val){eS(val)},get crc(){return el},set crc(val){el=Math.max(0,val)>>>0},get compressedSize(){return ef},set compressedSize(val){ef=Math.max(0,val)>>>0},get size(){return ed},set size(val){ed=Math.max(0,val)>>>0},get fileNameLength(){return ep},set fileNameLength(val){ep=val},get extraLength(){return eh},set extraLength(val){eh=val},get commentLength(){return ey},set commentLength(val){ey=val},get diskNumStart(){return eg},set diskNumStart(val){eg=Math.max(0,val)>>>0},get inAttr(){return em},set inAttr(val){em=Math.max(0,val)>>>0},get attr(){return e_},set attr(val){e_=Math.max(0,val)>>>0},get fileAttr(){return e_?(e_>>>0|0)>>16&4095:0},get offset(){return ew},set offset(val){ew=Math.max(0,val)>>>0},get encripted(){return(et&1)===1},get entryHeaderSize(){return eo.CENHDR+ep+eh+ey},get realDataOffset(){return ew+eo.LOCHDR+eE.fnameLen+eE.extraLen},get dataHeader(){return eE},loadDataHeaderFromBinary:function($){var ee=$.slice(ew,ew+eo.LOCHDR);if(ee.readUInt32LE(0)!==eo.LOCSIG){throw new Error(ei.Errors.INVALID_LOC)}eE={version:ee.readUInt16LE(eo.LOCVER),flags:ee.readUInt16LE(eo.LOCFLG),method:ee.readUInt16LE(eo.LOCHOW),time:ee.readUInt32LE(eo.LOCTIM),crc:ee.readUInt32LE(eo.LOCCRC),compressedSize:ee.readUInt32LE(eo.LOCSIZ),size:ee.readUInt32LE(eo.LOCLEN),fnameLen:ee.readUInt16LE(eo.LOCNAM),extraLen:ee.readUInt16LE(eo.LOCEXT)}},loadFromBinary:function(en){if(en.length!==eo.CENHDR||en.readUInt32LE(0)!==eo.CENSIG){throw new Error(ei.Errors.INVALID_CEN)}$=en.readUInt16LE(eo.CENVEM);ee=en.readUInt16LE(eo.CENVER);et=en.readUInt16LE(eo.CENFLG);es=en.readUInt16LE(eo.CENHOW);eu=en.readUInt32LE(eo.CENTIM);el=en.readUInt32LE(eo.CENCRC);ef=en.readUInt32LE(eo.CENSIZ);ed=en.readUInt32LE(eo.CENLEN);ep=en.readUInt16LE(eo.CENNAM);eh=en.readUInt16LE(eo.CENEXT);ey=en.readUInt16LE(eo.CENCOM);eg=en.readUInt16LE(eo.CENDSK);em=en.readUInt16LE(eo.CENATT);e_=en.readUInt32LE(eo.CENATX);ew=en.readUInt32LE(eo.CENOFF)},dataHeaderToBinary:function(){var $=en.alloc(eo.LOCHDR);$.writeUInt32LE(eo.LOCSIG,0);$.writeUInt16LE(ee,eo.LOCVER);$.writeUInt16LE(et,eo.LOCFLG);$.writeUInt16LE(es,eo.LOCHOW);$.writeUInt32LE(eu,eo.LOCTIM);$.writeUInt32LE(el,eo.LOCCRC);$.writeUInt32LE(ef,eo.LOCSIZ);$.writeUInt32LE(ed,eo.LOCLEN);$.writeUInt16LE(ep,eo.LOCNAM);$.writeUInt16LE(eh,eo.LOCEXT);return $},entryHeaderToBinary:function(){var ei=en.alloc(eo.CENHDR+ep+eh+ey);ei.writeUInt32LE(eo.CENSIG,0);ei.writeUInt16LE($,eo.CENVEM);ei.writeUInt16LE(ee,eo.CENVER);ei.writeUInt16LE(et,eo.CENFLG);ei.writeUInt16LE(es,eo.CENHOW);ei.writeUInt32LE(eu,eo.CENTIM);ei.writeUInt32LE(el,eo.CENCRC);ei.writeUInt32LE(ef,eo.CENSIZ);ei.writeUInt32LE(ed,eo.CENLEN);ei.writeUInt16LE(ep,eo.CENNAM);ei.writeUInt16LE(eh,eo.CENEXT);ei.writeUInt16LE(ey,eo.CENCOM);ei.writeUInt16LE(eg,eo.CENDSK);ei.writeUInt16LE(em,eo.CENATT);ei.writeUInt32LE(e_,eo.CENATX);ei.writeUInt32LE(ew,eo.CENOFF);ei.fill(0,eo.CENHDR);return ei},toJSON:function(){const en=function($){return $+" bytes"};return{made:$,version:ee,flags:et,method:ei.methodToString(es),time:this.time,crc:"0x"+el.toString(16).toUpperCase(),compressedSize:en(ef),size:en(ed),fileNameLength:en(ep),extraLength:en(eh),commentLength:en(ey),diskNumStart:eg,inAttr:em,attr:e_,offset:ew,entryHeaderSize:en(eo.CENHDR+ep+eh+ey)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}},3854:($,ee,et)=>{ee.EntryHeader=et(2907);ee.MainHeader=et(3519)},3519:($,ee,et)=>{var en=et(8764)["Buffer"];var ei=et(5173),eo=ei.Constants;$.exports=function(){var $=0,ee=0,et=0,es=0,eu=0;return{get diskEntries(){return $},set diskEntries(val){$=ee=val},get totalEntries(){return ee},set totalEntries(val){ee=$=val},get size(){return et},set size(val){et=val},get offset(){return es},set offset(val){es=val},get commentLength(){return eu},set commentLength(val){eu=val},get mainHeaderSize(){return eo.ENDHDR+eu},loadFromBinary:function(en){if((en.length!==eo.ENDHDR||en.readUInt32LE(0)!==eo.ENDSIG)&&(en.length<eo.ZIP64HDR||en.readUInt32LE(0)!==eo.ZIP64SIG)){throw new Error(ei.Errors.INVALID_END)}if(en.readUInt32LE(0)===eo.ENDSIG){$=en.readUInt16LE(eo.ENDSUB);ee=en.readUInt16LE(eo.ENDTOT);et=en.readUInt32LE(eo.ENDSIZ);es=en.readUInt32LE(eo.ENDOFF);eu=en.readUInt16LE(eo.ENDCOM)}else{$=ei.readBigUInt64LE(en,eo.ZIP64SUB);ee=ei.readBigUInt64LE(en,eo.ZIP64TOT);et=ei.readBigUInt64LE(en,eo.ZIP64SIZE);es=ei.readBigUInt64LE(en,eo.ZIP64OFF);eu=0}},toBinary:function(){var ei=en.alloc(eo.ENDHDR+eu);ei.writeUInt32LE(eo.ENDSIG,0);ei.writeUInt32LE(0,4);ei.writeUInt16LE($,eo.ENDSUB);ei.writeUInt16LE(ee,eo.ENDTOT);ei.writeUInt32LE(et,eo.ENDSIZ);ei.writeUInt32LE(es,eo.ENDOFF);ei.writeUInt16LE(eu,eo.ENDCOM);ei.fill(" ",eo.ENDHDR);return ei},toJSON:function(){const en=function($,ee){let et=$.toString(16).toUpperCase();while(et.length<ee)et="0"+et;return"0x"+et};return{diskEntries:$,totalEntries:ee,size:et+" bytes",offset:en(es,4),commentLength:eu}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}},753:($,ee,et)=>{var en=et(8764)["Buffer"];$.exports=function($){var ee=et(2635);var ei={chunkSize:(parseInt($.length/1024)+1)*1024};return{deflate:function(){return ee.deflateRawSync($,ei)},deflateAsync:function(et){var eo=ee.createDeflateRaw(ei),es=[],eu=0;eo.on("data",function($){es.push($);eu+=$.length});eo.on("end",function(){var $=en.alloc(eu),ee=0;$.fill(0);for(var ei=0;ei<es.length;ei++){var eo=es[ei];eo.copy($,ee);ee+=eo.length}et&&et($)});eo.end($)}}}},1004:($,ee,et)=>{ee.Deflater=et(753);ee.Inflater=et(1269);ee.ZipCrypto=et(4729)},1269:($,ee,et)=>{var en=et(8764)["Buffer"];$.exports=function($){var ee=et(2635);return{inflate:function(){return ee.inflateRawSync($)},inflateAsync:function(et){var ei=ee.createInflateRaw(),eo=[],es=0;ei.on("data",function($){eo.push($);es+=$.length});ei.on("end",function(){var $=en.alloc(es),ee=0;$.fill(0);for(var ei=0;ei<eo.length;ei++){var eu=eo[ei];eu.copy($,ee);ee+=eu.length}et&&et($)});ei.end($)}}}},4729:($,ee,et)=>{"use strict";var en=et(8764)["Buffer"];const{randomFillSync:ei}=et(1214);const eo=new Uint32Array(256).map(($,ee)=>{for(let $=0;$<8;$++){if(0!==(ee&1)){ee=ee>>>1^3988292384}else{ee>>>=1}}return ee>>>0});const es=($,ee)=>Math.imul($,ee)>>>0;const eu=($,ee)=>{return eo[($^ee)&255]^$>>>8};const el=()=>{if("function"===typeof ei){return ei(en.alloc(12))}else{return el.node()}};el.node=()=>{const $=en.alloc(12);const ee=$.length;for(let et=0;et<ee;et++)$[et]=Math.random()*256&255;return $};const ef={genSalt:el};function ed($){const ee=en.isBuffer($)?$:en.from($);this.keys=new Uint32Array([305419896,591751049,878082192]);for(let $=0;$<ee.length;$++){this.updateKeys(ee[$])}}ed.prototype.updateKeys=function($){const ee=this.keys;ee[0]=eu(ee[0],$);ee[1]+=ee[0]&255;ee[1]=es(ee[1],134775813)+1;ee[2]=eu(ee[2],ee[1]>>>24);return $};ed.prototype.next=function(){const $=(this.keys[2]|2)>>>0;return es($,$^1)>>8&255};function ep($){const ee=new ed($);return function($){const et=en.alloc($.length);let ei=0;for(let en of $){et[ei++]=ee.updateKeys(en^ee.next())}return et}}function eh($){const ee=new ed($);return function($,et,ei=0){if(!et)et=en.alloc($.length);for(let en of $){const $=ee.next();et[ei++]=en^$;ee.updateKeys(en)}return et}}function ey($,ee,et){if(!$||!en.isBuffer($)||$.length<12){return en.alloc(0)}const ei=ep(et);const eo=ei($.slice(0,12));if(eo[11]!==ee.crc>>>24){throw"ADM-ZIP: Wrong Password"}return ei($.slice(12))}function eg($){if(en.isBuffer($)&&$.length>=12){ef.genSalt=function(){return $.slice(0,12)}}else if($==="node"){ef.genSalt=el.node}else{ef.genSalt=el}}function em($,ee,et,ei=false){if($==null)$=en.alloc(0);if(!en.isBuffer($))$=en.from($.toString());const eo=eh(et);const es=ef.genSalt();es[11]=ee.crc>>>24&255;if(ei)es[10]=ee.crc>>>16&255;const eu=en.alloc($.length+12);eo(es,eu);return eo($,eu,12)}$.exports={decrypt:ey,encrypt:em,_salter:eg}},5991:$=>{$.exports={LOCHDR:30,LOCSIG:67324752,LOCVER:4,LOCFLG:6,LOCHOW:8,LOCTIM:10,LOCCRC:14,LOCSIZ:18,LOCLEN:22,LOCNAM:26,LOCEXT:28,EXTSIG:134695760,EXTHDR:16,EXTCRC:4,EXTSIZ:8,EXTLEN:12,CENHDR:46,CENSIG:33639248,CENVEM:4,CENVER:6,CENFLG:8,CENHOW:10,CENTIM:12,CENCRC:16,CENSIZ:20,CENLEN:24,CENNAM:28,CENEXT:30,CENCOM:32,CENDSK:34,CENATT:36,CENATX:38,CENOFF:42,ENDHDR:22,ENDSIG:101010256,ENDSUB:8,ENDTOT:10,ENDSIZ:12,ENDOFF:16,ENDCOM:20,END64HDR:20,END64SIG:117853008,END64START:4,END64OFF:8,END64NUMDISKS:16,ZIP64SIG:101075792,ZIP64HDR:56,ZIP64LEAD:12,ZIP64SIZE:4,ZIP64VEM:12,ZIP64VER:14,ZIP64DSK:16,ZIP64DSKDIR:20,ZIP64SUB:24,ZIP64TOT:32,ZIP64SIZB:40,ZIP64OFF:48,ZIP64EXTRA:56,STORED:0,SHRUNK:1,REDUCED1:2,REDUCED2:3,REDUCED3:4,REDUCED4:5,IMPLODED:6,DEFLATED:8,ENHANCED_DEFLATED:9,PKWARE:10,BZIP2:12,LZMA:14,IBM_TERSE:18,IBM_LZ77:19,AES_ENCRYPT:99,FLG_ENC:1,FLG_COMP1:2,FLG_COMP2:4,FLG_DESC:8,FLG_ENH:16,FLG_PATCH:32,FLG_STR:64,FLG_EFS:2048,FLG_MSK:4096,FILE:2,BUFFER:1,NONE:0,EF_ID:0,EF_SIZE:2,ID_ZIP64:1,ID_AVINFO:7,ID_PFS:8,ID_OS2:9,ID_NTFS:10,ID_OPENVMS:12,ID_UNIX:13,ID_FORK:14,ID_PATCH:15,ID_X509_PKCS7:20,ID_X509_CERTID_F:21,ID_X509_CERTID_C:22,ID_STRONGENC:23,ID_RECORD_MGT:24,ID_X509_PKCS7_RL:25,ID_IBM1:101,ID_IBM2:102,ID_POSZIP:18064,EF_ZIP64_OR_32:4294967295,EF_ZIP64_OR_16:65535,EF_ZIP64_SUNCOMP:0,EF_ZIP64_SCOMP:8,EF_ZIP64_RHO:16,EF_ZIP64_DSN:24}},2190:$=>{$.exports={INVALID_LOC:"Invalid LOC header (bad signature)",INVALID_CEN:"Invalid CEN header (bad signature)",INVALID_END:"Invalid END header (bad signature)",NO_DATA:"Nothing to decompress",BAD_CRC:"CRC32 checksum failed",FILE_IN_THE_WAY:"There is a file in the way: %s",UNKNOWN_METHOD:"Invalid/unsupported compression method",AVAIL_DATA:"inflate::Available inflate data did not terminate",INVALID_DISTANCE:"inflate::Invalid literal/length or distance code in fixed or dynamic block",TO_MANY_CODES:"inflate::Dynamic block code description: too many length or distance codes",INVALID_REPEAT_LEN:"inflate::Dynamic block code description: repeat more than specified lengths",INVALID_REPEAT_FIRST:"inflate::Dynamic block code description: repeat lengths with no first length",INCOMPLETE_CODES:"inflate::Dynamic block code description: code lengths codes incomplete",INVALID_DYN_DISTANCE:"inflate::Dynamic block code description: invalid distance code lengths",INVALID_CODES_LEN:"inflate::Dynamic block code description: invalid literal/length code lengths",INVALID_STORE_BLOCK:"inflate::Stored block length did not match one's complement",INVALID_BLOCK_TYPE:"inflate::Invalid block type (type == 3)",CANT_EXTRACT_FILE:"Could not extract the file",CANT_OVERRIDE:"Target file already exists",NO_ZIP:"No zip file was loaded",NO_ENTRY:"Entry doesn't exist",DIRECTORY_CONTENT_ERROR:"A directory cannot have content",FILE_NOT_FOUND:"File not found: %s",NOT_IMPLEMENTED:"Not implemented",INVALID_FILENAME:"Invalid filename",INVALID_FORMAT:"Invalid or unsupported zip format. No END header found"}},3455:($,ee,et)=>{const en=et(5147).require();const ei=et(6470);en.existsSync=en.existsSync||ei.existsSync;$.exports=function($){var ee=$||"",et=es(),eo=null;function es(){return{directory:false,readonly:false,hidden:false,executable:false,mtime:0,atime:0}}if(ee&&en.existsSync(ee)){eo=en.statSync(ee);et.directory=eo.isDirectory();et.mtime=eo.mtime;et.atime=eo.atime;et.executable=(73&eo.mode)!==0;et.readonly=(128&eo.mode)===0;et.hidden=ei.basename(ee)[0]==="."}else{console.warn("Invalid path: "+ee)}return{get directory(){return et.directory},get readOnly(){return et.readonly},get hidden(){return et.hidden},get mtime(){return et.mtime},get atime(){return et.atime},get executable(){return et.executable},decodeAttributes:function(){},encodeAttributes:function(){},toJSON:function(){return{path:ee,isDirectory:et.directory,isReadOnly:et.readonly,isHidden:et.hidden,isExecutable:et.executable,mTime:et.mtime,aTime:et.atime}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}},5147:($,ee,et)=>{var en=et(4155);ee.require=function(){if(typeof en==="object"&&en.versions&&en.versions["electron"]){try{const $=et(Object(function $(){var $=new Error("Cannot find module 'original-fs'");$.code="MODULE_NOT_FOUND";throw $}()));if(Object.keys($).length>0){return $}}catch($){}}return et(6551)}},5173:($,ee,et)=>{$.exports=et(7646);$.exports.Constants=et(5991);$.exports.Errors=et(2190);$.exports.FileAttr=et(3455)},7646:($,ee,et)=>{var en=et(4155);var ei=et(8764)["Buffer"];const eo=et(5147).require();const es=et(6470);const eu=et(5991);const el=et(2190);const ef=typeof en==="object"&&"win32"===en.platform;const ed=$=>$&&typeof $==="object";const ep=new Uint32Array(256).map(($,ee)=>{for(let $=0;$<8;$++){if((ee&1)!==0){ee=3988292384^ee>>>1}else{ee>>>=1}}return ee>>>0});function eh($){this.sep=es.sep;this.fs=eo;if(ed($)){if(ed($.fs)&&typeof $.fs.statSync==="function"){this.fs=$.fs}}}$.exports=eh;eh.prototype.makeDir=function($){const ee=this;function et($){let et=$.split(ee.sep)[0];$.split(ee.sep).forEach(function($){if(!$||$.substr(-1,1)===":")return;et+=ee.sep+$;var en;try{en=ee.fs.statSync(et)}catch($){ee.fs.mkdirSync(et)}if(en&&en.isFile())throw el.FILE_IN_THE_WAY.replace("%s",et)})}et($)};eh.prototype.writeFileTo=function($,ee,et,en){const ei=this;if(ei.fs.existsSync($)){if(!et)return false;var eo=ei.fs.statSync($);if(eo.isDirectory()){return false}}var eu=es.dirname($);if(!ei.fs.existsSync(eu)){ei.makeDir(eu)}var el;try{el=ei.fs.openSync($,"w",438)}catch(ee){ei.fs.chmodSync($,438);el=ei.fs.openSync($,"w",438)}if(el){try{ei.fs.writeSync(el,ee,0,ee.length,0)}finally{ei.fs.closeSync(el)}}ei.fs.chmodSync($,en||438);return true};eh.prototype.writeFileToAsync=function($,ee,et,en,ei){if(typeof en==="function"){ei=en;en=undefined}const eo=this;eo.fs.exists($,function(eu){if(eu&&!et)return ei(false);eo.fs.stat($,function(et,el){if(eu&&el.isDirectory()){return ei(false)}var ef=es.dirname($);eo.fs.exists(ef,function(et){if(!et)eo.makeDir(ef);eo.fs.open($,"w",438,function(et,es){if(et){eo.fs.chmod($,438,function(){eo.fs.open($,"w",438,function(et,es){eo.fs.write(es,ee,0,ee.length,0,function(){eo.fs.close(es,function(){eo.fs.chmod($,en||438,function(){ei(true)})})})})})}else if(es){eo.fs.write(es,ee,0,ee.length,0,function(){eo.fs.close(es,function(){eo.fs.chmod($,en||438,function(){ei(true)})})})}else{eo.fs.chmod($,en||438,function(){ei(true)})}})})})})};eh.prototype.findFiles=function($){const ee=this;function et($,en,ei){if(typeof en==="boolean"){ei=en;en=undefined}let eo=[];ee.fs.readdirSync($).forEach(function(eu){var el=es.join($,eu);if(ee.fs.statSync(el).isDirectory()&&ei)eo=eo.concat(et(el,en,ei));if(!en||en.test(el)){eo.push(es.normalize(el)+(ee.fs.statSync(el).isDirectory()?ee.sep:""))}});return eo}return et($,undefined,true)};eh.prototype.getAttributes=function(){};eh.prototype.setAttributes=function(){};eh.crc32update=function($,ee){return ep[($^ee)&255]^$>>>8};eh.crc32=function($){if(typeof $==="string"){$=ei.from($,"utf8")}if(!ep.length)genCRCTable();let ee=$.length;let et=~0;for(let en=0;en<ee;)et=eh.crc32update(et,$[en++]);return~et>>>0};eh.methodToString=function($){switch($){case eu.STORED:return"STORED ("+$+")";case eu.DEFLATED:return"DEFLATED ("+$+")";default:return"UNSUPPORTED ("+$+")"}};eh.canonical=function($){if(!$)return"";var ee=es.posix.normalize("/"+$.split("\\").join("/"));return es.join(".",ee)};eh.sanitize=function($,ee){$=es.resolve(es.normalize($));var et=ee.split("/");for(var en=0,ei=et.length;en<ei;en++){var eo=es.normalize(es.join($,et.slice(en,ei).join(es.sep)));if(eo.indexOf($)===0){return eo}}return es.normalize(es.join($,es.basename(ee)))};eh.toBuffer=function $($){if(ei.isBuffer($)){return $}else if($ instanceof Uint8Array){return ei.from($)}else{return typeof $==="string"?ei.from($,"utf8"):ei.alloc(0)}};eh.readBigUInt64LE=function($,ee){var et=ei.from($.slice(ee,ee+8));et.swap64();return parseInt(`0x${et.toString("hex")}`)};eh.isWin=ef;eh.crcTable=ep},7396:($,ee,et)=>{var en=et(8764)["Buffer"];var ei=et(5173),eo=et(3854),es=ei.Constants,eu=et(1004);$.exports=function($){var ee=new eo.EntryHeader,et=en.alloc(0),el=en.alloc(0),ef=false,ed=null,ep=en.alloc(0);function eh(){if(!$||!en.isBuffer($)){return en.alloc(0)}ee.loadDataHeaderFromBinary($);return $.slice(ee.realDataOffset,ee.realDataOffset+ee.compressedSize)}function ey($){if((ee.flags&8)!==8){if(ei.crc32($)!==ee.dataHeader.crc){return false}}else{}return true}function eg($,eo,es){if(typeof eo==="undefined"&&typeof $==="string"){es=$;$=void 0}if(ef){if($&&eo){eo(en.alloc(0),ei.Errors.DIRECTORY_CONTENT_ERROR)}return en.alloc(0)}var el=eh();if(el.length===0){if($&&eo)eo(el);return el}if(ee.encripted){if("string"!==typeof es&&!en.isBuffer(es)){throw new Error("ADM-ZIP: Incompatible password parameter")}el=eu.ZipCrypto.decrypt(el,ee,es)}var ed=en.alloc(ee.size);switch(ee.method){case ei.Constants.STORED:el.copy(ed);if(!ey(ed)){if($&&eo)eo(ed,ei.Errors.BAD_CRC);throw new Error(ei.Errors.BAD_CRC)}else{if($&&eo)eo(ed);return ed}case ei.Constants.DEFLATED:var ep=new eu.Inflater(el);if(!$){const $=ep.inflate(ed);$.copy(ed,0);if(!ey(ed)){throw new Error(ei.Errors.BAD_CRC+" "+et.toString())}return ed}else{ep.inflateAsync(function($){$.copy($,0);if(eo){if(!ey($)){eo($,ei.Errors.BAD_CRC)}else{eo($)}}})}break;default:if($&&eo)eo(en.alloc(0),ei.Errors.UNKNOWN_METHOD);throw new Error(ei.Errors.UNKNOWN_METHOD)}}function em(et,eo){if((!ed||!ed.length)&&en.isBuffer($)){if(et&&eo)eo(eh());return eh()}if(ed.length&&!ef){var es;switch(ee.method){case ei.Constants.STORED:ee.compressedSize=ee.size;es=en.alloc(ed.length);ed.copy(es);if(et&&eo)eo(es);return es;default:case ei.Constants.DEFLATED:var el=new eu.Deflater(ed);if(!et){var ep=el.deflate();ee.compressedSize=ep.length;return ep}else{el.deflateAsync(function($){es=en.alloc($.length);ee.compressedSize=$.length;$.copy(es);eo&&eo(es)})}el=null;break}}else if(et&&eo){eo(en.alloc(0))}else{return en.alloc(0)}}function e_($,ee){return($.readUInt32LE(ee+4)<<4)+$.readUInt32LE(ee)}function ew($){var ee=0;var et,en,ei;while(ee<$.length){et=$.readUInt16LE(ee);ee+=2;en=$.readUInt16LE(ee);ee+=2;ei=$.slice(ee,ee+en);ee+=en;if(es.ID_ZIP64===et){eE(ei)}}}function eE($){var et,en,ei,eo;if($.length>=es.EF_ZIP64_SCOMP){et=e_($,es.EF_ZIP64_SUNCOMP);if(ee.size===es.EF_ZIP64_OR_32){ee.size=et}}if($.length>=es.EF_ZIP64_RHO){en=e_($,es.EF_ZIP64_SCOMP);if(ee.compressedSize===es.EF_ZIP64_OR_32){ee.compressedSize=en}}if($.length>=es.EF_ZIP64_DSN){ei=e_($,es.EF_ZIP64_RHO);if(ee.offset===es.EF_ZIP64_OR_32){ee.offset=ei}}if($.length>=es.EF_ZIP64_DSN+4){eo=$.readUInt32LE(es.EF_ZIP64_DSN);if(ee.diskNumStart===es.EF_ZIP64_OR_16){ee.diskNumStart=eo}}}return{get entryName(){return et.toString()},get rawEntryName(){return et},set entryName(val){et=ei.toBuffer(val);var eS=et[et.length-1];ef=eS===47||eS===92;ee.fileNameLength=et.length},get extra(){return ep},set extra(val){ep=val;ee.extraLength=val.length;ew(val)},get comment(){return el.toString()},set comment(val){el=ei.toBuffer(val);ee.commentLength=el.length},get name(){var eT=et.toString();return ef?eT.substr(eT.length-1).split("/").pop():eT.split("/").pop()},get isDirectory(){return ef},getCompressedData:function(){return em(false,null)},getCompressedDataAsync:function($){em(true,$)},setData:function($){ed=ei.toBuffer($);if(!ef&&ed.length){ee.size=ed.length;ee.method=ei.Constants.DEFLATED;ee.crc=ei.crc32($);ee.changed=true}else{ee.method=ei.Constants.STORED}},getData:function($){if(ee.changed){return ed}else{return eg(false,null,$)}},getDataAsync:function($,et){if(ee.changed){$(ed)}else{eg(true,$,et)}},set attr(attr){ee.attr=attr},get attr(){return ee.attr},set header(data){ee.loadFromBinary(data)},get header(){return ee},packHeader:function(){var $=ee.entryHeaderToBinary();var en=ei.Constants.CENHDR;et.copy($,en);en+=et.length;if(ee.extraLength){ep.copy($,en);en+=ee.extraLength}if(ee.commentLength){el.copy($,en)}return $},toJSON:function(){const et=function($){return"<"+($&&$.length+" bytes buffer"||"null")+">"};return{entryName:this.entryName,name:this.name,comment:this.comment,isDirectory:this.isDirectory,header:ee.toJSON(),compressedData:et($),data:et(ed)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}},6333:($,ee,et)=>{var en=et(8764)["Buffer"];const ei=et(7396);const eo=et(3854);const es=et(5173);$.exports=function($,ee){var et=[],eu={},el=en.alloc(0),ef=new eo.MainHeader,ed=false;const ep=Object.assign(Object.create(null),ee);const{noSort:eh}=ep;if($){em(ep.readEntries)}else{ed=true}function ey(ee){const et=ef.diskEntries;let en=ef.offset;for(let eo=0;eo<et;eo++){let et=en;const eo=new ei($);eo.header=$.slice(et,et+=es.Constants.CENHDR);eo.entryName=$.slice(et,et+=eo.header.fileNameLength);en+=eo.header.entryHeaderSize;ee(eo)}}function eg(){ed=true;eu={};et=new Array(ef.diskEntries);var ee=ef.offset;for(var en=0;en<et.length;en++){var eo=ee,el=new ei($);el.header=$.slice(eo,eo+=es.Constants.CENHDR);el.entryName=$.slice(eo,eo+=el.header.fileNameLength);if(el.header.extraLength){el.extra=$.slice(eo,eo+=el.header.extraLength)}if(el.header.commentLength)el.comment=$.slice(eo,eo+el.header.commentLength);ee+=el.header.entryHeaderSize;et[en]=el;eu[el.entryName]=el}}function em(ee){var et=$.length-es.Constants.ENDHDR,en=Math.max(0,et-65535),ei=en,eo=$.length,eu=-1,ed=0;for(et;et>=ei;et--){if($[et]!==80)continue;if($.readUInt32LE(et)===es.Constants.ENDSIG){eu=et;ed=et;eo=et+es.Constants.ENDHDR;ei=et-es.Constants.END64HDR;continue}if($.readUInt32LE(et)===es.Constants.END64SIG){ei=en;continue}if($.readUInt32LE(et)===es.Constants.ZIP64SIG){eu=et;eo=et+es.readBigUInt64LE($,et+es.Constants.ZIP64SIZE)+es.Constants.ZIP64LEAD;break}}if(!~eu)throw new Error(es.Errors.INVALID_FORMAT);ef.loadFromBinary($.slice(eu,eo));if(ef.commentLength){el=$.slice(ed+es.Constants.ENDHDR)}if(ee)eg()}function e_(){if(et.length>1&&!eh){et.sort(($,ee)=>$.entryName.toLowerCase().localeCompare(ee.entryName.toLowerCase()))}}return{get entries(){if(!ed){eg()}return et},get comment(){return el.toString()},set comment(val){el=es.toBuffer(val);ef.commentLength=el.length},getEntryCount:function(){if(!ed){return ef.diskEntries}return et.length},forEach:function($){if(!ed){ey($);return}et.forEach($)},getEntry:function($){if(!ed){eg()}return eu[$]||null},setEntry:function($){if(!ed){eg()}et.push($);eu[$.entryName]=$;ef.totalEntries=et.length},deleteEntry:function($){if(!ed){eg()}var ee=eu[$];if(ee&&ee.isDirectory){var en=this;this.getEntryChildren(ee).forEach(function(ee){if(ee.entryName!==$){en.deleteEntry(ee.entryName)}})}et.splice(et.indexOf(ee),1);delete eu[$];ef.totalEntries=et.length},getEntryChildren:function($){if(!ed){eg()}if($&&$.isDirectory){const ee=[];const en=$.entryName;const ei=en.length;et.forEach(function($){if($.entryName.substr(0,ei)===en){ee.push($)}});return ee}return[]},compressToBuffer:function(){if(!ed){eg()}e_();const $=[];const ee=[];let ei=0;let eo=0;ef.size=0;ef.offset=0;for(const es of et){const et=es.getCompressedData();es.header.offset=eo;const eu=es.header.dataHeaderToBinary();const el=es.rawEntryName.length;const ed=en.alloc(el+es.extra.length);es.rawEntryName.copy(ed,0);ed.copy(es.extra,el);const ep=eu.length+ed.length+et.length;eo+=ep;$.push(eu);$.push(ed);$.push(et);const eh=es.packHeader();ee.push(eh);ef.size+=eh.length;ei+=ep+eh.length}ei+=ef.mainHeaderSize;ef.offset=eo;eo=0;const eu=en.alloc(ei);for(const ee of $){ee.copy(eu,eo);eo+=ee.length}for(const $ of ee){$.copy(eu,eo);eo+=$.length}const ep=ef.toBinary();if(el){el.copy(ep,es.Constants.ENDHDR)}ep.copy(eu,eo);return eu},toAsyncBuffer:function($,ee,ei,eo){try{if(!ed){eg()}e_();const ee=[];const eu=[];let ep=0;let eh=0;ef.size=0;ef.offset=0;const ey=function(et){if(et.length){const $=et.pop();const es=$.entryName+$.extra.toString();if(ei)ei(es);$.getCompressedDataAsync(function(ei){if(eo)eo(es);$.header.offset=eh;const el=$.header.dataHeaderToBinary();const ed=en.alloc(es.length,es);const eg=el.length+ed.length+ei.length;eh+=eg;ee.push(el);ee.push(ed);ee.push(ei);const em=$.packHeader();eu.push(em);ef.size+=em.length;ep+=eg+em.length;ey(et)})}else{ep+=ef.mainHeaderSize;ef.offset=eh;eh=0;const et=en.alloc(ep);ee.forEach(function($){$.copy(et,eh);eh+=$.length});eu.forEach(function($){$.copy(et,eh);eh+=$.length});const ei=ef.toBinary();if(el){el.copy(ei,es.Constants.ENDHDR)}ei.copy(et,eh);$(et)}};ey(et)}catch($){ee($)}}}}},6894:($,ee,et)=>{"use strict";var en=et(1924);var ei=en("ArrayBuffer.prototype.byteLength",true);var eo=et(635);$.exports=function $($){if(!eo($)){return NaN}return ei?ei($):$.byteLength}},9282:($,ee,et)=>{"use strict";var en=et(4155);function ei($){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){ei=function $($){return typeof $}}else{ei=function $($){return $&&typeof Symbol==="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $}}return ei($)}function eo($,ee){if(!($ instanceof ee)){throw new TypeError("Cannot call a class as a function")}}var es=et(2136),eu=es.codes,el=eu.ERR_AMBIGUOUS_ARGUMENT,ef=eu.ERR_INVALID_ARG_TYPE,ed=eu.ERR_INVALID_ARG_VALUE,ep=eu.ERR_INVALID_RETURN_VALUE,eh=eu.ERR_MISSING_ARGS;var ey=et(5961);var eg=et(9539),em=eg.inspect;var e_=et(9539).types,ew=e_.isPromise,eE=e_.isRegExp;var eS=Object.assign?Object.assign:et(8091).assign;var eT=Object.is?Object.is:et(609);var eO=new Map;var eA;var eI;var eN;var eD;var eR;function eC(){var $=et(9158);eA=$.isDeepEqual;eI=$.isDeepStrictEqual}var ek=/[\x00-\x08\x0b\x0c\x0e-\x1f]/g;var eM=null&&["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","","","\\u000b","\\f","","\\u000e","\\u000f","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001a","\\u001b","\\u001c","\\u001d","\\u001e","\\u001f"];var eL=function $($){return eM[$.charCodeAt(0)]};var eP=false;var eF=$.exports=eH;var eB={};function eU($){if($.message instanceof Error)throw $.message;throw new ey($)}function ej($,ee,et,ei,eo){var es=arguments.length;var eu;if(es===0){eu="Failed"}else if(es===1){et=$;$=undefined}else{if(eP===false){eP=true;var el=en.emitWarning?en.emitWarning:console.warn.bind(console);el("assert.fail() with more than one argument is deprecated. "+"Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")}if(es===2)ei="!="}if(et instanceof Error)throw et;var ef={actual:$,expected:ee,operator:ei===undefined?"fail":ei,stackStartFn:eo||ej};if(et!==undefined){ef.message=et}var ed=new ey(ef);if(eu){ed.message=eu;ed.generatedMessage=true}throw ed}eF.fail=ej;eF.AssertionError=ey;function eW($,ee,et,en){if(!et){var ei=false;if(ee===0){ei=true;en="No value argument passed to `assert.ok()`"}else if(en instanceof Error){throw en}var eo=new ey({actual:et,expected:true,message:en,operator:"==",stackStartFn:$});eo.generatedMessage=ei;throw eo}}function eH(){for(var $=arguments.length,ee=new Array($),et=0;et<$;et++){ee[et]=arguments[et]}eW.apply(void 0,[eH,ee.length].concat(ee))}eF.ok=eH;eF.equal=function $(ee,et,en){if(arguments.length<2){throw new eh("actual","expected")}if(ee!=et){eU({actual:ee,expected:et,message:en,operator:"==",stackStartFn:$})}};eF.notEqual=function $(ee,et,en){if(arguments.length<2){throw new eh("actual","expected")}if(ee==et){eU({actual:ee,expected:et,message:en,operator:"!=",stackStartFn:$})}};eF.deepEqual=function $(ee,et,en){if(arguments.length<2){throw new eh("actual","expected")}if(eA===undefined)eC();if(!eA(ee,et)){eU({actual:ee,expected:et,message:en,operator:"deepEqual",stackStartFn:$})}};eF.notDeepEqual=function $(ee,et,en){if(arguments.length<2){throw new eh("actual","expected")}if(eA===undefined)eC();if(eA(ee,et)){eU({actual:ee,expected:et,message:en,operator:"notDeepEqual",stackStartFn:$})}};eF.deepStrictEqual=function $(ee,et,en){if(arguments.length<2){throw new eh("actual","expected")}if(eA===undefined)eC();if(!eI(ee,et)){eU({actual:ee,expected:et,message:en,operator:"deepStrictEqual",stackStartFn:$})}};eF.notDeepStrictEqual=ez;function ez($,ee,et){if(arguments.length<2){throw new eh("actual","expected")}if(eA===undefined)eC();if(eI($,ee)){eU({actual:$,expected:ee,message:et,operator:"notDeepStrictEqual",stackStartFn:ez})}}eF.strictEqual=function $(ee,et,en){if(arguments.length<2){throw new eh("actual","expected")}if(!eT(ee,et)){eU({actual:ee,expected:et,message:en,operator:"strictEqual",stackStartFn:$})}};eF.notStrictEqual=function $(ee,et,en){if(arguments.length<2){throw new eh("actual","expected")}if(eT(ee,et)){eU({actual:ee,expected:et,message:en,operator:"notStrictEqual",stackStartFn:$})}};var eV=function $(ee,et,en){var ei=this;eo(this,$);et.forEach(function($){if($ in ee){if(en!==undefined&&typeof en[$]==="string"&&eE(ee[$])&&ee[$].test(en[$])){ei[$]=en[$]}else{ei[$]=ee[$]}}})};function e$($,ee,et,en,ei,eo){if(!(et in $)||!eI($[et],ee[et])){if(!en){var es=new eV($,ei);var eu=new eV(ee,ei,$);var el=new ey({actual:es,expected:eu,operator:"deepStrictEqual",stackStartFn:eo});el.actual=$;el.expected=ee;el.operator=eo.name;throw el}eU({actual:$,expected:ee,message:en,operator:eo.name,stackStartFn:eo})}}function eq($,ee,et,en){if(typeof ee!=="function"){if(eE(ee))return ee.test($);if(arguments.length===2){throw new ef("expected",["Function","RegExp"],ee)}if(ei($)!=="object"||$===null){var eo=new ey({actual:$,expected:ee,message:et,operator:"deepStrictEqual",stackStartFn:en});eo.operator=en.name;throw eo}var es=Object.keys(ee);if(ee instanceof Error){es.push("name","message")}else if(es.length===0){throw new ed("error",ee,"may not be an empty object")}if(eA===undefined)eC();es.forEach(function(ei){if(typeof $[ei]==="string"&&eE(ee[ei])&&ee[ei].test($[ei])){return}e$($,ee,ei,et,es,en)});return true}if(ee.prototype!==undefined&&$ instanceof ee){return true}if(Error.isPrototypeOf(ee)){return false}return ee.call({},$)===true}function eG($){if(typeof $!=="function"){throw new ef("fn","Function",$)}try{$()}catch($){return $}return eB}function eY($){return ew($)||$!==null&&ei($)==="object"&&typeof $.then==="function"&&typeof $.catch==="function"}function eK($){return Promise.resolve().then(function(){var ee;if(typeof $==="function"){ee=$();if(!eY(ee)){throw new ep("instance of Promise","promiseFn",ee)}}else if(eY($)){ee=$}else{throw new ef("promiseFn",["Function","Promise"],$)}return Promise.resolve().then(function(){return ee}).then(function(){return eB}).catch(function($){return $})})}function eZ($,ee,et,en){if(typeof et==="string"){if(arguments.length===4){throw new ef("error",["Object","Error","Function","RegExp"],et)}if(ei(ee)==="object"&&ee!==null){if(ee.message===et){throw new el("error/message",'The error message "'.concat(ee.message,'" is identical to the message.'))}}else if(ee===et){throw new el("error/message",'The error "'.concat(ee,'" is identical to the message.'))}en=et;et=undefined}else if(et!=null&&ei(et)!=="object"&&typeof et!=="function"){throw new ef("error",["Object","Error","Function","RegExp"],et)}if(ee===eB){var eo="";if(et&&et.name){eo+=" (".concat(et.name,")")}eo+=en?": ".concat(en):".";var es=$.name==="rejects"?"rejection":"exception";eU({actual:undefined,expected:et,operator:$.name,message:"Missing expected ".concat(es).concat(eo),stackStartFn:$})}if(et&&!eq(ee,et,en,$)){throw ee}}function eJ($,ee,et,en){if(ee===eB)return;if(typeof et==="string"){en=et;et=undefined}if(!et||eq(ee,et)){var ei=en?": ".concat(en):".";var eo=$.name==="doesNotReject"?"rejection":"exception";eU({actual:ee,expected:et,operator:$.name,message:"Got unwanted ".concat(eo).concat(ei,"\n")+'Actual message: "'.concat(ee&&ee.message,'"'),stackStartFn:$})}throw ee}eF.throws=function $(ee){for(var et=arguments.length,en=new Array(et>1?et-1:0),ei=1;ei<et;ei++){en[ei-1]=arguments[ei]}eZ.apply(void 0,[$,eG(ee)].concat(en))};eF.rejects=function $(ee){for(var et=arguments.length,en=new Array(et>1?et-1:0),ei=1;ei<et;ei++){en[ei-1]=arguments[ei]}return eK(ee).then(function(ee){return eZ.apply(void 0,[$,ee].concat(en))})};eF.doesNotThrow=function $(ee){for(var et=arguments.length,en=new Array(et>1?et-1:0),ei=1;ei<et;ei++){en[ei-1]=arguments[ei]}eJ.apply(void 0,[$,eG(ee)].concat(en))};eF.doesNotReject=function $(ee){for(var et=arguments.length,en=new Array(et>1?et-1:0),ei=1;ei<et;ei++){en[ei-1]=arguments[ei]}return eK(ee).then(function(ee){return eJ.apply(void 0,[$,ee].concat(en))})};eF.ifError=function $(ee){if(ee!==null&&ee!==undefined){var et="ifError got unwanted exception: ";if(ei(ee)==="object"&&typeof ee.message==="string"){if(ee.message.length===0&&ee.constructor){et+=ee.constructor.name}else{et+=ee.message}}else{et+=em(ee)}var en=new ey({actual:ee,expected:null,operator:"ifError",message:et,stackStartFn:$});var eo=ee.stack;if(typeof eo==="string"){var es=eo.split("\n");es.shift();var eu=en.stack.split("\n");for(var el=0;el<es.length;el++){var ef=eu.indexOf(es[el]);if(ef!==-1){eu=eu.slice(0,ef);break}}en.stack="".concat(eu.join("\n"),"\n").concat(es.join("\n"))}throw en}};function eX(){for(var $=arguments.length,ee=new Array($),et=0;et<$;et++){ee[et]=arguments[et]}eW.apply(void 0,[eX,ee.length].concat(ee))}eF.strict=eS(eX,eF,{equal:eF.strictEqual,deepEqual:eF.deepStrictEqual,notEqual:eF.notStrictEqual,notDeepEqual:eF.notDeepStrictEqual});eF.strict.strict=eF.strict},5961:($,ee,et)=>{"use strict";var en=et(4155);function ei($){for(var ee=1;ee<arguments.length;ee++){var et=arguments[ee]!=null?arguments[ee]:{};var en=Object.keys(et);if(typeof Object.getOwnPropertySymbols==="function"){en=en.concat(Object.getOwnPropertySymbols(et).filter(function($){return Object.getOwnPropertyDescriptor(et,$).enumerable}))}en.forEach(function(ee){eo($,ee,et[ee])})}return $}function eo($,ee,et){if(ee in $){Object.defineProperty($,ee,{value:et,enumerable:true,configurable:true,writable:true})}else{$[ee]=et}return $}function es($,ee){if(!($ instanceof ee)){throw new TypeError("Cannot call a class as a function")}}function eu($,ee){for(var et=0;et<ee.length;et++){var en=ee[et];en.enumerable=en.enumerable||false;en.configurable=true;if("value"in en)en.writable=true;Object.defineProperty($,en.key,en)}}function el($,ee,et){if(ee)eu($.prototype,ee);if(et)eu($,et);return $}function ef($,ee){if(ee&&(eE(ee)==="object"||typeof ee==="function")){return ee}return ed($)}function ed($){if($===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return $}function ep($,ee){if(typeof ee!=="function"&&ee!==null){throw new TypeError("Super expression must either be null or a function")}$.prototype=Object.create(ee&&ee.prototype,{constructor:{value:$,writable:true,configurable:true}});if(ee)e_($,ee)}function eh($){var ee=typeof Map==="function"?new Map:undefined;eh=function $($){if($===null||!em($))return $;if(typeof $!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof ee!=="undefined"){if(ee.has($))return ee.get($);ee.set($,et)}function et(){return eg($,arguments,ew(this).constructor)}et.prototype=Object.create($.prototype,{constructor:{value:et,enumerable:false,writable:true,configurable:true}});return e_(et,$)};return eh($)}function ey(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true}catch($){return false}}function eg($,ee,et){if(ey()){eg=Reflect.construct}else{eg=function $($,ee,et){var en=[null];en.push.apply(en,ee);var ei=Function.bind.apply($,en);var eo=new ei;if(et)e_(eo,et.prototype);return eo}}return eg.apply(null,arguments)}function em($){return Function.toString.call($).indexOf("[native code]")!==-1}function e_($,ee){e_=Object.setPrototypeOf||function $($,ee){$.__proto__=ee;return $};return e_($,ee)}function ew($){ew=Object.setPrototypeOf?Object.getPrototypeOf:function $($){return $.__proto__||Object.getPrototypeOf($)};return ew($)}function eE($){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){eE=function $($){return typeof $}}else{eE=function $($){return $&&typeof Symbol==="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $}}return eE($)}var eS=et(9539),eT=eS.inspect;var eO=et(2136),eA=eO.codes.ERR_INVALID_ARG_TYPE;function eI($,ee,et){if(et===undefined||et>$.length){et=$.length}return $.substring(et-ee.length,et)===ee}function eN($,ee){ee=Math.floor(ee);if($.length==0||ee==0)return"";var et=$.length*ee;ee=Math.floor(Math.log(ee)/Math.log(2));while(ee){$+=$;ee--}$+=$.substring(0,et-$.length);return $}var eD="";var eR="";var eC="";var ek="";var eM={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};var eL=10;function eP($){var ee=Object.keys($);var et=Object.create(Object.getPrototypeOf($));ee.forEach(function(ee){et[ee]=$[ee]});Object.defineProperty(et,"message",{value:$.message});return et}function eF($){return eT($,{compact:false,customInspect:false,depth:1e3,maxArrayLength:Infinity,showHidden:false,breakLength:Infinity,showProxy:false,sorted:true,getters:true})}function eB($,ee,et){var ei="";var eo="";var es=0;var eu="";var el=false;var ef=eF($);var ed=ef.split("\n");var ep=eF(ee).split("\n");var eh=0;var ey="";if(et==="strictEqual"&&eE($)==="object"&&eE(ee)==="object"&&$!==null&&ee!==null){et="strictEqualObject"}if(ed.length===1&&ep.length===1&&ed[0]!==ep[0]){var eg=ed[0].length+ep[0].length;if(eg<=eL){if((eE($)!=="object"||$===null)&&(eE(ee)!=="object"||ee===null)&&($!==0||ee!==0)){return"".concat(eM[et],"\n\n")+"".concat(ed[0]," !== ").concat(ep[0],"\n")}}else if(et!=="strictEqualObject"){var em=en.stderr&&en.stderr.isTTY?en.stderr.columns:80;if(eg<em){while(ed[0][eh]===ep[0][eh]){eh++}if(eh>2){ey="\n ".concat(eN(" ",eh),"^");eh=0}}}}var e_=ed[ed.length-1];var ew=ep[ep.length-1];while(e_===ew){if(eh++<2){eu="\n ".concat(e_).concat(eu)}else{ei=e_}ed.pop();ep.pop();if(ed.length===0||ep.length===0)break;e_=ed[ed.length-1];ew=ep[ep.length-1]}var eS=Math.max(ed.length,ep.length);if(eS===0){var eT=ef.split("\n");if(eT.length>30){eT[26]="".concat(eD,"...").concat(ek);while(eT.length>27){eT.pop()}}return"".concat(eM.notIdentical,"\n\n").concat(eT.join("\n"),"\n")}if(eh>3){eu="\n".concat(eD,"...").concat(ek).concat(eu);el=true}if(ei!==""){eu="\n ".concat(ei).concat(eu);ei=""}var eO=0;var eA=eM[et]+"\n".concat(eR,"+ actual").concat(ek," ").concat(eC,"- expected").concat(ek);var eP=" ".concat(eD,"...").concat(ek," Lines skipped");for(eh=0;eh<eS;eh++){var eB=eh-es;if(ed.length<eh+1){if(eB>1&&eh>2){if(eB>4){eo+="\n".concat(eD,"...").concat(ek);el=true}else if(eB>3){eo+="\n ".concat(ep[eh-2]);eO++}eo+="\n ".concat(ep[eh-1]);eO++}es=eh;ei+="\n".concat(eC,"-").concat(ek," ").concat(ep[eh]);eO++}else if(ep.length<eh+1){if(eB>1&&eh>2){if(eB>4){eo+="\n".concat(eD,"...").concat(ek);el=true}else if(eB>3){eo+="\n ".concat(ed[eh-2]);eO++}eo+="\n ".concat(ed[eh-1]);eO++}es=eh;eo+="\n".concat(eR,"+").concat(ek," ").concat(ed[eh]);eO++}else{var eU=ep[eh];var ej=ed[eh];var eW=ej!==eU&&(!eI(ej,",")||ej.slice(0,-1)!==eU);if(eW&&eI(eU,",")&&eU.slice(0,-1)===ej){eW=false;ej+=","}if(eW){if(eB>1&&eh>2){if(eB>4){eo+="\n".concat(eD,"...").concat(ek);el=true}else if(eB>3){eo+="\n ".concat(ed[eh-2]);eO++}eo+="\n ".concat(ed[eh-1]);eO++}es=eh;eo+="\n".concat(eR,"+").concat(ek," ").concat(ej);ei+="\n".concat(eC,"-").concat(ek," ").concat(eU);eO+=2}else{eo+=ei;ei="";if(eB===1||eh===0){eo+="\n ".concat(ej);eO++}}}if(eO>20&&eh<eS-2){return"".concat(eA).concat(eP,"\n").concat(eo,"\n").concat(eD,"...").concat(ek).concat(ei,"\n")+"".concat(eD,"...").concat(ek)}}return"".concat(eA).concat(el?eP:"","\n").concat(eo).concat(ei).concat(eu).concat(ey)}var eU=function($){ep(ee,$);function ee($){var et;es(this,ee);if(eE($)!=="object"||$===null){throw new eA("options","Object",$)}var ei=$.message,eo=$.operator,eu=$.stackStartFn;var el=$.actual,ep=$.expected;var eh=Error.stackTraceLimit;Error.stackTraceLimit=0;if(ei!=null){et=ef(this,ew(ee).call(this,String(ei)))}else{if(en.stderr&&en.stderr.isTTY){if(en.stderr&&en.stderr.getColorDepth&&en.stderr.getColorDepth()!==1){eD="\x1b[34m";eR="\x1b[32m";ek="\x1b[39m";eC="\x1b[31m"}else{eD="";eR="";ek="";eC=""}}if(eE(el)==="object"&&el!==null&&eE(ep)==="object"&&ep!==null&&"stack"in el&&el instanceof Error&&"stack"in ep&&ep instanceof Error){el=eP(el);ep=eP(ep)}if(eo==="deepStrictEqual"||eo==="strictEqual"){et=ef(this,ew(ee).call(this,eB(el,ep,eo)))}else if(eo==="notDeepStrictEqual"||eo==="notStrictEqual"){var ey=eM[eo];var eg=eF(el).split("\n");if(eo==="notStrictEqual"&&eE(el)==="object"&&el!==null){ey=eM.notStrictEqualObject}if(eg.length>30){eg[26]="".concat(eD,"...").concat(ek);while(eg.length>27){eg.pop()}}if(eg.length===1){et=ef(this,ew(ee).call(this,"".concat(ey," ").concat(eg[0])))}else{et=ef(this,ew(ee).call(this,"".concat(ey,"\n\n").concat(eg.join("\n"),"\n")))}}else{var em=eF(el);var e_="";var eS=eM[eo];if(eo==="notDeepEqual"||eo==="notEqual"){em="".concat(eM[eo],"\n\n").concat(em);if(em.length>1024){em="".concat(em.slice(0,1021),"...")}}else{e_="".concat(eF(ep));if(em.length>512){em="".concat(em.slice(0,509),"...")}if(e_.length>512){e_="".concat(e_.slice(0,509),"...")}if(eo==="deepEqual"||eo==="equal"){em="".concat(eS,"\n\n").concat(em,"\n\nshould equal\n\n")}else{e_=" ".concat(eo," ").concat(e_)}}et=ef(this,ew(ee).call(this,"".concat(em).concat(e_)))}}Error.stackTraceLimit=eh;et.generatedMessage=!ei;Object.defineProperty(ed(et),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:false,writable:true,configurable:true});et.code="ERR_ASSERTION";et.actual=el;et.expected=ep;et.operator=eo;if(Error.captureStackTrace){Error.captureStackTrace(ed(et),eu)}et.stack;et.name="AssertionError";return ef(et)}el(ee,[{key:"toString",value:function $(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:eT.custom,value:function $($,ee){return eT(this,ei({},ee,{customInspect:false,depth:0}))}}]);return ee}(eh(Error));$.exports=eU},2136:($,ee,et)=>{"use strict";function en($){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){en=function $($){return typeof $}}else{en=function $($){return $&&typeof Symbol==="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $}}return en($)}function ei($,ee){if(!($ instanceof ee)){throw new TypeError("Cannot call a class as a function")}}function eo($,ee){if(ee&&(en(ee)==="object"||typeof ee==="function")){return ee}return es($)}function es($){if($===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return $}function eu($){eu=Object.setPrototypeOf?Object.getPrototypeOf:function $($){return $.__proto__||Object.getPrototypeOf($)};return eu($)}function el($,ee){if(typeof ee!=="function"&&ee!==null){throw new TypeError("Super expression must either be null or a function")}$.prototype=Object.create(ee&&ee.prototype,{constructor:{value:$,writable:true,configurable:true}});if(ee)ef($,ee)}function ef($,ee){ef=Object.setPrototypeOf||function $($,ee){$.__proto__=ee;return $};return ef($,ee)}var ed={};var ep;var eh;function ey($,ee,et){if(!et){et=Error}function en($,et,en){if(typeof ee==="string"){return ee}else{return ee($,et,en)}}var es=function(ee){el(et,ee);function et(ee,es,el){var ef;ei(this,et);ef=eo(this,eu(et).call(this,en(ee,es,el)));ef.code=$;return ef}return et}(et);ed[$]=es}function eg($,ee){if(Array.isArray($)){var et=$.length;$=$.map(function($){return String($)});if(et>2){return"one of ".concat(ee," ").concat($.slice(0,et-1).join(", "),", or ")+$[et-1]}else if(et===2){return"one of ".concat(ee," ").concat($[0]," or ").concat($[1])}else{return"of ".concat(ee," ").concat($[0])}}else{return"of ".concat(ee," ").concat(String($))}}function em($,ee,et){return $.substr(!et||et<0?0:+et,ee.length)===ee}function e_($,ee,et){if(et===undefined||et>$.length){et=$.length}return $.substring(et-ee.length,et)===ee}function ew($,ee,et){if(typeof et!=="number"){et=0}if(et+ee.length>$.length){return false}else{return $.indexOf(ee,et)!==-1}}ey("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError);ey("ERR_INVALID_ARG_TYPE",function($,ee,ei){if(ep===undefined)ep=et(9282);ep(typeof $==="string","'name' must be a string");var eo;if(typeof ee==="string"&&em(ee,"not ")){eo="must not be";ee=ee.replace(/^not /,"")}else{eo="must be"}var es;if(e_($," argument")){es="The ".concat($," ").concat(eo," ").concat(eg(ee,"type"))}else{var eu=ew($,".")?"property":"argument";es='The "'.concat($,'" ').concat(eu," ").concat(eo," ").concat(eg(ee,"type"))}es+=". Received type ".concat(en(ei));return es},TypeError);ey("ERR_INVALID_ARG_VALUE",function($,ee){var en=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"is invalid";if(eh===undefined)eh=et(9539);var ei=eh.inspect(ee);if(ei.length>128){ei="".concat(ei.slice(0,128),"...")}return"The argument '".concat($,"' ").concat(en,". Received ").concat(ei)},TypeError,RangeError);ey("ERR_INVALID_RETURN_VALUE",function($,ee,et){var ei;if(et&&et.constructor&&et.constructor.name){ei="instance of ".concat(et.constructor.name)}else{ei="type ".concat(en(et))}return"Expected ".concat($,' to be returned from the "').concat(ee,'"')+" function but got ".concat(ei,".")},TypeError);ey("ERR_MISSING_ARGS",function(){for(var $=arguments.length,ee=new Array($),en=0;en<$;en++){ee[en]=arguments[en]}if(ep===undefined)ep=et(9282);ep(ee.length>0,"At least one arg needs to be specified");var ei="The ";var eo=ee.length;ee=ee.map(function($){return'"'.concat($,'"')});switch(eo){case 1:ei+="".concat(ee[0]," argument");break;case 2:ei+="".concat(ee[0]," and ").concat(ee[1]," arguments");break;default:ei+=ee.slice(0,eo-1).join(", ");ei+=", and ".concat(ee[eo-1]," arguments");break}return"".concat(ei," must be specified")},TypeError);$.exports.codes=ed},9158:($,ee,et)=>{"use strict";function en($,ee){return es($)||eo($,ee)||ei()}function ei(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function eo($,ee){var et=[];var en=true;var ei=false;var eo=undefined;try{for(var es=$[Symbol.iterator](),eu;!(en=(eu=es.next()).done);en=true){et.push(eu.value);if(ee&&et.length===ee)break}}catch($){ei=true;eo=$}finally{try{if(!en&&es["return"]!=null)es["return"]()}finally{if(ei)throw eo}}return et}function es($){if(Array.isArray($))return $}function eu($){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){eu=function $($){return typeof $}}else{eu=function $($){return $&&typeof Symbol==="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $}}return eu($)}var el=/a/g.flags!==undefined;var ef=function $($){var ee=[];$.forEach(function($){return ee.push($)});return ee};var ed=function $($){var ee=[];$.forEach(function($,et){return ee.push([et,$])});return ee};var ep=Object.is?Object.is:et(609);var eh=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]};var ey=Number.isNaN?Number.isNaN:et(360);function eg($){return $.call.bind($)}var em=eg(Object.prototype.hasOwnProperty);var e_=eg(Object.prototype.propertyIsEnumerable);var ew=eg(Object.prototype.toString);var eE=et(9539).types,eS=eE.isAnyArrayBuffer,eT=eE.isArrayBufferView,eO=eE.isDate,eA=eE.isMap,eI=eE.isRegExp,eN=eE.isSet,eD=eE.isNativeError,eR=eE.isBoxedPrimitive,eC=eE.isNumberObject,ek=eE.isStringObject,eM=eE.isBooleanObject,eL=eE.isBigIntObject,eP=eE.isSymbolObject,eF=eE.isFloat32Array,eB=eE.isFloat64Array;function eU($){if($.length===0||$.length>10)return true;for(var ee=0;ee<$.length;ee++){var et=$.charCodeAt(ee);if(et<48||et>57)return true}return $.length===10&&$>=Math.pow(2,32)}function ej($){return Object.keys($).filter(eU).concat(eh($).filter(Object.prototype.propertyIsEnumerable.bind($)))}/*!
2
+ * The buffer module from node.js, for the browser.
3
+ *
4
+ * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
5
+ * @license MIT
6
+ */function eW($,ee){if($===ee){return 0}var et=$.length;var en=ee.length;for(var ei=0,eo=Math.min(et,en);ei<eo;++ei){if($[ei]!==ee[ei]){et=$[ei];en=ee[ei];break}}if(et<en){return-1}if(en<et){return 1}return 0}var eH=undefined;var ez=true;var eV=false;var e$=0;var eq=1;var eG=2;var eY=3;function eK($,ee){return el?$.source===ee.source&&$.flags===ee.flags:RegExp.prototype.toString.call($)===RegExp.prototype.toString.call(ee)}function eZ($,ee){if($.byteLength!==ee.byteLength){return false}for(var et=0;et<$.byteLength;et++){if($[et]!==ee[et]){return false}}return true}function eJ($,ee){if($.byteLength!==ee.byteLength){return false}return eW(new Uint8Array($.buffer,$.byteOffset,$.byteLength),new Uint8Array(ee.buffer,ee.byteOffset,ee.byteLength))===0}function eX($,ee){return $.byteLength===ee.byteLength&&eW(new Uint8Array($),new Uint8Array(ee))===0}function eQ($,ee){if(eC($)){return eC(ee)&&ep(Number.prototype.valueOf.call($),Number.prototype.valueOf.call(ee))}if(ek($)){return ek(ee)&&String.prototype.valueOf.call($)===String.prototype.valueOf.call(ee)}if(eM($)){return eM(ee)&&Boolean.prototype.valueOf.call($)===Boolean.prototype.valueOf.call(ee)}if(eL($)){return eL(ee)&&BigInt.prototype.valueOf.call($)===BigInt.prototype.valueOf.call(ee)}return eP(ee)&&Symbol.prototype.valueOf.call($)===Symbol.prototype.valueOf.call(ee)}function e0($,ee,et,en){if($===ee){if($!==0)return true;return et?ep($,ee):true}if(et){if(eu($)!=="object"){return typeof $==="number"&&ey($)&&ey(ee)}if(eu(ee)!=="object"||$===null||ee===null){return false}if(Object.getPrototypeOf($)!==Object.getPrototypeOf(ee)){return false}}else{if($===null||eu($)!=="object"){if(ee===null||eu(ee)!=="object"){return $==ee}return false}if(ee===null||eu(ee)!=="object"){return false}}var ei=ew($);var eo=ew(ee);if(ei!==eo){return false}if(Array.isArray($)){if($.length!==ee.length){return false}var es=ej($,eH);var el=ej(ee,eH);if(es.length!==el.length){return false}return e2($,ee,et,en,eq,es)}if(ei==="[object Object]"){if(!eA($)&&eA(ee)||!eN($)&&eN(ee)){return false}}if(eO($)){if(!eO(ee)||Date.prototype.getTime.call($)!==Date.prototype.getTime.call(ee)){return false}}else if(eI($)){if(!eI(ee)||!eK($,ee)){return false}}else if(eD($)||$ instanceof Error){if($.message!==ee.message||$.name!==ee.name){return false}}else if(eT($)){if(!et&&(eF($)||eB($))){if(!eZ($,ee)){return false}}else if(!eJ($,ee)){return false}var ef=ej($,eH);var ed=ej(ee,eH);if(ef.length!==ed.length){return false}return e2($,ee,et,en,e$,ef)}else if(eN($)){if(!eN(ee)||$.size!==ee.size){return false}return e2($,ee,et,en,eG)}else if(eA($)){if(!eA(ee)||$.size!==ee.size){return false}return e2($,ee,et,en,eY)}else if(eS($)){if(!eX($,ee)){return false}}else if(eR($)&&!eQ($,ee)){return false}return e2($,ee,et,en,e$)}function e1($,ee){return ee.filter(function(ee){return e_($,ee)})}function e2($,ee,et,en,ei,eo){if(arguments.length===5){eo=Object.keys($);var es=Object.keys(ee);if(eo.length!==es.length){return false}}var eu=0;for(;eu<eo.length;eu++){if(!em(ee,eo[eu])){return false}}if(et&&arguments.length===5){var el=eh($);if(el.length!==0){var ef=0;for(eu=0;eu<el.length;eu++){var ed=el[eu];if(e_($,ed)){if(!e_(ee,ed)){return false}eo.push(ed);ef++}else if(e_(ee,ed)){return false}}var ep=eh(ee);if(el.length!==ep.length&&e1(ee,ep).length!==ef){return false}}else{var ey=eh(ee);if(ey.length!==0&&e1(ee,ey).length!==0){return false}}}if(eo.length===0&&(ei===e$||ei===eq&&$.length===0||$.size===0)){return true}if(en===undefined){en={val1:new Map,val2:new Map,position:0}}else{var eg=en.val1.get($);if(eg!==undefined){var ew=en.val2.get(ee);if(ew!==undefined){return eg===ew}}en.position++}en.val1.set($,en.position);en.val2.set(ee,en.position);var eE=te($,ee,et,eo,en,ei);en.val1.delete($);en.val2.delete(ee);return eE}function e6($,ee,et,en){var ei=ef($);for(var eo=0;eo<ei.length;eo++){var es=ei[eo];if(e0(ee,es,et,en)){$.delete(es);return true}}return false}function e4($){switch(eu($)){case"undefined":return null;case"object":return undefined;case"symbol":return false;case"string":$=+$;case"number":if(ey($)){return false}}return true}function e3($,ee,et){var en=e4(et);if(en!=null)return en;return ee.has(en)&&!$.has(en)}function e8($,ee,et,en,ei){var eo=e4(et);if(eo!=null){return eo}var es=ee.get(eo);if(es===undefined&&!ee.has(eo)||!e0(en,es,false,ei)){return false}return!$.has(eo)&&e0(en,es,false,ei)}function e5($,ee,et,en){var ei=null;var eo=ef($);for(var es=0;es<eo.length;es++){var el=eo[es];if(eu(el)==="object"&&el!==null){if(ei===null){ei=new Set}ei.add(el)}else if(!ee.has(el)){if(et)return false;if(!e3($,ee,el)){return false}if(ei===null){ei=new Set}ei.add(el)}}if(ei!==null){var ed=ef(ee);for(var ep=0;ep<ed.length;ep++){var eh=ed[ep];if(eu(eh)==="object"&&eh!==null){if(!e6(ei,eh,et,en))return false}else if(!et&&!$.has(eh)&&!e6(ei,eh,et,en)){return false}}return ei.size===0}return true}function e9($,ee,et,en,ei,eo){var es=ef($);for(var eu=0;eu<es.length;eu++){var el=es[eu];if(e0(et,el,ei,eo)&&e0(en,ee.get(el),ei,eo)){$.delete(el);return true}}return false}function e7($,ee,et,ei){var eo=null;var es=ed($);for(var el=0;el<es.length;el++){var ef=en(es[el],2),ep=ef[0],eh=ef[1];if(eu(ep)==="object"&&ep!==null){if(eo===null){eo=new Set}eo.add(ep)}else{var ey=ee.get(ep);if(ey===undefined&&!ee.has(ep)||!e0(eh,ey,et,ei)){if(et)return false;if(!e8($,ee,ep,eh,ei))return false;if(eo===null){eo=new Set}eo.add(ep)}}}if(eo!==null){var eg=ed(ee);for(var em=0;em<eg.length;em++){var e_=en(eg[em],2),ep=e_[0],ew=e_[1];if(eu(ep)==="object"&&ep!==null){if(!e9(eo,$,ep,ew,et,ei))return false}else if(!et&&(!$.has(ep)||!e0($.get(ep),ew,false,ei))&&!e9(eo,$,ep,ew,false,ei)){return false}}return eo.size===0}return true}function te($,ee,et,en,ei,eo){var es=0;if(eo===eG){if(!e5($,ee,et,ei)){return false}}else if(eo===eY){if(!e7($,ee,et,ei)){return false}}else if(eo===eq){for(;es<$.length;es++){if(em($,es)){if(!em(ee,es)||!e0($[es],ee[es],et,ei)){return false}}else if(em(ee,es)){return false}else{var eu=Object.keys($);for(;es<eu.length;es++){var el=eu[es];if(!em(ee,el)||!e0($[el],ee[el],et,ei)){return false}}if(eu.length!==Object.keys(ee).length){return false}return true}}}for(es=0;es<en.length;es++){var ef=en[es];if(!e0($[ef],ee[ef],et,ei)){return false}}return true}function tt($,ee){return e0($,ee,eV)}function tr($,ee){return e0($,ee,ez)}$.exports={isDeepEqual:tt,isDeepStrictEqual:tr}},9742:($,ee)=>{"use strict";ee.byteLength=ef;ee.toByteArray=ep;ee.fromByteArray=eg;var et=[];var en=[];var ei=typeof Uint8Array!=="undefined"?Uint8Array:Array;var eo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var es=0,eu=eo.length;es<eu;++es){et[es]=eo[es];en[eo.charCodeAt(es)]=es}en["-".charCodeAt(0)]=62;en["_".charCodeAt(0)]=63;function el($){var ee=$.length;if(ee%4>0){throw new Error("Invalid string. Length must be a multiple of 4")}var et=$.indexOf("=");if(et===-1)et=ee;var en=et===ee?0:4-et%4;return[et,en]}function ef($){var ee=el($);var et=ee[0];var en=ee[1];return(et+en)*3/4-en}function ed($,ee,et){return(ee+et)*3/4-et}function ep($){var ee;var et=el($);var eo=et[0];var es=et[1];var eu=new ei(ed($,eo,es));var ef=0;var ep=es>0?eo-4:eo;var eh;for(eh=0;eh<ep;eh+=4){ee=en[$.charCodeAt(eh)]<<18|en[$.charCodeAt(eh+1)]<<12|en[$.charCodeAt(eh+2)]<<6|en[$.charCodeAt(eh+3)];eu[ef++]=ee>>16&255;eu[ef++]=ee>>8&255;eu[ef++]=ee&255}if(es===2){ee=en[$.charCodeAt(eh)]<<2|en[$.charCodeAt(eh+1)]>>4;eu[ef++]=ee&255}if(es===1){ee=en[$.charCodeAt(eh)]<<10|en[$.charCodeAt(eh+1)]<<4|en[$.charCodeAt(eh+2)]>>2;eu[ef++]=ee>>8&255;eu[ef++]=ee&255}return eu}function eh($){return et[$>>18&63]+et[$>>12&63]+et[$>>6&63]+et[$&63]}function ey($,ee,et){var en;var ei=[];for(var eo=ee;eo<et;eo+=3){en=($[eo]<<16&16711680)+($[eo+1]<<8&65280)+($[eo+2]&255);ei.push(eh(en))}return ei.join("")}function eg($){var ee;var en=$.length;var ei=en%3;var eo=[];var es=16383;for(var eu=0,el=en-ei;eu<el;eu+=es){eo.push(ey($,eu,eu+es>el?el:eu+es))}if(ei===1){ee=$[en-1];eo.push(et[ee>>2]+et[ee<<4&63]+"==")}else if(ei===2){ee=($[en-2]<<8)+$[en-1];eo.push(et[ee>>10]+et[ee>>4&63]+et[ee<<2&63]+"=")}return eo.join("")}},4505:($,ee,et)=>{"use strict";var en=et(8764)["Buffer"];var ei=et(4155);var eo=et(9282);var es=et(2292);var eu=et(405);var el=et(7948);var ef=et(1619);for(var ed in ef){ee[ed]=ef[ed]}ee.NONE=0;ee.DEFLATE=1;ee.INFLATE=2;ee.GZIP=3;ee.GUNZIP=4;ee.DEFLATERAW=5;ee.INFLATERAW=6;ee.UNZIP=7;var ep=31;var eh=139;function ey($){if(typeof $!=="number"||$<ee.DEFLATE||$>ee.UNZIP){throw new TypeError("Bad argument")}this.dictionary=null;this.err=0;this.flush=0;this.init_done=false;this.level=0;this.memLevel=0;this.mode=$;this.strategy=0;this.windowBits=0;this.write_in_progress=false;this.pending_close=false;this.gzip_id_bytes_read=0}ey.prototype.close=function(){if(this.write_in_progress){this.pending_close=true;return}this.pending_close=false;eo(this.init_done,"close before init");eo(this.mode<=ee.UNZIP);if(this.mode===ee.DEFLATE||this.mode===ee.GZIP||this.mode===ee.DEFLATERAW){eu.deflateEnd(this.strm)}else if(this.mode===ee.INFLATE||this.mode===ee.GUNZIP||this.mode===ee.INFLATERAW||this.mode===ee.UNZIP){el.inflateEnd(this.strm)}this.mode=ee.NONE;this.dictionary=null};ey.prototype.write=function($,ee,et,en,ei,eo,es){return this._write(true,$,ee,et,en,ei,eo,es)};ey.prototype.writeSync=function($,ee,et,en,ei,eo,es){return this._write(false,$,ee,et,en,ei,eo,es)};ey.prototype._write=function($,et,es,eu,el,ef,ed,ep){eo.equal(arguments.length,8);eo(this.init_done,"write before init");eo(this.mode!==ee.NONE,"already finalized");eo.equal(false,this.write_in_progress,"write already in progress");eo.equal(false,this.pending_close,"close is pending");this.write_in_progress=true;eo.equal(false,et===undefined,"must provide flush value");this.write_in_progress=true;if(et!==ee.Z_NO_FLUSH&&et!==ee.Z_PARTIAL_FLUSH&&et!==ee.Z_SYNC_FLUSH&&et!==ee.Z_FULL_FLUSH&&et!==ee.Z_FINISH&&et!==ee.Z_BLOCK){throw new Error("Invalid flush value")}if(es==null){es=en.alloc(0);el=0;eu=0}this.strm.avail_in=el;this.strm.input=es;this.strm.next_in=eu;this.strm.avail_out=ep;this.strm.output=ef;this.strm.next_out=ed;this.flush=et;if(!$){this._process();if(this._checkError()){return this._afterSync()}return}var eh=this;ei.nextTick(function(){eh._process();eh._after()});return this};ey.prototype._afterSync=function(){var $=this.strm.avail_out;var ee=this.strm.avail_in;this.write_in_progress=false;return[ee,$]};ey.prototype._process=function(){var $=null;switch(this.mode){case ee.DEFLATE:case ee.GZIP:case ee.DEFLATERAW:this.err=eu.deflate(this.strm,this.flush);break;case ee.UNZIP:if(this.strm.avail_in>0){$=this.strm.next_in}switch(this.gzip_id_bytes_read){case 0:if($===null){break}if(this.strm.input[$]===ep){this.gzip_id_bytes_read=1;$++;if(this.strm.avail_in===1){break}}else{this.mode=ee.INFLATE;break}case 1:if($===null){break}if(this.strm.input[$]===eh){this.gzip_id_bytes_read=2;this.mode=ee.GUNZIP}else{this.mode=ee.INFLATE}break;default:throw new Error("invalid number of gzip magic number bytes read")}case ee.INFLATE:case ee.GUNZIP:case ee.INFLATERAW:this.err=el.inflate(this.strm,this.flush);if(this.err===ee.Z_NEED_DICT&&this.dictionary){this.err=el.inflateSetDictionary(this.strm,this.dictionary);if(this.err===ee.Z_OK){this.err=el.inflate(this.strm,this.flush)}else if(this.err===ee.Z_DATA_ERROR){this.err=ee.Z_NEED_DICT}}while(this.strm.avail_in>0&&this.mode===ee.GUNZIP&&this.err===ee.Z_STREAM_END&&this.strm.next_in[0]!==0){this.reset();this.err=el.inflate(this.strm,this.flush)}break;default:throw new Error("Unknown mode "+this.mode)}};ey.prototype._checkError=function(){switch(this.err){case ee.Z_OK:case ee.Z_BUF_ERROR:if(this.strm.avail_out!==0&&this.flush===ee.Z_FINISH){this._error("unexpected end of file");return false}break;case ee.Z_STREAM_END:break;case ee.Z_NEED_DICT:if(this.dictionary==null){this._error("Missing dictionary")}else{this._error("Bad dictionary")}return false;default:this._error("Zlib error");return false}return true};ey.prototype._after=function(){if(!this._checkError()){return}var $=this.strm.avail_out;var ee=this.strm.avail_in;this.write_in_progress=false;this.callback(ee,$);if(this.pending_close){this.close()}};ey.prototype._error=function($){if(this.strm.msg){$=this.strm.msg}this.onerror($,this.err);this.write_in_progress=false;if(this.pending_close){this.close()}};ey.prototype.init=function($,et,en,ei,es){eo(arguments.length===4||arguments.length===5,"init(windowBits, level, memLevel, strategy, [dictionary])");eo($>=8&&$<=15,"invalid windowBits");eo(et>=-1&&et<=9,"invalid compression level");eo(en>=1&&en<=9,"invalid memlevel");eo(ei===ee.Z_FILTERED||ei===ee.Z_HUFFMAN_ONLY||ei===ee.Z_RLE||ei===ee.Z_FIXED||ei===ee.Z_DEFAULT_STRATEGY,"invalid strategy");this._init(et,$,en,ei,es);this._setDictionary()};ey.prototype.params=function(){throw new Error("deflateParams Not supported")};ey.prototype.reset=function(){this._reset();this._setDictionary()};ey.prototype._init=function($,et,en,ei,eo){this.level=$;this.windowBits=et;this.memLevel=en;this.strategy=ei;this.flush=ee.Z_NO_FLUSH;this.err=ee.Z_OK;if(this.mode===ee.GZIP||this.mode===ee.GUNZIP){this.windowBits+=16}if(this.mode===ee.UNZIP){this.windowBits+=32}if(this.mode===ee.DEFLATERAW||this.mode===ee.INFLATERAW){this.windowBits=-1*this.windowBits}this.strm=new es;switch(this.mode){case ee.DEFLATE:case ee.GZIP:case ee.DEFLATERAW:this.err=eu.deflateInit2(this.strm,this.level,ee.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case ee.INFLATE:case ee.GUNZIP:case ee.INFLATERAW:case ee.UNZIP:this.err=el.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}if(this.err!==ee.Z_OK){this._error("Init error")}this.dictionary=eo;this.write_in_progress=false;this.init_done=true};ey.prototype._setDictionary=function(){if(this.dictionary==null){return}this.err=ee.Z_OK;switch(this.mode){case ee.DEFLATE:case ee.DEFLATERAW:this.err=eu.deflateSetDictionary(this.strm,this.dictionary);break;default:break}if(this.err!==ee.Z_OK){this._error("Failed to set dictionary")}};ey.prototype._reset=function(){this.err=ee.Z_OK;switch(this.mode){case ee.DEFLATE:case ee.DEFLATERAW:case ee.GZIP:this.err=eu.deflateReset(this.strm);break;case ee.INFLATE:case ee.INFLATERAW:case ee.GUNZIP:this.err=el.inflateReset(this.strm);break;default:break}if(this.err!==ee.Z_OK){this._error("Failed to reset stream")}};ee.Zlib=ey},2635:($,ee,et)=>{"use strict";var en=et(4155);var ei=et(8764).Buffer;var eo=et(2830).Transform;var es=et(4505);var eu=et(9539);var el=et(9282).ok;var ef=et(8764).kMaxLength;var ed="Cannot create final Buffer. It would be larger "+"than 0x"+ef.toString(16)+" bytes";es.Z_MIN_WINDOWBITS=8;es.Z_MAX_WINDOWBITS=15;es.Z_DEFAULT_WINDOWBITS=15;es.Z_MIN_CHUNK=64;es.Z_MAX_CHUNK=Infinity;es.Z_DEFAULT_CHUNK=16*1024;es.Z_MIN_MEMLEVEL=1;es.Z_MAX_MEMLEVEL=9;es.Z_DEFAULT_MEMLEVEL=8;es.Z_MIN_LEVEL=-1;es.Z_MAX_LEVEL=9;es.Z_DEFAULT_LEVEL=es.Z_DEFAULT_COMPRESSION;var ep=Object.keys(es);for(var eh=0;eh<ep.length;eh++){var ey=ep[eh];if(ey.match(/^Z/)){Object.defineProperty(ee,ey,{enumerable:true,value:es[ey],writable:false})}}var eg={Z_OK:es.Z_OK,Z_STREAM_END:es.Z_STREAM_END,Z_NEED_DICT:es.Z_NEED_DICT,Z_ERRNO:es.Z_ERRNO,Z_STREAM_ERROR:es.Z_STREAM_ERROR,Z_DATA_ERROR:es.Z_DATA_ERROR,Z_MEM_ERROR:es.Z_MEM_ERROR,Z_BUF_ERROR:es.Z_BUF_ERROR,Z_VERSION_ERROR:es.Z_VERSION_ERROR};var em=Object.keys(eg);for(var e_=0;e_<em.length;e_++){var ew=em[e_];eg[eg[ew]]=ew}Object.defineProperty(ee,"codes",{enumerable:true,value:Object.freeze(eg),writable:false});ee.Deflate=eT;ee.Inflate=eO;ee.Gzip=eA;ee.Gunzip=eI;ee.DeflateRaw=eN;ee.InflateRaw=eD;ee.Unzip=eR;ee.createDeflate=function($){return new eT($)};ee.createInflate=function($){return new eO($)};ee.createDeflateRaw=function($){return new eN($)};ee.createInflateRaw=function($){return new eD($)};ee.createGzip=function($){return new eA($)};ee.createGunzip=function($){return new eI($)};ee.createUnzip=function($){return new eR($)};ee.deflate=function($,ee,et){if(typeof ee==="function"){et=ee;ee={}}return eE(new eT(ee),$,et)};ee.deflateSync=function($,ee){return eS(new eT(ee),$)};ee.gzip=function($,ee,et){if(typeof ee==="function"){et=ee;ee={}}return eE(new eA(ee),$,et)};ee.gzipSync=function($,ee){return eS(new eA(ee),$)};ee.deflateRaw=function($,ee,et){if(typeof ee==="function"){et=ee;ee={}}return eE(new eN(ee),$,et)};ee.deflateRawSync=function($,ee){return eS(new eN(ee),$)};ee.unzip=function($,ee,et){if(typeof ee==="function"){et=ee;ee={}}return eE(new eR(ee),$,et)};ee.unzipSync=function($,ee){return eS(new eR(ee),$)};ee.inflate=function($,ee,et){if(typeof ee==="function"){et=ee;ee={}}return eE(new eO(ee),$,et)};ee.inflateSync=function($,ee){return eS(new eO(ee),$)};ee.gunzip=function($,ee,et){if(typeof ee==="function"){et=ee;ee={}}return eE(new eI(ee),$,et)};ee.gunzipSync=function($,ee){return eS(new eI(ee),$)};ee.inflateRaw=function($,ee,et){if(typeof ee==="function"){et=ee;ee={}}return eE(new eD(ee),$,et)};ee.inflateRawSync=function($,ee){return eS(new eD(ee),$)};function eE($,ee,et){var en=[];var eo=0;$.on("error",eu);$.on("end",el);$.end(ee);es();function es(){var ee;while(null!==(ee=$.read())){en.push(ee);eo+=ee.length}$.once("readable",es)}function eu(ee){$.removeListener("end",el);$.removeListener("readable",es);et(ee)}function el(){var ee;var es=null;if(eo>=ef){es=new RangeError(ed)}else{ee=ei.concat(en,eo)}en=[];$.close();et(es,ee)}}function eS($,ee){if(typeof ee==="string")ee=ei.from(ee);if(!ei.isBuffer(ee))throw new TypeError("Not a string or buffer");var et=$._finishFlushFlag;return $._processChunk(ee,et)}function eT($){if(!(this instanceof eT))return new eT($);ek.call(this,$,es.DEFLATE)}function eO($){if(!(this instanceof eO))return new eO($);ek.call(this,$,es.INFLATE)}function eA($){if(!(this instanceof eA))return new eA($);ek.call(this,$,es.GZIP)}function eI($){if(!(this instanceof eI))return new eI($);ek.call(this,$,es.GUNZIP)}function eN($){if(!(this instanceof eN))return new eN($);ek.call(this,$,es.DEFLATERAW)}function eD($){if(!(this instanceof eD))return new eD($);ek.call(this,$,es.INFLATERAW)}function eR($){if(!(this instanceof eR))return new eR($);ek.call(this,$,es.UNZIP)}function eC($){return $===es.Z_NO_FLUSH||$===es.Z_PARTIAL_FLUSH||$===es.Z_SYNC_FLUSH||$===es.Z_FULL_FLUSH||$===es.Z_FINISH||$===es.Z_BLOCK}function ek($,et){var en=this;this._opts=$=$||{};this._chunkSize=$.chunkSize||ee.Z_DEFAULT_CHUNK;eo.call(this,$);if($.flush&&!eC($.flush)){throw new Error("Invalid flush flag: "+$.flush)}if($.finishFlush&&!eC($.finishFlush)){throw new Error("Invalid flush flag: "+$.finishFlush)}this._flushFlag=$.flush||es.Z_NO_FLUSH;this._finishFlushFlag=typeof $.finishFlush!=="undefined"?$.finishFlush:es.Z_FINISH;if($.chunkSize){if($.chunkSize<ee.Z_MIN_CHUNK||$.chunkSize>ee.Z_MAX_CHUNK){throw new Error("Invalid chunk size: "+$.chunkSize)}}if($.windowBits){if($.windowBits<ee.Z_MIN_WINDOWBITS||$.windowBits>ee.Z_MAX_WINDOWBITS){throw new Error("Invalid windowBits: "+$.windowBits)}}if($.level){if($.level<ee.Z_MIN_LEVEL||$.level>ee.Z_MAX_LEVEL){throw new Error("Invalid compression level: "+$.level)}}if($.memLevel){if($.memLevel<ee.Z_MIN_MEMLEVEL||$.memLevel>ee.Z_MAX_MEMLEVEL){throw new Error("Invalid memLevel: "+$.memLevel)}}if($.strategy){if($.strategy!=ee.Z_FILTERED&&$.strategy!=ee.Z_HUFFMAN_ONLY&&$.strategy!=ee.Z_RLE&&$.strategy!=ee.Z_FIXED&&$.strategy!=ee.Z_DEFAULT_STRATEGY){throw new Error("Invalid strategy: "+$.strategy)}}if($.dictionary){if(!ei.isBuffer($.dictionary)){throw new Error("Invalid dictionary: it should be a Buffer instance")}}this._handle=new es.Zlib(et);var eu=this;this._hadError=false;this._handle.onerror=function($,et){eM(eu);eu._hadError=true;var en=new Error($);en.errno=et;en.code=ee.codes[et];eu.emit("error",en)};var el=ee.Z_DEFAULT_COMPRESSION;if(typeof $.level==="number")el=$.level;var ef=ee.Z_DEFAULT_STRATEGY;if(typeof $.strategy==="number")ef=$.strategy;this._handle.init($.windowBits||ee.Z_DEFAULT_WINDOWBITS,el,$.memLevel||ee.Z_DEFAULT_MEMLEVEL,ef,$.dictionary);this._buffer=ei.allocUnsafe(this._chunkSize);this._offset=0;this._level=el;this._strategy=ef;this.once("end",this.close);Object.defineProperty(this,"_closed",{get:function(){return!en._handle},configurable:true,enumerable:true})}eu.inherits(ek,eo);ek.prototype.params=function($,et,ei){if($<ee.Z_MIN_LEVEL||$>ee.Z_MAX_LEVEL){throw new RangeError("Invalid compression level: "+$)}if(et!=ee.Z_FILTERED&&et!=ee.Z_HUFFMAN_ONLY&&et!=ee.Z_RLE&&et!=ee.Z_FIXED&&et!=ee.Z_DEFAULT_STRATEGY){throw new TypeError("Invalid strategy: "+et)}if(this._level!==$||this._strategy!==et){var eo=this;this.flush(es.Z_SYNC_FLUSH,function(){el(eo._handle,"zlib binding closed");eo._handle.params($,et);if(!eo._hadError){eo._level=$;eo._strategy=et;if(ei)ei()}})}else{en.nextTick(ei)}};ek.prototype.reset=function(){el(this._handle,"zlib binding closed");return this._handle.reset()};ek.prototype._flush=function($){this._transform(ei.alloc(0),"",$)};ek.prototype.flush=function($,ee){var et=this;var eo=this._writableState;if(typeof $==="function"||$===undefined&&!ee){ee=$;$=es.Z_FULL_FLUSH}if(eo.ended){if(ee)en.nextTick(ee)}else if(eo.ending){if(ee)this.once("end",ee)}else if(eo.needDrain){if(ee){this.once("drain",function(){return et.flush($,ee)})}}else{this._flushFlag=$;this.write(ei.alloc(0),"",ee)}};ek.prototype.close=function($){eM(this,$);en.nextTick(eL,this)};function eM($,ee){if(ee)en.nextTick(ee);if(!$._handle)return;$._handle.close();$._handle=null}function eL($){$.emit("close")}ek.prototype._transform=function($,ee,et){var en;var eo=this._writableState;var eu=eo.ending||eo.ended;var el=eu&&(!$||eo.length===$.length);if($!==null&&!ei.isBuffer($))return et(new Error("invalid input"));if(!this._handle)return et(new Error("zlib binding closed"));if(el)en=this._finishFlushFlag;else{en=this._flushFlag;if($.length>=eo.length){this._flushFlag=this._opts.flush||es.Z_NO_FLUSH}}this._processChunk($,en,et)};ek.prototype._processChunk=function($,ee,et){var en=$&&$.length;var eo=this._chunkSize-this._offset;var es=0;var eu=this;var ep=typeof et==="function";if(!ep){var eh=[];var ey=0;var eg;this.on("error",function($){eg=$});el(this._handle,"zlib binding closed");do{var em=this._handle.writeSync(ee,$,es,en,this._buffer,this._offset,eo)}while(!this._hadError&&eE(em[0],em[1]))if(this._hadError){throw eg}if(ey>=ef){eM(this);throw new RangeError(ed)}var e_=ei.concat(eh,ey);eM(this);return e_}el(this._handle,"zlib binding closed");var ew=this._handle.write(ee,$,es,en,this._buffer,this._offset,eo);ew.buffer=$;ew.callback=eE;function eE(ef,ed){if(this){this.buffer=null;this.callback=null}if(eu._hadError)return;var eg=eo-ed;el(eg>=0,"have should not go down");if(eg>0){var em=eu._buffer.slice(eu._offset,eu._offset+eg);eu._offset+=eg;if(ep){eu.push(em)}else{eh.push(em);ey+=em.length}}if(ed===0||eu._offset>=eu._chunkSize){eo=eu._chunkSize;eu._offset=0;eu._buffer=ei.allocUnsafe(eu._chunkSize)}if(ed===0){es+=en-ef;en=ef;if(!ep)return true;var e_=eu._handle.write(ee,$,es,en,eu._buffer,eu._offset,eu._chunkSize);e_.callback=eE;e_.buffer=$;return}if(!ep)return false;et()}};eu.inherits(eT,ek);eu.inherits(eO,ek);eu.inherits(eA,ek);eu.inherits(eI,ek);eu.inherits(eN,ek);eu.inherits(eD,ek);eu.inherits(eR,ek)},8764:($,ee,et)=>{"use strict";/*!
7
+ * The buffer module from node.js, for the browser.
8
+ *
9
+ * @author Feross Aboukhadijeh <https://feross.org>
10
+ * @license MIT
11
+ */const en=et(9742);const ei=et(645);const eo=typeof Symbol==="function"&&typeof Symbol["for"]==="function"?Symbol["for"]("nodejs.util.inspect.custom"):null;ee.Buffer=ef;ee.SlowBuffer=eT;ee.INSPECT_MAX_BYTES=50;const es=2147483647;ee.kMaxLength=es;ef.TYPED_ARRAY_SUPPORT=eu();if(!ef.TYPED_ARRAY_SUPPORT&&typeof console!=="undefined"&&typeof console.error==="function"){console.error("This browser lacks typed array (Uint8Array) support which is required by "+"`buffer` v5.x. Use `buffer` v4.x if you require old browser support.")}function eu(){try{const $=new Uint8Array(1);const ee={foo:function(){return 42}};Object.setPrototypeOf(ee,Uint8Array.prototype);Object.setPrototypeOf($,ee);return $.foo()===42}catch($){return false}}Object.defineProperty(ef.prototype,"parent",{enumerable:true,get:function(){if(!ef.isBuffer(this))return undefined;return this.buffer}});Object.defineProperty(ef.prototype,"offset",{enumerable:true,get:function(){if(!ef.isBuffer(this))return undefined;return this.byteOffset}});function el($){if($>es){throw new RangeError('The value "'+$+'" is invalid for option "size"')}const ee=new Uint8Array($);Object.setPrototypeOf(ee,ef.prototype);return ee}function ef($,ee,et){if(typeof $==="number"){if(typeof ee==="string"){throw new TypeError('The "string" argument must be of type string. Received type number')}return ey($)}return ed($,ee,et)}ef.poolSize=8192;function ed($,ee,et){if(typeof $==="string"){return eg($,ee)}if(ArrayBuffer.isView($)){return e_($)}if($==null){throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, "+"or Array-like Object. Received type "+typeof $)}if(tt($,ArrayBuffer)||$&&tt($.buffer,ArrayBuffer)){return ew($,ee,et)}if(typeof SharedArrayBuffer!=="undefined"&&(tt($,SharedArrayBuffer)||$&&tt($.buffer,SharedArrayBuffer))){return ew($,ee,et)}if(typeof $==="number"){throw new TypeError('The "value" argument must not be of type number. Received type number')}const en=$.valueOf&&$.valueOf();if(en!=null&&en!==$){return ef.from(en,ee,et)}const ei=eE($);if(ei)return ei;if(typeof Symbol!=="undefined"&&Symbol.toPrimitive!=null&&typeof $[Symbol.toPrimitive]==="function"){return ef.from($[Symbol.toPrimitive]("string"),ee,et)}throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, "+"or Array-like Object. Received type "+typeof $)}ef.from=function($,ee,et){return ed($,ee,et)};Object.setPrototypeOf(ef.prototype,Uint8Array.prototype);Object.setPrototypeOf(ef,Uint8Array);function ep($){if(typeof $!=="number"){throw new TypeError('"size" argument must be of type number')}else if($<0){throw new RangeError('The value "'+$+'" is invalid for option "size"')}}function eh($,ee,et){ep($);if($<=0){return el($)}if(ee!==undefined){return typeof et==="string"?el($).fill(ee,et):el($).fill(ee)}return el($)}ef.alloc=function($,ee,et){return eh($,ee,et)};function ey($){ep($);return el($<0?0:eS($)|0)}ef.allocUnsafe=function($){return ey($)};ef.allocUnsafeSlow=function($){return ey($)};function eg($,ee){if(typeof ee!=="string"||ee===""){ee="utf8"}if(!ef.isEncoding(ee)){throw new TypeError("Unknown encoding: "+ee)}const et=eO($,ee)|0;let en=el(et);const ei=en.write($,ee);if(ei!==et){en=en.slice(0,ei)}return en}function em($){const ee=$.length<0?0:eS($.length)|0;const et=el(ee);for(let en=0;en<ee;en+=1){et[en]=$[en]&255}return et}function e_($){if(tt($,Uint8Array)){const ee=new Uint8Array($);return ew(ee.buffer,ee.byteOffset,ee.byteLength)}return em($)}function ew($,ee,et){if(ee<0||$.byteLength<ee){throw new RangeError('"offset" is outside of buffer bounds')}if($.byteLength<ee+(et||0)){throw new RangeError('"length" is outside of buffer bounds')}let en;if(ee===undefined&&et===undefined){en=new Uint8Array($)}else if(et===undefined){en=new Uint8Array($,ee)}else{en=new Uint8Array($,ee,et)}Object.setPrototypeOf(en,ef.prototype);return en}function eE($){if(ef.isBuffer($)){const ee=eS($.length)|0;const et=el(ee);if(et.length===0){return et}$.copy(et,0,0,ee);return et}if($.length!==undefined){if(typeof $.length!=="number"||tr($.length)){return el(0)}return em($)}if($.type==="Buffer"&&Array.isArray($.data)){return em($.data)}}function eS($){if($>=es){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+es.toString(16)+" bytes")}return $|0}function eT($){if(+$!=$){$=0}return ef.alloc(+$)}ef.isBuffer=function $($){return $!=null&&$._isBuffer===true&&$!==ef.prototype};ef.compare=function $($,ee){if(tt($,Uint8Array))$=ef.from($,$.offset,$.byteLength);if(tt(ee,Uint8Array))ee=ef.from(ee,ee.offset,ee.byteLength);if(!ef.isBuffer($)||!ef.isBuffer(ee)){throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array')}if($===ee)return 0;let et=$.length;let en=ee.length;for(let ei=0,eo=Math.min(et,en);ei<eo;++ei){if($[ei]!==ee[ei]){et=$[ei];en=ee[ei];break}}if(et<en)return-1;if(en<et)return 1;return 0};ef.isEncoding=function $($){switch(String($).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return true;default:return false}};ef.concat=function $($,ee){if(!Array.isArray($)){throw new TypeError('"list" argument must be an Array of Buffers')}if($.length===0){return ef.alloc(0)}let et;if(ee===undefined){ee=0;for(et=0;et<$.length;++et){ee+=$[et].length}}const en=ef.allocUnsafe(ee);let ei=0;for(et=0;et<$.length;++et){let ee=$[et];if(tt(ee,Uint8Array)){if(ei+ee.length>en.length){if(!ef.isBuffer(ee))ee=ef.from(ee);ee.copy(en,ei)}else{Uint8Array.prototype.set.call(en,ee,ei)}}else if(!ef.isBuffer(ee)){throw new TypeError('"list" argument must be an Array of Buffers')}else{ee.copy(en,ei)}ei+=ee.length}return en};function eO($,ee){if(ef.isBuffer($)){return $.length}if(ArrayBuffer.isView($)||tt($,ArrayBuffer)){return $.byteLength}if(typeof $!=="string"){throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. '+"Received type "+typeof $)}const et=$.length;const en=arguments.length>2&&arguments[2]===true;if(!en&&et===0)return 0;let ei=false;for(;;){switch(ee){case"ascii":case"latin1":case"binary":return et;case"utf8":case"utf-8":return e8($).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return et*2;case"hex":return et>>>1;case"base64":return e7($).length;default:if(ei){return en?-1:e8($).length}ee=(""+ee).toLowerCase();ei=true}}}ef.byteLength=eO;function eA($,ee,et){let en=false;if(ee===undefined||ee<0){ee=0}if(ee>this.length){return""}if(et===undefined||et>this.length){et=this.length}if(et<=0){return""}et>>>=0;ee>>>=0;if(et<=ee){return""}if(!$)$="utf8";while(true){switch($){case"hex":return eH(this,ee,et);case"utf8":case"utf-8":return eF(this,ee,et);case"ascii":return ej(this,ee,et);case"latin1":case"binary":return eW(this,ee,et);case"base64":return eP(this,ee,et);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ez(this,ee,et);default:if(en)throw new TypeError("Unknown encoding: "+$);$=($+"").toLowerCase();en=true}}}ef.prototype._isBuffer=true;function eI($,ee,et){const en=$[ee];$[ee]=$[et];$[et]=en}ef.prototype.swap16=function $(){const $=this.length;if($%2!==0){throw new RangeError("Buffer size must be a multiple of 16-bits")}for(let ee=0;ee<$;ee+=2){eI(this,ee,ee+1)}return this};ef.prototype.swap32=function $(){const $=this.length;if($%4!==0){throw new RangeError("Buffer size must be a multiple of 32-bits")}for(let ee=0;ee<$;ee+=4){eI(this,ee,ee+3);eI(this,ee+1,ee+2)}return this};ef.prototype.swap64=function $(){const $=this.length;if($%8!==0){throw new RangeError("Buffer size must be a multiple of 64-bits")}for(let ee=0;ee<$;ee+=8){eI(this,ee,ee+7);eI(this,ee+1,ee+6);eI(this,ee+2,ee+5);eI(this,ee+3,ee+4)}return this};ef.prototype.toString=function $(){const $=this.length;if($===0)return"";if(arguments.length===0)return eF(this,0,$);return eA.apply(this,arguments)};ef.prototype.toLocaleString=ef.prototype.toString;ef.prototype.equals=function $($){if(!ef.isBuffer($))throw new TypeError("Argument must be a Buffer");if(this===$)return true;return ef.compare(this,$)===0};ef.prototype.inspect=function $(){let $="";const et=ee.INSPECT_MAX_BYTES;$=this.toString("hex",0,et).replace(/(.{2})/g,"$1 ").trim();if(this.length>et)$+=" ... ";return"<Buffer "+$+">"};if(eo){ef.prototype[eo]=ef.prototype.inspect}ef.prototype.compare=function $($,ee,et,en,ei){if(tt($,Uint8Array)){$=ef.from($,$.offset,$.byteLength)}if(!ef.isBuffer($)){throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. '+"Received type "+typeof $)}if(ee===undefined){ee=0}if(et===undefined){et=$?$.length:0}if(en===undefined){en=0}if(ei===undefined){ei=this.length}if(ee<0||et>$.length||en<0||ei>this.length){throw new RangeError("out of range index")}if(en>=ei&&ee>=et){return 0}if(en>=ei){return-1}if(ee>=et){return 1}ee>>>=0;et>>>=0;en>>>=0;ei>>>=0;if(this===$)return 0;let eo=ei-en;let es=et-ee;const eu=Math.min(eo,es);const el=this.slice(en,ei);const ed=$.slice(ee,et);for(let $=0;$<eu;++$){if(el[$]!==ed[$]){eo=el[$];es=ed[$];break}}if(eo<es)return-1;if(es<eo)return 1;return 0};function eN($,ee,et,en,ei){if($.length===0)return-1;if(typeof et==="string"){en=et;et=0}else if(et>2147483647){et=2147483647}else if(et<-2147483648){et=-2147483648}et=+et;if(tr(et)){et=ei?0:$.length-1}if(et<0)et=$.length+et;if(et>=$.length){if(ei)return-1;else et=$.length-1}else if(et<0){if(ei)et=0;else return-1}if(typeof ee==="string"){ee=ef.from(ee,en)}if(ef.isBuffer(ee)){if(ee.length===0){return-1}return eD($,ee,et,en,ei)}else if(typeof ee==="number"){ee=ee&255;if(typeof Uint8Array.prototype.indexOf==="function"){if(ei){return Uint8Array.prototype.indexOf.call($,ee,et)}else{return Uint8Array.prototype.lastIndexOf.call($,ee,et)}}return eD($,[ee],et,en,ei)}throw new TypeError("val must be string, number or Buffer")}function eD($,ee,et,en,ei){let eo=1;let es=$.length;let eu=ee.length;if(en!==undefined){en=String(en).toLowerCase();if(en==="ucs2"||en==="ucs-2"||en==="utf16le"||en==="utf-16le"){if($.length<2||ee.length<2){return-1}eo=2;es/=2;eu/=2;et/=2}}function el($,ee){if(eo===1){return $[ee]}else{return $.readUInt16BE(ee*eo)}}let ef;if(ei){let en=-1;for(ef=et;ef<es;ef++){if(el($,ef)===el(ee,en===-1?0:ef-en)){if(en===-1)en=ef;if(ef-en+1===eu)return en*eo}else{if(en!==-1)ef-=ef-en;en=-1}}}else{if(et+eu>es)et=es-eu;for(ef=et;ef>=0;ef--){let et=true;for(let en=0;en<eu;en++){if(el($,ef+en)!==el(ee,en)){et=false;break}}if(et)return ef}}return-1}ef.prototype.includes=function $($,ee,et){return this.indexOf($,ee,et)!==-1};ef.prototype.indexOf=function $($,ee,et){return eN(this,$,ee,et,true)};ef.prototype.lastIndexOf=function $($,ee,et){return eN(this,$,ee,et,false)};function eR($,ee,et,en){et=Number(et)||0;const ei=$.length-et;if(!en){en=ei}else{en=Number(en);if(en>ei){en=ei}}const eo=ee.length;if(en>eo/2){en=eo/2}let es;for(es=0;es<en;++es){const en=parseInt(ee.substr(es*2,2),16);if(tr(en))return es;$[et+es]=en}return es}function eC($,ee,et,en){return te(e8(ee,$.length-et),$,et,en)}function ek($,ee,et,en){return te(e5(ee),$,et,en)}function eM($,ee,et,en){return te(e7(ee),$,et,en)}function eL($,ee,et,en){return te(e9(ee,$.length-et),$,et,en)}ef.prototype.write=function $($,ee,et,en){if(ee===undefined){en="utf8";et=this.length;ee=0}else if(et===undefined&&typeof ee==="string"){en=ee;et=this.length;ee=0}else if(isFinite(ee)){ee=ee>>>0;if(isFinite(et)){et=et>>>0;if(en===undefined)en="utf8"}else{en=et;et=undefined}}else{throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported")}const ei=this.length-ee;if(et===undefined||et>ei)et=ei;if($.length>0&&(et<0||ee<0)||ee>this.length){throw new RangeError("Attempt to write outside buffer bounds")}if(!en)en="utf8";let eo=false;for(;;){switch(en){case"hex":return eR(this,$,ee,et);case"utf8":case"utf-8":return eC(this,$,ee,et);case"ascii":case"latin1":case"binary":return ek(this,$,ee,et);case"base64":return eM(this,$,ee,et);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return eL(this,$,ee,et);default:if(eo)throw new TypeError("Unknown encoding: "+en);en=(""+en).toLowerCase();eo=true}}};ef.prototype.toJSON=function $(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function eP($,ee,et){if(ee===0&&et===$.length){return en.fromByteArray($)}else{return en.fromByteArray($.slice(ee,et))}}function eF($,ee,et){et=Math.min($.length,et);const en=[];let ei=ee;while(ei<et){const ee=$[ei];let eo=null;let es=ee>239?4:ee>223?3:ee>191?2:1;if(ei+es<=et){let et,en,eu,el;switch(es){case 1:if(ee<128){eo=ee}break;case 2:et=$[ei+1];if((et&192)===128){el=(ee&31)<<6|et&63;if(el>127){eo=el}}break;case 3:et=$[ei+1];en=$[ei+2];if((et&192)===128&&(en&192)===128){el=(ee&15)<<12|(et&63)<<6|en&63;if(el>2047&&(el<55296||el>57343)){eo=el}}break;case 4:et=$[ei+1];en=$[ei+2];eu=$[ei+3];if((et&192)===128&&(en&192)===128&&(eu&192)===128){el=(ee&15)<<18|(et&63)<<12|(en&63)<<6|eu&63;if(el>65535&&el<1114112){eo=el}}}}if(eo===null){eo=65533;es=1}else if(eo>65535){eo-=65536;en.push(eo>>>10&1023|55296);eo=56320|eo&1023}en.push(eo);ei+=es}return eU(en)}const eB=4096;function eU($){const ee=$.length;if(ee<=eB){return String.fromCharCode.apply(String,$)}let et="";let en=0;while(en<ee){et+=String.fromCharCode.apply(String,$.slice(en,en+=eB))}return et}function ej($,ee,et){let en="";et=Math.min($.length,et);for(let ei=ee;ei<et;++ei){en+=String.fromCharCode($[ei]&127)}return en}function eW($,ee,et){let en="";et=Math.min($.length,et);for(let ei=ee;ei<et;++ei){en+=String.fromCharCode($[ei])}return en}function eH($,ee,et){const en=$.length;if(!ee||ee<0)ee=0;if(!et||et<0||et>en)et=en;let ei="";for(let en=ee;en<et;++en){ei+=tn[$[en]]}return ei}function ez($,ee,et){const en=$.slice(ee,et);let ei="";for(let $=0;$<en.length-1;$+=2){ei+=String.fromCharCode(en[$]+en[$+1]*256)}return ei}ef.prototype.slice=function $($,ee){const et=this.length;$=~~$;ee=ee===undefined?et:~~ee;if($<0){$+=et;if($<0)$=0}else if($>et){$=et}if(ee<0){ee+=et;if(ee<0)ee=0}else if(ee>et){ee=et}if(ee<$)ee=$;const en=this.subarray($,ee);Object.setPrototypeOf(en,ef.prototype);return en};function eV($,ee,et){if($%1!==0||$<0)throw new RangeError("offset is not uint");if($+ee>et)throw new RangeError("Trying to access beyond buffer length")}ef.prototype.readUintLE=ef.prototype.readUIntLE=function $($,ee,et){$=$>>>0;ee=ee>>>0;if(!et)eV($,ee,this.length);let en=this[$];let ei=1;let eo=0;while(++eo<ee&&(ei*=256)){en+=this[$+eo]*ei}return en};ef.prototype.readUintBE=ef.prototype.readUIntBE=function $($,ee,et){$=$>>>0;ee=ee>>>0;if(!et){eV($,ee,this.length)}let en=this[$+--ee];let ei=1;while(ee>0&&(ei*=256)){en+=this[$+--ee]*ei}return en};ef.prototype.readUint8=ef.prototype.readUInt8=function $($,ee){$=$>>>0;if(!ee)eV($,1,this.length);return this[$]};ef.prototype.readUint16LE=ef.prototype.readUInt16LE=function $($,ee){$=$>>>0;if(!ee)eV($,2,this.length);return this[$]|this[$+1]<<8};ef.prototype.readUint16BE=ef.prototype.readUInt16BE=function $($,ee){$=$>>>0;if(!ee)eV($,2,this.length);return this[$]<<8|this[$+1]};ef.prototype.readUint32LE=ef.prototype.readUInt32LE=function $($,ee){$=$>>>0;if(!ee)eV($,4,this.length);return(this[$]|this[$+1]<<8|this[$+2]<<16)+this[$+3]*16777216};ef.prototype.readUint32BE=ef.prototype.readUInt32BE=function $($,ee){$=$>>>0;if(!ee)eV($,4,this.length);return this[$]*16777216+(this[$+1]<<16|this[$+2]<<8|this[$+3])};ef.prototype.readBigUInt64LE=ti(function $($){$=$>>>0;e2($,"offset");const ee=this[$];const et=this[$+7];if(ee===undefined||et===undefined){e6($,this.length-8)}const en=ee+this[++$]*2**8+this[++$]*2**16+this[++$]*2**24;const ei=this[++$]+this[++$]*2**8+this[++$]*2**16+et*2**24;return BigInt(en)+(BigInt(ei)<<BigInt(32))});ef.prototype.readBigUInt64BE=ti(function $($){$=$>>>0;e2($,"offset");const ee=this[$];const et=this[$+7];if(ee===undefined||et===undefined){e6($,this.length-8)}const en=ee*2**24+this[++$]*2**16+this[++$]*2**8+this[++$];const ei=this[++$]*2**24+this[++$]*2**16+this[++$]*2**8+et;return(BigInt(en)<<BigInt(32))+BigInt(ei)});ef.prototype.readIntLE=function $($,ee,et){$=$>>>0;ee=ee>>>0;if(!et)eV($,ee,this.length);let en=this[$];let ei=1;let eo=0;while(++eo<ee&&(ei*=256)){en+=this[$+eo]*ei}ei*=128;if(en>=ei)en-=Math.pow(2,8*ee);return en};ef.prototype.readIntBE=function $($,ee,et){$=$>>>0;ee=ee>>>0;if(!et)eV($,ee,this.length);let en=ee;let ei=1;let eo=this[$+--en];while(en>0&&(ei*=256)){eo+=this[$+--en]*ei}ei*=128;if(eo>=ei)eo-=Math.pow(2,8*ee);return eo};ef.prototype.readInt8=function $($,ee){$=$>>>0;if(!ee)eV($,1,this.length);if(!(this[$]&128))return this[$];return(255-this[$]+1)*-1};ef.prototype.readInt16LE=function $($,ee){$=$>>>0;if(!ee)eV($,2,this.length);const et=this[$]|this[$+1]<<8;return et&32768?et|4294901760:et};ef.prototype.readInt16BE=function $($,ee){$=$>>>0;if(!ee)eV($,2,this.length);const et=this[$+1]|this[$]<<8;return et&32768?et|4294901760:et};ef.prototype.readInt32LE=function $($,ee){$=$>>>0;if(!ee)eV($,4,this.length);return this[$]|this[$+1]<<8|this[$+2]<<16|this[$+3]<<24};ef.prototype.readInt32BE=function $($,ee){$=$>>>0;if(!ee)eV($,4,this.length);return this[$]<<24|this[$+1]<<16|this[$+2]<<8|this[$+3]};ef.prototype.readBigInt64LE=ti(function $($){$=$>>>0;e2($,"offset");const ee=this[$];const et=this[$+7];if(ee===undefined||et===undefined){e6($,this.length-8)}const en=this[$+4]+this[$+5]*2**8+this[$+6]*2**16+(et<<24);return(BigInt(en)<<BigInt(32))+BigInt(ee+this[++$]*2**8+this[++$]*2**16+this[++$]*2**24)});ef.prototype.readBigInt64BE=ti(function $($){$=$>>>0;e2($,"offset");const ee=this[$];const et=this[$+7];if(ee===undefined||et===undefined){e6($,this.length-8)}const en=(ee<<24)+this[++$]*2**16+this[++$]*2**8+this[++$];return(BigInt(en)<<BigInt(32))+BigInt(this[++$]*2**24+this[++$]*2**16+this[++$]*2**8+et)});ef.prototype.readFloatLE=function $($,ee){$=$>>>0;if(!ee)eV($,4,this.length);return ei.read(this,$,true,23,4)};ef.prototype.readFloatBE=function $($,ee){$=$>>>0;if(!ee)eV($,4,this.length);return ei.read(this,$,false,23,4)};ef.prototype.readDoubleLE=function $($,ee){$=$>>>0;if(!ee)eV($,8,this.length);return ei.read(this,$,true,52,8)};ef.prototype.readDoubleBE=function $($,ee){$=$>>>0;if(!ee)eV($,8,this.length);return ei.read(this,$,false,52,8)};function e$($,ee,et,en,ei,eo){if(!ef.isBuffer($))throw new TypeError('"buffer" argument must be a Buffer instance');if(ee>ei||ee<eo)throw new RangeError('"value" argument is out of bounds');if(et+en>$.length)throw new RangeError("Index out of range")}ef.prototype.writeUintLE=ef.prototype.writeUIntLE=function $($,ee,et,en){$=+$;ee=ee>>>0;et=et>>>0;if(!en){const en=Math.pow(2,8*et)-1;e$(this,$,ee,et,en,0)}let ei=1;let eo=0;this[ee]=$&255;while(++eo<et&&(ei*=256)){this[ee+eo]=$/ei&255}return ee+et};ef.prototype.writeUintBE=ef.prototype.writeUIntBE=function $($,ee,et,en){$=+$;ee=ee>>>0;et=et>>>0;if(!en){const en=Math.pow(2,8*et)-1;e$(this,$,ee,et,en,0)}let ei=et-1;let eo=1;this[ee+ei]=$&255;while(--ei>=0&&(eo*=256)){this[ee+ei]=$/eo&255}return ee+et};ef.prototype.writeUint8=ef.prototype.writeUInt8=function $($,ee,et){$=+$;ee=ee>>>0;if(!et)e$(this,$,ee,1,255,0);this[ee]=$&255;return ee+1};ef.prototype.writeUint16LE=ef.prototype.writeUInt16LE=function $($,ee,et){$=+$;ee=ee>>>0;if(!et)e$(this,$,ee,2,65535,0);this[ee]=$&255;this[ee+1]=$>>>8;return ee+2};ef.prototype.writeUint16BE=ef.prototype.writeUInt16BE=function $($,ee,et){$=+$;ee=ee>>>0;if(!et)e$(this,$,ee,2,65535,0);this[ee]=$>>>8;this[ee+1]=$&255;return ee+2};ef.prototype.writeUint32LE=ef.prototype.writeUInt32LE=function $($,ee,et){$=+$;ee=ee>>>0;if(!et)e$(this,$,ee,4,4294967295,0);this[ee+3]=$>>>24;this[ee+2]=$>>>16;this[ee+1]=$>>>8;this[ee]=$&255;return ee+4};ef.prototype.writeUint32BE=ef.prototype.writeUInt32BE=function $($,ee,et){$=+$;ee=ee>>>0;if(!et)e$(this,$,ee,4,4294967295,0);this[ee]=$>>>24;this[ee+1]=$>>>16;this[ee+2]=$>>>8;this[ee+3]=$&255;return ee+4};function eq($,ee,et,en,ei){e1(ee,en,ei,$,et,7);let eo=Number(ee&BigInt(4294967295));$[et++]=eo;eo=eo>>8;$[et++]=eo;eo=eo>>8;$[et++]=eo;eo=eo>>8;$[et++]=eo;let es=Number(ee>>BigInt(32)&BigInt(4294967295));$[et++]=es;es=es>>8;$[et++]=es;es=es>>8;$[et++]=es;es=es>>8;$[et++]=es;return et}function eG($,ee,et,en,ei){e1(ee,en,ei,$,et,7);let eo=Number(ee&BigInt(4294967295));$[et+7]=eo;eo=eo>>8;$[et+6]=eo;eo=eo>>8;$[et+5]=eo;eo=eo>>8;$[et+4]=eo;let es=Number(ee>>BigInt(32)&BigInt(4294967295));$[et+3]=es;es=es>>8;$[et+2]=es;es=es>>8;$[et+1]=es;es=es>>8;$[et]=es;return et+8}ef.prototype.writeBigUInt64LE=ti(function $($,ee=0){return eq(this,$,ee,BigInt(0),BigInt("0xffffffffffffffff"))});ef.prototype.writeBigUInt64BE=ti(function $($,ee=0){return eG(this,$,ee,BigInt(0),BigInt("0xffffffffffffffff"))});ef.prototype.writeIntLE=function $($,ee,et,en){$=+$;ee=ee>>>0;if(!en){const en=Math.pow(2,8*et-1);e$(this,$,ee,et,en-1,-en)}let ei=0;let eo=1;let es=0;this[ee]=$&255;while(++ei<et&&(eo*=256)){if($<0&&es===0&&this[ee+ei-1]!==0){es=1}this[ee+ei]=($/eo>>0)-es&255}return ee+et};ef.prototype.writeIntBE=function $($,ee,et,en){$=+$;ee=ee>>>0;if(!en){const en=Math.pow(2,8*et-1);e$(this,$,ee,et,en-1,-en)}let ei=et-1;let eo=1;let es=0;this[ee+ei]=$&255;while(--ei>=0&&(eo*=256)){if($<0&&es===0&&this[ee+ei+1]!==0){es=1}this[ee+ei]=($/eo>>0)-es&255}return ee+et};ef.prototype.writeInt8=function $($,ee,et){$=+$;ee=ee>>>0;if(!et)e$(this,$,ee,1,127,-128);if($<0)$=255+$+1;this[ee]=$&255;return ee+1};ef.prototype.writeInt16LE=function $($,ee,et){$=+$;ee=ee>>>0;if(!et)e$(this,$,ee,2,32767,-32768);this[ee]=$&255;this[ee+1]=$>>>8;return ee+2};ef.prototype.writeInt16BE=function $($,ee,et){$=+$;ee=ee>>>0;if(!et)e$(this,$,ee,2,32767,-32768);this[ee]=$>>>8;this[ee+1]=$&255;return ee+2};ef.prototype.writeInt32LE=function $($,ee,et){$=+$;ee=ee>>>0;if(!et)e$(this,$,ee,4,2147483647,-2147483648);this[ee]=$&255;this[ee+1]=$>>>8;this[ee+2]=$>>>16;this[ee+3]=$>>>24;return ee+4};ef.prototype.writeInt32BE=function $($,ee,et){$=+$;ee=ee>>>0;if(!et)e$(this,$,ee,4,2147483647,-2147483648);if($<0)$=4294967295+$+1;this[ee]=$>>>24;this[ee+1]=$>>>16;this[ee+2]=$>>>8;this[ee+3]=$&255;return ee+4};ef.prototype.writeBigInt64LE=ti(function $($,ee=0){return eq(this,$,ee,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});ef.prototype.writeBigInt64BE=ti(function $($,ee=0){return eG(this,$,ee,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function eY($,ee,et,en,ei,eo){if(et+en>$.length)throw new RangeError("Index out of range");if(et<0)throw new RangeError("Index out of range")}function eK($,ee,et,en,eo){ee=+ee;et=et>>>0;if(!eo){eY($,ee,et,4,34028234663852886e22,-34028234663852886e22)}ei.write($,ee,et,en,23,4);return et+4}ef.prototype.writeFloatLE=function $($,ee,et){return eK(this,$,ee,true,et)};ef.prototype.writeFloatBE=function $($,ee,et){return eK(this,$,ee,false,et)};function eZ($,ee,et,en,eo){ee=+ee;et=et>>>0;if(!eo){eY($,ee,et,8,17976931348623157e292,-17976931348623157e292)}ei.write($,ee,et,en,52,8);return et+8}ef.prototype.writeDoubleLE=function $($,ee,et){return eZ(this,$,ee,true,et)};ef.prototype.writeDoubleBE=function $($,ee,et){return eZ(this,$,ee,false,et)};ef.prototype.copy=function $($,ee,et,en){if(!ef.isBuffer($))throw new TypeError("argument should be a Buffer");if(!et)et=0;if(!en&&en!==0)en=this.length;if(ee>=$.length)ee=$.length;if(!ee)ee=0;if(en>0&&en<et)en=et;if(en===et)return 0;if($.length===0||this.length===0)return 0;if(ee<0){throw new RangeError("targetStart out of bounds")}if(et<0||et>=this.length)throw new RangeError("Index out of range");if(en<0)throw new RangeError("sourceEnd out of bounds");if(en>this.length)en=this.length;if($.length-ee<en-et){en=$.length-ee+et}const ei=en-et;if(this===$&&typeof Uint8Array.prototype.copyWithin==="function"){this.copyWithin(ee,et,en)}else{Uint8Array.prototype.set.call($,this.subarray(et,en),ee)}return ei};ef.prototype.fill=function $($,ee,et,en){if(typeof $==="string"){if(typeof ee==="string"){en=ee;ee=0;et=this.length}else if(typeof et==="string"){en=et;et=this.length}if(en!==undefined&&typeof en!=="string"){throw new TypeError("encoding must be a string")}if(typeof en==="string"&&!ef.isEncoding(en)){throw new TypeError("Unknown encoding: "+en)}if($.length===1){const ee=$.charCodeAt(0);if(en==="utf8"&&ee<128||en==="latin1"){$=ee}}}else if(typeof $==="number"){$=$&255}else if(typeof $==="boolean"){$=Number($)}if(ee<0||this.length<ee||this.length<et){throw new RangeError("Out of range index")}if(et<=ee){return this}ee=ee>>>0;et=et===undefined?this.length:et>>>0;if(!$)$=0;let ei;if(typeof $==="number"){for(ei=ee;ei<et;++ei){this[ei]=$}}else{const eo=ef.isBuffer($)?$:ef.from($,en);const es=eo.length;if(es===0){throw new TypeError('The value "'+$+'" is invalid for argument "value"')}for(ei=0;ei<et-ee;++ei){this[ei+ee]=eo[ei%es]}}return this};const eJ={};function eX($,ee,et){eJ[$]=class en extends et{constructor(){super();Object.defineProperty(this,"message",{value:ee.apply(this,arguments),writable:true,configurable:true});this.name=`${this.name} [${$}]`;this.stack;delete this.name}get code(){return $}set code($){Object.defineProperty(this,"code",{configurable:true,enumerable:true,value:$,writable:true})}toString(){return`${this.name} [${$}]: ${this.message}`}}}eX("ERR_BUFFER_OUT_OF_BOUNDS",function($){if($){return`${$} is outside of buffer bounds`}return"Attempt to access memory outside buffer bounds"},RangeError);eX("ERR_INVALID_ARG_TYPE",function($,ee){return`The "${$}" argument must be of type number. Received type ${typeof ee}`},TypeError);eX("ERR_OUT_OF_RANGE",function($,ee,et){let en=`The value of "${$}" is out of range.`;let ei=et;if(Number.isInteger(et)&&Math.abs(et)>2**32){ei=eQ(String(et))}else if(typeof et==="bigint"){ei=String(et);if(et>BigInt(2)**BigInt(32)||et<-(BigInt(2)**BigInt(32))){ei=eQ(ei)}ei+="n"}en+=` It must be ${ee}. Received ${ei}`;return en},RangeError);function eQ($){let ee="";let et=$.length;const en=$[0]==="-"?1:0;for(;et>=en+4;et-=3){ee=`_${$.slice(et-3,et)}${ee}`}return`${$.slice(0,et)}${ee}`}function e0($,ee,et){e2(ee,"offset");if($[ee]===undefined||$[ee+et]===undefined){e6(ee,$.length-(et+1))}}function e1($,ee,et,en,ei,eo){if($>et||$<ee){const en=typeof ee==="bigint"?"n":"";let ei;if(eo>3){if(ee===0||ee===BigInt(0)){ei=`>= 0${en} and < 2${en} ** ${(eo+1)*8}${en}`}else{ei=`>= -(2${en} ** ${(eo+1)*8-1}${en}) and < 2 ** `+`${(eo+1)*8-1}${en}`}}else{ei=`>= ${ee}${en} and <= ${et}${en}`}throw new eJ.ERR_OUT_OF_RANGE("value",ei,$)}e0(en,ei,eo)}function e2($,ee){if(typeof $!=="number"){throw new eJ.ERR_INVALID_ARG_TYPE(ee,"number",$)}}function e6($,ee,et){if(Math.floor($)!==$){e2($,et);throw new eJ.ERR_OUT_OF_RANGE(et||"offset","an integer",$)}if(ee<0){throw new eJ.ERR_BUFFER_OUT_OF_BOUNDS}throw new eJ.ERR_OUT_OF_RANGE(et||"offset",`>= ${et?1:0} and <= ${ee}`,$)}const e4=/[^+/0-9A-Za-z-_]/g;function e3($){$=$.split("=")[0];$=$.trim().replace(e4,"");if($.length<2)return"";while($.length%4!==0){$=$+"="}return $}function e8($,ee){ee=ee||Infinity;let et;const en=$.length;let ei=null;const eo=[];for(let es=0;es<en;++es){et=$.charCodeAt(es);if(et>55295&&et<57344){if(!ei){if(et>56319){if((ee-=3)>-1)eo.push(239,191,189);continue}else if(es+1===en){if((ee-=3)>-1)eo.push(239,191,189);continue}ei=et;continue}if(et<56320){if((ee-=3)>-1)eo.push(239,191,189);ei=et;continue}et=(ei-55296<<10|et-56320)+65536}else if(ei){if((ee-=3)>-1)eo.push(239,191,189)}ei=null;if(et<128){if((ee-=1)<0)break;eo.push(et)}else if(et<2048){if((ee-=2)<0)break;eo.push(et>>6|192,et&63|128)}else if(et<65536){if((ee-=3)<0)break;eo.push(et>>12|224,et>>6&63|128,et&63|128)}else if(et<1114112){if((ee-=4)<0)break;eo.push(et>>18|240,et>>12&63|128,et>>6&63|128,et&63|128)}else{throw new Error("Invalid code point")}}return eo}function e5($){const ee=[];for(let et=0;et<$.length;++et){ee.push($.charCodeAt(et)&255)}return ee}function e9($,ee){let et,en,ei;const eo=[];for(let es=0;es<$.length;++es){if((ee-=2)<0)break;et=$.charCodeAt(es);en=et>>8;ei=et%256;eo.push(ei);eo.push(en)}return eo}function e7($){return en.toByteArray(e3($))}function te($,ee,et,en){let ei;for(ei=0;ei<en;++ei){if(ei+et>=ee.length||ei>=$.length)break;ee[ei+et]=$[ei]}return ei}function tt($,ee){return $ instanceof ee||$!=null&&$.constructor!=null&&$.constructor.name!=null&&$.constructor.name===ee.name}function tr($){return $!==$}const tn=function(){const $="0123456789abcdef";const ee=new Array(256);for(let et=0;et<16;++et){const en=et*16;for(let ei=0;ei<16;++ei){ee[en+ei]=$[et]+$[ei]}}return ee}();function ti($){return typeof BigInt==="undefined"?tu:$}function tu(){throw new Error("BigInt not supported")}},1924:($,ee,et)=>{"use strict";var en=et(210);var ei=et(5559);var eo=ei(en("String.prototype.indexOf"));$.exports=function $($,ee){var et=en($,!!ee);if(typeof et==="function"&&eo($,".prototype.")>-1){return ei(et)}return et}},5559:($,ee,et)=>{"use strict";var en=et(8612);var ei=et(210);var eo=ei("%Function.prototype.apply%");var es=ei("%Function.prototype.call%");var eu=ei("%Reflect.apply%",true)||en.call(es,eo);var el=ei("%Object.getOwnPropertyDescriptor%",true);var ef=ei("%Object.defineProperty%",true);var ed=ei("%Math.max%");if(ef){try{ef({},"a",{value:1})}catch($){ef=null}}$.exports=function $($){var ee=eu(en,es,arguments);if(el&&ef){var et=el(ee,"length");if(et.configurable){ef(ee,"length",{value:1+ed(0,$.length-(arguments.length-1))})}}return ee};var ep=function $(){return eu(en,eo,arguments)};if(ef){ef($.exports,"apply",{value:ep})}else{$.exports.apply=ep}},487:$=>{var ee={utf8:{stringToBytes:function($){return ee.bin.stringToBytes(unescape(encodeURIComponent($)))},bytesToString:function($){return decodeURIComponent(escape(ee.bin.bytesToString($)))}},bin:{stringToBytes:function($){for(var ee=[],et=0;et<$.length;et++)ee.push($.charCodeAt(et)&255);return ee},bytesToString:function($){for(var ee=[],et=0;et<$.length;et++)ee.push(String.fromCharCode($[et]));return ee.join("")}}};$.exports=ee},1012:$=>{(function(){var ee="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",et={rotl:function($,ee){return $<<ee|$>>>32-ee},rotr:function($,ee){return $<<32-ee|$>>>ee},endian:function($){if($.constructor==Number){return et.rotl($,8)&16711935|et.rotl($,24)&4278255360}for(var ee=0;ee<$.length;ee++)$[ee]=et.endian($[ee]);return $},randomBytes:function($){for(var ee=[];$>0;$--)ee.push(Math.floor(Math.random()*256));return ee},bytesToWords:function($){for(var ee=[],et=0,en=0;et<$.length;et++,en+=8)ee[en>>>5]|=$[et]<<24-en%32;return ee},wordsToBytes:function($){for(var ee=[],et=0;et<$.length*32;et+=8)ee.push($[et>>>5]>>>24-et%32&255);return ee},bytesToHex:function($){for(var ee=[],et=0;et<$.length;et++){ee.push(($[et]>>>4).toString(16));ee.push(($[et]&15).toString(16))}return ee.join("")},hexToBytes:function($){for(var ee=[],et=0;et<$.length;et+=2)ee.push(parseInt($.substr(et,2),16));return ee},bytesToBase64:function($){for(var et=[],en=0;en<$.length;en+=3){var ei=$[en]<<16|$[en+1]<<8|$[en+2];for(var eo=0;eo<4;eo++)if(en*8+eo*6<=$.length*8)et.push(ee.charAt(ei>>>6*(3-eo)&63));else et.push("=")}return et.join("")},base64ToBytes:function($){$=$.replace(/[^A-Z0-9+\/]/ig,"");for(var et=[],en=0,ei=0;en<$.length;ei=++en%4){if(ei==0)continue;et.push((ee.indexOf($.charAt(en-1))&Math.pow(2,-2*ei+8)-1)<<ei*2|ee.indexOf($.charAt(en))>>>6-ei*2)}return et}};$.exports=et})()},6203:($,ee,et)=>{var en=et(8764)["Buffer"];class ei{constructor($=100){this.size=$;this.length=0;this.buf=en.alloc($)}prepend($){if(en.isBuffer($)){const ee=this.length+$.length;if(ee>=this.size){this.resize();if(ee>=this.size){throw Error("INVALID_BUFFER_STATE")}}const et=this.buf;this.buf=en.alloc(this.size);$.copy(this.buf,0);et.copy(this.buf,$.length);this.length+=$.length}else{const ee=this.length++;if(ee===this.size){this.resize()}const et=this.clone();this.buf[0]=$;et.copy(this.buf,1,0,ee)}}append($){const ee=this.length++;if(ee===this.size){this.resize()}this.buf[ee]=$}clone(){return en.from(this.buf.slice(0,this.length))}resize(){const $=this.length;this.size=this.size*2;const ee=en.alloc(this.size);this.buf.copy(ee,0,0,$);this.buf=ee}toString($){if($){return this.buf.slice(0,this.length).toString($)}else{return Uint8Array.prototype.slice.call(this.buf.slice(0,this.length))}}toJSON(){return this.toString("utf8")}reset(){this.length=0}}$.exports=ei},1786:($,ee,et)=>{var en=et(8764)["Buffer"];const{Transform:ei}=et(2830);const eo=et(6203);const es=9;const eu=10;const el=12;const ef=13;const ed=32;const ep={"utf8":en.from([239,187,191]),"utf16le":en.from([255,254])};class eh extends ei{constructor($={}){super({...{readableObjectMode:true},...$,encoding:null});this.__originalOptions=$;this.__normalizeOptions($)}__normalizeOptions($){const ee={};for(let et in $){ee[em(et)]=$[et]}if(ee.encoding===undefined||ee.encoding===true){ee.encoding="utf8"}else if(ee.encoding===null||ee.encoding===false){ee.encoding=null}else if(typeof ee.encoding!=="string"&&ee.encoding!==null){throw new eg("CSV_INVALID_OPTION_ENCODING",["Invalid option encoding:","encoding must be a string or null to return a buffer,",`got ${JSON.stringify(ee.encoding)}`],ee)}if(ee.bom===undefined||ee.bom===null||ee.bom===false){ee.bom=false}else if(ee.bom!==true){throw new eg("CSV_INVALID_OPTION_BOM",["Invalid option bom:","bom must be true,",`got ${JSON.stringify(ee.bom)}`],ee)}let et=null;if(ee.cast===undefined||ee.cast===null||ee.cast===false||ee.cast===""){ee.cast=undefined}else if(typeof ee.cast==="function"){et=ee.cast;ee.cast=true}else if(ee.cast!==true){throw new eg("CSV_INVALID_OPTION_CAST",["Invalid option cast:","cast must be true or a function,",`got ${JSON.stringify(ee.cast)}`],ee)}if(ee.cast_date===undefined||ee.cast_date===null||ee.cast_date===false||ee.cast_date===""){ee.cast_date=false}else if(ee.cast_date===true){ee.cast_date=function($){const ee=Date.parse($);return!isNaN(ee)?new Date(ee):$}}else{throw new eg("CSV_INVALID_OPTION_CAST_DATE",["Invalid option cast_date:","cast_date must be true or a function,",`got ${JSON.stringify(ee.cast_date)}`],ee)}let ei=null;if(ee.columns===true){ei=undefined}else if(typeof ee.columns==="function"){ei=ee.columns;ee.columns=true}else if(Array.isArray(ee.columns)){ee.columns=eE(ee.columns)}else if(ee.columns===undefined||ee.columns===null||ee.columns===false){ee.columns=false}else{throw new eg("CSV_INVALID_OPTION_COLUMNS",["Invalid option columns:","expect an array, a function or true,",`got ${JSON.stringify(ee.columns)}`],ee)}if(ee.columns_duplicates_to_array===undefined||ee.columns_duplicates_to_array===null||ee.columns_duplicates_to_array===false){ee.columns_duplicates_to_array=false}else if(ee.columns_duplicates_to_array!==true){throw new eg("CSV_INVALID_OPTION_COLUMNS_DUPLICATES_TO_ARRAY",["Invalid option columns_duplicates_to_array:","expect an boolean,",`got ${JSON.stringify(ee.columns_duplicates_to_array)}`],ee)}else if(ee.columns===false){throw new eg("CSV_INVALID_OPTION_COLUMNS_DUPLICATES_TO_ARRAY",["Invalid option columns_duplicates_to_array:","the `columns` mode must be activated."],ee)}if(ee.comment===undefined||ee.comment===null||ee.comment===false||ee.comment===""){ee.comment=null}else{if(typeof ee.comment==="string"){ee.comment=en.from(ee.comment,ee.encoding)}if(!en.isBuffer(ee.comment)){throw new eg("CSV_INVALID_OPTION_COMMENT",["Invalid option comment:","comment must be a buffer or a string,",`got ${JSON.stringify(ee.comment)}`],ee)}}const es=JSON.stringify(ee.delimiter);if(!Array.isArray(ee.delimiter))ee.delimiter=[ee.delimiter];if(ee.delimiter.length===0){throw new eg("CSV_INVALID_OPTION_DELIMITER",["Invalid option delimiter:","delimiter must be a non empty string or buffer or array of string|buffer,",`got ${es}`],ee)}ee.delimiter=ee.delimiter.map(function($){if($===undefined||$===null||$===false){return en.from(",",ee.encoding)}if(typeof $==="string"){$=en.from($,ee.encoding)}if(!en.isBuffer($)||$.length===0){throw new eg("CSV_INVALID_OPTION_DELIMITER",["Invalid option delimiter:","delimiter must be a non empty string or buffer or array of string|buffer,",`got ${es}`],ee)}return $});if(ee.escape===undefined||ee.escape===true){ee.escape=en.from('"',ee.encoding)}else if(typeof ee.escape==="string"){ee.escape=en.from(ee.escape,ee.encoding)}else if(ee.escape===null||ee.escape===false){ee.escape=null}if(ee.escape!==null){if(!en.isBuffer(ee.escape)){throw new Error(`Invalid Option: escape must be a buffer, a string or a boolean, got ${JSON.stringify(ee.escape)}`)}}if(ee.from===undefined||ee.from===null){ee.from=1}else{if(typeof ee.from==="string"&&/\d+/.test(ee.from)){ee.from=parseInt(ee.from)}if(Number.isInteger(ee.from)){if(ee.from<0){throw new Error(`Invalid Option: from must be a positive integer, got ${JSON.stringify($.from)}`)}}else{throw new Error(`Invalid Option: from must be an integer, got ${JSON.stringify(ee.from)}`)}}if(ee.from_line===undefined||ee.from_line===null){ee.from_line=1}else{if(typeof ee.from_line==="string"&&/\d+/.test(ee.from_line)){ee.from_line=parseInt(ee.from_line)}if(Number.isInteger(ee.from_line)){if(ee.from_line<=0){throw new Error(`Invalid Option: from_line must be a positive integer greater than 0, got ${JSON.stringify($.from_line)}`)}}else{throw new Error(`Invalid Option: from_line must be an integer, got ${JSON.stringify($.from_line)}`)}}if(ee.ignore_last_delimiters===undefined||ee.ignore_last_delimiters===null){ee.ignore_last_delimiters=false}else if(typeof ee.ignore_last_delimiters==="number"){ee.ignore_last_delimiters=Math.floor(ee.ignore_last_delimiters);if(ee.ignore_last_delimiters===0){ee.ignore_last_delimiters=false}}else if(typeof ee.ignore_last_delimiters!=="boolean"){throw new eg("CSV_INVALID_OPTION_IGNORE_LAST_DELIMITERS",["Invalid option `ignore_last_delimiters`:","the value must be a boolean value or an integer,",`got ${JSON.stringify(ee.ignore_last_delimiters)}`],ee)}if(ee.ignore_last_delimiters===true&&ee.columns===false){throw new eg("CSV_IGNORE_LAST_DELIMITERS_REQUIRES_COLUMNS",["The option `ignore_last_delimiters`","requires the activation of the `columns` option"],ee)}if(ee.info===undefined||ee.info===null||ee.info===false){ee.info=false}else if(ee.info!==true){throw new Error(`Invalid Option: info must be true, got ${JSON.stringify(ee.info)}`)}if(ee.max_record_size===undefined||ee.max_record_size===null||ee.max_record_size===false){ee.max_record_size=0}else if(Number.isInteger(ee.max_record_size)&&ee.max_record_size>=0){}else if(typeof ee.max_record_size==="string"&&/\d+/.test(ee.max_record_size)){ee.max_record_size=parseInt(ee.max_record_size)}else{throw new Error(`Invalid Option: max_record_size must be a positive integer, got ${JSON.stringify(ee.max_record_size)}`)}if(ee.objname===undefined||ee.objname===null||ee.objname===false){ee.objname=undefined}else if(en.isBuffer(ee.objname)){if(ee.objname.length===0){throw new Error(`Invalid Option: objname must be a non empty buffer`)}if(ee.encoding===null){}else{ee.objname=ee.objname.toString(ee.encoding)}}else if(typeof ee.objname==="string"){if(ee.objname.length===0){throw new Error(`Invalid Option: objname must be a non empty string`)}}else{throw new Error(`Invalid Option: objname must be a string or a buffer, got ${ee.objname}`)}if(ee.on_record===undefined||ee.on_record===null){ee.on_record=undefined}else if(typeof ee.on_record!=="function"){throw new eg("CSV_INVALID_OPTION_ON_RECORD",["Invalid option `on_record`:","expect a function,",`got ${JSON.stringify(ee.on_record)}`],ee)}if(ee.quote===null||ee.quote===false||ee.quote===""){ee.quote=null}else{if(ee.quote===undefined||ee.quote===true){ee.quote=en.from('"',ee.encoding)}else if(typeof ee.quote==="string"){ee.quote=en.from(ee.quote,ee.encoding)}if(!en.isBuffer(ee.quote)){throw new Error(`Invalid Option: quote must be a buffer or a string, got ${JSON.stringify(ee.quote)}`)}}if(ee.raw===undefined||ee.raw===null||ee.raw===false){ee.raw=false}else if(ee.raw!==true){throw new Error(`Invalid Option: raw must be true, got ${JSON.stringify(ee.raw)}`)}if(!ee.record_delimiter){ee.record_delimiter=[]}else if(!Array.isArray(ee.record_delimiter)){ee.record_delimiter=[ee.record_delimiter]}ee.record_delimiter=ee.record_delimiter.map(function($){if(typeof $==="string"){$=en.from($,ee.encoding)}return $});if(typeof ee.relax==="boolean"){}else if(ee.relax===undefined||ee.relax===null){ee.relax=false}else{throw new Error(`Invalid Option: relax must be a boolean, got ${JSON.stringify(ee.relax)}`)}if(typeof ee.relax_column_count==="boolean"){}else if(ee.relax_column_count===undefined||ee.relax_column_count===null){ee.relax_column_count=false}else{throw new Error(`Invalid Option: relax_column_count must be a boolean, got ${JSON.stringify(ee.relax_column_count)}`)}if(typeof ee.relax_column_count_less==="boolean"){}else if(ee.relax_column_count_less===undefined||ee.relax_column_count_less===null){ee.relax_column_count_less=false}else{throw new Error(`Invalid Option: relax_column_count_less must be a boolean, got ${JSON.stringify(ee.relax_column_count_less)}`)}if(typeof ee.relax_column_count_more==="boolean"){}else if(ee.relax_column_count_more===undefined||ee.relax_column_count_more===null){ee.relax_column_count_more=false}else{throw new Error(`Invalid Option: relax_column_count_more must be a boolean, got ${JSON.stringify(ee.relax_column_count_more)}`)}if(typeof ee.skip_empty_lines==="boolean"){}else if(ee.skip_empty_lines===undefined||ee.skip_empty_lines===null){ee.skip_empty_lines=false}else{throw new Error(`Invalid Option: skip_empty_lines must be a boolean, got ${JSON.stringify(ee.skip_empty_lines)}`)}if(typeof ee.skip_lines_with_empty_values==="boolean"){}else if(ee.skip_lines_with_empty_values===undefined||ee.skip_lines_with_empty_values===null){ee.skip_lines_with_empty_values=false}else{throw new Error(`Invalid Option: skip_lines_with_empty_values must be a boolean, got ${JSON.stringify(ee.skip_lines_with_empty_values)}`)}if(typeof ee.skip_lines_with_error==="boolean"){}else if(ee.skip_lines_with_error===undefined||ee.skip_lines_with_error===null){ee.skip_lines_with_error=false}else{throw new Error(`Invalid Option: skip_lines_with_error must be a boolean, got ${JSON.stringify(ee.skip_lines_with_error)}`)}if(ee.rtrim===undefined||ee.rtrim===null||ee.rtrim===false){ee.rtrim=false}else if(ee.rtrim!==true){throw new Error(`Invalid Option: rtrim must be a boolean, got ${JSON.stringify(ee.rtrim)}`)}if(ee.ltrim===undefined||ee.ltrim===null||ee.ltrim===false){ee.ltrim=false}else if(ee.ltrim!==true){throw new Error(`Invalid Option: ltrim must be a boolean, got ${JSON.stringify(ee.ltrim)}`)}if(ee.trim===undefined||ee.trim===null||ee.trim===false){ee.trim=false}else if(ee.trim!==true){throw new Error(`Invalid Option: trim must be a boolean, got ${JSON.stringify(ee.trim)}`)}if(ee.trim===true&&$.ltrim!==false){ee.ltrim=true}else if(ee.ltrim!==true){ee.ltrim=false}if(ee.trim===true&&$.rtrim!==false){ee.rtrim=true}else if(ee.rtrim!==true){ee.rtrim=false}if(ee.to===undefined||ee.to===null){ee.to=-1}else{if(typeof ee.to==="string"&&/\d+/.test(ee.to)){ee.to=parseInt(ee.to)}if(Number.isInteger(ee.to)){if(ee.to<=0){throw new Error(`Invalid Option: to must be a positive integer greater than 0, got ${JSON.stringify($.to)}`)}}else{throw new Error(`Invalid Option: to must be an integer, got ${JSON.stringify($.to)}`)}}if(ee.to_line===undefined||ee.to_line===null){ee.to_line=-1}else{if(typeof ee.to_line==="string"&&/\d+/.test(ee.to_line)){ee.to_line=parseInt(ee.to_line)}if(Number.isInteger(ee.to_line)){if(ee.to_line<=0){throw new Error(`Invalid Option: to_line must be a positive integer greater than 0, got ${JSON.stringify($.to_line)}`)}}else{throw new Error(`Invalid Option: to_line must be an integer, got ${JSON.stringify($.to_line)}`)}}this.info={bytes:0,comment_lines:0,empty_lines:0,invalid_field_length:0,lines:1,records:0};this.options=ee;this.state={bomSkipped:false,bufBytesStart:0,castField:et,commenting:false,error:undefined,enabled:ee.from_line===1,escaping:false,escapeIsQuote:en.isBuffer(ee.escape)&&en.isBuffer(ee.quote)&&en.compare(ee.escape,ee.quote)===0,expectedRecordLength:Array.isArray(ee.columns)?ee.columns.length:undefined,field:new eo(20),firstLineToHeaders:ei,needMoreDataSize:Math.max(ee.comment!==null?ee.comment.length:0,...ee.delimiter.map($=>$.length),ee.quote!==null?ee.quote.length:0),previousBuf:undefined,quoting:false,stop:false,rawBuffer:new eo(100),record:[],recordHasError:false,record_length:0,recordDelimiterMaxLength:ee.record_delimiter.length===0?2:Math.max(...ee.record_delimiter.map($=>$.length)),trimChars:[en.from(" ",ee.encoding)[0],en.from(" ",ee.encoding)[0]],wasQuoting:false,wasRowDelimiter:false}}_transform($,ee,et){if(this.state.stop===true){return}const en=this.__parse($,false);if(en!==undefined){this.state.stop=true}et(en)}_flush($){if(this.state.stop===true){return}const ee=this.__parse(undefined,true);$(ee)}__parse($,ee){const{bom:et,comment:ei,escape:eo,from_line:es,ltrim:el,max_record_size:ed,quote:eh,raw:ey,relax:em,rtrim:e_,skip_empty_lines:ew,to:eE,to_line:eS}=this.options;let{record_delimiter:eT}=this.options;const{bomSkipped:eO,previousBuf:eA,rawBuffer:eI,escapeIsQuote:eN}=this.state;let eD;if(eA===undefined){if($===undefined){this.push(null);return}else{eD=$}}else if(eA!==undefined&&$===undefined){eD=eA}else{eD=en.concat([eA,$])}if(eO===false){if(et===false){this.state.bomSkipped=true}else if(eD.length<3){if(ee===false){this.state.previousBuf=eD;return}}else{for(let $ in ep){if(ep[$].compare(eD,0,ep[$].length)===0){let ee=ep[$].length;this.state.bufBytesStart+=ee;eD=eD.slice(ee);this.__normalizeOptions({...this.__originalOptions,encoding:$});break}}this.state.bomSkipped=true}}const eR=eD.length;let eC;for(eC=0;eC<eR;eC++){if(this.__needMoreData(eC,eR,ee)){break}if(this.state.wasRowDelimiter===true){this.info.lines++;this.state.wasRowDelimiter=false}if(eS!==-1&&this.info.lines>eS){this.state.stop=true;this.push(null);return}if(this.state.quoting===false&&eT.length===0){const $=this.__autoDiscoverRecordDelimiter(eD,eC);if($){eT=this.options.record_delimiter}}const $=eD[eC];if(ey===true){eI.append($)}if(($===ef||$===eu)&&this.state.wasRowDelimiter===false){this.state.wasRowDelimiter=true}if(this.state.escaping===true){this.state.escaping=false}else{if(eo!==null&&this.state.quoting===true&&this.__isEscape(eD,eC,$)&&eC+eo.length<eR){if(eN){if(this.__isQuote(eD,eC+eo.length)){this.state.escaping=true;eC+=eo.length-1;continue}}else{this.state.escaping=true;eC+=eo.length-1;continue}}if(this.state.commenting===false&&this.__isQuote(eD,eC)){if(this.state.quoting===true){const ee=eD[eC+eh.length];const et=e_&&this.__isCharTrimable(ee);const en=ei!==null&&this.__compareBytes(ei,eD,eC+eh.length,ee);const es=this.__isDelimiter(eD,eC+eh.length,ee);const eu=eT.length===0?this.__autoDiscoverRecordDelimiter(eD,eC+eh.length):this.__isRecordDelimiter(ee,eD,eC+eh.length);if(eo!==null&&this.__isEscape(eD,eC,$)&&this.__isQuote(eD,eC+eo.length)){eC+=eo.length-1}else if(!ee||es||eu||en||et){this.state.quoting=false;this.state.wasQuoting=true;eC+=eh.length-1;continue}else if(em===false){const $=this.__error(new eg("CSV_INVALID_CLOSING_QUOTE",["Invalid Closing Quote:",`got "${String.fromCharCode(ee)}"`,`at line ${this.info.lines}`,"instead of delimiter, record delimiter, trimable character","(if activated) or comment"],this.options,this.__infoField()));if($!==undefined)return $}else{this.state.quoting=false;this.state.wasQuoting=true;this.state.field.prepend(eh);eC+=eh.length-1}}else{if(this.state.field.length!==0){if(em===false){const $=this.__error(new eg("INVALID_OPENING_QUOTE",["Invalid Opening Quote:",`a quote is found inside a field at line ${this.info.lines}`],this.options,this.__infoField(),{field:this.state.field}));if($!==undefined)return $}}else{this.state.quoting=true;eC+=eh.length-1;continue}}}if(this.state.quoting===false){let ee=this.__isRecordDelimiter($,eD,eC);if(ee!==0){const $=this.state.commenting&&this.state.wasQuoting===false&&this.state.record.length===0&&this.state.field.length===0;if($){this.info.comment_lines++}else{if(this.state.enabled===false&&this.info.lines+(this.state.wasRowDelimiter===true?1:0)>=es){this.state.enabled=true;this.__resetField();this.__resetRecord();eC+=ee-1;continue}if(ew===true&&this.state.wasQuoting===false&&this.state.record.length===0&&this.state.field.length===0){this.info.empty_lines++;eC+=ee-1;continue}this.info.bytes=this.state.bufBytesStart+eC;const $=this.__onField();if($!==undefined)return $;this.info.bytes=this.state.bufBytesStart+eC+ee;const et=this.__onRecord();if(et!==undefined)return et;if(eE!==-1&&this.info.records>=eE){this.state.stop=true;this.push(null);return}}this.state.commenting=false;eC+=ee-1;continue}if(this.state.commenting){continue}const et=ei===null?0:this.__compareBytes(ei,eD,eC,$);if(et!==0){this.state.commenting=true;continue}let en=this.__isDelimiter(eD,eC,$);if(en!==0){this.info.bytes=this.state.bufBytesStart+eC;const $=this.__onField();if($!==undefined)return $;eC+=en-1;continue}}}if(this.state.commenting===false){if(ed!==0&&this.state.record_length+this.state.field.length>ed){const $=this.__error(new eg("CSV_MAX_RECORD_SIZE",["Max Record Size:","record exceed the maximum number of tolerated bytes",`of ${ed}`,`at line ${this.info.lines}`],this.options,this.__infoField()));if($!==undefined)return $}}const et=el===false||this.state.quoting===true||this.state.field.length!==0||!this.__isCharTrimable($);const en=e_===false||this.state.wasQuoting===false;if(et===true&&en===true){this.state.field.append($)}else if(e_===true&&!this.__isCharTrimable($)){const $=this.__error(new eg("CSV_NON_TRIMABLE_CHAR_AFTER_CLOSING_QUOTE",["Invalid Closing Quote:","found non trimable byte after quote",`at line ${this.info.lines}`],this.options,this.__infoField()));if($!==undefined)return $}}if(ee===true){if(this.state.quoting===true){const $=this.__error(new eg("CSV_QUOTE_NOT_CLOSED",["Quote Not Closed:",`the parsing is finished with an opening quote at line ${this.info.lines}`],this.options,this.__infoField()));if($!==undefined)return $}else{if(this.state.wasQuoting===true||this.state.record.length!==0||this.state.field.length!==0){this.info.bytes=this.state.bufBytesStart+eC;const $=this.__onField();if($!==undefined)return $;const ee=this.__onRecord();if(ee!==undefined)return ee}else if(this.state.wasRowDelimiter===true){this.info.empty_lines++}else if(this.state.commenting===true){this.info.comment_lines++}}}else{this.state.bufBytesStart+=eC;this.state.previousBuf=eD.slice(eC)}if(this.state.wasRowDelimiter===true){this.info.lines++;this.state.wasRowDelimiter=false}}__onRecord(){const{columns:$,columns_duplicates_to_array:ee,encoding:et,info:en,from:ei,relax_column_count:eo,relax_column_count_less:es,relax_column_count_more:eu,raw:el,skip_lines_with_empty_values:ef}=this.options;const{enabled:ed,record:ep}=this.state;if(ed===false){return this.__resetRecord()}const eh=ep.length;if($===true){if(ef===true&&ew(ep)){this.__resetRecord();return}return this.__firstLineToColumns(ep)}if($===false&&this.info.records===0){this.state.expectedRecordLength=eh}if(eh!==this.state.expectedRecordLength){const ee=$===false?new eg("CSV_INCONSISTENT_RECORD_LENGTH",["Invalid Record Length:",`expect ${this.state.expectedRecordLength},`,`got ${eh} on line ${this.info.lines}`],this.options,this.__infoField(),{record:ep}):new eg("CSV_RECORD_DONT_MATCH_COLUMNS_LENGTH",["Invalid Record Length:",`columns length is ${$.length},`,`got ${eh} on line ${this.info.lines}`],this.options,this.__infoField(),{record:ep});if(eo===true||es===true&&eh<this.state.expectedRecordLength||eu===true&&eh>this.state.expectedRecordLength){this.info.invalid_field_length++;this.state.error=ee}else{const $=this.__error(ee);if($)return $}}if(ef===true&&ew(ep)){this.__resetRecord();return}if(this.state.recordHasError===true){this.__resetRecord();this.state.recordHasError=false;return}this.info.records++;if(ei===1||this.info.records>=ei){if($!==false){const ei={};for(let et=0,en=ep.length;et<en;et++){if($[et]===undefined||$[et].disabled)continue;if(ee===true&&ei[$[et].name]!==undefined){if(Array.isArray(ei[$[et].name])){ei[$[et].name]=ei[$[et].name].concat(ep[et])}else{ei[$[et].name]=[ei[$[et].name],ep[et]]}}else{ei[$[et].name]=ep[et]}}const{objname:eo}=this.options;if(eo===undefined){if(el===true||en===true){const $=this.__push(Object.assign({record:ei},el===true?{raw:this.state.rawBuffer.toString(et)}:{},en===true?{info:this.__infoRecord()}:{}));if($){return $}}else{const $=this.__push(ei);if($){return $}}}else{if(el===true||en===true){const $=this.__push(Object.assign({record:[ei[eo],ei]},el===true?{raw:this.state.rawBuffer.toString(et)}:{},en===true?{info:this.__infoRecord()}:{}));if($){return $}}else{const $=this.__push([ei[eo],ei]);if($){return $}}}}else{if(el===true||en===true){const $=this.__push(Object.assign({record:ep},el===true?{raw:this.state.rawBuffer.toString(et)}:{},en===true?{info:this.__infoRecord()}:{}));if($){return $}}else{const $=this.__push(ep);if($){return $}}}}this.__resetRecord()}__firstLineToColumns($){const{firstLineToHeaders:ee}=this.state;try{const et=ee===undefined?$:ee.call(null,$);if(!Array.isArray(et)){return this.__error(new eg("CSV_INVALID_COLUMN_MAPPING",["Invalid Column Mapping:","expect an array from column function,",`got ${JSON.stringify(et)}`],this.options,this.__infoField(),{headers:et}))}const en=eE(et);this.state.expectedRecordLength=en.length;this.options.columns=en;this.__resetRecord();return}catch($){return $}}__resetRecord(){if(this.options.raw===true){this.state.rawBuffer.reset()}this.state.error=undefined;this.state.record=[];this.state.record_length=0}__onField(){const{cast:$,encoding:ee,rtrim:et,max_record_size:en}=this.options;const{enabled:ei,wasQuoting:eo}=this.state;if(ei===false){return this.__resetField()}let es=this.state.field.toString(ee);if(et===true&&eo===false){es=es.trimRight()}if($===true){const[$,ee]=this.__cast(es);if($!==undefined)return $;es=ee}this.state.record.push(es);if(en!==0&&typeof es==="string"){this.state.record_length+=es.length}this.__resetField()}__resetField(){this.state.field.reset();this.state.wasQuoting=false}__push($){const{on_record:ee}=this.options;if(ee!==undefined){const et=this.__infoRecord();try{$=ee.call(null,$,et)}catch($){return $}if($===undefined||$===null){return}}this.push($)}__cast($){const{columns:ee,relax_column_count:et}=this.options;const en=Array.isArray(ee);if(en===true&&et&&this.options.columns.length<=this.state.record.length){return[undefined,undefined]}if(this.state.castField!==null){try{const ee=this.__infoField();return[undefined,this.state.castField.call(null,$,ee)]}catch($){return[$]}}if(this.__isFloat($)){return[undefined,parseFloat($)]}else if(this.options.cast_date!==false){const ee=this.__infoField();return[undefined,this.options.cast_date.call(null,$,ee)]}return[undefined,$]}__isCharTrimable($){return $===ed||$===es||$===ef||$===eu||$===el}__isFloat($){return $-parseFloat($)+1>=0}__compareBytes($,ee,et,en){if($[0]!==en)return 0;const ei=$.length;for(let en=1;en<ei;en++){if($[en]!==ee[et+en])return 0}return ei}__needMoreData($,ee,et){if(et)return false;const{quote:en}=this.options;const{quoting:ei,needMoreDataSize:eo,recordDelimiterMaxLength:es}=this.state;const eu=ee-$-1;const el=Math.max(eo,es,ei?en.length+es:0);return eu<el}__isDelimiter($,ee,et){const{delimiter:en,ignore_last_delimiters:ei}=this.options;if(ei===true&&this.state.record.length===this.options.columns.length-1){return 0}else if(ei!==false&&typeof ei==="number"&&this.state.record.length===ei-1){return 0}r:for(let ei=0;ei<en.length;ei++){const eo=en[ei];if(eo[0]===et){for(let et=1;et<eo.length;et++){if(eo[et]!==$[ee+et])continue r}return eo.length}}return 0}__isRecordDelimiter($,ee,et){const{record_delimiter:en}=this.options;const ei=en.length;r:for(let eo=0;eo<ei;eo++){const ei=en[eo];const es=ei.length;if(ei[0]!==$){continue}for(let $=1;$<es;$++){if(ei[$]!==ee[et+$]){continue r}}return ei.length}return 0}__isEscape($,ee,et){const{escape:en}=this.options;if(en===null)return false;const ei=en.length;if(en[0]===et){for(let et=0;et<ei;et++){if(en[et]!==$[ee+et]){return false}}return true}return false}__isQuote($,ee){const{quote:et}=this.options;if(et===null)return false;const en=et.length;for(let ei=0;ei<en;ei++){if(et[ei]!==$[ee+ei]){return false}}return true}__autoDiscoverRecordDelimiter($,ee){const{encoding:et}=this.options;const ei=$[ee];if(ei===ef){if($[ee+1]===eu){this.options.record_delimiter.push(en.from("\r\n",et));this.state.recordDelimiterMaxLength=2;return 2}else{this.options.record_delimiter.push(en.from("\r",et));this.state.recordDelimiterMaxLength=1;return 1}}else if(ei===eu){this.options.record_delimiter.push(en.from("\n",et));this.state.recordDelimiterMaxLength=1;return 1}return 0}__error($){const{skip_lines_with_error:ee}=this.options;const et=typeof $==="string"?new Error($):$;if(ee){this.state.recordHasError=true;this.emit("skip",et);return undefined}else{return et}}__infoDataSet(){return{...this.info,columns:this.options.columns}}__infoRecord(){const{columns:$}=this.options;return{...this.__infoDataSet(),error:this.state.error,header:$===true,index:this.state.record.length}}__infoField(){const{columns:$}=this.options;const ee=Array.isArray($);return{...this.__infoRecord(),column:ee===true?$.length>this.state.record.length?$[this.state.record.length].name:null:this.state.record.length,quoting:this.state.wasQuoting}}}const ey=function(){let $,ee,et;for(let ei in arguments){const eo=arguments[ei];const es=typeof eo;if($===undefined&&(typeof eo==="string"||en.isBuffer(eo))){$=eo}else if(ee===undefined&&e_(eo)){ee=eo}else if(et===undefined&&es==="function"){et=eo}else{throw new eg("CSV_INVALID_ARGUMENT",["Invalid argument:",`got ${JSON.stringify(eo)} at index ${ei}`],ee||{})}}const ei=new eh(ee);if(et){const $=ee===undefined||ee.objname===undefined?[]:{};ei.on("readable",function(){let et;while((et=this.read())!==null){if(ee===undefined||ee.objname===undefined){$.push(et)}else{$[et[0]]=et[1]}}});ei.on("error",function($){et($,undefined,ei.__infoDataSet())});ei.on("end",function(){et(undefined,$,ei.__infoDataSet())})}if($!==undefined){if(typeof setImmediate==="function"){setImmediate(function(){ei.write($);ei.end()})}else{ei.write($);ei.end()}}return ei};class eg extends Error{constructor($,ee,et,...ei){if(Array.isArray(ee))ee=ee.join(" ");super(ee);if(Error.captureStackTrace!==undefined){Error.captureStackTrace(this,eg)}this.code=$;for(const $ of ei){for(const ee in $){const ei=$[ee];this[ee]=en.isBuffer(ei)?ei.toString(et.encoding):ei==null?ei:JSON.parse(JSON.stringify(ei))}}}}ey.Parser=eh;ey.CsvError=eg;$.exports=ey;const em=function($){return $.replace(/([A-Z])/g,function($,ee){return"_"+ee.toLowerCase()})};const e_=function($){return typeof $==="object"&&$!==null&&!Array.isArray($)};const ew=function($){return $.every($=>$==null||$.toString&&$.toString().trim()==="")};const eE=function($){const ee=[];for(let et=0,en=$.length;et<en;et++){const en=$[et];if(en===undefined||en===null||en===false){ee[et]={disabled:true}}else if(typeof en==="string"){ee[et]={name:en}}else if(e_(en)){if(typeof en.name!=="string"){throw new eg("CSV_OPTION_COLUMNS_MISSING_NAME",["Option columns missing name:",`property "name" is required at position ${et}`,"when column is an object literal"])}ee[et]=en}else{throw new eg("CSV_INVALID_COLUMN_DEFINITION",["Invalid column definition:","expect a string or a literal object,",`got ${JSON.stringify(en)} at position ${et}`])}}return ee}},6241:($,ee,et)=>{var en=et(8764)["Buffer"];const ei=et(1786);$.exports=function($,ee={}){if(typeof $==="string"){$=en.from($)}const et=ee&&ee.objname?{}:[];const eo=new ei.Parser(ee);eo.push=function($){if($===null){return}if(ee.objname===undefined)et.push($);else{et[$[0]]=$[1]}};const es=eo.__parse($,false);if(es!==undefined)throw es;const eu=eo.__parse(undefined,true);if(eu!==undefined)throw eu;return et}},1884:($,ee,et)=>{var en=et(8764)["Buffer"];const{Transform:ei}=et(2830);const eo=en.from([239,187,191]);class es extends ei{constructor($={}){super({...{writableObjectMode:true},...$});const ee={};let et;for(let et in $){ee[ed(et)]=$[et]}if(et=this.normalize(ee))throw et;switch(ee.record_delimiter){case"auto":ee.record_delimiter=null;break;case"unix":ee.record_delimiter="\n";break;case"mac":ee.record_delimiter="\r";break;case"windows":ee.record_delimiter="\r\n";break;case"ascii":ee.record_delimiter="\x1e";break;case"unicode":ee.record_delimiter="\u2028";break}this.options=ee;this.state={stop:false};this.info={records:0}}normalize($){if($.bom===undefined||$.bom===null||$.bom===false){$.bom=false}else if($.bom!==true){return new el("CSV_OPTION_BOOLEAN_INVALID_TYPE",["option `bom` is optional and must be a boolean value,",`got ${JSON.stringify($.bom)}`])}if($.delimiter===undefined||$.delimiter===null){$.delimiter=","}else if(en.isBuffer($.delimiter)){$.delimiter=$.delimiter.toString()}else if(typeof $.delimiter!=="string"){return new el("CSV_OPTION_DELIMITER_INVALID_TYPE",["option `delimiter` must be a buffer or a string,",`got ${JSON.stringify($.delimiter)}`])}if($.quote===undefined||$.quote===null){$.quote='"'}else if($.quote===true){$.quote='"'}else if($.quote===false){$.quote=""}else if(en.isBuffer($.quote)){$.quote=$.quote.toString()}else if(typeof $.quote!=="string"){return new el("CSV_OPTION_QUOTE_INVALID_TYPE",["option `quote` must be a boolean, a buffer or a string,",`got ${JSON.stringify($.quote)}`])}if($.quoted===undefined||$.quoted===null){$.quoted=false}else{}if($.quoted_empty===undefined||$.quoted_empty===null){$.quoted_empty=undefined}else{}if($.quoted_match===undefined||$.quoted_match===null||$.quoted_match===false){$.quoted_match=null}else if(!Array.isArray($.quoted_match)){$.quoted_match=[$.quoted_match]}if($.quoted_match){for(let ee of $.quoted_match){const $=typeof ee==="string";const et=ee instanceof RegExp;if(!$&&!et){return Error(`Invalid Option: quoted_match must be a string or a regex, got ${JSON.stringify(ee)}`)}}}if($.quoted_string===undefined||$.quoted_string===null){$.quoted_string=false}else{}if($.eof===undefined||$.eof===null){$.eof=true}else{}if($.escape===undefined||$.escape===null){$.escape='"'}else if(en.isBuffer($.escape)){$.escape=$.escape.toString()}else if(typeof $.escape!=="string"){return Error(`Invalid Option: escape must be a buffer or a string, got ${JSON.stringify($.escape)}`)}if($.escape.length>1){return Error(`Invalid Option: escape must be one character, got ${$.escape.length} characters`)}if($.header===undefined||$.header===null){$.header=false}else{}$.columns=this.normalize_columns($.columns);if($.quoted===undefined||$.quoted===null){$.quoted=false}else{}if($.cast===undefined||$.cast===null){$.cast={}}else{}if($.cast.bigint===undefined||$.cast.bigint===null){$.cast.bigint=$=>""+$}if($.cast.boolean===undefined||$.cast.boolean===null){$.cast.boolean=$=>$?"1":""}if($.cast.date===undefined||$.cast.date===null){$.cast.date=$=>""+$.getTime()}if($.cast.number===undefined||$.cast.number===null){$.cast.number=$=>""+$}if($.cast.object===undefined||$.cast.object===null){$.cast.object=$=>JSON.stringify($)}if($.cast.string===undefined||$.cast.string===null){$.cast.string=function($){return $}}if($.record_delimiter===undefined||$.record_delimiter===null){$.record_delimiter="\n"}else if(en.isBuffer($.record_delimiter)){$.record_delimiter=$.record_delimiter.toString()}else if(typeof $.record_delimiter!=="string"){return Error(`Invalid Option: record_delimiter must be a buffer or a string, got ${JSON.stringify($.record_delimiter)}`)}}_transform($,ee,et){if(this.state.stop===true){return}if(!Array.isArray($)&&typeof $!=="object"){this.state.stop=true;return et(Error(`Invalid Record: expect an array or an object, got ${JSON.stringify($)}`))}if(this.info.records===0){if(Array.isArray($)){if(this.options.header===true&&!this.options.columns){this.state.stop=true;return et(Error("Undiscoverable Columns: header option requires column option or object records"))}}else if(this.options.columns===undefined||this.options.columns===null){this.options.columns=this.normalize_columns(Object.keys($))}}if(this.info.records===0){this.bom();this.headers()}try{this.emit("record",$,this.info.records)}catch($){this.state.stop=true;return this.emit("error",$)}let en;if(this.options.eof){en=this.stringify($);if(en===undefined){return}else{en=en+this.options.record_delimiter}}else{en=this.stringify($);if(en===undefined){return}else{if(this.options.header||this.info.records){en=this.options.record_delimiter+en}}}this.info.records++;this.push(en);et()}_flush($){if(this.info.records===0){this.bom();this.headers()}$()}stringify($,ee=false){if(typeof $!=="object"){return $}const{columns:et,header:en}=this.options;const ei=[];if(Array.isArray($)){if(et){$.splice(et.length)}for(let et=0;et<$.length;et++){const en=$[et];const[eo,es]=this.__cast(en,{index:et,column:et,records:this.info.records,header:ee});if(eo){this.emit("error",eo);return}ei[et]=[es,en]}}else{if(et){for(let en=0;en<et.length;en++){const eo=eA($,et[en].key);const[es,eu]=this.__cast(eo,{index:en,column:et[en].key,records:this.info.records,header:ee});if(es){this.emit("error",es);return}ei[en]=[eu,eo]}}else{for(let en of $){const eo=$[en];const[es,eu]=this.__cast(eo,{index:i,column:et[i].key,records:this.info.records,header:ee});if(es){this.emit("error",es);return}ei.push([eu,eo])}}}let eo="";for(let $=0;$<ei.length;$++){let ee,et;let[en,es]=ei[$];if(typeof en==="string"){ee=this.options}else if(ef(en)){ee=en;en=ee.value;delete ee.value;if(typeof en!=="string"&&en!==undefined&&en!==null){this.emit("error",Error(`Invalid Casting Value: returned value must return a string, null or undefined, got ${JSON.stringify(en)}`));return}ee={...this.options,...ee};if(et=this.normalize(ee)){this.emit("error",et);return}}else if(en===undefined||en===null){ee=this.options}else{this.emit("error",Error(`Invalid Casting Value: returned value must return a string, an object, null or undefined, got ${JSON.stringify(en)}`));return}const{delimiter:eu,escape:el,quote:ed,quoted:ep,quoted_empty:eh,quoted_string:ey,quoted_match:eg,record_delimiter:em}=ee;if(en){if(typeof en!=="string"){this.emit("error",Error(`Formatter must return a string, null or undefined, got ${JSON.stringify(en)}`));return null}const $=eu.length&&en.indexOf(eu)>=0;const ee=ed!==""&&en.indexOf(ed)>=0;const et=en.indexOf(el)>=0&&el!==ed;const ei=en.indexOf(em)>=0;const ef=ey&&typeof es==="string";let eh=eg&&eg.filter($=>{if(typeof $==="string"){return en.indexOf($)!==-1}else{return $.test(en)}});eh=eh&&eh.length>0;const e_=ee===true||$||ei||ep||ef||eh;if(e_===true&&et===true){const $=el==="\\"?new RegExp(el+el,"g"):new RegExp(el,"g");en=en.replace($,el+el)}if(ee===true){const $=new RegExp(ed,"g");en=en.replace($,el+ed)}if(e_===true){en=ed+en+ed}eo+=en}else if(eh===true||es===""&&ey===true&&eh!==false){eo+=ed+ed}if($!==ei.length-1){eo+=eu}}return eo}bom(){if(this.options.bom!==true){return}this.push(eo)}headers(){if(this.options.header===false){return}if(this.options.columns===undefined){return}let $=this.options.columns.map($=>$.header);if(this.options.eof){$=this.stringify($,true)+this.options.record_delimiter}else{$=this.stringify($)}this.push($)}__cast($,ee){const et=typeof $;try{if(et==="string"){return[undefined,this.options.cast.string($,ee)]}else if(et==="bigint"){return[undefined,this.options.cast.bigint($,ee)]}else if(et==="number"){return[undefined,this.options.cast.number($,ee)]}else if(et==="boolean"){return[undefined,this.options.cast.boolean($,ee)]}else if($ instanceof Date){return[undefined,this.options.cast.date($,ee)]}else if(et==="object"&&$!==null){return[undefined,this.options.cast.object($,ee)]}else{return[undefined,$,$]}}catch($){return[$]}}normalize_columns($){if($===undefined||$===null){return undefined}if(typeof $!=="object"){throw Error('Invalid option "columns": expect an array or an object')}if(!Array.isArray($)){const ee=[];for(let et in $){ee.push({key:et,header:$[et]})}$=ee}else{const ee=[];for(let et of $){if(typeof et==="string"){ee.push({key:et,header:et})}else if(typeof et==="object"&&et!==undefined&&!Array.isArray(et)){if(!et.key){throw Error('Invalid column definition: property "key" is required')}if(et.header===undefined){et.header=et.key}ee.push(et)}else{throw Error("Invalid column definition: expect a string or an object")}}$=ee}return $}}const eu=function(){let $,ee,et;for(let en in arguments){const ei=arguments[en];const eo=typeof ei;if($===undefined&&Array.isArray(ei)){$=ei}else if(ee===undefined&&ef(ei)){ee=ei}else if(et===undefined&&eo==="function"){et=ei}else{throw new el("CSV_INVALID_ARGUMENT",["Invalid argument:",`got ${JSON.stringify(ei)} at index ${en}`])}}const en=new es(ee);if(et){const $=[];en.on("readable",function(){let ee;while((ee=this.read())!==null){$.push(ee)}});en.on("error",function($){et($)});en.on("end",function(){et(undefined,$.join(""))})}if($!==undefined){if(typeof setImmediate==="function"){setImmediate(function(){for(let ee of $){en.write(ee)}en.end()})}else{for(let ee of $){en.write(ee)}en.end()}}return en};class el extends Error{constructor($,ee,...et){if(Array.isArray(ee))ee=ee.join(" ");super(ee);if(Error.captureStackTrace!==undefined){Error.captureStackTrace(this,el)}this.code=$;for(const $ of et){for(const ee in $){const et=$[ee];this[ee]=en.isBuffer(et)?et.toString():et==null?et:JSON.parse(JSON.stringify(et))}}}}eu.Stringifier=es;eu.CsvError=el;$.exports=eu;const ef=function($){return typeof $==="object"&&$!==null&&!Array.isArray($)};const ed=function($){return $.replace(/([A-Z])/g,function($,ee){return"_"+ee.toLowerCase()})};const ep=".".charCodeAt(0);const eh=/\\(\\)?/g;const ey=RegExp("[^.[\\]]+"+"|"+"\\[(?:"+"([^\"'][^[]*)"+"|"+"([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2"+")\\]"+"|"+"(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))","g");const eg=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;const em=/^\w*$/;const e_=function($){if(!$)$===undefined?"[object Undefined]":"[object Null]";return Object.prototype.toString.call($)};const ew=function($,ee){if(Array.isArray($)){return false}const et=typeof $;if(et==="number"||et==="symbol"||et==="boolean"||!$||eE($)){return true}return em.test($)||!eg.test($)||ee!=null&&$ in Object(ee)};const eE=function($){const ee=typeof $;return ee==="symbol"||ee==="object"&&$&&e_($)==="[object Symbol]"};const eS=function($){const ee=[];if($.charCodeAt(0)===ep){ee.push("")}$.replace(ey,function($,et,en,ei){let eo=$;if(en){eo=ei.replace(eh,"$1")}else if(et){eo=et.trim()}ee.push(eo)});return ee};const eT=function($,ee){if(Array.isArray($)){return $}else{return ew($,ee)?[$]:eS($)}};const eO=function($){if(typeof $==="string"||eE($))return $;const ee=`${$}`;return ee=="0"&&1/$==-INFINITY?"-0":ee};const eA=function($,ee){ee=eT(ee,$);let et=0;const en=ee.length;while($!=null&&et<en){$=$[eO(ee[et++])]}return et&&et===en?$:undefined}},7565:($,ee,et)=>{var en=et(8764)["Buffer"];const ei=et(1884);const{StringDecoder:eo}=et(2553);$.exports=function($,ee={}){const et=[];if(en.isBuffer($)){const ee=new eo;$=ee.write($)}function es($){if($){et.push($.toString())}}let eu=new ei.Stringifier(ee);eu.on("data",es);for(let ee of $){eu.write(ee)}eu.end();eu.off("data",es);return et.join("")}},251:($,ee,et)=>{"use strict";var en=et(3533);var ei=et(1924);var eo=et(2847);var es=et(210);var eu=et(3216);var el=et(7478);var ef=et(609);var ed=et(2584);var ep=et(5826);var eh=et(635);var ey=et(8923);var eg=et(8420);var em=et(2579);var e_=et(2215);var ew=et(3679);var eE=et(3483);var eS=et(6430);var eT=et(6894);var eO=ei("SharedArrayBuffer.prototype.byteLength",true);var eA=ei("Date.prototype.getTime");var eI=Object.getPrototypeOf;var eN=ei("Object.prototype.toString");var eD=es("%Set%",true);var eR=ei("Map.prototype.has",true);var eC=ei("Map.prototype.get",true);var ek=ei("Map.prototype.size",true);var eM=ei("Set.prototype.add",true);var eL=ei("Set.prototype.delete",true);var eP=ei("Set.prototype.has",true);var eF=ei("Set.prototype.size",true);function eB($,ee,et,en){var ei=eu($);var eo;while((eo=ei.next())&&!eo.done){if(ez(ee,eo.value,et,en)){eL($,eo.value);return true}}return false}function eU($){if(typeof $==="undefined"){return null}if(typeof $==="object"){return void 0}if(typeof $==="symbol"){return false}if(typeof $==="string"||typeof $==="number"){return+$===+$}return true}function ej($,ee,et,ei,eo,es){var eu=eU(et);if(eu!=null){return eu}var el=eC(ee,eu);var ef=en({},eo,{strict:false});if(typeof el==="undefined"&&!eR(ee,eu)||!ez(ei,el,ef,es)){return false}return!eR($,eu)&&ez(ei,el,ef,es)}function eW($,ee,et){var en=eU(et);if(en!=null){return en}return eP(ee,en)&&!eP($,en)}function eH($,ee,et,en,ei,eo){var es=eu($);var el;var ef;while((el=es.next())&&!el.done){ef=el.value;if(ez(et,ef,ei,eo)&&ez(en,eC(ee,ef),ei,eo)){eL($,ef);return true}}return false}function ez($,ee,et,en){var ei=et||{};if(ei.strict?ef($,ee):$===ee){return true}var eo=ew($);var es=ew(ee);if(eo!==es){return false}if(!$||!ee||typeof $!=="object"&&typeof ee!=="object"){return ei.strict?ef($,ee):$==ee}var eu=en.has($);var el=en.has(ee);var ed;if(eu&&el){if(en.get($)===en.get(ee)){return true}}else{ed={}}if(!eu){en.set($,ed)}if(!el){en.set(ee,ed)}return eG($,ee,ei,en)}function eV($){if(!$||typeof $!=="object"||typeof $.length!=="number"){return false}if(typeof $.copy!=="function"||typeof $.slice!=="function"){return false}if($.length>0&&typeof $[0]!=="number"){return false}return!!($.constructor&&$.constructor.isBuffer&&$.constructor.isBuffer($))}function e$($,ee,et,en){if(eF($)!==eF(ee)){return false}var ei=eu($);var eo=eu(ee);var es;var el;var ef;while((es=ei.next())&&!es.done){if(es.value&&typeof es.value==="object"){if(!ef){ef=new eD}eM(ef,es.value)}else if(!eP(ee,es.value)){if(et.strict){return false}if(!eW($,ee,es.value)){return false}if(!ef){ef=new eD}eM(ef,es.value)}}if(ef){while((el=eo.next())&&!el.done){if(el.value&&typeof el.value==="object"){if(!eB(ef,el.value,et.strict,en)){return false}}else if(!et.strict&&!eP($,el.value)&&!eB(ef,el.value,et.strict,en)){return false}}return eF(ef)===0}return true}function eq($,ee,et,ei){if(ek($)!==ek(ee)){return false}var eo=eu($);var es=eu(ee);var el;var ef;var ed;var ep;var eh;var ey;while((el=eo.next())&&!el.done){ep=el.value[0];eh=el.value[1];if(ep&&typeof ep==="object"){if(!ed){ed=new eD}eM(ed,ep)}else{ey=eC(ee,ep);if(typeof ey==="undefined"&&!eR(ee,ep)||!ez(eh,ey,et,ei)){if(et.strict){return false}if(!ej($,ee,ep,eh,et,ei)){return false}if(!ed){ed=new eD}eM(ed,ep)}}}if(ed){while((ef=es.next())&&!ef.done){ep=ef.value[0];ey=ef.value[1];if(ep&&typeof ep==="object"){if(!eH(ed,$,ep,ey,et,ei)){return false}}else if(!et.strict&&(!$.has(ep)||!ez(eC($,ep),ey,et,ei))&&!eH(ed,$,ep,ey,en({},et,{strict:false}),ei)){return false}}return eF(ed)===0}return true}function eG($,ee,et,en){var ei,es;if(typeof $!==typeof ee){return false}if($==null||ee==null){return false}if(eN($)!==eN(ee)){return false}if(ed($)!==ed(ee)){return false}var eu=ep($);var el=ep(ee);if(eu!==el){return false}var ef=$ instanceof Error;var ew=ee instanceof Error;if(ef!==ew){return false}if(ef||ew){if($.name!==ee.name||$.message!==ee.message){return false}}var eD=eg($);var eR=eg(ee);if(eD!==eR){return false}if((eD||eR)&&($.source!==ee.source||eo($)!==eo(ee))){return false}var eC=ey($);var ek=ey(ee);if(eC!==ek){return false}if(eC||ek){if(eA($)!==eA(ee)){return false}}if(et.strict&&eI&&eI($)!==eI(ee)){return false}var eM=eS($);var eL=eS(ee);if((eM||eL)&&eM!==eL){return false}var eP=eV($);var eF=eV(ee);if(eP!==eF){return false}if(eP||eF){if($.length!==ee.length){return false}for(ei=0;ei<$.length;ei++){if($[ei]!==ee[ei]){return false}}return true}var eB=eh($);var eU=eh(ee);if(eB!==eU){return false}if(eB||eU){if(eT($)!==eT(ee)){return false}return typeof Uint8Array==="function"&&ez(new Uint8Array($),new Uint8Array(ee),et,en)}var ej=em($);var eW=em(ee);if(ej!==eW){return false}if(ej||eW){if(eO($)!==eO(ee)){return false}return typeof Uint8Array==="function"&&ez(new Uint8Array($),new Uint8Array(ee),et,en)}if(typeof $!==typeof ee){return false}var eH=e_($);var eG=e_(ee);if(eH.length!==eG.length){return false}eH.sort();eG.sort();for(ei=eH.length-1;ei>=0;ei--){if(eH[ei]!=eG[ei]){return false}}for(ei=eH.length-1;ei>=0;ei--){es=eH[ei];if(!ez($[es],ee[es],et,en)){return false}}var eY=eE($);var eK=eE(ee);if(eY!==eK){return false}if(eY==="Set"||eK==="Set"){return e$($,ee,et,en)}if(eY==="Map"){return eq($,ee,et,en)}return true}$.exports=function $($,ee,et){return ez($,ee,et,el())}},4289:($,ee,et)=>{"use strict";var en=et(2215);var ei=typeof Symbol==="function"&&typeof Symbol("foo")==="symbol";var eo=Object.prototype.toString;var es=Array.prototype.concat;var eu=Object.defineProperty;var el=function($){return typeof $==="function"&&eo.call($)==="[object Function]"};var ef=et(1044)();var ed=eu&&ef;var ep=function($,ee,et,en){if(ee in $){if(en===true){if($[ee]===et){return}}else if(!el(en)||!en()){return}}if(ed){eu($,ee,{configurable:true,enumerable:false,value:et,writable:true})}else{$[ee]=et}};var eh=function($,ee){var et=arguments.length>2?arguments[2]:{};var eo=en(ee);if(ei){eo=es.call(eo,Object.getOwnPropertySymbols(ee))}for(var eu=0;eu<eo.length;eu+=1){ep($,eo[eu],ee[eo[eu]],et[eo[eu]])}};eh.supportsDescriptors=!!ed;$.exports=eh},8091:$=>{"use strict";function ee($,ee){if($===undefined||$===null){throw new TypeError("Cannot convert first argument to object")}var et=Object($);for(var en=1;en<arguments.length;en++){var ei=arguments[en];if(ei===undefined||ei===null){continue}var eo=Object.keys(Object(ei));for(var es=0,eu=eo.length;es<eu;es++){var el=eo[es];var ef=Object.getOwnPropertyDescriptor(ei,el);if(ef!==undefined&&ef.enumerable){et[el]=ei[el]}}}return et}function et(){if(!Object.assign){Object.defineProperty(Object,"assign",{enumerable:false,configurable:true,writable:true,value:ee})}}$.exports={assign:ee,polyfill:et}},7187:$=>{"use strict";var ee=typeof Reflect==="object"?Reflect:null;var et=ee&&typeof ee.apply==="function"?ee.apply:function $($,ee,et){return Function.prototype.apply.call($,ee,et)};var en;if(ee&&typeof ee.ownKeys==="function"){en=ee.ownKeys}else if(Object.getOwnPropertySymbols){en=function $($){return Object.getOwnPropertyNames($).concat(Object.getOwnPropertySymbols($))}}else{en=function $($){return Object.getOwnPropertyNames($)}}function ei($){if(console&&console.warn)console.warn($)}var eo=Number.isNaN||function $($){return $!==$};function es(){es.init.call(this)}$.exports=es;$.exports.once=eE;es.EventEmitter=es;es.prototype._events=undefined;es.prototype._eventsCount=0;es.prototype._maxListeners=undefined;var eu=10;function el($){if(typeof $!=="function"){throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof $)}}Object.defineProperty(es,"defaultMaxListeners",{enumerable:true,get:function(){return eu},set:function($){if(typeof $!=="number"||$<0||eo($)){throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+$+".")}eu=$}});es.init=function(){if(this._events===undefined||this._events===Object.getPrototypeOf(this)._events){this._events=Object.create(null);this._eventsCount=0}this._maxListeners=this._maxListeners||undefined};es.prototype.setMaxListeners=function $($){if(typeof $!=="number"||$<0||eo($)){throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+$+".")}this._maxListeners=$;return this};function ef($){if($._maxListeners===undefined)return es.defaultMaxListeners;return $._maxListeners}es.prototype.getMaxListeners=function $(){return ef(this)};es.prototype.emit=function $($){var ee=[];for(var en=1;en<arguments.length;en++)ee.push(arguments[en]);var ei=$==="error";var eo=this._events;if(eo!==undefined)ei=ei&&eo.error===undefined;else if(!ei)return false;if(ei){var es;if(ee.length>0)es=ee[0];if(es instanceof Error){throw es}var eu=new Error("Unhandled error."+(es?" ("+es.message+")":""));eu.context=es;throw eu}var el=eo[$];if(el===undefined)return false;if(typeof el==="function"){et(el,this,ee)}else{var ef=el.length;var ed=em(el,ef);for(var en=0;en<ef;++en)et(ed[en],this,ee)}return true};function ed($,ee,et,en){var eo;var es;var eu;el(et);es=$._events;if(es===undefined){es=$._events=Object.create(null);$._eventsCount=0}else{if(es.newListener!==undefined){$.emit("newListener",ee,et.listener?et.listener:et);es=$._events}eu=es[ee]}if(eu===undefined){eu=es[ee]=et;++$._eventsCount}else{if(typeof eu==="function"){eu=es[ee]=en?[et,eu]:[eu,et]}else if(en){eu.unshift(et)}else{eu.push(et)}eo=ef($);if(eo>0&&eu.length>eo&&!eu.warned){eu.warned=true;var ed=new Error("Possible EventEmitter memory leak detected. "+eu.length+" "+String(ee)+" listeners "+"added. Use emitter.setMaxListeners() to "+"increase limit");ed.name="MaxListenersExceededWarning";ed.emitter=$;ed.type=ee;ed.count=eu.length;ei(ed)}}return $}es.prototype.addListener=function $($,ee){return ed(this,$,ee,false)};es.prototype.on=es.prototype.addListener;es.prototype.prependListener=function $($,ee){return ed(this,$,ee,true)};function ep(){if(!this.fired){this.target.removeListener(this.type,this.wrapFn);this.fired=true;if(arguments.length===0)return this.listener.call(this.target);return this.listener.apply(this.target,arguments)}}function eh($,ee,et){var en={fired:false,wrapFn:undefined,target:$,type:ee,listener:et};var ei=ep.bind(en);ei.listener=et;en.wrapFn=ei;return ei}es.prototype.once=function $($,ee){el(ee);this.on($,eh(this,$,ee));return this};es.prototype.prependOnceListener=function $($,ee){el(ee);this.prependListener($,eh(this,$,ee));return this};es.prototype.removeListener=function $($,ee){var et,en,ei,eo,es;el(ee);en=this._events;if(en===undefined)return this;et=en[$];if(et===undefined)return this;if(et===ee||et.listener===ee){if(--this._eventsCount===0)this._events=Object.create(null);else{delete en[$];if(en.removeListener)this.emit("removeListener",$,et.listener||ee)}}else if(typeof et!=="function"){ei=-1;for(eo=et.length-1;eo>=0;eo--){if(et[eo]===ee||et[eo].listener===ee){es=et[eo].listener;ei=eo;break}}if(ei<0)return this;if(ei===0)et.shift();else{e_(et,ei)}if(et.length===1)en[$]=et[0];if(en.removeListener!==undefined)this.emit("removeListener",$,es||ee)}return this};es.prototype.off=es.prototype.removeListener;es.prototype.removeAllListeners=function $($){var ee,et,en;et=this._events;if(et===undefined)return this;if(et.removeListener===undefined){if(arguments.length===0){this._events=Object.create(null);this._eventsCount=0}else if(et[$]!==undefined){if(--this._eventsCount===0)this._events=Object.create(null);else delete et[$]}return this}if(arguments.length===0){var ei=Object.keys(et);var eo;for(en=0;en<ei.length;++en){eo=ei[en];if(eo==="removeListener")continue;this.removeAllListeners(eo)}this.removeAllListeners("removeListener");this._events=Object.create(null);this._eventsCount=0;return this}ee=et[$];if(typeof ee==="function"){this.removeListener($,ee)}else if(ee!==undefined){for(en=ee.length-1;en>=0;en--){this.removeListener($,ee[en])}}return this};function ey($,ee,et){var en=$._events;if(en===undefined)return[];var ei=en[ee];if(ei===undefined)return[];if(typeof ei==="function")return et?[ei.listener||ei]:[ei];return et?ew(ei):em(ei,ei.length)}es.prototype.listeners=function $($){return ey(this,$,true)};es.prototype.rawListeners=function $($){return ey(this,$,false)};es.listenerCount=function($,ee){if(typeof $.listenerCount==="function"){return $.listenerCount(ee)}else{return eg.call($,ee)}};es.prototype.listenerCount=eg;function eg($){var ee=this._events;if(ee!==undefined){var et=ee[$];if(typeof et==="function"){return 1}else if(et!==undefined){return et.length}}return 0}es.prototype.eventNames=function $(){return this._eventsCount>0?en(this._events):[]};function em($,ee){var et=new Array(ee);for(var en=0;en<ee;++en)et[en]=$[en];return et}function e_($,ee){for(;ee+1<$.length;ee++)$[ee]=$[ee+1];$.pop()}function ew($){var ee=new Array($.length);for(var et=0;et<ee.length;++et){ee[et]=$[et].listener||$[et]}return ee}function eE($,ee){return new Promise(function(et,en){function ei(et){$.removeListener(ee,eo);en(et)}function eo(){if(typeof $.removeListener==="function"){$.removeListener("error",ei)}et([].slice.call(arguments))};eT($,ee,eo,{once:true});if(ee!=="error"){eS($,ei,{once:true})}})}function eS($,ee,et){if(typeof $.on==="function"){eT($,"error",ee,et)}}function eT($,ee,et,en){if(typeof $.on==="function"){if(en.once){$.once(ee,et)}else{$.on(ee,et)}}else if(typeof $.addEventListener==="function"){$.addEventListener(ee,function ei(eo){if(en.once){$.removeEventListener(ee,ei)}et(eo)})}else{throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof $)}}},4029:($,ee,et)=>{"use strict";var en=et(5320);var ei=Object.prototype.toString;var eo=Object.prototype.hasOwnProperty;var es=function $($,ee,et){for(var en=0,ei=$.length;en<ei;en++){if(eo.call($,en)){if(et==null){ee($[en],en,$)}else{ee.call(et,$[en],en,$)}}}};var eu=function $($,ee,et){for(var en=0,ei=$.length;en<ei;en++){if(et==null){ee($.charAt(en),en,$)}else{ee.call(et,$.charAt(en),en,$)}}};var el=function $($,ee,et){for(var en in $){if(eo.call($,en)){if(et==null){ee($[en],en,$)}else{ee.call(et,$[en],en,$)}}}};var ef=function $($,ee,et){if(!en(ee)){throw new TypeError("iterator must be a function")}var eo;if(arguments.length>=3){eo=et}if(ei.call($)==="[object Array]"){es($,ee,eo)}else if(typeof $==="string"){eu($,ee,eo)}else{el($,ee,eo)}};$.exports=ef},7648:$=>{"use strict";var ee="Function.prototype.bind called on incompatible ";var et=Array.prototype.slice;var en=Object.prototype.toString;var ei="[object Function]";$.exports=function $($){var eo=this;if(typeof eo!=="function"||en.call(eo)!==ei){throw new TypeError(ee+eo)}var es=et.call(arguments,1);var eu;var el=function(){if(this instanceof eu){var ee=eo.apply(this,es.concat(et.call(arguments)));if(Object(ee)===ee){return ee}return this}else{return eo.apply($,es.concat(et.call(arguments)))}};var ef=Math.max(0,eo.length-es.length);var ed=[];for(var ep=0;ep<ef;ep++){ed.push("$"+ep)}eu=Function("binder","return function ("+ed.join(",")+"){ return binder.apply(this,arguments); }")(el);if(eo.prototype){var eh=function $(){};eh.prototype=eo.prototype;eu.prototype=new eh;eh.prototype=null}return eu}},8612:($,ee,et)=>{"use strict";var en=et(7648);$.exports=Function.prototype.bind||en},5972:$=>{"use strict";var ee=function $(){return typeof(function $(){}).name==="string"};var et=Object.getOwnPropertyDescriptor;if(et){try{et([],"length")}catch($){et=null}}ee.functionsHaveConfigurableNames=function $(){if(!ee()||!et){return false}var $=et(function(){},"name");return!!$&&!!$.configurable};var en=Function.prototype.bind;ee.boundFunctionsHaveNames=function $(){return ee()&&typeof en==="function"&&(function $(){}).bind().name!==""};$.exports=ee},210:($,ee,et)=>{"use strict";var en;var ei=SyntaxError;var eo=Function;var es=TypeError;var eu=function($){try{return eo('"use strict"; return ('+$+").constructor;")()}catch($){}};var el=Object.getOwnPropertyDescriptor;if(el){try{el({},"")}catch($){el=null}}var ef=function(){throw new es};var ed=el?function(){try{arguments.callee;return ef}catch($){try{return el(arguments,"callee").get}catch($){return ef}}}():ef;var ep=et(1405)();var eh=et(8185)();var ey=Object.getPrototypeOf||(eh?function($){return $.__proto__}:null);var eg={};var em=typeof Uint8Array==="undefined"||!ey?en:ey(Uint8Array);var e_={"%AggregateError%":typeof AggregateError==="undefined"?en:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer==="undefined"?en:ArrayBuffer,"%ArrayIteratorPrototype%":ep&&ey?ey([][Symbol.iterator]()):en,"%AsyncFromSyncIteratorPrototype%":en,"%AsyncFunction%":eg,"%AsyncGenerator%":eg,"%AsyncGeneratorFunction%":eg,"%AsyncIteratorPrototype%":eg,"%Atomics%":typeof Atomics==="undefined"?en:Atomics,"%BigInt%":typeof BigInt==="undefined"?en:BigInt,"%BigInt64Array%":typeof BigInt64Array==="undefined"?en:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array==="undefined"?en:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView==="undefined"?en:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array==="undefined"?en:Float32Array,"%Float64Array%":typeof Float64Array==="undefined"?en:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry==="undefined"?en:FinalizationRegistry,"%Function%":eo,"%GeneratorFunction%":eg,"%Int8Array%":typeof Int8Array==="undefined"?en:Int8Array,"%Int16Array%":typeof Int16Array==="undefined"?en:Int16Array,"%Int32Array%":typeof Int32Array==="undefined"?en:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":ep&&ey?ey(ey([][Symbol.iterator]())):en,"%JSON%":typeof JSON==="object"?JSON:en,"%Map%":typeof Map==="undefined"?en:Map,"%MapIteratorPrototype%":typeof Map==="undefined"||!ep||!ey?en:ey(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise==="undefined"?en:Promise,"%Proxy%":typeof Proxy==="undefined"?en:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect==="undefined"?en:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set==="undefined"?en:Set,"%SetIteratorPrototype%":typeof Set==="undefined"||!ep||!ey?en:ey(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer==="undefined"?en:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":ep&&ey?ey(""[Symbol.iterator]()):en,"%Symbol%":ep?Symbol:en,"%SyntaxError%":ei,"%ThrowTypeError%":ed,"%TypedArray%":em,"%TypeError%":es,"%Uint8Array%":typeof Uint8Array==="undefined"?en:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray==="undefined"?en:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array==="undefined"?en:Uint16Array,"%Uint32Array%":typeof Uint32Array==="undefined"?en:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap==="undefined"?en:WeakMap,"%WeakRef%":typeof WeakRef==="undefined"?en:WeakRef,"%WeakSet%":typeof WeakSet==="undefined"?en:WeakSet};if(ey){try{null.error}catch($){var ew=ey(ey($));e_["%Error.prototype%"]=ew}}var eE=function $(ee){var et;if(ee==="%AsyncFunction%"){et=eu("async function () {}")}else if(ee==="%GeneratorFunction%"){et=eu("function* () {}")}else if(ee==="%AsyncGeneratorFunction%"){et=eu("async function* () {}")}else if(ee==="%AsyncGenerator%"){var en=$("%AsyncGeneratorFunction%");if(en){et=en.prototype}}else if(ee==="%AsyncIteratorPrototype%"){var ei=$("%AsyncGenerator%");if(ei&&ey){et=ey(ei.prototype)}}e_[ee]=et;return et};var eS={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]};var eT=et(8612);var eO=et(7642);var eA=eT.call(Function.call,Array.prototype.concat);var eI=eT.call(Function.apply,Array.prototype.splice);var eN=eT.call(Function.call,String.prototype.replace);var eD=eT.call(Function.call,String.prototype.slice);var eR=eT.call(Function.call,RegExp.prototype.exec);var eC=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;var ek=/\\(\\)?/g;var eM=function $($){var ee=eD($,0,1);var et=eD($,-1);if(ee==="%"&&et!=="%"){throw new ei("invalid intrinsic syntax, expected closing `%`")}else if(et==="%"&&ee!=="%"){throw new ei("invalid intrinsic syntax, expected opening `%`")}var en=[];eN($,eC,function($,ee,et,ei){en[en.length]=et?eN(ei,ek,"$1"):ee||$});return en};var eL=function $($,ee){var et=$;var en;if(eO(eS,et)){en=eS[et];et="%"+en[0]+"%"}if(eO(e_,et)){var eo=e_[et];if(eo===eg){eo=eE(et)}if(typeof eo==="undefined"&&!ee){throw new es("intrinsic "+$+" exists, but is not available. Please file an issue!")}return{alias:en,name:et,value:eo}}throw new ei("intrinsic "+$+" does not exist!")};$.exports=function $($,ee){if(typeof $!=="string"||$.length===0){throw new es("intrinsic name must be a non-empty string")}if(arguments.length>1&&typeof ee!=="boolean"){throw new es('"allowMissing" argument must be a boolean')}if(eR(/^%?[^%]*%?$/,$)===null){throw new ei("`%` may not be present anywhere but at the beginning and end of the intrinsic name")}var et=eM($);var eo=et.length>0?et[0]:"";var eu=eL("%"+eo+"%",ee);var ef=eu.name;var ed=eu.value;var ep=false;var eh=eu.alias;if(eh){eo=eh[0];eI(et,eA([0,1],eh))}for(var ey=1,eg=true;ey<et.length;ey+=1){var em=et[ey];var ew=eD(em,0,1);var eE=eD(em,-1);if((ew==='"'||ew==="'"||ew==="`"||eE==='"'||eE==="'"||eE==="`")&&ew!==eE){throw new ei("property names with quotes must have matching quotes")}if(em==="constructor"||!eg){ep=true}eo+="."+em;ef="%"+eo+"%";if(eO(e_,ef)){ed=e_[ef]}else if(ed!=null){if(!(em in ed)){if(!ee){throw new es("base intrinsic for "+$+" exists, but the property is not available.")}return void en}if(el&&ey+1>=et.length){var eS=el(ed,em);eg=!!eS;if(eg&&"get"in eS&&!("originalValue"in eS.get)){ed=eS.get}else{ed=ed[em]}}else{eg=eO(ed,em);ed=ed[em]}if(eg&&!ep){e_[ef]=ed}}}return ed}},3019:function(__unused_webpack_module,exports,__webpack_require__){var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function($,ee,et){$ instanceof String&&($=String($));for(var en=$.length,ei=0;ei<en;ei++){var eo=$[ei];if(ee.call(et,eo,ei,$))return{i:ei,v:eo}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function($,ee,et){$!=Array.prototype&&$!=Object.prototype&&($[ee]=et.value)};$jscomp.getGlobal=function($){return"undefined"!=typeof window&&window===$?$:"undefined"!=typeof __webpack_require__.g&&null!=__webpack_require__.g?__webpack_require__.g:$};$jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function($,ee,et,en){if(ee){et=$jscomp.global;$=$.split(".");for(en=0;en<$.length-1;en++){var ei=$[en];ei in et||(et[ei]={});et=et[ei]}$=$[$.length-1];en=et[$];ee=ee(en);ee!=en&&null!=ee&&$jscomp.defineProperty(et,$,{configurable:!0,writable:!0,value:ee})}};$jscomp.polyfill("Array.prototype.findIndex",function($){return $?$:function($,ee){return $jscomp.findInternal(this,$,ee).i}},"es6","es3");$jscomp.checkStringArgs=function($,ee,et){if(null==$)throw new TypeError("The 'this' value for String.prototype."+et+" must not be null or undefined");if(ee instanceof RegExp)throw new TypeError("First argument to String.prototype."+et+" must not be a regular expression");return $+""};$jscomp.polyfill("String.prototype.endsWith",function($){return $?$:function($,ee){var et=$jscomp.checkStringArgs(this,$,"endsWith");$+="";void 0===ee&&(ee=et.length);ee=Math.max(0,Math.min(ee|0,et.length));for(var en=$.length;0<en&&0<ee;)if(et[--ee]!=$[--en])return!1;return 0>=en}},"es6","es3");$jscomp.polyfill("Array.prototype.find",function($){return $?$:function($,ee){return $jscomp.findInternal(this,$,ee).v}},"es6","es3");$jscomp.polyfill("String.prototype.startsWith",function($){return $?$:function($,ee){var et=$jscomp.checkStringArgs(this,$,"startsWith");$+="";var en=et.length,ei=$.length;ee=Math.max(0,Math.min(ee|0,et.length));for(var eo=0;eo<ei&&ee<en;)if(et[ee++]!=$[eo++])return!1;return eo>=ei}},"es6","es3");$jscomp.polyfill("String.prototype.repeat",function($){return $?$:function($){var ee=$jscomp.checkStringArgs(this,null,"repeat");if(0>$||1342177279<$)throw new RangeError("Invalid count value");$|=0;for(var et="";$;)if($&1&&(et+=ee),$>>>=1)ee+=ee;return et}},"es6","es3");var COMPILED=!0,goog=goog||{};goog.global=this||self;goog.exportPath_=function($,ee,et){$=$.split(".");et=et||goog.global;$[0]in et||"undefined"==typeof et.execScript||et.execScript("var "+$[0]);for(var en;$.length&&(en=$.shift());)$.length||void 0===ee?et=et[en]&&et[en]!==Object.prototype[en]?et[en]:et[en]={}:et[en]=ee};goog.define=function($,ee){if(!COMPILED){var et=goog.global.CLOSURE_UNCOMPILED_DEFINES,en=goog.global.CLOSURE_DEFINES;et&&void 0===et.nodeType&&Object.prototype.hasOwnProperty.call(et,$)?ee=et[$]:en&&void 0===en.nodeType&&Object.prototype.hasOwnProperty.call(en,$)&&(ee=en[$])}return ee};goog.FEATURESET_YEAR=2012;goog.DEBUG=!0;goog.LOCALE="en";goog.TRUSTED_SITE=!0;goog.STRICT_MODE_COMPATIBLE=!1;goog.DISALLOW_TEST_ONLY_CODE=COMPILED&&!goog.DEBUG;goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING=!1;goog.provide=function($){if(goog.isInModuleLoader_())throw Error("goog.provide cannot be used within a module.");if(!COMPILED&&goog.isProvided_($))throw Error('Namespace "'+$+'" already declared.');goog.constructNamespace_($)};goog.constructNamespace_=function($,ee){if(!COMPILED){delete goog.implicitNamespaces_[$];for(var et=$;(et=et.substring(0,et.lastIndexOf(".")))&&!goog.getObjectByName(et);)goog.implicitNamespaces_[et]=!0}goog.exportPath_($,ee)};goog.getScriptNonce=function($){if($&&$!=goog.global)return goog.getScriptNonce_($.document);null===goog.cspNonce_&&(goog.cspNonce_=goog.getScriptNonce_(goog.global.document));return goog.cspNonce_};goog.NONCE_PATTERN_=/^[\w+/_-]+[=]{0,2}$/;goog.cspNonce_=null;goog.getScriptNonce_=function($){return($=$.querySelector&&$.querySelector("script[nonce]"))&&($=$.nonce||$.getAttribute("nonce"))&&goog.NONCE_PATTERN_.test($)?$:""};goog.VALID_MODULE_RE_=/^[a-zA-Z_$][a-zA-Z0-9._$]*$/;goog.module=function($){if("string"!==typeof $||!$||-1==$.search(goog.VALID_MODULE_RE_))throw Error("Invalid module identifier");if(!goog.isInGoogModuleLoader_())throw Error("Module "+$+" has been loaded incorrectly. Note, modules cannot be loaded as normal scripts. They require some kind of pre-processing step. You're likely trying to load a module via a script tag or as a part of a concatenated bundle without rewriting the module. For more info see: https://github.com/google/closure-library/wiki/goog.module:-an-ES6-module-like-alternative-to-goog.provide.");if(goog.moduleLoaderState_.moduleName)throw Error("goog.module may only be called once per module.");goog.moduleLoaderState_.moduleName=$;if(!COMPILED){if(goog.isProvided_($))throw Error('Namespace "'+$+'" already declared.');delete goog.implicitNamespaces_[$]}};goog.module.get=function($){return goog.module.getInternal_($)};goog.module.getInternal_=function($){if(!COMPILED){if($ in goog.loadedModules_)return goog.loadedModules_[$].exports;if(!goog.implicitNamespaces_[$])return $=goog.getObjectByName($),null!=$?$:null}return null};goog.ModuleType={ES6:"es6",GOOG:"goog"};goog.moduleLoaderState_=null;goog.isInModuleLoader_=function(){return goog.isInGoogModuleLoader_()||goog.isInEs6ModuleLoader_()};goog.isInGoogModuleLoader_=function(){return!!goog.moduleLoaderState_&&goog.moduleLoaderState_.type==goog.ModuleType.GOOG};goog.isInEs6ModuleLoader_=function(){if(goog.moduleLoaderState_&&goog.moduleLoaderState_.type==goog.ModuleType.ES6)return!0;var $=goog.global.$jscomp;return $?"function"!=typeof $.getCurrentModulePath?!1:!!$.getCurrentModulePath():!1};goog.module.declareLegacyNamespace=function(){if(!COMPILED&&!goog.isInGoogModuleLoader_())throw Error("goog.module.declareLegacyNamespace must be called from within a goog.module");if(!COMPILED&&!goog.moduleLoaderState_.moduleName)throw Error("goog.module must be called prior to goog.module.declareLegacyNamespace.");goog.moduleLoaderState_.declareLegacyNamespace=!0};goog.declareModuleId=function($){if(!COMPILED){if(!goog.isInEs6ModuleLoader_())throw Error("goog.declareModuleId may only be called from within an ES6 module");if(goog.moduleLoaderState_&&goog.moduleLoaderState_.moduleName)throw Error("goog.declareModuleId may only be called once per module.");if($ in goog.loadedModules_)throw Error('Module with namespace "'+$+'" already exists.')}if(goog.moduleLoaderState_)goog.moduleLoaderState_.moduleName=$;else{var ee=goog.global.$jscomp;if(!ee||"function"!=typeof ee.getCurrentModulePath)throw Error('Module with namespace "'+$+'" has been loaded incorrectly.');ee=ee.require(ee.getCurrentModulePath());goog.loadedModules_[$]={exports:ee,type:goog.ModuleType.ES6,moduleId:$}}};goog.setTestOnly=function($){if(goog.DISALLOW_TEST_ONLY_CODE)throw $=$||"",Error("Importing test-only code into non-debug environment"+($?": "+$:"."))};goog.forwardDeclare=function($){};COMPILED||(goog.isProvided_=function($){return $ in goog.loadedModules_||!goog.implicitNamespaces_[$]&&null!=goog.getObjectByName($)},goog.implicitNamespaces_={"goog.module":!0});goog.getObjectByName=function($,ee){$=$.split(".");ee=ee||goog.global;for(var et=0;et<$.length;et++)if(ee=ee[$[et]],null==ee)return null;return ee};goog.globalize=function($,ee){ee=ee||goog.global;for(var et in $)ee[et]=$[et]};goog.addDependency=function($,ee,et,en){!COMPILED&&goog.DEPENDENCIES_ENABLED&&goog.debugLoader_.addDependency($,ee,et,en)};goog.ENABLE_DEBUG_LOADER=!0;goog.logToConsole_=function($){goog.global.console&&goog.global.console.error($)};goog.require=function($){if(!COMPILED){goog.ENABLE_DEBUG_LOADER&&goog.debugLoader_.requested($);if(goog.isProvided_($)){if(goog.isInModuleLoader_())return goog.module.getInternal_($)}else if(goog.ENABLE_DEBUG_LOADER){var ee=goog.moduleLoaderState_;goog.moduleLoaderState_=null;try{goog.debugLoader_.load_($)}finally{goog.moduleLoaderState_=ee}}return null}};goog.requireType=function($){return{}};goog.basePath="";goog.nullFunction=function(){};goog.abstractMethod=function(){throw Error("unimplemented abstract method")};goog.addSingletonGetter=function($){$.instance_=void 0;$.getInstance=function(){if($.instance_)return $.instance_;goog.DEBUG&&(goog.instantiatedSingletons_[goog.instantiatedSingletons_.length]=$);return $.instance_=new $}};goog.instantiatedSingletons_=[];goog.LOAD_MODULE_USING_EVAL=!0;goog.SEAL_MODULE_EXPORTS=goog.DEBUG;goog.loadedModules_={};goog.DEPENDENCIES_ENABLED=!COMPILED&&goog.ENABLE_DEBUG_LOADER;goog.TRANSPILE="detect";goog.ASSUME_ES_MODULES_TRANSPILED=!1;goog.TRANSPILE_TO_LANGUAGE="";goog.TRANSPILER="transpile.js";goog.hasBadLetScoping=null;goog.useSafari10Workaround=function(){if(null==goog.hasBadLetScoping){try{var a=!eval('"use strict";let x = 1; function f() { return typeof x; };f() == "number";')}catch(b){a=!1}goog.hasBadLetScoping=a}return goog.hasBadLetScoping};goog.workaroundSafari10EvalBug=function($){return"(function(){"+$+"\n;})();\n"};goog.loadModule=function($){var ee=goog.moduleLoaderState_;try{goog.moduleLoaderState_={moduleName:"",declareLegacyNamespace:!1,type:goog.ModuleType.GOOG};if(goog.isFunction($))var et=$.call(void 0,{});else if("string"===typeof $)goog.useSafari10Workaround()&&($=goog.workaroundSafari10EvalBug($)),et=goog.loadModuleFromSource_.call(void 0,$);else throw Error("Invalid module definition");var en=goog.moduleLoaderState_.moduleName;if("string"===typeof en&&en)goog.moduleLoaderState_.declareLegacyNamespace?goog.constructNamespace_(en,et):goog.SEAL_MODULE_EXPORTS&&Object.seal&&"object"==typeof et&&null!=et&&Object.seal(et),goog.loadedModules_[en]={exports:et,type:goog.ModuleType.GOOG,moduleId:goog.moduleLoaderState_.moduleName};else throw Error('Invalid module name "'+en+'"')}finally{goog.moduleLoaderState_=ee}};goog.loadModuleFromSource_=function(a){eval(a);return{}};goog.normalizePath_=function($){$=$.split("/");for(var ee=0;ee<$.length;)"."==$[ee]?$.splice(ee,1):ee&&".."==$[ee]&&$[ee-1]&&".."!=$[ee-1]?$.splice(--ee,2):ee++;return $.join("/")};goog.loadFileSync_=function($){if(goog.global.CLOSURE_LOAD_FILE_SYNC)return goog.global.CLOSURE_LOAD_FILE_SYNC($);try{var ee=new goog.global.XMLHttpRequest;ee.open("get",$,!1);ee.send();return 0==ee.status||200==ee.status?ee.responseText:null}catch($){return null}};goog.transpile_=function($,ee,et){var en=goog.global.$jscomp;en||(goog.global.$jscomp=en={});var ei=en.transpile;if(!ei){var eo=goog.basePath+goog.TRANSPILER,es=goog.loadFileSync_(eo);if(es){(function(){(0,eval)(es+"\n//# sourceURL="+eo)}).call(goog.global);if(goog.global.$gwtExport&&goog.global.$gwtExport.$jscomp&&!goog.global.$gwtExport.$jscomp.transpile)throw Error('The transpiler did not properly export the "transpile" method. $gwtExport: '+JSON.stringify(goog.global.$gwtExport));goog.global.$jscomp.transpile=goog.global.$gwtExport.$jscomp.transpile;en=goog.global.$jscomp;ei=en.transpile}}ei||(ei=en.transpile=function($,ee){goog.logToConsole_(ee+" requires transpilation but no transpiler was found.");return $});return ei($,ee,et)};goog.typeOf=function($){var ee=typeof $;if("object"==ee)if($){if($ instanceof Array)return"array";if($ instanceof Object)return ee;var et=Object.prototype.toString.call($);if("[object Window]"==et)return"object";if("[object Array]"==et||"number"==typeof $.length&&"undefined"!=typeof $.splice&&"undefined"!=typeof $.propertyIsEnumerable&&!$.propertyIsEnumerable("splice"))return"array";if("[object Function]"==et||"undefined"!=typeof $.call&&"undefined"!=typeof $.propertyIsEnumerable&&!$.propertyIsEnumerable("call"))return"function"}else return"null";else if("function"==ee&&"undefined"==typeof $.call)return"object";return ee};goog.isArray=function($){return"array"==goog.typeOf($)};goog.isArrayLike=function($){var ee=goog.typeOf($);return"array"==ee||"object"==ee&&"number"==typeof $.length};goog.isDateLike=function($){return goog.isObject($)&&"function"==typeof $.getFullYear};goog.isFunction=function($){return"function"==goog.typeOf($)};goog.isObject=function($){var ee=typeof $;return"object"==ee&&null!=$||"function"==ee};goog.getUid=function($){return Object.prototype.hasOwnProperty.call($,goog.UID_PROPERTY_)&&$[goog.UID_PROPERTY_]||($[goog.UID_PROPERTY_]=++goog.uidCounter_)};goog.hasUid=function($){return!!$[goog.UID_PROPERTY_]};goog.removeUid=function($){null!==$&&"removeAttribute"in $&&$.removeAttribute(goog.UID_PROPERTY_);try{delete $[goog.UID_PROPERTY_]}catch($){}};goog.UID_PROPERTY_="closure_uid_"+(1e9*Math.random()>>>0);goog.uidCounter_=0;goog.getHashCode=goog.getUid;goog.removeHashCode=goog.removeUid;goog.cloneObject=function($){var ee=goog.typeOf($);if("object"==ee||"array"==ee){if("function"===typeof $.clone)return $.clone();ee="array"==ee?[]:{};for(var et in $)ee[et]=goog.cloneObject($[et]);return ee}return $};goog.bindNative_=function($,ee,et){return $.call.apply($.bind,arguments)};goog.bindJs_=function($,ee,et){if(!$)throw Error();if(2<arguments.length){var en=Array.prototype.slice.call(arguments,2);return function(){var et=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(et,en);return $.apply(ee,et)}}return function(){return $.apply(ee,arguments)}};goog.bind=function($,ee,et){Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?goog.bind=goog.bindNative_:goog.bind=goog.bindJs_;return goog.bind.apply(null,arguments)};goog.partial=function($,ee){var et=Array.prototype.slice.call(arguments,1);return function(){var ee=et.slice();ee.push.apply(ee,arguments);return $.apply(this,ee)}};goog.mixin=function($,ee){for(var et in ee)$[et]=ee[et]};goog.now=goog.TRUSTED_SITE&&Date.now||function(){return+new Date};goog.globalEval=function($){if(goog.global.execScript)goog.global.execScript($,"JavaScript");else if(goog.global.eval){if(null==goog.evalWorksForGlobals_){try{goog.global.eval("var _evalTest_ = 1;")}catch($){}if("undefined"!=typeof goog.global._evalTest_){try{delete goog.global._evalTest_}catch($){}goog.evalWorksForGlobals_=!0}else goog.evalWorksForGlobals_=!1}if(goog.evalWorksForGlobals_)goog.global.eval($);else{var ee=goog.global.document,et=ee.createElement("script");et.type="text/javascript";et.defer=!1;et.appendChild(ee.createTextNode($));ee.head.appendChild(et);ee.head.removeChild(et)}}else throw Error("goog.globalEval not available")};goog.evalWorksForGlobals_=null;goog.getCssName=function($,ee){if("."==String($).charAt(0))throw Error('className passed in goog.getCssName must not start with ".". You passed: '+$);var et=function($){return goog.cssNameMapping_[$]||$},en=function($){$=$.split("-");for(var ee=[],en=0;en<$.length;en++)ee.push(et($[en]));return ee.join("-")};en=goog.cssNameMapping_?"BY_WHOLE"==goog.cssNameMappingStyle_?et:en:function($){return $};$=ee?$+"-"+en(ee):en($);return goog.global.CLOSURE_CSS_NAME_MAP_FN?goog.global.CLOSURE_CSS_NAME_MAP_FN($):$};goog.setCssNameMapping=function($,ee){goog.cssNameMapping_=$;goog.cssNameMappingStyle_=ee};!COMPILED&&goog.global.CLOSURE_CSS_NAME_MAPPING&&(goog.cssNameMapping_=goog.global.CLOSURE_CSS_NAME_MAPPING);goog.getMsg=function($,ee,et){et&&et.html&&($=$.replace(/</g,"&lt;"));ee&&($=$.replace(/\{\$([^}]+)}/g,function($,et){return null!=ee&&et in ee?ee[et]:$}));return $};goog.getMsgWithFallback=function($,ee){return $};goog.exportSymbol=function($,ee,et){goog.exportPath_($,ee,et)};goog.exportProperty=function($,ee,et){$[ee]=et};goog.inherits=function($,ee){function et(){}et.prototype=ee.prototype;$.superClass_=ee.prototype;$.prototype=new et;$.prototype.constructor=$;$.base=function($,et,en){for(var ei=Array(arguments.length-2),eo=2;eo<arguments.length;eo++)ei[eo-2]=arguments[eo];return ee.prototype[et].apply($,ei)}};goog.scope=function($){if(goog.isInModuleLoader_())throw Error("goog.scope is not supported within a module.");$.call(goog.global)};COMPILED||(goog.global.COMPILED=COMPILED);goog.defineClass=function($,ee){var et=ee.constructor,en=ee.statics;et&&et!=Object.prototype.constructor||(et=function(){throw Error("cannot instantiate an interface (no constructor defined).")});et=goog.defineClass.createSealingConstructor_(et,$);$&&goog.inherits(et,$);delete ee.constructor;delete ee.statics;goog.defineClass.applyProperties_(et.prototype,ee);null!=en&&(en instanceof Function?en(et):goog.defineClass.applyProperties_(et,en));return et};goog.defineClass.SEAL_CLASS_INSTANCES=goog.DEBUG;goog.defineClass.createSealingConstructor_=function($,ee){if(!goog.defineClass.SEAL_CLASS_INSTANCES)return $;var et=!goog.defineClass.isUnsealable_(ee),en=function(){var ee=$.apply(this,arguments)||this;ee[goog.UID_PROPERTY_]=ee[goog.UID_PROPERTY_];this.constructor===en&&et&&Object.seal instanceof Function&&Object.seal(ee);return ee};return en};goog.defineClass.isUnsealable_=function($){return $&&$.prototype&&$.prototype[goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_]};goog.defineClass.OBJECT_PROTOTYPE_FIELDS_="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");goog.defineClass.applyProperties_=function($,ee){for(var et in ee)Object.prototype.hasOwnProperty.call(ee,et)&&($[et]=ee[et]);for(var en=0;en<goog.defineClass.OBJECT_PROTOTYPE_FIELDS_.length;en++)et=goog.defineClass.OBJECT_PROTOTYPE_FIELDS_[en],Object.prototype.hasOwnProperty.call(ee,et)&&($[et]=ee[et])};goog.tagUnsealableClass=function($){!COMPILED&&goog.defineClass.SEAL_CLASS_INSTANCES&&($.prototype[goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_]=!0)};goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_="goog_defineClass_legacy_unsealable";!COMPILED&&goog.DEPENDENCIES_ENABLED&&(goog.inHtmlDocument_=function(){var $=goog.global.document;return null!=$&&"write"in $},goog.isDocumentLoading_=function(){var $=goog.global.document;return $.attachEvent?"complete"!=$.readyState:"loading"==$.readyState},goog.findBasePath_=function(){if(void 0!=goog.global.CLOSURE_BASE_PATH&&"string"===typeof goog.global.CLOSURE_BASE_PATH)goog.basePath=goog.global.CLOSURE_BASE_PATH;else if(goog.inHtmlDocument_()){var $=goog.global.document,ee=$.currentScript;$=ee?[ee]:$.getElementsByTagName("SCRIPT");for(ee=$.length-1;0<=ee;--ee){var et=$[ee].src,en=et.lastIndexOf("?");en=-1==en?et.length:en;if("base.js"==et.substr(en-7,7)){goog.basePath=et.substr(0,en-7);break}}}},goog.findBasePath_(),goog.Transpiler=function(){this.requiresTranspilation_=null;this.transpilationTarget_=goog.TRANSPILE_TO_LANGUAGE},goog.Transpiler.prototype.createRequiresTranspilation_=function(){function a($,ee){e?d[$]=!0:ee()?(c=$,d[$]=!1):e=d[$]=!0}function b(a){try{return!!eval(a)}catch(h){return!1}}var c="es3",d={es3:!1},e=!1,f=goog.global.navigator&&goog.global.navigator.userAgent?goog.global.navigator.userAgent:"";a("es5",function(){return b("[1,].length==1")});a("es6",function(){return f.match(/Edge\/(\d+)(\.\d)*/i)?!1:b('(()=>{"use strict";class X{constructor(){if(new.target!=String)throw 1;this.x=42}}let q=Reflect.construct(X,[],String);if(q.x!=42||!(q instanceof String))throw 1;for(const a of[2,3]){if(a==2)continue;function f(z={a}){let a=0;return z.a}{function f(){return 0;}}return f()==3}})()')});a("es7",function(){return b("2 ** 2 == 4")});a("es8",function(){return b("async () => 1, true")});a("es9",function(){return b("({...rest} = {}), true")});a("es_next",function(){return!1});return{target:c,map:d}},goog.Transpiler.prototype.needsTranspile=function($,ee){if("always"==goog.TRANSPILE)return!0;if("never"==goog.TRANSPILE)return!1;if(!this.requiresTranspilation_){var et=this.createRequiresTranspilation_();this.requiresTranspilation_=et.map;this.transpilationTarget_=this.transpilationTarget_||et.target}if($ in this.requiresTranspilation_)return this.requiresTranspilation_[$]?!0:!goog.inHtmlDocument_()||"es6"!=ee||"noModule"in goog.global.document.createElement("script")?!1:!0;throw Error("Unknown language mode: "+$)},goog.Transpiler.prototype.transpile=function($,ee){return goog.transpile_($,ee,this.transpilationTarget_)},goog.transpiler_=new goog.Transpiler,goog.protectScriptTag_=function($){return $.replace(/<\/(SCRIPT)/ig,"\\x3c/$1")},goog.DebugLoader_=function(){this.dependencies_={};this.idToPath_={};this.written_={};this.loadingDeps_=[];this.depsToLoad_=[];this.paused_=!1;this.factory_=new goog.DependencyFactory(goog.transpiler_);this.deferredCallbacks_={};this.deferredQueue_=[]},goog.DebugLoader_.prototype.bootstrap=function($,ee){function et(){en&&(goog.global.setTimeout(en,0),en=null)}var en=ee;if($.length){ee=[];for(var ei=0;ei<$.length;ei++){var eo=this.getPathFromDeps_($[ei]);if(!eo)throw Error("Unregonized namespace: "+$[ei]);ee.push(this.dependencies_[eo])}eo=goog.require;var es=0;for(ei=0;ei<$.length;ei++)eo($[ei]),ee[ei].onLoad(function(){++es==$.length&&et()})}else et()},goog.DebugLoader_.prototype.loadClosureDeps=function(){this.depsToLoad_.push(this.factory_.createDependency(goog.normalizePath_(goog.basePath+"deps.js"),"deps.js",[],[],{},!1));this.loadDeps_()},goog.DebugLoader_.prototype.requested=function($,ee){($=this.getPathFromDeps_($))&&(ee||this.areDepsLoaded_(this.dependencies_[$].requires))&&(ee=this.deferredCallbacks_[$])&&(delete this.deferredCallbacks_[$],ee())},goog.DebugLoader_.prototype.setDependencyFactory=function($){this.factory_=$},goog.DebugLoader_.prototype.load_=function($){if(this.getPathFromDeps_($)){var ee=this,et=[],en=function($){var ei=ee.getPathFromDeps_($);if(!ei)throw Error("Bad dependency path or symbol: "+$);if(!ee.written_[ei]){ee.written_[ei]=!0;$=ee.dependencies_[ei];for(ei=0;ei<$.requires.length;ei++)goog.isProvided_($.requires[ei])||en($.requires[ei]);et.push($)}};en($);$=!!this.depsToLoad_.length;this.depsToLoad_=this.depsToLoad_.concat(et);this.paused_||$||this.loadDeps_()}else throw $="goog.require could not find: "+$,goog.logToConsole_($),Error($)},goog.DebugLoader_.prototype.loadDeps_=function(){for(var $=this,ee=this.paused_;this.depsToLoad_.length&&!ee;)(function(){var et=!1,en=$.depsToLoad_.shift(),ei=!1;$.loading_(en);var eo={pause:function(){if(et)throw Error("Cannot call pause after the call to load.");ee=!0},resume:function(){et?$.resume_():ee=!1},loaded:function(){if(ei)throw Error("Double call to loaded.");ei=!0;$.loaded_(en)},pending:function(){for(var ee=[],et=0;et<$.loadingDeps_.length;et++)ee.push($.loadingDeps_[et]);return ee},setModuleState:function($){goog.moduleLoaderState_={type:$,moduleName:"",declareLegacyNamespace:!1}},registerEs6ModuleExports:function($,ee,et){et&&(goog.loadedModules_[et]={exports:ee,type:goog.ModuleType.ES6,moduleId:et||""})},registerGoogModuleExports:function($,ee){goog.loadedModules_[$]={exports:ee,type:goog.ModuleType.GOOG,moduleId:$}},clearModuleState:function(){goog.moduleLoaderState_=null},defer:function(ee){if(et)throw Error("Cannot register with defer after the call to load.");$.defer_(en,ee)},areDepsLoaded:function(){return $.areDepsLoaded_(en.requires)}};try{en.load(eo)}finally{et=!0}})();ee&&this.pause_()},goog.DebugLoader_.prototype.pause_=function(){this.paused_=!0},goog.DebugLoader_.prototype.resume_=function(){this.paused_&&(this.paused_=!1,this.loadDeps_())},goog.DebugLoader_.prototype.loading_=function($){this.loadingDeps_.push($)},goog.DebugLoader_.prototype.loaded_=function($){for(var ee=0;ee<this.loadingDeps_.length;ee++)if(this.loadingDeps_[ee]==$){this.loadingDeps_.splice(ee,1);break}for(ee=0;ee<this.deferredQueue_.length;ee++)if(this.deferredQueue_[ee]==$.path){this.deferredQueue_.splice(ee,1);break}if(this.loadingDeps_.length==this.deferredQueue_.length&&!this.depsToLoad_.length)for(;this.deferredQueue_.length;)this.requested(this.deferredQueue_.shift(),!0);$.loaded()},goog.DebugLoader_.prototype.areDepsLoaded_=function($){for(var ee=0;ee<$.length;ee++){var et=this.getPathFromDeps_($[ee]);if(!et||!(et in this.deferredCallbacks_||goog.isProvided_($[ee])))return!1}return!0},goog.DebugLoader_.prototype.getPathFromDeps_=function($){return $ in this.idToPath_?this.idToPath_[$]:$ in this.dependencies_?$:null},goog.DebugLoader_.prototype.defer_=function($,ee){this.deferredCallbacks_[$.path]=ee;this.deferredQueue_.push($.path)},goog.LoadController=function(){},goog.LoadController.prototype.pause=function(){},goog.LoadController.prototype.resume=function(){},goog.LoadController.prototype.loaded=function(){},goog.LoadController.prototype.pending=function(){},goog.LoadController.prototype.registerEs6ModuleExports=function($,ee,et){},goog.LoadController.prototype.setModuleState=function($){},goog.LoadController.prototype.clearModuleState=function(){},goog.LoadController.prototype.defer=function($){},goog.LoadController.prototype.areDepsLoaded=function(){},goog.Dependency=function($,ee,et,en,ei){this.path=$;this.relativePath=ee;this.provides=et;this.requires=en;this.loadFlags=ei;this.loaded_=!1;this.loadCallbacks_=[]},goog.Dependency.prototype.getPathName=function(){var $=this.path,ee=$.indexOf("://");0<=ee&&($=$.substring(ee+3),ee=$.indexOf("/"),0<=ee&&($=$.substring(ee+1)));return $},goog.Dependency.prototype.onLoad=function($){this.loaded_?$():this.loadCallbacks_.push($)},goog.Dependency.prototype.loaded=function(){this.loaded_=!0;var $=this.loadCallbacks_;this.loadCallbacks_=[];for(var ee=0;ee<$.length;ee++)$[ee]()},goog.Dependency.defer_=!1,goog.Dependency.callbackMap_={},goog.Dependency.registerCallback_=function($){var ee=Math.random().toString(32);goog.Dependency.callbackMap_[ee]=$;return ee},goog.Dependency.unregisterCallback_=function($){delete goog.Dependency.callbackMap_[$]},goog.Dependency.callback_=function($,ee){if($ in goog.Dependency.callbackMap_){for(var et=goog.Dependency.callbackMap_[$],en=[],ei=1;ei<arguments.length;ei++)en.push(arguments[ei]);et.apply(void 0,en)}else throw Error("Callback key "+$+" does not exist (was base.js loaded more than once?).")},goog.Dependency.prototype.load=function($){if(goog.global.CLOSURE_IMPORT_SCRIPT)goog.global.CLOSURE_IMPORT_SCRIPT(this.path)?$.loaded():$.pause();else if(goog.inHtmlDocument_()){var ee=goog.global.document;if("complete"==ee.readyState&&!goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING){if(/\bdeps.js$/.test(this.path)){$.loaded();return}throw Error('Cannot write "'+this.path+'" after document load')}if(!goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING&&goog.isDocumentLoading_()){var et=goog.Dependency.registerCallback_(function(ee){goog.DebugLoader_.IS_OLD_IE_&&"complete"!=ee.readyState||(goog.Dependency.unregisterCallback_(et),$.loaded())}),en=!goog.DebugLoader_.IS_OLD_IE_&&goog.getScriptNonce()?' nonce="'+goog.getScriptNonce()+'"':"";en='<script src="'+this.path+'" '+(goog.DebugLoader_.IS_OLD_IE_?"onreadystatechange":"onload")+"=\"goog.Dependency.callback_('"+et+'\', this)" type="text/javascript" '+(goog.Dependency.defer_?"defer":"")+en+"></script>";ee.write(goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createHTML(en):en)}else{var ei=ee.createElement("script");ei.defer=goog.Dependency.defer_;ei.async=!1;ei.type="text/javascript";(en=goog.getScriptNonce())&&ei.setAttribute("nonce",en);goog.DebugLoader_.IS_OLD_IE_?($.pause(),ei.onreadystatechange=function(){if("loaded"==ei.readyState||"complete"==ei.readyState)$.loaded(),$.resume()}):ei.onload=function(){ei.onload=null;$.loaded()};ei.src=goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createScriptURL(this.path):this.path;ee.head.appendChild(ei)}}else goog.logToConsole_("Cannot use default debug loader outside of HTML documents."),"deps.js"==this.relativePath?(goog.logToConsole_("Consider setting CLOSURE_IMPORT_SCRIPT before loading base.js, or setting CLOSURE_NO_DEPS to true."),$.loaded()):$.pause()},goog.Es6ModuleDependency=function($,ee,et,en,ei){goog.Dependency.call(this,$,ee,et,en,ei)},goog.inherits(goog.Es6ModuleDependency,goog.Dependency),goog.Es6ModuleDependency.prototype.load=function($){function ee($,ee){$=ee?'<script type="module" crossorigin>'+ee+"</script>":'<script type="module" crossorigin src="'+$+'"></script>';en.write(goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createHTML($):$)}function et($,ee){var et=en.createElement("script");et.defer=!0;et.async=!1;et.type="module";et.setAttribute("crossorigin",!0);var ei=goog.getScriptNonce();ei&&et.setAttribute("nonce",ei);ee?et.textContent=goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createScript(ee):ee:et.src=goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createScriptURL($):$;en.head.appendChild(et)}if(goog.global.CLOSURE_IMPORT_SCRIPT)goog.global.CLOSURE_IMPORT_SCRIPT(this.path)?$.loaded():$.pause();else if(goog.inHtmlDocument_()){var en=goog.global.document,ei=this;if(goog.isDocumentLoading_()){var eo=ee;goog.Dependency.defer_=!0}else eo=et;var es=goog.Dependency.registerCallback_(function(){goog.Dependency.unregisterCallback_(es);$.setModuleState(goog.ModuleType.ES6)});eo(void 0,'goog.Dependency.callback_("'+es+'")');eo(this.path,void 0);var eu=goog.Dependency.registerCallback_(function(ee){goog.Dependency.unregisterCallback_(eu);$.registerEs6ModuleExports(ei.path,ee,goog.moduleLoaderState_.moduleName)});eo(void 0,'import * as m from "'+this.path+'"; goog.Dependency.callback_("'+eu+'", m)');var el=goog.Dependency.registerCallback_(function(){goog.Dependency.unregisterCallback_(el);$.clearModuleState();$.loaded()});eo(void 0,'goog.Dependency.callback_("'+el+'")')}else goog.logToConsole_("Cannot use default debug loader outside of HTML documents."),$.pause()},goog.TransformedDependency=function($,ee,et,en,ei){goog.Dependency.call(this,$,ee,et,en,ei);this.contents_=null;this.lazyFetch_=!goog.inHtmlDocument_()||!("noModule"in goog.global.document.createElement("script"))},goog.inherits(goog.TransformedDependency,goog.Dependency),goog.TransformedDependency.prototype.load=function($){function ee(){ei.contents_=goog.loadFileSync_(ei.path);ei.contents_&&(ei.contents_=ei.transform(ei.contents_),ei.contents_&&(ei.contents_+="\n//# sourceURL="+ei.path))}function et(){ei.lazyFetch_&&ee();if(ei.contents_){eo&&$.setModuleState(goog.ModuleType.ES6);try{var et=ei.contents_;ei.contents_=null;goog.globalEval(et);if(eo)var en=goog.moduleLoaderState_.moduleName}finally{eo&&$.clearModuleState()}eo&&goog.global.$jscomp.require.ensure([ei.getPathName()],function(){$.registerEs6ModuleExports(ei.path,goog.global.$jscomp.require(ei.getPathName()),en)});$.loaded()}}function en(){var $=goog.global.document,ee=goog.Dependency.registerCallback_(function(){goog.Dependency.unregisterCallback_(ee);et()}),en='<script type="text/javascript">'+goog.protectScriptTag_('goog.Dependency.callback_("'+ee+'");')+"</script>";$.write(goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createHTML(en):en)}var ei=this;if(goog.global.CLOSURE_IMPORT_SCRIPT)ee(),this.contents_&&goog.global.CLOSURE_IMPORT_SCRIPT("",this.contents_)?(this.contents_=null,$.loaded()):$.pause();else{var eo=this.loadFlags.module==goog.ModuleType.ES6;this.lazyFetch_||ee();var es=1<$.pending().length,eu=es&&goog.DebugLoader_.IS_OLD_IE_;es=goog.Dependency.defer_&&(es||goog.isDocumentLoading_());if(eu||es)$.defer(function(){et()});else{var el=goog.global.document;eu=goog.inHtmlDocument_()&&"ActiveXObject"in goog.global;if(eo&&goog.inHtmlDocument_()&&goog.isDocumentLoading_()&&!eu){goog.Dependency.defer_=!0;$.pause();var ef=el.onreadystatechange;el.onreadystatechange=function(){"interactive"==el.readyState&&(el.onreadystatechange=ef,et(),$.resume());goog.isFunction(ef)&&ef.apply(void 0,arguments)}}else!goog.DebugLoader_.IS_OLD_IE_&&goog.inHtmlDocument_()&&goog.isDocumentLoading_()?en():et()}}},goog.TransformedDependency.prototype.transform=function($){},goog.TranspiledDependency=function($,ee,et,en,ei,eo){goog.TransformedDependency.call(this,$,ee,et,en,ei);this.transpiler=eo},goog.inherits(goog.TranspiledDependency,goog.TransformedDependency),goog.TranspiledDependency.prototype.transform=function($){return this.transpiler.transpile($,this.getPathName())},goog.PreTranspiledEs6ModuleDependency=function($,ee,et,en,ei){goog.TransformedDependency.call(this,$,ee,et,en,ei)},goog.inherits(goog.PreTranspiledEs6ModuleDependency,goog.TransformedDependency),goog.PreTranspiledEs6ModuleDependency.prototype.transform=function($){return $},goog.GoogModuleDependency=function($,ee,et,en,ei,eo,es){goog.TransformedDependency.call(this,$,ee,et,en,ei);this.needsTranspile_=eo;this.transpiler_=es},goog.inherits(goog.GoogModuleDependency,goog.TransformedDependency),goog.GoogModuleDependency.prototype.transform=function($){this.needsTranspile_&&($=this.transpiler_.transpile($,this.getPathName()));return goog.LOAD_MODULE_USING_EVAL&&void 0!==goog.global.JSON?"goog.loadModule("+goog.global.JSON.stringify($+"\n//# sourceURL="+this.path+"\n")+");":'goog.loadModule(function(exports) {"use strict";'+$+"\n;return exports});\n//# sourceURL="+this.path+"\n"},goog.DebugLoader_.IS_OLD_IE_=!(goog.global.atob||!goog.global.document||!goog.global.document.all),goog.DebugLoader_.prototype.addDependency=function($,ee,et,en){ee=ee||[];$=$.replace(/\\/g,"/");var ei=goog.normalizePath_(goog.basePath+$);en&&"boolean"!==typeof en||(en=en?{module:goog.ModuleType.GOOG}:{});et=this.factory_.createDependency(ei,$,ee,et,en,goog.transpiler_.needsTranspile(en.lang||"es3",en.module));this.dependencies_[ei]=et;for(et=0;et<ee.length;et++)this.idToPath_[ee[et]]=ei;this.idToPath_[$]=ei},goog.DependencyFactory=function($){this.transpiler=$},goog.DependencyFactory.prototype.createDependency=function($,ee,et,en,ei,eo){return ei.module==goog.ModuleType.GOOG?new goog.GoogModuleDependency($,ee,et,en,ei,eo,this.transpiler):eo?new goog.TranspiledDependency($,ee,et,en,ei,this.transpiler):ei.module==goog.ModuleType.ES6?"never"==goog.TRANSPILE&&goog.ASSUME_ES_MODULES_TRANSPILED?new goog.PreTranspiledEs6ModuleDependency($,ee,et,en,ei):new goog.Es6ModuleDependency($,ee,et,en,ei):new goog.Dependency($,ee,et,en,ei)},goog.debugLoader_=new goog.DebugLoader_,goog.loadClosureDeps=function(){goog.debugLoader_.loadClosureDeps()},goog.setDependencyFactory=function($){goog.debugLoader_.setDependencyFactory($)},goog.global.CLOSURE_NO_DEPS||goog.debugLoader_.loadClosureDeps(),goog.bootstrap=function($,ee){goog.debugLoader_.bootstrap($,ee)});goog.TRUSTED_TYPES_POLICY_NAME="";goog.identity_=function($){return $};goog.createTrustedTypesPolicy=function($){var ee=null,et=goog.global.trustedTypes||goog.global.TrustedTypes;if(!et||!et.createPolicy)return ee;try{ee=et.createPolicy($,{createHTML:goog.identity_,createScript:goog.identity_,createScriptURL:goog.identity_,createURL:goog.identity_})}catch($){goog.logToConsole_($.message)}return ee};goog.TRUSTED_TYPES_POLICY_=goog.TRUSTED_TYPES_POLICY_NAME?goog.createTrustedTypesPolicy(goog.TRUSTED_TYPES_POLICY_NAME+"#base"):null;goog.object={};goog.object.is=function($,ee){return $===ee?0!==$||1/$===1/ee:$!==$&&ee!==ee};goog.object.forEach=function($,ee,et){for(var en in $)ee.call(et,$[en],en,$)};goog.object.filter=function($,ee,et){var en={},ei;for(ei in $)ee.call(et,$[ei],ei,$)&&(en[ei]=$[ei]);return en};goog.object.map=function($,ee,et){var en={},ei;for(ei in $)en[ei]=ee.call(et,$[ei],ei,$);return en};goog.object.some=function($,ee,et){for(var en in $)if(ee.call(et,$[en],en,$))return!0;return!1};goog.object.every=function($,ee,et){for(var en in $)if(!ee.call(et,$[en],en,$))return!1;return!0};goog.object.getCount=function($){var ee=0,et;for(et in $)ee++;return ee};goog.object.getAnyKey=function($){for(var ee in $)return ee};goog.object.getAnyValue=function($){for(var ee in $)return $[ee]};goog.object.contains=function($,ee){return goog.object.containsValue($,ee)};goog.object.getValues=function($){var ee=[],et=0,en;for(en in $)ee[et++]=$[en];return ee};goog.object.getKeys=function($){var ee=[],et=0,en;for(en in $)ee[et++]=en;return ee};goog.object.getValueByKeys=function($,ee){var et=goog.isArrayLike(ee),en=et?ee:arguments;for(et=et?0:1;et<en.length;et++){if(null==$)return;$=$[en[et]]}return $};goog.object.containsKey=function($,ee){return null!==$&&ee in $};goog.object.containsValue=function($,ee){for(var et in $)if($[et]==ee)return!0;return!1};goog.object.findKey=function($,ee,et){for(var en in $)if(ee.call(et,$[en],en,$))return en};goog.object.findValue=function($,ee,et){return(ee=goog.object.findKey($,ee,et))&&$[ee]};goog.object.isEmpty=function($){for(var ee in $)return!1;return!0};goog.object.clear=function($){for(var ee in $)delete $[ee]};goog.object.remove=function($,ee){var et;(et=ee in $)&&delete $[ee];return et};goog.object.add=function($,ee,et){if(null!==$&&ee in $)throw Error('The object already contains the key "'+ee+'"');goog.object.set($,ee,et)};goog.object.get=function($,ee,et){return null!==$&&ee in $?$[ee]:et};goog.object.set=function($,ee,et){$[ee]=et};goog.object.setIfUndefined=function($,ee,et){return ee in $?$[ee]:$[ee]=et};goog.object.setWithReturnValueIfNotSet=function($,ee,et){if(ee in $)return $[ee];et=et();return $[ee]=et};goog.object.equals=function($,ee){for(var et in $)if(!(et in ee)||$[et]!==ee[et])return!1;for(var en in ee)if(!(en in $))return!1;return!0};goog.object.clone=function($){var ee={},et;for(et in $)ee[et]=$[et];return ee};goog.object.unsafeClone=function($){var ee=goog.typeOf($);if("object"==ee||"array"==ee){if(goog.isFunction($.clone))return $.clone();ee="array"==ee?[]:{};for(var et in $)ee[et]=goog.object.unsafeClone($[et]);return ee}return $};goog.object.transpose=function($){var ee={},et;for(et in $)ee[$[et]]=et;return ee};goog.object.PROTOTYPE_FIELDS_="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");goog.object.extend=function($,ee){for(var et,en,ei=1;ei<arguments.length;ei++){en=arguments[ei];for(et in en)$[et]=en[et];for(var eo=0;eo<goog.object.PROTOTYPE_FIELDS_.length;eo++)et=goog.object.PROTOTYPE_FIELDS_[eo],Object.prototype.hasOwnProperty.call(en,et)&&($[et]=en[et])}};goog.object.create=function($){var ee=arguments.length;if(1==ee&&Array.isArray(arguments[0]))return goog.object.create.apply(null,arguments[0]);if(ee%2)throw Error("Uneven number of arguments");for(var et={},en=0;en<ee;en+=2)et[arguments[en]]=arguments[en+1];return et};goog.object.createSet=function($){var ee=arguments.length;if(1==ee&&Array.isArray(arguments[0]))return goog.object.createSet.apply(null,arguments[0]);for(var et={},en=0;en<ee;en++)et[arguments[en]]=!0;return et};goog.object.createImmutableView=function($){var ee=$;Object.isFrozen&&!Object.isFrozen($)&&(ee=Object.create($),Object.freeze(ee));return ee};goog.object.isImmutableView=function($){return!!Object.isFrozen&&Object.isFrozen($)};goog.object.getAllPropertyNames=function($,ee,et){if(!$)return[];if(!Object.getOwnPropertyNames||!Object.getPrototypeOf)return goog.object.getKeys($);for(var en={};$&&($!==Object.prototype||ee)&&($!==Function.prototype||et);){for(var ei=Object.getOwnPropertyNames($),eo=0;eo<ei.length;eo++)en[ei[eo]]=!0;$=Object.getPrototypeOf($)}return goog.object.getKeys(en)};goog.object.getSuperClass=function($){return($=Object.getPrototypeOf($.prototype))&&$.constructor};var jspb={asserts:{}};jspb.asserts.doAssertFailure=function($,ee,et,en){var ei="Assertion failed";if(et){ei+=": "+et;var eo=en}else $&&(ei+=": "+$,eo=ee);throw Error(""+ei,eo||[])};jspb.asserts.assert=function($,ee,et){for(var en=[],ei=2;ei<arguments.length;++ei)en[ei-2]=arguments[ei];$||jspb.asserts.doAssertFailure("",null,ee,en);return $};jspb.asserts.assertString=function($,ee,et){for(var en=[],ei=2;ei<arguments.length;++ei)en[ei-2]=arguments[ei];"string"!==typeof $&&jspb.asserts.doAssertFailure("Expected string but got %s: %s.",[goog.typeOf($),$],ee,en);return $};jspb.asserts.assertArray=function($,ee,et){for(var en=[],ei=2;ei<arguments.length;++ei)en[ei-2]=arguments[ei];Array.isArray($)||jspb.asserts.doAssertFailure("Expected array but got %s: %s.",[goog.typeOf($),$],ee,en);return $};jspb.asserts.fail=function($,ee){for(var et=[],en=1;en<arguments.length;++en)et[en-1]=arguments[en];throw Error("Failure"+($?": "+$:""),et)};jspb.asserts.assertInstanceof=function($,ee,et,en){for(var ei=[],eo=3;eo<arguments.length;++eo)ei[eo-3]=arguments[eo];$ instanceof ee||jspb.asserts.doAssertFailure("Expected instanceof %s but got %s.",[jspb.asserts.getType(ee),jspb.asserts.getType($)],et,ei);return $};jspb.asserts.getType=function($){return $ instanceof Function?$.displayName||$.name||"unknown type name":$ instanceof Object?$.constructor.displayName||$.constructor.name||Object.prototype.toString.call($):null===$?"null":typeof $};jspb.BinaryConstants={};jspb.ConstBinaryMessage=function(){};jspb.BinaryMessage=function(){};jspb.BinaryConstants.FieldType={INVALID:-1,DOUBLE:1,FLOAT:2,INT64:3,UINT64:4,INT32:5,FIXED64:6,FIXED32:7,BOOL:8,STRING:9,GROUP:10,MESSAGE:11,BYTES:12,UINT32:13,ENUM:14,SFIXED32:15,SFIXED64:16,SINT32:17,SINT64:18,FHASH64:30,VHASH64:31};jspb.BinaryConstants.WireType={INVALID:-1,VARINT:0,FIXED64:1,DELIMITED:2,START_GROUP:3,END_GROUP:4,FIXED32:5};jspb.BinaryConstants.FieldTypeToWireType=function($){var ee=jspb.BinaryConstants.FieldType,et=jspb.BinaryConstants.WireType;switch($){case ee.INT32:case ee.INT64:case ee.UINT32:case ee.UINT64:case ee.SINT32:case ee.SINT64:case ee.BOOL:case ee.ENUM:case ee.VHASH64:return et.VARINT;case ee.DOUBLE:case ee.FIXED64:case ee.SFIXED64:case ee.FHASH64:return et.FIXED64;case ee.STRING:case ee.MESSAGE:case ee.BYTES:return et.DELIMITED;case ee.FLOAT:case ee.FIXED32:case ee.SFIXED32:return et.FIXED32;default:return et.INVALID}};jspb.BinaryConstants.INVALID_FIELD_NUMBER=-1;jspb.BinaryConstants.FLOAT32_EPS=1401298464324817e-60;jspb.BinaryConstants.FLOAT32_MIN=11754943508222875e-54;jspb.BinaryConstants.FLOAT32_MAX=34028234663852886e22;jspb.BinaryConstants.FLOAT64_EPS=5e-324;jspb.BinaryConstants.FLOAT64_MIN=22250738585072014e-324;jspb.BinaryConstants.FLOAT64_MAX=17976931348623157e292;jspb.BinaryConstants.TWO_TO_20=1048576;jspb.BinaryConstants.TWO_TO_23=8388608;jspb.BinaryConstants.TWO_TO_31=2147483648;jspb.BinaryConstants.TWO_TO_32=4294967296;jspb.BinaryConstants.TWO_TO_52=4503599627370496;jspb.BinaryConstants.TWO_TO_63=0x7fffffffffffffff;jspb.BinaryConstants.TWO_TO_64=18446744073709552e3;jspb.BinaryConstants.ZERO_HASH="\x00\x00\x00\x00\x00\x00\x00\x00";goog.debug={};goog.debug.Error=function($){if(Error.captureStackTrace)Error.captureStackTrace(this,goog.debug.Error);else{var ee=Error().stack;ee&&(this.stack=ee)}$&&(this.message=String($));this.reportErrorToServer=!0};goog.inherits(goog.debug.Error,Error);goog.debug.Error.prototype.name="CustomError";goog.dom={};goog.dom.NodeType={ELEMENT:1,ATTRIBUTE:2,TEXT:3,CDATA_SECTION:4,ENTITY_REFERENCE:5,ENTITY:6,PROCESSING_INSTRUCTION:7,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,NOTATION:12};goog.asserts={};goog.asserts.ENABLE_ASSERTS=goog.DEBUG;goog.asserts.AssertionError=function($,ee){goog.debug.Error.call(this,goog.asserts.subs_($,ee));this.messagePattern=$};goog.inherits(goog.asserts.AssertionError,goog.debug.Error);goog.asserts.AssertionError.prototype.name="AssertionError";goog.asserts.DEFAULT_ERROR_HANDLER=function($){throw $};goog.asserts.errorHandler_=goog.asserts.DEFAULT_ERROR_HANDLER;goog.asserts.subs_=function($,ee){$=$.split("%s");for(var et="",en=$.length-1,ei=0;ei<en;ei++)et+=$[ei]+(ei<ee.length?ee[ei]:"%s");return et+$[en]};goog.asserts.doAssertFailure_=function($,ee,et,en){var ei="Assertion failed";if(et){ei+=": "+et;var eo=en}else $&&(ei+=": "+$,eo=ee);$=new goog.asserts.AssertionError(""+ei,eo||[]);goog.asserts.errorHandler_($)};goog.asserts.setErrorHandler=function($){goog.asserts.ENABLE_ASSERTS&&(goog.asserts.errorHandler_=$)};goog.asserts.assert=function($,ee,et){goog.asserts.ENABLE_ASSERTS&&!$&&goog.asserts.doAssertFailure_("",null,ee,Array.prototype.slice.call(arguments,2));return $};goog.asserts.assertExists=function($,ee,et){goog.asserts.ENABLE_ASSERTS&&null==$&&goog.asserts.doAssertFailure_("Expected to exist: %s.",[$],ee,Array.prototype.slice.call(arguments,2));return $};goog.asserts.fail=function($,ee){goog.asserts.ENABLE_ASSERTS&&goog.asserts.errorHandler_(new goog.asserts.AssertionError("Failure"+($?": "+$:""),Array.prototype.slice.call(arguments,1)))};goog.asserts.assertNumber=function($,ee,et){goog.asserts.ENABLE_ASSERTS&&"number"!==typeof $&&goog.asserts.doAssertFailure_("Expected number but got %s: %s.",[goog.typeOf($),$],ee,Array.prototype.slice.call(arguments,2));return $};goog.asserts.assertString=function($,ee,et){goog.asserts.ENABLE_ASSERTS&&"string"!==typeof $&&goog.asserts.doAssertFailure_("Expected string but got %s: %s.",[goog.typeOf($),$],ee,Array.prototype.slice.call(arguments,2));return $};goog.asserts.assertFunction=function($,ee,et){goog.asserts.ENABLE_ASSERTS&&!goog.isFunction($)&&goog.asserts.doAssertFailure_("Expected function but got %s: %s.",[goog.typeOf($),$],ee,Array.prototype.slice.call(arguments,2));return $};goog.asserts.assertObject=function($,ee,et){goog.asserts.ENABLE_ASSERTS&&!goog.isObject($)&&goog.asserts.doAssertFailure_("Expected object but got %s: %s.",[goog.typeOf($),$],ee,Array.prototype.slice.call(arguments,2));return $};goog.asserts.assertArray=function($,ee,et){goog.asserts.ENABLE_ASSERTS&&!Array.isArray($)&&goog.asserts.doAssertFailure_("Expected array but got %s: %s.",[goog.typeOf($),$],ee,Array.prototype.slice.call(arguments,2));return $};goog.asserts.assertBoolean=function($,ee,et){goog.asserts.ENABLE_ASSERTS&&"boolean"!==typeof $&&goog.asserts.doAssertFailure_("Expected boolean but got %s: %s.",[goog.typeOf($),$],ee,Array.prototype.slice.call(arguments,2));return $};goog.asserts.assertElement=function($,ee,et){!goog.asserts.ENABLE_ASSERTS||goog.isObject($)&&$.nodeType==goog.dom.NodeType.ELEMENT||goog.asserts.doAssertFailure_("Expected Element but got %s: %s.",[goog.typeOf($),$],ee,Array.prototype.slice.call(arguments,2));return $};goog.asserts.assertInstanceof=function($,ee,et,en){!goog.asserts.ENABLE_ASSERTS||$ instanceof ee||goog.asserts.doAssertFailure_("Expected instanceof %s but got %s.",[goog.asserts.getType_(ee),goog.asserts.getType_($)],et,Array.prototype.slice.call(arguments,3));return $};goog.asserts.assertFinite=function($,ee,et){!goog.asserts.ENABLE_ASSERTS||"number"==typeof $&&isFinite($)||goog.asserts.doAssertFailure_("Expected %s to be a finite number but it is not.",[$],ee,Array.prototype.slice.call(arguments,2));return $};goog.asserts.assertObjectPrototypeIsIntact=function(){for(var $ in Object.prototype)goog.asserts.fail($+" should not be enumerable in Object.prototype.")};goog.asserts.getType_=function($){return $ instanceof Function?$.displayName||$.name||"unknown type name":$ instanceof Object?$.constructor.displayName||$.constructor.name||Object.prototype.toString.call($):null===$?"null":typeof $};goog.array={};goog.NATIVE_ARRAY_PROTOTYPES=goog.TRUSTED_SITE;goog.array.ASSUME_NATIVE_FUNCTIONS=2012<goog.FEATURESET_YEAR;goog.array.peek=function($){return $[$.length-1]};goog.array.last=goog.array.peek;goog.array.indexOf=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.indexOf)?function($,ee,et){goog.asserts.assert(null!=$.length);return Array.prototype.indexOf.call($,ee,et)}:function($,ee,et){et=null==et?0:0>et?Math.max(0,$.length+et):et;if("string"===typeof $)return"string"!==typeof ee||1!=ee.length?-1:$.indexOf(ee,et);for(;et<$.length;et++)if(et in $&&$[et]===ee)return et;return-1};goog.array.lastIndexOf=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.lastIndexOf)?function($,ee,et){goog.asserts.assert(null!=$.length);return Array.prototype.lastIndexOf.call($,ee,null==et?$.length-1:et)}:function($,ee,et){et=null==et?$.length-1:et;0>et&&(et=Math.max(0,$.length+et));if("string"===typeof $)return"string"!==typeof ee||1!=ee.length?-1:$.lastIndexOf(ee,et);for(;0<=et;et--)if(et in $&&$[et]===ee)return et;return-1};goog.array.forEach=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.forEach)?function($,ee,et){goog.asserts.assert(null!=$.length);Array.prototype.forEach.call($,ee,et)}:function($,ee,et){for(var en=$.length,ei="string"===typeof $?$.split(""):$,eo=0;eo<en;eo++)eo in ei&&ee.call(et,ei[eo],eo,$)};goog.array.forEachRight=function($,ee,et){var en=$.length,ei="string"===typeof $?$.split(""):$;for(--en;0<=en;--en)en in ei&&ee.call(et,ei[en],en,$)};goog.array.filter=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.filter)?function($,ee,et){goog.asserts.assert(null!=$.length);return Array.prototype.filter.call($,ee,et)}:function($,ee,et){for(var en=$.length,ei=[],eo=0,es="string"===typeof $?$.split(""):$,eu=0;eu<en;eu++)if(eu in es){var el=es[eu];ee.call(et,el,eu,$)&&(ei[eo++]=el)}return ei};goog.array.map=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.map)?function($,ee,et){goog.asserts.assert(null!=$.length);return Array.prototype.map.call($,ee,et)}:function($,ee,et){for(var en=$.length,ei=Array(en),eo="string"===typeof $?$.split(""):$,es=0;es<en;es++)es in eo&&(ei[es]=ee.call(et,eo[es],es,$));return ei};goog.array.reduce=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.reduce)?function($,ee,et,en){goog.asserts.assert(null!=$.length);en&&(ee=goog.bind(ee,en));return Array.prototype.reduce.call($,ee,et)}:function($,ee,et,en){var ei=et;goog.array.forEach($,function(et,eo){ei=ee.call(en,ei,et,eo,$)});return ei};goog.array.reduceRight=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.reduceRight)?function($,ee,et,en){goog.asserts.assert(null!=$.length);goog.asserts.assert(null!=ee);en&&(ee=goog.bind(ee,en));return Array.prototype.reduceRight.call($,ee,et)}:function($,ee,et,en){var ei=et;goog.array.forEachRight($,function(et,eo){ei=ee.call(en,ei,et,eo,$)});return ei};goog.array.some=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.some)?function($,ee,et){goog.asserts.assert(null!=$.length);return Array.prototype.some.call($,ee,et)}:function($,ee,et){for(var en=$.length,ei="string"===typeof $?$.split(""):$,eo=0;eo<en;eo++)if(eo in ei&&ee.call(et,ei[eo],eo,$))return!0;return!1};goog.array.every=goog.NATIVE_ARRAY_PROTOTYPES&&(goog.array.ASSUME_NATIVE_FUNCTIONS||Array.prototype.every)?function($,ee,et){goog.asserts.assert(null!=$.length);return Array.prototype.every.call($,ee,et)}:function($,ee,et){for(var en=$.length,ei="string"===typeof $?$.split(""):$,eo=0;eo<en;eo++)if(eo in ei&&!ee.call(et,ei[eo],eo,$))return!1;return!0};goog.array.count=function($,ee,et){var en=0;goog.array.forEach($,function($,ei,eo){ee.call(et,$,ei,eo)&&++en},et);return en};goog.array.find=function($,ee,et){ee=goog.array.findIndex($,ee,et);return 0>ee?null:"string"===typeof $?$.charAt(ee):$[ee]};goog.array.findIndex=function($,ee,et){for(var en=$.length,ei="string"===typeof $?$.split(""):$,eo=0;eo<en;eo++)if(eo in ei&&ee.call(et,ei[eo],eo,$))return eo;return-1};goog.array.findRight=function($,ee,et){ee=goog.array.findIndexRight($,ee,et);return 0>ee?null:"string"===typeof $?$.charAt(ee):$[ee]};goog.array.findIndexRight=function($,ee,et){var en=$.length,ei="string"===typeof $?$.split(""):$;for(--en;0<=en;en--)if(en in ei&&ee.call(et,ei[en],en,$))return en;return-1};goog.array.contains=function($,ee){return 0<=goog.array.indexOf($,ee)};goog.array.isEmpty=function($){return 0==$.length};goog.array.clear=function($){if(!Array.isArray($))for(var ee=$.length-1;0<=ee;ee--)delete $[ee];$.length=0};goog.array.insert=function($,ee){goog.array.contains($,ee)||$.push(ee)};goog.array.insertAt=function($,ee,et){goog.array.splice($,et,0,ee)};goog.array.insertArrayAt=function($,ee,et){goog.partial(goog.array.splice,$,et,0).apply(null,ee)};goog.array.insertBefore=function($,ee,et){var en;2==arguments.length||0>(en=goog.array.indexOf($,et))?$.push(ee):goog.array.insertAt($,ee,en)};goog.array.remove=function($,ee){ee=goog.array.indexOf($,ee);var et;(et=0<=ee)&&goog.array.removeAt($,ee);return et};goog.array.removeLast=function($,ee){ee=goog.array.lastIndexOf($,ee);return 0<=ee?(goog.array.removeAt($,ee),!0):!1};goog.array.removeAt=function($,ee){goog.asserts.assert(null!=$.length);return 1==Array.prototype.splice.call($,ee,1).length};goog.array.removeIf=function($,ee,et){ee=goog.array.findIndex($,ee,et);return 0<=ee?(goog.array.removeAt($,ee),!0):!1};goog.array.removeAllIf=function($,ee,et){var en=0;goog.array.forEachRight($,function(ei,eo){ee.call(et,ei,eo,$)&&goog.array.removeAt($,eo)&&en++});return en};goog.array.concat=function($){return Array.prototype.concat.apply([],arguments)};goog.array.join=function($){return Array.prototype.concat.apply([],arguments)};goog.array.toArray=function($){var ee=$.length;if(0<ee){for(var et=Array(ee),en=0;en<ee;en++)et[en]=$[en];return et}return[]};goog.array.clone=goog.array.toArray;goog.array.extend=function($,ee){for(var et=1;et<arguments.length;et++){var en=arguments[et];if(goog.isArrayLike(en)){var ei=$.length||0,eo=en.length||0;$.length=ei+eo;for(var es=0;es<eo;es++)$[ei+es]=en[es]}else $.push(en)}};goog.array.splice=function($,ee,et,en){goog.asserts.assert(null!=$.length);return Array.prototype.splice.apply($,goog.array.slice(arguments,1))};goog.array.slice=function($,ee,et){goog.asserts.assert(null!=$.length);return 2>=arguments.length?Array.prototype.slice.call($,ee):Array.prototype.slice.call($,ee,et)};goog.array.removeDuplicates=function($,ee,et){ee=ee||$;var en=function($){return goog.isObject($)?"o"+goog.getUid($):(typeof $).charAt(0)+$};et=et||en;en={};for(var ei=0,eo=0;eo<$.length;){var es=$[eo++],eu=et(es);Object.prototype.hasOwnProperty.call(en,eu)||(en[eu]=!0,ee[ei++]=es)}ee.length=ei};goog.array.binarySearch=function($,ee,et){return goog.array.binarySearch_($,et||goog.array.defaultCompare,!1,ee)};goog.array.binarySelect=function($,ee,et){return goog.array.binarySearch_($,ee,!0,void 0,et)};goog.array.binarySearch_=function($,ee,et,en,ei){for(var eo=0,es=$.length,eu;eo<es;){var el=eo+(es-eo>>>1);var ef=et?ee.call(ei,$[el],el,$):ee(en,$[el]);0<ef?eo=el+1:(es=el,eu=!ef)}return eu?eo:-eo-1};goog.array.sort=function($,ee){$.sort(ee||goog.array.defaultCompare)};goog.array.stableSort=function($,ee){for(var et=Array($.length),en=0;en<$.length;en++)et[en]={index:en,value:$[en]};var ei=ee||goog.array.defaultCompare;goog.array.sort(et,function($,ee){return ei($.value,ee.value)||$.index-ee.index});for(en=0;en<$.length;en++)$[en]=et[en].value};goog.array.sortByKey=function($,ee,et){var en=et||goog.array.defaultCompare;goog.array.sort($,function($,et){return en(ee($),ee(et))})};goog.array.sortObjectsByKey=function($,ee,et){goog.array.sortByKey($,function($){return $[ee]},et)};goog.array.isSorted=function($,ee,et){ee=ee||goog.array.defaultCompare;for(var en=1;en<$.length;en++){var ei=ee($[en-1],$[en]);if(0<ei||0==ei&&et)return!1}return!0};goog.array.equals=function($,ee,et){if(!goog.isArrayLike($)||!goog.isArrayLike(ee)||$.length!=ee.length)return!1;var en=$.length;et=et||goog.array.defaultCompareEquality;for(var ei=0;ei<en;ei++)if(!et($[ei],ee[ei]))return!1;return!0};goog.array.compare3=function($,ee,et){et=et||goog.array.defaultCompare;for(var en=Math.min($.length,ee.length),ei=0;ei<en;ei++){var eo=et($[ei],ee[ei]);if(0!=eo)return eo}return goog.array.defaultCompare($.length,ee.length)};goog.array.defaultCompare=function($,ee){return $>ee?1:$<ee?-1:0};goog.array.inverseDefaultCompare=function($,ee){return-goog.array.defaultCompare($,ee)};goog.array.defaultCompareEquality=function($,ee){return $===ee};goog.array.binaryInsert=function($,ee,et){et=goog.array.binarySearch($,ee,et);return 0>et?(goog.array.insertAt($,ee,-(et+1)),!0):!1};goog.array.binaryRemove=function($,ee,et){ee=goog.array.binarySearch($,ee,et);return 0<=ee?goog.array.removeAt($,ee):!1};goog.array.bucket=function($,ee,et){for(var en={},ei=0;ei<$.length;ei++){var eo=$[ei],es=ee.call(et,eo,ei,$);void 0!==es&&(en[es]||(en[es]=[])).push(eo)}return en};goog.array.toObject=function($,ee,et){var en={};goog.array.forEach($,function(ei,eo){en[ee.call(et,ei,eo,$)]=ei});return en};goog.array.range=function($,ee,et){var en=[],ei=0,eo=$;et=et||1;void 0!==ee&&(ei=$,eo=ee);if(0>et*(eo-ei))return[];if(0<et)for($=ei;$<eo;$+=et)en.push($);else for($=ei;$>eo;$+=et)en.push($);return en};goog.array.repeat=function($,ee){for(var et=[],en=0;en<ee;en++)et[en]=$;return et};goog.array.flatten=function($){for(var ee=[],et=0;et<arguments.length;et++){var en=arguments[et];if(Array.isArray(en))for(var ei=0;ei<en.length;ei+=8192){var eo=goog.array.slice(en,ei,ei+8192);eo=goog.array.flatten.apply(null,eo);for(var es=0;es<eo.length;es++)ee.push(eo[es])}else ee.push(en)}return ee};goog.array.rotate=function($,ee){goog.asserts.assert(null!=$.length);$.length&&(ee%=$.length,0<ee?Array.prototype.unshift.apply($,$.splice(-ee,ee)):0>ee&&Array.prototype.push.apply($,$.splice(0,-ee)));return $};goog.array.moveItem=function($,ee,et){goog.asserts.assert(0<=ee&&ee<$.length);goog.asserts.assert(0<=et&&et<$.length);ee=Array.prototype.splice.call($,ee,1);Array.prototype.splice.call($,et,0,ee[0])};goog.array.zip=function($){if(!arguments.length)return[];for(var ee=[],et=arguments[0].length,en=1;en<arguments.length;en++)arguments[en].length<et&&(et=arguments[en].length);for(en=0;en<et;en++){for(var ei=[],eo=0;eo<arguments.length;eo++)ei.push(arguments[eo][en]);ee.push(ei)}return ee};goog.array.shuffle=function($,ee){ee=ee||Math.random;for(var et=$.length-1;0<et;et--){var en=Math.floor(ee()*(et+1)),ei=$[et];$[et]=$[en];$[en]=ei}};goog.array.copyByIndex=function($,ee){var et=[];goog.array.forEach(ee,function(ee){et.push($[ee])});return et};goog.array.concatMap=function($,ee,et){return goog.array.concat.apply([],goog.array.map($,ee,et))};goog.crypt={};goog.crypt.stringToByteArray=function($){for(var ee=[],et=0,en=0;en<$.length;en++){var ei=$.charCodeAt(en);255<ei&&(ee[et++]=ei&255,ei>>=8);ee[et++]=ei}return ee};goog.crypt.byteArrayToString=function($){if(8192>=$.length)return String.fromCharCode.apply(null,$);for(var ee="",et=0;et<$.length;et+=8192){var en=goog.array.slice($,et,et+8192);ee+=String.fromCharCode.apply(null,en)}return ee};goog.crypt.byteArrayToHex=function($,ee){return goog.array.map($,function($){$=$.toString(16);return 1<$.length?$:"0"+$}).join(ee||"")};goog.crypt.hexToByteArray=function($){goog.asserts.assert(0==$.length%2,"Key string length must be multiple of 2");for(var ee=[],et=0;et<$.length;et+=2)ee.push(parseInt($.substring(et,et+2),16));return ee};goog.crypt.stringToUtf8ByteArray=function($){for(var ee=[],et=0,en=0;en<$.length;en++){var ei=$.charCodeAt(en);128>ei?ee[et++]=ei:(2048>ei?ee[et++]=ei>>6|192:(55296==(ei&64512)&&en+1<$.length&&56320==($.charCodeAt(en+1)&64512)?(ei=65536+((ei&1023)<<10)+($.charCodeAt(++en)&1023),ee[et++]=ei>>18|240,ee[et++]=ei>>12&63|128):ee[et++]=ei>>12|224,ee[et++]=ei>>6&63|128),ee[et++]=ei&63|128)}return ee};goog.crypt.utf8ByteArrayToString=function($){for(var ee=[],et=0,en=0;et<$.length;){var ei=$[et++];if(128>ei)ee[en++]=String.fromCharCode(ei);else if(191<ei&&224>ei){var eo=$[et++];ee[en++]=String.fromCharCode((ei&31)<<6|eo&63)}else if(239<ei&&365>ei){eo=$[et++];var es=$[et++],eu=$[et++];ei=((ei&7)<<18|(eo&63)<<12|(es&63)<<6|eu&63)-65536;ee[en++]=String.fromCharCode(55296+(ei>>10));ee[en++]=String.fromCharCode(56320+(ei&1023))}else eo=$[et++],es=$[et++],ee[en++]=String.fromCharCode((ei&15)<<12|(eo&63)<<6|es&63)}return ee.join("")};goog.crypt.xorByteArray=function($,ee){goog.asserts.assert($.length==ee.length,"XOR array lengths must match");for(var et=[],en=0;en<$.length;en++)et.push($[en]^ee[en]);return et};goog.dom.asserts={};goog.dom.asserts.assertIsLocation=function($){if(goog.asserts.ENABLE_ASSERTS){var ee=goog.dom.asserts.getWindow_($);ee&&(!$||!($ instanceof ee.Location)&&$ instanceof ee.Element)&&goog.asserts.fail("Argument is not a Location (or a non-Element mock); got: %s",goog.dom.asserts.debugStringForType_($))}return $};goog.dom.asserts.assertIsElementType_=function($,ee){if(goog.asserts.ENABLE_ASSERTS){var et=goog.dom.asserts.getWindow_($);et&&"undefined"!=typeof et[ee]&&($&&($ instanceof et[ee]||!($ instanceof et.Location||$ instanceof et.Element))||goog.asserts.fail("Argument is not a %s (or a non-Element, non-Location mock); got: %s",ee,goog.dom.asserts.debugStringForType_($)))}return $};goog.dom.asserts.assertIsHTMLAnchorElement=function($){return goog.dom.asserts.assertIsElementType_($,"HTMLAnchorElement")};goog.dom.asserts.assertIsHTMLButtonElement=function($){return goog.dom.asserts.assertIsElementType_($,"HTMLButtonElement")};goog.dom.asserts.assertIsHTMLLinkElement=function($){return goog.dom.asserts.assertIsElementType_($,"HTMLLinkElement")};goog.dom.asserts.assertIsHTMLImageElement=function($){return goog.dom.asserts.assertIsElementType_($,"HTMLImageElement")};goog.dom.asserts.assertIsHTMLAudioElement=function($){return goog.dom.asserts.assertIsElementType_($,"HTMLAudioElement")};goog.dom.asserts.assertIsHTMLVideoElement=function($){return goog.dom.asserts.assertIsElementType_($,"HTMLVideoElement")};goog.dom.asserts.assertIsHTMLInputElement=function($){return goog.dom.asserts.assertIsElementType_($,"HTMLInputElement")};goog.dom.asserts.assertIsHTMLTextAreaElement=function($){return goog.dom.asserts.assertIsElementType_($,"HTMLTextAreaElement")};goog.dom.asserts.assertIsHTMLCanvasElement=function($){return goog.dom.asserts.assertIsElementType_($,"HTMLCanvasElement")};goog.dom.asserts.assertIsHTMLEmbedElement=function($){return goog.dom.asserts.assertIsElementType_($,"HTMLEmbedElement")};goog.dom.asserts.assertIsHTMLFormElement=function($){return goog.dom.asserts.assertIsElementType_($,"HTMLFormElement")};goog.dom.asserts.assertIsHTMLFrameElement=function($){return goog.dom.asserts.assertIsElementType_($,"HTMLFrameElement")};goog.dom.asserts.assertIsHTMLIFrameElement=function($){return goog.dom.asserts.assertIsElementType_($,"HTMLIFrameElement")};goog.dom.asserts.assertIsHTMLObjectElement=function($){return goog.dom.asserts.assertIsElementType_($,"HTMLObjectElement")};goog.dom.asserts.assertIsHTMLScriptElement=function($){return goog.dom.asserts.assertIsElementType_($,"HTMLScriptElement")};goog.dom.asserts.debugStringForType_=function($){if(goog.isObject($))try{return $.constructor.displayName||$.constructor.name||Object.prototype.toString.call($)}catch($){return"<object could not be stringified>"}else return void 0===$?"undefined":null===$?"null":typeof $};goog.dom.asserts.getWindow_=function($){try{var ee=$&&$.ownerDocument,et=ee&&(ee.defaultView||ee.parentWindow);et=et||goog.global;if(et.Element&&et.Location)return et}catch($){}return null};goog.functions={};goog.functions.constant=function($){return function(){return $}};goog.functions.FALSE=function(){return!1};goog.functions.TRUE=function(){return!0};goog.functions.NULL=function(){return null};goog.functions.identity=function($,ee){return $};goog.functions.error=function($){return function(){throw Error($)}};goog.functions.fail=function($){return function(){throw $}};goog.functions.lock=function($,ee){ee=ee||0;return function(){return $.apply(this,Array.prototype.slice.call(arguments,0,ee))}};goog.functions.nth=function($){return function(){return arguments[$]}};goog.functions.partialRight=function($,ee){var et=Array.prototype.slice.call(arguments,1);return function(){var ee=Array.prototype.slice.call(arguments);ee.push.apply(ee,et);return $.apply(this,ee)}};goog.functions.withReturnValue=function($,ee){return goog.functions.sequence($,goog.functions.constant(ee))};goog.functions.equalTo=function($,ee){return function(et){return ee?$==et:$===et}};goog.functions.compose=function($,ee){var et=arguments,en=et.length;return function(){var $;en&&($=et[en-1].apply(this,arguments));for(var ee=en-2;0<=ee;ee--)$=et[ee].call(this,$);return $}};goog.functions.sequence=function($){var ee=arguments,et=ee.length;return function(){for(var $,en=0;en<et;en++)$=ee[en].apply(this,arguments);return $}};goog.functions.and=function($){var ee=arguments,et=ee.length;return function(){for(var $=0;$<et;$++)if(!ee[$].apply(this,arguments))return!1;return!0}};goog.functions.or=function($){var ee=arguments,et=ee.length;return function(){for(var $=0;$<et;$++)if(ee[$].apply(this,arguments))return!0;return!1}};goog.functions.not=function($){return function(){return!$.apply(this,arguments)}};goog.functions.create=function($,ee){var et=function(){};et.prototype=$.prototype;et=new et;$.apply(et,Array.prototype.slice.call(arguments,1));return et};goog.functions.CACHE_RETURN_VALUE=!0;goog.functions.cacheReturnValue=function($){var ee=!1,et;return function(){if(!goog.functions.CACHE_RETURN_VALUE)return $();ee||(et=$(),ee=!0);return et}};goog.functions.once=function($){var ee=$;return function(){if(ee){var $=ee;ee=null;$()}}};goog.functions.debounce=function($,ee,et){var en=0;return function(ei){goog.global.clearTimeout(en);var eo=arguments;en=goog.global.setTimeout(function(){$.apply(et,eo)},ee)}};goog.functions.throttle=function($,ee,et){var en=0,ei=!1,eo=[],es=function(){en=0;ei&&(ei=!1,eu())},eu=function(){en=goog.global.setTimeout(es,ee);$.apply(et,eo)};return function($){eo=arguments;en?ei=!0:eu()}};goog.functions.rateLimit=function($,ee,et){var en=0,ei=function(){en=0};return function(eo){en||(en=goog.global.setTimeout(ei,ee),$.apply(et,arguments))}};goog.dom.HtmlElement=function(){};goog.dom.TagName=function($){this.tagName_=$};goog.dom.TagName.prototype.toString=function(){return this.tagName_};goog.dom.TagName.A=new goog.dom.TagName("A");goog.dom.TagName.ABBR=new goog.dom.TagName("ABBR");goog.dom.TagName.ACRONYM=new goog.dom.TagName("ACRONYM");goog.dom.TagName.ADDRESS=new goog.dom.TagName("ADDRESS");goog.dom.TagName.APPLET=new goog.dom.TagName("APPLET");goog.dom.TagName.AREA=new goog.dom.TagName("AREA");goog.dom.TagName.ARTICLE=new goog.dom.TagName("ARTICLE");goog.dom.TagName.ASIDE=new goog.dom.TagName("ASIDE");goog.dom.TagName.AUDIO=new goog.dom.TagName("AUDIO");goog.dom.TagName.B=new goog.dom.TagName("B");goog.dom.TagName.BASE=new goog.dom.TagName("BASE");goog.dom.TagName.BASEFONT=new goog.dom.TagName("BASEFONT");goog.dom.TagName.BDI=new goog.dom.TagName("BDI");goog.dom.TagName.BDO=new goog.dom.TagName("BDO");goog.dom.TagName.BIG=new goog.dom.TagName("BIG");goog.dom.TagName.BLOCKQUOTE=new goog.dom.TagName("BLOCKQUOTE");goog.dom.TagName.BODY=new goog.dom.TagName("BODY");goog.dom.TagName.BR=new goog.dom.TagName("BR");goog.dom.TagName.BUTTON=new goog.dom.TagName("BUTTON");goog.dom.TagName.CANVAS=new goog.dom.TagName("CANVAS");goog.dom.TagName.CAPTION=new goog.dom.TagName("CAPTION");goog.dom.TagName.CENTER=new goog.dom.TagName("CENTER");goog.dom.TagName.CITE=new goog.dom.TagName("CITE");goog.dom.TagName.CODE=new goog.dom.TagName("CODE");goog.dom.TagName.COL=new goog.dom.TagName("COL");goog.dom.TagName.COLGROUP=new goog.dom.TagName("COLGROUP");goog.dom.TagName.COMMAND=new goog.dom.TagName("COMMAND");goog.dom.TagName.DATA=new goog.dom.TagName("DATA");goog.dom.TagName.DATALIST=new goog.dom.TagName("DATALIST");goog.dom.TagName.DD=new goog.dom.TagName("DD");goog.dom.TagName.DEL=new goog.dom.TagName("DEL");goog.dom.TagName.DETAILS=new goog.dom.TagName("DETAILS");goog.dom.TagName.DFN=new goog.dom.TagName("DFN");goog.dom.TagName.DIALOG=new goog.dom.TagName("DIALOG");goog.dom.TagName.DIR=new goog.dom.TagName("DIR");goog.dom.TagName.DIV=new goog.dom.TagName("DIV");goog.dom.TagName.DL=new goog.dom.TagName("DL");goog.dom.TagName.DT=new goog.dom.TagName("DT");goog.dom.TagName.EM=new goog.dom.TagName("EM");goog.dom.TagName.EMBED=new goog.dom.TagName("EMBED");goog.dom.TagName.FIELDSET=new goog.dom.TagName("FIELDSET");goog.dom.TagName.FIGCAPTION=new goog.dom.TagName("FIGCAPTION");goog.dom.TagName.FIGURE=new goog.dom.TagName("FIGURE");goog.dom.TagName.FONT=new goog.dom.TagName("FONT");goog.dom.TagName.FOOTER=new goog.dom.TagName("FOOTER");goog.dom.TagName.FORM=new goog.dom.TagName("FORM");goog.dom.TagName.FRAME=new goog.dom.TagName("FRAME");goog.dom.TagName.FRAMESET=new goog.dom.TagName("FRAMESET");goog.dom.TagName.H1=new goog.dom.TagName("H1");goog.dom.TagName.H2=new goog.dom.TagName("H2");goog.dom.TagName.H3=new goog.dom.TagName("H3");goog.dom.TagName.H4=new goog.dom.TagName("H4");goog.dom.TagName.H5=new goog.dom.TagName("H5");goog.dom.TagName.H6=new goog.dom.TagName("H6");goog.dom.TagName.HEAD=new goog.dom.TagName("HEAD");goog.dom.TagName.HEADER=new goog.dom.TagName("HEADER");goog.dom.TagName.HGROUP=new goog.dom.TagName("HGROUP");goog.dom.TagName.HR=new goog.dom.TagName("HR");goog.dom.TagName.HTML=new goog.dom.TagName("HTML");goog.dom.TagName.I=new goog.dom.TagName("I");goog.dom.TagName.IFRAME=new goog.dom.TagName("IFRAME");goog.dom.TagName.IMG=new goog.dom.TagName("IMG");goog.dom.TagName.INPUT=new goog.dom.TagName("INPUT");goog.dom.TagName.INS=new goog.dom.TagName("INS");goog.dom.TagName.ISINDEX=new goog.dom.TagName("ISINDEX");goog.dom.TagName.KBD=new goog.dom.TagName("KBD");goog.dom.TagName.KEYGEN=new goog.dom.TagName("KEYGEN");goog.dom.TagName.LABEL=new goog.dom.TagName("LABEL");goog.dom.TagName.LEGEND=new goog.dom.TagName("LEGEND");goog.dom.TagName.LI=new goog.dom.TagName("LI");goog.dom.TagName.LINK=new goog.dom.TagName("LINK");goog.dom.TagName.MAIN=new goog.dom.TagName("MAIN");goog.dom.TagName.MAP=new goog.dom.TagName("MAP");goog.dom.TagName.MARK=new goog.dom.TagName("MARK");goog.dom.TagName.MATH=new goog.dom.TagName("MATH");goog.dom.TagName.MENU=new goog.dom.TagName("MENU");goog.dom.TagName.MENUITEM=new goog.dom.TagName("MENUITEM");goog.dom.TagName.META=new goog.dom.TagName("META");goog.dom.TagName.METER=new goog.dom.TagName("METER");goog.dom.TagName.NAV=new goog.dom.TagName("NAV");goog.dom.TagName.NOFRAMES=new goog.dom.TagName("NOFRAMES");goog.dom.TagName.NOSCRIPT=new goog.dom.TagName("NOSCRIPT");goog.dom.TagName.OBJECT=new goog.dom.TagName("OBJECT");goog.dom.TagName.OL=new goog.dom.TagName("OL");goog.dom.TagName.OPTGROUP=new goog.dom.TagName("OPTGROUP");goog.dom.TagName.OPTION=new goog.dom.TagName("OPTION");goog.dom.TagName.OUTPUT=new goog.dom.TagName("OUTPUT");goog.dom.TagName.P=new goog.dom.TagName("P");goog.dom.TagName.PARAM=new goog.dom.TagName("PARAM");goog.dom.TagName.PICTURE=new goog.dom.TagName("PICTURE");goog.dom.TagName.PRE=new goog.dom.TagName("PRE");goog.dom.TagName.PROGRESS=new goog.dom.TagName("PROGRESS");goog.dom.TagName.Q=new goog.dom.TagName("Q");goog.dom.TagName.RP=new goog.dom.TagName("RP");goog.dom.TagName.RT=new goog.dom.TagName("RT");goog.dom.TagName.RTC=new goog.dom.TagName("RTC");goog.dom.TagName.RUBY=new goog.dom.TagName("RUBY");goog.dom.TagName.S=new goog.dom.TagName("S");goog.dom.TagName.SAMP=new goog.dom.TagName("SAMP");goog.dom.TagName.SCRIPT=new goog.dom.TagName("SCRIPT");goog.dom.TagName.SECTION=new goog.dom.TagName("SECTION");goog.dom.TagName.SELECT=new goog.dom.TagName("SELECT");goog.dom.TagName.SMALL=new goog.dom.TagName("SMALL");goog.dom.TagName.SOURCE=new goog.dom.TagName("SOURCE");goog.dom.TagName.SPAN=new goog.dom.TagName("SPAN");goog.dom.TagName.STRIKE=new goog.dom.TagName("STRIKE");goog.dom.TagName.STRONG=new goog.dom.TagName("STRONG");goog.dom.TagName.STYLE=new goog.dom.TagName("STYLE");goog.dom.TagName.SUB=new goog.dom.TagName("SUB");goog.dom.TagName.SUMMARY=new goog.dom.TagName("SUMMARY");goog.dom.TagName.SUP=new goog.dom.TagName("SUP");goog.dom.TagName.SVG=new goog.dom.TagName("SVG");goog.dom.TagName.TABLE=new goog.dom.TagName("TABLE");goog.dom.TagName.TBODY=new goog.dom.TagName("TBODY");goog.dom.TagName.TD=new goog.dom.TagName("TD");goog.dom.TagName.TEMPLATE=new goog.dom.TagName("TEMPLATE");goog.dom.TagName.TEXTAREA=new goog.dom.TagName("TEXTAREA");goog.dom.TagName.TFOOT=new goog.dom.TagName("TFOOT");goog.dom.TagName.TH=new goog.dom.TagName("TH");goog.dom.TagName.THEAD=new goog.dom.TagName("THEAD");goog.dom.TagName.TIME=new goog.dom.TagName("TIME");goog.dom.TagName.TITLE=new goog.dom.TagName("TITLE");goog.dom.TagName.TR=new goog.dom.TagName("TR");goog.dom.TagName.TRACK=new goog.dom.TagName("TRACK");goog.dom.TagName.TT=new goog.dom.TagName("TT");goog.dom.TagName.U=new goog.dom.TagName("U");goog.dom.TagName.UL=new goog.dom.TagName("UL");goog.dom.TagName.VAR=new goog.dom.TagName("VAR");goog.dom.TagName.VIDEO=new goog.dom.TagName("VIDEO");goog.dom.TagName.WBR=new goog.dom.TagName("WBR");goog.dom.tags={};goog.dom.tags.VOID_TAGS_={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};goog.dom.tags.isVoidTag=function($){return!0===goog.dom.tags.VOID_TAGS_[$]};goog.html={};goog.html.trustedtypes={};goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY=goog.TRUSTED_TYPES_POLICY_NAME?goog.createTrustedTypesPolicy(goog.TRUSTED_TYPES_POLICY_NAME+"#html"):null;goog.string={};goog.string.TypedString=function(){};goog.string.Const=function($,ee){this.stringConstValueWithSecurityContract__googStringSecurityPrivate_=$===goog.string.Const.GOOG_STRING_CONSTRUCTOR_TOKEN_PRIVATE_&&ee||"";this.STRING_CONST_TYPE_MARKER__GOOG_STRING_SECURITY_PRIVATE_=goog.string.Const.TYPE_MARKER_};goog.string.Const.prototype.implementsGoogStringTypedString=!0;goog.string.Const.prototype.getTypedStringValue=function(){return this.stringConstValueWithSecurityContract__googStringSecurityPrivate_};goog.DEBUG&&(goog.string.Const.prototype.toString=function(){return"Const{"+this.stringConstValueWithSecurityContract__googStringSecurityPrivate_+"}"});goog.string.Const.unwrap=function($){if($ instanceof goog.string.Const&&$.constructor===goog.string.Const&&$.STRING_CONST_TYPE_MARKER__GOOG_STRING_SECURITY_PRIVATE_===goog.string.Const.TYPE_MARKER_)return $.stringConstValueWithSecurityContract__googStringSecurityPrivate_;goog.asserts.fail("expected object of type Const, got '"+$+"'");return"type_error:Const"};goog.string.Const.from=function($){return new goog.string.Const(goog.string.Const.GOOG_STRING_CONSTRUCTOR_TOKEN_PRIVATE_,$)};goog.string.Const.TYPE_MARKER_={};goog.string.Const.GOOG_STRING_CONSTRUCTOR_TOKEN_PRIVATE_={};goog.string.Const.EMPTY=goog.string.Const.from("");goog.html.SafeScript=function(){this.privateDoNotAccessOrElseSafeScriptWrappedValue_="";this.SAFE_SCRIPT_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeScript.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_};goog.html.SafeScript.prototype.implementsGoogStringTypedString=!0;goog.html.SafeScript.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={};goog.html.SafeScript.fromConstant=function($){$=goog.string.Const.unwrap($);return 0===$.length?goog.html.SafeScript.EMPTY:goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse($)};goog.html.SafeScript.fromConstantAndArgs=function($,ee){for(var et=[],en=1;en<arguments.length;en++)et.push(goog.html.SafeScript.stringify_(arguments[en]));return goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse("("+goog.string.Const.unwrap($)+")("+et.join(", ")+");")};goog.html.SafeScript.fromJson=function($){return goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(goog.html.SafeScript.stringify_($))};goog.html.SafeScript.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeScriptWrappedValue_.toString()};goog.DEBUG&&(goog.html.SafeScript.prototype.toString=function(){return"SafeScript{"+this.privateDoNotAccessOrElseSafeScriptWrappedValue_+"}"});goog.html.SafeScript.unwrap=function($){return goog.html.SafeScript.unwrapTrustedScript($).toString()};goog.html.SafeScript.unwrapTrustedScript=function($){if($ instanceof goog.html.SafeScript&&$.constructor===goog.html.SafeScript&&$.SAFE_SCRIPT_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeScript.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_)return $.privateDoNotAccessOrElseSafeScriptWrappedValue_;goog.asserts.fail("expected object of type SafeScript, got '"+$+"' of type "+goog.typeOf($));return"type_error:SafeScript"};goog.html.SafeScript.stringify_=function($){return JSON.stringify($).replace(/</g,"\\x3c")};goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse=function($){return(new goog.html.SafeScript).initSecurityPrivateDoNotAccessOrElse_($)};goog.html.SafeScript.prototype.initSecurityPrivateDoNotAccessOrElse_=function($){this.privateDoNotAccessOrElseSafeScriptWrappedValue_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY?goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createScript($):$;return this};goog.html.SafeScript.EMPTY=goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse("");goog.fs={};goog.fs.url={};goog.fs.url.createObjectUrl=function($){return goog.fs.url.getUrlObject_().createObjectURL($)};goog.fs.url.revokeObjectUrl=function($){goog.fs.url.getUrlObject_().revokeObjectURL($)};goog.fs.url.UrlObject_=function(){};goog.fs.url.UrlObject_.prototype.createObjectURL=function($){};goog.fs.url.UrlObject_.prototype.revokeObjectURL=function($){};goog.fs.url.getUrlObject_=function(){var $=goog.fs.url.findUrlObject_();if(null!=$)return $;throw Error("This browser doesn't seem to support blob URLs")};goog.fs.url.findUrlObject_=function(){return void 0!==goog.global.URL&&void 0!==goog.global.URL.createObjectURL?goog.global.URL:void 0!==goog.global.webkitURL&&void 0!==goog.global.webkitURL.createObjectURL?goog.global.webkitURL:void 0!==goog.global.createObjectURL?goog.global:null};goog.fs.url.browserSupportsObjectUrls=function(){return null!=goog.fs.url.findUrlObject_()};goog.fs.blob={};goog.fs.blob.getBlob=function($){var ee=goog.global.BlobBuilder||goog.global.WebKitBlobBuilder;if(void 0!==ee){ee=new ee;for(var et=0;et<arguments.length;et++)ee.append(arguments[et]);return ee.getBlob()}return goog.fs.blob.getBlobWithProperties(goog.array.toArray(arguments))};goog.fs.blob.getBlobWithProperties=function($,ee,et){var en=goog.global.BlobBuilder||goog.global.WebKitBlobBuilder;if(void 0!==en){en=new en;for(var ei=0;ei<$.length;ei++)en.append($[ei],et);return en.getBlob(ee)}if(void 0!==goog.global.Blob)return en={},ee&&(en.type=ee),et&&(en.endings=et),new Blob($,en);throw Error("This browser doesn't seem to support creating Blobs")};goog.i18n={};goog.i18n.bidi={};goog.i18n.bidi.FORCE_RTL=!1;goog.i18n.bidi.IS_RTL=goog.i18n.bidi.FORCE_RTL||("ar"==goog.LOCALE.substring(0,2).toLowerCase()||"fa"==goog.LOCALE.substring(0,2).toLowerCase()||"he"==goog.LOCALE.substring(0,2).toLowerCase()||"iw"==goog.LOCALE.substring(0,2).toLowerCase()||"ps"==goog.LOCALE.substring(0,2).toLowerCase()||"sd"==goog.LOCALE.substring(0,2).toLowerCase()||"ug"==goog.LOCALE.substring(0,2).toLowerCase()||"ur"==goog.LOCALE.substring(0,2).toLowerCase()||"yi"==goog.LOCALE.substring(0,2).toLowerCase())&&(2==goog.LOCALE.length||"-"==goog.LOCALE.substring(2,3)||"_"==goog.LOCALE.substring(2,3))||3<=goog.LOCALE.length&&"ckb"==goog.LOCALE.substring(0,3).toLowerCase()&&(3==goog.LOCALE.length||"-"==goog.LOCALE.substring(3,4)||"_"==goog.LOCALE.substring(3,4))||7<=goog.LOCALE.length&&("-"==goog.LOCALE.substring(2,3)||"_"==goog.LOCALE.substring(2,3))&&("adlm"==goog.LOCALE.substring(3,7).toLowerCase()||"arab"==goog.LOCALE.substring(3,7).toLowerCase()||"hebr"==goog.LOCALE.substring(3,7).toLowerCase()||"nkoo"==goog.LOCALE.substring(3,7).toLowerCase()||"rohg"==goog.LOCALE.substring(3,7).toLowerCase()||"thaa"==goog.LOCALE.substring(3,7).toLowerCase())||8<=goog.LOCALE.length&&("-"==goog.LOCALE.substring(3,4)||"_"==goog.LOCALE.substring(3,4))&&("adlm"==goog.LOCALE.substring(4,8).toLowerCase()||"arab"==goog.LOCALE.substring(4,8).toLowerCase()||"hebr"==goog.LOCALE.substring(4,8).toLowerCase()||"nkoo"==goog.LOCALE.substring(4,8).toLowerCase()||"rohg"==goog.LOCALE.substring(4,8).toLowerCase()||"thaa"==goog.LOCALE.substring(4,8).toLowerCase());goog.i18n.bidi.Format={LRE:"‪",RLE:"‫",PDF:"‬",LRM:"‎",RLM:"‏"};goog.i18n.bidi.Dir={LTR:1,RTL:-1,NEUTRAL:0};goog.i18n.bidi.RIGHT="right";goog.i18n.bidi.LEFT="left";goog.i18n.bidi.I18N_RIGHT=goog.i18n.bidi.IS_RTL?goog.i18n.bidi.LEFT:goog.i18n.bidi.RIGHT;goog.i18n.bidi.I18N_LEFT=goog.i18n.bidi.IS_RTL?goog.i18n.bidi.RIGHT:goog.i18n.bidi.LEFT;goog.i18n.bidi.toDir=function($,ee){return"number"==typeof $?0<$?goog.i18n.bidi.Dir.LTR:0>$?goog.i18n.bidi.Dir.RTL:ee?null:goog.i18n.bidi.Dir.NEUTRAL:null==$?null:$?goog.i18n.bidi.Dir.RTL:goog.i18n.bidi.Dir.LTR};goog.i18n.bidi.ltrChars_="A-Za-z\xc0-\xd6\xd8-\xf6\xf8-ʸ̀-֐ऀ-῿‎Ⰰ-\ud801\ud804-\ud839\ud83c-\udbff豈-﬜︀-﹯﻽-￿";goog.i18n.bidi.rtlChars_="֑-ۯۺ-ࣿ‏\ud802-\ud803\ud83a-\ud83bיִ-﷿ﹰ-ﻼ";goog.i18n.bidi.htmlSkipReg_=/<[^>]*>|&[^;]+;/g;goog.i18n.bidi.stripHtmlIfNeeded_=function($,ee){return ee?$.replace(goog.i18n.bidi.htmlSkipReg_,""):$};goog.i18n.bidi.rtlCharReg_=new RegExp("["+goog.i18n.bidi.rtlChars_+"]");goog.i18n.bidi.ltrCharReg_=new RegExp("["+goog.i18n.bidi.ltrChars_+"]");goog.i18n.bidi.hasAnyRtl=function($,ee){return goog.i18n.bidi.rtlCharReg_.test(goog.i18n.bidi.stripHtmlIfNeeded_($,ee))};goog.i18n.bidi.hasRtlChar=goog.i18n.bidi.hasAnyRtl;goog.i18n.bidi.hasAnyLtr=function($,ee){return goog.i18n.bidi.ltrCharReg_.test(goog.i18n.bidi.stripHtmlIfNeeded_($,ee))};goog.i18n.bidi.ltrRe_=new RegExp("^["+goog.i18n.bidi.ltrChars_+"]");goog.i18n.bidi.rtlRe_=new RegExp("^["+goog.i18n.bidi.rtlChars_+"]");goog.i18n.bidi.isRtlChar=function($){return goog.i18n.bidi.rtlRe_.test($)};goog.i18n.bidi.isLtrChar=function($){return goog.i18n.bidi.ltrRe_.test($)};goog.i18n.bidi.isNeutralChar=function($){return!goog.i18n.bidi.isLtrChar($)&&!goog.i18n.bidi.isRtlChar($)};goog.i18n.bidi.ltrDirCheckRe_=new RegExp("^[^"+goog.i18n.bidi.rtlChars_+"]*["+goog.i18n.bidi.ltrChars_+"]");goog.i18n.bidi.rtlDirCheckRe_=new RegExp("^[^"+goog.i18n.bidi.ltrChars_+"]*["+goog.i18n.bidi.rtlChars_+"]");goog.i18n.bidi.startsWithRtl=function($,ee){return goog.i18n.bidi.rtlDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_($,ee))};goog.i18n.bidi.isRtlText=goog.i18n.bidi.startsWithRtl;goog.i18n.bidi.startsWithLtr=function($,ee){return goog.i18n.bidi.ltrDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_($,ee))};goog.i18n.bidi.isLtrText=goog.i18n.bidi.startsWithLtr;goog.i18n.bidi.isRequiredLtrRe_=/^http:\/\/.*/;goog.i18n.bidi.isNeutralText=function($,ee){$=goog.i18n.bidi.stripHtmlIfNeeded_($,ee);return goog.i18n.bidi.isRequiredLtrRe_.test($)||!goog.i18n.bidi.hasAnyLtr($)&&!goog.i18n.bidi.hasAnyRtl($)};goog.i18n.bidi.ltrExitDirCheckRe_=new RegExp("["+goog.i18n.bidi.ltrChars_+"][^"+goog.i18n.bidi.rtlChars_+"]*$");goog.i18n.bidi.rtlExitDirCheckRe_=new RegExp("["+goog.i18n.bidi.rtlChars_+"][^"+goog.i18n.bidi.ltrChars_+"]*$");goog.i18n.bidi.endsWithLtr=function($,ee){return goog.i18n.bidi.ltrExitDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_($,ee))};goog.i18n.bidi.isLtrExitText=goog.i18n.bidi.endsWithLtr;goog.i18n.bidi.endsWithRtl=function($,ee){return goog.i18n.bidi.rtlExitDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_($,ee))};goog.i18n.bidi.isRtlExitText=goog.i18n.bidi.endsWithRtl;goog.i18n.bidi.rtlLocalesRe_=/^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i;goog.i18n.bidi.isRtlLanguage=function($){return goog.i18n.bidi.rtlLocalesRe_.test($)};goog.i18n.bidi.bracketGuardTextRe_=/(\(.*?\)+)|(\[.*?\]+)|(\{.*?\}+)|(<.*?>+)/g;goog.i18n.bidi.guardBracketInText=function($,ee){ee=(void 0===ee?goog.i18n.bidi.hasAnyRtl($):ee)?goog.i18n.bidi.Format.RLM:goog.i18n.bidi.Format.LRM;return $.replace(goog.i18n.bidi.bracketGuardTextRe_,ee+"$&"+ee)};goog.i18n.bidi.enforceRtlInHtml=function($){return"<"==$.charAt(0)?$.replace(/<\w+/,"$& dir=rtl"):"\n<span dir=rtl>"+$+"</span>"};goog.i18n.bidi.enforceRtlInText=function($){return goog.i18n.bidi.Format.RLE+$+goog.i18n.bidi.Format.PDF};goog.i18n.bidi.enforceLtrInHtml=function($){return"<"==$.charAt(0)?$.replace(/<\w+/,"$& dir=ltr"):"\n<span dir=ltr>"+$+"</span>"};goog.i18n.bidi.enforceLtrInText=function($){return goog.i18n.bidi.Format.LRE+$+goog.i18n.bidi.Format.PDF};goog.i18n.bidi.dimensionsRe_=/:\s*([.\d][.\w]*)\s+([.\d][.\w]*)\s+([.\d][.\w]*)\s+([.\d][.\w]*)/g;goog.i18n.bidi.leftRe_=/left/gi;goog.i18n.bidi.rightRe_=/right/gi;goog.i18n.bidi.tempRe_=/%%%%/g;goog.i18n.bidi.mirrorCSS=function($){return $.replace(goog.i18n.bidi.dimensionsRe_,":$1 $4 $3 $2").replace(goog.i18n.bidi.leftRe_,"%%%%").replace(goog.i18n.bidi.rightRe_,goog.i18n.bidi.LEFT).replace(goog.i18n.bidi.tempRe_,goog.i18n.bidi.RIGHT)};goog.i18n.bidi.doubleQuoteSubstituteRe_=/([\u0591-\u05f2])"/g;goog.i18n.bidi.singleQuoteSubstituteRe_=/([\u0591-\u05f2])'/g;goog.i18n.bidi.normalizeHebrewQuote=function($){return $.replace(goog.i18n.bidi.doubleQuoteSubstituteRe_,"$1״").replace(goog.i18n.bidi.singleQuoteSubstituteRe_,"$1׳")};goog.i18n.bidi.wordSeparatorRe_=/\s+/;goog.i18n.bidi.hasNumeralsRe_=/[\d\u06f0-\u06f9]/;goog.i18n.bidi.rtlDetectionThreshold_=.4;goog.i18n.bidi.estimateDirection=function($,ee){var et=0,en=0,ei=!1;$=goog.i18n.bidi.stripHtmlIfNeeded_($,ee).split(goog.i18n.bidi.wordSeparatorRe_);for(ee=0;ee<$.length;ee++){var eo=$[ee];goog.i18n.bidi.startsWithRtl(eo)?(et++,en++):goog.i18n.bidi.isRequiredLtrRe_.test(eo)?ei=!0:goog.i18n.bidi.hasAnyLtr(eo)?en++:goog.i18n.bidi.hasNumeralsRe_.test(eo)&&(ei=!0)}return 0==en?ei?goog.i18n.bidi.Dir.LTR:goog.i18n.bidi.Dir.NEUTRAL:et/en>goog.i18n.bidi.rtlDetectionThreshold_?goog.i18n.bidi.Dir.RTL:goog.i18n.bidi.Dir.LTR};goog.i18n.bidi.detectRtlDirectionality=function($,ee){return goog.i18n.bidi.estimateDirection($,ee)==goog.i18n.bidi.Dir.RTL};goog.i18n.bidi.setElementDirAndAlign=function($,ee){$&&(ee=goog.i18n.bidi.toDir(ee))&&($.style.textAlign=ee==goog.i18n.bidi.Dir.RTL?goog.i18n.bidi.RIGHT:goog.i18n.bidi.LEFT,$.dir=ee==goog.i18n.bidi.Dir.RTL?"rtl":"ltr")};goog.i18n.bidi.setElementDirByTextDirectionality=function($,ee){switch(goog.i18n.bidi.estimateDirection(ee)){case goog.i18n.bidi.Dir.LTR:$.dir="ltr";break;case goog.i18n.bidi.Dir.RTL:$.dir="rtl";break;default:$.removeAttribute("dir")}};goog.i18n.bidi.DirectionalString=function(){};goog.html.TrustedResourceUrl=function($,ee){this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_=$===goog.html.TrustedResourceUrl.CONSTRUCTOR_TOKEN_PRIVATE_&&ee||"";this.TRUSTED_RESOURCE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.TrustedResourceUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_};goog.html.TrustedResourceUrl.prototype.implementsGoogStringTypedString=!0;goog.html.TrustedResourceUrl.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_.toString()};goog.html.TrustedResourceUrl.prototype.implementsGoogI18nBidiDirectionalString=!0;goog.html.TrustedResourceUrl.prototype.getDirection=function(){return goog.i18n.bidi.Dir.LTR};goog.html.TrustedResourceUrl.prototype.cloneWithParams=function($,ee){var et=goog.html.TrustedResourceUrl.unwrap(this);et=goog.html.TrustedResourceUrl.URL_PARAM_PARSER_.exec(et);var en=et[3]||"";return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(et[1]+goog.html.TrustedResourceUrl.stringifyParams_("?",et[2]||"",$)+goog.html.TrustedResourceUrl.stringifyParams_("#",en,ee))};goog.DEBUG&&(goog.html.TrustedResourceUrl.prototype.toString=function(){return"TrustedResourceUrl{"+this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_+"}"});goog.html.TrustedResourceUrl.unwrap=function($){return goog.html.TrustedResourceUrl.unwrapTrustedScriptURL($).toString()};goog.html.TrustedResourceUrl.unwrapTrustedScriptURL=function($){if($ instanceof goog.html.TrustedResourceUrl&&$.constructor===goog.html.TrustedResourceUrl&&$.TRUSTED_RESOURCE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.TrustedResourceUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_)return $.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_;goog.asserts.fail("expected object of type TrustedResourceUrl, got '"+$+"' of type "+goog.typeOf($));return"type_error:TrustedResourceUrl"};goog.html.TrustedResourceUrl.format=function($,ee){var et=goog.string.Const.unwrap($);if(!goog.html.TrustedResourceUrl.BASE_URL_.test(et))throw Error("Invalid TrustedResourceUrl format: "+et);$=et.replace(goog.html.TrustedResourceUrl.FORMAT_MARKER_,function($,en){if(!Object.prototype.hasOwnProperty.call(ee,en))throw Error('Found marker, "'+en+'", in format string, "'+et+'", but no valid label mapping found in args: '+JSON.stringify(ee));$=ee[en];return $ instanceof goog.string.Const?goog.string.Const.unwrap($):encodeURIComponent(String($))});return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse($)};goog.html.TrustedResourceUrl.FORMAT_MARKER_=/%{(\w+)}/g;goog.html.TrustedResourceUrl.BASE_URL_=/^((https:)?\/\/[0-9a-z.:[\]-]+\/|\/[^/\\]|[^:/\\%]+\/|[^:/\\%]*[?#]|about:blank#)/i;goog.html.TrustedResourceUrl.URL_PARAM_PARSER_=/^([^?#]*)(\?[^#]*)?(#[\s\S]*)?/;goog.html.TrustedResourceUrl.formatWithParams=function($,ee,et,en){return goog.html.TrustedResourceUrl.format($,ee).cloneWithParams(et,en)};goog.html.TrustedResourceUrl.fromConstant=function($){return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(goog.string.Const.unwrap($))};goog.html.TrustedResourceUrl.fromConstants=function($){for(var ee="",et=0;et<$.length;et++)ee+=goog.string.Const.unwrap($[et]);return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(ee)};goog.html.TrustedResourceUrl.fromSafeScript=function($){$=goog.fs.blob.getBlobWithProperties([goog.html.SafeScript.unwrap($)],"text/javascript");$=goog.fs.url.createObjectUrl($);return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse($)};goog.html.TrustedResourceUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={};goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse=function($){$=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY?goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createScriptURL($):$;return new goog.html.TrustedResourceUrl(goog.html.TrustedResourceUrl.CONSTRUCTOR_TOKEN_PRIVATE_,$)};goog.html.TrustedResourceUrl.stringifyParams_=function($,ee,et){if(null==et)return ee;if("string"===typeof et)return et?$+encodeURIComponent(et):"";for(var en in et){var ei=et[en];ei=Array.isArray(ei)?ei:[ei];for(var eo=0;eo<ei.length;eo++){var es=ei[eo];null!=es&&(ee||(ee=$),ee+=(ee.length>$.length?"&":"")+encodeURIComponent(en)+"="+encodeURIComponent(String(es)))}}return ee};goog.html.TrustedResourceUrl.CONSTRUCTOR_TOKEN_PRIVATE_={};goog.string.internal={};goog.string.internal.startsWith=function($,ee){return 0==$.lastIndexOf(ee,0)};goog.string.internal.endsWith=function($,ee){var et=$.length-ee.length;return 0<=et&&$.indexOf(ee,et)==et};goog.string.internal.caseInsensitiveStartsWith=function($,ee){return 0==goog.string.internal.caseInsensitiveCompare(ee,$.substr(0,ee.length))};goog.string.internal.caseInsensitiveEndsWith=function($,ee){return 0==goog.string.internal.caseInsensitiveCompare(ee,$.substr($.length-ee.length,ee.length))};goog.string.internal.caseInsensitiveEquals=function($,ee){return $.toLowerCase()==ee.toLowerCase()};goog.string.internal.isEmptyOrWhitespace=function($){return/^[\s\xa0]*$/.test($)};goog.string.internal.trim=goog.TRUSTED_SITE&&String.prototype.trim?function($){return $.trim()}:function($){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec($)[1]};goog.string.internal.caseInsensitiveCompare=function($,ee){$=String($).toLowerCase();ee=String(ee).toLowerCase();return $<ee?-1:$==ee?0:1};goog.string.internal.newLineToBr=function($,ee){return $.replace(/(\r\n|\r|\n)/g,ee?"<br />":"<br>")};goog.string.internal.htmlEscape=function($,ee){if(ee)$=$.replace(goog.string.internal.AMP_RE_,"&amp;").replace(goog.string.internal.LT_RE_,"&lt;").replace(goog.string.internal.GT_RE_,"&gt;").replace(goog.string.internal.QUOT_RE_,"&quot;").replace(goog.string.internal.SINGLE_QUOTE_RE_,"&#39;").replace(goog.string.internal.NULL_RE_,"&#0;");else{if(!goog.string.internal.ALL_RE_.test($))return $;-1!=$.indexOf("&")&&($=$.replace(goog.string.internal.AMP_RE_,"&amp;"));-1!=$.indexOf("<")&&($=$.replace(goog.string.internal.LT_RE_,"&lt;"));-1!=$.indexOf(">")&&($=$.replace(goog.string.internal.GT_RE_,"&gt;"));-1!=$.indexOf('"')&&($=$.replace(goog.string.internal.QUOT_RE_,"&quot;"));-1!=$.indexOf("'")&&($=$.replace(goog.string.internal.SINGLE_QUOTE_RE_,"&#39;"));-1!=$.indexOf("\x00")&&($=$.replace(goog.string.internal.NULL_RE_,"&#0;"))}return $};goog.string.internal.AMP_RE_=/&/g;goog.string.internal.LT_RE_=/</g;goog.string.internal.GT_RE_=/>/g;goog.string.internal.QUOT_RE_=/"/g;goog.string.internal.SINGLE_QUOTE_RE_=/'/g;goog.string.internal.NULL_RE_=/\x00/g;goog.string.internal.ALL_RE_=/[\x00&<>"']/;goog.string.internal.whitespaceEscape=function($,ee){return goog.string.internal.newLineToBr($.replace(/ /g," &#160;"),ee)};goog.string.internal.contains=function($,ee){return-1!=$.indexOf(ee)};goog.string.internal.caseInsensitiveContains=function($,ee){return goog.string.internal.contains($.toLowerCase(),ee.toLowerCase())};goog.string.internal.compareVersions=function($,ee){var et=0;$=goog.string.internal.trim(String($)).split(".");ee=goog.string.internal.trim(String(ee)).split(".");for(var en=Math.max($.length,ee.length),ei=0;0==et&&ei<en;ei++){var eo=$[ei]||"",es=ee[ei]||"";do{eo=/(\d*)(\D*)(.*)/.exec(eo)||["","","",""];es=/(\d*)(\D*)(.*)/.exec(es)||["","","",""];if(0==eo[0].length&&0==es[0].length)break;et=0==eo[1].length?0:parseInt(eo[1],10);var eu=0==es[1].length?0:parseInt(es[1],10);et=goog.string.internal.compareElements_(et,eu)||goog.string.internal.compareElements_(0==eo[2].length,0==es[2].length)||goog.string.internal.compareElements_(eo[2],es[2]);eo=eo[3];es=es[3]}while(0==et)}return et};goog.string.internal.compareElements_=function($,ee){return $<ee?-1:$>ee?1:0};goog.html.SafeUrl=function($,ee){this.privateDoNotAccessOrElseSafeUrlWrappedValue_=$===goog.html.SafeUrl.CONSTRUCTOR_TOKEN_PRIVATE_&&ee||"";this.SAFE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_};goog.html.SafeUrl.INNOCUOUS_STRING="about:invalid#zClosurez";goog.html.SafeUrl.prototype.implementsGoogStringTypedString=!0;goog.html.SafeUrl.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeUrlWrappedValue_.toString()};goog.html.SafeUrl.prototype.implementsGoogI18nBidiDirectionalString=!0;goog.html.SafeUrl.prototype.getDirection=function(){return goog.i18n.bidi.Dir.LTR};goog.DEBUG&&(goog.html.SafeUrl.prototype.toString=function(){return"SafeUrl{"+this.privateDoNotAccessOrElseSafeUrlWrappedValue_+"}"});goog.html.SafeUrl.unwrap=function($){if($ instanceof goog.html.SafeUrl&&$.constructor===goog.html.SafeUrl&&$.SAFE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_)return $.privateDoNotAccessOrElseSafeUrlWrappedValue_;goog.asserts.fail("expected object of type SafeUrl, got '"+$+"' of type "+goog.typeOf($));return"type_error:SafeUrl"};goog.html.SafeUrl.fromConstant=function($){return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(goog.string.Const.unwrap($))};goog.html.SAFE_MIME_TYPE_PATTERN_=/^(?:audio\/(?:3gpp2|3gpp|aac|L16|midi|mp3|mp4|mpeg|oga|ogg|opus|x-m4a|x-matroska|x-wav|wav|webm)|image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp|x-icon)|text\/csv|video\/(?:mpeg|mp4|ogg|webm|quicktime|x-matroska))(?:;\w+=(?:\w+|"[\w;,= ]+"))*$/i;goog.html.SafeUrl.isSafeMimeType=function($){return goog.html.SAFE_MIME_TYPE_PATTERN_.test($)};goog.html.SafeUrl.fromBlob=function($){$=goog.html.SafeUrl.isSafeMimeType($.type)?goog.fs.url.createObjectUrl($):goog.html.SafeUrl.INNOCUOUS_STRING;return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse($)};goog.html.SafeUrl.fromMediaSource=function($){goog.asserts.assert("MediaSource"in goog.global,"No support for MediaSource");$=$ instanceof MediaSource?goog.fs.url.createObjectUrl($):goog.html.SafeUrl.INNOCUOUS_STRING;return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse($)};goog.html.DATA_URL_PATTERN_=/^data:(.*);base64,[a-z0-9+\/]+=*$/i;goog.html.SafeUrl.fromDataUrl=function($){$=$.replace(/(%0A|%0D)/g,"");var ee=$.match(goog.html.DATA_URL_PATTERN_);ee=ee&&goog.html.SafeUrl.isSafeMimeType(ee[1]);return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(ee?$:goog.html.SafeUrl.INNOCUOUS_STRING)};goog.html.SafeUrl.fromTelUrl=function($){goog.string.internal.caseInsensitiveStartsWith($,"tel:")||($=goog.html.SafeUrl.INNOCUOUS_STRING);return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse($)};goog.html.SIP_URL_PATTERN_=/^sip[s]?:[+a-z0-9_.!$%&'*\/=^`{|}~-]+@([a-z0-9-]+\.)+[a-z0-9]{2,63}$/i;goog.html.SafeUrl.fromSipUrl=function($){goog.html.SIP_URL_PATTERN_.test(decodeURIComponent($))||($=goog.html.SafeUrl.INNOCUOUS_STRING);return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse($)};goog.html.SafeUrl.fromFacebookMessengerUrl=function($){goog.string.internal.caseInsensitiveStartsWith($,"fb-messenger://share")||($=goog.html.SafeUrl.INNOCUOUS_STRING);return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse($)};goog.html.SafeUrl.fromWhatsAppUrl=function($){goog.string.internal.caseInsensitiveStartsWith($,"whatsapp://send")||($=goog.html.SafeUrl.INNOCUOUS_STRING);return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse($)};goog.html.SafeUrl.fromSmsUrl=function($){goog.string.internal.caseInsensitiveStartsWith($,"sms:")&&goog.html.SafeUrl.isSmsUrlBodyValid_($)||($=goog.html.SafeUrl.INNOCUOUS_STRING);return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse($)};goog.html.SafeUrl.isSmsUrlBodyValid_=function($){var ee=$.indexOf("#");0<ee&&($=$.substring(0,ee));ee=$.match(/[?&]body=/gi);if(!ee)return!0;if(1<ee.length)return!1;$=$.match(/[?&]body=([^&]*)/)[1];if(!$)return!0;try{decodeURIComponent($)}catch($){return!1}return/^(?:[a-z0-9\-_.~]|%[0-9a-f]{2})+$/i.test($)};goog.html.SafeUrl.fromSshUrl=function($){goog.string.internal.caseInsensitiveStartsWith($,"ssh://")||($=goog.html.SafeUrl.INNOCUOUS_STRING);return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse($)};goog.html.SafeUrl.sanitizeChromeExtensionUrl=function($,ee){return goog.html.SafeUrl.sanitizeExtensionUrl_(/^chrome-extension:\/\/([^\/]+)\//,$,ee)};goog.html.SafeUrl.sanitizeFirefoxExtensionUrl=function($,ee){return goog.html.SafeUrl.sanitizeExtensionUrl_(/^moz-extension:\/\/([^\/]+)\//,$,ee)};goog.html.SafeUrl.sanitizeEdgeExtensionUrl=function($,ee){return goog.html.SafeUrl.sanitizeExtensionUrl_(/^ms-browser-extension:\/\/([^\/]+)\//,$,ee)};goog.html.SafeUrl.sanitizeExtensionUrl_=function($,ee,et){($=$.exec(ee))?($=$[1],-1==(et instanceof goog.string.Const?[goog.string.Const.unwrap(et)]:et.map(function($){return goog.string.Const.unwrap($)})).indexOf($)&&(ee=goog.html.SafeUrl.INNOCUOUS_STRING)):ee=goog.html.SafeUrl.INNOCUOUS_STRING;return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(ee)};goog.html.SafeUrl.fromTrustedResourceUrl=function($){return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(goog.html.TrustedResourceUrl.unwrap($))};goog.html.SAFE_URL_PATTERN_=/^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i;goog.html.SafeUrl.SAFE_URL_PATTERN=goog.html.SAFE_URL_PATTERN_;goog.html.SafeUrl.sanitize=function($){if($ instanceof goog.html.SafeUrl)return $;$="object"==typeof $&&$.implementsGoogStringTypedString?$.getTypedStringValue():String($);goog.html.SAFE_URL_PATTERN_.test($)||($=goog.html.SafeUrl.INNOCUOUS_STRING);return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse($)};goog.html.SafeUrl.sanitizeAssertUnchanged=function($,ee){if($ instanceof goog.html.SafeUrl)return $;$="object"==typeof $&&$.implementsGoogStringTypedString?$.getTypedStringValue():String($);if(ee&&/^data:/i.test($)&&(ee=goog.html.SafeUrl.fromDataUrl($),ee.getTypedStringValue()==$))return ee;goog.asserts.assert(goog.html.SAFE_URL_PATTERN_.test($),"%s does not match the safe URL pattern",$)||($=goog.html.SafeUrl.INNOCUOUS_STRING);return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse($)};goog.html.SafeUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={};goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse=function($){return new goog.html.SafeUrl(goog.html.SafeUrl.CONSTRUCTOR_TOKEN_PRIVATE_,$)};goog.html.SafeUrl.ABOUT_BLANK=goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse("about:blank");goog.html.SafeUrl.CONSTRUCTOR_TOKEN_PRIVATE_={};goog.html.SafeStyle=function(){this.privateDoNotAccessOrElseSafeStyleWrappedValue_="";this.SAFE_STYLE_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeStyle.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_};goog.html.SafeStyle.prototype.implementsGoogStringTypedString=!0;goog.html.SafeStyle.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={};goog.html.SafeStyle.fromConstant=function($){$=goog.string.Const.unwrap($);if(0===$.length)return goog.html.SafeStyle.EMPTY;goog.asserts.assert(goog.string.internal.endsWith($,";"),"Last character of style string is not ';': "+$);goog.asserts.assert(goog.string.internal.contains($,":"),"Style string must contain at least one ':', to specify a \"name: value\" pair: "+$);return goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse($)};goog.html.SafeStyle.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeStyleWrappedValue_};goog.DEBUG&&(goog.html.SafeStyle.prototype.toString=function(){return"SafeStyle{"+this.privateDoNotAccessOrElseSafeStyleWrappedValue_+"}"});goog.html.SafeStyle.unwrap=function($){if($ instanceof goog.html.SafeStyle&&$.constructor===goog.html.SafeStyle&&$.SAFE_STYLE_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeStyle.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_)return $.privateDoNotAccessOrElseSafeStyleWrappedValue_;goog.asserts.fail("expected object of type SafeStyle, got '"+$+"' of type "+goog.typeOf($));return"type_error:SafeStyle"};goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse=function($){return(new goog.html.SafeStyle).initSecurityPrivateDoNotAccessOrElse_($)};goog.html.SafeStyle.prototype.initSecurityPrivateDoNotAccessOrElse_=function($){this.privateDoNotAccessOrElseSafeStyleWrappedValue_=$;return this};goog.html.SafeStyle.EMPTY=goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse("");goog.html.SafeStyle.INNOCUOUS_STRING="zClosurez";goog.html.SafeStyle.create=function($){var ee="",et;for(et in $){if(!/^[-_a-zA-Z0-9]+$/.test(et))throw Error("Name allows only [-_a-zA-Z0-9], got: "+et);var en=$[et];null!=en&&(en=Array.isArray(en)?goog.array.map(en,goog.html.SafeStyle.sanitizePropertyValue_).join(" "):goog.html.SafeStyle.sanitizePropertyValue_(en),ee+=et+":"+en+";")}return ee?goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(ee):goog.html.SafeStyle.EMPTY};goog.html.SafeStyle.sanitizePropertyValue_=function($){if($ instanceof goog.html.SafeUrl)return'url("'+goog.html.SafeUrl.unwrap($).replace(/</g,"%3c").replace(/[\\"]/g,"\\$&")+'")';$=$ instanceof goog.string.Const?goog.string.Const.unwrap($):goog.html.SafeStyle.sanitizePropertyValueString_(String($));if(/[{;}]/.test($))throw new goog.asserts.AssertionError("Value does not allow [{;}], got: %s.",[$]);return $};goog.html.SafeStyle.sanitizePropertyValueString_=function($){var ee=$.replace(goog.html.SafeStyle.FUNCTIONS_RE_,"$1").replace(goog.html.SafeStyle.FUNCTIONS_RE_,"$1").replace(goog.html.SafeStyle.URL_RE_,"url");if(goog.html.SafeStyle.VALUE_RE_.test(ee)){if(goog.html.SafeStyle.COMMENT_RE_.test($))return goog.asserts.fail("String value disallows comments, got: "+$),goog.html.SafeStyle.INNOCUOUS_STRING;if(!goog.html.SafeStyle.hasBalancedQuotes_($))return goog.asserts.fail("String value requires balanced quotes, got: "+$),goog.html.SafeStyle.INNOCUOUS_STRING;if(!goog.html.SafeStyle.hasBalancedSquareBrackets_($))return goog.asserts.fail("String value requires balanced square brackets and one identifier per pair of brackets, got: "+$),goog.html.SafeStyle.INNOCUOUS_STRING}else return goog.asserts.fail("String value allows only "+goog.html.SafeStyle.VALUE_ALLOWED_CHARS_+" and simple functions, got: "+$),goog.html.SafeStyle.INNOCUOUS_STRING;return goog.html.SafeStyle.sanitizeUrl_($)};goog.html.SafeStyle.hasBalancedQuotes_=function($){for(var ee=!0,et=!0,en=0;en<$.length;en++){var ei=$.charAt(en);"'"==ei&&et?ee=!ee:'"'==ei&&ee&&(et=!et)}return ee&&et};goog.html.SafeStyle.hasBalancedSquareBrackets_=function($){for(var ee=!0,et=/^[-_a-zA-Z0-9]$/,en=0;en<$.length;en++){var ei=$.charAt(en);if("]"==ei){if(ee)return!1;ee=!0}else if("["==ei){if(!ee)return!1;ee=!1}else if(!ee&&!et.test(ei))return!1}return ee};goog.html.SafeStyle.VALUE_ALLOWED_CHARS_="[-,.\"'%_!# a-zA-Z0-9\\[\\]]";goog.html.SafeStyle.VALUE_RE_=new RegExp("^"+goog.html.SafeStyle.VALUE_ALLOWED_CHARS_+"+$");goog.html.SafeStyle.URL_RE_=/\b(url\([ \t\n]*)('[ -&(-\[\]-~]*'|"[ !#-\[\]-~]*"|[!#-&*-\[\]-~]*)([ \t\n]*\))/g;goog.html.SafeStyle.ALLOWED_FUNCTIONS_="calc cubic-bezier fit-content hsl hsla linear-gradient matrix minmax repeat rgb rgba (rotate|scale|translate)(X|Y|Z|3d)?".split(" ");goog.html.SafeStyle.FUNCTIONS_RE_=new RegExp("\\b("+goog.html.SafeStyle.ALLOWED_FUNCTIONS_.join("|")+")\\([-+*/0-9a-z.%\\[\\], ]+\\)","g");goog.html.SafeStyle.COMMENT_RE_=/\/\*/;goog.html.SafeStyle.sanitizeUrl_=function($){return $.replace(goog.html.SafeStyle.URL_RE_,function($,ee,et,en){var ei="";et=et.replace(/^(['"])(.*)\1$/,function($,ee,et){ei=ee;return et});$=goog.html.SafeUrl.sanitize(et).getTypedStringValue();return ee+ei+$+ei+en})};goog.html.SafeStyle.concat=function($){var ee="",et=function($){Array.isArray($)?goog.array.forEach($,et):ee+=goog.html.SafeStyle.unwrap($)};goog.array.forEach(arguments,et);return ee?goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(ee):goog.html.SafeStyle.EMPTY};goog.html.SafeStyleSheet=function(){this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_="";this.SAFE_STYLE_SHEET_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeStyleSheet.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_};goog.html.SafeStyleSheet.prototype.implementsGoogStringTypedString=!0;goog.html.SafeStyleSheet.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={};goog.html.SafeStyleSheet.createRule=function($,ee){if(goog.string.internal.contains($,"<"))throw Error("Selector does not allow '<', got: "+$);var et=$.replace(/('|")((?!\1)[^\r\n\f\\]|\\[\s\S])*\1/g,"");if(!/^[-_a-zA-Z0-9#.:* ,>+~[\]()=^$|]+$/.test(et))throw Error("Selector allows only [-_a-zA-Z0-9#.:* ,>+~[\\]()=^$|] and strings, got: "+$);if(!goog.html.SafeStyleSheet.hasBalancedBrackets_(et))throw Error("() and [] in selector must be balanced, got: "+$);ee instanceof goog.html.SafeStyle||(ee=goog.html.SafeStyle.create(ee));$=$+"{"+goog.html.SafeStyle.unwrap(ee).replace(/</g,"\\3C ")+"}";return goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse($)};goog.html.SafeStyleSheet.hasBalancedBrackets_=function($){for(var ee={"(":")","[":"]"},et=[],en=0;en<$.length;en++){var ei=$[en];if(ee[ei])et.push(ee[ei]);else if(goog.object.contains(ee,ei)&&et.pop()!=ei)return!1}return 0==et.length};goog.html.SafeStyleSheet.concat=function($){var ee="",et=function($){Array.isArray($)?goog.array.forEach($,et):ee+=goog.html.SafeStyleSheet.unwrap($)};goog.array.forEach(arguments,et);return goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(ee)};goog.html.SafeStyleSheet.fromConstant=function($){$=goog.string.Const.unwrap($);if(0===$.length)return goog.html.SafeStyleSheet.EMPTY;goog.asserts.assert(!goog.string.internal.contains($,"<"),"Forbidden '<' character in style sheet string: "+$);return goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse($)};goog.html.SafeStyleSheet.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_};goog.DEBUG&&(goog.html.SafeStyleSheet.prototype.toString=function(){return"SafeStyleSheet{"+this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_+"}"});goog.html.SafeStyleSheet.unwrap=function($){if($ instanceof goog.html.SafeStyleSheet&&$.constructor===goog.html.SafeStyleSheet&&$.SAFE_STYLE_SHEET_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeStyleSheet.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_)return $.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_;goog.asserts.fail("expected object of type SafeStyleSheet, got '"+$+"' of type "+goog.typeOf($));return"type_error:SafeStyleSheet"};goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse=function($){return(new goog.html.SafeStyleSheet).initSecurityPrivateDoNotAccessOrElse_($)};goog.html.SafeStyleSheet.prototype.initSecurityPrivateDoNotAccessOrElse_=function($){this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_=$;return this};goog.html.SafeStyleSheet.EMPTY=goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse("");goog.labs={};goog.labs.userAgent={};goog.labs.userAgent.util={};goog.labs.userAgent.util.getNativeUserAgentString_=function(){var $=goog.labs.userAgent.util.getNavigator_();return $&&($=$.userAgent)?$:""};goog.labs.userAgent.util.getNavigator_=function(){return goog.global.navigator};goog.labs.userAgent.util.userAgent_=goog.labs.userAgent.util.getNativeUserAgentString_();goog.labs.userAgent.util.setUserAgent=function($){goog.labs.userAgent.util.userAgent_=$||goog.labs.userAgent.util.getNativeUserAgentString_()};goog.labs.userAgent.util.getUserAgent=function(){return goog.labs.userAgent.util.userAgent_};goog.labs.userAgent.util.matchUserAgent=function($){var ee=goog.labs.userAgent.util.getUserAgent();return goog.string.internal.contains(ee,$)};goog.labs.userAgent.util.matchUserAgentIgnoreCase=function($){var ee=goog.labs.userAgent.util.getUserAgent();return goog.string.internal.caseInsensitiveContains(ee,$)};goog.labs.userAgent.util.extractVersionTuples=function($){for(var ee=/(\w[\w ]+)\/([^\s]+)\s*(?:\((.*?)\))?/g,et=[],en;en=ee.exec($);)et.push([en[1],en[2],en[3]||void 0]);return et};goog.labs.userAgent.browser={};goog.labs.userAgent.browser.matchOpera_=function(){return goog.labs.userAgent.util.matchUserAgent("Opera")};goog.labs.userAgent.browser.matchIE_=function(){return goog.labs.userAgent.util.matchUserAgent("Trident")||goog.labs.userAgent.util.matchUserAgent("MSIE")};goog.labs.userAgent.browser.matchEdgeHtml_=function(){return goog.labs.userAgent.util.matchUserAgent("Edge")};goog.labs.userAgent.browser.matchEdgeChromium_=function(){return goog.labs.userAgent.util.matchUserAgent("Edg/")};goog.labs.userAgent.browser.matchOperaChromium_=function(){return goog.labs.userAgent.util.matchUserAgent("OPR")};goog.labs.userAgent.browser.matchFirefox_=function(){return goog.labs.userAgent.util.matchUserAgent("Firefox")||goog.labs.userAgent.util.matchUserAgent("FxiOS")};goog.labs.userAgent.browser.matchSafari_=function(){return goog.labs.userAgent.util.matchUserAgent("Safari")&&!(goog.labs.userAgent.browser.matchChrome_()||goog.labs.userAgent.browser.matchCoast_()||goog.labs.userAgent.browser.matchOpera_()||goog.labs.userAgent.browser.matchEdgeHtml_()||goog.labs.userAgent.browser.matchEdgeChromium_()||goog.labs.userAgent.browser.matchOperaChromium_()||goog.labs.userAgent.browser.matchFirefox_()||goog.labs.userAgent.browser.isSilk()||goog.labs.userAgent.util.matchUserAgent("Android"))};goog.labs.userAgent.browser.matchCoast_=function(){return goog.labs.userAgent.util.matchUserAgent("Coast")};goog.labs.userAgent.browser.matchIosWebview_=function(){return(goog.labs.userAgent.util.matchUserAgent("iPad")||goog.labs.userAgent.util.matchUserAgent("iPhone"))&&!goog.labs.userAgent.browser.matchSafari_()&&!goog.labs.userAgent.browser.matchChrome_()&&!goog.labs.userAgent.browser.matchCoast_()&&!goog.labs.userAgent.browser.matchFirefox_()&&goog.labs.userAgent.util.matchUserAgent("AppleWebKit")};goog.labs.userAgent.browser.matchChrome_=function(){return(goog.labs.userAgent.util.matchUserAgent("Chrome")||goog.labs.userAgent.util.matchUserAgent("CriOS"))&&!goog.labs.userAgent.browser.matchEdgeHtml_()};goog.labs.userAgent.browser.matchAndroidBrowser_=function(){return goog.labs.userAgent.util.matchUserAgent("Android")&&!(goog.labs.userAgent.browser.isChrome()||goog.labs.userAgent.browser.isFirefox()||goog.labs.userAgent.browser.isOpera()||goog.labs.userAgent.browser.isSilk())};goog.labs.userAgent.browser.isOpera=goog.labs.userAgent.browser.matchOpera_;goog.labs.userAgent.browser.isIE=goog.labs.userAgent.browser.matchIE_;goog.labs.userAgent.browser.isEdge=goog.labs.userAgent.browser.matchEdgeHtml_;goog.labs.userAgent.browser.isEdgeChromium=goog.labs.userAgent.browser.matchEdgeChromium_;goog.labs.userAgent.browser.isOperaChromium=goog.labs.userAgent.browser.matchOperaChromium_;goog.labs.userAgent.browser.isFirefox=goog.labs.userAgent.browser.matchFirefox_;goog.labs.userAgent.browser.isSafari=goog.labs.userAgent.browser.matchSafari_;goog.labs.userAgent.browser.isCoast=goog.labs.userAgent.browser.matchCoast_;goog.labs.userAgent.browser.isIosWebview=goog.labs.userAgent.browser.matchIosWebview_;goog.labs.userAgent.browser.isChrome=goog.labs.userAgent.browser.matchChrome_;goog.labs.userAgent.browser.isAndroidBrowser=goog.labs.userAgent.browser.matchAndroidBrowser_;goog.labs.userAgent.browser.isSilk=function(){return goog.labs.userAgent.util.matchUserAgent("Silk")};goog.labs.userAgent.browser.getVersion=function(){function $($){$=goog.array.find($,en);return et[$]||""}var ee=goog.labs.userAgent.util.getUserAgent();if(goog.labs.userAgent.browser.isIE())return goog.labs.userAgent.browser.getIEVersion_(ee);ee=goog.labs.userAgent.util.extractVersionTuples(ee);var et={};goog.array.forEach(ee,function($){et[$[0]]=$[1]});var en=goog.partial(goog.object.containsKey,et);return goog.labs.userAgent.browser.isOpera()?$(["Version","Opera"]):goog.labs.userAgent.browser.isEdge()?$(["Edge"]):goog.labs.userAgent.browser.isEdgeChromium()?$(["Edg"]):goog.labs.userAgent.browser.isChrome()?$(["Chrome","CriOS","HeadlessChrome"]):(ee=ee[2])&&ee[1]||""};goog.labs.userAgent.browser.isVersionOrHigher=function($){return 0<=goog.string.internal.compareVersions(goog.labs.userAgent.browser.getVersion(),$)};goog.labs.userAgent.browser.getIEVersion_=function($){var ee=/rv: *([\d\.]*)/.exec($);if(ee&&ee[1])return ee[1];ee="";var et=/MSIE +([\d\.]+)/.exec($);if(et&&et[1])if($=/Trident\/(\d.\d)/.exec($),"7.0"==et[1])if($&&$[1])switch($[1]){case"4.0":ee="8.0";break;case"5.0":ee="9.0";break;case"6.0":ee="10.0";break;case"7.0":ee="11.0"}else ee="7.0";else ee=et[1];return ee};goog.html.SafeHtml=function(){this.privateDoNotAccessOrElseSafeHtmlWrappedValue_="";this.SAFE_HTML_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_=goog.html.SafeHtml.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_;this.dir_=null};goog.html.SafeHtml.ENABLE_ERROR_MESSAGES=goog.DEBUG;goog.html.SafeHtml.SUPPORT_STYLE_ATTRIBUTE=!0;goog.html.SafeHtml.prototype.implementsGoogI18nBidiDirectionalString=!0;goog.html.SafeHtml.prototype.getDirection=function(){return this.dir_};goog.html.SafeHtml.prototype.implementsGoogStringTypedString=!0;goog.html.SafeHtml.prototype.getTypedStringValue=function(){return this.privateDoNotAccessOrElseSafeHtmlWrappedValue_.toString()};goog.DEBUG&&(goog.html.SafeHtml.prototype.toString=function(){return"SafeHtml{"+this.privateDoNotAccessOrElseSafeHtmlWrappedValue_+"}"});goog.html.SafeHtml.unwrap=function($){return goog.html.SafeHtml.unwrapTrustedHTML($).toString()};goog.html.SafeHtml.unwrapTrustedHTML=function($){if($ instanceof goog.html.SafeHtml&&$.constructor===goog.html.SafeHtml&&$.SAFE_HTML_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_===goog.html.SafeHtml.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_)return $.privateDoNotAccessOrElseSafeHtmlWrappedValue_;goog.asserts.fail("expected object of type SafeHtml, got '"+$+"' of type "+goog.typeOf($));return"type_error:SafeHtml"};goog.html.SafeHtml.htmlEscape=function($){if($ instanceof goog.html.SafeHtml)return $;var ee="object"==typeof $,et=null;ee&&$.implementsGoogI18nBidiDirectionalString&&(et=$.getDirection());$=ee&&$.implementsGoogStringTypedString?$.getTypedStringValue():String($);return goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(goog.string.internal.htmlEscape($),et)};goog.html.SafeHtml.htmlEscapePreservingNewlines=function($){if($ instanceof goog.html.SafeHtml)return $;$=goog.html.SafeHtml.htmlEscape($);return goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(goog.string.internal.newLineToBr(goog.html.SafeHtml.unwrap($)),$.getDirection())};goog.html.SafeHtml.htmlEscapePreservingNewlinesAndSpaces=function($){if($ instanceof goog.html.SafeHtml)return $;$=goog.html.SafeHtml.htmlEscape($);return goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(goog.string.internal.whitespaceEscape(goog.html.SafeHtml.unwrap($)),$.getDirection())};goog.html.SafeHtml.from=goog.html.SafeHtml.htmlEscape;goog.html.SafeHtml.comment=function($){return goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("<!--"+goog.string.internal.htmlEscape($)+"-->",null)};goog.html.SafeHtml.VALID_NAMES_IN_TAG_=/^[a-zA-Z0-9-]+$/;goog.html.SafeHtml.URL_ATTRIBUTES_={action:!0,cite:!0,data:!0,formaction:!0,href:!0,manifest:!0,poster:!0,src:!0};goog.html.SafeHtml.NOT_ALLOWED_TAG_NAMES_={APPLET:!0,BASE:!0,EMBED:!0,IFRAME:!0,LINK:!0,MATH:!0,META:!0,OBJECT:!0,SCRIPT:!0,STYLE:!0,SVG:!0,TEMPLATE:!0};goog.html.SafeHtml.create=function($,ee,et){goog.html.SafeHtml.verifyTagName(String($));return goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse(String($),ee,et)};goog.html.SafeHtml.verifyTagName=function($){if(!goog.html.SafeHtml.VALID_NAMES_IN_TAG_.test($))throw Error(goog.html.SafeHtml.ENABLE_ERROR_MESSAGES?"Invalid tag name <"+$+">.":"");if($.toUpperCase() in goog.html.SafeHtml.NOT_ALLOWED_TAG_NAMES_)throw Error(goog.html.SafeHtml.ENABLE_ERROR_MESSAGES?"Tag name <"+$+"> is not allowed for SafeHtml.":"")};goog.html.SafeHtml.createIframe=function($,ee,et,en){$&&goog.html.TrustedResourceUrl.unwrap($);var ei={};ei.src=$||null;ei.srcdoc=ee&&goog.html.SafeHtml.unwrap(ee);$=goog.html.SafeHtml.combineAttributes(ei,{sandbox:""},et);return goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("iframe",$,en)};goog.html.SafeHtml.createSandboxIframe=function($,ee,et,en){if(!goog.html.SafeHtml.canUseSandboxIframe())throw Error(goog.html.SafeHtml.ENABLE_ERROR_MESSAGES?"The browser does not support sandboxed iframes.":"");var ei={};ei.src=$?goog.html.SafeUrl.unwrap(goog.html.SafeUrl.sanitize($)):null;ei.srcdoc=ee||null;ei.sandbox="";$=goog.html.SafeHtml.combineAttributes(ei,{},et);return goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("iframe",$,en)};goog.html.SafeHtml.canUseSandboxIframe=function(){return goog.global.HTMLIFrameElement&&"sandbox"in goog.global.HTMLIFrameElement.prototype};goog.html.SafeHtml.createScriptSrc=function($,ee){goog.html.TrustedResourceUrl.unwrap($);$=goog.html.SafeHtml.combineAttributes({src:$},{},ee);return goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("script",$)};goog.html.SafeHtml.createScript=function($,ee){for(var et in ee){var en=et.toLowerCase();if("language"==en||"src"==en||"text"==en||"type"==en)throw Error(goog.html.SafeHtml.ENABLE_ERROR_MESSAGES?'Cannot set "'+en+'" attribute':"")}et="";$=goog.array.concat($);for(en=0;en<$.length;en++)et+=goog.html.SafeScript.unwrap($[en]);$=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(et,goog.i18n.bidi.Dir.NEUTRAL);return goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("script",ee,$)};goog.html.SafeHtml.createStyle=function($,ee){ee=goog.html.SafeHtml.combineAttributes({type:"text/css"},{},ee);var et="";$=goog.array.concat($);for(var en=0;en<$.length;en++)et+=goog.html.SafeStyleSheet.unwrap($[en]);$=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(et,goog.i18n.bidi.Dir.NEUTRAL);return goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("style",ee,$)};goog.html.SafeHtml.createMetaRefresh=function($,ee){$=goog.html.SafeUrl.unwrap(goog.html.SafeUrl.sanitize($));(goog.labs.userAgent.browser.isIE()||goog.labs.userAgent.browser.isEdge())&&goog.string.internal.contains($,";")&&($="'"+$.replace(/'/g,"%27")+"'");return goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("meta",{"http-equiv":"refresh",content:(ee||0)+"; url="+$})};goog.html.SafeHtml.getAttrNameAndValue_=function($,ee,et){if(et instanceof goog.string.Const)et=goog.string.Const.unwrap(et);else if("style"==ee.toLowerCase())if(goog.html.SafeHtml.SUPPORT_STYLE_ATTRIBUTE)et=goog.html.SafeHtml.getStyleValue_(et);else throw Error(goog.html.SafeHtml.ENABLE_ERROR_MESSAGES?'Attribute "style" not supported.':"");else{if(/^on/i.test(ee))throw Error(goog.html.SafeHtml.ENABLE_ERROR_MESSAGES?'Attribute "'+ee+'" requires goog.string.Const value, "'+et+'" given.':"");if(ee.toLowerCase() in goog.html.SafeHtml.URL_ATTRIBUTES_)if(et instanceof goog.html.TrustedResourceUrl)et=goog.html.TrustedResourceUrl.unwrap(et);else if(et instanceof goog.html.SafeUrl)et=goog.html.SafeUrl.unwrap(et);else if("string"===typeof et)et=goog.html.SafeUrl.sanitize(et).getTypedStringValue();else throw Error(goog.html.SafeHtml.ENABLE_ERROR_MESSAGES?'Attribute "'+ee+'" on tag "'+$+'" requires goog.html.SafeUrl, goog.string.Const, or string, value "'+et+'" given.':"")}et.implementsGoogStringTypedString&&(et=et.getTypedStringValue());goog.asserts.assert("string"===typeof et||"number"===typeof et,"String or number value expected, got "+typeof et+" with value: "+et);return ee+'="'+goog.string.internal.htmlEscape(String(et))+'"'};goog.html.SafeHtml.getStyleValue_=function($){if(!goog.isObject($))throw Error(goog.html.SafeHtml.ENABLE_ERROR_MESSAGES?'The "style" attribute requires goog.html.SafeStyle or map of style properties, '+typeof $+" given: "+$:"");$ instanceof goog.html.SafeStyle||($=goog.html.SafeStyle.create($));return goog.html.SafeStyle.unwrap($)};goog.html.SafeHtml.createWithDir=function($,ee,et,en){ee=goog.html.SafeHtml.create(ee,et,en);ee.dir_=$;return ee};goog.html.SafeHtml.join=function($,ee){$=goog.html.SafeHtml.htmlEscape($);var et=$.getDirection(),en=[],ei=function($){Array.isArray($)?goog.array.forEach($,ei):($=goog.html.SafeHtml.htmlEscape($),en.push(goog.html.SafeHtml.unwrap($)),$=$.getDirection(),et==goog.i18n.bidi.Dir.NEUTRAL?et=$:$!=goog.i18n.bidi.Dir.NEUTRAL&&et!=$&&(et=null))};goog.array.forEach(ee,ei);return goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(en.join(goog.html.SafeHtml.unwrap($)),et)};goog.html.SafeHtml.concat=function($){return goog.html.SafeHtml.join(goog.html.SafeHtml.EMPTY,Array.prototype.slice.call(arguments))};goog.html.SafeHtml.concatWithDir=function($,ee){var et=goog.html.SafeHtml.concat(goog.array.slice(arguments,1));et.dir_=$;return et};goog.html.SafeHtml.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_={};goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse=function($,ee){return(new goog.html.SafeHtml).initSecurityPrivateDoNotAccessOrElse_($,ee)};goog.html.SafeHtml.prototype.initSecurityPrivateDoNotAccessOrElse_=function($,ee){this.privateDoNotAccessOrElseSafeHtmlWrappedValue_=goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY?goog.html.trustedtypes.PRIVATE_DO_NOT_ACCESS_OR_ELSE_POLICY.createHTML($):$;this.dir_=ee;return this};goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse=function($,ee,et){var en=null;var ei="<"+$+goog.html.SafeHtml.stringifyAttributes($,ee);null==et?et=[]:Array.isArray(et)||(et=[et]);goog.dom.tags.isVoidTag($.toLowerCase())?(goog.asserts.assert(!et.length,"Void tag <"+$+"> does not allow content."),ei+=">"):(en=goog.html.SafeHtml.concat(et),ei+=">"+goog.html.SafeHtml.unwrap(en)+"</"+$+">",en=en.getDirection());($=ee&&ee.dir)&&(en=/^(ltr|rtl|auto)$/i.test($)?goog.i18n.bidi.Dir.NEUTRAL:null);return goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(ei,en)};goog.html.SafeHtml.stringifyAttributes=function($,ee){var et="";if(ee)for(var en in ee){if(!goog.html.SafeHtml.VALID_NAMES_IN_TAG_.test(en))throw Error(goog.html.SafeHtml.ENABLE_ERROR_MESSAGES?'Invalid attribute name "'+en+'".':"");var ei=ee[en];null!=ei&&(et+=" "+goog.html.SafeHtml.getAttrNameAndValue_($,en,ei))}return et};goog.html.SafeHtml.combineAttributes=function($,ee,et){var en={},ei;for(ei in $)goog.asserts.assert(ei.toLowerCase()==ei,"Must be lower case"),en[ei]=$[ei];for(ei in ee)goog.asserts.assert(ei.toLowerCase()==ei,"Must be lower case"),en[ei]=ee[ei];if(et)for(ei in et){var eo=ei.toLowerCase();if(eo in $)throw Error(goog.html.SafeHtml.ENABLE_ERROR_MESSAGES?'Cannot override "'+eo+'" attribute, got "'+ei+'" with value "'+et[ei]+'"':"");eo in ee&&delete en[eo];en[ei]=et[ei]}return en};goog.html.SafeHtml.DOCTYPE_HTML=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("<!DOCTYPE html>",goog.i18n.bidi.Dir.NEUTRAL);goog.html.SafeHtml.EMPTY=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("",goog.i18n.bidi.Dir.NEUTRAL);goog.html.SafeHtml.BR=goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("<br>",goog.i18n.bidi.Dir.NEUTRAL);goog.html.uncheckedconversions={};goog.html.uncheckedconversions.safeHtmlFromStringKnownToSatisfyTypeContract=function($,ee,et){goog.asserts.assertString(goog.string.Const.unwrap($),"must provide justification");goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap($)),"must provide non-empty justification");return goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(ee,et||null)};goog.html.uncheckedconversions.safeScriptFromStringKnownToSatisfyTypeContract=function($,ee){goog.asserts.assertString(goog.string.Const.unwrap($),"must provide justification");goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap($)),"must provide non-empty justification");return goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(ee)};goog.html.uncheckedconversions.safeStyleFromStringKnownToSatisfyTypeContract=function($,ee){goog.asserts.assertString(goog.string.Const.unwrap($),"must provide justification");goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap($)),"must provide non-empty justification");return goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(ee)};goog.html.uncheckedconversions.safeStyleSheetFromStringKnownToSatisfyTypeContract=function($,ee){goog.asserts.assertString(goog.string.Const.unwrap($),"must provide justification");goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap($)),"must provide non-empty justification");return goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(ee)};goog.html.uncheckedconversions.safeUrlFromStringKnownToSatisfyTypeContract=function($,ee){goog.asserts.assertString(goog.string.Const.unwrap($),"must provide justification");goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap($)),"must provide non-empty justification");return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(ee)};goog.html.uncheckedconversions.trustedResourceUrlFromStringKnownToSatisfyTypeContract=function($,ee){goog.asserts.assertString(goog.string.Const.unwrap($),"must provide justification");goog.asserts.assert(!goog.string.internal.isEmptyOrWhitespace(goog.string.Const.unwrap($)),"must provide non-empty justification");return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(ee)};goog.dom.safe={};goog.dom.safe.InsertAdjacentHtmlPosition={AFTERBEGIN:"afterbegin",AFTEREND:"afterend",BEFOREBEGIN:"beforebegin",BEFOREEND:"beforeend"};goog.dom.safe.insertAdjacentHtml=function($,ee,et){$.insertAdjacentHTML(ee,goog.html.SafeHtml.unwrapTrustedHTML(et))};goog.dom.safe.SET_INNER_HTML_DISALLOWED_TAGS_={MATH:!0,SCRIPT:!0,STYLE:!0,SVG:!0,TEMPLATE:!0};goog.dom.safe.isInnerHtmlCleanupRecursive_=goog.functions.cacheReturnValue(function(){if(goog.DEBUG&&"undefined"===typeof document)return!1;var $=document.createElement("div"),ee=document.createElement("div");ee.appendChild(document.createElement("div"));$.appendChild(ee);if(goog.DEBUG&&!$.firstChild)return!1;ee=$.firstChild.firstChild;$.innerHTML=goog.html.SafeHtml.unwrapTrustedHTML(goog.html.SafeHtml.EMPTY);return!ee.parentElement});goog.dom.safe.unsafeSetInnerHtmlDoNotUseOrElse=function($,ee){if(goog.dom.safe.isInnerHtmlCleanupRecursive_())for(;$.lastChild;)$.removeChild($.lastChild);$.innerHTML=goog.html.SafeHtml.unwrapTrustedHTML(ee)};goog.dom.safe.setInnerHtml=function($,ee){if(goog.asserts.ENABLE_ASSERTS){var et=$.tagName.toUpperCase();if(goog.dom.safe.SET_INNER_HTML_DISALLOWED_TAGS_[et])throw Error("goog.dom.safe.setInnerHtml cannot be used to set content of "+$.tagName+".")}goog.dom.safe.unsafeSetInnerHtmlDoNotUseOrElse($,ee)};goog.dom.safe.setOuterHtml=function($,ee){$.outerHTML=goog.html.SafeHtml.unwrapTrustedHTML(ee)};goog.dom.safe.setFormElementAction=function($,ee){ee=ee instanceof goog.html.SafeUrl?ee:goog.html.SafeUrl.sanitizeAssertUnchanged(ee);goog.dom.asserts.assertIsHTMLFormElement($).action=goog.html.SafeUrl.unwrap(ee)};goog.dom.safe.setButtonFormAction=function($,ee){ee=ee instanceof goog.html.SafeUrl?ee:goog.html.SafeUrl.sanitizeAssertUnchanged(ee);goog.dom.asserts.assertIsHTMLButtonElement($).formAction=goog.html.SafeUrl.unwrap(ee)};goog.dom.safe.setInputFormAction=function($,ee){ee=ee instanceof goog.html.SafeUrl?ee:goog.html.SafeUrl.sanitizeAssertUnchanged(ee);goog.dom.asserts.assertIsHTMLInputElement($).formAction=goog.html.SafeUrl.unwrap(ee)};goog.dom.safe.setStyle=function($,ee){$.style.cssText=goog.html.SafeStyle.unwrap(ee)};goog.dom.safe.documentWrite=function($,ee){$.write(goog.html.SafeHtml.unwrapTrustedHTML(ee))};goog.dom.safe.setAnchorHref=function($,ee){goog.dom.asserts.assertIsHTMLAnchorElement($);ee=ee instanceof goog.html.SafeUrl?ee:goog.html.SafeUrl.sanitizeAssertUnchanged(ee);$.href=goog.html.SafeUrl.unwrap(ee)};goog.dom.safe.setImageSrc=function($,ee){goog.dom.asserts.assertIsHTMLImageElement($);if(!(ee instanceof goog.html.SafeUrl)){var et=/^data:image\//i.test(ee);ee=goog.html.SafeUrl.sanitizeAssertUnchanged(ee,et)}$.src=goog.html.SafeUrl.unwrap(ee)};goog.dom.safe.setAudioSrc=function($,ee){goog.dom.asserts.assertIsHTMLAudioElement($);if(!(ee instanceof goog.html.SafeUrl)){var et=/^data:audio\//i.test(ee);ee=goog.html.SafeUrl.sanitizeAssertUnchanged(ee,et)}$.src=goog.html.SafeUrl.unwrap(ee)};goog.dom.safe.setVideoSrc=function($,ee){goog.dom.asserts.assertIsHTMLVideoElement($);if(!(ee instanceof goog.html.SafeUrl)){var et=/^data:video\//i.test(ee);ee=goog.html.SafeUrl.sanitizeAssertUnchanged(ee,et)}$.src=goog.html.SafeUrl.unwrap(ee)};goog.dom.safe.setEmbedSrc=function($,ee){goog.dom.asserts.assertIsHTMLEmbedElement($);$.src=goog.html.TrustedResourceUrl.unwrapTrustedScriptURL(ee)};goog.dom.safe.setFrameSrc=function($,ee){goog.dom.asserts.assertIsHTMLFrameElement($);$.src=goog.html.TrustedResourceUrl.unwrap(ee)};goog.dom.safe.setIframeSrc=function($,ee){goog.dom.asserts.assertIsHTMLIFrameElement($);$.src=goog.html.TrustedResourceUrl.unwrap(ee)};goog.dom.safe.setIframeSrcdoc=function($,ee){goog.dom.asserts.assertIsHTMLIFrameElement($);$.srcdoc=goog.html.SafeHtml.unwrapTrustedHTML(ee)};goog.dom.safe.setLinkHrefAndRel=function($,ee,et){goog.dom.asserts.assertIsHTMLLinkElement($);$.rel=et;goog.string.internal.caseInsensitiveContains(et,"stylesheet")?(goog.asserts.assert(ee instanceof goog.html.TrustedResourceUrl,'URL must be TrustedResourceUrl because "rel" contains "stylesheet"'),$.href=goog.html.TrustedResourceUrl.unwrap(ee)):$.href=ee instanceof goog.html.TrustedResourceUrl?goog.html.TrustedResourceUrl.unwrap(ee):ee instanceof goog.html.SafeUrl?goog.html.SafeUrl.unwrap(ee):goog.html.SafeUrl.unwrap(goog.html.SafeUrl.sanitizeAssertUnchanged(ee))};goog.dom.safe.setObjectData=function($,ee){goog.dom.asserts.assertIsHTMLObjectElement($);$.data=goog.html.TrustedResourceUrl.unwrapTrustedScriptURL(ee)};goog.dom.safe.setScriptSrc=function($,ee){goog.dom.asserts.assertIsHTMLScriptElement($);$.src=goog.html.TrustedResourceUrl.unwrapTrustedScriptURL(ee);(ee=goog.getScriptNonce())&&$.setAttribute("nonce",ee)};goog.dom.safe.setScriptContent=function($,ee){goog.dom.asserts.assertIsHTMLScriptElement($);$.text=goog.html.SafeScript.unwrapTrustedScript(ee);(ee=goog.getScriptNonce())&&$.setAttribute("nonce",ee)};goog.dom.safe.setLocationHref=function($,ee){goog.dom.asserts.assertIsLocation($);ee=ee instanceof goog.html.SafeUrl?ee:goog.html.SafeUrl.sanitizeAssertUnchanged(ee);$.href=goog.html.SafeUrl.unwrap(ee)};goog.dom.safe.assignLocation=function($,ee){goog.dom.asserts.assertIsLocation($);ee=ee instanceof goog.html.SafeUrl?ee:goog.html.SafeUrl.sanitizeAssertUnchanged(ee);$.assign(goog.html.SafeUrl.unwrap(ee))};goog.dom.safe.replaceLocation=function($,ee){ee=ee instanceof goog.html.SafeUrl?ee:goog.html.SafeUrl.sanitizeAssertUnchanged(ee);$.replace(goog.html.SafeUrl.unwrap(ee))};goog.dom.safe.openInWindow=function($,ee,et,en,ei){$=$ instanceof goog.html.SafeUrl?$:goog.html.SafeUrl.sanitizeAssertUnchanged($);ee=ee||goog.global;et=et instanceof goog.string.Const?goog.string.Const.unwrap(et):et||"";return ee.open(goog.html.SafeUrl.unwrap($),et,en,ei)};goog.dom.safe.parseFromStringHtml=function($,ee){return goog.dom.safe.parseFromString($,ee,"text/html")};goog.dom.safe.parseFromString=function($,ee,et){return $.parseFromString(goog.html.SafeHtml.unwrapTrustedHTML(ee),et)};goog.dom.safe.createImageFromBlob=function($){if(!/^image\/.*/g.test($.type))throw Error("goog.dom.safe.createImageFromBlob only accepts MIME type image/.*.");var ee=goog.global.URL.createObjectURL($);$=new goog.global.Image;$.onload=function(){goog.global.URL.revokeObjectURL(ee)};goog.dom.safe.setImageSrc($,goog.html.uncheckedconversions.safeUrlFromStringKnownToSatisfyTypeContract(goog.string.Const.from("Image blob URL."),ee));return $};goog.string.DETECT_DOUBLE_ESCAPING=!1;goog.string.FORCE_NON_DOM_HTML_UNESCAPING=!1;goog.string.Unicode={NBSP:"\xa0"};goog.string.startsWith=goog.string.internal.startsWith;goog.string.endsWith=goog.string.internal.endsWith;goog.string.caseInsensitiveStartsWith=goog.string.internal.caseInsensitiveStartsWith;goog.string.caseInsensitiveEndsWith=goog.string.internal.caseInsensitiveEndsWith;goog.string.caseInsensitiveEquals=goog.string.internal.caseInsensitiveEquals;goog.string.subs=function($,ee){for(var et=$.split("%s"),en="",ei=Array.prototype.slice.call(arguments,1);ei.length&&1<et.length;)en+=et.shift()+ei.shift();return en+et.join("%s")};goog.string.collapseWhitespace=function($){return $.replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")};goog.string.isEmptyOrWhitespace=goog.string.internal.isEmptyOrWhitespace;goog.string.isEmptyString=function($){return 0==$.length};goog.string.isEmpty=goog.string.isEmptyOrWhitespace;goog.string.isEmptyOrWhitespaceSafe=function($){return goog.string.isEmptyOrWhitespace(goog.string.makeSafe($))};goog.string.isEmptySafe=goog.string.isEmptyOrWhitespaceSafe;goog.string.isBreakingWhitespace=function($){return!/[^\t\n\r ]/.test($)};goog.string.isAlpha=function($){return!/[^a-zA-Z]/.test($)};goog.string.isNumeric=function($){return!/[^0-9]/.test($)};goog.string.isAlphaNumeric=function($){return!/[^a-zA-Z0-9]/.test($)};goog.string.isSpace=function($){return" "==$};goog.string.isUnicodeChar=function($){return 1==$.length&&" "<=$&&"~">=$||"\x80"<=$&&"�">=$};goog.string.stripNewlines=function($){return $.replace(/(\r\n|\r|\n)+/g," ")};goog.string.canonicalizeNewlines=function($){return $.replace(/(\r\n|\r|\n)/g,"\n")};goog.string.normalizeWhitespace=function($){return $.replace(/\xa0|\s/g," ")};goog.string.normalizeSpaces=function($){return $.replace(/\xa0|[ \t]+/g," ")};goog.string.collapseBreakingSpaces=function($){return $.replace(/[\t\r\n ]+/g," ").replace(/^[\t\r\n ]+|[\t\r\n ]+$/g,"")};goog.string.trim=goog.string.internal.trim;goog.string.trimLeft=function($){return $.replace(/^[\s\xa0]+/,"")};goog.string.trimRight=function($){return $.replace(/[\s\xa0]+$/,"")};goog.string.caseInsensitiveCompare=goog.string.internal.caseInsensitiveCompare;goog.string.numberAwareCompare_=function($,ee,et){if($==ee)return 0;if(!$)return-1;if(!ee)return 1;for(var en=$.toLowerCase().match(et),ei=ee.toLowerCase().match(et),eo=Math.min(en.length,ei.length),es=0;es<eo;es++){et=en[es];var eu=ei[es];if(et!=eu)return $=parseInt(et,10),!isNaN($)&&(ee=parseInt(eu,10),!isNaN(ee)&&$-ee)?$-ee:et<eu?-1:1}return en.length!=ei.length?en.length-ei.length:$<ee?-1:1};goog.string.intAwareCompare=function($,ee){return goog.string.numberAwareCompare_($,ee,/\d+|\D+/g)};goog.string.floatAwareCompare=function($,ee){return goog.string.numberAwareCompare_($,ee,/\d+|\.\d+|\D+/g)};goog.string.numerateCompare=goog.string.floatAwareCompare;goog.string.urlEncode=function($){return encodeURIComponent(String($))};goog.string.urlDecode=function($){return decodeURIComponent($.replace(/\+/g," "))};goog.string.newLineToBr=goog.string.internal.newLineToBr;goog.string.htmlEscape=function($,ee){$=goog.string.internal.htmlEscape($,ee);goog.string.DETECT_DOUBLE_ESCAPING&&($=$.replace(goog.string.E_RE_,"&#101;"));return $};goog.string.E_RE_=/e/g;goog.string.unescapeEntities=function($){return goog.string.contains($,"&")?!goog.string.FORCE_NON_DOM_HTML_UNESCAPING&&"document"in goog.global?goog.string.unescapeEntitiesUsingDom_($):goog.string.unescapePureXmlEntities_($):$};goog.string.unescapeEntitiesWithDocument=function($,ee){return goog.string.contains($,"&")?goog.string.unescapeEntitiesUsingDom_($,ee):$};goog.string.unescapeEntitiesUsingDom_=function($,ee){var et={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"'};var en=ee?ee.createElement("div"):goog.global.document.createElement("div");return $.replace(goog.string.HTML_ENTITY_PATTERN_,function($,ee){var ei=et[$];if(ei)return ei;"#"==ee.charAt(0)&&(ee=Number("0"+ee.substr(1)),isNaN(ee)||(ei=String.fromCharCode(ee)));ei||(goog.dom.safe.setInnerHtml(en,goog.html.uncheckedconversions.safeHtmlFromStringKnownToSatisfyTypeContract(goog.string.Const.from("Single HTML entity."),$+" ")),ei=en.firstChild.nodeValue.slice(0,-1));return et[$]=ei})};goog.string.unescapePureXmlEntities_=function($){return $.replace(/&([^;]+);/g,function($,ee){switch(ee){case"amp":return"&";case"lt":return"<";case"gt":return">";case"quot":return'"';default:return"#"!=ee.charAt(0)||(ee=Number("0"+ee.substr(1)),isNaN(ee))?$:String.fromCharCode(ee)}})};goog.string.HTML_ENTITY_PATTERN_=/&([^;\s<&]+);?/g;goog.string.whitespaceEscape=function($,ee){return goog.string.newLineToBr($.replace(/ /g," &#160;"),ee)};goog.string.preserveSpaces=function($){return $.replace(/(^|[\n ]) /g,"$1"+goog.string.Unicode.NBSP)};goog.string.stripQuotes=function($,ee){for(var et=ee.length,en=0;en<et;en++){var ei=1==et?ee:ee.charAt(en);if($.charAt(0)==ei&&$.charAt($.length-1)==ei)return $.substring(1,$.length-1)}return $};goog.string.truncate=function($,ee,et){et&&($=goog.string.unescapeEntities($));$.length>ee&&($=$.substring(0,ee-3)+"...");et&&($=goog.string.htmlEscape($));return $};goog.string.truncateMiddle=function($,ee,et,en){et&&($=goog.string.unescapeEntities($));if(en&&$.length>ee){en>ee&&(en=ee);var ei=$.length-en;$=$.substring(0,ee-en)+"..."+$.substring(ei)}else $.length>ee&&(en=Math.floor(ee/2),ei=$.length-en,$=$.substring(0,en+ee%2)+"..."+$.substring(ei));et&&($=goog.string.htmlEscape($));return $};goog.string.specialEscapeChars_={"\x00":"\\0","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\x0B",'"':'\\"',"\\":"\\\\","<":"\\u003C"};goog.string.jsEscapeCache_={"'":"\\'"};goog.string.quote=function($){$=String($);for(var ee=['"'],et=0;et<$.length;et++){var en=$.charAt(et),ei=en.charCodeAt(0);ee[et+1]=goog.string.specialEscapeChars_[en]||(31<ei&&127>ei?en:goog.string.escapeChar(en))}ee.push('"');return ee.join("")};goog.string.escapeString=function($){for(var ee=[],et=0;et<$.length;et++)ee[et]=goog.string.escapeChar($.charAt(et));return ee.join("")};goog.string.escapeChar=function($){if($ in goog.string.jsEscapeCache_)return goog.string.jsEscapeCache_[$];if($ in goog.string.specialEscapeChars_)return goog.string.jsEscapeCache_[$]=goog.string.specialEscapeChars_[$];var ee=$.charCodeAt(0);if(31<ee&&127>ee)var et=$;else{if(256>ee){if(et="\\x",16>ee||256<ee)et+="0"}else et="\\u",4096>ee&&(et+="0");et+=ee.toString(16).toUpperCase()}return goog.string.jsEscapeCache_[$]=et};goog.string.contains=goog.string.internal.contains;goog.string.caseInsensitiveContains=goog.string.internal.caseInsensitiveContains;goog.string.countOf=function($,ee){return $&&ee?$.split(ee).length-1:0};goog.string.removeAt=function($,ee,et){var en=$;0<=ee&&ee<$.length&&0<et&&(en=$.substr(0,ee)+$.substr(ee+et,$.length-ee-et));return en};goog.string.remove=function($,ee){return $.replace(ee,"")};goog.string.removeAll=function($,ee){ee=new RegExp(goog.string.regExpEscape(ee),"g");return $.replace(ee,"")};goog.string.replaceAll=function($,ee,et){ee=new RegExp(goog.string.regExpEscape(ee),"g");return $.replace(ee,et.replace(/\$/g,"$$$$"))};goog.string.regExpEscape=function($){return String($).replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")};goog.string.repeat=String.prototype.repeat?function($,ee){return $.repeat(ee)}:function($,ee){return Array(ee+1).join($)};goog.string.padNumber=function($,ee,et){$=void 0!==et?$.toFixed(et):String($);et=$.indexOf(".");-1==et&&(et=$.length);return goog.string.repeat("0",Math.max(0,ee-et))+$};goog.string.makeSafe=function($){return null==$?"":String($)};goog.string.buildString=function($){return Array.prototype.join.call(arguments,"")};goog.string.getRandomString=function(){return Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^goog.now()).toString(36)};goog.string.compareVersions=goog.string.internal.compareVersions;goog.string.hashCode=function($){for(var ee=0,et=0;et<$.length;++et)ee=31*ee+$.charCodeAt(et)>>>0;return ee};goog.string.uniqueStringCounter_=2147483648*Math.random()|0;goog.string.createUniqueString=function(){return"goog_"+goog.string.uniqueStringCounter_++};goog.string.toNumber=function($){var ee=Number($);return 0==ee&&goog.string.isEmptyOrWhitespace($)?NaN:ee};goog.string.isLowerCamelCase=function($){return/^[a-z]+([A-Z][a-z]*)*$/.test($)};goog.string.isUpperCamelCase=function($){return/^([A-Z][a-z]*)+$/.test($)};goog.string.toCamelCase=function($){return String($).replace(/\-([a-z])/g,function($,ee){return ee.toUpperCase()})};goog.string.toSelectorCase=function($){return String($).replace(/([A-Z])/g,"-$1").toLowerCase()};goog.string.toTitleCase=function($,ee){ee="string"===typeof ee?goog.string.regExpEscape(ee):"\\s";return $.replace(new RegExp("(^"+(ee?"|["+ee+"]+":"")+")([a-z])","g"),function($,ee,et){return ee+et.toUpperCase()})};goog.string.capitalize=function($){return String($.charAt(0)).toUpperCase()+String($.substr(1)).toLowerCase()};goog.string.parseInt=function($){isFinite($)&&($=String($));return"string"===typeof $?/^\s*-?0x/i.test($)?parseInt($,16):parseInt($,10):NaN};goog.string.splitLimit=function($,ee,et){$=$.split(ee);for(var en=[];0<et&&$.length;)en.push($.shift()),et--;$.length&&en.push($.join(ee));return en};goog.string.lastComponent=function($,ee){if(ee)"string"==typeof ee&&(ee=[ee]);else return $;for(var et=-1,en=0;en<ee.length;en++)if(""!=ee[en]){var ei=$.lastIndexOf(ee[en]);ei>et&&(et=ei)}return-1==et?$:$.slice(et+1)};goog.string.editDistance=function($,ee){var et=[],en=[];if($==ee)return 0;if(!$.length||!ee.length)return Math.max($.length,ee.length);for(var ei=0;ei<ee.length+1;ei++)et[ei]=ei;for(ei=0;ei<$.length;ei++){en[0]=ei+1;for(var eo=0;eo<ee.length;eo++)en[eo+1]=Math.min(en[eo]+1,et[eo+1]+1,et[eo]+Number($[ei]!=ee[eo]));for(eo=0;eo<et.length;eo++)et[eo]=en[eo]}return en[ee.length]};goog.labs.userAgent.engine={};goog.labs.userAgent.engine.isPresto=function(){return goog.labs.userAgent.util.matchUserAgent("Presto")};goog.labs.userAgent.engine.isTrident=function(){return goog.labs.userAgent.util.matchUserAgent("Trident")||goog.labs.userAgent.util.matchUserAgent("MSIE")};goog.labs.userAgent.engine.isEdge=function(){return goog.labs.userAgent.util.matchUserAgent("Edge")};goog.labs.userAgent.engine.isWebKit=function(){return goog.labs.userAgent.util.matchUserAgentIgnoreCase("WebKit")&&!goog.labs.userAgent.engine.isEdge()};goog.labs.userAgent.engine.isGecko=function(){return goog.labs.userAgent.util.matchUserAgent("Gecko")&&!goog.labs.userAgent.engine.isWebKit()&&!goog.labs.userAgent.engine.isTrident()&&!goog.labs.userAgent.engine.isEdge()};goog.labs.userAgent.engine.getVersion=function(){var $=goog.labs.userAgent.util.getUserAgent();if($){$=goog.labs.userAgent.util.extractVersionTuples($);var ee=goog.labs.userAgent.engine.getEngineTuple_($);if(ee)return"Gecko"==ee[0]?goog.labs.userAgent.engine.getVersionForKey_($,"Firefox"):ee[1];$=$[0];var et;if($&&(et=$[2])&&(et=/Trident\/([^\s;]+)/.exec(et)))return et[1]}return""};goog.labs.userAgent.engine.getEngineTuple_=function($){if(!goog.labs.userAgent.engine.isEdge())return $[1];for(var ee=0;ee<$.length;ee++){var et=$[ee];if("Edge"==et[0])return et}};goog.labs.userAgent.engine.isVersionOrHigher=function($){return 0<=goog.string.compareVersions(goog.labs.userAgent.engine.getVersion(),$)};goog.labs.userAgent.engine.getVersionForKey_=function($,ee){return($=goog.array.find($,function($){return ee==$[0]}))&&$[1]||""};goog.labs.userAgent.platform={};goog.labs.userAgent.platform.isAndroid=function(){return goog.labs.userAgent.util.matchUserAgent("Android")};goog.labs.userAgent.platform.isIpod=function(){return goog.labs.userAgent.util.matchUserAgent("iPod")};goog.labs.userAgent.platform.isIphone=function(){return goog.labs.userAgent.util.matchUserAgent("iPhone")&&!goog.labs.userAgent.util.matchUserAgent("iPod")&&!goog.labs.userAgent.util.matchUserAgent("iPad")};goog.labs.userAgent.platform.isIpad=function(){return goog.labs.userAgent.util.matchUserAgent("iPad")};goog.labs.userAgent.platform.isIos=function(){return goog.labs.userAgent.platform.isIphone()||goog.labs.userAgent.platform.isIpad()||goog.labs.userAgent.platform.isIpod()};goog.labs.userAgent.platform.isMacintosh=function(){return goog.labs.userAgent.util.matchUserAgent("Macintosh")};goog.labs.userAgent.platform.isLinux=function(){return goog.labs.userAgent.util.matchUserAgent("Linux")};goog.labs.userAgent.platform.isWindows=function(){return goog.labs.userAgent.util.matchUserAgent("Windows")};goog.labs.userAgent.platform.isChromeOS=function(){return goog.labs.userAgent.util.matchUserAgent("CrOS")};goog.labs.userAgent.platform.isChromecast=function(){return goog.labs.userAgent.util.matchUserAgent("CrKey")};goog.labs.userAgent.platform.isKaiOS=function(){return goog.labs.userAgent.util.matchUserAgentIgnoreCase("KaiOS")};goog.labs.userAgent.platform.getVersion=function(){var $=goog.labs.userAgent.util.getUserAgent(),ee="";goog.labs.userAgent.platform.isWindows()?(ee=/Windows (?:NT|Phone) ([0-9.]+)/,ee=($=ee.exec($))?$[1]:"0.0"):goog.labs.userAgent.platform.isIos()?(ee=/(?:iPhone|iPod|iPad|CPU)\s+OS\s+(\S+)/,ee=($=ee.exec($))&&$[1].replace(/_/g,".")):goog.labs.userAgent.platform.isMacintosh()?(ee=/Mac OS X ([0-9_.]+)/,ee=($=ee.exec($))?$[1].replace(/_/g,"."):"10"):goog.labs.userAgent.platform.isKaiOS()?(ee=/(?:KaiOS)\/(\S+)/i,ee=($=ee.exec($))&&$[1]):goog.labs.userAgent.platform.isAndroid()?(ee=/Android\s+([^\);]+)(\)|;)/,ee=($=ee.exec($))&&$[1]):goog.labs.userAgent.platform.isChromeOS()&&(ee=/(?:CrOS\s+(?:i686|x86_64)\s+([0-9.]+))/,ee=($=ee.exec($))&&$[1]);return ee||""};goog.labs.userAgent.platform.isVersionOrHigher=function($){return 0<=goog.string.compareVersions(goog.labs.userAgent.platform.getVersion(),$)};goog.reflect={};goog.reflect.object=function($,ee){return ee};goog.reflect.objectProperty=function($,ee){return $};goog.reflect.sinkValue=function($){goog.reflect.sinkValue[" "]($);return $};goog.reflect.sinkValue[" "]=goog.nullFunction;goog.reflect.canAccessProperty=function($,ee){try{return goog.reflect.sinkValue($[ee]),!0}catch($){}return!1};goog.reflect.cache=function($,ee,et,en){en=en?en(ee):ee;return Object.prototype.hasOwnProperty.call($,en)?$[en]:$[en]=et(ee)};goog.userAgent={};goog.userAgent.ASSUME_IE=!1;goog.userAgent.ASSUME_EDGE=!1;goog.userAgent.ASSUME_GECKO=!1;goog.userAgent.ASSUME_WEBKIT=!1;goog.userAgent.ASSUME_MOBILE_WEBKIT=!1;goog.userAgent.ASSUME_OPERA=!1;goog.userAgent.ASSUME_ANY_VERSION=!1;goog.userAgent.BROWSER_KNOWN_=goog.userAgent.ASSUME_IE||goog.userAgent.ASSUME_EDGE||goog.userAgent.ASSUME_GECKO||goog.userAgent.ASSUME_MOBILE_WEBKIT||goog.userAgent.ASSUME_WEBKIT||goog.userAgent.ASSUME_OPERA;goog.userAgent.getUserAgentString=function(){return goog.labs.userAgent.util.getUserAgent()};goog.userAgent.getNavigatorTyped=function(){return goog.global.navigator||null};goog.userAgent.getNavigator=function(){return goog.userAgent.getNavigatorTyped()};goog.userAgent.OPERA=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_OPERA:goog.labs.userAgent.browser.isOpera();goog.userAgent.IE=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_IE:goog.labs.userAgent.browser.isIE();goog.userAgent.EDGE=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_EDGE:goog.labs.userAgent.engine.isEdge();goog.userAgent.EDGE_OR_IE=goog.userAgent.EDGE||goog.userAgent.IE;goog.userAgent.GECKO=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_GECKO:goog.labs.userAgent.engine.isGecko();goog.userAgent.WEBKIT=goog.userAgent.BROWSER_KNOWN_?goog.userAgent.ASSUME_WEBKIT||goog.userAgent.ASSUME_MOBILE_WEBKIT:goog.labs.userAgent.engine.isWebKit();goog.userAgent.isMobile_=function(){return goog.userAgent.WEBKIT&&goog.labs.userAgent.util.matchUserAgent("Mobile")};goog.userAgent.MOBILE=goog.userAgent.ASSUME_MOBILE_WEBKIT||goog.userAgent.isMobile_();goog.userAgent.SAFARI=goog.userAgent.WEBKIT;goog.userAgent.determinePlatform_=function(){var $=goog.userAgent.getNavigatorTyped();return $&&$.platform||""};goog.userAgent.PLATFORM=goog.userAgent.determinePlatform_();goog.userAgent.ASSUME_MAC=!1;goog.userAgent.ASSUME_WINDOWS=!1;goog.userAgent.ASSUME_LINUX=!1;goog.userAgent.ASSUME_X11=!1;goog.userAgent.ASSUME_ANDROID=!1;goog.userAgent.ASSUME_IPHONE=!1;goog.userAgent.ASSUME_IPAD=!1;goog.userAgent.ASSUME_IPOD=!1;goog.userAgent.ASSUME_KAIOS=!1;goog.userAgent.PLATFORM_KNOWN_=goog.userAgent.ASSUME_MAC||goog.userAgent.ASSUME_WINDOWS||goog.userAgent.ASSUME_LINUX||goog.userAgent.ASSUME_X11||goog.userAgent.ASSUME_ANDROID||goog.userAgent.ASSUME_IPHONE||goog.userAgent.ASSUME_IPAD||goog.userAgent.ASSUME_IPOD;goog.userAgent.MAC=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_MAC:goog.labs.userAgent.platform.isMacintosh();goog.userAgent.WINDOWS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_WINDOWS:goog.labs.userAgent.platform.isWindows();goog.userAgent.isLegacyLinux_=function(){return goog.labs.userAgent.platform.isLinux()||goog.labs.userAgent.platform.isChromeOS()};goog.userAgent.LINUX=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_LINUX:goog.userAgent.isLegacyLinux_();goog.userAgent.isX11_=function(){var $=goog.userAgent.getNavigatorTyped();return!!$&&goog.string.contains($.appVersion||"","X11")};goog.userAgent.X11=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_X11:goog.userAgent.isX11_();goog.userAgent.ANDROID=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_ANDROID:goog.labs.userAgent.platform.isAndroid();goog.userAgent.IPHONE=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPHONE:goog.labs.userAgent.platform.isIphone();goog.userAgent.IPAD=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPAD:goog.labs.userAgent.platform.isIpad();goog.userAgent.IPOD=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPOD:goog.labs.userAgent.platform.isIpod();goog.userAgent.IOS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_IPHONE||goog.userAgent.ASSUME_IPAD||goog.userAgent.ASSUME_IPOD:goog.labs.userAgent.platform.isIos();goog.userAgent.KAIOS=goog.userAgent.PLATFORM_KNOWN_?goog.userAgent.ASSUME_KAIOS:goog.labs.userAgent.platform.isKaiOS();goog.userAgent.determineVersion_=function(){var $="",ee=goog.userAgent.getVersionRegexResult_();ee&&($=ee?ee[1]:"");return goog.userAgent.IE&&(ee=goog.userAgent.getDocumentMode_(),null!=ee&&ee>parseFloat($))?String(ee):$};goog.userAgent.getVersionRegexResult_=function(){var $=goog.userAgent.getUserAgentString();if(goog.userAgent.GECKO)return/rv:([^\);]+)(\)|;)/.exec($);if(goog.userAgent.EDGE)return/Edge\/([\d\.]+)/.exec($);if(goog.userAgent.IE)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec($);if(goog.userAgent.WEBKIT)return/WebKit\/(\S+)/.exec($);if(goog.userAgent.OPERA)return/(?:Version)[ \/]?(\S+)/.exec($)};goog.userAgent.getDocumentMode_=function(){var $=goog.global.document;return $?$.documentMode:void 0};goog.userAgent.VERSION=goog.userAgent.determineVersion_();goog.userAgent.compare=function($,ee){return goog.string.compareVersions($,ee)};goog.userAgent.isVersionOrHigherCache_={};goog.userAgent.isVersionOrHigher=function($){return goog.userAgent.ASSUME_ANY_VERSION||goog.reflect.cache(goog.userAgent.isVersionOrHigherCache_,$,function(){return 0<=goog.string.compareVersions(goog.userAgent.VERSION,$)})};goog.userAgent.isVersion=goog.userAgent.isVersionOrHigher;goog.userAgent.isDocumentModeOrHigher=function($){return Number(goog.userAgent.DOCUMENT_MODE)>=$};goog.userAgent.isDocumentMode=goog.userAgent.isDocumentModeOrHigher;goog.userAgent.DOCUMENT_MODE=function(){if(goog.global.document&&goog.userAgent.IE){var $=goog.userAgent.getDocumentMode_();return $?$:parseInt(goog.userAgent.VERSION,10)||void 0}}();goog.userAgent.product={};goog.userAgent.product.ASSUME_FIREFOX=!1;goog.userAgent.product.ASSUME_IPHONE=!1;goog.userAgent.product.ASSUME_IPAD=!1;goog.userAgent.product.ASSUME_ANDROID=!1;goog.userAgent.product.ASSUME_CHROME=!1;goog.userAgent.product.ASSUME_SAFARI=!1;goog.userAgent.product.PRODUCT_KNOWN_=goog.userAgent.ASSUME_IE||goog.userAgent.ASSUME_EDGE||goog.userAgent.ASSUME_OPERA||goog.userAgent.product.ASSUME_FIREFOX||goog.userAgent.product.ASSUME_IPHONE||goog.userAgent.product.ASSUME_IPAD||goog.userAgent.product.ASSUME_ANDROID||goog.userAgent.product.ASSUME_CHROME||goog.userAgent.product.ASSUME_SAFARI;goog.userAgent.product.OPERA=goog.userAgent.OPERA;goog.userAgent.product.IE=goog.userAgent.IE;goog.userAgent.product.EDGE=goog.userAgent.EDGE;goog.userAgent.product.FIREFOX=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_FIREFOX:goog.labs.userAgent.browser.isFirefox();goog.userAgent.product.isIphoneOrIpod_=function(){return goog.labs.userAgent.platform.isIphone()||goog.labs.userAgent.platform.isIpod()};goog.userAgent.product.IPHONE=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_IPHONE:goog.userAgent.product.isIphoneOrIpod_();goog.userAgent.product.IPAD=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_IPAD:goog.labs.userAgent.platform.isIpad();goog.userAgent.product.ANDROID=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_ANDROID:goog.labs.userAgent.browser.isAndroidBrowser();goog.userAgent.product.CHROME=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_CHROME:goog.labs.userAgent.browser.isChrome();goog.userAgent.product.isSafariDesktop_=function(){return goog.labs.userAgent.browser.isSafari()&&!goog.labs.userAgent.platform.isIos()};goog.userAgent.product.SAFARI=goog.userAgent.product.PRODUCT_KNOWN_?goog.userAgent.product.ASSUME_SAFARI:goog.userAgent.product.isSafariDesktop_();goog.crypt.base64={};goog.crypt.base64.DEFAULT_ALPHABET_COMMON_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";goog.crypt.base64.ENCODED_VALS=goog.crypt.base64.DEFAULT_ALPHABET_COMMON_+"+/=";goog.crypt.base64.ENCODED_VALS_WEBSAFE=goog.crypt.base64.DEFAULT_ALPHABET_COMMON_+"-_.";goog.crypt.base64.Alphabet={DEFAULT:0,NO_PADDING:1,WEBSAFE:2,WEBSAFE_DOT_PADDING:3,WEBSAFE_NO_PADDING:4};goog.crypt.base64.paddingChars_="=.";goog.crypt.base64.isPadding_=function($){return goog.string.contains(goog.crypt.base64.paddingChars_,$)};goog.crypt.base64.byteToCharMaps_={};goog.crypt.base64.charToByteMap_=null;goog.crypt.base64.ASSUME_NATIVE_SUPPORT_=goog.userAgent.GECKO||goog.userAgent.WEBKIT&&!goog.userAgent.product.SAFARI||goog.userAgent.OPERA;goog.crypt.base64.HAS_NATIVE_ENCODE_=goog.crypt.base64.ASSUME_NATIVE_SUPPORT_||"function"==typeof goog.global.btoa;goog.crypt.base64.HAS_NATIVE_DECODE_=goog.crypt.base64.ASSUME_NATIVE_SUPPORT_||!goog.userAgent.product.SAFARI&&!goog.userAgent.IE&&"function"==typeof goog.global.atob;goog.crypt.base64.encodeByteArray=function($,ee){goog.asserts.assert(goog.isArrayLike($),"encodeByteArray takes an array as a parameter");void 0===ee&&(ee=goog.crypt.base64.Alphabet.DEFAULT);goog.crypt.base64.init_();ee=goog.crypt.base64.byteToCharMaps_[ee];for(var et=[],en=0;en<$.length;en+=3){var ei=$[en],eo=en+1<$.length,es=eo?$[en+1]:0,eu=en+2<$.length,el=eu?$[en+2]:0,ef=ei>>2;ei=(ei&3)<<4|es>>4;es=(es&15)<<2|el>>6;el&=63;eu||(el=64,eo||(es=64));et.push(ee[ef],ee[ei],ee[es]||"",ee[el]||"")}return et.join("")};goog.crypt.base64.encodeString=function($,ee){return goog.crypt.base64.HAS_NATIVE_ENCODE_&&!ee?goog.global.btoa($):goog.crypt.base64.encodeByteArray(goog.crypt.stringToByteArray($),ee)};goog.crypt.base64.decodeString=function($,ee){if(goog.crypt.base64.HAS_NATIVE_DECODE_&&!ee)return goog.global.atob($);var et="";goog.crypt.base64.decodeStringInternal_($,function($){et+=String.fromCharCode($)});return et};goog.crypt.base64.decodeStringToByteArray=function($,ee){var et=[];goog.crypt.base64.decodeStringInternal_($,function($){et.push($)});return et};goog.crypt.base64.decodeStringToUint8Array=function($){goog.asserts.assert(!goog.userAgent.IE||goog.userAgent.isVersionOrHigher("10"),"Browser does not support typed arrays");var ee=$.length,et=3*ee/4;et%3?et=Math.floor(et):goog.crypt.base64.isPadding_($[ee-1])&&(et=goog.crypt.base64.isPadding_($[ee-2])?et-2:et-1);var en=new Uint8Array(et),ei=0;goog.crypt.base64.decodeStringInternal_($,function($){en[ei++]=$});return en.subarray(0,ei)};goog.crypt.base64.decodeStringInternal_=function($,ee){function et(ee){for(;en<$.length;){var et=$.charAt(en++),ei=goog.crypt.base64.charToByteMap_[et];if(null!=ei)return ei;if(!goog.string.isEmptyOrWhitespace(et))throw Error("Unknown base64 encoding at char: "+et)}return ee}goog.crypt.base64.init_();for(var en=0;;){var ei=et(-1),eo=et(0),es=et(64),eu=et(64);if(64===eu&&-1===ei)break;ee(ei<<2|eo>>4);64!=es&&(ee(eo<<4&240|es>>2),64!=eu&&ee(es<<6&192|eu))}};goog.crypt.base64.init_=function(){if(!goog.crypt.base64.charToByteMap_){goog.crypt.base64.charToByteMap_={};for(var $=goog.crypt.base64.DEFAULT_ALPHABET_COMMON_.split(""),ee=["+/=","+/","-_=","-_.","-_"],et=0;5>et;et++){var en=$.concat(ee[et].split(""));goog.crypt.base64.byteToCharMaps_[et]=en;for(var ei=0;ei<en.length;ei++){var eo=en[ei],es=goog.crypt.base64.charToByteMap_[eo];void 0===es?goog.crypt.base64.charToByteMap_[eo]=ei:goog.asserts.assert(es===ei)}}}};jspb.utils={};jspb.utils.split64Low=0;jspb.utils.split64High=0;jspb.utils.splitUint64=function($){var ee=$>>>0;$=Math.floor(($-ee)/jspb.BinaryConstants.TWO_TO_32)>>>0;jspb.utils.split64Low=ee;jspb.utils.split64High=$};jspb.utils.splitInt64=function($){var ee=0>$;$=Math.abs($);var et=$>>>0;$=Math.floor(($-et)/jspb.BinaryConstants.TWO_TO_32);$>>>=0;ee&&($=~$>>>0,et=(~et>>>0)+1,4294967295<et&&(et=0,$++,4294967295<$&&($=0)));jspb.utils.split64Low=et;jspb.utils.split64High=$};jspb.utils.splitZigzag64=function($){var ee=0>$;$=2*Math.abs($);jspb.utils.splitUint64($);$=jspb.utils.split64Low;var et=jspb.utils.split64High;ee&&(0==$?0==et?et=$=4294967295:(et--,$=4294967295):$--);jspb.utils.split64Low=$;jspb.utils.split64High=et};jspb.utils.splitFloat32=function($){var ee=0>$?1:0;$=ee?-$:$;if(0===$)0<1/$?(jspb.utils.split64High=0,jspb.utils.split64Low=0):(jspb.utils.split64High=0,jspb.utils.split64Low=2147483648);else if(isNaN($))jspb.utils.split64High=0,jspb.utils.split64Low=2147483647;else if($>jspb.BinaryConstants.FLOAT32_MAX)jspb.utils.split64High=0,jspb.utils.split64Low=(ee<<31|2139095040)>>>0;else if($<jspb.BinaryConstants.FLOAT32_MIN)$=Math.round($/Math.pow(2,-149)),jspb.utils.split64High=0,jspb.utils.split64Low=(ee<<31|$)>>>0;else{var et=Math.floor(Math.log($)/Math.LN2);$*=Math.pow(2,-et);$=Math.round($*jspb.BinaryConstants.TWO_TO_23);16777216<=$&&++et;jspb.utils.split64High=0;jspb.utils.split64Low=(ee<<31|et+127<<23|$&8388607)>>>0}};jspb.utils.splitFloat64=function($){var ee=0>$?1:0;$=ee?-$:$;if(0===$)jspb.utils.split64High=0<1/$?0:2147483648,jspb.utils.split64Low=0;else if(isNaN($))jspb.utils.split64High=2147483647,jspb.utils.split64Low=4294967295;else if($>jspb.BinaryConstants.FLOAT64_MAX)jspb.utils.split64High=(ee<<31|2146435072)>>>0,jspb.utils.split64Low=0;else if($<jspb.BinaryConstants.FLOAT64_MIN){var et=$/Math.pow(2,-1074);$=et/jspb.BinaryConstants.TWO_TO_32;jspb.utils.split64High=(ee<<31|$)>>>0;jspb.utils.split64Low=et>>>0}else{et=$;var en=0;if(2<=et)for(;2<=et&&1023>en;)en++,et/=2;else for(;1>et&&-1022<en;)et*=2,en--;et=$*Math.pow(2,-en);$=et*jspb.BinaryConstants.TWO_TO_20&1048575;et=et*jspb.BinaryConstants.TWO_TO_52>>>0;jspb.utils.split64High=(ee<<31|en+1023<<20|$)>>>0;jspb.utils.split64Low=et}};jspb.utils.splitHash64=function($){var ee=$.charCodeAt(0),et=$.charCodeAt(1),en=$.charCodeAt(2),ei=$.charCodeAt(3),eo=$.charCodeAt(4),es=$.charCodeAt(5),eu=$.charCodeAt(6);$=$.charCodeAt(7);jspb.utils.split64Low=ee+(et<<8)+(en<<16)+(ei<<24)>>>0;jspb.utils.split64High=eo+(es<<8)+(eu<<16)+($<<24)>>>0};jspb.utils.joinUint64=function($,ee){return ee*jspb.BinaryConstants.TWO_TO_32+($>>>0)};jspb.utils.joinInt64=function($,ee){var et=ee&2147483648;et&&($=~$+1>>>0,ee=~ee>>>0,0==$&&(ee=ee+1>>>0));$=jspb.utils.joinUint64($,ee);return et?-$:$};jspb.utils.toZigzag64=function($,ee,et){var en=ee>>31;return et($<<1^en,(ee<<1|$>>>31)^en)};jspb.utils.joinZigzag64=function($,ee){return jspb.utils.fromZigzag64($,ee,jspb.utils.joinInt64)};jspb.utils.fromZigzag64=function($,ee,et){var en=-($&1);return et(($>>>1|ee<<31)^en,ee>>>1^en)};jspb.utils.joinFloat32=function($,ee){ee=2*($>>31)+1;var et=$>>>23&255;$&=8388607;return 255==et?$?NaN:Infinity*ee:0==et?ee*Math.pow(2,-149)*$:ee*Math.pow(2,et-150)*($+Math.pow(2,23))};jspb.utils.joinFloat64=function($,ee){var et=2*(ee>>31)+1,en=ee>>>20&2047;$=jspb.BinaryConstants.TWO_TO_32*(ee&1048575)+$;return 2047==en?$?NaN:Infinity*et:0==en?et*Math.pow(2,-1074)*$:et*Math.pow(2,en-1075)*($+jspb.BinaryConstants.TWO_TO_52)};jspb.utils.joinHash64=function($,ee){return String.fromCharCode($>>>0&255,$>>>8&255,$>>>16&255,$>>>24&255,ee>>>0&255,ee>>>8&255,ee>>>16&255,ee>>>24&255)};jspb.utils.DIGITS="0123456789abcdef".split("");jspb.utils.ZERO_CHAR_CODE_=48;jspb.utils.A_CHAR_CODE_=97;jspb.utils.joinUnsignedDecimalString=function($,ee){function et($,ee){$=$?String($):"";return ee?"0000000".slice($.length)+$:$}if(2097151>=ee)return""+jspb.utils.joinUint64($,ee);var en=($>>>24|ee<<8)>>>0&16777215;ee=ee>>16&65535;$=($&16777215)+6777216*en+6710656*ee;en+=8147497*ee;ee*=2;1e7<=$&&(en+=Math.floor($/1e7),$%=1e7);1e7<=en&&(ee+=Math.floor(en/1e7),en%=1e7);return et(ee,0)+et(en,ee)+et($,1)};jspb.utils.joinSignedDecimalString=function($,ee){var et=ee&2147483648;et&&($=~$+1>>>0,ee=~ee+(0==$?1:0)>>>0);$=jspb.utils.joinUnsignedDecimalString($,ee);return et?"-"+$:$};jspb.utils.hash64ToDecimalString=function($,ee){jspb.utils.splitHash64($);$=jspb.utils.split64Low;var et=jspb.utils.split64High;return ee?jspb.utils.joinSignedDecimalString($,et):jspb.utils.joinUnsignedDecimalString($,et)};jspb.utils.hash64ArrayToDecimalStrings=function($,ee){for(var et=Array($.length),en=0;en<$.length;en++)et[en]=jspb.utils.hash64ToDecimalString($[en],ee);return et};jspb.utils.decimalStringToHash64=function($){function ee($,ee){for(var et=0;8>et&&(1!==$||0<ee);et++)ee=$*ei[et]+ee,ei[et]=ee&255,ee>>>=8}function et(){for(var $=0;8>$;$++)ei[$]=~ei[$]&255}jspb.asserts.assert(0<$.length);var en=!1;"-"===$[0]&&(en=!0,$=$.slice(1));for(var ei=[0,0,0,0,0,0,0,0],eo=0;eo<$.length;eo++)ee(10,$.charCodeAt(eo)-jspb.utils.ZERO_CHAR_CODE_);en&&(et(),ee(1,1));return goog.crypt.byteArrayToString(ei)};jspb.utils.splitDecimalString=function($){jspb.utils.splitHash64(jspb.utils.decimalStringToHash64($))};jspb.utils.toHexDigit_=function($){return String.fromCharCode(10>$?jspb.utils.ZERO_CHAR_CODE_+$:jspb.utils.A_CHAR_CODE_-10+$)};jspb.utils.fromHexCharCode_=function($){return $>=jspb.utils.A_CHAR_CODE_?$-jspb.utils.A_CHAR_CODE_+10:$-jspb.utils.ZERO_CHAR_CODE_};jspb.utils.hash64ToHexString=function($){var ee=Array(18);ee[0]="0";ee[1]="x";for(var et=0;8>et;et++){var en=$.charCodeAt(7-et);ee[2*et+2]=jspb.utils.toHexDigit_(en>>4);ee[2*et+3]=jspb.utils.toHexDigit_(en&15)}return ee.join("")};jspb.utils.hexStringToHash64=function($){$=$.toLowerCase();jspb.asserts.assert(18==$.length);jspb.asserts.assert("0"==$[0]);jspb.asserts.assert("x"==$[1]);for(var ee="",et=0;8>et;et++){var en=jspb.utils.fromHexCharCode_($.charCodeAt(2*et+2)),ei=jspb.utils.fromHexCharCode_($.charCodeAt(2*et+3));ee=String.fromCharCode(16*en+ei)+ee}return ee};jspb.utils.hash64ToNumber=function($,ee){jspb.utils.splitHash64($);$=jspb.utils.split64Low;var et=jspb.utils.split64High;return ee?jspb.utils.joinInt64($,et):jspb.utils.joinUint64($,et)};jspb.utils.numberToHash64=function($){jspb.utils.splitInt64($);return jspb.utils.joinHash64(jspb.utils.split64Low,jspb.utils.split64High)};jspb.utils.countVarints=function($,ee,et){for(var en=0,ei=ee;ei<et;ei++)en+=$[ei]>>7;return et-ee-en};jspb.utils.countVarintFields=function($,ee,et,en){var ei=0;en=8*en+jspb.BinaryConstants.WireType.VARINT;if(128>en)for(;ee<et&&$[ee++]==en;)for(ei++;;){var eo=$[ee++];if(0==(eo&128))break}else for(;ee<et;){for(eo=en;128<eo;){if($[ee]!=(eo&127|128))return ei;ee++;eo>>=7}if($[ee++]!=eo)break;for(ei++;eo=$[ee++],0!=(eo&128););}return ei};jspb.utils.countFixedFields_=function($,ee,et,en,ei){var eo=0;if(128>en)for(;ee<et&&$[ee++]==en;)eo++,ee+=ei;else for(;ee<et;){for(var es=en;128<es;){if($[ee++]!=(es&127|128))return eo;es>>=7}if($[ee++]!=es)break;eo++;ee+=ei}return eo};jspb.utils.countFixed32Fields=function($,ee,et,en){return jspb.utils.countFixedFields_($,ee,et,8*en+jspb.BinaryConstants.WireType.FIXED32,4)};jspb.utils.countFixed64Fields=function($,ee,et,en){return jspb.utils.countFixedFields_($,ee,et,8*en+jspb.BinaryConstants.WireType.FIXED64,8)};jspb.utils.countDelimitedFields=function($,ee,et,en){var ei=0;for(en=8*en+jspb.BinaryConstants.WireType.DELIMITED;ee<et;){for(var eo=en;128<eo;){if($[ee++]!=(eo&127|128))return ei;eo>>=7}if($[ee++]!=eo)break;ei++;for(var es=0,eu=1;eo=$[ee++],es+=(eo&127)*eu,eu*=128,0!=(eo&128););ee+=es}return ei};jspb.utils.debugBytesToTextFormat=function($){var ee='"';if($){$=jspb.utils.byteSourceToUint8Array($);for(var et=0;et<$.length;et++)ee+="\\x",16>$[et]&&(ee+="0"),ee+=$[et].toString(16)}return ee+'"'};jspb.utils.debugScalarToTextFormat=function($){return"string"===typeof $?goog.string.quote($):$.toString()};jspb.utils.stringToByteArray=function($){for(var ee=new Uint8Array($.length),et=0;et<$.length;et++){var en=$.charCodeAt(et);if(255<en)throw Error("Conversion error: string contains codepoint outside of byte range");ee[et]=en}return ee};jspb.utils.byteSourceToUint8Array=function($){if($.constructor===Uint8Array)return $;if($.constructor===ArrayBuffer||$.constructor===Array)return new Uint8Array($);if($.constructor===String)return goog.crypt.base64.decodeStringToUint8Array($);if($ instanceof Uint8Array)return new Uint8Array($.buffer,$.byteOffset,$.byteLength);jspb.asserts.fail("Type not convertible to Uint8Array.");return new Uint8Array(0)};jspb.BinaryDecoder=function($,ee,et){this.bytes_=null;this.cursor_=this.end_=this.start_=0;this.error_=!1;$&&this.setBlock($,ee,et)};jspb.BinaryDecoder.instanceCache_=[];jspb.BinaryDecoder.alloc=function($,ee,et){if(jspb.BinaryDecoder.instanceCache_.length){var en=jspb.BinaryDecoder.instanceCache_.pop();$&&en.setBlock($,ee,et);return en}return new jspb.BinaryDecoder($,ee,et)};jspb.BinaryDecoder.prototype.free=function(){this.clear();100>jspb.BinaryDecoder.instanceCache_.length&&jspb.BinaryDecoder.instanceCache_.push(this)};jspb.BinaryDecoder.prototype.clone=function(){return jspb.BinaryDecoder.alloc(this.bytes_,this.start_,this.end_-this.start_)};jspb.BinaryDecoder.prototype.clear=function(){this.bytes_=null;this.cursor_=this.end_=this.start_=0;this.error_=!1};jspb.BinaryDecoder.prototype.getBuffer=function(){return this.bytes_};jspb.BinaryDecoder.prototype.setBlock=function($,ee,et){this.bytes_=jspb.utils.byteSourceToUint8Array($);this.start_=void 0!==ee?ee:0;this.end_=void 0!==et?this.start_+et:this.bytes_.length;this.cursor_=this.start_};jspb.BinaryDecoder.prototype.getEnd=function(){return this.end_};jspb.BinaryDecoder.prototype.setEnd=function($){this.end_=$};jspb.BinaryDecoder.prototype.reset=function(){this.cursor_=this.start_};jspb.BinaryDecoder.prototype.getCursor=function(){return this.cursor_};jspb.BinaryDecoder.prototype.setCursor=function($){this.cursor_=$};jspb.BinaryDecoder.prototype.advance=function($){this.cursor_+=$;jspb.asserts.assert(this.cursor_<=this.end_)};jspb.BinaryDecoder.prototype.atEnd=function(){return this.cursor_==this.end_};jspb.BinaryDecoder.prototype.pastEnd=function(){return this.cursor_>this.end_};jspb.BinaryDecoder.prototype.getError=function(){return this.error_||0>this.cursor_||this.cursor_>this.end_};jspb.BinaryDecoder.prototype.readSplitVarint64=function($){for(var ee=128,et=0,en=0,ei=0;4>ei&&128<=ee;ei++)ee=this.bytes_[this.cursor_++],et|=(ee&127)<<7*ei;128<=ee&&(ee=this.bytes_[this.cursor_++],et|=(ee&127)<<28,en|=(ee&127)>>4);if(128<=ee)for(ei=0;5>ei&&128<=ee;ei++)ee=this.bytes_[this.cursor_++],en|=(ee&127)<<7*ei+3;if(128>ee)return $(et>>>0,en>>>0);jspb.asserts.fail("Failed to read varint, encoding is invalid.");this.error_=!0};jspb.BinaryDecoder.prototype.readSplitZigzagVarint64=function($){return this.readSplitVarint64(function(ee,et){return jspb.utils.fromZigzag64(ee,et,$)})};jspb.BinaryDecoder.prototype.readSplitFixed64=function($){var ee=this.bytes_,et=this.cursor_;this.cursor_+=8;for(var en=0,ei=0,eo=et+7;eo>=et;eo--)en=en<<8|ee[eo],ei=ei<<8|ee[eo+4];return $(en,ei)};jspb.BinaryDecoder.prototype.skipVarint=function(){for(;this.bytes_[this.cursor_]&128;)this.cursor_++;this.cursor_++};jspb.BinaryDecoder.prototype.unskipVarint=function($){for(;128<$;)this.cursor_--,$>>>=7;this.cursor_--};jspb.BinaryDecoder.prototype.readUnsignedVarint32=function(){var $=this.bytes_;var ee=$[this.cursor_+0];var et=ee&127;if(128>ee)return this.cursor_+=1,jspb.asserts.assert(this.cursor_<=this.end_),et;ee=$[this.cursor_+1];et|=(ee&127)<<7;if(128>ee)return this.cursor_+=2,jspb.asserts.assert(this.cursor_<=this.end_),et;ee=$[this.cursor_+2];et|=(ee&127)<<14;if(128>ee)return this.cursor_+=3,jspb.asserts.assert(this.cursor_<=this.end_),et;ee=$[this.cursor_+3];et|=(ee&127)<<21;if(128>ee)return this.cursor_+=4,jspb.asserts.assert(this.cursor_<=this.end_),et;ee=$[this.cursor_+4];et|=(ee&15)<<28;if(128>ee)return this.cursor_+=5,jspb.asserts.assert(this.cursor_<=this.end_),et>>>0;this.cursor_+=5;128<=$[this.cursor_++]&&128<=$[this.cursor_++]&&128<=$[this.cursor_++]&&128<=$[this.cursor_++]&&128<=$[this.cursor_++]&&jspb.asserts.assert(!1);jspb.asserts.assert(this.cursor_<=this.end_);return et};jspb.BinaryDecoder.prototype.readSignedVarint32=function(){return~~this.readUnsignedVarint32()};jspb.BinaryDecoder.prototype.readUnsignedVarint32String=function(){return this.readUnsignedVarint32().toString()};jspb.BinaryDecoder.prototype.readSignedVarint32String=function(){return this.readSignedVarint32().toString()};jspb.BinaryDecoder.prototype.readZigzagVarint32=function(){var $=this.readUnsignedVarint32();return $>>>1^-($&1)};jspb.BinaryDecoder.prototype.readUnsignedVarint64=function(){return this.readSplitVarint64(jspb.utils.joinUint64)};jspb.BinaryDecoder.prototype.readUnsignedVarint64String=function(){return this.readSplitVarint64(jspb.utils.joinUnsignedDecimalString)};jspb.BinaryDecoder.prototype.readSignedVarint64=function(){return this.readSplitVarint64(jspb.utils.joinInt64)};jspb.BinaryDecoder.prototype.readSignedVarint64String=function(){return this.readSplitVarint64(jspb.utils.joinSignedDecimalString)};jspb.BinaryDecoder.prototype.readZigzagVarint64=function(){return this.readSplitVarint64(jspb.utils.joinZigzag64)};jspb.BinaryDecoder.prototype.readZigzagVarintHash64=function(){return this.readSplitZigzagVarint64(jspb.utils.joinHash64)};jspb.BinaryDecoder.prototype.readZigzagVarint64String=function(){return this.readSplitZigzagVarint64(jspb.utils.joinSignedDecimalString)};jspb.BinaryDecoder.prototype.readUint8=function(){var $=this.bytes_[this.cursor_+0];this.cursor_+=1;jspb.asserts.assert(this.cursor_<=this.end_);return $};jspb.BinaryDecoder.prototype.readUint16=function(){var $=this.bytes_[this.cursor_+0],ee=this.bytes_[this.cursor_+1];this.cursor_+=2;jspb.asserts.assert(this.cursor_<=this.end_);return $<<0|ee<<8};jspb.BinaryDecoder.prototype.readUint32=function(){var $=this.bytes_[this.cursor_+0],ee=this.bytes_[this.cursor_+1],et=this.bytes_[this.cursor_+2],en=this.bytes_[this.cursor_+3];this.cursor_+=4;jspb.asserts.assert(this.cursor_<=this.end_);return($<<0|ee<<8|et<<16|en<<24)>>>0};jspb.BinaryDecoder.prototype.readUint64=function(){var $=this.readUint32(),ee=this.readUint32();return jspb.utils.joinUint64($,ee)};jspb.BinaryDecoder.prototype.readUint64String=function(){var $=this.readUint32(),ee=this.readUint32();return jspb.utils.joinUnsignedDecimalString($,ee)};jspb.BinaryDecoder.prototype.readInt8=function(){var $=this.bytes_[this.cursor_+0];this.cursor_+=1;jspb.asserts.assert(this.cursor_<=this.end_);return $<<24>>24};jspb.BinaryDecoder.prototype.readInt16=function(){var $=this.bytes_[this.cursor_+0],ee=this.bytes_[this.cursor_+1];this.cursor_+=2;jspb.asserts.assert(this.cursor_<=this.end_);return($<<0|ee<<8)<<16>>16};jspb.BinaryDecoder.prototype.readInt32=function(){var $=this.bytes_[this.cursor_+0],ee=this.bytes_[this.cursor_+1],et=this.bytes_[this.cursor_+2],en=this.bytes_[this.cursor_+3];this.cursor_+=4;jspb.asserts.assert(this.cursor_<=this.end_);return $<<0|ee<<8|et<<16|en<<24};jspb.BinaryDecoder.prototype.readInt64=function(){var $=this.readUint32(),ee=this.readUint32();return jspb.utils.joinInt64($,ee)};jspb.BinaryDecoder.prototype.readInt64String=function(){var $=this.readUint32(),ee=this.readUint32();return jspb.utils.joinSignedDecimalString($,ee)};jspb.BinaryDecoder.prototype.readFloat=function(){var $=this.readUint32();return jspb.utils.joinFloat32($,0)};jspb.BinaryDecoder.prototype.readDouble=function(){var $=this.readUint32(),ee=this.readUint32();return jspb.utils.joinFloat64($,ee)};jspb.BinaryDecoder.prototype.readBool=function(){return!!this.bytes_[this.cursor_++]};jspb.BinaryDecoder.prototype.readEnum=function(){return this.readSignedVarint32()};jspb.BinaryDecoder.prototype.readString=function($){var ee=this.bytes_,et=this.cursor_;$=et+$;for(var en=[],ei="";et<$;){var eo=ee[et++];if(128>eo)en.push(eo);else if(192>eo)continue;else if(224>eo){var es=ee[et++];en.push((eo&31)<<6|es&63)}else if(240>eo){es=ee[et++];var eu=ee[et++];en.push((eo&15)<<12|(es&63)<<6|eu&63)}else if(248>eo){es=ee[et++];eu=ee[et++];var el=ee[et++];eo=(eo&7)<<18|(es&63)<<12|(eu&63)<<6|el&63;eo-=65536;en.push((eo>>10&1023)+55296,(eo&1023)+56320)}8192<=en.length&&(ei+=String.fromCharCode.apply(null,en),en.length=0)}ei+=goog.crypt.byteArrayToString(en);this.cursor_=et;return ei};jspb.BinaryDecoder.prototype.readStringWithLength=function(){var $=this.readUnsignedVarint32();return this.readString($)};jspb.BinaryDecoder.prototype.readBytes=function($){if(0>$||this.cursor_+$>this.bytes_.length)return this.error_=!0,jspb.asserts.fail("Invalid byte length!"),new Uint8Array(0);var ee=this.bytes_.subarray(this.cursor_,this.cursor_+$);this.cursor_+=$;jspb.asserts.assert(this.cursor_<=this.end_);return ee};jspb.BinaryDecoder.prototype.readVarintHash64=function(){return this.readSplitVarint64(jspb.utils.joinHash64)};jspb.BinaryDecoder.prototype.readFixedHash64=function(){var $=this.bytes_,ee=this.cursor_,et=$[ee+0],en=$[ee+1],ei=$[ee+2],eo=$[ee+3],es=$[ee+4],eu=$[ee+5],el=$[ee+6];$=$[ee+7];this.cursor_+=8;return String.fromCharCode(et,en,ei,eo,es,eu,el,$)};jspb.BinaryReader=function($,ee,et){this.decoder_=jspb.BinaryDecoder.alloc($,ee,et);this.fieldCursor_=this.decoder_.getCursor();this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER;this.nextWireType_=jspb.BinaryConstants.WireType.INVALID;this.error_=!1;this.readCallbacks_=null};jspb.BinaryReader.instanceCache_=[];jspb.BinaryReader.alloc=function($,ee,et){if(jspb.BinaryReader.instanceCache_.length){var en=jspb.BinaryReader.instanceCache_.pop();$&&en.decoder_.setBlock($,ee,et);return en}return new jspb.BinaryReader($,ee,et)};jspb.BinaryReader.prototype.alloc=jspb.BinaryReader.alloc;jspb.BinaryReader.prototype.free=function(){this.decoder_.clear();this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER;this.nextWireType_=jspb.BinaryConstants.WireType.INVALID;this.error_=!1;this.readCallbacks_=null;100>jspb.BinaryReader.instanceCache_.length&&jspb.BinaryReader.instanceCache_.push(this)};jspb.BinaryReader.prototype.getFieldCursor=function(){return this.fieldCursor_};jspb.BinaryReader.prototype.getCursor=function(){return this.decoder_.getCursor()};jspb.BinaryReader.prototype.getBuffer=function(){return this.decoder_.getBuffer()};jspb.BinaryReader.prototype.getFieldNumber=function(){return this.nextField_};goog.exportProperty(jspb.BinaryReader.prototype,"getFieldNumber",jspb.BinaryReader.prototype.getFieldNumber);jspb.BinaryReader.prototype.getWireType=function(){return this.nextWireType_};jspb.BinaryReader.prototype.isDelimited=function(){return this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED};goog.exportProperty(jspb.BinaryReader.prototype,"isDelimited",jspb.BinaryReader.prototype.isDelimited);jspb.BinaryReader.prototype.isEndGroup=function(){return this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP};goog.exportProperty(jspb.BinaryReader.prototype,"isEndGroup",jspb.BinaryReader.prototype.isEndGroup);jspb.BinaryReader.prototype.getError=function(){return this.error_||this.decoder_.getError()};jspb.BinaryReader.prototype.setBlock=function($,ee,et){this.decoder_.setBlock($,ee,et);this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER;this.nextWireType_=jspb.BinaryConstants.WireType.INVALID};jspb.BinaryReader.prototype.reset=function(){this.decoder_.reset();this.nextField_=jspb.BinaryConstants.INVALID_FIELD_NUMBER;this.nextWireType_=jspb.BinaryConstants.WireType.INVALID};jspb.BinaryReader.prototype.advance=function($){this.decoder_.advance($)};jspb.BinaryReader.prototype.nextField=function(){if(this.decoder_.atEnd())return!1;if(this.getError())return jspb.asserts.fail("Decoder hit an error"),!1;this.fieldCursor_=this.decoder_.getCursor();var $=this.decoder_.readUnsignedVarint32(),ee=$>>>3;$&=7;if($!=jspb.BinaryConstants.WireType.VARINT&&$!=jspb.BinaryConstants.WireType.FIXED32&&$!=jspb.BinaryConstants.WireType.FIXED64&&$!=jspb.BinaryConstants.WireType.DELIMITED&&$!=jspb.BinaryConstants.WireType.START_GROUP&&$!=jspb.BinaryConstants.WireType.END_GROUP)return jspb.asserts.fail("Invalid wire type: %s (at position %s)",$,this.fieldCursor_),this.error_=!0,!1;this.nextField_=ee;this.nextWireType_=$;return!0};goog.exportProperty(jspb.BinaryReader.prototype,"nextField",jspb.BinaryReader.prototype.nextField);jspb.BinaryReader.prototype.unskipHeader=function(){this.decoder_.unskipVarint(this.nextField_<<3|this.nextWireType_)};jspb.BinaryReader.prototype.skipMatchingFields=function(){var $=this.nextField_;for(this.unskipHeader();this.nextField()&&this.getFieldNumber()==$;)this.skipField();this.decoder_.atEnd()||this.unskipHeader()};jspb.BinaryReader.prototype.skipVarintField=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.VARINT?(jspb.asserts.fail("Invalid wire type for skipVarintField"),this.skipField()):this.decoder_.skipVarint()};jspb.BinaryReader.prototype.skipDelimitedField=function(){if(this.nextWireType_!=jspb.BinaryConstants.WireType.DELIMITED)jspb.asserts.fail("Invalid wire type for skipDelimitedField"),this.skipField();else{var $=this.decoder_.readUnsignedVarint32();this.decoder_.advance($)}};jspb.BinaryReader.prototype.skipFixed32Field=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.FIXED32?(jspb.asserts.fail("Invalid wire type for skipFixed32Field"),this.skipField()):this.decoder_.advance(4)};jspb.BinaryReader.prototype.skipFixed64Field=function(){this.nextWireType_!=jspb.BinaryConstants.WireType.FIXED64?(jspb.asserts.fail("Invalid wire type for skipFixed64Field"),this.skipField()):this.decoder_.advance(8)};jspb.BinaryReader.prototype.skipGroup=function(){var $=this.nextField_;do{if(!this.nextField()){jspb.asserts.fail("Unmatched start-group tag: stream EOF");this.error_=!0;break}if(this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP){this.nextField_!=$&&(jspb.asserts.fail("Unmatched end-group tag"),this.error_=!0);break}this.skipField()}while(1)};jspb.BinaryReader.prototype.skipField=function(){switch(this.nextWireType_){case jspb.BinaryConstants.WireType.VARINT:this.skipVarintField();break;case jspb.BinaryConstants.WireType.FIXED64:this.skipFixed64Field();break;case jspb.BinaryConstants.WireType.DELIMITED:this.skipDelimitedField();break;case jspb.BinaryConstants.WireType.FIXED32:this.skipFixed32Field();break;case jspb.BinaryConstants.WireType.START_GROUP:this.skipGroup();break;default:jspb.asserts.fail("Invalid wire encoding for field.")}};jspb.BinaryReader.prototype.registerReadCallback=function($,ee){null===this.readCallbacks_&&(this.readCallbacks_={});jspb.asserts.assert(!this.readCallbacks_[$]);this.readCallbacks_[$]=ee};jspb.BinaryReader.prototype.runReadCallback=function($){jspb.asserts.assert(null!==this.readCallbacks_);$=this.readCallbacks_[$];jspb.asserts.assert($);return $(this)};jspb.BinaryReader.prototype.readAny=function($){this.nextWireType_=jspb.BinaryConstants.FieldTypeToWireType($);var ee=jspb.BinaryConstants.FieldType;switch($){case ee.DOUBLE:return this.readDouble();case ee.FLOAT:return this.readFloat();case ee.INT64:return this.readInt64();case ee.UINT64:return this.readUint64();case ee.INT32:return this.readInt32();case ee.FIXED64:return this.readFixed64();case ee.FIXED32:return this.readFixed32();case ee.BOOL:return this.readBool();case ee.STRING:return this.readString();case ee.GROUP:jspb.asserts.fail("Group field type not supported in readAny()");case ee.MESSAGE:jspb.asserts.fail("Message field type not supported in readAny()");case ee.BYTES:return this.readBytes();case ee.UINT32:return this.readUint32();case ee.ENUM:return this.readEnum();case ee.SFIXED32:return this.readSfixed32();case ee.SFIXED64:return this.readSfixed64();case ee.SINT32:return this.readSint32();case ee.SINT64:return this.readSint64();case ee.FHASH64:return this.readFixedHash64();case ee.VHASH64:return this.readVarintHash64();default:jspb.asserts.fail("Invalid field type in readAny()")}return 0};jspb.BinaryReader.prototype.readMessage=function($,ee){jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var et=this.decoder_.getEnd(),en=this.decoder_.readUnsignedVarint32();en=this.decoder_.getCursor()+en;this.decoder_.setEnd(en);ee($,this);this.decoder_.setCursor(en);this.decoder_.setEnd(et)};goog.exportProperty(jspb.BinaryReader.prototype,"readMessage",jspb.BinaryReader.prototype.readMessage);jspb.BinaryReader.prototype.readGroup=function($,ee,et){jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.START_GROUP);jspb.asserts.assert(this.nextField_==$);et(ee,this);this.error_||this.nextWireType_==jspb.BinaryConstants.WireType.END_GROUP||(jspb.asserts.fail("Group submessage did not end with an END_GROUP tag"),this.error_=!0)};goog.exportProperty(jspb.BinaryReader.prototype,"readGroup",jspb.BinaryReader.prototype.readGroup);jspb.BinaryReader.prototype.getFieldDecoder=function(){jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var $=this.decoder_.readUnsignedVarint32(),ee=this.decoder_.getCursor(),et=ee+$;$=jspb.BinaryDecoder.alloc(this.decoder_.getBuffer(),ee,$);this.decoder_.setCursor(et);return $};jspb.BinaryReader.prototype.readInt32=function(){jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readSignedVarint32()};goog.exportProperty(jspb.BinaryReader.prototype,"readInt32",jspb.BinaryReader.prototype.readInt32);jspb.BinaryReader.prototype.readInt32String=function(){jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readSignedVarint32String()};jspb.BinaryReader.prototype.readInt64=function(){jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readSignedVarint64()};goog.exportProperty(jspb.BinaryReader.prototype,"readInt64",jspb.BinaryReader.prototype.readInt64);jspb.BinaryReader.prototype.readInt64String=function(){jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readSignedVarint64String()};jspb.BinaryReader.prototype.readUint32=function(){jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readUnsignedVarint32()};goog.exportProperty(jspb.BinaryReader.prototype,"readUint32",jspb.BinaryReader.prototype.readUint32);jspb.BinaryReader.prototype.readUint32String=function(){jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readUnsignedVarint32String()};jspb.BinaryReader.prototype.readUint64=function(){jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readUnsignedVarint64()};goog.exportProperty(jspb.BinaryReader.prototype,"readUint64",jspb.BinaryReader.prototype.readUint64);jspb.BinaryReader.prototype.readUint64String=function(){jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readUnsignedVarint64String()};jspb.BinaryReader.prototype.readSint32=function(){jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readZigzagVarint32()};goog.exportProperty(jspb.BinaryReader.prototype,"readSint32",jspb.BinaryReader.prototype.readSint32);jspb.BinaryReader.prototype.readSint64=function(){jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readZigzagVarint64()};goog.exportProperty(jspb.BinaryReader.prototype,"readSint64",jspb.BinaryReader.prototype.readSint64);jspb.BinaryReader.prototype.readSint64String=function(){jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readZigzagVarint64String()};jspb.BinaryReader.prototype.readFixed32=function(){jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32);return this.decoder_.readUint32()};goog.exportProperty(jspb.BinaryReader.prototype,"readFixed32",jspb.BinaryReader.prototype.readFixed32);jspb.BinaryReader.prototype.readFixed64=function(){jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64);return this.decoder_.readUint64()};goog.exportProperty(jspb.BinaryReader.prototype,"readFixed64",jspb.BinaryReader.prototype.readFixed64);jspb.BinaryReader.prototype.readFixed64String=function(){jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64);return this.decoder_.readUint64String()};jspb.BinaryReader.prototype.readSfixed32=function(){jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32);return this.decoder_.readInt32()};goog.exportProperty(jspb.BinaryReader.prototype,"readSfixed32",jspb.BinaryReader.prototype.readSfixed32);jspb.BinaryReader.prototype.readSfixed32String=function(){jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32);return this.decoder_.readInt32().toString()};jspb.BinaryReader.prototype.readSfixed64=function(){jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64);return this.decoder_.readInt64()};goog.exportProperty(jspb.BinaryReader.prototype,"readSfixed64",jspb.BinaryReader.prototype.readSfixed64);jspb.BinaryReader.prototype.readSfixed64String=function(){jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64);return this.decoder_.readInt64String()};jspb.BinaryReader.prototype.readFloat=function(){jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED32);return this.decoder_.readFloat()};goog.exportProperty(jspb.BinaryReader.prototype,"readFloat",jspb.BinaryReader.prototype.readFloat);jspb.BinaryReader.prototype.readDouble=function(){jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64);return this.decoder_.readDouble()};goog.exportProperty(jspb.BinaryReader.prototype,"readDouble",jspb.BinaryReader.prototype.readDouble);jspb.BinaryReader.prototype.readBool=function(){jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return!!this.decoder_.readUnsignedVarint32()};goog.exportProperty(jspb.BinaryReader.prototype,"readBool",jspb.BinaryReader.prototype.readBool);jspb.BinaryReader.prototype.readEnum=function(){jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readSignedVarint64()};goog.exportProperty(jspb.BinaryReader.prototype,"readEnum",jspb.BinaryReader.prototype.readEnum);jspb.BinaryReader.prototype.readString=function(){jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var $=this.decoder_.readUnsignedVarint32();return this.decoder_.readString($)};goog.exportProperty(jspb.BinaryReader.prototype,"readString",jspb.BinaryReader.prototype.readString);jspb.BinaryReader.prototype.readBytes=function(){jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var $=this.decoder_.readUnsignedVarint32();return this.decoder_.readBytes($)};goog.exportProperty(jspb.BinaryReader.prototype,"readBytes",jspb.BinaryReader.prototype.readBytes);jspb.BinaryReader.prototype.readVarintHash64=function(){jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readVarintHash64()};jspb.BinaryReader.prototype.readSintHash64=function(){jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readZigzagVarintHash64()};jspb.BinaryReader.prototype.readSplitVarint64=function($){jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readSplitVarint64($)};jspb.BinaryReader.prototype.readSplitZigzagVarint64=function($){jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.VARINT);return this.decoder_.readSplitVarint64(function(ee,et){return jspb.utils.fromZigzag64(ee,et,$)})};jspb.BinaryReader.prototype.readFixedHash64=function(){jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64);return this.decoder_.readFixedHash64()};jspb.BinaryReader.prototype.readSplitFixed64=function($){jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.FIXED64);return this.decoder_.readSplitFixed64($)};jspb.BinaryReader.prototype.readPackedField_=function($){jspb.asserts.assert(this.nextWireType_==jspb.BinaryConstants.WireType.DELIMITED);var ee=this.decoder_.readUnsignedVarint32();ee=this.decoder_.getCursor()+ee;for(var et=[];this.decoder_.getCursor()<ee;)et.push($.call(this.decoder_));return et};jspb.BinaryReader.prototype.readPackedInt32=function(){return this.readPackedField_(this.decoder_.readSignedVarint32)};goog.exportProperty(jspb.BinaryReader.prototype,"readPackedInt32",jspb.BinaryReader.prototype.readPackedInt32);jspb.BinaryReader.prototype.readPackedInt32String=function(){return this.readPackedField_(this.decoder_.readSignedVarint32String)};jspb.BinaryReader.prototype.readPackedInt64=function(){return this.readPackedField_(this.decoder_.readSignedVarint64)};goog.exportProperty(jspb.BinaryReader.prototype,"readPackedInt64",jspb.BinaryReader.prototype.readPackedInt64);jspb.BinaryReader.prototype.readPackedInt64String=function(){return this.readPackedField_(this.decoder_.readSignedVarint64String)};jspb.BinaryReader.prototype.readPackedUint32=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint32)};goog.exportProperty(jspb.BinaryReader.prototype,"readPackedUint32",jspb.BinaryReader.prototype.readPackedUint32);jspb.BinaryReader.prototype.readPackedUint32String=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint32String)};jspb.BinaryReader.prototype.readPackedUint64=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint64)};goog.exportProperty(jspb.BinaryReader.prototype,"readPackedUint64",jspb.BinaryReader.prototype.readPackedUint64);jspb.BinaryReader.prototype.readPackedUint64String=function(){return this.readPackedField_(this.decoder_.readUnsignedVarint64String)};jspb.BinaryReader.prototype.readPackedSint32=function(){return this.readPackedField_(this.decoder_.readZigzagVarint32)};goog.exportProperty(jspb.BinaryReader.prototype,"readPackedSint32",jspb.BinaryReader.prototype.readPackedSint32);jspb.BinaryReader.prototype.readPackedSint64=function(){return this.readPackedField_(this.decoder_.readZigzagVarint64)};goog.exportProperty(jspb.BinaryReader.prototype,"readPackedSint64",jspb.BinaryReader.prototype.readPackedSint64);jspb.BinaryReader.prototype.readPackedSint64String=function(){return this.readPackedField_(this.decoder_.readZigzagVarint64String)};jspb.BinaryReader.prototype.readPackedFixed32=function(){return this.readPackedField_(this.decoder_.readUint32)};goog.exportProperty(jspb.BinaryReader.prototype,"readPackedFixed32",jspb.BinaryReader.prototype.readPackedFixed32);jspb.BinaryReader.prototype.readPackedFixed64=function(){return this.readPackedField_(this.decoder_.readUint64)};goog.exportProperty(jspb.BinaryReader.prototype,"readPackedFixed64",jspb.BinaryReader.prototype.readPackedFixed64);jspb.BinaryReader.prototype.readPackedFixed64String=function(){return this.readPackedField_(this.decoder_.readUint64String)};jspb.BinaryReader.prototype.readPackedSfixed32=function(){return this.readPackedField_(this.decoder_.readInt32)};goog.exportProperty(jspb.BinaryReader.prototype,"readPackedSfixed32",jspb.BinaryReader.prototype.readPackedSfixed32);jspb.BinaryReader.prototype.readPackedSfixed64=function(){return this.readPackedField_(this.decoder_.readInt64)};goog.exportProperty(jspb.BinaryReader.prototype,"readPackedSfixed64",jspb.BinaryReader.prototype.readPackedSfixed64);jspb.BinaryReader.prototype.readPackedSfixed64String=function(){return this.readPackedField_(this.decoder_.readInt64String)};jspb.BinaryReader.prototype.readPackedFloat=function(){return this.readPackedField_(this.decoder_.readFloat)};goog.exportProperty(jspb.BinaryReader.prototype,"readPackedFloat",jspb.BinaryReader.prototype.readPackedFloat);jspb.BinaryReader.prototype.readPackedDouble=function(){return this.readPackedField_(this.decoder_.readDouble)};goog.exportProperty(jspb.BinaryReader.prototype,"readPackedDouble",jspb.BinaryReader.prototype.readPackedDouble);jspb.BinaryReader.prototype.readPackedBool=function(){return this.readPackedField_(this.decoder_.readBool)};goog.exportProperty(jspb.BinaryReader.prototype,"readPackedBool",jspb.BinaryReader.prototype.readPackedBool);jspb.BinaryReader.prototype.readPackedEnum=function(){return this.readPackedField_(this.decoder_.readEnum)};goog.exportProperty(jspb.BinaryReader.prototype,"readPackedEnum",jspb.BinaryReader.prototype.readPackedEnum);jspb.BinaryReader.prototype.readPackedVarintHash64=function(){return this.readPackedField_(this.decoder_.readVarintHash64)};jspb.BinaryReader.prototype.readPackedFixedHash64=function(){return this.readPackedField_(this.decoder_.readFixedHash64)};jspb.BinaryEncoder=function(){this.buffer_=[]};jspb.BinaryEncoder.prototype.length=function(){return this.buffer_.length};jspb.BinaryEncoder.prototype.end=function(){var $=this.buffer_;this.buffer_=[];return $};jspb.BinaryEncoder.prototype.writeSplitVarint64=function($,ee){jspb.asserts.assert($==Math.floor($));jspb.asserts.assert(ee==Math.floor(ee));jspb.asserts.assert(0<=$&&$<jspb.BinaryConstants.TWO_TO_32);for(jspb.asserts.assert(0<=ee&&ee<jspb.BinaryConstants.TWO_TO_32);0<ee||127<$;)this.buffer_.push($&127|128),$=($>>>7|ee<<25)>>>0,ee>>>=7;this.buffer_.push($)};jspb.BinaryEncoder.prototype.writeSplitFixed64=function($,ee){jspb.asserts.assert($==Math.floor($));jspb.asserts.assert(ee==Math.floor(ee));jspb.asserts.assert(0<=$&&$<jspb.BinaryConstants.TWO_TO_32);jspb.asserts.assert(0<=ee&&ee<jspb.BinaryConstants.TWO_TO_32);this.writeUint32($);this.writeUint32(ee)};jspb.BinaryEncoder.prototype.writeUnsignedVarint32=function($){jspb.asserts.assert($==Math.floor($));for(jspb.asserts.assert(0<=$&&$<jspb.BinaryConstants.TWO_TO_32);127<$;)this.buffer_.push($&127|128),$>>>=7;this.buffer_.push($)};jspb.BinaryEncoder.prototype.writeSignedVarint32=function($){jspb.asserts.assert($==Math.floor($));jspb.asserts.assert($>=-jspb.BinaryConstants.TWO_TO_31&&$<jspb.BinaryConstants.TWO_TO_31);if(0<=$)this.writeUnsignedVarint32($);else{for(var ee=0;9>ee;ee++)this.buffer_.push($&127|128),$>>=7;this.buffer_.push(1)}};jspb.BinaryEncoder.prototype.writeUnsignedVarint64=function($){jspb.asserts.assert($==Math.floor($));jspb.asserts.assert(0<=$&&$<jspb.BinaryConstants.TWO_TO_64);jspb.utils.splitInt64($);this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)};jspb.BinaryEncoder.prototype.writeSignedVarint64=function($){jspb.asserts.assert($==Math.floor($));jspb.asserts.assert($>=-jspb.BinaryConstants.TWO_TO_63&&$<jspb.BinaryConstants.TWO_TO_63);jspb.utils.splitInt64($);this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)};jspb.BinaryEncoder.prototype.writeZigzagVarint32=function($){jspb.asserts.assert($==Math.floor($));jspb.asserts.assert($>=-jspb.BinaryConstants.TWO_TO_31&&$<jspb.BinaryConstants.TWO_TO_31);this.writeUnsignedVarint32(($<<1^$>>31)>>>0)};jspb.BinaryEncoder.prototype.writeZigzagVarint64=function($){jspb.asserts.assert($==Math.floor($));jspb.asserts.assert($>=-jspb.BinaryConstants.TWO_TO_63&&$<jspb.BinaryConstants.TWO_TO_63);jspb.utils.splitZigzag64($);this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)};jspb.BinaryEncoder.prototype.writeZigzagVarint64String=function($){this.writeZigzagVarintHash64(jspb.utils.decimalStringToHash64($))};jspb.BinaryEncoder.prototype.writeZigzagVarintHash64=function($){var ee=this;jspb.utils.splitHash64($);jspb.utils.toZigzag64(jspb.utils.split64Low,jspb.utils.split64High,function($,et){ee.writeSplitVarint64($>>>0,et>>>0)})};jspb.BinaryEncoder.prototype.writeUint8=function($){jspb.asserts.assert($==Math.floor($));jspb.asserts.assert(0<=$&&256>$);this.buffer_.push($>>>0&255)};jspb.BinaryEncoder.prototype.writeUint16=function($){jspb.asserts.assert($==Math.floor($));jspb.asserts.assert(0<=$&&65536>$);this.buffer_.push($>>>0&255);this.buffer_.push($>>>8&255)};jspb.BinaryEncoder.prototype.writeUint32=function($){jspb.asserts.assert($==Math.floor($));jspb.asserts.assert(0<=$&&$<jspb.BinaryConstants.TWO_TO_32);this.buffer_.push($>>>0&255);this.buffer_.push($>>>8&255);this.buffer_.push($>>>16&255);this.buffer_.push($>>>24&255)};jspb.BinaryEncoder.prototype.writeUint64=function($){jspb.asserts.assert($==Math.floor($));jspb.asserts.assert(0<=$&&$<jspb.BinaryConstants.TWO_TO_64);jspb.utils.splitUint64($);this.writeUint32(jspb.utils.split64Low);this.writeUint32(jspb.utils.split64High)};jspb.BinaryEncoder.prototype.writeInt8=function($){jspb.asserts.assert($==Math.floor($));jspb.asserts.assert(-128<=$&&128>$);this.buffer_.push($>>>0&255)};jspb.BinaryEncoder.prototype.writeInt16=function($){jspb.asserts.assert($==Math.floor($));jspb.asserts.assert(-32768<=$&&32768>$);this.buffer_.push($>>>0&255);this.buffer_.push($>>>8&255)};jspb.BinaryEncoder.prototype.writeInt32=function($){jspb.asserts.assert($==Math.floor($));jspb.asserts.assert($>=-jspb.BinaryConstants.TWO_TO_31&&$<jspb.BinaryConstants.TWO_TO_31);this.buffer_.push($>>>0&255);this.buffer_.push($>>>8&255);this.buffer_.push($>>>16&255);this.buffer_.push($>>>24&255)};jspb.BinaryEncoder.prototype.writeInt64=function($){jspb.asserts.assert($==Math.floor($));jspb.asserts.assert($>=-jspb.BinaryConstants.TWO_TO_63&&$<jspb.BinaryConstants.TWO_TO_63);jspb.utils.splitInt64($);this.writeSplitFixed64(jspb.utils.split64Low,jspb.utils.split64High)};jspb.BinaryEncoder.prototype.writeInt64String=function($){jspb.asserts.assert($==Math.floor($));jspb.asserts.assert(+$>=-jspb.BinaryConstants.TWO_TO_63&&+$<jspb.BinaryConstants.TWO_TO_63);jspb.utils.splitHash64(jspb.utils.decimalStringToHash64($));this.writeSplitFixed64(jspb.utils.split64Low,jspb.utils.split64High)};jspb.BinaryEncoder.prototype.writeFloat=function($){jspb.asserts.assert(Infinity===$||-Infinity===$||isNaN($)||$>=-jspb.BinaryConstants.FLOAT32_MAX&&$<=jspb.BinaryConstants.FLOAT32_MAX);jspb.utils.splitFloat32($);this.writeUint32(jspb.utils.split64Low)};jspb.BinaryEncoder.prototype.writeDouble=function($){jspb.asserts.assert(Infinity===$||-Infinity===$||isNaN($)||$>=-jspb.BinaryConstants.FLOAT64_MAX&&$<=jspb.BinaryConstants.FLOAT64_MAX);jspb.utils.splitFloat64($);this.writeUint32(jspb.utils.split64Low);this.writeUint32(jspb.utils.split64High)};jspb.BinaryEncoder.prototype.writeBool=function($){jspb.asserts.assert("boolean"===typeof $||"number"===typeof $);this.buffer_.push($?1:0)};jspb.BinaryEncoder.prototype.writeEnum=function($){jspb.asserts.assert($==Math.floor($));jspb.asserts.assert($>=-jspb.BinaryConstants.TWO_TO_31&&$<jspb.BinaryConstants.TWO_TO_31);this.writeSignedVarint32($)};jspb.BinaryEncoder.prototype.writeBytes=function($){this.buffer_.push.apply(this.buffer_,$)};jspb.BinaryEncoder.prototype.writeVarintHash64=function($){jspb.utils.splitHash64($);this.writeSplitVarint64(jspb.utils.split64Low,jspb.utils.split64High)};jspb.BinaryEncoder.prototype.writeFixedHash64=function($){jspb.utils.splitHash64($);this.writeUint32(jspb.utils.split64Low);this.writeUint32(jspb.utils.split64High)};jspb.BinaryEncoder.prototype.writeString=function($){var ee=this.buffer_.length;jspb.asserts.assertString($);for(var et=0;et<$.length;et++){var en=$.charCodeAt(et);if(128>en)this.buffer_.push(en);else if(2048>en)this.buffer_.push(en>>6|192),this.buffer_.push(en&63|128);else if(65536>en)if(55296<=en&&56319>=en&&et+1<$.length){var ei=$.charCodeAt(et+1);56320<=ei&&57343>=ei&&(en=1024*(en-55296)+ei-56320+65536,this.buffer_.push(en>>18|240),this.buffer_.push(en>>12&63|128),this.buffer_.push(en>>6&63|128),this.buffer_.push(en&63|128),et++)}else this.buffer_.push(en>>12|224),this.buffer_.push(en>>6&63|128),this.buffer_.push(en&63|128)}return this.buffer_.length-ee};jspb.arith={};jspb.arith.UInt64=function($,ee){this.lo=$;this.hi=ee};jspb.arith.UInt64.prototype.cmp=function($){return this.hi<$.hi||this.hi==$.hi&&this.lo<$.lo?-1:this.hi==$.hi&&this.lo==$.lo?0:1};jspb.arith.UInt64.prototype.rightShift=function(){return new jspb.arith.UInt64((this.lo>>>1|(this.hi&1)<<31)>>>0,this.hi>>>1>>>0)};jspb.arith.UInt64.prototype.leftShift=function(){return new jspb.arith.UInt64(this.lo<<1>>>0,(this.hi<<1|this.lo>>>31)>>>0)};jspb.arith.UInt64.prototype.msb=function(){return!!(this.hi&2147483648)};jspb.arith.UInt64.prototype.lsb=function(){return!!(this.lo&1)};jspb.arith.UInt64.prototype.zero=function(){return 0==this.lo&&0==this.hi};jspb.arith.UInt64.prototype.add=function($){return new jspb.arith.UInt64((this.lo+$.lo&4294967295)>>>0>>>0,((this.hi+$.hi&4294967295)>>>0)+(4294967296<=this.lo+$.lo?1:0)>>>0)};jspb.arith.UInt64.prototype.sub=function($){return new jspb.arith.UInt64((this.lo-$.lo&4294967295)>>>0>>>0,((this.hi-$.hi&4294967295)>>>0)-(0>this.lo-$.lo?1:0)>>>0)};jspb.arith.UInt64.mul32x32=function($,ee){var et=$&65535;$>>>=16;var en=ee&65535,ei=ee>>>16;ee=et*en+65536*(et*ei&65535)+65536*($*en&65535);for(et=$*ei+(et*ei>>>16)+($*en>>>16);4294967296<=ee;)ee-=4294967296,et+=1;return new jspb.arith.UInt64(ee>>>0,et>>>0)};jspb.arith.UInt64.prototype.mul=function($){var ee=jspb.arith.UInt64.mul32x32(this.lo,$);$=jspb.arith.UInt64.mul32x32(this.hi,$);$.hi=$.lo;$.lo=0;return ee.add($)};jspb.arith.UInt64.prototype.div=function($){if(0==$)return[];var ee=new jspb.arith.UInt64(0,0),et=new jspb.arith.UInt64(this.lo,this.hi);$=new jspb.arith.UInt64($,0);for(var en=new jspb.arith.UInt64(1,0);!$.msb();)$=$.leftShift(),en=en.leftShift();for(;!en.zero();)0>=$.cmp(et)&&(ee=ee.add(en),et=et.sub($)),$=$.rightShift(),en=en.rightShift();return[ee,et]};jspb.arith.UInt64.prototype.toString=function(){for(var $="",ee=this;!ee.zero();){ee=ee.div(10);var et=ee[0];$=ee[1].lo+$;ee=et}""==$&&($="0");return $};jspb.arith.UInt64.fromString=function($){for(var ee=new jspb.arith.UInt64(0,0),et=new jspb.arith.UInt64(0,0),en=0;en<$.length;en++){if("0">$[en]||"9"<$[en])return null;var ei=parseInt($[en],10);et.lo=ei;ee=ee.mul(10).add(et)}return ee};jspb.arith.UInt64.prototype.clone=function(){return new jspb.arith.UInt64(this.lo,this.hi)};jspb.arith.Int64=function($,ee){this.lo=$;this.hi=ee};jspb.arith.Int64.prototype.add=function($){return new jspb.arith.Int64((this.lo+$.lo&4294967295)>>>0>>>0,((this.hi+$.hi&4294967295)>>>0)+(4294967296<=this.lo+$.lo?1:0)>>>0)};jspb.arith.Int64.prototype.sub=function($){return new jspb.arith.Int64((this.lo-$.lo&4294967295)>>>0>>>0,((this.hi-$.hi&4294967295)>>>0)-(0>this.lo-$.lo?1:0)>>>0)};jspb.arith.Int64.prototype.clone=function(){return new jspb.arith.Int64(this.lo,this.hi)};jspb.arith.Int64.prototype.toString=function(){var $=0!=(this.hi&2147483648),ee=new jspb.arith.UInt64(this.lo,this.hi);$&&(ee=new jspb.arith.UInt64(0,0).sub(ee));return($?"-":"")+ee.toString()};jspb.arith.Int64.fromString=function($){var ee=0<$.length&&"-"==$[0];ee&&($=$.substring(1));$=jspb.arith.UInt64.fromString($);if(null===$)return null;ee&&($=new jspb.arith.UInt64(0,0).sub($));return new jspb.arith.Int64($.lo,$.hi)};jspb.BinaryWriter=function(){this.blocks_=[];this.totalLength_=0;this.encoder_=new jspb.BinaryEncoder;this.bookmarks_=[]};jspb.BinaryWriter.prototype.appendUint8Array_=function($){var ee=this.encoder_.end();this.blocks_.push(ee);this.blocks_.push($);this.totalLength_+=ee.length+$.length};jspb.BinaryWriter.prototype.beginDelimited_=function($){this.writeFieldHeader_($,jspb.BinaryConstants.WireType.DELIMITED);$=this.encoder_.end();this.blocks_.push($);this.totalLength_+=$.length;$.push(this.totalLength_);return $};jspb.BinaryWriter.prototype.endDelimited_=function($){var ee=$.pop();ee=this.totalLength_+this.encoder_.length()-ee;for(jspb.asserts.assert(0<=ee);127<ee;)$.push(ee&127|128),ee>>>=7,this.totalLength_++;$.push(ee);this.totalLength_++};jspb.BinaryWriter.prototype.writeSerializedMessage=function($,ee,et){this.appendUint8Array_($.subarray(ee,et))};jspb.BinaryWriter.prototype.maybeWriteSerializedMessage=function($,ee,et){null!=$&&null!=ee&&null!=et&&this.writeSerializedMessage($,ee,et)};jspb.BinaryWriter.prototype.reset=function(){this.blocks_=[];this.encoder_.end();this.totalLength_=0;this.bookmarks_=[]};jspb.BinaryWriter.prototype.getResultBuffer=function(){jspb.asserts.assert(0==this.bookmarks_.length);for(var $=new Uint8Array(this.totalLength_+this.encoder_.length()),ee=this.blocks_,et=ee.length,en=0,ei=0;ei<et;ei++){var eo=ee[ei];$.set(eo,en);en+=eo.length}ee=this.encoder_.end();$.set(ee,en);en+=ee.length;jspb.asserts.assert(en==$.length);this.blocks_=[$];return $};goog.exportProperty(jspb.BinaryWriter.prototype,"getResultBuffer",jspb.BinaryWriter.prototype.getResultBuffer);jspb.BinaryWriter.prototype.getResultBase64String=function($){return goog.crypt.base64.encodeByteArray(this.getResultBuffer(),$)};jspb.BinaryWriter.prototype.beginSubMessage=function($){this.bookmarks_.push(this.beginDelimited_($))};jspb.BinaryWriter.prototype.endSubMessage=function(){jspb.asserts.assert(0<=this.bookmarks_.length);this.endDelimited_(this.bookmarks_.pop())};jspb.BinaryWriter.prototype.writeFieldHeader_=function($,ee){jspb.asserts.assert(1<=$&&$==Math.floor($));this.encoder_.writeUnsignedVarint32(8*$+ee)};jspb.BinaryWriter.prototype.writeAny=function($,ee,et){var en=jspb.BinaryConstants.FieldType;switch($){case en.DOUBLE:this.writeDouble(ee,et);break;case en.FLOAT:this.writeFloat(ee,et);break;case en.INT64:this.writeInt64(ee,et);break;case en.UINT64:this.writeUint64(ee,et);break;case en.INT32:this.writeInt32(ee,et);break;case en.FIXED64:this.writeFixed64(ee,et);break;case en.FIXED32:this.writeFixed32(ee,et);break;case en.BOOL:this.writeBool(ee,et);break;case en.STRING:this.writeString(ee,et);break;case en.GROUP:jspb.asserts.fail("Group field type not supported in writeAny()");break;case en.MESSAGE:jspb.asserts.fail("Message field type not supported in writeAny()");break;case en.BYTES:this.writeBytes(ee,et);break;case en.UINT32:this.writeUint32(ee,et);break;case en.ENUM:this.writeEnum(ee,et);break;case en.SFIXED32:this.writeSfixed32(ee,et);break;case en.SFIXED64:this.writeSfixed64(ee,et);break;case en.SINT32:this.writeSint32(ee,et);break;case en.SINT64:this.writeSint64(ee,et);break;case en.FHASH64:this.writeFixedHash64(ee,et);break;case en.VHASH64:this.writeVarintHash64(ee,et);break;default:jspb.asserts.fail("Invalid field type in writeAny()")}};jspb.BinaryWriter.prototype.writeUnsignedVarint32_=function($,ee){null!=ee&&(this.writeFieldHeader_($,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeUnsignedVarint32(ee))};jspb.BinaryWriter.prototype.writeSignedVarint32_=function($,ee){null!=ee&&(this.writeFieldHeader_($,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint32(ee))};jspb.BinaryWriter.prototype.writeUnsignedVarint64_=function($,ee){null!=ee&&(this.writeFieldHeader_($,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeUnsignedVarint64(ee))};jspb.BinaryWriter.prototype.writeSignedVarint64_=function($,ee){null!=ee&&(this.writeFieldHeader_($,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint64(ee))};jspb.BinaryWriter.prototype.writeZigzagVarint32_=function($,ee){null!=ee&&(this.writeFieldHeader_($,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarint32(ee))};jspb.BinaryWriter.prototype.writeZigzagVarint64_=function($,ee){null!=ee&&(this.writeFieldHeader_($,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarint64(ee))};jspb.BinaryWriter.prototype.writeZigzagVarint64String_=function($,ee){null!=ee&&(this.writeFieldHeader_($,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarint64String(ee))};jspb.BinaryWriter.prototype.writeZigzagVarintHash64_=function($,ee){null!=ee&&(this.writeFieldHeader_($,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeZigzagVarintHash64(ee))};jspb.BinaryWriter.prototype.writeInt32=function($,ee){null!=ee&&(jspb.asserts.assert(ee>=-jspb.BinaryConstants.TWO_TO_31&&ee<jspb.BinaryConstants.TWO_TO_31),this.writeSignedVarint32_($,ee))};goog.exportProperty(jspb.BinaryWriter.prototype,"writeInt32",jspb.BinaryWriter.prototype.writeInt32);jspb.BinaryWriter.prototype.writeInt32String=function($,ee){null!=ee&&(ee=parseInt(ee,10),jspb.asserts.assert(ee>=-jspb.BinaryConstants.TWO_TO_31&&ee<jspb.BinaryConstants.TWO_TO_31),this.writeSignedVarint32_($,ee))};jspb.BinaryWriter.prototype.writeInt64=function($,ee){null!=ee&&(jspb.asserts.assert(ee>=-jspb.BinaryConstants.TWO_TO_63&&ee<jspb.BinaryConstants.TWO_TO_63),this.writeSignedVarint64_($,ee))};goog.exportProperty(jspb.BinaryWriter.prototype,"writeInt64",jspb.BinaryWriter.prototype.writeInt64);jspb.BinaryWriter.prototype.writeInt64String=function($,ee){null!=ee&&(ee=jspb.arith.Int64.fromString(ee),this.writeFieldHeader_($,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSplitVarint64(ee.lo,ee.hi))};jspb.BinaryWriter.prototype.writeUint32=function($,ee){null!=ee&&(jspb.asserts.assert(0<=ee&&ee<jspb.BinaryConstants.TWO_TO_32),this.writeUnsignedVarint32_($,ee))};goog.exportProperty(jspb.BinaryWriter.prototype,"writeUint32",jspb.BinaryWriter.prototype.writeUint32);jspb.BinaryWriter.prototype.writeUint32String=function($,ee){null!=ee&&(ee=parseInt(ee,10),jspb.asserts.assert(0<=ee&&ee<jspb.BinaryConstants.TWO_TO_32),this.writeUnsignedVarint32_($,ee))};jspb.BinaryWriter.prototype.writeUint64=function($,ee){null!=ee&&(jspb.asserts.assert(0<=ee&&ee<jspb.BinaryConstants.TWO_TO_64),this.writeUnsignedVarint64_($,ee))};goog.exportProperty(jspb.BinaryWriter.prototype,"writeUint64",jspb.BinaryWriter.prototype.writeUint64);jspb.BinaryWriter.prototype.writeUint64String=function($,ee){null!=ee&&(ee=jspb.arith.UInt64.fromString(ee),this.writeFieldHeader_($,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSplitVarint64(ee.lo,ee.hi))};jspb.BinaryWriter.prototype.writeSint32=function($,ee){null!=ee&&(jspb.asserts.assert(ee>=-jspb.BinaryConstants.TWO_TO_31&&ee<jspb.BinaryConstants.TWO_TO_31),this.writeZigzagVarint32_($,ee))};goog.exportProperty(jspb.BinaryWriter.prototype,"writeSint32",jspb.BinaryWriter.prototype.writeSint32);jspb.BinaryWriter.prototype.writeSint64=function($,ee){null!=ee&&(jspb.asserts.assert(ee>=-jspb.BinaryConstants.TWO_TO_63&&ee<jspb.BinaryConstants.TWO_TO_63),this.writeZigzagVarint64_($,ee))};goog.exportProperty(jspb.BinaryWriter.prototype,"writeSint64",jspb.BinaryWriter.prototype.writeSint64);jspb.BinaryWriter.prototype.writeSintHash64=function($,ee){null!=ee&&this.writeZigzagVarintHash64_($,ee)};jspb.BinaryWriter.prototype.writeSint64String=function($,ee){null!=ee&&this.writeZigzagVarint64String_($,ee)};jspb.BinaryWriter.prototype.writeFixed32=function($,ee){null!=ee&&(jspb.asserts.assert(0<=ee&&ee<jspb.BinaryConstants.TWO_TO_32),this.writeFieldHeader_($,jspb.BinaryConstants.WireType.FIXED32),this.encoder_.writeUint32(ee))};goog.exportProperty(jspb.BinaryWriter.prototype,"writeFixed32",jspb.BinaryWriter.prototype.writeFixed32);jspb.BinaryWriter.prototype.writeFixed64=function($,ee){null!=ee&&(jspb.asserts.assert(0<=ee&&ee<jspb.BinaryConstants.TWO_TO_64),this.writeFieldHeader_($,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeUint64(ee))};goog.exportProperty(jspb.BinaryWriter.prototype,"writeFixed64",jspb.BinaryWriter.prototype.writeFixed64);jspb.BinaryWriter.prototype.writeFixed64String=function($,ee){null!=ee&&(ee=jspb.arith.UInt64.fromString(ee),this.writeFieldHeader_($,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeSplitFixed64(ee.lo,ee.hi))};jspb.BinaryWriter.prototype.writeSfixed32=function($,ee){null!=ee&&(jspb.asserts.assert(ee>=-jspb.BinaryConstants.TWO_TO_31&&ee<jspb.BinaryConstants.TWO_TO_31),this.writeFieldHeader_($,jspb.BinaryConstants.WireType.FIXED32),this.encoder_.writeInt32(ee))};goog.exportProperty(jspb.BinaryWriter.prototype,"writeSfixed32",jspb.BinaryWriter.prototype.writeSfixed32);jspb.BinaryWriter.prototype.writeSfixed64=function($,ee){null!=ee&&(jspb.asserts.assert(ee>=-jspb.BinaryConstants.TWO_TO_63&&ee<jspb.BinaryConstants.TWO_TO_63),this.writeFieldHeader_($,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeInt64(ee))};goog.exportProperty(jspb.BinaryWriter.prototype,"writeSfixed64",jspb.BinaryWriter.prototype.writeSfixed64);jspb.BinaryWriter.prototype.writeSfixed64String=function($,ee){null!=ee&&(ee=jspb.arith.Int64.fromString(ee),this.writeFieldHeader_($,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeSplitFixed64(ee.lo,ee.hi))};jspb.BinaryWriter.prototype.writeFloat=function($,ee){null!=ee&&(this.writeFieldHeader_($,jspb.BinaryConstants.WireType.FIXED32),this.encoder_.writeFloat(ee))};goog.exportProperty(jspb.BinaryWriter.prototype,"writeFloat",jspb.BinaryWriter.prototype.writeFloat);jspb.BinaryWriter.prototype.writeDouble=function($,ee){null!=ee&&(this.writeFieldHeader_($,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeDouble(ee))};goog.exportProperty(jspb.BinaryWriter.prototype,"writeDouble",jspb.BinaryWriter.prototype.writeDouble);jspb.BinaryWriter.prototype.writeBool=function($,ee){null!=ee&&(jspb.asserts.assert("boolean"===typeof ee||"number"===typeof ee),this.writeFieldHeader_($,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeBool(ee))};goog.exportProperty(jspb.BinaryWriter.prototype,"writeBool",jspb.BinaryWriter.prototype.writeBool);jspb.BinaryWriter.prototype.writeEnum=function($,ee){null!=ee&&(jspb.asserts.assert(ee>=-jspb.BinaryConstants.TWO_TO_31&&ee<jspb.BinaryConstants.TWO_TO_31),this.writeFieldHeader_($,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint32(ee))};goog.exportProperty(jspb.BinaryWriter.prototype,"writeEnum",jspb.BinaryWriter.prototype.writeEnum);jspb.BinaryWriter.prototype.writeString=function($,ee){null!=ee&&($=this.beginDelimited_($),this.encoder_.writeString(ee),this.endDelimited_($))};goog.exportProperty(jspb.BinaryWriter.prototype,"writeString",jspb.BinaryWriter.prototype.writeString);jspb.BinaryWriter.prototype.writeBytes=function($,ee){null!=ee&&(ee=jspb.utils.byteSourceToUint8Array(ee),this.writeFieldHeader_($,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(ee.length),this.appendUint8Array_(ee))};goog.exportProperty(jspb.BinaryWriter.prototype,"writeBytes",jspb.BinaryWriter.prototype.writeBytes);jspb.BinaryWriter.prototype.writeMessage=function($,ee,et){null!=ee&&($=this.beginDelimited_($),et(ee,this),this.endDelimited_($))};goog.exportProperty(jspb.BinaryWriter.prototype,"writeMessage",jspb.BinaryWriter.prototype.writeMessage);jspb.BinaryWriter.prototype.writeMessageSet=function($,ee,et){null!=ee&&(this.writeFieldHeader_(1,jspb.BinaryConstants.WireType.START_GROUP),this.writeFieldHeader_(2,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeSignedVarint32($),$=this.beginDelimited_(3),et(ee,this),this.endDelimited_($),this.writeFieldHeader_(1,jspb.BinaryConstants.WireType.END_GROUP))};jspb.BinaryWriter.prototype.writeGroup=function($,ee,et){null!=ee&&(this.writeFieldHeader_($,jspb.BinaryConstants.WireType.START_GROUP),et(ee,this),this.writeFieldHeader_($,jspb.BinaryConstants.WireType.END_GROUP))};goog.exportProperty(jspb.BinaryWriter.prototype,"writeGroup",jspb.BinaryWriter.prototype.writeGroup);jspb.BinaryWriter.prototype.writeFixedHash64=function($,ee){null!=ee&&(jspb.asserts.assert(8==ee.length),this.writeFieldHeader_($,jspb.BinaryConstants.WireType.FIXED64),this.encoder_.writeFixedHash64(ee))};jspb.BinaryWriter.prototype.writeVarintHash64=function($,ee){null!=ee&&(jspb.asserts.assert(8==ee.length),this.writeFieldHeader_($,jspb.BinaryConstants.WireType.VARINT),this.encoder_.writeVarintHash64(ee))};jspb.BinaryWriter.prototype.writeSplitFixed64=function($,ee,et){this.writeFieldHeader_($,jspb.BinaryConstants.WireType.FIXED64);this.encoder_.writeSplitFixed64(ee,et)};jspb.BinaryWriter.prototype.writeSplitVarint64=function($,ee,et){this.writeFieldHeader_($,jspb.BinaryConstants.WireType.VARINT);this.encoder_.writeSplitVarint64(ee,et)};jspb.BinaryWriter.prototype.writeSplitZigzagVarint64=function($,ee,et){this.writeFieldHeader_($,jspb.BinaryConstants.WireType.VARINT);var en=this.encoder_;jspb.utils.toZigzag64(ee,et,function($,ee){en.writeSplitVarint64($>>>0,ee>>>0)})};jspb.BinaryWriter.prototype.writeRepeatedInt32=function($,ee){if(null!=ee)for(var et=0;et<ee.length;et++)this.writeSignedVarint32_($,ee[et])};goog.exportProperty(jspb.BinaryWriter.prototype,"writeRepeatedInt32",jspb.BinaryWriter.prototype.writeRepeatedInt32);jspb.BinaryWriter.prototype.writeRepeatedInt32String=function($,ee){if(null!=ee)for(var et=0;et<ee.length;et++)this.writeInt32String($,ee[et])};jspb.BinaryWriter.prototype.writeRepeatedInt64=function($,ee){if(null!=ee)for(var et=0;et<ee.length;et++)this.writeSignedVarint64_($,ee[et])};goog.exportProperty(jspb.BinaryWriter.prototype,"writeRepeatedInt64",jspb.BinaryWriter.prototype.writeRepeatedInt64);jspb.BinaryWriter.prototype.writeRepeatedSplitFixed64=function($,ee,et,en){if(null!=ee)for(var ei=0;ei<ee.length;ei++)this.writeSplitFixed64($,et(ee[ei]),en(ee[ei]))};jspb.BinaryWriter.prototype.writeRepeatedSplitVarint64=function($,ee,et,en){if(null!=ee)for(var ei=0;ei<ee.length;ei++)this.writeSplitVarint64($,et(ee[ei]),en(ee[ei]))};jspb.BinaryWriter.prototype.writeRepeatedSplitZigzagVarint64=function($,ee,et,en){if(null!=ee)for(var ei=0;ei<ee.length;ei++)this.writeSplitZigzagVarint64($,et(ee[ei]),en(ee[ei]))};jspb.BinaryWriter.prototype.writeRepeatedInt64String=function($,ee){if(null!=ee)for(var et=0;et<ee.length;et++)this.writeInt64String($,ee[et])};jspb.BinaryWriter.prototype.writeRepeatedUint32=function($,ee){if(null!=ee)for(var et=0;et<ee.length;et++)this.writeUnsignedVarint32_($,ee[et])};goog.exportProperty(jspb.BinaryWriter.prototype,"writeRepeatedUint32",jspb.BinaryWriter.prototype.writeRepeatedUint32);jspb.BinaryWriter.prototype.writeRepeatedUint32String=function($,ee){if(null!=ee)for(var et=0;et<ee.length;et++)this.writeUint32String($,ee[et])};jspb.BinaryWriter.prototype.writeRepeatedUint64=function($,ee){if(null!=ee)for(var et=0;et<ee.length;et++)this.writeUnsignedVarint64_($,ee[et])};goog.exportProperty(jspb.BinaryWriter.prototype,"writeRepeatedUint64",jspb.BinaryWriter.prototype.writeRepeatedUint64);jspb.BinaryWriter.prototype.writeRepeatedUint64String=function($,ee){if(null!=ee)for(var et=0;et<ee.length;et++)this.writeUint64String($,ee[et])};jspb.BinaryWriter.prototype.writeRepeatedSint32=function($,ee){if(null!=ee)for(var et=0;et<ee.length;et++)this.writeZigzagVarint32_($,ee[et])};goog.exportProperty(jspb.BinaryWriter.prototype,"writeRepeatedSint32",jspb.BinaryWriter.prototype.writeRepeatedSint32);jspb.BinaryWriter.prototype.writeRepeatedSint64=function($,ee){if(null!=ee)for(var et=0;et<ee.length;et++)this.writeZigzagVarint64_($,ee[et])};goog.exportProperty(jspb.BinaryWriter.prototype,"writeRepeatedSint64",jspb.BinaryWriter.prototype.writeRepeatedSint64);jspb.BinaryWriter.prototype.writeRepeatedSint64String=function($,ee){if(null!=ee)for(var et=0;et<ee.length;et++)this.writeZigzagVarint64String_($,ee[et])};jspb.BinaryWriter.prototype.writeRepeatedSintHash64=function($,ee){if(null!=ee)for(var et=0;et<ee.length;et++)this.writeZigzagVarintHash64_($,ee[et])};jspb.BinaryWriter.prototype.writeRepeatedFixed32=function($,ee){if(null!=ee)for(var et=0;et<ee.length;et++)this.writeFixed32($,ee[et])};goog.exportProperty(jspb.BinaryWriter.prototype,"writeRepeatedFixed32",jspb.BinaryWriter.prototype.writeRepeatedFixed32);jspb.BinaryWriter.prototype.writeRepeatedFixed64=function($,ee){if(null!=ee)for(var et=0;et<ee.length;et++)this.writeFixed64($,ee[et])};goog.exportProperty(jspb.BinaryWriter.prototype,"writeRepeatedFixed64",jspb.BinaryWriter.prototype.writeRepeatedFixed64);jspb.BinaryWriter.prototype.writeRepeatedFixed64String=function($,ee){if(null!=ee)for(var et=0;et<ee.length;et++)this.writeFixed64String($,ee[et])};goog.exportProperty(jspb.BinaryWriter.prototype,"writeRepeatedFixed64String",jspb.BinaryWriter.prototype.writeRepeatedFixed64String);jspb.BinaryWriter.prototype.writeRepeatedSfixed32=function($,ee){if(null!=ee)for(var et=0;et<ee.length;et++)this.writeSfixed32($,ee[et])};goog.exportProperty(jspb.BinaryWriter.prototype,"writeRepeatedSfixed32",jspb.BinaryWriter.prototype.writeRepeatedSfixed32);jspb.BinaryWriter.prototype.writeRepeatedSfixed64=function($,ee){if(null!=ee)for(var et=0;et<ee.length;et++)this.writeSfixed64($,ee[et])};goog.exportProperty(jspb.BinaryWriter.prototype,"writeRepeatedSfixed64",jspb.BinaryWriter.prototype.writeRepeatedSfixed64);jspb.BinaryWriter.prototype.writeRepeatedSfixed64String=function($,ee){if(null!=ee)for(var et=0;et<ee.length;et++)this.writeSfixed64String($,ee[et])};jspb.BinaryWriter.prototype.writeRepeatedFloat=function($,ee){if(null!=ee)for(var et=0;et<ee.length;et++)this.writeFloat($,ee[et])};goog.exportProperty(jspb.BinaryWriter.prototype,"writeRepeatedFloat",jspb.BinaryWriter.prototype.writeRepeatedFloat);jspb.BinaryWriter.prototype.writeRepeatedDouble=function($,ee){if(null!=ee)for(var et=0;et<ee.length;et++)this.writeDouble($,ee[et])};goog.exportProperty(jspb.BinaryWriter.prototype,"writeRepeatedDouble",jspb.BinaryWriter.prototype.writeRepeatedDouble);jspb.BinaryWriter.prototype.writeRepeatedBool=function($,ee){if(null!=ee)for(var et=0;et<ee.length;et++)this.writeBool($,ee[et])};goog.exportProperty(jspb.BinaryWriter.prototype,"writeRepeatedBool",jspb.BinaryWriter.prototype.writeRepeatedBool);jspb.BinaryWriter.prototype.writeRepeatedEnum=function($,ee){if(null!=ee)for(var et=0;et<ee.length;et++)this.writeEnum($,ee[et])};goog.exportProperty(jspb.BinaryWriter.prototype,"writeRepeatedEnum",jspb.BinaryWriter.prototype.writeRepeatedEnum);jspb.BinaryWriter.prototype.writeRepeatedString=function($,ee){if(null!=ee)for(var et=0;et<ee.length;et++)this.writeString($,ee[et])};goog.exportProperty(jspb.BinaryWriter.prototype,"writeRepeatedString",jspb.BinaryWriter.prototype.writeRepeatedString);jspb.BinaryWriter.prototype.writeRepeatedBytes=function($,ee){if(null!=ee)for(var et=0;et<ee.length;et++)this.writeBytes($,ee[et])};goog.exportProperty(jspb.BinaryWriter.prototype,"writeRepeatedBytes",jspb.BinaryWriter.prototype.writeRepeatedBytes);jspb.BinaryWriter.prototype.writeRepeatedMessage=function($,ee,et){if(null!=ee)for(var en=0;en<ee.length;en++){var ei=this.beginDelimited_($);et(ee[en],this);this.endDelimited_(ei)}};goog.exportProperty(jspb.BinaryWriter.prototype,"writeRepeatedMessage",jspb.BinaryWriter.prototype.writeRepeatedMessage);jspb.BinaryWriter.prototype.writeRepeatedGroup=function($,ee,et){if(null!=ee)for(var en=0;en<ee.length;en++)this.writeFieldHeader_($,jspb.BinaryConstants.WireType.START_GROUP),et(ee[en],this),this.writeFieldHeader_($,jspb.BinaryConstants.WireType.END_GROUP)};goog.exportProperty(jspb.BinaryWriter.prototype,"writeRepeatedGroup",jspb.BinaryWriter.prototype.writeRepeatedGroup);jspb.BinaryWriter.prototype.writeRepeatedFixedHash64=function($,ee){if(null!=ee)for(var et=0;et<ee.length;et++)this.writeFixedHash64($,ee[et])};jspb.BinaryWriter.prototype.writeRepeatedVarintHash64=function($,ee){if(null!=ee)for(var et=0;et<ee.length;et++)this.writeVarintHash64($,ee[et])};jspb.BinaryWriter.prototype.writePackedInt32=function($,ee){if(null!=ee&&ee.length){$=this.beginDelimited_($);for(var et=0;et<ee.length;et++)this.encoder_.writeSignedVarint32(ee[et]);this.endDelimited_($)}};goog.exportProperty(jspb.BinaryWriter.prototype,"writePackedInt32",jspb.BinaryWriter.prototype.writePackedInt32);jspb.BinaryWriter.prototype.writePackedInt32String=function($,ee){if(null!=ee&&ee.length){$=this.beginDelimited_($);for(var et=0;et<ee.length;et++)this.encoder_.writeSignedVarint32(parseInt(ee[et],10));this.endDelimited_($)}};jspb.BinaryWriter.prototype.writePackedInt64=function($,ee){if(null!=ee&&ee.length){$=this.beginDelimited_($);for(var et=0;et<ee.length;et++)this.encoder_.writeSignedVarint64(ee[et]);this.endDelimited_($)}};goog.exportProperty(jspb.BinaryWriter.prototype,"writePackedInt64",jspb.BinaryWriter.prototype.writePackedInt64);jspb.BinaryWriter.prototype.writePackedSplitFixed64=function($,ee,et,en){if(null!=ee){$=this.beginDelimited_($);for(var ei=0;ei<ee.length;ei++)this.encoder_.writeSplitFixed64(et(ee[ei]),en(ee[ei]));this.endDelimited_($)}};jspb.BinaryWriter.prototype.writePackedSplitVarint64=function($,ee,et,en){if(null!=ee){$=this.beginDelimited_($);for(var ei=0;ei<ee.length;ei++)this.encoder_.writeSplitVarint64(et(ee[ei]),en(ee[ei]));this.endDelimited_($)}};jspb.BinaryWriter.prototype.writePackedSplitZigzagVarint64=function($,ee,et,en){if(null!=ee){$=this.beginDelimited_($);for(var ei=this.encoder_,eo=0;eo<ee.length;eo++)jspb.utils.toZigzag64(et(ee[eo]),en(ee[eo]),function($,ee){ei.writeSplitVarint64($>>>0,ee>>>0)});this.endDelimited_($)}};jspb.BinaryWriter.prototype.writePackedInt64String=function($,ee){if(null!=ee&&ee.length){$=this.beginDelimited_($);for(var et=0;et<ee.length;et++){var en=jspb.arith.Int64.fromString(ee[et]);this.encoder_.writeSplitVarint64(en.lo,en.hi)}this.endDelimited_($)}};jspb.BinaryWriter.prototype.writePackedUint32=function($,ee){if(null!=ee&&ee.length){$=this.beginDelimited_($);for(var et=0;et<ee.length;et++)this.encoder_.writeUnsignedVarint32(ee[et]);this.endDelimited_($)}};goog.exportProperty(jspb.BinaryWriter.prototype,"writePackedUint32",jspb.BinaryWriter.prototype.writePackedUint32);jspb.BinaryWriter.prototype.writePackedUint32String=function($,ee){if(null!=ee&&ee.length){$=this.beginDelimited_($);for(var et=0;et<ee.length;et++)this.encoder_.writeUnsignedVarint32(parseInt(ee[et],10));this.endDelimited_($)}};jspb.BinaryWriter.prototype.writePackedUint64=function($,ee){if(null!=ee&&ee.length){$=this.beginDelimited_($);for(var et=0;et<ee.length;et++)this.encoder_.writeUnsignedVarint64(ee[et]);this.endDelimited_($)}};goog.exportProperty(jspb.BinaryWriter.prototype,"writePackedUint64",jspb.BinaryWriter.prototype.writePackedUint64);jspb.BinaryWriter.prototype.writePackedUint64String=function($,ee){if(null!=ee&&ee.length){$=this.beginDelimited_($);for(var et=0;et<ee.length;et++){var en=jspb.arith.UInt64.fromString(ee[et]);this.encoder_.writeSplitVarint64(en.lo,en.hi)}this.endDelimited_($)}};jspb.BinaryWriter.prototype.writePackedSint32=function($,ee){if(null!=ee&&ee.length){$=this.beginDelimited_($);for(var et=0;et<ee.length;et++)this.encoder_.writeZigzagVarint32(ee[et]);this.endDelimited_($)}};goog.exportProperty(jspb.BinaryWriter.prototype,"writePackedSint32",jspb.BinaryWriter.prototype.writePackedSint32);jspb.BinaryWriter.prototype.writePackedSint64=function($,ee){if(null!=ee&&ee.length){$=this.beginDelimited_($);for(var et=0;et<ee.length;et++)this.encoder_.writeZigzagVarint64(ee[et]);this.endDelimited_($)}};goog.exportProperty(jspb.BinaryWriter.prototype,"writePackedSint64",jspb.BinaryWriter.prototype.writePackedSint64);jspb.BinaryWriter.prototype.writePackedSint64String=function($,ee){if(null!=ee&&ee.length){$=this.beginDelimited_($);for(var et=0;et<ee.length;et++)this.encoder_.writeZigzagVarintHash64(jspb.utils.decimalStringToHash64(ee[et]));this.endDelimited_($)}};jspb.BinaryWriter.prototype.writePackedSintHash64=function($,ee){if(null!=ee&&ee.length){$=this.beginDelimited_($);for(var et=0;et<ee.length;et++)this.encoder_.writeZigzagVarintHash64(ee[et]);this.endDelimited_($)}};jspb.BinaryWriter.prototype.writePackedFixed32=function($,ee){if(null!=ee&&ee.length)for(this.writeFieldHeader_($,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(4*ee.length),$=0;$<ee.length;$++)this.encoder_.writeUint32(ee[$])};goog.exportProperty(jspb.BinaryWriter.prototype,"writePackedFixed32",jspb.BinaryWriter.prototype.writePackedFixed32);jspb.BinaryWriter.prototype.writePackedFixed64=function($,ee){if(null!=ee&&ee.length)for(this.writeFieldHeader_($,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*ee.length),$=0;$<ee.length;$++)this.encoder_.writeUint64(ee[$])};goog.exportProperty(jspb.BinaryWriter.prototype,"writePackedFixed64",jspb.BinaryWriter.prototype.writePackedFixed64);jspb.BinaryWriter.prototype.writePackedFixed64String=function($,ee){if(null!=ee&&ee.length)for(this.writeFieldHeader_($,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*ee.length),$=0;$<ee.length;$++){var et=jspb.arith.UInt64.fromString(ee[$]);this.encoder_.writeSplitFixed64(et.lo,et.hi)}};jspb.BinaryWriter.prototype.writePackedSfixed32=function($,ee){if(null!=ee&&ee.length)for(this.writeFieldHeader_($,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(4*ee.length),$=0;$<ee.length;$++)this.encoder_.writeInt32(ee[$])};goog.exportProperty(jspb.BinaryWriter.prototype,"writePackedSfixed32",jspb.BinaryWriter.prototype.writePackedSfixed32);jspb.BinaryWriter.prototype.writePackedSfixed64=function($,ee){if(null!=ee&&ee.length)for(this.writeFieldHeader_($,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*ee.length),$=0;$<ee.length;$++)this.encoder_.writeInt64(ee[$])};goog.exportProperty(jspb.BinaryWriter.prototype,"writePackedSfixed64",jspb.BinaryWriter.prototype.writePackedSfixed64);jspb.BinaryWriter.prototype.writePackedSfixed64String=function($,ee){if(null!=ee&&ee.length)for(this.writeFieldHeader_($,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*ee.length),$=0;$<ee.length;$++)this.encoder_.writeInt64String(ee[$])};jspb.BinaryWriter.prototype.writePackedFloat=function($,ee){if(null!=ee&&ee.length)for(this.writeFieldHeader_($,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(4*ee.length),$=0;$<ee.length;$++)this.encoder_.writeFloat(ee[$])};goog.exportProperty(jspb.BinaryWriter.prototype,"writePackedFloat",jspb.BinaryWriter.prototype.writePackedFloat);jspb.BinaryWriter.prototype.writePackedDouble=function($,ee){if(null!=ee&&ee.length)for(this.writeFieldHeader_($,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*ee.length),$=0;$<ee.length;$++)this.encoder_.writeDouble(ee[$])};goog.exportProperty(jspb.BinaryWriter.prototype,"writePackedDouble",jspb.BinaryWriter.prototype.writePackedDouble);jspb.BinaryWriter.prototype.writePackedBool=function($,ee){if(null!=ee&&ee.length)for(this.writeFieldHeader_($,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(ee.length),$=0;$<ee.length;$++)this.encoder_.writeBool(ee[$])};goog.exportProperty(jspb.BinaryWriter.prototype,"writePackedBool",jspb.BinaryWriter.prototype.writePackedBool);jspb.BinaryWriter.prototype.writePackedEnum=function($,ee){if(null!=ee&&ee.length){$=this.beginDelimited_($);for(var et=0;et<ee.length;et++)this.encoder_.writeEnum(ee[et]);this.endDelimited_($)}};goog.exportProperty(jspb.BinaryWriter.prototype,"writePackedEnum",jspb.BinaryWriter.prototype.writePackedEnum);jspb.BinaryWriter.prototype.writePackedFixedHash64=function($,ee){if(null!=ee&&ee.length)for(this.writeFieldHeader_($,jspb.BinaryConstants.WireType.DELIMITED),this.encoder_.writeUnsignedVarint32(8*ee.length),$=0;$<ee.length;$++)this.encoder_.writeFixedHash64(ee[$])};jspb.BinaryWriter.prototype.writePackedVarintHash64=function($,ee){if(null!=ee&&ee.length){$=this.beginDelimited_($);for(var et=0;et<ee.length;et++)this.encoder_.writeVarintHash64(ee[et]);this.endDelimited_($)}};jspb.Map=function($,ee){this.arr_=$;this.valueCtor_=ee;this.map_={};this.arrClean=!0;0<this.arr_.length&&this.loadFromArray_()};goog.exportSymbol("jspb.Map",jspb.Map);jspb.Map.prototype.loadFromArray_=function(){for(var $=0;$<this.arr_.length;$++){var ee=this.arr_[$],et=ee[0];this.map_[et.toString()]=new jspb.Map.Entry_(et,ee[1])}this.arrClean=!0};jspb.Map.prototype.toArray=function(){if(this.arrClean){if(this.valueCtor_){var $=this.map_,ee;for(ee in $)if(Object.prototype.hasOwnProperty.call($,ee)){var et=$[ee].valueWrapper;et&&et.toArray()}}}else{this.arr_.length=0;$=this.stringKeys_();$.sort();for(ee=0;ee<$.length;ee++){var en=this.map_[$[ee]];(et=en.valueWrapper)&&et.toArray();this.arr_.push([en.key,en.value])}this.arrClean=!0}return this.arr_};goog.exportProperty(jspb.Map.prototype,"toArray",jspb.Map.prototype.toArray);jspb.Map.prototype.toObject=function($,ee){for(var et=this.toArray(),en=[],ei=0;ei<et.length;ei++){var eo=this.map_[et[ei][0].toString()];this.wrapEntry_(eo);var es=eo.valueWrapper;es?(jspb.asserts.assert(ee),en.push([eo.key,ee($,es)])):en.push([eo.key,eo.value])}return en};goog.exportProperty(jspb.Map.prototype,"toObject",jspb.Map.prototype.toObject);jspb.Map.fromObject=function($,ee,et){ee=new jspb.Map([],ee);for(var en=0;en<$.length;en++){var ei=$[en][0],eo=et($[en][1]);ee.set(ei,eo)}return ee};goog.exportProperty(jspb.Map,"fromObject",jspb.Map.fromObject);jspb.Map.ArrayIteratorIterable_=function($){this.idx_=0;this.arr_=$};jspb.Map.ArrayIteratorIterable_.prototype.next=function(){return this.idx_<this.arr_.length?{done:!1,value:this.arr_[this.idx_++]}:{done:!0,value:void 0}};"undefined"!=typeof Symbol&&(jspb.Map.ArrayIteratorIterable_.prototype[Symbol.iterator]=function(){return this});jspb.Map.prototype.getLength=function(){return this.stringKeys_().length};goog.exportProperty(jspb.Map.prototype,"getLength",jspb.Map.prototype.getLength);jspb.Map.prototype.clear=function(){this.map_={};this.arrClean=!1};goog.exportProperty(jspb.Map.prototype,"clear",jspb.Map.prototype.clear);jspb.Map.prototype.del=function($){$=$.toString();var ee=this.map_.hasOwnProperty($);delete this.map_[$];this.arrClean=!1;return ee};goog.exportProperty(jspb.Map.prototype,"del",jspb.Map.prototype.del);jspb.Map.prototype.getEntryList=function(){var $=[],ee=this.stringKeys_();ee.sort();for(var et=0;et<ee.length;et++){var en=this.map_[ee[et]];$.push([en.key,en.value])}return $};goog.exportProperty(jspb.Map.prototype,"getEntryList",jspb.Map.prototype.getEntryList);jspb.Map.prototype.entries=function(){var $=[],ee=this.stringKeys_();ee.sort();for(var et=0;et<ee.length;et++){var en=this.map_[ee[et]];$.push([en.key,this.wrapEntry_(en)])}return new jspb.Map.ArrayIteratorIterable_($)};goog.exportProperty(jspb.Map.prototype,"entries",jspb.Map.prototype.entries);jspb.Map.prototype.keys=function(){var $=[],ee=this.stringKeys_();ee.sort();for(var et=0;et<ee.length;et++)$.push(this.map_[ee[et]].key);return new jspb.Map.ArrayIteratorIterable_($)};goog.exportProperty(jspb.Map.prototype,"keys",jspb.Map.prototype.keys);jspb.Map.prototype.values=function(){var $=[],ee=this.stringKeys_();ee.sort();for(var et=0;et<ee.length;et++)$.push(this.wrapEntry_(this.map_[ee[et]]));return new jspb.Map.ArrayIteratorIterable_($)};goog.exportProperty(jspb.Map.prototype,"values",jspb.Map.prototype.values);jspb.Map.prototype.forEach=function($,ee){var et=this.stringKeys_();et.sort();for(var en=0;en<et.length;en++){var ei=this.map_[et[en]];$.call(ee,this.wrapEntry_(ei),ei.key,this)}};goog.exportProperty(jspb.Map.prototype,"forEach",jspb.Map.prototype.forEach);jspb.Map.prototype.set=function($,ee){var et=new jspb.Map.Entry_($);this.valueCtor_?(et.valueWrapper=ee,et.value=ee.toArray()):et.value=ee;this.map_[$.toString()]=et;this.arrClean=!1;return this};goog.exportProperty(jspb.Map.prototype,"set",jspb.Map.prototype.set);jspb.Map.prototype.wrapEntry_=function($){return this.valueCtor_?($.valueWrapper||($.valueWrapper=new this.valueCtor_($.value)),$.valueWrapper):$.value};jspb.Map.prototype.get=function($){if($=this.map_[$.toString()])return this.wrapEntry_($)};goog.exportProperty(jspb.Map.prototype,"get",jspb.Map.prototype.get);jspb.Map.prototype.has=function($){return $.toString() in this.map_};goog.exportProperty(jspb.Map.prototype,"has",jspb.Map.prototype.has);jspb.Map.prototype.serializeBinary=function($,ee,et,en,ei){var eo=this.stringKeys_();eo.sort();for(var es=0;es<eo.length;es++){var eu=this.map_[eo[es]];ee.beginSubMessage($);et.call(ee,1,eu.key);this.valueCtor_?en.call(ee,2,this.wrapEntry_(eu),ei):en.call(ee,2,eu.value);ee.endSubMessage()}};goog.exportProperty(jspb.Map.prototype,"serializeBinary",jspb.Map.prototype.serializeBinary);jspb.Map.deserializeBinary=function($,ee,et,en,ei,eo,es){for(;ee.nextField()&&!ee.isEndGroup();){var eu=ee.getFieldNumber();1==eu?eo=et.call(ee):2==eu&&($.valueCtor_?(jspb.asserts.assert(ei),es||(es=new $.valueCtor_),en.call(ee,es,ei)):es=en.call(ee))}jspb.asserts.assert(void 0!=eo);jspb.asserts.assert(void 0!=es);$.set(eo,es)};goog.exportProperty(jspb.Map,"deserializeBinary",jspb.Map.deserializeBinary);jspb.Map.prototype.stringKeys_=function(){var $=this.map_,ee=[],et;for(et in $)Object.prototype.hasOwnProperty.call($,et)&&ee.push(et);return ee};jspb.Map.Entry_=function($,ee){this.key=$;this.value=ee;this.valueWrapper=void 0};jspb.ExtensionFieldInfo=function($,ee,et,en,ei){this.fieldIndex=$;this.fieldName=ee;this.ctor=et;this.toObjectFn=en;this.isRepeated=ei};goog.exportSymbol("jspb.ExtensionFieldInfo",jspb.ExtensionFieldInfo);jspb.ExtensionFieldBinaryInfo=function($,ee,et,en,ei,eo){this.fieldInfo=$;this.binaryReaderFn=ee;this.binaryWriterFn=et;this.binaryMessageSerializeFn=en;this.binaryMessageDeserializeFn=ei;this.isPacked=eo};goog.exportSymbol("jspb.ExtensionFieldBinaryInfo",jspb.ExtensionFieldBinaryInfo);jspb.ExtensionFieldInfo.prototype.isMessageType=function(){return!!this.ctor};goog.exportProperty(jspb.ExtensionFieldInfo.prototype,"isMessageType",jspb.ExtensionFieldInfo.prototype.isMessageType);jspb.Message=function(){};goog.exportSymbol("jspb.Message",jspb.Message);jspb.Message.GENERATE_TO_OBJECT=!0;goog.exportProperty(jspb.Message,"GENERATE_TO_OBJECT",jspb.Message.GENERATE_TO_OBJECT);jspb.Message.GENERATE_FROM_OBJECT=!goog.DISALLOW_TEST_ONLY_CODE;goog.exportProperty(jspb.Message,"GENERATE_FROM_OBJECT",jspb.Message.GENERATE_FROM_OBJECT);jspb.Message.GENERATE_TO_STRING=!0;jspb.Message.ASSUME_LOCAL_ARRAYS=!1;jspb.Message.SERIALIZE_EMPTY_TRAILING_FIELDS=!0;jspb.Message.SUPPORTS_UINT8ARRAY_="function"==typeof Uint8Array;jspb.Message.prototype.getJsPbMessageId=function(){return this.messageId_};goog.exportProperty(jspb.Message.prototype,"getJsPbMessageId",jspb.Message.prototype.getJsPbMessageId);jspb.Message.getIndex_=function($,ee){return ee+$.arrayIndexOffset_};jspb.Message.hiddenES6Property_=function(){};jspb.Message.getFieldNumber_=function($,ee){return ee-$.arrayIndexOffset_};jspb.Message.initialize=function($,ee,et,en,ei,eo){$.wrappers_=null;ee||(ee=et?[et]:[]);$.messageId_=et?String(et):void 0;$.arrayIndexOffset_=0===et?-1:0;$.array=ee;jspb.Message.initPivotAndExtensionObject_($,en);$.convertedPrimitiveFields_={};jspb.Message.SERIALIZE_EMPTY_TRAILING_FIELDS||($.repeatedFields=ei);if(ei)for(ee=0;ee<ei.length;ee++)et=ei[ee],et<$.pivot_?(et=jspb.Message.getIndex_($,et),$.array[et]=$.array[et]||jspb.Message.EMPTY_LIST_SENTINEL_):(jspb.Message.maybeInitEmptyExtensionObject_($),$.extensionObject_[et]=$.extensionObject_[et]||jspb.Message.EMPTY_LIST_SENTINEL_);if(eo&&eo.length)for(ee=0;ee<eo.length;ee++)jspb.Message.computeOneofCase($,eo[ee])};goog.exportProperty(jspb.Message,"initialize",jspb.Message.initialize);jspb.Message.EMPTY_LIST_SENTINEL_=goog.DEBUG&&Object.freeze?Object.freeze([]):[];jspb.Message.isArray_=function($){return jspb.Message.ASSUME_LOCAL_ARRAYS?$ instanceof Array:Array.isArray($)};jspb.Message.isExtensionObject_=function($){return null!==$&&"object"==typeof $&&!jspb.Message.isArray_($)&&!(jspb.Message.SUPPORTS_UINT8ARRAY_&&$ instanceof Uint8Array)};jspb.Message.initPivotAndExtensionObject_=function($,ee){var et=$.array.length,en=-1;if(et&&(en=et-1,et=$.array[en],jspb.Message.isExtensionObject_(et))){$.pivot_=jspb.Message.getFieldNumber_($,en);$.extensionObject_=et;return}-1<ee?($.pivot_=Math.max(ee,jspb.Message.getFieldNumber_($,en+1)),$.extensionObject_=null):$.pivot_=Number.MAX_VALUE};jspb.Message.maybeInitEmptyExtensionObject_=function($){var ee=jspb.Message.getIndex_($,$.pivot_);$.array[ee]||($.extensionObject_=$.array[ee]={})};jspb.Message.toObjectList=function($,ee,et){for(var en=[],ei=0;ei<$.length;ei++)en[ei]=ee.call($[ei],et,$[ei]);return en};goog.exportProperty(jspb.Message,"toObjectList",jspb.Message.toObjectList);jspb.Message.toObjectExtension=function($,ee,et,en,ei){for(var eo in et){var es=et[eo],eu=en.call($,es);if(null!=eu){for(var el in es.fieldName)if(es.fieldName.hasOwnProperty(el))break;ee[el]=es.toObjectFn?es.isRepeated?jspb.Message.toObjectList(eu,es.toObjectFn,ei):es.toObjectFn(ei,eu):eu}}};goog.exportProperty(jspb.Message,"toObjectExtension",jspb.Message.toObjectExtension);jspb.Message.serializeBinaryExtensions=function($,ee,et,en){for(var ei in et){var eo=et[ei],es=eo.fieldInfo;if(!eo.binaryWriterFn)throw Error("Message extension present that was generated without binary serialization support");var eu=en.call($,es);if(null!=eu)if(es.isMessageType())if(eo.binaryMessageSerializeFn)eo.binaryWriterFn.call(ee,es.fieldIndex,eu,eo.binaryMessageSerializeFn);else throw Error("Message extension present holding submessage without binary support enabled, and message is being serialized to binary format");else eo.binaryWriterFn.call(ee,es.fieldIndex,eu)}};goog.exportProperty(jspb.Message,"serializeBinaryExtensions",jspb.Message.serializeBinaryExtensions);jspb.Message.readBinaryExtension=function($,ee,et,en,ei){var eo=et[ee.getFieldNumber()];if(eo){et=eo.fieldInfo;if(!eo.binaryReaderFn)throw Error("Deserializing extension whose generated code does not support binary format");if(et.isMessageType()){var es=new et.ctor;eo.binaryReaderFn.call(ee,es,eo.binaryMessageDeserializeFn)}else es=eo.binaryReaderFn.call(ee);et.isRepeated&&!eo.isPacked?(ee=en.call($,et))?ee.push(es):ei.call($,et,[es]):ei.call($,et,es)}else ee.skipField()};goog.exportProperty(jspb.Message,"readBinaryExtension",jspb.Message.readBinaryExtension);jspb.Message.getField=function($,ee){if(ee<$.pivot_){ee=jspb.Message.getIndex_($,ee);var et=$.array[ee];return et===jspb.Message.EMPTY_LIST_SENTINEL_?$.array[ee]=[]:et}if($.extensionObject_)return et=$.extensionObject_[ee],et===jspb.Message.EMPTY_LIST_SENTINEL_?$.extensionObject_[ee]=[]:et};goog.exportProperty(jspb.Message,"getField",jspb.Message.getField);jspb.Message.getRepeatedField=function($,ee){return jspb.Message.getField($,ee)};goog.exportProperty(jspb.Message,"getRepeatedField",jspb.Message.getRepeatedField);jspb.Message.getOptionalFloatingPointField=function($,ee){$=jspb.Message.getField($,ee);return null==$?$:+$};goog.exportProperty(jspb.Message,"getOptionalFloatingPointField",jspb.Message.getOptionalFloatingPointField);jspb.Message.getBooleanField=function($,ee){$=jspb.Message.getField($,ee);return null==$?$:!!$};goog.exportProperty(jspb.Message,"getBooleanField",jspb.Message.getBooleanField);jspb.Message.getRepeatedFloatingPointField=function($,ee){var et=jspb.Message.getRepeatedField($,ee);$.convertedPrimitiveFields_||($.convertedPrimitiveFields_={});if(!$.convertedPrimitiveFields_[ee]){for(var en=0;en<et.length;en++)et[en]=+et[en];$.convertedPrimitiveFields_[ee]=!0}return et};goog.exportProperty(jspb.Message,"getRepeatedFloatingPointField",jspb.Message.getRepeatedFloatingPointField);jspb.Message.getRepeatedBooleanField=function($,ee){var et=jspb.Message.getRepeatedField($,ee);$.convertedPrimitiveFields_||($.convertedPrimitiveFields_={});if(!$.convertedPrimitiveFields_[ee]){for(var en=0;en<et.length;en++)et[en]=!!et[en];$.convertedPrimitiveFields_[ee]=!0}return et};goog.exportProperty(jspb.Message,"getRepeatedBooleanField",jspb.Message.getRepeatedBooleanField);jspb.Message.bytesAsB64=function($){if(null==$||"string"===typeof $)return $;if(jspb.Message.SUPPORTS_UINT8ARRAY_&&$ instanceof Uint8Array)return goog.crypt.base64.encodeByteArray($);jspb.asserts.fail("Cannot coerce to b64 string: "+goog.typeOf($));return null};goog.exportProperty(jspb.Message,"bytesAsB64",jspb.Message.bytesAsB64);jspb.Message.bytesAsU8=function($){if(null==$||$ instanceof Uint8Array)return $;if("string"===typeof $)return goog.crypt.base64.decodeStringToUint8Array($);jspb.asserts.fail("Cannot coerce to Uint8Array: "+goog.typeOf($));return null};goog.exportProperty(jspb.Message,"bytesAsU8",jspb.Message.bytesAsU8);jspb.Message.bytesListAsB64=function($){jspb.Message.assertConsistentTypes_($);return $.length&&"string"!==typeof $[0]?goog.array.map($,jspb.Message.bytesAsB64):$};goog.exportProperty(jspb.Message,"bytesListAsB64",jspb.Message.bytesListAsB64);jspb.Message.bytesListAsU8=function($){jspb.Message.assertConsistentTypes_($);return!$.length||$[0]instanceof Uint8Array?$:goog.array.map($,jspb.Message.bytesAsU8)};goog.exportProperty(jspb.Message,"bytesListAsU8",jspb.Message.bytesListAsU8);jspb.Message.assertConsistentTypes_=function($){if(goog.DEBUG&&$&&1<$.length){var ee=goog.typeOf($[0]);goog.array.forEach($,function($){goog.typeOf($)!=ee&&jspb.asserts.fail("Inconsistent type in JSPB repeated field array. Got "+goog.typeOf($)+" expected "+ee)})}};jspb.Message.getFieldWithDefault=function($,ee,et){$=jspb.Message.getField($,ee);return null==$?et:$};goog.exportProperty(jspb.Message,"getFieldWithDefault",jspb.Message.getFieldWithDefault);jspb.Message.getBooleanFieldWithDefault=function($,ee,et){$=jspb.Message.getBooleanField($,ee);return null==$?et:$};goog.exportProperty(jspb.Message,"getBooleanFieldWithDefault",jspb.Message.getBooleanFieldWithDefault);jspb.Message.getFloatingPointFieldWithDefault=function($,ee,et){$=jspb.Message.getOptionalFloatingPointField($,ee);return null==$?et:$};goog.exportProperty(jspb.Message,"getFloatingPointFieldWithDefault",jspb.Message.getFloatingPointFieldWithDefault);jspb.Message.getFieldProto3=jspb.Message.getFieldWithDefault;goog.exportProperty(jspb.Message,"getFieldProto3",jspb.Message.getFieldProto3);jspb.Message.getMapField=function($,ee,et,en){$.wrappers_||($.wrappers_={});if(ee in $.wrappers_)return $.wrappers_[ee];var ei=jspb.Message.getField($,ee);if(!ei){if(et)return;ei=[];jspb.Message.setField($,ee,ei)}return $.wrappers_[ee]=new jspb.Map(ei,en)};goog.exportProperty(jspb.Message,"getMapField",jspb.Message.getMapField);jspb.Message.setField=function($,ee,et){jspb.asserts.assertInstanceof($,jspb.Message);ee<$.pivot_?$.array[jspb.Message.getIndex_($,ee)]=et:(jspb.Message.maybeInitEmptyExtensionObject_($),$.extensionObject_[ee]=et);return $};goog.exportProperty(jspb.Message,"setField",jspb.Message.setField);jspb.Message.setProto3IntField=function($,ee,et){return jspb.Message.setFieldIgnoringDefault_($,ee,et,0)};goog.exportProperty(jspb.Message,"setProto3IntField",jspb.Message.setProto3IntField);jspb.Message.setProto3FloatField=function($,ee,et){return jspb.Message.setFieldIgnoringDefault_($,ee,et,0)};goog.exportProperty(jspb.Message,"setProto3FloatField",jspb.Message.setProto3FloatField);jspb.Message.setProto3BooleanField=function($,ee,et){return jspb.Message.setFieldIgnoringDefault_($,ee,et,!1)};goog.exportProperty(jspb.Message,"setProto3BooleanField",jspb.Message.setProto3BooleanField);jspb.Message.setProto3StringField=function($,ee,et){return jspb.Message.setFieldIgnoringDefault_($,ee,et,"")};goog.exportProperty(jspb.Message,"setProto3StringField",jspb.Message.setProto3StringField);jspb.Message.setProto3BytesField=function($,ee,et){return jspb.Message.setFieldIgnoringDefault_($,ee,et,"")};goog.exportProperty(jspb.Message,"setProto3BytesField",jspb.Message.setProto3BytesField);jspb.Message.setProto3EnumField=function($,ee,et){return jspb.Message.setFieldIgnoringDefault_($,ee,et,0)};goog.exportProperty(jspb.Message,"setProto3EnumField",jspb.Message.setProto3EnumField);jspb.Message.setProto3StringIntField=function($,ee,et){return jspb.Message.setFieldIgnoringDefault_($,ee,et,"0")};goog.exportProperty(jspb.Message,"setProto3StringIntField",jspb.Message.setProto3StringIntField);jspb.Message.setFieldIgnoringDefault_=function($,ee,et,en){jspb.asserts.assertInstanceof($,jspb.Message);et!==en?jspb.Message.setField($,ee,et):ee<$.pivot_?$.array[jspb.Message.getIndex_($,ee)]=null:(jspb.Message.maybeInitEmptyExtensionObject_($),delete $.extensionObject_[ee]);return $};jspb.Message.addToRepeatedField=function($,ee,et,en){jspb.asserts.assertInstanceof($,jspb.Message);ee=jspb.Message.getRepeatedField($,ee);void 0!=en?ee.splice(en,0,et):ee.push(et);return $};goog.exportProperty(jspb.Message,"addToRepeatedField",jspb.Message.addToRepeatedField);jspb.Message.setOneofField=function($,ee,et,en){jspb.asserts.assertInstanceof($,jspb.Message);(et=jspb.Message.computeOneofCase($,et))&&et!==ee&&void 0!==en&&($.wrappers_&&et in $.wrappers_&&($.wrappers_[et]=void 0),jspb.Message.setField($,et,void 0));return jspb.Message.setField($,ee,en)};goog.exportProperty(jspb.Message,"setOneofField",jspb.Message.setOneofField);jspb.Message.computeOneofCase=function($,ee){for(var et,en,ei=0;ei<ee.length;ei++){var eo=ee[ei],es=jspb.Message.getField($,eo);null!=es&&(et=eo,en=es,jspb.Message.setField($,eo,void 0))}return et?(jspb.Message.setField($,et,en),et):0};goog.exportProperty(jspb.Message,"computeOneofCase",jspb.Message.computeOneofCase);jspb.Message.getWrapperField=function($,ee,et,en){$.wrappers_||($.wrappers_={});if(!$.wrappers_[et]){var ei=jspb.Message.getField($,et);if(en||ei)$.wrappers_[et]=new ee(ei)}return $.wrappers_[et]};goog.exportProperty(jspb.Message,"getWrapperField",jspb.Message.getWrapperField);jspb.Message.getRepeatedWrapperField=function($,ee,et){jspb.Message.wrapRepeatedField_($,ee,et);ee=$.wrappers_[et];ee==jspb.Message.EMPTY_LIST_SENTINEL_&&(ee=$.wrappers_[et]=[]);return ee};goog.exportProperty(jspb.Message,"getRepeatedWrapperField",jspb.Message.getRepeatedWrapperField);jspb.Message.wrapRepeatedField_=function($,ee,et){$.wrappers_||($.wrappers_={});if(!$.wrappers_[et]){for(var en=jspb.Message.getRepeatedField($,et),ei=[],eo=0;eo<en.length;eo++)ei[eo]=new ee(en[eo]);$.wrappers_[et]=ei}};jspb.Message.setWrapperField=function($,ee,et){jspb.asserts.assertInstanceof($,jspb.Message);$.wrappers_||($.wrappers_={});var en=et?et.toArray():et;$.wrappers_[ee]=et;return jspb.Message.setField($,ee,en)};goog.exportProperty(jspb.Message,"setWrapperField",jspb.Message.setWrapperField);jspb.Message.setOneofWrapperField=function($,ee,et,en){jspb.asserts.assertInstanceof($,jspb.Message);$.wrappers_||($.wrappers_={});var ei=en?en.toArray():en;$.wrappers_[ee]=en;return jspb.Message.setOneofField($,ee,et,ei)};goog.exportProperty(jspb.Message,"setOneofWrapperField",jspb.Message.setOneofWrapperField);jspb.Message.setRepeatedWrapperField=function($,ee,et){jspb.asserts.assertInstanceof($,jspb.Message);$.wrappers_||($.wrappers_={});et=et||[];for(var en=[],ei=0;ei<et.length;ei++)en[ei]=et[ei].toArray();$.wrappers_[ee]=et;return jspb.Message.setField($,ee,en)};goog.exportProperty(jspb.Message,"setRepeatedWrapperField",jspb.Message.setRepeatedWrapperField);jspb.Message.addToRepeatedWrapperField=function($,ee,et,en,ei){jspb.Message.wrapRepeatedField_($,en,ee);var eo=$.wrappers_[ee];eo||(eo=$.wrappers_[ee]=[]);et=et?et:new en;$=jspb.Message.getRepeatedField($,ee);void 0!=ei?(eo.splice(ei,0,et),$.splice(ei,0,et.toArray())):(eo.push(et),$.push(et.toArray()));return et};goog.exportProperty(jspb.Message,"addToRepeatedWrapperField",jspb.Message.addToRepeatedWrapperField);jspb.Message.toMap=function($,ee,et,en){for(var ei={},eo=0;eo<$.length;eo++)ei[ee.call($[eo])]=et?et.call($[eo],en,$[eo]):$[eo];return ei};goog.exportProperty(jspb.Message,"toMap",jspb.Message.toMap);jspb.Message.prototype.syncMapFields_=function(){if(this.wrappers_)for(var $ in this.wrappers_){var ee=this.wrappers_[$];if(Array.isArray(ee))for(var et=0;et<ee.length;et++)ee[et]&&ee[et].toArray();else ee&&ee.toArray()}};jspb.Message.prototype.toArray=function(){this.syncMapFields_();return this.array};goog.exportProperty(jspb.Message.prototype,"toArray",jspb.Message.prototype.toArray);jspb.Message.GENERATE_TO_STRING&&(jspb.Message.prototype.toString=function(){this.syncMapFields_();return this.array.toString()});jspb.Message.prototype.getExtension=function($){if(this.extensionObject_){this.wrappers_||(this.wrappers_={});var ee=$.fieldIndex;if($.isRepeated){if($.isMessageType())return this.wrappers_[ee]||(this.wrappers_[ee]=goog.array.map(this.extensionObject_[ee]||[],function(ee){return new $.ctor(ee)})),this.wrappers_[ee]}else if($.isMessageType())return!this.wrappers_[ee]&&this.extensionObject_[ee]&&(this.wrappers_[ee]=new $.ctor(this.extensionObject_[ee])),this.wrappers_[ee];return this.extensionObject_[ee]}};goog.exportProperty(jspb.Message.prototype,"getExtension",jspb.Message.prototype.getExtension);jspb.Message.prototype.setExtension=function($,ee){this.wrappers_||(this.wrappers_={});jspb.Message.maybeInitEmptyExtensionObject_(this);var et=$.fieldIndex;$.isRepeated?(ee=ee||[],$.isMessageType()?(this.wrappers_[et]=ee,this.extensionObject_[et]=goog.array.map(ee,function($){return $.toArray()})):this.extensionObject_[et]=ee):$.isMessageType()?(this.wrappers_[et]=ee,this.extensionObject_[et]=ee?ee.toArray():ee):this.extensionObject_[et]=ee;return this};goog.exportProperty(jspb.Message.prototype,"setExtension",jspb.Message.prototype.setExtension);jspb.Message.difference=function($,ee){if(!($ instanceof ee.constructor))throw Error("Messages have different types.");var et=$.toArray();ee=ee.toArray();var en=[],ei=0,eo=et.length>ee.length?et.length:ee.length;$.getJsPbMessageId()&&(en[0]=$.getJsPbMessageId(),ei=1);for(;ei<eo;ei++)jspb.Message.compareFields(et[ei],ee[ei])||(en[ei]=ee[ei]);return new $.constructor(en)};goog.exportProperty(jspb.Message,"difference",jspb.Message.difference);jspb.Message.equals=function($,ee){return $==ee||!(!$||!ee)&&$ instanceof ee.constructor&&jspb.Message.compareFields($.toArray(),ee.toArray())};goog.exportProperty(jspb.Message,"equals",jspb.Message.equals);jspb.Message.compareExtensions=function($,ee){$=$||{};ee=ee||{};var et={},en;for(en in $)et[en]=0;for(en in ee)et[en]=0;for(en in et)if(!jspb.Message.compareFields($[en],ee[en]))return!1;return!0};goog.exportProperty(jspb.Message,"compareExtensions",jspb.Message.compareExtensions);jspb.Message.compareFields=function($,ee){if($==ee)return!0;if(!goog.isObject($)||!goog.isObject(ee))return"number"===typeof $&&isNaN($)||"number"===typeof ee&&isNaN(ee)?String($)==String(ee):!1;if($.constructor!=ee.constructor)return!1;if(jspb.Message.SUPPORTS_UINT8ARRAY_&&$.constructor===Uint8Array){if($.length!=ee.length)return!1;for(var et=0;et<$.length;et++)if($[et]!=ee[et])return!1;return!0}if($.constructor===Array){var en=void 0,ei=void 0,eo=Math.max($.length,ee.length);for(et=0;et<eo;et++){var es=$[et],eu=ee[et];es&&es.constructor==Object&&(jspb.asserts.assert(void 0===en),jspb.asserts.assert(et===$.length-1),en=es,es=void 0);eu&&eu.constructor==Object&&(jspb.asserts.assert(void 0===ei),jspb.asserts.assert(et===ee.length-1),ei=eu,eu=void 0);if(!jspb.Message.compareFields(es,eu))return!1}return en||ei?(en=en||{},ei=ei||{},jspb.Message.compareExtensions(en,ei)):!0}if($.constructor===Object)return jspb.Message.compareExtensions($,ee);throw Error("Invalid type in JSPB array")};goog.exportProperty(jspb.Message,"compareFields",jspb.Message.compareFields);jspb.Message.prototype.cloneMessage=function(){return jspb.Message.cloneMessage(this)};goog.exportProperty(jspb.Message.prototype,"cloneMessage",jspb.Message.prototype.cloneMessage);jspb.Message.prototype.clone=function(){return jspb.Message.cloneMessage(this)};goog.exportProperty(jspb.Message.prototype,"clone",jspb.Message.prototype.clone);jspb.Message.clone=function($){return jspb.Message.cloneMessage($)};goog.exportProperty(jspb.Message,"clone",jspb.Message.clone);jspb.Message.cloneMessage=function($){return new $.constructor(jspb.Message.clone_($.toArray()))};jspb.Message.copyInto=function($,ee){jspb.asserts.assertInstanceof($,jspb.Message);jspb.asserts.assertInstanceof(ee,jspb.Message);jspb.asserts.assert($.constructor==ee.constructor,"Copy source and target message should have the same type.");$=jspb.Message.clone($);for(var et=ee.toArray(),en=$.toArray(),ei=et.length=0;ei<en.length;ei++)et[ei]=en[ei];ee.wrappers_=$.wrappers_;ee.extensionObject_=$.extensionObject_};goog.exportProperty(jspb.Message,"copyInto",jspb.Message.copyInto);jspb.Message.clone_=function($){if(Array.isArray($)){for(var ee=Array($.length),et=0;et<$.length;et++){var en=$[et];null!=en&&(ee[et]="object"==typeof en?jspb.Message.clone_(jspb.asserts.assert(en)):en)}return ee}if(jspb.Message.SUPPORTS_UINT8ARRAY_&&$ instanceof Uint8Array)return new Uint8Array($);ee={};for(et in $)en=$[et],null!=en&&(ee[et]="object"==typeof en?jspb.Message.clone_(jspb.asserts.assert(en)):en);return ee};jspb.Message.registerMessageType=function($,ee){ee.messageId=$};goog.exportProperty(jspb.Message,"registerMessageType",jspb.Message.registerMessageType);jspb.Message.messageSetExtensions={};jspb.Message.messageSetExtensionsBinary={};jspb.Export={};true&&(exports.Map=jspb.Map,exports.Message=jspb.Message,exports.BinaryReader=jspb.BinaryReader,exports.BinaryWriter=jspb.BinaryWriter,exports.ExtensionFieldInfo=jspb.ExtensionFieldInfo,exports.ExtensionFieldBinaryInfo=jspb.ExtensionFieldBinaryInfo,exports.exportSymbol=goog.exportSymbol,exports.inherits=goog.inherits,exports.object={extend:goog.object.extend},exports.typeOf=goog.typeOf)},7296:($,ee,et)=>{"use strict";var en=et(210);var ei=en("%Object.getOwnPropertyDescriptor%",true);if(ei){try{ei([],"length")}catch($){ei=null}}$.exports=ei},932:$=>{"use strict";var ee=typeof BigInt!=="undefined"&&BigInt;$.exports=function $(){return typeof ee==="function"&&typeof BigInt==="function"&&typeof ee(42)==="bigint"&&typeof BigInt(42)==="bigint"}},1044:($,ee,et)=>{"use strict";var en=et(210);var ei=en("%Object.defineProperty%",true);var eo=function $(){if(ei){try{ei({},"a",{value:1});return true}catch($){return false}}return false};eo.hasArrayLengthDefineBug=function $(){if(!eo()){return null}try{return ei([],"length",{value:1}).length!==1}catch($){return true}};$.exports=eo},8185:$=>{"use strict";var ee={foo:{}};var et=Object;$.exports=function $(){return({__proto__:ee}).foo===ee.foo&&!(({__proto__:null})instanceof et)}},1405:($,ee,et)=>{"use strict";var en=typeof Symbol!=="undefined"&&Symbol;var ei=et(5419);$.exports=function $(){if(typeof en!=="function"){return false}if(typeof Symbol!=="function"){return false}if(typeof en("foo")!=="symbol"){return false}if(typeof Symbol("bar")!=="symbol"){return false}return ei()}},5419:$=>{"use strict";$.exports=function $(){if(typeof Symbol!=="function"||typeof Object.getOwnPropertySymbols!=="function"){return false}if(typeof Symbol.iterator==="symbol"){return true}var $={};var ee=Symbol("test");var et=Object(ee);if(typeof ee==="string"){return false}if(Object.prototype.toString.call(ee)!=="[object Symbol]"){return false}if(Object.prototype.toString.call(et)!=="[object Symbol]"){return false}var en=42;$[ee]=en;for(ee in $){return false}if(typeof Object.keys==="function"&&Object.keys($).length!==0){return false}if(typeof Object.getOwnPropertyNames==="function"&&Object.getOwnPropertyNames($).length!==0){return false}var ei=Object.getOwnPropertySymbols($);if(ei.length!==1||ei[0]!==ee){return false}if(!Object.prototype.propertyIsEnumerable.call($,ee)){return false}if(typeof Object.getOwnPropertyDescriptor==="function"){var eo=Object.getOwnPropertyDescriptor($,ee);if(eo.value!==en||eo.enumerable!==true){return false}}return true}},6410:($,ee,et)=>{"use strict";var en=et(5419);$.exports=function $(){return en()&&!!Symbol.toStringTag}},7642:($,ee,et)=>{"use strict";var en=et(8612);$.exports=en.call(Function.call,Object.prototype.hasOwnProperty)},645:($,ee)=>{/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ee.read=function($,ee,et,en,ei){var eo,es;var eu=ei*8-en-1;var el=(1<<eu)-1;var ef=el>>1;var ed=-7;var ep=et?ei-1:0;var eh=et?-1:1;var ey=$[ee+ep];ep+=eh;eo=ey&(1<<-ed)-1;ey>>=-ed;ed+=eu;for(;ed>0;eo=eo*256+$[ee+ep],ep+=eh,ed-=8){}es=eo&(1<<-ed)-1;eo>>=-ed;ed+=en;for(;ed>0;es=es*256+$[ee+ep],ep+=eh,ed-=8){}if(eo===0){eo=1-ef}else if(eo===el){return es?NaN:(ey?-1:1)*Infinity}else{es=es+Math.pow(2,en);eo=eo-ef}return(ey?-1:1)*es*Math.pow(2,eo-en)};ee.write=function($,ee,et,en,ei,eo){var es,eu,el;var ef=eo*8-ei-1;var ed=(1<<ef)-1;var ep=ed>>1;var eh=ei===23?Math.pow(2,-24)-Math.pow(2,-77):0;var ey=en?0:eo-1;var eg=en?1:-1;var em=ee<0||ee===0&&1/ee<0?1:0;ee=Math.abs(ee);if(isNaN(ee)||ee===Infinity){eu=isNaN(ee)?1:0;es=ed}else{es=Math.floor(Math.log(ee)/Math.LN2);if(ee*(el=Math.pow(2,-es))<1){es--;el*=2}if(es+ep>=1){ee+=eh/el}else{ee+=eh*Math.pow(2,1-ep)}if(ee*el>=2){es++;el/=2}if(es+ep>=ed){eu=0;es=ed}else if(es+ep>=1){eu=(ee*el-1)*Math.pow(2,ei);es=es+ep}else{eu=ee*Math.pow(2,ep-1)*Math.pow(2,ei);es=0}}for(;ei>=8;$[et+ey]=eu&255,ey+=eg,eu/=256,ei-=8){}es=es<<ei|eu;ef+=ei;for(;ef>0;$[et+ey]=es&255,ey+=eg,es/=256,ef-=8){}$[et+ey-eg]|=em*128}},5717:$=>{if(typeof Object.create==="function"){$.exports=function $($,ee){if(ee){$.super_=ee;$.prototype=Object.create(ee.prototype,{constructor:{value:$,enumerable:false,writable:true,configurable:true}})}}}else{$.exports=function $($,ee){if(ee){$.super_=ee;var et=function(){};et.prototype=ee.prototype;$.prototype=new et;$.prototype.constructor=$}}}},9496:($,ee,et)=>{"use strict";var en=et(210);var ei=et(7642);var eo=et(7478)();var es=en("%TypeError%");var eu={assert:function($,ee){if(!$||typeof $!=="object"&&typeof $!=="function"){throw new es("`O` is not an object")}if(typeof ee!=="string"){throw new es("`slot` must be a string")}eo.assert($);if(!eu.has($,ee)){throw new es("`"+ee+"` is not present on `O`")}},get:function($,ee){if(!$||typeof $!=="object"&&typeof $!=="function"){throw new es("`O` is not an object")}if(typeof ee!=="string"){throw new es("`slot` must be a string")}var et=eo.get($);return et&&et["$"+ee]},has:function($,ee){if(!$||typeof $!=="object"&&typeof $!=="function"){throw new es("`O` is not an object")}if(typeof ee!=="string"){throw new es("`slot` must be a string")}var et=eo.get($);return!!et&&ei(et,"$"+ee)},set:function($,ee,et){if(!$||typeof $!=="object"&&typeof $!=="function"){throw new es("`O` is not an object")}if(typeof ee!=="string"){throw new es("`slot` must be a string")}var en=eo.get($);if(!en){en={};eo.set($,en)}en["$"+ee]=et}};if(Object.freeze){Object.freeze(eu)}$.exports=eu},2584:($,ee,et)=>{"use strict";var en=et(6410)();var ei=et(1924);var eo=ei("Object.prototype.toString");var es=function $($){if(en&&$&&typeof $==="object"&&Symbol.toStringTag in $){return false}return eo($)==="[object Arguments]"};var eu=function $($){if(es($)){return true}return $!==null&&typeof $==="object"&&typeof $.length==="number"&&$.length>=0&&eo($)!=="[object Array]"&&eo($.callee)==="[object Function]"};var el=function(){return es(arguments)}();es.isLegacyArguments=eu;$.exports=el?es:eu},635:($,ee,et)=>{"use strict";var en=et(5559);var ei=et(1924);var eo=et(210);var es=et(5692);var eu=eo("ArrayBuffer",true);var el=eo("Float32Array",true);var ef=ei("ArrayBuffer.prototype.byteLength",true);var ed=eu&&!ef&&new eu().slice;var ep=ed&&en(ed);$.exports=ef||ep?function $($){if(!$||typeof $!=="object"){return false}try{if(ef){ef($)}else{ep($,0)}return true}catch($){return false}}:el?function $($){try{return new el($).buffer===$&&!es($)}catch(ee){return typeof $==="object"&&ee.name==="RangeError"}}:function $($){return false}},3376:($,ee,et)=>{"use strict";var en=et(932)();if(en){var ei=BigInt.prototype.valueOf;var eo=function $($){try{ei.call($);return true}catch($){}return false};$.exports=function $($){if($===null||typeof $==="undefined"||typeof $==="boolean"||typeof $==="string"||typeof $==="number"||typeof $==="symbol"||typeof $==="function"){return false}if(typeof $==="bigint"){return true}return eo($)}}else{$.exports=function $($){return false&&0}}},6814:($,ee,et)=>{"use strict";var en=et(1924);var ei=en("Boolean.prototype.toString");var eo=en("Object.prototype.toString");var es=function $($){try{ei($);return true}catch($){return false}};var eu="[object Boolean]";var el=et(6410)();$.exports=function $($){if(typeof $==="boolean"){return true}if($===null||typeof $!=="object"){return false}return el&&Symbol.toStringTag in $?es($):eo($)===eu}},5320:$=>{"use strict";var ee=Function.prototype.toString;var et=typeof Reflect==="object"&&Reflect!==null&&Reflect.apply;var en;var ei;if(typeof et==="function"&&typeof Object.defineProperty==="function"){try{en=Object.defineProperty({},"length",{get:function(){throw ei}});ei={};et(function(){throw 42},null,en)}catch($){if($!==ei){et=null}}}else{et=null}var eo=/^\s*class\b/;var es=function $($){try{var et=ee.call($);return eo.test(et)}catch($){return false}};var eu=function $($){try{if(es($)){return false}ee.call($);return true}catch($){return false}};var el=Object.prototype.toString;var ef="[object Object]";var ed="[object Function]";var ep="[object GeneratorFunction]";var eh="[object HTMLAllCollection]";var ey="[object HTML document.all class]";var eg="[object HTMLCollection]";var em=typeof Symbol==="function"&&!!Symbol.toStringTag;var e_=!(0 in[,]);var ew=function $(){return false};if(typeof document==="object"){var eE=document.all;if(el.call(eE)===el.call(document.all)){ew=function $($){if((e_||!$)&&(typeof $==="undefined"||typeof $==="object")){try{var ee=el.call($);return(ee===eh||ee===ey||ee===eg||ee===ef)&&$("")==null}catch($){}}return false}}}$.exports=et?function $($){if(ew($)){return true}if(!$){return false}if(typeof $!=="function"&&typeof $!=="object"){return false}try{et($,null,en)}catch($){if($!==ei){return false}}return!es($)&&eu($)}:function $($){if(ew($)){return true}if(!$){return false}if(typeof $!=="function"&&typeof $!=="object"){return false}if(em){return eu($)}if(es($)){return false}var ee=el.call($);if(ee!==ed&&ee!==ep&&!/^\[object HTML/.test(ee)){return false}return eu($)}},8923:($,ee,et)=>{"use strict";var en=Date.prototype.getDay;var ei=function $($){try{en.call($);return true}catch($){return false}};var eo=Object.prototype.toString;var es="[object Date]";var eu=et(6410)();$.exports=function $($){if(typeof $!=="object"||$===null){return false}return eu?ei($):eo.call($)===es}},8662:($,ee,et)=>{"use strict";var en=Object.prototype.toString;var ei=Function.prototype.toString;var eo=/^\s*(?:function)?\*/;var es=et(6410)();var eu=Object.getPrototypeOf;var el=function(){if(!es){return false}try{return Function("return function*() {}")()}catch($){}};var ef;$.exports=function $($){if(typeof $!=="function"){return false}if(eo.test(ei.call($))){return true}if(!es){var ee=en.call($);return ee==="[object GeneratorFunction]"}if(!eu){return false}if(typeof ef==="undefined"){var et=el();ef=et?eu(et):false}return eu($)===ef}},8379:$=>{"use strict";var ee=typeof Map==="function"&&Map.prototype?Map:null;var et=typeof Set==="function"&&Set.prototype?Set:null;var en;if(!ee){en=function $($){return false}}var ei=ee?Map.prototype.has:null;var eo=et?Set.prototype.has:null;if(!en&&!ei){en=function $($){return false}}$.exports=en||function $($){if(!$||typeof $!=="object"){return false}try{ei.call($);if(eo){try{eo.call($)}catch($){return true}}return $ instanceof ee}catch($){}return false}},8611:$=>{"use strict";$.exports=function $($){return $!==$}},360:($,ee,et)=>{"use strict";var en=et(5559);var ei=et(4289);var eo=et(8611);var es=et(9415);var eu=et(3194);var el=en(es(),Number);ei(el,{getPolyfill:es,implementation:eo,shim:eu});$.exports=el},9415:($,ee,et)=>{"use strict";var en=et(8611);$.exports=function $(){if(Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")){return Number.isNaN}return en}},3194:($,ee,et)=>{"use strict";var en=et(4289);var ei=et(9415);$.exports=function $(){var $=ei();en(Number,{isNaN:$},{isNaN:function ee(){return Number.isNaN!==$}});return $}},4578:($,ee,et)=>{"use strict";var en=Number.prototype.toString;var ei=function $($){try{en.call($);return true}catch($){return false}};var eo=Object.prototype.toString;var es="[object Number]";var eu=et(6410)();$.exports=function $($){if(typeof $==="number"){return true}if(typeof $!=="object"){return false}return eu?ei($):eo.call($)===es}},8420:($,ee,et)=>{"use strict";var en=et(1924);var ei=et(6410)();var eo;var es;var eu;var el;if(ei){eo=en("Object.prototype.hasOwnProperty");es=en("RegExp.prototype.exec");eu={};var ef=function(){throw eu};el={toString:ef,valueOf:ef};if(typeof Symbol.toPrimitive==="symbol"){el[Symbol.toPrimitive]=ef}}var ed=en("Object.prototype.toString");var ep=Object.getOwnPropertyDescriptor;var eh="[object RegExp]";$.exports=ei?function $($){if(!$||typeof $!=="object"){return false}var ee=ep($,"lastIndex");var et=ee&&eo(ee,"value");if(!et){return false}try{es($,el)}catch($){return $===eu}}:function $($){if(!$||typeof $!=="object"&&typeof $!=="function"){return false}return ed($)===eh}},9572:$=>{"use strict";var ee=typeof Map==="function"&&Map.prototype?Map:null;var et=typeof Set==="function"&&Set.prototype?Set:null;var en;if(!et){en=function $($){return false}}var ei=ee?Map.prototype.has:null;var eo=et?Set.prototype.has:null;if(!en&&!eo){en=function $($){return false}}$.exports=en||function $($){if(!$||typeof $!=="object"){return false}try{eo.call($);if(ei){try{ei.call($)}catch($){return true}}return $ instanceof et}catch($){}return false}},2579:($,ee,et)=>{"use strict";var en=et(1924);var ei=en("SharedArrayBuffer.prototype.byteLength",true);$.exports=ei?function $($){if(!$||typeof $!=="object"){return false}try{ei($);return true}catch($){return false}}:function $($){return false}},9981:($,ee,et)=>{"use strict";var en=String.prototype.valueOf;var ei=function $($){try{en.call($);return true}catch($){return false}};var eo=Object.prototype.toString;var es="[object String]";var eu=et(6410)();$.exports=function $($){if(typeof $==="string"){return true}if(typeof $!=="object"){return false}return eu?ei($):eo.call($)===es}},2636:($,ee,et)=>{"use strict";var en=Object.prototype.toString;var ei=et(1405)();if(ei){var eo=Symbol.prototype.toString;var es=/^Symbol\(.*\)$/;var eu=function $($){if(typeof $.valueOf()!=="symbol"){return false}return es.test(eo.call($))};$.exports=function $($){if(typeof $==="symbol"){return true}if(en.call($)!=="[object Symbol]"){return false}try{return eu($)}catch($){return false}}}else{$.exports=function $($){return false&&0}}},5692:($,ee,et)=>{"use strict";var en=et(4029);var ei=et(3083);var eo=et(1924);var es=eo("Object.prototype.toString");var eu=et(6410)();var el=et(7296);var ef=typeof globalThis==="undefined"?et.g:globalThis;var ed=ei();var ep=eo("Array.prototype.indexOf",true)||function $($,ee){for(var et=0;et<$.length;et+=1){if($[et]===ee){return et}}return-1};var eh=eo("String.prototype.slice");var ey={};var eg=Object.getPrototypeOf;if(eu&&el&&eg){en(ed,function($){var ee=new ef[$];if(Symbol.toStringTag in ee){var et=eg(ee);var en=el(et,Symbol.toStringTag);if(!en){var ei=eg(et);en=el(ei,Symbol.toStringTag)}ey[$]=en.get}})}var em=function $($){var ee=false;en(ey,function(et,en){if(!ee){try{ee=et.call($)===en}catch($){}}});return ee};$.exports=function $($){if(!$||typeof $!=="object"){return false}if(!eu||!(Symbol.toStringTag in $)){var ee=eh(es($),8,-1);return ep(ed,ee)>-1}if(!el){return false}return em($)}},1718:$=>{"use strict";var ee=typeof WeakMap==="function"&&WeakMap.prototype?WeakMap:null;var et=typeof WeakSet==="function"&&WeakSet.prototype?WeakSet:null;var en;if(!ee){en=function $($){return false}}var ei=ee?ee.prototype.has:null;var eo=et?et.prototype.has:null;if(!en&&!ei){en=function $($){return false}}$.exports=en||function $($){if(!$||typeof $!=="object"){return false}try{ei.call($,ei);if(eo){try{eo.call($,eo)}catch($){return true}}return $ instanceof ee}catch($){}return false}},5899:($,ee,et)=>{"use strict";var en=et(210);var ei=et(1924);var eo=en("%WeakSet%",true);var es=ei("WeakSet.prototype.has",true);if(es){var eu=ei("WeakMap.prototype.has",true);$.exports=function $($){if(!$||typeof $!=="object"){return false}try{es($,es);if(eu){try{eu($,eu)}catch($){return true}}return $ instanceof eo}catch($){}return false}}else{$.exports=function $($){return false}}},5826:$=>{var ee={}.toString;$.exports=Array.isArray||function($){return ee.call($)=="[object Array]"}},9593:($,ee,et)=>{"use strict";const en=et(3908);const ei=Symbol("max");const eo=Symbol("length");const es=Symbol("lengthCalculator");const eu=Symbol("allowStale");const el=Symbol("maxAge");const ef=Symbol("dispose");const ed=Symbol("noDisposeOnSet");const ep=Symbol("lruList");const eh=Symbol("cache");const ey=Symbol("updateAgeOnGet");const eg=()=>1;class em{constructor($){if(typeof $==="number")$={max:$};if(!$)$={};if($.max&&(typeof $.max!=="number"||$.max<0))throw new TypeError("max must be a non-negative number");const ee=this[ei]=$.max||Infinity;const et=$.length||eg;this[es]=typeof et!=="function"?eg:et;this[eu]=$.stale||false;if($.maxAge&&typeof $.maxAge!=="number")throw new TypeError("maxAge must be a number");this[el]=$.maxAge||0;this[ef]=$.dispose;this[ed]=$.noDisposeOnSet||false;this[ey]=$.updateAgeOnGet||false;this.reset()}set max($){if(typeof $!=="number"||$<0)throw new TypeError("max must be a non-negative number");this[ei]=$||Infinity;eE(this)}get max(){return this[ei]}set allowStale($){this[eu]=!!$}get allowStale(){return this[eu]}set maxAge($){if(typeof $!=="number")throw new TypeError("maxAge must be a non-negative number");this[el]=$;eE(this)}get maxAge(){return this[el]}set lengthCalculator($){if(typeof $!=="function")$=eg;if($!==this[es]){this[es]=$;this[eo]=0;this[ep].forEach($=>{$.length=this[es]($.value,$.key);this[eo]+=$.length})}eE(this)}get lengthCalculator(){return this[es]}get length(){return this[eo]}get itemCount(){return this[ep].length}rforEach($,ee){ee=ee||this;for(let et=this[ep].tail;et!==null;){const en=et.prev;eO(this,$,et,ee);et=en}}forEach($,ee){ee=ee||this;for(let et=this[ep].head;et!==null;){const en=et.next;eO(this,$,et,ee);et=en}}keys(){return this[ep].toArray().map($=>$.key)}values(){return this[ep].toArray().map($=>$.value)}reset(){if(this[ef]&&this[ep]&&this[ep].length){this[ep].forEach($=>this[ef]($.key,$.value))}this[eh]=new Map;this[ep]=new en;this[eo]=0}dump(){return this[ep].map($=>ew(this,$)?false:{k:$.key,v:$.value,e:$.now+($.maxAge||0)}).toArray().filter($=>$)}dumpLru(){return this[ep]}set($,ee,et){et=et||this[el];if(et&&typeof et!=="number")throw new TypeError("maxAge must be a number");const en=et?Date.now():0;const eu=this[es](ee,$);if(this[eh].has($)){if(eu>this[ei]){eS(this,this[eh].get($));return false}const es=this[eh].get($);const el=es.value;if(this[ef]){if(!this[ed])this[ef]($,el.value)}el.now=en;el.maxAge=et;el.value=ee;this[eo]+=eu-el.length;el.length=eu;this.get($);eE(this);return true}const ey=new eT($,ee,eu,en,et);if(ey.length>this[ei]){if(this[ef])this[ef]($,ee);return false}this[eo]+=ey.length;this[ep].unshift(ey);this[eh].set($,this[ep].head);eE(this);return true}has($){if(!this[eh].has($))return false;const ee=this[eh].get($).value;return!ew(this,ee)}get($){return e_(this,$,true)}peek($){return e_(this,$,false)}pop(){const $=this[ep].tail;if(!$)return null;eS(this,$);return $.value}del($){eS(this,this[eh].get($))}load($){this.reset();const ee=Date.now();for(let et=$.length-1;et>=0;et--){const en=$[et];const ei=en.e||0;if(ei===0)this.set(en.k,en.v);else{const $=ei-ee;if($>0){this.set(en.k,en.v,$)}}}}prune(){this[eh].forEach(($,ee)=>e_(this,ee,false))}}const e_=($,ee,et)=>{const en=$[eh].get(ee);if(en){const ee=en.value;if(ew($,ee)){eS($,en);if(!$[eu])return undefined}else{if(et){if($[ey])en.value.now=Date.now();$[ep].unshiftNode(en)}}return ee.value}};const ew=($,ee)=>{if(!ee||!ee.maxAge&&!$[el])return false;const et=Date.now()-ee.now;return ee.maxAge?et>ee.maxAge:$[el]&&et>$[el]};const eE=$=>{if($[eo]>$[ei]){for(let ee=$[ep].tail;$[eo]>$[ei]&&ee!==null;){const et=ee.prev;eS($,ee);ee=et}}};const eS=($,ee)=>{if(ee){const et=ee.value;if($[ef])$[ef](et.key,et.value);$[eo]-=et.length;$[eh].delete(et.key);$[ep].removeNode(ee)}};class eT{constructor($,ee,et,en,ei){this.key=$;this.value=ee;this.length=et;this.now=en;this.maxAge=ei||0}}const eO=($,ee,et,en)=>{let ei=et.value;if(ew($,ei)){eS($,et);if(!$[eu])ei=undefined}if(ei)ee.call(en,ei.value,ei.key,$)};$.exports=em},6520:$=>{"use strict";$.exports=function($){$.prototype[Symbol.iterator]=function*(){for(let $=this.head;$;$=$.next){yield $.value}}}},3908:($,ee,et)=>{"use strict";$.exports=en;en.Node=eu;en.create=en;function en($){var ee=this;if(!(ee instanceof en)){ee=new en}ee.tail=null;ee.head=null;ee.length=0;if($&&typeof $.forEach==="function"){$.forEach(function($){ee.push($)})}else if(arguments.length>0){for(var et=0,ei=arguments.length;et<ei;et++){ee.push(arguments[et])}}return ee}en.prototype.removeNode=function($){if($.list!==this){throw new Error("removing node which does not belong to this list")}var ee=$.next;var et=$.prev;if(ee){ee.prev=et}if(et){et.next=ee}if($===this.head){this.head=ee}if($===this.tail){this.tail=et}$.list.length--;$.next=null;$.prev=null;$.list=null;return ee};en.prototype.unshiftNode=function($){if($===this.head){return}if($.list){$.list.removeNode($)}var ee=this.head;$.list=this;$.next=ee;if(ee){ee.prev=$}this.head=$;if(!this.tail){this.tail=$}this.length++};en.prototype.pushNode=function($){if($===this.tail){return}if($.list){$.list.removeNode($)}var ee=this.tail;$.list=this;$.prev=ee;if(ee){ee.next=$}this.tail=$;if(!this.head){this.head=$}this.length++};en.prototype.push=function(){for(var $=0,ee=arguments.length;$<ee;$++){eo(this,arguments[$])}return this.length};en.prototype.unshift=function(){for(var $=0,ee=arguments.length;$<ee;$++){es(this,arguments[$])}return this.length};en.prototype.pop=function(){if(!this.tail){return undefined}var $=this.tail.value;this.tail=this.tail.prev;if(this.tail){this.tail.next=null}else{this.head=null}this.length--;return $};en.prototype.shift=function(){if(!this.head){return undefined}var $=this.head.value;this.head=this.head.next;if(this.head){this.head.prev=null}else{this.tail=null}this.length--;return $};en.prototype.forEach=function($,ee){ee=ee||this;for(var et=this.head,en=0;et!==null;en++){$.call(ee,et.value,en,this);et=et.next}};en.prototype.forEachReverse=function($,ee){ee=ee||this;for(var et=this.tail,en=this.length-1;et!==null;en--){$.call(ee,et.value,en,this);et=et.prev}};en.prototype.get=function($){for(var ee=0,et=this.head;et!==null&&ee<$;ee++){et=et.next}if(ee===$&&et!==null){return et.value}};en.prototype.getReverse=function($){for(var ee=0,et=this.tail;et!==null&&ee<$;ee++){et=et.prev}if(ee===$&&et!==null){return et.value}};en.prototype.map=function($,ee){ee=ee||this;var et=new en;for(var ei=this.head;ei!==null;){et.push($.call(ee,ei.value,this));ei=ei.next}return et};en.prototype.mapReverse=function($,ee){ee=ee||this;var et=new en;for(var ei=this.tail;ei!==null;){et.push($.call(ee,ei.value,this));ei=ei.prev}return et};en.prototype.reduce=function($,ee){var et;var en=this.head;if(arguments.length>1){et=ee}else if(this.head){en=this.head.next;et=this.head.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var ei=0;en!==null;ei++){et=$(et,en.value,ei);en=en.next}return et};en.prototype.reduceReverse=function($,ee){var et;var en=this.tail;if(arguments.length>1){et=ee}else if(this.tail){en=this.tail.prev;et=this.tail.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var ei=this.length-1;en!==null;ei--){et=$(et,en.value,ei);en=en.prev}return et};en.prototype.toArray=function(){var $=new Array(this.length);for(var ee=0,et=this.head;et!==null;ee++){$[ee]=et.value;et=et.next}return $};en.prototype.toArrayReverse=function(){var $=new Array(this.length);for(var ee=0,et=this.tail;et!==null;ee++){$[ee]=et.value;et=et.prev}return $};en.prototype.slice=function($,ee){ee=ee||this.length;if(ee<0){ee+=this.length}$=$||0;if($<0){$+=this.length}var et=new en;if(ee<$||ee<0){return et}if($<0){$=0}if(ee>this.length){ee=this.length}for(var ei=0,eo=this.head;eo!==null&&ei<$;ei++){eo=eo.next}for(;eo!==null&&ei<ee;ei++,eo=eo.next){et.push(eo.value)}return et};en.prototype.sliceReverse=function($,ee){ee=ee||this.length;if(ee<0){ee+=this.length}$=$||0;if($<0){$+=this.length}var et=new en;if(ee<$||ee<0){return et}if($<0){$=0}if(ee>this.length){ee=this.length}for(var ei=this.length,eo=this.tail;eo!==null&&ei>ee;ei--){eo=eo.prev}for(;eo!==null&&ei>$;ei--,eo=eo.prev){et.push(eo.value)}return et};en.prototype.splice=function($,ee){if($>this.length){$=this.length-1}if($<0){$=this.length+$}for(var et=0,en=this.head;en!==null&&et<$;et++){en=en.next}var eo=[];for(var et=0;en&&et<ee;et++){eo.push(en.value);en=this.removeNode(en)}if(en===null){en=this.tail}if(en!==this.head&&en!==this.tail){en=en.prev}for(var et=2;et<arguments.length;et++){en=ei(this,en,arguments[et])}return eo};en.prototype.reverse=function(){var $=this.head;var ee=this.tail;for(var et=$;et!==null;et=et.prev){var en=et.prev;et.prev=et.next;et.next=en}this.head=ee;this.tail=$;return this};function ei($,ee,et){var en=ee===$.head?new eu(et,null,ee,$):new eu(et,ee,ee.next,$);if(en.next===null){$.tail=en}if(en.prev===null){$.head=en}$.length++;return en}function eo($,ee){$.tail=new eu(ee,$.tail,null,$);if(!$.head){$.head=$.tail}$.length++}function es($,ee){$.head=new eu(ee,null,$.head,$);if(!$.tail){$.tail=$.head}$.length++}function eu($,ee,et,en){if(!(this instanceof eu)){return new eu($,ee,et,en)}this.list=en;this.value=$;if(ee){ee.next=this;this.prev=ee}else{this.prev=null}if(et){et.prev=this;this.next=et}else{this.next=null}}try{et(6520)(en)}catch($){}},2568:($,ee,et)=>{(function(){var ee=et(1012),en=et(487).utf8,ei=et(76),eo=et(487).bin,es=function($,et){if($.constructor==String)if(et&&et.encoding==="binary")$=eo.stringToBytes($);else $=en.stringToBytes($);else if(ei($))$=Array.prototype.slice.call($,0);else if(!Array.isArray($)&&$.constructor!==Uint8Array)$=$.toString();var eu=ee.bytesToWords($),el=$.length*8,ef=1732584193,ed=-271733879,ep=-1732584194,eh=271733878;for(var ey=0;ey<eu.length;ey++){eu[ey]=(eu[ey]<<8|eu[ey]>>>24)&16711935|(eu[ey]<<24|eu[ey]>>>8)&4278255360}eu[el>>>5]|=128<<el%32;eu[(el+64>>>9<<4)+14]=el;var eg=es._ff,em=es._gg,e_=es._hh,ew=es._ii;for(var ey=0;ey<eu.length;ey+=16){var eE=ef,eS=ed,eT=ep,eO=eh;ef=eg(ef,ed,ep,eh,eu[ey+0],7,-680876936);eh=eg(eh,ef,ed,ep,eu[ey+1],12,-389564586);ep=eg(ep,eh,ef,ed,eu[ey+2],17,606105819);ed=eg(ed,ep,eh,ef,eu[ey+3],22,-1044525330);ef=eg(ef,ed,ep,eh,eu[ey+4],7,-176418897);eh=eg(eh,ef,ed,ep,eu[ey+5],12,1200080426);ep=eg(ep,eh,ef,ed,eu[ey+6],17,-1473231341);ed=eg(ed,ep,eh,ef,eu[ey+7],22,-45705983);ef=eg(ef,ed,ep,eh,eu[ey+8],7,1770035416);eh=eg(eh,ef,ed,ep,eu[ey+9],12,-1958414417);ep=eg(ep,eh,ef,ed,eu[ey+10],17,-42063);ed=eg(ed,ep,eh,ef,eu[ey+11],22,-1990404162);ef=eg(ef,ed,ep,eh,eu[ey+12],7,1804603682);eh=eg(eh,ef,ed,ep,eu[ey+13],12,-40341101);ep=eg(ep,eh,ef,ed,eu[ey+14],17,-1502002290);ed=eg(ed,ep,eh,ef,eu[ey+15],22,1236535329);ef=em(ef,ed,ep,eh,eu[ey+1],5,-165796510);eh=em(eh,ef,ed,ep,eu[ey+6],9,-1069501632);ep=em(ep,eh,ef,ed,eu[ey+11],14,643717713);ed=em(ed,ep,eh,ef,eu[ey+0],20,-373897302);ef=em(ef,ed,ep,eh,eu[ey+5],5,-701558691);eh=em(eh,ef,ed,ep,eu[ey+10],9,38016083);ep=em(ep,eh,ef,ed,eu[ey+15],14,-660478335);ed=em(ed,ep,eh,ef,eu[ey+4],20,-405537848);ef=em(ef,ed,ep,eh,eu[ey+9],5,568446438);eh=em(eh,ef,ed,ep,eu[ey+14],9,-1019803690);ep=em(ep,eh,ef,ed,eu[ey+3],14,-187363961);ed=em(ed,ep,eh,ef,eu[ey+8],20,1163531501);ef=em(ef,ed,ep,eh,eu[ey+13],5,-1444681467);eh=em(eh,ef,ed,ep,eu[ey+2],9,-51403784);ep=em(ep,eh,ef,ed,eu[ey+7],14,1735328473);ed=em(ed,ep,eh,ef,eu[ey+12],20,-1926607734);ef=e_(ef,ed,ep,eh,eu[ey+5],4,-378558);eh=e_(eh,ef,ed,ep,eu[ey+8],11,-2022574463);ep=e_(ep,eh,ef,ed,eu[ey+11],16,1839030562);ed=e_(ed,ep,eh,ef,eu[ey+14],23,-35309556);ef=e_(ef,ed,ep,eh,eu[ey+1],4,-1530992060);eh=e_(eh,ef,ed,ep,eu[ey+4],11,1272893353);ep=e_(ep,eh,ef,ed,eu[ey+7],16,-155497632);ed=e_(ed,ep,eh,ef,eu[ey+10],23,-1094730640);ef=e_(ef,ed,ep,eh,eu[ey+13],4,681279174);eh=e_(eh,ef,ed,ep,eu[ey+0],11,-358537222);ep=e_(ep,eh,ef,ed,eu[ey+3],16,-722521979);ed=e_(ed,ep,eh,ef,eu[ey+6],23,76029189);ef=e_(ef,ed,ep,eh,eu[ey+9],4,-640364487);eh=e_(eh,ef,ed,ep,eu[ey+12],11,-421815835);ep=e_(ep,eh,ef,ed,eu[ey+15],16,530742520);ed=e_(ed,ep,eh,ef,eu[ey+2],23,-995338651);ef=ew(ef,ed,ep,eh,eu[ey+0],6,-198630844);eh=ew(eh,ef,ed,ep,eu[ey+7],10,1126891415);ep=ew(ep,eh,ef,ed,eu[ey+14],15,-1416354905);ed=ew(ed,ep,eh,ef,eu[ey+5],21,-57434055);ef=ew(ef,ed,ep,eh,eu[ey+12],6,1700485571);eh=ew(eh,ef,ed,ep,eu[ey+3],10,-1894986606);ep=ew(ep,eh,ef,ed,eu[ey+10],15,-1051523);ed=ew(ed,ep,eh,ef,eu[ey+1],21,-2054922799);ef=ew(ef,ed,ep,eh,eu[ey+8],6,1873313359);eh=ew(eh,ef,ed,ep,eu[ey+15],10,-30611744);ep=ew(ep,eh,ef,ed,eu[ey+6],15,-1560198380);ed=ew(ed,ep,eh,ef,eu[ey+13],21,1309151649);ef=ew(ef,ed,ep,eh,eu[ey+4],6,-145523070);eh=ew(eh,ef,ed,ep,eu[ey+11],10,-1120210379);ep=ew(ep,eh,ef,ed,eu[ey+2],15,718787259);ed=ew(ed,ep,eh,ef,eu[ey+9],21,-343485551);ef=ef+eE>>>0;ed=ed+eS>>>0;ep=ep+eT>>>0;eh=eh+eO>>>0}return ee.endian([ef,ed,ep,eh])};es._ff=function($,ee,et,en,ei,eo,es){var eu=$+(ee&et|~ee&en)+(ei>>>0)+es;return(eu<<eo|eu>>>32-eo)+ee};es._gg=function($,ee,et,en,ei,eo,es){var eu=$+(ee&en|et&~en)+(ei>>>0)+es;return(eu<<eo|eu>>>32-eo)+ee};es._hh=function($,ee,et,en,ei,eo,es){var eu=$+(ee^et^en)+(ei>>>0)+es;return(eu<<eo|eu>>>32-eo)+ee};es._ii=function($,ee,et,en,ei,eo,es){var eu=$+(et^(ee|~en))+(ei>>>0)+es;return(eu<<eo|eu>>>32-eo)+ee};es._blocksize=16;es._digestsize=16;$.exports=function($,et){if($===undefined||$===null)throw new Error("Illegal argument "+$);var en=ee.wordsToBytes(es($,et));return et&&et.asBytes?en:et&&et.asString?eo.bytesToString(en):ee.bytesToHex(en)}})()},76:$=>{/*!
12
+ * Determine if an object is a Buffer
13
+ *
14
+ * @author Feross Aboukhadijeh <https://feross.org>
15
+ * @license MIT
16
+ */$.exports=function($){return $!=null&&(ee($)||et($)||!!$._isBuffer)};function ee($){return!!$.constructor&&typeof $.constructor.isBuffer==="function"&&$.constructor.isBuffer($)}function et($){return typeof $.readFloatLE==="function"&&typeof $.slice==="function"&&ee($.slice(0,0))}},832:($,ee,et)=>{"use strict";Object.defineProperty(ee,"__esModule",{value:true});var en=et(5561);var ei=et(9568);var eo=en.constants.S_IFMT,es=en.constants.S_IFDIR,eu=en.constants.S_IFREG,el=en.constants.S_IFBLK,ef=en.constants.S_IFCHR,ed=en.constants.S_IFLNK,ep=en.constants.S_IFIFO,eh=en.constants.S_IFSOCK;var ey=function(){function $(){this.name="";this.mode=0}$.build=function(ee,et){var en=new $;var eo=ee.getNode().mode;en.name=ei.strToEncoding(ee.getName(),et);en.mode=eo;return en};$.prototype._checkModeProperty=function($){return(this.mode&eo)===$};$.prototype.isDirectory=function(){return this._checkModeProperty(es)};$.prototype.isFile=function(){return this._checkModeProperty(eu)};$.prototype.isBlockDevice=function(){return this._checkModeProperty(el)};$.prototype.isCharacterDevice=function(){return this._checkModeProperty(ef)};$.prototype.isSymbolicLink=function(){return this._checkModeProperty(ed)};$.prototype.isFIFO=function(){return this._checkModeProperty(ep)};$.prototype.isSocket=function(){return this._checkModeProperty(eh)};return $}();ee.Dirent=ey;ee["default"]=ey},1507:($,ee,et)=>{"use strict";Object.defineProperty(ee,"__esModule",{value:true});var en=et(5561);var ei=et(3103);var eo=en.constants.S_IFMT,es=en.constants.S_IFDIR,eu=en.constants.S_IFREG,el=en.constants.S_IFBLK,ef=en.constants.S_IFCHR,ed=en.constants.S_IFLNK,ep=en.constants.S_IFIFO,eh=en.constants.S_IFSOCK;var ey=function(){function $(){}$.build=function(ee,et){if(et===void 0){et=false}var en=new $;var eo=ee.uid,es=ee.gid,eu=ee.atime,el=ee.mtime,ef=ee.ctime;var ed=!et?function($){return $}:ei.default;en.uid=ed(eo);en.gid=ed(es);en.rdev=ed(0);en.blksize=ed(4096);en.ino=ed(ee.ino);en.size=ed(ee.getSize());en.blocks=ed(1);en.atime=eu;en.mtime=el;en.ctime=ef;en.birthtime=ef;en.atimeMs=ed(eu.getTime());en.mtimeMs=ed(el.getTime());var ep=ed(ef.getTime());en.ctimeMs=ep;en.birthtimeMs=ep;en.dev=ed(0);en.mode=ed(ee.mode);en.nlink=ed(ee.nlink);return en};$.prototype._checkModeProperty=function($){return(Number(this.mode)&eo)===$};$.prototype.isDirectory=function(){return this._checkModeProperty(es)};$.prototype.isFile=function(){return this._checkModeProperty(eu)};$.prototype.isBlockDevice=function(){return this._checkModeProperty(el)};$.prototype.isCharacterDevice=function(){return this._checkModeProperty(ef)};$.prototype.isSymbolicLink=function(){return this._checkModeProperty(ed)};$.prototype.isFIFO=function(){return this._checkModeProperty(ep)};$.prototype.isSocket=function(){return this._checkModeProperty(eh)};return $}();ee.Stats=ey;ee["default"]=ey},5561:($,ee)=>{"use strict";Object.defineProperty(ee,"__esModule",{value:true});ee.constants={O_RDONLY:0,O_WRONLY:1,O_RDWR:2,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,O_CREAT:64,O_EXCL:128,O_NOCTTY:256,O_TRUNC:512,O_APPEND:1024,O_DIRECTORY:65536,O_NOATIME:262144,O_NOFOLLOW:131072,O_SYNC:1052672,O_DIRECT:16384,O_NONBLOCK:2048,S_IRWXU:448,S_IRUSR:256,S_IWUSR:128,S_IXUSR:64,S_IRWXG:56,S_IRGRP:32,S_IWGRP:16,S_IXGRP:8,S_IRWXO:7,S_IROTH:4,S_IWOTH:2,S_IXOTH:1,F_OK:0,R_OK:4,W_OK:2,X_OK:1,UV_FS_SYMLINK_DIR:1,UV_FS_SYMLINK_JUNCTION:2,UV_FS_COPYFILE_EXCL:1,UV_FS_COPYFILE_FICLONE:2,UV_FS_COPYFILE_FICLONE_FORCE:4,COPYFILE_EXCL:1,COPYFILE_FICLONE:2,COPYFILE_FICLONE_FORCE:4}},9568:($,ee,et)=>{"use strict";Object.defineProperty(ee,"__esModule",{value:true});var en=et(6426);var ei=et(6978);ee.ENCODING_UTF8="utf8";function eo($){if($&&!en.Buffer.isEncoding($))throw new ei.TypeError("ERR_INVALID_OPT_VALUE_ENCODING",$)}ee.assertEncoding=eo;function es($,et){if(!et||et===ee.ENCODING_UTF8)return $;if(et==="buffer")return new en.Buffer($);return new en.Buffer($).toString(et)}ee.strToEncoding=es},3103:($,ee)=>{if(typeof BigInt==="function")ee["default"]=BigInt;else ee["default"]=function $(){throw new Error("BigInt is not supported in this environment.")}},6551:function($,ee,et){"use strict";var en=this&&this.__assign||function(){en=Object.assign||function($){for(var ee,et=1,en=arguments.length;et<en;et++){ee=arguments[et];for(var ei in ee)if(Object.prototype.hasOwnProperty.call(ee,ei))$[ei]=ee[ei]}return $};return en.apply(this,arguments)};Object.defineProperty(ee,"__esModule",{value:true});var ei=et(1507);var eo=et(832);var es=et(6898);var eu=et(4657),el=eu.fsSyncMethods,ef=eu.fsAsyncMethods;var ed=et(5561);var ep=ed.constants.F_OK,eh=ed.constants.R_OK,ey=ed.constants.W_OK,eg=ed.constants.X_OK;ee.Volume=es.Volume;ee.vol=new es.Volume;function em($){var ee={F_OK:ep,R_OK:eh,W_OK:ey,X_OK:eg,constants:ed.constants,Stats:ei.default,Dirent:eo.default};for(var et=0,en=el;et<en.length;et++){var eu=en[et];if(typeof $[eu]==="function")ee[eu]=$[eu].bind($)}for(var em=0,e_=ef;em<e_.length;em++){var eu=e_[em];if(typeof $[eu]==="function")ee[eu]=$[eu].bind($)}ee.StatWatcher=$.StatWatcher;ee.FSWatcher=$.FSWatcher;ee.WriteStream=$.WriteStream;ee.ReadStream=$.ReadStream;ee.promises=$.promises;ee._toUnixTimestamp=es.toUnixTimestamp;return ee}ee.createFsFromVolume=em;ee.fs=em(ee.vol);$.exports=en(en({},$.exports),ee.fs);$.exports.semantic=true},6426:function($,ee,et){"use strict";var en=this&&this.__spreadArrays||function(){for(var $=0,ee=0,et=arguments.length;ee<et;ee++)$+=arguments[ee].length;for(var en=Array($),ei=0,ee=0;ee<et;ee++)for(var eo=arguments[ee],es=0,eu=eo.length;es<eu;es++,ei++)en[ei]=eo[es];return en};Object.defineProperty(ee,"__esModule",{value:true});var ei=et(8764);ee.Buffer=ei.Buffer;function eo($){var ee=[];for(var et=1;et<arguments.length;et++){ee[et-1]=arguments[et]}return new(ei.Buffer.bind.apply(ei.Buffer,en([void 0,$],ee)))}var es=ei.Buffer.allocUnsafe||eo;ee.bufferAllocUnsafe=es;var eu=ei.Buffer.from||eo;ee.bufferFrom=eu},6978:function($,ee,et){"use strict";var en=this&&this.__extends||function(){var $=function(ee,et){$=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function($,ee){$.__proto__=ee}||function($,ee){for(var et in ee)if(ee.hasOwnProperty(et))$[et]=ee[et]};return $(ee,et)};return function(ee,et){$(ee,et);function en(){this.constructor=ee}ee.prototype=et===null?Object.create(et):(en.prototype=et.prototype,new en)}}();Object.defineProperty(ee,"__esModule",{value:true});var ei=et(9282);var eo=et(9539);var es=typeof Symbol==="undefined"?"_kCode":Symbol("code");var eu={};function el($){return function($){en(ee,$);function ee(ee){var et=[];for(var en=1;en<arguments.length;en++){et[en-1]=arguments[en]}var ei=$.call(this,ed(ee,et))||this;ei.code=ee;ei[es]=ee;ei.name=$.prototype.name+" ["+ei[es]+"]";return ei}return ee}($)}var ef=function($){en(et,$);function et(et){var en=this;if(typeof et!=="object"||et===null){throw new ee.TypeError("ERR_INVALID_ARG_TYPE","options","object")}if(et.message){en=$.call(this,et.message)||this}else{en=$.call(this,eo.inspect(et.actual).slice(0,128)+" "+(et.operator+" "+eo.inspect(et.expected).slice(0,128)))||this}en.generatedMessage=!et.message;en.name="AssertionError [ERR_ASSERTION]";en.code="ERR_ASSERTION";en.actual=et.actual;en.expected=et.expected;en.operator=et.operator;ee.Error.captureStackTrace(en,et.stackStartFunction);return en}return et}(et.g.Error);ee.AssertionError=ef;function ed($,ee){ei.strictEqual(typeof $,"string");var et=eu[$];ei(et,"An invalid error message key was used: "+$+".");var en;if(typeof et==="function"){en=et}else{en=eo.format;if(ee===undefined||ee.length===0)return et;ee.unshift(et)}return String(en.apply(null,ee))}ee.message=ed;function ep($,ee){eu[$]=typeof ee==="function"?ee:String(ee)}ee.E=ep;ee.Error=el(et.g.Error);ee.TypeError=el(et.g.TypeError);ee.RangeError=el(et.g.RangeError);ep("ERR_ARG_NOT_ITERABLE","%s must be iterable");ep("ERR_ASSERTION","%s");ep("ERR_BUFFER_OUT_OF_BOUNDS",em);ep("ERR_CHILD_CLOSED_BEFORE_REPLY","Child closed before reply received");ep("ERR_CONSOLE_WRITABLE_STREAM","Console expects a writable stream instance for %s");ep("ERR_CPU_USAGE","Unable to obtain cpu usage %s");ep("ERR_DNS_SET_SERVERS_FAILED",function($,ee){return'c-ares failed to set servers: "'+$+'" ['+ee+"]"});ep("ERR_FALSY_VALUE_REJECTION","Promise was rejected with falsy value");ep("ERR_ENCODING_NOT_SUPPORTED",function($){return'The "'+$+'" encoding is not supported'});ep("ERR_ENCODING_INVALID_ENCODED_DATA",function($){return"The encoded data was not valid for encoding "+$});ep("ERR_HTTP_HEADERS_SENT","Cannot render headers after they are sent to the client");ep("ERR_HTTP_INVALID_STATUS_CODE","Invalid status code: %s");ep("ERR_HTTP_TRAILER_INVALID","Trailers are invalid with this transfer encoding");ep("ERR_INDEX_OUT_OF_RANGE","Index out of range");ep("ERR_INVALID_ARG_TYPE",eh);ep("ERR_INVALID_ARRAY_LENGTH",function($,ee,et){ei.strictEqual(typeof et,"number");return'The array "'+$+'" (length '+et+") must be of length "+ee+"."});ep("ERR_INVALID_BUFFER_SIZE","Buffer size must be a multiple of %s");ep("ERR_INVALID_CALLBACK","Callback must be a function");ep("ERR_INVALID_CHAR","Invalid character in %s");ep("ERR_INVALID_CURSOR_POS","Cannot set cursor row without setting its column");ep("ERR_INVALID_FD",'"fd" must be a positive integer: %s');ep("ERR_INVALID_FILE_URL_HOST",'File URL host must be "localhost" or empty on %s');ep("ERR_INVALID_FILE_URL_PATH","File URL path %s");ep("ERR_INVALID_HANDLE_TYPE","This handle type cannot be sent");ep("ERR_INVALID_IP_ADDRESS","Invalid IP address: %s");ep("ERR_INVALID_OPT_VALUE",function($,ee){return'The value "'+String(ee)+'" is invalid for option "'+$+'"'});ep("ERR_INVALID_OPT_VALUE_ENCODING",function($){return'The value "'+String($)+'" is invalid for option "encoding"'});ep("ERR_INVALID_REPL_EVAL_CONFIG",'Cannot specify both "breakEvalOnSigint" and "eval" for REPL');ep("ERR_INVALID_SYNC_FORK_INPUT","Asynchronous forks do not support Buffer, Uint8Array or string input: %s");ep("ERR_INVALID_THIS",'Value of "this" must be of type %s');ep("ERR_INVALID_TUPLE","%s must be an iterable %s tuple");ep("ERR_INVALID_URL","Invalid URL: %s");ep("ERR_INVALID_URL_SCHEME",function($){return"The URL must be "+eg($,"scheme")});ep("ERR_IPC_CHANNEL_CLOSED","Channel closed");ep("ERR_IPC_DISCONNECTED","IPC channel is already disconnected");ep("ERR_IPC_ONE_PIPE","Child process can have only one IPC pipe");ep("ERR_IPC_SYNC_FORK","IPC cannot be used with synchronous forks");ep("ERR_MISSING_ARGS",ey);ep("ERR_MULTIPLE_CALLBACK","Callback called multiple times");ep("ERR_NAPI_CONS_FUNCTION","Constructor must be a function");ep("ERR_NAPI_CONS_PROTOTYPE_OBJECT","Constructor.prototype must be an object");ep("ERR_NO_CRYPTO","Node.js is not compiled with OpenSSL crypto support");ep("ERR_NO_LONGER_SUPPORTED","%s is no longer supported");ep("ERR_PARSE_HISTORY_DATA","Could not parse history data in %s");ep("ERR_SOCKET_ALREADY_BOUND","Socket is already bound");ep("ERR_SOCKET_BAD_PORT","Port should be > 0 and < 65536");ep("ERR_SOCKET_BAD_TYPE","Bad socket type specified. Valid types are: udp4, udp6");ep("ERR_SOCKET_CANNOT_SEND","Unable to send data");ep("ERR_SOCKET_CLOSED","Socket is closed");ep("ERR_SOCKET_DGRAM_NOT_RUNNING","Not running");ep("ERR_STDERR_CLOSE","process.stderr cannot be closed");ep("ERR_STDOUT_CLOSE","process.stdout cannot be closed");ep("ERR_STREAM_WRAP","Stream has StringDecoder set or is in objectMode");ep("ERR_TLS_CERT_ALTNAME_INVALID","Hostname/IP does not match certificate's altnames: %s");ep("ERR_TLS_DH_PARAM_SIZE",function($){return"DH parameter size "+$+" is less than 2048"});ep("ERR_TLS_HANDSHAKE_TIMEOUT","TLS handshake timeout");ep("ERR_TLS_RENEGOTIATION_FAILED","Failed to renegotiate");ep("ERR_TLS_REQUIRED_SERVER_NAME",'"servername" is required parameter for Server.addContext');ep("ERR_TLS_SESSION_ATTACK","TSL session renegotiation attack detected");ep("ERR_TRANSFORM_ALREADY_TRANSFORMING","Calling transform done when still transforming");ep("ERR_TRANSFORM_WITH_LENGTH_0","Calling transform done when writableState.length != 0");ep("ERR_UNKNOWN_ENCODING","Unknown encoding: %s");ep("ERR_UNKNOWN_SIGNAL","Unknown signal: %s");ep("ERR_UNKNOWN_STDIN_TYPE","Unknown stdin file type");ep("ERR_UNKNOWN_STREAM_TYPE","Unknown stream file type");ep("ERR_V8BREAKITERATOR","Full ICU data not installed. "+"See https://github.com/nodejs/node/wiki/Intl");function eh($,ee,et){ei($,"name is required");var en;if(ee.includes("not ")){en="must not be";ee=ee.split("not ")[1]}else{en="must be"}var eo;if(Array.isArray($)){var es=$.map(function($){return'"'+$+'"'}).join(", ");eo="The "+es+" arguments "+en+" "+eg(ee,"type")}else if($.includes(" argument")){eo="The "+$+" "+en+" "+eg(ee,"type")}else{var eu=$.includes(".")?"property":"argument";eo='The "'+$+'" '+eu+" "+en+" "+eg(ee,"type")}if(arguments.length>=3){eo+=". Received type "+(et!==null?typeof et:"null")}return eo}function ey(){var $=[];for(var ee=0;ee<arguments.length;ee++){$[ee]=arguments[ee]}ei($.length>0,"At least one arg needs to be specified");var et="The ";var en=$.length;$=$.map(function($){return'"'+$+'"'});switch(en){case 1:et+=$[0]+" argument";break;case 2:et+=$[0]+" and "+$[1]+" arguments";break;default:et+=$.slice(0,en-1).join(", ");et+=", and "+$[en-1]+" arguments";break}return et+" must be specified"}function eg($,ee){ei($,"expected is required");ei(typeof ee==="string","thing is required");if(Array.isArray($)){var et=$.length;ei(et>0,"At least one expected value needs to be specified");$=$.map(function($){return String($)});if(et>2){return"one of "+ee+" "+$.slice(0,et-1).join(", ")+", or "+$[et-1]}else if(et===2){return"one of "+ee+" "+$[0]+" or "+$[1]}else{return"of "+ee+" "+$[0]}}else{return"of "+ee+" "+String($)}}function em($,ee){if(ee){return"Attempt to write outside buffer bounds"}else{return'"'+$+'" is outside of buffer bounds'}}},1172:function($,ee,et){"use strict";var en=this&&this.__extends||function(){var $=function(ee,et){$=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function($,ee){$.__proto__=ee}||function($,ee){for(var et in ee)if(ee.hasOwnProperty(et))$[et]=ee[et]};return $(ee,et)};return function(ee,et){$(ee,et);function en(){this.constructor=ee}ee.prototype=et===null?Object.create(et):(en.prototype=et.prototype,new en)}}();Object.defineProperty(ee,"__esModule",{value:true});var ei=et(4880);var eo=et(6426);var es=et(5561);var eu=et(7187);var el=et(1507);var ef=es.constants.S_IFMT,ed=es.constants.S_IFDIR,ep=es.constants.S_IFREG,eh=es.constants.S_IFLNK,ey=es.constants.O_APPEND;ee.SEP="/";var eg=function($){en(ee,$);function ee(ee,et){if(et===void 0){et=438}var en=$.call(this)||this;en.uid=ei.default.getuid();en.gid=ei.default.getgid();en.atime=new Date;en.mtime=new Date;en.ctime=new Date;en.perm=438;en.mode=ep;en.nlink=1;en.perm=et;en.mode|=et;en.ino=ee;return en}ee.prototype.getString=function($){if($===void 0){$="utf8"}return this.getBuffer().toString($)};ee.prototype.setString=function($){this.buf=eo.bufferFrom($,"utf8");this.touch()};ee.prototype.getBuffer=function(){if(!this.buf)this.setBuffer(eo.bufferAllocUnsafe(0));return eo.bufferFrom(this.buf)};ee.prototype.setBuffer=function($){this.buf=eo.bufferFrom($);this.touch()};ee.prototype.getSize=function(){return this.buf?this.buf.length:0};ee.prototype.setModeProperty=function($){this.mode=this.mode&~ef|$};ee.prototype.setIsFile=function(){this.setModeProperty(ep)};ee.prototype.setIsDirectory=function(){this.setModeProperty(ed)};ee.prototype.setIsSymlink=function(){this.setModeProperty(eh)};ee.prototype.isFile=function(){return(this.mode&ef)===ep};ee.prototype.isDirectory=function(){return(this.mode&ef)===ed};ee.prototype.isSymlink=function(){return(this.mode&ef)===eh};ee.prototype.makeSymlink=function($){this.symlink=$;this.setIsSymlink()};ee.prototype.write=function($,ee,et,en){if(ee===void 0){ee=0}if(et===void 0){et=$.length}if(en===void 0){en=0}if(!this.buf)this.buf=eo.bufferAllocUnsafe(0);if(en+et>this.buf.length){var ei=eo.bufferAllocUnsafe(en+et);this.buf.copy(ei,0,0,this.buf.length);this.buf=ei}$.copy(this.buf,en,ee,ee+et);this.touch();return et};ee.prototype.read=function($,ee,et,en){if(ee===void 0){ee=0}if(et===void 0){et=$.byteLength}if(en===void 0){en=0}if(!this.buf)this.buf=eo.bufferAllocUnsafe(0);var ei=et;if(ei>$.byteLength){ei=$.byteLength}if(ei+en>this.buf.length){ei=this.buf.length-en}this.buf.copy($,ee,en,en+ei);return ei};ee.prototype.truncate=function($){if($===void 0){$=0}if(!$)this.buf=eo.bufferAllocUnsafe(0);else{if(!this.buf)this.buf=eo.bufferAllocUnsafe(0);if($<=this.buf.length){this.buf=this.buf.slice(0,$)}else{var ee=eo.bufferAllocUnsafe(0);this.buf.copy(ee);ee.fill(0,$)}}this.touch()};ee.prototype.chmod=function($){this.perm=$;this.mode=this.mode&~511|$;this.touch()};ee.prototype.chown=function($,ee){this.uid=$;this.gid=ee;this.touch()};ee.prototype.touch=function(){this.mtime=new Date;this.emit("change",this)};ee.prototype.canRead=function($,ee){if($===void 0){$=ei.default.getuid()}if(ee===void 0){ee=ei.default.getgid()}if(this.perm&4){return true}if(ee===this.gid){if(this.perm&32){return true}}if($===this.uid){if(this.perm&256){return true}}return false};ee.prototype.canWrite=function($,ee){if($===void 0){$=ei.default.getuid()}if(ee===void 0){ee=ei.default.getgid()}if(this.perm&2){return true}if(ee===this.gid){if(this.perm&16){return true}}if($===this.uid){if(this.perm&128){return true}}return false};ee.prototype.del=function(){this.emit("delete",this)};ee.prototype.toJSON=function(){return{ino:this.ino,uid:this.uid,gid:this.gid,atime:this.atime.getTime(),mtime:this.mtime.getTime(),ctime:this.ctime.getTime(),perm:this.perm,mode:this.mode,nlink:this.nlink,symlink:this.symlink,data:this.getString()}};return ee}(eu.EventEmitter);ee.Node=eg;var em=function($){en(et,$);function et(ee,et,en){var ei=$.call(this)||this;ei.children={};ei.steps=[];ei.ino=0;ei.length=0;ei.vol=ee;ei.parent=et;ei.steps=et?et.steps.concat([en]):[en];return ei}et.prototype.setNode=function($){this.node=$;this.ino=$.ino};et.prototype.getNode=function(){return this.node};et.prototype.createChild=function($,ee){if(ee===void 0){ee=this.vol.createNode()}var en=new et(this.vol,this,$);en.setNode(ee);if(ee.isDirectory()){}this.setChild($,en);return en};et.prototype.setChild=function($,ee){if(ee===void 0){ee=new et(this.vol,this,$)}this.children[$]=ee;ee.parent=this;this.length++;this.emit("child:add",ee,this);return ee};et.prototype.deleteChild=function($){delete this.children[$.getName()];this.length--;this.emit("child:delete",$,this)};et.prototype.getChild=function($){if(Object.hasOwnProperty.call(this.children,$)){return this.children[$]}};et.prototype.getPath=function(){return this.steps.join(ee.SEP)};et.prototype.getName=function(){return this.steps[this.steps.length-1]};et.prototype.walk=function($,ee,et){if(ee===void 0){ee=$.length}if(et===void 0){et=0}if(et>=$.length)return this;if(et>=ee)return this;var en=$[et];var ei=this.getChild(en);if(!ei)return null;return ei.walk($,ee,et+1)};et.prototype.toJSON=function(){return{steps:this.steps,ino:this.ino,children:Object.keys(this.children)}};return et}(eu.EventEmitter);ee.Link=em;var e_=function(){function $($,ee,et,en){this.position=0;this.link=$;this.node=ee;this.flags=et;this.fd=en}$.prototype.getString=function($){if($===void 0){$="utf8"}return this.node.getString()};$.prototype.setString=function($){this.node.setString($)};$.prototype.getBuffer=function(){return this.node.getBuffer()};$.prototype.setBuffer=function($){this.node.setBuffer($)};$.prototype.getSize=function(){return this.node.getSize()};$.prototype.truncate=function($){this.node.truncate($)};$.prototype.seekTo=function($){this.position=$};$.prototype.stats=function(){return el.default.build(this.node)};$.prototype.write=function($,ee,et,en){if(ee===void 0){ee=0}if(et===void 0){et=$.length}if(typeof en!=="number")en=this.position;if(this.flags&ey)en=this.getSize();var ei=this.node.write($,ee,et,en);this.position=en+ei;return ei};$.prototype.read=function($,ee,et,en){if(ee===void 0){ee=0}if(et===void 0){et=$.byteLength}if(typeof en!=="number")en=this.position;var ei=this.node.read($,ee,et,en);this.position=en+ei;return ei};$.prototype.chmod=function($){this.node.chmod($)};$.prototype.chown=function($,ee){this.node.chown($,ee)};return $}();ee.File=e_},4880:($,ee,et)=>{"use strict";var en=et(4155);Object.defineProperty(ee,"__esModule",{value:true});var ei=function(){if(typeof en!=="undefined"){return en}try{return et(4155)}catch($){return undefined}};function eo(){var $=ei()||{};if(!$.getuid)$.getuid=function(){return 0};if(!$.getgid)$.getgid=function(){return 0};if(!$.cwd)$.cwd=function(){return"/"};if(!$.nextTick)$.nextTick=et(6015)["default"];if(!$.emitWarning)$.emitWarning=function($,ee){console.warn(""+ee+(ee?": ":"")+$)};if(!$.env)$.env={};return $}ee.createProcess=eo;ee["default"]=eo()},6133:function($,ee){"use strict";var et=this&&this.__spreadArrays||function(){for(var $=0,ee=0,et=arguments.length;ee<et;ee++)$+=arguments[ee].length;for(var en=Array($),ei=0,ee=0;ee<et;ee++)for(var eo=arguments[ee],es=0,eu=eo.length;es<eu;es++,ei++)en[ei]=eo[es];return en};Object.defineProperty(ee,"__esModule",{value:true});function en($,ee,en){if(en===void 0){en=function($){return $}}return function(){var ei=[];for(var eo=0;eo<arguments.length;eo++){ei[eo]=arguments[eo]}return new Promise(function(eo,es){$[ee].bind($).apply(void 0,et(ei,[function($,ee){if($)return es($);return eo(en(ee))}]))})}}var ei=function(){function $($,ee){this.vol=$;this.fd=ee}$.prototype.appendFile=function($,ee){return en(this.vol,"appendFile")(this.fd,$,ee)};$.prototype.chmod=function($){return en(this.vol,"fchmod")(this.fd,$)};$.prototype.chown=function($,ee){return en(this.vol,"fchown")(this.fd,$,ee)};$.prototype.close=function(){return en(this.vol,"close")(this.fd)};$.prototype.datasync=function(){return en(this.vol,"fdatasync")(this.fd)};$.prototype.read=function($,ee,et,ei){return en(this.vol,"read",function(ee){return{bytesRead:ee,buffer:$}})(this.fd,$,ee,et,ei)};$.prototype.readFile=function($){return en(this.vol,"readFile")(this.fd,$)};$.prototype.stat=function($){return en(this.vol,"fstat")(this.fd,$)};$.prototype.sync=function(){return en(this.vol,"fsync")(this.fd)};$.prototype.truncate=function($){return en(this.vol,"ftruncate")(this.fd,$)};$.prototype.utimes=function($,ee){return en(this.vol,"futimes")(this.fd,$,ee)};$.prototype.write=function($,ee,et,ei){return en(this.vol,"write",function(ee){return{bytesWritten:ee,buffer:$}})(this.fd,$,ee,et,ei)};$.prototype.writeFile=function($,ee){return en(this.vol,"writeFile")(this.fd,$,ee)};return $}();ee.FileHandle=ei;function eo($){if(typeof Promise==="undefined")return null;return{FileHandle:ei,access:function(ee,et){return en($,"access")(ee,et)},appendFile:function(ee,et,eo){return en($,"appendFile")(ee instanceof ei?ee.fd:ee,et,eo)},chmod:function(ee,et){return en($,"chmod")(ee,et)},chown:function(ee,et,ei){return en($,"chown")(ee,et,ei)},copyFile:function(ee,et,ei){return en($,"copyFile")(ee,et,ei)},lchmod:function(ee,et){return en($,"lchmod")(ee,et)},lchown:function(ee,et,ei){return en($,"lchown")(ee,et,ei)},link:function(ee,et){return en($,"link")(ee,et)},lstat:function(ee,et){return en($,"lstat")(ee,et)},mkdir:function(ee,et){return en($,"mkdir")(ee,et)},mkdtemp:function(ee,et){return en($,"mkdtemp")(ee,et)},open:function(ee,et,eo){return en($,"open",function(ee){return new ei($,ee)})(ee,et,eo)},readdir:function(ee,et){return en($,"readdir")(ee,et)},readFile:function(ee,et){return en($,"readFile")(ee instanceof ei?ee.fd:ee,et)},readlink:function(ee,et){return en($,"readlink")(ee,et)},realpath:function(ee,et){return en($,"realpath")(ee,et)},rename:function(ee,et){return en($,"rename")(ee,et)},rmdir:function(ee){return en($,"rmdir")(ee)},stat:function(ee,et){return en($,"stat")(ee,et)},symlink:function(ee,et,ei){return en($,"symlink")(ee,et,ei)},truncate:function(ee,et){return en($,"truncate")(ee,et)},unlink:function(ee){return en($,"unlink")(ee)},utimes:function(ee,et,ei){return en($,"utimes")(ee,et,ei)},writeFile:function(ee,et,eo){return en($,"writeFile")(ee instanceof ei?ee.fd:ee,et,eo)}}}ee["default"]=eo},6015:($,ee,et)=>{"use strict";Object.defineProperty(ee,"__esModule",{value:true});var en;if(typeof setImmediate==="function")en=setImmediate.bind(et.g);else en=setTimeout.bind(et.g);ee["default"]=en},8369:($,ee)=>{"use strict";Object.defineProperty(ee,"__esModule",{value:true});function et($,ee,et){var en=setTimeout.apply(null,arguments);if(en&&typeof en==="object"&&typeof en.unref==="function")en.unref();return en}ee["default"]=et},6898:function($,ee,et){"use strict";var en=this&&this.__extends||function(){var $=function(ee,et){$=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function($,ee){$.__proto__=ee}||function($,ee){for(var et in ee)if(ee.hasOwnProperty(et))$[et]=ee[et]};return $(ee,et)};return function(ee,et){$(ee,et);function en(){this.constructor=ee}ee.prototype=et===null?Object.create(et):(en.prototype=et.prototype,new en)}}();var ei=this&&this.__spreadArrays||function(){for(var $=0,ee=0,et=arguments.length;ee<et;ee++)$+=arguments[ee].length;for(var en=Array($),ei=0,ee=0;ee<et;ee++)for(var eo=arguments[ee],es=0,eu=eo.length;es<eu;es++,ei++)en[ei]=eo[es];return en};Object.defineProperty(ee,"__esModule",{value:true});var eo=et(6470);var es=et(1172);var eu=et(1507);var el=et(832);var ef=et(6426);var ed=et(6015);var ep=et(4880);var eh=et(8369);var ey=et(2830);var eg=et(5561);var em=et(7187);var e_=et(9568);var ew=et(6978);var eE=et(9539);var eS=et(6133);var eT=eo.resolve;var eO=eg.constants.O_RDONLY,eA=eg.constants.O_WRONLY,eI=eg.constants.O_RDWR,eN=eg.constants.O_CREAT,eD=eg.constants.O_EXCL,eR=eg.constants.O_TRUNC,eC=eg.constants.O_APPEND,ek=eg.constants.O_SYNC,eM=eg.constants.O_DIRECTORY,eL=eg.constants.F_OK,eP=eg.constants.COPYFILE_EXCL,eF=eg.constants.COPYFILE_FICLONE_FORCE;var eB;var eU;if(eo.posix){var ej=eo.posix;eB=ej.sep;eU=ej.relative}else{eB=eo.sep;eU=eo.relative}var eW=ep.default.platform==="win32";var eH=128;var ez={PATH_STR:"path must be a string or Buffer",FD:"fd must be a file descriptor",MODE_INT:"mode must be an int",CB:"callback must be a function",UID:"uid must be an unsigned int",GID:"gid must be an unsigned int",LEN:"len must be an integer",ATIME:"atime must be an integer",MTIME:"mtime must be an integer",PREFIX:"filename prefix is required",BUFFER:"buffer must be an instance of Buffer or StaticBuffer",OFFSET:"offset must be an integer",LENGTH:"length must be an integer",POSITION:"position must be an integer"};var eV=function($){return"Expected options to be either an object or a string, but got "+$+" instead"};var e$="ENOENT";var eq="EBADF";var eG="EINVAL";var eY="EPERM";var eK="EPROTO";var eZ="EEXIST";var eJ="ENOTDIR";var eX="EMFILE";var eQ="EACCES";var e0="EISDIR";var e1="ENOTEMPTY";var e2="ENOSYS";function e6($,ee,et,en){if(ee===void 0){ee=""}if(et===void 0){et=""}if(en===void 0){en=""}var ei="";if(et)ei=" '"+et+"'";if(en)ei+=" -> '"+en+"'";switch($){case e$:return"ENOENT: no such file or directory, "+ee+ei;case eq:return"EBADF: bad file descriptor, "+ee+ei;case eG:return"EINVAL: invalid argument, "+ee+ei;case eY:return"EPERM: operation not permitted, "+ee+ei;case eK:return"EPROTO: protocol error, "+ee+ei;case eZ:return"EEXIST: file already exists, "+ee+ei;case eJ:return"ENOTDIR: not a directory, "+ee+ei;case e0:return"EISDIR: illegal operation on a directory, "+ee+ei;case eQ:return"EACCES: permission denied, "+ee+ei;case e1:return"ENOTEMPTY: directory not empty, "+ee+ei;case eX:return"EMFILE: too many open files, "+ee+ei;case e2:return"ENOSYS: function not implemented, "+ee+ei;default:return $+": error occurred, "+ee+ei}}function e4($,ee,et,en,ei){if(ee===void 0){ee=""}if(et===void 0){et=""}if(en===void 0){en=""}if(ei===void 0){ei=Error}var eo=new ei(e6($,ee,et,en));eo.code=$;return eo}var e3;(function($){$[$["r"]=eO]="r";$[$["r+"]=eI]="r+";$[$["rs"]=eO|ek]="rs";$[$["sr"]=$.rs]="sr";$[$["rs+"]=eI|ek]="rs+";$[$["sr+"]=$["rs+"]]="sr+";$[$["w"]=eA|eN|eR]="w";$[$["wx"]=eA|eN|eR|eD]="wx";$[$["xw"]=$.wx]="xw";$[$["w+"]=eI|eN|eR]="w+";$[$["wx+"]=eI|eN|eR|eD]="wx+";$[$["xw+"]=$["wx+"]]="xw+";$[$["a"]=eA|eC|eN]="a";$[$["ax"]=eA|eC|eN|eD]="ax";$[$["xa"]=$.ax]="xa";$[$["a+"]=eI|eC|eN]="a+";$[$["ax+"]=eI|eC|eN|eD]="ax+";$[$["xa+"]=$["ax+"]]="xa+"})(e3=ee.FLAGS||(ee.FLAGS={}));function e8($){if(typeof $==="number")return $;if(typeof $==="string"){var ee=e3[$];if(typeof ee!=="undefined")return ee}throw new ew.TypeError("ERR_INVALID_OPT_VALUE","flags",$)}ee.flagsToNumber=e8;function e5($,ee){var et;if(!ee)return $;else{var en=typeof ee;switch(en){case"string":et=Object.assign({},$,{encoding:ee});break;case"object":et=Object.assign({},$,ee);break;default:throw TypeError(eV(en))}}if(et.encoding!=="buffer")e_.assertEncoding(et.encoding);return et}function e9($){return function(ee){return e5($,ee)}}function e7($){if(typeof $!=="function")throw TypeError(ez.CB);return $}function te($){return function(ee,et){return typeof ee==="function"?[$(),ee]:[$(ee),e7(et)]}}var tt={encoding:"utf8"};var tr=e9(tt);var tn=te(tr);var ti={flag:"r"};var tu=e9(ti);var tc={encoding:"utf8",mode:438,flag:e3[e3.w]};var tf=e9(tc);var td={encoding:"utf8",mode:438,flag:e3[e3.a]};var tp=e9(td);var th=te(tp);var ty=tt;var tm=e9(ty);var t_=te(tm);var tv={mode:511,recursive:false};var tw=function($){if(typeof $==="number")return Object.assign({},tv,{mode:$});return Object.assign({},tv,$)};var tE={recursive:false};var tS=function($){return Object.assign({},tE,$)};var tT={encoding:"utf8",withFileTypes:false};var tO=e9(tT);var tA=te(tO);var tI={bigint:false};var tN=function($){if($===void 0){$={}}return Object.assign({},tI,$)};var tD=function($,ee){return typeof $==="function"?[tN(),$]:[tN($),e7(ee)]};function tR($){if($.hostname!==""){throw new ew.TypeError("ERR_INVALID_FILE_URL_HOST",ep.default.platform)}var ee=$.pathname;for(var et=0;et<ee.length;et++){if(ee[et]==="%"){var en=ee.codePointAt(et+2)|32;if(ee[et+1]==="2"&&en===102){throw new ew.TypeError("ERR_INVALID_FILE_URL_PATH","must not include encoded / characters")}}}return decodeURIComponent(ee)}function tC($){if(typeof $!=="string"&&!ef.Buffer.isBuffer($)){try{if(!($ instanceof et(8119).URL))throw new TypeError(ez.PATH_STR)}catch($){throw new TypeError(ez.PATH_STR)}$=tR($)}var ee=String($);tj(ee);return ee}ee.pathToFilename=tC;var tk=function($,ee){if(ee===void 0){ee=ep.default.cwd()}return eT(ee,$)};if(eW){var tM=tk;var tL=et(8012).Z4;tk=function($,ee){return tL(tM($,ee))}}function tx($,ee){var et=tk($,ee);var en=et.substr(1);if(!en)return[];return en.split(eB)}ee.filenameToSteps=tx;function tP($){return tx(tC($))}ee.pathToSteps=tP;function tF($,ee){if(ee===void 0){ee=e_.ENCODING_UTF8}if(ef.Buffer.isBuffer($))return $.toString(ee);else if($ instanceof Uint8Array)return ef.bufferFrom($).toString(ee);else return String($)}ee.dataToStr=tF;function tB($,ee){if(ee===void 0){ee=e_.ENCODING_UTF8}if(ef.Buffer.isBuffer($))return $;else if($ instanceof Uint8Array)return ef.bufferFrom($);else return ef.bufferFrom(String($),ee)}ee.dataToBuffer=tB;function tU($,ee){if(!ee||ee==="buffer")return $;else return $.toString(ee)}ee.bufferToEncoding=tU;function tj($,ee){if((""+$).indexOf("\x00")!==-1){var et=new Error("Path must be a string without null bytes");et.code=e$;if(typeof ee!=="function")throw et;ep.default.nextTick(ee,et);return false}return true}function tW($,ee){if(typeof $==="number")return $;if(typeof $==="string")return parseInt($,8);if(ee)return tH(ee);return undefined}function tH($,ee){var et=tW($,ee);if(typeof et!=="number"||isNaN(et))throw new TypeError(ez.MODE_INT);return et}function tz($){return $>>>0===$}function tV($){if(!tz($))throw TypeError(ez.FD)}function t$($){if(typeof $==="string"&&+$==$){return+$}if($ instanceof Date){return $.getTime()/1e3}if(isFinite($)){if($<0){return Date.now()/1e3}return $}throw new Error("Cannot parse time: "+$)}ee.toUnixTimestamp=t$;function tq($){if(typeof $!=="number")throw TypeError(ez.UID)}function tG($){if(typeof $!=="number")throw TypeError(ez.GID)}var tY=function(){function $($){if($===void 0){$={}}this.ino=0;this.inodes={};this.releasedInos=[];this.fds={};this.releasedFds=[];this.maxFiles=1e4;this.openFiles=0;this.promisesApi=eS.default(this);this.statWatchers={};this.props=Object.assign({Node:es.Node,Link:es.Link,File:es.File},$);var ee=this.createLink();ee.setNode(this.createNode(true));var et=this;this.StatWatcher=function($){en(ee,$);function ee(){return $.call(this,et)||this}return ee}(tZ);var eo=tQ;this.ReadStream=function($){en(ee,$);function ee(){var ee=[];for(var en=0;en<arguments.length;en++){ee[en]=arguments[en]}return $.apply(this,ei([et],ee))||this}return ee}(eo);var eu=t6;this.WriteStream=function($){en(ee,$);function ee(){var ee=[];for(var en=0;en<arguments.length;en++){ee[en]=arguments[en]}return $.apply(this,ei([et],ee))||this}return ee}(eu);this.FSWatcher=function($){en(ee,$);function ee(){return $.call(this,et)||this}return ee}(t4);this.root=ee}$.fromJSON=function(ee,et){var en=new $;en.fromJSON(ee,et);return en};Object.defineProperty($.prototype,"promises",{get:function(){if(this.promisesApi===null)throw new Error("Promise is not supported in this environment.");return this.promisesApi},enumerable:true,configurable:true});$.prototype.createLink=function($,ee,et,en){if(et===void 0){et=false}if(!$){return new this.props.Link(this,null,"")}if(!ee){throw new Error("createLink: name cannot be empty")}return $.createChild(ee,this.createNode(et,en))};$.prototype.deleteLink=function($){var ee=$.parent;if(ee){ee.deleteChild($);return true}return false};$.prototype.newInoNumber=function(){var $=this.releasedInos.pop();if($)return $;else{this.ino=(this.ino+1)%4294967295;return this.ino}};$.prototype.newFdNumber=function(){var ee=this.releasedFds.pop();return typeof ee==="number"?ee:$.fd--};$.prototype.createNode=function($,ee){if($===void 0){$=false}var et=new this.props.Node(this.newInoNumber(),ee);if($)et.setIsDirectory();this.inodes[et.ino]=et;return et};$.prototype.getNode=function($){return this.inodes[$]};$.prototype.deleteNode=function($){$.del();delete this.inodes[$.ino];this.releasedInos.push($.ino)};$.prototype.genRndStr=function(){var $=(Math.random()+1).toString(36).substr(2,6);if($.length===6)return $;else return this.genRndStr()};$.prototype.getLink=function($){return this.root.walk($)};$.prototype.getLinkOrThrow=function($,ee){var et=tx($);var en=this.getLink(et);if(!en)throw e4(e$,ee,$);return en};$.prototype.getResolvedLink=function($){var ee=typeof $==="string"?tx($):$;var et=this.root;var en=0;while(en<ee.length){var ei=ee[en];et=et.getChild(ei);if(!et)return null;var eo=et.getNode();if(eo.isSymlink()){ee=eo.symlink.concat(ee.slice(en+1));et=this.root;en=0;continue}en++}return et};$.prototype.getResolvedLinkOrThrow=function($,ee){var et=this.getResolvedLink($);if(!et)throw e4(e$,ee,$);return et};$.prototype.resolveSymlinks=function($){return this.getResolvedLink($.steps.slice(1))};$.prototype.getLinkAsDirOrThrow=function($,ee){var et=this.getLinkOrThrow($,ee);if(!et.getNode().isDirectory())throw e4(eJ,ee,$);return et};$.prototype.getLinkParent=function($){return this.root.walk($,$.length-1)};$.prototype.getLinkParentAsDirOrThrow=function($,ee){var et=$ instanceof Array?$:tx($);var en=this.getLinkParent(et);if(!en)throw e4(e$,ee,eB+et.join(eB));if(!en.getNode().isDirectory())throw e4(eJ,ee,eB+et.join(eB));return en};$.prototype.getFileByFd=function($){return this.fds[String($)]};$.prototype.getFileByFdOrThrow=function($,ee){if(!tz($))throw TypeError(ez.FD);var et=this.getFileByFd($);if(!et)throw e4(eq,ee);return et};$.prototype.getNodeByIdOrCreate=function($,ee,et){if(typeof $==="number"){var en=this.getFileByFd($);if(!en)throw Error("File nto found");return en.node}else{var ei=tP($);var eo=this.getLink(ei);if(eo)return eo.getNode();if(ee&eN){var es=this.getLinkParent(ei);if(es){var eu=ei[ei.length-1];eo=this.createLink(es,eu,false,et);return eo.getNode()}}throw e4(e$,"getNodeByIdOrCreate",tC($))}};$.prototype.wrapAsync=function($,ee,et){var en=this;e7(et);ed.default(function(){try{et(null,$.apply(en,ee))}catch($){et($)}})};$.prototype._toJSON=function($,ee,et){var en;if($===void 0){$=this.root}if(ee===void 0){ee={}}var ei=true;var eo=$.children;if($.getNode().isFile()){eo=(en={},en[$.getName()]=$.parent.getChild($.getName()),en);$=$.parent}for(var es in eo){ei=false;var eu=$.getChild(es);if(!eu){throw new Error("_toJSON: unexpected undefined")}var el=eu.getNode();if(el.isFile()){var ef=eu.getPath();if(et)ef=eU(et,ef);ee[ef]=el.getString()}else if(el.isDirectory()){this._toJSON(eu,ee,et)}}var ed=$.getPath();if(et)ed=eU(et,ed);if(ed&&ei){ee[ed]=null}return ee};$.prototype.toJSON=function($,ee,et){if(ee===void 0){ee={}}if(et===void 0){et=false}var en=[];if($){if(!($ instanceof Array))$=[$];for(var ei=0,eo=$;ei<eo.length;ei++){var es=eo[ei];var eu=tC(es);var el=this.getResolvedLink(eu);if(!el)continue;en.push(el)}}else{en.push(this.root)}if(!en.length)return ee;for(var ef=0,ed=en;ef<ed.length;ef++){var el=ed[ef];this._toJSON(el,ee,et?el.getPath():"")}return ee};$.prototype.fromJSON=function($,ee){if(ee===void 0){ee=ep.default.cwd()}for(var et in $){var en=$[et];if(typeof en==="string"){et=tk(et,ee);var ei=tx(et);if(ei.length>1){var eo=eB+ei.slice(0,ei.length-1).join(eB);this.mkdirpBase(eo,511)}this.writeFileSync(et,en)}else{this.mkdirpBase(et,511)}}};$.prototype.reset=function(){this.ino=0;this.inodes={};this.releasedInos=[];this.fds={};this.releasedFds=[];this.openFiles=0;this.root=this.createLink();this.root.setNode(this.createNode(true))};$.prototype.mountSync=function($,ee){this.fromJSON(ee,$)};$.prototype.openLink=function($,ee,et){if(et===void 0){et=true}if(this.openFiles>=this.maxFiles){throw e4(eX,"open",$.getPath())}var en=$;if(et)en=this.resolveSymlinks($);if(!en)throw e4(e$,"open",$.getPath());var ei=en.getNode();if(ei.isDirectory()){if((ee&(eO|eI|eA))!==eO)throw e4(e0,"open",$.getPath())}else{if(ee&eM)throw e4(eJ,"open",$.getPath())}if(!(ee&eA)){if(!ei.canRead()){throw e4(eQ,"open",$.getPath())}}if(ee&eI){}var eo=new this.props.File($,ei,ee,this.newFdNumber());this.fds[eo.fd]=eo;this.openFiles++;if(ee&eR)eo.truncate();return eo};$.prototype.openFile=function($,ee,et,en){if(en===void 0){en=true}var ei=tx($);var eo=en?this.getResolvedLink(ei):this.getLink(ei);if(!eo&&ee&eN){var es=this.getResolvedLink(ei.slice(0,ei.length-1));if(!es)throw e4(e$,"open",eB+ei.join(eB));if(ee&eN&&typeof et==="number"){eo=this.createLink(es,ei[ei.length-1],false,et)}}if(eo)return this.openLink(eo,ee,en);throw e4(e$,"open",$)};$.prototype.openBase=function($,ee,et,en){if(en===void 0){en=true}var ei=this.openFile($,ee,et,en);if(!ei)throw e4(e$,"open",$);return ei.fd};$.prototype.openSync=function($,ee,et){if(et===void 0){et=438}var en=tH(et);var ei=tC($);var eo=e8(ee);return this.openBase(ei,eo,en)};$.prototype.open=function($,ee,et,en){var ei=et;var eo=en;if(typeof et==="function"){ei=438;eo=et}ei=ei||438;var es=tH(ei);var eu=tC($);var el=e8(ee);this.wrapAsync(this.openBase,[eu,el,es],eo)};$.prototype.closeFile=function($){if(!this.fds[$.fd])return;this.openFiles--;delete this.fds[$.fd];this.releasedFds.push($.fd)};$.prototype.closeSync=function($){tV($);var ee=this.getFileByFdOrThrow($,"close");this.closeFile(ee)};$.prototype.close=function($,ee){tV($);this.wrapAsync(this.closeSync,[$],ee)};$.prototype.openFileOrGetById=function($,ee,et){if(typeof $==="number"){var en=this.fds[$];if(!en)throw e4(e$);return en}else{return this.openFile(tC($),ee,et)}};$.prototype.readBase=function($,ee,et,en,ei){var eo=this.getFileByFdOrThrow($);return eo.read(ee,Number(et),Number(en),ei)};$.prototype.readSync=function($,ee,et,en,ei){tV($);return this.readBase($,ee,et,en,ei)};$.prototype.read=function($,ee,et,en,ei,eo){var es=this;e7(eo);if(en===0){return ep.default.nextTick(function(){if(eo)eo(null,0,ee)})}ed.default(function(){try{var eu=es.readBase($,ee,et,en,ei);eo(null,eu,ee)}catch($){eo($)}})};$.prototype.readFileBase=function($,ee,et){var en;var ei=typeof $==="number";var eo=ei&&tz($);var es;if(eo)es=$;else{var eu=tC($);var el=tx(eu);var ef=this.getResolvedLink(el);if(ef){var ed=ef.getNode();if(ed.isDirectory())throw e4(e0,"open",ef.getPath())}es=this.openSync($,ee)}try{en=tU(this.getFileByFdOrThrow(es).getBuffer(),et)}finally{if(!eo){this.closeSync(es)}}return en};$.prototype.readFileSync=function($,ee){var et=tu(ee);var en=e8(et.flag);return this.readFileBase($,en,et.encoding)};$.prototype.readFile=function($,ee,et){var en=te(tu)(ee,et),ei=en[0],eo=en[1];var es=e8(ei.flag);this.wrapAsync(this.readFileBase,[$,es,ei.encoding],eo)};$.prototype.writeBase=function($,ee,et,en,ei){var eo=this.getFileByFdOrThrow($,"write");return eo.write(ee,et,en,ei)};$.prototype.writeSync=function($,ee,et,en,ei){tV($);var eo;var es;var eu;var el;var ef=typeof ee!=="string";if(ef){es=(et||0)|0;eu=en;el=ei}else{el=et;eo=en}var ed=tB(ee,eo);if(ef){if(typeof eu==="undefined"){eu=ed.length}}else{es=0;eu=ed.length}return this.writeBase($,ed,es,eu,el)};$.prototype.write=function($,ee,et,en,ei,eo){var es=this;tV($);var eu;var el;var ef;var ep;var eh;var ey=typeof ee;var eg=typeof et;var em=typeof en;var e_=typeof ei;if(ey!=="string"){if(eg==="function"){eh=et}else if(em==="function"){eu=et|0;eh=en}else if(e_==="function"){eu=et|0;el=en;eh=ei}else{eu=et|0;el=en;ef=ei;eh=eo}}else{if(eg==="function"){eh=et}else if(em==="function"){ef=et;eh=en}else if(e_==="function"){ef=et;ep=en;eh=ei}}var ew=tB(ee,ep);if(ey!=="string"){if(typeof el==="undefined")el=ew.length}else{eu=0;el=ew.length}var eE=e7(eh);ed.default(function(){try{var et=es.writeBase($,ew,eu,el,ef);if(ey!=="string"){eE(null,et,ew)}else{eE(null,et,ee)}}catch($){eE($)}})};$.prototype.writeFileBase=function($,ee,et,en){var ei=typeof $==="number";var eo;if(ei)eo=$;else{eo=this.openBase(tC($),et,en)}var es=0;var eu=ee.length;var el=et&eC?undefined:0;try{while(eu>0){var ef=this.writeSync(eo,ee,es,eu,el);es+=ef;eu-=ef;if(el!==undefined)el+=ef}}finally{if(!ei)this.closeSync(eo)}};$.prototype.writeFileSync=function($,ee,et){var en=tf(et);var ei=e8(en.flag);var eo=tH(en.mode);var es=tB(ee,en.encoding);this.writeFileBase($,es,ei,eo)};$.prototype.writeFile=function($,ee,et,en){var ei=et;var eo=en;if(typeof et==="function"){ei=tc;eo=et}var es=e7(eo);var eu=tf(ei);var el=e8(eu.flag);var ef=tH(eu.mode);var ed=tB(ee,eu.encoding);this.wrapAsync(this.writeFileBase,[$,ed,el,ef],es)};$.prototype.linkBase=function($,ee){var et=tx($);var en=this.getLink(et);if(!en)throw e4(e$,"link",$,ee);var ei=tx(ee);var eo=this.getLinkParent(ei);if(!eo)throw e4(e$,"link",$,ee);var es=ei[ei.length-1];if(eo.getChild(es))throw e4(eZ,"link",$,ee);var eu=en.getNode();eu.nlink++;eo.createChild(es,eu)};$.prototype.copyFileBase=function($,ee,et){var en=this.readFileSync($);if(et&eP){if(this.existsSync(ee)){throw e4(eZ,"copyFile",$,ee)}}if(et&eF){throw e4(e2,"copyFile",$,ee)}this.writeFileBase(ee,en,e3.w,438)};$.prototype.copyFileSync=function($,ee,et){var en=tC($);var ei=tC(ee);return this.copyFileBase(en,ei,(et||0)|0)};$.prototype.copyFile=function($,ee,et,en){var ei=tC($);var eo=tC(ee);var es;var eu;if(typeof et==="function"){es=0;eu=et}else{es=et;eu=en}e7(eu);this.wrapAsync(this.copyFileBase,[ei,eo,es],eu)};$.prototype.linkSync=function($,ee){var et=tC($);var en=tC(ee);this.linkBase(et,en)};$.prototype.link=function($,ee,et){var en=tC($);var ei=tC(ee);this.wrapAsync(this.linkBase,[en,ei],et)};$.prototype.unlinkBase=function($){var ee=tx($);var et=this.getLink(ee);if(!et)throw e4(e$,"unlink",$);if(et.length)throw Error("Dir not empty...");this.deleteLink(et);var en=et.getNode();en.nlink--;if(en.nlink<=0){this.deleteNode(en)}};$.prototype.unlinkSync=function($){var ee=tC($);this.unlinkBase(ee)};$.prototype.unlink=function($,ee){var et=tC($);this.wrapAsync(this.unlinkBase,[et],ee)};$.prototype.symlinkBase=function($,ee){var et=tx(ee);var en=this.getLinkParent(et);if(!en)throw e4(e$,"symlink",$,ee);var ei=et[et.length-1];if(en.getChild(ei))throw e4(eZ,"symlink",$,ee);var eo=en.createChild(ei);eo.getNode().makeSymlink(tx($));return eo};$.prototype.symlinkSync=function($,ee,et){var en=tC($);var ei=tC(ee);this.symlinkBase(en,ei)};$.prototype.symlink=function($,ee,et,en){var ei=e7(typeof et==="function"?et:en);var eo=tC($);var es=tC(ee);this.wrapAsync(this.symlinkBase,[eo,es],ei)};$.prototype.realpathBase=function($,ee){var et=tx($);var en=this.getResolvedLink(et);if(!en)throw e4(e$,"realpath",$);return e_.strToEncoding(en.getPath(),ee)};$.prototype.realpathSync=function($,ee){return this.realpathBase(tC($),tm(ee).encoding)};$.prototype.realpath=function($,ee,et){var en=t_(ee,et),ei=en[0],eo=en[1];var es=tC($);this.wrapAsync(this.realpathBase,[es,ei.encoding],eo)};$.prototype.lstatBase=function($,ee){if(ee===void 0){ee=false}var et=this.getLink(tx($));if(!et)throw e4(e$,"lstat",$);return eu.default.build(et.getNode(),ee)};$.prototype.lstatSync=function($,ee){return this.lstatBase(tC($),tN(ee).bigint)};$.prototype.lstat=function($,ee,et){var en=tD(ee,et),ei=en[0],eo=en[1];this.wrapAsync(this.lstatBase,[tC($),ei.bigint],eo)};$.prototype.statBase=function($,ee){if(ee===void 0){ee=false}var et=this.getResolvedLink(tx($));if(!et)throw e4(e$,"stat",$);return eu.default.build(et.getNode(),ee)};$.prototype.statSync=function($,ee){return this.statBase(tC($),tN(ee).bigint)};$.prototype.stat=function($,ee,et){var en=tD(ee,et),ei=en[0],eo=en[1];this.wrapAsync(this.statBase,[tC($),ei.bigint],eo)};$.prototype.fstatBase=function($,ee){if(ee===void 0){ee=false}var et=this.getFileByFd($);if(!et)throw e4(eq,"fstat");return eu.default.build(et.node,ee)};$.prototype.fstatSync=function($,ee){return this.fstatBase($,tN(ee).bigint)};$.prototype.fstat=function($,ee,et){var en=tD(ee,et),ei=en[0],eo=en[1];this.wrapAsync(this.fstatBase,[$,ei.bigint],eo)};$.prototype.renameBase=function($,ee){var et=this.getLink(tx($));if(!et)throw e4(e$,"rename",$,ee);var en=tx(ee);var eo=this.getLinkParent(en);if(!eo)throw e4(e$,"rename",$,ee);var es=et.parent;if(es){es.deleteChild(et)}var eu=en[en.length-1];et.steps=ei(eo.steps,[eu]);eo.setChild(et.getName(),et)};$.prototype.renameSync=function($,ee){var et=tC($);var en=tC(ee);this.renameBase(et,en)};$.prototype.rename=function($,ee,et){var en=tC($);var ei=tC(ee);this.wrapAsync(this.renameBase,[en,ei],et)};$.prototype.existsBase=function($){return!!this.statBase($)};$.prototype.existsSync=function($){try{return this.existsBase(tC($))}catch($){return false}};$.prototype.exists=function($,ee){var et=this;var en=tC($);if(typeof ee!=="function")throw Error(ez.CB);ed.default(function(){try{ee(et.existsBase(en))}catch($){ee(false)}})};$.prototype.accessBase=function($,ee){var et=this.getLinkOrThrow($,"access")};$.prototype.accessSync=function($,ee){if(ee===void 0){ee=eL}var et=tC($);ee=ee|0;this.accessBase(et,ee)};$.prototype.access=function($,ee,et){var en=eL;var ei;if(typeof ee!=="function"){en=ee|0;ei=e7(et)}else{ei=ee}var eo=tC($);this.wrapAsync(this.accessBase,[eo,en],ei)};$.prototype.appendFileSync=function($,ee,et){if(et===void 0){et=td}var en=tp(et);if(!en.flag||tz($))en.flag="a";this.writeFileSync($,ee,en)};$.prototype.appendFile=function($,ee,et,en){var ei=th(et,en),eo=ei[0],es=ei[1];if(!eo.flag||tz($))eo.flag="a";this.writeFile($,ee,eo,es)};$.prototype.readdirBase=function($,ee){var et=tx($);var en=this.getResolvedLink(et);if(!en)throw e4(e$,"readdir",$);var ei=en.getNode();if(!ei.isDirectory())throw e4(eJ,"scandir",$);if(ee.withFileTypes){var eo=[];for(var es in en.children){var eu=en.getChild(es);if(!eu){continue}eo.push(el.default.build(eu,ee.encoding))}if(!eW&&ee.encoding!=="buffer")eo.sort(function($,ee){if($.name<ee.name)return-1;if($.name>ee.name)return 1;return 0});return eo}var ef=[];for(var ed in en.children){ef.push(e_.strToEncoding(ed,ee.encoding))}if(!eW&&ee.encoding!=="buffer")ef.sort();return ef};$.prototype.readdirSync=function($,ee){var et=tO(ee);var en=tC($);return this.readdirBase(en,et)};$.prototype.readdir=function($,ee,et){var en=tA(ee,et),ei=en[0],eo=en[1];var es=tC($);this.wrapAsync(this.readdirBase,[es,ei],eo)};$.prototype.readlinkBase=function($,ee){var et=this.getLinkOrThrow($,"readlink");var en=et.getNode();if(!en.isSymlink())throw e4(eG,"readlink",$);var ei=eB+en.symlink.join(eB);return e_.strToEncoding(ei,ee)};$.prototype.readlinkSync=function($,ee){var et=tr(ee);var en=tC($);return this.readlinkBase(en,et.encoding)};$.prototype.readlink=function($,ee,et){var en=tn(ee,et),ei=en[0],eo=en[1];var es=tC($);this.wrapAsync(this.readlinkBase,[es,ei.encoding],eo)};$.prototype.fsyncBase=function($){this.getFileByFdOrThrow($,"fsync")};$.prototype.fsyncSync=function($){this.fsyncBase($)};$.prototype.fsync=function($,ee){this.wrapAsync(this.fsyncBase,[$],ee)};$.prototype.fdatasyncBase=function($){this.getFileByFdOrThrow($,"fdatasync")};$.prototype.fdatasyncSync=function($){this.fdatasyncBase($)};$.prototype.fdatasync=function($,ee){this.wrapAsync(this.fdatasyncBase,[$],ee)};$.prototype.ftruncateBase=function($,ee){var et=this.getFileByFdOrThrow($,"ftruncate");et.truncate(ee)};$.prototype.ftruncateSync=function($,ee){this.ftruncateBase($,ee)};$.prototype.ftruncate=function($,ee,et){var en=typeof ee==="number"?ee:0;var ei=e7(typeof ee==="number"?et:ee);this.wrapAsync(this.ftruncateBase,[$,en],ei)};$.prototype.truncateBase=function($,ee){var et=this.openSync($,"r+");try{this.ftruncateSync(et,ee)}finally{this.closeSync(et)}};$.prototype.truncateSync=function($,ee){if(tz($))return this.ftruncateSync($,ee);this.truncateBase($,ee)};$.prototype.truncate=function($,ee,et){var en=typeof ee==="number"?ee:0;var ei=e7(typeof ee==="number"?et:ee);if(tz($))return this.ftruncate($,en,ei);this.wrapAsync(this.truncateBase,[$,en],ei)};$.prototype.futimesBase=function($,ee,et){var en=this.getFileByFdOrThrow($,"futimes");var ei=en.node;ei.atime=new Date(ee*1e3);ei.mtime=new Date(et*1e3)};$.prototype.futimesSync=function($,ee,et){this.futimesBase($,t$(ee),t$(et))};$.prototype.futimes=function($,ee,et,en){this.wrapAsync(this.futimesBase,[$,t$(ee),t$(et)],en)};$.prototype.utimesBase=function($,ee,et){var en=this.openSync($,"r+");try{this.futimesBase(en,ee,et)}finally{this.closeSync(en)}};$.prototype.utimesSync=function($,ee,et){this.utimesBase(tC($),t$(ee),t$(et))};$.prototype.utimes=function($,ee,et,en){this.wrapAsync(this.utimesBase,[tC($),t$(ee),t$(et)],en)};$.prototype.mkdirBase=function($,ee){var et=tx($);if(!et.length){throw e4(e0,"mkdir",$)}var en=this.getLinkParentAsDirOrThrow($,"mkdir");var ei=et[et.length-1];if(en.getChild(ei))throw e4(eZ,"mkdir",$);en.createChild(ei,this.createNode(true,ee))};$.prototype.mkdirpBase=function($,ee){var et=tx($);var en=this.root;for(var ei=0;ei<et.length;ei++){var eo=et[ei];if(!en.getNode().isDirectory())throw e4(eJ,"mkdir",en.getPath());var es=en.getChild(eo);if(es){if(es.getNode().isDirectory())en=es;else throw e4(eJ,"mkdir",es.getPath())}else{en=en.createChild(eo,this.createNode(true,ee))}}};$.prototype.mkdirSync=function($,ee){var et=tw(ee);var en=tH(et.mode,511);var ei=tC($);if(et.recursive)this.mkdirpBase(ei,en);else this.mkdirBase(ei,en)};$.prototype.mkdir=function($,ee,et){var en=tw(ee);var ei=e7(typeof ee==="function"?ee:et);var eo=tH(en.mode,511);var es=tC($);if(en.recursive)this.wrapAsync(this.mkdirpBase,[es,eo],ei);else this.wrapAsync(this.mkdirBase,[es,eo],ei)};$.prototype.mkdirpSync=function($,ee){this.mkdirSync($,{mode:ee,recursive:true})};$.prototype.mkdirp=function($,ee,et){var en=typeof ee==="function"?undefined:ee;var ei=e7(typeof ee==="function"?ee:et);this.mkdir($,{mode:en,recursive:true},ei)};$.prototype.mkdtempBase=function($,ee,et){if(et===void 0){et=5}var en=$+this.genRndStr();try{this.mkdirBase(en,511);return e_.strToEncoding(en,ee)}catch(en){if(en.code===eZ){if(et>1)return this.mkdtempBase($,ee,et-1);else throw Error("Could not create temp dir.")}else throw en}};$.prototype.mkdtempSync=function($,ee){var et=tr(ee).encoding;if(!$||typeof $!=="string")throw new TypeError("filename prefix is required");tj($);return this.mkdtempBase($,et)};$.prototype.mkdtemp=function($,ee,et){var en=tn(ee,et),ei=en[0].encoding,eo=en[1];if(!$||typeof $!=="string")throw new TypeError("filename prefix is required");if(!tj($))return;this.wrapAsync(this.mkdtempBase,[$,ei],eo)};$.prototype.rmdirBase=function($,ee){var et=tS(ee);var en=this.getLinkAsDirOrThrow($,"rmdir");if(en.length&&!et.recursive)throw e4(e1,"rmdir",$);this.deleteLink(en)};$.prototype.rmdirSync=function($,ee){this.rmdirBase(tC($),ee)};$.prototype.rmdir=function($,ee,et){var en=tS(ee);var ei=e7(typeof ee==="function"?ee:et);this.wrapAsync(this.rmdirBase,[tC($),en],ei)};$.prototype.fchmodBase=function($,ee){var et=this.getFileByFdOrThrow($,"fchmod");et.chmod(ee)};$.prototype.fchmodSync=function($,ee){this.fchmodBase($,tH(ee))};$.prototype.fchmod=function($,ee,et){this.wrapAsync(this.fchmodBase,[$,tH(ee)],et)};$.prototype.chmodBase=function($,ee){var et=this.openSync($,"r+");try{this.fchmodBase(et,ee)}finally{this.closeSync(et)}};$.prototype.chmodSync=function($,ee){var et=tH(ee);var en=tC($);this.chmodBase(en,et)};$.prototype.chmod=function($,ee,et){var en=tH(ee);var ei=tC($);this.wrapAsync(this.chmodBase,[ei,en],et)};$.prototype.lchmodBase=function($,ee){var et=this.openBase($,eI,0,false);try{this.fchmodBase(et,ee)}finally{this.closeSync(et)}};$.prototype.lchmodSync=function($,ee){var et=tH(ee);var en=tC($);this.lchmodBase(en,et)};$.prototype.lchmod=function($,ee,et){var en=tH(ee);var ei=tC($);this.wrapAsync(this.lchmodBase,[ei,en],et)};$.prototype.fchownBase=function($,ee,et){this.getFileByFdOrThrow($,"fchown").chown(ee,et)};$.prototype.fchownSync=function($,ee,et){tq(ee);tG(et);this.fchownBase($,ee,et)};$.prototype.fchown=function($,ee,et,en){tq(ee);tG(et);this.wrapAsync(this.fchownBase,[$,ee,et],en)};$.prototype.chownBase=function($,ee,et){var en=this.getResolvedLinkOrThrow($,"chown");var ei=en.getNode();ei.chown(ee,et)};$.prototype.chownSync=function($,ee,et){tq(ee);tG(et);this.chownBase(tC($),ee,et)};$.prototype.chown=function($,ee,et,en){tq(ee);tG(et);this.wrapAsync(this.chownBase,[tC($),ee,et],en)};$.prototype.lchownBase=function($,ee,et){this.getLinkOrThrow($,"lchown").getNode().chown(ee,et)};$.prototype.lchownSync=function($,ee,et){tq(ee);tG(et);this.lchownBase(tC($),ee,et)};$.prototype.lchown=function($,ee,et,en){tq(ee);tG(et);this.wrapAsync(this.lchownBase,[tC($),ee,et],en)};$.prototype.watchFile=function($,ee,et){var en=tC($);var ei=ee;var eo=et;if(typeof ei==="function"){eo=ee;ei=null}if(typeof eo!=="function"){throw Error('"watchFile()" requires a listener function')}var es=5007;var eu=true;if(ei&&typeof ei==="object"){if(typeof ei.interval==="number")es=ei.interval;if(typeof ei.persistent==="boolean")eu=ei.persistent}var el=this.statWatchers[en];if(!el){el=new this.StatWatcher;el.start(en,eu,es);this.statWatchers[en]=el}el.addListener("change",eo);return el};$.prototype.unwatchFile=function($,ee){var et=tC($);var en=this.statWatchers[et];if(!en)return;if(typeof ee==="function"){en.removeListener("change",ee)}else{en.removeAllListeners("change")}if(en.listenerCount("change")===0){en.stop();delete this.statWatchers[et]}};$.prototype.createReadStream=function($,ee){return new this.ReadStream($,ee)};$.prototype.createWriteStream=function($,ee){return new this.WriteStream($,ee)};$.prototype.watch=function($,ee,et){var en=tC($);var ei=ee;if(typeof ee==="function"){et=ee;ei=null}var eo=tr(ei),es=eo.persistent,eu=eo.recursive,el=eo.encoding;if(es===undefined)es=true;if(eu===undefined)eu=false;var ef=new this.FSWatcher;ef.start(en,es,eu,el);if(et){ef.addListener("change",et)}return ef};$.fd=2147483647;return $}();ee.Volume=tY;function tK($){$.emit("stop")}var tZ=function($){en(ee,$);function ee(ee){var et=$.call(this)||this;et.onInterval=function(){try{var $=et.vol.statSync(et.filename);if(et.hasChanged($)){et.emit("change",$,et.prev);et.prev=$}}finally{et.loop()}};et.vol=ee;return et}ee.prototype.loop=function(){this.timeoutRef=this.setTimeout(this.onInterval,this.interval)};ee.prototype.hasChanged=function($){if($.mtimeMs>this.prev.mtimeMs)return true;if($.nlink!==this.prev.nlink)return true;return false};ee.prototype.start=function($,ee,et){if(ee===void 0){ee=true}if(et===void 0){et=5007}this.filename=tC($);this.setTimeout=ee?setTimeout:eh.default;this.interval=et;this.prev=this.vol.statSync(this.filename);this.loop()};ee.prototype.stop=function(){clearTimeout(this.timeoutRef);ep.default.nextTick(tK,this)};return ee}(em.EventEmitter);ee.StatWatcher=tZ;var tJ;function tX($){tJ=ef.bufferAllocUnsafe($);tJ.used=0}eE.inherits(tQ,ey.Readable);ee.ReadStream=tQ;function tQ($,ee,et){if(!(this instanceof tQ))return new tQ($,ee,et);this._vol=$;et=Object.assign({},e5(et,{}));if(et.highWaterMark===undefined)et.highWaterMark=64*1024;ey.Readable.call(this,et);this.path=tC(ee);this.fd=et.fd===undefined?null:et.fd;this.flags=et.flags===undefined?"r":et.flags;this.mode=et.mode===undefined?438:et.mode;this.start=et.start;this.end=et.end;this.autoClose=et.autoClose===undefined?true:et.autoClose;this.pos=undefined;this.bytesRead=0;if(this.start!==undefined){if(typeof this.start!=="number"){throw new TypeError('"start" option must be a Number')}if(this.end===undefined){this.end=Infinity}else if(typeof this.end!=="number"){throw new TypeError('"end" option must be a Number')}if(this.start>this.end){throw new Error('"start" option must be <= "end" option')}this.pos=this.start}if(typeof this.fd!=="number")this.open();this.on("end",function(){if(this.autoClose){if(this.destroy)this.destroy()}})}tQ.prototype.open=function(){var $=this;this._vol.open(this.path,this.flags,this.mode,function(ee,et){if(ee){if($.autoClose){if($.destroy)$.destroy()}$.emit("error",ee);return}$.fd=et;$.emit("open",et);$.read()})};tQ.prototype._read=function($){if(typeof this.fd!=="number"){return this.once("open",function(){this._read($)})}if(this.destroyed)return;if(!tJ||tJ.length-tJ.used<eH){tX(this._readableState.highWaterMark)}var ee=tJ;var et=Math.min(tJ.length-tJ.used,$);var en=tJ.used;if(this.pos!==undefined)et=Math.min(this.end-this.pos+1,et);if(et<=0)return this.push(null);var ei=this;this._vol.read(this.fd,tJ,tJ.used,et,this.pos,eo);if(this.pos!==undefined)this.pos+=et;tJ.used+=et;function eo($,et){if($){if(ei.autoClose&&ei.destroy){ei.destroy()}ei.emit("error",$)}else{var eo=null;if(et>0){ei.bytesRead+=et;eo=ee.slice(en,en+et)}ei.push(eo)}}};tQ.prototype._destroy=function($,ee){this.close(function(et){ee($||et)})};tQ.prototype.close=function($){var ee=this;if($)this.once("close",$);if(this.closed||typeof this.fd!=="number"){if(typeof this.fd!=="number"){this.once("open",t0);return}return ep.default.nextTick(function(){return ee.emit("close")})}this.closed=true;this._vol.close(this.fd,function($){if($)ee.emit("error",$);else ee.emit("close")});this.fd=null};function t0($){this.close()}eE.inherits(t6,ey.Writable);ee.WriteStream=t6;function t6($,ee,et){if(!(this instanceof t6))return new t6($,ee,et);this._vol=$;et=Object.assign({},e5(et,{}));ey.Writable.call(this,et);this.path=tC(ee);this.fd=et.fd===undefined?null:et.fd;this.flags=et.flags===undefined?"w":et.flags;this.mode=et.mode===undefined?438:et.mode;this.start=et.start;this.autoClose=et.autoClose===undefined?true:!!et.autoClose;this.pos=undefined;this.bytesWritten=0;if(this.start!==undefined){if(typeof this.start!=="number"){throw new TypeError('"start" option must be a Number')}if(this.start<0){throw new Error('"start" must be >= zero')}this.pos=this.start}if(et.encoding)this.setDefaultEncoding(et.encoding);if(typeof this.fd!=="number")this.open();this.once("finish",function(){if(this.autoClose){this.close()}})}t6.prototype.open=function(){this._vol.open(this.path,this.flags,this.mode,(function($,ee){if($){if(this.autoClose&&this.destroy){this.destroy()}this.emit("error",$);return}this.fd=ee;this.emit("open",ee)}).bind(this))};t6.prototype._write=function($,ee,et){if(!($ instanceof ef.Buffer))return this.emit("error",new Error("Invalid data"));if(typeof this.fd!=="number"){return this.once("open",function(){this._write($,ee,et)})}var en=this;this._vol.write(this.fd,$,0,$.length,this.pos,function($,ee){if($){if(en.autoClose&&en.destroy){en.destroy()}return et($)}en.bytesWritten+=ee;et()});if(this.pos!==undefined)this.pos+=$.length};t6.prototype._writev=function($,ee){if(typeof this.fd!=="number"){return this.once("open",function(){this._writev($,ee)})}var et=this;var en=$.length;var ei=new Array(en);var eo=0;for(var es=0;es<en;es++){var eu=$[es].chunk;ei[es]=eu;eo+=eu.length}var el=ef.Buffer.concat(ei);this._vol.write(this.fd,el,0,el.length,this.pos,function($,en){if($){if(et.destroy)et.destroy();return ee($)}et.bytesWritten+=en;ee()});if(this.pos!==undefined)this.pos+=eo};t6.prototype._destroy=tQ.prototype._destroy;t6.prototype.close=tQ.prototype.close;t6.prototype.destroySoon=t6.prototype.end;var t4=function($){en(ee,$);function ee(ee){var et=$.call(this)||this;et._filename="";et._filenameEncoded="";et._recursive=false;et._encoding=e_.ENCODING_UTF8;et._onNodeChange=function(){et._emit("change")};et._onParentChild=function($){if($.getName()===et._getName()){et._emit("rename")}};et._emit=function($){et.emit("change",$,et._filenameEncoded)};et._persist=function(){et._timer=setTimeout(et._persist,1e6)};et._vol=ee;return et}ee.prototype._getName=function(){return this._steps[this._steps.length-1]};ee.prototype.start=function($,ee,et,en){if(ee===void 0){ee=true}if(et===void 0){et=false}if(en===void 0){en=e_.ENCODING_UTF8}this._filename=tC($);this._steps=tx(this._filename);this._filenameEncoded=e_.strToEncoding(this._filename);this._recursive=et;this._encoding=en;try{this._link=this._vol.getLinkOrThrow(this._filename,"FSWatcher")}catch($){var ei=new Error("watch "+this._filename+" "+$.code);ei.code=$.code;ei.errno=$.code;throw ei}this._link.getNode().on("change",this._onNodeChange);this._link.on("child:add",this._onNodeChange);this._link.on("child:delete",this._onNodeChange);var eo=this._link.parent;if(eo){eo.setMaxListeners(eo.getMaxListeners()+1);eo.on("child:delete",this._onParentChild)}if(ee)this._persist()};ee.prototype.close=function(){clearTimeout(this._timer);this._link.getNode().removeListener("change",this._onNodeChange);var $=this._link.parent;if($){$.removeListener("child:delete",this._onParentChild)}};return ee}(em.EventEmitter);ee.FSWatcher=t4},8012:($,ee,et)=>{"use strict";var en;var ei=et(4155);en={value:true};ee.Z4=ef;en=ed;var eo=ei.platform==="win32";function es($){var ee=$.length-1;if(ee<2){return $}while(eu($,ee)){ee--}return $.substr(0,ee+1)}function eu($,ee){var et=$[ee];return ee>0&&(et==="/"||eo&&et==="\\")}function el($,ee){if(typeof $!=="string"){throw new TypeError("expected a string")}$=$.replace(/[\\\/]+/g,"/");if(ee!==false){$=es($)}return $}function ef($){var ee=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;if(eo){$=el($,ee);return $.replace(/^([a-zA-Z]+:|\.\/)/,"")}return $}function ed($){return ef($.replace(/^\\\\\?\\.:\\/,"\\"))}},4657:($,ee)=>{"use strict";Object.defineProperty(ee,"__esModule",{value:true});var et=ee.fsProps=["constants","F_OK","R_OK","W_OK","X_OK","Stats"];var en=ee.fsSyncMethods=["renameSync","ftruncateSync","truncateSync","chownSync","fchownSync","lchownSync","chmodSync","fchmodSync","lchmodSync","statSync","lstatSync","fstatSync","linkSync","symlinkSync","readlinkSync","realpathSync","unlinkSync","rmdirSync","mkdirSync","mkdirpSync","readdirSync","closeSync","openSync","utimesSync","futimesSync","fsyncSync","writeSync","readSync","readFileSync","writeFileSync","appendFileSync","existsSync","accessSync","fdatasyncSync","mkdtempSync","copyFileSync","createReadStream","createWriteStream"];var ei=ee.fsAsyncMethods=["rename","ftruncate","truncate","chown","fchown","lchown","chmod","fchmod","lchmod","stat","lstat","fstat","link","symlink","readlink","realpath","unlink","rmdir","mkdir","mkdirp","readdir","close","open","utimes","futimes","fsync","write","read","readFile","writeFile","appendFile","exists","access","fdatasync","mkdtemp","copyFile","watchFile","unwatchFile","watch"]},8053:$=>{(function(){const ee=this;const et=$=>new TextEncoder().encode($);function en($,ee){if(typeof $==="string")$=et($);let en=$.length,ei=ee^en,eo=0,es;while(en>=4){es=$[eo]&255|($[++eo]&255)<<8|($[++eo]&255)<<16|($[++eo]&255)<<24;es=(es&65535)*1540483477+(((es>>>16)*1540483477&65535)<<16);es^=es>>>24;es=(es&65535)*1540483477+(((es>>>16)*1540483477&65535)<<16);ei=(ei&65535)*1540483477+(((ei>>>16)*1540483477&65535)<<16)^es;en-=4;++eo}switch(en){case 3:ei^=($[eo+2]&255)<<16;case 2:ei^=($[eo+1]&255)<<8;case 1:ei^=$[eo]&255;ei=(ei&65535)*1540483477+(((ei>>>16)*1540483477&65535)<<16)}ei^=ei>>>13;ei=(ei&65535)*1540483477+(((ei>>>16)*1540483477&65535)<<16);ei^=ei>>>15;return ei>>>0};function ei($,ee){if(typeof $==="string")$=et($);let en,ei,eo,es,eu,el,ef,ed,ep,eh;en=$.length&3;ei=$.length-en;eo=ee;eu=3432918353;ef=461845907;eh=0;while(eh<ei){ep=$[eh]&255|($[++eh]&255)<<8|($[++eh]&255)<<16|($[++eh]&255)<<24;++eh;ep=(ep&65535)*eu+(((ep>>>16)*eu&65535)<<16)&4294967295;ep=ep<<15|ep>>>17;ep=(ep&65535)*ef+(((ep>>>16)*ef&65535)<<16)&4294967295;eo^=ep;eo=eo<<13|eo>>>19;es=(eo&65535)*5+(((eo>>>16)*5&65535)<<16)&4294967295;eo=(es&65535)+27492+(((es>>>16)+58964&65535)<<16)}ep=0;switch(en){case 3:ep^=($[eh+2]&255)<<16;case 2:ep^=($[eh+1]&255)<<8;case 1:ep^=$[eh]&255;ep=(ep&65535)*eu+(((ep>>>16)*eu&65535)<<16)&4294967295;ep=ep<<15|ep>>>17;ep=(ep&65535)*ef+(((ep>>>16)*ef&65535)<<16)&4294967295;eo^=ep}eo^=$.length;eo^=eo>>>16;eo=(eo&65535)*2246822507+(((eo>>>16)*2246822507&65535)<<16)&4294967295;eo^=eo>>>13;eo=(eo&65535)*3266489909+(((eo>>>16)*3266489909&65535)<<16)&4294967295;eo^=eo>>>16;return eo>>>0}const eo=ei;eo.v2=en;eo.v3=ei;if(true){$.exports=eo}else{}})()},631:($,ee,et)=>{var en=typeof Map==="function"&&Map.prototype;var ei=Object.getOwnPropertyDescriptor&&en?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null;var eo=en&&ei&&typeof ei.get==="function"?ei.get:null;var es=en&&Map.prototype.forEach;var eu=typeof Set==="function"&&Set.prototype;var el=Object.getOwnPropertyDescriptor&&eu?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null;var ef=eu&&el&&typeof el.get==="function"?el.get:null;var ed=eu&&Set.prototype.forEach;var ep=typeof WeakMap==="function"&&WeakMap.prototype;var eh=ep?WeakMap.prototype.has:null;var ey=typeof WeakSet==="function"&&WeakSet.prototype;var eg=ey?WeakSet.prototype.has:null;var em=typeof WeakRef==="function"&&WeakRef.prototype;var e_=em?WeakRef.prototype.deref:null;var ew=Boolean.prototype.valueOf;var eE=Object.prototype.toString;var eS=Function.prototype.toString;var eT=String.prototype.match;var eO=String.prototype.slice;var eA=String.prototype.replace;var eI=String.prototype.toUpperCase;var eN=String.prototype.toLowerCase;var eD=RegExp.prototype.test;var eR=Array.prototype.concat;var eC=Array.prototype.join;var ek=Array.prototype.slice;var eM=Math.floor;var eL=typeof BigInt==="function"?BigInt.prototype.valueOf:null;var eP=Object.getOwnPropertySymbols;var eF=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?Symbol.prototype.toString:null;var eB=typeof Symbol==="function"&&typeof Symbol.iterator==="object";var eU=typeof Symbol==="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===eB?"object":"symbol")?Symbol.toStringTag:null;var ej=Object.prototype.propertyIsEnumerable;var eW=(typeof Reflect==="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function($){return $.__proto__}:null);function eH($,ee){if($===Infinity||$===-Infinity||$!==$||$&&$>-1e3&&$<1e3||eD.call(/e/,ee)){return ee}var et=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof $==="number"){var en=$<0?-eM(-$):eM($);if(en!==$){var ei=String(en);var eo=eO.call(ee,ei.length+1);return eA.call(ei,et,"$&_")+"."+eA.call(eA.call(eo,/([0-9]{3})/g,"$&_"),/_$/,"")}}return eA.call(ee,et,"$&_")}var ez=et(4654);var eV=ez.custom;var e$=e1(eV)?eV:null;$.exports=function $(ee,et,en,ei){var eu=et||{};if(e4(eu,"quoteStyle")&&eu.quoteStyle!=="single"&&eu.quoteStyle!=="double"){throw new TypeError('option "quoteStyle" must be "single" or "double"')}if(e4(eu,"maxStringLength")&&(typeof eu.maxStringLength==="number"?eu.maxStringLength<0&&eu.maxStringLength!==Infinity:eu.maxStringLength!==null)){throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`')}var el=e4(eu,"customInspect")?eu.customInspect:true;if(typeof el!=="boolean"&&el!=="symbol"){throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`")}if(e4(eu,"indent")&&eu.indent!==null&&eu.indent!==" "&&!(parseInt(eu.indent,10)===eu.indent&&eu.indent>0)){throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`')}if(e4(eu,"numericSeparator")&&typeof eu.numericSeparator!=="boolean"){throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`')}var ep=eu.numericSeparator;if(typeof ee==="undefined"){return"undefined"}if(ee===null){return"null"}if(typeof ee==="boolean"){return ee?"true":"false"}if(typeof ee==="string"){return ti(ee,eu)}if(typeof ee==="number"){if(ee===0){return Infinity/ee>0?"0":"-0"}var eh=String(ee);return ep?eH(ee,eh):eh}if(typeof ee==="bigint"){var ey=String(ee)+"n";return ep?eH(ee,ey):ey}var eg=typeof eu.depth==="undefined"?5:eu.depth;if(typeof en==="undefined"){en=0}if(en>=eg&&eg>0&&typeof ee==="object"){return eY(ee)?"[Array]":"[Object]"}var em=th(eu,en);if(typeof ei==="undefined"){ei=[]}else if(e5(ei,ee)>=0){return"[Circular]"}function e_(ee,et,eo){if(et){ei=ek.call(ei);ei.push(et)}if(eo){var es={depth:eu.depth};if(e4(eu,"quoteStyle")){es.quoteStyle=eu.quoteStyle}return $(ee,es,en+1,ei)}return $(ee,eu,en+1,ei)}if(typeof ee==="function"&&!eZ(ee)){var eE=e8(ee);var eS=tm(ee,e_);return"[Function"+(eE?": "+eE:" (anonymous)")+"]"+(eS.length>0?" { "+eC.call(eS,", ")+" }":"")}if(e1(ee)){var eT=eB?eA.call(String(ee),/^(Symbol\(.*\))_[^)]*$/,"$1"):eF.call(ee);return typeof ee==="object"&&!eB?tc(eT):eT}if(tn(ee)){var eI="<"+eN.call(String(ee.nodeName));var eD=ee.attributes||[];for(var eM=0;eM<eD.length;eM++){eI+=" "+eD[eM].name+"="+eq(eG(eD[eM].value),"double",eu)}eI+=">";if(ee.childNodes&&ee.childNodes.length){eI+="..."}eI+="</"+eN.call(String(ee.nodeName))+">";return eI}if(eY(ee)){if(ee.length===0){return"[]"}var eP=tm(ee,e_);if(em&&!tp(eP)){return"["+ty(eP,em)+"]"}return"[ "+eC.call(eP,", ")+" ]"}if(eJ(ee)){var eV=tm(ee,e_);if(!("cause"in Error.prototype)&&"cause"in ee&&!ej.call(ee,"cause")){return"{ ["+String(ee)+"] "+eC.call(eR.call("[cause]: "+e_(ee.cause),eV),", ")+" }"}if(eV.length===0){return"["+String(ee)+"]"}return"{ ["+String(ee)+"] "+eC.call(eV,", ")+" }"}if(typeof ee==="object"&&el){if(e$&&typeof ee[e$]==="function"&&ez){return ez(ee,{depth:eg-en})}else if(el!=="symbol"&&typeof ee.inspect==="function"){return ee.inspect()}}if(e9(ee)){var e6=[];if(es){es.call(ee,function($,et){e6.push(e_(et,ee,true)+" => "+e_($,ee))})}return td("Map",eo.call(ee),e6,em)}if(tt(ee)){var tu=[];if(ed){ed.call(ee,function($){tu.push(e_($,ee))})}return td("Set",ef.call(ee),tu,em)}if(e7(ee)){return tf("WeakMap")}if(tr(ee)){return tf("WeakSet")}if(te(ee)){return tf("WeakRef")}if(eQ(ee)){return tc(e_(Number(ee)))}if(e2(ee)){return tc(e_(eL.call(ee)))}if(e0(ee)){return tc(ew.call(ee))}if(eX(ee)){return tc(e_(String(ee)))}if(!eK(ee)&&!eZ(ee)){var t_=tm(ee,e_);var tv=eW?eW(ee)===Object.prototype:ee instanceof Object||ee.constructor===Object;var tw=ee instanceof Object?"":"null prototype";var tE=!tv&&eU&&Object(ee)===ee&&eU in ee?eO.call(e3(ee),8,-1):tw?"Object":"";var tS=tv||typeof ee.constructor!=="function"?"":ee.constructor.name?ee.constructor.name+" ":"";var tT=tS+(tE||tw?"["+eC.call(eR.call([],tE||[],tw||[]),": ")+"] ":"");if(t_.length===0){return tT+"{}"}if(em){return tT+"{"+ty(t_,em)+"}"}return tT+"{ "+eC.call(t_,", ")+" }"}return String(ee)};function eq($,ee,et){var en=(et.quoteStyle||ee)==="double"?'"':"'";return en+$+en}function eG($){return eA.call(String($),/"/g,"&quot;")}function eY($){return e3($)==="[object Array]"&&(!eU||!(typeof $==="object"&&eU in $))}function eK($){return e3($)==="[object Date]"&&(!eU||!(typeof $==="object"&&eU in $))}function eZ($){return e3($)==="[object RegExp]"&&(!eU||!(typeof $==="object"&&eU in $))}function eJ($){return e3($)==="[object Error]"&&(!eU||!(typeof $==="object"&&eU in $))}function eX($){return e3($)==="[object String]"&&(!eU||!(typeof $==="object"&&eU in $))}function eQ($){return e3($)==="[object Number]"&&(!eU||!(typeof $==="object"&&eU in $))}function e0($){return e3($)==="[object Boolean]"&&(!eU||!(typeof $==="object"&&eU in $))}function e1($){if(eB){return $&&typeof $==="object"&&$ instanceof Symbol}if(typeof $==="symbol"){return true}if(!$||typeof $!=="object"||!eF){return false}try{eF.call($);return true}catch($){}return false}function e2($){if(!$||typeof $!=="object"||!eL){return false}try{eL.call($);return true}catch($){}return false}var e6=Object.prototype.hasOwnProperty||function($){return $ in this};function e4($,ee){return e6.call($,ee)}function e3($){return eE.call($)}function e8($){if($.name){return $.name}var ee=eT.call(eS.call($),/^function\s*([\w$]+)/);if(ee){return ee[1]}return null}function e5($,ee){if($.indexOf){return $.indexOf(ee)}for(var et=0,en=$.length;et<en;et++){if($[et]===ee){return et}}return-1}function e9($){if(!eo||!$||typeof $!=="object"){return false}try{eo.call($);try{ef.call($)}catch($){return true}return $ instanceof Map}catch($){}return false}function e7($){if(!eh||!$||typeof $!=="object"){return false}try{eh.call($,eh);try{eg.call($,eg)}catch($){return true}return $ instanceof WeakMap}catch($){}return false}function te($){if(!e_||!$||typeof $!=="object"){return false}try{e_.call($);return true}catch($){}return false}function tt($){if(!ef||!$||typeof $!=="object"){return false}try{ef.call($);try{eo.call($)}catch($){return true}return $ instanceof Set}catch($){}return false}function tr($){if(!eg||!$||typeof $!=="object"){return false}try{eg.call($,eg);try{eh.call($,eh)}catch($){return true}return $ instanceof WeakSet}catch($){}return false}function tn($){if(!$||typeof $!=="object"){return false}if(typeof HTMLElement!=="undefined"&&$ instanceof HTMLElement){return true}return typeof $.nodeName==="string"&&typeof $.getAttribute==="function"}function ti($,ee){if($.length>ee.maxStringLength){var et=$.length-ee.maxStringLength;var en="... "+et+" more character"+(et>1?"s":"");return ti(eO.call($,0,ee.maxStringLength),ee)+en}var ei=eA.call(eA.call($,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,tu);return eq(ei,"single",ee)}function tu($){var ee=$.charCodeAt(0);var et={8:"b",9:"t",10:"n",12:"f",13:"r"}[ee];if(et){return"\\"+et}return"\\x"+(ee<16?"0":"")+eI.call(ee.toString(16))}function tc($){return"Object("+$+")"}function tf($){return $+" { ? }"}function td($,ee,et,en){var ei=en?ty(et,en):eC.call(et,", ");return $+" ("+ee+") {"+ei+"}"}function tp($){for(var ee=0;ee<$.length;ee++){if(e5($[ee],"\n")>=0){return false}}return true}function th($,ee){var et;if($.indent===" "){et=" "}else if(typeof $.indent==="number"&&$.indent>0){et=eC.call(Array($.indent+1)," ")}else{return null}return{base:et,prev:eC.call(Array(ee+1),et)}}function ty($,ee){if($.length===0){return""}var et="\n"+ee.prev+ee.base;return et+eC.call($,","+et)+"\n"+ee.prev}function tm($,ee){var et=eY($);var en=[];if(et){en.length=$.length;for(var ei=0;ei<$.length;ei++){en[ei]=e4($,ei)?ee($[ei],$):""}}var eo=typeof eP==="function"?eP($):[];var es;if(eB){es={};for(var eu=0;eu<eo.length;eu++){es["$"+eo[eu]]=eo[eu]}}for(var el in $){if(!e4($,el)){continue}if(et&&String(Number(el))===el&&el<$.length){continue}if(eB&&es["$"+el]instanceof Symbol){continue}else if(eD.call(/[^\w$]/,el)){en.push(ee(el,$)+": "+ee($[el],$))}else{en.push(el+": "+ee($[el],$))}}if(typeof eP==="function"){for(var ef=0;ef<eo.length;ef++){if(ej.call($,eo[ef])){en.push("["+ee(eo[ef])+"]: "+ee($[eo[ef]],$))}}}return en}},4244:$=>{"use strict";var ee=function($){return $!==$};$.exports=function $($,et){if($===0&&et===0){return 1/$===1/et}if($===et){return true}if(ee($)&&ee(et)){return true}return false}},609:($,ee,et)=>{"use strict";var en=et(4289);var ei=et(5559);var eo=et(4244);var es=et(5624);var eu=et(2281);var el=ei(es(),Object);en(el,{getPolyfill:es,implementation:eo,shim:eu});$.exports=el},5624:($,ee,et)=>{"use strict";var en=et(4244);$.exports=function $(){return typeof Object.is==="function"?Object.is:en}},2281:($,ee,et)=>{"use strict";var en=et(5624);var ei=et(4289);$.exports=function $(){var $=en();ei(Object,{is:$},{is:function ee(){return Object.is!==$}});return $}},8987:($,ee,et)=>{"use strict";var en;if(!Object.keys){var ei=Object.prototype.hasOwnProperty;var eo=Object.prototype.toString;var es=et(1414);var eu=Object.prototype.propertyIsEnumerable;var el=!eu.call({toString:null},"toString");var ef=eu.call(function(){},"prototype");var ed=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"];var ep=function($){var ee=$.constructor;return ee&&ee.prototype===$};var eh={$applicationCache:true,$console:true,$external:true,$frame:true,$frameElement:true,$frames:true,$innerHeight:true,$innerWidth:true,$onmozfullscreenchange:true,$onmozfullscreenerror:true,$outerHeight:true,$outerWidth:true,$pageXOffset:true,$pageYOffset:true,$parent:true,$scrollLeft:true,$scrollTop:true,$scrollX:true,$scrollY:true,$self:true,$webkitIndexedDB:true,$webkitStorageInfo:true,$window:true};var ey=function(){if(typeof window==="undefined"){return false}for(var $ in window){try{if(!eh["$"+$]&&ei.call(window,$)&&window[$]!==null&&typeof window[$]==="object"){try{ep(window[$])}catch($){return true}}}catch($){return true}}return false}();var eg=function($){if(typeof window==="undefined"||!ey){return ep($)}try{return ep($)}catch($){return false}};en=function $($){var ee=$!==null&&typeof $==="object";var et=eo.call($)==="[object Function]";var en=es($);var eu=ee&&eo.call($)==="[object String]";var ep=[];if(!ee&&!et&&!en){throw new TypeError("Object.keys called on a non-object")}var eh=ef&&et;if(eu&&$.length>0&&!ei.call($,0)){for(var ey=0;ey<$.length;++ey){ep.push(String(ey))}}if(en&&$.length>0){for(var em=0;em<$.length;++em){ep.push(String(em))}}else{for(var e_ in $){if(!(eh&&e_==="prototype")&&ei.call($,e_)){ep.push(String(e_))}}}if(el){var ew=eg($);for(var eE=0;eE<ed.length;++eE){if(!(ew&&ed[eE]==="constructor")&&ei.call($,ed[eE])){ep.push(ed[eE])}}}return ep}}$.exports=en},2215:($,ee,et)=>{"use strict";var en=Array.prototype.slice;var ei=et(1414);var eo=Object.keys;var es=eo?function $($){return eo($)}:et(8987);var eu=Object.keys;es.shim=function $(){if(Object.keys){var $=function(){var $=Object.keys(arguments);return $&&$.length===arguments.length}(1,2);if(!$){Object.keys=function $($){if(ei($)){return eu(en.call($))}return eu($)}}}else{Object.keys=es}return Object.keys||es};$.exports=es},1414:$=>{"use strict";var ee=Object.prototype.toString;$.exports=function $($){var et=ee.call($);var en=et==="[object Arguments]";if(!en){en=et!=="[object Array]"&&$!==null&&typeof $==="object"&&typeof $.length==="number"&&$.length>=0&&ee.call($.callee)==="[object Function]"}return en}},2837:($,ee,et)=>{"use strict";var en=et(2215);var ei=et(5419)();var eo=et(1924);var es=Object;var eu=eo("Array.prototype.push");var el=eo("Object.prototype.propertyIsEnumerable");var ef=ei?Object.getOwnPropertySymbols:null;$.exports=function $($,ee){if($==null){throw new TypeError("target must be an object")}var et=es($);if(arguments.length===1){return et}for(var eo=1;eo<arguments.length;++eo){var ed=es(arguments[eo]);var ep=en(ed);var eh=ei&&(Object.getOwnPropertySymbols||ef);if(eh){var ey=eh(ed);for(var eg=0;eg<ey.length;++eg){var em=ey[eg];if(el(ed,em)){eu(ep,em)}}}for(var e_=0;e_<ep.length;++e_){var ew=ep[e_];if(el(ed,ew)){var eE=ed[ew];et[ew]=eE}}}return et}},3533:($,ee,et)=>{"use strict";var en=et(4289);var ei=et(5559);var eo=et(2837);var es=et(8162);var eu=et(4489);var el=ei.apply(es());var ef=function $($,ee){return el(Object,arguments)};en(ef,{getPolyfill:es,implementation:eo,shim:eu});$.exports=ef},8162:($,ee,et)=>{"use strict";var en=et(2837);var ei=function(){if(!Object.assign){return false}var $="abcdefghijklmnopqrst";var ee=$.split("");var et={};for(var en=0;en<ee.length;++en){et[ee[en]]=ee[en]}var ei=Object.assign({},et);var eo="";for(var es in ei){eo+=es}return $!==eo};var eo=function(){if(!Object.assign||!Object.preventExtensions){return false}var $=Object.preventExtensions({1:2});try{Object.assign($,"xy")}catch(ee){return $[1]==="y"}return false};$.exports=function $(){if(!Object.assign){return en}if(ei()){return en}if(eo()){return en}return Object.assign}},4489:($,ee,et)=>{"use strict";var en=et(4289);var ei=et(8162);$.exports=function $(){var $=ei();en(Object,{assign:$},{assign:function(){return Object.assign!==$}});return $}},4236:($,ee)=>{"use strict";var et=typeof Uint8Array!=="undefined"&&typeof Uint16Array!=="undefined"&&typeof Int32Array!=="undefined";function en($,ee){return Object.prototype.hasOwnProperty.call($,ee)}ee.assign=function($){var ee=Array.prototype.slice.call(arguments,1);while(ee.length){var et=ee.shift();if(!et){continue}if(typeof et!=="object"){throw new TypeError(et+"must be non-object")}for(var ei in et){if(en(et,ei)){$[ei]=et[ei]}}}return $};ee.shrinkBuf=function($,ee){if($.length===ee){return $}if($.subarray){return $.subarray(0,ee)}$.length=ee;return $};var ei={arraySet:function($,ee,et,en,ei){if(ee.subarray&&$.subarray){$.set(ee.subarray(et,et+en),ei);return}for(var eo=0;eo<en;eo++){$[ei+eo]=ee[et+eo]}},flattenChunks:function($){var ee,et,en,ei,eo,es;en=0;for(ee=0,et=$.length;ee<et;ee++){en+=$[ee].length}es=new Uint8Array(en);ei=0;for(ee=0,et=$.length;ee<et;ee++){eo=$[ee];es.set(eo,ei);ei+=eo.length}return es}};var eo={arraySet:function($,ee,et,en,ei){for(var eo=0;eo<en;eo++){$[ei+eo]=ee[et+eo]}},flattenChunks:function($){return[].concat.apply([],$)}};ee.setTyped=function($){if($){ee.Buf8=Uint8Array;ee.Buf16=Uint16Array;ee.Buf32=Int32Array;ee.assign(ee,ei)}else{ee.Buf8=Array;ee.Buf16=Array;ee.Buf32=Array;ee.assign(ee,eo)}};ee.setTyped(et)},6069:$=>{"use strict";function ee($,ee,et,en){var ei=$&65535|0,eo=$>>>16&65535|0,es=0;while(et!==0){es=et>2e3?2e3:et;et-=es;do{ei=ei+ee[en++]|0;eo=eo+ei|0}while(--es)ei%=65521;eo%=65521}return ei|eo<<16|0}$.exports=ee},1619:$=>{"use strict";$.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},2869:$=>{"use strict";function ee(){var $,ee=[];for(var et=0;et<256;et++){$=et;for(var en=0;en<8;en++){$=$&1?3988292384^$>>>1:$>>>1}ee[et]=$}return ee}var et=ee();function en($,ee,en,ei){var eo=et,es=ei+en;$^=-1;for(var eu=ei;eu<es;eu++){$=$>>>8^eo[($^ee[eu])&255]}return $^-1}$.exports=en},405:($,ee,et)=>{"use strict";var en=et(4236);var ei=et(342);var eo=et(6069);var es=et(2869);var eu=et(8898);var el=0;var ef=1;var ed=3;var ep=4;var eh=5;var ey=0;var eg=1;var em=-2;var e_=-3;var ew=-5;var eE=-1;var eS=1;var eT=2;var eO=3;var eA=4;var eI=0;var eN=2;var eD=8;var eR=9;var eC=15;var ek=8;var eM=29;var eL=256;var eP=eL+1+eM;var eF=30;var eB=19;var eU=2*eP+1;var ej=15;var eW=3;var eH=258;var ez=eH+eW+1;var eV=32;var e$=42;var eq=69;var eG=73;var eY=91;var eK=103;var eZ=113;var eJ=666;var eX=1;var eQ=2;var e0=3;var e1=4;var e2=3;function e6($,ee){$.msg=eu[ee];return ee}function e4($){return($<<1)-($>4?9:0)}function e3($){var ee=$.length;while(--ee>=0){$[ee]=0}}function e8($){var ee=$.state;var et=ee.pending;if(et>$.avail_out){et=$.avail_out}if(et===0){return}en.arraySet($.output,ee.pending_buf,ee.pending_out,et,$.next_out);$.next_out+=et;ee.pending_out+=et;$.total_out+=et;$.avail_out-=et;ee.pending-=et;if(ee.pending===0){ee.pending_out=0}}function e5($,ee){ei._tr_flush_block($,$.block_start>=0?$.block_start:-1,$.strstart-$.block_start,ee);$.block_start=$.strstart;e8($.strm)}function e9($,ee){$.pending_buf[$.pending++]=ee}function e7($,ee){$.pending_buf[$.pending++]=ee>>>8&255;$.pending_buf[$.pending++]=ee&255}function te($,ee,et,ei){var eu=$.avail_in;if(eu>ei){eu=ei}if(eu===0){return 0}$.avail_in-=eu;en.arraySet(ee,$.input,$.next_in,eu,et);if($.state.wrap===1){$.adler=eo($.adler,ee,eu,et)}else if($.state.wrap===2){$.adler=es($.adler,ee,eu,et)}$.next_in+=eu;$.total_in+=eu;return eu}function tt($,ee){var et=$.max_chain_length;var en=$.strstart;var ei;var eo;var es=$.prev_length;var eu=$.nice_match;var el=$.strstart>$.w_size-ez?$.strstart-($.w_size-ez):0;var ef=$.window;var ed=$.w_mask;var ep=$.prev;var eh=$.strstart+eH;var ey=ef[en+es-1];var eg=ef[en+es];if($.prev_length>=$.good_match){et>>=2}if(eu>$.lookahead){eu=$.lookahead}do{ei=ee;if(ef[ei+es]!==eg||ef[ei+es-1]!==ey||ef[ei]!==ef[en]||ef[++ei]!==ef[en+1]){continue}en+=2;ei++;do{}while(ef[++en]===ef[++ei]&&ef[++en]===ef[++ei]&&ef[++en]===ef[++ei]&&ef[++en]===ef[++ei]&&ef[++en]===ef[++ei]&&ef[++en]===ef[++ei]&&ef[++en]===ef[++ei]&&ef[++en]===ef[++ei]&&en<eh)eo=eH-(eh-en);en=eh-eH;if(eo>es){$.match_start=ee;es=eo;if(eo>=eu){break}ey=ef[en+es-1];eg=ef[en+es]}}while((ee=ep[ee&ed])>el&&--et!==0)if(es<=$.lookahead){return es}return $.lookahead}function tr($){var ee=$.w_size;var et,ei,eo,es,eu;do{es=$.window_size-$.lookahead-$.strstart;if($.strstart>=ee+(ee-ez)){en.arraySet($.window,$.window,ee,ee,0);$.match_start-=ee;$.strstart-=ee;$.block_start-=ee;ei=$.hash_size;et=ei;do{eo=$.head[--et];$.head[et]=eo>=ee?eo-ee:0}while(--ei)ei=ee;et=ei;do{eo=$.prev[--et];$.prev[et]=eo>=ee?eo-ee:0}while(--ei)es+=ee}if($.strm.avail_in===0){break}ei=te($.strm,$.window,$.strstart+$.lookahead,es);$.lookahead+=ei;if($.lookahead+$.insert>=eW){eu=$.strstart-$.insert;$.ins_h=$.window[eu];$.ins_h=($.ins_h<<$.hash_shift^$.window[eu+1])&$.hash_mask;while($.insert){$.ins_h=($.ins_h<<$.hash_shift^$.window[eu+eW-1])&$.hash_mask;$.prev[eu&$.w_mask]=$.head[$.ins_h];$.head[$.ins_h]=eu;eu++;$.insert--;if($.lookahead+$.insert<eW){break}}}}while($.lookahead<ez&&$.strm.avail_in!==0)}function tn($,ee){var et=65535;if(et>$.pending_buf_size-5){et=$.pending_buf_size-5}for(;;){if($.lookahead<=1){tr($);if($.lookahead===0&&ee===el){return eX}if($.lookahead===0){break}}$.strstart+=$.lookahead;$.lookahead=0;var en=$.block_start+et;if($.strstart===0||$.strstart>=en){$.lookahead=$.strstart-en;$.strstart=en;e5($,false);if($.strm.avail_out===0){return eX}}if($.strstart-$.block_start>=$.w_size-ez){e5($,false);if($.strm.avail_out===0){return eX}}}$.insert=0;if(ee===ep){e5($,true);if($.strm.avail_out===0){return e0}return e1}if($.strstart>$.block_start){e5($,false);if($.strm.avail_out===0){return eX}}return eX}function ti($,ee){var et;var en;for(;;){if($.lookahead<ez){tr($);if($.lookahead<ez&&ee===el){return eX}if($.lookahead===0){break}}et=0;if($.lookahead>=eW){$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+eW-1])&$.hash_mask;et=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h];$.head[$.ins_h]=$.strstart}if(et!==0&&$.strstart-et<=$.w_size-ez){$.match_length=tt($,et)}if($.match_length>=eW){en=ei._tr_tally($,$.strstart-$.match_start,$.match_length-eW);$.lookahead-=$.match_length;if($.match_length<=$.max_lazy_match&&$.lookahead>=eW){$.match_length--;do{$.strstart++;$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+eW-1])&$.hash_mask;et=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h];$.head[$.ins_h]=$.strstart}while(--$.match_length!==0)$.strstart++}else{$.strstart+=$.match_length;$.match_length=0;$.ins_h=$.window[$.strstart];$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+1])&$.hash_mask}}else{en=ei._tr_tally($,0,$.window[$.strstart]);$.lookahead--;$.strstart++}if(en){e5($,false);if($.strm.avail_out===0){return eX}}}$.insert=$.strstart<eW-1?$.strstart:eW-1;if(ee===ep){e5($,true);if($.strm.avail_out===0){return e0}return e1}if($.last_lit){e5($,false);if($.strm.avail_out===0){return eX}}return eQ}function tu($,ee){var et;var en;var eo;for(;;){if($.lookahead<ez){tr($);if($.lookahead<ez&&ee===el){return eX}if($.lookahead===0){break}}et=0;if($.lookahead>=eW){$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+eW-1])&$.hash_mask;et=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h];$.head[$.ins_h]=$.strstart}$.prev_length=$.match_length;$.prev_match=$.match_start;$.match_length=eW-1;if(et!==0&&$.prev_length<$.max_lazy_match&&$.strstart-et<=$.w_size-ez){$.match_length=tt($,et);if($.match_length<=5&&($.strategy===eS||$.match_length===eW&&$.strstart-$.match_start>4096)){$.match_length=eW-1}}if($.prev_length>=eW&&$.match_length<=$.prev_length){eo=$.strstart+$.lookahead-eW;en=ei._tr_tally($,$.strstart-1-$.prev_match,$.prev_length-eW);$.lookahead-=$.prev_length-1;$.prev_length-=2;do{if(++$.strstart<=eo){$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+eW-1])&$.hash_mask;et=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h];$.head[$.ins_h]=$.strstart}}while(--$.prev_length!==0)$.match_available=0;$.match_length=eW-1;$.strstart++;if(en){e5($,false);if($.strm.avail_out===0){return eX}}}else if($.match_available){en=ei._tr_tally($,0,$.window[$.strstart-1]);if(en){e5($,false)}$.strstart++;$.lookahead--;if($.strm.avail_out===0){return eX}}else{$.match_available=1;$.strstart++;$.lookahead--}}if($.match_available){en=ei._tr_tally($,0,$.window[$.strstart-1]);$.match_available=0}$.insert=$.strstart<eW-1?$.strstart:eW-1;if(ee===ep){e5($,true);if($.strm.avail_out===0){return e0}return e1}if($.last_lit){e5($,false);if($.strm.avail_out===0){return eX}}return eQ}function tc($,ee){var et;var en;var eo,es;var eu=$.window;for(;;){if($.lookahead<=eH){tr($);if($.lookahead<=eH&&ee===el){return eX}if($.lookahead===0){break}}$.match_length=0;if($.lookahead>=eW&&$.strstart>0){eo=$.strstart-1;en=eu[eo];if(en===eu[++eo]&&en===eu[++eo]&&en===eu[++eo]){es=$.strstart+eH;do{}while(en===eu[++eo]&&en===eu[++eo]&&en===eu[++eo]&&en===eu[++eo]&&en===eu[++eo]&&en===eu[++eo]&&en===eu[++eo]&&en===eu[++eo]&&eo<es)$.match_length=eH-(es-eo);if($.match_length>$.lookahead){$.match_length=$.lookahead}}}if($.match_length>=eW){et=ei._tr_tally($,1,$.match_length-eW);$.lookahead-=$.match_length;$.strstart+=$.match_length;$.match_length=0}else{et=ei._tr_tally($,0,$.window[$.strstart]);$.lookahead--;$.strstart++}if(et){e5($,false);if($.strm.avail_out===0){return eX}}}$.insert=0;if(ee===ep){e5($,true);if($.strm.avail_out===0){return e0}return e1}if($.last_lit){e5($,false);if($.strm.avail_out===0){return eX}}return eQ}function tf($,ee){var et;for(;;){if($.lookahead===0){tr($);if($.lookahead===0){if(ee===el){return eX}break}}$.match_length=0;et=ei._tr_tally($,0,$.window[$.strstart]);$.lookahead--;$.strstart++;if(et){e5($,false);if($.strm.avail_out===0){return eX}}}$.insert=0;if(ee===ep){e5($,true);if($.strm.avail_out===0){return e0}return e1}if($.last_lit){e5($,false);if($.strm.avail_out===0){return eX}}return eQ}function td($,ee,et,en,ei){this.good_length=$;this.max_lazy=ee;this.nice_length=et;this.max_chain=en;this.func=ei}var tp;tp=[new td(0,0,0,0,tn),new td(4,4,8,4,ti),new td(4,5,16,8,ti),new td(4,6,32,32,ti),new td(4,4,16,16,tu),new td(8,16,32,32,tu),new td(8,16,128,128,tu),new td(8,32,128,256,tu),new td(32,128,258,1024,tu),new td(32,258,258,4096,tu)];function th($){$.window_size=2*$.w_size;e3($.head);$.max_lazy_match=tp[$.level].max_lazy;$.good_match=tp[$.level].good_length;$.nice_match=tp[$.level].nice_length;$.max_chain_length=tp[$.level].max_chain;$.strstart=0;$.block_start=0;$.lookahead=0;$.insert=0;$.match_length=$.prev_length=eW-1;$.match_available=0;$.ins_h=0}function ty(){this.strm=null;this.status=0;this.pending_buf=null;this.pending_buf_size=0;this.pending_out=0;this.pending=0;this.wrap=0;this.gzhead=null;this.gzindex=0;this.method=eD;this.last_flush=-1;this.w_size=0;this.w_bits=0;this.w_mask=0;this.window=null;this.window_size=0;this.prev=null;this.head=null;this.ins_h=0;this.hash_size=0;this.hash_bits=0;this.hash_mask=0;this.hash_shift=0;this.block_start=0;this.match_length=0;this.prev_match=0;this.match_available=0;this.strstart=0;this.match_start=0;this.lookahead=0;this.prev_length=0;this.max_chain_length=0;this.max_lazy_match=0;this.level=0;this.strategy=0;this.good_match=0;this.nice_match=0;this.dyn_ltree=new en.Buf16(eU*2);this.dyn_dtree=new en.Buf16((2*eF+1)*2);this.bl_tree=new en.Buf16((2*eB+1)*2);e3(this.dyn_ltree);e3(this.dyn_dtree);e3(this.bl_tree);this.l_desc=null;this.d_desc=null;this.bl_desc=null;this.bl_count=new en.Buf16(ej+1);this.heap=new en.Buf16(2*eP+1);e3(this.heap);this.heap_len=0;this.heap_max=0;this.depth=new en.Buf16(2*eP+1);e3(this.depth);this.l_buf=0;this.lit_bufsize=0;this.last_lit=0;this.d_buf=0;this.opt_len=0;this.static_len=0;this.matches=0;this.insert=0;this.bi_buf=0;this.bi_valid=0}function tm($){var ee;if(!$||!$.state){return e6($,em)}$.total_in=$.total_out=0;$.data_type=eN;ee=$.state;ee.pending=0;ee.pending_out=0;if(ee.wrap<0){ee.wrap=-ee.wrap}ee.status=ee.wrap?e$:eZ;$.adler=ee.wrap===2?0:1;ee.last_flush=el;ei._tr_init(ee);return ey}function t_($){var ee=tm($);if(ee===ey){th($.state)}return ee}function tv($,ee){if(!$||!$.state){return em}if($.state.wrap!==2){return em}$.state.gzhead=ee;return ey}function tw($,ee,et,ei,eo,es){if(!$){return em}var eu=1;if(ee===eE){ee=6}if(ei<0){eu=0;ei=-ei}else if(ei>15){eu=2;ei-=16}if(eo<1||eo>eR||et!==eD||ei<8||ei>15||ee<0||ee>9||es<0||es>eA){return e6($,em)}if(ei===8){ei=9}var el=new ty;$.state=el;el.strm=$;el.wrap=eu;el.gzhead=null;el.w_bits=ei;el.w_size=1<<el.w_bits;el.w_mask=el.w_size-1;el.hash_bits=eo+7;el.hash_size=1<<el.hash_bits;el.hash_mask=el.hash_size-1;el.hash_shift=~~((el.hash_bits+eW-1)/eW);el.window=new en.Buf8(el.w_size*2);el.head=new en.Buf16(el.hash_size);el.prev=new en.Buf16(el.w_size);el.lit_bufsize=1<<eo+6;el.pending_buf_size=el.lit_bufsize*4;el.pending_buf=new en.Buf8(el.pending_buf_size);el.d_buf=1*el.lit_bufsize;el.l_buf=(1+2)*el.lit_bufsize;el.level=ee;el.strategy=es;el.method=et;return t_($)}function tE($,ee){return tw($,ee,eD,eC,ek,eI)}function tS($,ee){var et,en;var eo,eu;if(!$||!$.state||ee>eh||ee<0){return $?e6($,em):em}en=$.state;if(!$.output||!$.input&&$.avail_in!==0||en.status===eJ&&ee!==ep){return e6($,$.avail_out===0?ew:em)}en.strm=$;et=en.last_flush;en.last_flush=ee;if(en.status===e$){if(en.wrap===2){$.adler=0;e9(en,31);e9(en,139);e9(en,8);if(!en.gzhead){e9(en,0);e9(en,0);e9(en,0);e9(en,0);e9(en,0);e9(en,en.level===9?2:en.strategy>=eT||en.level<2?4:0);e9(en,e2);en.status=eZ}else{e9(en,(en.gzhead.text?1:0)+(en.gzhead.hcrc?2:0)+(!en.gzhead.extra?0:4)+(!en.gzhead.name?0:8)+(!en.gzhead.comment?0:16));e9(en,en.gzhead.time&255);e9(en,en.gzhead.time>>8&255);e9(en,en.gzhead.time>>16&255);e9(en,en.gzhead.time>>24&255);e9(en,en.level===9?2:en.strategy>=eT||en.level<2?4:0);e9(en,en.gzhead.os&255);if(en.gzhead.extra&&en.gzhead.extra.length){e9(en,en.gzhead.extra.length&255);e9(en,en.gzhead.extra.length>>8&255)}if(en.gzhead.hcrc){$.adler=es($.adler,en.pending_buf,en.pending,0)}en.gzindex=0;en.status=eq}}else{var e_=eD+(en.w_bits-8<<4)<<8;var eE=-1;if(en.strategy>=eT||en.level<2){eE=0}else if(en.level<6){eE=1}else if(en.level===6){eE=2}else{eE=3}e_|=eE<<6;if(en.strstart!==0){e_|=eV}e_+=31-e_%31;en.status=eZ;e7(en,e_);if(en.strstart!==0){e7(en,$.adler>>>16);e7(en,$.adler&65535)}$.adler=1}}if(en.status===eq){if(en.gzhead.extra){eo=en.pending;while(en.gzindex<(en.gzhead.extra.length&65535)){if(en.pending===en.pending_buf_size){if(en.gzhead.hcrc&&en.pending>eo){$.adler=es($.adler,en.pending_buf,en.pending-eo,eo)}e8($);eo=en.pending;if(en.pending===en.pending_buf_size){break}}e9(en,en.gzhead.extra[en.gzindex]&255);en.gzindex++}if(en.gzhead.hcrc&&en.pending>eo){$.adler=es($.adler,en.pending_buf,en.pending-eo,eo)}if(en.gzindex===en.gzhead.extra.length){en.gzindex=0;en.status=eG}}else{en.status=eG}}if(en.status===eG){if(en.gzhead.name){eo=en.pending;do{if(en.pending===en.pending_buf_size){if(en.gzhead.hcrc&&en.pending>eo){$.adler=es($.adler,en.pending_buf,en.pending-eo,eo)}e8($);eo=en.pending;if(en.pending===en.pending_buf_size){eu=1;break}}if(en.gzindex<en.gzhead.name.length){eu=en.gzhead.name.charCodeAt(en.gzindex++)&255}else{eu=0}e9(en,eu)}while(eu!==0)if(en.gzhead.hcrc&&en.pending>eo){$.adler=es($.adler,en.pending_buf,en.pending-eo,eo)}if(eu===0){en.gzindex=0;en.status=eY}}else{en.status=eY}}if(en.status===eY){if(en.gzhead.comment){eo=en.pending;do{if(en.pending===en.pending_buf_size){if(en.gzhead.hcrc&&en.pending>eo){$.adler=es($.adler,en.pending_buf,en.pending-eo,eo)}e8($);eo=en.pending;if(en.pending===en.pending_buf_size){eu=1;break}}if(en.gzindex<en.gzhead.comment.length){eu=en.gzhead.comment.charCodeAt(en.gzindex++)&255}else{eu=0}e9(en,eu)}while(eu!==0)if(en.gzhead.hcrc&&en.pending>eo){$.adler=es($.adler,en.pending_buf,en.pending-eo,eo)}if(eu===0){en.status=eK}}else{en.status=eK}}if(en.status===eK){if(en.gzhead.hcrc){if(en.pending+2>en.pending_buf_size){e8($)}if(en.pending+2<=en.pending_buf_size){e9(en,$.adler&255);e9(en,$.adler>>8&255);$.adler=0;en.status=eZ}}else{en.status=eZ}}if(en.pending!==0){e8($);if($.avail_out===0){en.last_flush=-1;return ey}}else if($.avail_in===0&&e4(ee)<=e4(et)&&ee!==ep){return e6($,ew)}if(en.status===eJ&&$.avail_in!==0){return e6($,ew)}if($.avail_in!==0||en.lookahead!==0||ee!==el&&en.status!==eJ){var eS=en.strategy===eT?tf(en,ee):en.strategy===eO?tc(en,ee):tp[en.level].func(en,ee);if(eS===e0||eS===e1){en.status=eJ}if(eS===eX||eS===e0){if($.avail_out===0){en.last_flush=-1}return ey}if(eS===eQ){if(ee===ef){ei._tr_align(en)}else if(ee!==eh){ei._tr_stored_block(en,0,0,false);if(ee===ed){e3(en.head);if(en.lookahead===0){en.strstart=0;en.block_start=0;en.insert=0}}}e8($);if($.avail_out===0){en.last_flush=-1;return ey}}}if(ee!==ep){return ey}if(en.wrap<=0){return eg}if(en.wrap===2){e9(en,$.adler&255);e9(en,$.adler>>8&255);e9(en,$.adler>>16&255);e9(en,$.adler>>24&255);e9(en,$.total_in&255);e9(en,$.total_in>>8&255);e9(en,$.total_in>>16&255);e9(en,$.total_in>>24&255)}else{e7(en,$.adler>>>16);e7(en,$.adler&65535)}e8($);if(en.wrap>0){en.wrap=-en.wrap}return en.pending!==0?ey:eg}function tT($){var ee;if(!$||!$.state){return em}ee=$.state.status;if(ee!==e$&&ee!==eq&&ee!==eG&&ee!==eY&&ee!==eK&&ee!==eZ&&ee!==eJ){return e6($,em)}$.state=null;return ee===eZ?e6($,e_):ey}function tO($,ee){var et=ee.length;var ei;var es,eu;var el;var ef;var ed;var ep;var eh;if(!$||!$.state){return em}ei=$.state;el=ei.wrap;if(el===2||el===1&&ei.status!==e$||ei.lookahead){return em}if(el===1){$.adler=eo($.adler,ee,et,0)}ei.wrap=0;if(et>=ei.w_size){if(el===0){e3(ei.head);ei.strstart=0;ei.block_start=0;ei.insert=0}eh=new en.Buf8(ei.w_size);en.arraySet(eh,ee,et-ei.w_size,ei.w_size,0);ee=eh;et=ei.w_size}ef=$.avail_in;ed=$.next_in;ep=$.input;$.avail_in=et;$.next_in=0;$.input=ee;tr(ei);while(ei.lookahead>=eW){es=ei.strstart;eu=ei.lookahead-(eW-1);do{ei.ins_h=(ei.ins_h<<ei.hash_shift^ei.window[es+eW-1])&ei.hash_mask;ei.prev[es&ei.w_mask]=ei.head[ei.ins_h];ei.head[ei.ins_h]=es;es++}while(--eu)ei.strstart=es;ei.lookahead=eW-1;tr(ei)}ei.strstart+=ei.lookahead;ei.block_start=ei.strstart;ei.insert=ei.lookahead;ei.lookahead=0;ei.match_length=ei.prev_length=eW-1;ei.match_available=0;$.next_in=ed;$.input=ep;$.avail_in=ef;ei.wrap=el;return ey}ee.deflateInit=tE;ee.deflateInit2=tw;ee.deflateReset=t_;ee.deflateResetKeep=tm;ee.deflateSetHeader=tv;ee.deflate=tS;ee.deflateEnd=tT;ee.deflateSetDictionary=tO;ee.deflateInfo="pako deflate (from Nodeca project)"},4264:$=>{"use strict";var ee=30;var et=12;$.exports=function $($,en){var ei;var eo;var es;var eu;var el;var ef;var ed;var ep;var eh;var ey;var eg;var em;var e_;var ew;var eE;var eS;var eT;var eO;var eA;var eI;var eN;var eD;var eR;var eC,ek;ei=$.state;eo=$.next_in;eC=$.input;es=eo+($.avail_in-5);eu=$.next_out;ek=$.output;el=eu-(en-$.avail_out);ef=eu+($.avail_out-257);ed=ei.dmax;ep=ei.wsize;eh=ei.whave;ey=ei.wnext;eg=ei.window;em=ei.hold;e_=ei.bits;ew=ei.lencode;eE=ei.distcode;eS=(1<<ei.lenbits)-1;eT=(1<<ei.distbits)-1;n:do{if(e_<15){em+=eC[eo++]<<e_;e_+=8;em+=eC[eo++]<<e_;e_+=8}eO=ew[em&eS];i:for(;;){eA=eO>>>24;em>>>=eA;e_-=eA;eA=eO>>>16&255;if(eA===0){ek[eu++]=eO&65535}else if(eA&16){eI=eO&65535;eA&=15;if(eA){if(e_<eA){em+=eC[eo++]<<e_;e_+=8}eI+=em&(1<<eA)-1;em>>>=eA;e_-=eA}if(e_<15){em+=eC[eo++]<<e_;e_+=8;em+=eC[eo++]<<e_;e_+=8}eO=eE[em&eT];a:for(;;){eA=eO>>>24;em>>>=eA;e_-=eA;eA=eO>>>16&255;if(eA&16){eN=eO&65535;eA&=15;if(e_<eA){em+=eC[eo++]<<e_;e_+=8;if(e_<eA){em+=eC[eo++]<<e_;e_+=8}}eN+=em&(1<<eA)-1;if(eN>ed){$.msg="invalid distance too far back";ei.mode=ee;break n}em>>>=eA;e_-=eA;eA=eu-el;if(eN>eA){eA=eN-eA;if(eA>eh){if(ei.sane){$.msg="invalid distance too far back";ei.mode=ee;break n}}eD=0;eR=eg;if(ey===0){eD+=ep-eA;if(eA<eI){eI-=eA;do{ek[eu++]=eg[eD++]}while(--eA)eD=eu-eN;eR=ek}}else if(ey<eA){eD+=ep+ey-eA;eA-=ey;if(eA<eI){eI-=eA;do{ek[eu++]=eg[eD++]}while(--eA)eD=0;if(ey<eI){eA=ey;eI-=eA;do{ek[eu++]=eg[eD++]}while(--eA)eD=eu-eN;eR=ek}}}else{eD+=ey-eA;if(eA<eI){eI-=eA;do{ek[eu++]=eg[eD++]}while(--eA)eD=eu-eN;eR=ek}}while(eI>2){ek[eu++]=eR[eD++];ek[eu++]=eR[eD++];ek[eu++]=eR[eD++];eI-=3}if(eI){ek[eu++]=eR[eD++];if(eI>1){ek[eu++]=eR[eD++]}}}else{eD=eu-eN;do{ek[eu++]=ek[eD++];ek[eu++]=ek[eD++];ek[eu++]=ek[eD++];eI-=3}while(eI>2)if(eI){ek[eu++]=ek[eD++];if(eI>1){ek[eu++]=ek[eD++]}}}}else if((eA&64)===0){eO=eE[(eO&65535)+(em&(1<<eA)-1)];continue a}else{$.msg="invalid distance code";ei.mode=ee;break n}break}}else if((eA&64)===0){eO=ew[(eO&65535)+(em&(1<<eA)-1)];continue i}else if(eA&32){ei.mode=et;break n}else{$.msg="invalid literal/length code";ei.mode=ee;break n}break}}while(eo<es&&eu<ef)eI=e_>>3;eo-=eI;e_-=eI<<3;em&=(1<<e_)-1;$.next_in=eo;$.next_out=eu;$.avail_in=eo<es?5+(es-eo):5-(eo-es);$.avail_out=eu<ef?257+(ef-eu):257-(eu-ef);ei.hold=em;ei.bits=e_;return}},7948:($,ee,et)=>{"use strict";var en=et(4236);var ei=et(6069);var eo=et(2869);var es=et(4264);var eu=et(9241);var el=0;var ef=1;var ed=2;var ep=4;var eh=5;var ey=6;var eg=0;var em=1;var e_=2;var ew=-2;var eE=-3;var eS=-4;var eT=-5;var eO=8;var eA=1;var eI=2;var eN=3;var eD=4;var eR=5;var eC=6;var ek=7;var eM=8;var eL=9;var eP=10;var eF=11;var eB=12;var eU=13;var ej=14;var eW=15;var eH=16;var ez=17;var eV=18;var e$=19;var eq=20;var eG=21;var eY=22;var eK=23;var eZ=24;var eJ=25;var eX=26;var eQ=27;var e0=28;var e1=29;var e2=30;var e6=31;var e4=32;var e3=852;var e8=592;var e5=15;var e9=e5;function e7($){return($>>>24&255)+($>>>8&65280)+(($&65280)<<8)+(($&255)<<24)}function te(){this.mode=0;this.last=false;this.wrap=0;this.havedict=false;this.flags=0;this.dmax=0;this.check=0;this.total=0;this.head=null;this.wbits=0;this.wsize=0;this.whave=0;this.wnext=0;this.window=null;this.hold=0;this.bits=0;this.length=0;this.offset=0;this.extra=0;this.lencode=null;this.distcode=null;this.lenbits=0;this.distbits=0;this.ncode=0;this.nlen=0;this.ndist=0;this.have=0;this.next=null;this.lens=new en.Buf16(320);this.work=new en.Buf16(288);this.lendyn=null;this.distdyn=null;this.sane=0;this.back=0;this.was=0}function tt($){var ee;if(!$||!$.state){return ew}ee=$.state;$.total_in=$.total_out=ee.total=0;$.msg="";if(ee.wrap){$.adler=ee.wrap&1}ee.mode=eA;ee.last=0;ee.havedict=0;ee.dmax=32768;ee.head=null;ee.hold=0;ee.bits=0;ee.lencode=ee.lendyn=new en.Buf32(e3);ee.distcode=ee.distdyn=new en.Buf32(e8);ee.sane=1;ee.back=-1;return eg}function tr($){var ee;if(!$||!$.state){return ew}ee=$.state;ee.wsize=0;ee.whave=0;ee.wnext=0;return tt($)}function tn($,ee){var et;var en;if(!$||!$.state){return ew}en=$.state;if(ee<0){et=0;ee=-ee}else{et=(ee>>4)+1;if(ee<48){ee&=15}}if(ee&&(ee<8||ee>15)){return ew}if(en.window!==null&&en.wbits!==ee){en.window=null}en.wrap=et;en.wbits=ee;return tr($)}function ti($,ee){var et;var en;if(!$){return ew}en=new te;$.state=en;en.window=null;et=tn($,ee);if(et!==eg){$.state=null}return et}function tu($){return ti($,e9)}var tc=true;var tf,td;function tp($){if(tc){var ee;tf=new en.Buf32(512);td=new en.Buf32(32);ee=0;while(ee<144){$.lens[ee++]=8}while(ee<256){$.lens[ee++]=9}while(ee<280){$.lens[ee++]=7}while(ee<288){$.lens[ee++]=8}eu(ef,$.lens,0,288,tf,0,$.work,{bits:9});ee=0;while(ee<32){$.lens[ee++]=5}eu(ed,$.lens,0,32,td,0,$.work,{bits:5});tc=false}$.lencode=tf;$.lenbits=9;$.distcode=td;$.distbits=5}function th($,ee,et,ei){var eo;var es=$.state;if(es.window===null){es.wsize=1<<es.wbits;es.wnext=0;es.whave=0;es.window=new en.Buf8(es.wsize)}if(ei>=es.wsize){en.arraySet(es.window,ee,et-es.wsize,es.wsize,0);es.wnext=0;es.whave=es.wsize}else{eo=es.wsize-es.wnext;if(eo>ei){eo=ei}en.arraySet(es.window,ee,et-ei,eo,es.wnext);ei-=eo;if(ei){en.arraySet(es.window,ee,et-ei,ei,0);es.wnext=ei;es.whave=es.wsize}else{es.wnext+=eo;if(es.wnext===es.wsize){es.wnext=0}if(es.whave<es.wsize){es.whave+=eo}}}return 0}function ty($,ee){var et;var e3,e8;var e5;var e9;var te,tt;var tr;var tn;var ti,tu;var tc;var tf;var td;var ty=0;var tm,t_,tv;var tw,tE,tS;var tT;var tO;var tA=new en.Buf8(4);var tI;var tN;var tD=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!$||!$.state||!$.output||!$.input&&$.avail_in!==0){return ew}et=$.state;if(et.mode===eB){et.mode=eU}e9=$.next_out;e8=$.output;tt=$.avail_out;e5=$.next_in;e3=$.input;te=$.avail_in;tr=et.hold;tn=et.bits;ti=te;tu=tt;tO=eg;o:for(;;){switch(et.mode){case eA:if(et.wrap===0){et.mode=eU;break}while(tn<16){if(te===0){break o}te--;tr+=e3[e5++]<<tn;tn+=8}if(et.wrap&2&&tr===35615){et.check=0;tA[0]=tr&255;tA[1]=tr>>>8&255;et.check=eo(et.check,tA,2,0);tr=0;tn=0;et.mode=eI;break}et.flags=0;if(et.head){et.head.done=false}if(!(et.wrap&1)||(((tr&255)<<8)+(tr>>8))%31){$.msg="incorrect header check";et.mode=e2;break}if((tr&15)!==eO){$.msg="unknown compression method";et.mode=e2;break}tr>>>=4;tn-=4;tT=(tr&15)+8;if(et.wbits===0){et.wbits=tT}else if(tT>et.wbits){$.msg="invalid window size";et.mode=e2;break}et.dmax=1<<tT;$.adler=et.check=1;et.mode=tr&512?eP:eB;tr=0;tn=0;break;case eI:while(tn<16){if(te===0){break o}te--;tr+=e3[e5++]<<tn;tn+=8}et.flags=tr;if((et.flags&255)!==eO){$.msg="unknown compression method";et.mode=e2;break}if(et.flags&57344){$.msg="unknown header flags set";et.mode=e2;break}if(et.head){et.head.text=tr>>8&1}if(et.flags&512){tA[0]=tr&255;tA[1]=tr>>>8&255;et.check=eo(et.check,tA,2,0)}tr=0;tn=0;et.mode=eN;case eN:while(tn<32){if(te===0){break o}te--;tr+=e3[e5++]<<tn;tn+=8}if(et.head){et.head.time=tr}if(et.flags&512){tA[0]=tr&255;tA[1]=tr>>>8&255;tA[2]=tr>>>16&255;tA[3]=tr>>>24&255;et.check=eo(et.check,tA,4,0)}tr=0;tn=0;et.mode=eD;case eD:while(tn<16){if(te===0){break o}te--;tr+=e3[e5++]<<tn;tn+=8}if(et.head){et.head.xflags=tr&255;et.head.os=tr>>8}if(et.flags&512){tA[0]=tr&255;tA[1]=tr>>>8&255;et.check=eo(et.check,tA,2,0)}tr=0;tn=0;et.mode=eR;case eR:if(et.flags&1024){while(tn<16){if(te===0){break o}te--;tr+=e3[e5++]<<tn;tn+=8}et.length=tr;if(et.head){et.head.extra_len=tr}if(et.flags&512){tA[0]=tr&255;tA[1]=tr>>>8&255;et.check=eo(et.check,tA,2,0)}tr=0;tn=0}else if(et.head){et.head.extra=null}et.mode=eC;case eC:if(et.flags&1024){tc=et.length;if(tc>te){tc=te}if(tc){if(et.head){tT=et.head.extra_len-et.length;if(!et.head.extra){et.head.extra=new Array(et.head.extra_len)}en.arraySet(et.head.extra,e3,e5,tc,tT)}if(et.flags&512){et.check=eo(et.check,e3,tc,e5)}te-=tc;e5+=tc;et.length-=tc}if(et.length){break o}}et.length=0;et.mode=ek;case ek:if(et.flags&2048){if(te===0){break o}tc=0;do{tT=e3[e5+tc++];if(et.head&&tT&&et.length<65536){et.head.name+=String.fromCharCode(tT)}}while(tT&&tc<te)if(et.flags&512){et.check=eo(et.check,e3,tc,e5)}te-=tc;e5+=tc;if(tT){break o}}else if(et.head){et.head.name=null}et.length=0;et.mode=eM;case eM:if(et.flags&4096){if(te===0){break o}tc=0;do{tT=e3[e5+tc++];if(et.head&&tT&&et.length<65536){et.head.comment+=String.fromCharCode(tT)}}while(tT&&tc<te)if(et.flags&512){et.check=eo(et.check,e3,tc,e5)}te-=tc;e5+=tc;if(tT){break o}}else if(et.head){et.head.comment=null}et.mode=eL;case eL:if(et.flags&512){while(tn<16){if(te===0){break o}te--;tr+=e3[e5++]<<tn;tn+=8}if(tr!==(et.check&65535)){$.msg="header crc mismatch";et.mode=e2;break}tr=0;tn=0}if(et.head){et.head.hcrc=et.flags>>9&1;et.head.done=true}$.adler=et.check=0;et.mode=eB;break;case eP:while(tn<32){if(te===0){break o}te--;tr+=e3[e5++]<<tn;tn+=8}$.adler=et.check=e7(tr);tr=0;tn=0;et.mode=eF;case eF:if(et.havedict===0){$.next_out=e9;$.avail_out=tt;$.next_in=e5;$.avail_in=te;et.hold=tr;et.bits=tn;return e_}$.adler=et.check=1;et.mode=eB;case eB:if(ee===eh||ee===ey){break o}case eU:if(et.last){tr>>>=tn&7;tn-=tn&7;et.mode=eQ;break}while(tn<3){if(te===0){break o}te--;tr+=e3[e5++]<<tn;tn+=8}et.last=tr&1;tr>>>=1;tn-=1;switch(tr&3){case 0:et.mode=ej;break;case 1:tp(et);et.mode=eq;if(ee===ey){tr>>>=2;tn-=2;break o}break;case 2:et.mode=ez;break;case 3:$.msg="invalid block type";et.mode=e2}tr>>>=2;tn-=2;break;case ej:tr>>>=tn&7;tn-=tn&7;while(tn<32){if(te===0){break o}te--;tr+=e3[e5++]<<tn;tn+=8}if((tr&65535)!==(tr>>>16^65535)){$.msg="invalid stored block lengths";et.mode=e2;break}et.length=tr&65535;tr=0;tn=0;et.mode=eW;if(ee===ey){break o}case eW:et.mode=eH;case eH:tc=et.length;if(tc){if(tc>te){tc=te}if(tc>tt){tc=tt}if(tc===0){break o}en.arraySet(e8,e3,e5,tc,e9);te-=tc;e5+=tc;tt-=tc;e9+=tc;et.length-=tc;break}et.mode=eB;break;case ez:while(tn<14){if(te===0){break o}te--;tr+=e3[e5++]<<tn;tn+=8}et.nlen=(tr&31)+257;tr>>>=5;tn-=5;et.ndist=(tr&31)+1;tr>>>=5;tn-=5;et.ncode=(tr&15)+4;tr>>>=4;tn-=4;if(et.nlen>286||et.ndist>30){$.msg="too many length or distance symbols";et.mode=e2;break}et.have=0;et.mode=eV;case eV:while(et.have<et.ncode){while(tn<3){if(te===0){break o}te--;tr+=e3[e5++]<<tn;tn+=8}et.lens[tD[et.have++]]=tr&7;tr>>>=3;tn-=3}while(et.have<19){et.lens[tD[et.have++]]=0}et.lencode=et.lendyn;et.lenbits=7;tI={bits:et.lenbits};tO=eu(el,et.lens,0,19,et.lencode,0,et.work,tI);et.lenbits=tI.bits;if(tO){$.msg="invalid code lengths set";et.mode=e2;break}et.have=0;et.mode=e$;case e$:while(et.have<et.nlen+et.ndist){for(;;){ty=et.lencode[tr&(1<<et.lenbits)-1];tm=ty>>>24;t_=ty>>>16&255;tv=ty&65535;if(tm<=tn){break}if(te===0){break o}te--;tr+=e3[e5++]<<tn;tn+=8}if(tv<16){tr>>>=tm;tn-=tm;et.lens[et.have++]=tv}else{if(tv===16){tN=tm+2;while(tn<tN){if(te===0){break o}te--;tr+=e3[e5++]<<tn;tn+=8}tr>>>=tm;tn-=tm;if(et.have===0){$.msg="invalid bit length repeat";et.mode=e2;break}tT=et.lens[et.have-1];tc=3+(tr&3);tr>>>=2;tn-=2}else if(tv===17){tN=tm+3;while(tn<tN){if(te===0){break o}te--;tr+=e3[e5++]<<tn;tn+=8}tr>>>=tm;tn-=tm;tT=0;tc=3+(tr&7);tr>>>=3;tn-=3}else{tN=tm+7;while(tn<tN){if(te===0){break o}te--;tr+=e3[e5++]<<tn;tn+=8}tr>>>=tm;tn-=tm;tT=0;tc=11+(tr&127);tr>>>=7;tn-=7}if(et.have+tc>et.nlen+et.ndist){$.msg="invalid bit length repeat";et.mode=e2;break}while(tc--){et.lens[et.have++]=tT}}}if(et.mode===e2){break}if(et.lens[256]===0){$.msg="invalid code -- missing end-of-block";et.mode=e2;break}et.lenbits=9;tI={bits:et.lenbits};tO=eu(ef,et.lens,0,et.nlen,et.lencode,0,et.work,tI);et.lenbits=tI.bits;if(tO){$.msg="invalid literal/lengths set";et.mode=e2;break}et.distbits=6;et.distcode=et.distdyn;tI={bits:et.distbits};tO=eu(ed,et.lens,et.nlen,et.ndist,et.distcode,0,et.work,tI);et.distbits=tI.bits;if(tO){$.msg="invalid distances set";et.mode=e2;break}et.mode=eq;if(ee===ey){break o}case eq:et.mode=eG;case eG:if(te>=6&&tt>=258){$.next_out=e9;$.avail_out=tt;$.next_in=e5;$.avail_in=te;et.hold=tr;et.bits=tn;es($,tu);e9=$.next_out;e8=$.output;tt=$.avail_out;e5=$.next_in;e3=$.input;te=$.avail_in;tr=et.hold;tn=et.bits;if(et.mode===eB){et.back=-1}break}et.back=0;for(;;){ty=et.lencode[tr&(1<<et.lenbits)-1];tm=ty>>>24;t_=ty>>>16&255;tv=ty&65535;if(tm<=tn){break}if(te===0){break o}te--;tr+=e3[e5++]<<tn;tn+=8}if(t_&&(t_&240)===0){tw=tm;tE=t_;tS=tv;for(;;){ty=et.lencode[tS+((tr&(1<<tw+tE)-1)>>tw)];tm=ty>>>24;t_=ty>>>16&255;tv=ty&65535;if(tw+tm<=tn){break}if(te===0){break o}te--;tr+=e3[e5++]<<tn;tn+=8}tr>>>=tw;tn-=tw;et.back+=tw}tr>>>=tm;tn-=tm;et.back+=tm;et.length=tv;if(t_===0){et.mode=eX;break}if(t_&32){et.back=-1;et.mode=eB;break}if(t_&64){$.msg="invalid literal/length code";et.mode=e2;break}et.extra=t_&15;et.mode=eY;case eY:if(et.extra){tN=et.extra;while(tn<tN){if(te===0){break o}te--;tr+=e3[e5++]<<tn;tn+=8}et.length+=tr&(1<<et.extra)-1;tr>>>=et.extra;tn-=et.extra;et.back+=et.extra}et.was=et.length;et.mode=eK;case eK:for(;;){ty=et.distcode[tr&(1<<et.distbits)-1];tm=ty>>>24;t_=ty>>>16&255;tv=ty&65535;if(tm<=tn){break}if(te===0){break o}te--;tr+=e3[e5++]<<tn;tn+=8}if((t_&240)===0){tw=tm;tE=t_;tS=tv;for(;;){ty=et.distcode[tS+((tr&(1<<tw+tE)-1)>>tw)];tm=ty>>>24;t_=ty>>>16&255;tv=ty&65535;if(tw+tm<=tn){break}if(te===0){break o}te--;tr+=e3[e5++]<<tn;tn+=8}tr>>>=tw;tn-=tw;et.back+=tw}tr>>>=tm;tn-=tm;et.back+=tm;if(t_&64){$.msg="invalid distance code";et.mode=e2;break}et.offset=tv;et.extra=t_&15;et.mode=eZ;case eZ:if(et.extra){tN=et.extra;while(tn<tN){if(te===0){break o}te--;tr+=e3[e5++]<<tn;tn+=8}et.offset+=tr&(1<<et.extra)-1;tr>>>=et.extra;tn-=et.extra;et.back+=et.extra}if(et.offset>et.dmax){$.msg="invalid distance too far back";et.mode=e2;break}et.mode=eJ;case eJ:if(tt===0){break o}tc=tu-tt;if(et.offset>tc){tc=et.offset-tc;if(tc>et.whave){if(et.sane){$.msg="invalid distance too far back";et.mode=e2;break}}if(tc>et.wnext){tc-=et.wnext;tf=et.wsize-tc}else{tf=et.wnext-tc}if(tc>et.length){tc=et.length}td=et.window}else{td=e8;tf=e9-et.offset;tc=et.length}if(tc>tt){tc=tt}tt-=tc;et.length-=tc;do{e8[e9++]=td[tf++]}while(--tc)if(et.length===0){et.mode=eG}break;case eX:if(tt===0){break o}e8[e9++]=et.length;tt--;et.mode=eG;break;case eQ:if(et.wrap){while(tn<32){if(te===0){break o}te--;tr|=e3[e5++]<<tn;tn+=8}tu-=tt;$.total_out+=tu;et.total+=tu;if(tu){$.adler=et.check=et.flags?eo(et.check,e8,tu,e9-tu):ei(et.check,e8,tu,e9-tu)}tu=tt;if((et.flags?tr:e7(tr))!==et.check){$.msg="incorrect data check";et.mode=e2;break}tr=0;tn=0}et.mode=e0;case e0:if(et.wrap&&et.flags){while(tn<32){if(te===0){break o}te--;tr+=e3[e5++]<<tn;tn+=8}if(tr!==(et.total&4294967295)){$.msg="incorrect length check";et.mode=e2;break}tr=0;tn=0}et.mode=e1;case e1:tO=em;break o;case e2:tO=eE;break o;case e6:return eS;case e4:default:return ew}}$.next_out=e9;$.avail_out=tt;$.next_in=e5;$.avail_in=te;et.hold=tr;et.bits=tn;if(et.wsize||tu!==$.avail_out&&et.mode<e2&&(et.mode<eQ||ee!==ep)){if(th($,$.output,$.next_out,tu-$.avail_out)){et.mode=e6;return eS}}ti-=$.avail_in;tu-=$.avail_out;$.total_in+=ti;$.total_out+=tu;et.total+=tu;if(et.wrap&&tu){$.adler=et.check=et.flags?eo(et.check,e8,tu,$.next_out-tu):ei(et.check,e8,tu,$.next_out-tu)}$.data_type=et.bits+(et.last?64:0)+(et.mode===eB?128:0)+(et.mode===eq||et.mode===eW?256:0);if((ti===0&&tu===0||ee===ep)&&tO===eg){tO=eT}return tO}function tm($){if(!$||!$.state){return ew}var ee=$.state;if(ee.window){ee.window=null}$.state=null;return eg}function t_($,ee){var et;if(!$||!$.state){return ew}et=$.state;if((et.wrap&2)===0){return ew}et.head=ee;ee.done=false;return eg}function tv($,ee){var et=ee.length;var en;var eo;var es;if(!$||!$.state){return ew}en=$.state;if(en.wrap!==0&&en.mode!==eF){return ew}if(en.mode===eF){eo=1;eo=ei(eo,ee,et,0);if(eo!==en.check){return eE}}es=th($,ee,et,et);if(es){en.mode=e6;return eS}en.havedict=1;return eg}ee.inflateReset=tr;ee.inflateReset2=tn;ee.inflateResetKeep=tt;ee.inflateInit=tu;ee.inflateInit2=ti;ee.inflate=ty;ee.inflateEnd=tm;ee.inflateGetHeader=t_;ee.inflateSetDictionary=tv;ee.inflateInfo="pako inflate (from Nodeca project)"},9241:($,ee,et)=>{"use strict";var en=et(4236);var ei=15;var eo=852;var es=592;var eu=0;var el=1;var ef=2;var ed=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0];var ep=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78];var eh=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0];var ey=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];$.exports=function $($,ee,et,eg,em,e_,ew,eE){var eS=eE.bits;var eT=0;var eO=0;var eA=0,eI=0;var eN=0;var eD=0;var eR=0;var eC=0;var ek=0;var eM=0;var eL;var eP;var eF;var eB;var eU;var ej=null;var eW=0;var eH;var ez=new en.Buf16(ei+1);var eV=new en.Buf16(ei+1);var e$=null;var eq=0;var eG,eY,eK;for(eT=0;eT<=ei;eT++){ez[eT]=0}for(eO=0;eO<eg;eO++){ez[ee[et+eO]]++}eN=eS;for(eI=ei;eI>=1;eI--){if(ez[eI]!==0){break}}if(eN>eI){eN=eI}if(eI===0){em[e_++]=1<<24|64<<16|0;em[e_++]=1<<24|64<<16|0;eE.bits=1;return 0}for(eA=1;eA<eI;eA++){if(ez[eA]!==0){break}}if(eN<eA){eN=eA}eC=1;for(eT=1;eT<=ei;eT++){eC<<=1;eC-=ez[eT];if(eC<0){return-1}}if(eC>0&&($===eu||eI!==1)){return-1}eV[1]=0;for(eT=1;eT<ei;eT++){eV[eT+1]=eV[eT]+ez[eT]}for(eO=0;eO<eg;eO++){if(ee[et+eO]!==0){ew[eV[ee[et+eO]]++]=eO}}if($===eu){ej=e$=ew;eH=19}else if($===el){ej=ed;eW-=257;e$=ep;eq-=257;eH=256}else{ej=eh;e$=ey;eH=-1}eM=0;eO=0;eT=eA;eU=e_;eD=eN;eR=0;eF=-1;ek=1<<eN;eB=ek-1;if($===el&&ek>eo||$===ef&&ek>es){return 1}for(;;){eG=eT-eR;if(ew[eO]<eH){eY=0;eK=ew[eO]}else if(ew[eO]>eH){eY=e$[eq+ew[eO]];eK=ej[eW+ew[eO]]}else{eY=32+64;eK=0}eL=1<<eT-eR;eP=1<<eD;eA=eP;do{eP-=eL;em[eU+(eM>>eR)+eP]=eG<<24|eY<<16|eK|0}while(eP!==0)eL=1<<eT-1;while(eM&eL){eL>>=1}if(eL!==0){eM&=eL-1;eM+=eL}else{eM=0}eO++;if(--ez[eT]===0){if(eT===eI){break}eT=ee[et+ew[eO]]}if(eT>eN&&(eM&eB)!==eF){if(eR===0){eR=eN}eU+=eA;eD=eT-eR;eC=1<<eD;while(eD+eR<eI){eC-=ez[eD+eR];if(eC<=0){break}eD++;eC<<=1}ek+=1<<eD;if($===el&&ek>eo||$===ef&&ek>es){return 1}eF=eM&eB;em[eF]=eN<<24|eD<<16|eU-e_|0}}if(eM!==0){em[eU+eM]=eT-eR<<24|64<<16|0}eE.bits=eN;return 0}},8898:$=>{"use strict";$.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},342:($,ee,et)=>{"use strict";var en=et(4236);var ei=4;var eo=0;var es=1;var eu=2;function el($){var ee=$.length;while(--ee>=0){$[ee]=0}}var ef=0;var ed=1;var ep=2;var eh=3;var ey=258;var eg=29;var em=256;var e_=em+1+eg;var ew=30;var eE=19;var eS=2*e_+1;var eT=15;var eO=16;var eA=7;var eI=256;var eN=16;var eD=17;var eR=18;var eC=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];var ek=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];var eM=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];var eL=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];var eP=512;var eF=new Array((e_+2)*2);el(eF);var eB=new Array(ew*2);el(eB);var eU=new Array(eP);el(eU);var ej=new Array(ey-eh+1);el(ej);var eW=new Array(eg);el(eW);var eH=new Array(ew);el(eH);function ez($,ee,et,en,ei){this.static_tree=$;this.extra_bits=ee;this.extra_base=et;this.elems=en;this.max_length=ei;this.has_stree=$&&$.length}var eV;var e$;var eq;function eG($,ee){this.dyn_tree=$;this.max_code=0;this.stat_desc=ee}function eY($){return $<256?eU[$]:eU[256+($>>>7)]}function eK($,ee){$.pending_buf[$.pending++]=ee&255;$.pending_buf[$.pending++]=ee>>>8&255}function eZ($,ee,et){if($.bi_valid>eO-et){$.bi_buf|=ee<<$.bi_valid&65535;eK($,$.bi_buf);$.bi_buf=ee>>eO-$.bi_valid;$.bi_valid+=et-eO}else{$.bi_buf|=ee<<$.bi_valid&65535;$.bi_valid+=et}}function eJ($,ee,et){eZ($,et[ee*2],et[ee*2+1])}function eX($,ee){var et=0;do{et|=$&1;$>>>=1;et<<=1}while(--ee>0)return et>>>1}function eQ($){if($.bi_valid===16){eK($,$.bi_buf);$.bi_buf=0;$.bi_valid=0}else if($.bi_valid>=8){$.pending_buf[$.pending++]=$.bi_buf&255;$.bi_buf>>=8;$.bi_valid-=8}}function e0($,ee){var et=ee.dyn_tree;var en=ee.max_code;var ei=ee.stat_desc.static_tree;var eo=ee.stat_desc.has_stree;var es=ee.stat_desc.extra_bits;var eu=ee.stat_desc.extra_base;var el=ee.stat_desc.max_length;var ef;var ed,ep;var eh;var ey;var eg;var em=0;for(eh=0;eh<=eT;eh++){$.bl_count[eh]=0}et[$.heap[$.heap_max]*2+1]=0;for(ef=$.heap_max+1;ef<eS;ef++){ed=$.heap[ef];eh=et[et[ed*2+1]*2+1]+1;if(eh>el){eh=el;em++}et[ed*2+1]=eh;if(ed>en){continue}$.bl_count[eh]++;ey=0;if(ed>=eu){ey=es[ed-eu]}eg=et[ed*2];$.opt_len+=eg*(eh+ey);if(eo){$.static_len+=eg*(ei[ed*2+1]+ey)}}if(em===0){return}do{eh=el-1;while($.bl_count[eh]===0){eh--}$.bl_count[eh]--;$.bl_count[eh+1]+=2;$.bl_count[el]--;em-=2}while(em>0)for(eh=el;eh!==0;eh--){ed=$.bl_count[eh];while(ed!==0){ep=$.heap[--ef];if(ep>en){continue}if(et[ep*2+1]!==eh){$.opt_len+=(eh-et[ep*2+1])*et[ep*2];et[ep*2+1]=eh}ed--}}}function e1($,ee,et){var en=new Array(eT+1);var ei=0;var eo;var es;for(eo=1;eo<=eT;eo++){en[eo]=ei=ei+et[eo-1]<<1}for(es=0;es<=ee;es++){var eu=$[es*2+1];if(eu===0){continue}$[es*2]=eX(en[eu]++,eu)}}function e2(){var $;var ee;var et;var en;var ei;var eo=new Array(eT+1);et=0;for(en=0;en<eg-1;en++){eW[en]=et;for($=0;$<1<<eC[en];$++){ej[et++]=en}}ej[et-1]=en;ei=0;for(en=0;en<16;en++){eH[en]=ei;for($=0;$<1<<ek[en];$++){eU[ei++]=en}}ei>>=7;for(;en<ew;en++){eH[en]=ei<<7;for($=0;$<1<<ek[en]-7;$++){eU[256+ei++]=en}}for(ee=0;ee<=eT;ee++){eo[ee]=0}$=0;while($<=143){eF[$*2+1]=8;$++;eo[8]++}while($<=255){eF[$*2+1]=9;$++;eo[9]++}while($<=279){eF[$*2+1]=7;$++;eo[7]++}while($<=287){eF[$*2+1]=8;$++;eo[8]++}e1(eF,e_+1,eo);for($=0;$<ew;$++){eB[$*2+1]=5;eB[$*2]=eX($,5)}eV=new ez(eF,eC,em+1,e_,eT);e$=new ez(eB,ek,0,ew,eT);eq=new ez(new Array(0),eM,0,eE,eA)}function e6($){var ee;for(ee=0;ee<e_;ee++){$.dyn_ltree[ee*2]=0}for(ee=0;ee<ew;ee++){$.dyn_dtree[ee*2]=0}for(ee=0;ee<eE;ee++){$.bl_tree[ee*2]=0}$.dyn_ltree[eI*2]=1;$.opt_len=$.static_len=0;$.last_lit=$.matches=0}function e4($){if($.bi_valid>8){eK($,$.bi_buf)}else if($.bi_valid>0){$.pending_buf[$.pending++]=$.bi_buf}$.bi_buf=0;$.bi_valid=0}function e3($,ee,et,ei){e4($);if(ei){eK($,et);eK($,~et)}en.arraySet($.pending_buf,$.window,ee,et,$.pending);$.pending+=et}function e8($,ee,et,en){var ei=ee*2;var eo=et*2;return $[ei]<$[eo]||$[ei]===$[eo]&&en[ee]<=en[et]}function e5($,ee,et){var en=$.heap[et];var ei=et<<1;while(ei<=$.heap_len){if(ei<$.heap_len&&e8(ee,$.heap[ei+1],$.heap[ei],$.depth)){ei++}if(e8(ee,en,$.heap[ei],$.depth)){break}$.heap[et]=$.heap[ei];et=ei;ei<<=1}$.heap[et]=en}function e9($,ee,et){var en;var ei;var eo=0;var es;var eu;if($.last_lit!==0){do{en=$.pending_buf[$.d_buf+eo*2]<<8|$.pending_buf[$.d_buf+eo*2+1];ei=$.pending_buf[$.l_buf+eo];eo++;if(en===0){eJ($,ei,ee)}else{es=ej[ei];eJ($,es+em+1,ee);eu=eC[es];if(eu!==0){ei-=eW[es];eZ($,ei,eu)}en--;es=eY(en);eJ($,es,et);eu=ek[es];if(eu!==0){en-=eH[es];eZ($,en,eu)}}}while(eo<$.last_lit)}eJ($,eI,ee)}function e7($,ee){var et=ee.dyn_tree;var en=ee.stat_desc.static_tree;var ei=ee.stat_desc.has_stree;var eo=ee.stat_desc.elems;var es,eu;var el=-1;var ef;$.heap_len=0;$.heap_max=eS;for(es=0;es<eo;es++){if(et[es*2]!==0){$.heap[++$.heap_len]=el=es;$.depth[es]=0}else{et[es*2+1]=0}}while($.heap_len<2){ef=$.heap[++$.heap_len]=el<2?++el:0;et[ef*2]=1;$.depth[ef]=0;$.opt_len--;if(ei){$.static_len-=en[ef*2+1]}}ee.max_code=el;for(es=$.heap_len>>1;es>=1;es--){e5($,et,es)}ef=eo;do{es=$.heap[1];$.heap[1]=$.heap[$.heap_len--];e5($,et,1);eu=$.heap[1];$.heap[--$.heap_max]=es;$.heap[--$.heap_max]=eu;et[ef*2]=et[es*2]+et[eu*2];$.depth[ef]=($.depth[es]>=$.depth[eu]?$.depth[es]:$.depth[eu])+1;et[es*2+1]=et[eu*2+1]=ef;$.heap[1]=ef++;e5($,et,1)}while($.heap_len>=2)$.heap[--$.heap_max]=$.heap[1];e0($,ee);e1(et,el,$.bl_count)}function te($,ee,et){var en;var ei=-1;var eo;var es=ee[0*2+1];var eu=0;var el=7;var ef=4;if(es===0){el=138;ef=3}ee[(et+1)*2+1]=65535;for(en=0;en<=et;en++){eo=es;es=ee[(en+1)*2+1];if(++eu<el&&eo===es){continue}else if(eu<ef){$.bl_tree[eo*2]+=eu}else if(eo!==0){if(eo!==ei){$.bl_tree[eo*2]++}$.bl_tree[eN*2]++}else if(eu<=10){$.bl_tree[eD*2]++}else{$.bl_tree[eR*2]++}eu=0;ei=eo;if(es===0){el=138;ef=3}else if(eo===es){el=6;ef=3}else{el=7;ef=4}}}function tt($,ee,et){var en;var ei=-1;var eo;var es=ee[0*2+1];var eu=0;var el=7;var ef=4;if(es===0){el=138;ef=3}for(en=0;en<=et;en++){eo=es;es=ee[(en+1)*2+1];if(++eu<el&&eo===es){continue}else if(eu<ef){do{eJ($,eo,$.bl_tree)}while(--eu!==0)}else if(eo!==0){if(eo!==ei){eJ($,eo,$.bl_tree);eu--}eJ($,eN,$.bl_tree);eZ($,eu-3,2)}else if(eu<=10){eJ($,eD,$.bl_tree);eZ($,eu-3,3)}else{eJ($,eR,$.bl_tree);eZ($,eu-11,7)}eu=0;ei=eo;if(es===0){el=138;ef=3}else if(eo===es){el=6;ef=3}else{el=7;ef=4}}}function tr($){var ee;te($,$.dyn_ltree,$.l_desc.max_code);te($,$.dyn_dtree,$.d_desc.max_code);e7($,$.bl_desc);for(ee=eE-1;ee>=3;ee--){if($.bl_tree[eL[ee]*2+1]!==0){break}}$.opt_len+=3*(ee+1)+5+5+4;return ee}function tn($,ee,et,en){var ei;eZ($,ee-257,5);eZ($,et-1,5);eZ($,en-4,4);for(ei=0;ei<en;ei++){eZ($,$.bl_tree[eL[ei]*2+1],3)}tt($,$.dyn_ltree,ee-1);tt($,$.dyn_dtree,et-1)}function ti($){var ee=4093624447;var et;for(et=0;et<=31;et++,ee>>>=1){if(ee&1&&$.dyn_ltree[et*2]!==0){return eo}}if($.dyn_ltree[9*2]!==0||$.dyn_ltree[10*2]!==0||$.dyn_ltree[13*2]!==0){return es}for(et=32;et<em;et++){if($.dyn_ltree[et*2]!==0){return es}}return eo}var tu=false;function tc($){if(!tu){e2();tu=true}$.l_desc=new eG($.dyn_ltree,eV);$.d_desc=new eG($.dyn_dtree,e$);$.bl_desc=new eG($.bl_tree,eq);$.bi_buf=0;$.bi_valid=0;e6($)}function tf($,ee,et,en){eZ($,(ef<<1)+(en?1:0),3);e3($,ee,et,true)}function td($){eZ($,ed<<1,3);eJ($,eI,eF);eQ($)}function tp($,ee,et,en){var eo,es;var el=0;if($.level>0){if($.strm.data_type===eu){$.strm.data_type=ti($)}e7($,$.l_desc);e7($,$.d_desc);el=tr($);eo=$.opt_len+3+7>>>3;es=$.static_len+3+7>>>3;if(es<=eo){eo=es}}else{eo=es=et+5}if(et+4<=eo&&ee!==-1){tf($,ee,et,en)}else if($.strategy===ei||es===eo){eZ($,(ed<<1)+(en?1:0),3);e9($,eF,eB)}else{eZ($,(ep<<1)+(en?1:0),3);tn($,$.l_desc.max_code+1,$.d_desc.max_code+1,el+1);e9($,$.dyn_ltree,$.dyn_dtree)}e6($);if(en){e4($)}}function th($,ee,et){$.pending_buf[$.d_buf+$.last_lit*2]=ee>>>8&255;$.pending_buf[$.d_buf+$.last_lit*2+1]=ee&255;$.pending_buf[$.l_buf+$.last_lit]=et&255;$.last_lit++;if(ee===0){$.dyn_ltree[et*2]++}else{$.matches++;ee--;$.dyn_ltree[(ej[et]+em+1)*2]++;$.dyn_dtree[eY(ee)*2]++}return $.last_lit===$.lit_bufsize-1}ee._tr_init=tc;ee._tr_stored_block=tf;ee._tr_flush_block=tp;ee._tr_tally=th;ee._tr_align=td},2292:$=>{"use strict";function ee(){this.input=null;this.next_in=0;this.avail_in=0;this.total_in=0;this.output=null;this.next_out=0;this.avail_out=0;this.total_out=0;this.msg="";this.state=null;this.data_type=2;this.adler=0}$.exports=ee},6470:($,ee,et)=>{"use strict";var en=et(4155);function ei($){if(typeof $!=="string"){throw new TypeError("Path must be a string. Received "+JSON.stringify($))}}function eo($,ee){var et="";var en=0;var ei=-1;var eo=0;var es;for(var eu=0;eu<=$.length;++eu){if(eu<$.length)es=$.charCodeAt(eu);else if(es===47)break;else es=47;if(es===47){if(ei===eu-1||eo===1){}else if(ei!==eu-1&&eo===2){if(et.length<2||en!==2||et.charCodeAt(et.length-1)!==46||et.charCodeAt(et.length-2)!==46){if(et.length>2){var el=et.lastIndexOf("/");if(el!==et.length-1){if(el===-1){et="";en=0}else{et=et.slice(0,el);en=et.length-1-et.lastIndexOf("/")}ei=eu;eo=0;continue}}else if(et.length===2||et.length===1){et="";en=0;ei=eu;eo=0;continue}}if(ee){if(et.length>0)et+="/..";else et="..";en=2}}else{if(et.length>0)et+="/"+$.slice(ei+1,eu);else et=$.slice(ei+1,eu);en=eu-ei-1}ei=eu;eo=0}else if(es===46&&eo!==-1){++eo}else{eo=-1}}return et}function es($,ee){var et=ee.dir||ee.root;var en=ee.base||(ee.name||"")+(ee.ext||"");if(!et){return en}if(et===ee.root){return et+en}return et+$+en}var eu={resolve:function $(){var $="";var ee=false;var et;for(var es=arguments.length-1;es>=-1&&!ee;es--){var eu;if(es>=0)eu=arguments[es];else{if(et===undefined)et=en.cwd();eu=et}ei(eu);if(eu.length===0){continue}$=eu+"/"+$;ee=eu.charCodeAt(0)===47}$=eo($,!ee);if(ee){if($.length>0)return"/"+$;else return"/"}else if($.length>0){return $}else{return"."}},normalize:function $($){ei($);if($.length===0)return".";var ee=$.charCodeAt(0)===47;var et=$.charCodeAt($.length-1)===47;$=eo($,!ee);if($.length===0&&!ee)$=".";if($.length>0&&et)$+="/";if(ee)return"/"+$;return $},isAbsolute:function $($){ei($);return $.length>0&&$.charCodeAt(0)===47},join:function $(){if(arguments.length===0)return".";var $;for(var ee=0;ee<arguments.length;++ee){var et=arguments[ee];ei(et);if(et.length>0){if($===undefined)$=et;else $+="/"+et}}if($===undefined)return".";return eu.normalize($)},relative:function $($,ee){ei($);ei(ee);if($===ee)return"";$=eu.resolve($);ee=eu.resolve(ee);if($===ee)return"";var et=1;for(;et<$.length;++et){if($.charCodeAt(et)!==47)break}var en=$.length;var eo=en-et;var es=1;for(;es<ee.length;++es){if(ee.charCodeAt(es)!==47)break}var el=ee.length;var ef=el-es;var ed=eo<ef?eo:ef;var ep=-1;var eh=0;for(;eh<=ed;++eh){if(eh===ed){if(ef>ed){if(ee.charCodeAt(es+eh)===47){return ee.slice(es+eh+1)}else if(eh===0){return ee.slice(es+eh)}}else if(eo>ed){if($.charCodeAt(et+eh)===47){ep=eh}else if(eh===0){ep=0}}break}var ey=$.charCodeAt(et+eh);var eg=ee.charCodeAt(es+eh);if(ey!==eg)break;else if(ey===47)ep=eh}var em="";for(eh=et+ep+1;eh<=en;++eh){if(eh===en||$.charCodeAt(eh)===47){if(em.length===0)em+="..";else em+="/.."}}if(em.length>0)return em+ee.slice(es+ep);else{es+=ep;if(ee.charCodeAt(es)===47)++es;return ee.slice(es)}},_makeLong:function $($){return $},dirname:function $($){ei($);if($.length===0)return".";var ee=$.charCodeAt(0);var et=ee===47;var en=-1;var eo=true;for(var es=$.length-1;es>=1;--es){ee=$.charCodeAt(es);if(ee===47){if(!eo){en=es;break}}else{eo=false}}if(en===-1)return et?"/":".";if(et&&en===1)return"//";return $.slice(0,en)},basename:function $($,ee){if(ee!==undefined&&typeof ee!=="string")throw new TypeError('"ext" argument must be a string');ei($);var et=0;var en=-1;var eo=true;var es;if(ee!==undefined&&ee.length>0&&ee.length<=$.length){if(ee.length===$.length&&ee===$)return"";var eu=ee.length-1;var el=-1;for(es=$.length-1;es>=0;--es){var ef=$.charCodeAt(es);if(ef===47){if(!eo){et=es+1;break}}else{if(el===-1){eo=false;el=es+1}if(eu>=0){if(ef===ee.charCodeAt(eu)){if(--eu===-1){en=es}}else{eu=-1;en=el}}}}if(et===en)en=el;else if(en===-1)en=$.length;return $.slice(et,en)}else{for(es=$.length-1;es>=0;--es){if($.charCodeAt(es)===47){if(!eo){et=es+1;break}}else if(en===-1){eo=false;en=es+1}}if(en===-1)return"";return $.slice(et,en)}},extname:function $($){ei($);var ee=-1;var et=0;var en=-1;var eo=true;var es=0;for(var eu=$.length-1;eu>=0;--eu){var el=$.charCodeAt(eu);if(el===47){if(!eo){et=eu+1;break}continue}if(en===-1){eo=false;en=eu+1}if(el===46){if(ee===-1)ee=eu;else if(es!==1)es=1}else if(ee!==-1){es=-1}}if(ee===-1||en===-1||es===0||es===1&&ee===en-1&&ee===et+1){return""}return $.slice(ee,en)},format:function $($){if($===null||typeof $!=="object"){throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof $)}return es("/",$)},parse:function $($){ei($);var ee={root:"",dir:"",base:"",ext:"",name:""};if($.length===0)return ee;var et=$.charCodeAt(0);var en=et===47;var eo;if(en){ee.root="/";eo=1}else{eo=0}var es=-1;var eu=0;var el=-1;var ef=true;var ed=$.length-1;var ep=0;for(;ed>=eo;--ed){et=$.charCodeAt(ed);if(et===47){if(!ef){eu=ed+1;break}continue}if(el===-1){ef=false;el=ed+1}if(et===46){if(es===-1)es=ed;else if(ep!==1)ep=1}else if(es!==-1){ep=-1}}if(es===-1||el===-1||ep===0||ep===1&&es===el-1&&es===eu+1){if(el!==-1){if(eu===0&&en)ee.base=ee.name=$.slice(1,el);else ee.base=ee.name=$.slice(eu,el)}}else{if(eu===0&&en){ee.name=$.slice(1,es);ee.base=$.slice(1,el)}else{ee.name=$.slice(eu,es);ee.base=$.slice(eu,el)}ee.ext=$.slice(es,el)}if(eu>0)ee.dir=$.slice(0,eu-1);else if(en)ee.dir="/";return ee},sep:"/",delimiter:":",win32:null,posix:null};eu.posix=eu;$.exports=eu},4155:$=>{var ee=$.exports={};var et;var en;function ei(){throw new Error("setTimeout has not been defined")}function eo(){throw new Error("clearTimeout has not been defined")}(function(){try{if(typeof setTimeout==="function"){et=setTimeout}else{et=ei}}catch($){et=ei}try{if(typeof clearTimeout==="function"){en=clearTimeout}else{en=eo}}catch($){en=eo}})();function es($){if(et===setTimeout){return setTimeout($,0)}if((et===ei||!et)&&setTimeout){et=setTimeout;return setTimeout($,0)}try{return et($,0)}catch(ee){try{return et.call(null,$,0)}catch(ee){return et.call(this,$,0)}}}function eu($){if(en===clearTimeout){return clearTimeout($)}if((en===eo||!en)&&clearTimeout){en=clearTimeout;return clearTimeout($)}try{return en($)}catch(ee){try{return en.call(null,$)}catch(ee){return en.call(this,$)}}}var el=[];var ef=false;var ed;var ep=-1;function eh(){if(!ef||!ed){return}ef=false;if(ed.length){el=ed.concat(el)}else{ep=-1}if(el.length){ey()}}function ey(){if(ef){return}var $=es(eh);ef=true;var ee=el.length;while(ee){ed=el;el=[];while(++ep<ee){if(ed){ed[ep].run()}}ep=-1;ee=el.length}ed=null;ef=false;eu($)}ee.nextTick=function($){var ee=new Array(arguments.length-1);if(arguments.length>1){for(var et=1;et<arguments.length;et++){ee[et-1]=arguments[et]}}el.push(new eg($,ee));if(el.length===1&&!ef){es(ey)}};function eg($,ee){this.fun=$;this.array=ee}eg.prototype.run=function(){this.fun.apply(null,this.array)};ee.title="browser";ee.browser=true;ee.env={};ee.argv=[];ee.version="";ee.versions={};function em(){}ee.on=em;ee.addListener=em;ee.once=em;ee.off=em;ee.removeListener=em;ee.removeAllListeners=em;ee.emit=em;ee.prependListener=em;ee.prependOnceListener=em;ee.listeners=function($){return[]};ee.binding=function($){throw new Error("process.binding is not supported")};ee.cwd=function(){return"/"};ee.chdir=function($){throw new Error("process.chdir is not supported")};ee.umask=function(){return 0}},4281:$=>{"use strict";function ee($,ee){$.prototype=Object.create(ee.prototype);$.prototype.constructor=$;$.__proto__=ee}var et={};function en($,en,ei){if(!ei){ei=Error}function eo($,ee,et){if(typeof en==="string"){return en}else{return en($,ee,et)}}var es=function($){ee(et,$);function et(ee,et,en){return $.call(this,eo(ee,et,en))||this}return et}(ei);es.prototype.name=ei.name;es.prototype.code=$;et[$]=es}function ei($,ee){if(Array.isArray($)){var et=$.length;$=$.map(function($){return String($)});if(et>2){return"one of ".concat(ee," ").concat($.slice(0,et-1).join(", "),", or ")+$[et-1]}else if(et===2){return"one of ".concat(ee," ").concat($[0]," or ").concat($[1])}else{return"of ".concat(ee," ").concat($[0])}}else{return"of ".concat(ee," ").concat(String($))}}function eo($,ee,et){return $.substr(!et||et<0?0:+et,ee.length)===ee}function es($,ee,et){if(et===undefined||et>$.length){et=$.length}return $.substring(et-ee.length,et)===ee}function eu($,ee,et){if(typeof et!=="number"){et=0}if(et+ee.length>$.length){return false}else{return $.indexOf(ee,et)!==-1}}en("ERR_INVALID_OPT_VALUE",function($,ee){return'The value "'+ee+'" is invalid for option "'+$+'"'},TypeError);en("ERR_INVALID_ARG_TYPE",function($,ee,et){var en;if(typeof ee==="string"&&eo(ee,"not ")){en="must not be";ee=ee.replace(/^not /,"")}else{en="must be"}var el;if(es($," argument")){el="The ".concat($," ").concat(en," ").concat(ei(ee,"type"))}else{var ef=eu($,".")?"property":"argument";el='The "'.concat($,'" ').concat(ef," ").concat(en," ").concat(ei(ee,"type"))}el+=". Received type ".concat(typeof et);return el},TypeError);en("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");en("ERR_METHOD_NOT_IMPLEMENTED",function($){return"The "+$+" method is not implemented"});en("ERR_STREAM_PREMATURE_CLOSE","Premature close");en("ERR_STREAM_DESTROYED",function($){return"Cannot call "+$+" after a stream was destroyed"});en("ERR_MULTIPLE_CALLBACK","Callback called multiple times");en("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");en("ERR_STREAM_WRITE_AFTER_END","write after end");en("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);en("ERR_UNKNOWN_ENCODING",function($){return"Unknown encoding: "+$},TypeError);en("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");$.exports.q=et},6753:($,ee,et)=>{"use strict";var en=et(4155);var ei=Object.keys||function($){var ee=[];for(var et in $)ee.push(et);return ee};$.exports=ed;var eo=et(9481);var es=et(4229);et(5717)(ed,eo);{var eu=ei(es.prototype);for(var el=0;el<eu.length;el++){var ef=eu[el];if(!ed.prototype[ef])ed.prototype[ef]=es.prototype[ef]}}function ed($){if(!(this instanceof ed))return new ed($);eo.call(this,$);es.call(this,$);this.allowHalfOpen=true;if($){if($.readable===false)this.readable=false;if($.writable===false)this.writable=false;if($.allowHalfOpen===false){this.allowHalfOpen=false;this.once("end",ep)}}}Object.defineProperty(ed.prototype,"writableHighWaterMark",{enumerable:false,get:function $(){return this._writableState.highWaterMark}});Object.defineProperty(ed.prototype,"writableBuffer",{enumerable:false,get:function $(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(ed.prototype,"writableLength",{enumerable:false,get:function $(){return this._writableState.length}});function ep(){if(this._writableState.ended)return;en.nextTick(eh,this)}function eh($){$.end()}Object.defineProperty(ed.prototype,"destroyed",{enumerable:false,get:function $(){if(this._readableState===undefined||this._writableState===undefined){return false}return this._readableState.destroyed&&this._writableState.destroyed},set:function $($){if(this._readableState===undefined||this._writableState===undefined){return}this._readableState.destroyed=$;this._writableState.destroyed=$}})},2725:($,ee,et)=>{"use strict";$.exports=ei;var en=et(4605);et(5717)(ei,en);function ei($){if(!(this instanceof ei))return new ei($);en.call(this,$)}ei.prototype._transform=function($,ee,et){et(null,$)}},9481:($,ee,et)=>{"use strict";var en=et(4155);$.exports=eL;var ei;eL.ReadableState=eM;var eo=et(7187).EventEmitter;var es=function $($,ee){return $.listeners(ee).length};var eu=et(2503);var el=et(8764).Buffer;var ef=(typeof et.g!=="undefined"?et.g:typeof window!=="undefined"?window:typeof self!=="undefined"?self:{}).Uint8Array||function(){};function ed($){return el.from($)}function ep($){return el.isBuffer($)||$ instanceof ef}var eh=et(4616);var ey;if(eh&&eh.debuglog){ey=eh.debuglog("stream")}else{ey=function $(){}}var eg=et(7327);var em=et(1195);var e_=et(2457),ew=e_.getHighWaterMark;var eE=et(4281).q,eS=eE.ERR_INVALID_ARG_TYPE,eT=eE.ERR_STREAM_PUSH_AFTER_EOF,eO=eE.ERR_METHOD_NOT_IMPLEMENTED,eA=eE.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;var eI;var eN;var eD;et(5717)(eL,eu);var eR=em.errorOrDestroy;var eC=["error","close","destroy","pause","resume"];function ek($,ee,et){if(typeof $.prependListener==="function")return $.prependListener(ee,et);if(!$._events||!$._events[ee])$.on(ee,et);else if(Array.isArray($._events[ee]))$._events[ee].unshift(et);else $._events[ee]=[et,$._events[ee]]}function eM($,ee,en){ei=ei||et(6753);$=$||{};if(typeof en!=="boolean")en=ee instanceof ei;this.objectMode=!!$.objectMode;if(en)this.objectMode=this.objectMode||!!$.readableObjectMode;this.highWaterMark=ew(this,$,"readableHighWaterMark",en);this.buffer=new eg;this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=null;this.ended=false;this.endEmitted=false;this.reading=false;this.sync=true;this.needReadable=false;this.emittedReadable=false;this.readableListening=false;this.resumeScheduled=false;this.paused=true;this.emitClose=$.emitClose!==false;this.autoDestroy=!!$.autoDestroy;this.destroyed=false;this.defaultEncoding=$.defaultEncoding||"utf8";this.awaitDrain=0;this.readingMore=false;this.decoder=null;this.encoding=null;if($.encoding){if(!eI)eI=et(4626).s;this.decoder=new eI($.encoding);this.encoding=$.encoding}}function eL($){ei=ei||et(6753);if(!(this instanceof eL))return new eL($);var ee=this instanceof ei;this._readableState=new eM($,this,ee);this.readable=true;if($){if(typeof $.read==="function")this._read=$.read;if(typeof $.destroy==="function")this._destroy=$.destroy}eu.call(this)}Object.defineProperty(eL.prototype,"destroyed",{enumerable:false,get:function $(){if(this._readableState===undefined){return false}return this._readableState.destroyed},set:function $($){if(!this._readableState){return}this._readableState.destroyed=$}});eL.prototype.destroy=em.destroy;eL.prototype._undestroy=em.undestroy;eL.prototype._destroy=function($,ee){ee($)};eL.prototype.push=function($,ee){var et=this._readableState;var en;if(!et.objectMode){if(typeof $==="string"){ee=ee||et.defaultEncoding;if(ee!==et.encoding){$=el.from($,ee);ee=""}en=true}}else{en=true}return eP(this,$,ee,false,en)};eL.prototype.unshift=function($){return eP(this,$,null,true,false)};function eP($,ee,et,en,ei){ey("readableAddChunk",ee);var eo=$._readableState;if(ee===null){eo.reading=false;eH($,eo)}else{var es;if(!ei)es=eB(eo,ee);if(es){eR($,es)}else if(eo.objectMode||ee&&ee.length>0){if(typeof ee!=="string"&&!eo.objectMode&&Object.getPrototypeOf(ee)!==el.prototype){ee=ed(ee)}if(en){if(eo.endEmitted)eR($,new eA);else eF($,eo,ee,true)}else if(eo.ended){eR($,new eT)}else if(eo.destroyed){return false}else{eo.reading=false;if(eo.decoder&&!et){ee=eo.decoder.write(ee);if(eo.objectMode||ee.length!==0)eF($,eo,ee,false);else e$($,eo)}else{eF($,eo,ee,false)}}}else if(!en){eo.reading=false;e$($,eo)}}return!eo.ended&&(eo.length<eo.highWaterMark||eo.length===0)}function eF($,ee,et,en){if(ee.flowing&&ee.length===0&&!ee.sync){ee.awaitDrain=0;$.emit("data",et)}else{ee.length+=ee.objectMode?1:et.length;if(en)ee.buffer.unshift(et);else ee.buffer.push(et);if(ee.needReadable)ez($)}e$($,ee)}function eB($,ee){var et;if(!ep(ee)&&typeof ee!=="string"&&ee!==undefined&&!$.objectMode){et=new eS("chunk",["string","Buffer","Uint8Array"],ee)}return et}eL.prototype.isPaused=function(){return this._readableState.flowing===false};eL.prototype.setEncoding=function($){if(!eI)eI=et(4626).s;var ee=new eI($);this._readableState.decoder=ee;this._readableState.encoding=this._readableState.decoder.encoding;var en=this._readableState.buffer.head;var ei="";while(en!==null){ei+=ee.write(en.data);en=en.next}this._readableState.buffer.clear();if(ei!=="")this._readableState.buffer.push(ei);this._readableState.length=ei.length;return this};var eU=1073741824;function ej($){if($>=eU){$=eU}else{$--;$|=$>>>1;$|=$>>>2;$|=$>>>4;$|=$>>>8;$|=$>>>16;$++}return $}function eW($,ee){if($<=0||ee.length===0&&ee.ended)return 0;if(ee.objectMode)return 1;if($!==$){if(ee.flowing&&ee.length)return ee.buffer.head.data.length;else return ee.length}if($>ee.highWaterMark)ee.highWaterMark=ej($);if($<=ee.length)return $;if(!ee.ended){ee.needReadable=true;return 0}return ee.length}eL.prototype.read=function($){ey("read",$);$=parseInt($,10);var ee=this._readableState;var et=$;if($!==0)ee.emittedReadable=false;if($===0&&ee.needReadable&&((ee.highWaterMark!==0?ee.length>=ee.highWaterMark:ee.length>0)||ee.ended)){ey("read: emitReadable",ee.length,ee.ended);if(ee.length===0&&ee.ended)e0(this);else ez(this);return null}$=eW($,ee);if($===0&&ee.ended){if(ee.length===0)e0(this);return null}var en=ee.needReadable;ey("need readable",en);if(ee.length===0||ee.length-$<ee.highWaterMark){en=true;ey("length less than watermark",en)}if(ee.ended||ee.reading){en=false;ey("reading or ended",en)}else if(en){ey("do read");ee.reading=true;ee.sync=true;if(ee.length===0)ee.needReadable=true;this._read(ee.highWaterMark);ee.sync=false;if(!ee.reading)$=eW(et,ee)}var ei;if($>0)ei=eQ($,ee);else ei=null;if(ei===null){ee.needReadable=ee.length<=ee.highWaterMark;$=0}else{ee.length-=$;ee.awaitDrain=0}if(ee.length===0){if(!ee.ended)ee.needReadable=true;if(et!==$&&ee.ended)e0(this)}if(ei!==null)this.emit("data",ei);return ei};function eH($,ee){ey("onEofChunk");if(ee.ended)return;if(ee.decoder){var et=ee.decoder.end();if(et&&et.length){ee.buffer.push(et);ee.length+=ee.objectMode?1:et.length}}ee.ended=true;if(ee.sync){ez($)}else{ee.needReadable=false;if(!ee.emittedReadable){ee.emittedReadable=true;eV($)}}}function ez($){var ee=$._readableState;ey("emitReadable",ee.needReadable,ee.emittedReadable);ee.needReadable=false;if(!ee.emittedReadable){ey("emitReadable",ee.flowing);ee.emittedReadable=true;en.nextTick(eV,$)}}function eV($){var ee=$._readableState;ey("emitReadable_",ee.destroyed,ee.length,ee.ended);if(!ee.destroyed&&(ee.length||ee.ended)){$.emit("readable");ee.emittedReadable=false}ee.needReadable=!ee.flowing&&!ee.ended&&ee.length<=ee.highWaterMark;eX($)}function e$($,ee){if(!ee.readingMore){ee.readingMore=true;en.nextTick(eq,$,ee)}}function eq($,ee){while(!ee.reading&&!ee.ended&&(ee.length<ee.highWaterMark||ee.flowing&&ee.length===0)){var et=ee.length;ey("maybeReadMore read 0");$.read(0);if(et===ee.length)break}ee.readingMore=false}eL.prototype._read=function($){eR(this,new eO("_read()"))};eL.prototype.pipe=function($,ee){var et=this;var ei=this._readableState;switch(ei.pipesCount){case 0:ei.pipes=$;break;case 1:ei.pipes=[ei.pipes,$];break;default:ei.pipes.push($);break}ei.pipesCount+=1;ey("pipe count=%d opts=%j",ei.pipesCount,ee);var eo=(!ee||ee.end!==false)&&$!==en.stdout&&$!==en.stderr;var eu=eo?ef:eE;if(ei.endEmitted)en.nextTick(eu);else et.once("end",eu);$.on("unpipe",el);function el($,ee){ey("onunpipe");if($===et){if(ee&&ee.hasUnpiped===false){ee.hasUnpiped=true;eh()}}}function ef(){ey("onend");$.end()}var ed=eG(et);$.on("drain",ed);var ep=false;function eh(){ey("cleanup");$.removeListener("close",e_);$.removeListener("finish",ew);$.removeListener("drain",ed);$.removeListener("error",em);$.removeListener("unpipe",el);et.removeListener("end",ef);et.removeListener("end",eE);et.removeListener("data",eg);ep=true;if(ei.awaitDrain&&(!$._writableState||$._writableState.needDrain))ed()}et.on("data",eg);function eg(ee){ey("ondata");var en=$.write(ee);ey("dest.write",en);if(en===false){if((ei.pipesCount===1&&ei.pipes===$||ei.pipesCount>1&&e2(ei.pipes,$)!==-1)&&!ep){ey("false write response, pause",ei.awaitDrain);ei.awaitDrain++}et.pause()}}function em(ee){ey("onerror",ee);eE();$.removeListener("error",em);if(es($,"error")===0)eR($,ee)}ek($,"error",em);function e_(){$.removeListener("finish",ew);eE()}$.once("close",e_);function ew(){ey("onfinish");$.removeListener("close",e_);eE()}$.once("finish",ew);function eE(){ey("unpipe");et.unpipe($)}$.emit("pipe",et);if(!ei.flowing){ey("pipe resume");et.resume()}return $};function eG($){return function ee(){var ee=$._readableState;ey("pipeOnDrain",ee.awaitDrain);if(ee.awaitDrain)ee.awaitDrain--;if(ee.awaitDrain===0&&es($,"data")){ee.flowing=true;eX($)}}}eL.prototype.unpipe=function($){var ee=this._readableState;var et={hasUnpiped:false};if(ee.pipesCount===0)return this;if(ee.pipesCount===1){if($&&$!==ee.pipes)return this;if(!$)$=ee.pipes;ee.pipes=null;ee.pipesCount=0;ee.flowing=false;if($)$.emit("unpipe",this,et);return this}if(!$){var en=ee.pipes;var ei=ee.pipesCount;ee.pipes=null;ee.pipesCount=0;ee.flowing=false;for(var eo=0;eo<ei;eo++)en[eo].emit("unpipe",this,{hasUnpiped:false});return this}var es=e2(ee.pipes,$);if(es===-1)return this;ee.pipes.splice(es,1);ee.pipesCount-=1;if(ee.pipesCount===1)ee.pipes=ee.pipes[0];$.emit("unpipe",this,et);return this};eL.prototype.on=function($,ee){var et=eu.prototype.on.call(this,$,ee);var ei=this._readableState;if($==="data"){ei.readableListening=this.listenerCount("readable")>0;if(ei.flowing!==false)this.resume()}else if($==="readable"){if(!ei.endEmitted&&!ei.readableListening){ei.readableListening=ei.needReadable=true;ei.flowing=false;ei.emittedReadable=false;ey("on readable",ei.length,ei.reading);if(ei.length){ez(this)}else if(!ei.reading){en.nextTick(eK,this)}}}return et};eL.prototype.addListener=eL.prototype.on;eL.prototype.removeListener=function($,ee){var et=eu.prototype.removeListener.call(this,$,ee);if($==="readable"){en.nextTick(eY,this)}return et};eL.prototype.removeAllListeners=function($){var ee=eu.prototype.removeAllListeners.apply(this,arguments);if($==="readable"||$===undefined){en.nextTick(eY,this)}return ee};function eY($){var ee=$._readableState;ee.readableListening=$.listenerCount("readable")>0;if(ee.resumeScheduled&&!ee.paused){ee.flowing=true}else if($.listenerCount("data")>0){$.resume()}}function eK($){ey("readable nexttick read 0");$.read(0)}eL.prototype.resume=function(){var $=this._readableState;if(!$.flowing){ey("resume");$.flowing=!$.readableListening;eZ(this,$)}$.paused=false;return this};function eZ($,ee){if(!ee.resumeScheduled){ee.resumeScheduled=true;en.nextTick(eJ,$,ee)}}function eJ($,ee){ey("resume",ee.reading);if(!ee.reading){$.read(0)}ee.resumeScheduled=false;$.emit("resume");eX($);if(ee.flowing&&!ee.reading)$.read(0)}eL.prototype.pause=function(){ey("call pause flowing=%j",this._readableState.flowing);if(this._readableState.flowing!==false){ey("pause");this._readableState.flowing=false;this.emit("pause")}this._readableState.paused=true;return this};function eX($){var ee=$._readableState;ey("flow",ee.flowing);while(ee.flowing&&$.read()!==null);}eL.prototype.wrap=function($){var ee=this;var et=this._readableState;var en=false;$.on("end",function(){ey("wrapped end");if(et.decoder&&!et.ended){var $=et.decoder.end();if($&&$.length)ee.push($)}ee.push(null)});$.on("data",function(ei){ey("wrapped data");if(et.decoder)ei=et.decoder.write(ei);if(et.objectMode&&(ei===null||ei===undefined))return;else if(!et.objectMode&&(!ei||!ei.length))return;var eo=ee.push(ei);if(!eo){en=true;$.pause()}});for(var ei in $){if(this[ei]===undefined&&typeof $[ei]==="function"){this[ei]=function ee(ee){return function et(){return $[ee].apply($,arguments)}}(ei)}}for(var eo=0;eo<eC.length;eo++){$.on(eC[eo],this.emit.bind(this,eC[eo]))}this._read=function(ee){ey("wrapped _read",ee);if(en){en=false;$.resume()}};return this};if(typeof Symbol==="function"){eL.prototype[Symbol.asyncIterator]=function(){if(eN===undefined){eN=et(5850)}return eN(this)}}Object.defineProperty(eL.prototype,"readableHighWaterMark",{enumerable:false,get:function $(){return this._readableState.highWaterMark}});Object.defineProperty(eL.prototype,"readableBuffer",{enumerable:false,get:function $(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(eL.prototype,"readableFlowing",{enumerable:false,get:function $(){return this._readableState.flowing},set:function $($){if(this._readableState){this._readableState.flowing=$}}});eL._fromList=eQ;Object.defineProperty(eL.prototype,"readableLength",{enumerable:false,get:function $(){return this._readableState.length}});function eQ($,ee){if(ee.length===0)return null;var et;if(ee.objectMode)et=ee.buffer.shift();else if(!$||$>=ee.length){if(ee.decoder)et=ee.buffer.join("");else if(ee.buffer.length===1)et=ee.buffer.first();else et=ee.buffer.concat(ee.length);ee.buffer.clear()}else{et=ee.buffer.consume($,ee.decoder)}return et}function e0($){var ee=$._readableState;ey("endReadable",ee.endEmitted);if(!ee.endEmitted){ee.ended=true;en.nextTick(e1,ee,$)}}function e1($,ee){ey("endReadableNT",$.endEmitted,$.length);if(!$.endEmitted&&$.length===0){$.endEmitted=true;ee.readable=false;ee.emit("end");if($.autoDestroy){var et=ee._writableState;if(!et||et.autoDestroy&&et.finished){ee.destroy()}}}}if(typeof Symbol==="function"){eL.from=function($,ee){if(eD===undefined){eD=et(5167)}return eD(eL,$,ee)}}function e2($,ee){for(var et=0,en=$.length;et<en;et++){if($[et]===ee)return et}return-1}},4605:($,ee,et)=>{"use strict";$.exports=ed;var en=et(4281).q,ei=en.ERR_METHOD_NOT_IMPLEMENTED,eo=en.ERR_MULTIPLE_CALLBACK,es=en.ERR_TRANSFORM_ALREADY_TRANSFORMING,eu=en.ERR_TRANSFORM_WITH_LENGTH_0;var el=et(6753);et(5717)(ed,el);function ef($,ee){var et=this._transformState;et.transforming=false;var en=et.writecb;if(en===null){return this.emit("error",new eo)}et.writechunk=null;et.writecb=null;if(ee!=null)this.push(ee);en($);var ei=this._readableState;ei.reading=false;if(ei.needReadable||ei.length<ei.highWaterMark){this._read(ei.highWaterMark)}}function ed($){if(!(this instanceof ed))return new ed($);el.call(this,$);this._transformState={afterTransform:ef.bind(this),needTransform:false,transforming:false,writecb:null,writechunk:null,writeencoding:null};this._readableState.needReadable=true;this._readableState.sync=false;if($){if(typeof $.transform==="function")this._transform=$.transform;if(typeof $.flush==="function")this._flush=$.flush}this.on("prefinish",ep)}function ep(){var $=this;if(typeof this._flush==="function"&&!this._readableState.destroyed){this._flush(function(ee,et){eh($,ee,et)})}else{eh(this,null,null)}}ed.prototype.push=function($,ee){this._transformState.needTransform=false;return el.prototype.push.call(this,$,ee)};ed.prototype._transform=function($,ee,et){et(new ei("_transform()"))};ed.prototype._write=function($,ee,et){var en=this._transformState;en.writecb=et;en.writechunk=$;en.writeencoding=ee;if(!en.transforming){var ei=this._readableState;if(en.needTransform||ei.needReadable||ei.length<ei.highWaterMark)this._read(ei.highWaterMark)}};ed.prototype._read=function($){var ee=this._transformState;if(ee.writechunk!==null&&!ee.transforming){ee.transforming=true;this._transform(ee.writechunk,ee.writeencoding,ee.afterTransform)}else{ee.needTransform=true}};ed.prototype._destroy=function($,ee){el.prototype._destroy.call(this,$,function($){ee($)})};function eh($,ee,et){if(ee)return $.emit("error",ee);if(et!=null)$.push(et);if($._writableState.length)throw new eu;if($._transformState.transforming)throw new es;return $.push(null)}},4229:($,ee,et)=>{"use strict";var en=et(4155);$.exports=eM;function ei($,ee,et){this.chunk=$;this.encoding=ee;this.callback=et;this.next=null}function eo($){var ee=this;this.next=null;this.entry=null;this.finish=function(){eJ(ee,$)}}var es;eM.WritableState=eC;var eu={deprecate:et(4927)};var el=et(2503);var ef=et(8764).Buffer;var ed=(typeof et.g!=="undefined"?et.g:typeof window!=="undefined"?window:typeof self!=="undefined"?self:{}).Uint8Array||function(){};function ep($){return ef.from($)}function eh($){return ef.isBuffer($)||$ instanceof ed}var ey=et(1195);var eg=et(2457),em=eg.getHighWaterMark;var e_=et(4281).q,ew=e_.ERR_INVALID_ARG_TYPE,eE=e_.ERR_METHOD_NOT_IMPLEMENTED,eS=e_.ERR_MULTIPLE_CALLBACK,eT=e_.ERR_STREAM_CANNOT_PIPE,eO=e_.ERR_STREAM_DESTROYED,eA=e_.ERR_STREAM_NULL_VALUES,eI=e_.ERR_STREAM_WRITE_AFTER_END,eN=e_.ERR_UNKNOWN_ENCODING;var eD=ey.errorOrDestroy;et(5717)(eM,el);function eR(){}function eC($,ee,en){es=es||et(6753);$=$||{};if(typeof en!=="boolean")en=ee instanceof es;this.objectMode=!!$.objectMode;if(en)this.objectMode=this.objectMode||!!$.writableObjectMode;this.highWaterMark=em(this,$,"writableHighWaterMark",en);this.finalCalled=false;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;this.destroyed=false;var ei=$.decodeStrings===false;this.decodeStrings=!ei;this.defaultEncoding=$.defaultEncoding||"utf8";this.length=0;this.writing=false;this.corked=0;this.sync=true;this.bufferProcessing=false;this.onwrite=function($){eH(ee,$)};this.writecb=null;this.writelen=0;this.bufferedRequest=null;this.lastBufferedRequest=null;this.pendingcb=0;this.prefinished=false;this.errorEmitted=false;this.emitClose=$.emitClose!==false;this.autoDestroy=!!$.autoDestroy;this.bufferedRequestCount=0;this.corkedRequestsFree=new eo(this)}eC.prototype.getBuffer=function $(){var $=this.bufferedRequest;var ee=[];while($){ee.push($);$=$.next}return ee};(function(){try{Object.defineProperty(eC.prototype,"buffer",{get:eu.deprecate(function $(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer "+"instead.","DEP0003")})}catch($){}})();var ek;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function"){ek=Function.prototype[Symbol.hasInstance];Object.defineProperty(eM,Symbol.hasInstance,{value:function $($){if(ek.call(this,$))return true;if(this!==eM)return false;return $&&$._writableState instanceof eC}})}else{ek=function $($){return $ instanceof this}}function eM($){es=es||et(6753);var ee=this instanceof es;if(!ee&&!ek.call(eM,this))return new eM($);this._writableState=new eC($,this,ee);this.writable=true;if($){if(typeof $.write==="function")this._write=$.write;if(typeof $.writev==="function")this._writev=$.writev;if(typeof $.destroy==="function")this._destroy=$.destroy;if(typeof $.final==="function")this._final=$.final}el.call(this)}eM.prototype.pipe=function(){eD(this,new eT)};function eL($,ee){var et=new eI;eD($,et);en.nextTick(ee,et)}function eP($,ee,et,ei){var eo;if(et===null){eo=new eA}else if(typeof et!=="string"&&!ee.objectMode){eo=new ew("chunk",["string","Buffer"],et)}if(eo){eD($,eo);en.nextTick(ei,eo);return false}return true}eM.prototype.write=function($,ee,et){var en=this._writableState;var ei=false;var eo=!en.objectMode&&eh($);if(eo&&!ef.isBuffer($)){$=ep($)}if(typeof ee==="function"){et=ee;ee=null}if(eo)ee="buffer";else if(!ee)ee=en.defaultEncoding;if(typeof et!=="function")et=eR;if(en.ending)eL(this,et);else if(eo||eP(this,en,$,et)){en.pendingcb++;ei=eB(this,en,eo,$,ee,et)}return ei};eM.prototype.cork=function(){this._writableState.corked++};eM.prototype.uncork=function(){var $=this._writableState;if($.corked){$.corked--;if(!$.writing&&!$.corked&&!$.bufferProcessing&&$.bufferedRequest)e$(this,$)}};eM.prototype.setDefaultEncoding=function $($){if(typeof $==="string")$=$.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf(($+"").toLowerCase())>-1))throw new eN($);this._writableState.defaultEncoding=$;return this};Object.defineProperty(eM.prototype,"writableBuffer",{enumerable:false,get:function $(){return this._writableState&&this._writableState.getBuffer()}});function eF($,ee,et){if(!$.objectMode&&$.decodeStrings!==false&&typeof ee==="string"){ee=ef.from(ee,et)}return ee}Object.defineProperty(eM.prototype,"writableHighWaterMark",{enumerable:false,get:function $(){return this._writableState.highWaterMark}});function eB($,ee,et,en,ei,eo){if(!et){var es=eF(ee,en,ei);if(en!==es){et=true;ei="buffer";en=es}}var eu=ee.objectMode?1:en.length;ee.length+=eu;var el=ee.length<ee.highWaterMark;if(!el)ee.needDrain=true;if(ee.writing||ee.corked){var ef=ee.lastBufferedRequest;ee.lastBufferedRequest={chunk:en,encoding:ei,isBuf:et,callback:eo,next:null};if(ef){ef.next=ee.lastBufferedRequest}else{ee.bufferedRequest=ee.lastBufferedRequest}ee.bufferedRequestCount+=1}else{eU($,ee,false,eu,en,ei,eo)}return el}function eU($,ee,et,en,ei,eo,es){ee.writelen=en;ee.writecb=es;ee.writing=true;ee.sync=true;if(ee.destroyed)ee.onwrite(new eO("write"));else if(et)$._writev(ei,ee.onwrite);else $._write(ei,eo,ee.onwrite);ee.sync=false}function ej($,ee,et,ei,eo){--ee.pendingcb;if(et){en.nextTick(eo,ei);en.nextTick(eK,$,ee);$._writableState.errorEmitted=true;eD($,ei)}else{eo(ei);$._writableState.errorEmitted=true;eD($,ei);eK($,ee)}}function eW($){$.writing=false;$.writecb=null;$.length-=$.writelen;$.writelen=0}function eH($,ee){var et=$._writableState;var ei=et.sync;var eo=et.writecb;if(typeof eo!=="function")throw new eS;eW(et);if(ee)ej($,et,ei,ee,eo);else{var es=eq(et)||$.destroyed;if(!es&&!et.corked&&!et.bufferProcessing&&et.bufferedRequest){e$($,et)}if(ei){en.nextTick(ez,$,et,es,eo)}else{ez($,et,es,eo)}}}function ez($,ee,et,en){if(!et)eV($,ee);ee.pendingcb--;en();eK($,ee)}function eV($,ee){if(ee.length===0&&ee.needDrain){ee.needDrain=false;$.emit("drain")}}function e$($,ee){ee.bufferProcessing=true;var et=ee.bufferedRequest;if($._writev&&et&&et.next){var en=ee.bufferedRequestCount;var ei=new Array(en);var es=ee.corkedRequestsFree;es.entry=et;var eu=0;var el=true;while(et){ei[eu]=et;if(!et.isBuf)el=false;et=et.next;eu+=1}ei.allBuffers=el;eU($,ee,true,ee.length,ei,"",es.finish);ee.pendingcb++;ee.lastBufferedRequest=null;if(es.next){ee.corkedRequestsFree=es.next;es.next=null}else{ee.corkedRequestsFree=new eo(ee)}ee.bufferedRequestCount=0}else{while(et){var ef=et.chunk;var ed=et.encoding;var ep=et.callback;var eh=ee.objectMode?1:ef.length;eU($,ee,false,eh,ef,ed,ep);et=et.next;ee.bufferedRequestCount--;if(ee.writing){break}}if(et===null)ee.lastBufferedRequest=null}ee.bufferedRequest=et;ee.bufferProcessing=false}eM.prototype._write=function($,ee,et){et(new eE("_write()"))};eM.prototype._writev=null;eM.prototype.end=function($,ee,et){var en=this._writableState;if(typeof $==="function"){et=$;$=null;ee=null}else if(typeof ee==="function"){et=ee;ee=null}if($!==null&&$!==undefined)this.write($,ee);if(en.corked){en.corked=1;this.uncork()}if(!en.ending)eZ(this,en,et);return this};Object.defineProperty(eM.prototype,"writableLength",{enumerable:false,get:function $(){return this._writableState.length}});function eq($){return $.ending&&$.length===0&&$.bufferedRequest===null&&!$.finished&&!$.writing}function eG($,ee){$._final(function(et){ee.pendingcb--;if(et){eD($,et)}ee.prefinished=true;$.emit("prefinish");eK($,ee)})}function eY($,ee){if(!ee.prefinished&&!ee.finalCalled){if(typeof $._final==="function"&&!ee.destroyed){ee.pendingcb++;ee.finalCalled=true;en.nextTick(eG,$,ee)}else{ee.prefinished=true;$.emit("prefinish")}}}function eK($,ee){var et=eq(ee);if(et){eY($,ee);if(ee.pendingcb===0){ee.finished=true;$.emit("finish");if(ee.autoDestroy){var en=$._readableState;if(!en||en.autoDestroy&&en.endEmitted){$.destroy()}}}}return et}function eZ($,ee,et){ee.ending=true;eK($,ee);if(et){if(ee.finished)en.nextTick(et);else $.once("finish",et)}ee.ended=true;$.writable=false}function eJ($,ee,et){var en=$.entry;$.entry=null;while(en){var ei=en.callback;ee.pendingcb--;ei(et);en=en.next}ee.corkedRequestsFree.next=$}Object.defineProperty(eM.prototype,"destroyed",{enumerable:false,get:function $(){if(this._writableState===undefined){return false}return this._writableState.destroyed},set:function $($){if(!this._writableState){return}this._writableState.destroyed=$}});eM.prototype.destroy=ey.destroy;eM.prototype._undestroy=ey.undestroy;eM.prototype._destroy=function($,ee){ee($)}},5850:($,ee,et)=>{"use strict";var en=et(4155);var ei;function eo($,ee,et){ee=es(ee);if(ee in $){Object.defineProperty($,ee,{value:et,enumerable:true,configurable:true,writable:true})}else{$[ee]=et}return $}function es($){var ee=eu($,"string");return typeof ee==="symbol"?ee:String(ee)}function eu($,ee){if(typeof $!=="object"||$===null)return $;var et=$[Symbol.toPrimitive];if(et!==undefined){var en=et.call($,ee||"default");if(typeof en!=="object")return en;throw new TypeError("@@toPrimitive must return a primitive value.")}return(ee==="string"?String:Number)($)}var el=et(8610);var ef=Symbol("lastResolve");var ed=Symbol("lastReject");var ep=Symbol("error");var eh=Symbol("ended");var ey=Symbol("lastPromise");var eg=Symbol("handlePromise");var em=Symbol("stream");function e_($,ee){return{value:$,done:ee}}function ew($){var ee=$[ef];if(ee!==null){var et=$[em].read();if(et!==null){$[ey]=null;$[ef]=null;$[ed]=null;ee(e_(et,false))}}}function eE($){en.nextTick(ew,$)}function eS($,ee){return function(et,en){$.then(function(){if(ee[eh]){et(e_(undefined,true));return}ee[eg](et,en)},en)}}var eT=Object.getPrototypeOf(function(){});var eO=Object.setPrototypeOf((ei={get stream(){return this[em]},next:function $(){var $=this;var ee=this[ep];if(ee!==null){return Promise.reject(ee)}if(this[eh]){return Promise.resolve(e_(undefined,true))}if(this[em].destroyed){return new Promise(function(ee,et){en.nextTick(function(){if($[ep]){et($[ep])}else{ee(e_(undefined,true))}})})}var et=this[ey];var ei;if(et){ei=new Promise(eS(et,this))}else{var eo=this[em].read();if(eo!==null){return Promise.resolve(e_(eo,false))}ei=new Promise(this[eg])}this[ey]=ei;return ei}},eo(ei,Symbol.asyncIterator,function(){return this}),eo(ei,"return",function $(){var $=this;return new Promise(function(ee,et){$[em].destroy(null,function($){if($){et($);return}ee(e_(undefined,true))})})}),ei),eT);var eA=function $($){var ee;var et=Object.create(eO,(ee={},eo(ee,em,{value:$,writable:true}),eo(ee,ef,{value:null,writable:true}),eo(ee,ed,{value:null,writable:true}),eo(ee,ep,{value:null,writable:true}),eo(ee,eh,{value:$._readableState.endEmitted,writable:true}),eo(ee,eg,{value:function $($,ee){var en=et[em].read();if(en){et[ey]=null;et[ef]=null;et[ed]=null;$(e_(en,false))}else{et[ef]=$;et[ed]=ee}},writable:true}),ee));et[ey]=null;el($,function($){if($&&$.code!=="ERR_STREAM_PREMATURE_CLOSE"){var ee=et[ed];if(ee!==null){et[ey]=null;et[ef]=null;et[ed]=null;ee($)}et[ep]=$;return}var en=et[ef];if(en!==null){et[ey]=null;et[ef]=null;et[ed]=null;en(e_(undefined,true))}et[eh]=true});$.on("readable",eE.bind(null,et));return et};$.exports=eA},7327:($,ee,et)=>{"use strict";function en($,ee){var et=Object.keys($);if(Object.getOwnPropertySymbols){var en=Object.getOwnPropertySymbols($);ee&&(en=en.filter(function(ee){return Object.getOwnPropertyDescriptor($,ee).enumerable})),et.push.apply(et,en)}return et}function ei($){for(var ee=1;ee<arguments.length;ee++){var et=null!=arguments[ee]?arguments[ee]:{};ee%2?en(Object(et),!0).forEach(function(ee){eo($,ee,et[ee])}):Object.getOwnPropertyDescriptors?Object.defineProperties($,Object.getOwnPropertyDescriptors(et)):en(Object(et)).forEach(function(ee){Object.defineProperty($,ee,Object.getOwnPropertyDescriptor(et,ee))})}return $}function eo($,ee,et){ee=ef(ee);if(ee in $){Object.defineProperty($,ee,{value:et,enumerable:true,configurable:true,writable:true})}else{$[ee]=et}return $}function es($,ee){if(!($ instanceof ee)){throw new TypeError("Cannot call a class as a function")}}function eu($,ee){for(var et=0;et<ee.length;et++){var en=ee[et];en.enumerable=en.enumerable||false;en.configurable=true;if("value"in en)en.writable=true;Object.defineProperty($,ef(en.key),en)}}function el($,ee,et){if(ee)eu($.prototype,ee);if(et)eu($,et);Object.defineProperty($,"prototype",{writable:false});return $}function ef($){var ee=ed($,"string");return typeof ee==="symbol"?ee:String(ee)}function ed($,ee){if(typeof $!=="object"||$===null)return $;var et=$[Symbol.toPrimitive];if(et!==undefined){var en=et.call($,ee||"default");if(typeof en!=="object")return en;throw new TypeError("@@toPrimitive must return a primitive value.")}return(ee==="string"?String:Number)($)}var ep=et(8764),eh=ep.Buffer;var ey=et(2361),eg=ey.inspect;var em=eg&&eg.custom||"inspect";function e_($,ee,et){eh.prototype.copy.call($,ee,et)}$.exports=function(){function $(){es(this,$);this.head=null;this.tail=null;this.length=0}el($,[{key:"push",value:function $($){var ee={data:$,next:null};if(this.length>0)this.tail.next=ee;else this.head=ee;this.tail=ee;++this.length}},{key:"unshift",value:function $($){var ee={data:$,next:this.head};if(this.length===0)this.tail=ee;this.head=ee;++this.length}},{key:"shift",value:function $(){if(this.length===0)return;var $=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return $}},{key:"clear",value:function $(){this.head=this.tail=null;this.length=0}},{key:"join",value:function $($){if(this.length===0)return"";var ee=this.head;var et=""+ee.data;while(ee=ee.next)et+=$+ee.data;return et}},{key:"concat",value:function $($){if(this.length===0)return eh.alloc(0);var ee=eh.allocUnsafe($>>>0);var et=this.head;var en=0;while(et){e_(et.data,ee,en);en+=et.data.length;et=et.next}return ee}},{key:"consume",value:function $($,ee){var et;if($<this.head.data.length){et=this.head.data.slice(0,$);this.head.data=this.head.data.slice($)}else if($===this.head.data.length){et=this.shift()}else{et=ee?this._getString($):this._getBuffer($)}return et}},{key:"first",value:function $(){return this.head.data}},{key:"_getString",value:function $($){var ee=this.head;var et=1;var en=ee.data;$-=en.length;while(ee=ee.next){var ei=ee.data;var eo=$>ei.length?ei.length:$;if(eo===ei.length)en+=ei;else en+=ei.slice(0,$);$-=eo;if($===0){if(eo===ei.length){++et;if(ee.next)this.head=ee.next;else this.head=this.tail=null}else{this.head=ee;ee.data=ei.slice(eo)}break}++et}this.length-=et;return en}},{key:"_getBuffer",value:function $($){var ee=eh.allocUnsafe($);var et=this.head;var en=1;et.data.copy(ee);$-=et.data.length;while(et=et.next){var ei=et.data;var eo=$>ei.length?ei.length:$;ei.copy(ee,ee.length-$,0,eo);$-=eo;if($===0){if(eo===ei.length){++en;if(et.next)this.head=et.next;else this.head=this.tail=null}else{this.head=et;et.data=ei.slice(eo)}break}++en}this.length-=en;return ee}},{key:em,value:function $($,ee){return eg(this,ei(ei({},ee),{},{depth:0,customInspect:false}))}}]);return $}()},1195:($,ee,et)=>{"use strict";var en=et(4155);function ei($,ee){var et=this;var ei=this._readableState&&this._readableState.destroyed;var eu=this._writableState&&this._writableState.destroyed;if(ei||eu){if(ee){ee($)}else if($){if(!this._writableState){en.nextTick(el,this,$)}else if(!this._writableState.errorEmitted){this._writableState.errorEmitted=true;en.nextTick(el,this,$)}}return this}if(this._readableState){this._readableState.destroyed=true}if(this._writableState){this._writableState.destroyed=true}this._destroy($||null,function($){if(!ee&&$){if(!et._writableState){en.nextTick(eo,et,$)}else if(!et._writableState.errorEmitted){et._writableState.errorEmitted=true;en.nextTick(eo,et,$)}else{en.nextTick(es,et)}}else if(ee){en.nextTick(es,et);ee($)}else{en.nextTick(es,et)}});return this}function eo($,ee){el($,ee);es($)}function es($){if($._writableState&&!$._writableState.emitClose)return;if($._readableState&&!$._readableState.emitClose)return;$.emit("close")}function eu(){if(this._readableState){this._readableState.destroyed=false;this._readableState.reading=false;this._readableState.ended=false;this._readableState.endEmitted=false}if(this._writableState){this._writableState.destroyed=false;this._writableState.ended=false;this._writableState.ending=false;this._writableState.finalCalled=false;this._writableState.prefinished=false;this._writableState.finished=false;this._writableState.errorEmitted=false}}function el($,ee){$.emit("error",ee)}function ef($,ee){var et=$._readableState;var en=$._writableState;if(et&&et.autoDestroy||en&&en.autoDestroy)$.destroy(ee);else $.emit("error",ee)}$.exports={destroy:ei,undestroy:eu,errorOrDestroy:ef}},8610:($,ee,et)=>{"use strict";var en=et(4281).q.ERR_STREAM_PREMATURE_CLOSE;function ei($){var ee=false;return function(){if(ee)return;ee=true;for(var et=arguments.length,en=new Array(et),ei=0;ei<et;ei++){en[ei]=arguments[ei]}$.apply(this,en)}}function eo(){}function es($){return $.setHeader&&typeof $.abort==="function"}function eu($,ee,et){if(typeof ee==="function")return eu($,null,ee);if(!ee)ee={};et=ei(et||eo);var el=ee.readable||ee.readable!==false&&$.readable;var ef=ee.writable||ee.writable!==false&&$.writable;var ed=function ee(){if(!$.writable)eh()};var ep=$._writableState&&$._writableState.finished;var eh=function ee(){ef=false;ep=true;if(!el)et.call($)};var ey=$._readableState&&$._readableState.endEmitted;var eg=function ee(){el=false;ey=true;if(!ef)et.call($)};var em=function ee(ee){et.call($,ee)};var e_=function ee(){var ee;if(el&&!ey){if(!$._readableState||!$._readableState.ended)ee=new en;return et.call($,ee)}if(ef&&!ep){if(!$._writableState||!$._writableState.ended)ee=new en;return et.call($,ee)}};var ew=function ee(){$.req.on("finish",eh)};if(es($)){$.on("complete",eh);$.on("abort",e_);if($.req)ew();else $.on("request",ew)}else if(ef&&!$._writableState){$.on("end",ed);$.on("close",ed)}$.on("end",eg);$.on("finish",eh);if(ee.error!==false)$.on("error",em);$.on("close",e_);return function(){$.removeListener("complete",eh);$.removeListener("abort",e_);$.removeListener("request",ew);if($.req)$.req.removeListener("finish",eh);$.removeListener("end",ed);$.removeListener("close",ed);$.removeListener("finish",eh);$.removeListener("end",eg);$.removeListener("error",em);$.removeListener("close",e_)}}$.exports=eu},5167:$=>{$.exports=function(){throw new Error("Readable.from is not available in the browser")}},9946:($,ee,et)=>{"use strict";var en;function ei($){var ee=false;return function(){if(ee)return;ee=true;$.apply(void 0,arguments)}}var eo=et(4281).q,es=eo.ERR_MISSING_ARGS,eu=eo.ERR_STREAM_DESTROYED;function el($){if($)throw $}function ef($){return $.setHeader&&typeof $.abort==="function"}function ed($,ee,eo,es){es=ei(es);var el=false;$.on("close",function(){el=true});if(en===undefined)en=et(8610);en($,{readable:ee,writable:eo},function($){if($)return es($);el=true;es()});var ed=false;return function(ee){if(el)return;if(ed)return;ed=true;if(ef($))return $.abort();if(typeof $.destroy==="function")return $.destroy();es(ee||new eu("pipe"))}}function ep($){$()}function eh($,ee){return $.pipe(ee)}function ey($){if(!$.length)return el;if(typeof $[$.length-1]!=="function")return el;return $.pop()}function eg(){for(var $=arguments.length,ee=new Array($),et=0;et<$;et++){ee[et]=arguments[et]}var en=ey(ee);if(Array.isArray(ee[0]))ee=ee[0];if(ee.length<2){throw new es("streams")}var ei;var eo=ee.map(function($,et){var es=et<ee.length-1;var eu=et>0;return ed($,es,eu,function($){if(!ei)ei=$;if($)eo.forEach(ep);if(es)return;eo.forEach(ep);en(ei)})});return ee.reduce(eh)}$.exports=eg},2457:($,ee,et)=>{"use strict";var en=et(4281).q.ERR_INVALID_OPT_VALUE;function ei($,ee,et){return $.highWaterMark!=null?$.highWaterMark:ee?$[et]:null}function eo($,ee,et,eo){var es=ei(ee,eo,et);if(es!=null){if(!(isFinite(es)&&Math.floor(es)===es)||es<0){var eu=eo?et:"highWaterMark";throw new en(eu,es)}return Math.floor(es)}return $.objectMode?16:16*1024}$.exports={getHighWaterMark:eo}},2503:($,ee,et)=>{$.exports=et(7187).EventEmitter},4626:($,ee,et)=>{"use strict";var en=et(9509).Buffer;var ei=en.isEncoding||function($){$=""+$;switch($&&$.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function eo($){if(!$)return"utf8";var ee;while(true){switch($){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return $;default:if(ee)return;$=(""+$).toLowerCase();ee=true}}};function es($){var ee=eo($);if(typeof ee!=="string"&&(en.isEncoding===ei||!ei($)))throw new Error("Unknown encoding: "+$);return ee||$}ee.s=eu;function eu($){this.encoding=es($);var ee;switch(this.encoding){case"utf16le":this.text=eg;this.end=em;ee=4;break;case"utf8":this.fillLast=ep;ee=4;break;case"base64":this.text=e_;this.end=ew;ee=3;break;default:this.write=eE;this.end=eS;return}this.lastNeed=0;this.lastTotal=0;this.lastChar=en.allocUnsafe(ee)}eu.prototype.write=function($){if($.length===0)return"";var ee;var et;if(this.lastNeed){ee=this.fillLast($);if(ee===undefined)return"";et=this.lastNeed;this.lastNeed=0}else{et=0}if(et<$.length)return ee?ee+this.text($,et):this.text($,et);return ee||""};eu.prototype.end=ey;eu.prototype.text=eh;eu.prototype.fillLast=function($){if(this.lastNeed<=$.length){$.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}$.copy(this.lastChar,this.lastTotal-this.lastNeed,0,$.length);this.lastNeed-=$.length};function el($){if($<=127)return 0;else if($>>5===6)return 2;else if($>>4===14)return 3;else if($>>3===30)return 4;return $>>6===2?-1:-2}function ef($,ee,et){var en=ee.length-1;if(en<et)return 0;var ei=el(ee[en]);if(ei>=0){if(ei>0)$.lastNeed=ei-1;return ei}if(--en<et||ei===-2)return 0;ei=el(ee[en]);if(ei>=0){if(ei>0)$.lastNeed=ei-2;return ei}if(--en<et||ei===-2)return 0;ei=el(ee[en]);if(ei>=0){if(ei>0){if(ei===2)ei=0;else $.lastNeed=ei-3}return ei}return 0}function ed($,ee,et){if((ee[0]&192)!==128){$.lastNeed=0;return"�"}if($.lastNeed>1&&ee.length>1){if((ee[1]&192)!==128){$.lastNeed=1;return"�"}if($.lastNeed>2&&ee.length>2){if((ee[2]&192)!==128){$.lastNeed=2;return"�"}}}}function ep($){var ee=this.lastTotal-this.lastNeed;var et=ed(this,$,ee);if(et!==undefined)return et;if(this.lastNeed<=$.length){$.copy(this.lastChar,ee,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}$.copy(this.lastChar,ee,0,$.length);this.lastNeed-=$.length}function eh($,ee){var et=ef(this,$,ee);if(!this.lastNeed)return $.toString("utf8",ee);this.lastTotal=et;var en=$.length-(et-this.lastNeed);$.copy(this.lastChar,0,en);return $.toString("utf8",ee,en)}function ey($){var ee=$&&$.length?this.write($):"";if(this.lastNeed)return ee+"�";return ee}function eg($,ee){if(($.length-ee)%2===0){var et=$.toString("utf16le",ee);if(et){var en=et.charCodeAt(et.length-1);if(en>=55296&&en<=56319){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=$[$.length-2];this.lastChar[1]=$[$.length-1];return et.slice(0,-1)}}return et}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=$[$.length-1];return $.toString("utf16le",ee,$.length-1)}function em($){var ee=$&&$.length?this.write($):"";if(this.lastNeed){var et=this.lastTotal-this.lastNeed;return ee+this.lastChar.toString("utf16le",0,et)}return ee}function e_($,ee){var et=($.length-ee)%3;if(et===0)return $.toString("base64",ee);this.lastNeed=3-et;this.lastTotal=3;if(et===1){this.lastChar[0]=$[$.length-1]}else{this.lastChar[0]=$[$.length-2];this.lastChar[1]=$[$.length-1]}return $.toString("base64",ee,$.length-et)}function ew($){var ee=$&&$.length?this.write($):"";if(this.lastNeed)return ee+this.lastChar.toString("base64",0,3-this.lastNeed);return ee}function eE($){return $.toString(this.encoding)}function eS($){return $&&$.length?this.write($):""}},3697:($,ee,et)=>{"use strict";var en=et(5972).functionsHaveConfigurableNames();var ei=Object;var eo=TypeError;$.exports=function $(){if(this!=null&&this!==ei(this)){throw new eo("RegExp.prototype.flags getter called on non-object")}var $="";if(this.hasIndices){$+="d"}if(this.global){$+="g"}if(this.ignoreCase){$+="i"}if(this.multiline){$+="m"}if(this.dotAll){$+="s"}if(this.unicode){$+="u"}if(this.unicodeSets){$+="v"}if(this.sticky){$+="y"}return $};if(en&&Object.defineProperty){Object.defineProperty($.exports,"name",{value:"get flags"})}},2847:($,ee,et)=>{"use strict";var en=et(4289);var ei=et(5559);var eo=et(3697);var es=et(1721);var eu=et(2753);var el=ei(es());en(el,{getPolyfill:es,implementation:eo,shim:eu});$.exports=el},1721:($,ee,et)=>{"use strict";var en=et(3697);var ei=et(4289).supportsDescriptors;var eo=Object.getOwnPropertyDescriptor;$.exports=function $(){if(ei&&/a/mig.flags==="gim"){var $=eo(RegExp.prototype,"flags");if($&&typeof $.get==="function"&&typeof RegExp.prototype.dotAll==="boolean"&&typeof RegExp.prototype.hasIndices==="boolean"){var ee="";var et={};Object.defineProperty(et,"hasIndices",{get:function(){ee+="d"}});Object.defineProperty(et,"sticky",{get:function(){ee+="y"}});if(ee==="dy"){return $.get}}}return en}},2753:($,ee,et)=>{"use strict";var en=et(4289).supportsDescriptors;var ei=et(1721);var eo=Object.getOwnPropertyDescriptor;var es=Object.defineProperty;var eu=TypeError;var el=Object.getPrototypeOf;var ef=/a/;$.exports=function $(){if(!en||!el){throw new eu("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors")}var $=ei();var ee=el(ef);var et=eo(ee,"flags");if(!et||et.get!==$){es(ee,"flags",{configurable:true,enumerable:false,get:$})}return $}},9509:($,ee,et)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var en=et(8764);var ei=en.Buffer;function eo($,ee){for(var et in $){ee[et]=$[et]}}if(ei.from&&ei.alloc&&ei.allocUnsafe&&ei.allocUnsafeSlow){$.exports=en}else{eo(en,ee);ee.Buffer=es}function es($,ee,et){return ei($,ee,et)}es.prototype=Object.create(ei.prototype);eo(ei,es);es.from=function($,ee,et){if(typeof $==="number"){throw new TypeError("Argument must not be a number")}return ei($,ee,et)};es.alloc=function($,ee,et){if(typeof $!=="number"){throw new TypeError("Argument must be a number")}var en=ei($);if(ee!==undefined){if(typeof et==="string"){en.fill(ee,et)}else{en.fill(ee)}}else{en.fill(0)}return en};es.allocUnsafe=function($){if(typeof $!=="number"){throw new TypeError("Argument must be a number")}return ei($)};es.allocUnsafeSlow=function($){if(typeof $!=="number"){throw new TypeError("Argument must be a number")}return en.SlowBuffer($)}},6099:($,ee,et)=>{var en=et(8764)["Buffer"];(function($){$.parser=function($,ee){return new ei($,ee)};$.SAXParser=ei;$.SAXStream=ep;$.createStream=ed;$.MAX_BUFFER_LENGTH=64*1024;var ee=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];$.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function ei(ee,et){if(!(this instanceof ei)){return new ei(ee,et)}var en=this;es(en);en.q=en.c="";en.bufferCheckPosition=$.MAX_BUFFER_LENGTH;en.opt=et||{};en.opt.lowercase=en.opt.lowercase||en.opt.lowercasetags;en.looseCase=en.opt.lowercase?"toLowerCase":"toUpperCase";en.tags=[];en.closed=en.closedRoot=en.sawRoot=false;en.tag=en.error=null;en.strict=!!ee;en.noscript=!!(ee||en.opt.noscript);en.state=eR.BEGIN;en.strictEntities=en.opt.strictEntities;en.ENTITIES=en.strictEntities?Object.create($.XML_ENTITIES):Object.create($.ENTITIES);en.attribList=[];if(en.opt.xmlns){en.ns=Object.create(e_)}en.trackPosition=en.opt.position!==false;if(en.trackPosition){en.position=en.line=en.column=0}ek(en,"onready")}if(!Object.create){Object.create=function($){function ee(){}ee.prototype=$;var et=new ee;return et}}if(!Object.keys){Object.keys=function($){var ee=[];for(var et in $)if($.hasOwnProperty(et))ee.push(et);return ee}}function eo(et){var en=Math.max($.MAX_BUFFER_LENGTH,10);var ei=0;for(var eo=0,es=ee.length;eo<es;eo++){var eu=et[ee[eo]].length;if(eu>en){switch(ee[eo]){case"textNode":eL(et);break;case"cdata":eM(et,"oncdata",et.cdata);et.cdata="";break;case"script":eM(et,"onscript",et.script);et.script="";break;default:eF(et,"Max buffer length exceeded: "+ee[eo])}}ei=Math.max(ei,eu)}var el=$.MAX_BUFFER_LENGTH-ei;et.bufferCheckPosition=el+et.position}function es($){for(var et=0,en=ee.length;et<en;et++){$[ee[et]]=""}}function eu($){eL($);if($.cdata!==""){eM($,"oncdata",$.cdata);$.cdata=""}if($.script!==""){eM($,"onscript",$.script);$.script=""}}ei.prototype={end:function(){eB(this)},write:eY,resume:function(){this.error=null;return this},close:function(){return this.write(null)},flush:function(){eu(this)}};var el;try{el=et(2830).Stream}catch($){el=function(){}}var ef=$.EVENTS.filter(function($){return $!=="error"&&$!=="end"});function ed($,ee){return new ep($,ee)}function ep($,ee){if(!(this instanceof ep)){return new ep($,ee)}el.apply(this);this._parser=new ei($,ee);this.writable=true;this.readable=true;var et=this;this._parser.onend=function(){et.emit("end")};this._parser.onerror=function($){et.emit("error",$);et._parser.error=null};this._decoder=null;ef.forEach(function($){Object.defineProperty(et,"on"+$,{get:function(){return et._parser["on"+$]},set:function(ee){if(!ee){et.removeAllListeners($);et._parser["on"+$]=ee;return ee}et.on($,ee)},enumerable:true,configurable:false})})}ep.prototype=Object.create(el.prototype,{constructor:{value:ep}});ep.prototype.write=function($){if(typeof en==="function"&&typeof en.isBuffer==="function"&&en.isBuffer($)){if(!this._decoder){var ee=et(2553).StringDecoder;this._decoder=new ee("utf8")}$=this._decoder.write($)}this._parser.write($.toString());this.emit("data",$);return true};ep.prototype.end=function($){if($&&$.length){this.write($)}this._parser.end();return true};ep.prototype.on=function($,ee){var et=this;if(!et._parser["on"+$]&&ef.indexOf($)!==-1){et._parser["on"+$]=function(){var ee=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);ee.splice(0,0,$);et.emit.apply(et,ee)}}return el.prototype.on.call(et,$,ee)};var eh="[CDATA[";var ey="DOCTYPE";var eg="http://www.w3.org/XML/1998/namespace";var em="http://www.w3.org/2000/xmlns/";var e_={xml:eg,xmlns:em};var ew=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;var eE=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;var eS=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;var eT=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function eO($){return $===" "||$==="\n"||$==="\r"||$===" "}function eA($){return $==='"'||$==="'"}function eI($){return $===">"||eO($)}function eN($,ee){return $.test(ee)}function eD($,ee){return!eN($,ee)}var eR=0;$.STATE={BEGIN:eR++,BEGIN_WHITESPACE:eR++,TEXT:eR++,TEXT_ENTITY:eR++,OPEN_WAKA:eR++,SGML_DECL:eR++,SGML_DECL_QUOTED:eR++,DOCTYPE:eR++,DOCTYPE_QUOTED:eR++,DOCTYPE_DTD:eR++,DOCTYPE_DTD_QUOTED:eR++,COMMENT_STARTING:eR++,COMMENT:eR++,COMMENT_ENDING:eR++,COMMENT_ENDED:eR++,CDATA:eR++,CDATA_ENDING:eR++,CDATA_ENDING_2:eR++,PROC_INST:eR++,PROC_INST_BODY:eR++,PROC_INST_ENDING:eR++,OPEN_TAG:eR++,OPEN_TAG_SLASH:eR++,ATTRIB:eR++,ATTRIB_NAME:eR++,ATTRIB_NAME_SAW_WHITE:eR++,ATTRIB_VALUE:eR++,ATTRIB_VALUE_QUOTED:eR++,ATTRIB_VALUE_CLOSED:eR++,ATTRIB_VALUE_UNQUOTED:eR++,ATTRIB_VALUE_ENTITY_Q:eR++,ATTRIB_VALUE_ENTITY_U:eR++,CLOSE_TAG:eR++,CLOSE_TAG_SAW_WHITE:eR++,SCRIPT:eR++,SCRIPT_ENDING:eR++};$.XML_ENTITIES={"amp":"&","gt":">","lt":"<","quot":'"',"apos":"'"};$.ENTITIES={"amp":"&","gt":">","lt":"<","quot":'"',"apos":"'","AElig":198,"Aacute":193,"Acirc":194,"Agrave":192,"Aring":197,"Atilde":195,"Auml":196,"Ccedil":199,"ETH":208,"Eacute":201,"Ecirc":202,"Egrave":200,"Euml":203,"Iacute":205,"Icirc":206,"Igrave":204,"Iuml":207,"Ntilde":209,"Oacute":211,"Ocirc":212,"Ograve":210,"Oslash":216,"Otilde":213,"Ouml":214,"THORN":222,"Uacute":218,"Ucirc":219,"Ugrave":217,"Uuml":220,"Yacute":221,"aacute":225,"acirc":226,"aelig":230,"agrave":224,"aring":229,"atilde":227,"auml":228,"ccedil":231,"eacute":233,"ecirc":234,"egrave":232,"eth":240,"euml":235,"iacute":237,"icirc":238,"igrave":236,"iuml":239,"ntilde":241,"oacute":243,"ocirc":244,"ograve":242,"oslash":248,"otilde":245,"ouml":246,"szlig":223,"thorn":254,"uacute":250,"ucirc":251,"ugrave":249,"uuml":252,"yacute":253,"yuml":255,"copy":169,"reg":174,"nbsp":160,"iexcl":161,"cent":162,"pound":163,"curren":164,"yen":165,"brvbar":166,"sect":167,"uml":168,"ordf":170,"laquo":171,"not":172,"shy":173,"macr":175,"deg":176,"plusmn":177,"sup1":185,"sup2":178,"sup3":179,"acute":180,"micro":181,"para":182,"middot":183,"cedil":184,"ordm":186,"raquo":187,"frac14":188,"frac12":189,"frac34":190,"iquest":191,"times":215,"divide":247,"OElig":338,"oelig":339,"Scaron":352,"scaron":353,"Yuml":376,"fnof":402,"circ":710,"tilde":732,"Alpha":913,"Beta":914,"Gamma":915,"Delta":916,"Epsilon":917,"Zeta":918,"Eta":919,"Theta":920,"Iota":921,"Kappa":922,"Lambda":923,"Mu":924,"Nu":925,"Xi":926,"Omicron":927,"Pi":928,"Rho":929,"Sigma":931,"Tau":932,"Upsilon":933,"Phi":934,"Chi":935,"Psi":936,"Omega":937,"alpha":945,"beta":946,"gamma":947,"delta":948,"epsilon":949,"zeta":950,"eta":951,"theta":952,"iota":953,"kappa":954,"lambda":955,"mu":956,"nu":957,"xi":958,"omicron":959,"pi":960,"rho":961,"sigmaf":962,"sigma":963,"tau":964,"upsilon":965,"phi":966,"chi":967,"psi":968,"omega":969,"thetasym":977,"upsih":978,"piv":982,"ensp":8194,"emsp":8195,"thinsp":8201,"zwnj":8204,"zwj":8205,"lrm":8206,"rlm":8207,"ndash":8211,"mdash":8212,"lsquo":8216,"rsquo":8217,"sbquo":8218,"ldquo":8220,"rdquo":8221,"bdquo":8222,"dagger":8224,"Dagger":8225,"bull":8226,"hellip":8230,"permil":8240,"prime":8242,"Prime":8243,"lsaquo":8249,"rsaquo":8250,"oline":8254,"frasl":8260,"euro":8364,"image":8465,"weierp":8472,"real":8476,"trade":8482,"alefsym":8501,"larr":8592,"uarr":8593,"rarr":8594,"darr":8595,"harr":8596,"crarr":8629,"lArr":8656,"uArr":8657,"rArr":8658,"dArr":8659,"hArr":8660,"forall":8704,"part":8706,"exist":8707,"empty":8709,"nabla":8711,"isin":8712,"notin":8713,"ni":8715,"prod":8719,"sum":8721,"minus":8722,"lowast":8727,"radic":8730,"prop":8733,"infin":8734,"ang":8736,"and":8743,"or":8744,"cap":8745,"cup":8746,"int":8747,"there4":8756,"sim":8764,"cong":8773,"asymp":8776,"ne":8800,"equiv":8801,"le":8804,"ge":8805,"sub":8834,"sup":8835,"nsub":8836,"sube":8838,"supe":8839,"oplus":8853,"otimes":8855,"perp":8869,"sdot":8901,"lceil":8968,"rceil":8969,"lfloor":8970,"rfloor":8971,"lang":9001,"rang":9002,"loz":9674,"spades":9824,"clubs":9827,"hearts":9829,"diams":9830};Object.keys($.ENTITIES).forEach(function(ee){var et=$.ENTITIES[ee];var en=typeof et==="number"?String.fromCharCode(et):et;$.ENTITIES[ee]=en});for(var eC in $.STATE){$.STATE[$.STATE[eC]]=eC}eR=$.STATE;function ek($,ee,et){$[ee]&&$[ee](et)}function eM($,ee,et){if($.textNode)eL($);ek($,ee,et)}function eL($){$.textNode=eP($.opt,$.textNode);if($.textNode)ek($,"ontext",$.textNode);$.textNode=""}function eP($,ee){if($.trim)ee=ee.trim();if($.normalize)ee=ee.replace(/\s+/g," ");return ee}function eF($,ee){eL($);if($.trackPosition){ee+="\nLine: "+$.line+"\nColumn: "+$.column+"\nChar: "+$.c}ee=new Error(ee);$.error=ee;ek($,"onerror",ee);return $}function eB($){if($.sawRoot&&!$.closedRoot)eU($,"Unclosed root tag");if($.state!==eR.BEGIN&&$.state!==eR.BEGIN_WHITESPACE&&$.state!==eR.TEXT){eF($,"Unexpected end")}eL($);$.c="";$.closed=true;ek($,"onend");ei.call($,$.strict,$.opt);return $}function eU($,ee){if(typeof $!=="object"||!($ instanceof ei)){throw new Error("bad call to strictFail")}if($.strict){eF($,ee)}}function ej($){if(!$.strict)$.tagName=$.tagName[$.looseCase]();var ee=$.tags[$.tags.length-1]||$;var et=$.tag={name:$.tagName,attributes:{}};if($.opt.xmlns){et.ns=ee.ns}$.attribList.length=0;eM($,"onopentagstart",et)}function eW($,ee){var et=$.indexOf(":");var en=et<0?["",$]:$.split(":");var ei=en[0];var eo=en[1];if(ee&&$==="xmlns"){ei="xmlns";eo=""}return{prefix:ei,local:eo}}function eH($){if(!$.strict){$.attribName=$.attribName[$.looseCase]()}if($.attribList.indexOf($.attribName)!==-1||$.tag.attributes.hasOwnProperty($.attribName)){$.attribName=$.attribValue="";return}if($.opt.xmlns){var ee=eW($.attribName,true);var et=ee.prefix;var en=ee.local;if(et==="xmlns"){if(en==="xml"&&$.attribValue!==eg){eU($,"xml: prefix must be bound to "+eg+"\n"+"Actual: "+$.attribValue)}else if(en==="xmlns"&&$.attribValue!==em){eU($,"xmlns: prefix must be bound to "+em+"\n"+"Actual: "+$.attribValue)}else{var ei=$.tag;var eo=$.tags[$.tags.length-1]||$;if(ei.ns===eo.ns){ei.ns=Object.create(eo.ns)}ei.ns[en]=$.attribValue}}$.attribList.push([$.attribName,$.attribValue])}else{$.tag.attributes[$.attribName]=$.attribValue;eM($,"onattribute",{name:$.attribName,value:$.attribValue})}$.attribName=$.attribValue=""}function ez($,ee){if($.opt.xmlns){var et=$.tag;var en=eW($.tagName);et.prefix=en.prefix;et.local=en.local;et.uri=et.ns[en.prefix]||"";if(et.prefix&&!et.uri){eU($,"Unbound namespace prefix: "+JSON.stringify($.tagName));et.uri=en.prefix}var ei=$.tags[$.tags.length-1]||$;if(et.ns&&ei.ns!==et.ns){Object.keys(et.ns).forEach(function(ee){eM($,"onopennamespace",{prefix:ee,uri:et.ns[ee]})})}for(var eo=0,es=$.attribList.length;eo<es;eo++){var eu=$.attribList[eo];var el=eu[0];var ef=eu[1];var ed=eW(el,true);var ep=ed.prefix;var eh=ed.local;var ey=ep===""?"":et.ns[ep]||"";var eg={name:el,value:ef,prefix:ep,local:eh,uri:ey};if(ep&&ep!=="xmlns"&&!ey){eU($,"Unbound namespace prefix: "+JSON.stringify(ep));eg.uri=ep}$.tag.attributes[el]=eg;eM($,"onattribute",eg)}$.attribList.length=0}$.tag.isSelfClosing=!!ee;$.sawRoot=true;$.tags.push($.tag);eM($,"onopentag",$.tag);if(!ee){if(!$.noscript&&$.tagName.toLowerCase()==="script"){$.state=eR.SCRIPT}else{$.state=eR.TEXT}$.tag=null;$.tagName=""}$.attribName=$.attribValue="";$.attribList.length=0}function eV($){if(!$.tagName){eU($,"Weird empty close tag.");$.textNode+="</>";$.state=eR.TEXT;return}if($.script){if($.tagName!=="script"){$.script+="</"+$.tagName+">";$.tagName="";$.state=eR.SCRIPT;return}eM($,"onscript",$.script);$.script=""}var ee=$.tags.length;var et=$.tagName;if(!$.strict){et=et[$.looseCase]()}var en=et;while(ee--){var ei=$.tags[ee];if(ei.name!==en){eU($,"Unexpected close tag")}else{break}}if(ee<0){eU($,"Unmatched closing tag: "+$.tagName);$.textNode+="</"+$.tagName+">";$.state=eR.TEXT;return}$.tagName=et;var eo=$.tags.length;while(eo-- >ee){var es=$.tag=$.tags.pop();$.tagName=$.tag.name;eM($,"onclosetag",$.tagName);var eu={};for(var el in es.ns){eu[el]=es.ns[el]}var ef=$.tags[$.tags.length-1]||$;if($.opt.xmlns&&es.ns!==ef.ns){Object.keys(es.ns).forEach(function(ee){var et=es.ns[ee];eM($,"onclosenamespace",{prefix:ee,uri:et})})}}if(ee===0)$.closedRoot=true;$.tagName=$.attribValue=$.attribName="";$.attribList.length=0;$.state=eR.TEXT}function e$($){var ee=$.entity;var et=ee.toLowerCase();var en;var ei="";if($.ENTITIES[ee]){return $.ENTITIES[ee]}if($.ENTITIES[et]){return $.ENTITIES[et]}ee=et;if(ee.charAt(0)==="#"){if(ee.charAt(1)==="x"){ee=ee.slice(2);en=parseInt(ee,16);ei=en.toString(16)}else{ee=ee.slice(1);en=parseInt(ee,10);ei=en.toString(10)}}ee=ee.replace(/^0+/,"");if(isNaN(en)||ei.toLowerCase()!==ee){eU($,"Invalid character entity");return"&"+$.entity+";"}return String.fromCodePoint(en)}function eq($,ee){if(ee==="<"){$.state=eR.OPEN_WAKA;$.startTagPosition=$.position}else if(!eO(ee)){eU($,"Non-whitespace before first tag.");$.textNode=ee;$.state=eR.TEXT}}function eG($,ee){var et="";if(ee<$.length){et=$.charAt(ee)}return et}function eY($){var ee=this;if(this.error){throw this.error}if(ee.closed){return eF(ee,"Cannot write after close. Assign an onready handler.")}if($===null){return eB(ee)}if(typeof $==="object"){$=$.toString()}var et=0;var en="";while(true){en=eG($,et++);ee.c=en;if(!en){break}if(ee.trackPosition){ee.position++;if(en==="\n"){ee.line++;ee.column=0}else{ee.column++}}switch(ee.state){case eR.BEGIN:ee.state=eR.BEGIN_WHITESPACE;if(en==="\uFEFF"){continue}eq(ee,en);continue;case eR.BEGIN_WHITESPACE:eq(ee,en);continue;case eR.TEXT:if(ee.sawRoot&&!ee.closedRoot){var ei=et-1;while(en&&en!=="<"&&en!=="&"){en=eG($,et++);if(en&&ee.trackPosition){ee.position++;if(en==="\n"){ee.line++;ee.column=0}else{ee.column++}}}ee.textNode+=$.substring(ei,et-1)}if(en==="<"&&!(ee.sawRoot&&ee.closedRoot&&!ee.strict)){ee.state=eR.OPEN_WAKA;ee.startTagPosition=ee.position}else{if(!eO(en)&&(!ee.sawRoot||ee.closedRoot)){eU(ee,"Text data outside of root node.")}if(en==="&"){ee.state=eR.TEXT_ENTITY}else{ee.textNode+=en}}continue;case eR.SCRIPT:if(en==="<"){ee.state=eR.SCRIPT_ENDING}else{ee.script+=en}continue;case eR.SCRIPT_ENDING:if(en==="/"){ee.state=eR.CLOSE_TAG}else{ee.script+="<"+en;ee.state=eR.SCRIPT}continue;case eR.OPEN_WAKA:if(en==="!"){ee.state=eR.SGML_DECL;ee.sgmlDecl=""}else if(eO(en)){}else if(eN(ew,en)){ee.state=eR.OPEN_TAG;ee.tagName=en}else if(en==="/"){ee.state=eR.CLOSE_TAG;ee.tagName=""}else if(en==="?"){ee.state=eR.PROC_INST;ee.procInstName=ee.procInstBody=""}else{eU(ee,"Unencoded <");if(ee.startTagPosition+1<ee.position){var es=ee.position-ee.startTagPosition;en=new Array(es).join(" ")+en}ee.textNode+="<"+en;ee.state=eR.TEXT}continue;case eR.SGML_DECL:if((ee.sgmlDecl+en).toUpperCase()===eh){eM(ee,"onopencdata");ee.state=eR.CDATA;ee.sgmlDecl="";ee.cdata=""}else if(ee.sgmlDecl+en==="--"){ee.state=eR.COMMENT;ee.comment="";ee.sgmlDecl=""}else if((ee.sgmlDecl+en).toUpperCase()===ey){ee.state=eR.DOCTYPE;if(ee.doctype||ee.sawRoot){eU(ee,"Inappropriately located doctype declaration")}ee.doctype="";ee.sgmlDecl=""}else if(en===">"){eM(ee,"onsgmldeclaration",ee.sgmlDecl);ee.sgmlDecl="";ee.state=eR.TEXT}else if(eA(en)){ee.state=eR.SGML_DECL_QUOTED;ee.sgmlDecl+=en}else{ee.sgmlDecl+=en}continue;case eR.SGML_DECL_QUOTED:if(en===ee.q){ee.state=eR.SGML_DECL;ee.q=""}ee.sgmlDecl+=en;continue;case eR.DOCTYPE:if(en===">"){ee.state=eR.TEXT;eM(ee,"ondoctype",ee.doctype);ee.doctype=true}else{ee.doctype+=en;if(en==="["){ee.state=eR.DOCTYPE_DTD}else if(eA(en)){ee.state=eR.DOCTYPE_QUOTED;ee.q=en}}continue;case eR.DOCTYPE_QUOTED:ee.doctype+=en;if(en===ee.q){ee.q="";ee.state=eR.DOCTYPE}continue;case eR.DOCTYPE_DTD:ee.doctype+=en;if(en==="]"){ee.state=eR.DOCTYPE}else if(eA(en)){ee.state=eR.DOCTYPE_DTD_QUOTED;ee.q=en}continue;case eR.DOCTYPE_DTD_QUOTED:ee.doctype+=en;if(en===ee.q){ee.state=eR.DOCTYPE_DTD;ee.q=""}continue;case eR.COMMENT:if(en==="-"){ee.state=eR.COMMENT_ENDING}else{ee.comment+=en}continue;case eR.COMMENT_ENDING:if(en==="-"){ee.state=eR.COMMENT_ENDED;ee.comment=eP(ee.opt,ee.comment);if(ee.comment){eM(ee,"oncomment",ee.comment)}ee.comment=""}else{ee.comment+="-"+en;ee.state=eR.COMMENT}continue;case eR.COMMENT_ENDED:if(en!==">"){eU(ee,"Malformed comment");ee.comment+="--"+en;ee.state=eR.COMMENT}else{ee.state=eR.TEXT}continue;case eR.CDATA:if(en==="]"){ee.state=eR.CDATA_ENDING}else{ee.cdata+=en}continue;case eR.CDATA_ENDING:if(en==="]"){ee.state=eR.CDATA_ENDING_2}else{ee.cdata+="]"+en;ee.state=eR.CDATA}continue;case eR.CDATA_ENDING_2:if(en===">"){if(ee.cdata){eM(ee,"oncdata",ee.cdata)}eM(ee,"onclosecdata");ee.cdata="";ee.state=eR.TEXT}else if(en==="]"){ee.cdata+="]"}else{ee.cdata+="]]"+en;ee.state=eR.CDATA}continue;case eR.PROC_INST:if(en==="?"){ee.state=eR.PROC_INST_ENDING}else if(eO(en)){ee.state=eR.PROC_INST_BODY}else{ee.procInstName+=en}continue;case eR.PROC_INST_BODY:if(!ee.procInstBody&&eO(en)){continue}else if(en==="?"){ee.state=eR.PROC_INST_ENDING}else{ee.procInstBody+=en}continue;case eR.PROC_INST_ENDING:if(en===">"){eM(ee,"onprocessinginstruction",{name:ee.procInstName,body:ee.procInstBody});ee.procInstName=ee.procInstBody="";ee.state=eR.TEXT}else{ee.procInstBody+="?"+en;ee.state=eR.PROC_INST_BODY}continue;case eR.OPEN_TAG:if(eN(eE,en)){ee.tagName+=en}else{ej(ee);if(en===">"){ez(ee)}else if(en==="/"){ee.state=eR.OPEN_TAG_SLASH}else{if(!eO(en)){eU(ee,"Invalid character in tag name")}ee.state=eR.ATTRIB}}continue;case eR.OPEN_TAG_SLASH:if(en===">"){ez(ee,true);eV(ee)}else{eU(ee,"Forward-slash in opening tag not followed by >");ee.state=eR.ATTRIB}continue;case eR.ATTRIB:if(eO(en)){continue}else if(en===">"){ez(ee)}else if(en==="/"){ee.state=eR.OPEN_TAG_SLASH}else if(eN(ew,en)){ee.attribName=en;ee.attribValue="";ee.state=eR.ATTRIB_NAME}else{eU(ee,"Invalid attribute name")}continue;case eR.ATTRIB_NAME:if(en==="="){ee.state=eR.ATTRIB_VALUE}else if(en===">"){eU(ee,"Attribute without value");ee.attribValue=ee.attribName;eH(ee);ez(ee)}else if(eO(en)){ee.state=eR.ATTRIB_NAME_SAW_WHITE}else if(eN(eE,en)){ee.attribName+=en}else{eU(ee,"Invalid attribute name")}continue;case eR.ATTRIB_NAME_SAW_WHITE:if(en==="="){ee.state=eR.ATTRIB_VALUE}else if(eO(en)){continue}else{eU(ee,"Attribute without value");ee.tag.attributes[ee.attribName]="";ee.attribValue="";eM(ee,"onattribute",{name:ee.attribName,value:""});ee.attribName="";if(en===">"){ez(ee)}else if(eN(ew,en)){ee.attribName=en;ee.state=eR.ATTRIB_NAME}else{eU(ee,"Invalid attribute name");ee.state=eR.ATTRIB}}continue;case eR.ATTRIB_VALUE:if(eO(en)){continue}else if(eA(en)){ee.q=en;ee.state=eR.ATTRIB_VALUE_QUOTED}else{eU(ee,"Unquoted attribute value");ee.state=eR.ATTRIB_VALUE_UNQUOTED;ee.attribValue=en}continue;case eR.ATTRIB_VALUE_QUOTED:if(en!==ee.q){if(en==="&"){ee.state=eR.ATTRIB_VALUE_ENTITY_Q}else{ee.attribValue+=en}continue}eH(ee);ee.q="";ee.state=eR.ATTRIB_VALUE_CLOSED;continue;case eR.ATTRIB_VALUE_CLOSED:if(eO(en)){ee.state=eR.ATTRIB}else if(en===">"){ez(ee)}else if(en==="/"){ee.state=eR.OPEN_TAG_SLASH}else if(eN(ew,en)){eU(ee,"No whitespace between attributes");ee.attribName=en;ee.attribValue="";ee.state=eR.ATTRIB_NAME}else{eU(ee,"Invalid attribute name")}continue;case eR.ATTRIB_VALUE_UNQUOTED:if(!eI(en)){if(en==="&"){ee.state=eR.ATTRIB_VALUE_ENTITY_U}else{ee.attribValue+=en}continue}eH(ee);if(en===">"){ez(ee)}else{ee.state=eR.ATTRIB}continue;case eR.CLOSE_TAG:if(!ee.tagName){if(eO(en)){continue}else if(eD(ew,en)){if(ee.script){ee.script+="</"+en;ee.state=eR.SCRIPT}else{eU(ee,"Invalid tagname in closing tag.")}}else{ee.tagName=en}}else if(en===">"){eV(ee)}else if(eN(eE,en)){ee.tagName+=en}else if(ee.script){ee.script+="</"+ee.tagName;ee.tagName="";ee.state=eR.SCRIPT}else{if(!eO(en)){eU(ee,"Invalid tagname in closing tag")}ee.state=eR.CLOSE_TAG_SAW_WHITE}continue;case eR.CLOSE_TAG_SAW_WHITE:if(eO(en)){continue}if(en===">"){eV(ee)}else{eU(ee,"Invalid characters in closing tag")}continue;case eR.TEXT_ENTITY:case eR.ATTRIB_VALUE_ENTITY_Q:case eR.ATTRIB_VALUE_ENTITY_U:var eu;var el;switch(ee.state){case eR.TEXT_ENTITY:eu=eR.TEXT;el="textNode";break;case eR.ATTRIB_VALUE_ENTITY_Q:eu=eR.ATTRIB_VALUE_QUOTED;el="attribValue";break;case eR.ATTRIB_VALUE_ENTITY_U:eu=eR.ATTRIB_VALUE_UNQUOTED;el="attribValue";break}if(en===";"){ee[el]+=e$(ee);ee.entity="";ee.state=eu}else if(eN(ee.entity.length?eT:eS,en)){ee.entity+=en}else{eU(ee,"Invalid character in entity name");ee[el]+="&"+ee.entity+en;ee.entity="";ee.state=eu}continue;default:throw new Error(ee,"Unknown state: "+ee.state)}}if(ee.position>=ee.bufferCheckPosition){eo(ee)}return ee}/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */if(!String.fromCodePoint){(function(){var $=String.fromCharCode;var ee=Math.floor;var et=function(){var et=16384;var en=[];var ei;var eo;var es=-1;var eu=arguments.length;if(!eu){return""}var el="";while(++es<eu){var ef=Number(arguments[es]);if(!isFinite(ef)||ef<0||ef>1114111||ee(ef)!==ef){throw RangeError("Invalid code point: "+ef)}if(ef<=65535){en.push(ef)}else{ef-=65536;ei=(ef>>10)+55296;eo=ef%1024+56320;en.push(ei,eo)}if(es+1===eu||en.length>et){el+=$.apply(null,en);en.length=0}}return el};if(Object.defineProperty){Object.defineProperty(String,"fromCodePoint",{value:et,configurable:true,writable:true})}else{String.fromCodePoint=et}})()}})(false?0:ee)},7478:($,ee,et)=>{"use strict";var en=et(210);var ei=et(1924);var eo=et(631);var es=en("%TypeError%");var eu=en("%WeakMap%",true);var el=en("%Map%",true);var ef=ei("WeakMap.prototype.get",true);var ed=ei("WeakMap.prototype.set",true);var ep=ei("WeakMap.prototype.has",true);var eh=ei("Map.prototype.get",true);var ey=ei("Map.prototype.set",true);var eg=ei("Map.prototype.has",true);var em=function($,ee){for(var et=$,en;(en=et.next)!==null;et=en){if(en.key===ee){et.next=en.next;en.next=$.next;$.next=en;return en}}};var e_=function($,ee){var et=em($,ee);return et&&et.value};var ew=function($,ee,et){var en=em($,ee);if(en){en.value=et}else{$.next={key:ee,next:$.next,value:et}}};var eE=function($,ee){return!!em($,ee)};$.exports=function $(){var $;var ee;var et;var en={assert:function($){if(!en.has($)){throw new es("Side channel does not contain "+eo($))}},get:function(en){if(eu&&en&&(typeof en==="object"||typeof en==="function")){if($){return ef($,en)}}else if(el){if(ee){return eh(ee,en)}}else{if(et){return e_(et,en)}}},has:function(en){if(eu&&en&&(typeof en==="object"||typeof en==="function")){if($){return ep($,en)}}else if(el){if(ee){return eg(ee,en)}}else{if(et){return eE(et,en)}}return false},set:function(en,ei){if(eu&&en&&(typeof en==="object"||typeof en==="function")){if(!$){$=new eu}ed($,en,ei)}else if(el){if(!ee){ee=new el}ey(ee,en,ei)}else{if(!et){et={key:{},next:null}}ew(et,en,ei)}}};return en}},3859:$=>{"use strict";$.exports=$=>{const ee=/^\\\\\?\\/.test($);const et=/[^\u0000-\u0080]+/.test($);if(ee||et){return $}return $.replace(/\\/g,"/")}},6373:($,ee,et)=>{"use strict";var en=et(9496);var ei=SyntaxError;var eo=typeof StopIteration==="object"?StopIteration:null;$.exports=function $($){if(!eo){throw new ei("this environment lacks StopIteration")}en.set($,"[[Done]]",false);var ee={next:function $(){var $=en.get(this,"[[Iterator]]");var ee=en.get($,"[[Done]]");try{return{done:ee,value:ee?void undefined:$.next()}}catch(ee){en.set($,"[[Done]]",true);if(ee!==eo){throw ee}return{done:true,value:void undefined}}}};en.set(ee,"[[Iterator]]",$);return ee}},2830:($,ee,et)=>{$.exports=eo;var en=et(7187).EventEmitter;var ei=et(5717);ei(eo,en);eo.Readable=et(9481);eo.Writable=et(4229);eo.Duplex=et(6753);eo.Transform=et(4605);eo.PassThrough=et(2725);eo.finished=et(8610);eo.pipeline=et(9946);eo.Stream=eo;function eo(){en.call(this)}eo.prototype.pipe=function($,ee){var et=this;function ei(ee){if($.writable){if(false===$.write(ee)&&et.pause){et.pause()}}}et.on("data",ei);function eo(){if(et.readable&&et.resume){et.resume()}}$.on("drain",eo);if(!$._isStdio&&(!ee||ee.end!==false)){et.on("end",eu);et.on("close",el)}var es=false;function eu(){if(es)return;es=true;$.end()}function el(){if(es)return;es=true;if(typeof $.destroy==="function")$.destroy()}function ef($){ed();if(en.listenerCount(this,"error")===0){throw $}}et.on("error",ef);$.on("error",ef);function ed(){et.removeListener("data",ei);$.removeListener("drain",eo);et.removeListener("end",eu);et.removeListener("close",el);et.removeListener("error",ef);$.removeListener("error",ef);et.removeListener("end",ed);et.removeListener("close",ed);$.removeListener("close",ed)}et.on("end",ed);et.on("close",ed);$.on("close",ed);$.emit("pipe",et);return $}},2553:($,ee,et)=>{"use strict";var en=et(396).Buffer;var ei=en.isEncoding||function($){$=""+$;switch($&&$.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function eo($){if(!$)return"utf8";var ee;while(true){switch($){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return $;default:if(ee)return;$=(""+$).toLowerCase();ee=true}}};function es($){var ee=eo($);if(typeof ee!=="string"&&(en.isEncoding===ei||!ei($)))throw new Error("Unknown encoding: "+$);return ee||$}ee.StringDecoder=eu;function eu($){this.encoding=es($);var ee;switch(this.encoding){case"utf16le":this.text=eg;this.end=em;ee=4;break;case"utf8":this.fillLast=ep;ee=4;break;case"base64":this.text=e_;this.end=ew;ee=3;break;default:this.write=eE;this.end=eS;return}this.lastNeed=0;this.lastTotal=0;this.lastChar=en.allocUnsafe(ee)}eu.prototype.write=function($){if($.length===0)return"";var ee;var et;if(this.lastNeed){ee=this.fillLast($);if(ee===undefined)return"";et=this.lastNeed;this.lastNeed=0}else{et=0}if(et<$.length)return ee?ee+this.text($,et):this.text($,et);return ee||""};eu.prototype.end=ey;eu.prototype.text=eh;eu.prototype.fillLast=function($){if(this.lastNeed<=$.length){$.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}$.copy(this.lastChar,this.lastTotal-this.lastNeed,0,$.length);this.lastNeed-=$.length};function el($){if($<=127)return 0;else if($>>5===6)return 2;else if($>>4===14)return 3;else if($>>3===30)return 4;return $>>6===2?-1:-2}function ef($,ee,et){var en=ee.length-1;if(en<et)return 0;var ei=el(ee[en]);if(ei>=0){if(ei>0)$.lastNeed=ei-1;return ei}if(--en<et||ei===-2)return 0;ei=el(ee[en]);if(ei>=0){if(ei>0)$.lastNeed=ei-2;return ei}if(--en<et||ei===-2)return 0;ei=el(ee[en]);if(ei>=0){if(ei>0){if(ei===2)ei=0;else $.lastNeed=ei-3}return ei}return 0}function ed($,ee,et){if((ee[0]&192)!==128){$.lastNeed=0;return"�"}if($.lastNeed>1&&ee.length>1){if((ee[1]&192)!==128){$.lastNeed=1;return"�"}if($.lastNeed>2&&ee.length>2){if((ee[2]&192)!==128){$.lastNeed=2;return"�"}}}}function ep($){var ee=this.lastTotal-this.lastNeed;var et=ed(this,$,ee);if(et!==undefined)return et;if(this.lastNeed<=$.length){$.copy(this.lastChar,ee,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}$.copy(this.lastChar,ee,0,$.length);this.lastNeed-=$.length}function eh($,ee){var et=ef(this,$,ee);if(!this.lastNeed)return $.toString("utf8",ee);this.lastTotal=et;var en=$.length-(et-this.lastNeed);$.copy(this.lastChar,0,en);return $.toString("utf8",ee,en)}function ey($){var ee=$&&$.length?this.write($):"";if(this.lastNeed)return ee+"�";return ee}function eg($,ee){if(($.length-ee)%2===0){var et=$.toString("utf16le",ee);if(et){var en=et.charCodeAt(et.length-1);if(en>=55296&&en<=56319){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=$[$.length-2];this.lastChar[1]=$[$.length-1];return et.slice(0,-1)}}return et}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=$[$.length-1];return $.toString("utf16le",ee,$.length-1)}function em($){var ee=$&&$.length?this.write($):"";if(this.lastNeed){var et=this.lastTotal-this.lastNeed;return ee+this.lastChar.toString("utf16le",0,et)}return ee}function e_($,ee){var et=($.length-ee)%3;if(et===0)return $.toString("base64",ee);this.lastNeed=3-et;this.lastTotal=3;if(et===1){this.lastChar[0]=$[$.length-1]}else{this.lastChar[0]=$[$.length-2];this.lastChar[1]=$[$.length-1]}return $.toString("base64",ee,$.length-et)}function ew($){var ee=$&&$.length?this.write($):"";if(this.lastNeed)return ee+this.lastChar.toString("base64",0,3-this.lastNeed);return ee}function eE($){return $.toString(this.encoding)}function eS($){return $&&$.length?this.write($):""}},396:($,ee,et)=>{var en=et(8764);var ei=en.Buffer;function eo($,ee){for(var et in $){ee[et]=$[et]}}if(ei.from&&ei.alloc&&ei.allocUnsafe&&ei.allocUnsafeSlow){$.exports=en}else{eo(en,ee);ee.Buffer=es}function es($,ee,et){return ei($,ee,et)}eo(ei,es);es.from=function($,ee,et){if(typeof $==="number"){throw new TypeError("Argument must not be a number")}return ei($,ee,et)};es.alloc=function($,ee,et){if(typeof $!=="number"){throw new TypeError("Argument must be a number")}var en=ei($);if(ee!==undefined){if(typeof et==="string"){en.fill(ee,et)}else{en.fill(ee)}}else{en.fill(0)}return en};es.allocUnsafe=function($){if(typeof $!=="number"){throw new TypeError("Argument must be a number")}return ei($)};es.allocUnsafeSlow=function($){if(typeof $!=="number"){throw new TypeError("Argument must be a number")}return en.SlowBuffer($)}},8393:function($,ee,et){"use strict";var en=this&&this.__createBinding||(Object.create?function($,ee,et,en){if(en===undefined)en=et;var ei=Object.getOwnPropertyDescriptor(ee,et);if(!ei||("get"in ei?!ee.__esModule:ei.writable||ei.configurable)){ei={enumerable:true,get:function $(){return ee[et]}}}Object.defineProperty($,en,ei)}:function($,ee,et,en){if(en===undefined)en=et;$[en]=ee[et]});var ei=this&&this.__exportStar||function($,ee){for(var et in $)if(et!=="default"&&!Object.prototype.hasOwnProperty.call(ee,et))en(ee,$,et)};Object.defineProperty(ee,"__esModule",{value:true});ei(et(5416),ee)},4473:function($,ee,et){"use strict";var en=this&&this.__createBinding||(Object.create?function($,ee,et,en){if(en===undefined)en=et;var ei=Object.getOwnPropertyDescriptor(ee,et);if(!ei||("get"in ei?!ee.__esModule:ei.writable||ei.configurable)){ei={enumerable:true,get:function $(){return ee[et]}}}Object.defineProperty($,en,ei)}:function($,ee,et,en){if(en===undefined)en=et;$[en]=ee[et]});var ei=this&&this.__setModuleDefault||(Object.create?function($,ee){Object.defineProperty($,"default",{enumerable:true,value:ee})}:function($,ee){$["default"]=ee});var eo=this&&this.__importStar||function($){if($&&$.__esModule)return $;var ee={};if($!=null){for(var et in $)if(et!=="default"&&Object.prototype.hasOwnProperty.call($,et))en(ee,$,et)}ei(ee,$);return ee};Object.defineProperty(ee,"__esModule",{value:true});ee.Timestamp=ee.deserializeClock=ee.serializeClock=ee.makeClientId=ee.makeClock=ee.setClock=ee.getClock=ee.merkle=void 0;var es=eo(et(5470));ee.merkle=es;var eu=et(3136);Object.defineProperty(ee,"getClock",{enumerable:true,get:function $(){return eu.getClock}});Object.defineProperty(ee,"setClock",{enumerable:true,get:function $(){return eu.setClock}});Object.defineProperty(ee,"makeClock",{enumerable:true,get:function $(){return eu.makeClock}});Object.defineProperty(ee,"makeClientId",{enumerable:true,get:function $(){return eu.makeClientId}});Object.defineProperty(ee,"serializeClock",{enumerable:true,get:function $(){return eu.serializeClock}});Object.defineProperty(ee,"deserializeClock",{enumerable:true,get:function $(){return eu.deserializeClock}});Object.defineProperty(ee,"Timestamp",{enumerable:true,get:function $(){return eu.Timestamp}})},5470:($,ee)=>{"use strict";function et($,ee){if(ee==null||ee>$.length)ee=$.length;for(var et=0,en=new Array(ee);et<ee;et++)en[et]=$[et];return en}function en($){if(Array.isArray($))return et($)}function ei($,ee,et){if(ee in $){Object.defineProperty($,ee,{value:et,enumerable:true,configurable:true,writable:true})}else{$[ee]=et}return $}function eo($){if(typeof Symbol!=="undefined"&&$[Symbol.iterator]!=null||$["@@iterator"]!=null)return Array.from($)}function es(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function eu($){return en($)||eo($)||el($)||es()}function el($,ee){if(!$)return;if(typeof $==="string")return et($,ee);var en=Object.prototype.toString.call($).slice(8,-1);if(en==="Object"&&$.constructor)en=$.constructor.name;if(en==="Map"||en==="Set")return Array.from(en);if(en==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(en))return et($,ee)}Object.defineProperty(ee,"__esModule",{value:true});ee.debug=ee.prune=ee.diff=ee.build=ee.insert=ee.keyToTimestamp=ee.getKeys=ee.emptyTrie=void 0;function ef(){return{hash:0}}ee.emptyTrie=ef;function ed($){return["0","1","2"].includes($)}function ep($){return Object.keys($).filter(ed)}ee.getKeys=ep;function eh($){var ee=$+"0".repeat(16-$.length);return parseInt(ee,3)*1e3*60}ee.keyToTimestamp=eh;function ey($,ee){var et=ee.hash();var en=Number(Math.floor(ee.millis()/1e3/60)).toString(3);$=Object.assign({},$,{hash:($.hash||0)^et});return eg($,en,et)}ee.insert=ey;function eg($,ee,et){if(ee.length===0){return $}var en=ee[0];var eo=ed(en)?$[en]:undefined;var es=eo||{};return Object.assign({},$,ei({},en,Object.assign({},es,eg(es,ee.slice(1),et),{hash:(es.hash||0)^et})))}function em($){var ee=ef();var et=true,en=false,ei=undefined;try{for(var eo=$[Symbol.iterator](),es;!(et=(es=eo.next()).done);et=true){var eu=es.value;ey(ee,eu)}}catch($){en=true;ei=$}finally{try{if(!et&&eo.return!=null){eo.return()}}finally{if(en){throw ei}}}return ee}ee.build=em;function e_($,ee){if($.hash===ee.hash){return null}var et=$;var en=ee;var ei="";while(1){var eo=new Set(eu(ep(et)).concat(eu(ep(en))));var es=eu(eo.values());es.sort();var el=null;for(var ed=0;ed<es.length;ed++){var ey=es[ed];var eg=et[ey];var em=en[ey];if(!eg||!em){break}if(eg.hash!==em.hash){el=ey;break}}if(!el){return eh(ei)}ei+=el;et=et[el]||ef();en=en[el]||ef()}return null}ee.diff=e_;function ew($){var ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;if(!$.hash){return $}var et=ep($);et.sort();var en={hash:$.hash};var ei=true,eo=false,es=undefined;try{for(var eu=et.slice(-ee)[Symbol.iterator](),el;!(ei=(el=eu.next()).done);ei=true){var ef=el.value;var ed=$[ef];if(!ed){throw new Error("TrieNode for key ".concat(ef," could not be found"))}en[ef]=ew(ed,ee)}}catch($){eo=true;es=$}finally{try{if(!ei&&eu.return!=null){eu.return()}}finally{if(eo){throw es}}}return en}ee.prune=ew;function eE($){var ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",et=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;var en=" ".repeat(et)+(ee!==""?"k: ".concat(ee," "):"")+"hash: ".concat($.hash||"(empty)","\n");return en+ep($).map(function(ee){var en=$[ee];if(!en)return"";return eE(en,ee,et+2)}).join("")}ee.debug=eE},3136:function($,ee,et){"use strict";function en($){if($===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return $}function ei($,ee){if(!($ instanceof ee)){throw new TypeError("Cannot call a class as a function")}}function eo($,ee,et){if(e_()){eo=Reflect.construct}else{eo=function $($,ee,et){var en=[null];en.push.apply(en,ee);var ei=Function.bind.apply($,en);var eo=new ei;if(et)ey(eo,et.prototype);return eo}}return eo.apply(null,arguments)}function es($,ee){for(var et=0;et<ee.length;et++){var en=ee[et];en.enumerable=en.enumerable||false;en.configurable=true;if("value"in en)en.writable=true;Object.defineProperty($,en.key,en)}}function eu($,ee,et){if(ee)es($.prototype,ee);if(et)es($,et);return $}function el($){el=Object.setPrototypeOf?Object.getPrototypeOf:function $($){return $.__proto__||Object.getPrototypeOf($)};return el($)}function ef($,ee){if(typeof ee!=="function"&&ee!==null){throw new TypeError("Super expression must either be null or a function")}$.prototype=Object.create(ee&&ee.prototype,{constructor:{value:$,writable:true,configurable:true}});if(ee)ey($,ee)}function ed($,ee){if(ee!=null&&typeof Symbol!=="undefined"&&ee[Symbol.hasInstance]){return!!ee[Symbol.hasInstance]($)}else{return $ instanceof ee}}function ep($){return Function.toString.call($).indexOf("[native code]")!==-1}function eh($,ee){if(ee&&(eg(ee)==="object"||typeof ee==="function")){return ee}return en($)}function ey($,ee){ey=Object.setPrototypeOf||function $($,ee){$.__proto__=ee;return $};return ey($,ee)}function eg($){"@swc/helpers - typeof";return $&&typeof Symbol!=="undefined"&&$.constructor===Symbol?"symbol":typeof $}function em($){var ee=typeof Map==="function"?new Map:undefined;em=function $($){if($===null||!ep($))return $;if(typeof $!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof ee!=="undefined"){if(ee.has($))return ee.get($);ee.set($,et)}function et(){return eo($,arguments,el(this).constructor)}et.prototype=Object.create($.prototype,{constructor:{value:et,enumerable:false,writable:true,configurable:true}});return ey(et,$)};return em($)}function e_(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true}catch($){return false}}function ew($){var ee=e_();return function et(){var et=el($),en;if(ee){var ei=el(this).constructor;en=Reflect.construct(et,arguments,ei)}else{en=et.apply(this,arguments)}return eh(this,en)}}var eE=this&&this.__importDefault||function($){return $&&$.__esModule?$:{"default":$}};Object.defineProperty(ee,"__esModule",{value:true});ee.Timestamp=ee.makeClientId=ee.deserializeClock=ee.serializeClock=ee.makeClock=ee.getClock=ee.setClock=void 0;var eS=eE(et(8053));var eT=et(7429);var eO;function eA($){eO=$}ee.setClock=eA;function eI(){return eO}ee.getClock=eI;function eN($){var ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return{timestamp:eF.from($),merkle:ee}}ee.makeClock=eN;function eD($){return JSON.stringify({timestamp:$.timestamp.toString(),merkle:$.merkle})}ee.serializeClock=eD;function eR($){var ee;try{ee=JSON.parse($)}catch($){ee={timestamp:"1970-01-01T00:00:00.000Z-0000-"+eC(),merkle:{}}}var et=eP.parse(ee.timestamp);if(!et){throw new eP.InvalidError(ee.timestamp)}return{timestamp:eF.from(et),merkle:ee.merkle}}ee.deserializeClock=eR;function eC(){return(0,eT.v4)().replace(/-/g,"").slice(-16)}ee.makeClientId=eC;var ek={maxDrift:5*60*1e3};var eM=parseInt("0xFFFF");var eL=16;var eP=function(){function $(ee,et,en){ei(this,$);this._state={millis:ee,counter:et,node:en}}eu($,[{key:"valueOf",value:function $(){return this.toString()}},{key:"toString",value:function $(){return[new Date(this.millis()).toISOString(),("0000"+this.counter().toString(16).toUpperCase()).slice(-4),("0000000000000000"+this.node()).slice(-16)].join("-")}},{key:"millis",value:function $(){return this._state.millis}},{key:"counter",value:function $(){return this._state.counter}},{key:"node",value:function $(){return this._state.node}},{key:"hash",value:function $(){return eS.default.v3(this.toString())}}],[{key:"init",value:function ee(){var ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ee.maxDrift){ek.maxDrift=ee.maxDrift}eA(eN(new $(0,0,ee.node?("0000000000000000"+ee.node).toString().slice(-16):"")))}},{key:"parse",value:function ee(ee){if(ed(ee,$)){return ee}if(typeof ee==="string"){var et=ee.split("-");if(et&&et.length===5){var en=Date.parse(et.slice(0,3).join("-")).valueOf();var ei=parseInt(et[3],16);var eo=et[4];if(!isNaN(en)&&en>=0&&!isNaN(ei)&&ei<=eM&&typeof eo==="string"&&eo.length<=eL){return new $(en,ei,eo)}}}return null}},{key:"send",value:function ee(){if(!eO){return null}var ee=Date.now();var et=eO.timestamp.millis();var en=eO.timestamp.counter();var ei=Math.max(et,ee);var eo=et===ei?en+1:0;if(ei-ee>ek.maxDrift){throw new $.ClockDriftError(ei,ee,ek.maxDrift)}if(eo>eM){throw new $.OverflowError}eO.timestamp.setMillis(ei);eO.timestamp.setCounter(eo);return new $(eO.timestamp.millis(),eO.timestamp.counter(),eO.timestamp.node())}},{key:"recv",value:function ee(ee){if(!eO){return null}var et=Date.now();var en=ee.millis();var ei=ee.counter();if(en-et>ek.maxDrift){throw new $.ClockDriftError}var eo=eO.timestamp.millis();var es=eO.timestamp.counter();var eu=Math.max(Math.max(eo,et),en);var el=eu===eo&&eu===en?Math.max(es,ei)+1:eu===eo?es+1:eu===en?ei+1:0;if(eu-et>ek.maxDrift){throw new $.ClockDriftError}if(el>eM){throw new $.OverflowError}eO.timestamp.setMillis(eu);eO.timestamp.setCounter(el);return new $(eO.timestamp.millis(),eO.timestamp.counter(),eO.timestamp.node())}}]);return $}();eP.max=eP.parse("9999-12-31T23:59:59.999Z-FFFF-FFFFFFFFFFFFFFFF");eP.zero=eP.parse("1970-01-01T00:00:00.000Z-0000-0000000000000000");eP.since=function($){return $+"-0000-0000000000000000"};eP.DuplicateNodeError=function($){ef(et,$);var ee=ew(et);function et($){ei(this,et);var en;en=ee.call(this,"duplicate node identifier "+$);en.name="DuplicateNodeError";return en}return et}(em(Error));eP.ClockDriftError=function($){ef(et,$);var ee=ew(et);function et(){for(var $=arguments.length,en=new Array($),eo=0;eo<$;eo++){en[eo]=arguments[eo]}ei(this,et);var es;es=ee.call(this,["maximum clock drift exceeded"].concat(en).join(" "));es.name="ClockDriftError";return es}return et}(em(Error));eP.OverflowError=function($){ef(et,$);var ee=ew(et);function et(){ei(this,et);var $;$=ee.call(this,"timestamp counter overflow");$.name="OverflowError";return $}return et}(em(Error));eP.InvalidError=function($){ef(et,$);var ee=ew(et);function et(){for(var $=arguments.length,en=new Array($),eo=0;eo<$;eo++){en[eo]=arguments[eo]}ei(this,et);var es;es=ee.call(this,["timestamp is not valid"].concat(en.map(String)).join(" "));es.name="InvalidError";return es}return et}(em(Error));ee.Timestamp=eP;var eF=function($){ef(et,$);var ee=ew(et);function et(){ei(this,et);return ee.apply(this,arguments)}eu(et,[{key:"setMillis",value:function $($){this._state.millis=$}},{key:"setCounter",value:function $($){this._state.counter=$}},{key:"setNode",value:function $($){this._state.node=$}}],[{key:"from",value:function $($){return new et($.millis(),$.counter(),$.node())}}]);return et}(eP)},5416:function($,ee,et){"use strict";var en=this&&this.__createBinding||(Object.create?function($,ee,et,en){if(en===undefined)en=et;var ei=Object.getOwnPropertyDescriptor(ee,et);if(!ei||("get"in ei?!ee.__esModule:ei.writable||ei.configurable)){ei={enumerable:true,get:function $(){return ee[et]}}}Object.defineProperty($,en,ei)}:function($,ee,et,en){if(en===undefined)en=et;$[en]=ee[et]});var ei=this&&this.__setModuleDefault||(Object.create?function($,ee){Object.defineProperty($,"default",{enumerable:true,value:ee})}:function($,ee){$["default"]=ee});var eo=this&&this.__importStar||function($){if($&&$.__esModule)return $;var ee={};if($!=null){for(var et in $)if(et!=="default"&&Object.prototype.hasOwnProperty.call($,et))en(ee,$,et)}ei(ee,$);return ee};Object.defineProperty(ee,"__esModule",{value:true});ee.SyncProtoBuf=ee.Timestamp=ee.deserializeClock=ee.serializeClock=ee.makeClientId=ee.makeClock=ee.setClock=ee.getClock=ee.merkle=void 0;var es=eo(et(1323));var eu=et(4473);Object.defineProperty(ee,"merkle",{enumerable:true,get:function $(){return eu.merkle}});Object.defineProperty(ee,"getClock",{enumerable:true,get:function $(){return eu.getClock}});Object.defineProperty(ee,"setClock",{enumerable:true,get:function $(){return eu.setClock}});Object.defineProperty(ee,"makeClock",{enumerable:true,get:function $(){return eu.makeClock}});Object.defineProperty(ee,"makeClientId",{enumerable:true,get:function $(){return eu.makeClientId}});Object.defineProperty(ee,"serializeClock",{enumerable:true,get:function $(){return eu.serializeClock}});Object.defineProperty(ee,"deserializeClock",{enumerable:true,get:function $(){return eu.deserializeClock}});Object.defineProperty(ee,"Timestamp",{enumerable:true,get:function $(){return eu.Timestamp}});ee.SyncProtoBuf=es},1323:($,ee,et)=>{"use strict";var en=et(3019);var ei=en;var eo=globalThis;ei.exportSymbol("proto.EncryptedData",null,eo);ei.exportSymbol("proto.Message",null,eo);ei.exportSymbol("proto.MessageEnvelope",null,eo);ei.exportSymbol("proto.SyncRequest",null,eo);ei.exportSymbol("proto.SyncResponse",null,eo);proto.EncryptedData=function($){en.Message.initialize(this,$,0,-1,null,null)};ei.inherits(proto.EncryptedData,en.Message);if(ei.DEBUG&&!COMPILED){proto.EncryptedData.displayName="proto.EncryptedData"}proto.Message=function($){en.Message.initialize(this,$,0,-1,null,null)};ei.inherits(proto.Message,en.Message);if(ei.DEBUG&&!COMPILED){proto.Message.displayName="proto.Message"}proto.MessageEnvelope=function($){en.Message.initialize(this,$,0,-1,null,null)};ei.inherits(proto.MessageEnvelope,en.Message);if(ei.DEBUG&&!COMPILED){proto.MessageEnvelope.displayName="proto.MessageEnvelope"}proto.SyncRequest=function($){en.Message.initialize(this,$,0,-1,proto.SyncRequest.repeatedFields_,null)};ei.inherits(proto.SyncRequest,en.Message);if(ei.DEBUG&&!COMPILED){proto.SyncRequest.displayName="proto.SyncRequest"}proto.SyncResponse=function($){en.Message.initialize(this,$,0,-1,proto.SyncResponse.repeatedFields_,null)};ei.inherits(proto.SyncResponse,en.Message);if(ei.DEBUG&&!COMPILED){proto.SyncResponse.displayName="proto.SyncResponse"}if(en.Message.GENERATE_TO_OBJECT){proto.EncryptedData.prototype.toObject=function($){return proto.EncryptedData.toObject($,this)};proto.EncryptedData.toObject=function($,ee){var et,en={iv:ee.getIv_asB64(),authtag:ee.getAuthtag_asB64(),data:ee.getData_asB64()};if($){en.$jspbMessageInstance=ee}return en}}proto.EncryptedData.deserializeBinary=function($){var ee=new en.BinaryReader($);var et=new proto.EncryptedData;return proto.EncryptedData.deserializeBinaryFromReader(et,ee)};proto.EncryptedData.deserializeBinaryFromReader=function($,ee){while(ee.nextField()){if(ee.isEndGroup()){break}var et=ee.getFieldNumber();switch(et){case 1:var en=ee.readBytes();$.setIv(en);break;case 2:var en=ee.readBytes();$.setAuthtag(en);break;case 3:var en=ee.readBytes();$.setData(en);break;default:ee.skipField();break}}return $};proto.EncryptedData.prototype.serializeBinary=function(){var $=new en.BinaryWriter;proto.EncryptedData.serializeBinaryToWriter(this,$);return $.getResultBuffer()};proto.EncryptedData.serializeBinaryToWriter=function($,ee){var et=undefined;et=$.getIv_asU8();if(et.length>0){ee.writeBytes(1,et)}et=$.getAuthtag_asU8();if(et.length>0){ee.writeBytes(2,et)}et=$.getData_asU8();if(et.length>0){ee.writeBytes(3,et)}};proto.EncryptedData.prototype.getIv=function(){return en.Message.getFieldWithDefault(this,1,"")};proto.EncryptedData.prototype.getIv_asB64=function(){return en.Message.bytesAsB64(this.getIv())};proto.EncryptedData.prototype.getIv_asU8=function(){return en.Message.bytesAsU8(this.getIv())};proto.EncryptedData.prototype.setIv=function($){return en.Message.setProto3BytesField(this,1,$)};proto.EncryptedData.prototype.getAuthtag=function(){return en.Message.getFieldWithDefault(this,2,"")};proto.EncryptedData.prototype.getAuthtag_asB64=function(){return en.Message.bytesAsB64(this.getAuthtag())};proto.EncryptedData.prototype.getAuthtag_asU8=function(){return en.Message.bytesAsU8(this.getAuthtag())};proto.EncryptedData.prototype.setAuthtag=function($){return en.Message.setProto3BytesField(this,2,$)};proto.EncryptedData.prototype.getData=function(){return en.Message.getFieldWithDefault(this,3,"")};proto.EncryptedData.prototype.getData_asB64=function(){return en.Message.bytesAsB64(this.getData())};proto.EncryptedData.prototype.getData_asU8=function(){return en.Message.bytesAsU8(this.getData())};proto.EncryptedData.prototype.setData=function($){return en.Message.setProto3BytesField(this,3,$)};if(en.Message.GENERATE_TO_OBJECT){proto.Message.prototype.toObject=function($){return proto.Message.toObject($,this)};proto.Message.toObject=function($,ee){var et,ei={dataset:en.Message.getFieldWithDefault(ee,1,""),row:en.Message.getFieldWithDefault(ee,2,""),column:en.Message.getFieldWithDefault(ee,3,""),value:en.Message.getFieldWithDefault(ee,4,"")};if($){ei.$jspbMessageInstance=ee}return ei}}proto.Message.deserializeBinary=function($){var ee=new en.BinaryReader($);var et=new proto.Message;return proto.Message.deserializeBinaryFromReader(et,ee)};proto.Message.deserializeBinaryFromReader=function($,ee){while(ee.nextField()){if(ee.isEndGroup()){break}var et=ee.getFieldNumber();switch(et){case 1:var en=ee.readString();$.setDataset(en);break;case 2:var en=ee.readString();$.setRow(en);break;case 3:var en=ee.readString();$.setColumn(en);break;case 4:var en=ee.readString();$.setValue(en);break;default:ee.skipField();break}}return $};proto.Message.prototype.serializeBinary=function(){var $=new en.BinaryWriter;proto.Message.serializeBinaryToWriter(this,$);return $.getResultBuffer()};proto.Message.serializeBinaryToWriter=function($,ee){var et=undefined;et=$.getDataset();if(et.length>0){ee.writeString(1,et)}et=$.getRow();if(et.length>0){ee.writeString(2,et)}et=$.getColumn();if(et.length>0){ee.writeString(3,et)}et=$.getValue();if(et.length>0){ee.writeString(4,et)}};proto.Message.prototype.getDataset=function(){return en.Message.getFieldWithDefault(this,1,"")};proto.Message.prototype.setDataset=function($){return en.Message.setProto3StringField(this,1,$)};proto.Message.prototype.getRow=function(){return en.Message.getFieldWithDefault(this,2,"")};proto.Message.prototype.setRow=function($){return en.Message.setProto3StringField(this,2,$)};proto.Message.prototype.getColumn=function(){return en.Message.getFieldWithDefault(this,3,"")};proto.Message.prototype.setColumn=function($){return en.Message.setProto3StringField(this,3,$)};proto.Message.prototype.getValue=function(){return en.Message.getFieldWithDefault(this,4,"")};proto.Message.prototype.setValue=function($){return en.Message.setProto3StringField(this,4,$)};if(en.Message.GENERATE_TO_OBJECT){proto.MessageEnvelope.prototype.toObject=function($){return proto.MessageEnvelope.toObject($,this)};proto.MessageEnvelope.toObject=function($,ee){var et,ei={timestamp:en.Message.getFieldWithDefault(ee,1,""),isencrypted:en.Message.getBooleanFieldWithDefault(ee,2,false),content:ee.getContent_asB64()};if($){ei.$jspbMessageInstance=ee}return ei}}proto.MessageEnvelope.deserializeBinary=function($){var ee=new en.BinaryReader($);var et=new proto.MessageEnvelope;return proto.MessageEnvelope.deserializeBinaryFromReader(et,ee)};proto.MessageEnvelope.deserializeBinaryFromReader=function($,ee){while(ee.nextField()){if(ee.isEndGroup()){break}var et=ee.getFieldNumber();switch(et){case 1:var en=ee.readString();$.setTimestamp(en);break;case 2:var en=ee.readBool();$.setIsencrypted(en);break;case 3:var en=ee.readBytes();$.setContent(en);break;default:ee.skipField();break}}return $};proto.MessageEnvelope.prototype.serializeBinary=function(){var $=new en.BinaryWriter;proto.MessageEnvelope.serializeBinaryToWriter(this,$);return $.getResultBuffer()};proto.MessageEnvelope.serializeBinaryToWriter=function($,ee){var et=undefined;et=$.getTimestamp();if(et.length>0){ee.writeString(1,et)}et=$.getIsencrypted();if(et){ee.writeBool(2,et)}et=$.getContent_asU8();if(et.length>0){ee.writeBytes(3,et)}};proto.MessageEnvelope.prototype.getTimestamp=function(){return en.Message.getFieldWithDefault(this,1,"")};proto.MessageEnvelope.prototype.setTimestamp=function($){return en.Message.setProto3StringField(this,1,$)};proto.MessageEnvelope.prototype.getIsencrypted=function(){return en.Message.getBooleanFieldWithDefault(this,2,false)};proto.MessageEnvelope.prototype.setIsencrypted=function($){return en.Message.setProto3BooleanField(this,2,$)};proto.MessageEnvelope.prototype.getContent=function(){return en.Message.getFieldWithDefault(this,3,"")};proto.MessageEnvelope.prototype.getContent_asB64=function(){return en.Message.bytesAsB64(this.getContent())};proto.MessageEnvelope.prototype.getContent_asU8=function(){return en.Message.bytesAsU8(this.getContent())};proto.MessageEnvelope.prototype.setContent=function($){return en.Message.setProto3BytesField(this,3,$)};proto.SyncRequest.repeatedFields_=[1];if(en.Message.GENERATE_TO_OBJECT){proto.SyncRequest.prototype.toObject=function($){return proto.SyncRequest.toObject($,this)};proto.SyncRequest.toObject=function($,ee){var et,ei={messagesList:en.Message.toObjectList(ee.getMessagesList(),proto.MessageEnvelope.toObject,$),fileid:en.Message.getFieldWithDefault(ee,2,""),groupid:en.Message.getFieldWithDefault(ee,3,""),keyid:en.Message.getFieldWithDefault(ee,5,""),since:en.Message.getFieldWithDefault(ee,6,"")};if($){ei.$jspbMessageInstance=ee}return ei}}proto.SyncRequest.deserializeBinary=function($){var ee=new en.BinaryReader($);var et=new proto.SyncRequest;return proto.SyncRequest.deserializeBinaryFromReader(et,ee)};proto.SyncRequest.deserializeBinaryFromReader=function($,ee){while(ee.nextField()){if(ee.isEndGroup()){break}var et=ee.getFieldNumber();switch(et){case 1:var en=new proto.MessageEnvelope;ee.readMessage(en,proto.MessageEnvelope.deserializeBinaryFromReader);$.addMessages(en);break;case 2:var en=ee.readString();$.setFileid(en);break;case 3:var en=ee.readString();$.setGroupid(en);break;case 5:var en=ee.readString();$.setKeyid(en);break;case 6:var en=ee.readString();$.setSince(en);break;default:ee.skipField();break}}return $};proto.SyncRequest.prototype.serializeBinary=function(){var $=new en.BinaryWriter;proto.SyncRequest.serializeBinaryToWriter(this,$);return $.getResultBuffer()};proto.SyncRequest.serializeBinaryToWriter=function($,ee){var et=undefined;et=$.getMessagesList();if(et.length>0){ee.writeRepeatedMessage(1,et,proto.MessageEnvelope.serializeBinaryToWriter)}et=$.getFileid();if(et.length>0){ee.writeString(2,et)}et=$.getGroupid();if(et.length>0){ee.writeString(3,et)}et=$.getKeyid();if(et.length>0){ee.writeString(5,et)}et=$.getSince();if(et.length>0){ee.writeString(6,et)}};proto.SyncRequest.prototype.getMessagesList=function(){return en.Message.getRepeatedWrapperField(this,proto.MessageEnvelope,1)};proto.SyncRequest.prototype.setMessagesList=function($){return en.Message.setRepeatedWrapperField(this,1,$)};proto.SyncRequest.prototype.addMessages=function($,ee){return en.Message.addToRepeatedWrapperField(this,1,$,proto.MessageEnvelope,ee)};proto.SyncRequest.prototype.clearMessagesList=function(){return this.setMessagesList([])};proto.SyncRequest.prototype.getFileid=function(){return en.Message.getFieldWithDefault(this,2,"")};proto.SyncRequest.prototype.setFileid=function($){return en.Message.setProto3StringField(this,2,$)};proto.SyncRequest.prototype.getGroupid=function(){return en.Message.getFieldWithDefault(this,3,"")};proto.SyncRequest.prototype.setGroupid=function($){return en.Message.setProto3StringField(this,3,$)};proto.SyncRequest.prototype.getKeyid=function(){return en.Message.getFieldWithDefault(this,5,"")};proto.SyncRequest.prototype.setKeyid=function($){return en.Message.setProto3StringField(this,5,$)};proto.SyncRequest.prototype.getSince=function(){return en.Message.getFieldWithDefault(this,6,"")};proto.SyncRequest.prototype.setSince=function($){return en.Message.setProto3StringField(this,6,$)};proto.SyncResponse.repeatedFields_=[1];if(en.Message.GENERATE_TO_OBJECT){proto.SyncResponse.prototype.toObject=function($){return proto.SyncResponse.toObject($,this)};proto.SyncResponse.toObject=function($,ee){var et,ei={messagesList:en.Message.toObjectList(ee.getMessagesList(),proto.MessageEnvelope.toObject,$),merkle:en.Message.getFieldWithDefault(ee,2,"")};if($){ei.$jspbMessageInstance=ee}return ei}}proto.SyncResponse.deserializeBinary=function($){var ee=new en.BinaryReader($);var et=new proto.SyncResponse;return proto.SyncResponse.deserializeBinaryFromReader(et,ee)};proto.SyncResponse.deserializeBinaryFromReader=function($,ee){while(ee.nextField()){if(ee.isEndGroup()){break}var et=ee.getFieldNumber();switch(et){case 1:var en=new proto.MessageEnvelope;ee.readMessage(en,proto.MessageEnvelope.deserializeBinaryFromReader);$.addMessages(en);break;case 2:var en=ee.readString();$.setMerkle(en);break;default:ee.skipField();break}}return $};proto.SyncResponse.prototype.serializeBinary=function(){var $=new en.BinaryWriter;proto.SyncResponse.serializeBinaryToWriter(this,$);return $.getResultBuffer()};proto.SyncResponse.serializeBinaryToWriter=function($,ee){var et=undefined;et=$.getMessagesList();if(et.length>0){ee.writeRepeatedMessage(1,et,proto.MessageEnvelope.serializeBinaryToWriter)}et=$.getMerkle();if(et.length>0){ee.writeString(2,et)}};proto.SyncResponse.prototype.getMessagesList=function(){return en.Message.getRepeatedWrapperField(this,proto.MessageEnvelope,1)};proto.SyncResponse.prototype.setMessagesList=function($){return en.Message.setRepeatedWrapperField(this,1,$)};proto.SyncResponse.prototype.addMessages=function($,ee){return en.Message.addToRepeatedWrapperField(this,1,$,proto.MessageEnvelope,ee)};proto.SyncResponse.prototype.clearMessagesList=function(){return this.setMessagesList([])};proto.SyncResponse.prototype.getMerkle=function(){return en.Message.getFieldWithDefault(this,2,"")};proto.SyncResponse.prototype.setMerkle=function($){return en.Message.setProto3StringField(this,2,$)};ei.object.extend(ee,proto)},4927:($,ee,et)=>{$.exports=en;function en($,ee){if(ei("noDeprecation")){return $}var et=false;function en(){if(!et){if(ei("throwDeprecation")){throw new Error(ee)}else if(ei("traceDeprecation")){console.trace(ee)}else{console.warn(ee)}et=true}return $.apply(this,arguments)}return en}function ei($){try{if(!et.g.localStorage)return false}catch($){return false}var ee=et.g.localStorage[$];if(null==ee)return false;return String(ee).toLowerCase()==="true"}},384:$=>{$.exports=function $($){return $&&typeof $==="object"&&typeof $.copy==="function"&&typeof $.fill==="function"&&typeof $.readUInt8==="function"}},5955:($,ee,et)=>{"use strict";var en=et(2584);var ei=et(8662);var eo=et(6430);var es=et(5692);function eu($){return $.call.bind($)}var el=typeof BigInt!=="undefined";var ef=typeof Symbol!=="undefined";var ed=eu(Object.prototype.toString);var ep=eu(Number.prototype.valueOf);var eh=eu(String.prototype.valueOf);var ey=eu(Boolean.prototype.valueOf);if(el){var eg=eu(BigInt.prototype.valueOf)}if(ef){var em=eu(Symbol.prototype.valueOf)}function e_($,ee){if(typeof $!=="object"){return false}try{ee($);return true}catch($){return false}}ee.isArgumentsObject=en;ee.isGeneratorFunction=ei;ee.isTypedArray=es;function ew($){return typeof Promise!=="undefined"&&$ instanceof Promise||$!==null&&typeof $==="object"&&typeof $.then==="function"&&typeof $.catch==="function"}ee.isPromise=ew;function eE($){if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView){return ArrayBuffer.isView($)}return es($)||eq($)}ee.isArrayBufferView=eE;function eS($){return eo($)==="Uint8Array"}ee.isUint8Array=eS;function eT($){return eo($)==="Uint8ClampedArray"}ee.isUint8ClampedArray=eT;function eO($){return eo($)==="Uint16Array"}ee.isUint16Array=eO;function eA($){return eo($)==="Uint32Array"}ee.isUint32Array=eA;function eI($){return eo($)==="Int8Array"}ee.isInt8Array=eI;function eN($){return eo($)==="Int16Array"}ee.isInt16Array=eN;function eD($){return eo($)==="Int32Array"}ee.isInt32Array=eD;function eR($){return eo($)==="Float32Array"}ee.isFloat32Array=eR;function eC($){return eo($)==="Float64Array"}ee.isFloat64Array=eC;function ek($){return eo($)==="BigInt64Array"}ee.isBigInt64Array=ek;function eM($){return eo($)==="BigUint64Array"}ee.isBigUint64Array=eM;function eL($){return ed($)==="[object Map]"}eL.working=typeof Map!=="undefined"&&eL(new Map);function eP($){if(typeof Map==="undefined"){return false}return eL.working?eL($):$ instanceof Map}ee.isMap=eP;function eF($){return ed($)==="[object Set]"}eF.working=typeof Set!=="undefined"&&eF(new Set);function eB($){if(typeof Set==="undefined"){return false}return eF.working?eF($):$ instanceof Set}ee.isSet=eB;function eU($){return ed($)==="[object WeakMap]"}eU.working=typeof WeakMap!=="undefined"&&eU(new WeakMap);function ej($){if(typeof WeakMap==="undefined"){return false}return eU.working?eU($):$ instanceof WeakMap}ee.isWeakMap=ej;function eW($){return ed($)==="[object WeakSet]"}eW.working=typeof WeakSet!=="undefined"&&eW(new WeakSet);function eH($){return eW($)}ee.isWeakSet=eH;function ez($){return ed($)==="[object ArrayBuffer]"}ez.working=typeof ArrayBuffer!=="undefined"&&ez(new ArrayBuffer);function eV($){if(typeof ArrayBuffer==="undefined"){return false}return ez.working?ez($):$ instanceof ArrayBuffer}ee.isArrayBuffer=eV;function e$($){return ed($)==="[object DataView]"}e$.working=typeof ArrayBuffer!=="undefined"&&typeof DataView!=="undefined"&&e$(new DataView(new ArrayBuffer(1),0,1));function eq($){if(typeof DataView==="undefined"){return false}return e$.working?e$($):$ instanceof DataView}ee.isDataView=eq;var eG=typeof SharedArrayBuffer!=="undefined"?SharedArrayBuffer:undefined;function eY($){return ed($)==="[object SharedArrayBuffer]"}function eK($){if(typeof eG==="undefined"){return false}if(typeof eY.working==="undefined"){eY.working=eY(new eG)}return eY.working?eY($):$ instanceof eG}ee.isSharedArrayBuffer=eK;function eZ($){return ed($)==="[object AsyncFunction]"}ee.isAsyncFunction=eZ;function eJ($){return ed($)==="[object Map Iterator]"}ee.isMapIterator=eJ;function eX($){return ed($)==="[object Set Iterator]"}ee.isSetIterator=eX;function eQ($){return ed($)==="[object Generator]"}ee.isGeneratorObject=eQ;function e0($){return ed($)==="[object WebAssembly.Module]"}ee.isWebAssemblyCompiledModule=e0;function e1($){return e_($,ep)}ee.isNumberObject=e1;function e2($){return e_($,eh)}ee.isStringObject=e2;function e6($){return e_($,ey)}ee.isBooleanObject=e6;function e4($){return el&&e_($,eg)}ee.isBigIntObject=e4;function e3($){return ef&&e_($,em)}ee.isSymbolObject=e3;function e8($){return e1($)||e2($)||e6($)||e4($)||e3($)}ee.isBoxedPrimitive=e8;function e5($){return typeof Uint8Array!=="undefined"&&(eV($)||eK($))}ee.isAnyArrayBuffer=e5;["isProxy","isExternal","isModuleNamespaceObject"].forEach(function($){Object.defineProperty(ee,$,{enumerable:false,value:function(){throw new Error($+" is not supported in userland")}})})},9539:($,ee,et)=>{var en=et(4155);var ei=Object.getOwnPropertyDescriptors||function $($){var ee=Object.keys($);var et={};for(var en=0;en<ee.length;en++){et[ee[en]]=Object.getOwnPropertyDescriptor($,ee[en])}return et};var eo=/%[sdj%]/g;ee.format=function($){if(!eN($)){var ee=[];for(var et=0;et<arguments.length;et++){ee.push(ef(arguments[et]))}return ee.join(" ")}var et=1;var en=arguments;var ei=en.length;var es=String($).replace(eo,function($){if($==="%%")return"%";if(et>=ei)return $;switch($){case"%s":return String(en[et++]);case"%d":return Number(en[et++]);case"%j":try{return JSON.stringify(en[et++])}catch($){return"[Circular]"}default:return $}});for(var eu=en[et];et<ei;eu=en[++et]){if(eO(eu)||!ek(eu)){es+=" "+eu}else{es+=" "+ef(eu)}}return es};ee.deprecate=function($,et){if(typeof en!=="undefined"&&en.noDeprecation===true){return $}if(typeof en==="undefined"){return function(){return ee.deprecate($,et).apply(this,arguments)}}var ei=false;function eo(){if(!ei){if(en.throwDeprecation){throw new Error(et)}else if(en.traceDeprecation){console.trace(et)}else{console.error(et)}ei=true}return $.apply(this,arguments)}return eo};var es={};var eu=/^$/;if(({}).NODE_DEBUG){var el={}.NODE_DEBUG;el=el.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase();eu=new RegExp("^"+el+"$","i")}ee.debuglog=function($){$=$.toUpperCase();if(!es[$]){if(eu.test($)){var et=en.pid;es[$]=function(){var en=ee.format.apply(ee,arguments);console.error("%s %d: %s",$,et,en)}}else{es[$]=function(){}}}return es[$]};function ef($,et){var en={seen:[],stylize:ep};if(arguments.length>=3)en.depth=arguments[2];if(arguments.length>=4)en.colors=arguments[3];if(eT(et)){en.showHidden=et}else if(et){ee._extend(en,et)}if(eR(en.showHidden))en.showHidden=false;if(eR(en.depth))en.depth=2;if(eR(en.colors))en.colors=false;if(eR(en.customInspect))en.customInspect=true;if(en.colors)en.stylize=ed;return ey(en,$,en.depth)}ee.inspect=ef;ef.colors={"bold":[1,22],"italic":[3,23],"underline":[4,24],"inverse":[7,27],"white":[37,39],"grey":[90,39],"black":[30,39],"blue":[34,39],"cyan":[36,39],"green":[32,39],"magenta":[35,39],"red":[31,39],"yellow":[33,39]};ef.styles={"special":"cyan","number":"yellow","boolean":"yellow","undefined":"grey","null":"bold","string":"green","date":"magenta","regexp":"red"};function ed($,ee){var et=ef.styles[ee];if(et){return"\x1b["+ef.colors[et][0]+"m"+$+"\x1b["+ef.colors[et][1]+"m"}else{return $}}function ep($,ee){return $}function eh($){var ee={};$.forEach(function($,et){ee[$]=true});return ee}function ey($,et,en){if($.customInspect&&et&&eP(et.inspect)&&et.inspect!==ee.inspect&&!(et.constructor&&et.constructor.prototype===et)){var ei=et.inspect(en,$);if(!eN(ei)){ei=ey($,ei,en)}return ei}var eo=eg($,et);if(eo){return eo}var es=Object.keys(et);var eu=eh(es);if($.showHidden){es=Object.getOwnPropertyNames(et)}if(eL(et)&&(es.indexOf("message")>=0||es.indexOf("description")>=0)){return em(et)}if(es.length===0){if(eP(et)){var el=et.name?": "+et.name:"";return $.stylize("[Function"+el+"]","special")}if(eC(et)){return $.stylize(RegExp.prototype.toString.call(et),"regexp")}if(eM(et)){return $.stylize(Date.prototype.toString.call(et),"date")}if(eL(et)){return em(et)}}var ef="",ed=false,ep=["{","}"];if(eS(et)){ed=true;ep=["[","]"]}if(eP(et)){var eT=et.name?": "+et.name:"";ef=" [Function"+eT+"]"}if(eC(et)){ef=" "+RegExp.prototype.toString.call(et)}if(eM(et)){ef=" "+Date.prototype.toUTCString.call(et)}if(eL(et)){ef=" "+em(et)}if(es.length===0&&(!ed||et.length==0)){return ep[0]+ef+ep[1]}if(en<0){if(eC(et)){return $.stylize(RegExp.prototype.toString.call(et),"regexp")}else{return $.stylize("[Object]","special")}}$.seen.push(et);var eO;if(ed){eO=e_($,et,en,eu,es)}else{eO=es.map(function(ee){return ew($,et,en,eu,ee,ed)})}$.seen.pop();return eE(eO,ef,ep)}function eg($,ee){if(eR(ee))return $.stylize("undefined","undefined");if(eN(ee)){var et="'"+JSON.stringify(ee).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return $.stylize(et,"string")}if(eI(ee))return $.stylize(""+ee,"number");if(eT(ee))return $.stylize(""+ee,"boolean");if(eO(ee))return $.stylize("null","null")}function em($){return"["+Error.prototype.toString.call($)+"]"}function e_($,ee,et,en,ei){var eo=[];for(var es=0,eu=ee.length;es<eu;++es){if(eH(ee,String(es))){eo.push(ew($,ee,et,en,String(es),true))}else{eo.push("")}}ei.forEach(function(ei){if(!ei.match(/^\d+$/)){eo.push(ew($,ee,et,en,ei,true))}});return eo}function ew($,ee,et,en,ei,eo){var es,eu,el;el=Object.getOwnPropertyDescriptor(ee,ei)||{value:ee[ei]};if(el.get){if(el.set){eu=$.stylize("[Getter/Setter]","special")}else{eu=$.stylize("[Getter]","special")}}else{if(el.set){eu=$.stylize("[Setter]","special")}}if(!eH(en,ei)){es="["+ei+"]"}if(!eu){if($.seen.indexOf(el.value)<0){if(eO(et)){eu=ey($,el.value,null)}else{eu=ey($,el.value,et-1)}if(eu.indexOf("\n")>-1){if(eo){eu=eu.split("\n").map(function($){return" "+$}).join("\n").slice(2)}else{eu="\n"+eu.split("\n").map(function($){return" "+$}).join("\n")}}}else{eu=$.stylize("[Circular]","special")}}if(eR(es)){if(eo&&ei.match(/^\d+$/)){return eu}es=JSON.stringify(""+ei);if(es.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){es=es.slice(1,-1);es=$.stylize(es,"name")}else{es=es.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");es=$.stylize(es,"string")}}return es+": "+eu}function eE($,ee,et){var en=0;var ei=$.reduce(function($,ee){en++;if(ee.indexOf("\n")>=0)en++;return $+ee.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(ei>60){return et[0]+(ee===""?"":ee+"\n ")+" "+$.join(",\n ")+" "+et[1]}return et[0]+ee+" "+$.join(", ")+" "+et[1]}ee.types=et(5955);function eS($){return Array.isArray($)}ee.isArray=eS;function eT($){return typeof $==="boolean"}ee.isBoolean=eT;function eO($){return $===null}ee.isNull=eO;function eA($){return $==null}ee.isNullOrUndefined=eA;function eI($){return typeof $==="number"}ee.isNumber=eI;function eN($){return typeof $==="string"}ee.isString=eN;function eD($){return typeof $==="symbol"}ee.isSymbol=eD;function eR($){return $===void 0}ee.isUndefined=eR;function eC($){return ek($)&&eB($)==="[object RegExp]"}ee.isRegExp=eC;ee.types.isRegExp=eC;function ek($){return typeof $==="object"&&$!==null}ee.isObject=ek;function eM($){return ek($)&&eB($)==="[object Date]"}ee.isDate=eM;ee.types.isDate=eM;function eL($){return ek($)&&(eB($)==="[object Error]"||$ instanceof Error)}ee.isError=eL;ee.types.isNativeError=eL;function eP($){return typeof $==="function"}ee.isFunction=eP;function eF($){return $===null||typeof $==="boolean"||typeof $==="number"||typeof $==="string"||typeof $==="symbol"||typeof $==="undefined"}ee.isPrimitive=eF;ee.isBuffer=et(384);function eB($){return Object.prototype.toString.call($)}function eU($){return $<10?"0"+$.toString(10):$.toString(10)}var ej=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function eW(){var $=new Date;var ee=[eU($.getHours()),eU($.getMinutes()),eU($.getSeconds())].join(":");return[$.getDate(),ej[$.getMonth()],ee].join(" ")}ee.log=function(){console.log("%s - %s",eW(),ee.format.apply(ee,arguments))};ee.inherits=et(5717);ee._extend=function($,ee){if(!ee||!ek(ee))return $;var et=Object.keys(ee);var en=et.length;while(en--){$[et[en]]=ee[et[en]]}return $};function eH($,ee){return Object.prototype.hasOwnProperty.call($,ee)}var ez=typeof Symbol!=="undefined"?Symbol("util.promisify.custom"):undefined;ee.promisify=function $($){if(typeof $!=="function")throw new TypeError('The "original" argument must be of type Function');if(ez&&$[ez]){var ee=$[ez];if(typeof ee!=="function"){throw new TypeError('The "util.promisify.custom" argument must be of type Function')}Object.defineProperty(ee,ez,{value:ee,enumerable:false,writable:false,configurable:true});return ee}function ee(){var ee,et;var en=new Promise(function($,en){ee=$;et=en});var ei=[];for(var eo=0;eo<arguments.length;eo++){ei.push(arguments[eo])}ei.push(function($,en){if($){et($)}else{ee(en)}});try{$.apply(this,ei)}catch($){et($)}return en}Object.setPrototypeOf(ee,Object.getPrototypeOf($));if(ez)Object.defineProperty(ee,ez,{value:ee,enumerable:false,writable:false,configurable:true});return Object.defineProperties(ee,ei($))};ee.promisify.custom=ez;function eV($,ee){if(!$){var et=new Error("Promise was rejected with a falsy value");et.reason=$;$=et}return ee($)}function e$($){if(typeof $!=="function"){throw new TypeError('The "original" argument must be of type Function')}function ee(){var ee=[];for(var et=0;et<arguments.length;et++){ee.push(arguments[et])}var ei=ee.pop();if(typeof ei!=="function"){throw new TypeError("The last argument must be of type Function")}var eo=this;var es=function(){return ei.apply(eo,arguments)};$.apply(this,ee).then(function($){en.nextTick(es.bind(null,null,$))},function($){en.nextTick(eV.bind(null,$,es))})}Object.setPrototypeOf(ee,Object.getPrototypeOf($));Object.defineProperties(ee,ei($));return ee}ee.callbackify=e$},7429:($,ee,et)=>{"use strict";Object.defineProperty(ee,"__esModule",{value:true});Object.defineProperty(ee,"NIL",{enumerable:true,get:function $(){return eu.default}});Object.defineProperty(ee,"parse",{enumerable:true,get:function $(){return ep.default}});Object.defineProperty(ee,"stringify",{enumerable:true,get:function $(){return ed.default}});Object.defineProperty(ee,"v1",{enumerable:true,get:function $(){return en.default}});Object.defineProperty(ee,"v3",{enumerable:true,get:function $(){return ei.default}});Object.defineProperty(ee,"v4",{enumerable:true,get:function $(){return eo.default}});Object.defineProperty(ee,"v5",{enumerable:true,get:function $(){return es.default}});Object.defineProperty(ee,"validate",{enumerable:true,get:function $(){return ef.default}});Object.defineProperty(ee,"version",{enumerable:true,get:function $(){return el.default}});var en=eh(et(3990));var ei=eh(et(8237));var eo=eh(et(5355));var es=eh(et(3764));var eu=eh(et(6314));var el=eh(et(8464));var ef=eh(et(6435));var ed=eh(et(4008));var ep=eh(et(8222));function eh($){return $&&$.__esModule?$:{default:$}}},4163:($,ee)=>{"use strict";Object.defineProperty(ee,"__esModule",{value:true});ee["default"]=void 0;function et($){if(typeof $==="string"){const ee=unescape(encodeURIComponent($));$=new Uint8Array(ee.length);for(let et=0;et<ee.length;++et){$[et]=ee.charCodeAt(et)}}return en(eo(es($),$.length*8))}function en($){const ee=[];const et=$.length*32;const en="0123456789abcdef";for(let ei=0;ei<et;ei+=8){const et=$[ei>>5]>>>ei%32&255;const eo=parseInt(en.charAt(et>>>4&15)+en.charAt(et&15),16);ee.push(eo)}return ee}function ei($){return($+64>>>9<<4)+14+1}function eo($,ee){$[ee>>5]|=128<<ee%32;$[ei(ee)-1]=ee;let et=1732584193;let en=-271733879;let eo=-1732584194;let es=271733878;for(let ee=0;ee<$.length;ee+=16){const ei=et;const el=en;const ef=eo;const eg=es;et=ed(et,en,eo,es,$[ee],7,-680876936);es=ed(es,et,en,eo,$[ee+1],12,-389564586);eo=ed(eo,es,et,en,$[ee+2],17,606105819);en=ed(en,eo,es,et,$[ee+3],22,-1044525330);et=ed(et,en,eo,es,$[ee+4],7,-176418897);es=ed(es,et,en,eo,$[ee+5],12,1200080426);eo=ed(eo,es,et,en,$[ee+6],17,-1473231341);en=ed(en,eo,es,et,$[ee+7],22,-45705983);et=ed(et,en,eo,es,$[ee+8],7,1770035416);es=ed(es,et,en,eo,$[ee+9],12,-1958414417);eo=ed(eo,es,et,en,$[ee+10],17,-42063);en=ed(en,eo,es,et,$[ee+11],22,-1990404162);et=ed(et,en,eo,es,$[ee+12],7,1804603682);es=ed(es,et,en,eo,$[ee+13],12,-40341101);eo=ed(eo,es,et,en,$[ee+14],17,-1502002290);en=ed(en,eo,es,et,$[ee+15],22,1236535329);et=ep(et,en,eo,es,$[ee+1],5,-165796510);es=ep(es,et,en,eo,$[ee+6],9,-1069501632);eo=ep(eo,es,et,en,$[ee+11],14,643717713);en=ep(en,eo,es,et,$[ee],20,-373897302);et=ep(et,en,eo,es,$[ee+5],5,-701558691);es=ep(es,et,en,eo,$[ee+10],9,38016083);eo=ep(eo,es,et,en,$[ee+15],14,-660478335);en=ep(en,eo,es,et,$[ee+4],20,-405537848);et=ep(et,en,eo,es,$[ee+9],5,568446438);es=ep(es,et,en,eo,$[ee+14],9,-1019803690);eo=ep(eo,es,et,en,$[ee+3],14,-187363961);en=ep(en,eo,es,et,$[ee+8],20,1163531501);et=ep(et,en,eo,es,$[ee+13],5,-1444681467);es=ep(es,et,en,eo,$[ee+2],9,-51403784);eo=ep(eo,es,et,en,$[ee+7],14,1735328473);en=ep(en,eo,es,et,$[ee+12],20,-1926607734);et=eh(et,en,eo,es,$[ee+5],4,-378558);es=eh(es,et,en,eo,$[ee+8],11,-2022574463);eo=eh(eo,es,et,en,$[ee+11],16,1839030562);en=eh(en,eo,es,et,$[ee+14],23,-35309556);et=eh(et,en,eo,es,$[ee+1],4,-1530992060);es=eh(es,et,en,eo,$[ee+4],11,1272893353);eo=eh(eo,es,et,en,$[ee+7],16,-155497632);en=eh(en,eo,es,et,$[ee+10],23,-1094730640);et=eh(et,en,eo,es,$[ee+13],4,681279174);es=eh(es,et,en,eo,$[ee],11,-358537222);eo=eh(eo,es,et,en,$[ee+3],16,-722521979);en=eh(en,eo,es,et,$[ee+6],23,76029189);et=eh(et,en,eo,es,$[ee+9],4,-640364487);es=eh(es,et,en,eo,$[ee+12],11,-421815835);eo=eh(eo,es,et,en,$[ee+15],16,530742520);en=eh(en,eo,es,et,$[ee+2],23,-995338651);et=ey(et,en,eo,es,$[ee],6,-198630844);es=ey(es,et,en,eo,$[ee+7],10,1126891415);eo=ey(eo,es,et,en,$[ee+14],15,-1416354905);en=ey(en,eo,es,et,$[ee+5],21,-57434055);et=ey(et,en,eo,es,$[ee+12],6,1700485571);es=ey(es,et,en,eo,$[ee+3],10,-1894986606);eo=ey(eo,es,et,en,$[ee+10],15,-1051523);en=ey(en,eo,es,et,$[ee+1],21,-2054922799);et=ey(et,en,eo,es,$[ee+8],6,1873313359);es=ey(es,et,en,eo,$[ee+15],10,-30611744);eo=ey(eo,es,et,en,$[ee+6],15,-1560198380);en=ey(en,eo,es,et,$[ee+13],21,1309151649);et=ey(et,en,eo,es,$[ee+4],6,-145523070);es=ey(es,et,en,eo,$[ee+11],10,-1120210379);eo=ey(eo,es,et,en,$[ee+2],15,718787259);en=ey(en,eo,es,et,$[ee+9],21,-343485551);et=eu(et,ei);en=eu(en,el);eo=eu(eo,ef);es=eu(es,eg)}return[et,en,eo,es]}function es($){if($.length===0){return[]}const ee=$.length*8;const et=new Uint32Array(ei(ee));for(let en=0;en<ee;en+=8){et[en>>5]|=($[en/8]&255)<<en%32}return et}function eu($,ee){const et=($&65535)+(ee&65535);const en=($>>16)+(ee>>16)+(et>>16);return en<<16|et&65535}function el($,ee){return $<<ee|$>>>32-ee}function ef($,ee,et,en,ei,eo){return eu(el(eu(eu(ee,$),eu(en,eo)),ei),et)}function ed($,ee,et,en,ei,eo,es){return ef(ee&et|~ee&en,$,ee,ei,eo,es)}function ep($,ee,et,en,ei,eo,es){return ef(ee&en|et&~en,$,ee,ei,eo,es)}function eh($,ee,et,en,ei,eo,es){return ef(ee^et^en,$,ee,ei,eo,es)}function ey($,ee,et,en,ei,eo,es){return ef(et^(ee|~en),$,ee,ei,eo,es)}var eg=et;ee["default"]=eg},4790:($,ee)=>{"use strict";Object.defineProperty(ee,"__esModule",{value:true});ee["default"]=void 0;const et=typeof crypto!=="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);var en={randomUUID:et};ee["default"]=en},6314:($,ee)=>{"use strict";Object.defineProperty(ee,"__esModule",{value:true});ee["default"]=void 0;var et="00000000-0000-0000-0000-000000000000";ee["default"]=et},8222:($,ee,et)=>{"use strict";Object.defineProperty(ee,"__esModule",{value:true});ee["default"]=void 0;var en=ei(et(6435));function ei($){return $&&$.__esModule?$:{default:$}}function eo($){if(!(0,en.default)($)){throw TypeError("Invalid UUID")}let ee;const et=new Uint8Array(16);et[0]=(ee=parseInt($.slice(0,8),16))>>>24;et[1]=ee>>>16&255;et[2]=ee>>>8&255;et[3]=ee&255;et[4]=(ee=parseInt($.slice(9,13),16))>>>8;et[5]=ee&255;et[6]=(ee=parseInt($.slice(14,18),16))>>>8;et[7]=ee&255;et[8]=(ee=parseInt($.slice(19,23),16))>>>8;et[9]=ee&255;et[10]=(ee=parseInt($.slice(24,36),16))/1099511627776&255;et[11]=ee/4294967296&255;et[12]=ee>>>24&255;et[13]=ee>>>16&255;et[14]=ee>>>8&255;et[15]=ee&255;return et}var es=eo;ee["default"]=es},58:($,ee)=>{"use strict";Object.defineProperty(ee,"__esModule",{value:true});ee["default"]=void 0;var et=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;ee["default"]=et},3319:($,ee)=>{"use strict";Object.defineProperty(ee,"__esModule",{value:true});ee["default"]=ei;let et;const en=new Uint8Array(16);function ei(){if(!et){et=typeof crypto!=="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto);if(!et){throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported")}}return et(en)}},3757:($,ee)=>{"use strict";Object.defineProperty(ee,"__esModule",{value:true});ee["default"]=void 0;function et($,ee,et,en){switch($){case 0:return ee&et^~ee&en;case 1:return ee^et^en;case 2:return ee&et^ee&en^et&en;case 3:return ee^et^en}}function en($,ee){return $<<ee|$>>>32-ee}function ei($){const ee=[1518500249,1859775393,2400959708,3395469782];const ei=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof $==="string"){const ee=unescape(encodeURIComponent($));$=[];for(let et=0;et<ee.length;++et){$.push(ee.charCodeAt(et))}}else if(!Array.isArray($)){$=Array.prototype.slice.call($)}$.push(128);const eo=$.length/4+2;const es=Math.ceil(eo/16);const eu=new Array(es);for(let ee=0;ee<es;++ee){const et=new Uint32Array(16);for(let en=0;en<16;++en){et[en]=$[ee*64+en*4]<<24|$[ee*64+en*4+1]<<16|$[ee*64+en*4+2]<<8|$[ee*64+en*4+3]}eu[ee]=et}eu[es-1][14]=($.length-1)*8/Math.pow(2,32);eu[es-1][14]=Math.floor(eu[es-1][14]);eu[es-1][15]=($.length-1)*8&4294967295;for(let $=0;$<es;++$){const eo=new Uint32Array(80);for(let ee=0;ee<16;++ee){eo[ee]=eu[$][ee]}for(let $=16;$<80;++$){eo[$]=en(eo[$-3]^eo[$-8]^eo[$-14]^eo[$-16],1)}let es=ei[0];let el=ei[1];let ef=ei[2];let ed=ei[3];let ep=ei[4];for(let $=0;$<80;++$){const ei=Math.floor($/20);const eu=en(es,5)+et(ei,el,ef,ed)+ep+ee[ei]+eo[$]>>>0;ep=ed;ed=ef;ef=en(el,30)>>>0;el=es;es=eu}ei[0]=ei[0]+es>>>0;ei[1]=ei[1]+el>>>0;ei[2]=ei[2]+ef>>>0;ei[3]=ei[3]+ed>>>0;ei[4]=ei[4]+ep>>>0}return[ei[0]>>24&255,ei[0]>>16&255,ei[0]>>8&255,ei[0]&255,ei[1]>>24&255,ei[1]>>16&255,ei[1]>>8&255,ei[1]&255,ei[2]>>24&255,ei[2]>>16&255,ei[2]>>8&255,ei[2]&255,ei[3]>>24&255,ei[3]>>16&255,ei[3]>>8&255,ei[3]&255,ei[4]>>24&255,ei[4]>>16&255,ei[4]>>8&255,ei[4]&255]}var eo=ei;ee["default"]=eo},4008:($,ee,et)=>{"use strict";Object.defineProperty(ee,"__esModule",{value:true});ee["default"]=void 0;ee.unsafeStringify=es;var en=ei(et(6435));function ei($){return $&&$.__esModule?$:{default:$}}const eo=[];for(let $=0;$<256;++$){eo.push(($+256).toString(16).slice(1))}function es($,ee=0){return(eo[$[ee+0]]+eo[$[ee+1]]+eo[$[ee+2]]+eo[$[ee+3]]+"-"+eo[$[ee+4]]+eo[$[ee+5]]+"-"+eo[$[ee+6]]+eo[$[ee+7]]+"-"+eo[$[ee+8]]+eo[$[ee+9]]+"-"+eo[$[ee+10]]+eo[$[ee+11]]+eo[$[ee+12]]+eo[$[ee+13]]+eo[$[ee+14]]+eo[$[ee+15]]).toLowerCase()}function eu($,ee=0){const et=es($,ee);if(!(0,en.default)(et)){throw TypeError("Stringified UUID is invalid")}return et}var el=eu;ee["default"]=el},3990:($,ee,et)=>{"use strict";Object.defineProperty(ee,"__esModule",{value:true});ee["default"]=void 0;var en=eo(et(3319));var ei=et(4008);function eo($){return $&&$.__esModule?$:{default:$}}let es;let eu;let el=0;let ef=0;function ed($,ee,et){let eo=ee&&et||0;const ed=ee||new Array(16);$=$||{};let ep=$.node||es;let eh=$.clockseq!==undefined?$.clockseq:eu;if(ep==null||eh==null){const ee=$.random||($.rng||en.default)();if(ep==null){ep=es=[ee[0]|1,ee[1],ee[2],ee[3],ee[4],ee[5]]}if(eh==null){eh=eu=(ee[6]<<8|ee[7])&16383}}let ey=$.msecs!==undefined?$.msecs:Date.now();let eg=$.nsecs!==undefined?$.nsecs:ef+1;const em=ey-el+(eg-ef)/1e4;if(em<0&&$.clockseq===undefined){eh=eh+1&16383}if((em<0||ey>el)&&$.nsecs===undefined){eg=0}if(eg>=1e4){throw new Error("uuid.v1(): Can't create more than 10M uuids/sec")}el=ey;ef=eg;eu=eh;ey+=122192928e5;const e_=((ey&268435455)*1e4+eg)%4294967296;ed[eo++]=e_>>>24&255;ed[eo++]=e_>>>16&255;ed[eo++]=e_>>>8&255;ed[eo++]=e_&255;const ew=ey/4294967296*1e4&268435455;ed[eo++]=ew>>>8&255;ed[eo++]=ew&255;ed[eo++]=ew>>>24&15|16;ed[eo++]=ew>>>16&255;ed[eo++]=eh>>>8|128;ed[eo++]=eh&255;for(let $=0;$<6;++$){ed[eo+$]=ep[$]}return ee||(0,ei.unsafeStringify)(ed)}var ep=ed;ee["default"]=ep},8237:($,ee,et)=>{"use strict";Object.defineProperty(ee,"__esModule",{value:true});ee["default"]=void 0;var en=eo(et(7925));var ei=eo(et(4163));function eo($){return $&&$.__esModule?$:{default:$}}const es=(0,en.default)("v3",48,ei.default);var eu=es;ee["default"]=eu},7925:($,ee,et)=>{"use strict";Object.defineProperty(ee,"__esModule",{value:true});ee.URL=ee.DNS=void 0;ee["default"]=ef;var en=et(4008);var ei=eo(et(8222));function eo($){return $&&$.__esModule?$:{default:$}}function es($){$=unescape(encodeURIComponent($));const ee=[];for(let et=0;et<$.length;++et){ee.push($.charCodeAt(et))}return ee}const eu="6ba7b810-9dad-11d1-80b4-00c04fd430c8";ee.DNS=eu;const el="6ba7b811-9dad-11d1-80b4-00c04fd430c8";ee.URL=el;function ef($,ee,et){function eo($,eo,eu,el){var ef;if(typeof $==="string"){$=es($)}if(typeof eo==="string"){eo=(0,ei.default)(eo)}if(((ef=eo)===null||ef===void 0?void 0:ef.length)!==16){throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)")}let ed=new Uint8Array(16+$.length);ed.set(eo);ed.set($,eo.length);ed=et(ed);ed[6]=ed[6]&15|ee;ed[8]=ed[8]&63|128;if(eu){el=el||0;for(let $=0;$<16;++$){eu[el+$]=ed[$]}return eu}return(0,en.unsafeStringify)(ed)}try{eo.name=$}catch($){}eo.DNS=eu;eo.URL=el;return eo}},5355:($,ee,et)=>{"use strict";Object.defineProperty(ee,"__esModule",{value:true});ee["default"]=void 0;var en=es(et(4790));var ei=es(et(3319));var eo=et(4008);function es($){return $&&$.__esModule?$:{default:$}}function eu($,ee,et){if(en.default.randomUUID&&!ee&&!$){return en.default.randomUUID()}$=$||{};const es=$.random||($.rng||ei.default)();es[6]=es[6]&15|64;es[8]=es[8]&63|128;if(ee){et=et||0;for(let $=0;$<16;++$){ee[et+$]=es[$]}return ee}return(0,eo.unsafeStringify)(es)}var el=eu;ee["default"]=el},3764:($,ee,et)=>{"use strict";Object.defineProperty(ee,"__esModule",{value:true});ee["default"]=void 0;var en=eo(et(7925));var ei=eo(et(3757));function eo($){return $&&$.__esModule?$:{default:$}}const es=(0,en.default)("v5",80,ei.default);var eu=es;ee["default"]=eu},6435:($,ee,et)=>{"use strict";Object.defineProperty(ee,"__esModule",{value:true});ee["default"]=void 0;var en=ei(et(58));function ei($){return $&&$.__esModule?$:{default:$}}function eo($){return typeof $==="string"&&en.default.test($)}var es=eo;ee["default"]=es},8464:($,ee,et)=>{"use strict";Object.defineProperty(ee,"__esModule",{value:true});ee["default"]=void 0;var en=ei(et(6435));function ei($){return $&&$.__esModule?$:{default:$}}function eo($){if(!(0,en.default)($)){throw TypeError("Invalid UUID")}return parseInt($.slice(14,15),16)}var es=eo;ee["default"]=es},3679:($,ee,et)=>{"use strict";var en=et(9981);var ei=et(4578);var eo=et(6814);var es=et(2636);var eu=et(3376);$.exports=function $($){if($==null||typeof $!=="object"&&typeof $!=="function"){return null}if(en($)){return"String"}if(ei($)){return"Number"}if(eo($)){return"Boolean"}if(es($)){return"Symbol"}if(eu($)){return"BigInt"}}},6430:($,ee,et)=>{"use strict";var en=et(4029);var ei=et(3083);var eo=et(5559);var es=et(1924);var eu=et(7296);var el=es("Object.prototype.toString");var ef=et(6410)();var ed=typeof globalThis==="undefined"?et.g:globalThis;var ep=ei();var eh=es("String.prototype.slice");var ey=Object.getPrototypeOf;var eg=es("Array.prototype.indexOf",true)||function $($,ee){for(var et=0;et<$.length;et+=1){if($[et]===ee){return et}}return-1};var em={__proto__:null};if(ef&&eu&&ey){en(ep,function($){var ee=new ed[$];if(Symbol.toStringTag in ee){var et=ey(ee);var en=eu(et,Symbol.toStringTag);if(!en){var ei=ey(et);en=eu(ei,Symbol.toStringTag)}em["$"+$]=eo(en.get)}})}else{en(ep,function($){var ee=new ed[$];em["$"+$]=eo(ee.slice)})}var e_=function $($){var ee=false;en(em,function(et,en){if(!ee){try{if("$"+et($)===en){ee=eh(en,1)}}catch($){}}});return ee};var ew=function $($){var ee=false;en(em,function(et,en){if(!ee){try{et($);ee=eh(en,1)}catch($){}}});return ee};$.exports=function $($){if(!$||typeof $!=="object"){return false}if(!ef){var ee=eh(el($),8,-1);if(eg(ep,ee)>-1){return ee}if(ee!=="Object"){return false}return ew($)}if(!eu){return null}return e_($)}},306:function($,ee){(function(){"use strict";ee.stripBOM=function($){if($[0]==="\uFEFF"){return $.substring(1)}else{return $}}}).call(this)},4096:function($,ee,et){(function(){"use strict";var $,en,ei,eo,es,eu={}.hasOwnProperty;$=et(9374);en=et(8381).defaults;eo=function($){return typeof $==="string"&&($.indexOf("&")>=0||$.indexOf(">")>=0||$.indexOf("<")>=0)};es=function($){return"<![CDATA["+ei($)+"]]>"};ei=function($){return $.replace("]]>","]]]]><![CDATA[>")};ee.Builder=function(){function ee($){var ee,et,ei;this.options={};et=en["0.2"];for(ee in et){if(!eu.call(et,ee))continue;ei=et[ee];this.options[ee]=ei}for(ee in $){if(!eu.call($,ee))continue;ei=$[ee];this.options[ee]=ei}}ee.prototype.buildObject=function(ee){var et,ei,el,ef,ed;et=this.options.attrkey;ei=this.options.charkey;if(Object.keys(ee).length===1&&this.options.rootName===en["0.2"].rootName){ed=Object.keys(ee)[0];ee=ee[ed]}else{ed=this.options.rootName}el=function($){return function(ee,en){var ef,ed,ep,eh,ey,eg;if(typeof en!=="object"){if($.options.cdata&&eo(en)){ee.raw(es(en))}else{ee.txt(en)}}else if(Array.isArray(en)){for(eh in en){if(!eu.call(en,eh))continue;ed=en[eh];for(ey in ed){ep=ed[ey];ee=el(ee.ele(ey),ep).up()}}}else{for(ey in en){if(!eu.call(en,ey))continue;ed=en[ey];if(ey===et){if(typeof ed==="object"){for(ef in ed){eg=ed[ef];ee=ee.att(ef,eg)}}}else if(ey===ei){if($.options.cdata&&eo(ed)){ee=ee.raw(es(ed))}else{ee=ee.txt(ed)}}else if(Array.isArray(ed)){for(eh in ed){if(!eu.call(ed,eh))continue;ep=ed[eh];if(typeof ep==="string"){if($.options.cdata&&eo(ep)){ee=ee.ele(ey).raw(es(ep)).up()}else{ee=ee.ele(ey,ep).up()}}else{ee=el(ee.ele(ey),ep).up()}}}else if(typeof ed==="object"){ee=el(ee.ele(ey),ed).up()}else{if(typeof ed==="string"&&$.options.cdata&&eo(ed)){ee=ee.ele(ey).raw(es(ed)).up()}else{if(ed==null){ed=""}ee=ee.ele(ey,ed.toString()).up()}}}}return ee}}(this);ef=$.create(ed,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars});return el(ef,ee).end(this.options.renderOpts)};return ee}()}).call(this)},8381:function($,ee){(function(){ee.defaults={"0.1":{explicitCharkey:false,trim:true,normalize:true,normalizeTags:false,attrkey:"@",charkey:"#",explicitArray:false,ignoreAttrs:false,mergeAttrs:false,explicitRoot:false,validator:null,xmlns:false,explicitChildren:false,childkey:"@@",charsAsChildren:false,includeWhiteChars:false,async:false,strict:true,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},"0.2":{explicitCharkey:false,trim:false,normalize:false,normalizeTags:false,attrkey:"$",charkey:"_",explicitArray:true,ignoreAttrs:false,mergeAttrs:false,explicitRoot:true,validator:null,xmlns:false,explicitChildren:false,preserveChildrenOrder:false,childkey:"$$",charsAsChildren:false,includeWhiteChars:false,async:false,strict:true,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{"version":"1.0","encoding":"UTF-8","standalone":true},doctype:null,renderOpts:{"pretty":true,"indent":" ","newline":"\n"},headless:false,chunkSize:1e4,emptyTag:"",cdata:false}}}).call(this)},9082:function($,ee,et){(function(){"use strict";var $,en,ei,eo,es,eu,el,ef,ed,ep=function($,ee){return function(){return $.apply(ee,arguments)}},eh=function($,ee){for(var et in ee){if(ey.call(ee,et))$[et]=ee[et]}function en(){this.constructor=$}en.prototype=ee.prototype;$.prototype=new en;$.__super__=ee.prototype;return $},ey={}.hasOwnProperty;ef=et(6099);eo=et(7187);$=et(306);el=et(7526);ed=et(8441).setImmediate;en=et(8381).defaults;es=function($){return typeof $==="object"&&$!=null&&Object.keys($).length===0};eu=function($,ee,et){var en,ei,eo;for(en=0,ei=$.length;en<ei;en++){eo=$[en];ee=eo(ee,et)}return ee};ei=function($,ee,et){var en;en=Object.create(null);en.value=et;en.writable=true;en.enumerable=true;en.configurable=true;return Object.defineProperty($,ee,en)};ee.Parser=function(et){eh(eo,et);function eo($){this.parseStringPromise=ep(this.parseStringPromise,this);this.parseString=ep(this.parseString,this);this.reset=ep(this.reset,this);this.assignOrPush=ep(this.assignOrPush,this);this.processAsync=ep(this.processAsync,this);var et,ei,eo;if(!(this instanceof ee.Parser)){return new ee.Parser($)}this.options={};ei=en["0.2"];for(et in ei){if(!ey.call(ei,et))continue;eo=ei[et];this.options[et]=eo}for(et in $){if(!ey.call($,et))continue;eo=$[et];this.options[et]=eo}if(this.options.xmlns){this.options.xmlnskey=this.options.attrkey+"ns"}if(this.options.normalizeTags){if(!this.options.tagNameProcessors){this.options.tagNameProcessors=[]}this.options.tagNameProcessors.unshift(el.normalize)}this.reset()}eo.prototype.processAsync=function(){var $,ee;try{if(this.remaining.length<=this.options.chunkSize){$=this.remaining;this.remaining="";this.saxParser=this.saxParser.write($);return this.saxParser.close()}else{$=this.remaining.substr(0,this.options.chunkSize);this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length);this.saxParser=this.saxParser.write($);return ed(this.processAsync)}}catch($){ee=$;if(!this.saxParser.errThrown){this.saxParser.errThrown=true;return this.emit(ee)}}};eo.prototype.assignOrPush=function($,ee,et){if(!(ee in $)){if(!this.options.explicitArray){return ei($,ee,et)}else{return ei($,ee,[et])}}else{if(!($[ee]instanceof Array)){ei($,ee,[$[ee]])}return $[ee].push(et)}};eo.prototype.reset=function(){var $,ee,et,en;this.removeAllListeners();this.saxParser=ef.parser(this.options.strict,{trim:false,normalize:false,xmlns:this.options.xmlns});this.saxParser.errThrown=false;this.saxParser.onerror=function($){return function(ee){$.saxParser.resume();if(!$.saxParser.errThrown){$.saxParser.errThrown=true;return $.emit("error",ee)}}}(this);this.saxParser.onend=function($){return function(){if(!$.saxParser.ended){$.saxParser.ended=true;return $.emit("end",$.resultObject)}}}(this);this.saxParser.ended=false;this.EXPLICIT_CHARKEY=this.options.explicitCharkey;this.resultObject=null;en=[];$=this.options.attrkey;ee=this.options.charkey;this.saxParser.onopentag=function(et){return function(eo){var es,el,ef,ed,ep;ef={};ef[ee]="";if(!et.options.ignoreAttrs){ep=eo.attributes;for(es in ep){if(!ey.call(ep,es))continue;if(!($ in ef)&&!et.options.mergeAttrs){ef[$]={}}el=et.options.attrValueProcessors?eu(et.options.attrValueProcessors,eo.attributes[es],es):eo.attributes[es];ed=et.options.attrNameProcessors?eu(et.options.attrNameProcessors,es):es;if(et.options.mergeAttrs){et.assignOrPush(ef,ed,el)}else{ei(ef[$],ed,el)}}}ef["#name"]=et.options.tagNameProcessors?eu(et.options.tagNameProcessors,eo.name):eo.name;if(et.options.xmlns){ef[et.options.xmlnskey]={uri:eo.uri,local:eo.local}}return en.push(ef)}}(this);this.saxParser.onclosetag=function($){return function(){var et,eo,el,ef,ed,ep,eh,eg,em,e_;ep=en.pop();ed=ep["#name"];if(!$.options.explicitChildren||!$.options.preserveChildrenOrder){delete ep["#name"]}if(ep.cdata===true){et=ep.cdata;delete ep.cdata}em=en[en.length-1];if(ep[ee].match(/^\s*$/)&&!et){eo=ep[ee];delete ep[ee]}else{if($.options.trim){ep[ee]=ep[ee].trim()}if($.options.normalize){ep[ee]=ep[ee].replace(/\s{2,}/g," ").trim()}ep[ee]=$.options.valueProcessors?eu($.options.valueProcessors,ep[ee],ed):ep[ee];if(Object.keys(ep).length===1&&ee in ep&&!$.EXPLICIT_CHARKEY){ep=ep[ee]}}if(es(ep)){if(typeof $.options.emptyTag==="function"){ep=$.options.emptyTag()}else{ep=$.options.emptyTag!==""?$.options.emptyTag:eo}}if($.options.validator!=null){e_="/"+(function(){var $,ee,et;et=[];for($=0,ee=en.length;$<ee;$++){ef=en[$];et.push(ef["#name"])}return et})().concat(ed).join("/");(function(){var ee;try{return ep=$.options.validator(e_,em&&em[ed],ep)}catch(et){ee=et;return $.emit("error",ee)}})()}if($.options.explicitChildren&&!$.options.mergeAttrs&&typeof ep==="object"){if(!$.options.preserveChildrenOrder){ef={};if($.options.attrkey in ep){ef[$.options.attrkey]=ep[$.options.attrkey];delete ep[$.options.attrkey]}if(!$.options.charsAsChildren&&$.options.charkey in ep){ef[$.options.charkey]=ep[$.options.charkey];delete ep[$.options.charkey]}if(Object.getOwnPropertyNames(ep).length>0){ef[$.options.childkey]=ep}ep=ef}else if(em){em[$.options.childkey]=em[$.options.childkey]||[];eh={};for(el in ep){if(!ey.call(ep,el))continue;ei(eh,el,ep[el])}em[$.options.childkey].push(eh);delete ep["#name"];if(Object.keys(ep).length===1&&ee in ep&&!$.EXPLICIT_CHARKEY){ep=ep[ee]}}}if(en.length>0){return $.assignOrPush(em,ed,ep)}else{if($.options.explicitRoot){eg=ep;ep={};ei(ep,ed,eg)}$.resultObject=ep;$.saxParser.ended=true;return $.emit("end",$.resultObject)}}}(this);et=function($){return function(et){var ei,eo;eo=en[en.length-1];if(eo){eo[ee]+=et;if($.options.explicitChildren&&$.options.preserveChildrenOrder&&$.options.charsAsChildren&&($.options.includeWhiteChars||et.replace(/\\n/g,"").trim()!=="")){eo[$.options.childkey]=eo[$.options.childkey]||[];ei={"#name":"__text__"};ei[ee]=et;if($.options.normalize){ei[ee]=ei[ee].replace(/\s{2,}/g," ").trim()}eo[$.options.childkey].push(ei)}return eo}}}(this);this.saxParser.ontext=et;return this.saxParser.oncdata=function($){return function($){var ee;ee=et($);if(ee){return ee.cdata=true}}}(this)};eo.prototype.parseString=function(ee,et){var en;if(et!=null&&typeof et==="function"){this.on("end",function($){this.reset();return et(null,$)});this.on("error",function($){this.reset();return et($)})}try{ee=ee.toString();if(ee.trim()===""){this.emit("end",null);return true}ee=$.stripBOM(ee);if(this.options.async){this.remaining=ee;ed(this.processAsync);return this.saxParser}return this.saxParser.write(ee).close()}catch($){en=$;if(!(this.saxParser.errThrown||this.saxParser.ended)){this.emit("error",en);return this.saxParser.errThrown=true}else if(this.saxParser.ended){throw en}}};eo.prototype.parseStringPromise=function($){return new Promise(function(ee){return function(et,en){return ee.parseString($,function($,ee){if($){return en($)}else{return et(ee)}})}}(this))};return eo}(eo);ee.parseString=function($,et,en){var ei,eo,es;if(en!=null){if(typeof en==="function"){ei=en}if(typeof et==="object"){eo=et}}else{if(typeof et==="function"){ei=et}eo={}}es=new ee.Parser(eo);return es.parseString($,ei)};ee.parseStringPromise=function($,et){var en,ei;if(typeof et==="object"){en=et}ei=new ee.Parser(en);return ei.parseStringPromise($)}}).call(this)},7526:function($,ee){(function(){"use strict";var $;$=new RegExp(/(?!xmlns)^.*:/);ee.normalize=function($){return $.toLowerCase()};ee.firstCharLowerCase=function($){return $.charAt(0).toLowerCase()+$.slice(1)};ee.stripPrefix=function(ee){return ee.replace($,"")};ee.parseNumbers=function($){if(!isNaN($)){$=$%1===0?parseInt($,10):parseFloat($)}return $};ee.parseBooleans=function($){if(/^(?:true|false)$/i.test($)){$=$.toLowerCase()==="true"}return $}}).call(this)},5055:function($,ee,et){(function(){"use strict";var $,en,ei,eo,es=function($,ee){for(var et in ee){if(eu.call(ee,et))$[et]=ee[et]}function en(){this.constructor=$}en.prototype=ee.prototype;$.prototype=new en;$.__super__=ee.prototype;return $},eu={}.hasOwnProperty;en=et(8381);$=et(4096);ei=et(9082);eo=et(7526);ee.defaults=en.defaults;ee.processors=eo;ee.ValidationError=function($){es(ee,$);function ee($){this.message=$}return ee}(Error);ee.Builder=$.Builder;ee.Parser=ei.Parser;ee.parseString=ei.parseString;ee.parseStringPromise=ei.parseStringPromise}).call(this)},8154:function($){(function(){$.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(this)},8745:function($){(function(){$.exports={Element:1,Attribute:2,Text:3,CData:4,EntityReference:5,EntityDeclaration:6,ProcessingInstruction:7,Comment:8,Document:9,DocType:10,DocumentFragment:11,NotationDeclaration:12,Declaration:201,Raw:202,AttributeDeclaration:203,ElementDeclaration:204,Dummy:205}}).call(this)},8676:function($){(function(){var ee,et,en,ei,eo,es,eu,el=[].slice,ef={}.hasOwnProperty;ee=function(){var $,ee,et,en,ei,es;es=arguments[0],ei=2<=arguments.length?el.call(arguments,1):[];if(eo(Object.assign)){Object.assign.apply(null,arguments)}else{for($=0,et=ei.length;$<et;$++){en=ei[$];if(en!=null){for(ee in en){if(!ef.call(en,ee))continue;es[ee]=en[ee]}}}}return es};eo=function($){return!!$&&Object.prototype.toString.call($)==="[object Function]"};es=function($){var ee;return!!$&&((ee=typeof $)==="function"||ee==="object")};en=function($){if(eo(Array.isArray)){return Array.isArray($)}else{return Object.prototype.toString.call($)==="[object Array]"}};ei=function($){var ee;if(en($)){return!$.length}else{for(ee in $){if(!ef.call($,ee))continue;return false}return true}};eu=function($){var ee,et;return es($)&&(et=Object.getPrototypeOf($))&&(ee=et.constructor)&&typeof ee==="function"&&ee instanceof ee&&Function.prototype.toString.call(ee)===Function.prototype.toString.call(Object)};et=function($){if(eo($.valueOf)){return $.valueOf()}else{return $}};$.exports.assign=ee;$.exports.isFunction=eo;$.exports.isObject=es;$.exports.isArray=en;$.exports.isEmpty=ei;$.exports.isPlainObject=eu;$.exports.getValue=et}).call(this)},6530:function($){(function(){$.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(this)},7490:function($,ee,et){(function(){var ee,en,ei;ee=et(8745);ei=et(630);$.exports=en=function(){function $($,et,en){this.parent=$;if(this.parent){this.options=this.parent.options;this.stringify=this.parent.stringify}if(et==null){throw new Error("Missing attribute name. "+this.debugInfo(et))}this.name=this.stringify.name(et);this.value=this.stringify.attValue(en);this.type=ee.Attribute;this.isId=false;this.schemaTypeInfo=null}Object.defineProperty($.prototype,"nodeType",{get:function(){return this.type}});Object.defineProperty($.prototype,"ownerElement",{get:function(){return this.parent}});Object.defineProperty($.prototype,"textContent",{get:function(){return this.value},set:function($){return this.value=$||""}});Object.defineProperty($.prototype,"namespaceURI",{get:function(){return""}});Object.defineProperty($.prototype,"prefix",{get:function(){return""}});Object.defineProperty($.prototype,"localName",{get:function(){return this.name}});Object.defineProperty($.prototype,"specified",{get:function(){return true}});$.prototype.clone=function(){return Object.create(this)};$.prototype.toString=function($){return this.options.writer.attribute(this,this.options.writer.filterOptions($))};$.prototype.debugInfo=function($){$=$||this.name;if($==null){return"parent: <"+this.parent.name+">"}else{return"attribute: {"+$+"}, parent: <"+this.parent.name+">"}};$.prototype.isEqualNode=function($){if($.namespaceURI!==this.namespaceURI){return false}if($.prefix!==this.prefix){return false}if($.localName!==this.localName){return false}if($.value!==this.value){return false}return true};return $}()}).call(this)},9877:function($,ee,et){(function(){var ee,en,ei,eo=function($,ee){for(var et in ee){if(es.call(ee,et))$[et]=ee[et]}function en(){this.constructor=$}en.prototype=ee.prototype;$.prototype=new en;$.__super__=ee.prototype;return $},es={}.hasOwnProperty;ee=et(8745);ei=et(4356);$.exports=en=function($){eo(et,$);function et($,en){et.__super__.constructor.call(this,$);if(en==null){throw new Error("Missing CDATA text. "+this.debugInfo())}this.name="#cdata-section";this.type=ee.CData;this.value=this.stringify.cdata(en)}et.prototype.clone=function(){return Object.create(this)};et.prototype.toString=function($){return this.options.writer.cdata(this,this.options.writer.filterOptions($))};return et}(ei)}).call(this)},4356:function($,ee,et){(function(){var ee,en,ei=function($,ee){for(var et in ee){if(eo.call(ee,et))$[et]=ee[et]}function en(){this.constructor=$}en.prototype=ee.prototype;$.prototype=new en;$.__super__=ee.prototype;return $},eo={}.hasOwnProperty;en=et(630);$.exports=ee=function($){ei(ee,$);function ee($){ee.__super__.constructor.call(this,$);this.value=""}Object.defineProperty(ee.prototype,"data",{get:function(){return this.value},set:function($){return this.value=$||""}});Object.defineProperty(ee.prototype,"length",{get:function(){return this.value.length}});Object.defineProperty(ee.prototype,"textContent",{get:function(){return this.value},set:function($){return this.value=$||""}});ee.prototype.clone=function(){return Object.create(this)};ee.prototype.substringData=function($,ee){throw new Error("This DOM method is not implemented."+this.debugInfo())};ee.prototype.appendData=function($){throw new Error("This DOM method is not implemented."+this.debugInfo())};ee.prototype.insertData=function($,ee){throw new Error("This DOM method is not implemented."+this.debugInfo())};ee.prototype.deleteData=function($,ee){throw new Error("This DOM method is not implemented."+this.debugInfo())};ee.prototype.replaceData=function($,ee,et){throw new Error("This DOM method is not implemented."+this.debugInfo())};ee.prototype.isEqualNode=function($){if(!ee.__super__.isEqualNode.apply(this,arguments).isEqualNode($)){return false}if($.data!==this.data){return false}return true};return ee}(en)}).call(this)},2374:function($,ee,et){(function(){var ee,en,ei,eo=function($,ee){for(var et in ee){if(es.call(ee,et))$[et]=ee[et]}function en(){this.constructor=$}en.prototype=ee.prototype;$.prototype=new en;$.__super__=ee.prototype;return $},es={}.hasOwnProperty;ee=et(8745);en=et(4356);$.exports=ei=function($){eo(et,$);function et($,en){et.__super__.constructor.call(this,$);if(en==null){throw new Error("Missing comment text. "+this.debugInfo())}this.name="#comment";this.type=ee.Comment;this.value=this.stringify.comment(en)}et.prototype.clone=function(){return Object.create(this)};et.prototype.toString=function($){return this.options.writer.comment(this,this.options.writer.filterOptions($))};return et}(en)}).call(this)},1829:function($,ee,et){(function(){var ee,en,ei;en=et(7885);ei=et(4929);$.exports=ee=function(){function $(){var $;this.defaultParams={"canonical-form":false,"cdata-sections":false,"comments":false,"datatype-normalization":false,"element-content-whitespace":true,"entities":true,"error-handler":new en,"infoset":true,"validate-if-schema":false,"namespaces":true,"namespace-declarations":true,"normalize-characters":false,"schema-location":"","schema-type":"","split-cdata-sections":true,"validate":false,"well-formed":true};this.params=$=Object.create(this.defaultParams)}Object.defineProperty($.prototype,"parameterNames",{get:function(){return new ei(Object.keys(this.defaultParams))}});$.prototype.getParameter=function($){if(this.params.hasOwnProperty($)){return this.params[$]}else{return null}};$.prototype.canSetParameter=function($,ee){return true};$.prototype.setParameter=function($,ee){if(ee!=null){return this.params[$]=ee}else{return delete this.params[$]}};return $}()}).call(this)},7885:function($){(function(){var ee;$.exports=ee=function(){function $(){}$.prototype.handleError=function($){throw new Error($)};return $}()}).call(this)},4016:function($){(function(){var ee;$.exports=ee=function(){function $(){}$.prototype.hasFeature=function($,ee){return true};$.prototype.createDocumentType=function($,ee,et){throw new Error("This DOM method is not implemented.")};$.prototype.createDocument=function($,ee,et){throw new Error("This DOM method is not implemented.")};$.prototype.createHTMLDocument=function($){throw new Error("This DOM method is not implemented.")};$.prototype.getFeature=function($,ee){throw new Error("This DOM method is not implemented.")};return $}()}).call(this)},4929:function($){(function(){var ee;$.exports=ee=function(){function $($){this.arr=$||[]}Object.defineProperty($.prototype,"length",{get:function(){return this.arr.length}});$.prototype.item=function($){return this.arr[$]||null};$.prototype.contains=function($){return this.arr.indexOf($)!==-1};return $}()}).call(this)},4131:function($,ee,et){(function(){var ee,en,ei,eo=function($,ee){for(var et in ee){if(es.call(ee,et))$[et]=ee[et]}function en(){this.constructor=$}en.prototype=ee.prototype;$.prototype=new en;$.__super__=ee.prototype;return $},es={}.hasOwnProperty;ei=et(630);ee=et(8745);$.exports=en=function($){eo(et,$);function et($,en,ei,eo,es,eu){et.__super__.constructor.call(this,$);if(en==null){throw new Error("Missing DTD element name. "+this.debugInfo())}if(ei==null){throw new Error("Missing DTD attribute name. "+this.debugInfo(en))}if(!eo){throw new Error("Missing DTD attribute type. "+this.debugInfo(en))}if(!es){throw new Error("Missing DTD attribute default. "+this.debugInfo(en))}if(es.indexOf("#")!==0){es="#"+es}if(!es.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)){throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(en))}if(eu&&!es.match(/^(#FIXED|#DEFAULT)$/)){throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(en))}this.elementName=this.stringify.name(en);this.type=ee.AttributeDeclaration;this.attributeName=this.stringify.name(ei);this.attributeType=this.stringify.dtdAttType(eo);if(eu){this.defaultValue=this.stringify.dtdAttDefault(eu)}this.defaultValueType=es}et.prototype.toString=function($){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions($))};return et}(ei)}).call(this)},7338:function($,ee,et){(function(){var ee,en,ei,eo=function($,ee){for(var et in ee){if(es.call(ee,et))$[et]=ee[et]}function en(){this.constructor=$}en.prototype=ee.prototype;$.prototype=new en;$.__super__=ee.prototype;return $},es={}.hasOwnProperty;ei=et(630);ee=et(8745);$.exports=en=function($){eo(et,$);function et($,en,ei){et.__super__.constructor.call(this,$);if(en==null){throw new Error("Missing DTD element name. "+this.debugInfo())}if(!ei){ei="(#PCDATA)"}if(Array.isArray(ei)){ei="("+ei.join(",")+")"}this.name=this.stringify.name(en);this.type=ee.ElementDeclaration;this.value=this.stringify.dtdElementValue(ei)}et.prototype.toString=function($){return this.options.writer.dtdElement(this,this.options.writer.filterOptions($))};return et}(ei)}).call(this)},7834:function($,ee,et){(function(){var ee,en,ei,eo,es=function($,ee){for(var et in ee){if(eu.call(ee,et))$[et]=ee[et]}function en(){this.constructor=$}en.prototype=ee.prototype;$.prototype=new en;$.__super__=ee.prototype;return $},eu={}.hasOwnProperty;eo=et(8676).isObject;ei=et(630);ee=et(8745);$.exports=en=function($){es(et,$);function et($,en,ei,es){et.__super__.constructor.call(this,$);if(ei==null){throw new Error("Missing DTD entity name. "+this.debugInfo(ei))}if(es==null){throw new Error("Missing DTD entity value. "+this.debugInfo(ei))}this.pe=!!en;this.name=this.stringify.name(ei);this.type=ee.EntityDeclaration;if(!eo(es)){this.value=this.stringify.dtdEntityValue(es);this.internal=true}else{if(!es.pubID&&!es.sysID){throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(ei))}if(es.pubID&&!es.sysID){throw new Error("System identifier is required for a public external entity. "+this.debugInfo(ei))}this.internal=false;if(es.pubID!=null){this.pubID=this.stringify.dtdPubID(es.pubID)}if(es.sysID!=null){this.sysID=this.stringify.dtdSysID(es.sysID)}if(es.nData!=null){this.nData=this.stringify.dtdNData(es.nData)}if(this.pe&&this.nData){throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(ei))}}}Object.defineProperty(et.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(et.prototype,"systemId",{get:function(){return this.sysID}});Object.defineProperty(et.prototype,"notationName",{get:function(){return this.nData||null}});Object.defineProperty(et.prototype,"inputEncoding",{get:function(){return null}});Object.defineProperty(et.prototype,"xmlEncoding",{get:function(){return null}});Object.defineProperty(et.prototype,"xmlVersion",{get:function(){return null}});et.prototype.toString=function($){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions($))};return et}(ei)}).call(this)},8507:function($,ee,et){(function(){var ee,en,ei,eo=function($,ee){for(var et in ee){if(es.call(ee,et))$[et]=ee[et]}function en(){this.constructor=$}en.prototype=ee.prototype;$.prototype=new en;$.__super__=ee.prototype;return $},es={}.hasOwnProperty;ei=et(630);ee=et(8745);$.exports=en=function($){eo(et,$);function et($,en,ei){et.__super__.constructor.call(this,$);if(en==null){throw new Error("Missing DTD notation name. "+this.debugInfo(en))}if(!ei.pubID&&!ei.sysID){throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(en))}this.name=this.stringify.name(en);this.type=ee.NotationDeclaration;if(ei.pubID!=null){this.pubID=this.stringify.dtdPubID(ei.pubID)}if(ei.sysID!=null){this.sysID=this.stringify.dtdSysID(ei.sysID)}}Object.defineProperty(et.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(et.prototype,"systemId",{get:function(){return this.sysID}});et.prototype.toString=function($){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions($))};return et}(ei)}).call(this)},2308:function($,ee,et){(function(){var ee,en,ei,eo,es=function($,ee){for(var et in ee){if(eu.call(ee,et))$[et]=ee[et]}function en(){this.constructor=$}en.prototype=ee.prototype;$.prototype=new en;$.__super__=ee.prototype;return $},eu={}.hasOwnProperty;eo=et(8676).isObject;ei=et(630);ee=et(8745);$.exports=en=function($){es(et,$);function et($,en,ei,es){var eu;et.__super__.constructor.call(this,$);if(eo(en)){eu=en,en=eu.version,ei=eu.encoding,es=eu.standalone}if(!en){en="1.0"}this.type=ee.Declaration;this.version=this.stringify.xmlVersion(en);if(ei!=null){this.encoding=this.stringify.xmlEncoding(ei)}if(es!=null){this.standalone=this.stringify.xmlStandalone(es)}}et.prototype.toString=function($){return this.options.writer.declaration(this,this.options.writer.filterOptions($))};return et}(ei)}).call(this)},6808:function($,ee,et){(function(){var ee,en,ei,eo,es,eu,el,ef,ed,ep=function($,ee){for(var et in ee){if(eh.call(ee,et))$[et]=ee[et]}function en(){this.constructor=$}en.prototype=ee.prototype;$.prototype=new en;$.__super__=ee.prototype;return $},eh={}.hasOwnProperty;ed=et(8676).isObject;ef=et(630);ee=et(8745);en=et(4131);eo=et(7834);ei=et(7338);es=et(8507);el=et(9538);$.exports=eu=function($){ep(et,$);function et($,en,ei){var eo,es,eu,el,ef,ep;et.__super__.constructor.call(this,$);this.type=ee.DocType;if($.children){el=$.children;for(es=0,eu=el.length;es<eu;es++){eo=el[es];if(eo.type===ee.Element){this.name=eo.name;break}}}this.documentObject=$;if(ed(en)){ef=en,en=ef.pubID,ei=ef.sysID}if(ei==null){ep=[en,ei],ei=ep[0],en=ep[1]}if(en!=null){this.pubID=this.stringify.dtdPubID(en)}if(ei!=null){this.sysID=this.stringify.dtdSysID(ei)}}Object.defineProperty(et.prototype,"entities",{get:function(){var $,et,en,ei,eo;ei={};eo=this.children;for(et=0,en=eo.length;et<en;et++){$=eo[et];if($.type===ee.EntityDeclaration&&!$.pe){ei[$.name]=$}}return new el(ei)}});Object.defineProperty(et.prototype,"notations",{get:function(){var $,et,en,ei,eo;ei={};eo=this.children;for(et=0,en=eo.length;et<en;et++){$=eo[et];if($.type===ee.NotationDeclaration){ei[$.name]=$}}return new el(ei)}});Object.defineProperty(et.prototype,"publicId",{get:function(){return this.pubID}});Object.defineProperty(et.prototype,"systemId",{get:function(){return this.sysID}});Object.defineProperty(et.prototype,"internalSubset",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});et.prototype.element=function($,ee){var et;et=new ei(this,$,ee);this.children.push(et);return this};et.prototype.attList=function($,ee,et,ei,eo){var es;es=new en(this,$,ee,et,ei,eo);this.children.push(es);return this};et.prototype.entity=function($,ee){var et;et=new eo(this,false,$,ee);this.children.push(et);return this};et.prototype.pEntity=function($,ee){var et;et=new eo(this,true,$,ee);this.children.push(et);return this};et.prototype.notation=function($,ee){var et;et=new es(this,$,ee);this.children.push(et);return this};et.prototype.toString=function($){return this.options.writer.docType(this,this.options.writer.filterOptions($))};et.prototype.ele=function($,ee){return this.element($,ee)};et.prototype.att=function($,ee,et,en,ei){return this.attList($,ee,et,en,ei)};et.prototype.ent=function($,ee){return this.entity($,ee)};et.prototype.pent=function($,ee){return this.pEntity($,ee)};et.prototype.not=function($,ee){return this.notation($,ee)};et.prototype.up=function(){return this.root()||this.documentObject};et.prototype.isEqualNode=function($){if(!et.__super__.isEqualNode.apply(this,arguments).isEqualNode($)){return false}if($.name!==this.name){return false}if($.publicId!==this.publicId){return false}if($.systemId!==this.systemId){return false}return true};return et}(ef)}).call(this)},1888:function($,ee,et){(function(){var ee,en,ei,eo,es,eu,el,ef,ed=function($,ee){for(var et in ee){if(ep.call(ee,et))$[et]=ee[et]}function en(){this.constructor=$}en.prototype=ee.prototype;$.prototype=new en;$.__super__=ee.prototype;return $},ep={}.hasOwnProperty;ef=et(8676).isPlainObject;ei=et(4016);en=et(1829);es=et(630);ee=et(8745);el=et(8365);eu=et(1663);$.exports=eo=function($){ed(et,$);function et($){et.__super__.constructor.call(this,null);this.name="#document";this.type=ee.Document;this.documentURI=null;this.domConfig=new en;$||($={});if(!$.writer){$.writer=new eu}this.options=$;this.stringify=new el($)}Object.defineProperty(et.prototype,"implementation",{value:new ei});Object.defineProperty(et.prototype,"doctype",{get:function(){var $,et,en,ei;ei=this.children;for(et=0,en=ei.length;et<en;et++){$=ei[et];if($.type===ee.DocType){return $}}return null}});Object.defineProperty(et.prototype,"documentElement",{get:function(){return this.rootObject||null}});Object.defineProperty(et.prototype,"inputEncoding",{get:function(){return null}});Object.defineProperty(et.prototype,"strictErrorChecking",{get:function(){return false}});Object.defineProperty(et.prototype,"xmlEncoding",{get:function(){if(this.children.length!==0&&this.children[0].type===ee.Declaration){return this.children[0].encoding}else{return null}}});Object.defineProperty(et.prototype,"xmlStandalone",{get:function(){if(this.children.length!==0&&this.children[0].type===ee.Declaration){return this.children[0].standalone==="yes"}else{return false}}});Object.defineProperty(et.prototype,"xmlVersion",{get:function(){if(this.children.length!==0&&this.children[0].type===ee.Declaration){return this.children[0].version}else{return"1.0"}}});Object.defineProperty(et.prototype,"URL",{get:function(){return this.documentURI}});Object.defineProperty(et.prototype,"origin",{get:function(){return null}});Object.defineProperty(et.prototype,"compatMode",{get:function(){return null}});Object.defineProperty(et.prototype,"characterSet",{get:function(){return null}});Object.defineProperty(et.prototype,"contentType",{get:function(){return null}});et.prototype.end=function($){var ee;ee={};if(!$){$=this.options.writer}else if(ef($)){ee=$;$=this.options.writer}return $.document(this,$.filterOptions(ee))};et.prototype.toString=function($){return this.options.writer.document(this,this.options.writer.filterOptions($))};et.prototype.createElement=function($){throw new Error("This DOM method is not implemented."+this.debugInfo())};et.prototype.createDocumentFragment=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};et.prototype.createTextNode=function($){throw new Error("This DOM method is not implemented."+this.debugInfo())};et.prototype.createComment=function($){throw new Error("This DOM method is not implemented."+this.debugInfo())};et.prototype.createCDATASection=function($){throw new Error("This DOM method is not implemented."+this.debugInfo())};et.prototype.createProcessingInstruction=function($,ee){throw new Error("This DOM method is not implemented."+this.debugInfo())};et.prototype.createAttribute=function($){throw new Error("This DOM method is not implemented."+this.debugInfo())};et.prototype.createEntityReference=function($){throw new Error("This DOM method is not implemented."+this.debugInfo())};et.prototype.getElementsByTagName=function($){throw new Error("This DOM method is not implemented."+this.debugInfo())};et.prototype.importNode=function($,ee){throw new Error("This DOM method is not implemented."+this.debugInfo())};et.prototype.createElementNS=function($,ee){throw new Error("This DOM method is not implemented."+this.debugInfo())};et.prototype.createAttributeNS=function($,ee){throw new Error("This DOM method is not implemented."+this.debugInfo())};et.prototype.getElementsByTagNameNS=function($,ee){throw new Error("This DOM method is not implemented."+this.debugInfo())};et.prototype.getElementById=function($){throw new Error("This DOM method is not implemented."+this.debugInfo())};et.prototype.adoptNode=function($){throw new Error("This DOM method is not implemented."+this.debugInfo())};et.prototype.normalizeDocument=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};et.prototype.renameNode=function($,ee,et){throw new Error("This DOM method is not implemented."+this.debugInfo())};et.prototype.getElementsByClassName=function($){throw new Error("This DOM method is not implemented."+this.debugInfo())};et.prototype.createEvent=function($){throw new Error("This DOM method is not implemented."+this.debugInfo())};et.prototype.createRange=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};et.prototype.createNodeIterator=function($,ee,et){throw new Error("This DOM method is not implemented."+this.debugInfo())};et.prototype.createTreeWalker=function($,ee,et){throw new Error("This DOM method is not implemented."+this.debugInfo())};return et}(es)}).call(this)},2621:function($,ee,et){(function(){var ee,en,ei,eo,es,eu,el,ef,ed,ep,eh,ey,eg,em,e_,ew,eE,eS,eT,eO,eA,eI,eN,eD,eR={}.hasOwnProperty;eD=et(8676),eI=eD.isObject,eA=eD.isFunction,eN=eD.isPlainObject,eO=eD.getValue;ee=et(8745);ey=et(1888);em=et(5725);eo=et(9877);es=et(2374);ew=et(7641);eT=et(4306);e_=et(3402);ep=et(2308);eh=et(6808);eu=et(4131);ef=et(7834);el=et(7338);ed=et(8507);ei=et(7490);eS=et(8365);eE=et(1663);en=et(6530);$.exports=eg=function(){function $($,et,en){var ei;this.name="?xml";this.type=ee.Document;$||($={});ei={};if(!$.writer){$.writer=new eE}else if(eN($.writer)){ei=$.writer;$.writer=new eE}this.options=$;this.writer=$.writer;this.writerOptions=this.writer.filterOptions(ei);this.stringify=new eS($);this.onDataCallback=et||function(){};this.onEndCallback=en||function(){};this.currentNode=null;this.currentLevel=-1;this.openTags={};this.documentStarted=false;this.documentCompleted=false;this.root=null}$.prototype.createChildNode=function($){var et,en,ei,eo,es,eu,el,ef;switch($.type){case ee.CData:this.cdata($.value);break;case ee.Comment:this.comment($.value);break;case ee.Element:ei={};el=$.attribs;for(en in el){if(!eR.call(el,en))continue;et=el[en];ei[en]=et.value}this.node($.name,ei);break;case ee.Dummy:this.dummy();break;case ee.Raw:this.raw($.value);break;case ee.Text:this.text($.value);break;case ee.ProcessingInstruction:this.instruction($.target,$.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+$.constructor.name)}ef=$.children;for(es=0,eu=ef.length;es<eu;es++){eo=ef[es];this.createChildNode(eo);if(eo.type===ee.Element){this.up()}}return this};$.prototype.dummy=function(){return this};$.prototype.node=function($,ee,et){var en;if($==null){throw new Error("Missing node name.")}if(this.root&&this.currentLevel===-1){throw new Error("Document can only have one root node. "+this.debugInfo($))}this.openCurrent();$=eO($);if(ee==null){ee={}}ee=eO(ee);if(!eI(ee)){en=[ee,et],et=en[0],ee=en[1]}this.currentNode=new em(this,$,ee);this.currentNode.children=false;this.currentLevel++;this.openTags[this.currentLevel]=this.currentNode;if(et!=null){this.text(et)}return this};$.prototype.element=function($,et,en){var ei,eo,es,eu,el,ef;if(this.currentNode&&this.currentNode.type===ee.DocType){this.dtdElement.apply(this,arguments)}else{if(Array.isArray($)||eI($)||eA($)){eu=this.options.noValidation;this.options.noValidation=true;ef=new ey(this.options).element("TEMP_ROOT");ef.element($);this.options.noValidation=eu;el=ef.children;for(eo=0,es=el.length;eo<es;eo++){ei=el[eo];this.createChildNode(ei);if(ei.type===ee.Element){this.up()}}}else{this.node($,et,en)}}return this};$.prototype.attribute=function($,ee){var et,en;if(!this.currentNode||this.currentNode.children){throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo($))}if($!=null){$=eO($)}if(eI($)){for(et in $){if(!eR.call($,et))continue;en=$[et];this.attribute(et,en)}}else{if(eA(ee)){ee=ee.apply()}if(this.options.keepNullAttributes&&ee==null){this.currentNode.attribs[$]=new ei(this,$,"")}else if(ee!=null){this.currentNode.attribs[$]=new ei(this,$,ee)}}return this};$.prototype.text=function($){var ee;this.openCurrent();ee=new eT(this,$);this.onData(this.writer.text(ee,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};$.prototype.cdata=function($){var ee;this.openCurrent();ee=new eo(this,$);this.onData(this.writer.cdata(ee,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};$.prototype.comment=function($){var ee;this.openCurrent();ee=new es(this,$);this.onData(this.writer.comment(ee,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};$.prototype.raw=function($){var ee;this.openCurrent();ee=new ew(this,$);this.onData(this.writer.raw(ee,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};$.prototype.instruction=function($,ee){var et,en,ei,eo,es;this.openCurrent();if($!=null){$=eO($)}if(ee!=null){ee=eO(ee)}if(Array.isArray($)){for(et=0,eo=$.length;et<eo;et++){en=$[et];this.instruction(en)}}else if(eI($)){for(en in $){if(!eR.call($,en))continue;ei=$[en];this.instruction(en,ei)}}else{if(eA(ee)){ee=ee.apply()}es=new e_(this,$,ee);this.onData(this.writer.processingInstruction(es,this.writerOptions,this.currentLevel+1),this.currentLevel+1)}return this};$.prototype.declaration=function($,ee,et){var en;this.openCurrent();if(this.documentStarted){throw new Error("declaration() must be the first node.")}en=new ep(this,$,ee,et);this.onData(this.writer.declaration(en,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};$.prototype.doctype=function($,ee,et){this.openCurrent();if($==null){throw new Error("Missing root node name.")}if(this.root){throw new Error("dtd() must come before the root node.")}this.currentNode=new eh(this,ee,et);this.currentNode.rootNodeName=$;this.currentNode.children=false;this.currentLevel++;this.openTags[this.currentLevel]=this.currentNode;return this};$.prototype.dtdElement=function($,ee){var et;this.openCurrent();et=new el(this,$,ee);this.onData(this.writer.dtdElement(et,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};$.prototype.attList=function($,ee,et,en,ei){var eo;this.openCurrent();eo=new eu(this,$,ee,et,en,ei);this.onData(this.writer.dtdAttList(eo,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};$.prototype.entity=function($,ee){var et;this.openCurrent();et=new ef(this,false,$,ee);this.onData(this.writer.dtdEntity(et,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};$.prototype.pEntity=function($,ee){var et;this.openCurrent();et=new ef(this,true,$,ee);this.onData(this.writer.dtdEntity(et,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};$.prototype.notation=function($,ee){var et;this.openCurrent();et=new ed(this,$,ee);this.onData(this.writer.dtdNotation(et,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this};$.prototype.up=function(){if(this.currentLevel<0){throw new Error("The document node has no parent.")}if(this.currentNode){if(this.currentNode.children){this.closeNode(this.currentNode)}else{this.openNode(this.currentNode)}this.currentNode=null}else{this.closeNode(this.openTags[this.currentLevel])}delete this.openTags[this.currentLevel];this.currentLevel--;return this};$.prototype.end=function(){while(this.currentLevel>=0){this.up()}return this.onEnd()};$.prototype.openCurrent=function(){if(this.currentNode){this.currentNode.children=true;return this.openNode(this.currentNode)}};$.prototype.openNode=function($){var et,ei,eo,es;if(!$.isOpen){if(!this.root&&this.currentLevel===0&&$.type===ee.Element){this.root=$}ei="";if($.type===ee.Element){this.writerOptions.state=en.OpenTag;ei=this.writer.indent($,this.writerOptions,this.currentLevel)+"<"+$.name;es=$.attribs;for(eo in es){if(!eR.call(es,eo))continue;et=es[eo];ei+=this.writer.attribute(et,this.writerOptions,this.currentLevel)}ei+=($.children?">":"/>")+this.writer.endline($,this.writerOptions,this.currentLevel);this.writerOptions.state=en.InsideTag}else{this.writerOptions.state=en.OpenTag;ei=this.writer.indent($,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+$.rootNodeName;if($.pubID&&$.sysID){ei+=' PUBLIC "'+$.pubID+'" "'+$.sysID+'"'}else if($.sysID){ei+=' SYSTEM "'+$.sysID+'"'}if($.children){ei+=" [";this.writerOptions.state=en.InsideTag}else{this.writerOptions.state=en.CloseTag;ei+=">"}ei+=this.writer.endline($,this.writerOptions,this.currentLevel)}this.onData(ei,this.currentLevel);return $.isOpen=true}};$.prototype.closeNode=function($){var et;if(!$.isClosed){et="";this.writerOptions.state=en.CloseTag;if($.type===ee.Element){et=this.writer.indent($,this.writerOptions,this.currentLevel)+"</"+$.name+">"+this.writer.endline($,this.writerOptions,this.currentLevel)}else{et=this.writer.indent($,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline($,this.writerOptions,this.currentLevel)}this.writerOptions.state=en.None;this.onData(et,this.currentLevel);return $.isClosed=true}};$.prototype.onData=function($,ee){this.documentStarted=true;return this.onDataCallback($,ee+1)};$.prototype.onEnd=function(){this.documentCompleted=true;return this.onEndCallback()};$.prototype.debugInfo=function($){if($==null){return""}else{return"node: <"+$+">"}};$.prototype.ele=function(){return this.element.apply(this,arguments)};$.prototype.nod=function($,ee,et){return this.node($,ee,et)};$.prototype.txt=function($){return this.text($)};$.prototype.dat=function($){return this.cdata($)};$.prototype.com=function($){return this.comment($)};$.prototype.ins=function($,ee){return this.instruction($,ee)};$.prototype.dec=function($,ee,et){return this.declaration($,ee,et)};$.prototype.dtd=function($,ee,et){return this.doctype($,ee,et)};$.prototype.e=function($,ee,et){return this.element($,ee,et)};$.prototype.n=function($,ee,et){return this.node($,ee,et)};$.prototype.t=function($){return this.text($)};$.prototype.d=function($){return this.cdata($)};$.prototype.c=function($){return this.comment($)};$.prototype.r=function($){return this.raw($)};$.prototype.i=function($,ee){return this.instruction($,ee)};$.prototype.att=function(){if(this.currentNode&&this.currentNode.type===ee.DocType){return this.attList.apply(this,arguments)}else{return this.attribute.apply(this,arguments)}};$.prototype.a=function(){if(this.currentNode&&this.currentNode.type===ee.DocType){return this.attList.apply(this,arguments)}else{return this.attribute.apply(this,arguments)}};$.prototype.ent=function($,ee){return this.entity($,ee)};$.prototype.pent=function($,ee){return this.pEntity($,ee)};$.prototype.not=function($,ee){return this.notation($,ee)};return $}()}).call(this)},4402:function($,ee,et){(function(){var ee,en,ei,eo=function($,ee){for(var et in ee){if(es.call(ee,et))$[et]=ee[et]}function en(){this.constructor=$}en.prototype=ee.prototype;$.prototype=new en;$.__super__=ee.prototype;return $},es={}.hasOwnProperty;ei=et(630);ee=et(8745);$.exports=en=function($){eo(et,$);function et($){et.__super__.constructor.call(this,$);this.type=ee.Dummy}et.prototype.clone=function(){return Object.create(this)};et.prototype.toString=function($){return""};return et}(ei)}).call(this)},5725:function($,ee,et){(function(){var ee,en,ei,eo,es,eu,el,ef,ed,ep=function($,ee){for(var et in ee){if(eh.call(ee,et))$[et]=ee[et]}function en(){this.constructor=$}en.prototype=ee.prototype;$.prototype=new en;$.__super__=ee.prototype;return $},eh={}.hasOwnProperty;ed=et(8676),ef=ed.isObject,el=ed.isFunction,eu=ed.getValue;es=et(630);ee=et(8745);en=et(7490);eo=et(9538);$.exports=ei=function($){ep(et,$);function et($,en,ei){var eo,es,eu,el;et.__super__.constructor.call(this,$);if(en==null){throw new Error("Missing element name. "+this.debugInfo())}this.name=this.stringify.name(en);this.type=ee.Element;this.attribs={};this.schemaTypeInfo=null;if(ei!=null){this.attribute(ei)}if($.type===ee.Document){this.isRoot=true;this.documentObject=$;$.rootObject=this;if($.children){el=$.children;for(es=0,eu=el.length;es<eu;es++){eo=el[es];if(eo.type===ee.DocType){eo.name=this.name;break}}}}}Object.defineProperty(et.prototype,"tagName",{get:function(){return this.name}});Object.defineProperty(et.prototype,"namespaceURI",{get:function(){return""}});Object.defineProperty(et.prototype,"prefix",{get:function(){return""}});Object.defineProperty(et.prototype,"localName",{get:function(){return this.name}});Object.defineProperty(et.prototype,"id",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(et.prototype,"className",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(et.prototype,"classList",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(et.prototype,"attributes",{get:function(){if(!this.attributeMap||!this.attributeMap.nodes){this.attributeMap=new eo(this.attribs)}return this.attributeMap}});et.prototype.clone=function(){var $,ee,et,en;et=Object.create(this);if(et.isRoot){et.documentObject=null}et.attribs={};en=this.attribs;for(ee in en){if(!eh.call(en,ee))continue;$=en[ee];et.attribs[ee]=$.clone()}et.children=[];this.children.forEach(function($){var ee;ee=$.clone();ee.parent=et;return et.children.push(ee)});return et};et.prototype.attribute=function($,ee){var et,ei;if($!=null){$=eu($)}if(ef($)){for(et in $){if(!eh.call($,et))continue;ei=$[et];this.attribute(et,ei)}}else{if(el(ee)){ee=ee.apply()}if(this.options.keepNullAttributes&&ee==null){this.attribs[$]=new en(this,$,"")}else if(ee!=null){this.attribs[$]=new en(this,$,ee)}}return this};et.prototype.removeAttribute=function($){var ee,et,en;if($==null){throw new Error("Missing attribute name. "+this.debugInfo())}$=eu($);if(Array.isArray($)){for(et=0,en=$.length;et<en;et++){ee=$[et];delete this.attribs[ee]}}else{delete this.attribs[$]}return this};et.prototype.toString=function($){return this.options.writer.element(this,this.options.writer.filterOptions($))};et.prototype.att=function($,ee){return this.attribute($,ee)};et.prototype.a=function($,ee){return this.attribute($,ee)};et.prototype.getAttribute=function($){if(this.attribs.hasOwnProperty($)){return this.attribs[$].value}else{return null}};et.prototype.setAttribute=function($,ee){throw new Error("This DOM method is not implemented."+this.debugInfo())};et.prototype.getAttributeNode=function($){if(this.attribs.hasOwnProperty($)){return this.attribs[$]}else{return null}};et.prototype.setAttributeNode=function($){throw new Error("This DOM method is not implemented."+this.debugInfo())};et.prototype.removeAttributeNode=function($){throw new Error("This DOM method is not implemented."+this.debugInfo())};et.prototype.getElementsByTagName=function($){throw new Error("This DOM method is not implemented."+this.debugInfo())};et.prototype.getAttributeNS=function($,ee){throw new Error("This DOM method is not implemented."+this.debugInfo())};et.prototype.setAttributeNS=function($,ee,et){throw new Error("This DOM method is not implemented."+this.debugInfo())};et.prototype.removeAttributeNS=function($,ee){throw new Error("This DOM method is not implemented."+this.debugInfo())};et.prototype.getAttributeNodeNS=function($,ee){throw new Error("This DOM method is not implemented."+this.debugInfo())};et.prototype.setAttributeNodeNS=function($){throw new Error("This DOM method is not implemented."+this.debugInfo())};et.prototype.getElementsByTagNameNS=function($,ee){throw new Error("This DOM method is not implemented."+this.debugInfo())};et.prototype.hasAttribute=function($){return this.attribs.hasOwnProperty($)};et.prototype.hasAttributeNS=function($,ee){throw new Error("This DOM method is not implemented."+this.debugInfo())};et.prototype.setIdAttribute=function($,ee){if(this.attribs.hasOwnProperty($)){return this.attribs[$].isId}else{return ee}};et.prototype.setIdAttributeNS=function($,ee,et){throw new Error("This DOM method is not implemented."+this.debugInfo())};et.prototype.setIdAttributeNode=function($,ee){throw new Error("This DOM method is not implemented."+this.debugInfo())};et.prototype.getElementsByTagName=function($){throw new Error("This DOM method is not implemented."+this.debugInfo())};et.prototype.getElementsByTagNameNS=function($,ee){throw new Error("This DOM method is not implemented."+this.debugInfo())};et.prototype.getElementsByClassName=function($){throw new Error("This DOM method is not implemented."+this.debugInfo())};et.prototype.isEqualNode=function($){var ee,en,ei;if(!et.__super__.isEqualNode.apply(this,arguments).isEqualNode($)){return false}if($.namespaceURI!==this.namespaceURI){return false}if($.prefix!==this.prefix){return false}if($.localName!==this.localName){return false}if($.attribs.length!==this.attribs.length){return false}for(ee=en=0,ei=this.attribs.length-1;0<=ei?en<=ei:en>=ei;ee=0<=ei?++en:--en){if(!this.attribs[ee].isEqualNode($.attribs[ee])){return false}}return true};return et}(es)}).call(this)},9538:function($){(function(){var ee;$.exports=ee=function(){function $($){this.nodes=$}Object.defineProperty($.prototype,"length",{get:function(){return Object.keys(this.nodes).length||0}});$.prototype.clone=function(){return this.nodes=null};$.prototype.getNamedItem=function($){return this.nodes[$]};$.prototype.setNamedItem=function($){var ee;ee=this.nodes[$.nodeName];this.nodes[$.nodeName]=$;return ee||null};$.prototype.removeNamedItem=function($){var ee;ee=this.nodes[$];delete this.nodes[$];return ee||null};$.prototype.item=function($){return this.nodes[Object.keys(this.nodes)[$]]||null};$.prototype.getNamedItemNS=function($,ee){throw new Error("This DOM method is not implemented.")};$.prototype.setNamedItemNS=function($){throw new Error("This DOM method is not implemented.")};$.prototype.removeNamedItemNS=function($,ee){throw new Error("This DOM method is not implemented.")};return $}()}).call(this)},630:function($,ee,et){(function(){var ee,en,ei,eo,es,eu,el,ef,ed,ep,eh,ey,eg,em,e_,ew,eE,eS,eT,eO={}.hasOwnProperty;eT=et(8676),eS=eT.isObject,eE=eT.isFunction,ew=eT.isEmpty,e_=eT.getValue;ef=null;ei=null;eo=null;es=null;eu=null;eg=null;em=null;ey=null;el=null;en=null;eh=null;ed=null;ee=null;$.exports=ep=function(){function $($){this.parent=$;if(this.parent){this.options=this.parent.options;this.stringify=this.parent.stringify}this.value=null;this.children=[];this.baseURI=null;if(!ef){ef=et(5725);ei=et(9877);eo=et(2374);es=et(2308);eu=et(6808);eg=et(7641);em=et(4306);ey=et(3402);el=et(4402);en=et(8745);eh=et(3220);ed=et(9538);ee=et(8154)}}Object.defineProperty($.prototype,"nodeName",{get:function(){return this.name}});Object.defineProperty($.prototype,"nodeType",{get:function(){return this.type}});Object.defineProperty($.prototype,"nodeValue",{get:function(){return this.value}});Object.defineProperty($.prototype,"parentNode",{get:function(){return this.parent}});Object.defineProperty($.prototype,"childNodes",{get:function(){if(!this.childNodeList||!this.childNodeList.nodes){this.childNodeList=new eh(this.children)}return this.childNodeList}});Object.defineProperty($.prototype,"firstChild",{get:function(){return this.children[0]||null}});Object.defineProperty($.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]||null}});Object.defineProperty($.prototype,"previousSibling",{get:function(){var $;$=this.parent.children.indexOf(this);return this.parent.children[$-1]||null}});Object.defineProperty($.prototype,"nextSibling",{get:function(){var $;$=this.parent.children.indexOf(this);return this.parent.children[$+1]||null}});Object.defineProperty($.prototype,"ownerDocument",{get:function(){return this.document()||null}});Object.defineProperty($.prototype,"textContent",{get:function(){var $,ee,et,ei,eo;if(this.nodeType===en.Element||this.nodeType===en.DocumentFragment){eo="";ei=this.children;for(ee=0,et=ei.length;ee<et;ee++){$=ei[ee];if($.textContent){eo+=$.textContent}}return eo}else{return null}},set:function($){throw new Error("This DOM method is not implemented."+this.debugInfo())}});$.prototype.setParent=function($){var ee,et,en,ei,eo;this.parent=$;if($){this.options=$.options;this.stringify=$.stringify}ei=this.children;eo=[];for(et=0,en=ei.length;et<en;et++){ee=ei[et];eo.push(ee.setParent(this))}return eo};$.prototype.element=function($,ee,et){var en,ei,eo,es,eu,el,ef,ed,ep,eh,ey;el=null;if(ee===null&&et==null){ep=[{},null],ee=ep[0],et=ep[1]}if(ee==null){ee={}}ee=e_(ee);if(!eS(ee)){eh=[ee,et],et=eh[0],ee=eh[1]}if($!=null){$=e_($)}if(Array.isArray($)){for(eo=0,ef=$.length;eo<ef;eo++){ei=$[eo];el=this.element(ei)}}else if(eE($)){el=this.element($.apply())}else if(eS($)){for(eu in $){if(!eO.call($,eu))continue;ey=$[eu];if(eE(ey)){ey=ey.apply()}if(!this.options.ignoreDecorators&&this.stringify.convertAttKey&&eu.indexOf(this.stringify.convertAttKey)===0){el=this.attribute(eu.substr(this.stringify.convertAttKey.length),ey)}else if(!this.options.separateArrayItems&&Array.isArray(ey)&&ew(ey)){el=this.dummy()}else if(eS(ey)&&ew(ey)){el=this.element(eu)}else if(!this.options.keepNullNodes&&ey==null){el=this.dummy()}else if(!this.options.separateArrayItems&&Array.isArray(ey)){for(es=0,ed=ey.length;es<ed;es++){ei=ey[es];en={};en[eu]=ei;el=this.element(en)}}else if(eS(ey)){if(!this.options.ignoreDecorators&&this.stringify.convertTextKey&&eu.indexOf(this.stringify.convertTextKey)===0){el=this.element(ey)}else{el=this.element(eu);el.element(ey)}}else{el=this.element(eu,ey)}}}else if(!this.options.keepNullNodes&&et===null){el=this.dummy()}else{if(!this.options.ignoreDecorators&&this.stringify.convertTextKey&&$.indexOf(this.stringify.convertTextKey)===0){el=this.text(et)}else if(!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&$.indexOf(this.stringify.convertCDataKey)===0){el=this.cdata(et)}else if(!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&$.indexOf(this.stringify.convertCommentKey)===0){el=this.comment(et)}else if(!this.options.ignoreDecorators&&this.stringify.convertRawKey&&$.indexOf(this.stringify.convertRawKey)===0){el=this.raw(et)}else if(!this.options.ignoreDecorators&&this.stringify.convertPIKey&&$.indexOf(this.stringify.convertPIKey)===0){el=this.instruction($.substr(this.stringify.convertPIKey.length),et)}else{el=this.node($,ee,et)}}if(el==null){throw new Error("Could not create any elements with: "+$+". "+this.debugInfo())}return el};$.prototype.insertBefore=function($,ee,et){var en,ei,eo,es,eu;if($!=null?$.type:void 0){eo=$;es=ee;eo.setParent(this);if(es){ei=children.indexOf(es);eu=children.splice(ei);children.push(eo);Array.prototype.push.apply(children,eu)}else{children.push(eo)}return eo}else{if(this.isRoot){throw new Error("Cannot insert elements at root level. "+this.debugInfo($))}ei=this.parent.children.indexOf(this);eu=this.parent.children.splice(ei);en=this.parent.element($,ee,et);Array.prototype.push.apply(this.parent.children,eu);return en}};$.prototype.insertAfter=function($,ee,et){var en,ei,eo;if(this.isRoot){throw new Error("Cannot insert elements at root level. "+this.debugInfo($))}ei=this.parent.children.indexOf(this);eo=this.parent.children.splice(ei+1);en=this.parent.element($,ee,et);Array.prototype.push.apply(this.parent.children,eo);return en};$.prototype.remove=function(){var $,ee;if(this.isRoot){throw new Error("Cannot remove the root element. "+this.debugInfo())}$=this.parent.children.indexOf(this);[].splice.apply(this.parent.children,[$,$-$+1].concat(ee=[])),ee;return this.parent};$.prototype.node=function($,ee,et){var en,ei;if($!=null){$=e_($)}ee||(ee={});ee=e_(ee);if(!eS(ee)){ei=[ee,et],et=ei[0],ee=ei[1]}en=new ef(this,$,ee);if(et!=null){en.text(et)}this.children.push(en);return en};$.prototype.text=function($){var ee;if(eS($)){this.element($)}ee=new em(this,$);this.children.push(ee);return this};$.prototype.cdata=function($){var ee;ee=new ei(this,$);this.children.push(ee);return this};$.prototype.comment=function($){var ee;ee=new eo(this,$);this.children.push(ee);return this};$.prototype.commentBefore=function($){var ee,et,en;et=this.parent.children.indexOf(this);en=this.parent.children.splice(et);ee=this.parent.comment($);Array.prototype.push.apply(this.parent.children,en);return this};$.prototype.commentAfter=function($){var ee,et,en;et=this.parent.children.indexOf(this);en=this.parent.children.splice(et+1);ee=this.parent.comment($);Array.prototype.push.apply(this.parent.children,en);return this};$.prototype.raw=function($){var ee;ee=new eg(this,$);this.children.push(ee);return this};$.prototype.dummy=function(){var $;$=new el(this);return $};$.prototype.instruction=function($,ee){var et,en,ei,eo,es;if($!=null){$=e_($)}if(ee!=null){ee=e_(ee)}if(Array.isArray($)){for(eo=0,es=$.length;eo<es;eo++){et=$[eo];this.instruction(et)}}else if(eS($)){for(et in $){if(!eO.call($,et))continue;en=$[et];this.instruction(et,en)}}else{if(eE(ee)){ee=ee.apply()}ei=new ey(this,$,ee);this.children.push(ei)}return this};$.prototype.instructionBefore=function($,ee){var et,en,ei;en=this.parent.children.indexOf(this);ei=this.parent.children.splice(en);et=this.parent.instruction($,ee);Array.prototype.push.apply(this.parent.children,ei);return this};$.prototype.instructionAfter=function($,ee){var et,en,ei;en=this.parent.children.indexOf(this);ei=this.parent.children.splice(en+1);et=this.parent.instruction($,ee);Array.prototype.push.apply(this.parent.children,ei);return this};$.prototype.declaration=function($,ee,et){var ei,eo;ei=this.document();eo=new es(ei,$,ee,et);if(ei.children.length===0){ei.children.unshift(eo)}else if(ei.children[0].type===en.Declaration){ei.children[0]=eo}else{ei.children.unshift(eo)}return ei.root()||ei};$.prototype.dtd=function($,ee){var et,ei,eo,es,el,ef,ed,ep,eh,ey;ei=this.document();eo=new eu(ei,$,ee);eh=ei.children;for(es=el=0,ed=eh.length;el<ed;es=++el){et=eh[es];if(et.type===en.DocType){ei.children[es]=eo;return eo}}ey=ei.children;for(es=ef=0,ep=ey.length;ef<ep;es=++ef){et=ey[es];if(et.isRoot){ei.children.splice(es,0,eo);return eo}}ei.children.push(eo);return eo};$.prototype.up=function(){if(this.isRoot){throw new Error("The root node has no parent. Use doc() if you need to get the document object.")}return this.parent};$.prototype.root=function(){var $;$=this;while($){if($.type===en.Document){return $.rootObject}else if($.isRoot){return $}else{$=$.parent}}};$.prototype.document=function(){var $;$=this;while($){if($.type===en.Document){return $}else{$=$.parent}}};$.prototype.end=function($){return this.document().end($)};$.prototype.prev=function(){var $;$=this.parent.children.indexOf(this);if($<1){throw new Error("Already at the first node. "+this.debugInfo())}return this.parent.children[$-1]};$.prototype.next=function(){var $;$=this.parent.children.indexOf(this);if($===-1||$===this.parent.children.length-1){throw new Error("Already at the last node. "+this.debugInfo())}return this.parent.children[$+1]};$.prototype.importDocument=function($){var ee;ee=$.root().clone();ee.parent=this;ee.isRoot=false;this.children.push(ee);return this};$.prototype.debugInfo=function($){var ee,et;$=$||this.name;if($==null&&!((ee=this.parent)!=null?ee.name:void 0)){return""}else if($==null){return"parent: <"+this.parent.name+">"}else if(!((et=this.parent)!=null?et.name:void 0)){return"node: <"+$+">"}else{return"node: <"+$+">, parent: <"+this.parent.name+">"}};$.prototype.ele=function($,ee,et){return this.element($,ee,et)};$.prototype.nod=function($,ee,et){return this.node($,ee,et)};$.prototype.txt=function($){return this.text($)};$.prototype.dat=function($){return this.cdata($)};$.prototype.com=function($){return this.comment($)};$.prototype.ins=function($,ee){return this.instruction($,ee)};$.prototype.doc=function(){return this.document()};$.prototype.dec=function($,ee,et){return this.declaration($,ee,et)};$.prototype.e=function($,ee,et){return this.element($,ee,et)};$.prototype.n=function($,ee,et){return this.node($,ee,et)};$.prototype.t=function($){return this.text($)};$.prototype.d=function($){return this.cdata($)};$.prototype.c=function($){return this.comment($)};$.prototype.r=function($){return this.raw($)};$.prototype.i=function($,ee){return this.instruction($,ee)};$.prototype.u=function(){return this.up()};$.prototype.importXMLBuilder=function($){return this.importDocument($)};$.prototype.replaceChild=function($,ee){throw new Error("This DOM method is not implemented."+this.debugInfo())};$.prototype.removeChild=function($){throw new Error("This DOM method is not implemented."+this.debugInfo())};$.prototype.appendChild=function($){throw new Error("This DOM method is not implemented."+this.debugInfo())};$.prototype.hasChildNodes=function(){return this.children.length!==0};$.prototype.cloneNode=function($){throw new Error("This DOM method is not implemented."+this.debugInfo())};$.prototype.normalize=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())};$.prototype.isSupported=function($,ee){return true};$.prototype.hasAttributes=function(){return this.attribs.length!==0};$.prototype.compareDocumentPosition=function($){var et,en;et=this;if(et===$){return 0}else if(this.document()!==$.document()){en=ee.Disconnected|ee.ImplementationSpecific;if(Math.random()<.5){en|=ee.Preceding}else{en|=ee.Following}return en}else if(et.isAncestor($)){return ee.Contains|ee.Preceding}else if(et.isDescendant($)){return ee.Contains|ee.Following}else if(et.isPreceding($)){return ee.Preceding}else{return ee.Following}};$.prototype.isSameNode=function($){throw new Error("This DOM method is not implemented."+this.debugInfo())};$.prototype.lookupPrefix=function($){throw new Error("This DOM method is not implemented."+this.debugInfo())};$.prototype.isDefaultNamespace=function($){throw new Error("This DOM method is not implemented."+this.debugInfo())};$.prototype.lookupNamespaceURI=function($){throw new Error("This DOM method is not implemented."+this.debugInfo())};$.prototype.isEqualNode=function($){var ee,et,en;if($.nodeType!==this.nodeType){return false}if($.children.length!==this.children.length){return false}for(ee=et=0,en=this.children.length-1;0<=en?et<=en:et>=en;ee=0<=en?++et:--et){if(!this.children[ee].isEqualNode($.children[ee])){return false}}return true};$.prototype.getFeature=function($,ee){throw new Error("This DOM method is not implemented."+this.debugInfo())};$.prototype.setUserData=function($,ee,et){throw new Error("This DOM method is not implemented."+this.debugInfo())};$.prototype.getUserData=function($){throw new Error("This DOM method is not implemented."+this.debugInfo())};$.prototype.contains=function($){if(!$){return false}return $===this||this.isDescendant($)};$.prototype.isDescendant=function($){var ee,et,en,ei,eo;eo=this.children;for(en=0,ei=eo.length;en<ei;en++){ee=eo[en];if($===ee){return true}et=ee.isDescendant($);if(et){return true}}return false};$.prototype.isAncestor=function($){return $.isDescendant(this)};$.prototype.isPreceding=function($){var ee,et;ee=this.treePosition($);et=this.treePosition(this);if(ee===-1||et===-1){return false}else{return ee<et}};$.prototype.isFollowing=function($){var ee,et;ee=this.treePosition($);et=this.treePosition(this);if(ee===-1||et===-1){return false}else{return ee>et}};$.prototype.treePosition=function($){var ee,et;et=0;ee=false;this.foreachTreeNode(this.document(),function(en){et++;if(!ee&&en===$){return ee=true}});if(ee){return et}else{return-1}};$.prototype.foreachTreeNode=function($,ee){var et,en,ei,eo,es;$||($=this.document());eo=$.children;for(en=0,ei=eo.length;en<ei;en++){et=eo[en];if(es=ee(et)){return es}else{es=this.foreachTreeNode(et,ee);if(es){return es}}}};return $}()}).call(this)},3220:function($){(function(){var ee;$.exports=ee=function(){function $($){this.nodes=$}Object.defineProperty($.prototype,"length",{get:function(){return this.nodes.length||0}});$.prototype.clone=function(){return this.nodes=null};$.prototype.item=function($){return this.nodes[$]||null};return $}()}).call(this)},3402:function($,ee,et){(function(){var ee,en,ei,eo=function($,ee){for(var et in ee){if(es.call(ee,et))$[et]=ee[et]}function en(){this.constructor=$}en.prototype=ee.prototype;$.prototype=new en;$.__super__=ee.prototype;return $},es={}.hasOwnProperty;ee=et(8745);en=et(4356);$.exports=ei=function($){eo(et,$);function et($,en,ei){et.__super__.constructor.call(this,$);if(en==null){throw new Error("Missing instruction target. "+this.debugInfo())}this.type=ee.ProcessingInstruction;this.target=this.stringify.insTarget(en);this.name=this.target;if(ei){this.value=this.stringify.insValue(ei)}}et.prototype.clone=function(){return Object.create(this)};et.prototype.toString=function($){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions($))};et.prototype.isEqualNode=function($){if(!et.__super__.isEqualNode.apply(this,arguments).isEqualNode($)){return false}if($.target!==this.target){return false}return true};return et}(en)}).call(this)},7641:function($,ee,et){(function(){var ee,en,ei,eo=function($,ee){for(var et in ee){if(es.call(ee,et))$[et]=ee[et]}function en(){this.constructor=$}en.prototype=ee.prototype;$.prototype=new en;$.__super__=ee.prototype;return $},es={}.hasOwnProperty;ee=et(8745);en=et(630);$.exports=ei=function($){eo(et,$);function et($,en){et.__super__.constructor.call(this,$);if(en==null){throw new Error("Missing raw text. "+this.debugInfo())}this.type=ee.Raw;this.value=this.stringify.raw(en)}et.prototype.clone=function(){return Object.create(this)};et.prototype.toString=function($){return this.options.writer.raw(this,this.options.writer.filterOptions($))};return et}(en)}).call(this)},1479:function($,ee,et){(function(){var ee,en,ei,eo,es=function($,ee){for(var et in ee){if(eu.call(ee,et))$[et]=ee[et]}function en(){this.constructor=$}en.prototype=ee.prototype;$.prototype=new en;$.__super__=ee.prototype;return $},eu={}.hasOwnProperty;ee=et(8745);eo=et(5859);en=et(6530);$.exports=ei=function($){es(et,$);function et($,ee){this.stream=$;et.__super__.constructor.call(this,ee)}et.prototype.endline=function($,ee,ei){if($.isLastRootNode&&ee.state===en.CloseTag){return""}else{return et.__super__.endline.call(this,$,ee,ei)}};et.prototype.document=function($,ee){var et,en,ei,eo,es,eu,el,ef,ed;el=$.children;for(en=ei=0,es=el.length;ei<es;en=++ei){et=el[en];et.isLastRootNode=en===$.children.length-1}ee=this.filterOptions(ee);ef=$.children;ed=[];for(eo=0,eu=ef.length;eo<eu;eo++){et=ef[eo];ed.push(this.writeChildNode(et,ee,0))}return ed};et.prototype.attribute=function($,ee,en){return this.stream.write(et.__super__.attribute.call(this,$,ee,en))};et.prototype.cdata=function($,ee,en){return this.stream.write(et.__super__.cdata.call(this,$,ee,en))};et.prototype.comment=function($,ee,en){return this.stream.write(et.__super__.comment.call(this,$,ee,en))};et.prototype.declaration=function($,ee,en){return this.stream.write(et.__super__.declaration.call(this,$,ee,en))};et.prototype.docType=function($,ee,et){var ei,eo,es,eu;et||(et=0);this.openNode($,ee,et);ee.state=en.OpenTag;this.stream.write(this.indent($,ee,et));this.stream.write("<!DOCTYPE "+$.root().name);if($.pubID&&$.sysID){this.stream.write(' PUBLIC "'+$.pubID+'" "'+$.sysID+'"')}else if($.sysID){this.stream.write(' SYSTEM "'+$.sysID+'"')}if($.children.length>0){this.stream.write(" [");this.stream.write(this.endline($,ee,et));ee.state=en.InsideTag;eu=$.children;for(eo=0,es=eu.length;eo<es;eo++){ei=eu[eo];this.writeChildNode(ei,ee,et+1)}ee.state=en.CloseTag;this.stream.write("]")}ee.state=en.CloseTag;this.stream.write(ee.spaceBeforeSlash+">");this.stream.write(this.endline($,ee,et));ee.state=en.None;return this.closeNode($,ee,et)};et.prototype.element=function($,et,ei){var eo,es,el,ef,ed,ep,eh,ey,eg,em;ei||(ei=0);this.openNode($,et,ei);et.state=en.OpenTag;this.stream.write(this.indent($,et,ei)+"<"+$.name);eg=$.attribs;for(eh in eg){if(!eu.call(eg,eh))continue;eo=eg[eh];this.attribute(eo,et,ei)}el=$.children.length;ef=el===0?null:$.children[0];if(el===0||$.children.every(function($){return($.type===ee.Text||$.type===ee.Raw)&&$.value===""})){if(et.allowEmpty){this.stream.write(">");et.state=en.CloseTag;this.stream.write("</"+$.name+">")}else{et.state=en.CloseTag;this.stream.write(et.spaceBeforeSlash+"/>")}}else if(et.pretty&&el===1&&(ef.type===ee.Text||ef.type===ee.Raw)&&ef.value!=null){this.stream.write(">");et.state=en.InsideTag;et.suppressPrettyCount++;ey=true;this.writeChildNode(ef,et,ei+1);et.suppressPrettyCount--;ey=false;et.state=en.CloseTag;this.stream.write("</"+$.name+">")}else{this.stream.write(">"+this.endline($,et,ei));et.state=en.InsideTag;em=$.children;for(ed=0,ep=em.length;ed<ep;ed++){es=em[ed];this.writeChildNode(es,et,ei+1)}et.state=en.CloseTag;this.stream.write(this.indent($,et,ei)+"</"+$.name+">")}this.stream.write(this.endline($,et,ei));et.state=en.None;return this.closeNode($,et,ei)};et.prototype.processingInstruction=function($,ee,en){return this.stream.write(et.__super__.processingInstruction.call(this,$,ee,en))};et.prototype.raw=function($,ee,en){return this.stream.write(et.__super__.raw.call(this,$,ee,en))};et.prototype.text=function($,ee,en){return this.stream.write(et.__super__.text.call(this,$,ee,en))};et.prototype.dtdAttList=function($,ee,en){return this.stream.write(et.__super__.dtdAttList.call(this,$,ee,en))};et.prototype.dtdElement=function($,ee,en){return this.stream.write(et.__super__.dtdElement.call(this,$,ee,en))};et.prototype.dtdEntity=function($,ee,en){return this.stream.write(et.__super__.dtdEntity.call(this,$,ee,en))};et.prototype.dtdNotation=function($,ee,en){return this.stream.write(et.__super__.dtdNotation.call(this,$,ee,en))};return et}(eo)}).call(this)},1663:function($,ee,et){(function(){var ee,en,ei=function($,ee){for(var et in ee){if(eo.call(ee,et))$[et]=ee[et]}function en(){this.constructor=$}en.prototype=ee.prototype;$.prototype=new en;$.__super__=ee.prototype;return $},eo={}.hasOwnProperty;en=et(5859);$.exports=ee=function($){ei(ee,$);function ee($){ee.__super__.constructor.call(this,$)}ee.prototype.document=function($,ee){var et,en,ei,eo,es;ee=this.filterOptions(ee);eo="";es=$.children;for(en=0,ei=es.length;en<ei;en++){et=es[en];eo+=this.writeChildNode(et,ee,0)}if(ee.pretty&&eo.slice(-ee.newline.length)===ee.newline){eo=eo.slice(0,-ee.newline.length)}return eo};return ee}(en)}).call(this)},8365:function($){(function(){var ee,et=function($,ee){return function(){return $.apply(ee,arguments)}},en={}.hasOwnProperty;$.exports=ee=function(){function $($){this.assertLegalName=et(this.assertLegalName,this);this.assertLegalChar=et(this.assertLegalChar,this);var ee,ei,eo;$||($={});this.options=$;if(!this.options.version){this.options.version="1.0"}ei=$.stringify||{};for(ee in ei){if(!en.call(ei,ee))continue;eo=ei[ee];this[ee]=eo}}$.prototype.name=function($){if(this.options.noValidation){return $}return this.assertLegalName(""+$||"")};$.prototype.text=function($){if(this.options.noValidation){return $}return this.assertLegalChar(this.textEscape(""+$||""))};$.prototype.cdata=function($){if(this.options.noValidation){return $}$=""+$||"";$=$.replace("]]>","]]]]><![CDATA[>");return this.assertLegalChar($)};$.prototype.comment=function($){if(this.options.noValidation){return $}$=""+$||"";if($.match(/--/)){throw new Error("Comment text cannot contain double-hypen: "+$)}return this.assertLegalChar($)};$.prototype.raw=function($){if(this.options.noValidation){return $}return""+$||""};$.prototype.attValue=function($){if(this.options.noValidation){return $}return this.assertLegalChar(this.attEscape($=""+$||""))};$.prototype.insTarget=function($){if(this.options.noValidation){return $}return this.assertLegalChar(""+$||"")};$.prototype.insValue=function($){if(this.options.noValidation){return $}$=""+$||"";if($.match(/\?>/)){throw new Error("Invalid processing instruction value: "+$)}return this.assertLegalChar($)};$.prototype.xmlVersion=function($){if(this.options.noValidation){return $}$=""+$||"";if(!$.match(/1\.[0-9]+/)){throw new Error("Invalid version number: "+$)}return $};$.prototype.xmlEncoding=function($){if(this.options.noValidation){return $}$=""+$||"";if(!$.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)){throw new Error("Invalid encoding: "+$)}return this.assertLegalChar($)};$.prototype.xmlStandalone=function($){if(this.options.noValidation){return $}if($){return"yes"}else{return"no"}};$.prototype.dtdPubID=function($){if(this.options.noValidation){return $}return this.assertLegalChar(""+$||"")};$.prototype.dtdSysID=function($){if(this.options.noValidation){return $}return this.assertLegalChar(""+$||"")};$.prototype.dtdElementValue=function($){if(this.options.noValidation){return $}return this.assertLegalChar(""+$||"")};$.prototype.dtdAttType=function($){if(this.options.noValidation){return $}return this.assertLegalChar(""+$||"")};$.prototype.dtdAttDefault=function($){if(this.options.noValidation){return $}return this.assertLegalChar(""+$||"")};$.prototype.dtdEntityValue=function($){if(this.options.noValidation){return $}return this.assertLegalChar(""+$||"")};$.prototype.dtdNData=function($){if(this.options.noValidation){return $}return this.assertLegalChar(""+$||"")};$.prototype.convertAttKey="@";$.prototype.convertPIKey="?";$.prototype.convertTextKey="#text";$.prototype.convertCDataKey="#cdata";$.prototype.convertCommentKey="#comment";$.prototype.convertRawKey="#raw";$.prototype.assertLegalChar=function($){var ee,et;if(this.options.noValidation){return $}ee="";if(this.options.version==="1.0"){ee=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;if(et=$.match(ee)){throw new Error("Invalid character in string: "+$+" at index "+et.index)}}else if(this.options.version==="1.1"){ee=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;if(et=$.match(ee)){throw new Error("Invalid character in string: "+$+" at index "+et.index)}}return $};$.prototype.assertLegalName=function($){var ee;if(this.options.noValidation){return $}this.assertLegalChar($);ee=/^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/;if(!$.match(ee)){throw new Error("Invalid character in name")}return $};$.prototype.textEscape=function($){var ee;if(this.options.noValidation){return $}ee=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return $.replace(ee,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r/g,"&#xD;")};$.prototype.attEscape=function($){var ee;if(this.options.noValidation){return $}ee=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g;return $.replace(ee,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;")};return $}()}).call(this)},4306:function($,ee,et){(function(){var ee,en,ei,eo=function($,ee){for(var et in ee){if(es.call(ee,et))$[et]=ee[et]}function en(){this.constructor=$}en.prototype=ee.prototype;$.prototype=new en;$.__super__=ee.prototype;return $},es={}.hasOwnProperty;ee=et(8745);en=et(4356);$.exports=ei=function($){eo(et,$);function et($,en){et.__super__.constructor.call(this,$);if(en==null){throw new Error("Missing element text. "+this.debugInfo())}this.name="#text";this.type=ee.Text;this.value=this.stringify.text(en)}Object.defineProperty(et.prototype,"isElementContentWhitespace",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}});Object.defineProperty(et.prototype,"wholeText",{get:function(){var $,ee,et;et="";ee=this.previousSibling;while(ee){et=ee.data+et;ee=ee.previousSibling}et+=this.data;$=this.nextSibling;while($){et=et+$.data;$=$.nextSibling}return et}});et.prototype.clone=function(){return Object.create(this)};et.prototype.toString=function($){return this.options.writer.text(this,this.options.writer.filterOptions($))};et.prototype.splitText=function($){throw new Error("This DOM method is not implemented."+this.debugInfo())};et.prototype.replaceWholeText=function($){throw new Error("This DOM method is not implemented."+this.debugInfo())};return et}(en)}).call(this)},5859:function($,ee,et){(function(){var ee,en,ei,eo,es,eu,el,ef,ed,ep,eh,ey,eg,em,e_,ew,eE,eS={}.hasOwnProperty;eE=et(8676).assign;ee=et(8745);ed=et(2308);ep=et(6808);ei=et(9877);eo=et(2374);ey=et(5725);em=et(7641);e_=et(4306);eg=et(3402);eh=et(4402);es=et(4131);eu=et(7338);el=et(7834);ef=et(8507);en=et(6530);$.exports=ew=function(){function $($){var ee,et,en;$||($={});this.options=$;et=$.writer||{};for(ee in et){if(!eS.call(et,ee))continue;en=et[ee];this["_"+ee]=this[ee];this[ee]=en}}$.prototype.filterOptions=function($){var ee,et,ei,eo,es,eu,el,ef;$||($={});$=eE({},this.options,$);ee={writer:this};ee.pretty=$.pretty||false;ee.allowEmpty=$.allowEmpty||false;ee.indent=(et=$.indent)!=null?et:" ";ee.newline=(ei=$.newline)!=null?ei:"\n";ee.offset=(eo=$.offset)!=null?eo:0;ee.dontPrettyTextNodes=(es=(eu=$.dontPrettyTextNodes)!=null?eu:$.dontprettytextnodes)!=null?es:0;ee.spaceBeforeSlash=(el=(ef=$.spaceBeforeSlash)!=null?ef:$.spacebeforeslash)!=null?el:"";if(ee.spaceBeforeSlash===true){ee.spaceBeforeSlash=" "}ee.suppressPrettyCount=0;ee.user={};ee.state=en.None;return ee};$.prototype.indent=function($,ee,et){var en;if(!ee.pretty||ee.suppressPrettyCount){return""}else if(ee.pretty){en=(et||0)+ee.offset+1;if(en>0){return new Array(en).join(ee.indent)}}return""};$.prototype.endline=function($,ee,et){if(!ee.pretty||ee.suppressPrettyCount){return""}else{return ee.newline}};$.prototype.attribute=function($,ee,et){var en;this.openAttribute($,ee,et);en=" "+$.name+'="'+$.value+'"';this.closeAttribute($,ee,et);return en};$.prototype.cdata=function($,ee,et){var ei;this.openNode($,ee,et);ee.state=en.OpenTag;ei=this.indent($,ee,et)+"<![CDATA[";ee.state=en.InsideTag;ei+=$.value;ee.state=en.CloseTag;ei+="]]>"+this.endline($,ee,et);ee.state=en.None;this.closeNode($,ee,et);return ei};$.prototype.comment=function($,ee,et){var ei;this.openNode($,ee,et);ee.state=en.OpenTag;ei=this.indent($,ee,et)+"<!-- ";ee.state=en.InsideTag;ei+=$.value;ee.state=en.CloseTag;ei+=" -->"+this.endline($,ee,et);ee.state=en.None;this.closeNode($,ee,et);return ei};$.prototype.declaration=function($,ee,et){var ei;this.openNode($,ee,et);ee.state=en.OpenTag;ei=this.indent($,ee,et)+"<?xml";ee.state=en.InsideTag;ei+=' version="'+$.version+'"';if($.encoding!=null){ei+=' encoding="'+$.encoding+'"'}if($.standalone!=null){ei+=' standalone="'+$.standalone+'"'}ee.state=en.CloseTag;ei+=ee.spaceBeforeSlash+"?>";ei+=this.endline($,ee,et);ee.state=en.None;this.closeNode($,ee,et);return ei};$.prototype.docType=function($,ee,et){var ei,eo,es,eu,el;et||(et=0);this.openNode($,ee,et);ee.state=en.OpenTag;eu=this.indent($,ee,et);eu+="<!DOCTYPE "+$.root().name;if($.pubID&&$.sysID){eu+=' PUBLIC "'+$.pubID+'" "'+$.sysID+'"'}else if($.sysID){eu+=' SYSTEM "'+$.sysID+'"'}if($.children.length>0){eu+=" [";eu+=this.endline($,ee,et);ee.state=en.InsideTag;el=$.children;for(eo=0,es=el.length;eo<es;eo++){ei=el[eo];eu+=this.writeChildNode(ei,ee,et+1)}ee.state=en.CloseTag;eu+="]"}ee.state=en.CloseTag;eu+=ee.spaceBeforeSlash+">";eu+=this.endline($,ee,et);ee.state=en.None;this.closeNode($,ee,et);return eu};$.prototype.element=function($,et,ei){var eo,es,eu,el,ef,ed,ep,eh,ey,eg,em,e_,ew,eE;ei||(ei=0);eg=false;em="";this.openNode($,et,ei);et.state=en.OpenTag;em+=this.indent($,et,ei)+"<"+$.name;e_=$.attribs;for(ey in e_){if(!eS.call(e_,ey))continue;eo=e_[ey];em+=this.attribute(eo,et,ei)}eu=$.children.length;el=eu===0?null:$.children[0];if(eu===0||$.children.every(function($){return($.type===ee.Text||$.type===ee.Raw)&&$.value===""})){if(et.allowEmpty){em+=">";et.state=en.CloseTag;em+="</"+$.name+">"+this.endline($,et,ei)}else{et.state=en.CloseTag;em+=et.spaceBeforeSlash+"/>"+this.endline($,et,ei)}}else if(et.pretty&&eu===1&&(el.type===ee.Text||el.type===ee.Raw)&&el.value!=null){em+=">";et.state=en.InsideTag;et.suppressPrettyCount++;eg=true;em+=this.writeChildNode(el,et,ei+1);et.suppressPrettyCount--;eg=false;et.state=en.CloseTag;em+="</"+$.name+">"+this.endline($,et,ei)}else{if(et.dontPrettyTextNodes){ew=$.children;for(ef=0,ep=ew.length;ef<ep;ef++){es=ew[ef];if((es.type===ee.Text||es.type===ee.Raw)&&es.value!=null){et.suppressPrettyCount++;eg=true;break}}}em+=">"+this.endline($,et,ei);et.state=en.InsideTag;eE=$.children;for(ed=0,eh=eE.length;ed<eh;ed++){es=eE[ed];em+=this.writeChildNode(es,et,ei+1)}et.state=en.CloseTag;em+=this.indent($,et,ei)+"</"+$.name+">";if(eg){et.suppressPrettyCount--}em+=this.endline($,et,ei);et.state=en.None}this.closeNode($,et,ei);return em};$.prototype.writeChildNode=function($,et,en){switch($.type){case ee.CData:return this.cdata($,et,en);case ee.Comment:return this.comment($,et,en);case ee.Element:return this.element($,et,en);case ee.Raw:return this.raw($,et,en);case ee.Text:return this.text($,et,en);case ee.ProcessingInstruction:return this.processingInstruction($,et,en);case ee.Dummy:return"";case ee.Declaration:return this.declaration($,et,en);case ee.DocType:return this.docType($,et,en);case ee.AttributeDeclaration:return this.dtdAttList($,et,en);case ee.ElementDeclaration:return this.dtdElement($,et,en);case ee.EntityDeclaration:return this.dtdEntity($,et,en);case ee.NotationDeclaration:return this.dtdNotation($,et,en);default:throw new Error("Unknown XML node type: "+$.constructor.name)}};$.prototype.processingInstruction=function($,ee,et){var ei;this.openNode($,ee,et);ee.state=en.OpenTag;ei=this.indent($,ee,et)+"<?";ee.state=en.InsideTag;ei+=$.target;if($.value){ei+=" "+$.value}ee.state=en.CloseTag;ei+=ee.spaceBeforeSlash+"?>";ei+=this.endline($,ee,et);ee.state=en.None;this.closeNode($,ee,et);return ei};$.prototype.raw=function($,ee,et){var ei;this.openNode($,ee,et);ee.state=en.OpenTag;ei=this.indent($,ee,et);ee.state=en.InsideTag;ei+=$.value;ee.state=en.CloseTag;ei+=this.endline($,ee,et);ee.state=en.None;this.closeNode($,ee,et);return ei};$.prototype.text=function($,ee,et){var ei;this.openNode($,ee,et);ee.state=en.OpenTag;ei=this.indent($,ee,et);ee.state=en.InsideTag;ei+=$.value;ee.state=en.CloseTag;ei+=this.endline($,ee,et);ee.state=en.None;this.closeNode($,ee,et);return ei};$.prototype.dtdAttList=function($,ee,et){var ei;this.openNode($,ee,et);ee.state=en.OpenTag;ei=this.indent($,ee,et)+"<!ATTLIST";ee.state=en.InsideTag;ei+=" "+$.elementName+" "+$.attributeName+" "+$.attributeType;if($.defaultValueType!=="#DEFAULT"){ei+=" "+$.defaultValueType}if($.defaultValue){ei+=' "'+$.defaultValue+'"'}ee.state=en.CloseTag;ei+=ee.spaceBeforeSlash+">"+this.endline($,ee,et);ee.state=en.None;this.closeNode($,ee,et);return ei};$.prototype.dtdElement=function($,ee,et){var ei;this.openNode($,ee,et);ee.state=en.OpenTag;ei=this.indent($,ee,et)+"<!ELEMENT";ee.state=en.InsideTag;ei+=" "+$.name+" "+$.value;ee.state=en.CloseTag;ei+=ee.spaceBeforeSlash+">"+this.endline($,ee,et);ee.state=en.None;this.closeNode($,ee,et);return ei};$.prototype.dtdEntity=function($,ee,et){var ei;this.openNode($,ee,et);ee.state=en.OpenTag;ei=this.indent($,ee,et)+"<!ENTITY";ee.state=en.InsideTag;if($.pe){ei+=" %"}ei+=" "+$.name;if($.value){ei+=' "'+$.value+'"'}else{if($.pubID&&$.sysID){ei+=' PUBLIC "'+$.pubID+'" "'+$.sysID+'"'}else if($.sysID){ei+=' SYSTEM "'+$.sysID+'"'}if($.nData){ei+=" NDATA "+$.nData}}ee.state=en.CloseTag;ei+=ee.spaceBeforeSlash+">"+this.endline($,ee,et);ee.state=en.None;this.closeNode($,ee,et);return ei};$.prototype.dtdNotation=function($,ee,et){var ei;this.openNode($,ee,et);ee.state=en.OpenTag;ei=this.indent($,ee,et)+"<!NOTATION";ee.state=en.InsideTag;ei+=" "+$.name;if($.pubID&&$.sysID){ei+=' PUBLIC "'+$.pubID+'" "'+$.sysID+'"'}else if($.pubID){ei+=' PUBLIC "'+$.pubID+'"'}else if($.sysID){ei+=' SYSTEM "'+$.sysID+'"'}ee.state=en.CloseTag;ei+=ee.spaceBeforeSlash+">"+this.endline($,ee,et);ee.state=en.None;this.closeNode($,ee,et);return ei};$.prototype.openNode=function($,ee,et){};$.prototype.closeNode=function($,ee,et){};$.prototype.openAttribute=function($,ee,et){};$.prototype.closeAttribute=function($,ee,et){};return $}()}).call(this)},9374:function($,ee,et){(function(){var ee,en,ei,eo,es,eu,el,ef,ed,ep;ep=et(8676),ef=ep.assign,ed=ep.isFunction;ei=et(4016);eo=et(1888);es=et(2621);el=et(1663);eu=et(1479);ee=et(8745);en=et(6530);$.exports.create=function($,ee,et,en){var ei,es;if($==null){throw new Error("Root element needs a name.")}en=ef({},ee,et,en);ei=new eo(en);es=ei.element($);if(!en.headless){ei.declaration(en);if(en.pubID!=null||en.sysID!=null){ei.dtd(en)}}return es};$.exports.begin=function($,ee,et){var en;if(ed($)){en=[$,ee],ee=en[0],et=en[1];$={}}if(ee){return new es($,ee,et)}else{return new eo($)}};$.exports.stringWriter=function($){return new el($)};$.exports.streamWriter=function($,ee){return new eu($,ee)};$.exports.implementation=new ei;$.exports.nodeType=ee;$.exports.writerState=en}).call(this)},5070:function($,ee){var et,en,ei;(function(eo,es){if(true){!(en=[],et=es,ei=typeof et==="function"?et.apply(ee,en):et,ei!==undefined&&($.exports=ei))}else{}})(this,function(){"use strict";function $($,ee){function et(){this.constructor=$}et.prototype=ee.prototype;$.prototype=new et}function ee($,et,en,ei){var eo=Error.call(this,$);if(Object.setPrototypeOf){Object.setPrototypeOf(eo,ee.prototype)}eo.expected=et;eo.found=en;eo.location=ei;eo.name="SyntaxError";return eo}$(ee,Error);function et($,ee,et){et=et||" ";if($.length>ee){return $}ee-=$.length;et+=et.repeat(ee);return $+et.slice(0,ee)}ee.prototype.format=function($){var ee="Error: "+this.message;if(this.location){var en=null;var ei;for(ei=0;ei<$.length;ei++){if($[ei].source===this.location.source){en=$[ei].text.split(/\r\n|\n|\r/g);break}}var eo=this.location.start;var es=this.location.source&&typeof this.location.source.offset==="function"?this.location.source.offset(eo):eo;var eu=this.location.source+":"+es.line+":"+es.column;if(en){var el=this.location.end;var ef=et("",es.line.toString().length," ");var ed=en[eo.line-1];var ep=eo.line===el.line?el.column:ed.length+1;var eh=ep-eo.column||1;ee+="\n --> "+eu+"\n"+ef+" |\n"+es.line+" | "+ed+"\n"+ef+" | "+et("",eo.column-1," ")+et("",eh,"^")}else{ee+="\n at "+eu}}return ee};ee.buildMessage=function($,ee){var et={literal:function($){return'"'+ei($.text)+'"'},class:function($){var ee=$.parts.map(function($){return Array.isArray($)?eo($[0])+"-"+eo($[1]):eo($)});return"["+($.inverted?"^":"")+ee.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function($){return $.description}};function en($){return $.charCodeAt(0).toString(16).toUpperCase()}function ei($){return $.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function($){return"\\x0"+en($)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function($){return"\\x"+en($)})}function eo($){return $.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function($){return"\\x0"+en($)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function($){return"\\x"+en($)})}function es($){return et[$.type]($)}function eu($){var ee=$.map(es);var et,en;ee.sort();if(ee.length>0){for(et=1,en=1;et<ee.length;et++){if(ee[et-1]!==ee[et]){ee[en]=ee[et];en++}}ee.length=en}switch(ee.length){case 1:return ee[0];case 2:return ee[0]+" or "+ee[1];default:return ee.slice(0,-1).join(", ")+", or "+ee[ee.length-1]}}function el($){return $?'"'+ei($)+'"':"end of input"}return"Expected "+eu($)+" but "+el(ee)+" found."};function en($,et){et=et!==undefined?et:{};var en={};var ei=et.grammarSource;var eo={expr:eK};var es=eK;var eu="source";var el="sink";var ef=" ";var ed=/^[0-9]/;var ep=eU("source",false);var eh=eU("sink",false);var ey=ez("space");var eg=eU(" ",false);var em=ez("digit");var e_=ej([["0","9"]],false,false);var ew=ez("weight");var eE=function(){return{type:"source"}};var eS=function($){return{type:"sink",weight:+$||1}};var eT=function($){return+$};var eO=0;var eA=0;var eI=[{line:1,column:1}];var eN=0;var eD=[];var eR=0;var eC;if("startRule"in et){if(!(et.startRule in eo)){throw new Error("Can't start parsing from rule \""+et.startRule+'".')}es=eo[et.startRule]}function ek(){return $.substring(eA,eO)}function eM(){return eA}function eL(){return{source:ei,start:eA,end:eO}}function eP(){return e$(eA,eO)}function eF(ee,et){et=et!==undefined?et:e$(eA,eO);throw eY([ez(ee)],$.substring(eA,eO),et)}function eB($,ee){ee=ee!==undefined?ee:e$(eA,eO);throw eG($,ee)}function eU($,ee){return{type:"literal",text:$,ignoreCase:ee}}function ej($,ee,et){return{type:"class",parts:$,inverted:ee,ignoreCase:et}}function eW(){return{type:"any"}}function eH(){return{type:"end"}}function ez($){return{type:"other",description:$}}function eV(ee){var et=eI[ee];var en;if(et){return et}else{en=ee-1;while(!eI[en]){en--}et=eI[en];et={line:et.line,column:et.column};while(en<ee){if($.charCodeAt(en)===10){et.line++;et.column=1}else{et.column++}en++}eI[ee]=et;return et}}function e$($,ee,et){var en=eV($);var eo=eV(ee);var es={source:ei,start:{offset:$,line:en.line,column:en.column},end:{offset:ee,line:eo.line,column:eo.column}};if(et&&ei&&typeof ei.offset==="function"){es.start=ei.offset(es.start);es.end=ei.offset(es.end)}return es}function eq($){if(eO<eN){return}if(eO>eN){eN=eO;eD=[]}eD.push($)}function eG($,et){return new ee($,null,null,et)}function eY($,et,en){return new ee(ee.buildMessage($,et),$,et,en)}function eK(){var $,ee,et,ei;$=eO;ee=eZ();if(ee!==en){eA=$;ee=eE()}$=ee;if($===en){$=eO;ee=eJ();if(ee!==en){et=eX();if(et===en){et=null}ei=e0();if(ei===en){ei=null}eA=$;$=eS(ei)}else{eO=$;$=en}}return $}function eZ(){var ee;if($.substr(eO,6)===eu){ee=eu;eO+=6}else{ee=en;if(eR===0){eq(ep)}}return ee}function eJ(){var ee;if($.substr(eO,4)===el){ee=el;eO+=4}else{ee=en;if(eR===0){eq(eh)}}return ee}function eX(){var ee,et;eR++;ee=[];if($.charCodeAt(eO)===32){et=ef;eO++}else{et=en;if(eR===0){eq(eg)}}if(et!==en){while(et!==en){ee.push(et);if($.charCodeAt(eO)===32){et=ef;eO++}else{et=en;if(eR===0){eq(eg)}}}}else{ee=en}eR--;if(ee===en){et=en;if(eR===0){eq(ey)}}return ee}function eQ(){var ee,et;eR++;if(ed.test($.charAt(eO))){ee=$.charAt(eO);eO++}else{ee=en;if(eR===0){eq(e_)}}eR--;if(ee===en){et=en;if(eR===0){eq(em)}}return ee}function e0(){var ee,et,ei,eo;eR++;ee=eO;et=eO;ei=[];eo=eQ();if(eo!==en){while(eo!==en){ei.push(eo);eo=eQ()}}else{ei=en}if(ei!==en){et=$.substring(et,eO)}else{et=ei}if(et!==en){eA=ee;et=eT(et)}ee=et;eR--;if(ee===en){et=en;if(eR===0){eq(ew)}}return ee}eC=es();if(eC!==en&&eO===$.length){return eC}else{if(eC!==en&&eO<$.length){eq(eH())}throw eY(eD,eN<$.length?$.charAt(eN):null,eN<$.length?e$(eN,eN+1):e$(eN,eN))}}return{SyntaxError:ee,parse:en}})},4939:function($,ee){var et,en,ei;(function(eo,es){if(true){!(en=[],et=es,ei=typeof et==="function"?et.apply(ee,en):et,ei!==undefined&&($.exports=ei))}else{}})(this,function(){"use strict";function $($,ee){function et(){this.constructor=$}et.prototype=ee.prototype;$.prototype=new et}function ee($,et,en,ei){var eo=Error.call(this,$);if(Object.setPrototypeOf){Object.setPrototypeOf(eo,ee.prototype)}eo.expected=et;eo.found=en;eo.location=ei;eo.name="SyntaxError";return eo}$(ee,Error);function et($,ee,et){et=et||" ";if($.length>ee){return $}ee-=$.length;et+=et.repeat(ee);return $+et.slice(0,ee)}ee.prototype.format=function($){var ee="Error: "+this.message;if(this.location){var en=null;var ei;for(ei=0;ei<$.length;ei++){if($[ei].source===this.location.source){en=$[ei].text.split(/\r\n|\n|\r/g);break}}var eo=this.location.start;var es=this.location.source&&typeof this.location.source.offset==="function"?this.location.source.offset(eo):eo;var eu=this.location.source+":"+es.line+":"+es.column;if(en){var el=this.location.end;var ef=et("",es.line.toString().length," ");var ed=en[eo.line-1];var ep=eo.line===el.line?el.column:ed.length+1;var eh=ep-eo.column||1;ee+="\n --> "+eu+"\n"+ef+" |\n"+es.line+" | "+ed+"\n"+ef+" | "+et("",eo.column-1," ")+et("",eh,"^")}else{ee+="\n at "+eu}}return ee};ee.buildMessage=function($,ee){var et={literal:function($){return'"'+ei($.text)+'"'},class:function($){var ee=$.parts.map(function($){return Array.isArray($)?eo($[0])+"-"+eo($[1]):eo($)});return"["+($.inverted?"^":"")+ee.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function($){return $.description}};function en($){return $.charCodeAt(0).toString(16).toUpperCase()}function ei($){return $.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function($){return"\\x0"+en($)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function($){return"\\x"+en($)})}function eo($){return $.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function($){return"\\x0"+en($)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function($){return"\\x"+en($)})}function es($){return et[$.type]($)}function eu($){var ee=$.map(es);var et,en;ee.sort();if(ee.length>0){for(et=1,en=1;et<ee.length;et++){if(ee[et-1]!==ee[et]){ee[en]=ee[et];en++}}ee.length=en}switch(ee.length){case 1:return ee[0];case 2:return ee[0]+" or "+ee[1];default:return ee.slice(0,-1).join(", ")+", or "+ee[ee.length-1]}}function el($){return $?'"'+ei($)+'"':"end of input"}return"Expected "+eu($)+" but "+el(ee)+" found."};function en($,et){et=et!==undefined?et:{};var en={};var ei=et.grammarSource;var eo={expr:rc};var es=rc;var eu="month";var el="months";var ef="year";var ed="years";var ep="hold";var eh="previous";var ey="spend";var eg="from";var em="week";var e_="weeks";var ew="by";var eE="of";var eS="repeat";var eT="every";var eO="starting";var eA="up";var eI="to";var eN="schedule";var eD="full";var eR="-";var eC="remainder";var ek=" ";var eM=".";var eL="%";var eP=/^[0-9]/;var eF=/^[1-9]/;var eB=/^[^\r\n\t]/;var eU=rr("repeat interval");var ej=t8("month",true);var eW=t8("months",true);var eH=t8("year",true);var ez=t8("years",true);var eV=t8("hold",true);var e$=t8("previous",true);var eq=t8("spend",true);var eG=t8("from",true);var eY=t8("week",true);var eK=t8("weeks",true);var eZ=t8("by",true);var eJ=t8("of",true);var eX=t8("repeat",true);var eQ=t8("every",true);var e0=t8("starting",true);var e1=t8("up",true);var e2=t8("to",true);var e6=t8("schedule",true);var e4=t8("full",true);var e3=t8("-",true);var e8=t8("remainder",true);var e5=rr("space");var e9=t8(" ",false);var e7=rr("digit");var te=t5([["0","9"]],false,false);var tt=rr("number");var tr=t5([["1","9"]],false,false);var tn=rr("amount");var ti=t8(".",false);var tu=rr("percentage");var tc=t8("%",false);var tf=rr("year");var td=rr("month");var tp=t8("-",false);var th=rr("day");var ty=rr("currency symbol");var tm=t9();var t_=rr("Name");var tv=t5(["\r","\n"," "],true,false);var tw=function($,ee,et){return{type:"percentage",percent:+ee.percent,previous:ee.prev,category:et,priority:+$}};var tE=function($,ee,et,en,ei){return{type:"week",amount:ee,weeks:et,starting:en,limit:ei,priority:+$}};var tS=function($,ee,et,en,ei){return{type:en?"spend":"by",amount:ee,month:et,...ei?ei[3]:{},from:en,priority:+$}};var tT=function($,ee,et){return{type:"simple",monthly:ee,limit:et,priority:+$}};var tO=function($,ee){return{type:"simple",limit:ee,priority:+$}};var tA=function($,ee,et){return{type:"schedule",name:et,priority:+$,full:ee}};var tI=function($,ee){return{type:"remainder",priority:null,weight:ee}};var tN=function(){return{annual:false}};var tD=function($){return{annual:false,repeat:+$}};var tR=function(){return{annual:true}};var tC=function($){return{annual:true,repeat:+$}};var tk=function($){return{amount:$,hold:true}};var tM=function($){return{amount:$,hold:false}};var tL=function($){return{percent:$,prev:true}};var tx=function($){return{percent:$,prev:false}};var tP=function(){return null};var tF=function($){return+$};var tB=function($){return $};var tU=function(){return true};var tj=function($){return $};var tW=function($){return+$||1};var tH=function($){return+$};var tz=function($){return+$};var tV=function($){return/\p{Sc}/u.test($)};var t$=0;var tq=0;var tG=[{line:1,column:1}];var tY=0;var tK=[];var tZ=0;var tJ;if("startRule"in et){if(!(et.startRule in eo)){throw new Error("Can't start parsing from rule \""+et.startRule+'".')}es=eo[et.startRule]}function tX(){return $.substring(tq,t$)}function tQ(){return tq}function t0(){return{source:ei,start:tq,end:t$}}function t6(){return ri(tq,t$)}function t4(ee,et){et=et!==undefined?et:ri(tq,t$);throw rl([rr(ee)],$.substring(tq,t$),et)}function t3($,ee){ee=ee!==undefined?ee:ri(tq,t$);throw ru($,ee)}function t8($,ee){return{type:"literal",text:$,ignoreCase:ee}}function t5($,ee,et){return{type:"class",parts:$,inverted:ee,ignoreCase:et}}function t9(){return{type:"any"}}function t7(){return{type:"end"}}function rr($){return{type:"other",description:$}}function rn(ee){var et=tG[ee];var en;if(et){return et}else{en=ee-1;while(!tG[en]){en--}et=tG[en];et={line:et.line,column:et.column};while(en<ee){if($.charCodeAt(en)===10){et.line++;et.column=1}else{et.column++}en++}tG[ee]=et;return et}}function ri($,ee,et){var en=rn($);var eo=rn(ee);var es={source:ei,start:{offset:$,line:en.line,column:en.column},end:{offset:ee,line:eo.line,column:eo.column}};if(et&&ei&&typeof ei.offset==="function"){es.start=ei.offset(es.start);es.end=ei.offset(es.end)}return es}function ro($){if(t$<tY){return}if(t$>tY){tY=t$;tK=[]}tK.push($)}function ru($,et){return new ee($,null,null,et)}function rl($,et,en){return new ee(ee.buildMessage($,et),$,et,en)}function rc(){var $,ee,et,ei,eo,es,eu,el,ef,ed,ep,eh,ey,eg;$=t$;ee=rI();if(ee===en){ee=null}et=rD();if(et===en){et=null}ei=rh();if(ei!==en){eo=rW();if(eo!==en){tq=$;$=tw(ee,ei,eo)}else{t$=$;$=en}}else{t$=$;$=en}if($===en){$=t$;ee=rI();if(ee===en){ee=null}et=rD();if(et===en){et=null}ei=rM();if(ei!==en){eo=rD();if(eo!==en){es=rE();if(es!==en){eu=rD();if(eu!==en){el=ry();if(el!==en){ef=rD();if(ef!==en){ed=rS();if(ed!==en){ep=rD();if(ep!==en){eh=rU();if(eh!==en){ey=rp();if(ey===en){ey=null}tq=$;$=tE(ee,ei,el,eh,ey)}else{t$=$;$=en}}else{t$=$;$=en}}else{t$=$;$=en}}else{t$=$;$=en}}else{t$=$;$=en}}else{t$=$;$=en}}else{t$=$;$=en}}else{t$=$;$=en}}else{t$=$;$=en}if($===en){$=t$;ee=rI();if(ee===en){ee=null}et=rD();if(et===en){et=null}ei=rM();if(ei!==en){eo=rD();if(eo!==en){es=rv();if(es!==en){eu=rD();if(eu!==en){el=rF();if(el!==en){ef=rg();if(ef===en){ef=null}ed=t$;ep=rD();if(ep!==en){eh=rE();if(eh!==en){ey=rD();if(ey!==en){eg=rf();if(eg!==en){ep=[ep,eh,ey,eg];ed=ep}else{t$=ed;ed=en}}else{t$=ed;ed=en}}else{t$=ed;ed=en}}else{t$=ed;ed=en}if(ed===en){ed=null}tq=$;$=tS(ee,ei,el,ef,ed)}else{t$=$;$=en}}else{t$=$;$=en}}else{t$=$;$=en}}else{t$=$;$=en}}else{t$=$;$=en}if($===en){$=t$;ee=rI();if(ee===en){ee=null}et=rD();if(et===en){et=null}ei=rM();if(ei!==en){eo=rp();if(eo===en){eo=null}tq=$;$=tT(ee,ei,eo)}else{t$=$;$=en}if($===en){$=t$;ee=rI();if(ee===en){ee=null}et=rD();if(et===en){et=null}ei=rp();if(ei!==en){tq=$;$=tO(ee,ei)}else{t$=$;$=en}if($===en){$=t$;ee=rI();if(ee===en){ee=null}et=rD();if(et===en){et=null}ei=rO();if(ei!==en){eo=rD();if(eo!==en){es=rA();if(es===en){es=null}eu=rW();if(eu!==en){tq=$;$=tA(ee,es,eu)}else{t$=$;$=en}}else{t$=$;$=en}}else{t$=$;$=en}if($===en){$=t$;ee=rI();if(ee===en){ee=null}et=rD();if(et===en){et=null}ei=rN();if(ei!==en){tq=$;$=tI(ee,ei)}else{t$=$;$=en}}}}}}}return $}function rf(){var ee,et,ei,eo;tZ++;ee=t$;if($.substr(t$,5).toLowerCase()===eu){et=$.substr(t$,5);t$+=5}else{et=en;if(tZ===0){ro(ej)}}if(et!==en){tq=ee;et=tN()}ee=et;if(ee===en){ee=t$;et=rk();if(et!==en){ei=rD();if(ei!==en){if($.substr(t$,6).toLowerCase()===el){eo=$.substr(t$,6);t$+=6}else{eo=en;if(tZ===0){ro(eW)}}if(eo!==en){tq=ee;ee=tD(et)}else{t$=ee;ee=en}}else{t$=ee;ee=en}}else{t$=ee;ee=en}if(ee===en){ee=t$;if($.substr(t$,4).toLowerCase()===ef){et=$.substr(t$,4);t$+=4}else{et=en;if(tZ===0){ro(eH)}}if(et!==en){tq=ee;et=tR()}ee=et;if(ee===en){ee=t$;et=rk();if(et!==en){ei=rD();if(ei!==en){if($.substr(t$,5).toLowerCase()===ed){eo=$.substr(t$,5);t$+=5}else{eo=en;if(tZ===0){ro(ez)}}if(eo!==en){tq=ee;ee=tC(et)}else{t$=ee;ee=en}}else{t$=ee;ee=en}}else{t$=ee;ee=en}}}}tZ--;if(ee===en){et=en;if(tZ===0){ro(eU)}}return ee}function rp(){var ee,et,ei,eo,es,eu,el;ee=t$;et=rD();if(et===en){et=null}ei=rT();if(ei!==en){eo=rD();if(eo!==en){es=rM();if(es!==en){eu=rD();if(eu!==en){if($.substr(t$,4).toLowerCase()===ep){el=$.substr(t$,4);t$+=4}else{el=en;if(tZ===0){ro(eV)}}if(el!==en){tq=ee;ee=tk(es)}else{t$=ee;ee=en}}else{t$=ee;ee=en}}else{t$=ee;ee=en}}else{t$=ee;ee=en}}else{t$=ee;ee=en}if(ee===en){ee=t$;et=rD();if(et===en){et=null}ei=rT();if(ei!==en){eo=rD();if(eo!==en){es=rM();if(es!==en){tq=ee;ee=tM(es)}else{t$=ee;ee=en}}else{t$=ee;ee=en}}else{t$=ee;ee=en}}return ee}function rh(){var ee,et,ei,eo,es,eu,el;ee=t$;et=rL();if(et!==en){ei=rD();if(ei!==en){eo=rw();if(eo!==en){es=rD();if(es!==en){if($.substr(t$,8).toLowerCase()===eh){eu=$.substr(t$,8);t$+=8}else{eu=en;if(tZ===0){ro(e$)}}if(eu!==en){el=rD();if(el!==en){tq=ee;ee=tL(et)}else{t$=ee;ee=en}}else{t$=ee;ee=en}}else{t$=ee;ee=en}}else{t$=ee;ee=en}}else{t$=ee;ee=en}}else{t$=ee;ee=en}if(ee===en){ee=t$;et=rL();if(et!==en){ei=rD();if(ei!==en){eo=rw();if(eo!==en){es=rD();if(es!==en){tq=ee;ee=tx(et)}else{t$=ee;ee=en}}else{t$=ee;ee=en}}else{t$=ee;ee=en}}else{t$=ee;ee=en}}return ee}function ry(){var $,ee,et,ei;$=t$;ee=rm();if(ee!==en){tq=$;ee=tP()}$=ee;if($===en){$=t$;ee=rC();if(ee!==en){et=rD();if(et!==en){ei=r_();if(ei!==en){tq=$;$=tF(ee)}else{t$=$;$=en}}else{t$=$;$=en}}else{t$=$;$=en}}return $}function rg(){var ee,et,ei,eo,es,eu,el;ee=t$;et=rD();if(et!==en){if($.substr(t$,5).toLowerCase()===ey){ei=$.substr(t$,5);t$+=5}else{ei=en;if(tZ===0){ro(eq)}}if(ei!==en){eo=rD();if(eo!==en){if($.substr(t$,4).toLowerCase()===eg){es=$.substr(t$,4);t$+=4}else{es=en;if(tZ===0){ro(eG)}}if(es!==en){eu=rD();if(eu!==en){el=rF();if(el!==en){tq=ee;ee=tB(el)}else{t$=ee;ee=en}}else{t$=ee;ee=en}}else{t$=ee;ee=en}}else{t$=ee;ee=en}}else{t$=ee;ee=en}}else{t$=ee;ee=en}return ee}function rm(){var ee;if($.substr(t$,4).toLowerCase()===em){ee=$.substr(t$,4);t$+=4}else{ee=en;if(tZ===0){ro(eY)}}return ee}function r_(){var ee;if($.substr(t$,5).toLowerCase()===e_){ee=$.substr(t$,5);t$+=5}else{ee=en;if(tZ===0){ro(eK)}}return ee}function rv(){var ee;if($.substr(t$,2).toLowerCase()===ew){ee=$.substr(t$,2);t$+=2}else{ee=en;if(tZ===0){ro(eZ)}}return ee}function rw(){var ee;if($.substr(t$,2).toLowerCase()===eE){ee=$.substr(t$,2);t$+=2}else{ee=en;if(tZ===0){ro(eJ)}}return ee}function rE(){var ee,et,ei,eo;ee=t$;if($.substr(t$,6).toLowerCase()===eS){et=$.substr(t$,6);t$+=6}else{et=en;if(tZ===0){ro(eX)}}if(et!==en){ei=rD();if(ei!==en){if($.substr(t$,5).toLowerCase()===eT){eo=$.substr(t$,5);t$+=5}else{eo=en;if(tZ===0){ro(eQ)}}if(eo!==en){et=[et,ei,eo];ee=et}else{t$=ee;ee=en}}else{t$=ee;ee=en}}else{t$=ee;ee=en}return ee}function rS(){var ee;if($.substr(t$,8).toLowerCase()===eO){ee=$.substr(t$,8);t$+=8}else{ee=en;if(tZ===0){ro(e0)}}return ee}function rT(){var ee,et,ei,eo;ee=t$;if($.substr(t$,2).toLowerCase()===eA){et=$.substr(t$,2);t$+=2}else{et=en;if(tZ===0){ro(e1)}}if(et!==en){ei=rD();if(ei!==en){if($.substr(t$,2).toLowerCase()===eI){eo=$.substr(t$,2);t$+=2}else{eo=en;if(tZ===0){ro(e2)}}if(eo!==en){et=[et,ei,eo];ee=et}else{t$=ee;ee=en}}else{t$=ee;ee=en}}else{t$=ee;ee=en}return ee}function rO(){var ee;if($.substr(t$,8).toLowerCase()===eN){ee=$.substr(t$,8);t$+=8}else{ee=en;if(tZ===0){ro(e6)}}return ee}function rA(){var ee,et,ei;ee=t$;if($.substr(t$,4).toLowerCase()===eD){et=$.substr(t$,4);t$+=4}else{et=en;if(tZ===0){ro(e4)}}if(et!==en){ei=rD();if(ei!==en){tq=ee;ee=tU()}else{t$=ee;ee=en}}else{t$=ee;ee=en}return ee}function rI(){var ee,et,ei,eo;ee=t$;if($.substr(t$,1).toLowerCase()===eR){et=$.charAt(t$);t$++}else{et=en;if(tZ===0){ro(e3)}}if(et!==en){ei=rC();if(ei!==en){eo=rD();if(eo!==en){tq=ee;ee=tj(ei)}else{t$=ee;ee=en}}else{t$=ee;ee=en}}else{t$=ee;ee=en}return ee}function rN(){var ee,et,ei,eo;ee=t$;if($.substr(t$,9).toLowerCase()===eC){et=$.substr(t$,9);t$+=9}else{et=en;if(tZ===0){ro(e8)}}if(et!==en){ei=rD();if(ei===en){ei=null}eo=rk();if(eo===en){eo=null}tq=ee;ee=tW(eo)}else{t$=ee;ee=en}return ee}function rD(){var ee,et;tZ++;ee=[];if($.charCodeAt(t$)===32){et=ek;t$++}else{et=en;if(tZ===0){ro(e9)}}if(et!==en){while(et!==en){ee.push(et);if($.charCodeAt(t$)===32){et=ek;t$++}else{et=en;if(tZ===0){ro(e9)}}}}else{ee=en}tZ--;if(ee===en){et=en;if(tZ===0){ro(e5)}}return ee}function rR(){var ee,et;tZ++;if(eP.test($.charAt(t$))){ee=$.charAt(t$);t$++}else{ee=en;if(tZ===0){ro(te)}}tZ--;if(ee===en){et=en;if(tZ===0){ro(e7)}}return ee}function rC(){var ee,et,ei;tZ++;ee=t$;et=[];ei=rR();if(ei!==en){while(ei!==en){et.push(ei);ei=rR()}}else{et=en}if(et!==en){ee=$.substring(ee,t$)}else{ee=et}tZ--;if(ee===en){et=en;if(tZ===0){ro(tt)}}return ee}function rk(){var ee,et,ei,eo,es;ee=t$;et=t$;if(eF.test($.charAt(t$))){ei=$.charAt(t$);t$++}else{ei=en;if(tZ===0){ro(tr)}}if(ei!==en){eo=[];if(eP.test($.charAt(t$))){es=$.charAt(t$);t$++}else{es=en;if(tZ===0){ro(te)}}while(es!==en){eo.push(es);if(eP.test($.charAt(t$))){es=$.charAt(t$);t$++}else{es=en;if(tZ===0){ro(te)}}}ei=[ei,eo];et=ei}else{t$=et;et=en}if(et!==en){ee=$.substring(ee,t$)}else{ee=et}return ee}function rM(){var ee,et,ei,eo,es,eu,el,ef,ed,ep,eh;tZ++;ee=t$;et=rj();if(et===en){et=null}ei=rD();if(ei===en){ei=null}eo=t$;es=t$;eu=[];el=rR();if(el!==en){while(el!==en){eu.push(el);el=rR()}}else{eu=en}if(eu!==en){el=t$;if($.charCodeAt(t$)===46){ef=eM;t$++}else{ef=en;if(tZ===0){ro(ti)}}if(ef!==en){ed=t$;ep=rR();if(ep!==en){eh=rR();if(eh===en){eh=null}ep=[ep,eh];ed=ep}else{t$=ed;ed=en}if(ed===en){ed=null}ef=[ef,ed];el=ef}else{t$=el;el=en}if(el===en){el=null}eu=[eu,el];es=eu}else{t$=es;es=en}if(es!==en){eo=$.substring(eo,t$)}else{eo=es}if(eo!==en){tq=ee;ee=tH(eo)}else{t$=ee;ee=en}tZ--;if(ee===en){et=en;if(tZ===0){ro(tn)}}return ee}function rL(){var ee,et,ei,eo;tZ++;ee=t$;et=t$;ei=[];eo=rR();if(eo!==en){while(eo!==en){ei.push(eo);eo=rR()}}else{ei=en}if(ei!==en){et=$.substring(et,t$)}else{et=ei}if(et!==en){ei=rD();if(ei===en){ei=null}if($.charCodeAt(t$)===37){eo=eL;t$++}else{eo=en;if(tZ===0){ro(tc)}}if(eo!==en){tq=ee;ee=tz(et)}else{t$=ee;ee=en}}else{t$=ee;ee=en}tZ--;if(ee===en){et=en;if(tZ===0){ro(tu)}}return ee}function rP(){var ee,et,ei,eo,es,eu;tZ++;ee=t$;et=t$;ei=rR();if(ei!==en){eo=rR();if(eo!==en){es=rR();if(es!==en){eu=rR();if(eu!==en){ei=[ei,eo,es,eu];et=ei}else{t$=et;et=en}}else{t$=et;et=en}}else{t$=et;et=en}}else{t$=et;et=en}if(et!==en){ee=$.substring(ee,t$)}else{ee=et}tZ--;if(ee===en){et=en;if(tZ===0){ro(tf)}}return ee}function rF(){var ee,et,ei,eo,es,eu;tZ++;ee=t$;et=t$;ei=rP();if(ei!==en){if($.charCodeAt(t$)===45){eo=eR;t$++}else{eo=en;if(tZ===0){ro(tp)}}if(eo!==en){es=rR();if(es!==en){eu=rR();if(eu!==en){ei=[ei,eo,es,eu];et=ei}else{t$=et;et=en}}else{t$=et;et=en}}else{t$=et;et=en}}else{t$=et;et=en}if(et!==en){ee=$.substring(ee,t$)}else{ee=et}tZ--;if(ee===en){et=en;if(tZ===0){ro(td)}}return ee}function rB(){var ee,et,ei,eo;tZ++;ee=t$;et=t$;ei=rR();if(ei!==en){eo=rR();if(eo!==en){ei=[ei,eo];et=ei}else{t$=et;et=en}}else{t$=et;et=en}if(et!==en){ee=$.substring(ee,t$)}else{ee=et}tZ--;if(ee===en){et=en;if(tZ===0){ro(th)}}return ee}function rU(){var ee,et,ei,eo,es;ee=t$;et=t$;ei=rF();if(ei!==en){if($.charCodeAt(t$)===45){eo=eR;t$++}else{eo=en;if(tZ===0){ro(tp)}}if(eo!==en){es=rB();if(es!==en){ei=[ei,eo,es];et=ei}else{t$=et;et=en}}else{t$=et;et=en}}else{t$=et;et=en}if(et!==en){ee=$.substring(ee,t$)}else{ee=et}return ee}function rj(){var ee,et,ei;tZ++;ee=t$;if($.length>t$){et=$.charAt(t$);t$++}else{et=en;if(tZ===0){ro(tm)}}if(et!==en){tq=t$;ei=tV(et);if(ei){ei=undefined}else{ei=en}if(ei!==en){et=[et,ei];ee=et}else{t$=ee;ee=en}}else{t$=ee;ee=en}tZ--;if(ee===en){et=en;if(tZ===0){ro(ty)}}return ee}function rW(){var ee,et,ei;tZ++;ee=t$;et=[];if(eB.test($.charAt(t$))){ei=$.charAt(t$);t$++}else{ei=en;if(tZ===0){ro(tv)}}if(ei!==en){while(ei!==en){et.push(ei);if(eB.test($.charAt(t$))){ei=$.charAt(t$);t$++}else{ei=en;if(tZ===0){ro(tv)}}}}else{et=en}if(et!==en){ee=$.substring(ee,t$)}else{ee=et}tZ--;if(ee===en){et=en;if(tZ===0){ro(t_)}}return ee}tJ=es();if(tJ!==en&&t$===$.length){return tJ}else{if(tJ!==en&&t$<$.length){ro(t7())}throw rl(tK,tY<$.length?$.charAt(tY):null,tY<$.length?ri(tY,tY+1):ri(tY,tY))}}return{SyntaxError:ee,parse:en}})},2074:()=>{},1214:()=>{},8119:()=>{},4654:()=>{},2361:()=>{},4616:()=>{},8441:()=>{},3083:($,ee,et)=>{"use strict";var en=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"];var ei=typeof globalThis==="undefined"?et.g:globalThis;$.exports=function $(){var $=[];for(var ee=0;ee<en.length;ee++){if(typeof ei[en[ee]]==="function"){$[$.length]=en[ee]}}return $}},3216:($,ee,et)=>{"use strict";var en=et(4155);var ei=et(2584);var eo=et(6373);if(et(1405)()||et(5419)()){var es=Symbol.iterator;$.exports=function $($){if($!=null&&typeof $[es]!=="undefined"){return $[es]()}if(ei($)){return Array.prototype[es].call($)}}}else{var eu=et(5826);var el=et(9981);var ef=et(210);var ed=ef("%Map%",true);var ep=ef("%Set%",true);var eh=et(1924);var ey=eh("Array.prototype.push");var eg=eh("String.prototype.charCodeAt");var em=eh("String.prototype.slice");var e_=function $($,ee){var et=$.length;if(ee+1>=et){return ee+1}var en=eg($,ee);if(en<55296||en>56319){return ee+1}var ei=eg($,ee+1);if(ei<56320||ei>57343){return ee+1}return ee+2};var ew=function $($){var ee=0;return{next:function et(){var et=ee>=$.length;var en;if(!et){en=$[ee];ee+=1}return{done:et,value:en}}}};var eE=function $($,ee){if(eu($)||ei($)){return ew($)}if(el($)){var et=0;return{next:function ee(){var ee=e_($,et);var en=em($,et,ee);et=ee;return{done:ee>$.length,value:en}}}}if(ee&&typeof $["_es6-shim iterator_"]!=="undefined"){return $["_es6-shim iterator_"]()}};if(!ed&&!ep){$.exports=function $($){if($!=null){return eE($,true)}}}else{var eS=et(8379);var eT=et(9572);var eO=eh("Map.prototype.forEach",true);var eA=eh("Set.prototype.forEach",true);if(typeof en==="undefined"||!en.versions||!en.versions.node){var eI=eh("Map.prototype.iterator",true);var eN=eh("Set.prototype.iterator",true)}var eD=eh("Map.prototype.@@iterator",true)||eh("Map.prototype._es6-shim iterator_",true);var eR=eh("Set.prototype.@@iterator",true)||eh("Set.prototype._es6-shim iterator_",true);var eC=function $($){if(eS($)){if(eI){return eo(eI($))}if(eD){return eD($)}if(eO){var ee=[];eO($,function($,et){ey(ee,[et,$])});return ew(ee)}}if(eT($)){if(eN){return eo(eN($))}if(eR){return eR($)}if(eA){var et=[];eA($,function($){ey(et,$)});return ew(et)}}};$.exports=function $($){return eC($)||eE($)}}}},3483:($,ee,et)=>{"use strict";var en=et(8379);var ei=et(9572);var eo=et(1718);var es=et(5899);$.exports=function $($){if($&&typeof $==="object"){if(en($)){return"Map"}if(ei($)){return"Set"}if(eo($)){return"WeakMap"}if(es($)){return"WeakSet"}}return false}}};var __webpack_module_cache__={};function __webpack_require__($){var ee=__webpack_module_cache__[$];if(ee!==undefined){return ee.exports}var et=__webpack_module_cache__[$]={id:$,loaded:false,exports:{}};__webpack_modules__[$].call(et.exports,et,et.exports,__webpack_require__);et.loaded=true;return et.exports}__webpack_require__.m=__webpack_modules__;(()=>{__webpack_require__.n=$=>{var ee=$&&$.__esModule?()=>$["default"]:()=>$;__webpack_require__.d(ee,{a:ee});return ee}})();(()=>{__webpack_require__.d=($,ee)=>{for(var et in ee){if(__webpack_require__.o(ee,et)&&!__webpack_require__.o($,et)){Object.defineProperty($,et,{enumerable:true,get:ee[et]})}}}})();(()=>{__webpack_require__.f={};__webpack_require__.e=$=>{return Promise.all(Object.keys(__webpack_require__.f).reduce((ee,et)=>{__webpack_require__.f[et]($,ee);return ee},[]))}})();(()=>{__webpack_require__.u=$=>{return""+$+"."+$+".kcab.worker."+"2ee5d7175d50b7896f28"+".js"}})();(()=>{__webpack_require__.g=function(){if(typeof globalThis==="object")return globalThis;try{return this||new Function("return this")()}catch($){if(typeof window==="object")return window}}()})();(()=>{__webpack_require__.o=($,ee)=>Object.prototype.hasOwnProperty.call($,ee)})();(()=>{__webpack_require__.r=$=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty($,Symbol.toStringTag,{value:"Module"})}Object.defineProperty($,"__esModule",{value:true})}})();(()=>{__webpack_require__.nmd=$=>{$.paths=[];if(!$.children)$.children=[];return $}})();(()=>{__webpack_require__.p="/kcab/"})();(()=>{var $={"main":1};var ee=ee=>{var[et,ei,eo]=ee;for(var es in ei){if(__webpack_require__.o(ei,es)){__webpack_require__.m[es]=ei[es]}}if(eo)eo(__webpack_require__);while(et.length)$[et.pop()]=1;en(ee)};__webpack_require__.f.i=(ee,et)=>{if(!$[ee]){if(true){importScripts(__webpack_require__.p+__webpack_require__.u(ee))}}};var et=self["webpackChunkbackend"]=self["webpackChunkbackend"]||[];var en=et.push.bind(et);et.push=ee})();var __webpack_exports__={};(()=>{"use strict";__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{handlers:()=>Er,init:()=>El,initApp:()=>Eu,lib:()=>Ec});var $={};__webpack_require__.r($);__webpack_require__.d($,{all:()=>f2,asyncTransaction:()=>f1,cache:()=>fX,closeDatabase:()=>f$,deleteAccount:()=>dL,deleteCategory:()=>dv,deleteCategoryGroup:()=>dy,deletePayee:()=>dS,deleteTransaction:()=>dW,deleteTransferPayee:()=>dT,delete_:()=>de,execQuery:()=>fZ,first:()=>f6,firstSync:()=>f4,fromDateRepr:()=>oY,getAccounts:()=>dC,getCategories:()=>du,getCategoriesGrouped:()=>dl,getDatabase:()=>fG,getDatabasePath:()=>fH,getOrphanedPayees:()=>dD,getPayee:()=>dw,getPayeeByName:()=>dR,getPayees:()=>dI,getTransaction:()=>dP,getTransactions:()=>dB,getTransactionsByDate:()=>dF,insert:()=>f7,insertAccount:()=>dk,insertCategory:()=>dg,insertCategoryGroup:()=>df,insertPayee:()=>dE,insertTransaction:()=>dU,insertWithSchema:()=>di,insertWithUUID:()=>f9,loadClock:()=>fY,mergePayees:()=>dA,moveAccount:()=>dx,moveCategory:()=>d_,moveCategoryGroup:()=>dh,openDatabase:()=>fz,reopenDatabase:()=>fV,run:()=>f3,runQuery:()=>fK,select:()=>f8,selectFirstWithSchema:()=>dn,selectWithSchema:()=>dr,setDatabase:()=>fq,syncGetOrphanedPayees:()=>dN,toDateRepr:()=>oG,transaction:()=>f0,update:()=>f5,updateAccount:()=>dM,updateCategory:()=>dm,updateCategoryGroup:()=>dp,updatePayee:()=>dO,updateTransaction:()=>dj,updateWithSchema:()=>ds});var ee={};__webpack_require__.r(ee);__webpack_require__.d(ee,{doImport:()=>wc,getBudgetName:()=>wf,parseFile:()=>wh});var et={};__webpack_require__.r(et);__webpack_require__.d(et,{doImport:()=>wE,getBudgetName:()=>wT,parseFile:()=>wS});var en;function ei($){en=$}var eo=__webpack_require__(8393);const es=typeof crypto!=="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const eu={randomUUID:es};let el;const ef=new Uint8Array(16);function ed(){if(!el){el=typeof crypto!=="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto);if(!el){throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported")}}return el(ef)};const ep=[];for(let $=0;$<256;++$){ep.push(($+256).toString(16).slice(1))}function eh($,ee=0){return(ep[$[ee+0]]+ep[$[ee+1]]+ep[$[ee+2]]+ep[$[ee+3]]+"-"+ep[$[ee+4]]+ep[$[ee+5]]+"-"+ep[$[ee+6]]+ep[$[ee+7]]+"-"+ep[$[ee+8]]+ep[$[ee+9]]+"-"+ep[$[ee+10]]+ep[$[ee+11]]+ep[$[ee+12]]+ep[$[ee+13]]+ep[$[ee+14]]+ep[$[ee+15]]).toLowerCase()}function ey($,ee=0){const et=eh($,ee);if(!validate(et)){throw TypeError("Stringified UUID is invalid")}return et}const eg=null&&ey;function em($,ee,et){if(eu.randomUUID&&!ee&&!$){return eu.randomUUID()}$=$||{};const en=$.random||($.rng||ed)();en[6]=en[6]&15|64;en[8]=en[8]&63|128;if(ee){et=et||0;for(let $=0;$<16;++$){ee[et+$]=en[$]}return ee}return eh(en)}const e_=em;function ew($){"@babel/helpers - typeof";return ew="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function($){return typeof $}:function($){return $&&"function"==typeof Symbol&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},ew($)};function eE($,ee){if(ee.length<$){throw new TypeError($+" argument"+($>1?"s":"")+" required, but only "+ee.length+" present")}};function eS($){eE(1,arguments);var ee=Object.prototype.toString.call($);if($ instanceof Date||ew($)==="object"&&ee==="[object Date]"){return new Date($.getTime())}else if(typeof $==="number"||ee==="[object Number]"){return new Date($)}else{if((typeof $==="string"||ee==="[object String]")&&typeof console!=="undefined"){console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments");console.warn(new Error().stack)}return new Date(NaN)}};function eT($){eE(1,arguments);var ee;if($&&typeof $.forEach==="function"){ee=$}else if(ew($)==="object"&&$!==null){ee=Array.prototype.slice.call($)}else{return new Date(NaN)}var et;ee.forEach(function($){var ee=eS($);if(et===undefined||et<ee||isNaN(Number(ee))){et=ee}});return et||new Date(NaN)};function eO($){eE(1,arguments);return $ instanceof Date||ew($)==="object"&&Object.prototype.toString.call($)==="[object Date]"};function eA($){eE(1,arguments);if(!eO($)&&typeof $!=="number"){return false}var ee=eS($);return!isNaN(Number(ee))};function eI($){if($===null||$===true||$===false){return NaN}var ee=Number($);if(isNaN(ee)){return ee}return ee<0?Math.ceil(ee):Math.floor(ee)};function eN($,ee){eE(2,arguments);var et=eS($).getTime();var en=eI(ee);return new Date(et+en)};function eD($,ee){eE(2,arguments);var et=eI(ee);return eN($,-et)};var eR=864e5;function eC($){eE(1,arguments);var ee=eS($);var et=ee.getTime();ee.setUTCMonth(0,1);ee.setUTCHours(0,0,0,0);var en=ee.getTime();var ei=et-en;return Math.floor(ei/eR)+1};function ek($){eE(1,arguments);var ee=1;var et=eS($);var en=et.getUTCDay();var ei=(en<ee?7:0)+en-ee;et.setUTCDate(et.getUTCDate()-ei);et.setUTCHours(0,0,0,0);return et};function eM($){eE(1,arguments);var ee=eS($);var et=ee.getUTCFullYear();var en=new Date(0);en.setUTCFullYear(et+1,0,4);en.setUTCHours(0,0,0,0);var ei=ek(en);var eo=new Date(0);eo.setUTCFullYear(et,0,4);eo.setUTCHours(0,0,0,0);var es=ek(eo);if(ee.getTime()>=ei.getTime()){return et+1}else if(ee.getTime()>=es.getTime()){return et}else{return et-1}};function eL($){eE(1,arguments);var ee=eM($);var et=new Date(0);et.setUTCFullYear(ee,0,4);et.setUTCHours(0,0,0,0);var en=ek(et);return en};var eP=6048e5;function eF($){eE(1,arguments);var ee=eS($);var et=ek(ee).getTime()-eL(ee).getTime();return Math.round(et/eP)+1};var eB={};function eU(){return eB}function ej($){eB=$};function eW($,ee){var et,en,ei,eo,es,eu,el,ef;eE(1,arguments);var ed=eU();var ep=eI((et=(en=(ei=(eo=ee===null||ee===void 0?void 0:ee.weekStartsOn)!==null&&eo!==void 0?eo:ee===null||ee===void 0?void 0:(es=ee.locale)===null||es===void 0?void 0:(eu=es.options)===null||eu===void 0?void 0:eu.weekStartsOn)!==null&&ei!==void 0?ei:ed.weekStartsOn)!==null&&en!==void 0?en:(el=ed.locale)===null||el===void 0?void 0:(ef=el.options)===null||ef===void 0?void 0:ef.weekStartsOn)!==null&&et!==void 0?et:0);if(!(ep>=0&&ep<=6)){throw new RangeError("weekStartsOn must be between 0 and 6 inclusively")}var eh=eS($);var ey=eh.getUTCDay();var eg=(ey<ep?7:0)+ey-ep;eh.setUTCDate(eh.getUTCDate()-eg);eh.setUTCHours(0,0,0,0);return eh};function eH($,ee){var et,en,ei,eo,es,eu,el,ef;eE(1,arguments);var ed=eS($);var ep=ed.getUTCFullYear();var eh=eU();var ey=eI((et=(en=(ei=(eo=ee===null||ee===void 0?void 0:ee.firstWeekContainsDate)!==null&&eo!==void 0?eo:ee===null||ee===void 0?void 0:(es=ee.locale)===null||es===void 0?void 0:(eu=es.options)===null||eu===void 0?void 0:eu.firstWeekContainsDate)!==null&&ei!==void 0?ei:eh.firstWeekContainsDate)!==null&&en!==void 0?en:(el=eh.locale)===null||el===void 0?void 0:(ef=el.options)===null||ef===void 0?void 0:ef.firstWeekContainsDate)!==null&&et!==void 0?et:1);if(!(ey>=1&&ey<=7)){throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively")}var eg=new Date(0);eg.setUTCFullYear(ep+1,0,ey);eg.setUTCHours(0,0,0,0);var em=eW(eg,ee);var e_=new Date(0);e_.setUTCFullYear(ep,0,ey);e_.setUTCHours(0,0,0,0);var ew=eW(e_,ee);if(ed.getTime()>=em.getTime()){return ep+1}else if(ed.getTime()>=ew.getTime()){return ep}else{return ep-1}};function ez($,ee){var et,en,ei,eo,es,eu,el,ef;eE(1,arguments);var ed=eU();var ep=eI((et=(en=(ei=(eo=ee===null||ee===void 0?void 0:ee.firstWeekContainsDate)!==null&&eo!==void 0?eo:ee===null||ee===void 0?void 0:(es=ee.locale)===null||es===void 0?void 0:(eu=es.options)===null||eu===void 0?void 0:eu.firstWeekContainsDate)!==null&&ei!==void 0?ei:ed.firstWeekContainsDate)!==null&&en!==void 0?en:(el=ed.locale)===null||el===void 0?void 0:(ef=el.options)===null||ef===void 0?void 0:ef.firstWeekContainsDate)!==null&&et!==void 0?et:1);var eh=eH($,ee);var ey=new Date(0);ey.setUTCFullYear(eh,0,ep);ey.setUTCHours(0,0,0,0);var eg=eW(ey,ee);return eg};var eV=6048e5;function e$($,ee){eE(1,arguments);var et=eS($);var en=eW(et,ee).getTime()-ez(et,ee).getTime();return Math.round(en/eV)+1};function eq($,ee){var et=$<0?"-":"";var en=Math.abs($).toString();while(en.length<ee){en="0"+en}return et+en};var eG={y:function $($,ee){var et=$.getUTCFullYear();var en=et>0?et:1-et;return eq(ee==="yy"?en%100:en,ee.length)},M:function $($,ee){var et=$.getUTCMonth();return ee==="M"?String(et+1):eq(et+1,2)},d:function $($,ee){return eq($.getUTCDate(),ee.length)},a:function $($,ee){var et=$.getUTCHours()/12>=1?"pm":"am";switch(ee){case"a":case"aa":return et.toUpperCase();case"aaa":return et;case"aaaaa":return et[0];case"aaaa":default:return et==="am"?"a.m.":"p.m."}},h:function $($,ee){return eq($.getUTCHours()%12||12,ee.length)},H:function $($,ee){return eq($.getUTCHours(),ee.length)},m:function $($,ee){return eq($.getUTCMinutes(),ee.length)},s:function $($,ee){return eq($.getUTCSeconds(),ee.length)},S:function $($,ee){var et=ee.length;var en=$.getUTCMilliseconds();var ei=Math.floor(en*Math.pow(10,et-3));return eq(ei,ee.length)}};const eY=eG;var eK={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"};var eZ={G:function $($,ee,et){var en=$.getUTCFullYear()>0?1:0;switch(ee){case"G":case"GG":case"GGG":return et.era(en,{width:"abbreviated"});case"GGGGG":return et.era(en,{width:"narrow"});case"GGGG":default:return et.era(en,{width:"wide"})}},y:function $($,ee,et){if(ee==="yo"){var en=$.getUTCFullYear();var ei=en>0?en:1-en;return et.ordinalNumber(ei,{unit:"year"})}return eY.y($,ee)},Y:function $($,ee,et,en){var ei=eH($,en);var eo=ei>0?ei:1-ei;if(ee==="YY"){var es=eo%100;return eq(es,2)}if(ee==="Yo"){return et.ordinalNumber(eo,{unit:"year"})}return eq(eo,ee.length)},R:function $($,ee){var et=eM($);return eq(et,ee.length)},u:function $($,ee){var et=$.getUTCFullYear();return eq(et,ee.length)},Q:function $($,ee,et){var en=Math.ceil(($.getUTCMonth()+1)/3);switch(ee){case"Q":return String(en);case"QQ":return eq(en,2);case"Qo":return et.ordinalNumber(en,{unit:"quarter"});case"QQQ":return et.quarter(en,{width:"abbreviated",context:"formatting"});case"QQQQQ":return et.quarter(en,{width:"narrow",context:"formatting"});case"QQQQ":default:return et.quarter(en,{width:"wide",context:"formatting"})}},q:function $($,ee,et){var en=Math.ceil(($.getUTCMonth()+1)/3);switch(ee){case"q":return String(en);case"qq":return eq(en,2);case"qo":return et.ordinalNumber(en,{unit:"quarter"});case"qqq":return et.quarter(en,{width:"abbreviated",context:"standalone"});case"qqqqq":return et.quarter(en,{width:"narrow",context:"standalone"});case"qqqq":default:return et.quarter(en,{width:"wide",context:"standalone"})}},M:function $($,ee,et){var en=$.getUTCMonth();switch(ee){case"M":case"MM":return eY.M($,ee);case"Mo":return et.ordinalNumber(en+1,{unit:"month"});case"MMM":return et.month(en,{width:"abbreviated",context:"formatting"});case"MMMMM":return et.month(en,{width:"narrow",context:"formatting"});case"MMMM":default:return et.month(en,{width:"wide",context:"formatting"})}},L:function $($,ee,et){var en=$.getUTCMonth();switch(ee){case"L":return String(en+1);case"LL":return eq(en+1,2);case"Lo":return et.ordinalNumber(en+1,{unit:"month"});case"LLL":return et.month(en,{width:"abbreviated",context:"standalone"});case"LLLLL":return et.month(en,{width:"narrow",context:"standalone"});case"LLLL":default:return et.month(en,{width:"wide",context:"standalone"})}},w:function $($,ee,et,en){var ei=e$($,en);if(ee==="wo"){return et.ordinalNumber(ei,{unit:"week"})}return eq(ei,ee.length)},I:function $($,ee,et){var en=eF($);if(ee==="Io"){return et.ordinalNumber(en,{unit:"week"})}return eq(en,ee.length)},d:function $($,ee,et){if(ee==="do"){return et.ordinalNumber($.getUTCDate(),{unit:"date"})}return eY.d($,ee)},D:function $($,ee,et){var en=eC($);if(ee==="Do"){return et.ordinalNumber(en,{unit:"dayOfYear"})}return eq(en,ee.length)},E:function $($,ee,et){var en=$.getUTCDay();switch(ee){case"E":case"EE":case"EEE":return et.day(en,{width:"abbreviated",context:"formatting"});case"EEEEE":return et.day(en,{width:"narrow",context:"formatting"});case"EEEEEE":return et.day(en,{width:"short",context:"formatting"});case"EEEE":default:return et.day(en,{width:"wide",context:"formatting"})}},e:function $($,ee,et,en){var ei=$.getUTCDay();var eo=(ei-en.weekStartsOn+8)%7||7;switch(ee){case"e":return String(eo);case"ee":return eq(eo,2);case"eo":return et.ordinalNumber(eo,{unit:"day"});case"eee":return et.day(ei,{width:"abbreviated",context:"formatting"});case"eeeee":return et.day(ei,{width:"narrow",context:"formatting"});case"eeeeee":return et.day(ei,{width:"short",context:"formatting"});case"eeee":default:return et.day(ei,{width:"wide",context:"formatting"})}},c:function $($,ee,et,en){var ei=$.getUTCDay();var eo=(ei-en.weekStartsOn+8)%7||7;switch(ee){case"c":return String(eo);case"cc":return eq(eo,ee.length);case"co":return et.ordinalNumber(eo,{unit:"day"});case"ccc":return et.day(ei,{width:"abbreviated",context:"standalone"});case"ccccc":return et.day(ei,{width:"narrow",context:"standalone"});case"cccccc":return et.day(ei,{width:"short",context:"standalone"});case"cccc":default:return et.day(ei,{width:"wide",context:"standalone"})}},i:function $($,ee,et){var en=$.getUTCDay();var ei=en===0?7:en;switch(ee){case"i":return String(ei);case"ii":return eq(ei,ee.length);case"io":return et.ordinalNumber(ei,{unit:"day"});case"iii":return et.day(en,{width:"abbreviated",context:"formatting"});case"iiiii":return et.day(en,{width:"narrow",context:"formatting"});case"iiiiii":return et.day(en,{width:"short",context:"formatting"});case"iiii":default:return et.day(en,{width:"wide",context:"formatting"})}},a:function $($,ee,et){var en=$.getUTCHours();var ei=en/12>=1?"pm":"am";switch(ee){case"a":case"aa":return et.dayPeriod(ei,{width:"abbreviated",context:"formatting"});case"aaa":return et.dayPeriod(ei,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return et.dayPeriod(ei,{width:"narrow",context:"formatting"});case"aaaa":default:return et.dayPeriod(ei,{width:"wide",context:"formatting"})}},b:function $($,ee,et){var en=$.getUTCHours();var ei;if(en===12){ei=eK.noon}else if(en===0){ei=eK.midnight}else{ei=en/12>=1?"pm":"am"}switch(ee){case"b":case"bb":return et.dayPeriod(ei,{width:"abbreviated",context:"formatting"});case"bbb":return et.dayPeriod(ei,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return et.dayPeriod(ei,{width:"narrow",context:"formatting"});case"bbbb":default:return et.dayPeriod(ei,{width:"wide",context:"formatting"})}},B:function $($,ee,et){var en=$.getUTCHours();var ei;if(en>=17){ei=eK.evening}else if(en>=12){ei=eK.afternoon}else if(en>=4){ei=eK.morning}else{ei=eK.night}switch(ee){case"B":case"BB":case"BBB":return et.dayPeriod(ei,{width:"abbreviated",context:"formatting"});case"BBBBB":return et.dayPeriod(ei,{width:"narrow",context:"formatting"});case"BBBB":default:return et.dayPeriod(ei,{width:"wide",context:"formatting"})}},h:function $($,ee,et){if(ee==="ho"){var en=$.getUTCHours()%12;if(en===0)en=12;return et.ordinalNumber(en,{unit:"hour"})}return eY.h($,ee)},H:function $($,ee,et){if(ee==="Ho"){return et.ordinalNumber($.getUTCHours(),{unit:"hour"})}return eY.H($,ee)},K:function $($,ee,et){var en=$.getUTCHours()%12;if(ee==="Ko"){return et.ordinalNumber(en,{unit:"hour"})}return eq(en,ee.length)},k:function $($,ee,et){var en=$.getUTCHours();if(en===0)en=24;if(ee==="ko"){return et.ordinalNumber(en,{unit:"hour"})}return eq(en,ee.length)},m:function $($,ee,et){if(ee==="mo"){return et.ordinalNumber($.getUTCMinutes(),{unit:"minute"})}return eY.m($,ee)},s:function $($,ee,et){if(ee==="so"){return et.ordinalNumber($.getUTCSeconds(),{unit:"second"})}return eY.s($,ee)},S:function $($,ee){return eY.S($,ee)},X:function $($,ee,et,en){var ei=en._originalDate||$;var eo=ei.getTimezoneOffset();if(eo===0){return"Z"}switch(ee){case"X":return eX(eo);case"XXXX":case"XX":return eQ(eo);case"XXXXX":case"XXX":default:return eQ(eo,":")}},x:function $($,ee,et,en){var ei=en._originalDate||$;var eo=ei.getTimezoneOffset();switch(ee){case"x":return eX(eo);case"xxxx":case"xx":return eQ(eo);case"xxxxx":case"xxx":default:return eQ(eo,":")}},O:function $($,ee,et,en){var ei=en._originalDate||$;var eo=ei.getTimezoneOffset();switch(ee){case"O":case"OO":case"OOO":return"GMT"+eJ(eo,":");case"OOOO":default:return"GMT"+eQ(eo,":")}},z:function $($,ee,et,en){var ei=en._originalDate||$;var eo=ei.getTimezoneOffset();switch(ee){case"z":case"zz":case"zzz":return"GMT"+eJ(eo,":");case"zzzz":default:return"GMT"+eQ(eo,":")}},t:function $($,ee,et,en){var ei=en._originalDate||$;var eo=Math.floor(ei.getTime()/1e3);return eq(eo,ee.length)},T:function $($,ee,et,en){var ei=en._originalDate||$;var eo=ei.getTime();return eq(eo,ee.length)}};function eJ($,ee){var et=$>0?"-":"+";var en=Math.abs($);var ei=Math.floor(en/60);var eo=en%60;if(eo===0){return et+String(ei)}var es=ee||"";return et+String(ei)+es+eq(eo,2)}function eX($,ee){if($%60===0){var et=$>0?"-":"+";return et+eq(Math.abs($)/60,2)}return eQ($,ee)}function eQ($,ee){var et=ee||"";var en=$>0?"-":"+";var ei=Math.abs($);var eo=eq(Math.floor(ei/60),2);var es=eq(ei%60,2);return en+eo+et+es}const e0=eZ;var e1=function $($,ee){switch($){case"P":return ee.date({width:"short"});case"PP":return ee.date({width:"medium"});case"PPP":return ee.date({width:"long"});case"PPPP":default:return ee.date({width:"full"})}};var e2=function $($,ee){switch($){case"p":return ee.time({width:"short"});case"pp":return ee.time({width:"medium"});case"ppp":return ee.time({width:"long"});case"pppp":default:return ee.time({width:"full"})}};var e6=function $($,ee){var et=$.match(/(P+)(p+)?/)||[];var en=et[1];var ei=et[2];if(!ei){return e1($,ee)}var eo;switch(en){case"P":eo=ee.dateTime({width:"short"});break;case"PP":eo=ee.dateTime({width:"medium"});break;case"PPP":eo=ee.dateTime({width:"long"});break;case"PPPP":default:eo=ee.dateTime({width:"full"});break}return eo.replace("{{date}}",e1(en,ee)).replace("{{time}}",e2(ei,ee))};var e4={p:e2,P:e6};const e3=e4;function e8($){var ee=new Date(Date.UTC($.getFullYear(),$.getMonth(),$.getDate(),$.getHours(),$.getMinutes(),$.getSeconds(),$.getMilliseconds()));ee.setUTCFullYear($.getFullYear());return $.getTime()-ee.getTime()};var e5=["D","DD"];var e9=["YY","YYYY"];function e7($){return e5.indexOf($)!==-1}function te($){return e9.indexOf($)!==-1}function tt($,ee,et){if($==="YYYY"){throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(ee,"`) for formatting years to the input `").concat(et,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}else if($==="YY"){throw new RangeError("Use `yy` instead of `YY` (in `".concat(ee,"`) for formatting years to the input `").concat(et,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}else if($==="D"){throw new RangeError("Use `d` instead of `D` (in `".concat(ee,"`) for formatting days of the month to the input `").concat(et,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}else if($==="DD"){throw new RangeError("Use `dd` instead of `DD` (in `".concat(ee,"`) for formatting days of the month to the input `").concat(et,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}};var tr={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};var tn=function $($,ee,et){var en;var ei=tr[$];if(typeof ei==="string"){en=ei}else if(ee===1){en=ei.one}else{en=ei.other.replace("{{count}}",ee.toString())}if(et!==null&&et!==void 0&&et.addSuffix){if(et.comparison&&et.comparison>0){return"in "+en}else{return en+" ago"}}return en};const ti=tn;function tu($){return function(){var ee=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var et=ee.width?String(ee.width):$.defaultWidth;var en=$.formats[et]||$.formats[$.defaultWidth];return en}};var tc={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"};var tf={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"};var td={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"};var tp={date:tu({formats:tc,defaultWidth:"full"}),time:tu({formats:tf,defaultWidth:"full"}),dateTime:tu({formats:td,defaultWidth:"full"})};const th=tp;var ty={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};var tm=function $($,ee,et,en){return ty[$]};const t_=tm;function tv($){return function(ee,et){var en=et!==null&&et!==void 0&&et.context?String(et.context):"standalone";var ei;if(en==="formatting"&&$.formattingValues){var eo=$.defaultFormattingWidth||$.defaultWidth;var es=et!==null&&et!==void 0&&et.width?String(et.width):eo;ei=$.formattingValues[es]||$.formattingValues[eo]}else{var eu=$.defaultWidth;var el=et!==null&&et!==void 0&&et.width?String(et.width):$.defaultWidth;ei=$.values[el]||$.values[eu]}var ef=$.argumentCallback?$.argumentCallback(ee):ee;return ei[ef]}};var tw={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]};var tE={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]};var tS={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]};var tT={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]};var tO={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}};var tA={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}};var tI=function $($,ee){var et=Number($);var en=et%100;if(en>20||en<10){switch(en%10){case 1:return et+"st";case 2:return et+"nd";case 3:return et+"rd"}}return et+"th"};var tN={ordinalNumber:tI,era:tv({values:tw,defaultWidth:"wide"}),quarter:tv({values:tE,defaultWidth:"wide",argumentCallback:function $($){return $-1}}),month:tv({values:tS,defaultWidth:"wide"}),day:tv({values:tT,defaultWidth:"wide"}),dayPeriod:tv({values:tO,defaultWidth:"wide",formattingValues:tA,defaultFormattingWidth:"wide"})};const tD=tN;function tR($){return function(ee){var et=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var en=et.width;var ei=en&&$.matchPatterns[en]||$.matchPatterns[$.defaultMatchWidth];var eo=ee.match(ei);if(!eo){return null}var es=eo[0];var eu=en&&$.parsePatterns[en]||$.parsePatterns[$.defaultParseWidth];var el=Array.isArray(eu)?tk(eu,function($){return $.test(es)}):tC(eu,function($){return $.test(es)});var ef;ef=$.valueCallback?$.valueCallback(el):el;ef=et.valueCallback?et.valueCallback(ef):ef;var ed=ee.slice(es.length);return{value:ef,rest:ed}}}function tC($,ee){for(var et in $){if($.hasOwnProperty(et)&&ee($[et])){return et}}return undefined}function tk($,ee){for(var et=0;et<$.length;et++){if(ee($[et])){return et}}return undefined};function tM($){return function(ee){var et=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var en=ee.match($.matchPattern);if(!en)return null;var ei=en[0];var eo=ee.match($.parsePattern);if(!eo)return null;var es=$.valueCallback?$.valueCallback(eo[0]):eo[0];es=et.valueCallback?et.valueCallback(es):es;var eu=ee.slice(ei.length);return{value:es,rest:eu}}};var tL=/^(\d+)(th|st|nd|rd)?/i;var tx=/\d+/i;var tP={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i};var tF={any:[/^b/i,/^(a|c)/i]};var tB={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i};var tU={any:[/1/i,/2/i,/3/i,/4/i]};var tj={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i};var tW={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]};var tH={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i};var tz={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]};var tV={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i};var t$={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}};var tq={ordinalNumber:tM({matchPattern:tL,parsePattern:tx,valueCallback:function $($){return parseInt($,10)}}),era:tR({matchPatterns:tP,defaultMatchWidth:"wide",parsePatterns:tF,defaultParseWidth:"any"}),quarter:tR({matchPatterns:tB,defaultMatchWidth:"wide",parsePatterns:tU,defaultParseWidth:"any",valueCallback:function $($){return $+1}}),month:tR({matchPatterns:tj,defaultMatchWidth:"wide",parsePatterns:tW,defaultParseWidth:"any"}),day:tR({matchPatterns:tH,defaultMatchWidth:"wide",parsePatterns:tz,defaultParseWidth:"any"}),dayPeriod:tR({matchPatterns:tV,defaultMatchWidth:"any",parsePatterns:t$,defaultParseWidth:"any"})};const tG=tq;var tY={code:"en-US",formatDistance:ti,formatLong:th,formatRelative:t_,localize:tD,match:tG,options:{weekStartsOn:0,firstWeekContainsDate:1}};const tK=tY;const tZ=tK;var tJ=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;var tX=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;var tQ=/^'([^]*?)'?$/;var t0=/''/g;var t6=/[a-zA-Z]/;function t4($,ee,et){var en,ei,eo,es,eu,el,ef,ed,ep,eh,ey,eg,em,e_,ew,eT,eO,eN;eE(2,arguments);var eR=String(ee);var eC=eU();var ek=(en=(ei=et===null||et===void 0?void 0:et.locale)!==null&&ei!==void 0?ei:eC.locale)!==null&&en!==void 0?en:tZ;var eM=eI((eo=(es=(eu=(el=et===null||et===void 0?void 0:et.firstWeekContainsDate)!==null&&el!==void 0?el:et===null||et===void 0?void 0:(ef=et.locale)===null||ef===void 0?void 0:(ed=ef.options)===null||ed===void 0?void 0:ed.firstWeekContainsDate)!==null&&eu!==void 0?eu:eC.firstWeekContainsDate)!==null&&es!==void 0?es:(ep=eC.locale)===null||ep===void 0?void 0:(eh=ep.options)===null||eh===void 0?void 0:eh.firstWeekContainsDate)!==null&&eo!==void 0?eo:1);if(!(eM>=1&&eM<=7)){throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively")}var eL=eI((ey=(eg=(em=(e_=et===null||et===void 0?void 0:et.weekStartsOn)!==null&&e_!==void 0?e_:et===null||et===void 0?void 0:(ew=et.locale)===null||ew===void 0?void 0:(eT=ew.options)===null||eT===void 0?void 0:eT.weekStartsOn)!==null&&em!==void 0?em:eC.weekStartsOn)!==null&&eg!==void 0?eg:(eO=eC.locale)===null||eO===void 0?void 0:(eN=eO.options)===null||eN===void 0?void 0:eN.weekStartsOn)!==null&&ey!==void 0?ey:0);if(!(eL>=0&&eL<=6)){throw new RangeError("weekStartsOn must be between 0 and 6 inclusively")}if(!ek.localize){throw new RangeError("locale must contain localize property")}if(!ek.formatLong){throw new RangeError("locale must contain formatLong property")}var eP=eS($);if(!eA(eP)){throw new RangeError("Invalid time value")}var eF=e8(eP);var eB=eD(eP,eF);var ej={firstWeekContainsDate:eM,weekStartsOn:eL,locale:ek,_originalDate:eP};var eW=eR.match(tX).map(function($){var ee=$[0];if(ee==="p"||ee==="P"){var et=e3[ee];return et($,ek.formatLong)}return $}).join("").match(tJ).map(function(en){if(en==="''"){return"'"}var ei=en[0];if(ei==="'"){return t3(en)}var eo=e0[ei];if(eo){if(!(et!==null&&et!==void 0&&et.useAdditionalWeekYearTokens)&&te(en)){tt(en,ee,String($))}if(!(et!==null&&et!==void 0&&et.useAdditionalDayOfYearTokens)&&e7(en)){tt(en,ee,String($))}return eo(eB,en,ek.localize,ej)}if(ei.match(t6)){throw new RangeError("Format string contains an unescaped latin alphabet character `"+ei+"`")}return en}).join("");return eW}function t3($){var ee=$.match(tQ);if(!ee){return $}return ee[1].replace(t0,"'")};var t8=7;var t5=365.2425;var t9=Math.pow(10,8)*24*60*60*1e3;var t7=6e4;var rr=36e5;var rn=1e3;var ri=-t9;var ro=60;var ru=3;var rl=12;var rc=4;var rf=3600;var rp=60;var rh=rf*24;var ry=rh*7;var rg=rh*t5;var rm=rg/12;var r_=rm*3;function rv($,ee){var et;eE(1,arguments);var en=eI((et=ee===null||ee===void 0?void 0:ee.additionalDigits)!==null&&et!==void 0?et:2);if(en!==2&&en!==1&&en!==0){throw new RangeError("additionalDigits must be 0, 1 or 2")}if(!(typeof $==="string"||Object.prototype.toString.call($)==="[object String]")){return new Date(NaN)}var ei=rO($);var eo;if(ei.date){var es=rA(ei.date,en);eo=rI(es.restDateString,es.year)}if(!eo||isNaN(eo.getTime())){return new Date(NaN)}var eu=eo.getTime();var el=0;var ef;if(ei.time){el=rD(ei.time);if(isNaN(el)){return new Date(NaN)}}if(ei.timezone){ef=rC(ei.timezone);if(isNaN(ef)){return new Date(NaN)}}else{var ed=new Date(eu+el);var ep=new Date(0);ep.setFullYear(ed.getUTCFullYear(),ed.getUTCMonth(),ed.getUTCDate());ep.setHours(ed.getUTCHours(),ed.getUTCMinutes(),ed.getUTCSeconds(),ed.getUTCMilliseconds());return ep}return new Date(eu+el+ef)}var rw={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/};var rE=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/;var rS=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/;var rT=/^([+-])(\d{2})(?::?(\d{2}))?$/;function rO($){var ee={};var et=$.split(rw.dateTimeDelimiter);var en;if(et.length>2){return ee}if(/:/.test(et[0])){en=et[0]}else{ee.date=et[0];en=et[1];if(rw.timeZoneDelimiter.test(ee.date)){ee.date=$.split(rw.timeZoneDelimiter)[0];en=$.substr(ee.date.length,$.length)}}if(en){var ei=rw.timezone.exec(en);if(ei){ee.time=en.replace(ei[1],"");ee.timezone=ei[1]}else{ee.time=en}}return ee}function rA($,ee){var et=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+ee)+"})|(\\d{2}|[+-]\\d{"+(2+ee)+"})$)");var en=$.match(et);if(!en)return{year:NaN,restDateString:""};var ei=en[1]?parseInt(en[1]):null;var eo=en[2]?parseInt(en[2]):null;return{year:eo===null?ei:eo*100,restDateString:$.slice((en[1]||en[2]).length)}}function rI($,ee){if(ee===null)return new Date(NaN);var et=$.match(rE);if(!et)return new Date(NaN);var en=!!et[4];var ei=rN(et[1]);var eo=rN(et[2])-1;var es=rN(et[3]);var eu=rN(et[4]);var el=rN(et[5])-1;if(en){if(!rB(ee,eu,el)){return new Date(NaN)}return rk(ee,eu,el)}else{var ef=new Date(0);if(!rP(ee,eo,es)||!rF(ee,ei)){return new Date(NaN)}ef.setUTCFullYear(ee,eo,Math.max(ei,es));return ef}}function rN($){return $?parseInt($):1}function rD($){var ee=$.match(rS);if(!ee)return NaN;var et=rR(ee[1]);var en=rR(ee[2]);var ei=rR(ee[3]);if(!rU(et,en,ei)){return NaN}return et*rr+en*t7+ei*1e3}function rR($){return $&&parseFloat($.replace(",","."))||0}function rC($){if($==="Z")return 0;var ee=$.match(rT);if(!ee)return 0;var et=ee[1]==="+"?-1:1;var en=parseInt(ee[2]);var ei=ee[3]&&parseInt(ee[3])||0;if(!rj(en,ei)){return NaN}return et*(en*rr+ei*t7)}function rk($,ee,et){var en=new Date(0);en.setUTCFullYear($,0,4);var ei=en.getUTCDay()||7;var eo=(ee-1)*7+et+1-ei;en.setUTCDate(en.getUTCDate()+eo);return en}var rM=[31,null,31,30,31,30,31,31,30,31,30,31];function rL($){return $%400===0||$%4===0&&$%100!==0}function rP($,ee,et){return ee>=0&&ee<=11&&et>=1&&et<=(rM[ee]||(rL($)?29:28))}function rF($,ee){return ee>=1&&ee<=(rL($)?366:365)}function rB($,ee,et){return ee>=1&&ee<=53&&et>=0&&et<=6}function rU($,ee,et){if($===24){return ee===0&&et===0}return et>=0&&et<60&&ee>=0&&ee<60&&$>=0&&$<25}function rj($,ee){return ee>=0&&ee<=59};let rW=rH();function rH(){return new Promise(($,ee)=>{let et=9;let en=indexedDB.open("actual",et);en.onupgradeneeded=function($){let ee=$.target.result;if(ee.objectStoreNames.contains("filesystem")){ee.deleteObjectStore("filesystem",{keyPath:"filepath"})}if(ee.objectStoreNames.contains("messages")){ee.deleteObjectStore("messages",{keyPath:"filepath"})}if(!ee.objectStoreNames.contains("asyncStorage")){ee.createObjectStore("asyncStorage")}if(!ee.objectStoreNames.contains("files")){ee.createObjectStore("files",{keyPath:"filepath"})}};en.onblocked=$=>console.log("blocked",$);en.onerror=$=>{console.log("openRequest error");ee(new Error("indexeddb-failure: Could not open IndexedDB"))};en.onsuccess=function(ee){let et=ee.target.result;et.onversionchange=()=>{et.close()};et.onerror=function($){console.log("Database error: "+($.target&&$.target.error));if($.target&&$.target.error){let ee=$.target.error;if(ee.name==="QuotaExceededError"){throw new Error("indexeddb-quota-error")}}};$(et)}})}const rz=function($,ee){let et=$.transaction([ee],"readwrite");return{trans:et,store:et.objectStore(ee)}};const rV=async function($,ee,et=$=>$){return new Promise((en,ei)=>{let eo=$.get(ee);eo.onsuccess=$=>{en(et(eo.result))};eo.onerror=$=>ei($)})};const r$=async function($,ee){return new Promise((et,en)=>{let ei=$.put(ee);ei.onsuccess=$=>et(undefined);ei.onerror=$=>en($)})};const rq=async function($,ee){return new Promise((et,en)=>{let ei=$.delete(ee);ei.onsuccess=$=>et(undefined);ei.onerror=$=>en($)})};const rG=function(){return rW};const rY=function(){if(rW==null){rW=rH()}return rW};const rK=function(){if(rW){rW.then($=>{$.close()});rW=null}};const rZ=function(){};function rJ($){if($.commit){$.commit()}}const rX=async function($){let ee=await rG();let et=ee.transaction(["asyncStorage"],"readonly");let en=et.objectStore("asyncStorage");return new Promise((ee,ei)=>{let eo=en.get($);eo.onerror=$=>ei($);eo.onsuccess=$=>ee($.target.result);rJ(et)})};const rQ=async function($,ee){let et=await rG();let en=et.transaction(["asyncStorage"],"readwrite");let ei=en.objectStore("asyncStorage");new Promise((et,eo)=>{let es=ei.put(ee,$);es.onerror=$=>eo($);es.onsuccess=$=>et(undefined);rJ(en)})};const r0=async function($){let ee=await rG();let et=ee.transaction(["asyncStorage"],"readwrite");let en=et.objectStore("asyncStorage");return new Promise((ee,ei)=>{let eo=en.delete($);eo.onerror=$=>ei($);eo.onsuccess=$=>ee(undefined);rJ(et)})};const r6=async function($){let ee=await rG();let et=ee.transaction(["asyncStorage"],"readonly");let en=et.objectStore("asyncStorage");let ei=Promise.all($.map($=>{return new Promise((ee,et)=>{let ei=en.get($);ei.onerror=$=>et($);ei.onsuccess=et=>ee([$,et.target.result])})}));rJ(et);return ei};const r4=async function($){let ee=await getDatabase();let et=ee.transaction(["asyncStorage"],"readwrite");let en=et.objectStore("asyncStorage");let ei=Promise.all($.map(([$,ee])=>{return new Promise((et,ei)=>{let eo=en.put(ee,$);eo.onerror=$=>ei($);eo.onsuccess=$=>et(undefined)})}));rJ(et);return ei};const r3=async function($){let ee=await rG();let et=ee.transaction(["asyncStorage"],"readwrite");let en=et.objectStore("asyncStorage");let ei=Promise.all($.map($=>{return new Promise((ee,et)=>{let ei=en.delete($);ei.onerror=$=>et($);ei.onsuccess=$=>ee(undefined)})}));rJ(et);return ei};function r8($,ee){eE(2,arguments);var et=eS($);var en=eI(ee);if(isNaN(en)){return new Date(NaN)}if(!en){return et}var ei=et.getDate();var eo=new Date(et.getTime());eo.setMonth(et.getMonth()+en+1,0);var es=eo.getDate();if(ei>=es){return eo}else{et.setFullYear(eo.getFullYear(),eo.getMonth(),ei);return et}};function r5($,ee){eE(2,arguments);var et=eI(ee);return r8($,-et)};function r9($,ee){eE(2,arguments);var et=eS($);var en=eI(ee);if(isNaN(en)){return new Date(NaN)}if(!en){return et}et.setDate(et.getDate()+en);return et};function r7($,ee){eE(2,arguments);var et=eI(ee);var en=et*7;return r9($,en)};function ne($,ee){eE(2,arguments);var et=eS($);var en=eS(ee);var ei=et.getFullYear()-en.getFullYear();var eo=et.getMonth()-en.getMonth();return ei*12+eo};function nt($,ee){eE(2,arguments);var et=eI(ee);return r9($,-et)};function nn($,ee){eE(2,arguments);var et=eS($);var en=eS(ee);return et.getTime()<en.getTime()};function ni($,ee){eE(2,arguments);var et=eS($);var en=eS(ee);return et.getTime()>en.getTime()};function no($){eE(1,arguments);var ee=eS($);ee.setDate(1);ee.setHours(0,0,0,0);return ee};function ns($){eE(1,arguments);var ee=eS($);var et=ee.getMonth();ee.setFullYear(ee.getFullYear(),et+1,0);ee.setHours(23,59,59,999);return ee};var nu=Number.isNaN||function $($){return typeof $==="number"&&$!==$};function nc($,ee){if($===ee){return true}if(nu($)&&nu(ee)){return true}return false}function nf($,ee){if($.length!==ee.length){return false}for(var et=0;et<$.length;et++){if(!nc($[et],ee[et])){return false}}return true}function nh($,ee){if(ee===void 0){ee=nf}var et=null;function en(){var en=[];for(var ei=0;ei<arguments.length;ei++){en[ei]=arguments[ei]}if(et&&et.lastThis===this&&ee(en,et.lastArgs)){return et.lastResult}var eo=$.apply(this,en);et={lastResult:eo,lastArgs:en,lastThis:this};return eo}en.clear=function $(){et=null};return en};const ny=navigator.platform&&navigator.platform.toLowerCase()==="win32";const ng=navigator.platform&&navigator.platform.toUpperCase().indexOf("MAC")>=0;const nm=navigator.userAgent==="playwright";const n_=null&&(ny?"windows":ng?"mac":"linux");const nw="web";const nE=true;function nS($){if(typeof $==="string"){let[ee,et,en]=$.split("-");if(en!=null){return new Date(parseInt(ee),parseInt(et)-1,parseInt(en),12)}else if(et!=null){return new Date(parseInt(ee),parseInt(et)-1,1,12)}else{return new Date(parseInt(ee),0,1,12)}}if(typeof $==="number"){return new Date($)}return $}const nT=nS;function nO($){return t4(nS($),"yyyy")}function nA($){return t4(nS($),"yyyy-MM")}function nI($){return t4(nS($),"yyyy-MM-dd")}function nN(){if(__webpack_require__.g.IS_TESTING||nm){return __webpack_require__.g.currentMonth||"2017-01"}else{return t4(new Date,"yyyy-MM")}}function nD(){if(__webpack_require__.g.IS_TESTING||Platform.isPlaywright){return d.parse(nR(),"yyyy-MM-dd",new Date)}return new Date}function nR(){if(__webpack_require__.g.IS_TESTING||nm){return"2017-01-01"}else{return t4(new Date,"yyyy-MM-dd")}}function nC($){return d.format(d.addMonths(nS($),1),"yyyy-MM")}function nk($){return t4(r5(nS($),1),"yyyy-MM")}function nM($,ee){return t4(r8(nS($),ee),"yyyy-MM")}function nL($,ee){return t4(r7(nS($),ee),"yyyy-MM-dd")}function nx($,ee){return ne(nS($),nS(ee))}function nP($,ee){return t4(r5(nS($),ee),"yyyy-MM")}function nF($,ee){return t4(r9(nS($),ee),"yyyy-MM-dd")}function nB($,ee){return t4(nt(nS($),ee),"yyyy-MM-dd")}function nU($,ee){return nn(nS($),nS(ee))}function nj($,ee){return ni(nS($),nS(ee))}function nW($){return{start:parseInt(t4(no(nS($)),"yyyyMMdd")),end:parseInt(t4(ns(nS($)),"yyyyMMdd"))}}function nH($,ee,et=false){const en=[];let ei=nA($);while(nn(nS(ei),nS(ee))){en.push(ei);ei=nM(ei,1)}if(et){en.push(ei)}return en}function nz($,ee){return nH($,ee)}function nV($,ee){return nH($,ee,true)}function n$($,ee,et=false){const en=[];let ei=$;while(d.isBefore(nS(ei),nS(ee))){en.push(ei);ei=nF(ei,1)}if(et){en.push(ei)}return en}function nq($,ee){return n$($,ee)}function nG($,ee){return n$($,ee,true)}function nY($){return parseInt($.slice(5,7))-1}function nK($){return $.slice(0,4)}function nZ($){return $.slice(0,7)}function nJ($){return nK($)+"-01"}function nX($){return nK($)+"-12"}function nQ($){return"budget"+$.replace("-","")}function n0($){return d.format(nS($),"MMMM 'yy")}function n1($,ee){return t4(nS($),ee)}const n2=nh($=>{return new RegExp($.replace(/d+/g,"\\d{1,2}").replace(/M+/g,"\\d{1,2}").replace(/y+/g,"\\d{4}"))});const n6=nh($=>{return $.replace(/y+/g,"").replace(/[^\w]$/,"").replace(/^[^\w]/,"")});const n4=nh($=>{let ee=$.replace(/y+/g,"").replace(/[^\w]$/,"").replace(/^[^\w]/,"").replace(/d+/g,"\\d{1,2}").replace(/M+/g,"\\d{1,2}");return new RegExp("^"+ee+"$")});const n3=nh($=>{return $.replace(/d+/g,"").replace(/[^\w]$/,"").replace(/^[^\w]/,"").replace(/\/\//,"/").replace(/\.\./,".").replace(/--/,"-")});const n8=nh($=>{let ee=$.replace(/d+/g,"").replace(/[^\w]$/,"").replace(/^[^\w]/,"").replace(/\/\//,"/").replace(/M+/g,"\\d{1,2}").replace(/y+/g,"\\d{2,4}");return new RegExp("^"+ee+"$")});const n5=nh($=>{return $.replace(/y+/g,"yy")});const n9=nh($=>{let ee=$.replace(/[^\w]$/,"").replace(/^[^\w]/,"").replace(/d+/g,"\\d{1,2}").replace(/M+/g,"\\d{1,2}").replace(/y+/g,"\\d{2}");return new RegExp("^"+ee+"$")});function n7($){return $[$.length-1]}function ie($,ee){const et=$.id?{id:$.id}:{};const en=Object.keys(ee);let ei=false;for(let eo=0;eo<en.length;eo++){let es=en[eo];if($[es]!==ee[es]){et[es]=ee[es];ei=true}}return ei?et:null}function it($,ee,et){let en=false;for(let ei=0;ei<et.length;ei++){let eo=et[ei];if($[eo]!==ee[eo]){en=true;break}}return en}function ir($,ee){ee=[...ee];if($.added){$.added.forEach($=>{ee.push($)})}if($.updated){$.updated.forEach(({id:$,...et})=>{const en=ee.findIndex(ee=>ee.id===$);ee[en]={...ee[en],...et}})}if($.deleted){$.deleted.forEach($=>{const et=ee.findIndex(ee=>$.id===ee.id);if(et!==-1){ee.splice(et,1)}})}return ee}function ii($,ee){let et=new Map;for(let en=0;en<$.length;en++){let ei=$[en];let eo=ei[ee];let es=et.get(eo)||[];es.push(ei);et.set(eo,es)}return et}function io($,ee){let et=new Map;for(let en=0;en<$.length;en++){let ei=$[en];let eo=ei[ee];let es=et.get(eo)||[];et.set(eo,es.concat([ei]))}return et}function iu($){let ee=new Map;for(let et=0;et<$.length;et++){let en=$[et];ee.set(en.id,en)}return ee}function ip($,ee){let et=iu($);let en=iu(ee);let ei=[];let eo=[];let es=$.filter($=>!en.has($.id)).map($=>({id:$.id}));ee.forEach($=>{let ee=et.get($.id);if(!ee){ei.push($)}else{const et=ie(ee,$);if(et){eo.push(et)}}});return{added:ei,updated:eo,deleted:es}}function ih($){let ee={};for(let et=0;et<$.length;et++){let en=$[et];ee[en.id]=en}return ee}function iy($,ee,et){for(let en=0;en<ee.length;en++){const ei=ee[en];if(en===ee.length-1){$.set(ei,et)}else{if(!$.has(ei)){$.set(ei,new Map)}$=$.get(ei)}}}function ig($,ee){let et=$;for(let $=0;$<ee.length;$++){et=et.get(ee[$]);if(et==null){return et}}return et}function im($,ee){let et=new Set($);let en=ee.values();let ei=en.next();while(!ei.done){et.add(ei.value);ei=en.next()}return et}function i_($){return $[0].toUpperCase()+$.slice(1)}const iw=[{value:"comma-dot",label:"1,000.33",labelNoFraction:"1,000"},{value:"dot-comma",label:"1.000,33",labelNoFraction:"1.000"},{value:"space-comma",label:"1 000,33",labelNoFraction:"1 000"},{value:"space-dot",label:"1 000.33",labelNoFraction:"1 000"},{value:"comma-dot-in",label:"1,00,000.33",labelNoFraction:"1,00,000"}];let iE={format:"comma-dot",hideFraction:false};function iS($){iE=$}function iT({format:$,hideFraction:ee}=iE){let et,en,ei;switch($){case"space-comma":et="en-ZA";en=/[^-0-9,]/g;ei=",";break;case"dot-comma":et="de-DE";en=/[^-0-9,]/g;ei=",";break;case"space-dot":et="dje";en=/[^-0-9.]/g;ei=".";break;case"comma-dot-in":et="en-IN";en=/[^-0-9.]/g;ei=".";break;case"comma-dot":default:et="en-US";en=/[^-0-9.]/g;ei="."}return{value:$,separator:ei,formatter:new Intl.NumberFormat(et,{minimumFractionDigits:ee?0:2,maximumFractionDigits:ee?0:2}),regex:en}}const iO=2**51-1;const iI=-iO;function iN($){if(!Number.isInteger($)){throw new Error("safeNumber: number is not an integer: "+JSON.stringify($))}if($>iO||$<iI){throw new Error("safeNumber: can’t safely perform arithmetic with number: "+$)}return $}function iD($){return iP(iM($)||0)}function iR($,ee=iT().formatter){return ee.format(iN($)/100)}function iC($){return iT().formatter.format($)}function ik($){let ee=parseFloat($.replace(iT().regex,"").replace(iT().separator,"."));return isNaN(ee)?null:ee}function iM($){let ee=ik($);return ee==null?null:ix(ee)}function iL($){let ee=parseInt($.replace(/[^-0-9.,]/g,""));if(!isNaN(ee)){return ee}return null}function ix($){return Math.round($*100)}function iP($){return parseFloat((iN($)/100).toFixed(2))}function iF($){function ee($){return isNaN($)?null:$}function et($){return $.replace(/[^0-9-]/g,"")}if($.startsWith("(")&&$.endsWith(")")){$=$.replace("(","-").replace(")","")}let en=$.match(/[.,][^.,]*$/);if(!en||en.index===0){return ee(parseFloat(et($)))}let ei=et($.slice(0,en.index));let eo=et($.slice(en.index+1));return ee(parseFloat(ei+"."+eo))}function iU($,ee){return[...$].sort(($,et)=>{if($[ee]<et[ee]){return-1}else if($[ee]>et[ee]){return 1}return 0})};function ij($){return $.indexOf("preview/")!==-1}function iW($){return typeof $==="number"?$:0}function iH($,ee){let et=iW(ee.amount)-$;return{type:"SplitTransactionError",version:1,difference:et}}function iz($,ee){let et=$.id==="temp"?"temp":"";return{amount:0,...ee,payee:ee.payee||$.payee,id:ee.id?ee.id:et+e_(),account:$.account,date:$.date,cleared:$.cleared!=null?$.cleared:null,starting_balance_flag:$.starting_balance_flag!=null?$.starting_balance_flag:null,is_child:true,parent_id:$.id,error:null}}function iV($){const ee=$.subtransactions.reduce(($,ee)=>$+iW(ee.amount),0);return{...$,error:ee===iW($.amount)?null:iH(ee,$)}}function i$($,ee){while(ee>=0){let et=$[ee];if(et.is_parent){return ee}ee--}return null}function iq($,ee){let et=[$[ee]];let en=ee+1;while(en<$.length&&$[en].is_child){et.push($[en]);en++}return et}function iG($){let ee=$.reduce(($,ee)=>{let{subtransactions:et,...en}=ee;et=et||[];$.push(en);for(let ee=0;ee<et.length;ee++){$.push(et[ee])}return $},[]);return ee}function iY($){return{...$[0],subtransactions:$.slice(1)}}function iK($){if($==null){return null}return iG([$])}function iZ($,ee){return iY(applyChanges(ee,iK($)))}function iJ($,ee,et){let en=$.findIndex($=>$.id===ee);let ei=$[en];let eo=[...$];if(en===-1){throw new Error("Tried to edit unknown transaction id: "+ee)}if(ei.is_parent||ei.is_child){let ee=i$($,en);if(ee==null){console.log("Cannot find parent index");return{diff:{deleted:[],updated:[]}}}let ei=iq($,ee);let es=et(iY(ei));let eu=iK(es);let el;if(eu==null){el={deleted:[{id:ei[0].id}],updated:[]};es={id:ei[0].id,_deleted:true};eo.splice(ee,ei.length)}else{el=ip(ei,eu);eo.splice(ee,ei.length,...eu)}return{data:eo,newTransaction:es,diff:el}}else{let $=et(ei);let ee=iK($)||[];if($){$.subtransactions=$.subtransactions||[]}eo.splice(en,1,...ee);return{data:eo,newTransaction:$||{id:ei.id,_deleted:true},diff:ip([ei],ee)}}}function iX($,ee){return iJ($,ee,$=>{if(!$.is_parent){return $}let ee=last($.subtransactions);$.subtransactions.push(iz($,{amount:0,sort_order:iW(ee&&ee.sort_order)-1}));return $})}function iQ($,ee){return iJ($,ee.id,$=>{if($.is_parent){let et=$.id===ee.id?ee:$;let en=$.subtransactions.map(en=>{let ei=en;if($.id===ee.id){ei={...en,payee:en.payee===$.payee?ee.payee:en.payee}}else if(en.id===ee.id){ei=ee}return iz(et,ei)});return iV({...et,subtransactions:en})}else{return ee}})}function i0($,ee){return iJ($,ee,$=>{if($.is_parent){if($.id===ee){return null}else if($.subtransactions.length===1){return{...$,subtransactions:null,is_parent:false,error:null}}else{let et=$.subtransactions.filter($=>$.id!==ee);return iV({...$,subtransactions:et})}}else{return null}})}function i1($,ee){return iJ($,ee,$=>{if($.is_parent||$.is_child){return $}return{...$,is_parent:true,error:iW($.amount)===0?null:iH(0,$),subtransactions:[iz($,{amount:0,sort_order:-1})]}})}function i2($){let ee=$.find($=>!$.is_child);ee={...ee,id:uuidv4()};let et=$.filter($=>$.is_child);return[ee,...et.map($=>({...$,id:uuidv4(),parent_id:ee.id}))]}var i6=__webpack_require__(9593);var i4=__webpack_require__.n(i6);const i3={EPERM:63,ENOENT:44};class i8{constructor($,ee){this.FS=$;this.backend=ee;this.node_ops={getattr:ee=>{let et=$.isFile(ee.mode)?ee.contents.getattr():null;let en={};en.dev=1;en.ino=ee.id;en.mode=et?et.mode:ee.mode;en.nlink=1;en.uid=0;en.gid=0;en.rdev=ee.rdev;en.size=et?et.size:$.isDir(ee.mode)?4096:0;en.atime=new Date(0);en.mtime=new Date(0);en.ctime=new Date(0);en.blksize=et?et.blockSize:4096;en.blocks=Math.ceil(en.size/en.blksize);return en},setattr:($,ee)=>{if(this.FS.isFile($.mode)){$.contents.setattr(ee)}else{if(ee.mode!=null){$.mode=ee.mode}if(ee.size!=null){$.size=ee.size}}},lookup:($,ee)=>{throw new this.FS.ErrnoError(i3.ENOENT)},mknod:($,ee,et,en)=>{if(ee.endsWith(".lock")){throw new Error("Locking via lockfiles is not supported")}return this.createNode($,ee,et,en)},rename:($,ee,et)=>{throw new Error("rename not implemented")},unlink:($,ee)=>{let et=this.FS.lookupNode($,ee);et.contents.delete(ee)},readdir:$=>{throw new Error("readdir not implemented")},symlink:($,ee,et)=>{throw new Error("symlink not implemented")},readlink:$=>{throw new Error("symlink not implemented")}};this.stream_ops={open:$=>{if(this.FS.isFile($.node.mode)){$.node.contents.open()}},close:$=>{if(this.FS.isFile($.node.mode)){$.node.contents.close()}},read:($,ee,et,en,ei)=>{return $.node.contents.read(ee,et,en,ei)},write:($,ee,et,en,ei)=>{return $.node.contents.write(ee,et,en,ei)},llseek:(ee,et,en)=>{var ei=et;if(en===1){ei+=ee.position}else if(en===2){if($.isFile(ee.node.mode)){ei+=ee.node.contents.getattr().size}}if(ei<0){throw new this.FS.ErrnoError(28)}return ei},allocate:($,ee,et)=>{$.node.contents.setattr({size:ee+et})},mmap:($,ee,et,en,ei,eo)=>{throw new Error("mmap not implemented")},msync:($,ee,et,en,ei)=>{throw new Error("msync not implemented")},fsync:($,ee,et,en,ei)=>{$.node.contents.fsync()}}}mount(){return this.createNode(null,"/",16384|511,0)}lock($,ee){let{node:et}=this.FS.lookupPath($);if(et&&et.contents){return et.contents.lock(ee)}return true}unlock($,ee){let{node:et}=this.FS.lookupPath($);if(et&&et.contents){return et.contents.unlock(ee)}return true}createNode($,ee,et,en){if(!(this.FS.isDir(et)||this.FS.isFile(et))){throw new this.FS.ErrnoError(i3.EPERM)}var ei=this.FS.createNode($,ee,et,en);if(this.FS.isDir(ei.mode)){ei.node_ops={mknod:this.node_ops.mknod,lookup:this.node_ops.lookup,unlink:this.node_ops.unlink,setattr:this.node_ops.setattr};ei.stream_ops={};ei.contents={}}else if(this.FS.isFile(ei.mode)){ei.node_ops=this.node_ops;ei.stream_ops=this.stream_ops;ei.contents=this.backend.createFile(ee)}if($){$.contents[ee]=ei;$.timestamp=ei.timestamp}return ei}}const i5=i8;let i9={NONE:0,SHARED:1,RESERVED:2,PENDING:3,EXCLUSIVE:4};function i7($){let ee=$[16];let et=$[17];return(ee<<8)+et}function ae($,ee){if($!=null&&ee!=null){let et=new Uint8Array($);let en=new Uint8Array(ee);for(let $=24;$<40;$++){if(et[$]!==en[$]){return false}}return true}return $==null&&ee==null}function at($,ee,et){let en=[];for(let ei=$;ei<=ee;ei+=et){en.push(ei)}return en}function an($,ee,et){let en=ee-ee%$;let ei=et-1-(et-1)%$;return at(en,ei,$)}function ao($,ee,et){let en=new ArrayBuffer(et-ee);let ei=new Uint8Array(en);for(let en=0;en<$.length;en++){let eo=$[en];if(eo.data.constructor.name!=="ArrayBuffer"){throw new Error("Chunk data is not an ArrayBuffer")}let es=0;let eu=eo.data.byteLength;if(ee>eo.pos){es=ee-eo.pos}if(et<eo.pos+eo.data.byteLength){eu=et-eo.pos}if(es>eo.data.byteLength||eu<0){continue}let el=eu-es;ei.set(new Uint8Array(eo.data,es,el),eo.pos-ee+es)}return en}function au($,ee,et,en){let ei=an(ee,et,en);let eo=0;return ei.map(ei=>{let es=0;let eu=ee;if(et>ei&&et<ei+ee){es=et-ei}if(en>ei&&en<ei+ee){eu=en-ei}let el=eu-es;let ef=new ArrayBuffer(ee);if(et>ei+ee||en<=ei){return null}let ed=$.byteOffset+eo;let ep=$.buffer.byteLength-ed;if(ep<=0){return null}let eh=Math.min(el,ep);new Uint8Array(ef).set(new Uint8Array($.buffer,ed,eh),es);eo+=eh;return{pos:ei,data:ef,offset:es,length:eh}}).filter(Boolean)}class al{constructor($,ee,et=null){this.filename=$;this.buffer=new Map;this.ops=ee;this.meta=et;this._metaDirty=false;this.writeLock=false;this.openHandles=0}bufferChunks($){for(let ee=0;ee<$.length;ee++){let et=$[ee];this.buffer.set(et.pos,et)}}open(){this.openHandles++;if(this.openHandles===1){this.ops.open();let $=this.ops.readMeta();if(this.meta==null){if($==null){$={size:0}}this.meta=$}}return this.meta}close(){this.fsync();this.openHandles=Math.max(this.openHandles-1,0);if(this.openHandles===0){this.ops.close()}}delete(){this.ops.delete()}load($){let ee=$.reduce(($,ee)=>{let et=this.buffer.get(ee);if(et){$.chunks.push(et)}else{$.missing.push(ee)}return $},{chunks:[],missing:[]});let et=[];if(ee.missing.length>0){et=this.ops.readBlocks(ee.missing,this.meta.blockSize)}return ee.chunks.concat(et)}read($,ee,et,en){let ei=$.buffer;if(et<=0){return 0}if(en<0){return 0}if(en>=this.meta.size){let $=new Uint8Array(ei,ee);for(let ee=0;ee<et;ee++){$[ee]=0}return et}en=Math.max(en,0);let eo=Math.min(et,this.meta.size-en);let es=en;let eu=en+eo;let el=an(this.meta.blockSize,es,eu);let ef=this.load(el);let ed=ao(ef,es,eu);if(ei.byteLength-ee<ed.byteLength){throw new Error("Buffer given to `read` is too small")}let ep=new Uint8Array(ei);ep.set(new Uint8Array(ed),ee);for(let $=eo;$<et;$++){ep[ee+$]=0}return et}write($,ee,et,en){if(this.meta.blockSize==null){let et=i7(new Uint8Array($.buffer,$.byteOffset+ee));if(![512,1024,2048,4096,8192,16384,32768,65536].includes(et)){throw new Error("File has invalid page size. (the first block of a new file must be written first)")}this.setattr({blockSize:et})}let ei=$.buffer;if(et<=0){return 0}if(en<0){return 0}if(ei.byteLength===0){return 0}et=Math.min(et,ei.byteLength-ee);let eo=au(new Uint8Array(ei,ee,et),this.meta.blockSize,en,en+et);let{partialWrites:es,fullWrites:eu}=eo.reduce(($,ee)=>{if(ee.length!==this.meta.blockSize){$.partialWrites.push(ee)}else{$.fullWrites.push({pos:ee.pos,data:ee.data})}return $},{fullWrites:[],partialWrites:[]});let el=[];if(es.length>0){el=this.load(es.map($=>$.pos))}let ef=eu.concat(el.map($=>{let ee=es.find(ee=>ee.pos===$.pos);new Uint8Array($.data).set(new Uint8Array(ee.data,ee.offset,ee.length),ee.offset,ee.length);return $}));this.bufferChunks(ef);if(en+et>this.meta.size){this.setattr({size:en+et})}return et}async readIfFallback(){if(this.ops.readIfFallback){let $=await this.ops.readIfFallback();this.meta=$||{size:0}}}lock($){if(!this._recordingLock){this._recordingLock=true}if(this.ops.lock($)){if($>=i9.RESERVED){this.writeLock=true}return true}return false}unlock($){if($===0){this._recordingLock=false}if(this.writeLock){this.fsync();this.writeLock=false}return this.ops.unlock($)}fsync(){if(this.buffer.size>0){let $=this.buffer.get(0);if($){let ee=i7(new Uint8Array($.data));if(ee!==this.meta.blockSize){let $=this.buffer;this.buffer=new Map;let et=[...$.values()];let en=et.length*this.meta.blockSize;let ei=new ArrayBuffer(en);let eo=new Uint8Array(ei);for(let $ of et){eo.set(new Uint8Array($.data),$.pos)}this.bufferChunks(au(eo,ee,0,en));this.setattr({blockSize:ee})}}this.ops.writeBlocks([...this.buffer.values()],this.meta.blockSize)}if(this._metaDirty){this.ops.writeMeta({size:this.meta.size});this._metaDirty=false}this.buffer=new Map}setattr($){if(this.meta==null){this.meta={}}if($.mode!==undefined){this.meta.mode=$.mode}if($.blockSize!==undefined){this.meta.blockSize=$.blockSize}if($.size!==undefined){this.meta.size=$.size;this._metaDirty=true}}getattr(){return this.meta}}let af=3735928559;let ad=0;let ap=1;class ah{constructor($,{initialOffset:ee=4,useAtomics:et=true,stream:en=true,debug:ei,name:eo}={}){this.buffer=$;this.atomicView=new Int32Array($);this.offset=ee;this.useAtomics=et;this.stream=en;this.debug=ei;this.name=eo}log(...$){if(this.debug){console.log(`[reader: ${this.name}]`,...$)}}waitWrite($,ee=null){if(this.useAtomics){this.log(`waiting for ${$}`);while(Atomics.load(this.atomicView,0)===ad){if(ee!=null){if(Atomics.wait(this.atomicView,0,ad,ee)==="timed-out"){throw new Error("timeout")}}Atomics.wait(this.atomicView,0,ad,500)}this.log(`resumed for ${$}`)}else{if(this.atomicView[0]!==ap){throw new Error("`waitWrite` expected array to be readable")}}}flip(){this.log("flip");if(this.useAtomics){let $=Atomics.compareExchange(this.atomicView,0,ap,ad);if($!==ap){throw new Error("Read data out of sync! This is disastrous")}Atomics.notify(this.atomicView,0)}else{this.atomicView[0]=ad}this.offset=4}done(){this.waitWrite("done");let $=new DataView(this.buffer,this.offset);let ee=$.getUint32(0)===af;if(ee){this.log("done");this.flip()}return ee}peek($){this.peekOffset=this.offset;let ee=$();this.offset=this.peekOffset;this.peekOffset=null;return ee}string($){this.waitWrite("string",$);let ee=this._int32();let et=ee/2;let en=new DataView(this.buffer,this.offset,ee);let ei=[];for(let $=0;$<et;$++){ei.push(en.getUint16($*2))}let eo=String.fromCharCode.apply(null,ei);this.log("string",eo);this.offset+=ee;if(this.peekOffset==null){this.flip()}return eo}_int32(){let $=4;let ee=new DataView(this.buffer,this.offset);let et=ee.getInt32();this.log("_int32",et);this.offset+=$;return et}int32(){this.waitWrite("int32");let $=this._int32();this.log("int32",$);if(this.peekOffset==null){this.flip()}return $}bytes(){this.waitWrite("bytes");let $=this._int32();let ee=new ArrayBuffer($);new Uint8Array(ee).set(new Uint8Array(this.buffer,this.offset,$));this.log("bytes",ee);this.offset+=$;if(this.peekOffset==null){this.flip()}return ee}}class ay{constructor($,{initialOffset:ee=4,useAtomics:et=true,stream:en=true,debug:ei,name:eo}={}){this.buffer=$;this.atomicView=new Int32Array($);this.offset=ee;this.useAtomics=et;this.stream=en;this.debug=ei;this.name=eo;if(this.useAtomics){Atomics.store(this.atomicView,0,ad)}else{this.atomicView[0]=ad}}log(...$){if(this.debug){console.log(`[writer: ${this.name}]`,...$)}}waitRead($){if(this.useAtomics){this.log(`waiting for ${$}`);let ee=Atomics.compareExchange(this.atomicView,0,ad,ap);if(ee!==ad){throw new Error("Wrote something into unwritable buffer! This is disastrous")}Atomics.notify(this.atomicView,0);while(Atomics.load(this.atomicView,0)===ap){Atomics.wait(this.atomicView,0,ap,500)}this.log(`resumed for ${$}`)}else{this.atomicView[0]=ap}this.offset=4}finalize(){this.log("finalizing");let $=new DataView(this.buffer,this.offset);$.setUint32(0,af);this.waitRead("finalize")}string($){this.log("string",$);let ee=$.length*2;this._int32(ee);let et=new DataView(this.buffer,this.offset,ee);for(let ee=0;ee<$.length;ee++){et.setUint16(ee*2,$.charCodeAt(ee))}this.offset+=ee;this.waitRead("string")}_int32($){let ee=4;let et=new DataView(this.buffer,this.offset);et.setInt32(0,$);this.offset+=ee}int32($){this.log("int32",$);this._int32($);this.waitRead("int32")}bytes($){this.log("bytes",$);let ee=$.byteLength;this._int32(ee);new Uint8Array(this.buffer,this.offset).set(new Uint8Array($));this.offset+=ee;this.waitRead("bytes")}}function ag($,ee){return Math.round($/ee)}function am($,ee){self.postMessage({type:"__absurd:spawn-idb-worker",argBuffer:ee.buffer,resultBuffer:$.buffer});self.addEventListener("message",et=>{switch(et.data.type){case"__perf-deets:start-profile":ee.string("profile-start");ee.finalize();$.int32();$.done();break;case"__perf-deets:stop-profile":ee.string("profile-stop");ee.finalize();$.int32();$.done();break}})}class a_{constructor($){this.filename=$}getStoreName(){return this.filename.replace(/\//g,"-")}invokeWorker($,ee){if(this.reader==null||this.writer==null){throw new Error(`Attempted ${$} on ${this.filename} but file not open`)}let et=this.reader;let en=this.writer;switch($){case"readBlocks":{let{name:$,positions:ei,blockSize:eo}=ee;let es=[];for(let ee of ei){en.string("readBlock");en.string($);en.int32(ag(ee,eo));en.finalize();let ei=et.bytes();et.done();es.push({pos:ee,data:ei.byteLength===0?new ArrayBuffer(eo):ei})}return es}case"writeBlocks":{let{name:$,writes:ei,blockSize:eo}=ee;en.string("writeBlocks");en.string($);for(let $ of ei){en.int32(ag($.pos,eo));en.bytes($.data)}en.finalize();let es=et.int32();et.done();return es}case"readMeta":{en.string("readMeta");en.string(ee.name);en.finalize();let $=et.int32();let ei=et.int32();et.done();return $===-1?null:{size:$,blockSize:ei}}case"writeMeta":{let{name:$,meta:ei}=ee;en.string("writeMeta");en.string($);en.int32(ei.size);en.finalize();let eo=et.int32();et.done();return eo}case"closeFile":{en.string("closeFile");en.string(ee.name);en.finalize();let $=et.int32();et.done();return $}case"lockFile":{en.string("lockFile");en.string(ee.name);en.int32(ee.lockType);en.finalize();let $=et.int32();et.done();return $===0}case"unlockFile":{en.string("unlockFile");en.string(ee.name);en.int32(ee.lockType);en.finalize();let $=et.int32();et.done();return $===0}}}lock($){return this.invokeWorker("lockFile",{name:this.getStoreName(),lockType:$})}unlock($){return this.invokeWorker("unlockFile",{name:this.getStoreName(),lockType:$})}delete(){if(this.reader||this.writer){this.close()}let $=globalThis.indexedDB.deleteDatabase(this.getStoreName());$.onerror=()=>{console.warn(`Deleting ${this.filename} database failed`)};$.onsuccess=()=>{}}open(){let $=new SharedArrayBuffer(4096*9);this.writer=new ay($,{name:"args (backend)",debug:false});let ee=new SharedArrayBuffer(4096*9);this.reader=new ah(ee,{name:"results",debug:false});am(this.reader,this.writer)}close(){this.invokeWorker("closeFile",{name:this.getStoreName()});this.reader=null;this.writer=null;this.worker=null}readMeta(){return this.invokeWorker("readMeta",{name:this.getStoreName()})}writeMeta($){return this.invokeWorker("writeMeta",{name:this.getStoreName(),meta:$})}readBlocks($,ee){if(this.stats){this.stats.read+=$.length}return this.invokeWorker("readBlocks",{name:this.getStoreName(),positions:$,blockSize:ee})}writeBlocks($,ee){if(this.stats){this.stats.writes+=$.length}return this.invokeWorker("writeBlocks",{name:this.getStoreName(),writes:$,blockSize:ee})}}function av(){const $=!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent);if(!$||!indexedDB.databases)return Promise.resolve();let ee;return new Promise($=>{const et=()=>indexedDB.databases().finally($);ee=setInterval(et,100);et()}).finally(()=>clearInterval(ee))}function aw($,ee){return Math.round($/ee)}async function aE($){await av();return new Promise((ee,et)=>{let en=globalThis.indexedDB.open($,2);en.onsuccess=$=>{let et=$.target.result;et.onversionchange=()=>{console.log("closing because version changed");et.close()};et.onclose=()=>{};ee(et)};en.onupgradeneeded=$=>{let ee=$.target.result;if(!ee.objectStoreNames.contains("data")){ee.createObjectStore("data")}};en.onblocked=$=>console.log("blocked",$);en.onerror=en.onabort=$=>et($.target.error)})}class aS{constructor($,ee){this.dbName=$;this._openDb=null;this.hasAlertedFailure=false;this.onFallbackFailure=ee}async getDb(){if(this._openDb){return this._openDb}this._openDb=await aE(this.dbName);return this._openDb}closeDb(){if(this._openDb){this._openDb.close();this._openDb=null}}async readAll(){let $=await this.getDb(this.dbName);let ee=new Map;let et=$.transaction(["data"],"readonly");let en=et.objectStore("data");return new Promise(($,et)=>{let ei=en.openCursor(IDBKeyRange.lowerBound(-1));ei.onerror=et;ei.onsuccess=et=>{let en=et.target.result;if(en){ee.set(en.key,en.value);en.continue()}else{$(ee)}}})}async write($,ee,et){let en=await this.getDb(this.dbName);let ei=en.transaction(["data"],"readwrite");let eo=ei.objectStore("data");await new Promise((en,es)=>{let eu=eo.get(0);eu.onsuccess=el=>{if(et){if(!ae(eu.result,ee)){if(this.onFallbackFailure&&!this.hasAlertedFailure){this.hasAlertedFailure=true;this.onFallbackFailure()}es(new Error("Fallback mode unable to write file changes"));return}}for(let ee of $){eo.put(ee.value,ee.key)}ei.onsuccess=()=>en();ei.onerror=()=>es()};eu.onerror=es})}}class aT{constructor($,ee){this.filename=$;this.dbName=this.filename.replace(/\//g,"-");this.cachedFirstBlock=null;this.writeQueue=null;this.blocks=new Map;this.lockType=0;this.transferBlockOwnership=false;this.persistance=new aS(this.dbName,ee)}async readIfFallback(){this.transferBlockOwnership=true;this.blocks=await this.persistance.readAll();return this.readMeta()}lock($){this.cachedFirstBlock=this.blocks.get(0);this.lockType=$;return true}unlock($){if(this.lockType>i9.SHARED&&$===i9.SHARED){this.flush()}this.lockType=$;return true}delete(){let $=globalThis.indexedDB.deleteDatabase(this.dbName);$.onerror=()=>{console.warn(`Deleting ${this.filename} database failed`)};$.onsuccess=()=>{}}open(){this.writeQueue=[];this.lockType=0}close(){this.flush();if(this.transferBlockOwnership){this.transferBlockOwnership=false}else{this.blocks=new Map}this.persistance.closeDb()}readMeta(){let $=this.blocks.get(-1);if($){let ee=this.blocks.get(0);return{size:$.size,blockSize:i7(new Uint8Array(ee))}}return null}writeMeta($){this.blocks.set(-1,$);this.queueWrite(-1,$)}readBlocks($,ee){let et=[];for(let en of $){et.push({pos:en,data:this.blocks.get(aw(en,ee))})}return et}writeBlocks($,ee){for(let et of $){let $=aw(et.pos,ee);this.blocks.set($,et.data);this.queueWrite($,et.data)}if(this.lockType<=i9.SHARED){this.flush()}}queueWrite($,ee){this.writeQueue.push({key:$,value:ee})}flush(){if(this.writeQueue.length>0){this.persistance.write(this.writeQueue,this.cachedFirstBlock,this.lockType>i9.SHARED);this.writeQueue=[]}this.cachedFirstBlock=null}}class aO{constructor($){this.onFallbackFailure=$}createFile($){let ee;if(typeof SharedArrayBuffer!=="undefined"){ee=new a_($)}else{ee=new aT($,this.onFallbackFailure)}let et=new al($,ee);if(false||({}).PERF_BUILD){if(this._files==null){this._files=new Set}this._files.add(et)}return et}startProfile(){for(let $ of this._files){if($.ops.writer){let ee=$.ops.writer;let et=$.ops.reader;ee.string("profile-start");ee.finalize();et.int32();et.done()}}}stopProfile(){for(let $ of this._files){if($.ops.writer){let ee=$.ops.writer;let et=$.ops.reader;ee.string("profile-stop");ee.finalize();et.int32();et.done()}}}}const aA=aO;const aI=function($){console.log("[Exception]",$)};const aN=function($){};function aD($){let ee={running:null,queue:[]};function et(){if(ee.queue.length>0){const $=ee.queue.shift();en($.args,$.resolve,$.reject)}else{ee.running=null}}function en(en,ei,eo){ee.running=$(...en);ee.running.then($=>{et();ei($)},$=>{et();eo($)})}return(...$)=>{if(!ee.running){return new Promise((ee,et)=>{return en($,ee,et)})}else{return new Promise((et,en)=>{ee.queue.push({resolve:et,reject:en,args:$})})}}}function aR($){let ee=null;let et=(...et)=>{if(!ee){ee=$(...et).finally(()=>{ee=null});return ee}return ee};return et};let aC=new Set;let ak=null;let aM=new WeakMap;let aL=false;let ax=[];function aP($){aM.set($,true);return $}function aF($){return aM.has($)}async function aB(){await aU(200);while(aC.size>0){await Promise.all([...aC.values()]);await aU(100)}}function aU($){return new Promise(ee=>setTimeout(ee,$))}async function aj($,ee,{undoTag:et,name:en}={}){ax.push(en);if(ax.length>5){ax=ax.slice(-5)}if(aM.has($)){return aV(()=>$(ee),{undoTag:et})}if(en==="close-budget"){await aB()}let ei=$(ee);aC.add(ei);ei.then(()=>{aC.delete(ei)});return ei}function aW(){if(false){}}function aH(){if(false){}}function az($,ee={}){ak=ee;return $().finally(()=>{ak=null})}const aV=aD(az);function a$($,ee){if(ak==null&&!aL){aN("Recent methods: "+ax.join(", "));aI(new Error("withMutatorContext: mutator not running"));return ee()}let et=ak;ak={...ak,...$};return ee().finally(()=>{ak=et})}function aq(){if(ak==null){aN({category:"server",message:"Recent methods: "+ax.join(", ")});return{}}if(ak==null&&aL){return{}}return ak};function aG(){let $=typeof window!=="undefined"?window:typeof self!=="undefined"?self:null;if(!$){throw new Error("Cannot get global object")}return $}aG().__globalServerChannel=null;function aY($){if($.type&&$.type==="APIError"){return $}return{type:"InternalError",message:$.message}}const aK=function($,ee){const et=$;aG().__globalServerChannel=et;et.addEventListener("message",$=>{let en=$.data;let ei=typeof en==="string"?JSON.parse(en):en;if(ei.type&&(ei.type==="init"||ei.type.startsWith("__"))){return}let{id:eo,name:es,args:eu,undoTag:el,catchErrors:ef}=ei;if(ee[es]){aj(ee[es],eu,{undoTag:el,name:es}).then($=>{if(ef){$={data:$,error:null}}et.postMessage({type:"reply",id:eo,result:$,mutated:aF(ee[es]),undoTag:el})},$=>{let ee=aY($);if(es.startsWith("api/")){et.postMessage({type:"reply",id:eo,error:ee})}else if(ef){et.postMessage({type:"reply",id:eo,result:{error:ee,data:null}})}else{et.postMessage({type:"error",id:eo})}if(ee.type==="InternalError"){aI($)}if(!ef){aZ("server-error")}})}else{console.warn("Unknown method: "+es);et.postMessage({type:"reply",id:eo,result:null,error:{type:"APIError",message:"Unknown method: "+es}})}},false);et.postMessage({type:"connect"})};const aZ=function($,ee){const{__globalServerChannel:et}=aG();if(et){et.postMessage({type:"push",name:$,args:ee})}};const aJ=function(){return 1};var aX=__webpack_require__(9298);var aQ=__webpack_require__.n(aX);let a0=null;async function a1(){return new Promise(($,ee)=>{aQ()({locateFile:$=>"/"+$}).then(ee=>{a0=ee;$(undefined)},$=>{ee($)})})}function a2(){if(a0==null){throw new Error("_getModule: sql.js must be initialized first")}return a0}function a6($,ee){ee.forEach(ee=>{if(typeof ee!=="string"&&typeof ee!=="number"&&ee!==null){throw new Error("Invalid field type "+ee+" for sql "+$)}})}function a4($,ee){return $.prepare(ee)}function a3($,ee,et=[],en=false){if(et){a6(ee,et)}let ei=typeof ee==="string"?$.prepare(ee):ee;if(en){try{ei.bind(et);let $=[];while(ei.step()){$.push(ei.getAsObject())}if(typeof ee==="string"){ei.free()}else{ei.reset()}return $}catch($){console.log(ee);throw $}}else{try{ei.run(et);return{changes:$.getRowsModified()}}catch($){throw $}}}function a8($,ee){$.exec(ee)}let a5=0;function a9($,ee){let et,en,ei;if(a5>0){et="SAVEPOINT __actual_sp";en="RELEASE __actual_sp";ei="ROLLBACK TO __actual_sp"}else{et="BEGIN";en="COMMIT";ei="ROLLBACK"}a8($,et);a5++;try{const et=ee();a8($,en);return et}catch(ee){a8($,ei);if(ei!=="ROLLBACK"){a8($,en)}throw ee}finally{a5--}}async function a7($,ee){if(a5===0){$.exec("BEGIN TRANSACTION")}a5++;try{await ee()}finally{a5--;if(a5===0){$.exec("COMMIT")}}}async function oe($){let ee=null;if($){if(typeof $!=="string"){ee=new a0.Database($)}else{let et=$;if(et!==":memory:"){if(typeof SharedArrayBuffer==="undefined"){let $=a0.FS.open(a0.FS.readlink(et),"a+");await $.node.contents.readIfFallback();a0.FS.close($)}ee=new a0.Database(et.includes("/blocked")?et:a0.FS.readlink(et),{filename:true});ee.exec(`
17
+ PRAGMA journal_mode=MEMORY;
18
+ PRAGMA cache_size=-10000;
19
+ `)}}}if(ee===null){ee=new a0.Database}ee.create_function("UNICODE_LOWER",$=>$?.toLowerCase());ee.create_function("UNICODE_UPPER",$=>$?.toUpperCase());return ee}function ot($){$.close()}async function or($){return $.export()};function oi($,ee){let et="";let en=0;let ei=-1;let eo=0;let es;for(let eu=0;eu<=$.length;++eu){if(eu<$.length)es=$.charCodeAt(eu);else if(es===47)break;else es=47;if(es===47){if(ei===eu-1||eo===1){}else if(ei!==eu-1&&eo===2){if(et.length<2||en!==2||et.charCodeAt(et.length-1)!==46||et.charCodeAt(et.length-2)!==46){if(et.length>2){let $=et.lastIndexOf("/");if($!==et.length-1){if($===-1){et="";en=0}else{et=et.slice(0,$);en=et.length-1-et.lastIndexOf("/")}ei=eu;eo=0;continue}}else if(et.length===2||et.length===1){et="";en=0;ei=eu;eo=0;continue}}if(ee){if(et.length>0)et+="/..";else et="..";en=2}}else{if(et.length>0)et+="/"+$.slice(ei+1,eu);else et=$.slice(ei+1,eu);en=eu-ei-1}ei=eu;eo=0}else if(es===46&&eo!==-1){++eo}else{eo=-1}}return et}function oo($){if($.length===0)return".";let ee=$.charCodeAt(0)===47;let et=$.charCodeAt($.length-1)===47;$=oi($,!ee);if($.length===0&&!ee)$=".";if($.length>0&&et)$+="/";if(ee)return"/"+$;return $}const os=(...$)=>{if($.length===0)return".";let ee;for(let et=0;et<$.length;++et){let en=$[et];if(en.length>0){if(ee===undefined)ee=en;else ee+="/"+en}}if(ee===undefined)return".";return oo(ee)};const ou=os;let ol;const oc=$=>ol=$;const of=()=>{if(!ol){throw new Error("Document directory is not set")}return ol};const od=$=>{if(!$){throw new Error("getDocumentDir: id is falsy: "+$)}if($.match(/[^A-Za-z0-9\-_]/)){throw new Error(`Invalid budget id “${$}”. Check the id of your budget in the Advanced section of the settings page.`)}return ou(of(),$)};let oh=null;let oy=null;let og=false;const om="/default-db.sqlite";const o_="/migrations";const ov="/demo-budget";const ow=()=>"/";const oE=function($){return $.replace(/^\//,"").replace(/\//g,"-")};function oS($){try{oh.readlink($);return true}catch($){}try{oh.stat($);return true}catch($){}return false}function oT($){let ee=$.split("/").filter($=>$!=="");let et="";for(let $ of ee){et+="/"+$;if(!oS(et)){oh.mkdir(et)}}}function oO($){if(!og&&$.startsWith("/documents")){if($.endsWith(".sqlite")){if(!oS($)){oh.symlink("/blocked/"+oE($),$)}}else{oh.writeFile($,"!$@) this should never read !$@)")}}return $}async function oA($,ee){if(!og&&$.startsWith("/documents")&&!$.endsWith(".sqlite")){if(!oS($)){throw new Error("File does not exist: "+$)}let{store:et}=rz(await rG(),"files");let en=await rV(et,$);if(en==null){throw new Error("File does not exist: "+$)}if(ee.encoding==="utf8"&&ArrayBuffer.isView(en.contents)){return String.fromCharCode.apply(null,new Uint16Array(en.contents.buffer))}return en.contents}else{return oh.readFile(oI($),ee)}}function oI($){try{let{node:ee}=oh.lookupPath($,{follow:false});return ee.link?oh.readlink($):$}catch(ee){return $}}async function oN($,ee){if(ee instanceof ArrayBuffer){ee=new Uint8Array(ee)}else if(ArrayBuffer.isView(ee)){ee=new Uint8Array(ee.buffer)}oO($);if(!og&&$.startsWith("/documents")){let et=$.endsWith(".sqlite");let{store:en}=rz(await rG(),"files");if(et){await r$(en,{filepath:$,contents:""});await Promise.resolve();oh.writeFile(oI($),ee)}else{await r$(en,{filepath:$,contents:ee})}}else{oh.writeFile(oI($),ee)}}async function oD($){if(!og&&$.startsWith("/documents")){let ee=$.endsWith(".sqlite");let{store:et}=rz(await rG(),"files");await rq(et,$);if(ee){let ee=oI($);if(oS(ee)){oh.unlink(ee)}}}oh.unlink($)}async function oR(){let $=await (await fetch("/"+"data-file-index.txt")).text();let ee=$.split("\n").map($=>$.trim()).filter($=>$!=="");let et=$=>fetch($).then($=>$.arrayBuffer());await oF("/migrations");await oF("/demo-budget");await Promise.all(ee.map(async $=>{let ee=await et("/"+"data/"+$);oN("/"+$,ee)}))}const oC=async function(){let{store:$}=rz(await rG(),"files");let ee=$.getAllKeys();let et=await new Promise(($,et)=>{ee.onsuccess=ee=>$(ee.target.result);ee.onerror=$=>et($)});for(let $ of et){oT(oL($));oO($)}};const oM=async function(){let $=a2();oh=$.FS;oh.mkdir("/uploads");oh.mkdir("/documents");oh.mkdir("/blocked");if(true){let ee=new aA(()=>{aZ("fallback-write-error")});oy=new i5(oh,ee);$.register_for_idb(oy);oh.mount(oy,{},"/blocked");await oR()}await oC()};const oL=function($){let ee=$.split("/");return ee.slice(0,-1).join("/")};const ox=async function($){let ee=oh.readdir($);return ee.filter($=>$!=="."&&$!=="..")};const oP=async function($){return oS($)};const oF=async function($){oh.mkdir($)};const oB=async function($){let ee=oh.stat(oI($));return ee.size};const oU=async function($,ee){let et=await oA($);return oN(ee,et)};const oj=async function($,ee="utf8"){return oA($,{encoding:ee})};const oW=async function($,ee){return oN($,ee)};const oH=async function($){return oD($)};const oz=async function($){oh.rmdir($)};const oV=async function($){if(await oP($)){for(let ee of(await ox($))){let et=ou($,ee);let en=oh.stat(et,true);if(oh.isDir(en.mode)){await oV(et)}else{await oH(et)}}await oz($)}};const o$=async function($){throw new Error("getModifiedTime not supported on the web (only used for backups)")};function oq($,ee,et,en){et.forEach(et=>{if(en){if(ee.hasOwnProperty(et)&&ee[et]==null){throw new Error(`${$} is missing field ${et}`)}}else{if(!ee.hasOwnProperty(et)||ee[et]==null){throw new Error(`${$} is missing field ${et}`)}}})}function oG($){if(typeof $!=="string"){throw new Error("toDateRepr not passed a string: "+$)}return parseInt($.replace(/-/g,""))}function oY($){if(typeof $!=="number"){throw new Error("fromDateRepr not passed a number: "+$)}const ee=$.toString();return ee.slice(0,4)+"-"+ee.slice(4,6)+"-"+ee.slice(6)}const oK={validate($,{update:ee}={}){oq("account",$,ee?["name","offbudget","closed"]:["name"],ee);return $}};const oZ={validate($,{update:ee}={}){oq("category",$,ee?["name","is_income","cat_group"]:["name","cat_group"],ee);let{sort_order:et,...en}=$;return en}};const oJ={validate($,{update:ee}={}){oq("categoryGroup",$,ee?["name","is_income"]:["name"],ee);let{sort_order:et,...en}=$;return en}};const oX={validate($,{update:ee}={}){oq("payee",$,["name"],ee);return $}};const oQ={validate($,{update:ee}={}){oq("transaction",$,["date","acct"],ee);if("date"in $){if($.date.match(/^\d{4}-\d{2}-\d{2}$/)==null||$.date<"2000-01-01"){throw new Error("Invalid transaction date: "+$.date)}}return $},toJS($){if(!("location"in $)){throw new Error("A full transaction is required to be passed to `toJS`. Instead got: "+JSON.stringify($))}let ee={...$};ee.error=$.error?JSON.parse($.error):null;ee.isParent=$.isParent===1?true:false;ee.isChild=$.isChild===1?true:false;ee.starting_balance_flag=$.starting_balance_flag===1?true:false;ee.cleared=$.cleared===1?true:false;ee.pending=$.pending===1?true:false;ee.date=ee.date&&oY(ee.date);return ee},fromJS($){let ee={...$};if("error"in ee){ee.error=$.error?JSON.stringify($.error):null}if("isParent"in ee){ee.isParent=$.isParent?1:0}if("isChild"in ee){ee.isChild=$.isChild?1:0}if("cleared"in ee){ee.cleared=$.cleared?1:0}if("pending"in ee){ee.pending=$.pending?1:0}if("starting_balance_flag"in ee){ee.starting_balance_flag=$.starting_balance_flag?1:0}if("date"in ee){ee.date=oG($.date)}return ee}};function o0($,ee){return ee.required||$==="id"}function o1($,ee){if($===undefined){throw new Error("Query value cannot be undefined")}else if($===null){if(ee==="boolean"){return 0}return null}switch(ee){case"date":if($ instanceof Date){return oG(nI($))}else if($.match(/^\d{4}-\d{2}-\d{2}$/)==null||$.date<"2000-01-01"){throw new Error("Invalid date: "+$)}return oG($);case"date-month":return oG($.slice(0,7));case"date-year":return oG($.slice(0,4));case"boolean":return $?1:0;case"id":if(typeof $!=="string"&&$!==null){throw new Error("Invalid id, must be string: "+$)}return $;case"integer":if(typeof $==="number"&&Number.isInteger($)){return $}else{throw new Error("Can’t convert to integer: "+JSON.stringify($))}case"json":return JSON.stringify($);default:}return $}function o2($,ee){if($===null){if(ee==="boolean"){return false}return null}switch(ee){case"date":return oY($);case"date-month":return oY($).slice(0,7);case"date-year":return oY($).slice(0,4);case"boolean":return $===1;case"json":case"json/fallback":try{return JSON.parse($)}catch(et){return ee==="json/fallback"?$:null}default:}return $}function o6($,ee,et,en,{skipNull:ei=false}={}){let eo=$[et];if(eo==null){throw new Error(`Table “${et}” does not exist`)}let es=ee.views||{};let eu=$=>{if(es[et]&&es[et].fields){return es[et].fields[$]||$}return $};return Object.fromEntries(Object.keys(en).map($=>{if($[0]==="_"){return null}let ee=eo[$];if(ee==null){throw new Error(`Field “${$}” does not exist on table ${et}: ${JSON.stringify(en)}`)}if(o0($,ee)&&en[$]==null){throw new Error(`“${$}” is required for table “${et}”: ${JSON.stringify(en)}`)}if(ei&&en[$]==null){return null}return[eu($),o1(en[$],ee.type)]}).filter(Boolean))}function o4($,ee,et,en){let ei={...en};let eo=$[et];if(eo==null){throw new Error(`Error inserting: table “${et}” does not exist`)}Object.keys(eo).forEach($=>{let ee=eo[$];if(ei[$]==null){if(ee.default!==undefined){ei[$]=typeof ee.default==="function"?ee.default():ee.default}else if(o0($,ee)){throw new Error(`“${$}” is required for table “${et}”: ${JSON.stringify(ei)}`)}}});return o6($,ee,et,ei,{skipNull:true})}function o3($,ee,et,en){let ei={...en};let eo=$[et];if(eo==null){throw new Error(`Error updating: table “${et}” does not exist`)}return o6($,ee,et,ei)}function o8($,ee,et,en){let ei=$[et];if(ei==null){throw new Error(`Table “${et}” does not exist`)}let eo=Object.keys(ei);let es={};for(let $=0;$<eo.length;$++){let ee=eo[$];let et=ei[ee];es[ee]=o2(en[ee],et.type)}return es};let o5=0;function o9(){o5=0}function o7($){o5++;return $+o5}class se extends Error{}function st($){let ee=$=>($<10?"0":"")+$;return $.getFullYear()+ee($.getMonth()+1)+ee($.getDate())}function sr($){return parseInt($.replace(/-/g,""))}function sn($,ee,et,en){let ei=$[ee].tombstone!=null;return ei?`${en} AND ${et}.tombstone = 0`:en}function si($){let ee=$.split(".");return{path:ee.slice(0,-1).join("."),field:ee[ee.length-1]}}function so($){return $==="group"}function ss($){return $.indexOf(".")===-1&&!so($)?$:`"${$}"`}function su($,ee,{literal:et=false}={}){return{value:$,type:ee,literal:et}}function sl($,ee,et){if($[ee]==null){throw new se(`Table “${ee}” does not exist in the schema`)}let en=$[ee][et];if(en==null){throw new se(`Field “${et}” does not exist in table “${ee}”`)}return en}function sc($,ee){let{schema:et,paths:en}=$;let ei=ee.split(".");if(ei.length<2){throw new se("Invalid path: "+ee)}let eo=ei[0];let es=ei.slice(1).reduce(($,ee)=>{let en=et[$];if(en==null){throw new se(`Path error: ${$} table does not exist`)}if(!en[ee]||en[ee].ref==null){throw new se(`Field not joinable on table ${$}: “${ee}”`)}return en[ee].ref},eo);let eu;let el=ei.slice(0,-1);if(el.length===1){eu=el[0]}else{let $=el.join(".");let ee=en.get($);if(!ee){throw new se("Path does not exist: "+$)}eu=ee.tableId}return{tableName:es,tableId:o7(es),joinField:ei[ei.length-1],joinTable:eu}}function sf($,ee){let et=ee.split(".");et=et.reduce(($,ee)=>{let et=$.context+"."+ee;return{context:et,path:[...$.path,et]}},{context:$.implicitTableName,path:[]}).path;et.forEach(ee=>{if(!$.paths.get(ee)){$.paths.set(ee,sc($,ee))}});let en=$.paths.get(et[et.length-1]);return en}function sd($,ee){if(typeof ee!=="string"){throw new se("Invalid field name, must be a string")}let{path:et,field:en}=si(ee);let ei;if(et===""){ei={tableName:$.implicitTableName,tableId:$.implicitTableId}}else{ei=sf($,et)}let eo=sl($.schema,ei.tableName,en);if($.validateRefs&&eo.ref&&eo.type==="id"&&en!=="id"){let et=$.implicitTableName+"."+ee;let eo=$.paths.get(et);if(!eo){eo=sc($,et);eo.noMapping=true;$.paths.set(et,eo)}en="id";ei=eo}let es=ei.tableId+"."+en;return su(es,eo.type)}function sp($){let ee=$.match(/^(\d{4}-\d{2}-\d{2})$/);if(ee){return su(sr(ee[1]),"date",{literal:true})}return null}function sh($){let ee=$.match(/^(\d{4}-\d{2})$/);if(ee){return su(sr(ee[1]),"date",{literal:true})}return null}function sy($){let ee=$.match(/^(\d{4})$/);if(ee){return su(sr(ee[1]),"date",{literal:true})}return null}function sg($,ee){throw new se(`Bad ${ee} format: ${$}`)}function sm($,ee){let et=$.paramType;if(et){let en={date:["string"],"date-month":["date"],"date-year":["date","date-month"],id:["string"],float:["integer"]};if(et!==ee&&(!en[ee]||!en[ee].includes(et))){throw new Error(`Parameter “${$.paramName}” can’t convert to ${ee} (already inferred as ${et})`)}}else{$.paramType=ee}}function s_($,ee,et){if(ee.type===et){return ee}else if(ee.type==="param"){sm(ee,et);return su(ee.value,et)}else if(ee.type==="null"){if(!ee.literal){throw new se("A non-literal null doesn’t make sense")}if(et==="boolean"){return su(0,"boolean",{literal:true})}return ee}if(et==="date"){if(ee.type==="string"){if(ee.literal){return sp(ee.value)||sg(ee.value,"date")}else{throw new se("Casting string fields to dates is not supported")}}throw new se(`Can’t cast ${ee.type} to date`)}else if(et==="date-month"){let $;if(ee.type==="date"){$=ee}else if(ee.type==="string"||ee.type==="any"){$=sh(ee.value)||sp(ee.value)||sg(ee.value,"date-month")}else{throw new se(`Can’t cast ${ee.type} to date-month`)}if($.literal){return su(sr($.value.toString().slice(0,6)),"date-month",{literal:true})}else{return su(`CAST(SUBSTR(${$.value}, 1, 6) AS integer)`,"date-month")}}else if(et==="date-year"){let $;if(ee.type==="date"||ee.type==="date-month"){$=ee}else if(ee.type==="string"){$=sy(ee.value)||sh(ee.value)||sp(ee.value)||sg(ee.value,"date-year")}else{throw new se(`Can’t cast ${ee.type} to date-year`)}if($.literal){return su(sr($.value.toString().slice(0,4)),"date-year",{literal:true})}else{return su(`CAST(SUBSTR(${$.value}, 1, 4) AS integer)`,"date-year")}}else if(et==="id"){if(ee.type==="string"){return su(ee.value,"id",{literal:ee.literal})}}else if(et==="float"){if(ee.type==="integer"){return su(ee.value,"float",{literal:ee.literal})}}if(ee.type==="any"){return su(ee.value,et,{literal:ee.literal})}throw new se(`Can’t convert ${ee.type} to ${et}`)}function sv($,ee,et){let en=ee;if(et){en=s_($,ee,et)}if(en.literal){if(en.type==="id"){return`'${en.value}'`}else if(en.type==="string"){let $=en.value.replace(/'/g,"''");return`'${$}'`}}return en.value}function sw($,ee,et){return ee.map((ee,en)=>sv($,ee,et?et[en]:null))}function sE($,ee,et){if(et==null){et=ee}if(ee!=null&&$.length<ee){throw new se("Too few arguments")}if(et!=null&&$.length>et){throw new se("Too many arguments")}}function sS($,ee){return(et,...en)=>{if(et==null||et.compileStack==null){throw new se("This function cannot track error data. "+"It needs to accept the compiler state as the first argument.")}et.compileStack.push({type:$,args:en});let ei=ee(et,...en);et.compileStack.pop();return ei}}function sT($){if(typeof $==="string"){return $}else if($===undefined){return"undefined"}let ee=JSON.stringify($);if(ee.length>70){let ee=JSON.stringify($,null,2);return ee.split("\n").join("\n ")}return ee}function sO($,ee){if(ee.length===0){return $}let et=ee.slice(1).reverse().map($=>{switch($.type){case"expr":case"function":return sT($.args[0]);case"op":{let[ee,et]=$.args;return sT({[ee]:et})}case"value":return sT($.value);default:return""}}).map($=>"\n "+$).join("");const en=ee[0].type;const ei=ee[0].args[0];et+=`
20
+ ${en}(${sT(ei.length===1?ei[0]:ei)})`;if(true){const ee=new se;ee.message=`${$.message}
21
+
22
+ Expression stack:`+et;ee.stack=null;return ee}$.message=`${$.message}
23
+
24
+ Expression stack:`+et;return $}function sA($){if($===undefined){throw new se("`undefined` is not a valid query value")}else if($===null){return su("NULL","null",{literal:true})}else if($ instanceof Date){return su(st($),"date",{literal:true})}else if(typeof $==="string"){$=$.replace(/\\\$/g,"$");return su($,"string",{literal:true})}else if(typeof $==="boolean"){return su($?1:0,"boolean",{literal:true})}else if(typeof $==="number"){return su($,Number.isInteger($)?"integer":"float",{literal:true})}else if(Array.isArray($)){return su($,"array",{literal:true})}else{throw new se("Unsupported type of expression: "+JSON.stringify($))}}const sI=sS("expr",($,ee)=>{if(typeof ee==="string"){if(ee[0]==="$"){let et=ee==="$"?$.implicitField:ee.slice(1);if(et==null||et===""){throw new se("Invalid field reference: "+ee)}return sd($,et)}if(ee[0]===":"){let et={value:"?",type:"param",paramName:ee.slice(1)};$.namedParameters.push(et);return et}}if(ee!==null){if(Array.isArray(ee)){return sA(ee)}else if(typeof ee==="object"&&Object.keys(ee).find($=>$[0]==="$")){return sN($,ee)}}return sA(ee)});const sN=sS("function",($,ee)=>{let[et]=Object.keys(ee);let en=ee[et];if(!Array.isArray(en)){en=[en]}if(et[0]!=="$"){throw new se(`Unknown property “${et}.” Did you mean to call a function? Try prefixing it with $`)}let ei=en;if(et!=="$condition"){ei=en.map(ee=>sI($,ee))}switch(et){case"$sum":{sE(ei,1);let[ee]=sw($,ei,["float"]);return su(`SUM(${ee})`,ei[0].type)}case"$sumOver":{let[ee]=sw($,ei,["float"]);let et=$.orders?"ORDER BY "+sB($,$.orders):"";return su(`(SUM(${ee}) OVER (${et} ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING))`,ei[0].type)}case"$count":{sE(ei,1);let[ee]=sw($,ei);return su(`COUNT(${ee})`,"integer")}case"$substr":{sE(ei,2,3);let[ee,et,en]=sw($,ei,["string","integer","integer"]);return su(`SUBSTR(${ee}, ${et}, ${en})`,"string")}case"$lower":{sE(ei,1);let[ee]=sw($,ei,["string"]);return su(`UNICODE_LOWER(${ee})`,"string")}case"$neg":{sE(ei,1);sw($,ei,["float"]);return su(`(-${sv($,ei[0])})`,ei[0].type)}case"$abs":{sE(ei,1);sw($,ei,["float"]);return su(`ABS(${sv($,ei[0])})`,ei[0].type)}case"$idiv":{sE(ei,2);sw($,ei,["integer","integer"]);return su(`(${sv($,ei[0])} / ${sv($,ei[1])})`,ei[0].type)}case"$month":{sE(ei,1);return s_($,ei[0],"date-month")}case"$year":{sE(ei,1);return s_($,ei[0],"date-year")}case"$condition":sE(ei,1);let eo=sR($,ei[0]);return su(eo.join(" AND "),"boolean");case"$nocase":sE(ei,1);let[es]=sw($,ei,["string"]);return su(`${es} COLLATE NOCASE`,ei[0].type);case"$literal":{sE(ei,1);if(!ei[0].literal){throw new se("Literal not passed to $literal")}return ei[0]}default:throw new se(`Unknown function: ${et}`)}});const sD=sS("op",($,ee,et)=>{let{$transform:en,...ei}=et;let[eo]=Object.keys(ei);let es=sI($,et[eo]);let eu;if(en){eu=sN({...$,implicitField:ee},typeof en==="string"?{[en]:"$"}:en)}else{eu=sI($,"$"+ee)}switch(eo){case"$gte":{let[ee,et]=sw($,[eu,es],[null,eu.type]);return`${ee} >= ${et}`}case"$lte":{let[ee,et]=sw($,[eu,es],[null,eu.type]);return`${ee} <= ${et}`}case"$gt":{let[ee,et]=sw($,[eu,es],[null,eu.type]);return`${ee} > ${et}`}case"$lt":{let[ee,et]=sw($,[eu,es],[null,eu.type]);return`${ee} < ${et}`}case"$eq":{if(s_($,es,eu.type).type==="null"){return`${sv($,eu)} IS NULL`}let[ee,et]=sw($,[eu,es],[null,eu.type]);if(es.type==="param"){let en=$.namedParameters.map($=>{return $===es||$===eu?[$,{...$}]:$});$.namedParameters=[].concat.apply([],en);return`CASE
25
+ WHEN ${ee} IS NULL THEN ${et} IS NULL
26
+ ELSE ${ee} = ${et}
27
+ END`}return`${ee} = ${et}`}case"$ne":{if(s_($,es,eu.type).type==="null"){return`${sv($,eu)} IS NULL`}let[ee,et]=sw($,[eu,es],[null,eu.type]);if(es.type==="param"){let en=$.namedParameters.map($=>{return $===es||$===eu?[$,{...$}]:$});$.namedParameters=[].concat.apply([],en);return`CASE
28
+ WHEN ${ee} IS NULL THEN ${et} IS NULL
29
+ ELSE ${ee} != ${et}
30
+ END`}return`${ee} != ${et}`}case"$oneof":{let[ee,et]=sw($,[eu,es],[null,"array"]);let en=[...new Set(et)];return`${ee} IN (`+en.map($=>`'${$}'`).join(",")+")"}case"$like":{let[ee,et]=sw($,[eu,es],["string","string"]);return`${ee} LIKE ${et}`}case"$notlike":{let[ee,et]=sw($,[eu,es],["string","string"]);return`(${ee} NOT LIKE ${et}
31
+ OR ${ee} IS NULL)`}default:throw new se(`Unknown operator: ${eo}`)}});function sR($,ee){if(!Array.isArray(ee)){ee=Object.entries(ee).map($=>{return{[$[0]]:$[1]}})}return ee.filter(Boolean).reduce((ee,et)=>{let en=Object.entries(et).map(([ee,et])=>{if(ee==="$and"){if(!et){return null}return sk($,et)}else if(ee==="$or"){if(!et){return null}return sC($,et)}if(typeof et==="string"||typeof et==="number"||typeof et==="boolean"||et instanceof Date||et==null){return sD($,ee,{$eq:et})}if(Array.isArray(et)){return et.map(et=>sD($,ee,et)).join(" AND ")}return sD($,ee,et)}).filter(Boolean);return[...ee,...en]},[])}function sC($,ee){if(!ee){return"0"}let et=sR($,ee);if(et.length===0){return"0"}return"("+et.join("\n OR ")+")"}function sk($,ee){if(!ee){return"1"}let et=sR($,ee);if(et.length===0){return"1"}return"("+et.join("\n AND ")+")"}const sM=sS("filter",($,ee)=>{return sk($,ee)});function sL($,ee,et){let en=[];$.paths.forEach((ei,eo)=>{let{tableName:es,tableId:eu,joinField:el,joinTable:ef,noMapping:ed}=$.paths.get(eo);let ep=`${eu}.id = ${ee(ef)}.${ss(el)}`;let eh=et(es);if(eh.length>0){ep+=" AND "+sk({...$,implicitTableName:es,implicitTableId:eu},eh)}en.push(`LEFT JOIN ${ed?es:ee(es,true)} ${eu} ON ${sn($.schema,es,eu,ep)}`);if($.dependencies.indexOf(es)===-1){$.dependencies.push(es)}});return en.join("\n")}function sx($,ee){let et;let en;if(ee==="*"){en={tableName:$.implicitTableName,tableId:$.implicitTableId}}else if(ee.match(/\.\*$/)){let ei=si(ee);et=ei.path;en=sf($,ei.path)}let ei=$.schema[en.tableName];if(ei==null){throw new Error(`Table “${en.tableName}” does not exist`)}return Object.keys(ei).map($=>et?`${et}.${$}`:$)}const sP=sS("select",($,ee,et,en)=>{if(!et&&!ee.includes("id")&&!ee.includes("*")){ee=ee.concat(["id"])}let ei=ee.map(ee=>{if(typeof ee==="string"){if(ee.indexOf("*")!==-1){let et=sx($,ee);return et.map(ee=>{let et=sI($,"$"+ee);$.outputTypes.set(ee,et.type);return et.value+" AS "+ss(ee)}).join(", ")}let et=sI($,"$"+ee);$.outputTypes.set(ee,et.type);return et.value+" AS "+ss(ee)}let[et,ei]=Object.entries(ee)[0];if(et[0]==="$"){$.compileStack.push({type:"value",value:ee});throw new se(`Invalid field “${et}”, are you trying to select a function? You need to name the expression`)}if(typeof ei==="string"){let ee=sI($,"$"+ei);$.outputTypes.set(et,ee.type);return`${ee.value} AS ${ss(et)}`}let eo=sN({...$,orders:en},ei);$.outputTypes.set(et,eo.type);return eo.value+` AS ${ss(et)}`});return ei.join(", ")});const sF=sS("groupBy",($,ee)=>{let et=ee.map(ee=>{if(typeof ee==="string"){return sI($,"$"+ee).value}return sN($,ee).value});return et.join(", ")});const sB=sS("orderBy",($,ee)=>{let et=ee.map(ee=>{let et;let en=null;if(typeof ee==="string"){et=sI($,"$"+ee).value}else{let ei=Object.entries(ee);let eo=ei[0];if(ei.length===1&&eo[0][0]!=="$"){en=eo[1];et=sI($,"$"+eo[0]).value}else{let{$dir:ei,...eo}=ee;en=ei;et=sN($,eo).value}}if(en!=null){if(en!=="desc"&&en!=="asc"){throw new se("Invalid order direction: "+en)}return`${et} ${en}`}return et});return et.join(", ")});let sU=["$sum","$count"];function sj($){if(typeof $!=="object"||Array.isArray($)){return false}let[ee,et]=Object.entries($)[0];if(!Array.isArray(et)){et=[et]}if(sU.indexOf(ee)!==-1){return true}return!!et.find($=>sj($))}function sW($){if($.groupExpressions.length>0){return true}return!!$.selectExpressions.find($=>{if(typeof $!=="string"){let[ee,et]=Object.entries($)[0];return sj(et)}return false})}function sH($,ee,et={}){let{withDead:en,validateRefs:ei=true,tableOptions:eo,rawMode:es}=$;let{tableViews:eu={},tableFilters:el=$=>[],customizeQuery:ef=$=>$}=et;let ed=$=>{let ee=el($);for(let $ of ee){if(Array.isArray($)){throw new se("Invalid internal table filter: only object filters are supported")}if(Object.keys($)[0].indexOf(".")!==-1){throw new se("Invalid internal table filter: field names cannot contain paths")}}return ee};let ep=($,ee)=>{let et=typeof eu==="function"?eu($,{withDead:en,isJoin:ee,tableOptions:eo}):eu[$];return et||$};let eh=$.table;let{filterExpressions:ey,selectExpressions:eg,groupExpressions:em,orderExpressions:e_,limit:ew,offset:eE}=ef($);let eS="";let eT="";let eO="";let eA="";let eI="";let eN={schema:ee,implicitTableName:eh,implicitTableId:ep(eh),paths:new Map,dependencies:[eh],compileStack:[],outputTypes:new Map,validateRefs:ei,namedParameters:[]};o9();try{eS=sP(eN,eg,sW($),e_);if(ey.length>0){let $=sM(eN,ey);eT="WHERE "+$}else{eT="WHERE 1"}if(!es){let $=ed(eh);if($.length>0){eT+=" AND "+sk(eN,$)}}if(em.length>0){let $=sF(eN,em);eA="GROUP BY "+$}if(e_.length>0){let $=sB(eN,e_);eI="ORDER BY "+$}if(eN.paths.size>0){eO=sL(eN,ep,ed)}}catch($){if($ instanceof se){throw sO($,eN.compileStack)}throw $}let eD={select:eS,from:ep(eh),joins:eO,where:eT,groupBy:eA,orderBy:eI,limit:ew,offset:eE};return{sqlPieces:eD,state:eN}}function sz($,ee,et){let en=et;let ei=$.withDead?en.where:sn(ee.schema,ee.implicitTableName,ee.implicitTableId,en.where);return`
32
+ SELECT ${en.select} FROM ${en.from}
33
+ ${en.joins}
34
+ ${ei}
35
+ ${en.groupBy}
36
+ ${en.orderBy}
37
+ ${en.limit!=null?`LIMIT ${en.limit}`:""}
38
+ ${en.offset!=null?`OFFSET ${en.offset}`:""}
39
+ `}function sV($,ee,et){let{sqlPieces:en,state:ei}=sH($,ee,et);return{sql:sz($,ei,en),state:ei}};function s$($){return Object.keys($).map(ee=>{let et=$[ee];let en=et!==ee;if(!et.match(/[ .]/)){et=`_.${et}`}return en?`${et} AS ${ss(ee)}`:`${et}`}).join(", ")}function sq($,ee){let et=ee.views;let en=[];Object.keys(et).forEach(ee=>{let{fields:ei={},...eo}=et[ee];let es=Object.fromEntries(Object.keys($[ee]).map($=>[$,$]));let eu={...es,...ei};Object.keys(eo).forEach($=>{let ee=$=>{let ee={...es,...$};return s$(ee)};let et=$=>{let ee={...eu,...$};return s$(ee)};let ei;if(typeof eo[$]==="function"){ei=eo[$](et,ee)}else{ei=eo[$]}ei=ei.trim().replace(/;$/,"");en.push(`
40
+ DROP VIEW IF EXISTS ${$};
41
+ CREATE VIEW ${$} AS ${ei};
42
+ `)})});return en.join("\n")};function sG($,ee){return{type:$,...ee}}const sY={transactions:{id:sG("id"),is_parent:sG("boolean"),is_child:sG("boolean"),parent_id:sG("id"),account:sG("id",{ref:"accounts",required:true}),category:sG("id",{ref:"categories"}),amount:sG("integer",{default:0,required:true}),payee:sG("id",{ref:"payees"}),notes:sG("string"),date:sG("date",{required:true}),imported_id:sG("string"),error:sG("json"),imported_payee:sG("string"),starting_balance_flag:sG("boolean"),transfer_id:sG("id"),sort_order:sG("float",{default:()=>Date.now()}),cleared:sG("boolean",{default:true}),tombstone:sG("boolean"),schedule:sG("id",{ref:"schedules"})},payees:{id:sG("id"),name:sG("string",{required:true}),transfer_acct:sG("id",{ref:"accounts"}),tombstone:sG("boolean")},accounts:{id:sG("id"),name:sG("string",{required:true}),offbudget:sG("boolean"),closed:sG("boolean"),sort_order:sG("float"),tombstone:sG("boolean")},categories:{id:sG("id"),name:sG("string"),is_income:sG("boolean"),hidden:sG("boolean"),group:sG("id",{ref:"category_groups"}),sort_order:sG("float"),tombstone:sG("boolean")},category_groups:{id:sG("id"),name:sG("string"),is_income:sG("boolean"),hidden:sG("boolean"),sort_order:sG("float"),tombstone:sG("boolean")},schedules:{id:sG("id"),name:sG("string"),rule:sG("id",{ref:"rules",required:true}),next_date:sG("date"),completed:sG("boolean"),posts_transaction:sG("boolean"),tombstone:sG("boolean"),_payee:sG("id",{ref:"payees"}),_account:sG("id",{ref:"accounts"}),_amount:sG("json/fallback"),_amountOp:sG("string"),_date:sG("json/fallback"),_conditions:sG("json"),_actions:sG("json")},rules:{id:sG("id"),stage:sG("string"),conditions_op:sG("string"),conditions:sG("json"),actions:sG("json"),tombstone:sG("boolean")},notes:{id:sG("id"),note:sG("string")},transaction_filters:{id:sG("id"),name:sG("string"),conditions_op:sG("string"),conditions:sG("json"),tombstone:sG("boolean")}};const sK={tableViews($,{isJoin:ee,withDead:et,tableOptions:en={splits:undefined}}){switch($){case"transactions":{if(ee){return"v_transactions_internal_alive"}let $=en.splits||"inline";if(!et&&($==="inline"||$==="none")){return"v_transactions_internal_alive"}return"v_transactions_internal"}case"schedules":return"v_schedules";case"categories":return"v_categories";case"payees":return"v_payees";default:}return $},customizeQuery($){let{table:ee}=$;function et($){if($.length>0){return $.concat(["id"])}switch(ee){case"transactions":return[{date:"desc"},"starting_balance_flag",{sort_order:"desc"},"id"];case"payees":return[{$condition:{transfer_acct:null},$dir:"desc"},{$nocase:"$name"}];case"accounts":return["sort_order","name"];case"schedules":return[{$condition:{completed:true}},"next_date"];default:}return[]}return{...$,orderExpressions:et($.orderExpressions)}},views:{payees:{v_payees:$=>{let ee=$({name:"COALESCE(__accounts.name, _.name)"});return`
43
+ SELECT ${ee} FROM payees _
44
+ LEFT JOIN accounts __accounts ON (_.transfer_acct = __accounts.id AND __accounts.tombstone = 0)
45
+ -- We never want to show transfer payees that are pointing to deleted accounts.
46
+ -- Either this is not a transfer payee, if the account exists
47
+ WHERE _.transfer_acct IS NULL OR __accounts.id IS NOT NULL
48
+ `}},categories:{fields:{group:"cat_group"},v_categories:$=>{let ee=$({group:"cat_group"});return`SELECT ${ee} FROM categories _`}},schedules:{v_schedules:$=>{let ee=$({next_date:`
49
+ CASE
50
+ WHEN _nd.local_next_date_ts = _nd.base_next_date_ts THEN _nd.local_next_date
51
+ ELSE _nd.base_next_date
52
+ END
53
+ `,_payee:`pm.targetId`,_account:`json_extract(_rules.conditions, _paths.account || '.value')`,_amount:`json_extract(_rules.conditions, _paths.amount || '.value')`,_amountOp:`json_extract(_rules.conditions, _paths.amount || '.op')`,_date:`json_extract(_rules.conditions, _paths.date || '.value')`,_conditions:"_rules.conditions",_actions:"_rules.actions"});return`
54
+ SELECT ${ee} FROM schedules _
55
+ LEFT JOIN schedules_next_date _nd ON _nd.schedule_id = _.id
56
+ LEFT JOIN schedules_json_paths _paths ON _paths.schedule_id = _.id
57
+ LEFT JOIN rules _rules ON _rules.id = _.rule
58
+ LEFT JOIN payee_mapping pm ON pm.id = json_extract(_rules.conditions, _paths.payee || '.value')
59
+ `}},transactions:{fields:{is_parent:"isParent",is_child:"isChild",account:"acct",imported_id:"financial_id",imported_payee:"imported_description",transfer_id:"transferred_id",payee:"description"},v_transactions_internal:$=>{let ee=$({payee:"pm.targetId",category:`CASE WHEN _.isParent = 1 THEN NULL ELSE cm.transferId END`,amount:`IFNULL(_.amount, 0)`,parent_id:"CASE WHEN _.isChild = 0 THEN NULL ELSE _.parent_id END"});return`
60
+ SELECT ${ee} FROM transactions _
61
+ LEFT JOIN category_mapping cm ON cm.id = _.category
62
+ LEFT JOIN payee_mapping pm ON pm.id = _.description
63
+ WHERE
64
+ _.date IS NOT NULL AND
65
+ _.acct IS NOT NULL AND
66
+ (_.isChild = 0 OR _.parent_id IS NOT NULL)
67
+ `},v_transactions_internal_alive:`
68
+ SELECT _.* FROM v_transactions_internal _
69
+ LEFT JOIN transactions t2 ON (_.is_child = 1 AND t2.id = _.parent_id)
70
+ WHERE IFNULL(_.tombstone, 0) = 0 AND (_.is_child = 0 OR t2.tombstone = 0)
71
+ `,v_transactions:($,ee)=>{let et=ee({payee:"p.id",category:"c.id",account:"a.id"});return`
72
+ SELECT ${et} FROM v_transactions_internal_alive _
73
+ LEFT JOIN payees p ON (p.id = _.payee AND p.tombstone = 0)
74
+ LEFT JOIN categories c ON (c.id = _.category AND c.tombstone = 0)
75
+ LEFT JOIN accounts a ON (a.id = _.account AND a.tombstone = 0)
76
+ ORDER BY _.date desc, _.starting_balance_flag, _.sort_order desc, _.id;
77
+ `}}}};class sZ{state;constructor($){this.state={filterExpressions:$.filterExpressions||[],selectExpressions:$.selectExpressions||[],groupExpressions:$.groupExpressions||[],orderExpressions:$.orderExpressions||[],calculation:false,rawMode:false,withDead:false,validateRefs:true,limit:null,offset:null,...$}}filter($){return new sZ({...this.state,filterExpressions:[...this.state.filterExpressions,$]})}unfilter($){let ee=new Set($);return new sZ({...this.state,filterExpressions:this.state.filterExpressions.filter($=>!ee.has(Object.keys($)[0]))})}select($=[]){if(!Array.isArray($)){$=[$]}let ee=new sZ({...this.state,selectExpressions:$});ee.state.calculation=false;return ee}calculate($){let ee=this.select({result:$});ee.state.calculation=true;return ee}groupBy($){if(!Array.isArray($)){$=[$]}return new sZ({...this.state,groupExpressions:[...this.state.groupExpressions,...$]})}orderBy($){if(!Array.isArray($)){$=[$]}return new sZ({...this.state,orderExpressions:[...this.state.orderExpressions,...$]})}limit($){return new sZ({...this.state,limit:$})}offset($){return new sZ({...this.state,offset:$})}raw(){return new sZ({...this.state,rawMode:true})}withDead(){return new sZ({...this.state,withDead:true})}withoutValidatedRefs(){return new sZ({...this.state,validateRefs:false})}options($){return new sZ({...this.state,tableOptions:$})}serialize(){return this.state}}function sJ($,ee){let et=$.serialize().orderExpressions;if(et.length===0){if(ee){return{order:"asc",...ee}}return null}let en=et[0];if(typeof en==="string"){return{field:en,order:"asc"}}let[ei]=Object.keys(en);return{field:ei,order:en[ei]}}function sX($){return new sZ({table:$})};function sQ($,ee){for(let et=0;et<$.length;et++){let en=$[et];Object.keys(en).forEach($=>{en[$]=o2(en[$],ee.get($))})}}async function ue($,ee,et,en,ei){let eo=sz($,ee,et);let es=await f2(eo,en);sQ(es,ei);return es}async function ut($,ee,et,{params:en={},executors:ei={}}={}){let eo=et.namedParameters.map($=>{let ee=$.paramName;if(en[ee]===undefined){throw new Error(`Parameter ${ee} not provided to query`)}return o1(en[ee],$.paramType)});let es;if(ei[et.implicitTableName]){es=await ei[et.implicitTableName](et,$,ee,eo,et.outputTypes)}else{es=await ue($,et,ee,eo,et.outputTypes)}if($.calculation){if(es.length>0){let $=es[0];let ee=Object.keys($)[0];es=$[ee]||0}else{es=null}}return es}async function ur($,ee,et,en){let{sqlPieces:ei,state:eo}=sH(et,$,ee);let es=await ut(et,ei,eo,en);return{data:es,dependencies:eo.dependencies}};async function un($,ee,et,en,ei=[]){let eo=500;let es=[];let eu=new Set;for(let el=0;el<ee.length;el+=eo){let ef=ee.slice(el,el+eo).filter($=>!eu.has($));if(ef.length>0){let ee=ef.map($=>et($)).join(" OR ");let eo=en("("+ee+")");let el=await $(eo,ei,true);eu=new Set([...eu,...ef]);es=es.concat(el)}}return es}function ui($,ee){let et=[...new Set($)];let en=`${ee} IN (`+et.map($=>`'${$}'`).join(",")+")";return en};function uo($,ee,et=$=>$){return $.reduce(($,en)=>{let ei=ee.get(en.id)||[];$.push({...et(en),subtransactions:ei.map(et)});return $},[])}function us($,ee,et,en,ei){let eo=ee.tableOptions||{};let es=eo.splits||"inline";if(["all","inline","none","grouped"].indexOf(es)===-1){throw new Error(`Invalid “splits” option for transactions: “${es}”`)}if(es==="all"||es==="inline"||es==="none"){return uf($,ee,et,en,es,ei)}else if(es==="grouped"){return uc($,ee,et,en,es,ei)}}function uu($){for(let ee of Object.keys($)){if(ee==="$or"||ee==="$and"){if($[ee]&&uu($[ee])){return true}}else if(!(ee.indexOf("account")===0||ee==="date")){return true}}return false}function ul($){return $.filterExpressions.find(uu)==null}async function uc($,ee,et,en,ei,eo){let{withDead:es}=ee;let eu=es?"":`AND ${et.from}.tombstone = 0`;if(sW(ee)){let ei={...et};ei.where=`${ei.where} AND ${ei.from}.is_parent = 0`;if(!es){ei.from="v_transactions_internal_alive v_transactions_internal"}return ue(ee,$,ei,en,eo)}let el;let ef=null;if(ul(ee)){let $=`
78
+ SELECT ${et.from}.id as group_id
79
+ FROM ${et.from}
80
+ ${et.joins}
81
+ ${et.where} AND is_child = 0 ${eu}
82
+ ${et.orderBy}
83
+ ${et.limit!=null?`LIMIT ${et.limit}`:""}
84
+ ${et.offset!=null?`OFFSET ${et.offset}`:""}
85
+ `;el=await f2($,en)}else{let $=`
86
+ SELECT group_id, matched FROM (
87
+ SELECT
88
+ group_id,
89
+ GROUP_CONCAT(id) as matched
90
+ FROM (
91
+ SELECT ${et.from}.id, IFNULL(${et.from}.parent_id, ${et.from}.id) as group_id
92
+ FROM ${et.from}
93
+ LEFT JOIN transactions _t2 ON ${et.from}.is_child = 1 AND _t2.id = ${et.from}.parent_id
94
+ ${et.joins}
95
+ ${et.where} AND ${et.from}.tombstone = 0 AND IFNULL(_t2.tombstone, 0) = 0
96
+ )
97
+ GROUP BY group_id
98
+ )
99
+ LEFT JOIN ${et.from} ON ${et.from}.id = group_id
100
+ ${et.joins}
101
+ ${et.orderBy}
102
+ ${et.limit!=null?`LIMIT ${et.limit}`:""}
103
+ ${et.offset!=null?`OFFSET ${et.offset}`:""}
104
+ `;el=await f2($,en);ef=new Set([].concat.apply([],el.map($=>$.matched.split(","))))}let ed=ui(el.map($=>$.group_id),`IFNULL(${et.from}.parent_id, ${et.from}.id)`);let ep=`
105
+ SELECT ${et.select}, parent_id AS _parent_id FROM ${et.from}
106
+ ${et.joins}
107
+ WHERE ${ed} ${eu}
108
+ ${et.orderBy}
109
+ `;let eh=await f2(ep);let{parents:ey,children:eg}=eh.reduce(($,ee)=>{let et=ee._parent_id;delete ee._parent_id;if(et==null){$.parents.push(ee)}else{let en=$.children.get(et)||[];en.push(ee);$.children.set(et,en)}return $},{parents:[],children:new Map});let em=$=>{Object.keys($).forEach(ee=>{$[ee]=o2($[ee],eo.get(ee))});if(ef&&!ef.has($.id)){$._unmatched=true}return $};return uo(ey,eg,em)}async function uf($,ee,et,en,ei,eo){let es={...et};if(ei!=="all"){if(ei==="none"){es.where=`${es.where} AND ${es.from}.parent_id IS NULL`}else{es.where=`${es.where} AND ${es.from}.is_parent = 0`}}return ue(ee,$,es,en,eo)}const ud={transactions:us};function up($,ee,et,en){return ut($,ee,et,{params:en,executors:ud})}function uh($,ee){if($ instanceof sZ){$=$.serialize()}return ur(sY,sK,$,{params:ee,executors:ud})};;const uy={info:(...$)=>{console.log(...$)},warn:(...$)=>{console.warn(...$)}};const ug=uy;const um=false;const u_=true;const uv=false;const uw=["report","rollover"];let uE=null;async function uS($){if(false){}const ee=ou(od($),"metadata.json");try{uE=JSON.parse(await oj(ee))}catch(ee){uE={id:$,budgetName:$}}let et=["syncAccount"];for(const $ of et){delete uE[`flags.${$}`]}for(const $ of Object.keys(uE)){if($.startsWith("notifications.")){delete uE[$]}}uE.id=$;return uE}async function uT($,{avoidSync:ee=false}={}){Object.assign(uE,$);if(!ee){const ee=Object.keys($).map(ee=>{if(ee==="budgetType"||ee==="budgetName"){return{dataset:"prefs",row:ee,column:"value",value:$[ee],timestamp:eo.Timestamp.send()}}return null}).filter($=>$);if(ee.length>0){await fN(ee)}}if(true){let $=ou(od(uE.id),"metadata.json");await oW($,JSON.stringify(uE))}}function uO(){uE=null}function uA(){return uE}function uI($,ee){return{id:$,budgetName:ee}};function uN($){return{all:$=$||new Map,on:function(ee,et){var en=$.get(ee);en?en.push(et):$.set(ee,[et])},off:function(ee,et){var en=$.get(ee);en&&(et?en.splice(en.indexOf(et)>>>0,1):$.set(ee,[]))},emit:function(ee,et){var en=$.get(ee);en&&en.slice().map(function($){$(et)}),(en=$.get("*"))&&en.slice().map(function($){$(ee,et)})}}};function uD(){let $={addNode:ei,removeNode:es,adjacent:eu,adjacentIncoming:el,addEdge:ef,removeEdge:ed,removeIncomingEdges:eo,topologicalSort:eh,generateDOT:ey,getEdges:en};let ee=new Map;let et=new Map;function en(){return{edges:ee,incomingEdges:et}}function ei(en){ee.set(en,eu(en));et.set(en,el(en));return $}function eo($){const ee=el($);et.set($,new Set);let en=ee.values();let ei=en.next();while(!ei.done){ed(ei.value,$);ei=en.next()}}function es(en){eo(en);ee.delete(en);et.delete(en);return $}function eu($){return ee.get($)||new Set}function el($){return et.get($)||new Set}function ef(ee,et){ei(ee);ei(et);eu(ee).add(et);el(et).add(ee);return $}function ed(en,ei){if(ee.has(en)){eu(en).delete(ei)}if(et.has(ei)){el(ei).delete(en)}return $}function ep($,ee,et){ee.add($);let en=eu($).values();let ei=en.next();while(!ei.done){if(!ee.has(ei.value)){ep(ei.value,ee,et)}ei=en.next()}et.unshift($)}function eh($){const ee=new Set;const et=[];$.forEach($=>{if(!ee.has($)){ep($,ee,et)}});return et}function ey(){let $=[];ee.forEach(function(ee,et){if(ee.length!==0){$.push(`${et} -> {${ee.join(",")}}`)}});return`
110
+ digraph G {
111
+ ${$.join("\n").replace(/!/g,"_")}
112
+ }
113
+ `}return $}const uR=uD;function uC($){let ee=$.indexOf("!");if(ee!==-1){return{sheet:$.slice(0,ee),name:$.slice(ee+1)}}return{sheet:null,name:$}}function uk($,ee){return $+"!"+ee};class uM{_meta;cacheBarrier;computeQueue;dirtyCells;events;graph;nodes;running;saveCache;setCacheStatus;transactionDepth;constructor($,ee){this.graph=new uR;this.nodes=new Map;this.transactionDepth=0;this.saveCache=$;this.setCacheStatus=ee;this.dirtyCells=[];this.computeQueue=[];this.events=uN();this._meta={createdMonths:new Set}}meta(){return this._meta}setMeta($){this._meta=$}_getNode($){const{sheet:ee}=uC($);if(!this.nodes.has($)){this.nodes.set($,{name:$,expr:null,value:null,sheet:ee})}return this.nodes.get($)}getNode($){return this._getNode($)}hasCell($){return this.nodes.has($)}add($,ee,et){this.set($,ee)}getNodes(){return this.nodes}serialize(){return{graph:this.graph.getEdges(),nodes:[...this.nodes.entries()]}}transaction($){this.startTransaction();try{$()}catch($){console.log($)}return this.endTransaction()}startTransaction(){this.transactionDepth++}endTransaction(){this.transactionDepth--;if(this.transactionDepth===0){const $=this.dirtyCells;this.dirtyCells=[];this.queueComputation(this.graph.topologicalSort($))}return[]}queueComputation($){this.computeQueue=this.computeQueue.concat($);Promise.resolve().then(()=>{if(!this.running){this.runComputations()}})}runComputations($=0){this.running=true;while($<this.computeQueue.length){let ee=this.computeQueue[$];let et;let en;try{et=this.getNode(ee);if(et._run){let $=et._dependencies.map($=>{return this.getNode($).value});en=et._run(...$);if(en instanceof Promise){console.warn(`dynamic cell ${ee} returned a promise! this is discouraged because errors are not handled properly`)}}else if(et.sql){en=up(et.query,et.sql.sqlPieces,et.sql.state)}else{$++;continue}}catch($){console.log("Error while evaluating "+ee+":",$);this.running=false;this.computeQueue=[];return}if(en instanceof Promise){en.then(ee=>{et.value=ee;this.runComputations($+1)},ee=>{console.warn(`Failed running ${et.name}!`,ee);this.runComputations($+1)});return}else{et.value=en}$++}if($===this.computeQueue.length){this.events.emit("change",{names:this.computeQueue});if(typeof this.saveCache==="function"){this.saveCache(this.computeQueue)}this.markCacheSafe();this.running=false;this.computeQueue=[]}}markCacheSafe(){if(!this.cacheBarrier){if(this.setCacheStatus){this.setCacheStatus({clean:true})}}}markCacheDirty(){if(this.setCacheStatus){this.setCacheStatus({clean:false})}}startCacheBarrier(){this.cacheBarrier=true;this.markCacheDirty()}endCacheBarrier(){this.cacheBarrier=false;let $=this.running||this.computeQueue.length>0;if(!$){this.markCacheSafe()}}addEventListener($,ee){this.events.on($,ee);return()=>this.events.off($,ee)}onFinish($){if(this.transactionDepth!==0){throw new Error("onFinish called while inside a spreadsheet transaction. This is not allowed as it will lead to race conditions")}if(!this.running&&this.computeQueue.length===0){$([]);return()=>{}}let ee=this.addEventListener("change",(...et)=>{ee();return $(...et)});return ee}unload(){this.events.all.clear()}getValue($){return this.getNode($).value}getExpr($){return this.getNode($).expr}getCellValue($,ee){return this.getNode(uk($,ee)).value}getCellExpr($,ee){return this.getNode(uk($,ee)).expr}getCellValueLoose($,ee){let et=uk($,ee);if(this.nodes.has(et)){return this.getNode(et).value}return null}bootup($){this.onFinish(()=>{$()})}load($,ee){const et=this._getNode($);et.expr=ee;et.value=ee}create($,ee){return this.transaction(()=>{const et=this._getNode($);et.expr=ee;et.value=ee;this._markDirty($)})}set($,ee){this.create($,ee)}recompute($){this.transaction(()=>{this.dirtyCells.push($)})}recomputeAll(){this.transaction(()=>{this.dirtyCells=[...this.nodes.keys()]})}createQuery($,ee,et){let en=uk($,ee);let ei=this._getNode(en);if(ei.query!==et){ei.query=et;let{sqlPieces:$,state:ee}=sH(ei.query,sY,sK);ei.sql={sqlPieces:$,state:ee};this.transaction(()=>{this._markDirty(en)})}}createStatic($,ee,et){let en=uk($,ee);let ei=this.nodes.has(en);if(!ei){this.create(en,et)}}createDynamic($,ee,{dependencies:et=[],run:en,initialValue:ei,refresh:eo=false}){let es=uk($,ee);let eu=this._getNode(es);if(eu.dynamic){return}eu.dynamic=true;eu._run=en;et=et.map(ee=>{let et;if(!uC(ee).sheet){et=uk($,ee)}else{et=ee}return et});eu._dependencies=et;this.graph.removeIncomingEdges(es);et.forEach($=>{this.graph.addEdge($,es)});if(eu.value==null||eo){this.transaction(()=>{eu.value=ei;this._markDirty(es)})}}clearSheet($){for(let[ee,et]of this.nodes.entries()){if(et.sheet===$){this.nodes.delete(ee)}}}voidCell($,ee,et=null){let en=this.getNode(uk($,ee));en._run=null;en.dynamic=false;en.value=et}deleteCell($,ee){this.voidCell($,ee);this.nodes.delete(uk($,ee))}addDependencies($,ee,et){let en=uk($,ee);et=et.map(ee=>{if(!uC(ee).sheet){return uk($,ee)}return ee});let ei=this.getNode(en);let eo=et.filter($=>(ei._dependencies||[]).indexOf($)===-1);if(eo.length>0){ei._dependencies=(ei._dependencies||[]).concat(eo);eo.forEach($=>{this.graph.addEdge($,en)});this.recompute(en)}}removeDependencies($,ee,et){let en=uk($,ee);et=et.map(ee=>{if(!uC(ee).sheet){return uk($,ee)}return ee});let ei=this.getNode(en);ei._dependencies=(ei._dependencies||[]).filter($=>et.indexOf($)===-1);et.forEach($=>{this.graph.removeEdge($,en)});this.recompute(en)}_markDirty($){this.dirtyCells.push($)}triggerDatabaseChanges($,ee){let et=new Set([...$.keys(),...ee.keys()]);this.startTransaction();this.nodes.forEach($=>{if($.sql&&$.sql.state.dependencies.some($=>et.has($))){this._markDirty($.name)}});this.endTransaction()}};let uL;let ux;let uP;function uF(){return uL}async function uB($,ee){await a9($,()=>{ee.forEach(ee=>{const et=uL._getNode(ee);if(et.sql==null){a3($,"INSERT OR REPLACE INTO kvcache (key, value) VALUES (?, ?)",[ee,JSON.stringify(et.value)])}})})}function uU($,ee,{clean:et}){if(et){let et=Math.random()*1e7;a3(ee,"INSERT OR REPLACE INTO kvcache_key (id, key) VALUES (1, ?)",[et]);if($){a3($,"INSERT OR REPLACE INTO kvcache_key (id, key) VALUES (1, ?)",[et])}}else{a3(ee,"DELETE FROM kvcache_key")}}function uj($,ee){let et=a3(ee,"SELECT key FROM kvcache_key WHERE id = 1",[],true);let en=et.length===0?null:et[0].key;if(en==null){return true}if($){let ee=a3($,"SELECT key FROM kvcache_key WHERE id = 1",[],true);if(ee.length===0||ee[0].key!==en){return true}}et=a3(ee,"SELECT * FROM kvcache LIMIT 1",[],true);return et.length===0}async function uW($,ee){let et="production"!=="test";let en=$.getDatabase();let ei;if(uv&&et){let ee=$.getDatabasePath().replace(/db\.sqlite$/,"cache.sqlite");uP=ei=oe(ee);a8(ei,`
114
+ CREATE TABLE IF NOT EXISTS kvcache (key TEXT PRIMARY KEY, value TEXT);
115
+ CREATE TABLE IF NOT EXISTS kvcache_key (id INTEGER PRIMARY KEY, key REAL)
116
+ `)}else{ei=en}let eo;if(et){eo=new uM(uB.bind(null,ei),uU.bind(null,en,ei))}else{eo=new uM}aN({message:"loading spreaadsheet",category:"server"});uL=eo;ux=ee;if(ee){eo.addEventListener("change",ee)}if(et&&!uj(en,ei)){let $=await a3(ei,"SELECT * FROM kvcache",[],true);console.log(`Loaded spreadsheet from cache (${$.length} items)`);for(let ee of $){let $=JSON.parse(ee.value);eo.load(ee.key,$)}}else{console.log("Loading fresh spreadsheet");await uV($)}aN({message:"loaded spreaadsheet",category:"server"});return eo}function uH(){if(uL){uL.unload();uL=null}if(uP){ot(uP);uP=null}}async function uz($){if(uL){uH();return uW($,ux)}}async function uV($){let ee=uL;let{budgetType:et}=uA()||{};let en=et==="report"?"reflect_budgets":"zero_budgets";let ei=await $.all(`
117
+ SELECT * FROM ${en} b
118
+ LEFT JOIN categories c ON c.id = b.category
119
+ WHERE c.tombstone = 0
120
+ `);ee.startTransaction();for(let $ of ei){if($.month&&$.category){let et=`budget${$.month}`;ee.set(`${et}!budget-${$.category}`,$.amount);ee.set(`${et}!carryover-${$.category}`,$.carryover===1?true:false)}}if(et!=="report"){let et=await $.all("SELECT * FROM zero_budget_months");for(let $ of et){let et=nQ($.id);ee.set(`${et}!buffered`,$.buffered)}}ee.endTransaction()}function u$($,ee){return uL._getNode(uk($,ee))}function uq($,ee){return uL.getValue(uk($,ee))}function uG(){if(uL){uL.startTransaction()}}function uY(){if(uL){uL.endTransaction()}}function uK(){return new Promise($=>{if(uL){uL.onFinish($)}else{$(undefined)}})};async function uZ($,ee){const et=await u$($,ee);return iN(typeof et.value==="number"?et.value:0)}function uJ($,ee,et){et=Math.min(Math.max(et,-ee),Math.max($,0));return ee+et}function uX(){let{budgetType:$}=uA()||{};return $==="report"?"reflect_budgets":"zero_budgets"}function uQ(){let{budgetType:$}=uA();return $==="report"}function u0($){return parseInt($.replace("-",""))}function u1($,ee){return f2(`
121
+ SELECT b.*, c.is_income FROM v_categories c
122
+ LEFT JOIN ${$} b ON b.category = c.id
123
+ WHERE c.tombstone = 0 AND b.month = ?
124
+ `,[ee])}function u2($){let{createdMonths:ee}=uF().meta();let et=null;for(let $ of ee){if(et==null||$>et){et=$}}return nV($,et)}function u6({category:$,month:ee}){let et=uX();let en=f4(`SELECT * FROM ${et} WHERE month = ? AND category = ?`,[u0(ee),$]);return en?en.amount||0:0}function u4({category:$,month:ee,amount:et}){et=iN(typeof et==="number"?et:0);const en=uX();let ei=f4(`SELECT id FROM ${en} WHERE month = ? AND category = ?`,[u0(ee),$]);if(ei){return f5(en,{id:ei.id,amount:et})}return f7(en,{id:`${u0(ee)}-${$}`,month:u0(ee),category:$,amount:et})}function u3($,ee){let et=f4(`SELECT id FROM zero_budget_months WHERE id = ?`,[$]);if(et){return f5("zero_budget_months",{id:et.id,buffered:ee})}return f7("zero_budget_months",{id:$,buffered:ee})}function u8($,ee,et,en){let ei=f4(`SELECT id FROM ${$} WHERE month = ? AND category = ?`,[et,ee]);if(ei){return f5($,{id:ei.id,carryover:en?1:0})}return f7($,{id:`${et}-${ee}`,month:et,category:ee,carryover:en?1:0})}async function u5({month:$}){let ee=u0(nk($));let et=uX();let en=await u1(et,ee.toString());await fI(async()=>{en.forEach(ee=>{if(ee.is_income===1&&!uQ()){return}u4({category:ee.category,month:$,amount:ee.amount})})})}async function u9({month:$,category:ee}){let et=nk($);let en=await uZ(nQ(et),"budget-"+ee);await fI(async()=>{u4({category:ee,month:$,amount:en})})}async function u7({month:$}){let ee=await f2("SELECT * FROM v_categories WHERE tombstone = 0");await fI(async()=>{ee.forEach(ee=>{if(ee.is_income===1&&!uQ()){return}u4({category:ee.id,month:$,amount:0})})})}async function le({month:$}){let ee=await f2("SELECT * FROM v_categories WHERE tombstone = 0");let et=nk($);let en=nk(et);let ei=nk(en);await fI(async()=>{for(let eo of ee){if(eo.is_income===1&&!uQ()){continue}let ee=await uZ(nQ(et),"sum-amount-"+eo.id);let es=await uZ(nQ(en),"sum-amount-"+eo.id);let eu=await uZ(nQ(ei),"sum-amount-"+eo.id);const el=Math.round((ee+es+eu)/3);u4({category:eo.id,month:$,amount:-el})}})}async function lt({month:$,N:ee,category:et}){let en=nk($);let ei=0;for(let $=0;$<ee;$++){ei+=await uZ(nQ(en),"sum-amount-"+et);en=nk(en)}await fI(async()=>{const en=Math.round(ei/ee);u4({category:et,month:$,amount:-en})})}async function lr({month:$,amount:ee}){let et=await f6("SELECT buffered FROM zero_budget_months WHERE id = ?",[$]);let en=nQ($);let ei=await uZ(en,"to-budget");if(ei>0){let en=uJ(ei,et&&et.buffered||0,ee);await u3($,en);return true}return false}async function ln({month:$}){await u3($,0)}async function li({month:$,to:ee,from:et}){let en=nQ($);let ei=await uZ(en,"budget-"+ee);let eo=await uZ(en,"leftover-"+ee);let es=await uZ(en,et==="to-be-budgeted"?"to-budget":"leftover-"+et);if(eo>=0||es<=0){return}let eu=Math.min(-eo,es);if(et!=="to-be-budgeted"){const ee=await uZ(en,"budget-"+et);await u4({category:et,month:$,amount:ee-eu})}await u4({category:ee,month:$,amount:ei+eu})}async function ls({month:$,amount:ee,category:et}){let en=nQ($);let ei=await uZ(en,"to-budget");ee=Math.max(Math.min(ee,ei),0);let eo=await uZ(en,"budget-"+et);await u4({category:et,month:$,amount:eo+ee})}async function lu({month:$,amount:ee,from:et,to:en}){const ei=nQ($);const eo=await uZ(ei,"budget-"+et);await u4({category:et,month:$,amount:eo-ee});if(en!=="to-be-budgeted"){const et=await uZ(ei,"budget-"+en);await u4({category:en,month:$,amount:et+ee})}}async function lf({startMonth:$,category:ee,flag:et}){let en=uX();let ei=u2($);await fI(async()=>{for(let $ of ei){u8(en,ee,u0($).toString(),et)}})};function ld($){if(typeof $==="number"){return $}else if(typeof $==="string"){const ee=parseFloat($);if(isNaN(ee)){return 0}return ee}return 0};function lp(...$){return iN($.reduce(($,ee)=>{return $+ld(ee)},0))}function lh($){return Array.prototype.concat.apply([],$)}function ly($){let ee=[];for(let et=0;et<$.length;et+=2){ee.push([$[et],$[et+1]])}return ee};async function lg($,ee,et){uF().createStatic(ee,`budget-${$.id}`,0);if(uF().getCellValue(ee,`budget-${$.id}`)==null){uF().set(uk(ee,`budget-${$.id}`),0)}uF().createDynamic(ee,`leftover-${$.id}`,{initialValue:0,dependencies:[`budget-${$.id}`,`sum-amount-${$.id}`,`${et}!carryover-${$.id}`,`${et}!leftover-${$.id}`],run:(ee,et,en,ei)=>{if($.is_income){return iN(ld(ee)-ld(et)+(en?ld(ei):0))}return iN(ld(ee)+ld(et)+(en?ld(ei):0))}});uF().createDynamic(ee,`spent-with-carryover-${$.id}`,{initialValue:0,dependencies:[`budget-${$.id}`,`sum-amount-${$.id}`,`carryover-${$.id}`],refresh:true,run:($,ee,et)=>{return et?Math.max(0,iN(ld($)+ld(ee))):ee}});uF().createStatic(ee,`carryover-${$.id}`,false)}function lm($,ee,et){let en=$.filter($=>$.is_income)[0];let ei=ee.filter($=>!$.is_income);uF().createDynamic(et,"total-budgeted",{initialValue:0,dependencies:$.filter($=>!$.is_income).map($=>`group-budget-${$.id}`),run:lp});uF().createDynamic(et,"total-spent",{initialValue:0,refresh:true,dependencies:ei.map($=>`${et}!spent-with-carryover-${$.id}`),run:lp});uF().createDynamic(et,"total-income",{initialValue:0,dependencies:[`group-sum-amount-${en.id}`],run:$=>$});uF().createDynamic(et,"total-leftover",{initialValue:0,dependencies:["total-budgeted","total-spent"],run:lp});uF().createDynamic(et,"total-budget-income",{initialValue:0,dependencies:[`group-budget-${en.id}`],run:$=>$});uF().createDynamic(et,"total-saved",{initialValue:0,dependencies:["total-budget-income","total-budgeted"],run:($,ee)=>{return $-ee}});uF().createDynamic(et,"real-saved",{initialValue:0,dependencies:["total-income","total-spent"],run:($,ee)=>{return iN($- -ee)}})};function l_($){let ee=nk($[0]);return nQ(ee)}function lv($,ee){if(ee.length>0){let et=l_(ee);uF().createStatic(et,`carryover-${$.id}`,false);uF().createStatic(et,`leftover-${$.id}`,0);uF().createStatic(et,`leftover-pos-${$.id}`,0)}}function lw($,ee,et){uF().createStatic(ee,"is-blank",true);uF().createStatic(ee,"to-budget",0);uF().createStatic(ee,"buffered",0);$.forEach($=>lv($,et))}function lE($,ee,et){if(!$.is_income){uF().createStatic(ee,`budget-${$.id}`,0);if(uF().getCellValue(ee,`budget-${$.id}`)==null){uF().set(uk(ee,`budget-${$.id}`),0)}uF().createStatic(ee,`carryover-${$.id}`,false);uF().createDynamic(ee,`leftover-${$.id}`,{initialValue:0,dependencies:[`budget-${$.id}`,`sum-amount-${$.id}`,`${et}!carryover-${$.id}`,`${et}!leftover-${$.id}`,`${et}!leftover-pos-${$.id}`],run:($,ee,et,en,ei)=>{return iN(ld($)+ld(ee)+(et?ld(en):ld(ei)))}});uF().createDynamic(ee,"leftover-pos-"+$.id,{initialValue:0,dependencies:[`leftover-${$.id}`],run:$=>{return $<0?0:$}})}}function lS($,ee,et,en){let ei=$.filter($=>$.is_income)[0];let eo=ee.filter($=>!$.is_income);uF().createStatic(en,"buffered",0);uF().createDynamic(en,"from-last-month",{initialValue:0,dependencies:[`${et}!to-budget`,`${et}!buffered`],run:($,ee)=>iN(ld($)+ld(ee))});uF().createDynamic(en,"total-income",{initialValue:0,dependencies:[`group-sum-amount-${ei.id}`],run:$=>$});uF().createDynamic(en,"available-funds",{initialValue:0,dependencies:["total-income","from-last-month"],run:($,ee)=>iN(ld($)+ld(ee))});uF().createDynamic(en,"last-month-overspent",{initialValue:0,dependencies:lh(eo.map($=>[`${et}!leftover-${$.id}`,`${et}!carryover-${$.id}`])),run:(...$)=>{$=ly($);return iN($.reduce(($,[ee,et])=>{if(et){return $}return $+Math.min(0,ld(ee))},0))}});uF().createDynamic(en,"total-budgeted",{initialValue:0,dependencies:$.filter($=>!$.is_income).map($=>`group-budget-${$.id}`),run:(...$)=>{return-lp(...$)}});uF().createDynamic(en,"buffered",{initialValue:0});uF().createDynamic(en,"to-budget",{initialValue:0,dependencies:["available-funds","last-month-overspent","total-budgeted","buffered"],run:($,ee,et,en)=>{return iN(ld($)+ld(ee)+ld(et)-ld(en))}});uF().createDynamic(en,"total-spent",{initialValue:0,dependencies:$.filter($=>!$.is_income).map($=>`group-sum-amount-${$.id}`),run:lp});uF().createDynamic(en,"total-leftover",{initialValue:0,dependencies:$.filter($=>!$.is_income).map($=>`group-leftover-${$.id}`),run:lp})}function lT($,ee,et){let en=l_(et);if($.blankSheet!==en){uF().clearSheet($.blankSheet);lw(ee,en,et);$.blankSheet=en}};function lO(){let $=uF().meta();return $.budgetType||"rollover"}function lA($,ee){$=nZ($);ee=nZ(ee);if($>ee){$=ee}$=nP($,3);ee=nM(ee,12);return{start:$,end:ee,range:nV($,ee)}}function lI($,ee,et,en,ei){uF().createDynamic(ee,"sum-amount-"+$.id,{initialValue:0,run:()=>{let ee=fK(`SELECT SUM(amount) as amount FROM v_transactions_internal_alive t
125
+ LEFT JOIN accounts a ON a.id = t.account
126
+ WHERE t.date >= ${en} AND t.date <= ${ei}
127
+ AND category = '${$.id}' AND a.offbudget = 0`,[],true);let et=ee[0];let eo=et?et.amount:0;return eo||0}});if(lO()==="rollover"){lE($,ee,et)}else{lg($,ee,et)}}function lN($,ee){uF().createDynamic(ee,"group-sum-amount-"+$.id,{initialValue:0,dependencies:$.categories.map($=>`sum-amount-${$.id}`),run:lp});if(!$.is_income||lO()!=="rollover"){uF().createDynamic(ee,"group-budget-"+$.id,{initialValue:0,dependencies:$.categories.map($=>`budget-${$.id}`),run:lp});uF().createDynamic(ee,"group-leftover-"+$.id,{initialValue:0,dependencies:$.categories.map($=>`leftover-${$.id}`),run:lp})}}function lD($,ee,et){if(!ee||ee.offbudget!==et.offbudget){let ee=fK(`
128
+ SELECT DISTINCT(category) as category FROM transactions
129
+ WHERE acct = ?
130
+ `,[et.id],true);$.forEach($=>{let et=nQ($);ee.forEach($=>{uF().recompute(uk(et,"sum-amount-"+$.category))})})}}function lR($,ee){if((ee.has("date")||ee.has("acct")||ee.has("amount")||ee.has("category")||ee.has("tombstone")||ee.has("isParent"))&&$.date&&$.category){let ee=nA(oY($.date));let et=nQ(ee);uF().recompute(uk(et,"sum-amount-"+$.category))}}function lk($,ee,et){$.forEach($=>{let en=nQ($);if(ee){uF().recompute(uk(en,"sum-amount-"+ee.transferId))}uF().recompute(uk(en,"sum-amount-"+et.transferId))})}function lM($,ee,et){function en($,ee,et){uF().addDependencies($,`group-sum-amount-${ee}`,[`sum-amount-${et}`]);uF().addDependencies($,`group-budget-${ee}`,[`budget-${et}`]);uF().addDependencies($,`group-leftover-${ee}`,[`leftover-${et}`])}function ei($,ee,et){uF().removeDependencies($,`group-sum-amount-${ee}`,[`sum-amount-${et}`]);uF().removeDependencies($,`group-budget-${ee}`,[`budget-${et}`]);uF().removeDependencies($,`group-leftover-${ee}`,[`leftover-${et}`])}let eo=lO();if(ee&&ee.tombstone===0&&et.tombstone===1){let ee=et.id;let en=et.cat_group;$.forEach($=>{let et=nQ($);ei(et,en,ee)})}else if(et.tombstone===0&&(!ee||ee.tombstone===1)){if(eo==="rollover"){lv(et,$)}$.forEach($=>{let ee=nk($);let ei=nQ(ee);let eo=nQ($);let{start:es,end:eu}=nW($);lI(et,eo,ei,es,eu);let el=et.id;let ef=et.cat_group;if(lO()==="rollover"){uF().addDependencies(eo,"last-month-overspent",[`${ei}!leftover-${el}`,`${ei}!carryover-${el}`])}en(eo,ef,el)})}else if(ee&&ee.cat_group!==et.cat_group){let eo=et.id;$.forEach($=>{let es=nQ($);ei(es,ee.cat_group,eo);en(es,et.cat_group,eo)})}}function lL($,ee,et){let en=lO();function ei($,ee){uF().addDependencies($,"total-budgeted",[`group-budget-${ee}`]);uF().addDependencies($,"total-spent",[`group-sum-amount-${ee}`]);uF().addDependencies($,"total-leftover",[`group-leftover-${ee}`])}function eo($,ee){uF().removeDependencies($,"total-budgeted",[`group-budget-${ee}`]);uF().removeDependencies($,"total-spent",[`group-sum-amount-${ee}`]);uF().removeDependencies($,"total-leftover",[`group-leftover-${ee}`])}if(et.tombstone===1&&ee&&ee.tombstone===0){let ee=et.id;$.forEach($=>{let et=nQ($);eo(et,ee)})}else if(et.tombstone===0&&(!ee||ee.tombstone===1)){let ee=et;if(!ee.is_income||en!=="rollover"){$.forEach($=>{let et=nQ($);let en=fK("SELECT * FROM categories WHERE tombstone = 0 AND cat_group = ?",[ee.id],true);lN({...ee,categories:en},et);ei(et,ee.id)})}}}function lP($){let ee=nQ($.id);uF().set(`${ee}!buffered`,$.buffered)}function lF($){if($.category){let ee=nQ($.month.toString());uF().set(`${ee}!budget-${$.category}`,$.amount||0);uF().set(`${ee}!carryover-${$.category}`,$.carryover===1?true:false)}}function lB($,ee){let{createdMonths:et=new Set}=uF().meta();uG();try{ee.forEach((ee,en)=>{let ei=$.get(en);ee.forEach($=>{let ee=ei&&ei.get($.id);if(en==="zero_budget_months"){lP($)}else if(en==="zero_budgets"||en==="reflect_budgets"){lF($)}else if(en==="transactions"){let et=new Set(Object.keys(ie(ee||{},$)||{}));if(ee){lR(ee,et)}lR($,et)}else if(en==="category_mapping"){lk(et,ee,$)}else if(en==="categories"){lM(et,ee,$)}else if(en==="category_groups"){lL(et,ee,$)}else if(en==="accounts"){lD(et,ee,$)}})})}finally{uY()}}async function lU($,ee){let{createdMonths:et}=uF().meta();[...et].forEach(et=>{let en=$.map($=>{return u6({month:et,category:$})}).reduce(($,ee)=>$+ee,0);let ei=u6({month:et,category:ee});u4({month:et,category:ee,amount:en+ei})})}async function lj($){const ee=await du();const et=await dl();uG();let en=uF().meta();en.createdMonths=en.createdMonths||new Set;let ei=lO();if(ei==="rollover"){lT(en,ee,$)}$.forEach($=>{if(!en.createdMonths.has($)){let eo=nk($);let{start:es,end:eu}=nW($);let el=nQ($);let ef=nQ(eo);ee.forEach($=>{lI($,el,ef,es,eu)});et.forEach($=>{lN($,el)});if(ei==="rollover"){lS(et,ee,ef,el)}else{lm(et,ee,el)}en.createdMonths.add($)}});uF().setMeta(en);uY();await uK()}async function lW(){let $=await f6("SELECT * FROM transactions WHERE isChild=0 AND date IS NOT NULL ORDER BY date ASC LIMIT 1");let ee=$&&oY($.date);let et=nN();let{start:en,end:ei,range:eo}=lA(ee||et,et);let es=uF().meta();let eu=es.createdMonths||new Set;let el=eo.filter($=>!eu.has($));if(el.length>0){await lj(eo)}return{start:en,end:ei}}async function lH(ee){let et=uF().meta();if(ee===et.budgetType){return}et.budgetType=ee;et.createdMonths=new Set;let en=uF().getNodes();f0(()=>{for(let $ of en.keys()){let[ee,et]=$.split("!");if(ee.match(/^budget\d+/)){uF().deleteCell(ee,et)}}});uF().startCacheBarrier();uV($);let ei=await lW();uF().endCacheBarrier();return ei};class lz extends Error{meta;reason;type;constructor($,ee){super("PostError: "+$);this.type="PostError";this.reason=$;this.meta=ee}}class lV extends Error{statusCode;responseBody;constructor($,ee){super(`HTTPError: unsuccessful status code (${$}): ${ee}`);this.statusCode=$;this.responseBody=ee}}class l$ extends Error{meta;reason;constructor($,ee){super("SyncError: "+$);this.reason=$;this.meta=ee}}class lq extends Error{}class lG extends Error{type;constructor($,ee){super("RuleError: "+ee);this.type=$}}function lY($,ee){return{type:"APIError",message:$,meta:ee}}function lK($,ee){return{type:"FileDownloadError",reason:$,meta:ee}}function lZ($,ee){return{type:"FileUploadError",reason:$,meta:ee}};class lJ{events;handlers;services;unlistenServices;constructor(){this.handlers={};this.services=[];this.events=uN();this.unlistenServices=[]}method($,ee){if(this.handlers[$]!=null){throw new Error("Conflicting method name, names must be globally unique: "+$)}this.handlers[$]=ee}service($){this.services.push($)}combine(...$){for(let ee of $){Object.keys(ee.handlers).forEach($=>{this.method($,ee.handlers[$])});ee.services.forEach($=>{this.service($)});for(let[$,et]of ee.events.all.entries()){for(let ee of et){this.events.on($,ee)}}}}startServices(){if(this.unlistenServices.length>0){aI(new Error("App: startServices called while services are already running"))}this.unlistenServices=this.services.map($=>$())}stopServices(){this.unlistenServices.forEach($=>{if($){$()}});this.unlistenServices=[]}}function lX(){return new lJ};const lQ=lX();lQ.events.on("sync",$=>{aZ("sync-event",$)});const l0=lQ;const l1=globalThis.fetch;var l2=__webpack_require__(8764)["Buffer"];function l6($,ee){if($.status!==200){if($.status===500){throw new lz($.status===500?"internal":ee)}let et=$.headers.get("Content-Type");if(et.toLowerCase().indexOf("application/json")!==-1){let $=JSON.parse(ee);throw new lz($.reason)}throw new lz(ee)}}async function l4($,ee,et={}){let en;let ei;try{ei=await l1($,{method:"POST",body:JSON.stringify(ee),headers:{...et,"Content-Type":"application/json"}});en=await ei.text()}catch($){throw new lz("network-failure")}l6(ei,en);try{ei=JSON.parse(en)}catch($){throw new lz("parse-json",{meta:en})}if(ei.status!=="ok"){console.log("API call failed: "+$+"\nData: "+JSON.stringify(ee,null,2)+"\nResponse: "+JSON.stringify(ei,null,2));throw new lz(ei.description||ei.reason||"unknown")}return ei.data}async function l3($,ee,et){let en;try{en=await l1($,{method:"POST",body:u_?ee:l2.from(ee),headers:{"Content-Length":ee.length,"Content-Type":"application/actual-sync",...et}})}catch($){throw new lz("network-failure")}let ei;if(en.arrayBuffer){ei=l2.from(await en.arrayBuffer())}else{ei=await en.buffer()}l6(en,ei.toString());return ei}function l8($,ee){return l1($,ee).then($=>$.text())};let l5=null;function l9($,...ee){let et=new URL($);et.pathname=ou(...ee);return et.toString()}function l7($){if($==null){l5=null}else{l5=ce($)}}function ce($){if($){return{BASE_SERVER:$,SYNC_SERVER:l9($,"/sync"),SIGNUP_SERVER:l9($,"/account"),PLAID_SERVER:l9($,"/plaid"),GOCARDLESS_SERVER:l9($,"/gocardless")}}return l5};let ct=[{type:"marker"}];let cn=0;let co=20;function cs(){ct=ct.slice(0,cn+1);let $=ct.filter($=>$.type==="marker");if($.length>co){let ee=$.slice(-co);let et=ct.indexOf(ee[0]);ct=ct.slice(et);cn=ct.length-1}}function cu($,ee){let et=aq();if(et.undoListening&&$.length>0){cs();let{undoTag:en}=et;ct.push({type:"messages",messages:$,oldData:ee,undoTag:en});cn++}}function cl(){ct=[{type:"marker"}];cn=0}function cf($,ee){let et=aq();if(et.undoDisabled||et.undoListening){return $()}ct=ct.slice(0,cn+1);let en={type:"marker",meta:ee};if(ct[ct.length-1].type==="marker"){ct[ct.length-1]=en}else{ct.push(en);cn++}return a$({undoListening:true,undoTag:et.undoTag},$)}function cd($){return(...ee)=>{return cf(()=>{return $(...ee)})}}async function cp($,ee,et){await a$({undoListening:false},()=>{return fN($.map($=>({...$,timestamp:eo.Timestamp.send()})))});const en=$.reduce(($,ee)=>{if(!$.includes(ee.dataset)){$.push(ee.dataset)}return $},[]);aZ("undo-event",{messages:$,tables:en,meta:ee,undoTag:et})}async function cy(){let $=cn;cn=Math.max(cn-1,0);while(cn>0&&ct[cn].type!=="marker"){cn--}let ee=ct[cn].meta;let et=Math.max(cn,0);let en=ct.slice(et,$+1).filter($=>$.type==="messages");if(en.length>0){let $=en.reduce(($,ee)=>{return $.concat(ee.messages.map($=>cg($,ee.oldData)).filter($=>$))},[]).reverse();await cp($,ee,en[0].undoTag)}}function cg($,ee){let et=ig(ee,[$.dataset,$.row]);if(et){let ee=$.column;if($.dataset==="spreadsheet_cells"){ee="cachedValue"}return{...$,value:et[ee]}}else{if($.dataset==="spreadsheet_cells"){if($.column==="expr"){return{...$,value:null}}return $}else if($.dataset!=="category_mapping"&&$.dataset!=="payee_mapping"){if($.dataset==="zero_budget_months"||$.dataset==="zero_budgets"||$.dataset==="reflect_budgets"){if(["buffered","amount","carryover"].includes($.column)){return{...$,value:0}}return null}else if($.dataset==="notes"){return{...$,value:null}}return{...$,column:"tombstone",value:1}}}return null}async function cm(){let $=ct[cn].type==="marker"?ct[cn].meta:null;let ee=cn;cn=Math.min(cn+1,ct.length-1);while(cn<ct.length-1&&ct[cn].type!=="marker"){cn++}let et=cn;let en=ct.slice(ee+1,et+1).filter($=>$.type==="messages");if(en.length>0){let ee=en.reduce(($,ee)=>{return $.concat(ee.messages).concat(c_(ee.messages,ee.oldData))},[]);await cp(ee,$,en[en.length-1].undoTag)}}function c_($,ee){let et=new Set;$.forEach($=>{let en=ig(ee,[$.dataset,$.row]);if(!en&&!["zero_budget_months","zero_budgets","reflect_budgets","notes","category_mapping","payee_mapping"].includes($.dataset)){et.add($.dataset+"."+$.row)}});return[...et].map($=>{let[ee,et]=$.split(".");return{dataset:ee,row:et,column:"tombstone",value:0,timestamp:eo.Timestamp.send()}})};var cv=__webpack_require__(8764)["Buffer"];let cw="aes-256-gcm";function cE($){switch($){case"aes-256-gcm":return"AES-GCM";default:throw new Error("unsupported crypto algorithm: "+$)}}async function cS($){let ee=new TextEncoder("utf-8").encode($).buffer;let et=await crypto.subtle.digest("sha-256",ee);let en=Array.from(new Uint8Array(et)).map($=>String.fromCharCode($)).join("");return btoa(en)}function cT($){return cv.from(crypto.getRandomValues(new Uint8Array($)))}async function cO($,ee){let et=crypto.getRandomValues(new Uint8Array(12));let en=await crypto.subtle.encrypt({name:cE(cw),iv:et,tagLength:128},$.getValue().raw,ee);en=cv.from(en);let ei=en.slice(-16);en=en.slice(0,-16);return{value:en,meta:{keyId:$.getId(),algorithm:cw,iv:cv.from(et).toString("base64"),authTag:ei.toString("base64")}}}async function cA($,ee,et){let{algorithm:en,iv:ei,authTag:eo}=et;let es=await crypto.subtle.decrypt({name:cE(en),iv:cv.from(ei,"base64"),tagLength:128},$.getValue().raw,cv.concat([ee,cv.from(eo,"base64")]));return cv.from(es)}async function cI({secret:$,salt:ee}){let et=cv.from($);let en=cv.from(ee);let ei=await crypto.subtle.importKey("raw",et,{name:"PBKDF2"},false,["deriveBits","deriveKey"]);let eo=await crypto.subtle.deriveKey({name:"PBKDF2",hash:"SHA-512",salt:en,iterations:1e4},ei,{name:"AES-GCM",length:256},true,["encrypt","decrypt"]);let es=await crypto.subtle.exportKey("raw",eo);return{raw:eo,base64:cv.from(es).toString("base64")}}async function cN($){let ee=await crypto.subtle.importKey("raw",cv.from($,"base64"),{name:"AES-GCM"},false,["encrypt","decrypt"]);return{raw:ee,base64:$}};let cD={};class cR{id;value;constructor({id:$}){this.id=$||e_()}async createFromPassword({password:$,salt:ee}){this.value=await cI({secret:$,salt:ee})}async createFromBase64($){this.value=await cN($)}getId(){return this.id}getValue(){return this.value}serialize(){return{id:this.id,base64:this.value.base64}}}function cC($){if($==null||cD[$]==null){throw new Error("missing-key")}return cD[$]}function cM($){return $ in cD}function cL($,ee){return cO(cC(ee),$)}function cx($,ee){return cA(cC(ee.keyId),$,ee)}function cP($){return cT($)}async function cF($){let ee;if(!($ instanceof cR)){ee=new cR({id:$.id});await ee.createFromBase64($.base64)}else{ee=$}cD[ee.getId()]=ee}function cB($){delete cD[$.getId()]}function cU(){cD={}}async function cj({id:$,password:ee,salt:et}){let en=new cR({id:$});await en.createFromPassword({password:ee,salt:et});return en};var cW=__webpack_require__(8764)["Buffer"];function cH($){if(!cW.isBuffer($)){return cW.from($)}return $}async function cz($,ee,et,en){let{encryptKeyId:ei}=uA();let es=new eo.SyncProtoBuf.SyncRequest;for(let $=0;$<en.length;$++){let ee=en[$];let et=new eo.SyncProtoBuf.MessageEnvelope;et.setTimestamp(ee.timestamp.toString());let eu=new eo.SyncProtoBuf.Message;eu.setDataset(ee.dataset);eu.setRow(ee.row);eu.setColumn(ee.column);eu.setValue(ee.value);let el=eu.serializeBinary();if(ei){let $=new eo.SyncProtoBuf.EncryptedData;let ee;try{ee=await cL(el,ei)}catch($){throw new l$("encrypt-failure",{isMissingKey:$.message==="missing-key"})}$.setData(ee.value);$.setIv(cW.from(ee.meta.iv,"base64"));$.setAuthtag(cW.from(ee.meta.authTag,"base64"));et.setContent($.serializeBinary());et.setIsencrypted(true)}else{et.setContent(el)}es.addMessages(et)}es.setGroupid($);es.setFileid(ee);es.setKeyid(ei);es.setSince(et.toString());return es.serializeBinary()}async function cV($){let{encryptKeyId:ee}=uA();let et=eo.SyncProtoBuf.SyncResponse.deserializeBinary($);let en=JSON.parse(et.getMerkle());let ei=et.getMessagesList();let es=[];for(let $=0;$<ei.length;$++){let et=ei[$];let en=eo.Timestamp.parse(et.getTimestamp());let eu=et.getIsencrypted();let el;if(eu){let $=eo.SyncProtoBuf.EncryptedData.deserializeBinary(et.getContent());let en;try{en=await cx(cH($.getData()),{keyId:ee,algorithm:"aes-256-gcm",iv:cH($.getIv()),authTag:cH($.getAuthtag())})}catch($){console.log($);throw new l$("decrypt-failure",{isMissingKey:$.message==="missing-key"})}el=eo.SyncProtoBuf.Message.deserializeBinary(en)}else{el=eo.SyncProtoBuf.Message.deserializeBinary(et.getContent())}es.push({timestamp:en,dataset:el.getDataset(),row:el.getRow(),column:el.getColumn(),value:el.getValue()})}return{messages:es,merkle:en}};function c$(){let $=fK("SELECT timestamp FROM messages_crdt",[],true);let ee=eo.merkle.emptyTrie();for(let et=0;et<$.length;et++){ee=eo.merkle.insert(ee,eo.Timestamp.parse($[et].timestamp))}return{numMessages:$.length,trie:ee}}async function cq(){let $=c$();let ee=(0,eo.getClock)();ee.merkle=$.trie;fK(fX("INSERT OR REPLACE INTO messages_clock (id, clock) VALUES (1, ?)"),[(0,eo.serializeClock)(ee)])};function cG($){return $.error!==undefined};async function cY(){return(await cP(12)).toString()}async function cK($){let ee=new eo.SyncProtoBuf.Message;ee.setDataset(await cY());ee.setRow(await cY());ee.setColumn(await cY());ee.setValue(await cY());let et=ee.serializeBinary();return await cL(et,$)}var cZ=__webpack_require__(5285);var cJ=__webpack_require__.n(cZ);var cX=__webpack_require__(8764)["Buffer"];let cQ=7;async function c0($){if($.status!==200){return $.text().then(ee=>{throw new lV($.status,ee)})}else{return $}}async function c6(...$){let ee=await l1(...$);ee=await c0(ee);return ee.json()}async function c4(){let $=await rX("user-token");let{cloudFileId:ee,encryptKeyId:et}=uA();let en;try{en=await l4(ce().SYNC_SERVER+"/user-get-key",{token:$,fileId:ee})}catch($){console.log($);return{valid:false,error:{reason:"network"}}}return{valid:en.id==et&&(et==null||cM(et))}}async function c3($){let ee=await rX("user-token");let{cloudFileId:et}=uA();try{await l4(ce().SYNC_SERVER+"/reset-user-file",{token:ee,fileId:et})}catch($){if($ instanceof lz){return{error:{reason:$.reason==="unauthorized"?"unauthorized":"network"}}}return{error:{reason:"internal"}}}if($){try{await l4(ce().SYNC_SERVER+"/user-create-key",{token:ee,fileId:et,keyId:$.key.getId(),keySalt:$.salt,testContent:$.testContent})}catch($){if($ instanceof lz){return{error:{reason:"network"}}}return{error:{reason:"internal"}}}}return{}}async function c8(){let{id:$,budgetName:ee}=uA();if(!ee){return null}let et=od($);let en=new(cJ());await aV(async()=>{let $=await oj(ou(et,"db.sqlite"),"binary");let ee=await oe($);a8(ee,`
131
+ DELETE FROM kvcache;
132
+ DELETE FROM kvcache_key;
133
+ `);let ei=await or(ee);ot(ee);let eo=JSON.parse(await oj(ou(et,"metadata.json")));eo.resetClock=true;let es=cX.from(JSON.stringify(eo),"utf8");en.addFile("db.sqlite",cX.from(ei));en.addFile("metadata.json",es)});return cX.from(en.toBuffer())}async function c5($,ee){let et,en;try{et=new(cJ())(ee);en=et.getEntries()}catch($){throw lK("not-zip-file")}let ei=en.find($=>$.entryName.includes("db.sqlite"));let eo=en.find($=>$.entryName.includes("metadata.json"));if(!ei||!eo){throw lK("invalid-zip-file")}let es=et.readFile(ei);let eu=et.readFile(eo);let el;try{el=JSON.parse(eu.toString("utf8"))}catch($){throw lK("invalid-meta-file")}el={...el,cloudFileId:$.fileId,groupId:$.groupId,lastUploaded:nR(),encryptKeyId:$.encryptMeta?$.encryptMeta.keyId:null};let ef=od(el.id);if(await oP(ef)){let $=ou(ef,"db.sqlite");let ee=ou(ef,"metadata.json");if(await oP($)){await oH($)}if(await oP(ee)){await oH(ee)}}else{await oF(ef)}await oW(ou(ef,"db.sqlite"),es);await oW(ou(ef,"metadata.json"),JSON.stringify(el));return{id:el.id}}async function c9(){let $=await rX("user-token");if(!$){throw lZ("unauthorized")}let ee=await c8();if(ee==null){return}let{id:et,groupId:en,budgetName:ei,cloudFileId:eo,encryptKeyId:es}=uA();let eu=ee;let el=null;if(es){let $;try{$=await cL(ee,es)}catch($){throw lZ("encrypt-failure",{isMissingKey:$.message==="missing-key"})}eu=$.value;el=$.meta}if(!eo){eo=e_()}let ef;try{ef=await c6(ce().SYNC_SERVER+"/upload-user-file",{method:"POST",headers:{"Content-Length":eu.length,"Content-Type":"application/encrypted-file","X-ACTUAL-TOKEN":$,"X-ACTUAL-FILE-ID":eo,"X-ACTUAL-NAME":encodeURIComponent(ei),"X-ACTUAL-FORMAT":2,...el?{"X-ACTUAL-ENCRYPT-META":JSON.stringify(el)}:null,...en?{"X-ACTUAL-GROUP-ID":en}:null},body:eu})}catch($){console.log("Upload failure",$);if($ instanceof lz){throw lZ($.reason==="unauthorized"?"unauthorized":$.reason||"network")}throw lZ("internal")}if(ef.status==="ok"){if(uA()&&uA().id===et){await uT({lastUploaded:nR(),cloudFileId:eo,groupId:ef.groupId})}}else{throw lZ("internal")}}async function c7(){let{cloudFileId:$,groupId:ee,lastUploaded:et}=uA();let en=et&&nF(et,cQ);let ei=nR();if(et&&ei<en){return}if(!$||!ee){return}c9().catch($=>{})}async function fe($){let ee=await rX("user-token");await l4(ce().SYNC_SERVER+"/delete-user-file",{token:ee,fileId:$})}async function ft(){let $=await rX("user-token");if(!$){return null}let ee;try{ee=await c6(ce().SYNC_SERVER+"/list-user-files",{headers:{"X-ACTUAL-TOKEN":$}})}catch($){console.log("Unexpected error fetching file list from server",$);return null}if(ee.status==="error"){console.log("Error fetching file list from server",ee);return null}return ee.data.map($=>({...$,hasKey:cM($.encryptKeyId)}))}async function fr($){let ee=await rX("user-token");let et;try{et=await l1(ce().SYNC_SERVER+"/download-user-file",{headers:{"X-ACTUAL-TOKEN":ee,"X-ACTUAL-FILE-ID":$}}).then(c0).then($=>{if($.arrayBuffer){return $.arrayBuffer().then($=>cX.from($))}return $.buffer()})}catch($){console.log("Download failure",$);throw lK("download-failure")}let en;try{en=await c6(ce().SYNC_SERVER+"/get-user-file-info",{headers:{"X-ACTUAL-TOKEN":ee,"X-ACTUAL-FILE-ID":$}})}catch(ee){console.log("Error fetching file info",ee);throw lK("internal",{fileId:$})}if(en.status!=="ok"){console.log("Could not download file from the server. Are you sure you have the right file ID?",en);throw lK("internal",{fileId:$})}let ei=en.data;if(ei.encryptMeta){try{et=await cx(et,ei.encryptMeta)}catch($){throw lK("decrypt-failure",{isMissingKey:$.message==="missing-key"})}}return c5(ei,et)};async function fi($){if(!$){let{valid:$,error:ee}=await c4();if(ee){return{error:ee}}else if(!$){return{error:{reason:"file-has-new-key"}}}}let{error:ee}=await c3($);if(ee){return{error:ee}}await aV(async()=>{await fZ(`
134
+ DELETE FROM messages_crdt;
135
+ DELETE FROM messages_clock;
136
+ DELETE FROM transactions WHERE tombstone = 1;
137
+ DELETE FROM accounts WHERE tombstone = 1;
138
+ DELETE FROM payees WHERE tombstone = 1;
139
+ DELETE FROM categories WHERE tombstone = 1;
140
+ DELETE FROM category_groups WHERE tombstone = 1;
141
+ DELETE FROM schedules WHERE tombstone = 1;
142
+ DELETE FROM rules WHERE tombstone = 1;
143
+ ANALYZE;
144
+ VACUUM;
145
+ `);await fY()});await uT({groupId:null,lastSyncedTimestamp:null,lastUploaded:null});if($){let{key:ee}=$;let{cloudFileId:et}=uA();let en=JSON.parse(await rX(`encrypt-keys`)||"{}");en[et]=ee.serialize();await rQ("encrypt-keys",JSON.stringify(en));await uT({encryptKeyId:ee.getId()})}try{await c9()}catch($){if($.reason){return{error:$}}aI($);return{error:{reason:"upload-failure"}}}finally{aZ("prefs-updated")}return{}};let fo=1e3;let fu="enabled";function fl($){let ee=fu;switch($){case"enabled":fu="enabled";break;case"offline":fu="offline";break;case"disabled":fu="disabled";break;case"import":fu="import";break;default:throw new Error("setSyncingMode: invalid mode: "+$)}return ee}function ff($){switch($){case"enabled":return fu==="enabled"||fu==="offline";case"disabled":return fu==="disabled"||fu==="import";case"offline":return fu==="offline";case"import":return fu==="import";default:throw new Error("checkSyncingMode: invalid mode: "+$)}}function fp($,ee){let{dataset:et,row:en,column:ei,value:eo}=$;if(et==="prefs"){}else{let $;try{if(ee){$={sql:`UPDATE ${et} SET ${ei} = ? WHERE id = ?`,params:[eo,en]}}else{$={sql:`INSERT INTO ${et} (id, ${ei}) VALUES (?, ?)`,params:[en,eo]}}fK(fX($.sql),$.params)}catch(ee){throw new l$("invalid-schema",{error:{message:ee.message,stack:ee.stack},query:$})}}}async function fh($,ee){let et=[];let en=100;for(let ei=0;ei<ee.length;ei+=en){let eo=ee.slice(ei,ei+en);let es;let eu=`${$}.id`;if($==="transactions"){es=`
146
+ SELECT t.*, c.transferId AS category
147
+ FROM transactions t
148
+ LEFT JOIN category_mapping c ON c.id = t.category
149
+ `;eu="t.id"}else{es=`SELECT * FROM ${$}`}es+=` WHERE `;es+=eo.map($=>`${eu} = ?`).join(" OR ");try{let $=await fK(es,eo,true);et=et.concat($)}catch($){throw new l$("invalid-schema",{error:{message:$.message,stack:$.stack},sql:es,params:eo})}}return et}function fy($){if($===null){return"0:"}else if(typeof $==="number"){return"N:"+$}else if(typeof $==="string"){return"S:"+$}throw new Error("Unserializable value type: "+JSON.stringify($))}function fg($){const ee=$[0];switch(ee){case"0":return null;case"N":return parseFloat($.slice(2));case"S":return $.slice(2);default:}throw new Error("Invalid type key for value: "+$)}let fm=[];function f_($){fm.push($);return()=>{fm=fm.filter(ee=>ee!==$)}}async function fv($){let ee=[];for(let et=0;et<$.length;et++){let en=$[et];let{dataset:ei,row:eo,column:es,timestamp:eu}=en;let el=eu.toString();let ef=fK(fX("SELECT timestamp FROM messages_crdt WHERE dataset = ? AND row = ? AND column = ? AND timestamp >= ?"),[ei,eo,es,el],true);if(ef.length===0){ee.push(en)}else if(ef[0].timestamp!==el){ee.push({...en,old:true})}}return ee}function fw($){f0(()=>{for(let ee=0;ee<$.length;ee++){let et=$[ee];let{dataset:en}=et;if(!et.old){try{fp(et)}catch($){fp(et,true)}if(en==="prefs"){throw new Error("Cannot set prefs while importing")}}}})}const fE=aD(async $=>{if(ff("import")){fw($);return undefined}else if(ff("enabled")){$=await fv($)}$=[...$].sort(($,ee)=>{let et=$.timestamp?$.timestamp.toString():"";let en=ee.timestamp?ee.timestamp.toString():"";if(et<en){return-1}else if(et>en){return 1}return 0});let ee={};$.forEach($=>{if($.dataset==="prefs"){return}if(ee[$.dataset]==null){ee[$.dataset]=[]}ee[$.dataset].push($.row)});async function et(){let $=new Map;for(let et of Object.keys(ee)){const en=await fh(et,ee[et]);for(let ee=0;ee<en.length;ee++){let ei=en[ee];iy($,[et,ei.id],ei)}}return $}let en={};let ei=await et();cu($,ei);let es;let eu;if(ff("enabled")){es=(0,eo.getClock)();eu=es.merkle}if(uF()){uF().startCacheBarrier()}f0(()=>{let ee=new Set;for(const et of $){const{dataset:$,row:es,column:el,timestamp:ef,value:ed}=et;if(!et.old){fp(et,ig(ei,[$,es])||ee.has($+es));if($==="prefs"){en[es]=ed}else{ee.add($+es)}}if(ff("enabled")){fK(fX(`INSERT INTO messages_crdt (timestamp, dataset, row, column, value)
150
+ VALUES (?, ?, ?, ?, ?)`),[ef.toString(),$,es,el,fy(ed)]);eu=eo.merkle.insert(eu,ef)}}if(ff("enabled")){eu=eo.merkle.prune(eu);fK(fX("INSERT OR REPLACE INTO messages_clock (id, clock) VALUES (1, ?)"),[(0,eo.serializeClock)({...es,merkle:eu})])}});if(ff("enabled")){es.merkle=eu}if(Object.keys(en).length>0){uT(en,{avoidSync:true});if(en.budgetType){lH(en.budgetType)}aZ("prefs-updated")}let el=await et();if(uF()){uG();lB(ei,el);uF().triggerDatabaseChanges(ei,el);uY();uF().endCacheBarrier()}fm.forEach($=>$(ei,el));let ef=fM($.filter($=>!$.old));l0.events.emit("sync",{type:"applied",tables:ef,data:el,prevData:ei});return $});function fS($){$.forEach($=>{eo.Timestamp.recv($.timestamp)});return aV(()=>fE($))}async function fT($){try{await fE($)}catch($){if($ instanceof l$){if($.reason==="invalid-schema"){l0.events.emit("sync",{type:"error",subtype:"apply-failure",meta:$.meta})}else{l0.events.emit("sync",{type:"error",meta:$.meta})}}throw $}await fk()}let fO=false;let fA=[];async function fI($){if(fO){await $();return}fO=true;let ee=[];try{await $()}finally{fO=false;ee=fA;fA=[]}if(ee.length>0){await fT(ee)}}async function fN($){if(fO){fA=fA.concat($)}else{return fT($)}}function fD($){return fK("SELECT timestamp, dataset, row, column, value FROM messages_crdt WHERE timestamp > ?",[$],true)}function fR(){if(fC){clearTimeout(fC);fC=null}}let fC=null;function fk(){fR();if(ff("enabled")&&!ff("offline")){if(false){}else{fC=setTimeout(fx,fo)}}}function fM($){return $.reduce(($,ee)=>{let et=ee.dataset==="schedules_next_date"?"schedules":ee.dataset;if(!$.includes(et)){$.push(et)}return $},[])}async function fL(){let $=await fx();if(cG($)){await uK();return $}return{}}const fx=aR(async function(){l0.events.emit("sync",{type:"start"});let $;try{$=await fP(null,0,null)}catch($){console.log($);if($ instanceof l$){if($.reason==="out-of-sync"){aI($);l0.events.emit("sync",{type:"error",subtype:"out-of-sync",meta:$.meta})}else if($.reason==="invalid-schema"){l0.events.emit("sync",{type:"error",subtype:"invalid-schema",meta:$.meta})}else if($.reason==="decrypt-failure"||$.reason==="encrypt-failure"){l0.events.emit("sync",{type:"error",subtype:$.reason,meta:$.meta})}else{l0.events.emit("sync",{type:"error",meta:$.meta})}}else if($ instanceof lz){console.log($);if($.reason==="unauthorized"){l0.events.emit("sync",{type:"unauthorized"});rQ("readOnly","true")}else if($.reason==="network-failure"){l0.events.emit("sync",{type:"error",subtype:"network"})}else{l0.events.emit("sync",{type:"error",subtype:$.reason})}}else{aI($);l0.events.emit("sync",{type:"error"})}return{error:{message:$.message,reason:$.reason,meta:$.meta}}}let ee=fM($);l0.events.emit("sync",{type:"success",tables:ee,syncDisabled:ff("disabled")});return{messages:$}});async function fP($,ee,et){let{cloudFileId:en,groupId:ei,lastSyncedTimestamp:es}=uA()||{};fR();if(ff("disabled")||ff("offline")){return[]}let eu=(0,eo.getClock)().timestamp.toString();let el=$||es||new eo.Timestamp(Date.now()-5*60*1e3,0,"0").toString();let ef=fD(el);let ed=await rX("user-token");ug.info("Syncing since",el,ef.length,"(attempt: "+ee+")");let ep=await cz(ei,en,el,ef);let eh=await l3(ce().SYNC_SERVER+"/sync",ep,{"X-ACTUAL-TOKEN":ed});if(!uA()||uA().groupId!==ei){return[]}let ey=await cV(eh);ug.info("Got messages from server",ey.messages.length);let eg=(0,eo.getClock)().timestamp.toString()!==eu;let em=[];if(ey.messages.length>0){em=await fS(ey.messages.map($=>({...$,value:fg($.value)})))}let e_=eo.merkle.diff(ey.merkle,(0,eo.getClock)().merkle);if(e_!==null){if(ee>=10&&e_===et||ee>=100){ug.info("SENT -------");ug.info(JSON.stringify(ef));ug.info("RECEIVED -------");ug.info(JSON.stringify(ey.messages));let $=c$();console.log(ee,"messages:",ef.length,ef.length>0?ef[0]:null,"res.messages:",ey.messages.length,ey.messages.length>0?ey.messages[0]:null,"clientId",(0,eo.getClock)().timestamp.node(),"groupId",ei,"diffTime:",e_,e_===et,"local clock:",(0,eo.getClock)().timestamp.toString(),(0,eo.getClock)().merkle.hash,"rebuilt hash:",$.numMessages,$.trie.hash,"server hash:",ey.merkle.hash,"localTimeChanged:",eg);if($.trie.hash===ey.merkle.hash){let $=await f2("SELECT * FROM messages_clock");if($.length!==1){console.log("Bad number of clocks:",$.length)}let ee=(0,eo.deserializeClock)($[0]).merkle.hash;console.log("Merkle hash in db:",ee)}throw new l$("out-of-sync")}em=em.concat(await fP(new eo.Timestamp(e_,0,"0").toString(),eg?0:ee+1,e_))}else{await uT({lastSyncedTimestamp:(0,eo.getClock)().timestamp.toString()})}return em};const fF=16384;function fB($,ee){const et=$[ee-1];const en=$[ee];if(!et){return en.sort_order/2}else if(!en){return et.sort_order+fF}else{return(et.sort_order+en.sort_order)/2}}function fU($,ee){const et=$.findIndex($=>$.id===ee);const en=$[et];const ei=$[et-1];let eo=[];if(!ee||et===-1){let ee;if($.length>0){ee=$[$.length-1].sort_order+fF}else{ee=fF}return{updates:eo,sort_order:ee}}else{if(en.sort_order-(ei?ei.sort_order:0)<=2){let ee=et;let en=Math.floor($[ee].sort_order)+fF;while(ee<$.length){if(en<=$[ee].sort_order){break}eo.push({id:$[ee].id,sort_order:en});ee++;en+=fF}}return{updates:eo,sort_order:fB($,et)}}};let fj;let fW;function fH(){return fj}async function fz($){if(fW){await ot(fW)}fj=ou(od($),"db.sqlite");fq(await oe(fj))}async function fV(){await ot(fW);fq(await oe(fj))}async function f$(){if(fW){await ot(fW);fq(null)}}function fq($){fW=$;fQ()}function fG(){return fW}async function fY(){let $=await f6("SELECT * FROM messages_clock");if($){let ee=(0,eo.deserializeClock)($.clock);(0,eo.setClock)(ee)}else{let $=new eo.Timestamp(0,0,(0,eo.makeClientId)());let ee=(0,eo.makeClock)($);(0,eo.setClock)(ee);await fK("INSERT INTO messages_clock (id, clock) VALUES (?, ?)",[1,(0,eo.serializeClock)(ee)])}}function fK($,ee,et){const en=a3(fW,$,ee,et);return en}function fZ($){a8(fW,$)}let fJ=new(i4())({max:100});function fX($){let ee=fJ.get($);if(ee){return ee}let et=a4(fW,$);fJ.set($,et);return et}function fQ(){fJ=new(i4())({max:100})}function f0($){return a9(fW,$)}function f1($){return a7(fW,$)}async function f2($,ee){return fK($,ee,true)}async function f6($,ee){const et=await fK($,ee,true);return et.length===0?null:et[0]}function f4($,ee){const et=fK($,ee,true);return et.length===0?null:et[0]}async function f3($,ee){return fK($,ee)}async function f8($,ee){const et=await fK("SELECT * FROM "+$+" WHERE id = ?",[ee],true);return et[0]}async function f5($,ee){let et=Object.keys(ee).filter($=>$!=="id");if(ee.id==null){throw new Error("update: id is required")}await fN(et.map(et=>{return{dataset:$,row:ee.id,column:et,value:ee[et],timestamp:eo.Timestamp.send()}}))}async function f9($,ee){if(!ee.id){ee={...ee,id:e_()}}await f7($,ee);return ee.id}async function f7($,ee){let et=Object.keys(ee).filter($=>$!=="id");if(ee.id==null){throw new Error("insert: id is required")}await fN(et.map(et=>{return{dataset:$,row:ee.id,column:et,value:ee[et],timestamp:eo.Timestamp.send()}}))}async function de($,ee){await fN([{dataset:$,row:ee,column:"tombstone",value:1,timestamp:eo.Timestamp.send()}])}async function dr($,ee,et){let en=await fK(ee,et,true);return en.map(ee=>o8(sY,sK,$,ee)).filter(Boolean)}async function dn($,ee,et){let en=await dr($,ee,et);return en.length>0?en[0]:null}function di($,ee){if(!ee.id){ee={...ee,id:e_()}}return f9($,o4(sY,sK,$,ee))}function ds($,ee){return f5($,o3(sY,sK,$,ee))}async function du(){return f2(`
151
+ SELECT c.* FROM categories c
152
+ LEFT JOIN category_groups cg ON c.cat_group = cg.id
153
+ WHERE c.tombstone = 0
154
+ ORDER BY cg.sort_order, cg.id, c.sort_order, c.id
155
+ `)}async function dl(){const $=await f2("SELECT * FROM category_groups WHERE tombstone = 0 ORDER BY is_income, sort_order, id");const ee=await f2(`
156
+ SELECT * FROM categories WHERE tombstone = 0
157
+ ORDER BY sort_order, id
158
+ `);return $.map($=>{return{...$,categories:ee.filter(ee=>ee.cat_group===$.id)}})}async function df($){const ee=await f6(`
159
+ SELECT sort_order FROM category_groups WHERE tombstone = 0 ORDER BY sort_order DESC, id DESC LIMIT 1
160
+ `);const et=(ee?ee.sort_order:0)+fF;$={...oJ.validate($),sort_order:et};return f9("category_groups",$)}function dp($){$=oJ.validate($,{update:true});return f5("category_groups",$)}async function dh($,ee){const et=await f2(`SELECT id, sort_order FROM category_groups WHERE tombstone = 0 ORDER BY sort_order, id`);const{updates:en,sort_order:ei}=fU(et,ee);for(let $ of en){await f5("category_groups",$)}await f5("category_groups",{id:$,sort_order:ei})}async function dy($,ee){const et=await f2("SELECT * FROM categories WHERE cat_group = ?",[$.id]);await Promise.all(et.map($=>dv($,ee)));await de("category_groups",$.id)}async function dg($,{atEnd:ee}={atEnd:undefined}){let et;let en;await fI(async()=>{if(ee){const $=await f6(`
161
+ SELECT sort_order FROM categories WHERE tombstone = 0 ORDER BY sort_order DESC, id DESC LIMIT 1
162
+ `);et=($?$.sort_order:0)+fF}else{const ee=await f2(`SELECT id, sort_order FROM categories WHERE cat_group = ? AND tombstone = 0 ORDER BY sort_order, id`,[$.cat_group]);const{updates:en,sort_order:ei}=fU(ee,ee.length>0?ee[0].id:null);for(let $ of en){await f5("categories",$)}et=ei}$={...oZ.validate($),sort_order:et};const ei=await f9("categories",$);await f7("category_mapping",{id:ei,transferId:ei});en=ei});return en}function dm($){$=oZ.validate($,{update:true});return f5("categories",$)}async function d_($,ee,et){if(!ee){throw new Error("moveCategory: groupId is required")}const en=await f2(`SELECT id, sort_order FROM categories WHERE cat_group = ? AND tombstone = 0 ORDER BY sort_order, id`,[ee]);const{updates:ei,sort_order:eo}=fU(en,et);for(let $ of ei){await f5("categories",$)}await f5("categories",{id:$,sort_order:eo,cat_group:ee})}async function dv($,ee){if(ee){const et=await f2("SELECT * FROM category_mapping WHERE transferId = ?",[$.id]);for(let $ of et){await f5("category_mapping",{id:$.id,transferId:ee})}await f5("category_mapping",{id:$.id,transferId:ee})}return de("categories",$.id)}async function dw($){return f6(`SELECT * FROM payees WHERE id = ?`,[$])}async function dE($){$=oX.validate($);let ee;await fI(async()=>{ee=await f9("payees",$);await f7("payee_mapping",{id:ee,targetId:ee})});return ee}async function dS($){let{transfer_acct:ee}=await f6("SELECT * FROM payees WHERE id = ?",[$.id]);if(ee){return}return de("payees",$.id)}async function dT($){return de("payees",$.id)}function dO($){$=oX.validate($,{update:true});return f5("payees",$)}async function dA($,ee){let et=ih(await f2("SELECT * FROM payees"));if(et[$].transfer_acct!=null){return}ee=ee.filter($=>et[$].transfer_acct==null);await fI(async()=>{await Promise.all(ee.map(async ee=>{let et=await f2("SELECT id FROM payee_mapping WHERE targetId = ?",[ee]);await Promise.all(et.map(ee=>f5("payee_mapping",{id:ee.id,targetId:$})))}));await Promise.all(ee.map(ee=>Promise.all([f5("payee_mapping",{id:ee,targetId:$}),de("payees",ee)])))})}function dI(){return f2(`
163
+ SELECT p.*, COALESCE(a.name, p.name) AS name FROM payees p
164
+ LEFT JOIN accounts a ON (p.transfer_acct = a.id AND a.tombstone = 0)
165
+ WHERE p.tombstone = 0 AND (p.transfer_acct IS NULL OR a.id IS NOT NULL)
166
+ ORDER BY p.transfer_acct IS NULL DESC, p.name COLLATE NOCASE
167
+ `)}function dN(){return f2(`
168
+ SELECT p.id FROM payees p
169
+ LEFT JOIN payee_mapping pm ON pm.id = p.id
170
+ LEFT JOIN v_transactions_internal_alive t ON t.payee = pm.targetId
171
+ WHERE p.tombstone = 0 AND p.transfer_acct IS NULL AND t.id IS NULL
172
+ `)}async function dD(){let $=await f2(`
173
+ SELECT p.id FROM payees p
174
+ LEFT JOIN payee_mapping pm ON pm.id = p.id
175
+ LEFT JOIN v_transactions_internal_alive t ON t.payee = pm.targetId
176
+ WHERE p.tombstone = 0 AND p.transfer_acct IS NULL AND t.id IS NULL
177
+ `);return $.map($=>$.id)}async function dR($){return f6(`SELECT * FROM payees WHERE UNICODE_LOWER(name) = ? AND tombstone = 0`,[$.toLowerCase()])}function dC(){return f2(`SELECT a.*, b.name as bankName, b.id as bankId FROM accounts a
178
+ LEFT JOIN banks b ON a.bank = b.id
179
+ WHERE a.tombstone = 0
180
+ ORDER BY sort_order, name`)}async function dk($){const ee=await f2("SELECT * FROM accounts WHERE offbudget = ? ORDER BY sort_order, name",[$.offbudget!=null?$.offbudget:0]);let{sort_order:et}=fU(ee);$=oK.validate({...$,sort_order:et});return f9("accounts",$)}function dM($){$=oK.validate($,{update:true});return f5("accounts",$)}function dL($){return de("accounts",$.id)}async function dx($,ee){let et=await f6("SELECT * FROM accounts WHERE id = ?",[$]);let en;if(et.closed){en=await f2(`SELECT id, sort_order FROM accounts WHERE closed = 1 ORDER BY sort_order, name`)}else{en=await f2(`SELECT id, sort_order FROM accounts WHERE tombstone = 0 AND offbudget = ? ORDER BY sort_order, name`,[et.offbudget])}const{updates:ei,sort_order:eo}=fU(en,ee);await fI(async()=>{for(let $ of ei){f5("accounts",$)}f5("accounts",{id:$,sort_order:eo})})}async function dP($){let ee=await dr("transactions","SELECT * FROM v_transactions WHERE id = ?",[$]);return ee[0]}async function dF($,ee,et,en={}){throw new Error("`getTransactionsByDate` is deprecated")}async function dB($){if(arguments.length>1){throw new Error("`getTransactions` was given a second argument, it now only takes a single argument `accountId`")}return dr("transactions","SELECT * FROM v_transactions WHERE account = ?",[$])}function dU($){return di("transactions",$)}function dj($){return ds("transactions",$)}async function dW($){return de("transactions",$.id)};async function dH($){let ee=await f6(`SELECT id FROM payees WHERE UNICODE_LOWER(name) = ? AND tombstone = 0`,[$.toLowerCase()]);if(ee){return ee.id}else{return dE({name:$})}}async function dz(){let $=await f6(`
181
+ SELECT * FROM categories
182
+ WHERE is_income = 1 AND
183
+ LOWER(name) = 'starting balances' AND
184
+ tombstone = 0
185
+ `);if($===null){$=await f6("SELECT * FROM categories WHERE is_income = 1 AND tombstone = 0")}let ee=await dH("Starting Balance");return{id:ee,category:$?$.id:null}};const dV=["for","and","nor","but","or","yet","so"];const d$=["a","an","the"];const dq=["aboard","about","above","across","after","against","along","amid","among","anti","around","as","at","before","behind","below","beneath","beside","besides","between","beyond","but","by","concerning","considering","despite","down","during","except","excepting","excluding","following","for","from","in","inside","into","like","minus","near","of","off","on","onto","opposite","over","past","per","plus","regarding","round","save","since","than","through","to","toward","towards","under","underneath","unlike","until","up","upon","versus","via","with","within","without"];const dG=new Set([...dV,...d$,...dq]);const dY=dG;const dK=["CLI","API","HTTP","HTTPS","JSX","DNS","URL","CI","CDN","GitHub","CSS","JS","JavaScript","TypeScript","HTML","WordPress","JavaScript","Next.js","Node.js"];const dZ=dK;let dJ="[0-9A-Za-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶ-ͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԣԱ-Ֆՙա-ևא-תװ-ײء-يٮ-ٯٱ-ۓەۥ-ۦۮ-ۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴ-ߵߺऄ-हऽॐक़-ॡॱ-ॲॻ-ॿঅ-ঌএ-ঐও-নপ-রলশ-হঽৎড়-ঢ়য়-ৡৰ-ৱਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલ-ળવ-હઽૐૠ-ૡଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହଽଡ଼-ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘ-ౙౠ-ౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠ-ೡഅ-ഌഎ-ഐഒ-നപ-ഹഽൠ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะา-ำเ-ๆກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ະາ-ຳຽເ-ໄໆໜ-ໝༀཀ-ཇཉ-ཬྈ-ྋက-ဪဿၐ-ၕၚ-ၝၡၥ-ၦၮ-ၰၵ-ႁႎႠ-Ⴥა-ჺჼᄀ-ᅙᅟ-ᆢᆨ-ᇹሀ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙶᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦩᧁ-ᧇᨀ-ᨖᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮ-ᮯᰀ-ᰣᱍ-ᱏᱚ-ᱽᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₔℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-Ɐⱱ-ⱽⲀ-ⳤⴀ-ⴥⴰ-ⵥⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆷㇰ-ㇿ㐀䶵一鿃ꀀ-ꒌꔀ-ꘌꘐ-ꘟꘪ-ꘫꙀ-ꙟꙢ-ꙮꙿ-ꚗꜗ-ꜟꜢ-ꞈꞋ-ꞌꟻ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꤊ-ꤥꤰ-ꥆꨀ-ꨨꩀ-ꩂꩄ-ꩋ가힣豈-鶴侮-頻並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]";let dX=new RegExp(`(?:(?:(\\s?(?:^|[.\\(\\)!?;:"-])\\s*)(${dJ}))|(${dJ}))(${dJ}*[’']*${dJ}*)`,"g");let dQ=$=>$.map($=>[new RegExp(`\\b${$}\\b`,"gi"),$]);function d0($){const ee=$[0];if(/\s/.test(ee)){return $.substr(1)}if(/[()]/.test(ee)){return null}return $}function d1($,ee={special:undefined}){$=$.toLowerCase().replace(dX,($,ee="",et,en,ei)=>{const eo=d0($);if(!eo){return $}if(!et){const $=en+ei;if(dY.has($)){return eo}}return ee+(en||et).toUpperCase()+ei});const et=ee.special||[];const en=[...dZ,...et];const ei=dQ(en);ei.forEach(([ee,et])=>{$=$.replace(ee,et)});return $};const d2={date:{ops:["is","isapprox","gt","gte","lt","lte"],nullable:false},id:{ops:["is","contains","oneOf","isNot","doesNotContain","notOneOf"],nullable:true},saved:{ops:[],nullable:false},string:{ops:["is","contains","oneOf","isNot","doesNotContain","notOneOf"],nullable:true},number:{ops:["is","isapprox","isbetween","gt","gte","lt","lte"],nullable:false},boolean:{ops:["is"],nullable:false}};const d6=new Map(Object.entries({imported_payee:"string",payee:"id",date:"date",notes:"string",amount:"number",amountInflow:"number",amountOutfow:"number",category:"id",account:"id",cleared:"boolean",saved:"saved"}));function d4($,ee){ee=ee||{};switch($){case"imported_payee":return"imported payee";case"amount":if(ee.inflow){return"amount (inflow)"}else if(ee.outflow){return"amount (outflow)"}return"amount";case"amount-inflow":return"amount (inflow)";case"amount-outflow":return"amount (outflow)";default:return $}}function d3($,ee){switch($){case"oneOf":return"one of";case"notOneOf":return"not one of";case"is":return"is";case"isNot":return"is not";case"isapprox":return"is approx";case"isbetween":return"is between";case"contains":return"contains";case"doesNotContain":return"does not contain";case"gt":if(ee==="date"){return"is after"}return"is greater than";case"gte":if(ee==="date"){return"is after or equals"}return"is greater than or equals";case"lt":if(ee==="date"){return"is before"}return"is less than";case"lte":if(ee==="date"){return"is before or equals"}return"is less than or equals";case"true":return"is true";case"false":return"is false";case"set":return"set";case"link-schedule":return"link schedule";case"and":return"and";case"or":return"or";default:return""}}function d8($){if($==="amount-inflow"){return{field:"amount",options:{inflow:true}}}else if($==="amount-outflow"){return{field:"amount",options:{outflow:true}}}else{return{field:$}}}function d5($){switch($){case"date-format":return"Invalid date format";case"no-null":case"no-empty-array":case"no-empty-string":return"Value cannot be empty";case"not-number":return"Value must be a number";case"invalid-field":return"Please choose a valid field for this type of rule";default:return"Internal error, sorry! Please get in touch https://actualbudget.org/contact/ for support"}}function d9($,ee){if($<ee){return[$,ee]}return[ee,$]}function d7($){switch($.type){case"number":{let ee=$.value;if($.field==="amount"&&$.op!=="isbetween"&&ee!=null){ee=integerToAmount(ee)}return{...$,value:ee}}case"string":{let ee=$.value==null?"":$.value;return{...$,value:ee}}case"boolean":{let ee=$.value;return{...$,value:ee}}default:}return{...$,error:null}}function pt({error:$,inputKey:ee,...et}){switch(et.type){case"number":{let $=et.value;if(et.field==="amount"&&et.op!=="isbetween"){$=amountToInteger($)}return{...et,value:$}}case"string":{let $=et.value==null?"":et.value;return{...et,value:$}}case"boolean":{let $=et.value==null?false:et.value;return{...et,value:$}}default:}return et}function pr($,ee){switch(ee.type){case"number":{if(ee.op!=="isbetween"){return{...ee,error:null,value:$?currencyToAmount(String($))||0:0}}break}default:}return{...ee,error:null,value:$}}function pn($){return Math.round(Math.abs($)*.075)};let pi;let po;async function ps(){let $=(await f2("SELECT * FROM category_mapping")).map($=>[$.id,$.transferId]);let ee=(await f2("SELECT * FROM payee_mapping")).map($=>[$.id,$.targetId]);pi=new Map($.concat(ee));if(po){po()}po=f_(pu)}function pu($,ee){ee.forEach(($,ee)=>{if(ee.indexOf("mapping")!==-1){let et=ee==="category_mapping"?"transferId":"targetId";$.forEach($=>{pi.set($.id,$[et])})}})}function pl(){return pi}function pc($){return pi.get($)||null};function pf($,ee,et){let en=nR();if(ee){return"completed"}else if(et){return"paid"}else if($===en){return"due"}else if($>en&&$<=nF(en,7)){return"upcoming"}else if($<en){return"missed"}else{return"scheduled"}}function pd($){let ee=$.map($=>{let ee=$._conditions.find($=>$.field==="date");return{$and:{schedule:$.id,date:{$gte:ee&&ee.op==="is"?$.next_date:nB($.next_date,2)}}}});return sX("transactions").filter({$or:ee}).orderBy({date:"desc"}).groupBy("schedule").select(["schedule","date"])}function pp($){return monthUtils.format(new Date(2020,0,$,12),"do")}function ph($){let ee={SU:"Sunday",MO:"Monday",TU:"Tuesday",WE:"Wednesday",TH:"Thursday",FR:"Friday",SA:"Saturday"};return ee[$]}function py($){let ee=$.interval||1;switch($.frequency){case"daily":{let $="Every ";$+=ee!==1?`${ee} days`:"day";return $}case"weekly":{let et="Every ";et+=ee!==1?`${ee} weeks`:"week";et+=" on "+monthUtils.format($.start,"EEEE");return et}case"monthly":{let et="Every ";et+=ee!==1?`${ee} months`:"month";if($.patterns&&$.patterns.length>0){let ee=[...$.patterns].sort(($,ee)=>{let et=($.type==="day"?1:0)-(ee.type==="day"?1:0);let en=$.value-ee.value;if(et===0){return en}return et}).filter($=>$.value!==-1);ee=ee.concat($.patterns.filter($=>$.value===-1));et+=" on the ";let en=[];let ei=new Set(ee.map($=>$.type));let eo=ei.size===1&&!ei.has("day");for(let $ of ee){if($.type==="day"){if($.value===-1){en.push("last day")}else{en.push(pp($.value))}}else{let ee=eo?"":" "+ph($.type);if($.value===-1){en.push("last"+ee)}else{en.push(pp($.value)+ee)}}}if(en.length>2){et+=en.slice(0,en.length-1).join(", ");et+=", and ";et+=en[en.length-1]}else{et+=en.join(" and ")}if(eo){et+=" "+ph(ee[0].type)}}else{et+=" on the "+monthUtils.format($.start,"do")}return et}case"yearly":{let et="Every ";et+=ee!==1?`${ee} years`:"year";et+=" on "+monthUtils.format($.start,"LLL do");return et}default:return"Recurring error"}}function pg($){let ee={start:nT($.start),frequency:$.frequency.toUpperCase(),byHourOfDay:[12]};if($.interval){ee.interval=$.interval}let et=$=>$.slice(0,2).toUpperCase();switch($.frequency){case"daily":return[ee];case"weekly":return[ee];case"monthly":if($.patterns&&$.patterns.length>0){let en=$.patterns.filter($=>$.type==="day");let ei=$.patterns.filter($=>$.type!=="day");return[en.length>0&&{...ee,byDayOfMonth:en.map($=>$.value)},ei.length>0&&{...ee,byDayOfWeek:ei.map($=>[et($.type),$.value])}].filter(Boolean)}else{return[ee]}case"yearly":return[ee];default:throw new Error("Invalid recurring date config")}}function pm($){return{payee:$.find($=>$.op==="is"&&$.field==="payee")||$.find($=>$.op==="is"&&$.field==="description")||null,account:$.find($=>$.op==="is"&&$.field==="account")||$.find($=>$.op==="is"&&$.field==="acct")||null,amount:$.find($=>($.op==="is"||$.op==="isapprox"||$.op==="isbetween")&&$.field==="amount")||null,date:$.find($=>($.op==="is"||$.op==="isapprox")&&$.field==="date")||null}}function p_($){if($&&typeof $!=="number"){return Math.round(($.num1+$.num2)/2)}return $}function pv($,ee){if(ee){return`${ee.name} (${$.next_date})`}else{return`Next: ${$.next_date}`}};class pE extends Error{}let pS;class pT{constructor($,ee){this.metadata={};this.duration=ee&&ee.duration||0;this.generators=ee&&ee.generators&&ee.generators.slice()||[];if(!Number.isInteger(this.duration)||this.duration<0){throw new pE("duration must be a non-negative integer")}}static set adapter($){if(pS){throw new Error(`"${pS.name}" has already been configured.`)}pS=$}static get adapter(){if(!pS){throw new Error("No date adapter has been configured. See rSchedule docs.")}return pS}static isDate($){throw pO("isDate()")}static fromDate($,ee){throw pO("fromDate()")}static fromJSON($){throw pO("fromJSON()")}static fromDateTime($){throw pO("fromDateTime()")}toISOString(){return this.set("timezone","UTC").toDateTime().toISOString()}toDateTime(){const $=pN.fromJSON(Object.assign(Object.assign({},this.toJSON()),{generators:this.generators,metadata:this.metadata}));return $}}pT.hasTimezoneSupport=false;function pO($){return new Error(`You must implement the "${$}" method for this DateAdapter class`)}var pA;(function($){$.WEEKDAYS=["SU","MO","TU","WE","TH","FR","SA"];$.MILLISECONDS_IN_SECOND=1e3;$.MILLISECONDS_IN_MINUTE=$.MILLISECONDS_IN_SECOND*60;$.MILLISECONDS_IN_HOUR=$.MILLISECONDS_IN_MINUTE*60;$.MILLISECONDS_IN_DAY=$.MILLISECONDS_IN_HOUR*24;$.MILLISECONDS_IN_WEEK=$.MILLISECONDS_IN_DAY*7})(pA||(pA={}));class pI extends Error{}class pN{constructor($,ee,et,en,ei={}){this.metadata={};this.date=new Date($);this.timezone=ee||null;this.duration=et||0;this.generators=en&&en.slice()||[];if(!Number.isInteger(this.duration)||this.duration<0){throw new pI("duration must be a non-negative integer")}if(ei.metadata){Object.assign(this.metadata,ei.metadata)}this.assertIsValid()}static fromJSON($){const ee=new Date(Date.UTC($.year,$.month-1,$.day,$.hour,$.minute,$.second,$.millisecond));return new pN(ee,$.timezone,$.duration,$.generators,{metadata:$.metadata})}static fromDateAdapter($){return pN.fromJSON(Object.assign(Object.assign({},$.toJSON()),{generators:$.generators,metadata:$.metadata}))}get end(){if(!this.duration)return;if(this._end)return this._end;this._end=this.add(this.duration,"millisecond");return this._end}isEqual($){if(!$){return false}pD(this,$);return this.valueOf()===$.valueOf()}isBefore($){pD(this,$);return this.valueOf()<$.valueOf()}isBeforeOrEqual($){pD(this,$);return this.valueOf()<=$.valueOf()}isAfter($){pD(this,$);return this.valueOf()>$.valueOf()}isAfterOrEqual($){pD(this,$);return this.valueOf()>=$.valueOf()}isOccurring($){if(!this.duration){throw new Error("DateTime#isOccurring() is only applicable to DateTimes with durations")}pD(this,$);return $.isAfterOrEqual(this)&&$.isBeforeOrEqual(this.add(this.duration,"millisecond"))}add($,ee){switch(ee){case"generator":{const ee=this.generators.slice();ee.unshift($);return new pN(this.date,this.timezone,this.duration,ee)}case"year":return this.forkDateTime(pV(this.date,$));case"month":return this.forkDateTime(p$(this.date,$));case"week":return this.forkDateTime(pq(this.date,$));case"day":return this.forkDateTime(pG(this.date,$));case"hour":return this.forkDateTime(pY(this.date,$));case"minute":return this.forkDateTime(pK(this.date,$));case"second":return this.forkDateTime(pZ(this.date,$));case"millisecond":return this.forkDateTime(pJ(this.date,$));default:throw new Error("Invalid unit provided to `DateTime#add`")}}subtract($,ee){switch(ee){case"year":return this.forkDateTime(pX(this.date,$));case"month":return this.forkDateTime(pQ(this.date,$));case"week":return this.forkDateTime(p0(this.date,$));case"day":return this.forkDateTime(p6(this.date,$));case"hour":return this.forkDateTime(p4(this.date,$));case"minute":return this.forkDateTime(p3(this.date,$));case"second":return this.forkDateTime(p8(this.date,$));case"millisecond":return this.forkDateTime(p5(this.date,$));default:throw new Error("Invalid unit provided to `DateTime#subtract`")}}get($){switch($){case"year":return this.date.getUTCFullYear();case"month":return this.date.getUTCMonth()+1;case"yearday":return pW(this.date);case"weekday":return pA.WEEKDAYS[this.date.getUTCDay()];case"day":return this.date.getUTCDate();case"hour":return this.date.getUTCHours();case"minute":return this.date.getUTCMinutes();case"second":return this.date.getUTCSeconds();case"millisecond":return this.date.getUTCMilliseconds();default:throw new Error("Invalid unit provided to `DateTime#set`")}}set($,ee){if($==="duration"){return new pN(this.date,this.timezone,ee,this.generators)}if($==="generators"){return new pN(this.date,this.timezone,this.duration,ee)}let et=new Date(this.date);switch($){case"year":et.setUTCFullYear(ee);break;case"month":{const $=pF(ee,et.getUTCFullYear());const en=et.getUTCDate();if(en>$){et.setUTCDate(1);et.setUTCMonth(ee);et=p6(et,1)}else{et.setUTCMonth(ee-1)}break}case"day":et.setUTCDate(ee);break;case"hour":et.setUTCHours(ee);break;case"minute":et.setUTCMinutes(ee);break;case"second":et.setUTCSeconds(ee);break;case"millisecond":et.setUTCMilliseconds(ee);break;default:throw new Error("Invalid unit provided to `DateTime#set`")}return this.forkDateTime(et)}granularity($,ee={}){let et=this.forkDateTime(this.date);switch($){case"year":et=et.set("month",1);case"month":et=et.set("day",1);break;case"week":et=pR(et,ee.weekStart)}switch($){case"year":case"month":case"week":case"day":et=et.set("hour",0);case"hour":et=et.set("minute",0);case"minute":et=et.set("second",0);case"second":et=et.set("millisecond",0);case"millisecond":return et;default:throw new Error("Invalid granularity provided to `DateTime#granularity`: "+$)}}endGranularity($,ee={}){let et=this.forkDateTime(this.date);switch($){case"year":et=et.set("month",12);case"month":et=et.set("day",pF(et.get("month"),et.get("year")));break;case"week":et=pC(et,ee.weekStart)}switch($){case"year":case"month":case"week":case"day":et=et.set("hour",23);case"hour":et=et.set("minute",59);case"minute":et=et.set("second",59);case"second":et=et.set("millisecond",999);case"millisecond":return et;default:throw new Error("Invalid granularity provided to `DateTime#granularity`: "+$)}}toISOString(){return this.date.toISOString()}toDateTime(){return this}toJSON(){const $={timezone:this.timezone,year:this.get("year"),month:this.get("month"),day:this.get("day"),hour:this.get("hour"),minute:this.get("minute"),second:this.get("second"),millisecond:this.get("millisecond")};if(this.duration){$.duration=this.duration}return $}valueOf(){return this.date.valueOf()}assertIsValid(){if(isNaN(this.valueOf())){throw new pI("DateTime has invalid date.")}return true}forkDateTime($){return new pN($,this.timezone,this.duration,this.generators)}}function pD($,ee){if($.timezone!==ee.timezone){throw new pI("Attempted to compare a datetime to another date in a different timezone: "+JSON.stringify($)+" and "+JSON.stringify(ee))}return true}function pR($,ee){const et=pL(ee).indexOf($.get("weekday"));return $.subtract(et,"day")}function pC($,ee){const et=pL(ee).indexOf($.get("weekday"));return $.add(6-et,"day")}function pk($,ee){if($.isAfter(ee))return 1;if($.isBefore(ee))return-1;if($.duration&&ee.duration){if($.duration>ee.duration)return 1;if($.duration<ee.duration)return-1}return 0}function pM($){return Array.from(new Map($.map($=>[$.toISOString(),$])).values())}function pL($="SU"){const ee=pA.WEEKDAYS.slice();let et=ee.indexOf($);while(et!==0){px(ee);et--}return ee}function px($,ee="first"){if($.length===0){return $}else if(ee==="first"){$.push($.shift())}else{$.unshift($.pop())}return $}function pP($,ee){if($===ee)return 0;const et=pA.WEEKDAYS.indexOf($)-pA.WEEKDAYS.indexOf(ee);return et>0?7-et:Math.abs(et)}function pF($,ee){const et={1:31,2:pB(ee),3:31,4:30,5:31,6:30,7:31,8:31,9:30,10:31,11:30,12:31};return et[$]}function pB($){return pU($)?29:28}function pU($){return $%400===0||$%4===0&&$%100!==0}function pj($){return pU($)?366:365}function pW($){const ee=new Date(Date.UTC($.getUTCFullYear(),0,1));const et=$.valueOf()-ee.valueOf();return 1+Math.floor(et/pA.MILLISECONDS_IN_DAY)}function pH($){if($===null||$===true||$===false){return NaN}const ee=Number($);if(isNaN(ee)){return ee}return ee<0?Math.ceil(ee):Math.floor(ee)}function pz($,ee){if(arguments.length<2){throw new TypeError("2 arguments required, but only "+arguments.length+" present")}const et=$.valueOf();const en=pH(ee);return new Date(et+en)}function pV($,ee){const et=pH(ee);return p$($,et*12)}function p$($,ee){const et=pH(ee);$=new Date($);const en=$.getUTCMonth()+et;const ei=new Date(0);ei.setUTCFullYear($.getUTCFullYear(),en,1);ei.setUTCHours(0,0,0,0);const eo=pF(ei.getUTCMonth()+1,ei.getUTCFullYear());$.setUTCMonth(en,Math.min(eo,$.getUTCDate()));return $}function pq($,ee){const et=pH(ee);const en=et*7;return pG($,en)}function pG($,ee){return pJ($,pH(ee)*pA.MILLISECONDS_IN_DAY)}function pY($,ee){const et=pH(ee);return pz($,et*pA.MILLISECONDS_IN_HOUR)}function pK($,ee){const et=pH(ee);return pz($,et*pA.MILLISECONDS_IN_MINUTE)}function pZ($,ee){const et=pH(ee);return pz($,et*pA.MILLISECONDS_IN_SECOND)}function pJ($,ee){const et=pH(ee);const en=$.getTime();return new Date(en+et)}function pX($,ee){return pV($,-ee)}function pQ($,ee){return p$($,-ee)}function p0($,ee){return pq($,-ee)}function p6($,ee){return pG($,-ee)}function p4($,ee){return pY($,-ee)}function p3($,ee){return pK($,-ee)}function p8($,ee){return pZ($,-ee)}function p5($,ee){return pJ($,-ee)}class p9 extends Error{}class p7 extends Error{}function he($,ee){if($>ee){return 1}else if(ee>$){return-1}else{return 0}}function ht($){switch($){case"YEARLY":return"year";case"MONTHLY":return"month";case"WEEKLY":return"week";case"DAILY":return"day";case"HOURLY":return"hour";case"MINUTELY":return"minute";case"SECONDLY":return"second";case"MILLISECONDLY":return"millisecond";default:throw new Error("unknown freq passed to freqToGranularity()")}}function hr($){return JSON.parse(JSON.stringify($))}function hn($){return $ instanceof pN?pT.adapter.fromDateTime($):$ instanceof pT?$:pT.adapter.fromDate($)}function ho($,ee){if($ instanceof pN){if($.timezone!==ee){return pT.adapter.fromDateTime($).set("timezone",ee).toDateTime()}return $}return $ instanceof pT?$.set("timezone",ee).toDateTime():pT.adapter.fromDate($).set("timezone",ee).toDateTime()}function hs($,ee){if($.timezone!==ee){return pT.adapter.fromDateTime($).set("timezone",ee).toDateTime()}return $}class hu extends Error{}function hl($){let ee;if($.start instanceof pN){ee=$.start}else if($.start instanceof pT){ee=$.start.toDateTime()}else if(pT.adapter.isDate($.start)){ee=pT.adapter.fromDate($.start).toDateTime()}else{throw new hu('"start" must be either a `DateAdapter` instance or an instance of the '+"date a DateAdapter is wrapping (e.g. `StandardDateAdapter` wraps a `Date`)")}let et;if($.end){if($.end instanceof pN){et=$.end}else if($.end instanceof pT){et=$.end.toDateTime()}else if(pT.adapter.isDate($.end)){et=pT.adapter.fromDate($.end).toDateTime()}else{throw new hu('"end" must be either be `undefined`, a `DateAdapter` instance, or an instance of the '+"date a DateAdapter is wrapping (e.g. `StandardDateAdapter` wraps a `Date`)")}}if($.duration!==undefined){if(!Number.isInteger($.duration)){throw new hu('"duration" expects a whole number')}if($.duration<=0){throw new hu('"duration" must be greater than 0')}}if($.count!==undefined){if(!Number.isInteger($.count)){throw new hu('"count" must be a whole number')}if($.count<0){throw new hu('"count" must be greater than 0')}}if($.end!==undefined&&$.count!==undefined){throw new hu('"end" and "count" cannot both be present')}return{start:ee,end:et,count:$.count,duration:$.duration}}function hf($,ee){const et=hl(ee);const en=hr(ee);$.forEach($=>{$.normalizeOptions(en,et)});Object.keys(et).forEach($=>{if(et[$]===undefined){delete et[$]}});return et}function hd($){const ee=hr($);ee.start=$.start;if($.end)ee.end=$.end;return ee}class hp extends Error{}class hh{constructor($){this.date=$}}class hy{constructor($){this.date=$}}function hg($){return ee=>$.reduce(($,et)=>{const en=et.get(ee);if(en)$.push(en);return $},[])}class hm{constructor($,ee,et){this.options=ee;this.args=et;this.rules=[];this.iterator=this.options.count===undefined?this.iterate():this.args.reverse?this.iterateWithReverseCount():this.iterateWithCount();this.options=Object.assign(Object.assign({},hr(ee)),{start:ee.start,end:ee.end});this.reverse=this.options.count===undefined&&et.reverse||false;const{start:en,end:ei}=this.normalizeDateTimeArgs(et);if(ee.count!==undefined){this.start=ee.start}else if(en&&ee.start){this.start=en.isAfterOrEqual(ee.start)?en:ee.start}else{this.start=en||ee.start}if(ei&&ee.end){this.end=ei.isBeforeOrEqual(ee.end)?ei:ee.end}else{this.end=ei||ee.end}if(this.args.reverse&&!(ee.count!==undefined||this.end)){throw new Error("When iterating in reverse, the rule must have an `end` or `count` "+"property or you must provide an `end` argument.")}this.isInfinite=!this.end&&this.options.count===undefined;this.hasDuration=!!this.options.duration;this.rules=Array.isArray($)?$:$(this)}[Symbol.iterator](){return this.iterator}next($){return this.iterator.next($)}*iterateWithReverseCount(){const $=Array.from(this.iterateWithCount()).reverse();let ee;const et=$.slice();let en=et.shift();while(en){if(ee&&ee.skipToDate&&en.isAfter(ee.skipToDate)){en=et.shift();continue}ee=yield en;if(ee&&ee.skipToDate&&ee.skipToDate.isAfterOrEqual(en)){throw new Error("A provided `skipToDate` option must be greater than the last yielded date "+"(or smaller, in the case of reverse iteration)")}en=et.shift()}return undefined}*iterateWithCount(){if(this.options.count===0)return;const $=this.iterate();const ee=this.args.start||this.start;let et=$.next().value;let en=1;let ei;while(et&&en<=this.options.count){en++;if(et.isBefore(ee)){et=$.next().value;continue}if(ei&&ei.skipToDate&&et.isBefore(ei.skipToDate)){et=$.next().value;continue}ei=yield et;if(ei&&ei.skipToDate&&ei.skipToDate.isBeforeOrEqual(et)){throw new Error("A provided `skipToDate` option must be greater than the last yielded date "+"(or smaller, in the case of reverse iteration)")}et=$.next().value}return undefined}*iterate(){let $=this.start;if(this.reverse)$=this.end;let ee=this.nextDate($);while(ee){const $=yield this.normalizeRunOutput(ee);if($&&$.skipToDate){if(this.reverse?$.skipToDate.isAfterOrEqual(ee):$.skipToDate.isBeforeOrEqual(ee)){throw new Error("A provided `skipToDate` option must be greater than the last yielded date "+"(or smaller, in the case of reverse iteration)")}ee=this.nextDate($.skipToDate)}else{ee=this.nextDate(this.reverse?ee.subtract(1,"millisecond"):ee.add(1,"millisecond"))}}return undefined}nextDate($){let ee=this.runRules($.set("generators",[]));if(this.isDatePastEnd(ee.date))return null;let et=0;while(ee instanceof hy&&et<50){ee=this.runRules(ee.date);if(this.isDatePastEnd(ee.date))return null;et++}if(ee instanceof hy){throw new hp(`Failed to find a matching occurrence in ${et} iterations. `+`Last iterated date: "${ee.date.toISOString()}"`)}if(this.reverse?$.isBefore(ee.date):$.isAfter(ee.date)){throw new hp("An error occurred in a recurrence rule. If this happened using "+"the rSchedule provided recurrence rules, you should "+"open an issue in the rSchedule repo. The maintainer is going to "+"want to know how to recreate the error.")}return ee.date}runRules($){let ee=new hh($);for(const $ of this.rules){if(ee instanceof hy){return ee}ee=$.run(ee.date)}return ee}isDatePastEnd($){return this.reverse?$.isBefore(this.start):this.end&&$.isAfter(this.end)}normalizeRunOutput($){return this.hasDuration?$.set("duration",this.options.duration):$}normalizeDateTimeArgs($){return{start:$.start&&hs($.start,this.options.start.timezone),end:$.end&&hs($.end,this.options.start.timezone)}}};class h_{constructor($={}){this.timezone=$.timezone!==undefined?$.timezone:null;this.maxDuration=$.maxDuration||0}get firstDate(){if(this._firstDate!==undefined)return this._firstDate;const $=this._run().next().value;this._firstDate=$?this.dateAdapter.fromDateTime($):null;return this._firstDate}get lastDate(){if(this._lastDate!==undefined)return this._lastDate;if(this.isInfinite){this._lastDate=null;return null}const $=this._run({reverse:true}).next().value;this._lastDate=$?this.dateAdapter.fromDateTime($):null;return this._lastDate}pipe(...$){return $.reduce(($,ee)=>ee({base:$,timezone:this.timezone}),this)}occurrences($={}){return new hv(this,this.normalizeOccurrencesArgs($))}collections($={}){return new hE(this,this.normalizeCollectionsArgs($))}occursBetween($,ee,et={}){const en=this.normalizeDateInput($);const ei=this.normalizeDateInput(ee);if(this.hasDuration&&!et.excludeEnds){const $=this.getMaxDuration("occursBetween",et);const ee=this._run({start:en.subtract($,"millisecond"),end:ei,reverse:true});for(const $ of ee){if($.end.isBefore(en))continue;return true}return false}for(const $ of this._run({start:en,end:ei})){if(et.excludeEnds){if($.isEqual(en)){continue}if($.isEqual(ei)){break}}return true}return false}occursOn($){const ee=this.normalizeOccursOnArgs($);if(ee.weekday){if(this.isInfinite&&!ee.before){throw new p9("When calling `occursOn()` with a `weekday` argument "+"and an occurrence object that has infinite occurrences, "+"you must include a `before` argument as well.")}const $=ee.after&&(ee.excludeEnds?ee.after.add(1,"day"):ee.after);const et=ee.before&&(ee.excludeEnds?ee.before.subtract(1,"day"):ee.before);const en=this._run({start:$,end:et});let ei=en.next().value;if(!ei)return false;while(ei){if(ei.get("weekday")===ee.weekday){return true}ei=en.next({skipToDate:ei.add(pP(ei.get("weekday"),ee.weekday),"day").granularity("day")}).value}return false}if(!ee.date){throw new p9(`"occursOn()" must be called with either a "date" or "weekday" argument`)}if(this.hasDuration){const $=this.getMaxDuration("occursOn",ee);const et=this._run({start:ee.date.subtract($,"millisecond"),end:ee.date});for(const $ of et){if($.end.isBefore(ee.date))continue;if($.isAfter(ee.date))return false;return true}return false}for(const $ of this._run({start:ee.date,end:ee.date})){return!!$}return false}occursAfter($,ee={}){const et=this.normalizeDateInput($);if(this.hasDuration&&!ee.excludeStart){const $=this.getMaxDuration("occursAfter",ee);const en=this._run({start:et.subtract($,"millisecond")});for(const $ of en){if($.end.isBefore(et))continue;return true}return false}for(const $ of this._run({start:et})){if(ee.excludeStart&&$.isEqual(et)){continue}return true}return false}occursBefore($,ee={}){const et=this.normalizeDateInput($);if(this.hasDuration&&ee.excludeStart){for(const $ of this._run({end:et,reverse:true})){if($.end.isAfterOrEqual(et))continue;return true}return false}for(const $ of this._run({end:et,reverse:true})){if(ee.excludeStart&&$.isEqual(et)){continue}return true}return false}get dateAdapter(){return pT.adapter}normalizeOccurrencesArgs($){return Object.assign(Object.assign({},$),{start:this.normalizeDateInput($.start),end:this.normalizeDateInput($.end)})}normalizeCollectionsArgs($){if($.reverse!==undefined){throw new p9("`collections()` does not support the `reverse` option at this time.")}return Object.assign(Object.assign({},$),{start:this.normalizeDateInput($.start),end:this.normalizeDateInput($.end)})}normalizeOccursOnArgs($={}){return Object.assign(Object.assign({},$),{date:this.normalizeDateInput($.date),after:this.normalizeDateInput($.after),before:this.normalizeDateInput($.before),excludeDates:$.excludeDates&&$.excludeDates.map($=>this.normalizeDateInput($))})}normalizeRunArgs($){return Object.assign(Object.assign({},$),{start:this.normalizeDateInput($.start),end:this.normalizeDateInput($.end)})}normalizeDateInput($){return $?ho($,this.timezone):undefined}normalizeDateInputToAdapter($){if(!$)return;return hn($)}normalizeRunOutput($){return hs($,this.timezone)}getMaxDuration($,ee){const et=ee.maxDuration||this.maxDuration;if(!Number.isInteger(et)){throw new p9(`When an occurrence generator `+`has a duration, a 'maxDuration' argument must be supplied `+`to ${$}().`)}return et}}class hv{constructor($,ee){this.iterable=$;this.args=ee;this[Symbol.iterator]=()=>this.occurrenceIterator();this.iterator=$._run(ee);this.isInfinite=$.isInfinite}next($){return this.occurrenceIterator($).next()}toArray(){if(this.args.end||this.args.take||!this.isInfinite){return Array.from(this.occurrenceIterator())}throw new p7("OccurrenceIterator#toArray() can only be called if the iterator "+"is not infinite, or you provide and `end` argument, or you provide "+"a `take` argument.")}*occurrenceIterator($){let ee=this.normalizeRunArgs($);let et=this.iterator.next(ee).value;while(et){const $=yield this.normalizeDateOutput(et);ee=this.normalizeRunArgs($);et=this.iterator.next(ee).value}return undefined}normalizeRunArgs($){return{skipToDate:this.normalizeDateInput($&&$.skipToDate)}}normalizeDateInput($){return $?ho($,this.iterable.timezone):undefined}normalizeDateOutput($){if(!$)return;return $?pT.adapter.fromDateTime($):undefined}}class hw{constructor($=[],ee,et,en){this.dates=$;this.granularity=ee;this.periodStart=et;this.periodEnd=en}}class hE{constructor($,ee){this.iterable=$;this.args=ee;this.granularity="year";this[Symbol.iterator]=()=>this.iterator;if(ee.granularity){this.granularity=ee.granularity;if(this.granularity==="week"&&!ee.weekStart){throw new Error('"week" granularity requires `weekStart` arg')}}if(ee.weekStart){this.weekStart=ee.weekStart}if(ee.reverse){throw new Error("`OccurrenceGenerator#collections()` does not support iterating in reverse. "+"Though `OccurrenceGenerator#occurrences()` does support iterating in reverse.")}this.args=Object.assign(Object.assign({},ee),{start:ee.start||$._run().next().value,end:ee.end&&this.getPeriod(ee.end).end});this.startDate=this.args.start&&this.normalizeDateOutput(this.getPeriod(this.args.start).start)||null;this.iterator=this.collectionIterator()}next(){return this.iterator.next()}toArray(){if(this.args.end||this.args.take||!this.iterable.isInfinite){const $=[];for(const ee of this.collectionIterator()){$.push(ee)}return $}throw new p7("CollectionIterator#toArray() can only be called if the iterator "+"is not infinite, or you provide and `end` argument, or you provide "+"a `take` argument.")}normalizeDateOutput($){if(!$)return;return pT.adapter.fromDateTime($)}*collectionIterator(){if(!this.startDate)return;let $=this.occurrenceIterator();let ee=$.next().value;if(!ee)return;let et=this.getPeriod(this.args.start);let en=[];let ei=0;while(ee&&(this.args.take===undefined||this.args.take>ei)){while(ee&&ee.isBeforeOrEqual(et.end)){en.push(ee);ee=$.next().value}yield new hw(en.map($=>this.normalizeDateOutput($)),this.granularity,this.normalizeDateOutput(et.start),this.normalizeDateOutput(et.end));if(!ee)return;en=[];et=!this.args.skipEmptyPeriods?this.getPeriod(this.incrementPeriod(et.period)):this.getPeriod(ee);if(this.granularity==="month"&&this.weekStart){$=this.iterable._run({start:et.start,end:this.args.end});ee=$.next().value}ei++}}getPeriod($){let ee;let et;let en;if(this.granularity==="month"&&this.weekStart){ee=$.granularity("month").granularity("week",{weekStart:this.weekStart});et=$.endGranularity("month").endGranularity("week",{weekStart:this.weekStart});en=$.granularity("month")}else{ee=$.granularity(this.granularity,{weekStart:this.weekStart});et=$.endGranularity(this.granularity,{weekStart:this.weekStart});en=ee}return{start:ee,end:et,period:en}}incrementPeriod($){return $.add(1,this.granularity)}occurrenceIterator(){let $=this.args.start||this.iterable._run().next().value;if(!$)return this.iterable._run(this.args);$=this.getPeriod($).start;return this.iterable._run({start:$,end:this.args.end})}}class hS extends h_{constructor($,ee){super(ee);this.streams=$;this.config=ee;this.timezone=ee.timezone;this.streams=$.map($=>$ instanceof hS?$:$.set("timezone",this.timezone));this.isInfinite=this.calculateIsInfinite();this.hasDuration=this.calculateHasDuration()}normalizeDateInput($){if(!$)return;return ho($,this.timezone)}normalizeRunOutput($){return hs($,this.timezone)}}class hT{constructor($,ee){this.runArgs=ee;this.stream=$._run(this.runArgs);this.next()}next($){const{done:ee,value:et}=this.stream.next($);this.done=typeof ee==="boolean"?ee:true;this.value=et;return{done:ee,value:et}}}function hO($,ee={},et={}){if(!et.skipToDate||$.length===0)return;if(ee.reverse?$.every($=>$.value.isBeforeOrEqual(et.skipToDate)):$.every($=>$.value.isAfterOrEqual(et.skipToDate))){throw new Error("A provided `skipToDate` option must be greater than the last yielded date "+"(or smaller, in the case of reverse iteration)")}for(const en of $){if(en.done)continue;if(ee.reverse?en.value.isBeforeOrEqual(et.skipToDate):en.value.isAfterOrEqual(et.skipToDate)){continue}en.next(et)}}function hA($,ee){if($.done&&ee.done)return 0;if($.done)return 1;if(ee.done)return-1;if($.value.isAfter(ee.value))return 1;return-1}function hI($,ee){if($.done&&ee.done)return 0;if($.done)return-1;if(ee.done)return 1;if($.value.isAfter(ee.value))return-1;return 1}function hN($,ee={},et={}){hO($,ee,et);return $.sort(ee.reverse?hI:hA).filter($=>!$.done).shift()}function hD($,ee={},et={}){hO($,ee,et);return $.sort(ee.reverse?hI:hA).filter($=>!$.done).pop()}function hR(...$){return ee=>new hC($,ee)}class hC extends hS{set($,ee){return new hC(this.streams.map($=>$.set("timezone",ee)),Object.assign(Object.assign({},this.config),{base:this.config.base&&this.config.base.set("timezone",ee),timezone:ee}))}*_run($={}){const ee=this.streams.map(ee=>new hT(ee,$));if(this.config.base){ee.push(new hT(this.config.base,$))}if(ee.length===0)return;let et=hN(ee,$);while(et&&!et.done){const en=yield this.normalizeRunOutput(et.value);if(!(en&&en.skipToDate)){et.next()}et=hN(ee,$,en)}}calculateIsInfinite(){return this.config.base&&this.config.base.isInfinite||this.streams.some($=>$.isInfinite)}calculateHasDuration(){const $=this.streams.every($=>$.hasDuration);if(!this.config.base)return $;return this.config.base.hasDuration&&$}}class hk extends(null&&h_){constructor($={}){super($);this.schedules=[];this.data=$.data;if($.schedules){this.schedules=Array.isArray($.schedules)?$.schedules:[$.schedules];this.schedules=this.schedules.map($=>$.set("timezone",this.timezone))}this.isInfinite=this.schedules.some($=>$.isInfinite);this.hasDuration=this.schedules.every($=>$.hasDuration)}occurrences($={}){return new hv(this,this.normalizeOccurrencesArgs($))}collections($={}){return new hE(this,this.normalizeCollectionsArgs($))}set($,ee,et){if($==="timezone"){return new hk({schedules:this.schedules.map(en=>en.set($,ee,et)),data:this.data,timezone:ee,maxDuration:this.maxDuration})}else if($==="schedules"){return new hk({schedules:Array.isArray(ee)?ee:[ee],data:this.data,timezone:this.timezone,maxDuration:this.maxDuration})}throw new ArgumentError("Unknown value for `prop`: "+`"${$}"`)}*_run($={}){if(this.schedules.length===0)return;const ee=$.take;delete $.take;let et;if(this.schedules.length===1){et=this.schedules[0]._run($)}else{et=new hC(this.schedules,{timezone:this.timezone})._run($)}let en=et.next().value;let ei=0;while(en&&(ee===undefined||ee>ei)){en=en.add(this,"generator");const $=yield this.normalizeRunOutput(en);en=et.next($).value;ei++}return undefined}}class hM extends h_{constructor($={}){super($);this.adapters=[];this.isInfinite=false;this.maxDuration=0;this.datetimes=[];this.data=$.data;if($.dates){this.adapters=$.dates.map(ee=>{let et=this.normalizeDateInputToAdapter(ee);if($.duration&&!et.duration){et=et.set("duration",$.duration)}return et.set("timezone",this.timezone)});this.datetimes=this.adapters.map($=>$.toDateTime())}this.hasDuration=this.datetimes.every($=>!!$.duration);if(this.hasDuration){this.maxDuration=this.adapters.reduce(($,ee)=>ee.duration>$?ee.duration:$,0)}}get length(){return this.adapters.length}get firstDate(){return this.adapters[0]||null}get lastDate(){return this.adapters[this.length-1]||null}occurrences($={}){return new hv(this,this.normalizeOccurrencesArgs($))}collections($={}){return new hE(this,this.normalizeCollectionsArgs($))}add($){return new hM({dates:[...this.adapters,$],timezone:this.timezone,data:this.data})}remove($){const ee=this.adapters.slice();const et=this.normalizeDateInputToAdapter($);const en=ee.findIndex($=>$.valueOf()===et.valueOf());if(en>=0){ee.splice(en,1)}return new hM({dates:ee,timezone:this.timezone,data:this.data})}set($,ee,et={}){let en=this.timezone;let ei=this.adapters.slice();if($==="timezone"){if(ee===this.timezone)return this;else if(et.keepLocalTime){ei=this.adapters.map($=>{const et=$.toJSON();et.timezone=ee;return this.dateAdapter.fromJSON(et)})}en=ee}else if($==="dates"){ei=ee}else if($==="duration"){ei=ei.map($=>$.set("duration",ee||0))}else{throw new p9(`Unexpected prop argument "${$}". Accepted values are "timezone" or "dates"`)}return new hM({dates:ei,data:this.data,timezone:en})}filter($){return new hM({dates:this.adapters.filter($),data:this.data,timezone:this.timezone})}*_run($={}){let ee=this.datetimes.sort(pk);if($.start){ee=ee.filter(ee=>ee.isAfterOrEqual($.start))}if($.end){ee=ee.filter(ee=>ee.isBeforeOrEqual($.end))}if($.reverse){ee=ee.slice().reverse()}if($.take){ee=ee.slice(0,$.take)}const et=ee.slice();let en=et.shift();let ei;while(en){if(ei&&ei.skipToDate&&($.reverse?ei.skipToDate.isBefore(en):ei.skipToDate.isAfter(en))){en=et.shift();continue}en=en.add(this,"generator");ei=yield this.normalizeRunOutput(en);if(ei&&ei.skipToDate&&($.reverse?ei.skipToDate.isAfterOrEqual(en):ei.skipToDate.isBeforeOrEqual(en))){throw new Error("A provided `skipToDate` option must be greater than the last yielded date "+"(or smaller, in the case of reverse iteration)")}en=et.shift()}return undefined}}class hL extends Error{}let hx;class hP{constructor($,ee){this.metadata={};this.duration=ee&&ee.duration||0;this.generators=ee&&ee.generators&&ee.generators.slice()||[];if(!Number.isInteger(this.duration)||this.duration<0){throw new hL("duration must be a non-negative integer")}}static set adapter($){if(hx){throw new Error(`"${hx.name}" has already been configured.`)}hx=$}static get adapter(){if(!hx){throw new Error("No date adapter has been configured. See rSchedule docs.")}return hx}static isDate($){throw hF("isDate()")}static fromDate($,ee){throw hF("fromDate()")}static fromJSON($){throw hF("fromJSON()")}static fromDateTime($){throw hF("fromDateTime()")}toISOString(){return this.set("timezone","UTC").toDateTime().toISOString()}toDateTime(){const $=hj.fromJSON(Object.assign(Object.assign({},this.toJSON()),{generators:this.generators,metadata:this.metadata}));return $}}hP.hasTimezoneSupport=false;function hF($){return new Error(`You must implement the "${$}" method for this DateAdapter class`)}var hB;(function($){$.WEEKDAYS=["SU","MO","TU","WE","TH","FR","SA"];$.MILLISECONDS_IN_SECOND=1e3;$.MILLISECONDS_IN_MINUTE=$.MILLISECONDS_IN_SECOND*60;$.MILLISECONDS_IN_HOUR=$.MILLISECONDS_IN_MINUTE*60;$.MILLISECONDS_IN_DAY=$.MILLISECONDS_IN_HOUR*24;$.MILLISECONDS_IN_WEEK=$.MILLISECONDS_IN_DAY*7})(hB||(hB={}));class hU extends Error{}class hj{constructor($,ee,et,en,ei={}){this.metadata={};this.date=new Date($);this.timezone=ee||null;this.duration=et||0;this.generators=en&&en.slice()||[];if(!Number.isInteger(this.duration)||this.duration<0){throw new hU("duration must be a non-negative integer")}if(ei.metadata){Object.assign(this.metadata,ei.metadata)}this.assertIsValid()}static fromJSON($){const ee=new Date(Date.UTC($.year,$.month-1,$.day,$.hour,$.minute,$.second,$.millisecond));return new hj(ee,$.timezone,$.duration,$.generators,{metadata:$.metadata})}static fromDateAdapter($){return hj.fromJSON(Object.assign(Object.assign({},$.toJSON()),{generators:$.generators,metadata:$.metadata}))}get end(){if(!this.duration)return;if(this._end)return this._end;this._end=this.add(this.duration,"millisecond");return this._end}isEqual($){if(!$){return false}hW(this,$);return this.valueOf()===$.valueOf()}isBefore($){hW(this,$);return this.valueOf()<$.valueOf()}isBeforeOrEqual($){hW(this,$);return this.valueOf()<=$.valueOf()}isAfter($){hW(this,$);return this.valueOf()>$.valueOf()}isAfterOrEqual($){hW(this,$);return this.valueOf()>=$.valueOf()}isOccurring($){if(!this.duration){throw new Error("DateTime#isOccurring() is only applicable to DateTimes with durations")}hW(this,$);return $.isAfterOrEqual(this)&&$.isBeforeOrEqual(this.add(this.duration,"millisecond"))}add($,ee){switch(ee){case"generator":{const ee=this.generators.slice();ee.unshift($);return new hj(this.date,this.timezone,this.duration,ee)}case"year":return this.forkDateTime(hX(this.date,$));case"month":return this.forkDateTime(hQ(this.date,$));case"week":return this.forkDateTime(h0(this.date,$));case"day":return this.forkDateTime(h2(this.date,$));case"hour":return this.forkDateTime(h6(this.date,$));case"minute":return this.forkDateTime(h4(this.date,$));case"second":return this.forkDateTime(h3(this.date,$));case"millisecond":return this.forkDateTime(h8(this.date,$));default:throw new Error("Invalid unit provided to `DateTime#add`")}}subtract($,ee){switch(ee){case"year":return this.forkDateTime(h5(this.date,$));case"month":return this.forkDateTime(h9(this.date,$));case"week":return this.forkDateTime(h7(this.date,$));case"day":return this.forkDateTime(ye(this.date,$));case"hour":return this.forkDateTime(yt(this.date,$));case"minute":return this.forkDateTime(yr(this.date,$));case"second":return this.forkDateTime(yn(this.date,$));case"millisecond":return this.forkDateTime(yi(this.date,$));default:throw new Error("Invalid unit provided to `DateTime#subtract`")}}get($){switch($){case"year":return this.date.getUTCFullYear();case"month":return this.date.getUTCMonth()+1;case"yearday":return hK(this.date);case"weekday":return hB.WEEKDAYS[this.date.getUTCDay()];case"day":return this.date.getUTCDate();case"hour":return this.date.getUTCHours();case"minute":return this.date.getUTCMinutes();case"second":return this.date.getUTCSeconds();case"millisecond":return this.date.getUTCMilliseconds();default:throw new Error("Invalid unit provided to `DateTime#set`")}}set($,ee){if($==="duration"){return new hj(this.date,this.timezone,ee,this.generators)}if($==="generators"){return new hj(this.date,this.timezone,this.duration,ee)}let et=new Date(this.date);switch($){case"year":et.setUTCFullYear(ee);break;case"month":{const $=hq(ee,et.getUTCFullYear());const en=et.getUTCDate();if(en>$){et.setUTCDate(1);et.setUTCMonth(ee);et=ye(et,1)}else{et.setUTCMonth(ee-1)}break}case"day":et.setUTCDate(ee);break;case"hour":et.setUTCHours(ee);break;case"minute":et.setUTCMinutes(ee);break;case"second":et.setUTCSeconds(ee);break;case"millisecond":et.setUTCMilliseconds(ee);break;default:throw new Error("Invalid unit provided to `DateTime#set`")}return this.forkDateTime(et)}granularity($,ee={}){let et=this.forkDateTime(this.date);switch($){case"year":et=et.set("month",1);case"month":et=et.set("day",1);break;case"week":et=hH(et,ee.weekStart)}switch($){case"year":case"month":case"week":case"day":et=et.set("hour",0);case"hour":et=et.set("minute",0);case"minute":et=et.set("second",0);case"second":et=et.set("millisecond",0);case"millisecond":return et;default:throw new Error("Invalid granularity provided to `DateTime#granularity`: "+$)}}endGranularity($,ee={}){let et=this.forkDateTime(this.date);switch($){case"year":et=et.set("month",12);case"month":et=et.set("day",hq(et.get("month"),et.get("year")));break;case"week":et=hz(et,ee.weekStart)}switch($){case"year":case"month":case"week":case"day":et=et.set("hour",23);case"hour":et=et.set("minute",59);case"minute":et=et.set("second",59);case"second":et=et.set("millisecond",999);case"millisecond":return et;default:throw new Error("Invalid granularity provided to `DateTime#granularity`: "+$)}}toISOString(){return this.date.toISOString()}toDateTime(){return this}toJSON(){const $={timezone:this.timezone,year:this.get("year"),month:this.get("month"),day:this.get("day"),hour:this.get("hour"),minute:this.get("minute"),second:this.get("second"),millisecond:this.get("millisecond")};if(this.duration){$.duration=this.duration}return $}valueOf(){return this.date.valueOf()}assertIsValid(){if(isNaN(this.valueOf())){throw new hU("DateTime has invalid date.")}return true}forkDateTime($){return new hj($,this.timezone,this.duration,this.generators)}}function hW($,ee){if($.timezone!==ee.timezone){throw new hU("Attempted to compare a datetime to another date in a different timezone: "+JSON.stringify($)+" and "+JSON.stringify(ee))}return true}function hH($,ee){const et=hV(ee).indexOf($.get("weekday"));return $.subtract(et,"day")}function hz($,ee){const et=hV(ee).indexOf($.get("weekday"));return $.add(6-et,"day")}function hV($="SU"){const ee=hB.WEEKDAYS.slice();let et=ee.indexOf($);while(et!==0){h$(ee);et--}return ee}function h$($,ee="first"){if($.length===0){return $}else if(ee==="first"){$.push($.shift())}else{$.unshift($.pop())}return $}function hq($,ee){const et={1:31,2:hG(ee),3:31,4:30,5:31,6:30,7:31,8:31,9:30,10:31,11:30,12:31};return et[$]}function hG($){return hY($)?29:28}function hY($){return $%400===0||$%4===0&&$%100!==0}function hK($){const ee=new Date(Date.UTC($.getUTCFullYear(),0,1));const et=$.valueOf()-ee.valueOf();return 1+Math.floor(et/hB.MILLISECONDS_IN_DAY)}function hZ($){if($===null||$===true||$===false){return NaN}const ee=Number($);if(isNaN(ee)){return ee}return ee<0?Math.ceil(ee):Math.floor(ee)}function hJ($,ee){if(arguments.length<2){throw new TypeError("2 arguments required, but only "+arguments.length+" present")}const et=$.valueOf();const en=hZ(ee);return new Date(et+en)}function hX($,ee){const et=hZ(ee);return hQ($,et*12)}function hQ($,ee){const et=hZ(ee);$=new Date($);const en=$.getUTCMonth()+et;const ei=new Date(0);ei.setUTCFullYear($.getUTCFullYear(),en,1);ei.setUTCHours(0,0,0,0);const eo=hq(ei.getUTCMonth()+1,ei.getUTCFullYear());$.setUTCMonth(en,Math.min(eo,$.getUTCDate()));return $}function h0($,ee){const et=hZ(ee);const en=et*7;return h2($,en)}function h2($,ee){return h8($,hZ(ee)*hB.MILLISECONDS_IN_DAY)}function h6($,ee){const et=hZ(ee);return hJ($,et*hB.MILLISECONDS_IN_HOUR)}function h4($,ee){const et=hZ(ee);return hJ($,et*hB.MILLISECONDS_IN_MINUTE)}function h3($,ee){const et=hZ(ee);return hJ($,et*hB.MILLISECONDS_IN_SECOND)}function h8($,ee){const et=hZ(ee);const en=$.getTime();return new Date(en+et)}function h5($,ee){return hX($,-ee)}function h9($,ee){return hQ($,-ee)}function h7($,ee){return h0($,-ee)}function ye($,ee){return h2($,-ee)}function yt($,ee){return h6($,-ee)}function yr($,ee){return h4($,-ee)}function yn($,ee){return h3($,-ee)}function yi($,ee){return h8($,-ee)}function yo($,ee){if($.timezone!==ee){return hP.adapter.fromDateTime($).set("timezone",ee).toDateTime()}return $}class yu extends h_{constructor($,ee,et={}){super(et);this.recurrenceRules=$;this.options=hd(ee);this.normOptions=hf(this.recurrenceRules,this.options);this.timezone=et.timezone!==undefined?et.timezone:this.normOptions.start.timezone;this.data=et.data;this.hasDuration=!!ee.duration;if(this.hasDuration)this.duration=ee.duration;this.isInfinite=this.normOptions.end===undefined&&this.normOptions.count===undefined}occurrences($={}){return new hv(this,this.normalizeOccurrencesArgs($))}collections($={}){return new hE(this,this.normalizeCollectionsArgs($))}*_run($={}){const ee=this.normalizeRunArgs($);const et=new hm(hg(this.recurrenceRules),this.normOptions,ee);let en=et.next().value;let ei=0;while(en&&(ee.take===undefined||ei<ee.take)){ei++;en=en.add(this,"generator");const $=yield this.normalizeRunOutput(en);if($===null||$===void 0?void 0:$.skipToDate){en=et.next(Object.assign(Object.assign({},$),{skipToDate:yo($.skipToDate,et.start.timezone)})).value}else{en=et.next($).value}}return undefined}}class yl extends yu{constructor($,ee={}){super(yl.recurrenceRules,$,ee)}set($,ee,et={}){let en=hd(this.options);let ei=this.timezone;if($==="timezone"){if(ee===this.timezone&&!et.keepLocalTime)return this;else if(et.keepLocalTime){const $=this.normalizeDateInput(en.start).toJSON();$.timezone=ee;const et=this.dateAdapter.fromJSON($);en.start=en.start instanceof this.dateAdapter?et:en.start instanceof pN?et.toDateTime():et.date}ei=ee}else if($==="options"){en=ee}else{en[$]=ee}return new yl(en,{data:this.data,maxDuration:this.maxDuration,timezone:ei})}}yl.recurrenceRules=[];class yc extends h_{constructor($){super($);this.data=$.data}occurrences($={}){return new hv(this,this.normalizeOccurrencesArgs($))}collections($={}){return new hE(this,this.normalizeCollectionsArgs($))}*_run($={}){const ee=$.take;delete $.take;const et=this.occurrenceStream._run($);let en=et.next().value;let ei=0;while(en&&(ee===undefined||ee>ei)){en=en.add(this,"generator");const $=yield this.normalizeRunOutput(en);en=et.next($).value;ei++}return undefined}}function yf(...$){return ee=>new yd($,ee)}class yd extends hS{set($,ee){return new yd(this.streams.map($=>$.set("timezone",ee)),Object.assign(Object.assign({},this.config),{base:this.config.base&&this.config.base.set("timezone",ee),timezone:ee}))}*_run($={}){if(!this.config.base)return;const ee=new hT(this.config.base,$);const et=new hT(new hC(this.streams,{timezone:this.config.timezone}),$);yp(ee,et,$);while(!ee.done){const en=yield this.normalizeRunOutput(ee.value);if(!(en&&en.skipToDate)){ee.next()}yp(ee,et,$,en)}}calculateIsInfinite(){return!!(this.config.base&&this.config.base.isInfinite)}calculateHasDuration(){return!!(this.config.base&&this.config.base.hasDuration)}}function yp($,ee,et={},en={}){hO([$,ee],et,en);yh($,ee,et);while(!$.done&&!ee.done&&$.value.isEqual(ee.value)){$.next();yh($,ee,et)}}function yh($,ee,et={}){if(et.reverse){while(!ee.done&&!$.done&&ee.value.isAfter($.value)){ee.next()}return}while(!ee.done&&!$.done&&ee.value.isBefore($.value)){ee.next()}}function yy(){return $=>new yg([],$)}class yg extends hS{set($,ee){return new yg([],Object.assign(Object.assign({},this.config),{base:this.config.base&&this.config.base.set("timezone",ee),timezone:ee}))}*_run($={}){if(!this.config.base)return;const ee=new hT(this.config.base,$);while(!ee.done){const $=yield this.normalizeRunOutput(ee.value);const et=ee.value;ee.next($);while(!($&&$.skipToDate)&&!ee.done&&ee.value.isEqual(et)){ee.next()}}}calculateIsInfinite(){return!!(this.config.base&&this.config.base.isInfinite)}calculateHasDuration(){return!!(this.config.base&&this.config.base.hasDuration)}}class ym extends yc{constructor($={}){super($);this.rrules=[];this.exrules=[];for(const ee of["rrules","exrules"]){const et=$[ee];if(et){this[ee]=et.map($=>{if($ instanceof yl){return $.set("timezone",this.timezone)}else{return new yl($,{timezone:this.timezone})}})}}for(const ee of["rdates","exdates"]){const et=$[ee];if(et){this[ee]=et instanceof hM?et.set("timezone",this.timezone):new hM({dates:et,timezone:this.timezone})}else{this[ee]=new hM({timezone:this.timezone})}}this.hasDuration=this.rrules.every($=>$.hasDuration)&&this.exrules.every($=>$.hasDuration)&&this.rdates.hasDuration&&this.exdates.hasDuration;this.isInfinite=this.rrules.some($=>$.isInfinite);this.occurrenceStream=[hR(...this.rrules),yf(...this.exrules),hR(this.rdates),yf(this.exdates),yy()].reduce(($,ee)=>ee({base:$,timezone:this.timezone}),undefined)}add($,ee){const et=this.rrules.slice();const en=this.exrules.slice();let ei=this.rdates;let eo=this.exdates;switch($){case"rrule":et.push(ee);break;case"exrule":en.push(ee);break;case"rdate":ei=this.rdates.add(ee);break;case"exdate":eo=this.exdates.add(ee);break}return new ym({timezone:this.timezone,data:this.data,rrules:et,exrules:en,rdates:ei,exdates:eo})}remove($,ee){let et=this.rrules;let en=this.exrules;let ei=this.rdates;let eo=this.exdates;switch($){case"rrule":et=et.filter($=>$!==ee);break;case"exrule":en=en.filter($=>$!==ee);break;case"rdate":ei=this.rdates.remove(ee);break;case"exdate":eo=this.exdates.remove(ee);break}return new ym({timezone:this.timezone,data:this.data,rrules:et,exrules:en,rdates:ei,exdates:eo})}set($,ee,et={}){let en=this.timezone;let ei=this.rrules;let eo=this.exrules;let es=this.rdates;let eu=this.exdates;switch($){case"timezone":if(ee===this.timezone&&!et.keepLocalTime)return this;else if(et.keepLocalTime){ei=ei.map($=>$.set("timezone",ee,et));eo=eo.map($=>$.set("timezone",ee,et));es=es.set("timezone",ee,et);eu=eu.set("timezone",ee,et)}en=ee;break;case"rrules":ei=ee;break;case"exrules":eo=ee;break;case"rdates":es=ee;break;case"exdates":eu=ee;break}return new ym({timezone:en,data:this.data,rrules:ei,exrules:eo,rdates:es,exdates:eu})}}function y_($){return ee=>new yv($,ee)}class yv extends(null&&hS){constructor($,ee){super($.streams,ee);if(this.isInfinite){this.maxFailedIterations=$.maxFailedIterations||yv.defaultMaxFailedIterations;if(!this.maxFailedIterations){throw new ArgumentError("The IntersectionOperator must be provided "+"a `maxFailedIterations` argument when it is built from schedules of infinite length. "+"This argument is used to ensure that the IntersectionOperator does not enter "+"an infinite loop because the underlying schedules never intersect. "+"If the `maxFailedIterations` count is reached it will be assumed that "+"all valid occurrences have been found and iteration will end without error."+'Without additional information, "50" is probably a good '+"`maxFailedIterations` value. "+"If the schedules are not of infinite length, `maxFailedIterations` is ignored. "+"Note also that you can provide a `defaultMaxFailedIterations` number via "+"IntersectionOperator.defaultMaxFailedIterations.")}}}set($,ee){return new yv({maxFailedIterations:this.maxFailedIterations,streams:this.streams.map($=>$.set("timezone",ee))},Object.assign(Object.assign({},this.config),{base:this.config.base&&this.config.base.set("timezone",ee),timezone:ee}))}*_run($={}){const ee=this.streams.map(ee=>new hT(ee,$));if(this.config.base){ee.push(new hT(this.config.base,$))}if(ee.length===0)return;const et=!!(!this.isInfinite||$.reverse||$.end);if(!yw(ee,undefined,Object.assign(Object.assign({},$),{hasEndDate:et,iteration:0,maxIterations:this.maxFailedIterations}))){return}let en=hN(ee,$);while(en){const ei=yield this.normalizeRunOutput(en.value);const eo=en.value;if(!(ei===null||ei===void 0?void 0:ei.skipToDate)){en.next()}if(!yw(ee,eo,Object.assign(Object.assign({},$),{hasEndDate:et,iteration:0,maxIterations:this.maxFailedIterations}),ei)){return}en=hN(ee,$)}}calculateIsInfinite(){if(!this.config.base){if(this.streams.length===0)return false;return this.streams.every($=>$.isInfinite)}else if(this.streams.length===0)return this.config.base.isInfinite;return this.config.base.isInfinite&&this.streams.every($=>$.isInfinite)}calculateHasDuration(){const $=this.streams.every($=>$.hasDuration);if(!this.config.base)return $;return this.config.base.hasDuration&&$}}function yw($,ee,et,en){const ei=hN($,et,en);if(!ei)return false;if(ee&&ei.value.isEqual(ee))return true;if($.some($=>$.done))return false;if($.every($=>$.value.isEqual(ei.value)))return true;et.iteration++;if(et.maxIterations&&!et.hasEndDate&&et.iteration>et.maxIterations){return false}const eo=hD($,et);$.forEach($=>{if(eo.value.isEqual($.value))return;$.next({skipToDate:eo.value})});return yw($,ee,et)}class yE extends(null&&hT){constructor($,ee){super($,ee);this.workingValue=this.value;this.next()}}class yS extends(null&&Error){}function yT($){return ee=>new yO($,ee)}class yO extends(null&&hS){constructor($,ee){super([],ee);this.maxDuration=$.maxDuration;if(ee.base&&!ee.base.hasDuration){throw new ArgumentError("Base stream provided to MergeDurationOperator does not have an associated duration. "+"The MergeDurationOperator can only be used with streams which have a duration. ")}}set($,ee){return new yO({maxDuration:this.maxDuration},Object.assign(Object.assign({},this.config),{base:this.config.base&&this.config.base.set("timezone",ee),timezone:ee}))}_run($={}){return $.reverse?this.reverseRun($):this.forwardRun($)}calculateIsInfinite(){return!!(this.config.base&&this.config.base.isInfinite)}calculateHasDuration(){return true}*forwardRun($={}){if(!this.config.base)return;let ee=$.start;if($.start){ee=$.start.subtract(this.maxDuration,"millisecond")}let et=$.end;if($.end){et=$.end.add(this.maxDuration,"millisecond")}const en=new yE(this.config.base,Object.assign(Object.assign({},$),{start:ee,end:et}));let ei;while(en.workingValue){while(!en.done&&en.workingValue.end.isAfterOrEqual(en.value)){if(en.workingValue.duration>this.maxDuration){throw new yS(`MergeDurationOperatorError: Occurrence duration exceeded maxDuration of `+this.maxDuration)}if(en.value.end.isAfter(en.workingValue.end)){const $=en.value.end.valueOf()-en.workingValue.end.valueOf();en.workingValue=en.workingValue.set("duration",en.workingValue.duration+$)}en.next()}if($.start&&en.workingValue.end.isBefore($.start)){en.workingValue=en.value;en.next();continue}if((ei===null||ei===void 0?void 0:ei.skipToDate)&&en.workingValue.end.isBefore(ei.skipToDate)){en.workingValue=en.value;en.next();continue}if($.end&&en.workingValue&&en.workingValue.isAfter($.end)){break}if(en.workingValue.duration>this.maxDuration){throw new yS(`MergeDurationOperatorError: Occurrence duration exceeded maxDuration of `+this.maxDuration)}ei=yield this.normalizeRunOutput(en.workingValue);if((ei===null||ei===void 0?void 0:ei.skipToDate)&&en.workingValue.isAfterOrEqual(ei.skipToDate)){throw new Error("A provided `skipToDate` option must be greater than the last yielded date "+"(or smaller, in the case of reverse iteration)")}en.workingValue=en.value;en.next()}}*reverseRun($={}){if(!this.config.base)return;let ee=$.start;if($.start){ee=$.start.subtract(this.maxDuration,"millisecond")}let et=$.end;if($.end){et=$.end.add(this.maxDuration,"millisecond")}const en=new yE(this.config.base,Object.assign(Object.assign({},$),{start:ee,end:et}));let ei;while(en.workingValue){while(!en.done&&en.workingValue.isBeforeOrEqual(en.value.end)){if(en.workingValue.duration>this.maxDuration){throw new yS(`MergeDurationOperatorError: Occurrence duration exceeded maxDuration of `+this.maxDuration)}if(en.value.isBefore(en.workingValue)||en.value.end.isAfter(en.workingValue.end)){if(en.value.end.isAfter(en.workingValue.end)){en.workingValue=en.value}else{const $=en.workingValue.valueOf()-en.value.valueOf();en.workingValue=en.value.set("duration",en.workingValue.duration+$)}}en.next()}if($.start&&en.workingValue.end.isBefore($.start)){break}if(ei&&ei.skipToDate&&en.workingValue.end.isBefore(ei.skipToDate)){en.workingValue=en.value;en.next();continue}if($.end&&en.workingValue&&en.workingValue.isAfter($.end)){en.workingValue=en.value;en.next();continue}if(en.workingValue.duration>this.maxDuration){throw new yS(`MergeDurationOperatorError: Occurrence duration exceeded maxDuration of `+this.maxDuration)}ei=yield this.normalizeRunOutput(en.workingValue);if(ei&&ei.skipToDate&&en.workingValue.end.isBeforeOrEqual(ei.skipToDate)){throw new Error("A provided `skipToDate` option must be greater than the last yielded date "+"(or smaller, in the case of reverse iteration)")}en.workingValue=en.value;en.next()}}}class yA extends(null&&Error){}function yI($){return ee=>new yN($,ee)}class yN extends(null&&hS){constructor($,ee){super([],ee);this.splitFn=$.splitFn;this.maxDuration=$.maxDuration;if(ee.base&&!ee.base.hasDuration){throw new ArgumentError("Base stream provided to SplitDurationOperator does not have an associated duration. "+"The SplitDurationOperator can only be used with streams which have a duration.")}}set($,ee){return new yN({maxDuration:this.maxDuration,splitFn:this.splitFn},Object.assign(Object.assign({},this.config),{base:this.config.base&&this.config.base.set("timezone",ee),timezone:ee}))}*_run($={}){if(!this.config.base)return;const ee=$.reverse||false;let et=$.start;if($.start){et=$.start.subtract(this.maxDuration,"millisecond")}let en=$.end;if($.end){en=$.end.add(this.maxDuration,"millisecond")}const ei=new hT(this.config.base,Object.assign(Object.assign({},$),{start:et,end:en}));let eo;const es=[];while(!ei.done||es[0]&&es[0][0]){if(!(es[0]&&es[0][0])){es.push(this.splitDate(ei.value,ee));ei.next()}while(!ei.done&&(ee?es[0].some($=>$.isBeforeOrEqual(ei.value.end)):es[0].some($=>$.isAfterOrEqual(ei.value)))){es.push(this.splitDate(ei.value,ee));ei.next()}let et=es[0]&&es[0][0];let en=-1;let eu=0;let el=-1;let ef=0;for(const $ of es){en++;el=-1;for(const ei of $){el++;let $;if(ee){$=ei.isAfter(et)||ei.isEqual(et)&&ei.duration>et.duration}else{$=ei.isBefore(et)||ei.isEqual(et)&&ei.duration<et.duration}if($){et=ei;eu=en;ef=el;break}}}es[eu].splice(ef,1);if(es[eu].length===0){es.splice(eu,1)}if(eo&&eo.skipToDate&&et&&!yD(et,$)&&!yR(et,eo.skipToDate,$)){continue}if($.start&&et.end.isBefore($.start)){if(ee)break;continue}if($.end&&et.isAfter($.end)){if(ee)continue;break}if(et.duration>this.maxDuration){throw new yA(`SplitDurationOperatorError: Occurrence duration exceeded maxDuration of `+this.maxDuration)}eo=yield this.normalizeRunOutput(et);if(eo&&eo.skipToDate&&($.reverse?et.isBeforeOrEqual(eo.skipToDate):et.isAfterOrEqual(eo.skipToDate))){throw new Error("A provided `skipToDate` option must be greater than the last yielded date "+"(or smaller, in the case of reverse iteration)")}}}calculateIsInfinite(){return!!(this.config.base&&this.config.base.isInfinite)}calculateHasDuration(){return true}splitDate($,ee){const et=this.splitFn($);let en;if(et.length===0){en=false}else if(et.length===1){en=$.duration===et[0].duration}else{en=$.duration===et.reduce(($,ee)=>$+ee.duration,0)}if(!en){throw new Error("The provided SplitDurationOperator split function "+"must return an array of DateTimes with length > 0 "+"where the total duration of the new dates equals the duration of "+"the original date.")}et.sort(dateTimeSortComparer);if(ee){et.reverse()}return et}}function yD($,ee){return!!(ee.reverse?ee.start&&$.isBefore(ee.start):ee.end&&$.isAfter(ee.end))}function yR($,ee,et){return!!(et.reverse?ee.isAfterOrEqual($):ee.isBeforeOrEqual($))};class yC{constructor($){this.processor=$;this.start=$.start;this.end=$.end;this.options=$.options}}class yk extends yC{constructor($,ee){super($);this.initDate=ee;this.intervalUnit=ht(this.options.frequency);this.firstIntervalStartDate=this.normalizedStartDate(this.options.start);this.intervalStartDate=this.firstIntervalStartDate;this.intervalEndDate=this.normalizedEndDate(this.firstIntervalStartDate);this.skipToInterval(this.initDate)}run($){return this.validateDate(new hh($))}validateDate($){const{date:ee}=$;if($ instanceof hh&&this.dateIsWithinInterval(ee)){return $}this.skipToInterval(ee);return new hy(this.dateIsWithinInterval(ee)?ee:this.setToCurrentInterval())}setToCurrentInterval(){return this.intervalStartDate}normalizedStartDate($){if(this.options.frequency==="WEEKLY"){return $.granularity("week",{weekStart:this.options.weekStart})}return $.granularity(this.intervalUnit)}normalizedEndDate($){switch(this.options.frequency){case"YEARLY":return $.add(1,"year");case"MONTHLY":return $.add(1,"month");case"WEEKLY":return $.add(1,"week");case"DAILY":return $.add(1,"day");case"HOURLY":return $.add(1,"hour");case"MINUTELY":return $.add(1,"minute");case"SECONDLY":return $.add(1,"second");case"MILLISECONDLY":return $.add(1,"millisecond");default:throw new Error(`Unknown frequency ${this.options.frequency}`)}}skipToInterval($){const ee=this.intervalDifference($);this.intervalStartDate=this.firstIntervalStartDate.add(ee,this.intervalUnit);this.intervalEndDate=this.normalizedEndDate(this.intervalStartDate)}dateIsWithinInterval($){return this.intervalStartDate.isBeforeOrEqual($)&&this.intervalEndDate.isAfter($)}intervalDifference($){return yM({first:this.firstIntervalStartDate,second:$,unit:this.intervalUnit,interval:this.options.interval,weekStart:this.options.weekStart,direction:"after"})}}function yM({first:$,second:ee,unit:et,interval:en,weekStart:ei,direction:eo}){let es=(()=>{let en;let eo;switch(et){case"year":eo=(ee.get("year")-$.get("year"))*12;eo=eo+ee.get("month")-$.get("month");return Math.floor(eo/12);case"month":eo=(ee.get("year")-$.get("year"))*12;eo=eo+ee.get("month")-$.get("month");return eo;case"week":$=$.granularity("week",{weekStart:ei});en=pA.MILLISECONDS_IN_WEEK;break;case"day":en=pA.MILLISECONDS_IN_DAY;break;case"hour":en=pA.MILLISECONDS_IN_HOUR;break;case"minute":en=pA.MILLISECONDS_IN_MINUTE;break;case"second":en=pA.MILLISECONDS_IN_SECOND;break;case"millisecond":en=1;break;default:throw new Error("Unexpected `unit` value")}const es=ee.valueOf()-$.valueOf();return Math.floor(es/en)})();const eu=eo==="after"?Math.ceil:Math.floor;es=eu(es/en)*en;return es}class yL extends yk{setToCurrentInterval(){return this.intervalEndDate.subtract(1,"millisecond")}intervalDifference($){return yM({first:this.firstIntervalStartDate,second:$,unit:this.intervalUnit,interval:this.options.interval,weekStart:this.options.weekStart,direction:"before"})}}const yx=["MILLISECONDLY","SECONDLY","MINUTELY","HOURLY","DAILY","WEEKLY","MONTHLY","YEARLY"];const yP={name:"FrequencyRule",get:$=>{if($.options.byMillisecondOfSecond!==undefined||$.options.frequency!=="MILLISECONDLY"){return null}if($.reverse)return new yL($,$.end);return new yk($,$.start)},normalizeOptions:($,ee)=>{if(!yx.includes($.frequency)){throw new hu(`"frequency" must be one of ${JSON.stringify(yx)}`)}if($.interval!==undefined){if(!Number.isInteger($.interval)){throw new hu('"interval" expects a whole number')}if($.interval<1){throw new hu('"interval" cannot be less than 1')}}if($.weekStart!==undefined){if(!pA.WEEKDAYS.includes($.weekStart)){throw new hu(`"weekStart" must be one of ${JSON.stringify(pA.WEEKDAYS)}`)}}ee.frequency=$.frequency;ee.interval=$.interval||1;ee.weekStart=$.weekStart||"MO"},deps:()=>[yP]};function yF($){return Array.isArray($)&&$.length>0}const yB=new WeakMap;class yU extends yC{constructor($){super($);if(!yB.has(this.processor)){yB.set(this.processor,new yk($,$.start))}this.frequency=yB.get(this.processor)}validateDate($){return this.frequency.validateDate($)}}class yj extends yC{constructor($){super($);if(!yB.has(this.processor)){yB.set(this.processor,new yL($,$.end))}this.frequency=yB.get(this.processor)}validateDate($){return this.frequency.validateDate($)}}class yW extends yj{run($){const ee=$.get(this.granularity);for(const et of this.option){if(ee<et)continue;if(ee===et){return this.validateDate(new hh($))}return this.validateDate(new hy($.endGranularity(this.baseGranularity).set(this.granularity,et)))}return this.validateDate(new hy($.endGranularity(this.baseGranularity).subtract(1,this.baseGranularity).set(this.granularity,this.option[0])))}}class yH extends yW{constructor(){super(...arguments);this.baseGranularity="second";this.granularity="millisecond";this.option=this.options.byMillisecondOfSecond.slice().reverse()}}class yz extends yU{run($){const ee=$.get(this.granularity);for(const et of this.option){if(ee>et)continue;if(ee===et){return this.validateDate(new hh($))}return this.validateDate(new hy($.granularity(this.baseGranularity).set(this.granularity,et)))}return this.validateDate(new hy($.granularity(this.baseGranularity).add(1,this.baseGranularity).set(this.granularity,this.option[0])))}}class yV extends yz{constructor(){super(...arguments);this.baseGranularity="second";this.granularity="millisecond";this.option=this.options.byMillisecondOfSecond}}const y$={name:"ByMillisecondOfSecond",get:$=>{if($.options.byMillisecondOfSecond===undefined)return null;if($.reverse)return new yH($);return new yV($)},normalizeOptions:($,ee)=>{if($.byMillisecondOfSecond!==undefined){if(!yF($.byMillisecondOfSecond)){throw new hu('"byMillisecondOfSecond" expects a non-empty array')}if($.byMillisecondOfSecond.some($=>$<0||$>999)){throw new hu('"byMillisecondOfSecond" values must be >= 0 && <= 999')}ee.byMillisecondOfSecond=$.byMillisecondOfSecond;ee.byMillisecondOfSecond.sort(he)}else if($.frequency!=="MILLISECONDLY"){ee.byMillisecondOfSecond=[ee.start.get("millisecond")]}},deps:()=>[yP,y$]};class yq extends yW{constructor(){super(...arguments);this.baseGranularity="minute";this.granularity="second";this.option=this.options.bySecondOfMinute.slice().reverse()}}class yG extends yz{constructor(){super(...arguments);this.baseGranularity="minute";this.granularity="second";this.option=this.options.bySecondOfMinute}}const yY={name:"BySecondOfMinute",get:$=>{if($.options.bySecondOfMinute===undefined)return null;if($.reverse)return new yq($);return new yG($)},normalizeOptions:($,ee)=>{if($.bySecondOfMinute!==undefined){if(!yF($.bySecondOfMinute)){throw new hu('"bySecondOfMinute" expects a non-empty array')}if($.bySecondOfMinute.some($=>$<0||$>60)){throw new hu('"bySecondOfMinute" values must be >= 0 && <= 60')}ee.bySecondOfMinute=$.bySecondOfMinute;ee.bySecondOfMinute.sort(he)}else if(!["SECONDLY","MILLISECONDLY"].includes($.frequency)){ee.bySecondOfMinute=[ee.start.get("second")]}},deps:()=>[yP,yY,y$]};class yK extends yW{constructor(){super(...arguments);this.baseGranularity="hour";this.granularity="minute";this.option=this.options.byMinuteOfHour.slice().reverse()}}class yZ extends yz{constructor(){super(...arguments);this.baseGranularity="hour";this.granularity="minute";this.option=this.options.byMinuteOfHour}}const yJ={name:"ByMinuteOfHour",get:$=>{if($.options.byMinuteOfHour===undefined)return null;if($.reverse)return new yK($);return new yZ($)},normalizeOptions:($,ee)=>{if($.byMinuteOfHour!==undefined){if(!yF($.byMinuteOfHour)){throw new hu('"byMinuteOfHour" expects a non-empty array')}if($.byMinuteOfHour.some($=>$<0||$>59)){throw new hu('"byMinuteOfHour" values must be >= 0 && <= 59')}ee.byMinuteOfHour=$.byMinuteOfHour;ee.byMinuteOfHour.sort(he)}else if(!["MINUTELY","SECONDLY","MILLISECONDLY"].includes($.frequency)){ee.byMinuteOfHour=[ee.start.get("minute")]}},deps:()=>[yP,yJ,yY,y$]};class yX extends yW{constructor(){super(...arguments);this.baseGranularity="day";this.granularity="hour";this.option=this.options.byHourOfDay.slice().reverse()}}class yQ extends yz{constructor(){super(...arguments);this.baseGranularity="day";this.granularity="hour";this.option=this.options.byHourOfDay}}const y0={name:"ByHourOfDay",get:$=>{if($.options.byHourOfDay===undefined)return null;if($.reverse)return new yX($);return new yQ($)},normalizeOptions:($,ee)=>{if($.byHourOfDay!==undefined){if(!yF($.byHourOfDay)){throw new hu('"byHourOfDay" expects a non-empty array')}if($.byHourOfDay.some($=>$<0||$>23)){throw new hu('"byHourOfDay" values must be >= 0 && <= 23')}ee.byHourOfDay=$.byHourOfDay;ee.byHourOfDay.sort(he)}else if(["YEARLY","MONTHLY","WEEKLY","DAILY"].includes($.frequency)){ee.byHourOfDay=[ee.start.get("hour")]}},deps:()=>[yP,y0,yJ,yY,y$]};function y1($,ee){return $.add(pP($.get("weekday"),ee),"day")}function y2($,ee,et){let en=$.set("day",1);if(et<0){en=en.add(1,"month")}en=y1(en,ee);return et<0?en.add(et,"week"):en.add(et-1,"week")}class y6 extends yU{run($){const ee=y4($,this.options.byDayOfMonth,this.options.byDayOfWeek);const et=$.get("day");for(const en of ee){if(et>en)continue;if(et===en){return this.validateDate(new hh($))}return this.validateDate(new hy($.granularity("month").set("day",en)))}let en;let ei=$;let eo=0;while(!en&&eo<30){ei=ei.granularity("month").add(1,"month");en=y4(ei,this.options.byDayOfMonth,this.options.byDayOfWeek)[0];eo++}if(eo>=13){throw new hp("byDayOfMonth Infinite while loop")}return this.validateDate(new hy(ei.set("day",en)))}}function y4($,ee,et){const en=$.endGranularity("month").get("day");let ei=ee.filter($=>en>=Math.abs($)).map($=>$>0?$:en+$+1);if(et){const ee=$.granularity("month");const en=[];et.forEach(et=>{if(typeof et==="string"){en.push(...ei.filter($=>ee.set("day",$).get("weekday")===et));return}const eo=y2($,...et).get("day");if(ei.includes(eo)){en.push(eo)}});ei=Array.from(new Set(en))}return ei.sort(($,ee)=>{if($>ee)return 1;if($<ee)return-1;else return 0})}class y3 extends yj{run($){const ee=y4($,this.options.byDayOfMonth,this.options.byDayOfWeek).reverse();const et=$.get("day");for(const en of ee){if(et<en)continue;if(et===en){return this.validateDate(new hh($))}return this.validateDate(new hy($.endGranularity("month").set("day",en)))}let en;let ei=$;let eo=0;while(!en&&eo<30){ei=ei.endGranularity("month").subtract(1,"month");en=y4(ei,this.options.byDayOfMonth,this.options.byDayOfWeek).pop();eo++}if(eo>=13){throw new hp("byDayOfMonth Infinite while loop")}return this.validateDate(new hy(ei.set("day",en)))}}const y8={name:"ByDayOfMonth",get:$=>{if($.options.byDayOfMonth===undefined)return null;if($.reverse)return new y3($);return new y6($)},normalizeOptions:($,ee)=>{if($.byDayOfMonth!==undefined){if($.frequency==="WEEKLY"){throw new hu('when "frequency" is "WEEKLY", "byDayOfMonth" cannot be present')}if(!yF($.byDayOfMonth)){throw new hu('"byDayOfMonth" expects a non-empty array')}if($.byDayOfMonth.some($=>$===0||$<-31||$>31)){throw new hu('"byDayOfMonth" values must be `num !== 0 && num <= 31 && num >= -31`')}ee.byDayOfMonth=$.byDayOfMonth.slice()}else if(!(yF($.byDayOfWeek)||yF($.byDayOfYear))&&["YEARLY","MONTHLY"].includes($.frequency)){ee.byDayOfMonth=[ee.start.get("day")]}},deps:()=>[yP,y8,y0,yJ,yY,y$]};function y5($,ee,et){let en=$.set("month",1).set("day",1);if(et<0){en=en.add(1,"year")}en=y1(en,ee);return et<0?en.add(et,"week"):en.add(et-1,"week")}function y9($,ee){const et=pP($.get("weekday"),ee);return $.subtract(et===0?0:7-et,"day")}class y7 extends yj{run($){if(this.options.frequency==="YEARLY"){return this.options.byMonthOfYear===undefined?this.expandYearly($):this.expandMonthly($)}else if(this.options.frequency==="MONTHLY"){return this.expandMonthly($)}return this.expand($)}expandYearly($){let ee=ge($,this.options.byDayOfWeek)[0];let et=0;let en=$;while(!ee&&et<28){et++;en=en.granularity("year").subtract(1,"millisecond");ee=ge(en,this.options.byDayOfWeek)[0]}if(!ee){throw new hp("The byDayOfWeek rule appears to contain an impossible combination")}return this.result($,ee)}expandMonthly($){let ee=gt($,this.options.byDayOfWeek)[0];let et=0;let en=$;while(!ee&&et<50){et++;en=en.granularity("month").subtract(1,"millisecond");ee=gt(en,this.options.byDayOfWeek)[0]}if(!ee){throw new hp("The byDayOfWeek rule appears to contain an impossible combination")}return this.result($,ee)}expand($){const ee=this.options.byDayOfWeek.map(ee=>y9($,ee)).sort(pk).pop();return this.result($,ee)}result($,ee){if(ee.isEqual($)){return this.validateDate(new hh($))}return this.validateDate(new hy(ee.endGranularity("day")))}}function ge($,ee){const et=ee.filter($=>Array.isArray($)).map(ee=>y5($,...ee));const en=ee.filter($=>typeof $==="string").map(ee=>y9($,ee)).filter(ee=>ee.get("year")===$.get("year"));return pM([...et,...en]).filter(ee=>ee.isBeforeOrEqual($)).sort(pk).reverse()}function gt($,ee){const et=ee.filter($=>Array.isArray($)).map(ee=>y2($,...ee));const en=ee.filter($=>typeof $==="string").map(ee=>y9($,ee)).filter(ee=>ee.get("year")===$.get("year")&&ee.get("month")===$.get("month"));return pM([...et,...en]).filter(ee=>ee.isBeforeOrEqual($)).sort(pk).reverse()}class gr extends yU{run($){if(this.options.frequency==="YEARLY"){return this.options.byMonthOfYear===undefined?this.expandYearly($):this.expandMonthly($)}else if(this.options.frequency==="MONTHLY"){return this.expandMonthly($)}return this.expand($)}expandYearly($){let ee=gn($,this.options.byDayOfWeek)[0];let et=0;let en=$;while(!ee&&et<28){et++;en=en.granularity("year").add(1,"year");ee=gn(en,this.options.byDayOfWeek)[0]}if(!ee){throw new hp("The byDayOfWeek rule appears to contain an impossible combination")}return this.result($,ee)}expandMonthly($){let ee=gi($,this.options.byDayOfWeek)[0];let et=0;let en=$;while(!ee&&et<50){et++;en=en.granularity("month").add(1,"month");ee=gi(en,this.options.byDayOfWeek)[0]}if(!ee){throw new hp("The byDayOfWeek rule appears to contain an impossible combination")}return this.result($,ee)}expand($){const ee=this.options.byDayOfWeek.map(ee=>y1($,ee)).sort(pk)[0];return this.result($,ee)}result($,ee){if(ee.isEqual($)){return this.validateDate(new hh($))}return this.validateDate(new hy(ee.granularity("day")))}}function gn($,ee){const et=ee.filter($=>Array.isArray($)).map(ee=>y5($,...ee));const en=ee.filter($=>typeof $==="string").map(ee=>y1($,ee)).filter(ee=>ee.get("year")===$.get("year"));return pM([...et,...en]).filter(ee=>ee.isAfterOrEqual($)).sort(pk)}function gi($,ee){const et=ee.filter($=>Array.isArray($)).map(ee=>y2($,...ee));const en=ee.filter($=>typeof $==="string").map(ee=>y1($,ee)).filter(ee=>ee.get("year")===$.get("year")&&ee.get("month")===$.get("month"));return pM([...et,...en]).filter(ee=>ee.isAfterOrEqual($)).sort(pk)}const ga={name:"ByDayOfWeek",get:$=>{if($.options.byDayOfWeek===undefined)return null;if($.reverse)return new y7($);return new gr($)},normalizeOptions:($,ee)=>{if($.byDayOfWeek!==undefined){if(!yF($.byDayOfWeek)){throw new hu('"byDayOfWeek" expects a non-empty array')}const et=$.byDayOfWeek.find($=>Array.isArray($)?!pA.WEEKDAYS.includes($[0]):!pA.WEEKDAYS.includes($));if(et){throw new hu(`"byDayOfWeek" expects weedays in the form `+`${JSON.stringify(pA.WEEKDAYS)} but "${et}" was provided`)}if(!["YEARLY","MONTHLY"].includes($.frequency)&&$.byDayOfWeek.some($=>Array.isArray($))){throw new hu('"byDayOfWeek" can only include a numeric value (i.e. `[string, number]`) when the "frequency" is '+'either "MONTHLY" or "YEARLY"')}if($.frequency==="MONTHLY"&&$.byDayOfWeek.some($=>Array.isArray($)&&($[1]<-31||$[1]===0||$[1]>31))){throw new hu('when "frequency" is "MONTHLY", each "byDayOfWeek" can optionally only'+" have a numeric value >= -31 and <= 31 and !== 0")}if($.frequency==="YEARLY"&&$.byDayOfWeek.some($=>Array.isArray($)&&($[1]<-366||$[1]===0||$[1]>366))){throw new hu('when "frequency" is "YEARLY", each "byDayOfWeek" can optionally only'+" have a numeric value >= -366 and <= 366 and !== 0")}ee.byDayOfWeek=$.byDayOfWeek}else if(!yF($.byDayOfMonth)&&$.frequency==="WEEKLY"){ee.byDayOfWeek=[ee.start.get("weekday")]}},deps:()=>[yP,ga,y0,yJ,yY,y$]};class go extends yj{constructor(){super(...arguments);this.option=this.processor.options.byMonthOfYear.slice().reverse()}run($){const ee=$.get("month");for(const et of this.option){if(ee<et)continue;if(ee===et){return this.validateDate(new hh($))}return this.validateDate(new hy($.endGranularity("year").set("month",et)))}return this.validateDate(new hy($.endGranularity("year").subtract(1,"year").set("month",this.option[0])))}}class gs extends yU{run($){const ee=$.get("month");for(const et of this.options.byMonthOfYear){if(ee>et)continue;if(ee===et){return this.validateDate(new hh($))}return this.validateDate(new hy($.granularity("year").set("month",et)))}return this.validateDate(new hy($.granularity("year").add(1,"year").set("month",this.options.byMonthOfYear[0])))}}const gu={name:"ByMonthOfYear",get:$=>{if($.options.byMonthOfYear===undefined)return null;if($.reverse){return new go($)}return new gs($)},normalizeOptions:($,ee)=>{if($.byMonthOfYear!==undefined){if(!yF($.byMonthOfYear)){throw new hu('"byMonthOfYear" expects a non-empty array')}if($.byMonthOfYear.some($=>$<1||$>12)){throw new hu('"byMonthOfYear" values must be `num >= 1 && num >= 12`')}ee.byMonthOfYear=$.byMonthOfYear.slice();ee.byMonthOfYear.sort(he)}else if(!(yF($.byDayOfMonth)||yF($.byDayOfWeek)||yF($.byDayOfYear))&&$.frequency==="YEARLY"){ee.byMonthOfYear=[ee.start.get("month")]}},deps:()=>[yP,gu,y8,y0,yJ,yY,y$]};const gl=[yP,gu,y8,ga,y0,yJ,yY,y$];class gf extends pT{constructor($,ee={}){super(undefined,ee);if(!["UTC",null,undefined].includes(ee.timezone)){throw new pE(`StandardDateAdapter only supports "UTC" and `+`local time zones but "${ee.timezone}" was provided.`)}this._date=new Date($);this.timezone=ee.timezone!==undefined?ee.timezone:null;if(ee.metadata){Object.assign(this.metadata,ee.metadata)}this.assertIsValid()}static isDate($){return Object.prototype.toString.call($)==="[object Date]"}static fromDate($,ee){return new gf($,ee)}static fromJSON($){const ee=[$.year,$.month-1,$.day,$.hour,$.minute,$.second,$.millisecond];let et;switch($.timezone){case"UTC":{et=new gf(new Date(Date.UTC(...ee)),{timezone:"UTC",duration:$.duration});break}case null:{et=new gf(new Date(...ee),{timezone:null,duration:$.duration});break}default:throw new pE("The `StandardDateAdapter` only supports datetimes in "+`UTC or LOCAL (null) time. You provided a JSON object `+`with timezone "${$.timezone}".`)}if($.metadata){Object.assign(et.metadata,$.metadata)}return et}static fromDateTime($){const ee=gf.fromJSON($.toJSON());ee.generators.push(...$.generators);if($.metadata){Object.assign(ee.metadata,$.metadata)}return ee}get date(){return new Date(this._date)}get end(){if(!this.duration)return;if(this._end)return this._end;this._end=gf.fromDateTime(this.toDateTime().add(this.duration,"millisecond")).date;return this._end}set($,ee){if($==="timezone"){if(this.timezone===ee)return this;else{return new gf(this._date,{timezone:ee,duration:this.duration,generators:this.generators})}}else if($==="duration"){if(this.duration===ee)return this;else{return new gf(this._date,{timezone:this.timezone,duration:ee,generators:this.generators})}}throw new p9(`Unknown prop "${$}" for StandardDateAdapter#set()`)}valueOf(){return this._date.valueOf()}toJSON(){let $;if(this.timezone==="UTC"){$={timezone:this.timezone,year:this._date.getUTCFullYear(),month:this._date.getUTCMonth()+1,day:this._date.getUTCDate(),hour:this._date.getUTCHours(),minute:this._date.getUTCMinutes(),second:this._date.getUTCSeconds(),millisecond:this._date.getUTCMilliseconds()}}else{$={timezone:this.timezone,year:this._date.getFullYear(),month:this._date.getMonth()+1,day:this._date.getDate(),hour:this._date.getHours(),minute:this._date.getMinutes(),second:this._date.getSeconds(),millisecond:this._date.getMilliseconds()}}if(this.duration){$.duration=this.duration}return $}assertIsValid(){if(!gf.isDate(this._date)||isNaN(this._date.valueOf())){throw new pE("StandardDateAdapter has invalid date.")}else if(![null,"UTC"].includes(this.timezone)){throw new pE("StandardDateAdapter only supports local (null) and UTC timezones but "+`"${this.timezone}" was specified.`)}else if(this.duration&&this.duration<=0){throw new pE("If provided, duration must be greater than 0.")}return true}}gf.hasTimezoneSupport=false;pT.adapter=gf;yl.recurrenceRules=gl;class gd extends Error{}class gp extends Error{}h_.JSON_FN_MAP=new Map;h_.prototype.toJSON=function $($){throw new gp(`To support smaller bundles, ${this.constructor.name}#toJSON() `+`must be manually added. See "@rschedule/json-tools" in the rSchedule docs.`)};h_.fromJSON=function $($,ee){if(typeof $!=="object"||$===null){throw new gd(`Invalid json "${$}"`)}const et=h_.JSON_FN_MAP.get($.type);if(!et){throw new gd(`Unknown rSchedule object type "${$.type}". Have you added a json serializer `+`for "${$.type}"? `+`See "@rschedule/json-tools" in the rSchedule docs.`)}return et($,ee)};function gh($,ee,et){if(!et.data)return;if(et.data===true){ee.data=$.data}else{ee.data=et.data($)}if(ee.data===undefined)delete ee.data}function gy($,ee){h_.JSON_FN_MAP.set($,ee)};hM.prototype.toJSON=function $($={}){const ee={type:"Dates",dates:this.adapters.map($=>$.toJSON())};if(!$.nested)ee.timezone=this.timezone;gh(this,ee,$);return ee};hM.fromJSON=function $($,ee={}){if($.type!=="Dates"){throw new gd("Invalid Dates JSON")}return new hM({dates:$.dates.map($=>pT.adapter.fromJSON($)),data:typeof ee.data==="function"?ee.data($):$.data,timezone:ee.timezone||$.timezone})};gy("Dates",hM.fromJSON);yl.prototype.toJSON=function $($={}){const ee={type:"Rule",config:Object.assign(Object.assign({},hr(this.options)),{start:this.normalizeDateInput(this.options.start).toJSON()})};if(this.options.end){ee.config.end=this.normalizeDateInput(this.options.end).toJSON()}if(!$.nested)ee.timezone=this.timezone;gh(this,ee,$);return ee};yl.fromJSON=function $($,ee={}){const et=Object.assign(Object.assign({},$.config),{start:pT.adapter.fromJSON($.config.start),end:$.config.end&&pT.adapter.fromJSON($.config.end)});return new yl(et,{data:typeof ee.data==="function"?ee.data($):$.data,timezone:ee.timezone||$.timezone})};gy("Rule",yl.fromJSON);ym.prototype.toJSON=function $($={}){const ee={type:"Schedule",rrules:this.rrules.map(ee=>ee.toJSON(Object.assign(Object.assign({},$),{nested:true}))),exrules:this.exrules.map(ee=>ee.toJSON(Object.assign(Object.assign({},$),{nested:true}))),rdates:this.rdates.toJSON(Object.assign(Object.assign({},$),{nested:true})),exdates:this.exdates.toJSON(Object.assign(Object.assign({},$),{nested:true}))};if(!$.nested)ee.timezone=this.timezone;gh(this,ee,$);return ee};ym.fromJSON=function $($,ee={}){if($.type!=="Schedule"){throw new gd("Invalid Schedule JSON")}return new ym({rrules:$.rrules.map(et=>yl.fromJSON(et,Object.assign({timezone:$.timezone},ee))),exrules:$.exrules.map(et=>yl.fromJSON(et,Object.assign({timezone:$.timezone},ee))),rdates:hM.fromJSON($.rdates,Object.assign({timezone:$.timezone},ee)),exdates:hM.fromJSON($.exdates,Object.assign({timezone:$.timezone},ee)),data:typeof ee.data==="function"?ee.data($):$.data,timezone:ee.timezone||$.timezone})};gy("Schedule",ym.fromJSON);;function gg($,ee,et){if(!$){throw new lG(ee,et)}}function gm($){try{let ee=pg($);return{type:"recur",schedule:new ym({rrules:ee,data:{skipWeekend:$.skipWeekend,weekendSolve:$.weekendSolveMode}})}}catch($){throw new lG("parse-recur-date",$.message)}}function g_($){if(typeof $!=="string"){return null}else if($.length===10){if(!eA(rv($))){return null}return{type:"date",date:$}}else if($.length===7){if(!eA(rv($+"-01"))){return null}return{type:"month",date:$}}else if($.length===4){if(!eA(rv($+"-01-01"))){return null}return{type:"year",date:$}}return null}function gv($){let{num1:ee,num2:et}=$;if(typeof ee!=="number"||typeof et!=="number"){return null}return{type:"between",num1:ee,num2:et}}let gw={date:{ops:["is","isapprox","gt","gte","lt","lte"],nullable:false,parse($,ee,et){let en=typeof ee==="string"?g_(ee):ee.frequency!=null?gm(ee):null;gg(en,"date-format",`Invalid date format (field: ${et})`);if($==="isapprox"){gg(en.type==="date"||en.type==="recur","date-format",`Invalid date value for “isapprox” (field: ${et})`)}else if($==="gt"||$==="gte"||$==="lt"||$==="lte"){gg(en.type==="date","date-format",`Invalid date value for “${$}” (field: ${et})`)}return en}},id:{ops:["is","contains","oneOf","isNot","doesNotContain","notOneOf"],nullable:true,parse($,ee,et){if($==="oneOf"||$==="notOneOf"){gg(Array.isArray(ee),"no-empty-array",`oneOf must have an array value (field: ${et})`);return ee}return ee}},string:{ops:["is","contains","oneOf","isNot","doesNotContain","notOneOf"],nullable:true,parse($,ee,et){if($==="oneOf"||$==="notOneOf"){gg(Array.isArray(ee),"no-empty-array",`oneOf must have an array value (field: ${et}): ${JSON.stringify(ee)}`);return ee.filter(Boolean).map($=>$.toLowerCase())}if($==="contains"||$==="doesNotContain"){gg(typeof ee==="string"&&ee.length>0,"no-empty-string",`contains must have non-empty string (field: ${et})`)}return ee.toLowerCase()}},number:{ops:["is","isapprox","isbetween","gt","gte","lt","lte"],nullable:false,parse($,ee,et){let en=typeof ee==="number"?{type:"literal",value:ee}:gv(ee);gg(en!=null,"not-number",`Value must be a number or between amount: ${JSON.stringify(ee)} (field: ${et})`);if($==="isbetween"){gg(en.type==="between","number-format",`Invalid between value for “${$}” (field: ${et})`)}else{gg(en.type==="literal","number-format",`Invalid number value for “${$}” (field: ${et})`)}return en}},boolean:{ops:["is"],nullable:false,parse($,ee,et){gg(typeof ee==="boolean","not-boolean",`Value must be a boolean: ${ee} (field: ${et})`);return ee}}};class gE{field;op;options;rawValue;type;unparsedValue;value;constructor($,ee,et,en,ei){let eo=ei.get(ee);gg(eo,"internal","Invalid condition field: "+ee);let es=gw[eo];gg(es,"internal",`Invalid condition type: ${eo} (field: ${ee})`);gg(es.ops.includes($),"internal",`Invalid condition operator: ${$} (type: ${eo}, field: ${ee})`);if(es.nullable!==true){gg(et!=null,"no-null",`Field cannot be empty: ${ee}`)}if(eo==="string"&&es.nullable!==true){gg(et!=="","no-null",`Field cannot be empty: ${ee}`)}this.rawValue=et;this.unparsedValue=et;this.op=$;this.field=ee;this.value=es.parse?es.parse($,et,ee):et;this.options=en;this.type=eo}eval($){let ee=$[this.field];if(ee===undefined){return false}if(typeof ee==="string"){ee=ee.toLowerCase()}let et=this.type;if(et==="number"&&this.options){if(this.options.outflow){if(ee>0){return false}ee=-ee}else if(this.options.inflow){if(ee<0){return false}}}let en=$=>et==="number"?$.value:$;switch(this.op){case"isapprox":case"is":if(et==="date"){if(ee==null){return false}if(this.value.type==="recur"){let{schedule:$}=this.value;if(this.op==="isapprox"){let et=nT(ee);return $.occursBetween(nt(et,2),r9(et,2))}else{return $.occursOn({date:nT(ee)})}}else{let{date:$}=this.value;if(this.op==="isapprox"){let et=nT($);let en=nF(et,2);let ei=nB(et,2);return ee>=ei&&ee<=en}else{switch(this.value.type){case"date":return ee===$;case"month":return nA(ee)===$;case"year":return nO(ee)===$;default:}}}}else if(et==="number"){let $=this.value.value;if(this.op==="isapprox"){let et=pn($);return ee>=$-et&&ee<=$+et}return ee===$}return ee===this.value;case"isNot":return ee!==this.value;case"isbetween":{let[$,et]=d9(this.value.num1,this.value.num2);return ee>=$&&ee<=et}case"contains":if(ee===null){return false}return ee.indexOf(this.value)!==-1;case"doesNotContain":if(ee===null){return false}return ee.indexOf(this.value)===-1;case"oneOf":if(ee===null){return false}return this.value.indexOf(ee)!==-1;case"notOneOf":if(ee===null){return false}return this.value.indexOf(ee)===-1;case"gt":if(ee===null){return false}else if(et==="date"){return nj(ee,this.value.date)}return ee>en(this.value);case"gte":if(ee===null){return false}else if(et==="date"){return ee===this.value.date||nj(ee,this.value.date)}return ee>=en(this.value);case"lt":if(ee===null){return false}else if(et==="date"){return nU(ee,this.value.date)}return ee<en(this.value);case"lte":if(ee===null){return false}else if(et==="date"){return ee===this.value.date||nU(ee,this.value.date)}return ee<=en(this.value);default:}return false}getValue(){return this.value}serialize(){return{op:this.op,field:this.field,value:this.unparsedValue,type:this.type,...this.options?{options:this.options}:null}}}let gS=["set","link-schedule"];class gT{field;op;options;rawValue;type;value;constructor($,ee,et,en,ei){gg(gS.includes($),"internal",`Invalid action operation: ${$}`);if($==="set"){let $=ei.get(ee);gg($,"internal",`Invalid field for action: ${ee}`);this.field=ee;this.type=$}else if($==="link-schedule"){this.field=null;this.type="id"}this.op=$;this.rawValue=et;this.value=et;this.options=en}exec($){switch(this.op){case"set":$[this.field]=this.value;break;case"link-schedule":$.schedule=this.value;break;default:}}serialize(){return{op:this.op,field:this.field,value:this.value,type:this.type,...this.options?{options:this.options}:null}}}class gO{actions;conditions;conditionsOp;id;stage;constructor({id:$,stage:ee,conditionsOp:et,conditions:en,actions:ei,fieldTypes:eo}){this.id=$;this.stage=ee;this.conditionsOp=et;this.conditions=en.map($=>new gE($.op,$.field,$.value,$.options,eo));this.actions=ei.map($=>new gT($.op,$.field,$.value,$.options,eo))}evalConditions($){if(this.conditions.length===0){return false}const ee=this.conditionsOp==="or"?"some":"every";return this.conditions[ee](ee=>{return ee.eval($)})}execActions($){let ee={};this.actions.forEach($=>$.exec(ee));return ee}exec($){if(this.evalConditions($)){return this.execActions($)}return null}apply($){let ee=this.exec($);return Object.assign({},$,ee)}getId(){return this.id}serialize(){return{id:this.id,stage:this.stage,conditionsOp:this.conditionsOp,conditions:this.conditions.map($=>$.serialize()),actions:this.actions.map($=>$.serialize())}}}class gA{field;method;rules;constructor({field:$,method:ee}){this.field=$;this.method=ee;this.rules=new Map}getIndex($){if(!this.rules.has($)){this.rules.set($,new Set)}return this.rules.get($)}getIndexForValue($){return this.getIndex(this.getKey($)||"*")}getKey($){if(typeof $==="string"&&$!==""){if(this.method==="firstchar"){return $[0].toLowerCase()}return $.toLowerCase()}return null}getIndexes($){let ee=$.conditions.find($=>$.field===this.field);let et=[];if(ee&&(ee.op==="oneOf"||ee.op==="is"||ee.op==="isNot"||ee.op==="notOneOf")){if(ee.op==="oneOf"||ee.op==="notOneOf"){ee.value.forEach($=>et.push(this.getIndexForValue($)))}else{et.push(this.getIndexForValue(ee.value))}}else{et.push(this.getIndex("*"))}return et}index($){let ee=this.getIndexes($);ee.forEach(ee=>{ee.add($)})}remove($){let ee=this.getIndexes($);ee.forEach(ee=>{ee.delete($)})}getApplicableRules($){let ee;if(this.field in $){let et=this.getKey($[this.field]);if(et){ee=this.rules.get(et)}}return im(ee||new Set,this.rules.get("*")||new Set)}}const gI={is:10,oneOf:9,isapprox:5,isbetween:5,gt:1,gte:1,lt:1,lte:1,contains:0};function gN($){let ee=$.conditions.reduce(($,ee)=>{if(gI[ee.op]==null){console.log(`Found invalid operation while ranking: ${ee.op}`);return 0}return $+gI[ee.op]},0);if($.conditions.every($=>$.op==="is"||$.op==="isNot"||$.op==="isapprox"||$.op==="oneOf"||$.op==="notOneOf")){return ee*2}return ee}function gD($){let ee=new Map;$.forEach($=>{ee.set($,gN($))});return[...$].sort(($,et)=>{let en=ee.get($);let ei=ee.get(et);if(en<ei){return-1}else if(en>ei){return 1}else{let ee=$.getId();let en=et.getId();return ee<en?-1:ee>en?1:0}})}function gR($){let ee=[];let et=[];let en=[];for(let ei of $){switch(ei.stage){case"pre":ee.push(ei);break;case"post":en.push(ei);break;default:et.push(ei)}}ee=gD(ee);et=gD(et);en=gD(en);return ee.concat(et).concat(en)}function gC($,ee){for(let et=0;et<$.conditions.length;et++){let en=$.conditions[et];if(en.type==="id"){switch(en.op){case"is":en.value=ee.get(en.rawValue)||en.rawValue;en.unparsedValue=en.value;break;case"isNot":en.value=ee.get(en.rawValue)||en.rawValue;en.unparsedValue=en.value;break;case"oneOf":en.value=en.rawValue.map($=>ee.get($)||$);en.unparsedValue=[...en.value];break;case"notOneOf":en.value=en.rawValue.map($=>ee.get($)||$);en.unparsedValue=[...en.value];break;default:}}}for(let et=0;et<$.actions.length;et++){let en=$.actions[et];if(en.type==="id"){if(en.op==="set"){en.value=ee.get(en.rawValue)||en.rawValue}}}}function gk($,ee,et){let en;s:for(en=0;en<$.length;en++){let ei=$[en];for(let $=0;$<ei.conditions.length;$++){let en=ei.conditions[$];if(en.type==="id"&&en.field===ee){switch(en.op){case"is":if(et(ei,en.value)){continue s}break;case"isNot":if(et(ei,en.value)){continue s}break;case"oneOf":for(let $=0;$<en.value.length;$++){if(et(ei,en.value[$])){continue s}}break;case"notOneOf":for(let $=0;$<en.value.length;$++){if(et(ei,en.value[$])){continue s}}break;default:}}}for(let $=0;$<ei.actions.length;$++){let en=ei.actions[$];if(en.type==="id"&&en.field===ee){if(en.op==="set"){if(et(ei,en.value)){break}}}}}};async function gM($){return f6("SELECT * FROM payees WHERE transfer_acct = ?",[$])}async function gL($){if($.payee){let{transfer_acct:ee}=await f6("SELECT id, transfer_acct FROM v_payees WHERE id = ?",[$.payee]);return ee}return null}async function gx($,ee){const{offbudget:et}=await f6("SELECT offbudget FROM accounts WHERE id = ?",[$.account]);const{offbudget:en}=await f6("SELECT offbudget FROM accounts WHERE id = ?",[ee]);if(et===en){await dj({id:$.id,category:null});return true}return false}async function gP($,ee){if($.is_parent){return null}let{id:et}=await f6("SELECT id FROM payees WHERE transfer_acct = ?",[$.account]);if($.parent_id){let ee=await f6(`
186
+ SELECT p.id, p.transfer_acct FROM v_transactions t
187
+ LEFT JOIN payees p ON p.id = t.payee
188
+ WHERE t.id = ?
189
+ `,[$.parent_id]);if(ee.transfer_acct){if(ee.id!==$.payee){await dj({id:$.id,payee:null});return{id:$.id,payee:null}}}}const en=await dU({account:ee,amount:-$.amount,payee:et,date:$.date,transfer_id:$.id,notes:$.notes||null,cleared:false});await dj({id:$.id,transfer_id:en});const ei=await gx($,ee);return{id:$.id,transfer_id:en,...ei?{category:null}:{}}}async function gF($){let ee=await dP($.transfer_id);if(ee){if(ee.is_child){await dj({id:$.transfer_id,transfer_id:null,payee:null})}else{await dW({id:$.transfer_id})}}await dj({id:$.id,transfer_id:null});return{id:$.id,transfer_id:null}}async function gB($,ee){let et=await gM($.account);await dj({id:$.transfer_id,account:ee,payee:et.id,date:$.date,notes:$.notes,amount:-$.amount});const en=await gx($,ee);if(en){return{id:$.id,category:null}}}async function gU($){let ee=await gL($);if(ee){return gP($,ee)}}async function gj($){if($.transfer_id){await gF($)}}async function gW($){const ee=await gL($);if(ee&&!$.transfer_id){return gP($,ee)}if(!ee&&$.transfer_id){return gF($)}if(ee&&$.transfer_id){return gB($,ee)}};async function gH($){let ee=ui($,"parent_id");let et=await f2(`SELECT id FROM v_transactions_internal WHERE ${ee}`);let en=new Set($);for(let $ of et){en.add($.id)}return[...en]}async function gz($){return un(($,ee)=>dr("transactions",$,ee),$,$=>`id = '${$}'`,$=>`SELECT * FROM v_transactions_internal WHERE ${$}`)}async function gV({added:$,deleted:ee,updated:et,learnCategories:en=false,detectOrphanPayees:ei=true}){let eo=[];let es=et?et.map($=>$.id):[];let eu=ee?await gH(ee.map($=>$.id)):[];let el=new Set;let ef=await f2("SELECT * FROM accounts WHERE tombstone = 0");if(et){let $=et.filter($=>$.payee).map($=>$.id);let ee=await gz($);for(let $=0;$<ee.length;$++){el.add(ee[$].payee)}}await fI(async()=>{if($){eo=await Promise.all($.map(async $=>dU($)))}if(ee){await Promise.all(eu.map(async $=>{await dW({id:$})}))}if(et){await Promise.all(et.map(async $=>{if($.account){let ee=ef.find(ee=>ee.id===$.account);if(ee.offbudget===1){$.category=null}}await dj($)}))}});let ed=await gz(eo);let ep=await gz(es);let eh=await gz(eu);let ey=ed;let eg;await fI(async()=>{await Promise.all(ed.map($=>gU($)));eg=(await Promise.all(ep.map($=>gW($)))).filter(Boolean);await Promise.all(eh.map($=>gj($)))});if(en){let ee=new Set([...$?$.filter($=>$.category).map($=>$.id):[],...et?et.filter($=>$.category).map($=>$.id):[]]);await mp(ed.concat(ep).filter($=>ee.has($.id)))}if(ei){if(et){let $=et.map($=>$.payee).filter(Boolean);if($.length>0){let ee=new Set(await dD());let et=[...el].filter($=>ee.has($));if(et.length>0){aZ("orphaned-payees",{orphanedIds:et,updatedPayeeIds:$})}}}}return{added:ey,updated:eg}};let g$;let gq;let gG;let gY;function gK(){g$=new Map;gG=new gA({field:"imported_payee",method:"firstchar"});gY=new gA({field:"payee"})}function gZ($){return Object.fromEntries(Object.entries($).map($=>{return[$[1],$[0]]}))}let gJ=sK.views.transactions.fields;let gX=gZ(sK.views.transactions.fields);function gQ($){return{...$,field:gX[$.field]||$.field}}function g0($){return{...$,field:gJ[$.field]||$.field}}function g1($){let ee;try{ee=typeof $==="string"?JSON.parse($):$}catch($){throw new lG("internal","Cannot parse rule json")}if(!Array.isArray(ee)){throw new lG("internal","Rule json must be an array")}return ee}function g2($){return $?g1($).map($=>gQ($)):[]}function g6($){return JSON.stringify($.map($=>g0($)))}const g4={validate($,{update:ee}={}){oq("rules",$,["conditions","actions"],ee);if(!ee||"stage"in $){if($.stage!=="pre"&&$.stage!=="post"&&$.stage!==null){throw new Error("Invalid rule stage: "+$.stage)}}if(!ee||"conditionsOp"in $){if(!["and","or"].includes($.conditionsOp)){throw new Error("Invalid rule conditionsOp: "+$.conditionsOp)}}return $},toJS($){let{conditions:ee,conditions_op:et,actions:en,...ei}=$;return{...ei,conditionsOp:et,conditions:g2(ee),actions:g2(en)}},fromJS($){let{conditions:ee,conditionsOp:et,actions:en,...ei}=$;if(et){ei.conditions_op=et}if(Array.isArray(ee)){ei.conditions=g6(ee)}if(Array.isArray(en)){ei.actions=g6(en)}return ei}};function g3($){let ee;try{ee=new gO({...g4.toJS($),fieldTypes:d6})}catch($){console.warn("Invalid rule",$);if($ instanceof lG){return null}throw $}gC(ee,pl());return ee}async function g8(){gK();let $=await f2(`
190
+ SELECT * FROM rules
191
+ WHERE conditions IS NOT NULL AND actions IS NOT NULL AND tombstone = 0
192
+ `);for(let ee=0;ee<$.length;ee++){let et=$[ee];if(et.stage==="cleanup"||et.stage==="modify"){et.stage="pre"}let en=g3(et);if(en){g$.set(en.id,en);gG.index(en);gY.index(en)}}if(gq){gq()}gq=f_(mr)}function g5(){return[...g$.values()]}async function g9($){$=g4.validate($);return f9("rules",g4.fromJS($))}async function g7($){$=g4.validate($,{update:true});return f5("rules",g4.fromJS($))}async function mt($){let ee=await f6("SELECT id FROM schedules WHERE rule = ?",[$.id]);if(ee){return false}return de("rules",$.id)}function mr($,ee){ee.forEach(($,ee)=>{if(ee==="rules"){$.forEach($=>{let ee=g$.get($.id);if($.tombstone===1){let ee=g$.get($.id);if(ee){g$.delete(ee.getId());gG.remove(ee);gY.remove(ee)}}else{let et=g3($);if(et){if(ee){gG.remove(ee);gY.remove(ee)}g$.set($.id,et);gG.index(et);gY.index(et)}}})}});let et=[...ee.keys()];if(et.find($=>$.indexOf("mapping")!==-1)){g5().forEach($=>{gC($,pl())})}}function mn($){let ee={...$};let et=gR(im(gG.getApplicableRules($),gY.getApplicableRules($)));for(let $=0;$<et.length;$++){ee=et[$].apply(ee)}return ee}function mi($,{recurDateBounds:ee=100}={}){let et=[];$=$.map($=>{if($ instanceof gE){return $}try{return new gE($.op,$.field,$.value,$.options,d6)}catch($){et.push($.type||"internal");console.log("conditionsToAQL: invalid condition: "+$.message);return null}}).filter(Boolean);let en=$.map($=>{let{type:et,field:en,op:ei,value:eo,options:es}=$;let eu=$=>{if(et==="number"){return $.value}return $};let el=($,ee,en)=>{if(et==="number"){if(es){if(es.outflow){return{$and:[{amount:{$lt:0}},{[$]:{$transform:"$neg",[ee]:en}}]}}else if(es.inflow){return{$and:[{amount:{$gt:0}},{[$]:{[ee]:en}}]}}}return{amount:{[ee]:en}}}else if(et==="string"){return{[$]:{$transform:"$lower",[ee]:en}}}else if(et==="date"){return{[$]:{[ee]:en.date}}}return{[$]:{[ee]:en}}};switch(ei){case"isapprox":case"is":if(et==="date"){if(eo.type==="recur"){let $=eo.schedule.occurrences({take:ee}).toArray().map($=>nI($.date));return{$or:$.map($=>{if(ei==="isapprox"){return{$and:[{date:{$gte:nB($,2)}},{date:{$lte:nF($,2)}}]}}return{date:$}})}}else{if(ei==="isapprox"){let $=nT(eo.date);let ee=nF($,2);let et=nB($,2);return{$and:[{date:{$gte:et}},{date:{$lte:ee}}]}}else{switch(eo.type){case"date":return{date:eo.date};case"month":{let $=eo.date+"-00";let ee=eo.date+"-99";return{$and:[{date:{$gte:$}},{date:{$lte:ee}}]}}case"year":{let $=eo.date+"-00-00";let ee=eo.date+"-99-99";return{$and:[{date:{$gte:$}},{date:{$lte:ee}}]}}default:}}}}else if(et==="number"){let $=eo.value;if(ei==="isapprox"){let ee=pn($);return{$and:[el(en,"$gte",$-ee),el(en,"$lte",$+ee)]}}return el(en,"$eq",$)}else if(et==="string"){if(eo===""){return{$or:[el(en,"$eq",null),el(en,"$eq","")]}}}return el(en,"$eq",eo);case"isNot":return el(en,"$ne",eo);case"isbetween":let[ef,ed]=d9(eo.num1,eo.num2);return{[en]:[{$gte:ef},{$lte:ed}]};case"contains":return el(et==="id"?en+".name":en,"$like","%"+eo+"%");case"doesNotContain":return el(et==="id"?en+".name":en,"$notlike","%"+eo+"%");case"oneOf":let ep=eo;if(ep.length===0){return{id:null}}return{$or:ep.map($=>el(en,"$eq",$))};case"notOneOf":let eh=eo;if(eh.length===0){return{id:null}}return{$and:eh.map($=>el(en,"$ne",$))};case"gt":return el(en,"$gt",eu(eo));case"gte":return el(en,"$gte",eu(eo));case"lt":return el(en,"$lt",eu(eo));case"lte":return el(en,"$lte",eu(eo));case"true":return el(en,"$eq",true);case"false":return el(en,"$eq",false);default:throw new Error("Unhandled operator: "+ei)}});return{filters:en,errors:et}}function mo($,ee){let et=ee.map($=>{if($ instanceof gT){return $}try{if($.op==="link-schedule"){return new gT($.op,null,$.value,null,d6)}return new gT($.op,$.field,$.value,$.options,d6)}catch($){console.log("Action error",$);return null}}).filter(Boolean);if(et.length!==ee.length){return null}let en=$.map($=>{let ee={id:$};for(let $ of et){$.exec(ee)}return ee});return gV({updated:en})}function ms($){let ee=new Set;gk(g5(),"payee",(et,en)=>{if(en===$){ee.add(et)}});return gR([...ee])}function*mu($,ee,et,{condValue:en,actionValue:ei}){let eo=g5();for(let es=0;es<eo.length;es++){let eu=eo[es];if(eu.stage===$&&eu.actions.length===1&&eu.actions[0].op==="set"&&eu.actions[0].field===et&&(ei===undefined||eu.actions[0].value===ei)&&eu.conditions.length===1&&(eu.conditions[0].op==="is"||eu.conditions[0].op==="isNot")&&eu.conditions[0].field===ee&&(en===undefined||eu.conditions[0].value===en)){yield eu.serialize()}}return null}function*ml($,ee,et,{condValue:en,actionValue:ei}){let eo=g5();for(let es=0;es<eo.length;es++){let eu=eo[es];if(eu.stage===$&&eu.actions.length===1&&eu.actions[0].op==="set"&&eu.actions[0].field===et&&(ei==null||eu.actions[0].value===ei)&&eu.conditions.length===1&&(eu.conditions[0].op==="oneOf"||eu.conditions[0].op==="oneOf")&&eu.conditions[0].field===ee&&(en==null||eu.conditions[0].value.indexOf(en)!==-1)){yield eu.serialize()}}return null}async function mf($,ee){let et=ml("pre","imported_payee","payee",{actionValue:ee}).next().value;if(et){let ee=et.conditions[0];let en=[...im(new Set(ee.value),new Set($.filter($=>$!=="")))];let ei={...et,conditions:[{...ee,value:en}]};await g7(ei);return et.id}else{let et=new gO({stage:"pre",conditionsOp:"and",conditions:[{op:"oneOf",field:"imported_payee",value:$}],actions:[{op:"set",field:"payee",value:ee}],fieldTypes:d6});return g9(et.serialize())}}function md($){let ee=new Map;$.forEach($=>{if($.category){ee.set($.category,(ee.get($.category)||0)+1)}});let et=$.reduce(($,et)=>{let en=ee.get(et.category);if(!$||en>$.score){return{score:en,category:et.category}}return $},null);return et.score>=3?et.category:null}async function mp($){if($.length===0){return}let ee=new Set($.map($=>$.payee));let et=new Set($.map($=>$.id));let en=null;for(let ee=0;ee<$.length;ee++){if(en===null||$[ee].date<en){en=$[ee].date}}en=nB(en,180);let ei=await f2(`SELECT t.* FROM v_transactions t
193
+ LEFT JOIN accounts a ON a.id = t.account
194
+ WHERE date >= ? AND date <= ? AND is_parent = 0 AND a.closed = 0
195
+ ORDER BY date DESC`,[oG(en),oG(nF(nR(),180))]);let eo=ii(ei,"payee");let es=new Map;for(let $ of ee){if($){let ee=(eo.get($)||[]).slice(0,5);if(ee.find($=>et.has($.id))){let et=md(ee);if(et){es.set($,et)}}}}await fI(async()=>{for(let[$,ee]of es.entries()){let et=[...mu(null,"payee","category",{condValue:$})];if(et.length>0){for(let $ of et){let et=$.actions[0];if(et.value!==ee){await g7({...$,actions:[{...et,value:ee}]})}}}else{let et=new gO({stage:null,conditionsOp:"and",conditions:[{op:"is",field:"payee",value:$}],actions:[{op:"set",field:"category",value:ee}],fieldTypes:d6});await g9(et.serialize())}}})};function my($,ee){return{type:"BankSyncError",category:$,code:ee}}function mg($,ee){let{subtransactions:et,...en}=iV({...$,is_parent:true,subtransactions:ee.map((ee,et)=>iz($,{...ee,sort_order:0-et}))});return[en,...et]}function mm($){switch($.type){case"credit":case"loan":return-$.balances.current;default:return $.balances.current}}async function m_($,ee){await fK("UPDATE accounts SET balance_current = ? WHERE id = ?",[ix(ee),$])}async function mv($,ee,et){let en=await l4(ce().PLAID_SERVER+"/accounts",{userId:$,key:ee,item_id:et});let{accounts:ei}=en;ei.forEach($=>{$.balances.current=mm($)});return ei}async function mw($,ee,et){const en=await rX("user-token");if(!en)return;let ei=await l4(ce().GOCARDLESS_SERVER+"/accounts",{userId:$,key:ee,item_id:et},{"X-ACTUAL-TOKEN":en});let{accounts:eo}=ei;eo.forEach($=>{$.balances.current=mm($)});return eo}function mE($){return{imported_id:$.transaction_id,payee_name:$.name,imported_payee:$.name,amount:-ix($.amount),date:$.date}}async function mS($,ee,et,en,ei,eo){let es=[];let eu=null;let el=100;let ef=0;let ed=0;while(1){const ep=nR();const eh=await l4(ce().PLAID_SERVER+"/transactions",{userId:$,key:ee,item_id:""+en,account_id:et,start_date:ei,end_date:ep,count:el,offset:ef});if(eh.error_code){throw my(eh.error_type,eh.error_code)}if(eh.transactions.length===0){break}ed+=eh.transactions.length;es=es.concat(eh.transactions.filter($=>!$.pending));eu=mm(eh.accounts[0]);if(ed===eh.total_transactions||eo!=null&&es.length>=eo){break}ef+=el}es=eo!=null?es.slice(0,eo):es;return{transactions:es.map(mE),accountBalance:eu}}async function mT($,ee,et,en,ei){let eo=await rX("user-token");if(!eo)return;const es=await l4(ce().GOCARDLESS_SERVER+"/transactions",{userId:$,key:ee,requisitionId:en,accountId:et,startDate:ei},{"X-ACTUAL-TOKEN":eo});if(es.error_code){throw my(es.error_type,es.error_code)}const{transactions:{all:eu},balances:el,startingBalance:ef}=es;return{transactions:eu,accountBalance:el,startingBalance:ef}}async function mO($,ee,et){if($.payee==null&&ee){let $=et.get(ee.toLowerCase());$=$||await dR(ee);if($!=null){return $.id}else{let $={id:e_(),name:ee};et.set(ee.toLowerCase(),$);return $.id}}return $.payee}async function mI($,ee,{rawPayeeName:et=false}={}){let en=new Map;let ei=[];for(let eo of $){if(eo.date==null){throw new Error("`date` is required when adding a transaction")}let{payee_name:$,subtransactions:es,...eu}=eo;eo=eu;if($){let ee=$.trim();if(ee===""){$=null}else{$=et?ee:d1(ee)}}eo.imported_payee=eo.imported_payee||$;if(eo.imported_payee){eo.imported_payee=eo.imported_payee.trim()}eo.account=ee;eo.payee=await mO(eo,$,en);ei.push({payee_name:$,subtransactions:es?es.map($=>({...$,account:ee})):null,trans:eo})}return{normalized:ei,payeesToCreate:en}}async function mN($,ee){let et=new Map;let en=[];for(let ei of $){if(!ei.amount){ei.amount=ei.transactionAmount.amount}if(ei.date==null){throw new Error("`date` is required when adding a transaction")}let $;if(ei.amount>0||Object.is(Number(ei.amount),0)){const ee=[];ee.push(d1(ei.debtorName||ei.remittanceInformationUnstructured||(ei.remittanceInformationUnstructuredArray||[]).join(", ")));if(ei.debtorAccount&&ei.debtorAccount.iban){ee.push("("+ei.debtorAccount.iban.slice(0,4)+" XXX "+ei.debtorAccount.iban.slice(-4)+")")}$=ee.join(" ")}else{const ee=[];ee.push(d1(ei.creditorName||ei.remittanceInformationUnstructured||(ei.remittanceInformationUnstructuredArray||[]).join(", ")));if(ei.creditorAccount&&ei.creditorAccount.iban){ee.push("("+ei.creditorAccount.iban.slice(0,4)+" XXX "+ei.creditorAccount.iban.slice(-4)+")")}$=ee.join(" ")}ei.imported_payee=ei.imported_payee||$;if(ei.imported_payee){ei.imported_payee=ei.imported_payee.trim()}ei.account=ee;ei.payee=await mO(ei,$,et);ei.cleared=Boolean(ei.booked);en.push({payee_name:$,trans:{amount:ix(ei.amount),payee:ei.payee,account:ei.account,date:ei.date,notes:ei.remittanceInformationUnstructured||(ei.remittanceInformationUnstructuredArray||[]).join(", "),imported_id:ei.transactionId,imported_payee:ei.imported_payee,cleared:ei.cleared}})}return{normalized:en,payeesToCreate:et}}async function mD($,ee){let et=new Set(ee.map($=>$.payee));await fI(async()=>{for(let ee of $.values()){if(et.has(ee.id)){await dE(ee)}}})}async function mR($,ee){const et=new Set;const en=[];const ei=[];let{normalized:eo,payeesToCreate:es}=await mN(ee,$);let eu=[];for(let{payee_name:ee,trans:en,subtransactions:ei}of eo){en=mn(en);let eo=null;let es=null;if(en.imported_id){eo=await f6("SELECT * FROM v_transactions WHERE imported_id = ? AND account = ?",[en.imported_id,$]);if(eo){et.add(eo.id)}}if(!eo){es=await f2(`SELECT id, is_parent, date, imported_id, payee, category, notes FROM v_transactions
196
+ WHERE date >= ? AND date <= ? AND amount = ? AND account = ? AND is_child = 0`,[oG(nB(en.date,4)),oG(nF(en.date,1)),en.amount||0,$])}eu.push({payee_name:ee,trans:en,subtransactions:ei,match:eo,fuzzyDataset:es})}let el=eu.map($=>{if(!$.match&&$.fuzzyDataset){let ee=$.fuzzyDataset.find(ee=>!et.has(ee.id)&&$.trans.payee===ee.payee);if(ee){et.add(ee.id);return{...$,match:ee}}}return $});let ef=el.map($=>{if(!$.match&&$.fuzzyDataset){let ee=$.fuzzyDataset.find($=>!et.has($.id));if(ee){et.add(ee.id);return{...$,match:ee}}}return $});for(let{trans:$,subtransactions:ee,match:et}of ef){if(et){let ee={...et,cleared:et.cleared===1,date:oY(et.date)};const ei={imported_id:$.imported_id||null,payee:ee.payee||$.payee||null,category:ee.category||$.category||null,imported_payee:$.imported_payee||null,notes:ee.notes||$.notes||null,cleared:$.cleared!=null?$.cleared:true};if(it(ee,ei,Object.keys(ei))){en.push({id:ee.id,...ei})}if(ee.is_parent&&ee.cleared!==ei.cleared){const $=await f2("SELECT id FROM v_transactions WHERE parent_id = ?",[ee.id]);for(const ee of $){en.push({id:ee.id,cleared:ei.cleared})}}}else{let et={...$,id:e_(),category:$.category||null,cleared:$.cleared!=null?$.cleared:true};if(ee&&ee.length>0){ei.push(...mg(et,ee))}else{ei.push(et)}}}await mD(es,[...ei,...en]);await gV({added:ei,updated:en});return{added:ei.map($=>$.id),updated:en.map($=>$.id)}}async function mC($,ee){const et=new Set;const en=[];const ei=[];let{normalized:eo,payeesToCreate:es}=await mI(ee,$);let eu=[];for(let{payee_name:ee,trans:en,subtransactions:ei}of eo){en=mn(en);let eo=null;let es=null;if(en.imported_id){eo=await f6("SELECT * FROM v_transactions WHERE imported_id = ? AND account = ?",[en.imported_id,$]);if(eo){et.add(eo.id)}}if(!eo){es=await f2(`SELECT id, is_parent, date, imported_id, payee, category, notes FROM v_transactions
197
+ WHERE date >= ? AND date <= ? AND amount = ? AND account = ? AND is_child = 0`,[oG(nB(en.date,4)),oG(nF(en.date,1)),en.amount||0,$])}eu.push({payee_name:ee,trans:en,subtransactions:ei,match:eo,fuzzyDataset:es})}let el=eu.map($=>{if(!$.match&&$.fuzzyDataset){let ee=$.fuzzyDataset.find(ee=>!et.has(ee.id)&&$.trans.payee===ee.payee);if(ee){et.add(ee.id);return{...$,match:ee}}}return $});let ef=el.map($=>{if(!$.match&&$.fuzzyDataset){let ee=$.fuzzyDataset.find($=>!et.has($.id));if(ee){et.add(ee.id);return{...$,match:ee}}}return $});for(let{trans:$,subtransactions:ee,match:et}of ef){if(et){let ee={...et,cleared:et.cleared===1,date:oY(et.date)};const ei={date:$.date,imported_id:$.imported_id||null,payee:ee.payee||$.payee||null,category:ee.category||$.category||null,imported_payee:$.imported_payee||null,notes:ee.notes||$.notes||null,cleared:$.cleared!=null?$.cleared:true};if(it(ee,ei,Object.keys(ei))){en.push({id:ee.id,...ei})}if(ee.is_parent&&ee.cleared!==ei.cleared){const $=await f2("SELECT id FROM v_transactions WHERE parent_id = ?",[ee.id]);for(const ee of $){en.push({id:ee.id,cleared:ei.cleared})}}}else{let et={...$,id:e_(),category:$.category||null,cleared:$.cleared!=null?$.cleared:true};if(ee&&ee.length>0){ei.push(...mg(et,ee))}else{ei.push(et)}}}await mD(es,[...ei,...en]);await gV({added:ei,updated:en});return{added:ei.map($=>$.id),updated:en.map($=>$.id)}}async function mk($,ee,{runTransfers:et=true}={}){const en=[];let{normalized:ei,payeesToCreate:eo}=await mI(ee,$,{rawPayeeName:true});for(let{trans:ee,subtransactions:et}of ei){ee=mn(ee);let ei={id:e_(),...ee,account:$,cleared:ee.cleared!=null?ee.cleared:true};if(et&&et.length>0){en.push(...mg(ei,et))}else{en.push(ei)}}await mD(eo,en);let es;if(et){let $=await gV({added:en});es=$.added.map($=>$.id)}else{await fI(async()=>{es=await Promise.all(en.map(async $=>dU($)))})}return es}async function mM($,ee,et,en,ei){const eo=await f6("SELECT * FROM v_transactions WHERE account = ? ORDER BY date DESC LIMIT 1",[et]);const es=await f8("accounts",et);if(eo){const eo=await f6("SELECT date FROM v_transactions WHERE account = ? ORDER BY date ASC LIMIT 1",[et]);const es=nT(oY(eo.date));const eu=nI(eT([nT(nB(nR(),90)),es]));let{transactions:el,accountBalance:ef}=await mT($,ee,en,ei,eu);if(el.length===0){return{added:[],updated:[]}}el=el.map($=>({...$,account:et}));return aV(async()=>{const $=await mR(et,el);await m_(et,ef);return $})}else{const eo=nB(nR(),90);const{transactions:eu,startingBalance:el}=await mT($,ee,en,ei,eo);const ef=eu[eu.length-1];const ed=eu.length>0?ef.date:nR();const ep=await dz();return aV(async()=>{let $=await dU({account:et,amount:el,category:es.offbudget===0?ep.category:null,payee:ep.id,date:ed,cleared:true,starting_balance_flag:true});let ee=await mR(et,eu);return{...ee,added:[$,...ee.added]}})}}async function mx($,ee,et,en,ei){const eo=await f6("SELECT * FROM v_transactions WHERE account = ? ORDER BY date DESC LIMIT 1",[et]);if(eo){const es=await f6("SELECT date FROM v_transactions WHERE account = ? ORDER BY date ASC LIMIT 1",[et]);const eu=oY(es.date);let el=nB(oY(eo.date),31);if(el<eu){el=eu}let{transactions:ef,accountBalance:ed}=await mS($,ee,en,ei,el);if(ef.length===0){return{added:[],updated:[]}}ef=ef.map($=>({...$,account:et}));return aV(async()=>{const $=await mC(et,ef);await m_(et,ed);return $})}else{const eo=await f8("accounts",et);const es=nB(nR(),eo.offbudget===0?1:30);const{transactions:eu}=await mS($,ee,en,ei,t4(rv(es),"yyyy-MM-dd"));let el=eo.balance_current;const ef=eu.reduce(($,ee)=>{return $-ee.amount},el);const ed=eu.length>0?eu[eu.length-1].date:nR();let ep=await dz();return aV(async()=>{let $=await dU({account:et,amount:ef,category:eo.offbudget===0?ep.category:null,payee:ep.id,date:ed,cleared:true,starting_balance_flag:true});let ee=await mC(et,eu);return{...ee,added:[$,...ee.added]}})}};let mP=0;function mF(){mP+=.45;if(mP>1){mP=0}return mP}const mB=nm?mF:Math.random;const mU=mB;function mj($){return $[Math.floor(mU()*$.length)%$.length]}function mW($,ee){return $+(ee-$)*mU()}function mH($,ee){return Math.round(mW($,ee))}function mz($,ee){let et=$[0];for(let en=0;en<$.length;en++){if($[en][ee]<et[ee]){et=$[en]}}return et}function mV($){return $.find($=>$.name==="Starting Balances").id}function m$($,ee){let et=$.find($=>$.name==="Deposit");let en=$.filter($=>$.name!=="Deposit"&&$.name!=="Starting Balance");let ei=ee.find($=>$.is_income===0);let eo=ee.find($=>$.is_income===1);let es=ei.categories.filter($=>["Food","Restaurants","Entertainment","Clothing","General","Gift","Medical"].indexOf($.name)!==-1);return{incomePayee:et,expensePayees:en.filter($=>!$.bill),incomeGroup:eo,expenseCategories:es,billCategories:ee.find($=>$.name==="Bills").categories,billPayees:en.filter($=>$.bill)}}async function mq($,ee,et,en){let{incomePayee:ei,expensePayees:eo,incomeGroup:es,expenseCategories:eu,billCategories:el,billPayees:ef}=m$(et,en);let ed=mH(100,200);let ep=[];for(let $=0;$<ed;$++){let et;if(mU()<.09){et=ei}else{et=mj(eo)}let en;if(et.name==="Deposit"){en=es.categories.find($=>$.name==="Income")}else{en=mj(eu)}let el;if(et.name==="Deposit"){el=mH(5e4,7e4)}else{el=mH(0,mU()<.05?-8e3:-700)}let ef={amount:el,payee:et.id,account:ee.id,date:nB(nR(),Math.floor($/3)),category:en.id};ep.push(ef);if(mU()<.2){let $=Math.round(ef.amount/3);let ee=()=>et===ei?es.categories.find($=>$.name==="Income").id:mj(eu).id;ef.subtransactions=[{amount:$,category:ee()},{amount:$,category:ee()},{amount:ef.amount-$*2,category:ee()}]}}let eh=nA(ep[ep.length-1].date);let ey=nV(eh,nN());let eg=nR();for(let $ of ey){let et=nF($,12);if(nU(et,eg)){ep.push({amount:-1e4,payee:ef.find($=>$.name.toLowerCase().includes("power")).id,account:ee.id,date:et,category:el.find($=>$.name==="Power").id})}et=nF($,18);if(nU(et,eg)){ep.push({amount:-9e3,payee:ef.find($=>$.name.toLowerCase().includes("water")).id,account:ee.id,date:et,category:el.find($=>$.name==="Water").id})}et=nF($,2);if(nU(et,eg)){ep.push({amount:-12e4,payee:ef.find($=>$.name.toLowerCase().includes("housy")).id,account:ee.id,date:et,category:el.find($=>$.name==="Mortgage").id})}et=nF($,20);if(nU(et,eg)){ep.push({amount:-6e3,payee:ef.find($=>$.name.toLowerCase().includes("internet")).id,account:ee.id,date:et,category:el.find($=>$.name==="Internet").id})}et=nF($,23);if(nU(et,eg)){ep.push({amount:-7500,payee:ef.find($=>$.name.toLowerCase().includes("t-mobile")).id,account:ee.id,date:et,category:el.find($=>$.name==="Cell").id})}}let em=null;ep.forEach($=>{if(em==null||$.date<em){em=$.date}});ep.unshift({amount:1e5,payee:et.find($=>$.name==="Starting Balance").id,account:ee.id,date:em,category:mV(es.categories),starting_balance_flag:true});return mk(ee.id,ep)}async function mG($,ee,et,en){let{incomePayee:ei,expensePayees:eo,incomeGroup:es,expenseCategories:eu}=m$(et,en);let el=mH(20,40);let ef=[];for(let $=0;$<el;$++){let et;if(mU()<.04){et=ei}else{et=mj(eo)}let en;if(et.name==="Deposit"){en=es.categories.find($=>$.name==="Income")}else{en=mj(eu)}let el=et.name==="Deposit"?mH(5e4,7e4):mH(0,-1e4);ef.push({amount:el,payee:et.id,account:ee.id,date:nB(nR(),$*2),category:en.id})}ef.unshift({amount:mH(9e4,12e4),payee:et.find($=>$.name==="Starting Balance").id,account:ee.id,date:ef[ef.length-1].date,category:mV(es.categories),starting_balance_flag:true});await $["transactions-batch-update"]({added:ef,fastMode:true})}async function mY($,ee,et,en){let{incomePayee:ei,incomeGroup:eo}=m$(et,en);let es=mH(10,30);let eu=[];for(let $=0;$<es;$++){let $=ei;let et=eo.categories.find($=>$.name==="Income");let en=mH(1e4,2e4);eu.push({amount:en,payee:$.id,account:ee.id,date:nB(nR(),mH(10,360)),category:et.id})}eu.unshift({amount:mH(1e4,2e4),payee:et.find($=>$.name==="Starting Balance").id,account:ee.id,date:mz(eu,"date").date,category:mV(eo.categories),starting_balance_flag:true});await $["transactions-batch-update"]({added:eu,fastMode:true})}async function mK($,ee,et,en){let{incomePayee:ei,expensePayees:eo,incomeGroup:es,expenseCategories:eu}=m$(et,en);let el=mH(15,40);let ef=[];for(let $=0;$<el;$++){let et;if(mU()<.3){et=ei}else{et=mj(eo)}let en=et===ei?es.categories.find($=>$.name==="Income"):mj(eu);let el=et===ei?mH(1e4,8e4):mH(-1e4,-2e3);ef.push({amount:el,payee:et.id,account:ee.id,date:nB(nR(),$*5),category:en.id})}ef.unshift({amount:3e4,payee:et.find($=>$.name==="Starting Balance").id,account:ee.id,date:ef[ef.length-1].date,category:mV(es.categories),starting_balance_flag:true});await $["transactions-batch-update"]({added:ef,fastMode:true})}async function mZ($,ee,et,en){let{incomePayee:ei,incomeGroup:eo}=m$(et,en);let es=mH(7,10);let eu=mH(1e5,2e5);let el=eo.categories.find($=>$.name==="Income");let ef=[{amount:mH(-3e3,-3500)*100*100,payee:et.find($=>$.name==="Starting Balance").id,account:ee.id,date:nP(nR(),es)+"-02",category:mV(eo.categories),starting_balance_flag:true}];for(let $=0;$<es;$++){let et=ei;ef.push({amount:eu,payee:et.id,account:ee.id,date:nP(nR(),$)+"-02",category:el.id,starting_balance_flag:true})}await $["transactions-batch-update"]({added:ef,fastMode:true})}async function mJ($,ee,et,en){let{incomePayee:ei,incomeGroup:eo}=m$(et,en);let es=mH(3,6);let eu=eo.categories.find($=>$.name==="Income");let el=[{amount:mH(3250,3700)*100*100,payee:et.find($=>$.name==="Starting Balance").id,account:ee.id,date:nP(nR(),es)+"-02",category:mV(eo.categories),starting_balance_flag:true}];for(let $=0;$<es;$++){let et=ei;let en=mH(4,9)*100*100;el.push({amount:en,payee:et.id,account:ee.id,date:nP(nR(),$)+"-02",category:eu.id})}await $["transactions-batch-update"]({added:el,fastMode:true})}async function mX($,ee,et){let en=$.find($=>$.name="Bank of America");let ei=(await f6(`SELECT * FROM v_transactions t LEFT JOIN accounts a ON t.account = a.id
198
+ WHERE a.offbudget = 0 AND t.is_child = 0 ORDER BY date ASC LIMIT 1`)).date;let eo=(await f6(`SELECT * FROM v_transactions t LEFT JOIN accounts a ON t.account = a.id
199
+ WHERE a.id = ? AND a.offbudget = 0 AND t.is_child = 0 ORDER BY date ASC LIMIT 1`,[en.id])).date;let es=nA(oY(ei));let eu=nN();let el=nV(es,eu);function ef($){for(let ee of et){let et=ee.categories.find(ee=>ee.name===$);if(et){return et}}}function ed($,ee,et){return u4({month:$,category:ee.id,amount:et})}function ep($,ee){let et=uq(nQ($),`sum-amount-${ee.id}`);if(et<0){ed($,ee,-et)}}await aV(()=>fI(async()=>{for(let $ of el){if($>=nA(oY(eo))){ed($,ef("Food"),4e4);ed($,ef("Restaurants"),3e4);ed($,ef("Entertainment"),1e4);ed($,ef("Clothing"),3e3);ed($,ef("General"),5e4);ed($,ef("Gift"),7500);ed($,ef("Medical"),1e4);ed($,ef("Cell"),7500);ed($,ef("Internet"),6e3);ed($,ef("Mortgage"),12e4);ed($,ef("Water"),9e3);ed($,ef("Power"),1e4)}else{ep($,ef("Food"));ep($,ef("Restaurants"));ep($,ef("Entertainment"));ep($,ef("Clothing"));ep($,ef("General"));ep($,ef("Gift"));ep($,ef("Medical"));ep($,ef("Cell"));ep($,ef("Internet"));ep($,ef("Mortgage"));ep($,ef("Water"));ep($,ef("Power"))}}}));await uK();await aV(()=>fI(async()=>{let $=0;for(let ee of el){if(ee>=nA(oY(eo))&&ee<=nN()){let et=nQ(ee);let en=uq(et,"to-budget");let ei=en-$;if(ei-403e3>0){ed(ee,ef("Savings"),ei-403e3);u3(ee,403e3);$+=ei-403e3}else if(ei>0){u3(ee,ei)}}}}));await uK();let eh=nQ(nN());let ey=uq(eh,"to-budget");if(ey<0){await mk(en.id,[{amount:-ey,category:ef("Income").id,date:nN()+"-01"}])}await uK()}async function mQ(ee){fl("import");await fZ("PRAGMA journal_mode = OFF");await fK("DELETE FROM categories;");await fK("DELETE FROM category_groups");let et=[{name:"Bank of America"},{name:"Ally Savings"},{name:"Capital One Checking"},{name:"HSBC"},{name:"Vanguard 401k",offBudget:1},{name:"Mortgage",offBudget:1},{name:"House Asset",offBudget:1},{name:"Roth IRA",offBudget:1}];await aV(()=>fI(async()=>{for(let $ of et){$.id=await ee["account-create"]($)}}));let en=[{name:"Starting Balance"},{name:"Kroger"},{name:"Publix"},{name:"Home Depot"},{name:"Movies"},{name:"Online store"},{name:"Deposit"},{name:"Dominion Power",bill:true},{name:"Extra Watery",bill:true},{name:"Housy House",bill:true},{name:"Fast Internet",bill:true},{name:"T-mobile",bill:true}];await aV(()=>fI(async()=>{for(let $ of en){$.id=await ee["payee-create"]({name:$.name})}}));let ei=[{name:"Usual Expenses",categories:[{name:"Savings"},{name:"Medical"},{name:"Gift"},{name:"General"},{name:"Clothing"},{name:"Entertainment"},{name:"Restaurants"},{name:"Food"}]},{name:"Bills",categories:[{name:"Power"},{name:"Water"},{name:"Mortgage"},{name:"Internet"},{name:"Cell"}]},{name:"Income",is_income:true,categories:[{name:"Income",is_income:true},{name:"Misc",is_income:true},{name:"Starting Balances",is_income:true}]}];await aV(async()=>{for(let $ of ei){$.id=await ee["category-group-create"]({name:$.name,isIncome:$.is_income?1:0});for(let et of $.categories){et.id=await ee["category-create"]({...et,isIncome:et.is_income?1:0,groupId:$.id})}}});let eo=(await aj(ee["get-categories"])).grouped;fl("import");await aV(()=>fI(async()=>{for(let $ of et){if($.name==="Bank of America"){await mq(ee,$,en,eo)}else if($.name==="Capital One Checking"||$.name==="HSBC"){await mG(ee,$,en,eo)}else if($.name==="Ally Savings"){await mK(ee,$,en,eo)}else if($.name==="Vanguard 401k"||$.name==="Roth IRA"){await mY(ee,$,en,eo)}else if($.name==="Mortgage"){await mZ(ee,$,en,eo)}else if($.name==="House Asset"){await mJ(ee,$,en,eo)}else{console.error("Unknown account name for test budget: ",$.name);await mG(ee,$,en,eo)}}}));fl("import");let es=et.find($=>$.name="Bank of America");let{data:eu}=await uh(sX("transactions").filter({account:es.id}).calculate({$sum:"$amount"}).serialize());if(eu<0){let{data:$}=await uh(sX("transactions").filter({account:es.id,amount:{$gt:0}}).limit(1).select(["id","amount"]).serialize());let et=$[0];await aj(ee["transaction-update"],{...et,amount:et.amount+-eu+mH(1e4,2e4)})}fl("disabled");await uT({isCached:false});await uz($);await lW();await uK();await aV(()=>fI(async()=>{const $=et.find($=>$.name==="Bank of America");await aj(ee["schedule/create"],{schedule:{name:"Phone bills",posts_transaction:false},conditions:[{op:"is",field:"payee",value:en.find($=>$.name==="Dominion Power").id},{op:"is",field:"account",value:$.id},{op:"is",field:"date",value:{start:nR(),frequency:"monthly",patterns:[],skipWeekend:false,weekendSolveMode:"after"}},{op:"isapprox",field:"amount",value:-12e3}]});await aj(ee["schedule/create"],{schedule:{name:"Internet bill",posts_transaction:false},conditions:[{op:"is",field:"payee",value:en.find($=>$.name==="Fast Internet").id},{op:"is",field:"account",value:$.id},{op:"is",field:"date",value:nB(nR(),1)},{op:"isapprox",field:"amount",value:-14e3}]});await aj(ee["schedule/create"],{schedule:{name:"Wedding",posts_transaction:false},conditions:[{op:"is",field:"date",value:{start:nB(nR(),3),frequency:"monthly",patterns:[],skipWeekend:false,weekendSolveMode:"after"}},{op:"is",field:"amount",value:-27e5}]});await aj(ee["schedule/create"],{schedule:{name:"Utilities",posts_transaction:false},conditions:[{op:"is",field:"account",value:$.id},{op:"is",field:"date",value:{start:nF(nR(),1),frequency:"monthly",patterns:[],skipWeekend:false,weekendSolveMode:"after"}},{op:"is",field:"amount",value:-19e4}]})}));await mX(et,en,eo)};function m0(){return String({}.REACT_APP_NETLIFY)==="true"}function m6(){return"production"==="development"}function m4(){return m0()||m6()}function m3(){if(navigator.userAgent.indexOf("Electron")>=0){return true}return false}var m8=__webpack_require__(7565);var m5=__webpack_require__.n(m8);async function m9($,ee,et,en){const ei=ee.reduce(($,{id:ee,name:et})=>{$[ee]=et;return $},{});const eo=et.reduce(($,{name:ee,categories:et})=>{et.forEach(et=>$[et.id]=`${ee}: ${et.name}`);return $},{});const es=en.reduce(($,{id:ee,name:et})=>{$[ee]=et;return $},{});const eu=$.map(({account:$,date:ee,payee:et,notes:en,category:eu,amount:el})=>({Account:ei[$],Date:ee,Payee:es[et],Notes:en,Category:eo[eu],Amount:el==null?0:iP(el)}));return m5()(eu,{header:true})}async function m7($){let{data:ee}=await uh($.select([{Id:"id"},{Account:"account.name"},{Date:"date"},{Payee:"payee.name"},{ParentId:"parent_id"},{IsParent:"is_parent"},{Notes:"notes"},{Category:"category.name"},{Amount:"amount"}]).options({splits:"all"}));let et=new Map;for(let $ of ee){if($.IsParent){et.set($.Id,$.Payee)}}let en=ee.filter($=>!$.IsParent);let ei=en.map($=>{return{Account:$.Account,Date:$.Date,Payee:$.ParentId?et.get($.ParentId):$.Payee,Notes:$.Notes,Category:$.Category,Amount:$.Amount==null?0:iP($.Amount)}});return m5()(ei,{header:true})};async function _t($,ee){let[[,et],[,en]]=await r6(["user-id","user-key"]);if($==null||!$.institution_id||!$.name){throw new Error("Invalid institution object")}let ei=e_();await l4(ce().PLAID_SERVER+"/handoff_public_token",{userId:et,key:en,item_id:ei,public_token:ee});await aV(()=>f9("banks",{id:ei,bank_id:$.institution_id,name:$.name}));return ei}async function _r($,ee){let et=await f6("SELECT id, bank_id, name FROM banks WHERE bank_id = ?",[ee]);if(et){return et}const en={id:e_(),bank_id:ee,name:$.name};await f9("banks",en);return en}async function _o($,ee,et=[]){let[[,en],[,ei]]=await r6(["user-id","user-key"]);let eo=await mv(en,ei,$);eo=eo.filter($=>ee.includes($.account_id));return Promise.all(eo.map(async ee=>{let eo=await aV(async()=>{let en=await dk({account_id:ee.account_id,name:ee.name,official_name:ee.official_name,balance_current:ix(ee.balances.current),mask:ee.mask,bank:$,offbudget:et.includes(ee.account_id)?1:0});await dE({name:"",transfer_acct:en});return en});await mx(en,ei,eo,ee.account_id,$);return eo}))}async function _u($,ee,et=[]){let[[,en],[,ei]]=await r6(["user-id","user-key"]);let eo=await mw(en,ei,$);eo=eo.filter($=>ee.includes($.account_id));return Promise.all(eo.map(async ee=>{let eo=await aV(async()=>{let en=await dk({account_id:ee.account_id,name:ee.name,official_name:ee.official_name,balance_current:ix(ee.balances.current),mask:ee.mask,bank:$,offbudget:et.includes(ee.account_id)?1:0});await dE({name:"",transfer_acct:en});return en});await mM(en,ei,eo,ee.account_id,$);return eo}))}var _l=__webpack_require__(6241);var _c=__webpack_require__.n(_l);var _f=__webpack_require__(5055);function _p($){return $.replace(/&/g,"&#038;").replace(/&amp;/g,"&#038;").replace(/>\s+</g,"><").replace(/\s+</g,"<").replace(/>\s+/g,">").replace(/\.(?=[^<>]*>)/g,"").replace(/<(\w+?)>([^<]+)/g,"<$1>$2</<added>$1>").replace(/<\/<added>(\w+?)>(<\/\1>)?/g,"</$1>")}async function _h($){return await (0,_f.parseStringPromise)($,{explicitArray:false})}function _y($){const ee=$?.["OFX"];const et=ee?.["CREDITCARDMSGSRSV1"]!=null;const en=et?ee?.["CREDITCARDMSGSRSV1"]:ee?.["BANKMSGSRSV1"];const ei=en?.[`${et?"CC":""}STMTTRNRS`];const eo=ei?.[`${et?"CC":""}STMTRS`];const es=eo?.["BANKTRANLIST"];const eu=es?.["STMTTRN"];if(!Array.isArray(eu)){return[eu]}return eu}function _g($){const ee=$["DTPOSTED"];const et=ee?new Date(Number(ee.substring(0,4)),Number(ee.substring(4,6))-1,Number(ee.substring(6,8))):null;return{amount:$["TRNAMT"],type:$["TRNTYPE"],fitId:$["FITID"],date:nI(et),name:$["NAME"],memo:$["MEMO"]}}async function _m($){const ee=$.split("<OFX>",2);const et=ee[0].split(/\r?\n/);const en={};et.forEach($=>{if($){const ee=$.split(/:/,2);en[ee[0]]=ee[1]}});const ei=`<OFX>${ee[1]}`;let eo=null;try{eo=await _h(ei)}catch(ee){const $=_p(ei);eo=await _h($)}return{headers:en,transactions:_y(eo).map(_g)}};function _b($,ee={}){let et=$.split("\n");let en=et.shift();let ei=/!Type:([^$]*)$/.exec(en.trim());let eo={dateFormat:ee.dateFormat,transactions:[]};let es=eo.transactions;let eu={};if(!ei||!ei.length){throw new Error("File does not appear to be a valid qif file: "+en)}eo.type=ei[1];let el={};while(en=et.shift()){en=en.trim();if(en==="^"){es.push(eu);eu={};continue}switch(en[0]){case"D":eu.date=en.substring(1);break;case"T":eu.amount=en.substring(1);break;case"N":eu.number=en.substring(1);break;case"M":eu.memo=en.substring(1);break;case"A":eu.address=(eu.address||[]).concat(en.substring(1));break;case"P":eu.payee=en.substring(1).replace(/&amp;/g,"&");break;case"L":let $=en.substring(1).split(":");eu.category=$[0];if($[1]!==undefined){eu.subcategory=$[1]}break;case"C":eu.clearedStatus=en.substring(1);break;case"S":let ee=en.substring(1).split(":");el.category=ee[0];if(ee[1]!==undefined){el.subcategory=ee[1]}break;case"E":el.description=en.substring(1);break;case"$":el.amount=parseFloat(en.substring(1));if(!(eu.division instanceof Array)){eu.division=[]}eu.division.push(el);el={};break;default:throw new Error("Unknown Detail Code: "+en[0])}}if(Object.keys(eu).length){es.push(eu)}return eo};async function _w($,ee){let et=Array();let en=$.match(/\.[^.]*$/);if(en){let et=en[0];switch(et.toLowerCase()){case".qif":return _S($);case".csv":case".tsv":return _E($,ee);case".ofx":case".qfx":return _T($,ee);default:}}et.push({message:"Invalid file type",internal:""});return{errors:et,transactions:[]}}async function _E($,ee){let et=Array();let en=await oj($);let ei;try{ei=_c()(en,{columns:ee?.hasHeaderRow,bom:true,delimiter:ee?.delimiter||",",quote:'"',trim:true,relax_column_count:true,skip_empty_lines:true})}catch($){et.push({message:"Failed parsing: "+$.message,internal:$.message});return{errors:et,transactions:[]}}return{errors:et,transactions:ei}}async function _S($){let ee=Array();let et=await oj($);let en;try{en=_b(et)}catch($){ee.push({message:"Failed parsing: doesn’t look like a valid QIF file.",internal:$.stack});return{errors:ee,transactions:[]}}return{errors:[],transactions:en.transactions.map($=>({amount:$.amount!=null?iF($.amount):null,date:$.date,payee_name:$.payee,imported_payee:$.payee,notes:$.memo||null}))}}async function _T($,ee){if(!ee?.enableExperimentalOfxParser){return _O($,ee)}const et=Array();const en=await oj($);let ei;try{ei=await _m(en)}catch($){et.push({message:"Failed importing file",internal:$.stack});return{errors:et}}let eo=ee.fallbackMissingPayeeToMemo;return{errors:et,transactions:ei.transactions.map($=>{return{amount:$.amount,imported_id:$.fitId,date:$.date,payee_name:$.name||(eo?$.memo:null),imported_payee:$.name||(eo?$.memo:null),notes:!!$.name||!eo?$.memo||null:null}})}}async function _O($,ee){let{getOFXTransactions:et,initModule:en}=await __webpack_require__.e("xfo").then(__webpack_require__.bind(__webpack_require__,4343));await en();let ei=Array();let eo=await oj($,"binary");let es;try{es=et(eo)}catch($){ei.push({message:"Failed importing file",internal:$.stack});return{errors:ei}}let eu=ee.fallbackMissingPayeeToMemo;return{errors:ei,transactions:es.map($=>({amount:$.amount,imported_id:$.fi_id,date:$.date?nI(new Date($.date*1e3)):null,payee_name:$.name||(eu?$.memo:null),imported_payee:$.name||(eu?$.memo:null),notes:!!$.name||!eu?$.memo||null:null}))}};function _A({reason:$,meta:ee}){switch($){case"unauthorized":return"You are not logged in.";case"encrypt-failure":if(ee.isMissingKey){return"Encrypting your file failed because you are missing your encryption key. Create your key in the next step."}return"Encrypting the file failed. You have the correct key so this is an internal bug. To fix this, generate a new key in the next step.";case"file-has-reset":return"Something went wrong while resetting your file. Please try again.";case"file-has-new-key":return"Unable to encrypt your data because you are missing the key. Create the latest key in the next step.";case"network":return"Uploading the file failed. Check your network connection.";default:return`An internal error occurred, sorry! Visit https://actualbudget.org/contact/ for support. (ref: ${$})`}}function _I({reason:$,meta:ee,fileName:et}){switch($){case"network":case"download-failure":return"Downloading the file failed. Check your network connection.";case"not-zip-file":case"invalid-zip-file":case"invalid-meta-file":return"Downloaded file is invalid, sorry! Visit https://actualbudget.org/contact/ for support.";case"decrypt-failure":return"Unable to decrypt file "+(et||"(unknown)")+". To change your key, first "+"download this file with the proper password.";case"out-of-sync-migrations":return"This budget cannot be loaded with this version of the app. "+"Make sure the app is up-to-date.";default:let en=ee&&ee.fileId?`, fileId: ${ee.fileId}`:"";return"Something went wrong trying to download that file, sorry! "+"Visit https://actualbudget.org/contact/ for support. "+`(reason: ${$}${en})`}}function _N($){return _A($)}function _D({reason:$}){switch($){case"network":return"Unable to connect to the server. We need to access the server to get some information about your keys.";case"old-key-style":return"This file is encrypted with an old unsupported key style. Recreate the key "+"on a device where the file is available, or use an older version of Actual to download "+"it.";case"decrypt-failure":return"Unable to decrypt file with this password. Please try again.";default:return"Something went wrong trying to create a key, sorry! Visit https://actualbudget.org/contact/ for support."}}function _R($,ee){if($==="out-of-sync-migrations"||$==="out-of-sync-data"){return"This budget cannot be loaded with this version of the app."}else if($==="budget-not-found"){return`Budget “${ee}” not found. Check the id of your budget in the Advanced section of the settings page.`}else{return`We had an unknown problem opening “${ee}”.`}};const _C={...oK,toExternal($){return{id:$.id,name:$.name,offbudget:$.offbudget?true:false,closed:$.closed?true:false}},fromExternal($){let ee={...$};if("offbudget"in $){ee.offbudget=$.offbudget?1:0}if("closed"in $){ee.closed=$.closed?1:0}return ee}};const _k={...oZ,toExternal($){return{id:$.id,name:$.name,is_income:$.is_income?true:false,group_id:$.cat_group}},fromExternal($){let{group_id:ee,...et}=$;if("is_income"in $){et.is_income=$.is_income?1:0}if("group_id"in $){et.cat_group=$.group_id}return et}};const _M={...oJ,toExternal($){return{id:$.id,name:$.name,is_income:$.is_income?true:false,categories:$.categories.map(_k.toExternal)}},fromExternal($){let ee={...$};if("is_income"in $){ee.is_income=$.is_income?1:0}if("categories"in $){ee.categories=$.categories.map(_k.fromExternal)}return ee}};const _L={...oX,toExternal($){return{id:$.id,name:$.name,category:$.category,transfer_acct:$.transfer_acct}},fromExternal($){return $}};let _x=false;function _P($,ee){return{type:"APIError",message:$,meta:ee}}function _F($){return ee=>{return aV(async()=>{let et=(0,eo.getClock)().timestamp.toString();let en=await $(ee);let ei=await f2("SELECT DISTINCT dataset FROM messages_crdt WHERE timestamp > ?",[et]);if(aJ()>1){aZ("sync-event",{type:"success",tables:ei.map($=>$.dataset)})}return en},{undoDisabled:true})}}let _B={};async function _U($){if(!$.match(/^\d{4}-\d{2}$/)){throw _P("Invalid month format, use YYYY-MM: "+$)}if(!_x){let{start:ee,end:et}=await _B["get-budget-bounds"]();let en=nz(ee,et);if(!en.includes($)){throw _P("No budget exists for month: "+$)}}}async function _j($,ee){if(ee==null){throw _P(`${$}: category id is required`)}let et=await f6("SELECT is_income FROM categories WHERE id = ?",[ee]);if(!et){throw _P(`${$}: category “${ee}” does not exist`)}if(et.is_income!==0){throw _P(`${$}: category “${ee}” is not an expense category`)}}function _W(){if(!(uA()||{}).id){throw _P("No budget file is open")}}let _H=null;_B["api/batch-budget-start"]=async function(){if(_H){throw _P("Cannot start a batch process: batch already started")}if(_x){f1(()=>{return new Promise(($,ee)=>{_H={resolve:$,reject:ee}})})}else{fI(()=>{return new Promise(($,ee)=>{_H={resolve:$,reject:ee}})})}};_B["api/batch-budget-end"]=async function(){if(!_H){throw _P("Cannot end a batch process: no batch started")}_H.resolve();_H=null};_B["api/load-budget"]=async function({id:$}){let{id:ee}=uA()||{};if(ee!==$){aZ("start-load");let{error:ee}=await _B["load-budget"]({id:$});if(!ee){aZ("finish-load")}else{aZ("show-budgets");throw new Error(_R(ee,$))}}};_B["api/download-budget"]=async function({syncId:$,password:ee}){let{id:et}=uA()||{};if(et){await _B["close-budget"]()}let en=(await _B["get-budgets"]()).find(ee=>ee.groupId===$);if(en){await _B["load-budget"]({id:en.id});let $=await _B["sync-budget"]();if($.error){throw new Error(_R($.error,en.id))}}else{let et=await _B["get-remote-files"]();if(!et){throw new Error("Could not get remote files")}let en=et.find(ee=>ee.groupId===$);if(!en){throw new Error(`Budget “${$}” not found. Check the sync id of your budget in the Advanced section of the settings page.`)}if(en.encryptKeyId&&!ee){throw new Error(`File ${en.name} is encrypted. Please provide a password.`)}if(ee){let $=await _B["key-test"]({fileId:en.fileId,password:ee});if($.error){throw new Error(_D($.error))}}let ei=await _B["download-budget"]({fileId:en.fileId});if(ei.error){console.log("Full error details",ei.error);throw new Error(_I(ei.error))}await _B["load-budget"]({id:ei.id})}};_B["api/sync"]=async function(){let{id:$}=uA();let ee=await _B["sync-budget"]();if(ee.error){throw new Error(_R(ee.error,$))}};_B["api/start-import"]=async function({budgetName:$}){await _B["close-budget"]();await _B["create-budget"]({budgetName:$,avoidUpload:true});await fK("DELETE FROM categories WHERE is_income = 0");await fK("DELETE FROM category_groups WHERE is_income = 0");fl("import");aZ("start-import");_x=true};_B["api/finish-import"]=async function(){_W();uF().markCacheDirty();let{id:$}=uA();await _B["close-budget"]();await _B["load-budget"]({id:$});await _B["get-budget-bounds"]();await uK();await c9().catch($=>{});aZ("finish-import");_x=false};_B["api/abort-import"]=async function(){if(_x){_W();let{id:$}=uA();await _B["close-budget"]();await _B["delete-budget"]({id:$});aZ("show-budgets")}_x=false};_B["api/query"]=async function({query:$}){_W();return uh($)};_B["api/budget-months"]=async function(){_W();let{start:$,end:ee}=await _B["get-budget-bounds"]();return nz($,ee)};_B["api/budget-month"]=async function({month:$}){_W();await _U($);let ee=await dl();let et=nQ($);function en($){let ee=uF().getCellValue(et,$);return ee===""?0:ee}return{month:$,incomeAvailable:en("available-funds"),lastMonthOverspent:en("last-month-overspent"),forNextMonth:en("buffered"),totalBudgeted:en("total-budgeted"),toBudget:en("to-budget"),fromLastMonth:en("from-last-month"),totalIncome:en("total-income"),totalSpent:en("total-spent"),totalBalance:en("total-leftover"),categoryGroups:ee.map($=>{if($.is_income){return{..._M.toExternal($),received:en("total-income"),categories:$.categories.map($=>({..._k.toExternal($),received:en(`sum-amount-${$.id}`)}))}}return{..._M.toExternal($),budgeted:en(`group-budget-${$.id}`),spent:en(`group-sum-amount-${$.id}`),balance:en(`group-leftover-${$.id}`),categories:$.categories.map($=>({..._k.toExternal($),budgeted:en(`budget-${$.id}`),spent:en(`sum-amount-${$.id}`),balance:en(`leftover-${$.id}`),carryover:en(`carryover-${$.id}`)}))}})}};_B["api/budget-set-amount"]=_F(async function({month:$,categoryId:ee,amount:et}){_W();return _B["budget/budget-amount"]({month:$,category:ee,amount:et})});_B["api/budget-set-carryover"]=_F(async function({month:$,categoryId:ee,flag:et}){_W();await _U($);await _j("budget-set-carryover",ee);return _B["budget/set-carryover"]({startMonth:$,category:ee,flag:et})});_B["api/transactions-export"]=async function({transactions:$,categoryGroups:ee,payees:et}){_W();return _B["transactions-export"]({transactions:$,categoryGroups:ee,payees:et})};_B["api/transactions-import"]=_F(async function({accountId:$,transactions:ee}){_W();return _B["transactions-import"]({accountId:$,transactions:ee})});_B["api/transactions-add"]=_F(async function({accountId:$,transactions:ee}){_W();await mk($,ee,{runTransfers:false});return"ok"});_B["api/transactions-get"]=async function({accountId:$,startDate:ee,endDate:et}){_W();let{data:en}=await uh(sX("transactions").filter({$and:[$&&{account:$},ee&&{date:{$gte:ee}},et&&{date:{$lte:et}}].filter(Boolean)}).select("*").options({splits:"grouped"}));return en};_B["api/transactions-filter"]=async function({text:$,accountId:ee}){throw new Error("`filterTransactions` is deprecated, use `runQuery` instead")};_B["api/transaction-update"]=_F(async function({id:$,fields:ee}){_W();let{data:et}=await uh(sX("transactions").filter({id:$}).select("*").options({splits:"grouped"}));let en=iG(et);if(en.length===0){return[]}let{diff:ei}=iQ(en,ee);return _B["transactions-batch-update"](ei)});_B["api/transaction-delete"]=_F(async function({id:$}){_W();let{data:ee}=await uh(sX("transactions").filter({id:$}).select("*").options({splits:"grouped"}));let et=iG(ee);if(et.length===0){return[]}let{diff:en}=i0(et,$);return _B["transactions-batch-update"](en)});_B["api/accounts-get"]=async function(){_W();let $=await dC();return $.map($=>_C.toExternal($))};_B["api/account-create"]=_F(async function({account:$,initialBalance:ee=null}){_W();return _B["account-create"]({name:$.name,offBudget:$.offbudget,closed:$.closed,balance:ee!=null?iP(ee):null})});_B["api/account-update"]=_F(async function({id:$,fields:ee}){_W();return dM({id:$,..._C.fromExternal(ee)})});_B["api/account-close"]=_F(async function({id:$,transferAccountId:ee,transferCategoryId:et}){_W();return _B["account-close"]({id:$,transferAccountId:ee,categoryId:et})});_B["api/account-reopen"]=_F(async function({id:$}){_W();return _B["account-reopen"]({id:$})});_B["api/account-delete"]=_F(async function({id:$}){_W();return _B["account-close"]({id:$,forced:true})});_B["api/categories-get"]=async function({grouped:$}={}){_W();let ee=await _B["get-categories"]();return $?ee.grouped.map(_M.toExternal):ee.list.map(_k.toExternal)};_B["api/category-group-create"]=_F(async function({group:$}){_W();return _B["category-group-create"]({name:$.name})});_B["api/category-group-update"]=_F(async function({id:$,fields:ee}){_W();return _B["category-group-update"]({id:$,..._M.fromExternal(ee)})});_B["api/category-group-delete"]=_F(async function({id:$,transferCategoryId:ee}){_W();return _B["category-group-delete"]({id:$,transferId:ee})});_B["api/category-create"]=_F(async function({category:$}){_W();return _B["category-create"]({name:$.name,groupId:$.group_id,isIncome:$.is_income})});_B["api/category-update"]=_F(async function({id:$,fields:ee}){_W();return _B["category-update"]({id:$,..._k.fromExternal(ee)})});_B["api/category-delete"]=_F(async function({id:$,transferCategoryId:ee}){_W();return _B["category-delete"]({id:$,transferId:ee})});_B["api/payees-get"]=async function(){_W();let $=await _B["payees-get"]();return $.map(_L.toExternal)};_B["api/payee-create"]=_F(async function({payee:$}){_W();return _B["payee-create"]({name:$.name})});_B["api/payee-update"]=_F(async function({id:$,fields:ee}){_W();return _B["payees-batch-change"]({updated:[{id:$,..._L.fromExternal(ee)}]})});_B["api/payee-delete"]=_F(async function({id:$}){_W();return _B["payees-batch-change"]({deleted:[{id:$}]})});function _z($){let ee=Object.assign({},$,_B);_B=ee;return ee};const _V="db.latest.sqlite";let _$=null;async function _q($){const ee=od($);const et=ou(ee,"backups");let en=[];if(await oP(et)){en=await ox(et);en=en.filter($=>$.match(/\.sqlite$/))}const ei=await Promise.all(en.map(async $=>{const ee=await o$(ou(et,$));return{id:$,date:new Date(ee)}}));ei.sort(($,ee)=>{if($.date<ee.date){return 1}else if($.date>ee.date){return-1}return 0});return ei}async function _G($){const ee=od($);if(await oP(ou(ee,_V))){return{id:_V,date:null,isLatest:true}}return null}async function _Y($){let ee=await _q($);let et=await _G($);if(et){ee.unshift(et)}return ee.map($=>({...$,date:$.date?t4($.date,"yyyy-MM-dd h:mm"):null}))}async function _K($){const ee=$.reduce(($,ee)=>{const et=t4(ee.date,"yyyy-MM-dd");$[et]=$[et]||[];$[et].push(ee);return $},{});const et=[];for(let $ of Object.keys(ee)){const en=ee[$];const ei=$===nR();for(let $ of en.slice(ei?3:1)){et.push($.id)}}const en=$.filter($=>!et.includes($.id));return et.concat(en.slice(10).map($=>$.id))}async function _Z($){const ee=od($);if(await oP(ou(ee,_V))){await oH(ou(od($),_V))}let et=`${e_()}.sqlite`;let en=ou(ee,"backups",et);if(!await oP(ou(ee,"backups"))){await oF(ou(ee,"backups"))}await oU(ou(ee,"db.sqlite"),en);const ei=oe(en);await a3(ei,"DELETE FROM messages_crdt");await a3(ei,"DELETE FROM messages_clock");ot(ei);const eo=await _K(await _q($));for(let $ of eo){await oH(ou(ee,"backups",$))}aZ("backups-updated",await _Y($))}async function _J($,ee){const et=od($);if(!await oP(ou(et,_V))){await oU(ou(et,"db.sqlite"),ou(et,_V));await oU(ou(et,"metadata.json"),ou(et,"metadata.latest.json"));_Q();_X($);await uS($)}if(ee===_V){console.log("Reverting backup");await oU(ou(et,_V),ou(et,"db.sqlite"));await oU(ou(et,"metadata.latest.json"),ou(et,"metadata.json"));await oH(ou(et,_V));await oH(ou(et,"metadata.latest.json"));try{await c9()}catch($){}uO()}else{console.log("Loading backup",ee);await uS($);await uT({groupId:null,lastSyncedTimestamp:null,lastUploaded:null});try{await c9()}catch($){}uO();await oU(ou(et,"backups",ee),ou(et,"db.sqlite"))}}function _X($){if(_$){clearInterval(_$)}_$=setInterval(async()=>{console.log("Making backup");await _Z($)},1e3*60*15)}function _Q(){clearInterval(_$);_$=null}var _0=__webpack_require__(5070);function _1({month:$}){return _2($)}async function _2($){let ee=0;let et=0;let en=0;let ei=[];let eo=[];let es=await _4();let eu=await f2("SELECT * FROM v_categories WHERE tombstone = 0");let el=nQ($);for(let ei=0;ei<eu.length;ei++){let ef=eu[ei];let ed=es[ef.id];if(ed){if(ed.filter($=>$.type==="source").length>0){let et=await uZ(el,`leftover-${ef.id}`);let en=await uZ(el,`budget-${ef.id}`);await u4({category:ef.id,month:$,amount:en-et});ee+=1}if(ed.filter($=>$.type==="sink").length>0){eo.push({cat:ef,temp:ed});et+=1;en+=ed.filter($=>$.type==="sink")[0].weight}}}let ef=parseInt($.replace("-",""));for(let ee=0;ee<eu.length;ee++){let et=eu[ee];let en=await uZ(el,`to-budget`);let ei=await uZ(el,`leftover-${et.id}`);let eo=await uZ(el,`budget-${et.id}`);let es=eo+Math.abs(ei);let ed=et.id;let ep=await f6(`SELECT carryover FROM zero_budgets WHERE month = ? and category = ?`,[ef,ed]);if(ei<0&&Math.abs(ei)<=en&&!et.is_income&&ep.carryover===0){await u4({category:et.id,month:$,amount:es})}}let ed=await uZ(el,`to-budget`);if(ed<=0){ei.push("No funds are available to reallocate.")}for(let ee=0;ee<eo.length;ee++){let et=await uZ(el,`budget-${eo[ee].cat.id}`);let ei=eo[ee].cat.id;let es=eo[ee].temp.filter($=>$.type==="sink")[0].weight;let eu=et+Math.round(es/en*ed);if(ee===eo.length-1){let $=await uZ(el,`to-budget`);if(eu>$){eu=et+$}}await u4({category:ei,month:$,amount:eu})}if(ee===0){if(ei.length){return{type:"error",sticky:true,message:`There were errors interpreting some templates:`,pre:ei.join("\n\n")}}else{return{type:"message",message:"All categories were up to date."}}}else{let $=`Successfully returned funds from ${ee} ${ee===1?"source":"sources"} and funded ${et} sinking ${et===1?"fund":"funds"}.`;if(ei.length){return{sticky:true,message:`${$} There were errors interpreting some templates:`,pre:ei.join("\n\n")}}else{return{type:"message",message:$}}}}const _6="#cleanup ";async function _4(){let $={};let ee=await f2(`SELECT * FROM notes WHERE lower(note) like '%${_6}%'`);for(let et=0;et<ee.length;et++){let en=ee[et].note.split("\n");let ei=[];for(let $=0;$<en.length;$++){let ee=en[$].trim();if(!ee.toLowerCase().startsWith(_6))continue;let et=ee.slice(_6.length);try{let $=(0,_0.parse)(et);ei.push($)}catch($){ei.push({type:"error",line:ee,error:$})}}if(ei.length){$[ee[et].id]=ei}}return $};function _3($){eE(1,arguments);var ee=eS($);ee.setHours(0,0,0,0);return ee};function _8($){eE(1,arguments);var ee=eS($);var et=ee.getDay();return et===0||et===6};function _5($){eE(1,arguments);var ee=eS($);var et=ee.getDay();return et};function _9($,ee){eE(2,arguments);var et=ee-_5($);if(et<=0)et+=7;return r9($,et)};function _7($){eE(1,arguments);return _9($,1)};function ve($,ee){eE(2,arguments);var et=_5($)-ee;if(et<=0)et+=7;return nt($,et)};function vt($){eE(1,arguments);return ve($,5)}var vr=__webpack_require__(251);var vn=__webpack_require__.n(vr);var vo=864e5;function vs($,ee){eE(2,arguments);var et=_3($);var en=_3(ee);var ei=et.getTime()-e8(et);var eo=en.getTime()-e8(en);return Math.round((ei-eo)/vo)};function vu($,ee){var et=$.getFullYear()-ee.getFullYear()||$.getMonth()-ee.getMonth()||$.getDate()-ee.getDate()||$.getHours()-ee.getHours()||$.getMinutes()-ee.getMinutes()||$.getSeconds()-ee.getSeconds()||$.getMilliseconds()-ee.getMilliseconds();if(et<0){return-1}else if(et>0){return 1}else{return et}}function vl($,ee){eE(2,arguments);var et=eS($);var en=eS(ee);var ei=vu(et,en);var eo=Math.abs(vs(et,en));et.setDate(et.getDate()-ei*eo);var es=Number(vu(et,en)===-ei);var eu=ei*(eo-es);return eu===0?0:eu};function vc($,ee){eE(2,arguments);var et=eI(ee);return r7($,-et)};function vf($){eE(1,arguments);var ee=eS($);var et=ee.getDate();return et};function vd($,ee){eE(2,arguments);var et=eI(ee);return r8($,et*12)};function vp($,ee){eE(2,arguments);var et=eI(ee);return vd($,-et)};function vh($){let ee=new ym({rrules:pg($)});return ee.occurrences({take:3}).toArray().map($=>$.date)}async function vy($,ee){let{data:et}=await uh(sX("transactions").filter({account:ee,schedule:null,"payee.transfer_acct":null,$and:[{date:{$gte:nt($,2)}},{date:{$lte:r9($,2)}}]}).select("*").options({splits:"none"}));return et}function vg($,ee){let et=Math.abs(vl(nT($),nT(ee)));return 1/(et+1)}function vm($,ee,et=.5){$=[...$].reverse();let en=$[0];let ei=$.slice(1);let eo=[];for(let et of en.transactions){let es=pn(et.amount);let eu=et.payee;let el=ei.map($=>{let ee=$.transactions.find($=>$.amount>=et.amount-es&&$.amount<=et.amount+es);ee=ee&&ee.payee===eu?ee:null;if(ee){return{trans:ee,rank:vg($.date,ee.date)}}return null});if(el.indexOf(null)!==-1){continue}let ef=el.reduce(($,ee)=>$+ee.rank,vg(en.date,et.date));let ed=el.reduce(($,ee)=>$&&ee.trans.amount===et.amount,true);eo.push({rank:ef,amount:et.amount,account:et.account,payee:et.payee,date:ee,exactDate:ef===$.length,exactAmount:ed})}return eo}async function v_($,ee,et,en,ei){let eo=[];for(let es=0;es<ee;es++){let ee=r9($,es);let eu;if(typeof et==="function"){eu=et(ee);if(eu===false){continue}}else{eu={...et,start:ee}}eu.start=nI(eu.start);let el=[];let ef=vh(eu);for(let $ of ef){el.push({date:nI($),transactions:await vy($,en)})}eo=eo.concat(vm(el,eu,ei))}return eo}async function vv($,ee){return v_(vc(nT($),4),7*2,{frequency:"weekly"},ee)}async function vw($,ee){return v_(vc(nT($),7),7*2,{frequency:"weekly",interval:2},ee)}async function vE($,ee){return v_(r5(nT($),4),31*2,$=>{if(vf($)>28){return false}return{start:$,frequency:"monthly"}},ee)}async function vS($,ee){let et=await v_(r5(nT($),3),1,{frequency:"monthly",patterns:[{type:"day",value:-1}]},ee,.75);let en=await v_(r5(nT($),4),1,{frequency:"monthly",patterns:[{type:"day",value:-1}]},ee,.75);return et.concat(en)}async function vT($,ee){return v_(vc(nT($),8),14,$=>{let ee=t4(new Date,"iiii");let et=ee.slice(0,2).toUpperCase();return{start:$,frequency:"monthly",patterns:[{type:et,value:1},{type:et,value:3}]}},ee)}async function vO($,ee){return v_(r5(nT($),8),14,$=>{let ee=t4(new Date,"iiii");let et=ee.slice(0,2).toUpperCase();return{start:$,frequency:"monthly",patterns:[{type:et,value:2},{type:et,value:4}]}},ee)}async function vA($){let ee=$._conditions;let et=ee.find($=>$.field==="date");let en=et.value;while(1){let $=en;en={...$};switch(en.frequency){case"weekly":en.start=nI(vc(nT(en.start),en.interval||1));break;case"monthly":en.start=nI(r5(nT(en.start),en.interval||1));break;case"yearly":en.start=nI(vp(nT(en.start),en.interval||1));break;default:throw new Error("findStartDate: invalid frequency")}let et=ee.map($=>$.field==="date"?{...$,value:en}:$);let{filters:ei,errors:eo}=mi(et,{recurDateBounds:1});if(eo.length>0){en=null;break}let{data:es}=await uh(sX("transactions").filter({$and:ei}).select("*"));if(es.length===0){en=$;break}}if(en){return{...$,date:en,_conditions:ee.map($=>$.field==="date"?{...$,value:en}:$)}}return $}async function vI(){let{data:$}=await uh(sX("accounts").filter({closed:false}).select("*"));let ee=[];for(let et of $){let $=await f6("SELECT * FROM v_transactions WHERE account = ? AND parent_id IS NULL ORDER BY date DESC LIMIT 1",[et.id]);if($){let en=oY($.date);ee=ee.concat(await vv(en,et.id),await vw(en,et.id),await vE(en,et.id),await vS(en,et.id),await vT(en,et.id),await vO(en,et.id))}}let et=[...io(ee,"payee").entries()].map(([$,ee])=>{ee.sort(($,ee)=>ee.rank-$.rank);let et=ee[0];return{id:e_(),account:et.account,payee:et.payee,date:et.date,amount:et.amount,_conditions:[{op:"is",field:"account",value:et.account},{op:"is",field:"payee",value:et.payee},{op:et.exactDate?"is":"isapprox",field:"date",value:et.date},{op:et.exactAmount?"is":"isapprox",field:"amount",value:et.amount}]}});let en=[];for(let $ of et){en.push(await vA($))}return en};function vN($,ee){let et=[];for(let en=0;en<$.length;en++){et.push([$[en],ee[en]])}return et}function vD($,ee){let et=pm($);let en=pm(ee);let ei=vN(Object.values(et),Object.values(en));let eo=$.map($=>{let ee=ei.find(ee=>$===ee[0]);return ee&&ee[1]?ee[1]:$});let es=ei.filter($=>$[0]==null&&$[1]!=null).map($=>$[1]);return eo.concat(es)}function vR($,ee=new Date(nR())){ee=_3(ee);let et=new gE($.op,"date",$.value,null,new Map(Object.entries({date:"date"})));let en=et.getValue();if(en.type==="date"){return en.date}else if(en.type==="recur"){let $=en.schedule.occurrences({start:ee,take:1}).toArray();if($.length>0){let ee=$[0].date;if(en.schedule.data.skipWeekend){ee=vG(ee,en.schedule.data.weekendSolve)}return nI(ee)}}return null}async function vC($){if($==null){throw new Error("Schedule not attached to a rule")}let{data:ee}=await uh(sX("schedules").filter({id:$}).calculate("rule"));return g5().find($=>$.id===ee)}async function vk($){let{data:ee}=await uh(sX("schedules").filter({id:$}).calculate("rule"));if(ee){await de("rules",ee)}let et=await g9({stage:null,conditionsOp:"and",conditions:[{op:"isapprox",field:"date",value:nR()},{op:"isapprox",field:"amount",value:0}],actions:[{op:"link-schedule",value:$}]});await ds("schedules",{id:$,rule:et});return g5().find($=>$.id===et)}async function vM({id:$,start:ee,conditions:et,reset:en}){if(et==null){let ee=await vC($);if(ee==null){throw new Error("No rule found for schedule")}et=ee.serialize().conditions}let{date:ei}=pm(et);let{data:eo}=await uh(sX("schedules").filter({id:$}).calculate("next_date"));if(ei){let et=vR(ei,ee?ee(eo):new Date);if(et!==eo){let ee=await f6("SELECT id, base_next_date_ts FROM schedules_next_date WHERE schedule_id = ?",[$]);await f5("schedules_next_date",en?{id:ee.id,base_next_date:oG(et),base_next_date_ts:Date.now()}:{id:ee.id,local_next_date:oG(et),local_next_date_ts:ee.base_next_date_ts})}}}async function vL($,ee){let et=await f6("SELECT id from schedules WHERE tombstone = 0 AND name = ?",[$]);if(et==null){return false}if(ee){return et["id"]!==ee}return true}async function vx({schedule:$=null,conditions:ee=[]}={}){let et=$?.id||e_();let{date:en}=pm(ee);if(en==null){throw new Error("A date condition is required to create a schedule")}if(en.value==null){throw new Error("Date is required")}let ei=vR(en);let eo=ei?oG(ei):null;if($){if($.name){if(await vL($.name,et)){throw new Error("Cannot create schedules with the same name")}}else{$.name=null}}let es=await g9({stage:null,conditionsOp:"and",conditions:ee,actions:[{op:"link-schedule",value:et}]});let eu=Date.now();await f9("schedules_next_date",{schedule_id:et,local_next_date:eo,local_next_date_ts:eu,base_next_date:eo,base_next_date_ts:eu});await di("schedules",{...$,id:et,rule:es});return et}async function vP({schedule:$,conditions:ee,resetNextDate:et}){if($.rule){throw new Error("You cannot change the rule of a schedule")}let en;if(ee){let{date:et}=pm(ee);if(et&&et.value==null){throw new Error("Date is required")}en=await vC($.id);if(en==null){en=await vk($.id)}}await fI(async()=>{if(ee){let ei=en.serialize().conditions;let eo=vD(ei,ee);await g7({id:en.id,conditions:eo});let es=({type:$,...ee})=>ee;if(et||!vn()(ei.find($=>$.field==="account"),ei.find($=>$.field==="account"))||!vn()(es(ei.find($=>$.field==="date")||{}),es(eo.find($=>$.field==="date")||{}))){await vM({id:$.id,conditions:eo,reset:true})}}else if(et){await vM({id:$.id,reset:true})}await ds("schedules",$)})}async function vF({id:$}){let{data:ee}=await uh(sX("schedules").filter({id:$}).calculate("rule"));await fI(async()=>{await de("rules",ee);await de("schedules",$)})}async function vB({id:$}){return vM({id:$,start:$=>{return r9(nT($),1)}})}function vU(){return vI()}async function vj({config:$,count:ee}){let et=pg($);try{let en=new ym({rrules:et});return en.occurrences({start:_3(new Date),take:ee}).toArray().map(ee=>$.skipWeekend?vG(ee.date,$.weekendSolveMode):ee.date).map($=>nI($))}catch(ee){aN($);throw ee}}function vW($){let{actions:ee,conditions:et}=$ instanceof gO?$.serialize():g4.toJS($);if(ee&&ee.find($=>$.op==="link-schedule")){let $=ee.find($=>$.op==="link-schedule").value;if($){let ee=pm(et);let en=et.findIndex($=>$===ee.payee);let ei=et.findIndex($=>$===ee.account);let eo=et.findIndex($=>$===ee.amount);let es=et.findIndex($=>$===ee.date);fK("INSERT OR REPLACE INTO schedules_json_paths (schedule_id, payee, account, amount, date) VALUES (?, ?, ?, ?, ?)",[$,en===-1?null:`$[${en}]`,ei===-1?null:`$[${ei}]`,eo===-1?null:`$[${eo}]`,es===-1?null:`$[${es}]`])}}}function vH(){f0(()=>{g5().forEach($=>{vW($)})});return f_(vz)}function vz($,ee){ee.forEach(($,ee)=>{if(ee==="rules"){$.forEach($=>{vW($)})}})}async function vV({id:$}){let{data:ee}=await uh(sX("schedules").filter({id:$}).select("*"));let et=ee[0];if(et==null||et._account==null){return}let en={payee:et._payee,account:et._account,amount:p_(et._amount),date:et.next_date,schedule:et.id,cleared:false};if(en.account){await mk(en.account,[en])}}async function v$($){let{data:ee}=await uh(sX("schedules").filter({completed:false,"_account.closed":false}).select("*"));let{data:et}=await uh(pd(ee));let en=new Set(et.filter(Boolean).map($=>$.schedule));let ei=[];let eo=false;for(let et of ee){let ee=pf(et.next_date,et.completed,en.has(et.id));if(ee==="paid"){if(et._date){if(et._date.frequency){try{await vM({id:et.id})}catch($){}}else{if(et._date<nR()){await vP({schedule:{id:et.id,completed:true}})}}}}else if((ee==="due"||ee==="missed")&&et.posts_transaction&&et._account){if($){await vV({id:et.id});eo=true}else{ei.push(et._payee)}}}if(ei.length>0){aZ("schedules-offline",{payees:ei})}else if(eo){aZ("sync-event",{type:"success",tables:["transactions"],syncDisabled:"false"})}}let vq=lX();vq.method("schedule/create",aP(cd(vx)));vq.method("schedule/update",aP(cd(vP)));vq.method("schedule/delete",aP(cd(vF)));vq.method("schedule/skip-next-date",aP(cd(vB)));vq.method("schedule/post-transaction",aP(cd(vV)));vq.method("schedule/force-run-service",aP(()=>v$(true)));vq.method("schedule/discover",vU);vq.method("schedule/get-upcoming-dates",vj);vq.service(vH);vq.events.on("sync",({type:$,subtype:ee})=>{let et=$==="success"||$==="error"||$==="unauthorized";if(et&&uA()){let{lastScheduleRun:ee}=uA();if(ee!==nR()){aV(()=>v$($==="success"));uT({lastScheduleRun:nR()})}}});function vG($,ee){if(_8($)){if(ee==="after"){return _7($)}else if(ee==="before"){return vt($)}else{throw new Error("Unknown weekend solve mode, this should not happen!")}}return $}const vY=vq;var vK=__webpack_require__(4939);async function vZ({month:$}){let ee=await v9(null);return v6($,false,ee)}async function vJ({month:$}){let ee=await v9(null);return v6($,true,ee)}async function vX({month:$,category:ee}){let et=await f2(`SELECT * FROM v_categories WHERE id = ?`,[ee]);let en=await v9(et[0]);await u4({category:ee,month:$,amount:0});return v6($,false,en)}function vQ(){return be()}function v0($){let ee=$[0].priority;let et=false;for(let en=1;en<$.length;en++){if($[en].priority!==ee){ee=Math.min(ee,$[en].priority);et=true}}return{lowPriority:ee,errorNotice:et}}async function v2({month:$,templateBudget:ee}){await fI(async()=>{ee.forEach(ee=>{u4({category:ee.category,month:$,amount:ee.amount})})})}async function v6($,ee,et){let en=0;let ei=[];let eo=0;let es=[];let eu=[];let el=await f2("SELECT * FROM v_categories WHERE tombstone = 0 AND hidden = 0");for(let ee=0;ee<el.length;ee++){let en=el[ee];let ei=await uZ(nQ($),`budget-${en.id}`);let ef=et[en.id];if(ef){for(let $=0;$<ef.length;$++){eo=ef[$].priority>eo?ef[$].priority:eo}}if(ei){es.push({category:en.id,amount:ei,isIncome:en.is_income,isTemplate:ef?true:false});eu.push({category:en.id,amount:0,isIncome:en.is_income,isTemplate:ef?true:false})}}await v2({month:$,templateBudget:eu.filter($=>$.isTemplate===true)});let ef;let ed=eo+1;let ep=0;for(let $=0;$<el.length;$++){let ee=el[$];let en=et[ee.id];if(en){for(let $=0;$<en.length;$++){if(en[$].type==="remainder"){en[$].priority=ed;ep+=en[$].weight;ef=true}}}}if(ef)eo=ed;let eh=nQ($);let ey=await uZ(eh,`to-budget`);let eg=uQ()?await uZ(eh,`total-saved`):await uZ(eh,`to-budget`);for(let es=0;es<=eo;es++){let eu=[];let ef=1;if(es===eo){let $=await uZ(eh,`to-budget`);ef=$/ep}for(let eo=0;eo<el.length;eo++){let ed=el[eo];let ep=et[ed.id];if(ep){let et=false;let eo=false;let el=0;if(ep.filter($=>($.type==="schedule"||$.type==="by")&&$.priority===es).length>0){ep=ep.filter($=>$.priority===es&&($.type!=="schedule"||$.type!=="by")||$.type==="schedule"||$.type==="by");let{lowPriority:$,errorNotice:ee}=await v0(ep);el=$;et=el!==es?true:false;eo=true;if(!et&&ee){ei.push(ed.name+": Schedules and By templates should all have the same priority. Using priority "+el)}}if(!et){if(!eo){ep=ep.filter($=>$.priority===es)}if(ep.length>0){ei=ei.concat(ep.filter($=>$.type==="error").map(({line:$,error:ee})=>[ed.name+": "+ee.message,$," ".repeat(v8.length+ee.location.start.offset)+"^"].join("\n")));let et=await uZ(eh,`budget-${ed.id}`);let{amount:eo,errors:el}=await v7(ed,ep,$,es,ef,ey,eg,et,ee);if(eo!=null){en++;if(eo>eg&&es>0){eo=eg}eu.push({category:ed.id,amount:eo+et});eg-=eo}if(el!=null){ei=ei.concat(el.map($=>`${ed.name}: ${$}`))}}}}}await v2({month:$,templateBudget:eu})}if(!ee){es=es.filter($=>$.isIncome===0&&$.isTemplate);for(let ee=0;ee<es.length;ee++){await u4({category:es[ee].category,month:$,amount:es[ee].amount});let et=ei.length;for(let $=0;$<et;$++){if(ei[$].includes(el.filter($=>$.id===es[ee].category)[0].name)){ei.splice($,1);et--}}}}if(en===0){if(ei.length){return{type:"error",sticky:true,message:`There were errors interpreting some templates:`,pre:ei.join("\n\n")}}else{return{type:"message",message:"All categories were up to date."}}}else{let $=`Successfully applied ${en} templates.`;if(ei.length){return{sticky:true,message:`${$} There were errors interpreting some templates:`,pre:ei.join("\n\n")}}else{return{type:"message",message:$}}}}const v8="#template";async function v9($){let ee={};let et=await f2(`SELECT * FROM notes WHERE lower(note) like '%${v8}%'`);if($)et=et.filter(ee=>ee.id===$.id);for(let $=0;$<et.length;$++){let en=et[$].note.split("\n");let ei=[];for(let $=0;$<en.length;$++){let ee=en[$].trim();if(!ee.toLowerCase().startsWith(v8))continue;let et=ee.slice(v8.length);try{let $=(0,vK.parse)(et);ei.push($)}catch($){ei.push({type:"error",line:ee,error:$})}}if(ei.length){ee[et[$].id]=ei}}return ee}async function v7($,ee,et,en,ei,eo,es,eu,el){let ef=`${et}-01`;let ed=[];let ep=await f2("SELECT name from schedules WHERE name NOT NULL AND tombstone = 0");ep=ep.map($=>$.name);let eh=false;ee=ee.filter($=>{switch($.type){case"by":case"spend":let ee=`${$.month}-01`;let et=nx(ee,ef);let en=$.annual?($.repeat||1)*12:$.repeat;let ei;if($.type==="spend"){ei=`${$.from}-01`}while(et<0&&en){ee=nM(ee,en);if(ei){ei=nM(ei,en)}et=nx(ee,ef)}if(et<0){ed.push(`${$.month} is in the past.`);return false}$.month=n1(ee,"yyyy-MM");if(ei){$.from=n1(ei,"yyyy-MM")}break;case"schedule":if(!ep.includes($.name)){ed.push(`Schedule ${$.name} does not exist`);return null}break;default:}return true});if(ee.length>1){ee=ee.sort(($,ee)=>{if($.type==="by"&&!$.annual){return nx(`${$.month}-01`,`${ee.month}-01`)}else if($.type==="schedule"||ee.type==="schedule"){return $.priority-ee.priority}else{return $.type.localeCompare(ee.type)}})}let ey=nQ(et);let eg=await uZ(ey,`sum-amount-${$.id}`);let em=await uZ(ey,`leftover-${$.id}`);let e_=0;let ew;let eE;let eS=em-eg-eu;let eT=0;for(let eu=0;eu<ee.length;eu++){let el=ee[eu];switch(el.type){case"simple":{if(el.limit!=null){if(ew!=null){ed.push(`More than one “up to” limit found.`);return{errors:ed}}else{ew=ix(el.limit.amount);eE=el.limit.hold}}let $=0;if(el.monthly!=null){let ee=ix(el.monthly);$=ee}else{$=ew}if(e_+$<es||!en){e_+=$}else{if(es>0)e_+=es;ed.push(`Insufficient funds.`)}break}case"by":{if(!uQ()){let $=0;let et=`${ee[eu].month}-01`;let ei=nx(et,ef);let eo=el.type==="by"?el.repeat:(el.repeat||1)*12;while(ei<0&&eo){et=nM(et,eo);ei=nx(ee[eu].month,ef)}if(eu===0)eT=eS;eT=ix(ee[eu].amount)-eT;if(eT>=0){$=eT;eT=0}else{$=0;eT=Math.abs(eT)}let ep=ei>=0?Math.round($/(ei+1)):0;if(ep>=0){if(e_+ep<es||!en){e_+=ep}else{if(es>0)e_+=es;ed.push(`Insufficient funds.`)}}}else{ed.push(`by templates are not supported in Report budgets`)}break}case"week":{let $=ix(el.amount);let ee=el.weeks!=null?Math.round(el.weeks):1;if(el.limit!=null){if(ew!=null){ed.push(`More than one “up to” limit found.`);return{errors:ed}}else{ew=ix(el.limit.amount);eE=el.limit.hold}}let et=el.starting;let ei=nM(ef,1);while(et<ei){if(et>=ef){if(e_+$<es||!en){e_+=$}else{if(es>0)e_+=es;ed.push(`Insufficient funds.`)}}et=nL(et,ee)}break}case"spend":{let ee=`${el.from}-01`;let et=`${el.month}-01`;let ei=eS;let eo=true;for(let et=ee;nx(ef,et)>0;et=nM(et,1)){let ee=nQ(n1(et,"yyyy-MM"));if(eo){let et=await uZ(ee,`sum-amount-${$.id}`);let en=await uZ(ee,`leftover-${$.id}`);ei=en-et;eo=false}else{let et=await uZ(ee,`budget-${$.id}`);ei+=et}}let eu=nx(et,nS(ef));let ep=ix(el.amount);let eh=0;if(eu<0){ed.push(`${el.month} is in the past.`);return{errors:ed}}else if(eu===0){eh=ep-ei}else{eh=Math.round((ep-ei)/(eu+1))}if(eh<es||!en){e_=eh}else{if(es>0)e_=es;ed.push(`Insufficient funds.`)}break}case"percentage":{let $=el.percent;let ee=0;if(el.category.toLowerCase()==="all income"){if(el.previous){let $=nQ(nM(et,-1));ee=await uZ($,"total-income")}else{ee=await uZ(ey,`total-income`)}}else if(el.category.toLowerCase()==="available funds"){ee=eo}else{let $=(await du()).find($=>$.is_income&&$.name.toLowerCase()===el.category.toLowerCase());if(!$){ed.push(`Could not find category “${el.category}”`);return{errors:ed}}if(el.previous){let en=nQ(nM(et,-1));ee=await uZ(en,`sum-amount-${$.id}`)}else{ee=await uZ(ey,`sum-amount-${$.id}`)}}let ei=Math.max(0,Math.round(ee*($/100)));if(ei+e_<=es||!en){e_+=ei}else{if(es>0)e_=es;ed.push(`Insufficient funds.`)}break}case"schedule":{if(!eh){eh=true;let $=ee.filter($=>$.type==="schedule");let et=[];let ei=0;for(let ee=0;ee<$.length;ee++){let{id:en,completed:eo}=await f6("SELECT * FROM schedules WHERE name = ?",[$[ee].name]);console.log(eo);let es=await vC(en);let eu=es.serialize().conditions;let{date:el,amount:ep}=pm(eu);let eh=-ep.value;let ey=vR(el,nS(ef));let eg=el.value.interval?el.value.interval:1;let em=el.value.frequency;let e_=Object(el.value)===el.value&&"frequency"in el.value;let ew=nx(ey,ef);et.push({template:$[ee],target:eh,next_date_string:ey,target_interval:eg,target_frequency:em,num_months:ew,completed:eo});if(!eo){if(e_){let $=0;let en=nM(ef,et[ee].num_months+1);let eo=vR(el,nS(ef));while(eo<en){$+=ep.value;eo=nF(eo,1);eo=vR(el,nS(eo))}et[ee].target=-$;ei+=eh}}else{ed.push(`Schedule ${et[ee].template.name} is a completed schedule.`)}}et=et.filter($=>$.completed===0);et=et.sort(($,ee)=>ee.target-$.target);let eo=0;if(em>=ei){for(let $=0;$<et.length;$++){if(et[$].num_months<0){ed.push(`Non-repeating schedule ${et[$].template.name} was due on ${et[$].next_date_string}, which is in the past.`);break}if(et[$].template.full&&et[$].num_months===0||et[$].target_frequency==="weekly"||et[$].target_frequency==="daily"){eo+=et[$].target}else if(et[$].template.full&&et[$].num_months>0){eo+=0}else{eo+=et[$].target/et[$].target_interval}}}else if(em<ei){for(let $=0;$<et.length;$++){if(uQ()){if(!et[$].template.full){ed.push(`Report budgets require the full option for Schedules.`);break}if(et[$].template.full&&et[$].num_months===0){e_+=et[$].target}}if(!uQ()){if(et[$].num_months<0){ed.push(`Non-repeating schedule ${et[$].template.name} was due on ${et[$].next_date_string}, which is in the past.`);break}if(et[$].template.full&&et[$].num_months>0){eT=0}else if($===0&&!et[$].template.full){eT=et[$].target-eS}else{eT=et[$].target-eT}let ee=0;if(eT>=0){ee=eT;eT=0}else{ee=0;eT=Math.abs(eT)}if(et[$].template.full||et[$].num_months===0||et[$].target_frequency==="weekly"||et[$].target_frequency==="daily"){eo+=ee}else if(et[$].template.full&&et[$].num_months>0){eo+=0}else{eo+=ee/(et[$].num_months+1)}}}}eo=Math.round(eo);if(eo>0&&e_+eo<=es||!en){e_+=eo}else if(e_+eo>es&&es>=0){e_=es;ed.push(`Insufficient funds.`)}}break}case"remainder":{if(ei>=0){e_+=ei===0?Math.round(el.weight):Math.round(ei*el.weight);if(e_>=es){e_=es}else if(es-e_===1){e_=e_+1}}break}case"error":return{errors:ed};default:}}if(ew!=null){if(eE&&em>ew){e_=0}else if(e_+em>ew){e_=ew-em}}if(($.budgeted!=null&&$.budgeted!==0||e_===0)&&!el){return{errors:ed}}else if($.budgeted===e_){return null}else{let et=$.name+": "+iP(eS);et+=" + "+iP(e_)+" = "+iP(eS+e_);et+=" "+ee.map($=>$.line).join("\n");console.log(et);return{amount:e_,errors:ed}}}async function be(){let $=await v9(null);let ee=[];let et=await f2("SELECT * FROM v_categories WHERE tombstone = 0");for(let en=0;en<et.length;en++){let ei=et[en];let eo=$[ei.id];if(eo){for(let $=0;$<eo.length;$++){if(eo[$].type==="error"){ee.push(ei.name+": "+eo[$].line)}}}}if(ee.length){return{sticky:true,message:`There were errors interpreting some templates:`,pre:ee.join("\n\n")}}else{return{type:"message",message:"All templates passed! 🎉"}}};let bt=lX();bt.method("budget/budget-amount",aP(cd(u4)));bt.method("budget/copy-previous-month",aP(cd(u5)));bt.method("budget/copy-single-month",aP(cd(u9)));bt.method("budget/set-zero",aP(cd(u7)));bt.method("budget/set-3month-avg",aP(cd(le)));bt.method("budget/set-n-month-avg",aP(cd(lt)));bt.method("budget/check-templates",aP(cd(vQ)));bt.method("budget/apply-goal-template",aP(cd(vZ)));bt.method("budget/overwrite-goal-template",aP(cd(vJ)));bt.method("budget/apply-single-template",aP(cd(vX)));bt.method("budget/cleanup-goal-template",aP(cd(_1)));bt.method("budget/hold-for-next-month",aP(cd(lr)));bt.method("budget/reset-hold",aP(cd(ln)));bt.method("budget/cover-overspending",aP(cd(li)));bt.method("budget/transfer-available",aP(cd(ls)));bt.method("budget/transfer-category",aP(cd(lu)));bt.method("budget/set-carryover",aP(cd(lf)));const br=bt;const bn={validate($,{update:ee}={}){oq("transaction_filters",$,["conditions"],ee);if(!ee||"conditionsOp"in $){if(!["and","or"].includes($.conditionsOp)){throw new Error("Invalid filter conditionsOp: "+$.conditionsOp)}}return $},toJS($){let{conditions:ee,conditions_op:et,...en}=$;return{...en,conditionsOp:et,conditions:g2(ee)}},fromJS($){let{conditionsOp:ee,...et}=$;if(ee){et.conditions_op=ee}return et}};async function bi($,ee,et){let en=await f6("SELECT id from transaction_filters WHERE tombstone = 0 AND name = ?",[$]);if(en===null){return false}if(!et){return en.id!==ee}return true}function bo($,ee,et){let{conditions:en,conditionsOp:ei}=$;let eo=[];let es=false;let eu;ee.map($=>{if(!es&&(en.length===1?true:$.conditionsOp===ei)&&!$.tombstone&&$.conditions.length===en.length){es=false;en.map((ee,et)=>{eo[et]=$.conditions.filter($=>{return ee.value===$.value&&ee.op===$.op&&ee.field===$.field}).length>0;es=(et===0?true:es)&&eo[et];return true});eu=es&&eo[en.length-1]&&$}return true});eo=[];if(!et){return eu?eu.id!==$.id?eu.name:false:false}return eu?eu.name:false}async function bs($){let ee=e_();let et={id:ee,conditions:$.state.conditions,conditionsOp:$.state.conditionsOp,name:$.state.name};if(et.name){if(await bi(et.name,et.id,true)){throw new Error("There is already a filter named "+et.name)}}else{throw new Error("Filter name is required")}if(et.conditions.length>0){let ee=bo(et,$.filters,true);if(ee){throw new Error("Duplicate filter warning: conditions already exist. Filter name: "+ee)}}else{throw new Error("Conditions are required")}await di("transaction_filters",bn.fromJS(et));return ee}async function bu($){let ee={id:$.state.id,conditions:$.state.conditions,conditionsOp:$.state.conditionsOp,name:$.state.name};if(ee.name){if(await bi(ee.name,ee.id,false)){throw new Error("There is already a filter named "+ee.name)}}else{throw new Error("Filter name is required")}if(ee.conditions.length>0){let et=bo(ee,$.filters,false);if(et){throw new Error("Duplicate filter warning: conditions already exist. Filter name: "+et)}}else{throw new Error("Conditions are required")}await ds("transaction_filters",bn.fromJS(ee))}async function bl($){await de("transaction_filters",$)}let bf=lX();bf.method("filter-create",aP(bs));bf.method("filter-update",aP(bu));bf.method("filter-delete",aP(cd(bl)));const bd=bf;async function bp($,ee){await Er["close-budget"]();let et;try{({id:et}=await c5({cloudFileId:null,groupId:null},ee))}catch($){if($.type==="FileDownloadError"){return{error:$.reason}}throw $}let en=await oe(ou(od(et),"db.sqlite"));a8(en,`
200
+ DELETE FROM kvcache;
201
+ DELETE FROM kvcache_key;
202
+ `);ot(en);await Er["load-budget"]({id:et});await Er["get-budget-bounds"]();await uK();await c9().catch($=>{})};function bh($,ee,et,en,ei,eo,es){try{var eu=$[eo](es);var el=eu.value}catch($){et($);return}if(eu.done){ee(el)}else{Promise.resolve(el).then(en,ei)}}function by($){return function(){var ee=this,et=arguments;return new Promise(function(en,ei){var eo=$.apply(ee,et);function es($){bh(eo,en,ei,es,eu,"next",$)}function eu($){bh(eo,en,ei,es,eu,"throw",$)}es(undefined)})}}function bg($,ee){var et,en,ei,eo,es={label:0,sent:function(){if(ei[0]&1)throw ei[1];return ei[1]},trys:[],ops:[]};return eo={next:eu(0),"throw":eu(1),"return":eu(2)},typeof Symbol==="function"&&(eo[Symbol.iterator]=function(){return this}),eo;function eu($){return function(ee){return el([$,ee])}}function el(eo){if(et)throw new TypeError("Generator is already executing.");while(es)try{if(et=1,en&&(ei=eo[0]&2?en["return"]:eo[0]?en["throw"]||((ei=en["return"])&&ei.call(en),0):en.next)&&!(ei=ei.call(en,eo[1])).done)return ei;if(en=0,ei)eo=[eo[0]&2,ei.value];switch(eo[0]){case 0:case 1:ei=eo;break;case 4:es.label++;return{value:eo[1],done:false};case 5:es.label++;en=eo[1];eo=[0];continue;case 7:eo=es.ops.pop();es.trys.pop();continue;default:if(!(ei=es.trys,ei=ei.length>0&&ei[ei.length-1])&&(eo[0]===6||eo[0]===2)){es=0;continue}if(eo[0]===3&&(!ei||eo[1]>ei[0]&&eo[1]<ei[3])){es.label=eo[1];break}if(eo[0]===6&&es.label<ei[1]){es.label=ei[1];ei=eo;break}if(ei&&es.label<ei[2]){es.label=ei[2];es.ops.push(eo);break}if(ei[2])es.ops.pop();es.trys.pop();continue}eo=ee.call($,es)}catch($){eo=[6,$];en=0}finally{et=ei=0}if(eo[0]&5)throw eo[1];return{value:eo[0]?eo[1]:void 0,done:true}}}function bm($,ee){return en($,ee)}function b_($,ee){return bv.apply(this,arguments)}function bv(){bv=by(function($,ee){var et;return bg(this,function(en){switch(en.label){case 0:return[4,bm("api/start-import",{budgetName:$})];case 1:en.sent();en.label=2;case 2:en.trys.push([2,4,,6]);return[4,ee()];case 3:en.sent();return[3,6];case 4:et=en.sent();return[4,bm("api/abort-import")];case 5:en.sent();throw et;case 6:return[4,bm("api/finish-import")];case 7:en.sent();return[2]}})});return bv.apply(this,arguments)}function bw($){return bE.apply(this,arguments)}function bE(){bE=by(function($){return bg(this,function(ee){return[2,bm("api/load-budget",{id:$})]})});return bE.apply(this,arguments)}function bS($){return bT.apply(this,arguments)}function bT(){bT=by(function($){var ee;var et=arguments;return bg(this,function(en){ee=(et.length>1&&et[1]!==void 0?et[1]:{}).password;return[2,bm("api/download-budget",{syncId:$,password:ee})]})});return bT.apply(this,arguments)}function bO(){return bA.apply(this,arguments)}function bA(){bA=by(function(){return bg(this,function($){return[2,bm("api/sync")]})});return bA.apply(this,arguments)}function bI($){return bN.apply(this,arguments)}function bN(){bN=by(function($){return bg(this,function(ee){switch(ee.label){case 0:return[4,bm("api/batch-budget-start")];case 1:ee.sent();ee.label=2;case 2:ee.trys.push([2,,4,6]);return[4,$()];case 3:ee.sent();return[3,6];case 4:return[4,bm("api/batch-budget-end")];case 5:ee.sent();return[7];case 6:return[2]}})});return bN.apply(this,arguments)}function bD($){return bm("api/query",{query:$.serialize()})}function bR(){return bm("api/budget-months")}function bC($){return bm("api/budget-month",{month:$})}function bM($,ee,et){return bm("api/budget-set-amount",{month:$,categoryId:ee,amount:et})}function bL($,ee,et){return bm("api/budget-set-carryover",{month:$,categoryId:ee,flag:et})}function bx($,ee){return bm("api/transactions-add",{accountId:$,transactions:ee})}function bP($,ee){return bm("api/transactions-import",{accountId:$,transactions:ee})}function bF($,ee,et){return bm("api/transactions-get",{accountId:$,startDate:ee,endDate:et})}function bB($,ee){return bm("api/transactions-filter",{accountId:$,text:ee})}function bU($,ee){return bm("api/transaction-update",{id:$,fields:ee})}function bj($){return bm("api/transaction-delete",{id:$})}function bW(){return bm("api/accounts-get")}function bH($,ee){return bm("api/account-create",{account:$,initialBalance:ee})}function bz($,ee){return bm("api/account-update",{id:$,fields:ee})}function bV($,ee,et){return bm("api/account-close",{id:$,transferAccountId:ee,transferCategoryId:et})}function b$($){return bm("api/account-reopen",{id:$})}function bq($){return bm("api/account-delete",{id:$})}function bG($){return bm("api/category-group-create",{group:$})}function bY($,ee){return bm("api/category-group-update",{id:$,fields:ee})}function bK($,ee){return bm("api/category-group-delete",{id:$,transferCategoryId:ee})}function bZ(){return bm("api/categories-get",{grouped:false})}function bJ($){return bm("api/category-create",{category:$})}function bX($,ee){return bm("api/category-update",{id:$,fields:ee})}function bQ($,ee){return bm("api/category-delete",{id:$,transferCategoryId:ee})}function b0(){return bm("api/payees-get")}function b6($){return bm("api/payee-create",{payee:$})}function b4($,ee){return bm("api/payee-update",{id:$,fields:ee})}function b3($){return bm("api/payee-delete",{id:$})};function b8($){return Math.round($*100)}function b5($){return parseFloat(($/100).toFixed(2))}var b9=__webpack_require__(3859);var b7=__webpack_require__.n(b9);async function we($,ee){const et=iU($.accounts,"sortableIndex");return Promise.all(et.map(async $=>{if(!$.isTombstone){const et=await bH({name:$.accountName,offbudget:$.onBudget?false:true,closed:$.hidden?true:false});ee.set($.entityId,et)}}))}async function wt($,ee){const et=iU($.masterCategories,"sortableIndex");await Promise.all(et.map(async $=>{if($.type==="OUTFLOW"&&!$.isTombstone&&$.subCategories&&$.subCategories.some($=>!$.isTombstone)){const et=await bG({name:$.name,is_income:false});ee.set($.entityId,et);if($.note){en("notes-save",{id:et,note:$.note})}if($.subCategories){const et=iU($.subCategories,"sortableIndex");et.reverse();for(let $ of et){if(!$.isTombstone){const et=await bJ({name:$.name,group_id:ee.get($.masterCategoryId)});ee.set($.entityId,et);if($.note){en("notes-save",{id:et,note:$.note})}}}}}}))}async function wr($,ee){for(let et of $.payees){if(!et.isTombstone){let $=await b6({name:et.name,category:ee.get(et.autoFillCategoryId)||null,transfer_acct:ee.get(et.targetAccountId)||null});ee.set(et.entityId,$)}}}async function wn($,ee){const et=await bZ();const en=et.find($=>$.name==="Income").id;const ei=await bW();const eo=await b0();function es($){if($==null||$==="Category/__Split__"){return null}else if($==="Category/__ImmediateIncome__"||$==="Category/__DeferredIncome__"){return en}return ee.get($)}function eu($){let ee=ei.find(ee=>ee.id===$);if(!ee){throw new Error("Could not find account for transaction when importing")}return ee.offbudget}for(let et of $.transactions){ee.set(et.entityId,e_());if(et.subTransactions){for(let $ of et.subTransactions){ee.set($.entityId,e_())}}}let el=io($.transactions,"accountId");await Promise.all([...el.keys()].map(async et=>{let en=el.get(et);let ei=en.map(en=>{if(en.isTombstone){return null}let ei=ee.get(en.entityId);function el(et){let en=ee.get(et.transferTransactionId)||null;let ei=null;let es=null;if(en){ei=eo.find($=>$.transfer_acct===ee.get(et.targetAccountId)).id}else{ei=ee.get(et.payeeId);es=$.payees.find($=>$.entityId===et.payeeId)?.name}return{transfer_id:en,payee:ei,imported_payee:es}}let ef={id:ei,amount:b8(en.amount),category:eu(ee.get(et))?null:es(en.categoryId),date:en.date,notes:en.memo||null,cleared:en.cleared==="Cleared",...el(en),subtransactions:en.subTransactions&&en.subTransactions.map(($,et)=>{return{id:ee.get($.entityId),amount:b8($.amount),category:es($.categoryId),notes:$.memo||null,...el($)}})};return ef}).filter($=>$);await bx(ee.get(et),ei)}))}function wi($,ee){const et=[...ee];$.masterCategories.forEach($=>{if($.subCategories){$.subCategories.forEach($=>{if(!et.find(ee=>ee.categoryId===$.entityId)){et.push({budgeted:0,categoryId:$.entityId})}})}});return et}async function wo($,ee){let et=iU($.monthlyBudgets,"month");await bI(async()=>{for(let en of et){let et=wi($,en.monthlySubCategoryBudgets.filter($=>!$.isTombstone));await Promise.all(et.map(async $=>{let et=b8($.budgeted);let ei=ee.get($.categoryId);let eo=nA(en.month);if(!ei){return}await bM(eo,ei,et);if($.overspendingHandling==="AffectsBuffer"){await bL(eo,ei,false)}else if($.overspendingHandling==="Confined"){await bL(eo,ei,true)}}))}})}function wu($){return $.split(",").reduce(($,ee)=>{const[et,en]=ee.split("-");return $+parseInt(en)},0)}function wl($,ee){let et=ee.map(ee=>{const et=$.readFile(ee).toString("utf8");let en;try{en=JSON.parse(et)}catch($){return null}if(en.hasFullKnowledge){return{deviceGUID:en.deviceGUID,shortName:en.shortDeviceId,recentness:wu(en.knowledge)}}return null}).filter($=>$);et=iU(et,"recentness");return et[et.length-1].deviceGUID}async function wc($){const ee=new Map;console.log("Importing Accounts...");await we($,ee);console.log("Importing Categories...");await wt($,ee);console.log("Importing Payees...");await wr($,ee);console.log("Importing Transactions...");await wn($,ee);console.log("Importing Budgets...");await wo($,ee);console.log("Setting up...")}function wf($,ee){let et=b7()($);if(!/\.zip/.test(et)){return null}et=et.replace(/\.zip$/,"").replace(/.ynab4$/,"");let en=et.match(/([^/~]+)[^/]*$/);if(!en){return null}return en[1]}function wd($,ee){let et=$.filter($=>$.entryName===ee);if(et.length===0){throw new Error("Could not find file: "+ee)}if(et.length>=2){throw new Error("File name matches multiple files: "+ee)}return et[0]}function wp(...$){return $.slice(1).reduce(($,ee)=>{return $+"/"+ee.replace(/^\//,"")},$[0].replace(/\/$/,""))}function wh($){let ee=new(cJ())($);let et=ee.getEntries();let en="";let ei=et[0].entryName.match(/([^/]*\.ynab4)/);if(ei){en=ei[1]+"/"}let eo=ee.readFile(wd(et,en+"Budget.ymeta"));let es=JSON.parse(eo.toString("utf8"));let eu=wp(en,es.relativeDataFolderName);let el=et.filter($=>$.entryName.startsWith(wp(eu,"devices")));let ef=wl(ee,el);const ed=wp(eu,ef,"Budget.yfull");let ep;try{ep=ee.readFile(wd(et,ed)).toString("utf8")}catch($){console.log($);throw new Error("Error reading Budget.yfull file")}try{return JSON.parse(ep)}catch($){throw new Error("Error parsing Budget.yfull file")}};function wy($){return Math.round($/10)}function wg($,ee){return Promise.all($.accounts.map(async $=>{if(!$.deleted){let et=await bH({name:$.name,offbudget:$.on_budget?false:true,closed:$.closed});ee.set($.id,et)}}))}async function wm($,ee){const et=await bZ();const en=et.find($=>$.name==="Income").id;const ei=["To be Budgeted","Inflow: Ready to Assign"];function eo(ee){if(ee.category_group_id===$.category_groups.find($=>$.name==="Internal Master Category").id){if(ei.includes(ee.name)){return"income"}else{return"internal"}}else if(ee.category_group_id===$.category_groups.find($=>$.name==="Credit Card Payments").id){return"creditCard"}}for(let et of $.category_groups){if(!et.deleted){let ei;if(et.name!=="Internal Master Category"&&et.name!=="Credit Card Payments"){ei=await bG({name:et.name,is_income:false});ee.set(et.id,ei)}let es=$.categories.filter($=>$.category_group_id===et.id);for(let $ of es.reverse()){if(!$.deleted){switch(eo($)){case"income":{let et=en;ee.set($.id,et);break}case"creditCard":case"internal":break;default:{let et=await bJ({name:$.name,group_id:ei});ee.set($.id,et);break}}}}}}}function w_($,ee){return Promise.all($.payees.map(async $=>{if(!$.deleted){let et=await b6({name:$.name});ee.set($.id,et)}}))}async function wv($,ee){const et=await b0();const en=await bZ();const ei=en.find($=>$.name==="Income").id;const eo=en.find($=>$.name==="Starting Balances").id;const es=$.payees.find($=>$.name==="Starting Balance").id;let eu=io($.transactions,"account_id");let el=io($.subtransactions,"transaction_id");for(let et of $.transactions){ee.set(et.id,e_())}for(let et of $.subtransactions){ee.set(et.id,e_())}await Promise.all([...eu.keys()].map(async en=>{let ef=eu.get(en);let ed=ef.map(en=>{if(en.deleted){return null}let eu=el.get(en.id);let ef={id:ee.get(en.id),account:ee.get(en.account_id),date:en.date,amount:wy(en.amount),category:ee.get(en.category_id)||null,cleared:["cleared","reconciled"].includes(en.cleared),notes:en.memo||null,imported_id:en.import_id||null,transfer_id:ee.get(en.transfer_transaction_id)||null,subtransactions:eu?eu.map($=>{return{id:ee.get($.id),amount:wy($.amount),category:ee.get($.category_id)||null,notes:$.memo}}):null,payee:null,imported_payee:null};if(en.transfer_account_id){ef.payee=et.find($=>$.transfer_acct===ee.get(en.transfer_account_id)).id}else{ef.payee=ee.get(en.payee_id);ef.imported_payee=$.payees.find($=>!$.deleted&&$.id===en.payee_id)?.name}if(en.payee_id===es&&ee.get(en.category_id)===ei){ef.category=eo;ef.payee=null}return ef}).filter($=>$);await bx(ee.get(en),ed)}))}async function ww($,ee){let et=iU($.months,"month");const en=$.category_groups.find($=>$.name==="Internal Master Category").id;const ei=$.category_groups.find($=>$.name==="Credit Card Payments").id;await bI(async()=>{for(let $ of et){let et=nA($.month);await Promise.all($.categories.map(async $=>{let eo=ee.get($.id);let es=Math.round($.budgeted/10);if(!eo||$.category_group_id===en||$.category_group_id===ei){return}await bM(et,eo,es)}))}})}async function wE($){const ee=new Map;console.log("Importing Accounts...");await wg($,ee);console.log("Importing Categories...");await wm($,ee);console.log("Importing Payees...");await w_($,ee);console.log("Importing Transactions...");await wv($,ee);console.log("Importing Budgets...");await ww($,ee);console.log("Setting up...")}function wS($){let ee=JSON.parse($.toString());if(ee.data){ee=ee.data}if(ee.budget){ee=ee.budget}return ee}function wT($,ee){return ee.budget_name||ee.name};let wO={ynab4:ee,ynab5:et};async function wA($,ee,et){if($==="actual"){return bp(ee,et)}let en=wO[$];try{let ei;let eo;try{ei=en.parseFile(et);eo=en.getBudgetName(ee,ei)}catch($){console.error("failed to parse file",$)}if(!eo){return{error:"not-"+$}}try{await Er["api/start-import"]({budgetName:eo})}catch($){console.error("failed to start import",$);return{error:"unknown"}}await en.doImport(ei)}catch($){await Er["api/abort-import"]();console.error("failed to run import",$);return{error:"unknown"}}await Er["api/finish-import"]()};let wI=lX();wI.method("notes-save",async({id:$,note:ee})=>{await f5("notes",{id:$,note:ee})});const wN=wI;function wD($){function ee($,ee){const et=$.map($=>{try{ee($)}catch($){if($ instanceof lG){console.warn("Invalid rule",$);return $.type}throw $}return null}).filter($=>typeof $==="string");return et.length?et:null}let et=ee($.conditions,$=>new gE($.op,$.field,$.value,$.options,d6));let en=ee($.actions,$=>$.op==="link-schedule"?new gT($.op,null,$.value,null,d6):new gT($.op,$.field,$.value,$.options,d6));if(et||en){return{conditionErrors:et,actionErrors:en}}return null}let wR=lX();wR.method("rule-validate",async function($){let ee=wD($);return{error:ee}});wR.method("rule-add",aP(async function($){let ee=wD($);if(ee){return{error:ee}}let et=await g9($);return{id:et}}));wR.method("rule-update",aP(async function($){let ee=wD($);if(ee){return{error:ee}}await g7($);return{}}));wR.method("rule-delete",aP(async function($){return mt($)}));wR.method("rule-delete-all",aP(async function($){let ee=false;await fI(async()=>{for(let et of $){let $=await mt({id:et});if($===false){ee=true}}});return{someDeletionsFailed:ee}}));wR.method("rule-apply-actions",aP(cd(async function({transactionIds:$,actions:ee}){return mo($,ee)})));wR.method("rule-add-payee-rename",aP(async function({fromNames:$,to:ee}){return mf($,ee)}));wR.method("rules-get",async function(){return gR(g5()).map($=>$.serialize())});wR.method("rule-get",async function({id:$}){let ee=g5().find(ee=>ee.id===$);return ee?ee.serialize():null});wR.method("rules-run",async function({transaction:$}){return mn($)});const wC=wR;function wk($,ee){ee.forEach(($,ee)=>{if(ee==="transactions"){let ee=[];$.forEach($=>{if($.isChild===1&&$.parent_id==null&&$.id.includes("/")){let et=$.id.split("/")[0];ee.push({dataset:"transactions",row:$.id,column:"parent_id",value:et,timestamp:eo.Timestamp.send()})}});if(ee.length>0){fE(ee)}}})}let wM=null;function wL(){wx();wM=f_(wk)}function wx(){if(wM){wM();wM=null}};let wP=lX();wP.method("tools/fix-split-transactions",async()=>{let $=await f2(`
203
+ SELECT t.*, p.payee AS parentPayee FROM v_transactions_internal t
204
+ LEFT JOIN v_transactions_internal p ON t.parent_id = p.id
205
+ WHERE t.is_child = 1 AND t.payee IS NULL AND p.payee IS NOT NULL
206
+ `);await aV(async()=>{let ee=$.map($=>({id:$.id,payee:$.parentPayee}));await gV({updated:ee})});let ee=await f2(`
207
+ SELECT t.id, p.cleared FROM v_transactions_internal t
208
+ LEFT JOIN v_transactions_internal p ON t.parent_id = p.id
209
+ WHERE t.is_child = 1 AND t.cleared != p.cleared
210
+ `);await aV(async()=>{let $=ee.map($=>({id:$.id,cleared:$.cleared===1}));await gV({updated:$})});let et=await f2(`
211
+ SELECT t.* FROM v_transactions_internal t
212
+ LEFT JOIN v_transactions_internal p ON t.parent_id = p.id
213
+ WHERE t.is_child = 1 AND t.tombstone = 0 AND (p.tombstone = 1 OR p.id IS NULL)
214
+ `);await aV(async()=>{let $=et.map($=>({id:$.id,tombstone:1}));await gV({updated:$})});return{numBlankPayees:$.length,numCleared:ee.length,numDeleted:et.length}});const wF=wP;var wB=__webpack_require__(2568);var wU=__webpack_require__.n(wB);async function wj($,ee){function et($){return $.expr!=null?$.expr:$.cachedValue}$.execQuery(`
215
+ CREATE TABLE zero_budget_months
216
+ (id TEXT PRIMARY KEY,
217
+ buffered INTEGER DEFAULT 0);
218
+
219
+ CREATE TABLE zero_budgets
220
+ (id TEXT PRIMARY KEY,
221
+ month INTEGER,
222
+ category TEXT,
223
+ amount INTEGER DEFAULT 0,
224
+ carryover INTEGER DEFAULT 0);
225
+
226
+ CREATE TABLE reflect_budgets
227
+ (id TEXT PRIMARY KEY,
228
+ month INTEGER,
229
+ category TEXT,
230
+ amount INTEGER DEFAULT 0,
231
+ carryover INTEGER DEFAULT 0);
232
+
233
+ CREATE TABLE notes
234
+ (id TEXT PRIMARY KEY,
235
+ note TEXT);
236
+
237
+ CREATE TABLE kvcache (key TEXT PRIMARY KEY, value TEXT);
238
+ CREATE TABLE kvcache_key (id INTEGER PRIMARY KEY, key REAL);
239
+ `);let en=$.runQuery(`SELECT * FROM spreadsheet_cells WHERE name LIKE 'budget%!budget-%'`,[],true);$.transaction(()=>{en.forEach(ee=>{let en=ee.name.match(/^(budget-report|budget)(\d+)!budget-(.+)$/);if(en==null){console.log("Warning: invalid budget month name",ee.name);return}let ei=en[1];let eo=en[2].slice(0,4)+"-"+en[2].slice(4);let es=parseInt(en[2]);let eu=en[3];let el=parseInt(et(ee));if(isNaN(el)){el=0}let ef=ee.name.split("!")[0];let ed=$.runQuery("SELECT * FROM spreadsheet_cells WHERE name = ?",[`${ef}!carryover-${eu}`],true);let ep=ei==="budget-report"?"reflect_budgets":"zero_budgets";$.runQuery(`INSERT INTO ${ep} (id, month, category, amount, carryover) VALUES (?, ?, ?, ?, ?)`,[`${eo}-${eu}`,es,eu,el,ed.length>0&&et(ed[0])==="true"?1:0])})});let ei=$.runQuery(`SELECT * FROM spreadsheet_cells WHERE name LIKE 'budget%!buffered'`,[],true);$.transaction(()=>{ei.forEach(ee=>{let en=ee.name.match(/^budget(\d+)!buffered$/);if(en){let ei=en[1].slice(0,4)+"-"+en[1].slice(4);let eo=parseInt(et(ee));if(isNaN(eo)){eo=0}$.runQuery(`INSERT INTO zero_budget_months (id, buffered) VALUES (?, ?)`,[ei,eo])}})});let eo=$.runQuery(`SELECT * FROM spreadsheet_cells WHERE name LIKE 'notes!%'`,[],true);let es=$=>{try{let ee=JSON.parse($);return ee&&ee!==""?ee:null}catch($){return null}};$.transaction(()=>{eo.forEach(ee=>{let en=es(et(ee));if(en){let[,et]=ee.name.split("!");$.runQuery(`INSERT INTO notes (id, note) VALUES (?, ?)`,[et,en])}})});$.execQuery(`
240
+ DROP TABLE spreadsheet_cells;
241
+ ANALYZE;
242
+ VACUUM;
243
+ `)};let wW=o_;let wH={1632571489012:wj};async function wz($,ee){let et=wW;wW=$;await ee();wW=et}function wV(){return wW}function w$($){return parseInt($.match(/^(\d)+/)[0])}function wq($,ee){for(let et of ee){if(w$(et)===$){return et}}}async function wG($){let ee=1685375406832;let et=1688749527273;let en=await wY($);if(en.includes(ee)){await a3($,"DELETE FROM __migrations__ WHERE id = ?",[ee]);await a3($,"INSERT INTO __migrations__ (id) VALUES (?)",[et])}}async function wY($){const ee=await a3($,"SELECT * FROM __migrations__ ORDER BY id ASC",[],true);return ee.map($=>$.id)}async function wK($){const ee=await ox($);return ee.filter($=>$.match(/(\.sql|\.js)$/)).sort(($,ee)=>{const et=w$($);const en=w$(ee);if(et<en){return-1}else if(et>en){return 1}return 0})}function wZ($,ee){return ee.filter(ee=>{const et=w$(ee);return $.indexOf(et)===-1})}async function wJ($,ee){const et={runQuery:(ee,et,en)=>a3($,ee,et,en),execQuery:ee=>a8($,ee),transaction:ee=>a9($,ee)};if(wH[ee]==null){throw new Error("Could not find JS migration code to run for "+ee)}let en=wH[ee];return en(et,()=>e_())}async function wX($,ee){try{await a8($,ee)}catch($){console.log("Error applying sql:",ee);throw $}}async function wQ($,ee,et){const en=await oj(ou(et,ee));if(ee.match(/\.js$/)){await wJ($,w$(ee))}else{await wX($,en)}await a3($,"INSERT INTO __migrations__ (id) VALUES (?)",[w$(ee)])}function w0($,ee){for(let et=0;et<$.length;et++){if(et>=ee.length||$[et]!==w$(ee[et])){console.error("Database is out of sync with migrations:",{appliedIds:$,available:ee});throw new Error("out-of-sync-migrations")}}}async function w1($){await wG($);let ee=await wY($);let et=await wK(wW);w0(ee,et);const en=wZ(ee,et);for(let ee of en){await wQ($,ee,wW)}return en};async function w2(){await w1(fG())}async function w6(){let $="view-hash";let ee=await f6("SELECT value FROM __meta__ WHERE key = ?",[$]);let{value:et}=ee||{};let en=sq(sY,sK);let ei=wU()(en);if(et!==ei){await fZ(en);await fK("INSERT OR REPLACE INTO __meta__ (key, value) VALUES (?, ?)",[$,ei])}}async function w4(){await w2();await w6()};async function w3($){let ee="My Finances";let et=1;let en=ee;while($.find($=>$.name===en)){en=`${ee} ${et}`;et++}return en}async function w8($){let ee=$.replace(/( |[^A-Za-z0-9])/g,"-")+"-"+e_().slice(0,7);let et=0;let en=od(ee);while(await oP(en)){et++;en=od(ee+et.toString())}if(et>0){ee=ee+et.toString()}return ee};var w5=__webpack_require__(4155);var w9=__webpack_require__(8764)["Buffer"];let w7="_demo-budget";let Ee="_test-budget";function Et({names:$}){const ee=$.map($=>{let ee=uF()._getNode($);return{name:ee.name,value:ee.value}});aZ("cells-changed",ee)}let Er={};Er["undo"]=aP(async function(){return cy()});Er["redo"]=aP(function(){return cm()});Er["transactions-batch-update"]=aP(async function({added:$,deleted:ee,updated:et,learnCategories:en}){return cf(async()=>{let ei=await gV({added:$,updated:et,deleted:ee,learnCategories:en});return ei.updated})});Er["transaction-add"]=aP(async function($){await Er["transactions-batch-update"]({added:[$]});return{}});Er["transaction-update"]=aP(async function($){await Er["transactions-batch-update"]({updated:[$]});return{}});Er["transaction-delete"]=aP(async function($){await Er["transactions-batch-update"]({deleted:[$]});return{}});Er["transactions-parse-file"]=async function({filepath:$,options:ee}){return _w($,ee)};Er["transactions-export"]=async function({transactions:$,accounts:ee,categoryGroups:et,payees:en}){return m9($,ee,et,en)};Er["transactions-export-query"]=async function({query:$}){return m7(new sZ($))};Er["get-categories"]=async function(){return{grouped:await dl(),list:await du()}};Er["get-earliest-transaction"]=async function(){let{data:$}=await uh(sX("transactions").options({splits:"none"}).orderBy({date:"asc"}).select("*").limit(1));return $[0]||null};Er["get-budget-bounds"]=async function(){return lW()};Er["rollover-budget-month"]=async function({month:$}){let ee=await dl();let et=nQ($);function en($){let ee=uq(et,$);return{value:ee===""?0:ee,name:uk(et,$)}}let ei=[en("available-funds"),en("last-month-overspent"),en("buffered"),en("total-budgeted"),en("to-budget"),en("from-last-month"),en("total-income"),en("total-spent"),en("total-leftover")];for(let $ of ee){if($.is_income){ei.push(en("total-income"));for(let ee of $.categories){ei.push(en(`sum-amount-${ee.id}`))}}else{ei=ei.concat([en(`group-budget-${$.id}`),en(`group-sum-amount-${$.id}`),en(`group-leftover-${$.id}`)]);for(let ee of $.categories){ei=ei.concat([en(`budget-${ee.id}`),en(`sum-amount-${ee.id}`),en(`leftover-${ee.id}`),en(`carryover-${ee.id}`)])}}}return ei};Er["report-budget-month"]=async function({month:$}){let ee=await dl();let et=nQ($);function en($){let ee=uq(et,$);return{value:ee===""?0:ee,name:uk(et,$)}}let ei=[en("total-budgeted"),en("total-budget-income"),en("total-saved"),en("total-income"),en("total-spent"),en("real-saved"),en("total-leftover")];for(let $ of ee){ei=ei.concat([en(`group-budget-${$.id}`),en(`group-sum-amount-${$.id}`),en(`group-leftover-${$.id}`)]);for(let ee of $.categories){ei=ei.concat([en(`budget-${ee.id}`),en(`sum-amount-${ee.id}`),en(`leftover-${ee.id}`)]);if(!$.is_income){ei.push(en(`carryover-${ee.id}`))}}}return ei};Er["budget-set-type"]=async function({type:$}){if(!uw.includes($)){throw new Error("Invalid budget type: "+$)}if($===uA().budgetType){return}return uT({budgetType:$})};Er["category-create"]=aP(async function({name:$,groupId:ee,isIncome:et}){return cf(async()=>{if(!ee){throw lY("Creating a category: groupId is required")}return dg({name:$,cat_group:ee,is_income:et?1:0})})});Er["category-update"]=aP(async function($){return cf(async()=>{try{await dm($)}catch($){if($.message.toLowerCase().includes("unique constraint")){return{error:{type:"category-exists"}}}throw $}return{}})});Er["category-move"]=aP(async function({id:$,groupId:ee,targetId:et}){return cf(async()=>{await fI(async()=>{await d_($,ee,et)});return"ok"})});Er["category-delete"]=aP(async function({id:$,transferId:ee}){return cf(async()=>{let et={};await fI(async()=>{let en=await f6("SELECT is_income FROM categories WHERE id = ?",[$]);if(!en){et={error:"no-categories"};return}let ei=ee&&await f6("SELECT is_income FROM categories WHERE id = ?",[ee]);if(!en||ee&&!ei){et={error:"no-categories"};return}else if(ee&&en.is_income!==ei.is_income){et={error:"category-type"};return}if(en.is_income===0){if(ee){await lU([$],ee)}}await dv({id:$},ee)});return et})});Er["category-group-create"]=aP(async function({name:$,isIncome:ee}){return cf(async()=>{return df({name:$,is_income:ee?1:0})})});Er["category-group-update"]=aP(async function($){return cf(async()=>{return dp($)})});Er["category-group-move"]=aP(async function({id:$,targetId:ee}){return cf(async()=>{await fI(async()=>{await dh($,ee)});return"ok"})});Er["category-group-delete"]=aP(async function({id:$,transferId:ee}){return cf(async()=>{const et=await f2("SELECT id FROM categories WHERE cat_group = ? AND tombstone = 0",[$]);return fI(async()=>{if(ee){await lU(et.map($=>$.id),ee)}await dy({id:$},ee)})})});Er["must-category-transfer"]=async function({id:$}){const ee=await fK(`SELECT count(t.id) as count FROM transactions t
244
+ LEFT JOIN category_mapping cm ON cm.id = t.category
245
+ WHERE cm.transferId = ? AND t.tombstone = 0`,[$],true);if(ee[0].count!==0){return true}return[...uF().meta().createdMonths].some(ee=>{const et=nQ(ee);const en=uF().getCellValue(et,"budget-"+$);return en!==0})};Er["payee-create"]=aP(async function({name:$}){return cf(async()=>{return dE({name:$})})});Er["payees-get"]=async function(){return dI()};Er["payees-get-orphaned"]=async function(){return dN()};Er["payees-get-rule-counts"]=async function(){let $={};gk(g5(),"payee",(ee,et)=>{if($[et]==null){$[et]=0}$[et]++});return $};Er["payees-merge"]=aP(async function({targetId:$,mergeIds:ee}){return cf(async()=>{return dA($,ee)},{targetId:$,mergeIds:ee})});Er["payees-batch-change"]=aP(async function({added:$,deleted:ee,updated:et}){return cf(async()=>{return fI(async()=>{if(ee){await Promise.all(ee.map($=>dS($)))}if($){await Promise.all($.map($=>dE($)))}if(et){await Promise.all(et.map($=>dO($)))}})})});Er["payees-check-orphaned"]=async function({ids:$}){let ee=new Set(await dD());return $.filter($=>ee.has($))};Er["payees-get-rules"]=async function({id:$}){return ms($).map($=>$.serialize())};Er["make-filters-from-conditions"]=async function({conditions:$}){return mi($)};Er["getCell"]=async function({sheetName:$,name:ee}){let et=["name","value"];let en=uF()._getNode(uk($,ee));if(et){let $={};et.forEach(ee=>{if(ee==="run"){$[ee]=en._run?en._run.toString():null}else{$[ee]=en[ee]}});return $}else{return en}};Er["getCells"]=async function({names:$}){return $.map($=>({value:uF()._getNode($).value}))};Er["getCellNamesInSheet"]=async function({sheetName:$}){let ee=[];for(let et of uF().getNodes().keys()){let{sheet:en,name:ei}=uC(et);if(en===$){ee.push(ei)}}return ee};Er["debugCell"]=async function({sheetName:$,name:ee}){let et=uF().getNode(uk($,ee));return{...et,_run:et._run&&et._run.toString()}};Er["create-query"]=async function({sheetName:$,name:ee,query:et}){uF().createQuery($,ee,et);return"ok"};Er["query"]=async function($){if($.table==null){throw new Error("query has no table, did you forgot to call `.serialize`?")}return uh($)};Er["bank-delete"]=async function({id:$}){const ee=await fK("SELECT * FROM accounts WHERE bank = ?",[$],true);await de("banks",$);await Promise.all(ee.map(async $=>{await fK("DELETE FROM transactions WHERE acct = ?",[$.id]);await de("accounts",$.id)}));return"ok"};Er["account-update"]=aP(async function({id:$,name:ee}){return cf(async()=>{await f5("accounts",{id:$,name:ee});return{}})});Er["accounts-get"]=async function(){return dC()};Er["account-properties"]=async function({id:$}){const{balance:ee}=await f6("SELECT sum(amount) as balance FROM transactions WHERE acct = ? AND isParent = 0 AND tombstone = 0",[$]);const{count:et}=await f6("SELECT count(id) as count FROM transactions WHERE acct = ? AND tombstone = 0",[$]);return{balance:ee||0,numTransactions:et}};Er["accounts-link"]=async function({institution:$,publicToken:ee,accountId:et,upgradingId:en}){let ei=await _t($,ee);let[[,eo],[,es]]=await r6(["user-id","user-key"]);let eu=await mw(eo,es,ei);let el=eu.find($=>$.account_id===et);await f5("accounts",{id:en,account_id:el.account_id,official_name:el.official_name,balance_current:ix(el.balances.current),balance_available:ix(el.balances.available),balance_limit:ix(el.balances.limit),mask:el.mask,bank:ei});await mx(eo,es,en,el.account_id,ei);aZ("sync-event",{type:"success",tables:["transactions"]});return"ok"};Er["gocardless-accounts-link"]=async function({requisitionId:$,account:ee,upgradingId:et}){let en;let ei=await _r(ee.institution,$);if(et){const $=await f6("SELECT * FROM accounts WHERE id = ?",[et]);en=$.id;await f5("accounts",{id:en,account_id:ee.account_id,bank:ei.id})}else{en=e_();await f9("accounts",{id:en,account_id:ee.account_id,mask:ee.mask,name:ee.name,official_name:ee.official_name,bank:ei.id});await dE({name:"",transfer_acct:en})}await mM(undefined,undefined,en,ee.account_id,ei.bank_id);aZ("sync-event",{type:"success",tables:["transactions"]});return"ok"};Er["accounts-connect"]=async function({institution:$,publicToken:ee,accountIds:et,offbudgetIds:en}){let ei=await _t($,ee);let eo=await _o(ei,et,en);return eo};Er["gocardless-accounts-connect"]=async function({institution:$,publicToken:ee,accountIds:et,offbudgetIds:en}){let ei=await _t($,ee);let eo=await _u(ei,et,en);return eo};Er["account-create"]=aP(async function({name:$,balance:ee,offBudget:et,closed:en}){return cf(async()=>{const ei=await dk({name:$,offbudget:et?1:0,closed:en?1:0});await dE({name:"",transfer_acct:ei});if(ee!=null&&ee!==0){let $=await dz();await dU({account:ei,amount:ix(ee),category:et?null:$.category,payee:$.id,date:nR(),cleared:true,starting_balance_flag:true})}return ei})});Er["account-close"]=aP(async function({id:$,transferAccountId:ee,categoryId:et,forced:en}){await Er["account-unlink"]({id:$});return cf(async()=>{let ei=await f6("SELECT * FROM accounts WHERE id = ? AND tombstone = 0",[$]);if(!ei||ei.closed===1){return}const{balance:eo,numTransactions:es}=await Er["account-properties"]({id:$});if(es===0){await dL({id:$})}else if(en){let ee=await fK("SELECT id, transfer_id FROM v_transactions WHERE account = ?",[$],true);let{id:et}=await f6("SELECT id FROM payees WHERE transfer_acct = ?",[$]);await fI(async()=>{ee.forEach($=>{if($.transfer_id){dj({id:$.transfer_id,payee:null,transfer_id:null})}dW({id:$.id})});dL({id:$});dT({id:et})})}else{if(eo!==0&&ee==null){throw lY("balance is non-zero: transferAccountId is required")}await f5("accounts",{id:$,closed:1});if(eo!==0){let{id:en}=await f6("SELECT id FROM payees WHERE transfer_acct = ?",[ee]);await Er["transaction-add"]({id:e_(),payee:en,amount:-eo,account:$,date:nR(),notes:"Closing account",category:et||null})}}})});Er["account-reopen"]=aP(async function({id:$}){return cf(async()=>{await f5("accounts",{id:$,closed:0})})});Er["account-move"]=aP(async function({id:$,targetId:ee}){return cf(async()=>{await dx($,ee)})});let En=false;Er["poll-web-token"]=async function({token:$}){let[[,ee],[,et]]=await r6(["user-id","user-key"]);let en=Date.now();En=false;async function ei(eo){if(En){return}if(Date.now()-en>=1e3*60*10){eo("timeout");return}let es=await l4(ce().PLAID_SERVER+"/get-web-token-contents",{userId:ee,key:et,token:$});if(es){if(es.error){eo("unknown")}else{eo(null,es)}}else{setTimeout(()=>ei(eo),3e3)}}return new Promise($=>{ei((ee,et)=>{if(ee){$({error:ee})}else{$({data:et})}})})};Er["poll-web-token-stop"]=async function(){En=true;return"ok"};Er["accounts-sync"]=async function({id:$}){let[[,ee],[,et]]=await r6(["user-id","user-key"]);let en=await fK(`SELECT a.*, b.id as bankId FROM accounts a
246
+ LEFT JOIN banks b ON a.bank = b.id
247
+ WHERE a.tombstone = 0 AND a.closed = 0`,[],true);if($){en=en.filter(ee=>ee.id===$)}let ei=[];let eo=[];let es=[];let eu=[];for(let $=0;$<en.length;$++){const el=en[$];if(el.bankId){try{const $=await mx(ee,et,el.id,el.account_id,el.bankId);let{added:en,updated:ei}=$;eo=eo.concat(en);es=es.concat(ei);if(en.length>0||ei.length>0){eu=eu.concat(el.id)}}catch($){if($.type==="BankSyncError"){ei.push({type:"SyncError",accountId:el.id,message:"Failed syncing account “"+el.name+".”",category:$.category,code:$.code})}else if($ instanceof lz&&$.reason!=="internal"){ei.push({accountId:el.id,message:`Account “${el.name}” is not linked properly. Please link it again`})}else{ei.push({accountId:el.id,message:"There was an internal error. Please get in touch https://actualbudget.org/contact for support.",internal:$.stack});$.message="Failed syncing account: "+$.message;aI($)}}}}if(eu.length>0){aZ("sync-event",{type:"success",tables:["transactions"]})}return{errors:ei,newTransactions:eo,matchedTransactions:es,updatedAccounts:eu}};Er["secret-set"]=async function({name:$,value:ee}){let et=await rX("user-token");if(!et){return{error:"unauthorized"}}try{return await l4(ce().BASE_SERVER+"/secret",{name:$,value:ee},{"X-ACTUAL-TOKEN":et})}catch($){console.error($);return{error:"failed"}}};Er["secret-check"]=async function($){let ee=await rX("user-token");if(!ee){return{error:"unauthorized"}}try{return await l8(ce().BASE_SERVER+"/secret/"+$,{"X-ACTUAL-TOKEN":ee})}catch($){console.error($);return{error:"failed"}}};Er["gocardless-poll-web-token"]=async function({upgradingAccountId:$,requisitionId:ee}){let et=await rX("user-token");if(!et)return null;let en=Date.now();En=false;async function ei(eo){if(En){return}if(Date.now()-en>=1e3*60*10){eo("timeout");return}let es=await l4(ce().GOCARDLESS_SERVER+"/get-accounts",{upgradingAccountId:$,requisitionId:ee},{"X-ACTUAL-TOKEN":et});if(es){if(es.error){eo("unknown")}else{eo(null,es)}}else{setTimeout(()=>ei(eo),3e3)}}return new Promise($=>{ei((ee,et)=>{if(ee){$({error:ee})}else{$({data:et})}})})};Er["gocardless-status"]=async function(){const $=await rX("user-token");if(!$){return{error:"unauthorized"}}return l4(ce().GOCARDLESS_SERVER+"/status",{},{"X-ACTUAL-TOKEN":$})};Er["gocardless-get-banks"]=async function($){const ee=await rX("user-token");if(!ee){return{error:"unauthorized"}}return l4(ce().GOCARDLESS_SERVER+"/get-banks",{country:$,showDemo:m4()},{"X-ACTUAL-TOKEN":ee})};Er["gocardless-poll-web-token-stop"]=async function(){En=true;return"ok"};Er["gocardless-create-web-token"]=async function({upgradingAccountId:$,institutionId:ee,accessValidForDays:et}){let en=await rX("user-token");if(!en){return{error:"unauthorized"}}try{return await l4(ce().GOCARDLESS_SERVER+"/create-web-token",{upgradingAccountId:$,institutionId:ee,accessValidForDays:et},{"X-ACTUAL-TOKEN":en})}catch($){console.error($);return{error:"failed"}}};Er["gocardless-accounts-sync"]=async function({id:$}){let[[,ee],[,et]]=await r6(["user-id","user-key"]);let en=await fK(`SELECT a.*, b.bank_id as bankId FROM accounts a
248
+ LEFT JOIN banks b ON a.bank = b.id
249
+ WHERE a.tombstone = 0 AND a.closed = 0`,[],true);if($){en=en.filter(ee=>ee.id===$)}let ei=[];let eo=[];let es=[];let eu=[];for(let $=0;$<en.length;$++){const el=en[$];if(el.bankId){try{const $=await mM(ee,et,el.id,el.account_id,el.bankId);let{added:en,updated:ei}=$;eo=eo.concat(en);es=es.concat(ei);if(en.length>0||ei.length>0){eu=eu.concat(el.id)}}catch($){if($.type==="BankSyncError"){ei.push({type:"SyncError",accountId:el.id,message:"Failed syncing account “"+el.name+".”",category:$.category,code:$.code})}else if($ instanceof lz&&$.reason!=="internal"){ei.push({accountId:el.id,message:`Account “${el.name}” is not linked properly. Please link it again`})}else{ei.push({accountId:el.id,message:"There was an internal error. Please get in touch https://actualbudget.org/contact for support.",internal:$.stack});$.message="Failed syncing account: "+$.message;aI($)}}}}if(eu.length>0){aZ("sync-event",{type:"success",tables:["transactions"]})}return{errors:ei,newTransactions:eo,matchedTransactions:es,updatedAccounts:eu}};Er["transactions-import"]=aP(function({accountId:$,transactions:ee}){return cf(async()=>{if(typeof $!=="string"){throw lY("transactions-import: accountId must be an id")}try{return await mC($,ee)}catch($){if($ instanceof lq){return{errors:[{message:$.message}],added:[],updated:[]}}throw $}})});Er["account-unlink"]=aP(async function({id:$}){let{bank:ee}=await f6("SELECT bank FROM accounts WHERE id = ?",[$]);if(!ee){return"ok"}await dM({id:$,account_id:null,bank:null,balance_current:null,balance_available:null,balance_limit:null});let{count:et}=await f6("SELECT COUNT(*) as count FROM accounts WHERE bank = ?",[ee]);let en=await rX("user-token");if(!en){return"ok"}if(et===0){let{bank_id:$}=await f6("SELECT bank_id FROM banks WHERE id = ?",[ee]);try{await l4(ce().GOCARDLESS_SERVER+"/remove-account",{requisitionId:$},{"X-ACTUAL-TOKEN":en})}catch($){console.log({error:$})}}return"ok"});Er["make-plaid-public-token"]=async function({bankId:$}){let[[,ee],[,et]]=await r6(["user-id","user-key"]);let en=await l4(ce().PLAID_SERVER+"/make-public-token",{userId:ee,key:et,item_id:""+$});if(en.error_code){return{error:"",code:en.error_code,type:en.error_type}}return{linkToken:en.link_token}};Er["save-global-prefs"]=async function($){if("maxMonths"in $){await rQ("max-months",""+$.maxMonths)}if("autoUpdate"in $){await rQ("auto-update",""+$.autoUpdate);w5.send({type:"shouldAutoUpdate",flag:$.autoUpdate})}if("documentDir"in $){if(await oP($.documentDir)){await rQ("document-dir",$.documentDir)}}if("floatingSidebar"in $){await rQ("floating-sidebar",""+$.floatingSidebar)}if("theme"in $){await rQ("theme",$.theme)}return"ok"};Er["load-global-prefs"]=async function(){let[[,$],[,ee],[,et],[,en],[,ei],[,eo]]=await r6(["floating-sidebar","max-months","auto-update","document-dir","encrypt-key","theme"]);return{floatingSidebar:$==="true"?true:false,maxMonths:iL(ee||""),autoUpdate:et==null||et==="true"?true:false,documentDir:en||Eo(),keyId:ei&&JSON.parse(ei).id,theme:eo==="light"||eo==="dark"?eo:"light"}};Er["save-prefs"]=async function($){let{cloudFileId:ee}=uA();if($.budgetName&&ee){let et=await rX("user-token");await l4(ce().SYNC_SERVER+"/update-user-filename",{token:et,fileId:ee,name:$.budgetName})}await uT($);return"ok"};Er["load-prefs"]=async function(){return uA()};Er["sync-reset"]=async function(){return await fi()};Er["sync-repair"]=async function(){await cq()};Er["key-make"]=async function({password:$}){if(!uA()){throw new Error("user-set-key must be called with file loaded")}let ee=cP(32).toString("base64");let et=e_();let en=await cj({id:et,password:$,salt:ee});await cF(en);let ei=await cK(en.getId());return await fi({key:en,salt:ee,testContent:JSON.stringify({...ei,value:ei.value.toString("base64")})})};Er["key-test"]=async function({fileId:$,password:ee}){let et=await rX("user-token");if($==null){$=uA().cloudFileId}let en;try{en=await l4(ce().SYNC_SERVER+"/user-get-key",{token:et,fileId:$})}catch($){console.log($);return{error:{reason:"network"}}}let{id:ei,salt:eo,test:es}=en;if(es==null){return{error:{reason:"old-key-style"}}}es=JSON.parse(es);let eu=await cj({id:ei,password:ee,salt:eo});cF(eu);try{await cx(w9.from(es.value,"base64"),es.meta)}catch($){console.log($);cB(eu);return{error:{reason:"decrypt-failure"}}}let el=JSON.parse(await rX(`encrypt-keys`)||"{}");el[$]=eu.serialize();await rQ("encrypt-keys",JSON.stringify(el));if(uA()){await uT({encryptKeyId:eu.getId()})}return{}};Er["get-did-bootstrap"]=async function(){return Boolean(await rX("did-bootstrap"))};Er["subscribe-needs-bootstrap"]=async function({url:$}={}){try{if(!ce($)){return{bootstrapped:true,hasServer:false}}}catch($){return{error:"get-server-failure"}}let ee;try{ee=await l8(ce($).SIGNUP_SERVER+"/needs-bootstrap")}catch($){return{error:"network-failure"}}try{ee=JSON.parse(ee)}catch($){return{error:"parse-failure"}}if(ee.status==="error"){return{error:ee.reason}}return{bootstrapped:ee.data.bootstrapped,hasServer:true}};Er["subscribe-bootstrap"]=async function({password:$}){let ee;try{ee=await l4(ce().SIGNUP_SERVER+"/bootstrap",{password:$})}catch($){return{error:$.reason||"network-failure"}}if(ee.token){await rQ("user-token",ee.token);return{}}return{error:"internal"}};Er["subscribe-get-user"]=async function(){if(!ce()){if(!await rX("did-bootstrap")){return null}return{offline:false}}let $=await rX("user-token");if(!$){return null}try{const ee=await l8(ce().SIGNUP_SERVER+"/validate",{headers:{"X-ACTUAL-TOKEN":$}});const{status:et,reason:en}=JSON.parse(ee);if(et==="error"){if(en==="unauthorized"){return null}return{offline:true}}return{offline:false}}catch($){console.log($);return{offline:true}}};Er["subscribe-change-password"]=async function({password:$}){let ee=await rX("user-token");if(!ee){return{error:"not-logged-in"}}try{await l4(ce().SIGNUP_SERVER+"/change-password",{token:ee,password:$})}catch($){return{error:$.reason||"network-failure"}}return{}};Er["subscribe-sign-in"]=async function({password:$}){let ee=await l4(ce().SIGNUP_SERVER+"/login",{password:$});if(ee.token){await rQ("user-token",ee.token);return{}}return{error:"invalid-password"}};Er["subscribe-sign-out"]=async function(){cU();await r3(["user-token","encrypt-keys","lastBudget","readOnly"]);return"ok"};Er["get-server-version"]=async function(){if(!ce()){return{error:"no-server"}}let $;try{const ee=await l8(ce().BASE_SERVER+"/info");const et=JSON.parse(ee);$=et.build.version}catch($){return{error:"network-failure"}}return{version:$}};Er["get-server-url"]=async function(){return ce()&&ce().BASE_SERVER};Er["set-server-url"]=async function({url:$,validate:ee=true}){if($==null){await r0("user-token")}else{$=$.replace(/\/+$/,"");if(ee){let{error:ee}=await aj(Er["subscribe-needs-bootstrap"],{url:$});if(ee){return{error:ee}}}}await rQ("server-url",$);await rQ("did-bootstrap",true);l7($);return{}};Er["sync"]=async function(){return fx()};Er["get-budgets"]=async function(){const $=await ox(of());const ee=(await Promise.all($.map(async $=>{const ee=ou(of(),$,"metadata.json");if(await oP(ee)){let et;try{et=JSON.parse(await oj(ee))}catch($){console.log("Error parsing metadata:",$.stack);return}if($!==w7){return{id:$,cloudFileId:et.cloudFileId,groupId:et.groupId,name:et.budgetName||"(no name)"}}}return null}))).filter($=>$);return ee};Er["get-remote-files"]=async function(){return ft()};Er["reset-budget-cache"]=aP(async function(){await uV($);uF().recomputeAll();await uK()});Er["upload-budget"]=async function({id:$}={}){if($){if(uA()){throw new Error("upload-budget: id given but prefs already loaded")}await uS($)}try{await c9()}catch($){console.log($);if($.type==="FileUploadError"){return{error:$}}aI($);return{error:{reason:"internal"}}}finally{if($){uO()}}return{}};Er["download-budget"]=async function({fileId:$}){let ee;try{ee=await fr($)}catch($){if($.type==="FileDownloadError"){if($.reason==="file-exists"&&$.meta.id){await uS($.meta.id);let ee=uA().budgetName;uO();$.meta={...$.meta,name:ee}}return{error:$}}else{aI($);return{error:{reason:"internal"}}}}let et=ee.id;await Er["load-budget"]({id:et});ee=await Er["sync-budget"]();await Er["close-budget"]();if(ee.error){return ee}return{id:et}};Er["sync-budget"]=async function(){fl("enabled");let $=await fL();return $};Er["load-budget"]=async function({id:$}){let ee=uA();if(ee){if(ee.id===$){return{}}else{await Er["close-budget"]()}}let et=await Ei($);return et};Er["create-demo-budget"]=async function(){await rQ("readOnly","");return Er["create-budget"]({budgetName:"Demo Budget",testMode:true,testBudgetId:w7})};Er["close-budget"]=async function(){aN({message:"Closing budget"});await uK();uH();fR();await l0.stopServices();await f$();try{await rQ("lastBudget","")}catch($){}uO();_Q();return"ok"};Er["delete-budget"]=async function({id:$,cloudFileId:ee}){if(ee){await fe(ee).catch($=>{})}if($){let ee=od($);await oV(ee)}return"ok"};Er["create-budget"]=async function({budgetName:$,avoidUpload:ee,testMode:et,testBudgetId:en}={}){let ei;if(et){$=$||"Test Budget";ei=en||Ee;if(await oP(od(ei))){await oV(od(ei))}}else{if(!$){let ee=await Er["get-budgets"]();$=await w3(ee)}ei=await w8($)}let eo=od(ei);await oF(eo);await oU(om,ou(eo,"db.sqlite"));await oW(ou(eo,"metadata.json"),JSON.stringify(uI(ei,$)));let{error:es}=await Ei(ei);if(es){console.log("Error creating budget: "+es);return{error:es}}if(!ee&&!et){try{await c9()}catch($){}}if(et){await mQ(Er)}return{}};Er["import-budget"]=async function({filepath:$,type:ee}){try{if(!await oP($)){throw new Error(`File not found at the provided path: ${$}`)}let et=w9.from(await oj($,"binary"));let en=await wA(ee,$,et);return en||{}}catch($){$.message="Error importing budget: "+$.message;aI($);return{error:"internal-error"}}};Er["export-budget"]=async function(){try{return{data:await c8()}}catch($){$.message="Error exporting budget: "+$.message;aI($);return{error:"internal-error"}}};async function Ei(ee){let et;try{et=od(ee)}catch($){aI(new Error("`getBudgetDir` failed in `loadBudget`: "+$.message));return{error:"budget-not-found"}}aN({message:"Loading budget "+et});if(!await oP(et)){aI(new Error("budget directory does not exist"));return{error:"budget-not-found"}}try{await uS(ee);await fz(ee)}catch($){aN({message:"Error loading budget "+ee});aI($);await Er["close-budget"]();return{error:"opening-budget"}}if(!uA().userId){let $=await rX("user-token");uT({userId:$})}try{await w4()}catch(et){console.warn("Error updating",et);let $;if(et.message.includes("out-of-sync-migrations")){$={error:"out-of-sync-migrations"}}else if(et.message.includes("out-of-sync-data")){$={error:"out-of-sync-data"}}else{aI(et);ug.info("Error updating budget "+ee,et);console.log("Error updating budget",et);$={error:"loading-budget"}}await Er["close-budget"]();return $}await fY();if(uA().resetClock){eo.getClock().timestamp.setNode(eo.makeClientId());await fK("INSERT OR REPLACE INTO messages_clock (id, clock) VALUES (1, ?)",[eo.serializeClock(eo.getClock())]);await uT({resetClock:false})}if(!u_&&!um&&"production"!=="test"){_X(ee)}try{await uW($,Et)}catch($){aI($);await Er["close-budget"]();return{error:"opening-budget"}}uF().meta().budgetType=uA().budgetType;await lW();await ps();await g8();await wL();await l0.startServices();cl();if(true){if(ee===w7){fl("disabled")}else{if(ce()){fl("enabled")}else{fl("disabled")}await rQ("lastBudget",ee);if(!um){await c7()}}}l0.events.emit("load-budget",{id:ee});return{}}Er["upload-file-web"]=async function({filename:$,contents:ee}){if(!u_){return null}await oW("/uploads/"+$,ee);return{}};Er["backups-get"]=async function({id:$}){return _Y($)};Er["backup-load"]=async function({id:$,backupId:ee}){await _J($,ee)};Er["backup-make"]=async function({id:$}){await _Z($)};Er["get-last-opened-backup"]=async function(){const $=await rX("lastBudget");if($&&$!==""){const ee=od($);if(await oP(ee)){return $}}return null};Er["app-focused"]=async function(){if(uA()&&uA().id){fx()}};Er=_z(Er);ei(($,ee)=>aj(l0.handlers[$],ee));l0.handlers=Er;l0.combine(vY,br,wN,wF,bd,wC);function Eo(){if(um){return"/documents"}return ou("/documents","Actual")}async function Es(){async function $($){if(!await oP($)){await oF($)}}let ee=await rX("document-dir");if(ee){try{await $(ee)}catch($){ee=null}}if(!ee){ee=Eo()}await $(ee);oc(ee)}async function Eu(ee,et){await a1();await Promise.all([rZ(),oM()]);await Es();let en=await rX("encrypt-keys");if(en){try{let $=JSON.parse(en);await Promise.all(Object.keys($).map(ee=>{return cF($[ee])}))}catch($){console.log("Error loading key",$);throw new Error("load-key-error")}}let ei=await rX("server-url");if(ei==="https://not-configured/"){ei=null;await rQ("server-url",null);await rQ("did-bootstrap",true)}if(!ei){await r0("user-token")}l7(ei);aK(et,l0.handlers);if(!ee&&!um&&!u_){let $=await rX("auto-update");w5.send({type:"shouldAutoUpdate",flag:$==null||$==="true"})}if(ee){__webpack_require__.g.$send=($,ee)=>aj(l0.handlers[$],ee);__webpack_require__.g.$query=uh;__webpack_require__.g.$q=sX;__webpack_require__.g.$db=$;__webpack_require__.g.$setSyncingMode=fl}}async function El($){let ee,et;if($){ee=$.dataDir;et=$.serverURL}else{ee="/";et=({}).ACTUAL_SERVER_URL}await a1();await Promise.all([rZ({persist:false}),oM()]);oc(ee||w5.cwd());if(et){l7(et);if($.password){await aj(Er["subscribe-sign-in"],{password:$.password})}}else{l7(null);l0.events.on("load-budget",()=>{fl("offline")})}return Ec}const Ec={getDataDir:ow,sendMessage:($,ee)=>aZ($,ee),send:async($,ee)=>{let et=await aj(l0.handlers[$],ee);return et},on:($,ee)=>l0.events.on($,ee),q:sX,db:$}})();backend=__webpack_exports__})();
250
+ //# sourceMappingURL=kcab.worker.b835d2cdcf8004c363da.js.map