@linxin666/dsh-remote-bridge 0.0.0-stage → 0.4.7

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 (69) hide show
  1. package/LICENSE +202 -0
  2. package/README.i18n.yaml +6 -0
  3. package/README.md +243 -2
  4. package/README.zh.md +244 -0
  5. package/cordis.patch.yml +17 -0
  6. package/lib/client.js +1830 -0
  7. package/lib/client.js.map +1 -0
  8. package/lib/index.js +3744 -0
  9. package/lib/types/client/PairEntry.d.ts +16 -0
  10. package/lib/types/client/PairPanel.d.ts +55 -0
  11. package/lib/types/client/icons.d.ts +18 -0
  12. package/lib/types/client/index.d.ts +35 -0
  13. package/lib/types/client/locales.d.ts +42 -0
  14. package/lib/types/client/pair-token.d.ts +73 -0
  15. package/lib/types/client/semantic.d.ts +28 -0
  16. package/lib/types/core/approvals.d.ts +75 -0
  17. package/lib/types/core/connection.d.ts +119 -0
  18. package/lib/types/core/crypto.d.ts +48 -0
  19. package/lib/types/core/devices.d.ts +72 -0
  20. package/lib/types/core/dsh-frames.d.ts +181 -0
  21. package/lib/types/core/envelope.d.ts +98 -0
  22. package/lib/types/core/gateway-errors.d.ts +49 -0
  23. package/lib/types/core/hub.d.ts +101 -0
  24. package/lib/types/core/loopback.d.ts +35 -0
  25. package/lib/types/core/owner-peer.d.ts +49 -0
  26. package/lib/types/core/pairing.d.ts +61 -0
  27. package/lib/types/core/protocol.d.ts +89 -0
  28. package/lib/types/core/questions.d.ts +246 -0
  29. package/lib/types/core/session-meta.d.ts +105 -0
  30. package/lib/types/core/session-permissions.d.ts +134 -0
  31. package/lib/types/core/wire.d.ts +115 -0
  32. package/lib/types/core/ws-frames.d.ts +61 -0
  33. package/lib/types/host/dsh-home.d.ts +16 -0
  34. package/lib/types/host/pair-origin.d.ts +44 -0
  35. package/lib/types/host/routes.d.ts +27 -0
  36. package/lib/types/host/websocket.d.ts +104 -0
  37. package/lib/types/index.d.ts +40 -0
  38. package/package.json +87 -3
  39. package/src/client/PairEntry.tsx +151 -0
  40. package/src/client/PairPanel.tsx +183 -0
  41. package/src/client/icons.tsx +72 -0
  42. package/src/client/index.ts +81 -0
  43. package/src/client/locales.ts +72 -0
  44. package/src/client/pair-token.ts +104 -0
  45. package/src/client/panel.module.css +344 -0
  46. package/src/client/semantic.ts +37 -0
  47. package/src/core/approvals.ts +142 -0
  48. package/src/core/connection.ts +1090 -0
  49. package/src/core/crypto.ts +113 -0
  50. package/src/core/devices.ts +209 -0
  51. package/src/core/dsh-frames.ts +486 -0
  52. package/src/core/envelope.ts +173 -0
  53. package/src/core/gateway-errors.ts +92 -0
  54. package/src/core/hub.ts +238 -0
  55. package/src/core/loopback.ts +60 -0
  56. package/src/core/owner-peer.ts +70 -0
  57. package/src/core/pairing.ts +113 -0
  58. package/src/core/protocol.ts +120 -0
  59. package/src/core/questions.ts +454 -0
  60. package/src/core/session-meta.ts +176 -0
  61. package/src/core/session-permissions.ts +266 -0
  62. package/src/core/wire.ts +155 -0
  63. package/src/core/ws-frames.ts +125 -0
  64. package/src/css-modules.d.ts +6 -0
  65. package/src/host/dsh-home.ts +42 -0
  66. package/src/host/pair-origin.ts +77 -0
  67. package/src/host/routes.ts +85 -0
  68. package/src/host/websocket.ts +325 -0
  69. package/src/index.ts +205 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","names":["React","css","css","writeClipboard"],"sources":["../../../node_modules/.pnpm/qrcode.react@4.2.0_react@18.3.1/node_modules/qrcode.react/lib/esm/index.js","../../../packages/dsh-remote-bridge/src/client/icons.tsx","../../../packages/dsh-remote-bridge/src/client/semantic.ts","../../../packages/dsh-remote-bridge/src/client/PairPanel.tsx","../../../packages/dsh-remote-bridge/src/client/PairEntry.tsx","../../../packages/dsh-remote-bridge/src/core/protocol.ts","../../../packages/dsh-remote-bridge/src/client/pair-token.ts","../../../packages/dsh-remote-bridge/src/client/locales.ts","../../../packages/dsh-remote-bridge/src/client/index.ts"],"sourcesContent":["var __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __objRest = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\n\n// src/index.tsx\nimport React from \"react\";\n\n// src/third-party/qrcodegen/index.ts\n/**\n * @license QR Code generator library (TypeScript)\n * Copyright (c) Project Nayuki.\n * SPDX-License-Identifier: MIT\n */\nvar qrcodegen;\n((qrcodegen2) => {\n const _QrCode = class _QrCode {\n /*-- Constructor (low level) and fields --*/\n // Creates a new QR Code with the given version number,\n // error correction level, data codeword bytes, and mask number.\n // This is a low-level API that most users should not use directly.\n // A mid-level API is the encodeSegments() function.\n constructor(version, errorCorrectionLevel, dataCodewords, msk) {\n this.version = version;\n this.errorCorrectionLevel = errorCorrectionLevel;\n // The modules of this QR Code (false = light, true = dark).\n // Immutable after constructor finishes. Accessed through getModule().\n this.modules = [];\n // Indicates function modules that are not subjected to masking. Discarded when constructor finishes.\n this.isFunction = [];\n if (version < _QrCode.MIN_VERSION || version > _QrCode.MAX_VERSION)\n throw new RangeError(\"Version value out of range\");\n if (msk < -1 || msk > 7)\n throw new RangeError(\"Mask value out of range\");\n this.size = version * 4 + 17;\n let row = [];\n for (let i = 0; i < this.size; i++)\n row.push(false);\n for (let i = 0; i < this.size; i++) {\n this.modules.push(row.slice());\n this.isFunction.push(row.slice());\n }\n this.drawFunctionPatterns();\n const allCodewords = this.addEccAndInterleave(dataCodewords);\n this.drawCodewords(allCodewords);\n if (msk == -1) {\n let minPenalty = 1e9;\n for (let i = 0; i < 8; i++) {\n this.applyMask(i);\n this.drawFormatBits(i);\n const penalty = this.getPenaltyScore();\n if (penalty < minPenalty) {\n msk = i;\n minPenalty = penalty;\n }\n this.applyMask(i);\n }\n }\n assert(0 <= msk && msk <= 7);\n this.mask = msk;\n this.applyMask(msk);\n this.drawFormatBits(msk);\n this.isFunction = [];\n }\n /*-- Static factory functions (high level) --*/\n // Returns a QR Code representing the given Unicode text string at the given error correction level.\n // As a conservative upper bound, this function is guaranteed to succeed for strings that have 738 or fewer\n // Unicode code points (not UTF-16 code units) if the low error correction level is used. The smallest possible\n // QR Code version is automatically chosen for the output. The ECC level of the result may be higher than the\n // ecl argument if it can be done without increasing the version.\n static encodeText(text, ecl) {\n const segs = qrcodegen2.QrSegment.makeSegments(text);\n return _QrCode.encodeSegments(segs, ecl);\n }\n // Returns a QR Code representing the given binary data at the given error correction level.\n // This function always encodes using the binary segment mode, not any text mode. The maximum number of\n // bytes allowed is 2953. The smallest possible QR Code version is automatically chosen for the output.\n // The ECC level of the result may be higher than the ecl argument if it can be done without increasing the version.\n static encodeBinary(data, ecl) {\n const seg = qrcodegen2.QrSegment.makeBytes(data);\n return _QrCode.encodeSegments([seg], ecl);\n }\n /*-- Static factory functions (mid level) --*/\n // Returns a QR Code representing the given segments with the given encoding parameters.\n // The smallest possible QR Code version within the given range is automatically\n // chosen for the output. Iff boostEcl is true, then the ECC level of the result\n // may be higher than the ecl argument if it can be done without increasing the\n // version. The mask number is either between 0 to 7 (inclusive) to force that\n // mask, or -1 to automatically choose an appropriate mask (which may be slow).\n // This function allows the user to create a custom sequence of segments that switches\n // between modes (such as alphanumeric and byte) to encode text in less space.\n // This is a mid-level API; the high-level API is encodeText() and encodeBinary().\n static encodeSegments(segs, ecl, minVersion = 1, maxVersion = 40, mask = -1, boostEcl = true) {\n if (!(_QrCode.MIN_VERSION <= minVersion && minVersion <= maxVersion && maxVersion <= _QrCode.MAX_VERSION) || mask < -1 || mask > 7)\n throw new RangeError(\"Invalid value\");\n let version;\n let dataUsedBits;\n for (version = minVersion; ; version++) {\n const dataCapacityBits2 = _QrCode.getNumDataCodewords(version, ecl) * 8;\n const usedBits = QrSegment.getTotalBits(segs, version);\n if (usedBits <= dataCapacityBits2) {\n dataUsedBits = usedBits;\n break;\n }\n if (version >= maxVersion)\n throw new RangeError(\"Data too long\");\n }\n for (const newEcl of [_QrCode.Ecc.MEDIUM, _QrCode.Ecc.QUARTILE, _QrCode.Ecc.HIGH]) {\n if (boostEcl && dataUsedBits <= _QrCode.getNumDataCodewords(version, newEcl) * 8)\n ecl = newEcl;\n }\n let bb = [];\n for (const seg of segs) {\n appendBits(seg.mode.modeBits, 4, bb);\n appendBits(seg.numChars, seg.mode.numCharCountBits(version), bb);\n for (const b of seg.getData())\n bb.push(b);\n }\n assert(bb.length == dataUsedBits);\n const dataCapacityBits = _QrCode.getNumDataCodewords(version, ecl) * 8;\n assert(bb.length <= dataCapacityBits);\n appendBits(0, Math.min(4, dataCapacityBits - bb.length), bb);\n appendBits(0, (8 - bb.length % 8) % 8, bb);\n assert(bb.length % 8 == 0);\n for (let padByte = 236; bb.length < dataCapacityBits; padByte ^= 236 ^ 17)\n appendBits(padByte, 8, bb);\n let dataCodewords = [];\n while (dataCodewords.length * 8 < bb.length)\n dataCodewords.push(0);\n bb.forEach((b, i) => dataCodewords[i >>> 3] |= b << 7 - (i & 7));\n return new _QrCode(version, ecl, dataCodewords, mask);\n }\n /*-- Accessor methods --*/\n // Returns the color of the module (pixel) at the given coordinates, which is false\n // for light or true for dark. The top left corner has the coordinates (x=0, y=0).\n // If the given coordinates are out of bounds, then false (light) is returned.\n getModule(x, y) {\n return 0 <= x && x < this.size && 0 <= y && y < this.size && this.modules[y][x];\n }\n // Modified to expose modules for easy access\n getModules() {\n return this.modules;\n }\n /*-- Private helper methods for constructor: Drawing function modules --*/\n // Reads this object's version field, and draws and marks all function modules.\n drawFunctionPatterns() {\n for (let i = 0; i < this.size; i++) {\n this.setFunctionModule(6, i, i % 2 == 0);\n this.setFunctionModule(i, 6, i % 2 == 0);\n }\n this.drawFinderPattern(3, 3);\n this.drawFinderPattern(this.size - 4, 3);\n this.drawFinderPattern(3, this.size - 4);\n const alignPatPos = this.getAlignmentPatternPositions();\n const numAlign = alignPatPos.length;\n for (let i = 0; i < numAlign; i++) {\n for (let j = 0; j < numAlign; j++) {\n if (!(i == 0 && j == 0 || i == 0 && j == numAlign - 1 || i == numAlign - 1 && j == 0))\n this.drawAlignmentPattern(alignPatPos[i], alignPatPos[j]);\n }\n }\n this.drawFormatBits(0);\n this.drawVersion();\n }\n // Draws two copies of the format bits (with its own error correction code)\n // based on the given mask and this object's error correction level field.\n drawFormatBits(mask) {\n const data = this.errorCorrectionLevel.formatBits << 3 | mask;\n let rem = data;\n for (let i = 0; i < 10; i++)\n rem = rem << 1 ^ (rem >>> 9) * 1335;\n const bits = (data << 10 | rem) ^ 21522;\n assert(bits >>> 15 == 0);\n for (let i = 0; i <= 5; i++)\n this.setFunctionModule(8, i, getBit(bits, i));\n this.setFunctionModule(8, 7, getBit(bits, 6));\n this.setFunctionModule(8, 8, getBit(bits, 7));\n this.setFunctionModule(7, 8, getBit(bits, 8));\n for (let i = 9; i < 15; i++)\n this.setFunctionModule(14 - i, 8, getBit(bits, i));\n for (let i = 0; i < 8; i++)\n this.setFunctionModule(this.size - 1 - i, 8, getBit(bits, i));\n for (let i = 8; i < 15; i++)\n this.setFunctionModule(8, this.size - 15 + i, getBit(bits, i));\n this.setFunctionModule(8, this.size - 8, true);\n }\n // Draws two copies of the version bits (with its own error correction code),\n // based on this object's version field, iff 7 <= version <= 40.\n drawVersion() {\n if (this.version < 7)\n return;\n let rem = this.version;\n for (let i = 0; i < 12; i++)\n rem = rem << 1 ^ (rem >>> 11) * 7973;\n const bits = this.version << 12 | rem;\n assert(bits >>> 18 == 0);\n for (let i = 0; i < 18; i++) {\n const color = getBit(bits, i);\n const a = this.size - 11 + i % 3;\n const b = Math.floor(i / 3);\n this.setFunctionModule(a, b, color);\n this.setFunctionModule(b, a, color);\n }\n }\n // Draws a 9*9 finder pattern including the border separator,\n // with the center module at (x, y). Modules can be out of bounds.\n drawFinderPattern(x, y) {\n for (let dy = -4; dy <= 4; dy++) {\n for (let dx = -4; dx <= 4; dx++) {\n const dist = Math.max(Math.abs(dx), Math.abs(dy));\n const xx = x + dx;\n const yy = y + dy;\n if (0 <= xx && xx < this.size && 0 <= yy && yy < this.size)\n this.setFunctionModule(xx, yy, dist != 2 && dist != 4);\n }\n }\n }\n // Draws a 5*5 alignment pattern, with the center module\n // at (x, y). All modules must be in bounds.\n drawAlignmentPattern(x, y) {\n for (let dy = -2; dy <= 2; dy++) {\n for (let dx = -2; dx <= 2; dx++)\n this.setFunctionModule(x + dx, y + dy, Math.max(Math.abs(dx), Math.abs(dy)) != 1);\n }\n }\n // Sets the color of a module and marks it as a function module.\n // Only used by the constructor. Coordinates must be in bounds.\n setFunctionModule(x, y, isDark) {\n this.modules[y][x] = isDark;\n this.isFunction[y][x] = true;\n }\n /*-- Private helper methods for constructor: Codewords and masking --*/\n // Returns a new byte string representing the given data with the appropriate error correction\n // codewords appended to it, based on this object's version and error correction level.\n addEccAndInterleave(data) {\n const ver = this.version;\n const ecl = this.errorCorrectionLevel;\n if (data.length != _QrCode.getNumDataCodewords(ver, ecl))\n throw new RangeError(\"Invalid argument\");\n const numBlocks = _QrCode.NUM_ERROR_CORRECTION_BLOCKS[ecl.ordinal][ver];\n const blockEccLen = _QrCode.ECC_CODEWORDS_PER_BLOCK[ecl.ordinal][ver];\n const rawCodewords = Math.floor(_QrCode.getNumRawDataModules(ver) / 8);\n const numShortBlocks = numBlocks - rawCodewords % numBlocks;\n const shortBlockLen = Math.floor(rawCodewords / numBlocks);\n let blocks = [];\n const rsDiv = _QrCode.reedSolomonComputeDivisor(blockEccLen);\n for (let i = 0, k = 0; i < numBlocks; i++) {\n let dat = data.slice(k, k + shortBlockLen - blockEccLen + (i < numShortBlocks ? 0 : 1));\n k += dat.length;\n const ecc = _QrCode.reedSolomonComputeRemainder(dat, rsDiv);\n if (i < numShortBlocks)\n dat.push(0);\n blocks.push(dat.concat(ecc));\n }\n let result = [];\n for (let i = 0; i < blocks[0].length; i++) {\n blocks.forEach((block, j) => {\n if (i != shortBlockLen - blockEccLen || j >= numShortBlocks)\n result.push(block[i]);\n });\n }\n assert(result.length == rawCodewords);\n return result;\n }\n // Draws the given sequence of 8-bit codewords (data and error correction) onto the entire\n // data area of this QR Code. Function modules need to be marked off before this is called.\n drawCodewords(data) {\n if (data.length != Math.floor(_QrCode.getNumRawDataModules(this.version) / 8))\n throw new RangeError(\"Invalid argument\");\n let i = 0;\n for (let right = this.size - 1; right >= 1; right -= 2) {\n if (right == 6)\n right = 5;\n for (let vert = 0; vert < this.size; vert++) {\n for (let j = 0; j < 2; j++) {\n const x = right - j;\n const upward = (right + 1 & 2) == 0;\n const y = upward ? this.size - 1 - vert : vert;\n if (!this.isFunction[y][x] && i < data.length * 8) {\n this.modules[y][x] = getBit(data[i >>> 3], 7 - (i & 7));\n i++;\n }\n }\n }\n }\n assert(i == data.length * 8);\n }\n // XORs the codeword modules in this QR Code with the given mask pattern.\n // The function modules must be marked and the codeword bits must be drawn\n // before masking. Due to the arithmetic of XOR, calling applyMask() with\n // the same mask value a second time will undo the mask. A final well-formed\n // QR Code needs exactly one (not zero, two, etc.) mask applied.\n applyMask(mask) {\n if (mask < 0 || mask > 7)\n throw new RangeError(\"Mask value out of range\");\n for (let y = 0; y < this.size; y++) {\n for (let x = 0; x < this.size; x++) {\n let invert;\n switch (mask) {\n case 0:\n invert = (x + y) % 2 == 0;\n break;\n case 1:\n invert = y % 2 == 0;\n break;\n case 2:\n invert = x % 3 == 0;\n break;\n case 3:\n invert = (x + y) % 3 == 0;\n break;\n case 4:\n invert = (Math.floor(x / 3) + Math.floor(y / 2)) % 2 == 0;\n break;\n case 5:\n invert = x * y % 2 + x * y % 3 == 0;\n break;\n case 6:\n invert = (x * y % 2 + x * y % 3) % 2 == 0;\n break;\n case 7:\n invert = ((x + y) % 2 + x * y % 3) % 2 == 0;\n break;\n default:\n throw new Error(\"Unreachable\");\n }\n if (!this.isFunction[y][x] && invert)\n this.modules[y][x] = !this.modules[y][x];\n }\n }\n }\n // Calculates and returns the penalty score based on state of this QR Code's current modules.\n // This is used by the automatic mask choice algorithm to find the mask pattern that yields the lowest score.\n getPenaltyScore() {\n let result = 0;\n for (let y = 0; y < this.size; y++) {\n let runColor = false;\n let runX = 0;\n let runHistory = [0, 0, 0, 0, 0, 0, 0];\n for (let x = 0; x < this.size; x++) {\n if (this.modules[y][x] == runColor) {\n runX++;\n if (runX == 5)\n result += _QrCode.PENALTY_N1;\n else if (runX > 5)\n result++;\n } else {\n this.finderPenaltyAddHistory(runX, runHistory);\n if (!runColor)\n result += this.finderPenaltyCountPatterns(runHistory) * _QrCode.PENALTY_N3;\n runColor = this.modules[y][x];\n runX = 1;\n }\n }\n result += this.finderPenaltyTerminateAndCount(runColor, runX, runHistory) * _QrCode.PENALTY_N3;\n }\n for (let x = 0; x < this.size; x++) {\n let runColor = false;\n let runY = 0;\n let runHistory = [0, 0, 0, 0, 0, 0, 0];\n for (let y = 0; y < this.size; y++) {\n if (this.modules[y][x] == runColor) {\n runY++;\n if (runY == 5)\n result += _QrCode.PENALTY_N1;\n else if (runY > 5)\n result++;\n } else {\n this.finderPenaltyAddHistory(runY, runHistory);\n if (!runColor)\n result += this.finderPenaltyCountPatterns(runHistory) * _QrCode.PENALTY_N3;\n runColor = this.modules[y][x];\n runY = 1;\n }\n }\n result += this.finderPenaltyTerminateAndCount(runColor, runY, runHistory) * _QrCode.PENALTY_N3;\n }\n for (let y = 0; y < this.size - 1; y++) {\n for (let x = 0; x < this.size - 1; x++) {\n const color = this.modules[y][x];\n if (color == this.modules[y][x + 1] && color == this.modules[y + 1][x] && color == this.modules[y + 1][x + 1])\n result += _QrCode.PENALTY_N2;\n }\n }\n let dark = 0;\n for (const row of this.modules)\n dark = row.reduce((sum, color) => sum + (color ? 1 : 0), dark);\n const total = this.size * this.size;\n const k = Math.ceil(Math.abs(dark * 20 - total * 10) / total) - 1;\n assert(0 <= k && k <= 9);\n result += k * _QrCode.PENALTY_N4;\n assert(0 <= result && result <= 2568888);\n return result;\n }\n /*-- Private helper functions --*/\n // Returns an ascending list of positions of alignment patterns for this version number.\n // Each position is in the range [0,177), and are used on both the x and y axes.\n // This could be implemented as lookup table of 40 variable-length lists of integers.\n getAlignmentPatternPositions() {\n if (this.version == 1)\n return [];\n else {\n const numAlign = Math.floor(this.version / 7) + 2;\n const step = this.version == 32 ? 26 : Math.ceil((this.version * 4 + 4) / (numAlign * 2 - 2)) * 2;\n let result = [6];\n for (let pos = this.size - 7; result.length < numAlign; pos -= step)\n result.splice(1, 0, pos);\n return result;\n }\n }\n // Returns the number of data bits that can be stored in a QR Code of the given version number, after\n // all function modules are excluded. This includes remainder bits, so it might not be a multiple of 8.\n // The result is in the range [208, 29648]. This could be implemented as a 40-entry lookup table.\n static getNumRawDataModules(ver) {\n if (ver < _QrCode.MIN_VERSION || ver > _QrCode.MAX_VERSION)\n throw new RangeError(\"Version number out of range\");\n let result = (16 * ver + 128) * ver + 64;\n if (ver >= 2) {\n const numAlign = Math.floor(ver / 7) + 2;\n result -= (25 * numAlign - 10) * numAlign - 55;\n if (ver >= 7)\n result -= 36;\n }\n assert(208 <= result && result <= 29648);\n return result;\n }\n // Returns the number of 8-bit data (i.e. not error correction) codewords contained in any\n // QR Code of the given version number and error correction level, with remainder bits discarded.\n // This stateless pure function could be implemented as a (40*4)-cell lookup table.\n static getNumDataCodewords(ver, ecl) {\n return Math.floor(_QrCode.getNumRawDataModules(ver) / 8) - _QrCode.ECC_CODEWORDS_PER_BLOCK[ecl.ordinal][ver] * _QrCode.NUM_ERROR_CORRECTION_BLOCKS[ecl.ordinal][ver];\n }\n // Returns a Reed-Solomon ECC generator polynomial for the given degree. This could be\n // implemented as a lookup table over all possible parameter values, instead of as an algorithm.\n static reedSolomonComputeDivisor(degree) {\n if (degree < 1 || degree > 255)\n throw new RangeError(\"Degree out of range\");\n let result = [];\n for (let i = 0; i < degree - 1; i++)\n result.push(0);\n result.push(1);\n let root = 1;\n for (let i = 0; i < degree; i++) {\n for (let j = 0; j < result.length; j++) {\n result[j] = _QrCode.reedSolomonMultiply(result[j], root);\n if (j + 1 < result.length)\n result[j] ^= result[j + 1];\n }\n root = _QrCode.reedSolomonMultiply(root, 2);\n }\n return result;\n }\n // Returns the Reed-Solomon error correction codeword for the given data and divisor polynomials.\n static reedSolomonComputeRemainder(data, divisor) {\n let result = divisor.map((_) => 0);\n for (const b of data) {\n const factor = b ^ result.shift();\n result.push(0);\n divisor.forEach((coef, i) => result[i] ^= _QrCode.reedSolomonMultiply(coef, factor));\n }\n return result;\n }\n // Returns the product of the two given field elements modulo GF(2^8/0x11D). The arguments and result\n // are unsigned 8-bit integers. This could be implemented as a lookup table of 256*256 entries of uint8.\n static reedSolomonMultiply(x, y) {\n if (x >>> 8 != 0 || y >>> 8 != 0)\n throw new RangeError(\"Byte out of range\");\n let z = 0;\n for (let i = 7; i >= 0; i--) {\n z = z << 1 ^ (z >>> 7) * 285;\n z ^= (y >>> i & 1) * x;\n }\n assert(z >>> 8 == 0);\n return z;\n }\n // Can only be called immediately after a light run is added, and\n // returns either 0, 1, or 2. A helper function for getPenaltyScore().\n finderPenaltyCountPatterns(runHistory) {\n const n = runHistory[1];\n assert(n <= this.size * 3);\n const core = n > 0 && runHistory[2] == n && runHistory[3] == n * 3 && runHistory[4] == n && runHistory[5] == n;\n return (core && runHistory[0] >= n * 4 && runHistory[6] >= n ? 1 : 0) + (core && runHistory[6] >= n * 4 && runHistory[0] >= n ? 1 : 0);\n }\n // Must be called at the end of a line (row or column) of modules. A helper function for getPenaltyScore().\n finderPenaltyTerminateAndCount(currentRunColor, currentRunLength, runHistory) {\n if (currentRunColor) {\n this.finderPenaltyAddHistory(currentRunLength, runHistory);\n currentRunLength = 0;\n }\n currentRunLength += this.size;\n this.finderPenaltyAddHistory(currentRunLength, runHistory);\n return this.finderPenaltyCountPatterns(runHistory);\n }\n // Pushes the given value to the front and drops the last value. A helper function for getPenaltyScore().\n finderPenaltyAddHistory(currentRunLength, runHistory) {\n if (runHistory[0] == 0)\n currentRunLength += this.size;\n runHistory.pop();\n runHistory.unshift(currentRunLength);\n }\n };\n /*-- Constants and tables --*/\n // The minimum version number supported in the QR Code Model 2 standard.\n _QrCode.MIN_VERSION = 1;\n // The maximum version number supported in the QR Code Model 2 standard.\n _QrCode.MAX_VERSION = 40;\n // For use in getPenaltyScore(), when evaluating which mask is best.\n _QrCode.PENALTY_N1 = 3;\n _QrCode.PENALTY_N2 = 3;\n _QrCode.PENALTY_N3 = 40;\n _QrCode.PENALTY_N4 = 10;\n _QrCode.ECC_CODEWORDS_PER_BLOCK = [\n // Version: (note that index 0 is for padding, and is set to an illegal value)\n //0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 Error correction level\n [-1, 7, 10, 15, 20, 26, 18, 20, 24, 30, 18, 20, 24, 26, 30, 22, 24, 28, 30, 28, 28, 28, 28, 30, 30, 26, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30],\n // Low\n [-1, 10, 16, 26, 18, 24, 16, 18, 22, 22, 26, 30, 22, 22, 24, 24, 28, 28, 26, 26, 26, 26, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28],\n // Medium\n [-1, 13, 22, 18, 26, 18, 24, 18, 22, 20, 24, 28, 26, 24, 20, 30, 24, 28, 28, 26, 30, 28, 30, 30, 30, 30, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30],\n // Quartile\n [-1, 17, 28, 22, 16, 22, 28, 26, 26, 24, 28, 24, 28, 22, 24, 24, 30, 28, 28, 26, 28, 30, 24, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30]\n // High\n ];\n _QrCode.NUM_ERROR_CORRECTION_BLOCKS = [\n // Version: (note that index 0 is for padding, and is set to an illegal value)\n //0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 Error correction level\n [-1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 4, 4, 6, 6, 6, 6, 7, 8, 8, 9, 9, 10, 12, 12, 12, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 24, 25],\n // Low\n [-1, 1, 1, 1, 2, 2, 4, 4, 4, 5, 5, 5, 8, 9, 9, 10, 10, 11, 13, 14, 16, 17, 17, 18, 20, 21, 23, 25, 26, 28, 29, 31, 33, 35, 37, 38, 40, 43, 45, 47, 49],\n // Medium\n [-1, 1, 1, 2, 2, 4, 4, 6, 6, 8, 8, 8, 10, 12, 16, 12, 17, 16, 18, 21, 20, 23, 23, 25, 27, 29, 34, 34, 35, 38, 40, 43, 45, 48, 51, 53, 56, 59, 62, 65, 68],\n // Quartile\n [-1, 1, 1, 2, 4, 4, 4, 5, 6, 8, 8, 11, 11, 16, 16, 18, 16, 19, 21, 25, 25, 25, 34, 30, 32, 35, 37, 40, 42, 45, 48, 51, 54, 57, 60, 63, 66, 70, 74, 77, 81]\n // High\n ];\n let QrCode = _QrCode;\n qrcodegen2.QrCode = _QrCode;\n function appendBits(val, len, bb) {\n if (len < 0 || len > 31 || val >>> len != 0)\n throw new RangeError(\"Value out of range\");\n for (let i = len - 1; i >= 0; i--)\n bb.push(val >>> i & 1);\n }\n function getBit(x, i) {\n return (x >>> i & 1) != 0;\n }\n function assert(cond) {\n if (!cond)\n throw new Error(\"Assertion error\");\n }\n const _QrSegment = class _QrSegment {\n /*-- Constructor (low level) and fields --*/\n // Creates a new QR Code segment with the given attributes and data.\n // The character count (numChars) must agree with the mode and the bit buffer length,\n // but the constraint isn't checked. The given bit buffer is cloned and stored.\n constructor(mode, numChars, bitData) {\n this.mode = mode;\n this.numChars = numChars;\n this.bitData = bitData;\n if (numChars < 0)\n throw new RangeError(\"Invalid argument\");\n this.bitData = bitData.slice();\n }\n /*-- Static factory functions (mid level) --*/\n // Returns a segment representing the given binary data encoded in\n // byte mode. All input byte arrays are acceptable. Any text string\n // can be converted to UTF-8 bytes and encoded as a byte mode segment.\n static makeBytes(data) {\n let bb = [];\n for (const b of data)\n appendBits(b, 8, bb);\n return new _QrSegment(_QrSegment.Mode.BYTE, data.length, bb);\n }\n // Returns a segment representing the given string of decimal digits encoded in numeric mode.\n static makeNumeric(digits) {\n if (!_QrSegment.isNumeric(digits))\n throw new RangeError(\"String contains non-numeric characters\");\n let bb = [];\n for (let i = 0; i < digits.length; ) {\n const n = Math.min(digits.length - i, 3);\n appendBits(parseInt(digits.substring(i, i + n), 10), n * 3 + 1, bb);\n i += n;\n }\n return new _QrSegment(_QrSegment.Mode.NUMERIC, digits.length, bb);\n }\n // Returns a segment representing the given text string encoded in alphanumeric mode.\n // The characters allowed are: 0 to 9, A to Z (uppercase only), space,\n // dollar, percent, asterisk, plus, hyphen, period, slash, colon.\n static makeAlphanumeric(text) {\n if (!_QrSegment.isAlphanumeric(text))\n throw new RangeError(\"String contains unencodable characters in alphanumeric mode\");\n let bb = [];\n let i;\n for (i = 0; i + 2 <= text.length; i += 2) {\n let temp = _QrSegment.ALPHANUMERIC_CHARSET.indexOf(text.charAt(i)) * 45;\n temp += _QrSegment.ALPHANUMERIC_CHARSET.indexOf(text.charAt(i + 1));\n appendBits(temp, 11, bb);\n }\n if (i < text.length)\n appendBits(_QrSegment.ALPHANUMERIC_CHARSET.indexOf(text.charAt(i)), 6, bb);\n return new _QrSegment(_QrSegment.Mode.ALPHANUMERIC, text.length, bb);\n }\n // Returns a new mutable list of zero or more segments to represent the given Unicode text string.\n // The result may use various segment modes and switch modes to optimize the length of the bit stream.\n static makeSegments(text) {\n if (text == \"\")\n return [];\n else if (_QrSegment.isNumeric(text))\n return [_QrSegment.makeNumeric(text)];\n else if (_QrSegment.isAlphanumeric(text))\n return [_QrSegment.makeAlphanumeric(text)];\n else\n return [_QrSegment.makeBytes(_QrSegment.toUtf8ByteArray(text))];\n }\n // Returns a segment representing an Extended Channel Interpretation\n // (ECI) designator with the given assignment value.\n static makeEci(assignVal) {\n let bb = [];\n if (assignVal < 0)\n throw new RangeError(\"ECI assignment value out of range\");\n else if (assignVal < 1 << 7)\n appendBits(assignVal, 8, bb);\n else if (assignVal < 1 << 14) {\n appendBits(2, 2, bb);\n appendBits(assignVal, 14, bb);\n } else if (assignVal < 1e6) {\n appendBits(6, 3, bb);\n appendBits(assignVal, 21, bb);\n } else\n throw new RangeError(\"ECI assignment value out of range\");\n return new _QrSegment(_QrSegment.Mode.ECI, 0, bb);\n }\n // Tests whether the given string can be encoded as a segment in numeric mode.\n // A string is encodable iff each character is in the range 0 to 9.\n static isNumeric(text) {\n return _QrSegment.NUMERIC_REGEX.test(text);\n }\n // Tests whether the given string can be encoded as a segment in alphanumeric mode.\n // A string is encodable iff each character is in the following set: 0 to 9, A to Z\n // (uppercase only), space, dollar, percent, asterisk, plus, hyphen, period, slash, colon.\n static isAlphanumeric(text) {\n return _QrSegment.ALPHANUMERIC_REGEX.test(text);\n }\n /*-- Methods --*/\n // Returns a new copy of the data bits of this segment.\n getData() {\n return this.bitData.slice();\n }\n // (Package-private) Calculates and returns the number of bits needed to encode the given segments at\n // the given version. The result is infinity if a segment has too many characters to fit its length field.\n static getTotalBits(segs, version) {\n let result = 0;\n for (const seg of segs) {\n const ccbits = seg.mode.numCharCountBits(version);\n if (seg.numChars >= 1 << ccbits)\n return Infinity;\n result += 4 + ccbits + seg.bitData.length;\n }\n return result;\n }\n // Returns a new array of bytes representing the given string encoded in UTF-8.\n static toUtf8ByteArray(str) {\n str = encodeURI(str);\n let result = [];\n for (let i = 0; i < str.length; i++) {\n if (str.charAt(i) != \"%\")\n result.push(str.charCodeAt(i));\n else {\n result.push(parseInt(str.substring(i + 1, i + 3), 16));\n i += 2;\n }\n }\n return result;\n }\n };\n /*-- Constants --*/\n // Describes precisely all strings that are encodable in numeric mode.\n _QrSegment.NUMERIC_REGEX = /^[0-9]*$/;\n // Describes precisely all strings that are encodable in alphanumeric mode.\n _QrSegment.ALPHANUMERIC_REGEX = /^[A-Z0-9 $%*+.\\/:-]*$/;\n // The set of all legal characters in alphanumeric mode,\n // where each character value maps to the index in the string.\n _QrSegment.ALPHANUMERIC_CHARSET = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:\";\n let QrSegment = _QrSegment;\n qrcodegen2.QrSegment = _QrSegment;\n})(qrcodegen || (qrcodegen = {}));\n((qrcodegen2) => {\n let QrCode;\n ((QrCode2) => {\n const _Ecc = class _Ecc {\n // The QR Code can tolerate about 30% erroneous codewords\n /*-- Constructor and fields --*/\n constructor(ordinal, formatBits) {\n this.ordinal = ordinal;\n this.formatBits = formatBits;\n }\n };\n /*-- Constants --*/\n _Ecc.LOW = new _Ecc(0, 1);\n // The QR Code can tolerate about 7% erroneous codewords\n _Ecc.MEDIUM = new _Ecc(1, 0);\n // The QR Code can tolerate about 15% erroneous codewords\n _Ecc.QUARTILE = new _Ecc(2, 3);\n // The QR Code can tolerate about 25% erroneous codewords\n _Ecc.HIGH = new _Ecc(3, 2);\n let Ecc = _Ecc;\n QrCode2.Ecc = _Ecc;\n })(QrCode = qrcodegen2.QrCode || (qrcodegen2.QrCode = {}));\n})(qrcodegen || (qrcodegen = {}));\n((qrcodegen2) => {\n let QrSegment;\n ((QrSegment2) => {\n const _Mode = class _Mode {\n /*-- Constructor and fields --*/\n constructor(modeBits, numBitsCharCount) {\n this.modeBits = modeBits;\n this.numBitsCharCount = numBitsCharCount;\n }\n /*-- Method --*/\n // (Package-private) Returns the bit width of the character count field for a segment in\n // this mode in a QR Code at the given version number. The result is in the range [0, 16].\n numCharCountBits(ver) {\n return this.numBitsCharCount[Math.floor((ver + 7) / 17)];\n }\n };\n /*-- Constants --*/\n _Mode.NUMERIC = new _Mode(1, [10, 12, 14]);\n _Mode.ALPHANUMERIC = new _Mode(2, [9, 11, 13]);\n _Mode.BYTE = new _Mode(4, [8, 16, 16]);\n _Mode.KANJI = new _Mode(8, [8, 10, 12]);\n _Mode.ECI = new _Mode(7, [0, 0, 0]);\n let Mode = _Mode;\n QrSegment2.Mode = _Mode;\n })(QrSegment = qrcodegen2.QrSegment || (qrcodegen2.QrSegment = {}));\n})(qrcodegen || (qrcodegen = {}));\nvar qrcodegen_default = qrcodegen;\n\n// src/index.tsx\n/**\n * @license qrcode.react\n * Copyright (c) Paul O'Shannessy\n * SPDX-License-Identifier: ISC\n */\nvar ERROR_LEVEL_MAP = {\n L: qrcodegen_default.QrCode.Ecc.LOW,\n M: qrcodegen_default.QrCode.Ecc.MEDIUM,\n Q: qrcodegen_default.QrCode.Ecc.QUARTILE,\n H: qrcodegen_default.QrCode.Ecc.HIGH\n};\nvar DEFAULT_SIZE = 128;\nvar DEFAULT_LEVEL = \"L\";\nvar DEFAULT_BGCOLOR = \"#FFFFFF\";\nvar DEFAULT_FGCOLOR = \"#000000\";\nvar DEFAULT_INCLUDEMARGIN = false;\nvar DEFAULT_MINVERSION = 1;\nvar SPEC_MARGIN_SIZE = 4;\nvar DEFAULT_MARGIN_SIZE = 0;\nvar DEFAULT_IMG_SCALE = 0.1;\nfunction generatePath(modules, margin = 0) {\n const ops = [];\n modules.forEach(function(row, y) {\n let start = null;\n row.forEach(function(cell, x) {\n if (!cell && start !== null) {\n ops.push(\n `M${start + margin} ${y + margin}h${x - start}v1H${start + margin}z`\n );\n start = null;\n return;\n }\n if (x === row.length - 1) {\n if (!cell) {\n return;\n }\n if (start === null) {\n ops.push(`M${x + margin},${y + margin} h1v1H${x + margin}z`);\n } else {\n ops.push(\n `M${start + margin},${y + margin} h${x + 1 - start}v1H${start + margin}z`\n );\n }\n return;\n }\n if (cell && start === null) {\n start = x;\n }\n });\n });\n return ops.join(\"\");\n}\nfunction excavateModules(modules, excavation) {\n return modules.slice().map((row, y) => {\n if (y < excavation.y || y >= excavation.y + excavation.h) {\n return row;\n }\n return row.map((cell, x) => {\n if (x < excavation.x || x >= excavation.x + excavation.w) {\n return cell;\n }\n return false;\n });\n });\n}\nfunction getImageSettings(cells, size, margin, imageSettings) {\n if (imageSettings == null) {\n return null;\n }\n const numCells = cells.length + margin * 2;\n const defaultSize = Math.floor(size * DEFAULT_IMG_SCALE);\n const scale = numCells / size;\n const w = (imageSettings.width || defaultSize) * scale;\n const h = (imageSettings.height || defaultSize) * scale;\n const x = imageSettings.x == null ? cells.length / 2 - w / 2 : imageSettings.x * scale;\n const y = imageSettings.y == null ? cells.length / 2 - h / 2 : imageSettings.y * scale;\n const opacity = imageSettings.opacity == null ? 1 : imageSettings.opacity;\n let excavation = null;\n if (imageSettings.excavate) {\n let floorX = Math.floor(x);\n let floorY = Math.floor(y);\n let ceilW = Math.ceil(w + x - floorX);\n let ceilH = Math.ceil(h + y - floorY);\n excavation = { x: floorX, y: floorY, w: ceilW, h: ceilH };\n }\n const crossOrigin = imageSettings.crossOrigin;\n return { x, y, h, w, excavation, opacity, crossOrigin };\n}\nfunction getMarginSize(includeMargin, marginSize) {\n if (marginSize != null) {\n return Math.max(Math.floor(marginSize), 0);\n }\n return includeMargin ? SPEC_MARGIN_SIZE : DEFAULT_MARGIN_SIZE;\n}\nfunction useQRCode({\n value,\n level,\n minVersion,\n includeMargin,\n marginSize,\n imageSettings,\n size,\n boostLevel\n}) {\n let qrcode = React.useMemo(() => {\n const values = Array.isArray(value) ? value : [value];\n const segments = values.reduce((accum, v) => {\n accum.push(...qrcodegen_default.QrSegment.makeSegments(v));\n return accum;\n }, []);\n return qrcodegen_default.QrCode.encodeSegments(\n segments,\n ERROR_LEVEL_MAP[level],\n minVersion,\n void 0,\n void 0,\n boostLevel\n );\n }, [value, level, minVersion, boostLevel]);\n const { cells, margin, numCells, calculatedImageSettings } = React.useMemo(() => {\n let cells2 = qrcode.getModules();\n const margin2 = getMarginSize(includeMargin, marginSize);\n const numCells2 = cells2.length + margin2 * 2;\n const calculatedImageSettings2 = getImageSettings(\n cells2,\n size,\n margin2,\n imageSettings\n );\n return {\n cells: cells2,\n margin: margin2,\n numCells: numCells2,\n calculatedImageSettings: calculatedImageSettings2\n };\n }, [qrcode, size, imageSettings, includeMargin, marginSize]);\n return {\n qrcode,\n margin,\n cells,\n numCells,\n calculatedImageSettings\n };\n}\nvar SUPPORTS_PATH2D = function() {\n try {\n new Path2D().addPath(new Path2D());\n } catch (e) {\n return false;\n }\n return true;\n}();\nvar QRCodeCanvas = React.forwardRef(\n function QRCodeCanvas2(props, forwardedRef) {\n const _a = props, {\n value,\n size = DEFAULT_SIZE,\n level = DEFAULT_LEVEL,\n bgColor = DEFAULT_BGCOLOR,\n fgColor = DEFAULT_FGCOLOR,\n includeMargin = DEFAULT_INCLUDEMARGIN,\n minVersion = DEFAULT_MINVERSION,\n boostLevel,\n marginSize,\n imageSettings\n } = _a, extraProps = __objRest(_a, [\n \"value\",\n \"size\",\n \"level\",\n \"bgColor\",\n \"fgColor\",\n \"includeMargin\",\n \"minVersion\",\n \"boostLevel\",\n \"marginSize\",\n \"imageSettings\"\n ]);\n const _b = extraProps, { style } = _b, otherProps = __objRest(_b, [\"style\"]);\n const imgSrc = imageSettings == null ? void 0 : imageSettings.src;\n const _canvas = React.useRef(null);\n const _image = React.useRef(null);\n const setCanvasRef = React.useCallback(\n (node) => {\n _canvas.current = node;\n if (typeof forwardedRef === \"function\") {\n forwardedRef(node);\n } else if (forwardedRef) {\n forwardedRef.current = node;\n }\n },\n [forwardedRef]\n );\n const [isImgLoaded, setIsImageLoaded] = React.useState(false);\n const { margin, cells, numCells, calculatedImageSettings } = useQRCode({\n value,\n level,\n minVersion,\n boostLevel,\n includeMargin,\n marginSize,\n imageSettings,\n size\n });\n React.useEffect(() => {\n if (_canvas.current != null) {\n const canvas = _canvas.current;\n const ctx = canvas.getContext(\"2d\");\n if (!ctx) {\n return;\n }\n let cellsToDraw = cells;\n const image = _image.current;\n const haveImageToRender = calculatedImageSettings != null && image !== null && image.complete && image.naturalHeight !== 0 && image.naturalWidth !== 0;\n if (haveImageToRender) {\n if (calculatedImageSettings.excavation != null) {\n cellsToDraw = excavateModules(\n cells,\n calculatedImageSettings.excavation\n );\n }\n }\n const pixelRatio = window.devicePixelRatio || 1;\n canvas.height = canvas.width = size * pixelRatio;\n const scale = size / numCells * pixelRatio;\n ctx.scale(scale, scale);\n ctx.fillStyle = bgColor;\n ctx.fillRect(0, 0, numCells, numCells);\n ctx.fillStyle = fgColor;\n if (SUPPORTS_PATH2D) {\n ctx.fill(new Path2D(generatePath(cellsToDraw, margin)));\n } else {\n cells.forEach(function(row, rdx) {\n row.forEach(function(cell, cdx) {\n if (cell) {\n ctx.fillRect(cdx + margin, rdx + margin, 1, 1);\n }\n });\n });\n }\n if (calculatedImageSettings) {\n ctx.globalAlpha = calculatedImageSettings.opacity;\n }\n if (haveImageToRender) {\n ctx.drawImage(\n image,\n calculatedImageSettings.x + margin,\n calculatedImageSettings.y + margin,\n calculatedImageSettings.w,\n calculatedImageSettings.h\n );\n }\n }\n });\n React.useEffect(() => {\n setIsImageLoaded(false);\n }, [imgSrc]);\n const canvasStyle = __spreadValues({ height: size, width: size }, style);\n let img = null;\n if (imgSrc != null) {\n img = /* @__PURE__ */ React.createElement(\n \"img\",\n {\n src: imgSrc,\n key: imgSrc,\n style: { display: \"none\" },\n onLoad: () => {\n setIsImageLoaded(true);\n },\n ref: _image,\n crossOrigin: calculatedImageSettings == null ? void 0 : calculatedImageSettings.crossOrigin\n }\n );\n }\n return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(\n \"canvas\",\n __spreadValues({\n style: canvasStyle,\n height: size,\n width: size,\n ref: setCanvasRef,\n role: \"img\"\n }, otherProps)\n ), img);\n }\n);\nQRCodeCanvas.displayName = \"QRCodeCanvas\";\nvar QRCodeSVG = React.forwardRef(\n function QRCodeSVG2(props, forwardedRef) {\n const _a = props, {\n value,\n size = DEFAULT_SIZE,\n level = DEFAULT_LEVEL,\n bgColor = DEFAULT_BGCOLOR,\n fgColor = DEFAULT_FGCOLOR,\n includeMargin = DEFAULT_INCLUDEMARGIN,\n minVersion = DEFAULT_MINVERSION,\n boostLevel,\n title,\n marginSize,\n imageSettings\n } = _a, otherProps = __objRest(_a, [\n \"value\",\n \"size\",\n \"level\",\n \"bgColor\",\n \"fgColor\",\n \"includeMargin\",\n \"minVersion\",\n \"boostLevel\",\n \"title\",\n \"marginSize\",\n \"imageSettings\"\n ]);\n const { margin, cells, numCells, calculatedImageSettings } = useQRCode({\n value,\n level,\n minVersion,\n boostLevel,\n includeMargin,\n marginSize,\n imageSettings,\n size\n });\n let cellsToDraw = cells;\n let image = null;\n if (imageSettings != null && calculatedImageSettings != null) {\n if (calculatedImageSettings.excavation != null) {\n cellsToDraw = excavateModules(\n cells,\n calculatedImageSettings.excavation\n );\n }\n image = /* @__PURE__ */ React.createElement(\n \"image\",\n {\n href: imageSettings.src,\n height: calculatedImageSettings.h,\n width: calculatedImageSettings.w,\n x: calculatedImageSettings.x + margin,\n y: calculatedImageSettings.y + margin,\n preserveAspectRatio: \"none\",\n opacity: calculatedImageSettings.opacity,\n crossOrigin: calculatedImageSettings.crossOrigin\n }\n );\n }\n const fgPath = generatePath(cellsToDraw, margin);\n return /* @__PURE__ */ React.createElement(\n \"svg\",\n __spreadValues({\n height: size,\n width: size,\n viewBox: `0 0 ${numCells} ${numCells}`,\n ref: forwardedRef,\n role: \"img\"\n }, otherProps),\n !!title && /* @__PURE__ */ React.createElement(\"title\", null, title),\n /* @__PURE__ */ React.createElement(\n \"path\",\n {\n fill: bgColor,\n d: `M0,0 h${numCells}v${numCells}H0z`,\n shapeRendering: \"crispEdges\"\n }\n ),\n /* @__PURE__ */ React.createElement(\"path\", { fill: fgColor, d: fgPath, shapeRendering: \"crispEdges\" }),\n image\n );\n }\n);\nQRCodeSVG.displayName = \"QRCodeSVG\";\nexport {\n QRCodeCanvas,\n QRCodeSVG\n};\n","/**\n * Inline SVG icons for the pairing panel (16px stroke style matching the\n * shell's nav icons). Held here rather than imported from\n * `@deepseek-ai/dsh-client-ui-primitives` so the panel's rendered tree carries\n * no closure-factory bundle import: the component stays renderable under the\n * package's own test runner.\n */\nimport type { SVGProps } from 'react'\n\n/** Shared svg attrs for the 16px stroke icon family. */\nfunction iconProps(props: SVGProps<SVGSVGElement>): SVGProps<SVGSVGElement> {\n return {\n width: 16,\n height: 16,\n viewBox: '0 0 16 16',\n fill: 'none',\n stroke: 'currentColor',\n strokeWidth: 1.3,\n strokeLinecap: 'round',\n strokeLinejoin: 'round',\n 'aria-hidden': true,\n ...props,\n }\n}\n\n/** A QR-symbol glyph: three finder squares plus a payload dot. */\nexport function QrIcon(props: SVGProps<SVGSVGElement>) {\n return (\n <svg {...iconProps(props)}>\n <path d=\"M2.5 2.5h4v4h-4zM9.5 2.5h4v4h-4zM2.5 9.5h4v4h-4z\" />\n <path d=\"M9.5 9.5h1.6v1.6H9.5zM12.4 9.5h1.1M9.5 12.4v1.1M12 13.5h1.5v-1.5h-1.5z\" />\n </svg>\n )\n}\n\n/** Copy glyph. */\nexport function CopyIcon(props: SVGProps<SVGSVGElement>) {\n return (\n <svg {...iconProps(props)}>\n <rect x=\"5.5\" y=\"5.5\" width=\"9\" height=\"9\" rx=\"1.5\" />\n <path d=\"M2.5 10.5v-7A1.5 1.5 0 0 1 4 2h5.5\" />\n </svg>\n )\n}\n\n/** Check glyph for the transient copied state. */\nexport function CheckIcon(props: SVGProps<SVGSVGElement>) {\n return (\n <svg {...iconProps(props)}>\n <path d=\"M3 8.5 6.5 12l6.5-8\" />\n </svg>\n )\n}\n\n/** Close glyph for the panel header. */\nexport function CloseIcon(props: SVGProps<SVGSVGElement>) {\n return (\n <svg {...iconProps(props)}>\n <path d=\"M4 4l8 8M12 4l-8 8\" />\n </svg>\n )\n}\n\n/** Refresh glyph for the mint-again action. */\nexport function RefreshIcon(props: SVGProps<SVGSVGElement>) {\n return (\n <svg {...iconProps(props)}>\n <path d=\"M13 8a5 5 0 1 1-1.8-3.85\" />\n <path d=\"M13.2 2.4V5.6H10\" />\n </svg>\n )\n}\n","/**\n * Semantic attribute values for the protocol v1 pairing panel (contract:\n * skins/skin-center/contracts/semantic-attrs-v1.md). Root containers carry\n * `data-dsh-plugin`; parts carry bare `data-dsh-part` values owned by that\n * plugin attribute.\n */\n\n/** Plugin short name stamped on the footer trigger and the modal root. */\nexport const PLUGIN_ATTR = 'remote-bridge'\n\n/** The sidebar footer seat trigger. */\nexport const PART_ENTRY = 'entry'\n\n/** The modal panel root. */\nexport const PART_PANEL = 'panel'\n\n/** The QR symbol's wrapper — it also mirrors the encoded string. */\nexport const PART_QR = 'qr'\n\n/** The plaintext pairing code row. */\nexport const PART_TOKEN = 'token'\n\n/** A state notice: the origin warning, or a refusal the host raised. */\nexport const PART_NOTICE = 'notice'\n\n/** The mint-again button. */\nexport const PART_REFRESH = 'refresh'\n\n/** The copy-the-code button. */\nexport const PART_COPY = 'copy'\n\n/**\n * Attribute carrying the exact string the QR symbol encodes, so the operator\n * (and a UI check) can compare it against the host route's answer without\n * decoding the symbol. The same string is already on screen in plaintext.\n */\nexport const QR_VALUE_ATTR = 'data-dsh-qr-value'\n","/**\n * The protocol v1 pairing panel body: the QR symbol, the same secret in\n * plaintext, the 30 s countdown with its expiry state, the refresh action, and\n * the two facts the reader must not miss — the phone's origin is the public\n * relay (never this machine's loopback address), and the code is one-shot.\n *\n * Pure presentation: every state and action arrives through props, and the\n * clock is a prop, so the expiry flip is deterministic instead of read from\n * `Date.now()` here.\n */\nimport { memo } from 'react'\nimport { QRCodeSVG } from 'qrcode.react'\nimport type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'\nimport { CheckIcon, CloseIcon, CopyIcon, RefreshIcon } from './icons.tsx'\nimport { PART_COPY, PART_NOTICE, PART_PANEL, PART_QR, PART_REFRESH, PART_TOKEN, PLUGIN_ATTR, QR_VALUE_ATTR } from './semantic.ts'\nimport css from './panel.module.css'\n\n/** What the panel is currently showing. */\nexport type PairPanelState =\n /** A read is in flight. */\n | { kind: 'reading' }\n /**\n * A live one-shot secret. `pairingUrl`, when the host could name its own\n * public origin, is what the QR encodes: a `{token, url}` document the iOS\n * client parses into both halves of its configuration, so one scan sets the\n * address AND the token. With no origin the QR carries the bare token and the\n * panel says the address has to be set on the phone by hand.\n */\n | { kind: 'ready'; token: string; issuedAt: number; expiresAt: number; origin: string | null; pairingUrl: string | null }\n /** 403 from the loopback gate: this page is not open on the machine itself. */\n | { kind: 'forbidden' }\n /** The host route answered with an unexpected status or shape. */\n | { kind: 'failed'; status: number }\n /** The request never reached the host. */\n | { kind: 'unreachable' }\n\n/** How the last copy attempt went. */\nexport type PairCopyState = 'idle' | 'copied' | 'failed'\n\nexport interface PairPanelProps {\n t: PropsLocale<'remote-bridge'>['t']\n state: PairPanelState\n /** The current wall clock; the entry supplies it from a one-second ticker. */\n now: number\n /** This page's own `host:port`, named in the origin warning. */\n host: string\n copy: PairCopyState\n onClose(): void\n onRefresh(): void\n onCopy(token: string): void\n}\n\n/**\n * The QR symbol, memoized on the secret: the countdown re-renders the panel\n * every second, and qrcode.react rebuilds the whole module path on each render.\n * The encoded value is the host's own `pairingUrl` verbatim when there is one —\n * a `{token, url}` document whose `url` names THIS instance's public relay, so\n * the phone adopts an origin that actually reaches this host. The bare-token\n * fallback means the phone keeps whatever origin it already has.\n */\nconst PairQrCode = memo(function PairQrCode({ value, label }: { value: string; label: string }) {\n return <QRCodeSVG value={value} size={184} level=\"M\" marginSize={1} aria-label={label} />\n})\n\n/** One state notice: a title and, when there is one, the sentence explaining it. */\nfunction Notice({ tone, title, body }: { tone: 'plain' | 'warning' | 'alert'; title: string; body?: string }) {\n return (\n <div className={css.notice} data-dsh-part={PART_NOTICE} data-tone={tone} role={tone === 'plain' ? 'status' : 'alert'}>\n <p className={css.noticeTitle}>{title}</p>\n {body !== undefined && <p className={css.noticeBody}>{body}</p>}\n </div>\n )\n}\n\n/**\n * Render the pairing panel.\n * @param props - locale seat, view state, clock, page host and actions.\n * @returns the panel element tree.\n */\nexport function PairPanel({ t, state, now, host, copy, onClose, onRefresh, onCopy }: PairPanelProps) {\n const remainingMs = state.kind === 'ready' ? Math.max(0, state.expiresAt - now) : 0\n const expired = state.kind === 'ready' && remainingMs <= 0\n const seconds = Math.ceil(remainingMs / 1000)\n const windowMs = state.kind === 'ready' ? Math.max(1, state.expiresAt - state.issuedAt) : 1\n const percent = Math.min(100, Math.max(0, Math.round((remainingMs / windowMs) * 100)))\n // What the QR encodes and what the copy button hands over: the same string,\n // so a human can paste exactly what a camera would have read.\n const payload = state.kind === 'ready' ? (state.pairingUrl ?? state.token) : ''\n\n return (\n <div className={css.overlay} role=\"presentation\">\n <div className={css.mask} aria-hidden=\"true\" onClick={onClose} />\n <div\n className={css.panel}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={t('title')}\n data-dsh-plugin={PLUGIN_ATTR}\n data-dsh-part={PART_PANEL}\n >\n <div className={css.header}>\n <div className={css.heading}>\n <h2 className={css.title}>{t('title')}</h2>\n <p className={css.subtitle}>{t('subtitle')}</p>\n </div>\n <button type=\"button\" className={css.closeButton} aria-label={t('action.close')} onClick={onClose}>\n <CloseIcon />\n </button>\n </div>\n\n {state.kind === 'reading' && <Notice tone=\"plain\" title={t('state.reading')} />}\n\n {state.kind === 'forbidden' && (\n <Notice tone=\"alert\" title={t('forbidden.title')} body={t('forbidden.body')} />\n )}\n\n {state.kind === 'failed' && (\n <Notice tone=\"alert\" title={t('failed.title')} body={t('failed.body', { status: String(state.status) })} />\n )}\n\n {state.kind === 'unreachable' && (\n <Notice tone=\"alert\" title={t('unreachable.title')} body={t('unreachable.body')} />\n )}\n\n {state.kind === 'ready' && (\n <>\n <div className={css.qrCard}>\n <div className={css.qrWrap} data-dsh-part={PART_QR} {...{ [QR_VALUE_ATTR]: payload }}>\n <PairQrCode value={payload} label={t('pair.qrLabel')} />\n </div>\n {expired ? (\n <Notice tone=\"alert\" title={t('pair.expired')} body={t('pair.expiredHint')} />\n ) : (\n <div className={css.countdown}>\n <span className={css.countdownText}>{t('pair.countdown', { s: String(seconds) })}</span>\n <span className={css.bar}>\n <span className={css.barFill} style={{ width: `${String(percent)}%` }} />\n </span>\n </div>\n )}\n </div>\n\n <div className={css.tokenRow} data-dsh-part={PART_TOKEN}>\n <span className={css.tokenLabel}>{t('pair.payloadLabel')}</span>\n <code className={css.token}>{payload}</code>\n </div>\n\n <button\n type=\"button\"\n className={css.copyButton}\n data-dsh-part={PART_COPY}\n data-copied={copy === 'copied'}\n data-failed={copy === 'failed'}\n onClick={() => { onCopy(payload) }}\n >\n {copy === 'copied' ? <CheckIcon /> : <CopyIcon />}\n {copy === 'copied' ? t('action.copied') : copy === 'failed' ? t('action.copyFailed') : t('action.copy')}\n </button>\n\n {state.pairingUrl === null ? (\n <Notice tone=\"warning\" title={t('origin.title')} body={t('origin.body', { host })} />\n ) : (\n <Notice\n tone=\"plain\"\n title={t('origin.located.title')}\n body={t('origin.located.body', { origin: state.origin ?? '' })}\n />\n )}\n </>\n )}\n\n <div className={css.actions}>\n {state.kind !== 'reading' && state.kind !== 'forbidden' && (\n <button type=\"button\" className={css.refresh} data-dsh-part={PART_REFRESH} onClick={onRefresh}>\n <RefreshIcon />\n {t('pair.refresh')}\n </button>\n )}\n </div>\n </div>\n </div>\n )\n}\n","/**\n * Sidebar footer entry for the protocol v1 pairing panel: the icon-only trigger\n * beside the sidebar settings seat (wide row / rail circle) that opens the\n * panel. Registered into the official `sidebar.footer.action` list slot\n * (declared by ui-sidebar — the same seat dsh-remote-web-ui and dsh-update\n * share).\n *\n * This component owns the panel's behavior: one read per open, one clock tick\n * while a live code is on screen, the mint-again action, and the copy action.\n * The wire call and the clipboard are injected (see the plugin entry), so the\n * rendered tree carries no closure-factory bundle import and both can be driven\n * by a test without patching a module.\n */\nimport { useCallback, useEffect, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\nimport type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'\nimport { PairPanel, type PairCopyState, type PairPanelState } from './PairPanel.tsx'\nimport type { PairTokenOutcome } from './pair-token.ts'\nimport { PART_ENTRY, PLUGIN_ATTR } from './semantic.ts'\nimport { QrIcon } from './icons.tsx'\nimport css from './panel.module.css'\n\n/** How long the transient \"copied\" / \"copy failed\" label stays up. */\nconst COPY_FEEDBACK_MS = 1_500\n/** The countdown's tick; one second is the resolution the panel shows. */\nconst TICK_MS = 1_000\n\nexport type PairEntryProps = PropsLocale<'remote-bridge'> & {\n /** Whether the sidebar renders wide content (false = 56px rail). */\n wide: boolean\n /** Reads a fresh one-shot token from this package's own Host route. */\n read: () => Promise<PairTokenOutcome>\n /** Puts the token on the OS clipboard; false means the write was refused. */\n copy: (text: string) => Promise<boolean>\n}\n\n/** Map a read outcome onto the panel's view state. */\nfunction panelStateOf(outcome: PairTokenOutcome, issuedAt: number): PairPanelState {\n switch (outcome.kind) {\n case 'ok':\n return {\n kind: 'ready',\n token: outcome.token,\n issuedAt,\n expiresAt: outcome.expiresAt,\n origin: outcome.origin,\n pairingUrl: outcome.pairingUrl,\n }\n case 'forbidden': return { kind: 'forbidden' }\n case 'unreachable': return { kind: 'unreachable' }\n case 'failed': return { kind: 'failed', status: outcome.status }\n }\n}\n\n/**\n * Render the pairing seat trigger and, when open, the panel.\n * @param props - the footer seat's column state, the injected actions and the locale seat.\n * @returns the trigger and the panel portal.\n */\nexport function PairEntry({ wide, read, copy, t }: PairEntryProps) {\n const [open, setOpen] = useState(false)\n const [state, setState] = useState<PairPanelState>({ kind: 'reading' })\n const [copyState, setCopyState] = useState<PairCopyState>('idle')\n const [now, setNow] = useState<number>(() => Date.now())\n // Generation counter: closing (or minting again) invalidates a read that is\n // still in flight, so an answer that lands after the panel closed cannot\n // resurrect a code nobody asked for.\n const generation = useRef(0)\n\n const mint = useCallback((): void => {\n const request = ++generation.current\n setState({ kind: 'reading' })\n void read().then((outcome) => {\n if (request !== generation.current) return\n const issuedAt = Date.now()\n setNow(issuedAt)\n setState(panelStateOf(outcome, issuedAt))\n })\n }, [read])\n\n const openPanel = useCallback((): void => {\n setOpen(true)\n setCopyState('idle')\n mint()\n }, [mint])\n\n const closePanel = useCallback((): void => {\n generation.current += 1\n setOpen(false)\n }, [])\n\n // One ticker per live code; it clears itself at the deadline, so a panel left\n // open on an expired code stops re-rendering instead of ticking forever.\n useEffect(() => {\n if (!open || state.kind !== 'ready') return\n const deadline = state.expiresAt\n const timer = window.setInterval(() => {\n const current = Date.now()\n setNow(current)\n if (current >= deadline) window.clearInterval(timer)\n }, TICK_MS)\n return () => { window.clearInterval(timer) }\n }, [open, state])\n\n useEffect(() => {\n if (!open) return\n const onKey = (event: KeyboardEvent): void => {\n if (event.key === 'Escape') closePanel()\n }\n window.addEventListener('keydown', onKey)\n return () => { window.removeEventListener('keydown', onKey) }\n }, [open, closePanel])\n\n const handleCopy = useCallback((token: string): void => {\n void copy(token).then((ok) => {\n setCopyState(ok ? 'copied' : 'failed')\n window.setTimeout(() => { setCopyState('idle') }, COPY_FEEDBACK_MS)\n })\n }, [copy])\n\n return (\n <>\n <button\n type=\"button\"\n className={css.trigger}\n data-dsh-plugin={PLUGIN_ATTR}\n data-dsh-part={PART_ENTRY}\n data-wide={wide ? 'wide' : 'rail'}\n aria-label={t('entry.label')}\n aria-expanded={open}\n title={t('entry.label')}\n onClick={openPanel}\n >\n <QrIcon />\n </button>\n {open && createPortal(\n <PairPanel\n t={t}\n state={state}\n now={now}\n host={window.location.host}\n copy={copyState}\n onClose={closePanel}\n onRefresh={mint}\n onCopy={handleCopy}\n />,\n document.body,\n )}\n </>\n )\n}\n","/**\n * The frozen protocol surface: method names, topic names, refusal codes, and\n * the one authorization rule the dispatcher enforces before any method runs.\n * @module dsh-remote-bridge/core/protocol\n */\n\n/** Client-callable methods of protocol v1. */\nexport const METHOD_HELLO = 'hello'\nexport const METHOD_SESSION_LIST = 'session.list'\nexport const METHOD_SESSION_TITLES = 'session.titles'\nexport const METHOD_SESSION_SNAPSHOT = 'session.snapshot'\nexport const METHOD_SESSION_HISTORY = 'session.history'\nexport const METHOD_SESSION_PROMPT = 'session.prompt'\nexport const METHOD_SESSION_INTERRUPT = 'session.interrupt'\nexport const METHOD_SESSION_ATTACHMENT = 'session.attachment'\nexport const METHOD_SESSION_PERMISSIONS = 'session.permissions'\nexport const METHOD_SESSION_SET_PERMISSION = 'session.setPermission'\nexport const METHOD_SESSION_MODELS = 'session.models'\nexport const METHOD_SESSION_SET_MODEL = 'session.setModel'\nexport const METHOD_PAIR_BEGIN = 'pair.begin'\nexport const METHOD_PAIR_FINISH = 'pair.finish'\nexport const METHOD_APPROVAL_RESOLVE = 'approval.resolve'\nexport const METHOD_QUESTION_ANSWER = 'question.answer'\n\n/** Server-pushed topics of protocol v1. */\nexport const TOPIC_SESSION_DELTA = 'session.delta'\nexport const TOPIC_APPROVAL_REQUEST = 'approval.request'\nexport const TOPIC_QUESTION_REQUEST = 'question.request'\n\n/**\n * Capability a client declares in `hello`'s `cap` array to ask for a trimmed\n * `session.snapshot` baseline. A client that does not declare it — including\n * every client written before this capability existed — is served exactly the\n * baseline protocol v1 always served.\n */\nexport const CAP_SESSION_SNAPSHOT_TRIM = 'session.snapshot.trim.v1'\n\n/**\n * Capability a client declares in `hello`'s `cap` array to have\n * `session.snapshot` answer with one bounded page instead of the whole opening\n * window. Declaring it is what makes an opening screen cost one page rather\n * than a whole session; a client that does not declare it — including every\n * client written before this capability existed — receives byte for byte the\n * snapshot protocol v1 always served.\n */\nexport const CAP_SESSION_SNAPSHOT_PAGE = 'session.snapshot.page.v1'\n\n/**\n * Capability a client declares in `hello`'s `cap` array to be shown the\n * host's pending user questions and to answer them with `question.answer`.\n *\n * Declaring it is what makes `question.request` reachable and what makes the\n * method part of that client's protocol at all: a client that does not declare\n * it — including every client written before this channel existed — receives no\n * such event, and its `question.answer` is refused as an unknown method,\n * exactly as that frame was refused before.\n */\nexport const CAP_QUESTIONS = 'questions.v1'\n\n/**\n * Methods an unpaired connection may still call: the handshake itself and the\n * two pairing steps. Everything else answers `unpaired` — a caller can pair\n * without a device token, but cannot touch a session without one.\n */\nexport const UNPAIRED_METHODS: ReadonlySet<string> = new Set([\n METHOD_HELLO,\n METHOD_PAIR_BEGIN,\n METHOD_PAIR_FINISH,\n])\n\n/** Every method this protocol version serves. */\nexport const KNOWN_METHODS: ReadonlySet<string> = new Set([\n METHOD_HELLO,\n METHOD_SESSION_LIST,\n METHOD_SESSION_TITLES,\n METHOD_SESSION_SNAPSHOT,\n METHOD_SESSION_HISTORY,\n METHOD_SESSION_PROMPT,\n METHOD_SESSION_INTERRUPT,\n METHOD_SESSION_ATTACHMENT,\n METHOD_SESSION_PERMISSIONS,\n METHOD_SESSION_SET_PERMISSION,\n METHOD_SESSION_MODELS,\n METHOD_SESSION_SET_MODEL,\n METHOD_PAIR_BEGIN,\n METHOD_PAIR_FINISH,\n METHOD_APPROVAL_RESOLVE,\n METHOD_QUESTION_ANSWER,\n])\n\n/** Refusal codes the bridge itself raises (DSH failures cross as their own code). */\nexport const CODE_UNPAIRED = 'unpaired'\nexport const CODE_UNKNOWN_METHOD = 'unknown-method'\nexport const CODE_INVALID_ARGS = 'invalid-args'\nexport const CODE_PROTO_UNSUPPORTED = 'proto-unsupported'\nexport const CODE_TOKEN_INVALID = 'token-invalid'\nexport const CODE_NONCE_INVALID = 'nonce-invalid'\nexport const CODE_SIGNATURE_INVALID = 'signature-invalid'\nexport const CODE_APPROVAL_UNKNOWN = 'approval-unknown'\n/**\n * The bridge does not hold the named question: it never claimed that call id, it\n * already answered it, or the host no longer holds it as answerable. Host\n * failures crossing this method keep their own codes instead.\n */\nexport const CODE_QUESTION_UNKNOWN = 'question-unknown'\nexport const CODE_SNAPSHOT_UNAVAILABLE = 'snapshot-unavailable'\nexport const CODE_SNAPSHOT_TOO_LARGE = 'snapshot-too-large'\nexport const CODE_INTERNAL = 'internal'\n\n/** Protocol version this package speaks. */\nexport const PROTO = 1\n/** Minor version this package speaks. */\nexport const MINOR = 0\n/** `server` field of the hello response. */\nexport const SERVER_ID = 'dsh-remote-bridge'\n\n/** Exact route path of the bridge's WebSocket endpoint. */\nexport const WS_PATH = '/ios/v1'\n/** Exact route path of the loopback-only bootstrap token endpoint. */\nexport const PAIR_TOKEN_PATH = '/remote-bridge/pair/token'\n","/**\n * The panel's one wire call: read the one-shot bootstrap token from this\n * package's own Host route.\n *\n * The route is same-origin and document-relative (the GUI is served with\n * `<base href=\"./\">`, so a sub-path deployment resolves it against its entry\n * directory instead of escaping to the origin root — the same rule\n * `dsh-remote-web-ui`'s pair API follows). It is NOT consumed here: the panel\n * only displays the secret, and the phone spends it in `pair.begin`, so a\n * mis-click on \"new code\" voids a token without ever pairing a device.\n *\n * `403` is a fact, not an error: the loopback gate in `core/loopback.ts`\n * refuses any page whose socket or `Host` is not this machine, which is exactly\n * the case the panel must name out loud.\n * @module dsh-remote-bridge/client/pair-token\n */\n\nimport { PAIR_TOKEN_PATH } from '../core/protocol.ts'\n\n/** Document-relative form of the Host route, for a page served under any base. */\nexport const PAIR_TOKEN_URL = PAIR_TOKEN_PATH.replace(/^\\/+/, '')\n\n/** The outcome of one token read. */\nexport type PairTokenOutcome =\n /**\n * A live one-shot token and the instant it stops being accepted, plus the\n * address half when this machine can name its own public origin. `pairingUrl`\n * is the code a QR should carry: a `{token, url}` document the phone parses\n * into both halves of its configuration.\n */\n | { kind: 'ok'; token: string; expiresAt: number; origin: string | null; pairingUrl: string | null }\n /** 403: the page is not open on the machine itself, so the loopback gate refused it. */\n | { kind: 'forbidden' }\n /** The route answered with a status the panel does not know, or with a body that is not a token. */\n | { kind: 'failed'; status: number }\n /** The request never reached the host (offline, host stopped, connection reset). */\n | { kind: 'unreachable' }\n\n/** The minimal response surface the reader uses, so a test can inject its own. */\nexport interface PairTokenResponse {\n readonly ok: boolean\n readonly status: number\n json(): Promise<unknown>\n}\n\n/** The minimal fetch surface the reader uses, so a test can inject its own. */\nexport type PairTokenFetch = (url: string, init: { signal?: AbortSignal; cache: string }) => Promise<PairTokenResponse>\n\nexport interface ReadPairTokenOptions {\n /** Injected transport; defaults to the global fetch. */\n readonly fetchImpl?: PairTokenFetch\n /** Aborts an in-flight read (the panel closed, the entry unmounted). */\n readonly signal?: AbortSignal\n}\n\n/** Read a string field, treating a missing, mistyped or empty value as absent. */\nfunction stringOrNull(value: unknown): string | null {\n return typeof value === 'string' && value !== '' ? value : null\n}\n\n/**\n * Read one bootstrap token.\n *\n * Never throws: every failure is one of the outcome arms, because the panel has\n * to render each of them. A `200` whose body is not `{token, expiresAt}` is\n * reported as a failure rather than shown as an empty QR.\n * @param options - injected transport and abort signal.\n * @returns the read outcome.\n */\nexport async function readPairToken(options: ReadPairTokenOptions = {}): Promise<PairTokenOutcome> {\n const send = options.fetchImpl ?? (globalThis.fetch as unknown as PairTokenFetch | undefined)\n if (send === undefined) return { kind: 'unreachable' }\n let response: PairTokenResponse\n try {\n response = await send(PAIR_TOKEN_URL, {\n cache: 'no-store',\n ...(options.signal === undefined ? {} : { signal: options.signal }),\n })\n } catch {\n // A network failure and an aborted read are indistinguishable here, and\n // both mean \"no token arrived\" — the panel says so instead of guessing.\n return { kind: 'unreachable' }\n }\n if (response.status === 403) return { kind: 'forbidden' }\n if (!response.ok) return { kind: 'failed', status: response.status }\n let body: unknown\n try {\n body = await response.json()\n } catch {\n return { kind: 'failed', status: response.status }\n }\n if (typeof body !== 'object' || body === null) return { kind: 'failed', status: response.status }\n const token = (body as { token?: unknown }).token\n const expiresAt = (body as { expiresAt?: unknown }).expiresAt\n if (typeof token !== 'string' || token === '') return { kind: 'failed', status: response.status }\n if (typeof expiresAt !== 'number' || !Number.isFinite(expiresAt)) return { kind: 'failed', status: response.status }\n // Additive fields: a host that predates origin discovery answers without\n // them, and the panel then falls back to the bare-token code instead of\n // refusing to show anything.\n const origin = stringOrNull((body as { origin?: unknown }).origin)\n const candidate = stringOrNull((body as { pairingUrl?: unknown }).pairingUrl)\n const pairingUrl = candidate !== null && /^wss?:\\/\\/\\S+$/.test(candidate) ? candidate : null\n return { kind: 'ok', token, expiresAt, origin, pairingUrl }\n}\n","/**\n * `remote-bridge` namespace dictionaries: the protocol v1 pairing panel copy.\n *\n * The panel has one job — show the operator the one-shot bootstrap token as a\n * QR symbol plus its plaintext — so the copy is dominated by the two facts a\n * reader has to get right: where the phone's origin points (the public relay,\n * never this machine's loopback address) and why the token vanished (30 s, one\n * use, or a fresh mint).\n */\n\n/** Simplified Chinese dictionary (the key-set source of truth). */\nexport const zh = {\n 'entry.label': '配对手机(协议 v1)',\n 'title': '协议 v1 配对',\n 'subtitle': '用手机 App 扫描下方二维码,即可以协议 v1 配对这台宿主。配对码由本机签发,仅在本机可读。',\n 'state.reading': '正在取配对码…',\n 'pair.qrLabel': '配对二维码',\n 'pair.payloadLabel': '二维码内容(可复制后粘贴到手机)',\n 'pair.countdown': '剩余 {s} 秒',\n 'pair.expired': '配对码已过期(30 秒)',\n 'pair.expiredHint': '过期的配对码不会被手机接受,请重新取码。',\n 'pair.usedHint': '配对码一次性:手机调用 pair.begin 的瞬间即作废,重新取码也会作废上一张。',\n 'pair.refresh': '重新取码',\n 'origin.title': '没能自动定位公网地址,二维码只装裸配对码',\n 'origin.body': '这台机器既没有 DSH_REMOTE_PUBLIC_BASE_URL,也没有中继注册表记录,因此无法把地址写进二维码。请先在手机 App 里把连接地址设成你的公网中继(形如 wss://<id>.dsh-market.com),再扫上面的码;本页所在的 {host} 只有本机能连,手机连不上。',\n 'origin.located.title': '手机将直接连到公网中继(地址已写进二维码)',\n 'origin.located.body': '二维码里已经带上 {origin}:手机扫一次就同时设好连接地址与配对码,不需要手填任何东西。',\n 'forbidden.title': '这个页面不是从本机打开的',\n 'forbidden.body': '配对码只能在本机 Web UI 上取。请在本机浏览器打开 http://127.0.0.1:<端口> 后重试。',\n 'failed.title': '取配对码失败',\n 'failed.body': '宿主返回了 HTTP {status},请刷新页面后重试。',\n 'unreachable.title': '无法连接本机宿主',\n 'unreachable.body': '请求没有到达宿主,请确认 dsh web 仍在运行后重试。',\n 'action.close': '关闭',\n 'action.copy': '复制配对码',\n 'action.copied': '已复制',\n 'action.copyFailed': '复制失败',\n 'action.retry': '重试',\n} as const\n\n/** English dictionary, key-for-key with the zh source. */\nexport const en: Record<RemoteBridgeKey, string> = {\n 'entry.label': 'Pair a phone (protocol v1)',\n 'title': 'Protocol v1 pairing',\n 'subtitle': 'Scan the QR code with the phone app to pair it with this host over protocol v1. The code is minted by this machine and only readable here.',\n 'state.reading': 'Requesting a pairing code…',\n 'pair.qrLabel': 'Pairing QR code',\n 'pair.payloadLabel': 'What the QR encodes (copy it to paste on the phone)',\n 'pair.countdown': '{s} s left',\n 'pair.expired': 'The pairing code expired (30 s)',\n 'pair.expiredHint': 'An expired code is never accepted; request a new one.',\n 'pair.usedHint': 'The code is single-use: the phone spends it the moment it calls pair.begin, and requesting a new one voids the previous code.',\n 'pair.refresh': 'New code',\n 'origin.title': 'No public address could be located, so the QR carries the bare code',\n 'origin.body': 'This machine has neither DSH_REMOTE_PUBLIC_BASE_URL nor a relay registry row, so the address cannot go into the QR. Set the phone app to your public relay first (such as wss://<id>.dsh-market.com), then scan the code above; {host} (this page) is reachable only from this machine and never from the phone.',\n 'origin.located.title': 'The phone dials the public relay directly (address is in the QR)',\n 'origin.located.body': 'The QR carries {origin}: one scan sets both the connection address and the pairing code, with nothing to type.',\n 'forbidden.title': 'This page is not open on this machine',\n 'forbidden.body': 'Pairing codes can only be read from the machine itself. Open http://127.0.0.1:<port> in a browser on this machine and retry.',\n 'failed.title': 'Could not read a pairing code',\n 'failed.body': 'The host answered HTTP {status}. Reload the page and retry.',\n 'unreachable.title': 'Cannot reach the local host',\n 'unreachable.body': 'The request never reached the host. Check that dsh web is still running and retry.',\n 'action.close': 'Close',\n 'action.copy': 'Copy pairing code',\n 'action.copied': 'Copied',\n 'action.copyFailed': 'Copy failed',\n 'action.retry': 'Retry',\n}\n\n/** Every key the `remote-bridge` namespace carries. */\nexport type RemoteBridgeKey = keyof typeof zh\n","/**\n * Protocol v1 pairing panel — browser half. Registers the `remote-bridge`\n * dictionary and the sidebar-foot trigger (into the ui-sidebar-declared\n * `sidebar.footer.action` list slot) that opens the panel showing this\n * package's own one-shot bootstrap token as a QR symbol plus its plaintext.\n *\n * The panel is display-only for the native path: it reads the same loopback-only\n * `GET /remote-bridge/pair/token` route an operator would curl, and never spends\n * the token (`pair.begin` stays the phone's call). The browser half therefore\n * adds no wire surface — the envelope, the method names, the topic names and\n * the events are untouched — and it does not touch `dsh-remote-web-ui`'s pairing\n * service, its roster, or its browser cookie path.\n *\n * Export discipline (packages/AGENTS.md): the /client surface carries only what\n * cordis loading needs plus types.\n */\nimport type { Context as ClientContext } from '@deepseek-ai/cordis'\n// Type-only: pulls the locale plugin's Context merge (ctx.locale) and its\n// LocaleNamespaceMap merge table.\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\n// Type-only: pulls the ctx.slots merge (the renderer owns the slot registry).\nimport type {} from '@deepseek-ai/dsh-client-ui-renderer/client'\n// Type-only: pulls the ui-sidebar SlotMap merge (the 'sidebar.footer.action' hole).\nimport type {} from '@deepseek-ai/dsh-client-ui-sidebar/client'\nimport { writeClipboard } from '@deepseek-ai/dsh-client-ui-primitives'\nimport { PairEntry } from './PairEntry.tsx'\nimport { readPairToken } from './pair-token.ts'\nimport { en, zh, type RemoteBridgeKey } from './locales.ts'\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface LocaleNamespaceMap {\n /** Protocol v1 pairing panel copy. */\n 'remote-bridge': RemoteBridgeKey\n }\n}\n\n/** Dictionary namespace owned by this plugin. */\nconst NS = 'remote-bridge'\n\n/** Unique occupant id inside the shared footer.action list slot. */\nconst ENTRY_ID = 'remote-bridge'\n\n/** Services required by this plugin. */\nexport const inject = ['slots', 'locale']\n\n/**\n * Register the protocol v1 pairing surface.\n * @param ctx - client root context.\n */\nexport function apply(ctx: ClientContext): void {\n ctx.effect(() => {\n try {\n return ctx.locale.register(NS, { zh, en })\n } catch {\n return () => {}\n }\n }, 'remote-bridge: dictionaries')\n\n // Sidebar foot entry. The shell declares 'sidebar.footer.action' (list kind:\n // multiple occupants may share the seat) and registration is\n // declaration-aware via slots.inject. Read and clipboard arrive as an\n // injected face rather than a module import, which keeps the trigger's\n // rendered tree free of closure-factory bundles.\n ctx.slots.inject('sidebar.footer.action', () => {\n try {\n return ctx.slots.register({\n name: 'sidebar.footer.action',\n id: ENTRY_ID,\n locale: NS,\n inject: () => ({ read: readPairToken, copy: writeClipboard }),\n }, PairEntry)\n } catch {\n return () => {}\n }\n })\n}\n\nexport type { PairEntryProps } from './PairEntry.tsx'\nexport type { PairCopyState, PairPanelProps, PairPanelState } from './PairPanel.tsx'\nexport type { PairTokenFetch, PairTokenOutcome, PairTokenResponse, ReadPairTokenOptions } from './pair-token.ts'\nexport type { RemoteBridgeKey } from './locales.ts'\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA,IAAI,YAAY,OAAO;EACvB,IAAI,sBAAsB,OAAO;EACjC,IAAI,eAAe,OAAO,UAAU;EACpC,IAAI,eAAe,OAAO,UAAU;EACpC,IAAI,mBAAmB,KAAK,KAAK,UAAU,OAAO,MAAM,UAAU,KAAK,KAAK;GAAE,YAAY;GAAM,cAAc;GAAM,UAAU;GAAM;EAAM,CAAC,IAAI,IAAI,OAAO;EAC1J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