one 2.13.9 → 2.14.0

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 (66) hide show
  1. package/android/src/main/java/dev/onejs/one/OneKotlinHostView.kt +53 -14
  2. package/android/src/main/java/dev/onejs/one/OneNativeSourceKeyedState.kt +23 -0
  3. package/android/src/main/java/dev/onejs/one/OneNativeSourceViewDispatch.kt +16 -3
  4. package/dist/cjs/metro-config/getViteMetroPluginOptions.cjs +4 -10
  5. package/dist/cjs/metro-config/getViteMetroPluginOptions.native.cjs +4 -10
  6. package/dist/cjs/metro-config/getViteMetroPluginOptions.native.js +4 -10
  7. package/dist/cjs/metro-config/getViteMetroPluginOptions.native.js.map +1 -1
  8. package/dist/cjs/platform/native-source/view.native.cjs +4 -4
  9. package/dist/cjs/platform/native-source/view.native.js +4 -4
  10. package/dist/cjs/platform/native-source/view.native.js.map +1 -1
  11. package/dist/cjs/platform/native-source/wire.native.cjs +152 -49
  12. package/dist/cjs/platform/native-source/wire.native.js +152 -49
  13. package/dist/cjs/platform/native-source/wire.native.js.map +1 -1
  14. package/dist/cjs/platform/native-source/wireProps.native.cjs +138 -0
  15. package/dist/cjs/platform/native-source/wireProps.native.js +140 -0
  16. package/dist/cjs/platform/native-source/wireProps.native.js.map +1 -0
  17. package/dist/cjs/platform/swift/index.native.cjs +12 -8
  18. package/dist/cjs/platform/swift/index.native.js +12 -8
  19. package/dist/cjs/platform/swift/index.native.js.map +1 -1
  20. package/dist/cjs/router/useScreens.cjs +1 -1
  21. package/dist/cjs/router/useScreens.native.cjs +2 -1
  22. package/dist/cjs/router/useScreens.native.js +2 -1
  23. package/dist/cjs/router/useScreens.native.js.map +1 -1
  24. package/dist/esm/metro-config/getViteMetroPluginOptions.mjs +4 -10
  25. package/dist/esm/metro-config/getViteMetroPluginOptions.mjs.map +1 -1
  26. package/dist/esm/metro-config/getViteMetroPluginOptions.native.js +4 -10
  27. package/dist/esm/metro-config/getViteMetroPluginOptions.native.js.map +1 -1
  28. package/dist/esm/platform/native-source/view.native.js +5 -5
  29. package/dist/esm/platform/native-source/view.native.js.map +1 -1
  30. package/dist/esm/platform/native-source/wire.native.js +149 -49
  31. package/dist/esm/platform/native-source/wire.native.js.map +1 -1
  32. package/dist/esm/platform/native-source/wireProps.native.js +113 -0
  33. package/dist/esm/platform/native-source/wireProps.native.js.map +1 -0
  34. package/dist/esm/platform/swift/index.native.js +13 -9
  35. package/dist/esm/platform/swift/index.native.js.map +1 -1
  36. package/dist/esm/router/useScreens.mjs +1 -1
  37. package/dist/esm/router/useScreens.mjs.map +1 -1
  38. package/dist/esm/router/useScreens.native.js +2 -1
  39. package/dist/esm/router/useScreens.native.js.map +1 -1
  40. package/ios/Generated/OneNativeTabViewView.swift +2 -1
  41. package/ios/OneNativeComposition.swift +1 -0
  42. package/ios/OneNativeHostingController.swift +113 -0
  43. package/ios/OneSwiftHostComponentView.mm +28 -4
  44. package/ios/OneSwiftHostView.swift +63 -9
  45. package/ios/OneSwiftPackage.swift +6 -1
  46. package/package.json +13 -13
  47. package/src/metro-config/getViteMetroPluginOptions.integration.test.ts +33 -3
  48. package/src/metro-config/getViteMetroPluginOptions.ts +5 -11
  49. package/src/native/packedClosure.test.ts +59 -22
  50. package/src/platform/native-source/view.native.tsx +4 -5
  51. package/src/platform/native-source/wire.native.ts +108 -26
  52. package/src/platform/native-source/wireProps.native.test.ts +57 -0
  53. package/src/platform/native-source/wireProps.native.ts +124 -0
  54. package/src/platform/swift/index.native.tsx +9 -7
  55. package/src/platform/swift/types.ts +4 -2
  56. package/src/router/useScreens.tsx +1 -1
  57. package/types/metro-config/getViteMetroPluginOptions.d.ts +1 -1
  58. package/types/metro-config/getViteMetroPluginOptions.d.ts.map +1 -1
  59. package/types/platform/native-source/view.native.d.ts.map +1 -1
  60. package/types/platform/native-source/wire.native.d.ts +3 -0
  61. package/types/platform/native-source/wire.native.d.ts.map +1 -1
  62. package/types/platform/native-source/wireProps.native.d.ts +15 -0
  63. package/types/platform/native-source/wireProps.native.d.ts.map +1 -0
  64. package/types/platform/swift/index.native.d.ts.map +1 -1
  65. package/types/platform/swift/types.d.ts +4 -1
  66. package/types/platform/swift/types.d.ts.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"wire.native.js","names":[],"sources":["esm/platform/native-source/wire.native.js"],"sourcesContent":["var BASE64 = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\nfunction base64Encode(bytes) {\n var out = \"\";\n for (var i = 0; i < bytes.length; i += 3) {\n var first = bytes[i];\n var second = i + 1 < bytes.length ? bytes[i + 1] : 0;\n var third = i + 2 < bytes.length ? bytes[i + 2] : 0;\n var triple = first << 16 | second << 8 | third;\n out += BASE64[triple >> 18 & 63] + BASE64[triple >> 12 & 63];\n out += i + 1 < bytes.length ? BASE64[triple >> 6 & 63] : \"=\";\n out += i + 2 < bytes.length ? BASE64[triple & 63] : \"=\";\n }\n return out;\n}\nfunction base64Decode(text) {\n if (!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(text)) {\n throw new TypeError(`expected base64 data`);\n }\n var clean = text.replace(/=+$/, \"\");\n var out = new Uint8Array(Math.floor(clean.length * 3 / 4));\n var at = 0;\n for (var i = 0; i < clean.length; i += 4) {\n var a = BASE64.indexOf(clean[i]);\n var b = BASE64.indexOf(clean[i + 1]);\n var c = i + 2 < clean.length ? BASE64.indexOf(clean[i + 2]) : 0;\n var d = i + 3 < clean.length ? BASE64.indexOf(clean[i + 3]) : 0;\n var triple = a << 18 | b << 12 | c << 6 | d;\n out[at++] = triple >> 16 & 255;\n if (i + 2 < clean.length) out[at++] = triple >> 8 & 255;\n if (i + 3 < clean.length) out[at++] = triple & 255;\n }\n return out.slice(0, at);\n}\nfunction isRecord(value) {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction encodeValue(value, wire, structs, path) {\n switch (wire.kind) {\n case \"date\":\n if (!(value instanceof Date)) throw new TypeError(`${path}: expected Date`);\n return value;\n case \"data\":\n if (!(value instanceof Uint8Array)) throw new TypeError(`${path}: expected Uint8Array`);\n return base64Encode(value);\n case \"enum\":\n if (typeof value !== \"string\" && typeof value !== \"number\") {\n throw new TypeError(`${path}: expected an enum value`);\n }\n return value;\n case \"struct\": {\n if (!isRecord(value)) throw new TypeError(`${path}: expected ${wire.name}`);\n var table = structs[wire.name];\n if (!table) throw new TypeError(`${path}: unknown struct ${wire.name}`);\n var out = {};\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n var _loop = function() {\n var key2 = _step.value;\n if (!table.fields.some(function(field2) {\n return field2.name === key2;\n })) out[key2] = value[key2];\n };\n for (var _iterator = Object.keys(value)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) _loop();\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n try {\n for (var _iterator1 = table.fields[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n var field = _step1.value;\n var present = value[field.name] !== void 0;\n if (!present) {\n if (!field.optional) throw new TypeError(`${path}.${field.name}: required`);\n continue;\n }\n out[field.name] = field.wire === void 0 ? value[field.name] : encodeValue(value[field.name], field.wire, structs, `${path}.${field.name}`);\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally {\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n return out;\n }\n case \"array\":\n if (!Array.isArray(value)) throw new TypeError(`${path}: expected an array`);\n return value.map(function(item, index) {\n return encodeValue(item, wire.element, structs, `${path}[${index}]`);\n });\n case \"map\": {\n if (!isRecord(value)) throw new TypeError(`${path}: expected an object`);\n var out1 = {};\n var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;\n try {\n for (var _iterator2 = Object.keys(value)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var key = _step2.value;\n out1[key] = encodeValue(value[key], wire.value, structs, `${path}.${key}`);\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n return out1;\n }\n case \"nullable\":\n return value === null || value === void 0 ? null : encodeValue(value, wire.inner, structs, path);\n }\n}\nfunction decodeValue(value, wire, structs, path) {\n switch (wire.kind) {\n case \"date\": {\n if (typeof value !== \"string\") throw new TypeError(`${path}: expected an ISO date string`);\n var date = new Date(value);\n if (Number.isNaN(date.getTime())) throw new TypeError(`${path}: expected an ISO date string`);\n return date;\n }\n case \"data\": {\n if (typeof value !== \"string\") throw new TypeError(`${path}: expected base64 data`);\n try {\n return base64Decode(value);\n } catch (unused) {\n throw new TypeError(`${path}: expected base64 data`);\n }\n }\n case \"enum\":\n if (typeof value !== \"string\" && typeof value !== \"number\") {\n throw new TypeError(`${path}: expected an enum value`);\n }\n return value;\n case \"struct\": {\n if (!isRecord(value)) throw new TypeError(`${path}: expected ${wire.name}`);\n var table = structs[wire.name];\n if (!table) throw new TypeError(`${path}: unknown struct ${wire.name}`);\n var out = {};\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n var _loop = function() {\n var key2 = _step.value;\n if (!table.fields.some(function(field2) {\n return field2.name === key2;\n })) out[key2] = value[key2];\n };\n for (var _iterator = Object.keys(value)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) _loop();\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n try {\n for (var _iterator1 = table.fields[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n var field = _step1.value;\n var present = value[field.name] !== void 0 && value[field.name] !== null;\n if (!present) {\n var _field_wire;\n if (value[field.name] === null && ((_field_wire = field.wire) === null || _field_wire === void 0 ? void 0 : _field_wire.kind) === \"nullable\") {\n out[field.name] = null;\n continue;\n }\n if (!field.optional) throw new TypeError(`${path}.${field.name}: required`);\n continue;\n }\n out[field.name] = field.wire === void 0 ? value[field.name] : decodeValue(value[field.name], field.wire, structs, `${path}.${field.name}`);\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally {\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n return out;\n }\n case \"array\":\n if (!Array.isArray(value)) throw new TypeError(`${path}: expected an array`);\n return value.map(function(item, index) {\n return decodeValue(item, wire.element, structs, `${path}[${index}]`);\n });\n case \"map\": {\n if (!isRecord(value)) throw new TypeError(`${path}: expected an object`);\n var out1 = {};\n var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;\n try {\n for (var _iterator2 = Object.keys(value)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var key = _step2.value;\n out1[key] = decodeValue(value[key], wire.value, structs, `${path}.${key}`);\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n return out1;\n }\n case \"nullable\":\n return value === null || value === void 0 ? null : decodeValue(value, wire.inner, structs, path);\n }\n}\nfunction encodeNativeSourceArgs(args, wires, structs) {\n return args.map(function(arg, index) {\n var wire = wires[index];\n return wire === void 0 || wire === null ? arg : encodeValue(arg, wire, structs, `args[${index}]`);\n });\n}\nfunction decodeNativeSourceResult(value, wire, structs) {\n return wire === void 0 || wire === null ? value : decodeValue(value, wire, structs, \"result\");\n}\nfunction encodeNativeSourceProps(props, wires, structs) {\n var out = {\n ...props\n };\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = Object.keys(wires)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var name = _step.value;\n if (out[name] === void 0) continue;\n out[name] = encodeValue(out[name], wires[name], structs, `props.${name}`);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return out;\n}\nfunction decodeNativeSourceCallback(args, wires, structs, event) {\n return args.map(function(arg, index) {\n var wire = wires[index];\n return wire === void 0 || wire === null ? arg : decodeValue(arg, wire, structs, `${event}[${index}]`);\n });\n}\nexport {\n base64Decode,\n base64Encode,\n decodeNativeSourceCallback,\n decodeNativeSourceResult,\n encodeNativeSourceArgs,\n encodeNativeSourceProps\n};\n//# sourceMappingURL=wire.native.js.map\n"],"mappings":";AAAA,IAAI,SAAS;AACb,SAAS,aAAa,OAAO;CAC3B,IAAI,MAAM;CACV,KAAK,IAAI,IAAI,GAAG,IAAI,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AAI,OAAO,MAAM;EACjB,OAAO,SAAS,KAAK,KAAK,SAAS,OAAO,MAAM,YAAY,KAAK,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,EAAE;CACtG,CAAC;AACH"}
1
+ {"version":3,"file":"wire.native.js","names":[],"sources":["esm/platform/native-source/wire.native.js"],"sourcesContent":["var BASE64 = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\nfunction base64Encode(bytes) {\n var out = \"\";\n for (var i = 0; i < bytes.length; i += 3) {\n var first = bytes[i];\n var second = i + 1 < bytes.length ? bytes[i + 1] : 0;\n var third = i + 2 < bytes.length ? bytes[i + 2] : 0;\n var triple = first << 16 | second << 8 | third;\n out += BASE64[triple >> 18 & 63] + BASE64[triple >> 12 & 63];\n out += i + 1 < bytes.length ? BASE64[triple >> 6 & 63] : \"=\";\n out += i + 2 < bytes.length ? BASE64[triple & 63] : \"=\";\n }\n return out;\n}\nfunction base64Decode(text) {\n if (!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(text)) {\n throw new TypeError(`expected base64 data`);\n }\n var clean = text.replace(/=+$/, \"\");\n var out = new Uint8Array(Math.floor(clean.length * 3 / 4));\n var at = 0;\n for (var i = 0; i < clean.length; i += 4) {\n var a = BASE64.indexOf(clean[i]);\n var b = BASE64.indexOf(clean[i + 1]);\n var c = i + 2 < clean.length ? BASE64.indexOf(clean[i + 2]) : 0;\n var d = i + 3 < clean.length ? BASE64.indexOf(clean[i + 3]) : 0;\n var triple = a << 18 | b << 12 | c << 6 | d;\n out[at++] = triple >> 16 & 255;\n if (i + 2 < clean.length) out[at++] = triple >> 8 & 255;\n if (i + 3 < clean.length) out[at++] = triple & 255;\n }\n return out.slice(0, at);\n}\nfunction isRecord(value) {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nvar trail = [];\nfunction trailText() {\n var text = String(trail[0]);\n for (var i = 1; i < trail.length; i++) {\n text += typeof trail[i] === \"number\" ? `[${trail[i]}]` : `.${trail[i]}`;\n }\n return text;\n}\nvar plainStructs = /* @__PURE__ */ new WeakMap();\nfunction encodeValue(value, wire, structs) {\n switch (wire.kind) {\n case \"date\":\n if (!(value instanceof Date)) throw new TypeError(`${trailText()}: expected Date`);\n return value;\n case \"data\":\n if (!(value instanceof Uint8Array)) throw new TypeError(`${trailText()}: expected Uint8Array`);\n return base64Encode(value);\n case \"enum\":\n if (typeof value !== \"string\" && typeof value !== \"number\") {\n throw new TypeError(`${trailText()}: expected an enum value`);\n }\n return value;\n case \"struct\": {\n if (!isRecord(value)) throw new TypeError(`${trailText()}: expected ${wire.name}`);\n var table = structs[wire.name];\n if (!table) throw new TypeError(`${trailText()}: unknown struct ${wire.name}`);\n var plain = plainStructs.get(table);\n if (plain === void 0) {\n plain = table.fields.every(function(field2) {\n return field2.wire === void 0;\n });\n plainStructs.set(table, plain);\n }\n if (plain) {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = table.fields[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var field = _step.value;\n if (value[field.name] === void 0 && !field.optional) {\n trail.push(field.name);\n throw new TypeError(`${trailText()}: required`);\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return value;\n }\n var out = {};\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n try {\n var _loop = function() {\n var key2 = _step1.value;\n if (!table.fields.some(function(field2) {\n return field2.name === key2;\n })) out[key2] = value[key2];\n };\n for (var _iterator1 = Object.keys(value)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) _loop();\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally {\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;\n try {\n for (var _iterator2 = table.fields[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var field1 = _step2.value;\n var present = value[field1.name] !== void 0;\n if (!present) {\n if (!field1.optional) {\n trail.push(field1.name);\n throw new TypeError(`${trailText()}: required`);\n }\n continue;\n }\n if (field1.wire === void 0) {\n out[field1.name] = value[field1.name];\n continue;\n }\n trail.push(field1.name);\n out[field1.name] = encodeValue(value[field1.name], field1.wire, structs);\n trail.pop();\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n return out;\n }\n case \"array\": {\n if (!Array.isArray(value)) throw new TypeError(`${trailText()}: expected an array`);\n var out1 = new Array(value.length);\n trail.push(0);\n var at = trail.length - 1;\n for (var index = 0; index < value.length; index++) {\n trail[at] = index;\n out1[index] = encodeValue(value[index], wire.element, structs);\n }\n trail.pop();\n return out1;\n }\n case \"map\": {\n if (!isRecord(value)) throw new TypeError(`${trailText()}: expected an object`);\n var out2 = {};\n var _iteratorNormalCompletion3 = true, _didIteratorError3 = false, _iteratorError3 = void 0;\n try {\n for (var _iterator3 = Object.keys(value)[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n var key = _step3.value;\n trail.push(key);\n out2[key] = encodeValue(value[key], wire.value, structs);\n trail.pop();\n }\n } catch (err) {\n _didIteratorError3 = true;\n _iteratorError3 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion3 && _iterator3.return != null) {\n _iterator3.return();\n }\n } finally {\n if (_didIteratorError3) {\n throw _iteratorError3;\n }\n }\n }\n return out2;\n }\n case \"nullable\":\n return value === null || value === void 0 ? null : encodeValue(value, wire.inner, structs);\n }\n}\nfunction decodeValue(value, wire, structs, path) {\n switch (wire.kind) {\n case \"date\": {\n if (typeof value !== \"string\") throw new TypeError(`${path}: expected an ISO date string`);\n var date = new Date(value);\n if (Number.isNaN(date.getTime())) throw new TypeError(`${path}: expected an ISO date string`);\n return date;\n }\n case \"data\": {\n if (typeof value !== \"string\") throw new TypeError(`${path}: expected base64 data`);\n try {\n return base64Decode(value);\n } catch (unused) {\n throw new TypeError(`${path}: expected base64 data`);\n }\n }\n case \"enum\":\n if (typeof value !== \"string\" && typeof value !== \"number\") {\n throw new TypeError(`${path}: expected an enum value`);\n }\n return value;\n case \"struct\": {\n if (!isRecord(value)) throw new TypeError(`${path}: expected ${wire.name}`);\n var table = structs[wire.name];\n if (!table) throw new TypeError(`${path}: unknown struct ${wire.name}`);\n var out = {};\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n var _loop = function() {\n var key2 = _step.value;\n if (!table.fields.some(function(field2) {\n return field2.name === key2;\n })) out[key2] = value[key2];\n };\n for (var _iterator = Object.keys(value)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) _loop();\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n try {\n for (var _iterator1 = table.fields[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n var field = _step1.value;\n var present = value[field.name] !== void 0 && value[field.name] !== null;\n if (!present) {\n var _field_wire;\n if (value[field.name] === null && ((_field_wire = field.wire) === null || _field_wire === void 0 ? void 0 : _field_wire.kind) === \"nullable\") {\n out[field.name] = null;\n continue;\n }\n if (!field.optional) throw new TypeError(`${path}.${field.name}: required`);\n continue;\n }\n out[field.name] = field.wire === void 0 ? value[field.name] : decodeValue(value[field.name], field.wire, structs, `${path}.${field.name}`);\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally {\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n return out;\n }\n case \"array\":\n if (!Array.isArray(value)) throw new TypeError(`${path}: expected an array`);\n return value.map(function(item, index) {\n return decodeValue(item, wire.element, structs, `${path}[${index}]`);\n });\n case \"map\": {\n if (!isRecord(value)) throw new TypeError(`${path}: expected an object`);\n var out1 = {};\n var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;\n try {\n for (var _iterator2 = Object.keys(value)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var key = _step2.value;\n out1[key] = decodeValue(value[key], wire.value, structs, `${path}.${key}`);\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n return out1;\n }\n case \"nullable\":\n return value === null || value === void 0 ? null : decodeValue(value, wire.inner, structs, path);\n }\n}\nfunction encodeAt(path, value, wire, structs) {\n trail.length = 0;\n trail.push(...path);\n return encodeValue(value, wire, structs);\n}\nfunction encodeNativeSourceArgs(args, wires, structs) {\n return args.map(function(arg, index) {\n var wire = wires[index];\n return wire === void 0 || wire === null ? arg : encodeAt([\n \"args\",\n index\n ], arg, wire, structs);\n });\n}\nfunction decodeNativeSourceResult(value, wire, structs) {\n return wire === void 0 || wire === null ? value : decodeValue(value, wire, structs, \"result\");\n}\nfunction encodeNativeSourceProps(props, wires, structs) {\n var out = {\n ...props\n };\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = Object.keys(wires)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var name = _step.value;\n if (out[name] === void 0) continue;\n out[name] = encodeAt([\n \"props\",\n name\n ], out[name], wires[name], structs);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return out;\n}\nfunction encodeNativeSourceProp(name, value, wires) {\n var wire = wires === null || wires === void 0 ? void 0 : wires.props[name];\n return wire === void 0 ? value : encodeAt([\n \"props\",\n name\n ], value, wire, wires.structs);\n}\nfunction encodeNativeSourceListItem(name, index, item, element, structs) {\n return encodeAt([\n \"props\",\n name,\n index\n ], item, element, structs);\n}\nfunction stringifyNativeSourceProps(props, wires) {\n var out = wires ? encodeNativeSourceProps(props, wires.props, wires.structs) : {\n ...props\n };\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = Object.keys(out)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var key = _step.value;\n if (typeof out[key] === \"function\") out[key] = true;\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return JSON.stringify(out);\n}\nfunction decodeNativeSourceCallback(args, wires, structs, event) {\n return args.map(function(arg, index) {\n var wire = wires[index];\n return wire === void 0 || wire === null ? arg : decodeValue(arg, wire, structs, `${event}[${index}]`);\n });\n}\nexport {\n base64Decode,\n base64Encode,\n decodeNativeSourceCallback,\n decodeNativeSourceResult,\n encodeNativeSourceArgs,\n encodeNativeSourceListItem,\n encodeNativeSourceProp,\n encodeNativeSourceProps,\n stringifyNativeSourceProps\n};\n//# sourceMappingURL=wire.native.js.map\n"],"mappings":";AAAA,IAAI,SAAS;AACb,SAAS,aAAa,OAAO;CAC3B,IAAI,MAAM;CACV,KAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK,GAAG;EACxC,IAAI,QAAQ,MAAM;EAClB,IAAI,SAAS,IAAI,IAAI,MAAM,SAAS,MAAM,IAAI,KAAK;EACnD,IAAI,QAAQ,IAAI,IAAI,MAAM,SAAS,MAAM,IAAI,KAAK;EAClD,IAAI,SAAS,SAAS,KAAK,UAAU,IAAI;EACzC,OAAO,OAAO,UAAU,KAAK,MAAM,OAAO,UAAU,KAAK;EACzD,OAAO,IAAI,IAAI,MAAM,SAAS,OAAO,UAAU,IAAI,MAAM;EACzD,OAAO,IAAI,IAAI,MAAM,SAAS,OAAO,SAAS,MAAM;CACtD;CACA,OAAO;AACT;AACA,SAAS,aAAa,MAAM;CAC1B,IAAI,CAAC,mEAAmE,KAAK,IAAI,GAAG;EAClF,MAAM,IAAI,UAAU,sBAAsB;CAC5C;CACA,IAAI,QAAQ,KAAK,QAAQ,OAAO,EAAE;CAClC,IAAI,MAAM,IAAI,WAAW,KAAK,MAAM,MAAM,SAAS,IAAI,CAAC,CAAC;CACzD,IAAI,KAAK;CACT,KAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK,GAAG;EACxC,IAAI,IAAI,OAAO,QAAQ,MAAM,EAAE;EAC/B,IAAI,IAAI,OAAO,QAAQ,MAAM,IAAI,EAAE;EACnC,IAAI,IAAI,IAAI,IAAI,MAAM,SAAS,OA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,OAAO,IAAI,SAAS,YAAY,IAAI,OAAO;EACjD;CACF,SAAS,KAAK;EACZ,oBAAoB;EACpB,iBAAiB;CACnB,UAAU;EACR,IAAI;GACF,IAAI,CAAC,6BAA6B,UAAU,UAAU,MAAM;IAC1D,UAAU,OAAO;GACnB;EACF,UAAU;GACR,IAAI,mBAAmB;IACrB,MAAM;GACR;EACF;CACF;CACA,OAAO,KAAK,UAAU,GAAG;AAC3B;AACA,SAAS,2BAA2B,MAAM,OAAO,SAAS,OAAO;CAC/D,OAAO,KAAK,IAAI,SAAS,KAAK,OAAO;EACnC,IAAI,OAAO,MAAM;EACjB,OAAO,SAAS,KAAK,KAAK,SAAS,OAAO,MAAM,YAAY,KAAK,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,EAAE;CACtG,CAAC;AACH"}
@@ -0,0 +1,113 @@
1
+ import { useLayoutEffect, useRef, useState } from "react";
2
+ import { encodeNativeSourceListItem, encodeNativeSourceProp, stringifyNativeSourceProps } from "./wire.native.js";
3
+
4
+ var MIN_LIST = 32;
5
+ var RESYNC_EVENT = "$resync";
6
+ function listElement(wire) {
7
+ if (wire === void 0) return void 0;
8
+ if (wire.kind === "array") return wire.element;
9
+ if (wire.kind === "nullable") return listElement(wire.inner);
10
+ return null;
11
+ }
12
+ function nextDocument(props, wires, prev, full) {
13
+ var _ref;
14
+ var whole = full || prev === null;
15
+ var seq = ((_ref = prev === null || prev === void 0 ? void 0 : prev.seq) !== null && _ref !== void 0 ? _ref : 0) + 1;
16
+ var lists = {};
17
+ var texts = {};
18
+ var entries = [];
19
+ var patches = {};
20
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
21
+ try {
22
+ var _loop = function() {
23
+ var name2 = _step.value;
24
+ var value = props[name2];
25
+ if (value === void 0) return "continue";
26
+ var element = listElement(wires === null || wires === void 0 ? void 0 : wires.props[name2]);
27
+ if (Array.isArray(value) && value.length >= MIN_LIST && element !== null) {
28
+ lists[name2] = value;
29
+ var before = prev === null || prev === void 0 ? void 0 : prev.lists[name2];
30
+ if (!whole && before) {
31
+ var indices = [];
32
+ for (var i = 0; i < value.length; i++) {
33
+ if (i >= before.length || before[i] !== value[i]) indices.push(i);
34
+ }
35
+ if (indices.length === 0 && before.length === value.length) return "continue";
36
+ if (indices.length * 2 < value.length) {
37
+ patches[name2] = {
38
+ length: value.length,
39
+ set: indices.map(function(i2) {
40
+ return [i2, element === void 0 ? value[i2] : encodeNativeSourceListItem(name2, i2, value[i2], element, wires.structs)];
41
+ })
42
+ };
43
+ return "continue";
44
+ }
45
+ }
46
+ entries.push(`${JSON.stringify(name2)}:${JSON.stringify(encodeNativeSourceProp(name2, value, wires))}`);
47
+ return "continue";
48
+ }
49
+ var text = typeof value === "function" ? "true" : JSON.stringify(encodeNativeSourceProp(name2, value, wires));
50
+ texts[name2] = text;
51
+ if (!whole && prev.texts[name2] === text) return "continue";
52
+ entries.push(`${JSON.stringify(name2)}:${text}`);
53
+ };
54
+ for (var _iterator = Object.keys(props)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) _loop();
55
+ } catch (err) {
56
+ _didIteratorError = true;
57
+ _iteratorError = err;
58
+ } finally {
59
+ try {
60
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
61
+ _iterator.return();
62
+ }
63
+ } finally {
64
+ if (_didIteratorError) {
65
+ throw _iteratorError;
66
+ }
67
+ }
68
+ }
69
+ if (!whole) {
70
+ for (var _i = 0, _iter = [...Object.keys(prev.texts), ...Object.keys(prev.lists)]; _i < _iter.length; _i++) {
71
+ var name = _iter[_i];
72
+ if (!(name in texts) && !(name in lists)) entries.push(`${JSON.stringify(name)}:null`);
73
+ }
74
+ if (entries.length === 0 && Object.keys(patches).length === 0) return null;
75
+ if (Object.keys(patches).length > 0) entries.push(`"$lists":${JSON.stringify(patches)}`);
76
+ }
77
+ var head = whole ? `"$seq":${seq}` : `"$seq":${seq},"$base":${prev.seq}`;
78
+ return {
79
+ seq,
80
+ text: `{${[head, ...entries].join(",")}}`,
81
+ lists,
82
+ texts
83
+ };
84
+ }
85
+ function useNativeSourceProps(props, wires, keyed) {
86
+ var sent = useRef(null);
87
+ var needFull = useRef(false);
88
+ var [, rerender] = useState(0);
89
+ var next = keyed ? nextDocument(props, wires, sent.current, needFull.current) : null;
90
+ useLayoutEffect(function() {
91
+ if (next) {
92
+ sent.current = next;
93
+ needFull.current = false;
94
+ }
95
+ });
96
+ var resync = function resync2() {
97
+ needFull.current = true;
98
+ rerender(function(n) {
99
+ return n + 1;
100
+ });
101
+ };
102
+ if (!keyed) return {
103
+ text: stringifyNativeSourceProps(props, wires),
104
+ resync
105
+ };
106
+ return {
107
+ text: (next !== null && next !== void 0 ? next : sent.current).text,
108
+ resync
109
+ };
110
+ }
111
+
112
+ export { RESYNC_EVENT, nextDocument, useNativeSourceProps };
113
+ //# sourceMappingURL=wireProps.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wireProps.native.js","names":[],"sources":["esm/platform/native-source/wireProps.native.js"],"sourcesContent":["import { useLayoutEffect, useRef, useState } from \"react\";\nimport { encodeNativeSourceListItem, encodeNativeSourceProp, stringifyNativeSourceProps } from \"./wire.native\";\nvar MIN_LIST = 32;\nvar RESYNC_EVENT = \"$resync\";\nfunction listElement(wire) {\n if (wire === void 0) return void 0;\n if (wire.kind === \"array\") return wire.element;\n if (wire.kind === \"nullable\") return listElement(wire.inner);\n return null;\n}\nfunction nextDocument(props, wires, prev, full) {\n var _ref;\n var whole = full || prev === null;\n var seq = ((_ref = prev === null || prev === void 0 ? void 0 : prev.seq) !== null && _ref !== void 0 ? _ref : 0) + 1;\n var lists = {};\n var texts = {};\n var entries = [];\n var patches = {};\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n var _loop = function() {\n var name2 = _step.value;\n var value = props[name2];\n if (value === void 0) return \"continue\";\n var element = listElement(wires === null || wires === void 0 ? void 0 : wires.props[name2]);\n if (Array.isArray(value) && value.length >= MIN_LIST && element !== null) {\n lists[name2] = value;\n var before = prev === null || prev === void 0 ? void 0 : prev.lists[name2];\n if (!whole && before) {\n var indices = [];\n for (var i = 0; i < value.length; i++) {\n if (i >= before.length || before[i] !== value[i]) indices.push(i);\n }\n if (indices.length === 0 && before.length === value.length) return \"continue\";\n if (indices.length * 2 < value.length) {\n patches[name2] = {\n length: value.length,\n set: indices.map(function(i2) {\n return [\n i2,\n element === void 0 ? value[i2] : encodeNativeSourceListItem(name2, i2, value[i2], element, wires.structs)\n ];\n })\n };\n return \"continue\";\n }\n }\n entries.push(`${JSON.stringify(name2)}:${JSON.stringify(encodeNativeSourceProp(name2, value, wires))}`);\n return \"continue\";\n }\n var text = typeof value === \"function\" ? \"true\" : JSON.stringify(encodeNativeSourceProp(name2, value, wires));\n texts[name2] = text;\n if (!whole && prev.texts[name2] === text) return \"continue\";\n entries.push(`${JSON.stringify(name2)}:${text}`);\n };\n for (var _iterator = Object.keys(props)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) _loop();\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n if (!whole) {\n for (var _i = 0, _iter = [\n ...Object.keys(prev.texts),\n ...Object.keys(prev.lists)\n ]; _i < _iter.length; _i++) {\n var name = _iter[_i];\n if (!(name in texts) && !(name in lists)) entries.push(`${JSON.stringify(name)}:null`);\n }\n if (entries.length === 0 && Object.keys(patches).length === 0) return null;\n if (Object.keys(patches).length > 0) entries.push(`\"$lists\":${JSON.stringify(patches)}`);\n }\n var head = whole ? `\"$seq\":${seq}` : `\"$seq\":${seq},\"$base\":${prev.seq}`;\n return {\n seq,\n text: `{${[\n head,\n ...entries\n ].join(\",\")}}`,\n lists,\n texts\n };\n}\nfunction useNativeSourceProps(props, wires, keyed) {\n var sent = useRef(null);\n var needFull = useRef(false);\n var [, rerender] = useState(0);\n var next = keyed ? nextDocument(props, wires, sent.current, needFull.current) : null;\n useLayoutEffect(function() {\n if (next) {\n sent.current = next;\n needFull.current = false;\n }\n });\n var resync = function resync2() {\n needFull.current = true;\n rerender(function(n) {\n return n + 1;\n });\n };\n if (!keyed) return {\n text: stringifyNativeSourceProps(props, wires),\n resync\n };\n return {\n text: (next !== null && next !== void 0 ? next : sent.current).text,\n resync\n };\n}\nexport {\n RESYNC_EVENT,\n nextDocument,\n useNativeSourceProps\n};\n//# sourceMappingURL=wireProps.native.js.map\n"],"mappings":";;;;AAEA,IAAI,WAAW;AACf,IAAI,eAAe;AACnB,SAAS,YAAY,MAAM;CACzB,IAAI,SAAS,KAAK,GAAG,OAAO,KAAK;CACjC,IAAI,KAAK,SAAS,SAAS,OAAO,KAAK;CACvC,IAAI,KAAK,SAAS,YAAY,OAAO,YAAY,KAAK,KAAK;CAC3D,OAAO;AACT;AACA,SAAS,aAAa,OAAO,OAAO,MAAM,MAAM;CAC9C,IAAI;CACJ,IAAI,QAAQ,QAAQ,SAAS;CAC7B,IAAI,QAAQ,OAAO,SAAS,QAAQ,SAAS,KAAK,IAAI,KAAK,IAAI,KAAK,SAAS,QAAQ,SAAS,KAAK,IAAI,OAAO,KAAK;CACnH,IAAI,QAAQ,CAAC;CACb,IAAI,QAAQ,CAAC;CACb,IAAI,UAAU,CAAC;CACf,IAAI,UAAU,CAAC;CACf,IAAI,4BAA4B,MAAM,oBAAoB,OAAO,iBAAiB,KAAK;CACvF,IAAI;EACF,IAAI,QAAQ,WAAW;GACrB,IAAI,QAAQ,MAAM;GAClB,IAAI,QAAQ,MAAM;GAClB,IAAI,UAAU,KAAK,GAAG,OAAO;GAC7B,IAAI,UAAU,YAAY,UAAU,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM,MAAM,MAAM;GAC1F,IAAI,MAAM,QAAQ,KAAK,KAAK,MAAM,UAAU,Y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AAO,SAAS,QAAQ,SAAS,KAAK,IAAI,OAAO,KAAK,QAAO,CAAE;EAC/D;CACF;AACF"}
@@ -1,28 +1,32 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
+ import { StyleSheet } from "react-native";
2
3
  import NativeSwiftHost from "../specs/OneSwiftHostNativeComponent.native.js";
3
- import { decodeNativeSourceCallback, encodeNativeSourceProps } from "../native-source/wire.native.js";
4
+ import { decodeNativeSourceCallback } from "../native-source/wire.native.js";
5
+ import { RESYNC_EVENT, useNativeSourceProps } from "../native-source/wireProps.native.js";
4
6
 
5
7
  function SwiftPackageView(param) {
6
8
  var { packageName, view, contractHash, props, fill, wires } = param;
7
- var encoded = wires ? encodeNativeSourceProps(props, wires.props, wires.structs) : props;
9
+ var _ref, _ref1;
10
+ var keyed = useNativeSourceProps(props, wires, view !== "");
11
+ var style = StyleSheet.flatten(props.style);
12
+ var fills = fill || ((_ref = style === null || style === void 0 ? void 0 : style.flex) !== null && _ref !== void 0 ? _ref : 0) > 0 || ((_ref1 = style === null || style === void 0 ? void 0 : style.flexGrow) !== null && _ref1 !== void 0 ? _ref1 : 0) > 0;
8
13
  return /* @__PURE__ */ jsx(NativeSwiftHost, {
9
14
  packageName,
10
15
  view,
11
16
  contractHash,
12
- props: JSON.stringify(encoded, function(_key, value) {
13
- return typeof value === "function" ? true : value;
14
- }),
15
- fill,
17
+ props: keyed.text,
18
+ fill: fills,
16
19
  onHostEvent: function onHostEvent(event) {
20
+ if (event.nativeEvent.name === RESYNC_EVENT) return keyed.resync();
17
21
  var callback = props[event.nativeEvent.name];
18
22
  if (typeof callback === "function") {
19
- var _ref;
23
+ var _ref2;
20
24
  var args = JSON.parse(event.nativeEvent.args);
21
25
  var argWires = wires === null || wires === void 0 ? void 0 : wires.callbacks[event.nativeEvent.name];
22
- callback(...argWires ? decodeNativeSourceCallback(args, argWires, (_ref = wires === null || wires === void 0 ? void 0 : wires.structs) !== null && _ref !== void 0 ? _ref : {}, event.nativeEvent.name) : args);
26
+ callback(...argWires ? decodeNativeSourceCallback(args, argWires, (_ref2 = wires === null || wires === void 0 ? void 0 : wires.structs) !== null && _ref2 !== void 0 ? _ref2 : {}, event.nativeEvent.name) : args);
23
27
  }
24
28
  },
25
- style: fill ? { flex: 1 } : void 0
29
+ style: fill ? { flex: 1 } : style
26
30
  });
27
31
  }
28
32
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.js","names":[],"sources":["esm/platform/swift/index.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport NativeSwiftHost from \"../specs/OneSwiftHostNativeComponent\";\nimport { decodeNativeSourceCallback, encodeNativeSourceProps } from \"../native-source/wire.native\";\nfunction SwiftPackageView(param) {\n var { packageName, view, contractHash, props, fill, wires } = param;\n var encoded = wires ? encodeNativeSourceProps(props, wires.props, wires.structs) : props;\n return /* @__PURE__ */ _jsx(NativeSwiftHost, {\n packageName,\n view,\n contractHash,\n // a typed view's host learns which callbacks the element passed\n props: JSON.stringify(encoded, function(_key, value) {\n return typeof value === \"function\" ? true : value;\n }),\n fill,\n onHostEvent: function onHostEvent(event) {\n var callback = props[event.nativeEvent.name];\n if (typeof callback === \"function\") {\n var _ref;\n var args = JSON.parse(event.nativeEvent.args);\n var argWires = wires === null || wires === void 0 ? void 0 : wires.callbacks[event.nativeEvent.name];\n callback(...argWires ? decodeNativeSourceCallback(args, argWires, (_ref = wires === null || wires === void 0 ? void 0 : wires.structs) !== null && _ref !== void 0 ? _ref : {}, event.nativeEvent.name) : args);\n }\n },\n style: fill ? {\n flex: 1\n } : void 0\n });\n}\nexport {\n SwiftPackageView\n};\n//# sourceMappingURL=index.native.js.map\n"],"mappings":";;;;;AAGA,SAAS,iBAAiB,OAAO;CAC/B,IAAI,EAAE,aAAa,MAAM,cAAc,OAAO,MAAM,UAAU;CAC9D,IAAI,UAAU,QAAQ,wBAAwB,OAAO,MAAM,OAAO,MAAM,OAAO,IAAI;CACnF,OAAuB,oBAAK,iBAAiB;EAC3C;EACA;EACA;EAEA,OAAO,KAAK,UAAU,SAAS,SAAS,MAAM,OAAO;GACnD,OAAO,OAAO,UAAU,aAAa,OAAO;EAC9C,CAAC;EACD;EACA,aAAa,SAAS,YAAY,OAAO;GACvC,IAAI,WAAW,MAAM,MAAM,YAAY;GACvC,IAAI,OAAO,aAAa,YAAY;IAClC,IAAI;IACJ,IAAI,OAAO,KAAK,MAAM,MAAM,YAAY,IAAI;IAC5C,IAAI,WAAW,UAAU,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM,UAAU,MAAM,YAAY;IAC/F,SAAS,GAAG,WAAW,2BAA2B,MAAM,WAAW,OAAO,UAAU,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM,aAAa,QAAQ,SAAS,KAAK,IAAI,OAAO,CAAC,GAAG,MAAM,YAAY,IAAI,IAAI,IAAI;GAChN;EACF;EACA,OAAO,OAAO,EACZ,MAAM,EACR,IAAI,KAAK;CACX,CAAC;AACH"}
1
+ {"version":3,"file":"index.native.js","names":[],"sources":["esm/platform/swift/index.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { StyleSheet } from \"react-native\";\nimport NativeSwiftHost from \"../specs/OneSwiftHostNativeComponent\";\nimport { decodeNativeSourceCallback } from \"../native-source/wire.native\";\nimport { RESYNC_EVENT, useNativeSourceProps } from \"../native-source/wireProps.native\";\nfunction SwiftPackageView(param) {\n var { packageName, view, contractHash, props, fill, wires } = param;\n var _ref, _ref1;\n var keyed = useNativeSourceProps(props, wires, view !== \"\");\n var style = StyleSheet.flatten(props.style);\n var fills = fill || ((_ref = style === null || style === void 0 ? void 0 : style.flex) !== null && _ref !== void 0 ? _ref : 0) > 0 || ((_ref1 = style === null || style === void 0 ? void 0 : style.flexGrow) !== null && _ref1 !== void 0 ? _ref1 : 0) > 0;\n return /* @__PURE__ */ _jsx(NativeSwiftHost, {\n packageName,\n view,\n contractHash,\n // a typed view's host learns which callbacks the element passed\n props: keyed.text,\n fill: fills,\n onHostEvent: function onHostEvent(event) {\n if (event.nativeEvent.name === RESYNC_EVENT) return keyed.resync();\n var callback = props[event.nativeEvent.name];\n if (typeof callback === \"function\") {\n var _ref2;\n var args = JSON.parse(event.nativeEvent.args);\n var argWires = wires === null || wires === void 0 ? void 0 : wires.callbacks[event.nativeEvent.name];\n callback(...argWires ? decodeNativeSourceCallback(args, argWires, (_ref2 = wires === null || wires === void 0 ? void 0 : wires.structs) !== null && _ref2 !== void 0 ? _ref2 : {}, event.nativeEvent.name) : args);\n }\n },\n style: fill ? {\n flex: 1\n } : style\n });\n}\nexport {\n SwiftPackageView\n};\n//# sourceMappingURL=index.native.js.map\n"],"mappings":";;;;;;;AAKA,SAAS,iBAAiB,OAAO;CAC/B,IAAI,EAAE,aAAa,MAAM,cAAc,OAAO,MAAM,UAAU;CAC9D,IAAI,MAAM;CACV,IAAI,QAAQ,qBAAqB,OAAO,OAAO,SAAS,EAAE;CAC1D,IAAI,QAAQ,WAAW,QAAQ,MAAM,KAAK;CAC1C,IAAI,QAAQ,UAAU,OAAO,UAAU,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM,UAAU,QAAQ,SAAS,KAAK,IAAI,OAAO,KAAK,OAAO,QAAQ,UAAU,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM,cAAc,QAAQ,UAAU,KAAK,IAAI,QAAQ,KAAK;CAC1P,OAAuB,oBAAK,iBAAiB;EAC3C;EACA;EACA;EAEA,OAAO,MAAM;EACb,MAAM;EACN,aAAa,SAAS,YAAY,OAAO;GACvC,IAAI,MAAM,YAAY,SAAS,cAAc,OAAO,MAAM,OAAO;GACjE,IAAI,WAAW,MAAM,MAAM,YAAY;GACvC,IAAI,OAAO,aAAa,YAAY;IAClC,IAAI;IACJ,IAAI,OAAO,KAAK,MAAM,MAAM,YAAY,IAAI;IAC5C,IAAI,WAAW,UAAU,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM,UAAU,MAAM,YAAY;IAC/F,SAAS,GAAG,WAAW,2BAA2B,MAAM,WAAW,QAAQ,UAAU,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM,aAAa,QAAQ,UAAU,KAAK,IAAI,QAAQ,CAAC,GAAG,MAAM,YAAY,IAAI,IAAI,IAAI;GACnN;EACF;EACA,OAAO,OAAO,EACZ,MAAM,EACR,IAAI;CACN,CAAC;AACH"}
@@ -315,8 +315,8 @@ function createGetIdForRoute(route) {
315
315
  function routeToScreen(route, { options, ...props } = {}) {
316
316
  const navigationRouteName = getReactNavigationRouteName(route);
317
317
  return /* @__PURE__ */ createElement(Screen, {
318
- getId: createGetIdForRoute(route),
319
318
  ...props,
319
+ getId: props.getId ?? createGetIdForRoute(route),
320
320
  name: navigationRouteName,
321
321
  key: navigationRouteName,
322
322
  options: (args) => {
@@ -1 +1 @@
1
- {"version":3,"file":"useScreens.js","names":[],"sources":["esm/router/useScreens.js"],"sourcesContent":["import { createNavigatorFactory } from \"@react-navigation/core\";\nimport React, { Suspense, createElement, memo, useContext, useEffect, useState } from \"react\";\nimport { SafeAreaProvider } from \"../safe-area-context\";\nimport { ServerContextScript } from \"../server/ServerContextScript\";\nimport { checkSkewAndReload } from \"../skewProtection\";\nimport { getClientMatchesSnapshot } from \"../useMatches\";\nimport { handleSkewError, isChunkLoadError } from \"../utils/dynamicImport\";\nimport { getPageExport } from \"../utils/getPageExport\";\nimport { EmptyRoute } from \"../views/EmptyRoute\";\nimport { NamedSlot } from \"../views/Navigator\";\nimport { RouteErrorView } from \"../views/RouteErrorView\";\nimport { Try } from \"../views/Try\";\nimport { ScrollBehaviorRouteCommit } from \"../views/ScrollBehavior\";\nimport { DevHead } from \"../vite/DevHead\";\nimport { getServerContext, useServerContext } from \"../vite/one-server-only\";\nimport { getReactNavigationRouteName } from \"../getReactNavigationConfig\";\nimport { filterRootHTML } from \"./filterRootHTML\";\nimport { Route, RouteParamsContext, SuspenseFallbackContext, useRouteNode } from \"./Route\";\nimport { SpaShellContext } from \"./SpaShellContext\";\nimport { sortRoutesWithInitial } from \"./sortRoutes\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\n\nfunction hasMetaCharset(children) {\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tif (!children) return false;\n\t\tconst checkElement = (child) => {\n\t\t\tif (!React.isValidElement(child)) return false;\n\t\t\tif (child.type === \"meta\") {\n\t\t\t\tconst props = child.props;\n\t\t\t\tif (\"charSet\" in props || \"charset\" in props) return true;\n\t\t\t}\n\t\t\tconst childProps = child.props;\n\t\t\tif (childProps.children) return hasMetaCharset(childProps.children);\n\t\t\treturn false;\n\t\t};\n\t\tif (Array.isArray(children)) return children.some(checkElement);\n\t\treturn checkElement(children);\n\t}\n\treturn true;\n}\nconst { Screen, Group } = createNavigatorFactory({})();\nconst cachedInlineCSSElements = typeof document !== \"undefined\" && typeof document.querySelectorAll === \"function\" ? (() => {\n\tconst elements = [];\n\tdocument.querySelectorAll(\"style[id^=\\\"__one_css_\\\"], link[rel=\\\"stylesheet\\\"][data-one-css]\").forEach((el, i) => {\n\t\tif (el.tagName === \"STYLE\") elements.push(/* @__PURE__ */ jsx(\"style\", {\n\t\t\tid: el.id,\n\t\t\tdangerouslySetInnerHTML: { __html: el.innerHTML }\n\t\t}, `inline-css-${i}`));\n\t\telse {\n\t\t\tconst href = el.getAttribute(\"href\");\n\t\t\telements.push(/* @__PURE__ */ jsx(\"link\", {\n\t\t\t\trel: \"stylesheet\",\n\t\t\t\thref,\n\t\t\t\t\"data-one-css\": \"\"\n\t\t\t}, href));\n\t\t}\n\t});\n\treturn elements;\n})() : [];\nconst SSR_SAFE_METRICS = {\n\tframe: {\n\t\tx: 0,\n\t\ty: 0,\n\t\twidth: 0,\n\t\theight: 0\n\t},\n\tinsets: {\n\t\ttop: 0,\n\t\tleft: 0,\n\t\tright: 0,\n\t\tbottom: 0\n\t}\n};\nfunction RootLayoutRenderer({ LayoutComponent, layoutProps, forwardedRef }) {\n\tif (process.env.NODE_ENV === \"development\" && true) {\n\t\tconst [, setHmrKey] = useState(0);\n\t\tuseEffect(() => {\n\t\t\tconst handler = () => setHmrKey((k) => k + 1);\n\t\t\twindow.addEventListener(\"one-hmr-update\", handler);\n\t\t\treturn () => window.removeEventListener(\"one-hmr-update\", handler);\n\t\t}, []);\n\t}\n\tconst { children, bodyProps, head, htmlProps } = filterRootHTML(LayoutComponent(layoutProps, forwardedRef));\n\tconst { children: headChildren, ...headProps } = head?.props || {};\n\tconst serverContext = useServerContext();\n\tlet finalChildren = children;\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tif (!hasMetaCharset(headChildren)) console.warn(`[one] Missing <meta charSet=\"utf-8\" /> in your root _layout.tsx <head>. This can cause React hydration issues due to encoding mismatch. Add it as the first element in your <head> tag.`);\n\t}\n\tfinalChildren = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(\"head\", {\n\t\t...headProps,\n\t\tchildren: [\n\t\t\t/* @__PURE__ */ jsx(DevHead, {}),\n\t\t\tserverContext?.cssContents?.length || serverContext?.cssInlineCount ? serverContext?.cssContents ? serverContext.cssContents.map((content, i) => content ? /* @__PURE__ */ jsx(\"style\", {\n\t\t\t\tid: `__one_css_${i}`,\n\t\t\t\tdangerouslySetInnerHTML: { __html: content }\n\t\t\t}, `inline-css-${i}`) : serverContext.css?.[i] ? /* @__PURE__ */ jsx(\"link\", {\n\t\t\t\trel: \"stylesheet\",\n\t\t\t\thref: serverContext.css[i]\n\t\t\t}, serverContext.css[i]) : null) : cachedInlineCSSElements : serverContext?.css?.map((file) => /* @__PURE__ */ jsx(\"link\", {\n\t\t\t\trel: \"stylesheet\",\n\t\t\t\thref: file\n\t\t\t}, file)),\n\t\t\t/* @__PURE__ */ jsx(ServerContextScript, {}),\n\t\t\theadChildren\n\t\t]\n\t}, \"head\"), /* @__PURE__ */ jsx(\"body\", {\n\t\tsuppressHydrationWarning: true,\n\t\t...bodyProps,\n\t\tchildren: /* @__PURE__ */ jsx(SafeAreaProvider, {\n\t\t\tinitialMetrics: SSR_SAFE_METRICS,\n\t\t\tchildren: finalChildren\n\t\t})\n\t}, \"body\")] });\n\treturn /* @__PURE__ */ jsx(\"html\", {\n\t\tsuppressHydrationWarning: true,\n\t\tlang: \"en-US\",\n\t\t...htmlProps,\n\t\tchildren: finalChildren\n\t});\n}\nfunction getSortedChildren(children, order, initialRouteName, options) {\n\tif (!order?.length) return children.sort(sortRoutesWithInitial(initialRouteName)).map((route) => ({\n\t\troute,\n\t\tprops: {}\n\t}));\n\tconst entries = [...children];\n\tconst ordered = order.map(({ name, redirect, initialParams, listeners, options: options2, getId }) => {\n\t\tif (!entries.length) {\n\t\t\tconsole.warn(`[Layout children]: Too many screens defined. Route \"${name}\" is extraneous.`);\n\t\t\treturn null;\n\t\t}\n\t\tconst matchIndex = entries.findIndex((child) => child.route === name);\n\t\tif (matchIndex === -1) {\n\t\t\tconsole.warn(`[Layout children]: No route named \"${name}\" exists in nested children:`, children.map(({ route }) => route));\n\t\t\treturn null;\n\t\t}\n\t\tconst match = entries[matchIndex];\n\t\tentries.splice(matchIndex, 1);\n\t\tif (redirect) {\n\t\t\tif (typeof redirect === \"string\") throw new Error(`Redirecting to a specific route is not supported yet.`);\n\t\t\treturn null;\n\t\t}\n\t\treturn {\n\t\t\troute: match,\n\t\t\tprops: {\n\t\t\t\tinitialParams,\n\t\t\t\tlisteners,\n\t\t\t\toptions: options2,\n\t\t\t\tgetId\n\t\t\t}\n\t\t};\n\t}).filter(Boolean);\n\tconst remaining = options?.remaining ?? \"all\";\n\tif (remaining !== \"none\") ordered.push(...entries.filter((route) => remaining === \"all\" || !route.generated).sort(sortRoutesWithInitial(initialRouteName)).map((route) => ({\n\t\troute,\n\t\tprops: {}\n\t})));\n\treturn ordered;\n}\nfunction useSortedScreens(order, options) {\n\tconst node = useRouteNode();\n\treturn React.useMemo(() => {\n\t\treturn (node?.children?.length ? getSortedChildren(node.children, order, node.initialRouteName, options) : []).filter((value) => {\n\t\t\tconst routeName = value.route.route;\n\t\t\tconst normalized = routeName.replace(/\\/index$/, \"\");\n\t\t\treturn !(options?.protectedScreens?.has(routeName) || options?.protectedScreens?.has(normalized));\n\t\t}).map((value) => routeToScreen(value.route, value.props));\n\t}, [\n\t\tnode?.children,\n\t\tnode?.initialRouteName,\n\t\torder,\n\t\toptions?.protectedScreens\n\t]);\n}\nfunction fromImport({ ErrorBoundary, SuspenseFallback, ...component }) {\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tconst exported = getPageExport(component);\n\t\tif (exported && typeof exported === \"object\" && Object.keys(exported).length === 0) return {\n\t\t\tdefault: EmptyRoute,\n\t\t\tErrorBoundary,\n\t\t\tSuspenseFallback\n\t\t};\n\t}\n\treturn {\n\t\tdefault: getPageExport(component),\n\t\tErrorBoundary,\n\t\tSuspenseFallback\n\t};\n}\nfunction RouteSuspenseFallback({ component: Component, route }) {\n\tconst params = useContext(RouteParamsContext);\n\treturn Component ? /* @__PURE__ */ jsx(Component, {\n\t\troute,\n\t\tparams: params ?? {}\n\t}) : null;\n}\nconst qualifiedStore = /* @__PURE__ */ new WeakMap();\nfunction getRouteMatchesForProps() {\n\tconst serverMatches = getServerContext()?.matches ?? [];\n\tif (process.env.VITE_ENVIRONMENT === \"ssr\") return serverMatches;\n\tconst clientMatches = getClientMatchesSnapshot();\n\treturn clientMatches.length ? clientMatches : serverMatches;\n}\nfunction getQualifiedRouteComponent(value) {\n\tif (value && qualifiedStore.has(value)) return qualifiedStore.get(value);\n\tconst ScreenComponent = React.forwardRef((props, ref) => {\n\t\tif (process.env.NODE_ENV === \"development\" && true) {\n\t\t\tconst [, setHmrKey] = useState(0);\n\t\t\tuseEffect(() => {\n\t\t\t\tconst handler = () => setHmrKey((k) => k + 1);\n\t\t\t\twindow.addEventListener(\"one-hmr-update\", handler);\n\t\t\t\treturn () => window.removeEventListener(\"one-hmr-update\", handler);\n\t\t\t}, []);\n\t\t}\n\t\tif (process.env.NODE_ENV === \"development\" && false);\n\t\tconst isSpaShell = useContext(SpaShellContext);\n\t\tconst InheritedSuspenseFallback = useContext(SuspenseFallbackContext);\n\t\tconst matches = getRouteMatchesForProps();\n\t\tif (isSpaShell && props.segment !== \"\") {\n\t\t\tif (!(value.children?.length && (value.layoutRenderMode === \"ssg\" || value.layoutRenderMode === \"ssr\"))) return /* @__PURE__ */ jsx(\"div\", { \"data-one-spa-content\": \"\" });\n\t\t}\n\t\tconst res = fromImport(value.loadRoute());\n\t\tconst Component = res.default || EmptyRoute;\n\t\tconst CatchBoundary = res.ErrorBoundary;\n\t\tconst LayoutSuspenseFallback = value.type === \"layout\" ? res.SuspenseFallback : void 0;\n\t\tconst match = matches.find((match2) => match2.routeId === value.contextKey) || (!value.children?.length ? matches[matches.length - 1] : void 0);\n\t\tconst loaderDataProps = match && \"loaderData\" in match ? { loaderData: match.loaderData } : {};\n\t\tif (process.env.NODE_ENV === \"development\" && process.env.DEBUG === \"one\") {\n\t\t\tconsole.groupCollapsed(`Render ${props.key} ${props.segment}`);\n\t\t\tconsole.info(`value`, value);\n\t\t\tconsole.info(`Component`, Component);\n\t\t\tconsole.groupEnd();\n\t\t}\n\t\tconst slotProps = {};\n\t\tif (value.slots && value.slots.size > 0) for (const [slotName] of value.slots) slotProps[slotName] = /* @__PURE__ */ jsx(NamedSlot, {\n\t\t\tname: slotName,\n\t\t\tlayoutContextKey: value.contextKey\n\t\t});\n\t\tlet rendered;\n\t\tif (props.segment === \"\") rendered = /* @__PURE__ */ jsx(RootLayoutRenderer, {\n\t\t\tLayoutComponent: Component,\n\t\t\tlayoutProps: {\n\t\t\t\t...props,\n\t\t\t\t...slotProps,\n\t\t\t\t...loaderDataProps\n\t\t\t},\n\t\t\tforwardedRef: ref\n\t\t});\n\t\telse {\n\t\t\tconst page = /* @__PURE__ */ jsx(Component, {\n\t\t\t\t...props,\n\t\t\t\t...slotProps,\n\t\t\t\t...loaderDataProps,\n\t\t\t\tref\n\t\t\t});\n\t\t\trendered = /* @__PURE__ */ jsx(RouteErrorBoundary, {\n\t\t\t\trouteName: value.route,\n\t\t\t\tchildren: CatchBoundary ? /* @__PURE__ */ jsx(Try, {\n\t\t\t\t\tcatch: CatchBoundary,\n\t\t\t\t\tchildren: page\n\t\t\t\t}) : page\n\t\t\t});\n\t\t}\n\t\tif (value.type !== \"layout\") return rendered;\n\t\tconst providedSuspenseFallback = LayoutSuspenseFallback ?? InheritedSuspenseFallback;\n\t\treturn /* @__PURE__ */ jsx(SuspenseFallbackContext.Provider, {\n\t\t\tvalue: providedSuspenseFallback,\n\t\t\tchildren: LayoutSuspenseFallback ? wrapSuspense(rendered, LayoutSuspenseFallback) : rendered\n\t\t});\n\t});\n\tconst wrapSuspense = (children, SuspenseFallback) => {\n\t\tconst fallback = /* @__PURE__ */ jsx(RouteSuspenseFallback, {\n\t\t\tcomponent: SuspenseFallback,\n\t\t\troute: value.contextKey\n\t\t});\n\t\tif (process.env.ONE_SUSPEND_ROUTES === \"1\" && globalThis.__ONE_DISABLE_SUSPENSE_ROUTES__ !== true) return /* @__PURE__ */ jsx(Suspense, {\n\t\t\tfallback,\n\t\t\tchildren\n\t\t});\n\t\treturn children;\n\t};\n\tconst QualifiedRoute = React.forwardRef(({ route, navigation, ...props }, ref) => {\n\t\tconst InheritedSuspenseFallback = useContext(SuspenseFallbackContext);\n\t\treturn /* @__PURE__ */ jsx(Route, {\n\t\t\troute,\n\t\t\tnode: value,\n\t\t\tchildren: /* @__PURE__ */ jsx(Fragment, { children: wrapSuspense(/* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ScreenComponent, {\n\t\t\t\t...props,\n\t\t\t\tref,\n\t\t\t\tsegment: value.route\n\t\t\t}), process.env.VITE_ENVIRONMENT === \"client\" && value.type !== \"layout\" && navigation && /* @__PURE__ */ jsx(ScrollBehaviorRouteCommit, {})] }), InheritedSuspenseFallback) })\n\t\t});\n\t});\n\tQualifiedRoute.displayName = `Route(${value.route})`;\n\tconst Memoized = memo(QualifiedRoute);\n\tqualifiedStore.set(value, Memoized);\n\treturn Memoized;\n}\nfunction createGetIdForRoute(route) {\n\tconst include = /* @__PURE__ */ new Map();\n\tif (route.dynamic) for (const segment of route.dynamic) include.set(segment.name, segment);\n\treturn ({ params = {} } = {}) => {\n\t\tconst segments = [];\n\t\tfor (const dynamic of include.values()) {\n\t\t\tconst value = params?.[dynamic.name];\n\t\t\tif (Array.isArray(value) && value.length > 0) segments.push(value.join(\"/\"));\n\t\t\telse if (value && !Array.isArray(value)) segments.push(value);\n\t\t\telse if (dynamic.deep) segments.push(`[...${dynamic.name}]`);\n\t\t\telse segments.push(`[${dynamic.name}]`);\n\t\t}\n\t\treturn segments.join(\"/\") ?? route.contextKey;\n\t};\n}\nfunction routeToScreen(route, { options, ...props } = {}) {\n\tconst navigationRouteName = getReactNavigationRouteName(route);\n\treturn /* @__PURE__ */ createElement(Screen, {\n\t\tgetId: createGetIdForRoute(route),\n\t\t...props,\n\t\tname: navigationRouteName,\n\t\tkey: navigationRouteName,\n\t\toptions: (args) => {\n\t\t\tconst staticOptions = route.generated ? route.loadRoute()?.getNavOptions : null;\n\t\t\tconst staticResult = typeof staticOptions === \"function\" ? staticOptions(args) : staticOptions;\n\t\t\tconst dynamicResult = typeof options === \"function\" ? options?.(args) : options;\n\t\t\tconst output = {\n\t\t\t\t...staticResult,\n\t\t\t\t...dynamicResult\n\t\t\t};\n\t\t\tif (route.generated) {\n\t\t\t\toutput.tabBarButton = () => null;\n\t\t\t\toutput.drawerItemStyle = {\n\t\t\t\t\theight: 0,\n\t\t\t\t\tdisplay: \"none\"\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn output;\n\t\t},\n\t\tgetComponent: () => {\n\t\t\treturn getQualifiedRouteComponent(route);\n\t\t}\n\t});\n}\nconst ROUTE_ERROR_BOUNDARY_INITIAL_STATE = {\n\thasError: false,\n\terror: null,\n\terrorInfo: null\n};\nvar RouteErrorBoundary = class extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\t\tthis.state = ROUTE_ERROR_BOUNDARY_INITIAL_STATE;\n\t}\n\tstatic getDerivedStateFromError(error) {\n\t\treturn {\n\t\t\thasError: true,\n\t\t\terror\n\t\t};\n\t}\n\tcomponentDidCatch(error, errorInfo) {\n\t\tconsole.error(`Error occurred while running route \"${this.props.routeName}\": ${error instanceof Error ? error.message : error}\n\n${error.stack}\n\nComponent Stack:\n${errorInfo.componentStack}`);\n\t\tthis.setState({ errorInfo });\n\t\tif (process.env.NODE_ENV === \"production\" && process.env.ONE_SKEW_PROTECTION !== \"false\") if (isChunkLoadError(error)) handleSkewError();\n\t\telse checkSkewAndReload();\n\t}\n\tclearError() {\n\t\tthis.setState(ROUTE_ERROR_BOUNDARY_INITIAL_STATE);\n\t}\n\trender() {\n\t\tif (this.state.hasError) {\n\t\t\tconst { error, errorInfo } = this.state;\n\t\t\treturn /* @__PURE__ */ jsx(RouteErrorView, {\n\t\t\t\trouteName: this.props.routeName,\n\t\t\t\terror,\n\t\t\t\terrorInfo,\n\t\t\t\tonRetry: this.clearError.bind(this)\n\t\t\t});\n\t\t}\n\t\treturn this.props.children;\n\t}\n};\n\nexport { Group, Screen, createGetIdForRoute, getQualifiedRouteComponent, useSortedScreens };"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAS,eAAe,UAAU;CACjC,IAAI,QAAQ,IAAI,aAAa,eAAe;EAC3C,IAAI,CAAC,UAAU,OAAO;EACtB,MAAM,gBAAgB,UAAU;GAC/B,IAAI,CAAC,MAAM,eAAe,KAAK,GAAG,OAAO;GACzC,IAAI,MAAM,SAAS,QAAQ;IAC1B,MAAM,QAAQ,MAAM;IACpB,IAAI,aAAa,SAAS,aAAa,OAAO,OAAO;GACtD;GACA,MAAM,aAAa,MAAM;GACzB,IAAI,WAAW,UAAU,OAAO,eAAe,WAAW,QAAQ;GAClE,OAAO;EACR;EACA,IAAI,MAAM,QAAQ,QAAQ,GAAG,OAAO,SAAS,KAAK,YAAY;EAC9D,OAAO,aAAa,QAAQ;CAC7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,QAAQ,MAAM,UAAU,MAAM;;EAE9H,MAAM,MAAM;;;EAGZ,UAAU,gBAAgB;EAC1B,KAAK,SAAS,EAAE,UAAU,CAAC;EAC3B,IAAI,QAAQ,IAAI,aAAa,gBAAgB,QAAQ,IAAI,wBAAwB,SAAS,IAAI,iBAAiB,KAAK,GAAG,gBAAgB;OAClI,mBAAmB;CACzB;CACA,aAAa;EACZ,KAAK,SAAS,kCAAkC;CACjD;CACA,SAAS;EACR,IAAI,KAAK,MAAM,UAAU;GACxB,MAAM,EAAE,OAAO,cAAc,KAAK;GAClC,OAAuB,oBAAI,gBAAgB;IAC1C,WAAW,KAAK,MAAM;IACtB;IACA;IACA,SAAS,KAAK,WAAW,KAAK,IAAI;GACnC,CAAC;EACF;EACA,OAAO,KAAK,MAAM;CACnB;AACD"}
1
+ {"version":3,"file":"useScreens.js","names":[],"sources":["esm/router/useScreens.js"],"sourcesContent":["import { createNavigatorFactory } from \"@react-navigation/core\";\nimport React, { Suspense, createElement, memo, useContext, useEffect, useState } from \"react\";\nimport { SafeAreaProvider } from \"../safe-area-context\";\nimport { ServerContextScript } from \"../server/ServerContextScript\";\nimport { checkSkewAndReload } from \"../skewProtection\";\nimport { getClientMatchesSnapshot } from \"../useMatches\";\nimport { handleSkewError, isChunkLoadError } from \"../utils/dynamicImport\";\nimport { getPageExport } from \"../utils/getPageExport\";\nimport { EmptyRoute } from \"../views/EmptyRoute\";\nimport { NamedSlot } from \"../views/Navigator\";\nimport { RouteErrorView } from \"../views/RouteErrorView\";\nimport { Try } from \"../views/Try\";\nimport { ScrollBehaviorRouteCommit } from \"../views/ScrollBehavior\";\nimport { DevHead } from \"../vite/DevHead\";\nimport { getServerContext, useServerContext } from \"../vite/one-server-only\";\nimport { getReactNavigationRouteName } from \"../getReactNavigationConfig\";\nimport { filterRootHTML } from \"./filterRootHTML\";\nimport { Route, RouteParamsContext, SuspenseFallbackContext, useRouteNode } from \"./Route\";\nimport { SpaShellContext } from \"./SpaShellContext\";\nimport { sortRoutesWithInitial } from \"./sortRoutes\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\n\nfunction hasMetaCharset(children) {\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tif (!children) return false;\n\t\tconst checkElement = (child) => {\n\t\t\tif (!React.isValidElement(child)) return false;\n\t\t\tif (child.type === \"meta\") {\n\t\t\t\tconst props = child.props;\n\t\t\t\tif (\"charSet\" in props || \"charset\" in props) return true;\n\t\t\t}\n\t\t\tconst childProps = child.props;\n\t\t\tif (childProps.children) return hasMetaCharset(childProps.children);\n\t\t\treturn false;\n\t\t};\n\t\tif (Array.isArray(children)) return children.some(checkElement);\n\t\treturn checkElement(children);\n\t}\n\treturn true;\n}\nconst { Screen, Group } = createNavigatorFactory({})();\nconst cachedInlineCSSElements = typeof document !== \"undefined\" && typeof document.querySelectorAll === \"function\" ? (() => {\n\tconst elements = [];\n\tdocument.querySelectorAll(\"style[id^=\\\"__one_css_\\\"], link[rel=\\\"stylesheet\\\"][data-one-css]\").forEach((el, i) => {\n\t\tif (el.tagName === \"STYLE\") elements.push(/* @__PURE__ */ jsx(\"style\", {\n\t\t\tid: el.id,\n\t\t\tdangerouslySetInnerHTML: { __html: el.innerHTML }\n\t\t}, `inline-css-${i}`));\n\t\telse {\n\t\t\tconst href = el.getAttribute(\"href\");\n\t\t\telements.push(/* @__PURE__ */ jsx(\"link\", {\n\t\t\t\trel: \"stylesheet\",\n\t\t\t\thref,\n\t\t\t\t\"data-one-css\": \"\"\n\t\t\t}, href));\n\t\t}\n\t});\n\treturn elements;\n})() : [];\nconst SSR_SAFE_METRICS = {\n\tframe: {\n\t\tx: 0,\n\t\ty: 0,\n\t\twidth: 0,\n\t\theight: 0\n\t},\n\tinsets: {\n\t\ttop: 0,\n\t\tleft: 0,\n\t\tright: 0,\n\t\tbottom: 0\n\t}\n};\nfunction RootLayoutRenderer({ LayoutComponent, layoutProps, forwardedRef }) {\n\tif (process.env.NODE_ENV === \"development\" && true) {\n\t\tconst [, setHmrKey] = useState(0);\n\t\tuseEffect(() => {\n\t\t\tconst handler = () => setHmrKey((k) => k + 1);\n\t\t\twindow.addEventListener(\"one-hmr-update\", handler);\n\t\t\treturn () => window.removeEventListener(\"one-hmr-update\", handler);\n\t\t}, []);\n\t}\n\tconst { children, bodyProps, head, htmlProps } = filterRootHTML(LayoutComponent(layoutProps, forwardedRef));\n\tconst { children: headChildren, ...headProps } = head?.props || {};\n\tconst serverContext = useServerContext();\n\tlet finalChildren = children;\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tif (!hasMetaCharset(headChildren)) console.warn(`[one] Missing <meta charSet=\"utf-8\" /> in your root _layout.tsx <head>. This can cause React hydration issues due to encoding mismatch. Add it as the first element in your <head> tag.`);\n\t}\n\tfinalChildren = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(\"head\", {\n\t\t...headProps,\n\t\tchildren: [\n\t\t\t/* @__PURE__ */ jsx(DevHead, {}),\n\t\t\tserverContext?.cssContents?.length || serverContext?.cssInlineCount ? serverContext?.cssContents ? serverContext.cssContents.map((content, i) => content ? /* @__PURE__ */ jsx(\"style\", {\n\t\t\t\tid: `__one_css_${i}`,\n\t\t\t\tdangerouslySetInnerHTML: { __html: content }\n\t\t\t}, `inline-css-${i}`) : serverContext.css?.[i] ? /* @__PURE__ */ jsx(\"link\", {\n\t\t\t\trel: \"stylesheet\",\n\t\t\t\thref: serverContext.css[i]\n\t\t\t}, serverContext.css[i]) : null) : cachedInlineCSSElements : serverContext?.css?.map((file) => /* @__PURE__ */ jsx(\"link\", {\n\t\t\t\trel: \"stylesheet\",\n\t\t\t\thref: file\n\t\t\t}, file)),\n\t\t\t/* @__PURE__ */ jsx(ServerContextScript, {}),\n\t\t\theadChildren\n\t\t]\n\t}, \"head\"), /* @__PURE__ */ jsx(\"body\", {\n\t\tsuppressHydrationWarning: true,\n\t\t...bodyProps,\n\t\tchildren: /* @__PURE__ */ jsx(SafeAreaProvider, {\n\t\t\tinitialMetrics: SSR_SAFE_METRICS,\n\t\t\tchildren: finalChildren\n\t\t})\n\t}, \"body\")] });\n\treturn /* @__PURE__ */ jsx(\"html\", {\n\t\tsuppressHydrationWarning: true,\n\t\tlang: \"en-US\",\n\t\t...htmlProps,\n\t\tchildren: finalChildren\n\t});\n}\nfunction getSortedChildren(children, order, initialRouteName, options) {\n\tif (!order?.length) return children.sort(sortRoutesWithInitial(initialRouteName)).map((route) => ({\n\t\troute,\n\t\tprops: {}\n\t}));\n\tconst entries = [...children];\n\tconst ordered = order.map(({ name, redirect, initialParams, listeners, options: options2, getId }) => {\n\t\tif (!entries.length) {\n\t\t\tconsole.warn(`[Layout children]: Too many screens defined. Route \"${name}\" is extraneous.`);\n\t\t\treturn null;\n\t\t}\n\t\tconst matchIndex = entries.findIndex((child) => child.route === name);\n\t\tif (matchIndex === -1) {\n\t\t\tconsole.warn(`[Layout children]: No route named \"${name}\" exists in nested children:`, children.map(({ route }) => route));\n\t\t\treturn null;\n\t\t}\n\t\tconst match = entries[matchIndex];\n\t\tentries.splice(matchIndex, 1);\n\t\tif (redirect) {\n\t\t\tif (typeof redirect === \"string\") throw new Error(`Redirecting to a specific route is not supported yet.`);\n\t\t\treturn null;\n\t\t}\n\t\treturn {\n\t\t\troute: match,\n\t\t\tprops: {\n\t\t\t\tinitialParams,\n\t\t\t\tlisteners,\n\t\t\t\toptions: options2,\n\t\t\t\tgetId\n\t\t\t}\n\t\t};\n\t}).filter(Boolean);\n\tconst remaining = options?.remaining ?? \"all\";\n\tif (remaining !== \"none\") ordered.push(...entries.filter((route) => remaining === \"all\" || !route.generated).sort(sortRoutesWithInitial(initialRouteName)).map((route) => ({\n\t\troute,\n\t\tprops: {}\n\t})));\n\treturn ordered;\n}\nfunction useSortedScreens(order, options) {\n\tconst node = useRouteNode();\n\treturn React.useMemo(() => {\n\t\treturn (node?.children?.length ? getSortedChildren(node.children, order, node.initialRouteName, options) : []).filter((value) => {\n\t\t\tconst routeName = value.route.route;\n\t\t\tconst normalized = routeName.replace(/\\/index$/, \"\");\n\t\t\treturn !(options?.protectedScreens?.has(routeName) || options?.protectedScreens?.has(normalized));\n\t\t}).map((value) => routeToScreen(value.route, value.props));\n\t}, [\n\t\tnode?.children,\n\t\tnode?.initialRouteName,\n\t\torder,\n\t\toptions?.protectedScreens\n\t]);\n}\nfunction fromImport({ ErrorBoundary, SuspenseFallback, ...component }) {\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tconst exported = getPageExport(component);\n\t\tif (exported && typeof exported === \"object\" && Object.keys(exported).length === 0) return {\n\t\t\tdefault: EmptyRoute,\n\t\t\tErrorBoundary,\n\t\t\tSuspenseFallback\n\t\t};\n\t}\n\treturn {\n\t\tdefault: getPageExport(component),\n\t\tErrorBoundary,\n\t\tSuspenseFallback\n\t};\n}\nfunction RouteSuspenseFallback({ component: Component, route }) {\n\tconst params = useContext(RouteParamsContext);\n\treturn Component ? /* @__PURE__ */ jsx(Component, {\n\t\troute,\n\t\tparams: params ?? {}\n\t}) : null;\n}\nconst qualifiedStore = /* @__PURE__ */ new WeakMap();\nfunction getRouteMatchesForProps() {\n\tconst serverMatches = getServerContext()?.matches ?? [];\n\tif (process.env.VITE_ENVIRONMENT === \"ssr\") return serverMatches;\n\tconst clientMatches = getClientMatchesSnapshot();\n\treturn clientMatches.length ? clientMatches : serverMatches;\n}\nfunction getQualifiedRouteComponent(value) {\n\tif (value && qualifiedStore.has(value)) return qualifiedStore.get(value);\n\tconst ScreenComponent = React.forwardRef((props, ref) => {\n\t\tif (process.env.NODE_ENV === \"development\" && true) {\n\t\t\tconst [, setHmrKey] = useState(0);\n\t\t\tuseEffect(() => {\n\t\t\t\tconst handler = () => setHmrKey((k) => k + 1);\n\t\t\t\twindow.addEventListener(\"one-hmr-update\", handler);\n\t\t\t\treturn () => window.removeEventListener(\"one-hmr-update\", handler);\n\t\t\t}, []);\n\t\t}\n\t\tif (process.env.NODE_ENV === \"development\" && false);\n\t\tconst isSpaShell = useContext(SpaShellContext);\n\t\tconst InheritedSuspenseFallback = useContext(SuspenseFallbackContext);\n\t\tconst matches = getRouteMatchesForProps();\n\t\tif (isSpaShell && props.segment !== \"\") {\n\t\t\tif (!(value.children?.length && (value.layoutRenderMode === \"ssg\" || value.layoutRenderMode === \"ssr\"))) return /* @__PURE__ */ jsx(\"div\", { \"data-one-spa-content\": \"\" });\n\t\t}\n\t\tconst res = fromImport(value.loadRoute());\n\t\tconst Component = res.default || EmptyRoute;\n\t\tconst CatchBoundary = res.ErrorBoundary;\n\t\tconst LayoutSuspenseFallback = value.type === \"layout\" ? res.SuspenseFallback : void 0;\n\t\tconst match = matches.find((match2) => match2.routeId === value.contextKey) || (!value.children?.length ? matches[matches.length - 1] : void 0);\n\t\tconst loaderDataProps = match && \"loaderData\" in match ? { loaderData: match.loaderData } : {};\n\t\tif (process.env.NODE_ENV === \"development\" && process.env.DEBUG === \"one\") {\n\t\t\tconsole.groupCollapsed(`Render ${props.key} ${props.segment}`);\n\t\t\tconsole.info(`value`, value);\n\t\t\tconsole.info(`Component`, Component);\n\t\t\tconsole.groupEnd();\n\t\t}\n\t\tconst slotProps = {};\n\t\tif (value.slots && value.slots.size > 0) for (const [slotName] of value.slots) slotProps[slotName] = /* @__PURE__ */ jsx(NamedSlot, {\n\t\t\tname: slotName,\n\t\t\tlayoutContextKey: value.contextKey\n\t\t});\n\t\tlet rendered;\n\t\tif (props.segment === \"\") rendered = /* @__PURE__ */ jsx(RootLayoutRenderer, {\n\t\t\tLayoutComponent: Component,\n\t\t\tlayoutProps: {\n\t\t\t\t...props,\n\t\t\t\t...slotProps,\n\t\t\t\t...loaderDataProps\n\t\t\t},\n\t\t\tforwardedRef: ref\n\t\t});\n\t\telse {\n\t\t\tconst page = /* @__PURE__ */ jsx(Component, {\n\t\t\t\t...props,\n\t\t\t\t...slotProps,\n\t\t\t\t...loaderDataProps,\n\t\t\t\tref\n\t\t\t});\n\t\t\trendered = /* @__PURE__ */ jsx(RouteErrorBoundary, {\n\t\t\t\trouteName: value.route,\n\t\t\t\tchildren: CatchBoundary ? /* @__PURE__ */ jsx(Try, {\n\t\t\t\t\tcatch: CatchBoundary,\n\t\t\t\t\tchildren: page\n\t\t\t\t}) : page\n\t\t\t});\n\t\t}\n\t\tif (value.type !== \"layout\") return rendered;\n\t\tconst providedSuspenseFallback = LayoutSuspenseFallback ?? InheritedSuspenseFallback;\n\t\treturn /* @__PURE__ */ jsx(SuspenseFallbackContext.Provider, {\n\t\t\tvalue: providedSuspenseFallback,\n\t\t\tchildren: LayoutSuspenseFallback ? wrapSuspense(rendered, LayoutSuspenseFallback) : rendered\n\t\t});\n\t});\n\tconst wrapSuspense = (children, SuspenseFallback) => {\n\t\tconst fallback = /* @__PURE__ */ jsx(RouteSuspenseFallback, {\n\t\t\tcomponent: SuspenseFallback,\n\t\t\troute: value.contextKey\n\t\t});\n\t\tif (process.env.ONE_SUSPEND_ROUTES === \"1\" && globalThis.__ONE_DISABLE_SUSPENSE_ROUTES__ !== true) return /* @__PURE__ */ jsx(Suspense, {\n\t\t\tfallback,\n\t\t\tchildren\n\t\t});\n\t\treturn children;\n\t};\n\tconst QualifiedRoute = React.forwardRef(({ route, navigation, ...props }, ref) => {\n\t\tconst InheritedSuspenseFallback = useContext(SuspenseFallbackContext);\n\t\treturn /* @__PURE__ */ jsx(Route, {\n\t\t\troute,\n\t\t\tnode: value,\n\t\t\tchildren: /* @__PURE__ */ jsx(Fragment, { children: wrapSuspense(/* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ScreenComponent, {\n\t\t\t\t...props,\n\t\t\t\tref,\n\t\t\t\tsegment: value.route\n\t\t\t}), process.env.VITE_ENVIRONMENT === \"client\" && value.type !== \"layout\" && navigation && /* @__PURE__ */ jsx(ScrollBehaviorRouteCommit, {})] }), InheritedSuspenseFallback) })\n\t\t});\n\t});\n\tQualifiedRoute.displayName = `Route(${value.route})`;\n\tconst Memoized = memo(QualifiedRoute);\n\tqualifiedStore.set(value, Memoized);\n\treturn Memoized;\n}\nfunction createGetIdForRoute(route) {\n\tconst include = /* @__PURE__ */ new Map();\n\tif (route.dynamic) for (const segment of route.dynamic) include.set(segment.name, segment);\n\treturn ({ params = {} } = {}) => {\n\t\tconst segments = [];\n\t\tfor (const dynamic of include.values()) {\n\t\t\tconst value = params?.[dynamic.name];\n\t\t\tif (Array.isArray(value) && value.length > 0) segments.push(value.join(\"/\"));\n\t\t\telse if (value && !Array.isArray(value)) segments.push(value);\n\t\t\telse if (dynamic.deep) segments.push(`[...${dynamic.name}]`);\n\t\t\telse segments.push(`[${dynamic.name}]`);\n\t\t}\n\t\treturn segments.join(\"/\") ?? route.contextKey;\n\t};\n}\nfunction routeToScreen(route, { options, ...props } = {}) {\n\tconst navigationRouteName = getReactNavigationRouteName(route);\n\treturn /* @__PURE__ */ createElement(Screen, {\n\t\t...props,\n\t\tgetId: props.getId ?? createGetIdForRoute(route),\n\t\tname: navigationRouteName,\n\t\tkey: navigationRouteName,\n\t\toptions: (args) => {\n\t\t\tconst staticOptions = route.generated ? route.loadRoute()?.getNavOptions : null;\n\t\t\tconst staticResult = typeof staticOptions === \"function\" ? staticOptions(args) : staticOptions;\n\t\t\tconst dynamicResult = typeof options === \"function\" ? options?.(args) : options;\n\t\t\tconst output = {\n\t\t\t\t...staticResult,\n\t\t\t\t...dynamicResult\n\t\t\t};\n\t\t\tif (route.generated) {\n\t\t\t\toutput.tabBarButton = () => null;\n\t\t\t\toutput.drawerItemStyle = {\n\t\t\t\t\theight: 0,\n\t\t\t\t\tdisplay: \"none\"\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn output;\n\t\t},\n\t\tgetComponent: () => {\n\t\t\treturn getQualifiedRouteComponent(route);\n\t\t}\n\t});\n}\nconst ROUTE_ERROR_BOUNDARY_INITIAL_STATE = {\n\thasError: false,\n\terror: null,\n\terrorInfo: null\n};\nvar RouteErrorBoundary = class extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\t\tthis.state = ROUTE_ERROR_BOUNDARY_INITIAL_STATE;\n\t}\n\tstatic getDerivedStateFromError(error) {\n\t\treturn {\n\t\t\thasError: true,\n\t\t\terror\n\t\t};\n\t}\n\tcomponentDidCatch(error, errorInfo) {\n\t\tconsole.error(`Error occurred while running route \"${this.props.routeName}\": ${error instanceof Error ? error.message : error}\n\n${error.stack}\n\nComponent Stack:\n${errorInfo.componentStack}`);\n\t\tthis.setState({ errorInfo });\n\t\tif (process.env.NODE_ENV === \"production\" && process.env.ONE_SKEW_PROTECTION !== \"false\") if (isChunkLoadError(error)) handleSkewError();\n\t\telse checkSkewAndReload();\n\t}\n\tclearError() {\n\t\tthis.setState(ROUTE_ERROR_BOUNDARY_INITIAL_STATE);\n\t}\n\trender() {\n\t\tif (this.state.hasError) {\n\t\t\tconst { error, errorInfo } = this.state;\n\t\t\treturn /* @__PURE__ */ jsx(RouteErrorView, {\n\t\t\t\trouteName: this.props.routeName,\n\t\t\t\terror,\n\t\t\t\terrorInfo,\n\t\t\t\tonRetry: this.clearError.bind(this)\n\t\t\t});\n\t\t}\n\t\treturn this.props.children;\n\t}\n};\n\nexport { Group, Screen, createGetIdForRoute, getQualifiedRouteComponent, useSortedScreens };"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAS,eAAe,UAAU;CACjC,IAAI,QAAQ,IAAI,aAAa,eAAe;EAC3C,IAAI,CAAC,UAAU,OAAO;EACtB,MAAM,gBAAgB,UAAU;GAC/B,IAAI,CAAC,MAAM,eAAe,KAAK,GAAG,OAAO;GACzC,IAAI,MAAM,SAAS,QAAQ;IAC1B,MAAM,QAAQ,MAAM;IACpB,IAAI,aAAa,SAAS,aAAa,OAAO,OAAO;GACtD;GACA,MAAM,aAAa,MAAM;GACzB,IAAI,WAAW,UAAU,OAAO,eAAe,WAAW,QAAQ;GAClE,OAAO;EACR;EACA,IAAI,MAAM,QAAQ,QAAQ,GAAG,OAAO,SAAS,KAAK,YAAY;EAC9D,OAAO,aAAa,QAAQ;CAC7B;CACA,OAAO;A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QAAQ,MAAM,UAAU,MAAM;;EAE9H,MAAM,MAAM;;;EAGZ,UAAU,gBAAgB;EAC1B,KAAK,SAAS,EAAE,UAAU,CAAC;EAC3B,IAAI,QAAQ,IAAI,aAAa,gBAAgB,QAAQ,IAAI,wBAAwB,SAAS,IAAI,iBAAiB,KAAK,GAAG,gBAAgB;OAClI,mBAAmB;CACzB;CACA,aAAa;EACZ,KAAK,SAAS,kCAAkC;CACjD;CACA,SAAS;EACR,IAAI,KAAK,MAAM,UAAU;GACxB,MAAM,EAAE,OAAO,cAAc,KAAK;GAClC,OAAuB,oBAAI,gBAAgB;IAC1C,WAAW,KAAK,MAAM;IACtB;IACA;IACA,SAAS,KAAK,WAAW,KAAK,IAAI;GACnC,CAAC;EACF;EACA,OAAO,KAAK,MAAM;CACnB;AACD"}
@@ -369,10 +369,11 @@ function createGetIdForRoute(route) {
369
369
  }
370
370
  function routeToScreen(route) {
371
371
  var { options, ...props } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
372
+ var _props_getId;
372
373
  var navigationRouteName = getReactNavigationRouteName(route);
373
374
  return /* @__PURE__ */ createElement(Screen, {
374
- getId: createGetIdForRoute(route),
375
375
  ...props,
376
+ getId: (_props_getId = props.getId) !== null && _props_getId !== void 0 ? _props_getId : createGetIdForRoute(route),
376
377
  name: navigationRouteName,
377
378
  key: navigationRouteName,
378
379
  options: function options1(args) {
@@ -1 +1 @@
1
- {"version":3,"file":"useScreens.native.js","names":[],"sources":["esm/router/useScreens.native.js"],"sourcesContent":["import { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nimport React, { Suspense, createElement, memo, useContext } from \"react\";\nimport { createNavigatorFactory } from \"@react-navigation/core\";\nimport { getClientMatchesSnapshot } from \"../useMatches\";\nimport { getPageExport } from \"../utils/getPageExport\";\nimport { EmptyRoute } from \"../views/EmptyRoute\";\nimport { NamedSlot } from \"../views/Navigator\";\nimport { RouteErrorView } from \"../views/RouteErrorView\";\nimport { Try } from \"../views/Try\";\nimport { ScrollBehaviorRouteCommit } from \"../views/ScrollBehavior\";\nimport { getServerContext, useServerContext } from \"../vite/one-server-only\";\nimport { getReactNavigationRouteName } from \"../getReactNavigationConfig\";\nimport { filterRootHTML } from \"./filterRootHTML\";\nimport { Route, RouteParamsContext, SuspenseFallbackContext, useRouteNode } from \"./Route\";\nimport { getRouteHmrEpoch, subscribeRouteHmr } from \"./routeHmr\";\nimport { SpaShellContext } from \"./SpaShellContext\";\nimport { sortRoutesWithInitial } from \"./sortRoutes\";\n\nfunction _assert_this_initialized(self) {\n\tif (self === void 0) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n\treturn self;\n}\nfunction _call_super(_this, derived, args) {\n\tderived = _get_prototype_of(derived);\n\treturn _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));\n}\nfunction _class_call_check(instance, Constructor) {\n\tif (!(instance instanceof Constructor)) throw new TypeError(\"Cannot call a class as a function\");\n}\nfunction _defineProperties(target, props) {\n\tfor (var i = 0; i < props.length; i++) {\n\t\tvar descriptor = props[i];\n\t\tdescriptor.enumerable = descriptor.enumerable || false;\n\t\tdescriptor.configurable = true;\n\t\tif (\"value\" in descriptor) descriptor.writable = true;\n\t\tObject.defineProperty(target, descriptor.key, descriptor);\n\t}\n}\nfunction _create_class(Constructor, protoProps, staticProps) {\n\tif (protoProps) _defineProperties(Constructor.prototype, protoProps);\n\tif (staticProps) _defineProperties(Constructor, staticProps);\n\treturn Constructor;\n}\nfunction _get_prototype_of(o) {\n\t_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o2) {\n\t\treturn o2.__proto__ || Object.getPrototypeOf(o2);\n\t};\n\treturn _get_prototype_of(o);\n}\nfunction _inherits(subClass, superClass) {\n\tif (typeof superClass !== \"function\" && superClass !== null) throw new TypeError(\"Super expression must either be null or a function\");\n\tsubClass.prototype = Object.create(superClass && superClass.prototype, { constructor: {\n\t\tvalue: subClass,\n\t\twritable: true,\n\t\tconfigurable: true\n\t} });\n\tif (superClass) _set_prototype_of(subClass, superClass);\n}\nfunction _is_native_reflect_construct() {\n\ttry {\n\t\tvar result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));\n\t} catch (_) {}\n\treturn (_is_native_reflect_construct = function() {\n\t\treturn !!result;\n\t})();\n}\nfunction _possible_constructor_return(self, call) {\n\tif (call && (_type_of(call) === \"object\" || typeof call === \"function\")) return call;\n\treturn _assert_this_initialized(self);\n}\nfunction _set_prototype_of(o, p) {\n\t_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o2, p2) {\n\t\to2.__proto__ = p2;\n\t\treturn o2;\n\t};\n\treturn _set_prototype_of(o, p);\n}\nfunction _type_of(obj) {\n\t\"@swc/helpers - typeof\";\n\treturn obj && typeof Symbol !== \"undefined\" && obj.constructor === Symbol ? \"symbol\" : typeof obj;\n}\nvar { Screen, Group } = createNavigatorFactory({})();\ntypeof document !== \"undefined\" && typeof document.querySelectorAll === \"function\" && (function() {\n\tvar elements = [];\n\tdocument.querySelectorAll(\"style[id^=\\\"__one_css_\\\"], link[rel=\\\"stylesheet\\\"][data-one-css]\").forEach(function(el, i) {\n\t\tif (el.tagName === \"STYLE\") elements.push(/* @__PURE__ */ jsx(\"style\", {\n\t\t\tid: el.id,\n\t\t\tdangerouslySetInnerHTML: { __html: el.innerHTML }\n\t\t}, `inline-css-${i}`));\n\t\telse {\n\t\t\tvar href = el.getAttribute(\"href\");\n\t\t\telements.push(/* @__PURE__ */ jsx(\"link\", {\n\t\t\t\trel: \"stylesheet\",\n\t\t\t\thref,\n\t\t\t\t\"data-one-css\": \"\"\n\t\t\t}, href));\n\t\t}\n\t});\n\treturn elements;\n})();\nfunction RootLayoutRenderer(param) {\n\tvar { LayoutComponent, layoutProps, forwardedRef } = param;\n\tif (process.env.NODE_ENV === \"development\" && false);\n\tvar { children, bodyProps, head, htmlProps } = filterRootHTML(LayoutComponent(layoutProps, forwardedRef));\n\tvar { children: headChildren, ...headProps } = (head === null || head === void 0 ? void 0 : head.props) || {};\n\tuseServerContext();\n\treturn children;\n}\nfunction getSortedChildren(children, order, initialRouteName, options) {\n\tvar _ref;\n\tif (!(order === null || order === void 0 ? void 0 : order.length)) return children.sort(sortRoutesWithInitial(initialRouteName)).map(function(route) {\n\t\treturn {\n\t\t\troute,\n\t\t\tprops: {}\n\t\t};\n\t});\n\tvar entries = [...children];\n\tvar ordered = order.map(function(param) {\n\t\tvar { name, redirect, initialParams, listeners, options: _$options, getId } = param;\n\t\tif (!entries.length) {\n\t\t\tconsole.warn(`[Layout children]: Too many screens defined. Route \"${name}\" is extraneous.`);\n\t\t\treturn null;\n\t\t}\n\t\tvar matchIndex = entries.findIndex(function(child) {\n\t\t\treturn child.route === name;\n\t\t});\n\t\tif (matchIndex === -1) {\n\t\t\tconsole.warn(`[Layout children]: No route named \"${name}\" exists in nested children:`, children.map(function(param2) {\n\t\t\t\tvar { route } = param2;\n\t\t\t\treturn route;\n\t\t\t}));\n\t\t\treturn null;\n\t\t}\n\t\tvar match = entries[matchIndex];\n\t\tentries.splice(matchIndex, 1);\n\t\tif (redirect) {\n\t\t\tif (typeof redirect === \"string\") throw new Error(`Redirecting to a specific route is not supported yet.`);\n\t\t\treturn null;\n\t\t}\n\t\treturn {\n\t\t\troute: match,\n\t\t\tprops: {\n\t\t\t\tinitialParams,\n\t\t\t\tlisteners,\n\t\t\t\toptions: _$options,\n\t\t\t\tgetId\n\t\t\t}\n\t\t};\n\t}).filter(Boolean);\n\tvar remaining = (_ref = options === null || options === void 0 ? void 0 : options.remaining) !== null && _ref !== void 0 ? _ref : \"all\";\n\tif (remaining !== \"none\") ordered.push(...entries.filter(function(route) {\n\t\treturn remaining === \"all\" || !route.generated;\n\t}).sort(sortRoutesWithInitial(initialRouteName)).map(function(route) {\n\t\treturn {\n\t\t\troute,\n\t\t\tprops: {}\n\t\t};\n\t}));\n\treturn ordered;\n}\nfunction useSortedScreens(order, options) {\n\tvar node = useRouteNode();\n\treturn React.useMemo(function() {\n\t\tvar _node_children;\n\t\treturn ((node === null || node === void 0 ? void 0 : (_node_children = node.children) === null || _node_children === void 0 ? void 0 : _node_children.length) ? getSortedChildren(node.children, order, node.initialRouteName, options) : []).filter(function(value) {\n\t\t\tvar _options_protectedScreens, _options_protectedScreens1;\n\t\t\tvar routeName = value.route.route;\n\t\t\tvar normalized = routeName.replace(/\\/index$/, \"\");\n\t\t\treturn !((options === null || options === void 0 ? void 0 : (_options_protectedScreens = options.protectedScreens) === null || _options_protectedScreens === void 0 ? void 0 : _options_protectedScreens.has(routeName)) || (options === null || options === void 0 ? void 0 : (_options_protectedScreens1 = options.protectedScreens) === null || _options_protectedScreens1 === void 0 ? void 0 : _options_protectedScreens1.has(normalized)));\n\t\t}).map(function(value) {\n\t\t\treturn routeToScreen(value.route, value.props);\n\t\t});\n\t}, [\n\t\tnode === null || node === void 0 ? void 0 : node.children,\n\t\tnode === null || node === void 0 ? void 0 : node.initialRouteName,\n\t\torder,\n\t\toptions === null || options === void 0 ? void 0 : options.protectedScreens\n\t]);\n}\nfunction fromImport(param) {\n\tvar { ErrorBoundary, SuspenseFallback, ...component } = param;\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tvar exported = getPageExport(component);\n\t\tif (exported && typeof exported === \"object\" && Object.keys(exported).length === 0) return {\n\t\t\tdefault: EmptyRoute,\n\t\t\tErrorBoundary,\n\t\t\tSuspenseFallback\n\t\t};\n\t}\n\treturn {\n\t\tdefault: getPageExport(component),\n\t\tErrorBoundary,\n\t\tSuspenseFallback\n\t};\n}\nfunction RouteSuspenseFallback(param) {\n\tvar { component: Component, route } = param;\n\tvar params = useContext(RouteParamsContext);\n\treturn Component ? /* @__PURE__ */ jsx(Component, {\n\t\troute,\n\t\tparams: params !== null && params !== void 0 ? params : {}\n\t}) : null;\n}\nvar qualifiedStore = /* @__PURE__ */ new WeakMap();\nfunction getRouteMatchesForProps() {\n\tvar _ref;\n\tvar _getServerContext;\n\tvar serverMatches = (_ref = (_getServerContext = getServerContext()) === null || _getServerContext === void 0 ? void 0 : _getServerContext.matches) !== null && _ref !== void 0 ? _ref : [];\n\tif (process.env.VITE_ENVIRONMENT === \"ssr\") return serverMatches;\n\tvar clientMatches = getClientMatchesSnapshot();\n\treturn clientMatches.length ? clientMatches : serverMatches;\n}\nfunction getQualifiedRouteComponent(value) {\n\tif (value && qualifiedStore.has(value)) return qualifiedStore.get(value);\n\tvar ScreenComponent = /* @__PURE__ */ React.forwardRef(function(props, ref) {\n\t\tvar _value_children;\n\t\tif (process.env.NODE_ENV === \"development\" && false);\n\t\tif (process.env.NODE_ENV === \"development\" && true) React.useSyncExternalStore(subscribeRouteHmr, getRouteHmrEpoch, getRouteHmrEpoch);\n\t\tvar isSpaShell = useContext(SpaShellContext);\n\t\tvar InheritedSuspenseFallback = useContext(SuspenseFallbackContext);\n\t\tvar matches = getRouteMatchesForProps();\n\t\tif (isSpaShell && props.segment !== \"\") {\n\t\t\tvar _value_children1;\n\t\t\tif (!(((_value_children1 = value.children) === null || _value_children1 === void 0 ? void 0 : _value_children1.length) && (value.layoutRenderMode === \"ssg\" || value.layoutRenderMode === \"ssr\"))) return /* @__PURE__ */ jsx(\"div\", { \"data-one-spa-content\": \"\" });\n\t\t}\n\t\tvar res = fromImport(value.loadRoute());\n\t\tvar Component = res.default || EmptyRoute;\n\t\tvar CatchBoundary = res.ErrorBoundary;\n\t\tvar LayoutSuspenseFallback = value.type === \"layout\" ? res.SuspenseFallback : void 0;\n\t\tvar match = matches.find(function(match2) {\n\t\t\treturn match2.routeId === value.contextKey;\n\t\t}) || (!((_value_children = value.children) === null || _value_children === void 0 ? void 0 : _value_children.length) ? matches[matches.length - 1] : void 0);\n\t\tvar loaderDataProps = match && \"loaderData\" in match ? { loaderData: match.loaderData } : {};\n\t\tif (process.env.NODE_ENV === \"development\" && process.env.DEBUG === \"one\") {\n\t\t\tconsole.groupCollapsed(`Render ${props.key} ${props.segment}`);\n\t\t\tconsole.info(`value`, value);\n\t\t\tconsole.info(`Component`, Component);\n\t\t\tconsole.groupEnd();\n\t\t}\n\t\tvar slotProps = {};\n\t\tif (value.slots && value.slots.size > 0) {\n\t\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\t\ttry {\n\t\t\t\tfor (var _iterator = value.slots[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\t\tvar [slotName] = _step.value;\n\t\t\t\t\tslotProps[slotName] = /* @__PURE__ */ jsx(NamedSlot, {\n\t\t\t\t\t\tname: slotName,\n\t\t\t\t\t\tlayoutContextKey: value.contextKey\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t_didIteratorError = true;\n\t\t\t\t_iteratorError = err;\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t\t} finally {\n\t\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tvar rendered;\n\t\tif (props.segment === \"\") rendered = /* @__PURE__ */ jsx(RootLayoutRenderer, {\n\t\t\tLayoutComponent: Component,\n\t\t\tlayoutProps: {\n\t\t\t\t...props,\n\t\t\t\t...slotProps,\n\t\t\t\t...loaderDataProps\n\t\t\t},\n\t\t\tforwardedRef: ref\n\t\t});\n\t\telse {\n\t\t\tvar page = /* @__PURE__ */ jsx(Component, {\n\t\t\t\t...props,\n\t\t\t\t...slotProps,\n\t\t\t\t...loaderDataProps,\n\t\t\t\tref\n\t\t\t});\n\t\t\trendered = /* @__PURE__ */ jsx(RouteErrorBoundary, {\n\t\t\t\trouteName: value.route,\n\t\t\t\tchildren: CatchBoundary ? /* @__PURE__ */ jsx(Try, {\n\t\t\t\t\tcatch: CatchBoundary,\n\t\t\t\t\tchildren: page\n\t\t\t\t}) : page\n\t\t\t});\n\t\t}\n\t\tif (value.type !== \"layout\") return rendered;\n\t\tvar providedSuspenseFallback = LayoutSuspenseFallback !== null && LayoutSuspenseFallback !== void 0 ? LayoutSuspenseFallback : InheritedSuspenseFallback;\n\t\treturn /* @__PURE__ */ jsx(SuspenseFallbackContext.Provider, {\n\t\t\tvalue: providedSuspenseFallback,\n\t\t\tchildren: LayoutSuspenseFallback ? wrapSuspense(rendered, LayoutSuspenseFallback) : rendered\n\t\t});\n\t});\n\tvar wrapSuspense = function wrapSuspense2(children, SuspenseFallback) {\n\t\tvar fallback = /* @__PURE__ */ jsx(RouteSuspenseFallback, {\n\t\t\tcomponent: SuspenseFallback,\n\t\t\troute: value.contextKey\n\t\t});\n\t\tif (process.env.ONE_SUSPEND_ROUTES_NATIVE === \"0\" || globalThis.__ONE_DISABLE_SUSPENSE_ROUTES__ === true) return children;\n\t\treturn /* @__PURE__ */ jsx(Suspense, {\n\t\t\tfallback,\n\t\t\tchildren\n\t\t});\n\t};\n\tvar QualifiedRoute = /* @__PURE__ */ React.forwardRef(function(param, ref) {\n\t\tvar { route, navigation, ...props } = param;\n\t\tvar InheritedSuspenseFallback = useContext(SuspenseFallbackContext);\n\t\treturn /* @__PURE__ */ jsx(Route, {\n\t\t\troute,\n\t\t\tnode: value,\n\t\t\tchildren: /* @__PURE__ */ jsx(Fragment, { children: wrapSuspense(/* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ScreenComponent, {\n\t\t\t\t...props,\n\t\t\t\tref,\n\t\t\t\tsegment: value.route\n\t\t\t}), process.env.VITE_ENVIRONMENT === \"client\" && value.type !== \"layout\" && navigation && /* @__PURE__ */ jsx(ScrollBehaviorRouteCommit, {})] }), InheritedSuspenseFallback) })\n\t\t});\n\t});\n\tQualifiedRoute.displayName = `Route(${value.route})`;\n\tvar Memoized = /* @__PURE__ */ memo(QualifiedRoute);\n\tqualifiedStore.set(value, Memoized);\n\treturn Memoized;\n}\nfunction createGetIdForRoute(route) {\n\tvar include = /* @__PURE__ */ new Map();\n\tif (route.dynamic) {\n\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\ttry {\n\t\t\tfor (var _iterator = route.dynamic[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\tvar segment = _step.value;\n\t\t\t\tinclude.set(segment.name, segment);\n\t\t\t}\n\t\t} catch (err) {\n\t\t\t_didIteratorError = true;\n\t\t\t_iteratorError = err;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t} finally {\n\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t}\n\t\t}\n\t}\n\treturn function() {\n\t\tvar { params = {} } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};\n\t\tvar _segments_join;\n\t\tvar segments = [];\n\t\tvar _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;\n\t\ttry {\n\t\t\tfor (var _iterator2 = include.values()[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n\t\t\t\tvar dynamic = _step2.value;\n\t\t\t\tvar value = params === null || params === void 0 ? void 0 : params[dynamic.name];\n\t\t\t\tif (Array.isArray(value) && value.length > 0) segments.push(value.join(\"/\"));\n\t\t\t\telse if (value && !Array.isArray(value)) segments.push(value);\n\t\t\t\telse if (dynamic.deep) segments.push(`[...${dynamic.name}]`);\n\t\t\t\telse segments.push(`[${dynamic.name}]`);\n\t\t\t}\n\t\t} catch (err) {\n\t\t\t_didIteratorError2 = true;\n\t\t\t_iteratorError2 = err;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();\n\t\t\t} finally {\n\t\t\t\tif (_didIteratorError2) throw _iteratorError2;\n\t\t\t}\n\t\t}\n\t\treturn (_segments_join = segments.join(\"/\")) !== null && _segments_join !== void 0 ? _segments_join : route.contextKey;\n\t};\n}\nfunction routeToScreen(route) {\n\tvar { options, ...props } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};\n\tvar navigationRouteName = getReactNavigationRouteName(route);\n\treturn /* @__PURE__ */ createElement(Screen, {\n\t\tgetId: createGetIdForRoute(route),\n\t\t...props,\n\t\tname: navigationRouteName,\n\t\tkey: navigationRouteName,\n\t\toptions: function options1(args) {\n\t\t\tvar _route_loadRoute;\n\t\t\tvar staticOptions = route.generated ? (_route_loadRoute = route.loadRoute()) === null || _route_loadRoute === void 0 ? void 0 : _route_loadRoute.getNavOptions : null;\n\t\t\tvar staticResult = typeof staticOptions === \"function\" ? staticOptions(args) : staticOptions;\n\t\t\tvar dynamicResult = typeof options === \"function\" ? options === null || options === void 0 ? void 0 : options(args) : options;\n\t\t\tvar output = {\n\t\t\t\t...staticResult,\n\t\t\t\t...dynamicResult\n\t\t\t};\n\t\t\tif (route.generated) {\n\t\t\t\toutput.tabBarButton = function() {\n\t\t\t\t\treturn null;\n\t\t\t\t};\n\t\t\t\toutput.drawerItemStyle = {\n\t\t\t\t\theight: 0,\n\t\t\t\t\tdisplay: \"none\"\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn output;\n\t\t},\n\t\tgetComponent: function getComponent() {\n\t\t\treturn getQualifiedRouteComponent(route);\n\t\t}\n\t});\n}\nvar ROUTE_ERROR_BOUNDARY_INITIAL_STATE = {\n\thasError: false,\n\terror: null,\n\terrorInfo: null\n};\nvar RouteErrorBoundary = /* @__PURE__ */ (function(_React_Component) {\n\t\"use strict\";\n\t_inherits(RouteErrorBoundary2, _React_Component);\n\tfunction RouteErrorBoundary2(props) {\n\t\t_class_call_check(this, RouteErrorBoundary2);\n\t\tvar _this = _call_super(this, RouteErrorBoundary2, [props]);\n\t\t_this.state = ROUTE_ERROR_BOUNDARY_INITIAL_STATE;\n\t\treturn _this;\n\t}\n\t_create_class(RouteErrorBoundary2, [\n\t\t{\n\t\t\tkey: \"componentDidCatch\",\n\t\t\tvalue: function componentDidCatch(error, errorInfo) {\n\t\t\t\tconsole.error(`Error occurred while running route \"${this.props.routeName}\": ${error instanceof Error ? error.message : error}\n\n${error.stack}\n\nComponent Stack:\n${errorInfo.componentStack}`);\n\t\t\t\tthis.setState({ errorInfo });\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tkey: \"clearError\",\n\t\t\tvalue: function clearError() {\n\t\t\t\tthis.setState(ROUTE_ERROR_BOUNDARY_INITIAL_STATE);\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tkey: \"render\",\n\t\t\tvalue: function render() {\n\t\t\t\tif (this.state.hasError) {\n\t\t\t\t\tvar { error, errorInfo } = this.state;\n\t\t\t\t\treturn /* @__PURE__ */ jsx(RouteErrorView, {\n\t\t\t\t\t\trouteName: this.props.routeName,\n\t\t\t\t\t\terror,\n\t\t\t\t\t\terrorInfo,\n\t\t\t\t\t\tonRetry: this.clearError.bind(this)\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn this.props.children;\n\t\t\t}\n\t\t}\n\t], [{\n\t\tkey: \"getDerivedStateFromError\",\n\t\tvalue: function getDerivedStateFromError(error) {\n\t\t\treturn {\n\t\t\t\thasError: true,\n\t\t\t\terror\n\t\t\t};\n\t\t}\n\t}]);\n\treturn RouteErrorBoundary2;\n})(React.Component);\n\nexport { Group, Screen, createGetIdForRoute, getQualifiedRouteComponent, useSortedScreens };"],"mappings":";;;;;;;;;;;;;;;;;;;AAkBA,SAAS,yBAAyB,MAAM;CACvC,IAAI,SAAS,KAAK,GAAG,MAAM,IAAI,eAAe,2DAA2D;CACzG,OAAO;AACR;AACA,SAAS,YAAY,OAAO,SAAS,MAAM;CAC1C,UAAU,kBAAkB,OAAO;CACnC,OAAO,6BAA6B,OAAO,6BAA6B,IAAI,QAAQ,UAAU,SAAS,QAAQ,CAAC,GAAG,kBAAkB,KAAK,CAAC,CA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AkB;KACxB,QAAQ;KACR,SAAS;IACV;GACD;GACA,OAAO;EACR;EACA,cAAc,SAAS,eAAe;GACrC,OAAO,2BAA2B,KAAK;EACxC;CACD,CAAC;AACF;AACA,IAAI,qCAAqC;CACxC,UAAU;CACV,OAAO;CACP,WAAW;AACZ;AACA,IAAI,qBAAqC,iBAAC,SAAS,kBAAkB;CACpE;CACA,UAAU,qBAAqB,gBAAgB;CAC/C,SAAS,oBAAoB,OAAO;EACnC,kBAAkB,MAAM,mBAAmB;EAC3C,IAAI,QAAQ,YAAY,MAAM,qBAAqB,CAAC,KAAK,CAAC;EAC1D,MAAM,QAAQ;EACd,OAAO;CACR;CACA,cAAc,qBAAqB;EAClC;GACC,KAAK;GACL,OAAO,SAAS,kBAAkB,OAAO,WAAW;IACnD,QAAQ,MAAM,uCAAuC,KAAK,MAAM,UAAU,KAAK,iBAAiB,QAAQ,MAAM,UAAU,MAAM;;EAEhI,MAAM,MAAM;;;EAGZ,UAAU,gBAAgB;IACxB,KAAK,SAAS,EAAE,UAAU,CAAC;GAC5B;EACD;EACA;GACC,KAAK;GACL,OAAO,SAAS,aAAa;IAC5B,KAAK,SAAS,kCAAkC;GACjD;EACD;EACA;GACC,KAAK;GACL,OAAO,SAAS,SAAS;IACxB,IAAI,KAAK,MAAM,UAAU;KACxB,IAAI,EAAE,OAAO,cAAc,KAAK;KAChC,OAAuB,oBAAI,gBAAgB;MAC1C,WAAW,KAAK,MAAM;MACtB;MACA;MACA,SAAS,KAAK,WAAW,KAAK,IAAI;KACnC,CAAC;IACF;IACA,OAAO,KAAK,MAAM;GACnB;EACD;CACD,GAAG,CAAC;EACH,KAAK;EACL,OAAO,SAAS,yBAAyB,OAAO;GAC/C,OAAO;IACN,UAAU;IACV;GACD;EACD;CACD,CAAC,CAAC;CACF,OAAO;AACR,EAAC,CAAE,MAAM,SAAS"}
1
+ {"version":3,"file":"useScreens.native.js","names":[],"sources":["esm/router/useScreens.native.js"],"sourcesContent":["import { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nimport React, { Suspense, createElement, memo, useContext } from \"react\";\nimport { createNavigatorFactory } from \"@react-navigation/core\";\nimport { getClientMatchesSnapshot } from \"../useMatches\";\nimport { getPageExport } from \"../utils/getPageExport\";\nimport { EmptyRoute } from \"../views/EmptyRoute\";\nimport { NamedSlot } from \"../views/Navigator\";\nimport { RouteErrorView } from \"../views/RouteErrorView\";\nimport { Try } from \"../views/Try\";\nimport { ScrollBehaviorRouteCommit } from \"../views/ScrollBehavior\";\nimport { getServerContext, useServerContext } from \"../vite/one-server-only\";\nimport { getReactNavigationRouteName } from \"../getReactNavigationConfig\";\nimport { filterRootHTML } from \"./filterRootHTML\";\nimport { Route, RouteParamsContext, SuspenseFallbackContext, useRouteNode } from \"./Route\";\nimport { getRouteHmrEpoch, subscribeRouteHmr } from \"./routeHmr\";\nimport { SpaShellContext } from \"./SpaShellContext\";\nimport { sortRoutesWithInitial } from \"./sortRoutes\";\n\nfunction _assert_this_initialized(self) {\n\tif (self === void 0) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n\treturn self;\n}\nfunction _call_super(_this, derived, args) {\n\tderived = _get_prototype_of(derived);\n\treturn _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));\n}\nfunction _class_call_check(instance, Constructor) {\n\tif (!(instance instanceof Constructor)) throw new TypeError(\"Cannot call a class as a function\");\n}\nfunction _defineProperties(target, props) {\n\tfor (var i = 0; i < props.length; i++) {\n\t\tvar descriptor = props[i];\n\t\tdescriptor.enumerable = descriptor.enumerable || false;\n\t\tdescriptor.configurable = true;\n\t\tif (\"value\" in descriptor) descriptor.writable = true;\n\t\tObject.defineProperty(target, descriptor.key, descriptor);\n\t}\n}\nfunction _create_class(Constructor, protoProps, staticProps) {\n\tif (protoProps) _defineProperties(Constructor.prototype, protoProps);\n\tif (staticProps) _defineProperties(Constructor, staticProps);\n\treturn Constructor;\n}\nfunction _get_prototype_of(o) {\n\t_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o2) {\n\t\treturn o2.__proto__ || Object.getPrototypeOf(o2);\n\t};\n\treturn _get_prototype_of(o);\n}\nfunction _inherits(subClass, superClass) {\n\tif (typeof superClass !== \"function\" && superClass !== null) throw new TypeError(\"Super expression must either be null or a function\");\n\tsubClass.prototype = Object.create(superClass && superClass.prototype, { constructor: {\n\t\tvalue: subClass,\n\t\twritable: true,\n\t\tconfigurable: true\n\t} });\n\tif (superClass) _set_prototype_of(subClass, superClass);\n}\nfunction _is_native_reflect_construct() {\n\ttry {\n\t\tvar result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));\n\t} catch (_) {}\n\treturn (_is_native_reflect_construct = function() {\n\t\treturn !!result;\n\t})();\n}\nfunction _possible_constructor_return(self, call) {\n\tif (call && (_type_of(call) === \"object\" || typeof call === \"function\")) return call;\n\treturn _assert_this_initialized(self);\n}\nfunction _set_prototype_of(o, p) {\n\t_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o2, p2) {\n\t\to2.__proto__ = p2;\n\t\treturn o2;\n\t};\n\treturn _set_prototype_of(o, p);\n}\nfunction _type_of(obj) {\n\t\"@swc/helpers - typeof\";\n\treturn obj && typeof Symbol !== \"undefined\" && obj.constructor === Symbol ? \"symbol\" : typeof obj;\n}\nvar { Screen, Group } = createNavigatorFactory({})();\ntypeof document !== \"undefined\" && typeof document.querySelectorAll === \"function\" && (function() {\n\tvar elements = [];\n\tdocument.querySelectorAll(\"style[id^=\\\"__one_css_\\\"], link[rel=\\\"stylesheet\\\"][data-one-css]\").forEach(function(el, i) {\n\t\tif (el.tagName === \"STYLE\") elements.push(/* @__PURE__ */ jsx(\"style\", {\n\t\t\tid: el.id,\n\t\t\tdangerouslySetInnerHTML: { __html: el.innerHTML }\n\t\t}, `inline-css-${i}`));\n\t\telse {\n\t\t\tvar href = el.getAttribute(\"href\");\n\t\t\telements.push(/* @__PURE__ */ jsx(\"link\", {\n\t\t\t\trel: \"stylesheet\",\n\t\t\t\thref,\n\t\t\t\t\"data-one-css\": \"\"\n\t\t\t}, href));\n\t\t}\n\t});\n\treturn elements;\n})();\nfunction RootLayoutRenderer(param) {\n\tvar { LayoutComponent, layoutProps, forwardedRef } = param;\n\tif (process.env.NODE_ENV === \"development\" && false);\n\tvar { children, bodyProps, head, htmlProps } = filterRootHTML(LayoutComponent(layoutProps, forwardedRef));\n\tvar { children: headChildren, ...headProps } = (head === null || head === void 0 ? void 0 : head.props) || {};\n\tuseServerContext();\n\treturn children;\n}\nfunction getSortedChildren(children, order, initialRouteName, options) {\n\tvar _ref;\n\tif (!(order === null || order === void 0 ? void 0 : order.length)) return children.sort(sortRoutesWithInitial(initialRouteName)).map(function(route) {\n\t\treturn {\n\t\t\troute,\n\t\t\tprops: {}\n\t\t};\n\t});\n\tvar entries = [...children];\n\tvar ordered = order.map(function(param) {\n\t\tvar { name, redirect, initialParams, listeners, options: _$options, getId } = param;\n\t\tif (!entries.length) {\n\t\t\tconsole.warn(`[Layout children]: Too many screens defined. Route \"${name}\" is extraneous.`);\n\t\t\treturn null;\n\t\t}\n\t\tvar matchIndex = entries.findIndex(function(child) {\n\t\t\treturn child.route === name;\n\t\t});\n\t\tif (matchIndex === -1) {\n\t\t\tconsole.warn(`[Layout children]: No route named \"${name}\" exists in nested children:`, children.map(function(param2) {\n\t\t\t\tvar { route } = param2;\n\t\t\t\treturn route;\n\t\t\t}));\n\t\t\treturn null;\n\t\t}\n\t\tvar match = entries[matchIndex];\n\t\tentries.splice(matchIndex, 1);\n\t\tif (redirect) {\n\t\t\tif (typeof redirect === \"string\") throw new Error(`Redirecting to a specific route is not supported yet.`);\n\t\t\treturn null;\n\t\t}\n\t\treturn {\n\t\t\troute: match,\n\t\t\tprops: {\n\t\t\t\tinitialParams,\n\t\t\t\tlisteners,\n\t\t\t\toptions: _$options,\n\t\t\t\tgetId\n\t\t\t}\n\t\t};\n\t}).filter(Boolean);\n\tvar remaining = (_ref = options === null || options === void 0 ? void 0 : options.remaining) !== null && _ref !== void 0 ? _ref : \"all\";\n\tif (remaining !== \"none\") ordered.push(...entries.filter(function(route) {\n\t\treturn remaining === \"all\" || !route.generated;\n\t}).sort(sortRoutesWithInitial(initialRouteName)).map(function(route) {\n\t\treturn {\n\t\t\troute,\n\t\t\tprops: {}\n\t\t};\n\t}));\n\treturn ordered;\n}\nfunction useSortedScreens(order, options) {\n\tvar node = useRouteNode();\n\treturn React.useMemo(function() {\n\t\tvar _node_children;\n\t\treturn ((node === null || node === void 0 ? void 0 : (_node_children = node.children) === null || _node_children === void 0 ? void 0 : _node_children.length) ? getSortedChildren(node.children, order, node.initialRouteName, options) : []).filter(function(value) {\n\t\t\tvar _options_protectedScreens, _options_protectedScreens1;\n\t\t\tvar routeName = value.route.route;\n\t\t\tvar normalized = routeName.replace(/\\/index$/, \"\");\n\t\t\treturn !((options === null || options === void 0 ? void 0 : (_options_protectedScreens = options.protectedScreens) === null || _options_protectedScreens === void 0 ? void 0 : _options_protectedScreens.has(routeName)) || (options === null || options === void 0 ? void 0 : (_options_protectedScreens1 = options.protectedScreens) === null || _options_protectedScreens1 === void 0 ? void 0 : _options_protectedScreens1.has(normalized)));\n\t\t}).map(function(value) {\n\t\t\treturn routeToScreen(value.route, value.props);\n\t\t});\n\t}, [\n\t\tnode === null || node === void 0 ? void 0 : node.children,\n\t\tnode === null || node === void 0 ? void 0 : node.initialRouteName,\n\t\torder,\n\t\toptions === null || options === void 0 ? void 0 : options.protectedScreens\n\t]);\n}\nfunction fromImport(param) {\n\tvar { ErrorBoundary, SuspenseFallback, ...component } = param;\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tvar exported = getPageExport(component);\n\t\tif (exported && typeof exported === \"object\" && Object.keys(exported).length === 0) return {\n\t\t\tdefault: EmptyRoute,\n\t\t\tErrorBoundary,\n\t\t\tSuspenseFallback\n\t\t};\n\t}\n\treturn {\n\t\tdefault: getPageExport(component),\n\t\tErrorBoundary,\n\t\tSuspenseFallback\n\t};\n}\nfunction RouteSuspenseFallback(param) {\n\tvar { component: Component, route } = param;\n\tvar params = useContext(RouteParamsContext);\n\treturn Component ? /* @__PURE__ */ jsx(Component, {\n\t\troute,\n\t\tparams: params !== null && params !== void 0 ? params : {}\n\t}) : null;\n}\nvar qualifiedStore = /* @__PURE__ */ new WeakMap();\nfunction getRouteMatchesForProps() {\n\tvar _ref;\n\tvar _getServerContext;\n\tvar serverMatches = (_ref = (_getServerContext = getServerContext()) === null || _getServerContext === void 0 ? void 0 : _getServerContext.matches) !== null && _ref !== void 0 ? _ref : [];\n\tif (process.env.VITE_ENVIRONMENT === \"ssr\") return serverMatches;\n\tvar clientMatches = getClientMatchesSnapshot();\n\treturn clientMatches.length ? clientMatches : serverMatches;\n}\nfunction getQualifiedRouteComponent(value) {\n\tif (value && qualifiedStore.has(value)) return qualifiedStore.get(value);\n\tvar ScreenComponent = /* @__PURE__ */ React.forwardRef(function(props, ref) {\n\t\tvar _value_children;\n\t\tif (process.env.NODE_ENV === \"development\" && false);\n\t\tif (process.env.NODE_ENV === \"development\" && true) React.useSyncExternalStore(subscribeRouteHmr, getRouteHmrEpoch, getRouteHmrEpoch);\n\t\tvar isSpaShell = useContext(SpaShellContext);\n\t\tvar InheritedSuspenseFallback = useContext(SuspenseFallbackContext);\n\t\tvar matches = getRouteMatchesForProps();\n\t\tif (isSpaShell && props.segment !== \"\") {\n\t\t\tvar _value_children1;\n\t\t\tif (!(((_value_children1 = value.children) === null || _value_children1 === void 0 ? void 0 : _value_children1.length) && (value.layoutRenderMode === \"ssg\" || value.layoutRenderMode === \"ssr\"))) return /* @__PURE__ */ jsx(\"div\", { \"data-one-spa-content\": \"\" });\n\t\t}\n\t\tvar res = fromImport(value.loadRoute());\n\t\tvar Component = res.default || EmptyRoute;\n\t\tvar CatchBoundary = res.ErrorBoundary;\n\t\tvar LayoutSuspenseFallback = value.type === \"layout\" ? res.SuspenseFallback : void 0;\n\t\tvar match = matches.find(function(match2) {\n\t\t\treturn match2.routeId === value.contextKey;\n\t\t}) || (!((_value_children = value.children) === null || _value_children === void 0 ? void 0 : _value_children.length) ? matches[matches.length - 1] : void 0);\n\t\tvar loaderDataProps = match && \"loaderData\" in match ? { loaderData: match.loaderData } : {};\n\t\tif (process.env.NODE_ENV === \"development\" && process.env.DEBUG === \"one\") {\n\t\t\tconsole.groupCollapsed(`Render ${props.key} ${props.segment}`);\n\t\t\tconsole.info(`value`, value);\n\t\t\tconsole.info(`Component`, Component);\n\t\t\tconsole.groupEnd();\n\t\t}\n\t\tvar slotProps = {};\n\t\tif (value.slots && value.slots.size > 0) {\n\t\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\t\ttry {\n\t\t\t\tfor (var _iterator = value.slots[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\t\tvar [slotName] = _step.value;\n\t\t\t\t\tslotProps[slotName] = /* @__PURE__ */ jsx(NamedSlot, {\n\t\t\t\t\t\tname: slotName,\n\t\t\t\t\t\tlayoutContextKey: value.contextKey\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t_didIteratorError = true;\n\t\t\t\t_iteratorError = err;\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t\t} finally {\n\t\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tvar rendered;\n\t\tif (props.segment === \"\") rendered = /* @__PURE__ */ jsx(RootLayoutRenderer, {\n\t\t\tLayoutComponent: Component,\n\t\t\tlayoutProps: {\n\t\t\t\t...props,\n\t\t\t\t...slotProps,\n\t\t\t\t...loaderDataProps\n\t\t\t},\n\t\t\tforwardedRef: ref\n\t\t});\n\t\telse {\n\t\t\tvar page = /* @__PURE__ */ jsx(Component, {\n\t\t\t\t...props,\n\t\t\t\t...slotProps,\n\t\t\t\t...loaderDataProps,\n\t\t\t\tref\n\t\t\t});\n\t\t\trendered = /* @__PURE__ */ jsx(RouteErrorBoundary, {\n\t\t\t\trouteName: value.route,\n\t\t\t\tchildren: CatchBoundary ? /* @__PURE__ */ jsx(Try, {\n\t\t\t\t\tcatch: CatchBoundary,\n\t\t\t\t\tchildren: page\n\t\t\t\t}) : page\n\t\t\t});\n\t\t}\n\t\tif (value.type !== \"layout\") return rendered;\n\t\tvar providedSuspenseFallback = LayoutSuspenseFallback !== null && LayoutSuspenseFallback !== void 0 ? LayoutSuspenseFallback : InheritedSuspenseFallback;\n\t\treturn /* @__PURE__ */ jsx(SuspenseFallbackContext.Provider, {\n\t\t\tvalue: providedSuspenseFallback,\n\t\t\tchildren: LayoutSuspenseFallback ? wrapSuspense(rendered, LayoutSuspenseFallback) : rendered\n\t\t});\n\t});\n\tvar wrapSuspense = function wrapSuspense2(children, SuspenseFallback) {\n\t\tvar fallback = /* @__PURE__ */ jsx(RouteSuspenseFallback, {\n\t\t\tcomponent: SuspenseFallback,\n\t\t\troute: value.contextKey\n\t\t});\n\t\tif (process.env.ONE_SUSPEND_ROUTES_NATIVE === \"0\" || globalThis.__ONE_DISABLE_SUSPENSE_ROUTES__ === true) return children;\n\t\treturn /* @__PURE__ */ jsx(Suspense, {\n\t\t\tfallback,\n\t\t\tchildren\n\t\t});\n\t};\n\tvar QualifiedRoute = /* @__PURE__ */ React.forwardRef(function(param, ref) {\n\t\tvar { route, navigation, ...props } = param;\n\t\tvar InheritedSuspenseFallback = useContext(SuspenseFallbackContext);\n\t\treturn /* @__PURE__ */ jsx(Route, {\n\t\t\troute,\n\t\t\tnode: value,\n\t\t\tchildren: /* @__PURE__ */ jsx(Fragment, { children: wrapSuspense(/* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ScreenComponent, {\n\t\t\t\t...props,\n\t\t\t\tref,\n\t\t\t\tsegment: value.route\n\t\t\t}), process.env.VITE_ENVIRONMENT === \"client\" && value.type !== \"layout\" && navigation && /* @__PURE__ */ jsx(ScrollBehaviorRouteCommit, {})] }), InheritedSuspenseFallback) })\n\t\t});\n\t});\n\tQualifiedRoute.displayName = `Route(${value.route})`;\n\tvar Memoized = /* @__PURE__ */ memo(QualifiedRoute);\n\tqualifiedStore.set(value, Memoized);\n\treturn Memoized;\n}\nfunction createGetIdForRoute(route) {\n\tvar include = /* @__PURE__ */ new Map();\n\tif (route.dynamic) {\n\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\ttry {\n\t\t\tfor (var _iterator = route.dynamic[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\tvar segment = _step.value;\n\t\t\t\tinclude.set(segment.name, segment);\n\t\t\t}\n\t\t} catch (err) {\n\t\t\t_didIteratorError = true;\n\t\t\t_iteratorError = err;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t} finally {\n\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t}\n\t\t}\n\t}\n\treturn function() {\n\t\tvar { params = {} } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};\n\t\tvar _segments_join;\n\t\tvar segments = [];\n\t\tvar _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;\n\t\ttry {\n\t\t\tfor (var _iterator2 = include.values()[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n\t\t\t\tvar dynamic = _step2.value;\n\t\t\t\tvar value = params === null || params === void 0 ? void 0 : params[dynamic.name];\n\t\t\t\tif (Array.isArray(value) && value.length > 0) segments.push(value.join(\"/\"));\n\t\t\t\telse if (value && !Array.isArray(value)) segments.push(value);\n\t\t\t\telse if (dynamic.deep) segments.push(`[...${dynamic.name}]`);\n\t\t\t\telse segments.push(`[${dynamic.name}]`);\n\t\t\t}\n\t\t} catch (err) {\n\t\t\t_didIteratorError2 = true;\n\t\t\t_iteratorError2 = err;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();\n\t\t\t} finally {\n\t\t\t\tif (_didIteratorError2) throw _iteratorError2;\n\t\t\t}\n\t\t}\n\t\treturn (_segments_join = segments.join(\"/\")) !== null && _segments_join !== void 0 ? _segments_join : route.contextKey;\n\t};\n}\nfunction routeToScreen(route) {\n\tvar { options, ...props } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};\n\tvar _props_getId;\n\tvar navigationRouteName = getReactNavigationRouteName(route);\n\treturn /* @__PURE__ */ createElement(Screen, {\n\t\t...props,\n\t\tgetId: (_props_getId = props.getId) !== null && _props_getId !== void 0 ? _props_getId : createGetIdForRoute(route),\n\t\tname: navigationRouteName,\n\t\tkey: navigationRouteName,\n\t\toptions: function options1(args) {\n\t\t\tvar _route_loadRoute;\n\t\t\tvar staticOptions = route.generated ? (_route_loadRoute = route.loadRoute()) === null || _route_loadRoute === void 0 ? void 0 : _route_loadRoute.getNavOptions : null;\n\t\t\tvar staticResult = typeof staticOptions === \"function\" ? staticOptions(args) : staticOptions;\n\t\t\tvar dynamicResult = typeof options === \"function\" ? options === null || options === void 0 ? void 0 : options(args) : options;\n\t\t\tvar output = {\n\t\t\t\t...staticResult,\n\t\t\t\t...dynamicResult\n\t\t\t};\n\t\t\tif (route.generated) {\n\t\t\t\toutput.tabBarButton = function() {\n\t\t\t\t\treturn null;\n\t\t\t\t};\n\t\t\t\toutput.drawerItemStyle = {\n\t\t\t\t\theight: 0,\n\t\t\t\t\tdisplay: \"none\"\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn output;\n\t\t},\n\t\tgetComponent: function getComponent() {\n\t\t\treturn getQualifiedRouteComponent(route);\n\t\t}\n\t});\n}\nvar ROUTE_ERROR_BOUNDARY_INITIAL_STATE = {\n\thasError: false,\n\terror: null,\n\terrorInfo: null\n};\nvar RouteErrorBoundary = /* @__PURE__ */ (function(_React_Component) {\n\t\"use strict\";\n\t_inherits(RouteErrorBoundary2, _React_Component);\n\tfunction RouteErrorBoundary2(props) {\n\t\t_class_call_check(this, RouteErrorBoundary2);\n\t\tvar _this = _call_super(this, RouteErrorBoundary2, [props]);\n\t\t_this.state = ROUTE_ERROR_BOUNDARY_INITIAL_STATE;\n\t\treturn _this;\n\t}\n\t_create_class(RouteErrorBoundary2, [\n\t\t{\n\t\t\tkey: \"componentDidCatch\",\n\t\t\tvalue: function componentDidCatch(error, errorInfo) {\n\t\t\t\tconsole.error(`Error occurred while running route \"${this.props.routeName}\": ${error instanceof Error ? error.message : error}\n\n${error.stack}\n\nComponent Stack:\n${errorInfo.componentStack}`);\n\t\t\t\tthis.setState({ errorInfo });\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tkey: \"clearError\",\n\t\t\tvalue: function clearError() {\n\t\t\t\tthis.setState(ROUTE_ERROR_BOUNDARY_INITIAL_STATE);\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tkey: \"render\",\n\t\t\tvalue: function render() {\n\t\t\t\tif (this.state.hasError) {\n\t\t\t\t\tvar { error, errorInfo } = this.state;\n\t\t\t\t\treturn /* @__PURE__ */ jsx(RouteErrorView, {\n\t\t\t\t\t\trouteName: this.props.routeName,\n\t\t\t\t\t\terror,\n\t\t\t\t\t\terrorInfo,\n\t\t\t\t\t\tonRetry: this.clearError.bind(this)\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn this.props.children;\n\t\t\t}\n\t\t}\n\t], [{\n\t\tkey: \"getDerivedStateFromError\",\n\t\tvalue: function getDerivedStateFromError(error) {\n\t\t\treturn {\n\t\t\t\thasError: true,\n\t\t\t\terror\n\t\t\t};\n\t\t}\n\t}]);\n\treturn RouteErrorBoundary2;\n})(React.Component);\n\nexport { Group, Screen, createGetIdFor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