@nethesis/phone-island 0.8.13 → 0.8.15

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 (167) hide show
  1. package/dist/App.js +1 -1
  2. package/dist/App.js.map +1 -1
  3. package/dist/components/CallView/DisplayName.js +1 -1
  4. package/dist/components/CallView/DisplayName.js.map +1 -1
  5. package/dist/components/Events.js.map +1 -1
  6. package/dist/components/Hangup.d.ts +1 -0
  7. package/dist/components/Hangup.js +1 -1
  8. package/dist/components/Hangup.js.map +1 -1
  9. package/dist/components/Island.js +1 -1
  10. package/dist/components/Island.js.map +1 -1
  11. package/dist/components/IslandMotion.js +1 -1
  12. package/dist/components/IslandMotion.js.map +1 -1
  13. package/dist/components/PhysicalRecorderView/PhysicalRecordingTimer.d.ts +5 -0
  14. package/dist/components/PhysicalRecorderView/PhysicalRecordingTimer.js +2 -0
  15. package/dist/components/PhysicalRecorderView/PhysicalRecordingTimer.js.map +1 -0
  16. package/dist/components/PhysicalRecorderView/index.d.ts +4 -0
  17. package/dist/components/PhysicalRecorderView/index.js +2 -0
  18. package/dist/components/PhysicalRecorderView/index.js.map +1 -0
  19. package/dist/components/RecorderView/Timer.js.map +1 -1
  20. package/dist/components/RecorderView/index.js +1 -1
  21. package/dist/components/RecorderView/index.js.map +1 -1
  22. package/dist/components/Socket.js +1 -1
  23. package/dist/components/Socket.js.map +1 -1
  24. package/dist/components/TransferView/ListAvatar.js +1 -1
  25. package/dist/components/TransferView/ListAvatar.js.map +1 -1
  26. package/dist/events/RecorderEvents.d.ts +4 -0
  27. package/dist/events/RecorderEvents.js +1 -1
  28. package/dist/events/RecorderEvents.js.map +1 -1
  29. package/dist/index.css +1 -1
  30. package/dist/lib/avatars/avatars.js +1 -1
  31. package/dist/lib/avatars/avatars.js.map +1 -1
  32. package/dist/lib/phone/audio.js.map +1 -1
  33. package/dist/lib/phone/call.d.ts +4 -0
  34. package/dist/lib/phone/call.js +1 -1
  35. package/dist/lib/phone/call.js.map +1 -1
  36. package/dist/lib/webrtc/janus.js +1 -1
  37. package/dist/lib/webrtc/janus.js.map +1 -1
  38. package/dist/lib/webrtc/messages.js.map +1 -1
  39. package/dist/models/index.d.ts +2 -0
  40. package/dist/models/index.js +1 -1
  41. package/dist/models/index.js.map +1 -1
  42. package/dist/models/island.d.ts +1 -1
  43. package/dist/models/island.js.map +1 -1
  44. package/dist/models/motions.d.ts +40 -0
  45. package/dist/models/motions.js +1 -1
  46. package/dist/models/motions.js.map +1 -1
  47. package/dist/models/physicalRecorder.d.ts +47 -0
  48. package/dist/models/physicalRecorder.js +2 -0
  49. package/dist/models/physicalRecorder.js.map +1 -0
  50. package/dist/node_modules/@emotion/stylis/dist/stylis.browser.esm.js +1 -1
  51. package/dist/node_modules/@emotion/stylis/dist/stylis.browser.esm.js.map +1 -1
  52. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.mjs.js.map +1 -1
  53. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.esm.js +1 -1
  54. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.esm.js.map +1 -1
  55. package/dist/node_modules/@fortawesome/fontawesome-svg-core/index.mjs.js +1 -1
  56. package/dist/node_modules/@fortawesome/fontawesome-svg-core/index.mjs.js.map +1 -1
  57. package/dist/node_modules/@fortawesome/react-fontawesome/index.es.js +1 -1
  58. package/dist/node_modules/@fortawesome/react-fontawesome/index.es.js.map +1 -1
  59. package/dist/node_modules/@headlessui/react/dist/components/menu/menu.js.map +1 -1
  60. package/dist/node_modules/@headlessui/react/dist/components/transitions/transition.js +1 -1
  61. package/dist/node_modules/@headlessui/react/dist/components/transitions/transition.js.map +1 -1
  62. package/dist/node_modules/@headlessui/react/dist/hooks/use-tracked-pointer.js.map +1 -1
  63. package/dist/node_modules/@headlessui/react/dist/utils/disposables.js.map +1 -1
  64. package/dist/node_modules/@headlessui/react/dist/utils/env.js.map +1 -1
  65. package/dist/node_modules/@headlessui/react/dist/utils/focus-management.js +1 -1
  66. package/dist/node_modules/@headlessui/react/dist/utils/focus-management.js.map +1 -1
  67. package/dist/node_modules/@headlessui/react/dist/utils/match.js.map +1 -1
  68. package/dist/node_modules/@headlessui/react/dist/utils/render.js.map +1 -1
  69. package/dist/node_modules/@socket.io/component-emitter/{index.mjs.js → lib/esm/index.js} +1 -1
  70. package/dist/node_modules/@socket.io/component-emitter/lib/esm/index.js.map +1 -0
  71. package/dist/node_modules/cross-fetch/dist/browser-ponyfill.js.map +1 -1
  72. package/dist/node_modules/engine.io-client/build/esm/contrib/has-cors.js.map +1 -1
  73. package/dist/node_modules/engine.io-client/build/esm/contrib/parseuri.js +1 -1
  74. package/dist/node_modules/engine.io-client/build/esm/contrib/parseuri.js.map +1 -1
  75. package/dist/node_modules/engine.io-client/build/esm/contrib/yeast.js +1 -1
  76. package/dist/node_modules/engine.io-client/build/esm/contrib/yeast.js.map +1 -1
  77. package/dist/node_modules/engine.io-client/build/esm/socket.js +1 -1
  78. package/dist/node_modules/engine.io-client/build/esm/socket.js.map +1 -1
  79. package/dist/node_modules/engine.io-client/build/esm/transport.js +1 -1
  80. package/dist/node_modules/engine.io-client/build/esm/transport.js.map +1 -1
  81. package/dist/node_modules/engine.io-client/build/esm/transports/index.js +1 -1
  82. package/dist/node_modules/engine.io-client/build/esm/transports/index.js.map +1 -1
  83. package/dist/node_modules/engine.io-client/build/esm/transports/polling.js +1 -1
  84. package/dist/node_modules/engine.io-client/build/esm/transports/polling.js.map +1 -1
  85. package/dist/node_modules/engine.io-client/build/esm/transports/websocket-constructor.browser.js.map +1 -1
  86. package/dist/node_modules/engine.io-client/build/esm/transports/websocket.js +1 -1
  87. package/dist/node_modules/engine.io-client/build/esm/transports/websocket.js.map +1 -1
  88. package/dist/node_modules/engine.io-client/build/esm/transports/webtransport.js +2 -0
  89. package/dist/node_modules/engine.io-client/build/esm/transports/webtransport.js.map +1 -0
  90. package/dist/node_modules/engine.io-client/build/esm/transports/xmlhttprequest.browser.js +1 -1
  91. package/dist/node_modules/engine.io-client/build/esm/transports/xmlhttprequest.browser.js.map +1 -1
  92. package/dist/node_modules/engine.io-client/build/esm/util.js +1 -1
  93. package/dist/node_modules/engine.io-client/build/esm/util.js.map +1 -1
  94. package/dist/node_modules/engine.io-parser/build/esm/commons.js.map +1 -1
  95. package/dist/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.js +1 -1
  96. package/dist/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.js.map +1 -1
  97. package/dist/node_modules/engine.io-parser/build/esm/decodePacket.browser.js +1 -1
  98. package/dist/node_modules/engine.io-parser/build/esm/decodePacket.browser.js.map +1 -1
  99. package/dist/node_modules/engine.io-parser/build/esm/encodePacket.browser.js +1 -1
  100. package/dist/node_modules/engine.io-parser/build/esm/encodePacket.browser.js.map +1 -1
  101. package/dist/node_modules/engine.io-parser/build/esm/index.js +1 -1
  102. package/dist/node_modules/engine.io-parser/build/esm/index.js.map +1 -1
  103. package/dist/node_modules/framer-motion/dist/framer-motion.js.map +1 -1
  104. package/dist/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js.map +1 -1
  105. package/dist/node_modules/i18next/dist/esm/i18next.js +1 -1
  106. package/dist/node_modules/i18next/dist/esm/i18next.js.map +1 -1
  107. package/dist/node_modules/i18next-browser-languagedetector/dist/esm/i18nextBrowserLanguageDetector.js +1 -1
  108. package/dist/node_modules/i18next-browser-languagedetector/dist/esm/i18nextBrowserLanguageDetector.js.map +1 -1
  109. package/dist/node_modules/i18next-http-backend/esm/index.js +1 -1
  110. package/dist/node_modules/i18next-http-backend/esm/index.js.map +1 -1
  111. package/dist/node_modules/i18next-http-backend/esm/request.js.map +1 -1
  112. package/dist/node_modules/js-base64/base64.mjs.js +1 -1
  113. package/dist/node_modules/js-base64/base64.mjs.js.map +1 -1
  114. package/dist/node_modules/moment/moment.js.map +1 -1
  115. package/dist/node_modules/object-assign/index.js +1 -1
  116. package/dist/node_modules/object-assign/index.js.map +1 -1
  117. package/dist/node_modules/prop-types/checkPropTypes.js.map +1 -1
  118. package/dist/node_modules/prop-types/factoryWithTypeCheckers.js +1 -1
  119. package/dist/node_modules/prop-types/factoryWithTypeCheckers.js.map +1 -1
  120. package/dist/node_modules/react-i18next/dist/es/useTranslation.js +1 -1
  121. package/dist/node_modules/react-i18next/dist/es/useTranslation.js.map +1 -1
  122. package/dist/node_modules/react-i18next/dist/es/utils.js +1 -1
  123. package/dist/node_modules/react-i18next/dist/es/utils.js.map +1 -1
  124. package/dist/node_modules/react-i18next/node_modules/@babel/runtime/helpers/iterableToArrayLimit.js.map +1 -1
  125. package/dist/node_modules/react-moment/dist/index.js.map +1 -1
  126. package/dist/node_modules/react-redux/es/hooks/useSelector.js.map +1 -1
  127. package/dist/node_modules/react-redux/es/utils/Subscription.js.map +1 -1
  128. package/dist/node_modules/react-tooltip/dist/react-tooltip.min.cjs.js +1 -1
  129. package/dist/node_modules/react-tooltip/dist/react-tooltip.min.cjs.js.map +1 -1
  130. package/dist/node_modules/redux/es/redux.js +1 -1
  131. package/dist/node_modules/redux/es/redux.js.map +1 -1
  132. package/dist/node_modules/socket.io-client/build/esm/contrib/backo2.js +1 -1
  133. package/dist/node_modules/socket.io-client/build/esm/contrib/backo2.js.map +1 -1
  134. package/dist/node_modules/socket.io-client/build/esm/manager.js +1 -1
  135. package/dist/node_modules/socket.io-client/build/esm/manager.js.map +1 -1
  136. package/dist/node_modules/socket.io-client/build/esm/socket.js +1 -1
  137. package/dist/node_modules/socket.io-client/build/esm/socket.js.map +1 -1
  138. package/dist/node_modules/socket.io-client/build/esm/url.js +1 -1
  139. package/dist/node_modules/socket.io-client/build/esm/url.js.map +1 -1
  140. package/dist/node_modules/socket.io-parser/build/esm/binary.js +1 -1
  141. package/dist/node_modules/socket.io-parser/build/esm/binary.js.map +1 -1
  142. package/dist/node_modules/socket.io-parser/build/esm/index.js +1 -1
  143. package/dist/node_modules/socket.io-parser/build/esm/index.js.map +1 -1
  144. package/dist/node_modules/socket.io-parser/build/esm/is-binary.js +1 -1
  145. package/dist/node_modules/socket.io-parser/build/esm/is-binary.js.map +1 -1
  146. package/dist/node_modules/tslib/tslib.es6.js.map +1 -1
  147. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +1 -1
  148. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js.map +1 -1
  149. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js.map +1 -1
  150. package/dist/node_modules/webm-duration-fix/lib/ebml/tools-ebml.js.map +1 -1
  151. package/dist/node_modules/webm-duration-fix/lib/index.js.map +1 -1
  152. package/dist/node_modules/webrtc-adapter/src/js/chrome/chrome_shim.js +1 -1
  153. package/dist/node_modules/webrtc-adapter/src/js/chrome/chrome_shim.js.map +1 -1
  154. package/dist/node_modules/webrtc-adapter/src/js/chrome/getusermedia.js.map +1 -1
  155. package/dist/node_modules/webrtc-adapter/src/js/common_shim.js +1 -1
  156. package/dist/node_modules/webrtc-adapter/src/js/common_shim.js.map +1 -1
  157. package/dist/node_modules/webrtc-adapter/src/js/firefox/firefox_shim.js.map +1 -1
  158. package/dist/node_modules/webrtc-adapter/src/js/safari/safari_shim.js.map +1 -1
  159. package/dist/node_modules/webrtc-adapter/src/js/utils.js.map +1 -1
  160. package/dist/services/astproxy.d.ts +1 -0
  161. package/dist/services/astproxy.js +1 -1
  162. package/dist/services/astproxy.js.map +1 -1
  163. package/dist/utils/customHooks/useLocalStorage.js.map +1 -1
  164. package/package.json +2 -2
  165. package/dist/_virtual/_rollupPluginBabelHelpers.js +0 -2
  166. package/dist/_virtual/_rollupPluginBabelHelpers.js.map +0 -1
  167. package/dist/node_modules/@socket.io/component-emitter/index.mjs.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"polling.js","sources":["../../../../../../node_modules/engine.io-client/build/esm/transports/polling.js"],"sourcesContent":["import { Transport } from \"../transport.js\";\nimport { yeast } from \"../contrib/yeast.js\";\nimport { encode } from \"../contrib/parseqs.js\";\nimport { encodePayload, decodePayload } from \"engine.io-parser\";\nimport { XHR as XMLHttpRequest } from \"./xmlhttprequest.js\";\nimport { Emitter } from \"@socket.io/component-emitter\";\nimport { installTimerFunctions, pick } from \"../util.js\";\nimport { globalThisShim as globalThis } from \"../globalThis.js\";\nfunction empty() { }\nconst hasXHR2 = (function () {\n const xhr = new XMLHttpRequest({\n xdomain: false\n });\n return null != xhr.responseType;\n})();\nexport class Polling extends Transport {\n /**\n * XHR Polling constructor.\n *\n * @param {Object} opts\n * @api public\n */\n constructor(opts) {\n super(opts);\n this.polling = false;\n if (typeof location !== \"undefined\") {\n const isSSL = \"https:\" === location.protocol;\n let port = location.port;\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? \"443\" : \"80\";\n }\n this.xd =\n (typeof location !== \"undefined\" &&\n opts.hostname !== location.hostname) ||\n port !== opts.port;\n this.xs = opts.secure !== isSSL;\n }\n /**\n * XHR supports binary\n */\n const forceBase64 = opts && opts.forceBase64;\n this.supportsBinary = hasXHR2 && !forceBase64;\n }\n /**\n * Transport name.\n */\n get name() {\n return \"polling\";\n }\n /**\n * Opens the socket (triggers polling). We write a PING message to determine\n * when the transport is open.\n *\n * @api private\n */\n doOpen() {\n this.poll();\n }\n /**\n * Pauses polling.\n *\n * @param {Function} callback upon buffers are flushed and transport is paused\n * @api private\n */\n pause(onPause) {\n this.readyState = \"pausing\";\n const pause = () => {\n this.readyState = \"paused\";\n onPause();\n };\n if (this.polling || !this.writable) {\n let total = 0;\n if (this.polling) {\n total++;\n this.once(\"pollComplete\", function () {\n --total || pause();\n });\n }\n if (!this.writable) {\n total++;\n this.once(\"drain\", function () {\n --total || pause();\n });\n }\n }\n else {\n pause();\n }\n }\n /**\n * Starts polling cycle.\n *\n * @api public\n */\n poll() {\n this.polling = true;\n this.doPoll();\n this.emitReserved(\"poll\");\n }\n /**\n * Overloads onData to detect payloads.\n *\n * @api private\n */\n onData(data) {\n const callback = packet => {\n // if its the first message we consider the transport open\n if (\"opening\" === this.readyState && packet.type === \"open\") {\n this.onOpen();\n }\n // if its a close packet, we close the ongoing requests\n if (\"close\" === packet.type) {\n this.onClose({ description: \"transport closed by the server\" });\n return false;\n }\n // otherwise bypass onData and handle the message\n this.onPacket(packet);\n };\n // decode payload\n decodePayload(data, this.socket.binaryType).forEach(callback);\n // if an event did not trigger closing\n if (\"closed\" !== this.readyState) {\n // if we got data we're not polling\n this.polling = false;\n this.emitReserved(\"pollComplete\");\n if (\"open\" === this.readyState) {\n this.poll();\n }\n else {\n }\n }\n }\n /**\n * For polling, send a close packet.\n *\n * @api private\n */\n doClose() {\n const close = () => {\n this.write([{ type: \"close\" }]);\n };\n if (\"open\" === this.readyState) {\n close();\n }\n else {\n // in case we're trying to close while\n // handshaking is in progress (GH-164)\n this.once(\"open\", close);\n }\n }\n /**\n * Writes a packets payload.\n *\n * @param {Array} data packets\n * @param {Function} drain callback\n * @api private\n */\n write(packets) {\n this.writable = false;\n encodePayload(packets, data => {\n this.doWrite(data, () => {\n this.writable = true;\n this.emitReserved(\"drain\");\n });\n });\n }\n /**\n * Generates uri for connection.\n *\n * @api private\n */\n uri() {\n let query = this.query || {};\n const schema = this.opts.secure ? \"https\" : \"http\";\n let port = \"\";\n // cache busting is forced\n if (false !== this.opts.timestampRequests) {\n query[this.opts.timestampParam] = yeast();\n }\n if (!this.supportsBinary && !query.sid) {\n query.b64 = 1;\n }\n // avoid port if default for schema\n if (this.opts.port &&\n ((\"https\" === schema && Number(this.opts.port) !== 443) ||\n (\"http\" === schema && Number(this.opts.port) !== 80))) {\n port = \":\" + this.opts.port;\n }\n const encodedQuery = encode(query);\n const ipv6 = this.opts.hostname.indexOf(\":\") !== -1;\n return (schema +\n \"://\" +\n (ipv6 ? \"[\" + this.opts.hostname + \"]\" : this.opts.hostname) +\n port +\n this.opts.path +\n (encodedQuery.length ? \"?\" + encodedQuery : \"\"));\n }\n /**\n * Creates a request.\n *\n * @param {String} method\n * @api private\n */\n request(opts = {}) {\n Object.assign(opts, { xd: this.xd, xs: this.xs }, this.opts);\n return new Request(this.uri(), opts);\n }\n /**\n * Sends data.\n *\n * @param {String} data to send.\n * @param {Function} called upon flush.\n * @api private\n */\n doWrite(data, fn) {\n const req = this.request({\n method: \"POST\",\n data: data\n });\n req.on(\"success\", fn);\n req.on(\"error\", (xhrStatus, context) => {\n this.onError(\"xhr post error\", xhrStatus, context);\n });\n }\n /**\n * Starts a poll cycle.\n *\n * @api private\n */\n doPoll() {\n const req = this.request();\n req.on(\"data\", this.onData.bind(this));\n req.on(\"error\", (xhrStatus, context) => {\n this.onError(\"xhr poll error\", xhrStatus, context);\n });\n this.pollXhr = req;\n }\n}\nexport class Request extends Emitter {\n /**\n * Request constructor\n *\n * @param {Object} options\n * @api public\n */\n constructor(uri, opts) {\n super();\n installTimerFunctions(this, opts);\n this.opts = opts;\n this.method = opts.method || \"GET\";\n this.uri = uri;\n this.async = false !== opts.async;\n this.data = undefined !== opts.data ? opts.data : null;\n this.create();\n }\n /**\n * Creates the XHR object and sends the request.\n *\n * @api private\n */\n create() {\n const opts = pick(this.opts, \"agent\", \"pfx\", \"key\", \"passphrase\", \"cert\", \"ca\", \"ciphers\", \"rejectUnauthorized\", \"autoUnref\");\n opts.xdomain = !!this.opts.xd;\n opts.xscheme = !!this.opts.xs;\n const xhr = (this.xhr = new XMLHttpRequest(opts));\n try {\n xhr.open(this.method, this.uri, this.async);\n try {\n if (this.opts.extraHeaders) {\n xhr.setDisableHeaderCheck && xhr.setDisableHeaderCheck(true);\n for (let i in this.opts.extraHeaders) {\n if (this.opts.extraHeaders.hasOwnProperty(i)) {\n xhr.setRequestHeader(i, this.opts.extraHeaders[i]);\n }\n }\n }\n }\n catch (e) { }\n if (\"POST\" === this.method) {\n try {\n xhr.setRequestHeader(\"Content-type\", \"text/plain;charset=UTF-8\");\n }\n catch (e) { }\n }\n try {\n xhr.setRequestHeader(\"Accept\", \"*/*\");\n }\n catch (e) { }\n // ie6 check\n if (\"withCredentials\" in xhr) {\n xhr.withCredentials = this.opts.withCredentials;\n }\n if (this.opts.requestTimeout) {\n xhr.timeout = this.opts.requestTimeout;\n }\n xhr.onreadystatechange = () => {\n if (4 !== xhr.readyState)\n return;\n if (200 === xhr.status || 1223 === xhr.status) {\n this.onLoad();\n }\n else {\n // make sure the `error` event handler that's user-set\n // does not throw in the same tick and gets caught here\n this.setTimeoutFn(() => {\n this.onError(typeof xhr.status === \"number\" ? xhr.status : 0);\n }, 0);\n }\n };\n xhr.send(this.data);\n }\n catch (e) {\n // Need to defer since .create() is called directly from the constructor\n // and thus the 'error' event can only be only bound *after* this exception\n // occurs. Therefore, also, we cannot throw here at all.\n this.setTimeoutFn(() => {\n this.onError(e);\n }, 0);\n return;\n }\n if (typeof document !== \"undefined\") {\n this.index = Request.requestsCount++;\n Request.requests[this.index] = this;\n }\n }\n /**\n * Called upon error.\n *\n * @api private\n */\n onError(err) {\n this.emitReserved(\"error\", err, this.xhr);\n this.cleanup(true);\n }\n /**\n * Cleans up house.\n *\n * @api private\n */\n cleanup(fromError) {\n if (\"undefined\" === typeof this.xhr || null === this.xhr) {\n return;\n }\n this.xhr.onreadystatechange = empty;\n if (fromError) {\n try {\n this.xhr.abort();\n }\n catch (e) { }\n }\n if (typeof document !== \"undefined\") {\n delete Request.requests[this.index];\n }\n this.xhr = null;\n }\n /**\n * Called upon load.\n *\n * @api private\n */\n onLoad() {\n const data = this.xhr.responseText;\n if (data !== null) {\n this.emitReserved(\"data\", data);\n this.emitReserved(\"success\");\n this.cleanup();\n }\n }\n /**\n * Aborts the request.\n *\n * @api public\n */\n abort() {\n this.cleanup();\n }\n}\nRequest.requestsCount = 0;\nRequest.requests = {};\n/**\n * Aborts pending requests when unloading the window. This is needed to prevent\n * memory leaks (e.g. when using IE) and to ensure that no spurious error is\n * emitted.\n */\nif (typeof document !== \"undefined\") {\n // @ts-ignore\n if (typeof attachEvent === \"function\") {\n // @ts-ignore\n attachEvent(\"onunload\", unloadHandler);\n }\n else if (typeof addEventListener === \"function\") {\n const terminationEvent = \"onpagehide\" in globalThis ? \"pagehide\" : \"unload\";\n addEventListener(terminationEvent, unloadHandler, false);\n }\n}\nfunction unloadHandler() {\n for (let i in Request.requests) {\n if (Request.requests.hasOwnProperty(i)) {\n Request.requests[i].abort();\n }\n }\n}\n"],"names":["empty","hasXHR2","XMLHttpRequest","xdomain","responseType","Polling","Transport","constructor","opts","super","this","polling","location","isSSL","protocol","port","xd","hostname","xs","secure","forceBase64","supportsBinary","name","doOpen","poll","pause","onPause","readyState","writable","total","once","doPoll","emitReserved","onData","data","decodePayload","socket","binaryType","forEach","packet","type","onOpen","onClose","description","onPacket","doClose","close","write","packets","encodePayload","doWrite","uri","query","schema","timestampRequests","timestampParam","yeast","sid","b64","Number","encodedQuery","encode","indexOf","path","length","request","arguments","undefined","Object","assign","Request","fn","req","method","on","xhrStatus","context","onError","bind","pollXhr","Emitter","installTimerFunctions","async","create","pick","xscheme","xhr","XHR","open","extraHeaders","setDisableHeaderCheck","i","hasOwnProperty","setRequestHeader","e","withCredentials","requestTimeout","timeout","onreadystatechange","status","onLoad","setTimeoutFn","send","document","index","requestsCount","requests","err","cleanup","fromError","abort","responseText","attachEvent","unloadHandler","addEventListener","terminationEvent","globalThis"],"mappings":"gZAQA,SAASA,IAAU,CACnB,MAAMC,EAIK,MAHK,IAAIC,MAAe,CAC3BC,SAAS,IAEMC,aAEhB,MAAMC,UAAgBC,EAAAA,UAOzBC,YAAYC,GAGR,GAFAC,MAAMD,GACNE,KAAKC,SAAU,EACS,oBAAbC,SAA0B,CACjC,MAAMC,EAAQ,WAAaD,SAASE,SACpC,IAAIC,EAAOH,SAASG,KAEfA,IACDA,EAAOF,EAAQ,MAAQ,MAE3BH,KAAKM,GACoB,oBAAbJ,UACJJ,EAAKS,WAAaL,SAASK,UAC3BF,IAASP,EAAKO,KACtBL,KAAKQ,GAAKV,EAAKW,SAAWN,CAC9B,CAIA,MAAMO,EAAcZ,GAAQA,EAAKY,YACjCV,KAAKW,e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AA8B,iBAAfS,EAAIa,OAAsBb,EAAIa,OAAS,EAAE,GAC9D,GACP,EAEJb,EAAIgB,KAAK5F,KAAKwB,KAUlB,CARA,MAAO4D,GAOH,YAHApF,KAAK2F,cAAa,KACd3F,KAAKmE,QAAQiB,EAAE,GAChB,EAEP,CACwB,oBAAbS,WACP7F,KAAK8F,MAAQlC,EAAQmC,gBACrBnC,EAAQoC,SAAShG,KAAK8F,OAAS9F,KAEvC,CAMAmE,QAAQ8B,GACJjG,KAAKsB,aAAa,QAAS2E,EAAKjG,KAAK4E,KACrC5E,KAAKkG,SAAQ,EACjB,CAMAA,QAAQC,GACJ,QAAI,IAAuBnG,KAAK4E,KAAO,OAAS5E,KAAK4E,IAArD,CAIA,GADA5E,KAAK4E,IAAIY,mBAAqBlG,EAC1B6G,EACA,IACInG,KAAK4E,IAAIwB,OAED,CAAZ,MAAOhB,GAAK,CAEQ,oBAAbS,iBACAjC,EAAQoC,SAAShG,KAAK8F,OAEjC9F,KAAK4E,IAAM,IAXX,CAYJ,CAMAc,SACI,MAAMlE,EAAOxB,KAAK4E,IAAIyB,aACT,OAAT7E,IACAxB,KAAKsB,aAAa,OAAQE,GAC1BxB,KAAKsB,aAAa,WAClBtB,KAAKkG,UAEb,CAMAE,QACIpG,KAAKkG,SACT,EASJ,GAPAtC,EAAQmC,cAAgB,EACxBnC,EAAQoC,SAAW,CAAA,EAMK,oBAAbH,SAEP,GAA2B,mBAAhBS,YAEPA,YAAY,WAAYC,QAEvB,GAAgC,mBAArBC,iBAAiC,CAC7C,MAAMC,EAAmB,eAAgBC,iBAAa,WAAa,SACnEF,iBAAiBC,EAAkBF,GAAe,EACtD,CAEJ,SAASA,IACL,IAAK,IAAItB,KAAKrB,EAAQoC,SACdpC,EAAQoC,SAASd,eAAeD,IAChCrB,EAAQoC,SAASf,GAAGmB,OAGhC"}
1
+ {"version":3,"file":"polling.js","sources":["../../../../../../node_modules/engine.io-client/build/esm/transports/polling.js"],"sourcesContent":["import { Transport } from \"../transport.js\";\nimport { yeast } from \"../contrib/yeast.js\";\nimport { encodePayload, decodePayload } from \"engine.io-parser\";\nimport { createCookieJar, XHR as XMLHttpRequest, } from \"./xmlhttprequest.js\";\nimport { Emitter } from \"@socket.io/component-emitter\";\nimport { installTimerFunctions, pick } from \"../util.js\";\nimport { globalThisShim as globalThis } from \"../globalThis.js\";\nfunction empty() { }\nconst hasXHR2 = (function () {\n const xhr = new XMLHttpRequest({\n xdomain: false,\n });\n return null != xhr.responseType;\n})();\nexport class Polling extends Transport {\n /**\n * XHR Polling constructor.\n *\n * @param {Object} opts\n * @package\n */\n constructor(opts) {\n super(opts);\n this.polling = false;\n if (typeof location !== \"undefined\") {\n const isSSL = \"https:\" === location.protocol;\n let port = location.port;\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? \"443\" : \"80\";\n }\n this.xd =\n (typeof location !== \"undefined\" &&\n opts.hostname !== location.hostname) ||\n port !== opts.port;\n }\n /**\n * XHR supports binary\n */\n const forceBase64 = opts && opts.forceBase64;\n this.supportsBinary = hasXHR2 && !forceBase64;\n if (this.opts.withCredentials) {\n this.cookieJar = createCookieJar();\n }\n }\n get name() {\n return \"polling\";\n }\n /**\n * Opens the socket (triggers polling). We write a PING message to determine\n * when the transport is open.\n *\n * @protected\n */\n doOpen() {\n this.poll();\n }\n /**\n * Pauses polling.\n *\n * @param {Function} onPause - callback upon buffers are flushed and transport is paused\n * @package\n */\n pause(onPause) {\n this.readyState = \"pausing\";\n const pause = () => {\n this.readyState = \"paused\";\n onPause();\n };\n if (this.polling || !this.writable) {\n let total = 0;\n if (this.polling) {\n total++;\n this.once(\"pollComplete\", function () {\n --total || pause();\n });\n }\n if (!this.writable) {\n total++;\n this.once(\"drain\", function () {\n --total || pause();\n });\n }\n }\n else {\n pause();\n }\n }\n /**\n * Starts polling cycle.\n *\n * @private\n */\n poll() {\n this.polling = true;\n this.doPoll();\n this.emitReserved(\"poll\");\n }\n /**\n * Overloads onData to detect payloads.\n *\n * @protected\n */\n onData(data) {\n const callback = (packet) => {\n // if its the first message we consider the transport open\n if (\"opening\" === this.readyState && packet.type === \"open\") {\n this.onOpen();\n }\n // if its a close packet, we close the ongoing requests\n if (\"close\" === packet.type) {\n this.onClose({ description: \"transport closed by the server\" });\n return false;\n }\n // otherwise bypass onData and handle the message\n this.onPacket(packet);\n };\n // decode payload\n decodePayload(data, this.socket.binaryType).forEach(callback);\n // if an event did not trigger closing\n if (\"closed\" !== this.readyState) {\n // if we got data we're not polling\n this.polling = false;\n this.emitReserved(\"pollComplete\");\n if (\"open\" === this.readyState) {\n this.poll();\n }\n else {\n }\n }\n }\n /**\n * For polling, send a close packet.\n *\n * @protected\n */\n doClose() {\n const close = () => {\n this.write([{ type: \"close\" }]);\n };\n if (\"open\" === this.readyState) {\n close();\n }\n else {\n // in case we're trying to close while\n // handshaking is in progress (GH-164)\n this.once(\"open\", close);\n }\n }\n /**\n * Writes a packets payload.\n *\n * @param {Array} packets - data packets\n * @protected\n */\n write(packets) {\n this.writable = false;\n encodePayload(packets, (data) => {\n this.doWrite(data, () => {\n this.writable = true;\n this.emitReserved(\"drain\");\n });\n });\n }\n /**\n * Generates uri for connection.\n *\n * @private\n */\n uri() {\n const schema = this.opts.secure ? \"https\" : \"http\";\n const query = this.query || {};\n // cache busting is forced\n if (false !== this.opts.timestampRequests) {\n query[this.opts.timestampParam] = yeast();\n }\n if (!this.supportsBinary && !query.sid) {\n query.b64 = 1;\n }\n return this.createUri(schema, query);\n }\n /**\n * Creates a request.\n *\n * @param {String} method\n * @private\n */\n request(opts = {}) {\n Object.assign(opts, { xd: this.xd, cookieJar: this.cookieJar }, this.opts);\n return new Request(this.uri(), opts);\n }\n /**\n * Sends data.\n *\n * @param {String} data to send.\n * @param {Function} called upon flush.\n * @private\n */\n doWrite(data, fn) {\n const req = this.request({\n method: \"POST\",\n data: data,\n });\n req.on(\"success\", fn);\n req.on(\"error\", (xhrStatus, context) => {\n this.onError(\"xhr post error\", xhrStatus, context);\n });\n }\n /**\n * Starts a poll cycle.\n *\n * @private\n */\n doPoll() {\n const req = this.request();\n req.on(\"data\", this.onData.bind(this));\n req.on(\"error\", (xhrStatus, context) => {\n this.onError(\"xhr poll error\", xhrStatus, context);\n });\n this.pollXhr = req;\n }\n}\nexport class Request extends Emitter {\n /**\n * Request constructor\n *\n * @param {Object} options\n * @package\n */\n constructor(uri, opts) {\n super();\n installTimerFunctions(this, opts);\n this.opts = opts;\n this.method = opts.method || \"GET\";\n this.uri = uri;\n this.data = undefined !== opts.data ? opts.data : null;\n this.create();\n }\n /**\n * Creates the XHR object and sends the request.\n *\n * @private\n */\n create() {\n var _a;\n const opts = pick(this.opts, \"agent\", \"pfx\", \"key\", \"passphrase\", \"cert\", \"ca\", \"ciphers\", \"rejectUnauthorized\", \"autoUnref\");\n opts.xdomain = !!this.opts.xd;\n const xhr = (this.xhr = new XMLHttpRequest(opts));\n try {\n xhr.open(this.method, this.uri, true);\n try {\n if (this.opts.extraHeaders) {\n xhr.setDisableHeaderCheck && xhr.setDisableHeaderCheck(true);\n for (let i in this.opts.extraHeaders) {\n if (this.opts.extraHeaders.hasOwnProperty(i)) {\n xhr.setRequestHeader(i, this.opts.extraHeaders[i]);\n }\n }\n }\n }\n catch (e) { }\n if (\"POST\" === this.method) {\n try {\n xhr.setRequestHeader(\"Content-type\", \"text/plain;charset=UTF-8\");\n }\n catch (e) { }\n }\n try {\n xhr.setRequestHeader(\"Accept\", \"*/*\");\n }\n catch (e) { }\n (_a = this.opts.cookieJar) === null || _a === void 0 ? void 0 : _a.addCookies(xhr);\n // ie6 check\n if (\"withCredentials\" in xhr) {\n xhr.withCredentials = this.opts.withCredentials;\n }\n if (this.opts.requestTimeout) {\n xhr.timeout = this.opts.requestTimeout;\n }\n xhr.onreadystatechange = () => {\n var _a;\n if (xhr.readyState === 3) {\n (_a = this.opts.cookieJar) === null || _a === void 0 ? void 0 : _a.parseCookies(xhr);\n }\n if (4 !== xhr.readyState)\n return;\n if (200 === xhr.status || 1223 === xhr.status) {\n this.onLoad();\n }\n else {\n // make sure the `error` event handler that's user-set\n // does not throw in the same tick and gets caught here\n this.setTimeoutFn(() => {\n this.onError(typeof xhr.status === \"number\" ? xhr.status : 0);\n }, 0);\n }\n };\n xhr.send(this.data);\n }\n catch (e) {\n // Need to defer since .create() is called directly from the constructor\n // and thus the 'error' event can only be only bound *after* this exception\n // occurs. Therefore, also, we cannot throw here at all.\n this.setTimeoutFn(() => {\n this.onError(e);\n }, 0);\n return;\n }\n if (typeof document !== \"undefined\") {\n this.index = Request.requestsCount++;\n Request.requests[this.index] = this;\n }\n }\n /**\n * Called upon error.\n *\n * @private\n */\n onError(err) {\n this.emitReserved(\"error\", err, this.xhr);\n this.cleanup(true);\n }\n /**\n * Cleans up house.\n *\n * @private\n */\n cleanup(fromError) {\n if (\"undefined\" === typeof this.xhr || null === this.xhr) {\n return;\n }\n this.xhr.onreadystatechange = empty;\n if (fromError) {\n try {\n this.xhr.abort();\n }\n catch (e) { }\n }\n if (typeof document !== \"undefined\") {\n delete Request.requests[this.index];\n }\n this.xhr = null;\n }\n /**\n * Called upon load.\n *\n * @private\n */\n onLoad() {\n const data = this.xhr.responseText;\n if (data !== null) {\n this.emitReserved(\"data\", data);\n this.emitReserved(\"success\");\n this.cleanup();\n }\n }\n /**\n * Aborts the request.\n *\n * @package\n */\n abort() {\n this.cleanup();\n }\n}\nRequest.requestsCount = 0;\nRequest.requests = {};\n/**\n * Aborts pending requests when unloading the window. This is needed to prevent\n * memory leaks (e.g. when using IE) and to ensure that no spurious error is\n * emitted.\n */\nif (typeof document !== \"undefined\") {\n // @ts-ignore\n if (typeof attachEvent === \"function\") {\n // @ts-ignore\n attachEvent(\"onunload\", unloadHandler);\n }\n else if (typeof addEventListener === \"function\") {\n const terminationEvent = \"onpagehide\" in globalThis ? \"pagehide\" : \"unload\";\n addEventListener(terminationEvent, unloadHandler, false);\n }\n}\nfunction unloadHandler() {\n for (let i in Request.requests) {\n if (Request.requests.hasOwnProperty(i)) {\n Request.requests[i].abort();\n }\n }\n}\n"],"names":["empty","hasXHR2","XMLHttpRequest","xdomain","responseType","Polling","Transport","constructor","opts","super","this","polling","location","isSSL","protocol","port","xd","hostname","forceBase64","supportsBinary","withCredentials","cookieJar","createCookieJar","name","doOpen","poll","pause","onPause","readyState","writable","total","once","doPoll","emitReserved","onData","data","decodePayload","socket","binaryType","forEach","packet","type","onOpen","onClose","description","onPacket","doClose","close","write","packets","encodePayload","doWrite","uri","schema","secure","query","timestampRequests","timestampParam","yeast","sid","b64","createUri","request","arguments","length","undefined","Object","assign","Request","fn","req","method","on","xhrStatus","context","onError","bind","pollXhr","Emitter","installTimerFunctions","create","_a","pick","xhr","XHR","open","extraHeaders","setDisableHeaderCheck","i","hasOwnProperty","setRequestHeader","e","addCookies","requestTimeout","timeout","onreadystatechange","parseCookies","status","onLoad","setTimeoutFn","send","document","index","requestsCount","requests","err","cleanup","fromError","abort","responseText","attachEvent","unloadHandler","addEventListener","terminationEvent","globalThis"],"mappings":"iXAOA,SAASA,IAAU,CACnB,MAAMC,EAIK,MAHK,IAAIC,MAAe,CAC3BC,SAAS,IAEMC,aAEhB,MAAMC,UAAgBC,EAAAA,UAOzBC,WAAAA,CAAYC,GAGR,GAFAC,MAAMD,GACNE,KAAKC,SAAU,EACS,oBAAbC,SAA0B,CACjC,MAAMC,EAAQ,WAAaD,SAASE,SACpC,IAAIC,EAAOH,SAASG,KAEfA,IACDA,EAAOF,EAAQ,MAAQ,MAE3BH,KAAKM,GACoB,oBAAbJ,UACJJ,EAAKS,WAAaL,SAASK,UAC3BF,IAASP,EAAKO,IAC1B,CAIA,MAAMG,EAAcV,GAAQA,EAAKU,YACjCR,KAAKS,eAAiBlB,IAAYiB,EAC9BR,KAAKF,KAAKY,kBACVV,KAAKW,UAAYC,EAAAA,kBAEzB,CACA,QAAIC,GACA,MAAO,SACX,CAOAC,MAAAA,GACId,KAAKe,MACT,CAOAC,KAAAA,CAAMC,GACFjB,KAAKkB,WAAa,UA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B,GACJ/F,KAAKuB,aAAa,QAASwE,EAAK/F,KAAKyE,KACrCzE,KAAKgG,SAAQ,EACjB,CAMAA,OAAAA,CAAQC,GACJ,QAAI,IAAuBjG,KAAKyE,KAAO,OAASzE,KAAKyE,IAArD,CAIA,GADAzE,KAAKyE,IAAIY,mBAAqB/F,EAC1B2G,EACA,IACIjG,KAAKyE,IAAIyB,OACb,CACA,MAAOjB,GAAK,CAEQ,oBAAbU,iBACAjC,EAAQoC,SAAS9F,KAAK4F,OAEjC5F,KAAKyE,IAAM,IAXX,CAYJ,CAMAe,MAAAA,GACI,MAAM/D,EAAOzB,KAAKyE,IAAI0B,aACT,OAAT1E,IACAzB,KAAKuB,aAAa,OAAQE,GAC1BzB,KAAKuB,aAAa,WAClBvB,KAAKgG,UAEb,CAMAE,KAAAA,GACIlG,KAAKgG,SACT,EASJ,GAPAtC,EAAQmC,cAAgB,EACxBnC,EAAQoC,SAAW,CAAA,EAMK,oBAAbH,SAEP,GAA2B,mBAAhBS,YAEPA,YAAY,WAAYC,QAEvB,GAAgC,mBAArBC,iBAAiC,CAC7C,MAAMC,EAAmB,eAAgBC,iBAAa,WAAa,SACnEF,iBAAiBC,EAAkBF,GAAe,EACtD,CAEJ,SAASA,IACL,IAAK,IAAIvB,KAAKpB,EAAQoC,SACdpC,EAAQoC,SAASf,eAAeD,IAChCpB,EAAQoC,SAAShB,GAAGoB,OAGhC"}
@@ -1 +1 @@
1
- {"version":3,"file":"websocket-constructor.browser.js","sources":["../../../../../../node_modules/engine.io-client/build/esm/transports/websocket-constructor.browser.js"],"sourcesContent":["import { globalThisShim as globalThis } from \"../globalThis.js\";\nexport const nextTick = (() => {\n const isPromiseAvailable = typeof Promise === \"function\" && typeof Promise.resolve === \"function\";\n if (isPromiseAvailable) {\n return cb => Promise.resolve().then(cb);\n }\n else {\n return (cb, setTimeoutFn) => setTimeoutFn(cb, 0);\n }\n})();\nexport const WebSocket = globalThis.WebSocket || globalThis.MozWebSocket;\nexport const usingBrowserWebSocket = true;\nexport const defaultBinaryType = \"arraybuffer\";\n"],"names":["nextTick","Promise","resolve","cb","then","setTimeoutFn","WebSocket","globalThis","globalThisShim","MozWebSocket"],"mappings":"8GACaA,MAAAA,EACqC,mBAAZC,SAAqD,mBAApBA,QAAQC,QAEhEC,GAAMF,QAAQC,UAAUE,KAAKD,GAG7B,CAACA,EAAIE,IAAiBA,EAAaF,EAAI,GAGzCG,EAAYC,EAAUC,eAACF,WAAaC,EAAAA,eAAWE,2DAE3B,gEADI"}
1
+ {"version":3,"file":"websocket-constructor.browser.js","sources":["../../../../../../node_modules/engine.io-client/build/esm/transports/websocket-constructor.browser.js"],"sourcesContent":["import { globalThisShim as globalThis } from \"../globalThis.js\";\nexport const nextTick = (() => {\n const isPromiseAvailable = typeof Promise === \"function\" && typeof Promise.resolve === \"function\";\n if (isPromiseAvailable) {\n return (cb) => Promise.resolve().then(cb);\n }\n else {\n return (cb, setTimeoutFn) => setTimeoutFn(cb, 0);\n }\n})();\nexport const WebSocket = globalThis.WebSocket || globalThis.MozWebSocket;\nexport const usingBrowserWebSocket = true;\nexport const defaultBinaryType = \"arraybuffer\";\n"],"names":["nextTick","Promise","resolve","cb","then","setTimeoutFn","WebSocket","globalThis","globalThisShim","MozWebSocket"],"mappings":"8GACaA,MAAAA,EACqC,mBAAZC,SAAqD,mBAApBA,QAAQC,QAE/DC,GAAOF,QAAQC,UAAUE,KAAKD,GAG/B,CAACA,EAAIE,IAAiBA,EAAaF,EAAI,GAGzCG,EAAYC,EAAUC,eAACF,WAAaC,EAAAA,eAAWE,2DAE3B,gEADI"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../transport.js"),s=require("../contrib/parseqs.js"),t=require("../contrib/yeast.js"),r=require("../util.js"),o=require("./websocket-constructor.browser.js"),i=require("../../../../engine.io-parser/build/esm/encodePacket.browser.js");require("../../../../engine.io-parser/build/esm/commons.js"),require("../../../../engine.io-parser/build/esm/contrib/base64-arraybuffer.js");const n="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class a extends e.Transport{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),s=this.opts.protocols,t=n?{}:r.pick(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(t.headers=this.opts.extraHeaders);try{this.ws=o.usingBrowserWebSocket&&!n?s?new o.WebSocket(e,s):new o.WebSocket(e):new o.WebSocket(e,s,t)}catch(e){return this.emitReserved("error",e)}this.ws.binaryType=this.socket.binaryType||o.defaultBinaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let s=0;s<e.length;s++){const t=e[s],r=s===e.length-1;i.default(t,this.supportsBinary,(e=>{try{o.usingBrowserWebSocket&&this.ws.send(e)}catch(e){}r&&o.nextTick((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){let e=this.query||{};const r=this.opts.secure?"wss":"ws";let o="";this.opts.port&&("wss"===r&&443!==Number(this.opts.port)||"ws"===r&&80!==Number(this.opts.port))&&(o=":"+this.opts.port),this.opts.timestampRequests&&(e[this.opts.timestampParam]=t.yeast()),this.supportsBinary||(e.b64=1);const i=s.encode(e);return r+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+o+this.opts.path+(i.length?"?"+i:"")}check(){return!!o.WebSocket}}exports.WS=a;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../transport.js"),s=require("../contrib/yeast.js"),t=require("../util.js"),r=require("./websocket-constructor.browser.js"),i=require("../../../../engine.io-parser/build/esm/encodePacket.browser.js");require("../../../../engine.io-parser/build/esm/commons.js"),require("../../../../engine.io-parser/build/esm/contrib/base64-arraybuffer.js");const o="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class n extends e.Transport{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),s=this.opts.protocols,i=o?{}:t.pick(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(i.headers=this.opts.extraHeaders);try{this.ws=r.usingBrowserWebSocket&&!o?s?new r.WebSocket(e,s):new r.WebSocket(e):new r.WebSocket(e,s,i)}catch(e){return this.emitReserved("error",e)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let s=0;s<e.length;s++){const t=e[s],o=s===e.length-1;i.encodePacket(t,this.supportsBinary,(e=>{try{r.usingBrowserWebSocket&&this.ws.send(e)}catch(e){}o&&r.nextTick((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=s.yeast()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}check(){return!!r.WebSocket}}exports.WS=n;
2
2
  //# sourceMappingURL=websocket.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"websocket.js","sources":["../../../../../../node_modules/engine.io-client/build/esm/transports/websocket.js"],"sourcesContent":["import { Transport } from \"../transport.js\";\nimport { encode } from \"../contrib/parseqs.js\";\nimport { yeast } from \"../contrib/yeast.js\";\nimport { pick } from \"../util.js\";\nimport { defaultBinaryType, nextTick, usingBrowserWebSocket, WebSocket } from \"./websocket-constructor.js\";\nimport { encodePacket } from \"engine.io-parser\";\n// detect ReactNative environment\nconst isReactNative = typeof navigator !== \"undefined\" &&\n typeof navigator.product === \"string\" &&\n navigator.product.toLowerCase() === \"reactnative\";\nexport class WS extends Transport {\n /**\n * WebSocket transport constructor.\n *\n * @api {Object} connection options\n * @api public\n */\n constructor(opts) {\n super(opts);\n this.supportsBinary = !opts.forceBase64;\n }\n /**\n * Transport name.\n *\n * @api public\n */\n get name() {\n return \"websocket\";\n }\n /**\n * Opens socket.\n *\n * @api private\n */\n doOpen() {\n if (!this.check()) {\n // let probe timeout\n return;\n }\n const uri = this.uri();\n const protocols = this.opts.protocols;\n // React Native only supports the 'headers' option, and will print a warning if anything else is passed\n const opts = isReactNative\n ? {}\n : pick(this.opts, \"agent\", \"perMessageDeflate\", \"pfx\", \"key\", \"passphrase\", \"cert\", \"ca\", \"ciphers\", \"rejectUnauthorized\", \"localAddress\", \"protocolVersion\", \"origin\", \"maxPayload\", \"family\", \"checkServerIdentity\");\n if (this.opts.extraHeaders) {\n opts.headers = this.opts.extraHeaders;\n }\n try {\n this.ws =\n usingBrowserWebSocket && !isReactNative\n ? protocols\n ? new WebSocket(uri, protocols)\n : new WebSocket(uri)\n : new WebSocket(uri, protocols, opts);\n }\n catch (err) {\n return this.emitReserved(\"error\", err);\n }\n this.ws.binaryType = this.socket.binaryType || defaultBinaryType;\n this.addEventListeners();\n }\n /**\n * Adds event listeners to the socket\n *\n * @api private\n */\n addEventListeners() {\n this.ws.onopen = () => {\n if (this.opts.autoUnref) {\n this.ws._socket.unref();\n }\n this.onOpen();\n };\n this.ws.onclose = closeEvent => this.onClose({\n description: \"websocket connection closed\",\n context: closeEvent\n });\n this.ws.onmessage = ev => this.onData(ev.data);\n this.ws.onerror = e => this.onError(\"websocket error\", e);\n }\n /**\n * Writes data to socket.\n *\n * @param {Array} array of packets.\n * @api private\n */\n write(packets) {\n this.writable = false;\n // encodePacket efficient as it uses WS framing\n // no need for encodePayload\n for (let i = 0; i < packets.length; i++) {\n const packet = packets[i];\n const lastPacket = i === packets.length - 1;\n encodePacket(packet, this.supportsBinary, data => {\n // always create a new object (GH-437)\n const opts = {};\n if (!usingBrowserWebSocket) {\n if (packet.options) {\n opts.compress = packet.options.compress;\n }\n if (this.opts.perMessageDeflate) {\n const len = \n // @ts-ignore\n \"string\" === typeof data ? Buffer.byteLength(data) : data.length;\n if (len < this.opts.perMessageDeflate.threshold) {\n opts.compress = false;\n }\n }\n }\n // Sometimes the websocket has already been closed but the browser didn't\n // have a chance of informing us about it yet, in that case send will\n // throw an error\n try {\n if (usingBrowserWebSocket) {\n // TypeError is thrown when passing the second argument on Safari\n this.ws.send(data);\n }\n else {\n this.ws.send(data, opts);\n }\n }\n catch (e) {\n }\n if (lastPacket) {\n // fake drain\n // defer to next tick to allow Socket to clear writeBuffer\n nextTick(() => {\n this.writable = true;\n this.emitReserved(\"drain\");\n }, this.setTimeoutFn);\n }\n });\n }\n }\n /**\n * Closes socket.\n *\n * @api private\n */\n doClose() {\n if (typeof this.ws !== \"undefined\") {\n this.ws.close();\n this.ws = null;\n }\n }\n /**\n * Generates uri for connection.\n *\n * @api private\n */\n uri() {\n let query = this.query || {};\n const schema = this.opts.secure ? \"wss\" : \"ws\";\n let port = \"\";\n // avoid port if default for schema\n if (this.opts.port &&\n ((\"wss\" === schema && Number(this.opts.port) !== 443) ||\n (\"ws\" === schema && Number(this.opts.port) !== 80))) {\n port = \":\" + this.opts.port;\n }\n // append timestamp to URI\n if (this.opts.timestampRequests) {\n query[this.opts.timestampParam] = yeast();\n }\n // communicate binary support capabilities\n if (!this.supportsBinary) {\n query.b64 = 1;\n }\n const encodedQuery = encode(query);\n const ipv6 = this.opts.hostname.indexOf(\":\") !== -1;\n return (schema +\n \"://\" +\n (ipv6 ? \"[\" + this.opts.hostname + \"]\" : this.opts.hostname) +\n port +\n this.opts.path +\n (encodedQuery.length ? \"?\" + encodedQuery : \"\"));\n }\n /**\n * Feature detection for WebSocket.\n *\n * @return {Boolean} whether this transport is available.\n * @api public\n */\n check() {\n return !!WebSocket;\n }\n}\n"],"names":["isReactNative","navigator","product","toLowerCase","WS","Transport","constructor","opts","super","this","supportsBinary","forceBase64","name","doOpen","check","uri","protocols","pick","extraHeaders","headers","ws","usingBrowserWebSocket","WebSocket","err","emitReserved","binaryType","socket","defaultBinaryType","addEventListeners","onopen","autoUnref","_socket","unref","onOpen","onclose","closeEvent","onClose","description","context","onmessage","ev","onData","data","onerror","e","onError","write","packets","writable","i","length","packet","lastPacket","encodePacket","send","nextTick","setTimeoutFn","doClose","close","query","schema","secure","port","Number","timestampRequests","timestampParam","yeast","b64","encodedQuery","encode","hostname","indexOf","path"],"mappings":"0cAOA,MAAMA,EAAqC,oBAAdC,WACI,iBAAtBA,UAAUC,SACmB,gBAApCD,UAAUC,QAAQC,cACf,MAAMC,UAAWC,EAAAA,UAOpBC,YAAYC,GACRC,MAAMD,GACNE,KAAKC,gBAAkBH,EAAKI,WAChC,CAMIC,WACA,MAAO,WACX,CAMAC,SACI,IAAKJ,KAAKK,QAEN,OAEJ,MAAMC,EAAMN,KAAKM,MACXC,EAAYP,KAAKF,KAAKS,UAEtBT,EAAOP,EACP,CAAA,EACAiB,EAAIA,KAACR,KAAKF,KAAM,QAAS,oBAAqB,MAAO,MAAO,aAAc,OAAQ,KAAM,UAAW,qBAAsB,eAAgB,kBAAmB,SAAU,aAAc,SAAU,uBAChME,KAAKF,KAAKW,eACVX,EAAKY,QAAUV,KAAKF,KAAKW,cAE7B,IACIT,KAAKW,GACDC,0BAA0BrB,EACpBgB,EACI,IAAIM,EAASA,UAACP,EAAKC,GACnB,IAAIM,EAAAA,UAAUP,GAClB,IAAIO,EAASA,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KuD,MAGvBrD,KAAKF,KAAKyD,oBACVL,EAAMlD,KAAKF,KAAK0D,gBAAkBC,EAAKA,SAGtCzD,KAAKC,iBACNiD,EAAMQ,IAAM,GAEhB,MAAMC,EAAeC,SAAOV,GAE5B,OAAQC,EACJ,QAF8C,IAArCnD,KAAKF,KAAK+D,SAASC,QAAQ,KAG5B,IAAM9D,KAAKF,KAAK+D,SAAW,IAAM7D,KAAKF,KAAK+D,UACnDR,EACArD,KAAKF,KAAKiE,MACTJ,EAAalB,OAAS,IAAMkB,EAAe,GACpD,CAOAtD,QACI,QAASQ,EAAAA,SACb"}
1
+ {"version":3,"file":"websocket.js","sources":["../../../../../../node_modules/engine.io-client/build/esm/transports/websocket.js"],"sourcesContent":["import { Transport } from \"../transport.js\";\nimport { yeast } from \"../contrib/yeast.js\";\nimport { pick } from \"../util.js\";\nimport { nextTick, usingBrowserWebSocket, WebSocket, } from \"./websocket-constructor.js\";\nimport { encodePacket } from \"engine.io-parser\";\n// detect ReactNative environment\nconst isReactNative = typeof navigator !== \"undefined\" &&\n typeof navigator.product === \"string\" &&\n navigator.product.toLowerCase() === \"reactnative\";\nexport class WS extends Transport {\n /**\n * WebSocket transport constructor.\n *\n * @param {Object} opts - connection options\n * @protected\n */\n constructor(opts) {\n super(opts);\n this.supportsBinary = !opts.forceBase64;\n }\n get name() {\n return \"websocket\";\n }\n doOpen() {\n if (!this.check()) {\n // let probe timeout\n return;\n }\n const uri = this.uri();\n const protocols = this.opts.protocols;\n // React Native only supports the 'headers' option, and will print a warning if anything else is passed\n const opts = isReactNative\n ? {}\n : pick(this.opts, \"agent\", \"perMessageDeflate\", \"pfx\", \"key\", \"passphrase\", \"cert\", \"ca\", \"ciphers\", \"rejectUnauthorized\", \"localAddress\", \"protocolVersion\", \"origin\", \"maxPayload\", \"family\", \"checkServerIdentity\");\n if (this.opts.extraHeaders) {\n opts.headers = this.opts.extraHeaders;\n }\n try {\n this.ws =\n usingBrowserWebSocket && !isReactNative\n ? protocols\n ? new WebSocket(uri, protocols)\n : new WebSocket(uri)\n : new WebSocket(uri, protocols, opts);\n }\n catch (err) {\n return this.emitReserved(\"error\", err);\n }\n this.ws.binaryType = this.socket.binaryType;\n this.addEventListeners();\n }\n /**\n * Adds event listeners to the socket\n *\n * @private\n */\n addEventListeners() {\n this.ws.onopen = () => {\n if (this.opts.autoUnref) {\n this.ws._socket.unref();\n }\n this.onOpen();\n };\n this.ws.onclose = (closeEvent) => this.onClose({\n description: \"websocket connection closed\",\n context: closeEvent,\n });\n this.ws.onmessage = (ev) => this.onData(ev.data);\n this.ws.onerror = (e) => this.onError(\"websocket error\", e);\n }\n write(packets) {\n this.writable = false;\n // encodePacket efficient as it uses WS framing\n // no need for encodePayload\n for (let i = 0; i < packets.length; i++) {\n const packet = packets[i];\n const lastPacket = i === packets.length - 1;\n encodePacket(packet, this.supportsBinary, (data) => {\n // always create a new object (GH-437)\n const opts = {};\n if (!usingBrowserWebSocket) {\n if (packet.options) {\n opts.compress = packet.options.compress;\n }\n if (this.opts.perMessageDeflate) {\n const len = \n // @ts-ignore\n \"string\" === typeof data ? Buffer.byteLength(data) : data.length;\n if (len < this.opts.perMessageDeflate.threshold) {\n opts.compress = false;\n }\n }\n }\n // Sometimes the websocket has already been closed but the browser didn't\n // have a chance of informing us about it yet, in that case send will\n // throw an error\n try {\n if (usingBrowserWebSocket) {\n // TypeError is thrown when passing the second argument on Safari\n this.ws.send(data);\n }\n else {\n this.ws.send(data, opts);\n }\n }\n catch (e) {\n }\n if (lastPacket) {\n // fake drain\n // defer to next tick to allow Socket to clear writeBuffer\n nextTick(() => {\n this.writable = true;\n this.emitReserved(\"drain\");\n }, this.setTimeoutFn);\n }\n });\n }\n }\n doClose() {\n if (typeof this.ws !== \"undefined\") {\n this.ws.close();\n this.ws = null;\n }\n }\n /**\n * Generates uri for connection.\n *\n * @private\n */\n uri() {\n const schema = this.opts.secure ? \"wss\" : \"ws\";\n const query = this.query || {};\n // append timestamp to URI\n if (this.opts.timestampRequests) {\n query[this.opts.timestampParam] = yeast();\n }\n // communicate binary support capabilities\n if (!this.supportsBinary) {\n query.b64 = 1;\n }\n return this.createUri(schema, query);\n }\n /**\n * Feature detection for WebSocket.\n *\n * @return {Boolean} whether this transport is available.\n * @private\n */\n check() {\n return !!WebSocket;\n }\n}\n"],"names":["isReactNative","navigator","product","toLowerCase","WS","Transport","constructor","opts","super","this","supportsBinary","forceBase64","name","doOpen","check","uri","protocols","pick","extraHeaders","headers","ws","usingBrowserWebSocket","WebSocket","err","emitReserved","binaryType","socket","addEventListeners","onopen","autoUnref","_socket","unref","onOpen","onclose","closeEvent","onClose","description","context","onmessage","ev","onData","data","onerror","e","onError","write","packets","writable","i","length","packet","lastPacket","encodePacket","send","nextTick","setTimeoutFn","doClose","close","schema","secure","query","timestampRequests","timestampParam","yeast","b64","createUri"],"mappings":"uaAMA,MAAMA,EAAqC,oBAAdC,WACI,iBAAtBA,UAAUC,SACmB,gBAApCD,UAAUC,QAAQC,cACf,MAAMC,UAAWC,EAAAA,UAOpBC,WAAAA,CAAYC,GACRC,MAAMD,GACNE,KAAKC,gBAAkBH,EAAKI,WAChC,CACA,QAAIC,GACA,MAAO,WACX,CACAC,MAAAA,GACI,IAAKJ,KAAKK,QAEN,OAEJ,MAAMC,EAAMN,KAAKM,MACXC,EAAYP,KAAKF,KAAKS,UAEtBT,EAAOP,EACP,CAAA,EACAiB,EAAIA,KAACR,KAAKF,KAAM,QAAS,oBAAqB,MAAO,MAAO,aAAc,OAAQ,KAAM,UAAW,qBAAsB,eAAgB,kBAAmB,SAAU,aAAc,SAAU,uBAChME,KAAKF,KAAKW,eACVX,EAAKY,QAAUV,KAAKF,KAAKW,cAE7B,IACIT,KAAKW,GACDC,0BAA0BrB,EACpBgB,EACI,IAAIM,EAASA,UAACP,EAAKC,GACnB,IAAIM,EAAAA,UAAUP,GAClB,IAAIO,EAASA,UAACP,EAAKC,EAAWT,EAC3C,CACD,MAAOgB,GACH,OAAOd,KAAKe,aAAa,Q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ports,"__esModule",{value:!0});var e=require("../transport.js"),t=require("./websocket-constructor.browser.js"),r=require("../../../../engine.io-parser/build/esm/index.js");class s extends e.Transport{get name(){return"webtransport"}doOpen(){"function"==typeof WebTransport&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then((()=>{this.onClose()})).catch((e=>{this.onError("webtransport error",e)})),this.transport.ready.then((()=>{this.transport.createBidirectionalStream().then((e=>{const t=r.createPacketDecoderStream(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=e.readable.pipeThrough(t).getReader(),i=r.createPacketEncoderStream();i.readable.pipeTo(e.writable),this.writer=i.writable.getWriter();const n=()=>{s.read().then((e=>{let{done:t,value:r}=e;t||(this.onPacket(r),n())})).catch((e=>{}))};n();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this.writer.write(o).then((()=>this.onOpen()))}))})))}write(e){this.writable=!1;for(let r=0;r<e.length;r++){const s=e[r],i=r===e.length-1;this.writer.write(s).then((()=>{i&&t.nextTick((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){var e;null===(e=this.transport)||void 0===e||e.close()}}exports.WT=s;
2
+ //# sourceMappingURL=webtransport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webtransport.js","sources":["../../../../../../node_modules/engine.io-client/build/esm/transports/webtransport.js"],"sourcesContent":["import { Transport } from \"../transport.js\";\nimport { nextTick } from \"./websocket-constructor.js\";\nimport { createPacketDecoderStream, createPacketEncoderStream, } from \"engine.io-parser\";\nexport class WT extends Transport {\n get name() {\n return \"webtransport\";\n }\n doOpen() {\n // @ts-ignore\n if (typeof WebTransport !== \"function\") {\n return;\n }\n // @ts-ignore\n this.transport = new WebTransport(this.createUri(\"https\"), this.opts.transportOptions[this.name]);\n this.transport.closed\n .then(() => {\n this.onClose();\n })\n .catch((err) => {\n this.onError(\"webtransport error\", err);\n });\n // note: we could have used async/await, but that would require some additional polyfills\n this.transport.ready.then(() => {\n this.transport.createBidirectionalStream().then((stream) => {\n const decoderStream = createPacketDecoderStream(Number.MAX_SAFE_INTEGER, this.socket.binaryType);\n const reader = stream.readable.pipeThrough(decoderStream).getReader();\n const encoderStream = createPacketEncoderStream();\n encoderStream.readable.pipeTo(stream.writable);\n this.writer = encoderStream.writable.getWriter();\n const read = () => {\n reader\n .read()\n .then(({ done, value }) => {\n if (done) {\n return;\n }\n this.onPacket(value);\n read();\n })\n .catch((err) => {\n });\n };\n read();\n const packet = { type: \"open\" };\n if (this.query.sid) {\n packet.data = `{\"sid\":\"${this.query.sid}\"}`;\n }\n this.writer.write(packet).then(() => this.onOpen());\n });\n });\n }\n write(packets) {\n this.writable = false;\n for (let i = 0; i < packets.length; i++) {\n const packet = packets[i];\n const lastPacket = i === packets.length - 1;\n this.writer.write(packet).then(() => {\n if (lastPacket) {\n nextTick(() => {\n this.writable = true;\n this.emitReserved(\"drain\");\n }, this.setTimeoutFn);\n }\n });\n }\n }\n doClose() {\n var _a;\n (_a = this.transport) === null || _a === void 0 ? void 0 : _a.close();\n }\n}\n"],"names":["WT","Transport","name","doOpen","WebTransport","this","transport","createUri","opts","transportOptions","closed","then","onClose","catch","err","onError","ready","createBidirectionalStream","stream","decoderStream","createPacketDecoderStream","Number","MAX_SAFE_INTEGER","socket","binaryType","reader","readable","pipeThrough","getReader","encoderStream","createPacketEncoderStream","pipeTo","writable","writer","getWriter","read","_ref","done","value","onPacket","packet","type","query","sid","data","write","onOpen","packets","i","length","lastPacket","nextTick","emitReserved","setTimeoutFn","doClose","_a","close"],"mappings":"kNAGO,MAAMA,UAAWC,EAAAA,UACpB,QAAIC,GACA,MAAO,cACX,CACAC,MAAAA,GAEgC,mBAAjBC,eAIXC,KAAKC,UAAY,IAAIF,aAAaC,KAAKE,UAAU,SAAUF,KAAKG,KAAKC,iBAAiBJ,KAAKH,OAC3FG,KAAKC,UAAUI,OACVC,MAAK,KACNN,KAAKO,SAAS,IAEbC,OAAOC,IACRT,KAAKU,QAAQ,qBAAsBD,EAAI,IAG3CT,KAAKC,UAAUU,MAAML,MAAK,KACtBN,KAAKC,UAAUW,4BAA4BN,MAAMO,IAC7C,MAAMC,EAAgBC,EAAAA,0BAA0BC,OAAOC,iBAAkBjB,KAAKkB,OAAOC,YAC/EC,EAASP,EAAOQ,SAASC,YAAYR,GAAeS,YACpDC,EAAgBC,EAAAA,4BACtBD,EAAcH,SAASK,OAAOb,EAAOc,UACrC3B,KAAK4B,OAASJ,EAAcG,SAASE,YACrC,MAAMC,EAAOA,KACTV,EACKU,OACAxB,MAAKyB,IAAqB,IAApBC,KAAEA,EAAIC,MAAEA,GAAOF,EAClBC,IAGJhC,KAAKkC,SAASD,GACdH,IAAM,IAELtB,OAAOC,OACV,EAENqB,IACA,MAAMK,EAAS,CAAEC,KAAM,QACnBpC,KAAKqC,MAAMC,MACXH,EAAOI,KAAO,WAAWvC,KAAKqC,MAAMC,SAExCtC,KAAK4B,OAAOY,MAAML,GAAQ7B,MAAK,IAAMN,KAAKyC,UAAS,GACrD,IAEV,CACAD,KAAAA,CAAME,GACF1C,KAAK2B,UAAW,EAChB,IAAK,IAAIgB,EAAI,EAAGA,EAAID,EAAQE,OAAQD,IAAK,CACrC,MAAMR,EAASO,EAAQC,GACjBE,EAAaF,IAAMD,EAAQE,OAAS,EAC1C5C,KAAK4B,OAAOY,MAAML,GAAQ7B,MAAK,KACvBuC,GACAC,EAAAA,UAAS,KACL9C,KAAK2B,UAAW,EAChB3B,KAAK+C,aAAa,QAAQ,GAC3B/C,KAAKgD,aACZ,GAER,CACJ,CACAC,OAAAA,GACI,IAAIC,EACsB,QAAzBA,EAAKlD,KAAKC,iBAA8B,IAAPiD,GAAyBA,EAAGC,OAClE"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../contrib/has-cors.js"),t=require("../globalThis.browser.js");exports.XHR=function(r){const o=r.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!o||e.hasCORS))return new XMLHttpRequest}catch(e){}if(!o)try{return new(t.globalThisShim[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../contrib/has-cors.js"),t=require("../globalThis.browser.js");exports.XHR=function(r){const o=r.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!o||e.hasCORS))return new XMLHttpRequest}catch(e){}if(!o)try{return new(t.globalThisShim[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}},exports.createCookieJar=function(){};
2
2
  //# sourceMappingURL=xmlhttprequest.browser.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"xmlhttprequest.browser.js","sources":["../../../../../../node_modules/engine.io-client/build/esm/transports/xmlhttprequest.browser.js"],"sourcesContent":["// browser shim for xmlhttprequest module\nimport { hasCORS } from \"../contrib/has-cors.js\";\nimport { globalThisShim as globalThis } from \"../globalThis.js\";\nexport function XHR(opts) {\n const xdomain = opts.xdomain;\n // XMLHttpRequest can be disabled on IE\n try {\n if (\"undefined\" !== typeof XMLHttpRequest && (!xdomain || hasCORS)) {\n return new XMLHttpRequest();\n }\n }\n catch (e) { }\n if (!xdomain) {\n try {\n return new globalThis[[\"Active\"].concat(\"Object\").join(\"X\")](\"Microsoft.XMLHTTP\");\n }\n catch (e) { }\n }\n}\n"],"names":["opts","xdomain","XMLHttpRequest","hasCORS","e","globalThis","globalThisShim","concat","join"],"mappings":"8JAGO,SAAaA,GAChB,MAAMC,EAAUD,EAAKC,QAErB,IACI,GAAI,oBAAuBC,kBAAoBD,GAAWE,EAAOA,SAC7D,OAAO,IAAID,cAGP,CAAZ,MAAOE,GAAK,CACZ,IAAKH,EACD,IACI,OAAO,IAAII,EAAUC,eAAC,CAAC,UAAUC,OAAO,UAAUC,KAAK,OAAM,oBAErD,CAAZ,MAAOJ,GAAK,CAEpB"}
1
+ {"version":3,"file":"xmlhttprequest.browser.js","sources":["../../../../../../node_modules/engine.io-client/build/esm/transports/xmlhttprequest.browser.js"],"sourcesContent":["// browser shim for xmlhttprequest module\nimport { hasCORS } from \"../contrib/has-cors.js\";\nimport { globalThisShim as globalThis } from \"../globalThis.js\";\nexport function XHR(opts) {\n const xdomain = opts.xdomain;\n // XMLHttpRequest can be disabled on IE\n try {\n if (\"undefined\" !== typeof XMLHttpRequest && (!xdomain || hasCORS)) {\n return new XMLHttpRequest();\n }\n }\n catch (e) { }\n if (!xdomain) {\n try {\n return new globalThis[[\"Active\"].concat(\"Object\").join(\"X\")](\"Microsoft.XMLHTTP\");\n }\n catch (e) { }\n }\n}\nexport function createCookieJar() { }\n"],"names":["opts","xdomain","XMLHttpRequest","hasCORS","e","globalThis","globalThisShim","concat","join"],"mappings":"8JAGO,SAAaA,GAChB,MAAMC,EAAUD,EAAKC,QAErB,IACI,GAAI,oBAAuBC,kBAAoBD,GAAWE,EAAOA,SAC7D,OAAO,IAAID,cAEnB,CACA,MAAOE,GAAK,CACZ,IAAKH,EACD,IACI,OAAO,IAAII,EAAUC,eAAC,CAAC,UAAUC,OAAO,UAAUC,KAAK,OAAM,oBACjE,CACA,MAAOJ,GAAK,CAEpB,0BACO,WAA2B"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./globalThis.browser.js");const t=setTimeout,i=clearTimeout;exports.byteLength=function(e){return"string"==typeof e?function(e){let t=0,i=0;for(let r=0,n=e.length;r<n;r++)t=e.charCodeAt(r),t<128?i+=1:t<2048?i+=2:t<55296||t>=57344?i+=3:(r++,i+=4);return i}(e):Math.ceil(1.33*(e.byteLength||e.size))},exports.installTimerFunctions=function(r,n){n.useNativeTimers?(r.setTimeoutFn=t.bind(e.globalThisShim),r.clearTimeoutFn=i.bind(e.globalThisShim)):(r.setTimeoutFn=setTimeout.bind(e.globalThisShim),r.clearTimeoutFn=clearTimeout.bind(e.globalThisShim))},exports.pick=function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];return i.reduce(((t,i)=>(e.hasOwnProperty(i)&&(t[i]=e[i]),t)),{})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./globalThis.browser.js");const i=e.globalThisShim.setTimeout,t=e.globalThisShim.clearTimeout;exports.byteLength=function(e){return"string"==typeof e?function(e){let i=0,t=0;for(let o=0,r=e.length;o<r;o++)i=e.charCodeAt(o),i<128?t+=1:i<2048?t+=2:i<55296||i>=57344?t+=3:(o++,t+=4);return t}(e):Math.ceil(1.33*(e.byteLength||e.size))},exports.installTimerFunctions=function(o,r){r.useNativeTimers?(o.setTimeoutFn=i.bind(e.globalThisShim),o.clearTimeoutFn=t.bind(e.globalThisShim)):(o.setTimeoutFn=e.globalThisShim.setTimeout.bind(e.globalThisShim),o.clearTimeoutFn=e.globalThisShim.clearTimeout.bind(e.globalThisShim))},exports.pick=function(e){for(var i=arguments.length,t=new Array(i>1?i-1:0),o=1;o<i;o++)t[o-1]=arguments[o];return t.reduce(((i,t)=>(e.hasOwnProperty(t)&&(i[t]=e[t]),i)),{})};
2
2
  //# sourceMappingURL=util.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"util.js","sources":["../../../../../node_modules/engine.io-client/build/esm/util.js"],"sourcesContent":["import { globalThisShim as globalThis } from \"./globalThis.js\";\nexport function pick(obj, ...attr) {\n return attr.reduce((acc, k) => {\n if (obj.hasOwnProperty(k)) {\n acc[k] = obj[k];\n }\n return acc;\n }, {});\n}\n// Keep a reference to the real timeout functions so they can be used when overridden\nconst NATIVE_SET_TIMEOUT = setTimeout;\nconst NATIVE_CLEAR_TIMEOUT = clearTimeout;\nexport function installTimerFunctions(obj, opts) {\n if (opts.useNativeTimers) {\n obj.setTimeoutFn = NATIVE_SET_TIMEOUT.bind(globalThis);\n obj.clearTimeoutFn = NATIVE_CLEAR_TIMEOUT.bind(globalThis);\n }\n else {\n obj.setTimeoutFn = setTimeout.bind(globalThis);\n obj.clearTimeoutFn = clearTimeout.bind(globalThis);\n }\n}\n// base64 encoded buffers are about 33% bigger (https://en.wikipedia.org/wiki/Base64)\nconst BASE64_OVERHEAD = 1.33;\n// we could also have used `new Blob([obj]).size`, but it isn't supported in IE9\nexport function byteLength(obj) {\n if (typeof obj === \"string\") {\n return utf8Length(obj);\n }\n // arraybuffer or blob\n return Math.ceil((obj.byteLength || obj.size) * BASE64_OVERHEAD);\n}\nfunction utf8Length(str) {\n let c = 0, length = 0;\n for (let i = 0, l = str.length; i < l; i++) {\n c = str.charCodeAt(i);\n if (c < 0x80) {\n length += 1;\n }\n else if (c < 0x800) {\n length += 2;\n }\n else if (c < 0xd800 || c >= 0xe000) {\n length += 3;\n }\n else {\n i++;\n length += 4;\n }\n }\n return length;\n}\n"],"names":["NATIVE_SET_TIMEOUT","setTimeout","NATIVE_CLEAR_TIMEOUT","clearTimeout","obj","str","c","length","i","l","charCodeAt","utf8Length","Math","ceil","byteLength","size","opts","useNativeTimers","setTimeoutFn","bind","globalThis","globalThisShim","clearTimeoutFn","_len","arguments","attr","Array","_key","reduce","acc","k","hasOwnProperty"],"mappings":"6GAUA,MAAMA,EAAqBC,WACrBC,EAAuBC,gCActB,SAAoBC,GACvB,MAAmB,iBAARA,EAMf,SAAoBC,GAChB,IAAIC,EAAI,EAAGC,EAAS,EACpB,IAAK,IAAIC,EAAI,EAAGC,EAAIJ,EAAIE,OAAQC,EAAIC,EAAGD,IACnCF,EAAID,EAAIK,WAAWF,GACfF,EAAI,IACJC,GAAU,EAELD,EAAI,KACTC,GAAU,EAELD,EAAI,OAAUA,GAAK,MACxBC,GAAU,GAGVC,IACAD,GAAU,GAGlB,OAAOA,CACX,CAxBeI,CAAWP,GAGfQ,KAAKC,KAPQ,MAOFT,EAAIU,YAAcV,EAAIW,MAC5C,gCAnBO,SAA+BX,EAAKY,GACnCA,EAAKC,iBACLb,EAAIc,aAAelB,EAAmBmB,KAAKC,EAAUC,gBACrDjB,EAAIkB,eAAiBpB,EAAqBiB,KAAKC,EAAUC,kBAGzDjB,EAAIc,aAAejB,WAAWkB,KAAKC,EAAUC,gBAC7CjB,EAAIkB,eAAiBnB,aAAagB,KAAKC,EAAUC,gBAEzD,eApBO,SAAcjB,GAAc,IAAAmB,IAAAA,EAAAC,UAAAjB,OAANkB,MAAIC,MAAAH,EAAAA,EAAAA,OAAAI,EAAA,EAAAA,EAAAJ,EAAAI,IAAJF,EAAIE,EAAAH,GAAAA,UAAAG,GAC7B,OAAOF,EAAKG,QAAO,CAACC,EAAKC,KACjB1B,EAAI2B,eAAeD,KACnBD,EAAIC,GAAK1B,EAAI0B,IAEVD,IACR,CAAE,EACT"}
1
+ {"version":3,"file":"util.js","sources":["../../../../../node_modules/engine.io-client/build/esm/util.js"],"sourcesContent":["import { globalThisShim as globalThis } from \"./globalThis.js\";\nexport function pick(obj, ...attr) {\n return attr.reduce((acc, k) => {\n if (obj.hasOwnProperty(k)) {\n acc[k] = obj[k];\n }\n return acc;\n }, {});\n}\n// Keep a reference to the real timeout functions so they can be used when overridden\nconst NATIVE_SET_TIMEOUT = globalThis.setTimeout;\nconst NATIVE_CLEAR_TIMEOUT = globalThis.clearTimeout;\nexport function installTimerFunctions(obj, opts) {\n if (opts.useNativeTimers) {\n obj.setTimeoutFn = NATIVE_SET_TIMEOUT.bind(globalThis);\n obj.clearTimeoutFn = NATIVE_CLEAR_TIMEOUT.bind(globalThis);\n }\n else {\n obj.setTimeoutFn = globalThis.setTimeout.bind(globalThis);\n obj.clearTimeoutFn = globalThis.clearTimeout.bind(globalThis);\n }\n}\n// base64 encoded buffers are about 33% bigger (https://en.wikipedia.org/wiki/Base64)\nconst BASE64_OVERHEAD = 1.33;\n// we could also have used `new Blob([obj]).size`, but it isn't supported in IE9\nexport function byteLength(obj) {\n if (typeof obj === \"string\") {\n return utf8Length(obj);\n }\n // arraybuffer or blob\n return Math.ceil((obj.byteLength || obj.size) * BASE64_OVERHEAD);\n}\nfunction utf8Length(str) {\n let c = 0, length = 0;\n for (let i = 0, l = str.length; i < l; i++) {\n c = str.charCodeAt(i);\n if (c < 0x80) {\n length += 1;\n }\n else if (c < 0x800) {\n length += 2;\n }\n else if (c < 0xd800 || c >= 0xe000) {\n length += 3;\n }\n else {\n i++;\n length += 4;\n }\n }\n return length;\n}\n"],"names":["NATIVE_SET_TIMEOUT","globalThis","globalThisShim","setTimeout","NATIVE_CLEAR_TIMEOUT","clearTimeout","obj","str","c","length","i","l","charCodeAt","utf8Length","Math","ceil","byteLength","size","opts","useNativeTimers","setTimeoutFn","bind","clearTimeoutFn","_len","arguments","attr","Array","_key","reduce","acc","k","hasOwnProperty"],"mappings":"6GAUA,MAAMA,EAAqBC,EAAUC,eAACC,WAChCC,EAAuBH,EAAUC,eAACG,gCAcjC,SAAoBC,GACvB,MAAmB,iBAARA,EAMf,SAAoBC,GAChB,IAAIC,EAAI,EAAGC,EAAS,EACpB,IAAK,IAAIC,EAAI,EAAGC,EAAIJ,EAAIE,OAAQC,EAAIC,EAAGD,IACnCF,EAAID,EAAIK,WAAWF,GACfF,EAAI,IACJC,GAAU,EAELD,EAAI,KACTC,GAAU,EAELD,EAAI,OAAUA,GAAK,MACxBC,GAAU,GAGVC,IACAD,GAAU,GAGlB,OAAOA,CACX,CAxBeI,CAAWP,GAGfQ,KAAKC,KAPQ,MAOFT,EAAIU,YAAcV,EAAIW,MAC5C,gCAnBO,SAA+BX,EAAKY,GACnCA,EAAKC,iBACLb,EAAIc,aAAepB,EAAmBqB,KAAKpB,EAAUC,gBACrDI,EAAIgB,eAAiBlB,EAAqBiB,KAAKpB,EAAUC,kBAGzDI,EAAIc,aAAenB,EAAUC,eAACC,WAAWkB,KAAKpB,EAAUC,gBACxDI,EAAIgB,eAAiBrB,EAAUC,eAACG,aAAagB,KAAKpB,EAAUC,gBAEpE,eApBO,SAAcI,GAAc,IAAAiB,IAAAA,EAAAC,UAAAf,OAANgB,MAAIC,MAAAH,EAAAA,EAAAA,OAAAI,EAAA,EAAAA,EAAAJ,EAAAI,IAAJF,EAAIE,EAAAH,GAAAA,UAAAG,GAC7B,OAAOF,EAAKG,QAAO,CAACC,EAAKC,KACjBxB,EAAIyB,eAAeD,KACnBD,EAAIC,GAAKxB,EAAIwB,IAEVD,IACR,CAAE,EACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"commons.js","sources":["../../../../../node_modules/engine.io-parser/build/esm/commons.js"],"sourcesContent":["const PACKET_TYPES = Object.create(null); // no Map = no polyfill\nPACKET_TYPES[\"open\"] = \"0\";\nPACKET_TYPES[\"close\"] = \"1\";\nPACKET_TYPES[\"ping\"] = \"2\";\nPACKET_TYPES[\"pong\"] = \"3\";\nPACKET_TYPES[\"message\"] = \"4\";\nPACKET_TYPES[\"upgrade\"] = \"5\";\nPACKET_TYPES[\"noop\"] = \"6\";\nconst PACKET_TYPES_REVERSE = Object.create(null);\nObject.keys(PACKET_TYPES).forEach(key => {\n PACKET_TYPES_REVERSE[PACKET_TYPES[key]] = key;\n});\nconst ERROR_PACKET = { type: \"error\", data: \"parser error\" };\nexport { PACKET_TYPES, PACKET_TYPES_REVERSE, ERROR_PACKET };\n"],"names":["PACKET_TYPES","Object","create","PACKET_TYPES_REVERSE","keys","forEach","key","type","data"],"mappings":"oEAAMA,MAAAA,EAAeC,OAAOC,OAAO,MACnCF,EAAmB,KAAI,IACvBA,EAAoB,MAAI,IACxBA,EAAmB,KAAI,IACvBA,EAAmB,KAAI,IACvBA,EAAsB,QAAI,IAC1BA,EAAsB,QAAI,IAC1BA,EAAmB,KAAI,IACvB,MAAMG,EAAuBF,OAAOC,OAAO,MAC3CD,OAAOG,KAAKJ,GAAcK,SAAQC,IAC9BH,EAAqBH,EAAaM,IAAQA,CAAG,yBAE5B,CAAEC,KAAM,QAASC,KAAM"}
1
+ {"version":3,"file":"commons.js","sources":["../../../../../node_modules/engine.io-parser/build/esm/commons.js"],"sourcesContent":["const PACKET_TYPES = Object.create(null); // no Map = no polyfill\nPACKET_TYPES[\"open\"] = \"0\";\nPACKET_TYPES[\"close\"] = \"1\";\nPACKET_TYPES[\"ping\"] = \"2\";\nPACKET_TYPES[\"pong\"] = \"3\";\nPACKET_TYPES[\"message\"] = \"4\";\nPACKET_TYPES[\"upgrade\"] = \"5\";\nPACKET_TYPES[\"noop\"] = \"6\";\nconst PACKET_TYPES_REVERSE = Object.create(null);\nObject.keys(PACKET_TYPES).forEach((key) => {\n PACKET_TYPES_REVERSE[PACKET_TYPES[key]] = key;\n});\nconst ERROR_PACKET = { type: \"error\", data: \"parser error\" };\nexport { PACKET_TYPES, PACKET_TYPES_REVERSE, ERROR_PACKET };\n"],"names":["PACKET_TYPES","Object","create","PACKET_TYPES_REVERSE","keys","forEach","key","type","data"],"mappings":"oEAAMA,MAAAA,EAAeC,OAAOC,OAAO,MACnCF,EAAmB,KAAI,IACvBA,EAAoB,MAAI,IACxBA,EAAmB,KAAI,IACvBA,EAAmB,KAAI,IACvBA,EAAsB,QAAI,IAC1BA,EAAsB,QAAI,IAC1BA,EAAmB,KAAI,IACvB,MAAMG,EAAuBF,OAAOC,OAAO,MAC3CD,OAAOG,KAAKJ,GAAcK,SAASC,IAC/BH,EAAqBH,EAAaM,IAAQA,CAAG,yBAE5B,CAAEC,KAAM,QAASC,KAAM"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let r=0;r<e.length;r++)t[e.charCodeAt(r)]=r;exports.decode=e=>{let r,n,o,d,a,c=.75*e.length,h=e.length,l=0;"="===e[e.length-1]&&(c--,"="===e[e.length-2]&&c--);const A=new ArrayBuffer(c),f=new Uint8Array(A);for(r=0;r<h;r+=4)n=t[e.charCodeAt(r)],o=t[e.charCodeAt(r+1)],d=t[e.charCodeAt(r+2)],a=t[e.charCodeAt(r+3)],f[l++]=n<<2|o>>4,f[l++]=(15&o)<<4|d>>2,f[l++]=(3&d)<<6|63&a;return A};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let r=0;r<64;r++)t[e.charCodeAt(r)]=r;exports.decode=e=>{let r,n,o,d,a,c=.75*e.length,h=e.length,A=0;"="===e[e.length-1]&&(c--,"="===e[e.length-2]&&c--);const l=new ArrayBuffer(c),f=new Uint8Array(l);for(r=0;r<h;r+=4)n=t[e.charCodeAt(r)],o=t[e.charCodeAt(r+1)],d=t[e.charCodeAt(r+2)],a=t[e.charCodeAt(r+3)],f[A++]=n<<2|o>>4,f[A++]=(15&o)<<4|d>>2,f[A++]=(3&d)<<6|63&a;return l};
2
2
  //# sourceMappingURL=base64-arraybuffer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"base64-arraybuffer.js","sources":["../../../../../../node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.js"],"sourcesContent":["const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n// Use a lookup table to find the index.\nconst lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);\nfor (let i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n}\nexport const encode = (arraybuffer) => {\n let bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = '';\n for (i = 0; i < len; i += 3) {\n base64 += chars[bytes[i] >> 2];\n base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n base64 += chars[bytes[i + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + '=';\n }\n else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + '==';\n }\n return base64;\n};\nexport const decode = (base64) => {\n let bufferLength = base64.length * 0.75, len = base64.length, i, p = 0, encoded1, encoded2, encoded3, encoded4;\n if (base64[base64.length - 1] === '=') {\n bufferLength--;\n if (base64[base64.length - 2] === '=') {\n bufferLength--;\n }\n }\n const arraybuffer = new ArrayBuffer(bufferLength), bytes = new Uint8Array(arraybuffer);\n for (i = 0; i < len; i += 4) {\n encoded1 = lookup[base64.charCodeAt(i)];\n encoded2 = lookup[base64.charCodeAt(i + 1)];\n encoded3 = lookup[base64.charCodeAt(i + 2)];\n encoded4 = lookup[base64.charCodeAt(i + 3)];\n bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n }\n return arraybuffer;\n};\n"],"names":["chars","lookup","Uint8Array","i","length","charCodeAt","base64","encoded1","encoded2","encoded3","encoded4","bufferLength","len","p","arraybuffer","ArrayBuffer","bytes"],"mappings":"oEAAA,MAAMA,EAAQ,mEAERC,EAA+B,oBAAfC,WAA6B,GAAK,IAAIA,WAAW,KACvE,IAAK,IAAIC,EAAI,EAAGA,EAAIH,EAAMI,OAAQD,IAC9BF,EAAOD,EAAMK,WAAWF,IAAMA,iBAkBXG,IACnB,IAA8DH,EAAUI,EAAUC,EAAUC,EAAUC,EAAlGC,EAA+B,IAAhBL,EAAOF,OAAeQ,EAAMN,EAAOF,OAAWS,EAAI,EACnC,MAA9BP,EAAOA,EAAOF,OAAS,KACvBO,IACkC,MAA9BL,EAAOA,EAAOF,OAAS,IACvBO,KAGR,MAAMG,EAAc,IAAIC,YAAYJ,GAAeK,EAAQ,IAAId,WAAWY,GAC1E,IAAKX,EAAI,EAAGA,EAAIS,EAAKT,GAAK,EACtBI,EAAWN,EAAOK,EAAOD,WAAWF,IACpCK,EAAWP,EAAOK,EAAOD,WAAWF,EAAI,IACxCM,EAAWR,EAAOK,EAAOD,WAAWF,EAAI,IACxCO,EAAWT,EAAOK,EAAOD,WAAWF,EAAI,IACxCa,EAAMH,KAAQN,GAAY,EAAMC,GAAY,EAC5CQ,EAAMH,MAAoB,GAAXL,IAAkB,EAAMC,GAAY,EACnDO,EAAMH,MAAoB,EAAXJ,IAAiB,EAAiB,GAAXC,EAE1C,OAAOI,CAAW"}
1
+ {"version":3,"file":"base64-arraybuffer.js","sources":["../../../../../../node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.js"],"sourcesContent":["// imported from https://github.com/socketio/base64-arraybuffer\nconst chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n// Use a lookup table to find the index.\nconst lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);\nfor (let i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n}\nexport const encode = (arraybuffer) => {\n let bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = '';\n for (i = 0; i < len; i += 3) {\n base64 += chars[bytes[i] >> 2];\n base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n base64 += chars[bytes[i + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + '=';\n }\n else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + '==';\n }\n return base64;\n};\nexport const decode = (base64) => {\n let bufferLength = base64.length * 0.75, len = base64.length, i, p = 0, encoded1, encoded2, encoded3, encoded4;\n if (base64[base64.length - 1] === '=') {\n bufferLength--;\n if (base64[base64.length - 2] === '=') {\n bufferLength--;\n }\n }\n const arraybuffer = new ArrayBuffer(bufferLength), bytes = new Uint8Array(arraybuffer);\n for (i = 0; i < len; i += 4) {\n encoded1 = lookup[base64.charCodeAt(i)];\n encoded2 = lookup[base64.charCodeAt(i + 1)];\n encoded3 = lookup[base64.charCodeAt(i + 2)];\n encoded4 = lookup[base64.charCodeAt(i + 3)];\n bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n }\n return arraybuffer;\n};\n"],"names":["chars","lookup","Uint8Array","i","charCodeAt","base64","encoded1","encoded2","encoded3","encoded4","bufferLength","length","len","p","arraybuffer","ArrayBuffer","bytes"],"mappings":"oEACA,MAAMA,EAAQ,mEAERC,EAA+B,oBAAfC,WAA6B,GAAK,IAAIA,WAAW,KACvE,IAAK,IAAIC,EAAI,EAAGA,EAAIH,GAAcG,IAC9BF,EAAOD,EAAMI,WAAWD,IAAMA,iBAkBXE,IACnB,IAA8DF,EAAUG,EAAUC,EAAUC,EAAUC,EAAlGC,EAA+B,IAAhBL,EAAOM,OAAeC,EAAMP,EAAOM,OAAWE,EAAI,EACnC,MAA9BR,EAAOA,EAAOM,OAAS,KACvBD,IACkC,MAA9BL,EAAOA,EAAOM,OAAS,IACvBD,KAGR,MAAMI,EAAc,IAAIC,YAAYL,GAAeM,EAAQ,IAAId,WAAWY,GAC1E,IAAKX,EAAI,EAAGA,EAAIS,EAAKT,GAAK,EACtBG,EAAWL,EAAOI,EAAOD,WAAWD,IACpCI,EAAWN,EAAOI,EAAOD,WAAWD,EAAI,IACxCK,EAAWP,EAAOI,EAAOD,WAAWD,EAAI,IACxCM,EAAWR,EAAOI,EAAOD,WAAWD,EAAI,IACxCa,EAAMH,KAAQP,GAAY,EAAMC,GAAY,EAC5CS,EAAMH,MAAoB,GAAXN,IAAkB,EAAMC,GAAY,EACnDQ,EAAMH,MAAoB,EAAXL,IAAiB,EAAiB,GAAXC,EAE1C,OAAOK,CAAW"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./commons.js"),r=require("./contrib/base64-arraybuffer.js");const t="function"==typeof ArrayBuffer,s=(e,s)=>{if(t){const t=r.decode(e);return a(t,s)}return{base64:!0,data:e}},a=(e,r)=>"blob"===r&&e instanceof ArrayBuffer?new Blob([e]):e;exports.default=(r,t)=>{if("string"!=typeof r)return{type:"message",data:a(r,t)};const n=r.charAt(0);if("b"===n)return{type:"message",data:s(r.substring(1),t)};return e.PACKET_TYPES_REVERSE[n]?r.length>1?{type:e.PACKET_TYPES_REVERSE[n],data:r.substring(1)}:{type:e.PACKET_TYPES_REVERSE[n]}:e.ERROR_PACKET};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./commons.js"),r=require("./contrib/base64-arraybuffer.js");const t="function"==typeof ArrayBuffer,s=(e,s)=>{if(t){const t=r.decode(e);return a(t,s)}return{base64:!0,data:e}},a=(e,r)=>"blob"===r?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer;exports.decodePacket=(r,t)=>{if("string"!=typeof r)return{type:"message",data:a(r,t)};const n=r.charAt(0);if("b"===n)return{type:"message",data:s(r.substring(1),t)};return e.PACKET_TYPES_REVERSE[n]?r.length>1?{type:e.PACKET_TYPES_REVERSE[n],data:r.substring(1)}:{type:e.PACKET_TYPES_REVERSE[n]}:e.ERROR_PACKET};
2
2
  //# sourceMappingURL=decodePacket.browser.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"decodePacket.browser.js","sources":["../../../../../node_modules/engine.io-parser/build/esm/decodePacket.browser.js"],"sourcesContent":["import { ERROR_PACKET, PACKET_TYPES_REVERSE } from \"./commons.js\";\nimport { decode } from \"./contrib/base64-arraybuffer.js\";\nconst withNativeArrayBuffer = typeof ArrayBuffer === \"function\";\nconst decodePacket = (encodedPacket, binaryType) => {\n if (typeof encodedPacket !== \"string\") {\n return {\n type: \"message\",\n data: mapBinary(encodedPacket, binaryType)\n };\n }\n const type = encodedPacket.charAt(0);\n if (type === \"b\") {\n return {\n type: \"message\",\n data: decodeBase64Packet(encodedPacket.substring(1), binaryType)\n };\n }\n const packetType = PACKET_TYPES_REVERSE[type];\n if (!packetType) {\n return ERROR_PACKET;\n }\n return encodedPacket.length > 1\n ? {\n type: PACKET_TYPES_REVERSE[type],\n data: encodedPacket.substring(1)\n }\n : {\n type: PACKET_TYPES_REVERSE[type]\n };\n};\nconst decodeBase64Packet = (data, binaryType) => {\n if (withNativeArrayBuffer) {\n const decoded = decode(data);\n return mapBinary(decoded, binaryType);\n }\n else {\n return { base64: true, data }; // fallback for old browsers\n }\n};\nconst mapBinary = (data, binaryType) => {\n switch (binaryType) {\n case \"blob\":\n return data instanceof ArrayBuffer ? new Blob([data]) : data;\n case \"arraybuffer\":\n default:\n return data; // assuming the data is already an ArrayBuffer\n }\n};\nexport default decodePacket;\n"],"names":["withNativeArrayBuffer","ArrayBuffer","decodeBase64Packet","data","binaryType","decoded","decode","mapBinary","base64","Blob","decodePacket","encodedPacket","type","charAt","substring","PACKET_TYPES_REVERSE","length","ERROR_PACKET"],"mappings":"+IAEA,MAAMA,EAA+C,mBAAhBC,YA4B/BC,EAAqBA,CAACC,EAAMC,KAC9B,GAAIJ,EAAuB,CACvB,MAAMK,EAAUC,SAAOH,GACvB,OAAOI,EAAUF,EAASD,EAC9B,CAEI,MAAO,CAAEI,QAAQ,EAAML,OAC3B,EAEEI,EAAYA,CAACJ,EAAMC,IAEZ,SADDA,GAEOD,aAAgBF,YAAc,IAAIQ,KAAK,CAACN,IAGxCA,kBA1CEO,CAACC,EAAeP,KACjC,GAA6B,iBAAlBO,EACP,MAAO,CACHC,KAAM,UACNT,KAAMI,EAAUI,EAAeP,IAGvC,MAAMQ,EAAOD,EAAcE,OAAO,GAClC,GAAa,MAATD,EACA,MAAO,CACHA,KAAM,UACNT,KAAMD,EAAmBS,EAAcG,UAAU,GAAIV,IAI7D,OADmBW,uBAAqBH,GAIjCD,EAAcK,OAAS,EACxB,CACEJ,KAAMG,EAAoBA,qBAACH,GAC3BT,KAAMQ,EAAcG,UAAU,IAEhC,CACEF,KAAMG,EAAoBA,qBAACH,IARxBK,cASN"}
1
+ {"version":3,"file":"decodePacket.browser.js","sources":["../../../../../node_modules/engine.io-parser/build/esm/decodePacket.browser.js"],"sourcesContent":["import { ERROR_PACKET, PACKET_TYPES_REVERSE, } from \"./commons.js\";\nimport { decode } from \"./contrib/base64-arraybuffer.js\";\nconst withNativeArrayBuffer = typeof ArrayBuffer === \"function\";\nexport const decodePacket = (encodedPacket, binaryType) => {\n if (typeof encodedPacket !== \"string\") {\n return {\n type: \"message\",\n data: mapBinary(encodedPacket, binaryType),\n };\n }\n const type = encodedPacket.charAt(0);\n if (type === \"b\") {\n return {\n type: \"message\",\n data: decodeBase64Packet(encodedPacket.substring(1), binaryType),\n };\n }\n const packetType = PACKET_TYPES_REVERSE[type];\n if (!packetType) {\n return ERROR_PACKET;\n }\n return encodedPacket.length > 1\n ? {\n type: PACKET_TYPES_REVERSE[type],\n data: encodedPacket.substring(1),\n }\n : {\n type: PACKET_TYPES_REVERSE[type],\n };\n};\nconst decodeBase64Packet = (data, binaryType) => {\n if (withNativeArrayBuffer) {\n const decoded = decode(data);\n return mapBinary(decoded, binaryType);\n }\n else {\n return { base64: true, data }; // fallback for old browsers\n }\n};\nconst mapBinary = (data, binaryType) => {\n switch (binaryType) {\n case \"blob\":\n if (data instanceof Blob) {\n // from WebSocket + binaryType \"blob\"\n return data;\n }\n else {\n // from HTTP long-polling or WebTransport\n return new Blob([data]);\n }\n case \"arraybuffer\":\n default:\n if (data instanceof ArrayBuffer) {\n // from HTTP long-polling (base64) or WebSocket + binaryType \"arraybuffer\"\n return data;\n }\n else {\n // from WebTransport (Uint8Array)\n return data.buffer;\n }\n }\n};\n"],"names":["withNativeArrayBuffer","ArrayBuffer","decodeBase64Packet","data","binaryType","decoded","decode","mapBinary","base64","Blob","buffer","decodePacket","encodedPacket","type","charAt","substring","PACKET_TYPES_REVERSE","length","ERROR_PACKET"],"mappings":"+IAEA,MAAMA,EAA+C,mBAAhBC,YA4B/BC,EAAqBA,CAACC,EAAMC,KAC9B,GAAIJ,EAAuB,CACvB,MAAMK,EAAUC,SAAOH,GACvB,OAAOI,EAAUF,EAASD,EAC9B,CAEI,MAAO,CAAEI,QAAQ,EAAML,OAC3B,EAEEI,EAAYA,CAACJ,EAAMC,IAEZ,SADDA,EAEID,aAAgBM,KAETN,EAIA,IAAIM,KAAK,CAACN,IAIjBA,aAAgBF,YAETE,EAIAA,EAAKO,4BAvDAC,CAACC,EAAeR,KACxC,GAA6B,iBAAlBQ,EACP,MAAO,CACHC,KAAM,UACNV,KAAMI,EAAUK,EAAeR,IAGvC,MAAMS,EAAOD,EAAcE,OAAO,GAClC,GAAa,MAATD,EACA,MAAO,CACHA,KAAM,UACNV,KAAMD,EAAmBU,EAAcG,UAAU,GAAIX,IAI7D,OADmBY,uBAAqBH,GAIjCD,EAAcK,OAAS,EACxB,CACEJ,KAAMG,EAAoBA,qBAACH,GAC3BV,KAAMS,EAAcG,UAAU,IAEhC,CACEF,KAAMG,EAAoBA,qBAACH,IARxBK,cASN"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./commons.js");const t="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),r="function"==typeof ArrayBuffer,o=(e,t)=>{const r=new FileReader;return r.onload=function(){const e=r.result.split(",")[1];t("b"+e)},r.readAsDataURL(e)};exports.default=(n,f,a)=>{let{type:u,data:s}=n;return t&&s instanceof Blob?f?a(s):o(s,a):r&&(s instanceof ArrayBuffer||(i=s,"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(i):i&&i.buffer instanceof ArrayBuffer))?f?a(s):o(new Blob([s]),a):a(e.PACKET_TYPES[u]+(s||""));var i};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./commons.js");const t="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),r="function"==typeof ArrayBuffer,n=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,o=(o,f,c)=>{let{type:i,data:u}=o;return t&&u instanceof Blob?f?c(u):a(u,c):r&&(u instanceof ArrayBuffer||n(u))?f?c(u):a(new Blob([u]),c):c(e.PACKET_TYPES[i]+(u||""))},a=(e,t)=>{const r=new FileReader;return r.onload=function(){const e=r.result.split(",")[1];t("b"+(e||""))},r.readAsDataURL(e)};function f(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let c;exports.encodePacket=o,exports.encodePacketToBinary=function(e,a){return t&&e.data instanceof Blob?e.data.arrayBuffer().then(f).then(a):r&&(e.data instanceof ArrayBuffer||n(e.data))?a(f(e.data)):void o(e,!1,(e=>{c||(c=new TextEncoder),a(c.encode(e))}))};
2
2
  //# sourceMappingURL=encodePacket.browser.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"encodePacket.browser.js","sources":["../../../../../node_modules/engine.io-parser/build/esm/encodePacket.browser.js"],"sourcesContent":["import { PACKET_TYPES } from \"./commons.js\";\nconst withNativeBlob = typeof Blob === \"function\" ||\n (typeof Blob !== \"undefined\" &&\n Object.prototype.toString.call(Blob) === \"[object BlobConstructor]\");\nconst withNativeArrayBuffer = typeof ArrayBuffer === \"function\";\n// ArrayBuffer.isView method is not defined in IE10\nconst isView = obj => {\n return typeof ArrayBuffer.isView === \"function\"\n ? ArrayBuffer.isView(obj)\n : obj && obj.buffer instanceof ArrayBuffer;\n};\nconst encodePacket = ({ type, data }, supportsBinary, callback) => {\n if (withNativeBlob && data instanceof Blob) {\n if (supportsBinary) {\n return callback(data);\n }\n else {\n return encodeBlobAsBase64(data, callback);\n }\n }\n else if (withNativeArrayBuffer &&\n (data instanceof ArrayBuffer || isView(data))) {\n if (supportsBinary) {\n return callback(data);\n }\n else {\n return encodeBlobAsBase64(new Blob([data]), callback);\n }\n }\n // plain string\n return callback(PACKET_TYPES[type] + (data || \"\"));\n};\nconst encodeBlobAsBase64 = (data, callback) => {\n const fileReader = new FileReader();\n fileReader.onload = function () {\n const content = fileReader.result.split(\",\")[1];\n callback(\"b\" + content);\n };\n return fileReader.readAsDataURL(data);\n};\nexport default encodePacket;\n"],"names":["withNativeBlob","Blob","Object","prototype","toString","call","withNativeArrayBuffer","ArrayBuffer","encodeBlobAsBase64","data","callback","fileReader","FileReader","onload","content","result","split","readAsDataURL","encodePacket","_ref","supportsBinary","type","obj","isView","buffer","PACKET_TYPES"],"mappings":"kGACA,MAAMA,EAAiC,mBAATC,MACT,oBAATA,MACqC,6BAAzCC,OAAOC,UAAUC,SAASC,KAAKJ,MACjCK,EAA+C,mBAAhBC,YA4B/BC,EAAqBA,CAACC,EAAMC,KAC9B,MAAMC,EAAa,IAAIC,WAKvB,OAJAD,EAAWE,OAAS,WAChB,MAAMC,EAAUH,EAAWI,OAAOC,MAAM,KAAK,GAC7CN,EAAS,IAAMI,IAEZH,EAAWM,cAAcR,EAAK,kBA3BpBS,CAAAC,EAAiBC,EAAgBV,KAAa,IAA7CW,KAAEA,EAAIZ,KAAEA,GAAMU,EAChC,OAAInB,GAAkBS,aAAgBR,KAC9BmB,EACOV,EAASD,GAGTD,EAAmBC,EAAMC,GAG/BJ,IACJG,aAAgBF,cAfVe,EAegCb,EAdN,mBAAvBF,YAAYgB,OACpBhB,YAAYgB,OAAOD,GACnBA,GAAOA,EAAIE,kBAAkBjB,cAa3Ba,EACOV,EAASD,GAGTD,EAAmB,IAAIP,KAAK,CAACQ,IAAQC,GAI7CA,EAASe,EAAAA,aAAaJ,IAASZ,GAAQ,KAxBnCa,KAwBuC"}
1
+ {"version":3,"file":"encodePacket.browser.js","sources":["../../../../../node_modules/engine.io-parser/build/esm/encodePacket.browser.js"],"sourcesContent":["import { PACKET_TYPES } from \"./commons.js\";\nconst withNativeBlob = typeof Blob === \"function\" ||\n (typeof Blob !== \"undefined\" &&\n Object.prototype.toString.call(Blob) === \"[object BlobConstructor]\");\nconst withNativeArrayBuffer = typeof ArrayBuffer === \"function\";\n// ArrayBuffer.isView method is not defined in IE10\nconst isView = (obj) => {\n return typeof ArrayBuffer.isView === \"function\"\n ? ArrayBuffer.isView(obj)\n : obj && obj.buffer instanceof ArrayBuffer;\n};\nconst encodePacket = ({ type, data }, supportsBinary, callback) => {\n if (withNativeBlob && data instanceof Blob) {\n if (supportsBinary) {\n return callback(data);\n }\n else {\n return encodeBlobAsBase64(data, callback);\n }\n }\n else if (withNativeArrayBuffer &&\n (data instanceof ArrayBuffer || isView(data))) {\n if (supportsBinary) {\n return callback(data);\n }\n else {\n return encodeBlobAsBase64(new Blob([data]), callback);\n }\n }\n // plain string\n return callback(PACKET_TYPES[type] + (data || \"\"));\n};\nconst encodeBlobAsBase64 = (data, callback) => {\n const fileReader = new FileReader();\n fileReader.onload = function () {\n const content = fileReader.result.split(\",\")[1];\n callback(\"b\" + (content || \"\"));\n };\n return fileReader.readAsDataURL(data);\n};\nfunction toArray(data) {\n if (data instanceof Uint8Array) {\n return data;\n }\n else if (data instanceof ArrayBuffer) {\n return new Uint8Array(data);\n }\n else {\n return new Uint8Array(data.buffer, data.byteOffset, data.byteLength);\n }\n}\nlet TEXT_ENCODER;\nexport function encodePacketToBinary(packet, callback) {\n if (withNativeBlob && packet.data instanceof Blob) {\n return packet.data.arrayBuffer().then(toArray).then(callback);\n }\n else if (withNativeArrayBuffer &&\n (packet.data instanceof ArrayBuffer || isView(packet.data))) {\n return callback(toArray(packet.data));\n }\n encodePacket(packet, false, (encoded) => {\n if (!TEXT_ENCODER) {\n TEXT_ENCODER = new TextEncoder();\n }\n callback(TEXT_ENCODER.encode(encoded));\n });\n}\nexport { encodePacket };\n"],"names":["withNativeBlob","Blob","Object","prototype","toString","call","withNativeArrayBuffer","ArrayBuffer","isView","obj","buffer","encodePacket","_ref","supportsBinary","callback","type","data","encodeBlobAsBase64","PACKET_TYPES","fileReader","FileReader","onload","content","result","split","readAsDataURL","toArray","Uint8Array","byteOffset","byteLength","TEXT_ENCODER","packet","arrayBuffer","then","encoded","TextEncoder","encode"],"mappings":"kGACA,MAAMA,EAAiC,mBAATC,MACT,oBAATA,MACqC,6BAAzCC,OAAOC,UAAUC,SAASC,KAAKJ,MACjCK,EAA+C,mBAAhBC,YAE/BC,EAAUC,GACyB,mBAAvBF,YAAYC,OACpBD,YAAYC,OAAOC,GACnBA,GAAOA,EAAIC,kBAAkBH,YAEjCI,EAAeA,CAAAC,EAAiBC,EAAgBC,KAAa,IAA7CC,KAAEA,EAAIC,KAAEA,GAAMJ,EAChC,OAAIZ,GAAkBgB,aAAgBf,KAC9BY,EACOC,EAASE,GAGTC,EAAmBD,EAAMF,GAG/BR,IACJU,aAAgBT,aAAeC,EAAOQ,IACnCH,EACOC,EAASE,GAGTC,EAAmB,IAAIhB,KAAK,CAACe,IAAQF,GAI7CA,EAASI,EAAAA,aAAaH,IAASC,GAAQ,IAAI,EAEhDC,EAAqBA,CAACD,EAAMF,KAC9B,MAAMK,EAAa,IAAIC,WAKvB,OAJAD,EAAWE,OAAS,WAChB,MAAMC,EAAUH,EAAWI,OAAOC,MAAM,KAAK,GAC7CV,EAAS,KAAOQ,GAAW,MAExBH,EAAWM,cAAcT,EAAK,EAEzC,SAASU,EAAQV,GACb,OAAIA,aAAgBW,WACTX,EAEFA,aAAgBT,YACd,IAAIoB,WAAWX,GAGf,IAAIW,WAAWX,EAAKN,OAAQM,EAAKY,WAAYZ,EAAKa,WAEjE,CACA,IAAIC,sDACG,SAA8BC,EAAQjB,GACzC,OAAId,GAAkB+B,EAAOf,gBAAgBf,KAClC8B,EAAOf,KAAKgB,cAAcC,KAAKP,GAASO,KAAKnB,GAE/CR,IACJyB,EAAOf,gBAAgBT,aAAeC,EAAOuB,EAAOf,OAC9CF,EAASY,EAAQK,EAAOf,YAEnCL,EAAaoB,GAAQ,GAAQG,IACpBJ,IACDA,EAAe,IAAIK,aAEvBrB,EAASgB,EAAaM,OAAOF,GAAS,GAE9C"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./encodePacket.browser.js"),r=require("./decodePacket.browser.js");const o=String.fromCharCode(30);exports.encodePacket=e.default,exports.decodePacket=r.default,exports.decodePayload=(e,t)=>{const s=e.split(o),a=[];for(let e=0;e<s.length;e++){const o=r.default(s[e],t);if(a.push(o),"error"===o.type)break}return a},exports.encodePayload=(r,t)=>{const s=r.length,a=new Array(s);let c=0;r.forEach(((r,d)=>{e.default(r,!1,(e=>{a[d]=e,++c===s&&t(a.join(o))}))}))},exports.protocol=4;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./encodePacket.browser.js"),t=require("./decodePacket.browser.js"),r=require("./commons.js");const n=String.fromCharCode(30);let o;function a(e){return e.reduce(((e,t)=>e+t.length),0)}function c(e,t){if(e[0].length===t)return e.shift();const r=new Uint8Array(t);let n=0;for(let o=0;o<t;o++)r[o]=e[0][n++],n===e[0].length&&(e.shift(),n=0);return e.length&&n<e[0].length&&(e[0]=e[0].slice(n)),r}exports.encodePacket=e.encodePacket,exports.decodePacket=t.decodePacket,exports.createPacketDecoderStream=function(e,n){o||(o=new TextDecoder);const s=[];let i=0,f=-1,u=!1;return new TransformStream({transform(d,l){for(s.push(d);;){if(0===i){if(a(s)<1)break;const e=c(s,1);u=!(128&~e[0]),f=127&e[0],i=f<126?3:126===f?1:2}else if(1===i){if(a(s)<2)break;const e=c(s,2);f=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),i=3}else if(2===i){if(a(s)<8)break;const e=c(s,8),t=new DataView(e.buffer,e.byteOffset,e.length),n=t.getUint32(0);if(n>Math.pow(2,21)-1){l.enqueue(r.ERROR_PACKET);break}f=n*Math.pow(2,32)+t.getUint32(4),i=3}else{if(a(s)<f)break;const e=c(s,f);l.enqueue(t.decodePacket(u?e:o.decode(e),n)),i=0}if(0===f||f>e){l.enqueue(r.ERROR_PACKET);break}}}})},exports.createPacketEncoderStream=function(){return new TransformStream({transform(t,r){e.encodePacketToBinary(t,(e=>{const n=e.length;let o;if(n<126)o=new Uint8Array(1),new DataView(o.buffer).setUint8(0,n);else if(n<65536){o=new Uint8Array(3);const e=new DataView(o.buffer);e.setUint8(0,126),e.setUint16(1,n)}else{o=new Uint8Array(9);const e=new DataView(o.buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(n))}t.data&&"string"!=typeof t.data&&(o[0]|=128),r.enqueue(o),r.enqueue(e)}))}})},exports.decodePayload=(e,r)=>{const o=e.split(n),a=[];for(let e=0;e<o.length;e++){const n=t.decodePacket(o[e],r);if(a.push(n),"error"===n.type)break}return a},exports.encodePayload=(t,r)=>{const o=t.length,a=new Array(o);let c=0;t.forEach(((t,s)=>{e.encodePacket(t,!1,(e=>{a[s]=e,++c===o&&r(a.join(n))}))}))},exports.protocol=4;
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../node_modules/engine.io-parser/build/esm/index.js"],"sourcesContent":["import encodePacket from \"./encodePacket.js\";\nimport decodePacket from \"./decodePacket.js\";\nconst SEPARATOR = String.fromCharCode(30); // see https://en.wikipedia.org/wiki/Delimiter#ASCII_delimited_text\nconst encodePayload = (packets, callback) => {\n // some packets may be added to the array while encoding, so the initial length must be saved\n const length = packets.length;\n const encodedPackets = new Array(length);\n let count = 0;\n packets.forEach((packet, i) => {\n // force base64 encoding for binary packets\n encodePacket(packet, false, encodedPacket => {\n encodedPackets[i] = encodedPacket;\n if (++count === length) {\n callback(encodedPackets.join(SEPARATOR));\n }\n });\n });\n};\nconst decodePayload = (encodedPayload, binaryType) => {\n const encodedPackets = encodedPayload.split(SEPARATOR);\n const packets = [];\n for (let i = 0; i < encodedPackets.length; i++) {\n const decodedPacket = decodePacket(encodedPackets[i], binaryType);\n packets.push(decodedPacket);\n if (decodedPacket.type === \"error\") {\n break;\n }\n }\n return packets;\n};\nexport const protocol = 4;\nexport { encodePacket, encodePayload, decodePacket, decodePayload };\n"],"names":["SEPARATOR","String","fromCharCode","decodePayload","encodedPayload","binaryType","encodedPackets","split","packets","i","length","decodedPacket","decodePacket","push","type","encodePayload","callback","Array","count","forEach","packet","encodePacket","encodedPacket","join"],"mappings":"sJAEA,MAAMA,EAAYC,OAAOC,aAAa,wFAgBhBC,CAACC,EAAgBC,KACnC,MAAMC,EAAiBF,EAAeG,MAAMP,GACtCQ,EAAU,GAChB,IAAK,IAAIC,EAAI,EAAGA,EAAIH,EAAeI,OAAQD,IAAK,CAC5C,MAAME,EAAgBC,EAAAA,QAAaN,EAAeG,GAAIJ,GAEtD,GADAG,EAAQK,KAAKF,GACc,UAAvBA,EAAcG,KACd,KAER,CACA,OAAON,CAAO,wBAzBIO,CAACP,EAASQ,KAE5B,MAAMN,EAASF,EAAQE,OACjBJ,EAAiB,IAAIW,MAAMP,GACjC,IAAIQ,EAAQ,EACZV,EAAQW,SAAQ,CAACC,EAAQX,KAErBY,UAAaD,GAAQ,GAAOE,IACxBhB,EAAeG,GAAKa,IACdJ,IAAUR,GACZM,EAASV,EAAeiB,KAAKvB,GACjC,GACF,GACJ,mBAckB"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../node_modules/engine.io-parser/build/esm/index.js"],"sourcesContent":["import { encodePacket, encodePacketToBinary } from \"./encodePacket.js\";\nimport { decodePacket } from \"./decodePacket.js\";\nimport { ERROR_PACKET, } from \"./commons.js\";\nconst SEPARATOR = String.fromCharCode(30); // see https://en.wikipedia.org/wiki/Delimiter#ASCII_delimited_text\nconst encodePayload = (packets, callback) => {\n // some packets may be added to the array while encoding, so the initial length must be saved\n const length = packets.length;\n const encodedPackets = new Array(length);\n let count = 0;\n packets.forEach((packet, i) => {\n // force base64 encoding for binary packets\n encodePacket(packet, false, (encodedPacket) => {\n encodedPackets[i] = encodedPacket;\n if (++count === length) {\n callback(encodedPackets.join(SEPARATOR));\n }\n });\n });\n};\nconst decodePayload = (encodedPayload, binaryType) => {\n const encodedPackets = encodedPayload.split(SEPARATOR);\n const packets = [];\n for (let i = 0; i < encodedPackets.length; i++) {\n const decodedPacket = decodePacket(encodedPackets[i], binaryType);\n packets.push(decodedPacket);\n if (decodedPacket.type === \"error\") {\n break;\n }\n }\n return packets;\n};\nexport function createPacketEncoderStream() {\n // @ts-expect-error\n return new TransformStream({\n transform(packet, controller) {\n encodePacketToBinary(packet, (encodedPacket) => {\n const payloadLength = encodedPacket.length;\n let header;\n // inspired by the WebSocket format: https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_servers#decoding_payload_length\n if (payloadLength < 126) {\n header = new Uint8Array(1);\n new DataView(header.buffer).setUint8(0, payloadLength);\n }\n else if (payloadLength < 65536) {\n header = new Uint8Array(3);\n const view = new DataView(header.buffer);\n view.setUint8(0, 126);\n view.setUint16(1, payloadLength);\n }\n else {\n header = new Uint8Array(9);\n const view = new DataView(header.buffer);\n view.setUint8(0, 127);\n view.setBigUint64(1, BigInt(payloadLength));\n }\n // first bit indicates whether the payload is plain text (0) or binary (1)\n if (packet.data && typeof packet.data !== \"string\") {\n header[0] |= 0x80;\n }\n controller.enqueue(header);\n controller.enqueue(encodedPacket);\n });\n },\n });\n}\nlet TEXT_DECODER;\nfunction totalLength(chunks) {\n return chunks.reduce((acc, chunk) => acc + chunk.length, 0);\n}\nfunction concatChunks(chunks, size) {\n if (chunks[0].length === size) {\n return chunks.shift();\n }\n const buffer = new Uint8Array(size);\n let j = 0;\n for (let i = 0; i < size; i++) {\n buffer[i] = chunks[0][j++];\n if (j === chunks[0].length) {\n chunks.shift();\n j = 0;\n }\n }\n if (chunks.length && j < chunks[0].length) {\n chunks[0] = chunks[0].slice(j);\n }\n return buffer;\n}\nexport function createPacketDecoderStream(maxPayload, binaryType) {\n if (!TEXT_DECODER) {\n TEXT_DECODER = new TextDecoder();\n }\n const chunks = [];\n let state = 0 /* READ_HEADER */;\n let expectedLength = -1;\n let isBinary = false;\n // @ts-expect-error\n return new TransformStream({\n transform(chunk, controller) {\n chunks.push(chunk);\n while (true) {\n if (state === 0 /* READ_HEADER */) {\n if (totalLength(chunks) < 1) {\n break;\n }\n const header = concatChunks(chunks, 1);\n isBinary = (header[0] & 0x80) === 0x80;\n expectedLength = header[0] & 0x7f;\n if (expectedLength < 126) {\n state = 3 /* READ_PAYLOAD */;\n }\n else if (expectedLength === 126) {\n state = 1 /* READ_EXTENDED_LENGTH_16 */;\n }\n else {\n state = 2 /* READ_EXTENDED_LENGTH_64 */;\n }\n }\n else if (state === 1 /* READ_EXTENDED_LENGTH_16 */) {\n if (totalLength(chunks) < 2) {\n break;\n }\n const headerArray = concatChunks(chunks, 2);\n expectedLength = new DataView(headerArray.buffer, headerArray.byteOffset, headerArray.length).getUint16(0);\n state = 3 /* READ_PAYLOAD */;\n }\n else if (state === 2 /* READ_EXTENDED_LENGTH_64 */) {\n if (totalLength(chunks) < 8) {\n break;\n }\n const headerArray = concatChunks(chunks, 8);\n const view = new DataView(headerArray.buffer, headerArray.byteOffset, headerArray.length);\n const n = view.getUint32(0);\n if (n > Math.pow(2, 53 - 32) - 1) {\n // the maximum safe integer in JavaScript is 2^53 - 1\n controller.enqueue(ERROR_PACKET);\n break;\n }\n expectedLength = n * Math.pow(2, 32) + view.getUint32(4);\n state = 3 /* READ_PAYLOAD */;\n }\n else {\n if (totalLength(chunks) < expectedLength) {\n break;\n }\n const data = concatChunks(chunks, expectedLength);\n controller.enqueue(decodePacket(isBinary ? data : TEXT_DECODER.decode(data), binaryType));\n state = 0 /* READ_HEADER */;\n }\n if (expectedLength === 0 || expectedLength > maxPayload) {\n controller.enqueue(ERROR_PACKET);\n break;\n }\n }\n },\n });\n}\nexport const protocol = 4;\nexport { encodePacket, encodePayload, decodePacket, decodePayload, };\n"],"names":["SEPARATOR","String","fromCharCode","TEXT_DECODER","totalLength","chunks","reduce","acc","chunk","length","concatChunks","size","shift","buffer","Uint8Array","j","i","slice","maxPayload","binaryType","TextDecoder","state","expectedLength","isBinary","TransformStream","transform","controller","push","header","headerArray","DataView","byteOffset","getUint16","view","n","getUint32","Math","pow","enqueue","ERROR_PACKET","data","decodePacket","decode","packet","encodePacketToBinary","encodedPacket","payloadLength","setUint8","setUint16","setBigUint64","BigInt","decodePayload","encodedPayload","encodedPackets","split","packets","decodedPacket","type","encodePayload","callback","Array","count","forEach","encodePacket","join"],"mappings":"gLAGA,MAAMA,EAAYC,OAAOC,aAAa,IA8DtC,IAAIC,EACJ,SAASC,EAAYC,GACjB,OAAOA,EAAOC,QAAO,CAACC,EAAKC,IAAUD,EAAMC,EAAMC,QAAQ,EAC7D,CACA,SAASC,EAAaL,EAAQM,GAC1B,GAAIN,EAAO,GAAGI,SAAWE,EACrB,OAAON,EAAOO,QAElB,MAAMC,EAAS,IAAIC,WAAWH,GAC9B,IAAII,EAAI,EACR,IAAK,IAAIC,EAAI,EAAGA,EAAIL,EAAMK,IACtBH,EAAOG,GAAKX,EAAO,GAAGU,KAClBA,IAAMV,EAAO,GAAGI,SAChBJ,EAAOO,QACPG,EAAI,GAMZ,OAHIV,EAAOI,QAAUM,EAAIV,EAAO,GAAGI,SAC/BJ,EAAO,GAAKA,EAAO,GAAGY,MAAMF,IAEzBF,CACX,2GACO,SAAmCK,EAAYC,GAC7ChB,IACDA,EAAe,IAAIiB,aAEvB,MAAMf,EAAS,GACf,IAAIgB,EAAQ,EACRC,GAAkB,EAClBC,GAAW,EAEf,OAAO,IAAIC,gBAAgB,CACvBC,SAAAA,CAAUjB,EAAOkB,GAEb,IADArB,EAAOsB,KAAKnB,KACC,CACT,GAAc,IAAVa,EAA+B,CAC/B,GAAIjB,EAAYC,GAAU,EACtB,MAEJ,MAAMuB,EAASlB,EAAaL,EAAQ,GACpCkB,IAAkC,KAAtBK,EAAO,IACnBN,EAA6B,IAAZM,EAAO,GAEpBP,EADAC,EAAiB,IACT,EAEgB,MAAnBA,EACG,EAGA,CAEhB,MACK,GAAc,IAAVD,EAA2C,CAChD,GAAIjB,EAAYC,GAAU,EACtB,MAEJ,MAAMwB,EAAcnB,EAAaL,EAAQ,GACzCiB,EAAiB,IAAIQ,SAASD,EAAYhB,OAAQgB,EAAYE,WAAYF,EAAYpB,QAAQuB,UAAU,GACxGX,EAAQ,CACZ,MACK,GAAc,IA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