tokentracker-cli 0.5.1 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1111) hide show
  1. package/README.md +3 -0
  2. package/dashboard/dist/assets/DashboardPage-ccDq1oTb.js +12 -0
  3. package/dashboard/dist/assets/LeaderboardPage-BvhBcafd.js +1 -0
  4. package/dashboard/dist/assets/LeaderboardProfilePage-B5Yw_BZM.js +1 -0
  5. package/dashboard/dist/assets/ThemeToggle-CQvh_d2Z.js +1 -0
  6. package/dashboard/dist/assets/leaderboard-columns-COq9DxPJ.js +1 -0
  7. package/dashboard/dist/assets/main-8JBJiGVQ.js +4759 -0
  8. package/dashboard/dist/assets/main-Cwn9_aQV.css +1 -0
  9. package/dashboard/dist/brand-logos/claude-code.svg +3 -0
  10. package/dashboard/dist/brand-logos/codex.svg +3 -0
  11. package/dashboard/dist/brand-logos/cursor.svg +3 -0
  12. package/dashboard/dist/brand-logos/gemini.svg +20 -0
  13. package/dashboard/dist/brand-logos/openclaw.svg +22 -0
  14. package/dashboard/dist/brand-logos/opencode.svg +3 -0
  15. package/dashboard/dist/dashboard-dark.png +0 -0
  16. package/dashboard/dist/feed.xml +7 -7
  17. package/dashboard/dist/index.html +5 -5
  18. package/dashboard/dist/llms.txt +13 -13
  19. package/dashboard/dist/robots.txt +3 -3
  20. package/dashboard/dist/share.html +2 -2
  21. package/dashboard/dist/sitemap.xml +2 -2
  22. package/package.json +3 -12
  23. package/src/commands/init.js +8 -95
  24. package/src/commands/serve.js +1 -1
  25. package/src/commands/sync.js +106 -153
  26. package/src/lib/activation-check.js +21 -21
  27. package/src/lib/browser-auth.js +1 -1
  28. package/src/lib/doctor.js +0 -13
  29. package/src/lib/gemini-config.js +1 -1
  30. package/src/lib/local-api.js +94 -12
  31. package/src/lib/openclaw-hook.js +8 -8
  32. package/src/lib/openclaw-session-plugin.js +7 -7
  33. package/src/lib/opencode-config.js +1 -1
  34. package/src/lib/opencode-usage-audit.js +1 -1
  35. package/src/lib/rollout.js +9 -15
  36. package/src/lib/runtime-config.js +1 -11
  37. package/dashboard/dist/assets/DashboardPage-CExFMoW6.js +0 -20
  38. package/dashboard/dist/assets/LandingExtras-xTxVZkGw.js +0 -1
  39. package/dashboard/dist/assets/LeaderboardPage-OsAoNAEz.js +0 -1
  40. package/dashboard/dist/assets/LeaderboardProfilePage-DK2OUyhv.js +0 -1
  41. package/dashboard/dist/assets/MatrixRain-C71qNSYx.js +0 -1
  42. package/dashboard/dist/assets/MatrixShell-DVXCuT--.js +0 -1
  43. package/dashboard/dist/assets/main-B_NbZucu.css +0 -1
  44. package/dashboard/dist/assets/main-DBkuzJr4.js +0 -2058
  45. package/dashboard/dist/assets/vibeusage-api-93ghbEE8.js +0 -1
  46. package/dashboard/dist/icon.svg +0 -1
  47. package/dashboard/dist/landing-dashboard.jpg +0 -0
  48. package/dashboard/dist/og-image.jpg +0 -0
  49. package/dashboard/dist/share-dashboard.jpg +0 -0
  50. package/dashboard/dist/social-preview.png +0 -0
  51. package/dashboard/dist/wrapped-2025.png +0 -0
  52. package/node_modules/@insforge/sdk/LICENSE +0 -201
  53. package/node_modules/@insforge/sdk/README.md +0 -259
  54. package/node_modules/@insforge/sdk/dist/index.d.mts +0 -854
  55. package/node_modules/@insforge/sdk/dist/index.d.ts +0 -854
  56. package/node_modules/@insforge/sdk/dist/index.js +0 -1823
  57. package/node_modules/@insforge/sdk/dist/index.js.map +0 -1
  58. package/node_modules/@insforge/sdk/dist/index.mjs +0 -1784
  59. package/node_modules/@insforge/sdk/dist/index.mjs.map +0 -1
  60. package/node_modules/@insforge/sdk/package.json +0 -68
  61. package/node_modules/@insforge/shared-schemas/dist/ai-api.schema.d.ts +0 -583
  62. package/node_modules/@insforge/shared-schemas/dist/ai-api.schema.d.ts.map +0 -1
  63. package/node_modules/@insforge/shared-schemas/dist/ai-api.schema.js +0 -111
  64. package/node_modules/@insforge/shared-schemas/dist/ai-api.schema.js.map +0 -1
  65. package/node_modules/@insforge/shared-schemas/dist/ai.schema.d.ts +0 -188
  66. package/node_modules/@insforge/shared-schemas/dist/ai.schema.d.ts.map +0 -1
  67. package/node_modules/@insforge/shared-schemas/dist/ai.schema.js +0 -48
  68. package/node_modules/@insforge/shared-schemas/dist/ai.schema.js.map +0 -1
  69. package/node_modules/@insforge/shared-schemas/dist/auth-api.schema.d.ts +0 -1127
  70. package/node_modules/@insforge/shared-schemas/dist/auth-api.schema.d.ts.map +0 -1
  71. package/node_modules/@insforge/shared-schemas/dist/auth-api.schema.js +0 -277
  72. package/node_modules/@insforge/shared-schemas/dist/auth-api.schema.js.map +0 -1
  73. package/node_modules/@insforge/shared-schemas/dist/auth.schema.d.ts +0 -187
  74. package/node_modules/@insforge/shared-schemas/dist/auth.schema.d.ts.map +0 -1
  75. package/node_modules/@insforge/shared-schemas/dist/auth.schema.js +0 -105
  76. package/node_modules/@insforge/shared-schemas/dist/auth.schema.js.map +0 -1
  77. package/node_modules/@insforge/shared-schemas/dist/cloud-events.schema.d.ts +0 -144
  78. package/node_modules/@insforge/shared-schemas/dist/cloud-events.schema.d.ts.map +0 -1
  79. package/node_modules/@insforge/shared-schemas/dist/cloud-events.schema.js +0 -41
  80. package/node_modules/@insforge/shared-schemas/dist/cloud-events.schema.js.map +0 -1
  81. package/node_modules/@insforge/shared-schemas/dist/database-api.schema.d.ts +0 -1627
  82. package/node_modules/@insforge/shared-schemas/dist/database-api.schema.d.ts.map +0 -1
  83. package/node_modules/@insforge/shared-schemas/dist/database-api.schema.js +0 -209
  84. package/node_modules/@insforge/shared-schemas/dist/database-api.schema.js.map +0 -1
  85. package/node_modules/@insforge/shared-schemas/dist/database.schema.d.ts +0 -263
  86. package/node_modules/@insforge/shared-schemas/dist/database.schema.d.ts.map +0 -1
  87. package/node_modules/@insforge/shared-schemas/dist/database.schema.js +0 -89
  88. package/node_modules/@insforge/shared-schemas/dist/database.schema.js.map +0 -1
  89. package/node_modules/@insforge/shared-schemas/dist/docs.schema.d.ts +0 -4
  90. package/node_modules/@insforge/shared-schemas/dist/docs.schema.d.ts.map +0 -1
  91. package/node_modules/@insforge/shared-schemas/dist/docs.schema.js +0 -22
  92. package/node_modules/@insforge/shared-schemas/dist/docs.schema.js.map +0 -1
  93. package/node_modules/@insforge/shared-schemas/dist/email-api.schema.d.ts +0 -34
  94. package/node_modules/@insforge/shared-schemas/dist/email-api.schema.d.ts.map +0 -1
  95. package/node_modules/@insforge/shared-schemas/dist/email-api.schema.js +0 -24
  96. package/node_modules/@insforge/shared-schemas/dist/email-api.schema.js.map +0 -1
  97. package/node_modules/@insforge/shared-schemas/dist/functions-api.schema.d.ts +0 -39
  98. package/node_modules/@insforge/shared-schemas/dist/functions-api.schema.d.ts.map +0 -1
  99. package/node_modules/@insforge/shared-schemas/dist/functions-api.schema.js +0 -18
  100. package/node_modules/@insforge/shared-schemas/dist/functions-api.schema.js.map +0 -1
  101. package/node_modules/@insforge/shared-schemas/dist/functions.schema.d.ts +0 -34
  102. package/node_modules/@insforge/shared-schemas/dist/functions.schema.d.ts.map +0 -1
  103. package/node_modules/@insforge/shared-schemas/dist/functions.schema.js +0 -14
  104. package/node_modules/@insforge/shared-schemas/dist/functions.schema.js.map +0 -1
  105. package/node_modules/@insforge/shared-schemas/dist/index.d.ts +0 -19
  106. package/node_modules/@insforge/shared-schemas/dist/index.d.ts.map +0 -1
  107. package/node_modules/@insforge/shared-schemas/dist/index.js +0 -19
  108. package/node_modules/@insforge/shared-schemas/dist/index.js.map +0 -1
  109. package/node_modules/@insforge/shared-schemas/dist/logs-api.schema.d.ts +0 -237
  110. package/node_modules/@insforge/shared-schemas/dist/logs-api.schema.d.ts.map +0 -1
  111. package/node_modules/@insforge/shared-schemas/dist/logs-api.schema.js +0 -41
  112. package/node_modules/@insforge/shared-schemas/dist/logs-api.schema.js.map +0 -1
  113. package/node_modules/@insforge/shared-schemas/dist/logs.schema.d.ts +0 -79
  114. package/node_modules/@insforge/shared-schemas/dist/logs.schema.d.ts.map +0 -1
  115. package/node_modules/@insforge/shared-schemas/dist/logs.schema.js +0 -31
  116. package/node_modules/@insforge/shared-schemas/dist/logs.schema.js.map +0 -1
  117. package/node_modules/@insforge/shared-schemas/dist/metadata.schema.d.ts +0 -940
  118. package/node_modules/@insforge/shared-schemas/dist/metadata.schema.d.ts.map +0 -1
  119. package/node_modules/@insforge/shared-schemas/dist/metadata.schema.js +0 -50
  120. package/node_modules/@insforge/shared-schemas/dist/metadata.schema.js.map +0 -1
  121. package/node_modules/@insforge/shared-schemas/dist/realtime-api.schema.d.ts +0 -395
  122. package/node_modules/@insforge/shared-schemas/dist/realtime-api.schema.d.ts.map +0 -1
  123. package/node_modules/@insforge/shared-schemas/dist/realtime-api.schema.js +0 -73
  124. package/node_modules/@insforge/shared-schemas/dist/realtime-api.schema.js.map +0 -1
  125. package/node_modules/@insforge/shared-schemas/dist/realtime.schema.d.ts +0 -269
  126. package/node_modules/@insforge/shared-schemas/dist/realtime.schema.d.ts.map +0 -1
  127. package/node_modules/@insforge/shared-schemas/dist/realtime.schema.js +0 -109
  128. package/node_modules/@insforge/shared-schemas/dist/realtime.schema.js.map +0 -1
  129. package/node_modules/@insforge/shared-schemas/dist/storage-api.schema.d.ts +0 -166
  130. package/node_modules/@insforge/shared-schemas/dist/storage-api.schema.d.ts.map +0 -1
  131. package/node_modules/@insforge/shared-schemas/dist/storage-api.schema.js +0 -49
  132. package/node_modules/@insforge/shared-schemas/dist/storage-api.schema.js.map +0 -1
  133. package/node_modules/@insforge/shared-schemas/dist/storage.schema.d.ts +0 -39
  134. package/node_modules/@insforge/shared-schemas/dist/storage.schema.d.ts.map +0 -1
  135. package/node_modules/@insforge/shared-schemas/dist/storage.schema.js +0 -15
  136. package/node_modules/@insforge/shared-schemas/dist/storage.schema.js.map +0 -1
  137. package/node_modules/@insforge/shared-schemas/package.json +0 -31
  138. package/node_modules/@socket.io/component-emitter/LICENSE +0 -24
  139. package/node_modules/@socket.io/component-emitter/Readme.md +0 -79
  140. package/node_modules/@socket.io/component-emitter/lib/cjs/index.d.ts +0 -179
  141. package/node_modules/@socket.io/component-emitter/lib/cjs/index.js +0 -176
  142. package/node_modules/@socket.io/component-emitter/lib/cjs/package.json +0 -4
  143. package/node_modules/@socket.io/component-emitter/lib/esm/index.d.ts +0 -179
  144. package/node_modules/@socket.io/component-emitter/lib/esm/index.js +0 -169
  145. package/node_modules/@socket.io/component-emitter/lib/esm/package.json +0 -4
  146. package/node_modules/@socket.io/component-emitter/package.json +0 -28
  147. package/node_modules/@supabase/node-fetch/LICENSE.md +0 -22
  148. package/node_modules/@supabase/node-fetch/README.md +0 -633
  149. package/node_modules/@supabase/node-fetch/browser.js +0 -22
  150. package/node_modules/@supabase/node-fetch/lib/index.es.js +0 -1778
  151. package/node_modules/@supabase/node-fetch/lib/index.js +0 -1787
  152. package/node_modules/@supabase/node-fetch/lib/index.mjs +0 -1776
  153. package/node_modules/@supabase/node-fetch/package.json +0 -80
  154. package/node_modules/@supabase/postgrest-js/LICENSE +0 -21
  155. package/node_modules/@supabase/postgrest-js/README.md +0 -56
  156. package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestBuilder.d.ts +0 -71
  157. package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestBuilder.d.ts.map +0 -1
  158. package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestBuilder.js +0 -222
  159. package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestBuilder.js.map +0 -1
  160. package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestClient.d.ts +0 -74
  161. package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestClient.d.ts.map +0 -1
  162. package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestClient.js +0 -121
  163. package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestClient.js.map +0 -1
  164. package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestError.d.ts +0 -17
  165. package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestError.d.ts.map +0 -1
  166. package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestError.js +0 -18
  167. package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestError.js.map +0 -1
  168. package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestFilterBuilder.d.ts +0 -108
  169. package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestFilterBuilder.d.ts.map +0 -1
  170. package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestFilterBuilder.js +0 -381
  171. package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestFilterBuilder.js.map +0 -1
  172. package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestQueryBuilder.d.ts +0 -117
  173. package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestQueryBuilder.d.ts.map +0 -1
  174. package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestQueryBuilder.js +0 -251
  175. package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestQueryBuilder.js.map +0 -1
  176. package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestTransformBuilder.d.ts +0 -157
  177. package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestTransformBuilder.d.ts.map +0 -1
  178. package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestTransformBuilder.js +0 -226
  179. package/node_modules/@supabase/postgrest-js/dist/cjs/PostgrestTransformBuilder.js.map +0 -1
  180. package/node_modules/@supabase/postgrest-js/dist/cjs/constants.d.ts +0 -4
  181. package/node_modules/@supabase/postgrest-js/dist/cjs/constants.d.ts.map +0 -1
  182. package/node_modules/@supabase/postgrest-js/dist/cjs/constants.js +0 -6
  183. package/node_modules/@supabase/postgrest-js/dist/cjs/constants.js.map +0 -1
  184. package/node_modules/@supabase/postgrest-js/dist/cjs/index.d.ts +0 -19
  185. package/node_modules/@supabase/postgrest-js/dist/cjs/index.d.ts.map +0 -1
  186. package/node_modules/@supabase/postgrest-js/dist/cjs/index.js +0 -28
  187. package/node_modules/@supabase/postgrest-js/dist/cjs/index.js.map +0 -1
  188. package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/parser.d.ts +0 -261
  189. package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/parser.d.ts.map +0 -1
  190. package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/parser.js +0 -5
  191. package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/parser.js.map +0 -1
  192. package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/result.d.ts +0 -157
  193. package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/result.d.ts.map +0 -1
  194. package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/result.js +0 -3
  195. package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/result.js.map +0 -1
  196. package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/types.d.ts +0 -31
  197. package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/types.d.ts.map +0 -1
  198. package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/types.js +0 -3
  199. package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/types.js.map +0 -1
  200. package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/utils.d.ts +0 -264
  201. package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/utils.d.ts.map +0 -1
  202. package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/utils.js +0 -3
  203. package/node_modules/@supabase/postgrest-js/dist/cjs/select-query-parser/utils.js.map +0 -1
  204. package/node_modules/@supabase/postgrest-js/dist/cjs/types.d.ts +0 -106
  205. package/node_modules/@supabase/postgrest-js/dist/cjs/types.d.ts.map +0 -1
  206. package/node_modules/@supabase/postgrest-js/dist/cjs/types.js +0 -3
  207. package/node_modules/@supabase/postgrest-js/dist/cjs/types.js.map +0 -1
  208. package/node_modules/@supabase/postgrest-js/dist/cjs/version.d.ts +0 -2
  209. package/node_modules/@supabase/postgrest-js/dist/cjs/version.d.ts.map +0 -1
  210. package/node_modules/@supabase/postgrest-js/dist/cjs/version.js +0 -5
  211. package/node_modules/@supabase/postgrest-js/dist/cjs/version.js.map +0 -1
  212. package/node_modules/@supabase/postgrest-js/dist/esm/wrapper.mjs +0 -28
  213. package/node_modules/@supabase/postgrest-js/package.json +0 -75
  214. package/node_modules/@supabase/postgrest-js/src/PostgrestBuilder.ts +0 -300
  215. package/node_modules/@supabase/postgrest-js/src/PostgrestClient.ts +0 -192
  216. package/node_modules/@supabase/postgrest-js/src/PostgrestError.ts +0 -18
  217. package/node_modules/@supabase/postgrest-js/src/PostgrestFilterBuilder.ts +0 -604
  218. package/node_modules/@supabase/postgrest-js/src/PostgrestQueryBuilder.ts +0 -437
  219. package/node_modules/@supabase/postgrest-js/src/PostgrestTransformBuilder.ts +0 -368
  220. package/node_modules/@supabase/postgrest-js/src/constants.ts +0 -2
  221. package/node_modules/@supabase/postgrest-js/src/index.ts +0 -35
  222. package/node_modules/@supabase/postgrest-js/src/select-query-parser/parser.ts +0 -469
  223. package/node_modules/@supabase/postgrest-js/src/select-query-parser/result.ts +0 -503
  224. package/node_modules/@supabase/postgrest-js/src/select-query-parser/types.ts +0 -115
  225. package/node_modules/@supabase/postgrest-js/src/select-query-parser/utils.ts +0 -602
  226. package/node_modules/@supabase/postgrest-js/src/types.ts +0 -201
  227. package/node_modules/@supabase/postgrest-js/src/version.ts +0 -1
  228. package/node_modules/debug/LICENSE +0 -20
  229. package/node_modules/debug/README.md +0 -481
  230. package/node_modules/debug/package.json +0 -60
  231. package/node_modules/debug/src/browser.js +0 -271
  232. package/node_modules/debug/src/common.js +0 -274
  233. package/node_modules/debug/src/index.js +0 -10
  234. package/node_modules/debug/src/node.js +0 -263
  235. package/node_modules/engine.io-client/LICENSE +0 -22
  236. package/node_modules/engine.io-client/README.md +0 -331
  237. package/node_modules/engine.io-client/build/cjs/browser-entrypoint.d.ts +0 -3
  238. package/node_modules/engine.io-client/build/cjs/browser-entrypoint.js +0 -4
  239. package/node_modules/engine.io-client/build/cjs/contrib/has-cors.d.ts +0 -1
  240. package/node_modules/engine.io-client/build/cjs/contrib/has-cors.js +0 -14
  241. package/node_modules/engine.io-client/build/cjs/contrib/parseqs.d.ts +0 -15
  242. package/node_modules/engine.io-client/build/cjs/contrib/parseqs.js +0 -38
  243. package/node_modules/engine.io-client/build/cjs/contrib/parseuri.d.ts +0 -1
  244. package/node_modules/engine.io-client/build/cjs/contrib/parseuri.js +0 -67
  245. package/node_modules/engine.io-client/build/cjs/globals.d.ts +0 -4
  246. package/node_modules/engine.io-client/build/cjs/globals.js +0 -26
  247. package/node_modules/engine.io-client/build/cjs/globals.node.d.ts +0 -21
  248. package/node_modules/engine.io-client/build/cjs/globals.node.js +0 -97
  249. package/node_modules/engine.io-client/build/cjs/index.d.ts +0 -15
  250. package/node_modules/engine.io-client/build/cjs/index.js +0 -32
  251. package/node_modules/engine.io-client/build/cjs/package.json +0 -10
  252. package/node_modules/engine.io-client/build/cjs/socket.d.ts +0 -482
  253. package/node_modules/engine.io-client/build/cjs/socket.js +0 -765
  254. package/node_modules/engine.io-client/build/cjs/transport.d.ts +0 -106
  255. package/node_modules/engine.io-client/build/cjs/transport.js +0 -153
  256. package/node_modules/engine.io-client/build/cjs/transports/index.d.ts +0 -8
  257. package/node_modules/engine.io-client/build/cjs/transports/index.js +0 -11
  258. package/node_modules/engine.io-client/build/cjs/transports/polling-fetch.d.ts +0 -15
  259. package/node_modules/engine.io-client/build/cjs/transports/polling-fetch.js +0 -60
  260. package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.d.ts +0 -108
  261. package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.js +0 -285
  262. package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.node.d.ts +0 -11
  263. package/node_modules/engine.io-client/build/cjs/transports/polling-xhr.node.js +0 -44
  264. package/node_modules/engine.io-client/build/cjs/transports/polling.d.ts +0 -52
  265. package/node_modules/engine.io-client/build/cjs/transports/polling.js +0 -165
  266. package/node_modules/engine.io-client/build/cjs/transports/websocket.d.ts +0 -36
  267. package/node_modules/engine.io-client/build/cjs/transports/websocket.js +0 -136
  268. package/node_modules/engine.io-client/build/cjs/transports/websocket.node.d.ts +0 -14
  269. package/node_modules/engine.io-client/build/cjs/transports/websocket.node.js +0 -68
  270. package/node_modules/engine.io-client/build/cjs/transports/webtransport.d.ts +0 -18
  271. package/node_modules/engine.io-client/build/cjs/transports/webtransport.js +0 -94
  272. package/node_modules/engine.io-client/build/cjs/util.d.ts +0 -7
  273. package/node_modules/engine.io-client/build/cjs/util.js +0 -65
  274. package/node_modules/engine.io-client/build/esm/browser-entrypoint.d.ts +0 -3
  275. package/node_modules/engine.io-client/build/esm/browser-entrypoint.js +0 -2
  276. package/node_modules/engine.io-client/build/esm/contrib/has-cors.d.ts +0 -1
  277. package/node_modules/engine.io-client/build/esm/contrib/has-cors.js +0 -11
  278. package/node_modules/engine.io-client/build/esm/contrib/parseqs.d.ts +0 -15
  279. package/node_modules/engine.io-client/build/esm/contrib/parseqs.js +0 -34
  280. package/node_modules/engine.io-client/build/esm/contrib/parseuri.d.ts +0 -1
  281. package/node_modules/engine.io-client/build/esm/contrib/parseuri.js +0 -64
  282. package/node_modules/engine.io-client/build/esm/globals.d.ts +0 -4
  283. package/node_modules/engine.io-client/build/esm/globals.js +0 -22
  284. package/node_modules/engine.io-client/build/esm/globals.node.d.ts +0 -21
  285. package/node_modules/engine.io-client/build/esm/globals.node.js +0 -91
  286. package/node_modules/engine.io-client/build/esm/index.d.ts +0 -15
  287. package/node_modules/engine.io-client/build/esm/index.js +0 -15
  288. package/node_modules/engine.io-client/build/esm/package.json +0 -10
  289. package/node_modules/engine.io-client/build/esm/socket.d.ts +0 -482
  290. package/node_modules/engine.io-client/build/esm/socket.js +0 -727
  291. package/node_modules/engine.io-client/build/esm/transport.d.ts +0 -106
  292. package/node_modules/engine.io-client/build/esm/transport.js +0 -142
  293. package/node_modules/engine.io-client/build/esm/transports/index.d.ts +0 -8
  294. package/node_modules/engine.io-client/build/esm/transports/index.js +0 -8
  295. package/node_modules/engine.io-client/build/esm/transports/polling-fetch.d.ts +0 -15
  296. package/node_modules/engine.io-client/build/esm/transports/polling-fetch.js +0 -56
  297. package/node_modules/engine.io-client/build/esm/transports/polling-xhr.d.ts +0 -108
  298. package/node_modules/engine.io-client/build/esm/transports/polling-xhr.js +0 -271
  299. package/node_modules/engine.io-client/build/esm/transports/polling-xhr.node.d.ts +0 -11
  300. package/node_modules/engine.io-client/build/esm/transports/polling-xhr.node.js +0 -17
  301. package/node_modules/engine.io-client/build/esm/transports/polling.d.ts +0 -52
  302. package/node_modules/engine.io-client/build/esm/transports/polling.js +0 -145
  303. package/node_modules/engine.io-client/build/esm/transports/websocket.d.ts +0 -36
  304. package/node_modules/engine.io-client/build/esm/transports/websocket.js +0 -125
  305. package/node_modules/engine.io-client/build/esm/transports/websocket.node.d.ts +0 -14
  306. package/node_modules/engine.io-client/build/esm/transports/websocket.node.js +0 -41
  307. package/node_modules/engine.io-client/build/esm/transports/webtransport.d.ts +0 -18
  308. package/node_modules/engine.io-client/build/esm/transports/webtransport.js +0 -80
  309. package/node_modules/engine.io-client/build/esm/util.d.ts +0 -7
  310. package/node_modules/engine.io-client/build/esm/util.js +0 -59
  311. package/node_modules/engine.io-client/build/esm-debug/browser-entrypoint.d.ts +0 -3
  312. package/node_modules/engine.io-client/build/esm-debug/browser-entrypoint.js +0 -2
  313. package/node_modules/engine.io-client/build/esm-debug/contrib/has-cors.d.ts +0 -1
  314. package/node_modules/engine.io-client/build/esm-debug/contrib/has-cors.js +0 -11
  315. package/node_modules/engine.io-client/build/esm-debug/contrib/parseqs.d.ts +0 -15
  316. package/node_modules/engine.io-client/build/esm-debug/contrib/parseqs.js +0 -34
  317. package/node_modules/engine.io-client/build/esm-debug/contrib/parseuri.d.ts +0 -1
  318. package/node_modules/engine.io-client/build/esm-debug/contrib/parseuri.js +0 -64
  319. package/node_modules/engine.io-client/build/esm-debug/globals.d.ts +0 -4
  320. package/node_modules/engine.io-client/build/esm-debug/globals.js +0 -22
  321. package/node_modules/engine.io-client/build/esm-debug/globals.node.d.ts +0 -21
  322. package/node_modules/engine.io-client/build/esm-debug/globals.node.js +0 -91
  323. package/node_modules/engine.io-client/build/esm-debug/index.d.ts +0 -15
  324. package/node_modules/engine.io-client/build/esm-debug/index.js +0 -15
  325. package/node_modules/engine.io-client/build/esm-debug/package.json +0 -10
  326. package/node_modules/engine.io-client/build/esm-debug/socket.d.ts +0 -482
  327. package/node_modules/engine.io-client/build/esm-debug/socket.js +0 -756
  328. package/node_modules/engine.io-client/build/esm-debug/transport.d.ts +0 -106
  329. package/node_modules/engine.io-client/build/esm-debug/transport.js +0 -145
  330. package/node_modules/engine.io-client/build/esm-debug/transports/index.d.ts +0 -8
  331. package/node_modules/engine.io-client/build/esm-debug/transports/index.js +0 -8
  332. package/node_modules/engine.io-client/build/esm-debug/transports/polling-fetch.d.ts +0 -15
  333. package/node_modules/engine.io-client/build/esm-debug/transports/polling-fetch.js +0 -56
  334. package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.d.ts +0 -108
  335. package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.js +0 -276
  336. package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.node.d.ts +0 -11
  337. package/node_modules/engine.io-client/build/esm-debug/transports/polling-xhr.node.js +0 -17
  338. package/node_modules/engine.io-client/build/esm-debug/transports/polling.d.ts +0 -52
  339. package/node_modules/engine.io-client/build/esm-debug/transports/polling.js +0 -158
  340. package/node_modules/engine.io-client/build/esm-debug/transports/websocket.d.ts +0 -36
  341. package/node_modules/engine.io-client/build/esm-debug/transports/websocket.js +0 -128
  342. package/node_modules/engine.io-client/build/esm-debug/transports/websocket.node.d.ts +0 -14
  343. package/node_modules/engine.io-client/build/esm-debug/transports/websocket.node.js +0 -41
  344. package/node_modules/engine.io-client/build/esm-debug/transports/webtransport.d.ts +0 -18
  345. package/node_modules/engine.io-client/build/esm-debug/transports/webtransport.js +0 -87
  346. package/node_modules/engine.io-client/build/esm-debug/util.d.ts +0 -7
  347. package/node_modules/engine.io-client/build/esm-debug/util.js +0 -59
  348. package/node_modules/engine.io-client/dist/engine.io.esm.min.js +0 -7
  349. package/node_modules/engine.io-client/dist/engine.io.esm.min.js.map +0 -1
  350. package/node_modules/engine.io-client/dist/engine.io.js +0 -2968
  351. package/node_modules/engine.io-client/dist/engine.io.js.map +0 -1
  352. package/node_modules/engine.io-client/dist/engine.io.min.js +0 -7
  353. package/node_modules/engine.io-client/dist/engine.io.min.js.map +0 -1
  354. package/node_modules/engine.io-client/package.json +0 -95
  355. package/node_modules/engine.io-parser/LICENSE +0 -22
  356. package/node_modules/engine.io-parser/Readme.md +0 -158
  357. package/node_modules/engine.io-parser/build/cjs/commons.d.ts +0 -14
  358. package/node_modules/engine.io-parser/build/cjs/commons.js +0 -19
  359. package/node_modules/engine.io-parser/build/cjs/contrib/base64-arraybuffer.d.ts +0 -2
  360. package/node_modules/engine.io-parser/build/cjs/contrib/base64-arraybuffer.js +0 -48
  361. package/node_modules/engine.io-parser/build/cjs/decodePacket.browser.d.ts +0 -2
  362. package/node_modules/engine.io-parser/build/cjs/decodePacket.browser.js +0 -66
  363. package/node_modules/engine.io-parser/build/cjs/decodePacket.d.ts +0 -2
  364. package/node_modules/engine.io-parser/build/cjs/decodePacket.js +0 -59
  365. package/node_modules/engine.io-parser/build/cjs/encodePacket.browser.d.ts +0 -4
  366. package/node_modules/engine.io-parser/build/cjs/encodePacket.browser.js +0 -72
  367. package/node_modules/engine.io-parser/build/cjs/encodePacket.d.ts +0 -3
  368. package/node_modules/engine.io-parser/build/cjs/encodePacket.js +0 -38
  369. package/node_modules/engine.io-parser/build/cjs/index.d.ts +0 -9
  370. package/node_modules/engine.io-parser/build/cjs/index.js +0 -164
  371. package/node_modules/engine.io-parser/build/cjs/package.json +0 -8
  372. package/node_modules/engine.io-parser/build/esm/commons.d.ts +0 -14
  373. package/node_modules/engine.io-parser/build/esm/commons.js +0 -14
  374. package/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.d.ts +0 -2
  375. package/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.js +0 -43
  376. package/node_modules/engine.io-parser/build/esm/decodePacket.browser.d.ts +0 -2
  377. package/node_modules/engine.io-parser/build/esm/decodePacket.browser.js +0 -62
  378. package/node_modules/engine.io-parser/build/esm/decodePacket.d.ts +0 -2
  379. package/node_modules/engine.io-parser/build/esm/decodePacket.js +0 -55
  380. package/node_modules/engine.io-parser/build/esm/encodePacket.browser.d.ts +0 -4
  381. package/node_modules/engine.io-parser/build/esm/encodePacket.browser.js +0 -68
  382. package/node_modules/engine.io-parser/build/esm/encodePacket.d.ts +0 -3
  383. package/node_modules/engine.io-parser/build/esm/encodePacket.js +0 -33
  384. package/node_modules/engine.io-parser/build/esm/index.d.ts +0 -9
  385. package/node_modules/engine.io-parser/build/esm/index.js +0 -156
  386. package/node_modules/engine.io-parser/build/esm/package.json +0 -8
  387. package/node_modules/engine.io-parser/package.json +0 -46
  388. package/node_modules/ms/index.js +0 -162
  389. package/node_modules/ms/license.md +0 -21
  390. package/node_modules/ms/package.json +0 -38
  391. package/node_modules/ms/readme.md +0 -59
  392. package/node_modules/socket.io-client/LICENSE +0 -21
  393. package/node_modules/socket.io-client/README.md +0 -29
  394. package/node_modules/socket.io-client/build/cjs/browser-entrypoint.d.ts +0 -2
  395. package/node_modules/socket.io-client/build/cjs/browser-entrypoint.js +0 -4
  396. package/node_modules/socket.io-client/build/cjs/contrib/backo2.d.ts +0 -12
  397. package/node_modules/socket.io-client/build/cjs/contrib/backo2.js +0 -69
  398. package/node_modules/socket.io-client/build/cjs/index.d.ts +0 -29
  399. package/node_modules/socket.io-client/build/cjs/index.js +0 -76
  400. package/node_modules/socket.io-client/build/cjs/manager.d.ts +0 -295
  401. package/node_modules/socket.io-client/build/cjs/manager.js +0 -416
  402. package/node_modules/socket.io-client/build/cjs/on.d.ts +0 -2
  403. package/node_modules/socket.io-client/build/cjs/on.js +0 -9
  404. package/node_modules/socket.io-client/build/cjs/socket.d.ts +0 -593
  405. package/node_modules/socket.io-client/build/cjs/socket.js +0 -910
  406. package/node_modules/socket.io-client/build/cjs/url.d.ts +0 -33
  407. package/node_modules/socket.io-client/build/cjs/url.js +0 -69
  408. package/node_modules/socket.io-client/build/esm/browser-entrypoint.d.ts +0 -2
  409. package/node_modules/socket.io-client/build/esm/browser-entrypoint.js +0 -2
  410. package/node_modules/socket.io-client/build/esm/contrib/backo2.d.ts +0 -12
  411. package/node_modules/socket.io-client/build/esm/contrib/backo2.js +0 -66
  412. package/node_modules/socket.io-client/build/esm/index.d.ts +0 -29
  413. package/node_modules/socket.io-client/build/esm/index.js +0 -58
  414. package/node_modules/socket.io-client/build/esm/manager.d.ts +0 -295
  415. package/node_modules/socket.io-client/build/esm/manager.js +0 -367
  416. package/node_modules/socket.io-client/build/esm/on.d.ts +0 -2
  417. package/node_modules/socket.io-client/build/esm/on.js +0 -6
  418. package/node_modules/socket.io-client/build/esm/package.json +0 -5
  419. package/node_modules/socket.io-client/build/esm/socket.d.ts +0 -593
  420. package/node_modules/socket.io-client/build/esm/socket.js +0 -882
  421. package/node_modules/socket.io-client/build/esm/url.d.ts +0 -33
  422. package/node_modules/socket.io-client/build/esm/url.js +0 -59
  423. package/node_modules/socket.io-client/build/esm-debug/browser-entrypoint.d.ts +0 -2
  424. package/node_modules/socket.io-client/build/esm-debug/browser-entrypoint.js +0 -2
  425. package/node_modules/socket.io-client/build/esm-debug/contrib/backo2.d.ts +0 -12
  426. package/node_modules/socket.io-client/build/esm-debug/contrib/backo2.js +0 -66
  427. package/node_modules/socket.io-client/build/esm-debug/index.d.ts +0 -29
  428. package/node_modules/socket.io-client/build/esm-debug/index.js +0 -62
  429. package/node_modules/socket.io-client/build/esm-debug/manager.d.ts +0 -295
  430. package/node_modules/socket.io-client/build/esm-debug/manager.js +0 -386
  431. package/node_modules/socket.io-client/build/esm-debug/on.d.ts +0 -2
  432. package/node_modules/socket.io-client/build/esm-debug/on.js +0 -6
  433. package/node_modules/socket.io-client/build/esm-debug/package.json +0 -5
  434. package/node_modules/socket.io-client/build/esm-debug/socket.d.ts +0 -593
  435. package/node_modules/socket.io-client/build/esm-debug/socket.js +0 -903
  436. package/node_modules/socket.io-client/build/esm-debug/url.d.ts +0 -33
  437. package/node_modules/socket.io-client/build/esm-debug/url.js +0 -63
  438. package/node_modules/socket.io-client/dist/socket.io.esm.min.js +0 -7
  439. package/node_modules/socket.io-client/dist/socket.io.esm.min.js.map +0 -1
  440. package/node_modules/socket.io-client/dist/socket.io.js +0 -4908
  441. package/node_modules/socket.io-client/dist/socket.io.js.map +0 -1
  442. package/node_modules/socket.io-client/dist/socket.io.min.js +0 -7
  443. package/node_modules/socket.io-client/dist/socket.io.min.js.map +0 -1
  444. package/node_modules/socket.io-client/dist/socket.io.msgpack.min.js +0 -7
  445. package/node_modules/socket.io-client/dist/socket.io.msgpack.min.js.map +0 -1
  446. package/node_modules/socket.io-client/package.json +0 -101
  447. package/node_modules/socket.io-parser/LICENSE +0 -20
  448. package/node_modules/socket.io-parser/Readme.md +0 -81
  449. package/node_modules/socket.io-parser/build/cjs/binary.d.ts +0 -20
  450. package/node_modules/socket.io-parser/build/cjs/binary.js +0 -88
  451. package/node_modules/socket.io-parser/build/cjs/index.d.ts +0 -90
  452. package/node_modules/socket.io-parser/build/cjs/index.js +0 -321
  453. package/node_modules/socket.io-parser/build/cjs/is-binary.d.ts +0 -7
  454. package/node_modules/socket.io-parser/build/cjs/is-binary.js +0 -55
  455. package/node_modules/socket.io-parser/build/cjs/package.json +0 -3
  456. package/node_modules/socket.io-parser/build/esm/binary.d.ts +0 -20
  457. package/node_modules/socket.io-parser/build/esm/binary.js +0 -83
  458. package/node_modules/socket.io-parser/build/esm/index.d.ts +0 -90
  459. package/node_modules/socket.io-parser/build/esm/index.js +0 -311
  460. package/node_modules/socket.io-parser/build/esm/is-binary.d.ts +0 -7
  461. package/node_modules/socket.io-parser/build/esm/is-binary.js +0 -50
  462. package/node_modules/socket.io-parser/build/esm/package.json +0 -3
  463. package/node_modules/socket.io-parser/build/esm-debug/binary.d.ts +0 -20
  464. package/node_modules/socket.io-parser/build/esm-debug/binary.js +0 -83
  465. package/node_modules/socket.io-parser/build/esm-debug/index.d.ts +0 -90
  466. package/node_modules/socket.io-parser/build/esm-debug/index.js +0 -316
  467. package/node_modules/socket.io-parser/build/esm-debug/is-binary.d.ts +0 -7
  468. package/node_modules/socket.io-parser/build/esm-debug/is-binary.js +0 -50
  469. package/node_modules/socket.io-parser/build/esm-debug/package.json +0 -3
  470. package/node_modules/socket.io-parser/package.json +0 -58
  471. package/node_modules/tr46/.npmignore +0 -4
  472. package/node_modules/tr46/index.js +0 -193
  473. package/node_modules/tr46/lib/.gitkeep +0 -0
  474. package/node_modules/tr46/lib/mappingTable.json +0 -1
  475. package/node_modules/tr46/package.json +0 -31
  476. package/node_modules/webidl-conversions/LICENSE.md +0 -12
  477. package/node_modules/webidl-conversions/README.md +0 -53
  478. package/node_modules/webidl-conversions/lib/index.js +0 -189
  479. package/node_modules/webidl-conversions/package.json +0 -23
  480. package/node_modules/whatwg-url/LICENSE.txt +0 -21
  481. package/node_modules/whatwg-url/README.md +0 -67
  482. package/node_modules/whatwg-url/lib/URL-impl.js +0 -200
  483. package/node_modules/whatwg-url/lib/URL.js +0 -196
  484. package/node_modules/whatwg-url/lib/public-api.js +0 -11
  485. package/node_modules/whatwg-url/lib/url-state-machine.js +0 -1297
  486. package/node_modules/whatwg-url/lib/utils.js +0 -20
  487. package/node_modules/whatwg-url/package.json +0 -32
  488. package/node_modules/ws/LICENSE +0 -20
  489. package/node_modules/ws/README.md +0 -548
  490. package/node_modules/ws/browser.js +0 -8
  491. package/node_modules/ws/index.js +0 -13
  492. package/node_modules/ws/lib/buffer-util.js +0 -131
  493. package/node_modules/ws/lib/constants.js +0 -12
  494. package/node_modules/ws/lib/event-target.js +0 -292
  495. package/node_modules/ws/lib/extension.js +0 -203
  496. package/node_modules/ws/lib/limiter.js +0 -55
  497. package/node_modules/ws/lib/permessage-deflate.js +0 -514
  498. package/node_modules/ws/lib/receiver.js +0 -704
  499. package/node_modules/ws/lib/sender.js +0 -497
  500. package/node_modules/ws/lib/stream.js +0 -159
  501. package/node_modules/ws/lib/subprotocol.js +0 -62
  502. package/node_modules/ws/lib/validation.js +0 -130
  503. package/node_modules/ws/lib/websocket-server.js +0 -540
  504. package/node_modules/ws/lib/websocket.js +0 -1338
  505. package/node_modules/ws/package.json +0 -69
  506. package/node_modules/ws/wrapper.mjs +0 -8
  507. package/node_modules/xmlhttprequest-ssl/LICENSE +0 -22
  508. package/node_modules/xmlhttprequest-ssl/README.md +0 -67
  509. package/node_modules/xmlhttprequest-ssl/lib/XMLHttpRequest.js +0 -689
  510. package/node_modules/xmlhttprequest-ssl/package.json +0 -40
  511. package/node_modules/zod/LICENSE +0 -21
  512. package/node_modules/zod/README.md +0 -208
  513. package/node_modules/zod/index.cjs +0 -33
  514. package/node_modules/zod/index.d.cts +0 -4
  515. package/node_modules/zod/index.d.ts +0 -4
  516. package/node_modules/zod/index.js +0 -4
  517. package/node_modules/zod/package.json +0 -118
  518. package/node_modules/zod/src/index.ts +0 -4
  519. package/node_modules/zod/src/v3/ZodError.ts +0 -330
  520. package/node_modules/zod/src/v3/benchmarks/datetime.ts +0 -58
  521. package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +0 -80
  522. package/node_modules/zod/src/v3/benchmarks/index.ts +0 -59
  523. package/node_modules/zod/src/v3/benchmarks/ipv4.ts +0 -57
  524. package/node_modules/zod/src/v3/benchmarks/object.ts +0 -69
  525. package/node_modules/zod/src/v3/benchmarks/primitives.ts +0 -162
  526. package/node_modules/zod/src/v3/benchmarks/realworld.ts +0 -63
  527. package/node_modules/zod/src/v3/benchmarks/string.ts +0 -55
  528. package/node_modules/zod/src/v3/benchmarks/union.ts +0 -80
  529. package/node_modules/zod/src/v3/errors.ts +0 -13
  530. package/node_modules/zod/src/v3/external.ts +0 -6
  531. package/node_modules/zod/src/v3/helpers/enumUtil.ts +0 -17
  532. package/node_modules/zod/src/v3/helpers/errorUtil.ts +0 -8
  533. package/node_modules/zod/src/v3/helpers/parseUtil.ts +0 -176
  534. package/node_modules/zod/src/v3/helpers/partialUtil.ts +0 -34
  535. package/node_modules/zod/src/v3/helpers/typeAliases.ts +0 -2
  536. package/node_modules/zod/src/v3/helpers/util.ts +0 -224
  537. package/node_modules/zod/src/v3/index.ts +0 -4
  538. package/node_modules/zod/src/v3/locales/en.ts +0 -124
  539. package/node_modules/zod/src/v3/standard-schema.ts +0 -113
  540. package/node_modules/zod/src/v3/tests/Mocker.ts +0 -54
  541. package/node_modules/zod/src/v3/tests/all-errors.test.ts +0 -157
  542. package/node_modules/zod/src/v3/tests/anyunknown.test.ts +0 -28
  543. package/node_modules/zod/src/v3/tests/array.test.ts +0 -71
  544. package/node_modules/zod/src/v3/tests/async-parsing.test.ts +0 -388
  545. package/node_modules/zod/src/v3/tests/async-refinements.test.ts +0 -46
  546. package/node_modules/zod/src/v3/tests/base.test.ts +0 -29
  547. package/node_modules/zod/src/v3/tests/bigint.test.ts +0 -55
  548. package/node_modules/zod/src/v3/tests/branded.test.ts +0 -53
  549. package/node_modules/zod/src/v3/tests/catch.test.ts +0 -220
  550. package/node_modules/zod/src/v3/tests/coerce.test.ts +0 -133
  551. package/node_modules/zod/src/v3/tests/complex.test.ts +0 -56
  552. package/node_modules/zod/src/v3/tests/custom.test.ts +0 -31
  553. package/node_modules/zod/src/v3/tests/date.test.ts +0 -32
  554. package/node_modules/zod/src/v3/tests/deepmasking.test.ts +0 -186
  555. package/node_modules/zod/src/v3/tests/default.test.ts +0 -112
  556. package/node_modules/zod/src/v3/tests/description.test.ts +0 -33
  557. package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +0 -315
  558. package/node_modules/zod/src/v3/tests/enum.test.ts +0 -80
  559. package/node_modules/zod/src/v3/tests/error.test.ts +0 -551
  560. package/node_modules/zod/src/v3/tests/firstparty.test.ts +0 -87
  561. package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +0 -21
  562. package/node_modules/zod/src/v3/tests/function.test.ts +0 -257
  563. package/node_modules/zod/src/v3/tests/generics.test.ts +0 -48
  564. package/node_modules/zod/src/v3/tests/instanceof.test.ts +0 -37
  565. package/node_modules/zod/src/v3/tests/intersection.test.ts +0 -110
  566. package/node_modules/zod/src/v3/tests/language-server.source.ts +0 -76
  567. package/node_modules/zod/src/v3/tests/language-server.test.ts +0 -207
  568. package/node_modules/zod/src/v3/tests/literal.test.ts +0 -36
  569. package/node_modules/zod/src/v3/tests/map.test.ts +0 -110
  570. package/node_modules/zod/src/v3/tests/masking.test.ts +0 -4
  571. package/node_modules/zod/src/v3/tests/mocker.test.ts +0 -19
  572. package/node_modules/zod/src/v3/tests/nan.test.ts +0 -21
  573. package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +0 -87
  574. package/node_modules/zod/src/v3/tests/nullable.test.ts +0 -42
  575. package/node_modules/zod/src/v3/tests/number.test.ts +0 -176
  576. package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +0 -29
  577. package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +0 -29
  578. package/node_modules/zod/src/v3/tests/object.test.ts +0 -434
  579. package/node_modules/zod/src/v3/tests/optional.test.ts +0 -42
  580. package/node_modules/zod/src/v3/tests/parseUtil.test.ts +0 -23
  581. package/node_modules/zod/src/v3/tests/parser.test.ts +0 -41
  582. package/node_modules/zod/src/v3/tests/partials.test.ts +0 -243
  583. package/node_modules/zod/src/v3/tests/pickomit.test.ts +0 -111
  584. package/node_modules/zod/src/v3/tests/pipeline.test.ts +0 -29
  585. package/node_modules/zod/src/v3/tests/preprocess.test.ts +0 -186
  586. package/node_modules/zod/src/v3/tests/primitive.test.ts +0 -440
  587. package/node_modules/zod/src/v3/tests/promise.test.ts +0 -90
  588. package/node_modules/zod/src/v3/tests/readonly.test.ts +0 -194
  589. package/node_modules/zod/src/v3/tests/record.test.ts +0 -171
  590. package/node_modules/zod/src/v3/tests/recursive.test.ts +0 -197
  591. package/node_modules/zod/src/v3/tests/refine.test.ts +0 -313
  592. package/node_modules/zod/src/v3/tests/safeparse.test.ts +0 -27
  593. package/node_modules/zod/src/v3/tests/set.test.ts +0 -142
  594. package/node_modules/zod/src/v3/tests/standard-schema.test.ts +0 -83
  595. package/node_modules/zod/src/v3/tests/string.test.ts +0 -916
  596. package/node_modules/zod/src/v3/tests/transformer.test.ts +0 -233
  597. package/node_modules/zod/src/v3/tests/tuple.test.ts +0 -90
  598. package/node_modules/zod/src/v3/tests/unions.test.ts +0 -57
  599. package/node_modules/zod/src/v3/tests/validations.test.ts +0 -133
  600. package/node_modules/zod/src/v3/tests/void.test.ts +0 -15
  601. package/node_modules/zod/src/v3/types.ts +0 -5136
  602. package/node_modules/zod/src/v4/classic/checks.ts +0 -30
  603. package/node_modules/zod/src/v4/classic/coerce.ts +0 -27
  604. package/node_modules/zod/src/v4/classic/compat.ts +0 -66
  605. package/node_modules/zod/src/v4/classic/errors.ts +0 -75
  606. package/node_modules/zod/src/v4/classic/external.ts +0 -50
  607. package/node_modules/zod/src/v4/classic/index.ts +0 -5
  608. package/node_modules/zod/src/v4/classic/iso.ts +0 -90
  609. package/node_modules/zod/src/v4/classic/parse.ts +0 -33
  610. package/node_modules/zod/src/v4/classic/schemas.ts +0 -2054
  611. package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +0 -26
  612. package/node_modules/zod/src/v4/classic/tests/array.test.ts +0 -264
  613. package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +0 -210
  614. package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +0 -381
  615. package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +0 -68
  616. package/node_modules/zod/src/v4/classic/tests/base.test.ts +0 -7
  617. package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +0 -54
  618. package/node_modules/zod/src/v4/classic/tests/brand.test.ts +0 -63
  619. package/node_modules/zod/src/v4/classic/tests/catch.test.ts +0 -252
  620. package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +0 -20
  621. package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +0 -160
  622. package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +0 -352
  623. package/node_modules/zod/src/v4/classic/tests/custom.test.ts +0 -40
  624. package/node_modules/zod/src/v4/classic/tests/date.test.ts +0 -31
  625. package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +0 -296
  626. package/node_modules/zod/src/v4/classic/tests/default.test.ts +0 -313
  627. package/node_modules/zod/src/v4/classic/tests/description.test.ts +0 -32
  628. package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +0 -619
  629. package/node_modules/zod/src/v4/classic/tests/enum.test.ts +0 -285
  630. package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +0 -527
  631. package/node_modules/zod/src/v4/classic/tests/error.test.ts +0 -711
  632. package/node_modules/zod/src/v4/classic/tests/file.test.ts +0 -91
  633. package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +0 -175
  634. package/node_modules/zod/src/v4/classic/tests/function.test.ts +0 -268
  635. package/node_modules/zod/src/v4/classic/tests/generics.test.ts +0 -72
  636. package/node_modules/zod/src/v4/classic/tests/index.test.ts +0 -829
  637. package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +0 -34
  638. package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +0 -171
  639. package/node_modules/zod/src/v4/classic/tests/json.test.ts +0 -108
  640. package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +0 -227
  641. package/node_modules/zod/src/v4/classic/tests/literal.test.ts +0 -92
  642. package/node_modules/zod/src/v4/classic/tests/map.test.ts +0 -196
  643. package/node_modules/zod/src/v4/classic/tests/nan.test.ts +0 -21
  644. package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +0 -168
  645. package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +0 -86
  646. package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +0 -22
  647. package/node_modules/zod/src/v4/classic/tests/number.test.ts +0 -247
  648. package/node_modules/zod/src/v4/classic/tests/object.test.ts +0 -563
  649. package/node_modules/zod/src/v4/classic/tests/optional.test.ts +0 -123
  650. package/node_modules/zod/src/v4/classic/tests/partial.test.ts +0 -147
  651. package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +0 -127
  652. package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +0 -81
  653. package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +0 -37
  654. package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +0 -298
  655. package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +0 -175
  656. package/node_modules/zod/src/v4/classic/tests/promise.test.ts +0 -81
  657. package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +0 -23
  658. package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +0 -252
  659. package/node_modules/zod/src/v4/classic/tests/record.test.ts +0 -342
  660. package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +0 -356
  661. package/node_modules/zod/src/v4/classic/tests/refine.test.ts +0 -532
  662. package/node_modules/zod/src/v4/classic/tests/registries.test.ts +0 -204
  663. package/node_modules/zod/src/v4/classic/tests/set.test.ts +0 -179
  664. package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +0 -57
  665. package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +0 -109
  666. package/node_modules/zod/src/v4/classic/tests/string.test.ts +0 -881
  667. package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +0 -66
  668. package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +0 -758
  669. package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +0 -2314
  670. package/node_modules/zod/src/v4/classic/tests/transform.test.ts +0 -250
  671. package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +0 -163
  672. package/node_modules/zod/src/v4/classic/tests/union.test.ts +0 -94
  673. package/node_modules/zod/src/v4/classic/tests/validations.test.ts +0 -283
  674. package/node_modules/zod/src/v4/classic/tests/void.test.ts +0 -12
  675. package/node_modules/zod/src/v4/core/api.ts +0 -1594
  676. package/node_modules/zod/src/v4/core/checks.ts +0 -1283
  677. package/node_modules/zod/src/v4/core/config.ts +0 -15
  678. package/node_modules/zod/src/v4/core/core.ts +0 -134
  679. package/node_modules/zod/src/v4/core/doc.ts +0 -44
  680. package/node_modules/zod/src/v4/core/errors.ts +0 -424
  681. package/node_modules/zod/src/v4/core/function.ts +0 -176
  682. package/node_modules/zod/src/v4/core/index.ts +0 -15
  683. package/node_modules/zod/src/v4/core/json-schema.ts +0 -143
  684. package/node_modules/zod/src/v4/core/parse.ts +0 -94
  685. package/node_modules/zod/src/v4/core/regexes.ts +0 -135
  686. package/node_modules/zod/src/v4/core/registries.ts +0 -96
  687. package/node_modules/zod/src/v4/core/schemas.ts +0 -3842
  688. package/node_modules/zod/src/v4/core/standard-schema.ts +0 -64
  689. package/node_modules/zod/src/v4/core/tests/index.test.ts +0 -46
  690. package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +0 -124
  691. package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +0 -22
  692. package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +0 -128
  693. package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +0 -69
  694. package/node_modules/zod/src/v4/core/to-json-schema.ts +0 -977
  695. package/node_modules/zod/src/v4/core/util.ts +0 -775
  696. package/node_modules/zod/src/v4/core/versions.ts +0 -5
  697. package/node_modules/zod/src/v4/core/zsf.ts +0 -323
  698. package/node_modules/zod/src/v4/index.ts +0 -4
  699. package/node_modules/zod/src/v4/locales/ar.ts +0 -125
  700. package/node_modules/zod/src/v4/locales/az.ts +0 -121
  701. package/node_modules/zod/src/v4/locales/be.ts +0 -184
  702. package/node_modules/zod/src/v4/locales/ca.ts +0 -127
  703. package/node_modules/zod/src/v4/locales/cs.ts +0 -142
  704. package/node_modules/zod/src/v4/locales/de.ts +0 -124
  705. package/node_modules/zod/src/v4/locales/en.ts +0 -127
  706. package/node_modules/zod/src/v4/locales/eo.ts +0 -125
  707. package/node_modules/zod/src/v4/locales/es.ts +0 -125
  708. package/node_modules/zod/src/v4/locales/fa.ts +0 -134
  709. package/node_modules/zod/src/v4/locales/fi.ts +0 -131
  710. package/node_modules/zod/src/v4/locales/fr-CA.ts +0 -126
  711. package/node_modules/zod/src/v4/locales/fr.ts +0 -124
  712. package/node_modules/zod/src/v4/locales/he.ts +0 -125
  713. package/node_modules/zod/src/v4/locales/hu.ts +0 -126
  714. package/node_modules/zod/src/v4/locales/id.ts +0 -125
  715. package/node_modules/zod/src/v4/locales/index.ts +0 -39
  716. package/node_modules/zod/src/v4/locales/it.ts +0 -125
  717. package/node_modules/zod/src/v4/locales/ja.ts +0 -122
  718. package/node_modules/zod/src/v4/locales/kh.ts +0 -126
  719. package/node_modules/zod/src/v4/locales/ko.ts +0 -131
  720. package/node_modules/zod/src/v4/locales/mk.ts +0 -127
  721. package/node_modules/zod/src/v4/locales/ms.ts +0 -124
  722. package/node_modules/zod/src/v4/locales/nl.ts +0 -126
  723. package/node_modules/zod/src/v4/locales/no.ts +0 -124
  724. package/node_modules/zod/src/v4/locales/ota.ts +0 -125
  725. package/node_modules/zod/src/v4/locales/pl.ts +0 -126
  726. package/node_modules/zod/src/v4/locales/ps.ts +0 -133
  727. package/node_modules/zod/src/v4/locales/pt.ts +0 -123
  728. package/node_modules/zod/src/v4/locales/ru.ts +0 -184
  729. package/node_modules/zod/src/v4/locales/sl.ts +0 -126
  730. package/node_modules/zod/src/v4/locales/sv.ts +0 -127
  731. package/node_modules/zod/src/v4/locales/ta.ts +0 -125
  732. package/node_modules/zod/src/v4/locales/th.ts +0 -126
  733. package/node_modules/zod/src/v4/locales/tr.ts +0 -121
  734. package/node_modules/zod/src/v4/locales/ua.ts +0 -126
  735. package/node_modules/zod/src/v4/locales/ur.ts +0 -126
  736. package/node_modules/zod/src/v4/locales/vi.ts +0 -125
  737. package/node_modules/zod/src/v4/locales/zh-CN.ts +0 -123
  738. package/node_modules/zod/src/v4/locales/zh-TW.ts +0 -125
  739. package/node_modules/zod/src/v4/mini/checks.ts +0 -32
  740. package/node_modules/zod/src/v4/mini/coerce.ts +0 -22
  741. package/node_modules/zod/src/v4/mini/external.ts +0 -40
  742. package/node_modules/zod/src/v4/mini/index.ts +0 -3
  743. package/node_modules/zod/src/v4/mini/iso.ts +0 -62
  744. package/node_modules/zod/src/v4/mini/parse.ts +0 -1
  745. package/node_modules/zod/src/v4/mini/schemas.ts +0 -1579
  746. package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +0 -129
  747. package/node_modules/zod/src/v4/mini/tests/brand.test.ts +0 -51
  748. package/node_modules/zod/src/v4/mini/tests/checks.test.ts +0 -144
  749. package/node_modules/zod/src/v4/mini/tests/computed.test.ts +0 -36
  750. package/node_modules/zod/src/v4/mini/tests/error.test.ts +0 -22
  751. package/node_modules/zod/src/v4/mini/tests/functions.test.ts +0 -43
  752. package/node_modules/zod/src/v4/mini/tests/index.test.ts +0 -871
  753. package/node_modules/zod/src/v4/mini/tests/number.test.ts +0 -95
  754. package/node_modules/zod/src/v4/mini/tests/object.test.ts +0 -185
  755. package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +0 -43
  756. package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +0 -275
  757. package/node_modules/zod/src/v4/mini/tests/string.test.ts +0 -299
  758. package/node_modules/zod/src/v4-mini/index.ts +0 -1
  759. package/node_modules/zod/v3/ZodError.cjs +0 -138
  760. package/node_modules/zod/v3/ZodError.d.cts +0 -164
  761. package/node_modules/zod/v3/ZodError.d.ts +0 -164
  762. package/node_modules/zod/v3/ZodError.js +0 -133
  763. package/node_modules/zod/v3/errors.cjs +0 -17
  764. package/node_modules/zod/v3/errors.d.cts +0 -5
  765. package/node_modules/zod/v3/errors.d.ts +0 -5
  766. package/node_modules/zod/v3/errors.js +0 -9
  767. package/node_modules/zod/v3/external.cjs +0 -22
  768. package/node_modules/zod/v3/external.d.cts +0 -6
  769. package/node_modules/zod/v3/external.d.ts +0 -6
  770. package/node_modules/zod/v3/external.js +0 -6
  771. package/node_modules/zod/v3/helpers/enumUtil.cjs +0 -2
  772. package/node_modules/zod/v3/helpers/enumUtil.d.cts +0 -8
  773. package/node_modules/zod/v3/helpers/enumUtil.d.ts +0 -8
  774. package/node_modules/zod/v3/helpers/enumUtil.js +0 -1
  775. package/node_modules/zod/v3/helpers/errorUtil.cjs +0 -9
  776. package/node_modules/zod/v3/helpers/errorUtil.d.cts +0 -9
  777. package/node_modules/zod/v3/helpers/errorUtil.d.ts +0 -9
  778. package/node_modules/zod/v3/helpers/errorUtil.js +0 -6
  779. package/node_modules/zod/v3/helpers/parseUtil.cjs +0 -124
  780. package/node_modules/zod/v3/helpers/parseUtil.d.cts +0 -78
  781. package/node_modules/zod/v3/helpers/parseUtil.d.ts +0 -78
  782. package/node_modules/zod/v3/helpers/parseUtil.js +0 -109
  783. package/node_modules/zod/v3/helpers/partialUtil.cjs +0 -2
  784. package/node_modules/zod/v3/helpers/partialUtil.d.cts +0 -8
  785. package/node_modules/zod/v3/helpers/partialUtil.d.ts +0 -8
  786. package/node_modules/zod/v3/helpers/partialUtil.js +0 -1
  787. package/node_modules/zod/v3/helpers/typeAliases.cjs +0 -2
  788. package/node_modules/zod/v3/helpers/typeAliases.d.cts +0 -2
  789. package/node_modules/zod/v3/helpers/typeAliases.d.ts +0 -2
  790. package/node_modules/zod/v3/helpers/typeAliases.js +0 -1
  791. package/node_modules/zod/v3/helpers/util.cjs +0 -137
  792. package/node_modules/zod/v3/helpers/util.d.cts +0 -85
  793. package/node_modules/zod/v3/helpers/util.d.ts +0 -85
  794. package/node_modules/zod/v3/helpers/util.js +0 -133
  795. package/node_modules/zod/v3/index.cjs +0 -33
  796. package/node_modules/zod/v3/index.d.cts +0 -4
  797. package/node_modules/zod/v3/index.d.ts +0 -4
  798. package/node_modules/zod/v3/index.js +0 -4
  799. package/node_modules/zod/v3/locales/en.cjs +0 -111
  800. package/node_modules/zod/v3/locales/en.d.cts +0 -3
  801. package/node_modules/zod/v3/locales/en.d.ts +0 -3
  802. package/node_modules/zod/v3/locales/en.js +0 -109
  803. package/node_modules/zod/v3/standard-schema.cjs +0 -2
  804. package/node_modules/zod/v3/standard-schema.d.cts +0 -102
  805. package/node_modules/zod/v3/standard-schema.d.ts +0 -102
  806. package/node_modules/zod/v3/standard-schema.js +0 -1
  807. package/node_modules/zod/v3/types.cjs +0 -3775
  808. package/node_modules/zod/v3/types.d.cts +0 -1031
  809. package/node_modules/zod/v3/types.d.ts +0 -1031
  810. package/node_modules/zod/v3/types.js +0 -3693
  811. package/node_modules/zod/v4/classic/checks.cjs +0 -32
  812. package/node_modules/zod/v4/classic/checks.d.cts +0 -1
  813. package/node_modules/zod/v4/classic/checks.d.ts +0 -1
  814. package/node_modules/zod/v4/classic/checks.js +0 -1
  815. package/node_modules/zod/v4/classic/coerce.cjs +0 -47
  816. package/node_modules/zod/v4/classic/coerce.d.cts +0 -17
  817. package/node_modules/zod/v4/classic/coerce.d.ts +0 -17
  818. package/node_modules/zod/v4/classic/coerce.js +0 -17
  819. package/node_modules/zod/v4/classic/compat.cjs +0 -57
  820. package/node_modules/zod/v4/classic/compat.d.cts +0 -46
  821. package/node_modules/zod/v4/classic/compat.d.ts +0 -46
  822. package/node_modules/zod/v4/classic/compat.js +0 -27
  823. package/node_modules/zod/v4/classic/errors.cjs +0 -67
  824. package/node_modules/zod/v4/classic/errors.d.cts +0 -30
  825. package/node_modules/zod/v4/classic/errors.d.ts +0 -30
  826. package/node_modules/zod/v4/classic/errors.js +0 -41
  827. package/node_modules/zod/v4/classic/external.cjs +0 -70
  828. package/node_modules/zod/v4/classic/external.d.cts +0 -13
  829. package/node_modules/zod/v4/classic/external.d.ts +0 -13
  830. package/node_modules/zod/v4/classic/external.js +0 -18
  831. package/node_modules/zod/v4/classic/index.cjs +0 -33
  832. package/node_modules/zod/v4/classic/index.d.cts +0 -4
  833. package/node_modules/zod/v4/classic/index.d.ts +0 -4
  834. package/node_modules/zod/v4/classic/index.js +0 -4
  835. package/node_modules/zod/v4/classic/iso.cjs +0 -60
  836. package/node_modules/zod/v4/classic/iso.d.cts +0 -22
  837. package/node_modules/zod/v4/classic/iso.d.ts +0 -22
  838. package/node_modules/zod/v4/classic/iso.js +0 -30
  839. package/node_modules/zod/v4/classic/parse.cjs +0 -32
  840. package/node_modules/zod/v4/classic/parse.d.cts +0 -23
  841. package/node_modules/zod/v4/classic/parse.d.ts +0 -23
  842. package/node_modules/zod/v4/classic/parse.js +0 -6
  843. package/node_modules/zod/v4/classic/schemas.cjs +0 -1109
  844. package/node_modules/zod/v4/classic/schemas.d.cts +0 -630
  845. package/node_modules/zod/v4/classic/schemas.d.ts +0 -630
  846. package/node_modules/zod/v4/classic/schemas.js +0 -1006
  847. package/node_modules/zod/v4/core/api.cjs +0 -1039
  848. package/node_modules/zod/v4/core/api.d.cts +0 -284
  849. package/node_modules/zod/v4/core/api.d.ts +0 -284
  850. package/node_modules/zod/v4/core/api.js +0 -906
  851. package/node_modules/zod/v4/core/checks.cjs +0 -591
  852. package/node_modules/zod/v4/core/checks.d.cts +0 -278
  853. package/node_modules/zod/v4/core/checks.d.ts +0 -278
  854. package/node_modules/zod/v4/core/checks.js +0 -565
  855. package/node_modules/zod/v4/core/core.cjs +0 -67
  856. package/node_modules/zod/v4/core/core.d.cts +0 -49
  857. package/node_modules/zod/v4/core/core.d.ts +0 -49
  858. package/node_modules/zod/v4/core/core.js +0 -61
  859. package/node_modules/zod/v4/core/doc.cjs +0 -39
  860. package/node_modules/zod/v4/core/doc.d.cts +0 -14
  861. package/node_modules/zod/v4/core/doc.d.ts +0 -14
  862. package/node_modules/zod/v4/core/doc.js +0 -35
  863. package/node_modules/zod/v4/core/errors.cjs +0 -226
  864. package/node_modules/zod/v4/core/errors.d.cts +0 -208
  865. package/node_modules/zod/v4/core/errors.d.ts +0 -208
  866. package/node_modules/zod/v4/core/errors.js +0 -195
  867. package/node_modules/zod/v4/core/function.cjs +0 -102
  868. package/node_modules/zod/v4/core/function.d.cts +0 -52
  869. package/node_modules/zod/v4/core/function.d.ts +0 -52
  870. package/node_modules/zod/v4/core/function.js +0 -75
  871. package/node_modules/zod/v4/core/index.cjs +0 -44
  872. package/node_modules/zod/v4/core/index.d.cts +0 -15
  873. package/node_modules/zod/v4/core/index.d.ts +0 -15
  874. package/node_modules/zod/v4/core/index.js +0 -15
  875. package/node_modules/zod/v4/core/json-schema.cjs +0 -2
  876. package/node_modules/zod/v4/core/json-schema.d.cts +0 -87
  877. package/node_modules/zod/v4/core/json-schema.d.ts +0 -87
  878. package/node_modules/zod/v4/core/json-schema.js +0 -1
  879. package/node_modules/zod/v4/core/parse.cjs +0 -87
  880. package/node_modules/zod/v4/core/parse.d.cts +0 -25
  881. package/node_modules/zod/v4/core/parse.d.ts +0 -25
  882. package/node_modules/zod/v4/core/parse.js +0 -57
  883. package/node_modules/zod/v4/core/regexes.cjs +0 -103
  884. package/node_modules/zod/v4/core/regexes.d.cts +0 -62
  885. package/node_modules/zod/v4/core/regexes.d.ts +0 -62
  886. package/node_modules/zod/v4/core/regexes.js +0 -95
  887. package/node_modules/zod/v4/core/registries.cjs +0 -56
  888. package/node_modules/zod/v4/core/registries.d.cts +0 -35
  889. package/node_modules/zod/v4/core/registries.d.ts +0 -35
  890. package/node_modules/zod/v4/core/registries.js +0 -51
  891. package/node_modules/zod/v4/core/schemas.cjs +0 -1748
  892. package/node_modules/zod/v4/core/schemas.d.cts +0 -1041
  893. package/node_modules/zod/v4/core/schemas.d.ts +0 -1041
  894. package/node_modules/zod/v4/core/schemas.js +0 -1717
  895. package/node_modules/zod/v4/core/standard-schema.cjs +0 -2
  896. package/node_modules/zod/v4/core/standard-schema.d.cts +0 -55
  897. package/node_modules/zod/v4/core/standard-schema.d.ts +0 -55
  898. package/node_modules/zod/v4/core/standard-schema.js +0 -1
  899. package/node_modules/zod/v4/core/to-json-schema.cjs +0 -854
  900. package/node_modules/zod/v4/core/to-json-schema.d.cts +0 -88
  901. package/node_modules/zod/v4/core/to-json-schema.d.ts +0 -88
  902. package/node_modules/zod/v4/core/to-json-schema.js +0 -849
  903. package/node_modules/zod/v4/core/util.cjs +0 -539
  904. package/node_modules/zod/v4/core/util.d.cts +0 -183
  905. package/node_modules/zod/v4/core/util.d.ts +0 -183
  906. package/node_modules/zod/v4/core/util.js +0 -493
  907. package/node_modules/zod/v4/core/versions.cjs +0 -8
  908. package/node_modules/zod/v4/core/versions.d.cts +0 -5
  909. package/node_modules/zod/v4/core/versions.d.ts +0 -5
  910. package/node_modules/zod/v4/core/versions.js +0 -5
  911. package/node_modules/zod/v4/index.cjs +0 -22
  912. package/node_modules/zod/v4/index.d.cts +0 -3
  913. package/node_modules/zod/v4/index.d.ts +0 -3
  914. package/node_modules/zod/v4/index.js +0 -3
  915. package/node_modules/zod/v4/locales/ar.cjs +0 -142
  916. package/node_modules/zod/v4/locales/ar.d.cts +0 -4
  917. package/node_modules/zod/v4/locales/ar.d.ts +0 -4
  918. package/node_modules/zod/v4/locales/ar.js +0 -116
  919. package/node_modules/zod/v4/locales/az.cjs +0 -141
  920. package/node_modules/zod/v4/locales/az.d.cts +0 -4
  921. package/node_modules/zod/v4/locales/az.d.ts +0 -4
  922. package/node_modules/zod/v4/locales/az.js +0 -115
  923. package/node_modules/zod/v4/locales/be.cjs +0 -190
  924. package/node_modules/zod/v4/locales/be.d.cts +0 -4
  925. package/node_modules/zod/v4/locales/be.d.ts +0 -4
  926. package/node_modules/zod/v4/locales/be.js +0 -164
  927. package/node_modules/zod/v4/locales/ca.cjs +0 -144
  928. package/node_modules/zod/v4/locales/ca.d.cts +0 -4
  929. package/node_modules/zod/v4/locales/ca.d.ts +0 -4
  930. package/node_modules/zod/v4/locales/ca.js +0 -118
  931. package/node_modules/zod/v4/locales/cs.cjs +0 -161
  932. package/node_modules/zod/v4/locales/cs.d.cts +0 -4
  933. package/node_modules/zod/v4/locales/cs.d.ts +0 -4
  934. package/node_modules/zod/v4/locales/cs.js +0 -135
  935. package/node_modules/zod/v4/locales/de.cjs +0 -142
  936. package/node_modules/zod/v4/locales/de.d.cts +0 -4
  937. package/node_modules/zod/v4/locales/de.d.ts +0 -4
  938. package/node_modules/zod/v4/locales/de.js +0 -116
  939. package/node_modules/zod/v4/locales/en.cjs +0 -145
  940. package/node_modules/zod/v4/locales/en.d.cts +0 -5
  941. package/node_modules/zod/v4/locales/en.d.ts +0 -5
  942. package/node_modules/zod/v4/locales/en.js +0 -117
  943. package/node_modules/zod/v4/locales/eo.cjs +0 -144
  944. package/node_modules/zod/v4/locales/eo.d.cts +0 -5
  945. package/node_modules/zod/v4/locales/eo.d.ts +0 -5
  946. package/node_modules/zod/v4/locales/eo.js +0 -116
  947. package/node_modules/zod/v4/locales/es.cjs +0 -143
  948. package/node_modules/zod/v4/locales/es.d.cts +0 -4
  949. package/node_modules/zod/v4/locales/es.d.ts +0 -4
  950. package/node_modules/zod/v4/locales/es.js +0 -117
  951. package/node_modules/zod/v4/locales/fa.cjs +0 -148
  952. package/node_modules/zod/v4/locales/fa.d.cts +0 -4
  953. package/node_modules/zod/v4/locales/fa.d.ts +0 -4
  954. package/node_modules/zod/v4/locales/fa.js +0 -122
  955. package/node_modules/zod/v4/locales/fi.cjs +0 -148
  956. package/node_modules/zod/v4/locales/fi.d.cts +0 -4
  957. package/node_modules/zod/v4/locales/fi.d.ts +0 -4
  958. package/node_modules/zod/v4/locales/fi.js +0 -122
  959. package/node_modules/zod/v4/locales/fr-CA.cjs +0 -143
  960. package/node_modules/zod/v4/locales/fr-CA.d.cts +0 -4
  961. package/node_modules/zod/v4/locales/fr-CA.d.ts +0 -4
  962. package/node_modules/zod/v4/locales/fr-CA.js +0 -117
  963. package/node_modules/zod/v4/locales/fr.cjs +0 -142
  964. package/node_modules/zod/v4/locales/fr.d.cts +0 -4
  965. package/node_modules/zod/v4/locales/fr.d.ts +0 -4
  966. package/node_modules/zod/v4/locales/fr.js +0 -116
  967. package/node_modules/zod/v4/locales/he.cjs +0 -143
  968. package/node_modules/zod/v4/locales/he.d.cts +0 -4
  969. package/node_modules/zod/v4/locales/he.d.ts +0 -4
  970. package/node_modules/zod/v4/locales/he.js +0 -117
  971. package/node_modules/zod/v4/locales/hu.cjs +0 -143
  972. package/node_modules/zod/v4/locales/hu.d.cts +0 -4
  973. package/node_modules/zod/v4/locales/hu.d.ts +0 -4
  974. package/node_modules/zod/v4/locales/hu.js +0 -117
  975. package/node_modules/zod/v4/locales/id.cjs +0 -142
  976. package/node_modules/zod/v4/locales/id.d.cts +0 -4
  977. package/node_modules/zod/v4/locales/id.d.ts +0 -4
  978. package/node_modules/zod/v4/locales/id.js +0 -116
  979. package/node_modules/zod/v4/locales/index.cjs +0 -84
  980. package/node_modules/zod/v4/locales/index.d.cts +0 -39
  981. package/node_modules/zod/v4/locales/index.d.ts +0 -39
  982. package/node_modules/zod/v4/locales/index.js +0 -39
  983. package/node_modules/zod/v4/locales/it.cjs +0 -143
  984. package/node_modules/zod/v4/locales/it.d.cts +0 -4
  985. package/node_modules/zod/v4/locales/it.d.ts +0 -4
  986. package/node_modules/zod/v4/locales/it.js +0 -117
  987. package/node_modules/zod/v4/locales/ja.cjs +0 -141
  988. package/node_modules/zod/v4/locales/ja.d.cts +0 -4
  989. package/node_modules/zod/v4/locales/ja.d.ts +0 -4
  990. package/node_modules/zod/v4/locales/ja.js +0 -115
  991. package/node_modules/zod/v4/locales/kh.cjs +0 -143
  992. package/node_modules/zod/v4/locales/kh.d.cts +0 -4
  993. package/node_modules/zod/v4/locales/kh.d.ts +0 -4
  994. package/node_modules/zod/v4/locales/kh.js +0 -117
  995. package/node_modules/zod/v4/locales/ko.cjs +0 -147
  996. package/node_modules/zod/v4/locales/ko.d.cts +0 -4
  997. package/node_modules/zod/v4/locales/ko.d.ts +0 -4
  998. package/node_modules/zod/v4/locales/ko.js +0 -121
  999. package/node_modules/zod/v4/locales/mk.cjs +0 -144
  1000. package/node_modules/zod/v4/locales/mk.d.cts +0 -4
  1001. package/node_modules/zod/v4/locales/mk.d.ts +0 -4
  1002. package/node_modules/zod/v4/locales/mk.js +0 -118
  1003. package/node_modules/zod/v4/locales/ms.cjs +0 -142
  1004. package/node_modules/zod/v4/locales/ms.d.cts +0 -4
  1005. package/node_modules/zod/v4/locales/ms.d.ts +0 -4
  1006. package/node_modules/zod/v4/locales/ms.js +0 -116
  1007. package/node_modules/zod/v4/locales/nl.cjs +0 -143
  1008. package/node_modules/zod/v4/locales/nl.d.cts +0 -4
  1009. package/node_modules/zod/v4/locales/nl.d.ts +0 -4
  1010. package/node_modules/zod/v4/locales/nl.js +0 -117
  1011. package/node_modules/zod/v4/locales/no.cjs +0 -142
  1012. package/node_modules/zod/v4/locales/no.d.cts +0 -4
  1013. package/node_modules/zod/v4/locales/no.d.ts +0 -4
  1014. package/node_modules/zod/v4/locales/no.js +0 -116
  1015. package/node_modules/zod/v4/locales/ota.cjs +0 -143
  1016. package/node_modules/zod/v4/locales/ota.d.cts +0 -4
  1017. package/node_modules/zod/v4/locales/ota.d.ts +0 -4
  1018. package/node_modules/zod/v4/locales/ota.js +0 -117
  1019. package/node_modules/zod/v4/locales/pl.cjs +0 -143
  1020. package/node_modules/zod/v4/locales/pl.d.cts +0 -4
  1021. package/node_modules/zod/v4/locales/pl.d.ts +0 -4
  1022. package/node_modules/zod/v4/locales/pl.js +0 -117
  1023. package/node_modules/zod/v4/locales/ps.cjs +0 -148
  1024. package/node_modules/zod/v4/locales/ps.d.cts +0 -4
  1025. package/node_modules/zod/v4/locales/ps.d.ts +0 -4
  1026. package/node_modules/zod/v4/locales/ps.js +0 -122
  1027. package/node_modules/zod/v4/locales/pt.cjs +0 -142
  1028. package/node_modules/zod/v4/locales/pt.d.cts +0 -4
  1029. package/node_modules/zod/v4/locales/pt.d.ts +0 -4
  1030. package/node_modules/zod/v4/locales/pt.js +0 -116
  1031. package/node_modules/zod/v4/locales/ru.cjs +0 -190
  1032. package/node_modules/zod/v4/locales/ru.d.cts +0 -4
  1033. package/node_modules/zod/v4/locales/ru.d.ts +0 -4
  1034. package/node_modules/zod/v4/locales/ru.js +0 -164
  1035. package/node_modules/zod/v4/locales/sl.cjs +0 -143
  1036. package/node_modules/zod/v4/locales/sl.d.cts +0 -4
  1037. package/node_modules/zod/v4/locales/sl.d.ts +0 -4
  1038. package/node_modules/zod/v4/locales/sl.js +0 -117
  1039. package/node_modules/zod/v4/locales/sv.cjs +0 -144
  1040. package/node_modules/zod/v4/locales/sv.d.cts +0 -4
  1041. package/node_modules/zod/v4/locales/sv.d.ts +0 -4
  1042. package/node_modules/zod/v4/locales/sv.js +0 -118
  1043. package/node_modules/zod/v4/locales/ta.cjs +0 -143
  1044. package/node_modules/zod/v4/locales/ta.d.cts +0 -4
  1045. package/node_modules/zod/v4/locales/ta.d.ts +0 -4
  1046. package/node_modules/zod/v4/locales/ta.js +0 -117
  1047. package/node_modules/zod/v4/locales/th.cjs +0 -143
  1048. package/node_modules/zod/v4/locales/th.d.cts +0 -4
  1049. package/node_modules/zod/v4/locales/th.d.ts +0 -4
  1050. package/node_modules/zod/v4/locales/th.js +0 -117
  1051. package/node_modules/zod/v4/locales/tr.cjs +0 -143
  1052. package/node_modules/zod/v4/locales/tr.d.cts +0 -5
  1053. package/node_modules/zod/v4/locales/tr.d.ts +0 -5
  1054. package/node_modules/zod/v4/locales/tr.js +0 -115
  1055. package/node_modules/zod/v4/locales/ua.cjs +0 -143
  1056. package/node_modules/zod/v4/locales/ua.d.cts +0 -4
  1057. package/node_modules/zod/v4/locales/ua.d.ts +0 -4
  1058. package/node_modules/zod/v4/locales/ua.js +0 -117
  1059. package/node_modules/zod/v4/locales/ur.cjs +0 -143
  1060. package/node_modules/zod/v4/locales/ur.d.cts +0 -4
  1061. package/node_modules/zod/v4/locales/ur.d.ts +0 -4
  1062. package/node_modules/zod/v4/locales/ur.js +0 -117
  1063. package/node_modules/zod/v4/locales/vi.cjs +0 -142
  1064. package/node_modules/zod/v4/locales/vi.d.cts +0 -4
  1065. package/node_modules/zod/v4/locales/vi.d.ts +0 -4
  1066. package/node_modules/zod/v4/locales/vi.js +0 -116
  1067. package/node_modules/zod/v4/locales/zh-CN.cjs +0 -142
  1068. package/node_modules/zod/v4/locales/zh-CN.d.cts +0 -4
  1069. package/node_modules/zod/v4/locales/zh-CN.d.ts +0 -4
  1070. package/node_modules/zod/v4/locales/zh-CN.js +0 -116
  1071. package/node_modules/zod/v4/locales/zh-TW.cjs +0 -143
  1072. package/node_modules/zod/v4/locales/zh-TW.d.cts +0 -4
  1073. package/node_modules/zod/v4/locales/zh-TW.d.ts +0 -4
  1074. package/node_modules/zod/v4/locales/zh-TW.js +0 -117
  1075. package/node_modules/zod/v4/mini/checks.cjs +0 -34
  1076. package/node_modules/zod/v4/mini/checks.d.cts +0 -1
  1077. package/node_modules/zod/v4/mini/checks.d.ts +0 -1
  1078. package/node_modules/zod/v4/mini/checks.js +0 -1
  1079. package/node_modules/zod/v4/mini/coerce.cjs +0 -47
  1080. package/node_modules/zod/v4/mini/coerce.d.cts +0 -7
  1081. package/node_modules/zod/v4/mini/coerce.d.ts +0 -7
  1082. package/node_modules/zod/v4/mini/coerce.js +0 -17
  1083. package/node_modules/zod/v4/mini/external.cjs +0 -62
  1084. package/node_modules/zod/v4/mini/external.d.cts +0 -11
  1085. package/node_modules/zod/v4/mini/external.d.ts +0 -11
  1086. package/node_modules/zod/v4/mini/external.js +0 -13
  1087. package/node_modules/zod/v4/mini/index.cjs +0 -32
  1088. package/node_modules/zod/v4/mini/index.d.cts +0 -3
  1089. package/node_modules/zod/v4/mini/index.d.ts +0 -3
  1090. package/node_modules/zod/v4/mini/index.js +0 -3
  1091. package/node_modules/zod/v4/mini/iso.cjs +0 -60
  1092. package/node_modules/zod/v4/mini/iso.d.cts +0 -22
  1093. package/node_modules/zod/v4/mini/iso.d.ts +0 -22
  1094. package/node_modules/zod/v4/mini/iso.js +0 -30
  1095. package/node_modules/zod/v4/mini/parse.cjs +0 -8
  1096. package/node_modules/zod/v4/mini/parse.d.cts +0 -1
  1097. package/node_modules/zod/v4/mini/parse.d.ts +0 -1
  1098. package/node_modules/zod/v4/mini/parse.js +0 -1
  1099. package/node_modules/zod/v4/mini/schemas.cjs +0 -839
  1100. package/node_modules/zod/v4/mini/schemas.d.cts +0 -356
  1101. package/node_modules/zod/v4/mini/schemas.d.ts +0 -356
  1102. package/node_modules/zod/v4/mini/schemas.js +0 -732
  1103. package/node_modules/zod/v4-mini/index.cjs +0 -17
  1104. package/node_modules/zod/v4-mini/index.d.cts +0 -1
  1105. package/node_modules/zod/v4-mini/index.d.ts +0 -1
  1106. package/node_modules/zod/v4-mini/index.js +0 -1
  1107. package/src/lib/insforge-client.js +0 -79
  1108. package/src/lib/insforge.js +0 -29
  1109. package/src/lib/uploader.js +0 -224
  1110. package/src/lib/vibeusage-api.js +0 -243
  1111. package/src/lib/vibeusage-public-repo.js +0 -105
@@ -1,2968 +0,0 @@
1
- /*!
2
- * Engine.IO v6.6.3
3
- * (c) 2014-2025 Guillermo Rauch
4
- * Released under the MIT License.
5
- */
6
- (function (global, factory) {
7
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
8
- typeof define === 'function' && define.amd ? define(factory) :
9
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.eio = factory());
10
- })(this, (function () { 'use strict';
11
-
12
- function _arrayLikeToArray(r, a) {
13
- (null == a || a > r.length) && (a = r.length);
14
- for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
15
- return n;
16
- }
17
- function _arrayWithoutHoles(r) {
18
- if (Array.isArray(r)) return _arrayLikeToArray(r);
19
- }
20
- function _construct(t, e, r) {
21
- if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
22
- var o = [null];
23
- o.push.apply(o, e);
24
- var p = new (t.bind.apply(t, o))();
25
- return r && _setPrototypeOf(p, r.prototype), p;
26
- }
27
- function _defineProperties(e, r) {
28
- for (var t = 0; t < r.length; t++) {
29
- var o = r[t];
30
- o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
31
- }
32
- }
33
- function _createClass(e, r, t) {
34
- return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
35
- writable: !1
36
- }), e;
37
- }
38
- function _extends() {
39
- return _extends = Object.assign ? Object.assign.bind() : function (n) {
40
- for (var e = 1; e < arguments.length; e++) {
41
- var t = arguments[e];
42
- for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
43
- }
44
- return n;
45
- }, _extends.apply(null, arguments);
46
- }
47
- function _getPrototypeOf(t) {
48
- return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
49
- return t.__proto__ || Object.getPrototypeOf(t);
50
- }, _getPrototypeOf(t);
51
- }
52
- function _inheritsLoose(t, o) {
53
- t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
54
- }
55
- function _isNativeFunction(t) {
56
- try {
57
- return -1 !== Function.toString.call(t).indexOf("[native code]");
58
- } catch (n) {
59
- return "function" == typeof t;
60
- }
61
- }
62
- function _isNativeReflectConstruct() {
63
- try {
64
- var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
65
- } catch (t) {}
66
- return (_isNativeReflectConstruct = function () {
67
- return !!t;
68
- })();
69
- }
70
- function _iterableToArray(r) {
71
- if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
72
- }
73
- function _nonIterableSpread() {
74
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
75
- }
76
- function _setPrototypeOf(t, e) {
77
- return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
78
- return t.__proto__ = e, t;
79
- }, _setPrototypeOf(t, e);
80
- }
81
- function _toConsumableArray(r) {
82
- return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
83
- }
84
- function _toPrimitive(t, r) {
85
- if ("object" != typeof t || !t) return t;
86
- var e = t[Symbol.toPrimitive];
87
- if (void 0 !== e) {
88
- var i = e.call(t, r || "default");
89
- if ("object" != typeof i) return i;
90
- throw new TypeError("@@toPrimitive must return a primitive value.");
91
- }
92
- return ("string" === r ? String : Number)(t);
93
- }
94
- function _toPropertyKey(t) {
95
- var i = _toPrimitive(t, "string");
96
- return "symbol" == typeof i ? i : i + "";
97
- }
98
- function _typeof(o) {
99
- "@babel/helpers - typeof";
100
-
101
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
102
- return typeof o;
103
- } : function (o) {
104
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
105
- }, _typeof(o);
106
- }
107
- function _unsupportedIterableToArray(r, a) {
108
- if (r) {
109
- if ("string" == typeof r) return _arrayLikeToArray(r, a);
110
- var t = {}.toString.call(r).slice(8, -1);
111
- return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
112
- }
113
- }
114
- function _wrapNativeSuper(t) {
115
- var r = "function" == typeof Map ? new Map() : void 0;
116
- return _wrapNativeSuper = function (t) {
117
- if (null === t || !_isNativeFunction(t)) return t;
118
- if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
119
- if (void 0 !== r) {
120
- if (r.has(t)) return r.get(t);
121
- r.set(t, Wrapper);
122
- }
123
- function Wrapper() {
124
- return _construct(t, arguments, _getPrototypeOf(this).constructor);
125
- }
126
- return Wrapper.prototype = Object.create(t.prototype, {
127
- constructor: {
128
- value: Wrapper,
129
- enumerable: !1,
130
- writable: !0,
131
- configurable: !0
132
- }
133
- }), _setPrototypeOf(Wrapper, t);
134
- }, _wrapNativeSuper(t);
135
- }
136
-
137
- var PACKET_TYPES = Object.create(null); // no Map = no polyfill
138
- PACKET_TYPES["open"] = "0";
139
- PACKET_TYPES["close"] = "1";
140
- PACKET_TYPES["ping"] = "2";
141
- PACKET_TYPES["pong"] = "3";
142
- PACKET_TYPES["message"] = "4";
143
- PACKET_TYPES["upgrade"] = "5";
144
- PACKET_TYPES["noop"] = "6";
145
- var PACKET_TYPES_REVERSE = Object.create(null);
146
- Object.keys(PACKET_TYPES).forEach(function (key) {
147
- PACKET_TYPES_REVERSE[PACKET_TYPES[key]] = key;
148
- });
149
- var ERROR_PACKET = {
150
- type: "error",
151
- data: "parser error"
152
- };
153
-
154
- var withNativeBlob = typeof Blob === "function" || typeof Blob !== "undefined" && Object.prototype.toString.call(Blob) === "[object BlobConstructor]";
155
- var withNativeArrayBuffer$1 = typeof ArrayBuffer === "function";
156
- // ArrayBuffer.isView method is not defined in IE10
157
- var isView = function isView(obj) {
158
- return typeof ArrayBuffer.isView === "function" ? ArrayBuffer.isView(obj) : obj && obj.buffer instanceof ArrayBuffer;
159
- };
160
- var encodePacket = function encodePacket(_ref, supportsBinary, callback) {
161
- var type = _ref.type,
162
- data = _ref.data;
163
- if (withNativeBlob && data instanceof Blob) {
164
- if (supportsBinary) {
165
- return callback(data);
166
- } else {
167
- return encodeBlobAsBase64(data, callback);
168
- }
169
- } else if (withNativeArrayBuffer$1 && (data instanceof ArrayBuffer || isView(data))) {
170
- if (supportsBinary) {
171
- return callback(data);
172
- } else {
173
- return encodeBlobAsBase64(new Blob([data]), callback);
174
- }
175
- }
176
- // plain string
177
- return callback(PACKET_TYPES[type] + (data || ""));
178
- };
179
- var encodeBlobAsBase64 = function encodeBlobAsBase64(data, callback) {
180
- var fileReader = new FileReader();
181
- fileReader.onload = function () {
182
- var content = fileReader.result.split(",")[1];
183
- callback("b" + (content || ""));
184
- };
185
- return fileReader.readAsDataURL(data);
186
- };
187
- function toArray(data) {
188
- if (data instanceof Uint8Array) {
189
- return data;
190
- } else if (data instanceof ArrayBuffer) {
191
- return new Uint8Array(data);
192
- } else {
193
- return new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
194
- }
195
- }
196
- var TEXT_ENCODER;
197
- function encodePacketToBinary(packet, callback) {
198
- if (withNativeBlob && packet.data instanceof Blob) {
199
- return packet.data.arrayBuffer().then(toArray).then(callback);
200
- } else if (withNativeArrayBuffer$1 && (packet.data instanceof ArrayBuffer || isView(packet.data))) {
201
- return callback(toArray(packet.data));
202
- }
203
- encodePacket(packet, false, function (encoded) {
204
- if (!TEXT_ENCODER) {
205
- TEXT_ENCODER = new TextEncoder();
206
- }
207
- callback(TEXT_ENCODER.encode(encoded));
208
- });
209
- }
210
-
211
- // imported from https://github.com/socketio/base64-arraybuffer
212
- var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
213
- // Use a lookup table to find the index.
214
- var lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);
215
- for (var i = 0; i < chars.length; i++) {
216
- lookup[chars.charCodeAt(i)] = i;
217
- }
218
- var decode$1 = function decode(base64) {
219
- var bufferLength = base64.length * 0.75,
220
- len = base64.length,
221
- i,
222
- p = 0,
223
- encoded1,
224
- encoded2,
225
- encoded3,
226
- encoded4;
227
- if (base64[base64.length - 1] === '=') {
228
- bufferLength--;
229
- if (base64[base64.length - 2] === '=') {
230
- bufferLength--;
231
- }
232
- }
233
- var arraybuffer = new ArrayBuffer(bufferLength),
234
- bytes = new Uint8Array(arraybuffer);
235
- for (i = 0; i < len; i += 4) {
236
- encoded1 = lookup[base64.charCodeAt(i)];
237
- encoded2 = lookup[base64.charCodeAt(i + 1)];
238
- encoded3 = lookup[base64.charCodeAt(i + 2)];
239
- encoded4 = lookup[base64.charCodeAt(i + 3)];
240
- bytes[p++] = encoded1 << 2 | encoded2 >> 4;
241
- bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2;
242
- bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63;
243
- }
244
- return arraybuffer;
245
- };
246
-
247
- var withNativeArrayBuffer = typeof ArrayBuffer === "function";
248
- var decodePacket = function decodePacket(encodedPacket, binaryType) {
249
- if (typeof encodedPacket !== "string") {
250
- return {
251
- type: "message",
252
- data: mapBinary(encodedPacket, binaryType)
253
- };
254
- }
255
- var type = encodedPacket.charAt(0);
256
- if (type === "b") {
257
- return {
258
- type: "message",
259
- data: decodeBase64Packet(encodedPacket.substring(1), binaryType)
260
- };
261
- }
262
- var packetType = PACKET_TYPES_REVERSE[type];
263
- if (!packetType) {
264
- return ERROR_PACKET;
265
- }
266
- return encodedPacket.length > 1 ? {
267
- type: PACKET_TYPES_REVERSE[type],
268
- data: encodedPacket.substring(1)
269
- } : {
270
- type: PACKET_TYPES_REVERSE[type]
271
- };
272
- };
273
- var decodeBase64Packet = function decodeBase64Packet(data, binaryType) {
274
- if (withNativeArrayBuffer) {
275
- var decoded = decode$1(data);
276
- return mapBinary(decoded, binaryType);
277
- } else {
278
- return {
279
- base64: true,
280
- data: data
281
- }; // fallback for old browsers
282
- }
283
- };
284
- var mapBinary = function mapBinary(data, binaryType) {
285
- switch (binaryType) {
286
- case "blob":
287
- if (data instanceof Blob) {
288
- // from WebSocket + binaryType "blob"
289
- return data;
290
- } else {
291
- // from HTTP long-polling or WebTransport
292
- return new Blob([data]);
293
- }
294
- case "arraybuffer":
295
- default:
296
- if (data instanceof ArrayBuffer) {
297
- // from HTTP long-polling (base64) or WebSocket + binaryType "arraybuffer"
298
- return data;
299
- } else {
300
- // from WebTransport (Uint8Array)
301
- return data.buffer;
302
- }
303
- }
304
- };
305
-
306
- var SEPARATOR = String.fromCharCode(30); // see https://en.wikipedia.org/wiki/Delimiter#ASCII_delimited_text
307
- var encodePayload = function encodePayload(packets, callback) {
308
- // some packets may be added to the array while encoding, so the initial length must be saved
309
- var length = packets.length;
310
- var encodedPackets = new Array(length);
311
- var count = 0;
312
- packets.forEach(function (packet, i) {
313
- // force base64 encoding for binary packets
314
- encodePacket(packet, false, function (encodedPacket) {
315
- encodedPackets[i] = encodedPacket;
316
- if (++count === length) {
317
- callback(encodedPackets.join(SEPARATOR));
318
- }
319
- });
320
- });
321
- };
322
- var decodePayload = function decodePayload(encodedPayload, binaryType) {
323
- var encodedPackets = encodedPayload.split(SEPARATOR);
324
- var packets = [];
325
- for (var i = 0; i < encodedPackets.length; i++) {
326
- var decodedPacket = decodePacket(encodedPackets[i], binaryType);
327
- packets.push(decodedPacket);
328
- if (decodedPacket.type === "error") {
329
- break;
330
- }
331
- }
332
- return packets;
333
- };
334
- function createPacketEncoderStream() {
335
- return new TransformStream({
336
- transform: function transform(packet, controller) {
337
- encodePacketToBinary(packet, function (encodedPacket) {
338
- var payloadLength = encodedPacket.length;
339
- var header;
340
- // inspired by the WebSocket format: https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_servers#decoding_payload_length
341
- if (payloadLength < 126) {
342
- header = new Uint8Array(1);
343
- new DataView(header.buffer).setUint8(0, payloadLength);
344
- } else if (payloadLength < 65536) {
345
- header = new Uint8Array(3);
346
- var view = new DataView(header.buffer);
347
- view.setUint8(0, 126);
348
- view.setUint16(1, payloadLength);
349
- } else {
350
- header = new Uint8Array(9);
351
- var _view = new DataView(header.buffer);
352
- _view.setUint8(0, 127);
353
- _view.setBigUint64(1, BigInt(payloadLength));
354
- }
355
- // first bit indicates whether the payload is plain text (0) or binary (1)
356
- if (packet.data && typeof packet.data !== "string") {
357
- header[0] |= 0x80;
358
- }
359
- controller.enqueue(header);
360
- controller.enqueue(encodedPacket);
361
- });
362
- }
363
- });
364
- }
365
- var TEXT_DECODER;
366
- function totalLength(chunks) {
367
- return chunks.reduce(function (acc, chunk) {
368
- return acc + chunk.length;
369
- }, 0);
370
- }
371
- function concatChunks(chunks, size) {
372
- if (chunks[0].length === size) {
373
- return chunks.shift();
374
- }
375
- var buffer = new Uint8Array(size);
376
- var j = 0;
377
- for (var i = 0; i < size; i++) {
378
- buffer[i] = chunks[0][j++];
379
- if (j === chunks[0].length) {
380
- chunks.shift();
381
- j = 0;
382
- }
383
- }
384
- if (chunks.length && j < chunks[0].length) {
385
- chunks[0] = chunks[0].slice(j);
386
- }
387
- return buffer;
388
- }
389
- function createPacketDecoderStream(maxPayload, binaryType) {
390
- if (!TEXT_DECODER) {
391
- TEXT_DECODER = new TextDecoder();
392
- }
393
- var chunks = [];
394
- var state = 0 /* State.READ_HEADER */;
395
- var expectedLength = -1;
396
- var isBinary = false;
397
- return new TransformStream({
398
- transform: function transform(chunk, controller) {
399
- chunks.push(chunk);
400
- while (true) {
401
- if (state === 0 /* State.READ_HEADER */) {
402
- if (totalLength(chunks) < 1) {
403
- break;
404
- }
405
- var header = concatChunks(chunks, 1);
406
- isBinary = (header[0] & 0x80) === 0x80;
407
- expectedLength = header[0] & 0x7f;
408
- if (expectedLength < 126) {
409
- state = 3 /* State.READ_PAYLOAD */;
410
- } else if (expectedLength === 126) {
411
- state = 1 /* State.READ_EXTENDED_LENGTH_16 */;
412
- } else {
413
- state = 2 /* State.READ_EXTENDED_LENGTH_64 */;
414
- }
415
- } else if (state === 1 /* State.READ_EXTENDED_LENGTH_16 */) {
416
- if (totalLength(chunks) < 2) {
417
- break;
418
- }
419
- var headerArray = concatChunks(chunks, 2);
420
- expectedLength = new DataView(headerArray.buffer, headerArray.byteOffset, headerArray.length).getUint16(0);
421
- state = 3 /* State.READ_PAYLOAD */;
422
- } else if (state === 2 /* State.READ_EXTENDED_LENGTH_64 */) {
423
- if (totalLength(chunks) < 8) {
424
- break;
425
- }
426
- var _headerArray = concatChunks(chunks, 8);
427
- var view = new DataView(_headerArray.buffer, _headerArray.byteOffset, _headerArray.length);
428
- var n = view.getUint32(0);
429
- if (n > Math.pow(2, 53 - 32) - 1) {
430
- // the maximum safe integer in JavaScript is 2^53 - 1
431
- controller.enqueue(ERROR_PACKET);
432
- break;
433
- }
434
- expectedLength = n * Math.pow(2, 32) + view.getUint32(4);
435
- state = 3 /* State.READ_PAYLOAD */;
436
- } else {
437
- if (totalLength(chunks) < expectedLength) {
438
- break;
439
- }
440
- var data = concatChunks(chunks, expectedLength);
441
- controller.enqueue(decodePacket(isBinary ? data : TEXT_DECODER.decode(data), binaryType));
442
- state = 0 /* State.READ_HEADER */;
443
- }
444
- if (expectedLength === 0 || expectedLength > maxPayload) {
445
- controller.enqueue(ERROR_PACKET);
446
- break;
447
- }
448
- }
449
- }
450
- });
451
- }
452
- var protocol = 4;
453
-
454
- /**
455
- * Initialize a new `Emitter`.
456
- *
457
- * @api public
458
- */
459
-
460
- function Emitter(obj) {
461
- if (obj) return mixin(obj);
462
- }
463
-
464
- /**
465
- * Mixin the emitter properties.
466
- *
467
- * @param {Object} obj
468
- * @return {Object}
469
- * @api private
470
- */
471
-
472
- function mixin(obj) {
473
- for (var key in Emitter.prototype) {
474
- obj[key] = Emitter.prototype[key];
475
- }
476
- return obj;
477
- }
478
-
479
- /**
480
- * Listen on the given `event` with `fn`.
481
- *
482
- * @param {String} event
483
- * @param {Function} fn
484
- * @return {Emitter}
485
- * @api public
486
- */
487
-
488
- Emitter.prototype.on = Emitter.prototype.addEventListener = function (event, fn) {
489
- this._callbacks = this._callbacks || {};
490
- (this._callbacks['$' + event] = this._callbacks['$' + event] || []).push(fn);
491
- return this;
492
- };
493
-
494
- /**
495
- * Adds an `event` listener that will be invoked a single
496
- * time then automatically removed.
497
- *
498
- * @param {String} event
499
- * @param {Function} fn
500
- * @return {Emitter}
501
- * @api public
502
- */
503
-
504
- Emitter.prototype.once = function (event, fn) {
505
- function on() {
506
- this.off(event, on);
507
- fn.apply(this, arguments);
508
- }
509
- on.fn = fn;
510
- this.on(event, on);
511
- return this;
512
- };
513
-
514
- /**
515
- * Remove the given callback for `event` or all
516
- * registered callbacks.
517
- *
518
- * @param {String} event
519
- * @param {Function} fn
520
- * @return {Emitter}
521
- * @api public
522
- */
523
-
524
- Emitter.prototype.off = Emitter.prototype.removeListener = Emitter.prototype.removeAllListeners = Emitter.prototype.removeEventListener = function (event, fn) {
525
- this._callbacks = this._callbacks || {};
526
-
527
- // all
528
- if (0 == arguments.length) {
529
- this._callbacks = {};
530
- return this;
531
- }
532
-
533
- // specific event
534
- var callbacks = this._callbacks['$' + event];
535
- if (!callbacks) return this;
536
-
537
- // remove all handlers
538
- if (1 == arguments.length) {
539
- delete this._callbacks['$' + event];
540
- return this;
541
- }
542
-
543
- // remove specific handler
544
- var cb;
545
- for (var i = 0; i < callbacks.length; i++) {
546
- cb = callbacks[i];
547
- if (cb === fn || cb.fn === fn) {
548
- callbacks.splice(i, 1);
549
- break;
550
- }
551
- }
552
-
553
- // Remove event specific arrays for event types that no
554
- // one is subscribed for to avoid memory leak.
555
- if (callbacks.length === 0) {
556
- delete this._callbacks['$' + event];
557
- }
558
- return this;
559
- };
560
-
561
- /**
562
- * Emit `event` with the given args.
563
- *
564
- * @param {String} event
565
- * @param {Mixed} ...
566
- * @return {Emitter}
567
- */
568
-
569
- Emitter.prototype.emit = function (event) {
570
- this._callbacks = this._callbacks || {};
571
- var args = new Array(arguments.length - 1),
572
- callbacks = this._callbacks['$' + event];
573
- for (var i = 1; i < arguments.length; i++) {
574
- args[i - 1] = arguments[i];
575
- }
576
- if (callbacks) {
577
- callbacks = callbacks.slice(0);
578
- for (var i = 0, len = callbacks.length; i < len; ++i) {
579
- callbacks[i].apply(this, args);
580
- }
581
- }
582
- return this;
583
- };
584
-
585
- // alias used for reserved events (protected method)
586
- Emitter.prototype.emitReserved = Emitter.prototype.emit;
587
-
588
- /**
589
- * Return array of callbacks for `event`.
590
- *
591
- * @param {String} event
592
- * @return {Array}
593
- * @api public
594
- */
595
-
596
- Emitter.prototype.listeners = function (event) {
597
- this._callbacks = this._callbacks || {};
598
- return this._callbacks['$' + event] || [];
599
- };
600
-
601
- /**
602
- * Check if this emitter has `event` handlers.
603
- *
604
- * @param {String} event
605
- * @return {Boolean}
606
- * @api public
607
- */
608
-
609
- Emitter.prototype.hasListeners = function (event) {
610
- return !!this.listeners(event).length;
611
- };
612
-
613
- var nextTick = function () {
614
- var isPromiseAvailable = typeof Promise === "function" && typeof Promise.resolve === "function";
615
- if (isPromiseAvailable) {
616
- return function (cb) {
617
- return Promise.resolve().then(cb);
618
- };
619
- } else {
620
- return function (cb, setTimeoutFn) {
621
- return setTimeoutFn(cb, 0);
622
- };
623
- }
624
- }();
625
- var globalThisShim = function () {
626
- if (typeof self !== "undefined") {
627
- return self;
628
- } else if (typeof window !== "undefined") {
629
- return window;
630
- } else {
631
- return Function("return this")();
632
- }
633
- }();
634
- var defaultBinaryType = "arraybuffer";
635
- function createCookieJar() {}
636
-
637
- function pick(obj) {
638
- for (var _len = arguments.length, attr = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
639
- attr[_key - 1] = arguments[_key];
640
- }
641
- return attr.reduce(function (acc, k) {
642
- if (obj.hasOwnProperty(k)) {
643
- acc[k] = obj[k];
644
- }
645
- return acc;
646
- }, {});
647
- }
648
- // Keep a reference to the real timeout functions so they can be used when overridden
649
- var NATIVE_SET_TIMEOUT = globalThisShim.setTimeout;
650
- var NATIVE_CLEAR_TIMEOUT = globalThisShim.clearTimeout;
651
- function installTimerFunctions(obj, opts) {
652
- if (opts.useNativeTimers) {
653
- obj.setTimeoutFn = NATIVE_SET_TIMEOUT.bind(globalThisShim);
654
- obj.clearTimeoutFn = NATIVE_CLEAR_TIMEOUT.bind(globalThisShim);
655
- } else {
656
- obj.setTimeoutFn = globalThisShim.setTimeout.bind(globalThisShim);
657
- obj.clearTimeoutFn = globalThisShim.clearTimeout.bind(globalThisShim);
658
- }
659
- }
660
- // base64 encoded buffers are about 33% bigger (https://en.wikipedia.org/wiki/Base64)
661
- var BASE64_OVERHEAD = 1.33;
662
- // we could also have used `new Blob([obj]).size`, but it isn't supported in IE9
663
- function byteLength(obj) {
664
- if (typeof obj === "string") {
665
- return utf8Length(obj);
666
- }
667
- // arraybuffer or blob
668
- return Math.ceil((obj.byteLength || obj.size) * BASE64_OVERHEAD);
669
- }
670
- function utf8Length(str) {
671
- var c = 0,
672
- length = 0;
673
- for (var i = 0, l = str.length; i < l; i++) {
674
- c = str.charCodeAt(i);
675
- if (c < 0x80) {
676
- length += 1;
677
- } else if (c < 0x800) {
678
- length += 2;
679
- } else if (c < 0xd800 || c >= 0xe000) {
680
- length += 3;
681
- } else {
682
- i++;
683
- length += 4;
684
- }
685
- }
686
- return length;
687
- }
688
- /**
689
- * Generates a random 8-characters string.
690
- */
691
- function randomString() {
692
- return Date.now().toString(36).substring(3) + Math.random().toString(36).substring(2, 5);
693
- }
694
-
695
- // imported from https://github.com/galkn/querystring
696
- /**
697
- * Compiles a querystring
698
- * Returns string representation of the object
699
- *
700
- * @param {Object}
701
- * @api private
702
- */
703
- function encode(obj) {
704
- var str = '';
705
- for (var i in obj) {
706
- if (obj.hasOwnProperty(i)) {
707
- if (str.length) str += '&';
708
- str += encodeURIComponent(i) + '=' + encodeURIComponent(obj[i]);
709
- }
710
- }
711
- return str;
712
- }
713
- /**
714
- * Parses a simple querystring into an object
715
- *
716
- * @param {String} qs
717
- * @api private
718
- */
719
- function decode(qs) {
720
- var qry = {};
721
- var pairs = qs.split('&');
722
- for (var i = 0, l = pairs.length; i < l; i++) {
723
- var pair = pairs[i].split('=');
724
- qry[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);
725
- }
726
- return qry;
727
- }
728
-
729
- function getDefaultExportFromCjs (x) {
730
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
731
- }
732
-
733
- var browser = {exports: {}};
734
-
735
- var ms;
736
- var hasRequiredMs;
737
- function requireMs() {
738
- if (hasRequiredMs) return ms;
739
- hasRequiredMs = 1;
740
- var s = 1000;
741
- var m = s * 60;
742
- var h = m * 60;
743
- var d = h * 24;
744
- var w = d * 7;
745
- var y = d * 365.25;
746
-
747
- /**
748
- * Parse or format the given `val`.
749
- *
750
- * Options:
751
- *
752
- * - `long` verbose formatting [false]
753
- *
754
- * @param {String|Number} val
755
- * @param {Object} [options]
756
- * @throws {Error} throw an error if val is not a non-empty string or a number
757
- * @return {String|Number}
758
- * @api public
759
- */
760
-
761
- ms = function ms(val, options) {
762
- options = options || {};
763
- var type = _typeof(val);
764
- if (type === 'string' && val.length > 0) {
765
- return parse(val);
766
- } else if (type === 'number' && isFinite(val)) {
767
- return options["long"] ? fmtLong(val) : fmtShort(val);
768
- }
769
- throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val));
770
- };
771
-
772
- /**
773
- * Parse the given `str` and return milliseconds.
774
- *
775
- * @param {String} str
776
- * @return {Number}
777
- * @api private
778
- */
779
-
780
- function parse(str) {
781
- str = String(str);
782
- if (str.length > 100) {
783
- return;
784
- }
785
- var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str);
786
- if (!match) {
787
- return;
788
- }
789
- var n = parseFloat(match[1]);
790
- var type = (match[2] || 'ms').toLowerCase();
791
- switch (type) {
792
- case 'years':
793
- case 'year':
794
- case 'yrs':
795
- case 'yr':
796
- case 'y':
797
- return n * y;
798
- case 'weeks':
799
- case 'week':
800
- case 'w':
801
- return n * w;
802
- case 'days':
803
- case 'day':
804
- case 'd':
805
- return n * d;
806
- case 'hours':
807
- case 'hour':
808
- case 'hrs':
809
- case 'hr':
810
- case 'h':
811
- return n * h;
812
- case 'minutes':
813
- case 'minute':
814
- case 'mins':
815
- case 'min':
816
- case 'm':
817
- return n * m;
818
- case 'seconds':
819
- case 'second':
820
- case 'secs':
821
- case 'sec':
822
- case 's':
823
- return n * s;
824
- case 'milliseconds':
825
- case 'millisecond':
826
- case 'msecs':
827
- case 'msec':
828
- case 'ms':
829
- return n;
830
- default:
831
- return undefined;
832
- }
833
- }
834
-
835
- /**
836
- * Short format for `ms`.
837
- *
838
- * @param {Number} ms
839
- * @return {String}
840
- * @api private
841
- */
842
-
843
- function fmtShort(ms) {
844
- var msAbs = Math.abs(ms);
845
- if (msAbs >= d) {
846
- return Math.round(ms / d) + 'd';
847
- }
848
- if (msAbs >= h) {
849
- return Math.round(ms / h) + 'h';
850
- }
851
- if (msAbs >= m) {
852
- return Math.round(ms / m) + 'm';
853
- }
854
- if (msAbs >= s) {
855
- return Math.round(ms / s) + 's';
856
- }
857
- return ms + 'ms';
858
- }
859
-
860
- /**
861
- * Long format for `ms`.
862
- *
863
- * @param {Number} ms
864
- * @return {String}
865
- * @api private
866
- */
867
-
868
- function fmtLong(ms) {
869
- var msAbs = Math.abs(ms);
870
- if (msAbs >= d) {
871
- return plural(ms, msAbs, d, 'day');
872
- }
873
- if (msAbs >= h) {
874
- return plural(ms, msAbs, h, 'hour');
875
- }
876
- if (msAbs >= m) {
877
- return plural(ms, msAbs, m, 'minute');
878
- }
879
- if (msAbs >= s) {
880
- return plural(ms, msAbs, s, 'second');
881
- }
882
- return ms + ' ms';
883
- }
884
-
885
- /**
886
- * Pluralization helper.
887
- */
888
-
889
- function plural(ms, msAbs, n, name) {
890
- var isPlural = msAbs >= n * 1.5;
891
- return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
892
- }
893
- return ms;
894
- }
895
-
896
- /**
897
- * This is the common logic for both the Node.js and web browser
898
- * implementations of `debug()`.
899
- */
900
-
901
- function setup(env) {
902
- createDebug.debug = createDebug;
903
- createDebug["default"] = createDebug;
904
- createDebug.coerce = coerce;
905
- createDebug.disable = disable;
906
- createDebug.enable = enable;
907
- createDebug.enabled = enabled;
908
- createDebug.humanize = requireMs();
909
- createDebug.destroy = destroy;
910
- Object.keys(env).forEach(function (key) {
911
- createDebug[key] = env[key];
912
- });
913
-
914
- /**
915
- * The currently active debug mode names, and names to skip.
916
- */
917
-
918
- createDebug.names = [];
919
- createDebug.skips = [];
920
-
921
- /**
922
- * Map of special "%n" handling functions, for the debug "format" argument.
923
- *
924
- * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
925
- */
926
- createDebug.formatters = {};
927
-
928
- /**
929
- * Selects a color for a debug namespace
930
- * @param {String} namespace The namespace string for the debug instance to be colored
931
- * @return {Number|String} An ANSI color code for the given namespace
932
- * @api private
933
- */
934
- function selectColor(namespace) {
935
- var hash = 0;
936
- for (var i = 0; i < namespace.length; i++) {
937
- hash = (hash << 5) - hash + namespace.charCodeAt(i);
938
- hash |= 0; // Convert to 32bit integer
939
- }
940
- return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
941
- }
942
- createDebug.selectColor = selectColor;
943
-
944
- /**
945
- * Create a debugger with the given `namespace`.
946
- *
947
- * @param {String} namespace
948
- * @return {Function}
949
- * @api public
950
- */
951
- function createDebug(namespace) {
952
- var prevTime;
953
- var enableOverride = null;
954
- var namespacesCache;
955
- var enabledCache;
956
- function debug() {
957
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
958
- args[_key] = arguments[_key];
959
- }
960
- // Disabled?
961
- if (!debug.enabled) {
962
- return;
963
- }
964
- var self = debug;
965
-
966
- // Set `diff` timestamp
967
- var curr = Number(new Date());
968
- var ms = curr - (prevTime || curr);
969
- self.diff = ms;
970
- self.prev = prevTime;
971
- self.curr = curr;
972
- prevTime = curr;
973
- args[0] = createDebug.coerce(args[0]);
974
- if (typeof args[0] !== 'string') {
975
- // Anything else let's inspect with %O
976
- args.unshift('%O');
977
- }
978
-
979
- // Apply any `formatters` transformations
980
- var index = 0;
981
- args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {
982
- // If we encounter an escaped % then don't increase the array index
983
- if (match === '%%') {
984
- return '%';
985
- }
986
- index++;
987
- var formatter = createDebug.formatters[format];
988
- if (typeof formatter === 'function') {
989
- var val = args[index];
990
- match = formatter.call(self, val);
991
-
992
- // Now we need to remove `args[index]` since it's inlined in the `format`
993
- args.splice(index, 1);
994
- index--;
995
- }
996
- return match;
997
- });
998
-
999
- // Apply env-specific formatting (colors, etc.)
1000
- createDebug.formatArgs.call(self, args);
1001
- var logFn = self.log || createDebug.log;
1002
- logFn.apply(self, args);
1003
- }
1004
- debug.namespace = namespace;
1005
- debug.useColors = createDebug.useColors();
1006
- debug.color = createDebug.selectColor(namespace);
1007
- debug.extend = extend;
1008
- debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.
1009
-
1010
- Object.defineProperty(debug, 'enabled', {
1011
- enumerable: true,
1012
- configurable: false,
1013
- get: function get() {
1014
- if (enableOverride !== null) {
1015
- return enableOverride;
1016
- }
1017
- if (namespacesCache !== createDebug.namespaces) {
1018
- namespacesCache = createDebug.namespaces;
1019
- enabledCache = createDebug.enabled(namespace);
1020
- }
1021
- return enabledCache;
1022
- },
1023
- set: function set(v) {
1024
- enableOverride = v;
1025
- }
1026
- });
1027
-
1028
- // Env-specific initialization logic for debug instances
1029
- if (typeof createDebug.init === 'function') {
1030
- createDebug.init(debug);
1031
- }
1032
- return debug;
1033
- }
1034
- function extend(namespace, delimiter) {
1035
- var newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
1036
- newDebug.log = this.log;
1037
- return newDebug;
1038
- }
1039
-
1040
- /**
1041
- * Enables a debug mode by namespaces. This can include modes
1042
- * separated by a colon and wildcards.
1043
- *
1044
- * @param {String} namespaces
1045
- * @api public
1046
- */
1047
- function enable(namespaces) {
1048
- createDebug.save(namespaces);
1049
- createDebug.namespaces = namespaces;
1050
- createDebug.names = [];
1051
- createDebug.skips = [];
1052
- var i;
1053
- var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
1054
- var len = split.length;
1055
- for (i = 0; i < len; i++) {
1056
- if (!split[i]) {
1057
- // ignore empty strings
1058
- continue;
1059
- }
1060
- namespaces = split[i].replace(/\*/g, '.*?');
1061
- if (namespaces[0] === '-') {
1062
- createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));
1063
- } else {
1064
- createDebug.names.push(new RegExp('^' + namespaces + '$'));
1065
- }
1066
- }
1067
- }
1068
-
1069
- /**
1070
- * Disable debug output.
1071
- *
1072
- * @return {String} namespaces
1073
- * @api public
1074
- */
1075
- function disable() {
1076
- var namespaces = [].concat(_toConsumableArray(createDebug.names.map(toNamespace)), _toConsumableArray(createDebug.skips.map(toNamespace).map(function (namespace) {
1077
- return '-' + namespace;
1078
- }))).join(',');
1079
- createDebug.enable('');
1080
- return namespaces;
1081
- }
1082
-
1083
- /**
1084
- * Returns true if the given mode name is enabled, false otherwise.
1085
- *
1086
- * @param {String} name
1087
- * @return {Boolean}
1088
- * @api public
1089
- */
1090
- function enabled(name) {
1091
- if (name[name.length - 1] === '*') {
1092
- return true;
1093
- }
1094
- var i;
1095
- var len;
1096
- for (i = 0, len = createDebug.skips.length; i < len; i++) {
1097
- if (createDebug.skips[i].test(name)) {
1098
- return false;
1099
- }
1100
- }
1101
- for (i = 0, len = createDebug.names.length; i < len; i++) {
1102
- if (createDebug.names[i].test(name)) {
1103
- return true;
1104
- }
1105
- }
1106
- return false;
1107
- }
1108
-
1109
- /**
1110
- * Convert regexp to namespace
1111
- *
1112
- * @param {RegExp} regxep
1113
- * @return {String} namespace
1114
- * @api private
1115
- */
1116
- function toNamespace(regexp) {
1117
- return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, '*');
1118
- }
1119
-
1120
- /**
1121
- * Coerce `val`.
1122
- *
1123
- * @param {Mixed} val
1124
- * @return {Mixed}
1125
- * @api private
1126
- */
1127
- function coerce(val) {
1128
- if (val instanceof Error) {
1129
- return val.stack || val.message;
1130
- }
1131
- return val;
1132
- }
1133
-
1134
- /**
1135
- * XXX DO NOT USE. This is a temporary stub function.
1136
- * XXX It WILL be removed in the next major release.
1137
- */
1138
- function destroy() {
1139
- console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
1140
- }
1141
- createDebug.enable(createDebug.load());
1142
- return createDebug;
1143
- }
1144
- var common = setup;
1145
-
1146
- /* eslint-env browser */
1147
- browser.exports;
1148
- (function (module, exports) {
1149
- /**
1150
- * This is the web browser implementation of `debug()`.
1151
- */
1152
-
1153
- exports.formatArgs = formatArgs;
1154
- exports.save = save;
1155
- exports.load = load;
1156
- exports.useColors = useColors;
1157
- exports.storage = localstorage();
1158
- exports.destroy = function () {
1159
- var warned = false;
1160
- return function () {
1161
- if (!warned) {
1162
- warned = true;
1163
- console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
1164
- }
1165
- };
1166
- }();
1167
-
1168
- /**
1169
- * Colors.
1170
- */
1171
-
1172
- exports.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'];
1173
-
1174
- /**
1175
- * Currently only WebKit-based Web Inspectors, Firefox >= v31,
1176
- * and the Firebug extension (any Firefox version) are known
1177
- * to support "%c" CSS customizations.
1178
- *
1179
- * TODO: add a `localStorage` variable to explicitly enable/disable colors
1180
- */
1181
-
1182
- // eslint-disable-next-line complexity
1183
- function useColors() {
1184
- // NB: In an Electron preload script, document will be defined but not fully
1185
- // initialized. Since we know we're in Chrome, we'll just detect this case
1186
- // explicitly
1187
- if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
1188
- return true;
1189
- }
1190
-
1191
- // Internet Explorer and Edge do not support colors.
1192
- if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
1193
- return false;
1194
- }
1195
-
1196
- // Is webkit? http://stackoverflow.com/a/16459606/376773
1197
- // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
1198
- return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance ||
1199
- // Is firebug? http://stackoverflow.com/a/398120/376773
1200
- typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) ||
1201
- // Is firefox >= v31?
1202
- // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
1203
- typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 ||
1204
- // Double check webkit in userAgent just in case we are in a worker
1205
- typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
1206
- }
1207
-
1208
- /**
1209
- * Colorize log arguments if enabled.
1210
- *
1211
- * @api public
1212
- */
1213
-
1214
- function formatArgs(args) {
1215
- args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);
1216
- if (!this.useColors) {
1217
- return;
1218
- }
1219
- var c = 'color: ' + this.color;
1220
- args.splice(1, 0, c, 'color: inherit');
1221
-
1222
- // The final "%c" is somewhat tricky, because there could be other
1223
- // arguments passed either before or after the %c, so we need to
1224
- // figure out the correct index to insert the CSS into
1225
- var index = 0;
1226
- var lastC = 0;
1227
- args[0].replace(/%[a-zA-Z%]/g, function (match) {
1228
- if (match === '%%') {
1229
- return;
1230
- }
1231
- index++;
1232
- if (match === '%c') {
1233
- // We only are interested in the *last* %c
1234
- // (the user may have provided their own)
1235
- lastC = index;
1236
- }
1237
- });
1238
- args.splice(lastC, 0, c);
1239
- }
1240
-
1241
- /**
1242
- * Invokes `console.debug()` when available.
1243
- * No-op when `console.debug` is not a "function".
1244
- * If `console.debug` is not available, falls back
1245
- * to `console.log`.
1246
- *
1247
- * @api public
1248
- */
1249
- exports.log = console.debug || console.log || function () {};
1250
-
1251
- /**
1252
- * Save `namespaces`.
1253
- *
1254
- * @param {String} namespaces
1255
- * @api private
1256
- */
1257
- function save(namespaces) {
1258
- try {
1259
- if (namespaces) {
1260
- exports.storage.setItem('debug', namespaces);
1261
- } else {
1262
- exports.storage.removeItem('debug');
1263
- }
1264
- } catch (error) {
1265
- // Swallow
1266
- // XXX (@Qix-) should we be logging these?
1267
- }
1268
- }
1269
-
1270
- /**
1271
- * Load `namespaces`.
1272
- *
1273
- * @return {String} returns the previously persisted debug modes
1274
- * @api private
1275
- */
1276
- function load() {
1277
- var r;
1278
- try {
1279
- r = exports.storage.getItem('debug');
1280
- } catch (error) {
1281
- // Swallow
1282
- // XXX (@Qix-) should we be logging these?
1283
- }
1284
-
1285
- // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
1286
- if (!r && typeof process !== 'undefined' && 'env' in process) {
1287
- r = process.env.DEBUG;
1288
- }
1289
- return r;
1290
- }
1291
-
1292
- /**
1293
- * Localstorage attempts to return the localstorage.
1294
- *
1295
- * This is necessary because safari throws
1296
- * when a user disables cookies/localstorage
1297
- * and you attempt to access it.
1298
- *
1299
- * @return {LocalStorage}
1300
- * @api private
1301
- */
1302
-
1303
- function localstorage() {
1304
- try {
1305
- // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
1306
- // The Browser also has localStorage in the global context.
1307
- return localStorage;
1308
- } catch (error) {
1309
- // Swallow
1310
- // XXX (@Qix-) should we be logging these?
1311
- }
1312
- }
1313
- module.exports = common(exports);
1314
- var formatters = module.exports.formatters;
1315
-
1316
- /**
1317
- * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
1318
- */
1319
-
1320
- formatters.j = function (v) {
1321
- try {
1322
- return JSON.stringify(v);
1323
- } catch (error) {
1324
- return '[UnexpectedJSONParseError]: ' + error.message;
1325
- }
1326
- };
1327
- })(browser, browser.exports);
1328
- var browserExports = browser.exports;
1329
- var debugModule = /*@__PURE__*/getDefaultExportFromCjs(browserExports);
1330
-
1331
- var debug$5 = debugModule("engine.io-client:transport"); // debug()
1332
- var TransportError = /*#__PURE__*/function (_Error) {
1333
- function TransportError(reason, description, context) {
1334
- var _this;
1335
- _this = _Error.call(this, reason) || this;
1336
- _this.description = description;
1337
- _this.context = context;
1338
- _this.type = "TransportError";
1339
- return _this;
1340
- }
1341
- _inheritsLoose(TransportError, _Error);
1342
- return TransportError;
1343
- }( /*#__PURE__*/_wrapNativeSuper(Error));
1344
- var Transport = /*#__PURE__*/function (_Emitter) {
1345
- /**
1346
- * Transport abstract constructor.
1347
- *
1348
- * @param {Object} opts - options
1349
- * @protected
1350
- */
1351
- function Transport(opts) {
1352
- var _this2;
1353
- _this2 = _Emitter.call(this) || this;
1354
- _this2.writable = false;
1355
- installTimerFunctions(_this2, opts);
1356
- _this2.opts = opts;
1357
- _this2.query = opts.query;
1358
- _this2.socket = opts.socket;
1359
- _this2.supportsBinary = !opts.forceBase64;
1360
- return _this2;
1361
- }
1362
- /**
1363
- * Emits an error.
1364
- *
1365
- * @param {String} reason
1366
- * @param description
1367
- * @param context - the error context
1368
- * @return {Transport} for chaining
1369
- * @protected
1370
- */
1371
- _inheritsLoose(Transport, _Emitter);
1372
- var _proto = Transport.prototype;
1373
- _proto.onError = function onError(reason, description, context) {
1374
- _Emitter.prototype.emitReserved.call(this, "error", new TransportError(reason, description, context));
1375
- return this;
1376
- }
1377
- /**
1378
- * Opens the transport.
1379
- */;
1380
- _proto.open = function open() {
1381
- this.readyState = "opening";
1382
- this.doOpen();
1383
- return this;
1384
- }
1385
- /**
1386
- * Closes the transport.
1387
- */;
1388
- _proto.close = function close() {
1389
- if (this.readyState === "opening" || this.readyState === "open") {
1390
- this.doClose();
1391
- this.onClose();
1392
- }
1393
- return this;
1394
- }
1395
- /**
1396
- * Sends multiple packets.
1397
- *
1398
- * @param {Array} packets
1399
- */;
1400
- _proto.send = function send(packets) {
1401
- if (this.readyState === "open") {
1402
- this.write(packets);
1403
- } else {
1404
- // this might happen if the transport was silently closed in the beforeunload event handler
1405
- debug$5("transport is not open, discarding packets");
1406
- }
1407
- }
1408
- /**
1409
- * Called upon open
1410
- *
1411
- * @protected
1412
- */;
1413
- _proto.onOpen = function onOpen() {
1414
- this.readyState = "open";
1415
- this.writable = true;
1416
- _Emitter.prototype.emitReserved.call(this, "open");
1417
- }
1418
- /**
1419
- * Called with data.
1420
- *
1421
- * @param {String} data
1422
- * @protected
1423
- */;
1424
- _proto.onData = function onData(data) {
1425
- var packet = decodePacket(data, this.socket.binaryType);
1426
- this.onPacket(packet);
1427
- }
1428
- /**
1429
- * Called with a decoded packet.
1430
- *
1431
- * @protected
1432
- */;
1433
- _proto.onPacket = function onPacket(packet) {
1434
- _Emitter.prototype.emitReserved.call(this, "packet", packet);
1435
- }
1436
- /**
1437
- * Called upon close.
1438
- *
1439
- * @protected
1440
- */;
1441
- _proto.onClose = function onClose(details) {
1442
- this.readyState = "closed";
1443
- _Emitter.prototype.emitReserved.call(this, "close", details);
1444
- }
1445
- /**
1446
- * Pauses the transport, in order not to lose packets during an upgrade.
1447
- *
1448
- * @param onPause
1449
- */;
1450
- _proto.pause = function pause(onPause) {};
1451
- _proto.createUri = function createUri(schema) {
1452
- var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1453
- return schema + "://" + this._hostname() + this._port() + this.opts.path + this._query(query);
1454
- };
1455
- _proto._hostname = function _hostname() {
1456
- var hostname = this.opts.hostname;
1457
- return hostname.indexOf(":") === -1 ? hostname : "[" + hostname + "]";
1458
- };
1459
- _proto._port = function _port() {
1460
- if (this.opts.port && (this.opts.secure && Number(this.opts.port !== 443) || !this.opts.secure && Number(this.opts.port) !== 80)) {
1461
- return ":" + this.opts.port;
1462
- } else {
1463
- return "";
1464
- }
1465
- };
1466
- _proto._query = function _query(query) {
1467
- var encodedQuery = encode(query);
1468
- return encodedQuery.length ? "?" + encodedQuery : "";
1469
- };
1470
- return Transport;
1471
- }(Emitter);
1472
-
1473
- var debug$4 = debugModule("engine.io-client:polling"); // debug()
1474
- var Polling = /*#__PURE__*/function (_Transport) {
1475
- function Polling() {
1476
- var _this;
1477
- _this = _Transport.apply(this, arguments) || this;
1478
- _this._polling = false;
1479
- return _this;
1480
- }
1481
- _inheritsLoose(Polling, _Transport);
1482
- var _proto = Polling.prototype;
1483
- /**
1484
- * Opens the socket (triggers polling). We write a PING message to determine
1485
- * when the transport is open.
1486
- *
1487
- * @protected
1488
- */
1489
- _proto.doOpen = function doOpen() {
1490
- this._poll();
1491
- }
1492
- /**
1493
- * Pauses polling.
1494
- *
1495
- * @param {Function} onPause - callback upon buffers are flushed and transport is paused
1496
- * @package
1497
- */;
1498
- _proto.pause = function pause(onPause) {
1499
- var _this2 = this;
1500
- this.readyState = "pausing";
1501
- var pause = function pause() {
1502
- debug$4("paused");
1503
- _this2.readyState = "paused";
1504
- onPause();
1505
- };
1506
- if (this._polling || !this.writable) {
1507
- var total = 0;
1508
- if (this._polling) {
1509
- debug$4("we are currently polling - waiting to pause");
1510
- total++;
1511
- this.once("pollComplete", function () {
1512
- debug$4("pre-pause polling complete");
1513
- --total || pause();
1514
- });
1515
- }
1516
- if (!this.writable) {
1517
- debug$4("we are currently writing - waiting to pause");
1518
- total++;
1519
- this.once("drain", function () {
1520
- debug$4("pre-pause writing complete");
1521
- --total || pause();
1522
- });
1523
- }
1524
- } else {
1525
- pause();
1526
- }
1527
- }
1528
- /**
1529
- * Starts polling cycle.
1530
- *
1531
- * @private
1532
- */;
1533
- _proto._poll = function _poll() {
1534
- debug$4("polling");
1535
- this._polling = true;
1536
- this.doPoll();
1537
- this.emitReserved("poll");
1538
- }
1539
- /**
1540
- * Overloads onData to detect payloads.
1541
- *
1542
- * @protected
1543
- */;
1544
- _proto.onData = function onData(data) {
1545
- var _this3 = this;
1546
- debug$4("polling got data %s", data);
1547
- var callback = function callback(packet) {
1548
- // if its the first message we consider the transport open
1549
- if ("opening" === _this3.readyState && packet.type === "open") {
1550
- _this3.onOpen();
1551
- }
1552
- // if its a close packet, we close the ongoing requests
1553
- if ("close" === packet.type) {
1554
- _this3.onClose({
1555
- description: "transport closed by the server"
1556
- });
1557
- return false;
1558
- }
1559
- // otherwise bypass onData and handle the message
1560
- _this3.onPacket(packet);
1561
- };
1562
- // decode payload
1563
- decodePayload(data, this.socket.binaryType).forEach(callback);
1564
- // if an event did not trigger closing
1565
- if ("closed" !== this.readyState) {
1566
- // if we got data we're not polling
1567
- this._polling = false;
1568
- this.emitReserved("pollComplete");
1569
- if ("open" === this.readyState) {
1570
- this._poll();
1571
- } else {
1572
- debug$4('ignoring poll - transport state "%s"', this.readyState);
1573
- }
1574
- }
1575
- }
1576
- /**
1577
- * For polling, send a close packet.
1578
- *
1579
- * @protected
1580
- */;
1581
- _proto.doClose = function doClose() {
1582
- var _this4 = this;
1583
- var close = function close() {
1584
- debug$4("writing close packet");
1585
- _this4.write([{
1586
- type: "close"
1587
- }]);
1588
- };
1589
- if ("open" === this.readyState) {
1590
- debug$4("transport open - closing");
1591
- close();
1592
- } else {
1593
- // in case we're trying to close while
1594
- // handshaking is in progress (GH-164)
1595
- debug$4("transport not open - deferring close");
1596
- this.once("open", close);
1597
- }
1598
- }
1599
- /**
1600
- * Writes a packets payload.
1601
- *
1602
- * @param {Array} packets - data packets
1603
- * @protected
1604
- */;
1605
- _proto.write = function write(packets) {
1606
- var _this5 = this;
1607
- this.writable = false;
1608
- encodePayload(packets, function (data) {
1609
- _this5.doWrite(data, function () {
1610
- _this5.writable = true;
1611
- _this5.emitReserved("drain");
1612
- });
1613
- });
1614
- }
1615
- /**
1616
- * Generates uri for connection.
1617
- *
1618
- * @private
1619
- */;
1620
- _proto.uri = function uri() {
1621
- var schema = this.opts.secure ? "https" : "http";
1622
- var query = this.query || {};
1623
- // cache busting is forced
1624
- if (false !== this.opts.timestampRequests) {
1625
- query[this.opts.timestampParam] = randomString();
1626
- }
1627
- if (!this.supportsBinary && !query.sid) {
1628
- query.b64 = 1;
1629
- }
1630
- return this.createUri(schema, query);
1631
- };
1632
- return _createClass(Polling, [{
1633
- key: "name",
1634
- get: function get() {
1635
- return "polling";
1636
- }
1637
- }]);
1638
- }(Transport);
1639
-
1640
- // imported from https://github.com/component/has-cors
1641
- var value = false;
1642
- try {
1643
- value = typeof XMLHttpRequest !== 'undefined' && 'withCredentials' in new XMLHttpRequest();
1644
- } catch (err) {
1645
- // if XMLHttp support is disabled in IE then it will throw
1646
- // when trying to create
1647
- }
1648
- var hasCORS = value;
1649
-
1650
- var debug$3 = debugModule("engine.io-client:polling"); // debug()
1651
- function empty() {}
1652
- var BaseXHR = /*#__PURE__*/function (_Polling) {
1653
- /**
1654
- * XHR Polling constructor.
1655
- *
1656
- * @param {Object} opts
1657
- * @package
1658
- */
1659
- function BaseXHR(opts) {
1660
- var _this;
1661
- _this = _Polling.call(this, opts) || this;
1662
- if (typeof location !== "undefined") {
1663
- var isSSL = "https:" === location.protocol;
1664
- var port = location.port;
1665
- // some user agents have empty `location.port`
1666
- if (!port) {
1667
- port = isSSL ? "443" : "80";
1668
- }
1669
- _this.xd = typeof location !== "undefined" && opts.hostname !== location.hostname || port !== opts.port;
1670
- }
1671
- return _this;
1672
- }
1673
- /**
1674
- * Sends data.
1675
- *
1676
- * @param {String} data to send.
1677
- * @param {Function} called upon flush.
1678
- * @private
1679
- */
1680
- _inheritsLoose(BaseXHR, _Polling);
1681
- var _proto = BaseXHR.prototype;
1682
- _proto.doWrite = function doWrite(data, fn) {
1683
- var _this2 = this;
1684
- var req = this.request({
1685
- method: "POST",
1686
- data: data
1687
- });
1688
- req.on("success", fn);
1689
- req.on("error", function (xhrStatus, context) {
1690
- _this2.onError("xhr post error", xhrStatus, context);
1691
- });
1692
- }
1693
- /**
1694
- * Starts a poll cycle.
1695
- *
1696
- * @private
1697
- */;
1698
- _proto.doPoll = function doPoll() {
1699
- var _this3 = this;
1700
- debug$3("xhr poll");
1701
- var req = this.request();
1702
- req.on("data", this.onData.bind(this));
1703
- req.on("error", function (xhrStatus, context) {
1704
- _this3.onError("xhr poll error", xhrStatus, context);
1705
- });
1706
- this.pollXhr = req;
1707
- };
1708
- return BaseXHR;
1709
- }(Polling);
1710
- var Request = /*#__PURE__*/function (_Emitter) {
1711
- /**
1712
- * Request constructor
1713
- *
1714
- * @param {Object} options
1715
- * @package
1716
- */
1717
- function Request(createRequest, uri, opts) {
1718
- var _this4;
1719
- _this4 = _Emitter.call(this) || this;
1720
- _this4.createRequest = createRequest;
1721
- installTimerFunctions(_this4, opts);
1722
- _this4._opts = opts;
1723
- _this4._method = opts.method || "GET";
1724
- _this4._uri = uri;
1725
- _this4._data = undefined !== opts.data ? opts.data : null;
1726
- _this4._create();
1727
- return _this4;
1728
- }
1729
- /**
1730
- * Creates the XHR object and sends the request.
1731
- *
1732
- * @private
1733
- */
1734
- _inheritsLoose(Request, _Emitter);
1735
- var _proto2 = Request.prototype;
1736
- _proto2._create = function _create() {
1737
- var _this5 = this;
1738
- var _a;
1739
- var opts = pick(this._opts, "agent", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "autoUnref");
1740
- opts.xdomain = !!this._opts.xd;
1741
- var xhr = this._xhr = this.createRequest(opts);
1742
- try {
1743
- debug$3("xhr open %s: %s", this._method, this._uri);
1744
- xhr.open(this._method, this._uri, true);
1745
- try {
1746
- if (this._opts.extraHeaders) {
1747
- // @ts-ignore
1748
- xhr.setDisableHeaderCheck && xhr.setDisableHeaderCheck(true);
1749
- for (var i in this._opts.extraHeaders) {
1750
- if (this._opts.extraHeaders.hasOwnProperty(i)) {
1751
- xhr.setRequestHeader(i, this._opts.extraHeaders[i]);
1752
- }
1753
- }
1754
- }
1755
- } catch (e) {}
1756
- if ("POST" === this._method) {
1757
- try {
1758
- xhr.setRequestHeader("Content-type", "text/plain;charset=UTF-8");
1759
- } catch (e) {}
1760
- }
1761
- try {
1762
- xhr.setRequestHeader("Accept", "*/*");
1763
- } catch (e) {}
1764
- (_a = this._opts.cookieJar) === null || _a === void 0 ? void 0 : _a.addCookies(xhr);
1765
- // ie6 check
1766
- if ("withCredentials" in xhr) {
1767
- xhr.withCredentials = this._opts.withCredentials;
1768
- }
1769
- if (this._opts.requestTimeout) {
1770
- xhr.timeout = this._opts.requestTimeout;
1771
- }
1772
- xhr.onreadystatechange = function () {
1773
- var _a;
1774
- if (xhr.readyState === 3) {
1775
- (_a = _this5._opts.cookieJar) === null || _a === void 0 ? void 0 : _a.parseCookies(
1776
- // @ts-ignore
1777
- xhr.getResponseHeader("set-cookie"));
1778
- }
1779
- if (4 !== xhr.readyState) return;
1780
- if (200 === xhr.status || 1223 === xhr.status) {
1781
- _this5._onLoad();
1782
- } else {
1783
- // make sure the `error` event handler that's user-set
1784
- // does not throw in the same tick and gets caught here
1785
- _this5.setTimeoutFn(function () {
1786
- _this5._onError(typeof xhr.status === "number" ? xhr.status : 0);
1787
- }, 0);
1788
- }
1789
- };
1790
- debug$3("xhr data %s", this._data);
1791
- xhr.send(this._data);
1792
- } catch (e) {
1793
- // Need to defer since .create() is called directly from the constructor
1794
- // and thus the 'error' event can only be only bound *after* this exception
1795
- // occurs. Therefore, also, we cannot throw here at all.
1796
- this.setTimeoutFn(function () {
1797
- _this5._onError(e);
1798
- }, 0);
1799
- return;
1800
- }
1801
- if (typeof document !== "undefined") {
1802
- this._index = Request.requestsCount++;
1803
- Request.requests[this._index] = this;
1804
- }
1805
- }
1806
- /**
1807
- * Called upon error.
1808
- *
1809
- * @private
1810
- */;
1811
- _proto2._onError = function _onError(err) {
1812
- this.emitReserved("error", err, this._xhr);
1813
- this._cleanup(true);
1814
- }
1815
- /**
1816
- * Cleans up house.
1817
- *
1818
- * @private
1819
- */;
1820
- _proto2._cleanup = function _cleanup(fromError) {
1821
- if ("undefined" === typeof this._xhr || null === this._xhr) {
1822
- return;
1823
- }
1824
- this._xhr.onreadystatechange = empty;
1825
- if (fromError) {
1826
- try {
1827
- this._xhr.abort();
1828
- } catch (e) {}
1829
- }
1830
- if (typeof document !== "undefined") {
1831
- delete Request.requests[this._index];
1832
- }
1833
- this._xhr = null;
1834
- }
1835
- /**
1836
- * Called upon load.
1837
- *
1838
- * @private
1839
- */;
1840
- _proto2._onLoad = function _onLoad() {
1841
- var data = this._xhr.responseText;
1842
- if (data !== null) {
1843
- this.emitReserved("data", data);
1844
- this.emitReserved("success");
1845
- this._cleanup();
1846
- }
1847
- }
1848
- /**
1849
- * Aborts the request.
1850
- *
1851
- * @package
1852
- */;
1853
- _proto2.abort = function abort() {
1854
- this._cleanup();
1855
- };
1856
- return Request;
1857
- }(Emitter);
1858
- Request.requestsCount = 0;
1859
- Request.requests = {};
1860
- /**
1861
- * Aborts pending requests when unloading the window. This is needed to prevent
1862
- * memory leaks (e.g. when using IE) and to ensure that no spurious error is
1863
- * emitted.
1864
- */
1865
- if (typeof document !== "undefined") {
1866
- // @ts-ignore
1867
- if (typeof attachEvent === "function") {
1868
- // @ts-ignore
1869
- attachEvent("onunload", unloadHandler);
1870
- } else if (typeof addEventListener === "function") {
1871
- var terminationEvent = "onpagehide" in globalThisShim ? "pagehide" : "unload";
1872
- addEventListener(terminationEvent, unloadHandler, false);
1873
- }
1874
- }
1875
- function unloadHandler() {
1876
- for (var i in Request.requests) {
1877
- if (Request.requests.hasOwnProperty(i)) {
1878
- Request.requests[i].abort();
1879
- }
1880
- }
1881
- }
1882
- var hasXHR2 = function () {
1883
- var xhr = newRequest({
1884
- xdomain: false
1885
- });
1886
- return xhr && xhr.responseType !== null;
1887
- }();
1888
- /**
1889
- * HTTP long-polling based on the built-in `XMLHttpRequest` object.
1890
- *
1891
- * Usage: browser
1892
- *
1893
- * @see https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest
1894
- */
1895
- var XHR = /*#__PURE__*/function (_BaseXHR) {
1896
- function XHR(opts) {
1897
- var _this6;
1898
- _this6 = _BaseXHR.call(this, opts) || this;
1899
- var forceBase64 = opts && opts.forceBase64;
1900
- _this6.supportsBinary = hasXHR2 && !forceBase64;
1901
- return _this6;
1902
- }
1903
- _inheritsLoose(XHR, _BaseXHR);
1904
- var _proto3 = XHR.prototype;
1905
- _proto3.request = function request() {
1906
- var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1907
- _extends(opts, {
1908
- xd: this.xd
1909
- }, this.opts);
1910
- return new Request(newRequest, this.uri(), opts);
1911
- };
1912
- return XHR;
1913
- }(BaseXHR);
1914
- function newRequest(opts) {
1915
- var xdomain = opts.xdomain;
1916
- // XMLHttpRequest can be disabled on IE
1917
- try {
1918
- if ("undefined" !== typeof XMLHttpRequest && (!xdomain || hasCORS)) {
1919
- return new XMLHttpRequest();
1920
- }
1921
- } catch (e) {}
1922
- if (!xdomain) {
1923
- try {
1924
- return new globalThisShim[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP");
1925
- } catch (e) {}
1926
- }
1927
- }
1928
-
1929
- var debug$2 = debugModule("engine.io-client:websocket"); // debug()
1930
- // detect ReactNative environment
1931
- var isReactNative = typeof navigator !== "undefined" && typeof navigator.product === "string" && navigator.product.toLowerCase() === "reactnative";
1932
- var BaseWS = /*#__PURE__*/function (_Transport) {
1933
- function BaseWS() {
1934
- return _Transport.apply(this, arguments) || this;
1935
- }
1936
- _inheritsLoose(BaseWS, _Transport);
1937
- var _proto = BaseWS.prototype;
1938
- _proto.doOpen = function doOpen() {
1939
- var uri = this.uri();
1940
- var protocols = this.opts.protocols;
1941
- // React Native only supports the 'headers' option, and will print a warning if anything else is passed
1942
- var opts = isReactNative ? {} : pick(this.opts, "agent", "perMessageDeflate", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "localAddress", "protocolVersion", "origin", "maxPayload", "family", "checkServerIdentity");
1943
- if (this.opts.extraHeaders) {
1944
- opts.headers = this.opts.extraHeaders;
1945
- }
1946
- try {
1947
- this.ws = this.createSocket(uri, protocols, opts);
1948
- } catch (err) {
1949
- return this.emitReserved("error", err);
1950
- }
1951
- this.ws.binaryType = this.socket.binaryType;
1952
- this.addEventListeners();
1953
- }
1954
- /**
1955
- * Adds event listeners to the socket
1956
- *
1957
- * @private
1958
- */;
1959
- _proto.addEventListeners = function addEventListeners() {
1960
- var _this = this;
1961
- this.ws.onopen = function () {
1962
- if (_this.opts.autoUnref) {
1963
- _this.ws._socket.unref();
1964
- }
1965
- _this.onOpen();
1966
- };
1967
- this.ws.onclose = function (closeEvent) {
1968
- return _this.onClose({
1969
- description: "websocket connection closed",
1970
- context: closeEvent
1971
- });
1972
- };
1973
- this.ws.onmessage = function (ev) {
1974
- return _this.onData(ev.data);
1975
- };
1976
- this.ws.onerror = function (e) {
1977
- return _this.onError("websocket error", e);
1978
- };
1979
- };
1980
- _proto.write = function write(packets) {
1981
- var _this2 = this;
1982
- this.writable = false;
1983
- // encodePacket efficient as it uses WS framing
1984
- // no need for encodePayload
1985
- var _loop = function _loop() {
1986
- var packet = packets[i];
1987
- var lastPacket = i === packets.length - 1;
1988
- encodePacket(packet, _this2.supportsBinary, function (data) {
1989
- // Sometimes the websocket has already been closed but the browser didn't
1990
- // have a chance of informing us about it yet, in that case send will
1991
- // throw an error
1992
- try {
1993
- _this2.doWrite(packet, data);
1994
- } catch (e) {
1995
- debug$2("websocket closed before onclose event");
1996
- }
1997
- if (lastPacket) {
1998
- // fake drain
1999
- // defer to next tick to allow Socket to clear writeBuffer
2000
- nextTick(function () {
2001
- _this2.writable = true;
2002
- _this2.emitReserved("drain");
2003
- }, _this2.setTimeoutFn);
2004
- }
2005
- });
2006
- };
2007
- for (var i = 0; i < packets.length; i++) {
2008
- _loop();
2009
- }
2010
- };
2011
- _proto.doClose = function doClose() {
2012
- if (typeof this.ws !== "undefined") {
2013
- this.ws.onerror = function () {};
2014
- this.ws.close();
2015
- this.ws = null;
2016
- }
2017
- }
2018
- /**
2019
- * Generates uri for connection.
2020
- *
2021
- * @private
2022
- */;
2023
- _proto.uri = function uri() {
2024
- var schema = this.opts.secure ? "wss" : "ws";
2025
- var query = this.query || {};
2026
- // append timestamp to URI
2027
- if (this.opts.timestampRequests) {
2028
- query[this.opts.timestampParam] = randomString();
2029
- }
2030
- // communicate binary support capabilities
2031
- if (!this.supportsBinary) {
2032
- query.b64 = 1;
2033
- }
2034
- return this.createUri(schema, query);
2035
- };
2036
- return _createClass(BaseWS, [{
2037
- key: "name",
2038
- get: function get() {
2039
- return "websocket";
2040
- }
2041
- }]);
2042
- }(Transport);
2043
- var WebSocketCtor = globalThisShim.WebSocket || globalThisShim.MozWebSocket;
2044
- /**
2045
- * WebSocket transport based on the built-in `WebSocket` object.
2046
- *
2047
- * Usage: browser, Node.js (since v21), Deno, Bun
2048
- *
2049
- * @see https://developer.mozilla.org/en-US/docs/Web/API/WebSocket
2050
- * @see https://caniuse.com/mdn-api_websocket
2051
- * @see https://nodejs.org/api/globals.html#websocket
2052
- */
2053
- var WS = /*#__PURE__*/function (_BaseWS) {
2054
- function WS() {
2055
- return _BaseWS.apply(this, arguments) || this;
2056
- }
2057
- _inheritsLoose(WS, _BaseWS);
2058
- var _proto2 = WS.prototype;
2059
- _proto2.createSocket = function createSocket(uri, protocols, opts) {
2060
- return !isReactNative ? protocols ? new WebSocketCtor(uri, protocols) : new WebSocketCtor(uri) : new WebSocketCtor(uri, protocols, opts);
2061
- };
2062
- _proto2.doWrite = function doWrite(_packet, data) {
2063
- this.ws.send(data);
2064
- };
2065
- return WS;
2066
- }(BaseWS);
2067
-
2068
- var debug$1 = debugModule("engine.io-client:webtransport"); // debug()
2069
- /**
2070
- * WebTransport transport based on the built-in `WebTransport` object.
2071
- *
2072
- * Usage: browser, Node.js (with the `@fails-components/webtransport` package)
2073
- *
2074
- * @see https://developer.mozilla.org/en-US/docs/Web/API/WebTransport
2075
- * @see https://caniuse.com/webtransport
2076
- */
2077
- var WT = /*#__PURE__*/function (_Transport) {
2078
- function WT() {
2079
- return _Transport.apply(this, arguments) || this;
2080
- }
2081
- _inheritsLoose(WT, _Transport);
2082
- var _proto = WT.prototype;
2083
- _proto.doOpen = function doOpen() {
2084
- var _this = this;
2085
- try {
2086
- // @ts-ignore
2087
- this._transport = new WebTransport(this.createUri("https"), this.opts.transportOptions[this.name]);
2088
- } catch (err) {
2089
- return this.emitReserved("error", err);
2090
- }
2091
- this._transport.closed.then(function () {
2092
- debug$1("transport closed gracefully");
2093
- _this.onClose();
2094
- })["catch"](function (err) {
2095
- debug$1("transport closed due to %s", err);
2096
- _this.onError("webtransport error", err);
2097
- });
2098
- // note: we could have used async/await, but that would require some additional polyfills
2099
- this._transport.ready.then(function () {
2100
- _this._transport.createBidirectionalStream().then(function (stream) {
2101
- var decoderStream = createPacketDecoderStream(Number.MAX_SAFE_INTEGER, _this.socket.binaryType);
2102
- var reader = stream.readable.pipeThrough(decoderStream).getReader();
2103
- var encoderStream = createPacketEncoderStream();
2104
- encoderStream.readable.pipeTo(stream.writable);
2105
- _this._writer = encoderStream.writable.getWriter();
2106
- var read = function read() {
2107
- reader.read().then(function (_ref) {
2108
- var done = _ref.done,
2109
- value = _ref.value;
2110
- if (done) {
2111
- debug$1("session is closed");
2112
- return;
2113
- }
2114
- debug$1("received chunk: %o", value);
2115
- _this.onPacket(value);
2116
- read();
2117
- })["catch"](function (err) {
2118
- debug$1("an error occurred while reading: %s", err);
2119
- });
2120
- };
2121
- read();
2122
- var packet = {
2123
- type: "open"
2124
- };
2125
- if (_this.query.sid) {
2126
- packet.data = "{\"sid\":\"".concat(_this.query.sid, "\"}");
2127
- }
2128
- _this._writer.write(packet).then(function () {
2129
- return _this.onOpen();
2130
- });
2131
- });
2132
- });
2133
- };
2134
- _proto.write = function write(packets) {
2135
- var _this2 = this;
2136
- this.writable = false;
2137
- var _loop = function _loop() {
2138
- var packet = packets[i];
2139
- var lastPacket = i === packets.length - 1;
2140
- _this2._writer.write(packet).then(function () {
2141
- if (lastPacket) {
2142
- nextTick(function () {
2143
- _this2.writable = true;
2144
- _this2.emitReserved("drain");
2145
- }, _this2.setTimeoutFn);
2146
- }
2147
- });
2148
- };
2149
- for (var i = 0; i < packets.length; i++) {
2150
- _loop();
2151
- }
2152
- };
2153
- _proto.doClose = function doClose() {
2154
- var _a;
2155
- (_a = this._transport) === null || _a === void 0 ? void 0 : _a.close();
2156
- };
2157
- return _createClass(WT, [{
2158
- key: "name",
2159
- get: function get() {
2160
- return "webtransport";
2161
- }
2162
- }]);
2163
- }(Transport);
2164
-
2165
- var transports = {
2166
- websocket: WS,
2167
- webtransport: WT,
2168
- polling: XHR
2169
- };
2170
-
2171
- // imported from https://github.com/galkn/parseuri
2172
- /**
2173
- * Parses a URI
2174
- *
2175
- * Note: we could also have used the built-in URL object, but it isn't supported on all platforms.
2176
- *
2177
- * See:
2178
- * - https://developer.mozilla.org/en-US/docs/Web/API/URL
2179
- * - https://caniuse.com/url
2180
- * - https://www.rfc-editor.org/rfc/rfc3986#appendix-B
2181
- *
2182
- * History of the parse() method:
2183
- * - first commit: https://github.com/socketio/socket.io-client/commit/4ee1d5d94b3906a9c052b459f1a818b15f38f91c
2184
- * - export into its own module: https://github.com/socketio/engine.io-client/commit/de2c561e4564efeb78f1bdb1ba39ef81b2822cb3
2185
- * - reimport: https://github.com/socketio/engine.io-client/commit/df32277c3f6d622eec5ed09f493cae3f3391d242
2186
- *
2187
- * @author Steven Levithan <stevenlevithan.com> (MIT license)
2188
- * @api private
2189
- */
2190
- var re = /^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/;
2191
- var parts = ['source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'];
2192
- function parse(str) {
2193
- if (str.length > 8000) {
2194
- throw "URI too long";
2195
- }
2196
- var src = str,
2197
- b = str.indexOf('['),
2198
- e = str.indexOf(']');
2199
- if (b != -1 && e != -1) {
2200
- str = str.substring(0, b) + str.substring(b, e).replace(/:/g, ';') + str.substring(e, str.length);
2201
- }
2202
- var m = re.exec(str || ''),
2203
- uri = {},
2204
- i = 14;
2205
- while (i--) {
2206
- uri[parts[i]] = m[i] || '';
2207
- }
2208
- if (b != -1 && e != -1) {
2209
- uri.source = src;
2210
- uri.host = uri.host.substring(1, uri.host.length - 1).replace(/;/g, ':');
2211
- uri.authority = uri.authority.replace('[', '').replace(']', '').replace(/;/g, ':');
2212
- uri.ipv6uri = true;
2213
- }
2214
- uri.pathNames = pathNames(uri, uri['path']);
2215
- uri.queryKey = queryKey(uri, uri['query']);
2216
- return uri;
2217
- }
2218
- function pathNames(obj, path) {
2219
- var regx = /\/{2,9}/g,
2220
- names = path.replace(regx, "/").split("/");
2221
- if (path.slice(0, 1) == '/' || path.length === 0) {
2222
- names.splice(0, 1);
2223
- }
2224
- if (path.slice(-1) == '/') {
2225
- names.splice(names.length - 1, 1);
2226
- }
2227
- return names;
2228
- }
2229
- function queryKey(uri, query) {
2230
- var data = {};
2231
- query.replace(/(?:^|&)([^&=]*)=?([^&]*)/g, function ($0, $1, $2) {
2232
- if ($1) {
2233
- data[$1] = $2;
2234
- }
2235
- });
2236
- return data;
2237
- }
2238
-
2239
- var debug = debugModule("engine.io-client:socket"); // debug()
2240
- var withEventListeners = typeof addEventListener === "function" && typeof removeEventListener === "function";
2241
- var OFFLINE_EVENT_LISTENERS = [];
2242
- if (withEventListeners) {
2243
- // within a ServiceWorker, any event handler for the 'offline' event must be added on the initial evaluation of the
2244
- // script, so we create one single event listener here which will forward the event to the socket instances
2245
- addEventListener("offline", function () {
2246
- debug("closing %d connection(s) because the network was lost", OFFLINE_EVENT_LISTENERS.length);
2247
- OFFLINE_EVENT_LISTENERS.forEach(function (listener) {
2248
- return listener();
2249
- });
2250
- }, false);
2251
- }
2252
- /**
2253
- * This class provides a WebSocket-like interface to connect to an Engine.IO server. The connection will be established
2254
- * with one of the available low-level transports, like HTTP long-polling, WebSocket or WebTransport.
2255
- *
2256
- * This class comes without upgrade mechanism, which means that it will keep the first low-level transport that
2257
- * successfully establishes the connection.
2258
- *
2259
- * In order to allow tree-shaking, there are no transports included, that's why the `transports` option is mandatory.
2260
- *
2261
- * @example
2262
- * import { SocketWithoutUpgrade, WebSocket } from "engine.io-client";
2263
- *
2264
- * const socket = new SocketWithoutUpgrade({
2265
- * transports: [WebSocket]
2266
- * });
2267
- *
2268
- * socket.on("open", () => {
2269
- * socket.send("hello");
2270
- * });
2271
- *
2272
- * @see SocketWithUpgrade
2273
- * @see Socket
2274
- */
2275
- var SocketWithoutUpgrade = /*#__PURE__*/function (_Emitter) {
2276
- /**
2277
- * Socket constructor.
2278
- *
2279
- * @param {String|Object} uri - uri or options
2280
- * @param {Object} opts - options
2281
- */
2282
- function SocketWithoutUpgrade(uri, opts) {
2283
- var _this;
2284
- _this = _Emitter.call(this) || this;
2285
- _this.binaryType = defaultBinaryType;
2286
- _this.writeBuffer = [];
2287
- _this._prevBufferLen = 0;
2288
- _this._pingInterval = -1;
2289
- _this._pingTimeout = -1;
2290
- _this._maxPayload = -1;
2291
- /**
2292
- * The expiration timestamp of the {@link _pingTimeoutTimer} object is tracked, in case the timer is throttled and the
2293
- * callback is not fired on time. This can happen for example when a laptop is suspended or when a phone is locked.
2294
- */
2295
- _this._pingTimeoutTime = Infinity;
2296
- if (uri && "object" === _typeof(uri)) {
2297
- opts = uri;
2298
- uri = null;
2299
- }
2300
- if (uri) {
2301
- var parsedUri = parse(uri);
2302
- opts.hostname = parsedUri.host;
2303
- opts.secure = parsedUri.protocol === "https" || parsedUri.protocol === "wss";
2304
- opts.port = parsedUri.port;
2305
- if (parsedUri.query) opts.query = parsedUri.query;
2306
- } else if (opts.host) {
2307
- opts.hostname = parse(opts.host).host;
2308
- }
2309
- installTimerFunctions(_this, opts);
2310
- _this.secure = null != opts.secure ? opts.secure : typeof location !== "undefined" && "https:" === location.protocol;
2311
- if (opts.hostname && !opts.port) {
2312
- // if no port is specified manually, use the protocol default
2313
- opts.port = _this.secure ? "443" : "80";
2314
- }
2315
- _this.hostname = opts.hostname || (typeof location !== "undefined" ? location.hostname : "localhost");
2316
- _this.port = opts.port || (typeof location !== "undefined" && location.port ? location.port : _this.secure ? "443" : "80");
2317
- _this.transports = [];
2318
- _this._transportsByName = {};
2319
- opts.transports.forEach(function (t) {
2320
- var transportName = t.prototype.name;
2321
- _this.transports.push(transportName);
2322
- _this._transportsByName[transportName] = t;
2323
- });
2324
- _this.opts = _extends({
2325
- path: "/engine.io",
2326
- agent: false,
2327
- withCredentials: false,
2328
- upgrade: true,
2329
- timestampParam: "t",
2330
- rememberUpgrade: false,
2331
- addTrailingSlash: true,
2332
- rejectUnauthorized: true,
2333
- perMessageDeflate: {
2334
- threshold: 1024
2335
- },
2336
- transportOptions: {},
2337
- closeOnBeforeunload: false
2338
- }, opts);
2339
- _this.opts.path = _this.opts.path.replace(/\/$/, "") + (_this.opts.addTrailingSlash ? "/" : "");
2340
- if (typeof _this.opts.query === "string") {
2341
- _this.opts.query = decode(_this.opts.query);
2342
- }
2343
- if (withEventListeners) {
2344
- if (_this.opts.closeOnBeforeunload) {
2345
- // Firefox closes the connection when the "beforeunload" event is emitted but not Chrome. This event listener
2346
- // ensures every browser behaves the same (no "disconnect" event at the Socket.IO level when the page is
2347
- // closed/reloaded)
2348
- _this._beforeunloadEventListener = function () {
2349
- if (_this.transport) {
2350
- // silently close the transport
2351
- _this.transport.removeAllListeners();
2352
- _this.transport.close();
2353
- }
2354
- };
2355
- addEventListener("beforeunload", _this._beforeunloadEventListener, false);
2356
- }
2357
- if (_this.hostname !== "localhost") {
2358
- debug("adding listener for the 'offline' event");
2359
- _this._offlineEventListener = function () {
2360
- _this._onClose("transport close", {
2361
- description: "network connection lost"
2362
- });
2363
- };
2364
- OFFLINE_EVENT_LISTENERS.push(_this._offlineEventListener);
2365
- }
2366
- }
2367
- if (_this.opts.withCredentials) {
2368
- _this._cookieJar = createCookieJar();
2369
- }
2370
- _this._open();
2371
- return _this;
2372
- }
2373
- /**
2374
- * Creates transport of the given type.
2375
- *
2376
- * @param {String} name - transport name
2377
- * @return {Transport}
2378
- * @private
2379
- */
2380
- _inheritsLoose(SocketWithoutUpgrade, _Emitter);
2381
- var _proto = SocketWithoutUpgrade.prototype;
2382
- _proto.createTransport = function createTransport(name) {
2383
- debug('creating transport "%s"', name);
2384
- var query = _extends({}, this.opts.query);
2385
- // append engine.io protocol identifier
2386
- query.EIO = protocol;
2387
- // transport name
2388
- query.transport = name;
2389
- // session id if we already have one
2390
- if (this.id) query.sid = this.id;
2391
- var opts = _extends({}, this.opts, {
2392
- query: query,
2393
- socket: this,
2394
- hostname: this.hostname,
2395
- secure: this.secure,
2396
- port: this.port
2397
- }, this.opts.transportOptions[name]);
2398
- debug("options: %j", opts);
2399
- return new this._transportsByName[name](opts);
2400
- }
2401
- /**
2402
- * Initializes transport to use and starts probe.
2403
- *
2404
- * @private
2405
- */;
2406
- _proto._open = function _open() {
2407
- var _this2 = this;
2408
- if (this.transports.length === 0) {
2409
- // Emit error on next tick so it can be listened to
2410
- this.setTimeoutFn(function () {
2411
- _this2.emitReserved("error", "No transports available");
2412
- }, 0);
2413
- return;
2414
- }
2415
- var transportName = this.opts.rememberUpgrade && SocketWithoutUpgrade.priorWebsocketSuccess && this.transports.indexOf("websocket") !== -1 ? "websocket" : this.transports[0];
2416
- this.readyState = "opening";
2417
- var transport = this.createTransport(transportName);
2418
- transport.open();
2419
- this.setTransport(transport);
2420
- }
2421
- /**
2422
- * Sets the current transport. Disables the existing one (if any).
2423
- *
2424
- * @private
2425
- */;
2426
- _proto.setTransport = function setTransport(transport) {
2427
- var _this3 = this;
2428
- debug("setting transport %s", transport.name);
2429
- if (this.transport) {
2430
- debug("clearing existing transport %s", this.transport.name);
2431
- this.transport.removeAllListeners();
2432
- }
2433
- // set up transport
2434
- this.transport = transport;
2435
- // set up transport listeners
2436
- transport.on("drain", this._onDrain.bind(this)).on("packet", this._onPacket.bind(this)).on("error", this._onError.bind(this)).on("close", function (reason) {
2437
- return _this3._onClose("transport close", reason);
2438
- });
2439
- }
2440
- /**
2441
- * Called when connection is deemed open.
2442
- *
2443
- * @private
2444
- */;
2445
- _proto.onOpen = function onOpen() {
2446
- debug("socket open");
2447
- this.readyState = "open";
2448
- SocketWithoutUpgrade.priorWebsocketSuccess = "websocket" === this.transport.name;
2449
- this.emitReserved("open");
2450
- this.flush();
2451
- }
2452
- /**
2453
- * Handles a packet.
2454
- *
2455
- * @private
2456
- */;
2457
- _proto._onPacket = function _onPacket(packet) {
2458
- if ("opening" === this.readyState || "open" === this.readyState || "closing" === this.readyState) {
2459
- debug('socket receive: type "%s", data "%s"', packet.type, packet.data);
2460
- this.emitReserved("packet", packet);
2461
- // Socket is live - any packet counts
2462
- this.emitReserved("heartbeat");
2463
- switch (packet.type) {
2464
- case "open":
2465
- this.onHandshake(JSON.parse(packet.data));
2466
- break;
2467
- case "ping":
2468
- this._sendPacket("pong");
2469
- this.emitReserved("ping");
2470
- this.emitReserved("pong");
2471
- this._resetPingTimeout();
2472
- break;
2473
- case "error":
2474
- var err = new Error("server error");
2475
- // @ts-ignore
2476
- err.code = packet.data;
2477
- this._onError(err);
2478
- break;
2479
- case "message":
2480
- this.emitReserved("data", packet.data);
2481
- this.emitReserved("message", packet.data);
2482
- break;
2483
- }
2484
- } else {
2485
- debug('packet received with socket readyState "%s"', this.readyState);
2486
- }
2487
- }
2488
- /**
2489
- * Called upon handshake completion.
2490
- *
2491
- * @param {Object} data - handshake obj
2492
- * @private
2493
- */;
2494
- _proto.onHandshake = function onHandshake(data) {
2495
- this.emitReserved("handshake", data);
2496
- this.id = data.sid;
2497
- this.transport.query.sid = data.sid;
2498
- this._pingInterval = data.pingInterval;
2499
- this._pingTimeout = data.pingTimeout;
2500
- this._maxPayload = data.maxPayload;
2501
- this.onOpen();
2502
- // In case open handler closes socket
2503
- if ("closed" === this.readyState) return;
2504
- this._resetPingTimeout();
2505
- }
2506
- /**
2507
- * Sets and resets ping timeout timer based on server pings.
2508
- *
2509
- * @private
2510
- */;
2511
- _proto._resetPingTimeout = function _resetPingTimeout() {
2512
- var _this4 = this;
2513
- this.clearTimeoutFn(this._pingTimeoutTimer);
2514
- var delay = this._pingInterval + this._pingTimeout;
2515
- this._pingTimeoutTime = Date.now() + delay;
2516
- this._pingTimeoutTimer = this.setTimeoutFn(function () {
2517
- _this4._onClose("ping timeout");
2518
- }, delay);
2519
- if (this.opts.autoUnref) {
2520
- this._pingTimeoutTimer.unref();
2521
- }
2522
- }
2523
- /**
2524
- * Called on `drain` event
2525
- *
2526
- * @private
2527
- */;
2528
- _proto._onDrain = function _onDrain() {
2529
- this.writeBuffer.splice(0, this._prevBufferLen);
2530
- // setting prevBufferLen = 0 is very important
2531
- // for example, when upgrading, upgrade packet is sent over,
2532
- // and a nonzero prevBufferLen could cause problems on `drain`
2533
- this._prevBufferLen = 0;
2534
- if (0 === this.writeBuffer.length) {
2535
- this.emitReserved("drain");
2536
- } else {
2537
- this.flush();
2538
- }
2539
- }
2540
- /**
2541
- * Flush write buffers.
2542
- *
2543
- * @private
2544
- */;
2545
- _proto.flush = function flush() {
2546
- if ("closed" !== this.readyState && this.transport.writable && !this.upgrading && this.writeBuffer.length) {
2547
- var packets = this._getWritablePackets();
2548
- debug("flushing %d packets in socket", packets.length);
2549
- this.transport.send(packets);
2550
- // keep track of current length of writeBuffer
2551
- // splice writeBuffer and callbackBuffer on `drain`
2552
- this._prevBufferLen = packets.length;
2553
- this.emitReserved("flush");
2554
- }
2555
- }
2556
- /**
2557
- * Ensure the encoded size of the writeBuffer is below the maxPayload value sent by the server (only for HTTP
2558
- * long-polling)
2559
- *
2560
- * @private
2561
- */;
2562
- _proto._getWritablePackets = function _getWritablePackets() {
2563
- var shouldCheckPayloadSize = this._maxPayload && this.transport.name === "polling" && this.writeBuffer.length > 1;
2564
- if (!shouldCheckPayloadSize) {
2565
- return this.writeBuffer;
2566
- }
2567
- var payloadSize = 1; // first packet type
2568
- for (var i = 0; i < this.writeBuffer.length; i++) {
2569
- var data = this.writeBuffer[i].data;
2570
- if (data) {
2571
- payloadSize += byteLength(data);
2572
- }
2573
- if (i > 0 && payloadSize > this._maxPayload) {
2574
- debug("only send %d out of %d packets", i, this.writeBuffer.length);
2575
- return this.writeBuffer.slice(0, i);
2576
- }
2577
- payloadSize += 2; // separator + packet type
2578
- }
2579
- debug("payload size is %d (max: %d)", payloadSize, this._maxPayload);
2580
- return this.writeBuffer;
2581
- }
2582
- /**
2583
- * Checks whether the heartbeat timer has expired but the socket has not yet been notified.
2584
- *
2585
- * Note: this method is private for now because it does not really fit the WebSocket API, but if we put it in the
2586
- * `write()` method then the message would not be buffered by the Socket.IO client.
2587
- *
2588
- * @return {boolean}
2589
- * @private
2590
- */
2591
- /* private */;
2592
- _proto._hasPingExpired = function _hasPingExpired() {
2593
- var _this5 = this;
2594
- if (!this._pingTimeoutTime) return true;
2595
- var hasExpired = Date.now() > this._pingTimeoutTime;
2596
- if (hasExpired) {
2597
- debug("throttled timer detected, scheduling connection close");
2598
- this._pingTimeoutTime = 0;
2599
- nextTick(function () {
2600
- _this5._onClose("ping timeout");
2601
- }, this.setTimeoutFn);
2602
- }
2603
- return hasExpired;
2604
- }
2605
- /**
2606
- * Sends a message.
2607
- *
2608
- * @param {String} msg - message.
2609
- * @param {Object} options.
2610
- * @param {Function} fn - callback function.
2611
- * @return {Socket} for chaining.
2612
- */;
2613
- _proto.write = function write(msg, options, fn) {
2614
- this._sendPacket("message", msg, options, fn);
2615
- return this;
2616
- }
2617
- /**
2618
- * Sends a message. Alias of {@link Socket#write}.
2619
- *
2620
- * @param {String} msg - message.
2621
- * @param {Object} options.
2622
- * @param {Function} fn - callback function.
2623
- * @return {Socket} for chaining.
2624
- */;
2625
- _proto.send = function send(msg, options, fn) {
2626
- this._sendPacket("message", msg, options, fn);
2627
- return this;
2628
- }
2629
- /**
2630
- * Sends a packet.
2631
- *
2632
- * @param {String} type: packet type.
2633
- * @param {String} data.
2634
- * @param {Object} options.
2635
- * @param {Function} fn - callback function.
2636
- * @private
2637
- */;
2638
- _proto._sendPacket = function _sendPacket(type, data, options, fn) {
2639
- if ("function" === typeof data) {
2640
- fn = data;
2641
- data = undefined;
2642
- }
2643
- if ("function" === typeof options) {
2644
- fn = options;
2645
- options = null;
2646
- }
2647
- if ("closing" === this.readyState || "closed" === this.readyState) {
2648
- return;
2649
- }
2650
- options = options || {};
2651
- options.compress = false !== options.compress;
2652
- var packet = {
2653
- type: type,
2654
- data: data,
2655
- options: options
2656
- };
2657
- this.emitReserved("packetCreate", packet);
2658
- this.writeBuffer.push(packet);
2659
- if (fn) this.once("flush", fn);
2660
- this.flush();
2661
- }
2662
- /**
2663
- * Closes the connection.
2664
- */;
2665
- _proto.close = function close() {
2666
- var _this6 = this;
2667
- var close = function close() {
2668
- _this6._onClose("forced close");
2669
- debug("socket closing - telling transport to close");
2670
- _this6.transport.close();
2671
- };
2672
- var cleanupAndClose = function cleanupAndClose() {
2673
- _this6.off("upgrade", cleanupAndClose);
2674
- _this6.off("upgradeError", cleanupAndClose);
2675
- close();
2676
- };
2677
- var waitForUpgrade = function waitForUpgrade() {
2678
- // wait for upgrade to finish since we can't send packets while pausing a transport
2679
- _this6.once("upgrade", cleanupAndClose);
2680
- _this6.once("upgradeError", cleanupAndClose);
2681
- };
2682
- if ("opening" === this.readyState || "open" === this.readyState) {
2683
- this.readyState = "closing";
2684
- if (this.writeBuffer.length) {
2685
- this.once("drain", function () {
2686
- if (_this6.upgrading) {
2687
- waitForUpgrade();
2688
- } else {
2689
- close();
2690
- }
2691
- });
2692
- } else if (this.upgrading) {
2693
- waitForUpgrade();
2694
- } else {
2695
- close();
2696
- }
2697
- }
2698
- return this;
2699
- }
2700
- /**
2701
- * Called upon transport error
2702
- *
2703
- * @private
2704
- */;
2705
- _proto._onError = function _onError(err) {
2706
- debug("socket error %j", err);
2707
- SocketWithoutUpgrade.priorWebsocketSuccess = false;
2708
- if (this.opts.tryAllTransports && this.transports.length > 1 && this.readyState === "opening") {
2709
- debug("trying next transport");
2710
- this.transports.shift();
2711
- return this._open();
2712
- }
2713
- this.emitReserved("error", err);
2714
- this._onClose("transport error", err);
2715
- }
2716
- /**
2717
- * Called upon transport close.
2718
- *
2719
- * @private
2720
- */;
2721
- _proto._onClose = function _onClose(reason, description) {
2722
- if ("opening" === this.readyState || "open" === this.readyState || "closing" === this.readyState) {
2723
- debug('socket close with reason: "%s"', reason);
2724
- // clear timers
2725
- this.clearTimeoutFn(this._pingTimeoutTimer);
2726
- // stop event from firing again for transport
2727
- this.transport.removeAllListeners("close");
2728
- // ensure transport won't stay open
2729
- this.transport.close();
2730
- // ignore further transport communication
2731
- this.transport.removeAllListeners();
2732
- if (withEventListeners) {
2733
- if (this._beforeunloadEventListener) {
2734
- removeEventListener("beforeunload", this._beforeunloadEventListener, false);
2735
- }
2736
- if (this._offlineEventListener) {
2737
- var i = OFFLINE_EVENT_LISTENERS.indexOf(this._offlineEventListener);
2738
- if (i !== -1) {
2739
- debug("removing listener for the 'offline' event");
2740
- OFFLINE_EVENT_LISTENERS.splice(i, 1);
2741
- }
2742
- }
2743
- }
2744
- // set ready state
2745
- this.readyState = "closed";
2746
- // clear session id
2747
- this.id = null;
2748
- // emit close event
2749
- this.emitReserved("close", reason, description);
2750
- // clean buffers after, so users can still
2751
- // grab the buffers on `close` event
2752
- this.writeBuffer = [];
2753
- this._prevBufferLen = 0;
2754
- }
2755
- };
2756
- return SocketWithoutUpgrade;
2757
- }(Emitter);
2758
- SocketWithoutUpgrade.protocol = protocol;
2759
- /**
2760
- * This class provides a WebSocket-like interface to connect to an Engine.IO server. The connection will be established
2761
- * with one of the available low-level transports, like HTTP long-polling, WebSocket or WebTransport.
2762
- *
2763
- * This class comes with an upgrade mechanism, which means that once the connection is established with the first
2764
- * low-level transport, it will try to upgrade to a better transport.
2765
- *
2766
- * In order to allow tree-shaking, there are no transports included, that's why the `transports` option is mandatory.
2767
- *
2768
- * @example
2769
- * import { SocketWithUpgrade, WebSocket } from "engine.io-client";
2770
- *
2771
- * const socket = new SocketWithUpgrade({
2772
- * transports: [WebSocket]
2773
- * });
2774
- *
2775
- * socket.on("open", () => {
2776
- * socket.send("hello");
2777
- * });
2778
- *
2779
- * @see SocketWithoutUpgrade
2780
- * @see Socket
2781
- */
2782
- var SocketWithUpgrade = /*#__PURE__*/function (_SocketWithoutUpgrade) {
2783
- function SocketWithUpgrade() {
2784
- var _this7;
2785
- _this7 = _SocketWithoutUpgrade.apply(this, arguments) || this;
2786
- _this7._upgrades = [];
2787
- return _this7;
2788
- }
2789
- _inheritsLoose(SocketWithUpgrade, _SocketWithoutUpgrade);
2790
- var _proto2 = SocketWithUpgrade.prototype;
2791
- _proto2.onOpen = function onOpen() {
2792
- _SocketWithoutUpgrade.prototype.onOpen.call(this);
2793
- if ("open" === this.readyState && this.opts.upgrade) {
2794
- debug("starting upgrade probes");
2795
- for (var i = 0; i < this._upgrades.length; i++) {
2796
- this._probe(this._upgrades[i]);
2797
- }
2798
- }
2799
- }
2800
- /**
2801
- * Probes a transport.
2802
- *
2803
- * @param {String} name - transport name
2804
- * @private
2805
- */;
2806
- _proto2._probe = function _probe(name) {
2807
- var _this8 = this;
2808
- debug('probing transport "%s"', name);
2809
- var transport = this.createTransport(name);
2810
- var failed = false;
2811
- SocketWithoutUpgrade.priorWebsocketSuccess = false;
2812
- var onTransportOpen = function onTransportOpen() {
2813
- if (failed) return;
2814
- debug('probe transport "%s" opened', name);
2815
- transport.send([{
2816
- type: "ping",
2817
- data: "probe"
2818
- }]);
2819
- transport.once("packet", function (msg) {
2820
- if (failed) return;
2821
- if ("pong" === msg.type && "probe" === msg.data) {
2822
- debug('probe transport "%s" pong', name);
2823
- _this8.upgrading = true;
2824
- _this8.emitReserved("upgrading", transport);
2825
- if (!transport) return;
2826
- SocketWithoutUpgrade.priorWebsocketSuccess = "websocket" === transport.name;
2827
- debug('pausing current transport "%s"', _this8.transport.name);
2828
- _this8.transport.pause(function () {
2829
- if (failed) return;
2830
- if ("closed" === _this8.readyState) return;
2831
- debug("changing transport and sending upgrade packet");
2832
- cleanup();
2833
- _this8.setTransport(transport);
2834
- transport.send([{
2835
- type: "upgrade"
2836
- }]);
2837
- _this8.emitReserved("upgrade", transport);
2838
- transport = null;
2839
- _this8.upgrading = false;
2840
- _this8.flush();
2841
- });
2842
- } else {
2843
- debug('probe transport "%s" failed', name);
2844
- var err = new Error("probe error");
2845
- // @ts-ignore
2846
- err.transport = transport.name;
2847
- _this8.emitReserved("upgradeError", err);
2848
- }
2849
- });
2850
- };
2851
- function freezeTransport() {
2852
- if (failed) return;
2853
- // Any callback called by transport should be ignored since now
2854
- failed = true;
2855
- cleanup();
2856
- transport.close();
2857
- transport = null;
2858
- }
2859
- // Handle any error that happens while probing
2860
- var onerror = function onerror(err) {
2861
- var error = new Error("probe error: " + err);
2862
- // @ts-ignore
2863
- error.transport = transport.name;
2864
- freezeTransport();
2865
- debug('probe transport "%s" failed because of error: %s', name, err);
2866
- _this8.emitReserved("upgradeError", error);
2867
- };
2868
- function onTransportClose() {
2869
- onerror("transport closed");
2870
- }
2871
- // When the socket is closed while we're probing
2872
- function onclose() {
2873
- onerror("socket closed");
2874
- }
2875
- // When the socket is upgraded while we're probing
2876
- function onupgrade(to) {
2877
- if (transport && to.name !== transport.name) {
2878
- debug('"%s" works - aborting "%s"', to.name, transport.name);
2879
- freezeTransport();
2880
- }
2881
- }
2882
- // Remove all listeners on the transport and on self
2883
- var cleanup = function cleanup() {
2884
- transport.removeListener("open", onTransportOpen);
2885
- transport.removeListener("error", onerror);
2886
- transport.removeListener("close", onTransportClose);
2887
- _this8.off("close", onclose);
2888
- _this8.off("upgrading", onupgrade);
2889
- };
2890
- transport.once("open", onTransportOpen);
2891
- transport.once("error", onerror);
2892
- transport.once("close", onTransportClose);
2893
- this.once("close", onclose);
2894
- this.once("upgrading", onupgrade);
2895
- if (this._upgrades.indexOf("webtransport") !== -1 && name !== "webtransport") {
2896
- // favor WebTransport
2897
- this.setTimeoutFn(function () {
2898
- if (!failed) {
2899
- transport.open();
2900
- }
2901
- }, 200);
2902
- } else {
2903
- transport.open();
2904
- }
2905
- };
2906
- _proto2.onHandshake = function onHandshake(data) {
2907
- this._upgrades = this._filterUpgrades(data.upgrades);
2908
- _SocketWithoutUpgrade.prototype.onHandshake.call(this, data);
2909
- }
2910
- /**
2911
- * Filters upgrades, returning only those matching client transports.
2912
- *
2913
- * @param {Array} upgrades - server upgrades
2914
- * @private
2915
- */;
2916
- _proto2._filterUpgrades = function _filterUpgrades(upgrades) {
2917
- var filteredUpgrades = [];
2918
- for (var i = 0; i < upgrades.length; i++) {
2919
- if (~this.transports.indexOf(upgrades[i])) filteredUpgrades.push(upgrades[i]);
2920
- }
2921
- return filteredUpgrades;
2922
- };
2923
- return SocketWithUpgrade;
2924
- }(SocketWithoutUpgrade);
2925
- /**
2926
- * This class provides a WebSocket-like interface to connect to an Engine.IO server. The connection will be established
2927
- * with one of the available low-level transports, like HTTP long-polling, WebSocket or WebTransport.
2928
- *
2929
- * This class comes with an upgrade mechanism, which means that once the connection is established with the first
2930
- * low-level transport, it will try to upgrade to a better transport.
2931
- *
2932
- * @example
2933
- * import { Socket } from "engine.io-client";
2934
- *
2935
- * const socket = new Socket();
2936
- *
2937
- * socket.on("open", () => {
2938
- * socket.send("hello");
2939
- * });
2940
- *
2941
- * @see SocketWithoutUpgrade
2942
- * @see SocketWithUpgrade
2943
- */
2944
- var Socket = /*#__PURE__*/function (_SocketWithUpgrade) {
2945
- function Socket(uri) {
2946
- var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2947
- var o = _typeof(uri) === "object" ? uri : opts;
2948
- if (!o.transports || o.transports && typeof o.transports[0] === "string") {
2949
- o.transports = (o.transports || ["polling", "websocket", "webtransport"]).map(function (transportName) {
2950
- return transports[transportName];
2951
- }).filter(function (t) {
2952
- return !!t;
2953
- });
2954
- }
2955
- return _SocketWithUpgrade.call(this, uri, o) || this;
2956
- }
2957
- _inheritsLoose(Socket, _SocketWithUpgrade);
2958
- return Socket;
2959
- }(SocketWithUpgrade);
2960
-
2961
- var browserEntrypoint = (function (uri, opts) {
2962
- return new Socket(uri, opts);
2963
- });
2964
-
2965
- return browserEntrypoint;
2966
-
2967
- }));
2968
- //# sourceMappingURL=engine.io.js.map