meadow-endpoints 3.0.7 → 4.0.2
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.
- package/Dockerfile_LUXURYCode +1 -1
- package/README.md +48 -14
- package/debug/Animal.json +62 -0
- package/debug/Harness-Configuration.json +31 -0
- package/debug/Harness.js +7 -108
- package/debug/KillHarness.sh +10 -0
- package/dist/meadowendpoints.js +4402 -0
- package/dist/meadowendpoints.min.js +92 -0
- package/dist/meadowendpoints.min.js.map +1 -0
- package/gulpfile.js +83 -0
- package/package.json +27 -15
- package/source/Meadow-Endpoints-Browser-Shim.js +14 -0
- package/source/Meadow-Endpoints.js +176 -565
- package/source/controller/Meadow-Endpoints-Controller-Base.js +161 -0
- package/source/controller/components/Meadow-Endpoints-Controller-BehaviorInjection.js +125 -0
- package/source/controller/components/Meadow-Endpoints-Controller-Error-StatusCodes.txt +189 -0
- package/source/controller/components/Meadow-Endpoints-Controller-Error.js +118 -0
- package/source/controller/components/Meadow-Endpoints-Controller-Log.js +103 -0
- package/source/controller/utility/Meadow-Endpoints-Filter-Parser.js +225 -0
- package/source/controller/utility/Meadow-Endpoints-Session-Marshaler.js +48 -0
- package/source/controller/utility/Meadow-Endpoints-Stream-RecordArray.js +66 -0
- package/source/endpoints/count/Meadow-Endpoint-Count.js +49 -0
- package/source/endpoints/count/Meadow-Endpoint-CountBy.js +40 -0
- package/source/endpoints/create/Meadow-Endpoint-BulkCreate.js +53 -0
- package/source/endpoints/create/Meadow-Endpoint-Create.js +58 -0
- package/source/endpoints/create/Meadow-Operation-Create.js +83 -0
- package/source/endpoints/delete/Meadow-Endpoint-Delete.js +93 -0
- package/source/endpoints/delete/Meadow-Endpoint-Undelete.js +108 -0
- package/source/endpoints/read/Meadow-Endpoint-Read.js +72 -0
- package/source/endpoints/read/Meadow-Endpoint-ReadDistinctList.js +92 -0
- package/source/endpoints/read/Meadow-Endpoint-ReadLiteList.js +85 -0
- package/source/endpoints/read/Meadow-Endpoint-ReadMax.js +55 -0
- package/source/endpoints/read/Meadow-Endpoint-ReadSelectList.js +89 -0
- package/source/endpoints/read/Meadow-Endpoint-Reads.js +75 -0
- package/source/endpoints/read/Meadow-Endpoint-ReadsBy.js +100 -0
- package/source/{crud → endpoints/read}/Meadow-Marshal-DistinctList.js +4 -13
- package/source/{crud → endpoints/read}/Meadow-Marshal-LiteList.js +5 -14
- package/source/endpoints/schema/Meadow-Endpoint-New.js +36 -0
- package/source/endpoints/schema/Meadow-Endpoint-Schema.js +36 -0
- package/source/endpoints/schema/Meadow-Endpoint-Validate.js +41 -0
- package/source/endpoints/update/Meadow-Endpoint-BulkUpdate.js +50 -0
- package/source/endpoints/update/Meadow-Endpoint-Update.js +58 -0
- package/source/endpoints/update/Meadow-Operation-Update.js +115 -0
- package/source/endpoints/upsert/Meadow-Endpoint-BulkUpsert.js +52 -0
- package/source/endpoints/upsert/Meadow-Endpoint-Upsert.js +57 -0
- package/source/endpoints/upsert/Meadow-Operation-Upsert.js +137 -0
- package/test/MeadowEndpoints_basic_tests.js +50 -2408
- package/test_support/bookstore-api-endpoint-exercises.paw +0 -0
- package/test_support/bookstore-configuration.json +28 -0
- package/test_support/bookstore-import-books-run.js +1 -0
- package/test_support/bookstore-import-books.js +215 -0
- package/test_support/bookstore-serve-meadow-endpoint-apis-IPC.js +138 -0
- package/test_support/bookstore-serve-meadow-endpoint-apis-run.js +6 -0
- package/test_support/bookstore-serve-meadow-endpoint-apis.js +129 -0
- package/test_support/data/books.csv +10001 -0
- package/test_support/model/ddl/BookStore.ddl +66 -0
- package/test_support/model/generated_diagram/README.md +1 -0
- package/test_support/model/generated_diagram/Stricture_Output.dot +13 -0
- package/test_support/model/generated_diagram/Stricture_Output.png +0 -0
- package/test_support/model/generated_documentation/Dictionary.md +18 -0
- package/test_support/model/generated_documentation/Model-Author.md +20 -0
- package/test_support/model/generated_documentation/Model-Book.md +26 -0
- package/test_support/model/generated_documentation/Model-BookAuthorJoin.md +14 -0
- package/test_support/model/generated_documentation/Model-BookPrice.md +25 -0
- package/test_support/model/generated_documentation/Model-Review.md +22 -0
- package/test_support/model/generated_documentation/ModelChangeTracking.md +17 -0
- package/test_support/model/generated_documentation/README.md +1 -0
- package/test_support/model/manual_scripts/DropTables.sql +5 -0
- package/test_support/model/manual_scripts/README.md +2 -0
- package/test_support/model/sql_create/BookStore-CreateDatabase.mysql.sql +116 -0
- package/test_support/model/sql_create/README.md +1 -0
- package/test_support/test_old/Tests.js +3243 -0
- package/test_support/test_old/untitled.js +88 -0
- package/source/Meadow-Authenticator.js +0 -31
- package/source/Meadow-Authorizers.js +0 -214
- package/source/Meadow-BehaviorModifications.js +0 -170
- package/source/Meadow-CommonServices.js +0 -206
- package/source/Meadow-MarshallSessionData.js +0 -64
- package/source/Restify-RouteParser.js +0 -114
- package/source/authorizers/Meadow-Authorizer-Allow.js +0 -17
- package/source/authorizers/Meadow-Authorizer-Deny.js +0 -17
- package/source/authorizers/Meadow-Authorizer-Mine.js +0 -47
- package/source/authorizers/Meadow-Authorizer-MyCustomer.js +0 -48
- package/source/crud/Meadow-Endpoint-BulkCreate.js +0 -67
- package/source/crud/Meadow-Endpoint-BulkUpdate.js +0 -74
- package/source/crud/Meadow-Endpoint-BulkUpsert.js +0 -76
- package/source/crud/Meadow-Endpoint-Count.js +0 -93
- package/source/crud/Meadow-Endpoint-CountBy.js +0 -101
- package/source/crud/Meadow-Endpoint-Create.js +0 -77
- package/source/crud/Meadow-Endpoint-Delete.js +0 -139
- package/source/crud/Meadow-Endpoint-Read.js +0 -109
- package/source/crud/Meadow-Endpoint-ReadDistinctList.js +0 -146
- package/source/crud/Meadow-Endpoint-ReadLiteList.js +0 -139
- package/source/crud/Meadow-Endpoint-ReadMax.js +0 -86
- package/source/crud/Meadow-Endpoint-ReadSelectList.js +0 -145
- package/source/crud/Meadow-Endpoint-Reads.js +0 -129
- package/source/crud/Meadow-Endpoint-ReadsBy.js +0 -155
- package/source/crud/Meadow-Endpoint-Undelete.js +0 -161
- package/source/crud/Meadow-Endpoint-Update.js +0 -80
- package/source/crud/Meadow-Endpoint-Upsert.js +0 -78
- package/source/crud/Meadow-Operation-Create.js +0 -105
- package/source/crud/Meadow-Operation-Update.js +0 -145
- package/source/crud/Meadow-Operation-Upsert.js +0 -106
- package/source/crud/Meadow-StreamRecordArray.js +0 -45
- package/source/schema/Meadow-Endpoint-New.js +0 -37
- package/source/schema/Meadow-Endpoint-Schema.js +0 -37
- package/source/schema/Meadow-Endpoint-Validate.js +0 -43
- package/test/Animal.json +0 -140
- package/test/MeadowEndpoints_disabledAuth_tests.js +0 -1325
- package/test/MeadowEndpoints_trustedSession_tests.js +0 -1731
- package/test/load/artillery-low.yml +0 -10
- package/test/load/cloud9setup.sh +0 -25
- package/test/load/package.json +0 -19
- package/test/load/test-schema-initializedatabase.sql +0 -29
- package/test/load/test-schema.json +0 -119
- package/test/load/test-server.js +0 -157
- package/test/scripts/InitializeDatabase-C9.sql +0 -7
- /package/{test/schemas → test_support/model}/json_schema/BookStore-Extended.json +0 -0
- /package/{test/schemas → test_support/model}/json_schema/BookStore-PICT.json +0 -0
- /package/{test/schemas → test_support/model}/json_schema/BookStore.json +0 -0
- /package/{test/schemas → test_support/model}/json_schema/README.md +0 -0
- /package/{test/schemas → test_support/model}/meadow_schema/BookStore-MeadowSchema-Author.json +0 -0
- /package/{test/schemas → test_support/model}/meadow_schema/BookStore-MeadowSchema-Book.json +0 -0
- /package/{test/schemas → test_support/model}/meadow_schema/BookStore-MeadowSchema-BookAuthorJoin.json +0 -0
- /package/{test/schemas → test_support/model}/meadow_schema/BookStore-MeadowSchema-BookPrice.json +0 -0
- /package/{test/schemas → test_support/model}/meadow_schema/BookStore-MeadowSchema-Review.json +0 -0
- /package/{test/schemas → test_support/model}/meadow_schema/README.md +0 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).MeadowEndpoints=e()}}((function(){return function e(t,r,n){function i(a,s){if(!r[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[a]={exports:{}};t[a][0].call(c.exports,(function(e){return i(t[a][1][e]||e)}),c,c.exports,e,t,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;a<n.length;a++)i(n[a]);return i}({1:[function(e,t,r){(function(t){(function(){"use strict";var n=e("jsonparse"),i=e("through"),o=t.from&&t.from!==Uint8Array.from;function a(e,t){return"string"==typeof e?t==e:e&&"function"==typeof e.exec?e.exec(t):"boolean"==typeof e||"object"==typeof e?e:"function"==typeof e&&e(t)}r.parse=function(e,r){var s,u,l=new n,c=i((function(e){"string"==typeof e&&(e=o?t.from(e):new t(e)),l.write(e)}),(function(e){e&&c.write(e),s&&c.emit("header",s),u&&c.emit("footer",u),c.queue(null)}));"string"==typeof e&&(e=e.split(".").map((function(e){return"$*"===e?{emitKey:!0}:"*"===e||(""===e?{recurse:!0}:e)})));return e&&e.length||(e=null),l.onValue=function(t){if(this.root||(c.root=t),e){for(var n=0,i=0,o=!1,u=!1;n<e.length;){var l,d=e[n];if(i++,d&&!d.recurse){if(!(l=i===this.stack.length?this:this.stack[i]))return;if(!a(d,l.key))return void f(l.key,t);o=!!d.emitKey,u=!!d.emitPath,n++}else{n++;var h=e[n];if(!h)return;for(;;){if(!(l=i===this.stack.length?this:this.stack[i]))return;if(a(h,l.key)){n++,Object.isFrozen(this.stack[i])||(this.stack[i].value=null);break}f(l.key,t),i++}}}if(s&&(c.emit("header",s),s=!1),i===this.stack.length){0;var p=this.stack.slice(1).map((function(e){return e.key})).concat([this.key]),y=t;for(var b in null!=y&&null!=(y=r?r(y,p):y)&&((o||u)&&(y={value:y},o&&(y.key=this.key),u&&(y.path=p)),c.queue(y)),this.value&&delete this.value[this.key],this.stack)Object.isFrozen(this.stack[b])||(this.stack[b].value=null)}}},l._onToken=l.onToken,l.onToken=function(t,r){l._onToken(t,r),0===this.stack.length&&c.root&&(e||c.queue(c.root),0,c.root=null)},l.onError=function(e){e.message.indexOf("at position")>-1&&(e.message="Invalid JSON ("+e.message+")"),c.emit("error",e)},c;function f(e,t){!1!==s&&((s=s||{})[e]=t),!1!==u&&!1===s&&((u=u||{})[e]=t)}},r.stringify=function(e,t,r,n){n=n||0,!1===e?(e="",t="\n",r=""):null==e&&(e="[\n",t="\n,\n",r="\n]\n");var o,a=!0,s=!1;return o=i((function(r){s=!0;try{var i=JSON.stringify(r,null,n)}catch(e){return o.emit("error",e)}a?(a=!1,o.queue(e+i)):o.queue(t+i)}),(function(t){s||o.queue(e),o.queue(r),o.queue(null)}))},r.stringifyObject=function(e,t,r,n){n=n||0,!1===e?(e="",t="\n",r=""):null==e&&(e="{\n",t="\n,\n",r="\n}\n");var o=!0,a=!1;return i((function(r){a=!0;var i=JSON.stringify(r[0])+":"+JSON.stringify(r[1],null,n);o?(o=!1,this.queue(e+i)):this.queue(t+i)}),(function(t){a||this.queue(e),this.queue(r),this.queue(null)}))}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:22,jsonparse:56,through:164}],2:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return(0,i.default)((function(t,r){var i;try{i=e.apply(this,t)}catch(e){return r(e)}(0,n.default)(i)&&"function"==typeof i.then?i.then((function(e){s(r,null,e)}),(function(e){s(r,e.message?e:new Error(e))})):r(null,i)}))};var n=a(e("lodash/isObject")),i=a(e("./internal/initialParams")),o=a(e("./internal/setImmediate"));function a(e){return e&&e.__esModule?e:{default:e}}function s(e,t,r){try{e(t,r)}catch(e){(0,o.default)(u,e)}}function u(e){throw e}t.exports=r.default},{"./internal/initialParams":9,"./internal/setImmediate":13,"lodash/isObject":81}],3:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t,r,a){(0,n.default)(t)(e,(0,i.default)((0,o.default)(r)),a)};var n=a(e("./internal/eachOfLimit")),i=a(e("./internal/withoutIndex")),o=a(e("./internal/wrapAsync"));function a(e){return e&&e.__esModule?e:{default:e}}t.exports=r.default},{"./internal/eachOfLimit":7,"./internal/withoutIndex":15,"./internal/wrapAsync":16}],4:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=o(e("./eachLimit")),i=o(e("./internal/doLimit"));function o(e){return e&&e.__esModule?e:{default:e}}r.default=(0,i.default)(n.default,1),t.exports=r.default},{"./eachLimit":3,"./internal/doLimit":6}],5:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default={},t.exports=r.default},{}],6:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t){return function(r,n,i){return e(r,t,n,i)}},t.exports=r.default},{}],7:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return function(t,r,u){if(u=(0,i.default)(u||n.default),e<=0||!t)return u(null);var l=(0,o.default)(t),c=!1,f=0,d=!1;function h(e,t){if(f-=1,e)c=!0,u(e);else{if(t===s.default||c&&f<=0)return c=!0,u(null);d||p()}}function p(){for(d=!0;f<e&&!c;){var t=l();if(null===t)return c=!0,void(f<=0&&u(null));f+=1,r(t.value,t.key,(0,a.default)(h))}d=!1}p()}};var n=u(e("lodash/noop")),i=u(e("./once")),o=u(e("./iterator")),a=u(e("./onlyOnce")),s=u(e("./breakLoop"));function u(e){return e&&e.__esModule?e:{default:e}}t.exports=r.default},{"./breakLoop":5,"./iterator":10,"./once":11,"./onlyOnce":12,"lodash/noop":85}],8:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return n&&e[n]&&e[n]()};var n="function"==typeof Symbol&&Symbol.iterator;t.exports=r.default},{}],9:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return function(){var t=(0,o.default)(arguments),r=t.pop();e.call(this,t,r)}};var n,i=e("./slice"),o=(n=i)&&n.__esModule?n:{default:n};t.exports=r.default},{"./slice":14}],10:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){if((0,n.default)(e))return function(e){var t=-1,r=e.length;return function(){return++t<r?{value:e[t],key:t}:null}}(e);var t=(0,i.default)(e);return t?function(e){var t=-1;return function(){var r=e.next();return r.done?null:(t++,{value:r.value,key:t})}}(t):(r=e,a=(0,o.default)(r),s=-1,u=a.length,function(){var e=a[++s];return s<u?{value:r[e],key:e}:null});var r,a,s,u};var n=a(e("lodash/isArrayLike")),i=a(e("./getIterator")),o=a(e("lodash/keys"));function a(e){return e&&e.__esModule?e:{default:e}}t.exports=r.default},{"./getIterator":8,"lodash/isArrayLike":77,"lodash/keys":84}],11:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return function(){if(null!==e){var t=e;e=null,t.apply(this,arguments)}}},t.exports=r.default},{}],12:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return function(){if(null===e)throw new Error("Callback was already called.");var t=e;e=null,t.apply(this,arguments)}},t.exports=r.default},{}],13:[function(e,t,r){(function(t,n){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.hasNextTick=r.hasSetImmediate=void 0,r.fallback=c,r.wrap=f;var i,o=e("./slice"),a=(i=o)&&i.__esModule?i:{default:i};var s,u=r.hasSetImmediate="function"==typeof n&&n,l=r.hasNextTick="object"==typeof t&&"function"==typeof t.nextTick;function c(e){setTimeout(e,0)}function f(e){return function(t){var r=(0,a.default)(arguments,1);e((function(){t.apply(null,r)}))}}s=u?n:l?t.nextTick:c,r.default=f(s)}).call(this)}).call(this,e("_process"),e("timers").setImmediate)},{"./slice":14,_process:121,timers:165}],14:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t){t|=0;for(var r=Math.max(e.length-t,0),n=Array(r),i=0;i<r;i++)n[i]=e[t+i];return n},t.exports=r.default},{}],15:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return function(t,r,n){return e(t,n)}},t.exports=r.default},{}],16:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.isAsync=void 0;var n,i=e("../asyncify"),o=(n=i)&&n.__esModule?n:{default:n};var a="function"==typeof Symbol;function s(e){return a&&"AsyncFunction"===e[Symbol.toStringTag]}r.default=function(e){return s(e)?(0,o.default)(e):e},r.isAsync=s},{"../asyncify":2}],17:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t){if(t=(0,o.default)(t||i.default),!(0,n.default)(e))return t(new Error("First argument to waterfall must be an array of functions"));if(!e.length)return t();var r=0;function l(t){var n=(0,u.default)(e[r++]);t.push((0,s.default)(c)),n.apply(null,t)}function c(n){if(n||r===e.length)return t.apply(null,arguments);l((0,a.default)(arguments,1))}l([])};var n=l(e("lodash/isArray")),i=l(e("lodash/noop")),o=l(e("./internal/once")),a=l(e("./internal/slice")),s=l(e("./internal/onlyOnce")),u=l(e("./internal/wrapAsync"));function l(e){return e&&e.__esModule?e:{default:e}}t.exports=r.default},{"./internal/once":11,"./internal/onlyOnce":12,"./internal/slice":14,"./internal/wrapAsync":16,"lodash/isArray":76,"lodash/noop":85}],18:[function(e,t,r){(function(e){(function(){"use strict";var r=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],n="undefined"==typeof globalThis?e:globalThis;t.exports=function(){for(var e=[],t=0;t<r.length;t++)"function"==typeof n[r[t]]&&(e[e.length]=r[t]);return e}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],19:[function(e,t,r){"use strict";r.byteLength=function(e){var t=l(e),r=t[0],n=t[1];return 3*(r+n)/4-n},r.toByteArray=function(e){var t,r,n=l(e),a=n[0],s=n[1],u=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,s)),c=0,f=s>0?a-4:a;for(r=0;r<f;r+=4)t=i[e.charCodeAt(r)]<<18|i[e.charCodeAt(r+1)]<<12|i[e.charCodeAt(r+2)]<<6|i[e.charCodeAt(r+3)],u[c++]=t>>16&255,u[c++]=t>>8&255,u[c++]=255&t;2===s&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,u[c++]=255&t);1===s&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t);return u},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],a=16383,s=0,u=r-i;s<u;s+=a)o.push(c(e,s,s+a>u?u:s+a));1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s<u;++s)n[s]=a[s],i[a.charCodeAt(s)]=s;function l(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,r){for(var i,o,a=[],s=t;s<r;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],20:[function(e,t,r){},{}],21:[function(e,t,r){arguments[4][20][0].apply(r,arguments)},{dup:20}],22:[function(e,t,r){(function(t){(function(){
|
|
2
|
+
/*!
|
|
3
|
+
* The buffer module from node.js, for the browser.
|
|
4
|
+
*
|
|
5
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
|
6
|
+
* @license MIT
|
|
7
|
+
*/"use strict";var t=e("base64-js"),n=e("ieee754");r.Buffer=a,r.SlowBuffer=function(e){+e!=e&&(e=0);return a.alloc(+e)},r.INSPECT_MAX_BYTES=50;var i=2147483647;function o(e){if(e>i)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=a.prototype,t}function a(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return l(e)}return s(e,t,r)}function s(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!a.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|d(e,t),n=o(r),i=n.write(e,t);i!==r&&(n=n.slice(0,i));return n}(e,t);if(ArrayBuffer.isView(e))return c(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(N(e,ArrayBuffer)||e&&N(e.buffer,ArrayBuffer))return function(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r);return n.__proto__=a.prototype,n}(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return a.from(n,t,r);var i=function(e){if(a.isBuffer(e)){var t=0|f(e.length),r=o(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||F(e.length)?o(0):c(e);if("Buffer"===e.type&&Array.isArray(e.data))return c(e.data)}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return a.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function l(e){return u(e),o(e<0?0:0|f(e))}function c(e){for(var t=e.length<0?0:0|f(e.length),r=o(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function f(e){if(e>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|e}function d(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||N(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return P(e).length;default:if(i)return n?-1:q(e).length;t=(""+t).toLowerCase(),i=!0}}function h(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return D(this,t,r);case"utf8":case"utf-8":return R(this,t,r);case"ascii":return j(this,t,r);case"latin1":case"binary":return O(this,t,r);case"base64":return E(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function p(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),F(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=a.from(t,n)),a.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,i){var o,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var c=-1;for(o=r;o<s;o++)if(l(e,o)===l(t,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===u)return c*a}else-1!==c&&(o-=o-c),c=-1}else for(r+u>s&&(r=s-u),o=r;o>=0;o--){for(var f=!0,d=0;d<u;d++)if(l(e,o+d)!==l(t,d)){f=!1;break}if(f)return o}return-1}function g(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(t.substr(2*a,2),16);if(F(s))return a;e[r+a]=s}return a}function m(e,t,r,n){return B(q(t,e.length-r),e,r,n)}function v(e,t,r,n){return B(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function w(e,t,r,n){return v(e,t,r,n)}function _(e,t,r,n){return B(P(t),e,r,n)}function S(e,t,r,n){return B(function(e,t){for(var r,n,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)n=(r=e.charCodeAt(a))>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function E(e,r,n){return 0===r&&n===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(r,n))}function R(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,a,s,u,l=e[i],c=null,f=l>239?4:l>223?3:l>191?2:1;if(i+f<=r)switch(f){case 1:l<128&&(c=l);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&l)<<6|63&o)>127&&(c=u);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(u=(15&l)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,f=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=f}return function(e){var t=e.length;if(t<=A)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=A));return r}(n)}r.kMaxLength=i,a.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}(),a.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||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."),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),a.poolSize=8192,a.from=function(e,t,r){return s(e,t,r)},a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,a.alloc=function(e,t,r){return function(e,t,r){return u(e),e<=0?o(e):void 0!==t?"string"==typeof r?o(e).fill(t,r):o(e).fill(t):o(e)}(e,t,r)},a.allocUnsafe=function(e){return l(e)},a.allocUnsafeSlow=function(e){return l(e)},a.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==a.prototype},a.compare=function(e,t){if(N(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),N(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(e)||!a.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},a.isEncoding=function(e){switch(String(e).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!0;default:return!1}},a.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return a.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=a.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var o=e[r];if(N(o,Uint8Array)&&(o=a.from(o)),!a.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},a.byteLength=d,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)p(this,t,t+1);return this},a.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)p(this,t,t+3),p(this,t+1,t+2);return this},a.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)p(this,t,t+7),p(this,t+1,t+6),p(this,t+2,t+5),p(this,t+3,t+4);return this},a.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?R(this,0,e):h.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(e){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===a.compare(this,e)},a.prototype.inspect=function(){var e="",t=r.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},a.prototype.compare=function(e,t,r,n,i){if(N(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),u=Math.min(o,s),l=this.slice(n,i),c=e.slice(t,r),f=0;f<u;++f)if(l[f]!==c[f]){o=l[f],s=c[f];break}return o<s?-1:s<o?1:0},a.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},a.prototype.indexOf=function(e,t,r){return y(this,e,t,r,!0)},a.prototype.lastIndexOf=function(e,t,r){return y(this,e,t,r,!1)},a.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return g(this,e,t,r);case"utf8":case"utf-8":return m(this,e,t,r);case"ascii":return v(this,e,t,r);case"latin1":case"binary":return w(this,e,t,r);case"base64":return _(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function j(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function O(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function D(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=M(e[o]);return i}function C(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function T(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function L(e,t,r,n,i,o){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function I(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function x(e,t,r,i,o){return t=+t,r>>>=0,o||I(e,0,r,4),n.write(e,t,r,i,23,4),r+4}function U(e,t,r,i,o){return t=+t,r>>>=0,o||I(e,0,r,8),n.write(e,t,r,i,52,8),r+8}a.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return n.__proto__=a.prototype,n},a.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},a.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},a.prototype.readUInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},a.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},a.prototype.readInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),n.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),n.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),n.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),n.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||L(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},a.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||L(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},a.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);L(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<r&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},a.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);L(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},a.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeFloatLE=function(e,t,r){return x(this,e,t,!0,r)},a.prototype.writeFloatBE=function(e,t,r){return x(this,e,t,!1,r)},a.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},a.prototype.copy=function(e,t,r,n){if(!a.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i=n-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,n);else if(this===e&&r<t&&t<n)for(var o=i-1;o>=0;--o)e[o+t]=this[o+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return i},a.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var i=e.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(e=i)}}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{var s=a.isBuffer(e)?e:a.from(e,n),u=s.length;if(0===u)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-t;++o)this[o+t]=s[o%u]}return this};var k=/[^+/0-9A-Za-z-_]/g;function M(e){return e<16?"0"+e.toString(16):e.toString(16)}function q(e,t){var r;t=t||1/0;for(var n=e.length,i=null,o=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function P(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(k,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function B(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function N(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function F(e){return e!=e}}).call(this)}).call(this,e("buffer").Buffer)},{"base64-js":19,buffer:22,ieee754:46}],23:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],24:[function(e,t,r){"use strict";var n=e("get-intrinsic"),i=e("./"),o=i(n("String.prototype.indexOf"));t.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&o(e,".prototype.")>-1?i(r):r}},{"./":25,"get-intrinsic":39}],25:[function(e,t,r){"use strict";var n=e("function-bind"),i=e("get-intrinsic"),o=i("%Function.prototype.apply%"),a=i("%Function.prototype.call%"),s=i("%Reflect.apply%",!0)||n.call(a,o),u=i("%Object.getOwnPropertyDescriptor%",!0),l=i("%Object.defineProperty%",!0),c=i("%Math.max%");if(l)try{l({},"a",{value:1})}catch(e){l=null}t.exports=function(e){var t=s(n,a,arguments);u&&l&&(u(t,"length").configurable&&l(t,"length",{value:1+c(0,e.length-(arguments.length-1))}));return t};var f=function(){return s(n,o,arguments)};l?l(t.exports,"apply",{value:f}):t.exports.apply=f},{"function-bind":36,"get-intrinsic":39}],26:[function(e,t,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}t.exports=s,t.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}g(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&g(e,"error",t,r)}(e,i,{once:!0})}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var u=10;function l(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function f(e,t,r,n){var i,o,a,s;if(l(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),a=o[t]),void 0===a)a=o[t]=r,++e._eventsCount;else if("function"==typeof a?a=o[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=c(e))>0&&a.length>i&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,s=u,console&&console.warn&&console.warn(s)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=d.bind(n);return i.listener=r,n.wrapFn=i,i}function p(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):b(i,i.length)}function y(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function b(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function g(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){n.once&&e.removeEventListener(t,i),r(o)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");u=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)o(u,this,t);else{var l=u.length,c=b(u,l);for(r=0;r<l;++r)o(c[r],this,t)}return!0},s.prototype.addListener=function(e,t){return f(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return f(this,e,t,!0)},s.prototype.once=function(e,t){return l(t),this.on(e,h(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,h(this,e,t)),this},s.prototype.removeListener=function(e,t){var r,n,i,o,a;if(l(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},s.prototype.listeners=function(e){return p(this,e,!0)},s.prototype.rawListeners=function(e){return p(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):y.call(e,t)},s.prototype.listenerCount=y,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},{}],27:[function(e,t,r){"use strict";var n=e("is-callable"),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty,a=function(e,t,r){for(var n=0,i=e.length;n<i;n++)o.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))},s=function(e,t,r){for(var n=0,i=e.length;n<i;n++)null==r?t(e.charAt(n),n,e):t.call(r,e.charAt(n),n,e)},u=function(e,t,r){for(var n in e)o.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))};t.exports=function(e,t,r){if(!n(t))throw new TypeError("iterator must be a function");var o;arguments.length>=3&&(o=r),"[object Array]"===i.call(e)?a(e,t,o):"string"==typeof e?s(e,t,o):u(e,t,o)}},{"is-callable":49}],28:[function(e,t,r){
|
|
8
|
+
/**
|
|
9
|
+
* FoxHound Query Generation Library
|
|
10
|
+
* @license MIT
|
|
11
|
+
* @author Steven Velozo <steven@velozo.com>
|
|
12
|
+
*/
|
|
13
|
+
const n=e("./Parameters.js");t.exports=function t(r,i){if("object"!=typeof r||!("fable"in r))return{new:t};var o=r,a=void 0===i?{}:i,s=!1,u=e("./Foxhound-Dialects.js"),l=o.getUUID(),c=0,f=!1,d=function(){return(s=o.Utility.extend({},n,a)).query={disableAutoIdentity:!1,disableAutoDateStamp:!1,disableAutoUserStamp:!1,disableDeleteTracking:!1,body:!1,schema:!1,IDUser:0,UUID:o.getUUID(),records:!1,parameters:{}},s.result={executed:!1,value:!1,error:void 0},this};d();var h=function(e,t,r,n){if("string"!=typeof e)return o.log.warn("Tried to add an invalid query join table",{queryUUID:l,parameters:s}),this;if(void 0===t||void 0===r)return o.log.warn("Tried to add an invalid query join field",{queryUUID:l,parameters:s}),this;if(0!=t.indexOf(e))return o.log.warn("Tried to add an invalid query join field, join must come FROM the join table!",{queryUUID:l,parameters:s,invalidField:t}),this;if(r.indexOf(".")<=0)return o.log.warn("Tried to add an invalid query join field, join must go TO a field on another table ([table].[field])!",{queryUUID:l,parameters:s,invalidField:r}),this;var i={Type:void 0===n?"INNER JOIN":n,Table:e,From:t,To:r};return Array.isArray(s.join)?s.join.push(i):s.join=[i],c>2&&o.log.info("Added a join",{queryUUID:l,parameters:s}),this},p=function(e){return"string"!=typeof e?(o.log.warn("Dialect set to English - invalid name",{queryUUID:l,parameters:s,invalidDialect:e}),p("English")):(u.hasOwnProperty(e)?(f=u[e](o),c>2&&o.log.info("Dialog set to: "+e,{queryUUID:l,parameters:s})):(o.log.error('Dialect not set - unknown dialect "'+e+"'",{queryUUID:l,parameters:s,invalidDialect:e}),p("English")),this)},y=function(){!1===f&&p("English")},b={resetParameters:d,mergeParameters:function(e){return s=o.Utility.extend({},s,e),this},setLogLevel:function(e){var t=0;return"number"==typeof e&&e%1==0&&(t=e),c=t,this},setScope:function(e){var t=!1;return"string"==typeof e?t=e:!1!==e&&o.log.error("Scope set failed. You must pass in a string or array.",{queryUUID:l,parameters:s,invalidScope:e}),s.scope=t,c>2&&o.log.info("Scope set: "+t,{queryUUID:l,parameters:s}),this},setDistinct:function(e){return s.distinct=!!e,c>2&&o.log.info("Distinct set: "+s.distinct,{queryUUID:l,parameters:s}),this},setIDUser:function(e){var t=0;return"number"==typeof e&&e%1==0&&e>=0?t=e:!1!==e&&o.log.error("User set failed; non-positive or non-numeric argument.",{queryUUID:l,parameters:s,invalidIDUser:e}),s.userID=t,s.query.IDUser=t,c>2&&o.log.info("IDUser set to: "+t,{queryUUID:l,parameters:s}),this},setDataElements:function(e){var t=!1;return Array.isArray(e)&&(t=e),"string"==typeof e&&(t=[e]),s.dataElements=t,c>2&&o.log.info("Data Elements set",{queryUUID:l,parameters:s}),this},setBegin:function(e){var t=!1;return"number"==typeof e&&e%1==0&&e>=0?t=e:!1!==e&&o.log.error("Begin set failed; non-positive or non-numeric argument.",{queryUUID:l,parameters:s,invalidBeginAmount:e}),s.begin=t,c>2&&o.log.info("Begin set: "+e,{queryUUID:l,parameters:s}),this},setCap:function(e){var t=!1;return"number"==typeof e&&e%1==0&&e>=0?t=e:!1!==e&&o.log.error("Cap set failed; non-positive or non-numeric argument.",{queryUUID:l,parameters:s,invalidCapAmount:e}),s.cap=t,c>2&&o.log.info("Cap set to: "+t,{queryUUID:l,parameters:s}),this},setFilter:function(e){var t=!1;return Array.isArray(e)?t=e:"object"==typeof e&&(t=[e]),s.filter=t,c>2&&o.log.info("Filter set",{queryUUID:l,parameters:s}),this},addFilter:function(e,t,r,n,i){if("string"!=typeof e)return o.log.warn("Tried to add an invalid query filter column",{queryUUID:l,parameters:s}),this;if(void 0===t)return o.log.warn("Tried to add an invalid query filter value",{queryUUID:l,parameters:s,invalidColumn:e}),this;var a=void 0===i?e:i,u={Column:e,Operator:void 0===r?"=":r,Value:t,Connector:void 0===n?"AND":n,Parameter:a=a.replace(".","_")};return Array.isArray(s.filter)?s.filter.push(u):s.filter=[u],c>2&&o.log.info("Added a filter",{queryUUID:l,parameters:s,newFilter:u}),this},setSort:function(e){var t=!1;return Array.isArray(e)?t=e:"string"==typeof e?t=[{Column:e,Direction:"Ascending"}]:"object"==typeof e&&(t=[e]),s.sort=t,c>2&&o.log.info("Sort set",{queryUUID:l,parameters:s}),this},addSort:function(e){var t=!1;return"string"==typeof e&&(t={Column:e,Direction:"Ascending"}),"object"==typeof e&&(t=e),s.sort||(s.sort=[]),s.sort.push(t),c>2&&o.log.info("Sort set",{queryUUID:l,parameters:s}),this},setJoin:function(e){return s.join=[],Array.isArray(e)?e.forEach((function(e){h(e.Table,e.From,e.To,e.Type)})):"object"==typeof e&&h(e.Table,e.From,e.To,e.Type),this},addJoin:h,addRecord:function(e){return"object"!=typeof e?(o.log.warn("Tried to add an invalid record to the query -- records must be an object",{queryUUID:l,parameters:s}),this):(Array.isArray(s.query.records)?s.query.records.push(e):s.query.records=[e],c>2&&o.log.info("Added a record to the query",{queryUUID:l,parameters:s,newRecord:e}),this)},setDisableAutoIdentity:function(e){return s.query.disableAutoIdentity=e,this},setDisableAutoDateStamp:function(e){return s.query.disableAutoDateStamp=e,this},setDisableAutoUserStamp:function(e){return s.query.disableAutoUserStamp=e,this},setDisableDeleteTracking:function(e){return s.query.disableDeleteTracking=e,this},setDialect:p,buildCreateQuery:function(){return y(),s.query.body=f.Create(s),this},buildReadQuery:function(){return y(),s.query.body=f.Read(s),this},buildUpdateQuery:function(){return y(),s.query.body=f.Update(s),this},buildDeleteQuery:function(){return y(),s.query.body=f.Delete(s),this},buildUndeleteQuery:function(){return y(),s.query.body=f.Undelete(s),this},buildCountQuery:function(){return y(),s.query.body=f.Count(s),this},clone:function(){var e=t(o,n).setScope(s.scope).setBegin(s.begin).setCap(s.cap);return e.query.schema=s.query.schema,s.dataElements&&(e.parameters.dataElements=s.dataElements.slice()),s.sort&&(e.parameters.sort=s.sort.slice()),s.filter&&(e.parameters.filter=s.filter.slice()),e},new:t};return Object.defineProperty(b,"query",{get:function(){return s.query},set:function(e){s.query=e},enumerable:!0}),Object.defineProperty(b,"result",{get:function(){return s.result},set:function(e){s.result=e},enumerable:!0}),Object.defineProperty(b,"parameters",{get:function(){return s},set:function(e){s=e},enumerable:!0}),Object.defineProperty(b,"dialect",{get:function(){return f},enumerable:!0}),Object.defineProperty(b,"uuid",{get:function(){return l},enumerable:!0}),Object.defineProperty(b,"logLevel",{get:function(){return c},enumerable:!0}),b}()},{"./Foxhound-Dialects.js":29,"./Parameters.js":30}],29:[function(e,t,r){getDialects=()=>{let t={};return t.ALASQL=e("./dialects/ALASQL/FoxHound-Dialect-ALASQL.js"),t.English=e("./dialects/English/FoxHound-Dialect-English.js"),t.MeadowEndpoints=e("./dialects/MeadowEndpoints/FoxHound-Dialect-MeadowEndpoints.js"),t.MySQL=e("./dialects/MySQL/FoxHound-Dialect-MySQL.js"),t.default=t.English,t},t.exports=getDialects()},{"./dialects/ALASQL/FoxHound-Dialect-ALASQL.js":31,"./dialects/English/FoxHound-Dialect-English.js":32,"./dialects/MeadowEndpoints/FoxHound-Dialect-MeadowEndpoints.js":33,"./dialects/MySQL/FoxHound-Dialect-MySQL.js":34}],30:[function(e,t,r){t.exports={scope:!1,dataElements:!1,begin:!1,cap:!1,filter:!1,sort:!1,join:!1,queryOverride:!1,query:!1,userID:0,result:!1}},{}],31:[function(e,t,r){t.exports=function(e){_Fable=e;var t=function(e){return" "+e.scope},r=(e,t)=>{if(e.indexOf(".")<0)return"`"+e+"`";var r=t.scope;return e.indexOf(r+".")>-1?"`"+e.replace(r+".","")+"`":"`"+e+"`"},n=function(e,t){var n=e.dataElements;if(!Array.isArray(n)||n.length<1){if(!t)return" *";const r=Array.isArray(e.query.schema)?e.query.schema:[];if(r.length<1)return"";const n=r.find((e=>"AutoIdentity"===e.Type));return n?` ${n.Column}`:""}for(var i=" ",o=0;o<n.length;o++)o>0&&(i+=", "),i+=r(n[o],e);return i},i=function(e){var n=Array.isArray(e.filter)?e.filter:[],i=t(e).trim();if(!e.query.disableDeleteTracking)for(var o=Array.isArray(e.query.schema)?e.query.schema:[],a=0;a<o.length;a++){var s=o[a];if("Deleted"===s.Type){var u=!1;if(n.length>0)for(var l=0;l<n.length;l++)if(n[l].Column===s.Column){u=!0;break}u||n.push({Column:i+"."+s.Column,Operator:"=",Value:0,Connector:"AND",Parameter:"Deleted"});break}}if(n.length<1)return"";var c=" WHERE",f=!1;for(a=0;a<n.length;a++){var d;"NONE"!=n[a].Connector&&")"!=n[a].Operator&&" WHERE"!=c&&0==f&&(c+=" "+n[a].Connector),f=!1,"("===n[a].Operator?(c+=" (",f=!0):")"===n[a].Operator?c+=" )":"IN"===n[a].Operator?(d=n[a].Parameter+"_w"+a,c+=" "+r(n[a].Column,e)+" "+n[a].Operator+" ( :"+d+" )",e.query.parameters[d]=n[a].Value):"IS NOT NULL"===n[a].Operator?c+=" "+r(n[a].Column,e)+" "+n[a].Operator:(d=n[a].Parameter+"_w"+a,c+=" "+r(n[a].Column,e)+" "+n[a].Operator+" :"+d,e.query.parameters[d]=n[a].Value)}return c},o={Create:function(e){var n=t(e),i=function(e){var t=e.query.records,n=Array.isArray(e.query.schema)?e.query.schema:[],i="";for(var o in t[0]){for(var a={Column:o,Type:"Default"},s=0;s<n.length;s++)if(o==n[s].Column){a=n[s];break}(e.query.disableDeleteTracking||"DeleteDate"!==a.Type&&"DeleteIDUser"!==a.Type)&&(a.Type,""!=i&&(i+=","),i+=" "+r(o,e))}return i}(e),o=function(e){var t=e.query.records;if(!Array.isArray(t)||t.length<1)return!1;var r=Array.isArray(e.query.schema)?e.query.schema:[],n="",i=0;for(var o in t[0]){for(var a={Column:o,Type:"Default"},s=0;s<r.length;s++)if(o==r[s].Column){a=r[s];break}if(e.query.disableDeleteTracking||"DeleteDate"!==a.Type&&"DeleteIDUser"!==a.Type){i>0&&(n+=",");var u,l=function(){var r=o+"_"+i;n+=" :"+r,e.query.parameters[r]=t[0][o]};switch(a.Type){case"AutoIdentity":e.query.disableAutoIdentity?l():n+=" NULL";break;case"AutoGUID":e.query.disableAutoIdentity||t[0][o]&&t[0][o].length>=5&&"0x0000000000000000"!==t[0][o]?l():(n+=" :"+(u=o+"_"+i),e.query.parameters[u]=e.query.UUID);break;case"UpdateDate":case"CreateDate":case"DeleteDate":e.query.disableAutoDateStamp?l():n+=" NOW()";break;case"UpdateIDUser":case"CreateIDUser":case"DeleteIDUser":e.query.disableAutoUserStamp?l():(n+=" :"+(u=o+"_"+i),e.query.parameters[u]=e.query.IDUser);break;default:l()}i++}}return""!==n&&n}(e);return!!o&&"INSERT INTO"+n+" ("+i+") VALUES ("+o+");"},Read:function(e){var o=n(e),a=t(e),s=i(e),u=function(e){var t=e.sort;if(!Array.isArray(t)||t.length<1)return"";for(var n=" ORDER BY",i=0;i<t.length;i++)i>0&&(n+=","),n+=" "+r(t[i].Column,e),"Descending"==t[i].Direction&&(n+=" DESC");return n}(e),l=function(e){if(!e.cap)return"";var t=" LIMIT";return t+=" "+e.cap,!1!==e.begin&&(t+=" FETCH "+e.begin),t}(e);const c=e.distinct?" DISTINCT":"";if(e.queryOverride)try{return _Fable.Utility.template(e.queryOverride)({FieldList:o,TableName:a,Where:s,OrderBy:u,Limit:l,Distinct:c,_Params:e})}catch(t){return console.log("Error with custom Read Query ["+e.queryOverride+"]: "+t),!1}return`SELECT${c}${o} FROM${a}${s}${u}${l};`},Update:function(e){var n=t(e),o=i(e),a=function(e){var t=e.query.records;if(!Array.isArray(t)||t.length<1)return!1;var n=Array.isArray(e.query.schema)?e.query.schema:[],i="",o=0;for(var a in t[0]){for(var s={Column:a,Type:"Default"},u=0;u<n.length;u++)if(a==n[u].Column){s=n[u];break}if(!(e.query.disableAutoDateStamp&&"UpdateDate"===s.Type||e.query.disableAutoUserStamp&&"UpdateIDUser"===s.Type)){switch(s.Type){case"AutoIdentity":case"CreateDate":case"CreateIDUser":case"DeleteDate":case"DeleteIDUser":continue}switch(o>0&&(i+=","),s.Type){case"UpdateDate":i+=" "+r(a,e)+" = NOW()";break;case"UpdateIDUser":var l=a+"_"+o;i+=" "+r(a,e)+" = :"+l,e.query.parameters[l]=e.query.IDUser;break;default:var c=a+"_"+o;i+=" "+r(a,e)+" = :"+c,e.query.parameters[c]=t[0][a]}o++}}return""!==i&&i}(e);return!!a&&"UPDATE"+n+" SET"+a+o+";"},Delete:function(e){var n=t(e),o=i(e),a=function(e){if(e.query.disableDeleteTracking)return!1;for(var t=Array.isArray(e.query.schema)?e.query.schema:[],n=0,i=!1,o="",a={Type:"Default"},s=0;s<t.length;s++){var u=null;switch((a=t[s]).Type){case"Deleted":u=" "+r(a.Column,e)+" = 1",i=!0;break;case"DeleteDate":case"UpdateDate":u=" "+r(a.Column,e)+" = NOW()";break;case"DeleteIDUser":var l=a.Column+"_"+n;u=" "+r(a.Column,e)+" = :"+l,e.query.parameters[l]=e.query.IDUser;break;default:continue}n>0&&(o+=","),o+=u,n++}return!(!i||""===o)&&o}(e);return a?"UPDATE"+n+" SET"+a+o+";":"DELETE FROM"+n+o+";"},Undelete:function(e){var n=t(e);let o=e.query.disableDeleteTracking;e.query.disableDeleteTracking=!0;var a=i(e),s=function(e){for(var t=Array.isArray(e.query.schema)?e.query.schema:[],n=0,i=!1,o="",a={Type:"Default"},s=0;s<t.length;s++){var u=null;switch((a=t[s]).Type){case"Deleted":u=" "+r(a.Column,e)+" = 0",i=!0;break;case"UpdateDate":u=" "+r(a.Column,e)+" = NOW()";break;case"UpdateIDUser":var l=a.Column+"_"+n;u=" "+r(a.Column,e)+" = :"+l,e.query.parameters[l]=e.query.IDUser;break;default:continue}n>0&&(o+=","),o+=u,n++}return!(!i||""===o)&&o}(e);return e.query.disableDeleteTracking=o,s?"UPDATE"+n+" SET"+s+a+";":"SELECT NULL;"},Count:function(e){var r=t(e),o=i(e);const a=e.distinct?n(e,!0):"*";e.distinct&&a.length<1&&console.warn("Distinct requested but no field list or schema are available, so not honoring distinct for count query.");const s=e.distinct&&a.length>0?"DISTINCT":"";if(e.queryOverride)try{return _Fable.Utility.template(e.queryOverride)({FieldList:[],TableName:r,Where:o,OrderBy:"",Limit:"",Distinct:s,_Params:e})}catch(t){return console.log("Error with custom Count Query ["+e.queryOverride+"]: "+t),!1}return`SELECT COUNT(${s}${a||"*"}) AS RowCount FROM${r}${o};`}};return Object.defineProperty(o,"name",{get:function(){return"ALASQL"},enumerable:!0}),o}},{}],32:[function(e,t,r){t.exports=function(){var e={Create:function(e){return"Here is a "+e.scope+"."},Read:function(e){var t=e.scope;return`Please give me all your ${e.distinct?"unique ":""}${t} records. Thanks.`},Update:function(e){return"I am changing your "+e.scope+"."},Delete:function(e){return"I am deleting your "+e.scope+"."},Undelete:function(e){return"I am undeleting your "+e.scope+"."},Count:function(e){var t=e.scope;return`Count your ${e.distinct?"unique ":""}${t}.`}};return Object.defineProperty(e,"name",{get:function(){return"English"},enumerable:!0}),e}},{}],33:[function(e,t,r){t.exports=function(){var e=function(e){return e.scope},t=function(t){var r=Array.isArray(t.filter)?t.filter:[],i=(e(t),"");let o=(e,t)=>{i.length>0&&(i+="~"),i+=`${e}~${t[0]}~${t[1]}~${t[2]}`},a=e=>{switch(tmpNewOperator="EQ",e.toUpperCase()){case"!=":tmpNewOperator="NE";break;case">":tmpNewOperator="GT";break;case">=":tmpNewOperator="GE";break;case"<=":tmpNewOperator="LE";break;case"<":tmpNewOperator="LT";break;case"LIKE":tmpNewOperator="LK";break;case"IN":tmpNewOperator="INN";break;case"NOT IN":tmpNewOperator="NI"}return tmpNewOperator};t.query.disableDeleteTracking&&o("FBV",["Deleted","GE","0"]);for(var s=0;s<r.length;s++)if("("===r[s].Operator)o("FOP",["0","(","0"]);else if(")"===r[s].Operator)o("FCP",["0",")","0"]);else if("IN"===r[s].Operator||"NOT IN"===r[s].Operator){let e="FBV";"OR"==r[s].Connector&&(e="FBVOR"),o(e,[r[s].Column,a(r[s].Operator),r[s].Value.map(encodeURIComponent).join(",")])}else if("IS NULL"===r[s].Operator)o("FBV",[r[s].Column,"IN","0"]);else if("IS NOT NULL"===r[s].Operator)o("FBV",[r[s].Column,"NN","0"]);else{let e="FBV";"OR"==r[s].Connector&&(e="FBVOR"),o(e,[r[s].Column,a(r[s].Operator),encodeURIComponent(r[s].Value)])}let u=n(t);return u&&(i&&(i+="~"),i+=u),i};function r(e){let t=e.query.disableAutoDateStamp,r=e.query.disableDeleteTracking,n=e.query.disableAutoIdentity,i=e.query.disableAutoUserStamp,o="",a=(e,t)=>{e&&(o.length>0&&(o+=","),o+=t)};return a(t,"DisableAutoDateStamp"),a(r,"DisableDeleteTracking"),a(n,"DisableAutoIdentity"),a(i,"DisableAutoUserStamp"),o}var n=function(e){var t=e.sort,r=!1;if(!Array.isArray(t)||t.length<1)return r;r="";for(var n=0;n<t.length;n++)n>0&&(r+="~"),r+=`FSF~${t[n].Column}~`,"Descending"==t[n].Direction?r+="DESC~0":r+="ASC~0";return r},i={Create:function(t){var n=e(t),i=r(t);if(n){let e=n;return i&&(e=`${e}/WithFlags/${i}`),e}return!1},Read:function(r){var n=e(r),i=function(e){var t=e.dataElements;if(!Array.isArray(t)||t.length<1)return"";for(var r="",n=0;n<t.length;n++)n>0&&(r+=","),r+=t[n];return r}(r),o=t(r),a=function(e){return e.cap?`${!1!==e.begin?e.begin:0}/${e.cap}`:""}(r),s=`${n}`;return r.filter&&1==r.filter.length&&r.filter[0].Column===function(e){return`ID${e.scope}`}(r)&&"="===r.filter[0].Operator&&""==a&&""==i&&!r.sort?s=`${s}/${r.filter[0].Value}`:(s=`${s}s`,i&&(s=`${s}/LiteExtended/${i}`),o&&(s=`${s}/FilteredTo/${o}`),a&&(s=`${s}/${a}`)),s},Update:function(t){var n=e(t),i=r(t);if(n){let e=n;return i&&(e=`${e}/WithFlags/${i}`),e}return!1},Delete:function(t){var r=e(t),n=function(e){var t=Array.isArray(e.filter)?e.filter:[],r=!1;if(t.length<1)return r;for(var n=0;n<t.length;n++)for(var i=Array.isArray(e.query.schema)?e.query.schema:[],o=(t[n].Column,0);o<i.length;o++)if(t[n].Column==i[o].Column&&"AutoIdentity"==i[o].Type){r=t[n].Value;break}return r}(t);return!!n&&`${r}/${n}`},Count:function(r){var n=e(r),i=t(r);return i?`${n}s/Count/FilteredTo/${i}`:`${n}s/Count`}};return Object.defineProperty(i,"name",{get:function(){return"MeadowEndpoints"},enumerable:!0}),i}},{}],34:[function(e,t,r){t.exports=function(e){const t="NOW(3)";_Fable=e;var r=function(e){return e.scope&&e.scope.indexOf("`")>=0?" "+e.scope:" `"+e.scope+"`"},n=function(e,t){var n=e.dataElements;if(!Array.isArray(n)||n.length<1){const n=r(e);if(!t)return n+".*";const i=Array.isArray(e.query.schema)?e.query.schema:[];if(i.length<1)return"";const o=i.find((e=>"AutoIdentity"===e.Type));if(!o)return"";const s=`${n}.${o.Column}`;return` ${a(s)}`}for(var i=" ",o=0;o<n.length;o++)o>0&&(i+=", "),Array.isArray(n[o])?(i+=a(n[o][0]),n[o].length>1&&n[o][1]&&(i+=" AS "+a(n[o][1]))):i+=a(n[o]);return i};const i=/^[` ]+|[` ]+$/g,o=e=>e.replace(i,"");var a=function(e){let t=e.split(".");if(t.length>1){const e=o(t[1]);return"*"===e?"`"+o(t[0])+"`.*":"`"+o(t[0])+"`.`"+e+"`"}return"*"===o(t[0])?"*":"`"+o(t[0])+"`"},s=function(e){var t=Array.isArray(e.filter)?e.filter:[],n=r(e);if(!e.query.disableDeleteTracking)for(var i=Array.isArray(e.query.schema)?e.query.schema:[],o=0;o<i.length;o++){var a=i[o];if("Deleted"===a.Type){var s=!1;if(t.length>0)for(var u=0;u<t.length;u++)if(t[u].Column===a.Column){s=!0;break}s||t.push({Column:n+"."+a.Column,Operator:"=",Value:0,Connector:"AND",Parameter:"Deleted"});break}}if(t.length<1)return"";var l=" WHERE",c=!1;for(o=0;o<t.length;o++){var f;"NONE"!=t[o].Connector&&")"!=t[o].Operator&&" WHERE"!=l&&0==c&&(l+=" "+t[o].Connector),c=!1,"("===t[o].Operator?(l+=" (",c=!0):")"===t[o].Operator?l+=" )":"IN"===t[o].Operator||"NOT IN"===t[o].Operator?(f=t[o].Parameter+"_w"+o,l+=" "+t[o].Column+" "+t[o].Operator+" ( :"+f+" )",e.query.parameters[f]=t[o].Value):"IS NULL"===t[o].Operator||"IS NOT NULL"===t[o].Operator?l+=" "+t[o].Column+" "+t[o].Operator:(f=t[o].Parameter+"_w"+o,l+=" "+t[o].Column+" "+t[o].Operator+" :"+f,e.query.parameters[f]=t[o].Value)}return l},u=function(e){var t=e.join;if(!Array.isArray(t)||t.length<1)return"";for(var r="",n=0;n<t.length;n++){var i=t[n];i.Type&&i.Table&&i.From&&i.To&&(r+=` ${i.Type} ${i.Table} ON ${i.From} = ${i.To}`)}return r},l={Create:function(e){var n=r(e),i=function(e){var t=e.query.records,r=Array.isArray(e.query.schema)?e.query.schema:[],n="";for(var i in t[0]){for(var o={Column:i,Type:"Default"},a=0;a<r.length;a++)if(i==r[a].Column){o=r[a];break}(e.query.disableDeleteTracking||"DeleteDate"!==o.Type&&"DeleteIDUser"!==o.Type)&&(o.Type,""!=n&&(n+=","),n+=" "+i)}return n}(e),o=function(e){var r=e.query.records;if(!Array.isArray(r)||r.length<1)return!1;var n=Array.isArray(e.query.schema)?e.query.schema:[],i="",o=0;for(var a in r[0]){for(var s={Column:a,Type:"Default"},u=0;u<n.length;u++)if(a==n[u].Column){s=n[u];break}if(e.query.disableDeleteTracking||"DeleteDate"!==s.Type&&"DeleteIDUser"!==s.Type){o>0&&(i+=",");var l,c=function(){var t=a+"_"+o;i+=" :"+t,e.query.parameters[t]=r[0][a]};switch(s.Type){case"AutoIdentity":e.query.disableAutoIdentity?c():i+=" NULL";break;case"AutoGUID":e.query.disableAutoIdentity||r[0][a]&&r[0][a].length>=5&&"0x0000000000000000"!==r[0][a]?c():(i+=" :"+(l=a+"_"+o),e.query.parameters[l]=e.query.UUID);break;case"UpdateDate":case"CreateDate":case"DeleteDate":e.query.disableAutoDateStamp?c():i+=" "+t;break;case"DeleteIDUser":case"UpdateIDUser":case"CreateIDUser":e.query.disableAutoUserStamp?c():(i+=" :"+(l=a+"_"+o),e.query.parameters[l]=e.query.IDUser);break;default:c()}o++}}return""!==i&&i}(e);return!!o&&"INSERT INTO"+n+" ("+i+") VALUES ("+o+");"},Read:function(e){var t=n(e),i=r(e),o=s(e),a=u(e),l=function(e){var t=e.sort;if(!Array.isArray(t)||t.length<1)return"";for(var r=" ORDER BY",n=0;n<t.length;n++)n>0&&(r+=","),r+=" "+t[n].Column,"Descending"==t[n].Direction&&(r+=" DESC");return r}(e),c=function(e){if(!e.cap)return"";var t=" LIMIT";return!1!==e.begin&&(t+=" "+e.begin+","),t+" "+e.cap}(e);const f=e.distinct?" DISTINCT":"";if(e.queryOverride)try{return _Fable.Utility.template(e.queryOverride)({FieldList:t,TableName:i,Where:o,Join:a,OrderBy:l,Limit:c,Distinct:f,_Params:e})}catch(t){return console.log("Error with custom Read Query ["+e.queryOverride+"]: "+t),!1}return`SELECT${f}${t} FROM${i}${a}${o}${l}${c};`},Update:function(e){var n=r(e),i=s(e),o=function(e){var r=e.query.records;if(!Array.isArray(r)||r.length<1)return!1;var n=Array.isArray(e.query.schema)?e.query.schema:[],i="",o=0;for(var a in r[0]){for(var s={Column:a,Type:"Default"},u=0;u<n.length;u++)if(a==n[u].Column){s=n[u];break}if(!(e.query.disableAutoDateStamp&&"UpdateDate"===s.Type||e.query.disableAutoUserStamp&&"UpdateIDUser"===s.Type)){switch(s.Type){case"AutoIdentity":case"CreateDate":case"CreateIDUser":case"DeleteDate":case"DeleteIDUser":continue}switch(o>0&&(i+=","),s.Type){case"UpdateDate":i+=" "+a+" = "+t;break;case"UpdateIDUser":var l=a+"_"+o;i+=" "+a+" = :"+l,e.query.parameters[l]=e.query.IDUser;break;default:var c=a+"_"+o;i+=" "+a+" = :"+c,e.query.parameters[c]=r[0][a]}o++}}return""!==i&&i}(e);return!!o&&"UPDATE"+n+" SET"+o+i+";"},Delete:function(e){var n=r(e),i=s(e),o=function(e){if(e.query.disableDeleteTracking)return!1;for(var r=Array.isArray(e.query.schema)?e.query.schema:[],n=0,i=!1,o="",a={Type:"Default"},s=0;s<r.length;s++){var u=null;switch((a=r[s]).Type){case"Deleted":u=" "+a.Column+" = 1",i=!0;break;case"DeleteDate":case"UpdateDate":u=" "+a.Column+" = "+t;break;case"DeleteIDUser":var l=a.Column+"_"+n;u=" "+a.Column+" = :"+l,e.query.parameters[l]=e.query.IDUser;break;default:continue}n>0&&(o+=","),o+=u,n++}return!(!i||""===o)&&o}(e);return o?"UPDATE"+n+" SET"+o+i+";":"DELETE FROM"+n+i+";"},Undelete:function(e){var n=r(e);let i=e.query.disableDeleteTracking;e.query.disableDeleteTracking=!0;var o=s(e),a=function(e){for(var r=Array.isArray(e.query.schema)?e.query.schema:[],n=0,i=!1,o="",a={Type:"Default"},s=0;s<r.length;s++){var u=null;switch((a=r[s]).Type){case"Deleted":u=" "+a.Column+" = 0",i=!0;break;case"UpdateDate":u=" "+a.Column+" = "+t;break;case"UpdateIDUser":var l=a.Column+"_"+n;u=" "+a.Column+" = :"+l,e.query.parameters[l]=e.query.IDUser;break;default:continue}n>0&&(o+=","),o+=u,n++}return!(!i||""===o)&&o}(e);return e.query.disableDeleteTracking=i,a?"UPDATE"+n+" SET"+a+o+";":"SELECT NULL;"},Count:function(e){var t=e.distinct?n(e,!0):"*",i=r(e),o=u(e),a=s(e);e.distinct&&t.length<1&&console.warn("Distinct requested but no field list or schema are available, so not honoring distinct for count query.");const l=e.distinct&&t.length>0?"DISTINCT":"";if(e.queryOverride)try{return _Fable.Utility.template(e.queryOverride)({FieldList:[],TableName:i,Where:a,OrderBy:"",Limit:"",Distinct:l,_Params:e})}catch(t){return console.log("Error with custom Count Query ["+e.queryOverride+"]: "+t),!1}return`SELECT COUNT(${l}${t||"*"}) AS RowCount FROM${i}${o}${a};`}};return Object.defineProperty(l,"name",{get:function(){return"MySQL"},enumerable:!0}),l}},{}],35:[function(e,t,r){"use strict";var n="Function.prototype.bind called on incompatible ",i=Array.prototype.slice,o=Object.prototype.toString,a="[object Function]";t.exports=function(e){var t=this;if("function"!=typeof t||o.call(t)!==a)throw new TypeError(n+t);for(var r,s=i.call(arguments,1),u=Math.max(0,t.length-s.length),l=[],c=0;c<u;c++)l.push("$"+c);if(r=Function("binder","return function ("+l.join(",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof r){var n=t.apply(this,s.concat(i.call(arguments)));return Object(n)===n?n:this}return t.apply(e,s.concat(i.call(arguments)))})),t.prototype){var f=function(){};f.prototype=t.prototype,r.prototype=new f,f.prototype=null}return r}},{}],36:[function(e,t,r){"use strict";var n=e("./implementation");t.exports=Function.prototype.bind||n},{"./implementation":35}],37:[function(e,t,r){for(var n=e("util"),i=e("is-property"),o=/[\{\[]/,a=/[\}\]]/,s=["do","if","in","for","let","new","try","var","case","else","enum","eval","null","this","true","void","with","await","break","catch","class","const","false","super","throw","while","yield","delete","export","import","public","return","static","switch","typeof","default","extends","finally","package","private","continue","debugger","function","arguments","interface","protected","implements","instanceof","NaN","undefined"],u={},l=0;l<s.length;l++)u[s[l]]=!0;var c=function(e){return i(e)&&!u.hasOwnProperty(e)},f={s:function(e){return""+e},d:function(e){return""+Number(e)},o:function(e){return JSON.stringify(e)}},d=function(){var e=[],t=0,r={},s=function(r){for(var n="";n.length<2*t;)n+=" ";e.push(n+r)},u=function(e){return a.test(e.trim()[0])&&o.test(e[e.length-1])?(t--,s(e),void t++):o.test(e[e.length-1])?(s(e),void t++):a.test(e.trim()[0])?(t--,void s(e)):void s(e)},l=function(e){if(!e)return l;if(1===arguments.length&&e.indexOf("\n")>-1)for(var t=e.trim().split("\n"),r=0;r<t.length;r++)u(t[r].trim());else u(n.format.apply(n,arguments));return l};return l.scope={},l.formats=f,l.sym=function(e){return e&&c(e)||(e="tmp"),r[e]||(r[e]=0),e+(r[e]++||"")},l.property=function(e,t){return 1===arguments.length&&(t=e,e=""),i(t+="")?e?e+"."+t:t:e?e+"["+JSON.stringify(t)+"]":JSON.stringify(t)},l.toString=function(){return e.join("\n")},l.toFunction=function(e){e||(e={});var t="return ("+l.toString()+")";Object.keys(l.scope).forEach((function(t){e[t]||(e[t]=l.scope[t])}));var r=Object.keys(e).map((function(e){return e})),n=r.map((function(t){return e[t]}));return Function.apply(null,r.concat(t)).apply(null,n)},arguments.length&&l.apply(null,arguments),l};d.formats=f,t.exports=d},{"is-property":54,util:171}],38:[function(e,t,r){var n=e("is-property"),i=function(e,t){return n(t)?e+"."+t:e+"["+JSON.stringify(t)+"]"};i.valid=n,i.property=function(e){return n(e)?e:JSON.stringify(e)},t.exports=i},{"is-property":54}],39:[function(e,t,r){"use strict";var n,i=SyntaxError,o=Function,a=TypeError,s=function(e){try{return o('"use strict"; return ('+e+").constructor;")()}catch(e){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(e){u=null}var l=function(){throw new a},c=u?function(){try{return l}catch(e){try{return u(arguments,"callee").get}catch(e){return l}}}():l,f=e("has-symbols")(),d=Object.getPrototypeOf||function(e){return e.__proto__},h={},p="undefined"==typeof Uint8Array?n:d(Uint8Array),y={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":f?d([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":h,"%AsyncGenerator%":h,"%AsyncGeneratorFunction%":h,"%AsyncIteratorPrototype%":h,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":h,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":f?d(d([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&f?d((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&f?d((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":f?d(""[Symbol.iterator]()):n,"%Symbol%":f?Symbol:n,"%SyntaxError%":i,"%ThrowTypeError%":c,"%TypedArray%":p,"%TypeError%":a,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};try{null.error}catch(e){var b=d(d(e));y["%Error.prototype%"]=b}var g=function e(t){var r;if("%AsyncFunction%"===t)r=s("async function () {}");else if("%GeneratorFunction%"===t)r=s("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=s("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&(r=d(i.prototype))}return y[t]=r,r},m={"%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"]},v=e("function-bind"),w=e("has"),_=v.call(Function.call,Array.prototype.concat),S=v.call(Function.apply,Array.prototype.splice),E=v.call(Function.call,String.prototype.replace),R=v.call(Function.call,String.prototype.slice),A=v.call(Function.call,RegExp.prototype.exec),j=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,O=/\\(\\)?/g,D=function(e){var t=R(e,0,1),r=R(e,-1);if("%"===t&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return E(e,j,(function(e,t,r,i){n[n.length]=r?E(i,O,"$1"):t||e})),n},C=function(e,t){var r,n=e;if(w(m,n)&&(n="%"+(r=m[n])[0]+"%"),w(y,n)){var o=y[n];if(o===h&&(o=g(n)),void 0===o&&!t)throw new a("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new i("intrinsic "+e+" does not exist!")};t.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new a('"allowMissing" argument must be a boolean');if(null===A(/^%?[^%]*%?$/,e))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=D(e),n=r.length>0?r[0]:"",o=C("%"+n+"%",t),s=o.name,l=o.value,c=!1,f=o.alias;f&&(n=f[0],S(r,_([0,1],f)));for(var d=1,h=!0;d<r.length;d+=1){var p=r[d],b=R(p,0,1),g=R(p,-1);if(('"'===b||"'"===b||"`"===b||'"'===g||"'"===g||"`"===g)&&b!==g)throw new i("property names with quotes must have matching quotes");if("constructor"!==p&&h||(c=!0),w(y,s="%"+(n+="."+p)+"%"))l=y[s];else if(null!=l){if(!(p in l)){if(!t)throw new a("base intrinsic for "+e+" exists, but the property is not available.");return}if(u&&d+1>=r.length){var m=u(l,p);l=(h=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:l[p]}else h=w(l,p),l=l[p];h&&!c&&(y[s]=l)}}return l}},{"function-bind":36,has:44,"has-symbols":41}],40:[function(e,t,r){"use strict";var n=e("get-intrinsic")("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(e){n=null}t.exports=n},{"get-intrinsic":39}],41:[function(e,t,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=e("./shams");t.exports=function(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&i())))}},{"./shams":42}],42:[function(e,t,r){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},{}],43:[function(e,t,r){"use strict";var n=e("has-symbols/shams");t.exports=function(){return n()&&!!Symbol.toStringTag}},{"has-symbols/shams":42}],44:[function(e,t,r){"use strict";var n=e("function-bind");t.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},{"function-bind":36}],45:[function(e,t,r){var n=e("http"),i=e("url"),o=t.exports;for(var a in n)n.hasOwnProperty(a)&&(o[a]=n[a]);function s(e){if("string"==typeof e&&(e=i.parse(e)),e.protocol||(e.protocol="https:"),"https:"!==e.protocol)throw new Error('Protocol "'+e.protocol+'" not supported. Expected "https:"');return e}o.request=function(e,t){return e=s(e),n.request.call(this,e,t)},o.get=function(e,t){return e=s(e),n.get.call(this,e,t)}},{http:144,url:166}],46:[function(e,t,r){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */r.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,u=(1<<s)-1,l=u>>1,c=-7,f=r?i-1:0,d=r?-1:1,h=e[t+f];for(f+=d,o=h&(1<<-c)-1,h>>=-c,c+=s;c>0;o=256*o+e[t+f],f+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+e[t+f],f+=d,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),o-=l}return(h?-1:1)*a*Math.pow(2,o-n)},r.write=function(e,t,r,n,i,o){var a,s,u,l=8*o-i-1,c=(1<<l)-1,f=c>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,p=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=c?(s=0,a=c):a+f>=1?(s=(t*u-1)*Math.pow(2,i),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;e[r+h]=255&s,h+=p,s/=256,i-=8);for(a=a<<i|s,l+=i;l>0;e[r+h]=255&a,h+=p,a/=256,l-=8);e[r+h-p]|=128*y}},{}],47:[function(e,t,r){"function"==typeof Object.create?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},{}],48:[function(e,t,r){"use strict";var n=e("has-tostringtag/shams")(),i=e("call-bind/callBound")("Object.prototype.toString"),o=function(e){return!(n&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===i(e)},a=function(e){return!!o(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"[object Function]"===i(e.callee)},s=function(){return o(arguments)}();o.isLegacyArguments=a,t.exports=s?o:a},{"call-bind/callBound":24,"has-tostringtag/shams":43}],49:[function(e,t,r){"use strict";var n,i,o=Function.prototype.toString,a="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof a&&"function"==typeof Object.defineProperty)try{n=Object.defineProperty({},"length",{get:function(){throw i}}),i={},a((function(){throw 42}),null,n)}catch(e){e!==i&&(a=null)}else a=null;var s=/^\s*class\b/,u=function(e){try{var t=o.call(e);return s.test(t)}catch(e){return!1}},l=function(e){try{return!u(e)&&(o.call(e),!0)}catch(e){return!1}},c=Object.prototype.toString,f="function"==typeof Symbol&&!!Symbol.toStringTag,d=!(0 in[,]),h=function(){return!1};if("object"==typeof document){var p=document.all;c.call(p)===c.call(document.all)&&(h=function(e){if((d||!e)&&(void 0===e||"object"==typeof e))try{var t=c.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}t.exports=a?function(e){if(h(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{a(e,null,n)}catch(e){if(e!==i)return!1}return!u(e)&&l(e)}:function(e){if(h(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(f)return l(e);if(u(e))return!1;var t=c.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&l(e)}},{}],50:[function(e,t,r){"use strict";var n,i=Object.prototype.toString,o=Function.prototype.toString,a=/^\s*(?:function)?\*/,s=e("has-tostringtag/shams")(),u=Object.getPrototypeOf;t.exports=function(e){if("function"!=typeof e)return!1;if(a.test(o.call(e)))return!0;if(!s)return"[object GeneratorFunction]"===i.call(e);if(!u)return!1;if(void 0===n){var t=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(e){}}();n=!!t&&u(t)}return u(e)===n}},{"has-tostringtag/shams":43}],51:[function(e,t,r){var n=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,i=/\/\d{1,3}(?=%|$)/,o=/\//,a=/%.*$/,s=/([^0-9a-f:/%])/i,u=/([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/i;function l(e){if(!n.test(e))return!1;var t=e.split(".");if(4!==t.length)return!1;if("0"===t[0][0]&&t[0].length>1)return!1;if("0"===t[1][0]&&t[1].length>1)return!1;if("0"===t[2][0]&&t[2].length>1)return!1;if("0"===t[3][0]&&t[3].length>1)return!1;var r=Number(t[0]),i=Number(t[1]),o=Number(t[2]),a=Number(t[3]);return r>=0&&r<256&&i>=0&&i<256&&o>=0&&o<256&&a>=0&&a<256}function c(e){var t=e.replace(i,""),r=e.length!==t.length;if(r)return!1;if(!r&&o.test(e))return!1;var n=t.replace(a,""),c=n.lastIndexOf(":");if(-1===c)return!1;var f=l(n.substring(c+1))?n.substring(0,c+1)+"1234:5678":n;if(s.test(f))return!1;if(u.test(f))return!1;var d=f.split("::");if(d.length>2)return!1;if(2===d.length){var h=""===d[0]?[]:d[0].split(":"),p=""===d[1]?[]:d[1].split(":");if(8-(h.length+p.length)<=0)return!1}else if(8!==f.split(":").length)return!1;return!0}function f(e){return l(e)||c(e)}t.exports=function(e){if(e||(e={}),4===e.version)return l;if(6===e.version)return c;if(null==e.version)return f;throw new Error("Unknown version: "+e.version)},t.exports.__all_regexes__=[n,i,o,a,s,u]},{}],52:[function(e,t,r){var n=e("is-my-ip-valid"),i=/\s/,o=/^[a-zA-Z0-9.-]+$/,a=/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/,s=/^\+[0-9][0-9 ]{5,27}[0-9]$/,u=/ {2}/,l=/ /g;r["date-time"]=/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-[0-9]{2}[tT ]\d{2}:\d{2}:\d{2}(?:\.\d+|)([zZ]|[+-]\d{2}:\d{2})$/,r.date=/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-[0-9]{2}$/,r.time=/^\d{2}:\d{2}:\d{2}$/,r.email=function(e){return-1!==e.indexOf("@")&&!i.test(e)},r["ip-address"]=r.ipv4=n({version:4}),r.ipv6=n({version:6}),r.uri=/^[a-zA-Z][a-zA-Z0-9+\-.]*:[^\s]*$/,r.color=/(#?([0-9A-Fa-f]{3,6})\b)|(aqua)|(black)|(blue)|(fuchsia)|(gray)|(green)|(lime)|(maroon)|(navy)|(olive)|(orange)|(purple)|(red)|(silver)|(teal)|(white)|(yellow)|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\))/,r.hostname=function(e){if(!o.test(e))return!1;for(var t=e.split("."),r=0;r<t.length;r++)if(!a.test(t[r]))return!1;return!0},r.alpha=/^[a-zA-Z]+$/,r.alphanumeric=/^[a-zA-Z0-9]+$/,r.style=/.:\s*[^;]/g,r.phone=function(e){if(!s.test(e))return!1;if(u.test(e))return!1;var t=e.substring(1).replace(l,"").length;return t>=7&&t<=15},r["utc-millisec"]=/^[0-9]{1,15}\.?[0-9]{0,15}$/},{"is-my-ip-valid":51}],53:[function(e,t,r){var n=e("generate-object-property"),i=e("generate-function"),o=e("jsonpointer"),a=e("xtend"),s=e("./formats"),u={any:function(){return"true"},null:function(e){return e+" === null"},boolean:function(e){return"typeof "+e+' === "boolean"'},array:function(e){return"Array.isArray("+e+")"},object:function(e){return"typeof "+e+' === "object" && '+e+" && !Array.isArray("+e+")"},number:function(e){return"typeof "+e+' === "number" && isFinite('+e+")"},integer:function(e){return"typeof "+e+' === "number" && (Math.floor('+e+") === "+e+" || "+e+" > 9007199254740992 || "+e+" < -9007199254740992)"},string:function(e){return"typeof "+e+' === "string"'}},l=function(e,t){t=Math.min(-1===t?e.length:t,e.length);for(var r=[],n=0;n<t;n++)r.push("object"==typeof e[n]?JSON.stringify(e[n]):e[n]);for(n=1;n<r.length;n++)if(r.indexOf(r[n])!==n)return!1;return!0},c=function(e,t){var r,n=(0|t)!==t?Math.pow(10,t.toString().split(".").pop().length):1;n>1?r=((0|e)!==e?Math.pow(10,e.toString().split(".").pop().length):1)>n||Math.round(n*e)%(n*t):r=e%t;return!r},f=function(e,t,r){return r>-1&&t.length>r||e.test(t)},d=function(e,t,r,h,p){var y=p?a(s,p.formats):s,b={unique:l,formats:y,isMultipleOf:c,testLimitedRegex:f},g=!!p&&!!p.verbose,m=!(!p||void 0===p.greedy)&&p.greedy,v={},w=[],_=function(e){var t=e+(v[e]=(v[e]||0)+1);return w.push(t),t},S=function(e){var t=JSON.stringify(e);try{for(var r=/\[([^\[\]"]+)\]/;r.test(t);)t=t.replace(r,n);return t}catch(t){return JSON.stringify(e)}function n(e,t){if(-1===w.indexOf(t))throw new Error("Unreplaceable");return'." + '+t+' + "'}},E={},R=function(e){if(E[e])return E[e];var t=_("pattern");return b[t]=new RegExp(e),E[e]=t,t},A=["i","j","k","l","m","n","o","p","q","r","s","t","u","v","x","y","z"],j=function(){var e=A.shift();return A.push(e+e[0]),w.push(e),e},O=function(e,i,a,l,c){var f=i.properties,h=i.type,v=!1;Array.isArray(i.items)&&(f={},i.items.forEach((function(e,t){f[t]=e})),h="array",v=!0);var w=0,E=function(t,r,n){D("errors++"),!0===a&&(D("if (validate.errors === null) validate.errors = []"),g?D("validate.errors.push({field:%s,message:%s,value:%s,type:%s,schemaPath:%s})",S(r||e),JSON.stringify(t),n||e,JSON.stringify(h),JSON.stringify(c)):D("validate.errors.push({field:%s,message:%s})",S(r||e),JSON.stringify(t)))};!0===i.required?(w++,D("if (%s === undefined) {",e),E("is required"),D("} else {")):(w++,D("if (%s !== undefined) {",e));var A=[].concat(h).map((function(t){if(t&&!u.hasOwnProperty(t))throw new Error("Unknown type: "+t);return u[t||"any"](e)})).join(" || ")||"true";if("true"!==A&&(w++,D("if (!(%s)) {",A),E("is the wrong type"),D("} else {")),v)if(!1===i.additionalItems)D("if (%s.length > %d) {",e,i.items.length),E("has additional items"),D("}");else if(i.additionalItems){var C=j();D("for (var %s = %d; %s < %s.length; %s++) {",C,i.items.length,C,e,C),O(e+"["+C+"]",i.additionalItems,a,l,c.concat("additionalItems")),D("}")}if(i.format&&y[i.format]){"string"!==h&&s[i.format]&&D("if (%s) {",u.string(e));var T=_("format");b[T]=y[i.format],"function"==typeof b[T]?D("if (!%s(%s)) {",T,e):D("if (!testLimitedRegex(%s, %s, %d)) {",T,e,void 0===i.maxLength?-1:i.maxLength),E("must be "+i.format+" format"),D("}"),"string"!==h&&s[i.format]&&D("}")}if(Array.isArray(i.required)){T=_("missing");D("var %s = 0",T);D("if ((%s)) {","object"!==h?u.object(e):"true"),i.required.map((function(t){var r=n(e,t);D("if (%s === undefined) {",r),E("is required",r),D("%s++",T),D("}")})),D("}"),m||(D("if (%s === 0) {",T),w++)}if(i.uniqueItems&&("array"!==h&&D("if (%s) {",u.array(e)),D("if (!(unique(%s, %d))) {",e,i.maxItems||-1),E("must be unique"),D("}"),"array"!==h&&D("}")),i.enum){var L=i.enum.some((function(e){return"object"==typeof e}))?function(t){return"JSON.stringify("+e+") !== JSON.stringify("+JSON.stringify(t)+")"}:function(t){return e+" !== "+JSON.stringify(t)};D("if (%s) {",i.enum.map(L).join(" && ")||"false"),E("must be an enum value"),D("}")}if(i.dependencies&&("object"!==h&&D("if (%s) {",u.object(e)),Object.keys(i.dependencies).forEach((function(t){var r=i.dependencies[t];"string"==typeof r&&(r=[r]);Array.isArray(r)&&(D("if (%s !== undefined && !(%s)) {",n(e,t),r.map((function(t){return n(e,t)+" !== undefined"})).join(" && ")||"true"),E("dependencies not set"),D("}")),"object"==typeof r&&(D("if (%s !== undefined) {",n(e,t)),O(e,r,a,l,c.concat(["dependencies",t])),D("}"))})),"object"!==h&&D("}")),i.additionalProperties||!1===i.additionalProperties){"object"!==h&&D("if (%s) {",u.object(e));C=j();var I=_("keys"),x=Object.keys(f||{}).map((function(e){return I+"["+C+"] !== "+JSON.stringify(e)})).concat(Object.keys(i.patternProperties||{}).map((function(e){return"!"+R(e)+".test("+I+"["+C+"])"}))).join(" && ")||"true";D("var %s = Object.keys(%s)",I,e)("for (var %s = 0; %s < %s.length; %s++) {",C,C,I,C)("if (%s) {",x),!1===i.additionalProperties?(l&&D("delete %s",e+"["+I+"["+C+"]]"),E("has additional properties",null,JSON.stringify(e+".")+" + "+I+"["+C+"]")):O(e+"["+I+"["+C+"]]",i.additionalProperties,a,l,c.concat(["additionalProperties"])),D("}")("}"),"object"!==h&&D("}")}if(i.$ref){var U=function(e,t,r){var n=function(e){return e&&e.id===r?e:"object"==typeof e&&e?Object.keys(e).reduce((function(t,r){return t||n(e[r])}),null):null},i=n(e);if(i)return i;r=(r=r.replace(/^#/,"")).replace(/\/$/,"");try{return o.get(e,decodeURI(r))}catch(e){var a,s=r.indexOf("#");if(0!==s)if(-1===s)a=t[r];else{a=t[r.slice(0,s)];var u=r.slice(s).replace(/^#/,"");try{return o.get(a,u)}catch(e){}}else a=t[r];return a||null}}(r,p&&p.schemas||{},i.$ref);if(U){var k=t[i.$ref];k||(t[i.$ref]=function(e){return k(e)},k=d(U,t,r,!1,p));T=_("ref");b[T]=k,D("if (!(%s(%s))) {",T,e),E("referenced schema does not match"),D("}")}}if(i.not){var M=_("prev");D("var %s = errors",M),O(e,i.not,!1,l,c.concat("not")),D("if (%s === errors) {",M),E("negative schema matches"),D("} else {")("errors = %s",M)("}")}if(i.items&&!v){"array"!==h&&D("if (%s) {",u.array(e));C=j();D("for (var %s = 0; %s < %s.length; %s++) {",C,C,e,C),O(e+"["+C+"]",i.items,a,l,c.concat("items")),D("}"),"array"!==h&&D("}")}if(i.patternProperties){"object"!==h&&D("if (%s) {",u.object(e));I=_("keys"),C=j();D("var %s = Object.keys(%s)",I,e)("for (var %s = 0; %s < %s.length; %s++) {",C,C,I,C),Object.keys(i.patternProperties).forEach((function(t){var r=R(t);D("if (%s.test(%s)) {",r,I+"["+C+"]"),O(e+"["+I+"["+C+"]]",i.patternProperties[t],a,l,c.concat(["patternProperties",t])),D("}")})),D("}"),"object"!==h&&D("}")}if(i.pattern){var q=R(i.pattern);"string"!==h&&D("if (%s) {",u.string(e)),D("if (!(testLimitedRegex(%s, %s, %d))) {",q,e,void 0===i.maxLength?-1:i.maxLength),E("pattern mismatch"),D("}"),"string"!==h&&D("}")}if(i.allOf&&i.allOf.forEach((function(t,r){O(e,t,a,l,c.concat(["allOf",r]))})),i.anyOf&&i.anyOf.length){M=_("prev");i.anyOf.forEach((function(t,r){0===r?D("var %s = errors",M):D("if (errors !== %s) {",M)("errors = %s",M),O(e,t,!1,!1,c)})),i.anyOf.forEach((function(e,t){t&&D("}")})),D("if (%s !== errors) {",M),E("no schemas match"),D("}")}if(i.oneOf&&i.oneOf.length){M=_("prev");var P=_("passes");D("var %s = errors",M)("var %s = 0",P),i.oneOf.forEach((function(t,r){O(e,t,!1,!1,c),D("if (%s === errors) {",M)("%s++",P)("} else {")("errors = %s",M)("}")})),D("if (%s !== 1) {",P),E("no (or more than one) schemas match"),D("}")}for(void 0!==i.multipleOf&&("number"!==h&&"integer"!==h&&D("if (%s) {",u.number(e)),D("if (!isMultipleOf(%s, %d)) {",e,i.multipleOf),E("has a remainder"),D("}"),"number"!==h&&"integer"!==h&&D("}")),void 0!==i.maxProperties&&("object"!==h&&D("if (%s) {",u.object(e)),D("if (Object.keys(%s).length > %d) {",e,i.maxProperties),E("has more properties than allowed"),D("}"),"object"!==h&&D("}")),void 0!==i.minProperties&&("object"!==h&&D("if (%s) {",u.object(e)),D("if (Object.keys(%s).length < %d) {",e,i.minProperties),E("has less properties than allowed"),D("}"),"object"!==h&&D("}")),void 0!==i.maxItems&&("array"!==h&&D("if (%s) {",u.array(e)),D("if (%s.length > %d) {",e,i.maxItems),E("has more items than allowed"),D("}"),"array"!==h&&D("}")),void 0!==i.minItems&&("array"!==h&&D("if (%s) {",u.array(e)),D("if (%s.length < %d) {",e,i.minItems),E("has less items than allowed"),D("}"),"array"!==h&&D("}")),void 0!==i.maxLength&&("string"!==h&&D("if (%s) {",u.string(e)),D("if (%s.length > %d) {",e,i.maxLength),E("has longer length than allowed"),D("}"),"string"!==h&&D("}")),void 0!==i.minLength&&("string"!==h&&D("if (%s) {",u.string(e)),D("if (%s.length < %d) {",e,i.minLength),E("has less length than allowed"),D("}"),"string"!==h&&D("}")),void 0!==i.minimum&&("number"!==h&&"integer"!==h&&D("if (%s) {",u.number(e)),D("if (%s %s %d) {",e,i.exclusiveMinimum?"<=":"<",i.minimum),E("is less than minimum"),D("}"),"number"!==h&&"integer"!==h&&D("}")),void 0!==i.maximum&&("number"!==h&&"integer"!==h&&D("if (%s) {",u.number(e)),D("if (%s %s %d) {",e,i.exclusiveMaximum?">=":">",i.maximum),E("is more than maximum"),D("}"),"number"!==h&&"integer"!==h&&D("}")),f&&Object.keys(f).forEach((function(t){Array.isArray(h)&&-1!==h.indexOf("null")&&D("if (%s !== null) {",e),O(n(e,t),f[t],a,l,c.concat(v?t:["properties",t])),Array.isArray(h)&&-1!==h.indexOf("null")&&D("}")}));w--;)D("}")},D=i("function validate(data) {")("if (data === undefined) data = null")("validate.errors = null")("var errors = 0");return O("data",e,h,p&&p.filter,[]),D("return errors === 0")("}"),(D=D.toFunction(b)).errors=null,Object.defineProperty&&Object.defineProperty(D,"error",{get:function(){return D.errors?D.errors.map((function(e){return e.field+" "+e.message})).join("\n"):""}}),D.toJSON=function(){return e},D};t.exports=function(e,t){return"string"==typeof e&&(e=JSON.parse(e)),d(e,{},e,!0,t)},t.exports.filter=function(e,r){var n=t.exports(e,a(r,{filter:!0}));return function(e){return n(e),e}}},{"./formats":52,"generate-function":37,"generate-object-property":38,jsonpointer:57,xtend:174}],54:[function(e,t,r){"use strict";t.exports=function(e){return/^[$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc][$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc0-9\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19b0-\u19c0\u19c8\u19c9\u19d0-\u19d9\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1dc0-\u1de6\u1dfc-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f1\ua900-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f]*$/.test(e)}},{}],55:[function(e,t,r){(function(r){(function(){"use strict";var n=e("for-each"),i=e("available-typed-arrays"),o=e("call-bind/callBound"),a=o("Object.prototype.toString"),s=e("has-tostringtag/shams")(),u=e("gopd"),l="undefined"==typeof globalThis?r:globalThis,c=i(),f=o("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r<e.length;r+=1)if(e[r]===t)return r;return-1},d=o("String.prototype.slice"),h={},p=Object.getPrototypeOf;s&&u&&p&&n(c,(function(e){var t=new l[e];if(Symbol.toStringTag in t){var r=p(t),n=u(r,Symbol.toStringTag);if(!n){var i=p(r);n=u(i,Symbol.toStringTag)}h[e]=n.get}}));t.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!s||!(Symbol.toStringTag in e)){var t=d(a(e),8,-1);return f(c,t)>-1}return!!u&&function(e){var t=!1;return n(h,(function(r,n){if(!t)try{t=r.call(e)===n}catch(e){}})),t}(e)}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"available-typed-arrays":18,"call-bind/callBound":24,"for-each":27,gopd:40,"has-tostringtag/shams":43}],56:[function(e,t,r){(function(e){(function(){var r={},n=r.LEFT_BRACE=1,i=r.RIGHT_BRACE=2,o=r.LEFT_BRACKET=3,a=r.RIGHT_BRACKET=4,s=r.COLON=5,u=r.COMMA=6,l=r.TRUE=7,c=r.FALSE=8,f=r.NULL=9,d=r.STRING=10,h=r.NUMBER=11,p=r.START=17,y=r.STOP=18,b=r.TRUE1=33,g=r.TRUE2=34,m=r.TRUE3=35,v=r.FALSE1=49,w=r.FALSE2=50,_=r.FALSE3=51,S=r.FALSE4=52,E=r.NULL1=65,R=r.NULL2=66,A=r.NULL3=67,j=r.NUMBER1=81,O=r.NUMBER3=83,D=r.STRING1=97,C=r.STRING2=98,T=r.STRING3=99,L=r.STRING4=100,I=r.STRING5=101,x=r.STRING6=102,U=r.VALUE=113,k=r.KEY=114,M=r.OBJECT=129,q=r.ARRAY=130,P="\\".charCodeAt(0),B="/".charCodeAt(0),N="\b".charCodeAt(0),F="\f".charCodeAt(0),Q="\n".charCodeAt(0),$="\r".charCodeAt(0),H="\t".charCodeAt(0),G=65536;function W(){this.tState=p,this.value=void 0,this.string=void 0,this.stringBuffer=e.alloc?e.alloc(G):new e(G),this.stringBufferOffset=0,this.unicode=void 0,this.highSurrogate=void 0,this.key=void 0,this.mode=void 0,this.stack=[],this.state=U,this.bytes_remaining=0,this.bytes_in_sequence=0,this.temp_buffs={2:new e(2),3:new e(3),4:new e(4)},this.offset=-1}W.toknam=function(e){for(var t=Object.keys(r),n=0,i=t.length;n<i;n++){var o=t[n];if(r[o]===e)return o}return e&&"0x"+e.toString(16)};var V=W.prototype;V.onError=function(e){throw e},V.charError=function(e,t){this.tState=y,this.onError(new Error("Unexpected "+JSON.stringify(String.fromCharCode(e[t]))+" at position "+t+" in state "+W.toknam(this.tState)))},V.appendStringChar=function(e){this.stringBufferOffset>=G&&(this.string+=this.stringBuffer.toString("utf8"),this.stringBufferOffset=0),this.stringBuffer[this.stringBufferOffset++]=e},V.appendStringBuf=function(e,t,r){var n=e.length;"number"==typeof t&&(n="number"==typeof r?r<0?e.length-t+r:r-t:e.length-t),n<0&&(n=0),this.stringBufferOffset+n>G&&(this.string+=this.stringBuffer.toString("utf8",0,this.stringBufferOffset),this.stringBufferOffset=0),e.copy(this.stringBuffer,this.stringBufferOffset,t,r),this.stringBufferOffset+=n},V.write=function(t){var r;"string"==typeof t&&(t=new e(t));for(var y=0,U=t.length;y<U;y++)if(this.tState===p){if(r=t[y],this.offset++,123===r)this.onToken(n,"{");else if(125===r)this.onToken(i,"}");else if(91===r)this.onToken(o,"[");else if(93===r)this.onToken(a,"]");else if(58===r)this.onToken(s,":");else if(44===r)this.onToken(u,",");else if(116===r)this.tState=b;else if(102===r)this.tState=v;else if(110===r)this.tState=E;else if(34===r)this.string="",this.stringBufferOffset=0,this.tState=D;else if(45===r)this.string="-",this.tState=j;else if(r>=48&&r<64)this.string=String.fromCharCode(r),this.tState=O;else if(32!==r&&9!==r&&10!==r&&13!==r)return this.charError(t,y)}else if(this.tState===D)if(r=t[y],this.bytes_remaining>0){for(var k=0;k<this.bytes_remaining;k++)this.temp_buffs[this.bytes_in_sequence][this.bytes_in_sequence-this.bytes_remaining+k]=t[k];this.appendStringBuf(this.temp_buffs[this.bytes_in_sequence]),this.bytes_in_sequence=this.bytes_remaining=0,y=y+k-1}else if(0===this.bytes_remaining&&r>=128){if(r<=193||r>244)return this.onError(new Error("Invalid UTF-8 character at position "+y+" in state "+W.toknam(this.tState)));if(r>=194&&r<=223&&(this.bytes_in_sequence=2),r>=224&&r<=239&&(this.bytes_in_sequence=3),r>=240&&r<=244&&(this.bytes_in_sequence=4),this.bytes_in_sequence+y>t.length){for(var M=0;M<=t.length-1-y;M++)this.temp_buffs[this.bytes_in_sequence][M]=t[y+M];this.bytes_remaining=y+this.bytes_in_sequence-t.length,y=t.length-1}else this.appendStringBuf(t,y,y+this.bytes_in_sequence),y=y+this.bytes_in_sequence-1}else if(34===r)this.tState=p,this.string+=this.stringBuffer.toString("utf8",0,this.stringBufferOffset),this.stringBufferOffset=0,this.onToken(d,this.string),this.offset+=e.byteLength(this.string,"utf8")+1,this.string=void 0;else if(92===r)this.tState=C;else{if(!(r>=32))return this.charError(t,y);this.appendStringChar(r)}else if(this.tState===C)if(34===(r=t[y]))this.appendStringChar(r),this.tState=D;else if(92===r)this.appendStringChar(P),this.tState=D;else if(47===r)this.appendStringChar(B),this.tState=D;else if(98===r)this.appendStringChar(N),this.tState=D;else if(102===r)this.appendStringChar(F),this.tState=D;else if(110===r)this.appendStringChar(Q),this.tState=D;else if(114===r)this.appendStringChar($),this.tState=D;else if(116===r)this.appendStringChar(H),this.tState=D;else{if(117!==r)return this.charError(t,y);this.unicode="",this.tState=T}else if(this.tState===T||this.tState===L||this.tState===I||this.tState===x){if(!((r=t[y])>=48&&r<64||r>64&&r<=70||r>96&&r<=102))return this.charError(t,y);if(this.unicode+=String.fromCharCode(r),this.tState++===x){var q=parseInt(this.unicode,16);this.unicode=void 0,void 0!==this.highSurrogate&&q>=56320&&q<57344?(this.appendStringBuf(new e(String.fromCharCode(this.highSurrogate,q))),this.highSurrogate=void 0):void 0===this.highSurrogate&&q>=55296&&q<56320?this.highSurrogate=q:(void 0!==this.highSurrogate&&(this.appendStringBuf(new e(String.fromCharCode(this.highSurrogate))),this.highSurrogate=void 0),this.appendStringBuf(new e(String.fromCharCode(q)))),this.tState=D}}else if(this.tState===j||this.tState===O)switch(r=t[y]){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 46:case 101:case 69:case 43:case 45:this.string+=String.fromCharCode(r),this.tState=O;break;default:this.tState=p;var G=Number(this.string);if(isNaN(G))return this.charError(t,y);this.string.match(/[0-9]+/)==this.string&&G.toString()!=this.string?this.onToken(d,this.string):this.onToken(h,G),this.offset+=this.string.length-1,this.string=void 0,y--}else if(this.tState===b){if(114!==t[y])return this.charError(t,y);this.tState=g}else if(this.tState===g){if(117!==t[y])return this.charError(t,y);this.tState=m}else if(this.tState===m){if(101!==t[y])return this.charError(t,y);this.tState=p,this.onToken(l,!0),this.offset+=3}else if(this.tState===v){if(97!==t[y])return this.charError(t,y);this.tState=w}else if(this.tState===w){if(108!==t[y])return this.charError(t,y);this.tState=_}else if(this.tState===_){if(115!==t[y])return this.charError(t,y);this.tState=S}else if(this.tState===S){if(101!==t[y])return this.charError(t,y);this.tState=p,this.onToken(c,!1),this.offset+=4}else if(this.tState===E){if(117!==t[y])return this.charError(t,y);this.tState=R}else if(this.tState===R){if(108!==t[y])return this.charError(t,y);this.tState=A}else if(this.tState===A){if(108!==t[y])return this.charError(t,y);this.tState=p,this.onToken(f,null),this.offset+=3}},V.onToken=function(e,t){},V.parseError=function(e,t){this.tState=y,this.onError(new Error("Unexpected "+W.toknam(e)+(t?"("+JSON.stringify(t)+")":"")+" in state "+W.toknam(this.state)))},V.push=function(){this.stack.push({value:this.value,key:this.key,mode:this.mode})},V.pop=function(){var e=this.value,t=this.stack.pop();this.value=t.value,this.key=t.key,this.mode=t.mode,this.emit(e),this.mode||(this.state=U)},V.emit=function(e){this.mode&&(this.state=u),this.onValue(e)},V.onValue=function(e){},V.onToken=function(e,t){if(this.state===U)if(e===d||e===h||e===l||e===c||e===f)this.value&&(this.value[this.key]=t),this.emit(t);else if(e===n)this.push(),this.value?this.value=this.value[this.key]={}:this.value={},this.key=void 0,this.state=k,this.mode=M;else if(e===o)this.push(),this.value?this.value=this.value[this.key]=[]:this.value=[],this.key=0,this.mode=q,this.state=U;else if(e===i){if(this.mode!==M)return this.parseError(e,t);this.pop()}else{if(e!==a)return this.parseError(e,t);if(this.mode!==q)return this.parseError(e,t);this.pop()}else if(this.state===k)if(e===d)this.key=t,this.state=s;else{if(e!==i)return this.parseError(e,t);this.pop()}else if(this.state===s){if(e!==s)return this.parseError(e,t);this.state=U}else{if(this.state!==u)return this.parseError(e,t);if(e===u)this.mode===q?(this.key++,this.state=U):this.mode===M&&(this.state=k);else{if(!(e===a&&this.mode===q||e===i&&this.mode===M))return this.parseError(e,t);this.pop()}}},W.C=r,t.exports=W}).call(this)}).call(this,e("buffer").Buffer)},{buffer:22}],57:[function(e,t,r){var n=/~/,i=/~[01]/g;function o(e){switch(e){case"~1":return"/";case"~0":return"~"}throw new Error("Invalid tilde escape: "+e)}function a(e){return n.test(e)?e.replace(i,o):e}function s(e){if("string"==typeof e){if(""===(e=e.split("/"))[0])return e;throw new Error("Invalid JSON pointer.")}if(Array.isArray(e)){for(const t of e)if("string"!=typeof t&&"number"!=typeof t)throw new Error("Invalid JSON pointer. Must be of type string or number.");return e}throw new Error("Invalid JSON pointer.")}function u(e,t){if("object"!=typeof e)throw new Error("Invalid input object.");var r=(t=s(t)).length;if(1===r)return e;for(var n=1;n<r;){if(e=e[a(t[n++])],r===n)return e;if("object"!=typeof e||null===e)return}}function l(e,t,r){if("object"!=typeof e)throw new Error("Invalid input object.");if(0===(t=s(t)).length)throw new Error("Invalid JSON pointer for set.");return function(e,t,r){for(var n,i,o=1,s=t.length;o<s;){if("constructor"===t[o]||"prototype"===t[o]||"__proto__"===t[o])return e;if(n=a(t[o++]),i=s>o,void 0===e[n]&&(Array.isArray(e)&&"-"===n&&(n=e.length),i&&(""!==t[o]&&t[o]<1/0||"-"===t[o]?e[n]=[]:e[n]={})),!i)break;e=e[n]}var u=e[n];return void 0===r?delete e[n]:e[n]=r,u}(e,t,r)}r.get=u,r.set=l,r.compile=function(e){var t=s(e);return{get:function(e){return u(e,t)},set:function(e,r){return l(e,t,r)}}}},{}],58:[function(e,t,r){var n=e("./_root").Symbol;t.exports=n},{"./_root":74}],59:[function(e,t,r){var n=e("./_baseTimes"),i=e("./isArguments"),o=e("./isArray"),a=e("./isBuffer"),s=e("./_isIndex"),u=e("./isTypedArray"),l=Object.prototype.hasOwnProperty;t.exports=function(e,t){var r=o(e),c=!r&&i(e),f=!r&&!c&&a(e),d=!r&&!c&&!f&&u(e),h=r||c||f||d,p=h?n(e.length,String):[],y=p.length;for(var b in e)!t&&!l.call(e,b)||h&&("length"==b||f&&("offset"==b||"parent"==b)||d&&("buffer"==b||"byteLength"==b||"byteOffset"==b)||s(b,y))||p.push(b);return p}},{"./_baseTimes":64,"./_isIndex":68,"./isArguments":75,"./isArray":76,"./isBuffer":78,"./isTypedArray":83}],60:[function(e,t,r){var n=e("./_Symbol"),i=e("./_getRawTag"),o=e("./_objectToString"),a="[object Null]",s="[object Undefined]",u=n?n.toStringTag:void 0;t.exports=function(e){return null==e?void 0===e?s:a:u&&u in Object(e)?i(e):o(e)}},{"./_Symbol":58,"./_getRawTag":67,"./_objectToString":72}],61:[function(e,t,r){var n=e("./_baseGetTag"),i=e("./isObjectLike"),o="[object Arguments]";t.exports=function(e){return i(e)&&n(e)==o}},{"./_baseGetTag":60,"./isObjectLike":82}],62:[function(e,t,r){var n=e("./_baseGetTag"),i=e("./isLength"),o=e("./isObjectLike"),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,t.exports=function(e){return o(e)&&i(e.length)&&!!a[n(e)]}},{"./_baseGetTag":60,"./isLength":80,"./isObjectLike":82}],63:[function(e,t,r){var n=e("./_isPrototype"),i=e("./_nativeKeys"),o=Object.prototype.hasOwnProperty;t.exports=function(e){if(!n(e))return i(e);var t=[];for(var r in Object(e))o.call(e,r)&&"constructor"!=r&&t.push(r);return t}},{"./_isPrototype":69,"./_nativeKeys":70}],64:[function(e,t,r){t.exports=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}},{}],65:[function(e,t,r){t.exports=function(e){return function(t){return e(t)}}},{}],66:[function(e,t,r){(function(e){(function(){var r="object"==typeof e&&e&&e.Object===Object&&e;t.exports=r}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],67:[function(e,t,r){var n=e("./_Symbol"),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=n?n.toStringTag:void 0;t.exports=function(e){var t=o.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var i=a.call(e);return n&&(t?e[s]=r:delete e[s]),i}},{"./_Symbol":58}],68:[function(e,t,r){var n=9007199254740991,i=/^(?:0|[1-9]\d*)$/;t.exports=function(e,t){var r=typeof e;return!!(t=null==t?n:t)&&("number"==r||"symbol"!=r&&i.test(e))&&e>-1&&e%1==0&&e<t}},{}],69:[function(e,t,r){var n=Object.prototype;t.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}},{}],70:[function(e,t,r){var n=e("./_overArg")(Object.keys,Object);t.exports=n},{"./_overArg":73}],71:[function(e,t,r){var n=e("./_freeGlobal"),i="object"==typeof r&&r&&!r.nodeType&&r,o=i&&"object"==typeof t&&t&&!t.nodeType&&t,a=o&&o.exports===i&&n.process,s=function(){try{var e=o&&o.require&&o.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(e){}}();t.exports=s},{"./_freeGlobal":66}],72:[function(e,t,r){var n=Object.prototype.toString;t.exports=function(e){return n.call(e)}},{}],73:[function(e,t,r){t.exports=function(e,t){return function(r){return e(t(r))}}},{}],74:[function(e,t,r){var n=e("./_freeGlobal"),i="object"==typeof self&&self&&self.Object===Object&&self,o=n||i||Function("return this")();t.exports=o},{"./_freeGlobal":66}],75:[function(e,t,r){var n=e("./_baseIsArguments"),i=e("./isObjectLike"),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,u=n(function(){return arguments}())?n:function(e){return i(e)&&a.call(e,"callee")&&!s.call(e,"callee")};t.exports=u},{"./_baseIsArguments":61,"./isObjectLike":82}],76:[function(e,t,r){var n=Array.isArray;t.exports=n},{}],77:[function(e,t,r){var n=e("./isFunction"),i=e("./isLength");t.exports=function(e){return null!=e&&i(e.length)&&!n(e)}},{"./isFunction":79,"./isLength":80}],78:[function(e,t,r){var n=e("./_root"),i=e("./stubFalse"),o="object"==typeof r&&r&&!r.nodeType&&r,a=o&&"object"==typeof t&&t&&!t.nodeType&&t,s=a&&a.exports===o?n.Buffer:void 0,u=(s?s.isBuffer:void 0)||i;t.exports=u},{"./_root":74,"./stubFalse":86}],79:[function(e,t,r){var n=e("./_baseGetTag"),i=e("./isObject"),o="[object AsyncFunction]",a="[object Function]",s="[object GeneratorFunction]",u="[object Proxy]";t.exports=function(e){if(!i(e))return!1;var t=n(e);return t==a||t==s||t==o||t==u}},{"./_baseGetTag":60,"./isObject":81}],80:[function(e,t,r){var n=9007199254740991;t.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}},{}],81:[function(e,t,r){t.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},{}],82:[function(e,t,r){t.exports=function(e){return null!=e&&"object"==typeof e}},{}],83:[function(e,t,r){var n=e("./_baseIsTypedArray"),i=e("./_baseUnary"),o=e("./_nodeUtil"),a=o&&o.isTypedArray,s=a?i(a):n;t.exports=s},{"./_baseIsTypedArray":62,"./_baseUnary":65,"./_nodeUtil":71}],84:[function(e,t,r){var n=e("./_arrayLikeKeys"),i=e("./_baseKeys"),o=e("./isArrayLike");t.exports=function(e){return o(e)?n(e):i(e)}},{"./_arrayLikeKeys":59,"./_baseKeys":63,"./isArrayLike":77}],85:[function(e,t,r){t.exports=function(){}},{}],86:[function(e,t,r){t.exports=function(){return!1}},{}],87:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){if((0,o.isAsync)(e))return function(...t){const r=t.pop();return s(e.apply(this,t),r)};return(0,n.default)((function(t,r){var n;try{n=e.apply(this,t)}catch(e){return r(e)}if(n&&"function"==typeof n.then)return s(n,r);r(null,n)}))};var n=a(e("./internal/initialParams.js")),i=a(e("./internal/setImmediate.js")),o=e("./internal/wrapAsync.js");function a(e){return e&&e.__esModule?e:{default:e}}function s(e,t){return e.then((e=>{u(t,null,e)}),(e=>{u(t,e&&e.message?e:new Error(e))}))}function u(e,t,r){try{e(t,r)}catch(e){(0,i.default)((e=>{throw e}),e)}}t.exports=r.default},{"./internal/initialParams.js":95,"./internal/setImmediate.js":100,"./internal/wrapAsync.js":102}],88:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=s(e("./internal/eachOfLimit.js")),i=s(e("./internal/withoutIndex.js")),o=s(e("./internal/wrapAsync.js")),a=s(e("./internal/awaitify.js"));function s(e){return e&&e.__esModule?e:{default:e}}r.default=(0,a.default)((function(e,t,r,a){return(0,n.default)(t)(e,(0,i.default)((0,o.default)(r)),a)}),4),t.exports=r.default},{"./internal/awaitify.js":91,"./internal/eachOfLimit.js":93,"./internal/withoutIndex.js":101,"./internal/wrapAsync.js":102}],89:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=o(e("./eachLimit.js")),i=o(e("./internal/awaitify.js"));function o(e){return e&&e.__esModule?e:{default:e}}r.default=(0,i.default)((function(e,t,r){return(0,n.default)(e,1,t,r)}),3),t.exports=r.default},{"./eachLimit.js":88,"./internal/awaitify.js":91}],90:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t,r,n){let i=!1,a=!1,s=!1,u=0,l=0;function c(){u>=t||s||i||(s=!0,e.next().then((({value:e,done:t})=>{if(!a&&!i){if(s=!1,t)return i=!0,void(u<=0&&n(null));u++,r(e,l,f),l++,c()}})).catch(d))}function f(e,t){if(u-=1,!a)return e?d(e):!1===e?(i=!0,void(a=!0)):t===o.default||i&&u<=0?(i=!0,n(null)):void c()}function d(e){a||(s=!1,i=!0,n(e))}c()};var n,i=e("./breakLoop.js"),o=(n=i)&&n.__esModule?n:{default:n};t.exports=r.default},{"./breakLoop.js":92}],91:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t=e.length){if(!t)throw new Error("arity is undefined");return function(...r){return"function"==typeof r[t-1]?e.apply(this,r):new Promise(((n,i)=>{r[t-1]=(e,...t)=>{if(e)return i(e);n(t.length>1?t:t[0])},e.apply(this,r)}))}},t.exports=r.default},{}],92:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.default={},t.exports=r.default},{}],93:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=l(e("./once.js")),i=l(e("./iterator.js")),o=l(e("./onlyOnce.js")),a=e("./wrapAsync.js"),s=l(e("./asyncEachOfLimit.js")),u=l(e("./breakLoop.js"));function l(e){return e&&e.__esModule?e:{default:e}}r.default=e=>(t,r,l)=>{if(l=(0,n.default)(l),e<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!t)return l(null);if((0,a.isAsyncGenerator)(t))return(0,s.default)(t,e,r,l);if((0,a.isAsyncIterable)(t))return(0,s.default)(t[Symbol.asyncIterator](),e,r,l);var c=(0,i.default)(t),f=!1,d=!1,h=0,p=!1;function y(e,t){if(!d)if(h-=1,e)f=!0,l(e);else if(!1===e)f=!0,d=!0;else{if(t===u.default||f&&h<=0)return f=!0,l(null);p||b()}}function b(){for(p=!0;h<e&&!f;){var t=c();if(null===t)return f=!0,void(h<=0&&l(null));h+=1,r(t.value,t.key,(0,o.default)(y))}p=!1}b()},t.exports=r.default},{"./asyncEachOfLimit.js":90,"./breakLoop.js":92,"./iterator.js":97,"./once.js":98,"./onlyOnce.js":99,"./wrapAsync.js":102}],94:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return e[Symbol.iterator]&&e[Symbol.iterator]()},t.exports=r.default},{}],95:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return function(...t){var r=t.pop();return e.call(this,t,r)}},t.exports=r.default},{}],96:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return e&&"number"==typeof e.length&&e.length>=0&&e.length%1==0},t.exports=r.default},{}],97:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){if((0,n.default)(e))return function(e){var t=-1,r=e.length;return function(){return++t<r?{value:e[t],key:t}:null}}(e);var t=(0,i.default)(e);return t?function(e){var t=-1;return function(){var r=e.next();return r.done?null:(t++,{value:r.value,key:t})}}(t):(r=e,o=r?Object.keys(r):[],a=-1,s=o.length,function e(){var t=o[++a];return"__proto__"===t?e():a<s?{value:r[t],key:t}:null});var r,o,a,s};var n=o(e("./isArrayLike.js")),i=o(e("./getIterator.js"));function o(e){return e&&e.__esModule?e:{default:e}}t.exports=r.default},{"./getIterator.js":94,"./isArrayLike.js":96}],98:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){function t(...t){if(null!==e){var r=e;e=null,r.apply(this,t)}}return Object.assign(t,e),t},t.exports=r.default},{}],99:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return function(...t){if(null===e)throw new Error("Callback was already called.");var r=e;e=null,r.apply(this,t)}},t.exports=r.default},{}],100:[function(e,t,r){(function(e,t){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.fallback=s,r.wrap=u;var n,i=r.hasQueueMicrotask="function"==typeof queueMicrotask&&queueMicrotask,o=r.hasSetImmediate="function"==typeof t&&t,a=r.hasNextTick="object"==typeof e&&"function"==typeof e.nextTick;function s(e){setTimeout(e,0)}function u(e){return(t,...r)=>e((()=>t(...r)))}n=i?queueMicrotask:o?t:a?e.nextTick:s,r.default=u(n)}).call(this)}).call(this,e("_process"),e("timers").setImmediate)},{_process:121,timers:165}],101:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return(t,r,n)=>e(t,n)},t.exports=r.default},{}],102:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.isAsyncIterable=r.isAsyncGenerator=r.isAsync=void 0;var n,i=e("../asyncify.js"),o=(n=i)&&n.__esModule?n:{default:n};function a(e){return"AsyncFunction"===e[Symbol.toStringTag]}r.default=function(e){if("function"!=typeof e)throw new Error("expected a function");return a(e)?(0,o.default)(e):e},r.isAsync=a,r.isAsyncGenerator=function(e){return"AsyncGenerator"===e[Symbol.toStringTag]},r.isAsyncIterable=function(e){return"function"==typeof e[Symbol.asyncIterator]}},{"../asyncify.js":87}],103:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=s(e("./internal/once.js")),i=s(e("./internal/onlyOnce.js")),o=s(e("./internal/wrapAsync.js")),a=s(e("./internal/awaitify.js"));function s(e){return e&&e.__esModule?e:{default:e}}r.default=(0,a.default)((function(e,t){if(t=(0,n.default)(t),!Array.isArray(e))return t(new Error("First argument to waterfall must be an array of functions"));if(!e.length)return t();var r=0;function a(t){(0,o.default)(e[r++])(...t,(0,i.default)(s))}function s(n,...i){if(!1!==n)return n||r===e.length?t(n,...i):void a(i)}a([])})),t.exports=r.default},{"./internal/awaitify.js":91,"./internal/once.js":98,"./internal/onlyOnce.js":99,"./internal/wrapAsync.js":102}],104:[function(e,t,r){t.exports=function(t,r){var n=!1;try{n=e(r)}catch(e){return t.fable.log.error("Error loading Fable package",{Package:r}),!1}var i=t.new(t.fable);return"string"==typeof n.Scope&&i.setScope(n.Scope),"string"==typeof n.Domain&&i.setDomain(n.Domain),"string"==typeof n.DefaultIdentifier&&i.setDefaultIdentifier(n.DefaultIdentifier),Array.isArray(n.Schema)&&i.setSchema(n.Schema),"object"==typeof n.JsonSchema&&i.setJsonSchema(n.JsonSchema),"object"==typeof n.DefaultObject&&i.setDefault(n.DefaultObject),"object"==typeof n.Authorization&&i.setAuthorizer(n.Authorization),i}},{}],105:[function(e,t,r){t.exports=function(e,t){var r="object"==typeof t?t:{};t.hasOwnProperty("Scope")||e.fable.log.error("Error loading Fable package -- scope not defined.",{Package:t});var n=e.new(e.fable);return"string"==typeof r.Scope&&n.setScope(r.Scope),"string"==typeof r.Domain&&n.setDomain(r.Domain),"string"==typeof r.DefaultIdentifier&&n.setDefaultIdentifier(r.DefaultIdentifier),Array.isArray(r.Schema)&&n.setSchema(r.Schema),"object"==typeof r.JsonSchema&&n.setJsonSchema(r.JsonSchema),"object"==typeof r.DefaultObject&&n.setDefault(r.DefaultObject),"object"==typeof r.Authorization&&n.setAuthorizer(r.Authorization),n}},{}],106:[function(e,t,r){
|
|
14
|
+
/**
|
|
15
|
+
* @license MIT
|
|
16
|
+
* @author <steven@velozo.com>
|
|
17
|
+
*/
|
|
18
|
+
var n=e("fs");t.exports=new function(){return function e(t){if("object"!=typeof t||!("fable"in t))return{new:e};var r=t,i={};function o(e,t){return i[e]=t,r}return{loadQuery:function(e,t,i){var a="function"==typeof i?i:function(){};return n.readFile(t,"utf8",(function(n,i){n?(r.fable.log.error("Problem loading custom query file.",{QueryTag:e,FileName:t,Error:n}),o(e,""),a(!1)):(r.fable.log.trace("Loaded custom query file.",{QueryTag:e,FileName:t}),o(e,i),a(!0))})),r},setQuery:o,checkQuery:function(e){return i.hasOwnProperty(e)},getQuery:function(e){return!!i.hasOwnProperty(e)&&i[e]},new:e}}()}},{fs:21}],107:[function(e,t,r){
|
|
19
|
+
/**
|
|
20
|
+
* @license MIT
|
|
21
|
+
* @author <steven@velozo.com>
|
|
22
|
+
*/
|
|
23
|
+
var n=e("is-my-json-valid");t.exports=new function(){return function e(t,r){var i=!1,o=!1,a=!1,s=!1,u={},l=function(e){i="object"==typeof e?e:{title:"Unknown",type:"object",required:[]}};l(r);var c=function(e){s=n(o="object"==typeof e?e:{title:"Unknown",type:"object",required:[]},{greedy:!0,verbose:!0})};c(t);var f=function(e){a="object"==typeof e?e:{}};f();var d={setSchema:l,setJsonSchema:c,setDefault:f,setAuthorizer:function(e){u="object"==typeof e?e:{}},validateObject:function(e){var t={Valid:s(e)};return t.Valid||(t.Errors=s.errors),t},new:e};return Object.defineProperty(d,"schema",{get:function(){return i},enumerable:!0}),Object.defineProperty(d,"jsonSchema",{get:function(){return o},enumerable:!0}),Object.defineProperty(d,"defaultObject",{get:function(){return a},enumerable:!0}),Object.defineProperty(d,"authorizer",{get:function(){return u},enumerable:!0}),d}()}},{"is-my-json-valid":53}],108:[function(e,t,r){
|
|
24
|
+
/**
|
|
25
|
+
* @license MIT
|
|
26
|
+
* @author <steven@velozo.com>
|
|
27
|
+
*/
|
|
28
|
+
var n=e("foxhound");t.exports=new function(){return function t(r,i,o,a){if("object"!=typeof r||!("fable"in r))return{new:t};var s=r;s.settingsManager.fill({MeadowProvider:"None"});var u=0,l="string"==typeof i?i:"Unknown",c=e("./Meadow-Schema.js").new(o,a),f=n.new(s).setScope(l),d=e("./Meadow-RawQuery.js").new(s),h=e("./behaviors/Meadow-Create.js"),p=e("./behaviors/Meadow-Read.js"),y=e("./behaviors/Meadow-Reads.js"),b=e("./behaviors/Meadow-Update.js"),g=e("./behaviors/Meadow-Delete.js"),m=e("./behaviors/Meadow-Undelete.js"),v=e("./behaviors/Meadow-Count.js"),w=!1,_=!1,S="ID"+l,E="GUID"+l,R=e("./Meadow-PackageFileLoader.js"),A=e("./Meadow-PackageObjectLoader.js"),j=()=>("function"==typeof w.setSchema&&w.setSchema(l,c.schema,S,E),this),O={ALASQL:e("./providers/Meadow-Provider-ALASQL.js"),MeadowEndpoints:e("./providers/Meadow-Provider-MeadowEndpoints.js"),MySQL:e("./providers/Meadow-Provider-MySQL.js"),None:e("./providers/Meadow-Provider-None.js")},D=function(e){"string"!=typeof e&&(e="None");try{w=O[e].new(s),j(),_=e}catch(t){s.log.error("Provider not set - require load problem",{InvalidProvider:e,error:t}),D("None")}return this};let C;D(s.settings.MeadowProvider),C=Array.isArray(s.settings.MeadowRoleNames)?s.settings.MeadowRoleNames:["Unauthenticated","User","Manager","Director","Executive","Administrator"];var T={doCreate:function(e,t){return h(this,e,t)},doRead:function(e,t){return p(this,e,t)},doReads:function(e,t){return y(this,e,t)},doUpdate:function(e,t){return b(this,e,t)},doDelete:function(e,t){return g(this,e,t)},doUndelete:function(e,t){return m(this,e,t)},doCount:function(e,t){return v(this,e,t)},validateObject:c.validateObject,marshalRecordFromSourceToObject:function(e){var t=s.Utility.extend({},c.defaultObject);return w.marshalRecordFromSourceToObject(t,e,c.schema),t},setProvider:D,setIDUser:function(e){return u=e,this},loadFromPackage:function(e){return R(this,e)},loadFromPackageObject:function(e){return A(this,e)},setScope:function(e){return l=e,f.setScope(e),j(),this},setDomain:function(e){return e,this},setSchema:function(e){return c.setSchema(e),j(),this},setJsonSchema:function(e){return c.setJsonSchema(e),this},setDefault:function(e){return c.setDefault(e),this},setDefaultIdentifier:function(e){return S=e,E="GU"+e,j(),this},setAuthorizer:function(e){return c.setAuthorizer(e),this},getRoleName:function(e){return e<0||e>=C.length?"Unauthenticated":C[e]},logSlowQuery:function(e,t){var r=t.query||{body:"",parameters:{}},n=r.body;if(r.parameters.length)for(var i in r.parameters)n=n.replace(":"+i,r.parameters[i]);s.log.warn("Slow Read query took "+e+"ms",{Provider:_,Query:{Body:r.body,Parameters:r.parameters,FullQuery:n}})},new:t};return Object.defineProperty(T,"scope",{get:function(){return l},enumerable:!0}),Object.defineProperty(T,"schema",{get:function(){return c.schema},enumerable:!0}),Object.defineProperty(T,"schemaFull",{get:function(){return c},enumerable:!0}),Object.defineProperty(T,"defaultIdentifier",{get:function(){return S},enumerable:!0}),Object.defineProperty(T,"defaultGUIdentifier",{get:function(){return E},enumerable:!0}),Object.defineProperty(T,"jsonSchema",{get:function(){return c.jsonSchema},enumerable:!0}),Object.defineProperty(T,"userIdentifier",{get:function(){return u},enumerable:!0}),Object.defineProperty(T,"query",{get:function(){var e=f.clone();return e.query.schema=c.schema,e},enumerable:!0}),Object.defineProperty(T,"rawQueries",{get:function(){return d},enumerable:!0}),Object.defineProperty(T,"provider",{get:function(){return w},enumerable:!0}),Object.defineProperty(T,"providerName",{get:function(){return _},enumerable:!0}),"function"==typeof s.addServices?s.addServices(T):(Object.defineProperty(T,"fable",{get:function(){return s},enumerable:!1}),Object.defineProperty(T,"settings",{get:function(){return s.settings},enumerable:!1}),Object.defineProperty(T,"log",{get:function(){return s.log},enumerable:!1})),T}()}},{"./Meadow-PackageFileLoader.js":104,"./Meadow-PackageObjectLoader.js":105,"./Meadow-RawQuery.js":106,"./Meadow-Schema.js":107,"./behaviors/Meadow-Count.js":109,"./behaviors/Meadow-Create.js":110,"./behaviors/Meadow-Delete.js":111,"./behaviors/Meadow-Read.js":112,"./behaviors/Meadow-Reads.js":113,"./behaviors/Meadow-Undelete.js":114,"./behaviors/Meadow-Update.js":115,"./providers/Meadow-Provider-ALASQL.js":116,"./providers/Meadow-Provider-MeadowEndpoints.js":117,"./providers/Meadow-Provider-MySQL.js":118,"./providers/Meadow-Provider-None.js":119,foxhound:28}],109:[function(e,t,r){
|
|
29
|
+
/**
|
|
30
|
+
* @license MIT
|
|
31
|
+
* @author <steven@velozo.com>
|
|
32
|
+
*/
|
|
33
|
+
var n=e("async/waterfall");t.exports=function(e,t,r){var i=new Date;return n([function(r){e.rawQueries.checkQuery("Count")&&(t.parameters.queryOverride=e.rawQueries.getQuery("Count")),e.provider.Count(t,(function(){r(t.result.error,t)}))},function(t,r){var n=(new Date).getTime()-i.getTime();if(n>(e.fable.settings.QueryThresholdWarnTime||200)&&e.logSlowQuery(n,t),"number"!=typeof t.parameters.result.value)return r("Count did not return valid results.",t,!1);r(t.result.error,t,t.result.value)}],(function(t,n,i){t&&e.fable.log.warn("Error during the count waterfall",{Error:t,Message:t.message,Query:n.query}),r(t,n,i)})),e}},{"async/waterfall":103}],110:[function(e,t,r){
|
|
34
|
+
/**
|
|
35
|
+
* @license MIT
|
|
36
|
+
* @author <steven@velozo.com>
|
|
37
|
+
*/
|
|
38
|
+
var n=e("async/waterfall");t.exports=function(e,t,r){return n([function(r){if(!t.query.records)return r("No record submitted",t,!1);if(!(t.query.records[0][e.defaultGUIdentifier]&&t.query.records[0][e.defaultGUIdentifier].length>=5))return r();var n=t.query.records[0][e.defaultGUIdentifier],i=t.clone().addFilter(e.defaultGUIdentifier,n).setDisableDeleteTracking(!0);e.rawQueries.checkQuery("Read")&&(i.parameters.queryOverride=e.rawQueries.getQuery("Read")),e.provider.Read(i,(function(){var e=i.error;return!e&&i.result.value.length>0&&(e="Record with GUID "+n+" already exists!"),e?r(e,i,i,null):r()}))},function(r){t.query.IDUser||("number"==typeof t.userID&&t.userID%1==0&&t.userID>=0?t.query.IDUser=t.userID:t.query.IDUser=e.userIdentifier),t.query.records[0]=e.fable.Utility.extend({},e.schemaFull.defaultObject,t.query.records[0]),e.provider.Create(t,(function(){r(t.result.error,t)}))},function(e,t){if(!1===e.parameters.result.value)return t("Creation failed",e,!1);var r=e.result.value;t(e.result.error,e,r)},function(t,r,n){var i=t.clone().addFilter(e.defaultIdentifier,r).setDisableDeleteTracking(t.parameters.query.disableDeleteTracking);e.rawQueries.checkQuery("Read")&&(i.parameters.queryOverride=e.rawQueries.getQuery("Read")),e.provider.Read(i,(function(){n(i.result.error,t,i)}))},function(t,r,n){if(r.parameters.result.value.length<1)return n("No record found after create.",t,r,!1);var i=e.marshalRecordFromSourceToObject(r.result.value[0]);n(t.result.error,t,r,i)}],(function(t,n,i,o){t&&e.fable.log.warn("Error during the create waterfall",{Error:t,Message:t.message,Query:n.query,Stack:t.stack}),r(t,n,i,o)})),e}},{"async/waterfall":103}],111:[function(e,t,r){
|
|
39
|
+
/**
|
|
40
|
+
* @license MIT
|
|
41
|
+
* @author <steven@velozo.com>
|
|
42
|
+
*/
|
|
43
|
+
var n=e("async/waterfall");t.exports=function(e,t,r){return n([function(r){e.rawQueries.checkQuery("Delete")&&(t.parameters.queryOverride=e.rawQueries.getQuery("Delete")),e.provider.Delete(t,(function(){r(t.result.error,t,t.result.value)}))}],(function(t,n,i){t&&e.fable.log.warn("Error during the delete waterfall",{Error:t,Message:t.message,Query:n.query}),r(t,n,i)})),e}},{"async/waterfall":103}],112:[function(e,t,r){
|
|
44
|
+
/**
|
|
45
|
+
* @license MIT
|
|
46
|
+
* @author <steven@velozo.com>
|
|
47
|
+
*/
|
|
48
|
+
var n=e("async/waterfall");t.exports=function(e,t,r){return n([function(r){e.rawQueries.checkQuery("Read")&&(t.parameters.queryOverride=e.rawQueries.getQuery("Read")),e.provider.Read(t,(function(){r(t.result.error,t)}))},function(t,r){if(t.parameters.result.value.length<1)return r(void 0,t,!1);var n=e.marshalRecordFromSourceToObject(t.result.value[0]);r(t.result.error,t,n)}],((t,n,i)=>{t&&e.fable.log.warn("Error during the read waterfall",{Error:t,Message:t.message,Query:n.query}),r(t,n,i)})),e}},{"async/waterfall":103}],113:[function(e,t,r){
|
|
49
|
+
/**
|
|
50
|
+
* @license MIT
|
|
51
|
+
* @author <steven@velozo.com>
|
|
52
|
+
*/
|
|
53
|
+
var n=e("async/waterfall"),i=e("async/eachSeries");t.exports=function(e,t,r){var o=new Date;return n([function(r){e.rawQueries.checkQuery("Reads")&&(t.parameters.queryOverride=e.rawQueries.getQuery("Reads")),e.provider.Read(t,(function(){r(t.result.error,t)}))},function(t,r){var n=(new Date).getTime()-o.getTime();n>(e.fable.settings.QueryThresholdWarnTime||200)&&e.logSlowQuery(n,t);var a=[];i(t.parameters.result.value,(function(t,r){a.push(e.marshalRecordFromSourceToObject(t)),r()}),(function(){r(t.result.error,t,a)}))}],(function(t,n,i){t&&e.fable.log.warn("Error during the read multiple waterfall",{Error:t,Message:t.message,Query:n.query}),r(t,n,i)})),e}},{"async/eachSeries":89,"async/waterfall":103}],114:[function(e,t,r){
|
|
54
|
+
/**
|
|
55
|
+
* @license MIT
|
|
56
|
+
* @author <steven@velozo.com>
|
|
57
|
+
*/
|
|
58
|
+
var n=e("async/waterfall");t.exports=function(e,t,r){return n([function(r){e.rawQueries.checkQuery("Undelete")&&(t.parameters.queryOverride=e.rawQueries.getQuery("Undelete")),e.provider.Undelete(t,(function(){r(t.result.error,t,t.result.value)}))}],(function(t,n,i){t&&e.fable.log.warn("Error during the undelete waterfall",{Error:t,Message:t.message,Query:n.query}),r(t,n,i)})),e}},{"async/waterfall":103}],115:[function(e,t,r){
|
|
59
|
+
/**
|
|
60
|
+
* @license MIT
|
|
61
|
+
* @author <steven@velozo.com>
|
|
62
|
+
*/
|
|
63
|
+
var n=e("async/waterfall");t.exports=function(e,t,r){return n([function(r){if(t.query.IDUser||("number"==typeof t.userID&&t.userID%1==0&&t.userID>=0?t.query.IDUser=t.userID:t.query.IDUser=e.userIdentifier),!t.query.records)return r("No record submitted",t,!1);if(!t.query.records[0].hasOwnProperty(e.defaultIdentifier))return r("Automated update missing default identifier",t,!1);for(var n=0;n<e.schema.length;n++)switch(e.schema[n].Type){case"UpdateIDUser":case"UpdateDate":t.query.records[0][e.schema[n].Column]=!1}if(t.addFilter(e.defaultIdentifier,t.query.records[0][e.defaultIdentifier]),!1===t.parameters.filter||t.parameters.filter.length<1)return r("Automated update missing filters... aborting!",t,!1);e.provider.Update(t,(function(){r(t.result.error,t)}))},function(e,t){if("object"!=typeof e.parameters.result.value)return t("No record updated.",e,!1);t(e.result.error,e)},function(t,r){var n=t.clone();e.rawQueries.checkQuery("Read")&&(n.parameters.queryOverride=e.rawQueries.getQuery("Read")),e.provider.Read(n,(function(){r(n.result.error,t,n)}))},function(t,r,n){if(0===r.result.value.length)return n("No record found to update!",r.result,!1);var i=e.marshalRecordFromSourceToObject(r.result.value[0]);n(t.result.error,t,r,i)}],(function(t,n,i,o){t&&e.fable.log.warn("Error during Update waterfall",{Error:t,Message:t.message,Query:n.query}),r(t,n,i,o)})),e}},{"async/waterfall":103}],116:[function(e,t,r){t.exports=new function(){return function e(t){if("object"!=typeof t)return{new:e};var r=t,n=0;if(r.settings.ArrayStorage&&(n=r.settings.ArrayStorage.GlobalLogLevel||0),!r.hasOwnProperty("ALASQL"))return r.log.fatal("Meadow is trying to perform queries without a valid [Fable.ALASQL] object. See the documentation for how to initialize one."),!1;var i=r.ALASQL,o="Unknown_Meadow_ALASQL_Scope",a={},s="ID",u=()=>{var e="",t=o,n=a;if(e+="CREATE TABLE IF NOT EXISTS\n "+t+"\n",n.length>0){e+=" (\n";for(var u=0;u<n.length;u++)switch(u>0&&(e+=","),e+="\n",n[u].Type){case"AutoIdentity":e+=" `"+n[u].Column+"` INT UNSIGNED NOT NULL AUTO_INCREMENT",s=n[u].Column;break;case"AutoGUID":e+=" `"+n[u].Column+"` CHAR(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000'",n[u].Column;break;case"Boolean":case"Deleted":case"CreateIDUser":case"UpdateIDUser":case"DeleteIDUser":case"Numeric":e+=" `"+n[u].Column+"` INT NOT NULL DEFAULT 0";break;case"Decimal":e+=" `"+n[u].Column+"` DECIMAL("+n[u].Size+")";break;case"String":e+=" `"+n[u].Column+"` VARCHAR NOT NULL DEFAULT ''";break;case"Text":e+=" `"+n[u].Column+"` TEXT";break;case"CreateDate":case"UpdateDate":case"DeleteDate":case"DateTime":e+=" `"+n[u].Column+"` DATETIME"}e+="\n )"}return e+=";",r.log.info("Auto Creating ALASQL database `"+t+"`",{CreateStatement:e}),i(e),this},l=e=>{"Unknown_Meadow_ALASQL_Scope"==o&&void 0!==e.scope&&(o=e.scope),r.ALASQL.tables.hasOwnProperty(o)||u()};return{setSchema:(e,t,r,n)=>(o=e,a=t,s=r,n,this),marshalRecordFromSourceToObject:function(e,t){for(var r in t)e[r]=t[r]},constructFromObject:e=>{if("object"!=typeof e||"object"!=typeof e.Meadow)return!1;"string"!=typeof e.Scope&&(e.Scope="DATA"),"object"!=typeof e.ObjectPrototype&&(e.ObjectPrototype={}),"boolean"!=typeof e.AuditData&&(e.AuditData=!0),"boolean"!=typeof e.Import&&(e.Import=!0),Array.isArray(e.Data)||(e.Data=[]);var t,n=e.Meadow.new(r,e.Scope).setProvider("ALASQL"),i=[];for(var o in e.AuditData&&(t="ID"+e.Scope,i.push({Column:t,Type:"AutoIdentity"}),i.push({Column:"GU"+t,Type:"AutoGUID"}),i.push({Column:"CreateDate",Type:"CreateDate"}),i.push({Column:"CreatingIDUser",Type:"CreateIDUser"}),i.push({Column:"UpdateDate",Type:"UpdateDate"}),i.push({Column:"UpdatingIDUser",Type:"UpdateIDUser"}),i.push({Column:"DeleteDate",Type:"DeleteDate"}),i.push({Column:"DeletingIDUser",Type:"DeleteIDUser"}),i.push({Column:"Deleted",Type:"Deleted"})),e.ObjectPrototype){switch(typeof e.ObjectPrototype[o]){case"undefined":case"object":case"function":default:break;case"boolean":i.push({Column:o,Type:"Boolean"});break;case"number":case"string":i.push({Column:o,Type:"Text"})}!1}if(n.setSchema(i),void 0===t&&n.setDefaultIdentifier(t),e.Import)for(var a=0;a<e.Data.length;a++)n.doCreate(n.query.clone().addRecord(e.Data[a]),(function(e,t,n,i){r.log.trace("Auto imported record",i)}));else n.provider.bindObject(e.Data);return n},bindObject:e=>!!Array.isArray(e)&&(l({}),!!r.ALASQL.tables.hasOwnProperty(o)&&(r.ALASQL.tables[o].data=e,!0)),Create:function(e,t){var o=e.parameters.result;l(e.parameters),e.setDialect("ALASQL").buildCreateQuery();var a=i.compile(e.query.body);(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);try{o.error=void 0,o.executed=!1,o.value=0,a(e.query.parameters)>0&&(i.tables[e.parameters.scope].identities[s]?o.value=i.autoval(e.parameters.scope,s):e.query.records.length>0&&e.query.records[0].hasOwnProperty(s)&&(o.value=e.query.records[0][s])),o.executed=!0}catch(e){o.error=e}t()},Read:function(e,t){var o=e.parameters.result;l(e.parameters),e.setDialect("ALASQL").buildReadQuery();var a=i.compile(e.query.body);(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);try{o.error=void 0,o.executed=!1,o.value=a(e.query.parameters),o.executed=!0}catch(e){o.error=e}t()},Update:function(e,t){var o=e.parameters.result;l(e.parameters),e.setDialect("ALASQL").buildUpdateQuery();var a=i.compile(e.query.body);(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);try{o.error=void 0,o.executed=!1,o.value={affectedRows:a(e.query.parameters)},o.executed=!0}catch(e){o.error=e}t()},Delete:function(e,t){var o=e.parameters.result;l(e.parameters),e.setDialect("ALASQL").buildDeleteQuery();var a=i.compile(e.query.body);(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);try{o.error=void 0,o.executed=!1,o.value=a(e.query.parameters),o.executed=!0}catch(e){o.error=e}t()},Undelete:function(e,t){var o=e.parameters.result;l(e.parameters),e.setDialect("ALASQL").buildUndeleteQuery();var a=i.compile(e.query.body);(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);try{o.error=void 0,o.executed=!1,o.value=a(e.query.parameters),o.executed=!0}catch(e){o.error=e}t()},Count:function(e,t){var o=e.parameters.result;l(e.parameters),e.setDialect("ALASQL").buildCountQuery();var a=i.compile(e.query.body);(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);try{o.error=void 0,o.executed=!1,o.value=a(e.query.parameters)[0].RowCount,o.executed=!0}catch(e){o.error=e}t()},new:e}}()}},{}],117:[function(e,t,r){
|
|
64
|
+
/**
|
|
65
|
+
* @license MIT
|
|
66
|
+
* @author <steven@velozo.com>
|
|
67
|
+
*/
|
|
68
|
+
var n=e("simple-get");t.exports=new function(){return function e(t){if("object"!=typeof t)return{new:e};var r=t,i="MeadowEndpoints",o={},a=[],s=r.settings.hasOwnProperty("MeadowEndpoints")?JSON.parse(JSON.stringify(r.settings.MedaowEndpoints)):{ServerProtocol:"http",ServerAddress:"127.0.0.1",ServerPort:"8086",ServerEndpointPrefix:"1.0/"},u=function(e){var t;e.logLevel>0&&r.log.trace(e.query.body,e.query.records);let n={url:(t=e.query.body,`${s.ServerProtocol}://${s.ServerAddress}:${s.ServerPort}/${s.ServerEndpointPrefix}${t}`),headers:r.Utility.extend({cookie:""},o)};return n.headers.cookie=a.join(";"),e.logLevel>0&&r.log.debug("Request options built...",n),n};return{marshalRecordFromSourceToObject:function(e,t){for(var r in t)e[r]=t[r]},Create:function(e,t){var o=e.parameters.result;e.setDialect(i).buildCreateQuery();let a=u(e);if(!e.query.records.length>0)return o.error="No records passed for proxying to Meadow-Endpoints.",t();a.body=e.query.records[0],a.json=!0,n.post(a,((n,i)=>{if(o.error=n,o.executed=!0,e.logLevel>0&&r.log.debug("--\x3e POST request connected"),n)return t(o);let a="";i.on("data",(t=>{e.logLevel>0&&r.log.debug(`--\x3e POST data chunk size ${t.length}b received`),a+=t})),i.on("end",(()=>{a&&(o.value=JSON.parse(a));let n=`ID${e.parameters.scope}`;return o.value.hasOwnProperty(n)&&(o.value=o.value[n]),e.logLevel>0&&r.log.debug(`==> POST completed data size ${a.length}b received`,o),t()}))}))},Read:function(e,t){var o=e.parameters.result;e.setDialect(i).buildReadQuery();let a=u(e);n.get(a,((n,i)=>{if(o.error=n,o.executed=!0,e.logLevel>0&&r.log.debug("--\x3e GET request connected"),n)return t(o);let a="";i.on("data",(t=>{e.logLevel>0&&r.log.debug(`--\x3e GET data chunk size ${t.length}b received`),a+=t})),i.on("end",(()=>{a&&(o.value=JSON.parse(a)),e.query.body.startsWith(`${e.parameters.scope}/`)&&(o.value=[o.value]),e.logLevel>0&&r.log.debug(`==> GET completed data size ${a.length}b received`,o),t()}))}))},Update:function(e,t){var o=e.parameters.result;e.setDialect(i).buildUpdateQuery();let a=u(e);if(!e.query.records.length>0)return o.error="No records passed for proxying to Meadow-Endpoints.",t();a.body=e.query.records[0],a.json=!0,n.put(a,((n,i)=>{if(o.error=n,o.executed=!0,e.logLevel>0&&r.log.debug("--\x3e PUT request connected"),n)return t(o);let a="";i.on("data",(t=>{e.logLevel>0&&r.log.debug(`--\x3e PUT data chunk size ${t.length}b received`),a+=t})),i.on("end",(()=>{a&&(o.value=JSON.parse(a));let n=`ID${e.parameters.scope}`;return o.value.hasOwnProperty(n)&&(o.value=o.value[n]),e.logLevel>0&&r.log.debug(`==> PUT completed data size ${a.length}b received`,o),t()}))}))},Delete:function(e,t){var o=e.parameters.result;e.setDialect(i).buildDeleteQuery();let a=u(e);n.delete(a,((n,i)=>{if(o.error=n,o.executed=!0,e.logLevel>0&&r.log.debug("--\x3e DEL request connected"),n)return t(o);let a="";i.on("data",(t=>{e.logLevel>0&&r.log.debug(`--\x3e DEL data chunk size ${t.length}b received`),a+=t})),i.on("end",(()=>{a&&(o.value=JSON.parse(a)),o.value.hasOwnProperty("Count")&&(o.value=o.value.Count),e.logLevel>0&&r.log.debug(`==> DEL completed data size ${a.length}b received`,o),t()}))}))},Count:function(e,t){var o=e.parameters.result;e.setDialect(i).buildCountQuery();let a=u(e);n.get(a,((n,i)=>{if(o.error=n,o.executed=!0,e.logLevel>0&&r.log.debug("--\x3e GET request connected"),n)return t(o);let a="";i.on("data",(t=>{e.logLevel>0&&r.log.debug(`--\x3e GET data chunk size ${t.length}b received`),a+=t})),i.on("end",(()=>{a&&(o.value=JSON.parse(a));try{o.value=o.value.Count}catch(t){o.value=-1,r.log.warn("Error getting rowcount during count query",{Body:e.query.body,Parameters:e.query.parameters})}e.logLevel>0&&r.log.debug(`==> GET completed data size ${a.length}b received`,o),t()}))}))},new:e}}()}},{"simple-get":128}],118:[function(e,t,r){t.exports=new function(){return function e(t){if("object"!=typeof t)return{new:e};var r=t,n=0;r.settings.MySQL&&(n=r.settings.MySQL.GlobalLogLevel||0);var i=function(){return"object"!=typeof r.MeadowMySQLConnectionPool?(r.log.fatal("Meadow is trying to perform queries without a valid [Fable.MeadowMySQLConnectionPool] object. See the documentation for how to initialize one."),!1):r.MeadowMySQLConnectionPool};return{marshalRecordFromSourceToObject:function(e,t){for(var r in t)e[r]=t[r]},Create:function(e,t){var o=e.parameters.result;e.setDialect("MySQL").buildCreateQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters),i().getConnection((function(n,i){i.query(e.query.body,e.query.parameters,(function(n,a){i.release(),o.error=n,o.value=!1;try{o.value=a.insertId}catch(t){r.log.warn("Error getting insert ID during create query",{Body:e.query.body,Parameters:e.query.parameters})}return o.executed=!0,t()}))}))},Read:function(e,t){var o=e.parameters.result;e.setDialect("MySQL").buildReadQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters),i().getConnection((function(r,n){n.query(e.query.body,e.query.parameters,(function(e,r){return n.release(),o.error=e,o.value=r,o.executed=!0,t()}))}))},Update:function(e,t){var o=e.parameters.result;e.setDialect("MySQL").buildUpdateQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters),i().getConnection((function(r,n){n.query(e.query.body,e.query.parameters,(function(e,r){return n.release(),o.error=e,o.value=r,o.executed=!0,t()}))}))},Delete:function(e,t){var o=e.parameters.result;e.setDialect("MySQL").buildDeleteQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters),i().getConnection((function(n,i){i.query(e.query.body,e.query.parameters,(function(n,a){i.release(),o.error=n,o.value=!1;try{o.value=a.affectedRows}catch(t){r.log.warn("Error getting affected rowcount during delete query",{Body:e.query.body,Parameters:e.query.parameters})}return o.executed=!0,t()}))}))},Undelete:function(e,t){var o=e.parameters.result;e.setDialect("MySQL").buildUndeleteQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters),i().getConnection((function(n,i){i.query(e.query.body,e.query.parameters,(function(n,a){i.release(),o.error=n,o.value=!1;try{o.value=a.affectedRows}catch(t){r.log.warn("Error getting affected rowcount during delete query",{Body:e.query.body,Parameters:e.query.parameters})}return o.executed=!0,t()}))}))},Count:function(e,t){var o=e.parameters.result;e.setDialect("MySQL").buildCountQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters),i().getConnection((function(n,i){i.query(e.query.body,e.query.parameters,(function(n,a){i.release(),o.executed=!0,o.error=n,o.value=!1;try{o.value=a[0].RowCount}catch(t){r.log.warn("Error getting rowcount during count query",{Body:e.query.body,Parameters:e.query.parameters})}return t()}))}))},new:e}}()}},{}],119:[function(e,t,r){t.exports=new function(){return function e(t){return"object"==typeof t&&"fable"in t?{marshalRecordFromSourceToObject:function(){},Create:function(e,t){e.parameters.result.executed=!0,t()},Read:function(e,t){e.parameters.result.executed=!0,e.parameters.result.value=[!0],t()},Update:function(e,t){e.parameters.result.executed=!0,t()},Delete:function(e,t){e.parameters.result.executed=!0,t()},Undelete:function(e,t){e.parameters.result.executed=!0,t()},Count:function(e,t){e.parameters.result.executed=!0,t()},new:e}:{new:e}}()}},{}],120:[function(e,t,r){var n=e("wrappy");function i(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function o(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}t.exports=n(i),t.exports.strict=n(o),i.proto=i((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return i(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return o(this)},configurable:!0})}))},{wrappy:173}],121:[function(e,t,r){var n,i,o=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function u(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(e){i=s}}();var l,c=[],f=!1,d=-1;function h(){f&&l&&(f=!1,l.length?c=l.concat(c):d=-1,c.length&&p())}function p(){if(!f){var e=u(h);f=!0;for(var t=c.length;t;){for(l=c,c=[];++d<t;)l&&l[d].run();d=-1,t=c.length}l=null,f=!1,function(e){if(i===clearTimeout)return clearTimeout(e);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{return i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}(e)}}function y(e,t){this.fun=e,this.array=t}function b(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new y(e,t)),1!==c.length||f||u(p)},y.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=b,o.addListener=b,o.once=b,o.off=b,o.removeListener=b,o.removeAllListeners=b,o.emit=b,o.prependListener=b,o.prependOnceListener=b,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],122:[function(e,t,r){(function(e){(function(){!function(n){var i="object"==typeof r&&r&&!r.nodeType&&r,o="object"==typeof t&&t&&!t.nodeType&&t,a="object"==typeof e&&e;a.global!==a&&a.window!==a&&a.self!==a||(n=a);var s,u,l=2147483647,c=36,f=1,d=26,h=38,p=700,y=72,b=128,g="-",m=/^xn--/,v=/[^\x20-\x7E]/,w=/[\x2E\u3002\uFF0E\uFF61]/g,_={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},S=c-f,E=Math.floor,R=String.fromCharCode;function A(e){throw new RangeError(_[e])}function j(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function O(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+j((e=e.replace(w,".")).split("."),t).join(".")}function D(e){for(var t,r,n=[],i=0,o=e.length;i<o;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<o?56320==(64512&(r=e.charCodeAt(i++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--):n.push(t);return n}function C(e){return j(e,(function(e){var t="";return e>65535&&(t+=R((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=R(e)})).join("")}function T(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function L(e,t,r){var n=0;for(e=r?E(e/p):e>>1,e+=E(e/t);e>S*d>>1;n+=c)e=E(e/S);return E(n+(S+1)*e/(e+h))}function I(e){var t,r,n,i,o,a,s,u,h,p,m,v=[],w=e.length,_=0,S=b,R=y;for((r=e.lastIndexOf(g))<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&A("not-basic"),v.push(e.charCodeAt(n));for(i=r>0?r+1:0;i<w;){for(o=_,a=1,s=c;i>=w&&A("invalid-input"),((u=(m=e.charCodeAt(i++))-48<10?m-22:m-65<26?m-65:m-97<26?m-97:c)>=c||u>E((l-_)/a))&&A("overflow"),_+=u*a,!(u<(h=s<=R?f:s>=R+d?d:s-R));s+=c)a>E(l/(p=c-h))&&A("overflow"),a*=p;R=L(_-o,t=v.length+1,0==o),E(_/t)>l-S&&A("overflow"),S+=E(_/t),_%=t,v.splice(_++,0,S)}return C(v)}function x(e){var t,r,n,i,o,a,s,u,h,p,m,v,w,_,S,j=[];for(v=(e=D(e)).length,t=b,r=0,o=y,a=0;a<v;++a)(m=e[a])<128&&j.push(R(m));for(n=i=j.length,i&&j.push(g);n<v;){for(s=l,a=0;a<v;++a)(m=e[a])>=t&&m<s&&(s=m);for(s-t>E((l-r)/(w=n+1))&&A("overflow"),r+=(s-t)*w,t=s,a=0;a<v;++a)if((m=e[a])<t&&++r>l&&A("overflow"),m==t){for(u=r,h=c;!(u<(p=h<=o?f:h>=o+d?d:h-o));h+=c)S=u-p,_=c-p,j.push(R(T(p+S%_,0))),u=E(S/_);j.push(R(T(u,0))),o=L(r,w,n==i),r=0,++n}++r,++t}return j.join("")}if(s={version:"1.4.1",ucs2:{decode:D,encode:C},decode:I,encode:x,toASCII:function(e){return O(e,(function(e){return v.test(e)?"xn--"+x(e):e}))},toUnicode:function(e){return O(e,(function(e){return m.test(e)?I(e.slice(4).toLowerCase()):e}))}},i&&o)if(t.exports==i)o.exports=s;else for(u in s)s.hasOwnProperty(u)&&(i[u]=s[u]);else n.punycode=s}(this)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],123:[function(e,t,r){"use strict";function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,r,o){t=t||"&",r=r||"=";var a={};if("string"!=typeof e||0===e.length)return a;var s=/\+/g;e=e.split(t);var u=1e3;o&&"number"==typeof o.maxKeys&&(u=o.maxKeys);var l=e.length;u>0&&l>u&&(l=u);for(var c=0;c<l;++c){var f,d,h,p,y=e[c].replace(s,"%20"),b=y.indexOf(r);b>=0?(f=y.substr(0,b),d=y.substr(b+1)):(f=y,d=""),h=decodeURIComponent(f),p=decodeURIComponent(d),n(a,h)?i(a[h])?a[h].push(p):a[h]=[a[h],p]:a[h]=p}return a};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],124:[function(e,t,r){"use strict";var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,r,s){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?o(a(e),(function(a){var s=encodeURIComponent(n(a))+r;return i(e[a])?o(e[a],(function(e){return s+encodeURIComponent(n(e))})).join(t):s+encodeURIComponent(n(e[a]))})).join(t):s?encodeURIComponent(n(s))+r+encodeURIComponent(n(e)):""};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function o(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n<e.length;n++)r.push(t(e[n],n));return r}var a=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t}},{}],125:[function(e,t,r){"use strict";r.decode=r.parse=e("./decode"),r.encode=r.stringify=e("./encode")},{"./decode":123,"./encode":124}],126:[function(e,t,r){/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var n=e("buffer"),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,r),r.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},{buffer:22}],127:[function(e,t,r){(function(e){(function(){/*! simple-concat. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */t.exports=function(t,r){var n=[];t.on("data",(function(e){n.push(e)})),t.once("end",(function(){r&&r(null,e.concat(n)),r=null})),t.once("error",(function(e){r&&r(e),r=null}))}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:22}],128:[function(e,t,r){(function(r){(function(){/*! simple-get. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */t.exports=f;const n=e("simple-concat"),i=e("decompress-response"),o=e("http"),a=e("https"),s=e("once"),u=e("querystring"),l=e("url"),c=e=>null!==e&&"object"==typeof e&&"function"==typeof e.pipe;function f(e,t){if(e=Object.assign({maxRedirects:10},"string"==typeof e?{url:e}:e),t=s(t),e.url){const{hostname:t,port:r,protocol:n,auth:i,path:o}=l.parse(e.url);delete e.url,t||r||n||i?Object.assign(e,{hostname:t,port:r,protocol:n,auth:i,path:o}):e.path=o}const n={"accept-encoding":"gzip, deflate"};let d;e.headers&&Object.keys(e.headers).forEach((t=>n[t.toLowerCase()]=e.headers[t])),e.headers=n,e.body?d=e.json&&!c(e.body)?JSON.stringify(e.body):e.body:e.form&&(d="string"==typeof e.form?e.form:u.stringify(e.form),e.headers["content-type"]="application/x-www-form-urlencoded"),d&&(e.method||(e.method="POST"),c(d)||(e.headers["content-length"]=r.byteLength(d)),e.json&&!e.form&&(e.headers["content-type"]="application/json")),delete e.body,delete e.form,e.json&&(e.headers.accept="application/json"),e.method&&(e.method=e.method.toUpperCase());const h=e.hostname,p=("https:"===e.protocol?a:o).request(e,(r=>{if(!1!==e.followRedirects&&r.statusCode>=300&&r.statusCode<400&&r.headers.location){e.url=r.headers.location,delete e.headers.host,r.resume();const n=l.parse(e.url).hostname;return null!==n&&n!==h&&(delete e.headers.cookie,delete e.headers.authorization),"POST"===e.method&&[301,302].includes(r.statusCode)&&(e.method="GET",delete e.headers["content-length"],delete e.headers["content-type"]),0==e.maxRedirects--?t(new Error("too many redirects")):f(e,t)}const n="function"==typeof i&&"HEAD"!==e.method;t(null,n?i(r):r)}));return p.on("timeout",(()=>{p.abort(),t(new Error("Request timed out"))})),p.on("error",t),c(d)?d.on("error",t).pipe(p):p.end(d),p}f.concat=(e,t)=>f(e,((r,i)=>{if(r)return t(r);n(i,((r,n)=>{if(r)return t(r);if(e.json)try{n=JSON.parse(n.toString())}catch(r){return t(r,i,n)}t(null,i,n)}))})),["get","post","put","patch","head","delete"].forEach((e=>{f[e]=(t,r)=>("string"==typeof t&&(t={url:t}),f(Object.assign({method:e.toUpperCase()},t),r))}))}).call(this)}).call(this,e("buffer").Buffer)},{buffer:22,"decompress-response":20,http:144,https:45,once:120,querystring:125,"simple-concat":127,url:166}],129:[function(e,t,r){t.exports=i;var n=e("events").EventEmitter;function i(){n.call(this)}e("inherits")(i,n),i.Readable=e("readable-stream/lib/_stream_readable.js"),i.Writable=e("readable-stream/lib/_stream_writable.js"),i.Duplex=e("readable-stream/lib/_stream_duplex.js"),i.Transform=e("readable-stream/lib/_stream_transform.js"),i.PassThrough=e("readable-stream/lib/_stream_passthrough.js"),i.finished=e("readable-stream/lib/internal/streams/end-of-stream.js"),i.pipeline=e("readable-stream/lib/internal/streams/pipeline.js"),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",u));var a=!1;function s(){a||(a=!0,e.end())}function u(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function l(e){if(c(),0===n.listenerCount(this,"error"))throw e}function c(){r.removeListener("data",i),e.removeListener("drain",o),r.removeListener("end",s),r.removeListener("close",u),r.removeListener("error",l),e.removeListener("error",l),r.removeListener("end",c),r.removeListener("close",c),e.removeListener("close",c)}return r.on("error",l),e.on("error",l),r.on("end",c),r.on("close",c),e.on("close",c),e.emit("pipe",r),e}},{events:26,inherits:47,"readable-stream/lib/_stream_duplex.js":131,"readable-stream/lib/_stream_passthrough.js":132,"readable-stream/lib/_stream_readable.js":133,"readable-stream/lib/_stream_transform.js":134,"readable-stream/lib/_stream_writable.js":135,"readable-stream/lib/internal/streams/end-of-stream.js":139,"readable-stream/lib/internal/streams/pipeline.js":141}],130:[function(e,t,r){"use strict";var n={};function i(e,t,r){r||(r=Error);var i=function(e){var r,n;function i(r,n,i){return e.call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,n,i))||this}return n=e,(r=i).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,i}(r);i.prototype.name=r.name,i.prototype.code=e,n[e]=i}function o(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}i("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(e,t,r){var n,i,a,s;if("string"==typeof t&&(i="not ",t.substr(!a||a<0?0:+a,i.length)===i)?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))s="The ".concat(e," ").concat(n," ").concat(o(t,"type"));else{var u=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(u," ").concat(n," ").concat(o(t,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=n},{}],131:[function(e,t,r){(function(r){(function(){"use strict";var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=s;const i=e("./_stream_readable"),o=e("./_stream_writable");e("inherits")(s,i);{const e=n(o.prototype);for(var a=0;a<e.length;a++){const t=e[a];s.prototype[t]||(s.prototype[t]=o.prototype[t])}}function s(e){if(!(this instanceof s))return new s(e);i.call(this,e),o.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",u)))}function u(){this._writableState.ended||r.nextTick(l,this)}function l(e){e.end()}Object.defineProperty(s.prototype,"writableHighWaterMark",{enumerable:!1,get(){return this._writableState.highWaterMark}}),Object.defineProperty(s.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(s.prototype,"writableLength",{enumerable:!1,get(){return this._writableState.length}}),Object.defineProperty(s.prototype,"destroyed",{enumerable:!1,get(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})}).call(this)}).call(this,e("_process"))},{"./_stream_readable":133,"./_stream_writable":135,_process:121,inherits:47}],132:[function(e,t,r){"use strict";t.exports=i;const n=e("./_stream_transform");function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}e("inherits")(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},{"./_stream_transform":134,inherits:47}],133:[function(e,t,r){(function(r,n){(function(){"use strict";var i;t.exports=A,A.ReadableState=R;e("events").EventEmitter;var o=function(e,t){return e.listeners(t).length},a=e("./internal/streams/stream");const s=e("buffer").Buffer,u=(void 0!==n?n:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};const l=e("util");let c;c=l&&l.debuglog?l.debuglog("stream"):function(){};const f=e("./internal/streams/buffer_list"),d=e("./internal/streams/destroy"),h=e("./internal/streams/state").getHighWaterMark,p=e("../errors").codes,y=p.ERR_INVALID_ARG_TYPE,b=p.ERR_STREAM_PUSH_AFTER_EOF,g=p.ERR_METHOD_NOT_IMPLEMENTED,m=p.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;let v,w,_;e("inherits")(A,a);const S=d.errorOrDestroy,E=["error","close","destroy","pause","resume"];function R(t,r,n){i=i||e("./_stream_duplex"),t=t||{},"boolean"!=typeof n&&(n=r instanceof i),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=h(this,t,"readableHighWaterMark",n),this.buffer=new f,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(v||(v=e("string_decoder/").StringDecoder),this.decoder=new v(t.encoding),this.encoding=t.encoding)}function A(t){if(i=i||e("./_stream_duplex"),!(this instanceof A))return new A(t);const r=this instanceof i;this._readableState=new R(t,this,r),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),a.call(this)}function j(e,t,r,n,i){c("readableAddChunk",t);var o,a=e._readableState;if(null===t)a.reading=!1,function(e,t){if(c("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?T(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,L(e)))}(e,a);else if(i||(o=function(e,t){var r;n=t,s.isBuffer(n)||n instanceof u||"string"==typeof t||void 0===t||e.objectMode||(r=new y("chunk",["string","Buffer","Uint8Array"],t));var n;return r}(a,t)),o)S(e,o);else if(a.objectMode||t&&t.length>0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),n)a.endEmitted?S(e,new m):O(e,a,t,!0);else if(a.ended)S(e,new b);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?O(e,a,t,!1):I(e,a)):O(e,a,t,!1)}else n||(a.reading=!1,I(e,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function O(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&T(e)),I(e,t)}Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get(){return void 0!==this._readableState&&this._readableState.destroyed},set(e){this._readableState&&(this._readableState.destroyed=e)}}),A.prototype.destroy=d.destroy,A.prototype._undestroy=d.undestroy,A.prototype._destroy=function(e,t){t(e)},A.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=s.from(e,t),t=""),r=!0),j(this,e,t,!1,r)},A.prototype.unshift=function(e){return j(this,e,null,!0,!1)},A.prototype.isPaused=function(){return!1===this._readableState.flowing},A.prototype.setEncoding=function(t){v||(v=e("string_decoder/").StringDecoder);const r=new v(t);this._readableState.decoder=r,this._readableState.encoding=this._readableState.decoder.encoding;let n=this._readableState.buffer.head,i="";for(;null!==n;)i+=r.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};const D=1073741824;function C(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=D?e=D:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function T(e){var t=e._readableState;c("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(c("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick(L,e))}function L(e){var t=e._readableState;c("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,q(e)}function I(e,t){t.readingMore||(t.readingMore=!0,r.nextTick(x,e,t))}function x(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){const r=t.length;if(c("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function U(e){const t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function k(e){c("readable nexttick read 0"),e.read(0)}function M(e,t){c("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),q(e),t.flowing&&!t.reading&&e.read(0)}function q(e){const t=e._readableState;for(c("flow",t.flowing);t.flowing&&null!==e.read(););}function P(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function B(e){var t=e._readableState;c("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(N,t,e))}function N(e,t){if(c("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){const e=t._writableState;(!e||e.autoDestroy&&e.finished)&&t.destroy()}}function F(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}A.prototype.read=function(e){c("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return c("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?B(this):T(this),null;if(0===(e=C(e,t))&&t.ended)return 0===t.length&&B(this),null;var n,i=t.needReadable;return c("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&c("length less than watermark",i=!0),t.ended||t.reading?c("reading or ended",i=!1):i&&(c("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=C(r,t))),null===(n=e>0?P(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&B(this)),null!==n&&this.emit("data",n),n},A.prototype._read=function(e){S(this,new g("_read()"))},A.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,c("pipe count=%d opts=%j",i.pipesCount,t);var a=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?u:b;function s(t,r){c("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,c("cleanup"),e.removeListener("close",p),e.removeListener("finish",y),e.removeListener("drain",l),e.removeListener("error",h),e.removeListener("unpipe",s),n.removeListener("end",u),n.removeListener("end",b),n.removeListener("data",d),f=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function u(){c("onend"),e.end()}i.endEmitted?r.nextTick(a):n.once("end",a),e.on("unpipe",s);var l=function(e){return function(){var t=e._readableState;c("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,q(e))}}(n);e.on("drain",l);var f=!1;function d(t){c("ondata");var r=e.write(t);c("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==F(i.pipes,e))&&!f&&(c("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function h(t){c("onerror",t),b(),e.removeListener("error",h),0===o(e,"error")&&S(e,t)}function p(){e.removeListener("finish",y),b()}function y(){c("onfinish"),e.removeListener("close",p),b()}function b(){c("unpipe"),n.unpipe(e)}return n.on("data",d),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",h),e.once("close",p),e.once("finish",y),e.emit("pipe",n),i.flowing||(c("pipe resume"),n.resume()),e},A.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=F(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},A.prototype.on=function(e,t){const n=a.prototype.on.call(this,e,t),i=this._readableState;return"data"===e?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,c("on readable",i.length,i.reading),i.length?T(this):i.reading||r.nextTick(k,this))),n},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(e,t){const n=a.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(U,this),n},A.prototype.removeAllListeners=function(e){const t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(U,this),t},A.prototype.resume=function(){var e=this._readableState;return e.flowing||(c("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(M,e,t))}(this,e)),e.paused=!1,this},A.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(e){var t=this._readableState,r=!1;for(var n in e.on("end",(()=>{if(c("wrapped end"),t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&this.push(e)}this.push(null)})),e.on("data",(n=>{(c("wrapped data"),t.decoder&&(n=t.decoder.write(n)),t.objectMode&&null==n)||(t.objectMode||n&&n.length)&&(this.push(n)||(r=!0,e.pause()))})),e)void 0===this[n]&&"function"==typeof e[n]&&(this[n]=function(t){return function(){return e[t].apply(e,arguments)}}(n));for(var i=0;i<E.length;i++)e.on(E[i],this.emit.bind(this,E[i]));return this._read=t=>{c("wrapped _read",t),r&&(r=!1,e.resume())},this},"function"==typeof Symbol&&(A.prototype[Symbol.asyncIterator]=function(){return void 0===w&&(w=e("./internal/streams/async_iterator")),w(this)}),Object.defineProperty(A.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(A.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(A.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),A._fromList=P,Object.defineProperty(A.prototype,"readableLength",{enumerable:!1,get(){return this._readableState.length}}),"function"==typeof Symbol&&(A.from=function(t,r){return void 0===_&&(_=e("./internal/streams/from")),_(A,t,r)})}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":130,"./_stream_duplex":131,"./internal/streams/async_iterator":136,"./internal/streams/buffer_list":137,"./internal/streams/destroy":138,"./internal/streams/from":140,"./internal/streams/state":142,"./internal/streams/stream":143,_process:121,buffer:22,events:26,inherits:47,"string_decoder/":163,util:20}],134:[function(e,t,r){"use strict";t.exports=c;const n=e("../errors").codes,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,a=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=n.ERR_TRANSFORM_WITH_LENGTH_0,u=e("./_stream_duplex");function l(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function c(e){if(!(this instanceof c))return new c(e);u.call(this,e),this._transformState={afterTransform:l.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",f)}function f(){"function"!=typeof this._flush||this._readableState.destroyed?d(this,null,null):this._flush(((e,t)=>{d(this,e,t)}))}function d(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new s;if(e._transformState.transforming)throw new a;return e.push(null)}e("inherits")(c,u),c.prototype.push=function(e,t){return this._transformState.needTransform=!1,u.prototype.push.call(this,e,t)},c.prototype._transform=function(e,t,r){r(new i("_transform()"))},c.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},c.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},c.prototype._destroy=function(e,t){u.prototype._destroy.call(this,e,(e=>{t(e)}))}},{"../errors":130,"./_stream_duplex":131,inherits:47}],135:[function(e,t,r){(function(r,n){(function(){"use strict";function i(e){this.next=null,this.entry=null,this.finish=()=>{!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}(this,e)}}var o;t.exports=A,A.WritableState=E;const a={deprecate:e("util-deprecate")};var s=e("./internal/streams/stream");const u=e("buffer").Buffer,l=(void 0!==n?n:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};const c=e("./internal/streams/destroy"),f=e("./internal/streams/state").getHighWaterMark,d=e("../errors").codes,h=d.ERR_INVALID_ARG_TYPE,p=d.ERR_METHOD_NOT_IMPLEMENTED,y=d.ERR_MULTIPLE_CALLBACK,b=d.ERR_STREAM_CANNOT_PIPE,g=d.ERR_STREAM_DESTROYED,m=d.ERR_STREAM_NULL_VALUES,v=d.ERR_STREAM_WRITE_AFTER_END,w=d.ERR_UNKNOWN_ENCODING,_=c.errorOrDestroy;function S(){}function E(t,n,a){o=o||e("./_stream_duplex"),t=t||{},"boolean"!=typeof a&&(a=n instanceof o),this.objectMode=!!t.objectMode,a&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=f(this,t,"writableHighWaterMark",a),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===t.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,i=n.sync,o=n.writecb;if("function"!=typeof o)throw new y;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,i,o){--t.pendingcb,n?(r.nextTick(o,i),r.nextTick(L,e,t),e._writableState.errorEmitted=!0,_(e,i)):(o(i),e._writableState.errorEmitted=!0,_(e,i),L(e,t))}(e,n,i,t,o);else{var a=C(n)||e.destroyed;a||n.corked||n.bufferProcessing||!n.bufferedRequest||D(e,n),i?r.nextTick(O,e,n,a,o):O(e,n,a,o)}}(n,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}var R;function A(t){const r=this instanceof(o=o||e("./_stream_duplex"));if(!r&&!R.call(A,this))return new A(t);this._writableState=new E(t,this,r),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),s.call(this)}function j(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new g("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function O(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),L(e,t)}function D(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,o=new Array(n),a=t.corkedRequestsFree;a.entry=r;for(var s=0,u=!0;r;)o[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;o.allBuffers=u,j(e,t,!0,t.length,o,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new i(t),t.bufferedRequestCount=0}else{for(;r;){var l=r.chunk,c=r.encoding,f=r.callback;if(j(e,t,!1,t.objectMode?1:l.length,l,c,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function C(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function T(e,t){e._final((r=>{t.pendingcb--,r&&_(e,r),t.prefinished=!0,e.emit("prefinish"),L(e,t)}))}function L(e,t){var n=C(t);if(n&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,r.nextTick(T,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){const t=e._readableState;(!t||t.autoDestroy&&t.endEmitted)&&e.destroy()}return n}e("inherits")(A,s),E.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(E.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(R=Function.prototype[Symbol.hasInstance],Object.defineProperty(A,Symbol.hasInstance,{value:function(e){return!!R.call(this,e)||this===A&&(e&&e._writableState instanceof E)}})):R=function(e){return e instanceof this},A.prototype.pipe=function(){_(this,new b)},A.prototype.write=function(e,t,n){var i,o=this._writableState,a=!1,s=!o.objectMode&&(i=e,u.isBuffer(i)||i instanceof l);return s&&!u.isBuffer(e)&&(e=function(e){return u.from(e)}(e)),"function"==typeof t&&(n=t,t=null),s?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof n&&(n=S),o.ending?function(e,t){var n=new v;_(e,n),r.nextTick(t,n)}(this,n):(s||function(e,t,n,i){var o;return null===n?o=new m:"string"==typeof n||t.objectMode||(o=new h("chunk",["string","Buffer"],n)),!o||(_(e,o),r.nextTick(i,o),!1)}(this,o,e,n))&&(o.pendingcb++,a=function(e,t,r,n,i,o){if(!r){var a=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=u.from(t,r));return t}(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var l=t.length<t.highWaterMark;l||(t.needDrain=!0);if(t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else j(e,t,!1,s,n,i,o);return l}(this,o,s,e,t,n)),a},A.prototype.cork=function(){this._writableState.corked++},A.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||D(this,e))},A.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(e,t,r){r(new p("_write()"))},A.prototype._writev=null,A.prototype.end=function(e,t,n){var i=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||function(e,t,n){t.ending=!0,L(e,t),n&&(t.finished?r.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,i,n),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get(){return void 0!==this._writableState&&this._writableState.destroyed},set(e){this._writableState&&(this._writableState.destroyed=e)}}),A.prototype.destroy=c.destroy,A.prototype._undestroy=c.undestroy,A.prototype._destroy=function(e,t){t(e)}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":130,"./_stream_duplex":131,"./internal/streams/destroy":138,"./internal/streams/state":142,"./internal/streams/stream":143,_process:121,buffer:22,inherits:47,"util-deprecate":168}],136:[function(e,t,r){(function(r){(function(){"use strict";const n=e("./end-of-stream"),i=Symbol("lastResolve"),o=Symbol("lastReject"),a=Symbol("error"),s=Symbol("ended"),u=Symbol("lastPromise"),l=Symbol("handlePromise"),c=Symbol("stream");function f(e,t){return{value:e,done:t}}function d(e){const t=e[i];if(null!==t){const r=e[c].read();null!==r&&(e[u]=null,e[i]=null,e[o]=null,t(f(r,!1)))}}function h(e){r.nextTick(d,e)}const p=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf({get stream(){return this[c]},next(){const e=this[a];if(null!==e)return Promise.reject(e);if(this[s])return Promise.resolve(f(void 0,!0));if(this[c].destroyed)return new Promise(((e,t)=>{r.nextTick((()=>{this[a]?t(this[a]):e(f(void 0,!0))}))}));const t=this[u];let n;if(t)n=new Promise(function(e,t){return(r,n)=>{e.then((()=>{t[s]?r(f(void 0,!0)):t[l](r,n)}),n)}}(t,this));else{const e=this[c].read();if(null!==e)return Promise.resolve(f(e,!1));n=new Promise(this[l])}return this[u]=n,n},[Symbol.asyncIterator](){return this},return(){return new Promise(((e,t)=>{this[c].destroy(null,(r=>{r?t(r):e(f(void 0,!0))}))}))}},p);t.exports=e=>{const t=Object.create(y,{[c]:{value:e,writable:!0},[i]:{value:null,writable:!0},[o]:{value:null,writable:!0},[a]:{value:null,writable:!0},[s]:{value:e._readableState.endEmitted,writable:!0},[l]:{value:(e,r)=>{const n=t[c].read();n?(t[u]=null,t[i]=null,t[o]=null,e(f(n,!1))):(t[i]=e,t[o]=r)},writable:!0}});return t[u]=null,n(e,(e=>{if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){const r=t[o];return null!==r&&(t[u]=null,t[i]=null,t[o]=null,r(e)),void(t[a]=e)}const r=t[i];null!==r&&(t[u]=null,t[i]=null,t[o]=null,r(f(void 0,!0))),t[s]=!0})),e.on("readable",h.bind(null,t)),t}}).call(this)}).call(this,e("_process"))},{"./end-of-stream":139,_process:121}],137:[function(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function o(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const a=e("buffer").Buffer,s=e("util").inspect,u=s&&s.custom||"inspect";t.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){const t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}unshift(e){const t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}shift(){if(0===this.length)return;const e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}concat(e){if(0===this.length)return a.alloc(0);const t=a.allocUnsafe(e>>>0);for(var r,n,i,o=this.head,s=0;o;)r=o.data,n=t,i=s,a.prototype.copy.call(r,n,i),s+=o.data.length,o=o.next;return t}consume(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}first(){return this.head.data}_getString(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){const i=t.data,o=e>i.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0===(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}_getBuffer(e){const t=a.allocUnsafe(e);var r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){const i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0===(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}[u](e,t){return s(this,i(i({},t),{},{depth:0,customInspect:!1}))}}},{buffer:22,util:20}],138:[function(e,t,r){(function(e){(function(){"use strict";function r(e,t){i(e,t),n(e)}function n(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function i(e,t){e.emit("error",t)}t.exports={destroy:function(t,o){const a=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return a||s?(o?o(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,e.nextTick(i,this,t)):e.nextTick(i,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(t=>{!o&&t?this._writableState?this._writableState.errorEmitted?e.nextTick(n,this):(this._writableState.errorEmitted=!0,e.nextTick(r,this,t)):e.nextTick(r,this,t):o?(e.nextTick(n,this),o(t)):e.nextTick(n,this)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){const r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}}).call(this)}).call(this,e("_process"))},{_process:121}],139:[function(e,t,r){"use strict";const n=e("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function e(t,r,o){if("function"==typeof r)return e(t,null,r);r||(r={}),o=function(e){let t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(o||i);let a=r.readable||!1!==r.readable&&t.readable,s=r.writable||!1!==r.writable&&t.writable;const u=()=>{t.writable||c()};var l=t._writableState&&t._writableState.finished;const c=()=>{s=!1,l=!0,a||o.call(t)};var f=t._readableState&&t._readableState.endEmitted;const d=()=>{a=!1,f=!0,s||o.call(t)},h=e=>{o.call(t,e)},p=()=>{let e;return a&&!f?(t._readableState&&t._readableState.ended||(e=new n),o.call(t,e)):s&&!l?(t._writableState&&t._writableState.ended||(e=new n),o.call(t,e)):void 0},y=()=>{t.req.on("finish",c)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(t)?s&&!t._writableState&&(t.on("end",u),t.on("close",u)):(t.on("complete",c),t.on("abort",p),t.req?y():t.on("request",y)),t.on("end",d),t.on("finish",c),!1!==r.error&&t.on("error",h),t.on("close",p),function(){t.removeListener("complete",c),t.removeListener("abort",p),t.removeListener("request",y),t.req&&t.req.removeListener("finish",c),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",c),t.removeListener("end",d),t.removeListener("error",h),t.removeListener("close",p)}}},{"../../../errors":130}],140:[function(e,t,r){t.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],141:[function(e,t,r){"use strict";let n;const i=e("../../../errors").codes,o=i.ERR_MISSING_ARGS,a=i.ERR_STREAM_DESTROYED;function s(e){if(e)throw e}function u(e){e()}function l(e,t){return e.pipe(t)}t.exports=function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];const c=function(e){return e.length?"function"!=typeof e[e.length-1]?s:e.pop():s}(r);if(Array.isArray(r[0])&&(r=r[0]),r.length<2)throw new o("streams");let f;const d=r.map((function(t,i){const o=i<r.length-1;return function(t,r,i,o){o=function(e){let t=!1;return function(){t||(t=!0,e(...arguments))}}(o);let s=!1;t.on("close",(()=>{s=!0})),void 0===n&&(n=e("./end-of-stream")),n(t,{readable:r,writable:i},(e=>{if(e)return o(e);s=!0,o()}));let u=!1;return e=>{if(!s&&!u)return u=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void o(e||new a("pipe"))}}(t,o,i>0,(function(e){f||(f=e),e&&d.forEach(u),o||(d.forEach(u),c(f))}))}));return r.reduce(l)}},{"../../../errors":130,"./end-of-stream":139}],142:[function(e,t,r){"use strict";const n=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,r,i){const o=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0){throw new n(i?r:"highWaterMark",o)}return Math.floor(o)}return e.objectMode?16:16384}}},{"../../../errors":130}],143:[function(e,t,r){t.exports=e("events").EventEmitter},{events:26}],144:[function(e,t,r){(function(t){(function(){var n=e("./lib/request"),i=e("./lib/response"),o=e("xtend"),a=e("builtin-status-codes"),s=e("url"),u=r;u.request=function(e,r){e="string"==typeof e?s.parse(e):o(e);var i=-1===t.location.protocol.search(/^https?:$/)?"http:":"",a=e.protocol||i,u=e.hostname||e.host,l=e.port,c=e.path||"/";u&&-1!==u.indexOf(":")&&(u="["+u+"]"),e.url=(u?a+"//"+u:"")+(l?":"+l:"")+c,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var f=new n(e);return r&&f.on("response",r),f},u.get=function(e,t){var r=u.request(e,t);return r.end(),r},u.ClientRequest=n,u.IncomingMessage=i.IncomingMessage,u.Agent=function(){},u.Agent.defaultMaxSockets=4,u.globalAgent=new u.Agent,u.STATUS_CODES=a,u.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./lib/request":146,"./lib/response":147,"builtin-status-codes":23,url:166,xtend:174}],145:[function(e,t,r){(function(e){(function(){var t;function n(){if(void 0!==t)return t;if(e.XMLHttpRequest){t=new e.XMLHttpRequest;try{t.open("GET",e.XDomainRequest?"/":"https://example.com")}catch(e){t=null}}else t=null;return t}function i(e){var t=n();if(!t)return!1;try{return t.responseType=e,t.responseType===e}catch(e){}return!1}function o(e){return"function"==typeof e}r.fetch=o(e.fetch)&&o(e.ReadableStream),r.writableStream=o(e.WritableStream),r.abortController=o(e.AbortController),r.arraybuffer=r.fetch||i("arraybuffer"),r.msstream=!r.fetch&&i("ms-stream"),r.mozchunkedarraybuffer=!r.fetch&&i("moz-chunked-arraybuffer"),r.overrideMimeType=r.fetch||!!n()&&o(n().overrideMimeType),t=null}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],146:[function(e,t,r){(function(r,n,i){(function(){var o=e("./capability"),a=e("inherits"),s=e("./response"),u=e("readable-stream"),l=s.IncomingMessage,c=s.readyStates;var f=t.exports=function(e){var t,r=this;u.Writable.call(r),r._opts=e,r._body=[],r._headers={},e.auth&&r.setHeader("Authorization","Basic "+i.from(e.auth).toString("base64")),Object.keys(e.headers).forEach((function(t){r.setHeader(t,e.headers[t])}));var n=!0;if("disable-fetch"===e.mode||"requestTimeout"in e&&!o.abortController)n=!1,t=!0;else if("prefer-streaming"===e.mode)t=!1;else if("allow-wrong-content-type"===e.mode)t=!o.overrideMimeType;else{if(e.mode&&"default"!==e.mode&&"prefer-fast"!==e.mode)throw new Error("Invalid value for opts.mode");t=!0}r._mode=function(e,t){return o.fetch&&t?"fetch":o.mozchunkedarraybuffer?"moz-chunked-arraybuffer":o.msstream?"ms-stream":o.arraybuffer&&e?"arraybuffer":"text"}(t,n),r._fetchTimer=null,r._socketTimeout=null,r._socketTimer=null,r.on("finish",(function(){r._onFinish()}))};a(f,u.Writable),f.prototype.setHeader=function(e,t){var r=e.toLowerCase();-1===d.indexOf(r)&&(this._headers[r]={name:e,value:t})},f.prototype.getHeader=function(e){var t=this._headers[e.toLowerCase()];return t?t.value:null},f.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},f.prototype._onFinish=function(){var e=this;if(!e._destroyed){var t=e._opts;"timeout"in t&&0!==t.timeout&&e.setTimeout(t.timeout);var i=e._headers,a=null;"GET"!==t.method&&"HEAD"!==t.method&&(a=new Blob(e._body,{type:(i["content-type"]||{}).value||""}));var s=[];if(Object.keys(i).forEach((function(e){var t=i[e].name,r=i[e].value;Array.isArray(r)?r.forEach((function(e){s.push([t,e])})):s.push([t,r])})),"fetch"===e._mode){var u=null;if(o.abortController){var l=new AbortController;u=l.signal,e._fetchAbortController=l,"requestTimeout"in t&&0!==t.requestTimeout&&(e._fetchTimer=n.setTimeout((function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()}),t.requestTimeout))}n.fetch(e._opts.url,{method:e._opts.method,headers:s,body:a||void 0,mode:"cors",credentials:t.withCredentials?"include":"same-origin",signal:u}).then((function(t){e._fetchResponse=t,e._resetTimers(!1),e._connect()}),(function(t){e._resetTimers(!0),e._destroyed||e.emit("error",t)}))}else{var f=e._xhr=new n.XMLHttpRequest;try{f.open(e._opts.method,e._opts.url,!0)}catch(t){return void r.nextTick((function(){e.emit("error",t)}))}"responseType"in f&&(f.responseType=e._mode),"withCredentials"in f&&(f.withCredentials=!!t.withCredentials),"text"===e._mode&&"overrideMimeType"in f&&f.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in t&&(f.timeout=t.requestTimeout,f.ontimeout=function(){e.emit("requestTimeout")}),s.forEach((function(e){f.setRequestHeader(e[0],e[1])})),e._response=null,f.onreadystatechange=function(){switch(f.readyState){case c.LOADING:case c.DONE:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(f.onprogress=function(){e._onXHRProgress()}),f.onerror=function(){e._destroyed||(e._resetTimers(!0),e.emit("error",new Error("XHR error")))};try{f.send(a)}catch(t){return void r.nextTick((function(){e.emit("error",t)}))}}}},f.prototype._onXHRProgress=function(){var e=this;e._resetTimers(!1),function(e){try{var t=e.status;return null!==t&&0!==t}catch(e){return!1}}(e._xhr)&&!e._destroyed&&(e._response||e._connect(),e._response._onXHRProgress(e._resetTimers.bind(e)))},f.prototype._connect=function(){var e=this;e._destroyed||(e._response=new l(e._xhr,e._fetchResponse,e._mode,e._resetTimers.bind(e)),e._response.on("error",(function(t){e.emit("error",t)})),e.emit("response",e._response))},f.prototype._write=function(e,t,r){this._body.push(e),r()},f.prototype._resetTimers=function(e){var t=this;n.clearTimeout(t._socketTimer),t._socketTimer=null,e?(n.clearTimeout(t._fetchTimer),t._fetchTimer=null):t._socketTimeout&&(t._socketTimer=n.setTimeout((function(){t.emit("timeout")}),t._socketTimeout))},f.prototype.abort=f.prototype.destroy=function(e){var t=this;t._destroyed=!0,t._resetTimers(!0),t._response&&(t._response._destroyed=!0),t._xhr?t._xhr.abort():t._fetchAbortController&&t._fetchAbortController.abort(),e&&t.emit("error",e)},f.prototype.end=function(e,t,r){"function"==typeof e&&(r=e,e=void 0),u.Writable.prototype.end.call(this,e,t,r)},f.prototype.setTimeout=function(e,t){var r=this;t&&r.once("timeout",t),r._socketTimeout=e,r._resetTimers(!1)},f.prototype.flushHeaders=function(){},f.prototype.setNoDelay=function(){},f.prototype.setSocketKeepAlive=function(){};var d=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer)},{"./capability":145,"./response":147,_process:121,buffer:22,inherits:47,"readable-stream":162}],147:[function(e,t,r){(function(t,n,i){(function(){var o=e("./capability"),a=e("inherits"),s=e("readable-stream"),u=r.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},l=r.IncomingMessage=function(e,r,n,a){var u=this;if(s.Readable.call(u),u._mode=n,u.headers={},u.rawHeaders=[],u.trailers={},u.rawTrailers=[],u.on("end",(function(){t.nextTick((function(){u.emit("close")}))})),"fetch"===n){if(u._fetchResponse=r,u.url=r.url,u.statusCode=r.status,u.statusMessage=r.statusText,r.headers.forEach((function(e,t){u.headers[t.toLowerCase()]=e,u.rawHeaders.push(t,e)})),o.writableStream){var l=new WritableStream({write:function(e){return a(!1),new Promise((function(t,r){u._destroyed?r():u.push(i.from(e))?t():u._resumeFetch=t}))},close:function(){a(!0),u._destroyed||u.push(null)},abort:function(e){a(!0),u._destroyed||u.emit("error",e)}});try{return void r.body.pipeTo(l).catch((function(e){a(!0),u._destroyed||u.emit("error",e)}))}catch(e){}}var c=r.body.getReader();!function e(){c.read().then((function(t){u._destroyed||(a(t.done),t.done?u.push(null):(u.push(i.from(t.value)),e()))})).catch((function(e){a(!0),u._destroyed||u.emit("error",e)}))}()}else{if(u._xhr=e,u._pos=0,u.url=e.responseURL,u.statusCode=e.status,u.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\r?\n/).forEach((function(e){var t=e.match(/^([^:]+):\s*(.*)/);if(t){var r=t[1].toLowerCase();"set-cookie"===r?(void 0===u.headers[r]&&(u.headers[r]=[]),u.headers[r].push(t[2])):void 0!==u.headers[r]?u.headers[r]+=", "+t[2]:u.headers[r]=t[2],u.rawHeaders.push(t[1],t[2])}})),u._charset="x-user-defined",!o.overrideMimeType){var f=u.rawHeaders["mime-type"];if(f){var d=f.match(/;\s*charset=([^;])(;|$)/);d&&(u._charset=d[1].toLowerCase())}u._charset||(u._charset="utf-8")}}};a(l,s.Readable),l.prototype._read=function(){var e=this._resumeFetch;e&&(this._resumeFetch=null,e())},l.prototype._onXHRProgress=function(e){var t=this,r=t._xhr,o=null;switch(t._mode){case"text":if((o=r.responseText).length>t._pos){var a=o.substr(t._pos);if("x-user-defined"===t._charset){for(var s=i.alloc(a.length),l=0;l<a.length;l++)s[l]=255&a.charCodeAt(l);t.push(s)}else t.push(a,t._charset);t._pos=o.length}break;case"arraybuffer":if(r.readyState!==u.DONE||!r.response)break;o=r.response,t.push(i.from(new Uint8Array(o)));break;case"moz-chunked-arraybuffer":if(o=r.response,r.readyState!==u.LOADING||!o)break;t.push(i.from(new Uint8Array(o)));break;case"ms-stream":if(o=r.response,r.readyState!==u.LOADING)break;var c=new n.MSStreamReader;c.onprogress=function(){c.result.byteLength>t._pos&&(t.push(i.from(new Uint8Array(c.result.slice(t._pos)))),t._pos=c.result.byteLength)},c.onload=function(){e(!0),t.push(null)},c.readAsArrayBuffer(o)}t._xhr.readyState===u.DONE&&"ms-stream"!==t._mode&&(e(!0),t.push(null))}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer)},{"./capability":145,_process:121,buffer:22,inherits:47,"readable-stream":162}],148:[function(e,t,r){arguments[4][130][0].apply(r,arguments)},{dup:130}],149:[function(e,t,r){(function(r){(function(){"use strict";var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=s;const i=e("./_stream_readable"),o=e("./_stream_writable");e("inherits")(s,i);{const e=n(o.prototype);for(var a=0;a<e.length;a++){const t=e[a];s.prototype[t]||(s.prototype[t]=o.prototype[t])}}function s(e){if(!(this instanceof s))return new s(e);i.call(this,e),o.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",u)))}function u(){this._writableState.ended||r.nextTick(l,this)}function l(e){e.end()}Object.defineProperty(s.prototype,"writableHighWaterMark",{enumerable:!1,get(){return this._writableState.highWaterMark}}),Object.defineProperty(s.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(s.prototype,"writableLength",{enumerable:!1,get(){return this._writableState.length}}),Object.defineProperty(s.prototype,"destroyed",{enumerable:!1,get(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})}).call(this)}).call(this,e("_process"))},{"./_stream_readable":151,"./_stream_writable":153,_process:121,inherits:47}],150:[function(e,t,r){arguments[4][132][0].apply(r,arguments)},{"./_stream_transform":152,dup:132,inherits:47}],151:[function(e,t,r){(function(r,n){(function(){"use strict";var i;t.exports=A,A.ReadableState=R;e("events").EventEmitter;var o=function(e,t){return e.listeners(t).length},a=e("./internal/streams/stream");const s=e("buffer").Buffer,u=(void 0!==n?n:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};const l=e("util");let c;c=l&&l.debuglog?l.debuglog("stream"):function(){};const f=e("./internal/streams/buffer_list"),d=e("./internal/streams/destroy"),h=e("./internal/streams/state").getHighWaterMark,p=e("../errors").codes,y=p.ERR_INVALID_ARG_TYPE,b=p.ERR_STREAM_PUSH_AFTER_EOF,g=p.ERR_METHOD_NOT_IMPLEMENTED,m=p.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;let v,w,_;e("inherits")(A,a);const S=d.errorOrDestroy,E=["error","close","destroy","pause","resume"];function R(t,r,n){i=i||e("./_stream_duplex"),t=t||{},"boolean"!=typeof n&&(n=r instanceof i),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=h(this,t,"readableHighWaterMark",n),this.buffer=new f,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(v||(v=e("string_decoder/").StringDecoder),this.decoder=new v(t.encoding),this.encoding=t.encoding)}function A(t){if(i=i||e("./_stream_duplex"),!(this instanceof A))return new A(t);const r=this instanceof i;this._readableState=new R(t,this,r),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),a.call(this)}function j(e,t,r,n,i){c("readableAddChunk",t);var o,a=e._readableState;if(null===t)a.reading=!1,function(e,t){if(c("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?T(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,L(e)))}(e,a);else if(i||(o=function(e,t){var r;n=t,s.isBuffer(n)||n instanceof u||"string"==typeof t||void 0===t||e.objectMode||(r=new y("chunk",["string","Buffer","Uint8Array"],t));var n;return r}(a,t)),o)S(e,o);else if(a.objectMode||t&&t.length>0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),n)a.endEmitted?S(e,new m):O(e,a,t,!0);else if(a.ended)S(e,new b);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?O(e,a,t,!1):I(e,a)):O(e,a,t,!1)}else n||(a.reading=!1,I(e,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function O(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&T(e)),I(e,t)}Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get(){return void 0!==this._readableState&&this._readableState.destroyed},set(e){this._readableState&&(this._readableState.destroyed=e)}}),A.prototype.destroy=d.destroy,A.prototype._undestroy=d.undestroy,A.prototype._destroy=function(e,t){t(e)},A.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=s.from(e,t),t=""),r=!0),j(this,e,t,!1,r)},A.prototype.unshift=function(e){return j(this,e,null,!0,!1)},A.prototype.isPaused=function(){return!1===this._readableState.flowing},A.prototype.setEncoding=function(t){v||(v=e("string_decoder/").StringDecoder);const r=new v(t);this._readableState.decoder=r,this._readableState.encoding=this._readableState.decoder.encoding;let n=this._readableState.buffer.head,i="";for(;null!==n;)i+=r.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};const D=1073741824;function C(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=D?e=D:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function T(e){var t=e._readableState;c("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(c("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick(L,e))}function L(e){var t=e._readableState;c("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,q(e)}function I(e,t){t.readingMore||(t.readingMore=!0,r.nextTick(x,e,t))}function x(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){const r=t.length;if(c("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function U(e){const t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function k(e){c("readable nexttick read 0"),e.read(0)}function M(e,t){c("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),q(e),t.flowing&&!t.reading&&e.read(0)}function q(e){const t=e._readableState;for(c("flow",t.flowing);t.flowing&&null!==e.read(););}function P(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function B(e){var t=e._readableState;c("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(N,t,e))}function N(e,t){if(c("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){const e=t._writableState;(!e||e.autoDestroy&&e.finished)&&t.destroy()}}function F(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}A.prototype.read=function(e){c("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return c("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?B(this):T(this),null;if(0===(e=C(e,t))&&t.ended)return 0===t.length&&B(this),null;var n,i=t.needReadable;return c("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&c("length less than watermark",i=!0),t.ended||t.reading?c("reading or ended",i=!1):i&&(c("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=C(r,t))),null===(n=e>0?P(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&B(this)),null!==n&&this.emit("data",n),n},A.prototype._read=function(e){S(this,new g("_read()"))},A.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,c("pipe count=%d opts=%j",i.pipesCount,t);var a=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?u:b;function s(t,r){c("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,c("cleanup"),e.removeListener("close",p),e.removeListener("finish",y),e.removeListener("drain",l),e.removeListener("error",h),e.removeListener("unpipe",s),n.removeListener("end",u),n.removeListener("end",b),n.removeListener("data",d),f=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function u(){c("onend"),e.end()}i.endEmitted?r.nextTick(a):n.once("end",a),e.on("unpipe",s);var l=function(e){return function(){var t=e._readableState;c("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,q(e))}}(n);e.on("drain",l);var f=!1;function d(t){c("ondata");var r=e.write(t);c("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==F(i.pipes,e))&&!f&&(c("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function h(t){c("onerror",t),b(),e.removeListener("error",h),0===o(e,"error")&&S(e,t)}function p(){e.removeListener("finish",y),b()}function y(){c("onfinish"),e.removeListener("close",p),b()}function b(){c("unpipe"),n.unpipe(e)}return n.on("data",d),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",h),e.once("close",p),e.once("finish",y),e.emit("pipe",n),i.flowing||(c("pipe resume"),n.resume()),e},A.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=F(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},A.prototype.on=function(e,t){const n=a.prototype.on.call(this,e,t),i=this._readableState;return"data"===e?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,c("on readable",i.length,i.reading),i.length?T(this):i.reading||r.nextTick(k,this))),n},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(e,t){const n=a.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(U,this),n},A.prototype.removeAllListeners=function(e){const t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(U,this),t},A.prototype.resume=function(){var e=this._readableState;return e.flowing||(c("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(M,e,t))}(this,e)),e.paused=!1,this},A.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(e){var t=this._readableState,r=!1;for(var n in e.on("end",(()=>{if(c("wrapped end"),t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&this.push(e)}this.push(null)})),e.on("data",(n=>{(c("wrapped data"),t.decoder&&(n=t.decoder.write(n)),t.objectMode&&null==n)||(t.objectMode||n&&n.length)&&(this.push(n)||(r=!0,e.pause()))})),e)void 0===this[n]&&"function"==typeof e[n]&&(this[n]=function(t){return function(){return e[t].apply(e,arguments)}}(n));for(var i=0;i<E.length;i++)e.on(E[i],this.emit.bind(this,E[i]));return this._read=t=>{c("wrapped _read",t),r&&(r=!1,e.resume())},this},"function"==typeof Symbol&&(A.prototype[Symbol.asyncIterator]=function(){return void 0===w&&(w=e("./internal/streams/async_iterator")),w(this)}),Object.defineProperty(A.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(A.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(A.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),A._fromList=P,Object.defineProperty(A.prototype,"readableLength",{enumerable:!1,get(){return this._readableState.length}}),"function"==typeof Symbol&&(A.from=function(t,r){return void 0===_&&(_=e("./internal/streams/from")),_(A,t,r)})}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":148,"./_stream_duplex":149,"./internal/streams/async_iterator":154,"./internal/streams/buffer_list":155,"./internal/streams/destroy":156,"./internal/streams/from":158,"./internal/streams/state":160,"./internal/streams/stream":161,_process:121,buffer:22,events:26,inherits:47,"string_decoder/":163,util:20}],152:[function(e,t,r){arguments[4][134][0].apply(r,arguments)},{"../errors":148,"./_stream_duplex":149,dup:134,inherits:47}],153:[function(e,t,r){(function(r,n){(function(){"use strict";function i(e){this.next=null,this.entry=null,this.finish=()=>{!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}(this,e)}}var o;t.exports=A,A.WritableState=E;const a={deprecate:e("util-deprecate")};var s=e("./internal/streams/stream");const u=e("buffer").Buffer,l=(void 0!==n?n:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};const c=e("./internal/streams/destroy"),f=e("./internal/streams/state").getHighWaterMark,d=e("../errors").codes,h=d.ERR_INVALID_ARG_TYPE,p=d.ERR_METHOD_NOT_IMPLEMENTED,y=d.ERR_MULTIPLE_CALLBACK,b=d.ERR_STREAM_CANNOT_PIPE,g=d.ERR_STREAM_DESTROYED,m=d.ERR_STREAM_NULL_VALUES,v=d.ERR_STREAM_WRITE_AFTER_END,w=d.ERR_UNKNOWN_ENCODING,_=c.errorOrDestroy;function S(){}function E(t,n,a){o=o||e("./_stream_duplex"),t=t||{},"boolean"!=typeof a&&(a=n instanceof o),this.objectMode=!!t.objectMode,a&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=f(this,t,"writableHighWaterMark",a),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===t.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,i=n.sync,o=n.writecb;if("function"!=typeof o)throw new y;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,i,o){--t.pendingcb,n?(r.nextTick(o,i),r.nextTick(L,e,t),e._writableState.errorEmitted=!0,_(e,i)):(o(i),e._writableState.errorEmitted=!0,_(e,i),L(e,t))}(e,n,i,t,o);else{var a=C(n)||e.destroyed;a||n.corked||n.bufferProcessing||!n.bufferedRequest||D(e,n),i?r.nextTick(O,e,n,a,o):O(e,n,a,o)}}(n,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}var R;function A(t){const r=this instanceof(o=o||e("./_stream_duplex"));if(!r&&!R.call(A,this))return new A(t);this._writableState=new E(t,this,r),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),s.call(this)}function j(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new g("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function O(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),L(e,t)}function D(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,o=new Array(n),a=t.corkedRequestsFree;a.entry=r;for(var s=0,u=!0;r;)o[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;o.allBuffers=u,j(e,t,!0,t.length,o,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new i(t),t.bufferedRequestCount=0}else{for(;r;){var l=r.chunk,c=r.encoding,f=r.callback;if(j(e,t,!1,t.objectMode?1:l.length,l,c,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function C(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function T(e,t){e._final((r=>{t.pendingcb--,r&&_(e,r),t.prefinished=!0,e.emit("prefinish"),L(e,t)}))}function L(e,t){var n=C(t);if(n&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,r.nextTick(T,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){const t=e._readableState;(!t||t.autoDestroy&&t.endEmitted)&&e.destroy()}return n}e("inherits")(A,s),E.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(E.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(R=Function.prototype[Symbol.hasInstance],Object.defineProperty(A,Symbol.hasInstance,{value:function(e){return!!R.call(this,e)||this===A&&(e&&e._writableState instanceof E)}})):R=function(e){return e instanceof this},A.prototype.pipe=function(){_(this,new b)},A.prototype.write=function(e,t,n){var i,o=this._writableState,a=!1,s=!o.objectMode&&(i=e,u.isBuffer(i)||i instanceof l);return s&&!u.isBuffer(e)&&(e=function(e){return u.from(e)}(e)),"function"==typeof t&&(n=t,t=null),s?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof n&&(n=S),o.ending?function(e,t){var n=new v;_(e,n),r.nextTick(t,n)}(this,n):(s||function(e,t,n,i){var o;return null===n?o=new m:"string"==typeof n||t.objectMode||(o=new h("chunk",["string","Buffer"],n)),!o||(_(e,o),r.nextTick(i,o),!1)}(this,o,e,n))&&(o.pendingcb++,a=function(e,t,r,n,i,o){if(!r){var a=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=u.from(t,r));return t}(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var l=t.length<t.highWaterMark;l||(t.needDrain=!0);if(t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else j(e,t,!1,s,n,i,o);return l}(this,o,s,e,t,n)),a},A.prototype.cork=function(){this._writableState.corked++},A.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||D(this,e))},A.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(e,t,r){r(new p("_write()"))},A.prototype._writev=null,A.prototype.end=function(e,t,n){var i=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||function(e,t,n){t.ending=!0,L(e,t),n&&(t.finished?r.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,i,n),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get(){return void 0!==this._writableState&&this._writableState.destroyed},set(e){this._writableState&&(this._writableState.destroyed=e)}}),A.prototype.destroy=c.destroy,A.prototype._undestroy=c.undestroy,A.prototype._destroy=function(e,t){t(e)}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":148,"./_stream_duplex":149,"./internal/streams/destroy":156,"./internal/streams/state":160,"./internal/streams/stream":161,_process:121,buffer:22,inherits:47,"util-deprecate":168}],154:[function(e,t,r){(function(r){(function(){"use strict";const n=e("./end-of-stream"),i=Symbol("lastResolve"),o=Symbol("lastReject"),a=Symbol("error"),s=Symbol("ended"),u=Symbol("lastPromise"),l=Symbol("handlePromise"),c=Symbol("stream");function f(e,t){return{value:e,done:t}}function d(e){const t=e[i];if(null!==t){const r=e[c].read();null!==r&&(e[u]=null,e[i]=null,e[o]=null,t(f(r,!1)))}}function h(e){r.nextTick(d,e)}const p=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf({get stream(){return this[c]},next(){const e=this[a];if(null!==e)return Promise.reject(e);if(this[s])return Promise.resolve(f(void 0,!0));if(this[c].destroyed)return new Promise(((e,t)=>{r.nextTick((()=>{this[a]?t(this[a]):e(f(void 0,!0))}))}));const t=this[u];let n;if(t)n=new Promise(function(e,t){return(r,n)=>{e.then((()=>{t[s]?r(f(void 0,!0)):t[l](r,n)}),n)}}(t,this));else{const e=this[c].read();if(null!==e)return Promise.resolve(f(e,!1));n=new Promise(this[l])}return this[u]=n,n},[Symbol.asyncIterator](){return this},return(){return new Promise(((e,t)=>{this[c].destroy(null,(r=>{r?t(r):e(f(void 0,!0))}))}))}},p);t.exports=e=>{const t=Object.create(y,{[c]:{value:e,writable:!0},[i]:{value:null,writable:!0},[o]:{value:null,writable:!0},[a]:{value:null,writable:!0},[s]:{value:e._readableState.endEmitted,writable:!0},[l]:{value:(e,r)=>{const n=t[c].read();n?(t[u]=null,t[i]=null,t[o]=null,e(f(n,!1))):(t[i]=e,t[o]=r)},writable:!0}});return t[u]=null,n(e,(e=>{if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){const r=t[o];return null!==r&&(t[u]=null,t[i]=null,t[o]=null,r(e)),void(t[a]=e)}const r=t[i];null!==r&&(t[u]=null,t[i]=null,t[o]=null,r(f(void 0,!0))),t[s]=!0})),e.on("readable",h.bind(null,t)),t}}).call(this)}).call(this,e("_process"))},{"./end-of-stream":157,_process:121}],155:[function(e,t,r){arguments[4][137][0].apply(r,arguments)},{buffer:22,dup:137,util:20}],156:[function(e,t,r){(function(e){(function(){"use strict";function r(e,t){i(e,t),n(e)}function n(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function i(e,t){e.emit("error",t)}t.exports={destroy:function(t,o){const a=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return a||s?(o?o(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,e.nextTick(i,this,t)):e.nextTick(i,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(t=>{!o&&t?this._writableState?this._writableState.errorEmitted?e.nextTick(n,this):(this._writableState.errorEmitted=!0,e.nextTick(r,this,t)):e.nextTick(r,this,t):o?(e.nextTick(n,this),o(t)):e.nextTick(n,this)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){const r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}}).call(this)}).call(this,e("_process"))},{_process:121}],157:[function(e,t,r){arguments[4][139][0].apply(r,arguments)},{"../../../errors":148,dup:139}],158:[function(e,t,r){arguments[4][140][0].apply(r,arguments)},{dup:140}],159:[function(e,t,r){arguments[4][141][0].apply(r,arguments)},{"../../../errors":148,"./end-of-stream":157,dup:141}],160:[function(e,t,r){arguments[4][142][0].apply(r,arguments)},{"../../../errors":148,dup:142}],161:[function(e,t,r){arguments[4][143][0].apply(r,arguments)},{dup:143,events:26}],162:[function(e,t,r){(r=t.exports=e("./lib/_stream_readable.js")).Stream=r,r.Readable=r,r.Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js"),r.finished=e("./lib/internal/streams/end-of-stream.js"),r.pipeline=e("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":149,"./lib/_stream_passthrough.js":150,"./lib/_stream_readable.js":151,"./lib/_stream_transform.js":152,"./lib/_stream_writable.js":153,"./lib/internal/streams/end-of-stream.js":157,"./lib/internal/streams/pipeline.js":159}],163:[function(e,t,r){"use strict";var n=e("safe-buffer").Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.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!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){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 e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=l,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=c,this.end=f,t=3;break;default:return this.write=d,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function c(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}r.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=a(t[n]);if(i>=0)return i>0&&(e.lastNeed=i-1),i;if(--n<r||-2===i)return 0;if(i=a(t[n]),i>=0)return i>0&&(e.lastNeed=i-2),i;if(--n<r||-2===i)return 0;if(i=a(t[n]),i>=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":126}],164:[function(e,t,r){(function(r){(function(){var n=e("stream");function i(e,t,i){e=e||function(e){this.queue(e)},t=t||function(){this.queue(null)};var o=!1,a=!1,s=[],u=!1,l=new n;function c(){for(;s.length&&!l.paused;){var e=s.shift();if(null===e)return l.emit("end");l.emit("data",e)}}return l.readable=l.writable=!0,l.paused=!1,l.autoDestroy=!(i&&!1===i.autoDestroy),l.write=function(t){return e.call(this,t),!l.paused},l.queue=l.push=function(e){return u||(null===e&&(u=!0),s.push(e),c()),l},l.on("end",(function(){l.readable=!1,!l.writable&&l.autoDestroy&&r.nextTick((function(){l.destroy()}))})),l.end=function(e){if(!o)return o=!0,arguments.length&&l.write(e),l.writable=!1,t.call(l),!l.readable&&l.autoDestroy&&l.destroy(),l},l.destroy=function(){if(!a)return a=!0,o=!0,s.length=0,l.writable=l.readable=!1,l.emit("close"),l},l.pause=function(){if(!l.paused)return l.paused=!0,l},l.resume=function(){return l.paused&&(l.paused=!1,l.emit("resume")),c(),l.paused||l.emit("drain"),l},l}t.exports=i,i.through=i}).call(this)}).call(this,e("_process"))},{_process:121,stream:129}],165:[function(e,t,r){(function(t,n){(function(){var i=e("process/browser.js").nextTick,o=Function.prototype.apply,a=Array.prototype.slice,s={},u=0;function l(e,t){this._id=e,this._clearFn=t}r.setTimeout=function(){return new l(o.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new l(o.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(e){e.close()},l.prototype.unref=l.prototype.ref=function(){},l.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},r.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},r._unrefActive=r.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r.setImmediate="function"==typeof t?t:function(e){var t=u++,n=!(arguments.length<2)&&a.call(arguments,1);return s[t]=!0,i((function(){s[t]&&(n?e.apply(null,n):e.call(null),r.clearImmediate(t))})),t},r.clearImmediate="function"==typeof n?n:function(e){delete s[e]}}).call(this)}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":121,timers:165}],166:[function(e,t,r){"use strict";var n=e("punycode"),i=e("./util");function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}r.parse=v,r.resolve=function(e,t){return v(e,!1,!0).resolve(t)},r.resolveObject=function(e,t){return e?v(e,!1,!0).resolveObject(t):t},r.format=function(e){i.isString(e)&&(e=v(e));return e instanceof o?e.format():o.prototype.format.call(e)},r.Url=o;var a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,l=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(l),f=["%","/","?",";","#"].concat(c),d=["/","?","#"],h=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,y={javascript:!0,"javascript:":!0},b={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},m=e("querystring");function v(e,t,r){if(e&&i.isObject(e)&&e instanceof o)return e;var n=new o;return n.parse(e,t,r),n}o.prototype.parse=function(e,t,r){if(!i.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var o=e.indexOf("?"),s=-1!==o&&o<e.indexOf("#")?"?":"#",l=e.split(s);l[0]=l[0].replace(/\\/g,"/");var v=e=l.join(s);if(v=v.trim(),!r&&1===e.split("#").length){var w=u.exec(v);if(w)return this.path=v,this.href=v,this.pathname=w[1],w[2]?(this.search=w[2],this.query=t?m.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var _=a.exec(v);if(_){var S=(_=_[0]).toLowerCase();this.protocol=S,v=v.substr(_.length)}if(r||_||v.match(/^\/\/[^@\/]+@[^@\/]+/)){var E="//"===v.substr(0,2);!E||_&&b[_]||(v=v.substr(2),this.slashes=!0)}if(!b[_]&&(E||_&&!g[_])){for(var R,A,j=-1,O=0;O<d.length;O++){-1!==(D=v.indexOf(d[O]))&&(-1===j||D<j)&&(j=D)}-1!==(A=-1===j?v.lastIndexOf("@"):v.lastIndexOf("@",j))&&(R=v.slice(0,A),v=v.slice(A+1),this.auth=decodeURIComponent(R)),j=-1;for(O=0;O<f.length;O++){var D;-1!==(D=v.indexOf(f[O]))&&(-1===j||D<j)&&(j=D)}-1===j&&(j=v.length),this.host=v.slice(0,j),v=v.slice(j),this.parseHost(),this.hostname=this.hostname||"";var C="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!C)for(var T=this.hostname.split(/\./),L=(O=0,T.length);O<L;O++){var I=T[O];if(I&&!I.match(h)){for(var x="",U=0,k=I.length;U<k;U++)I.charCodeAt(U)>127?x+="x":x+=I[U];if(!x.match(h)){var M=T.slice(0,O),q=T.slice(O+1),P=I.match(p);P&&(M.push(P[1]),q.unshift(P[2])),q.length&&(v="/"+q.join(".")+v),this.hostname=M.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),C||(this.hostname=n.toASCII(this.hostname));var B=this.port?":"+this.port:"",N=this.hostname||"";this.host=N+B,this.href+=this.host,C&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==v[0]&&(v="/"+v))}if(!y[S])for(O=0,L=c.length;O<L;O++){var F=c[O];if(-1!==v.indexOf(F)){var Q=encodeURIComponent(F);Q===F&&(Q=escape(F)),v=v.split(F).join(Q)}}var $=v.indexOf("#");-1!==$&&(this.hash=v.substr($),v=v.slice(0,$));var H=v.indexOf("?");if(-1!==H?(this.search=v.substr(H),this.query=v.substr(H+1),t&&(this.query=m.parse(this.query)),v=v.slice(0,H)):t&&(this.search="",this.query={}),v&&(this.pathname=v),g[S]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){B=this.pathname||"";var G=this.search||"";this.path=B+G}return this.href=this.format(),this},o.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",o=!1,a="";this.host?o=e+this.host:this.hostname&&(o=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(a=m.stringify(this.query));var s=this.search||a&&"?"+a||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||g[t])&&!1!==o?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o||(o=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),t+o+(r=r.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(s=s.replace("#","%23"))+n},o.prototype.resolve=function(e){return this.resolveObject(v(e,!1,!0)).format()},o.prototype.resolveObject=function(e){if(i.isString(e)){var t=new o;t.parse(e,!1,!0),e=t}for(var r=new o,n=Object.keys(this),a=0;a<n.length;a++){var s=n[a];r[s]=this[s]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var u=Object.keys(e),l=0;l<u.length;l++){var c=u[l];"protocol"!==c&&(r[c]=e[c])}return g[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!g[e.protocol]){for(var f=Object.keys(e),d=0;d<f.length;d++){var h=f[d];r[h]=e[h]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||b[e.protocol])r.pathname=e.pathname;else{for(var p=(e.pathname||"").split("/");p.length&&!(e.host=p.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==p[0]&&p.unshift(""),p.length<2&&p.unshift(""),r.pathname=p.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var y=r.pathname||"",m=r.search||"";r.path=y+m}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var v=r.pathname&&"/"===r.pathname.charAt(0),w=e.host||e.pathname&&"/"===e.pathname.charAt(0),_=w||v||r.host&&e.pathname,S=_,E=r.pathname&&r.pathname.split("/")||[],R=(p=e.pathname&&e.pathname.split("/")||[],r.protocol&&!g[r.protocol]);if(R&&(r.hostname="",r.port=null,r.host&&(""===E[0]?E[0]=r.host:E.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===p[0]?p[0]=e.host:p.unshift(e.host)),e.host=null),_=_&&(""===p[0]||""===E[0])),w)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,E=p;else if(p.length)E||(E=[]),E.pop(),E=E.concat(p),r.search=e.search,r.query=e.query;else if(!i.isNullOrUndefined(e.search)){if(R)r.hostname=r.host=E.shift(),(C=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=C.shift(),r.host=r.hostname=C.shift());return r.search=e.search,r.query=e.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!E.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var A=E.slice(-1)[0],j=(r.host||e.host||E.length>1)&&("."===A||".."===A)||""===A,O=0,D=E.length;D>=0;D--)"."===(A=E[D])?E.splice(D,1):".."===A?(E.splice(D,1),O++):O&&(E.splice(D,1),O--);if(!_&&!S)for(;O--;O)E.unshift("..");!_||""===E[0]||E[0]&&"/"===E[0].charAt(0)||E.unshift(""),j&&"/"!==E.join("/").substr(-1)&&E.push("");var C,T=""===E[0]||E[0]&&"/"===E[0].charAt(0);R&&(r.hostname=r.host=T?"":E.length?E.shift():"",(C=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=C.shift(),r.host=r.hostname=C.shift()));return(_=_||r.host&&E.length)&&!T&&E.unshift(""),E.length?r.pathname=E.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},{"./util":167,punycode:122,querystring:125}],167:[function(e,t,r){"use strict";t.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},{}],168:[function(e,t,r){(function(e){(function(){function r(t){try{if(!e.localStorage)return!1}catch(e){return!1}var r=e.localStorage[t];return null!=r&&"true"===String(r).toLowerCase()}t.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],169:[function(e,t,r){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],170:[function(e,t,r){"use strict";var n=e("is-arguments"),i=e("is-generator-function"),o=e("which-typed-array"),a=e("is-typed-array");function s(e){return e.call.bind(e)}var u="undefined"!=typeof BigInt,l="undefined"!=typeof Symbol,c=s(Object.prototype.toString),f=s(Number.prototype.valueOf),d=s(String.prototype.valueOf),h=s(Boolean.prototype.valueOf);if(u)var p=s(BigInt.prototype.valueOf);if(l)var y=s(Symbol.prototype.valueOf);function b(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function g(e){return"[object Map]"===c(e)}function m(e){return"[object Set]"===c(e)}function v(e){return"[object WeakMap]"===c(e)}function w(e){return"[object WeakSet]"===c(e)}function _(e){return"[object ArrayBuffer]"===c(e)}function S(e){return"undefined"!=typeof ArrayBuffer&&(_.working?_(e):e instanceof ArrayBuffer)}function E(e){return"[object DataView]"===c(e)}function R(e){return"undefined"!=typeof DataView&&(E.working?E(e):e instanceof DataView)}r.isArgumentsObject=n,r.isGeneratorFunction=i,r.isTypedArray=a,r.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},r.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):a(e)||R(e)},r.isUint8Array=function(e){return"Uint8Array"===o(e)},r.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===o(e)},r.isUint16Array=function(e){return"Uint16Array"===o(e)},r.isUint32Array=function(e){return"Uint32Array"===o(e)},r.isInt8Array=function(e){return"Int8Array"===o(e)},r.isInt16Array=function(e){return"Int16Array"===o(e)},r.isInt32Array=function(e){return"Int32Array"===o(e)},r.isFloat32Array=function(e){return"Float32Array"===o(e)},r.isFloat64Array=function(e){return"Float64Array"===o(e)},r.isBigInt64Array=function(e){return"BigInt64Array"===o(e)},r.isBigUint64Array=function(e){return"BigUint64Array"===o(e)},g.working="undefined"!=typeof Map&&g(new Map),r.isMap=function(e){return"undefined"!=typeof Map&&(g.working?g(e):e instanceof Map)},m.working="undefined"!=typeof Set&&m(new Set),r.isSet=function(e){return"undefined"!=typeof Set&&(m.working?m(e):e instanceof Set)},v.working="undefined"!=typeof WeakMap&&v(new WeakMap),r.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(v.working?v(e):e instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),r.isWeakSet=function(e){return w(e)},_.working="undefined"!=typeof ArrayBuffer&&_(new ArrayBuffer),r.isArrayBuffer=S,E.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&E(new DataView(new ArrayBuffer(1),0,1)),r.isDataView=R;var A="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function j(e){return"[object SharedArrayBuffer]"===c(e)}function O(e){return void 0!==A&&(void 0===j.working&&(j.working=j(new A)),j.working?j(e):e instanceof A)}function D(e){return b(e,f)}function C(e){return b(e,d)}function T(e){return b(e,h)}function L(e){return u&&b(e,p)}function I(e){return l&&b(e,y)}r.isSharedArrayBuffer=O,r.isAsyncFunction=function(e){return"[object AsyncFunction]"===c(e)},r.isMapIterator=function(e){return"[object Map Iterator]"===c(e)},r.isSetIterator=function(e){return"[object Set Iterator]"===c(e)},r.isGeneratorObject=function(e){return"[object Generator]"===c(e)},r.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===c(e)},r.isNumberObject=D,r.isStringObject=C,r.isBooleanObject=T,r.isBigIntObject=L,r.isSymbolObject=I,r.isBoxedPrimitive=function(e){return D(e)||C(e)||T(e)||L(e)||I(e)},r.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(S(e)||O(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(e){Object.defineProperty(r,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})}))},{"is-arguments":48,"is-generator-function":50,"is-typed-array":55,"which-typed-array":172}],171:[function(e,t,r){(function(t){(function(){var n=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++)r[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return r},i=/%[sdj%]/g;r.format=function(e){if(!m(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(u(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,o=n.length,a=String(e).replace(i,(function(e){if("%%"===e)return"%";if(r>=o)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),s=n[r];r<o;s=n[++r])b(s)||!_(s)?a+=" "+s:a+=" "+u(s);return a},r.deprecate=function(e,n){if(void 0!==t&&!0===t.noDeprecation)return e;if(void 0===t)return function(){return r.deprecate(e,n).apply(this,arguments)};var i=!1;return function(){if(!i){if(t.throwDeprecation)throw new Error(n);t.traceDeprecation?console.trace(n):console.error(n),i=!0}return e.apply(this,arguments)}};var o={},a=/^$/;if(t.env.NODE_DEBUG){var s=t.env.NODE_DEBUG;s=s.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),a=new RegExp("^"+s+"$","i")}function u(e,t){var n={seen:[],stylize:c};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),y(t)?n.showHidden=t:t&&r._extend(n,t),v(n.showHidden)&&(n.showHidden=!1),v(n.depth)&&(n.depth=2),v(n.colors)&&(n.colors=!1),v(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=l),f(n,e,n.depth)}function l(e,t){var r=u.styles[t];return r?"["+u.colors[r][0]+"m"+e+"["+u.colors[r][1]+"m":e}function c(e,t){return e}function f(e,t,n){if(e.customInspect&&t&&R(t.inspect)&&t.inspect!==r.inspect&&(!t.constructor||t.constructor.prototype!==t)){var i=t.inspect(n,e);return m(i)||(i=f(e,i,n)),i}var o=function(e,t){if(v(t))return e.stylize("undefined","undefined");if(m(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(g(t))return e.stylize(""+t,"number");if(y(t))return e.stylize(""+t,"boolean");if(b(t))return e.stylize("null","null")}(e,t);if(o)return o;var a=Object.keys(t),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(t)),E(t)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return d(t);if(0===a.length){if(R(t)){var u=t.name?": "+t.name:"";return e.stylize("[Function"+u+"]","special")}if(w(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(S(t))return e.stylize(Date.prototype.toString.call(t),"date");if(E(t))return d(t)}var l,c="",_=!1,A=["{","}"];(p(t)&&(_=!0,A=["[","]"]),R(t))&&(c=" [Function"+(t.name?": "+t.name:"")+"]");return w(t)&&(c=" "+RegExp.prototype.toString.call(t)),S(t)&&(c=" "+Date.prototype.toUTCString.call(t)),E(t)&&(c=" "+d(t)),0!==a.length||_&&0!=t.length?n<0?w(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),l=_?function(e,t,r,n,i){for(var o=[],a=0,s=t.length;a<s;++a)D(t,String(a))?o.push(h(e,t,r,n,String(a),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(h(e,t,r,n,i,!0))})),o}(e,t,n,s,a):a.map((function(r){return h(e,t,n,s,r,_)})),e.seen.pop(),function(e,t,r){var n=e.reduce((function(e,t){return t.indexOf("\n")>=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0);if(n>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(l,c,A)):A[0]+c+A[1]}function d(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,r,n,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),D(n,i)||(a="["+i+"]"),s||(e.seen.indexOf(u.value)<0?(s=b(r)?f(e,u.value,null):f(e,u.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(e){return" "+e})).join("\n").slice(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),v(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.slice(1,-1),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function p(e){return Array.isArray(e)}function y(e){return"boolean"==typeof e}function b(e){return null===e}function g(e){return"number"==typeof e}function m(e){return"string"==typeof e}function v(e){return void 0===e}function w(e){return _(e)&&"[object RegExp]"===A(e)}function _(e){return"object"==typeof e&&null!==e}function S(e){return _(e)&&"[object Date]"===A(e)}function E(e){return _(e)&&("[object Error]"===A(e)||e instanceof Error)}function R(e){return"function"==typeof e}function A(e){return Object.prototype.toString.call(e)}function j(e){return e<10?"0"+e.toString(10):e.toString(10)}r.debuglog=function(e){if(e=e.toUpperCase(),!o[e])if(a.test(e)){var n=t.pid;o[e]=function(){var t=r.format.apply(r,arguments);console.error("%s %d: %s",e,n,t)}}else o[e]=function(){};return o[e]},r.inspect=u,u.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]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},r.types=e("./support/types"),r.isArray=p,r.isBoolean=y,r.isNull=b,r.isNullOrUndefined=function(e){return null==e},r.isNumber=g,r.isString=m,r.isSymbol=function(e){return"symbol"==typeof e},r.isUndefined=v,r.isRegExp=w,r.types.isRegExp=w,r.isObject=_,r.isDate=S,r.types.isDate=S,r.isError=E,r.types.isNativeError=E,r.isFunction=R,r.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},r.isBuffer=e("./support/isBuffer");var O=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function D(e,t){return Object.prototype.hasOwnProperty.call(e,t)}r.log=function(){var e,t;console.log("%s - %s",(e=new Date,t=[j(e.getHours()),j(e.getMinutes()),j(e.getSeconds())].join(":"),[e.getDate(),O[e.getMonth()],t].join(" ")),r.format.apply(r,arguments))},r.inherits=e("inherits"),r._extend=function(e,t){if(!t||!_(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var C="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function T(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}r.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(C&&e[C]){var t;if("function"!=typeof(t=e[C]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,C,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push((function(e,n){e?r(e):t(n)}));try{e.apply(this,i)}catch(e){r(e)}return n}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),C&&Object.defineProperty(t,C,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,n(e))},r.promisify.custom=C,r.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function r(){for(var r=[],n=0;n<arguments.length;n++)r.push(arguments[n]);var i=r.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var o=this,a=function(){return i.apply(o,arguments)};e.apply(this,r).then((function(e){t.nextTick(a.bind(null,null,e))}),(function(e){t.nextTick(T.bind(null,e,a))}))}return Object.setPrototypeOf(r,Object.getPrototypeOf(e)),Object.defineProperties(r,n(e)),r}}).call(this)}).call(this,e("_process"))},{"./support/isBuffer":169,"./support/types":170,_process:121,inherits:47}],172:[function(e,t,r){(function(r){(function(){"use strict";var n=e("for-each"),i=e("available-typed-arrays"),o=e("call-bind/callBound"),a=e("gopd"),s=o("Object.prototype.toString"),u=e("has-tostringtag/shams")(),l="undefined"==typeof globalThis?r:globalThis,c=i(),f=o("String.prototype.slice"),d={},h=Object.getPrototypeOf;u&&a&&h&&n(c,(function(e){if("function"==typeof l[e]){var t=new l[e];if(Symbol.toStringTag in t){var r=h(t),n=a(r,Symbol.toStringTag);if(!n){var i=h(r);n=a(i,Symbol.toStringTag)}d[e]=n.get}}}));var p=e("is-typed-array");t.exports=function(e){return!!p(e)&&(u&&Symbol.toStringTag in e?function(e){var t=!1;return n(d,(function(r,n){if(!t)try{var i=r.call(e);i===n&&(t=i)}catch(e){}})),t}(e):f(s(e),8,-1))}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"available-typed-arrays":18,"call-bind/callBound":24,"for-each":27,gopd:40,"has-tostringtag/shams":43,"is-typed-array":55}],173:[function(e,t,r){t.exports=function e(t,r){if(t&&r)return e(t)(r);if("function"!=typeof t)throw new TypeError("need wrapper function");return Object.keys(t).forEach((function(e){n[e]=t[e]})),n;function n(){for(var e=new Array(arguments.length),r=0;r<e.length;r++)e[r]=arguments[r];var n=t.apply(this,e),i=e[e.length-1];return"function"==typeof n&&n!==i&&Object.keys(i).forEach((function(e){n[e]=i[e]})),n}}},{}],174:[function(e,t,r){t.exports=function(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var i in r)n.call(r,i)&&(e[i]=r[i])}return e};var n=Object.prototype.hasOwnProperty},{}],175:[function(e,t,r){
|
|
69
|
+
/**
|
|
70
|
+
* Simple browser shim loader - assign the npm module to a window global automatically
|
|
71
|
+
*
|
|
72
|
+
* @license MIT
|
|
73
|
+
* @author <steven@velozo.com>
|
|
74
|
+
*/
|
|
75
|
+
var n=e("./Meadow-Endpoints.js");"object"!=typeof window||window.hasOwnProperty("MeadowEndpoints")||(window.MeadowEndpoints=n),t.exports=n},{"./Meadow-Endpoints.js":176}],176:[function(e,t,r){
|
|
76
|
+
/**
|
|
77
|
+
* Meadow Endpoints Service Data Broker Library
|
|
78
|
+
*
|
|
79
|
+
* @license MIT
|
|
80
|
+
* @author Steven Velozo <steven@velozo.com>
|
|
81
|
+
*/
|
|
82
|
+
const n=e("./controller/Meadow-Endpoints-Controller-Base.js"),i=e("meadow");class o{constructor(t,r){if(this._Meadow=t,this.DAL=this._Meadow,this._Controller=!1,this._ControllerOptions="object"==typeof r?r:{},"object"!=typeof t)throw new Error("Meadow endpoints requires a valid Meadow DAL object as the first parameter of the constructor.");this._ControllerOptions.hasOwnProperty("ControllerInstance")?this._Controller=this._ControllerOptions.ControllerInstance:this._ControllerOptions.hasOwnProperty("ControllerClass")?this._Controller=new this._ControllerOptions.ControllerClass(this):this._Controller=new n(this),this.EndpointVersion=this._Controller.settings.MeadowEndpointVersion||"1.0",this.EndpointName=this.DAL.scope,this.EndpointPrefix=`/${this.EndpointVersion}/${this.EndpointName}`,this._EnabledBehaviorSets={Create:!0,Read:!0,Reads:!0,Update:!0,Delete:!0,Count:!0,Schema:!0,Validate:!0,New:!0},this._Endpoints={Create:e("./endpoints/create/Meadow-Endpoint-Create.js"),Creates:e("./endpoints/create/Meadow-Endpoint-BulkCreate.js"),Read:e("./endpoints/read/Meadow-Endpoint-Read.js"),ReadMax:e("./endpoints/read/Meadow-Endpoint-ReadMax.js"),Reads:e("./endpoints/read/Meadow-Endpoint-Reads.js"),ReadsBy:e("./endpoints/read/Meadow-Endpoint-ReadsBy.js"),ReadSelectList:e("./endpoints/read/Meadow-Endpoint-ReadSelectList.js"),ReadLiteList:e("./endpoints/read/Meadow-Endpoint-ReadLiteList.js"),ReadDistinctList:e("./endpoints/read/Meadow-Endpoint-ReadDistinctList.js"),Update:e("./endpoints/update/Meadow-Endpoint-Update.js"),Updates:e("./endpoints/update/Meadow-Endpoint-BulkUpdate.js"),Upsert:e("./endpoints/upsert/Meadow-Endpoint-Upsert.js"),Upserts:e("./endpoints/upsert/Meadow-Endpoint-BulkUpsert.js"),Delete:e("./endpoints/delete/Meadow-Endpoint-Delete.js"),Undelete:e("./endpoints/delete/Meadow-Endpoint-Undelete.js"),Count:e("./endpoints/count/Meadow-Endpoint-Count.js"),CountBy:e("./endpoints/count/Meadow-Endpoint-CountBy.js"),Schema:e("./endpoints/schema/Meadow-Endpoint-Schema.js"),Validate:e("./endpoints/schema/Meadow-Endpoint-Validate.js"),New:e("./endpoints/schema/Meadow-Endpoint-New.js")}}get controller(){return this._Controller}set controller(e){this._Controller=e}setBehaviorEndpoint(e,t){return"function"==typeof t&&(this._Endpoints[e]=t),this}connectRoute(e,t,r,n,i){let o=`${this.EndpointPrefix}${r}`,a="string"==typeof i?i:"an unnamed custom behavior";this._Controller.log.trace(`...meadow-endpoints mapping a ${t} endpoint for scope ${this.DAL.scope} on route [${o}] which runs ${a}.`);try{e[t](o,n.bind(this._Controller))}catch(e){this._Controller.log.error(`...error mapping ${i} to method ${t} for scope ${this.DAL.scope} to route [${o}]: ${e}`,e.stack)}return!0}connectRoutes(e){this._Controller.log.trace(`Creating automatic meadow endpoints at prefix [${this.EndpointPrefix}] for scope ${this.DAL.scope}...`),this._EnabledBehaviorSets.Schema&&this.connectRoute(e,"get","/Schema",this._Endpoints.Schema,"the internal behavior _Endpoints.Schema"),this._EnabledBehaviorSets.New&&this.connectRoute(e,"get","/Schema/New",this._Endpoints.New,"the internal behavior _Endpoints.New"),this._EnabledBehaviorSets.Validate&&this.connectRoute(e,"post","/Schema/Validate",this._Endpoints.Validate,"the internal behavior _Endpoints.Validate"),this._EnabledBehaviorSets.Create&&(this.connectRoute(e,"post","",this._Endpoints.Create,"the internal behavior _Endpoints.Create"),this.connectRoute(e,"post","s",this._Endpoints.Creates,"the internal behavior _Endpoints.Creates")),this._EnabledBehaviorSets.Read&&(this.connectRoute(e,"get","/Max/:ColumnName",this._Endpoints.ReadMax,"the internal behavior _Endpoints.ReadMax"),this.connectRoute(e,"get","/:IDRecord",this._Endpoints.Read,"the internal behavior _Endpoints.Read")),this._EnabledBehaviorSets.Reads&&(this.connectRoute(e,"get","s",this._Endpoints.Reads,"the internal behavior _Endpoints.Reads"),this.connectRoute(e,"get","s/By/:ByField/:ByValue",this._Endpoints.ReadsBy,"the internal behavior _Endpoints.ReadsBy"),this.connectRoute(e,"get","s/By/:ByField/:ByValue/:Begin/:Cap",this._Endpoints.ReadsBy,"the internal behavior _Endpoints.ReadsBy"),this.connectRoute(e,"get","s/FilteredTo/:Filter",this._Endpoints.Reads,"the internal behavior _Endpoints.Reads"),this.connectRoute(e,"get","s/FilteredTo/:Filter/:Begin/:Cap",this._Endpoints.Reads,"the internal behavior _Endpoints.Reads"),this.connectRoute(e,"get","Select",this._Endpoints.ReadSelectList,"the internal behavior _Endpoints.ReadSelectList"),this.connectRoute(e,"get","Select/FilteredTo/:Filter",this._Endpoints.ReadSelectList,"the internal behavior _Endpoints.ReadSelectList"),this.connectRoute(e,"get","Select/FilteredTo/:Filter/:Begin/:Cap",this._Endpoints.ReadSelectList,"the internal behavior _Endpoints.ReadSelectList"),this.connectRoute(e,"get","Select/:Begin/:Cap",this._Endpoints.ReadSelectList,"the internal behavior _Endpoints.ReadSelectList"),this.connectRoute(e,"get","s/Lite",this._Endpoints.ReadLiteList,"the internal behavior _Endpoints.ReadLiteList"),this.connectRoute(e,"get","s/Lite/FilteredTo/:Filter",this._Endpoints.ReadLiteList,"the internal behavior _Endpoints.ReadLiteList"),this.connectRoute(e,"get","s/Lite/FilteredTo/:Filter/:Begin/:Cap",this._Endpoints.ReadLiteList,"the internal behavior _Endpoints.ReadLiteList"),this.connectRoute(e,"get","s/Lite/:Begin/:Cap",this._Endpoints.ReadLiteList,"the internal behavior _Endpoints.ReadLiteList"),this.connectRoute(e,"get","s/LiteExtended/:ExtraColumns",this._Endpoints.ReadLiteList,"the internal behavior _Endpoints.ReadLiteList"),this.connectRoute(e,"get","s/LiteExtended/:ExtraColumns/FilteredTo/:Filter",this._Endpoints.ReadLiteList,"the internal behavior _Endpoints.ReadLiteList"),this.connectRoute(e,"get","s/LiteExtended/:ExtraColumns/FilteredTo/:Filter/:Begin/:Cap",this._Endpoints.ReadLiteList,"the internal behavior _Endpoints.ReadLiteList"),this.connectRoute(e,"get","s/LiteExtended/:ExtraColumns/:Begin/:Cap",this._Endpoints.ReadLiteList,"the internal behavior _Endpoints.ReadLiteList"),this.connectRoute(e,"get","s/Distinct/:Columns",this._Endpoints.ReadDistinctList,"the internal behavior _Endpoints.ReadDistinctList"),this.connectRoute(e,"get","s/Distinct/:Columns/FilteredTo/:Filter",this._Endpoints.ReadDistinctList,"the internal behavior _Endpoints.ReadDistinctList"),this.connectRoute(e,"get","s/Distinct/:Columns/FilteredTo/:Filter/:Begin/:Cap",this._Endpoints.ReadDistinctList,"the internal behavior _Endpoints.ReadDistinctList"),this.connectRoute(e,"get","s/Distinct/:Columns/:Begin/:Cap",this._Endpoints.ReadDistinctList,"the internal behavior _Endpoints.ReadDistinctList"),this.connectRoute(e,"get","s/:Begin/:Cap",this._Endpoints.Reads,"the internal behavior _Endpoints.Reads")),this._EnabledBehaviorSets.Update&&(this.connectRoute(e,"put","",this._Endpoints.Update,"the internal behavior _Endpoints.Update"),this.connectRoute(e,"put","s",this._Endpoints.Updates,"the internal behavior _Endpoints.Updates"),this.connectRoute(e,"put","/Upsert",this._Endpoints.Upsert,"the internal behavior _Endpoints.Upsert"),this.connectRoute(e,"put","/Upserts",this._Endpoints.Upserts,"the internal behavior _Endpoints.Upserts")),this._EnabledBehaviorSets.Delete&&(this.connectRoute(e,"del","",this._Endpoints.Delete,"the internal behavior _Endpoints.Delete"),this.connectRoute(e,"del","/:IDRecord",this._Endpoints.Delete,"the internal behavior _Endpoints.Delete"),this.connectRoute(e,"get","/Undelete/:IDRecord",this._Endpoints.Undelete,"the internal behavior _Endpoints.Undelete")),this._EnabledBehaviorSets.Count&&(this.connectRoute(e,"get","s/Count",this._Endpoints.Count,"the internal behavior _Endpoints.Count"),this.connectRoute(e,"get","s/Count/By/:ByField/:ByValue",this._Endpoints.CountBy,"the internal behavior _Endpoints.CountBy"),this.connectRoute(e,"get","s/Count/FilteredTo/:Filter",this._Endpoints.Count,"the internal behavior _Endpoints.Count"))}}t.exports=o,t.exports.new=function(e,t){return new o(e,t)},t.exports.Meadow=i,t.exports.BaseController=n},{"./controller/Meadow-Endpoints-Controller-Base.js":177,"./endpoints/count/Meadow-Endpoint-Count.js":184,"./endpoints/count/Meadow-Endpoint-CountBy.js":185,"./endpoints/create/Meadow-Endpoint-BulkCreate.js":186,"./endpoints/create/Meadow-Endpoint-Create.js":187,"./endpoints/delete/Meadow-Endpoint-Delete.js":189,"./endpoints/delete/Meadow-Endpoint-Undelete.js":190,"./endpoints/read/Meadow-Endpoint-Read.js":191,"./endpoints/read/Meadow-Endpoint-ReadDistinctList.js":192,"./endpoints/read/Meadow-Endpoint-ReadLiteList.js":193,"./endpoints/read/Meadow-Endpoint-ReadMax.js":194,"./endpoints/read/Meadow-Endpoint-ReadSelectList.js":195,"./endpoints/read/Meadow-Endpoint-Reads.js":196,"./endpoints/read/Meadow-Endpoint-ReadsBy.js":197,"./endpoints/schema/Meadow-Endpoint-New.js":200,"./endpoints/schema/Meadow-Endpoint-Schema.js":201,"./endpoints/schema/Meadow-Endpoint-Validate.js":202,"./endpoints/update/Meadow-Endpoint-BulkUpdate.js":203,"./endpoints/update/Meadow-Endpoint-Update.js":204,"./endpoints/upsert/Meadow-Endpoint-BulkUpsert.js":206,"./endpoints/upsert/Meadow-Endpoint-Upsert.js":207,meadow:108}],177:[function(e,t,r){e("async/waterfall");const n=e("./components/Meadow-Endpoints-Controller-Log.js"),i=e("./components/Meadow-Endpoints-Controller-Error.js"),o=e("./components/Meadow-Endpoints-Controller-BehaviorInjection.js"),a=e("./utility/Meadow-Endpoints-Filter-Parser.js"),s=e("./utility/Meadow-Endpoints-Session-Marshaler.js"),u=e("./utility/Meadow-Endpoints-Stream-RecordArray.js");t.exports=class{constructor(e){this.DAL=e.DAL,this.ControllerOptions=e._ControllerOptions,this._Settings=!1,this._LogController=!1,this._BehaviorInjectionController=!1,this._ErrorController=!1,this.waterfall=this.DAL.fable.Utility.waterfall,this.eachLimit=this.DAL.fable.Utility.eachLimit,this.extend=this.DAL.fable.Utility.extend,("object"!=typeof pControllerOptions||pControllerOptions.hasOwnProperty("ControllerClass"))&&this.initializeDefaultUnsetControllers(this),this._FilterParser=new a(this),this._SessionMarshaler=new s(this),this._StreamRecordArray=new u(this)}initializeDefaultUnsetControllers(e){this._Settings||(this._Settings=e.DAL.fable.settings),this._Settings.hasOwnProperty("MeadowEndpointsDefaultSessionObject")||(this._Settings.MeadowEndpointsDefaultSessionObject={CustomerID:0,SessionID:"0x0000",DeviceID:"Unset",UserID:0,UserRole:"None",UserRoleIndex:0,LoggedIn:!1}),this._LogController||(this._LogController=new n(e)),this._BehaviorInjectionController||(this._BehaviorInjectionController=new o(e)),this._ErrorController||(this._ErrorController=new i(e))}initializeRequestState(e,t){let r={};return r.Verb="string"==typeof t?t:"Unnamed_Custom_Behavior",r.SessionData=this.getSessionData(e),r}cloneAsyncSafeRequestState(e,t){let r={ParentRequestState:e,SessionData:e.SessionData};return r.Verb="string"==typeof t?pVerb:e.Verb,r}_BeginDataRequestFunction(e,t,r){return r()}beginMeadowRequest(e,t,r){this._BeginDataRequestFunction(e,t,r)}_EndDataRequestFunction(e,t,r){return r()}endMeadowRequest(e,t,r){this._EndDataRequestFunction(e,t,r)}get settings(){return this._Settings}set settings(e){this._Settings=e}get log(){return this._LogController}set log(e){this._LogController=e}get BehaviorInjection(){return this._BehaviorInjectionController}set BehaviorInjection(e){this._BehaviorInjectionController=e}get ErrorHandler(){return this._ErrorController}set ErrorHandler(e){this._ErrorController=e}parseFilter(e,t){return this._FilterParser.parseFilter(e,t)}doStreamRecordArray(e,t,r){return this._StreamRecordArray.streamRecordArray(e,t,r)}getSessionData(e){return this._SessionMarshaler.getSessionData(e)}},t.exports.BaseErrorController=i,t.exports.BaseBehaviorInjectionController=o,t.exports.BaseFilterParser=a,t.exports.BaseSessionMarshaler=s,t.exports.BaseStreamRecordArray=u},{"./components/Meadow-Endpoints-Controller-BehaviorInjection.js":178,"./components/Meadow-Endpoints-Controller-Error.js":179,"./components/Meadow-Endpoints-Controller-Log.js":180,"./utility/Meadow-Endpoints-Filter-Parser.js":181,"./utility/Meadow-Endpoints-Session-Marshaler.js":182,"./utility/Meadow-Endpoints-Stream-RecordArray.js":183,"async/waterfall":17}],178:[function(e,t,r){t.exports=class{constructor(e){this._Controller=e,this.template=this._Controller.DAL.fable.Utility.template,this._BehaviorFunctions={},this._Templates={},this._TemplateFunctions={}}setBehavior(e,t){this._BehaviorFunctions[e]=t}runBehavior(e,t,r,n,i){if(this._BehaviorFunctions.hasOwnProperty(e))try{return this._BehaviorFunctions[e].call(t,r,n,i)}catch(e){return i(e)}return i()}getTemplate(e){return!!this._Templates.hasOwnProperty(e)&&this._Templates[e]}setTemplate(e,t){this._Templates[e]=t,this._TemplateFunctions[e]=this.template(t)}getTemplateFunction(e){return!!this._TemplateFunctions.hasOwnProperty(e)&&this._TemplateFunctions[e]}processTemplate(e,t,r){var n=this.getTemplateFunction(e),i=void 0===t?{}:t;return!1===n&&(this.setTemplate(e,void 0===r?"":r),n=this.getTemplateFunction(e)),n(i)}}},{}],179:[function(e,t,r){t.exports=class{constructor(e){this._Controller=e}getError(e,t,r){let n=new Error(e);return n.StatusCode="number"==typeof t?t:400,n.SuppressSoftwareTrace=void 0===r||r,n}handleErrorIfSet(e,t,r,n,i){return n?this.sendError(e,t,r,n,i):i()}sendError(e,t,r,n,i){if(this._Controller.log.logRequestError(e,t,n),!this._Controller.ControllerOptions.SendErrorStatusCodes){let e=n.hasOwnProperty("StatusCode")?n.StatusCode:500;r.status(e)}let o={Error:n.message,StatusCode:n.StatusCode};o=this._Controller.ErrorHandler.prepareRequestContextOutputObject(o,e,t,n),r.send(o),i(n)}prepareRequestContextOutputObject(e,t,r,n){if(n&&(e.Error=n.message,e.Code=n.code,e.StatusCode=n.StatusCode,n.SuppressSoftwareTrace||(e.Stack=n.stack),r.hasOwnProperty("Record")&&(e.Record=r.Record),r.hasOwnProperty("Query")&&"object"==typeof r.Query&&r.Query.query&&("string"==typeof r.Query.query.body&&(e.Query=r.Query.query.body),"object"==typeof r.Query.query.parameters))){e.QueryParameters=r.Query.query.parameters,e.RebuiltQueryString="string"==typeof e.Query?e.Query:"";let t=Object.keys(e.QueryParameters);for(let r=0;r<t.length;r++)if("number"==typeof t[r])e.RebuiltQueryString=e.RebuiltQueryString.replace(new RegExp(`:${t[r]}\\b`,"g"),`'${e.QueryParameters[t[r]]}'`);else e.RebuiltQueryString=e.RebuiltQueryString.replace(new RegExp(`:${t[r]}\\b`,"g"),e.QueryParameters[t[r]])}return e}}},{}],180:[function(e,t,r){t.exports=class{constructor(e){this._Controller=e}requestCompletedSuccessfully(e,t,r){this._Controller.log.info(r,{SessionID:t.SessionData.SessionID,RequestID:e.RequestUUID,RequestURL:e.url,Scope:this._Controller.DAL.scope,Action:`${this._Controller.DAL.scope}-${t.Verb}`,Verb:t.Verb})}logRequestError(e,t,r){let n={SessionID:t.SessionData.SessionID,RequestID:e.RequestUUID,RequestURL:e.url,Scope:this._Controller.DAL.scope,Action:`${this._Controller.DAL.scope}-${t.Verb}`,Verb:t.Verb};n=this._Controller.ErrorHandler.prepareRequestContextOutputObject(n,e,t,r),this._Controller.log.error(r.message,n)}trace(e,t){this._Controller.DAL.log.trace(e,t)}debug(e,t){this._Controller.DAL.log.debug(e,t)}info(e,t){this._Controller.DAL.log.info(e,t)}warn(e,t){this._Controller.DAL.log.warn(e,t)}error(e,t){this._Controller.DAL.log.error(e,t)}fatal(e,t){this._Controller.DAL.log.fatal(e,t)}}},{}],181:[function(e,t,r){t.exports=
|
|
83
|
+
/**
|
|
84
|
+
* Meadow Endpoint Utility Class - Parse a Filter String and put it into a Query.
|
|
85
|
+
*
|
|
86
|
+
* @license MIT
|
|
87
|
+
*
|
|
88
|
+
* @author Steven Velozo <steven@velozo.com>
|
|
89
|
+
* @module Meadow
|
|
90
|
+
*/
|
|
91
|
+
class{constructor(e){this._Controller=e}getFilterComparisonOperator(e){let t="=";switch(e){case"EQ":t="=";break;case"NE":t="!=";break;case"GT":t=">";break;case"GE":t=">=";break;case"LT":t="<";break;case"LE":t="<=";break;case"LK":t="LIKE";break;case"NLK":t="NOT LIKE";break;case"IN":t="IS NULL";break;case"NN":t="IS NOT NULL";break;case"INN":t="IN";break;case"FOP":t="(";break;case"FCP":t=")"}return t}addFilterStanzaToQuery(e,t){if(!e.Instruction)return!1;switch(e.Instruction){case"FBV":t.addFilter(e.Field,e.Value,getFilterComparisonOperator(e.Operator),"AND");break;case"FBVOR":t.addFilter(e.Field,e.Value,getFilterComparisonOperator(e.Operator),"OR");break;case"FBL":t.addFilter(e.Field,e.Value.split(","),getFilterComparisonOperator(e.Operator),"AND");break;case"FBLOR":t.addFilter(e.Field,e.Value.split(","),getFilterComparisonOperator(e.Operator),"OR");break;case"FBD":t.addFilter(`DATE(${e.Field})`,e.Value.split(","),getFilterComparisonOperator(e.Operator),"AND",e.Field);break;case"FBDOR":t.addFilter(`DATE(${e.Field})`,e.Value.split(","),getFilterComparisonOperator(e.Operator),"OR",e.Field);break;case"FSF":const r="DESC"===e.Operator?"Descending":"Ascending";t.addSort({Column:e.Field,Direction:r});break;case"FOP":t.addFilter("","","(");break;case"FCP":t.addFilter("","",")");break;case"FDST":t.setDistinct&&t.setDistinct(!0);break;default:return!1}return e.Instruction=!1,!0}parseFilter(e,t){if("string"!=typeof e)return!1;const r=e.split("~");if(r.length<4)return!0;let n={Instruction:!1};for(let e=0;e<r.length;e++)switch(e%4){case 0:addFilterStanzaToQuery(n,t),n={Instruction:r[e],Field:"",Operator:"",Value:""};break;case 1:n.Field=r[e];break;case 2:n.Operator=r[e];break;case 3:n.Value=r[e]}return this.addFilterStanzaToQuery(n,t),!0}}},{}],182:[function(e,t,r){t.exports=class{constructor(e){this._Controller=e}getSessionData(e){let t=Object.assign({},this._Controller.settings.MeadowEndpointsDefaultSessionObject);switch(this._Controller.settings.MeadowEndpointsSessionDataSource||"Request"){default:this._LogController.warn(`Unknown session source configured: ${_SessionDataSource} - defaulting to Request for backward compatibility`);case"Request":t=this._Controller.extend(t,e.UserSession);break;case"None":break;case"Header":try{const r=e.headers["x-trusted-session"];if(!r)break;tmpHeaderSession=JSON.parse(r),t=this._Controller.extend(t,e.tmpHeaderSession)}catch(e){this._LogController.error(`Meadow Endpoints attempted to process a Header Session String with value [${tmpHeaderSessionString}] and failed -- likely culprit is bad JSON.`)}}return e.UserSession=t,t}}},{}],183:[function(e,t,r){(function(r){(function(){const n=e("async/eachSeries"),i=e("JSONStream");t.exports=class{constructor(e){this._Controller=e}chunk(e,t,r){let n=[...e],i="number"==typeof t?t:0,o=void 0!==r?r:[];if(i<=0)return o;for(;n.length;)o.push(n.splice(0,i));return o}streamRecordArray(e,t,o){if(!e.writeHead||!Array.isArray(t)||t.length<2500)return e.send(t),o();e.writeHead(200,{"content-type":"application/json"});const a=i.stringify();a.pipe(e),n(this.chunk(t,1e3),((e,t)=>{e.forEach(a.write),r(t)}),(e=>{a.end(),o(e)}))}}}).call(this)}).call(this,e("timers").setImmediate)},{JSONStream:1,"async/eachSeries":4,timers:165}],184:[function(e,t,r){t.exports=function(e,t,r){let n=this.initializeRequestState(e,"Count");this.waterfall([t=>(n.Query=this.DAL.query,"string"==typeof e.params.Filter?this.parseFilter(e.params.Filter,n.Query):e.params.Filter&&n.Query.setFilter(e.params.Filter),t()),(t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,n,r)})("Count-QueryConfiguration"),e=>{this.DAL.doCount(n.Query,((t,r,i)=>(n.Result={Count:i},e(t))))},r=>(t.send(n.Result),this.log.requestCompletedSuccessfully(e,n,`Delivered recordset count of ${n.Result.Count} for ${this.DAL.scope}.`),r())],(i=>this.ErrorHandler.handleErrorIfSet(e,n,t,i,r)))}},{}],185:[function(e,t,r){t.exports=function(e,t,r){let n=this.initializeRequestState(e,"CountBy");this.waterfall([t=>(n.Query=this.DAL.query,n.Query.addFilter(e.params.ByField,e.params.ByValue,"=","AND","RequestByField"),t()),(t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,n,r)})("CountBy-QueryConfiguration"),e=>{this.DAL.doCount(n.Query,((t,r,i)=>(n.Result={Count:i},e(t))))},r=>(this.log.requestCompletedSuccessfully(e,n,"Delivered recordset count of "+n.Result.Count+"."),t.send(n.Result),r())],(i=>this.ErrorHandler.handleErrorIfSet(e,n,t,i,r)))}},{}],186:[function(e,t,r){const n=e("./Meadow-Operation-Create.js");t.exports=function(e,t,r){let i=this.initializeRequestState(e,"CreateBulk"),o=t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,i,r)};i.CreatedRecords=[],this.waterfall([t=>Array.isArray(e.body)?(e.RecordsToBulkCreate=e.body,t()):t(this.ErrorHandler.getError("Bulk record create failure - a valid array of records to create is required.",500)),o("CreateBulk-PreOperation"),r=>{libAsync.eachSeries(e.RecordsToBulkCreate,((r,o)=>{n.call(this,r,e,i,t,o)}),r)},o("CreateBulk-PostOperation"),e=>this.doStreamRecordArray(t,i.CreatedRecords,e),t=>(this.log.requestCompletedSuccessfully(e,i,"Created a record with ID "+pNewRecord[this.DAL.defaultIdentifier]+"."),t())],(n=>this.ErrorHandler.handleErrorIfSet(e,i,t,n,r)))}},{"./Meadow-Operation-Create.js":188}],187:[function(e,t,r){const n=e("./Meadow-Operation-Create.js");t.exports=function(e,t,r){let i=this.initializeRequestState(e,"Create");this.waterfall([t=>"object"!=typeof e.body?t(this.ErrorHandler.getError("Record create failure - a valid record is required.",500)):t(),r=>{n.call(this,e.body,e,i,t,r)},e=>i.RecordCreateError?e(i.RecordCreateErrorObject):e(),e=>(t.send(i.Record),e()),t=>(this.log.requestCompletedSuccessfully(e,i,`Created a ${this.DAL.scope} record ID ${i.Record.IDRecord}`),t())],(n=>this.ErrorHandler.handleErrorIfSet(e,i,t,n,r)))}},{"./Meadow-Operation-Create.js":188}],188:[function(e,t,r){t.exports=function(e,t,r,n,i){let o=cloneAsyncSafeRequestState(r,"doCreate");Array.isArray(o.ParentRequestState.CreatedRecords)||(o.ParentRequestState.CreatedRecords=[]),this.waterfall([t=>(o.RecordToCreate=e,!o.RecordToCreate.hasOwnProperty("IDCustomer")&&this.DAL.jsonSchema.properties.hasOwnProperty("IDCustomer")&&(o.RecordToCreate.IDCustomer=o.SessionData.CustomerID||0),t()),e=>{this.BehaviorInjection.runBehavior("Create-PreOperation",this,t,o,e)},e=>(o.Query=this.DAL.query,o.Query.setIDUser(o.SessionData.UserID),o.Query.addRecord(o.RecordToCreate),e()),e=>{this.BehaviorInjection.runBehavior("Create-QueryConfiguration",this,t,o,e)},e=>{this.DAL.doCreate(o.Query,((t,r,n,i)=>t?e(t):i?(o.Record=i,e()):e(this.ErrorHandler.getError("Error in DAL Create: No record returned from persistence engine.",500))))},e=>this.BehaviorInjection.runBehavior("Create-PostOperation",this,t,o,e),e=>(o.ParentRequestState.CreatedRecords.push(o.Record),this.log.requestCompletedSuccessfully(t,o,`Created a record with ${this.DAL.defaultIdentifier} = ${o.Record[this.DAL.defaultIdentifier]}`),e())],(e=>(e&&(o.RecordToCreate.Error=e,o.ParentRequestState.RecordCreateError=!0,o.ParentRequestState.RecordCreateErrorObject=e,o.ParentRequestState.CreatedRecords.push(o.RecordToCreate)),i())))}},{}],189:[function(e,t,r){t.exports=function(e,t,r){let n=this.initializeRequestState(e,"Delete");n.IDRecord=0,n.RecordCount={Count:0},this.waterfall([t=>("string"==typeof e.params.IDRecord?n.IDRecord=e.params.IDRecord:("number"==typeof e.body[this.DAL.defaultIdentifier]||"string"==typeof e.body[this.DAL.defaultIdentifier])&&(n.IDRecord=e.body[this.DAL.defaultIdentifier]),n.IDRecord<1?t(this.ErrorHandler.getError("Record delete failure - a valid record ID is required in the passed-in record.",500)):t()),e=>(n.Query=this.DAL.query,n.Query.addFilter(this.DAL.defaultIdentifier,n.IDRecord),n.Query.setIDUser(n.SessionData.UserID),e()),t=>this.BehaviorInjection.runBehavior("Delete-QueryConfiguration",this,e,n,t),e=>{this.DAL.doRead(n.Query,((t,r,i)=>i?(n.Record=i,e()):e(this.ErrorHandler.getError("Record not found.",404))))},t=>this.BehaviorInjection.runBehavior("Delete-PreOperation",this,e,n,t),e=>{this.DAL.doDelete(n.Query,((t,r,i)=>(n.RecordCount.Count=i,e(t))))},t=>this.BehaviorInjection.runBehavior("Delete-PostOperation",this,e,n,t),r=>(t.send(n.RecordCount),this.log.requestCompletedSuccessfully(e,n,`Deleted ${n.RecordCount.Count} ${this.DAL.scope} records with ID ${n.IDRecord}`),r())],(i=>this.ErrorHandler.handleErrorIfSet(e,n,t,i,r)))}},{}],190:[function(e,t,r){t.exports=function(e,t,r){let n=this.initializeRequestState(e,"Undelete");var i=0;if("string"==typeof e.params.IDRecord?i=e.params.IDRecord:("number"==typeof e.body[this.DAL.defaultIdentifier]||"string"==typeof e.body[this.DAL.defaultIdentifier])&&(i=e.body[this.DAL.defaultIdentifier]),i<1)return fStageComplete(this.ErrorHandler.getError("Record undelete failure - a valid record ID is required.",500));n.RecordCount={Count:0},this.waterfall([e=>{var t=this.DAL.schema,r=!1;for(let e=0;e<t.length;e++)"Deleted"==t[e].Type&&(r=!0);return r?e():e(this.ErrorHandler.getError("No undelete bit on record.",500))},e=>(n.Query=this.DAL.query,n.Query.addFilter(this.DAL.defaultIdentifier,i),n.Query.addFilter("Deleted",1),n.Query.setIDUser(n.SessionData.UserID),e()),e=>{this.DAL.doRead(n.Query,((t,r,i)=>i?(n.Record=i,e()):e(this.ErrorHandler.getError("Record not found.",404))))},t=>this.BehaviorInjection.runBehavior("Undelete-PreOperation",this,e,n,t),e=>{this.DAL.doUndelete(n.Query,((t,r,i)=>(n.RecordCount={Count:i},e(t))))},t=>this.BehaviorInjection.runBehavior("Undelete-PostOperation",this,e,n,t),r=>(t.send(n.RecordCount),this.log.requestCompletedSuccessfully(e,n,"Undeleted "+n.RecordCount.Count+" records with ID "+i+"."),r())],(i=>this.ErrorHandler.handleErrorIfSet(e,n,t,i,r)))}},{}],191:[function(e,t,r){t.exports=function(e,t,r){let n=this.initializeRequestState(e,"Read"),i=t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,n,r)};this.waterfall([e=>(n.Query=this.DAL.query,e()),i("Read-PreOperation"),t=>{if(!e.params.IDRecord&&e.params.GUIDRecord)n.RecordSearchCriteria=`${this.DAL.defaultGUIdentifier} = ${e.params.GUIDRecord}`,n.Query.addFilter(this.DAL.defaultGUIdentifier,e.params.GUIDRecord,"=","AND","RequestDefaultIdentifier");else{if(!e.params.IDRecord)return t(this.ErrorHandler.getError("No ID Provided",400));n.RecordSearchCriteria=`${this.DAL.defaultIdentifier} = ${e.params.IDRecord}`,n.Query.addFilter(this.DAL.defaultIdentifier,e.params.IDRecord,"=","AND","RequestDefaultIdentifier")}return t()},i("Read-QueryConfiguration"),e=>{try{this.DAL.doRead(n.Query,((t,r,i)=>i?(n.Record=i,e()):e(this.ErrorHandler.getError("Record not Found",404))))}catch(t){return e(t)}},i("Read-PostOperation"),r=>(t.send(n.Record),this.log.requestCompletedSuccessfully(e,n,`Read Record Where ${n.RecordSearchCriteria}`),r())],(i=>this.ErrorHandler.handleErrorIfSet(e,n,t,i,r)))}},{}],192:[function(e,t,r){const n=e("./Meadow-Marshal-DistinctList.js");t.exports=function(e,t,r){let i=this.initializeRequestState(e,"ReadDistinct");i.DistinctColumns,this.waterfall([t=>{i.Query=this.DAL.query.setDistinct(!0);let r=!1,n=!1;if("string"!=typeof e.params.Begin&&"number"!=typeof e.params.Begin||(n=parseInt(e.params.Begin,10)),r="string"==typeof e.params.Cap||"number"==typeof e.params.Cap?parseInt(e.params.Cap,10):this.settings.MeadowDefaultMaxCap||250,i.Query.setCap(r).setBegin(n),"string"==typeof e.params.Filter?this.parseFilter(e.params.Filter,i.Query):e.params.Filter&&i.Query.setFilter(e.params.Filter),"string"==typeof e.params.Columns){if(i.DistinctColumns=e.params.Columns.split(","),!i.DistinctColumns)return t({Code:400,Message:"Columns to distinct on must be provided."});i.Query.setDataElements(i.DistinctColumns)}return t()},(t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,i,r)})("Reads-QueryConfiguration"),e=>{this.DAL.doReads(i.Query,e)},(e,t,r)=>(t.length<1&&(t=[]),i.Records=t,r()),t=>(i.ResultRecords=n.call(this,i.Records,e,i.DistinctColumns),t()),e=>this.doStreamRecordArray(t,i.ResultRecords,e),t=>(this.log.requestCompletedSuccessfully(e,i,`Read a recordset distinct lite list with ${i.ResultRecords.length} results.`),t())],(n=>this.ErrorHandler.handleErrorIfSet(e,i,t,n,r)))}},{"./Meadow-Marshal-DistinctList.js":198}],193:[function(e,t,r){const n=e("./Meadow-Marshal-LiteList.js");t.exports=function(e,t,r){let i=this.initializeRequestState(e,"ReadsLite");this.waterfall([t=>{i.Query=this.DAL.query;var r=!1,n=!1;return"string"!=typeof e.params.Begin&&"number"!=typeof e.params.Begin||(n=parseInt(e.params.Begin,10)),r="string"==typeof e.params.Cap||"number"==typeof e.params.Cap?parseInt(e.params.Cap,10):this.settings.MeadowDefaultMaxCap||250,i.Query.setCap(r).setBegin(n),"string"==typeof e.params.Filter?this.parseFilter(e.params.Filter,i.Query):e.params.Filter&&i.Query.setFilter(e.params.Filter),t()},(t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,i,r)})("Reads-QueryConfiguration"),e=>{this.DAL.doReads(i.Query,e)},(e,t,r)=>(t.length<1&&(t=[]),i.RawRecords=t,r()),t=>(i.Records=n.call(this,i.RawRecords,e,"string"==typeof e.params.ExtraColumns?e.params.ExtraColumns.split(","):[]),t()),e=>this.doStreamRecordArray(t,i.Records,r),t=>(this.log.requestCompletedSuccessfully(e,i,`Read a recordset lite list with ${i.Records.length} results`),t())],((n,o)=>this.ErrorHandler.handleErrorIfSet(e,i,t,n,r)))}},{"./Meadow-Marshal-LiteList.js":199}],194:[function(e,t,r){t.exports=function(e,t,r){let n=this.initializeRequestState(e,"ReadMax");this.waterfall([e=>(n.Query=this.DAL.query,e()),t=>(n.ColumnName=e.params.ColumnName,n.Query.setSort({Column:n.ColumnName,Direction:"Descending"}),n.Query.setCap(1),t()),(t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,n,r)})("ReadMax-QueryConfiguration"),e=>{this.DAL.doRead(n.Query,e)},(e,t,r)=>t?(n.Record=t,r()):r(this.ErrorHandler.getError("Record not Found",404)),t=>{this.BehaviorInjection.runBehavior("ReadMax-PostOperation",this,e,n,t)},r=>{this.log.requestCompletedSuccessfully(e,n,`Read max record of ${this.DAL.scope} on ${n.ColumnName}`),t.send(n.Record)}],(i=>this.ErrorHandler.handleErrorIfSet(e,n,t,i,r)))}},{}],195:[function(e,t,r){t.exports=function(e,t,r){let n=this.initializeRequestState(e,"ReadsBy");this.waterfall([t=>{n.Query=this.DAL.query;var r=!1,i=!1;return"string"!=typeof e.params.Begin&&"number"!=typeof e.params.Begin||(i=parseInt(e.params.Begin)),r="string"==typeof e.params.Cap||"number"==typeof e.params.Cap?parseInt(e.params.Cap):this.settings.MeadowDefaultMaxCap||250,n.Query.setCap(r).setBegin(i),"string"==typeof e.params.Filter&&this.parseFilter(e.params.Filter,n.Query),t()},(t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,n,r)})("Reads-QueryConfiguration"),e=>{this.DAL.doReads(n.Query,e)},(e,t,r)=>(t.length<1&&(t=[]),n.Records=t,r()),e=>{n.SelectList=[];for(var t=0;t<n.Records.length;t++)n.SelectList.push({Hash:n.Records[t][this.DAL.defaultIdentifier],Value:this.BehaviorInjection.processTemplate("SelectList",{Record:n.Records[t]},this.DAL.scope+" #<%= Record."+this.DAL.defaultIdentifier+"%>")});return e()},e=>this.doStreamRecordArray(t,n.SelectList,e),t=>(this.log.requestCompletedSuccessfully(e,n,`Read a recordset lite list with ${n.SelectList.length} results.`),t())],((i,o)=>this.ErrorHandler.handleErrorIfSet(e,n,t,i,r)))}},{}],196:[function(e,t,r){t.exports=function(e,t,r){let n=this.initializeRequestState(e,"Reads"),i=t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,n,r)};this.waterfall([t=>{n.Query=this.DAL.query;var r=!1,i=!1;return"string"!=typeof e.params.Begin&&"number"!=typeof e.params.Begin||(i=parseInt(e.params.Begin)),r="string"==typeof e.params.Cap||"number"==typeof e.params.Cap?parseInt(e.params.Cap):this.settings.MeadowDefaultMaxCap||250,n.Query.setCap(r).setBegin(i),"string"==typeof e.params.Filter?this.parseFilter(e.params.Filter,n.Query):e.params.Filter&&n.Query.setFilter(e.params.Filter),t()},i("Reads-QueryConfiguration"),e=>{this.DAL.doReads(n.Query,e)},(e,t,r)=>t?(n.Records=t,r()):r(this.ErrorHandler.getError("No records found.",404)),i("Reads-PostOperation"),e=>{this.doStreamRecordArray(t,n.Records,e)},t=>(this.log.requestCompletedSuccessfully(e,n,"Read a list of records."),t())],(i=>this.ErrorHandler.handleErrorIfSet(e,n,t,i,r)))}},{}],197:[function(e,t,r){t.exports=function(e,t,r){let n=this.initializeRequestState(e,"ReadsBy"),i=t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,n,r)};this.waterfall([t=>{n.Query=this.DAL.query;var r=!1,i=!1;return"string"!=typeof e.params.Begin&&"number"!=typeof e.params.Begin||(i=parseInt(e.params.Begin)),r="string"==typeof e.params.Cap||"number"==typeof e.params.Cap?parseInt(e.params.Cap):this.settings.MeadowDefaultMaxCap||250,n.Query.setCap(r).setBegin(i),t()},t=>{function r(e,t){t.constructor===Array?n.Query.addFilter(e,t,"IN","AND","RequestByField"):n.Query.addFilter(e,t,"=","AND","RequestByField")}var i=e.params.Filters;return i&&i.constructor===Array?i.forEach((function(e){r(e.ByField,e.ByValue)})):r(e.params.ByField,e.params.ByValue),t()},i("Reads-QueryConfiguration"),e=>{this.DAL.doReads(n.Query,((t,r,i)=>i?(n.Records=i,e()):e(this.ErrorHandler.getError("No records found.",404))))},i("Reads-PostOperation"),e=>this.doStreamRecordArray(t,n.Records,e),t=>(this.log.requestCompletedSuccessfully(e,n,`Read a list of records by ${e.params.ByField} = ${e.params.ByValue}`),t())],(i=>this.ErrorHandler.handleErrorIfSet(e,n,t,i,r)))}},{}],198:[function(e,t,r){t.exports=function(e,t,r){if(e.length<1)return[];let n=[],i=void 0!==r?r:[],o=(!!(this.DAL.defaultGUIdentifier&&this.DAL.defaultGUIdentifier.length>0)&&this.DAL.defaultGUIdentifier,e[0].hasOwnProperty("UpdateDate"),Object.keys(e[0]),0);for(;o<i.length;)e[0].hasOwnProperty(i[0])?o++:i.splice(o,1);for(let t=0;t<e.length;t++){let r={};i.forEach((n=>{r[n]=e[t][n]})),n.push(r)}return n}},{}],199:[function(e,t,r){t.exports=function(e,t,r){if(e.length<1)return[];let n=[],i=void 0!==r?r:[],o=!!(this.DAL.defaultGUIdentifier&&this.DAL.defaultGUIdentifier.length>0)&&this.DAL.defaultGUIdentifier,a=!!e[0].hasOwnProperty("UpdateDate");Object.keys(e[0]).forEach((e=>{0!==e.indexOf("ID")&&0!==e.indexOf("GUID")&&"CreatingIDUser"!=e||i.push(e)}));let s=0;for(;s<i.length;)e[0].hasOwnProperty(i[0])?s++:i.splice(s,1);for(let t=0;t<e.length;t++){let r={Value:this.BehaviorInjection.processTemplate("SelectList",{Record:e[t]},this.DAL.scope+" #<%= Record."+this.DAL.defaultIdentifier+"%>")};r[this.DAL.defaultIdentifier]=e[t][this.DAL.defaultIdentifier],o&&(r[o]=e[t][o]),a&&(r.UpdateDate=e[t].UpdateDate),i.forEach((n=>{r[n]=e[t][n]})),n.push(r)}return n}},{}],200:[function(e,t,r){t.exports=function(e,t,r){let n=this.initializeRequestState(e,"New"),i=t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,n,r)};this.waterfall([i("New-PreOperation"),e=>(n.EmptyEntityRecord||(n.EmptyEntityRecord=this.extend({},this.DAL.schemaFull.defaultObject)),e()),i("New-PostOperation"),r=>(t.send(n.EmptyEntityRecord),this.log.requestCompletedSuccessfully(e,n,`Delivered New ${this.DAL.scope} Record`),r())],(i=>this.ErrorHandler.handleErrorIfSet(e,n,t,i,r)))}},{}],201:[function(e,t,r){t.exports=function(e,t,r){let n=this.initializeRequestState(e,"Schema"),i=t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,n,r)};this.waterfall([i("Schema-PreOperation"),t=>(e.JSONSchema||(n.JSONSchema=this.extend({},this.DAL.jsonSchema)),t()),i("Schema-PostOperation"),r=>(t.send(n.JSONSchema),this.log.requestCompletedSuccessfully(e,n,`Delivered JSONSchema for ${this.DAL.scope}`),r())],(i=>this.ErrorHandler.handleErrorIfSet(e,n,t,i,r)))}},{}],202:[function(e,t,r){t.exports=function(e,t,r){let n=this.initializeRequestState(e,"Validate"),i=t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,n,r)};this.waterfall([i("Validate-PreOperation"),t=>"object"!=typeof e.body?t(this.ErrorHandler.getError("Record validate failure - a valid JSON object is required.",500)):(n.Record=e.body,t()),e=>(n.RecordValidation=this.DAL.schemaFull.validateObject(tmpRecord),e()),i("Validate-PostOperation"),r=>(t.send(n.RecordValidation),this.log.requestCompletedSuccessfully(e,n,`Validated Record for ${this.DAL.scope} - ${n.RecordValidation}`),r())],(i=>this.ErrorHandler.handleErrorIfSet(e,n,t,i,r)))}},{}],203:[function(e,t,r){const n=e("./Meadow-Operation-Update.js");t.exports=function(e,t,r){let i=this.initializeRequestState(e,"UpdateBulk");i.UpdatedRecords=[],this.waterfall([t=>Array.isArray(e.body)?(e.BulkRecords=e.body,t()):t(this.ErrorHandler.getError("Record update failure - a valid record is required.",500)),r=>{libAsync.eachSeries(e.BulkRecords,((r,o)=>{n(r,e,i,t,o)}),r)},r=>this.doStreamRecordArray(t,e.UpdatedRecords,r)],(n=>this.ErrorHandler.handleErrorIfSet(e,i,t,n,r)))}},{"./Meadow-Operation-Update.js":205}],204:[function(e,t,r){const n=e("./Meadow-Operation-Update.js");t.exports=function(e,t,r){let i=this.initializeRequestState(e,"Update");this.waterfall([t=>"object"!=typeof e.body?t(this.ErrorHandler.getError("Record update failure - a valid record is required.",400)):e.body[this.DAL.defaultIdentifier]<1?t(this.ErrorHandler.getError("Record update failure - a valid record ID is required in the passed-in record.",400)):(i.Record=e.body,t()),r=>{n.call(this,e.body,e,i,t,r)},e=>i.RecordUpdateError?e(i.RecordUpdateErrorObject):e(),e=>(t.send(i.Record),e())],(n=>this.ErrorHandler.handleErrorIfSet(e,i,t,n,r)))}},{"./Meadow-Operation-Update.js":205}],205:[function(e,t,r){t.exports=function(e,t,r,n,i,o){let a=cloneAsyncSafeRequestState(r,"doUpdate");if(e[this.DAL.defaultIdentifier]<1&&void 0===o)return i("Record update failure - a valid record ID is required in the passed-in record.");Array.isArray(a.ParentRequestState.UpdatedRecords)||(a.ParentRequestState.UpdatedRecords=[]),this.waterfall([t=>{if(a.RecordToModify=e,void 0!==o)return a.OriginalRecord=o,t();a.Query=this.DAL.query,a.Query.addFilter(this.DAL.defaultIdentifier,a.RecordToModify[this.DAL.defaultIdentifier]),this.DAL.doRead(a.Query,((e,r,n)=>e?t(e):n?(a.OriginalRecord=n,t()):t(this.ErrorHandler.getError("Record not Found",404))))},e=>(a.Query=this.DAL.query,e()),e=>(a.Query.setIDUser(a.SessionData.UserID),a.Query.addRecord(a.RecordToModify),e()),e=>{this.DAL.doUpdate(a.Query,((t,r,n,i)=>t?e(t):i?(a.Record=i,e()):e("Error updating a record.")))},e=>this.BehaviorInjection.runBehavior("Update-PostOperation",this,t,a,e),e=>(a.ParentRequestState.UpdatedRecords.push(a.Record),this.log.requestCompletedSuccessfully(t,a,`Updated record with ID ${a.Record[this.DAL.defaultIdentifier]}`),e())],(e=>(e&&(a.UpdatingRecord.Error=e,a.ParentRequestState.RecordUpdateError=!0,a.ParentRequestState.RecordUpdateErrorObject=e,a.ParentRequestState.UpdatedRecords.push(a.RecordToCreate)),i())))}},{}],206:[function(e,t,r){const n=e("./Meadow-Operation-Upsert.js"),i=e("../read/Meadow-Marshal-LiteList.js");t.exports=function(e,t,r){let o=this.initializeRequestState(e,"UpsertBulk");o.CreatedRecords=[],o.UpdatedRecords=[],o.UpsertedRecords=[],this.waterfall([t=>Array.isArray(e.body)?(o.BulkRecords=e.body,t()):t(this.ErrorHandler.getError("Record upsert failure - a valid record is required.",500)),r=>{libAsync.eachSeries(o.BulkRecords,((r,i)=>{n.call(this,r,e,o,t,i)}),r)},r=>this.doStreamRecordArray(t,i.call(this,e.UpsertedRecords,e),r)],(n=>this.ErrorHandler.handleErrorIfSet(e,o,t,n,r)))}},{"../read/Meadow-Marshal-LiteList.js":199,"./Meadow-Operation-Upsert.js":208}],207:[function(e,t,r){var n=e("./Meadow-Operation-Upsert.js");t.exports=function(e,t,r){let i=this.initializeRequestState(e,"Upsert");i.CreatedRecords=[],i.UpdatedRecords=[],i.UpsertedRecords=[],this.waterfall([t=>"object"!=typeof i.body?t(this.ErrorHandler.getError("Record upsert failure - a valid record is required.",500)):(i.RecordToUpsert=e.body,t()),r=>{n.call(this,i.RecordToUpsert,e,i,t,r)},e=>i.RecordUpsertError?e(i.RecordUpsertErrorMessage):(t.send(i.Record),e())],(n=>this.ErrorHandler.handleErrorIfSet(e,i,t,n,r)))}},{"./Meadow-Operation-Upsert.js":208}],208:[function(e,t,r){const n=e("../create/Meadow-Operation-Create.js"),i=e("../update/Meadow-Operation-Update.js");t.exports=function(e,t,r,o,a){let s=this.cloneAsyncSafeRequestState(t,"Upsert");this.waterfall([r=>{s.Query=this.DAL.query,s.Record=e,s.UpsertCreateOnly=!0,void 0!==s.Record[this.DAL.defaultGUIdentifier]&&s.Record[this.DAL.defaultGUIdentifier].length>0&&(s.Query.addFilter(this.DAL.defaultGUIdentifier,s.Record[this.DAL.defaultGUIdentifier]),s.UpsertCreateOnly=!1),void 0!==s.Record[this.DAL.defaultIdentifier]&&s.Record[this.DAL.defaultIdentifier]>0&&(s.Query.addFilter(this.DAL.defaultIdentifier,s.Record[this.DAL.defaultIdentifier]),s.UpsertCreateOnly=!1),s.UpsertCreateOnly?n.call(this,s.Record,t,o,r):this.DAL.doRead(s.Query,((e,a,u)=>{if(e)return r(e);if(e||u){if(s.Record.hasOwnProperty(this.DAL.defaultIdentifier)||(s.Record[this.DAL.defaultIdentifier]=u[this.DAL.defaultIdentifier]),s.Record[this.DAL.defaultIdentifier]!=u[this.DAL.defaultIdentifier])return r(this.ErrorHandler.getError("Record IDs do not match",500));i.call(this,s.Record,t,o,r,u)}else n.call(this,s.Record,t,o,r)}))},e=>(t.UpsertedRecords.push(s.Record),e())],(r=>(r&&(e.Error="Error upserting record:"+r,s.RecordUpsertError=!0,s.RecordUpsertErrorMessage=r,t.UpsertedRecords.push(e),t.CommonServices.log.error("Error upserting record:"+r,{SessionID:t.UserSession.SessionID,RequestID:t.RequestUUID,RequestURL:t.url,Action:this.DAL.scope+"-"+t.MeadowOperation,Stack:r.stack},t)),a())))}},{"../create/Meadow-Operation-Create.js":188,"../update/Meadow-Operation-Update.js":205}]},{},[175])(175)}));
|
|
92
|
+
//# sourceMappingURL=meadowendpoints.min.js.map
|