@wix/himalaya-cli 0.1520.0 → 0.1521.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.
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/webview-page/src/webTransport.d.ts +21 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/webview-page.mjs +223 -1
- package/dist/cli.mjs +1051 -554
- package/dist/preview-assets.generated.bin +0 -0
- package/package.json +2 -2
package/dist/cli.mjs
CHANGED
|
@@ -11758,10 +11758,10 @@ function appBindingIssues(root, ctx, appActions, isNavItemHidden = (at2) => /^to
|
|
|
11758
11758
|
continue;
|
|
11759
11759
|
}
|
|
11760
11760
|
if ((ref.key === "itemsPath" || ref.key === "optionsPath") && ctx?.appState) {
|
|
11761
|
-
const
|
|
11762
|
-
if (
|
|
11761
|
+
const bound2 = initialValue(own3(ctx.appState, parsed.service), parsed.path);
|
|
11762
|
+
if (bound2 !== void 0 && !Array.isArray(bound2)) {
|
|
11763
11763
|
issues.push({
|
|
11764
|
-
...issue2(`${ref.key} "${ref.value}" resolves to ${
|
|
11764
|
+
...issue2(`${ref.key} "${ref.value}" resolves to ${bound2 === null ? "null" : typeof bound2} in the app service's INITIAL state, not an array \u2014 the list renders no rows`),
|
|
11765
11765
|
severity: ref.key === "itemsPath" || strict ? "error" : "warning"
|
|
11766
11766
|
});
|
|
11767
11767
|
}
|
|
@@ -12112,8 +12112,8 @@ function mountable(c2, inTemplate = false) {
|
|
|
12112
12112
|
const pages2 = type === "Carousel" ? props.items : props.pages;
|
|
12113
12113
|
const perPage = Array.isArray(pages2) ? pages2.map((p2) => isComponent(p2) ? mountable(p2) : 0) : [];
|
|
12114
12114
|
const window2 = typeof props.liveWindow === "number" && props.liveWindow > 0 ? Math.floor(props.liveWindow) : 0;
|
|
12115
|
-
const
|
|
12116
|
-
if (
|
|
12115
|
+
const bound2 = type === "Carousel" && hasItemsPath(props);
|
|
12116
|
+
if (bound2) {
|
|
12117
12117
|
const template = perPage[0] ?? 0;
|
|
12118
12118
|
if (template === 0) return 0;
|
|
12119
12119
|
return repeated(window2 > 0 ? template * (2 * window2 + 1) : Infinity);
|
|
@@ -12185,8 +12185,8 @@ function webViewEmbeddedFindings(descriptor) {
|
|
|
12185
12185
|
});
|
|
12186
12186
|
}
|
|
12187
12187
|
if ((bridged || isPerInstance(props)) && !s2.inTemplate) {
|
|
12188
|
-
const
|
|
12189
|
-
const effective = isLiteral(
|
|
12188
|
+
const explicit2 = props.instanceId;
|
|
12189
|
+
const effective = isLiteral(explicit2) ? explicit2 : explicit2 === void 0 || explicit2 === "" ? effectiveWebViewInstanceId(screenId, void 0, s2.id) : null;
|
|
12190
12190
|
if (effective !== null) {
|
|
12191
12191
|
const first = seen.get(effective);
|
|
12192
12192
|
if (first !== void 0) {
|
|
@@ -13300,8 +13300,8 @@ function deviceParityWithheldFrom(root) {
|
|
|
13300
13300
|
function setDefaultEvaluator(evaluator) {
|
|
13301
13301
|
defaultEvaluator = evaluator;
|
|
13302
13302
|
}
|
|
13303
|
-
function resolveEvaluator(
|
|
13304
|
-
const chosen =
|
|
13303
|
+
function resolveEvaluator(explicit2) {
|
|
13304
|
+
const chosen = explicit2 ?? defaultEvaluator;
|
|
13305
13305
|
if (!chosen) {
|
|
13306
13306
|
throw new Error(
|
|
13307
13307
|
"no RealmEvaluator installed \u2014 import validate-descriptor.js (node) or validate-descriptor.browser.js (browser), or pass `evaluator` explicitly"
|
|
@@ -13315,8 +13315,8 @@ function setBootEvaluator(evaluator) {
|
|
|
13315
13315
|
function installedBootEvaluator() {
|
|
13316
13316
|
return bootEvaluator;
|
|
13317
13317
|
}
|
|
13318
|
-
function resolveBootEvaluator(
|
|
13319
|
-
return
|
|
13318
|
+
function resolveBootEvaluator(explicit2) {
|
|
13319
|
+
return explicit2 ?? bootEvaluator ?? resolveEvaluator();
|
|
13320
13320
|
}
|
|
13321
13321
|
function setActionEvaluator(evaluator) {
|
|
13322
13322
|
actionEvaluator = evaluator;
|
|
@@ -13324,8 +13324,8 @@ function setActionEvaluator(evaluator) {
|
|
|
13324
13324
|
function installedActionEvaluator() {
|
|
13325
13325
|
return actionEvaluator;
|
|
13326
13326
|
}
|
|
13327
|
-
function resolveActionEvaluator(
|
|
13328
|
-
return
|
|
13327
|
+
function resolveActionEvaluator(explicit2) {
|
|
13328
|
+
return explicit2 ?? actionEvaluator ?? resolveEvaluator();
|
|
13329
13329
|
}
|
|
13330
13330
|
function responseBytes(value) {
|
|
13331
13331
|
try {
|
|
@@ -15129,13 +15129,13 @@ function validateScreenDescriptor(screenId, descriptor, opts = {}) {
|
|
|
15129
15129
|
if (k2 === "itemsPath" && typeof val === "string") {
|
|
15130
15130
|
const m2 = /^\$service:([A-Za-z0-9_-]+)\.([A-Za-z0-9_.[\]]+)/.exec(val);
|
|
15131
15131
|
if (m2 && m2[1] in services) {
|
|
15132
|
-
const
|
|
15133
|
-
if (
|
|
15132
|
+
const bound2 = pathValue(services[m2[1]], m2[2]);
|
|
15133
|
+
if (bound2 !== void 0 && !Array.isArray(bound2)) {
|
|
15134
15134
|
issues.push({
|
|
15135
15135
|
severity: "error",
|
|
15136
15136
|
pass: "bindings",
|
|
15137
15137
|
path: here,
|
|
15138
|
-
message: `itemsPath must bind to an array \u2014 $service:${m2[1]}.${m2[2]} is ${
|
|
15138
|
+
message: `itemsPath must bind to an array \u2014 $service:${m2[1]}.${m2[2]} is ${bound2 === null ? "null" : typeof bound2} in the bundle's initial state; initialize it as [] (see the dynamic-list recipe: himi docs recipe-dynamic-list)`
|
|
15139
15139
|
});
|
|
15140
15140
|
}
|
|
15141
15141
|
}
|
|
@@ -15208,13 +15208,13 @@ function validateScreenDescriptor(screenId, descriptor, opts = {}) {
|
|
|
15208
15208
|
if (OPTIONS_BINDING_PROPS.has(k2) && typeof val === "string") {
|
|
15209
15209
|
const mm = /^\$service:([A-Za-z0-9_-]+)\.([A-Za-z0-9_.[\]]+)/.exec(val);
|
|
15210
15210
|
if (mm && mm[1] in services) {
|
|
15211
|
-
const
|
|
15212
|
-
if (
|
|
15211
|
+
const bound2 = pathValue(services[mm[1]], mm[2]);
|
|
15212
|
+
if (bound2 !== void 0 && !Array.isArray(bound2)) {
|
|
15213
15213
|
issues.push({
|
|
15214
15214
|
severity: strict ? "error" : "warning",
|
|
15215
15215
|
pass: "bindings",
|
|
15216
15216
|
path: here,
|
|
15217
|
-
message: `\`${k2}\` must bind to a list of options \u2014 $service:${mm[1]}.${mm[2]} is ${
|
|
15217
|
+
message: `\`${k2}\` must bind to a list of options \u2014 $service:${mm[1]}.${mm[2]} is ${bound2 === null ? "null" : typeof bound2} in the bundle's initial state, so the component renders no bound options on device (it silently keeps its static list). Initialize it as \`[]\` and populate it in an action (see the dynamic-list recipe: himi docs recipe-dynamic-list).`
|
|
15218
15218
|
});
|
|
15219
15219
|
}
|
|
15220
15220
|
}
|
|
@@ -29786,8 +29786,8 @@ function resolveServeBase() {
|
|
|
29786
29786
|
return (raw ?? "").replace(/\/$/, "");
|
|
29787
29787
|
}
|
|
29788
29788
|
function resolvePlaneControlReadBase() {
|
|
29789
|
-
const
|
|
29790
|
-
if (
|
|
29789
|
+
const explicit2 = process.env.HIMALAYA_PLAYER_CONTROL_URL;
|
|
29790
|
+
if (explicit2) return explicit2.replace(/\/$/, "");
|
|
29791
29791
|
const override = process.env.HIMALAYA_PLAYER_SERVE_URL;
|
|
29792
29792
|
if (override) {
|
|
29793
29793
|
const base = resolveServeBase();
|
|
@@ -31104,10 +31104,10 @@ function servicePath(binding2) {
|
|
|
31104
31104
|
}
|
|
31105
31105
|
function useResolvedScalar(v2, ctx) {
|
|
31106
31106
|
const isService = typeof v2 === "string" && isBinding(v2) && v2.startsWith("$service:");
|
|
31107
|
-
const
|
|
31107
|
+
const bound2 = useBoundValue(ctx, isService ? v2 : "");
|
|
31108
31108
|
if (!isService) return resolveScalarStatic(v2, ctx);
|
|
31109
31109
|
if (!ctx.provider) return void 0;
|
|
31110
|
-
return
|
|
31110
|
+
return bound2 ?? void 0;
|
|
31111
31111
|
}
|
|
31112
31112
|
function useBoundValue(ctx, binding2) {
|
|
31113
31113
|
const path2 = servicePath(binding2);
|
|
@@ -31182,8 +31182,8 @@ var init_bindings2 = __esm({
|
|
|
31182
31182
|
};
|
|
31183
31183
|
BoundList = ({ ctx, itemsPath, template, renderRow }) => {
|
|
31184
31184
|
const local = itemsPath.startsWith("$item.");
|
|
31185
|
-
const
|
|
31186
|
-
const arr2 = local ? ctx.itemScope?.[itemsPath.slice("$item.".length)] :
|
|
31185
|
+
const bound2 = useBoundValue(ctx, local ? "" : itemsPath);
|
|
31186
|
+
const arr2 = local ? ctx.itemScope?.[itemsPath.slice("$item.".length)] : bound2;
|
|
31187
31187
|
const items = Array.isArray(arr2) ? arr2 : [];
|
|
31188
31188
|
return /* @__PURE__ */ jsx3(Fragment, { children: items.map((item, i2) => {
|
|
31189
31189
|
const scope2 = item && typeof item === "object" ? { ...item, __index: i2 } : { value: item, __index: i2 };
|
|
@@ -31348,10 +31348,10 @@ function clampDateFieldValue(encoded2, minUnix, maxUnix, mode) {
|
|
|
31348
31348
|
return String(clampDateUnix(Number(encoded2), minUnix, maxUnix, mode));
|
|
31349
31349
|
}
|
|
31350
31350
|
function clampDateUnix(unix, minUnix, maxUnix, mode) {
|
|
31351
|
-
const onDay = (
|
|
31352
|
-
if (typeof
|
|
31353
|
-
if (mode !== "time") return
|
|
31354
|
-
const b2 = new Date(
|
|
31351
|
+
const onDay = (bound2) => {
|
|
31352
|
+
if (typeof bound2 !== "number") return null;
|
|
31353
|
+
if (mode !== "time") return bound2;
|
|
31354
|
+
const b2 = new Date(bound2 * 1e3);
|
|
31355
31355
|
const d2 = new Date(unix * 1e3);
|
|
31356
31356
|
d2.setHours(b2.getHours(), b2.getMinutes(), b2.getSeconds(), 0);
|
|
31357
31357
|
return Math.floor(d2.getTime() / 1e3);
|
|
@@ -33069,8 +33069,8 @@ var init_controls = __esm({
|
|
|
33069
33069
|
rowShareFloor = (style, rowStretch, floor2) => rowStretch ? { ...style, minWidth: floor2 } : style;
|
|
33070
33070
|
A11ySwitch = ({ props, ctx, wrap }) => {
|
|
33071
33071
|
const C2 = ctx.color;
|
|
33072
|
-
const
|
|
33073
|
-
const resolved2 = ctx.empty ? false : props.valuePath != null ? encodeToggleFieldValue(
|
|
33072
|
+
const bound2 = useResolvedScalar(props.valuePath, ctx);
|
|
33073
|
+
const resolved2 = ctx.empty ? false : props.valuePath != null ? encodeToggleFieldValue(bound2) === "true" : encodeToggleFieldValue(props.value, props.on === true) === "true";
|
|
33074
33074
|
const bag = React7.useContext(FormValuesContext);
|
|
33075
33075
|
const fieldId = props.__formFieldId;
|
|
33076
33076
|
const inForm = Boolean(bag && fieldId);
|
|
@@ -33081,7 +33081,7 @@ var init_controls = __esm({
|
|
|
33081
33081
|
setFormOn(null);
|
|
33082
33082
|
}, [resolved2]);
|
|
33083
33083
|
const toggleServiceBound = typeof props.valuePath === "string" && props.valuePath.startsWith("$service:");
|
|
33084
|
-
const toggleReady = !toggleServiceBound ||
|
|
33084
|
+
const toggleReady = !toggleServiceBound || bound2 !== void 0;
|
|
33085
33085
|
React7.useEffect(() => {
|
|
33086
33086
|
if (!bag || !fieldId) return;
|
|
33087
33087
|
if (!toggleReady && !hasContributed(bag, fieldId)) return;
|
|
@@ -33145,18 +33145,18 @@ var init_controls = __esm({
|
|
|
33145
33145
|
const min = props.min ?? 0, max = props.max ?? 1;
|
|
33146
33146
|
const boundValue = useResolvedScalar(props.valuePath, ctx);
|
|
33147
33147
|
const raw = props.valuePath != null ? boundValue : props.value;
|
|
33148
|
-
const
|
|
33148
|
+
const bound2 = typeof raw === "number" ? raw : (min + max) / 2;
|
|
33149
33149
|
const tint = C2(props.tint ?? "accentPrimary", "#116DFF");
|
|
33150
33150
|
const step = typeof props.step === "number" && props.step > 0 ? props.step : (max - min) / 100 || 0.01;
|
|
33151
33151
|
const range = props.range === true && typeof props.upperValue === "number";
|
|
33152
|
-
const [val, setVal] = React7.useState(
|
|
33153
|
-
const latestValue = React7.useRef(
|
|
33152
|
+
const [val, setVal] = React7.useState(bound2);
|
|
33153
|
+
const latestValue = React7.useRef(bound2);
|
|
33154
33154
|
const dragging = React7.useRef(false);
|
|
33155
33155
|
React7.useEffect(() => {
|
|
33156
33156
|
if (dragging.current) return;
|
|
33157
|
-
latestValue.current =
|
|
33158
|
-
setVal(
|
|
33159
|
-
}, [
|
|
33157
|
+
latestValue.current = bound2;
|
|
33158
|
+
setVal(bound2);
|
|
33159
|
+
}, [bound2]);
|
|
33160
33160
|
const lastEmit = React7.useRef(void 0);
|
|
33161
33161
|
const canFire = !!(ctx.onAction && props.onChange && !props.disabled);
|
|
33162
33162
|
const commit = (nv) => {
|
|
@@ -33167,10 +33167,10 @@ var init_controls = __esm({
|
|
|
33167
33167
|
ctx.onAction({ ...act, args: { ...act.args ?? {}, value: nv } });
|
|
33168
33168
|
};
|
|
33169
33169
|
const clampPct = (n2) => max > min ? Math.max(0, Math.min(1, (n2 - min) / (max - min))) : 0;
|
|
33170
|
-
const [pair, setPair] = React7.useState(() => [Math.min(
|
|
33170
|
+
const [pair, setPair] = React7.useState(() => [Math.min(bound2, props.upperValue ?? bound2), Math.max(bound2, props.upperValue ?? bound2)]);
|
|
33171
33171
|
React7.useEffect(() => {
|
|
33172
|
-
if (range) setPair([Math.min(
|
|
33173
|
-
}, [range,
|
|
33172
|
+
if (range) setPair([Math.min(bound2, props.upperValue), Math.max(bound2, props.upperValue)]);
|
|
33173
|
+
}, [range, bound2, props.upperValue]);
|
|
33174
33174
|
if (range) {
|
|
33175
33175
|
const [lo2, hi2] = pair;
|
|
33176
33176
|
const thumbKey = (which) => (e2) => {
|
|
@@ -33407,8 +33407,8 @@ var init_controls = __esm({
|
|
|
33407
33407
|
}
|
|
33408
33408
|
return value;
|
|
33409
33409
|
};
|
|
33410
|
-
tabsActiveColorName = (raw,
|
|
33411
|
-
const name = typeof raw === "string" && isBinding(raw) ?
|
|
33410
|
+
tabsActiveColorName = (raw, bound2) => {
|
|
33411
|
+
const name = typeof raw === "string" && isBinding(raw) ? bound2 : raw;
|
|
33412
33412
|
return typeof name === "string" && name.trim() ? name.trim() : void 0;
|
|
33413
33413
|
};
|
|
33414
33414
|
swipeTabPage = (pages2, tabId) => {
|
|
@@ -35022,6 +35022,448 @@ var init_pdfFetch = __esm({
|
|
|
35022
35022
|
}
|
|
35023
35023
|
});
|
|
35024
35024
|
|
|
35025
|
+
// ../../core/web-renderer/src/webviewBridge.ts
|
|
35026
|
+
function canonicalJson2(value, path2 = /* @__PURE__ */ new Set()) {
|
|
35027
|
+
if (value === null || typeof value === "boolean" || typeof value === "string") return JSON.stringify(value);
|
|
35028
|
+
if (typeof value === "number") {
|
|
35029
|
+
if (!Number.isFinite(value)) throw new TypeError(`canonicalJson: ${value} is not representable in JSON`);
|
|
35030
|
+
return String(value);
|
|
35031
|
+
}
|
|
35032
|
+
if (typeof value !== "object") throw new TypeError(`canonicalJson: a ${typeof value} is not JSON data`);
|
|
35033
|
+
if (path2.has(value)) throw new TypeError("canonicalJson: a cyclic value is not JSON data");
|
|
35034
|
+
path2.add(value);
|
|
35035
|
+
try {
|
|
35036
|
+
if (Array.isArray(value)) {
|
|
35037
|
+
const parts = [];
|
|
35038
|
+
for (let i2 = 0; i2 < value.length; i2++) {
|
|
35039
|
+
if (!(i2 in value) || value[i2] === void 0) throw new TypeError(`canonicalJson: array element ${i2} is not JSON data`);
|
|
35040
|
+
parts.push(canonicalJson2(value[i2], path2));
|
|
35041
|
+
}
|
|
35042
|
+
return `[${parts.join(",")}]`;
|
|
35043
|
+
}
|
|
35044
|
+
const proto = Object.getPrototypeOf(value);
|
|
35045
|
+
if (proto !== Object.prototype && proto !== null) throw new TypeError("canonicalJson: not a plain object");
|
|
35046
|
+
const rec = value;
|
|
35047
|
+
const keys = Object.keys(rec).filter((k2) => rec[k2] !== void 0).sort(byCodeUnit2);
|
|
35048
|
+
return `{${keys.map((k2) => `${JSON.stringify(k2)}:${canonicalJson2(rec[k2], path2)}`).join(",")}}`;
|
|
35049
|
+
} finally {
|
|
35050
|
+
path2.delete(value);
|
|
35051
|
+
}
|
|
35052
|
+
}
|
|
35053
|
+
function canonicalScreenArgs2(args) {
|
|
35054
|
+
if (!args) return "";
|
|
35055
|
+
return Object.keys(args).filter((k2) => args[k2] !== void 0).sort(byCodeUnit2).map((k2) => `${encodeURIComponent(k2)}=${encodeURIComponent(canonicalJson2(args[k2]))}`).join("&");
|
|
35056
|
+
}
|
|
35057
|
+
function effectiveWebViewInstanceId2(screenId, args, componentId, explicitInstanceId) {
|
|
35058
|
+
if (typeof explicitInstanceId === "string" && explicitInstanceId !== "") return explicitInstanceId;
|
|
35059
|
+
return `${screenId}?${canonicalScreenArgs2(args)}/${componentId}`;
|
|
35060
|
+
}
|
|
35061
|
+
function webViewBridgePlan(input) {
|
|
35062
|
+
if (input.inlineHtml != null && input.inlineHtml !== "") return { bridged: false, reason: "web_srcdoc_unbridged" };
|
|
35063
|
+
const pageOrigin = input.pageOrigin === void 0 ? currentOrigin() : input.pageOrigin;
|
|
35064
|
+
const target = input.url ? classifyEmbedUrl(input.url, pageOrigin) : null;
|
|
35065
|
+
if (!target || !target.crossOrigin || target.protocol !== "https:" && target.protocol !== "http:") {
|
|
35066
|
+
return { bridged: false, reason: "web_url_same_origin_unbridged" };
|
|
35067
|
+
}
|
|
35068
|
+
const origin = new URL(target.href).origin;
|
|
35069
|
+
if (input.allowedOrigins.length === 0 || !webViewOriginAllowed(input.url ?? "", input.allowedOrigins)) {
|
|
35070
|
+
return { bridged: false, reason: "web_url_not_app_controlled" };
|
|
35071
|
+
}
|
|
35072
|
+
return { bridged: true, trustOrigin: origin };
|
|
35073
|
+
}
|
|
35074
|
+
function webViewBridgeLimits(security) {
|
|
35075
|
+
const sec = security && typeof security === "object" ? security : {};
|
|
35076
|
+
const base = sec.profile === "app_content" ? APP_CONTENT_LIMITS : FLOOR_LIMITS;
|
|
35077
|
+
return {
|
|
35078
|
+
maxCalls: explicit(sec.rateLimitMaxCalls, base.maxCalls),
|
|
35079
|
+
windowMs: explicit(sec.rateLimitWindowMs, base.windowMs),
|
|
35080
|
+
maxStringLength: explicit(sec.maxArgStringLength, base.maxStringLength),
|
|
35081
|
+
maxDepth: explicit(sec.maxArgDepth, base.maxDepth),
|
|
35082
|
+
maxBytes: explicit(sec.maxMessageBytes, base.maxBytes),
|
|
35083
|
+
allowsLineBreaks: base.allowsLineBreaks
|
|
35084
|
+
};
|
|
35085
|
+
}
|
|
35086
|
+
function admitRaw(raw, limits, callTimes, now) {
|
|
35087
|
+
while (callTimes.length > 0 && callTimes[0] < now - limits.windowMs) callTimes.shift();
|
|
35088
|
+
if (callTimes.length >= limits.maxCalls) return "rate_limit";
|
|
35089
|
+
callTimes.push(now);
|
|
35090
|
+
if (utf83(raw) > limits.maxBytes) return "too_large";
|
|
35091
|
+
return null;
|
|
35092
|
+
}
|
|
35093
|
+
function containsUnsafe(s2, allowsLineBreaks) {
|
|
35094
|
+
const lower = s2.toLowerCase();
|
|
35095
|
+
if (lower.includes("<script") || lower.includes("</script")) return true;
|
|
35096
|
+
for (let i2 = 0; i2 < s2.length; i2++) {
|
|
35097
|
+
const c2 = s2.charCodeAt(i2);
|
|
35098
|
+
if (c2 === 9 || allowsLineBreaks && (c2 === 10 || c2 === 13)) continue;
|
|
35099
|
+
if (c2 < 32 || c2 === 127) return true;
|
|
35100
|
+
if (c2 >= 8234 && c2 <= 8238 || c2 >= 8294 && c2 <= 8297) return true;
|
|
35101
|
+
}
|
|
35102
|
+
return false;
|
|
35103
|
+
}
|
|
35104
|
+
function argsClean(value, depth, limits) {
|
|
35105
|
+
if (depth > limits.maxDepth) return false;
|
|
35106
|
+
if (typeof value === "string") return value.length <= limits.maxStringLength && !containsUnsafe(value, limits.allowsLineBreaks);
|
|
35107
|
+
if (Array.isArray(value)) return value.every((v2) => argsClean(v2, depth + 1, limits));
|
|
35108
|
+
if (value && typeof value === "object") return Object.values(value).every((v2) => argsClean(v2, depth + 1, limits));
|
|
35109
|
+
return true;
|
|
35110
|
+
}
|
|
35111
|
+
function judged(payload) {
|
|
35112
|
+
if (typeof payload !== "string") return payload;
|
|
35113
|
+
try {
|
|
35114
|
+
return JSON.parse(payload);
|
|
35115
|
+
} catch {
|
|
35116
|
+
return payload;
|
|
35117
|
+
}
|
|
35118
|
+
}
|
|
35119
|
+
function pagePayloadJson(payload) {
|
|
35120
|
+
if (payload === void 0 || payload === null) return "null";
|
|
35121
|
+
return typeof payload === "string" ? payload : JSON.stringify(payload);
|
|
35122
|
+
}
|
|
35123
|
+
function scrubKind(kind) {
|
|
35124
|
+
return kind.slice(0, 64).replace(/[\u0000-\u001f\u007f\u202a-\u202e\u2066-\u2069]/g, "");
|
|
35125
|
+
}
|
|
35126
|
+
function isConsoleEnvelope(payload) {
|
|
35127
|
+
const j2 = judged(payload);
|
|
35128
|
+
return !!j2 && typeof j2 === "object" && !Array.isArray(j2) && j2.sys === "console";
|
|
35129
|
+
}
|
|
35130
|
+
function consoleArgLength(limits) {
|
|
35131
|
+
return Math.min(limits.maxStringLength, Math.max(16, Math.floor(limits.maxBytes / (CONSOLE_MAX_ARGS * 6))));
|
|
35132
|
+
}
|
|
35133
|
+
function admitConsole(budget, now) {
|
|
35134
|
+
while (budget.consoleTimes.length > 0 && budget.consoleTimes[0] <= now - 1e3) budget.consoleTimes.shift();
|
|
35135
|
+
if (budget.consoleTimes.length >= CONSOLE_MAX_PER_SECOND) {
|
|
35136
|
+
budget.consoleDropped++;
|
|
35137
|
+
return false;
|
|
35138
|
+
}
|
|
35139
|
+
budget.consoleTimes.push(now);
|
|
35140
|
+
return true;
|
|
35141
|
+
}
|
|
35142
|
+
function lifecycleEnvelope(instanceId, state, detail) {
|
|
35143
|
+
return JSON.stringify(detail === void 0 ? { iid: instanceId, state, sys: "lifecycle", v: 1 } : { detail, iid: instanceId, state, sys: "lifecycle", v: 1 });
|
|
35144
|
+
}
|
|
35145
|
+
var byCodeUnit2, FLOOR_LIMITS, APP_CONTENT_LIMITS, explicit, utf83, CONSOLE_MAX_PER_SECOND, CONSOLE_MAX_ARGS, ANNOUNCE, PORT, HOST_CONTROL, MAX_HELD, MAX_REPORTED, WebViewBridgeSession;
|
|
35146
|
+
var init_webviewBridge = __esm({
|
|
35147
|
+
"../../core/web-renderer/src/webviewBridge.ts"() {
|
|
35148
|
+
init_webviewFrame();
|
|
35149
|
+
byCodeUnit2 = (a2, b2) => a2 < b2 ? -1 : a2 > b2 ? 1 : 0;
|
|
35150
|
+
FLOOR_LIMITS = { maxCalls: 50, windowMs: 1e3, maxStringLength: 2048, maxDepth: 10, maxBytes: 1048576, allowsLineBreaks: false };
|
|
35151
|
+
APP_CONTENT_LIMITS = { maxCalls: 200, windowMs: 1e3, maxStringLength: 262144, maxDepth: 32, maxBytes: 4194304, allowsLineBreaks: true };
|
|
35152
|
+
explicit = (v2, base) => typeof v2 === "number" && Number.isFinite(v2) ? v2 : base;
|
|
35153
|
+
utf83 = (s2) => new TextEncoder().encode(s2).byteLength;
|
|
35154
|
+
CONSOLE_MAX_PER_SECOND = 20;
|
|
35155
|
+
CONSOLE_MAX_ARGS = 16;
|
|
35156
|
+
ANNOUNCE = "webview.announce";
|
|
35157
|
+
PORT = "webview.port";
|
|
35158
|
+
HOST_CONTROL = "webview.host";
|
|
35159
|
+
MAX_HELD = 64;
|
|
35160
|
+
MAX_REPORTED = 32;
|
|
35161
|
+
WebViewBridgeSession = class {
|
|
35162
|
+
constructor(opts) {
|
|
35163
|
+
this.opts = opts;
|
|
35164
|
+
this.active = opts.active !== false;
|
|
35165
|
+
this.muted = opts.muted === true;
|
|
35166
|
+
}
|
|
35167
|
+
registration = null;
|
|
35168
|
+
port = null;
|
|
35169
|
+
boundDoc = null;
|
|
35170
|
+
held = [];
|
|
35171
|
+
loaded = false;
|
|
35172
|
+
active;
|
|
35173
|
+
muted;
|
|
35174
|
+
stopped = false;
|
|
35175
|
+
everBound = false;
|
|
35176
|
+
boundTo = null;
|
|
35177
|
+
reported = /* @__PURE__ */ new Set();
|
|
35178
|
+
onWindowMessage = (event) => this.announce(event);
|
|
35179
|
+
get instanceId() {
|
|
35180
|
+
return this.opts.instanceId;
|
|
35181
|
+
}
|
|
35182
|
+
get bridged() {
|
|
35183
|
+
return this.opts.plan.bridged;
|
|
35184
|
+
}
|
|
35185
|
+
/** Whether a page document ever took a port from this session (it then holds it, and stops announcing). */
|
|
35186
|
+
get hasBoundPage() {
|
|
35187
|
+
return this.everBound;
|
|
35188
|
+
}
|
|
35189
|
+
/** The frame window whose page holds this session's latest port (`null` if none ever bound). */
|
|
35190
|
+
get boundWindow() {
|
|
35191
|
+
return this.boundTo;
|
|
35192
|
+
}
|
|
35193
|
+
/** Mount: register with the worker's hub, tell it `mounted` (with the reason when unbridged), and
|
|
35194
|
+
* start listening for the page's announce. */
|
|
35195
|
+
start() {
|
|
35196
|
+
const { channel: channel3, instanceId, plan } = this.opts;
|
|
35197
|
+
const registration = channel3.register(instanceId, (json8) => this.toPage(json8));
|
|
35198
|
+
this.registration = registration;
|
|
35199
|
+
channel3.deliverLifecycle(instanceId, registration.replacedLive ? lifecycleEnvelope(instanceId, "reloaded") : lifecycleEnvelope(instanceId, "mounted", plan.bridged ? { bridged: true } : { bridged: false, reason: plan.reason }));
|
|
35200
|
+
if (!this.active) channel3.deliverLifecycle(instanceId, lifecycleEnvelope(instanceId, "inactive"));
|
|
35201
|
+
if (plan.bridged) this.opts.win.addEventListener("message", this.onWindowMessage);
|
|
35202
|
+
}
|
|
35203
|
+
/** The iframe's `load`. Only the first one of a document epoch is `loaded`: an in-frame navigation
|
|
35204
|
+
* loads again, and that new document is announced (`reloaded`) when it binds its port. */
|
|
35205
|
+
frameLoaded() {
|
|
35206
|
+
if (this.stopped || this.loaded) return;
|
|
35207
|
+
this.loaded = true;
|
|
35208
|
+
this.opts.channel.deliverLifecycle(this.opts.instanceId, lifecycleEnvelope(this.opts.instanceId, "loaded"));
|
|
35209
|
+
}
|
|
35210
|
+
/** `active_path` changed. */
|
|
35211
|
+
setActive(active) {
|
|
35212
|
+
if (this.stopped || active === this.active) return;
|
|
35213
|
+
this.active = active;
|
|
35214
|
+
this.control("active", active);
|
|
35215
|
+
this.opts.channel.deliverLifecycle(this.opts.instanceId, lifecycleEnvelope(this.opts.instanceId, active ? "active" : "inactive"));
|
|
35216
|
+
}
|
|
35217
|
+
/** `muted_path` changed: the page-side muted sweep, best effort. */
|
|
35218
|
+
setMuted(muted) {
|
|
35219
|
+
if (this.stopped || muted === this.muted) return;
|
|
35220
|
+
this.muted = muted;
|
|
35221
|
+
this.control("muted", muted);
|
|
35222
|
+
}
|
|
35223
|
+
/** `reload_key_path` changed: the caller remounts the iframe; this ends the old document. */
|
|
35224
|
+
reloaded() {
|
|
35225
|
+
if (this.stopped) return;
|
|
35226
|
+
this.closePort();
|
|
35227
|
+
this.boundDoc = null;
|
|
35228
|
+
this.held = [];
|
|
35229
|
+
this.loaded = false;
|
|
35230
|
+
this.opts.channel.deliverLifecycle(this.opts.instanceId, lifecycleEnvelope(this.opts.instanceId, "reloaded"));
|
|
35231
|
+
}
|
|
35232
|
+
/** Unmount: close the port, unregister (THIS registration only) and tell the worker. */
|
|
35233
|
+
stop() {
|
|
35234
|
+
if (this.stopped) return;
|
|
35235
|
+
this.stopped = true;
|
|
35236
|
+
this.opts.win.removeEventListener("message", this.onWindowMessage);
|
|
35237
|
+
this.closePort();
|
|
35238
|
+
this.held = [];
|
|
35239
|
+
const still = this.registration?.unregister() ?? false;
|
|
35240
|
+
this.registration = null;
|
|
35241
|
+
if (still) this.opts.channel.deliverLifecycle(this.opts.instanceId, lifecycleEnvelope(this.opts.instanceId, "unmounted"));
|
|
35242
|
+
}
|
|
35243
|
+
// ── page handshake ──
|
|
35244
|
+
announce(event) {
|
|
35245
|
+
if (this.stopped || !this.opts.plan.bridged) return;
|
|
35246
|
+
const frame = this.opts.frameWindow();
|
|
35247
|
+
if (!frame || event.source !== frame) return;
|
|
35248
|
+
const data = event.data;
|
|
35249
|
+
if (!data || typeof data !== "object" || data.himalaya !== ANNOUNCE || data.v !== 1) return;
|
|
35250
|
+
const doc = typeof data.doc === "string" && data.doc.length > 0 && data.doc.length <= 64 ? data.doc : null;
|
|
35251
|
+
if (!doc) return;
|
|
35252
|
+
if (event.origin !== this.opts.plan.trustOrigin) {
|
|
35253
|
+
this.deny("untrusted_origin", `origin ${event.origin}`, "-");
|
|
35254
|
+
return;
|
|
35255
|
+
}
|
|
35256
|
+
if (doc === this.boundDoc) return;
|
|
35257
|
+
if (this.port) {
|
|
35258
|
+
this.closePort();
|
|
35259
|
+
this.loaded = false;
|
|
35260
|
+
this.opts.channel.deliverLifecycle(this.opts.instanceId, lifecycleEnvelope(this.opts.instanceId, "reloaded"));
|
|
35261
|
+
}
|
|
35262
|
+
const channel3 = this.opts.createChannel?.() ?? new MessageChannel();
|
|
35263
|
+
const port = channel3.port1;
|
|
35264
|
+
port.onmessage = (e2) => this.fromPage(e2.data);
|
|
35265
|
+
port.start?.();
|
|
35266
|
+
this.port = port;
|
|
35267
|
+
this.boundDoc = doc;
|
|
35268
|
+
this.everBound = true;
|
|
35269
|
+
this.boundTo = frame;
|
|
35270
|
+
const hello = {
|
|
35271
|
+
himalaya: PORT,
|
|
35272
|
+
v: 1,
|
|
35273
|
+
doc,
|
|
35274
|
+
active: this.active,
|
|
35275
|
+
muted: this.muted,
|
|
35276
|
+
console: this.opts.consoleForwarding ? { maxArgs: CONSOLE_MAX_ARGS, argLength: consoleArgLength(this.opts.limits) } : null
|
|
35277
|
+
};
|
|
35278
|
+
try {
|
|
35279
|
+
frame.postMessage(hello, this.opts.plan.trustOrigin, [channel3.port2]);
|
|
35280
|
+
} catch {
|
|
35281
|
+
this.closePort();
|
|
35282
|
+
this.boundDoc = null;
|
|
35283
|
+
return;
|
|
35284
|
+
}
|
|
35285
|
+
const held = this.held;
|
|
35286
|
+
this.held = [];
|
|
35287
|
+
for (const json8 of held) this.toPage(json8);
|
|
35288
|
+
}
|
|
35289
|
+
// ── page → worker ──
|
|
35290
|
+
fromPage(raw) {
|
|
35291
|
+
if (this.stopped || !this.port) return;
|
|
35292
|
+
const { channel: channel3, instanceId, limits } = this.opts;
|
|
35293
|
+
if (typeof raw !== "string") {
|
|
35294
|
+
this.deny("unsafe_args", "non-string");
|
|
35295
|
+
return;
|
|
35296
|
+
}
|
|
35297
|
+
const budget = channel3.budget(instanceId);
|
|
35298
|
+
const now = this.opts.now?.() ?? Date.now();
|
|
35299
|
+
const rejected = admitRaw(raw, limits, budget.callTimes, now);
|
|
35300
|
+
if (rejected) {
|
|
35301
|
+
this.deny(rejected, rejected);
|
|
35302
|
+
return;
|
|
35303
|
+
}
|
|
35304
|
+
let msg;
|
|
35305
|
+
try {
|
|
35306
|
+
msg = JSON.parse(raw);
|
|
35307
|
+
} catch {
|
|
35308
|
+
this.deny("unsafe_args", "unparsable");
|
|
35309
|
+
return;
|
|
35310
|
+
}
|
|
35311
|
+
if (!msg || typeof msg !== "object" || Array.isArray(msg)) {
|
|
35312
|
+
this.deny("unsafe_args", "not-object");
|
|
35313
|
+
return;
|
|
35314
|
+
}
|
|
35315
|
+
const kind = typeof msg.kind === "string" ? msg.kind : "";
|
|
35316
|
+
if (kind !== "worker.message") {
|
|
35317
|
+
const shown2 = scrubKind(kind);
|
|
35318
|
+
this.deny("bridged_action_path", `kind ${shown2}`, shown2);
|
|
35319
|
+
return;
|
|
35320
|
+
}
|
|
35321
|
+
const payload = msg.payload;
|
|
35322
|
+
const consoleLine = isConsoleEnvelope(payload);
|
|
35323
|
+
if (consoleLine && !this.opts.consoleForwarding) return;
|
|
35324
|
+
if (consoleLine && !admitConsole(budget, now)) return;
|
|
35325
|
+
if (consoleLine) budget.callTimes.pop();
|
|
35326
|
+
const parsed = typeof payload === "string" ? judged(payload) : void 0;
|
|
35327
|
+
if (!argsClean(msg, 0, limits) || parsed !== void 0 && parsed !== payload && !argsClean(parsed, 1, limits)) {
|
|
35328
|
+
this.deny("unsafe_args", "unsafe_args");
|
|
35329
|
+
return;
|
|
35330
|
+
}
|
|
35331
|
+
if (consoleLine) {
|
|
35332
|
+
const env = judged(payload);
|
|
35333
|
+
(this.opts.log ?? ((line) => console.info(line)))(`[himalaya.webview] [${typeof env.level === "string" ? env.level : "log"}] ${JSON.stringify(env.args ?? [])}`);
|
|
35334
|
+
}
|
|
35335
|
+
channel3.deliverMessage(instanceId, pagePayloadJson(payload));
|
|
35336
|
+
}
|
|
35337
|
+
// ── worker → page ──
|
|
35338
|
+
toPage(json8) {
|
|
35339
|
+
if (this.stopped || !this.opts.plan.bridged) return;
|
|
35340
|
+
if (!this.port) {
|
|
35341
|
+
if (this.held.length < MAX_HELD) this.held.push(json8);
|
|
35342
|
+
return;
|
|
35343
|
+
}
|
|
35344
|
+
try {
|
|
35345
|
+
this.port.postMessage(json8);
|
|
35346
|
+
} catch {
|
|
35347
|
+
}
|
|
35348
|
+
}
|
|
35349
|
+
control(op, value) {
|
|
35350
|
+
try {
|
|
35351
|
+
this.port?.postMessage({ himalaya: HOST_CONTROL, v: 1, op, value });
|
|
35352
|
+
} catch {
|
|
35353
|
+
}
|
|
35354
|
+
}
|
|
35355
|
+
closePort() {
|
|
35356
|
+
if (!this.port) return;
|
|
35357
|
+
this.port.onmessage = null;
|
|
35358
|
+
try {
|
|
35359
|
+
this.port.close();
|
|
35360
|
+
} catch {
|
|
35361
|
+
}
|
|
35362
|
+
this.port = null;
|
|
35363
|
+
}
|
|
35364
|
+
/** A refused page message. With `actionId` it is reported as `bridge_call_denied` (native reports the
|
|
35365
|
+
* origin gate and the action-path refusal); the caps (`rate_limit`, `too_large`, `unsafe_args`) are
|
|
35366
|
+
* only logged, as native logs them. Bounded per session either way. */
|
|
35367
|
+
deny(reason, key3, actionId) {
|
|
35368
|
+
const k2 = `${reason}:${key3}`;
|
|
35369
|
+
if (this.reported.size >= MAX_REPORTED || this.reported.has(k2)) return;
|
|
35370
|
+
this.reported.add(k2);
|
|
35371
|
+
if (actionId !== void 0) this.opts.channel.reportDenied(reason, this.opts.instanceId, actionId);
|
|
35372
|
+
else (this.opts.warn ?? ((line) => console.warn(line)))(`[himalaya.webview] message rejected: ${reason} (bridged) iid=${this.opts.instanceId}`);
|
|
35373
|
+
}
|
|
35374
|
+
};
|
|
35375
|
+
}
|
|
35376
|
+
});
|
|
35377
|
+
|
|
35378
|
+
// ../../core/web-renderer/src/webviewBridgeHost.tsx
|
|
35379
|
+
var webviewBridgeHost_exports = {};
|
|
35380
|
+
__export(webviewBridgeHost_exports, {
|
|
35381
|
+
default: () => WebViewBridgeHost
|
|
35382
|
+
});
|
|
35383
|
+
import React10 from "react";
|
|
35384
|
+
function WebViewBridgeHost(p2) {
|
|
35385
|
+
const { channel: channel3, props, ctx } = p2;
|
|
35386
|
+
const explicit2 = useResolvedScalar(props.instanceId, ctx);
|
|
35387
|
+
const explicitId = typeof explicit2 === "string" || typeof explicit2 === "number" ? String(explicit2) : "";
|
|
35388
|
+
const active = useResolvedScalar(bound(props.activePath), ctx) !== false;
|
|
35389
|
+
const muted = useResolvedScalar(bound(props.mutedPath), ctx) === true;
|
|
35390
|
+
const cfg = props.config && typeof props.config === "object" ? props.config : {};
|
|
35391
|
+
const consoleForwarding = cfg.consoleForwarding === true;
|
|
35392
|
+
const security = JSON.stringify(cfg.bridgeSecurity ?? null);
|
|
35393
|
+
const screenArgs = JSON.stringify(ctx.screenArgs ?? null);
|
|
35394
|
+
const source = p2.htmlStr != null ? "\0html" : p2.urlStr ?? "";
|
|
35395
|
+
const origins = p2.allowedOrigins.join("\n");
|
|
35396
|
+
const sessionRef = React10.useRef(null);
|
|
35397
|
+
const live3 = React10.useRef({ active, muted });
|
|
35398
|
+
live3.current = { active, muted };
|
|
35399
|
+
React10.useEffect(() => {
|
|
35400
|
+
if (typeof window === "undefined") return;
|
|
35401
|
+
if (p2.urlStr == null && p2.htmlStr == null) return;
|
|
35402
|
+
let instanceId;
|
|
35403
|
+
try {
|
|
35404
|
+
instanceId = effectiveWebViewInstanceId2(ctx.screenId ?? "", ctx.screenArgs, p2.nodeId ?? "", explicitId || void 0);
|
|
35405
|
+
} catch {
|
|
35406
|
+
return;
|
|
35407
|
+
}
|
|
35408
|
+
const session = new WebViewBridgeSession({
|
|
35409
|
+
instanceId,
|
|
35410
|
+
channel: channel3,
|
|
35411
|
+
plan: webViewBridgePlan({ url: p2.urlStr, inlineHtml: p2.htmlStr, allowedOrigins: p2.allowedOrigins }),
|
|
35412
|
+
limits: webViewBridgeLimits(cfg.bridgeSecurity),
|
|
35413
|
+
consoleForwarding,
|
|
35414
|
+
win: window,
|
|
35415
|
+
frameWindow: () => p2.frameRef.current?.contentWindow ?? null,
|
|
35416
|
+
active: live3.current.active,
|
|
35417
|
+
muted: live3.current.muted
|
|
35418
|
+
});
|
|
35419
|
+
session.start();
|
|
35420
|
+
sessionRef.current = session;
|
|
35421
|
+
p2.load.onLoad = () => session.frameLoaded();
|
|
35422
|
+
const frame = p2.frameRef.current;
|
|
35423
|
+
if (frame && p2.load.boundFrame === frame) {
|
|
35424
|
+
p2.load.boundFrame = null;
|
|
35425
|
+
p2.load.loaded = false;
|
|
35426
|
+
if (frame.getAttribute("src")) frame.setAttribute("src", frame.getAttribute("src"));
|
|
35427
|
+
} else if (p2.load.loaded) {
|
|
35428
|
+
session.frameLoaded();
|
|
35429
|
+
}
|
|
35430
|
+
return () => {
|
|
35431
|
+
const current = p2.frameRef.current;
|
|
35432
|
+
p2.load.boundFrame = session.hasBoundPage && current && current.contentWindow === session.boundWindow ? current : null;
|
|
35433
|
+
session.stop();
|
|
35434
|
+
if (sessionRef.current === session) sessionRef.current = null;
|
|
35435
|
+
p2.load.onLoad = void 0;
|
|
35436
|
+
};
|
|
35437
|
+
}, [channel3, ctx.screenId, screenArgs, p2.nodeId, explicitId, source, origins, security, consoleForwarding]);
|
|
35438
|
+
React10.useEffect(() => {
|
|
35439
|
+
sessionRef.current?.setActive(active);
|
|
35440
|
+
}, [active]);
|
|
35441
|
+
React10.useEffect(() => {
|
|
35442
|
+
sessionRef.current?.setMuted(muted);
|
|
35443
|
+
}, [muted]);
|
|
35444
|
+
const first = React10.useRef(true);
|
|
35445
|
+
useLayoutEffectInBrowser(() => {
|
|
35446
|
+
if (first.current) {
|
|
35447
|
+
first.current = false;
|
|
35448
|
+
return;
|
|
35449
|
+
}
|
|
35450
|
+
p2.load.loaded = false;
|
|
35451
|
+
sessionRef.current?.reloaded();
|
|
35452
|
+
}, [p2.reloadKey, p2.htmlStr]);
|
|
35453
|
+
return null;
|
|
35454
|
+
}
|
|
35455
|
+
var useLayoutEffectInBrowser, bound;
|
|
35456
|
+
var init_webviewBridgeHost = __esm({
|
|
35457
|
+
"../../core/web-renderer/src/webviewBridgeHost.tsx"() {
|
|
35458
|
+
"use strict";
|
|
35459
|
+
init_bindings2();
|
|
35460
|
+
init_helpers();
|
|
35461
|
+
init_webviewBridge();
|
|
35462
|
+
useLayoutEffectInBrowser = typeof globalThis.document === "undefined" ? React10.useEffect : React10.useLayoutEffect;
|
|
35463
|
+
bound = (v2) => typeof v2 === "string" && isBinding(v2) ? v2 : void 0;
|
|
35464
|
+
}
|
|
35465
|
+
});
|
|
35466
|
+
|
|
35025
35467
|
// ../../core/web-renderer/src/pdfPainter.ts
|
|
35026
35468
|
async function paintPdfDocument(document2, container, width = container.clientWidth || 600, startPage = 1, zoomPercent = 100, isCurrent = () => true, onPageCount) {
|
|
35027
35469
|
if (!isCurrent()) return document2.numPages;
|
|
@@ -115630,7 +116072,7 @@ __export(pdfDocument_exports, {
|
|
|
115630
116072
|
PdfDocument: () => PdfDocument,
|
|
115631
116073
|
destroyPdfDocumentLoad: () => destroyPdfDocumentLoad
|
|
115632
116074
|
});
|
|
115633
|
-
import
|
|
116075
|
+
import React11 from "react";
|
|
115634
116076
|
import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
115635
116077
|
async function loadPdfDocument(src, ownerDocument) {
|
|
115636
116078
|
const [pdfjs, pdfWorkerAsset] = await Promise.all([
|
|
@@ -115649,18 +116091,18 @@ async function destroyPdfDocumentLoad(loading) {
|
|
|
115649
116091
|
}
|
|
115650
116092
|
}
|
|
115651
116093
|
function PdfDocument({ src, nativeSrc, title, height, startPage, zoomPercent, style, onPageCount, onFallback, loadDocument = loadPdfDocument }) {
|
|
115652
|
-
const [pages2, setPages] =
|
|
115653
|
-
const [failedRequest, setFailedRequest] =
|
|
116094
|
+
const [pages2, setPages] = React11.useState(0);
|
|
116095
|
+
const [failedRequest, setFailedRequest] = React11.useState(null);
|
|
115654
116096
|
const request = JSON.stringify([src, zoomPercent]);
|
|
115655
116097
|
const failed3 = failedRequest === request;
|
|
115656
|
-
const containerRef =
|
|
115657
|
-
const frameRef =
|
|
115658
|
-
const startPageRef =
|
|
116098
|
+
const containerRef = React11.useRef(null);
|
|
116099
|
+
const frameRef = React11.useRef(null);
|
|
116100
|
+
const startPageRef = React11.useRef(startPage);
|
|
115659
116101
|
startPageRef.current = startPage;
|
|
115660
|
-
|
|
116102
|
+
React11.useEffect(() => {
|
|
115661
116103
|
if (failed3) onFallback?.();
|
|
115662
116104
|
}, [failed3, onFallback]);
|
|
115663
|
-
|
|
116105
|
+
React11.useEffect(() => {
|
|
115664
116106
|
const frame2 = frameRef.current;
|
|
115665
116107
|
const page = Math.min(pages2, Math.max(1, Math.floor(startPage ?? 1) || 1));
|
|
115666
116108
|
const canvas = pages2 ? containerRef.current?.querySelector(`[data-pdf-page="${page}"]`) : null;
|
|
@@ -115669,7 +116111,7 @@ function PdfDocument({ src, nativeSrc, title, height, startPage, zoomPercent, st
|
|
|
115669
116111
|
const scale = frame2.offsetHeight > 0 && box.height > 0 ? box.height / frame2.offsetHeight : 1;
|
|
115670
116112
|
frame2.scrollTop += (canvas.getBoundingClientRect().top - box.top) / scale;
|
|
115671
116113
|
}, [startPage, pages2]);
|
|
115672
|
-
|
|
116114
|
+
React11.useEffect(() => {
|
|
115673
116115
|
let live3 = true;
|
|
115674
116116
|
let loading;
|
|
115675
116117
|
const container = containerRef.current;
|
|
@@ -115731,7 +116173,7 @@ var init_pdfDocument = __esm({
|
|
|
115731
116173
|
});
|
|
115732
116174
|
|
|
115733
116175
|
// ../../core/web-renderer/src/renderNode.tsx
|
|
115734
|
-
import
|
|
116176
|
+
import React12 from "react";
|
|
115735
116177
|
import { createPortal } from "react-dom";
|
|
115736
116178
|
import { Fragment as Fragment4, jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
115737
116179
|
function boundTokenName(path2, fallback, ctx) {
|
|
@@ -115779,6 +116221,7 @@ function makeCtx(tokens2, scheme = "light", opts = {}) {
|
|
|
115779
116221
|
emitTelemetry: opts.emitTelemetry,
|
|
115780
116222
|
assetBaseUrl: opts.assetBaseUrl,
|
|
115781
116223
|
runtimeDegraded: opts.runtimeDegraded,
|
|
116224
|
+
screenArgs: opts.screenArgs,
|
|
115782
116225
|
previewSurface: opts.previewSurface,
|
|
115783
116226
|
debugUnknownComponents: opts.debugUnknownComponents,
|
|
115784
116227
|
appId: opts.appId,
|
|
@@ -115823,8 +116266,8 @@ function isNumericLike(s2) {
|
|
|
115823
116266
|
return NUMERIC_TEXT.test(s2.trim());
|
|
115824
116267
|
}
|
|
115825
116268
|
function useValueSwap(value, enabled) {
|
|
115826
|
-
const prev =
|
|
115827
|
-
const gen =
|
|
116269
|
+
const prev = React12.useRef(value);
|
|
116270
|
+
const gen = React12.useRef(0);
|
|
115828
116271
|
if (prev.current !== value) {
|
|
115829
116272
|
if (enabled && prev.current !== void 0 && value !== void 0) gen.current += 1;
|
|
115830
116273
|
prev.current = value;
|
|
@@ -115892,9 +116335,9 @@ function revealOnFocusStyle(C2) {
|
|
|
115892
116335
|
};
|
|
115893
116336
|
}
|
|
115894
116337
|
function FormFieldLabelIdScope({ render, fieldKey, ...extras }) {
|
|
115895
|
-
const id =
|
|
116338
|
+
const id = React12.useId().replace(/[^A-Za-z0-9_-]/g, "");
|
|
115896
116339
|
const el2 = render(`${fieldKey ? `${fieldKey}-` : ""}auto-${id}`);
|
|
115897
|
-
return Object.keys(extras).length ?
|
|
116340
|
+
return Object.keys(extras).length ? React12.cloneElement(el2, extras) : el2;
|
|
115898
116341
|
}
|
|
115899
116342
|
function formFieldA11y(props) {
|
|
115900
116343
|
const labelledBy = props.__labelledBy;
|
|
@@ -116629,9 +117072,9 @@ function sectionSlot(raw) {
|
|
|
116629
117072
|
}
|
|
116630
117073
|
}
|
|
116631
117074
|
function useLoadingTiming(target, graceMs, floorMs) {
|
|
116632
|
-
const [shown2, setShown] =
|
|
116633
|
-
const loadingSince =
|
|
116634
|
-
|
|
117075
|
+
const [shown2, setShown] = React12.useState(() => target === "loading" && graceMs > 0 ? "pending" : target);
|
|
117076
|
+
const loadingSince = React12.useRef(shown2 === "loading" ? Date.now() : null);
|
|
117077
|
+
React12.useEffect(() => {
|
|
116635
117078
|
if (target === shown2) return void 0;
|
|
116636
117079
|
if (target === "loading") {
|
|
116637
117080
|
if (graceMs <= 0) {
|
|
@@ -116670,8 +117113,8 @@ function autoGrowBox(contentHeight, lineHeight, verticalPadding, maxLines) {
|
|
|
116670
117113
|
function PreviewMenuOverlay({ label: label3, dialogRef, preview, ctx, onClose, anchorHost, children }) {
|
|
116671
117114
|
const host = anchorHost?.closest(`[${MODAL_SCOPE_ATTR}]`) ?? (typeof document !== "undefined" ? document.body : null);
|
|
116672
117115
|
const reduce = ctx.reduceMotion();
|
|
116673
|
-
const [shown2, setShown] =
|
|
116674
|
-
|
|
117116
|
+
const [shown2, setShown] = React12.useState(reduce);
|
|
117117
|
+
React12.useEffect(() => {
|
|
116675
117118
|
if (reduce || typeof requestAnimationFrame !== "function") {
|
|
116676
117119
|
setShown(true);
|
|
116677
117120
|
return;
|
|
@@ -116680,7 +117123,7 @@ function PreviewMenuOverlay({ label: label3, dialogRef, preview, ctx, onClose, a
|
|
|
116680
117123
|
return () => cancelAnimationFrame(raf);
|
|
116681
117124
|
}, [reduce]);
|
|
116682
117125
|
const inScope = host != null && host !== host.ownerDocument.body;
|
|
116683
|
-
const previewCtx =
|
|
117126
|
+
const previewCtx = React12.useMemo(() => ctx.onAction ? { ...ctx, onAction: (a2) => {
|
|
116684
117127
|
onClose();
|
|
116685
117128
|
ctx.onAction(a2);
|
|
116686
117129
|
} } : ctx, [ctx, onClose]);
|
|
@@ -116747,7 +117190,7 @@ function youtubeId(item) {
|
|
|
116747
117190
|
}
|
|
116748
117191
|
}
|
|
116749
117192
|
function useResolvedMediaItems(items, ctx) {
|
|
116750
|
-
const paths =
|
|
117193
|
+
const paths = React12.useMemo(() => {
|
|
116751
117194
|
const set = /* @__PURE__ */ new Set();
|
|
116752
117195
|
for (const it2 of items) {
|
|
116753
117196
|
if (!it2 || typeof it2 !== "object") continue;
|
|
@@ -116759,17 +117202,17 @@ function useResolvedMediaItems(items, ctx) {
|
|
|
116759
117202
|
return [...set];
|
|
116760
117203
|
}, [items]);
|
|
116761
117204
|
const key3 = paths.join("\0");
|
|
116762
|
-
const [values, setValues] =
|
|
117205
|
+
const [values, setValues] = React12.useState(() => {
|
|
116763
117206
|
const seed2 = {};
|
|
116764
117207
|
if (ctx.provider) for (const p2 of paths) seed2[p2] = ctx.provider.value(p2);
|
|
116765
117208
|
return seed2;
|
|
116766
117209
|
});
|
|
116767
|
-
|
|
117210
|
+
React12.useEffect(() => {
|
|
116768
117211
|
if (!ctx.provider || paths.length === 0) return;
|
|
116769
117212
|
const unsubs = paths.map((p2) => ctx.provider.subscribe(p2, (v2) => setValues((prev) => prev[p2] === v2 ? prev : { ...prev, [p2]: v2 })));
|
|
116770
117213
|
return () => unsubs.forEach((u2) => u2());
|
|
116771
117214
|
}, [ctx.provider, key3]);
|
|
116772
|
-
return
|
|
117215
|
+
return React12.useMemo(() => items.map((it2) => {
|
|
116773
117216
|
if (!it2 || typeof it2 !== "object") return it2;
|
|
116774
117217
|
let out2 = null;
|
|
116775
117218
|
for (const f2 of MEDIA_ITEM_BINDABLE) {
|
|
@@ -116796,9 +117239,24 @@ function sourceZoomPercent(fragment) {
|
|
|
116796
117239
|
const zoom = match ? Number(match[1]) : NaN;
|
|
116797
117240
|
return Number.isFinite(zoom) && zoom > 0 ? zoom : void 0;
|
|
116798
117241
|
}
|
|
117242
|
+
function webViewChannelOf(provider) {
|
|
117243
|
+
const host = provider;
|
|
117244
|
+
return host && typeof host.webViewChannel === "function" ? host.webViewChannel() : null;
|
|
117245
|
+
}
|
|
117246
|
+
function reloadKeyOf(v2) {
|
|
117247
|
+
if (v2 === void 0 || v2 === null) return null;
|
|
117248
|
+
if (typeof v2 === "object") {
|
|
117249
|
+
try {
|
|
117250
|
+
return JSON.stringify(v2);
|
|
117251
|
+
} catch {
|
|
117252
|
+
return "?";
|
|
117253
|
+
}
|
|
117254
|
+
}
|
|
117255
|
+
return String(v2);
|
|
117256
|
+
}
|
|
116799
117257
|
function cloneWithKids(el2, props, kids3) {
|
|
116800
|
-
if (kids3 === el2.props.children) return
|
|
116801
|
-
return
|
|
117258
|
+
if (kids3 === el2.props.children) return React12.cloneElement(el2, props);
|
|
117259
|
+
return React12.cloneElement(el2, props, ...Array.isArray(kids3) ? kids3 : [kids3]);
|
|
116802
117260
|
}
|
|
116803
117261
|
function editA11yParts(node, edit) {
|
|
116804
117262
|
if (Array.isArray(node)) {
|
|
@@ -116810,7 +117268,7 @@ function editA11yParts(node, edit) {
|
|
|
116810
117268
|
});
|
|
116811
117269
|
return changed ? out2 : node;
|
|
116812
117270
|
}
|
|
116813
|
-
if (!
|
|
117271
|
+
if (!React12.isValidElement(node) || typeof node.type !== "string") return node;
|
|
116814
117272
|
const own6 = node.props;
|
|
116815
117273
|
if (own6["data-component-id"] != null) return node;
|
|
116816
117274
|
const part3 = own6[A11Y_PART];
|
|
@@ -116854,8 +117312,8 @@ function isNativeInteractiveElement(el2) {
|
|
|
116854
117312
|
return typeof el2.type === "string" && (["button", "input", "select", "textarea"].includes(el2.type) || el2.type === "a" && typeof props.href === "string");
|
|
116855
117313
|
}
|
|
116856
117314
|
function hasInteractiveReactDescendant(el2) {
|
|
116857
|
-
return
|
|
116858
|
-
if (!
|
|
117315
|
+
return React12.Children.toArray(el2.props.children).some((child) => {
|
|
117316
|
+
if (!React12.isValidElement(child)) return false;
|
|
116859
117317
|
if (isNativeInteractiveElement(child)) return true;
|
|
116860
117318
|
const props = child.props;
|
|
116861
117319
|
if (typeof child.type === "string" && typeof props.role === "string" && INTERACTIVE_ROLES.has(props.role)) return true;
|
|
@@ -116931,8 +117389,8 @@ function trackActivatorName(activator) {
|
|
|
116931
117389
|
activatorNameObservers.set(activator, observer);
|
|
116932
117390
|
}
|
|
116933
117391
|
function TapActivator({ label: label3, state, tabIndex = 0, role = "button", hint, initialFocus }) {
|
|
116934
|
-
const ref =
|
|
116935
|
-
const hintId = `hm-tap-hint${
|
|
117392
|
+
const ref = React12.useRef(null);
|
|
117393
|
+
const hintId = `hm-tap-hint${React12.useId()}`;
|
|
116936
117394
|
useIsomorphicLayoutEffect(() => {
|
|
116937
117395
|
const el2 = ref.current;
|
|
116938
117396
|
if (!el2 || label3) return;
|
|
@@ -116971,9 +117429,9 @@ function TapActivator({ label: label3, state, tabIndex = 0, role = "button", hin
|
|
|
116971
117429
|
function withExtras(name, render) {
|
|
116972
117430
|
const Wrapped = ({ props, ctx, wrap, nodeId, gap, ...pass }) => {
|
|
116973
117431
|
const el2 = render({ props, ctx, wrap, nodeId, gap, nodeExtras: pass });
|
|
116974
|
-
if (!
|
|
117432
|
+
if (!React12.isValidElement(el2)) return /* @__PURE__ */ jsx11(Fragment4, { children: el2 });
|
|
116975
117433
|
if (el2.props[NODE_EXTRAS_TARGET] === "bottom-drawer-panel") {
|
|
116976
|
-
return
|
|
117434
|
+
return React12.cloneElement(el2, { [NODE_EXTRAS_TARGET]: void 0 });
|
|
116977
117435
|
}
|
|
116978
117436
|
const additive = addIntrinsicPadding(el2.props.style, wrap ?? {});
|
|
116979
117437
|
const inferredDecorative = el2.props[INFERRED_DECORATIVE] === true;
|
|
@@ -116993,7 +117451,7 @@ function withExtras(name, render) {
|
|
|
116993
117451
|
}, hasA11yParts ? editA11yParts(kids3, a11yPartEdit({}, false, () => {
|
|
116994
117452
|
})) : kids3));
|
|
116995
117453
|
}
|
|
116996
|
-
return withCircleClipBorder(additive ?
|
|
117454
|
+
return withCircleClipBorder(additive ? React12.cloneElement(el2, { style: additive }) : el2);
|
|
116997
117455
|
}
|
|
116998
117456
|
const prev = el2.props;
|
|
116999
117457
|
const next = { ...pass };
|
|
@@ -117094,7 +117552,7 @@ function withExtras(name, render) {
|
|
|
117094
117552
|
}
|
|
117095
117553
|
return withCircleClipBorder(cloneWithKids(el2, next, kids3));
|
|
117096
117554
|
}
|
|
117097
|
-
return withCircleClipBorder(
|
|
117555
|
+
return withCircleClipBorder(React12.cloneElement(el2, next));
|
|
117098
117556
|
};
|
|
117099
117557
|
Wrapped.displayName = name;
|
|
117100
117558
|
return Wrapped;
|
|
@@ -117202,7 +117660,7 @@ function overlayEdgeStyle(edge, gap) {
|
|
|
117202
117660
|
}
|
|
117203
117661
|
function useFlippedEdge(edge, open, bubbleRef, anchorRef, gap = TOOLTIP_GAP) {
|
|
117204
117662
|
const initial = { edge, x: 0, y: 0, maxWidth: Infinity };
|
|
117205
|
-
const [placed, setPlaced] =
|
|
117663
|
+
const [placed, setPlaced] = React12.useState(initial);
|
|
117206
117664
|
useIsomorphicLayoutEffect(() => {
|
|
117207
117665
|
if (!open) {
|
|
117208
117666
|
setPlaced((previous) => previous.edge === edge && previous.x === 0 && previous.y === 0 && previous.maxWidth === Infinity ? previous : initial);
|
|
@@ -117996,7 +118454,7 @@ function renderNodeInner(node, ctx) {
|
|
|
117996
118454
|
}
|
|
117997
118455
|
}
|
|
117998
118456
|
const el2 = renderInner(node, ctx);
|
|
117999
|
-
if (!
|
|
118457
|
+
if (!React12.isValidElement(el2)) return el2;
|
|
118000
118458
|
const extra = {};
|
|
118001
118459
|
const material = node?.modifiers?.material;
|
|
118002
118460
|
const materialName = typeof material === "string" ? material : material?.token ?? material?.name;
|
|
@@ -118159,10 +118617,10 @@ function renderNodeInner(node, ctx) {
|
|
|
118159
118617
|
}
|
|
118160
118618
|
{
|
|
118161
118619
|
const mods = node?.modifiers;
|
|
118162
|
-
const
|
|
118163
|
-
if (mods?.padding != null ||
|
|
118620
|
+
const bound2 = mods ? boundPaddingInsets(mods, ctx) : {};
|
|
118621
|
+
if (mods?.padding != null || bound2.paddingTop != null || bound2.paddingBottom != null) {
|
|
118164
118622
|
const style = extra.style ?? el2.props.style;
|
|
118165
|
-
const modPad = { ...ctx.modStyle({ padding: mods?.padding, density: mods?.density }), ...
|
|
118623
|
+
const modPad = { ...ctx.modStyle({ padding: mods?.padding, density: mods?.density }), ...bound2 };
|
|
118166
118624
|
const composed2 = addIntrinsicPadding(style, modPad);
|
|
118167
118625
|
if (composed2) extra.style = composed2;
|
|
118168
118626
|
}
|
|
@@ -118175,8 +118633,8 @@ function renderNodeInner(node, ctx) {
|
|
|
118175
118633
|
const finalStyle = extra.style ?? el2.props.style;
|
|
118176
118634
|
if (!finalStyle?.position) extra.style = { ...finalStyle ?? {}, position: "relative" };
|
|
118177
118635
|
}
|
|
118178
|
-
let out2 = tapActivator ?
|
|
118179
|
-
if (
|
|
118636
|
+
let out2 = tapActivator ? React12.cloneElement(el2, extra, tapActivator, el2.props.children) : Object.keys(extra).length ? React12.cloneElement(el2, extra) : el2;
|
|
118637
|
+
if (React12.isValidElement(out2)) out2 = withCircleClipBorder(out2);
|
|
118180
118638
|
if (a11yHint && !tapActivator) {
|
|
118181
118639
|
out2 = /* @__PURE__ */ jsx11(A11yHintDescription, { hint: a11yHint, idBase: componentId, children: out2 });
|
|
118182
118640
|
}
|
|
@@ -118393,10 +118851,10 @@ function renderInner(node, ctx) {
|
|
|
118393
118851
|
template: items[0],
|
|
118394
118852
|
renderRow: (t2, ic) => {
|
|
118395
118853
|
let row = renderNode(t2, asItem(ic));
|
|
118396
|
-
if (boundStagger > 0 &&
|
|
118854
|
+
if (boundStagger > 0 && React12.isValidElement(row)) {
|
|
118397
118855
|
const i2 = Number(ic.itemScope?.__index ?? 0);
|
|
118398
118856
|
const prev = row.props.style ?? {};
|
|
118399
|
-
row =
|
|
118857
|
+
row = React12.cloneElement(row, { style: { ...prev, animationDelay: `${i2 * boundStagger}ms` } });
|
|
118400
118858
|
}
|
|
118401
118859
|
if (boundSwipe && ctx.onAction && !props.horizontal) {
|
|
118402
118860
|
const leading = resolveSwipeActions(boundSwipe.leading, ic);
|
|
@@ -118456,7 +118914,7 @@ function renderInner(node, ctx) {
|
|
|
118456
118914
|
if (swipe && ctx.onAction && !props.horizontal) {
|
|
118457
118915
|
const leading = swipe.leading ?? [];
|
|
118458
118916
|
const trailing = swipe.trailing ?? [];
|
|
118459
|
-
const arr2 =
|
|
118917
|
+
const arr2 = React12.Children.toArray(rendered);
|
|
118460
118918
|
body = arr2.map((child, i2) => /* @__PURE__ */ jsx11(
|
|
118461
118919
|
SwipeRow,
|
|
118462
118920
|
{
|
|
@@ -118514,8 +118972,8 @@ function renderInner(node, ctx) {
|
|
|
118514
118972
|
const card2 = ctx.elevation("card");
|
|
118515
118973
|
const elevation = card2 && ownSurface ? { border: card2.border } : card2;
|
|
118516
118974
|
const wrapShadow = wrap.boxShadow;
|
|
118517
|
-
const
|
|
118518
|
-
const elevationShadow = !elevation ? wrapShadow :
|
|
118975
|
+
const explicit2 = m2?.shadow != null || m2?.boxShadow != null || m2?.box_shadow != null;
|
|
118976
|
+
const elevationShadow = !elevation ? wrapShadow : explicit2 ? elevationBoxShadow({ border: elevation.border, shadow: wrapShadow }) : [elevationBoxShadow(elevation), wrapShadow].filter(Boolean).join(", ") || void 0;
|
|
118519
118977
|
return /* @__PURE__ */ jsx11("div", { style: { display: "flex", flexDirection: "column", gap: props.spacing == null ? 8 : ctx.sp(props.spacing), padding: props.padding == null ? 12 : ctx.sp(props.padding), background: elevation?.tint ? mixColor(fill, elevation.tint.color, elevation.tint.alpha) : fill, borderRadius: ctx.radius(props.cornerRadius ?? "md", 10), overflow: "hidden", alignSelf: "stretch", ...props.alignment ? { alignItems: props.alignment === "center" ? "center" : props.alignment === "trailing" ? "flex-end" : "flex-start" } : {}, ...wrap, ...elevationShadow ? { boxShadow: elevationShadow } : {} }, children: kids2(props.children, ctx) });
|
|
118520
118978
|
}
|
|
118521
118979
|
case "SplitView":
|
|
@@ -118945,7 +119403,7 @@ function renderInner(node, ctx) {
|
|
|
118945
119403
|
] });
|
|
118946
119404
|
// ───────────── embeddable WebView ─────────────
|
|
118947
119405
|
case "WebView":
|
|
118948
|
-
return /* @__PURE__ */ jsx11(WebViewNode, { props, ctx, wrap });
|
|
119406
|
+
return /* @__PURE__ */ jsx11(WebViewNode, { props, ctx, wrap, nodeId: resolvedComponentId(node.id, ctx) ?? "" });
|
|
118949
119407
|
// ───────────── app intents + unknown ─────────────
|
|
118950
119408
|
default: {
|
|
118951
119409
|
const intent = pkg ? ctx.intents?.[`${pkg}.${type}`] : void 0;
|
|
@@ -118967,7 +119425,7 @@ function reportUnknownComponent(ctx, pkg, type) {
|
|
|
118967
119425
|
function unknownComponentShowsDeveloperLabel(ctx) {
|
|
118968
119426
|
return ctx.debugUnknownComponents ?? ctx.previewSurface != null;
|
|
118969
119427
|
}
|
|
118970
|
-
var rowValue, loadPdfFetch, useIsomorphicLayoutEffect, ResponsiveGrid, SPLIT_EXPANDED_MIN_WIDTH, SPLIT_COLUMN_GAP, ResponsiveSplitView, ABSOLUTE_URL_RE, appearKeyframesInjected, valueSwapKeyframesInjected, NUMERIC_TEXT, shimmerKeyframesInjected, pressStylesInjected, REVEAL_ON_FOCUS_ATTR, FOCUS_RING_CSS, focusStylesInjected, HLIST_CHILD_CSS, hListStylesInjected, listAnimateRuntimeInstalled, transitionKeyframesInjected, countUpRuntimeInjected, MEASURE_PREFIX, measureRuntimeInjected, revealRuntimeInjected, AMBIENT_HOST_STYLE, AmbientMotionBox, vectorAnimStylesInjected, scrollProgressRuntimeInjected, confettiRuntimeInjected, lottieRuntimeInjected, LOTTIE_RUNTIME_ATTRIBUTES, lottieAnims, riveRuntimeInjected, gradientKeyframesInjected, parallaxRuntimeInjected, spinKeyframesInjected, marqueeKeyframesInjected, alignItems, zJustifyItems, hAlignItems, bodyFont, kids2, rowKidCtx, rowKids, staggeredKids, asTextL10n, asFinalTextL10n, asBoundText, useBoundString, InterpolatedTextView, txt, selectFragmentCase, fragmentValueHash, fragmentSlotContent, FragmentSlotNode, RichContentEditorNode, MediaFieldNode, WorkerSubtreeNode, RichContentNode, resolveItemDeep2, resolveRowAction2, resolveSwipeActions, resolveModBindings, resolvedComponentId, directServiceBindings, withRootStyle, ReactiveDirectScalars, HiddenGate, ExitPresence, StatefulSectionNode, KEYBOARD_INPUT_MODES, AUTOCAPITALIZE_VALUES, ENTER_KEY_HINTS, AUTOGROW_CEILING, EditableField, MENU_ANCHOR_CONTROL, MenuNode, MENU_LONG_PRESS_MS, menuOpensOnLongPress, LoadMoreSentinel, FieldErrorNode, FormView, MediaSlotProvider, MEDIA_ITEM_BINDABLE, MediaPlayerView, VideoNode, PdfDocumentCanvas, PdfViewNode, WebViewNode, InteractivePicker, InteractiveDatePicker, InteractiveSearchField, InteractiveStepper, NODE_EXTRAS_TARGET, SYNTHETIC_TAP_ROLE, SYNTHETIC_TABINDEX, INFERRED_DECORATIVE, SELF_RENDERED_LEAF, ROLE_WHEN_NAMED, AUTHORED_ROLE, PENDING_RANGE, RANGE_ROLES, NODE_A11Y_ATTRS, INTERACTIVE_ROLES, ALWAYS_INTERACTIVE_COMPONENT_TYPES, TAP_ACTIVATOR_ATTR, TAP_GROUP_ATTR, NESTED_CONTROL_SELECTOR, VISUALLY_HIDDEN, NAME_SKIP_SELECTOR, activatorNameObservers, ACTIVATOR_STATE_ATTRS, controlNode, ToggleNode, SliderNode, SelectionControlNode, TabsNode, SegmentedControlNode, DisclosureGroupNode, GridNode, SplitViewNode, REVEAL_RELEASE_MS, REVEAL_FADE_MS, REVEAL_BUFFER, revealProgress, countWords, RevealText, TextNode, ImageNode, ANIMATION_LEAF, LottieNode, RiveNode, AvatarNode, IconNode, EMPTY_STATE_SPACING, EmptyStateNode, ButtonNode, OtpInputNode, ProgressBarNode, SnackbarNode, ACTIVITY_DEFAULT_NAME, ACTIVITY_RING_ARC, ActivityIndicatorNode, NATIVELY_TABBABLE, BottomSheetNode, BOTTOM_DRAWER_HOST_STACK_EVENT, ModalBottomSheetNode, BottomDrawerNode, PRESENTED_OVERLAY_ATTR, TooltipNode, PopoverNode, ChipsInputNode, ChipNode, TableNode, GaugeRing, GaugeNode, RATING_METRICS, ratingMetrics, RatingNode, AvatarStripNode, CHART_STROKE_CYCLE, chartStrokeAt, chartBarCenter, ChartNode, donutSliceOpacity, DonutChartNode, ShapeNode, LegendMarker, LegendNode, cellAlign, DataTableNode, voiceNoteState, voiceNoteDelivery, VOICE_NOTE_DEFAULT_BARS, clampBarCount, VoiceNoteNode, TimelineNode, PagingNode, WheelPickerNode, ColorPickerNode, FilterChipsNode, TILE_PX, MAX_MERCATOR_LAT, DEFAULT_TILE_MAX_ZOOM, CIRCLE_SEGMENTS, METRES_PER_DEG_LAT, MARKER_HIT_RADIUS, SHAPE_HIT_RADIUS, MapNode, CAROUSEL_SETTLE_MS, scrollCarouselTo, CarouselNode, BannerNode, CollapsingHeaderNode, UnsupportedOnSurface, CALENDAR_DATE_ONLY_RE, CAL_DEFAULT_MAX_DOTS, CAL_AGENDA_INITIAL_DAYS, CAL_AGENDA_PAGE_DAYS, CAL_DEFAULT_SNAP_MINUTES, CAL_UNASSIGNED_LANE_ID, MonthCalendarNode, TimeGridNode, AgendaNode, ARIA_ROLE, initialFocusScheduled, PRESENTED_SCOPE, focusRoots, A11yHintDescription, reportedUnknownComponents, UnknownComponentNode, WebRenderer;
|
|
119428
|
+
var rowValue, loadPdfFetch, WebViewBridgeHost2, useIsomorphicLayoutEffect, ResponsiveGrid, SPLIT_EXPANDED_MIN_WIDTH, SPLIT_COLUMN_GAP, ResponsiveSplitView, ABSOLUTE_URL_RE, appearKeyframesInjected, valueSwapKeyframesInjected, NUMERIC_TEXT, shimmerKeyframesInjected, pressStylesInjected, REVEAL_ON_FOCUS_ATTR, FOCUS_RING_CSS, focusStylesInjected, HLIST_CHILD_CSS, hListStylesInjected, listAnimateRuntimeInstalled, transitionKeyframesInjected, countUpRuntimeInjected, MEASURE_PREFIX, measureRuntimeInjected, revealRuntimeInjected, AMBIENT_HOST_STYLE, AmbientMotionBox, vectorAnimStylesInjected, scrollProgressRuntimeInjected, confettiRuntimeInjected, lottieRuntimeInjected, LOTTIE_RUNTIME_ATTRIBUTES, lottieAnims, riveRuntimeInjected, gradientKeyframesInjected, parallaxRuntimeInjected, spinKeyframesInjected, marqueeKeyframesInjected, alignItems, zJustifyItems, hAlignItems, bodyFont, kids2, rowKidCtx, rowKids, staggeredKids, asTextL10n, asFinalTextL10n, asBoundText, useBoundString, InterpolatedTextView, txt, selectFragmentCase, fragmentValueHash, fragmentSlotContent, FragmentSlotNode, RichContentEditorNode, MediaFieldNode, WorkerSubtreeNode, RichContentNode, resolveItemDeep2, resolveRowAction2, resolveSwipeActions, resolveModBindings, resolvedComponentId, directServiceBindings, withRootStyle, ReactiveDirectScalars, HiddenGate, ExitPresence, StatefulSectionNode, KEYBOARD_INPUT_MODES, AUTOCAPITALIZE_VALUES, ENTER_KEY_HINTS, AUTOGROW_CEILING, EditableField, MENU_ANCHOR_CONTROL, MenuNode, MENU_LONG_PRESS_MS, menuOpensOnLongPress, LoadMoreSentinel, FieldErrorNode, FormView, MediaSlotProvider, MEDIA_ITEM_BINDABLE, MediaPlayerView, VideoNode, PdfDocumentCanvas, PdfViewNode, WebViewNode, InteractivePicker, InteractiveDatePicker, InteractiveSearchField, InteractiveStepper, NODE_EXTRAS_TARGET, SYNTHETIC_TAP_ROLE, SYNTHETIC_TABINDEX, INFERRED_DECORATIVE, SELF_RENDERED_LEAF, ROLE_WHEN_NAMED, AUTHORED_ROLE, PENDING_RANGE, RANGE_ROLES, NODE_A11Y_ATTRS, INTERACTIVE_ROLES, ALWAYS_INTERACTIVE_COMPONENT_TYPES, TAP_ACTIVATOR_ATTR, TAP_GROUP_ATTR, NESTED_CONTROL_SELECTOR, VISUALLY_HIDDEN, NAME_SKIP_SELECTOR, activatorNameObservers, ACTIVATOR_STATE_ATTRS, controlNode, ToggleNode, SliderNode, SelectionControlNode, TabsNode, SegmentedControlNode, DisclosureGroupNode, GridNode, SplitViewNode, REVEAL_RELEASE_MS, REVEAL_FADE_MS, REVEAL_BUFFER, revealProgress, countWords, RevealText, TextNode, ImageNode, ANIMATION_LEAF, LottieNode, RiveNode, AvatarNode, IconNode, EMPTY_STATE_SPACING, EmptyStateNode, ButtonNode, OtpInputNode, ProgressBarNode, SnackbarNode, ACTIVITY_DEFAULT_NAME, ACTIVITY_RING_ARC, ActivityIndicatorNode, NATIVELY_TABBABLE, BottomSheetNode, BOTTOM_DRAWER_HOST_STACK_EVENT, ModalBottomSheetNode, BottomDrawerNode, PRESENTED_OVERLAY_ATTR, TooltipNode, PopoverNode, ChipsInputNode, ChipNode, TableNode, GaugeRing, GaugeNode, RATING_METRICS, ratingMetrics, RatingNode, AvatarStripNode, CHART_STROKE_CYCLE, chartStrokeAt, chartBarCenter, ChartNode, donutSliceOpacity, DonutChartNode, ShapeNode, LegendMarker, LegendNode, cellAlign, DataTableNode, voiceNoteState, voiceNoteDelivery, VOICE_NOTE_DEFAULT_BARS, clampBarCount, VoiceNoteNode, TimelineNode, PagingNode, WheelPickerNode, ColorPickerNode, FilterChipsNode, TILE_PX, MAX_MERCATOR_LAT, DEFAULT_TILE_MAX_ZOOM, CIRCLE_SEGMENTS, METRES_PER_DEG_LAT, MARKER_HIT_RADIUS, SHAPE_HIT_RADIUS, MapNode, CAROUSEL_SETTLE_MS, scrollCarouselTo, CarouselNode, BannerNode, CollapsingHeaderNode, UnsupportedOnSurface, CALENDAR_DATE_ONLY_RE, CAL_DEFAULT_MAX_DOTS, CAL_AGENDA_INITIAL_DAYS, CAL_AGENDA_PAGE_DAYS, CAL_DEFAULT_SNAP_MINUTES, CAL_UNASSIGNED_LANE_ID, MonthCalendarNode, TimeGridNode, AgendaNode, ARIA_ROLE, initialFocusScheduled, PRESENTED_SCOPE, focusRoots, A11yHintDescription, reportedUnknownComponents, UnknownComponentNode, WebRenderer;
|
|
118971
119429
|
var init_renderNode = __esm({
|
|
118972
119430
|
"../../core/web-renderer/src/renderNode.tsx"() {
|
|
118973
119431
|
"use strict";
|
|
@@ -119016,11 +119474,12 @@ var init_renderNode = __esm({
|
|
|
119016
119474
|
init_richContent();
|
|
119017
119475
|
rowValue = (v2, ctx) => typeof v2 === "string" && v2.startsWith("$item") ? resolveScalarStatic(v2, ctx) : v2;
|
|
119018
119476
|
loadPdfFetch = () => Promise.resolve().then(() => (init_pdfFetch(), pdfFetch_exports));
|
|
119019
|
-
|
|
119477
|
+
WebViewBridgeHost2 = React12.lazy(() => Promise.resolve().then(() => (init_webviewBridgeHost(), webviewBridgeHost_exports)));
|
|
119478
|
+
useIsomorphicLayoutEffect = typeof globalThis.document === "undefined" ? React12.useEffect : React12.useLayoutEffect;
|
|
119020
119479
|
ResponsiveGrid = ({ base, medium, expanded, initialCols, seedWidth, spacing, extra, children }) => {
|
|
119021
|
-
const [el2, setEl] =
|
|
119022
|
-
const [cols, setCols] =
|
|
119023
|
-
|
|
119480
|
+
const [el2, setEl] = React12.useState(null);
|
|
119481
|
+
const [cols, setCols] = React12.useState(initialCols);
|
|
119482
|
+
React12.useEffect(() => {
|
|
119024
119483
|
if (!el2) return;
|
|
119025
119484
|
const measure2 = () => {
|
|
119026
119485
|
const w2 = seededWidth(el2.clientWidth, seedWidth);
|
|
@@ -119046,9 +119505,9 @@ var init_renderNode = __esm({
|
|
|
119046
119505
|
SPLIT_EXPANDED_MIN_WIDTH = 840;
|
|
119047
119506
|
SPLIT_COLUMN_GAP = 16;
|
|
119048
119507
|
ResponsiveSplitView = ({ primary, detail, primaryMaxWidth, initialWide, seedWidth, extra }) => {
|
|
119049
|
-
const ref =
|
|
119050
|
-
const [wide, setWide] =
|
|
119051
|
-
|
|
119508
|
+
const ref = React12.useRef(null);
|
|
119509
|
+
const [wide, setWide] = React12.useState(initialWide);
|
|
119510
|
+
React12.useEffect(() => {
|
|
119052
119511
|
const el2 = ref.current;
|
|
119053
119512
|
if (!el2) return;
|
|
119054
119513
|
const measure2 = () => {
|
|
@@ -119094,9 +119553,9 @@ var init_renderNode = __esm({
|
|
|
119094
119553
|
revealRuntimeInjected = false;
|
|
119095
119554
|
AMBIENT_HOST_STYLE = { display: "contents" };
|
|
119096
119555
|
AmbientMotionBox = ({ spec, kind, children }) => {
|
|
119097
|
-
const ref =
|
|
119556
|
+
const ref = React12.useRef(null);
|
|
119098
119557
|
const { minGapMs, maxGapMs } = spec;
|
|
119099
|
-
|
|
119558
|
+
React12.useEffect(() => {
|
|
119100
119559
|
const el2 = ref.current?.firstElementChild;
|
|
119101
119560
|
if (!el2 || typeof el2.animate !== "function") return;
|
|
119102
119561
|
let timer;
|
|
@@ -119180,14 +119639,14 @@ var init_renderNode = __esm({
|
|
|
119180
119639
|
}
|
|
119181
119640
|
};
|
|
119182
119641
|
bodyFont = (ctx) => fontStack(ctx.font("body").family, ctx.idiom);
|
|
119183
|
-
kids2 = (arr2, ctx) => Array.isArray(arr2) ? arr2.map((n2, i2) => /* @__PURE__ */ jsx11(
|
|
119642
|
+
kids2 = (arr2, ctx) => Array.isArray(arr2) ? arr2.map((n2, i2) => /* @__PURE__ */ jsx11(React12.Fragment, { children: renderNode(n2, ctx) }, n2?.id ?? i2)) : null;
|
|
119184
119643
|
rowKidCtx = (n2, ctx) => wantsRowStretch(n2) ? { ...ctx, rowStretch: true } : normalize(n2).type === "Divider" ? { ...ctx, rowDivider: true } : ctx;
|
|
119185
|
-
rowKids = (arr2, ctx) => Array.isArray(arr2) ? arr2.map((n2, i2) => /* @__PURE__ */ jsx11(
|
|
119644
|
+
rowKids = (arr2, ctx) => Array.isArray(arr2) ? arr2.map((n2, i2) => /* @__PURE__ */ jsx11(React12.Fragment, { children: renderNode(n2, rowKidCtx(n2, ctx)) }, n2?.id ?? i2)) : null;
|
|
119186
119645
|
staggeredKids = (arr2, ctx, staggerMs) => Array.isArray(arr2) ? arr2.map((n2, i2) => {
|
|
119187
119646
|
const el2 = renderNode(n2, ctx);
|
|
119188
|
-
if (!
|
|
119647
|
+
if (!React12.isValidElement(el2)) return /* @__PURE__ */ jsx11(React12.Fragment, { children: el2 }, n2?.id ?? i2);
|
|
119189
119648
|
const prev = el2.props.style ?? {};
|
|
119190
|
-
return
|
|
119649
|
+
return React12.cloneElement(el2, { key: n2?.id ?? i2, style: { ...prev, animationDelay: `${i2 * staggerMs}ms` } });
|
|
119191
119650
|
}) : null;
|
|
119192
119651
|
asTextL10n = (v2, ctx) => typeof v2 === "string" && v2.startsWith(TRANSLATION_PREFIX) ? asText2(resolveTranslation(v2, ctx.catalog)) : asText2(v2);
|
|
119193
119652
|
asFinalTextL10n = (v2, ctx) => typeof v2 === "string" ? v2.startsWith(TRANSLATION_PREFIX) ? asText2(resolveTranslation(v2, ctx.catalog)) : v2 : asText2(v2);
|
|
@@ -119197,19 +119656,19 @@ var init_renderNode = __esm({
|
|
|
119197
119656
|
return isBinding(v2) ? asTextL10n(resolved2 ?? "", ctx) : asText2(v2);
|
|
119198
119657
|
};
|
|
119199
119658
|
InterpolatedTextView = ({ pattern, params, ctx }) => {
|
|
119200
|
-
const
|
|
119659
|
+
const bound2 = Object.entries(params).filter(
|
|
119201
119660
|
([, v2]) => typeof v2 === "string" && v2.startsWith("$service:")
|
|
119202
119661
|
);
|
|
119203
|
-
const [live3, setLive] =
|
|
119662
|
+
const [live3, setLive] = React12.useState(() => {
|
|
119204
119663
|
const seed2 = {};
|
|
119205
|
-
if (ctx.provider) for (const [k2, p2] of
|
|
119664
|
+
if (ctx.provider) for (const [k2, p2] of bound2) seed2[k2] = ctx.provider.value(servicePath(p2));
|
|
119206
119665
|
return seed2;
|
|
119207
119666
|
});
|
|
119208
|
-
const subKey =
|
|
119209
|
-
|
|
119667
|
+
const subKey = bound2.map(([k2, p2]) => `${k2}=${p2}`).join("|");
|
|
119668
|
+
React12.useEffect(() => {
|
|
119210
119669
|
const provider = ctx.provider;
|
|
119211
119670
|
if (!provider) return;
|
|
119212
|
-
const unsubs =
|
|
119671
|
+
const unsubs = bound2.map(
|
|
119213
119672
|
([k2, p2]) => provider.subscribe(servicePath(p2), (v2) => setLive((prev) => prev[k2] === v2 ? prev : { ...prev, [k2]: v2 }))
|
|
119214
119673
|
);
|
|
119215
119674
|
return () => unsubs.forEach((u2) => u2());
|
|
@@ -119248,11 +119707,11 @@ var init_renderNode = __esm({
|
|
|
119248
119707
|
fragmentSlotContent = ({ props, ctx, discriminator, slotId, extra }) => {
|
|
119249
119708
|
const selected = selectFragmentCase(props, discriminator);
|
|
119250
119709
|
const selectedId = typeof selected?.id === "string" ? selected.id : "";
|
|
119251
|
-
const previousId =
|
|
119252
|
-
const reportedUnknown =
|
|
119253
|
-
const reportedInvalid =
|
|
119254
|
-
const [announcement, setAnnouncement] =
|
|
119255
|
-
|
|
119710
|
+
const previousId = React12.useRef(selectedId);
|
|
119711
|
+
const reportedUnknown = React12.useRef(/* @__PURE__ */ new Set());
|
|
119712
|
+
const reportedInvalid = React12.useRef(/* @__PURE__ */ new Set());
|
|
119713
|
+
const [announcement, setAnnouncement] = React12.useState("");
|
|
119714
|
+
React12.useEffect(() => {
|
|
119256
119715
|
if (typeof discriminator === "string") {
|
|
119257
119716
|
if (discriminator && !props.cases?.some((candidate) => candidate.id === discriminator) && !reportedUnknown.current.has(discriminator)) {
|
|
119258
119717
|
reportedUnknown.current.add(discriminator);
|
|
@@ -119266,7 +119725,7 @@ var init_renderNode = __esm({
|
|
|
119266
119725
|
}
|
|
119267
119726
|
}
|
|
119268
119727
|
}, [ctx, discriminator, props.cases, slotId]);
|
|
119269
|
-
|
|
119728
|
+
React12.useEffect(() => {
|
|
119270
119729
|
if (previousId.current !== selectedId) {
|
|
119271
119730
|
const next = selected?.accessibilityAnnouncement ?? selected?.accessibility_announcement;
|
|
119272
119731
|
setAnnouncement(typeof next === "string" ? next : "");
|
|
@@ -119280,7 +119739,7 @@ var init_renderNode = __esm({
|
|
|
119280
119739
|
// and the right edge clips (branded-lite's home is a FragmentSlot → 32px cut in
|
|
119281
119740
|
// the phone preview). Included before ...extra so a modifier can still override.
|
|
119282
119741
|
/* @__PURE__ */ jsxs8("div", { "data-fragment-slot": slotId ?? "", "data-fragment-case": selectedId, style: { width: "100%", boxSizing: "border-box", ...extra }, children: [
|
|
119283
|
-
selected?.content ? /* @__PURE__ */ jsx11(
|
|
119742
|
+
selected?.content ? /* @__PURE__ */ jsx11(React12.Fragment, { children: renderNode(selected.content, ctx) }, selectedId) : null,
|
|
119284
119743
|
/* @__PURE__ */ jsx11("span", { "aria-live": "polite", style: { position: "absolute", width: 1, height: 1, padding: 0, margin: -1, overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", border: 0 }, children: announcement })
|
|
119285
119744
|
] })
|
|
119286
119745
|
);
|
|
@@ -119288,24 +119747,24 @@ var init_renderNode = __esm({
|
|
|
119288
119747
|
FragmentSlotNode = withExtras("FragmentSlotNode", ({ props, ctx, wrap, nodeId }) => {
|
|
119289
119748
|
const casePath = props.casePath ?? props.case_path;
|
|
119290
119749
|
const isService = typeof casePath === "string" && casePath.startsWith("$service:");
|
|
119291
|
-
const
|
|
119292
|
-
const discriminator = isService ?
|
|
119750
|
+
const bound2 = useBoundValue(ctx, isService ? casePath : "");
|
|
119751
|
+
const discriminator = isService ? bound2 : isEnvExpr(casePath) ? evalEnvExpr(casePath, ctxEnv(ctx)) : resolveScalarStatic(casePath, ctx);
|
|
119293
119752
|
return fragmentSlotContent({ props, ctx, discriminator, slotId: nodeId, extra: wrap });
|
|
119294
119753
|
});
|
|
119295
119754
|
RichContentEditorNode = withExtras("RichContentEditorNode", ({ props, ctx, wrap, nodeId }) => /* @__PURE__ */ jsx11(RichContentEditorView, { props, ctx, wrap, nodeId, renderChild: (n2) => renderNode(n2, ctx) }));
|
|
119296
119755
|
MediaFieldNode = withExtras("MediaFieldNode", ({ props, ctx, wrap }) => {
|
|
119297
119756
|
const C2 = ctx.color;
|
|
119298
119757
|
const servicePathStr = mediaFieldServicePath(props.valuePath);
|
|
119299
|
-
const
|
|
119300
|
-
const imageUrl = typeof
|
|
119758
|
+
const bound2 = useBoundValue(ctx, servicePathStr ? String(props.valuePath) : "");
|
|
119759
|
+
const imageUrl = typeof bound2 === "string" ? bound2 : "";
|
|
119301
119760
|
const fallbackPathStr = mediaFieldServicePath(props.fallbackTextPath);
|
|
119302
119761
|
const fallbackBound = useBoundValue(ctx, fallbackPathStr ? String(props.fallbackTextPath) : "");
|
|
119303
119762
|
const fallbackText = typeof fallbackBound === "string" ? fallbackBound : "";
|
|
119304
|
-
const [uploading, setUploading] =
|
|
119305
|
-
const [failed3, setFailed] =
|
|
119306
|
-
const fileRef =
|
|
119307
|
-
const previewRef =
|
|
119308
|
-
const [localPreview, setLocalPreview] =
|
|
119763
|
+
const [uploading, setUploading] = React12.useState(false);
|
|
119764
|
+
const [failed3, setFailed] = React12.useState(false);
|
|
119765
|
+
const fileRef = React12.useRef(null);
|
|
119766
|
+
const previewRef = React12.useRef(null);
|
|
119767
|
+
const [localPreview, setLocalPreview] = React12.useState("");
|
|
119309
119768
|
const uploadService = typeof props.uploadService === "string" ? props.uploadService : "";
|
|
119310
119769
|
const resolvedLabel = asText2(resolveScalarStatic(props.label, ctx));
|
|
119311
119770
|
const name = mediaFieldName(resolvedLabel);
|
|
@@ -119350,7 +119809,7 @@ var init_renderNode = __esm({
|
|
|
119350
119809
|
setUploading(false);
|
|
119351
119810
|
}
|
|
119352
119811
|
};
|
|
119353
|
-
|
|
119812
|
+
React12.useEffect(() => () => {
|
|
119354
119813
|
const previewUrl = previewRef.current;
|
|
119355
119814
|
if (previewUrl && typeof URL.revokeObjectURL === "function") URL.revokeObjectURL(previewUrl);
|
|
119356
119815
|
previewRef.current = null;
|
|
@@ -119422,7 +119881,7 @@ var init_renderNode = __esm({
|
|
|
119422
119881
|
const value = useBoundValue(ctx, typeof path2 === "string" ? path2 : "");
|
|
119423
119882
|
const policy = props.policy;
|
|
119424
119883
|
const catalog3 = ctx.provider && typeof ctx.provider.listActions === "function" ? ctx.provider : null;
|
|
119425
|
-
const validation =
|
|
119884
|
+
const validation = React12.useMemo(() => {
|
|
119426
119885
|
if (value === void 0 || value === null) return { ok: false, reason: "unresolved" };
|
|
119427
119886
|
if (typeof value !== "string") return { ok: false, reason: "value_type" };
|
|
119428
119887
|
if (!policy || typeof policy !== "object") return { ok: false, reason: "typed_decode" };
|
|
@@ -119432,8 +119891,8 @@ var init_renderNode = __esm({
|
|
|
119432
119891
|
return { ok: false, reason: "typed_decode" };
|
|
119433
119892
|
}
|
|
119434
119893
|
}, [catalog3, policy, slotId, value]);
|
|
119435
|
-
const reported =
|
|
119436
|
-
|
|
119894
|
+
const reported = React12.useRef(/* @__PURE__ */ new Set());
|
|
119895
|
+
React12.useEffect(() => {
|
|
119437
119896
|
const key3 = validation.ok ? `ok:${validation.treeHash}` : `bad:${validation.treeHash ?? validation.reason}`;
|
|
119438
119897
|
if (reported.current.has(key3)) return;
|
|
119439
119898
|
reported.current.add(key3);
|
|
@@ -119460,12 +119919,12 @@ var init_renderNode = __esm({
|
|
|
119460
119919
|
const componentId = nodeId ?? "";
|
|
119461
119920
|
const path2 = props.documentJsonPath ?? props.document_json_path;
|
|
119462
119921
|
const hasPath = typeof path2 === "string" && path2 !== "";
|
|
119463
|
-
const
|
|
119464
|
-
const raw = hasPath ?
|
|
119465
|
-
const result =
|
|
119922
|
+
const bound2 = useResolvedScalar(hasPath ? path2 : void 0, ctx);
|
|
119923
|
+
const raw = hasPath ? bound2 : props.documentJson ?? props.document_json;
|
|
119924
|
+
const result = React12.useMemo(() => layoutRichContentValue(raw), [raw]);
|
|
119466
119925
|
const reason = result && "rejected" in result ? result.rejected : void 0;
|
|
119467
|
-
const reported =
|
|
119468
|
-
|
|
119926
|
+
const reported = React12.useRef(/* @__PURE__ */ new Set());
|
|
119927
|
+
React12.useEffect(() => {
|
|
119469
119928
|
if (!reason) return;
|
|
119470
119929
|
const key3 = typeof raw === "string" ? `${reason}:${raw.length}:${richContentDocumentHash(raw)}` : `${reason}:non-string`;
|
|
119471
119930
|
if (reported.current.has(key3)) return;
|
|
@@ -119559,17 +120018,17 @@ var init_renderNode = __esm({
|
|
|
119559
120018
|
};
|
|
119560
120019
|
withRootStyle = (content, style) => {
|
|
119561
120020
|
if (Array.isArray(content)) return content.map((child) => withRootStyle(child, style));
|
|
119562
|
-
if (!
|
|
119563
|
-
if (content.type ===
|
|
119564
|
-
return
|
|
120021
|
+
if (!React12.isValidElement(content)) return content;
|
|
120022
|
+
if (content.type === React12.Fragment) {
|
|
120023
|
+
return React12.cloneElement(content, {}, React12.Children.map(content.props.children, (child) => withRootStyle(child, style)));
|
|
119565
120024
|
}
|
|
119566
120025
|
const element = content;
|
|
119567
|
-
return
|
|
120026
|
+
return React12.cloneElement(element, { style: { ...element.props.style, ...style } });
|
|
119568
120027
|
};
|
|
119569
120028
|
ReactiveDirectScalars = ({ node, ctx, bindings, style }) => {
|
|
119570
|
-
const [, rerender] =
|
|
120029
|
+
const [, rerender] = React12.useState(0);
|
|
119571
120030
|
const bindingKey = bindings.join("|");
|
|
119572
|
-
|
|
120031
|
+
React12.useEffect(() => {
|
|
119573
120032
|
if (!ctx.provider) return;
|
|
119574
120033
|
const unsubs = bindings.map((binding2) => ctx.provider.subscribe(servicePath(binding2), () => rerender((n2) => n2 + 1)));
|
|
119575
120034
|
return () => unsubs.forEach((unsubscribe) => unsubscribe());
|
|
@@ -119582,14 +120041,14 @@ var init_renderNode = __esm({
|
|
|
119582
120041
|
return /* @__PURE__ */ jsx11(ExitPresence, { hidden: hiddenBool(v2), exit: exit ?? null, children });
|
|
119583
120042
|
};
|
|
119584
120043
|
ExitPresence = ({ hidden, exit, children }) => {
|
|
119585
|
-
const [prevHidden, setPrevHidden] =
|
|
119586
|
-
const [exiting, setExiting] =
|
|
120044
|
+
const [prevHidden, setPrevHidden] = React12.useState(hidden);
|
|
120045
|
+
const [exiting, setExiting] = React12.useState(false);
|
|
119587
120046
|
if (hidden !== prevHidden) {
|
|
119588
120047
|
setPrevHidden(hidden);
|
|
119589
120048
|
setExiting(hidden && exit != null);
|
|
119590
120049
|
}
|
|
119591
|
-
const ref =
|
|
119592
|
-
const exitRef =
|
|
120050
|
+
const ref = React12.useRef(null);
|
|
120051
|
+
const exitRef = React12.useRef(exit);
|
|
119593
120052
|
exitRef.current = exit;
|
|
119594
120053
|
useIsomorphicLayoutEffect(() => {
|
|
119595
120054
|
if (!exiting) return void 0;
|
|
@@ -119617,13 +120076,13 @@ var init_renderNode = __esm({
|
|
|
119617
120076
|
const C2 = ctx.color;
|
|
119618
120077
|
const raw = props.state;
|
|
119619
120078
|
const isBound = typeof raw === "string" && raw.startsWith("$service:");
|
|
119620
|
-
const
|
|
120079
|
+
const bound2 = useResolvedScalar(isBound ? raw : void 0, ctx);
|
|
119621
120080
|
const legacy = isNodeLike(props.data) ? "data" : isNodeLike(props.loading) ? "loading" : props.state === "error" ? "error" : "empty";
|
|
119622
|
-
const target = raw == null || raw === "" || isBound && !ctx.provider ? legacy : sectionSlot(isBound ?
|
|
120081
|
+
const target = raw == null || raw === "" || isBound && !ctx.provider ? legacy : sectionSlot(isBound ? bound2 : raw);
|
|
119623
120082
|
const { graceMs, floorMs } = loadingTiming(ctx.kit, props.loadingGraceMs ?? props.loading_grace_ms, props.loadingFloorMs ?? props.loading_floor_ms);
|
|
119624
120083
|
const shown2 = useLoadingTiming(target, graceMs, floorMs);
|
|
119625
|
-
const changed =
|
|
119626
|
-
const first =
|
|
120084
|
+
const changed = React12.useRef(false);
|
|
120085
|
+
const first = React12.useRef(shown2);
|
|
119627
120086
|
if (shown2 !== first.current) changed.current = true;
|
|
119628
120087
|
const renderCfg = (cfg) => cfg && typeof cfg === "object" ? /* @__PURE__ */ jsxs8("div", { style: { textAlign: "center", padding: "24px 12px", color: C2("textSecondary", "#9aa2ad") }, children: [
|
|
119629
120088
|
cfg.title && /* @__PURE__ */ jsx11("div", { style: { fontSize: pxToRem(15), fontWeight: 600, color: C2("textPrimary", "#111") }, children: asText2(cfg.title) }),
|
|
@@ -119655,8 +120114,8 @@ var init_renderNode = __esm({
|
|
|
119655
120114
|
}
|
|
119656
120115
|
const animate = motionDefaultsAnimate(ctx);
|
|
119657
120116
|
const fadeMs = motionDefaultsDuration(ctx.kit, 220);
|
|
119658
|
-
const lastShown =
|
|
119659
|
-
const [outgoing, setOutgoing] =
|
|
120117
|
+
const lastShown = React12.useRef(null);
|
|
120118
|
+
const [outgoing, setOutgoing] = React12.useState(null);
|
|
119660
120119
|
useIsomorphicLayoutEffect(() => {
|
|
119661
120120
|
const was = lastShown.current;
|
|
119662
120121
|
if (!animate || !was || was.slot === shown2 || was.node == null) return void 0;
|
|
@@ -119664,7 +120123,7 @@ var init_renderNode = __esm({
|
|
|
119664
120123
|
const t2 = setTimeout(() => setOutgoing(null), fadeMs);
|
|
119665
120124
|
return () => clearTimeout(t2);
|
|
119666
120125
|
}, [shown2]);
|
|
119667
|
-
|
|
120126
|
+
React12.useEffect(() => {
|
|
119668
120127
|
lastShown.current = { slot: shown2, node: content };
|
|
119669
120128
|
});
|
|
119670
120129
|
if (changed.current && animate) {
|
|
@@ -119700,7 +120159,7 @@ var init_renderNode = __esm({
|
|
|
119700
120159
|
const onChangeAction = resolveRowAction2(props.onChange ?? cfg.onChange, ctx);
|
|
119701
120160
|
const borderless = props.borderless === true || cfg.borderless === true;
|
|
119702
120161
|
const secure = props.secure === true || cfg.secure === true;
|
|
119703
|
-
const [valueVisible, setValueVisible] =
|
|
120162
|
+
const [valueVisible, setValueVisible] = React12.useState(false);
|
|
119704
120163
|
const visibilityToggle = secure && (props.visibilityToggle === true || cfg.visibilityToggle === true);
|
|
119705
120164
|
const visibilityLabel = ctx.catalog?.get(valueVisible ? "auth.gate.password.hide" : "auth.gate.password.show") ?? (valueVisible ? "Hide password" : "Show password");
|
|
119706
120165
|
const erroredProp = props.error === true || cfg.error === true;
|
|
@@ -119714,20 +120173,20 @@ var init_renderNode = __esm({
|
|
|
119714
120173
|
const boundRawText = typeof boundVal === "string" ? boundVal : typeof boundVal === "number" ? String(boundVal) : void 0;
|
|
119715
120174
|
const boundText = serializeRichText && boundRawText !== void 0 ? richTextHtmlToPlainText(boundRawText) : boundRawText;
|
|
119716
120175
|
const literalText = typeof valueBinding === "string" ? serializeRichText ? richTextHtmlToPlainText(valueBinding) : valueBinding : "";
|
|
119717
|
-
const [local, setLocal] =
|
|
120176
|
+
const [local, setLocal] = React12.useState(
|
|
119718
120177
|
isBound ? boundText ?? "" : literalText
|
|
119719
120178
|
);
|
|
119720
|
-
const [edited, setEdited] =
|
|
119721
|
-
const [pristineRichValue, setPristineRichValue] =
|
|
120179
|
+
const [edited, setEdited] = React12.useState(false);
|
|
120180
|
+
const [pristineRichValue, setPristineRichValue] = React12.useState(
|
|
119722
120181
|
serializeRichText ? isBound ? boundRawText : typeof valueBinding === "string" ? valueBinding : void 0 : void 0
|
|
119723
120182
|
);
|
|
119724
|
-
const focused =
|
|
119725
|
-
const [touched, setTouched] =
|
|
119726
|
-
const [isFocused, setIsFocused] =
|
|
119727
|
-
const pendingEdits =
|
|
119728
|
-
const previousBoundText =
|
|
119729
|
-
const previousBoundRawText =
|
|
119730
|
-
|
|
120183
|
+
const focused = React12.useRef(false);
|
|
120184
|
+
const [touched, setTouched] = React12.useState(false);
|
|
120185
|
+
const [isFocused, setIsFocused] = React12.useState(false);
|
|
120186
|
+
const pendingEdits = React12.useRef([]);
|
|
120187
|
+
const previousBoundText = React12.useRef(boundText);
|
|
120188
|
+
const previousBoundRawText = React12.useRef(boundRawText);
|
|
120189
|
+
React12.useEffect(() => {
|
|
119731
120190
|
if (!isBound || boundText === void 0) return;
|
|
119732
120191
|
const boundTextChanged = previousBoundText.current !== boundText;
|
|
119733
120192
|
const boundRawTextChanged = previousBoundRawText.current !== boundRawText;
|
|
@@ -119758,23 +120217,23 @@ var init_renderNode = __esm({
|
|
|
119758
120217
|
}
|
|
119759
120218
|
if (!focused.current && boundText !== local) setLocal(boundText);
|
|
119760
120219
|
}, [boundText, serializeRichText ? boundRawText : void 0, isFocused, serializeRichText ? edited : false]);
|
|
119761
|
-
const formBag =
|
|
120220
|
+
const formBag = React12.useContext(FormValuesContext);
|
|
119762
120221
|
const fieldId = props.__formFieldId;
|
|
119763
|
-
const previousBinding =
|
|
120222
|
+
const previousBinding = React12.useRef(binding2);
|
|
119764
120223
|
const rule = props.validation ?? cfg.validation;
|
|
119765
120224
|
const { "aria-labelledby": labelledBy } = formFieldA11y(props);
|
|
119766
120225
|
const required3 = rule?.required === true || void 0;
|
|
119767
|
-
const ruleKey =
|
|
119768
|
-
|
|
120226
|
+
const ruleKey = React12.useMemo(() => rule ? JSON.stringify(rule) : "", [rule]);
|
|
120227
|
+
React12.useEffect(() => {
|
|
119769
120228
|
if (!formBag || !fieldId) return;
|
|
119770
120229
|
formBag.register(fieldId, rule);
|
|
119771
120230
|
return () => formBag.unregister(fieldId);
|
|
119772
120231
|
}, [fieldId, formBag, ruleKey]);
|
|
119773
120232
|
const formValue = serializeRichText && !edited && pristineRichValue !== void 0 ? pristineRichValue : serializeRichText ? richTextEditedHtml(pristineRichValue, pristineRichValue === void 0 ? "" : richTextHtmlToPlainText(pristineRichValue), local) : local;
|
|
119774
|
-
|
|
120233
|
+
React12.useEffect(() => {
|
|
119775
120234
|
if (formBag && fieldId) formBag.set(fieldId, formValue);
|
|
119776
120235
|
}, [formValue, fieldId, formBag, binding2]);
|
|
119777
|
-
|
|
120236
|
+
React12.useEffect(() => {
|
|
119778
120237
|
if (previousBinding.current === binding2) return;
|
|
119779
120238
|
previousBinding.current = binding2;
|
|
119780
120239
|
pendingEdits.current = [];
|
|
@@ -119793,7 +120252,7 @@ var init_renderNode = __esm({
|
|
|
119793
120252
|
const errorTextRaw = props.errorText ?? cfg.errorText;
|
|
119794
120253
|
const errorTextResolved = useBoundString(errorTextRaw, ctx);
|
|
119795
120254
|
const workerError = typeof boundError === "string" ? boundError : errorTextRaw == null ? void 0 : errorTextResolved;
|
|
119796
|
-
const validationCatalog =
|
|
120255
|
+
const validationCatalog = React12.useMemo(
|
|
119797
120256
|
() => ctx.catalog ? new Proxy({}, { get: (_t2, k2) => typeof k2 === "string" ? ctx.catalog.get(k2) : void 0 }) : void 0,
|
|
119798
120257
|
[ctx.catalog]
|
|
119799
120258
|
);
|
|
@@ -119808,7 +120267,7 @@ var init_renderNode = __esm({
|
|
|
119808
120267
|
const hasWorkerError = Boolean(workerError && workerError.trim());
|
|
119809
120268
|
const painted2 = rawMessage === null ? "" : translateOnly(rawMessage);
|
|
119810
120269
|
const message = !painted2.trim() || ruleMessagePending && !hasWorkerError ? null : painted2;
|
|
119811
|
-
const [feedbackShown, setFeedbackShown] =
|
|
120270
|
+
const [feedbackShown, setFeedbackShown] = React12.useState(false);
|
|
119812
120271
|
const revealed = message !== null && shouldRevealError({
|
|
119813
120272
|
rule,
|
|
119814
120273
|
feedbackShown,
|
|
@@ -119817,11 +120276,11 @@ var init_renderNode = __esm({
|
|
|
119817
120276
|
focused: isFocused,
|
|
119818
120277
|
submitAttempted: formBag?.submitAttempted ?? false
|
|
119819
120278
|
});
|
|
119820
|
-
|
|
120279
|
+
React12.useEffect(() => {
|
|
119821
120280
|
if (revealed) setFeedbackShown(true);
|
|
119822
120281
|
}, [revealed]);
|
|
119823
120282
|
const errored = erroredProp || revealed;
|
|
119824
|
-
const generatedId =
|
|
120283
|
+
const generatedId = React12.useId();
|
|
119825
120284
|
const errorId = revealed ? `${componentId ?? generatedId}__error` : void 0;
|
|
119826
120285
|
const emit = (v2) => {
|
|
119827
120286
|
if (onChangeAction && ctx.onAction) {
|
|
@@ -119833,16 +120292,16 @@ var init_renderNode = __esm({
|
|
|
119833
120292
|
});
|
|
119834
120293
|
}
|
|
119835
120294
|
};
|
|
119836
|
-
const ownsPrivateDraft =
|
|
119837
|
-
|
|
120295
|
+
const ownsPrivateDraft = React12.useRef(false);
|
|
120296
|
+
React12.useEffect(() => {
|
|
119838
120297
|
if (visibilityToggle && !isBound) ownsPrivateDraft.current = true;
|
|
119839
120298
|
}, [visibilityToggle, isBound]);
|
|
119840
|
-
const clearSensitiveDraft =
|
|
120299
|
+
const clearSensitiveDraft = React12.useRef(() => {
|
|
119841
120300
|
});
|
|
119842
120301
|
clearSensitiveDraft.current = () => {
|
|
119843
120302
|
if (ownsPrivateDraft.current && !isBound) emit("");
|
|
119844
120303
|
};
|
|
119845
|
-
|
|
120304
|
+
React12.useEffect(() => () => clearSensitiveDraft.current(), []);
|
|
119846
120305
|
const onInput = (e2) => {
|
|
119847
120306
|
const v2 = e2.currentTarget.value;
|
|
119848
120307
|
setLocal(v2);
|
|
@@ -119874,7 +120333,7 @@ var init_renderNode = __esm({
|
|
|
119874
120333
|
const submitLabelRaw = props.submitLabel ?? cfg.submitLabel;
|
|
119875
120334
|
const onSubmitAction = props.onSubmit ?? cfg.onSubmit;
|
|
119876
120335
|
const enterKeyHint = !multilineBox && ENTER_KEY_HINTS.has(submitLabelRaw) ? submitLabelRaw : !multilineBox && onSubmitAction ? "done" : void 0;
|
|
119877
|
-
const inputRef =
|
|
120336
|
+
const inputRef = React12.useRef(null);
|
|
119878
120337
|
useIsomorphicLayoutEffect(() => {
|
|
119879
120338
|
const el2 = inputRef.current;
|
|
119880
120339
|
const view = el2?.ownerDocument?.defaultView;
|
|
@@ -119889,8 +120348,8 @@ var init_renderNode = __esm({
|
|
|
119889
120348
|
}, [local, multilineBox, maxLines]);
|
|
119890
120349
|
const focusBinding = (typeof props.focusPath === "string" ? props.focusPath : typeof cfg.focusPath === "string" ? cfg.focusPath : void 0) ?? "";
|
|
119891
120350
|
const focusTokenVal = useBoundValue(ctx, focusBinding);
|
|
119892
|
-
const lastFocusToken =
|
|
119893
|
-
|
|
120351
|
+
const lastFocusToken = React12.useRef(void 0);
|
|
120352
|
+
React12.useEffect(() => {
|
|
119894
120353
|
if (!focusBinding) return;
|
|
119895
120354
|
const next = typeof focusTokenVal === "string" ? focusTokenVal : typeof focusTokenVal === "number" ? String(focusTokenVal) : "";
|
|
119896
120355
|
if (!next || next === lastFocusToken.current) return;
|
|
@@ -119965,8 +120424,8 @@ var init_renderNode = __esm({
|
|
|
119965
120424
|
};
|
|
119966
120425
|
MENU_ANCHOR_CONTROL = 'a[href], button, input, select, textarea, [tabindex]:not([tabindex="-1"]), [role="button"], [role="link"]';
|
|
119967
120426
|
MenuNode = withExtras("MenuNode", ({ props, ctx, wrap }) => {
|
|
119968
|
-
const [open, setOpen] =
|
|
119969
|
-
const hostRef =
|
|
120427
|
+
const [open, setOpen] = React12.useState(false);
|
|
120428
|
+
const hostRef = React12.useRef(null);
|
|
119970
120429
|
const context = menuOpensOnLongPress(props.style);
|
|
119971
120430
|
const itemsPath = typeof props.itemsPath === "string" && props.itemsPath.startsWith("$service:") ? props.itemsPath : "";
|
|
119972
120431
|
const boundItems = useBoundValue(ctx, itemsPath);
|
|
@@ -119974,7 +120433,7 @@ var init_renderNode = __esm({
|
|
|
119974
120433
|
const previewMode = context && props.preview != null;
|
|
119975
120434
|
const items = sourceItems.map((it2) => ({ ...it2, label: typeof it2?.label === "string" && it2.label.startsWith("$item") ? resolveItemDeep2(it2.label, ctx) : it2?.label, disabled: it2?.disabled === true || !it2?.action }));
|
|
119976
120435
|
const C2 = ctx.color;
|
|
119977
|
-
|
|
120436
|
+
React12.useEffect(() => {
|
|
119978
120437
|
if (!open) return;
|
|
119979
120438
|
const onTop = () => menuRef.current != null && isWithinTopModal(menuRef.current);
|
|
119980
120439
|
const onDown = (e2) => {
|
|
@@ -120000,11 +120459,11 @@ var init_renderNode = __esm({
|
|
|
120000
120459
|
const flexGrow = typeof wrap?.flex === "string" ? parseFloat(wrap.flex) : typeof wrap?.flex === "number" ? wrap.flex : Number(wrap?.flexGrow ?? 0);
|
|
120001
120460
|
const fill = wrap?.width === "100%" || Number.isFinite(flexGrow) && flexGrow > 0;
|
|
120002
120461
|
const popupPlacement = fill ? { position: "absolute", top: "100%", left: 0, right: 0, zIndex: 20, marginTop: 4 } : { position: "absolute", top: "100%", right: 0, zIndex: 20, marginTop: 4 };
|
|
120003
|
-
const anchorRef =
|
|
120004
|
-
const menuRef =
|
|
120005
|
-
const dialogRef =
|
|
120006
|
-
const [popupAlignLeft, setPopupAlignLeft] =
|
|
120007
|
-
const [popupAbove, setPopupAbove] =
|
|
120462
|
+
const anchorRef = React12.useRef(null);
|
|
120463
|
+
const menuRef = React12.useRef(null);
|
|
120464
|
+
const dialogRef = React12.useRef(null);
|
|
120465
|
+
const [popupAlignLeft, setPopupAlignLeft] = React12.useState(false);
|
|
120466
|
+
const [popupAbove, setPopupAbove] = React12.useState(false);
|
|
120008
120467
|
useIsomorphicLayoutEffect(() => {
|
|
120009
120468
|
if (!open || !anchorRef.current || !menuRef.current) return;
|
|
120010
120469
|
const anchor = anchorRef.current.getBoundingClientRect();
|
|
@@ -120026,8 +120485,8 @@ var init_renderNode = __esm({
|
|
|
120026
120485
|
setPopupAlignLeft(anchor.right - popup.width < left);
|
|
120027
120486
|
setPopupAbove(anchor.bottom + popup.height + 4 > bottom && anchor.top - popup.height - 4 >= top);
|
|
120028
120487
|
});
|
|
120029
|
-
const [innerControl, setInnerControl] =
|
|
120030
|
-
const innerControlRef =
|
|
120488
|
+
const [innerControl, setInnerControl] = React12.useState(null);
|
|
120489
|
+
const innerControlRef = React12.useRef(null);
|
|
120031
120490
|
useIsomorphicLayoutEffect(() => {
|
|
120032
120491
|
const anchor = anchorRef.current;
|
|
120033
120492
|
const refresh = () => {
|
|
@@ -120043,7 +120502,7 @@ var init_renderNode = __esm({
|
|
|
120043
120502
|
observer.observe(anchor, { childList: true, subtree: true, attributes: true, attributeFilter: ["disabled", "tabindex", "href", "role"] });
|
|
120044
120503
|
return () => observer.disconnect();
|
|
120045
120504
|
});
|
|
120046
|
-
|
|
120505
|
+
React12.useEffect(() => {
|
|
120047
120506
|
if (!innerControl) return;
|
|
120048
120507
|
innerControl.setAttribute("aria-haspopup", "menu");
|
|
120049
120508
|
innerControl.setAttribute("aria-expanded", String(open));
|
|
@@ -120055,13 +120514,13 @@ var init_renderNode = __esm({
|
|
|
120055
120514
|
};
|
|
120056
120515
|
}, [innerControl, open]);
|
|
120057
120516
|
const itemsKey = items.map((it2, i2) => `${it2?.id ?? i2}:${it2?.disabled ? 0 : 1}`).join("|");
|
|
120058
|
-
|
|
120517
|
+
React12.useEffect(() => {
|
|
120059
120518
|
if (!open || !modal) return;
|
|
120060
120519
|
const menu = menuRef.current;
|
|
120061
120520
|
if (!menu || menu.contains(document.activeElement)) return;
|
|
120062
120521
|
(menu.querySelector('[role="menuitem"][tabindex="0"]') ?? menu).focus();
|
|
120063
120522
|
}, [open, modal, itemsKey]);
|
|
120064
|
-
|
|
120523
|
+
React12.useEffect(() => {
|
|
120065
120524
|
if (!open || !modal) return;
|
|
120066
120525
|
const layer = pushModalLayer(() => dialogRef.current);
|
|
120067
120526
|
return () => {
|
|
@@ -120083,11 +120542,11 @@ var init_renderNode = __esm({
|
|
|
120083
120542
|
e2.preventDefault();
|
|
120084
120543
|
items2[next].focus();
|
|
120085
120544
|
};
|
|
120086
|
-
const pressTimer =
|
|
120087
|
-
const longPressed =
|
|
120088
|
-
const touchOrigin =
|
|
120089
|
-
const suppressNextClick =
|
|
120090
|
-
const suppressTimer =
|
|
120545
|
+
const pressTimer = React12.useRef(null);
|
|
120546
|
+
const longPressed = React12.useRef(false);
|
|
120547
|
+
const touchOrigin = React12.useRef(null);
|
|
120548
|
+
const suppressNextClick = React12.useRef(false);
|
|
120549
|
+
const suppressTimer = React12.useRef(null);
|
|
120091
120550
|
const clearSuppress = () => {
|
|
120092
120551
|
suppressNextClick.current = false;
|
|
120093
120552
|
if (suppressTimer.current != null) {
|
|
@@ -120101,7 +120560,7 @@ var init_renderNode = __esm({
|
|
|
120101
120560
|
pressTimer.current = null;
|
|
120102
120561
|
}
|
|
120103
120562
|
};
|
|
120104
|
-
|
|
120563
|
+
React12.useEffect(() => () => {
|
|
120105
120564
|
cancelPress();
|
|
120106
120565
|
clearSuppress();
|
|
120107
120566
|
}, []);
|
|
@@ -120265,11 +120724,11 @@ var init_renderNode = __esm({
|
|
|
120265
120724
|
LoadMoreSentinel = ({ ctx, pagination, style }) => {
|
|
120266
120725
|
const raw = pagination?.cursor;
|
|
120267
120726
|
const isBound = typeof raw === "string" && isBinding(raw);
|
|
120268
|
-
const
|
|
120269
|
-
const cursor = isBound ? typeof
|
|
120270
|
-
const ref =
|
|
120271
|
-
const fired =
|
|
120272
|
-
|
|
120727
|
+
const bound2 = useBoundValue(ctx, isBound ? raw : "");
|
|
120728
|
+
const cursor = isBound ? typeof bound2 === "string" ? bound2 : "" : String(raw ?? "");
|
|
120729
|
+
const ref = React12.useRef(null);
|
|
120730
|
+
const fired = React12.useRef("");
|
|
120731
|
+
React12.useEffect(() => {
|
|
120273
120732
|
fired.current = "";
|
|
120274
120733
|
const el2 = ref.current;
|
|
120275
120734
|
if (!cursor || !ctx.onAction || !el2 || typeof IntersectionObserver === "undefined") return;
|
|
@@ -120289,8 +120748,8 @@ var init_renderNode = __esm({
|
|
|
120289
120748
|
const literalErrorText = useBoundString(props.text ?? props.message, ctx);
|
|
120290
120749
|
const C2 = ctx.color;
|
|
120291
120750
|
const isBoundText = typeof props.textPath === "string" && isBinding(props.textPath);
|
|
120292
|
-
const
|
|
120293
|
-
const text11 = isBoundText ? typeof
|
|
120751
|
+
const bound2 = useResolvedScalar(isBoundText ? props.textPath : void 0, ctx);
|
|
120752
|
+
const text11 = isBoundText ? typeof bound2 === "string" || typeof bound2 === "number" ? String(bound2) : "" : literalErrorText;
|
|
120294
120753
|
if (props.visible === false) return null;
|
|
120295
120754
|
if (isBoundText && !text11) return null;
|
|
120296
120755
|
const c2 = (props.severity ?? "error") === "warning" ? C2("warning", "#E89F00") : C2("danger", "#E62214");
|
|
@@ -120300,11 +120759,11 @@ var init_renderNode = __esm({
|
|
|
120300
120759
|
] });
|
|
120301
120760
|
});
|
|
120302
120761
|
FormView = withExtras("FormView", ({ props, ctx, wrap }) => {
|
|
120303
|
-
const bagRef =
|
|
120762
|
+
const bagRef = React12.useRef(null);
|
|
120304
120763
|
if (!bagRef.current) bagRef.current = createFormBag();
|
|
120305
120764
|
const bag = bagRef.current;
|
|
120306
|
-
|
|
120307
|
-
|
|
120765
|
+
React12.useSyncExternalStore(
|
|
120766
|
+
React12.useCallback((cb) => bag.subscribe(cb), [bag]),
|
|
120308
120767
|
() => bag.version,
|
|
120309
120768
|
() => bag.version
|
|
120310
120769
|
);
|
|
@@ -120321,7 +120780,7 @@ var init_renderNode = __esm({
|
|
|
120321
120780
|
ctx.onAction?.({ ...action, args: merged });
|
|
120322
120781
|
}
|
|
120323
120782
|
};
|
|
120324
|
-
const submitNode =
|
|
120783
|
+
const submitNode = React12.useMemo(() => {
|
|
120325
120784
|
const node = props.submitButton;
|
|
120326
120785
|
if (!node || valid) return node;
|
|
120327
120786
|
if (node.body) return { ...node, body: { ...node.body, props: { ...node.body.props ?? {}, disabled: true } } };
|
|
@@ -120371,11 +120830,11 @@ var init_renderNode = __esm({
|
|
|
120371
120830
|
const startPositionPath = typeof props.startPositionSeconds === "string" && isBinding(props.startPositionSeconds) ? props.startPositionSeconds : "";
|
|
120372
120831
|
const boundStartPosition = useResolvedScalar(startPositionPath || void 0, ctx);
|
|
120373
120832
|
const initialStartPosition = startPositionPath && typeof boundStartPosition === "number" && Number.isFinite(boundStartPosition) ? Math.max(0, boundStartPosition) : Math.max(0, Number.isFinite(Number(props.startPositionSeconds)) ? Number(props.startPositionSeconds) : 0);
|
|
120374
|
-
const [index, setIndex] =
|
|
120833
|
+
const [index, setIndex] = React12.useState(initialIndex);
|
|
120375
120834
|
const queueReady = !itemsPath || Array.isArray(boundQueue);
|
|
120376
120835
|
const seatKey = `${itemsPath ?? ""}|${startIndex}`;
|
|
120377
|
-
const seated =
|
|
120378
|
-
|
|
120836
|
+
const seated = React12.useRef(null);
|
|
120837
|
+
React12.useEffect(() => {
|
|
120379
120838
|
const last = Math.max(0, resolvedItems.length - 1);
|
|
120380
120839
|
if (resolvedItems.length === 0) return;
|
|
120381
120840
|
if (queueReady && seated.current !== seatKey) {
|
|
@@ -120390,19 +120849,19 @@ var init_renderNode = __esm({
|
|
|
120390
120849
|
}
|
|
120391
120850
|
setIndex((i2) => Math.min(Math.max(0, i2), last));
|
|
120392
120851
|
}, [resolvedItems.length, startIndex, queueReady, seatKey]);
|
|
120393
|
-
const [status, setStatus] =
|
|
120394
|
-
const [position, setPosition] =
|
|
120395
|
-
const [duration2, setDuration] =
|
|
120396
|
-
const [buffered, setBuffered] =
|
|
120397
|
-
const [rate, setRateState] =
|
|
120398
|
-
const [fullscreen, setFullscreen] =
|
|
120399
|
-
const [error, setError] =
|
|
120400
|
-
const mediaRef =
|
|
120401
|
-
const hostRef =
|
|
120402
|
-
const autoplayConsumed =
|
|
120852
|
+
const [status, setStatus] = React12.useState("idle");
|
|
120853
|
+
const [position, setPosition] = React12.useState(initialStartPosition);
|
|
120854
|
+
const [duration2, setDuration] = React12.useState(0);
|
|
120855
|
+
const [buffered, setBuffered] = React12.useState(0);
|
|
120856
|
+
const [rate, setRateState] = React12.useState(1);
|
|
120857
|
+
const [fullscreen, setFullscreen] = React12.useState(false);
|
|
120858
|
+
const [error, setError] = React12.useState("");
|
|
120859
|
+
const mediaRef = React12.useRef(null);
|
|
120860
|
+
const hostRef = React12.useRef(null);
|
|
120861
|
+
const autoplayConsumed = React12.useRef(false);
|
|
120403
120862
|
const item = resolvedItems[index];
|
|
120404
120863
|
const mediaKey2 = `${index}:${item?.id ?? item?.url ?? ""}`;
|
|
120405
|
-
|
|
120864
|
+
React12.useEffect(() => {
|
|
120406
120865
|
const outgoing = mediaRef.current;
|
|
120407
120866
|
return () => {
|
|
120408
120867
|
try {
|
|
@@ -120416,7 +120875,7 @@ var init_renderNode = __esm({
|
|
|
120416
120875
|
const isYouTube = provider === "youtube";
|
|
120417
120876
|
const isUnsupportedProvider = provider !== "direct" && !isYouTube;
|
|
120418
120877
|
const isAudio = ["audio", "podcast", "radio"].includes(String(item?.kind ?? ""));
|
|
120419
|
-
const capabilities =
|
|
120878
|
+
const capabilities = React12.useMemo(() => ({
|
|
120420
120879
|
seek: !isUnsupportedProvider && item?.live !== true,
|
|
120421
120880
|
rate: !isUnsupportedProvider && item?.live !== true,
|
|
120422
120881
|
queue: !isUnsupportedProvider && items.length > 1,
|
|
@@ -120444,9 +120903,9 @@ var init_renderNode = __esm({
|
|
|
120444
120903
|
error,
|
|
120445
120904
|
capabilities
|
|
120446
120905
|
};
|
|
120447
|
-
const slotProvider =
|
|
120448
|
-
|
|
120449
|
-
|
|
120906
|
+
const slotProvider = React12.useMemo(() => new MediaSlotProvider(state), []);
|
|
120907
|
+
React12.useEffect(() => slotProvider.set(state));
|
|
120908
|
+
React12.useEffect(() => {
|
|
120450
120909
|
if (!startPositionPath || typeof boundStartPosition !== "number" || !Number.isFinite(boundStartPosition) || status !== "idle") return;
|
|
120451
120910
|
const next = Math.max(0, boundStartPosition);
|
|
120452
120911
|
setPosition(next);
|
|
@@ -120457,7 +120916,7 @@ var init_renderNode = __esm({
|
|
|
120457
120916
|
}
|
|
120458
120917
|
}
|
|
120459
120918
|
}, [startPositionPath, boundStartPosition, status]);
|
|
120460
|
-
const emit =
|
|
120919
|
+
const emit = React12.useCallback((action, extra = {}) => {
|
|
120461
120920
|
if (!action || !ctx.onAction) return;
|
|
120462
120921
|
const snapshot2 = {
|
|
120463
120922
|
sessionId,
|
|
@@ -120476,13 +120935,13 @@ var init_renderNode = __esm({
|
|
|
120476
120935
|
};
|
|
120477
120936
|
ctx.onAction({ ...action, args: { ...action.args ?? {}, ...snapshot2, ...extra }, params: { ...action.params ?? {}, sessionId, index: String(index), ...Object.fromEntries(Object.entries(extra).map(([k2, v2]) => [k2, String(v2)])) } });
|
|
120478
120937
|
}, [ctx.onAction, sessionId, status, index, position, duration2, item, buffered, rate, props.muted, fullscreen, error]);
|
|
120479
|
-
|
|
120938
|
+
React12.useEffect(() => {
|
|
120480
120939
|
if (!isUnsupportedProvider || status === "error") return;
|
|
120481
120940
|
setStatus("error");
|
|
120482
120941
|
setError("provider_unsupported");
|
|
120483
120942
|
emit(props.onError, { state: "error", status: "error", error: "provider_unsupported", code: "provider_unsupported" });
|
|
120484
120943
|
}, [isUnsupportedProvider, status, emit, props.onError]);
|
|
120485
|
-
const play =
|
|
120944
|
+
const play = React12.useCallback(async () => {
|
|
120486
120945
|
if (isYouTube) return;
|
|
120487
120946
|
if (isUnsupportedProvider) {
|
|
120488
120947
|
setStatus("error");
|
|
@@ -120504,17 +120963,17 @@ var init_renderNode = __esm({
|
|
|
120504
120963
|
emit(props.onError, { state: "blocked", status: "blocked", error: message, code: "playback_blocked" });
|
|
120505
120964
|
}
|
|
120506
120965
|
}, [isYouTube, isUnsupportedProvider, emit, props.onError]);
|
|
120507
|
-
const pause =
|
|
120966
|
+
const pause = React12.useCallback(() => {
|
|
120508
120967
|
mediaRef.current?.pause();
|
|
120509
120968
|
setStatus("paused");
|
|
120510
120969
|
}, []);
|
|
120511
|
-
const seek =
|
|
120970
|
+
const seek = React12.useCallback((seconds) => {
|
|
120512
120971
|
const media = mediaRef.current;
|
|
120513
120972
|
if (!media || !Number.isFinite(seconds)) return;
|
|
120514
120973
|
media.currentTime = Math.max(0, Math.min(seconds, Number.isFinite(media.duration) ? media.duration : seconds));
|
|
120515
120974
|
setPosition(media.currentTime);
|
|
120516
120975
|
}, []);
|
|
120517
|
-
const select2 =
|
|
120976
|
+
const select2 = React12.useCallback((next) => {
|
|
120518
120977
|
if (resolvedItems.length === 0) return;
|
|
120519
120978
|
const normalized = (next % resolvedItems.length + resolvedItems.length) % resolvedItems.length;
|
|
120520
120979
|
const nextItem = resolvedItems[normalized];
|
|
@@ -120536,7 +120995,7 @@ var init_renderNode = __esm({
|
|
|
120536
120995
|
error: ""
|
|
120537
120996
|
});
|
|
120538
120997
|
}, [resolvedItems, emit, props.onItemChange]);
|
|
120539
|
-
const toggleFullscreen =
|
|
120998
|
+
const toggleFullscreen = React12.useCallback(async () => {
|
|
120540
120999
|
if (props.fullscreen === "disabled") return;
|
|
120541
121000
|
const host = hostRef.current;
|
|
120542
121001
|
try {
|
|
@@ -120546,7 +121005,7 @@ var init_renderNode = __esm({
|
|
|
120546
121005
|
setFullscreen((value) => !value);
|
|
120547
121006
|
}
|
|
120548
121007
|
}, [props.fullscreen]);
|
|
120549
|
-
|
|
121008
|
+
React12.useEffect(() => {
|
|
120550
121009
|
const listener = (event) => {
|
|
120551
121010
|
const detail = event.detail;
|
|
120552
121011
|
if (!detail || detail.sessionId !== sessionId) return;
|
|
@@ -120594,7 +121053,7 @@ var init_renderNode = __esm({
|
|
|
120594
121053
|
window.addEventListener("himalaya-media-command", listener);
|
|
120595
121054
|
return () => window.removeEventListener("himalaya-media-command", listener);
|
|
120596
121055
|
}, [sessionId, index, play, pause, seek, select2, toggleFullscreen]);
|
|
120597
|
-
|
|
121056
|
+
React12.useEffect(() => {
|
|
120598
121057
|
const listener = () => {
|
|
120599
121058
|
const value = document.fullscreenElement === hostRef.current;
|
|
120600
121059
|
setFullscreen(value);
|
|
@@ -120603,14 +121062,14 @@ var init_renderNode = __esm({
|
|
|
120603
121062
|
document.addEventListener("fullscreenchange", listener);
|
|
120604
121063
|
return () => document.removeEventListener("fullscreenchange", listener);
|
|
120605
121064
|
}, [emit, props.onFullscreenChange]);
|
|
120606
|
-
|
|
121065
|
+
React12.useEffect(() => {
|
|
120607
121066
|
const media = mediaRef.current;
|
|
120608
121067
|
if (!media || isYouTube || isUnsupportedProvider) return;
|
|
120609
121068
|
media.muted = props.muted === true;
|
|
120610
121069
|
media.playbackRate = rate;
|
|
120611
121070
|
if (position > 0) media.currentTime = position;
|
|
120612
121071
|
}, [item?.url, isUnsupportedProvider]);
|
|
120613
|
-
|
|
121072
|
+
React12.useEffect(() => {
|
|
120614
121073
|
if (isYouTube || isUnsupportedProvider || props.autoplay === "never" || autoplayConsumed.current) return;
|
|
120615
121074
|
if (props.autoplay === "once") {
|
|
120616
121075
|
autoplayConsumed.current = true;
|
|
@@ -120812,15 +121271,15 @@ var init_renderNode = __esm({
|
|
|
120812
121271
|
}
|
|
120813
121272
|
);
|
|
120814
121273
|
});
|
|
120815
|
-
PdfDocumentCanvas =
|
|
121274
|
+
PdfDocumentCanvas = React12.lazy(() => Promise.resolve().then(() => (init_pdfDocument(), pdfDocument_exports)).then((module) => ({ default: module.PdfDocument })));
|
|
120816
121275
|
PdfViewNode = withExtras("PdfViewNode", ({ props, ctx, wrap }) => {
|
|
120817
121276
|
const boundUrl = useResolvedScalar(props.url != null && isBinding(props.url) ? props.url : void 0, ctx);
|
|
120818
121277
|
const url = props.url != null && isBinding(props.url) ? boundUrl : props.url;
|
|
120819
121278
|
const rawUrl = typeof url === "string" && !isBinding(url) ? url : "";
|
|
120820
121279
|
const plan = rawUrl ? pdfEmbedPlan(rawUrl, void 0, typeof document !== "undefined" ? document.baseURI : void 0) : null;
|
|
120821
121280
|
const retypeSrc = plan?.mode === "retype" ? plan.src : null;
|
|
120822
|
-
const [retyped, setRetyped] =
|
|
120823
|
-
|
|
121281
|
+
const [retyped, setRetyped] = React12.useState(null);
|
|
121282
|
+
React12.useEffect(() => {
|
|
120824
121283
|
if (!retypeSrc) return;
|
|
120825
121284
|
let live3 = true;
|
|
120826
121285
|
let made = null;
|
|
@@ -120842,11 +121301,11 @@ var init_renderNode = __esm({
|
|
|
120842
121301
|
}, [retypeSrc]);
|
|
120843
121302
|
const settled = retyped && retyped.from === retypeSrc ? retyped : null;
|
|
120844
121303
|
const wantsShare = props.allowShare === true;
|
|
120845
|
-
const [fellBackFrom, setFellBackFrom] =
|
|
121304
|
+
const [fellBackFrom, setFellBackFrom] = React12.useState(null);
|
|
120846
121305
|
const directFellBack = plan?.mode === "direct" && fellBackFrom === plan.src;
|
|
120847
121306
|
const directSrc = plan?.mode === "direct" && (wantsShare || props.showPageControls !== false && directFellBack) ? plan.src : null;
|
|
120848
|
-
const [direct, setDirect] =
|
|
120849
|
-
|
|
121307
|
+
const [direct, setDirect] = React12.useState(null);
|
|
121308
|
+
React12.useEffect(() => {
|
|
120850
121309
|
if (!directSrc) return;
|
|
120851
121310
|
let live3 = true;
|
|
120852
121311
|
let made = null;
|
|
@@ -120863,16 +121322,16 @@ var init_renderNode = __esm({
|
|
|
120863
121322
|
}, [directSrc, wantsShare]);
|
|
120864
121323
|
const directDoc = direct && direct.from === directSrc ? direct : null;
|
|
120865
121324
|
const fallbackPageCount = plan?.mode === "retype" ? settled?.pageCount ?? null : directDoc?.count ?? null;
|
|
120866
|
-
const [nav, setNav] =
|
|
121325
|
+
const [nav, setNav] = React12.useState({ from: rawUrl, page: null, zoom: null });
|
|
120867
121326
|
const view = nav.from === rawUrl ? nav : { from: rawUrl, page: null, zoom: null };
|
|
120868
121327
|
const src = plan?.mode === "direct" ? plan.src : settled?.url ?? null;
|
|
120869
|
-
const [canvasCount, setCanvasCount] =
|
|
120870
|
-
const onPageCount =
|
|
121328
|
+
const [canvasCount, setCanvasCount] = React12.useState(null);
|
|
121329
|
+
const onPageCount = React12.useCallback((count2) => {
|
|
120871
121330
|
if (!Number.isInteger(count2) || count2 < 1) return;
|
|
120872
121331
|
setCanvasCount((cur) => cur?.from === src && cur.count === count2 ? cur : { from: src, count: count2 });
|
|
120873
121332
|
}, [src]);
|
|
120874
121333
|
const pageCount = canvasCount?.from === src ? canvasCount.count : fallbackPageCount;
|
|
120875
|
-
const onFallback =
|
|
121334
|
+
const onFallback = React12.useCallback(() => setFellBackFrom(src), [src]);
|
|
120876
121335
|
const loading = plan?.mode === "retype" && !settled || directSrc != null && wantsShare && !directDoc && typeof window !== "undefined";
|
|
120877
121336
|
const loadSrc = plan?.mode === "direct" && wantsShare ? directDoc?.blobUrl ?? src : src;
|
|
120878
121337
|
const ph = typeof props.height === "number" && props.height > 0 ? props.height : void 0;
|
|
@@ -120922,7 +121381,7 @@ var init_renderNode = __esm({
|
|
|
120922
121381
|
const data = base + pdfOpenFragment(sourceHash, { page, zoom: zoomable ? view.zoom : null, fitWidth: !zoomable });
|
|
120923
121382
|
const label3 = typeof props.title === "string" && props.title ? props.title : "PDF document";
|
|
120924
121383
|
const documentStyle = showPageControls || zoomable || allowShare ? { display: "block", width: "100%", flex: "1 1 auto", minHeight: ph ? 0 : 280, border: "none" } : frame;
|
|
120925
|
-
const object9 = typeof window === "undefined" ? /* @__PURE__ */ jsx11("object", { "data-himalaya-pdf": "static-fallback", data, type: "application/pdf", "aria-label": label3, style: documentStyle }) : /* @__PURE__ */ jsx11(
|
|
121384
|
+
const object9 = typeof window === "undefined" ? /* @__PURE__ */ jsx11("object", { "data-himalaya-pdf": "static-fallback", data, type: "application/pdf", "aria-label": label3, style: documentStyle }) : /* @__PURE__ */ jsx11(React12.Suspense, { fallback: /* @__PURE__ */ jsx11("div", { "data-himalaya-pdf": "loading", role: "img", "aria-label": "loading document", "aria-busy": "true", style: documentStyle }), children: /* @__PURE__ */ jsx11(
|
|
120926
121385
|
PdfDocumentCanvas,
|
|
120927
121386
|
{
|
|
120928
121387
|
src: loadSrc ?? src,
|
|
@@ -120986,7 +121445,7 @@ var init_renderNode = __esm({
|
|
|
120986
121445
|
)
|
|
120987
121446
|
] });
|
|
120988
121447
|
});
|
|
120989
|
-
WebViewNode = withExtras("WebViewNode", ({ props, ctx, wrap }) => {
|
|
121448
|
+
WebViewNode = withExtras("WebViewNode", ({ props, ctx, wrap, nodeId }) => {
|
|
120990
121449
|
const boundUrl = useResolvedScalar(props.url != null && isBinding(props.url) ? props.url : void 0, ctx);
|
|
120991
121450
|
const boundHtml = useResolvedScalar(props.inlineHtml != null && isBinding(props.inlineHtml) ? props.inlineHtml : void 0, ctx);
|
|
120992
121451
|
const url = props.url != null && isBinding(props.url) ? boundUrl : props.url;
|
|
@@ -120998,26 +121457,63 @@ var init_renderNode = __esm({
|
|
|
120998
121457
|
const htmlStr = rawHtml != null ? injectIntoInlineHtml(rawHtml, config, scrollEnabled) : void 0;
|
|
120999
121458
|
const urlAllowed = urlStr != null && (config.allowedOrigins.length === 0 || webViewOriginAllowed(urlStr, config.allowedOrigins));
|
|
121000
121459
|
const urlFrame = urlStr && urlAllowed ? webviewFrameSandbox(urlStr) : null;
|
|
121001
|
-
const
|
|
121460
|
+
const boundHeight = useResolvedScalar(props.heightPath != null && isBinding(props.heightPath) ? props.heightPath : void 0, ctx);
|
|
121461
|
+
const fill = props.fill === true;
|
|
121462
|
+
const h2 = typeof boundHeight === "number" && boundHeight > 0 ? boundHeight : typeof props.height === "number" && props.height > 0 ? props.height : void 0;
|
|
121002
121463
|
const ar2 = typeof props.aspectRatio === "number" && props.aspectRatio > 0 ? props.aspectRatio : void 0;
|
|
121003
|
-
const frameStyle = { width: "100%", boxSizing: "border-box", border: "none", borderRadius: ctx.radius("md", 8), background: "#fff", ...scrollEnabled ? {} : { overflow: "hidden" }, ...h2 ? { height: h2 } : ar2 ? { aspectRatio: String(ar2) } : { height: 200 } };
|
|
121004
|
-
const
|
|
121005
|
-
const
|
|
121464
|
+
const frameStyle = { width: "100%", boxSizing: "border-box", border: "none", borderRadius: ctx.radius("md", 8), background: "#fff", ...scrollEnabled ? {} : { overflow: "hidden" }, ...fill ? { flex: "1 1 0", minHeight: 0 } : h2 ? { height: h2 } : ar2 ? { aspectRatio: String(ar2) } : { height: 200 } };
|
|
121465
|
+
const reloadValue = reloadKeyOf(useResolvedScalar(props.reloadKeyPath != null && isBinding(props.reloadKeyPath) ? props.reloadKeyPath : void 0, ctx));
|
|
121466
|
+
const reloadState = React12.useRef({ base: null, epoch: 0 });
|
|
121467
|
+
if (reloadValue !== null && reloadValue !== reloadState.current.base) {
|
|
121468
|
+
if (reloadState.current.base !== null) reloadState.current.epoch++;
|
|
121469
|
+
reloadState.current.base = reloadValue;
|
|
121470
|
+
}
|
|
121471
|
+
const reloadKey = reloadState.current.epoch > 0 ? String(reloadState.current.epoch) : "";
|
|
121472
|
+
const sourceKey = htmlStr ?? urlFrame?.src ?? null;
|
|
121473
|
+
const frameKey = sourceKey == null ? null : reloadKey ? `${sourceKey}\0${reloadKey}` : sourceKey;
|
|
121474
|
+
const [loadedKey, setLoadedKey] = React12.useState(null);
|
|
121006
121475
|
const loaded = loadedKey === frameKey;
|
|
121476
|
+
const bridgeChannel = props.bridge === "worker" ? webViewChannelOf(ctx.provider) : null;
|
|
121477
|
+
const frameRef = React12.useRef(null);
|
|
121478
|
+
const bridgeLoad = React12.useRef({ loaded: false });
|
|
121479
|
+
if (bridgeLoad.current.key !== frameKey) {
|
|
121480
|
+
bridgeLoad.current.key = frameKey;
|
|
121481
|
+
bridgeLoad.current.loaded = false;
|
|
121482
|
+
}
|
|
121007
121483
|
const frameProps = {
|
|
121484
|
+
ref: frameRef,
|
|
121008
121485
|
title: "webview",
|
|
121009
121486
|
scrolling: scrollEnabled ? void 0 : "no",
|
|
121010
121487
|
"data-scroll-enabled": scrollEnabled ? "true" : "false",
|
|
121011
121488
|
allow: config.allow || void 0,
|
|
121012
|
-
onLoad: () =>
|
|
121489
|
+
onLoad: () => {
|
|
121490
|
+
setLoadedKey(frameKey);
|
|
121491
|
+
bridgeLoad.current.loaded = true;
|
|
121492
|
+
bridgeLoad.current.onLoad?.();
|
|
121493
|
+
},
|
|
121013
121494
|
style: frameStyle
|
|
121014
121495
|
};
|
|
121015
121496
|
const showLoading = !loaded && (config.loadingText != null || config.showProgressBar) && (htmlStr != null || urlFrame != null);
|
|
121016
121497
|
const rawBand = config.coverBandColor ?? props.coverBandColor;
|
|
121017
121498
|
const bandColor = typeof rawBand === "string" && rawBand.length > 0 ? rawBand : void 0;
|
|
121018
|
-
return /* @__PURE__ */ jsxs8("div", { style: { width: "100%", position: "relative", ...bandColor ? { background: bandColor, borderRadius: ctx.radius("md", 8), overflow: "hidden" } : {}, ...wrap }, children: [
|
|
121499
|
+
return /* @__PURE__ */ jsxs8("div", { style: { width: "100%", position: "relative", ...fill ? { height: "100%", flex: "1 1 0", minHeight: 0, display: "flex", flexDirection: "column" } : {}, ...bandColor ? { background: bandColor, borderRadius: ctx.radius("md", 8), overflow: "hidden" } : {}, ...wrap }, children: [
|
|
121019
121500
|
bandColor ? /* @__PURE__ */ jsx11("div", { "data-testid": "webview-cover-band", style: { height: 8, background: bandColor } }) : null,
|
|
121020
|
-
htmlStr ? /* @__PURE__ */ jsx11("iframe", { ...frameProps, srcDoc: htmlStr, sandbox: "allow-scripts" }) : urlFrame ? /* @__PURE__ */ jsx11("iframe", { ...frameProps, src: urlFrame.src, sandbox: urlFrame.sandbox }) : /* @__PURE__ */ jsx11("div", { style: { ...frameStyle, display: "grid", placeItems: "center", color: "#999", fontFamily: "ui-monospace, monospace", fontSize: pxToRem(11), border: "1px dashed #ccc" }, children: urlStr ? "WebView (url not allowed)" : "WebView (no url)" }),
|
|
121501
|
+
htmlStr ? /* @__PURE__ */ jsx11("iframe", { ...frameProps, srcDoc: htmlStr, sandbox: "allow-scripts" }, frameKey ?? void 0) : urlFrame ? /* @__PURE__ */ jsx11("iframe", { ...frameProps, src: urlFrame.src, sandbox: urlFrame.sandbox }, frameKey ?? void 0) : /* @__PURE__ */ jsx11("div", { style: { ...frameStyle, display: "grid", placeItems: "center", color: "#999", fontFamily: "ui-monospace, monospace", fontSize: pxToRem(11), border: "1px dashed #ccc" }, children: urlStr ? "WebView (url not allowed)" : "WebView (no url)" }),
|
|
121502
|
+
bridgeChannel ? /* @__PURE__ */ jsx11(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsx11(
|
|
121503
|
+
WebViewBridgeHost2,
|
|
121504
|
+
{
|
|
121505
|
+
channel: bridgeChannel,
|
|
121506
|
+
props,
|
|
121507
|
+
ctx,
|
|
121508
|
+
nodeId,
|
|
121509
|
+
urlStr,
|
|
121510
|
+
htmlStr,
|
|
121511
|
+
allowedOrigins: config.allowedOrigins,
|
|
121512
|
+
reloadKey,
|
|
121513
|
+
frameRef,
|
|
121514
|
+
load: bridgeLoad.current
|
|
121515
|
+
}
|
|
121516
|
+
) }) : null,
|
|
121021
121517
|
showLoading ? /* @__PURE__ */ jsxs8("div", { "data-testid": "webview-loading", role: "status", "aria-live": "polite", "aria-label": config.loadingText ? void 0 : "Loading", style: { position: "absolute", left: 0, right: 0, top: bandColor ? 8 : 0, bottom: 0, display: "grid", placeItems: "center", pointerEvents: "none", fontFamily: bodyFont(ctx), fontSize: pxToRem(13), color: ctx.color("textSecondary", "#666") }, children: [
|
|
121022
121518
|
config.showProgressBar ? /* @__PURE__ */ jsx11("div", { "aria-hidden": "true", style: { position: "absolute", left: 0, top: 0, height: 3, width: "40%", background: ctx.color("accentPrimary", "#116DFF") } }) : null,
|
|
121023
121519
|
config.loadingText ?? null
|
|
@@ -121028,24 +121524,24 @@ var init_renderNode = __esm({
|
|
|
121028
121524
|
const placeholderText = useBoundString(props.placeholder, ctx);
|
|
121029
121525
|
const C2 = ctx.color;
|
|
121030
121526
|
const optionsPath = props.optionsPath;
|
|
121031
|
-
const
|
|
121032
|
-
const opts = Array.isArray(
|
|
121527
|
+
const bound2 = useBoundValue(ctx, typeof optionsPath === "string" && isBinding(optionsPath) ? optionsPath : "");
|
|
121528
|
+
const opts = Array.isArray(bound2) && bound2.length ? bound2 : Array.isArray(props.options) ? props.options : [];
|
|
121033
121529
|
const onChange = props.onChange;
|
|
121034
121530
|
const boundSel = useResolvedScalar(isBinding(props.selectedId) ? props.selectedId : void 0, ctx);
|
|
121035
121531
|
const selectedId = isBinding(props.selectedId) ? boundSel : props.selectedId;
|
|
121036
|
-
const [sel, setSel] =
|
|
121037
|
-
|
|
121532
|
+
const [sel, setSel] = React12.useState(ctx.empty ? "" : String(selectedId ?? ""));
|
|
121533
|
+
React12.useEffect(() => {
|
|
121038
121534
|
if (!ctx.empty && selectedId != null) setSel(String(selectedId));
|
|
121039
121535
|
}, [selectedId, ctx.empty]);
|
|
121040
|
-
const pickerBag =
|
|
121536
|
+
const pickerBag = React12.useContext(FormValuesContext);
|
|
121041
121537
|
const pickerFieldId = props.__formFieldId;
|
|
121042
121538
|
const pickerRuleKey = props.validation ? JSON.stringify(props.validation) : "";
|
|
121043
|
-
|
|
121539
|
+
React12.useEffect(() => {
|
|
121044
121540
|
if (!pickerBag || !pickerFieldId) return;
|
|
121045
121541
|
pickerBag.register(pickerFieldId, props.validation);
|
|
121046
121542
|
return () => pickerBag.unregister(pickerFieldId);
|
|
121047
121543
|
}, [pickerFieldId, pickerBag, pickerRuleKey]);
|
|
121048
|
-
|
|
121544
|
+
React12.useEffect(() => {
|
|
121049
121545
|
if (pickerBag && pickerFieldId) pickerBag.set(pickerFieldId, sel);
|
|
121050
121546
|
}, [sel, pickerFieldId, pickerBag]);
|
|
121051
121547
|
const emitPick = (id) => {
|
|
@@ -121161,24 +121657,24 @@ var init_renderNode = __esm({
|
|
|
121161
121657
|
const s2 = seedUnix();
|
|
121162
121658
|
return s2 == null ? null : clampUnix(s2);
|
|
121163
121659
|
};
|
|
121164
|
-
const [val, setVal] =
|
|
121660
|
+
const [val, setVal] = React12.useState(ctx.empty ? "" : toInput(shownSeed()));
|
|
121165
121661
|
const dateServiceBound = typeof props.valuePath === "string" && props.valuePath.startsWith("$service:");
|
|
121166
121662
|
const bagSource = () => dateServiceBound ? boundRaw : boundRaw !== void 0 && boundRaw !== null && boundRaw !== "" ? boundRaw : props.valueUnix;
|
|
121167
|
-
const [dateBagVal, setDateBagVal] =
|
|
121168
|
-
|
|
121663
|
+
const [dateBagVal, setDateBagVal] = React12.useState(ctx.empty ? "" : clampDateFieldValue(encodeDateFieldValue(bagSource()), props.minUnix, props.maxUnix, props.mode));
|
|
121664
|
+
React12.useEffect(() => {
|
|
121169
121665
|
if (ctx.empty) return;
|
|
121170
121666
|
setVal(toInput(shownSeed()));
|
|
121171
121667
|
setDateBagVal(clampDateFieldValue(encodeDateFieldValue(bagSource()), props.minUnix, props.maxUnix, props.mode));
|
|
121172
121668
|
}, [boundRaw, props.valueUnix, props.valuePath, ctx.empty]);
|
|
121173
|
-
const dateBag =
|
|
121669
|
+
const dateBag = React12.useContext(FormValuesContext);
|
|
121174
121670
|
const dateFieldId = props.__formFieldId;
|
|
121175
121671
|
const dateRuleKey = props.validation ? JSON.stringify(props.validation) : "";
|
|
121176
|
-
|
|
121672
|
+
React12.useEffect(() => {
|
|
121177
121673
|
if (!dateBag || !dateFieldId) return;
|
|
121178
121674
|
dateBag.register(dateFieldId, props.validation);
|
|
121179
121675
|
return () => dateBag.unregister(dateFieldId);
|
|
121180
121676
|
}, [dateFieldId, dateBag, dateRuleKey]);
|
|
121181
|
-
|
|
121677
|
+
React12.useEffect(() => {
|
|
121182
121678
|
if (dateBag && dateFieldId) dateBag.set(dateFieldId, dateBagVal);
|
|
121183
121679
|
}, [dateBagVal, dateFieldId, dateBag]);
|
|
121184
121680
|
if (!ctx.onAction) {
|
|
@@ -121247,11 +121743,11 @@ var init_renderNode = __esm({
|
|
|
121247
121743
|
const valueBinding = isBinding(props.value) ? props.value : void 0;
|
|
121248
121744
|
const boundValue = useResolvedScalar(valueBinding, ctx);
|
|
121249
121745
|
const initialValue2 = ctx.empty ? "" : valueBinding ? boundValue == null ? "" : String(boundValue) : String(props.value ?? "");
|
|
121250
|
-
const [local, setLocal] =
|
|
121251
|
-
|
|
121746
|
+
const [local, setLocal] = React12.useState(initialValue2);
|
|
121747
|
+
React12.useEffect(() => {
|
|
121252
121748
|
if (!ctx.empty && valueBinding) setLocal(boundValue == null ? "" : String(boundValue));
|
|
121253
121749
|
}, [boundValue, ctx.empty, valueBinding]);
|
|
121254
|
-
const timer =
|
|
121750
|
+
const timer = React12.useRef(null);
|
|
121255
121751
|
const dispatch = (action, v2) => {
|
|
121256
121752
|
if (!action || !ctx.onAction) return;
|
|
121257
121753
|
ctx.onAction({ ...action, params: { ...action.params ?? {}, value: v2 }, args: { ...action.args ?? {}, value: v2 } });
|
|
@@ -121293,33 +121789,33 @@ var init_renderNode = __esm({
|
|
|
121293
121789
|
const boundValue = useResolvedScalar(props.valuePath, ctx);
|
|
121294
121790
|
const effectiveValue = props.valuePath != null ? boundValue : props.value;
|
|
121295
121791
|
const fallbackValue = effectiveValue ?? props.value ?? 0;
|
|
121296
|
-
const [value, setValue] =
|
|
121792
|
+
const [value, setValue] = React12.useState(() => {
|
|
121297
121793
|
const seed2 = Number(fallbackValue);
|
|
121298
121794
|
return Number.isFinite(seed2) ? Math.min(max, Math.max(min, seed2)) : 0;
|
|
121299
121795
|
});
|
|
121300
|
-
|
|
121796
|
+
React12.useEffect(() => {
|
|
121301
121797
|
const next = Number(fallbackValue);
|
|
121302
121798
|
if (Number.isFinite(next)) setValue(Math.min(max, Math.max(min, next)));
|
|
121303
121799
|
}, [fallbackValue, min, max]);
|
|
121304
|
-
const stepperBag =
|
|
121800
|
+
const stepperBag = React12.useContext(FormValuesContext);
|
|
121305
121801
|
const stepperFieldId = props.__formFieldId;
|
|
121306
121802
|
const stepperRuleKey = props.validation ? JSON.stringify(props.validation) : "";
|
|
121307
|
-
|
|
121803
|
+
React12.useEffect(() => {
|
|
121308
121804
|
if (!stepperBag || !stepperFieldId) return;
|
|
121309
121805
|
stepperBag.register(stepperFieldId, props.validation);
|
|
121310
121806
|
return () => stepperBag.unregister(stepperFieldId);
|
|
121311
121807
|
}, [stepperFieldId, stepperBag, stepperRuleKey]);
|
|
121312
121808
|
const serviceBound = typeof props.valuePath === "string" && isBinding(props.valuePath) && props.valuePath.startsWith("$service:");
|
|
121313
|
-
const [bagValue, setBagValue] =
|
|
121314
|
-
|
|
121809
|
+
const [bagValue, setBagValue] = React12.useState(() => serviceBound ? boundValue != null ? encodeStepperFieldValue(boundValue, { min, max }) : "" : encodeStepperFieldValue(value, { min, max }));
|
|
121810
|
+
React12.useEffect(() => {
|
|
121315
121811
|
if (!serviceBound || boundValue == null) return;
|
|
121316
121812
|
setBagValue(encodeStepperFieldValue(boundValue, { min, max }));
|
|
121317
121813
|
}, [boundValue, serviceBound, min, max]);
|
|
121318
|
-
|
|
121814
|
+
React12.useEffect(() => {
|
|
121319
121815
|
if (serviceBound) return;
|
|
121320
121816
|
setBagValue(encodeStepperFieldValue(value, { min, max }));
|
|
121321
121817
|
}, [value, serviceBound, min, max]);
|
|
121322
|
-
|
|
121818
|
+
React12.useEffect(() => {
|
|
121323
121819
|
if (stepperBag && stepperFieldId) stepperBag.set(stepperFieldId, bagValue);
|
|
121324
121820
|
}, [bagValue, stepperFieldId, stepperBag]);
|
|
121325
121821
|
const dispatch = (next) => {
|
|
@@ -121334,7 +121830,7 @@ var init_renderNode = __esm({
|
|
|
121334
121830
|
dispatch(next);
|
|
121335
121831
|
return next;
|
|
121336
121832
|
};
|
|
121337
|
-
const [pressed, setPressed] =
|
|
121833
|
+
const [pressed, setPressed] = React12.useState({ text: "", count: 0 });
|
|
121338
121834
|
const bump = (delta) => commit(value + delta);
|
|
121339
121835
|
const press = (delta) => {
|
|
121340
121836
|
const next = bump(delta);
|
|
@@ -121478,9 +121974,9 @@ var init_renderNode = __esm({
|
|
|
121478
121974
|
const items = Array.isArray(props.items) ? props.items : [];
|
|
121479
121975
|
const gridStagger = ctx.reduceMotion() ? 0 : Number(props.staggerMs ?? props.stagger_ms ?? 0);
|
|
121480
121976
|
const stagger = (el2, i2) => {
|
|
121481
|
-
if (!(gridStagger > 0) || !
|
|
121977
|
+
if (!(gridStagger > 0) || !React12.isValidElement(el2)) return el2;
|
|
121482
121978
|
const prev = el2.props.style ?? {};
|
|
121483
|
-
return
|
|
121979
|
+
return React12.cloneElement(el2, { style: { ...prev, animationDelay: `${i2 * gridStagger}ms` } });
|
|
121484
121980
|
};
|
|
121485
121981
|
const inner = itemsPath && items[0] && ctx.provider ? /* @__PURE__ */ jsx11(
|
|
121486
121982
|
BoundList,
|
|
@@ -121555,13 +122051,13 @@ var init_renderNode = __esm({
|
|
|
121555
122051
|
revealProgress = /* @__PURE__ */ new Map();
|
|
121556
122052
|
countWords = (s2) => s2.split(/\s+/).filter((t2) => t2 !== "").length;
|
|
121557
122053
|
RevealText = ({ text: text11, reduce, markdownHtml }) => {
|
|
121558
|
-
const tokens2 =
|
|
121559
|
-
const total =
|
|
122054
|
+
const tokens2 = React12.useMemo(() => text11.split(/(\s+)/).filter((t2) => t2 !== ""), [text11]);
|
|
122055
|
+
const total = React12.useMemo(
|
|
121560
122056
|
() => markdownHtml != null ? revealHtml(markdownHtml, 0, void 0).total : countWords(text11),
|
|
121561
122057
|
[text11, markdownHtml]
|
|
121562
122058
|
);
|
|
121563
|
-
const [shown2, setShown] =
|
|
121564
|
-
const prevRef =
|
|
122059
|
+
const [shown2, setShown] = React12.useState(total);
|
|
122060
|
+
const prevRef = React12.useRef(null);
|
|
121565
122061
|
useIsomorphicLayoutEffect(() => {
|
|
121566
122062
|
const prev = prevRef.current;
|
|
121567
122063
|
prevRef.current = text11;
|
|
@@ -121637,9 +122133,9 @@ var init_renderNode = __esm({
|
|
|
121637
122133
|
}
|
|
121638
122134
|
}
|
|
121639
122135
|
if (collapse) {
|
|
121640
|
-
const
|
|
121641
|
-
if (!
|
|
121642
|
-
const eff =
|
|
122136
|
+
const bound2 = isBinding(props.text) && props.text.startsWith("$service:");
|
|
122137
|
+
if (!bound2 || ctx.provider) {
|
|
122138
|
+
const eff = bound2 ? resolvedForCollapse : isBinding(props.text) ? resolveScalarStatic(props.text, ctx) : props.text;
|
|
121643
122139
|
const s2 = eff == null ? "" : String(eff).trim();
|
|
121644
122140
|
if (s2 === "" || s2 === "\u2014") return null;
|
|
121645
122141
|
}
|
|
@@ -121684,8 +122180,8 @@ var init_renderNode = __esm({
|
|
|
121684
122180
|
const boundInitials = useResolvedScalar(props.initials != null && isBinding(props.initials) ? props.initials : void 0, ctx);
|
|
121685
122181
|
const boundAlt = useResolvedScalar(contentDescription, ctx);
|
|
121686
122182
|
const fadeIn = motionDefaultsAnimate(ctx);
|
|
121687
|
-
const [shownSrc, setShownSrc] =
|
|
121688
|
-
const imgRef =
|
|
122183
|
+
const [shownSrc, setShownSrc] = React12.useState(null);
|
|
122184
|
+
const imgRef = React12.useRef(null);
|
|
121689
122185
|
const hasSource = props.url != null || props.initials != null || props.asset != null || props.icon != null;
|
|
121690
122186
|
const banner = fillWidth === true || props.width == null && props.height == null && !props.initials;
|
|
121691
122187
|
const w2 = banner ? "100%" : props.width ?? 40;
|
|
@@ -121699,7 +122195,7 @@ var init_renderNode = __esm({
|
|
|
121699
122195
|
const ph = props.placeholder ? C2(props.placeholder, "#e6e6e6") : void 0;
|
|
121700
122196
|
const imgUrl = props.url != null && isBinding(props.url) ? boundUrl : props.url;
|
|
121701
122197
|
const imgInitials = props.initials != null && isBinding(props.initials) ? boundInitials : props.initials;
|
|
121702
|
-
const [failedSrc, setFailedSrc] =
|
|
122198
|
+
const [failedSrc, setFailedSrc] = React12.useState(null);
|
|
121703
122199
|
const resolvedSrc = imgUrl && typeof imgUrl === "string" ? resolveAssetUrl(imgUrl, ctx.assetBaseUrl) : null;
|
|
121704
122200
|
const imgShown = !fadeIn || resolvedSrc != null && shownSrc === resolvedSrc;
|
|
121705
122201
|
useIsomorphicLayoutEffect(() => {
|
|
@@ -121732,7 +122228,7 @@ var init_renderNode = __esm({
|
|
|
121732
122228
|
if (imgInitials && typeof imgInitials === "string") {
|
|
121733
122229
|
const alt = asText2(boundAlt).trim();
|
|
121734
122230
|
const circle = avatarCircle(String(imgInitials), typeof w2 === "number" ? w2 : 40, C2, false, bodyFont(ctx));
|
|
121735
|
-
return
|
|
122231
|
+
return React12.cloneElement(circle, alt ? { role: "img", "aria-label": alt, [SELF_RENDERED_LEAF]: true } : { [ROLE_WHEN_NAMED]: "img", [SELF_RENDERED_LEAF]: true });
|
|
121736
122232
|
}
|
|
121737
122233
|
if (props.icon != null && props.url == null && props.asset == null && imgInitials == null) {
|
|
121738
122234
|
const side2 = typeof w2 === "number" ? w2 : 40;
|
|
@@ -121747,13 +122243,13 @@ var init_renderNode = __esm({
|
|
|
121747
122243
|
const reduce = ctx.reduceMotion();
|
|
121748
122244
|
const servicePlayPath = typeof props.playPath === "string" && props.playPath.startsWith("$service:") ? props.playPath : void 0;
|
|
121749
122245
|
const nonce = lottieNonce(useResolvedScalar(servicePlayPath, ctx));
|
|
121750
|
-
const [replay, setReplay] =
|
|
121751
|
-
const [gen, setGen] =
|
|
121752
|
-
|
|
122246
|
+
const [replay, setReplay] = React12.useState({ plays: 0 });
|
|
122247
|
+
const [gen, setGen] = React12.useState(0);
|
|
122248
|
+
React12.useEffect(() => {
|
|
121753
122249
|
setReplay((s2) => ({ plays: s2.plays }));
|
|
121754
122250
|
setGen((g2) => g2 + 1);
|
|
121755
122251
|
}, [servicePlayPath, ctx.provider, props.source]);
|
|
121756
|
-
|
|
122252
|
+
React12.useEffect(() => {
|
|
121757
122253
|
setReplay((s2) => lottieReplayStep(s2, nonce, reduce));
|
|
121758
122254
|
}, [nonce, servicePlayPath, ctx.provider, props.source]);
|
|
121759
122255
|
return /* @__PURE__ */ jsx11(
|
|
@@ -121804,14 +122300,14 @@ var init_renderNode = __esm({
|
|
|
121804
122300
|
const C2 = ctx.color;
|
|
121805
122301
|
const effectStyle = useSymbolEffect(props.effect, ctx.reduceMotion);
|
|
121806
122302
|
const size = props.size ?? 22;
|
|
121807
|
-
const
|
|
121808
|
-
const iconName = isBinding(props.name) ? String(
|
|
122303
|
+
const bound2 = useResolvedScalar(isBinding(props.name) ? props.name : void 0, ctx);
|
|
122304
|
+
const iconName = isBinding(props.name) ? String(bound2 ?? "") : props.name;
|
|
121809
122305
|
const contentDescription = useResolvedScalar(props.contentDescription, ctx);
|
|
121810
122306
|
const described = contentDescription != null && String(contentDescription).trim() !== "";
|
|
121811
122307
|
const a11y = described ? { role: "img", "aria-label": String(contentDescription), [SELF_RENDERED_LEAF]: true } : { "aria-hidden": "true", [INFERRED_DECORATIVE]: true, [SELF_RENDERED_LEAF]: true, [ROLE_WHEN_NAMED]: "img" };
|
|
121812
122308
|
const glyph = iconSvg(iconName, { size, color: C2(resolveScalarStatic(props.tint, ctx) ?? "textPrimary", "#636b78") });
|
|
121813
122309
|
const swap = useIconSwap(iconName, ctx);
|
|
121814
|
-
const animatedGlyph = Object.keys(effectStyle).length || swap.key > 0 ?
|
|
122310
|
+
const animatedGlyph = Object.keys(effectStyle).length || swap.key > 0 ? React12.cloneElement(glyph, { style: { ...glyph.props.style, ...swap.style, ...effectStyle }, key: swap.key }) : glyph;
|
|
121815
122311
|
return /* @__PURE__ */ jsx11("span", { ...a11y, style: { display: "inline-grid", placeItems: "center", width: size + 6, height: size + 6, lineHeight: 1, flex: "none", ...wrap }, children: animatedGlyph });
|
|
121816
122312
|
});
|
|
121817
122313
|
EMPTY_STATE_SPACING = {
|
|
@@ -121996,14 +122492,14 @@ var init_renderNode = __esm({
|
|
|
121996
122492
|
});
|
|
121997
122493
|
OtpInputNode = withExtras("OtpInputNode", ({ props, ctx, wrap }) => {
|
|
121998
122494
|
const C2 = ctx.color;
|
|
121999
|
-
const
|
|
122000
|
-
const boundText = props.valuePath != null ? typeof
|
|
122001
|
-
const [typed, setTyped] =
|
|
122002
|
-
|
|
122495
|
+
const bound2 = useResolvedScalar(props.valuePath, ctx);
|
|
122496
|
+
const boundText = props.valuePath != null ? typeof bound2 === "string" ? bound2 : typeof bound2 === "number" ? String(bound2) : "" : void 0;
|
|
122497
|
+
const [typed, setTyped] = React12.useState(void 0);
|
|
122498
|
+
React12.useEffect(() => {
|
|
122003
122499
|
setTyped(void 0);
|
|
122004
122500
|
}, [boundText, props.value, props.valuePath, typeof props.valuePath === "string" && props.valuePath.startsWith("$service:") ? ctx.provider : null]);
|
|
122005
122501
|
const otpPath = typeof props.valuePath === "string" && props.valuePath.startsWith("$service:") ? servicePath(props.valuePath) : "";
|
|
122006
|
-
|
|
122502
|
+
React12.useEffect(() => {
|
|
122007
122503
|
if (!ctx.provider || !otpPath) return;
|
|
122008
122504
|
let subscribing = true;
|
|
122009
122505
|
let active = true;
|
|
@@ -122094,10 +122590,10 @@ var init_renderNode = __esm({
|
|
|
122094
122590
|
return /* @__PURE__ */ jsx11("div", { ...a11y, style: { width: "100%", height: 6, borderRadius: 999, background: C2(boundTokenName(props.trackColorPath, props.trackColor, ctx) ?? "surfaceTertiary", "#eee"), overflow: "hidden", ...wrap }, children: /* @__PURE__ */ jsx11("div", { style: { width: `${Math.round((p2 ?? 0.4) * 100)}%`, height: "100%", borderRadius: 999, background: C2(boundTokenName(props.tintPath, props.tint, ctx) ?? "accentPrimary", "#116DFF"), opacity: p2 == null ? 0.45 : 1, ...animatedFill ? { transition: ctx.motionTransition(ctx.kit?.motion) } : {} } }) });
|
|
122095
122591
|
});
|
|
122096
122592
|
SnackbarNode = withExtras("SnackbarNode", ({ props, ctx, wrap }) => {
|
|
122097
|
-
const [phase, setPhase] =
|
|
122593
|
+
const [phase, setPhase] = React12.useState("shown");
|
|
122098
122594
|
const hideAfter = ctx.empty ? void 0 : snackbarAutoHideMs(props.durationMs);
|
|
122099
122595
|
const identity = snackbarIdentity(props);
|
|
122100
|
-
|
|
122596
|
+
React12.useEffect(() => {
|
|
122101
122597
|
setPhase("shown");
|
|
122102
122598
|
if (hideAfter === void 0) return;
|
|
122103
122599
|
let fade;
|
|
@@ -122126,8 +122622,8 @@ var init_renderNode = __esm({
|
|
|
122126
122622
|
const tint = C2(boundTokenName(props.tintPath, props.tint, ctx) ?? "accentPrimary", "#116DFF");
|
|
122127
122623
|
const track = activityRingTrack(C2, tint, { cssMix: true });
|
|
122128
122624
|
const thick = Math.max(3, Math.round(size / 8));
|
|
122129
|
-
const
|
|
122130
|
-
const aiRaw = props.valuePath != null ?
|
|
122625
|
+
const bound2 = useResolvedScalar(props.valuePath, ctx);
|
|
122626
|
+
const aiRaw = props.valuePath != null ? bound2 : props.value;
|
|
122131
122627
|
const aiNum = typeof aiRaw === "number" ? aiRaw : typeof aiRaw === "string" && aiRaw.trim() !== "" ? Number(aiRaw) : void 0;
|
|
122132
122628
|
const determinate = !props.indeterminate && aiNum !== void 0 && Number.isFinite(aiNum);
|
|
122133
122629
|
if (determinate) {
|
|
@@ -122149,12 +122645,12 @@ var init_renderNode = __esm({
|
|
|
122149
122645
|
ModalBottomSheetNode = withExtras("ModalBottomSheetNode", ({ props, ctx, wrap }) => {
|
|
122150
122646
|
const sheetTitle = useBoundString(props.title, ctx);
|
|
122151
122647
|
const C2 = ctx.color;
|
|
122152
|
-
const
|
|
122648
|
+
const bound2 = useResolvedScalar(props.presentedPath, ctx);
|
|
122153
122649
|
const gated2 = props.presentedPath != null || props.presented != null;
|
|
122154
|
-
const presented = props.presentedPath != null ?
|
|
122650
|
+
const presented = props.presentedPath != null ? bound2 : props.presented;
|
|
122155
122651
|
const gateOpen = !gated2 || presented === true || presented === "true";
|
|
122156
|
-
const [dismissed, setDismissed] =
|
|
122157
|
-
|
|
122652
|
+
const [dismissed, setDismissed] = React12.useState(false);
|
|
122653
|
+
React12.useEffect(() => {
|
|
122158
122654
|
if (!gateOpen) setDismissed(false);
|
|
122159
122655
|
}, [gateOpen]);
|
|
122160
122656
|
const shown2 = gateOpen && !dismissed;
|
|
@@ -122162,26 +122658,26 @@ var init_renderNode = __esm({
|
|
|
122162
122658
|
const dismissible = props.dismissible !== false;
|
|
122163
122659
|
const edge = sheetEdge(props.edge);
|
|
122164
122660
|
const detents = edge === "bottom" ? sheetDetents(props.detents) : [];
|
|
122165
|
-
const [detentIndex, setDetentIndex] =
|
|
122166
|
-
|
|
122661
|
+
const [detentIndex, setDetentIndex] = React12.useState(0);
|
|
122662
|
+
React12.useEffect(() => {
|
|
122167
122663
|
if (!shown2) setDetentIndex(0);
|
|
122168
122664
|
}, [shown2]);
|
|
122169
|
-
const dialogRef =
|
|
122665
|
+
const dialogRef = React12.useRef(null);
|
|
122170
122666
|
const trapTab = useModalOverlay(dialogRef, shown2 && modal);
|
|
122171
|
-
const latest =
|
|
122667
|
+
const latest = React12.useRef({ ctx, onDismiss: props.onDismiss });
|
|
122172
122668
|
latest.current = { ctx, onDismiss: props.onDismiss };
|
|
122173
|
-
const closed =
|
|
122174
|
-
|
|
122669
|
+
const closed = React12.useRef(false);
|
|
122670
|
+
React12.useEffect(() => {
|
|
122175
122671
|
if (shown2) closed.current = false;
|
|
122176
122672
|
}, [shown2]);
|
|
122177
|
-
const dismiss =
|
|
122673
|
+
const dismiss = React12.useCallback(() => {
|
|
122178
122674
|
if (closed.current) return;
|
|
122179
122675
|
closed.current = true;
|
|
122180
122676
|
setDismissed(true);
|
|
122181
122677
|
const { ctx: now, onDismiss } = latest.current;
|
|
122182
122678
|
if (onDismiss != null) now.onAction?.(resolveItemDeep2(onDismiss, now));
|
|
122183
122679
|
}, []);
|
|
122184
|
-
|
|
122680
|
+
React12.useEffect(() => {
|
|
122185
122681
|
if (!shown2 || !dismissible) return;
|
|
122186
122682
|
const doc = dialogRef.current?.ownerDocument;
|
|
122187
122683
|
if (!doc) return;
|
|
@@ -122195,11 +122691,11 @@ var init_renderNode = __esm({
|
|
|
122195
122691
|
doc.addEventListener("keydown", onKey, true);
|
|
122196
122692
|
return () => doc.removeEventListener("keydown", onKey, true);
|
|
122197
122693
|
}, [shown2, dismissible, dismiss]);
|
|
122198
|
-
const drag =
|
|
122694
|
+
const drag = React12.useRef(null);
|
|
122199
122695
|
const reduceMotion = ctx.reduceMotion();
|
|
122200
|
-
const [mounted, setMounted] =
|
|
122201
|
-
const [entered, setEntered] =
|
|
122202
|
-
|
|
122696
|
+
const [mounted, setMounted] = React12.useState(shown2);
|
|
122697
|
+
const [entered, setEntered] = React12.useState(shown2 && ctx.staticRender === true);
|
|
122698
|
+
React12.useEffect(() => {
|
|
122203
122699
|
if (shown2) {
|
|
122204
122700
|
setMounted(true);
|
|
122205
122701
|
if (reduceMotion || typeof requestAnimationFrame !== "function") {
|
|
@@ -122223,8 +122719,8 @@ var init_renderNode = __esm({
|
|
|
122223
122719
|
const t2 = setTimeout(() => setMounted(false), DRAWER_EXIT_MS);
|
|
122224
122720
|
return () => clearTimeout(t2);
|
|
122225
122721
|
}, [shown2, reduceMotion]);
|
|
122226
|
-
const scrimRef =
|
|
122227
|
-
const [rtl, setRtl] =
|
|
122722
|
+
const scrimRef = React12.useRef(null);
|
|
122723
|
+
const [rtl, setRtl] = React12.useState(false);
|
|
122228
122724
|
useIsomorphicLayoutEffect(() => {
|
|
122229
122725
|
const el2 = scrimRef.current;
|
|
122230
122726
|
if (el2 && el2.ownerDocument.defaultView) setRtl(el2.ownerDocument.defaultView.getComputedStyle(el2).direction === "rtl");
|
|
@@ -122328,12 +122824,12 @@ var init_renderNode = __esm({
|
|
|
122328
122824
|
BottomDrawerNode = withExtras("BottomDrawerNode", ({ props, ctx, wrap, nodeId, nodeExtras = {} }) => {
|
|
122329
122825
|
const C2 = ctx.color;
|
|
122330
122826
|
const label3 = useBoundString(props.label, ctx);
|
|
122331
|
-
const
|
|
122827
|
+
const bound2 = useResolvedScalar(props.presentedPath, ctx);
|
|
122332
122828
|
const gated2 = props.presentedPath != null || props.presented != null;
|
|
122333
|
-
const presented = props.presentedPath != null ?
|
|
122829
|
+
const presented = props.presentedPath != null ? bound2 : props.presented;
|
|
122334
122830
|
const gateOpen = !gated2 || presented === true || presented === "true";
|
|
122335
|
-
const [dismissed, setDismissed] =
|
|
122336
|
-
|
|
122831
|
+
const [dismissed, setDismissed] = React12.useState(false);
|
|
122832
|
+
React12.useEffect(() => {
|
|
122337
122833
|
if (!gateOpen) setDismissed(false);
|
|
122338
122834
|
}, [gateOpen]);
|
|
122339
122835
|
const shown2 = gateOpen && !dismissed;
|
|
@@ -122341,18 +122837,18 @@ var init_renderNode = __esm({
|
|
|
122341
122837
|
const autoMs = drawerAutoDismissMs(props.autoDismissMs);
|
|
122342
122838
|
const placement = sheetPlacement(props.placement);
|
|
122343
122839
|
const detents = sheetDetents(props.detents);
|
|
122344
|
-
const [detentIndex, setDetentIndex] =
|
|
122345
|
-
const [expanded, setExpanded] =
|
|
122346
|
-
|
|
122840
|
+
const [detentIndex, setDetentIndex] = React12.useState(0);
|
|
122841
|
+
const [expanded, setExpanded] = React12.useState(false);
|
|
122842
|
+
React12.useEffect(() => {
|
|
122347
122843
|
if (!shown2) {
|
|
122348
122844
|
setDetentIndex(0);
|
|
122349
122845
|
setExpanded(false);
|
|
122350
122846
|
}
|
|
122351
122847
|
}, [shown2]);
|
|
122352
122848
|
const reduceMotion = ctx.reduceMotion();
|
|
122353
|
-
const [mounted, setMounted] =
|
|
122354
|
-
const [entered, setEntered] =
|
|
122355
|
-
|
|
122849
|
+
const [mounted, setMounted] = React12.useState(shown2);
|
|
122850
|
+
const [entered, setEntered] = React12.useState(shown2 && ctx.staticRender === true);
|
|
122851
|
+
React12.useEffect(() => {
|
|
122356
122852
|
if (shown2) {
|
|
122357
122853
|
setMounted(true);
|
|
122358
122854
|
if (reduceMotion || typeof requestAnimationFrame !== "function") {
|
|
@@ -122376,10 +122872,10 @@ var init_renderNode = __esm({
|
|
|
122376
122872
|
const t2 = setTimeout(() => setMounted(false), DRAWER_EXIT_MS);
|
|
122377
122873
|
return () => clearTimeout(t2);
|
|
122378
122874
|
}, [shown2, reduceMotion]);
|
|
122379
|
-
const anchorRef =
|
|
122380
|
-
const panelRef =
|
|
122381
|
-
const [host, setHost] =
|
|
122382
|
-
const [hostTop, setHostTop] =
|
|
122875
|
+
const anchorRef = React12.useRef(null);
|
|
122876
|
+
const panelRef = React12.useRef(null);
|
|
122877
|
+
const [host, setHost] = React12.useState(null);
|
|
122878
|
+
const [hostTop, setHostTop] = React12.useState(true);
|
|
122383
122879
|
useIsomorphicLayoutEffect(() => {
|
|
122384
122880
|
if (!host) {
|
|
122385
122881
|
setHostTop(true);
|
|
@@ -122407,7 +122903,7 @@ var init_renderNode = __esm({
|
|
|
122407
122903
|
setHost(overlay ?? own6(DRAWER_HOST_ATTR));
|
|
122408
122904
|
}, [mounted, placement]);
|
|
122409
122905
|
const overHost = host?.hasAttribute(SHEET_OVERLAY_HOST_ATTR) ?? false;
|
|
122410
|
-
const [regionPx, setRegionPx] =
|
|
122906
|
+
const [regionPx, setRegionPx] = React12.useState(0);
|
|
122411
122907
|
useIsomorphicLayoutEffect(() => {
|
|
122412
122908
|
if (!detents.length || !mounted) return;
|
|
122413
122909
|
const region = host ? overHost ? host.parentElement : host.previousElementSibling : null;
|
|
@@ -122434,38 +122930,38 @@ var init_renderNode = __esm({
|
|
|
122434
122930
|
resizeObserver?.disconnect();
|
|
122435
122931
|
};
|
|
122436
122932
|
}, [host, overHost, mounted, detents.length]);
|
|
122437
|
-
const latest =
|
|
122933
|
+
const latest = React12.useRef({ ctx, onDismiss: props.onDismiss });
|
|
122438
122934
|
latest.current = { ctx, onDismiss: props.onDismiss };
|
|
122439
|
-
const closed =
|
|
122440
|
-
const remaining =
|
|
122441
|
-
|
|
122935
|
+
const closed = React12.useRef(false);
|
|
122936
|
+
const remaining = React12.useRef(autoMs ?? 0);
|
|
122937
|
+
React12.useEffect(() => {
|
|
122442
122938
|
if (!shown2) return;
|
|
122443
122939
|
closed.current = false;
|
|
122444
122940
|
remaining.current = autoMs ?? 0;
|
|
122445
122941
|
}, [shown2, autoMs]);
|
|
122446
|
-
const close =
|
|
122942
|
+
const close = React12.useCallback(() => {
|
|
122447
122943
|
if (closed.current) return;
|
|
122448
122944
|
closed.current = true;
|
|
122449
122945
|
setDismissed(true);
|
|
122450
122946
|
const { ctx: now, onDismiss } = latest.current;
|
|
122451
122947
|
if (onDismiss != null) now.onAction?.(resolveItemDeep2(onDismiss, now));
|
|
122452
122948
|
}, []);
|
|
122453
|
-
const toDetent =
|
|
122949
|
+
const toDetent = React12.useCallback((next, from) => {
|
|
122454
122950
|
if (next > from) setExpanded(true);
|
|
122455
122951
|
setDetentIndex(next);
|
|
122456
122952
|
}, []);
|
|
122457
|
-
const [hover, setHover] =
|
|
122458
|
-
const [pressed, setPressed] =
|
|
122459
|
-
const [focusIn, setFocusIn] =
|
|
122953
|
+
const [hover, setHover] = React12.useState(false);
|
|
122954
|
+
const [pressed, setPressed] = React12.useState(false);
|
|
122955
|
+
const [focusIn, setFocusIn] = React12.useState(false);
|
|
122460
122956
|
const paused = hover || pressed || focusIn;
|
|
122461
|
-
|
|
122957
|
+
React12.useEffect(() => {
|
|
122462
122958
|
if (!shown2) {
|
|
122463
122959
|
setHover(false);
|
|
122464
122960
|
setPressed(false);
|
|
122465
122961
|
setFocusIn(false);
|
|
122466
122962
|
}
|
|
122467
122963
|
}, [shown2]);
|
|
122468
|
-
|
|
122964
|
+
React12.useEffect(() => {
|
|
122469
122965
|
if (!shown2 || !hostTop || autoMs == null || paused || expanded) return;
|
|
122470
122966
|
const since = Date.now();
|
|
122471
122967
|
const t2 = setTimeout(() => {
|
|
@@ -122476,7 +122972,7 @@ var init_renderNode = __esm({
|
|
|
122476
122972
|
remaining.current = drawerRemainingMs(remaining.current, Date.now() - since);
|
|
122477
122973
|
};
|
|
122478
122974
|
}, [shown2, hostTop, autoMs, paused, expanded, close]);
|
|
122479
|
-
|
|
122975
|
+
React12.useEffect(() => {
|
|
122480
122976
|
if (!shown2 || !dismissible) return;
|
|
122481
122977
|
const doc = panelRef.current?.ownerDocument;
|
|
122482
122978
|
if (!doc) return;
|
|
@@ -122489,13 +122985,13 @@ var init_renderNode = __esm({
|
|
|
122489
122985
|
doc.addEventListener("keydown", onKey, true);
|
|
122490
122986
|
return () => doc.removeEventListener("keydown", onKey, true);
|
|
122491
122987
|
}, [shown2, dismissible, close, host]);
|
|
122492
|
-
const drag =
|
|
122493
|
-
const dragged =
|
|
122494
|
-
const [dragDy, setDragDy] =
|
|
122495
|
-
|
|
122988
|
+
const drag = React12.useRef(null);
|
|
122989
|
+
const dragged = React12.useRef(false);
|
|
122990
|
+
const [dragDy, setDragDy] = React12.useState(0);
|
|
122991
|
+
React12.useEffect(() => {
|
|
122496
122992
|
if (!shown2) setDragDy(0);
|
|
122497
122993
|
}, [shown2]);
|
|
122498
|
-
const dragState =
|
|
122994
|
+
const dragState = React12.useRef({ index: 0, count: 0, dismissible });
|
|
122499
122995
|
if (!shown2 && !mounted) return /* @__PURE__ */ jsx11("span", { ref: anchorRef, "data-bottom-drawer-anchor": "", hidden: true, ...{ [NODE_EXTRAS_TARGET]: "bottom-drawer-panel" } });
|
|
122500
122996
|
const sheet = idiomControls(ctx.idiom).sheet;
|
|
122501
122997
|
const r3 = `${sheet.cornerRadius}px`;
|
|
@@ -122637,23 +123133,23 @@ var init_renderNode = __esm({
|
|
|
122637
123133
|
const rich = title !== "";
|
|
122638
123134
|
const trigger = resolveTooltipTrigger(props.trigger, "pointer");
|
|
122639
123135
|
const edge = resolveOverlayEdge("Tooltip", props.edge);
|
|
122640
|
-
const [open, setOpen] =
|
|
122641
|
-
const anchorRef =
|
|
122642
|
-
const bubbleRef =
|
|
122643
|
-
const pressTimer =
|
|
123136
|
+
const [open, setOpen] = React12.useState(false);
|
|
123137
|
+
const anchorRef = React12.useRef(null);
|
|
123138
|
+
const bubbleRef = React12.useRef(null);
|
|
123139
|
+
const pressTimer = React12.useRef(null);
|
|
122644
123140
|
const placement = useFlippedEdge(edge, open, bubbleRef, anchorRef);
|
|
122645
123141
|
const placed = placement.edge;
|
|
122646
|
-
const latest =
|
|
123142
|
+
const latest = React12.useRef({ ctx, onDismiss: props.onDismiss, open });
|
|
122647
123143
|
latest.current = { ctx, onDismiss: props.onDismiss, open };
|
|
122648
|
-
const holding =
|
|
122649
|
-
const [needsTabStop, setNeedsTabStop] =
|
|
123144
|
+
const holding = React12.useRef({ hover: false, focus: false });
|
|
123145
|
+
const [needsTabStop, setNeedsTabStop] = React12.useState(false);
|
|
122650
123146
|
useIsomorphicLayoutEffect(() => {
|
|
122651
123147
|
const el2 = anchorRef.current;
|
|
122652
123148
|
const want = trigger === "hover" && el2 != null && !hasTabStop(el2);
|
|
122653
123149
|
if (want !== needsTabStop) setNeedsTabStop(want);
|
|
122654
123150
|
});
|
|
122655
|
-
const show =
|
|
122656
|
-
const dismiss =
|
|
123151
|
+
const show = React12.useCallback(() => setOpen(true), []);
|
|
123152
|
+
const dismiss = React12.useCallback(() => {
|
|
122657
123153
|
holding.current = { hover: false, focus: false };
|
|
122658
123154
|
const { ctx: now, onDismiss, open: wasOpen } = latest.current;
|
|
122659
123155
|
if (!wasOpen) return;
|
|
@@ -122661,7 +123157,7 @@ var init_renderNode = __esm({
|
|
|
122661
123157
|
setOpen(false);
|
|
122662
123158
|
if (onDismiss != null) now.onAction?.(resolveItemDeep2(onDismiss, now));
|
|
122663
123159
|
}, []);
|
|
122664
|
-
|
|
123160
|
+
React12.useEffect(() => {
|
|
122665
123161
|
if (!open) return;
|
|
122666
123162
|
const doc = bubbleRef.current?.ownerDocument;
|
|
122667
123163
|
if (!doc) return;
|
|
@@ -122685,7 +123181,7 @@ var init_renderNode = __esm({
|
|
|
122685
123181
|
if (timer) clearTimeout(timer);
|
|
122686
123182
|
};
|
|
122687
123183
|
}, [open, trigger, dismiss]);
|
|
122688
|
-
|
|
123184
|
+
React12.useEffect(() => () => {
|
|
122689
123185
|
if (pressTimer.current) clearTimeout(pressTimer.current);
|
|
122690
123186
|
}, []);
|
|
122691
123187
|
const cancelPress = () => {
|
|
@@ -122725,7 +123221,7 @@ var init_renderNode = __esm({
|
|
|
122725
123221
|
};
|
|
122726
123222
|
const hint = [title, text11].filter((s2) => s2 !== "").join(". ");
|
|
122727
123223
|
const anchor = props.anchor ? renderNode(props.anchor, ctx) : null;
|
|
122728
|
-
const wrapperHintId = `hm-tip-hint${
|
|
123224
|
+
const wrapperHintId = `hm-tip-hint${React12.useId()}`;
|
|
122729
123225
|
useIsomorphicLayoutEffect(() => {
|
|
122730
123226
|
const wrapper = anchorRef.current;
|
|
122731
123227
|
if (!wrapper || !hint || needsTabStop) return;
|
|
@@ -122747,7 +123243,7 @@ var init_renderNode = __esm({
|
|
|
122747
123243
|
/* @__PURE__ */ jsx11(OverlayAnchorClip, { wrap, children: needsTabStop ? /* @__PURE__ */ jsxs8(Fragment4, { children: [
|
|
122748
123244
|
anchor,
|
|
122749
123245
|
hint && /* @__PURE__ */ jsx11("span", { id: wrapperHintId, hidden: true, "data-hm-a11y-hint": "", children: hint })
|
|
122750
|
-
] }) : hint &&
|
|
123246
|
+
] }) : hint && React12.isValidElement(anchor) ? /* @__PURE__ */ jsxs8(Fragment4, { children: [
|
|
122751
123247
|
/* @__PURE__ */ jsx11(A11yHintDescription, { hint, children: anchor }),
|
|
122752
123248
|
/* @__PURE__ */ jsx11("span", { id: wrapperHintId, hidden: true, "data-hm-a11y-hint": "", children: hint })
|
|
122753
123249
|
] }) : /* @__PURE__ */ jsxs8(Fragment4, { children: [
|
|
@@ -122762,30 +123258,30 @@ var init_renderNode = __esm({
|
|
|
122762
123258
|
});
|
|
122763
123259
|
PopoverNode = withExtras("PopoverNode", ({ props, ctx, wrap }) => {
|
|
122764
123260
|
const C2 = ctx.color;
|
|
122765
|
-
const
|
|
123261
|
+
const bound2 = useResolvedScalar(props.presentedPath, ctx);
|
|
122766
123262
|
const gated2 = props.presentedPath != null || props.presented != null;
|
|
122767
|
-
const gate = props.presentedPath != null ?
|
|
123263
|
+
const gate = props.presentedPath != null ? bound2 : props.presented;
|
|
122768
123264
|
const gateOpen = gate === true || gate === "true";
|
|
122769
123265
|
const literal = props.presentedPath == null && props.presented != null;
|
|
122770
123266
|
const identity = { path: props.presentedPath, presented: props.presented, provider: ctx.provider };
|
|
122771
|
-
const [local, setLocal] =
|
|
123267
|
+
const [local, setLocal] = React12.useState({ ...identity, opened: false, dismissed: false });
|
|
122772
123268
|
const sameGate = local.path === identity.path && local.presented === identity.presented && local.provider === identity.provider;
|
|
122773
123269
|
const current = sameGate ? local : { ...identity, opened: false, dismissed: false };
|
|
122774
123270
|
if (!sameGate) setLocal(current);
|
|
122775
|
-
|
|
123271
|
+
React12.useEffect(() => {
|
|
122776
123272
|
if (!gateOpen) setLocal((previous) => previous.dismissed ? { ...previous, dismissed: false } : previous);
|
|
122777
123273
|
}, [gateOpen]);
|
|
122778
123274
|
const shown2 = !gated2 || (gateOpen || current.opened) && !current.dismissed;
|
|
122779
123275
|
const modal = gated2 && isOverlayModal("Popover", props.modal);
|
|
122780
|
-
const dialogRef =
|
|
122781
|
-
const anchorRef =
|
|
122782
|
-
const boxRef =
|
|
123276
|
+
const dialogRef = React12.useRef(null);
|
|
123277
|
+
const anchorRef = React12.useRef(null);
|
|
123278
|
+
const boxRef = React12.useRef(null);
|
|
122783
123279
|
const trapTab = useModalOverlay(dialogRef, shown2 && modal);
|
|
122784
123280
|
const placement = useFlippedEdge(resolveOverlayEdge("Popover", props.edge), gated2 && shown2, dialogRef, boxRef, 6);
|
|
122785
123281
|
const placed = placement.edge;
|
|
122786
|
-
const latest =
|
|
123282
|
+
const latest = React12.useRef({ ctx, onDismiss: props.onDismiss });
|
|
122787
123283
|
latest.current = { ctx, onDismiss: props.onDismiss };
|
|
122788
|
-
|
|
123284
|
+
React12.useEffect(() => {
|
|
122789
123285
|
if (!gated2 || !shown2) return;
|
|
122790
123286
|
const doc = dialogRef.current?.ownerDocument;
|
|
122791
123287
|
if (!doc) return;
|
|
@@ -122823,8 +123319,8 @@ var init_renderNode = __esm({
|
|
|
122823
123319
|
if (shown2) return;
|
|
122824
123320
|
setLocal({ ...identity, opened: true, dismissed: false });
|
|
122825
123321
|
} : void 0;
|
|
122826
|
-
const [anchorIsButton, setAnchorIsButton] =
|
|
122827
|
-
const [needsSeparateOpener, setNeedsSeparateOpener] =
|
|
123322
|
+
const [anchorIsButton, setAnchorIsButton] = React12.useState(false);
|
|
123323
|
+
const [needsSeparateOpener, setNeedsSeparateOpener] = React12.useState(false);
|
|
122828
123324
|
useIsomorphicLayoutEffect(() => {
|
|
122829
123325
|
const el2 = anchorRef.current;
|
|
122830
123326
|
const want = literal && el2 != null && !hasTabStop(el2);
|
|
@@ -122851,10 +123347,10 @@ var init_renderNode = __esm({
|
|
|
122851
123347
|
});
|
|
122852
123348
|
ChipsInputNode = withExtras("ChipsInputNode", ({ props, ctx, wrap }) => {
|
|
122853
123349
|
const placeholderText = useBoundString(props.placeholder, ctx);
|
|
122854
|
-
const [draft, setDraft] =
|
|
123350
|
+
const [draft, setDraft] = React12.useState("");
|
|
122855
123351
|
const C2 = ctx.color;
|
|
122856
|
-
const
|
|
122857
|
-
const raw = props.valuesPath != null ?
|
|
123352
|
+
const bound2 = useResolvedScalar(props.valuesPath, ctx);
|
|
123353
|
+
const raw = props.valuesPath != null ? bound2 : props.values;
|
|
122858
123354
|
const values = Array.isArray(raw) ? raw : [];
|
|
122859
123355
|
const hasAddField = props.onAdd != null;
|
|
122860
123356
|
const canAdd = !!ctx.onAction && hasAddField && !props.disabled;
|
|
@@ -122943,9 +123439,9 @@ var init_renderNode = __esm({
|
|
|
122943
123439
|
});
|
|
122944
123440
|
TableNode = withExtras("TableNode", ({ props, ctx, wrap }) => {
|
|
122945
123441
|
const C2 = ctx.color;
|
|
122946
|
-
const
|
|
123442
|
+
const bound2 = useResolvedScalar(props.rowsPath, ctx);
|
|
122947
123443
|
const cols = Array.isArray(props.columns) ? props.columns : [];
|
|
122948
|
-
const rawRows = props.rowsPath != null ?
|
|
123444
|
+
const rawRows = props.rowsPath != null ? bound2 : props.rows;
|
|
122949
123445
|
const rows = Array.isArray(rawRows) ? rawRows : [];
|
|
122950
123446
|
const cellStyle = (head) => ({ padding: "8px 12px", fontFamily: bodyFont(ctx), fontSize: pxToRem(14), textAlign: "left", borderBottom: `1px solid ${C2("border", "#eceef1")}`, color: head ? C2("textSecondary", "#636b78") : C2("textPrimary", "#13171e"), fontWeight: head ? 600 : 400, whiteSpace: "nowrap" });
|
|
122951
123447
|
return /* @__PURE__ */ jsx11("div", { style: { width: "100%", boxSizing: "border-box", overflowX: "auto", border: `1px solid ${C2("border", "#e8eaed")}`, borderRadius: 10, ...wrap }, children: /* @__PURE__ */ jsxs8("table", { style: { width: "100%", borderCollapse: "collapse" }, children: [
|
|
@@ -122957,8 +123453,8 @@ var init_renderNode = __esm({
|
|
|
122957
123453
|
] }) });
|
|
122958
123454
|
});
|
|
122959
123455
|
GaugeRing = ({ ring, ctx, index, size, step, thick, track }) => {
|
|
122960
|
-
const
|
|
122961
|
-
const rv = ring?.valuePath != null ?
|
|
123456
|
+
const bound2 = useResolvedScalar(ring?.valuePath, ctx);
|
|
123457
|
+
const rv = ring?.valuePath != null ? bound2 : ring?.value;
|
|
122962
123458
|
const rp = Math.max(0, Math.min(1, typeof rv === "number" && Number.isFinite(rv) ? rv : 0));
|
|
122963
123459
|
const rt2 = ctx.color(ring?.tint ?? "accentPrimary", "#116DFF");
|
|
122964
123460
|
const d2 = size - index * step, off = (size - d2) / 2;
|
|
@@ -122968,8 +123464,8 @@ var init_renderNode = __esm({
|
|
|
122968
123464
|
GaugeNode = withExtras("GaugeNode", ({ props, ctx, wrap }) => {
|
|
122969
123465
|
const C2 = ctx.color;
|
|
122970
123466
|
const min = props.min ?? 0, max = props.max ?? 1;
|
|
122971
|
-
const
|
|
122972
|
-
const gSource = props.valuePath != null ?
|
|
123467
|
+
const bound2 = useResolvedScalar(props.valuePath, ctx);
|
|
123468
|
+
const gSource = props.valuePath != null ? bound2 : props.value;
|
|
122973
123469
|
const gRaw = typeof gSource === "string" && gSource.trim() !== "" && Number.isFinite(Number(gSource)) ? Number(gSource) : gSource;
|
|
122974
123470
|
const v2 = typeof gRaw === "number" ? gRaw : (min + max) / 2;
|
|
122975
123471
|
const pct = max > min ? Math.max(0, Math.min(1, (v2 - min) / (max - min))) : 0;
|
|
@@ -123005,8 +123501,8 @@ var init_renderNode = __esm({
|
|
|
123005
123501
|
ratingMetrics = (size) => size === "sm" ? RATING_METRICS.sm : RATING_METRICS.md;
|
|
123006
123502
|
RatingNode = withExtras("RatingNode", ({ props, ctx, wrap }) => {
|
|
123007
123503
|
const C2 = ctx.color;
|
|
123008
|
-
const
|
|
123009
|
-
const raw = props.valuePath != null ?
|
|
123504
|
+
const bound2 = useResolvedScalar(props.valuePath, ctx);
|
|
123505
|
+
const raw = props.valuePath != null ? bound2 : props.value;
|
|
123010
123506
|
const val = typeof raw === "number" ? raw : 0;
|
|
123011
123507
|
const max = props.max ?? 5;
|
|
123012
123508
|
const m2 = ratingMetrics(props.size);
|
|
@@ -123024,8 +123520,8 @@ var init_renderNode = __esm({
|
|
|
123024
123520
|
AvatarStripNode = withExtras("AvatarStripNode", ({ props, ctx, wrap }) => {
|
|
123025
123521
|
const C2 = ctx.color;
|
|
123026
123522
|
const path2 = props.avatarsPath ?? props.avatars_path;
|
|
123027
|
-
const
|
|
123028
|
-
const raw = path2 != null ?
|
|
123523
|
+
const bound2 = useResolvedScalar(path2, ctx);
|
|
123524
|
+
const raw = path2 != null ? bound2 : props.avatars;
|
|
123029
123525
|
const avatars = Array.isArray(raw) ? raw : [];
|
|
123030
123526
|
const size = props.size ?? 36;
|
|
123031
123527
|
const maxVisible = props.maxVisible ?? 4;
|
|
@@ -123044,7 +123540,7 @@ var init_renderNode = __esm({
|
|
|
123044
123540
|
const who = asText2(a2.initials).trim();
|
|
123045
123541
|
const initials = avatarCircle(who || "?", size, C2, true, bodyFont(ctx));
|
|
123046
123542
|
const photo = typeof a2.imageUrl === "string" && a2.imageUrl && !isBinding(a2.imageUrl) ? a2.imageUrl : "";
|
|
123047
|
-
const circle = photo ?
|
|
123543
|
+
const circle = photo ? React12.cloneElement(
|
|
123048
123544
|
initials,
|
|
123049
123545
|
{ style: { ...initials.props.style, position: "relative", overflow: "hidden" } },
|
|
123050
123546
|
initials.props.children,
|
|
@@ -123052,7 +123548,7 @@ var init_renderNode = __esm({
|
|
|
123052
123548
|
e2.currentTarget.style.display = "none";
|
|
123053
123549
|
}, style: { position: "absolute", inset: 0, width: "100%", height: "100%", objectFit: "cover" } })
|
|
123054
123550
|
) : initials;
|
|
123055
|
-
return who ? /* @__PURE__ */ jsx11("div", { role: "listitem", style: wrapStyle, children:
|
|
123551
|
+
return who ? /* @__PURE__ */ jsx11("div", { role: "listitem", style: wrapStyle, children: React12.cloneElement(circle, { role: "img", "aria-label": who }) }, i2) : /* @__PURE__ */ jsx11("div", { "aria-hidden": "true", style: wrapStyle, children: circle }, i2);
|
|
123056
123552
|
}),
|
|
123057
123553
|
overflow > 0 && /* @__PURE__ */ jsx11("div", { role: "listitem", style: { marginLeft: -(size - shift), width: size, height: size, borderRadius: "50%", border: `2px solid ${C2("surfacePrimary", "#fff")}`, background: C2("surfaceTertiary", "#e6e6e6"), color: C2("textPrimary", "#111"), display: "grid", placeItems: "center", fontSize: size * 0.32, fontWeight: 700, fontFamily: bodyFont(ctx) }, children: /* @__PURE__ */ jsxs8("span", { role: "img", "aria-label": `${overflow} more`, children: [
|
|
123058
123554
|
"+",
|
|
@@ -123073,7 +123569,7 @@ var init_renderNode = __esm({
|
|
|
123073
123569
|
const declared = Array.isArray(props.series) ? props.series : [];
|
|
123074
123570
|
const multi = declared.length > 0;
|
|
123075
123571
|
const singleBound = useBoundValue(ctx, typeof props.valuesPath === "string" && !multi ? props.valuesPath : "");
|
|
123076
|
-
const seriesBindings =
|
|
123572
|
+
const seriesBindings = React12.useMemo(
|
|
123077
123573
|
() => declared.map((d2) => typeof d2?.valuesPath === "string" ? d2.valuesPath : ""),
|
|
123078
123574
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
123079
123575
|
[declared.map((d2) => String(d2?.valuesPath ?? "")).join("\0")]
|
|
@@ -123167,8 +123663,8 @@ var init_renderNode = __esm({
|
|
|
123167
123663
|
donutSliceOpacity = (i2) => Math.max(1 - i2 * 0.18, 0.25);
|
|
123168
123664
|
DonutChartNode = withExtras("DonutChartNode", ({ props, ctx, wrap }) => {
|
|
123169
123665
|
const C2 = ctx.color;
|
|
123170
|
-
const
|
|
123171
|
-
const slices = donutSlices(props.slicesPath != null ?
|
|
123666
|
+
const bound2 = useResolvedScalar(props.slicesPath, ctx);
|
|
123667
|
+
const slices = donutSlices(props.slicesPath != null ? bound2 : props.slices);
|
|
123172
123668
|
const size = props.size ?? 160;
|
|
123173
123669
|
const thickness = props.thickness ?? 28;
|
|
123174
123670
|
const base = C2(String(resolveScalarStatic(props.color, ctx) ?? "accentPrimary"), "#116DFF");
|
|
@@ -123219,9 +123715,9 @@ var init_renderNode = __esm({
|
|
|
123219
123715
|
] }) });
|
|
123220
123716
|
});
|
|
123221
123717
|
ShapeNode = withExtras("ShapeNode", ({ props, ctx, wrap }) => {
|
|
123222
|
-
const ref =
|
|
123223
|
-
const [box, setBox] =
|
|
123224
|
-
|
|
123718
|
+
const ref = React12.useRef(null);
|
|
123719
|
+
const [box, setBox] = React12.useState(null);
|
|
123720
|
+
React12.useEffect(() => {
|
|
123225
123721
|
const el2 = ref.current;
|
|
123226
123722
|
if (!el2) return;
|
|
123227
123723
|
const measure2 = () => {
|
|
@@ -123297,8 +123793,8 @@ var init_renderNode = __esm({
|
|
|
123297
123793
|
};
|
|
123298
123794
|
LegendNode = withExtras("LegendNode", ({ props, ctx, wrap }) => {
|
|
123299
123795
|
const C2 = ctx.color;
|
|
123300
|
-
const
|
|
123301
|
-
const items = legendItems(props.itemsPath != null ?
|
|
123796
|
+
const bound2 = useResolvedScalar(props.itemsPath, ctx);
|
|
123797
|
+
const items = legendItems(props.itemsPath != null ? bound2 : props.items);
|
|
123302
123798
|
if (items.length === 0) return /* @__PURE__ */ jsx11("div", { style: { ...wrap } });
|
|
123303
123799
|
const vertical = props.orientation === "vertical";
|
|
123304
123800
|
return /* @__PURE__ */ jsx11("ul", { style: {
|
|
@@ -123363,8 +123859,8 @@ var init_renderNode = __esm({
|
|
|
123363
123859
|
const boundState = useResolvedScalar(props.statePath, ctx);
|
|
123364
123860
|
const boundDelivery = useResolvedScalar(props.deliveryPath, ctx);
|
|
123365
123861
|
const boundRate = useResolvedScalar(props.ratePath, ctx);
|
|
123366
|
-
const num4 = (
|
|
123367
|
-
const v2 =
|
|
123862
|
+
const num4 = (bound2, literal, dflt) => {
|
|
123863
|
+
const v2 = bound2 !== void 0 && bound2 !== null ? bound2 : literal;
|
|
123368
123864
|
const n2 = typeof v2 === "number" ? v2 : typeof v2 === "string" ? Number(v2) : NaN;
|
|
123369
123865
|
return Number.isFinite(n2) ? n2 : dflt;
|
|
123370
123866
|
};
|
|
@@ -123379,10 +123875,10 @@ var init_renderNode = __esm({
|
|
|
123379
123875
|
const isPlayable = !isFailed && !isUploading;
|
|
123380
123876
|
const isPlaying = state === "playing";
|
|
123381
123877
|
const isLoading = state === "loading";
|
|
123382
|
-
const [scrub, setScrub] =
|
|
123383
|
-
const [seeked, setSeeked] =
|
|
123878
|
+
const [scrub, setScrub] = React12.useState(null);
|
|
123879
|
+
const [seeked, setSeeked] = React12.useState(null);
|
|
123384
123880
|
const positionMs = Math.max(0, num4(props.positionMsPath != null ? boundPosition : void 0, props.positionMs, 0));
|
|
123385
|
-
|
|
123881
|
+
React12.useEffect(() => {
|
|
123386
123882
|
setSeeked(null);
|
|
123387
123883
|
}, [positionMs]);
|
|
123388
123884
|
const effectivePositionMs = seeked ?? positionMs;
|
|
@@ -123424,8 +123920,8 @@ var init_renderNode = __esm({
|
|
|
123424
123920
|
const barW = Math.max(0.6, slot * 0.58);
|
|
123425
123921
|
const cut2 = progress * W2;
|
|
123426
123922
|
const rates = Array.isArray(props.rates) ? props.rates.map(Number).filter((n2) => n2 > 0) : [];
|
|
123427
|
-
const [pickedRate, setPickedRate] =
|
|
123428
|
-
|
|
123923
|
+
const [pickedRate, setPickedRate] = React12.useState(null);
|
|
123924
|
+
React12.useEffect(() => {
|
|
123429
123925
|
setPickedRate(null);
|
|
123430
123926
|
}, [rate]);
|
|
123431
123927
|
const effectiveRate = pickedRate ?? rate;
|
|
@@ -123576,8 +124072,8 @@ var init_renderNode = __esm({
|
|
|
123576
124072
|
});
|
|
123577
124073
|
TimelineNode = withExtras("TimelineNode", ({ props, ctx, wrap }) => {
|
|
123578
124074
|
const C2 = ctx.color;
|
|
123579
|
-
const
|
|
123580
|
-
const raw = props.entriesPath != null ?
|
|
124075
|
+
const bound2 = useResolvedScalar(props.entriesPath, ctx);
|
|
124076
|
+
const raw = props.entriesPath != null ? bound2 : props.entries;
|
|
123581
124077
|
const entries = Array.isArray(raw) ? raw : [];
|
|
123582
124078
|
return /* @__PURE__ */ jsx11("div", { style: { display: "flex", flexDirection: "column", width: "100%", ...wrap }, children: entries.map((e2, i2) => {
|
|
123583
124079
|
const done = e2?.done === true;
|
|
@@ -123602,9 +124098,9 @@ var init_renderNode = __esm({
|
|
|
123602
124098
|
const items = (props.__pager ? props.pages : props.items) ?? [];
|
|
123603
124099
|
const pages2 = items.filter((page) => isNodeLike(page) || page?.type);
|
|
123604
124100
|
const requested = Math.max(0, Math.min(pages2.length - 1, props.currentIndex ?? 0));
|
|
123605
|
-
const [current, setCurrent] =
|
|
123606
|
-
const rail =
|
|
123607
|
-
const currentRef =
|
|
124101
|
+
const [current, setCurrent] = React12.useState(requested);
|
|
124102
|
+
const rail = React12.useRef(null);
|
|
124103
|
+
const currentRef = React12.useRef(current);
|
|
123608
124104
|
const itemsPath = props.itemsPath ?? props.items_path;
|
|
123609
124105
|
const boundRail = !!itemsPath && !!items[0] && !!ctx.provider;
|
|
123610
124106
|
const select2 = (index) => {
|
|
@@ -123613,12 +124109,12 @@ var init_renderNode = __esm({
|
|
|
123613
124109
|
setCurrent(index);
|
|
123614
124110
|
if (props.onChange && ctx.onAction) ctx.onAction({ ...props.onChange, args: { ...props.onChange.args ?? {}, index } });
|
|
123615
124111
|
};
|
|
123616
|
-
|
|
124112
|
+
React12.useEffect(() => {
|
|
123617
124113
|
currentRef.current = requested;
|
|
123618
124114
|
setCurrent(requested);
|
|
123619
124115
|
if (rail.current && !boundRail) rail.current.scrollLeft = requested * rail.current.clientWidth;
|
|
123620
124116
|
}, [requested, boundRail, pages2.length]);
|
|
123621
|
-
|
|
124117
|
+
React12.useEffect(() => {
|
|
123622
124118
|
const interval = props.autoplayIntervalMs;
|
|
123623
124119
|
if (props.__pager || boundRail || !Number.isFinite(interval) || interval <= 0 || pages2.length < 2 || ctx.reduceMotion()) return;
|
|
123624
124120
|
const timer = setInterval(() => {
|
|
@@ -123661,19 +124157,19 @@ var init_renderNode = __esm({
|
|
|
123661
124157
|
const opts = Array.isArray(rawOpts) ? rawOpts : [];
|
|
123662
124158
|
const selectedId = isBinding(props.selectedId) ? boundSel : props.selectedId;
|
|
123663
124159
|
const selIdx = Math.max(0, opts.findIndex((o2) => o2?.id === selectedId));
|
|
123664
|
-
const viewport =
|
|
123665
|
-
const settle =
|
|
123666
|
-
const pickerId =
|
|
124160
|
+
const viewport = React12.useRef(null);
|
|
124161
|
+
const settle = React12.useRef(void 0);
|
|
124162
|
+
const pickerId = React12.useId();
|
|
123667
124163
|
const interactive = !!ctx.onAction && !!props.onChange;
|
|
123668
124164
|
const emit = (index) => {
|
|
123669
124165
|
const id = opts[index]?.id;
|
|
123670
124166
|
if (!interactive || id == null || index === selIdx) return;
|
|
123671
124167
|
ctx.onAction({ ...props.onChange, args: { ...props.onChange.args ?? {}, selectedId: String(id) } });
|
|
123672
124168
|
};
|
|
123673
|
-
|
|
124169
|
+
React12.useEffect(() => {
|
|
123674
124170
|
if (viewport.current) viewport.current.scrollTop = selIdx * 32;
|
|
123675
124171
|
}, [selIdx, opts.length]);
|
|
123676
|
-
|
|
124172
|
+
React12.useEffect(() => () => clearTimeout(settle.current), []);
|
|
123677
124173
|
return /* @__PURE__ */ jsxs8("div", { style: { position: "relative", width: "100%", maxWidth: 220, height: 160, overflow: "hidden", background: C2("surfaceSecondary", "#f5f7fa"), borderRadius: 12, ...wrap }, children: [
|
|
123678
124174
|
/* @__PURE__ */ jsx11("div", { "aria-hidden": "true", style: { position: "absolute", top: 64, left: 8, right: 8, height: 32, background: C2("surfacePrimary", "#fff"), borderRadius: 8, boxShadow: "inset 0 0 0 1px rgba(0,0,0,.06)" } }),
|
|
123679
124175
|
/* @__PURE__ */ jsx11(
|
|
@@ -123715,8 +124211,8 @@ var init_renderNode = __esm({
|
|
|
123715
124211
|
});
|
|
123716
124212
|
ColorPickerNode = withExtras("ColorPickerNode", ({ props, ctx, wrap }) => {
|
|
123717
124213
|
const C2 = ctx.color;
|
|
123718
|
-
const
|
|
123719
|
-
const raw = props.valuePath != null ?
|
|
124214
|
+
const bound2 = useResolvedScalar(props.valuePath, ctx);
|
|
124215
|
+
const raw = props.valuePath != null ? bound2 : props.value;
|
|
123720
124216
|
const cur = typeof raw === "string" ? raw : "#116DFF";
|
|
123721
124217
|
const swatches = Array.isArray(props.swatches) ? props.swatches : ["#116DFF", "#23924D", "#E89F00", "#E62214", "#8B5CF6", "#111827"];
|
|
123722
124218
|
const onPick = (hex2) => ctx.onAction && props.onChange ? () => ctx.onAction({ ...props.onChange, args: { ...props.onChange?.args ?? {}, value: hex2 } }) : void 0;
|
|
@@ -123784,23 +124280,23 @@ var init_renderNode = __esm({
|
|
|
123784
124280
|
const hasEvents = !!(props.onMapTap || props.onMarkerTap || props.onRegionChange || props.onShapeTap);
|
|
123785
124281
|
const boundShapes = useResolvedScalar(props.shapesPath, ctx);
|
|
123786
124282
|
const shapesRaw = Array.isArray(boundShapes) ? boundShapes : Array.isArray(props.shapes) ? props.shapes : [];
|
|
123787
|
-
const shapes =
|
|
124283
|
+
const shapes = React12.useMemo(() => shapesRaw.map((sh) => {
|
|
123788
124284
|
const kind = parseShapeKind(sh?.kind);
|
|
123789
124285
|
const pts = Array.isArray(sh?.points) ? sh.points.filter((p2) => p2 && typeof p2.latitude === "number" && typeof p2.longitude === "number") : [];
|
|
123790
124286
|
const ring = kind === "circle" && pts.length ? circleRing(pts[0].latitude, pts[0].longitude, typeof sh.radiusM === "number" ? sh.radiusM : 0) : pts;
|
|
123791
124287
|
return { ...sh, kind, points: ring };
|
|
123792
124288
|
}), [JSON.stringify(shapesRaw)]);
|
|
123793
124289
|
const boundCameraRaw = useResolvedScalar(props.cameraPath, ctx);
|
|
123794
|
-
const commandedCamera =
|
|
123795
|
-
const [box, setBox] =
|
|
123796
|
-
const [tileStatus, setTileStatus] =
|
|
123797
|
-
const [userCam, setUserCam] =
|
|
123798
|
-
const dragRef =
|
|
123799
|
-
const dragMovedRef =
|
|
123800
|
-
const regionReportedRef =
|
|
123801
|
-
const [boxEl, setBoxEl] =
|
|
123802
|
-
const attachBox =
|
|
123803
|
-
|
|
124290
|
+
const commandedCamera = React12.useMemo(() => decodeCamera(boundCameraRaw), [boundCameraRaw]);
|
|
124291
|
+
const [box, setBox] = React12.useState({ w: 400, h: h2 });
|
|
124292
|
+
const [tileStatus, setTileStatus] = React12.useState({});
|
|
124293
|
+
const [userCam, setUserCam] = React12.useState(null);
|
|
124294
|
+
const dragRef = React12.useRef(null);
|
|
124295
|
+
const dragMovedRef = React12.useRef(false);
|
|
124296
|
+
const regionReportedRef = React12.useRef(false);
|
|
124297
|
+
const [boxEl, setBoxEl] = React12.useState(null);
|
|
124298
|
+
const attachBox = React12.useCallback((el2) => setBoxEl(el2), []);
|
|
124299
|
+
React12.useEffect(() => {
|
|
123804
124300
|
const el2 = boxEl;
|
|
123805
124301
|
if (!el2) return;
|
|
123806
124302
|
const measure2 = () => {
|
|
@@ -123823,12 +124319,12 @@ var init_renderNode = __esm({
|
|
|
123823
124319
|
const explicitSchematic = schematic && props.routeMode?.toLowerCase() === "schematic";
|
|
123824
124320
|
const usesTileArm = !explicitSchematic && (otherTileReason || hasStaticMarkers) && (follow || !schematic);
|
|
123825
124321
|
const pinsOnly = hasStaticMarkers && !otherTileReason;
|
|
123826
|
-
const [userFix, setUserFix] =
|
|
123827
|
-
const [followBroken, setFollowBroken] =
|
|
123828
|
-
|
|
124322
|
+
const [userFix, setUserFix] = React12.useState(null);
|
|
124323
|
+
const [followBroken, setFollowBroken] = React12.useState(false);
|
|
124324
|
+
React12.useEffect(() => {
|
|
123829
124325
|
if (follow) setFollowBroken(false);
|
|
123830
124326
|
}, [follow]);
|
|
123831
|
-
|
|
124327
|
+
React12.useEffect(() => {
|
|
123832
124328
|
if (!observeUserLocation || !usesTileArm) return;
|
|
123833
124329
|
const geo = typeof navigator !== "undefined" ? navigator.geolocation : void 0;
|
|
123834
124330
|
if (!geo || typeof geo.watchPosition !== "function") return;
|
|
@@ -123855,7 +124351,7 @@ var init_renderNode = __esm({
|
|
|
123855
124351
|
const z4 = userCam?.z ?? fitted;
|
|
123856
124352
|
const cLat = followActive ? userFix.lat : userCam?.lat ?? baseLat;
|
|
123857
124353
|
const cLng = followActive ? userFix.lng : userCam?.lng ?? baseLng;
|
|
123858
|
-
|
|
124354
|
+
React12.useEffect(() => {
|
|
123859
124355
|
const resolved2 = resolveCamera(commandedCamera, cLat, cLng, z4);
|
|
123860
124356
|
if (!resolved2) return;
|
|
123861
124357
|
setFollowBroken(true);
|
|
@@ -123937,7 +124433,7 @@ var init_renderNode = __esm({
|
|
|
123937
124433
|
const endDrag = () => {
|
|
123938
124434
|
dragRef.current = null;
|
|
123939
124435
|
};
|
|
123940
|
-
|
|
124436
|
+
React12.useEffect(() => {
|
|
123941
124437
|
if (!boxEl || !usesTileArm || !interactive) return;
|
|
123942
124438
|
const zoomOnWheel = (event) => {
|
|
123943
124439
|
event.preventDefault();
|
|
@@ -123947,7 +124443,7 @@ var init_renderNode = __esm({
|
|
|
123947
124443
|
boxEl.addEventListener("wheel", zoomOnWheel, { passive: false });
|
|
123948
124444
|
return () => boxEl.removeEventListener("wheel", zoomOnWheel);
|
|
123949
124445
|
}, [boxEl, usesTileArm, interactive, z4, cLat, cLng]);
|
|
123950
|
-
|
|
124446
|
+
React12.useEffect(() => {
|
|
123951
124447
|
const action = props.onRegionChange;
|
|
123952
124448
|
const fire = ctx.onAction;
|
|
123953
124449
|
if (!usesTileArm || !action || !fire) return;
|
|
@@ -124084,30 +124580,30 @@ var init_renderNode = __esm({
|
|
|
124084
124580
|
const items = Array.isArray(props.items) ? props.items : [];
|
|
124085
124581
|
const pages2 = items.filter((p2) => isNodeLike(p2) || p2?.type);
|
|
124086
124582
|
const count2 = pages2.length;
|
|
124087
|
-
const [index, setIndex] =
|
|
124088
|
-
const indexRef =
|
|
124089
|
-
const trackRef =
|
|
124090
|
-
const [hovered, setHovered] =
|
|
124091
|
-
const [focused, setFocused] =
|
|
124583
|
+
const [index, setIndex] = React12.useState(typeof props.currentIndex === "number" ? props.currentIndex : 0);
|
|
124584
|
+
const indexRef = React12.useRef(index);
|
|
124585
|
+
const trackRef = React12.useRef(null);
|
|
124586
|
+
const [hovered, setHovered] = React12.useState(false);
|
|
124587
|
+
const [focused, setFocused] = React12.useState(false);
|
|
124092
124588
|
const paused = hovered || focused;
|
|
124093
124589
|
const interval = typeof props.autoplayIntervalMs === "number" && props.autoplayIntervalMs > 0 ? props.autoplayIntervalMs : 0;
|
|
124094
124590
|
const autoplay = interval > 0 && count2 > 1 && !ctx.reduceMotion();
|
|
124095
124591
|
const onChange = props.onChange;
|
|
124096
|
-
const onChangeRef =
|
|
124592
|
+
const onChangeRef = React12.useRef(onChange);
|
|
124097
124593
|
onChangeRef.current = onChange;
|
|
124098
|
-
const autoScrollRef =
|
|
124099
|
-
const endAutoScroll =
|
|
124594
|
+
const autoScrollRef = React12.useRef(null);
|
|
124595
|
+
const endAutoScroll = React12.useCallback(() => {
|
|
124100
124596
|
if (autoScrollRef.current) clearTimeout(autoScrollRef.current.timer);
|
|
124101
124597
|
autoScrollRef.current = null;
|
|
124102
124598
|
}, []);
|
|
124103
124599
|
const requestedIndex = Math.max(0, Math.min(count2 - 1, typeof props.currentIndex === "number" ? props.currentIndex : 0));
|
|
124104
|
-
|
|
124600
|
+
React12.useEffect(() => {
|
|
124105
124601
|
endAutoScroll();
|
|
124106
124602
|
indexRef.current = requestedIndex;
|
|
124107
124603
|
setIndex(requestedIndex);
|
|
124108
124604
|
if (trackRef.current) trackRef.current.scrollLeft = requestedIndex * trackRef.current.clientWidth;
|
|
124109
124605
|
}, [requestedIndex, count2, endAutoScroll]);
|
|
124110
|
-
|
|
124606
|
+
React12.useEffect(() => {
|
|
124111
124607
|
const el2 = trackRef.current;
|
|
124112
124608
|
el2?.addEventListener("scrollend", endAutoScroll);
|
|
124113
124609
|
return () => {
|
|
@@ -124115,14 +124611,14 @@ var init_renderNode = __esm({
|
|
|
124115
124611
|
endAutoScroll();
|
|
124116
124612
|
};
|
|
124117
124613
|
}, [endAutoScroll]);
|
|
124118
|
-
const pageTo =
|
|
124614
|
+
const pageTo = React12.useCallback((page) => {
|
|
124119
124615
|
if (page === indexRef.current) return;
|
|
124120
124616
|
indexRef.current = page;
|
|
124121
124617
|
setIndex(page);
|
|
124122
124618
|
const action = onChangeRef.current;
|
|
124123
124619
|
if (action && ctx.onAction) ctx.onAction({ ...action, args: { ...action.args ?? {}, index: page } });
|
|
124124
124620
|
}, [ctx]);
|
|
124125
|
-
|
|
124621
|
+
React12.useEffect(() => {
|
|
124126
124622
|
if (!autoplay || paused) return;
|
|
124127
124623
|
const id = setInterval(() => {
|
|
124128
124624
|
const next = (indexRef.current + 1) % count2;
|
|
@@ -124187,7 +124683,7 @@ var init_renderNode = __esm({
|
|
|
124187
124683
|
});
|
|
124188
124684
|
BannerNode = withExtras("BannerNode", ({ props, ctx, wrap }) => {
|
|
124189
124685
|
const C2 = ctx.color;
|
|
124190
|
-
const [dismissed, setDismissed] =
|
|
124686
|
+
const [dismissed, setDismissed] = React12.useState(false);
|
|
124191
124687
|
if (dismissed) return null;
|
|
124192
124688
|
const accent = sevColor(ctx, props.severity ?? "info");
|
|
124193
124689
|
return /* @__PURE__ */ jsxs8("div", { style: { display: "flex", gap: 11, width: "100%", boxSizing: "border-box", borderRadius: ctx.radius("md", 10), padding: 13, background: `color-mix(in srgb, ${accent} 12%, ${C2("surfacePrimary", "#fff")})`, border: `1px solid color-mix(in srgb, ${accent} 32%, transparent)`, ...wrap }, children: [
|
|
@@ -124220,15 +124716,15 @@ var init_renderNode = __esm({
|
|
|
124220
124716
|
const rawImageUrl = props.imageUrl != null && isBinding(props.imageUrl) ? boundImageUrl : props.imageUrl;
|
|
124221
124717
|
const heroSrc = typeof rawImageUrl === "string" && rawImageUrl !== "" ? rawImageUrl : typeof props.imageAsset === "string" && isWebAssetPath(props.imageAsset) ? props.imageAsset : void 0;
|
|
124222
124718
|
const resolvedHero = heroSrc ? resolveAssetUrl(heroSrc, ctx.assetBaseUrl) : void 0;
|
|
124223
|
-
const [failedHero, setFailedHero] =
|
|
124719
|
+
const [failedHero, setFailedHero] = React12.useState(null);
|
|
124224
124720
|
const imageUrl = resolvedHero && resolvedHero !== failedHero ? resolvedHero : void 0;
|
|
124225
124721
|
const expanded = Math.max(0, typeof props.expandedHeight === "number" && Number.isFinite(props.expandedHeight) ? props.expandedHeight : 280);
|
|
124226
124722
|
const collapsed = Math.max(0, Math.min(expanded, typeof props.collapsedHeight === "number" && props.collapsedHeight > 0 ? props.collapsedHeight : 64));
|
|
124227
124723
|
const parallax = typeof props.parallaxFactor === "number" && Number.isFinite(props.parallaxFactor) ? Math.max(0, Math.min(1, props.parallaxFactor)) : 0.5;
|
|
124228
124724
|
const span = Math.max(1, expanded - collapsed);
|
|
124229
|
-
const rootRef =
|
|
124230
|
-
const [offset, setOffset] =
|
|
124231
|
-
|
|
124725
|
+
const rootRef = React12.useRef(null);
|
|
124726
|
+
const [offset, setOffset] = React12.useState(0);
|
|
124727
|
+
React12.useEffect(() => {
|
|
124232
124728
|
const el2 = rootRef.current;
|
|
124233
124729
|
const win = el2?.ownerDocument?.defaultView;
|
|
124234
124730
|
if (!el2 || !win) return;
|
|
@@ -124330,22 +124826,22 @@ var init_renderNode = __esm({
|
|
|
124330
124826
|
const boundEnd = useResolvedScalar(props.selectedEndDatePath, ctx);
|
|
124331
124827
|
const seedStart = (props.selectedStartDatePath != null ? typeof boundStart === "string" ? boundStart : "" : typeof props.selectedStartDate === "string" ? props.selectedStartDate : "") || "";
|
|
124332
124828
|
const seedEnd = (props.selectedEndDatePath != null ? typeof boundEnd === "string" ? boundEnd : "" : typeof props.selectedEndDate === "string" ? props.selectedEndDate : "") || "";
|
|
124333
|
-
const [range, setRange] =
|
|
124334
|
-
const lastRangeSeed =
|
|
124335
|
-
|
|
124829
|
+
const [range, setRange] = React12.useState({ start: seedStart, end: seedEnd });
|
|
124830
|
+
const lastRangeSeed = React12.useRef(`${seedStart}|${seedEnd}`);
|
|
124831
|
+
React12.useEffect(() => {
|
|
124336
124832
|
const key3 = `${seedStart}|${seedEnd}`;
|
|
124337
124833
|
if (lastRangeSeed.current === key3) return;
|
|
124338
124834
|
lastRangeSeed.current = key3;
|
|
124339
124835
|
setRange({ start: seedStart, end: seedEnd });
|
|
124340
124836
|
}, [seedStart, seedEnd]);
|
|
124341
|
-
const seed2 =
|
|
124837
|
+
const seed2 = React12.useMemo(
|
|
124342
124838
|
() => monthSeed(drivenYear ?? props.year, drivenMonth ?? props.month, selectedDate),
|
|
124343
124839
|
[drivenYear, drivenMonth, props.year, props.month, selectedDate]
|
|
124344
124840
|
);
|
|
124345
|
-
const [view, setView] =
|
|
124841
|
+
const [view, setView] = React12.useState(seed2);
|
|
124346
124842
|
const seedKey = `${seed2.year}-${seed2.month}`;
|
|
124347
|
-
const lastSeed =
|
|
124348
|
-
|
|
124843
|
+
const lastSeed = React12.useRef(seedKey);
|
|
124844
|
+
React12.useEffect(() => {
|
|
124349
124845
|
if (lastSeed.current === seedKey) return;
|
|
124350
124846
|
lastSeed.current = seedKey;
|
|
124351
124847
|
setView(seed2);
|
|
@@ -124355,18 +124851,18 @@ var init_renderNode = __esm({
|
|
|
124355
124851
|
const boundMode = useResolvedScalar(props.displayModePath, ctx);
|
|
124356
124852
|
const drivenMode = props.displayModePath != null && (boundMode === "week" || boundMode === "month") ? boundMode : void 0;
|
|
124357
124853
|
const modeSeed = drivenMode ?? (props.displayMode === "week" ? "week" : "month");
|
|
124358
|
-
const [mode, setMode] =
|
|
124359
|
-
const lastModeSeed =
|
|
124360
|
-
|
|
124854
|
+
const [mode, setMode] = React12.useState(modeSeed);
|
|
124855
|
+
const lastModeSeed = React12.useRef(modeSeed);
|
|
124856
|
+
React12.useEffect(() => {
|
|
124361
124857
|
if (lastModeSeed.current === modeSeed) return;
|
|
124362
124858
|
lastModeSeed.current = modeSeed;
|
|
124363
124859
|
setMode(modeSeed);
|
|
124364
124860
|
}, [modeSeed]);
|
|
124365
124861
|
const isWeek = mode === "week";
|
|
124366
124862
|
const weekSeed = calWeekStart(selectedDate ?? localDayKey(/* @__PURE__ */ new Date()), firstWeekday);
|
|
124367
|
-
const [weekStart, setWeekStart] =
|
|
124368
|
-
const lastWeekSeed =
|
|
124369
|
-
|
|
124863
|
+
const [weekStart, setWeekStart] = React12.useState(weekSeed);
|
|
124864
|
+
const lastWeekSeed = React12.useRef(weekSeed);
|
|
124865
|
+
React12.useEffect(() => {
|
|
124370
124866
|
if (lastWeekSeed.current === weekSeed) return;
|
|
124371
124867
|
lastWeekSeed.current = weekSeed;
|
|
124372
124868
|
setWeekStart(weekSeed);
|
|
@@ -124379,7 +124875,7 @@ var init_renderNode = __esm({
|
|
|
124379
124875
|
return { date, day: parseLocalDate(date)?.getDate() ?? 0, inMonth: true, isToday: date === todayKey };
|
|
124380
124876
|
})] : monthMatrix(year, month, firstWeekday);
|
|
124381
124877
|
const heads = weekdayLabels(firstWeekday);
|
|
124382
|
-
const gridRef =
|
|
124878
|
+
const gridRef = React12.useRef(null);
|
|
124383
124879
|
const titleMonth = isWeek ? calWeekTitleMonth(weekStart) : { year, month };
|
|
124384
124880
|
const monthLabel = new Date(titleMonth.year, titleMonth.month - 1, 1).toLocaleDateString(void 0, { month: "long", year: "numeric" });
|
|
124385
124881
|
const expandable = props.expandable === true;
|
|
@@ -124554,7 +125050,7 @@ var init_renderNode = __esm({
|
|
|
124554
125050
|
const events = Array.isArray(rawEvents) ? rawEvents : [];
|
|
124555
125051
|
const boundAnchor = useResolvedScalar(props.anchorDatePath, ctx);
|
|
124556
125052
|
const anchorRaw = props.anchorDatePath != null ? boundAnchor : props.anchorDate;
|
|
124557
|
-
const [pagedAnchor, setPagedAnchor] =
|
|
125053
|
+
const [pagedAnchor, setPagedAnchor] = React12.useState(null);
|
|
124558
125054
|
const localAnchor = pagedAnchor && Object.is(pagedAnchor.raw, anchorRaw) && pagedAnchor.path === props.anchorDatePath && pagedAnchor.mode === props.mode && pagedAnchor.provider === ctx.provider ? pagedAnchor.date : null;
|
|
124559
125055
|
if (pagedAnchor && !localAnchor) setPagedAnchor(null);
|
|
124560
125056
|
const anchor = localAnchor ?? (typeof anchorRaw === "string" ? parseLocalDate(anchorRaw) : null) ?? /* @__PURE__ */ new Date();
|
|
@@ -124794,7 +125290,7 @@ var init_renderNode = __esm({
|
|
|
124794
125290
|
const boundEvents = useResolvedScalar(props.eventsPath, ctx);
|
|
124795
125291
|
const rawEvents = props.eventsPath != null ? boundEvents : props.events;
|
|
124796
125292
|
const events = Array.isArray(rawEvents) ? rawEvents : [];
|
|
124797
|
-
const groups =
|
|
125293
|
+
const groups = React12.useMemo(() => {
|
|
124798
125294
|
const buckets = /* @__PURE__ */ new Map();
|
|
124799
125295
|
for (const ev of events) {
|
|
124800
125296
|
if (!ev) continue;
|
|
@@ -124814,19 +125310,19 @@ var init_renderNode = __esm({
|
|
|
124814
125310
|
const onSelect = (ev) => dispatchCalendarAction(ctx, ev?.onTap ?? props.onSelectEvent, { eventId: ev?.id });
|
|
124815
125311
|
const boundScrollTo = useResolvedScalar(props.scrollToDatePath, ctx);
|
|
124816
125312
|
const scrollTarget = props.scrollToDatePath != null ? typeof boundScrollTo === "string" ? boundScrollTo : void 0 : typeof props.scrollToDate === "string" ? props.scrollToDate : void 0;
|
|
124817
|
-
const containerRef =
|
|
124818
|
-
const [visibleDays, setVisibleDays] =
|
|
125313
|
+
const containerRef = React12.useRef(null);
|
|
125314
|
+
const [visibleDays, setVisibleDays] = React12.useState(CAL_AGENDA_INITIAL_DAYS);
|
|
124819
125315
|
const targetIndex = scrollTarget ? groups.findIndex((g2) => g2.key === scrollTarget) : -1;
|
|
124820
125316
|
const windowEnd = Math.max(visibleDays, targetIndex >= 0 ? targetIndex + 1 : 0);
|
|
124821
125317
|
const shown2 = groups.length > windowEnd ? groups.slice(0, windowEnd) : groups;
|
|
124822
125318
|
const hasMore = groups.length > shown2.length;
|
|
124823
|
-
|
|
125319
|
+
React12.useEffect(() => {
|
|
124824
125320
|
if (!scrollTarget) return;
|
|
124825
125321
|
const block = groups[0]?.key === scrollTarget ? "nearest" : "start";
|
|
124826
125322
|
containerRef.current?.querySelector(`[data-daygroup="${scrollTarget}"]`)?.scrollIntoView({ block });
|
|
124827
125323
|
}, [scrollTarget, windowEnd]);
|
|
124828
|
-
const sentinelRef =
|
|
124829
|
-
|
|
125324
|
+
const sentinelRef = React12.useRef(null);
|
|
125325
|
+
React12.useEffect(() => {
|
|
124830
125326
|
if (!hasMore) return;
|
|
124831
125327
|
const el2 = sentinelRef.current;
|
|
124832
125328
|
if (!el2 || typeof IntersectionObserver === "undefined") return;
|
|
@@ -124943,26 +125439,26 @@ var init_renderNode = __esm({
|
|
|
124943
125439
|
PRESENTED_SCOPE = '[aria-modal="true"], [role="dialog"], [role="alertdialog"], [role="menu"]';
|
|
124944
125440
|
focusRoots = /* @__PURE__ */ new WeakMap();
|
|
124945
125441
|
A11yHintDescription = ({ hint, idBase, children, ...forwarded }) => {
|
|
124946
|
-
const descId = `${idBase ?? "hm"}__hint${
|
|
125442
|
+
const descId = `${idBase ?? "hm"}__hint${React12.useId()}`;
|
|
124947
125443
|
const own6 = children.props;
|
|
124948
125444
|
const next = { ...forwarded };
|
|
124949
125445
|
if (forwarded.style) next.style = { ...own6.style ?? {}, ...forwarded.style };
|
|
124950
125446
|
const ids = [own6["aria-describedby"], forwarded["aria-describedby"], descId].flatMap((v2) => v2 ? String(v2).split(/\s+/) : []).filter(Boolean);
|
|
124951
125447
|
next["aria-describedby"] = Array.from(new Set(ids)).join(" ");
|
|
124952
125448
|
return /* @__PURE__ */ jsxs8(Fragment4, { children: [
|
|
124953
|
-
|
|
125449
|
+
React12.cloneElement(children, next),
|
|
124954
125450
|
/* @__PURE__ */ jsx11("span", { id: descId, hidden: true, "data-hm-a11y-hint": "", children: hint })
|
|
124955
125451
|
] });
|
|
124956
125452
|
};
|
|
124957
125453
|
reportedUnknownComponents = /* @__PURE__ */ new Set();
|
|
124958
125454
|
UnknownComponentNode = ({ pkg, type, props, ctx, wrap, ...extras }) => {
|
|
124959
125455
|
const hasTelemetry = !!ctx.emitTelemetry;
|
|
124960
|
-
|
|
125456
|
+
React12.useEffect(() => {
|
|
124961
125457
|
reportUnknownComponent(ctx, pkg, type);
|
|
124962
125458
|
}, [ctx.appId, ctx.screenId, hasTelemetry, pkg, type]);
|
|
124963
125459
|
const { style: extraStyle, children: extraChildren, ...attrs } = extras;
|
|
124964
125460
|
const nodeProps = (entries) => entries.filter(([, v2]) => isNodeLike(v2) || Array.isArray(v2) && v2.some(isNodeLike));
|
|
124965
|
-
const renderProps = (entries) => entries.map(([k2, v2]) => /* @__PURE__ */ jsx11(
|
|
125461
|
+
const renderProps = (entries) => entries.map(([k2, v2]) => /* @__PURE__ */ jsx11(React12.Fragment, { children: Array.isArray(v2) ? kids2(v2.filter(isNodeLike), ctx) : renderNode(v2, ctx) }, k2));
|
|
124966
125462
|
const childKeys = nodeProps(Object.entries(props ?? {}));
|
|
124967
125463
|
if (!unknownComponentShowsDeveloperLabel(ctx)) {
|
|
124968
125464
|
const contentKeys = childKeys.filter(([k2]) => k2 === "child" || k2 === "children");
|
|
@@ -124986,7 +125482,7 @@ var init_renderNode = __esm({
|
|
|
124986
125482
|
});
|
|
124987
125483
|
|
|
124988
125484
|
// ../../core/web-renderer/src/renderToHtml.tsx
|
|
124989
|
-
import
|
|
125485
|
+
import React13 from "react";
|
|
124990
125486
|
import { renderToStaticMarkup } from "react-dom/server";
|
|
124991
125487
|
function renderDescriptorToHtml(payload, tokens2, scheme = "light", provider = null, width, chrome, opts) {
|
|
124992
125488
|
const rtl = opts?.isRTL === true;
|
|
@@ -125006,7 +125502,7 @@ function renderDescriptorToHtml(payload, tokens2, scheme = "light", provider = n
|
|
|
125006
125502
|
const withRenderStyles = (markup) => {
|
|
125007
125503
|
if (!markup) return markup;
|
|
125008
125504
|
if (!glassPreview) return FOCUS_STYLE_MARKUP + markup;
|
|
125009
|
-
const scoped = renderToStaticMarkup(
|
|
125505
|
+
const scoped = renderToStaticMarkup(React13.createElement(
|
|
125010
125506
|
"div",
|
|
125011
125507
|
{
|
|
125012
125508
|
className: "himi-ios-glass-preview",
|
|
@@ -125023,18 +125519,18 @@ function renderDescriptorToHtml(payload, tokens2, scheme = "light", provider = n
|
|
|
125023
125519
|
const dir = rtl ? { dir: "rtl" } : {};
|
|
125024
125520
|
if (header || footer) {
|
|
125025
125521
|
return withRenderStyles(renderToStaticMarkup(
|
|
125026
|
-
|
|
125522
|
+
React13.createElement(
|
|
125027
125523
|
"div",
|
|
125028
125524
|
// F-22 — same footer pin as ScreenHost: a full-height flex column + margin-top:auto
|
|
125029
125525
|
// keeps the footer at the bottom edge even when the payload is short.
|
|
125030
125526
|
{ "data-testid": "screen-host", ...dir, ...footer ? { style: { display: "flex", flexDirection: "column", minHeight: "100%", flexGrow: 1 } } : {} },
|
|
125031
|
-
header ?
|
|
125527
|
+
header ? React13.createElement(
|
|
125032
125528
|
"div",
|
|
125033
125529
|
{ "data-testid": "sticky-header", style: { position: "sticky", top: 0, zIndex: 10 } },
|
|
125034
125530
|
renderNode(header, ctx)
|
|
125035
125531
|
) : null,
|
|
125036
125532
|
renderNode(payload, ctx),
|
|
125037
|
-
footer ?
|
|
125533
|
+
footer ? React13.createElement(
|
|
125038
125534
|
"div",
|
|
125039
125535
|
{ "data-testid": "sticky-footer", style: { position: "sticky", bottom: 0, zIndex: 10, marginTop: "auto" } },
|
|
125040
125536
|
renderNode(footer, ctx)
|
|
@@ -125044,11 +125540,11 @@ function renderDescriptorToHtml(payload, tokens2, scheme = "light", provider = n
|
|
|
125044
125540
|
}
|
|
125045
125541
|
if (rtl) {
|
|
125046
125542
|
return withRenderStyles(renderToStaticMarkup(
|
|
125047
|
-
|
|
125543
|
+
React13.createElement("div", dir, renderNode(payload, ctx))
|
|
125048
125544
|
));
|
|
125049
125545
|
}
|
|
125050
125546
|
return withRenderStyles(renderToStaticMarkup(
|
|
125051
|
-
|
|
125547
|
+
React13.createElement(React13.Fragment, null, renderNode(payload, ctx))
|
|
125052
125548
|
));
|
|
125053
125549
|
}
|
|
125054
125550
|
var init_renderToHtml = __esm({
|
|
@@ -132509,8 +133005,8 @@ function hasRowBinding(props) {
|
|
|
132509
133005
|
}
|
|
132510
133006
|
function declaredOptionIds(props, resolve81) {
|
|
132511
133007
|
const literal = props.options ?? props.tabs ?? props.chips;
|
|
132512
|
-
const
|
|
132513
|
-
const raw = Array.isArray(
|
|
133008
|
+
const bound2 = props.optionsPath !== void 0 ? resolved(props.optionsPath, resolve81) : void 0;
|
|
133009
|
+
const raw = Array.isArray(bound2) ? bound2 : literal;
|
|
132514
133010
|
if (!Array.isArray(raw)) return [];
|
|
132515
133011
|
const out2 = [];
|
|
132516
133012
|
for (const o2 of raw) {
|
|
@@ -132577,9 +133073,9 @@ function synthesizeInput(control, resolve81, tokens2) {
|
|
|
132577
133073
|
}
|
|
132578
133074
|
if (!acceptsWords(props) || !acceptsWords(control.wrapper ?? {})) return null;
|
|
132579
133075
|
const binding2 = typeof props.valuePath === "string" ? props.valuePath : typeof props.value === "string" && props.value.startsWith("$service:") ? props.value : void 0;
|
|
132580
|
-
const
|
|
133076
|
+
const bound2 = binding2 === void 0 ? void 0 : resolve81(binding2);
|
|
132581
133077
|
const literal = typeof props.value === "string" && !props.value.startsWith("$") ? props.value : void 0;
|
|
132582
|
-
const current = typeof
|
|
133078
|
+
const current = typeof bound2 === "string" ? bound2 : typeof bound2 === "number" ? String(bound2) : literal ?? "";
|
|
132583
133079
|
const max = typeof props.maxLength === "number" && props.maxLength > 0 ? props.maxLength : void 0;
|
|
132584
133080
|
const pick3 = tokens2().find((t2) => t2 !== current && (max === void 0 || t2.length <= max));
|
|
132585
133081
|
if (pick3 === void 0) return null;
|
|
@@ -133240,12 +133736,12 @@ function collapsesWhenEmpty(n2, path2, ctx) {
|
|
|
133240
133736
|
const props = body.props;
|
|
133241
133737
|
if (!props || props.collapseWhenEmpty !== true) return false;
|
|
133242
133738
|
const raw = props.text;
|
|
133243
|
-
const
|
|
133244
|
-
if (
|
|
133245
|
-
const eff =
|
|
133739
|
+
const bound2 = typeof raw === "string" && (raw.startsWith("$service:") || raw.startsWith("$item"));
|
|
133740
|
+
if (bound2 && raw.startsWith("$item") && !ctx.scope) return false;
|
|
133741
|
+
const eff = bound2 ? resolveNameBinding(raw, ctx) : raw;
|
|
133246
133742
|
const s2 = eff == null ? "" : String(eff).trim();
|
|
133247
133743
|
if (s2 !== "" && s2 !== "\u2014") return false;
|
|
133248
|
-
if (
|
|
133744
|
+
if (bound2 && typeof eff === "string" && s2 === "") {
|
|
133249
133745
|
ctx.emptied.push({ at: joinPath(path2, wire ? "body.props" : "props"), field: "text", binding: raw });
|
|
133250
133746
|
}
|
|
133251
133747
|
return true;
|
|
@@ -134016,11 +134512,11 @@ async function crawlScreenInner(opts) {
|
|
|
134016
134512
|
for (const site of sites) {
|
|
134017
134513
|
if (parseWorkerAction(site.actionId)) continue;
|
|
134018
134514
|
const before = { ...site.params ?? {}, ...site.args ?? {} };
|
|
134019
|
-
const
|
|
134020
|
-
if (!
|
|
134515
|
+
const bound2 = Object.entries(before).filter(([, v2]) => typeof v2 === "string" && v2.startsWith("$service:"));
|
|
134516
|
+
if (!bound2.length) continue;
|
|
134021
134517
|
const resolved2 = resolveActionServiceParams({ actionId: site.actionId, params: site.params, args: site.args }, provider);
|
|
134022
134518
|
const after = { ...resolved2.params ?? {}, ...resolved2.args ?? {} };
|
|
134023
|
-
for (const [k2, v2] of
|
|
134519
|
+
for (const [k2, v2] of bound2) {
|
|
134024
134520
|
if (!(k2 in after)) {
|
|
134025
134521
|
findings.push({
|
|
134026
134522
|
screen: screenId,
|
|
@@ -134399,11 +134895,11 @@ function unverifiableNodes(screenId, payload) {
|
|
|
134399
134895
|
const type = typeof body?.type === "string" ? body.type : void 0;
|
|
134400
134896
|
if (type && BLANK_WHEN_BOUND[type]) {
|
|
134401
134897
|
const props = body?.props ?? {};
|
|
134402
|
-
const
|
|
134898
|
+
const bound2 = BLANK_WHEN_BOUND[type].some((p2) => {
|
|
134403
134899
|
const v2 = props[p2];
|
|
134404
134900
|
return typeof v2 === "string" && (v2.startsWith("$service:") || v2.startsWith("$item"));
|
|
134405
134901
|
});
|
|
134406
|
-
if (
|
|
134902
|
+
if (bound2) {
|
|
134407
134903
|
out2.push({
|
|
134408
134904
|
screen: screenId,
|
|
134409
134905
|
node: typeof rec.id === "string" ? `${type}#${rec.id}` : type,
|
|
@@ -146961,8 +147457,8 @@ function planTrim(src, keepIds, links) {
|
|
|
146961
147457
|
validIds: sorted(app.routes.map((r3) => r3.label))
|
|
146962
147458
|
});
|
|
146963
147459
|
}
|
|
146964
|
-
const
|
|
146965
|
-
const implicit =
|
|
147460
|
+
const explicit2 = new Set([...kept].filter((r3) => r3 !== app.home || keepIds.includes(app.home.label)));
|
|
147461
|
+
const implicit = explicit2.has(app.home) ? [] : [app.home];
|
|
146966
147462
|
for (const id of navPinnedScreens(app.nav.value)) {
|
|
146967
147463
|
const route = resolveIn(app, id);
|
|
146968
147464
|
if (!route || kept.has(route)) continue;
|
|
@@ -158826,7 +159322,7 @@ function createLocalTestSandbox() {
|
|
|
158826
159322
|
if (jsonBytes(input) > limits.maxRequestBytes) {
|
|
158827
159323
|
throw new SandboxError("execution_failed", "request exceeds maxRequestBytes");
|
|
158828
159324
|
}
|
|
158829
|
-
const { MessageChannel, Worker: Worker2 } = await import("node:worker_threads");
|
|
159325
|
+
const { MessageChannel: MessageChannel2, Worker: Worker2 } = await import("node:worker_threads");
|
|
158830
159326
|
const started = Date.now();
|
|
158831
159327
|
const workerSource = `
|
|
158832
159328
|
import { parentPort, workerData } from "node:worker_threads";
|
|
@@ -158901,7 +159397,7 @@ function createLocalTestSandbox() {
|
|
|
158901
159397
|
})();
|
|
158902
159398
|
`;
|
|
158903
159399
|
return await new Promise((resolve81, reject) => {
|
|
158904
|
-
const { port1, port2 } = new
|
|
159400
|
+
const { port1, port2 } = new MessageChannel2();
|
|
158905
159401
|
const serializableContext = {
|
|
158906
159402
|
auth: context.auth,
|
|
158907
159403
|
identity: context.identity,
|
|
@@ -165786,36 +166282,37 @@ var init_preview_assets_generated = __esm({
|
|
|
165786
166282
|
"../../packages/serve/src/preview-assets.generated.ts"() {
|
|
165787
166283
|
init_preview_assets_format();
|
|
165788
166284
|
PREVIEW_ASSET_MANIFEST = [
|
|
165789
|
-
{ key: "assets/DashboardHost-
|
|
165790
|
-
{ key: "assets/DevDrawer-
|
|
165791
|
-
{ key: "assets/IdiomCompare-
|
|
165792
|
-
{ key: "assets/LightboxViewer-
|
|
165793
|
-
{ key: "assets/PhonePreviewControl-
|
|
165794
|
-
{ key: "assets/SchemeCompare-
|
|
166285
|
+
{ key: "assets/DashboardHost-ccb_e_DP.js", contentType: "application/javascript; charset=utf-8", offset: 8, length: 2916, sha256: "9183bc77ce886be410e1a6a3d8b811365ba60c82c656f9ed8249c4ba12696620" },
|
|
166286
|
+
{ key: "assets/DevDrawer-_P2xA5Uo.js", contentType: "application/javascript; charset=utf-8", offset: 2924, length: 16744, sha256: "52a51a9937ae5736e37a2c6b383612dafe49ac82dd49817cecf2b87675470733" },
|
|
166287
|
+
{ key: "assets/IdiomCompare-B5rjJbc6.js", contentType: "application/javascript; charset=utf-8", offset: 19668, length: 1892, sha256: "c90292bfc15a84b60d4ad1820d79f51647feb45eaf6c5f7020efd5995edca0c2" },
|
|
166288
|
+
{ key: "assets/LightboxViewer-B9bXYaNa.js", contentType: "application/javascript; charset=utf-8", offset: 21560, length: 8132, sha256: "7dc5209784b7339538bf2e5af88099d94cd4fa4dada0a537025d8ab14b1782f0" },
|
|
166289
|
+
{ key: "assets/PhonePreviewControl-BbU25q3T.js", contentType: "application/javascript; charset=utf-8", offset: 29692, length: 37729, sha256: "7b5bf7361e18d9fab03c8195337dd7d7dbab40aceb81876363115dfd5b3506ca" },
|
|
166290
|
+
{ key: "assets/SchemeCompare-AdWcP5Op.js", contentType: "application/javascript; charset=utf-8", offset: 67421, length: 1824, sha256: "eaac412de580143ae5e2e3c75ffb2af3f507d8f39487681f56cdd51a61a3cd2a" },
|
|
165795
166291
|
{ key: "assets/glassPreviewBrowser-Bt5ZFmG4.js", contentType: "application/javascript; charset=utf-8", offset: 69245, length: 342, sha256: "20d73f97d38f6d9a0b79e68e24954cd6bbfe66833a6e6aecae00a9102e64cab3" },
|
|
165796
|
-
{ key: "assets/index-
|
|
165797
|
-
{ key: "assets/pdf-
|
|
165798
|
-
{ key: "assets/pdf.worker.min-BQa_JDET.js", contentType: "application/javascript; charset=utf-8", offset:
|
|
165799
|
-
{ key: "assets/pdf.worker.min-BmVo14Nb.mjs", contentType: "application/javascript; charset=utf-8", offset:
|
|
165800
|
-
{ key: "assets/pdfDocument
|
|
165801
|
-
{ key: "assets/pdfFetch-Cc8i1I1h.js", contentType: "application/javascript; charset=utf-8", offset:
|
|
165802
|
-
{ key: "
|
|
165803
|
-
{ key: "fonts/Roboto-
|
|
165804
|
-
{ key: "fonts/
|
|
165805
|
-
{ key: "fonts/WixMadeforDisplay-
|
|
165806
|
-
{ key: "fonts/WixMadeforDisplay-
|
|
165807
|
-
{ key: "fonts/WixMadeforDisplay-
|
|
165808
|
-
{ key: "fonts/WixMadeforDisplay-
|
|
165809
|
-
{ key: "fonts/
|
|
165810
|
-
{ key: "fonts/WixMadeforText-
|
|
165811
|
-
{ key: "fonts/WixMadeforText-
|
|
165812
|
-
{ key: "fonts/WixMadeforText-
|
|
165813
|
-
{ key: "fonts/WixMadeforText-
|
|
165814
|
-
{ key: "
|
|
165815
|
-
{ key: "
|
|
165816
|
-
{ key: "
|
|
165817
|
-
{ key: "ios-glass-preview.
|
|
165818
|
-
{ key: "
|
|
166292
|
+
{ key: "assets/index-vy60YTYP.js", contentType: "application/javascript; charset=utf-8", offset: 69587, length: 1332702, sha256: "8602e03a2d1f869963c76b634787d06e2a4f9ff8449f880a03079f2a98d42881" },
|
|
166293
|
+
{ key: "assets/pdf-6zNQxbtC.js", contentType: "application/javascript; charset=utf-8", offset: 1402289, length: 488199, sha256: "c32a381ff3c8da40d4ecc3653dd01e6aa2d2a7273486909aa66d4aa221915ff6" },
|
|
166294
|
+
{ key: "assets/pdf.worker.min-BQa_JDET.js", contentType: "application/javascript; charset=utf-8", offset: 1890488, length: 73, sha256: "41bcfda4f3c8c0a81c785ea87c69afc8e7d0ed8c333324aee94c273d881bb6aa" },
|
|
166295
|
+
{ key: "assets/pdf.worker.min-BmVo14Nb.mjs", contentType: "application/javascript; charset=utf-8", offset: 1890561, length: 1317034, sha256: "a33cfe728c584fdba4fcc1fd54bcdc2f9f2f13889ddbb5b2bd1d0f8cbe49b84e" },
|
|
166296
|
+
{ key: "assets/pdfDocument-CFatnBSm.js", contentType: "application/javascript; charset=utf-8", offset: 3207595, length: 3379, sha256: "50e909061e6bbd49c76392215686898570949f168a40cfc0cf30db5a49560939" },
|
|
166297
|
+
{ key: "assets/pdfFetch-Cc8i1I1h.js", contentType: "application/javascript; charset=utf-8", offset: 3210974, length: 2266, sha256: "1d21ad008921942217c9eac0c35b1713773b9d89c71e3ab4412781f7bb88f463" },
|
|
166298
|
+
{ key: "assets/webviewBridgeHost-BB3fp3uP.js", contentType: "application/javascript; charset=utf-8", offset: 3213240, length: 9781, sha256: "2f5f3427dffef435ba58ee1b7a47eed601d3aabc66648eda053081eaf99e456a" },
|
|
166299
|
+
{ key: "fonts/Roboto-LICENSE.txt", contentType: "application/octet-stream", offset: 3223021, length: 4610, sha256: "994062dd7af4186a739de55dd9e151c63b6301f8e2cbafc608d35c2e87da0cd2" },
|
|
166300
|
+
{ key: "fonts/Roboto-Variable.ttf", contentType: "font/ttf", offset: 3227631, length: 488584, sha256: "d7598e12c5dbef095ff8272cfc55da0250bd07fbdecbac8a530b9b277872a134" },
|
|
166301
|
+
{ key: "fonts/WixMadeforDisplay-Bold.ttf", contentType: "font/ttf", offset: 3716215, length: 90924, sha256: "ec4c7d63772d980d6e147b2df6215fd2737e4b04cebe0cf7e11dc695fb63cdcf" },
|
|
166302
|
+
{ key: "fonts/WixMadeforDisplay-ExtraBold.ttf", contentType: "font/ttf", offset: 3807139, length: 90984, sha256: "bf4c16a2774edd38a921edf3099469866cd74c094fd596f3fa4e81f54a04dfaa" },
|
|
166303
|
+
{ key: "fonts/WixMadeforDisplay-Medium.ttf", contentType: "font/ttf", offset: 3898123, length: 90980, sha256: "368faca44fb9f7207e4af784e94750b1ee59c1098b8689e0f4a918926f244fb5" },
|
|
166304
|
+
{ key: "fonts/WixMadeforDisplay-Regular.ttf", contentType: "font/ttf", offset: 3989103, length: 90872, sha256: "97ed8f1a6772abe26e3d8af5cecfc4b02faa94497d585b0398b5053b739a70c1" },
|
|
166305
|
+
{ key: "fonts/WixMadeforDisplay-SemiBold.ttf", contentType: "font/ttf", offset: 4079975, length: 90980, sha256: "642feab8a48ddf6c7a89d7c2a7c0edfa0e6e773f671287e460e222703563191e" },
|
|
166306
|
+
{ key: "fonts/WixMadeforText-Bold.ttf", contentType: "font/ttf", offset: 4170955, length: 108636, sha256: "37c179b4fefb63ea9637322b84583a2df53aa226c150294eea1675c14b1b8e29" },
|
|
166307
|
+
{ key: "fonts/WixMadeforText-ExtraBold.ttf", contentType: "font/ttf", offset: 4279591, length: 109084, sha256: "62e2fe4718129f36ecdb0ae4de385bd6b81ecc876146447167c6c140fad699a9" },
|
|
166308
|
+
{ key: "fonts/WixMadeforText-Medium.ttf", contentType: "font/ttf", offset: 4388675, length: 109048, sha256: "4ecf270136af928612c76fe4ebade91d8156975e5ea4c0cf9225501dd1788e02" },
|
|
166309
|
+
{ key: "fonts/WixMadeforText-Regular.ttf", contentType: "font/ttf", offset: 4497723, length: 107700, sha256: "dee56f09fd3efc127c1ea95557edc74110c1460a46287da36e0af25efd341ef5" },
|
|
166310
|
+
{ key: "fonts/WixMadeforText-SemiBold.ttf", contentType: "font/ttf", offset: 4605423, length: 88108, sha256: "dced97a77624bc5f8b1ae65850360908297f4588e09feb6f22792d29dc7e765b" },
|
|
166311
|
+
{ key: "himi-sw.js", contentType: "application/javascript; charset=utf-8", offset: 4693531, length: 6748, sha256: "4a92459977d7cefa1a6a7e020c3a63509737f083b3f2773557c1a5771665811a" },
|
|
166312
|
+
{ key: "index.html", contentType: "text/html; charset=utf-8", offset: 4700279, length: 4947, sha256: "dcada8e4b42e9583f4c6ebf2ea3898a3b9b13b53d0174305ca447aaabe18bdb3" },
|
|
166313
|
+
{ key: "ios-glass-preview.css", contentType: "text/css; charset=utf-8", offset: 4705226, length: 7193, sha256: "a482f4796147c2a3893942e10ab225bd3b6f749f7125fe0330680d4c20ea0212" },
|
|
166314
|
+
{ key: "ios-glass-preview.svg", contentType: "image/svg+xml", offset: 4712419, length: 423, sha256: "b9cd5989d31464a0422f260a332af6be5add0b04de2148944de35158f3b75efc" },
|
|
166315
|
+
{ key: "t5-frame.html", contentType: "text/html; charset=utf-8", offset: 4712842, length: 18778, sha256: "ba734d58c88281c71c01d9a2842a991d06f3ed91bf03449427ef11c7f6d1605d" }
|
|
165819
166316
|
];
|
|
165820
166317
|
}
|
|
165821
166318
|
});
|
|
@@ -166002,7 +166499,7 @@ async function runPackage(source, opts = {}) {
|
|
|
166002
166499
|
const server = nodeAdapter(handler);
|
|
166003
166500
|
const first = await listen(server, opts.port ?? 0, host);
|
|
166004
166501
|
const port = first.port;
|
|
166005
|
-
const
|
|
166502
|
+
const bound2 = [first.address];
|
|
166006
166503
|
const servers = [server];
|
|
166007
166504
|
if (lanHost) {
|
|
166008
166505
|
const lanServer = nodeAdapter(handler);
|
|
@@ -166014,7 +166511,7 @@ async function runPackage(source, opts = {}) {
|
|
|
166014
166511
|
if (resolved2.temp) rmSync23(resolved2.temp, { recursive: true, force: true });
|
|
166015
166512
|
throw new Error(`himi run --lan could not listen on ${lanHost}:${port} (${e2.message}); drop --lan, or pass --port for a free one`);
|
|
166016
166513
|
}
|
|
166017
|
-
|
|
166514
|
+
bound2.push(lanBound);
|
|
166018
166515
|
servers.push(lanServer);
|
|
166019
166516
|
}
|
|
166020
166517
|
const origin = `http://${host}:${port}`;
|
|
@@ -166028,7 +166525,7 @@ async function runPackage(source, opts = {}) {
|
|
|
166028
166525
|
url,
|
|
166029
166526
|
releaseRoot: resolved2.releaseRoot,
|
|
166030
166527
|
origin,
|
|
166031
|
-
bound,
|
|
166528
|
+
bound: bound2,
|
|
166032
166529
|
...lanUrl ? { lanUrl } : {},
|
|
166033
166530
|
warnings: resolved2.warnings,
|
|
166034
166531
|
close: async () => {
|
|
@@ -167520,11 +168017,11 @@ function sortKeys(value) {
|
|
|
167520
168017
|
const obj5 = value;
|
|
167521
168018
|
return Object.fromEntries(Object.keys(obj5).sort().map((key3) => [key3, sortKeys(obj5[key3])]));
|
|
167522
168019
|
}
|
|
167523
|
-
function
|
|
168020
|
+
function canonicalJson3(value) {
|
|
167524
168021
|
return JSON.stringify(sortKeys(value));
|
|
167525
168022
|
}
|
|
167526
168023
|
function sha256Digest(value) {
|
|
167527
|
-
return `sha256:${createHash43("sha256").update(
|
|
168024
|
+
return `sha256:${createHash43("sha256").update(canonicalJson3(value)).digest("hex")}`;
|
|
167528
168025
|
}
|
|
167529
168026
|
function manifestDigest(manifest) {
|
|
167530
168027
|
return sha256Digest(manifest);
|
|
@@ -177121,8 +177618,8 @@ function buildVeloChapter(input) {
|
|
|
177121
177618
|
if (owner?.git) source.push("git");
|
|
177122
177619
|
const httpFunctions = dedupeHttp(httpFromFiles);
|
|
177123
177620
|
const pages2 = veloPagesForBind(input.look);
|
|
177124
|
-
const
|
|
177125
|
-
const coded = new Set(
|
|
177621
|
+
const bound2 = bindVeloFiles(files.slice(0, 80), pages2);
|
|
177622
|
+
const coded = new Set(bound2.filter((f2) => f2.pageUrl).map((f2) => f2.pageId).filter(Boolean));
|
|
177126
177623
|
const pagesOut = pages2.map((p2) => ({ ...p2, hasCode: p2.hasCode || !!p2.pageId && coded.has(p2.pageId) }));
|
|
177127
177624
|
const gridAppId = owner?.gridAppId || hint?.gridAppId;
|
|
177128
177625
|
const enabled = source.length > 0 || httpFunctions.length > 0;
|
|
@@ -177131,7 +177628,7 @@ function buildVeloChapter(input) {
|
|
|
177131
177628
|
source,
|
|
177132
177629
|
httpFunctions,
|
|
177133
177630
|
pages: pagesOut,
|
|
177134
|
-
files:
|
|
177631
|
+
files: bound2
|
|
177135
177632
|
};
|
|
177136
177633
|
if (gridAppId) chapter.gridAppId = gridAppId;
|
|
177137
177634
|
if (hint?.wixCodeFeatures.length) chapter.wixCodeFeatures = hint.wixCodeFeatures;
|
|
@@ -184969,8 +185466,8 @@ function buildMergedContract(options) {
|
|
|
184969
185466
|
if (fonts.length) {
|
|
184970
185467
|
branding.fonts = fonts;
|
|
184971
185468
|
const chosen = overlayFontFamily;
|
|
184972
|
-
const
|
|
184973
|
-
if (!
|
|
185469
|
+
const explicit2 = typeof chosen === "string" && chosen.trim() !== "";
|
|
185470
|
+
if (!explicit2) branding.fontFamily = fonts[0].family;
|
|
184974
185471
|
}
|
|
184975
185472
|
}
|
|
184976
185473
|
merged.branding = branding;
|