@superinterface/server 1.1.4 → 1.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +2 -2
  3. package/.next/cache/.previewinfo +1 -1
  4. package/.next/cache/.rscinfo +1 -1
  5. package/.next/cache/.tsbuildinfo +1 -1
  6. package/.next/cache/eslint/.cache_btwyo7 +1 -1
  7. package/.next/fallback-build-manifest.json +2 -2
  8. package/.next/prerender-manifest.json +3 -3
  9. package/.next/server/app/_not-found.html +1 -1
  10. package/.next/server/app/_not-found.rsc +1 -1
  11. package/.next/server/app/api/api-keys/[apiKeyId]/route.js +1 -1
  12. package/.next/server/app/api/api-keys/[apiKeyId]/route.js.nft.json +1 -1
  13. package/.next/server/app/api/api-keys/route.js +1 -1
  14. package/.next/server/app/api/api-keys/route.js.nft.json +1 -1
  15. package/.next/server/app/api/assistants/[assistantId]/functions/[functionId]/route.js +1 -1
  16. package/.next/server/app/api/assistants/[assistantId]/functions/[functionId]/route.js.nft.json +1 -1
  17. package/.next/server/app/api/assistants/[assistantId]/functions/route.js +1 -1
  18. package/.next/server/app/api/assistants/[assistantId]/functions/route.js.nft.json +1 -1
  19. package/.next/server/app/api/assistants/[assistantId]/initial-messages/route.js +1 -1
  20. package/.next/server/app/api/assistants/[assistantId]/initial-messages/route.js.nft.json +1 -1
  21. package/.next/server/app/api/assistants/[assistantId]/mcp-servers/[mcpServerId]/route.js +1 -1
  22. package/.next/server/app/api/assistants/[assistantId]/mcp-servers/[mcpServerId]/route.js.nft.json +1 -1
  23. package/.next/server/app/api/assistants/[assistantId]/mcp-servers/route.js +1 -1
  24. package/.next/server/app/api/assistants/[assistantId]/mcp-servers/route.js.nft.json +1 -1
  25. package/.next/server/app/api/assistants/[assistantId]/route.js +1 -1
  26. package/.next/server/app/api/assistants/[assistantId]/route.js.nft.json +1 -1
  27. package/.next/server/app/api/assistants/route.js +1 -1
  28. package/.next/server/app/api/assistants/route.js.nft.json +1 -1
  29. package/.next/server/app/api/files/[fileId]/contents/route.js +1 -1
  30. package/.next/server/app/api/files/[fileId]/contents/route.js.nft.json +1 -1
  31. package/.next/server/app/api/files/route.js +1 -1
  32. package/.next/server/app/api/files/route.js.nft.json +1 -1
  33. package/.next/server/app/api/messages/route.js +1 -1
  34. package/.next/server/app/api/messages/route.js.nft.json +1 -1
  35. package/.next/server/app/api/providers/[modelProviderId]/assistants/route.js +1 -1
  36. package/.next/server/app/api/providers/[modelProviderId]/assistants/route.js.nft.json +1 -1
  37. package/.next/server/app/api/providers/[modelProviderId]/models/route.js +1 -1
  38. package/.next/server/app/api/providers/[modelProviderId]/models/route.js.nft.json +1 -1
  39. package/.next/server/app/api/providers/[modelProviderId]/route.js +1 -1
  40. package/.next/server/app/api/providers/[modelProviderId]/route.js.nft.json +1 -1
  41. package/.next/server/app/api/providers/route.js +1 -1
  42. package/.next/server/app/api/providers/route.js.nft.json +1 -1
  43. package/.next/server/app/api/tasks/[taskId]/route.js +1 -1
  44. package/.next/server/app/api/tasks/[taskId]/route.js.nft.json +1 -1
  45. package/.next/server/app/api/tasks/callback/route.js +1 -1
  46. package/.next/server/app/api/tasks/callback/route.js.nft.json +1 -1
  47. package/.next/server/app/api/tasks/route.js +1 -1
  48. package/.next/server/app/api/tasks/route.js.nft.json +1 -1
  49. package/.next/server/app/api/threads/runs/submit-client-tool-outputs/route.js +1 -1
  50. package/.next/server/app/api/threads/runs/submit-client-tool-outputs/route.js.nft.json +1 -1
  51. package/.next/server/app/api/workspaces/[workspaceId]/route.js +1 -1
  52. package/.next/server/app/api/workspaces/[workspaceId]/route.js.nft.json +1 -1
  53. package/.next/server/app/api/workspaces/route.js +1 -1
  54. package/.next/server/app/api/workspaces/route.js.nft.json +1 -1
  55. package/.next/server/app/index.html +1 -1
  56. package/.next/server/app/index.rsc +1 -1
  57. package/.next/server/chunks/{[root-of-the-server]__f6f61507._.js → [root-of-the-server]__281d6920._.js} +12 -12
  58. package/.next/server/chunks/[root-of-the-server]__281d6920._.js.map +1 -0
  59. package/.next/server/chunks/[root-of-the-server]__6f8f12bd._.js +1 -1
  60. package/.next/server/chunks/[root-of-the-server]__6f8f12bd._.js.map +1 -1
  61. package/.next/server/chunks/{[root-of-the-server]__47b17fad._.js → [root-of-the-server]__933f2258._.js} +12 -12
  62. package/.next/server/chunks/[root-of-the-server]__933f2258._.js.map +1 -0
  63. package/.next/server/chunks/[root-of-the-server]__ccec8f9e._.js +1 -1
  64. package/.next/server/chunks/[root-of-the-server]__ccec8f9e._.js.map +1 -1
  65. package/.next/server/pages/404.html +1 -1
  66. package/.next/server/pages/500.html +1 -1
  67. package/.next/server/server-reference-manifest.js +1 -1
  68. package/.next/server/server-reference-manifest.json +1 -1
  69. package/.next/trace +1 -1
  70. package/README.md +12 -0
  71. package/dist/lib/functions/handleFunction/handleAssistant.d.ts.map +1 -1
  72. package/dist/lib/functions/handleFunction/handleAssistant.js +0 -43
  73. package/dist/lib/prisma/index.d.ts.map +1 -1
  74. package/dist/lib/prisma/index.js +29 -5
  75. package/package.json +1 -1
  76. package/scripts/utils/loadPrisma.ts +36 -8
  77. package/.next/server/chunks/[root-of-the-server]__47b17fad._.js.map +0 -1
  78. package/.next/server/chunks/[root-of-the-server]__f6f61507._.js.map +0 -1
  79. /package/.next/static/{gf0TUacozuObJ7_Pkziw6 → 8ere9Febbau5NxxQazJbz}/_buildManifest.js +0 -0
  80. /package/.next/static/{gf0TUacozuObJ7_Pkziw6 → 8ere9Febbau5NxxQazJbz}/_clientMiddlewareManifest.json +0 -0
  81. /package/.next/static/{gf0TUacozuObJ7_Pkziw6 → 8ere9Febbau5NxxQazJbz}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- module.exports=[61724,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-route-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-route-turbo.runtime.prod.js"))},5865,(e,t,r)=>{t.exports=e.r(61724)},79391,e=>{"use strict";function t(e){return Symbol.for(e)}e.s(["DiagConsoleLogger",()=>eY,"DiagLogLevel",()=>r,"INVALID_SPANID",()=>ew,"INVALID_SPAN_CONTEXT",()=>eS,"INVALID_TRACEID",()=>eE,"ProxyTracer",()=>eq,"ProxyTracerProvider",()=>eG,"ROOT_CONTEXT",()=>u,"SamplingDecision",()=>s,"SpanKind",()=>o,"SpanStatusCode",()=>a,"TraceFlags",()=>n,"ValueType",()=>i,"baggageEntryMetadataFromString",()=>ey,"context",()=>N,"createContextKey",()=>t,"createNoopMeter",()=>Z,"createTraceState",()=>e0,"default",()=>eW,"defaultTextMapGetter",()=>ei,"defaultTextMapSetter",()=>es,"diag",()=>L,"isSpanContextValid",()=>ek,"isValidSpanId",()=>eD,"isValidTraceId",()=>eM,"metrics",()=>er,"propagation",()=>e_,"trace",()=>eV],79391),e.s(["default",()=>eW],81087);var r,n,i,s,o,a,u=new function e(t){var r=this;r._currentContext=t?new Map(t):new Map,r.getValue=function(e){return r._currentContext.get(e)},r.setValue=function(t,n){var i=new e(r._currentContext);return i._currentContext.set(t,n),i},r.deleteValue=function(t){var n=new e(r._currentContext);return n._currentContext.delete(t),n}},c=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return o},l=function(e,t,r){if(r||2==arguments.length)for(var n,i=0,s=t.length;i<s;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},h=function(){function e(){}return e.prototype.active=function(){return u},e.prototype.with=function(e,t,r){for(var n=[],i=3;i<arguments.length;i++)n[i-3]=arguments[i];return t.call.apply(t,l([r],c(n),!1))},e.prototype.bind=function(e,t){return t},e.prototype.enable=function(){return this},e.prototype.disable=function(){return this},e}(),f="object"==typeof globalThis?globalThis:e.g,d="1.9.0",p=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/,g=function(e){var t=new Set([e]),r=new Set,n=e.match(p);if(!n)return function(){return!1};var i={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};if(null!=i.prerelease)return function(t){return t===e};function s(e){return r.add(e),!1}return function(e){if(t.has(e))return!0;if(r.has(e))return!1;var n=e.match(p);if(!n)return s(e);var o={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};if(null!=o.prerelease||i.major!==o.major)return s(e);if(0===i.major)return i.minor===o.minor&&i.patch<=o.patch?(t.add(e),!0):s(e);return i.minor<=o.minor?(t.add(e),!0):s(e)}}(d),m=Symbol.for("opentelemetry.js.api."+d.split(".")[0]);function y(e,t,r,n){void 0===n&&(n=!1);var i,s=f[m]=null!=(i=f[m])?i:{version:d};if(!n&&s[e]){var o=Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return r.error(o.stack||o.message),!1}if(s.version!==d){var o=Error("@opentelemetry/api: Registration of version v"+s.version+" for "+e+" does not match previously registered API v"+d);return r.error(o.stack||o.message),!1}return s[e]=t,r.debug("@opentelemetry/api: Registered a global for "+e+" v"+d+"."),!0}function b(e){var t,r,n=null==(t=f[m])?void 0:t.version;if(n&&g(n))return null==(r=f[m])?void 0:r[e]}function v(e,t){t.debug("@opentelemetry/api: Unregistering a global for "+e+" v"+d+".");var r=f[m];r&&delete r[e]}var _=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return o},w=function(e,t,r){if(r||2==arguments.length)for(var n,i=0,s=t.length;i<s;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},E=function(){function e(e){this._namespace=e.namespace||"DiagComponentLogger"}return e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return S("debug",this._namespace,e)},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return S("error",this._namespace,e)},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return S("info",this._namespace,e)},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return S("warn",this._namespace,e)},e.prototype.verbose=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return S("verbose",this._namespace,e)},e}();function S(e,t,r){var n=b("diag");if(n)return r.unshift(t),n[e].apply(n,w([],_(r),!1))}!function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"}(r||(r={}));var R=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return o},x=function(e,t,r){if(r||2==arguments.length)for(var n,i=0,s=t.length;i<s;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},A=function(){function e(){function e(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=b("diag");if(n)return n[e].apply(n,x([],R(t),!1))}}var t=this;t.setLogger=function(e,n){if(void 0===n&&(n={logLevel:r.INFO}),e===t){var i,s,o,a=Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return t.error(null!=(i=a.stack)?i:a.message),!1}"number"==typeof n&&(n={logLevel:n});var u=b("diag"),c=function(e,t){function n(r,n){var i=t[r];return"function"==typeof i&&e>=n?i.bind(t):function(){}}return e<r.NONE?e=r.NONE:e>r.ALL&&(e=r.ALL),t=t||{},{error:n("error",r.ERROR),warn:n("warn",r.WARN),info:n("info",r.INFO),debug:n("debug",r.DEBUG),verbose:n("verbose",r.VERBOSE)}}(null!=(s=n.logLevel)?s:r.INFO,e);if(u&&!n.suppressOverrideMessage){var l=null!=(o=Error().stack)?o:"<failed to generate stacktrace>";u.warn("Current logger will be overwritten from "+l),c.warn("Current logger will overwrite one already registered from "+l)}return y("diag",c,t,!0)},t.disable=function(){v("diag",t)},t.createComponentLogger=function(e){return new E(e)},t.verbose=e("verbose"),t.debug=e("debug"),t.info=e("info"),t.warn=e("warn"),t.error=e("error")}return e.instance=function(){return this._instance||(this._instance=new e),this._instance},e}(),T=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return o},P=function(e,t,r){if(r||2==arguments.length)for(var n,i=0,s=t.length;i<s;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},O="context",C=new h,I=function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalContextManager=function(e){return y(O,e,A.instance())},e.prototype.active=function(){return this._getContextManager().active()},e.prototype.with=function(e,t,r){for(var n,i=[],s=3;s<arguments.length;s++)i[s-3]=arguments[s];return(n=this._getContextManager()).with.apply(n,P([e,t,r],T(i),!1))},e.prototype.bind=function(e,t){return this._getContextManager().bind(e,t)},e.prototype._getContextManager=function(){return b(O)||C},e.prototype.disable=function(){this._getContextManager().disable(),v(O,A.instance())},e}(),N=I.getInstance(),L=A.instance(),M=function(){var e=function(t,r){return(e=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),D=function(){function e(){}return e.prototype.createGauge=function(e,t){return Q},e.prototype.createHistogram=function(e,t){return Y},e.prototype.createCounter=function(e,t){return W},e.prototype.createUpDownCounter=function(e,t){return X},e.prototype.createObservableGauge=function(e,t){return K},e.prototype.createObservableCounter=function(e,t){return z},e.prototype.createObservableUpDownCounter=function(e,t){return J},e.prototype.addBatchObservableCallback=function(e,t){},e.prototype.removeBatchObservableCallback=function(e){},e}(),k=function(){},B=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return M(t,e),t.prototype.add=function(e,t){},t}(k),j=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return M(t,e),t.prototype.add=function(e,t){},t}(k),U=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return M(t,e),t.prototype.record=function(e,t){},t}(k),F=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return M(t,e),t.prototype.record=function(e,t){},t}(k),q=function(){function e(){}return e.prototype.addCallback=function(e){},e.prototype.removeCallback=function(e){},e}(),$=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return M(t,e),t}(q),G=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return M(t,e),t}(q),H=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return M(t,e),t}(q),V=new D,W=new B,Q=new U,Y=new F,X=new j,z=new $,K=new G,J=new H;function Z(){return V}var ee=new(function(){function e(){}return e.prototype.getMeter=function(e,t,r){return V},e}()),et="metrics",er=(function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalMeterProvider=function(e){return y(et,e,A.instance())},e.prototype.getMeterProvider=function(){return b(et)||ee},e.prototype.getMeter=function(e,t,r){return this.getMeterProvider().getMeter(e,t,r)},e.prototype.disable=function(){v(et,A.instance())},e})().getInstance(),en=function(){function e(){}return e.prototype.inject=function(e,t){},e.prototype.extract=function(e,t){return e},e.prototype.fields=function(){return[]},e}(),ei={get:function(e,t){if(null!=e)return e[t]},keys:function(e){return null==e?[]:Object.keys(e)}},es={set:function(e,t,r){null!=e&&(e[t]=r)}},eo=t("OpenTelemetry Baggage Key");function ea(e){return e.getValue(eo)||void 0}function eu(){return ea(I.getInstance().active())}function ec(e,t){return e.setValue(eo,t)}function el(e){return e.deleteValue(eo)}var eh=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return o},ef=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ed=function(){function e(e){this._entries=e?new Map(e):new Map}return e.prototype.getEntry=function(e){var t=this._entries.get(e);if(t)return Object.assign({},t)},e.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(e){var t=eh(e,2);return[t[0],t[1]]})},e.prototype.setEntry=function(t,r){var n=new e(this._entries);return n._entries.set(t,r),n},e.prototype.removeEntry=function(t){var r=new e(this._entries);return r._entries.delete(t),r},e.prototype.removeEntries=function(){for(var t,r,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var s=new e(this._entries);try{for(var o=ef(n),a=o.next();!a.done;a=o.next()){var u=a.value;s._entries.delete(u)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return s},e.prototype.clear=function(){return new e},e}(),ep=Symbol("BaggageEntryMetadata"),eg=A.instance();function em(e){return void 0===e&&(e={}),new ed(new Map(Object.entries(e)))}function ey(e){return"string"!=typeof e&&(eg.error("Cannot create baggage metadata from unknown type: "+typeof e),e=""),{__TYPE__:ep,toString:function(){return e}}}var eb="propagation",ev=new en,e_=(function(){function e(){this.createBaggage=em,this.getBaggage=ea,this.getActiveBaggage=eu,this.setBaggage=ec,this.deleteBaggage=el}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalPropagator=function(e){return y(eb,e,A.instance())},e.prototype.inject=function(e,t,r){return void 0===r&&(r=es),this._getGlobalPropagator().inject(e,t,r)},e.prototype.extract=function(e,t,r){return void 0===r&&(r=ei),this._getGlobalPropagator().extract(e,t,r)},e.prototype.fields=function(){return this._getGlobalPropagator().fields()},e.prototype.disable=function(){v(eb,A.instance())},e.prototype._getGlobalPropagator=function(){return b(eb)||ev},e})().getInstance();!function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"}(n||(n={}));var ew="0000000000000000",eE="00000000000000000000000000000000",eS={traceId:eE,spanId:ew,traceFlags:n.NONE},eR=function(){function e(e){void 0===e&&(e=eS),this._spanContext=e}return e.prototype.spanContext=function(){return this._spanContext},e.prototype.setAttribute=function(e,t){return this},e.prototype.setAttributes=function(e){return this},e.prototype.addEvent=function(e,t){return this},e.prototype.addLink=function(e){return this},e.prototype.addLinks=function(e){return this},e.prototype.setStatus=function(e){return this},e.prototype.updateName=function(e){return this},e.prototype.end=function(e){},e.prototype.isRecording=function(){return!1},e.prototype.recordException=function(e,t){},e}(),ex=t("OpenTelemetry Context Key SPAN");function eA(e){return e.getValue(ex)||void 0}function eT(){return eA(I.getInstance().active())}function eP(e,t){return e.setValue(ex,t)}function eO(e){return e.deleteValue(ex)}function eC(e,t){return eP(e,new eR(t))}function eI(e){var t;return null==(t=eA(e))?void 0:t.spanContext()}var eN=/^([0-9a-f]{32})$/i,eL=/^[0-9a-f]{16}$/i;function eM(e){return eN.test(e)&&e!==eE}function eD(e){return eL.test(e)&&e!==ew}function ek(e){return eM(e.traceId)&&eD(e.spanId)}function eB(e){return new eR(e)}var ej=I.getInstance(),eU=function(){function e(){}return e.prototype.startSpan=function(e,t,r){if(void 0===r&&(r=ej.active()),null==t?void 0:t.root)return new eR;var n,i=r&&eI(r);return"object"==typeof(n=i)&&"string"==typeof n.spanId&&"string"==typeof n.traceId&&"number"==typeof n.traceFlags&&ek(i)?new eR(i):new eR},e.prototype.startActiveSpan=function(e,t,r,n){if(!(arguments.length<2)){2==arguments.length?o=t:3==arguments.length?(i=t,o=r):(i=t,s=r,o=n);var i,s,o,a=null!=s?s:ej.active(),u=this.startSpan(e,i,a),c=eP(a,u);return ej.with(c,o,void 0,u)}},e}(),eF=new eU,eq=function(){function e(e,t,r,n){this._provider=e,this.name=t,this.version=r,this.options=n}return e.prototype.startSpan=function(e,t,r){return this._getTracer().startSpan(e,t,r)},e.prototype.startActiveSpan=function(e,t,r,n){var i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)},e.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):eF},e}(),e$=new(function(){function e(){}return e.prototype.getTracer=function(e,t,r){return new eU},e}()),eG=function(){function e(){}return e.prototype.getTracer=function(e,t,r){var n;return null!=(n=this.getDelegateTracer(e,t,r))?n:new eq(this,e,t,r)},e.prototype.getDelegate=function(){var e;return null!=(e=this._delegate)?e:e$},e.prototype.setDelegate=function(e){this._delegate=e},e.prototype.getDelegateTracer=function(e,t,r){var n;return null==(n=this._delegate)?void 0:n.getTracer(e,t,r)},e}(),eH="trace",eV=(function(){function e(){this._proxyTracerProvider=new eG,this.wrapSpanContext=eB,this.isSpanContextValid=ek,this.deleteSpan=eO,this.getSpan=eA,this.getActiveSpan=eT,this.getSpanContext=eI,this.setSpan=eP,this.setSpanContext=eC}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalTracerProvider=function(e){var t=y(eH,this._proxyTracerProvider,A.instance());return t&&this._proxyTracerProvider.setDelegate(e),t},e.prototype.getTracerProvider=function(){return b(eH)||this._proxyTracerProvider},e.prototype.getTracer=function(e,t){return this.getTracerProvider().getTracer(e,t)},e.prototype.disable=function(){v(eH,A.instance()),this._proxyTracerProvider=new eG},e})().getInstance();let eW={context:N,diag:L,metrics:er,propagation:e_,trace:eV};e.i(81087);var eQ=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],eY=function(){for(var e=0;e<eQ.length;e++)this[eQ[e].n]=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];if(console){var n=console[e];if("function"!=typeof n&&(n=console.log),"function"==typeof n)return n.apply(console,t)}}}(eQ[e].c)};!function(e){e[e.INT=0]="INT",e[e.DOUBLE=1]="DOUBLE"}(i||(i={})),function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"}(s||(s={})),function(e){e[e.INTERNAL=0]="INTERNAL",e[e.SERVER=1]="SERVER",e[e.CLIENT=2]="CLIENT",e[e.PRODUCER=3]="PRODUCER",e[e.CONSUMER=4]="CONSUMER"}(o||(o={})),function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"}(a||(a={}));var eX="[_0-9a-z-*/]",ez=RegExp("^(?:[a-z]"+eX+"{0,255}|"+("[a-z0-9]"+eX+"{0,240}@[a-z]")+eX+"{0,13})$"),eK=/^[ -~]{0,255}[!-~]$/,eJ=/,|=/,eZ=function(){function e(e){this._internalState=new Map,e&&this._parse(e)}return e.prototype.set=function(e,t){var r=this._clone();return r._internalState.has(e)&&r._internalState.delete(e),r._internalState.set(e,t),r},e.prototype.unset=function(e){var t=this._clone();return t._internalState.delete(e),t},e.prototype.get=function(e){return this._internalState.get(e)},e.prototype.serialize=function(){var e=this;return this._keys().reduce(function(t,r){return t.push(r+"="+e.get(r)),t},[]).join(",")},e.prototype._parse=function(e){!(e.length>512)&&(this._internalState=e.split(",").reverse().reduce(function(e,t){var r=t.trim(),n=r.indexOf("=");if(-1!==n){var i=r.slice(0,n),s=r.slice(n+1,t.length);ez.test(i)&&eK.test(s)&&!eJ.test(s)&&e.set(i,s)}return e},new Map),this._internalState.size>32&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,32))))},e.prototype._keys=function(){return Array.from(this._internalState.keys()).reverse()},e.prototype._clone=function(){var t=new e;return t._internalState=new Map(this._internalState),t},e}();function e0(e){return new eZ(e)}},39583,(e,t,r)=>{(()=>{"use strict";var r={491:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ContextAPI=void 0;let n=r(223),i=r(172),s=r(930),o="context",a=new n.NoopContextManager;class u{constructor(){}static getInstance(){return this._instance||(this._instance=new u),this._instance}setGlobalContextManager(e){return(0,i.registerGlobal)(o,e,s.DiagAPI.instance())}active(){return this._getContextManager().active()}with(e,t,r,...n){return this._getContextManager().with(e,t,r,...n)}bind(e,t){return this._getContextManager().bind(e,t)}_getContextManager(){return(0,i.getGlobal)(o)||a}disable(){this._getContextManager().disable(),(0,i.unregisterGlobal)(o,s.DiagAPI.instance())}}t.ContextAPI=u},930:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagAPI=void 0;let n=r(56),i=r(912),s=r(957),o=r(172);class a{constructor(){function e(e){return function(...t){let r=(0,o.getGlobal)("diag");if(r)return r[e](...t)}}let t=this;t.setLogger=(e,r={logLevel:s.DiagLogLevel.INFO})=>{var n,a,u;if(e===t){let e=Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return t.error(null!=(n=e.stack)?n:e.message),!1}"number"==typeof r&&(r={logLevel:r});let c=(0,o.getGlobal)("diag"),l=(0,i.createLogLevelDiagLogger)(null!=(a=r.logLevel)?a:s.DiagLogLevel.INFO,e);if(c&&!r.suppressOverrideMessage){let e=null!=(u=Error().stack)?u:"<failed to generate stacktrace>";c.warn(`Current logger will be overwritten from ${e}`),l.warn(`Current logger will overwrite one already registered from ${e}`)}return(0,o.registerGlobal)("diag",l,t,!0)},t.disable=()=>{(0,o.unregisterGlobal)("diag",t)},t.createComponentLogger=e=>new n.DiagComponentLogger(e),t.verbose=e("verbose"),t.debug=e("debug"),t.info=e("info"),t.warn=e("warn"),t.error=e("error")}static instance(){return this._instance||(this._instance=new a),this._instance}}t.DiagAPI=a},653:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MetricsAPI=void 0;let n=r(660),i=r(172),s=r(930),o="metrics";class a{constructor(){}static getInstance(){return this._instance||(this._instance=new a),this._instance}setGlobalMeterProvider(e){return(0,i.registerGlobal)(o,e,s.DiagAPI.instance())}getMeterProvider(){return(0,i.getGlobal)(o)||n.NOOP_METER_PROVIDER}getMeter(e,t,r){return this.getMeterProvider().getMeter(e,t,r)}disable(){(0,i.unregisterGlobal)(o,s.DiagAPI.instance())}}t.MetricsAPI=a},181:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropagationAPI=void 0;let n=r(172),i=r(874),s=r(194),o=r(277),a=r(369),u=r(930),c="propagation",l=new i.NoopTextMapPropagator;class h{constructor(){this.createBaggage=a.createBaggage,this.getBaggage=o.getBaggage,this.getActiveBaggage=o.getActiveBaggage,this.setBaggage=o.setBaggage,this.deleteBaggage=o.deleteBaggage}static getInstance(){return this._instance||(this._instance=new h),this._instance}setGlobalPropagator(e){return(0,n.registerGlobal)(c,e,u.DiagAPI.instance())}inject(e,t,r=s.defaultTextMapSetter){return this._getGlobalPropagator().inject(e,t,r)}extract(e,t,r=s.defaultTextMapGetter){return this._getGlobalPropagator().extract(e,t,r)}fields(){return this._getGlobalPropagator().fields()}disable(){(0,n.unregisterGlobal)(c,u.DiagAPI.instance())}_getGlobalPropagator(){return(0,n.getGlobal)(c)||l}}t.PropagationAPI=h},997:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceAPI=void 0;let n=r(172),i=r(846),s=r(139),o=r(607),a=r(930),u="trace";class c{constructor(){this._proxyTracerProvider=new i.ProxyTracerProvider,this.wrapSpanContext=s.wrapSpanContext,this.isSpanContextValid=s.isSpanContextValid,this.deleteSpan=o.deleteSpan,this.getSpan=o.getSpan,this.getActiveSpan=o.getActiveSpan,this.getSpanContext=o.getSpanContext,this.setSpan=o.setSpan,this.setSpanContext=o.setSpanContext}static getInstance(){return this._instance||(this._instance=new c),this._instance}setGlobalTracerProvider(e){let t=(0,n.registerGlobal)(u,this._proxyTracerProvider,a.DiagAPI.instance());return t&&this._proxyTracerProvider.setDelegate(e),t}getTracerProvider(){return(0,n.getGlobal)(u)||this._proxyTracerProvider}getTracer(e,t){return this.getTracerProvider().getTracer(e,t)}disable(){(0,n.unregisterGlobal)(u,a.DiagAPI.instance()),this._proxyTracerProvider=new i.ProxyTracerProvider}}t.TraceAPI=c},277:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.deleteBaggage=t.setBaggage=t.getActiveBaggage=t.getBaggage=void 0;let n=r(491),i=(0,r(780).createContextKey)("OpenTelemetry Baggage Key");function s(e){return e.getValue(i)||void 0}t.getBaggage=s,t.getActiveBaggage=function(){return s(n.ContextAPI.getInstance().active())},t.setBaggage=function(e,t){return e.setValue(i,t)},t.deleteBaggage=function(e){return e.deleteValue(i)}},993:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaggageImpl=void 0;class r{constructor(e){this._entries=e?new Map(e):new Map}getEntry(e){let t=this._entries.get(e);if(t)return Object.assign({},t)}getAllEntries(){return Array.from(this._entries.entries()).map(([e,t])=>[e,t])}setEntry(e,t){let n=new r(this._entries);return n._entries.set(e,t),n}removeEntry(e){let t=new r(this._entries);return t._entries.delete(e),t}removeEntries(...e){let t=new r(this._entries);for(let r of e)t._entries.delete(r);return t}clear(){return new r}}t.BaggageImpl=r},830:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.baggageEntryMetadataSymbol=void 0,t.baggageEntryMetadataSymbol=Symbol("BaggageEntryMetadata")},369:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.baggageEntryMetadataFromString=t.createBaggage=void 0;let n=r(930),i=r(993),s=r(830),o=n.DiagAPI.instance();t.createBaggage=function(e={}){return new i.BaggageImpl(new Map(Object.entries(e)))},t.baggageEntryMetadataFromString=function(e){return"string"!=typeof e&&(o.error(`Cannot create baggage metadata from unknown type: ${typeof e}`),e=""),{__TYPE__:s.baggageEntryMetadataSymbol,toString:()=>e}}},67:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.context=void 0,t.context=r(491).ContextAPI.getInstance()},223:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopContextManager=void 0;let n=r(780);t.NoopContextManager=class{active(){return n.ROOT_CONTEXT}with(e,t,r,...n){return t.call(r,...n)}bind(e,t){return t}enable(){return this}disable(){return this}}},780:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ROOT_CONTEXT=t.createContextKey=void 0,t.createContextKey=function(e){return Symbol.for(e)};class r{constructor(e){let t=this;t._currentContext=e?new Map(e):new Map,t.getValue=e=>t._currentContext.get(e),t.setValue=(e,n)=>{let i=new r(t._currentContext);return i._currentContext.set(e,n),i},t.deleteValue=e=>{let n=new r(t._currentContext);return n._currentContext.delete(e),n}}}t.ROOT_CONTEXT=new r},506:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.diag=void 0,t.diag=r(930).DiagAPI.instance()},56:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagComponentLogger=void 0;let n=r(172);function i(e,t,r){let i=(0,n.getGlobal)("diag");if(i)return r.unshift(t),i[e](...r)}t.DiagComponentLogger=class{constructor(e){this._namespace=e.namespace||"DiagComponentLogger"}debug(...e){return i("debug",this._namespace,e)}error(...e){return i("error",this._namespace,e)}info(...e){return i("info",this._namespace,e)}warn(...e){return i("warn",this._namespace,e)}verbose(...e){return i("verbose",this._namespace,e)}}},972:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagConsoleLogger=void 0;let r=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}];t.DiagConsoleLogger=class{constructor(){for(let e=0;e<r.length;e++)this[r[e].n]=function(e){return function(...t){if(console){let r=console[e];if("function"!=typeof r&&(r=console.log),"function"==typeof r)return r.apply(console,t)}}}(r[e].c)}}},912:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createLogLevelDiagLogger=void 0;let n=r(957);t.createLogLevelDiagLogger=function(e,t){function r(r,n){let i=t[r];return"function"==typeof i&&e>=n?i.bind(t):function(){}}return e<n.DiagLogLevel.NONE?e=n.DiagLogLevel.NONE:e>n.DiagLogLevel.ALL&&(e=n.DiagLogLevel.ALL),t=t||{},{error:r("error",n.DiagLogLevel.ERROR),warn:r("warn",n.DiagLogLevel.WARN),info:r("info",n.DiagLogLevel.INFO),debug:r("debug",n.DiagLogLevel.DEBUG),verbose:r("verbose",n.DiagLogLevel.VERBOSE)}}},957:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagLogLevel=void 0,function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"}(t.DiagLogLevel||(t.DiagLogLevel={}))},172:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.unregisterGlobal=t.getGlobal=t.registerGlobal=void 0;let n=r(200),i=r(521),s=r(130),o=i.VERSION.split(".")[0],a=Symbol.for(`opentelemetry.js.api.${o}`),u=n._globalThis;t.registerGlobal=function(e,t,r,n=!1){var s;let o=u[a]=null!=(s=u[a])?s:{version:i.VERSION};if(!n&&o[e]){let t=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return r.error(t.stack||t.message),!1}if(o.version!==i.VERSION){let t=Error(`@opentelemetry/api: Registration of version v${o.version} for ${e} does not match previously registered API v${i.VERSION}`);return r.error(t.stack||t.message),!1}return o[e]=t,r.debug(`@opentelemetry/api: Registered a global for ${e} v${i.VERSION}.`),!0},t.getGlobal=function(e){var t,r;let n=null==(t=u[a])?void 0:t.version;if(n&&(0,s.isCompatible)(n))return null==(r=u[a])?void 0:r[e]},t.unregisterGlobal=function(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${i.VERSION}.`);let r=u[a];r&&delete r[e]}},130:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isCompatible=t._makeCompatibilityCheck=void 0;let n=r(521),i=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function s(e){let t=new Set([e]),r=new Set,n=e.match(i);if(!n)return()=>!1;let s={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};if(null!=s.prerelease)return function(t){return t===e};function o(e){return r.add(e),!1}return function(e){if(t.has(e))return!0;if(r.has(e))return!1;let n=e.match(i);if(!n)return o(e);let a={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};if(null!=a.prerelease||s.major!==a.major)return o(e);if(0===s.major)return s.minor===a.minor&&s.patch<=a.patch?(t.add(e),!0):o(e);return s.minor<=a.minor?(t.add(e),!0):o(e)}}t._makeCompatibilityCheck=s,t.isCompatible=s(n.VERSION)},886:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.metrics=void 0,t.metrics=r(653).MetricsAPI.getInstance()},901:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ValueType=void 0,function(e){e[e.INT=0]="INT",e[e.DOUBLE=1]="DOUBLE"}(t.ValueType||(t.ValueType={}))},102:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createNoopMeter=t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=t.NOOP_OBSERVABLE_GAUGE_METRIC=t.NOOP_OBSERVABLE_COUNTER_METRIC=t.NOOP_UP_DOWN_COUNTER_METRIC=t.NOOP_HISTOGRAM_METRIC=t.NOOP_COUNTER_METRIC=t.NOOP_METER=t.NoopObservableUpDownCounterMetric=t.NoopObservableGaugeMetric=t.NoopObservableCounterMetric=t.NoopObservableMetric=t.NoopHistogramMetric=t.NoopUpDownCounterMetric=t.NoopCounterMetric=t.NoopMetric=t.NoopMeter=void 0;class r{constructor(){}createHistogram(e,r){return t.NOOP_HISTOGRAM_METRIC}createCounter(e,r){return t.NOOP_COUNTER_METRIC}createUpDownCounter(e,r){return t.NOOP_UP_DOWN_COUNTER_METRIC}createObservableGauge(e,r){return t.NOOP_OBSERVABLE_GAUGE_METRIC}createObservableCounter(e,r){return t.NOOP_OBSERVABLE_COUNTER_METRIC}createObservableUpDownCounter(e,r){return t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}}t.NoopMeter=r;class n{}t.NoopMetric=n;class i extends n{add(e,t){}}t.NoopCounterMetric=i;class s extends n{add(e,t){}}t.NoopUpDownCounterMetric=s;class o extends n{record(e,t){}}t.NoopHistogramMetric=o;class a{addCallback(e){}removeCallback(e){}}t.NoopObservableMetric=a;class u extends a{}t.NoopObservableCounterMetric=u;class c extends a{}t.NoopObservableGaugeMetric=c;class l extends a{}t.NoopObservableUpDownCounterMetric=l,t.NOOP_METER=new r,t.NOOP_COUNTER_METRIC=new i,t.NOOP_HISTOGRAM_METRIC=new o,t.NOOP_UP_DOWN_COUNTER_METRIC=new s,t.NOOP_OBSERVABLE_COUNTER_METRIC=new u,t.NOOP_OBSERVABLE_GAUGE_METRIC=new c,t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=new l,t.createNoopMeter=function(){return t.NOOP_METER}},660:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NOOP_METER_PROVIDER=t.NoopMeterProvider=void 0;let n=r(102);class i{getMeter(e,t,r){return n.NOOP_METER}}t.NoopMeterProvider=i,t.NOOP_METER_PROVIDER=new i},200:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(46),t)},651:(t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r._globalThis=void 0,r._globalThis="object"==typeof globalThis?globalThis:e.g},46:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(651),t)},939:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.propagation=void 0,t.propagation=r(181).PropagationAPI.getInstance()},874:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTextMapPropagator=void 0,t.NoopTextMapPropagator=class{inject(e,t){}extract(e,t){return e}fields(){return[]}}},194:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultTextMapSetter=t.defaultTextMapGetter=void 0,t.defaultTextMapGetter={get(e,t){if(null!=e)return e[t]},keys:e=>null==e?[]:Object.keys(e)},t.defaultTextMapSetter={set(e,t,r){null!=e&&(e[t]=r)}}},845:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.trace=void 0,t.trace=r(997).TraceAPI.getInstance()},403:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NonRecordingSpan=void 0;let n=r(476);t.NonRecordingSpan=class{constructor(e=n.INVALID_SPAN_CONTEXT){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,t){return this}setAttributes(e){return this}addEvent(e,t){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,t){}}},614:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTracer=void 0;let n=r(491),i=r(607),s=r(403),o=r(139),a=n.ContextAPI.getInstance();t.NoopTracer=class{startSpan(e,t,r=a.active()){var n;if(null==t?void 0:t.root)return new s.NonRecordingSpan;let u=r&&(0,i.getSpanContext)(r);return"object"==typeof(n=u)&&"string"==typeof n.spanId&&"string"==typeof n.traceId&&"number"==typeof n.traceFlags&&(0,o.isSpanContextValid)(u)?new s.NonRecordingSpan(u):new s.NonRecordingSpan}startActiveSpan(e,t,r,n){let s,o,u;if(arguments.length<2)return;2==arguments.length?u=t:3==arguments.length?(s=t,u=r):(s=t,o=r,u=n);let c=null!=o?o:a.active(),l=this.startSpan(e,s,c),h=(0,i.setSpan)(c,l);return a.with(h,u,void 0,l)}}},124:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTracerProvider=void 0;let n=r(614);t.NoopTracerProvider=class{getTracer(e,t,r){return new n.NoopTracer}}},125:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyTracer=void 0;let n=new(r(614)).NoopTracer;t.ProxyTracer=class{constructor(e,t,r,n){this._provider=e,this.name=t,this.version=r,this.options=n}startSpan(e,t,r){return this._getTracer().startSpan(e,t,r)}startActiveSpan(e,t,r,n){let i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)}_getTracer(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):n}}},846:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyTracerProvider=void 0;let n=r(125),i=new(r(124)).NoopTracerProvider;t.ProxyTracerProvider=class{getTracer(e,t,r){var i;return null!=(i=this.getDelegateTracer(e,t,r))?i:new n.ProxyTracer(this,e,t,r)}getDelegate(){var e;return null!=(e=this._delegate)?e:i}setDelegate(e){this._delegate=e}getDelegateTracer(e,t,r){var n;return null==(n=this._delegate)?void 0:n.getTracer(e,t,r)}}},996:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SamplingDecision=void 0,function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"}(t.SamplingDecision||(t.SamplingDecision={}))},607:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getSpanContext=t.setSpanContext=t.deleteSpan=t.setSpan=t.getActiveSpan=t.getSpan=void 0;let n=r(780),i=r(403),s=r(491),o=(0,n.createContextKey)("OpenTelemetry Context Key SPAN");function a(e){return e.getValue(o)||void 0}function u(e,t){return e.setValue(o,t)}t.getSpan=a,t.getActiveSpan=function(){return a(s.ContextAPI.getInstance().active())},t.setSpan=u,t.deleteSpan=function(e){return e.deleteValue(o)},t.setSpanContext=function(e,t){return u(e,new i.NonRecordingSpan(t))},t.getSpanContext=function(e){var t;return null==(t=a(e))?void 0:t.spanContext()}},325:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceStateImpl=void 0;let n=r(564);class i{constructor(e){this._internalState=new Map,e&&this._parse(e)}set(e,t){let r=this._clone();return r._internalState.has(e)&&r._internalState.delete(e),r._internalState.set(e,t),r}unset(e){let t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=>(e.push(t+"="+this.get(t)),e),[]).join(",")}_parse(e){!(e.length>512)&&(this._internalState=e.split(",").reverse().reduce((e,t)=>{let r=t.trim(),i=r.indexOf("=");if(-1!==i){let s=r.slice(0,i),o=r.slice(i+1,t.length);(0,n.validateKey)(s)&&(0,n.validateValue)(o)&&e.set(s,o)}return e},new Map),this._internalState.size>32&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,32))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new i;return e._internalState=new Map(this._internalState),e}}t.TraceStateImpl=i},564:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateValue=t.validateKey=void 0;let r="[_0-9a-z-*/]",n=`[a-z]${r}{0,255}`,i=`[a-z0-9]${r}{0,240}@[a-z]${r}{0,13}`,s=RegExp(`^(?:${n}|${i})$`),o=/^[ -~]{0,255}[!-~]$/,a=/,|=/;t.validateKey=function(e){return s.test(e)},t.validateValue=function(e){return o.test(e)&&!a.test(e)}},98:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createTraceState=void 0;let n=r(325);t.createTraceState=function(e){return new n.TraceStateImpl(e)}},476:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.INVALID_SPAN_CONTEXT=t.INVALID_TRACEID=t.INVALID_SPANID=void 0;let n=r(475);t.INVALID_SPANID="0000000000000000",t.INVALID_TRACEID="00000000000000000000000000000000",t.INVALID_SPAN_CONTEXT={traceId:t.INVALID_TRACEID,spanId:t.INVALID_SPANID,traceFlags:n.TraceFlags.NONE}},357:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SpanKind=void 0,function(e){e[e.INTERNAL=0]="INTERNAL",e[e.SERVER=1]="SERVER",e[e.CLIENT=2]="CLIENT",e[e.PRODUCER=3]="PRODUCER",e[e.CONSUMER=4]="CONSUMER"}(t.SpanKind||(t.SpanKind={}))},139:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.wrapSpanContext=t.isSpanContextValid=t.isValidSpanId=t.isValidTraceId=void 0;let n=r(476),i=r(403),s=/^([0-9a-f]{32})$/i,o=/^[0-9a-f]{16}$/i;function a(e){return s.test(e)&&e!==n.INVALID_TRACEID}function u(e){return o.test(e)&&e!==n.INVALID_SPANID}t.isValidTraceId=a,t.isValidSpanId=u,t.isSpanContextValid=function(e){return a(e.traceId)&&u(e.spanId)},t.wrapSpanContext=function(e){return new i.NonRecordingSpan(e)}},847:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SpanStatusCode=void 0,function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"}(t.SpanStatusCode||(t.SpanStatusCode={}))},475:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceFlags=void 0,function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"}(t.TraceFlags||(t.TraceFlags={}))},521:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,t.VERSION="1.6.0"}},n={};function i(e){var t=n[e];if(void 0!==t)return t.exports;var s=n[e]={exports:{}},o=!0;try{r[e].call(s.exports,s,s.exports,i),o=!1}finally{o&&delete n[e]}return s.exports}i.ab="/ROOT/supercorp/superinterface/node_modules/next/dist/compiled/@opentelemetry/api/";var s={};(()=>{Object.defineProperty(s,"__esModule",{value:!0}),s.trace=s.propagation=s.metrics=s.diag=s.context=s.INVALID_SPAN_CONTEXT=s.INVALID_TRACEID=s.INVALID_SPANID=s.isValidSpanId=s.isValidTraceId=s.isSpanContextValid=s.createTraceState=s.TraceFlags=s.SpanStatusCode=s.SpanKind=s.SamplingDecision=s.ProxyTracerProvider=s.ProxyTracer=s.defaultTextMapSetter=s.defaultTextMapGetter=s.ValueType=s.createNoopMeter=s.DiagLogLevel=s.DiagConsoleLogger=s.ROOT_CONTEXT=s.createContextKey=s.baggageEntryMetadataFromString=void 0;var e=i(369);Object.defineProperty(s,"baggageEntryMetadataFromString",{enumerable:!0,get:function(){return e.baggageEntryMetadataFromString}});var t=i(780);Object.defineProperty(s,"createContextKey",{enumerable:!0,get:function(){return t.createContextKey}}),Object.defineProperty(s,"ROOT_CONTEXT",{enumerable:!0,get:function(){return t.ROOT_CONTEXT}});var r=i(972);Object.defineProperty(s,"DiagConsoleLogger",{enumerable:!0,get:function(){return r.DiagConsoleLogger}});var n=i(957);Object.defineProperty(s,"DiagLogLevel",{enumerable:!0,get:function(){return n.DiagLogLevel}});var o=i(102);Object.defineProperty(s,"createNoopMeter",{enumerable:!0,get:function(){return o.createNoopMeter}});var a=i(901);Object.defineProperty(s,"ValueType",{enumerable:!0,get:function(){return a.ValueType}});var u=i(194);Object.defineProperty(s,"defaultTextMapGetter",{enumerable:!0,get:function(){return u.defaultTextMapGetter}}),Object.defineProperty(s,"defaultTextMapSetter",{enumerable:!0,get:function(){return u.defaultTextMapSetter}});var c=i(125);Object.defineProperty(s,"ProxyTracer",{enumerable:!0,get:function(){return c.ProxyTracer}});var l=i(846);Object.defineProperty(s,"ProxyTracerProvider",{enumerable:!0,get:function(){return l.ProxyTracerProvider}});var h=i(996);Object.defineProperty(s,"SamplingDecision",{enumerable:!0,get:function(){return h.SamplingDecision}});var f=i(357);Object.defineProperty(s,"SpanKind",{enumerable:!0,get:function(){return f.SpanKind}});var d=i(847);Object.defineProperty(s,"SpanStatusCode",{enumerable:!0,get:function(){return d.SpanStatusCode}});var p=i(475);Object.defineProperty(s,"TraceFlags",{enumerable:!0,get:function(){return p.TraceFlags}});var g=i(98);Object.defineProperty(s,"createTraceState",{enumerable:!0,get:function(){return g.createTraceState}});var m=i(139);Object.defineProperty(s,"isSpanContextValid",{enumerable:!0,get:function(){return m.isSpanContextValid}}),Object.defineProperty(s,"isValidTraceId",{enumerable:!0,get:function(){return m.isValidTraceId}}),Object.defineProperty(s,"isValidSpanId",{enumerable:!0,get:function(){return m.isValidSpanId}});var y=i(476);Object.defineProperty(s,"INVALID_SPANID",{enumerable:!0,get:function(){return y.INVALID_SPANID}}),Object.defineProperty(s,"INVALID_TRACEID",{enumerable:!0,get:function(){return y.INVALID_TRACEID}}),Object.defineProperty(s,"INVALID_SPAN_CONTEXT",{enumerable:!0,get:function(){return y.INVALID_SPAN_CONTEXT}});let b=i(67);Object.defineProperty(s,"context",{enumerable:!0,get:function(){return b.context}});let v=i(506);Object.defineProperty(s,"diag",{enumerable:!0,get:function(){return v.diag}});let _=i(886);Object.defineProperty(s,"metrics",{enumerable:!0,get:function(){return _.metrics}});let w=i(939);Object.defineProperty(s,"propagation",{enumerable:!0,get:function(){return w.propagation}});let E=i(845);Object.defineProperty(s,"trace",{enumerable:!0,get:function(){return E.trace}}),s.default={context:b.context,diag:v.diag,metrics:_.metrics,propagation:w.propagation,trace:E.trace}})(),t.exports=s})()},62087,(e,t,r)=>{"use strict";t.exports=e.r(18622)},41141,(e,t,r)=>{"use strict";t.exports=e.r(62087).vendored["react-rsc"].React},18780,(e,t,r)=>{"use strict";var n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={};function u(e){var t;let r=["path"in e&&e.path&&`Path=${e.path}`,"expires"in e&&(e.expires||0===e.expires)&&`Expires=${("number"==typeof e.expires?new Date(e.expires):e.expires).toUTCString()}`,"maxAge"in e&&"number"==typeof e.maxAge&&`Max-Age=${e.maxAge}`,"domain"in e&&e.domain&&`Domain=${e.domain}`,"secure"in e&&e.secure&&"Secure","httpOnly"in e&&e.httpOnly&&"HttpOnly","sameSite"in e&&e.sameSite&&`SameSite=${e.sameSite}`,"partitioned"in e&&e.partitioned&&"Partitioned","priority"in e&&e.priority&&`Priority=${e.priority}`].filter(Boolean),n=`${e.name}=${encodeURIComponent(null!=(t=e.value)?t:"")}`;return 0===r.length?n:`${n}; ${r.join("; ")}`}function c(e){let t=new Map;for(let r of e.split(/; */)){if(!r)continue;let e=r.indexOf("=");if(-1===e){t.set(r,"true");continue}let[n,i]=[r.slice(0,e),r.slice(e+1)];try{t.set(n,decodeURIComponent(null!=i?i:"true"))}catch{}}return t}function l(e){if(!e)return;let[[t,r],...n]=c(e),{domain:i,expires:s,httponly:o,maxage:a,path:u,samesite:l,secure:d,partitioned:p,priority:g}=Object.fromEntries(n.map(([e,t])=>[e.toLowerCase().replace(/-/g,""),t]));{var m,y,b={name:t,value:decodeURIComponent(r),domain:i,...s&&{expires:new Date(s)},...o&&{httpOnly:!0},..."string"==typeof a&&{maxAge:Number(a)},path:u,...l&&{sameSite:h.includes(m=(m=l).toLowerCase())?m:void 0},...d&&{secure:!0},...g&&{priority:f.includes(y=(y=g).toLowerCase())?y:void 0},...p&&{partitioned:!0}};let e={};for(let t in b)b[t]&&(e[t]=b[t]);return e}}((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})(a,{RequestCookies:()=>d,ResponseCookies:()=>p,parseCookie:()=>c,parseSetCookie:()=>l,stringifyCookie:()=>u}),t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let u of s(t))o.call(e,u)||u===r||n(e,u,{get:()=>t[u],enumerable:!(a=i(t,u))||a.enumerable});return e})(n({},"__esModule",{value:!0}),a);var h=["strict","lax","none"],f=["low","medium","high"],d=class{constructor(e){this._parsed=new Map,this._headers=e;let t=e.get("cookie");if(t)for(let[e,r]of c(t))this._parsed.set(e,{name:e,value:r})}[Symbol.iterator](){return this._parsed[Symbol.iterator]()}get size(){return this._parsed.size}get(...e){let t="string"==typeof e[0]?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;let r=Array.from(this._parsed);if(!e.length)return r.map(([e,t])=>t);let n="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return r.filter(([e])=>e===n).map(([e,t])=>t)}has(e){return this._parsed.has(e)}set(...e){let[t,r]=1===e.length?[e[0].name,e[0].value]:e,n=this._parsed;return n.set(t,{name:t,value:r}),this._headers.set("cookie",Array.from(n).map(([e,t])=>u(t)).join("; ")),this}delete(e){let t=this._parsed,r=Array.isArray(e)?e.map(e=>t.delete(e)):t.delete(e);return this._headers.set("cookie",Array.from(t).map(([e,t])=>u(t)).join("; ")),r}clear(){return this.delete(Array.from(this._parsed.keys())),this}[Symbol.for("edge-runtime.inspect.custom")](){return`RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(e=>`${e.name}=${encodeURIComponent(e.value)}`).join("; ")}},p=class{constructor(e){var t,r,n;this._parsed=new Map,this._headers=e;let i=null!=(n=null!=(r=null==(t=e.getSetCookie)?void 0:t.call(e))?r:e.get("set-cookie"))?n:[];for(let e of Array.isArray(i)?i:function(e){if(!e)return[];var t,r,n,i,s,o=[],a=0;function u(){for(;a<e.length&&/\s/.test(e.charAt(a));)a+=1;return a<e.length}for(;a<e.length;){for(t=a,s=!1;u();)if(","===(r=e.charAt(a))){for(n=a,a+=1,u(),i=a;a<e.length&&"="!==(r=e.charAt(a))&&";"!==r&&","!==r;)a+=1;a<e.length&&"="===e.charAt(a)?(s=!0,a=i,o.push(e.substring(t,n)),t=a):a=n+1}else a+=1;(!s||a>=e.length)&&o.push(e.substring(t,e.length))}return o}(i)){let t=l(e);t&&this._parsed.set(t.name,t)}}get(...e){let t="string"==typeof e[0]?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;let r=Array.from(this._parsed.values());if(!e.length)return r;let n="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return r.filter(e=>e.name===n)}has(e){return this._parsed.has(e)}set(...e){let[t,r,n]=1===e.length?[e[0].name,e[0].value,e[0]]:e,i=this._parsed;return i.set(t,function(e={name:"",value:""}){return"number"==typeof e.expires&&(e.expires=new Date(e.expires)),e.maxAge&&(e.expires=new Date(Date.now()+1e3*e.maxAge)),(null===e.path||void 0===e.path)&&(e.path="/"),e}({name:t,value:r,...n})),function(e,t){for(let[,r]of(t.delete("set-cookie"),e)){let e=u(r);t.append("set-cookie",e)}}(i,this._headers),this}delete(...e){let[t,r]="string"==typeof e[0]?[e[0]]:[e[0].name,e[0]];return this.set({...r,name:t,value:"",expires:new Date(0)})}[Symbol.for("edge-runtime.inspect.custom")](){return`ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(u).join("; ")}}},38343,(e,t,r)=>{(()=>{"use strict";"undefined"!=typeof __nccwpck_require__&&(__nccwpck_require__.ab="/ROOT/supercorp/superinterface/node_modules/next/dist/compiled/cookie/");var e={};(()=>{e.parse=function(e,r){if("string"!=typeof e)throw TypeError("argument str must be a string");for(var i={},s=e.split(n),o=(r||{}).decode||t,a=0;a<s.length;a++){var u=s[a],c=u.indexOf("=");if(!(c<0)){var l=u.substr(0,c).trim(),h=u.substr(++c,u.length).trim();'"'==h[0]&&(h=h.slice(1,-1)),void 0==i[l]&&(i[l]=function(e,t){try{return t(e)}catch(t){return e}}(h,o))}}return i},e.serialize=function(e,t,n){var s=n||{},o=s.encode||r;if("function"!=typeof o)throw TypeError("option encode is invalid");if(!i.test(e))throw TypeError("argument name is invalid");var a=o(t);if(a&&!i.test(a))throw TypeError("argument val is invalid");var u=e+"="+a;if(null!=s.maxAge){var c=s.maxAge-0;if(isNaN(c)||!isFinite(c))throw TypeError("option maxAge is invalid");u+="; Max-Age="+Math.floor(c)}if(s.domain){if(!i.test(s.domain))throw TypeError("option domain is invalid");u+="; Domain="+s.domain}if(s.path){if(!i.test(s.path))throw TypeError("option path is invalid");u+="; Path="+s.path}if(s.expires){if("function"!=typeof s.expires.toUTCString)throw TypeError("option expires is invalid");u+="; Expires="+s.expires.toUTCString()}if(s.httpOnly&&(u+="; HttpOnly"),s.secure&&(u+="; Secure"),s.sameSite)switch("string"==typeof s.sameSite?s.sameSite.toLowerCase():s.sameSite){case!0:case"strict":u+="; SameSite=Strict";break;case"lax":u+="; SameSite=Lax";break;case"none":u+="; SameSite=None";break;default:throw TypeError("option sameSite is invalid")}return u};var t=decodeURIComponent,r=encodeURIComponent,n=/; */,i=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/})(),t.exports=e})()},81962,(e,t,r)=>{"use strict";function n(e){let t=null!=e;return function(r){let n=r.length-1;if(1===n)return[];if("}"!==r[n])throw Error("Invalid array text - must end with }");let i=0;if("["===r[0]&&(i=r.indexOf("=")+1),"{"!==r[i++])throw Error("Invalid array text - must start with {");let s=[],o=s,a=[],u=i,c="",l=!0;for(;i<n;++i){let s=r[i];if('"'===s){u=++i;let n=r.indexOf('"',u),s=r.indexOf("\\",u);for(;-1!==s&&s<n;)i=s,c+=r.slice(u,i),u=++i,n===i++&&(n=r.indexOf('"',i)),s=r.indexOf("\\",i);i=n,c+=r.slice(u,i),o.push(t?e(c):c),c="",l=!1}else if("{"===s){let e=[];o.push(e),a.push(o),o=e,u=i+1,l=!0}else if(","===s)l=!0;else if("}"===s){l=!1;let e=a.pop();if(void 0===e)throw Error("Invalid array text - too many '}'");o=e}else if(l){for(u=i;","!==(s=r[i])&&"}"!==s&&i<n;)++i;let a=r.slice(u,i--);o.push("NULL"===a?null:t?e(a):a),l=!1}else throw Error("Was expecting delimeter")}return s}}let i=n();r.parse=(e,t)=>null!=t?n(t)(e):i(e)},29173,(e,t,r)=>{t.exports=e.x("@prisma/client",()=>require("@prisma/client"))},89193,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{RequestCookies:function(){return n.RequestCookies},ResponseCookies:function(){return n.ResponseCookies},stringifyCookie:function(){return n.stringifyCookie}});let n=e.r(18780)},99667,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"ReflectAdapter",{enumerable:!0,get:function(){return n}});class n{static get(e,t,r){let n=Reflect.get(e,t,r);return"function"==typeof n?n.bind(e):n}static set(e,t,r,n){return Reflect.set(e,t,r,n)}static has(e,t){return Reflect.has(e,t)}static deleteProperty(e,t){return Reflect.deleteProperty(e,t)}}},94059,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{DynamicServerError:function(){return i},isDynamicServerError:function(){return s}});let n="DYNAMIC_SERVER_USAGE";class i extends Error{constructor(e){super("Dynamic server usage: "+e),this.description=e,this.digest=n}}function s(e){return"object"==typeof e&&null!==e&&"digest"in e&&"string"==typeof e.digest&&e.digest===n}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},78506,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{StaticGenBailoutError:function(){return i},isStaticGenBailoutError:function(){return s}});let n="NEXT_STATIC_GEN_BAILOUT";class i extends Error{constructor(...e){super(...e),this.code=n}}function s(e){return"object"==typeof e&&null!==e&&"code"in e&&e.code===n}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},53920,(e,t,r)=>{"use strict";function n(e){return"object"==typeof e&&null!==e&&"digest"in e&&e.digest===i}Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{isHangingPromiseRejectionError:function(){return n},makeDevtoolsIOAwarePromise:function(){return c},makeHangingPromise:function(){return a}});let i="HANGING_PROMISE_REJECTION";class s extends Error{constructor(e,t){super(`During prerendering, ${t} rejects when the prerender is complete. Typically these errors are handled by React but if you move ${t} to a different context by using \`setTimeout\`, \`after\`, or similar functions you may observe this error and you should handle it in that context. This occurred at route "${e}".`),this.route=e,this.expression=t,this.digest=i}}let o=new WeakMap;function a(e,t,r){if(e.aborted)return Promise.reject(new s(t,r));{let n=new Promise((n,i)=>{let a=i.bind(null,new s(t,r)),u=o.get(e);if(u)u.push(a);else{let t=[a];o.set(e,t),e.addEventListener("abort",()=>{for(let e=0;e<t.length;e++)t[e]()},{once:!0})}});return n.catch(u),n}}function u(){}function c(e){return new Promise(t=>{setTimeout(()=>{t(e)},0)})}},25812,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{METADATA_BOUNDARY_NAME:function(){return n},OUTLET_BOUNDARY_NAME:function(){return s},ROOT_LAYOUT_BOUNDARY_NAME:function(){return o},VIEWPORT_BOUNDARY_NAME:function(){return i}});let n="__next_metadata_boundary__",i="__next_viewport_boundary__",s="__next_outlet_boundary__",o="__next_root_layout_boundary__"},64244,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{atLeastOneTask:function(){return s},scheduleImmediate:function(){return i},scheduleOnNextTick:function(){return n},waitAtLeastOneReactRenderTask:function(){return o}});let n=e=>{Promise.resolve().then(()=>{process.nextTick(e)})},i=e=>{setImmediate(e)};function s(){return new Promise(e=>i(e))}function o(){return new Promise(e=>setImmediate(e))}},79920,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{BailoutToCSRError:function(){return i},isBailoutToCSRError:function(){return s}});let n="BAILOUT_TO_CLIENT_SIDE_RENDERING";class i extends Error{constructor(e){super("Bail out to client-side rendering: "+e),this.reason=e,this.digest=n}}function s(e){return"object"==typeof e&&null!==e&&"digest"in e&&e.digest===n}},4784,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"InvariantError",{enumerable:!0,get:function(){return n}});class n extends Error{constructor(e,t){super("Invariant: "+(e.endsWith(".")?e:e+".")+" This is a bug in Next.js.",t),this.name="InvariantError"}}},30810,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{Postpone:function(){return A},PreludeState:function(){return Q},abortAndThrowOnSynchronousRequestDataAccess:function(){return S},abortOnSynchronousPlatformIOAccess:function(){return w},accessedDynamicData:function(){return M},annotateDynamicAccess:function(){return U},consumeDynamicAccess:function(){return D},createDynamicTrackingState:function(){return p},createDynamicValidationState:function(){return g},createHangingInputAbortSignal:function(){return j},createRenderInBrowserAbortSignal:function(){return B},delayUntilRuntimeStage:function(){return z},formatDynamicAPIAccesses:function(){return k},getFirstDynamicReason:function(){return m},isDynamicPostpone:function(){return O},isPrerenderInterruptedError:function(){return L},logDisallowedDynamicError:function(){return Y},markCurrentScopeAsDynamic:function(){return y},postponeWithTracking:function(){return T},throwIfDisallowedDynamic:function(){return X},throwToInterruptStaticGeneration:function(){return b},trackAllowedDynamicAccess:function(){return W},trackDynamicDataInDynamicRender:function(){return v},trackSynchronousPlatformIOAccessInDev:function(){return E},trackSynchronousRequestDataAccessInDev:function(){return x},useDynamicRouteParams:function(){return F},warnOnSyncDynamicError:function(){return R}});let n=function(e){return e&&e.__esModule?e:{default:e}}(e.r(41141)),i=e.r(94059),s=e.r(78506),o=e.r(32319),a=e.r(56704),u=e.r(53920),c=e.r(25812),l=e.r(64244),h=e.r(79920),f=e.r(4784),d="function"==typeof n.default.unstable_postpone;function p(e){return{isDebugDynamicAccesses:e,dynamicAccesses:[],syncDynamicErrorWithStack:null}}function g(){return{hasSuspenseAboveBody:!1,hasDynamicMetadata:!1,hasDynamicViewport:!1,hasAllowedDynamic:!1,dynamicErrors:[]}}function m(e){var t;return null==(t=e.dynamicAccesses[0])?void 0:t.expression}function y(e,t,r){if(t)switch(t.type){case"cache":case"unstable-cache":case"private-cache":return}if(!e.forceDynamic&&!e.forceStatic){if(e.dynamicShouldError)throw Object.defineProperty(new s.StaticGenBailoutError(`Route ${e.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${r}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E553",enumerable:!1,configurable:!0});if(t)switch(t.type){case"prerender-ppr":return T(e.route,r,t.dynamicTracking);case"prerender-legacy":t.revalidate=0;let n=Object.defineProperty(new i.DynamicServerError(`Route ${e.route} couldn't be rendered statically because it used ${r}. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`),"__NEXT_ERROR_CODE",{value:"E550",enumerable:!1,configurable:!0});throw e.dynamicUsageDescription=r,e.dynamicUsageStack=n.stack,n}}}function b(e,t,r){let n=Object.defineProperty(new i.DynamicServerError(`Route ${t.route} couldn't be rendered statically because it used \`${e}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`),"__NEXT_ERROR_CODE",{value:"E558",enumerable:!1,configurable:!0});throw r.revalidate=0,t.dynamicUsageDescription=e,t.dynamicUsageStack=n.stack,n}function v(e){switch(e.type){case"cache":case"unstable-cache":case"private-cache":return}}function _(e,t,r){let n=N(`Route ${e} needs to bail out of prerendering at this point because it used ${t}.`);r.controller.abort(n);let i=r.dynamicTracking;i&&i.dynamicAccesses.push({stack:i.isDebugDynamicAccesses?Error().stack:void 0,expression:t})}function w(e,t,r,n){let i=n.dynamicTracking;_(e,t,n),i&&null===i.syncDynamicErrorWithStack&&(i.syncDynamicErrorWithStack=r)}function E(e){e.prerenderPhase=!1}function S(e,t,r,n){if(!1===n.controller.signal.aborted){_(e,t,n);let i=n.dynamicTracking;i&&null===i.syncDynamicErrorWithStack&&(i.syncDynamicErrorWithStack=r)}throw N(`Route ${e} needs to bail out of prerendering at this point because it used ${t}.`)}function R(e){e.syncDynamicErrorWithStack&&console.error(e.syncDynamicErrorWithStack)}let x=E;function A({reason:e,route:t}){let r=o.workUnitAsyncStorage.getStore();T(t,e,r&&"prerender-ppr"===r.type?r.dynamicTracking:null)}function T(e,t,r){(function(){if(!d)throw Object.defineProperty(Error("Invariant: React.unstable_postpone is not defined. This suggests the wrong version of React was loaded. This is a bug in Next.js"),"__NEXT_ERROR_CODE",{value:"E224",enumerable:!1,configurable:!0})})(),r&&r.dynamicAccesses.push({stack:r.isDebugDynamicAccesses?Error().stack:void 0,expression:t}),n.default.unstable_postpone(P(e,t))}function P(e,t){return`Route ${e} needs to bail out of prerendering at this point because it used ${t}. React throws this special object to indicate where. It should not be caught by your own try/catch. Learn more: https://nextjs.org/docs/messages/ppr-caught-error`}function O(e){return"object"==typeof e&&null!==e&&"string"==typeof e.message&&C(e.message)}function C(e){return e.includes("needs to bail out of prerendering at this point because it used")&&e.includes("Learn more: https://nextjs.org/docs/messages/ppr-caught-error")}if(!1===C(P("%%%","^^^")))throw Object.defineProperty(Error("Invariant: isDynamicPostpone misidentified a postpone reason. This is a bug in Next.js"),"__NEXT_ERROR_CODE",{value:"E296",enumerable:!1,configurable:!0});let I="NEXT_PRERENDER_INTERRUPTED";function N(e){let t=Object.defineProperty(Error(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return t.digest=I,t}function L(e){return"object"==typeof e&&null!==e&&e.digest===I&&"name"in e&&"message"in e&&e instanceof Error}function M(e){return e.length>0}function D(e,t){return e.dynamicAccesses.push(...t.dynamicAccesses),e.dynamicAccesses}function k(e){return e.filter(e=>"string"==typeof e.stack&&e.stack.length>0).map(({expression:e,stack:t})=>(t=t.split("\n").slice(4).filter(e=>!(e.includes("node_modules/next/")||e.includes(" (<anonymous>)")||e.includes(" (node:"))).join("\n"),`Dynamic API Usage Debug - ${e}:
1
+ module.exports=[61724,(e,t,r)=>{t.exports=e.x("next/dist/compiled/next-server/app-route-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-route-turbo.runtime.prod.js"))},5865,(e,t,r)=>{t.exports=e.r(61724)},79391,e=>{"use strict";function t(e){return Symbol.for(e)}e.s(["DiagConsoleLogger",()=>eY,"DiagLogLevel",()=>r,"INVALID_SPANID",()=>ew,"INVALID_SPAN_CONTEXT",()=>eS,"INVALID_TRACEID",()=>eE,"ProxyTracer",()=>eq,"ProxyTracerProvider",()=>eG,"ROOT_CONTEXT",()=>u,"SamplingDecision",()=>s,"SpanKind",()=>o,"SpanStatusCode",()=>a,"TraceFlags",()=>n,"ValueType",()=>i,"baggageEntryMetadataFromString",()=>ey,"context",()=>N,"createContextKey",()=>t,"createNoopMeter",()=>Z,"createTraceState",()=>e0,"default",()=>eW,"defaultTextMapGetter",()=>ei,"defaultTextMapSetter",()=>es,"diag",()=>L,"isSpanContextValid",()=>ek,"isValidSpanId",()=>eD,"isValidTraceId",()=>eM,"metrics",()=>er,"propagation",()=>e_,"trace",()=>eV],79391),e.s(["default",()=>eW],81087);var r,n,i,s,o,a,u=new function e(t){var r=this;r._currentContext=t?new Map(t):new Map,r.getValue=function(e){return r._currentContext.get(e)},r.setValue=function(t,n){var i=new e(r._currentContext);return i._currentContext.set(t,n),i},r.deleteValue=function(t){var n=new e(r._currentContext);return n._currentContext.delete(t),n}},c=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return o},l=function(e,t,r){if(r||2==arguments.length)for(var n,i=0,s=t.length;i<s;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},h=function(){function e(){}return e.prototype.active=function(){return u},e.prototype.with=function(e,t,r){for(var n=[],i=3;i<arguments.length;i++)n[i-3]=arguments[i];return t.call.apply(t,l([r],c(n),!1))},e.prototype.bind=function(e,t){return t},e.prototype.enable=function(){return this},e.prototype.disable=function(){return this},e}(),f="object"==typeof globalThis?globalThis:e.g,d="1.9.0",p=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/,g=function(e){var t=new Set([e]),r=new Set,n=e.match(p);if(!n)return function(){return!1};var i={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};if(null!=i.prerelease)return function(t){return t===e};function s(e){return r.add(e),!1}return function(e){if(t.has(e))return!0;if(r.has(e))return!1;var n=e.match(p);if(!n)return s(e);var o={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};if(null!=o.prerelease||i.major!==o.major)return s(e);if(0===i.major)return i.minor===o.minor&&i.patch<=o.patch?(t.add(e),!0):s(e);return i.minor<=o.minor?(t.add(e),!0):s(e)}}(d),m=Symbol.for("opentelemetry.js.api."+d.split(".")[0]);function y(e,t,r,n){void 0===n&&(n=!1);var i,s=f[m]=null!=(i=f[m])?i:{version:d};if(!n&&s[e]){var o=Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return r.error(o.stack||o.message),!1}if(s.version!==d){var o=Error("@opentelemetry/api: Registration of version v"+s.version+" for "+e+" does not match previously registered API v"+d);return r.error(o.stack||o.message),!1}return s[e]=t,r.debug("@opentelemetry/api: Registered a global for "+e+" v"+d+"."),!0}function b(e){var t,r,n=null==(t=f[m])?void 0:t.version;if(n&&g(n))return null==(r=f[m])?void 0:r[e]}function v(e,t){t.debug("@opentelemetry/api: Unregistering a global for "+e+" v"+d+".");var r=f[m];r&&delete r[e]}var _=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return o},w=function(e,t,r){if(r||2==arguments.length)for(var n,i=0,s=t.length;i<s;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},E=function(){function e(e){this._namespace=e.namespace||"DiagComponentLogger"}return e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return S("debug",this._namespace,e)},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return S("error",this._namespace,e)},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return S("info",this._namespace,e)},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return S("warn",this._namespace,e)},e.prototype.verbose=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return S("verbose",this._namespace,e)},e}();function S(e,t,r){var n=b("diag");if(n)return r.unshift(t),n[e].apply(n,w([],_(r),!1))}!function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"}(r||(r={}));var R=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return o},x=function(e,t,r){if(r||2==arguments.length)for(var n,i=0,s=t.length;i<s;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},A=function(){function e(){function e(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=b("diag");if(n)return n[e].apply(n,x([],R(t),!1))}}var t=this;t.setLogger=function(e,n){if(void 0===n&&(n={logLevel:r.INFO}),e===t){var i,s,o,a=Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return t.error(null!=(i=a.stack)?i:a.message),!1}"number"==typeof n&&(n={logLevel:n});var u=b("diag"),c=function(e,t){function n(r,n){var i=t[r];return"function"==typeof i&&e>=n?i.bind(t):function(){}}return e<r.NONE?e=r.NONE:e>r.ALL&&(e=r.ALL),t=t||{},{error:n("error",r.ERROR),warn:n("warn",r.WARN),info:n("info",r.INFO),debug:n("debug",r.DEBUG),verbose:n("verbose",r.VERBOSE)}}(null!=(s=n.logLevel)?s:r.INFO,e);if(u&&!n.suppressOverrideMessage){var l=null!=(o=Error().stack)?o:"<failed to generate stacktrace>";u.warn("Current logger will be overwritten from "+l),c.warn("Current logger will overwrite one already registered from "+l)}return y("diag",c,t,!0)},t.disable=function(){v("diag",t)},t.createComponentLogger=function(e){return new E(e)},t.verbose=e("verbose"),t.debug=e("debug"),t.info=e("info"),t.warn=e("warn"),t.error=e("error")}return e.instance=function(){return this._instance||(this._instance=new e),this._instance},e}(),T=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return o},P=function(e,t,r){if(r||2==arguments.length)for(var n,i=0,s=t.length;i<s;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},O="context",C=new h,I=function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalContextManager=function(e){return y(O,e,A.instance())},e.prototype.active=function(){return this._getContextManager().active()},e.prototype.with=function(e,t,r){for(var n,i=[],s=3;s<arguments.length;s++)i[s-3]=arguments[s];return(n=this._getContextManager()).with.apply(n,P([e,t,r],T(i),!1))},e.prototype.bind=function(e,t){return this._getContextManager().bind(e,t)},e.prototype._getContextManager=function(){return b(O)||C},e.prototype.disable=function(){this._getContextManager().disable(),v(O,A.instance())},e}(),N=I.getInstance(),L=A.instance(),M=function(){var e=function(t,r){return(e=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),D=function(){function e(){}return e.prototype.createGauge=function(e,t){return Q},e.prototype.createHistogram=function(e,t){return Y},e.prototype.createCounter=function(e,t){return W},e.prototype.createUpDownCounter=function(e,t){return X},e.prototype.createObservableGauge=function(e,t){return K},e.prototype.createObservableCounter=function(e,t){return z},e.prototype.createObservableUpDownCounter=function(e,t){return J},e.prototype.addBatchObservableCallback=function(e,t){},e.prototype.removeBatchObservableCallback=function(e){},e}(),k=function(){},B=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return M(t,e),t.prototype.add=function(e,t){},t}(k),j=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return M(t,e),t.prototype.add=function(e,t){},t}(k),U=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return M(t,e),t.prototype.record=function(e,t){},t}(k),F=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return M(t,e),t.prototype.record=function(e,t){},t}(k),q=function(){function e(){}return e.prototype.addCallback=function(e){},e.prototype.removeCallback=function(e){},e}(),$=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return M(t,e),t}(q),G=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return M(t,e),t}(q),H=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return M(t,e),t}(q),V=new D,W=new B,Q=new U,Y=new F,X=new j,z=new $,K=new G,J=new H;function Z(){return V}var ee=new(function(){function e(){}return e.prototype.getMeter=function(e,t,r){return V},e}()),et="metrics",er=(function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalMeterProvider=function(e){return y(et,e,A.instance())},e.prototype.getMeterProvider=function(){return b(et)||ee},e.prototype.getMeter=function(e,t,r){return this.getMeterProvider().getMeter(e,t,r)},e.prototype.disable=function(){v(et,A.instance())},e})().getInstance(),en=function(){function e(){}return e.prototype.inject=function(e,t){},e.prototype.extract=function(e,t){return e},e.prototype.fields=function(){return[]},e}(),ei={get:function(e,t){if(null!=e)return e[t]},keys:function(e){return null==e?[]:Object.keys(e)}},es={set:function(e,t,r){null!=e&&(e[t]=r)}},eo=t("OpenTelemetry Baggage Key");function ea(e){return e.getValue(eo)||void 0}function eu(){return ea(I.getInstance().active())}function ec(e,t){return e.setValue(eo,t)}function el(e){return e.deleteValue(eo)}var eh=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return o},ef=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ed=function(){function e(e){this._entries=e?new Map(e):new Map}return e.prototype.getEntry=function(e){var t=this._entries.get(e);if(t)return Object.assign({},t)},e.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(e){var t=eh(e,2);return[t[0],t[1]]})},e.prototype.setEntry=function(t,r){var n=new e(this._entries);return n._entries.set(t,r),n},e.prototype.removeEntry=function(t){var r=new e(this._entries);return r._entries.delete(t),r},e.prototype.removeEntries=function(){for(var t,r,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var s=new e(this._entries);try{for(var o=ef(n),a=o.next();!a.done;a=o.next()){var u=a.value;s._entries.delete(u)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return s},e.prototype.clear=function(){return new e},e}(),ep=Symbol("BaggageEntryMetadata"),eg=A.instance();function em(e){return void 0===e&&(e={}),new ed(new Map(Object.entries(e)))}function ey(e){return"string"!=typeof e&&(eg.error("Cannot create baggage metadata from unknown type: "+typeof e),e=""),{__TYPE__:ep,toString:function(){return e}}}var eb="propagation",ev=new en,e_=(function(){function e(){this.createBaggage=em,this.getBaggage=ea,this.getActiveBaggage=eu,this.setBaggage=ec,this.deleteBaggage=el}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalPropagator=function(e){return y(eb,e,A.instance())},e.prototype.inject=function(e,t,r){return void 0===r&&(r=es),this._getGlobalPropagator().inject(e,t,r)},e.prototype.extract=function(e,t,r){return void 0===r&&(r=ei),this._getGlobalPropagator().extract(e,t,r)},e.prototype.fields=function(){return this._getGlobalPropagator().fields()},e.prototype.disable=function(){v(eb,A.instance())},e.prototype._getGlobalPropagator=function(){return b(eb)||ev},e})().getInstance();!function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"}(n||(n={}));var ew="0000000000000000",eE="00000000000000000000000000000000",eS={traceId:eE,spanId:ew,traceFlags:n.NONE},eR=function(){function e(e){void 0===e&&(e=eS),this._spanContext=e}return e.prototype.spanContext=function(){return this._spanContext},e.prototype.setAttribute=function(e,t){return this},e.prototype.setAttributes=function(e){return this},e.prototype.addEvent=function(e,t){return this},e.prototype.addLink=function(e){return this},e.prototype.addLinks=function(e){return this},e.prototype.setStatus=function(e){return this},e.prototype.updateName=function(e){return this},e.prototype.end=function(e){},e.prototype.isRecording=function(){return!1},e.prototype.recordException=function(e,t){},e}(),ex=t("OpenTelemetry Context Key SPAN");function eA(e){return e.getValue(ex)||void 0}function eT(){return eA(I.getInstance().active())}function eP(e,t){return e.setValue(ex,t)}function eO(e){return e.deleteValue(ex)}function eC(e,t){return eP(e,new eR(t))}function eI(e){var t;return null==(t=eA(e))?void 0:t.spanContext()}var eN=/^([0-9a-f]{32})$/i,eL=/^[0-9a-f]{16}$/i;function eM(e){return eN.test(e)&&e!==eE}function eD(e){return eL.test(e)&&e!==ew}function ek(e){return eM(e.traceId)&&eD(e.spanId)}function eB(e){return new eR(e)}var ej=I.getInstance(),eU=function(){function e(){}return e.prototype.startSpan=function(e,t,r){if(void 0===r&&(r=ej.active()),null==t?void 0:t.root)return new eR;var n,i=r&&eI(r);return"object"==typeof(n=i)&&"string"==typeof n.spanId&&"string"==typeof n.traceId&&"number"==typeof n.traceFlags&&ek(i)?new eR(i):new eR},e.prototype.startActiveSpan=function(e,t,r,n){if(!(arguments.length<2)){2==arguments.length?o=t:3==arguments.length?(i=t,o=r):(i=t,s=r,o=n);var i,s,o,a=null!=s?s:ej.active(),u=this.startSpan(e,i,a),c=eP(a,u);return ej.with(c,o,void 0,u)}},e}(),eF=new eU,eq=function(){function e(e,t,r,n){this._provider=e,this.name=t,this.version=r,this.options=n}return e.prototype.startSpan=function(e,t,r){return this._getTracer().startSpan(e,t,r)},e.prototype.startActiveSpan=function(e,t,r,n){var i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)},e.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):eF},e}(),e$=new(function(){function e(){}return e.prototype.getTracer=function(e,t,r){return new eU},e}()),eG=function(){function e(){}return e.prototype.getTracer=function(e,t,r){var n;return null!=(n=this.getDelegateTracer(e,t,r))?n:new eq(this,e,t,r)},e.prototype.getDelegate=function(){var e;return null!=(e=this._delegate)?e:e$},e.prototype.setDelegate=function(e){this._delegate=e},e.prototype.getDelegateTracer=function(e,t,r){var n;return null==(n=this._delegate)?void 0:n.getTracer(e,t,r)},e}(),eH="trace",eV=(function(){function e(){this._proxyTracerProvider=new eG,this.wrapSpanContext=eB,this.isSpanContextValid=ek,this.deleteSpan=eO,this.getSpan=eA,this.getActiveSpan=eT,this.getSpanContext=eI,this.setSpan=eP,this.setSpanContext=eC}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalTracerProvider=function(e){var t=y(eH,this._proxyTracerProvider,A.instance());return t&&this._proxyTracerProvider.setDelegate(e),t},e.prototype.getTracerProvider=function(){return b(eH)||this._proxyTracerProvider},e.prototype.getTracer=function(e,t){return this.getTracerProvider().getTracer(e,t)},e.prototype.disable=function(){v(eH,A.instance()),this._proxyTracerProvider=new eG},e})().getInstance();let eW={context:N,diag:L,metrics:er,propagation:e_,trace:eV};e.i(81087);var eQ=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],eY=function(){for(var e=0;e<eQ.length;e++)this[eQ[e].n]=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];if(console){var n=console[e];if("function"!=typeof n&&(n=console.log),"function"==typeof n)return n.apply(console,t)}}}(eQ[e].c)};!function(e){e[e.INT=0]="INT",e[e.DOUBLE=1]="DOUBLE"}(i||(i={})),function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"}(s||(s={})),function(e){e[e.INTERNAL=0]="INTERNAL",e[e.SERVER=1]="SERVER",e[e.CLIENT=2]="CLIENT",e[e.PRODUCER=3]="PRODUCER",e[e.CONSUMER=4]="CONSUMER"}(o||(o={})),function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"}(a||(a={}));var eX="[_0-9a-z-*/]",ez=RegExp("^(?:[a-z]"+eX+"{0,255}|"+("[a-z0-9]"+eX+"{0,240}@[a-z]")+eX+"{0,13})$"),eK=/^[ -~]{0,255}[!-~]$/,eJ=/,|=/,eZ=function(){function e(e){this._internalState=new Map,e&&this._parse(e)}return e.prototype.set=function(e,t){var r=this._clone();return r._internalState.has(e)&&r._internalState.delete(e),r._internalState.set(e,t),r},e.prototype.unset=function(e){var t=this._clone();return t._internalState.delete(e),t},e.prototype.get=function(e){return this._internalState.get(e)},e.prototype.serialize=function(){var e=this;return this._keys().reduce(function(t,r){return t.push(r+"="+e.get(r)),t},[]).join(",")},e.prototype._parse=function(e){!(e.length>512)&&(this._internalState=e.split(",").reverse().reduce(function(e,t){var r=t.trim(),n=r.indexOf("=");if(-1!==n){var i=r.slice(0,n),s=r.slice(n+1,t.length);ez.test(i)&&eK.test(s)&&!eJ.test(s)&&e.set(i,s)}return e},new Map),this._internalState.size>32&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,32))))},e.prototype._keys=function(){return Array.from(this._internalState.keys()).reverse()},e.prototype._clone=function(){var t=new e;return t._internalState=new Map(this._internalState),t},e}();function e0(e){return new eZ(e)}},39583,(e,t,r)=>{(()=>{"use strict";var r={491:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ContextAPI=void 0;let n=r(223),i=r(172),s=r(930),o="context",a=new n.NoopContextManager;class u{constructor(){}static getInstance(){return this._instance||(this._instance=new u),this._instance}setGlobalContextManager(e){return(0,i.registerGlobal)(o,e,s.DiagAPI.instance())}active(){return this._getContextManager().active()}with(e,t,r,...n){return this._getContextManager().with(e,t,r,...n)}bind(e,t){return this._getContextManager().bind(e,t)}_getContextManager(){return(0,i.getGlobal)(o)||a}disable(){this._getContextManager().disable(),(0,i.unregisterGlobal)(o,s.DiagAPI.instance())}}t.ContextAPI=u},930:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagAPI=void 0;let n=r(56),i=r(912),s=r(957),o=r(172);class a{constructor(){function e(e){return function(...t){let r=(0,o.getGlobal)("diag");if(r)return r[e](...t)}}let t=this;t.setLogger=(e,r={logLevel:s.DiagLogLevel.INFO})=>{var n,a,u;if(e===t){let e=Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return t.error(null!=(n=e.stack)?n:e.message),!1}"number"==typeof r&&(r={logLevel:r});let c=(0,o.getGlobal)("diag"),l=(0,i.createLogLevelDiagLogger)(null!=(a=r.logLevel)?a:s.DiagLogLevel.INFO,e);if(c&&!r.suppressOverrideMessage){let e=null!=(u=Error().stack)?u:"<failed to generate stacktrace>";c.warn(`Current logger will be overwritten from ${e}`),l.warn(`Current logger will overwrite one already registered from ${e}`)}return(0,o.registerGlobal)("diag",l,t,!0)},t.disable=()=>{(0,o.unregisterGlobal)("diag",t)},t.createComponentLogger=e=>new n.DiagComponentLogger(e),t.verbose=e("verbose"),t.debug=e("debug"),t.info=e("info"),t.warn=e("warn"),t.error=e("error")}static instance(){return this._instance||(this._instance=new a),this._instance}}t.DiagAPI=a},653:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MetricsAPI=void 0;let n=r(660),i=r(172),s=r(930),o="metrics";class a{constructor(){}static getInstance(){return this._instance||(this._instance=new a),this._instance}setGlobalMeterProvider(e){return(0,i.registerGlobal)(o,e,s.DiagAPI.instance())}getMeterProvider(){return(0,i.getGlobal)(o)||n.NOOP_METER_PROVIDER}getMeter(e,t,r){return this.getMeterProvider().getMeter(e,t,r)}disable(){(0,i.unregisterGlobal)(o,s.DiagAPI.instance())}}t.MetricsAPI=a},181:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropagationAPI=void 0;let n=r(172),i=r(874),s=r(194),o=r(277),a=r(369),u=r(930),c="propagation",l=new i.NoopTextMapPropagator;class h{constructor(){this.createBaggage=a.createBaggage,this.getBaggage=o.getBaggage,this.getActiveBaggage=o.getActiveBaggage,this.setBaggage=o.setBaggage,this.deleteBaggage=o.deleteBaggage}static getInstance(){return this._instance||(this._instance=new h),this._instance}setGlobalPropagator(e){return(0,n.registerGlobal)(c,e,u.DiagAPI.instance())}inject(e,t,r=s.defaultTextMapSetter){return this._getGlobalPropagator().inject(e,t,r)}extract(e,t,r=s.defaultTextMapGetter){return this._getGlobalPropagator().extract(e,t,r)}fields(){return this._getGlobalPropagator().fields()}disable(){(0,n.unregisterGlobal)(c,u.DiagAPI.instance())}_getGlobalPropagator(){return(0,n.getGlobal)(c)||l}}t.PropagationAPI=h},997:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceAPI=void 0;let n=r(172),i=r(846),s=r(139),o=r(607),a=r(930),u="trace";class c{constructor(){this._proxyTracerProvider=new i.ProxyTracerProvider,this.wrapSpanContext=s.wrapSpanContext,this.isSpanContextValid=s.isSpanContextValid,this.deleteSpan=o.deleteSpan,this.getSpan=o.getSpan,this.getActiveSpan=o.getActiveSpan,this.getSpanContext=o.getSpanContext,this.setSpan=o.setSpan,this.setSpanContext=o.setSpanContext}static getInstance(){return this._instance||(this._instance=new c),this._instance}setGlobalTracerProvider(e){let t=(0,n.registerGlobal)(u,this._proxyTracerProvider,a.DiagAPI.instance());return t&&this._proxyTracerProvider.setDelegate(e),t}getTracerProvider(){return(0,n.getGlobal)(u)||this._proxyTracerProvider}getTracer(e,t){return this.getTracerProvider().getTracer(e,t)}disable(){(0,n.unregisterGlobal)(u,a.DiagAPI.instance()),this._proxyTracerProvider=new i.ProxyTracerProvider}}t.TraceAPI=c},277:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.deleteBaggage=t.setBaggage=t.getActiveBaggage=t.getBaggage=void 0;let n=r(491),i=(0,r(780).createContextKey)("OpenTelemetry Baggage Key");function s(e){return e.getValue(i)||void 0}t.getBaggage=s,t.getActiveBaggage=function(){return s(n.ContextAPI.getInstance().active())},t.setBaggage=function(e,t){return e.setValue(i,t)},t.deleteBaggage=function(e){return e.deleteValue(i)}},993:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaggageImpl=void 0;class r{constructor(e){this._entries=e?new Map(e):new Map}getEntry(e){let t=this._entries.get(e);if(t)return Object.assign({},t)}getAllEntries(){return Array.from(this._entries.entries()).map(([e,t])=>[e,t])}setEntry(e,t){let n=new r(this._entries);return n._entries.set(e,t),n}removeEntry(e){let t=new r(this._entries);return t._entries.delete(e),t}removeEntries(...e){let t=new r(this._entries);for(let r of e)t._entries.delete(r);return t}clear(){return new r}}t.BaggageImpl=r},830:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.baggageEntryMetadataSymbol=void 0,t.baggageEntryMetadataSymbol=Symbol("BaggageEntryMetadata")},369:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.baggageEntryMetadataFromString=t.createBaggage=void 0;let n=r(930),i=r(993),s=r(830),o=n.DiagAPI.instance();t.createBaggage=function(e={}){return new i.BaggageImpl(new Map(Object.entries(e)))},t.baggageEntryMetadataFromString=function(e){return"string"!=typeof e&&(o.error(`Cannot create baggage metadata from unknown type: ${typeof e}`),e=""),{__TYPE__:s.baggageEntryMetadataSymbol,toString:()=>e}}},67:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.context=void 0,t.context=r(491).ContextAPI.getInstance()},223:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopContextManager=void 0;let n=r(780);t.NoopContextManager=class{active(){return n.ROOT_CONTEXT}with(e,t,r,...n){return t.call(r,...n)}bind(e,t){return t}enable(){return this}disable(){return this}}},780:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ROOT_CONTEXT=t.createContextKey=void 0,t.createContextKey=function(e){return Symbol.for(e)};class r{constructor(e){let t=this;t._currentContext=e?new Map(e):new Map,t.getValue=e=>t._currentContext.get(e),t.setValue=(e,n)=>{let i=new r(t._currentContext);return i._currentContext.set(e,n),i},t.deleteValue=e=>{let n=new r(t._currentContext);return n._currentContext.delete(e),n}}}t.ROOT_CONTEXT=new r},506:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.diag=void 0,t.diag=r(930).DiagAPI.instance()},56:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagComponentLogger=void 0;let n=r(172);function i(e,t,r){let i=(0,n.getGlobal)("diag");if(i)return r.unshift(t),i[e](...r)}t.DiagComponentLogger=class{constructor(e){this._namespace=e.namespace||"DiagComponentLogger"}debug(...e){return i("debug",this._namespace,e)}error(...e){return i("error",this._namespace,e)}info(...e){return i("info",this._namespace,e)}warn(...e){return i("warn",this._namespace,e)}verbose(...e){return i("verbose",this._namespace,e)}}},972:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagConsoleLogger=void 0;let r=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}];t.DiagConsoleLogger=class{constructor(){for(let e=0;e<r.length;e++)this[r[e].n]=function(e){return function(...t){if(console){let r=console[e];if("function"!=typeof r&&(r=console.log),"function"==typeof r)return r.apply(console,t)}}}(r[e].c)}}},912:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createLogLevelDiagLogger=void 0;let n=r(957);t.createLogLevelDiagLogger=function(e,t){function r(r,n){let i=t[r];return"function"==typeof i&&e>=n?i.bind(t):function(){}}return e<n.DiagLogLevel.NONE?e=n.DiagLogLevel.NONE:e>n.DiagLogLevel.ALL&&(e=n.DiagLogLevel.ALL),t=t||{},{error:r("error",n.DiagLogLevel.ERROR),warn:r("warn",n.DiagLogLevel.WARN),info:r("info",n.DiagLogLevel.INFO),debug:r("debug",n.DiagLogLevel.DEBUG),verbose:r("verbose",n.DiagLogLevel.VERBOSE)}}},957:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DiagLogLevel=void 0,function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"}(t.DiagLogLevel||(t.DiagLogLevel={}))},172:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.unregisterGlobal=t.getGlobal=t.registerGlobal=void 0;let n=r(200),i=r(521),s=r(130),o=i.VERSION.split(".")[0],a=Symbol.for(`opentelemetry.js.api.${o}`),u=n._globalThis;t.registerGlobal=function(e,t,r,n=!1){var s;let o=u[a]=null!=(s=u[a])?s:{version:i.VERSION};if(!n&&o[e]){let t=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return r.error(t.stack||t.message),!1}if(o.version!==i.VERSION){let t=Error(`@opentelemetry/api: Registration of version v${o.version} for ${e} does not match previously registered API v${i.VERSION}`);return r.error(t.stack||t.message),!1}return o[e]=t,r.debug(`@opentelemetry/api: Registered a global for ${e} v${i.VERSION}.`),!0},t.getGlobal=function(e){var t,r;let n=null==(t=u[a])?void 0:t.version;if(n&&(0,s.isCompatible)(n))return null==(r=u[a])?void 0:r[e]},t.unregisterGlobal=function(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${i.VERSION}.`);let r=u[a];r&&delete r[e]}},130:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isCompatible=t._makeCompatibilityCheck=void 0;let n=r(521),i=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function s(e){let t=new Set([e]),r=new Set,n=e.match(i);if(!n)return()=>!1;let s={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};if(null!=s.prerelease)return function(t){return t===e};function o(e){return r.add(e),!1}return function(e){if(t.has(e))return!0;if(r.has(e))return!1;let n=e.match(i);if(!n)return o(e);let a={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};if(null!=a.prerelease||s.major!==a.major)return o(e);if(0===s.major)return s.minor===a.minor&&s.patch<=a.patch?(t.add(e),!0):o(e);return s.minor<=a.minor?(t.add(e),!0):o(e)}}t._makeCompatibilityCheck=s,t.isCompatible=s(n.VERSION)},886:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.metrics=void 0,t.metrics=r(653).MetricsAPI.getInstance()},901:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ValueType=void 0,function(e){e[e.INT=0]="INT",e[e.DOUBLE=1]="DOUBLE"}(t.ValueType||(t.ValueType={}))},102:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createNoopMeter=t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=t.NOOP_OBSERVABLE_GAUGE_METRIC=t.NOOP_OBSERVABLE_COUNTER_METRIC=t.NOOP_UP_DOWN_COUNTER_METRIC=t.NOOP_HISTOGRAM_METRIC=t.NOOP_COUNTER_METRIC=t.NOOP_METER=t.NoopObservableUpDownCounterMetric=t.NoopObservableGaugeMetric=t.NoopObservableCounterMetric=t.NoopObservableMetric=t.NoopHistogramMetric=t.NoopUpDownCounterMetric=t.NoopCounterMetric=t.NoopMetric=t.NoopMeter=void 0;class r{constructor(){}createHistogram(e,r){return t.NOOP_HISTOGRAM_METRIC}createCounter(e,r){return t.NOOP_COUNTER_METRIC}createUpDownCounter(e,r){return t.NOOP_UP_DOWN_COUNTER_METRIC}createObservableGauge(e,r){return t.NOOP_OBSERVABLE_GAUGE_METRIC}createObservableCounter(e,r){return t.NOOP_OBSERVABLE_COUNTER_METRIC}createObservableUpDownCounter(e,r){return t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}}t.NoopMeter=r;class n{}t.NoopMetric=n;class i extends n{add(e,t){}}t.NoopCounterMetric=i;class s extends n{add(e,t){}}t.NoopUpDownCounterMetric=s;class o extends n{record(e,t){}}t.NoopHistogramMetric=o;class a{addCallback(e){}removeCallback(e){}}t.NoopObservableMetric=a;class u extends a{}t.NoopObservableCounterMetric=u;class c extends a{}t.NoopObservableGaugeMetric=c;class l extends a{}t.NoopObservableUpDownCounterMetric=l,t.NOOP_METER=new r,t.NOOP_COUNTER_METRIC=new i,t.NOOP_HISTOGRAM_METRIC=new o,t.NOOP_UP_DOWN_COUNTER_METRIC=new s,t.NOOP_OBSERVABLE_COUNTER_METRIC=new u,t.NOOP_OBSERVABLE_GAUGE_METRIC=new c,t.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=new l,t.createNoopMeter=function(){return t.NOOP_METER}},660:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NOOP_METER_PROVIDER=t.NoopMeterProvider=void 0;let n=r(102);class i{getMeter(e,t,r){return n.NOOP_METER}}t.NoopMeterProvider=i,t.NOOP_METER_PROVIDER=new i},200:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(46),t)},651:(t,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r._globalThis=void 0,r._globalThis="object"==typeof globalThis?globalThis:e.g},46:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(651),t)},939:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.propagation=void 0,t.propagation=r(181).PropagationAPI.getInstance()},874:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTextMapPropagator=void 0,t.NoopTextMapPropagator=class{inject(e,t){}extract(e,t){return e}fields(){return[]}}},194:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultTextMapSetter=t.defaultTextMapGetter=void 0,t.defaultTextMapGetter={get(e,t){if(null!=e)return e[t]},keys:e=>null==e?[]:Object.keys(e)},t.defaultTextMapSetter={set(e,t,r){null!=e&&(e[t]=r)}}},845:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.trace=void 0,t.trace=r(997).TraceAPI.getInstance()},403:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NonRecordingSpan=void 0;let n=r(476);t.NonRecordingSpan=class{constructor(e=n.INVALID_SPAN_CONTEXT){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,t){return this}setAttributes(e){return this}addEvent(e,t){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,t){}}},614:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTracer=void 0;let n=r(491),i=r(607),s=r(403),o=r(139),a=n.ContextAPI.getInstance();t.NoopTracer=class{startSpan(e,t,r=a.active()){var n;if(null==t?void 0:t.root)return new s.NonRecordingSpan;let u=r&&(0,i.getSpanContext)(r);return"object"==typeof(n=u)&&"string"==typeof n.spanId&&"string"==typeof n.traceId&&"number"==typeof n.traceFlags&&(0,o.isSpanContextValid)(u)?new s.NonRecordingSpan(u):new s.NonRecordingSpan}startActiveSpan(e,t,r,n){let s,o,u;if(arguments.length<2)return;2==arguments.length?u=t:3==arguments.length?(s=t,u=r):(s=t,o=r,u=n);let c=null!=o?o:a.active(),l=this.startSpan(e,s,c),h=(0,i.setSpan)(c,l);return a.with(h,u,void 0,l)}}},124:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NoopTracerProvider=void 0;let n=r(614);t.NoopTracerProvider=class{getTracer(e,t,r){return new n.NoopTracer}}},125:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyTracer=void 0;let n=new(r(614)).NoopTracer;t.ProxyTracer=class{constructor(e,t,r,n){this._provider=e,this.name=t,this.version=r,this.options=n}startSpan(e,t,r){return this._getTracer().startSpan(e,t,r)}startActiveSpan(e,t,r,n){let i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)}_getTracer(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):n}}},846:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyTracerProvider=void 0;let n=r(125),i=new(r(124)).NoopTracerProvider;t.ProxyTracerProvider=class{getTracer(e,t,r){var i;return null!=(i=this.getDelegateTracer(e,t,r))?i:new n.ProxyTracer(this,e,t,r)}getDelegate(){var e;return null!=(e=this._delegate)?e:i}setDelegate(e){this._delegate=e}getDelegateTracer(e,t,r){var n;return null==(n=this._delegate)?void 0:n.getTracer(e,t,r)}}},996:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SamplingDecision=void 0,function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"}(t.SamplingDecision||(t.SamplingDecision={}))},607:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getSpanContext=t.setSpanContext=t.deleteSpan=t.setSpan=t.getActiveSpan=t.getSpan=void 0;let n=r(780),i=r(403),s=r(491),o=(0,n.createContextKey)("OpenTelemetry Context Key SPAN");function a(e){return e.getValue(o)||void 0}function u(e,t){return e.setValue(o,t)}t.getSpan=a,t.getActiveSpan=function(){return a(s.ContextAPI.getInstance().active())},t.setSpan=u,t.deleteSpan=function(e){return e.deleteValue(o)},t.setSpanContext=function(e,t){return u(e,new i.NonRecordingSpan(t))},t.getSpanContext=function(e){var t;return null==(t=a(e))?void 0:t.spanContext()}},325:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceStateImpl=void 0;let n=r(564);class i{constructor(e){this._internalState=new Map,e&&this._parse(e)}set(e,t){let r=this._clone();return r._internalState.has(e)&&r._internalState.delete(e),r._internalState.set(e,t),r}unset(e){let t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=>(e.push(t+"="+this.get(t)),e),[]).join(",")}_parse(e){!(e.length>512)&&(this._internalState=e.split(",").reverse().reduce((e,t)=>{let r=t.trim(),i=r.indexOf("=");if(-1!==i){let s=r.slice(0,i),o=r.slice(i+1,t.length);(0,n.validateKey)(s)&&(0,n.validateValue)(o)&&e.set(s,o)}return e},new Map),this._internalState.size>32&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,32))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new i;return e._internalState=new Map(this._internalState),e}}t.TraceStateImpl=i},564:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.validateValue=t.validateKey=void 0;let r="[_0-9a-z-*/]",n=`[a-z]${r}{0,255}`,i=`[a-z0-9]${r}{0,240}@[a-z]${r}{0,13}`,s=RegExp(`^(?:${n}|${i})$`),o=/^[ -~]{0,255}[!-~]$/,a=/,|=/;t.validateKey=function(e){return s.test(e)},t.validateValue=function(e){return o.test(e)&&!a.test(e)}},98:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createTraceState=void 0;let n=r(325);t.createTraceState=function(e){return new n.TraceStateImpl(e)}},476:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.INVALID_SPAN_CONTEXT=t.INVALID_TRACEID=t.INVALID_SPANID=void 0;let n=r(475);t.INVALID_SPANID="0000000000000000",t.INVALID_TRACEID="00000000000000000000000000000000",t.INVALID_SPAN_CONTEXT={traceId:t.INVALID_TRACEID,spanId:t.INVALID_SPANID,traceFlags:n.TraceFlags.NONE}},357:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SpanKind=void 0,function(e){e[e.INTERNAL=0]="INTERNAL",e[e.SERVER=1]="SERVER",e[e.CLIENT=2]="CLIENT",e[e.PRODUCER=3]="PRODUCER",e[e.CONSUMER=4]="CONSUMER"}(t.SpanKind||(t.SpanKind={}))},139:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.wrapSpanContext=t.isSpanContextValid=t.isValidSpanId=t.isValidTraceId=void 0;let n=r(476),i=r(403),s=/^([0-9a-f]{32})$/i,o=/^[0-9a-f]{16}$/i;function a(e){return s.test(e)&&e!==n.INVALID_TRACEID}function u(e){return o.test(e)&&e!==n.INVALID_SPANID}t.isValidTraceId=a,t.isValidSpanId=u,t.isSpanContextValid=function(e){return a(e.traceId)&&u(e.spanId)},t.wrapSpanContext=function(e){return new i.NonRecordingSpan(e)}},847:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SpanStatusCode=void 0,function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"}(t.SpanStatusCode||(t.SpanStatusCode={}))},475:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TraceFlags=void 0,function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"}(t.TraceFlags||(t.TraceFlags={}))},521:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,t.VERSION="1.6.0"}},n={};function i(e){var t=n[e];if(void 0!==t)return t.exports;var s=n[e]={exports:{}},o=!0;try{r[e].call(s.exports,s,s.exports,i),o=!1}finally{o&&delete n[e]}return s.exports}i.ab="/ROOT/supercorp/superinterface/node_modules/next/dist/compiled/@opentelemetry/api/";var s={};(()=>{Object.defineProperty(s,"__esModule",{value:!0}),s.trace=s.propagation=s.metrics=s.diag=s.context=s.INVALID_SPAN_CONTEXT=s.INVALID_TRACEID=s.INVALID_SPANID=s.isValidSpanId=s.isValidTraceId=s.isSpanContextValid=s.createTraceState=s.TraceFlags=s.SpanStatusCode=s.SpanKind=s.SamplingDecision=s.ProxyTracerProvider=s.ProxyTracer=s.defaultTextMapSetter=s.defaultTextMapGetter=s.ValueType=s.createNoopMeter=s.DiagLogLevel=s.DiagConsoleLogger=s.ROOT_CONTEXT=s.createContextKey=s.baggageEntryMetadataFromString=void 0;var e=i(369);Object.defineProperty(s,"baggageEntryMetadataFromString",{enumerable:!0,get:function(){return e.baggageEntryMetadataFromString}});var t=i(780);Object.defineProperty(s,"createContextKey",{enumerable:!0,get:function(){return t.createContextKey}}),Object.defineProperty(s,"ROOT_CONTEXT",{enumerable:!0,get:function(){return t.ROOT_CONTEXT}});var r=i(972);Object.defineProperty(s,"DiagConsoleLogger",{enumerable:!0,get:function(){return r.DiagConsoleLogger}});var n=i(957);Object.defineProperty(s,"DiagLogLevel",{enumerable:!0,get:function(){return n.DiagLogLevel}});var o=i(102);Object.defineProperty(s,"createNoopMeter",{enumerable:!0,get:function(){return o.createNoopMeter}});var a=i(901);Object.defineProperty(s,"ValueType",{enumerable:!0,get:function(){return a.ValueType}});var u=i(194);Object.defineProperty(s,"defaultTextMapGetter",{enumerable:!0,get:function(){return u.defaultTextMapGetter}}),Object.defineProperty(s,"defaultTextMapSetter",{enumerable:!0,get:function(){return u.defaultTextMapSetter}});var c=i(125);Object.defineProperty(s,"ProxyTracer",{enumerable:!0,get:function(){return c.ProxyTracer}});var l=i(846);Object.defineProperty(s,"ProxyTracerProvider",{enumerable:!0,get:function(){return l.ProxyTracerProvider}});var h=i(996);Object.defineProperty(s,"SamplingDecision",{enumerable:!0,get:function(){return h.SamplingDecision}});var f=i(357);Object.defineProperty(s,"SpanKind",{enumerable:!0,get:function(){return f.SpanKind}});var d=i(847);Object.defineProperty(s,"SpanStatusCode",{enumerable:!0,get:function(){return d.SpanStatusCode}});var p=i(475);Object.defineProperty(s,"TraceFlags",{enumerable:!0,get:function(){return p.TraceFlags}});var g=i(98);Object.defineProperty(s,"createTraceState",{enumerable:!0,get:function(){return g.createTraceState}});var m=i(139);Object.defineProperty(s,"isSpanContextValid",{enumerable:!0,get:function(){return m.isSpanContextValid}}),Object.defineProperty(s,"isValidTraceId",{enumerable:!0,get:function(){return m.isValidTraceId}}),Object.defineProperty(s,"isValidSpanId",{enumerable:!0,get:function(){return m.isValidSpanId}});var y=i(476);Object.defineProperty(s,"INVALID_SPANID",{enumerable:!0,get:function(){return y.INVALID_SPANID}}),Object.defineProperty(s,"INVALID_TRACEID",{enumerable:!0,get:function(){return y.INVALID_TRACEID}}),Object.defineProperty(s,"INVALID_SPAN_CONTEXT",{enumerable:!0,get:function(){return y.INVALID_SPAN_CONTEXT}});let b=i(67);Object.defineProperty(s,"context",{enumerable:!0,get:function(){return b.context}});let v=i(506);Object.defineProperty(s,"diag",{enumerable:!0,get:function(){return v.diag}});let _=i(886);Object.defineProperty(s,"metrics",{enumerable:!0,get:function(){return _.metrics}});let w=i(939);Object.defineProperty(s,"propagation",{enumerable:!0,get:function(){return w.propagation}});let E=i(845);Object.defineProperty(s,"trace",{enumerable:!0,get:function(){return E.trace}}),s.default={context:b.context,diag:v.diag,metrics:_.metrics,propagation:w.propagation,trace:E.trace}})(),t.exports=s})()},62087,(e,t,r)=>{"use strict";t.exports=e.r(18622)},41141,(e,t,r)=>{"use strict";t.exports=e.r(62087).vendored["react-rsc"].React},18780,(e,t,r)=>{"use strict";var n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={};function u(e){var t;let r=["path"in e&&e.path&&`Path=${e.path}`,"expires"in e&&(e.expires||0===e.expires)&&`Expires=${("number"==typeof e.expires?new Date(e.expires):e.expires).toUTCString()}`,"maxAge"in e&&"number"==typeof e.maxAge&&`Max-Age=${e.maxAge}`,"domain"in e&&e.domain&&`Domain=${e.domain}`,"secure"in e&&e.secure&&"Secure","httpOnly"in e&&e.httpOnly&&"HttpOnly","sameSite"in e&&e.sameSite&&`SameSite=${e.sameSite}`,"partitioned"in e&&e.partitioned&&"Partitioned","priority"in e&&e.priority&&`Priority=${e.priority}`].filter(Boolean),n=`${e.name}=${encodeURIComponent(null!=(t=e.value)?t:"")}`;return 0===r.length?n:`${n}; ${r.join("; ")}`}function c(e){let t=new Map;for(let r of e.split(/; */)){if(!r)continue;let e=r.indexOf("=");if(-1===e){t.set(r,"true");continue}let[n,i]=[r.slice(0,e),r.slice(e+1)];try{t.set(n,decodeURIComponent(null!=i?i:"true"))}catch{}}return t}function l(e){if(!e)return;let[[t,r],...n]=c(e),{domain:i,expires:s,httponly:o,maxage:a,path:u,samesite:l,secure:d,partitioned:p,priority:g}=Object.fromEntries(n.map(([e,t])=>[e.toLowerCase().replace(/-/g,""),t]));{var m,y,b={name:t,value:decodeURIComponent(r),domain:i,...s&&{expires:new Date(s)},...o&&{httpOnly:!0},..."string"==typeof a&&{maxAge:Number(a)},path:u,...l&&{sameSite:h.includes(m=(m=l).toLowerCase())?m:void 0},...d&&{secure:!0},...g&&{priority:f.includes(y=(y=g).toLowerCase())?y:void 0},...p&&{partitioned:!0}};let e={};for(let t in b)b[t]&&(e[t]=b[t]);return e}}((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})(a,{RequestCookies:()=>d,ResponseCookies:()=>p,parseCookie:()=>c,parseSetCookie:()=>l,stringifyCookie:()=>u}),t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let u of s(t))o.call(e,u)||u===r||n(e,u,{get:()=>t[u],enumerable:!(a=i(t,u))||a.enumerable});return e})(n({},"__esModule",{value:!0}),a);var h=["strict","lax","none"],f=["low","medium","high"],d=class{constructor(e){this._parsed=new Map,this._headers=e;let t=e.get("cookie");if(t)for(let[e,r]of c(t))this._parsed.set(e,{name:e,value:r})}[Symbol.iterator](){return this._parsed[Symbol.iterator]()}get size(){return this._parsed.size}get(...e){let t="string"==typeof e[0]?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;let r=Array.from(this._parsed);if(!e.length)return r.map(([e,t])=>t);let n="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return r.filter(([e])=>e===n).map(([e,t])=>t)}has(e){return this._parsed.has(e)}set(...e){let[t,r]=1===e.length?[e[0].name,e[0].value]:e,n=this._parsed;return n.set(t,{name:t,value:r}),this._headers.set("cookie",Array.from(n).map(([e,t])=>u(t)).join("; ")),this}delete(e){let t=this._parsed,r=Array.isArray(e)?e.map(e=>t.delete(e)):t.delete(e);return this._headers.set("cookie",Array.from(t).map(([e,t])=>u(t)).join("; ")),r}clear(){return this.delete(Array.from(this._parsed.keys())),this}[Symbol.for("edge-runtime.inspect.custom")](){return`RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(e=>`${e.name}=${encodeURIComponent(e.value)}`).join("; ")}},p=class{constructor(e){var t,r,n;this._parsed=new Map,this._headers=e;let i=null!=(n=null!=(r=null==(t=e.getSetCookie)?void 0:t.call(e))?r:e.get("set-cookie"))?n:[];for(let e of Array.isArray(i)?i:function(e){if(!e)return[];var t,r,n,i,s,o=[],a=0;function u(){for(;a<e.length&&/\s/.test(e.charAt(a));)a+=1;return a<e.length}for(;a<e.length;){for(t=a,s=!1;u();)if(","===(r=e.charAt(a))){for(n=a,a+=1,u(),i=a;a<e.length&&"="!==(r=e.charAt(a))&&";"!==r&&","!==r;)a+=1;a<e.length&&"="===e.charAt(a)?(s=!0,a=i,o.push(e.substring(t,n)),t=a):a=n+1}else a+=1;(!s||a>=e.length)&&o.push(e.substring(t,e.length))}return o}(i)){let t=l(e);t&&this._parsed.set(t.name,t)}}get(...e){let t="string"==typeof e[0]?e[0]:e[0].name;return this._parsed.get(t)}getAll(...e){var t;let r=Array.from(this._parsed.values());if(!e.length)return r;let n="string"==typeof e[0]?e[0]:null==(t=e[0])?void 0:t.name;return r.filter(e=>e.name===n)}has(e){return this._parsed.has(e)}set(...e){let[t,r,n]=1===e.length?[e[0].name,e[0].value,e[0]]:e,i=this._parsed;return i.set(t,function(e={name:"",value:""}){return"number"==typeof e.expires&&(e.expires=new Date(e.expires)),e.maxAge&&(e.expires=new Date(Date.now()+1e3*e.maxAge)),(null===e.path||void 0===e.path)&&(e.path="/"),e}({name:t,value:r,...n})),function(e,t){for(let[,r]of(t.delete("set-cookie"),e)){let e=u(r);t.append("set-cookie",e)}}(i,this._headers),this}delete(...e){let[t,r]="string"==typeof e[0]?[e[0]]:[e[0].name,e[0]];return this.set({...r,name:t,value:"",expires:new Date(0)})}[Symbol.for("edge-runtime.inspect.custom")](){return`ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`}toString(){return[...this._parsed.values()].map(u).join("; ")}}},38343,(e,t,r)=>{(()=>{"use strict";"undefined"!=typeof __nccwpck_require__&&(__nccwpck_require__.ab="/ROOT/supercorp/superinterface/node_modules/next/dist/compiled/cookie/");var e={};(()=>{e.parse=function(e,r){if("string"!=typeof e)throw TypeError("argument str must be a string");for(var i={},s=e.split(n),o=(r||{}).decode||t,a=0;a<s.length;a++){var u=s[a],c=u.indexOf("=");if(!(c<0)){var l=u.substr(0,c).trim(),h=u.substr(++c,u.length).trim();'"'==h[0]&&(h=h.slice(1,-1)),void 0==i[l]&&(i[l]=function(e,t){try{return t(e)}catch(t){return e}}(h,o))}}return i},e.serialize=function(e,t,n){var s=n||{},o=s.encode||r;if("function"!=typeof o)throw TypeError("option encode is invalid");if(!i.test(e))throw TypeError("argument name is invalid");var a=o(t);if(a&&!i.test(a))throw TypeError("argument val is invalid");var u=e+"="+a;if(null!=s.maxAge){var c=s.maxAge-0;if(isNaN(c)||!isFinite(c))throw TypeError("option maxAge is invalid");u+="; Max-Age="+Math.floor(c)}if(s.domain){if(!i.test(s.domain))throw TypeError("option domain is invalid");u+="; Domain="+s.domain}if(s.path){if(!i.test(s.path))throw TypeError("option path is invalid");u+="; Path="+s.path}if(s.expires){if("function"!=typeof s.expires.toUTCString)throw TypeError("option expires is invalid");u+="; Expires="+s.expires.toUTCString()}if(s.httpOnly&&(u+="; HttpOnly"),s.secure&&(u+="; Secure"),s.sameSite)switch("string"==typeof s.sameSite?s.sameSite.toLowerCase():s.sameSite){case!0:case"strict":u+="; SameSite=Strict";break;case"lax":u+="; SameSite=Lax";break;case"none":u+="; SameSite=None";break;default:throw TypeError("option sameSite is invalid")}return u};var t=decodeURIComponent,r=encodeURIComponent,n=/; */,i=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/})(),t.exports=e})()},29173,(e,t,r)=>{t.exports=e.x("@prisma/client",()=>require("@prisma/client"))},81962,(e,t,r)=>{"use strict";function n(e){let t=null!=e;return function(r){let n=r.length-1;if(1===n)return[];if("}"!==r[n])throw Error("Invalid array text - must end with }");let i=0;if("["===r[0]&&(i=r.indexOf("=")+1),"{"!==r[i++])throw Error("Invalid array text - must start with {");let s=[],o=s,a=[],u=i,c="",l=!0;for(;i<n;++i){let s=r[i];if('"'===s){u=++i;let n=r.indexOf('"',u),s=r.indexOf("\\",u);for(;-1!==s&&s<n;)i=s,c+=r.slice(u,i),u=++i,n===i++&&(n=r.indexOf('"',i)),s=r.indexOf("\\",i);i=n,c+=r.slice(u,i),o.push(t?e(c):c),c="",l=!1}else if("{"===s){let e=[];o.push(e),a.push(o),o=e,u=i+1,l=!0}else if(","===s)l=!0;else if("}"===s){l=!1;let e=a.pop();if(void 0===e)throw Error("Invalid array text - too many '}'");o=e}else if(l){for(u=i;","!==(s=r[i])&&"}"!==s&&i<n;)++i;let a=r.slice(u,i--);o.push("NULL"===a?null:t?e(a):a),l=!1}else throw Error("Was expecting delimeter")}return s}}let i=n();r.parse=(e,t)=>null!=t?n(t)(e):i(e)},89193,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{RequestCookies:function(){return n.RequestCookies},ResponseCookies:function(){return n.ResponseCookies},stringifyCookie:function(){return n.stringifyCookie}});let n=e.r(18780)},99667,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"ReflectAdapter",{enumerable:!0,get:function(){return n}});class n{static get(e,t,r){let n=Reflect.get(e,t,r);return"function"==typeof n?n.bind(e):n}static set(e,t,r,n){return Reflect.set(e,t,r,n)}static has(e,t){return Reflect.has(e,t)}static deleteProperty(e,t){return Reflect.deleteProperty(e,t)}}},94059,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{DynamicServerError:function(){return i},isDynamicServerError:function(){return s}});let n="DYNAMIC_SERVER_USAGE";class i extends Error{constructor(e){super("Dynamic server usage: "+e),this.description=e,this.digest=n}}function s(e){return"object"==typeof e&&null!==e&&"digest"in e&&"string"==typeof e.digest&&e.digest===n}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},78506,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{StaticGenBailoutError:function(){return i},isStaticGenBailoutError:function(){return s}});let n="NEXT_STATIC_GEN_BAILOUT";class i extends Error{constructor(...e){super(...e),this.code=n}}function s(e){return"object"==typeof e&&null!==e&&"code"in e&&e.code===n}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},53920,(e,t,r)=>{"use strict";function n(e){return"object"==typeof e&&null!==e&&"digest"in e&&e.digest===i}Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{isHangingPromiseRejectionError:function(){return n},makeDevtoolsIOAwarePromise:function(){return c},makeHangingPromise:function(){return a}});let i="HANGING_PROMISE_REJECTION";class s extends Error{constructor(e,t){super(`During prerendering, ${t} rejects when the prerender is complete. Typically these errors are handled by React but if you move ${t} to a different context by using \`setTimeout\`, \`after\`, or similar functions you may observe this error and you should handle it in that context. This occurred at route "${e}".`),this.route=e,this.expression=t,this.digest=i}}let o=new WeakMap;function a(e,t,r){if(e.aborted)return Promise.reject(new s(t,r));{let n=new Promise((n,i)=>{let a=i.bind(null,new s(t,r)),u=o.get(e);if(u)u.push(a);else{let t=[a];o.set(e,t),e.addEventListener("abort",()=>{for(let e=0;e<t.length;e++)t[e]()},{once:!0})}});return n.catch(u),n}}function u(){}function c(e){return new Promise(t=>{setTimeout(()=>{t(e)},0)})}},25812,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{METADATA_BOUNDARY_NAME:function(){return n},OUTLET_BOUNDARY_NAME:function(){return s},ROOT_LAYOUT_BOUNDARY_NAME:function(){return o},VIEWPORT_BOUNDARY_NAME:function(){return i}});let n="__next_metadata_boundary__",i="__next_viewport_boundary__",s="__next_outlet_boundary__",o="__next_root_layout_boundary__"},64244,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{atLeastOneTask:function(){return s},scheduleImmediate:function(){return i},scheduleOnNextTick:function(){return n},waitAtLeastOneReactRenderTask:function(){return o}});let n=e=>{Promise.resolve().then(()=>{process.nextTick(e)})},i=e=>{setImmediate(e)};function s(){return new Promise(e=>i(e))}function o(){return new Promise(e=>setImmediate(e))}},79920,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{BailoutToCSRError:function(){return i},isBailoutToCSRError:function(){return s}});let n="BAILOUT_TO_CLIENT_SIDE_RENDERING";class i extends Error{constructor(e){super("Bail out to client-side rendering: "+e),this.reason=e,this.digest=n}}function s(e){return"object"==typeof e&&null!==e&&"digest"in e&&e.digest===n}},4784,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"InvariantError",{enumerable:!0,get:function(){return n}});class n extends Error{constructor(e,t){super("Invariant: "+(e.endsWith(".")?e:e+".")+" This is a bug in Next.js.",t),this.name="InvariantError"}}},30810,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{Postpone:function(){return A},PreludeState:function(){return Q},abortAndThrowOnSynchronousRequestDataAccess:function(){return S},abortOnSynchronousPlatformIOAccess:function(){return w},accessedDynamicData:function(){return M},annotateDynamicAccess:function(){return U},consumeDynamicAccess:function(){return D},createDynamicTrackingState:function(){return p},createDynamicValidationState:function(){return g},createHangingInputAbortSignal:function(){return j},createRenderInBrowserAbortSignal:function(){return B},delayUntilRuntimeStage:function(){return z},formatDynamicAPIAccesses:function(){return k},getFirstDynamicReason:function(){return m},isDynamicPostpone:function(){return O},isPrerenderInterruptedError:function(){return L},logDisallowedDynamicError:function(){return Y},markCurrentScopeAsDynamic:function(){return y},postponeWithTracking:function(){return T},throwIfDisallowedDynamic:function(){return X},throwToInterruptStaticGeneration:function(){return b},trackAllowedDynamicAccess:function(){return W},trackDynamicDataInDynamicRender:function(){return v},trackSynchronousPlatformIOAccessInDev:function(){return E},trackSynchronousRequestDataAccessInDev:function(){return x},useDynamicRouteParams:function(){return F},warnOnSyncDynamicError:function(){return R}});let n=function(e){return e&&e.__esModule?e:{default:e}}(e.r(41141)),i=e.r(94059),s=e.r(78506),o=e.r(32319),a=e.r(56704),u=e.r(53920),c=e.r(25812),l=e.r(64244),h=e.r(79920),f=e.r(4784),d="function"==typeof n.default.unstable_postpone;function p(e){return{isDebugDynamicAccesses:e,dynamicAccesses:[],syncDynamicErrorWithStack:null}}function g(){return{hasSuspenseAboveBody:!1,hasDynamicMetadata:!1,hasDynamicViewport:!1,hasAllowedDynamic:!1,dynamicErrors:[]}}function m(e){var t;return null==(t=e.dynamicAccesses[0])?void 0:t.expression}function y(e,t,r){if(t)switch(t.type){case"cache":case"unstable-cache":case"private-cache":return}if(!e.forceDynamic&&!e.forceStatic){if(e.dynamicShouldError)throw Object.defineProperty(new s.StaticGenBailoutError(`Route ${e.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${r}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E553",enumerable:!1,configurable:!0});if(t)switch(t.type){case"prerender-ppr":return T(e.route,r,t.dynamicTracking);case"prerender-legacy":t.revalidate=0;let n=Object.defineProperty(new i.DynamicServerError(`Route ${e.route} couldn't be rendered statically because it used ${r}. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`),"__NEXT_ERROR_CODE",{value:"E550",enumerable:!1,configurable:!0});throw e.dynamicUsageDescription=r,e.dynamicUsageStack=n.stack,n}}}function b(e,t,r){let n=Object.defineProperty(new i.DynamicServerError(`Route ${t.route} couldn't be rendered statically because it used \`${e}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`),"__NEXT_ERROR_CODE",{value:"E558",enumerable:!1,configurable:!0});throw r.revalidate=0,t.dynamicUsageDescription=e,t.dynamicUsageStack=n.stack,n}function v(e){switch(e.type){case"cache":case"unstable-cache":case"private-cache":return}}function _(e,t,r){let n=N(`Route ${e} needs to bail out of prerendering at this point because it used ${t}.`);r.controller.abort(n);let i=r.dynamicTracking;i&&i.dynamicAccesses.push({stack:i.isDebugDynamicAccesses?Error().stack:void 0,expression:t})}function w(e,t,r,n){let i=n.dynamicTracking;_(e,t,n),i&&null===i.syncDynamicErrorWithStack&&(i.syncDynamicErrorWithStack=r)}function E(e){e.prerenderPhase=!1}function S(e,t,r,n){if(!1===n.controller.signal.aborted){_(e,t,n);let i=n.dynamicTracking;i&&null===i.syncDynamicErrorWithStack&&(i.syncDynamicErrorWithStack=r)}throw N(`Route ${e} needs to bail out of prerendering at this point because it used ${t}.`)}function R(e){e.syncDynamicErrorWithStack&&console.error(e.syncDynamicErrorWithStack)}let x=E;function A({reason:e,route:t}){let r=o.workUnitAsyncStorage.getStore();T(t,e,r&&"prerender-ppr"===r.type?r.dynamicTracking:null)}function T(e,t,r){(function(){if(!d)throw Object.defineProperty(Error("Invariant: React.unstable_postpone is not defined. This suggests the wrong version of React was loaded. This is a bug in Next.js"),"__NEXT_ERROR_CODE",{value:"E224",enumerable:!1,configurable:!0})})(),r&&r.dynamicAccesses.push({stack:r.isDebugDynamicAccesses?Error().stack:void 0,expression:t}),n.default.unstable_postpone(P(e,t))}function P(e,t){return`Route ${e} needs to bail out of prerendering at this point because it used ${t}. React throws this special object to indicate where. It should not be caught by your own try/catch. Learn more: https://nextjs.org/docs/messages/ppr-caught-error`}function O(e){return"object"==typeof e&&null!==e&&"string"==typeof e.message&&C(e.message)}function C(e){return e.includes("needs to bail out of prerendering at this point because it used")&&e.includes("Learn more: https://nextjs.org/docs/messages/ppr-caught-error")}if(!1===C(P("%%%","^^^")))throw Object.defineProperty(Error("Invariant: isDynamicPostpone misidentified a postpone reason. This is a bug in Next.js"),"__NEXT_ERROR_CODE",{value:"E296",enumerable:!1,configurable:!0});let I="NEXT_PRERENDER_INTERRUPTED";function N(e){let t=Object.defineProperty(Error(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return t.digest=I,t}function L(e){return"object"==typeof e&&null!==e&&e.digest===I&&"name"in e&&"message"in e&&e instanceof Error}function M(e){return e.length>0}function D(e,t){return e.dynamicAccesses.push(...t.dynamicAccesses),e.dynamicAccesses}function k(e){return e.filter(e=>"string"==typeof e.stack&&e.stack.length>0).map(({expression:e,stack:t})=>(t=t.split("\n").slice(4).filter(e=>!(e.includes("node_modules/next/")||e.includes(" (<anonymous>)")||e.includes(" (node:"))).join("\n"),`Dynamic API Usage Debug - ${e}:
2
2
  ${t}`))}function B(){let e=new AbortController;return e.abort(Object.defineProperty(new h.BailoutToCSRError("Render in Browser"),"__NEXT_ERROR_CODE",{value:"E721",enumerable:!1,configurable:!0})),e.signal}function j(e){switch(e.type){case"prerender":case"prerender-runtime":let t=new AbortController;if(e.cacheSignal)e.cacheSignal.inputReady().then(()=>{t.abort()});else{let r=(0,o.getRuntimeStagePromise)(e);r?r.then(()=>(0,l.scheduleOnNextTick)(()=>t.abort())):(0,l.scheduleOnNextTick)(()=>t.abort())}return t.signal;case"prerender-client":case"prerender-ppr":case"prerender-legacy":case"request":case"cache":case"private-cache":case"unstable-cache":return}}function U(e,t){let r=t.dynamicTracking;r&&r.dynamicAccesses.push({stack:r.isDebugDynamicAccesses?Error().stack:void 0,expression:e})}function F(e){let t=a.workAsyncStorage.getStore(),r=o.workUnitAsyncStorage.getStore();if(t&&r)switch(r.type){case"prerender-client":case"prerender":{let i=r.fallbackRouteParams;i&&i.size>0&&n.default.use((0,u.makeHangingPromise)(r.renderSignal,t.route,e));break}case"prerender-ppr":{let n=r.fallbackRouteParams;if(n&&n.size>0)return T(t.route,e,r.dynamicTracking);break}case"prerender-runtime":throw Object.defineProperty(new f.InvariantError(`\`${e}\` was called during a runtime prerender. Next.js should be preventing ${e} from being included in server components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E771",enumerable:!1,configurable:!0});case"cache":case"private-cache":throw Object.defineProperty(new f.InvariantError(`\`${e}\` was called inside a cache scope. Next.js should be preventing ${e} from being included in server components statically, but did not in this case.`),"__NEXT_ERROR_CODE",{value:"E745",enumerable:!1,configurable:!0})}}let q=/\n\s+at Suspense \(<anonymous>\)/,$=RegExp(`\\n\\s+at Suspense \\(<anonymous>\\)(?:(?!\\n\\s+at (?:body|div|main|section|article|aside|header|footer|nav|form|p|span|h1|h2|h3|h4|h5|h6) \\(<anonymous>\\))[\\s\\S])*?\\n\\s+at ${c.ROOT_LAYOUT_BOUNDARY_NAME} \\([^\\n]*\\)`),G=RegExp(`\\n\\s+at ${c.METADATA_BOUNDARY_NAME}[\\n\\s]`),H=RegExp(`\\n\\s+at ${c.VIEWPORT_BOUNDARY_NAME}[\\n\\s]`),V=RegExp(`\\n\\s+at ${c.OUTLET_BOUNDARY_NAME}[\\n\\s]`);function W(e,t,r,n){if(!V.test(t)){if(G.test(t)){r.hasDynamicMetadata=!0;return}if(H.test(t)){r.hasDynamicViewport=!0;return}if($.test(t)){r.hasAllowedDynamic=!0,r.hasSuspenseAboveBody=!0;return}else if(q.test(t)){r.hasAllowedDynamic=!0;return}else{if(n.syncDynamicErrorWithStack)return void r.dynamicErrors.push(n.syncDynamicErrorWithStack);let i=function(e,t){let r=Object.defineProperty(Error(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return r.stack=r.name+": "+e+t,r}(`Route "${e.route}": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense`,t);return void r.dynamicErrors.push(i)}}}var Q=function(e){return e[e.Full=0]="Full",e[e.Empty=1]="Empty",e[e.Errored=2]="Errored",e}({});function Y(e,t){console.error(t),e.dev||(e.hasReadableErrorStacks?console.error(`To get a more detailed stack trace and pinpoint the issue, start the app in development mode by running \`next dev\`, then open "${e.route}" in your browser to investigate the error.`):console.error(`To get a more detailed stack trace and pinpoint the issue, try one of the following:
3
3
  - Start the app in development mode by running \`next dev\`, then open "${e.route}" in your browser to investigate the error.
4
4
  - Rerun the production build with \`next build --debug-prerender\` to generate better stack traces.`))}function X(e,t,r,n){if(0!==t){if(r.hasSuspenseAboveBody)return;if(n.syncDynamicErrorWithStack)throw Y(e,n.syncDynamicErrorWithStack),new s.StaticGenBailoutError;let i=r.dynamicErrors;if(i.length>0){for(let t=0;t<i.length;t++)Y(e,i[t]);throw new s.StaticGenBailoutError}if(r.hasDynamicViewport)throw console.error(`Route "${e.route}" has a \`generateViewport\` that depends on Request data (\`cookies()\`, etc...) or uncached external data (\`fetch(...)\`, etc...) without explicitly allowing fully dynamic rendering. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport`),new s.StaticGenBailoutError;if(1===t)throw console.error(`Route "${e.route}" did not produce a static shell and Next.js was unable to determine a reason. This is a bug in Next.js.`),new s.StaticGenBailoutError}else if(!1===r.hasAllowedDynamic&&r.hasDynamicMetadata)throw console.error(`Route "${e.route}" has a \`generateMetadata\` that depends on Request data (\`cookies()\`, etc...) or uncached external data (\`fetch(...)\`, etc...) when the rest of the route does not. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-metadata`),new s.StaticGenBailoutError}function z(e,t){return e.runtimeStagePromise?e.runtimeStagePromise.then(()=>t):t}},44261,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{isRequestAPICallableInsideAfter:function(){return u},throwForSearchParamsAccessInUseCache:function(){return a},throwWithStaticGenerationBailoutError:function(){return s},throwWithStaticGenerationBailoutErrorWithDynamicError:function(){return o}});let n=e.r(78506),i=e.r(24725);function s(e,t){throw Object.defineProperty(new n.StaticGenBailoutError(`Route ${e} couldn't be rendered statically because it used ${t}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E576",enumerable:!1,configurable:!0})}function o(e,t){throw Object.defineProperty(new n.StaticGenBailoutError(`Route ${e} with \`dynamic = "error"\` couldn't be rendered statically because it used ${t}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`),"__NEXT_ERROR_CODE",{value:"E543",enumerable:!1,configurable:!0})}function a(e,t){let r=Object.defineProperty(Error(`Route ${e.route} used "searchParams" inside "use cache". Accessing dynamic request data inside a cache scope is not supported. If you need some search params inside a cached function await "searchParams" outside of the cached function and pass only the required search params as arguments to the cached function. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`),"__NEXT_ERROR_CODE",{value:"E779",enumerable:!1,configurable:!0});throw Error.captureStackTrace(r,t),e.invalidDynamicUsageError??=r,r}function u(){let e=i.afterTaskAsyncStorage.getStore();return(null==e?void 0:e.rootTaskSpawnPhase)==="action"}},50591,(e,t,r)=>{"use strict";function n(e,t,r){if(e)for(let s of(r&&(r=r.toLowerCase()),e)){var n,i;if(t===(null==(n=s.domain)?void 0:n.split(":",1)[0].toLowerCase())||r===s.defaultLocale.toLowerCase()||(null==(i=s.locales)?void 0:i.some(e=>e.toLowerCase()===r)))return s}}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"detectDomainLocale",{enumerable:!0,get:function(){return n}})},9363,(e,t,r)=>{"use strict";function n(e){return e.replace(/\/$/,"")||"/"}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"removeTrailingSlash",{enumerable:!0,get:function(){return n}})},28210,(e,t,r)=>{"use strict";function n(e){let t=e.indexOf("#"),r=e.indexOf("?"),n=r>-1&&(t<0||r<t);return n||t>-1?{pathname:e.substring(0,n?r:t),query:n?e.substring(r,t>-1?t:void 0):"",hash:t>-1?e.slice(t):""}:{pathname:e,query:"",hash:""}}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"parsePath",{enumerable:!0,get:function(){return n}})},64151,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"addPathPrefix",{enumerable:!0,get:function(){return i}});let n=e.r(28210);function i(e,t){if(!e.startsWith("/")||!t)return e;let{pathname:r,query:i,hash:s}=(0,n.parsePath)(e);return""+t+r+i+s}},76435,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"addPathSuffix",{enumerable:!0,get:function(){return i}});let n=e.r(28210);function i(e,t){if(!e.startsWith("/")||!t)return e;let{pathname:r,query:i,hash:s}=(0,n.parsePath)(e);return""+r+t+i+s}},66590,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"pathHasPrefix",{enumerable:!0,get:function(){return i}});let n=e.r(28210);function i(e,t){if("string"!=typeof e)return!1;let{pathname:r}=(0,n.parsePath)(e);return r===t||r.startsWith(t+"/")}},10441,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"addLocale",{enumerable:!0,get:function(){return s}});let n=e.r(64151),i=e.r(66590);function s(e,t,r,s){if(!t||t===r)return e;let o=e.toLowerCase();return!s&&((0,i.pathHasPrefix)(o,"/api")||(0,i.pathHasPrefix)(o,"/"+t.toLowerCase()))?e:(0,n.addPathPrefix)(e,"/"+t)}},74989,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"formatNextPathnameInfo",{enumerable:!0,get:function(){return a}});let n=e.r(9363),i=e.r(64151),s=e.r(76435),o=e.r(10441);function a(e){let t=(0,o.addLocale)(e.pathname,e.locale,e.buildId?void 0:e.defaultLocale,e.ignorePrefix);return(e.buildId||!e.trailingSlash)&&(t=(0,n.removeTrailingSlash)(t)),e.buildId&&(t=(0,s.addPathSuffix)((0,i.addPathPrefix)(t,"/_next/data/"+e.buildId),"/"===e.pathname?"index.json":".json")),t=(0,i.addPathPrefix)(t,e.basePath),!e.buildId&&e.trailingSlash?t.endsWith("/")?t:(0,s.addPathSuffix)(t,"/"):(0,n.removeTrailingSlash)(t)}},15707,(e,t,r)=>{"use strict";function n(e,t){let r;if((null==t?void 0:t.host)&&!Array.isArray(t.host))r=t.host.toString().split(":",1)[0];else{if(!e.hostname)return;r=e.hostname}return r.toLowerCase()}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"getHostname",{enumerable:!0,get:function(){return n}})},53018,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"normalizeLocalePath",{enumerable:!0,get:function(){return i}});let n=new WeakMap;function i(e,t){let r;if(!t)return{pathname:e};let i=n.get(t);i||(i=t.map(e=>e.toLowerCase()),n.set(t,i));let s=e.split("/",2);if(!s[1])return{pathname:e};let o=s[1].toLowerCase(),a=i.indexOf(o);return a<0?{pathname:e}:(r=t[a],{pathname:e=e.slice(r.length+1)||"/",detectedLocale:r})}},63186,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"removePathPrefix",{enumerable:!0,get:function(){return i}});let n=e.r(66590);function i(e,t){if(!(0,n.pathHasPrefix)(e,t))return e;let r=e.slice(t.length);return r.startsWith("/")?r:"/"+r}},87414,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"getNextPathnameInfo",{enumerable:!0,get:function(){return o}});let n=e.r(53018),i=e.r(63186),s=e.r(66590);function o(e,t){var r,o;let{basePath:a,i18n:u,trailingSlash:c}=null!=(r=t.nextConfig)?r:{},l={pathname:e,trailingSlash:"/"!==e?e.endsWith("/"):c};a&&(0,s.pathHasPrefix)(l.pathname,a)&&(l.pathname=(0,i.removePathPrefix)(l.pathname,a),l.basePath=a);let h=l.pathname;if(l.pathname.startsWith("/_next/data/")&&l.pathname.endsWith(".json")){let e=l.pathname.replace(/^\/_next\/data\//,"").replace(/\.json$/,"").split("/");l.buildId=e[0],h="index"!==e[1]?"/"+e.slice(1).join("/"):"/",!0===t.parseData&&(l.pathname=h)}if(u){let e=t.i18nProvider?t.i18nProvider.analyze(l.pathname):(0,n.normalizeLocalePath)(l.pathname,u.locales);l.locale=e.detectedLocale,l.pathname=null!=(o=e.pathname)?o:l.pathname,!e.detectedLocale&&l.buildId&&(e=t.i18nProvider?t.i18nProvider.analyze(h):(0,n.normalizeLocalePath)(h,u.locales)).detectedLocale&&(l.locale=e.detectedLocale)}return l}},95340,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"NextURL",{enumerable:!0,get:function(){return l}});let n=e.r(50591),i=e.r(74989),s=e.r(15707),o=e.r(87414),a=/(?!^https?:\/\/)(127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\[::1\]|localhost)/;function u(e,t){return new URL(String(e).replace(a,"localhost"),t&&String(t).replace(a,"localhost"))}let c=Symbol("NextURLInternal");class l{constructor(e,t,r){let n,i;"object"==typeof t&&"pathname"in t||"string"==typeof t?(n=t,i=r||{}):i=r||t||{},this[c]={url:u(e,n??i.base),options:i,basePath:""},this.analyze()}analyze(){var e,t,r,i,a;let u=(0,o.getNextPathnameInfo)(this[c].url.pathname,{nextConfig:this[c].options.nextConfig,parseData:!0,i18nProvider:this[c].options.i18nProvider}),l=(0,s.getHostname)(this[c].url,this[c].options.headers);this[c].domainLocale=this[c].options.i18nProvider?this[c].options.i18nProvider.detectDomainLocale(l):(0,n.detectDomainLocale)(null==(t=this[c].options.nextConfig)||null==(e=t.i18n)?void 0:e.domains,l);let h=(null==(r=this[c].domainLocale)?void 0:r.defaultLocale)||(null==(a=this[c].options.nextConfig)||null==(i=a.i18n)?void 0:i.defaultLocale);this[c].url.pathname=u.pathname,this[c].defaultLocale=h,this[c].basePath=u.basePath??"",this[c].buildId=u.buildId,this[c].locale=u.locale??h,this[c].trailingSlash=u.trailingSlash}formatPathname(){return(0,i.formatNextPathnameInfo)({basePath:this[c].basePath,buildId:this[c].buildId,defaultLocale:this[c].options.forceLocale?void 0:this[c].defaultLocale,locale:this[c].locale,pathname:this[c].url.pathname,trailingSlash:this[c].trailingSlash})}formatSearch(){return this[c].url.search}get buildId(){return this[c].buildId}set buildId(e){this[c].buildId=e}get locale(){return this[c].locale??""}set locale(e){var t,r;if(!this[c].locale||!(null==(r=this[c].options.nextConfig)||null==(t=r.i18n)?void 0:t.locales.includes(e)))throw Object.defineProperty(TypeError(`The NextURL configuration includes no locale "${e}"`),"__NEXT_ERROR_CODE",{value:"E597",enumerable:!1,configurable:!0});this[c].locale=e}get defaultLocale(){return this[c].defaultLocale}get domainLocale(){return this[c].domainLocale}get searchParams(){return this[c].url.searchParams}get host(){return this[c].url.host}set host(e){this[c].url.host=e}get hostname(){return this[c].url.hostname}set hostname(e){this[c].url.hostname=e}get port(){return this[c].url.port}set port(e){this[c].url.port=e}get protocol(){return this[c].url.protocol}set protocol(e){this[c].url.protocol=e}get href(){let e=this.formatPathname(),t=this.formatSearch();return`${this.protocol}//${this.host}${e}${t}${this.hash}`}set href(e){this[c].url=u(e),this.analyze()}get origin(){return this[c].url.origin}get pathname(){return this[c].url.pathname}set pathname(e){this[c].url.pathname=e}get hash(){return this[c].url.hash}set hash(e){this[c].url.hash=e}get search(){return this[c].url.search}set search(e){this[c].url.search=e}get password(){return this[c].url.password}set password(e){this[c].url.password=e}get username(){return this[c].url.username}set username(e){this[c].url.username=e}get basePath(){return this[c].basePath}set basePath(e){this[c].basePath=e.startsWith("/")?e:`/${e}`}toString(){return this.href}toJSON(){return this.href}[Symbol.for("edge-runtime.inspect.custom")](){return{href:this.href,origin:this.origin,protocol:this.protocol,username:this.username,password:this.password,host:this.host,hostname:this.hostname,port:this.port,pathname:this.pathname,search:this.search,searchParams:this.searchParams,hash:this.hash}}clone(){return new l(String(this),this[c].options)}}},35459,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{ACTION_SUFFIX:function(){return g},APP_DIR_ALIAS:function(){return D},CACHE_ONE_YEAR:function(){return T},DOT_NEXT_ALIAS:function(){return L},ESLINT_DEFAULT_DIRS:function(){return et},GSP_NO_RETURNED_VALUE:function(){return X},GSSP_COMPONENT_MEMBER_ERROR:function(){return J},GSSP_NO_RETURNED_VALUE:function(){return z},HTML_CONTENT_TYPE_HEADER:function(){return i},INFINITE_CACHE:function(){return P},INSTRUMENTATION_HOOK_FILENAME:function(){return I},JSON_CONTENT_TYPE_HEADER:function(){return s},MATCHED_PATH_HEADER:function(){return u},MIDDLEWARE_FILENAME:function(){return O},MIDDLEWARE_LOCATION_REGEXP:function(){return C},NEXT_BODY_SUFFIX:function(){return b},NEXT_CACHE_IMPLICIT_TAG_ID:function(){return A},NEXT_CACHE_REVALIDATED_TAGS_HEADER:function(){return _},NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER:function(){return w},NEXT_CACHE_SOFT_TAG_MAX_LENGTH:function(){return x},NEXT_CACHE_TAGS_HEADER:function(){return v},NEXT_CACHE_TAG_MAX_ITEMS:function(){return S},NEXT_CACHE_TAG_MAX_LENGTH:function(){return R},NEXT_DATA_SUFFIX:function(){return m},NEXT_INTERCEPTION_MARKER_PREFIX:function(){return a},NEXT_META_SUFFIX:function(){return y},NEXT_QUERY_PARAM_PREFIX:function(){return o},NEXT_RESUME_HEADER:function(){return E},NON_STANDARD_NODE_ENV:function(){return Z},PAGES_DIR_ALIAS:function(){return N},PRERENDER_REVALIDATE_HEADER:function(){return c},PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER:function(){return l},PUBLIC_DIR_MIDDLEWARE_CONFLICT:function(){return G},ROOT_DIR_ALIAS:function(){return M},RSC_ACTION_CLIENT_WRAPPER_ALIAS:function(){return $},RSC_ACTION_ENCRYPTION_ALIAS:function(){return q},RSC_ACTION_PROXY_ALIAS:function(){return j},RSC_ACTION_VALIDATE_ALIAS:function(){return B},RSC_CACHE_WRAPPER_ALIAS:function(){return U},RSC_DYNAMIC_IMPORT_WRAPPER_ALIAS:function(){return F},RSC_MOD_REF_PROXY_ALIAS:function(){return k},RSC_PREFETCH_SUFFIX:function(){return h},RSC_SEGMENTS_DIR_SUFFIX:function(){return f},RSC_SEGMENT_SUFFIX:function(){return d},RSC_SUFFIX:function(){return p},SERVER_PROPS_EXPORT_ERROR:function(){return Y},SERVER_PROPS_GET_INIT_PROPS_CONFLICT:function(){return V},SERVER_PROPS_SSG_CONFLICT:function(){return W},SERVER_RUNTIME:function(){return er},SSG_FALLBACK_EXPORT_ERROR:function(){return ee},SSG_GET_INITIAL_PROPS_CONFLICT:function(){return H},STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR:function(){return Q},TEXT_PLAIN_CONTENT_TYPE_HEADER:function(){return n},UNSTABLE_REVALIDATE_RENAME_ERROR:function(){return K},WEBPACK_LAYERS:function(){return ei},WEBPACK_RESOURCE_QUERIES:function(){return es}});let n="text/plain",i="text/html; charset=utf-8",s="application/json; charset=utf-8",o="nxtP",a="nxtI",u="x-matched-path",c="x-prerender-revalidate",l="x-prerender-revalidate-if-generated",h=".prefetch.rsc",f=".segments",d=".segment.rsc",p=".rsc",g=".action",m=".json",y=".meta",b=".body",v="x-next-cache-tags",_="x-next-revalidated-tags",w="x-next-revalidate-tag-token",E="next-resume",S=128,R=256,x=1024,A="_N_T_",T=31536e3,P=0xfffffffe,O="middleware",C=`(?:src/)?${O}`,I="instrumentation",N="private-next-pages",L="private-dot-next",M="private-next-root-dir",D="private-next-app-dir",k="private-next-rsc-mod-ref-proxy",B="private-next-rsc-action-validate",j="private-next-rsc-server-reference",U="private-next-rsc-cache-wrapper",F="private-next-rsc-track-dynamic-import",q="private-next-rsc-action-encryption",$="private-next-rsc-action-client-wrapper",G="You can not have a '_next' folder inside of your public folder. This conflicts with the internal '/_next' route. https://nextjs.org/docs/messages/public-next-folder-conflict",H="You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps",V="You can not use getInitialProps with getServerSideProps. Please remove getInitialProps.",W="You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps",Q="can not have getInitialProps/getServerSideProps, https://nextjs.org/docs/messages/404-get-initial-props",Y="pages with `getServerSideProps` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export",X="Your `getStaticProps` function did not return an object. Did you forget to add a `return`?",z="Your `getServerSideProps` function did not return an object. Did you forget to add a `return`?",K="The `unstable_revalidate` property is available for general use.\nPlease use `revalidate` instead.",J="can not be attached to a page's component and must be exported from the page. See more info here: https://nextjs.org/docs/messages/gssp-component-member",Z='You are using a non-standard "NODE_ENV" value in your environment. This creates inconsistencies in the project and is strongly advised against. Read more: https://nextjs.org/docs/messages/non-standard-node-env',ee="Pages with `fallback` enabled in `getStaticPaths` can not be exported. See more info here: https://nextjs.org/docs/messages/ssg-fallback-true-export",et=["app","pages","components","lib","src"],er={edge:"edge",experimentalEdge:"experimental-edge",nodejs:"nodejs"},en={shared:"shared",reactServerComponents:"rsc",serverSideRendering:"ssr",actionBrowser:"action-browser",apiNode:"api-node",apiEdge:"api-edge",middleware:"middleware",instrument:"instrument",edgeAsset:"edge-asset",appPagesBrowser:"app-pages-browser",pagesDirBrowser:"pages-dir-browser",pagesDirEdge:"pages-dir-edge",pagesDirNode:"pages-dir-node"},ei={...en,GROUP:{builtinReact:[en.reactServerComponents,en.actionBrowser],serverOnly:[en.reactServerComponents,en.actionBrowser,en.instrument,en.middleware],neutralTarget:[en.apiNode,en.apiEdge],clientOnly:[en.serverSideRendering,en.appPagesBrowser],bundled:[en.reactServerComponents,en.actionBrowser,en.serverSideRendering,en.appPagesBrowser,en.shared,en.instrument,en.middleware],appPages:[en.reactServerComponents,en.serverSideRendering,en.appPagesBrowser,en.actionBrowser]}},es={edgeSSREntry:"__next_edge_ssr_entry__",metadata:"__next_metadata__",metadataRoute:"__next_metadata_route__",metadataImageMeta:"__next_metadata_image_meta__"}},68794,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{fromNodeOutgoingHttpHeaders:function(){return i},normalizeNextQueryParam:function(){return u},splitCookiesString:function(){return s},toNodeOutgoingHttpHeaders:function(){return o},validateURL:function(){return a}});let n=e.r(35459);function i(e){let t=new Headers;for(let[r,n]of Object.entries(e))for(let e of Array.isArray(n)?n:[n])void 0!==e&&("number"==typeof e&&(e=e.toString()),t.append(r,e));return t}function s(e){var t,r,n,i,s,o=[],a=0;function u(){for(;a<e.length&&/\s/.test(e.charAt(a));)a+=1;return a<e.length}for(;a<e.length;){for(t=a,s=!1;u();)if(","===(r=e.charAt(a))){for(n=a,a+=1,u(),i=a;a<e.length&&"="!==(r=e.charAt(a))&&";"!==r&&","!==r;)a+=1;a<e.length&&"="===e.charAt(a)?(s=!0,a=i,o.push(e.substring(t,n)),t=a):a=n+1}else a+=1;(!s||a>=e.length)&&o.push(e.substring(t,e.length))}return o}function o(e){let t={},r=[];if(e)for(let[n,i]of e.entries())"set-cookie"===n.toLowerCase()?(r.push(...s(i)),t[n]=1===r.length?r[0]:r):t[n]=i;return t}function a(e){try{return String(new URL(String(e)))}catch(t){throw Object.defineProperty(Error(`URL is malformed "${String(e)}". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`,{cause:t}),"__NEXT_ERROR_CODE",{value:"E61",enumerable:!1,configurable:!0})}}function u(e){for(let t of[n.NEXT_QUERY_PARAM_PREFIX,n.NEXT_INTERCEPTION_MARKER_PREFIX])if(e!==t&&e.startsWith(t))return e.substring(t.length);return null}},31048,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{PageSignatureError:function(){return n},RemovedPageError:function(){return i},RemovedUAError:function(){return s}});class n extends Error{constructor({page:e}){super(`The middleware "${e}" accepts an async API directly with the form:
@@ -16,23 +16,23 @@ ${t}`))}function B(){let e=new AbortController;return e.abort(Object.definePrope
16
16
  Read more: https://nextjs.org/docs/messages/middleware-request-page
17
17
  `)}}class eD extends Error{constructor(){super(`The request.ua has been removed in favour of \`userAgent\` function.
18
18
  Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent
19
- `)}}var ek=e.i(18780);let eB=Symbol("internal request");class ej extends Request{constructor(e,t={}){let r="string"!=typeof e&&"url"in e?e.url:String(e);eE(r),t.body&&"half"!==t.duplex&&(t.duplex="half"),e instanceof Request?super(e,t):super(r,t);let n=new eL(r,{headers:ew(this.headers),nextConfig:t.nextConfig});this[eB]={cookies:new ek.RequestCookies(this.headers),nextUrl:n,url:n.toString()}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,nextUrl:this.nextUrl,url:this.url,bodyUsed:this.bodyUsed,cache:this.cache,credentials:this.credentials,destination:this.destination,headers:Object.fromEntries(this.headers),integrity:this.integrity,keepalive:this.keepalive,method:this.method,mode:this.mode,redirect:this.redirect,referrer:this.referrer,referrerPolicy:this.referrerPolicy,signal:this.signal}}get cookies(){return this[eB].cookies}get nextUrl(){return this[eB].nextUrl}get page(){throw new eM}get ua(){throw new eD}get url(){return this[eB].url}}let eU="ResponseAborted";class eF extends Error{constructor(...e){super(...e),this.name=eU}}function eq(e){let t=new AbortController;return e.once("close",()=>{e.writableFinished||t.abort(new eF)}),t}function e$(e){let{errored:t,destroyed:r}=e;if(t||r)return AbortSignal.abort(t??new eF);let{signal:n}=eq(e);return n}class eG{static fromBaseNextRequest(e,t){return eG.fromNodeNextRequest(e,t)}static fromNodeNextRequest(e,t){let r,n=null;if("GET"!==e.method&&"HEAD"!==e.method&&e.body&&(n=e.body),e.url.startsWith("http"))r=new URL(e.url);else{let t=eb(e,"initURL");r=t&&t.startsWith("http")?new URL(e.url,t):new URL(e.url,"http://n")}return new ej(r,{method:e.method,headers:ev(e.headers),duplex:"half",signal:t,...t.aborted?{}:{body:n}})}static fromWebNextRequest(e){let t=null;return"GET"!==e.method&&"HEAD"!==e.method&&(t=e.body),new ej(e.url,{method:e.method,headers:ev(e.headers),duplex:"half",signal:e.request.signal,...e.request.signal.aborted?{}:{body:t}})}}let eH=0,eV=0,eW=0;function eQ(e){return(null==e?void 0:e.name)==="AbortError"||(null==e?void 0:e.name)===eU}async function eY(e,t,r){try{let{errored:n,destroyed:i}=t;if(n||i)return;let s=eq(t),o=function(e,t){let r=!1,n=new ec;function i(){n.resolve()}e.on("drain",i),e.once("close",()=>{e.off("drain",i),n.resolve()});let s=new ec;return e.once("finish",()=>{s.resolve()}),new WritableStream({write:async t=>{if(!r){if(r=!0,"performance"in globalThis&&process.env.NEXT_OTEL_PERFORMANCE_PREFIX){let e=function(e={}){let t=0===eH?void 0:{clientComponentLoadStart:eH,clientComponentLoadTimes:eV,clientComponentLoadCount:eW};return e.reset&&(eH=0,eV=0,eW=0),t}();e&&performance.measure(`${process.env.NEXT_OTEL_PERFORMANCE_PREFIX}:next-client-component-loading`,{start:e.clientComponentLoadStart,end:e.clientComponentLoadStart+e.clientComponentLoadTimes})}e.flushHeaders(),B().trace(d.startResponse,{spanName:"start response"},()=>void 0)}try{let r=e.write(t);"flush"in e&&"function"==typeof e.flush&&e.flush(),r||(await n.promise,n=new ec)}catch(t){throw e.end(),Object.defineProperty(Error("failed to write chunk to response",{cause:t}),"__NEXT_ERROR_CODE",{value:"E321",enumerable:!1,configurable:!0})}},abort:t=>{e.writableFinished||e.destroy(t)},close:async()=>{if(t&&await t,!e.writableFinished)return e.end(),s.promise}})}(t,r);await e.pipeTo(o,{signal:s.signal})}catch(e){if(eQ(e))return;throw Object.defineProperty(Error("failed to pipe response",{cause:e}),"__NEXT_ERROR_CODE",{value:"E180",enumerable:!1,configurable:!0})}}class eX{static #e=this.EMPTY=new eX(null,{metadata:{},contentType:null});static fromStatic(e,t){return new eX(e,{metadata:{},contentType:t})}constructor(e,{contentType:t,waitUntil:r,metadata:n}){this.response=e,this.contentType=t,this.metadata=n,this.waitUntil=r}assignMetadata(e){Object.assign(this.metadata,e)}get isNull(){return null===this.response}get isDynamic(){return"string"!=typeof this.response}toUnchunkedString(e=!1){if(null===this.response)return"";if("string"!=typeof this.response){if(!e)throw Object.defineProperty(new en("dynamic responses cannot be unchunked. This is a bug in Next.js"),"__NEXT_ERROR_CODE",{value:"E732",enumerable:!1,configurable:!0});return em(this.readable)}return this.response}get readable(){return null===this.response?new ReadableStream({start(e){e.close()}}):"string"==typeof this.response?ep(this.response):Buffer.isBuffer(this.response)?eg(this.response):Array.isArray(this.response)?function(...e){if(0===e.length)return new ReadableStream({start(e){e.close()}});if(1===e.length)return e[0];let{readable:t,writable:r}=new TransformStream,n=e[0].pipeTo(r,{preventClose:!0}),i=1;for(;i<e.length-1;i++){let t=e[i];n=n.then(()=>t.pipeTo(r,{preventClose:!0}))}let s=e[i];return(n=n.then(()=>s.pipeTo(r))).catch(ef),t}(...this.response):this.response}coerce(){return null===this.response?[]:"string"==typeof this.response?[ep(this.response)]:Array.isArray(this.response)?this.response:Buffer.isBuffer(this.response)?[eg(this.response)]:[this.response]}unshift(e){this.response=this.coerce(),this.response.unshift(e)}push(e){this.response=this.coerce(),this.response.push(e)}async pipeTo(e){try{await this.readable.pipeTo(e,{preventClose:!0}),this.waitUntil&&await this.waitUntil,await e.close()}catch(t){if(eQ(t))return void await e.abort(t);throw t}}async pipeToNodeResponse(e){await eY(this.readable,e,this.waitUntil)}}let ez=Symbol.for("next-patch");function eK(e,t){e.shouldTrackFetchMetrics&&(e.fetchMetrics??=[],e.fetchMetrics.push({...t,end:performance.timeOrigin+performance.now(),idx:e.nextFetchId||0}))}async function eJ(e,t,r,n,i,s){let o=await e.arrayBuffer(),a={headers:Object.fromEntries(e.headers.entries()),body:Buffer.from(o).toString("base64"),status:e.status,url:e.url};return r&&await n.set(t,{kind:el.FETCH,data:a,revalidate:i},r),await s(),new Response(o,{headers:e.headers,status:e.status,statusText:e.statusText})}async function eZ(e,t,r,n,i,s,o,a,u){let[c,l]=eu(t),h=c.arrayBuffer().then(async e=>{let t=Buffer.from(e),a={headers:Object.fromEntries(c.headers.entries()),body:t.toString("base64"),status:c.status,url:c.url};null==s||s.set(r,a),n&&await i.set(r,{kind:el.FETCH,data:a,revalidate:o},n)}).catch(e=>console.warn("Failed to set fetch cache",a,e)).finally(u),f=`cache-set-${r}`;return e.pendingRevalidates??={},f in e.pendingRevalidates&&await e.pendingRevalidates[f],e.pendingRevalidates[f]=h.finally(()=>{var t;(null==(t=e.pendingRevalidates)?void 0:t[f])&&delete e.pendingRevalidates[f]}),l}function e0(e){if(!0===globalThis[ez])return;let t=function(e){let t=X.cache(e=>[]);return function(r,n){let i,s;if(n&&n.signal)return e(r,n);if("string"!=typeof r||n){let t="string"==typeof r||r instanceof URL?new Request(r,n):r;if("GET"!==t.method&&"HEAD"!==t.method||t.keepalive)return e(r,n);s=JSON.stringify([t.method,Array.from(t.headers.entries()),t.mode,t.redirect,t.credentials,t.referrer,t.referrerPolicy,t.integrity]),i=t.url}else s='["GET",[],null,"follow",null,null,null,null]',i=r;let o=t(i);for(let e=0,t=o.length;e<t;e+=1){let[t,r]=o[e];if(t===s)return r.then(()=>{let t=o[e][2];if(!t)throw Object.defineProperty(new en("No cached response"),"__NEXT_ERROR_CODE",{value:"E579",enumerable:!1,configurable:!0});let[r,n]=eu(t);return o[e][2]=n,r})}let a=e(r,n),u=[s,a,null];return o.push(u),a.then(e=>{let[t,r]=eu(e);return u[2]=r,t})}}(globalThis.fetch);globalThis.fetch=function(e,{workAsyncStorage:t,workUnitAsyncStorage:r}){let n=async function(n,i){var s,o;let a;try{(a=new URL(n instanceof Request?n.url:n)).username="",a.password=""}catch{a=void 0}let u=(null==a?void 0:a.href)??"",c=(null==i||null==(s=i.method)?void 0:s.toUpperCase())||"GET",l=(null==i||null==(o=i.next)?void 0:o.internal)===!0,h="1"===process.env.NEXT_OTEL_FETCH_DISABLED,f=l?void 0:performance.timeOrigin+performance.now(),p=t.getStore(),g=r.getStore(),y=g?(0,J.getCacheSignal)(g):null;y&&y.beginRead();let b=B().trace(l?d.internalFetch:m.fetch,{hideSpan:h,kind:P.CLIENT,spanName:["fetch",c,u].filter(Boolean).join(" "),attributes:{"http.url":u,"http.method":c,"net.peer.name":null==a?void 0:a.hostname,"net.peer.port":(null==a?void 0:a.port)||void 0}},async()=>{var t;let r,s,o,a,c,h;if(l||!p||p.isDraftMode)return e(n,i);let d=n&&"object"==typeof n&&"string"==typeof n.method,m=e=>(null==i?void 0:i[e])||(d?n[e]:null),b=e=>{var t,r,s;return void 0!==(null==i||null==(t=i.next)?void 0:t[e])?null==i||null==(r=i.next)?void 0:r[e]:d?null==(s=n.next)?void 0:s[e]:void 0},v=b("revalidate"),_=v,w=function(e,t){let r=[],n=[];for(let i=0;i<e.length;i++){let s=e[i];if("string"!=typeof s?n.push({tag:s,reason:"invalid type, must be a string"}):s.length>V?n.push({tag:s,reason:`exceeded max length of ${V}`}):r.push(s),r.length>H){console.warn(`Warning: exceeded max tag count for ${t}, dropped tags:`,e.slice(i).join(", "));break}}if(n.length>0)for(let{tag:e,reason:r}of(console.warn(`Warning: invalid tags passed to ${t}: `),n))console.log(`tag: "${e}" ${r}`);return r}(b("tags")||[],`fetch ${n.toString()}`);if(g)switch(g.type){case"prerender":case"prerender-runtime":case"prerender-client":case"prerender-ppr":case"prerender-legacy":case"cache":case"private-cache":r=g}if(r&&Array.isArray(w)){let e=r.tags??(r.tags=[]);for(let t of w)e.includes(t)||e.push(t)}let E=null==g?void 0:g.implicitTags,S=p.fetchCache;g&&"unstable-cache"===g.type&&(S="force-no-store");let R=!!p.isUnstableNoStore,x=m("cache"),A="";"string"==typeof x&&void 0!==_&&("force-cache"===x&&0===_||"no-store"===x&&(_>0||!1===_))&&(s=`Specified "cache: ${x}" and "revalidate: ${_}", only one should be specified.`,x=void 0,_=void 0);let T="no-cache"===x||"no-store"===x||"force-no-store"===S||"only-no-store"===S,P=!S&&!x&&!_&&p.forceDynamic;"force-cache"===x&&void 0===_?_=!1:(T||P)&&(_=0),("no-cache"===x||"no-store"===x)&&(A=`cache: ${x}`),h=function(e,t){try{let r;if(!1===e)r=Q;else if("number"==typeof e&&!isNaN(e)&&e>-1)r=e;else if(void 0!==e)throw Object.defineProperty(Error(`Invalid revalidate value "${e}" on "${t}", must be a non-negative number or false`),"__NEXT_ERROR_CODE",{value:"E179",enumerable:!1,configurable:!0});return r}catch(e){if(e instanceof Error&&e.message.includes("Invalid revalidate"))throw e;return}}(_,p.route);let O=m("headers"),C="function"==typeof(null==O?void 0:O.get)?O:new Headers(O||{}),I=C.get("authorization")||C.get("cookie"),N=!["get","head"].includes((null==(t=m("method"))?void 0:t.toLowerCase())||"get"),L=void 0==S&&(void 0==x||"default"===x)&&void 0==_,M=!!((I||N)&&(null==r?void 0:r.revalidate)===0),D=!1;if(!M&&L&&(p.isBuildTimePrerendering?D=!0:M=!0),L&&void 0!==g)switch(g.type){case"prerender":case"prerender-runtime":case"prerender-client":return y&&(y.endRead(),y=null),et(g.renderSignal,p.route,"fetch()")}switch(S){case"force-no-store":A="fetchCache = force-no-store";break;case"only-no-store":if("force-cache"===x||void 0!==h&&h>0)throw Object.defineProperty(Error(`cache: 'force-cache' used on fetch for ${u} with 'export const fetchCache = 'only-no-store'`),"__NEXT_ERROR_CODE",{value:"E448",enumerable:!1,configurable:!0});A="fetchCache = only-no-store";break;case"only-cache":if("no-store"===x)throw Object.defineProperty(Error(`cache: 'no-store' used on fetch for ${u} with 'export const fetchCache = 'only-cache'`),"__NEXT_ERROR_CODE",{value:"E521",enumerable:!1,configurable:!0});break;case"force-cache":(void 0===_||0===_)&&(A="fetchCache = force-cache",h=Q)}if(void 0===h?"default-cache"!==S||R?"default-no-store"===S?(h=0,A="fetchCache = default-no-store"):R?(h=0,A="noStore call"):M?(h=0,A="auto no cache"):(A="auto cache",h=r?r.revalidate:Q):(h=Q,A="fetchCache = default-cache"):A||(A=`revalidate: ${h}`),!(p.forceStatic&&0===h)&&!M&&r&&h<r.revalidate){if(0===h){if(g)switch(g.type){case"prerender":case"prerender-client":case"prerender-runtime":return y&&(y.endRead(),y=null),et(g.renderSignal,p.route,"fetch()")}es(p,g,`revalidate: 0 fetch ${n} ${p.route}`)}r&&v===h&&(r.revalidate=h)}let k="number"==typeof h&&h>0,{incrementalCache:B}=p,j=!1;if(g)switch(g.type){case"request":case"cache":case"private-cache":j=g.isHmrRefresh??!1,a=g.serverComponentsHmrCache}if(B&&(k||a))try{o=await B.generateCacheKey(u,d?n:i)}catch(e){console.error("Failed to generate cache key for",n)}let U=p.nextFetchId??1;p.nextFetchId=U+1;let F=()=>{},q=async(t,r)=>{let c=["cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","window","duplex",...t?[]:["signal"]];if(d){let e=n,t={body:e._ogBody||e.body};for(let r of c)t[r]=e[r];n=new Request(e.url,t)}else if(i){let{_ogBody:e,body:r,signal:n,...s}=i;i={...s,body:e||r,signal:t?void 0:n}}let l={...i,next:{...null==i?void 0:i.next,fetchType:"origin",fetchIdx:U}};return e(n,l).then(async e=>{if(!t&&f&&eK(p,{start:f,url:u,cacheReason:r||A,cacheStatus:0===h||r?"skip":"miss",cacheWarning:s,status:e.status,method:l.method||"GET"}),200===e.status&&B&&o&&(k||a)){let t=h>=Q?W:h,r=k?{fetchCache:!0,fetchUrl:u,fetchIdx:U,tags:w,isImplicitBuildTimeCache:D}:void 0;switch(null==g?void 0:g.type){case"prerender":case"prerender-client":case"prerender-runtime":return eJ(e,o,r,B,t,F);case"prerender-ppr":case"prerender-legacy":case"request":case"cache":case"private-cache":case"unstable-cache":case void 0:return eZ(p,e,o,r,B,a,t,n,F)}}return await F(),e}).catch(e=>{throw F(),e})},$=!1,G=!1;if(o&&B){let e;if(j&&a&&(e=a.get(o),G=!0),k&&!e){F=await B.lock(o);let t=p.isOnDemandRevalidate?null:await B.get(o,{kind:eh.FETCH,revalidate:h,fetchUrl:u,fetchIdx:U,tags:w,softTags:null==E?void 0:E.tags});if(L&&g)switch(g.type){case"prerender":case"prerender-client":case"prerender-runtime":await new Promise(e=>setImmediate(e))}if(t?await F():c="cache-control: no-cache (hard refresh)",(null==t?void 0:t.value)&&t.value.kind===el.FETCH)if(p.isRevalidate&&t.isStale)$=!0;else{if(t.isStale&&(p.pendingRevalidates??={},!p.pendingRevalidates[o])){let e=q(!0).then(async e=>({body:await e.arrayBuffer(),headers:e.headers,status:e.status,statusText:e.statusText})).finally(()=>{p.pendingRevalidates??={},delete p.pendingRevalidates[o||""]});e.catch(console.error),p.pendingRevalidates[o]=e}e=t.value.data}}if(e){f&&eK(p,{start:f,url:u,cacheReason:A,cacheStatus:G?"hmr":"hit",cacheWarning:s,status:e.status||200,method:(null==i?void 0:i.method)||"GET"});let t=new Response(Buffer.from(e.body,"base64"),{headers:e.headers,status:e.status});return Object.defineProperty(t,"url",{value:e.url}),t}}if(p.isStaticGeneration&&i&&"object"==typeof i){let{cache:e}=i;if("no-store"===e){if(g)switch(g.type){case"prerender":case"prerender-client":case"prerender-runtime":return y&&(y.endRead(),y=null),et(g.renderSignal,p.route,"fetch()")}es(p,g,`no-store fetch ${n} ${p.route}`)}let t="next"in i,{next:s={}}=i;if("number"==typeof s.revalidate&&r&&s.revalidate<r.revalidate){if(0===s.revalidate){if(g)switch(g.type){case"prerender":case"prerender-client":case"prerender-runtime":return et(g.renderSignal,p.route,"fetch()")}es(p,g,`revalidate: 0 fetch ${n} ${p.route}`)}p.forceStatic&&0===s.revalidate||(r.revalidate=s.revalidate)}t&&delete i.next}if(!o||!$)return q(!1,c);{let e=o;p.pendingRevalidates??={};let t=p.pendingRevalidates[e];if(t){let e=await t;return new Response(e.body,{headers:e.headers,status:e.status,statusText:e.statusText})}let r=q(!0,c).then(eu);return(t=r.then(async e=>{let t=e[0];return{body:await t.arrayBuffer(),headers:t.headers,status:t.status,statusText:t.statusText}}).finally(()=>{var t;(null==(t=p.pendingRevalidates)?void 0:t[e])&&delete p.pendingRevalidates[e]})).catch(()=>{}),p.pendingRevalidates[e]=t,r.then(e=>e[1])}});if(y)try{return await b}finally{y&&y.endRead()}return b};return n.__nextPatched=!0,n.__nextGetStaticStore=()=>t,n._nextOriginalFetch=e,globalThis[ez]=!0,Object.defineProperty(n,"name",{value:"fetch",writable:!1}),n}(t,e)}function e1(e){var t;return(t=e.split("/").reduce((e,t,r,n)=>t?"("===t[0]&&t.endsWith(")")||"@"===t[0]||("page"===t||"route"===t)&&r===n.length-1?e:e+"/"+t:e,"")).startsWith("/")?t:"/"+t}e.s(["normalizeAppPath",()=>e1],5270),e.s(["NodeNextRequest",()=>e7,"NodeNextResponse",()=>te],90231);class e2{static get(e,t,r){let n=Reflect.get(e,t,r);return"function"==typeof n?n.bind(e):n}static set(e,t,r,n){return Reflect.set(e,t,r,n)}static has(e,t){return Reflect.has(e,t)}static deleteProperty(e,t){return Reflect.deleteProperty(e,t)}}class e6 extends Error{constructor(){super("Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers")}static callable(){throw new e6}}class e3 extends Headers{constructor(e){super(),this.headers=new Proxy(e,{get(t,r,n){if("symbol"==typeof r)return e2.get(t,r,n);let i=r.toLowerCase(),s=Object.keys(e).find(e=>e.toLowerCase()===i);if(void 0!==s)return e2.get(t,s,n)},set(t,r,n,i){if("symbol"==typeof r)return e2.set(t,r,n,i);let s=r.toLowerCase(),o=Object.keys(e).find(e=>e.toLowerCase()===s);return e2.set(t,o??r,n,i)},has(t,r){if("symbol"==typeof r)return e2.has(t,r);let n=r.toLowerCase(),i=Object.keys(e).find(e=>e.toLowerCase()===n);return void 0!==i&&e2.has(t,i)},deleteProperty(t,r){if("symbol"==typeof r)return e2.deleteProperty(t,r);let n=r.toLowerCase(),i=Object.keys(e).find(e=>e.toLowerCase()===n);return void 0===i||e2.deleteProperty(t,i)}})}static seal(e){return new Proxy(e,{get(e,t,r){switch(t){case"append":case"delete":case"set":return e6.callable;default:return e2.get(e,t,r)}}})}merge(e){return Array.isArray(e)?e.join(", "):e}static from(e){return e instanceof Headers?e:new e3(e)}append(e,t){let r=this.headers[e];"string"==typeof r?this.headers[e]=[r,t]:Array.isArray(r)?r.push(t):this.headers[e]=t}delete(e){delete this.headers[e]}get(e){let t=this.headers[e];return void 0!==t?this.merge(t):null}has(e){return void 0!==this.headers[e]}set(e,t){this.headers[e]=t}forEach(e,t){for(let[r,n]of this.entries())e.call(t,n,r,this)}*entries(){for(let e of Object.keys(this.headers)){let t=e.toLowerCase(),r=this.get(t);yield[t,r]}}*keys(){for(let e of Object.keys(this.headers)){let t=e.toLowerCase();yield t}}*values(){for(let e of Object.keys(this.headers)){let t=this.get(e);yield t}}[Symbol.iterator](){return this.entries()}}Symbol("__next_preview_data");let e5=Symbol("__prerender_bypass");var e4=function(e){return e[e.SeeOther=303]="SeeOther",e[e.TemporaryRedirect=307]="TemporaryRedirect",e[e.PermanentRedirect=308]="PermanentRedirect",e}({});class e8{constructor(e,t,r){this.method=e,this.url=t,this.body=r}get cookies(){var t;return this._cookies?this._cookies:this._cookies=(t=this.headers,function(){let{cookie:r}=t;if(!r)return{};let{parse:n}=e.r(38343);return n(Array.isArray(r)?r.join("; "):r)})()}}class e9{constructor(e){this.destination=e}redirect(e,t){return this.setHeader("Location",e),this.statusCode=t,t===e4.PermanentRedirect&&this.setHeader("Refresh",`0;url=${e}`),this}}class e7 extends e8{static #e=ey;constructor(e){var t;super(e.method.toUpperCase(),e.url,e),this._req=e,this.headers=this._req.headers,this.fetchMetrics=null==(t=this._req)?void 0:t.fetchMetrics,this[ey]=this._req[ey]||{},this.streaming=!1}get originalRequest(){return this._req[ey]=this[ey],this._req.url=this.url,this._req.cookies=this.cookies,this._req}set originalRequest(e){this._req=e}stream(){if(this.streaming)throw Object.defineProperty(Error("Invariant: NodeNextRequest.stream() can only be called once"),"__NEXT_ERROR_CODE",{value:"E467",enumerable:!1,configurable:!0});return this.streaming=!0,new ReadableStream({start:e=>{this._req.on("data",t=>{e.enqueue(new Uint8Array(t))}),this._req.on("end",()=>{e.close()}),this._req.on("error",t=>{e.error(t)})}})}}class te extends e9{get originalResponse(){return e5 in this&&(this._res[e5]=this[e5]),this._res}constructor(e){super(e),this._res=e,this.textBody=void 0}get sent(){return this._res.finished||this._res.headersSent}get statusCode(){return this._res.statusCode}set statusCode(e){this._res.statusCode=e}get statusMessage(){return this._res.statusMessage}set statusMessage(e){this._res.statusMessage=e}setHeader(e,t){return this._res.setHeader(e,t),this}removeHeader(e){return this._res.removeHeader(e),this}getHeaderValues(e){let t=this._res.getHeader(e);if(void 0!==t)return(Array.isArray(t)?t:[t]).map(e=>e.toString())}hasHeader(e){return this._res.hasHeader(e)}getHeader(e){let t=this.getHeaderValues(e);return Array.isArray(t)?t.join(","):void 0}getHeaders(){return this._res.getHeaders()}appendHeader(e,t){let r=this.getHeaderValues(e)??[];return r.includes(t)||this._res.setHeader(e,[...r,t]),this}body(e){return this.textBody=e,this}send(){this._res.end(this.textBody)}onClose(e){this.originalResponse.on("close",e)}}function tt(e){return e.isOnDemandRevalidate?"on-demand":e.isRevalidate?"stale":void 0}async function tr(e,t,r,n){{var i;t.statusCode=r.status,t.statusMessage=r.statusText;let s=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(i=r.headers)||i.forEach((e,r)=>{if("x-middleware-set-cookie"!==r.toLowerCase())if("set-cookie"===r.toLowerCase())for(let n of e_(e))t.appendHeader(r,n);else{let n=void 0!==t.getHeader(r);(s.includes(r.toLowerCase())||!n)&&t.appendHeader(r,e)}});let{originalResponse:o}=t;r.body&&"HEAD"!==e.method?await eY(r.body,o,n):o.end()}}function tn({revalidate:e,expire:t}){let r="number"==typeof e&&void 0!==t&&e<t?`, stale-while-revalidate=${t-e}`:"";return 0===e?"private, no-cache, no-store, max-age=0, must-revalidate":"number"==typeof e?`s-maxage=${e}${r}`:`s-maxage=${W}${r}`}e.s(["getRevalidateReason",()=>tt],89822),e.s(["sendResponse",()=>tr],9124),e.s(["getCacheControlHeader",()=>tn],40568),e.s(["prisma",()=>iT],24493);var ti,ts,to,ta,tu=Object.create,tc=Object.defineProperty,tl=Object.getOwnPropertyDescriptor,th=Object.getOwnPropertyNames,tf=Object.getPrototypeOf,td=Object.prototype.hasOwnProperty,tp=(e,t)=>tc(e,"name",{value:t,configurable:!0}),tg=(e,t)=>()=>(e&&(t=e(e=0)),t),tm=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ty=(e,t)=>{for(var r in t)tc(e,r,{get:t[r],enumerable:!0})},tb=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of th(t))td.call(e,i)||i===r||tc(e,i,{get:()=>t[i],enumerable:!(n=tl(t,i))||n.enumerable});return e},tv=(e,t,r)=>(r=null!=e?tu(tf(e)):{},tb(!t&&e&&e.__esModule?r:tc(r,"default",{value:e,enumerable:!0}),e)),t_=e=>tb(tc({},"__esModule",{value:!0}),e),tw=(e,t,r)=>((e,t,r)=>t in e?tc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),tE=tm(e=>{tx(),e.byteLength=u,e.toByteArray=l,e.fromByteArray=d;var t,r,n=[],i=[],s="u">typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(t=0,r=o.length;t<r;++t)n[t]=o[t],i[o.charCodeAt(t)]=t;function a(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function u(e){var t=a(e),r=t[0],n=t[1];return(r+n)*3/4-n}function c(e,t,r){return(t+r)*3/4-r}function l(e){var t,r,n=a(e),o=n[0],u=n[1],l=new s(c(e,o,u)),h=0,f=u>0?o-4:o;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)],l[h++]=t>>16&255,l[h++]=t>>8&255,l[h++]=255&t;return 2===u&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,l[h++]=255&t),1===u&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,l[h++]=t>>8&255,l[h++]=255&t),l}function h(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function f(e,t,r){for(var n=[],i=t;i<r;i+=3)n.push(h((e[i]<<16&0xff0000)+(e[i+1]<<8&65280)+(255&e[i+2])));return n.join("")}function d(e){for(var t,r=e.length,i=r%3,s=[],o=0,a=r-i;o<a;o+=16383)s.push(f(e,o,o+16383>a?a:o+16383));return 1===i?s.push(n[(t=e[r-1])>>2]+n[t<<4&63]+"=="):2===i&&s.push(n[(t=(e[r-2]<<8)+e[r-1])>>10]+n[t>>4&63]+n[t<<2&63]+"="),s.join("")}i[45]=62,i[95]=63,tp(a,"getLens"),tp(u,"byteLength"),tp(c,"_byteLength"),tp(l,"toByteArray"),tp(h,"tripletToBase64"),tp(f,"encodeChunk"),tp(d,"fromByteArray")}),tS=tm(e=>{tx(),e.read=function(e,t,r,n,i){var s,o,a=8*i-n-1,u=(1<<a)-1,c=u>>1,l=-7,h=r?i-1:0,f=r?-1:1,d=e[t+h];for(h+=f,s=d&(1<<-l)-1,d>>=-l,l+=a;l>0;s=256*s+e[t+h],h+=f,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=n;l>0;o=256*o+e[t+h],h+=f,l-=8);if(0===s)s=1-c;else{if(s===u)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),s-=c}return(d?-1:1)*o*Math.pow(2,s-n)},e.write=function(e,t,r,n,i,s){var o,a,u,c=8*s-i-1,l=(1<<c)-1,h=l>>1,f=5960464477539062e-23*(23===i),d=n?0:s-1,p=n?1:-1,g=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(a=+!!isNaN(t),o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),o+h>=1?t+=f/u:t+=f*Math.pow(2,1-h),t*u>=2&&(o++,u/=2),o+h>=l?(a=0,o=l):o+h>=1?(a=(t*u-1)*Math.pow(2,i),o+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;e[r+d]=255&a,d+=p,a/=256,i-=8);for(o=o<<i|a,c+=i;c>0;e[r+d]=255&o,d+=p,o/=256,c-=8);e[r+d-p]|=128*g}}),tR=tm(e=>{tx();var t=tE(),r=tS(),n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function i(){try{let e=new Uint8Array(1),t={foo:tp(function(){return 42},"foo")};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch{return!1}}function s(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,o.prototype),t}function o(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return l(e)}return a(e,t,r)}function a(e,t,r){if("string"==typeof e)return h(e,t);if(ArrayBuffer.isView(e))return d(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(er(e,ArrayBuffer)||e&&er(e.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(er(e,SharedArrayBuffer)||e&&er(e.buffer,SharedArrayBuffer)))return p(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return o.from(n,t,r);let i=g(e);if(i)return i;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,r);throw 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 TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function c(e,t,r){return u(e),e<=0?s(e):void 0!==t?"string"==typeof r?s(e).fill(t,r):s(e).fill(t):s(e)}function l(e){return u(e),s(e<0?0:0|m(e))}function h(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!o.isEncoding(t))throw TypeError("Unknown encoding: "+t);let r=0|b(e,t),n=s(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function f(e){let t=e.length<0?0:0|m(e.length),r=s(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e){if(er(e,Uint8Array)){let t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return f(e)}function p(e,t,r){let n;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),o.prototype),n}function g(e){if(o.isBuffer(e)){let t=0|m(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||en(e.length)?s(0):f(e):"Buffer"===e.type&&Array.isArray(e.data)?f(e.data):void 0}function m(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function y(e){return+e!=e&&(e=0),o.alloc(+e)}function b(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||er(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return K(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return ee(e).length;default:if(i)return n?-1:K(e).length;t=(""+t).toLowerCase(),i=!0}}function v(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0)||(r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return L(this,t,r);case"utf8":case"utf-8":return O(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return N(this,t,r);case"base64":return P(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,r);default:if(n)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function _(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}function w(e,t,r,n,i){if(0===e.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),en(r*=1)&&(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;else r=0;if("string"==typeof t&&(t=o.from(t,n)),o.isBuffer(t))return 0===t.length?-1:E(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):E(e,[t],r,n,i);throw TypeError("val must be string, number or Buffer")}function E(e,t,r,n,i){let s,o=1,a=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;o=2,a/=2,u/=2,r/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(tp(c,"read"),i){let n=-1;for(s=r;s<a;s++)if(c(e,s)===c(t,-1===n?0:s-n)){if(-1===n&&(n=s),s-n+1===u)return n*o}else -1!==n&&(s-=s-n),n=-1}else for(r+u>a&&(r=a-u),s=r;s>=0;s--){let r=!0;for(let n=0;n<u;n++)if(c(e,s+n)!==c(t,n)){r=!1;break}if(r)return s}return -1}function S(e,t,r,n){let i;r=Number(r)||0;let s=e.length-r;n?(n=Number(n))>s&&(n=s):n=s;let o=t.length;for(n>o/2&&(n=o/2),i=0;i<n;++i){let n=parseInt(t.substr(2*i,2),16);if(en(n))break;e[r+i]=n}return i}function R(e,t,r,n){return et(K(t,e.length-r),e,r,n)}function x(e,t,r,n){return et(J(t),e,r,n)}function A(e,t,r,n){return et(ee(t),e,r,n)}function T(e,t,r,n){return et(Z(t,e.length-r),e,r,n)}function P(e,r,n){return 0===r&&n===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(r,n))}function O(e,t,r){r=Math.min(e.length,r);let n=[],i=t;for(;i<r;){let t=e[i],s=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o<=r){let r,n,a,u;switch(o){case 1:t<128&&(s=t);break;case 2:(192&(r=e[i+1]))==128&&(u=(31&t)<<6|63&r)>127&&(s=u);break;case 3:r=e[i+1],n=e[i+2],(192&r)==128&&(192&n)==128&&(u=(15&t)<<12|(63&r)<<6|63&n)>2047&&(u<55296||u>57343)&&(s=u);break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],(192&r)==128&&(192&n)==128&&(192&a)==128&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a)>65535&&u<1114112&&(s=u)}}null===s?(s=65533,o=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),i+=o}return C(n)}function C(e){let t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return r}function I(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function N(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function L(e,t,r){let n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=ei[e[n]];return i}function M(e,t,r){let n=e.slice(t,r),i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function D(e,t,r){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function k(e,t,r,n,i,s){if(!o.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw RangeError('"value" argument is out of bounds');if(r+n>e.length)throw RangeError("Index out of range")}function B(e,t,r,n,i){W(t,n,i,e,r,7);let s=Number(t&BigInt(0xffffffff));e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s;let o=Number(t>>BigInt(32)&BigInt(0xffffffff));return e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,r}function j(e,t,r,n,i){W(t,n,i,e,r,7);let s=Number(t&BigInt(0xffffffff));e[r+7]=s,s>>=8,e[r+6]=s,s>>=8,e[r+5]=s,s>>=8,e[r+4]=s;let o=Number(t>>BigInt(32)&BigInt(0xffffffff));return e[r+3]=o,o>>=8,e[r+2]=o,o>>=8,e[r+1]=o,o>>=8,e[r]=o,r+8}function U(e,t,r,n,i,s){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function F(e,t,n,i,s){return t*=1,n>>>=0,s||U(e,t,n,4,34028234663852886e22,-34028234663852886e22),r.write(e,t,n,i,23,4),n+4}function q(e,t,n,i,s){return t*=1,n>>>=0,s||U(e,t,n,8,17976931348623157e292,-17976931348623157e292),r.write(e,t,n,i,52,8),n+8}e.Buffer=o,e.SlowBuffer=y,e.INSPECT_MAX_BYTES=50,e.kMaxLength=0x7fffffff,o.TYPED_ARRAY_SUPPORT=i(),!o.TYPED_ARRAY_SUPPORT&&"u">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."),tp(i,"typedArraySupport"),Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:tp(function(){if(o.isBuffer(this))return this.buffer},"get")}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:tp(function(){if(o.isBuffer(this))return this.byteOffset},"get")}),tp(s,"createBuffer"),tp(o,"Buffer"),o.poolSize=8192,tp(a,"from"),o.from=function(e,t,r){return a(e,t,r)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),tp(u,"assertSize"),tp(c,"alloc"),o.alloc=function(e,t,r){return c(e,t,r)},tp(l,"allocUnsafe"),o.allocUnsafe=function(e){return l(e)},o.allocUnsafeSlow=function(e){return l(e)},tp(h,"fromString"),tp(f,"fromArrayLike"),tp(d,"fromArrayView"),tp(p,"fromArrayBuffer"),tp(g,"fromObject"),tp(m,"checked"),tp(y,"SlowBuffer"),o.isBuffer=tp(function(e){return null!=e&&!0===e._isBuffer&&e!==o.prototype},"isBuffer"),o.compare=tp(function(e,t){if(er(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),er(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(e)||!o.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,s=Math.min(r,n);i<s;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:+(n<r)},"compare"),o.isEncoding=tp(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}},"isEncoding"),o.concat=tp(function(e,t){let r;if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;let n=o.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){let t=e[r];if(er(t,Uint8Array))i+t.length>n.length?(o.isBuffer(t)||(t=o.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else if(o.isBuffer(t))t.copy(n,i);else throw TypeError('"list" argument must be an Array of Buffers');i+=t.length}return n},"concat"),tp(b,"byteLength"),o.byteLength=b,tp(v,"slowToString"),o.prototype._isBuffer=!0,tp(_,"swap"),o.prototype.swap16=tp(function(){let e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)_(this,t,t+1);return this},"swap16"),o.prototype.swap32=tp(function(){let e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)_(this,t,t+3),_(this,t+1,t+2);return this},"swap32"),o.prototype.swap64=tp(function(){let e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)_(this,t,t+7),_(this,t+1,t+6),_(this,t+2,t+5),_(this,t+3,t+4);return this},"swap64"),o.prototype.toString=tp(function(){let e=this.length;return 0===e?"":0==arguments.length?O(this,0,e):v.apply(this,arguments)},"toString"),o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=tp(function(e){if(!o.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},"equals"),o.prototype.inspect=tp(function(){let t="",r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},"inspect"),n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=tp(function(e,t,r,n,i){if(er(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw 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 RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;let s=i-n,a=r-t,u=Math.min(s,a),c=this.slice(n,i),l=e.slice(t,r);for(let e=0;e<u;++e)if(c[e]!==l[e]){s=c[e],a=l[e];break}return s<a?-1:+(a<s)},"compare"),tp(w,"bidirectionalIndexOf"),tp(E,"arrayIndexOf"),o.prototype.includes=tp(function(e,t,r){return -1!==this.indexOf(e,t,r)},"includes"),o.prototype.indexOf=tp(function(e,t,r){return w(this,e,t,r,!0)},"indexOf"),o.prototype.lastIndexOf=tp(function(e,t,r){return w(this,e,t,r,!1)},"lastIndexOf"),tp(S,"hexWrite"),tp(R,"utf8Write"),tp(x,"asciiWrite"),tp(A,"base64Write"),tp(T,"ucs2Write"),o.prototype.write=tp(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))t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let s=!1;for(;;)switch(n){case"hex":return S(this,e,t,r);case"utf8":case"utf-8":return R(this,e,t,r);case"ascii":case"latin1":case"binary":return x(this,e,t,r);case"base64":return A(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,r);default:if(s)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},"write"),o.prototype.toJSON=tp(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON"),tp(P,"base64Slice"),tp(O,"utf8Slice"),tp(C,"decodeCodePointsArray"),tp(I,"asciiSlice"),tp(N,"latin1Slice"),tp(L,"hexSlice"),tp(M,"utf16leSlice"),o.prototype.slice=tp(function(e,t){let r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);let n=this.subarray(e,t);return Object.setPrototypeOf(n,o.prototype),n},"slice"),tp(D,"checkOffset"),o.prototype.readUintLE=o.prototype.readUIntLE=tp(function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);let n=this[e],i=1,s=0;for(;++s<t&&(i*=256);)n+=this[e+s]*i;return n},"readUIntLE"),o.prototype.readUintBE=o.prototype.readUIntBE=tp(function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},"readUIntBE"),o.prototype.readUint8=o.prototype.readUInt8=tp(function(e,t){return e>>>=0,t||D(e,1,this.length),this[e]},"readUInt8"),o.prototype.readUint16LE=o.prototype.readUInt16LE=tp(function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]|this[e+1]<<8},"readUInt16LE"),o.prototype.readUint16BE=o.prototype.readUInt16BE=tp(function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE"),o.prototype.readUint32LE=o.prototype.readUInt32LE=tp(function(e,t){return e>>>=0,t||D(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},"readUInt32LE"),o.prototype.readUint32BE=o.prototype.readUInt32BE=tp(function(e,t){return e>>>=0,t||D(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"readUInt32BE"),o.prototype.readBigUInt64LE=es(tp(function(e){Q(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&Y(e,this.length-8);let n=t+256*this[++e]+65536*this[++e]+0x1000000*this[++e],i=this[++e]+256*this[++e]+65536*this[++e]+0x1000000*r;return BigInt(n)+(BigInt(i)<<BigInt(32))},"readBigUInt64LE")),o.prototype.readBigUInt64BE=es(tp(function(e){Q(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&Y(e,this.length-8);let n=0x1000000*t+65536*this[++e]+256*this[++e]+this[++e],i=0x1000000*this[++e]+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)},"readBigUInt64BE")),o.prototype.readIntLE=tp(function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);let n=this[e],i=1,s=0;for(;++s<t&&(i*=256);)n+=this[e+s]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},"readIntLE"),o.prototype.readIntBE=tp(function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);let n=t,i=1,s=this[e+--n];for(;n>0&&(i*=256);)s+=this[e+--n]*i;return s>=(i*=128)&&(s-=Math.pow(2,8*t)),s},"readIntBE"),o.prototype.readInt8=tp(function(e,t){return e>>>=0,t||D(e,1,this.length),128&this[e]?-((255-this[e]+1)*1):this[e]},"readInt8"),o.prototype.readInt16LE=tp(function(e,t){e>>>=0,t||D(e,2,this.length);let r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},"readInt16LE"),o.prototype.readInt16BE=tp(function(e,t){e>>>=0,t||D(e,2,this.length);let r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},"readInt16BE"),o.prototype.readInt32LE=tp(function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE"),o.prototype.readInt32BE=tp(function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE"),o.prototype.readBigInt64LE=es(tp(function(e){Q(e>>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&Y(e,this.length-8),(BigInt(this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24))<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+0x1000000*this[++e])},"readBigInt64LE")),o.prototype.readBigInt64BE=es(tp(function(e){Q(e>>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&Y(e,this.length-8),(BigInt((t<<24)+65536*this[++e]+256*this[++e]+this[++e])<<BigInt(32))+BigInt(0x1000000*this[++e]+65536*this[++e]+256*this[++e]+r)},"readBigInt64BE")),o.prototype.readFloatLE=tp(function(e,t){return e>>>=0,t||D(e,4,this.length),r.read(this,e,!0,23,4)},"readFloatLE"),o.prototype.readFloatBE=tp(function(e,t){return e>>>=0,t||D(e,4,this.length),r.read(this,e,!1,23,4)},"readFloatBE"),o.prototype.readDoubleLE=tp(function(e,t){return e>>>=0,t||D(e,8,this.length),r.read(this,e,!0,52,8)},"readDoubleLE"),o.prototype.readDoubleBE=tp(function(e,t){return e>>>=0,t||D(e,8,this.length),r.read(this,e,!1,52,8)},"readDoubleBE"),tp(k,"checkInt"),o.prototype.writeUintLE=o.prototype.writeUIntLE=tp(function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;k(this,e,t,r,n,0)}let i=1,s=0;for(this[t]=255&e;++s<r&&(i*=256);)this[t+s]=e/i&255;return t+r},"writeUIntLE"),o.prototype.writeUintBE=o.prototype.writeUIntBE=tp(function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;k(this,e,t,r,n,0)}let i=r-1,s=1;for(this[t+i]=255&e;--i>=0&&(s*=256);)this[t+i]=e/s&255;return t+r},"writeUIntBE"),o.prototype.writeUint8=o.prototype.writeUInt8=tp(function(e,t,r){return e*=1,t>>>=0,r||k(this,e,t,1,255,0),this[t]=255&e,t+1},"writeUInt8"),o.prototype.writeUint16LE=o.prototype.writeUInt16LE=tp(function(e,t,r){return e*=1,t>>>=0,r||k(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},"writeUInt16LE"),o.prototype.writeUint16BE=o.prototype.writeUInt16BE=tp(function(e,t,r){return e*=1,t>>>=0,r||k(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},"writeUInt16BE"),o.prototype.writeUint32LE=o.prototype.writeUInt32LE=tp(function(e,t,r){return e*=1,t>>>=0,r||k(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},"writeUInt32LE"),o.prototype.writeUint32BE=o.prototype.writeUInt32BE=tp(function(e,t,r){return e*=1,t>>>=0,r||k(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},"writeUInt32BE"),tp(B,"wrtBigUInt64LE"),tp(j,"wrtBigUInt64BE"),o.prototype.writeBigUInt64LE=es(tp(function(e,t=0){return B(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE")),o.prototype.writeBigUInt64BE=es(tp(function(e,t=0){return j(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE")),o.prototype.writeIntLE=tp(function(e,t,r,n){if(e*=1,t>>>=0,!n){let n=Math.pow(2,8*r-1);k(this,e,t,r,n-1,-n)}let i=0,s=1,o=0;for(this[t]=255&e;++i<r&&(s*=256);)e<0&&0===o&&0!==this[t+i-1]&&(o=1),this[t+i]=(e/s|0)-o&255;return t+r},"writeIntLE"),o.prototype.writeIntBE=tp(function(e,t,r,n){if(e*=1,t>>>=0,!n){let n=Math.pow(2,8*r-1);k(this,e,t,r,n-1,-n)}let i=r-1,s=1,o=0;for(this[t+i]=255&e;--i>=0&&(s*=256);)e<0&&0===o&&0!==this[t+i+1]&&(o=1),this[t+i]=(e/s|0)-o&255;return t+r},"writeIntBE"),o.prototype.writeInt8=tp(function(e,t,r){return e*=1,t>>>=0,r||k(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},"writeInt8"),o.prototype.writeInt16LE=tp(function(e,t,r){return e*=1,t>>>=0,r||k(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},"writeInt16LE"),o.prototype.writeInt16BE=tp(function(e,t,r){return e*=1,t>>>=0,r||k(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},"writeInt16BE"),o.prototype.writeInt32LE=tp(function(e,t,r){return e*=1,t>>>=0,r||k(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},"writeInt32LE"),o.prototype.writeInt32BE=tp(function(e,t,r){return e*=1,t>>>=0,r||k(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},"writeInt32BE"),o.prototype.writeBigInt64LE=es(tp(function(e,t=0){return B(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE")),o.prototype.writeBigInt64BE=es(tp(function(e,t=0){return j(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE")),tp(U,"checkIEEE754"),tp(F,"writeFloat"),o.prototype.writeFloatLE=tp(function(e,t,r){return F(this,e,t,!0,r)},"writeFloatLE"),o.prototype.writeFloatBE=tp(function(e,t,r){return F(this,e,t,!1,r)},"writeFloatBE"),tp(q,"writeDouble"),o.prototype.writeDoubleLE=tp(function(e,t,r){return q(this,e,t,!0,r)},"writeDoubleLE"),o.prototype.writeDoubleBE=tp(function(e,t,r){return q(this,e,t,!1,r)},"writeDoubleBE"),o.prototype.copy=tp(function(e,t,r,n){if(!o.isBuffer(e))throw 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||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);let i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},"copy"),o.prototype.fill=tp(function(e,t,r,n){let i;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 TypeError("encoding must be a string");if("string"==typeof n&&!o.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){let t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{let s=o.isBuffer(e)?e:o.from(e,n),a=s.length;if(0===a)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=s[i%a]}return this},"fill");var $={};function G(e,t,r){var n;$[e]=(tp(n=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}\
19
+ `)}}var ek=e.i(18780);let eB=Symbol("internal request");class ej extends Request{constructor(e,t={}){let r="string"!=typeof e&&"url"in e?e.url:String(e);eE(r),t.body&&"half"!==t.duplex&&(t.duplex="half"),e instanceof Request?super(e,t):super(r,t);let n=new eL(r,{headers:ew(this.headers),nextConfig:t.nextConfig});this[eB]={cookies:new ek.RequestCookies(this.headers),nextUrl:n,url:n.toString()}}[Symbol.for("edge-runtime.inspect.custom")](){return{cookies:this.cookies,nextUrl:this.nextUrl,url:this.url,bodyUsed:this.bodyUsed,cache:this.cache,credentials:this.credentials,destination:this.destination,headers:Object.fromEntries(this.headers),integrity:this.integrity,keepalive:this.keepalive,method:this.method,mode:this.mode,redirect:this.redirect,referrer:this.referrer,referrerPolicy:this.referrerPolicy,signal:this.signal}}get cookies(){return this[eB].cookies}get nextUrl(){return this[eB].nextUrl}get page(){throw new eM}get ua(){throw new eD}get url(){return this[eB].url}}let eU="ResponseAborted";class eF extends Error{constructor(...e){super(...e),this.name=eU}}function eq(e){let t=new AbortController;return e.once("close",()=>{e.writableFinished||t.abort(new eF)}),t}function e$(e){let{errored:t,destroyed:r}=e;if(t||r)return AbortSignal.abort(t??new eF);let{signal:n}=eq(e);return n}class eG{static fromBaseNextRequest(e,t){return eG.fromNodeNextRequest(e,t)}static fromNodeNextRequest(e,t){let r,n=null;if("GET"!==e.method&&"HEAD"!==e.method&&e.body&&(n=e.body),e.url.startsWith("http"))r=new URL(e.url);else{let t=eb(e,"initURL");r=t&&t.startsWith("http")?new URL(e.url,t):new URL(e.url,"http://n")}return new ej(r,{method:e.method,headers:ev(e.headers),duplex:"half",signal:t,...t.aborted?{}:{body:n}})}static fromWebNextRequest(e){let t=null;return"GET"!==e.method&&"HEAD"!==e.method&&(t=e.body),new ej(e.url,{method:e.method,headers:ev(e.headers),duplex:"half",signal:e.request.signal,...e.request.signal.aborted?{}:{body:t}})}}let eH=0,eV=0,eW=0;function eQ(e){return(null==e?void 0:e.name)==="AbortError"||(null==e?void 0:e.name)===eU}async function eY(e,t,r){try{let{errored:n,destroyed:i}=t;if(n||i)return;let s=eq(t),o=function(e,t){let r=!1,n=new ec;function i(){n.resolve()}e.on("drain",i),e.once("close",()=>{e.off("drain",i),n.resolve()});let s=new ec;return e.once("finish",()=>{s.resolve()}),new WritableStream({write:async t=>{if(!r){if(r=!0,"performance"in globalThis&&process.env.NEXT_OTEL_PERFORMANCE_PREFIX){let e=function(e={}){let t=0===eH?void 0:{clientComponentLoadStart:eH,clientComponentLoadTimes:eV,clientComponentLoadCount:eW};return e.reset&&(eH=0,eV=0,eW=0),t}();e&&performance.measure(`${process.env.NEXT_OTEL_PERFORMANCE_PREFIX}:next-client-component-loading`,{start:e.clientComponentLoadStart,end:e.clientComponentLoadStart+e.clientComponentLoadTimes})}e.flushHeaders(),B().trace(d.startResponse,{spanName:"start response"},()=>void 0)}try{let r=e.write(t);"flush"in e&&"function"==typeof e.flush&&e.flush(),r||(await n.promise,n=new ec)}catch(t){throw e.end(),Object.defineProperty(Error("failed to write chunk to response",{cause:t}),"__NEXT_ERROR_CODE",{value:"E321",enumerable:!1,configurable:!0})}},abort:t=>{e.writableFinished||e.destroy(t)},close:async()=>{if(t&&await t,!e.writableFinished)return e.end(),s.promise}})}(t,r);await e.pipeTo(o,{signal:s.signal})}catch(e){if(eQ(e))return;throw Object.defineProperty(Error("failed to pipe response",{cause:e}),"__NEXT_ERROR_CODE",{value:"E180",enumerable:!1,configurable:!0})}}class eX{static #e=this.EMPTY=new eX(null,{metadata:{},contentType:null});static fromStatic(e,t){return new eX(e,{metadata:{},contentType:t})}constructor(e,{contentType:t,waitUntil:r,metadata:n}){this.response=e,this.contentType=t,this.metadata=n,this.waitUntil=r}assignMetadata(e){Object.assign(this.metadata,e)}get isNull(){return null===this.response}get isDynamic(){return"string"!=typeof this.response}toUnchunkedString(e=!1){if(null===this.response)return"";if("string"!=typeof this.response){if(!e)throw Object.defineProperty(new en("dynamic responses cannot be unchunked. This is a bug in Next.js"),"__NEXT_ERROR_CODE",{value:"E732",enumerable:!1,configurable:!0});return em(this.readable)}return this.response}get readable(){return null===this.response?new ReadableStream({start(e){e.close()}}):"string"==typeof this.response?ep(this.response):Buffer.isBuffer(this.response)?eg(this.response):Array.isArray(this.response)?function(...e){if(0===e.length)return new ReadableStream({start(e){e.close()}});if(1===e.length)return e[0];let{readable:t,writable:r}=new TransformStream,n=e[0].pipeTo(r,{preventClose:!0}),i=1;for(;i<e.length-1;i++){let t=e[i];n=n.then(()=>t.pipeTo(r,{preventClose:!0}))}let s=e[i];return(n=n.then(()=>s.pipeTo(r))).catch(ef),t}(...this.response):this.response}coerce(){return null===this.response?[]:"string"==typeof this.response?[ep(this.response)]:Array.isArray(this.response)?this.response:Buffer.isBuffer(this.response)?[eg(this.response)]:[this.response]}unshift(e){this.response=this.coerce(),this.response.unshift(e)}push(e){this.response=this.coerce(),this.response.push(e)}async pipeTo(e){try{await this.readable.pipeTo(e,{preventClose:!0}),this.waitUntil&&await this.waitUntil,await e.close()}catch(t){if(eQ(t))return void await e.abort(t);throw t}}async pipeToNodeResponse(e){await eY(this.readable,e,this.waitUntil)}}let ez=Symbol.for("next-patch");function eK(e,t){e.shouldTrackFetchMetrics&&(e.fetchMetrics??=[],e.fetchMetrics.push({...t,end:performance.timeOrigin+performance.now(),idx:e.nextFetchId||0}))}async function eJ(e,t,r,n,i,s){let o=await e.arrayBuffer(),a={headers:Object.fromEntries(e.headers.entries()),body:Buffer.from(o).toString("base64"),status:e.status,url:e.url};return r&&await n.set(t,{kind:el.FETCH,data:a,revalidate:i},r),await s(),new Response(o,{headers:e.headers,status:e.status,statusText:e.statusText})}async function eZ(e,t,r,n,i,s,o,a,u){let[c,l]=eu(t),h=c.arrayBuffer().then(async e=>{let t=Buffer.from(e),a={headers:Object.fromEntries(c.headers.entries()),body:t.toString("base64"),status:c.status,url:c.url};null==s||s.set(r,a),n&&await i.set(r,{kind:el.FETCH,data:a,revalidate:o},n)}).catch(e=>console.warn("Failed to set fetch cache",a,e)).finally(u),f=`cache-set-${r}`;return e.pendingRevalidates??={},f in e.pendingRevalidates&&await e.pendingRevalidates[f],e.pendingRevalidates[f]=h.finally(()=>{var t;(null==(t=e.pendingRevalidates)?void 0:t[f])&&delete e.pendingRevalidates[f]}),l}function e0(e){if(!0===globalThis[ez])return;let t=function(e){let t=X.cache(e=>[]);return function(r,n){let i,s;if(n&&n.signal)return e(r,n);if("string"!=typeof r||n){let t="string"==typeof r||r instanceof URL?new Request(r,n):r;if("GET"!==t.method&&"HEAD"!==t.method||t.keepalive)return e(r,n);s=JSON.stringify([t.method,Array.from(t.headers.entries()),t.mode,t.redirect,t.credentials,t.referrer,t.referrerPolicy,t.integrity]),i=t.url}else s='["GET",[],null,"follow",null,null,null,null]',i=r;let o=t(i);for(let e=0,t=o.length;e<t;e+=1){let[t,r]=o[e];if(t===s)return r.then(()=>{let t=o[e][2];if(!t)throw Object.defineProperty(new en("No cached response"),"__NEXT_ERROR_CODE",{value:"E579",enumerable:!1,configurable:!0});let[r,n]=eu(t);return o[e][2]=n,r})}let a=e(r,n),u=[s,a,null];return o.push(u),a.then(e=>{let[t,r]=eu(e);return u[2]=r,t})}}(globalThis.fetch);globalThis.fetch=function(e,{workAsyncStorage:t,workUnitAsyncStorage:r}){let n=async function(n,i){var s,o;let a;try{(a=new URL(n instanceof Request?n.url:n)).username="",a.password=""}catch{a=void 0}let u=(null==a?void 0:a.href)??"",c=(null==i||null==(s=i.method)?void 0:s.toUpperCase())||"GET",l=(null==i||null==(o=i.next)?void 0:o.internal)===!0,h="1"===process.env.NEXT_OTEL_FETCH_DISABLED,f=l?void 0:performance.timeOrigin+performance.now(),p=t.getStore(),g=r.getStore(),y=g?(0,J.getCacheSignal)(g):null;y&&y.beginRead();let b=B().trace(l?d.internalFetch:m.fetch,{hideSpan:h,kind:P.CLIENT,spanName:["fetch",c,u].filter(Boolean).join(" "),attributes:{"http.url":u,"http.method":c,"net.peer.name":null==a?void 0:a.hostname,"net.peer.port":(null==a?void 0:a.port)||void 0}},async()=>{var t;let r,s,o,a,c,h;if(l||!p||p.isDraftMode)return e(n,i);let d=n&&"object"==typeof n&&"string"==typeof n.method,m=e=>(null==i?void 0:i[e])||(d?n[e]:null),b=e=>{var t,r,s;return void 0!==(null==i||null==(t=i.next)?void 0:t[e])?null==i||null==(r=i.next)?void 0:r[e]:d?null==(s=n.next)?void 0:s[e]:void 0},v=b("revalidate"),_=v,w=function(e,t){let r=[],n=[];for(let i=0;i<e.length;i++){let s=e[i];if("string"!=typeof s?n.push({tag:s,reason:"invalid type, must be a string"}):s.length>V?n.push({tag:s,reason:`exceeded max length of ${V}`}):r.push(s),r.length>H){console.warn(`Warning: exceeded max tag count for ${t}, dropped tags:`,e.slice(i).join(", "));break}}if(n.length>0)for(let{tag:e,reason:r}of(console.warn(`Warning: invalid tags passed to ${t}: `),n))console.log(`tag: "${e}" ${r}`);return r}(b("tags")||[],`fetch ${n.toString()}`);if(g)switch(g.type){case"prerender":case"prerender-runtime":case"prerender-client":case"prerender-ppr":case"prerender-legacy":case"cache":case"private-cache":r=g}if(r&&Array.isArray(w)){let e=r.tags??(r.tags=[]);for(let t of w)e.includes(t)||e.push(t)}let E=null==g?void 0:g.implicitTags,S=p.fetchCache;g&&"unstable-cache"===g.type&&(S="force-no-store");let R=!!p.isUnstableNoStore,x=m("cache"),A="";"string"==typeof x&&void 0!==_&&("force-cache"===x&&0===_||"no-store"===x&&(_>0||!1===_))&&(s=`Specified "cache: ${x}" and "revalidate: ${_}", only one should be specified.`,x=void 0,_=void 0);let T="no-cache"===x||"no-store"===x||"force-no-store"===S||"only-no-store"===S,P=!S&&!x&&!_&&p.forceDynamic;"force-cache"===x&&void 0===_?_=!1:(T||P)&&(_=0),("no-cache"===x||"no-store"===x)&&(A=`cache: ${x}`),h=function(e,t){try{let r;if(!1===e)r=Q;else if("number"==typeof e&&!isNaN(e)&&e>-1)r=e;else if(void 0!==e)throw Object.defineProperty(Error(`Invalid revalidate value "${e}" on "${t}", must be a non-negative number or false`),"__NEXT_ERROR_CODE",{value:"E179",enumerable:!1,configurable:!0});return r}catch(e){if(e instanceof Error&&e.message.includes("Invalid revalidate"))throw e;return}}(_,p.route);let O=m("headers"),C="function"==typeof(null==O?void 0:O.get)?O:new Headers(O||{}),I=C.get("authorization")||C.get("cookie"),N=!["get","head"].includes((null==(t=m("method"))?void 0:t.toLowerCase())||"get"),L=void 0==S&&(void 0==x||"default"===x)&&void 0==_,M=!!((I||N)&&(null==r?void 0:r.revalidate)===0),D=!1;if(!M&&L&&(p.isBuildTimePrerendering?D=!0:M=!0),L&&void 0!==g)switch(g.type){case"prerender":case"prerender-runtime":case"prerender-client":return y&&(y.endRead(),y=null),et(g.renderSignal,p.route,"fetch()")}switch(S){case"force-no-store":A="fetchCache = force-no-store";break;case"only-no-store":if("force-cache"===x||void 0!==h&&h>0)throw Object.defineProperty(Error(`cache: 'force-cache' used on fetch for ${u} with 'export const fetchCache = 'only-no-store'`),"__NEXT_ERROR_CODE",{value:"E448",enumerable:!1,configurable:!0});A="fetchCache = only-no-store";break;case"only-cache":if("no-store"===x)throw Object.defineProperty(Error(`cache: 'no-store' used on fetch for ${u} with 'export const fetchCache = 'only-cache'`),"__NEXT_ERROR_CODE",{value:"E521",enumerable:!1,configurable:!0});break;case"force-cache":(void 0===_||0===_)&&(A="fetchCache = force-cache",h=Q)}if(void 0===h?"default-cache"!==S||R?"default-no-store"===S?(h=0,A="fetchCache = default-no-store"):R?(h=0,A="noStore call"):M?(h=0,A="auto no cache"):(A="auto cache",h=r?r.revalidate:Q):(h=Q,A="fetchCache = default-cache"):A||(A=`revalidate: ${h}`),!(p.forceStatic&&0===h)&&!M&&r&&h<r.revalidate){if(0===h){if(g)switch(g.type){case"prerender":case"prerender-client":case"prerender-runtime":return y&&(y.endRead(),y=null),et(g.renderSignal,p.route,"fetch()")}es(p,g,`revalidate: 0 fetch ${n} ${p.route}`)}r&&v===h&&(r.revalidate=h)}let k="number"==typeof h&&h>0,{incrementalCache:B}=p,j=!1;if(g)switch(g.type){case"request":case"cache":case"private-cache":j=g.isHmrRefresh??!1,a=g.serverComponentsHmrCache}if(B&&(k||a))try{o=await B.generateCacheKey(u,d?n:i)}catch(e){console.error("Failed to generate cache key for",n)}let U=p.nextFetchId??1;p.nextFetchId=U+1;let F=()=>{},q=async(t,r)=>{let c=["cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","window","duplex",...t?[]:["signal"]];if(d){let e=n,t={body:e._ogBody||e.body};for(let r of c)t[r]=e[r];n=new Request(e.url,t)}else if(i){let{_ogBody:e,body:r,signal:n,...s}=i;i={...s,body:e||r,signal:t?void 0:n}}let l={...i,next:{...null==i?void 0:i.next,fetchType:"origin",fetchIdx:U}};return e(n,l).then(async e=>{if(!t&&f&&eK(p,{start:f,url:u,cacheReason:r||A,cacheStatus:0===h||r?"skip":"miss",cacheWarning:s,status:e.status,method:l.method||"GET"}),200===e.status&&B&&o&&(k||a)){let t=h>=Q?W:h,r=k?{fetchCache:!0,fetchUrl:u,fetchIdx:U,tags:w,isImplicitBuildTimeCache:D}:void 0;switch(null==g?void 0:g.type){case"prerender":case"prerender-client":case"prerender-runtime":return eJ(e,o,r,B,t,F);case"prerender-ppr":case"prerender-legacy":case"request":case"cache":case"private-cache":case"unstable-cache":case void 0:return eZ(p,e,o,r,B,a,t,n,F)}}return await F(),e}).catch(e=>{throw F(),e})},$=!1,G=!1;if(o&&B){let e;if(j&&a&&(e=a.get(o),G=!0),k&&!e){F=await B.lock(o);let t=p.isOnDemandRevalidate?null:await B.get(o,{kind:eh.FETCH,revalidate:h,fetchUrl:u,fetchIdx:U,tags:w,softTags:null==E?void 0:E.tags});if(L&&g)switch(g.type){case"prerender":case"prerender-client":case"prerender-runtime":await new Promise(e=>setImmediate(e))}if(t?await F():c="cache-control: no-cache (hard refresh)",(null==t?void 0:t.value)&&t.value.kind===el.FETCH)if(p.isRevalidate&&t.isStale)$=!0;else{if(t.isStale&&(p.pendingRevalidates??={},!p.pendingRevalidates[o])){let e=q(!0).then(async e=>({body:await e.arrayBuffer(),headers:e.headers,status:e.status,statusText:e.statusText})).finally(()=>{p.pendingRevalidates??={},delete p.pendingRevalidates[o||""]});e.catch(console.error),p.pendingRevalidates[o]=e}e=t.value.data}}if(e){f&&eK(p,{start:f,url:u,cacheReason:A,cacheStatus:G?"hmr":"hit",cacheWarning:s,status:e.status||200,method:(null==i?void 0:i.method)||"GET"});let t=new Response(Buffer.from(e.body,"base64"),{headers:e.headers,status:e.status});return Object.defineProperty(t,"url",{value:e.url}),t}}if(p.isStaticGeneration&&i&&"object"==typeof i){let{cache:e}=i;if("no-store"===e){if(g)switch(g.type){case"prerender":case"prerender-client":case"prerender-runtime":return y&&(y.endRead(),y=null),et(g.renderSignal,p.route,"fetch()")}es(p,g,`no-store fetch ${n} ${p.route}`)}let t="next"in i,{next:s={}}=i;if("number"==typeof s.revalidate&&r&&s.revalidate<r.revalidate){if(0===s.revalidate){if(g)switch(g.type){case"prerender":case"prerender-client":case"prerender-runtime":return et(g.renderSignal,p.route,"fetch()")}es(p,g,`revalidate: 0 fetch ${n} ${p.route}`)}p.forceStatic&&0===s.revalidate||(r.revalidate=s.revalidate)}t&&delete i.next}if(!o||!$)return q(!1,c);{let e=o;p.pendingRevalidates??={};let t=p.pendingRevalidates[e];if(t){let e=await t;return new Response(e.body,{headers:e.headers,status:e.status,statusText:e.statusText})}let r=q(!0,c).then(eu);return(t=r.then(async e=>{let t=e[0];return{body:await t.arrayBuffer(),headers:t.headers,status:t.status,statusText:t.statusText}}).finally(()=>{var t;(null==(t=p.pendingRevalidates)?void 0:t[e])&&delete p.pendingRevalidates[e]})).catch(()=>{}),p.pendingRevalidates[e]=t,r.then(e=>e[1])}});if(y)try{return await b}finally{y&&y.endRead()}return b};return n.__nextPatched=!0,n.__nextGetStaticStore=()=>t,n._nextOriginalFetch=e,globalThis[ez]=!0,Object.defineProperty(n,"name",{value:"fetch",writable:!1}),n}(t,e)}function e1(e){var t;return(t=e.split("/").reduce((e,t,r,n)=>t?"("===t[0]&&t.endsWith(")")||"@"===t[0]||("page"===t||"route"===t)&&r===n.length-1?e:e+"/"+t:e,"")).startsWith("/")?t:"/"+t}e.s(["normalizeAppPath",()=>e1],5270),e.s(["NodeNextRequest",()=>e7,"NodeNextResponse",()=>te],90231);class e2{static get(e,t,r){let n=Reflect.get(e,t,r);return"function"==typeof n?n.bind(e):n}static set(e,t,r,n){return Reflect.set(e,t,r,n)}static has(e,t){return Reflect.has(e,t)}static deleteProperty(e,t){return Reflect.deleteProperty(e,t)}}class e6 extends Error{constructor(){super("Headers cannot be modified. Read more: https://nextjs.org/docs/app/api-reference/functions/headers")}static callable(){throw new e6}}class e3 extends Headers{constructor(e){super(),this.headers=new Proxy(e,{get(t,r,n){if("symbol"==typeof r)return e2.get(t,r,n);let i=r.toLowerCase(),s=Object.keys(e).find(e=>e.toLowerCase()===i);if(void 0!==s)return e2.get(t,s,n)},set(t,r,n,i){if("symbol"==typeof r)return e2.set(t,r,n,i);let s=r.toLowerCase(),o=Object.keys(e).find(e=>e.toLowerCase()===s);return e2.set(t,o??r,n,i)},has(t,r){if("symbol"==typeof r)return e2.has(t,r);let n=r.toLowerCase(),i=Object.keys(e).find(e=>e.toLowerCase()===n);return void 0!==i&&e2.has(t,i)},deleteProperty(t,r){if("symbol"==typeof r)return e2.deleteProperty(t,r);let n=r.toLowerCase(),i=Object.keys(e).find(e=>e.toLowerCase()===n);return void 0===i||e2.deleteProperty(t,i)}})}static seal(e){return new Proxy(e,{get(e,t,r){switch(t){case"append":case"delete":case"set":return e6.callable;default:return e2.get(e,t,r)}}})}merge(e){return Array.isArray(e)?e.join(", "):e}static from(e){return e instanceof Headers?e:new e3(e)}append(e,t){let r=this.headers[e];"string"==typeof r?this.headers[e]=[r,t]:Array.isArray(r)?r.push(t):this.headers[e]=t}delete(e){delete this.headers[e]}get(e){let t=this.headers[e];return void 0!==t?this.merge(t):null}has(e){return void 0!==this.headers[e]}set(e,t){this.headers[e]=t}forEach(e,t){for(let[r,n]of this.entries())e.call(t,n,r,this)}*entries(){for(let e of Object.keys(this.headers)){let t=e.toLowerCase(),r=this.get(t);yield[t,r]}}*keys(){for(let e of Object.keys(this.headers)){let t=e.toLowerCase();yield t}}*values(){for(let e of Object.keys(this.headers)){let t=this.get(e);yield t}}[Symbol.iterator](){return this.entries()}}Symbol("__next_preview_data");let e5=Symbol("__prerender_bypass");var e4=function(e){return e[e.SeeOther=303]="SeeOther",e[e.TemporaryRedirect=307]="TemporaryRedirect",e[e.PermanentRedirect=308]="PermanentRedirect",e}({});class e8{constructor(e,t,r){this.method=e,this.url=t,this.body=r}get cookies(){var t;return this._cookies?this._cookies:this._cookies=(t=this.headers,function(){let{cookie:r}=t;if(!r)return{};let{parse:n}=e.r(38343);return n(Array.isArray(r)?r.join("; "):r)})()}}class e9{constructor(e){this.destination=e}redirect(e,t){return this.setHeader("Location",e),this.statusCode=t,t===e4.PermanentRedirect&&this.setHeader("Refresh",`0;url=${e}`),this}}class e7 extends e8{static #e=ey;constructor(e){var t;super(e.method.toUpperCase(),e.url,e),this._req=e,this.headers=this._req.headers,this.fetchMetrics=null==(t=this._req)?void 0:t.fetchMetrics,this[ey]=this._req[ey]||{},this.streaming=!1}get originalRequest(){return this._req[ey]=this[ey],this._req.url=this.url,this._req.cookies=this.cookies,this._req}set originalRequest(e){this._req=e}stream(){if(this.streaming)throw Object.defineProperty(Error("Invariant: NodeNextRequest.stream() can only be called once"),"__NEXT_ERROR_CODE",{value:"E467",enumerable:!1,configurable:!0});return this.streaming=!0,new ReadableStream({start:e=>{this._req.on("data",t=>{e.enqueue(new Uint8Array(t))}),this._req.on("end",()=>{e.close()}),this._req.on("error",t=>{e.error(t)})}})}}class te extends e9{get originalResponse(){return e5 in this&&(this._res[e5]=this[e5]),this._res}constructor(e){super(e),this._res=e,this.textBody=void 0}get sent(){return this._res.finished||this._res.headersSent}get statusCode(){return this._res.statusCode}set statusCode(e){this._res.statusCode=e}get statusMessage(){return this._res.statusMessage}set statusMessage(e){this._res.statusMessage=e}setHeader(e,t){return this._res.setHeader(e,t),this}removeHeader(e){return this._res.removeHeader(e),this}getHeaderValues(e){let t=this._res.getHeader(e);if(void 0!==t)return(Array.isArray(t)?t:[t]).map(e=>e.toString())}hasHeader(e){return this._res.hasHeader(e)}getHeader(e){let t=this.getHeaderValues(e);return Array.isArray(t)?t.join(","):void 0}getHeaders(){return this._res.getHeaders()}appendHeader(e,t){let r=this.getHeaderValues(e)??[];return r.includes(t)||this._res.setHeader(e,[...r,t]),this}body(e){return this.textBody=e,this}send(){this._res.end(this.textBody)}onClose(e){this.originalResponse.on("close",e)}}function tt(e){return e.isOnDemandRevalidate?"on-demand":e.isRevalidate?"stale":void 0}async function tr(e,t,r,n){{var i;t.statusCode=r.status,t.statusMessage=r.statusText;let s=["set-cookie","www-authenticate","proxy-authenticate","vary"];null==(i=r.headers)||i.forEach((e,r)=>{if("x-middleware-set-cookie"!==r.toLowerCase())if("set-cookie"===r.toLowerCase())for(let n of e_(e))t.appendHeader(r,n);else{let n=void 0!==t.getHeader(r);(s.includes(r.toLowerCase())||!n)&&t.appendHeader(r,e)}});let{originalResponse:o}=t;r.body&&"HEAD"!==e.method?await eY(r.body,o,n):o.end()}}function tn({revalidate:e,expire:t}){let r="number"==typeof e&&void 0!==t&&e<t?`, stale-while-revalidate=${t-e}`:"";return 0===e?"private, no-cache, no-store, max-age=0, must-revalidate":"number"==typeof e?`s-maxage=${e}${r}`:`s-maxage=${W}${r}`}e.s(["getRevalidateReason",()=>tt],89822),e.s(["sendResponse",()=>tr],9124),e.s(["getCacheControlHeader",()=>tn],40568),e.s(["prisma",()=>iT],24493);var ti,ts,to,ta,tu=e.i(29173),tc=Object.create,tl=Object.defineProperty,th=Object.getOwnPropertyDescriptor,tf=Object.getOwnPropertyNames,td=Object.getPrototypeOf,tp=Object.prototype.hasOwnProperty,tg=(e,t)=>tl(e,"name",{value:t,configurable:!0}),tm=(e,t)=>()=>(e&&(t=e(e=0)),t),ty=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),tb=(e,t)=>{for(var r in t)tl(e,r,{get:t[r],enumerable:!0})},tv=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of tf(t))tp.call(e,i)||i===r||tl(e,i,{get:()=>t[i],enumerable:!(n=th(t,i))||n.enumerable});return e},t_=(e,t,r)=>(r=null!=e?tc(td(e)):{},tv(!t&&e&&e.__esModule?r:tl(r,"default",{value:e,enumerable:!0}),e)),tw=e=>tv(tl({},"__esModule",{value:!0}),e),tE=(e,t,r)=>((e,t,r)=>t in e?tl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),tS=ty(e=>{tA(),e.byteLength=u,e.toByteArray=l,e.fromByteArray=d;var t,r,n=[],i=[],s="u">typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(t=0,r=o.length;t<r;++t)n[t]=o[t],i[o.charCodeAt(t)]=t;function a(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function u(e){var t=a(e),r=t[0],n=t[1];return(r+n)*3/4-n}function c(e,t,r){return(t+r)*3/4-r}function l(e){var t,r,n=a(e),o=n[0],u=n[1],l=new s(c(e,o,u)),h=0,f=u>0?o-4:o;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)],l[h++]=t>>16&255,l[h++]=t>>8&255,l[h++]=255&t;return 2===u&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,l[h++]=255&t),1===u&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,l[h++]=t>>8&255,l[h++]=255&t),l}function h(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function f(e,t,r){for(var n=[],i=t;i<r;i+=3)n.push(h((e[i]<<16&0xff0000)+(e[i+1]<<8&65280)+(255&e[i+2])));return n.join("")}function d(e){for(var t,r=e.length,i=r%3,s=[],o=0,a=r-i;o<a;o+=16383)s.push(f(e,o,o+16383>a?a:o+16383));return 1===i?s.push(n[(t=e[r-1])>>2]+n[t<<4&63]+"=="):2===i&&s.push(n[(t=(e[r-2]<<8)+e[r-1])>>10]+n[t>>4&63]+n[t<<2&63]+"="),s.join("")}i[45]=62,i[95]=63,tg(a,"getLens"),tg(u,"byteLength"),tg(c,"_byteLength"),tg(l,"toByteArray"),tg(h,"tripletToBase64"),tg(f,"encodeChunk"),tg(d,"fromByteArray")}),tR=ty(e=>{tA(),e.read=function(e,t,r,n,i){var s,o,a=8*i-n-1,u=(1<<a)-1,c=u>>1,l=-7,h=r?i-1:0,f=r?-1:1,d=e[t+h];for(h+=f,s=d&(1<<-l)-1,d>>=-l,l+=a;l>0;s=256*s+e[t+h],h+=f,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=n;l>0;o=256*o+e[t+h],h+=f,l-=8);if(0===s)s=1-c;else{if(s===u)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),s-=c}return(d?-1:1)*o*Math.pow(2,s-n)},e.write=function(e,t,r,n,i,s){var o,a,u,c=8*s-i-1,l=(1<<c)-1,h=l>>1,f=5960464477539062e-23*(23===i),d=n?0:s-1,p=n?1:-1,g=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(a=+!!isNaN(t),o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),o+h>=1?t+=f/u:t+=f*Math.pow(2,1-h),t*u>=2&&(o++,u/=2),o+h>=l?(a=0,o=l):o+h>=1?(a=(t*u-1)*Math.pow(2,i),o+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;e[r+d]=255&a,d+=p,a/=256,i-=8);for(o=o<<i|a,c+=i;c>0;e[r+d]=255&o,d+=p,o/=256,c-=8);e[r+d-p]|=128*g}}),tx=ty(e=>{tA();var t=tS(),r=tR(),n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function i(){try{let e=new Uint8Array(1),t={foo:tg(function(){return 42},"foo")};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch{return!1}}function s(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,o.prototype),t}function o(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return l(e)}return a(e,t,r)}function a(e,t,r){if("string"==typeof e)return h(e,t);if(ArrayBuffer.isView(e))return d(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(er(e,ArrayBuffer)||e&&er(e.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(er(e,SharedArrayBuffer)||e&&er(e.buffer,SharedArrayBuffer)))return p(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return o.from(n,t,r);let i=g(e);if(i)return i;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,r);throw 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 TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function c(e,t,r){return u(e),e<=0?s(e):void 0!==t?"string"==typeof r?s(e).fill(t,r):s(e).fill(t):s(e)}function l(e){return u(e),s(e<0?0:0|m(e))}function h(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!o.isEncoding(t))throw TypeError("Unknown encoding: "+t);let r=0|b(e,t),n=s(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function f(e){let t=e.length<0?0:0|m(e.length),r=s(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e){if(er(e,Uint8Array)){let t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return f(e)}function p(e,t,r){let n;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),o.prototype),n}function g(e){if(o.isBuffer(e)){let t=0|m(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||en(e.length)?s(0):f(e):"Buffer"===e.type&&Array.isArray(e.data)?f(e.data):void 0}function m(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function y(e){return+e!=e&&(e=0),o.alloc(+e)}function b(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||er(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return K(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return ee(e).length;default:if(i)return n?-1:K(e).length;t=(""+t).toLowerCase(),i=!0}}function v(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0)||(r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return L(this,t,r);case"utf8":case"utf-8":return O(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return N(this,t,r);case"base64":return P(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,r);default:if(n)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function _(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}function w(e,t,r,n,i){if(0===e.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),en(r*=1)&&(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;else r=0;if("string"==typeof t&&(t=o.from(t,n)),o.isBuffer(t))return 0===t.length?-1:E(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):E(e,[t],r,n,i);throw TypeError("val must be string, number or Buffer")}function E(e,t,r,n,i){let s,o=1,a=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;o=2,a/=2,u/=2,r/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(tg(c,"read"),i){let n=-1;for(s=r;s<a;s++)if(c(e,s)===c(t,-1===n?0:s-n)){if(-1===n&&(n=s),s-n+1===u)return n*o}else -1!==n&&(s-=s-n),n=-1}else for(r+u>a&&(r=a-u),s=r;s>=0;s--){let r=!0;for(let n=0;n<u;n++)if(c(e,s+n)!==c(t,n)){r=!1;break}if(r)return s}return -1}function S(e,t,r,n){let i;r=Number(r)||0;let s=e.length-r;n?(n=Number(n))>s&&(n=s):n=s;let o=t.length;for(n>o/2&&(n=o/2),i=0;i<n;++i){let n=parseInt(t.substr(2*i,2),16);if(en(n))break;e[r+i]=n}return i}function R(e,t,r,n){return et(K(t,e.length-r),e,r,n)}function x(e,t,r,n){return et(J(t),e,r,n)}function A(e,t,r,n){return et(ee(t),e,r,n)}function T(e,t,r,n){return et(Z(t,e.length-r),e,r,n)}function P(e,r,n){return 0===r&&n===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(r,n))}function O(e,t,r){r=Math.min(e.length,r);let n=[],i=t;for(;i<r;){let t=e[i],s=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o<=r){let r,n,a,u;switch(o){case 1:t<128&&(s=t);break;case 2:(192&(r=e[i+1]))==128&&(u=(31&t)<<6|63&r)>127&&(s=u);break;case 3:r=e[i+1],n=e[i+2],(192&r)==128&&(192&n)==128&&(u=(15&t)<<12|(63&r)<<6|63&n)>2047&&(u<55296||u>57343)&&(s=u);break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],(192&r)==128&&(192&n)==128&&(192&a)==128&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a)>65535&&u<1114112&&(s=u)}}null===s?(s=65533,o=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),i+=o}return C(n)}function C(e){let t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return r}function I(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function N(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function L(e,t,r){let n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=ei[e[n]];return i}function M(e,t,r){let n=e.slice(t,r),i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function D(e,t,r){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function k(e,t,r,n,i,s){if(!o.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw RangeError('"value" argument is out of bounds');if(r+n>e.length)throw RangeError("Index out of range")}function B(e,t,r,n,i){W(t,n,i,e,r,7);let s=Number(t&BigInt(0xffffffff));e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s;let o=Number(t>>BigInt(32)&BigInt(0xffffffff));return e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,r}function j(e,t,r,n,i){W(t,n,i,e,r,7);let s=Number(t&BigInt(0xffffffff));e[r+7]=s,s>>=8,e[r+6]=s,s>>=8,e[r+5]=s,s>>=8,e[r+4]=s;let o=Number(t>>BigInt(32)&BigInt(0xffffffff));return e[r+3]=o,o>>=8,e[r+2]=o,o>>=8,e[r+1]=o,o>>=8,e[r]=o,r+8}function U(e,t,r,n,i,s){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function F(e,t,n,i,s){return t*=1,n>>>=0,s||U(e,t,n,4,34028234663852886e22,-34028234663852886e22),r.write(e,t,n,i,23,4),n+4}function q(e,t,n,i,s){return t*=1,n>>>=0,s||U(e,t,n,8,17976931348623157e292,-17976931348623157e292),r.write(e,t,n,i,52,8),n+8}e.Buffer=o,e.SlowBuffer=y,e.INSPECT_MAX_BYTES=50,e.kMaxLength=0x7fffffff,o.TYPED_ARRAY_SUPPORT=i(),!o.TYPED_ARRAY_SUPPORT&&"u">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."),tg(i,"typedArraySupport"),Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:tg(function(){if(o.isBuffer(this))return this.buffer},"get")}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:tg(function(){if(o.isBuffer(this))return this.byteOffset},"get")}),tg(s,"createBuffer"),tg(o,"Buffer"),o.poolSize=8192,tg(a,"from"),o.from=function(e,t,r){return a(e,t,r)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),tg(u,"assertSize"),tg(c,"alloc"),o.alloc=function(e,t,r){return c(e,t,r)},tg(l,"allocUnsafe"),o.allocUnsafe=function(e){return l(e)},o.allocUnsafeSlow=function(e){return l(e)},tg(h,"fromString"),tg(f,"fromArrayLike"),tg(d,"fromArrayView"),tg(p,"fromArrayBuffer"),tg(g,"fromObject"),tg(m,"checked"),tg(y,"SlowBuffer"),o.isBuffer=tg(function(e){return null!=e&&!0===e._isBuffer&&e!==o.prototype},"isBuffer"),o.compare=tg(function(e,t){if(er(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),er(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(e)||!o.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,s=Math.min(r,n);i<s;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:+(n<r)},"compare"),o.isEncoding=tg(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}},"isEncoding"),o.concat=tg(function(e,t){let r;if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;let n=o.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){let t=e[r];if(er(t,Uint8Array))i+t.length>n.length?(o.isBuffer(t)||(t=o.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else if(o.isBuffer(t))t.copy(n,i);else throw TypeError('"list" argument must be an Array of Buffers');i+=t.length}return n},"concat"),tg(b,"byteLength"),o.byteLength=b,tg(v,"slowToString"),o.prototype._isBuffer=!0,tg(_,"swap"),o.prototype.swap16=tg(function(){let e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)_(this,t,t+1);return this},"swap16"),o.prototype.swap32=tg(function(){let e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)_(this,t,t+3),_(this,t+1,t+2);return this},"swap32"),o.prototype.swap64=tg(function(){let e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)_(this,t,t+7),_(this,t+1,t+6),_(this,t+2,t+5),_(this,t+3,t+4);return this},"swap64"),o.prototype.toString=tg(function(){let e=this.length;return 0===e?"":0==arguments.length?O(this,0,e):v.apply(this,arguments)},"toString"),o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=tg(function(e){if(!o.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},"equals"),o.prototype.inspect=tg(function(){let t="",r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},"inspect"),n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=tg(function(e,t,r,n,i){if(er(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw 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 RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;let s=i-n,a=r-t,u=Math.min(s,a),c=this.slice(n,i),l=e.slice(t,r);for(let e=0;e<u;++e)if(c[e]!==l[e]){s=c[e],a=l[e];break}return s<a?-1:+(a<s)},"compare"),tg(w,"bidirectionalIndexOf"),tg(E,"arrayIndexOf"),o.prototype.includes=tg(function(e,t,r){return -1!==this.indexOf(e,t,r)},"includes"),o.prototype.indexOf=tg(function(e,t,r){return w(this,e,t,r,!0)},"indexOf"),o.prototype.lastIndexOf=tg(function(e,t,r){return w(this,e,t,r,!1)},"lastIndexOf"),tg(S,"hexWrite"),tg(R,"utf8Write"),tg(x,"asciiWrite"),tg(A,"base64Write"),tg(T,"ucs2Write"),o.prototype.write=tg(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))t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let s=!1;for(;;)switch(n){case"hex":return S(this,e,t,r);case"utf8":case"utf-8":return R(this,e,t,r);case"ascii":case"latin1":case"binary":return x(this,e,t,r);case"base64":return A(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,r);default:if(s)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},"write"),o.prototype.toJSON=tg(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON"),tg(P,"base64Slice"),tg(O,"utf8Slice"),tg(C,"decodeCodePointsArray"),tg(I,"asciiSlice"),tg(N,"latin1Slice"),tg(L,"hexSlice"),tg(M,"utf16leSlice"),o.prototype.slice=tg(function(e,t){let r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);let n=this.subarray(e,t);return Object.setPrototypeOf(n,o.prototype),n},"slice"),tg(D,"checkOffset"),o.prototype.readUintLE=o.prototype.readUIntLE=tg(function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);let n=this[e],i=1,s=0;for(;++s<t&&(i*=256);)n+=this[e+s]*i;return n},"readUIntLE"),o.prototype.readUintBE=o.prototype.readUIntBE=tg(function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},"readUIntBE"),o.prototype.readUint8=o.prototype.readUInt8=tg(function(e,t){return e>>>=0,t||D(e,1,this.length),this[e]},"readUInt8"),o.prototype.readUint16LE=o.prototype.readUInt16LE=tg(function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]|this[e+1]<<8},"readUInt16LE"),o.prototype.readUint16BE=o.prototype.readUInt16BE=tg(function(e,t){return e>>>=0,t||D(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE"),o.prototype.readUint32LE=o.prototype.readUInt32LE=tg(function(e,t){return e>>>=0,t||D(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},"readUInt32LE"),o.prototype.readUint32BE=o.prototype.readUInt32BE=tg(function(e,t){return e>>>=0,t||D(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"readUInt32BE"),o.prototype.readBigUInt64LE=es(tg(function(e){Q(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&Y(e,this.length-8);let n=t+256*this[++e]+65536*this[++e]+0x1000000*this[++e],i=this[++e]+256*this[++e]+65536*this[++e]+0x1000000*r;return BigInt(n)+(BigInt(i)<<BigInt(32))},"readBigUInt64LE")),o.prototype.readBigUInt64BE=es(tg(function(e){Q(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&Y(e,this.length-8);let n=0x1000000*t+65536*this[++e]+256*this[++e]+this[++e],i=0x1000000*this[++e]+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)},"readBigUInt64BE")),o.prototype.readIntLE=tg(function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);let n=this[e],i=1,s=0;for(;++s<t&&(i*=256);)n+=this[e+s]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},"readIntLE"),o.prototype.readIntBE=tg(function(e,t,r){e>>>=0,t>>>=0,r||D(e,t,this.length);let n=t,i=1,s=this[e+--n];for(;n>0&&(i*=256);)s+=this[e+--n]*i;return s>=(i*=128)&&(s-=Math.pow(2,8*t)),s},"readIntBE"),o.prototype.readInt8=tg(function(e,t){return e>>>=0,t||D(e,1,this.length),128&this[e]?-((255-this[e]+1)*1):this[e]},"readInt8"),o.prototype.readInt16LE=tg(function(e,t){e>>>=0,t||D(e,2,this.length);let r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},"readInt16LE"),o.prototype.readInt16BE=tg(function(e,t){e>>>=0,t||D(e,2,this.length);let r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},"readInt16BE"),o.prototype.readInt32LE=tg(function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE"),o.prototype.readInt32BE=tg(function(e,t){return e>>>=0,t||D(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE"),o.prototype.readBigInt64LE=es(tg(function(e){Q(e>>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&Y(e,this.length-8),(BigInt(this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24))<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+0x1000000*this[++e])},"readBigInt64LE")),o.prototype.readBigInt64BE=es(tg(function(e){Q(e>>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&Y(e,this.length-8),(BigInt((t<<24)+65536*this[++e]+256*this[++e]+this[++e])<<BigInt(32))+BigInt(0x1000000*this[++e]+65536*this[++e]+256*this[++e]+r)},"readBigInt64BE")),o.prototype.readFloatLE=tg(function(e,t){return e>>>=0,t||D(e,4,this.length),r.read(this,e,!0,23,4)},"readFloatLE"),o.prototype.readFloatBE=tg(function(e,t){return e>>>=0,t||D(e,4,this.length),r.read(this,e,!1,23,4)},"readFloatBE"),o.prototype.readDoubleLE=tg(function(e,t){return e>>>=0,t||D(e,8,this.length),r.read(this,e,!0,52,8)},"readDoubleLE"),o.prototype.readDoubleBE=tg(function(e,t){return e>>>=0,t||D(e,8,this.length),r.read(this,e,!1,52,8)},"readDoubleBE"),tg(k,"checkInt"),o.prototype.writeUintLE=o.prototype.writeUIntLE=tg(function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;k(this,e,t,r,n,0)}let i=1,s=0;for(this[t]=255&e;++s<r&&(i*=256);)this[t+s]=e/i&255;return t+r},"writeUIntLE"),o.prototype.writeUintBE=o.prototype.writeUIntBE=tg(function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;k(this,e,t,r,n,0)}let i=r-1,s=1;for(this[t+i]=255&e;--i>=0&&(s*=256);)this[t+i]=e/s&255;return t+r},"writeUIntBE"),o.prototype.writeUint8=o.prototype.writeUInt8=tg(function(e,t,r){return e*=1,t>>>=0,r||k(this,e,t,1,255,0),this[t]=255&e,t+1},"writeUInt8"),o.prototype.writeUint16LE=o.prototype.writeUInt16LE=tg(function(e,t,r){return e*=1,t>>>=0,r||k(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},"writeUInt16LE"),o.prototype.writeUint16BE=o.prototype.writeUInt16BE=tg(function(e,t,r){return e*=1,t>>>=0,r||k(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},"writeUInt16BE"),o.prototype.writeUint32LE=o.prototype.writeUInt32LE=tg(function(e,t,r){return e*=1,t>>>=0,r||k(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},"writeUInt32LE"),o.prototype.writeUint32BE=o.prototype.writeUInt32BE=tg(function(e,t,r){return e*=1,t>>>=0,r||k(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},"writeUInt32BE"),tg(B,"wrtBigUInt64LE"),tg(j,"wrtBigUInt64BE"),o.prototype.writeBigUInt64LE=es(tg(function(e,t=0){return B(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE")),o.prototype.writeBigUInt64BE=es(tg(function(e,t=0){return j(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE")),o.prototype.writeIntLE=tg(function(e,t,r,n){if(e*=1,t>>>=0,!n){let n=Math.pow(2,8*r-1);k(this,e,t,r,n-1,-n)}let i=0,s=1,o=0;for(this[t]=255&e;++i<r&&(s*=256);)e<0&&0===o&&0!==this[t+i-1]&&(o=1),this[t+i]=(e/s|0)-o&255;return t+r},"writeIntLE"),o.prototype.writeIntBE=tg(function(e,t,r,n){if(e*=1,t>>>=0,!n){let n=Math.pow(2,8*r-1);k(this,e,t,r,n-1,-n)}let i=r-1,s=1,o=0;for(this[t+i]=255&e;--i>=0&&(s*=256);)e<0&&0===o&&0!==this[t+i+1]&&(o=1),this[t+i]=(e/s|0)-o&255;return t+r},"writeIntBE"),o.prototype.writeInt8=tg(function(e,t,r){return e*=1,t>>>=0,r||k(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},"writeInt8"),o.prototype.writeInt16LE=tg(function(e,t,r){return e*=1,t>>>=0,r||k(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},"writeInt16LE"),o.prototype.writeInt16BE=tg(function(e,t,r){return e*=1,t>>>=0,r||k(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},"writeInt16BE"),o.prototype.writeInt32LE=tg(function(e,t,r){return e*=1,t>>>=0,r||k(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},"writeInt32LE"),o.prototype.writeInt32BE=tg(function(e,t,r){return e*=1,t>>>=0,r||k(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},"writeInt32BE"),o.prototype.writeBigInt64LE=es(tg(function(e,t=0){return B(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE")),o.prototype.writeBigInt64BE=es(tg(function(e,t=0){return j(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE")),tg(U,"checkIEEE754"),tg(F,"writeFloat"),o.prototype.writeFloatLE=tg(function(e,t,r){return F(this,e,t,!0,r)},"writeFloatLE"),o.prototype.writeFloatBE=tg(function(e,t,r){return F(this,e,t,!1,r)},"writeFloatBE"),tg(q,"writeDouble"),o.prototype.writeDoubleLE=tg(function(e,t,r){return q(this,e,t,!0,r)},"writeDoubleLE"),o.prototype.writeDoubleBE=tg(function(e,t,r){return q(this,e,t,!1,r)},"writeDoubleBE"),o.prototype.copy=tg(function(e,t,r,n){if(!o.isBuffer(e))throw 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||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);let i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},"copy"),o.prototype.fill=tg(function(e,t,r,n){let i;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 TypeError("encoding must be a string");if("string"==typeof n&&!o.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){let t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{let s=o.isBuffer(e)?e:o.from(e,n),a=s.length;if(0===a)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=s[i%a]}return this},"fill");var $={};function G(e,t,r){var n;$[e]=(tg(n=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}\
20
20
  ]: ${this.message}`}},"NodeError"),n)}function H(e){let t="",r=e.length,n=+("-"===e[0]);for(;r>=n+4;r-=3)t=`\
21
21
  _${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function V(e,t,r){Q(t,"offset"),(void 0===e[t]||void 0===e[t+r])&&Y(t,e.length-(r+1))}function W(e,t,r,n,i,s){if(e>r||e<t){let n="bigint"==typeof t?"n":"",i;throw i=s>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n}\
22
22
  ** ${(s+1)*8}${n}`:`>= -(2${n} ** ${(s+1)*8-1}${n}) and < 2 ** ${(s+1)*8-1}${n}`:`>= ${t}${n} a\
23
- nd <= ${r}${n}`,new $.ERR_OUT_OF_RANGE("value",i,e)}V(n,i,s)}function Q(e,t){if("number"!=typeof e)throw new $.ERR_INVALID_ARG_TYPE(t,"number",e)}function Y(e,t,r){throw Math.floor(e)!==e?(Q(e,r),new $.ERR_OUT_OF_RANGE(r||"offset","an integer",e)):t<0?new $.ERR_BUFFER_OUT_OF_BOUNDS:new $.ERR_OUT_OF_RANGE(r||"offset",`>= ${+!!r} and <= ${t}`,e)}tp(G,"E"),G("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),G("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received typ\
23
+ nd <= ${r}${n}`,new $.ERR_OUT_OF_RANGE("value",i,e)}V(n,i,s)}function Q(e,t){if("number"!=typeof e)throw new $.ERR_INVALID_ARG_TYPE(t,"number",e)}function Y(e,t,r){throw Math.floor(e)!==e?(Q(e,r),new $.ERR_OUT_OF_RANGE(r||"offset","an integer",e)):t<0?new $.ERR_BUFFER_OUT_OF_BOUNDS:new $.ERR_OUT_OF_RANGE(r||"offset",`>= ${+!!r} and <= ${t}`,e)}tg(G,"E"),G("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),G("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received typ\
24
24
  e ${typeof t}`},TypeError),G("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out o\
25
25
  f range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>0x100000000?i=H(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=H(i)),i+="n"),n+=` It must be ${t}. Re\
26
- ceived ${i}`},RangeError),tp(H,"addNumericalSeparator"),tp(V,"checkBounds"),tp(W,"checkIntBI"),tp(Q,"validateNumber"),tp(Y,"boundsError");var X=/[^+/0-9A-Za-z-_]/g;function z(e){if((e=(e=e.split("=")[0]).trim().replace(X,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}function K(e,t){t=t||1/0;let r,n=e.length,i=null,s=[];for(let o=0;o<n;++o){if((r=e.charCodeAt(o))>55295&&r<57344){if(!i){if(r>56319||o+1===n){(t-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return s}function J(e){let t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function Z(e,t){let r,n,i=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)n=(r=e.charCodeAt(s))>>8,i.push(r%256),i.push(n);return i}function ee(e){return t.toByteArray(z(e))}function et(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function er(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function en(e){return e!=e}tp(z,"base64clean"),tp(K,"utf8ToBytes"),tp(J,"asciiToBytes"),tp(Z,"utf16leToBytes"),tp(ee,"base64ToBytes"),tp(et,"blitBuffer"),tp(er,"isInstance"),tp(en,"numberIsNaN");var ei=function(){let e="0123456789abcdef",t=Array(256);for(let r=0;r<16;++r){let n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function es(e){return typeof BigInt>"u"?eo:e}function eo(){throw Error("BigInt not supported")}tp(es,"defineBigIntMethod"),tp(eo,"BufferBigIntNotDefined")}),tx=tg(()=>{ti=globalThis,ts=globalThis.setImmediate??(e=>setTimeout(e,0)),globalThis.clearImmediate??(e=>clearTimeout(e)),to="function"==typeof globalThis.Buffer&&"function"==typeof globalThis.Buffer.allocUnsafe?globalThis.Buffer:tR().Buffer,(ta=globalThis.process??{}).env??(ta.env={});try{ta.nextTick(()=>{})}catch{let e=Promise.resolve();ta.nextTick=e.then.bind(e)}}),tA=tm((e,t)=>{tx();var r,n="object"==typeof Reflect?Reflect:null,i=n&&"function"==typeof n.apply?n.apply:tp(function(e,t,r){return Function.prototype.apply.call(e,t,r)},"ReflectApply");function s(e){console&&console.warn&&console.warn(e)}r=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?tp(function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):tp(function(e){return Object.getOwnPropertyNames(e)},"ReflectOwnKeys"),tp(s,"ProcessEmitWarning");var o=Number.isNaN||tp(function(e){return e!=e},"NumberIsNaN");function a(){a.init.call(this)}tp(a,"EventEmitter"),t.exports=a,t.exports.once=v,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var u=10;function c(e){if("function"!=typeof e)throw TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function h(e,t,r,n){var i,o,a;if(c(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=l(e))>0&&a.length>i&&!a.warned){a.warned=!0;var u=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)}return e}function f(){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 d(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=f.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?b(i):m(i,i.length)}function g(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 m(e,t){for(var r=Array(t),n=0;n<t;++n)r[n]=e[n];return r}function y(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function b(e){for(var t=Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}function v(e,t){return new Promise(function(r,n){function i(r){e.removeListener(t,s),n(r)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}tp(i,"errorListener"),tp(s,"resolver"),w(e,t,s,{once:!0}),"error"!==t&&_(e,i,{once:!0})})}function _(e,t,r){"function"==typeof e.on&&w(e,"error",t,r)}function w(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)e.addEventListener(t,tp(function i(s){n.once&&e.removeEventListener(t,i),r(s)},"wrapListener"));else throw TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}tp(c,"checkListener"),Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:tp(function(){return u},"get"),set:tp(function(e){if("number"!=typeof e||e<0||o(e))throw RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");u=e},"set")}),a.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},a.prototype.setMaxListeners=tp(function(e){if("number"!=typeof e||e<0||o(e))throw RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},"setMaxListeners"),tp(l,"_getMaxListeners"),a.prototype.getMaxListeners=tp(function(){return l(this)},"getMaxListeners"),a.prototype.emit=tp(function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,s=this._events;if(void 0!==s)n=n&&void 0===s.error;else if(!n)return!1;if(n){if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var o,a=Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var u=s[e];if(void 0===u)return!1;if("function"==typeof u)i(u,this,t);else for(var c=u.length,l=m(u,c),r=0;r<c;++r)i(l[r],this,t);return!0},"emit"),tp(h,"_addListener"),a.prototype.addListener=tp(function(e,t){return h(this,e,t,!1)},"addListener"),a.prototype.on=a.prototype.addListener,a.prototype.prependListener=tp(function(e,t){return h(this,e,t,!0)},"prependListener"),tp(f,"onceWrapper"),tp(d,"_onceWrap"),a.prototype.once=tp(function(e,t){return c(t),this.on(e,d(this,e,t)),this},"once"),a.prototype.prependOnceListener=tp(function(e,t){return c(t),this.prependListener(e,d(this,e,t)),this},"prependOnceListener"),a.prototype.removeListener=tp(function(e,t){var r,n,i,s,o;if(c(t),void 0===(n=this._events)||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,s=r.length-1;s>=0;s--)if(r[s]===t||r[s].listener===t){o=r[s].listener,i=s;break}if(i<0)return this;0===i?r.shift():y(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,o||t)}return this},"removeListener"),a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=tp(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,s=Object.keys(r);for(n=0;n<s.length;++n)"removeListener"!==(i=s[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},"removeAllListeners"),tp(p,"_listeners"),a.prototype.listeners=tp(function(e){return p(this,e,!0)},"listeners"),a.prototype.rawListeners=tp(function(e){return p(this,e,!1)},"rawListeners"),a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},a.prototype.listenerCount=g,tp(g,"listenerCount"),a.prototype.eventNames=tp(function(){return this._eventsCount>0?r(this._events):[]},"eventNames"),tp(m,"arrayClone"),tp(y,"spliceOne"),tp(b,"unwrapListeners"),tp(v,"once"),tp(_,"addErrorHandlerIfEventEmitter"),tp(w,"eventTargetAgnosticAddListener")}),tT={};function tP(e){return 0}ty(tT,{Socket:()=>tN,isIP:()=>tP});var tO,tC,tI,tN,tL=tg(()=>{tx(),tO=tv(tA(),1),tp(tP,"isIP"),tC=/^[^.]+\./,tI=class e extends tO.EventEmitter{constructor(){super(...arguments),tw(this,"opts",{}),tw(this,"connecting",!1),tw(this,"pending",!0),tw(this,"writable",!0),tw(this,"encrypted",!1),tw(this,"authorized",!1),tw(this,"destroyed",!1),tw(this,"ws",null),tw(this,"writeBuffer"),tw(this,"tlsState",0),tw(this,"tlsRead"),tw(this,"tlsWrite")}static get poolQueryViaFetch(){return e.opts.poolQueryViaFetch??e.defaults.poolQueryViaFetch}static set poolQueryViaFetch(t){e.opts.poolQueryViaFetch=t}static get fetchEndpoint(){return e.opts.fetchEndpoint??e.defaults.fetchEndpoint}static set fetchEndpoint(t){e.opts.fetchEndpoint=t}static get fetchConnectionCache(){return!0}static set fetchConnectionCache(e){console.warn("The `fetchConnectionCache` option is deprecated (now always `true`)")}static get fetchFunction(){return e.opts.fetchFunction??e.defaults.fetchFunction}static set fetchFunction(t){e.opts.fetchFunction=t}static get webSocketConstructor(){return e.opts.webSocketConstructor??e.defaults.webSocketConstructor}static set webSocketConstructor(t){e.opts.webSocketConstructor=t}get webSocketConstructor(){return this.opts.webSocketConstructor??e.webSocketConstructor}set webSocketConstructor(e){this.opts.webSocketConstructor=e}static get wsProxy(){return e.opts.wsProxy??e.defaults.wsProxy}static set wsProxy(t){e.opts.wsProxy=t}get wsProxy(){return this.opts.wsProxy??e.wsProxy}set wsProxy(e){this.opts.wsProxy=e}static get coalesceWrites(){return e.opts.coalesceWrites??e.defaults.coalesceWrites}static set coalesceWrites(t){e.opts.coalesceWrites=t}get coalesceWrites(){return this.opts.coalesceWrites??e.coalesceWrites}set coalesceWrites(e){this.opts.coalesceWrites=e}static get useSecureWebSocket(){return e.opts.useSecureWebSocket??e.defaults.useSecureWebSocket}static set useSecureWebSocket(t){e.opts.useSecureWebSocket=t}get useSecureWebSocket(){return this.opts.useSecureWebSocket??e.useSecureWebSocket}set useSecureWebSocket(e){this.opts.useSecureWebSocket=e}static get forceDisablePgSSL(){return e.opts.forceDisablePgSSL??e.defaults.forceDisablePgSSL}static set forceDisablePgSSL(t){e.opts.forceDisablePgSSL=t}get forceDisablePgSSL(){return this.opts.forceDisablePgSSL??e.forceDisablePgSSL}set forceDisablePgSSL(e){this.opts.forceDisablePgSSL=e}static get disableSNI(){return e.opts.disableSNI??e.defaults.disableSNI}static set disableSNI(t){e.opts.disableSNI=t}get disableSNI(){return this.opts.disableSNI??e.disableSNI}set disableSNI(e){this.opts.disableSNI=e}static get disableWarningInBrowsers(){return e.opts.disableWarningInBrowsers??e.defaults.disableWarningInBrowsers}static set disableWarningInBrowsers(t){e.opts.disableWarningInBrowsers=t}get disableWarningInBrowsers(){return this.opts.disableWarningInBrowsers??e.disableWarningInBrowsers}set disableWarningInBrowsers(e){this.opts.disableWarningInBrowsers=e}static get pipelineConnect(){return e.opts.pipelineConnect??e.defaults.pipelineConnect}static set pipelineConnect(t){e.opts.pipelineConnect=t}get pipelineConnect(){return this.opts.pipelineConnect??e.pipelineConnect}set pipelineConnect(e){this.opts.pipelineConnect=e}static get subtls(){return e.opts.subtls??e.defaults.subtls}static set subtls(t){e.opts.subtls=t}get subtls(){return this.opts.subtls??e.subtls}set subtls(e){this.opts.subtls=e}static get pipelineTLS(){return e.opts.pipelineTLS??e.defaults.pipelineTLS}static set pipelineTLS(t){e.opts.pipelineTLS=t}get pipelineTLS(){return this.opts.pipelineTLS??e.pipelineTLS}set pipelineTLS(e){this.opts.pipelineTLS=e}static get rootCerts(){return e.opts.rootCerts??e.defaults.rootCerts}static set rootCerts(t){e.opts.rootCerts=t}get rootCerts(){return this.opts.rootCerts??e.rootCerts}set rootCerts(e){this.opts.rootCerts=e}wsProxyAddrForHost(e,t){let r=this.wsProxy;if(void 0===r)throw Error("No WebSocket proxy is configured. Please see https://github.com/neondatabase/serverless/blob/main/CONFIG.md#wsproxy-string--host-string-port-number--string--string");return"function"==typeof r?r(e,t):`${r}?address=${e}:${t}`}setNoDelay(){return this}setKeepAlive(){return this}ref(){return this}unref(){return this}connect(e,t,r){this.connecting=!0,r&&this.once("connect",r);let n=tp(()=>{this.connecting=!1,this.pending=!1,this.emit("connect"),this.emit("ready")},"handleWebSocketOpen"),i=tp((e,t=!1)=>{e.binaryType="arraybuffer",e.addEventListener("error",e=>{this.emit("error",e),this.emit("close")}),e.addEventListener("message",e=>{if(0===this.tlsState){let t=to.from(e.data);this.emit("data",t)}}),e.addEventListener("close",()=>{this.emit("close")}),t?n():e.addEventListener("open",n)},"configureWebSocket"),s;try{s=this.wsProxyAddrForHost(t,"string"==typeof e?parseInt(e,10):e)}catch(e){this.emit("error",e),this.emit("close");return}try{let e=(this.useSecureWebSocket?"wss:":"ws:")+"//"+s;if(void 0!==this.webSocketConstructor)this.ws=new this.webSocketConstructor(e),i(this.ws);else try{this.ws=new WebSocket(e),i(this.ws)}catch{this.ws=new __unstable_WebSocket(e),i(this.ws)}}catch(e){fetch((this.useSecureWebSocket?"https:":"http:")+"//"+s,{headers:{Upgrade:"websocket"}}).then(t=>{if(this.ws=t.webSocket,null==this.ws)throw e;this.ws.accept(),i(this.ws,!0)}).catch(e=>{this.emit("error",Error(`All attempts to open a WebSocket to connect to the database failed. Please refer \
26
+ ceived ${i}`},RangeError),tg(H,"addNumericalSeparator"),tg(V,"checkBounds"),tg(W,"checkIntBI"),tg(Q,"validateNumber"),tg(Y,"boundsError");var X=/[^+/0-9A-Za-z-_]/g;function z(e){if((e=(e=e.split("=")[0]).trim().replace(X,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}function K(e,t){t=t||1/0;let r,n=e.length,i=null,s=[];for(let o=0;o<n;++o){if((r=e.charCodeAt(o))>55295&&r<57344){if(!i){if(r>56319||o+1===n){(t-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return s}function J(e){let t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function Z(e,t){let r,n,i=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)n=(r=e.charCodeAt(s))>>8,i.push(r%256),i.push(n);return i}function ee(e){return t.toByteArray(z(e))}function et(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function er(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function en(e){return e!=e}tg(z,"base64clean"),tg(K,"utf8ToBytes"),tg(J,"asciiToBytes"),tg(Z,"utf16leToBytes"),tg(ee,"base64ToBytes"),tg(et,"blitBuffer"),tg(er,"isInstance"),tg(en,"numberIsNaN");var ei=function(){let e="0123456789abcdef",t=Array(256);for(let r=0;r<16;++r){let n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function es(e){return typeof BigInt>"u"?eo:e}function eo(){throw Error("BigInt not supported")}tg(es,"defineBigIntMethod"),tg(eo,"BufferBigIntNotDefined")}),tA=tm(()=>{ti=globalThis,ts=globalThis.setImmediate??(e=>setTimeout(e,0)),globalThis.clearImmediate??(e=>clearTimeout(e)),to="function"==typeof globalThis.Buffer&&"function"==typeof globalThis.Buffer.allocUnsafe?globalThis.Buffer:tx().Buffer,(ta=globalThis.process??{}).env??(ta.env={});try{ta.nextTick(()=>{})}catch{let e=Promise.resolve();ta.nextTick=e.then.bind(e)}}),tT=ty((e,t)=>{tA();var r,n="object"==typeof Reflect?Reflect:null,i=n&&"function"==typeof n.apply?n.apply:tg(function(e,t,r){return Function.prototype.apply.call(e,t,r)},"ReflectApply");function s(e){console&&console.warn&&console.warn(e)}r=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?tg(function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):tg(function(e){return Object.getOwnPropertyNames(e)},"ReflectOwnKeys"),tg(s,"ProcessEmitWarning");var o=Number.isNaN||tg(function(e){return e!=e},"NumberIsNaN");function a(){a.init.call(this)}tg(a,"EventEmitter"),t.exports=a,t.exports.once=v,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var u=10;function c(e){if("function"!=typeof e)throw TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function h(e,t,r,n){var i,o,a;if(c(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=l(e))>0&&a.length>i&&!a.warned){a.warned=!0;var u=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)}return e}function f(){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 d(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=f.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?b(i):m(i,i.length)}function g(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 m(e,t){for(var r=Array(t),n=0;n<t;++n)r[n]=e[n];return r}function y(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function b(e){for(var t=Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}function v(e,t){return new Promise(function(r,n){function i(r){e.removeListener(t,s),n(r)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}tg(i,"errorListener"),tg(s,"resolver"),w(e,t,s,{once:!0}),"error"!==t&&_(e,i,{once:!0})})}function _(e,t,r){"function"==typeof e.on&&w(e,"error",t,r)}function w(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)e.addEventListener(t,tg(function i(s){n.once&&e.removeEventListener(t,i),r(s)},"wrapListener"));else throw TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}tg(c,"checkListener"),Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:tg(function(){return u},"get"),set:tg(function(e){if("number"!=typeof e||e<0||o(e))throw RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");u=e},"set")}),a.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},a.prototype.setMaxListeners=tg(function(e){if("number"!=typeof e||e<0||o(e))throw RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},"setMaxListeners"),tg(l,"_getMaxListeners"),a.prototype.getMaxListeners=tg(function(){return l(this)},"getMaxListeners"),a.prototype.emit=tg(function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,s=this._events;if(void 0!==s)n=n&&void 0===s.error;else if(!n)return!1;if(n){if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var o,a=Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var u=s[e];if(void 0===u)return!1;if("function"==typeof u)i(u,this,t);else for(var c=u.length,l=m(u,c),r=0;r<c;++r)i(l[r],this,t);return!0},"emit"),tg(h,"_addListener"),a.prototype.addListener=tg(function(e,t){return h(this,e,t,!1)},"addListener"),a.prototype.on=a.prototype.addListener,a.prototype.prependListener=tg(function(e,t){return h(this,e,t,!0)},"prependListener"),tg(f,"onceWrapper"),tg(d,"_onceWrap"),a.prototype.once=tg(function(e,t){return c(t),this.on(e,d(this,e,t)),this},"once"),a.prototype.prependOnceListener=tg(function(e,t){return c(t),this.prependListener(e,d(this,e,t)),this},"prependOnceListener"),a.prototype.removeListener=tg(function(e,t){var r,n,i,s,o;if(c(t),void 0===(n=this._events)||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,s=r.length-1;s>=0;s--)if(r[s]===t||r[s].listener===t){o=r[s].listener,i=s;break}if(i<0)return this;0===i?r.shift():y(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,o||t)}return this},"removeListener"),a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=tg(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,s=Object.keys(r);for(n=0;n<s.length;++n)"removeListener"!==(i=s[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},"removeAllListeners"),tg(p,"_listeners"),a.prototype.listeners=tg(function(e){return p(this,e,!0)},"listeners"),a.prototype.rawListeners=tg(function(e){return p(this,e,!1)},"rawListeners"),a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},a.prototype.listenerCount=g,tg(g,"listenerCount"),a.prototype.eventNames=tg(function(){return this._eventsCount>0?r(this._events):[]},"eventNames"),tg(m,"arrayClone"),tg(y,"spliceOne"),tg(b,"unwrapListeners"),tg(v,"once"),tg(_,"addErrorHandlerIfEventEmitter"),tg(w,"eventTargetAgnosticAddListener")}),tP={};function tO(e){return 0}tb(tP,{Socket:()=>tL,isIP:()=>tO});var tC,tI,tN,tL,tM=tm(()=>{tA(),tC=t_(tT(),1),tg(tO,"isIP"),tI=/^[^.]+\./,tN=class e extends tC.EventEmitter{constructor(){super(...arguments),tE(this,"opts",{}),tE(this,"connecting",!1),tE(this,"pending",!0),tE(this,"writable",!0),tE(this,"encrypted",!1),tE(this,"authorized",!1),tE(this,"destroyed",!1),tE(this,"ws",null),tE(this,"writeBuffer"),tE(this,"tlsState",0),tE(this,"tlsRead"),tE(this,"tlsWrite")}static get poolQueryViaFetch(){return e.opts.poolQueryViaFetch??e.defaults.poolQueryViaFetch}static set poolQueryViaFetch(t){e.opts.poolQueryViaFetch=t}static get fetchEndpoint(){return e.opts.fetchEndpoint??e.defaults.fetchEndpoint}static set fetchEndpoint(t){e.opts.fetchEndpoint=t}static get fetchConnectionCache(){return!0}static set fetchConnectionCache(e){console.warn("The `fetchConnectionCache` option is deprecated (now always `true`)")}static get fetchFunction(){return e.opts.fetchFunction??e.defaults.fetchFunction}static set fetchFunction(t){e.opts.fetchFunction=t}static get webSocketConstructor(){return e.opts.webSocketConstructor??e.defaults.webSocketConstructor}static set webSocketConstructor(t){e.opts.webSocketConstructor=t}get webSocketConstructor(){return this.opts.webSocketConstructor??e.webSocketConstructor}set webSocketConstructor(e){this.opts.webSocketConstructor=e}static get wsProxy(){return e.opts.wsProxy??e.defaults.wsProxy}static set wsProxy(t){e.opts.wsProxy=t}get wsProxy(){return this.opts.wsProxy??e.wsProxy}set wsProxy(e){this.opts.wsProxy=e}static get coalesceWrites(){return e.opts.coalesceWrites??e.defaults.coalesceWrites}static set coalesceWrites(t){e.opts.coalesceWrites=t}get coalesceWrites(){return this.opts.coalesceWrites??e.coalesceWrites}set coalesceWrites(e){this.opts.coalesceWrites=e}static get useSecureWebSocket(){return e.opts.useSecureWebSocket??e.defaults.useSecureWebSocket}static set useSecureWebSocket(t){e.opts.useSecureWebSocket=t}get useSecureWebSocket(){return this.opts.useSecureWebSocket??e.useSecureWebSocket}set useSecureWebSocket(e){this.opts.useSecureWebSocket=e}static get forceDisablePgSSL(){return e.opts.forceDisablePgSSL??e.defaults.forceDisablePgSSL}static set forceDisablePgSSL(t){e.opts.forceDisablePgSSL=t}get forceDisablePgSSL(){return this.opts.forceDisablePgSSL??e.forceDisablePgSSL}set forceDisablePgSSL(e){this.opts.forceDisablePgSSL=e}static get disableSNI(){return e.opts.disableSNI??e.defaults.disableSNI}static set disableSNI(t){e.opts.disableSNI=t}get disableSNI(){return this.opts.disableSNI??e.disableSNI}set disableSNI(e){this.opts.disableSNI=e}static get disableWarningInBrowsers(){return e.opts.disableWarningInBrowsers??e.defaults.disableWarningInBrowsers}static set disableWarningInBrowsers(t){e.opts.disableWarningInBrowsers=t}get disableWarningInBrowsers(){return this.opts.disableWarningInBrowsers??e.disableWarningInBrowsers}set disableWarningInBrowsers(e){this.opts.disableWarningInBrowsers=e}static get pipelineConnect(){return e.opts.pipelineConnect??e.defaults.pipelineConnect}static set pipelineConnect(t){e.opts.pipelineConnect=t}get pipelineConnect(){return this.opts.pipelineConnect??e.pipelineConnect}set pipelineConnect(e){this.opts.pipelineConnect=e}static get subtls(){return e.opts.subtls??e.defaults.subtls}static set subtls(t){e.opts.subtls=t}get subtls(){return this.opts.subtls??e.subtls}set subtls(e){this.opts.subtls=e}static get pipelineTLS(){return e.opts.pipelineTLS??e.defaults.pipelineTLS}static set pipelineTLS(t){e.opts.pipelineTLS=t}get pipelineTLS(){return this.opts.pipelineTLS??e.pipelineTLS}set pipelineTLS(e){this.opts.pipelineTLS=e}static get rootCerts(){return e.opts.rootCerts??e.defaults.rootCerts}static set rootCerts(t){e.opts.rootCerts=t}get rootCerts(){return this.opts.rootCerts??e.rootCerts}set rootCerts(e){this.opts.rootCerts=e}wsProxyAddrForHost(e,t){let r=this.wsProxy;if(void 0===r)throw Error("No WebSocket proxy is configured. Please see https://github.com/neondatabase/serverless/blob/main/CONFIG.md#wsproxy-string--host-string-port-number--string--string");return"function"==typeof r?r(e,t):`${r}?address=${e}:${t}`}setNoDelay(){return this}setKeepAlive(){return this}ref(){return this}unref(){return this}connect(e,t,r){this.connecting=!0,r&&this.once("connect",r);let n=tg(()=>{this.connecting=!1,this.pending=!1,this.emit("connect"),this.emit("ready")},"handleWebSocketOpen"),i=tg((e,t=!1)=>{e.binaryType="arraybuffer",e.addEventListener("error",e=>{this.emit("error",e),this.emit("close")}),e.addEventListener("message",e=>{if(0===this.tlsState){let t=to.from(e.data);this.emit("data",t)}}),e.addEventListener("close",()=>{this.emit("close")}),t?n():e.addEventListener("open",n)},"configureWebSocket"),s;try{s=this.wsProxyAddrForHost(t,"string"==typeof e?parseInt(e,10):e)}catch(e){this.emit("error",e),this.emit("close");return}try{let e=(this.useSecureWebSocket?"wss:":"ws:")+"//"+s;if(void 0!==this.webSocketConstructor)this.ws=new this.webSocketConstructor(e),i(this.ws);else try{this.ws=new WebSocket(e),i(this.ws)}catch{this.ws=new __unstable_WebSocket(e),i(this.ws)}}catch(e){fetch((this.useSecureWebSocket?"https:":"http:")+"//"+s,{headers:{Upgrade:"websocket"}}).then(t=>{if(this.ws=t.webSocket,null==this.ws)throw e;this.ws.accept(),i(this.ws,!0)}).catch(e=>{this.emit("error",Error(`All attempts to open a WebSocket to connect to the database failed. Please refer \
27
27
  to https://github.com/neondatabase/serverless/blob/main/CONFIG.md#websocketconstructor-typeof-websoc\
28
- ket--undefined. Details: ${e}`)),this.emit("close")})}}async startTls(e){if(void 0===this.subtls)throw Error("For Postgres SSL connections, you must set `neonConfig.subtls` to the subtls library. See https://github.com/neondatabase/serverless/blob/main/CONFIG.md for more information.");this.tlsState=1;let t=await this.subtls.TrustedCert.databaseFromPEM(this.rootCerts),r=new this.subtls.WebSocketReadQueue(this.ws),n=r.read.bind(r),i=this.rawWrite.bind(this),{read:s,write:o}=await this.subtls.startTls(e,t,n,i,{useSNI:!this.disableSNI,expectPreData:this.pipelineTLS?new Uint8Array([83]):void 0});this.tlsRead=s,this.tlsWrite=o,this.tlsState=2,this.encrypted=!0,this.authorized=!0,this.emit("secureConnection",this),this.tlsReadLoop()}async tlsReadLoop(){for(;;){let e=await this.tlsRead();if(void 0===e)break;{let t=to.from(e);this.emit("data",t)}}}rawWrite(e){if(!this.coalesceWrites){this.ws&&this.ws.send(e);return}if(void 0===this.writeBuffer)this.writeBuffer=e,setTimeout(()=>{this.ws&&this.ws.send(this.writeBuffer),this.writeBuffer=void 0},0);else{let t=new Uint8Array(this.writeBuffer.length+e.length);t.set(this.writeBuffer),t.set(e,this.writeBuffer.length),this.writeBuffer=t}}write(e,t="utf8",r=e=>{}){return 0===e.length?r():("string"==typeof e&&(e=to.from(e,t)),0===this.tlsState?(this.rawWrite(e),r()):1===this.tlsState?this.once("secureConnection",()=>{this.write(e,t,r)}):(this.tlsWrite(e),r())),!0}end(e=to.alloc(0),t="utf8",r=()=>{}){return this.write(e,t,()=>{this.ws.close(),r()}),this}destroy(){return this.destroyed=!0,this.end()}},tp(tI,"Socket"),tw(tI,"defaults",{poolQueryViaFetch:!1,fetchEndpoint:tp((e,t,r)=>"https://"+(r?.jwtAuth?e.replace(tC,"apiauth."):e.replace(tC,"api."))+"/sql","fetchEndpoint"),fetchConnectionCache:!0,fetchFunction:void 0,webSocketConstructor:void 0,wsProxy:tp(e=>e+"/v2","wsProxy"),useSecureWebSocket:!0,forceDisablePgSSL:!0,coalesceWrites:!0,pipelineConnect:"password",subtls:void 0,rootCerts:"",pipelineTLS:!1,disableSNI:!1,disableWarningInBrowsers:!1}),tw(tI,"opts",{}),tN=tI}),tM={};function tD(e,t=!1){let{protocol:r}=new URL(e),{username:n,password:i,host:s,hostname:o,port:a,pathname:u,search:c,searchParams:l,hash:h}=new URL("http:"+e.substring(r.length));i=decodeURIComponent(i),n=decodeURIComponent(n),u=decodeURIComponent(u);let f=n+":"+i,d=t?Object.fromEntries(l.entries()):c;return{href:e,protocol:r,auth:f,username:n,password:i,host:s,hostname:o,port:a,pathname:u,search:c,query:d,hash:h}}ty(tM,{parse:()=>tD});var tk=tg(()=>{tx(),tp(tD,"parse")}),tB=tm(e=>{tx(),e.parse=function(e,t){return new r(e,t).parse()};var t=class e{constructor(e,t){this.source=e,this.transform=t||n,this.position=0,this.entries=[],this.recorded=[],this.dimension=0}isEof(){return this.position>=this.source.length}nextCharacter(){var e=this.source[this.position++];return"\\"===e?{value:this.source[this.position++],escaped:!0}:{value:e,escaped:!1}}record(e){this.recorded.push(e)}newEntry(e){var t;(this.recorded.length>0||e)&&("NULL"!==(t=this.recorded.join(""))||e||(t=null),null!==t&&(t=this.transform(t)),this.entries.push(t),this.recorded=[])}consumeDimensions(){if("["===this.source[0])for(;!this.isEof()&&"="!==this.nextCharacter().value;);}parse(t){var r,n,i;for(this.consumeDimensions();!this.isEof();)if("{"!==(r=this.nextCharacter()).value||i){if("}"!==r.value||i)'"'!==r.value||r.escaped?","!==r.value||i?this.record(r.value):this.newEntry():(i&&this.newEntry(!0),i=!i);else if(this.dimension--,!this.dimension&&(this.newEntry(),t))return this.entries}else this.dimension++,this.dimension>1&&(n=new e(this.source.substr(this.position-1),this.transform),this.entries.push(n.parse(!0)),this.position+=n.position-2);if(0!==this.dimension)throw Error("array dimension not balanced");return this.entries}};tp(t,"ArrayParser");var r=t;function n(e){return e}tp(n,"identity")}),tj=tm((e,t)=>{tx();var r=tB();t.exports={create:tp(function(e,t){return{parse:tp(function(){return r.parse(e,t)},"parse")}},"create")}}),tU=tm((e,t)=>{tx();var r=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/,n=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,i=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,s=/^-?infinity$/;function o(e){var t=n.exec(e);if(t){var r=parseInt(t[1],10);t[4]&&(r=u(r));var i=new Date(r,parseInt(t[2],10)-1,t[3]);return c(r)&&i.setFullYear(r),i}}function a(e){if(e.endsWith("+00"))return 0;var t=i.exec(e.split(" ")[1]);if(t){var r=t[1];return"Z"===r?0:(3600*parseInt(t[2],10)+60*parseInt(t[3]||0,10)+parseInt(t[4]||0,10))*("-"===r?-1:1)*1e3}}function u(e){return-(e-1)}function c(e){return e>=0&&e<100}t.exports=tp(function(e){if(s.test(e))return Number(e.replace("i","I"));var t=r.exec(e);if(!t)return o(e)||null;var n=!!t[8],i=parseInt(t[1],10);n&&(i=u(i));var l=parseInt(t[2],10)-1,h=t[3],f=parseInt(t[4],10),d=parseInt(t[5],10),p=parseInt(t[6],10),g=t[7];g=g?1e3*parseFloat(g):0;var m,y=a(e);return null!=y?(m=new Date(Date.UTC(i,l,h,f,d,p,g)),c(i)&&m.setUTCFullYear(i),0!==y&&m.setTime(m.getTime()-y)):(m=new Date(i,l,h,f,d,p,g),c(i)&&m.setFullYear(i)),m},"parseDate"),tp(o,"getDate"),tp(a,"timeZoneOffset"),tp(u,"bcYearToNegativeYear"),tp(c,"is0To99")}),tF=tm((e,t)=>{tx(),t.exports=n;var r=Object.prototype.hasOwnProperty;function n(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)r.call(n,i)&&(e[i]=n[i])}return e}tp(n,"extend")}),tq=tm((e,t)=>{tx();var r=tF();function n(e){if(!(this instanceof n))return new n(e);r(this,d(e))}t.exports=n,tp(n,"PostgresInterval");var i=["seconds","minutes","hours","days","months","years"];n.prototype.toPostgres=function(){var e=i.filter(this.hasOwnProperty,this);return this.milliseconds&&0>e.indexOf("seconds")&&e.push("seconds"),0===e.length?"0":e.map(function(e){var t=this[e]||0;return"seconds"===e&&this.milliseconds&&(t=(t+this.milliseconds/1e3).toFixed(6).replace(/\.?0+$/,"")),t+" "+e},this).join(" ")};var s={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"S"},o=["years","months","days"],a=["hours","minutes","seconds"];n.prototype.toISOString=n.prototype.toISO=function(){return"P"+o.map(e,this).join("")+"T"+a.map(e,this).join("");function e(e){var t=this[e]||0;return"seconds"===e&&this.milliseconds&&(t=(t+this.milliseconds/1e3).toFixed(6).replace(/0+$/,"")),t+s[e]}};var u="([+-]?\\d+)",c=new RegExp([u+"\\s+years?",u+"\\s+mons?",u+"\\s+days?","([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?"].map(function(e){return"("+e+")?"}).join("\\s*")),l={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12},h=["hours","minutes","seconds","milliseconds"];function f(e){return parseInt(e+"000000".slice(e.length),10)/1e3}function d(e){if(!e)return{};var t=c.exec(e),r="-"===t[8];return Object.keys(l).reduce(function(e,n){var i=t[l[n]];return i&&(i="milliseconds"===n?f(i):parseInt(i,10))&&(r&&~h.indexOf(n)&&(i*=-1),e[n]=i),e},{})}tp(f,"parseMilliseconds"),tp(d,"parse")}),t$=tm((e,t)=>{tx(),t.exports=tp(function(e){if(/^\\x/.test(e))return new to(e.substr(2),"hex");for(var t="",r=0;r<e.length;)if("\\"!==e[r])t+=e[r],++r;else if(/[0-7]{3}/.test(e.substr(r+1,3)))t+=String.fromCharCode(parseInt(e.substr(r+1,3),8)),r+=4;else{for(var n=1;r+n<e.length&&"\\"===e[r+n];)n++;for(var i=0;i<Math.floor(n/2);++i)t+="\\";r+=2*Math.floor(n/2)}return new to(t,"binary")},"parseBytea")}),tG=tm((e,t)=>{tx();var r=tB(),n=tj(),i=tU(),s=tq(),o=t$();function a(e){return tp(function(t){return null===t?t:e(t)},"nullAllowed")}function u(e){return null===e?e:"TRUE"===e||"t"===e||"true"===e||"y"===e||"yes"===e||"on"===e||"1"===e}function c(e){return e?r.parse(e,u):null}function l(e){return parseInt(e,10)}function h(e){return e?r.parse(e,a(l)):null}function f(e){return e?r.parse(e,a(function(e){return _(e).trim()})):null}tp(a,"allowNull"),tp(u,"parseBool"),tp(c,"parseBoolArray"),tp(l,"parseBaseTenInt"),tp(h,"parseIntegerArray"),tp(f,"parseBigIntegerArray");var d=tp(function(e){return e?n.create(e,function(e){return null!==e&&(e=E(e)),e}).parse():null},"parsePointArray"),p=tp(function(e){return e?n.create(e,function(e){return null!==e&&(e=parseFloat(e)),e}).parse():null},"parseFloatArray"),g=tp(function(e){return e?n.create(e).parse():null},"parseStringArray"),m=tp(function(e){return e?n.create(e,function(e){return null!==e&&(e=i(e)),e}).parse():null},"parseDateArray"),y=tp(function(e){return e?n.create(e,function(e){return null!==e&&(e=s(e)),e}).parse():null},"parseIntervalArray"),b=tp(function(e){return e?r.parse(e,a(o)):null},"parseByteAArray"),v=tp(function(e){return parseInt(e,10)},"parseInteger"),_=tp(function(e){var t=String(e);return/^\d+$/.test(t)?t:e},"parseBigInteger"),w=tp(function(e){return e?r.parse(e,a(JSON.parse)):null},"parseJsonArray"),E=tp(function(e){return"("!==e[0]?null:{x:parseFloat((e=e.substring(1,e.length-1).split(","))[0]),y:parseFloat(e[1])}},"parsePoint"),S=tp(function(e){if("<"!==e[0]&&"("!==e[1])return null;for(var t="(",r="",n=!1,i=2;i<e.length-1;i++){if(n||(t+=e[i]),")"===e[i]){n=!0;continue}n&&","!==e[i]&&(r+=e[i])}var s=E(t);return s.radius=parseFloat(r),s},"parseCircle");t.exports={init:tp(function(e){e(20,_),e(21,v),e(23,v),e(26,v),e(700,parseFloat),e(701,parseFloat),e(16,u),e(1082,i),e(1114,i),e(1184,i),e(600,E),e(651,g),e(718,S),e(1e3,c),e(1001,b),e(1005,h),e(1007,h),e(1028,h),e(1016,f),e(1017,d),e(1021,p),e(1022,p),e(1231,p),e(1014,g),e(1015,g),e(1008,g),e(1009,g),e(1040,g),e(1041,g),e(1115,m),e(1182,m),e(1185,m),e(1186,s),e(1187,y),e(17,o),e(114,JSON.parse.bind(JSON)),e(3802,JSON.parse.bind(JSON)),e(199,w),e(3807,w),e(3907,g),e(2951,g),e(791,g),e(1183,g),e(1270,g)},"init")}}),tH=tm((e,t)=>{function r(e){var t=e.readInt32BE(0),r=e.readUInt32BE(4),n="";t<0&&(t=~t+(0===r),r=~r+1>>>0,n="-");var i,s,o,a,u,c,l="";if(i=t%1e6,t=t/1e6>>>0,r=(s=0x100000000*i+r)/1e6>>>0,o=""+(s-1e6*r),0===r&&0===t)return n+o+l;for(a="",u=6-o.length,c=0;c<u;c++)a+="0";if(l=a+o+l,i=t%1e6,t=t/1e6>>>0,r=(s=0x100000000*i+r)/1e6>>>0,o=""+(s-1e6*r),0===r&&0===t)return n+o+l;for(a="",u=6-o.length,c=0;c<u;c++)a+="0";if(l=a+o+l,i=t%1e6,t=t/1e6>>>0,r=(s=0x100000000*i+r)/1e6>>>0,o=""+(s-1e6*r),0===r&&0===t)return n+o+l;for(a="",u=6-o.length,c=0;c<u;c++)a+="0";return l=a+o+l,n+(o=""+(s=0x100000000*(i=t%1e6)+r)%1e6)+l}tx(),tp(r,"readInt8"),t.exports=r}),tV=tm((e,t)=>{tx();var r=tH(),n=tp(function(e,t,r,n,i){r=r||0,n=n||!1,i=i||function(e,t,r){return e*Math.pow(2,r)+t};var s=r>>3,o=tp(function(e){return n?255&~e:e},"inv"),a=255,u=8-r%8;t<u&&(a=255<<8-t&255,u=t),r&&(a>>=r%8);var c=0;r%8+t>=8&&(c=i(0,o(e[s])&a,u));for(var l=t+r>>3,h=s+1;h<l;h++)c=i(c,o(e[h]),8);var f=(t+r)%8;return f>0&&(c=i(c,o(e[l])>>8-f,f)),c},"parseBits"),i=tp(function(e,t,r){var i=Math.pow(2,r-1)-1,s=n(e,1),o=n(e,r,1);if(0===o)return 0;var a=1,u=n(e,t,r+1,!1,tp(function(e,t,r){0===e&&(e=1);for(var n=1;n<=r;n++)a/=2,(t&1<<r-n)>0&&(e+=a);return e},"parsePrecisionBits"));return o==Math.pow(2,r+1)-1?0===u?0===s?1/0:-1/0:NaN:(0===s?1:-1)*Math.pow(2,o-i)*u},"parseFloatFromBits"),s=tp(function(e){return 1==n(e,1)?-1*(n(e,15,1,!0)+1):n(e,15,1)},"parseInt16"),o=tp(function(e){return 1==n(e,1)?-1*(n(e,31,1,!0)+1):n(e,31,1)},"parseInt32"),a=tp(function(e){return i(e,23,8)},"parseFloat32"),u=tp(function(e){return i(e,52,11)},"parseFloat64"),c=tp(function(e){var t=n(e,16,32);if(49152==t)return NaN;for(var r=Math.pow(1e4,n(e,16,16)),i=0,s=n(e,16),o=0;o<s;o++)i+=n(e,16,64+16*o)*r,r/=1e4;var a=Math.pow(10,n(e,16,48));return(0===t?1:-1)*Math.round(i*a)/a},"parseNumeric"),l=tp(function(e,t){var r=n(t,1),i=n(t,63,1),s=new Date((0===r?1:-1)*i/1e3+9466848e5);return e||s.setTime(s.getTime()+6e4*s.getTimezoneOffset()),s.usec=i%1e3,s.getMicroSeconds=function(){return this.usec},s.setMicroSeconds=function(e){this.usec=e},s.getUTCMicroSeconds=function(){return this.usec},s},"parseDate"),h=tp(function(e){for(var t=n(e,32),r=(n(e,32,32),n(e,32,64)),i=96,s=[],o=0;o<t;o++)s[o]=n(e,32,i),i+=64;var a=tp(function(t){var r,s=n(e,32,i);return(i+=32,0xffffffff==s)?null:23==t||20==t?(r=n(e,8*s,i),i+=8*s,r):25==t?e.toString(this.encoding,i>>3,(i+=s<<3)>>3):void console.log("ERROR: ElementType not implemented: "+t)},"parseElement"),u=tp(function(e,t){var r,n=[];if(e.length>1){var i=e.shift();for(r=0;r<i;r++)n[r]=u(e,t);e.unshift(i)}else for(r=0;r<e[0];r++)n[r]=a(t);return n},"parse");return u(s,r)},"parseArray"),f=tp(function(e){return e.toString("utf8")},"parseText"),d=tp(function(e){return null===e?null:n(e,8)>0},"parseBool");t.exports={init:tp(function(e){e(20,r),e(21,s),e(23,o),e(26,o),e(1700,c),e(700,a),e(701,u),e(16,d),e(1114,l.bind(null,!1)),e(1184,l.bind(null,!0)),e(1e3,h),e(1007,h),e(1016,h),e(1008,h),e(1009,h),e(25,f)},"init")}}),tW=tm((e,t)=>{tx(),t.exports={BOOL:16,BYTEA:17,CHAR:18,INT8:20,INT2:21,INT4:23,REGPROC:24,TEXT:25,OID:26,TID:27,XID:28,CID:29,JSON:114,XML:142,PG_NODE_TREE:194,SMGR:210,PATH:602,POLYGON:604,CIDR:650,FLOAT4:700,FLOAT8:701,ABSTIME:702,RELTIME:703,TINTERVAL:704,CIRCLE:718,MACADDR8:774,MONEY:790,MACADDR:829,INET:869,ACLITEM:1033,BPCHAR:1042,VARCHAR:1043,DATE:1082,TIME:1083,TIMESTAMP:1114,TIMESTAMPTZ:1184,INTERVAL:1186,TIMETZ:1266,BIT:1560,VARBIT:1562,NUMERIC:1700,REFCURSOR:1790,REGPROCEDURE:2202,REGOPER:2203,REGOPERATOR:2204,REGCLASS:2205,REGTYPE:2206,UUID:2950,TXID_SNAPSHOT:2970,PG_LSN:3220,PG_NDISTINCT:3361,PG_DEPENDENCIES:3402,TSVECTOR:3614,TSQUERY:3615,GTSVECTOR:3642,REGCONFIG:3734,REGDICTIONARY:3769,JSONB:3802,REGNAMESPACE:4089,REGROLE:4096}}),tQ=tm(e=>{tx();var t=tG(),r=tV(),n=tj(),i=tW();e.getTypeParser=a,e.setTypeParser=u,e.arrayParser=n,e.builtins=i;var s={text:{},binary:{}};function o(e){return String(e)}function a(e,t){return s[t=t||"text"]&&s[t][e]||o}function u(e,t,r){"function"==typeof t&&(r=t,t="text"),s[t][e]=r}tp(o,"noParse"),tp(a,"getTypeParser"),tp(u,"setTypeParser"),t.init(function(e,t){s.text[e]=t}),r.init(function(e,t){s.binary[e]=t})}),tY=tm((e,t)=>{tx();var r=tQ();function n(e){this._types=e||r,this.text={},this.binary={}}tp(n,"TypeOverrides"),n.prototype.getOverrides=function(e){switch(e){case"text":return this.text;case"binary":return this.binary;default:return{}}},n.prototype.setTypeParser=function(e,t,r){"function"==typeof t&&(r=t,t="text"),this.getOverrides(t)[e]=r},n.prototype.getTypeParser=function(e,t){return t=t||"text",this.getOverrides(t)[e]||this._types.getTypeParser(e,t)},t.exports=n});function tX(e){let t=0x6a09e667,r=0xbb67ae85,n=0x3c6ef372,i=0xa54ff53a,s=0x510e527f,o=0x9b05688c,a=0x1f83d9ab,u=0x5be0cd19,c=0,l=0,h=[0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2],f=tp((e,t)=>e>>>t|e<<32-t,"rrot"),d=new Uint32Array(64),p=new Uint8Array(64),g=tp(()=>{for(let e=0,t=0;e<16;e++,t+=4)d[e]=p[t]<<24|p[t+1]<<16|p[t+2]<<8|p[t+3];for(let e=16;e<64;e++){let t=f(d[e-15],7)^f(d[e-15],18)^d[e-15]>>>3,r=f(d[e-2],17)^f(d[e-2],19)^d[e-2]>>>10;d[e]=d[e-16]+t+d[e-7]+r|0}let e=t,c=r,g=n,m=i,y=s,b=o,v=a,_=u;for(let t=0;t<64;t++){let r=_+(f(y,6)^f(y,11)^f(y,25))+(y&b^~y&v)+h[t]+d[t]|0,n=(f(e,2)^f(e,13)^f(e,22))+(e&c^e&g^c&g)|0;_=v,v=b,b=y,y=m+r|0,m=g,g=c,c=e,e=r+n|0}t=t+e|0,r=r+c|0,n=n+g|0,i=i+m|0,s=s+y|0,o=o+b|0,a=a+v|0,u=u+_|0,l=0},"process"),m=tp(e=>{"string"==typeof e&&(e=new TextEncoder().encode(e));for(let t=0;t<e.length;t++)p[l++]=e[t],64===l&&g();c+=e.length},"add"),y=tp(()=>{if(p[l++]=128,64==l&&g(),l+8>64){for(;l<64;)p[l++]=0;g()}for(;l<58;)p[l++]=0;let e=8*c;p[l++]=e/0x10000000000&255,p[l++]=e/0x100000000&255,p[l++]=e>>>24,p[l++]=e>>>16&255,p[l++]=e>>>8&255,p[l++]=255&e,g();let h=new Uint8Array(32);return h[0]=t>>>24,h[1]=t>>>16&255,h[2]=t>>>8&255,h[3]=255&t,h[4]=r>>>24,h[5]=r>>>16&255,h[6]=r>>>8&255,h[7]=255&r,h[8]=n>>>24,h[9]=n>>>16&255,h[10]=n>>>8&255,h[11]=255&n,h[12]=i>>>24,h[13]=i>>>16&255,h[14]=i>>>8&255,h[15]=255&i,h[16]=s>>>24,h[17]=s>>>16&255,h[18]=s>>>8&255,h[19]=255&s,h[20]=o>>>24,h[21]=o>>>16&255,h[22]=o>>>8&255,h[23]=255&o,h[24]=a>>>24,h[25]=a>>>16&255,h[26]=a>>>8&255,h[27]=255&a,h[28]=u>>>24,h[29]=u>>>16&255,h[30]=u>>>8&255,h[31]=255&u,h},"digest");return void 0===e?{add:m,digest:y}:(m(e),y())}var tz,tK,tJ=tg(()=>{tx(),tp(tX,"sha256")}),tZ=tg(()=>{tx(),tp(tz=class e{constructor(){tw(this,"_dataLength",0),tw(this,"_bufferLength",0),tw(this,"_state",new Int32Array(4)),tw(this,"_buffer",new ArrayBuffer(68)),tw(this,"_buffer8"),tw(this,"_buffer32"),this._buffer8=new Uint8Array(this._buffer,0,68),this._buffer32=new Uint32Array(this._buffer,0,17),this.start()}static hashByteArray(e,t=!1){return this.onePassHasher.start().appendByteArray(e).end(t)}static hashStr(e,t=!1){return this.onePassHasher.start().appendStr(e).end(t)}static hashAsciiStr(e,t=!1){return this.onePassHasher.start().appendAsciiStr(e).end(t)}static _hex(t){let r=e.hexChars,n=e.hexOut,i,s,o,a;for(a=0;a<4;a+=1)for(s=8*a,i=t[a],o=0;o<8;o+=2)n[s+1+o]=r.charAt(15&i),i>>>=4,n[s+0+o]=r.charAt(15&i),i>>>=4;return n.join("")}static _md5cycle(e,t){let r=e[0],n=e[1],i=e[2],s=e[3];r+=(n&i|~n&s)+t[0]-0x28955b88|0,s+=((r=(r<<7|r>>>25)+n|0)&n|~r&i)+t[1]-0x173848aa|0,i+=((s=(s<<12|s>>>20)+r|0)&r|~s&n)+t[2]+0x242070db|0,n+=((i=(i<<17|i>>>15)+s|0)&s|~i&r)+t[3]-0x3e423112|0,r+=((n=(n<<22|n>>>10)+i|0)&i|~n&s)+t[4]-0xa83f051|0,s+=((r=(r<<7|r>>>25)+n|0)&n|~r&i)+t[5]+0x4787c62a|0,i+=((s=(s<<12|s>>>20)+r|0)&r|~s&n)+t[6]-0x57cfb9ed|0,n+=((i=(i<<17|i>>>15)+s|0)&s|~i&r)+t[7]-0x2b96aff|0,r+=((n=(n<<22|n>>>10)+i|0)&i|~n&s)+t[8]+0x698098d8|0,s+=((r=(r<<7|r>>>25)+n|0)&n|~r&i)+t[9]-0x74bb0851|0,i+=((s=(s<<12|s>>>20)+r|0)&r|~s&n)+t[10]-42063|0,n+=((i=(i<<17|i>>>15)+s|0)&s|~i&r)+t[11]-0x76a32842|0,r+=((n=(n<<22|n>>>10)+i|0)&i|~n&s)+t[12]+0x6b901122|0,s+=((r=(r<<7|r>>>25)+n|0)&n|~r&i)+t[13]-0x2678e6d|0,i+=((s=(s<<12|s>>>20)+r|0)&r|~s&n)+t[14]-0x5986bc72|0,n+=((i=(i<<17|i>>>15)+s|0)&s|~i&r)+t[15]+0x49b40821|0,r+=((n=(n<<22|n>>>10)+i|0)&s|i&~s)+t[1]-0x9e1da9e|0,s+=((r=(r<<5|r>>>27)+n|0)&i|n&~i)+t[6]-0x3fbf4cc0|0,i+=((s=(s<<9|s>>>23)+r|0)&n|r&~n)+t[11]+0x265e5a51|0,n+=((i=(i<<14|i>>>18)+s|0)&r|s&~r)+t[0]-0x16493856|0,r+=((n=(n<<20|n>>>12)+i|0)&s|i&~s)+t[5]-0x29d0efa3|0,s+=((r=(r<<5|r>>>27)+n|0)&i|n&~i)+t[10]+0x2441453|0,i+=((s=(s<<9|s>>>23)+r|0)&n|r&~n)+t[15]-0x275e197f|0,n+=((i=(i<<14|i>>>18)+s|0)&r|s&~r)+t[4]-0x182c0438|0,r+=((n=(n<<20|n>>>12)+i|0)&s|i&~s)+t[9]+0x21e1cde6|0,s+=((r=(r<<5|r>>>27)+n|0)&i|n&~i)+t[14]-0x3cc8f82a|0,i+=((s=(s<<9|s>>>23)+r|0)&n|r&~n)+t[3]-0xb2af279|0,n+=((i=(i<<14|i>>>18)+s|0)&r|s&~r)+t[8]+0x455a14ed|0,r+=((n=(n<<20|n>>>12)+i|0)&s|i&~s)+t[13]-0x561c16fb|0,s+=((r=(r<<5|r>>>27)+n|0)&i|n&~i)+t[2]-0x3105c08|0,i+=((s=(s<<9|s>>>23)+r|0)&n|r&~n)+t[7]+0x676f02d9|0,n+=((i=(i<<14|i>>>18)+s|0)&r|s&~r)+t[12]-0x72d5b376|0,r+=((n=(n<<20|n>>>12)+i|0)^i^s)+t[5]-378558|0,s+=((r=(r<<4|r>>>28)+n|0)^n^i)+t[8]-0x788e097f|0,i+=((s=(s<<11|s>>>21)+r|0)^r^n)+t[11]+0x6d9d6122|0,n+=((i=(i<<16|i>>>16)+s|0)^s^r)+t[14]-0x21ac7f4|0,r+=((n=(n<<23|n>>>9)+i|0)^i^s)+t[1]-0x5b4115bc|0,s+=((r=(r<<4|r>>>28)+n|0)^n^i)+t[4]+0x4bdecfa9|0,i+=((s=(s<<11|s>>>21)+r|0)^r^n)+t[7]-0x944b4a0|0,n+=((i=(i<<16|i>>>16)+s|0)^s^r)+t[10]-0x41404390|0,r+=((n=(n<<23|n>>>9)+i|0)^i^s)+t[13]+0x289b7ec6|0,s+=((r=(r<<4|r>>>28)+n|0)^n^i)+t[0]-0x155ed806|0,i+=((s=(s<<11|s>>>21)+r|0)^r^n)+t[3]-0x2b10cf7b|0,n+=((i=(i<<16|i>>>16)+s|0)^s^r)+t[6]+0x4881d05|0,r+=((n=(n<<23|n>>>9)+i|0)^i^s)+t[9]-0x262b2fc7|0,s+=((r=(r<<4|r>>>28)+n|0)^n^i)+t[12]-0x1924661b|0,i+=((s=(s<<11|s>>>21)+r|0)^r^n)+t[15]+0x1fa27cf8|0,n+=((i=(i<<16|i>>>16)+s|0)^s^r)+t[2]-0x3b53a99b|0,n=(n<<23|n>>>9)+i|0,r+=(i^(n|~s))+t[0]-0xbd6ddbc|0,r=(r<<6|r>>>26)+n|0,s+=(n^(r|~i))+t[7]+0x432aff97|0,s=(s<<10|s>>>22)+r|0,i+=(r^(s|~n))+t[14]-0x546bdc59|0,i=(i<<15|i>>>17)+s|0,n+=(s^(i|~r))+t[5]-0x36c5fc7|0,n=(n<<21|n>>>11)+i|0,r+=(i^(n|~s))+t[12]+0x655b59c3|0,r=(r<<6|r>>>26)+n|0,s+=(n^(r|~i))+t[3]-0x70f3336e|0,s=(s<<10|s>>>22)+r|0,i+=(r^(s|~n))+t[10]-1051523|0,i=(i<<15|i>>>17)+s|0,n+=(s^(i|~r))+t[1]-0x7a7ba22f|0,n=(n<<21|n>>>11)+i|0,r+=(i^(n|~s))+t[8]+0x6fa87e4f|0,r=(r<<6|r>>>26)+n|0,s+=(n^(r|~i))+t[15]-0x1d31920|0,s=(s<<10|s>>>22)+r|0,i+=(r^(s|~n))+t[6]-0x5cfebcec|0,i=(i<<15|i>>>17)+s|0,n+=(s^(i|~r))+t[13]+0x4e0811a1|0,n=(n<<21|n>>>11)+i|0,r+=(i^(n|~s))+t[4]-0x8ac817e|0,r=(r<<6|r>>>26)+n|0,s+=(n^(r|~i))+t[11]-0x42c50dcb|0,s=(s<<10|s>>>22)+r|0,i+=(r^(s|~n))+t[2]+0x2ad7d2bb|0,i=(i<<15|i>>>17)+s|0,n+=(s^(i|~r))+t[9]-0x14792c6f|0,n=(n<<21|n>>>11)+i|0,e[0]=r+e[0]|0,e[1]=n+e[1]|0,e[2]=i+e[2]|0,e[3]=s+e[3]|0}start(){return this._dataLength=0,this._bufferLength=0,this._state.set(e.stateIdentity),this}appendStr(t){let r=this._buffer8,n=this._buffer32,i=this._bufferLength,s,o;for(o=0;o<t.length;o+=1){if((s=t.charCodeAt(o))<128)r[i++]=s;else if(s<2048)r[i++]=(s>>>6)+192,r[i++]=63&s|128;else if(s<55296||s>56319)r[i++]=(s>>>12)+224,r[i++]=s>>>6&63|128,r[i++]=63&s|128;else{if((s=(s-55296)*1024+(t.charCodeAt(++o)-56320)+65536)>1114111)throw Error("Unicode standard supports code points up to U+10FFFF");r[i++]=(s>>>18)+240,r[i++]=s>>>12&63|128,r[i++]=s>>>6&63|128,r[i++]=63&s|128}i>=64&&(this._dataLength+=64,e._md5cycle(this._state,n),i-=64,n[0]=n[16])}return this._bufferLength=i,this}appendAsciiStr(t){let r=this._buffer8,n=this._buffer32,i=this._bufferLength,s,o=0;for(;;){for(s=Math.min(t.length-o,64-i);s--;)r[i++]=t.charCodeAt(o++);if(i<64)break;this._dataLength+=64,e._md5cycle(this._state,n),i=0}return this._bufferLength=i,this}appendByteArray(t){let r=this._buffer8,n=this._buffer32,i=this._bufferLength,s,o=0;for(;;){for(s=Math.min(t.length-o,64-i);s--;)r[i++]=t[o++];if(i<64)break;this._dataLength+=64,e._md5cycle(this._state,n),i=0}return this._bufferLength=i,this}getState(){let e=this._state;return{buffer:String.fromCharCode.apply(null,Array.from(this._buffer8)),buflen:this._bufferLength,length:this._dataLength,state:[e[0],e[1],e[2],e[3]]}}setState(e){let t=e.buffer,r=e.state,n=this._state,i;for(this._dataLength=e.length,this._bufferLength=e.buflen,n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],i=0;i<t.length;i+=1)this._buffer8[i]=t.charCodeAt(i)}end(t=!1){let r=this._bufferLength,n=this._buffer8,i=this._buffer32,s=(r>>2)+1;this._dataLength+=r;let o=8*this._dataLength;if(n[r]=128,n[r+1]=n[r+2]=n[r+3]=0,i.set(e.buffer32Identity.subarray(s),s),r>55&&(e._md5cycle(this._state,i),i.set(e.buffer32Identity)),o<=0xffffffff)i[14]=o;else{let e=o.toString(16).match(/(.*?)(.{0,8})$/);if(null===e)return;let t=parseInt(e[2],16),r=parseInt(e[1],16)||0;i[14]=t,i[15]=r}return e._md5cycle(this._state,i),t?this._state:e._hex(this._state)}},"Md5"),tw(tz,"stateIdentity",new Int32Array([0x67452301,-0x10325477,-0x67452302,0x10325476])),tw(tz,"buffer32Identity",new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])),tw(tz,"hexChars","0123456789abcdef"),tw(tz,"hexOut",[]),tw(tz,"onePassHasher",new tz),tK=tz}),t0={};function t1(e){return crypto.getRandomValues(to.alloc(e))}function t2(e){if("sha256"===e)return{update:tp(function(e){return{digest:tp(function(){return to.from(tX(e))},"digest")}},"update")};if("md5"===e)return{update:tp(function(e){return{digest:tp(function(){return"string"==typeof e?tK.hashStr(e):tK.hashByteArray(e)},"digest")}},"update")};throw Error(`Hash type '${e}' not supported`)}function t6(e,t){if("sha256"!==e)throw Error(`\
29
- Only sha256 is supported (requested: '${e}')`);return{update:tp(function(e){return{digest:tp(function(){"string"==typeof t&&(t=new TextEncoder().encode(t)),"string"==typeof e&&(e=new TextEncoder().encode(e));let r=t.length;if(r>64)t=tX(t);else if(r<64){let e=new Uint8Array(64);e.set(t),t=e}let n=new Uint8Array(64),i=new Uint8Array(64);for(let e=0;e<64;e++)n[e]=54^t[e],i[e]=92^t[e];let s=new Uint8Array(e.length+64);s.set(n,0),s.set(e,64);let o=new Uint8Array(96);return o.set(i,0),o.set(tX(s),64),to.from(tX(o))},"digest")}},"update")}}ty(t0,{createHash:()=>t2,createHmac:()=>t6,randomBytes:()=>t1});var t3=tg(()=>{tx(),tJ(),tZ(),tp(t1,"randomBytes"),tp(t2,"createHash"),tp(t6,"createHmac")}),t5=tm((e,t)=>{tx(),t.exports={host:"localhost",user:"win32"===ta.platform?ta.env.USERNAME:ta.env.USER,database:void 0,password:null,connectionString:void 0,port:5432,rows:0,binary:!1,max:10,idleTimeoutMillis:3e4,client_encoding:"",ssl:!1,application_name:void 0,fallback_application_name:void 0,options:void 0,parseInputDatesAsUTC:!1,statement_timeout:!1,lock_timeout:!1,idle_in_transaction_session_timeout:!1,query_timeout:!1,connect_timeout:0,keepalives:1,keepalives_idle:0};var r=tQ(),n=r.getTypeParser(20,"text"),i=r.getTypeParser(1016,"text");t.exports.__defineSetter__("parseInt8",function(e){r.setTypeParser(20,"text",e?r.getTypeParser(23,"text"):n),r.setTypeParser(1016,"text",e?r.getTypeParser(1007,"text"):i)})}),t4=tm((e,t)=>{tx();var r=(t3(),t_(t0)),n=t5();function i(e){return'"'+e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'}function s(e){for(var t="{",r=0;r<e.length;r++)r>0&&(t+=","),null===e[r]||typeof e[r]>"u"?t+="NULL":Array.isArray(e[r])?t+=s(e[r]):e[r]instanceof to?t+="\\\\x"+e[r].toString("hex"):t+=i(o(e[r]));return t+"}"}tp(i,"escapeElement"),tp(s,"arrayString");var o=tp(function(e,t){if(null==e)return null;if(e instanceof to)return e;if(ArrayBuffer.isView(e)){var r=to.from(e.buffer,e.byteOffset,e.byteLength);return r.length===e.byteLength?r:r.slice(e.byteOffset,e.byteOffset+e.byteLength)}return e instanceof Date?n.parseInputDatesAsUTC?l(e):c(e):Array.isArray(e)?s(e):"object"==typeof e?a(e,t):e.toString()},"prepareValue");function a(e,t){if(e&&"function"==typeof e.toPostgres){if(-1!==(t=t||[]).indexOf(e))throw Error('circular reference detected while preparing "'+e+'" for query');return t.push(e),o(e.toPostgres(o),t)}return JSON.stringify(e)}function u(e,t){for(e=""+e;e.length<t;)e="0"+e;return e}function c(e){var t=-e.getTimezoneOffset(),r=e.getFullYear(),n=r<1;n&&(r=Math.abs(r)+1);var i=u(r,4)+"-"+u(e.getMonth()+1,2)+"-"+u(e.getDate(),2)+"T"+u(e.getHours(),2)+":"+u(e.getMinutes(),2)+":"+u(e.getSeconds(),2)+"."+u(e.getMilliseconds(),3);return t<0?(i+="-",t*=-1):i+="+",i+=u(Math.floor(t/60),2)+":"+u(t%60,2),n&&(i+=" BC"),i}function l(e){var t=e.getUTCFullYear(),r=t<1;r&&(t=Math.abs(t)+1);var n=u(t,4)+"-"+u(e.getUTCMonth()+1,2)+"-"+u(e.getUTCDate(),2)+"T"+u(e.getUTCHours(),2)+":"+u(e.getUTCMinutes(),2)+":"+u(e.getUTCSeconds(),2)+"."+u(e.getUTCMilliseconds(),3);return n+="+00:00",r&&(n+=" BC"),n}function h(e,t,r){return e="string"==typeof e?{text:e}:e,t&&("function"==typeof t?e.callback=t:e.values=t),r&&(e.callback=r),e}tp(a,"prepareObject"),tp(u,"pad"),tp(c,"dateToString"),tp(l,"dateToStringUTC"),tp(h,"normalizeQueryConfig");var f=tp(function(e){return r.createHash("md5").update(e,"utf-8").digest("hex")},"md5"),d=tp(function(e,t,r){var n=f(t+e);return"md5"+f(to.concat([to.from(n),r]))},"postgresMd5PasswordHash");t.exports={prepareValue:tp(function(e){return o(e)},"prepareValueWrapper"),normalizeQueryConfig:h,postgresMd5PasswordHash:d,md5:f}}),t8={};ty(t8,{default:()=>t9});var t9,t7=tg(()=>{tx(),t9={}}),re=tm((e,t)=>{tx();var r=(t3(),t_(t0));function n(e){if(-1===e.indexOf("SCRAM-SHA-256"))throw Error("SASL: Only mechanism SCRAM-SHA-256 is currently supported");let t=r.randomBytes(18).toString("base64");return{mechanism:"SCRAM-SHA-256",clientNonce:t,response:"n,,n=*,r="+t,message:"SASLInitialResponse"}}function i(e,t,r){if("SASLInitialResponse"!==e.message)throw Error("SASL: Last message was not SASLInitialResponse");if("string"!=typeof t)throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string");if("string"!=typeof r)throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: serverData must be a string");let n=c(r);if(n.nonce.startsWith(e.clientNonce)){if(n.nonce.length===e.clientNonce.length)throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce is too short")}else throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with client nonce");var i=p(t,to.from(n.salt,"base64"),n.iteration),s=d(i,"Client Key"),o=f(s),a="n=*,r="+e.clientNonce,u="r="+n.nonce+",s="+n.salt+",i="+n.iteration,l="c=biws,r="+n.nonce,g=a+","+u+","+l,m=h(s,d(o,g)).toString("base64"),y=d(i,"Server Key"),b=d(y,g);e.message="SASLResponse",e.serverSignature=b.toString("base64"),e.response=l+",p="+m}function s(e,t){if("SASLResponse"!==e.message)throw Error("SASL: Last message was not SASLResponse");if("string"!=typeof t)throw Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: serverData must be a string");let{serverSignature:r}=l(t);if(r!==e.serverSignature)throw Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature does not match")}function o(e){if("string"!=typeof e)throw TypeError("SASL: text must be a string");return e.split("").map((t,r)=>e.charCodeAt(r)).every(e=>e>=33&&e<=43||e>=45&&e<=126)}function a(e){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/.test(e)}function u(e){if("string"!=typeof e)throw TypeError("SASL: attribute pairs text must be a string");return new Map(e.split(",").map(e=>{if(!/^.=/.test(e))throw Error("SASL: Invalid attribute pair entry");return[e[0],e.substring(2)]}))}function c(e){let t=u(e),r=t.get("r");if(r){if(!o(r))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce must only contain printable characters")}else throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing");let n=t.get("s");if(n){if(!a(n))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt must be base64")}else throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing");let i=t.get("i");if(i){if(!/^[1-9][0-9]*$/.test(i))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: invalid iteration count")}else throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: iteration missing");return{nonce:r,salt:n,iteration:parseInt(i,10)}}function l(e){let t=u(e).get("v");if(t){if(!a(t))throw Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature must be base64")}else throw Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature is missing");return{serverSignature:t}}function h(e,t){if(!to.isBuffer(e))throw TypeError("first argument must be a Buffer");if(!to.isBuffer(t))throw TypeError("second argument must be a Buffer");if(e.length!==t.length)throw Error("Buffer lengths must match");if(0===e.length)throw Error("Buffers cannot be empty");return to.from(e.map((r,n)=>e[n]^t[n]))}function f(e){return r.createHash("sha256").update(e).digest()}function d(e,t){return r.createHmac("sha256",e).update(t).digest()}function p(e,t,r){for(var n=d(e,to.concat([t,to.from([0,0,0,1])])),i=n,s=0;s<r-1;s++)i=h(i,n=d(e,n));return i}tp(n,"startSession"),tp(i,"continueSession"),tp(s,"finalizeSession"),tp(o,"isPrintableChars"),tp(a,"isBase64"),tp(u,"parseAttributePairs"),tp(c,"parseServerFirstMessage"),tp(l,"parseServerFinalMessage"),tp(h,"xorBuffers"),tp(f,"sha256"),tp(d,"hmacSha256"),tp(p,"Hi"),t.exports={startSession:n,continueSession:i,finalizeSession:s}}),rt={};function rr(...e){return e.join("/")}ty(rt,{join:()=>rr});var rn=tg(()=>{tx(),tp(rr,"join")}),ri={};function rs(e,t){t(Error("No filesystem"))}ty(ri,{stat:()=>rs});var ro=tg(()=>{tx(),tp(rs,"stat")}),ra={};ty(ra,{default:()=>ru});var ru,rc=tg(()=>{tx(),ru={}}),rl={};ty(rl,{StringDecoder:()=>rf});var rh,rf,rd=tg(()=>{tx(),tp(rh=class{constructor(e){tw(this,"td"),this.td=new TextDecoder(e)}write(e){return this.td.decode(e,{stream:!0})}end(e){return this.td.decode(e)}},"StringDecoder"),rf=rh}),rp=tm((e,t)=>{tx();var{Transform:r}=(rc(),t_(ra)),{StringDecoder:n}=(rd(),t_(rl)),i=Symbol("last"),s=Symbol("decoder");function o(e,t,r){let n;if(this.overflow){if(1===(n=this[s].write(e).split(this.matcher)).length)return r();n.shift(),this.overflow=!1}else this[i]+=this[s].write(e),n=this[i].split(this.matcher);this[i]=n.pop();for(let e=0;e<n.length;e++)try{u(this,this.mapper(n[e]))}catch(e){return r(e)}if(this.overflow=this[i].length>this.maxLength,this.overflow&&!this.skipOverflow)return void r(Error("maximum buffer reached"));r()}function a(e){if(this[i]+=this[s].end(),this[i])try{u(this,this.mapper(this[i]))}catch(t){return e(t)}e()}function u(e,t){void 0!==t&&e.push(t)}function c(e){return e}function l(e,t,u){switch(e=e||/\r?\n/,t=t||c,u=u||{},arguments.length){case 1:"function"==typeof e?(t=e,e=/\r?\n/):"object"!=typeof e||e instanceof RegExp||e[Symbol.split]||(u=e,e=/\r?\n/);break;case 2:"function"==typeof e?(u=t,t=e,e=/\r?\n/):"object"==typeof t&&(u=t,t=c)}(u=Object.assign({},u)).autoDestroy=!0,u.transform=o,u.flush=a,u.readableObjectMode=!0;let l=new r(u);return l[i]="",l[s]=new n("utf8"),l.matcher=e,l.mapper=t,l.maxLength=u.maxLength,l.skipOverflow=u.skipOverflow||!1,l.overflow=!1,l._destroy=function(e,t){this._writableState.errorEmitted=!1,t(e)},l}tp(o,"transform"),tp(a,"flush"),tp(u,"push"),tp(c,"noop"),tp(l,"split"),t.exports=l}),rg=tm((e,t)=>{tx();var r=(rn(),t_(rt)),n=(rc(),t_(ra)).Stream,i=rp(),s=(t7(),t_(t8)),o="win32"===ta.platform,a=ta.stderr;function u(e){return(61440&e)==32768}tp(u,"isRegFile");var c=["host","port","database","user","password"],l=c.length,h=c[l-1];function f(){if(a instanceof n&&!0===a.writable){var e=Array.prototype.slice.call(arguments).concat(`
30
- `);a.write(s.format.apply(s,e))}}tp(f,"warn"),Object.defineProperty(t.exports,"isWin",{get:tp(function(){return o},"get"),set:tp(function(e){o=e},"set")}),t.exports.warnTo=function(e){var t=a;return a=e,t},t.exports.getFileName=function(e){var t=e||ta.env;return t.PGPASSFILE||(o?r.join(t.APPDATA||"./","postgresql","pgpass.conf"):r.join(t.HOME||"./",".pgpass"))},t.exports.usePgPass=function(e,t){return!Object.prototype.hasOwnProperty.call(ta.env,"PGPASSWORD")&&(!!o||(t=t||"<unkn>",u(e.mode)?!(63&e.mode)||(f('WARNING: password file "%s" has group or world access; permissions should be u=rw (0600) or less',t),!1):(f('WARNING: password file "%s" is not a plain file',t),!1)))};var d=t.exports.match=function(e,t){return c.slice(0,-1).reduce(function(r,n,i){return 1==i&&Number(e[n]||5432)===Number(t[n])?r&&!0:r&&("*"===t[n]||t[n]===e[n])},!0)};t.exports.getPassword=function(e,t,r){var n,s=t.pipe(i());function o(t){var r=p(t);r&&g(r)&&d(e,r)&&(n=r[h],s.end())}tp(o,"onLine");var a=tp(function(){t.destroy(),r(n)},"onEnd"),u=tp(function(e){t.destroy(),f("WARNING: error on reading file: %s",e),r(void 0)},"onErr");t.on("error",u),s.on("data",o).on("end",a).on("error",u)};var p=t.exports.parseLine=function(e){if(e.length<11||e.match(/^\s+#/))return null;for(var t="",r="",n=0,i=0,s={},o=tp(function(t,r,n){var i=e.substring(r,n);Object.hasOwnProperty.call(ta.env,"PGPASS_NO_DEESCAPE")||(i=i.replace(/\\([:\\])/g,"$1")),s[c[t]]=i},"addToObj"),a=0;a<e.length-1;a+=1){if(t=e.charAt(a+1),r=e.charAt(a),n==l-1){o(n,i);break}a>=0&&":"==t&&"\\"!==r&&(o(n,i,a+1),i=a+2,n+=1)}return s=Object.keys(s).length===l?s:null},g=t.exports.isValidEntry=function(e){for(var t={0:function(e){return e.length>0},1:function(e){return"*"===e||isFinite(e=Number(e))&&e>0&&e<0x20000000000000&&Math.floor(e)===e},2:function(e){return e.length>0},3:function(e){return e.length>0},4:function(e){return e.length>0}},r=0;r<c.length;r+=1)if(!(0,t[r])(e[c[r]]||""))return!1;return!0}}),rm=tm((e,t)=>{tx(),rn(),t_(rt);var r=(ro(),t_(ri)),n=rg();t.exports=function(e,t){var i=n.getFileName();r.stat(i,function(s,o){if(s||!n.usePgPass(o,i))return t(void 0);var a=r.createReadStream(i);n.getPassword(e,a,t)})},t.exports.warnTo=n.warnTo}),ry={};ty(ry,{default:()=>rb});var rb,rv=tg(()=>{tx(),rb={}}),r_=tm((e,t)=>{tx();var r=(tk(),t_(tM)),n=(ro(),t_(ri));function i(e){if("/"===e.charAt(0)){var t=e.split(" ");return{host:t[0],database:t[1]}}var i=r.parse(/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i.test(e)?encodeURI(e).replace(/\%25(\d\d)/g,"%$1"):e,!0),t=i.query;for(var s in t)Array.isArray(t[s])&&(t[s]=t[s][t[s].length-1]);var o=(i.auth||":").split(":");if(t.user=o[0],t.password=o.splice(1).join(":"),t.port=i.port,"socket:"==i.protocol)return t.host=decodeURI(i.pathname),t.database=i.query.db,t.client_encoding=i.query.encoding,t;t.host||(t.host=i.hostname);var a=i.pathname;if(!t.host&&a&&/^%2f/i.test(a)){var u=a.split("/");t.host=decodeURIComponent(u[0]),a=u.splice(1).join("/")}switch(a&&"/"===a.charAt(0)&&(a=a.slice(1)||null),t.database=a&&decodeURI(a),("true"===t.ssl||"1"===t.ssl)&&(t.ssl=!0),"0"===t.ssl&&(t.ssl=!1),(t.sslcert||t.sslkey||t.sslrootcert||t.sslmode)&&(t.ssl={}),t.sslcert&&(t.ssl.cert=n.readFileSync(t.sslcert).toString()),t.sslkey&&(t.ssl.key=n.readFileSync(t.sslkey).toString()),t.sslrootcert&&(t.ssl.ca=n.readFileSync(t.sslrootcert).toString()),t.sslmode){case"disable":t.ssl=!1;break;case"prefer":case"require":case"verify-ca":case"verify-full":break;case"no-verify":t.ssl.rejectUnauthorized=!1}return t}tp(i,"parse"),t.exports=i,i.parse=i}),rw=tm((e,t)=>{tx();var r=(rv(),t_(ry)),n=t5(),i=r_().parse,s=tp(function(e,t,r){return void 0===r?r=ta.env["PG"+e.toUpperCase()]:!1===r||(r=ta.env[r]),t[e]||r||n[e]},"val"),o=tp(function(){switch(ta.env.PGSSLMODE){case"disable":return!1;case"prefer":case"require":case"verify-ca":case"verify-full":return!0;case"no-verify":return{rejectUnauthorized:!1}}return n.ssl},"readSSLConfigFromEnvironment"),a=tp(function(e){return"'"+(""+e).replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"},"quoteParamValue"),u=tp(function(e,t,r){var n=t[r];null!=n&&e.push(r+"="+a(n))},"add"),c=class{constructor(e){(e="string"==typeof e?i(e):e||{}).connectionString&&(e=Object.assign({},e,i(e.connectionString))),this.user=s("user",e),this.database=s("database",e),void 0===this.database&&(this.database=this.user),this.port=parseInt(s("port",e),10),this.host=s("host",e),Object.defineProperty(this,"password",{configurable:!0,enumerable:!1,writable:!0,value:s("password",e)}),this.binary=s("binary",e),this.options=s("options",e),this.ssl=typeof e.ssl>"u"?o():e.ssl,"string"==typeof this.ssl&&"true"===this.ssl&&(this.ssl=!0),"no-verify"===this.ssl&&(this.ssl={rejectUnauthorized:!1}),this.ssl&&this.ssl.key&&Object.defineProperty(this.ssl,"key",{enumerable:!1}),this.client_encoding=s("client_encoding",e),this.replication=s("replication",e),this.isDomainSocket=!(this.host||"").indexOf("/"),this.application_name=s("application_name",e,"PGAPPNAME"),this.fallback_application_name=s("fallback_application_name",e,!1),this.statement_timeout=s("statement_timeout",e,!1),this.lock_timeout=s("lock_timeout",e,!1),this.idle_in_transaction_session_timeout=s("idle_in_transaction_session_timeout",e,!1),this.query_timeout=s("query_timeout",e,!1),void 0===e.connectionTimeoutMillis?this.connect_timeout=ta.env.PGCONNECT_TIMEOUT||0:this.connect_timeout=Math.floor(e.connectionTimeoutMillis/1e3),!1===e.keepAlive?this.keepalives=0:!0===e.keepAlive&&(this.keepalives=1),"number"==typeof e.keepAliveInitialDelayMillis&&(this.keepalives_idle=Math.floor(e.keepAliveInitialDelayMillis/1e3))}getLibpqConnectionString(e){var t=[];u(t,this,"user"),u(t,this,"password"),u(t,this,"port"),u(t,this,"application_name"),u(t,this,"fallback_application_name"),u(t,this,"connect_timeout"),u(t,this,"options");var n="object"==typeof this.ssl?this.ssl:this.ssl?{sslmode:this.ssl}:{};if(u(t,n,"sslmode"),u(t,n,"sslca"),u(t,n,"sslkey"),u(t,n,"sslcert"),u(t,n,"sslrootcert"),this.database&&t.push("dbname="+a(this.database)),this.replication&&t.push("replication="+a(this.replication)),this.host&&t.push("host="+a(this.host)),this.isDomainSocket)return e(null,t.join(" "));this.client_encoding&&t.push("client_encoding="+a(this.client_encoding)),r.lookup(this.host,function(r,n){return r?e(r,null):(t.push("hostaddr="+a(n)),e(null,t.join(" ")))})}};tp(c,"ConnectionParameters"),t.exports=c}),rE=tm((e,t)=>{tx();var r=tQ(),n=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/,i=class{constructor(e,t){this.command=null,this.rowCount=null,this.oid=null,this.rows=[],this.fields=[],this._parsers=void 0,this._types=t,this.RowCtor=null,this.rowAsArray="array"===e,this.rowAsArray&&(this.parseRow=this._parseRowAsArray)}addCommandComplete(e){var t;(t=e.text?n.exec(e.text):n.exec(e.command))&&(this.command=t[1],t[3]?(this.oid=parseInt(t[2],10),this.rowCount=parseInt(t[3],10)):t[2]&&(this.rowCount=parseInt(t[2],10)))}_parseRowAsArray(e){for(var t=Array(e.length),r=0,n=e.length;r<n;r++){var i=e[r];null!==i?t[r]=this._parsers[r](i):t[r]=null}return t}parseRow(e){for(var t={},r=0,n=e.length;r<n;r++){var i=e[r],s=this.fields[r].name;null!==i?t[s]=this._parsers[r](i):t[s]=null}return t}addRow(e){this.rows.push(e)}addFields(e){this.fields=e,this.fields.length&&(this._parsers=Array(e.length));for(var t=0;t<e.length;t++){var n=e[t];this._types?this._parsers[t]=this._types.getTypeParser(n.dataTypeID,n.format||"text"):this._parsers[t]=r.getTypeParser(n.dataTypeID,n.format||"text")}}};tp(i,"Result"),t.exports=i}),rS=tm((e,t)=>{tx();var{EventEmitter:r}=tA(),n=rE(),i=t4(),s=class extends r{constructor(e,t,r){super(),e=i.normalizeQueryConfig(e,t,r),this.text=e.text,this.values=e.values,this.rows=e.rows,this.types=e.types,this.name=e.name,this.binary=e.binary,this.portal=e.portal||"",this.callback=e.callback,this._rowMode=e.rowMode,ta.domain&&e.callback&&(this.callback=ta.domain.bind(e.callback)),this._result=new n(this._rowMode,this.types),this._results=this._result,this.isPreparedStatement=!1,this._canceledDueToError=!1,this._promise=null}requiresPreparation(){return!!this.name||!!this.rows||!!this.text&&!!this.values&&this.values.length>0}_checkForMultirow(){this._result.command&&(Array.isArray(this._results)||(this._results=[this._result]),this._result=new n(this._rowMode,this.types),this._results.push(this._result))}handleRowDescription(e){this._checkForMultirow(),this._result.addFields(e.fields),this._accumulateRows=this.callback||!this.listeners("row").length}handleDataRow(e){let t;if(!this._canceledDueToError){try{t=this._result.parseRow(e.fields)}catch(e){this._canceledDueToError=e;return}this.emit("row",t,this._result),this._accumulateRows&&this._result.addRow(t)}}handleCommandComplete(e,t){this._checkForMultirow(),this._result.addCommandComplete(e),this.rows&&t.sync()}handleEmptyQuery(e){this.rows&&e.sync()}handleError(e,t){if(this._canceledDueToError&&(e=this._canceledDueToError,this._canceledDueToError=!1),this.callback)return this.callback(e);this.emit("error",e)}handleReadyForQuery(e){if(this._canceledDueToError)return this.handleError(this._canceledDueToError,e);if(this.callback)try{this.callback(null,this._results)}catch(e){ta.nextTick(()=>{throw e})}this.emit("end",this._results)}submit(e){if("string"!=typeof this.text&&"string"!=typeof this.name)return Error("A query must have either text or a name. Supplying neither is unsupported.");let t=e.parsedStatements[this.name];return this.text&&t&&this.text!==t?Error(`Prepared statements must be unique - '${this.name}\
31
- ' was used for a different statement`):this.values&&!Array.isArray(this.values)?Error("Query values must be an array"):(this.requiresPreparation()?this.prepare(e):e.query(this.text),null)}hasBeenParsed(e){return this.name&&e.parsedStatements[this.name]}handlePortalSuspended(e){this._getRows(e,this.rows)}_getRows(e,t){e.execute({portal:this.portal,rows:t}),t?e.flush():e.sync()}prepare(e){this.isPreparedStatement=!0,this.hasBeenParsed(e)||e.parse({text:this.text,name:this.name,types:this.types});try{e.bind({portal:this.portal,statement:this.name,values:this.values,binary:this.binary,valueMapper:i.prepareValue})}catch(t){this.handleError(t,e);return}e.describe({type:"P",name:this.portal||""}),this._getRows(e,this.rows)}handleCopyInResponse(e){e.sendCopyFail("No source stream defined")}handleCopyData(e,t){}};tp(s,"Query"),t.exports=s}),rR=tm(e=>{tx(),Object.defineProperty(e,"__esModule",{value:!0}),e.NoticeMessage=e.DataRowMessage=e.CommandCompleteMessage=e.ReadyForQueryMessage=e.NotificationResponseMessage=e.BackendKeyDataMessage=e.AuthenticationMD5Password=e.ParameterStatusMessage=e.ParameterDescriptionMessage=e.RowDescriptionMessage=e.Field=e.CopyResponse=e.CopyDataMessage=e.DatabaseError=e.copyDone=e.emptyQuery=e.replicationStart=e.portalSuspended=e.noData=e.closeComplete=e.bindComplete=e.parseComplete=void 0,e.parseComplete={name:"parseComplete",length:5},e.bindComplete={name:"bindComplete",length:5},e.closeComplete={name:"closeComplete",length:5},e.noData={name:"noData",length:5},e.portalSuspended={name:"portalSuspended",length:5},e.replicationStart={name:"replicationStart",length:4},e.emptyQuery={name:"emptyQuery",length:4},e.copyDone={name:"copyDone",length:4};var t=class extends Error{constructor(e,t,r){super(e),this.length=t,this.name=r}};tp(t,"DatabaseError"),e.DatabaseError=t;var r=class{constructor(e,t){this.length=e,this.chunk=t,this.name="copyData"}};tp(r,"CopyDataMessage"),e.CopyDataMessage=r;var n=class{constructor(e,t,r,n){this.length=e,this.name=t,this.binary=r,this.columnTypes=Array(n)}};tp(n,"CopyResponse"),e.CopyResponse=n;var i=class{constructor(e,t,r,n,i,s,o){this.name=e,this.tableID=t,this.columnID=r,this.dataTypeID=n,this.dataTypeSize=i,this.dataTypeModifier=s,this.format=o}};tp(i,"Field"),e.Field=i;var s=class{constructor(e,t){this.length=e,this.fieldCount=t,this.name="rowDescription",this.fields=Array(this.fieldCount)}};tp(s,"RowDescriptionMessage"),e.RowDescriptionMessage=s;var o=class{constructor(e,t){this.length=e,this.parameterCount=t,this.name="parameterDescription",this.dataTypeIDs=Array(this.parameterCount)}};tp(o,"ParameterDescriptionMessage"),e.ParameterDescriptionMessage=o;var a=class{constructor(e,t,r){this.length=e,this.parameterName=t,this.parameterValue=r,this.name="parameterStatus"}};tp(a,"ParameterStatusMessage"),e.ParameterStatusMessage=a;var u=class{constructor(e,t){this.length=e,this.salt=t,this.name="authenticationMD5Password"}};tp(u,"AuthenticationMD5Password"),e.AuthenticationMD5Password=u;var c=class{constructor(e,t,r){this.length=e,this.processID=t,this.secretKey=r,this.name="backendKeyData"}};tp(c,"BackendKeyDataMessage"),e.BackendKeyDataMessage=c;var l=class{constructor(e,t,r,n){this.length=e,this.processId=t,this.channel=r,this.payload=n,this.name="notification"}};tp(l,"NotificationResponseMessage"),e.NotificationResponseMessage=l;var h=class{constructor(e,t){this.length=e,this.status=t,this.name="readyForQuery"}};tp(h,"ReadyForQueryMessage"),e.ReadyForQueryMessage=h;var f=class{constructor(e,t){this.length=e,this.text=t,this.name="commandComplete"}};tp(f,"CommandCompleteMessage"),e.CommandCompleteMessage=f;var d=class{constructor(e,t){this.length=e,this.fields=t,this.name="dataRow",this.fieldCount=t.length}};tp(d,"DataRowMessage"),e.DataRowMessage=d;var p=class{constructor(e,t){this.length=e,this.message=t,this.name="notice"}};tp(p,"NoticeMessage"),e.NoticeMessage=p}),rx=tm(e=>{tx(),Object.defineProperty(e,"__esModule",{value:!0}),e.Writer=void 0;var t=class{constructor(e=256){this.size=e,this.offset=5,this.headerPosition=0,this.buffer=to.allocUnsafe(e)}ensure(e){if(this.buffer.length-this.offset<e){let t=this.buffer,r=t.length+(t.length>>1)+e;this.buffer=to.allocUnsafe(r),t.copy(this.buffer)}}addInt32(e){return this.ensure(4),this.buffer[this.offset++]=e>>>24&255,this.buffer[this.offset++]=e>>>16&255,this.buffer[this.offset++]=e>>>8&255,this.buffer[this.offset++]=e>>>0&255,this}addInt16(e){return this.ensure(2),this.buffer[this.offset++]=e>>>8&255,this.buffer[this.offset++]=e>>>0&255,this}addCString(e){if(e){let t=to.byteLength(e);this.ensure(t+1),this.buffer.write(e,this.offset,"utf-8"),this.offset+=t}else this.ensure(1);return this.buffer[this.offset++]=0,this}addString(e=""){let t=to.byteLength(e);return this.ensure(t),this.buffer.write(e,this.offset),this.offset+=t,this}add(e){return this.ensure(e.length),e.copy(this.buffer,this.offset),this.offset+=e.length,this}join(e){if(e){this.buffer[this.headerPosition]=e;let t=this.offset-(this.headerPosition+1);this.buffer.writeInt32BE(t,this.headerPosition+1)}return this.buffer.slice(5*!e,this.offset)}flush(e){let t=this.join(e);return this.offset=5,this.headerPosition=0,this.buffer=to.allocUnsafe(this.size),t}};tp(t,"Writer"),e.Writer=t}),rA=tm(e=>{tx(),Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=void 0;var t=rx(),r=new t.Writer,n=tp(e=>{for(let t of(r.addInt16(3).addInt16(0),Object.keys(e)))r.addCString(t).addCString(e[t]);r.addCString("client_encoding").addCString("UTF8");let n=r.addCString("").flush(),i=n.length+4;return new t.Writer().addInt32(i).add(n).flush()},"startup"),i=tp(()=>{let e=to.allocUnsafe(8);return e.writeInt32BE(8,0),e.writeInt32BE(0x4d2162f,4),e},"requestSsl"),s=tp(e=>r.addCString(e).flush(112),"password"),o=tp(function(e,t){return r.addCString(e).addInt32(to.byteLength(t)).addString(t),r.flush(112)},"sendSASLInitialResponseMessage"),a=tp(function(e){return r.addString(e).flush(112)},"sendSCRAMClientFinalMessage"),u=tp(e=>r.addCString(e).flush(81),"query"),c=[],l=tp(e=>{let t=e.name||"";t.length>63&&(console.error("Warning! Postgres only supports 63 characters for query names."),console.error("You supplied %s (%s)",t,t.length),console.error("This can cause conflicts and silent errors executing queries"));let n=e.types||c,i=n.length,s=r.addCString(t).addCString(e.text).addInt16(i);for(let e=0;e<i;e++)s.addInt32(n[e]);return r.flush(80)},"parse"),h=new t.Writer,f=tp(function(e,t){for(let n=0;n<e.length;n++){let i=t?t(e[n],n):e[n];null==i?(r.addInt16(0),h.addInt32(-1)):i instanceof to?(r.addInt16(1),h.addInt32(i.length),h.add(i)):(r.addInt16(0),h.addInt32(to.byteLength(i)),h.addString(i))}},"writeValues"),d=tp((e={})=>{let t=e.portal||"",n=e.statement||"",i=e.binary||!1,s=e.values||c,o=s.length;return r.addCString(t).addCString(n),r.addInt16(o),f(s,e.valueMapper),r.addInt16(o),r.add(h.flush()),r.addInt16(+!!i),r.flush(66)},"bind"),p=to.from([69,0,0,0,9,0,0,0,0,0]),g=tp(e=>{if(!e||!e.portal&&!e.rows)return p;let t=e.portal||"",r=e.rows||0,n=to.byteLength(t),i=4+n+1+4,s=to.allocUnsafe(1+i);return s[0]=69,s.writeInt32BE(i,1),s.write(t,5,"utf-8"),s[n+5]=0,s.writeUInt32BE(r,s.length-4),s},"execute"),m=tp((e,t)=>{let r=to.allocUnsafe(16);return r.writeInt32BE(16,0),r.writeInt16BE(1234,4),r.writeInt16BE(5678,6),r.writeInt32BE(e,8),r.writeInt32BE(t,12),r},"cancel"),y=tp((e,t)=>{let r=4+to.byteLength(t)+1,n=to.allocUnsafe(1+r);return n[0]=e,n.writeInt32BE(r,1),n.write(t,5,"utf-8"),n[r]=0,n},"cstringMessage"),b=r.addCString("P").flush(68),v=r.addCString("S").flush(68),_=tp(e=>e.name?y(68,`${e.type}${e.name||""}`):"P"===e.type?b:v,"describe"),w=tp(e=>y(67,`${e.type}${e.name||""}`),"close"),E=tp(e=>r.add(e).flush(100),"copyData"),S=tp(e=>y(102,e),"copyFail"),R=tp(e=>to.from([e,0,0,0,4]),"codeOnlyBuffer"),x=R(72),A=R(83),T=R(88),P=R(99);e.serialize={startup:n,password:s,requestSsl:i,sendSASLInitialResponseMessage:o,sendSCRAMClientFinalMessage:a,query:u,parse:l,bind:d,execute:g,describe:_,close:w,flush:tp(()=>x,"flush"),sync:tp(()=>A,"sync"),end:tp(()=>T,"end"),copyData:E,copyDone:tp(()=>P,"copyDone"),copyFail:S,cancel:m}}),rT=tm(e=>{tx(),Object.defineProperty(e,"__esModule",{value:!0}),e.BufferReader=void 0;var t=to.allocUnsafe(0),r=class{constructor(e=0){this.offset=e,this.buffer=t,this.encoding="utf-8"}setBuffer(e,t){this.offset=e,this.buffer=t}int16(){let e=this.buffer.readInt16BE(this.offset);return this.offset+=2,e}byte(){let e=this.buffer[this.offset];return this.offset++,e}int32(){let e=this.buffer.readInt32BE(this.offset);return this.offset+=4,e}uint32(){let e=this.buffer.readUInt32BE(this.offset);return this.offset+=4,e}string(e){let t=this.buffer.toString(this.encoding,this.offset,this.offset+e);return this.offset+=e,t}cstring(){let e=this.offset,t=e;for(;0!==this.buffer[t++];);return this.offset=t,this.buffer.toString(this.encoding,e,t-1)}bytes(e){let t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}};tp(r,"BufferReader"),e.BufferReader=r}),rP=tm(e=>{tx(),Object.defineProperty(e,"__esModule",{value:!0}),e.Parser=void 0;var t=rR(),r=rT(),n=to.allocUnsafe(0),i=class{constructor(e){if(this.buffer=n,this.bufferLength=0,this.bufferOffset=0,this.reader=new r.BufferReader,e?.mode==="binary")throw Error("Binary mode not supported yet");this.mode=e?.mode||"text"}parse(e,t){this.mergeBuffer(e);let r=this.bufferOffset+this.bufferLength,i=this.bufferOffset;for(;i+5<=r;){let e=this.buffer[i],n=this.buffer.readUInt32BE(i+1),s=1+n;if(s+i<=r)t(this.handlePacket(i+5,e,n,this.buffer)),i+=s;else break}i===r?(this.buffer=n,this.bufferLength=0,this.bufferOffset=0):(this.bufferLength=r-i,this.bufferOffset=i)}mergeBuffer(e){if(this.bufferLength>0){let t=this.bufferLength+e.byteLength;if(t+this.bufferOffset>this.buffer.byteLength){let e;if(t<=this.buffer.byteLength&&this.bufferOffset>=this.bufferLength)e=this.buffer;else{let r=2*this.buffer.byteLength;for(;t>=r;)r*=2;e=to.allocUnsafe(r)}this.buffer.copy(e,0,this.bufferOffset,this.bufferOffset+this.bufferLength),this.buffer=e,this.bufferOffset=0}e.copy(this.buffer,this.bufferOffset+this.bufferLength),this.bufferLength=t}else this.buffer=e,this.bufferOffset=0,this.bufferLength=e.byteLength}handlePacket(e,r,n,i){switch(r){case 50:return t.bindComplete;case 49:return t.parseComplete;case 51:return t.closeComplete;case 110:return t.noData;case 115:return t.portalSuspended;case 99:return t.copyDone;case 87:return t.replicationStart;case 73:return t.emptyQuery;case 68:return this.parseDataRowMessage(e,n,i);case 67:return this.parseCommandCompleteMessage(e,n,i);case 90:return this.parseReadyForQueryMessage(e,n,i);case 65:return this.parseNotificationMessage(e,n,i);case 82:return this.parseAuthenticationResponse(e,n,i);case 83:return this.parseParameterStatusMessage(e,n,i);case 75:return this.parseBackendKeyData(e,n,i);case 69:return this.parseErrorMessage(e,n,i,"error");case 78:return this.parseErrorMessage(e,n,i,"notice");case 84:return this.parseRowDescriptionMessage(e,n,i);case 116:return this.parseParameterDescriptionMessage(e,n,i);case 71:return this.parseCopyInMessage(e,n,i);case 72:return this.parseCopyOutMessage(e,n,i);case 100:return this.parseCopyData(e,n,i);default:return new t.DatabaseError("received invalid response: "+r.toString(16),n,"error")}}parseReadyForQueryMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.string(1);return new t.ReadyForQueryMessage(r,i)}parseCommandCompleteMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.cstring();return new t.CommandCompleteMessage(r,i)}parseCopyData(e,r,n){let i=n.slice(e,e+(r-4));return new t.CopyDataMessage(r,i)}parseCopyInMessage(e,t,r){return this.parseCopyMessage(e,t,r,"copyInResponse")}parseCopyOutMessage(e,t,r){return this.parseCopyMessage(e,t,r,"copyOutResponse")}parseCopyMessage(e,r,n,i){this.reader.setBuffer(e,n);let s=0!==this.reader.byte(),o=this.reader.int16(),a=new t.CopyResponse(r,i,s,o);for(let e=0;e<o;e++)a.columnTypes[e]=this.reader.int16();return a}parseNotificationMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.int32(),s=this.reader.cstring(),o=this.reader.cstring();return new t.NotificationResponseMessage(r,i,s,o)}parseRowDescriptionMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.int16(),s=new t.RowDescriptionMessage(r,i);for(let e=0;e<i;e++)s.fields[e]=this.parseField();return s}parseField(){let e=this.reader.cstring(),r=this.reader.uint32(),n=this.reader.int16(),i=this.reader.uint32(),s=this.reader.int16(),o=this.reader.int32(),a=0===this.reader.int16()?"text":"binary";return new t.Field(e,r,n,i,s,o,a)}parseParameterDescriptionMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.int16(),s=new t.ParameterDescriptionMessage(r,i);for(let e=0;e<i;e++)s.dataTypeIDs[e]=this.reader.int32();return s}parseDataRowMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.int16(),s=Array(i);for(let e=0;e<i;e++){let t=this.reader.int32();s[e]=-1===t?null:this.reader.string(t)}return new t.DataRowMessage(r,s)}parseParameterStatusMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.cstring(),s=this.reader.cstring();return new t.ParameterStatusMessage(r,i,s)}parseBackendKeyData(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.int32(),s=this.reader.int32();return new t.BackendKeyDataMessage(r,i,s)}parseAuthenticationResponse(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.int32(),s={name:"authenticationOk",length:r};switch(i){case 0:break;case 3:8===s.length&&(s.name="authenticationCleartextPassword");break;case 5:if(12===s.length){s.name="authenticationMD5Password";let e=this.reader.bytes(4);return new t.AuthenticationMD5Password(r,e)}break;case 10:{let e;s.name="authenticationSASL",s.mechanisms=[];do(e=this.reader.cstring())&&s.mechanisms.push(e);while(e)}break;case 11:s.name="authenticationSASLContinue",s.data=this.reader.string(r-8);break;case 12:s.name="authenticationSASLFinal",s.data=this.reader.string(r-8);break;default:throw Error("Unknown authenticationOk message type "+i)}return s}parseErrorMessage(e,r,n,i){this.reader.setBuffer(e,n);let s={},o=this.reader.string(1);for(;"\0"!==o;)s[o]=this.reader.cstring(),o=this.reader.string(1);let a=s.M,u="notice"===i?new t.NoticeMessage(r,a):new t.DatabaseError(a,r,i);return u.severity=s.S,u.code=s.C,u.detail=s.D,u.hint=s.H,u.position=s.P,u.internalPosition=s.p,u.internalQuery=s.q,u.where=s.W,u.schema=s.s,u.table=s.t,u.column=s.c,u.dataType=s.d,u.constraint=s.n,u.file=s.F,u.line=s.L,u.routine=s.R,u}};tp(i,"Parser"),e.Parser=i}),rO=tm(e=>{tx(),Object.defineProperty(e,"__esModule",{value:!0}),e.DatabaseError=e.serialize=e.parse=void 0;var t=rR();Object.defineProperty(e,"DatabaseError",{enumerable:!0,get:tp(function(){return t.DatabaseError},"get")});var r=rA();Object.defineProperty(e,"serialize",{enumerable:!0,get:tp(function(){return r.serialize},"get")});var n=rP();function i(e,t){let r=new n.Parser;return e.on("data",e=>r.parse(e,t)),new Promise(t=>e.on("end",()=>t()))}tp(i,"parse"),e.parse=i}),rC={};function rI({socket:e,servername:t}){return e.startTls(t),e}ty(rC,{connect:()=>rI});var rN=tg(()=>{tx(),tp(rI,"connect")}),rL=tm((e,t)=>{tx();var r=(tL(),t_(tT)),n=tA().EventEmitter,{parse:i,serialize:s}=rO(),o=s.flush(),a=s.sync(),u=s.end(),c=class extends n{constructor(e){super(),e=e||{},this.stream=e.stream||new r.Socket,this._keepAlive=e.keepAlive,this._keepAliveInitialDelayMillis=e.keepAliveInitialDelayMillis,this.lastBuffer=!1,this.parsedStatements={},this.ssl=e.ssl||!1,this._ending=!1,this._emitMessage=!1;var t=this;this.on("newListener",function(e){"message"===e&&(t._emitMessage=!0)})}connect(e,t){var n=this;this._connecting=!0,this.stream.setNoDelay(!0),this.stream.connect(e,t),this.stream.once("connect",function(){n._keepAlive&&n.stream.setKeepAlive(!0,n._keepAliveInitialDelayMillis),n.emit("connect")});let i=tp(function(e){n._ending&&("ECONNRESET"===e.code||"EPIPE"===e.code)||n.emit("error",e)},"reportStreamError");if(this.stream.on("error",i),this.stream.on("close",function(){n.emit("end")}),!this.ssl)return this.attachListeners(this.stream);this.stream.once("data",function(e){switch(e.toString("utf8")){case"S":break;case"N":return n.stream.end(),n.emit("error",Error("The server does not support SSL connections"));default:return n.stream.end(),n.emit("error",Error("There was an error establishing an SSL connection"))}var s=(rN(),t_(rC));let o={socket:n.stream};!0!==n.ssl&&(Object.assign(o,n.ssl),"key"in n.ssl&&(o.key=n.ssl.key)),0===r.isIP(t)&&(o.servername=t);try{n.stream=s.connect(o)}catch(e){return n.emit("error",e)}n.attachListeners(n.stream),n.stream.on("error",i),n.emit("sslconnect")})}attachListeners(e){e.on("end",()=>{this.emit("end")}),i(e,e=>{var t="error"===e.name?"errorMessage":e.name;this._emitMessage&&this.emit("message",e),this.emit(t,e)})}requestSsl(){this.stream.write(s.requestSsl())}startup(e){this.stream.write(s.startup(e))}cancel(e,t){this._send(s.cancel(e,t))}password(e){this._send(s.password(e))}sendSASLInitialResponseMessage(e,t){this._send(s.sendSASLInitialResponseMessage(e,t))}sendSCRAMClientFinalMessage(e){this._send(s.sendSCRAMClientFinalMessage(e))}_send(e){return!!this.stream.writable&&this.stream.write(e)}query(e){this._send(s.query(e))}parse(e){this._send(s.parse(e))}bind(e){this._send(s.bind(e))}execute(e){this._send(s.execute(e))}flush(){this.stream.writable&&this.stream.write(o)}sync(){this._ending=!0,this._send(o),this._send(a)}ref(){this.stream.ref()}unref(){this.stream.unref()}end(){return(this._ending=!0,this._connecting&&this.stream.writable)?this.stream.write(u,()=>{this.stream.end()}):void this.stream.end()}close(e){this._send(s.close(e))}describe(e){this._send(s.describe(e))}sendCopyFromChunk(e){this._send(s.copyData(e))}endCopyFrom(){this._send(s.copyDone())}sendCopyFail(e){this._send(s.copyFail(e))}};tp(c,"Connection"),t.exports=c}),rM=tm((e,t)=>{tx();var r=tA().EventEmitter,n=(t7(),t_(t8),t4()),i=re(),s=rm(),o=tY(),a=rw(),u=rS(),c=t5(),l=rL(),h=class extends r{constructor(e){super(),this.connectionParameters=new a(e),this.user=this.connectionParameters.user,this.database=this.connectionParameters.database,this.port=this.connectionParameters.port,this.host=this.connectionParameters.host,Object.defineProperty(this,"password",{configurable:!0,enumerable:!1,writable:!0,value:this.connectionParameters.password}),this.replication=this.connectionParameters.replication;var t=e||{};this._Promise=t.Promise||ti.Promise,this._types=new o(t.types),this._ending=!1,this._connecting=!1,this._connected=!1,this._connectionError=!1,this._queryable=!0,this.connection=t.connection||new l({stream:t.stream,ssl:this.connectionParameters.ssl,keepAlive:t.keepAlive||!1,keepAliveInitialDelayMillis:t.keepAliveInitialDelayMillis||0,encoding:this.connectionParameters.client_encoding||"utf8"}),this.queryQueue=[],this.binary=t.binary||c.binary,this.processID=null,this.secretKey=null,this.ssl=this.connectionParameters.ssl||!1,this.ssl&&this.ssl.key&&Object.defineProperty(this.ssl,"key",{enumerable:!1}),this._connectionTimeoutMillis=t.connectionTimeoutMillis||0}_errorAllQueries(e){let t=tp(t=>{ta.nextTick(()=>{t.handleError(e,this.connection)})},"enqueueError");this.activeQuery&&(t(this.activeQuery),this.activeQuery=null),this.queryQueue.forEach(t),this.queryQueue.length=0}_connect(e){var t=this,r=this.connection;if(this._connectionCallback=e,this._connecting||this._connected){let t=Error("Client has already been connected. You cannot reuse a client.");ta.nextTick(()=>{e(t)});return}this._connecting=!0,this.connectionTimeoutHandle,this._connectionTimeoutMillis>0&&(this.connectionTimeoutHandle=setTimeout(()=>{r._ending=!0,r.stream.destroy(Error("timeout expired"))},this._connectionTimeoutMillis)),this.host&&0===this.host.indexOf("/")?r.connect(this.host+"/.s.PGSQL."+this.port):r.connect(this.port,this.host),r.on("connect",function(){t.ssl?r.requestSsl():r.startup(t.getStartupConf())}),r.on("sslconnect",function(){r.startup(t.getStartupConf())}),this._attachListeners(r),r.once("end",()=>{let e=this._ending?Error("Connection terminated"):Error("Connection terminated unexpectedly");clearTimeout(this.connectionTimeoutHandle),this._errorAllQueries(e),this._ending||(this._connecting&&!this._connectionError?this._connectionCallback?this._connectionCallback(e):this._handleErrorEvent(e):this._connectionError||this._handleErrorEvent(e)),ta.nextTick(()=>{this.emit("end")})})}connect(e){return e?void this._connect(e):new this._Promise((e,t)=>{this._connect(r=>{r?t(r):e()})})}_attachListeners(e){e.on("authenticationCleartextPassword",this._handleAuthCleartextPassword.bind(this)),e.on("authenticationMD5Password",this._handleAuthMD5Password.bind(this)),e.on("authenticationSASL",this._handleAuthSASL.bind(this)),e.on("authenticationSASLContinue",this._handleAuthSASLContinue.bind(this)),e.on("authenticationSASLFinal",this._handleAuthSASLFinal.bind(this)),e.on("backendKeyData",this._handleBackendKeyData.bind(this)),e.on("error",this._handleErrorEvent.bind(this)),e.on("errorMessage",this._handleErrorMessage.bind(this)),e.on("readyForQuery",this._handleReadyForQuery.bind(this)),e.on("notice",this._handleNotice.bind(this)),e.on("rowDescription",this._handleRowDescription.bind(this)),e.on("dataRow",this._handleDataRow.bind(this)),e.on("portalSuspended",this._handlePortalSuspended.bind(this)),e.on("emptyQuery",this._handleEmptyQuery.bind(this)),e.on("commandComplete",this._handleCommandComplete.bind(this)),e.on("parseComplete",this._handleParseComplete.bind(this)),e.on("copyInResponse",this._handleCopyInResponse.bind(this)),e.on("copyData",this._handleCopyData.bind(this)),e.on("notification",this._handleNotification.bind(this))}_checkPgPass(e){let t=this.connection;"function"==typeof this.password?this._Promise.resolve().then(()=>this.password()).then(r=>{if(void 0!==r){if("string"!=typeof r)return void t.emit("error",TypeError("Password must be a string"));this.connectionParameters.password=this.password=r}else this.connectionParameters.password=this.password=null;e()}).catch(e=>{t.emit("error",e)}):null!==this.password?e():s(this.connectionParameters,t=>{void 0!==t&&(this.connectionParameters.password=this.password=t),e()})}_handleAuthCleartextPassword(e){this._checkPgPass(()=>{this.connection.password(this.password)})}_handleAuthMD5Password(e){this._checkPgPass(()=>{let t=n.postgresMd5PasswordHash(this.user,this.password,e.salt);this.connection.password(t)})}_handleAuthSASL(e){this._checkPgPass(()=>{this.saslSession=i.startSession(e.mechanisms),this.connection.sendSASLInitialResponseMessage(this.saslSession.mechanism,this.saslSession.response)})}_handleAuthSASLContinue(e){i.continueSession(this.saslSession,this.password,e.data),this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}_handleAuthSASLFinal(e){i.finalizeSession(this.saslSession,e.data),this.saslSession=null}_handleBackendKeyData(e){this.processID=e.processID,this.secretKey=e.secretKey}_handleReadyForQuery(e){this._connecting&&(this._connecting=!1,this._connected=!0,clearTimeout(this.connectionTimeoutHandle),this._connectionCallback&&(this._connectionCallback(null,this),this._connectionCallback=null),this.emit("connect"));let{activeQuery:t}=this;this.activeQuery=null,this.readyForQuery=!0,t&&t.handleReadyForQuery(this.connection),this._pulseQueryQueue()}_handleErrorWhileConnecting(e){if(!this._connectionError){if(this._connectionError=!0,clearTimeout(this.connectionTimeoutHandle),this._connectionCallback)return this._connectionCallback(e);this.emit("error",e)}}_handleErrorEvent(e){if(this._connecting)return this._handleErrorWhileConnecting(e);this._queryable=!1,this._errorAllQueries(e),this.emit("error",e)}_handleErrorMessage(e){if(this._connecting)return this._handleErrorWhileConnecting(e);let t=this.activeQuery;if(!t)return void this._handleErrorEvent(e);this.activeQuery=null,t.handleError(e,this.connection)}_handleRowDescription(e){this.activeQuery.handleRowDescription(e)}_handleDataRow(e){this.activeQuery.handleDataRow(e)}_handlePortalSuspended(e){this.activeQuery.handlePortalSuspended(this.connection)}_handleEmptyQuery(e){this.activeQuery.handleEmptyQuery(this.connection)}_handleCommandComplete(e){this.activeQuery.handleCommandComplete(e,this.connection)}_handleParseComplete(e){this.activeQuery.name&&(this.connection.parsedStatements[this.activeQuery.name]=this.activeQuery.text)}_handleCopyInResponse(e){this.activeQuery.handleCopyInResponse(this.connection)}_handleCopyData(e){this.activeQuery.handleCopyData(e,this.connection)}_handleNotification(e){this.emit("notification",e)}_handleNotice(e){this.emit("notice",e)}getStartupConf(){var e=this.connectionParameters,t={user:e.user,database:e.database},r=e.application_name||e.fallback_application_name;return r&&(t.application_name=r),e.replication&&(t.replication=""+e.replication),e.statement_timeout&&(t.statement_timeout=String(parseInt(e.statement_timeout,10))),e.lock_timeout&&(t.lock_timeout=String(parseInt(e.lock_timeout,10))),e.idle_in_transaction_session_timeout&&(t.idle_in_transaction_session_timeout=String(parseInt(e.idle_in_transaction_session_timeout,10))),e.options&&(t.options=e.options),t}cancel(e,t){if(e.activeQuery===t){var r=this.connection;this.host&&0===this.host.indexOf("/")?r.connect(this.host+"/.s.PGSQL."+this.port):r.connect(this.port,this.host),r.on("connect",function(){r.cancel(e.processID,e.secretKey)})}else -1!==e.queryQueue.indexOf(t)&&e.queryQueue.splice(e.queryQueue.indexOf(t),1)}setTypeParser(e,t,r){return this._types.setTypeParser(e,t,r)}getTypeParser(e,t){return this._types.getTypeParser(e,t)}escapeIdentifier(e){return'"'+e.replace(/"/g,'""')+'"'}escapeLiteral(e){for(var t=!1,r="'",n=0;n<e.length;n++){var i=e[n];"'"===i?r+=i+i:"\\"===i?(r+=i+i,t=!0):r+=i}return r+="'",!0===t&&(r=" E"+r),r}_pulseQueryQueue(){if(!0===this.readyForQuery)if(this.activeQuery=this.queryQueue.shift(),this.activeQuery){this.readyForQuery=!1,this.hasExecuted=!0;let e=this.activeQuery.submit(this.connection);e&&ta.nextTick(()=>{this.activeQuery.handleError(e,this.connection),this.readyForQuery=!0,this._pulseQueryQueue()})}else this.hasExecuted&&(this.activeQuery=null,this.emit("drain"))}query(e,t,r){var n,i,s,o,a;if(null==e)throw TypeError("Client was passed a null or undefined query");return"function"==typeof e.submit?(s=e.query_timeout||this.connectionParameters.query_timeout,i=n=e,"function"==typeof t&&(n.callback=n.callback||t)):(s=this.connectionParameters.query_timeout,(n=new u(e,t,r)).callback||(i=new this._Promise((e,t)=>{n.callback=(r,n)=>r?t(r):e(n)}))),s&&(a=n.callback,o=setTimeout(()=>{var e=Error("Query read timeout");ta.nextTick(()=>{n.handleError(e,this.connection)}),a(e),n.callback=()=>{};var t=this.queryQueue.indexOf(n);t>-1&&this.queryQueue.splice(t,1),this._pulseQueryQueue()},s),n.callback=(e,t)=>{clearTimeout(o),a(e,t)}),this.binary&&!n.binary&&(n.binary=!0),n._result&&!n._result._types&&(n._result._types=this._types),this._queryable?this._ending?ta.nextTick(()=>{n.handleError(Error("Client was closed and is not queryable"),this.connection)}):(this.queryQueue.push(n),this._pulseQueryQueue()):ta.nextTick(()=>{n.handleError(Error("Client has encountered a connection error and is not queryable"),this.connection)}),i}ref(){this.connection.ref()}unref(){this.connection.unref()}end(e){if(this._ending=!0,!this.connection._connecting)if(!e)return this._Promise.resolve();else e();if(this.activeQuery||!this._queryable?this.connection.stream.destroy():this.connection.end(),!e)return new this._Promise(e=>{this.connection.once("end",e)});this.connection.once("end",e)}};tp(h,"Client"),h.Query=u,t.exports=h}),rD=tm((e,t)=>{tx();var r=tA().EventEmitter,n=tp(function(){},"NOOP"),i=tp((e,t)=>{let r=e.findIndex(t);return -1===r?void 0:e.splice(r,1)[0]},"removeWhere"),s=class{constructor(e,t,r){this.client=e,this.idleListener=t,this.timeoutId=r}};tp(s,"IdleItem");var o=class{constructor(e){this.callback=e}};function a(){throw Error("Release called on client which has already been released to the pool.")}function u(e,t){let r,n;return t?{callback:t,result:void 0}:{callback:tp(function(e,t){e?r(e):n(t)},"cb"),result:new e(function(e,t){n=e,r=t}).catch(e=>{throw Error.captureStackTrace(e),e})}}function c(e,t){return tp(function r(n){n.client=t,t.removeListener("error",r),t.on("error",()=>{e.log("additional client error after disconnection due to error",n)}),e._remove(t),e.emit("error",n,t)},"idleListener")}tp(o,"PendingItem"),tp(a,"throwOnDoubleRelease"),tp(u,"promisify"),tp(c,"makeIdleListener");var l=class extends r{constructor(e,t){super(),this.options=Object.assign({},e),null!=e&&"password"in e&&Object.defineProperty(this.options,"password",{configurable:!0,enumerable:!1,writable:!0,value:e.password}),null!=e&&e.ssl&&e.ssl.key&&Object.defineProperty(this.options.ssl,"key",{enumerable:!1}),this.options.max=this.options.max||this.options.poolSize||10,this.options.min=this.options.min||0,this.options.maxUses=this.options.maxUses||1/0,this.options.allowExitOnIdle=this.options.allowExitOnIdle||!1,this.options.maxLifetimeSeconds=this.options.maxLifetimeSeconds||0,this.log=this.options.log||function(){},this.Client=this.options.Client||t||rG().Client,this.Promise=this.options.Promise||ti.Promise,typeof this.options.idleTimeoutMillis>"u"&&(this.options.idleTimeoutMillis=1e4),this._clients=[],this._idle=[],this._expired=new WeakSet,this._pendingQueue=[],this._endCallback=void 0,this.ending=!1,this.ended=!1}_isFull(){return this._clients.length>=this.options.max}_isAboveMin(){return this._clients.length>this.options.min}_pulseQueue(){if(this.log("pulse queue"),this.ended)return void this.log("pulse queue ended");if(this.ending){this.log("pulse queue on ending"),this._idle.length&&this._idle.slice().map(e=>{this._remove(e.client)}),this._clients.length||(this.ended=!0,this._endCallback());return}if(!this._pendingQueue.length)return void this.log("no queued requests");if(!this._idle.length&&this._isFull())return;let e=this._pendingQueue.shift();if(this._idle.length){let t=this._idle.pop();clearTimeout(t.timeoutId);let r=t.client;r.ref&&r.ref();let n=t.idleListener;return this._acquireClient(r,e,n,!1)}if(!this._isFull())return this.newClient(e);throw Error("unexpected condition")}_remove(e){let t=i(this._idle,t=>t.client===e);void 0!==t&&clearTimeout(t.timeoutId),this._clients=this._clients.filter(t=>t!==e),e.end(),this.emit("remove",e)}connect(e){if(this.ending){let t=Error("Cannot use a pool after calling end on the pool");return e?e(t):this.Promise.reject(t)}let t=u(this.Promise,e),r=t.result;if(this._isFull()||this._idle.length){if(this._idle.length&&ta.nextTick(()=>this._pulseQueue()),!this.options.connectionTimeoutMillis)return this._pendingQueue.push(new o(t.callback)),r;let e=tp((e,r,n)=>{clearTimeout(s),t.callback(e,r,n)},"queueCallback"),n=new o(e),s=setTimeout(()=>{i(this._pendingQueue,t=>t.callback===e),n.timedOut=!0,t.callback(Error("timeout exceeded when trying to connect"))},this.options.connectionTimeoutMillis);return s.unref&&s.unref(),this._pendingQueue.push(n),r}return this.newClient(new o(t.callback)),r}newClient(e){let t=new this.Client(this.options);this._clients.push(t);let r=c(this,t);this.log("checking client timeout");let i,s=!1;this.options.connectionTimeoutMillis&&(i=setTimeout(()=>{this.log("ending client due to timeout"),s=!0,t.connection?t.connection.stream.destroy():t.end()},this.options.connectionTimeoutMillis)),this.log("connecting new client"),t.connect(a=>{if(i&&clearTimeout(i),t.on("error",r),a)this.log("client failed to connect",a),this._clients=this._clients.filter(e=>e!==t),s&&(a=Error("Connection terminated due to connection timeout",{cause:a})),this._pulseQueue(),e.timedOut||e.callback(a,void 0,n);else{if(this.log("new client connected"),0!==this.options.maxLifetimeSeconds){let e=setTimeout(()=>{this.log("ending client due to expired lifetime"),this._expired.add(t),-1!==this._idle.findIndex(e=>e.client===t)&&this._acquireClient(t,new o((e,t,r)=>r()),r,!1)},1e3*this.options.maxLifetimeSeconds);e.unref(),t.once("end",()=>clearTimeout(e))}return this._acquireClient(t,e,r,!0)}})}_acquireClient(e,t,r,i){i&&this.emit("connect",e),this.emit("acquire",e),e.release=this._releaseOnce(e,r),e.removeListener("error",r),t.timedOut?i&&this.options.verify?this.options.verify(e,e.release):e.release():i&&this.options.verify?this.options.verify(e,r=>{if(r)return e.release(r),t.callback(r,void 0,n);t.callback(void 0,e,e.release)}):t.callback(void 0,e,e.release)}_releaseOnce(e,t){let r=!1;return n=>{r&&a(),r=!0,this._release(e,t,n)}}_release(e,t,r){let n;if(e.on("error",t),e._poolUseCount=(e._poolUseCount||0)+1,this.emit("release",r,e),r||this.ending||!e._queryable||e._ending||e._poolUseCount>=this.options.maxUses){e._poolUseCount>=this.options.maxUses&&this.log("remove expended client"),this._remove(e),this._pulseQueue();return}if(this._expired.has(e)){this.log("remove expired client"),this._expired.delete(e),this._remove(e),this._pulseQueue();return}this.options.idleTimeoutMillis&&this._isAboveMin()&&(n=setTimeout(()=>{this.log("remove idle client"),this._remove(e)},this.options.idleTimeoutMillis),this.options.allowExitOnIdle&&n.unref()),this.options.allowExitOnIdle&&e.unref(),this._idle.push(new s(e,t,n)),this._pulseQueue()}query(e,t,r){if("function"==typeof e){let t=u(this.Promise,e);return ts(function(){return t.callback(Error("Passing a function as the first parameter to pool.query is not supported"))}),t.result}"function"==typeof t&&(r=t,t=void 0);let n=u(this.Promise,r);return r=n.callback,this.connect((n,i)=>{if(n)return r(n);let s=!1,o=tp(e=>{s||(s=!0,i.release(e),r(e))},"onError");i.once("error",o),this.log("dispatching query");try{i.query(e,t,(e,t)=>{if(this.log("query dispatched"),i.removeListener("error",o),!s)return s=!0,i.release(e),e?r(e):r(void 0,t)})}catch(e){return i.release(e),r(e)}}),n.result}end(e){if(this.log("ending"),this.ending){let t=Error("Called end on pool more than once");return e?e(t):this.Promise.reject(t)}this.ending=!0;let t=u(this.Promise,e);return this._endCallback=t.callback,this._pulseQueue(),t.result}get waitingCount(){return this._pendingQueue.length}get idleCount(){return this._idle.length}get expiredCount(){return this._clients.reduce((e,t)=>e+ +!!this._expired.has(t),0)}get totalCount(){return this._clients.length}};tp(l,"Pool"),t.exports=l}),rk={};ty(rk,{default:()=>rB});var rB,rj=tg(()=>{tx(),rB={}}),rU=tm((e,t)=>{t.exports={name:"pg",version:"8.8.0",description:"PostgreSQL client - pure javascript & libpq with the same API",keywords:["database","libpq","pg","postgre","postgres","postgresql","rdbms"],homepage:"https://github.com/brianc/node-postgres",repository:{type:"git",url:"git://github.com/brianc/node-postgres.git",directory:"packages/pg"},author:"Brian Carlson <brian.m.carlson@gmail.com>",main:"./lib",dependencies:{"buffer-writer":"2.0.0","packet-reader":"1.0.0","pg-connection-string":"^2.5.0","pg-pool":"^3.5.2","pg-protocol":"^1.5.0","pg-types":"^2.1.0",pgpass:"1.x"},devDependencies:{async:"2.6.4",bluebird:"3.5.2",co:"4.6.0","pg-copy-streams":"0.3.0"},peerDependencies:{"pg-native":">=3.0.1"},peerDependenciesMeta:{"pg-native":{optional:!0}},scripts:{test:"make test-all"},files:["lib","SPONSORS.md"],license:"MIT",engines:{node:">= 8.0.0"},gitHead:"c99fb2c127ddf8d712500db2c7b9a5491a178655"}}),rF=tm((e,t)=>{tx();var r=tA().EventEmitter,n=(t7(),t_(t8)),i=t4(),s=t.exports=function(e,t,n){r.call(this),e=i.normalizeQueryConfig(e,t,n),this.text=e.text,this.values=e.values,this.name=e.name,this.callback=e.callback,this.state="new",this._arrayMode="array"===e.rowMode,this._emitRowEvents=!1,this.on("newListener",(function(e){"row"===e&&(this._emitRowEvents=!0)}).bind(this))};n.inherits(s,r);var o={sqlState:"code",statementPosition:"position",messagePrimary:"message",context:"where",schemaName:"schema",tableName:"table",columnName:"column",dataTypeName:"dataType",constraintName:"constraint",sourceFile:"file",sourceLine:"line",sourceFunction:"routine"};s.prototype.handleError=function(e){var t=this.native.pq.resultErrorFields();if(t)for(var r in t)e[o[r]||r]=t[r];this.callback?this.callback(e):this.emit("error",e),this.state="error"},s.prototype.then=function(e,t){return this._getPromise().then(e,t)},s.prototype.catch=function(e){return this._getPromise().catch(e)},s.prototype._getPromise=function(){return this._promise||(this._promise=new Promise((function(e,t){this._once("end",e),this._once("error",t)}).bind(this))),this._promise},s.prototype.submit=function(e){this.state="running";var t=this;this.native=e.native,e.native.arrayMode=this._arrayMode;var r=tp(function(r,n,i){if(e.native.arrayMode=!1,ts(function(){t.emit("_done")}),r)return t.handleError(r);t._emitRowEvents&&(i.length>1?n.forEach((e,r)=>{e.forEach(e=>{t.emit("row",e,i[r])})}):n.forEach(function(e){t.emit("row",e,i)})),t.state="end",t.emit("end",i),t.callback&&t.callback(null,i)},"after");if(ta.domain&&(r=ta.domain.bind(r)),this.name){this.name.length>63&&(console.error("Warning! Postgres only supports 63 characters for query names."),console.error("You supplied %s (%s)",this.name,this.name.length),console.error("This can cause conflicts and silent errors executing queries"));var n=(this.values||[]).map(i.prepareValue);if(e.namedQueries[this.name]){if(this.text&&e.namedQueries[this.name]!==this.text){let e=Error(`Prepa\
32
- red statements must be unique - '${this.name}' was used for a different statement`);return r(e)}return e.native.execute(this.name,n,r)}return e.native.prepare(this.name,this.text,n.length,function(i){return i?r(i):(e.namedQueries[t.name]=t.text,t.native.execute(t.name,n,r))})}if(this.values){if(!Array.isArray(this.values)){let e=Error("Query values must be an array");return r(e)}var s=this.values.map(i.prepareValue);e.native.query(this.text,s,r)}else e.native.query(this.text,r)}}),rq=tm((e,t)=>{tx();var r=(rj(),t_(rk)),n=tY(),i=(rU(),tA().EventEmitter),s=(t7(),t_(t8)),o=rw(),a=rF(),u=t.exports=function(e){i.call(this),e=e||{},this._Promise=e.Promise||ti.Promise,this._types=new n(e.types),this.native=new r({types:this._types}),this._queryQueue=[],this._ending=!1,this._connecting=!1,this._connected=!1,this._queryable=!0;var t=this.connectionParameters=new o(e);this.user=t.user,Object.defineProperty(this,"password",{configurable:!0,enumerable:!1,writable:!0,value:t.password}),this.database=t.database,this.host=t.host,this.port=t.port,this.namedQueries={}};u.Query=a,s.inherits(u,i),u.prototype._errorAllQueries=function(e){let t=tp(t=>{ta.nextTick(()=>{t.native=this.native,t.handleError(e)})},"enqueueError");this._hasActiveQuery()&&(t(this._activeQuery),this._activeQuery=null),this._queryQueue.forEach(t),this._queryQueue.length=0},u.prototype._connect=function(e){var t=this;if(this._connecting)return void ta.nextTick(()=>e(Error("Client has already been connected. You cannot reuse a client.")));this._connecting=!0,this.connectionParameters.getLibpqConnectionString(function(r,n){if(r)return e(r);t.native.connect(n,function(r){if(r)return t.native.end(),e(r);t._connected=!0,t.native.on("error",function(e){t._queryable=!1,t._errorAllQueries(e),t.emit("error",e)}),t.native.on("notification",function(e){t.emit("notification",{channel:e.relname,payload:e.extra})}),t.emit("connect"),t._pulseQueryQueue(!0),e()})})},u.prototype.connect=function(e){return e?void this._connect(e):new this._Promise((e,t)=>{this._connect(r=>{r?t(r):e()})})},u.prototype.query=function(e,t,r){var n,i,s,o,u;if(null==e)throw TypeError("Client was passed a null or undefined query");if("function"==typeof e.submit)s=e.query_timeout||this.connectionParameters.query_timeout,i=n=e,"function"==typeof t&&(e.callback=t);else if(s=this.connectionParameters.query_timeout,!(n=new a(e,t,r)).callback){let e,t;i=new this._Promise((r,n)=>{e=r,t=n}),n.callback=(r,n)=>r?t(r):e(n)}return s&&(u=n.callback,o=setTimeout(()=>{var e=Error("Query read timeout");ta.nextTick(()=>{n.handleError(e,this.connection)}),u(e),n.callback=()=>{};var t=this._queryQueue.indexOf(n);t>-1&&this._queryQueue.splice(t,1),this._pulseQueryQueue()},s),n.callback=(e,t)=>{clearTimeout(o),u(e,t)}),this._queryable?this._ending?(n.native=this.native,ta.nextTick(()=>{n.handleError(Error("Client was closed and is not queryable"))})):(this._queryQueue.push(n),this._pulseQueryQueue()):(n.native=this.native,ta.nextTick(()=>{n.handleError(Error("Client has encountered a connection error and is not queryable"))})),i},u.prototype.end=function(e){var t,r=this;return this._ending=!0,this._connected||this.once("connect",this.end.bind(this,e)),e||(t=new this._Promise(function(t,r){e=tp(e=>e?r(e):t(),"cb")})),this.native.end(function(){r._errorAllQueries(Error("Connection terminated")),ta.nextTick(()=>{r.emit("end"),e&&e()})}),t},u.prototype._hasActiveQuery=function(){return this._activeQuery&&"error"!==this._activeQuery.state&&"end"!==this._activeQuery.state},u.prototype._pulseQueryQueue=function(e){if(this._connected&&!this._hasActiveQuery()){var t=this._queryQueue.shift();if(!t){e||this.emit("drain");return}this._activeQuery=t,t.submit(this);var r=this;t.once("_done",function(){r._pulseQueryQueue()})}},u.prototype.cancel=function(e){this._activeQuery===e?this.native.cancel(function(){}):-1!==this._queryQueue.indexOf(e)&&this._queryQueue.splice(this._queryQueue.indexOf(e),1)},u.prototype.ref=function(){},u.prototype.unref=function(){},u.prototype.setTypeParser=function(e,t,r){return this._types.setTypeParser(e,t,r)},u.prototype.getTypeParser=function(e,t){return this._types.getTypeParser(e,t)}}),r$=tm((e,t)=>{tx(),t.exports=rq()}),rG=tm((e,t)=>{tx();var r=rM(),n=t5(),i=rL(),s=rD(),{DatabaseError:o}=rO(),a=tp(e=>{var t;return tp(t=class extends s{constructor(t){super(t,e)}},"BoundPool"),t},"poolFactory"),u=tp(function(e){this.defaults=n,this.Client=e,this.Query=this.Client.Query,this.Pool=a(this.Client),this._pools=[],this.Connection=i,this.types=tQ(),this.DatabaseError=o},"PG");"u">typeof ta.env.NODE_PG_FORCE_NATIVE?t.exports=new u(r$()):(t.exports=new u(r),Object.defineProperty(t.exports,"native",{configurable:!0,enumerable:!1,get(){var e=null;try{e=new u(r$())}catch(e){if("MODULE_NOT_FOUND"!==e.code)throw e}return Object.defineProperty(t.exports,"native",{value:e}),e}}))});tx(),tx(),tL(),tk(),tx();var rH=Object.defineProperty,rV=Object.defineProperties,rW=Object.getOwnPropertyDescriptors,rQ=Object.getOwnPropertySymbols,rY=Object.prototype.hasOwnProperty,rX=Object.prototype.propertyIsEnumerable,rz=tp((e,t,r)=>t in e?rH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,"__defNormalProp"),rK=tp((e,t)=>{for(var r in t||(t={}))rY.call(t,r)&&rz(e,r,t[r]);if(rQ)for(var r of rQ(t))rX.call(t,r)&&rz(e,r,t[r]);return e},"__spreadValues"),rJ=tp((e,t)=>rV(e,rW(t)),"__spreadProps"),rZ=2===new Uint8Array(new Uint16Array([258]).buffer)[0],r0=new TextDecoder,r1=new TextEncoder,r2=r1.encode("0123456789abcdef"),r6=r1.encode("0123456789ABCDEF"),r3=r1.encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/").slice();function r5(e,{alphabet:t,scratchArr:r}={}){if(!n)if(n=new Uint16Array(256),i=new Uint16Array(256),rZ)for(let e=0;e<256;e++)n[e]=r2[15&e]<<8|r2[e>>>4],i[e]=r6[15&e]<<8|r6[e>>>4];else for(let e=0;e<256;e++)n[e]=r2[15&e]|r2[e>>>4]<<8,i[e]=r6[15&e]|r6[e>>>4]<<8;e.byteOffset%4!=0&&(e=new Uint8Array(e));let s=e.length,o=s>>>2,a=r||new Uint16Array(s),u=new Uint32Array(e.buffer,e.byteOffset,o),c=new Uint32Array(a.buffer,a.byteOffset,s>>>1),l="upper"===t?i:n,h=0,f=0,d;if(rZ)for(;h<o;)d=u[h++],c[f++]=l[d>>>8&255]<<16|l[255&d],c[f++]=l[d>>>24]<<16|l[d>>>16&255];else for(;h<o;)d=u[h++],c[f++]=l[d>>>24]<<16|l[d>>>16&255],c[f++]=l[d>>>8&255]<<16|l[255&d];for(h<<=2;h<s;)a[h]=l[e[h++]];return r0.decode(a.subarray(0,s))}function r4(e,t={}){let r="",n=e.length,i=Math.ceil(n/504e3),s=new Uint16Array(i>1?504e3:n);for(let n=0;n<i;n++){let i=504e3*n,o=i+504e3;r+=r5(e.subarray(i,o),rJ(rK({},t),{scratchArr:s}))}return r}function r8(e,t={}){return"upper"!==t.alphabet&&"function"==typeof e.toHex?e.toHex():r4(e,t)}r3[62]=45,r3[63]=95,tp(r5,"_toHex"),tp(r4,"_toHexChunked"),tp(r8,"toHex"),tx();var r9=class e{constructor(e,t){this.strings=e,this.values=t}toParameterizedQuery(t={query:"",params:[]}){let{strings:r,values:n}=this;for(let i=0,s=r.length;i<s;i++)if(t.query+=r[i],i<n.length){let r=n[i];if(r instanceof ne)t.query+=r.sql;else if(r instanceof nh)if(r.queryData instanceof e)r.queryData.toParameterizedQuery(t);else{if(r.queryData.params?.length)throw Error("This query is not composable");t.query+=r.queryData.query}else{let{params:e}=t;e.push(r),t.query+="$"+e.length,(r instanceof to||ArrayBuffer.isView(r))&&(t.query+="::bytea")}}return t}};tp(r9,"SqlTemplate");var r7=class{constructor(e){this.sql=e}};tp(r7,"UnsafeRawSql");var ne=r7;function nt(){}tx(),tp(nt,"warnIfBrowser"),tL();var nr=tv(tY()),nn=tv(t4()),ni=class e extends Error{constructor(t){super(t),tw(this,"name","NeonDbError"),tw(this,"severity"),tw(this,"code"),tw(this,"detail"),tw(this,"hint"),tw(this,"position"),tw(this,"internalPosition"),tw(this,"internalQuery"),tw(this,"where"),tw(this,"schema"),tw(this,"table"),tw(this,"column"),tw(this,"dataType"),tw(this,"constraint"),tw(this,"file"),tw(this,"line"),tw(this,"routine"),tw(this,"sourceError"),"captureStackTrace"in Error&&"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,e)}};tp(ni,"NeonDbError");var ns="transaction() expects an array of queries, or a function returning an array of queries",no=["severity","code","detail","hint","position","internalPosition","internalQuery","where","schema","table","column","dataType","constraint","file","line","routine"];function na(e){return e instanceof to?"\\x"+r8(e):e}function nu(e){let{query:t,params:r}=e instanceof r9?e.toParameterizedQuery():e;return{query:t,params:r.map(e=>na((0,nn.prepareValue)(e)))}}function nc(e,{arrayMode:t,fullResults:r,fetchOptions:n,isolationLevel:i,readOnly:s,deferrable:o,authToken:a,disableWarningInBrowsers:u}={}){let c;if(!e)throw Error("No database connection string was provided to `neon()`. Perhaps an environment variable has not been set?");try{c=tD(e)}catch{throw Error("Database connection string provided to `neon()` is not a valid URL. Connection string: "+String(e))}let{protocol:l,username:h,hostname:f,port:d,pathname:p}=c;if("postgres:"!==l&&"postgresql:"!==l||!h||!f||!p)throw Error("Database connection string format for `neon()` should be: postgresql://user:password@host.tld/dbname?option=value");function g(e,...t){if(!(Array.isArray(e)&&Array.isArray(e.raw)&&Array.isArray(t)))throw Error('This function can now be called only as a tagged-template function: sql`SELECT ${value}`, not sql("SELECT $1", [value], options). For a conventional function call with value placeholders ($1, $2, etc.), use sql.query("SELECT $1", [value], options).');return new nh(m,new r9(e,t))}async function m(c,l,h){let p,{fetchEndpoint:g,fetchFunction:m}=tN,y=Array.isArray(c)?{queries:c.map(e=>nu(e))}:nu(c),b=n??{},v=t??!1,_=r??!1,w=i,E=s,S=o;void 0!==h&&(void 0!==h.fetchOptions&&(b={...b,...h.fetchOptions}),void 0!==h.arrayMode&&(v=h.arrayMode),void 0!==h.fullResults&&(_=h.fullResults),void 0!==h.isolationLevel&&(w=h.isolationLevel),void 0!==h.readOnly&&(E=h.readOnly),void 0!==h.deferrable&&(S=h.deferrable)),void 0===l||Array.isArray(l)||void 0===l.fetchOptions||(b={...b,...l.fetchOptions});let R=a;Array.isArray(l)||l?.authToken===void 0||(R=l.authToken);let x="function"==typeof g?g(f,d,{jwtAuth:void 0!==R}):g,A={"Neon-Connection-String":e,"Neon-Raw-Text-Output":"true","Neon-Array-Mode":"true"},T=await nd(R);T&&(A.Authorization=`Bearer ${T}`),Array.isArray(c)&&(void 0!==w&&(A["Neon-Batch-Isolation-Level"]=w),void 0!==E&&(A["Neon-Batch-Read-Only"]=String(E)),void 0!==S&&(A["Neon-Batch-Deferrable"]=String(S))),u||tN.disableWarningInBrowsers||nt();try{p=await (m??fetch)(x,{method:"POST",body:JSON.stringify(y),headers:A,...b})}catch(t){let e=new ni(`Error connecting to database: ${t}`);throw e.sourceError=t,e}if(p.ok){let e=await p.json();if(Array.isArray(c)){let t=e.results;if(!Array.isArray(t))throw new ni("Neon internal error: unexpected result format");return t.map((e,t)=>{let r=l[t]??{};return nf(e,{arrayMode:r.arrayMode??v,fullResults:r.fullResults??_,types:r.types})})}{let t=l??{};return nf(e,{arrayMode:t.arrayMode??v,fullResults:t.fullResults??_,types:t.types})}}{let{status:e}=p;if(400===e){let e=await p.json(),t=new ni(e.message);for(let r of no)t[r]=e[r]??void 0;throw t}{let t=await p.text();throw new ni(`Server error (HTTP status ${e}): ${t}`)}}}return tp(g,"templateFn"),g.query=(e,t,r)=>new nh(m,{query:e,params:t??[]},r),g.unsafe=e=>new ne(e),g.transaction=async(e,t)=>{if("function"==typeof e&&(e=e(g)),!Array.isArray(e))throw Error(ns);return e.forEach(e=>{if(!(e instanceof nh))throw Error(ns)}),m(e.map(e=>e.queryData),e.map(e=>e.opts??{}),t)},tp(m,"execute"),g}tp(na,"encodeBuffersAsBytea"),tp(nu,"prepareQuery"),tp(nc,"neon");var nl=class{constructor(e,t,r){this.execute=e,this.queryData=t,this.opts=r}then(e,t){return this.execute(this.queryData,this.opts).then(e,t)}catch(e){return this.execute(this.queryData,this.opts).catch(e)}finally(e){return this.execute(this.queryData,this.opts).finally(e)}};tp(nl,"NeonQueryPromise");var nh=nl;function nf(e,{arrayMode:t,fullResults:r,types:n}){let i=new nr.default(n),s=e.fields.map(e=>e.name),o=e.fields.map(e=>i.getTypeParser(e.dataTypeID)),a=!0===t?e.rows.map(e=>e.map((e,t)=>null===e?null:o[t](e))):e.rows.map(e=>Object.fromEntries(e.map((e,t)=>[s[t],null===e?null:o[t](e)])));return r?(e.viaNeonFetch=!0,e.rowAsArray=t,e.rows=a,e._parsers=o,e._types=i,e):a}async function nd(e){if("string"==typeof e)return e;if("function"==typeof e)try{return await Promise.resolve(e())}catch(t){let e=new ni("Error getting auth token.");throw t instanceof Error&&(e=new ni(`Error getting auth token: ${t.message}`)),e}}tp(nf,"processQueryResult"),tp(nd,"getAuthToken"),tx();var np=tv(rG());tx();var ng=tv(rG()),nm=class extends ng.Client{constructor(e){super(e),this.config=e}get neonConfig(){return this.connection.stream}connect(e){let{neonConfig:t}=this;t.forceDisablePgSSL&&(this.ssl=this.connection.ssl=!1),this.ssl&&t.useSecureWebSocket&&console.warn("SSL is enabled for both Postgres (e.g. ?sslmode=require in the connection string + forceDisablePgSSL = false) and the WebSocket tunnel (useSecureWebSocket = true). Double encryption will increase latency and CPU usage. It may be appropriate to disable SSL in the Postgres connection parameters or set forceDisablePgSSL = true.");let r="string"!=typeof this.config&&this.config?.host!==void 0||"string"!=typeof this.config&&this.config?.connectionString!==void 0||void 0!==ta.env.PGHOST,n=ta.env.USER??ta.env.USERNAME;if(!r&&"localhost"===this.host&&this.user===n&&this.database===n&&null===this.password)throw Error(`No database host or connection string wa\
28
+ ket--undefined. Details: ${e}`)),this.emit("close")})}}async startTls(e){if(void 0===this.subtls)throw Error("For Postgres SSL connections, you must set `neonConfig.subtls` to the subtls library. See https://github.com/neondatabase/serverless/blob/main/CONFIG.md for more information.");this.tlsState=1;let t=await this.subtls.TrustedCert.databaseFromPEM(this.rootCerts),r=new this.subtls.WebSocketReadQueue(this.ws),n=r.read.bind(r),i=this.rawWrite.bind(this),{read:s,write:o}=await this.subtls.startTls(e,t,n,i,{useSNI:!this.disableSNI,expectPreData:this.pipelineTLS?new Uint8Array([83]):void 0});this.tlsRead=s,this.tlsWrite=o,this.tlsState=2,this.encrypted=!0,this.authorized=!0,this.emit("secureConnection",this),this.tlsReadLoop()}async tlsReadLoop(){for(;;){let e=await this.tlsRead();if(void 0===e)break;{let t=to.from(e);this.emit("data",t)}}}rawWrite(e){if(!this.coalesceWrites){this.ws&&this.ws.send(e);return}if(void 0===this.writeBuffer)this.writeBuffer=e,setTimeout(()=>{this.ws&&this.ws.send(this.writeBuffer),this.writeBuffer=void 0},0);else{let t=new Uint8Array(this.writeBuffer.length+e.length);t.set(this.writeBuffer),t.set(e,this.writeBuffer.length),this.writeBuffer=t}}write(e,t="utf8",r=e=>{}){return 0===e.length?r():("string"==typeof e&&(e=to.from(e,t)),0===this.tlsState?(this.rawWrite(e),r()):1===this.tlsState?this.once("secureConnection",()=>{this.write(e,t,r)}):(this.tlsWrite(e),r())),!0}end(e=to.alloc(0),t="utf8",r=()=>{}){return this.write(e,t,()=>{this.ws.close(),r()}),this}destroy(){return this.destroyed=!0,this.end()}},tg(tN,"Socket"),tE(tN,"defaults",{poolQueryViaFetch:!1,fetchEndpoint:tg((e,t,r)=>"https://"+(r?.jwtAuth?e.replace(tI,"apiauth."):e.replace(tI,"api."))+"/sql","fetchEndpoint"),fetchConnectionCache:!0,fetchFunction:void 0,webSocketConstructor:void 0,wsProxy:tg(e=>e+"/v2","wsProxy"),useSecureWebSocket:!0,forceDisablePgSSL:!0,coalesceWrites:!0,pipelineConnect:"password",subtls:void 0,rootCerts:"",pipelineTLS:!1,disableSNI:!1,disableWarningInBrowsers:!1}),tE(tN,"opts",{}),tL=tN}),tD={};function tk(e,t=!1){let{protocol:r}=new URL(e),{username:n,password:i,host:s,hostname:o,port:a,pathname:u,search:c,searchParams:l,hash:h}=new URL("http:"+e.substring(r.length));i=decodeURIComponent(i),n=decodeURIComponent(n),u=decodeURIComponent(u);let f=n+":"+i,d=t?Object.fromEntries(l.entries()):c;return{href:e,protocol:r,auth:f,username:n,password:i,host:s,hostname:o,port:a,pathname:u,search:c,query:d,hash:h}}tb(tD,{parse:()=>tk});var tB=tm(()=>{tA(),tg(tk,"parse")}),tj=ty(e=>{tA(),e.parse=function(e,t){return new r(e,t).parse()};var t=class e{constructor(e,t){this.source=e,this.transform=t||n,this.position=0,this.entries=[],this.recorded=[],this.dimension=0}isEof(){return this.position>=this.source.length}nextCharacter(){var e=this.source[this.position++];return"\\"===e?{value:this.source[this.position++],escaped:!0}:{value:e,escaped:!1}}record(e){this.recorded.push(e)}newEntry(e){var t;(this.recorded.length>0||e)&&("NULL"!==(t=this.recorded.join(""))||e||(t=null),null!==t&&(t=this.transform(t)),this.entries.push(t),this.recorded=[])}consumeDimensions(){if("["===this.source[0])for(;!this.isEof()&&"="!==this.nextCharacter().value;);}parse(t){var r,n,i;for(this.consumeDimensions();!this.isEof();)if("{"!==(r=this.nextCharacter()).value||i){if("}"!==r.value||i)'"'!==r.value||r.escaped?","!==r.value||i?this.record(r.value):this.newEntry():(i&&this.newEntry(!0),i=!i);else if(this.dimension--,!this.dimension&&(this.newEntry(),t))return this.entries}else this.dimension++,this.dimension>1&&(n=new e(this.source.substr(this.position-1),this.transform),this.entries.push(n.parse(!0)),this.position+=n.position-2);if(0!==this.dimension)throw Error("array dimension not balanced");return this.entries}};tg(t,"ArrayParser");var r=t;function n(e){return e}tg(n,"identity")}),tU=ty((e,t)=>{tA();var r=tj();t.exports={create:tg(function(e,t){return{parse:tg(function(){return r.parse(e,t)},"parse")}},"create")}}),tF=ty((e,t)=>{tA();var r=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/,n=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,i=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,s=/^-?infinity$/;function o(e){var t=n.exec(e);if(t){var r=parseInt(t[1],10);t[4]&&(r=u(r));var i=new Date(r,parseInt(t[2],10)-1,t[3]);return c(r)&&i.setFullYear(r),i}}function a(e){if(e.endsWith("+00"))return 0;var t=i.exec(e.split(" ")[1]);if(t){var r=t[1];return"Z"===r?0:(3600*parseInt(t[2],10)+60*parseInt(t[3]||0,10)+parseInt(t[4]||0,10))*("-"===r?-1:1)*1e3}}function u(e){return-(e-1)}function c(e){return e>=0&&e<100}t.exports=tg(function(e){if(s.test(e))return Number(e.replace("i","I"));var t=r.exec(e);if(!t)return o(e)||null;var n=!!t[8],i=parseInt(t[1],10);n&&(i=u(i));var l=parseInt(t[2],10)-1,h=t[3],f=parseInt(t[4],10),d=parseInt(t[5],10),p=parseInt(t[6],10),g=t[7];g=g?1e3*parseFloat(g):0;var m,y=a(e);return null!=y?(m=new Date(Date.UTC(i,l,h,f,d,p,g)),c(i)&&m.setUTCFullYear(i),0!==y&&m.setTime(m.getTime()-y)):(m=new Date(i,l,h,f,d,p,g),c(i)&&m.setFullYear(i)),m},"parseDate"),tg(o,"getDate"),tg(a,"timeZoneOffset"),tg(u,"bcYearToNegativeYear"),tg(c,"is0To99")}),tq=ty((e,t)=>{tA(),t.exports=n;var r=Object.prototype.hasOwnProperty;function n(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)r.call(n,i)&&(e[i]=n[i])}return e}tg(n,"extend")}),t$=ty((e,t)=>{tA();var r=tq();function n(e){if(!(this instanceof n))return new n(e);r(this,d(e))}t.exports=n,tg(n,"PostgresInterval");var i=["seconds","minutes","hours","days","months","years"];n.prototype.toPostgres=function(){var e=i.filter(this.hasOwnProperty,this);return this.milliseconds&&0>e.indexOf("seconds")&&e.push("seconds"),0===e.length?"0":e.map(function(e){var t=this[e]||0;return"seconds"===e&&this.milliseconds&&(t=(t+this.milliseconds/1e3).toFixed(6).replace(/\.?0+$/,"")),t+" "+e},this).join(" ")};var s={years:"Y",months:"M",days:"D",hours:"H",minutes:"M",seconds:"S"},o=["years","months","days"],a=["hours","minutes","seconds"];n.prototype.toISOString=n.prototype.toISO=function(){return"P"+o.map(e,this).join("")+"T"+a.map(e,this).join("");function e(e){var t=this[e]||0;return"seconds"===e&&this.milliseconds&&(t=(t+this.milliseconds/1e3).toFixed(6).replace(/0+$/,"")),t+s[e]}};var u="([+-]?\\d+)",c=new RegExp([u+"\\s+years?",u+"\\s+mons?",u+"\\s+days?","([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?"].map(function(e){return"("+e+")?"}).join("\\s*")),l={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12},h=["hours","minutes","seconds","milliseconds"];function f(e){return parseInt(e+"000000".slice(e.length),10)/1e3}function d(e){if(!e)return{};var t=c.exec(e),r="-"===t[8];return Object.keys(l).reduce(function(e,n){var i=t[l[n]];return i&&(i="milliseconds"===n?f(i):parseInt(i,10))&&(r&&~h.indexOf(n)&&(i*=-1),e[n]=i),e},{})}tg(f,"parseMilliseconds"),tg(d,"parse")}),tG=ty((e,t)=>{tA(),t.exports=tg(function(e){if(/^\\x/.test(e))return new to(e.substr(2),"hex");for(var t="",r=0;r<e.length;)if("\\"!==e[r])t+=e[r],++r;else if(/[0-7]{3}/.test(e.substr(r+1,3)))t+=String.fromCharCode(parseInt(e.substr(r+1,3),8)),r+=4;else{for(var n=1;r+n<e.length&&"\\"===e[r+n];)n++;for(var i=0;i<Math.floor(n/2);++i)t+="\\";r+=2*Math.floor(n/2)}return new to(t,"binary")},"parseBytea")}),tH=ty((e,t)=>{tA();var r=tj(),n=tU(),i=tF(),s=t$(),o=tG();function a(e){return tg(function(t){return null===t?t:e(t)},"nullAllowed")}function u(e){return null===e?e:"TRUE"===e||"t"===e||"true"===e||"y"===e||"yes"===e||"on"===e||"1"===e}function c(e){return e?r.parse(e,u):null}function l(e){return parseInt(e,10)}function h(e){return e?r.parse(e,a(l)):null}function f(e){return e?r.parse(e,a(function(e){return _(e).trim()})):null}tg(a,"allowNull"),tg(u,"parseBool"),tg(c,"parseBoolArray"),tg(l,"parseBaseTenInt"),tg(h,"parseIntegerArray"),tg(f,"parseBigIntegerArray");var d=tg(function(e){return e?n.create(e,function(e){return null!==e&&(e=E(e)),e}).parse():null},"parsePointArray"),p=tg(function(e){return e?n.create(e,function(e){return null!==e&&(e=parseFloat(e)),e}).parse():null},"parseFloatArray"),g=tg(function(e){return e?n.create(e).parse():null},"parseStringArray"),m=tg(function(e){return e?n.create(e,function(e){return null!==e&&(e=i(e)),e}).parse():null},"parseDateArray"),y=tg(function(e){return e?n.create(e,function(e){return null!==e&&(e=s(e)),e}).parse():null},"parseIntervalArray"),b=tg(function(e){return e?r.parse(e,a(o)):null},"parseByteAArray"),v=tg(function(e){return parseInt(e,10)},"parseInteger"),_=tg(function(e){var t=String(e);return/^\d+$/.test(t)?t:e},"parseBigInteger"),w=tg(function(e){return e?r.parse(e,a(JSON.parse)):null},"parseJsonArray"),E=tg(function(e){return"("!==e[0]?null:{x:parseFloat((e=e.substring(1,e.length-1).split(","))[0]),y:parseFloat(e[1])}},"parsePoint"),S=tg(function(e){if("<"!==e[0]&&"("!==e[1])return null;for(var t="(",r="",n=!1,i=2;i<e.length-1;i++){if(n||(t+=e[i]),")"===e[i]){n=!0;continue}n&&","!==e[i]&&(r+=e[i])}var s=E(t);return s.radius=parseFloat(r),s},"parseCircle");t.exports={init:tg(function(e){e(20,_),e(21,v),e(23,v),e(26,v),e(700,parseFloat),e(701,parseFloat),e(16,u),e(1082,i),e(1114,i),e(1184,i),e(600,E),e(651,g),e(718,S),e(1e3,c),e(1001,b),e(1005,h),e(1007,h),e(1028,h),e(1016,f),e(1017,d),e(1021,p),e(1022,p),e(1231,p),e(1014,g),e(1015,g),e(1008,g),e(1009,g),e(1040,g),e(1041,g),e(1115,m),e(1182,m),e(1185,m),e(1186,s),e(1187,y),e(17,o),e(114,JSON.parse.bind(JSON)),e(3802,JSON.parse.bind(JSON)),e(199,w),e(3807,w),e(3907,g),e(2951,g),e(791,g),e(1183,g),e(1270,g)},"init")}}),tV=ty((e,t)=>{function r(e){var t=e.readInt32BE(0),r=e.readUInt32BE(4),n="";t<0&&(t=~t+(0===r),r=~r+1>>>0,n="-");var i,s,o,a,u,c,l="";if(i=t%1e6,t=t/1e6>>>0,r=(s=0x100000000*i+r)/1e6>>>0,o=""+(s-1e6*r),0===r&&0===t)return n+o+l;for(a="",u=6-o.length,c=0;c<u;c++)a+="0";if(l=a+o+l,i=t%1e6,t=t/1e6>>>0,r=(s=0x100000000*i+r)/1e6>>>0,o=""+(s-1e6*r),0===r&&0===t)return n+o+l;for(a="",u=6-o.length,c=0;c<u;c++)a+="0";if(l=a+o+l,i=t%1e6,t=t/1e6>>>0,r=(s=0x100000000*i+r)/1e6>>>0,o=""+(s-1e6*r),0===r&&0===t)return n+o+l;for(a="",u=6-o.length,c=0;c<u;c++)a+="0";return l=a+o+l,n+(o=""+(s=0x100000000*(i=t%1e6)+r)%1e6)+l}tA(),tg(r,"readInt8"),t.exports=r}),tW=ty((e,t)=>{tA();var r=tV(),n=tg(function(e,t,r,n,i){r=r||0,n=n||!1,i=i||function(e,t,r){return e*Math.pow(2,r)+t};var s=r>>3,o=tg(function(e){return n?255&~e:e},"inv"),a=255,u=8-r%8;t<u&&(a=255<<8-t&255,u=t),r&&(a>>=r%8);var c=0;r%8+t>=8&&(c=i(0,o(e[s])&a,u));for(var l=t+r>>3,h=s+1;h<l;h++)c=i(c,o(e[h]),8);var f=(t+r)%8;return f>0&&(c=i(c,o(e[l])>>8-f,f)),c},"parseBits"),i=tg(function(e,t,r){var i=Math.pow(2,r-1)-1,s=n(e,1),o=n(e,r,1);if(0===o)return 0;var a=1,u=n(e,t,r+1,!1,tg(function(e,t,r){0===e&&(e=1);for(var n=1;n<=r;n++)a/=2,(t&1<<r-n)>0&&(e+=a);return e},"parsePrecisionBits"));return o==Math.pow(2,r+1)-1?0===u?0===s?1/0:-1/0:NaN:(0===s?1:-1)*Math.pow(2,o-i)*u},"parseFloatFromBits"),s=tg(function(e){return 1==n(e,1)?-1*(n(e,15,1,!0)+1):n(e,15,1)},"parseInt16"),o=tg(function(e){return 1==n(e,1)?-1*(n(e,31,1,!0)+1):n(e,31,1)},"parseInt32"),a=tg(function(e){return i(e,23,8)},"parseFloat32"),u=tg(function(e){return i(e,52,11)},"parseFloat64"),c=tg(function(e){var t=n(e,16,32);if(49152==t)return NaN;for(var r=Math.pow(1e4,n(e,16,16)),i=0,s=n(e,16),o=0;o<s;o++)i+=n(e,16,64+16*o)*r,r/=1e4;var a=Math.pow(10,n(e,16,48));return(0===t?1:-1)*Math.round(i*a)/a},"parseNumeric"),l=tg(function(e,t){var r=n(t,1),i=n(t,63,1),s=new Date((0===r?1:-1)*i/1e3+9466848e5);return e||s.setTime(s.getTime()+6e4*s.getTimezoneOffset()),s.usec=i%1e3,s.getMicroSeconds=function(){return this.usec},s.setMicroSeconds=function(e){this.usec=e},s.getUTCMicroSeconds=function(){return this.usec},s},"parseDate"),h=tg(function(e){for(var t=n(e,32),r=(n(e,32,32),n(e,32,64)),i=96,s=[],o=0;o<t;o++)s[o]=n(e,32,i),i+=64;var a=tg(function(t){var r,s=n(e,32,i);return(i+=32,0xffffffff==s)?null:23==t||20==t?(r=n(e,8*s,i),i+=8*s,r):25==t?e.toString(this.encoding,i>>3,(i+=s<<3)>>3):void console.log("ERROR: ElementType not implemented: "+t)},"parseElement"),u=tg(function(e,t){var r,n=[];if(e.length>1){var i=e.shift();for(r=0;r<i;r++)n[r]=u(e,t);e.unshift(i)}else for(r=0;r<e[0];r++)n[r]=a(t);return n},"parse");return u(s,r)},"parseArray"),f=tg(function(e){return e.toString("utf8")},"parseText"),d=tg(function(e){return null===e?null:n(e,8)>0},"parseBool");t.exports={init:tg(function(e){e(20,r),e(21,s),e(23,o),e(26,o),e(1700,c),e(700,a),e(701,u),e(16,d),e(1114,l.bind(null,!1)),e(1184,l.bind(null,!0)),e(1e3,h),e(1007,h),e(1016,h),e(1008,h),e(1009,h),e(25,f)},"init")}}),tQ=ty((e,t)=>{tA(),t.exports={BOOL:16,BYTEA:17,CHAR:18,INT8:20,INT2:21,INT4:23,REGPROC:24,TEXT:25,OID:26,TID:27,XID:28,CID:29,JSON:114,XML:142,PG_NODE_TREE:194,SMGR:210,PATH:602,POLYGON:604,CIDR:650,FLOAT4:700,FLOAT8:701,ABSTIME:702,RELTIME:703,TINTERVAL:704,CIRCLE:718,MACADDR8:774,MONEY:790,MACADDR:829,INET:869,ACLITEM:1033,BPCHAR:1042,VARCHAR:1043,DATE:1082,TIME:1083,TIMESTAMP:1114,TIMESTAMPTZ:1184,INTERVAL:1186,TIMETZ:1266,BIT:1560,VARBIT:1562,NUMERIC:1700,REFCURSOR:1790,REGPROCEDURE:2202,REGOPER:2203,REGOPERATOR:2204,REGCLASS:2205,REGTYPE:2206,UUID:2950,TXID_SNAPSHOT:2970,PG_LSN:3220,PG_NDISTINCT:3361,PG_DEPENDENCIES:3402,TSVECTOR:3614,TSQUERY:3615,GTSVECTOR:3642,REGCONFIG:3734,REGDICTIONARY:3769,JSONB:3802,REGNAMESPACE:4089,REGROLE:4096}}),tY=ty(e=>{tA();var t=tH(),r=tW(),n=tU(),i=tQ();e.getTypeParser=a,e.setTypeParser=u,e.arrayParser=n,e.builtins=i;var s={text:{},binary:{}};function o(e){return String(e)}function a(e,t){return s[t=t||"text"]&&s[t][e]||o}function u(e,t,r){"function"==typeof t&&(r=t,t="text"),s[t][e]=r}tg(o,"noParse"),tg(a,"getTypeParser"),tg(u,"setTypeParser"),t.init(function(e,t){s.text[e]=t}),r.init(function(e,t){s.binary[e]=t})}),tX=ty((e,t)=>{tA();var r=tY();function n(e){this._types=e||r,this.text={},this.binary={}}tg(n,"TypeOverrides"),n.prototype.getOverrides=function(e){switch(e){case"text":return this.text;case"binary":return this.binary;default:return{}}},n.prototype.setTypeParser=function(e,t,r){"function"==typeof t&&(r=t,t="text"),this.getOverrides(t)[e]=r},n.prototype.getTypeParser=function(e,t){return t=t||"text",this.getOverrides(t)[e]||this._types.getTypeParser(e,t)},t.exports=n});function tz(e){let t=0x6a09e667,r=0xbb67ae85,n=0x3c6ef372,i=0xa54ff53a,s=0x510e527f,o=0x9b05688c,a=0x1f83d9ab,u=0x5be0cd19,c=0,l=0,h=[0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2],f=tg((e,t)=>e>>>t|e<<32-t,"rrot"),d=new Uint32Array(64),p=new Uint8Array(64),g=tg(()=>{for(let e=0,t=0;e<16;e++,t+=4)d[e]=p[t]<<24|p[t+1]<<16|p[t+2]<<8|p[t+3];for(let e=16;e<64;e++){let t=f(d[e-15],7)^f(d[e-15],18)^d[e-15]>>>3,r=f(d[e-2],17)^f(d[e-2],19)^d[e-2]>>>10;d[e]=d[e-16]+t+d[e-7]+r|0}let e=t,c=r,g=n,m=i,y=s,b=o,v=a,_=u;for(let t=0;t<64;t++){let r=_+(f(y,6)^f(y,11)^f(y,25))+(y&b^~y&v)+h[t]+d[t]|0,n=(f(e,2)^f(e,13)^f(e,22))+(e&c^e&g^c&g)|0;_=v,v=b,b=y,y=m+r|0,m=g,g=c,c=e,e=r+n|0}t=t+e|0,r=r+c|0,n=n+g|0,i=i+m|0,s=s+y|0,o=o+b|0,a=a+v|0,u=u+_|0,l=0},"process"),m=tg(e=>{"string"==typeof e&&(e=new TextEncoder().encode(e));for(let t=0;t<e.length;t++)p[l++]=e[t],64===l&&g();c+=e.length},"add"),y=tg(()=>{if(p[l++]=128,64==l&&g(),l+8>64){for(;l<64;)p[l++]=0;g()}for(;l<58;)p[l++]=0;let e=8*c;p[l++]=e/0x10000000000&255,p[l++]=e/0x100000000&255,p[l++]=e>>>24,p[l++]=e>>>16&255,p[l++]=e>>>8&255,p[l++]=255&e,g();let h=new Uint8Array(32);return h[0]=t>>>24,h[1]=t>>>16&255,h[2]=t>>>8&255,h[3]=255&t,h[4]=r>>>24,h[5]=r>>>16&255,h[6]=r>>>8&255,h[7]=255&r,h[8]=n>>>24,h[9]=n>>>16&255,h[10]=n>>>8&255,h[11]=255&n,h[12]=i>>>24,h[13]=i>>>16&255,h[14]=i>>>8&255,h[15]=255&i,h[16]=s>>>24,h[17]=s>>>16&255,h[18]=s>>>8&255,h[19]=255&s,h[20]=o>>>24,h[21]=o>>>16&255,h[22]=o>>>8&255,h[23]=255&o,h[24]=a>>>24,h[25]=a>>>16&255,h[26]=a>>>8&255,h[27]=255&a,h[28]=u>>>24,h[29]=u>>>16&255,h[30]=u>>>8&255,h[31]=255&u,h},"digest");return void 0===e?{add:m,digest:y}:(m(e),y())}var tK,tJ,tZ=tm(()=>{tA(),tg(tz,"sha256")}),t0=tm(()=>{tA(),tg(tK=class e{constructor(){tE(this,"_dataLength",0),tE(this,"_bufferLength",0),tE(this,"_state",new Int32Array(4)),tE(this,"_buffer",new ArrayBuffer(68)),tE(this,"_buffer8"),tE(this,"_buffer32"),this._buffer8=new Uint8Array(this._buffer,0,68),this._buffer32=new Uint32Array(this._buffer,0,17),this.start()}static hashByteArray(e,t=!1){return this.onePassHasher.start().appendByteArray(e).end(t)}static hashStr(e,t=!1){return this.onePassHasher.start().appendStr(e).end(t)}static hashAsciiStr(e,t=!1){return this.onePassHasher.start().appendAsciiStr(e).end(t)}static _hex(t){let r=e.hexChars,n=e.hexOut,i,s,o,a;for(a=0;a<4;a+=1)for(s=8*a,i=t[a],o=0;o<8;o+=2)n[s+1+o]=r.charAt(15&i),i>>>=4,n[s+0+o]=r.charAt(15&i),i>>>=4;return n.join("")}static _md5cycle(e,t){let r=e[0],n=e[1],i=e[2],s=e[3];r+=(n&i|~n&s)+t[0]-0x28955b88|0,s+=((r=(r<<7|r>>>25)+n|0)&n|~r&i)+t[1]-0x173848aa|0,i+=((s=(s<<12|s>>>20)+r|0)&r|~s&n)+t[2]+0x242070db|0,n+=((i=(i<<17|i>>>15)+s|0)&s|~i&r)+t[3]-0x3e423112|0,r+=((n=(n<<22|n>>>10)+i|0)&i|~n&s)+t[4]-0xa83f051|0,s+=((r=(r<<7|r>>>25)+n|0)&n|~r&i)+t[5]+0x4787c62a|0,i+=((s=(s<<12|s>>>20)+r|0)&r|~s&n)+t[6]-0x57cfb9ed|0,n+=((i=(i<<17|i>>>15)+s|0)&s|~i&r)+t[7]-0x2b96aff|0,r+=((n=(n<<22|n>>>10)+i|0)&i|~n&s)+t[8]+0x698098d8|0,s+=((r=(r<<7|r>>>25)+n|0)&n|~r&i)+t[9]-0x74bb0851|0,i+=((s=(s<<12|s>>>20)+r|0)&r|~s&n)+t[10]-42063|0,n+=((i=(i<<17|i>>>15)+s|0)&s|~i&r)+t[11]-0x76a32842|0,r+=((n=(n<<22|n>>>10)+i|0)&i|~n&s)+t[12]+0x6b901122|0,s+=((r=(r<<7|r>>>25)+n|0)&n|~r&i)+t[13]-0x2678e6d|0,i+=((s=(s<<12|s>>>20)+r|0)&r|~s&n)+t[14]-0x5986bc72|0,n+=((i=(i<<17|i>>>15)+s|0)&s|~i&r)+t[15]+0x49b40821|0,r+=((n=(n<<22|n>>>10)+i|0)&s|i&~s)+t[1]-0x9e1da9e|0,s+=((r=(r<<5|r>>>27)+n|0)&i|n&~i)+t[6]-0x3fbf4cc0|0,i+=((s=(s<<9|s>>>23)+r|0)&n|r&~n)+t[11]+0x265e5a51|0,n+=((i=(i<<14|i>>>18)+s|0)&r|s&~r)+t[0]-0x16493856|0,r+=((n=(n<<20|n>>>12)+i|0)&s|i&~s)+t[5]-0x29d0efa3|0,s+=((r=(r<<5|r>>>27)+n|0)&i|n&~i)+t[10]+0x2441453|0,i+=((s=(s<<9|s>>>23)+r|0)&n|r&~n)+t[15]-0x275e197f|0,n+=((i=(i<<14|i>>>18)+s|0)&r|s&~r)+t[4]-0x182c0438|0,r+=((n=(n<<20|n>>>12)+i|0)&s|i&~s)+t[9]+0x21e1cde6|0,s+=((r=(r<<5|r>>>27)+n|0)&i|n&~i)+t[14]-0x3cc8f82a|0,i+=((s=(s<<9|s>>>23)+r|0)&n|r&~n)+t[3]-0xb2af279|0,n+=((i=(i<<14|i>>>18)+s|0)&r|s&~r)+t[8]+0x455a14ed|0,r+=((n=(n<<20|n>>>12)+i|0)&s|i&~s)+t[13]-0x561c16fb|0,s+=((r=(r<<5|r>>>27)+n|0)&i|n&~i)+t[2]-0x3105c08|0,i+=((s=(s<<9|s>>>23)+r|0)&n|r&~n)+t[7]+0x676f02d9|0,n+=((i=(i<<14|i>>>18)+s|0)&r|s&~r)+t[12]-0x72d5b376|0,r+=((n=(n<<20|n>>>12)+i|0)^i^s)+t[5]-378558|0,s+=((r=(r<<4|r>>>28)+n|0)^n^i)+t[8]-0x788e097f|0,i+=((s=(s<<11|s>>>21)+r|0)^r^n)+t[11]+0x6d9d6122|0,n+=((i=(i<<16|i>>>16)+s|0)^s^r)+t[14]-0x21ac7f4|0,r+=((n=(n<<23|n>>>9)+i|0)^i^s)+t[1]-0x5b4115bc|0,s+=((r=(r<<4|r>>>28)+n|0)^n^i)+t[4]+0x4bdecfa9|0,i+=((s=(s<<11|s>>>21)+r|0)^r^n)+t[7]-0x944b4a0|0,n+=((i=(i<<16|i>>>16)+s|0)^s^r)+t[10]-0x41404390|0,r+=((n=(n<<23|n>>>9)+i|0)^i^s)+t[13]+0x289b7ec6|0,s+=((r=(r<<4|r>>>28)+n|0)^n^i)+t[0]-0x155ed806|0,i+=((s=(s<<11|s>>>21)+r|0)^r^n)+t[3]-0x2b10cf7b|0,n+=((i=(i<<16|i>>>16)+s|0)^s^r)+t[6]+0x4881d05|0,r+=((n=(n<<23|n>>>9)+i|0)^i^s)+t[9]-0x262b2fc7|0,s+=((r=(r<<4|r>>>28)+n|0)^n^i)+t[12]-0x1924661b|0,i+=((s=(s<<11|s>>>21)+r|0)^r^n)+t[15]+0x1fa27cf8|0,n+=((i=(i<<16|i>>>16)+s|0)^s^r)+t[2]-0x3b53a99b|0,n=(n<<23|n>>>9)+i|0,r+=(i^(n|~s))+t[0]-0xbd6ddbc|0,r=(r<<6|r>>>26)+n|0,s+=(n^(r|~i))+t[7]+0x432aff97|0,s=(s<<10|s>>>22)+r|0,i+=(r^(s|~n))+t[14]-0x546bdc59|0,i=(i<<15|i>>>17)+s|0,n+=(s^(i|~r))+t[5]-0x36c5fc7|0,n=(n<<21|n>>>11)+i|0,r+=(i^(n|~s))+t[12]+0x655b59c3|0,r=(r<<6|r>>>26)+n|0,s+=(n^(r|~i))+t[3]-0x70f3336e|0,s=(s<<10|s>>>22)+r|0,i+=(r^(s|~n))+t[10]-1051523|0,i=(i<<15|i>>>17)+s|0,n+=(s^(i|~r))+t[1]-0x7a7ba22f|0,n=(n<<21|n>>>11)+i|0,r+=(i^(n|~s))+t[8]+0x6fa87e4f|0,r=(r<<6|r>>>26)+n|0,s+=(n^(r|~i))+t[15]-0x1d31920|0,s=(s<<10|s>>>22)+r|0,i+=(r^(s|~n))+t[6]-0x5cfebcec|0,i=(i<<15|i>>>17)+s|0,n+=(s^(i|~r))+t[13]+0x4e0811a1|0,n=(n<<21|n>>>11)+i|0,r+=(i^(n|~s))+t[4]-0x8ac817e|0,r=(r<<6|r>>>26)+n|0,s+=(n^(r|~i))+t[11]-0x42c50dcb|0,s=(s<<10|s>>>22)+r|0,i+=(r^(s|~n))+t[2]+0x2ad7d2bb|0,i=(i<<15|i>>>17)+s|0,n+=(s^(i|~r))+t[9]-0x14792c6f|0,n=(n<<21|n>>>11)+i|0,e[0]=r+e[0]|0,e[1]=n+e[1]|0,e[2]=i+e[2]|0,e[3]=s+e[3]|0}start(){return this._dataLength=0,this._bufferLength=0,this._state.set(e.stateIdentity),this}appendStr(t){let r=this._buffer8,n=this._buffer32,i=this._bufferLength,s,o;for(o=0;o<t.length;o+=1){if((s=t.charCodeAt(o))<128)r[i++]=s;else if(s<2048)r[i++]=(s>>>6)+192,r[i++]=63&s|128;else if(s<55296||s>56319)r[i++]=(s>>>12)+224,r[i++]=s>>>6&63|128,r[i++]=63&s|128;else{if((s=(s-55296)*1024+(t.charCodeAt(++o)-56320)+65536)>1114111)throw Error("Unicode standard supports code points up to U+10FFFF");r[i++]=(s>>>18)+240,r[i++]=s>>>12&63|128,r[i++]=s>>>6&63|128,r[i++]=63&s|128}i>=64&&(this._dataLength+=64,e._md5cycle(this._state,n),i-=64,n[0]=n[16])}return this._bufferLength=i,this}appendAsciiStr(t){let r=this._buffer8,n=this._buffer32,i=this._bufferLength,s,o=0;for(;;){for(s=Math.min(t.length-o,64-i);s--;)r[i++]=t.charCodeAt(o++);if(i<64)break;this._dataLength+=64,e._md5cycle(this._state,n),i=0}return this._bufferLength=i,this}appendByteArray(t){let r=this._buffer8,n=this._buffer32,i=this._bufferLength,s,o=0;for(;;){for(s=Math.min(t.length-o,64-i);s--;)r[i++]=t[o++];if(i<64)break;this._dataLength+=64,e._md5cycle(this._state,n),i=0}return this._bufferLength=i,this}getState(){let e=this._state;return{buffer:String.fromCharCode.apply(null,Array.from(this._buffer8)),buflen:this._bufferLength,length:this._dataLength,state:[e[0],e[1],e[2],e[3]]}}setState(e){let t=e.buffer,r=e.state,n=this._state,i;for(this._dataLength=e.length,this._bufferLength=e.buflen,n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],i=0;i<t.length;i+=1)this._buffer8[i]=t.charCodeAt(i)}end(t=!1){let r=this._bufferLength,n=this._buffer8,i=this._buffer32,s=(r>>2)+1;this._dataLength+=r;let o=8*this._dataLength;if(n[r]=128,n[r+1]=n[r+2]=n[r+3]=0,i.set(e.buffer32Identity.subarray(s),s),r>55&&(e._md5cycle(this._state,i),i.set(e.buffer32Identity)),o<=0xffffffff)i[14]=o;else{let e=o.toString(16).match(/(.*?)(.{0,8})$/);if(null===e)return;let t=parseInt(e[2],16),r=parseInt(e[1],16)||0;i[14]=t,i[15]=r}return e._md5cycle(this._state,i),t?this._state:e._hex(this._state)}},"Md5"),tE(tK,"stateIdentity",new Int32Array([0x67452301,-0x10325477,-0x67452302,0x10325476])),tE(tK,"buffer32Identity",new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])),tE(tK,"hexChars","0123456789abcdef"),tE(tK,"hexOut",[]),tE(tK,"onePassHasher",new tK),tJ=tK}),t1={};function t2(e){return crypto.getRandomValues(to.alloc(e))}function t6(e){if("sha256"===e)return{update:tg(function(e){return{digest:tg(function(){return to.from(tz(e))},"digest")}},"update")};if("md5"===e)return{update:tg(function(e){return{digest:tg(function(){return"string"==typeof e?tJ.hashStr(e):tJ.hashByteArray(e)},"digest")}},"update")};throw Error(`Hash type '${e}' not supported`)}function t3(e,t){if("sha256"!==e)throw Error(`\
29
+ Only sha256 is supported (requested: '${e}')`);return{update:tg(function(e){return{digest:tg(function(){"string"==typeof t&&(t=new TextEncoder().encode(t)),"string"==typeof e&&(e=new TextEncoder().encode(e));let r=t.length;if(r>64)t=tz(t);else if(r<64){let e=new Uint8Array(64);e.set(t),t=e}let n=new Uint8Array(64),i=new Uint8Array(64);for(let e=0;e<64;e++)n[e]=54^t[e],i[e]=92^t[e];let s=new Uint8Array(e.length+64);s.set(n,0),s.set(e,64);let o=new Uint8Array(96);return o.set(i,0),o.set(tz(s),64),to.from(tz(o))},"digest")}},"update")}}tb(t1,{createHash:()=>t6,createHmac:()=>t3,randomBytes:()=>t2});var t5=tm(()=>{tA(),tZ(),t0(),tg(t2,"randomBytes"),tg(t6,"createHash"),tg(t3,"createHmac")}),t4=ty((e,t)=>{tA(),t.exports={host:"localhost",user:"win32"===ta.platform?ta.env.USERNAME:ta.env.USER,database:void 0,password:null,connectionString:void 0,port:5432,rows:0,binary:!1,max:10,idleTimeoutMillis:3e4,client_encoding:"",ssl:!1,application_name:void 0,fallback_application_name:void 0,options:void 0,parseInputDatesAsUTC:!1,statement_timeout:!1,lock_timeout:!1,idle_in_transaction_session_timeout:!1,query_timeout:!1,connect_timeout:0,keepalives:1,keepalives_idle:0};var r=tY(),n=r.getTypeParser(20,"text"),i=r.getTypeParser(1016,"text");t.exports.__defineSetter__("parseInt8",function(e){r.setTypeParser(20,"text",e?r.getTypeParser(23,"text"):n),r.setTypeParser(1016,"text",e?r.getTypeParser(1007,"text"):i)})}),t8=ty((e,t)=>{tA();var r=(t5(),tw(t1)),n=t4();function i(e){return'"'+e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'}function s(e){for(var t="{",r=0;r<e.length;r++)r>0&&(t+=","),null===e[r]||typeof e[r]>"u"?t+="NULL":Array.isArray(e[r])?t+=s(e[r]):e[r]instanceof to?t+="\\\\x"+e[r].toString("hex"):t+=i(o(e[r]));return t+"}"}tg(i,"escapeElement"),tg(s,"arrayString");var o=tg(function(e,t){if(null==e)return null;if(e instanceof to)return e;if(ArrayBuffer.isView(e)){var r=to.from(e.buffer,e.byteOffset,e.byteLength);return r.length===e.byteLength?r:r.slice(e.byteOffset,e.byteOffset+e.byteLength)}return e instanceof Date?n.parseInputDatesAsUTC?l(e):c(e):Array.isArray(e)?s(e):"object"==typeof e?a(e,t):e.toString()},"prepareValue");function a(e,t){if(e&&"function"==typeof e.toPostgres){if(-1!==(t=t||[]).indexOf(e))throw Error('circular reference detected while preparing "'+e+'" for query');return t.push(e),o(e.toPostgres(o),t)}return JSON.stringify(e)}function u(e,t){for(e=""+e;e.length<t;)e="0"+e;return e}function c(e){var t=-e.getTimezoneOffset(),r=e.getFullYear(),n=r<1;n&&(r=Math.abs(r)+1);var i=u(r,4)+"-"+u(e.getMonth()+1,2)+"-"+u(e.getDate(),2)+"T"+u(e.getHours(),2)+":"+u(e.getMinutes(),2)+":"+u(e.getSeconds(),2)+"."+u(e.getMilliseconds(),3);return t<0?(i+="-",t*=-1):i+="+",i+=u(Math.floor(t/60),2)+":"+u(t%60,2),n&&(i+=" BC"),i}function l(e){var t=e.getUTCFullYear(),r=t<1;r&&(t=Math.abs(t)+1);var n=u(t,4)+"-"+u(e.getUTCMonth()+1,2)+"-"+u(e.getUTCDate(),2)+"T"+u(e.getUTCHours(),2)+":"+u(e.getUTCMinutes(),2)+":"+u(e.getUTCSeconds(),2)+"."+u(e.getUTCMilliseconds(),3);return n+="+00:00",r&&(n+=" BC"),n}function h(e,t,r){return e="string"==typeof e?{text:e}:e,t&&("function"==typeof t?e.callback=t:e.values=t),r&&(e.callback=r),e}tg(a,"prepareObject"),tg(u,"pad"),tg(c,"dateToString"),tg(l,"dateToStringUTC"),tg(h,"normalizeQueryConfig");var f=tg(function(e){return r.createHash("md5").update(e,"utf-8").digest("hex")},"md5"),d=tg(function(e,t,r){var n=f(t+e);return"md5"+f(to.concat([to.from(n),r]))},"postgresMd5PasswordHash");t.exports={prepareValue:tg(function(e){return o(e)},"prepareValueWrapper"),normalizeQueryConfig:h,postgresMd5PasswordHash:d,md5:f}}),t9={};tb(t9,{default:()=>t7});var t7,re=tm(()=>{tA(),t7={}}),rt=ty((e,t)=>{tA();var r=(t5(),tw(t1));function n(e){if(-1===e.indexOf("SCRAM-SHA-256"))throw Error("SASL: Only mechanism SCRAM-SHA-256 is currently supported");let t=r.randomBytes(18).toString("base64");return{mechanism:"SCRAM-SHA-256",clientNonce:t,response:"n,,n=*,r="+t,message:"SASLInitialResponse"}}function i(e,t,r){if("SASLInitialResponse"!==e.message)throw Error("SASL: Last message was not SASLInitialResponse");if("string"!=typeof t)throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string");if("string"!=typeof r)throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: serverData must be a string");let n=c(r);if(n.nonce.startsWith(e.clientNonce)){if(n.nonce.length===e.clientNonce.length)throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce is too short")}else throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with client nonce");var i=p(t,to.from(n.salt,"base64"),n.iteration),s=d(i,"Client Key"),o=f(s),a="n=*,r="+e.clientNonce,u="r="+n.nonce+",s="+n.salt+",i="+n.iteration,l="c=biws,r="+n.nonce,g=a+","+u+","+l,m=h(s,d(o,g)).toString("base64"),y=d(i,"Server Key"),b=d(y,g);e.message="SASLResponse",e.serverSignature=b.toString("base64"),e.response=l+",p="+m}function s(e,t){if("SASLResponse"!==e.message)throw Error("SASL: Last message was not SASLResponse");if("string"!=typeof t)throw Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: serverData must be a string");let{serverSignature:r}=l(t);if(r!==e.serverSignature)throw Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature does not match")}function o(e){if("string"!=typeof e)throw TypeError("SASL: text must be a string");return e.split("").map((t,r)=>e.charCodeAt(r)).every(e=>e>=33&&e<=43||e>=45&&e<=126)}function a(e){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/.test(e)}function u(e){if("string"!=typeof e)throw TypeError("SASL: attribute pairs text must be a string");return new Map(e.split(",").map(e=>{if(!/^.=/.test(e))throw Error("SASL: Invalid attribute pair entry");return[e[0],e.substring(2)]}))}function c(e){let t=u(e),r=t.get("r");if(r){if(!o(r))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce must only contain printable characters")}else throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing");let n=t.get("s");if(n){if(!a(n))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt must be base64")}else throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing");let i=t.get("i");if(i){if(!/^[1-9][0-9]*$/.test(i))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: invalid iteration count")}else throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: iteration missing");return{nonce:r,salt:n,iteration:parseInt(i,10)}}function l(e){let t=u(e).get("v");if(t){if(!a(t))throw Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature must be base64")}else throw Error("SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature is missing");return{serverSignature:t}}function h(e,t){if(!to.isBuffer(e))throw TypeError("first argument must be a Buffer");if(!to.isBuffer(t))throw TypeError("second argument must be a Buffer");if(e.length!==t.length)throw Error("Buffer lengths must match");if(0===e.length)throw Error("Buffers cannot be empty");return to.from(e.map((r,n)=>e[n]^t[n]))}function f(e){return r.createHash("sha256").update(e).digest()}function d(e,t){return r.createHmac("sha256",e).update(t).digest()}function p(e,t,r){for(var n=d(e,to.concat([t,to.from([0,0,0,1])])),i=n,s=0;s<r-1;s++)i=h(i,n=d(e,n));return i}tg(n,"startSession"),tg(i,"continueSession"),tg(s,"finalizeSession"),tg(o,"isPrintableChars"),tg(a,"isBase64"),tg(u,"parseAttributePairs"),tg(c,"parseServerFirstMessage"),tg(l,"parseServerFinalMessage"),tg(h,"xorBuffers"),tg(f,"sha256"),tg(d,"hmacSha256"),tg(p,"Hi"),t.exports={startSession:n,continueSession:i,finalizeSession:s}}),rr={};function rn(...e){return e.join("/")}tb(rr,{join:()=>rn});var ri=tm(()=>{tA(),tg(rn,"join")}),rs={};function ro(e,t){t(Error("No filesystem"))}tb(rs,{stat:()=>ro});var ra=tm(()=>{tA(),tg(ro,"stat")}),ru={};tb(ru,{default:()=>rc});var rc,rl=tm(()=>{tA(),rc={}}),rh={};tb(rh,{StringDecoder:()=>rd});var rf,rd,rp=tm(()=>{tA(),tg(rf=class{constructor(e){tE(this,"td"),this.td=new TextDecoder(e)}write(e){return this.td.decode(e,{stream:!0})}end(e){return this.td.decode(e)}},"StringDecoder"),rd=rf}),rg=ty((e,t)=>{tA();var{Transform:r}=(rl(),tw(ru)),{StringDecoder:n}=(rp(),tw(rh)),i=Symbol("last"),s=Symbol("decoder");function o(e,t,r){let n;if(this.overflow){if(1===(n=this[s].write(e).split(this.matcher)).length)return r();n.shift(),this.overflow=!1}else this[i]+=this[s].write(e),n=this[i].split(this.matcher);this[i]=n.pop();for(let e=0;e<n.length;e++)try{u(this,this.mapper(n[e]))}catch(e){return r(e)}if(this.overflow=this[i].length>this.maxLength,this.overflow&&!this.skipOverflow)return void r(Error("maximum buffer reached"));r()}function a(e){if(this[i]+=this[s].end(),this[i])try{u(this,this.mapper(this[i]))}catch(t){return e(t)}e()}function u(e,t){void 0!==t&&e.push(t)}function c(e){return e}function l(e,t,u){switch(e=e||/\r?\n/,t=t||c,u=u||{},arguments.length){case 1:"function"==typeof e?(t=e,e=/\r?\n/):"object"!=typeof e||e instanceof RegExp||e[Symbol.split]||(u=e,e=/\r?\n/);break;case 2:"function"==typeof e?(u=t,t=e,e=/\r?\n/):"object"==typeof t&&(u=t,t=c)}(u=Object.assign({},u)).autoDestroy=!0,u.transform=o,u.flush=a,u.readableObjectMode=!0;let l=new r(u);return l[i]="",l[s]=new n("utf8"),l.matcher=e,l.mapper=t,l.maxLength=u.maxLength,l.skipOverflow=u.skipOverflow||!1,l.overflow=!1,l._destroy=function(e,t){this._writableState.errorEmitted=!1,t(e)},l}tg(o,"transform"),tg(a,"flush"),tg(u,"push"),tg(c,"noop"),tg(l,"split"),t.exports=l}),rm=ty((e,t)=>{tA();var r=(ri(),tw(rr)),n=(rl(),tw(ru)).Stream,i=rg(),s=(re(),tw(t9)),o="win32"===ta.platform,a=ta.stderr;function u(e){return(61440&e)==32768}tg(u,"isRegFile");var c=["host","port","database","user","password"],l=c.length,h=c[l-1];function f(){if(a instanceof n&&!0===a.writable){var e=Array.prototype.slice.call(arguments).concat(`
30
+ `);a.write(s.format.apply(s,e))}}tg(f,"warn"),Object.defineProperty(t.exports,"isWin",{get:tg(function(){return o},"get"),set:tg(function(e){o=e},"set")}),t.exports.warnTo=function(e){var t=a;return a=e,t},t.exports.getFileName=function(e){var t=e||ta.env;return t.PGPASSFILE||(o?r.join(t.APPDATA||"./","postgresql","pgpass.conf"):r.join(t.HOME||"./",".pgpass"))},t.exports.usePgPass=function(e,t){return!Object.prototype.hasOwnProperty.call(ta.env,"PGPASSWORD")&&(!!o||(t=t||"<unkn>",u(e.mode)?!(63&e.mode)||(f('WARNING: password file "%s" has group or world access; permissions should be u=rw (0600) or less',t),!1):(f('WARNING: password file "%s" is not a plain file',t),!1)))};var d=t.exports.match=function(e,t){return c.slice(0,-1).reduce(function(r,n,i){return 1==i&&Number(e[n]||5432)===Number(t[n])?r&&!0:r&&("*"===t[n]||t[n]===e[n])},!0)};t.exports.getPassword=function(e,t,r){var n,s=t.pipe(i());function o(t){var r=p(t);r&&g(r)&&d(e,r)&&(n=r[h],s.end())}tg(o,"onLine");var a=tg(function(){t.destroy(),r(n)},"onEnd"),u=tg(function(e){t.destroy(),f("WARNING: error on reading file: %s",e),r(void 0)},"onErr");t.on("error",u),s.on("data",o).on("end",a).on("error",u)};var p=t.exports.parseLine=function(e){if(e.length<11||e.match(/^\s+#/))return null;for(var t="",r="",n=0,i=0,s={},o=tg(function(t,r,n){var i=e.substring(r,n);Object.hasOwnProperty.call(ta.env,"PGPASS_NO_DEESCAPE")||(i=i.replace(/\\([:\\])/g,"$1")),s[c[t]]=i},"addToObj"),a=0;a<e.length-1;a+=1){if(t=e.charAt(a+1),r=e.charAt(a),n==l-1){o(n,i);break}a>=0&&":"==t&&"\\"!==r&&(o(n,i,a+1),i=a+2,n+=1)}return s=Object.keys(s).length===l?s:null},g=t.exports.isValidEntry=function(e){for(var t={0:function(e){return e.length>0},1:function(e){return"*"===e||isFinite(e=Number(e))&&e>0&&e<0x20000000000000&&Math.floor(e)===e},2:function(e){return e.length>0},3:function(e){return e.length>0},4:function(e){return e.length>0}},r=0;r<c.length;r+=1)if(!(0,t[r])(e[c[r]]||""))return!1;return!0}}),ry=ty((e,t)=>{tA(),ri(),tw(rr);var r=(ra(),tw(rs)),n=rm();t.exports=function(e,t){var i=n.getFileName();r.stat(i,function(s,o){if(s||!n.usePgPass(o,i))return t(void 0);var a=r.createReadStream(i);n.getPassword(e,a,t)})},t.exports.warnTo=n.warnTo}),rb={};tb(rb,{default:()=>rv});var rv,r_=tm(()=>{tA(),rv={}}),rw=ty((e,t)=>{tA();var r=(tB(),tw(tD)),n=(ra(),tw(rs));function i(e){if("/"===e.charAt(0)){var t=e.split(" ");return{host:t[0],database:t[1]}}var i=r.parse(/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i.test(e)?encodeURI(e).replace(/\%25(\d\d)/g,"%$1"):e,!0),t=i.query;for(var s in t)Array.isArray(t[s])&&(t[s]=t[s][t[s].length-1]);var o=(i.auth||":").split(":");if(t.user=o[0],t.password=o.splice(1).join(":"),t.port=i.port,"socket:"==i.protocol)return t.host=decodeURI(i.pathname),t.database=i.query.db,t.client_encoding=i.query.encoding,t;t.host||(t.host=i.hostname);var a=i.pathname;if(!t.host&&a&&/^%2f/i.test(a)){var u=a.split("/");t.host=decodeURIComponent(u[0]),a=u.splice(1).join("/")}switch(a&&"/"===a.charAt(0)&&(a=a.slice(1)||null),t.database=a&&decodeURI(a),("true"===t.ssl||"1"===t.ssl)&&(t.ssl=!0),"0"===t.ssl&&(t.ssl=!1),(t.sslcert||t.sslkey||t.sslrootcert||t.sslmode)&&(t.ssl={}),t.sslcert&&(t.ssl.cert=n.readFileSync(t.sslcert).toString()),t.sslkey&&(t.ssl.key=n.readFileSync(t.sslkey).toString()),t.sslrootcert&&(t.ssl.ca=n.readFileSync(t.sslrootcert).toString()),t.sslmode){case"disable":t.ssl=!1;break;case"prefer":case"require":case"verify-ca":case"verify-full":break;case"no-verify":t.ssl.rejectUnauthorized=!1}return t}tg(i,"parse"),t.exports=i,i.parse=i}),rE=ty((e,t)=>{tA();var r=(r_(),tw(rb)),n=t4(),i=rw().parse,s=tg(function(e,t,r){return void 0===r?r=ta.env["PG"+e.toUpperCase()]:!1===r||(r=ta.env[r]),t[e]||r||n[e]},"val"),o=tg(function(){switch(ta.env.PGSSLMODE){case"disable":return!1;case"prefer":case"require":case"verify-ca":case"verify-full":return!0;case"no-verify":return{rejectUnauthorized:!1}}return n.ssl},"readSSLConfigFromEnvironment"),a=tg(function(e){return"'"+(""+e).replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"},"quoteParamValue"),u=tg(function(e,t,r){var n=t[r];null!=n&&e.push(r+"="+a(n))},"add"),c=class{constructor(e){(e="string"==typeof e?i(e):e||{}).connectionString&&(e=Object.assign({},e,i(e.connectionString))),this.user=s("user",e),this.database=s("database",e),void 0===this.database&&(this.database=this.user),this.port=parseInt(s("port",e),10),this.host=s("host",e),Object.defineProperty(this,"password",{configurable:!0,enumerable:!1,writable:!0,value:s("password",e)}),this.binary=s("binary",e),this.options=s("options",e),this.ssl=typeof e.ssl>"u"?o():e.ssl,"string"==typeof this.ssl&&"true"===this.ssl&&(this.ssl=!0),"no-verify"===this.ssl&&(this.ssl={rejectUnauthorized:!1}),this.ssl&&this.ssl.key&&Object.defineProperty(this.ssl,"key",{enumerable:!1}),this.client_encoding=s("client_encoding",e),this.replication=s("replication",e),this.isDomainSocket=!(this.host||"").indexOf("/"),this.application_name=s("application_name",e,"PGAPPNAME"),this.fallback_application_name=s("fallback_application_name",e,!1),this.statement_timeout=s("statement_timeout",e,!1),this.lock_timeout=s("lock_timeout",e,!1),this.idle_in_transaction_session_timeout=s("idle_in_transaction_session_timeout",e,!1),this.query_timeout=s("query_timeout",e,!1),void 0===e.connectionTimeoutMillis?this.connect_timeout=ta.env.PGCONNECT_TIMEOUT||0:this.connect_timeout=Math.floor(e.connectionTimeoutMillis/1e3),!1===e.keepAlive?this.keepalives=0:!0===e.keepAlive&&(this.keepalives=1),"number"==typeof e.keepAliveInitialDelayMillis&&(this.keepalives_idle=Math.floor(e.keepAliveInitialDelayMillis/1e3))}getLibpqConnectionString(e){var t=[];u(t,this,"user"),u(t,this,"password"),u(t,this,"port"),u(t,this,"application_name"),u(t,this,"fallback_application_name"),u(t,this,"connect_timeout"),u(t,this,"options");var n="object"==typeof this.ssl?this.ssl:this.ssl?{sslmode:this.ssl}:{};if(u(t,n,"sslmode"),u(t,n,"sslca"),u(t,n,"sslkey"),u(t,n,"sslcert"),u(t,n,"sslrootcert"),this.database&&t.push("dbname="+a(this.database)),this.replication&&t.push("replication="+a(this.replication)),this.host&&t.push("host="+a(this.host)),this.isDomainSocket)return e(null,t.join(" "));this.client_encoding&&t.push("client_encoding="+a(this.client_encoding)),r.lookup(this.host,function(r,n){return r?e(r,null):(t.push("hostaddr="+a(n)),e(null,t.join(" ")))})}};tg(c,"ConnectionParameters"),t.exports=c}),rS=ty((e,t)=>{tA();var r=tY(),n=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/,i=class{constructor(e,t){this.command=null,this.rowCount=null,this.oid=null,this.rows=[],this.fields=[],this._parsers=void 0,this._types=t,this.RowCtor=null,this.rowAsArray="array"===e,this.rowAsArray&&(this.parseRow=this._parseRowAsArray)}addCommandComplete(e){var t;(t=e.text?n.exec(e.text):n.exec(e.command))&&(this.command=t[1],t[3]?(this.oid=parseInt(t[2],10),this.rowCount=parseInt(t[3],10)):t[2]&&(this.rowCount=parseInt(t[2],10)))}_parseRowAsArray(e){for(var t=Array(e.length),r=0,n=e.length;r<n;r++){var i=e[r];null!==i?t[r]=this._parsers[r](i):t[r]=null}return t}parseRow(e){for(var t={},r=0,n=e.length;r<n;r++){var i=e[r],s=this.fields[r].name;null!==i?t[s]=this._parsers[r](i):t[s]=null}return t}addRow(e){this.rows.push(e)}addFields(e){this.fields=e,this.fields.length&&(this._parsers=Array(e.length));for(var t=0;t<e.length;t++){var n=e[t];this._types?this._parsers[t]=this._types.getTypeParser(n.dataTypeID,n.format||"text"):this._parsers[t]=r.getTypeParser(n.dataTypeID,n.format||"text")}}};tg(i,"Result"),t.exports=i}),rR=ty((e,t)=>{tA();var{EventEmitter:r}=tT(),n=rS(),i=t8(),s=class extends r{constructor(e,t,r){super(),e=i.normalizeQueryConfig(e,t,r),this.text=e.text,this.values=e.values,this.rows=e.rows,this.types=e.types,this.name=e.name,this.binary=e.binary,this.portal=e.portal||"",this.callback=e.callback,this._rowMode=e.rowMode,ta.domain&&e.callback&&(this.callback=ta.domain.bind(e.callback)),this._result=new n(this._rowMode,this.types),this._results=this._result,this.isPreparedStatement=!1,this._canceledDueToError=!1,this._promise=null}requiresPreparation(){return!!this.name||!!this.rows||!!this.text&&!!this.values&&this.values.length>0}_checkForMultirow(){this._result.command&&(Array.isArray(this._results)||(this._results=[this._result]),this._result=new n(this._rowMode,this.types),this._results.push(this._result))}handleRowDescription(e){this._checkForMultirow(),this._result.addFields(e.fields),this._accumulateRows=this.callback||!this.listeners("row").length}handleDataRow(e){let t;if(!this._canceledDueToError){try{t=this._result.parseRow(e.fields)}catch(e){this._canceledDueToError=e;return}this.emit("row",t,this._result),this._accumulateRows&&this._result.addRow(t)}}handleCommandComplete(e,t){this._checkForMultirow(),this._result.addCommandComplete(e),this.rows&&t.sync()}handleEmptyQuery(e){this.rows&&e.sync()}handleError(e,t){if(this._canceledDueToError&&(e=this._canceledDueToError,this._canceledDueToError=!1),this.callback)return this.callback(e);this.emit("error",e)}handleReadyForQuery(e){if(this._canceledDueToError)return this.handleError(this._canceledDueToError,e);if(this.callback)try{this.callback(null,this._results)}catch(e){ta.nextTick(()=>{throw e})}this.emit("end",this._results)}submit(e){if("string"!=typeof this.text&&"string"!=typeof this.name)return Error("A query must have either text or a name. Supplying neither is unsupported.");let t=e.parsedStatements[this.name];return this.text&&t&&this.text!==t?Error(`Prepared statements must be unique - '${this.name}\
31
+ ' was used for a different statement`):this.values&&!Array.isArray(this.values)?Error("Query values must be an array"):(this.requiresPreparation()?this.prepare(e):e.query(this.text),null)}hasBeenParsed(e){return this.name&&e.parsedStatements[this.name]}handlePortalSuspended(e){this._getRows(e,this.rows)}_getRows(e,t){e.execute({portal:this.portal,rows:t}),t?e.flush():e.sync()}prepare(e){this.isPreparedStatement=!0,this.hasBeenParsed(e)||e.parse({text:this.text,name:this.name,types:this.types});try{e.bind({portal:this.portal,statement:this.name,values:this.values,binary:this.binary,valueMapper:i.prepareValue})}catch(t){this.handleError(t,e);return}e.describe({type:"P",name:this.portal||""}),this._getRows(e,this.rows)}handleCopyInResponse(e){e.sendCopyFail("No source stream defined")}handleCopyData(e,t){}};tg(s,"Query"),t.exports=s}),rx=ty(e=>{tA(),Object.defineProperty(e,"__esModule",{value:!0}),e.NoticeMessage=e.DataRowMessage=e.CommandCompleteMessage=e.ReadyForQueryMessage=e.NotificationResponseMessage=e.BackendKeyDataMessage=e.AuthenticationMD5Password=e.ParameterStatusMessage=e.ParameterDescriptionMessage=e.RowDescriptionMessage=e.Field=e.CopyResponse=e.CopyDataMessage=e.DatabaseError=e.copyDone=e.emptyQuery=e.replicationStart=e.portalSuspended=e.noData=e.closeComplete=e.bindComplete=e.parseComplete=void 0,e.parseComplete={name:"parseComplete",length:5},e.bindComplete={name:"bindComplete",length:5},e.closeComplete={name:"closeComplete",length:5},e.noData={name:"noData",length:5},e.portalSuspended={name:"portalSuspended",length:5},e.replicationStart={name:"replicationStart",length:4},e.emptyQuery={name:"emptyQuery",length:4},e.copyDone={name:"copyDone",length:4};var t=class extends Error{constructor(e,t,r){super(e),this.length=t,this.name=r}};tg(t,"DatabaseError"),e.DatabaseError=t;var r=class{constructor(e,t){this.length=e,this.chunk=t,this.name="copyData"}};tg(r,"CopyDataMessage"),e.CopyDataMessage=r;var n=class{constructor(e,t,r,n){this.length=e,this.name=t,this.binary=r,this.columnTypes=Array(n)}};tg(n,"CopyResponse"),e.CopyResponse=n;var i=class{constructor(e,t,r,n,i,s,o){this.name=e,this.tableID=t,this.columnID=r,this.dataTypeID=n,this.dataTypeSize=i,this.dataTypeModifier=s,this.format=o}};tg(i,"Field"),e.Field=i;var s=class{constructor(e,t){this.length=e,this.fieldCount=t,this.name="rowDescription",this.fields=Array(this.fieldCount)}};tg(s,"RowDescriptionMessage"),e.RowDescriptionMessage=s;var o=class{constructor(e,t){this.length=e,this.parameterCount=t,this.name="parameterDescription",this.dataTypeIDs=Array(this.parameterCount)}};tg(o,"ParameterDescriptionMessage"),e.ParameterDescriptionMessage=o;var a=class{constructor(e,t,r){this.length=e,this.parameterName=t,this.parameterValue=r,this.name="parameterStatus"}};tg(a,"ParameterStatusMessage"),e.ParameterStatusMessage=a;var u=class{constructor(e,t){this.length=e,this.salt=t,this.name="authenticationMD5Password"}};tg(u,"AuthenticationMD5Password"),e.AuthenticationMD5Password=u;var c=class{constructor(e,t,r){this.length=e,this.processID=t,this.secretKey=r,this.name="backendKeyData"}};tg(c,"BackendKeyDataMessage"),e.BackendKeyDataMessage=c;var l=class{constructor(e,t,r,n){this.length=e,this.processId=t,this.channel=r,this.payload=n,this.name="notification"}};tg(l,"NotificationResponseMessage"),e.NotificationResponseMessage=l;var h=class{constructor(e,t){this.length=e,this.status=t,this.name="readyForQuery"}};tg(h,"ReadyForQueryMessage"),e.ReadyForQueryMessage=h;var f=class{constructor(e,t){this.length=e,this.text=t,this.name="commandComplete"}};tg(f,"CommandCompleteMessage"),e.CommandCompleteMessage=f;var d=class{constructor(e,t){this.length=e,this.fields=t,this.name="dataRow",this.fieldCount=t.length}};tg(d,"DataRowMessage"),e.DataRowMessage=d;var p=class{constructor(e,t){this.length=e,this.message=t,this.name="notice"}};tg(p,"NoticeMessage"),e.NoticeMessage=p}),rA=ty(e=>{tA(),Object.defineProperty(e,"__esModule",{value:!0}),e.Writer=void 0;var t=class{constructor(e=256){this.size=e,this.offset=5,this.headerPosition=0,this.buffer=to.allocUnsafe(e)}ensure(e){if(this.buffer.length-this.offset<e){let t=this.buffer,r=t.length+(t.length>>1)+e;this.buffer=to.allocUnsafe(r),t.copy(this.buffer)}}addInt32(e){return this.ensure(4),this.buffer[this.offset++]=e>>>24&255,this.buffer[this.offset++]=e>>>16&255,this.buffer[this.offset++]=e>>>8&255,this.buffer[this.offset++]=e>>>0&255,this}addInt16(e){return this.ensure(2),this.buffer[this.offset++]=e>>>8&255,this.buffer[this.offset++]=e>>>0&255,this}addCString(e){if(e){let t=to.byteLength(e);this.ensure(t+1),this.buffer.write(e,this.offset,"utf-8"),this.offset+=t}else this.ensure(1);return this.buffer[this.offset++]=0,this}addString(e=""){let t=to.byteLength(e);return this.ensure(t),this.buffer.write(e,this.offset),this.offset+=t,this}add(e){return this.ensure(e.length),e.copy(this.buffer,this.offset),this.offset+=e.length,this}join(e){if(e){this.buffer[this.headerPosition]=e;let t=this.offset-(this.headerPosition+1);this.buffer.writeInt32BE(t,this.headerPosition+1)}return this.buffer.slice(5*!e,this.offset)}flush(e){let t=this.join(e);return this.offset=5,this.headerPosition=0,this.buffer=to.allocUnsafe(this.size),t}};tg(t,"Writer"),e.Writer=t}),rT=ty(e=>{tA(),Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=void 0;var t=rA(),r=new t.Writer,n=tg(e=>{for(let t of(r.addInt16(3).addInt16(0),Object.keys(e)))r.addCString(t).addCString(e[t]);r.addCString("client_encoding").addCString("UTF8");let n=r.addCString("").flush(),i=n.length+4;return new t.Writer().addInt32(i).add(n).flush()},"startup"),i=tg(()=>{let e=to.allocUnsafe(8);return e.writeInt32BE(8,0),e.writeInt32BE(0x4d2162f,4),e},"requestSsl"),s=tg(e=>r.addCString(e).flush(112),"password"),o=tg(function(e,t){return r.addCString(e).addInt32(to.byteLength(t)).addString(t),r.flush(112)},"sendSASLInitialResponseMessage"),a=tg(function(e){return r.addString(e).flush(112)},"sendSCRAMClientFinalMessage"),u=tg(e=>r.addCString(e).flush(81),"query"),c=[],l=tg(e=>{let t=e.name||"";t.length>63&&(console.error("Warning! Postgres only supports 63 characters for query names."),console.error("You supplied %s (%s)",t,t.length),console.error("This can cause conflicts and silent errors executing queries"));let n=e.types||c,i=n.length,s=r.addCString(t).addCString(e.text).addInt16(i);for(let e=0;e<i;e++)s.addInt32(n[e]);return r.flush(80)},"parse"),h=new t.Writer,f=tg(function(e,t){for(let n=0;n<e.length;n++){let i=t?t(e[n],n):e[n];null==i?(r.addInt16(0),h.addInt32(-1)):i instanceof to?(r.addInt16(1),h.addInt32(i.length),h.add(i)):(r.addInt16(0),h.addInt32(to.byteLength(i)),h.addString(i))}},"writeValues"),d=tg((e={})=>{let t=e.portal||"",n=e.statement||"",i=e.binary||!1,s=e.values||c,o=s.length;return r.addCString(t).addCString(n),r.addInt16(o),f(s,e.valueMapper),r.addInt16(o),r.add(h.flush()),r.addInt16(+!!i),r.flush(66)},"bind"),p=to.from([69,0,0,0,9,0,0,0,0,0]),g=tg(e=>{if(!e||!e.portal&&!e.rows)return p;let t=e.portal||"",r=e.rows||0,n=to.byteLength(t),i=4+n+1+4,s=to.allocUnsafe(1+i);return s[0]=69,s.writeInt32BE(i,1),s.write(t,5,"utf-8"),s[n+5]=0,s.writeUInt32BE(r,s.length-4),s},"execute"),m=tg((e,t)=>{let r=to.allocUnsafe(16);return r.writeInt32BE(16,0),r.writeInt16BE(1234,4),r.writeInt16BE(5678,6),r.writeInt32BE(e,8),r.writeInt32BE(t,12),r},"cancel"),y=tg((e,t)=>{let r=4+to.byteLength(t)+1,n=to.allocUnsafe(1+r);return n[0]=e,n.writeInt32BE(r,1),n.write(t,5,"utf-8"),n[r]=0,n},"cstringMessage"),b=r.addCString("P").flush(68),v=r.addCString("S").flush(68),_=tg(e=>e.name?y(68,`${e.type}${e.name||""}`):"P"===e.type?b:v,"describe"),w=tg(e=>y(67,`${e.type}${e.name||""}`),"close"),E=tg(e=>r.add(e).flush(100),"copyData"),S=tg(e=>y(102,e),"copyFail"),R=tg(e=>to.from([e,0,0,0,4]),"codeOnlyBuffer"),x=R(72),A=R(83),T=R(88),P=R(99);e.serialize={startup:n,password:s,requestSsl:i,sendSASLInitialResponseMessage:o,sendSCRAMClientFinalMessage:a,query:u,parse:l,bind:d,execute:g,describe:_,close:w,flush:tg(()=>x,"flush"),sync:tg(()=>A,"sync"),end:tg(()=>T,"end"),copyData:E,copyDone:tg(()=>P,"copyDone"),copyFail:S,cancel:m}}),rP=ty(e=>{tA(),Object.defineProperty(e,"__esModule",{value:!0}),e.BufferReader=void 0;var t=to.allocUnsafe(0),r=class{constructor(e=0){this.offset=e,this.buffer=t,this.encoding="utf-8"}setBuffer(e,t){this.offset=e,this.buffer=t}int16(){let e=this.buffer.readInt16BE(this.offset);return this.offset+=2,e}byte(){let e=this.buffer[this.offset];return this.offset++,e}int32(){let e=this.buffer.readInt32BE(this.offset);return this.offset+=4,e}uint32(){let e=this.buffer.readUInt32BE(this.offset);return this.offset+=4,e}string(e){let t=this.buffer.toString(this.encoding,this.offset,this.offset+e);return this.offset+=e,t}cstring(){let e=this.offset,t=e;for(;0!==this.buffer[t++];);return this.offset=t,this.buffer.toString(this.encoding,e,t-1)}bytes(e){let t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}};tg(r,"BufferReader"),e.BufferReader=r}),rO=ty(e=>{tA(),Object.defineProperty(e,"__esModule",{value:!0}),e.Parser=void 0;var t=rx(),r=rP(),n=to.allocUnsafe(0),i=class{constructor(e){if(this.buffer=n,this.bufferLength=0,this.bufferOffset=0,this.reader=new r.BufferReader,e?.mode==="binary")throw Error("Binary mode not supported yet");this.mode=e?.mode||"text"}parse(e,t){this.mergeBuffer(e);let r=this.bufferOffset+this.bufferLength,i=this.bufferOffset;for(;i+5<=r;){let e=this.buffer[i],n=this.buffer.readUInt32BE(i+1),s=1+n;if(s+i<=r)t(this.handlePacket(i+5,e,n,this.buffer)),i+=s;else break}i===r?(this.buffer=n,this.bufferLength=0,this.bufferOffset=0):(this.bufferLength=r-i,this.bufferOffset=i)}mergeBuffer(e){if(this.bufferLength>0){let t=this.bufferLength+e.byteLength;if(t+this.bufferOffset>this.buffer.byteLength){let e;if(t<=this.buffer.byteLength&&this.bufferOffset>=this.bufferLength)e=this.buffer;else{let r=2*this.buffer.byteLength;for(;t>=r;)r*=2;e=to.allocUnsafe(r)}this.buffer.copy(e,0,this.bufferOffset,this.bufferOffset+this.bufferLength),this.buffer=e,this.bufferOffset=0}e.copy(this.buffer,this.bufferOffset+this.bufferLength),this.bufferLength=t}else this.buffer=e,this.bufferOffset=0,this.bufferLength=e.byteLength}handlePacket(e,r,n,i){switch(r){case 50:return t.bindComplete;case 49:return t.parseComplete;case 51:return t.closeComplete;case 110:return t.noData;case 115:return t.portalSuspended;case 99:return t.copyDone;case 87:return t.replicationStart;case 73:return t.emptyQuery;case 68:return this.parseDataRowMessage(e,n,i);case 67:return this.parseCommandCompleteMessage(e,n,i);case 90:return this.parseReadyForQueryMessage(e,n,i);case 65:return this.parseNotificationMessage(e,n,i);case 82:return this.parseAuthenticationResponse(e,n,i);case 83:return this.parseParameterStatusMessage(e,n,i);case 75:return this.parseBackendKeyData(e,n,i);case 69:return this.parseErrorMessage(e,n,i,"error");case 78:return this.parseErrorMessage(e,n,i,"notice");case 84:return this.parseRowDescriptionMessage(e,n,i);case 116:return this.parseParameterDescriptionMessage(e,n,i);case 71:return this.parseCopyInMessage(e,n,i);case 72:return this.parseCopyOutMessage(e,n,i);case 100:return this.parseCopyData(e,n,i);default:return new t.DatabaseError("received invalid response: "+r.toString(16),n,"error")}}parseReadyForQueryMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.string(1);return new t.ReadyForQueryMessage(r,i)}parseCommandCompleteMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.cstring();return new t.CommandCompleteMessage(r,i)}parseCopyData(e,r,n){let i=n.slice(e,e+(r-4));return new t.CopyDataMessage(r,i)}parseCopyInMessage(e,t,r){return this.parseCopyMessage(e,t,r,"copyInResponse")}parseCopyOutMessage(e,t,r){return this.parseCopyMessage(e,t,r,"copyOutResponse")}parseCopyMessage(e,r,n,i){this.reader.setBuffer(e,n);let s=0!==this.reader.byte(),o=this.reader.int16(),a=new t.CopyResponse(r,i,s,o);for(let e=0;e<o;e++)a.columnTypes[e]=this.reader.int16();return a}parseNotificationMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.int32(),s=this.reader.cstring(),o=this.reader.cstring();return new t.NotificationResponseMessage(r,i,s,o)}parseRowDescriptionMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.int16(),s=new t.RowDescriptionMessage(r,i);for(let e=0;e<i;e++)s.fields[e]=this.parseField();return s}parseField(){let e=this.reader.cstring(),r=this.reader.uint32(),n=this.reader.int16(),i=this.reader.uint32(),s=this.reader.int16(),o=this.reader.int32(),a=0===this.reader.int16()?"text":"binary";return new t.Field(e,r,n,i,s,o,a)}parseParameterDescriptionMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.int16(),s=new t.ParameterDescriptionMessage(r,i);for(let e=0;e<i;e++)s.dataTypeIDs[e]=this.reader.int32();return s}parseDataRowMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.int16(),s=Array(i);for(let e=0;e<i;e++){let t=this.reader.int32();s[e]=-1===t?null:this.reader.string(t)}return new t.DataRowMessage(r,s)}parseParameterStatusMessage(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.cstring(),s=this.reader.cstring();return new t.ParameterStatusMessage(r,i,s)}parseBackendKeyData(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.int32(),s=this.reader.int32();return new t.BackendKeyDataMessage(r,i,s)}parseAuthenticationResponse(e,r,n){this.reader.setBuffer(e,n);let i=this.reader.int32(),s={name:"authenticationOk",length:r};switch(i){case 0:break;case 3:8===s.length&&(s.name="authenticationCleartextPassword");break;case 5:if(12===s.length){s.name="authenticationMD5Password";let e=this.reader.bytes(4);return new t.AuthenticationMD5Password(r,e)}break;case 10:{let e;s.name="authenticationSASL",s.mechanisms=[];do(e=this.reader.cstring())&&s.mechanisms.push(e);while(e)}break;case 11:s.name="authenticationSASLContinue",s.data=this.reader.string(r-8);break;case 12:s.name="authenticationSASLFinal",s.data=this.reader.string(r-8);break;default:throw Error("Unknown authenticationOk message type "+i)}return s}parseErrorMessage(e,r,n,i){this.reader.setBuffer(e,n);let s={},o=this.reader.string(1);for(;"\0"!==o;)s[o]=this.reader.cstring(),o=this.reader.string(1);let a=s.M,u="notice"===i?new t.NoticeMessage(r,a):new t.DatabaseError(a,r,i);return u.severity=s.S,u.code=s.C,u.detail=s.D,u.hint=s.H,u.position=s.P,u.internalPosition=s.p,u.internalQuery=s.q,u.where=s.W,u.schema=s.s,u.table=s.t,u.column=s.c,u.dataType=s.d,u.constraint=s.n,u.file=s.F,u.line=s.L,u.routine=s.R,u}};tg(i,"Parser"),e.Parser=i}),rC=ty(e=>{tA(),Object.defineProperty(e,"__esModule",{value:!0}),e.DatabaseError=e.serialize=e.parse=void 0;var t=rx();Object.defineProperty(e,"DatabaseError",{enumerable:!0,get:tg(function(){return t.DatabaseError},"get")});var r=rT();Object.defineProperty(e,"serialize",{enumerable:!0,get:tg(function(){return r.serialize},"get")});var n=rO();function i(e,t){let r=new n.Parser;return e.on("data",e=>r.parse(e,t)),new Promise(t=>e.on("end",()=>t()))}tg(i,"parse"),e.parse=i}),rI={};function rN({socket:e,servername:t}){return e.startTls(t),e}tb(rI,{connect:()=>rN});var rL=tm(()=>{tA(),tg(rN,"connect")}),rM=ty((e,t)=>{tA();var r=(tM(),tw(tP)),n=tT().EventEmitter,{parse:i,serialize:s}=rC(),o=s.flush(),a=s.sync(),u=s.end(),c=class extends n{constructor(e){super(),e=e||{},this.stream=e.stream||new r.Socket,this._keepAlive=e.keepAlive,this._keepAliveInitialDelayMillis=e.keepAliveInitialDelayMillis,this.lastBuffer=!1,this.parsedStatements={},this.ssl=e.ssl||!1,this._ending=!1,this._emitMessage=!1;var t=this;this.on("newListener",function(e){"message"===e&&(t._emitMessage=!0)})}connect(e,t){var n=this;this._connecting=!0,this.stream.setNoDelay(!0),this.stream.connect(e,t),this.stream.once("connect",function(){n._keepAlive&&n.stream.setKeepAlive(!0,n._keepAliveInitialDelayMillis),n.emit("connect")});let i=tg(function(e){n._ending&&("ECONNRESET"===e.code||"EPIPE"===e.code)||n.emit("error",e)},"reportStreamError");if(this.stream.on("error",i),this.stream.on("close",function(){n.emit("end")}),!this.ssl)return this.attachListeners(this.stream);this.stream.once("data",function(e){switch(e.toString("utf8")){case"S":break;case"N":return n.stream.end(),n.emit("error",Error("The server does not support SSL connections"));default:return n.stream.end(),n.emit("error",Error("There was an error establishing an SSL connection"))}var s=(rL(),tw(rI));let o={socket:n.stream};!0!==n.ssl&&(Object.assign(o,n.ssl),"key"in n.ssl&&(o.key=n.ssl.key)),0===r.isIP(t)&&(o.servername=t);try{n.stream=s.connect(o)}catch(e){return n.emit("error",e)}n.attachListeners(n.stream),n.stream.on("error",i),n.emit("sslconnect")})}attachListeners(e){e.on("end",()=>{this.emit("end")}),i(e,e=>{var t="error"===e.name?"errorMessage":e.name;this._emitMessage&&this.emit("message",e),this.emit(t,e)})}requestSsl(){this.stream.write(s.requestSsl())}startup(e){this.stream.write(s.startup(e))}cancel(e,t){this._send(s.cancel(e,t))}password(e){this._send(s.password(e))}sendSASLInitialResponseMessage(e,t){this._send(s.sendSASLInitialResponseMessage(e,t))}sendSCRAMClientFinalMessage(e){this._send(s.sendSCRAMClientFinalMessage(e))}_send(e){return!!this.stream.writable&&this.stream.write(e)}query(e){this._send(s.query(e))}parse(e){this._send(s.parse(e))}bind(e){this._send(s.bind(e))}execute(e){this._send(s.execute(e))}flush(){this.stream.writable&&this.stream.write(o)}sync(){this._ending=!0,this._send(o),this._send(a)}ref(){this.stream.ref()}unref(){this.stream.unref()}end(){return(this._ending=!0,this._connecting&&this.stream.writable)?this.stream.write(u,()=>{this.stream.end()}):void this.stream.end()}close(e){this._send(s.close(e))}describe(e){this._send(s.describe(e))}sendCopyFromChunk(e){this._send(s.copyData(e))}endCopyFrom(){this._send(s.copyDone())}sendCopyFail(e){this._send(s.copyFail(e))}};tg(c,"Connection"),t.exports=c}),rD=ty((e,t)=>{tA();var r=tT().EventEmitter,n=(re(),tw(t9),t8()),i=rt(),s=ry(),o=tX(),a=rE(),u=rR(),c=t4(),l=rM(),h=class extends r{constructor(e){super(),this.connectionParameters=new a(e),this.user=this.connectionParameters.user,this.database=this.connectionParameters.database,this.port=this.connectionParameters.port,this.host=this.connectionParameters.host,Object.defineProperty(this,"password",{configurable:!0,enumerable:!1,writable:!0,value:this.connectionParameters.password}),this.replication=this.connectionParameters.replication;var t=e||{};this._Promise=t.Promise||ti.Promise,this._types=new o(t.types),this._ending=!1,this._connecting=!1,this._connected=!1,this._connectionError=!1,this._queryable=!0,this.connection=t.connection||new l({stream:t.stream,ssl:this.connectionParameters.ssl,keepAlive:t.keepAlive||!1,keepAliveInitialDelayMillis:t.keepAliveInitialDelayMillis||0,encoding:this.connectionParameters.client_encoding||"utf8"}),this.queryQueue=[],this.binary=t.binary||c.binary,this.processID=null,this.secretKey=null,this.ssl=this.connectionParameters.ssl||!1,this.ssl&&this.ssl.key&&Object.defineProperty(this.ssl,"key",{enumerable:!1}),this._connectionTimeoutMillis=t.connectionTimeoutMillis||0}_errorAllQueries(e){let t=tg(t=>{ta.nextTick(()=>{t.handleError(e,this.connection)})},"enqueueError");this.activeQuery&&(t(this.activeQuery),this.activeQuery=null),this.queryQueue.forEach(t),this.queryQueue.length=0}_connect(e){var t=this,r=this.connection;if(this._connectionCallback=e,this._connecting||this._connected){let t=Error("Client has already been connected. You cannot reuse a client.");ta.nextTick(()=>{e(t)});return}this._connecting=!0,this.connectionTimeoutHandle,this._connectionTimeoutMillis>0&&(this.connectionTimeoutHandle=setTimeout(()=>{r._ending=!0,r.stream.destroy(Error("timeout expired"))},this._connectionTimeoutMillis)),this.host&&0===this.host.indexOf("/")?r.connect(this.host+"/.s.PGSQL."+this.port):r.connect(this.port,this.host),r.on("connect",function(){t.ssl?r.requestSsl():r.startup(t.getStartupConf())}),r.on("sslconnect",function(){r.startup(t.getStartupConf())}),this._attachListeners(r),r.once("end",()=>{let e=this._ending?Error("Connection terminated"):Error("Connection terminated unexpectedly");clearTimeout(this.connectionTimeoutHandle),this._errorAllQueries(e),this._ending||(this._connecting&&!this._connectionError?this._connectionCallback?this._connectionCallback(e):this._handleErrorEvent(e):this._connectionError||this._handleErrorEvent(e)),ta.nextTick(()=>{this.emit("end")})})}connect(e){return e?void this._connect(e):new this._Promise((e,t)=>{this._connect(r=>{r?t(r):e()})})}_attachListeners(e){e.on("authenticationCleartextPassword",this._handleAuthCleartextPassword.bind(this)),e.on("authenticationMD5Password",this._handleAuthMD5Password.bind(this)),e.on("authenticationSASL",this._handleAuthSASL.bind(this)),e.on("authenticationSASLContinue",this._handleAuthSASLContinue.bind(this)),e.on("authenticationSASLFinal",this._handleAuthSASLFinal.bind(this)),e.on("backendKeyData",this._handleBackendKeyData.bind(this)),e.on("error",this._handleErrorEvent.bind(this)),e.on("errorMessage",this._handleErrorMessage.bind(this)),e.on("readyForQuery",this._handleReadyForQuery.bind(this)),e.on("notice",this._handleNotice.bind(this)),e.on("rowDescription",this._handleRowDescription.bind(this)),e.on("dataRow",this._handleDataRow.bind(this)),e.on("portalSuspended",this._handlePortalSuspended.bind(this)),e.on("emptyQuery",this._handleEmptyQuery.bind(this)),e.on("commandComplete",this._handleCommandComplete.bind(this)),e.on("parseComplete",this._handleParseComplete.bind(this)),e.on("copyInResponse",this._handleCopyInResponse.bind(this)),e.on("copyData",this._handleCopyData.bind(this)),e.on("notification",this._handleNotification.bind(this))}_checkPgPass(e){let t=this.connection;"function"==typeof this.password?this._Promise.resolve().then(()=>this.password()).then(r=>{if(void 0!==r){if("string"!=typeof r)return void t.emit("error",TypeError("Password must be a string"));this.connectionParameters.password=this.password=r}else this.connectionParameters.password=this.password=null;e()}).catch(e=>{t.emit("error",e)}):null!==this.password?e():s(this.connectionParameters,t=>{void 0!==t&&(this.connectionParameters.password=this.password=t),e()})}_handleAuthCleartextPassword(e){this._checkPgPass(()=>{this.connection.password(this.password)})}_handleAuthMD5Password(e){this._checkPgPass(()=>{let t=n.postgresMd5PasswordHash(this.user,this.password,e.salt);this.connection.password(t)})}_handleAuthSASL(e){this._checkPgPass(()=>{this.saslSession=i.startSession(e.mechanisms),this.connection.sendSASLInitialResponseMessage(this.saslSession.mechanism,this.saslSession.response)})}_handleAuthSASLContinue(e){i.continueSession(this.saslSession,this.password,e.data),this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}_handleAuthSASLFinal(e){i.finalizeSession(this.saslSession,e.data),this.saslSession=null}_handleBackendKeyData(e){this.processID=e.processID,this.secretKey=e.secretKey}_handleReadyForQuery(e){this._connecting&&(this._connecting=!1,this._connected=!0,clearTimeout(this.connectionTimeoutHandle),this._connectionCallback&&(this._connectionCallback(null,this),this._connectionCallback=null),this.emit("connect"));let{activeQuery:t}=this;this.activeQuery=null,this.readyForQuery=!0,t&&t.handleReadyForQuery(this.connection),this._pulseQueryQueue()}_handleErrorWhileConnecting(e){if(!this._connectionError){if(this._connectionError=!0,clearTimeout(this.connectionTimeoutHandle),this._connectionCallback)return this._connectionCallback(e);this.emit("error",e)}}_handleErrorEvent(e){if(this._connecting)return this._handleErrorWhileConnecting(e);this._queryable=!1,this._errorAllQueries(e),this.emit("error",e)}_handleErrorMessage(e){if(this._connecting)return this._handleErrorWhileConnecting(e);let t=this.activeQuery;if(!t)return void this._handleErrorEvent(e);this.activeQuery=null,t.handleError(e,this.connection)}_handleRowDescription(e){this.activeQuery.handleRowDescription(e)}_handleDataRow(e){this.activeQuery.handleDataRow(e)}_handlePortalSuspended(e){this.activeQuery.handlePortalSuspended(this.connection)}_handleEmptyQuery(e){this.activeQuery.handleEmptyQuery(this.connection)}_handleCommandComplete(e){this.activeQuery.handleCommandComplete(e,this.connection)}_handleParseComplete(e){this.activeQuery.name&&(this.connection.parsedStatements[this.activeQuery.name]=this.activeQuery.text)}_handleCopyInResponse(e){this.activeQuery.handleCopyInResponse(this.connection)}_handleCopyData(e){this.activeQuery.handleCopyData(e,this.connection)}_handleNotification(e){this.emit("notification",e)}_handleNotice(e){this.emit("notice",e)}getStartupConf(){var e=this.connectionParameters,t={user:e.user,database:e.database},r=e.application_name||e.fallback_application_name;return r&&(t.application_name=r),e.replication&&(t.replication=""+e.replication),e.statement_timeout&&(t.statement_timeout=String(parseInt(e.statement_timeout,10))),e.lock_timeout&&(t.lock_timeout=String(parseInt(e.lock_timeout,10))),e.idle_in_transaction_session_timeout&&(t.idle_in_transaction_session_timeout=String(parseInt(e.idle_in_transaction_session_timeout,10))),e.options&&(t.options=e.options),t}cancel(e,t){if(e.activeQuery===t){var r=this.connection;this.host&&0===this.host.indexOf("/")?r.connect(this.host+"/.s.PGSQL."+this.port):r.connect(this.port,this.host),r.on("connect",function(){r.cancel(e.processID,e.secretKey)})}else -1!==e.queryQueue.indexOf(t)&&e.queryQueue.splice(e.queryQueue.indexOf(t),1)}setTypeParser(e,t,r){return this._types.setTypeParser(e,t,r)}getTypeParser(e,t){return this._types.getTypeParser(e,t)}escapeIdentifier(e){return'"'+e.replace(/"/g,'""')+'"'}escapeLiteral(e){for(var t=!1,r="'",n=0;n<e.length;n++){var i=e[n];"'"===i?r+=i+i:"\\"===i?(r+=i+i,t=!0):r+=i}return r+="'",!0===t&&(r=" E"+r),r}_pulseQueryQueue(){if(!0===this.readyForQuery)if(this.activeQuery=this.queryQueue.shift(),this.activeQuery){this.readyForQuery=!1,this.hasExecuted=!0;let e=this.activeQuery.submit(this.connection);e&&ta.nextTick(()=>{this.activeQuery.handleError(e,this.connection),this.readyForQuery=!0,this._pulseQueryQueue()})}else this.hasExecuted&&(this.activeQuery=null,this.emit("drain"))}query(e,t,r){var n,i,s,o,a;if(null==e)throw TypeError("Client was passed a null or undefined query");return"function"==typeof e.submit?(s=e.query_timeout||this.connectionParameters.query_timeout,i=n=e,"function"==typeof t&&(n.callback=n.callback||t)):(s=this.connectionParameters.query_timeout,(n=new u(e,t,r)).callback||(i=new this._Promise((e,t)=>{n.callback=(r,n)=>r?t(r):e(n)}))),s&&(a=n.callback,o=setTimeout(()=>{var e=Error("Query read timeout");ta.nextTick(()=>{n.handleError(e,this.connection)}),a(e),n.callback=()=>{};var t=this.queryQueue.indexOf(n);t>-1&&this.queryQueue.splice(t,1),this._pulseQueryQueue()},s),n.callback=(e,t)=>{clearTimeout(o),a(e,t)}),this.binary&&!n.binary&&(n.binary=!0),n._result&&!n._result._types&&(n._result._types=this._types),this._queryable?this._ending?ta.nextTick(()=>{n.handleError(Error("Client was closed and is not queryable"),this.connection)}):(this.queryQueue.push(n),this._pulseQueryQueue()):ta.nextTick(()=>{n.handleError(Error("Client has encountered a connection error and is not queryable"),this.connection)}),i}ref(){this.connection.ref()}unref(){this.connection.unref()}end(e){if(this._ending=!0,!this.connection._connecting)if(!e)return this._Promise.resolve();else e();if(this.activeQuery||!this._queryable?this.connection.stream.destroy():this.connection.end(),!e)return new this._Promise(e=>{this.connection.once("end",e)});this.connection.once("end",e)}};tg(h,"Client"),h.Query=u,t.exports=h}),rk=ty((e,t)=>{tA();var r=tT().EventEmitter,n=tg(function(){},"NOOP"),i=tg((e,t)=>{let r=e.findIndex(t);return -1===r?void 0:e.splice(r,1)[0]},"removeWhere"),s=class{constructor(e,t,r){this.client=e,this.idleListener=t,this.timeoutId=r}};tg(s,"IdleItem");var o=class{constructor(e){this.callback=e}};function a(){throw Error("Release called on client which has already been released to the pool.")}function u(e,t){let r,n;return t?{callback:t,result:void 0}:{callback:tg(function(e,t){e?r(e):n(t)},"cb"),result:new e(function(e,t){n=e,r=t}).catch(e=>{throw Error.captureStackTrace(e),e})}}function c(e,t){return tg(function r(n){n.client=t,t.removeListener("error",r),t.on("error",()=>{e.log("additional client error after disconnection due to error",n)}),e._remove(t),e.emit("error",n,t)},"idleListener")}tg(o,"PendingItem"),tg(a,"throwOnDoubleRelease"),tg(u,"promisify"),tg(c,"makeIdleListener");var l=class extends r{constructor(e,t){super(),this.options=Object.assign({},e),null!=e&&"password"in e&&Object.defineProperty(this.options,"password",{configurable:!0,enumerable:!1,writable:!0,value:e.password}),null!=e&&e.ssl&&e.ssl.key&&Object.defineProperty(this.options.ssl,"key",{enumerable:!1}),this.options.max=this.options.max||this.options.poolSize||10,this.options.min=this.options.min||0,this.options.maxUses=this.options.maxUses||1/0,this.options.allowExitOnIdle=this.options.allowExitOnIdle||!1,this.options.maxLifetimeSeconds=this.options.maxLifetimeSeconds||0,this.log=this.options.log||function(){},this.Client=this.options.Client||t||rH().Client,this.Promise=this.options.Promise||ti.Promise,typeof this.options.idleTimeoutMillis>"u"&&(this.options.idleTimeoutMillis=1e4),this._clients=[],this._idle=[],this._expired=new WeakSet,this._pendingQueue=[],this._endCallback=void 0,this.ending=!1,this.ended=!1}_isFull(){return this._clients.length>=this.options.max}_isAboveMin(){return this._clients.length>this.options.min}_pulseQueue(){if(this.log("pulse queue"),this.ended)return void this.log("pulse queue ended");if(this.ending){this.log("pulse queue on ending"),this._idle.length&&this._idle.slice().map(e=>{this._remove(e.client)}),this._clients.length||(this.ended=!0,this._endCallback());return}if(!this._pendingQueue.length)return void this.log("no queued requests");if(!this._idle.length&&this._isFull())return;let e=this._pendingQueue.shift();if(this._idle.length){let t=this._idle.pop();clearTimeout(t.timeoutId);let r=t.client;r.ref&&r.ref();let n=t.idleListener;return this._acquireClient(r,e,n,!1)}if(!this._isFull())return this.newClient(e);throw Error("unexpected condition")}_remove(e){let t=i(this._idle,t=>t.client===e);void 0!==t&&clearTimeout(t.timeoutId),this._clients=this._clients.filter(t=>t!==e),e.end(),this.emit("remove",e)}connect(e){if(this.ending){let t=Error("Cannot use a pool after calling end on the pool");return e?e(t):this.Promise.reject(t)}let t=u(this.Promise,e),r=t.result;if(this._isFull()||this._idle.length){if(this._idle.length&&ta.nextTick(()=>this._pulseQueue()),!this.options.connectionTimeoutMillis)return this._pendingQueue.push(new o(t.callback)),r;let e=tg((e,r,n)=>{clearTimeout(s),t.callback(e,r,n)},"queueCallback"),n=new o(e),s=setTimeout(()=>{i(this._pendingQueue,t=>t.callback===e),n.timedOut=!0,t.callback(Error("timeout exceeded when trying to connect"))},this.options.connectionTimeoutMillis);return s.unref&&s.unref(),this._pendingQueue.push(n),r}return this.newClient(new o(t.callback)),r}newClient(e){let t=new this.Client(this.options);this._clients.push(t);let r=c(this,t);this.log("checking client timeout");let i,s=!1;this.options.connectionTimeoutMillis&&(i=setTimeout(()=>{this.log("ending client due to timeout"),s=!0,t.connection?t.connection.stream.destroy():t.end()},this.options.connectionTimeoutMillis)),this.log("connecting new client"),t.connect(a=>{if(i&&clearTimeout(i),t.on("error",r),a)this.log("client failed to connect",a),this._clients=this._clients.filter(e=>e!==t),s&&(a=Error("Connection terminated due to connection timeout",{cause:a})),this._pulseQueue(),e.timedOut||e.callback(a,void 0,n);else{if(this.log("new client connected"),0!==this.options.maxLifetimeSeconds){let e=setTimeout(()=>{this.log("ending client due to expired lifetime"),this._expired.add(t),-1!==this._idle.findIndex(e=>e.client===t)&&this._acquireClient(t,new o((e,t,r)=>r()),r,!1)},1e3*this.options.maxLifetimeSeconds);e.unref(),t.once("end",()=>clearTimeout(e))}return this._acquireClient(t,e,r,!0)}})}_acquireClient(e,t,r,i){i&&this.emit("connect",e),this.emit("acquire",e),e.release=this._releaseOnce(e,r),e.removeListener("error",r),t.timedOut?i&&this.options.verify?this.options.verify(e,e.release):e.release():i&&this.options.verify?this.options.verify(e,r=>{if(r)return e.release(r),t.callback(r,void 0,n);t.callback(void 0,e,e.release)}):t.callback(void 0,e,e.release)}_releaseOnce(e,t){let r=!1;return n=>{r&&a(),r=!0,this._release(e,t,n)}}_release(e,t,r){let n;if(e.on("error",t),e._poolUseCount=(e._poolUseCount||0)+1,this.emit("release",r,e),r||this.ending||!e._queryable||e._ending||e._poolUseCount>=this.options.maxUses){e._poolUseCount>=this.options.maxUses&&this.log("remove expended client"),this._remove(e),this._pulseQueue();return}if(this._expired.has(e)){this.log("remove expired client"),this._expired.delete(e),this._remove(e),this._pulseQueue();return}this.options.idleTimeoutMillis&&this._isAboveMin()&&(n=setTimeout(()=>{this.log("remove idle client"),this._remove(e)},this.options.idleTimeoutMillis),this.options.allowExitOnIdle&&n.unref()),this.options.allowExitOnIdle&&e.unref(),this._idle.push(new s(e,t,n)),this._pulseQueue()}query(e,t,r){if("function"==typeof e){let t=u(this.Promise,e);return ts(function(){return t.callback(Error("Passing a function as the first parameter to pool.query is not supported"))}),t.result}"function"==typeof t&&(r=t,t=void 0);let n=u(this.Promise,r);return r=n.callback,this.connect((n,i)=>{if(n)return r(n);let s=!1,o=tg(e=>{s||(s=!0,i.release(e),r(e))},"onError");i.once("error",o),this.log("dispatching query");try{i.query(e,t,(e,t)=>{if(this.log("query dispatched"),i.removeListener("error",o),!s)return s=!0,i.release(e),e?r(e):r(void 0,t)})}catch(e){return i.release(e),r(e)}}),n.result}end(e){if(this.log("ending"),this.ending){let t=Error("Called end on pool more than once");return e?e(t):this.Promise.reject(t)}this.ending=!0;let t=u(this.Promise,e);return this._endCallback=t.callback,this._pulseQueue(),t.result}get waitingCount(){return this._pendingQueue.length}get idleCount(){return this._idle.length}get expiredCount(){return this._clients.reduce((e,t)=>e+ +!!this._expired.has(t),0)}get totalCount(){return this._clients.length}};tg(l,"Pool"),t.exports=l}),rB={};tb(rB,{default:()=>rj});var rj,rU=tm(()=>{tA(),rj={}}),rF=ty((e,t)=>{t.exports={name:"pg",version:"8.8.0",description:"PostgreSQL client - pure javascript & libpq with the same API",keywords:["database","libpq","pg","postgre","postgres","postgresql","rdbms"],homepage:"https://github.com/brianc/node-postgres",repository:{type:"git",url:"git://github.com/brianc/node-postgres.git",directory:"packages/pg"},author:"Brian Carlson <brian.m.carlson@gmail.com>",main:"./lib",dependencies:{"buffer-writer":"2.0.0","packet-reader":"1.0.0","pg-connection-string":"^2.5.0","pg-pool":"^3.5.2","pg-protocol":"^1.5.0","pg-types":"^2.1.0",pgpass:"1.x"},devDependencies:{async:"2.6.4",bluebird:"3.5.2",co:"4.6.0","pg-copy-streams":"0.3.0"},peerDependencies:{"pg-native":">=3.0.1"},peerDependenciesMeta:{"pg-native":{optional:!0}},scripts:{test:"make test-all"},files:["lib","SPONSORS.md"],license:"MIT",engines:{node:">= 8.0.0"},gitHead:"c99fb2c127ddf8d712500db2c7b9a5491a178655"}}),rq=ty((e,t)=>{tA();var r=tT().EventEmitter,n=(re(),tw(t9)),i=t8(),s=t.exports=function(e,t,n){r.call(this),e=i.normalizeQueryConfig(e,t,n),this.text=e.text,this.values=e.values,this.name=e.name,this.callback=e.callback,this.state="new",this._arrayMode="array"===e.rowMode,this._emitRowEvents=!1,this.on("newListener",(function(e){"row"===e&&(this._emitRowEvents=!0)}).bind(this))};n.inherits(s,r);var o={sqlState:"code",statementPosition:"position",messagePrimary:"message",context:"where",schemaName:"schema",tableName:"table",columnName:"column",dataTypeName:"dataType",constraintName:"constraint",sourceFile:"file",sourceLine:"line",sourceFunction:"routine"};s.prototype.handleError=function(e){var t=this.native.pq.resultErrorFields();if(t)for(var r in t)e[o[r]||r]=t[r];this.callback?this.callback(e):this.emit("error",e),this.state="error"},s.prototype.then=function(e,t){return this._getPromise().then(e,t)},s.prototype.catch=function(e){return this._getPromise().catch(e)},s.prototype._getPromise=function(){return this._promise||(this._promise=new Promise((function(e,t){this._once("end",e),this._once("error",t)}).bind(this))),this._promise},s.prototype.submit=function(e){this.state="running";var t=this;this.native=e.native,e.native.arrayMode=this._arrayMode;var r=tg(function(r,n,i){if(e.native.arrayMode=!1,ts(function(){t.emit("_done")}),r)return t.handleError(r);t._emitRowEvents&&(i.length>1?n.forEach((e,r)=>{e.forEach(e=>{t.emit("row",e,i[r])})}):n.forEach(function(e){t.emit("row",e,i)})),t.state="end",t.emit("end",i),t.callback&&t.callback(null,i)},"after");if(ta.domain&&(r=ta.domain.bind(r)),this.name){this.name.length>63&&(console.error("Warning! Postgres only supports 63 characters for query names."),console.error("You supplied %s (%s)",this.name,this.name.length),console.error("This can cause conflicts and silent errors executing queries"));var n=(this.values||[]).map(i.prepareValue);if(e.namedQueries[this.name]){if(this.text&&e.namedQueries[this.name]!==this.text){let e=Error(`Prepa\
32
+ red statements must be unique - '${this.name}' was used for a different statement`);return r(e)}return e.native.execute(this.name,n,r)}return e.native.prepare(this.name,this.text,n.length,function(i){return i?r(i):(e.namedQueries[t.name]=t.text,t.native.execute(t.name,n,r))})}if(this.values){if(!Array.isArray(this.values)){let e=Error("Query values must be an array");return r(e)}var s=this.values.map(i.prepareValue);e.native.query(this.text,s,r)}else e.native.query(this.text,r)}}),r$=ty((e,t)=>{tA();var r=(rU(),tw(rB)),n=tX(),i=(rF(),tT().EventEmitter),s=(re(),tw(t9)),o=rE(),a=rq(),u=t.exports=function(e){i.call(this),e=e||{},this._Promise=e.Promise||ti.Promise,this._types=new n(e.types),this.native=new r({types:this._types}),this._queryQueue=[],this._ending=!1,this._connecting=!1,this._connected=!1,this._queryable=!0;var t=this.connectionParameters=new o(e);this.user=t.user,Object.defineProperty(this,"password",{configurable:!0,enumerable:!1,writable:!0,value:t.password}),this.database=t.database,this.host=t.host,this.port=t.port,this.namedQueries={}};u.Query=a,s.inherits(u,i),u.prototype._errorAllQueries=function(e){let t=tg(t=>{ta.nextTick(()=>{t.native=this.native,t.handleError(e)})},"enqueueError");this._hasActiveQuery()&&(t(this._activeQuery),this._activeQuery=null),this._queryQueue.forEach(t),this._queryQueue.length=0},u.prototype._connect=function(e){var t=this;if(this._connecting)return void ta.nextTick(()=>e(Error("Client has already been connected. You cannot reuse a client.")));this._connecting=!0,this.connectionParameters.getLibpqConnectionString(function(r,n){if(r)return e(r);t.native.connect(n,function(r){if(r)return t.native.end(),e(r);t._connected=!0,t.native.on("error",function(e){t._queryable=!1,t._errorAllQueries(e),t.emit("error",e)}),t.native.on("notification",function(e){t.emit("notification",{channel:e.relname,payload:e.extra})}),t.emit("connect"),t._pulseQueryQueue(!0),e()})})},u.prototype.connect=function(e){return e?void this._connect(e):new this._Promise((e,t)=>{this._connect(r=>{r?t(r):e()})})},u.prototype.query=function(e,t,r){var n,i,s,o,u;if(null==e)throw TypeError("Client was passed a null or undefined query");if("function"==typeof e.submit)s=e.query_timeout||this.connectionParameters.query_timeout,i=n=e,"function"==typeof t&&(e.callback=t);else if(s=this.connectionParameters.query_timeout,!(n=new a(e,t,r)).callback){let e,t;i=new this._Promise((r,n)=>{e=r,t=n}),n.callback=(r,n)=>r?t(r):e(n)}return s&&(u=n.callback,o=setTimeout(()=>{var e=Error("Query read timeout");ta.nextTick(()=>{n.handleError(e,this.connection)}),u(e),n.callback=()=>{};var t=this._queryQueue.indexOf(n);t>-1&&this._queryQueue.splice(t,1),this._pulseQueryQueue()},s),n.callback=(e,t)=>{clearTimeout(o),u(e,t)}),this._queryable?this._ending?(n.native=this.native,ta.nextTick(()=>{n.handleError(Error("Client was closed and is not queryable"))})):(this._queryQueue.push(n),this._pulseQueryQueue()):(n.native=this.native,ta.nextTick(()=>{n.handleError(Error("Client has encountered a connection error and is not queryable"))})),i},u.prototype.end=function(e){var t,r=this;return this._ending=!0,this._connected||this.once("connect",this.end.bind(this,e)),e||(t=new this._Promise(function(t,r){e=tg(e=>e?r(e):t(),"cb")})),this.native.end(function(){r._errorAllQueries(Error("Connection terminated")),ta.nextTick(()=>{r.emit("end"),e&&e()})}),t},u.prototype._hasActiveQuery=function(){return this._activeQuery&&"error"!==this._activeQuery.state&&"end"!==this._activeQuery.state},u.prototype._pulseQueryQueue=function(e){if(this._connected&&!this._hasActiveQuery()){var t=this._queryQueue.shift();if(!t){e||this.emit("drain");return}this._activeQuery=t,t.submit(this);var r=this;t.once("_done",function(){r._pulseQueryQueue()})}},u.prototype.cancel=function(e){this._activeQuery===e?this.native.cancel(function(){}):-1!==this._queryQueue.indexOf(e)&&this._queryQueue.splice(this._queryQueue.indexOf(e),1)},u.prototype.ref=function(){},u.prototype.unref=function(){},u.prototype.setTypeParser=function(e,t,r){return this._types.setTypeParser(e,t,r)},u.prototype.getTypeParser=function(e,t){return this._types.getTypeParser(e,t)}}),rG=ty((e,t)=>{tA(),t.exports=r$()}),rH=ty((e,t)=>{tA();var r=rD(),n=t4(),i=rM(),s=rk(),{DatabaseError:o}=rC(),a=tg(e=>{var t;return tg(t=class extends s{constructor(t){super(t,e)}},"BoundPool"),t},"poolFactory"),u=tg(function(e){this.defaults=n,this.Client=e,this.Query=this.Client.Query,this.Pool=a(this.Client),this._pools=[],this.Connection=i,this.types=tY(),this.DatabaseError=o},"PG");"u">typeof ta.env.NODE_PG_FORCE_NATIVE?t.exports=new u(rG()):(t.exports=new u(r),Object.defineProperty(t.exports,"native",{configurable:!0,enumerable:!1,get(){var e=null;try{e=new u(rG())}catch(e){if("MODULE_NOT_FOUND"!==e.code)throw e}return Object.defineProperty(t.exports,"native",{value:e}),e}}))});tA(),tA(),tM(),tB(),tA();var rV=Object.defineProperty,rW=Object.defineProperties,rQ=Object.getOwnPropertyDescriptors,rY=Object.getOwnPropertySymbols,rX=Object.prototype.hasOwnProperty,rz=Object.prototype.propertyIsEnumerable,rK=tg((e,t,r)=>t in e?rV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,"__defNormalProp"),rJ=tg((e,t)=>{for(var r in t||(t={}))rX.call(t,r)&&rK(e,r,t[r]);if(rY)for(var r of rY(t))rz.call(t,r)&&rK(e,r,t[r]);return e},"__spreadValues"),rZ=tg((e,t)=>rW(e,rQ(t)),"__spreadProps"),r0=2===new Uint8Array(new Uint16Array([258]).buffer)[0],r1=new TextDecoder,r2=new TextEncoder,r6=r2.encode("0123456789abcdef"),r3=r2.encode("0123456789ABCDEF"),r5=r2.encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/").slice();function r4(e,{alphabet:t,scratchArr:r}={}){if(!n)if(n=new Uint16Array(256),i=new Uint16Array(256),r0)for(let e=0;e<256;e++)n[e]=r6[15&e]<<8|r6[e>>>4],i[e]=r3[15&e]<<8|r3[e>>>4];else for(let e=0;e<256;e++)n[e]=r6[15&e]|r6[e>>>4]<<8,i[e]=r3[15&e]|r3[e>>>4]<<8;e.byteOffset%4!=0&&(e=new Uint8Array(e));let s=e.length,o=s>>>2,a=r||new Uint16Array(s),u=new Uint32Array(e.buffer,e.byteOffset,o),c=new Uint32Array(a.buffer,a.byteOffset,s>>>1),l="upper"===t?i:n,h=0,f=0,d;if(r0)for(;h<o;)d=u[h++],c[f++]=l[d>>>8&255]<<16|l[255&d],c[f++]=l[d>>>24]<<16|l[d>>>16&255];else for(;h<o;)d=u[h++],c[f++]=l[d>>>24]<<16|l[d>>>16&255],c[f++]=l[d>>>8&255]<<16|l[255&d];for(h<<=2;h<s;)a[h]=l[e[h++]];return r1.decode(a.subarray(0,s))}function r8(e,t={}){let r="",n=e.length,i=Math.ceil(n/504e3),s=new Uint16Array(i>1?504e3:n);for(let n=0;n<i;n++){let i=504e3*n,o=i+504e3;r+=r4(e.subarray(i,o),rZ(rJ({},t),{scratchArr:s}))}return r}function r9(e,t={}){return"upper"!==t.alphabet&&"function"==typeof e.toHex?e.toHex():r8(e,t)}r5[62]=45,r5[63]=95,tg(r4,"_toHex"),tg(r8,"_toHexChunked"),tg(r9,"toHex"),tA();var r7=class e{constructor(e,t){this.strings=e,this.values=t}toParameterizedQuery(t={query:"",params:[]}){let{strings:r,values:n}=this;for(let i=0,s=r.length;i<s;i++)if(t.query+=r[i],i<n.length){let r=n[i];if(r instanceof nt)t.query+=r.sql;else if(r instanceof nf)if(r.queryData instanceof e)r.queryData.toParameterizedQuery(t);else{if(r.queryData.params?.length)throw Error("This query is not composable");t.query+=r.queryData.query}else{let{params:e}=t;e.push(r),t.query+="$"+e.length,(r instanceof to||ArrayBuffer.isView(r))&&(t.query+="::bytea")}}return t}};tg(r7,"SqlTemplate");var ne=class{constructor(e){this.sql=e}};tg(ne,"UnsafeRawSql");var nt=ne;function nr(){}tA(),tg(nr,"warnIfBrowser"),tM();var nn=t_(tX()),ni=t_(t8()),ns=class e extends Error{constructor(t){super(t),tE(this,"name","NeonDbError"),tE(this,"severity"),tE(this,"code"),tE(this,"detail"),tE(this,"hint"),tE(this,"position"),tE(this,"internalPosition"),tE(this,"internalQuery"),tE(this,"where"),tE(this,"schema"),tE(this,"table"),tE(this,"column"),tE(this,"dataType"),tE(this,"constraint"),tE(this,"file"),tE(this,"line"),tE(this,"routine"),tE(this,"sourceError"),"captureStackTrace"in Error&&"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,e)}};tg(ns,"NeonDbError");var no="transaction() expects an array of queries, or a function returning an array of queries",na=["severity","code","detail","hint","position","internalPosition","internalQuery","where","schema","table","column","dataType","constraint","file","line","routine"];function nu(e){return e instanceof to?"\\x"+r9(e):e}function nc(e){let{query:t,params:r}=e instanceof r7?e.toParameterizedQuery():e;return{query:t,params:r.map(e=>nu((0,ni.prepareValue)(e)))}}function nl(e,{arrayMode:t,fullResults:r,fetchOptions:n,isolationLevel:i,readOnly:s,deferrable:o,authToken:a,disableWarningInBrowsers:u}={}){let c;if(!e)throw Error("No database connection string was provided to `neon()`. Perhaps an environment variable has not been set?");try{c=tk(e)}catch{throw Error("Database connection string provided to `neon()` is not a valid URL. Connection string: "+String(e))}let{protocol:l,username:h,hostname:f,port:d,pathname:p}=c;if("postgres:"!==l&&"postgresql:"!==l||!h||!f||!p)throw Error("Database connection string format for `neon()` should be: postgresql://user:password@host.tld/dbname?option=value");function g(e,...t){if(!(Array.isArray(e)&&Array.isArray(e.raw)&&Array.isArray(t)))throw Error('This function can now be called only as a tagged-template function: sql`SELECT ${value}`, not sql("SELECT $1", [value], options). For a conventional function call with value placeholders ($1, $2, etc.), use sql.query("SELECT $1", [value], options).');return new nf(m,new r7(e,t))}async function m(c,l,h){let p,{fetchEndpoint:g,fetchFunction:m}=tL,y=Array.isArray(c)?{queries:c.map(e=>nc(e))}:nc(c),b=n??{},v=t??!1,_=r??!1,w=i,E=s,S=o;void 0!==h&&(void 0!==h.fetchOptions&&(b={...b,...h.fetchOptions}),void 0!==h.arrayMode&&(v=h.arrayMode),void 0!==h.fullResults&&(_=h.fullResults),void 0!==h.isolationLevel&&(w=h.isolationLevel),void 0!==h.readOnly&&(E=h.readOnly),void 0!==h.deferrable&&(S=h.deferrable)),void 0===l||Array.isArray(l)||void 0===l.fetchOptions||(b={...b,...l.fetchOptions});let R=a;Array.isArray(l)||l?.authToken===void 0||(R=l.authToken);let x="function"==typeof g?g(f,d,{jwtAuth:void 0!==R}):g,A={"Neon-Connection-String":e,"Neon-Raw-Text-Output":"true","Neon-Array-Mode":"true"},T=await np(R);T&&(A.Authorization=`Bearer ${T}`),Array.isArray(c)&&(void 0!==w&&(A["Neon-Batch-Isolation-Level"]=w),void 0!==E&&(A["Neon-Batch-Read-Only"]=String(E)),void 0!==S&&(A["Neon-Batch-Deferrable"]=String(S))),u||tL.disableWarningInBrowsers||nr();try{p=await (m??fetch)(x,{method:"POST",body:JSON.stringify(y),headers:A,...b})}catch(t){let e=new ns(`Error connecting to database: ${t}`);throw e.sourceError=t,e}if(p.ok){let e=await p.json();if(Array.isArray(c)){let t=e.results;if(!Array.isArray(t))throw new ns("Neon internal error: unexpected result format");return t.map((e,t)=>{let r=l[t]??{};return nd(e,{arrayMode:r.arrayMode??v,fullResults:r.fullResults??_,types:r.types})})}{let t=l??{};return nd(e,{arrayMode:t.arrayMode??v,fullResults:t.fullResults??_,types:t.types})}}{let{status:e}=p;if(400===e){let e=await p.json(),t=new ns(e.message);for(let r of na)t[r]=e[r]??void 0;throw t}{let t=await p.text();throw new ns(`Server error (HTTP status ${e}): ${t}`)}}}return tg(g,"templateFn"),g.query=(e,t,r)=>new nf(m,{query:e,params:t??[]},r),g.unsafe=e=>new nt(e),g.transaction=async(e,t)=>{if("function"==typeof e&&(e=e(g)),!Array.isArray(e))throw Error(no);return e.forEach(e=>{if(!(e instanceof nf))throw Error(no)}),m(e.map(e=>e.queryData),e.map(e=>e.opts??{}),t)},tg(m,"execute"),g}tg(nu,"encodeBuffersAsBytea"),tg(nc,"prepareQuery"),tg(nl,"neon");var nh=class{constructor(e,t,r){this.execute=e,this.queryData=t,this.opts=r}then(e,t){return this.execute(this.queryData,this.opts).then(e,t)}catch(e){return this.execute(this.queryData,this.opts).catch(e)}finally(e){return this.execute(this.queryData,this.opts).finally(e)}};tg(nh,"NeonQueryPromise");var nf=nh;function nd(e,{arrayMode:t,fullResults:r,types:n}){let i=new nn.default(n),s=e.fields.map(e=>e.name),o=e.fields.map(e=>i.getTypeParser(e.dataTypeID)),a=!0===t?e.rows.map(e=>e.map((e,t)=>null===e?null:o[t](e))):e.rows.map(e=>Object.fromEntries(e.map((e,t)=>[s[t],null===e?null:o[t](e)])));return r?(e.viaNeonFetch=!0,e.rowAsArray=t,e.rows=a,e._parsers=o,e._types=i,e):a}async function np(e){if("string"==typeof e)return e;if("function"==typeof e)try{return await Promise.resolve(e())}catch(t){let e=new ns("Error getting auth token.");throw t instanceof Error&&(e=new ns(`Error getting auth token: ${t.message}`)),e}}tg(nd,"processQueryResult"),tg(np,"getAuthToken"),tA();var ng=t_(rH());tA();var nm=t_(rH()),ny=class extends nm.Client{constructor(e){super(e),this.config=e}get neonConfig(){return this.connection.stream}connect(e){let{neonConfig:t}=this;t.forceDisablePgSSL&&(this.ssl=this.connection.ssl=!1),this.ssl&&t.useSecureWebSocket&&console.warn("SSL is enabled for both Postgres (e.g. ?sslmode=require in the connection string + forceDisablePgSSL = false) and the WebSocket tunnel (useSecureWebSocket = true). Double encryption will increase latency and CPU usage. It may be appropriate to disable SSL in the Postgres connection parameters or set forceDisablePgSSL = true.");let r="string"!=typeof this.config&&this.config?.host!==void 0||"string"!=typeof this.config&&this.config?.connectionString!==void 0||void 0!==ta.env.PGHOST,n=ta.env.USER??ta.env.USERNAME;if(!r&&"localhost"===this.host&&this.user===n&&this.database===n&&null===this.password)throw Error(`No database host or connection string wa\
33
33
  s set, and key parameters have default values (host: localhost, user: ${n}, db: ${n}, password: null\
34
34
  ). Is an environment variable missing? Alternatively, if you intended to connect with these paramete\
35
- rs, please set the host to 'localhost' explicitly.`);let i=super.connect(e),s=t.pipelineTLS&&this.ssl,o="password"===t.pipelineConnect;if(!s&&!t.pipelineConnect)return i;let a=this.connection;if(s&&a.on("connect",()=>a.stream.emit("data","S")),o){a.removeAllListeners("authenticationCleartextPassword"),a.removeAllListeners("readyForQuery"),a.once("readyForQuery",()=>a.on("readyForQuery",this._handleReadyForQuery.bind(this)));let e=this.ssl?"sslconnect":"connect";a.on(e,()=>{this.neonConfig.disableWarningInBrowsers||nt(),this._handleAuthCleartextPassword(),this._handleReadyForQuery()})}return i}async _handleAuthSASLContinue(e){if(typeof crypto>"u"||void 0===crypto.subtle||void 0===crypto.subtle.importKey)throw Error("Cannot use SASL auth when `crypto.subtle` is not defined");let t=crypto.subtle,r=this.saslSession,n=this.password,i=e.data;if("SASLInitialResponse"!==r.message||"string"!=typeof n||"string"!=typeof i)throw Error("SASL: protocol error");let s=Object.fromEntries(i.split(",").map(e=>{if(!/^.=/.test(e))throw Error("SASL: Invalid attribute pair entry");return[e[0],e.substring(2)]})),o=s.r,a=s.s,u=s.i;if(!o||!/^[!-+--~]+$/.test(o))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing/unprintable");if(!a||!/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/.test(a))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing/not base64");if(!u||!/^[1-9][0-9]*$/.test(u))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: missing/invalid iteration count");if(!o.startsWith(r.clientNonce))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with client nonce");if(o.length===r.clientNonce.length)throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce is too short");let c=parseInt(u,10),l=to.from(a,"base64"),h=new TextEncoder,f=h.encode(n),d=await t.importKey("raw",f,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),p=new Uint8Array(await t.sign("HMAC",d,to.concat([l,to.from([0,0,0,1])]))),g=p;for(var m=0;m<c-1;m++)p=new Uint8Array(await t.sign("HMAC",d,p)),g=to.from(g.map((e,t)=>g[t]^p[t]));let y=g,b=await t.importKey("raw",y,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),v=new Uint8Array(await t.sign("HMAC",b,h.encode("Client Key"))),_=await t.digest("SHA-256",v),w="n=*,r="+r.clientNonce,E="r="+o+",s="+a+",i="+c,S="c=biws,r="+o,R=w+","+E+","+S,x=await t.importKey("raw",_,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var A=new Uint8Array(await t.sign("HMAC",x,h.encode(R))),T=to.from(v.map((e,t)=>v[t]^A[t])).toString("base64");let P=await t.importKey("raw",y,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),O=await t.sign("HMAC",P,h.encode("Server Key")),C=await t.importKey("raw",O,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var I=to.from(await t.sign("HMAC",C,h.encode(R)));r.message="SASLResponse",r.serverSignature=I.toString("base64"),r.response=S+",p="+T,this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}};tp(nm,"NeonClient"),tL();var ny=tv(rw());function nb(e,t){let r,n;return t?{callback:t,result:void 0}:{callback:tp(function(e,t){e?r(e):n(t)},"cb"),result:new e(function(e,t){n=e,r=t})}}tp(nb,"promisify");var nv=class extends np.Pool{constructor(){super(...arguments),tw(this,"Client",nm),tw(this,"hasFetchUnsupportedListeners",!1),tw(this,"addListener",this.on)}on(e,t){return"error"!==e&&(this.hasFetchUnsupportedListeners=!0),super.on(e,t)}query(e,t,r){if(!tN.poolQueryViaFetch||this.hasFetchUnsupportedListeners||"function"==typeof e)return super.query(e,t,r);"function"==typeof t&&(r=t,t=void 0);let n=nb(this.Promise,r);r=n.callback;try{let n=new ny.default(this.options),i=encodeURIComponent,s=encodeURI,o=`postgresql://${i(n.user)}:${i(n.password)}@${i(n.host)}\
36
- /${s(n.database)}`,a="string"==typeof e?e:e.text,u=t??e.values??[];nc(o,{fullResults:!0,arrayMode:"array"===e.rowMode}).query(a,u,{types:e.types??this.options?.types}).then(e=>r(void 0,e)).catch(e=>r(e))}catch(e){r(e)}return n.result}};tp(nv,"NeonPool"),tL();var n_=tv(rG());n_.DatabaseError,n_.defaults,n_.escapeIdentifier,n_.escapeLiteral;var nw=n_.types,nE=Object.defineProperty,nS={};((e,t)=>{for(var r in t)nE(e,r,{get:t[r],enumerable:!0})})(nS,{$:()=>nx,bgBlack:()=>nV,bgBlue:()=>nX,bgCyan:()=>nK,bgGreen:()=>nQ,bgMagenta:()=>nz,bgRed:()=>nW,bgWhite:()=>nJ,bgYellow:()=>nY,black:()=>nD,blue:()=>nU,bold:()=>nP,cyan:()=>nq,dim:()=>nO,gray:()=>nG,green:()=>nB,grey:()=>nH,hidden:()=>nL,inverse:()=>nN,italic:()=>nC,magenta:()=>nF,red:()=>nk,reset:()=>nT,strikethrough:()=>nM,underline:()=>nI,white:()=>n$,yellow:()=>nj});var nR=!0;"undefined"!=typeof process&&({FORCE_COLOR:s,NODE_DISABLE_COLORS:o,NO_COLOR:a,TERM:u}=process.env||{},nR=process.stdout&&process.stdout.isTTY);var nx={enabled:!o&&null==a&&"dumb"!==u&&(null!=s&&"0"!==s||nR)};function nA(e,t){let r=RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1b[${e}m`,i=`\x1b[${t}m`;return function(e){return nx.enabled&&null!=e?n+(~(""+e).indexOf(i)?e.replace(r,i+n):e)+i:e}}var nT=nA(0,0),nP=nA(1,22),nO=nA(2,22),nC=nA(3,23),nI=nA(4,24),nN=nA(7,27),nL=nA(8,28),nM=nA(9,29),nD=nA(30,39),nk=nA(31,39),nB=nA(32,39),nj=nA(33,39),nU=nA(34,39),nF=nA(35,39),nq=nA(36,39),n$=nA(37,39),nG=nA(90,39),nH=nA(90,39),nV=nA(40,49),nW=nA(41,49),nQ=nA(42,49),nY=nA(43,49),nX=nA(44,49),nz=nA(45,49),nK=nA(46,49),nJ=nA(47,49),nZ=["green","yellow","blue","magenta","cyan","red"],n0=[],n1=Date.now(),n2=0,n6="undefined"!=typeof process?process.env:{};globalThis.DEBUG??=n6.DEBUG??"",globalThis.DEBUG_COLORS??=!n6.DEBUG_COLORS||"true"===n6.DEBUG_COLORS;var n3={enable(e){"string"==typeof e&&(globalThis.DEBUG=e)},disable(){let e=globalThis.DEBUG;return globalThis.DEBUG="",e},enabled(e){let t=globalThis.DEBUG.split(",").map(e=>e.replace(/[.+?^${}()|[\]\\]/g,"\\$&")),r=t.some(t=>""!==t&&"-"!==t[0]&&e.match(RegExp(t.split("*").join(".*")+"$"))),n=t.some(t=>""!==t&&"-"===t[0]&&e.match(RegExp(t.slice(1).split("*").join(".*")+"$")));return r&&!n},log:(...e)=>{let[t,r,...n]=e;(console.warn??console.log)(`${t} ${r}`,...n)},formatters:{}},n5=new Proxy(function(e){let t={color:nZ[n2++%nZ.length],enabled:n3.enabled(e),namespace:e,log:n3.log,extend:()=>{}};return new Proxy((...e)=>{let{enabled:r,namespace:n,color:i,log:s}=t;if(0!==e.length&&n0.push([n,...e]),n0.length>100&&n0.shift(),n3.enabled(n)||r){let t=e.map(e=>"string"==typeof e?e:function(e,t=2){let r=new Set;return JSON.stringify(e,(e,t)=>{if("object"==typeof t&&null!==t){if(r.has(t))return"[Circular *]";r.add(t)}else if("bigint"==typeof t)return t.toString();return t},t)}(e)),r=`+${Date.now()-n1}ms`;n1=Date.now(),globalThis.DEBUG_COLORS?s(nS[i](nP(n)),...t,nS[i](r)):s(n,...t,r)}},{get:(e,r)=>t[r],set:(e,r,n)=>t[r]=n})},{get:(e,t)=>n3[t],set:(e,t,r)=>n3[t]=r}),n4=class extends Error{name="DriverAdapterError";cause;constructor(e){super("string"==typeof e.message?e.message:e.kind),this.cause=e}};n5("driver-adapter-utils");var n8={Int32:0,Int64:1,Float:2,Double:3,Numeric:4,Boolean:5,Text:7,Date:8,Time:9,DateTime:10,Json:11,Bytes:13,Uuid:15,Int32Array:64,Int64Array:65,FloatArray:66,DoubleArray:67,NumericArray:68,BooleanArray:69,CharacterArray:70,TextArray:71,DateArray:72,TimeArray:73,DateTimeArray:74,JsonArray:75,BytesArray:77,UuidArray:78};Error("Not implemented: queryRaw"),Error("Not implemented: executeRaw"),Error("Not implemented: startTransaction"),Error("Not implemented: executeScript"),Error("Not implemented: dispose");var n9=e.i(81962),n7="@prisma/adapter-neon",{builtins:ie,getTypeParser:it}=nw,ir={BIT_ARRAY:1561,BOOL_ARRAY:1e3,BYTEA_ARRAY:1001,BPCHAR_ARRAY:1014,CHAR_ARRAY:1002,CIDR_ARRAY:651,DATE_ARRAY:1182,FLOAT4_ARRAY:1021,FLOAT8_ARRAY:1022,INET_ARRAY:1041,INT2_ARRAY:1005,INT4_ARRAY:1007,INT8_ARRAY:1016,JSONB_ARRAY:3807,JSON_ARRAY:199,MONEY_ARRAY:791,NUMERIC_ARRAY:1231,OID_ARRAY:1028,TEXT_ARRAY:1009,TIMESTAMP_ARRAY:1115,TIMESTAMPTZ_ARRAY:1185,TIME_ARRAY:1183,UUID_ARRAY:2951,VARBIT_ARRAY:1563,VARCHAR_ARRAY:1015,XML_ARRAY:143},ii=class e extends Error{static typeNames={16:"bool",17:"bytea",18:"char",19:"name",20:"int8",21:"int2",22:"int2vector",23:"int4",24:"regproc",25:"text",26:"oid",27:"tid",28:"xid",29:"cid",30:"oidvector",32:"pg_ddl_command",71:"pg_type",75:"pg_attribute",81:"pg_proc",83:"pg_class",114:"json",142:"xml",194:"pg_node_tree",269:"table_am_handler",325:"index_am_handler",600:"point",601:"lseg",602:"path",603:"box",604:"polygon",628:"line",650:"cidr",700:"float4",701:"float8",705:"unknown",718:"circle",774:"macaddr8",790:"money",829:"macaddr",869:"inet",1033:"aclitem",1042:"bpchar",1043:"varchar",1082:"date",1083:"time",1114:"timestamp",1184:"timestamptz",1186:"interval",1266:"timetz",1560:"bit",1562:"varbit",1700:"numeric",1790:"refcursor",2202:"regprocedure",2203:"regoper",2204:"regoperator",2205:"regclass",2206:"regtype",2249:"record",2275:"cstring",2276:"any",2277:"anyarray",2278:"void",2279:"trigger",2280:"language_handler",2281:"internal",2283:"anyelement",2287:"_record",2776:"anynonarray",2950:"uuid",2970:"txid_snapshot",3115:"fdw_handler",3220:"pg_lsn",3310:"tsm_handler",3361:"pg_ndistinct",3402:"pg_dependencies",3500:"anyenum",3614:"tsvector",3615:"tsquery",3642:"gtsvector",3734:"regconfig",3769:"regdictionary",3802:"jsonb",3831:"anyrange",3838:"event_trigger",3904:"int4range",3906:"numrange",3908:"tsrange",3910:"tstzrange",3912:"daterange",3926:"int8range",4072:"jsonpath",4089:"regnamespace",4096:"regrole",4191:"regcollation",4451:"int4multirange",4532:"nummultirange",4533:"tsmultirange",4534:"tstzmultirange",4535:"datemultirange",4536:"int8multirange",4537:"anymultirange",4538:"anycompatiblemultirange",4600:"pg_brin_bloom_summary",4601:"pg_brin_minmax_multi_summary",5017:"pg_mcv_list",5038:"pg_snapshot",5069:"xid8",5077:"anycompatible",5078:"anycompatiblearray",5079:"anycompatiblenonarray",5080:"anycompatiblerange"};type;constructor(t){super(),this.type=e.typeNames[t]||"Unknown",this.message=`Unsupported column type ${this.type}`}};function is(e){return t=>(0,n9.parse)(t,e)}function io(e){return e}function ia(e){return e}function iu(e){return`${e.replace(" ","T")}+00:00`}function ic(e){return e.replace(" ","T").replace(/[+-]\d{2}(:\d{2})?$/,"+00:00")}function il(e){return e}function ih(e){return e.slice(1)}function id(e){return e}function ip(e){return Array.from(new Uint8Array(e))}var ig=it(ie.BYTEA),im=it(ir.BYTEA_ARRAY);function iy(e){return e}var ib={[ie.NUMERIC]:io,[ir.NUMERIC_ARRAY]:is(io),[ie.TIME]:il,[ir.TIME_ARRAY]:is(il),[ie.TIMETZ]:function(e){return e.replace(/[+-]\d{2}(:\d{2})?$/,"")},[ie.DATE]:ia,[ir.DATE_ARRAY]:is(ia),[ie.TIMESTAMP]:iu,[ir.TIMESTAMP_ARRAY]:is(iu),[ie.TIMESTAMPTZ]:ic,[ir.TIMESTAMPTZ_ARRAY]:is(ic),[ie.MONEY]:ih,[ir.MONEY_ARRAY]:is(ih),[ie.JSON]:id,[ir.JSON_ARRAY]:is(id),[ie.JSONB]:id,[ir.JSONB_ARRAY]:is(id),[ie.BYTEA]:function(e){return ip(ig(e))},[ir.BYTEA_ARRAY]:function(e){return im(e).map(e=>e?ip(e):null)},[ir.BIT_ARRAY]:is(iy),[ir.VARBIT_ARRAY]:is(iy),[ir.XML_ARRAY]:is(function(e){return e})},iv=n5("prisma:driver-adapter:neon"),i_=class{provider="postgres";adapterName=n7;async queryRaw(e){iv("[js::query_raw] %O",e);let{fields:t,rows:r}=await this.performIO(e),n=t.map(e=>e.name),i=[];try{i=t.map(e=>(function(e){switch(e){case ie.INT2:case ie.INT4:return n8.Int32;case ie.INT8:return n8.Int64;case ie.FLOAT4:return n8.Float;case ie.FLOAT8:return n8.Double;case ie.BOOL:return n8.Boolean;case ie.DATE:return n8.Date;case ie.TIME:case ie.TIMETZ:return n8.Time;case ie.TIMESTAMP:case ie.TIMESTAMPTZ:return n8.DateTime;case ie.NUMERIC:case ie.MONEY:return n8.Numeric;case ie.JSON:case ie.JSONB:return n8.Json;case ie.UUID:return n8.Uuid;case ie.OID:return n8.Int64;case ie.BPCHAR:case ie.TEXT:case ie.VARCHAR:case ie.BIT:case ie.VARBIT:case ie.INET:case ie.CIDR:case ie.XML:return n8.Text;case ie.BYTEA:return n8.Bytes;case ir.INT2_ARRAY:case ir.INT4_ARRAY:return n8.Int32Array;case ir.FLOAT4_ARRAY:return n8.FloatArray;case ir.FLOAT8_ARRAY:return n8.DoubleArray;case ir.NUMERIC_ARRAY:case ir.MONEY_ARRAY:return n8.NumericArray;case ir.BOOL_ARRAY:return n8.BooleanArray;case ir.CHAR_ARRAY:return n8.CharacterArray;case ir.BPCHAR_ARRAY:case ir.TEXT_ARRAY:case ir.VARCHAR_ARRAY:case ir.VARBIT_ARRAY:case ir.BIT_ARRAY:case ir.INET_ARRAY:case ir.CIDR_ARRAY:case ir.XML_ARRAY:return n8.TextArray;case ir.DATE_ARRAY:return n8.DateArray;case ir.TIME_ARRAY:return n8.TimeArray;case ir.TIMESTAMP_ARRAY:return n8.DateTimeArray;case ir.JSON_ARRAY:case ir.JSONB_ARRAY:return n8.JsonArray;case ir.BYTEA_ARRAY:return n8.BytesArray;case ir.UUID_ARRAY:return n8.UuidArray;case ir.INT8_ARRAY:case ir.OID_ARRAY:return n8.Int64Array;default:if(e>=1e4)return n8.Text;throw new ii(e)}})(e.dataTypeID))}catch(e){if(e instanceof ii)throw new n4({kind:"UnsupportedNativeDataType",type:e.type});throw e}return{columnNames:n,columnTypes:i,rows:r}}async executeRaw(e){return iv("[js::execute_raw] %O",e),(await this.performIO(e)).rowCount??0}},iw=class extends i_{constructor(e){super(),this.client=e}async performIO(e){let{sql:t,args:r}=e;try{return await this.client.query({text:t,rowMode:"array",types:{getTypeParser:(e,t)=>"text"===t&&ib[e]?ib[e]:nw.getTypeParser(e,t)}},r.map((t,r)=>(function e(t,r){if(null===t)return null;if(Array.isArray(t)&&"list"===r.arity)return t.map(t=>e(t,r));if("string"==typeof t&&"datetime"===r.scalarType&&(t=new Date(t)),t instanceof Date)switch(r.dbType){case"TIME":case"TIMETZ":var n=t;let i=(e,t=2)=>String(e).padStart(t,"0"),s=n.getUTCMilliseconds();return i(n.getUTCHours())+":"+i(n.getUTCMinutes())+":"+i(n.getUTCSeconds())+(s?"."+String(s).padStart(3,"0"):"");case"DATE":var o=t;let a=(e,t=2)=>String(e).padStart(t,"0");return a(o.getUTCFullYear(),4)+"-"+a(o.getUTCMonth()+1)+"-"+a(o.getUTCDate());default:var u=t;let c=(e,t=2)=>String(e).padStart(t,"0"),l=u.getUTCMilliseconds();return c(u.getUTCFullYear(),4)+"-"+c(u.getUTCMonth()+1)+"-"+c(u.getUTCDate())+" "+c(u.getUTCHours())+":"+c(u.getUTCMinutes())+":"+c(u.getUTCSeconds())+(l?"."+String(l).padStart(3,"0"):"")}return"string"==typeof t&&"bytes"===r.scalarType?Buffer.from(t,"base64"):Array.isArray(t)&&"bytes"===r.scalarType?Buffer.from(t):ArrayBuffer.isView(t)?Buffer.from(t.buffer,t.byteOffset,t.byteLength):t})(t,e.argTypes[r])))}catch(e){this.onError(e)}}onError(e){throw iv("Error in onError: %O",e),new n4(function(e){var t;if("string"==typeof(t=e).code&&"string"==typeof t.message&&"string"==typeof t.severity&&("string"==typeof t.detail||void 0===t.detail)&&("string"==typeof t.column||void 0===t.column)&&("string"==typeof t.hint||void 0===t.hint))return{originalCode:e.code,originalMessage:e.message,...function(e){switch(e.code){case"22001":return{kind:"LengthMismatch",column:e.column};case"22003":return{kind:"ValueOutOfRange",cause:e.message};case"23505":{let t=e.detail?.match(/Key \(([^)]+)\)/)?.at(1)?.split(", ");return{kind:"UniqueConstraintViolation",constraint:void 0!==t?{fields:t}:void 0}}case"23502":{let t=e.detail?.match(/Key \(([^)]+)\)/)?.at(1)?.split(", ");return{kind:"NullConstraintViolation",constraint:void 0!==t?{fields:t}:void 0}}case"23503":{let t;return e.column?t={fields:[e.column]}:e.constraint&&(t={index:e.constraint}),{kind:"ForeignKeyConstraintViolation",constraint:t}}case"3D000":return{kind:"DatabaseDoesNotExist",db:e.message.split(" ").at(1)?.split('"').at(1)};case"28000":return{kind:"DatabaseAccessDenied",db:e.message.split(",").find(e=>e.startsWith(" database"))?.split('"').at(1)};case"28P01":return{kind:"AuthenticationFailed",user:e.message.split(" ").pop()?.split('"').at(1)};case"40001":return{kind:"TransactionWriteConflict"};case"42P01":return{kind:"TableDoesNotExist",table:e.message.split(" ").at(1)?.split('"').at(1)};case"42703":return{kind:"ColumnNotFound",column:e.message.split(" ").at(1)?.split('"').at(1)};case"42P04":return{kind:"DatabaseAlreadyExists",db:e.message.split(" ").at(1)?.split('"').at(1)};case"53300":return{kind:"TooManyConnections",cause:e.message};default:return{kind:"postgres",code:e.code??"N/A",severity:e.severity??"N/A",message:e.message,detail:e.detail,column:e.column,hint:e.hint}}}(e)};throw e}(e))}},iE=class extends iw{constructor(e,t,r){super(e),this.options=t,this.cleanup=r}async commit(){iv("[js::commit]"),this.cleanup?.(),this.client.release()}async rollback(){iv("[js::rollback]"),this.cleanup?.(),this.client.release()}},iS=class extends iw{constructor(e,t){super(e),this.options=t}isRunning=!0;executeScript(e){throw Error("Not implemented yet")}async startTransaction(e){let t={usePhantomQuery:!1};iv("%s options: %O","[js::startTransaction]",t);let r=await this.client.connect().catch(e=>this.onError(e)),n=e=>{iv(`Error from pool connection: ${e.message} %O`,e),this.options?.onConnectionError?.(e)};r.on("error",n);let i=()=>{r.removeListener("error",n)};try{let n=new iE(r,t,i);return await n.executeRaw({sql:"BEGIN",args:[],argTypes:[]}),e&&await n.executeRaw({sql:`SET TRANSACTION ISOLATION LEVEL ${e}`,args:[],argTypes:[]}),n}catch(e){i(),r.release(e),this.onError(e)}}getConnectionInfo(){return{schemaName:this.options?.schema,supportsRelationJoins:!0}}async dispose(){this.isRunning&&(await this.client.end(),this.isRunning=!1)}underlyingDriver(){return this.client}},iR=class{constructor(e,t){this.config=e,this.options=t}provider="postgres";adapterName=n7;async connect(){let e=new nv(this.config);return e.on("error",e=>{iv(`Error from pool client: ${e.message} %O`,e),this.options?.onPoolError?.(e)}),new iS(e,this.options)}},ix=e.i(29173);let iA=globalThis,iT=iA.prisma??(()=>{let e=new iR({connectionString:`${process.env.DATABASE_URL}`});return new ix.PrismaClient({adapter:e,transactionOptions:{timeout:15e3}})})();iA.prisma||(iA.prisma=iT),e.s(["validate",()=>iO],55897);let iP=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i,iO=function(e){return"string"==typeof e&&iP.test(e)}}];
35
+ rs, please set the host to 'localhost' explicitly.`);let i=super.connect(e),s=t.pipelineTLS&&this.ssl,o="password"===t.pipelineConnect;if(!s&&!t.pipelineConnect)return i;let a=this.connection;if(s&&a.on("connect",()=>a.stream.emit("data","S")),o){a.removeAllListeners("authenticationCleartextPassword"),a.removeAllListeners("readyForQuery"),a.once("readyForQuery",()=>a.on("readyForQuery",this._handleReadyForQuery.bind(this)));let e=this.ssl?"sslconnect":"connect";a.on(e,()=>{this.neonConfig.disableWarningInBrowsers||nr(),this._handleAuthCleartextPassword(),this._handleReadyForQuery()})}return i}async _handleAuthSASLContinue(e){if(typeof crypto>"u"||void 0===crypto.subtle||void 0===crypto.subtle.importKey)throw Error("Cannot use SASL auth when `crypto.subtle` is not defined");let t=crypto.subtle,r=this.saslSession,n=this.password,i=e.data;if("SASLInitialResponse"!==r.message||"string"!=typeof n||"string"!=typeof i)throw Error("SASL: protocol error");let s=Object.fromEntries(i.split(",").map(e=>{if(!/^.=/.test(e))throw Error("SASL: Invalid attribute pair entry");return[e[0],e.substring(2)]})),o=s.r,a=s.s,u=s.i;if(!o||!/^[!-+--~]+$/.test(o))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing/unprintable");if(!a||!/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/.test(a))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing/not base64");if(!u||!/^[1-9][0-9]*$/.test(u))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: missing/invalid iteration count");if(!o.startsWith(r.clientNonce))throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with client nonce");if(o.length===r.clientNonce.length)throw Error("SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce is too short");let c=parseInt(u,10),l=to.from(a,"base64"),h=new TextEncoder,f=h.encode(n),d=await t.importKey("raw",f,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),p=new Uint8Array(await t.sign("HMAC",d,to.concat([l,to.from([0,0,0,1])]))),g=p;for(var m=0;m<c-1;m++)p=new Uint8Array(await t.sign("HMAC",d,p)),g=to.from(g.map((e,t)=>g[t]^p[t]));let y=g,b=await t.importKey("raw",y,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),v=new Uint8Array(await t.sign("HMAC",b,h.encode("Client Key"))),_=await t.digest("SHA-256",v),w="n=*,r="+r.clientNonce,E="r="+o+",s="+a+",i="+c,S="c=biws,r="+o,R=w+","+E+","+S,x=await t.importKey("raw",_,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var A=new Uint8Array(await t.sign("HMAC",x,h.encode(R))),T=to.from(v.map((e,t)=>v[t]^A[t])).toString("base64");let P=await t.importKey("raw",y,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),O=await t.sign("HMAC",P,h.encode("Server Key")),C=await t.importKey("raw",O,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);var I=to.from(await t.sign("HMAC",C,h.encode(R)));r.message="SASLResponse",r.serverSignature=I.toString("base64"),r.response=S+",p="+T,this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}};tg(ny,"NeonClient"),tM();var nb=t_(rE());function nv(e,t){let r,n;return t?{callback:t,result:void 0}:{callback:tg(function(e,t){e?r(e):n(t)},"cb"),result:new e(function(e,t){n=e,r=t})}}tg(nv,"promisify");var n_=class extends ng.Pool{constructor(){super(...arguments),tE(this,"Client",ny),tE(this,"hasFetchUnsupportedListeners",!1),tE(this,"addListener",this.on)}on(e,t){return"error"!==e&&(this.hasFetchUnsupportedListeners=!0),super.on(e,t)}query(e,t,r){if(!tL.poolQueryViaFetch||this.hasFetchUnsupportedListeners||"function"==typeof e)return super.query(e,t,r);"function"==typeof t&&(r=t,t=void 0);let n=nv(this.Promise,r);r=n.callback;try{let n=new nb.default(this.options),i=encodeURIComponent,s=encodeURI,o=`postgresql://${i(n.user)}:${i(n.password)}@${i(n.host)}\
36
+ /${s(n.database)}`,a="string"==typeof e?e:e.text,u=t??e.values??[];nl(o,{fullResults:!0,arrayMode:"array"===e.rowMode}).query(a,u,{types:e.types??this.options?.types}).then(e=>r(void 0,e)).catch(e=>r(e))}catch(e){r(e)}return n.result}};tg(n_,"NeonPool"),tM();var nw=t_(rH());nw.DatabaseError,nw.defaults,nw.escapeIdentifier,nw.escapeLiteral;var nE=nw.types,nS=Object.defineProperty,nR={};((e,t)=>{for(var r in t)nS(e,r,{get:t[r],enumerable:!0})})(nR,{$:()=>nA,bgBlack:()=>nW,bgBlue:()=>nz,bgCyan:()=>nJ,bgGreen:()=>nY,bgMagenta:()=>nK,bgRed:()=>nQ,bgWhite:()=>nZ,bgYellow:()=>nX,black:()=>nk,blue:()=>nF,bold:()=>nO,cyan:()=>n$,dim:()=>nC,gray:()=>nH,green:()=>nj,grey:()=>nV,hidden:()=>nM,inverse:()=>nL,italic:()=>nI,magenta:()=>nq,red:()=>nB,reset:()=>nP,strikethrough:()=>nD,underline:()=>nN,white:()=>nG,yellow:()=>nU});var nx=!0;"undefined"!=typeof process&&({FORCE_COLOR:s,NODE_DISABLE_COLORS:o,NO_COLOR:a,TERM:u}=process.env||{},nx=process.stdout&&process.stdout.isTTY);var nA={enabled:!o&&null==a&&"dumb"!==u&&(null!=s&&"0"!==s||nx)};function nT(e,t){let r=RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1b[${e}m`,i=`\x1b[${t}m`;return function(e){return nA.enabled&&null!=e?n+(~(""+e).indexOf(i)?e.replace(r,i+n):e)+i:e}}var nP=nT(0,0),nO=nT(1,22),nC=nT(2,22),nI=nT(3,23),nN=nT(4,24),nL=nT(7,27),nM=nT(8,28),nD=nT(9,29),nk=nT(30,39),nB=nT(31,39),nj=nT(32,39),nU=nT(33,39),nF=nT(34,39),nq=nT(35,39),n$=nT(36,39),nG=nT(37,39),nH=nT(90,39),nV=nT(90,39),nW=nT(40,49),nQ=nT(41,49),nY=nT(42,49),nX=nT(43,49),nz=nT(44,49),nK=nT(45,49),nJ=nT(46,49),nZ=nT(47,49),n0=["green","yellow","blue","magenta","cyan","red"],n1=[],n2=Date.now(),n6=0,n3="undefined"!=typeof process?process.env:{};globalThis.DEBUG??=n3.DEBUG??"",globalThis.DEBUG_COLORS??=!n3.DEBUG_COLORS||"true"===n3.DEBUG_COLORS;var n5={enable(e){"string"==typeof e&&(globalThis.DEBUG=e)},disable(){let e=globalThis.DEBUG;return globalThis.DEBUG="",e},enabled(e){let t=globalThis.DEBUG.split(",").map(e=>e.replace(/[.+?^${}()|[\]\\]/g,"\\$&")),r=t.some(t=>""!==t&&"-"!==t[0]&&e.match(RegExp(t.split("*").join(".*")+"$"))),n=t.some(t=>""!==t&&"-"===t[0]&&e.match(RegExp(t.slice(1).split("*").join(".*")+"$")));return r&&!n},log:(...e)=>{let[t,r,...n]=e;(console.warn??console.log)(`${t} ${r}`,...n)},formatters:{}},n4=new Proxy(function(e){let t={color:n0[n6++%n0.length],enabled:n5.enabled(e),namespace:e,log:n5.log,extend:()=>{}};return new Proxy((...e)=>{let{enabled:r,namespace:n,color:i,log:s}=t;if(0!==e.length&&n1.push([n,...e]),n1.length>100&&n1.shift(),n5.enabled(n)||r){let t=e.map(e=>"string"==typeof e?e:function(e,t=2){let r=new Set;return JSON.stringify(e,(e,t)=>{if("object"==typeof t&&null!==t){if(r.has(t))return"[Circular *]";r.add(t)}else if("bigint"==typeof t)return t.toString();return t},t)}(e)),r=`+${Date.now()-n2}ms`;n2=Date.now(),globalThis.DEBUG_COLORS?s(nR[i](nO(n)),...t,nR[i](r)):s(n,...t,r)}},{get:(e,r)=>t[r],set:(e,r,n)=>t[r]=n})},{get:(e,t)=>n5[t],set:(e,t,r)=>n5[t]=r}),n8=class extends Error{name="DriverAdapterError";cause;constructor(e){super("string"==typeof e.message?e.message:e.kind),this.cause=e}};n4("driver-adapter-utils");var n9={Int32:0,Int64:1,Float:2,Double:3,Numeric:4,Boolean:5,Text:7,Date:8,Time:9,DateTime:10,Json:11,Bytes:13,Uuid:15,Int32Array:64,Int64Array:65,FloatArray:66,DoubleArray:67,NumericArray:68,BooleanArray:69,CharacterArray:70,TextArray:71,DateArray:72,TimeArray:73,DateTimeArray:74,JsonArray:75,BytesArray:77,UuidArray:78};Error("Not implemented: queryRaw"),Error("Not implemented: executeRaw"),Error("Not implemented: startTransaction"),Error("Not implemented: executeScript"),Error("Not implemented: dispose");var n7=e.i(81962),ie="@prisma/adapter-neon",{builtins:it,getTypeParser:ir}=nE,ii={BIT_ARRAY:1561,BOOL_ARRAY:1e3,BYTEA_ARRAY:1001,BPCHAR_ARRAY:1014,CHAR_ARRAY:1002,CIDR_ARRAY:651,DATE_ARRAY:1182,FLOAT4_ARRAY:1021,FLOAT8_ARRAY:1022,INET_ARRAY:1041,INT2_ARRAY:1005,INT4_ARRAY:1007,INT8_ARRAY:1016,JSONB_ARRAY:3807,JSON_ARRAY:199,MONEY_ARRAY:791,NUMERIC_ARRAY:1231,OID_ARRAY:1028,TEXT_ARRAY:1009,TIMESTAMP_ARRAY:1115,TIMESTAMPTZ_ARRAY:1185,TIME_ARRAY:1183,UUID_ARRAY:2951,VARBIT_ARRAY:1563,VARCHAR_ARRAY:1015,XML_ARRAY:143},is=class e extends Error{static typeNames={16:"bool",17:"bytea",18:"char",19:"name",20:"int8",21:"int2",22:"int2vector",23:"int4",24:"regproc",25:"text",26:"oid",27:"tid",28:"xid",29:"cid",30:"oidvector",32:"pg_ddl_command",71:"pg_type",75:"pg_attribute",81:"pg_proc",83:"pg_class",114:"json",142:"xml",194:"pg_node_tree",269:"table_am_handler",325:"index_am_handler",600:"point",601:"lseg",602:"path",603:"box",604:"polygon",628:"line",650:"cidr",700:"float4",701:"float8",705:"unknown",718:"circle",774:"macaddr8",790:"money",829:"macaddr",869:"inet",1033:"aclitem",1042:"bpchar",1043:"varchar",1082:"date",1083:"time",1114:"timestamp",1184:"timestamptz",1186:"interval",1266:"timetz",1560:"bit",1562:"varbit",1700:"numeric",1790:"refcursor",2202:"regprocedure",2203:"regoper",2204:"regoperator",2205:"regclass",2206:"regtype",2249:"record",2275:"cstring",2276:"any",2277:"anyarray",2278:"void",2279:"trigger",2280:"language_handler",2281:"internal",2283:"anyelement",2287:"_record",2776:"anynonarray",2950:"uuid",2970:"txid_snapshot",3115:"fdw_handler",3220:"pg_lsn",3310:"tsm_handler",3361:"pg_ndistinct",3402:"pg_dependencies",3500:"anyenum",3614:"tsvector",3615:"tsquery",3642:"gtsvector",3734:"regconfig",3769:"regdictionary",3802:"jsonb",3831:"anyrange",3838:"event_trigger",3904:"int4range",3906:"numrange",3908:"tsrange",3910:"tstzrange",3912:"daterange",3926:"int8range",4072:"jsonpath",4089:"regnamespace",4096:"regrole",4191:"regcollation",4451:"int4multirange",4532:"nummultirange",4533:"tsmultirange",4534:"tstzmultirange",4535:"datemultirange",4536:"int8multirange",4537:"anymultirange",4538:"anycompatiblemultirange",4600:"pg_brin_bloom_summary",4601:"pg_brin_minmax_multi_summary",5017:"pg_mcv_list",5038:"pg_snapshot",5069:"xid8",5077:"anycompatible",5078:"anycompatiblearray",5079:"anycompatiblenonarray",5080:"anycompatiblerange"};type;constructor(t){super(),this.type=e.typeNames[t]||"Unknown",this.message=`Unsupported column type ${this.type}`}};function io(e){return t=>(0,n7.parse)(t,e)}function ia(e){return e}function iu(e){return e}function ic(e){return`${e.replace(" ","T")}+00:00`}function il(e){return e.replace(" ","T").replace(/[+-]\d{2}(:\d{2})?$/,"+00:00")}function ih(e){return e}function id(e){return e.slice(1)}function ip(e){return e}function ig(e){return Array.from(new Uint8Array(e))}var im=ir(it.BYTEA),iy=ir(ii.BYTEA_ARRAY);function ib(e){return e}var iv={[it.NUMERIC]:ia,[ii.NUMERIC_ARRAY]:io(ia),[it.TIME]:ih,[ii.TIME_ARRAY]:io(ih),[it.TIMETZ]:function(e){return e.replace(/[+-]\d{2}(:\d{2})?$/,"")},[it.DATE]:iu,[ii.DATE_ARRAY]:io(iu),[it.TIMESTAMP]:ic,[ii.TIMESTAMP_ARRAY]:io(ic),[it.TIMESTAMPTZ]:il,[ii.TIMESTAMPTZ_ARRAY]:io(il),[it.MONEY]:id,[ii.MONEY_ARRAY]:io(id),[it.JSON]:ip,[ii.JSON_ARRAY]:io(ip),[it.JSONB]:ip,[ii.JSONB_ARRAY]:io(ip),[it.BYTEA]:function(e){return ig(im(e))},[ii.BYTEA_ARRAY]:function(e){return iy(e).map(e=>e?ig(e):null)},[ii.BIT_ARRAY]:io(ib),[ii.VARBIT_ARRAY]:io(ib),[ii.XML_ARRAY]:io(function(e){return e})},i_=n4("prisma:driver-adapter:neon"),iw=class{provider="postgres";adapterName=ie;async queryRaw(e){i_("[js::query_raw] %O",e);let{fields:t,rows:r}=await this.performIO(e),n=t.map(e=>e.name),i=[];try{i=t.map(e=>(function(e){switch(e){case it.INT2:case it.INT4:return n9.Int32;case it.INT8:return n9.Int64;case it.FLOAT4:return n9.Float;case it.FLOAT8:return n9.Double;case it.BOOL:return n9.Boolean;case it.DATE:return n9.Date;case it.TIME:case it.TIMETZ:return n9.Time;case it.TIMESTAMP:case it.TIMESTAMPTZ:return n9.DateTime;case it.NUMERIC:case it.MONEY:return n9.Numeric;case it.JSON:case it.JSONB:return n9.Json;case it.UUID:return n9.Uuid;case it.OID:return n9.Int64;case it.BPCHAR:case it.TEXT:case it.VARCHAR:case it.BIT:case it.VARBIT:case it.INET:case it.CIDR:case it.XML:return n9.Text;case it.BYTEA:return n9.Bytes;case ii.INT2_ARRAY:case ii.INT4_ARRAY:return n9.Int32Array;case ii.FLOAT4_ARRAY:return n9.FloatArray;case ii.FLOAT8_ARRAY:return n9.DoubleArray;case ii.NUMERIC_ARRAY:case ii.MONEY_ARRAY:return n9.NumericArray;case ii.BOOL_ARRAY:return n9.BooleanArray;case ii.CHAR_ARRAY:return n9.CharacterArray;case ii.BPCHAR_ARRAY:case ii.TEXT_ARRAY:case ii.VARCHAR_ARRAY:case ii.VARBIT_ARRAY:case ii.BIT_ARRAY:case ii.INET_ARRAY:case ii.CIDR_ARRAY:case ii.XML_ARRAY:return n9.TextArray;case ii.DATE_ARRAY:return n9.DateArray;case ii.TIME_ARRAY:return n9.TimeArray;case ii.TIMESTAMP_ARRAY:return n9.DateTimeArray;case ii.JSON_ARRAY:case ii.JSONB_ARRAY:return n9.JsonArray;case ii.BYTEA_ARRAY:return n9.BytesArray;case ii.UUID_ARRAY:return n9.UuidArray;case ii.INT8_ARRAY:case ii.OID_ARRAY:return n9.Int64Array;default:if(e>=1e4)return n9.Text;throw new is(e)}})(e.dataTypeID))}catch(e){if(e instanceof is)throw new n8({kind:"UnsupportedNativeDataType",type:e.type});throw e}return{columnNames:n,columnTypes:i,rows:r}}async executeRaw(e){return i_("[js::execute_raw] %O",e),(await this.performIO(e)).rowCount??0}},iE=class extends iw{constructor(e){super(),this.client=e}async performIO(e){let{sql:t,args:r}=e;try{return await this.client.query({text:t,rowMode:"array",types:{getTypeParser:(e,t)=>"text"===t&&iv[e]?iv[e]:nE.getTypeParser(e,t)}},r.map((t,r)=>(function e(t,r){if(null===t)return null;if(Array.isArray(t)&&"list"===r.arity)return t.map(t=>e(t,r));if("string"==typeof t&&"datetime"===r.scalarType&&(t=new Date(t)),t instanceof Date)switch(r.dbType){case"TIME":case"TIMETZ":var n=t;let i=(e,t=2)=>String(e).padStart(t,"0"),s=n.getUTCMilliseconds();return i(n.getUTCHours())+":"+i(n.getUTCMinutes())+":"+i(n.getUTCSeconds())+(s?"."+String(s).padStart(3,"0"):"");case"DATE":var o=t;let a=(e,t=2)=>String(e).padStart(t,"0");return a(o.getUTCFullYear(),4)+"-"+a(o.getUTCMonth()+1)+"-"+a(o.getUTCDate());default:var u=t;let c=(e,t=2)=>String(e).padStart(t,"0"),l=u.getUTCMilliseconds();return c(u.getUTCFullYear(),4)+"-"+c(u.getUTCMonth()+1)+"-"+c(u.getUTCDate())+" "+c(u.getUTCHours())+":"+c(u.getUTCMinutes())+":"+c(u.getUTCSeconds())+(l?"."+String(l).padStart(3,"0"):"")}return"string"==typeof t&&"bytes"===r.scalarType?Buffer.from(t,"base64"):Array.isArray(t)&&"bytes"===r.scalarType?Buffer.from(t):ArrayBuffer.isView(t)?Buffer.from(t.buffer,t.byteOffset,t.byteLength):t})(t,e.argTypes[r])))}catch(e){this.onError(e)}}onError(e){throw i_("Error in onError: %O",e),new n8(function(e){var t;if("string"==typeof(t=e).code&&"string"==typeof t.message&&"string"==typeof t.severity&&("string"==typeof t.detail||void 0===t.detail)&&("string"==typeof t.column||void 0===t.column)&&("string"==typeof t.hint||void 0===t.hint))return{originalCode:e.code,originalMessage:e.message,...function(e){switch(e.code){case"22001":return{kind:"LengthMismatch",column:e.column};case"22003":return{kind:"ValueOutOfRange",cause:e.message};case"23505":{let t=e.detail?.match(/Key \(([^)]+)\)/)?.at(1)?.split(", ");return{kind:"UniqueConstraintViolation",constraint:void 0!==t?{fields:t}:void 0}}case"23502":{let t=e.detail?.match(/Key \(([^)]+)\)/)?.at(1)?.split(", ");return{kind:"NullConstraintViolation",constraint:void 0!==t?{fields:t}:void 0}}case"23503":{let t;return e.column?t={fields:[e.column]}:e.constraint&&(t={index:e.constraint}),{kind:"ForeignKeyConstraintViolation",constraint:t}}case"3D000":return{kind:"DatabaseDoesNotExist",db:e.message.split(" ").at(1)?.split('"').at(1)};case"28000":return{kind:"DatabaseAccessDenied",db:e.message.split(",").find(e=>e.startsWith(" database"))?.split('"').at(1)};case"28P01":return{kind:"AuthenticationFailed",user:e.message.split(" ").pop()?.split('"').at(1)};case"40001":return{kind:"TransactionWriteConflict"};case"42P01":return{kind:"TableDoesNotExist",table:e.message.split(" ").at(1)?.split('"').at(1)};case"42703":return{kind:"ColumnNotFound",column:e.message.split(" ").at(1)?.split('"').at(1)};case"42P04":return{kind:"DatabaseAlreadyExists",db:e.message.split(" ").at(1)?.split('"').at(1)};case"53300":return{kind:"TooManyConnections",cause:e.message};default:return{kind:"postgres",code:e.code??"N/A",severity:e.severity??"N/A",message:e.message,detail:e.detail,column:e.column,hint:e.hint}}}(e)};throw e}(e))}},iS=class extends iE{constructor(e,t,r){super(e),this.options=t,this.cleanup=r}async commit(){i_("[js::commit]"),this.cleanup?.(),this.client.release()}async rollback(){i_("[js::rollback]"),this.cleanup?.(),this.client.release()}},iR=class extends iE{constructor(e,t){super(e),this.options=t}isRunning=!0;executeScript(e){throw Error("Not implemented yet")}async startTransaction(e){let t={usePhantomQuery:!1};i_("%s options: %O","[js::startTransaction]",t);let r=await this.client.connect().catch(e=>this.onError(e)),n=e=>{i_(`Error from pool connection: ${e.message} %O`,e),this.options?.onConnectionError?.(e)};r.on("error",n);let i=()=>{r.removeListener("error",n)};try{let n=new iS(r,t,i);return await n.executeRaw({sql:"BEGIN",args:[],argTypes:[]}),e&&await n.executeRaw({sql:`SET TRANSACTION ISOLATION LEVEL ${e}`,args:[],argTypes:[]}),n}catch(e){i(),r.release(e),this.onError(e)}}getConnectionInfo(){return{schemaName:this.options?.schema,supportsRelationJoins:!0}}async dispose(){this.isRunning&&(await this.client.end(),this.isRunning=!1)}underlyingDriver(){return this.client}},ix=class{constructor(e,t){this.config=e,this.options=t}provider="postgres";adapterName=ie;async connect(){let e=new n_(this.config);return e.on("error",e=>{i_(`Error from pool client: ${e.message} %O`,e),this.options?.onPoolError?.(e)}),new iR(e,this.options)}};let iA=globalThis,iT=iA.prisma??(()=>{let e=`${process.env.DATABASE_URL}`;if("neon"===(()=>{let e=(process.env.DATABASE_ADAPTER??"neon").toLowerCase().trim();return["direct","standard","postgres","supabase"].includes(e)?"direct":(["neon","vercel","vercel_postgres"].includes(e),"neon")})()){let t=new ix({connectionString:e});return new tu.PrismaClient({adapter:t,transactionOptions:{timeout:15e3}})}return new tu.PrismaClient({datasources:{db:{url:e}},transactionOptions:{timeout:15e3}})})();iA.prisma||(iA.prisma=iT),e.s(["validate",()=>iO],55897);let iP=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i,iO=function(e){return"string"==typeof e&&iP.test(e)}}];
37
37
 
38
- //# sourceMappingURL=%5Broot-of-the-server%5D__f6f61507._.js.map
38
+ //# sourceMappingURL=%5Broot-of-the-server%5D__281d6920._.js.map