@chorus-aidlc/chorus 0.6.3 → 0.6.4

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 (135) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/app-build-manifest.json +162 -162
  3. package/.next/standalone/.next/app-path-routes-manifest.json +31 -31
  4. package/.next/standalone/.next/build-manifest.json +2 -2
  5. package/.next/standalone/.next/prerender-manifest.json +27 -27
  6. package/.next/standalone/.next/server/app/(dashboard)/project-groups/[uuid]/page_client-reference-manifest.js +1 -1
  7. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/activity/page_client-reference-manifest.js +1 -1
  8. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/[ideaUuid]/page_client-reference-manifest.js +1 -1
  9. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/page_client-reference-manifest.js +1 -1
  10. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/[documentUuid]/page_client-reference-manifest.js +1 -1
  11. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/page_client-reference-manifest.js +1 -1
  12. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/ideas/[ideaUuid]/page_client-reference-manifest.js +1 -1
  13. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/ideas/page_client-reference-manifest.js +1 -1
  14. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page_client-reference-manifest.js +1 -1
  15. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/new/page_client-reference-manifest.js +1 -1
  16. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/page_client-reference-manifest.js +1 -1
  17. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/[taskUuid]/page_client-reference-manifest.js +1 -1
  18. package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/page_client-reference-manifest.js +1 -1
  19. package/.next/standalone/.next/server/app/(dashboard)/projects/page_client-reference-manifest.js +1 -1
  20. package/.next/standalone/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +1 -1
  21. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  22. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  23. package/.next/standalone/.next/server/app/_not-found.rsc +1 -1
  24. package/.next/standalone/.next/server/app/admin/companies/[uuid]/page_client-reference-manifest.js +1 -1
  25. package/.next/standalone/.next/server/app/admin/companies/new/page_client-reference-manifest.js +1 -1
  26. package/.next/standalone/.next/server/app/admin/companies/new.html +1 -1
  27. package/.next/standalone/.next/server/app/admin/companies/new.rsc +1 -1
  28. package/.next/standalone/.next/server/app/admin/companies/page_client-reference-manifest.js +1 -1
  29. package/.next/standalone/.next/server/app/admin/companies.html +1 -1
  30. package/.next/standalone/.next/server/app/admin/companies.rsc +1 -1
  31. package/.next/standalone/.next/server/app/admin/page_client-reference-manifest.js +1 -1
  32. package/.next/standalone/.next/server/app/admin.html +1 -1
  33. package/.next/standalone/.next/server/app/admin.rsc +1 -1
  34. package/.next/standalone/.next/server/app/api/admin/companies/[uuid]/route_client-reference-manifest.js +1 -1
  35. package/.next/standalone/.next/server/app/api/admin/companies/route_client-reference-manifest.js +1 -1
  36. package/.next/standalone/.next/server/app/api/admin/login/route_client-reference-manifest.js +1 -1
  37. package/.next/standalone/.next/server/app/api/admin/session/route_client-reference-manifest.js +1 -1
  38. package/.next/standalone/.next/server/app/api/agents/[uuid]/route_client-reference-manifest.js +1 -1
  39. package/.next/standalone/.next/server/app/api/agents/[uuid]/sessions/route_client-reference-manifest.js +1 -1
  40. package/.next/standalone/.next/server/app/api/agents/route_client-reference-manifest.js +1 -1
  41. package/.next/standalone/.next/server/app/api/api-keys/[uuid]/route_client-reference-manifest.js +1 -1
  42. package/.next/standalone/.next/server/app/api/api-keys/route_client-reference-manifest.js +1 -1
  43. package/.next/standalone/.next/server/app/api/auth/callback/route_client-reference-manifest.js +1 -1
  44. package/.next/standalone/.next/server/app/api/auth/check-default/route_client-reference-manifest.js +1 -1
  45. package/.next/standalone/.next/server/app/api/auth/default-login/route_client-reference-manifest.js +1 -1
  46. package/.next/standalone/.next/server/app/api/auth/identify/route_client-reference-manifest.js +1 -1
  47. package/.next/standalone/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  48. package/.next/standalone/.next/server/app/api/auth/me/route_client-reference-manifest.js +1 -1
  49. package/.next/standalone/.next/server/app/api/auth/refresh/route_client-reference-manifest.js +1 -1
  50. package/.next/standalone/.next/server/app/api/auth/session/route_client-reference-manifest.js +1 -1
  51. package/.next/standalone/.next/server/app/api/auth/sync-token/route_client-reference-manifest.js +1 -1
  52. package/.next/standalone/.next/server/app/api/comments/route_client-reference-manifest.js +1 -1
  53. package/.next/standalone/.next/server/app/api/documents/[uuid]/route_client-reference-manifest.js +1 -1
  54. package/.next/standalone/.next/server/app/api/events/notifications/route_client-reference-manifest.js +1 -1
  55. package/.next/standalone/.next/server/app/api/events/route_client-reference-manifest.js +1 -1
  56. package/.next/standalone/.next/server/app/api/health/route_client-reference-manifest.js +1 -1
  57. package/.next/standalone/.next/server/app/api/ideas/[uuid]/claim/route_client-reference-manifest.js +1 -1
  58. package/.next/standalone/.next/server/app/api/ideas/[uuid]/move/route_client-reference-manifest.js +1 -1
  59. package/.next/standalone/.next/server/app/api/ideas/[uuid]/release/route_client-reference-manifest.js +1 -1
  60. package/.next/standalone/.next/server/app/api/ideas/[uuid]/route_client-reference-manifest.js +1 -1
  61. package/.next/standalone/.next/server/app/api/mcp/route_client-reference-manifest.js +1 -1
  62. package/.next/standalone/.next/server/app/api/me/assignments/route_client-reference-manifest.js +1 -1
  63. package/.next/standalone/.next/server/app/api/mentionables/route_client-reference-manifest.js +1 -1
  64. package/.next/standalone/.next/server/app/api/notifications/[uuid]/archive/route_client-reference-manifest.js +1 -1
  65. package/.next/standalone/.next/server/app/api/notifications/[uuid]/read/route_client-reference-manifest.js +1 -1
  66. package/.next/standalone/.next/server/app/api/notifications/preferences/route_client-reference-manifest.js +1 -1
  67. package/.next/standalone/.next/server/app/api/notifications/read-all/route_client-reference-manifest.js +1 -1
  68. package/.next/standalone/.next/server/app/api/notifications/route_client-reference-manifest.js +1 -1
  69. package/.next/standalone/.next/server/app/api/notifications/unread-count/route_client-reference-manifest.js +1 -1
  70. package/.next/standalone/.next/server/app/api/project-groups/[uuid]/dashboard/route_client-reference-manifest.js +1 -1
  71. package/.next/standalone/.next/server/app/api/project-groups/[uuid]/route_client-reference-manifest.js +1 -1
  72. package/.next/standalone/.next/server/app/api/project-groups/route_client-reference-manifest.js +1 -1
  73. package/.next/standalone/.next/server/app/api/projects/[uuid]/activity/route_client-reference-manifest.js +1 -1
  74. package/.next/standalone/.next/server/app/api/projects/[uuid]/available/route_client-reference-manifest.js +1 -1
  75. package/.next/standalone/.next/server/app/api/projects/[uuid]/documents/route_client-reference-manifest.js +1 -1
  76. package/.next/standalone/.next/server/app/api/projects/[uuid]/group/route_client-reference-manifest.js +1 -1
  77. package/.next/standalone/.next/server/app/api/projects/[uuid]/ideas/route_client-reference-manifest.js +1 -1
  78. package/.next/standalone/.next/server/app/api/projects/[uuid]/ideas/tracker/route_client-reference-manifest.js +1 -1
  79. package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/[proposalUuid]/validate/route_client-reference-manifest.js +1 -1
  80. package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/route_client-reference-manifest.js +1 -1
  81. package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/summary/route_client-reference-manifest.js +1 -1
  82. package/.next/standalone/.next/server/app/api/projects/[uuid]/route_client-reference-manifest.js +1 -1
  83. package/.next/standalone/.next/server/app/api/projects/[uuid]/stats/route_client-reference-manifest.js +1 -1
  84. package/.next/standalone/.next/server/app/api/projects/[uuid]/tasks/dependencies/route_client-reference-manifest.js +1 -1
  85. package/.next/standalone/.next/server/app/api/projects/[uuid]/tasks/route_client-reference-manifest.js +1 -1
  86. package/.next/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  87. package/.next/standalone/.next/server/app/api/proposals/[uuid]/approve/route_client-reference-manifest.js +1 -1
  88. package/.next/standalone/.next/server/app/api/proposals/[uuid]/close/route_client-reference-manifest.js +1 -1
  89. package/.next/standalone/.next/server/app/api/proposals/[uuid]/reject/route_client-reference-manifest.js +1 -1
  90. package/.next/standalone/.next/server/app/api/proposals/[uuid]/route_client-reference-manifest.js +1 -1
  91. package/.next/standalone/.next/server/app/api/search/route_client-reference-manifest.js +1 -1
  92. package/.next/standalone/.next/server/app/api/sessions/[uuid]/route_client-reference-manifest.js +1 -1
  93. package/.next/standalone/.next/server/app/api/tasks/[uuid]/claim/route_client-reference-manifest.js +1 -1
  94. package/.next/standalone/.next/server/app/api/tasks/[uuid]/dependencies/[dependsOnUuid]/route_client-reference-manifest.js +1 -1
  95. package/.next/standalone/.next/server/app/api/tasks/[uuid]/dependencies/route_client-reference-manifest.js +1 -1
  96. package/.next/standalone/.next/server/app/api/tasks/[uuid]/release/route_client-reference-manifest.js +1 -1
  97. package/.next/standalone/.next/server/app/api/tasks/[uuid]/route_client-reference-manifest.js +1 -1
  98. package/.next/standalone/.next/server/app/api/tasks/[uuid]/sessions/route_client-reference-manifest.js +1 -1
  99. package/.next/standalone/.next/server/app/index.html +1 -1
  100. package/.next/standalone/.next/server/app/index.rsc +1 -1
  101. package/.next/standalone/.next/server/app/login/admin/page_client-reference-manifest.js +1 -1
  102. package/.next/standalone/.next/server/app/login/admin.html +1 -1
  103. package/.next/standalone/.next/server/app/login/admin.rsc +1 -1
  104. package/.next/standalone/.next/server/app/login/callback/page_client-reference-manifest.js +1 -1
  105. package/.next/standalone/.next/server/app/login/callback.html +1 -1
  106. package/.next/standalone/.next/server/app/login/callback.rsc +1 -1
  107. package/.next/standalone/.next/server/app/login/page_client-reference-manifest.js +1 -1
  108. package/.next/standalone/.next/server/app/login/silent-refresh/page_client-reference-manifest.js +1 -1
  109. package/.next/standalone/.next/server/app/login/silent-refresh.html +1 -1
  110. package/.next/standalone/.next/server/app/login/silent-refresh.rsc +1 -1
  111. package/.next/standalone/.next/server/app/login.html +1 -1
  112. package/.next/standalone/.next/server/app/login.rsc +1 -1
  113. package/.next/standalone/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  114. package/.next/standalone/.next/server/app/onboarding.html +1 -1
  115. package/.next/standalone/.next/server/app/onboarding.rsc +1 -1
  116. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  117. package/.next/standalone/.next/server/app/projects.html +1 -1
  118. package/.next/standalone/.next/server/app/projects.rsc +1 -1
  119. package/.next/standalone/.next/server/app/settings.html +1 -1
  120. package/.next/standalone/.next/server/app/settings.rsc +1 -1
  121. package/.next/standalone/.next/server/app-paths-manifest.json +31 -31
  122. package/.next/standalone/.next/server/chunks/2618.js +1 -1
  123. package/.next/standalone/.next/server/chunks/937.js +1 -1
  124. package/.next/standalone/.next/server/chunks/9408.js +1 -1
  125. package/.next/standalone/.next/server/middleware-manifest.json +1 -1
  126. package/.next/standalone/.next/server/pages/404.html +1 -1
  127. package/.next/standalone/.next/server/pages/500.html +1 -1
  128. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  129. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  130. package/.next/standalone/package.json +1 -1
  131. package/README.md +2 -0
  132. package/README.zh.md +2 -0
  133. package/package.json +1 -1
  134. /package/.next/standalone/.next/static/{tlKc7sJMhCvChscpoM0uf → uWPfyLQQ7ucUGnHwispnH}/_buildManifest.js +0 -0
  135. /package/.next/standalone/.next/static/{tlKc7sJMhCvChscpoM0uf → uWPfyLQQ7ucUGnHwispnH}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- exports.id=937,exports.ids=[937],exports.modules={881:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});let d=c(41138);function e(a){setTimeout(function(){throw a},0)}b.default=function(a,b,c){return"function"==typeof b&&a.then(a=>{let f;(f=void 0!==c&&Object(c).spread&&Array.isArray(a)?d.tryCatch(b).apply(void 0,[null].concat(a)):void 0===a?d.tryCatch(b)(null):d.tryCatch(b)(null,a))===d.errorObj&&e(f.e)},a=>{if(!a){let b=Error(a+"");Object.assign(b,{cause:a}),a=b}let c=d.tryCatch(b)(a);c===d.errorObj&&e(c.e)}),a}},950:(a,b,c)=>{a.exports=function(a){function b(a){let c,e,f,g=null;function h(...a){if(!h.enabled)return;let d=Number(new Date);h.diff=d-(c||d),h.prev=c,h.curr=d,c=d,a[0]=b.coerce(a[0]),"string"!=typeof a[0]&&a.unshift("%O");let e=0;a[0]=a[0].replace(/%([a-zA-Z%])/g,(c,d)=>{if("%%"===c)return"%";e++;let f=b.formatters[d];if("function"==typeof f){let b=a[e];c=f.call(h,b),a.splice(e,1),e--}return c}),b.formatArgs.call(h,a),(h.log||b.log).apply(h,a)}return h.namespace=a,h.useColors=b.useColors(),h.color=b.selectColor(a),h.extend=d,h.destroy=b.destroy,Object.defineProperty(h,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==g?g:(e!==b.namespaces&&(e=b.namespaces,f=b.enabled(a)),f),set:a=>{g=a}}),"function"==typeof b.init&&b.init(h),h}function d(a,c){let d=b(this.namespace+(void 0===c?":":c)+a);return d.log=this.log,d}function e(a,b){let c=0,d=0,e=-1,f=0;for(;c<a.length;)if(d<b.length&&(b[d]===a[c]||"*"===b[d]))"*"===b[d]?(e=d,f=c):c++,d++;else{if(-1===e)return!1;d=e+1,c=++f}for(;d<b.length&&"*"===b[d];)d++;return d===b.length}return b.debug=b,b.default=b,b.coerce=function(a){return a instanceof Error?a.stack||a.message:a},b.disable=function(){let a=[...b.names,...b.skips.map(a=>"-"+a)].join(",");return b.enable(""),a},b.enable=function(a){for(let c of(b.save(a),b.namespaces=a,b.names=[],b.skips=[],("string"==typeof a?a:"").trim().replace(/\s+/g,",").split(",").filter(Boolean)))"-"===c[0]?b.skips.push(c.slice(1)):b.names.push(c)},b.enabled=function(a){for(let c of b.skips)if(e(a,c))return!1;for(let c of b.names)if(e(a,c))return!0;return!1},b.humanize=c(32011),b.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(a).forEach(c=>{b[c]=a[c]}),b.names=[],b.skips=[],b.formatters={},b.selectColor=function(a){let c=0;for(let b=0;b<a.length;b++)c=(c<<5)-c+a.charCodeAt(b)|0;return b.colors[Math.abs(c)%b.colors.length]},b.enable(b.load()),b}},3820:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});let d=c(91645),e=c(34631),f=c(54187),g=c(18797);class h extends g.default{constructor(a){super(a.disconnectTimeout),this.options=a}connect(a){let b,{options:c}=this;return this.connecting=!0,"path"in c&&c.path?b={path:c.path}:(b={},"port"in c&&null!=c.port&&(b.port=c.port),"host"in c&&null!=c.host&&(b.host=c.host),"family"in c&&null!=c.family&&(b.family=c.family)),c.tls&&Object.assign(b,c.tls),new Promise((a,g)=>{process.nextTick(()=>{if(!this.connecting)return void g(Error(f.CONNECTION_CLOSED_ERROR_MSG));try{c.tls?this.stream=(0,e.connect)(b):this.stream=(0,d.createConnection)(b)}catch(a){g(a);return}this.stream.once("error",a=>{this.firstError=a}),a(this.stream)})})}}b.default=h},9666:function(a,b,c){"use strict";var d=this&&this.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(b,"__esModule",{value:!0}),b.getKeyIndexes=b.hasFlag=b.exists=b.list=void 0;let e=d(c(39176));b.list=Object.keys(e.default);let f={};function g(a){"string"!=typeof a&&(a=String(a));let b=a.indexOf("->");return -1===b?a.length:b}b.list.forEach(a=>{f[a]=e.default[a].flags.reduce(function(a,b){return a[b]=!0,a},{})}),b.exists=function(a,b){return a=(null==b?void 0:b.caseInsensitive)?String(a).toLowerCase():a,!!e.default[a]},b.hasFlag=function(a,b,c){if(!f[a=(null==c?void 0:c.nameCaseInsensitive)?String(a).toLowerCase():a])throw Error("Unknown command "+a);return!!f[a][b]},b.getKeyIndexes=function(a,b,c){a=(null==c?void 0:c.nameCaseInsensitive)?String(a).toLowerCase():a;let d=e.default[a];if(!d)throw Error("Unknown command "+a);if(!Array.isArray(b))throw Error("Expect args to be an array");let f=[],h=!!(c&&c.parseExternalKey),i=(a,b)=>{let c=[],d=Number(a[b]);for(let a=0;a<d;a++)c.push(a+b+1);return c},j=(a,b,c)=>{for(let d=b;d<a.length-1;d+=1)if(String(a[d]).toLowerCase()===c.toLowerCase())return d+1;return null};switch(a){case"zunionstore":case"zinterstore":case"zdiffstore":f.push(0,...i(b,1));break;case"eval":case"evalsha":case"eval_ro":case"evalsha_ro":case"fcall":case"fcall_ro":case"blmpop":case"bzmpop":f.push(...i(b,1));break;case"sintercard":case"lmpop":case"zunion":case"zinter":case"zmpop":case"zintercard":case"zdiff":f.push(...i(b,0));break;case"georadius":{f.push(0);let a=j(b,5,"STORE");a&&f.push(a);let c=j(b,5,"STOREDIST");c&&f.push(c);break}case"georadiusbymember":{f.push(0);let a=j(b,4,"STORE");a&&f.push(a);let c=j(b,4,"STOREDIST");c&&f.push(c);break}case"sort":case"sort_ro":f.push(0);for(let a=1;a<b.length-1;a++){let c=b[a];if("string"!=typeof c)continue;let d=c.toUpperCase();"GET"===d?(a+=1,"#"!==(c=b[a])&&(h?f.push([a,g(c)]):f.push(a))):"BY"===d?(a+=1,h?f.push([a,g(b[a])]):f.push(a)):"STORE"===d&&(a+=1,f.push(a))}break;case"migrate":if(""===b[2])for(let a=5;a<b.length-1;a++){let c=b[a];if("string"==typeof c&&"KEYS"===c.toUpperCase()){for(let c=a+1;c<b.length;c++)f.push(c);break}}else f.push(2);break;case"xreadgroup":case"xread":for(let c=3*("xread"!==a);c<b.length-1;c++)if("STREAMS"===String(b[c]).toUpperCase()){for(let a=c+1;a<=c+(b.length-1-c)/2;a++)f.push(a);break}break;default:if(d.step>0){let a=d.keyStart-1,c=d.keyStop>0?d.keyStop:b.length+d.keyStop+1;for(let b=a;b<c;b+=d.step)f.push(b)}}return f}},10713:(a,b,c)=>{"use strict";c.d(b,{B:()=>s});var d=c(94735),e=c(55511),f=c(29229),g=c.n(f),h=c(37614);let i=h.A.child({module:"redis"}),j=function(){if(process.env.REDIS_URL)return process.env.REDIS_URL;let a=process.env.REDIS_HOST;if(!a)return;let b=process.env.REDIS_PORT||"6379",c=process.env.REDIS_USERNAME||"default",d=process.env.REDIS_PASSWORD,e="rediss";return d?`${e}://${c}:${encodeURIComponent(d)}@${a}:${b}`:`${e}://${a}:${b}`}(),k=globalThis;function l(a){let b=new(g())(j,{lazyConnect:!0,maxRetriesPerRequest:null,retryStrategy(b){let c=Math.min(200*b,5e3);return i.warn({name:a,delay:c,attempt:b},"Reconnecting"),c}});return b.on("error",b=>{i.error({name:a,err:b},"Redis error")}),b.on("connect",()=>{i.info({name:a},"Connected")}),b}function m(){return j?(k.redisPub||(k.redisPub=l("pub")),k.redisPub):null}function n(){return j?(k.redisSub||(k.redisSub=l("sub")),k.redisSub):null}let o=h.A.child({module:"event-bus"}),p="chorus:events";class q extends d.EventEmitter{static{this.THROTTLE_WINDOW_MS=2e3}static{this.EVICTION_INTERVAL_MS=3e4}static{this.EVICTION_TTL_MS=3e4}async connect(){if(this._connected||!j)return;this._connected=!0;let a=n(),b=m();a&&(await a.connect(),b&&await b.connect(),await a.subscribe(p),a.on("message",(a,b)=>{try{let a=JSON.parse(b);if(a._origin===this._instanceId)return;super.emit(a.channel,a.data)}catch{}}))}emit(a,...b){if("string"==typeof a&&j){let c=m();if(c&&"ready"===c.status){let d={_origin:this._instanceId,channel:a,data:b[0]};c.publish(p,JSON.stringify(d)).catch(()=>{})}}return super.emit(a,...b)}emitPresence(a){let b=`${a.agentUuid}:${a.entityType}:${a.entityUuid}${a.subEntityType?`:${a.subEntityType}`:""}${a.subEntityUuid?`:${a.subEntityUuid}`:""}`,c=Date.now(),d=this._presenceThrottle.get(b);d&&c-d<q.THROTTLE_WINDOW_MS||(this._presenceThrottle.set(b,c),this._ensureEvictionTimer(),this.emit("presence",a))}_ensureEvictionTimer(){!this._evictionTimer&&(this._evictionTimer=setInterval(()=>{let a=Date.now();for(let[b,c]of this._presenceThrottle)a-c>=q.EVICTION_TTL_MS&&this._presenceThrottle.delete(b);0===this._presenceThrottle.size&&(clearInterval(this._evictionTimer),this._evictionTimer=null)},q.EVICTION_INTERVAL_MS),this._evictionTimer&&"object"==typeof this._evictionTimer&&"unref"in this._evictionTimer&&this._evictionTimer.unref())}get _throttleMapSize(){return this._presenceThrottle.size}_resetPresenceState(){this._presenceThrottle.clear(),this._evictionTimer&&(clearInterval(this._evictionTimer),this._evictionTimer=null)}emitChange(a){this.emit("change",a)}async disconnect(){let a=m(),b=n();b&&await b.quit().catch(()=>{}),a&&await a.quit().catch(()=>{}),this._connected=!1}constructor(...a){super(...a),this._connected=!1,this._instanceId=(0,e.randomUUID)(),this._presenceThrottle=new Map,this._evictionTimer=null}}let r=globalThis,s=r.chorusEventBus??=new q;j&&s.connect().catch(a=>{o.error({err:a},"Redis connect failed, falling back to memory")})},11309:(a,b,c)=>{"use strict";c.d(b,{UE:()=>f,sL:()=>e});var d=c(96009),e=class extends Error{name="DriverAdapterError";cause;constructor(a){super("string"==typeof a.message?a.message:a.kind),this.cause=a}};(0,d.y)("driver-adapter-utils");var f={Int32:0,Int64:1,Float:2,Double:3,Numeric:4,Boolean:5,Character:6,Text:7,Date:8,Time:9,DateTime:10,Json:11,Enum:12,Bytes:13,Set:14,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,EnumArray:76,BytesArray:77,UuidArray:78,UnknownNumber:128};Error("Not implemented: queryRaw"),Error("Not implemented: executeRaw"),Error("Not implemented: startTransaction"),Error("Not implemented: executeScript"),Error("Not implemented: dispose")},12590:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});let d=c(55511),e=c(14642),f=c(881);class g{constructor(a,b=null,c="",f=!1){this.lua=a,this.numberOfKeys=b,this.keyPrefix=c,this.readOnly=f,this.sha=(0,d.createHash)("sha1").update(a).digest("hex");let g=this.sha,h=new WeakSet;this.Command=class extends e.default{toWritable(b){let c=this.reject;return this.reject=a=>{-1!==a.message.indexOf("NOSCRIPT")&&h.delete(b),c.call(this,a)},h.has(b)?"eval"===this.name&&(this.name="evalsha",this.args[0]=g):(h.add(b),this.name="eval",this.args[0]=a),super.toWritable(b)}}}execute(a,b,c,d){"number"==typeof this.numberOfKeys&&b.unshift(this.numberOfKeys),this.keyPrefix&&(c.keyPrefix=this.keyPrefix),this.readOnly&&(c.readOnly=!0);let e=new this.Command("evalsha",[this.sha,...b],c);return e.promise=e.promise.catch(d=>{if(-1===d.message.indexOf("NOSCRIPT"))throw d;let e=new this.Command("evalsha",[this.sha,...b],c);return(a.isPipeline?a.redis:a).sendCommand(e)}),(0,f.default)(e.promise,d),a.sendCommand(e)}}b.default=g},14642:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});let d=c(9666),e=c(91957),f=c(881),g=c(54187),h=c(85316);class i{constructor(a,b=[],c={},d){if(this.name=a,this.inTransaction=!1,this.isResolved=!1,this.transformed=!1,this.replyEncoding=c.replyEncoding,this.errorStack=c.errorStack,this.args=b.flat(),this.callback=d,this.initPromise(),c.keyPrefix){let a=c.keyPrefix instanceof Buffer,b=a?c.keyPrefix:null;this._iterateKeys(d=>d instanceof Buffer?(null===b&&(b=Buffer.from(c.keyPrefix)),Buffer.concat([b,d])):a?Buffer.concat([c.keyPrefix,Buffer.from(String(d))]):c.keyPrefix+d)}c.readOnly&&(this.isReadOnly=!0)}static checkFlag(a,b){return b=b.toLowerCase(),!!this.getFlagMap()[a][b]}static setArgumentTransformer(a,b){this._transformer.argument[a]=b}static setReplyTransformer(a,b){this._transformer.reply[a]=b}static getFlagMap(){return this.flagMap||(this.flagMap=Object.keys(i.FLAGS).reduce((a,b)=>(a[b]={},i.FLAGS[b].forEach(c=>{a[b][c]=!0}),a),{})),this.flagMap}getSlot(){if(void 0===this.slot){let a=this.getKeys()[0];this.slot=null==a?null:e(a)}return this.slot}getKeys(){return this._iterateKeys()}toWritable(a){let b,c="*"+(this.args.length+1)+"\r\n$"+Buffer.byteLength(this.name)+"\r\n"+this.name+"\r\n";if(this.bufferMode){let a=new l;a.push(c);for(let b=0;b<this.args.length;++b){let c=this.args[b];c instanceof Buffer?0===c.length?a.push("$0\r\n\r\n"):(a.push("$"+c.length+"\r\n"),a.push(c),a.push("\r\n")):a.push("$"+Buffer.byteLength(c)+"\r\n"+c+"\r\n")}b=a.toBuffer()}else{b=c;for(let a=0;a<this.args.length;++a){let c=this.args[a];b+="$"+Buffer.byteLength(c)+"\r\n"+c+"\r\n"}}return b}stringifyArguments(){for(let a=0;a<this.args.length;++a){let b=this.args[a];"string"==typeof b||(b instanceof Buffer?this.bufferMode=!0:this.args[a]=(0,g.toArg)(b))}}transformReply(a){this.replyEncoding&&(a=(0,g.convertBufferToString)(a,this.replyEncoding));let b=i._transformer.reply[this.name];return b&&(a=b(a)),a}setTimeout(a){this._commandTimeoutTimer||(this._commandTimeoutTimer=setTimeout(()=>{this.isResolved||this.reject(Error("Command timed out"))},a))}setBlockingTimeout(a){if(a<=0)return;this._blockingTimeoutTimer&&(clearTimeout(this._blockingTimeoutTimer),this._blockingTimeoutTimer=void 0);let b=Date.now();void 0===this._blockingDeadline&&(this._blockingDeadline=b+a);let c=this._blockingDeadline-b;if(c<=0)return void this.resolve(null);this._blockingTimeoutTimer=setTimeout(()=>{if(this.isResolved){this._blockingTimeoutTimer=void 0;return}this._blockingTimeoutTimer=void 0,this.resolve(null)},c)}extractBlockingTimeout(){let a=this.args;if(!a||0===a.length)return;let b=this.name.toLowerCase();return i.checkFlag("LAST_ARG_TIMEOUT_COMMANDS",b)?(0,h.parseSecondsArgument)(a[a.length-1]):i.checkFlag("FIRST_ARG_TIMEOUT_COMMANDS",b)?(0,h.parseSecondsArgument)(a[0]):i.checkFlag("BLOCK_OPTION_COMMANDS",b)?(0,h.parseBlockOption)(a):void 0}_clearTimers(){let a=this._commandTimeoutTimer;a&&(clearTimeout(a),delete this._commandTimeoutTimer);let b=this._blockingTimeoutTimer;b&&(clearTimeout(b),delete this._blockingTimeoutTimer)}initPromise(){let a=new Promise((a,b)=>{if(!this.transformed){this.transformed=!0;let a=i._transformer.argument[this.name];a&&(this.args=a(this.args)),this.stringifyArguments()}this.resolve=this._convertValue(a),this.reject=a=>{this._clearTimers(),this.errorStack?b((0,g.optimizeErrorStack)(a,this.errorStack.stack,__dirname)):b(a)}});this.promise=(0,f.default)(a,this.callback)}_iterateKeys(a=a=>a){if(void 0===this.keys&&(this.keys=[],(0,d.exists)(this.name,{caseInsensitive:!0})))for(let b of(0,d.getKeyIndexes)(this.name,this.args,{nameCaseInsensitive:!0}))this.args[b]=a(this.args[b]),this.keys.push(this.args[b]);return this.keys}_convertValue(a){return b=>{try{this._clearTimers(),a(this.transformReply(b)),this.isResolved=!0}catch(a){this.reject(a)}return this.promise}}}b.default=i,i.FLAGS={VALID_IN_SUBSCRIBER_MODE:["subscribe","psubscribe","unsubscribe","punsubscribe","ssubscribe","sunsubscribe","ping","quit"],VALID_IN_MONITOR_MODE:["monitor","auth"],ENTER_SUBSCRIBER_MODE:["subscribe","psubscribe","ssubscribe"],EXIT_SUBSCRIBER_MODE:["unsubscribe","punsubscribe","sunsubscribe"],WILL_DISCONNECT:["quit"],HANDSHAKE_COMMANDS:["auth","select","client","readonly","info"],IGNORE_RECONNECT_ON_ERROR:["client"],BLOCKING_COMMANDS:["blpop","brpop","brpoplpush","blmove","bzpopmin","bzpopmax","bzmpop","blmpop","xread","xreadgroup"],LAST_ARG_TIMEOUT_COMMANDS:["blpop","brpop","brpoplpush","blmove","bzpopmin","bzpopmax"],FIRST_ARG_TIMEOUT_COMMANDS:["bzmpop","blmpop"],BLOCK_OPTION_COMMANDS:["xread","xreadgroup"]},i._transformer={argument:{},reply:{}};let j=function(a){if(1===a.length){if(a[0]instanceof Map)return(0,g.convertMapToArray)(a[0]);if("object"==typeof a[0]&&null!==a[0])return(0,g.convertObjectToArray)(a[0])}return a},k=function(a){if(2===a.length){if(a[1]instanceof Map)return[a[0]].concat((0,g.convertMapToArray)(a[1]));if("object"==typeof a[1]&&null!==a[1])return[a[0]].concat((0,g.convertObjectToArray)(a[1]))}return a};i.setArgumentTransformer("mset",j),i.setArgumentTransformer("msetnx",j),i.setArgumentTransformer("hset",k),i.setArgumentTransformer("hmset",k),i.setReplyTransformer("hgetall",function(a){if(Array.isArray(a)){let b={};for(let c=0;c<a.length;c+=2){let d=a[c],e=a[c+1];d in b?Object.defineProperty(b,d,{value:e,configurable:!0,enumerable:!0,writable:!0}):b[d]=e}return b}return a});class l{constructor(){this.length=0,this.items=[]}push(a){this.length+=Buffer.byteLength(a),this.items.push(a)}toBuffer(){let a=Buffer.allocUnsafe(this.length),b=0;for(let c of this.items){let d=Buffer.byteLength(c);Buffer.isBuffer(c)?c.copy(a,b):a.write(c,b,d),b+=d}return a}}},15121:(a,b,c)=>{"use strict";let d=c(12412);class e extends Error{get name(){return this.constructor.name}}class f extends e{constructor(a,b,c){d(b),d.strictEqual(typeof c,"number");let e=Error.stackTraceLimit;Error.stackTraceLimit=2,super(a),Error.stackTraceLimit=e,this.offset=c,this.buffer=b}get name(){return this.constructor.name}}class g extends e{constructor(a){let b=Error.stackTraceLimit;Error.stackTraceLimit=2,super(a),Error.stackTraceLimit=b}get name(){return this.constructor.name}}class h extends e{get name(){return this.constructor.name}}class i extends h{get name(){return this.constructor.name}}a.exports={RedisError:e,ParserError:f,ReplyError:g,AbortError:h,InterruptError:i}},15789:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.SentinelIterator=void 0;let d=c(91645),e=c(54187),f=c(34631),g=c(47824);b.SentinelIterator=g.default;let h=c(18797),i=c(88568),j=c(23142),k=(0,e.Debug)("SentinelConnector");class l extends h.default{constructor(a){if(super(a.disconnectTimeout),this.options=a,this.emitter=null,this.failoverDetector=null,!this.options.sentinels.length)throw Error("Requires at least one sentinel to connect to.");if(!this.options.name)throw Error("Requires the name of master.");this.sentinelIterator=new g.default(this.options.sentinels)}check(a){let b=!a.role||this.options.role===a.role;return b||(k("role invalid, expected %s, but got %s",this.options.role,a.role),this.sentinelIterator.next(),this.sentinelIterator.next(),this.sentinelIterator.reset(!0)),b}disconnect(){super.disconnect(),this.failoverDetector&&this.failoverDetector.cleanup()}connect(a){let b;this.connecting=!0,this.retryAttempts=0;let c=async()=>{let g=this.sentinelIterator.next();if(g.done){this.sentinelIterator.reset(!1);let d="function"==typeof this.options.sentinelRetryStrategy?this.options.sentinelRetryStrategy(++this.retryAttempts):null,e="number"!=typeof d?"All sentinels are unreachable and retry is disabled.":`All sentinels are unreachable. Retrying from scratch after ${d}ms.`;b&&(e+=` Last error: ${b.message}`),k(e);let f=Error(e);if("number"==typeof d)return a("error",f),await new Promise(a=>setTimeout(a,d)),c();throw f}let h=null,i=null;try{h=await this.resolve(g.value)}catch(a){i=a}if(!this.connecting)throw Error(e.CONNECTION_CLOSED_ERROR_MSG);let j=g.value.host+":"+g.value.port;if(h)return k("resolved: %s:%s from sentinel %s",h.host,h.port,j),this.options.enableTLSForSentinelMode&&this.options.tls?(Object.assign(h,this.options.tls),this.stream=(0,f.connect)(h),this.stream.once("secureConnect",this.initFailoverDetector.bind(this))):(this.stream=(0,d.createConnection)(h),this.stream.once("connect",this.initFailoverDetector.bind(this))),this.stream.once("error",a=>{this.firstError=a}),this.stream;{let d=i?"failed to connect to sentinel "+j+" because "+i.message:"connected to sentinel "+j+" successfully, but got an invalid reply: "+h;return k(d),a("sentinelError",Error(d)),i&&(b=i),c()}};return c()}async updateSentinels(a){if(!this.options.updateSentinels)return;let b=await a.sentinel("sentinels",this.options.name);Array.isArray(b)&&(b.map(e.packObject).forEach(a=>{if(-1===(a.flags?a.flags.split(","):[]).indexOf("disconnected")&&a.ip&&a.port){let b=this.sentinelNatResolve(m(a));this.sentinelIterator.add(b)&&k("adding sentinel %s:%s",b.host,b.port)}}),k("Updated internal sentinels: %s",this.sentinelIterator))}async resolveMaster(a){let b=await a.sentinel("get-master-addr-by-name",this.options.name);return await this.updateSentinels(a),this.sentinelNatResolve(Array.isArray(b)?{host:b[0],port:Number(b[1])}:null)}async resolveSlave(a){let b=await a.sentinel("slaves",this.options.name);if(!Array.isArray(b))return null;let c=b.map(e.packObject).filter(a=>a.flags&&!a.flags.match(/(disconnected|s_down|o_down)/));return this.sentinelNatResolve(function(a,b){let c;if(0===a.length)return null;if("function"==typeof b)c=b(a);else if(null!==b&&"object"==typeof b){let d=Array.isArray(b)?b:[b];d.sort((a,b)=>(a.prio||(a.prio=1),b.prio||(b.prio=1),a.prio<b.prio)?-1:+(a.prio>b.prio));for(let b=0;b<d.length;b++){for(let e=0;e<a.length;e++){let f=a[e];if(f.ip===d[b].ip&&f.port===d[b].port){c=f;break}}if(c)break}}return c||(c=(0,e.sample)(a)),m(c)}(c,this.options.preferredSlaves))}sentinelNatResolve(a){if(!a||!this.options.natMap)return a;let b=`${a.host}:${a.port}`,c=a;return"function"==typeof this.options.natMap?c=this.options.natMap(b)||a:"object"==typeof this.options.natMap&&(c=this.options.natMap[b]||a),c}connectToSentinel(a,b){return new i.default({port:a.port||26379,host:a.host,username:this.options.sentinelUsername||null,password:this.options.sentinelPassword||null,family:a.family||("path"in this.options&&this.options.path?void 0:this.options.family),tls:this.options.sentinelTLS,retryStrategy:null,enableReadyCheck:!1,connectTimeout:this.options.connectTimeout,commandTimeout:this.options.sentinelCommandTimeout,...b})}async resolve(a){let b=this.connectToSentinel(a);b.on("error",n);try{if("slave"===this.options.role)return await this.resolveSlave(b);return await this.resolveMaster(b)}finally{b.disconnect()}}async initFailoverDetector(){var a;if(!this.options.failoverDetector)return;this.sentinelIterator.reset(!0);let b=[];for(;b.length<this.options.sentinelMaxConnections;){let{done:a,value:c}=this.sentinelIterator.next();if(a)break;let d=this.connectToSentinel(c,{lazyConnect:!0,retryStrategy:this.options.sentinelReconnectStrategy});d.on("reconnecting",()=>{var a;null==(a=this.emitter)||a.emit("sentinelReconnecting")}),b.push({address:c,client:d})}this.sentinelIterator.reset(!1),this.failoverDetector&&this.failoverDetector.cleanup(),this.failoverDetector=new j.FailoverDetector(this,b),await this.failoverDetector.subscribe(),null==(a=this.emitter)||a.emit("failoverSubscribed")}}function m(a){return{host:a.ip,port:Number(a.port)}}function n(){}b.default=l},16688:(a,b,c)=>{"use strict";a.exports=c(63145)},17751:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});let d=c(54187),e=c(37970),f=c(91957),g=c(34103),h=(0,d.Debug)("cluster:subscriberGroup");class i{constructor(a){this.subscriberGroupEmitter=a,this.shardedSubscribers=new Map,this.clusterSlots=[],this.subscriberToSlotsIndex=new Map,this.channels=new Map,this.failedAttemptsByNode=new Map,this.isResetting=!1,this.pendingReset=null,this.handleSubscriberConnectFailed=(a,b)=>{let c=(this.failedAttemptsByNode.get(b)||0)+1;this.failedAttemptsByNode.set(b,c);let d=Math.min(c,i.MAX_RETRY_ATTEMPTS),e=Math.min(i.BASE_BACKOFF_MS*2**d,i.MAX_BACKOFF_MS),f=Math.floor(.5*e*(Math.random()-.5)),g=Math.max(0,e+f);h("Failed to connect subscriber for %s. Refreshing slots in %dms",b,g),this.subscriberGroupEmitter.emit("subscriberConnectFailed",{delay:g,error:a})},this.handleSubscriberConnectSucceeded=a=>{this.failedAttemptsByNode.delete(a)}}getResponsibleSubscriber(a){let b=this.clusterSlots[a][0];return this.shardedSubscribers.get(b)}addChannels(a){let b=f(a[0]);for(let c of a)if(f(c)!==b)return -1;let c=this.channels.get(b);return c?this.channels.set(b,c.concat(a)):this.channels.set(b,a),Array.from(this.channels.values()).reduce((a,b)=>a+b.length,0)}removeChannels(a){let b=f(a[0]);for(let c of a)if(f(c)!==b)return -1;let c=this.channels.get(b);if(c){let d=c.filter(b=>!a.includes(b));this.channels.set(b,d)}return Array.from(this.channels.values()).reduce((a,b)=>a+b.length,0)}stop(){for(let a of this.shardedSubscribers.values())a.stop();this.pendingReset=null,this.shardedSubscribers.clear(),this.subscriberToSlotsIndex.clear()}start(){let a=[];for(let b of this.shardedSubscribers.values())b.isStarted()||a.push(b.start().then(()=>{this.handleSubscriberConnectSucceeded(b.getNodeKey())}).catch(a=>{this.handleSubscriberConnectFailed(a,b.getNodeKey())}));return Promise.all(a)}async reset(a,b){if(this.isResetting){this.pendingReset={slots:a,nodes:b};return}this.isResetting=!0;try{let c=this._refreshSlots(a),d=this.hasUnhealthySubscribers();if(!c&&!d)return void h("No topology change detected or failed subscribers. Skipping reset.");for(let[a,b]of this.shardedSubscribers){if(this.subscriberToSlotsIndex.has(a)&&b.isStarted()){h("Skipping deleting subscriber for %s",a);continue}h("Removing subscriber for %s",a),b.stop(),this.shardedSubscribers.delete(a),this.subscriberGroupEmitter.emit("-subscriber")}let f=[];for(let[a,c]of this.subscriberToSlotsIndex){if(this.shardedSubscribers.has(a)){h("Skipping creating new subscriber for %s",a);continue}h("Creating new subscriber for %s",a);let c=b.find(b=>(0,e.getNodeKey)(b.options)===a);if(!c){h("Failed to find node for key %s",a);continue}let d=new g.default(this.subscriberGroupEmitter,c.options);this.shardedSubscribers.set(a,d),f.push(d.start().then(()=>{this.handleSubscriberConnectSucceeded(a)}).catch(b=>{this.handleSubscriberConnectFailed(b,a)})),this.subscriberGroupEmitter.emit("+subscriber")}await Promise.all(f),this._resubscribe(),this.subscriberGroupEmitter.emit("subscribersReady")}finally{if(this.isResetting=!1,this.pendingReset){let{slots:a,nodes:b}=this.pendingReset;this.pendingReset=null,await this.reset(a,b)}}}_refreshSlots(a){if(this._slotsAreEqual(a))return h("Nothing to refresh because the new cluster map is equal to the previous one."),!1;h("Refreshing the slots of the subscriber group."),this.subscriberToSlotsIndex=new Map;for(let b=0;b<a.length;b++){let c=a[b][0];this.subscriberToSlotsIndex.has(c)||this.subscriberToSlotsIndex.set(c,[]),this.subscriberToSlotsIndex.get(c).push(Number(b))}return this.clusterSlots=JSON.parse(JSON.stringify(a)),!0}_resubscribe(){this.shardedSubscribers&&this.shardedSubscribers.forEach((a,b)=>{let c=this.subscriberToSlotsIndex.get(b);c&&c.forEach(c=>{let d=a.getInstance(),e=this.channels.get(c);if(e&&e.length>0){if("end"===d.status)return;"ready"===d.status?d.ssubscribe(...e).catch(a=>{h("Failed to ssubscribe on node %s: %s",b,a)}):d.once("ready",()=>{d.ssubscribe(...e).catch(a=>{h("Failed to ssubscribe on node %s: %s",b,a)})})}})})}_slotsAreEqual(a){return void 0!==this.clusterSlots&&JSON.stringify(this.clusterSlots)===JSON.stringify(a)}hasUnhealthySubscribers(){let a=Array.from(this.shardedSubscribers.values()).some(a=>!a.isStarted()),b=Array.from(this.subscriberToSlotsIndex.keys()).some(a=>!this.shardedSubscribers.has(a));return a||b}}b.default=i,i.MAX_RETRY_ATTEMPTS=10,i.MAX_BACKOFF_MS=2e3,i.BASE_BACKOFF_MS=100},18797:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});let d=(0,c(54187).Debug)("AbstractConnector");class e{constructor(a){this.connecting=!1,this.disconnectTimeout=a}check(a){return!0}disconnect(){if(this.connecting=!1,this.stream){let a=this.stream,b=setTimeout(()=>{d("stream %s:%s still open, destroying it",a.remoteAddress,a.remotePort),a.destroy()},this.disconnectTimeout);a.on("close",()=>clearTimeout(b)),a.end()}}}b.default=e},19140:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});let d=c(54187),e=c(73380),f=(0,d.Debug)("delayqueue");class g{constructor(){this.queues={},this.timeouts={}}push(a,b,c){let d=c.callback||process.nextTick;this.queues[a]||(this.queues[a]=new e),this.queues[a].push(b),this.timeouts[a]||(this.timeouts[a]=setTimeout(()=>{d(()=>{this.timeouts[a]=null,this.execute(a)})},c.timeout))}execute(a){let b=this.queues[a];if(!b)return;let{length:c}=b;if(c)for(f("send %d commands in %s queue",c,a),this.queues[a]=null;b.length>0;)b.shift()()}}b.default=g},19283:(a,b,c)=>{b.formatArgs=function(b){if(b[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+b[0]+(this.useColors?"%c ":" ")+"+"+a.exports.humanize(this.diff),!this.useColors)return;let c="color: "+this.color;b.splice(1,0,c,"color: inherit");let d=0,e=0;b[0].replace(/%[a-zA-Z%]/g,a=>{"%%"!==a&&(d++,"%c"===a&&(e=d))}),b.splice(e,0,c)},b.save=function(a){try{a?b.storage.setItem("debug",a):b.storage.removeItem("debug")}catch(a){}},b.load=function(){let a;try{a=b.storage.getItem("debug")||b.storage.getItem("DEBUG")}catch(a){}return!a&&"undefined"!=typeof process&&"env"in process&&(a=process.env.DEBUG),a},b.useColors=function(){let a;return"undefined"!=typeof window&&!!window.process&&("renderer"===window.process.type||!!window.process.__nwjs)||!("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(a=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(a[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},b.storage=function(){try{return localStorage}catch(a){}}(),b.destroy=(()=>{let a=!1;return()=>{a||(a=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),b.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],b.log=console.debug||console.log||(()=>{}),a.exports=c(950)(b);let{formatters:d}=a.exports;d.j=function(a){try{return JSON.stringify(a)}catch(a){return"[UnexpectedJSONParseError]: "+a.message}}},20354:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.DEFAULT_CLUSTER_OPTIONS=void 0;let d=c(14985);b.DEFAULT_CLUSTER_OPTIONS={clusterRetryStrategy:a=>Math.min(100+2*a,2e3),enableOfflineQueue:!0,enableReadyCheck:!0,scaleReads:"master",maxRedirections:16,retryDelayOnMoved:0,retryDelayOnFailover:100,retryDelayOnClusterDown:100,retryDelayOnTryAgain:100,slotsRefreshTimeout:1e3,useSRVRecords:!1,resolveSrv:d.resolveSrv,dnsLookup:d.lookup,enableAutoPipelining:!1,autoPipeliningIgnoredCommands:[],shardedSubscribers:!1}},22009:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.SentinelConnector=b.StandaloneConnector=void 0,b.StandaloneConnector=c(3820).default,b.SentinelConnector=c(15789).default},22618:(a,b,c)=>{"use strict";let d,e=c(21820),f=c(83997),g=c(47823),{env:h}=process;function i(a){return 0!==a&&{level:a,hasBasic:!0,has256:a>=2,has16m:a>=3}}function j(a,b){if(0===d)return 0;if(g("color=16m")||g("color=full")||g("color=truecolor"))return 3;if(g("color=256"))return 2;if(a&&!b&&void 0===d)return 0;let c=d||0;if("dumb"===h.TERM)return c;if("win32"===process.platform){let a=e.release().split(".");return Number(a[0])>=10&&Number(a[2])>=10586?Number(a[2])>=14931?3:2:1}if("CI"in h)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(a=>a in h)||"codeship"===h.CI_NAME?1:c;if("TEAMCITY_VERSION"in h)return+!!/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(h.TEAMCITY_VERSION);if("truecolor"===h.COLORTERM)return 3;if("TERM_PROGRAM"in h){let a=parseInt((h.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(h.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(h.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(h.TERM)||"COLORTERM"in h?1:c}g("no-color")||g("no-colors")||g("color=false")||g("color=never")?d=0:(g("color")||g("colors")||g("color=true")||g("color=always"))&&(d=1),"FORCE_COLOR"in h&&(d="true"===h.FORCE_COLOR?1:"false"===h.FORCE_COLOR?0:0===h.FORCE_COLOR.length?1:Math.min(parseInt(h.FORCE_COLOR,10),3)),a.exports={supportsColor:function(a){return i(j(a,a&&a.isTTY))},stdout:i(j(!0,f.isatty(1))),stderr:i(j(!0,f.isatty(2)))}},23142:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.FailoverDetector=void 0;let d=(0,c(54187).Debug)("FailoverDetector"),e="+switch-master";class f{constructor(a,b){this.isDisconnected=!1,this.connector=a,this.sentinels=b}cleanup(){for(let a of(this.isDisconnected=!0,this.sentinels))a.client.disconnect()}async subscribe(){d("Starting FailoverDetector");let a=[];for(let b of this.sentinels){let c=b.client.subscribe(e).catch(a=>{d("Failed to subscribe to failover messages on sentinel %s:%s (%s)",b.address.host||"127.0.0.1",b.address.port||26739,a.message)});a.push(c),b.client.on("message",a=>{this.isDisconnected||a!==e||this.disconnect()})}await Promise.all(a)}disconnect(){this.isDisconnected=!0,d("Failover detected, disconnecting"),this.connector.disconnect()}}b.FailoverDetector=f},23865:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});let d=c(14642),e=c(54187),f=c(16688),g=c(43504),h=(0,e.Debug)("dataHandler");class i{constructor(a,b){this.redis=a;let c=new f({stringNumbers:b.stringNumbers,returnBuffers:!0,returnError:a=>{this.returnError(a)},returnFatalError:a=>{this.returnFatalError(a)},returnReply:a=>{this.returnReply(a)}});a.stream.prependListener("data",a=>{c.execute(a)}),a.stream.resume()}returnFatalError(a){a.message+=". Please report this.",this.redis.recoverFromFatalError(a,a,{offlineQueue:!1})}returnError(a){let b=this.shiftCommand(a);if(b){if(a.command={name:b.command.name,args:b.command.args},"ssubscribe"==b.command.name&&a.message.includes("MOVED"))return void this.redis.emit("moved");this.redis.handleReconnection(a,b)}}returnReply(a){if(this.handleMonitorReply(a)||this.handleSubscriberReply(a))return;let b=this.shiftCommand(a);b&&(d.default.checkFlag("ENTER_SUBSCRIBER_MODE",b.command.name)?(this.redis.condition.subscriber=new g.default,this.redis.condition.subscriber.add(b.command.name,a[1].toString()),k(b.command,a[2])||this.redis.commandQueue.unshift(b)):d.default.checkFlag("EXIT_SUBSCRIBER_MODE",b.command.name)?l(b.command,a[2])||this.redis.commandQueue.unshift(b):b.command.resolve(a))}handleSubscriberReply(a){if(!this.redis.condition.subscriber)return!1;let b=Array.isArray(a)?a[0].toString():null;switch(h('receive reply "%s" in subscriber mode',b),b){case"message":this.redis.listeners("message").length>0&&this.redis.emit("message",a[1].toString(),a[2]?a[2].toString():""),this.redis.emit("messageBuffer",a[1],a[2]);break;case"pmessage":{let b=a[1].toString();this.redis.listeners("pmessage").length>0&&this.redis.emit("pmessage",b,a[2].toString(),a[3].toString()),this.redis.emit("pmessageBuffer",b,a[2],a[3]);break}case"smessage":this.redis.listeners("smessage").length>0&&this.redis.emit("smessage",a[1].toString(),a[2]?a[2].toString():""),this.redis.emit("smessageBuffer",a[1],a[2]);break;case"ssubscribe":case"subscribe":case"psubscribe":{let c=a[1].toString();this.redis.condition.subscriber.add(b,c);let d=this.shiftCommand(a);if(!d)return;k(d.command,a[2])||this.redis.commandQueue.unshift(d);break}case"sunsubscribe":case"unsubscribe":case"punsubscribe":{let c=a[1]?a[1].toString():null;c&&this.redis.condition.subscriber.del(b,c);let d=a[2];0===Number(d)&&(this.redis.condition.subscriber=!1);let e=this.shiftCommand(a);if(!e)return;l(e.command,d)||this.redis.commandQueue.unshift(e);break}default:{let b=this.shiftCommand(a);if(!b)return;b.command.resolve(a)}}return!0}handleMonitorReply(a){if("monitoring"!==this.redis.status)return!1;let b=a.toString();if("OK"===b)return!1;let c=b.indexOf(" "),d=b.slice(0,c),e=b.indexOf('"'),f=b.slice(e+1,-1).split('" "').map(a=>a.replace(/\\"/g,'"')),g=b.slice(c+2,e-2).split(" ");return this.redis.emit("monitor",d,f,g[1],g[0]),!0}shiftCommand(a){let b=this.redis.commandQueue.shift();if(!b){let b=Error("Command queue state error. If you can reproduce this, please report it."+(a instanceof Error?` Last error: ${a.message}`:` Last reply: ${a.toString()}`));return this.redis.emit("error",b),null}return b}}b.default=i;let j=new WeakMap;function k(a,b){let c=j.has(a)?j.get(a):a.args.length;return(c-=1)<=0?(a.resolve(b),j.delete(a),!0):(j.set(a,c),!1)}function l(a,b){let c=j.has(a)?j.get(a):a.args.length;return 0===c?0===Number(b)&&(j.delete(a),a.resolve(b),!0):(c-=1)<=0?(a.resolve(b),!0):(j.set(a,c),!1)}},24281:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.addTransactionSupport=void 0;let d=c(54187),e=c(881),f=c(82161);b.addTransactionSupport=function(a){a.pipeline=function(a){let b=new f.default(this);return Array.isArray(a)&&b.addBatch(a),b};let{multi:b}=a;a.multi=function(a,c){if(void 0!==c||Array.isArray(a)||(c=a,a=null),c&&!1===c.pipeline)return b.call(this);let g=new f.default(this);g.multi(),Array.isArray(a)&&g.addBatch(a);let h=g.exec;g.exec=function(a){if(this.isCluster&&!this.redis.slots.length)return"wait"===this.redis.status&&this.redis.connect().catch(d.noop),(0,e.default)(new Promise((a,b)=>{this.redis.delayUntilReady(c=>{if(c)return void b(c);this.exec(g).then(a,b)})}),a);if(this._transactions>0&&h.call(g),this.nodeifiedPromise)return h.call(g);let b=h.call(g);return(0,e.default)(b.then(function(a){let b=a[a.length-1];if(void 0===b)throw Error("Pipeline cannot be used to send any commands when the `exec()` has been called on it.");if(b[0]){b[0].previousErrors=[];for(let c=0;c<a.length-1;++c)a[c][0]&&b[0].previousErrors.push(a[c][0]);throw b[0]}return(0,d.wrapMultiResult)(b[1])}),a)};let{execBuffer:i}=g;return g.execBuffer=function(a){return this._transactions>0&&i.call(g),g.exec(a)},g};let{exec:c}=a;a.exec=function(a){return(0,e.default)(c.call(this).then(function(a){return Array.isArray(a)&&(a=(0,d.wrapMultiResult)(a)),a}),a)}}},27509:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.executeWithAutoPipelining=b.getFirstValueInFlattenedArray=b.shouldUseAutoPipelining=b.notAllowedAutoPipelineCommands=b.kCallbacks=b.kExec=void 0;let d=c(77318),e=c(91957),f=c(881),g=c(9666);function h(a){for(let b=0;b<a.length;b++){let c=a[b];if("string"==typeof c)return c;if(Array.isArray(c)||(0,d.isArguments)(c)){if(0===c.length)continue;return c[0]}let e=[c].flat();if(e.length>0)return e[0]}}b.kExec=Symbol("exec"),b.kCallbacks=Symbol("callbacks"),b.notAllowedAutoPipelineCommands=["auth","info","script","quit","cluster","pipeline","multi","subscribe","psubscribe","unsubscribe","unpsubscribe","select","client"],b.shouldUseAutoPipelining=function(a,c,d){return c&&a.options.enableAutoPipelining&&!a.isPipeline&&!b.notAllowedAutoPipelineCommands.includes(d)&&!a.options.autoPipeliningIgnoredCommands.includes(d)},b.getFirstValueInFlattenedArray=h,b.executeWithAutoPipelining=function a(c,i,j,k,l){if(c.isCluster&&!c.slots.length)return"wait"===c.status&&c.connect().catch(d.noop),(0,f.default)(new Promise(function(b,d){c.delayUntilReady(e=>{if(e)return void d(e);a(c,i,j,k,null).then(b,d)})}),l);let m=c.options.keyPrefix||"",n=c.isCluster?c.slots[e(`${m}${h(k)}`)].join(","):"main";if(c.isCluster&&"master"!==c.options.scaleReads&&(n+=(0,g.exists)(j)&&(0,g.hasFlag)(j,"readonly")?":read":":write"),!c._autoPipelines.has(n)){let a=c.pipeline();a[b.kExec]=!1,a[b.kCallbacks]=[],c._autoPipelines.set(n,a)}let o=c._autoPipelines.get(n);o[b.kExec]||(o[b.kExec]=!0,setImmediate(function a(c,d){if(c._runningAutoPipelines.has(d)||!c._autoPipelines.has(d))return;c._runningAutoPipelines.add(d);let e=c._autoPipelines.get(d);c._autoPipelines.delete(d);let f=e[b.kCallbacks];e[b.kCallbacks]=null,e.exec(function(b,e){if(c._runningAutoPipelines.delete(d),b)for(let a=0;a<f.length;a++)process.nextTick(f[a],b);else for(let a=0;a<f.length;a++)process.nextTick(f[a],...e[a]);c._autoPipelines.has(d)&&a(c,d)})},c,n));let p=new Promise(function(a,c){o[b.kCallbacks].push(function(b,d){if(b)return void c(b);a(d)}),"call"===i&&k.unshift(j),o[i](...k)});return(0,f.default)(p,l)}},29229:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.print=b.ReplyError=b.SentinelIterator=b.SentinelConnector=b.AbstractConnector=b.Pipeline=b.ScanStream=b.Command=b.Cluster=b.Redis=b.default=void 0,b=a.exports=c(88568).default;var d=c(88568);Object.defineProperty(b,"default",{enumerable:!0,get:function(){return d.default}});var e=c(88568);Object.defineProperty(b,"Redis",{enumerable:!0,get:function(){return e.default}});var f=c(55058);Object.defineProperty(b,"Cluster",{enumerable:!0,get:function(){return f.default}});var g=c(14642);Object.defineProperty(b,"Command",{enumerable:!0,get:function(){return g.default}});var h=c(30644);Object.defineProperty(b,"ScanStream",{enumerable:!0,get:function(){return h.default}});var i=c(82161);Object.defineProperty(b,"Pipeline",{enumerable:!0,get:function(){return i.default}});var j=c(18797);Object.defineProperty(b,"AbstractConnector",{enumerable:!0,get:function(){return j.default}});var k=c(15789);Object.defineProperty(b,"SentinelConnector",{enumerable:!0,get:function(){return k.default}}),Object.defineProperty(b,"SentinelIterator",{enumerable:!0,get:function(){return k.SentinelIterator}}),b.ReplyError=c(44400).ReplyError,Object.defineProperty(b,"Promise",{get:()=>(console.warn("ioredis v5 does not support plugging third-party Promise library anymore. Native Promise will be used."),Promise),set(a){console.warn("ioredis v5 does not support plugging third-party Promise library anymore. Native Promise will be used.")}}),b.print=function(a,b){a?console.log("Error: "+a):console.log("Reply: "+b)}},30577:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});let d=c(44400);class e extends d.RedisError{constructor(a,b){super(a),this.lastNodeError=b,Error.captureStackTrace(this,this.constructor)}get name(){return this.constructor.name}}b.default=e,e.defaultMessage="Failed to refresh slots cache."},30644:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});let d=c(27910);class e extends d.Readable{constructor(a){super(a),this.opt=a,this._redisCursor="0",this._redisDrained=!1}_read(){if(this._redisDrained)return void this.push(null);let a=[this._redisCursor];this.opt.key&&a.unshift(this.opt.key),this.opt.match&&a.push("MATCH",this.opt.match),this.opt.type&&a.push("TYPE",this.opt.type),this.opt.count&&a.push("COUNT",String(this.opt.count)),this.opt.noValues&&a.push("NOVALUES"),this.opt.redis[this.opt.command](a,(a,b)=>{if(a)return void this.emit("error",a);this._redisCursor=b[0]instanceof Buffer?b[0].toString():b[0],"0"===this._redisCursor&&(this._redisDrained=!0),this.push(b[1])})}close(){this._redisDrained=!0}}b.default=e},32011:a=>{function b(a,b,c,d){return Math.round(a/c)+" "+d+(b>=1.5*c?"s":"")}a.exports=function(a,c){c=c||{};var d,e,f,g,h=typeof a;if("string"===h&&a.length>0){var i=a;if(!((i=String(i)).length>100)){var j=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(j){var k=parseFloat(j[1]);switch((j[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*k;case"weeks":case"week":case"w":return 6048e5*k;case"days":case"day":case"d":return 864e5*k;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*k;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*k;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*k;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return k;default:break}}}return}if("number"===h&&isFinite(a)){return c.long?(e=Math.abs(d=a))>=864e5?b(d,e,864e5,"day"):e>=36e5?b(d,e,36e5,"hour"):e>=6e4?b(d,e,6e4,"minute"):e>=1e3?b(d,e,1e3,"second"):d+" ms":(g=Math.abs(f=a))>=864e5?Math.round(f/864e5)+"d":g>=36e5?Math.round(f/36e5)+"h":g>=6e4?Math.round(f/6e4)+"m":g>=1e3?Math.round(f/1e3)+"s":f+"ms"}throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(a))}},34103:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});let d=c(37970),e=c(54187),f=c(88568),g=(0,e.Debug)("cluster:subscriberGroup:shardedSubscriber");class h{constructor(a,b){for(let c of(this.emitter=a,this.started=!1,this.instance=null,this.messageListeners=new Map,this.onEnd=()=>{this.started=!1,this.emitter.emit("-node",this.instance,this.nodeKey)},this.onError=a=>{this.emitter.emit("nodeError",a,this.nodeKey)},this.onMoved=()=>{this.emitter.emit("moved")},this.instance=new f.default({port:b.port,host:b.host,username:b.username,password:b.password,enableReadyCheck:!1,offlineQueue:!0,connectionName:(0,d.getConnectionName)("ssubscriber",b.connectionName),lazyConnect:!0,tls:b.tls,retryStrategy:null}),this.nodeKey=(0,d.getNodeKey)(b),this.instance.once("end",this.onEnd),this.instance.on("error",this.onError),this.instance.on("moved",this.onMoved),["smessage","smessageBuffer"])){let a=(...a)=>{this.emitter.emit(c,...a)};this.messageListeners.set(c,a),this.instance.on(c,a)}}async start(){if(this.started)return void g("already started %s",this.nodeKey);try{await this.instance.connect(),g("started %s",this.nodeKey),this.started=!0}catch(a){throw g("failed to start %s: %s",this.nodeKey,a),this.started=!1,a}}stop(){this.started=!1,this.instance&&(this.instance.disconnect(),this.instance.removeAllListeners(),this.messageListeners.clear(),this.instance=null),g("stopped %s",this.nodeKey)}isStarted(){return this.started}getInstance(){return this.instance}getNodeKey(){return this.nodeKey}}b.default=h},37422:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{z:()=>o});var e=c(97494),f=c(80037),g=c(64939),h=c(37614),i=a([g,f]);[g,f]=i.then?(await i)():i;let j=process.env.DATABASE_URL||(process.env.DB_HOST?`postgresql://${process.env.DB_USERNAME}:${encodeURIComponent(process.env.DB_PASSWORD||"")}@${process.env.DB_HOST}:${process.env.DB_PORT||"5432"}/${process.env.DB_NAME||"chorus"}`:void 0),k=globalThis,l=k.pool??new g.default.Pool({connectionString:j,...process.env.DB_HOST?{ssl:{rejectUnauthorized:!1}}:{}}),m=new f.M(l),n=h.A.child({module:"prisma"}),o=k.prisma??new e.m3({adapter:m,log:[{emit:"event",level:"error"}]});k.prisma||"function"!=typeof o.$on||(o.$on("query",a=>{n.debug({duration:a.duration},a.query)}),o.$on("warn",a=>{n.warn(a.message)}),o.$on("error",a=>{n.error(a.message)})),d()}catch(a){d(a)}})},37614:(a,b,c)=>{"use strict";c.d(b,{A:()=>e});var d=c(74552);let e=c.n(d)()({level:process.env.LOG_LEVEL||"info",base:{service:"chorus"},...{}})},37970:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.getConnectionName=b.weightSrvRecords=b.groupSrvRecords=b.getUniqueHostnamesFromOptions=b.normalizeNodeOptions=b.nodeKeyToRedisOptions=b.getNodeKey=void 0;let d=c(54187),e=c(91645);b.getNodeKey=function(a){return a.port=a.port||6379,a.host=a.host||"127.0.0.1",a.host+":"+a.port},b.nodeKeyToRedisOptions=function(a){let b=a.lastIndexOf(":");if(-1===b)throw Error(`Invalid node key ${a}`);return{host:a.slice(0,b),port:Number(a.slice(b+1))}},b.normalizeNodeOptions=function(a){return a.map(a=>{let b={};if("object"==typeof a)Object.assign(b,a);else if("string"==typeof a)Object.assign(b,(0,d.parseURL)(a));else if("number"==typeof a)b.port=a;else throw Error("Invalid argument "+a);return"string"==typeof b.port&&(b.port=parseInt(b.port,10)),delete b.db,b.port||(b.port=6379),b.host||(b.host="127.0.0.1"),(0,d.resolveTLSProfile)(b)})},b.getUniqueHostnamesFromOptions=function(a){let b={};return a.forEach(a=>{b[a.host]=!0}),Object.keys(b).filter(a=>!(0,e.isIP)(a))},b.groupSrvRecords=function(a){let b={};for(let c of a)b.hasOwnProperty(c.priority)?(b[c.priority].totalWeight+=c.weight,b[c.priority].records.push(c)):b[c.priority]={totalWeight:c.weight,records:[c]};return b},b.weightSrvRecords=function(a){if(1===a.records.length)return a.totalWeight=0,a.records.shift();let b=Math.floor(Math.random()*(a.totalWeight+a.records.length)),c=0;for(let[d,e]of a.records.entries())if((c+=1+e.weight)>b)return a.totalWeight-=e.weight,a.records.splice(d,1),e},b.getConnectionName=function(a,b){let c=`ioredis-cluster(${a})`;return b?`${c}:${b}`:c}},38002:(a,b)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});let c=`-----BEGIN CERTIFICATE-----
1
+ exports.id=937,exports.ids=[937],exports.modules={881:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});let d=c(41138);function e(a){setTimeout(function(){throw a},0)}b.default=function(a,b,c){return"function"==typeof b&&a.then(a=>{let f;(f=void 0!==c&&Object(c).spread&&Array.isArray(a)?d.tryCatch(b).apply(void 0,[null].concat(a)):void 0===a?d.tryCatch(b)(null):d.tryCatch(b)(null,a))===d.errorObj&&e(f.e)},a=>{if(!a){let b=Error(a+"");Object.assign(b,{cause:a}),a=b}let c=d.tryCatch(b)(a);c===d.errorObj&&e(c.e)}),a}},950:(a,b,c)=>{a.exports=function(a){function b(a){let c,e,f,g=null;function h(...a){if(!h.enabled)return;let d=Number(new Date);h.diff=d-(c||d),h.prev=c,h.curr=d,c=d,a[0]=b.coerce(a[0]),"string"!=typeof a[0]&&a.unshift("%O");let e=0;a[0]=a[0].replace(/%([a-zA-Z%])/g,(c,d)=>{if("%%"===c)return"%";e++;let f=b.formatters[d];if("function"==typeof f){let b=a[e];c=f.call(h,b),a.splice(e,1),e--}return c}),b.formatArgs.call(h,a),(h.log||b.log).apply(h,a)}return h.namespace=a,h.useColors=b.useColors(),h.color=b.selectColor(a),h.extend=d,h.destroy=b.destroy,Object.defineProperty(h,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==g?g:(e!==b.namespaces&&(e=b.namespaces,f=b.enabled(a)),f),set:a=>{g=a}}),"function"==typeof b.init&&b.init(h),h}function d(a,c){let d=b(this.namespace+(void 0===c?":":c)+a);return d.log=this.log,d}function e(a,b){let c=0,d=0,e=-1,f=0;for(;c<a.length;)if(d<b.length&&(b[d]===a[c]||"*"===b[d]))"*"===b[d]?(e=d,f=c):c++,d++;else{if(-1===e)return!1;d=e+1,c=++f}for(;d<b.length&&"*"===b[d];)d++;return d===b.length}return b.debug=b,b.default=b,b.coerce=function(a){return a instanceof Error?a.stack||a.message:a},b.disable=function(){let a=[...b.names,...b.skips.map(a=>"-"+a)].join(",");return b.enable(""),a},b.enable=function(a){for(let c of(b.save(a),b.namespaces=a,b.names=[],b.skips=[],("string"==typeof a?a:"").trim().replace(/\s+/g,",").split(",").filter(Boolean)))"-"===c[0]?b.skips.push(c.slice(1)):b.names.push(c)},b.enabled=function(a){for(let c of b.skips)if(e(a,c))return!1;for(let c of b.names)if(e(a,c))return!0;return!1},b.humanize=c(32011),b.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(a).forEach(c=>{b[c]=a[c]}),b.names=[],b.skips=[],b.formatters={},b.selectColor=function(a){let c=0;for(let b=0;b<a.length;b++)c=(c<<5)-c+a.charCodeAt(b)|0;return b.colors[Math.abs(c)%b.colors.length]},b.enable(b.load()),b}},3820:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});let d=c(91645),e=c(34631),f=c(54187),g=c(18797);class h extends g.default{constructor(a){super(a.disconnectTimeout),this.options=a}connect(a){let b,{options:c}=this;return this.connecting=!0,"path"in c&&c.path?b={path:c.path}:(b={},"port"in c&&null!=c.port&&(b.port=c.port),"host"in c&&null!=c.host&&(b.host=c.host),"family"in c&&null!=c.family&&(b.family=c.family)),c.tls&&Object.assign(b,c.tls),new Promise((a,g)=>{process.nextTick(()=>{if(!this.connecting)return void g(Error(f.CONNECTION_CLOSED_ERROR_MSG));try{c.tls?this.stream=(0,e.connect)(b):this.stream=(0,d.createConnection)(b)}catch(a){g(a);return}this.stream.once("error",a=>{this.firstError=a}),a(this.stream)})})}}b.default=h},9666:function(a,b,c){"use strict";var d=this&&this.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(b,"__esModule",{value:!0}),b.getKeyIndexes=b.hasFlag=b.exists=b.list=void 0;let e=d(c(39176));b.list=Object.keys(e.default);let f={};function g(a){"string"!=typeof a&&(a=String(a));let b=a.indexOf("->");return -1===b?a.length:b}b.list.forEach(a=>{f[a]=e.default[a].flags.reduce(function(a,b){return a[b]=!0,a},{})}),b.exists=function(a,b){return a=(null==b?void 0:b.caseInsensitive)?String(a).toLowerCase():a,!!e.default[a]},b.hasFlag=function(a,b,c){if(!f[a=(null==c?void 0:c.nameCaseInsensitive)?String(a).toLowerCase():a])throw Error("Unknown command "+a);return!!f[a][b]},b.getKeyIndexes=function(a,b,c){a=(null==c?void 0:c.nameCaseInsensitive)?String(a).toLowerCase():a;let d=e.default[a];if(!d)throw Error("Unknown command "+a);if(!Array.isArray(b))throw Error("Expect args to be an array");let f=[],h=!!(c&&c.parseExternalKey),i=(a,b)=>{let c=[],d=Number(a[b]);for(let a=0;a<d;a++)c.push(a+b+1);return c},j=(a,b,c)=>{for(let d=b;d<a.length-1;d+=1)if(String(a[d]).toLowerCase()===c.toLowerCase())return d+1;return null};switch(a){case"zunionstore":case"zinterstore":case"zdiffstore":f.push(0,...i(b,1));break;case"eval":case"evalsha":case"eval_ro":case"evalsha_ro":case"fcall":case"fcall_ro":case"blmpop":case"bzmpop":f.push(...i(b,1));break;case"sintercard":case"lmpop":case"zunion":case"zinter":case"zmpop":case"zintercard":case"zdiff":f.push(...i(b,0));break;case"georadius":{f.push(0);let a=j(b,5,"STORE");a&&f.push(a);let c=j(b,5,"STOREDIST");c&&f.push(c);break}case"georadiusbymember":{f.push(0);let a=j(b,4,"STORE");a&&f.push(a);let c=j(b,4,"STOREDIST");c&&f.push(c);break}case"sort":case"sort_ro":f.push(0);for(let a=1;a<b.length-1;a++){let c=b[a];if("string"!=typeof c)continue;let d=c.toUpperCase();"GET"===d?(a+=1,"#"!==(c=b[a])&&(h?f.push([a,g(c)]):f.push(a))):"BY"===d?(a+=1,h?f.push([a,g(b[a])]):f.push(a)):"STORE"===d&&(a+=1,f.push(a))}break;case"migrate":if(""===b[2])for(let a=5;a<b.length-1;a++){let c=b[a];if("string"==typeof c&&"KEYS"===c.toUpperCase()){for(let c=a+1;c<b.length;c++)f.push(c);break}}else f.push(2);break;case"xreadgroup":case"xread":for(let c=3*("xread"!==a);c<b.length-1;c++)if("STREAMS"===String(b[c]).toUpperCase()){for(let a=c+1;a<=c+(b.length-1-c)/2;a++)f.push(a);break}break;default:if(d.step>0){let a=d.keyStart-1,c=d.keyStop>0?d.keyStop:b.length+d.keyStop+1;for(let b=a;b<c;b+=d.step)f.push(b)}}return f}},10713:(a,b,c)=>{"use strict";c.d(b,{B:()=>s});var d=c(94735),e=c(55511),f=c(29229),g=c.n(f),h=c(37614);let i=h.A.child({module:"redis"}),j=function(){if(process.env.REDIS_URL)return process.env.REDIS_URL;let a=process.env.REDIS_HOST;if(!a)return;let b=process.env.REDIS_PORT||"6379",c=process.env.REDIS_USERNAME||"default",d=process.env.REDIS_PASSWORD,e="rediss";return d?`${e}://${c}:${encodeURIComponent(d)}@${a}:${b}`:`${e}://${a}:${b}`}(),k=globalThis;function l(a){let b=new(g())(j,{lazyConnect:!0,maxRetriesPerRequest:null,retryStrategy(b){let c=Math.min(200*b,5e3);return i.warn({name:a,delay:c,attempt:b},"Reconnecting"),c}});return b.on("error",b=>{i.error({name:a,err:b},"Redis error")}),b.on("connect",()=>{i.info({name:a},"Connected")}),b}function m(){return j?(k.redisPub||(k.redisPub=l("pub")),k.redisPub):null}function n(){return j?(k.redisSub||(k.redisSub=l("sub")),k.redisSub):null}let o=h.A.child({module:"event-bus"}),p="chorus:events";class q extends d.EventEmitter{static{this.THROTTLE_WINDOW_MS=2e3}static{this.EVICTION_INTERVAL_MS=3e4}static{this.EVICTION_TTL_MS=3e4}async connect(){if(this._connected||!j)return;this._connected=!0;let a=n(),b=m();a&&(await a.connect(),b&&await b.connect(),await a.subscribe(p),a.on("message",(a,b)=>{try{let a=JSON.parse(b);if(a._origin===this._instanceId)return;super.emit(a.channel,a.data)}catch{}}))}emit(a,...b){if("string"==typeof a&&j){let c=m();if(c&&"ready"===c.status){let d={_origin:this._instanceId,channel:a,data:b[0]};c.publish(p,JSON.stringify(d)).catch(()=>{})}}return super.emit(a,...b)}emitPresence(a){let b=`${a.agentUuid}:${a.entityType}:${a.entityUuid}${a.subEntityType?`:${a.subEntityType}`:""}${a.subEntityUuid?`:${a.subEntityUuid}`:""}`,c=Date.now(),d=this._presenceThrottle.get(b);d&&c-d<q.THROTTLE_WINDOW_MS||(this._presenceThrottle.set(b,c),this._ensureEvictionTimer(),this.emit("presence",a))}_ensureEvictionTimer(){!this._evictionTimer&&(this._evictionTimer=setInterval(()=>{let a=Date.now();for(let[b,c]of this._presenceThrottle)a-c>=q.EVICTION_TTL_MS&&this._presenceThrottle.delete(b);0===this._presenceThrottle.size&&(clearInterval(this._evictionTimer),this._evictionTimer=null)},q.EVICTION_INTERVAL_MS),this._evictionTimer&&"object"==typeof this._evictionTimer&&"unref"in this._evictionTimer&&this._evictionTimer.unref())}get _throttleMapSize(){return this._presenceThrottle.size}_resetPresenceState(){this._presenceThrottle.clear(),this._evictionTimer&&(clearInterval(this._evictionTimer),this._evictionTimer=null)}emitChange(a){this.emit("change",a)}async disconnect(){let a=m(),b=n();b&&await b.quit().catch(()=>{}),a&&await a.quit().catch(()=>{}),this._connected=!1}constructor(...a){super(...a),this._connected=!1,this._instanceId=(0,e.randomUUID)(),this._presenceThrottle=new Map,this._evictionTimer=null}}let r=globalThis,s=r.chorusEventBus??=new q;j&&s.connect().catch(a=>{o.error({err:a},"Redis connect failed, falling back to memory")})},11309:(a,b,c)=>{"use strict";c.d(b,{UE:()=>f,sL:()=>e});var d=c(96009),e=class extends Error{name="DriverAdapterError";cause;constructor(a){super("string"==typeof a.message?a.message:a.kind),this.cause=a}};(0,d.y)("driver-adapter-utils");var f={Int32:0,Int64:1,Float:2,Double:3,Numeric:4,Boolean:5,Character:6,Text:7,Date:8,Time:9,DateTime:10,Json:11,Enum:12,Bytes:13,Set:14,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,EnumArray:76,BytesArray:77,UuidArray:78,UnknownNumber:128};Error("Not implemented: queryRaw"),Error("Not implemented: executeRaw"),Error("Not implemented: startTransaction"),Error("Not implemented: executeScript"),Error("Not implemented: dispose")},12590:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});let d=c(55511),e=c(14642),f=c(881);class g{constructor(a,b=null,c="",f=!1){this.lua=a,this.numberOfKeys=b,this.keyPrefix=c,this.readOnly=f,this.sha=(0,d.createHash)("sha1").update(a).digest("hex");let g=this.sha,h=new WeakSet;this.Command=class extends e.default{toWritable(b){let c=this.reject;return this.reject=a=>{-1!==a.message.indexOf("NOSCRIPT")&&h.delete(b),c.call(this,a)},h.has(b)?"eval"===this.name&&(this.name="evalsha",this.args[0]=g):(h.add(b),this.name="eval",this.args[0]=a),super.toWritable(b)}}}execute(a,b,c,d){"number"==typeof this.numberOfKeys&&b.unshift(this.numberOfKeys),this.keyPrefix&&(c.keyPrefix=this.keyPrefix),this.readOnly&&(c.readOnly=!0);let e=new this.Command("evalsha",[this.sha,...b],c);return e.promise=e.promise.catch(d=>{if(-1===d.message.indexOf("NOSCRIPT"))throw d;let e=new this.Command("evalsha",[this.sha,...b],c);return(a.isPipeline?a.redis:a).sendCommand(e)}),(0,f.default)(e.promise,d),a.sendCommand(e)}}b.default=g},14642:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});let d=c(9666),e=c(91957),f=c(881),g=c(54187),h=c(85316);class i{constructor(a,b=[],c={},d){if(this.name=a,this.inTransaction=!1,this.isResolved=!1,this.transformed=!1,this.replyEncoding=c.replyEncoding,this.errorStack=c.errorStack,this.args=b.flat(),this.callback=d,this.initPromise(),c.keyPrefix){let a=c.keyPrefix instanceof Buffer,b=a?c.keyPrefix:null;this._iterateKeys(d=>d instanceof Buffer?(null===b&&(b=Buffer.from(c.keyPrefix)),Buffer.concat([b,d])):a?Buffer.concat([c.keyPrefix,Buffer.from(String(d))]):c.keyPrefix+d)}c.readOnly&&(this.isReadOnly=!0)}static checkFlag(a,b){return b=b.toLowerCase(),!!this.getFlagMap()[a][b]}static setArgumentTransformer(a,b){this._transformer.argument[a]=b}static setReplyTransformer(a,b){this._transformer.reply[a]=b}static getFlagMap(){return this.flagMap||(this.flagMap=Object.keys(i.FLAGS).reduce((a,b)=>(a[b]={},i.FLAGS[b].forEach(c=>{a[b][c]=!0}),a),{})),this.flagMap}getSlot(){if(void 0===this.slot){let a=this.getKeys()[0];this.slot=null==a?null:e(a)}return this.slot}getKeys(){return this._iterateKeys()}toWritable(a){let b,c="*"+(this.args.length+1)+"\r\n$"+Buffer.byteLength(this.name)+"\r\n"+this.name+"\r\n";if(this.bufferMode){let a=new l;a.push(c);for(let b=0;b<this.args.length;++b){let c=this.args[b];c instanceof Buffer?0===c.length?a.push("$0\r\n\r\n"):(a.push("$"+c.length+"\r\n"),a.push(c),a.push("\r\n")):a.push("$"+Buffer.byteLength(c)+"\r\n"+c+"\r\n")}b=a.toBuffer()}else{b=c;for(let a=0;a<this.args.length;++a){let c=this.args[a];b+="$"+Buffer.byteLength(c)+"\r\n"+c+"\r\n"}}return b}stringifyArguments(){for(let a=0;a<this.args.length;++a){let b=this.args[a];"string"==typeof b||(b instanceof Buffer?this.bufferMode=!0:this.args[a]=(0,g.toArg)(b))}}transformReply(a){this.replyEncoding&&(a=(0,g.convertBufferToString)(a,this.replyEncoding));let b=i._transformer.reply[this.name];return b&&(a=b(a)),a}setTimeout(a){this._commandTimeoutTimer||(this._commandTimeoutTimer=setTimeout(()=>{this.isResolved||this.reject(Error("Command timed out"))},a))}setBlockingTimeout(a){if(a<=0)return;this._blockingTimeoutTimer&&(clearTimeout(this._blockingTimeoutTimer),this._blockingTimeoutTimer=void 0);let b=Date.now();void 0===this._blockingDeadline&&(this._blockingDeadline=b+a);let c=this._blockingDeadline-b;if(c<=0)return void this.resolve(null);this._blockingTimeoutTimer=setTimeout(()=>{if(this.isResolved){this._blockingTimeoutTimer=void 0;return}this._blockingTimeoutTimer=void 0,this.resolve(null)},c)}extractBlockingTimeout(){let a=this.args;if(!a||0===a.length)return;let b=this.name.toLowerCase();return i.checkFlag("LAST_ARG_TIMEOUT_COMMANDS",b)?(0,h.parseSecondsArgument)(a[a.length-1]):i.checkFlag("FIRST_ARG_TIMEOUT_COMMANDS",b)?(0,h.parseSecondsArgument)(a[0]):i.checkFlag("BLOCK_OPTION_COMMANDS",b)?(0,h.parseBlockOption)(a):void 0}_clearTimers(){let a=this._commandTimeoutTimer;a&&(clearTimeout(a),delete this._commandTimeoutTimer);let b=this._blockingTimeoutTimer;b&&(clearTimeout(b),delete this._blockingTimeoutTimer)}initPromise(){let a=new Promise((a,b)=>{if(!this.transformed){this.transformed=!0;let a=i._transformer.argument[this.name];a&&(this.args=a(this.args)),this.stringifyArguments()}this.resolve=this._convertValue(a),this.reject=a=>{this._clearTimers(),this.errorStack?b((0,g.optimizeErrorStack)(a,this.errorStack.stack,__dirname)):b(a)}});this.promise=(0,f.default)(a,this.callback)}_iterateKeys(a=a=>a){if(void 0===this.keys&&(this.keys=[],(0,d.exists)(this.name,{caseInsensitive:!0})))for(let b of(0,d.getKeyIndexes)(this.name,this.args,{nameCaseInsensitive:!0}))this.args[b]=a(this.args[b]),this.keys.push(this.args[b]);return this.keys}_convertValue(a){return b=>{try{this._clearTimers(),a(this.transformReply(b)),this.isResolved=!0}catch(a){this.reject(a)}return this.promise}}}b.default=i,i.FLAGS={VALID_IN_SUBSCRIBER_MODE:["subscribe","psubscribe","unsubscribe","punsubscribe","ssubscribe","sunsubscribe","ping","quit"],VALID_IN_MONITOR_MODE:["monitor","auth"],ENTER_SUBSCRIBER_MODE:["subscribe","psubscribe","ssubscribe"],EXIT_SUBSCRIBER_MODE:["unsubscribe","punsubscribe","sunsubscribe"],WILL_DISCONNECT:["quit"],HANDSHAKE_COMMANDS:["auth","select","client","readonly","info"],IGNORE_RECONNECT_ON_ERROR:["client"],BLOCKING_COMMANDS:["blpop","brpop","brpoplpush","blmove","bzpopmin","bzpopmax","bzmpop","blmpop","xread","xreadgroup"],LAST_ARG_TIMEOUT_COMMANDS:["blpop","brpop","brpoplpush","blmove","bzpopmin","bzpopmax"],FIRST_ARG_TIMEOUT_COMMANDS:["bzmpop","blmpop"],BLOCK_OPTION_COMMANDS:["xread","xreadgroup"]},i._transformer={argument:{},reply:{}};let j=function(a){if(1===a.length){if(a[0]instanceof Map)return(0,g.convertMapToArray)(a[0]);if("object"==typeof a[0]&&null!==a[0])return(0,g.convertObjectToArray)(a[0])}return a},k=function(a){if(2===a.length){if(a[1]instanceof Map)return[a[0]].concat((0,g.convertMapToArray)(a[1]));if("object"==typeof a[1]&&null!==a[1])return[a[0]].concat((0,g.convertObjectToArray)(a[1]))}return a};i.setArgumentTransformer("mset",j),i.setArgumentTransformer("msetnx",j),i.setArgumentTransformer("hset",k),i.setArgumentTransformer("hmset",k),i.setReplyTransformer("hgetall",function(a){if(Array.isArray(a)){let b={};for(let c=0;c<a.length;c+=2){let d=a[c],e=a[c+1];d in b?Object.defineProperty(b,d,{value:e,configurable:!0,enumerable:!0,writable:!0}):b[d]=e}return b}return a});class l{constructor(){this.length=0,this.items=[]}push(a){this.length+=Buffer.byteLength(a),this.items.push(a)}toBuffer(){let a=Buffer.allocUnsafe(this.length),b=0;for(let c of this.items){let d=Buffer.byteLength(c);Buffer.isBuffer(c)?c.copy(a,b):a.write(c,b,d),b+=d}return a}}},15121:(a,b,c)=>{"use strict";let d=c(12412);class e extends Error{get name(){return this.constructor.name}}class f extends e{constructor(a,b,c){d(b),d.strictEqual(typeof c,"number");let e=Error.stackTraceLimit;Error.stackTraceLimit=2,super(a),Error.stackTraceLimit=e,this.offset=c,this.buffer=b}get name(){return this.constructor.name}}class g extends e{constructor(a){let b=Error.stackTraceLimit;Error.stackTraceLimit=2,super(a),Error.stackTraceLimit=b}get name(){return this.constructor.name}}class h extends e{get name(){return this.constructor.name}}class i extends h{get name(){return this.constructor.name}}a.exports={RedisError:e,ParserError:f,ReplyError:g,AbortError:h,InterruptError:i}},15789:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.SentinelIterator=void 0;let d=c(91645),e=c(54187),f=c(34631),g=c(47824);b.SentinelIterator=g.default;let h=c(18797),i=c(88568),j=c(23142),k=(0,e.Debug)("SentinelConnector");class l extends h.default{constructor(a){if(super(a.disconnectTimeout),this.options=a,this.emitter=null,this.failoverDetector=null,!this.options.sentinels.length)throw Error("Requires at least one sentinel to connect to.");if(!this.options.name)throw Error("Requires the name of master.");this.sentinelIterator=new g.default(this.options.sentinels)}check(a){let b=!a.role||this.options.role===a.role;return b||(k("role invalid, expected %s, but got %s",this.options.role,a.role),this.sentinelIterator.next(),this.sentinelIterator.next(),this.sentinelIterator.reset(!0)),b}disconnect(){super.disconnect(),this.failoverDetector&&this.failoverDetector.cleanup()}connect(a){let b;this.connecting=!0,this.retryAttempts=0;let c=async()=>{let g=this.sentinelIterator.next();if(g.done){this.sentinelIterator.reset(!1);let d="function"==typeof this.options.sentinelRetryStrategy?this.options.sentinelRetryStrategy(++this.retryAttempts):null,e="number"!=typeof d?"All sentinels are unreachable and retry is disabled.":`All sentinels are unreachable. Retrying from scratch after ${d}ms.`;b&&(e+=` Last error: ${b.message}`),k(e);let f=Error(e);if("number"==typeof d)return a("error",f),await new Promise(a=>setTimeout(a,d)),c();throw f}let h=null,i=null;try{h=await this.resolve(g.value)}catch(a){i=a}if(!this.connecting)throw Error(e.CONNECTION_CLOSED_ERROR_MSG);let j=g.value.host+":"+g.value.port;if(h)return k("resolved: %s:%s from sentinel %s",h.host,h.port,j),this.options.enableTLSForSentinelMode&&this.options.tls?(Object.assign(h,this.options.tls),this.stream=(0,f.connect)(h),this.stream.once("secureConnect",this.initFailoverDetector.bind(this))):(this.stream=(0,d.createConnection)(h),this.stream.once("connect",this.initFailoverDetector.bind(this))),this.stream.once("error",a=>{this.firstError=a}),this.stream;{let d=i?"failed to connect to sentinel "+j+" because "+i.message:"connected to sentinel "+j+" successfully, but got an invalid reply: "+h;return k(d),a("sentinelError",Error(d)),i&&(b=i),c()}};return c()}async updateSentinels(a){if(!this.options.updateSentinels)return;let b=await a.sentinel("sentinels",this.options.name);Array.isArray(b)&&(b.map(e.packObject).forEach(a=>{if(-1===(a.flags?a.flags.split(","):[]).indexOf("disconnected")&&a.ip&&a.port){let b=this.sentinelNatResolve(m(a));this.sentinelIterator.add(b)&&k("adding sentinel %s:%s",b.host,b.port)}}),k("Updated internal sentinels: %s",this.sentinelIterator))}async resolveMaster(a){let b=await a.sentinel("get-master-addr-by-name",this.options.name);return await this.updateSentinels(a),this.sentinelNatResolve(Array.isArray(b)?{host:b[0],port:Number(b[1])}:null)}async resolveSlave(a){let b=await a.sentinel("slaves",this.options.name);if(!Array.isArray(b))return null;let c=b.map(e.packObject).filter(a=>a.flags&&!a.flags.match(/(disconnected|s_down|o_down)/));return this.sentinelNatResolve(function(a,b){let c;if(0===a.length)return null;if("function"==typeof b)c=b(a);else if(null!==b&&"object"==typeof b){let d=Array.isArray(b)?b:[b];d.sort((a,b)=>(a.prio||(a.prio=1),b.prio||(b.prio=1),a.prio<b.prio)?-1:+(a.prio>b.prio));for(let b=0;b<d.length;b++){for(let e=0;e<a.length;e++){let f=a[e];if(f.ip===d[b].ip&&f.port===d[b].port){c=f;break}}if(c)break}}return c||(c=(0,e.sample)(a)),m(c)}(c,this.options.preferredSlaves))}sentinelNatResolve(a){if(!a||!this.options.natMap)return a;let b=`${a.host}:${a.port}`,c=a;return"function"==typeof this.options.natMap?c=this.options.natMap(b)||a:"object"==typeof this.options.natMap&&(c=this.options.natMap[b]||a),c}connectToSentinel(a,b){return new i.default({port:a.port||26379,host:a.host,username:this.options.sentinelUsername||null,password:this.options.sentinelPassword||null,family:a.family||("path"in this.options&&this.options.path?void 0:this.options.family),tls:this.options.sentinelTLS,retryStrategy:null,enableReadyCheck:!1,connectTimeout:this.options.connectTimeout,commandTimeout:this.options.sentinelCommandTimeout,...b})}async resolve(a){let b=this.connectToSentinel(a);b.on("error",n);try{if("slave"===this.options.role)return await this.resolveSlave(b);return await this.resolveMaster(b)}finally{b.disconnect()}}async initFailoverDetector(){var a;if(!this.options.failoverDetector)return;this.sentinelIterator.reset(!0);let b=[];for(;b.length<this.options.sentinelMaxConnections;){let{done:a,value:c}=this.sentinelIterator.next();if(a)break;let d=this.connectToSentinel(c,{lazyConnect:!0,retryStrategy:this.options.sentinelReconnectStrategy});d.on("reconnecting",()=>{var a;null==(a=this.emitter)||a.emit("sentinelReconnecting")}),b.push({address:c,client:d})}this.sentinelIterator.reset(!1),this.failoverDetector&&this.failoverDetector.cleanup(),this.failoverDetector=new j.FailoverDetector(this,b),await this.failoverDetector.subscribe(),null==(a=this.emitter)||a.emit("failoverSubscribed")}}function m(a){return{host:a.ip,port:Number(a.port)}}function n(){}b.default=l},16688:(a,b,c)=>{"use strict";a.exports=c(63145)},17751:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});let d=c(54187),e=c(37970),f=c(91957),g=c(34103),h=(0,d.Debug)("cluster:subscriberGroup");class i{constructor(a){this.subscriberGroupEmitter=a,this.shardedSubscribers=new Map,this.clusterSlots=[],this.subscriberToSlotsIndex=new Map,this.channels=new Map,this.failedAttemptsByNode=new Map,this.isResetting=!1,this.pendingReset=null,this.handleSubscriberConnectFailed=(a,b)=>{let c=(this.failedAttemptsByNode.get(b)||0)+1;this.failedAttemptsByNode.set(b,c);let d=Math.min(c,i.MAX_RETRY_ATTEMPTS),e=Math.min(i.BASE_BACKOFF_MS*2**d,i.MAX_BACKOFF_MS),f=Math.floor(.5*e*(Math.random()-.5)),g=Math.max(0,e+f);h("Failed to connect subscriber for %s. Refreshing slots in %dms",b,g),this.subscriberGroupEmitter.emit("subscriberConnectFailed",{delay:g,error:a})},this.handleSubscriberConnectSucceeded=a=>{this.failedAttemptsByNode.delete(a)}}getResponsibleSubscriber(a){let b=this.clusterSlots[a][0];return this.shardedSubscribers.get(b)}addChannels(a){let b=f(a[0]);for(let c of a)if(f(c)!==b)return -1;let c=this.channels.get(b);return c?this.channels.set(b,c.concat(a)):this.channels.set(b,a),Array.from(this.channels.values()).reduce((a,b)=>a+b.length,0)}removeChannels(a){let b=f(a[0]);for(let c of a)if(f(c)!==b)return -1;let c=this.channels.get(b);if(c){let d=c.filter(b=>!a.includes(b));this.channels.set(b,d)}return Array.from(this.channels.values()).reduce((a,b)=>a+b.length,0)}stop(){for(let a of this.shardedSubscribers.values())a.stop();this.pendingReset=null,this.shardedSubscribers.clear(),this.subscriberToSlotsIndex.clear()}start(){let a=[];for(let b of this.shardedSubscribers.values())b.isStarted()||a.push(b.start().then(()=>{this.handleSubscriberConnectSucceeded(b.getNodeKey())}).catch(a=>{this.handleSubscriberConnectFailed(a,b.getNodeKey())}));return Promise.all(a)}async reset(a,b){if(this.isResetting){this.pendingReset={slots:a,nodes:b};return}this.isResetting=!0;try{let c=this._refreshSlots(a),d=this.hasUnhealthySubscribers();if(!c&&!d)return void h("No topology change detected or failed subscribers. Skipping reset.");for(let[a,b]of this.shardedSubscribers){if(this.subscriberToSlotsIndex.has(a)&&b.isStarted()){h("Skipping deleting subscriber for %s",a);continue}h("Removing subscriber for %s",a),b.stop(),this.shardedSubscribers.delete(a),this.subscriberGroupEmitter.emit("-subscriber")}let f=[];for(let[a,c]of this.subscriberToSlotsIndex){if(this.shardedSubscribers.has(a)){h("Skipping creating new subscriber for %s",a);continue}h("Creating new subscriber for %s",a);let c=b.find(b=>(0,e.getNodeKey)(b.options)===a);if(!c){h("Failed to find node for key %s",a);continue}let d=new g.default(this.subscriberGroupEmitter,c.options);this.shardedSubscribers.set(a,d),f.push(d.start().then(()=>{this.handleSubscriberConnectSucceeded(a)}).catch(b=>{this.handleSubscriberConnectFailed(b,a)})),this.subscriberGroupEmitter.emit("+subscriber")}await Promise.all(f),this._resubscribe(),this.subscriberGroupEmitter.emit("subscribersReady")}finally{if(this.isResetting=!1,this.pendingReset){let{slots:a,nodes:b}=this.pendingReset;this.pendingReset=null,await this.reset(a,b)}}}_refreshSlots(a){if(this._slotsAreEqual(a))return h("Nothing to refresh because the new cluster map is equal to the previous one."),!1;h("Refreshing the slots of the subscriber group."),this.subscriberToSlotsIndex=new Map;for(let b=0;b<a.length;b++){let c=a[b][0];this.subscriberToSlotsIndex.has(c)||this.subscriberToSlotsIndex.set(c,[]),this.subscriberToSlotsIndex.get(c).push(Number(b))}return this.clusterSlots=JSON.parse(JSON.stringify(a)),!0}_resubscribe(){this.shardedSubscribers&&this.shardedSubscribers.forEach((a,b)=>{let c=this.subscriberToSlotsIndex.get(b);c&&c.forEach(c=>{let d=a.getInstance(),e=this.channels.get(c);if(e&&e.length>0){if("end"===d.status)return;"ready"===d.status?d.ssubscribe(...e).catch(a=>{h("Failed to ssubscribe on node %s: %s",b,a)}):d.once("ready",()=>{d.ssubscribe(...e).catch(a=>{h("Failed to ssubscribe on node %s: %s",b,a)})})}})})}_slotsAreEqual(a){return void 0!==this.clusterSlots&&JSON.stringify(this.clusterSlots)===JSON.stringify(a)}hasUnhealthySubscribers(){let a=Array.from(this.shardedSubscribers.values()).some(a=>!a.isStarted()),b=Array.from(this.subscriberToSlotsIndex.keys()).some(a=>!this.shardedSubscribers.has(a));return a||b}}b.default=i,i.MAX_RETRY_ATTEMPTS=10,i.MAX_BACKOFF_MS=2e3,i.BASE_BACKOFF_MS=100},18797:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});let d=(0,c(54187).Debug)("AbstractConnector");class e{constructor(a){this.connecting=!1,this.disconnectTimeout=a}check(a){return!0}disconnect(){if(this.connecting=!1,this.stream){let a=this.stream,b=setTimeout(()=>{d("stream %s:%s still open, destroying it",a.remoteAddress,a.remotePort),a.destroy()},this.disconnectTimeout);a.on("close",()=>clearTimeout(b)),a.end()}}}b.default=e},19140:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});let d=c(54187),e=c(73380),f=(0,d.Debug)("delayqueue");class g{constructor(){this.queues={},this.timeouts={}}push(a,b,c){let d=c.callback||process.nextTick;this.queues[a]||(this.queues[a]=new e),this.queues[a].push(b),this.timeouts[a]||(this.timeouts[a]=setTimeout(()=>{d(()=>{this.timeouts[a]=null,this.execute(a)})},c.timeout))}execute(a){let b=this.queues[a];if(!b)return;let{length:c}=b;if(c)for(f("send %d commands in %s queue",c,a),this.queues[a]=null;b.length>0;)b.shift()()}}b.default=g},19283:(a,b,c)=>{b.formatArgs=function(b){if(b[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+b[0]+(this.useColors?"%c ":" ")+"+"+a.exports.humanize(this.diff),!this.useColors)return;let c="color: "+this.color;b.splice(1,0,c,"color: inherit");let d=0,e=0;b[0].replace(/%[a-zA-Z%]/g,a=>{"%%"!==a&&(d++,"%c"===a&&(e=d))}),b.splice(e,0,c)},b.save=function(a){try{a?b.storage.setItem("debug",a):b.storage.removeItem("debug")}catch(a){}},b.load=function(){let a;try{a=b.storage.getItem("debug")||b.storage.getItem("DEBUG")}catch(a){}return!a&&"undefined"!=typeof process&&"env"in process&&(a=process.env.DEBUG),a},b.useColors=function(){let a;return"undefined"!=typeof window&&!!window.process&&("renderer"===window.process.type||!!window.process.__nwjs)||!("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(a=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(a[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},b.storage=function(){try{return localStorage}catch(a){}}(),b.destroy=(()=>{let a=!1;return()=>{a||(a=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),b.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],b.log=console.debug||console.log||(()=>{}),a.exports=c(950)(b);let{formatters:d}=a.exports;d.j=function(a){try{return JSON.stringify(a)}catch(a){return"[UnexpectedJSONParseError]: "+a.message}}},20354:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.DEFAULT_CLUSTER_OPTIONS=void 0;let d=c(14985);b.DEFAULT_CLUSTER_OPTIONS={clusterRetryStrategy:a=>Math.min(100+2*a,2e3),enableOfflineQueue:!0,enableReadyCheck:!0,scaleReads:"master",maxRedirections:16,retryDelayOnMoved:0,retryDelayOnFailover:100,retryDelayOnClusterDown:100,retryDelayOnTryAgain:100,slotsRefreshTimeout:1e3,useSRVRecords:!1,resolveSrv:d.resolveSrv,dnsLookup:d.lookup,enableAutoPipelining:!1,autoPipeliningIgnoredCommands:[],shardedSubscribers:!1}},22009:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.SentinelConnector=b.StandaloneConnector=void 0,b.StandaloneConnector=c(3820).default,b.SentinelConnector=c(15789).default},22618:(a,b,c)=>{"use strict";let d,e=c(21820),f=c(83997),g=c(47823),{env:h}=process;function i(a){return 0!==a&&{level:a,hasBasic:!0,has256:a>=2,has16m:a>=3}}function j(a,b){if(0===d)return 0;if(g("color=16m")||g("color=full")||g("color=truecolor"))return 3;if(g("color=256"))return 2;if(a&&!b&&void 0===d)return 0;let c=d||0;if("dumb"===h.TERM)return c;if("win32"===process.platform){let a=e.release().split(".");return Number(a[0])>=10&&Number(a[2])>=10586?Number(a[2])>=14931?3:2:1}if("CI"in h)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(a=>a in h)||"codeship"===h.CI_NAME?1:c;if("TEAMCITY_VERSION"in h)return+!!/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(h.TEAMCITY_VERSION);if("truecolor"===h.COLORTERM)return 3;if("TERM_PROGRAM"in h){let a=parseInt((h.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(h.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(h.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(h.TERM)||"COLORTERM"in h?1:c}g("no-color")||g("no-colors")||g("color=false")||g("color=never")?d=0:(g("color")||g("colors")||g("color=true")||g("color=always"))&&(d=1),"FORCE_COLOR"in h&&(d="true"===h.FORCE_COLOR?1:"false"===h.FORCE_COLOR?0:0===h.FORCE_COLOR.length?1:Math.min(parseInt(h.FORCE_COLOR,10),3)),a.exports={supportsColor:function(a){return i(j(a,a&&a.isTTY))},stdout:i(j(!0,f.isatty(1))),stderr:i(j(!0,f.isatty(2)))}},23142:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.FailoverDetector=void 0;let d=(0,c(54187).Debug)("FailoverDetector"),e="+switch-master";class f{constructor(a,b){this.isDisconnected=!1,this.connector=a,this.sentinels=b}cleanup(){for(let a of(this.isDisconnected=!0,this.sentinels))a.client.disconnect()}async subscribe(){d("Starting FailoverDetector");let a=[];for(let b of this.sentinels){let c=b.client.subscribe(e).catch(a=>{d("Failed to subscribe to failover messages on sentinel %s:%s (%s)",b.address.host||"127.0.0.1",b.address.port||26739,a.message)});a.push(c),b.client.on("message",a=>{this.isDisconnected||a!==e||this.disconnect()})}await Promise.all(a)}disconnect(){this.isDisconnected=!0,d("Failover detected, disconnecting"),this.connector.disconnect()}}b.FailoverDetector=f},23865:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});let d=c(14642),e=c(54187),f=c(16688),g=c(43504),h=(0,e.Debug)("dataHandler");class i{constructor(a,b){this.redis=a;let c=new f({stringNumbers:b.stringNumbers,returnBuffers:!0,returnError:a=>{this.returnError(a)},returnFatalError:a=>{this.returnFatalError(a)},returnReply:a=>{this.returnReply(a)}});a.stream.prependListener("data",a=>{c.execute(a)}),a.stream.resume()}returnFatalError(a){a.message+=". Please report this.",this.redis.recoverFromFatalError(a,a,{offlineQueue:!1})}returnError(a){let b=this.shiftCommand(a);if(b){if(a.command={name:b.command.name,args:b.command.args},"ssubscribe"==b.command.name&&a.message.includes("MOVED"))return void this.redis.emit("moved");this.redis.handleReconnection(a,b)}}returnReply(a){if(this.handleMonitorReply(a)||this.handleSubscriberReply(a))return;let b=this.shiftCommand(a);b&&(d.default.checkFlag("ENTER_SUBSCRIBER_MODE",b.command.name)?(this.redis.condition.subscriber=new g.default,this.redis.condition.subscriber.add(b.command.name,a[1].toString()),k(b.command,a[2])||this.redis.commandQueue.unshift(b)):d.default.checkFlag("EXIT_SUBSCRIBER_MODE",b.command.name)?l(b.command,a[2])||this.redis.commandQueue.unshift(b):b.command.resolve(a))}handleSubscriberReply(a){if(!this.redis.condition.subscriber)return!1;let b=Array.isArray(a)?a[0].toString():null;switch(h('receive reply "%s" in subscriber mode',b),b){case"message":this.redis.listeners("message").length>0&&this.redis.emit("message",a[1].toString(),a[2]?a[2].toString():""),this.redis.emit("messageBuffer",a[1],a[2]);break;case"pmessage":{let b=a[1].toString();this.redis.listeners("pmessage").length>0&&this.redis.emit("pmessage",b,a[2].toString(),a[3].toString()),this.redis.emit("pmessageBuffer",b,a[2],a[3]);break}case"smessage":this.redis.listeners("smessage").length>0&&this.redis.emit("smessage",a[1].toString(),a[2]?a[2].toString():""),this.redis.emit("smessageBuffer",a[1],a[2]);break;case"ssubscribe":case"subscribe":case"psubscribe":{let c=a[1].toString();this.redis.condition.subscriber.add(b,c);let d=this.shiftCommand(a);if(!d)return;k(d.command,a[2])||this.redis.commandQueue.unshift(d);break}case"sunsubscribe":case"unsubscribe":case"punsubscribe":{let c=a[1]?a[1].toString():null;c&&this.redis.condition.subscriber.del(b,c);let d=a[2];0===Number(d)&&(this.redis.condition.subscriber=!1);let e=this.shiftCommand(a);if(!e)return;l(e.command,d)||this.redis.commandQueue.unshift(e);break}default:{let b=this.shiftCommand(a);if(!b)return;b.command.resolve(a)}}return!0}handleMonitorReply(a){if("monitoring"!==this.redis.status)return!1;let b=a.toString();if("OK"===b)return!1;let c=b.indexOf(" "),d=b.slice(0,c),e=b.indexOf('"'),f=b.slice(e+1,-1).split('" "').map(a=>a.replace(/\\"/g,'"')),g=b.slice(c+2,e-2).split(" ");return this.redis.emit("monitor",d,f,g[1],g[0]),!0}shiftCommand(a){let b=this.redis.commandQueue.shift();if(!b){let b=Error("Command queue state error. If you can reproduce this, please report it."+(a instanceof Error?` Last error: ${a.message}`:` Last reply: ${a.toString()}`));return this.redis.emit("error",b),null}return b}}b.default=i;let j=new WeakMap;function k(a,b){let c=j.has(a)?j.get(a):a.args.length;return(c-=1)<=0?(a.resolve(b),j.delete(a),!0):(j.set(a,c),!1)}function l(a,b){let c=j.has(a)?j.get(a):a.args.length;return 0===c?0===Number(b)&&(j.delete(a),a.resolve(b),!0):(c-=1)<=0?(a.resolve(b),!0):(j.set(a,c),!1)}},24281:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.addTransactionSupport=void 0;let d=c(54187),e=c(881),f=c(82161);b.addTransactionSupport=function(a){a.pipeline=function(a){let b=new f.default(this);return Array.isArray(a)&&b.addBatch(a),b};let{multi:b}=a;a.multi=function(a,c){if(void 0!==c||Array.isArray(a)||(c=a,a=null),c&&!1===c.pipeline)return b.call(this);let g=new f.default(this);g.multi(),Array.isArray(a)&&g.addBatch(a);let h=g.exec;g.exec=function(a){if(this.isCluster&&!this.redis.slots.length)return"wait"===this.redis.status&&this.redis.connect().catch(d.noop),(0,e.default)(new Promise((a,b)=>{this.redis.delayUntilReady(c=>{if(c)return void b(c);this.exec(g).then(a,b)})}),a);if(this._transactions>0&&h.call(g),this.nodeifiedPromise)return h.call(g);let b=h.call(g);return(0,e.default)(b.then(function(a){let b=a[a.length-1];if(void 0===b)throw Error("Pipeline cannot be used to send any commands when the `exec()` has been called on it.");if(b[0]){b[0].previousErrors=[];for(let c=0;c<a.length-1;++c)a[c][0]&&b[0].previousErrors.push(a[c][0]);throw b[0]}return(0,d.wrapMultiResult)(b[1])}),a)};let{execBuffer:i}=g;return g.execBuffer=function(a){return this._transactions>0&&i.call(g),g.exec(a)},g};let{exec:c}=a;a.exec=function(a){return(0,e.default)(c.call(this).then(function(a){return Array.isArray(a)&&(a=(0,d.wrapMultiResult)(a)),a}),a)}}},27509:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.executeWithAutoPipelining=b.getFirstValueInFlattenedArray=b.shouldUseAutoPipelining=b.notAllowedAutoPipelineCommands=b.kCallbacks=b.kExec=void 0;let d=c(77318),e=c(91957),f=c(881),g=c(9666);function h(a){for(let b=0;b<a.length;b++){let c=a[b];if("string"==typeof c)return c;if(Array.isArray(c)||(0,d.isArguments)(c)){if(0===c.length)continue;return c[0]}let e=[c].flat();if(e.length>0)return e[0]}}b.kExec=Symbol("exec"),b.kCallbacks=Symbol("callbacks"),b.notAllowedAutoPipelineCommands=["auth","info","script","quit","cluster","pipeline","multi","subscribe","psubscribe","unsubscribe","unpsubscribe","select","client"],b.shouldUseAutoPipelining=function(a,c,d){return c&&a.options.enableAutoPipelining&&!a.isPipeline&&!b.notAllowedAutoPipelineCommands.includes(d)&&!a.options.autoPipeliningIgnoredCommands.includes(d)},b.getFirstValueInFlattenedArray=h,b.executeWithAutoPipelining=function a(c,i,j,k,l){if(c.isCluster&&!c.slots.length)return"wait"===c.status&&c.connect().catch(d.noop),(0,f.default)(new Promise(function(b,d){c.delayUntilReady(e=>{if(e)return void d(e);a(c,i,j,k,null).then(b,d)})}),l);let m=c.options.keyPrefix||"",n=c.isCluster?c.slots[e(`${m}${h(k)}`)].join(","):"main";if(c.isCluster&&"master"!==c.options.scaleReads&&(n+=(0,g.exists)(j)&&(0,g.hasFlag)(j,"readonly")?":read":":write"),!c._autoPipelines.has(n)){let a=c.pipeline();a[b.kExec]=!1,a[b.kCallbacks]=[],c._autoPipelines.set(n,a)}let o=c._autoPipelines.get(n);o[b.kExec]||(o[b.kExec]=!0,setImmediate(function a(c,d){if(c._runningAutoPipelines.has(d)||!c._autoPipelines.has(d))return;c._runningAutoPipelines.add(d);let e=c._autoPipelines.get(d);c._autoPipelines.delete(d);let f=e[b.kCallbacks];e[b.kCallbacks]=null,e.exec(function(b,e){if(c._runningAutoPipelines.delete(d),b)for(let a=0;a<f.length;a++)process.nextTick(f[a],b);else for(let a=0;a<f.length;a++)process.nextTick(f[a],...e[a]);c._autoPipelines.has(d)&&a(c,d)})},c,n));let p=new Promise(function(a,c){o[b.kCallbacks].push(function(b,d){if(b)return void c(b);a(d)}),"call"===i&&k.unshift(j),o[i](...k)});return(0,f.default)(p,l)}},29229:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.print=b.ReplyError=b.SentinelIterator=b.SentinelConnector=b.AbstractConnector=b.Pipeline=b.ScanStream=b.Command=b.Cluster=b.Redis=b.default=void 0,b=a.exports=c(88568).default;var d=c(88568);Object.defineProperty(b,"default",{enumerable:!0,get:function(){return d.default}});var e=c(88568);Object.defineProperty(b,"Redis",{enumerable:!0,get:function(){return e.default}});var f=c(55058);Object.defineProperty(b,"Cluster",{enumerable:!0,get:function(){return f.default}});var g=c(14642);Object.defineProperty(b,"Command",{enumerable:!0,get:function(){return g.default}});var h=c(30644);Object.defineProperty(b,"ScanStream",{enumerable:!0,get:function(){return h.default}});var i=c(82161);Object.defineProperty(b,"Pipeline",{enumerable:!0,get:function(){return i.default}});var j=c(18797);Object.defineProperty(b,"AbstractConnector",{enumerable:!0,get:function(){return j.default}});var k=c(15789);Object.defineProperty(b,"SentinelConnector",{enumerable:!0,get:function(){return k.default}}),Object.defineProperty(b,"SentinelIterator",{enumerable:!0,get:function(){return k.SentinelIterator}}),b.ReplyError=c(44400).ReplyError,Object.defineProperty(b,"Promise",{get:()=>(console.warn("ioredis v5 does not support plugging third-party Promise library anymore. Native Promise will be used."),Promise),set(a){console.warn("ioredis v5 does not support plugging third-party Promise library anymore. Native Promise will be used.")}}),b.print=function(a,b){a?console.log("Error: "+a):console.log("Reply: "+b)}},30577:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});let d=c(44400);class e extends d.RedisError{constructor(a,b){super(a),this.lastNodeError=b,Error.captureStackTrace(this,this.constructor)}get name(){return this.constructor.name}}b.default=e,e.defaultMessage="Failed to refresh slots cache."},30644:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});let d=c(27910);class e extends d.Readable{constructor(a){super(a),this.opt=a,this._redisCursor="0",this._redisDrained=!1}_read(){if(this._redisDrained)return void this.push(null);let a=[this._redisCursor];this.opt.key&&a.unshift(this.opt.key),this.opt.match&&a.push("MATCH",this.opt.match),this.opt.type&&a.push("TYPE",this.opt.type),this.opt.count&&a.push("COUNT",String(this.opt.count)),this.opt.noValues&&a.push("NOVALUES"),this.opt.redis[this.opt.command](a,(a,b)=>{if(a)return void this.emit("error",a);this._redisCursor=b[0]instanceof Buffer?b[0].toString():b[0],"0"===this._redisCursor&&(this._redisDrained=!0),this.push(b[1])})}close(){this._redisDrained=!0}}b.default=e},32011:a=>{function b(a,b,c,d){return Math.round(a/c)+" "+d+(b>=1.5*c?"s":"")}a.exports=function(a,c){c=c||{};var d,e,f,g,h=typeof a;if("string"===h&&a.length>0){var i=a;if(!((i=String(i)).length>100)){var j=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(j){var k=parseFloat(j[1]);switch((j[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*k;case"weeks":case"week":case"w":return 6048e5*k;case"days":case"day":case"d":return 864e5*k;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*k;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*k;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*k;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return k;default:break}}}return}if("number"===h&&isFinite(a)){return c.long?(e=Math.abs(d=a))>=864e5?b(d,e,864e5,"day"):e>=36e5?b(d,e,36e5,"hour"):e>=6e4?b(d,e,6e4,"minute"):e>=1e3?b(d,e,1e3,"second"):d+" ms":(g=Math.abs(f=a))>=864e5?Math.round(f/864e5)+"d":g>=36e5?Math.round(f/36e5)+"h":g>=6e4?Math.round(f/6e4)+"m":g>=1e3?Math.round(f/1e3)+"s":f+"ms"}throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(a))}},34103:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});let d=c(37970),e=c(54187),f=c(88568),g=(0,e.Debug)("cluster:subscriberGroup:shardedSubscriber");class h{constructor(a,b){for(let c of(this.emitter=a,this.started=!1,this.instance=null,this.messageListeners=new Map,this.onEnd=()=>{this.started=!1,this.emitter.emit("-node",this.instance,this.nodeKey)},this.onError=a=>{this.emitter.emit("nodeError",a,this.nodeKey)},this.onMoved=()=>{this.emitter.emit("moved")},this.instance=new f.default({port:b.port,host:b.host,username:b.username,password:b.password,enableReadyCheck:!1,offlineQueue:!0,connectionName:(0,d.getConnectionName)("ssubscriber",b.connectionName),lazyConnect:!0,tls:b.tls,retryStrategy:null}),this.nodeKey=(0,d.getNodeKey)(b),this.instance.once("end",this.onEnd),this.instance.on("error",this.onError),this.instance.on("moved",this.onMoved),["smessage","smessageBuffer"])){let a=(...a)=>{this.emitter.emit(c,...a)};this.messageListeners.set(c,a),this.instance.on(c,a)}}async start(){if(this.started)return void g("already started %s",this.nodeKey);try{await this.instance.connect(),g("started %s",this.nodeKey),this.started=!0}catch(a){throw g("failed to start %s: %s",this.nodeKey,a),this.started=!1,a}}stop(){this.started=!1,this.instance&&(this.instance.disconnect(),this.instance.removeAllListeners(),this.messageListeners.clear(),this.instance=null),g("stopped %s",this.nodeKey)}isStarted(){return this.started}getInstance(){return this.instance}getNodeKey(){return this.nodeKey}}b.default=h},37422:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{z:()=>q});var e=c(97494),f=c(80037),g=c(64939),h=c(37614),i=a([g,f]);[g,f]=i.then?(await i)():i;let j=process.env.DATABASE_URL||(process.env.DB_HOST?`postgresql://${process.env.DB_USERNAME}:${encodeURIComponent(process.env.DB_PASSWORD||"")}@${process.env.DB_HOST}:${process.env.DB_PORT||"5432"}/${process.env.DB_NAME||"chorus"}`:void 0),k=globalThis,l=k.pool??new g.default.Pool({connectionString:j,...process.env.DB_HOST?{ssl:{rejectUnauthorized:!1}}:{}});k.pool||l.on("error",a=>{h.A.child({module:"pg-pool"}).warn({err:a.message},"Idle connection evicted")});let m=new f.M(l),n=h.A.child({module:"prisma"}),o=k.prisma??new e.m3({adapter:m,log:[{emit:"event",level:"error"}]}),p=h.A.child({module:"pg-pool"}),q=o.$extends({query:{async $allOperations({args:a,query:b}){let c;for(let d=0;d<=3;d++)try{return await b(a)}catch(a){if(a instanceof Error&&("code"in a&&"P1017"===a.code||a.message.includes("Connection terminated")||a.message.includes("Server has closed the connection"))&&d<3){p.warn("Stale connection evicted (attempt %d/%d)",d+1,3),c=a;continue}throw a}throw c}}});k.prisma||"function"!=typeof o.$on||(o.$on("query",a=>{n.debug({duration:a.duration},a.query)}),o.$on("warn",a=>{n.warn(a.message)}),o.$on("error",a=>{n.error(a.message)})),d()}catch(a){d(a)}})},37614:(a,b,c)=>{"use strict";c.d(b,{A:()=>e});var d=c(74552);let e=c.n(d)()({level:process.env.LOG_LEVEL||"info",base:{service:"chorus"},...{}})},37970:(a,b,c)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0}),b.getConnectionName=b.weightSrvRecords=b.groupSrvRecords=b.getUniqueHostnamesFromOptions=b.normalizeNodeOptions=b.nodeKeyToRedisOptions=b.getNodeKey=void 0;let d=c(54187),e=c(91645);b.getNodeKey=function(a){return a.port=a.port||6379,a.host=a.host||"127.0.0.1",a.host+":"+a.port},b.nodeKeyToRedisOptions=function(a){let b=a.lastIndexOf(":");if(-1===b)throw Error(`Invalid node key ${a}`);return{host:a.slice(0,b),port:Number(a.slice(b+1))}},b.normalizeNodeOptions=function(a){return a.map(a=>{let b={};if("object"==typeof a)Object.assign(b,a);else if("string"==typeof a)Object.assign(b,(0,d.parseURL)(a));else if("number"==typeof a)b.port=a;else throw Error("Invalid argument "+a);return"string"==typeof b.port&&(b.port=parseInt(b.port,10)),delete b.db,b.port||(b.port=6379),b.host||(b.host="127.0.0.1"),(0,d.resolveTLSProfile)(b)})},b.getUniqueHostnamesFromOptions=function(a){let b={};return a.forEach(a=>{b[a.host]=!0}),Object.keys(b).filter(a=>!(0,e.isIP)(a))},b.groupSrvRecords=function(a){let b={};for(let c of a)b.hasOwnProperty(c.priority)?(b[c.priority].totalWeight+=c.weight,b[c.priority].records.push(c)):b[c.priority]={totalWeight:c.weight,records:[c]};return b},b.weightSrvRecords=function(a){if(1===a.records.length)return a.totalWeight=0,a.records.shift();let b=Math.floor(Math.random()*(a.totalWeight+a.records.length)),c=0;for(let[d,e]of a.records.entries())if((c+=1+e.weight)>b)return a.totalWeight-=e.weight,a.records.splice(d,1),e},b.getConnectionName=function(a,b){let c=`ioredis-cluster(${a})`;return b?`${c}:${b}`:c}},38002:(a,b)=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});let c=`-----BEGIN CERTIFICATE-----
2
2
  MIIDTzCCAjegAwIBAgIJAKSVpiDswLcwMA0GCSqGSIb3DQEBBQUAMD4xFjAUBgNV
3
3
  BAoMDUdhcmFudGlhIERhdGExJDAiBgNVBAMMG1NTTCBDZXJ0aWZpY2F0aW9uIEF1
4
4
  dGhvcml0eTAeFw0xMzEwMDExMjE0NTVaFw0yMzA5MjkxMjE0NTVaMD4xFjAUBgNV