@homepages/concrete 5.0.0 → 6.0.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/CHANGELOG.md +336 -0
- package/README.md +28 -17
- package/codemods/fill-is-a-source.mjs +533 -0
- package/codemods/manifest.json +12 -0
- package/codemods/reads-replace-reconcile.mjs +285 -0
- package/dist/artifact/playground/client/assets/{index-D1fwOGVK.js → index-u3T7DiSN.js} +96 -96
- package/dist/artifact/playground/client/index.html +1 -1
- package/dist/artifact/playground/host.mjs +23 -23
- package/dist/base.css +3 -8
- package/dist/browser/site-config.js +1 -16
- package/dist/browser/submit-lead.js +0 -31
- package/dist/cli/build/artifact.js +16 -23
- package/dist/cli/build/captures.js +0 -6
- package/dist/cli/build/esbuild.js +0 -17
- package/dist/cli/build/fixtures.js +15 -30
- package/dist/cli/build/icons.js +0 -3
- package/dist/cli/build/index.js +1 -1
- package/dist/cli/build/playground.js +4 -8
- package/dist/cli/build/sections.js +9 -30
- package/dist/cli/build/source.js +52 -27
- package/dist/cli/build/static.js +4 -25
- package/dist/cli/capture/bundle.js +0 -9
- package/dist/cli/capture/capture-browser.js +0 -14
- package/dist/cli/capture/capture.js +1 -8
- package/dist/cli/check/analyze.js +2 -5
- package/dist/cli/check/index.js +1 -1
- package/dist/cli/check/line-endings.js +52 -0
- package/dist/cli/check/load-workspace.js +3 -8
- package/dist/cli/check/portable-names.js +48 -0
- package/dist/cli/check/render/class-conflicts.js +0 -5
- package/dist/cli/check/render/html.js +0 -1
- package/dist/cli/check/render/invariants.js +0 -5
- package/dist/cli/check/render/island-frames.js +0 -25
- package/dist/cli/check/render/marker-coverage.js +0 -20
- package/dist/cli/check/render/nav.js +0 -33
- package/dist/cli/check/report.js +0 -3
- package/dist/cli/check/stages/bundles.js +1 -9
- package/dist/cli/check/stages/composition.js +3 -2
- package/dist/cli/check/stages/dependencies.js +7 -38
- package/dist/cli/check/stages/fixtures.js +3 -31
- package/dist/cli/check/stages/lint.js +2 -2
- package/dist/cli/check/stages/logic.js +3 -34
- package/dist/cli/check/stages/relations.js +46 -0
- package/dist/cli/check/stages/render.js +0 -1
- package/dist/cli/check/stages/sections.js +3 -3
- package/dist/cli/check/stages/stylesheet.js +1 -1
- package/dist/cli/check/stages/typecheck.js +5 -11
- package/dist/cli/check/stages/workspace.js +36 -14
- package/dist/cli/commands.js +9 -56
- package/dist/cli/currency/cache.js +4 -17
- package/dist/cli/currency/decide.js +0 -14
- package/dist/cli/currency/opt-out.js +0 -7
- package/dist/cli/currency/preamble.js +3 -24
- package/dist/cli/currency/prompt.js +0 -1
- package/dist/cli/currency/refresh.js +5 -12
- package/dist/cli/currency/resolve-latest.js +3 -64
- package/dist/cli/currency/version-order.js +0 -12
- package/dist/cli/dev/crop.js +0 -2
- package/dist/cli/dev/http.js +0 -13
- package/dist/cli/dev/index.js +3 -4
- package/dist/cli/dev/islands.js +25 -70
- package/dist/cli/dev/listen.js +26 -0
- package/dist/cli/dev/load-template.js +0 -1
- package/dist/cli/dev/request-error.js +0 -4
- package/dist/cli/dev/server.js +46 -52
- package/dist/cli/dev/tsconfig-paths.js +0 -13
- package/dist/cli/dev/vite.js +9 -38
- package/dist/cli/dev/workspace-reader.js +4 -34
- package/dist/cli/media/cache.js +4 -51
- package/dist/cli/media/derive.js +2 -94
- package/dist/cli/media/deriver-plugin.js +0 -2
- package/dist/cli/media/frame-rung-floor.js +0 -6
- package/dist/cli/property/index.js +0 -4
- package/dist/cli/property/library.js +6 -24
- package/dist/cli/publish/client.js +0 -1
- package/dist/cli/publish/freshness.js +0 -2
- package/dist/cli/publish/git.js +2 -8
- package/dist/cli/publish/index.js +8 -15
- package/dist/cli/publish/pack.js +5 -6
- package/dist/cli/publish/report.js +0 -6
- package/dist/cli/publish/target.js +16 -13
- package/dist/cli/publish/wire.js +0 -6
- package/dist/cli/tar.js +2 -9
- package/dist/cli/upgrade/codemod.js +0 -8
- package/dist/cli/upgrade/index.js +0 -24
- package/dist/cli/upgrade/manifest.js +0 -12
- package/dist/cli/upgrade/plan.js +0 -17
- package/dist/cli/upgrade/stage.js +12 -15
- package/dist/cli/version.js +0 -8
- package/dist/cli/workspace.js +2 -34
- package/dist/cli.js +4 -21
- package/dist/css/compile.js +25 -28
- package/dist/css/graph.js +3 -10
- package/dist/css/inline.js +3 -13
- package/dist/css/rules.js +6 -43
- package/dist/design-system/format-variants.js +0 -22
- package/dist/eslint/authoring.js +0 -2
- package/dist/eslint/correctness.js +0 -7
- package/dist/eslint/rules/editor-reason.js +0 -11
- package/dist/eslint/rules/island-ids.js +0 -1
- package/dist/eslint/rules/jsx-visitor.js +0 -13
- package/dist/eslint/rules/no-editor-globals.js +0 -2
- package/dist/eslint/rules/no-raw-values.js +0 -1
- package/dist/fixtures/brand.js +0 -1
- package/dist/fixtures/bundle-rule.js +4 -9
- package/dist/fixtures/canonical.d.ts +20 -0
- package/dist/fixtures/image-dimensions.js +0 -1
- package/dist/fixtures/load.js +8 -17
- package/dist/fixtures/media-plugin.js +4 -31
- package/dist/fixtures/media.js +0 -21
- package/dist/fixtures/package-stylesheets.js +0 -6
- package/dist/fixtures/property.js +16 -15
- package/dist/fixtures/resolve.js +102 -29
- package/dist/fixtures/rows.js +12 -11
- package/dist/fixtures/synthesize-empties.js +0 -4
- package/dist/fixtures.d.ts +19 -4
- package/dist/fixtures.js +0 -18
- package/dist/index.d.ts +8 -9
- package/dist/index.js +2 -11
- package/dist/islands/client-module.js +0 -11
- package/dist/islands/marker.js +0 -33
- package/dist/node_modules/.pnpm/fflate@0.8.3/node_modules/fflate/esm/browser.js +0 -20
- package/dist/packages/external/concrete/package.js +1 -1
- package/dist/packages/internal/fill-bake/dist/bake-property-ref.js +21 -35
- package/dist/packages/internal/fill-bake/dist/compute-reads.js +4 -0
- package/dist/packages/internal/fill-bake/dist/derive-source.js +40 -0
- package/dist/packages/internal/fill-bake/dist/display.js +0 -1
- package/dist/packages/internal/fill-bake/dist/index.js +4 -4
- package/dist/packages/internal/fill-vocabulary/dist/origination.js +106 -0
- package/dist/packages/internal/fill-vocabulary/dist/row-planners.js +1 -49
- package/dist/packages/internal/format-geometry/dist/capture.js +10 -240
- package/dist/packages/internal/format-geometry/dist/geometry.js +0 -6
- package/dist/packages/internal/image-ladder/dist/crop.js +0 -12
- package/dist/packages/internal/image-ladder/dist/policy.js +0 -14
- package/dist/packages/internal/island-runtime/dist/capture-holds.js +0 -13
- package/dist/packages/internal/island-runtime/dist/contract.js +0 -34
- package/dist/packages/internal/island-runtime/dist/editor-instance-context.js +0 -1
- package/dist/packages/internal/island-runtime/dist/index.js +0 -34
- package/dist/packages/internal/island-runtime/dist/island-id-context.js +0 -1
- package/dist/packages/internal/island-runtime/dist/use-capture-ready.js +0 -15
- package/dist/packages/internal/island-runtime/dist/use-editor.js +0 -10
- package/dist/packages/internal/island-runtime/dist/use-island-id.js +0 -32
- package/dist/packages/internal/property-facts/dist/derive-facts-view.js +2 -17
- package/dist/packages/internal/property-facts/dist/index.js +1 -1
- package/dist/packages/internal/property-facts/dist/{property-facts-CSdkSuD7.js → property-facts-5pxZnlkh.js} +13 -2
- package/dist/packages/internal/section-contracts/dist/cap-contract.js +1 -18
- package/dist/packages/internal/section-contracts/dist/catalog.js +16 -8
- package/dist/packages/internal/section-contracts/dist/choose-select-contract.js +12 -16
- package/dist/packages/internal/section-contracts/dist/count-bounds-contract.js +5 -11
- package/dist/packages/internal/section-contracts/dist/display-contract.js +2 -0
- package/dist/packages/internal/section-contracts/dist/display-evidence-contract.js +2 -8
- package/dist/packages/internal/section-contracts/dist/fill-spec-view.js +13 -0
- package/dist/packages/internal/section-contracts/dist/index.js +2 -1
- package/dist/packages/internal/section-contracts/dist/interpolation-contract.js +16 -42
- package/dist/packages/internal/section-contracts/dist/list-fill-contract.js +24 -43
- package/dist/packages/internal/section-contracts/dist/name-title-contract.js +11 -18
- package/dist/packages/internal/section-contracts/dist/poi-curation-contract.js +10 -12
- package/dist/packages/internal/section-contracts/dist/pooling-field-contract.js +3 -13
- package/dist/packages/internal/section-contracts/dist/row-fill-contract.js +6 -18
- package/dist/packages/internal/section-contracts/dist/runners.js +21 -13
- package/dist/packages/internal/section-contracts/dist/source-contract.js +13 -2
- package/dist/packages/internal/section-contracts/dist/writer-reads-fact-contract.js +31 -0
- package/dist/packages/internal/source-resolution/dist/index.js +1 -9
- package/dist/packages/internal/template-artifact/dist/hash.js +0 -8
- package/dist/packages/internal/template-artifact/dist/index.js +1 -1
- package/dist/packages/internal/template-artifact/dist/layout.js +0 -39
- package/dist/packages/internal/template-artifact/dist/manifest.js +1 -9
- package/dist/packages/internal/template-artifact/dist/sha256.js +0 -1
- package/dist/packages/internal/template-artifact/dist/verify.js +2 -4
- package/dist/packages/internal/template-contracts/dist/collection-editing.js +0 -16
- package/dist/packages/internal/template-contracts/dist/content-categories.js +0 -4
- package/dist/packages/internal/template-contracts/dist/facts-view.d.ts +16 -10
- package/dist/packages/internal/template-contracts/dist/facts-view.js +15 -28
- package/dist/packages/internal/template-contracts/dist/layout.js +0 -7
- package/dist/packages/internal/template-contracts/dist/markers.js +0 -29
- package/dist/packages/internal/template-contracts/dist/select-key.js +0 -6
- package/dist/packages/internal/template-contracts/dist/slot-catalog.d.ts +56 -34
- package/dist/packages/internal/template-contracts/dist/slot-catalog.js +22 -389
- package/dist/platform/file-url.js +8 -0
- package/dist/platform/fs.js +73 -0
- package/dist/platform/names.js +63 -0
- package/dist/platform/order.js +7 -0
- package/dist/platform/paths.js +62 -0
- package/dist/platform/process.js +97 -0
- package/dist/playground/host/page-state.js +0 -2
- package/dist/playground/host/paths.js +0 -1
- package/dist/playground/layout.js +0 -7
- package/dist/playground/wire.js +0 -8
- package/dist/primitives/FrameShell.js +0 -18
- package/dist/primitives/Image.d.ts +5 -1
- package/dist/primitives/Image.js +2 -68
- package/dist/primitives/Section.js +0 -13
- package/dist/primitives/Tour.js +0 -26
- package/dist/primitives/Video.js +0 -32
- package/dist/primitives/embed-playback.js +0 -1
- package/dist/primitives/marker-attrs.js +0 -17
- package/dist/primitives/picture-sources.js +6 -1
- package/dist/primitives/probe-context.js +0 -7
- package/dist/primitives/slot-bindings.js +0 -46
- package/dist/primitives/slot-document.js +0 -11
- package/dist/primitives/slot-group.js +0 -9
- package/dist/primitives/slot-media.js +0 -27
- package/dist/primitives/slot-scalar.js +0 -4
- package/dist/primitives/slot.js +0 -6
- package/dist/rules/registry.js +42 -24
- package/dist/schema/compute.d.ts +46 -8
- package/dist/schema/compute.js +21 -15
- package/dist/schema/define-schema.d.ts +1 -1
- package/dist/schema/define-schema.js +37 -17
- package/dist/schema/extract-fill-spec.js +93 -180
- package/dist/schema/extract-used-facts.js +16 -158
- package/dist/schema/fact.d.ts +25 -12
- package/dist/schema/fact.js +7 -11
- package/dist/schema/fill-builders.d.ts +91 -366
- package/dist/schema/fill-builders.js +21 -259
- package/dist/schema/fill-declaration.d.ts +7 -69
- package/dist/schema/fill-declaration.js +5 -34
- package/dist/schema/fill-spec.js +59 -148
- package/dist/schema/format-presets.js +0 -12
- package/dist/schema/format.js +0 -7
- package/dist/schema/layout.js +0 -10
- package/dist/schema/manifest.js +0 -39
- package/dist/schema/property-facts.d.ts +20 -0
- package/dist/schema/section-nav.js +0 -15
- package/dist/schema/section-schema.d.ts +0 -1
- package/dist/schema/section-schema.js +4 -20
- package/dist/schema/slot-builders.d.ts +128 -117
- package/dist/schema/slot-builders.js +18 -201
- package/dist/schema/slot-ref.d.ts +63 -0
- package/dist/schema/slot-ref.js +33 -0
- package/dist/schema/slot-types.d.ts +3 -2
- package/dist/schema/slot-types.js +11 -20
- package/dist/section/declare.d.ts +14 -10
- package/dist/section/declare.js +13 -2
- package/dist/section/discovery.js +6 -21
- package/dist/section/groups.js +0 -6
- package/dist/section/materialize.js +0 -5
- package/dist/section/placements.js +0 -4
- package/dist/section/section.d.ts +8 -5
- package/dist/section/section.js +7 -29
- package/dist/styles.css +5 -0
- package/dist/template/define-template.d.ts +0 -4
- package/dist/template/define-template.js +1 -15
- package/dist/template/logic-build.js +8 -35
- package/dist/template/logic-shim.d.ts +4 -5
- package/dist/template/logic-shim.js +2 -6
- package/dist/template/logic-transform.js +0 -6
- package/dist/template/materialize.js +52 -43
- package/dist/template/mirror-types.js +43 -0
- package/dist/template/running-copy.js +5 -20
- package/dist/template/section-reads.js +83 -0
- package/guide/reference/cli/INDEX.md +12 -6
- package/guide/reference/cli/build.md +1 -1
- package/guide/reference/cli/check.md +1 -1
- package/guide/reference/cli/dev.md +3 -3
- package/guide/reference/cli/property-add.md +1 -1
- package/guide/reference/cli/property-list.md +1 -1
- package/guide/reference/cli/publish.md +4 -2
- package/guide/reference/cli/upgrade.md +1 -1
- package/guide/reference/rules/INDEX.md +26 -13
- package/package.json +4 -2
- package/dist/packages/internal/fact-interpolation/dist/index.js +0 -22
- package/dist/packages/internal/fill-bake/dist/reconcile-cross-section.js +0 -170
- package/dist/packages/internal/fill-vocabulary/dist/facts.d.ts +0 -32
- package/dist/packages/internal/fill-vocabulary/dist/facts.js +0 -131
- package/dist/packages/internal/template-contracts/dist/slot-overrides.js +0 -11
- package/dist/schema/fill-spec.d.ts +0 -18
- package/dist/template/reconcile.d.ts +0 -67
- package/dist/template/reconcile.js +0 -25
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="utf-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
6
|
<title>Playground</title>
|
|
7
|
-
<script type="module" crossorigin src="./assets/index-
|
|
7
|
+
<script type="module" crossorigin src="./assets/index-u3T7DiSN.js"></script>
|
|
8
8
|
<link rel="stylesheet" crossorigin href="./assets/index-CckS2ONm.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Xe=/^(\d+(?:\.\d+)?)(in|mm)$/;function Y(e){let t=Xe.exec(e),[,n,r]=t??[];if(n===void 0||r===void 0)throw new Error(`malformed physical length: "${e}"`);let o=Number.parseFloat(n);return r==="mm"?o/25.4:o}function N(e){if(typeof e.width=="number"&&typeof e.height=="number")return{frameWidth:e.width,frameHeight:e.height,bleed:0,viewportWidth:e.width,viewportHeight:e.height,deviceScaleFactor:1,pixelWidth:e.width,pixelHeight:e.height,pointWidth:e.width/96*72,pointHeight:e.height/96*72,bleedPoints:0};let t=e,n=Y(t.width),r=Y(t.height),o=t.bleed===void 0?0:Y(t.bleed),l=n*96,u=r*96,d=o*96,a=l+2*d,h=u+2*d,v=t.dpi/96;return{frameWidth:l,frameHeight:u,bleed:d,viewportWidth:a,viewportHeight:h,deviceScaleFactor:v,pixelWidth:Math.round(a*v),pixelHeight:Math.round(h*v),pointWidth:(n+2*o)*72,pointHeight:(r+2*o)*72,bleedPoints:o*72}}var $="concrete-frame";function O(e){let t=N(e);return{"--frame-w":`${t.frameWidth}px`,"--frame-h":`${t.frameHeight}px`,"--frame-bleed":`${t.bleed}px`}}var J=`(function () {
|
|
2
2
|
function CaptureIntersectionObserver(callback, options) {
|
|
3
3
|
var opts = options || {};
|
|
4
4
|
this.root = opts.root || null;
|
|
@@ -46,23 +46,23 @@ var Ke=/^(\d+(?:\.\d+)?)(in|mm)$/;function X(e){let t=Ke.exec(e),[,n,r]=t??[];if
|
|
|
46
46
|
return entries;
|
|
47
47
|
};
|
|
48
48
|
window.IntersectionObserver = CaptureIntersectionObserver;
|
|
49
|
-
})();`;var
|
|
50
|
-
const ready = window.${
|
|
49
|
+
})();`;var K="__trIslandsReady",Ke=`(async () => {
|
|
50
|
+
const ready = window.${K};
|
|
51
51
|
if (ready === undefined) {
|
|
52
52
|
throw new Error(
|
|
53
53
|
"capture blocked: the page ships island markers but its host published no " +
|
|
54
|
-
"window.${
|
|
54
|
+
"window.${K} \u2014 the island runtime never ran",
|
|
55
55
|
);
|
|
56
56
|
}
|
|
57
57
|
await ready;
|
|
58
|
-
})()`;var le=400;var
|
|
58
|
+
})()`;var le=400;var Je=`(async () => {
|
|
59
59
|
await new Promise((resolve) => {
|
|
60
60
|
setTimeout(resolve, ${le});
|
|
61
61
|
});
|
|
62
62
|
await new Promise((resolve) => {
|
|
63
63
|
requestAnimationFrame(() => resolve(undefined));
|
|
64
64
|
});
|
|
65
|
-
})()`,ce=5,
|
|
65
|
+
})()`,ce=5,Qe=`(async () => {
|
|
66
66
|
const frame = () => new Promise((resolve) => {
|
|
67
67
|
requestAnimationFrame(() => resolve(undefined));
|
|
68
68
|
});
|
|
@@ -83,37 +83,37 @@ var Ke=/^(\d+(?:\.\d+)?)(in|mm)$/;function X(e){let t=Ke.exec(e),[,n,r]=t??[];if
|
|
|
83
83
|
await frame();
|
|
84
84
|
}
|
|
85
85
|
await frame();
|
|
86
|
-
})()`;function M(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026")}function
|
|
87
|
-
<script type="application/json" id="
|
|
88
|
-
${e.root.bodyHtml}${
|
|
89
|
-
<script type="module" src="${
|
|
90
|
-
</body>`})}function
|
|
86
|
+
})()`;function M(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026")}function g(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function de(e){return ue(e.id,{...O(e)})}function ue(e,t){let n=Object.entries(t).map(([r,o])=>`${r}:${o}`).join(";");return{class:$,dataFormat:e,style:n}}function L(e,t){let n=de(e);return`<div class="${g(n.class)}" data-format="${g(n.dataFormat)}" style="${g(n.style)}">${t.join("")}</div>`}function C(e){switch(e.destination){case"published":return Ze(e);case"artifact":return et(e);case"preview":return tt(e);case"diff":return nt(e)}}function pe(e){return e.kind==="none"||Object.keys(e.islandMap).length===0?[]:[`<script>${J}</script>`]}var me="html, body { margin: 0; padding: 0; }";function fe(e){let t=[`rel="${e.rel}"`,`href="${g(e.href)}"`];return e.sizes!==void 0&&t.push(`sizes="${g(e.sizes)}"`),e.type!==void 0&&t.push(`type="${g(e.type)}"`),`<link ${t.join(" ")} />`}function Ze(e){let{meta:t}=e,n=['<meta charset="utf-8" />','<meta name="viewport" content="width=device-width, initial-scale=1" />',`<title>${g(t.title)}</title>`,`<meta name="description" content="${g(t.description)}" />`];t.canonical&&n.push(`<link rel="canonical" href="${g(t.canonical)}" />`);for(let o of t.icons??[])n.push(fe(o));n.push('<meta property="og:type" content="website" />'),t.siteName&&n.push(`<meta property="og:site_name" content="${g(t.siteName)}" />`),n.push(`<meta property="og:title" content="${g(t.title)}" />`),n.push(`<meta property="og:description" content="${g(t.description)}" />`),t.ogUrl&&n.push(`<meta property="og:url" content="${g(t.ogUrl)}" />`),t.ogImage&&(n.push(`<meta property="og:image" content="${g(t.ogImage)}" />`),t.ogImageWidth&&n.push(`<meta property="og:image:width" content="${t.ogImageWidth}" />`),t.ogImageHeight&&n.push(`<meta property="og:image:height" content="${t.ogImageHeight}" />`),t.ogImageType&&n.push(`<meta property="og:image:type" content="${g(t.ogImageType)}" />`),t.ogImageAlt&&n.push(`<meta property="og:image:alt" content="${g(t.ogImageAlt)}" />`),n.push('<meta name="twitter:card" content="summary_large_image" />'),n.push(`<meta name="twitter:title" content="${g(t.title)}" />`),n.push(`<meta name="twitter:description" content="${g(t.description)}" />`),n.push(`<meta name="twitter:image" content="${g(t.ogImage)}" />`)),n.push(...q(e.stylesheets)),n.push(...Z(e.islands)),e.prefetchUrls&&e.prefetchUrls.length>0&&n.push(`<script type="speculationrules">${M({prefetch:[{source:"list",urls:[...e.prefetchUrls]}]})}</script>`);let r=e.siteConfig?`
|
|
87
|
+
<script type="application/json" id="concrete-site-config">${M(e.siteConfig)}</script>`:"";return j({lang:t.lang??"en",head:n,body:` <body class="concrete-root">
|
|
88
|
+
${e.root.bodyHtml}${r}${ee(e.islands,"viewport")}
|
|
89
|
+
<script type="module" src="${g(e.analyticsJs.url)}"></script>
|
|
90
|
+
</body>`})}function et(e){let t=['<meta charset="utf-8" />'];e.title!==void 0&&t.push(`<title>${g(e.title)}</title>`),t.push(...q(e.stylesheets));let n=[me,...ot(e.root)];return t.push(Q(n)),t.push(...pe(e.islands)),t.push(...Z(e.islands)),j({lang:"en",head:t,body:` <body>${rt(e.root)}${ee(e.islands,"eager")}</body>`})}function tt(e){let t=['<meta charset="utf-8" />','<meta name="viewport" content="width=device-width, initial-scale=1" />',`<title>${g(e.title)}</title>`,...e.icon===void 0?[]:[fe({rel:"icon",href:e.icon})],...q(e.stylesheets),Q([me,...e.extraCss??[]]),...e.capture===!0?pe(e.islands):[],...Z(e.islands)],n=(e.devScripts??[]).map(r=>`
|
|
91
91
|
${r}`).join("");return j({lang:"en",head:t,body:` <body>
|
|
92
92
|
${e.root.bodyHtml}${ee(e.islands,e.capture===!0?"eager":"viewport")}${n}
|
|
93
|
-
</body>`})}function
|
|
93
|
+
</body>`})}function nt(e){let t=['<meta charset="utf-8" />',`<meta name="viewport" content="width=${e.viewportWidth}, initial-scale=1" />`,`<title>${g(e.title)}</title>`,...q(e.stylesheets),Q([`html, body { margin: 0; padding: 0; width: ${e.viewportWidth}px; }`])];return j({lang:"en",head:t,body:` <body>${e.root.bodyHtml}</body>`})}function j(e){let t=e.head.map(n=>` ${n}`).join(`
|
|
94
94
|
`);return`<!doctype html>
|
|
95
|
-
<html lang="${
|
|
95
|
+
<html lang="${g(e.lang)}">
|
|
96
96
|
<head>
|
|
97
97
|
${t}
|
|
98
98
|
</head>
|
|
99
99
|
${e.body}
|
|
100
100
|
</html>
|
|
101
|
-
`}function
|
|
102
|
-
`)}function
|
|
101
|
+
`}function rt(e){return e.kind==="frame"?L(e.format,e.sectionHtml):e.pages.map(t=>L(e.format,t)).join(`
|
|
102
|
+
`)}function ot(e){return e.kind!=="frameStack"?[]:[`body > .${$} { break-after: page; }`,`body > .${$}:last-child { break-after: auto; }`]}function q(e){return e.kind==="links"?e.hrefs.map(t=>`<link rel="stylesheet" href="${g(t)}" />`):e.css.map(t=>`<style>${t}</style>`)}function Q(e){let[t,...n]=e;return t===void 0?"<style></style>":n.length===0?`<style>${t}</style>`:`<style>${t}
|
|
103
103
|
${n.join(`
|
|
104
104
|
`)}
|
|
105
|
-
</style>`}function Z(e){if(e.kind!=="bundles")return[];let t=[],n=e.reactVendorMap;if(n&&Object.keys(n).length>0&&t.push(`<script type="importmap">${M({imports:n})}</script>`),Object.keys(e.islandMap).length===0)return t;for(let r of[e.runtime.url,...Object.values(n??{}),...e.reactVendorCore?[e.reactVendorCore.url]:[]])t.push(`<link rel="modulepreload" href="${
|
|
105
|
+
</style>`}function Z(e){if(e.kind!=="bundles")return[];let t=[],n=e.reactVendorMap;if(n&&Object.keys(n).length>0&&t.push(`<script type="importmap">${M({imports:n})}</script>`),Object.keys(e.islandMap).length===0)return t;for(let r of[e.runtime.url,...Object.values(n??{}),...e.reactVendorCore?[e.reactVendorCore.url]:[]])t.push(`<link rel="modulepreload" href="${g(r)}" />`);return t}function ee(e,t){if(e.kind==="none"||Object.keys(e.islandMap).length===0)return"";let n=M(e.islandMap),r=t==="eager"?' window.__TR_ISLAND_SCHEDULE = "eager";':"";return e.kind==="bundles"?`
|
|
106
106
|
<script>window.__TR_ISLAND_MAP=${n};${r}</script>
|
|
107
|
-
<script type="module" src="${
|
|
108
|
-
${
|
|
107
|
+
<script type="module" src="${g(e.runtime.url)}"></script>`:`
|
|
108
|
+
${it}
|
|
109
109
|
<script>window.__TR_ISLAND_MAP = ${n};${r}</script>
|
|
110
|
-
<script type="module" src="${
|
|
110
|
+
<script type="module" src="${g(e.bootstrapUrl)}"></script>`}var it=`<script type="module">
|
|
111
111
|
import RefreshRuntime from "/@react-refresh";
|
|
112
112
|
RefreshRuntime.injectIntoGlobalHook(window);
|
|
113
113
|
window.$RefreshReg$ = () => {};
|
|
114
114
|
window.$RefreshSig$ = () => (type) => type;
|
|
115
115
|
window.__vite_plugin_react_preamble_installed__ = true;
|
|
116
|
-
</script>`;function _e(){let e={};return new Proxy(e,{get:(t,n)=>typeof n!="string"||n in e||n==="then"||n==="toJSON"?e[n]:`#${n}`})}function be(e){let t=new URLSearchParams;for(let[r,o]of Object.entries(e))o!=null&&o!==""&&t.set(r,o);let n=t.toString();return n===""?"":`?${n}`}var T={catalog:"api/catalog",render:"api/render",media:e=>`api/media${be({fixture:e})}`,capture:(e,t)=>`api/capture/${e}${be({fixture:t.fixture,format:t.format,page:t.page,canvas:t.canvas})}`,live:(e,t)=>`fixtures/${encodeURIComponent(e)}/live${t==="/"?"/":`${t}/`}`,hmr:"__hmr"};var g=class extends Error{constructor(n,r){super(r);this.status=n}status};function ut(e){return e.split("-").map(t=>t&&t[0].toUpperCase()+t.slice(1)).join(" ")}function ve(e){let{variant:t}=e;return{required:e.required,variant:t===null?null:{cases:t.cases.map(n=>({value:n,label:ut(n)})),locked:t.locked}}}function we(e){return Object.fromEntries(e.map(t=>[t.instance_id,{enabled:t.enabled,...t.variant===void 0?{}:{variant:t.variant}}]))}function xe(e){if(e==null)return{};if(typeof e!="object"||Array.isArray(e))throw new g(400,"A render request's display is an object keyed by instance id.");let t={};for(let[n,r]of Object.entries(e)){if(typeof r!="object"||r===null||Array.isArray(r))throw new g(400,`The display state of "${n}" is not an object.`);let{enabled:o,variant:s}=r;if(o!==void 0&&typeof o!="boolean")throw new g(400,`The display state of "${n}" has a non-boolean enabled.`);if(s!==void 0&&typeof s!="string")throw new g(400,`The display state of "${n}" has a non-string variant.`);t[n]={...o===void 0?{}:{enabled:o},...s===void 0?{}:{variant:s}}}return t}function Re(e,t){for(let[n,r]of Object.entries(t)){let o=e.instances.find(u=>u.instanceId===n);if(o===void 0)throw new g(400,`The composition places no instance "${n}".`);if(r.enabled===!1&&o.display.required)throw new g(400,`Section instance "${n}" is required and cannot be hidden.`);if(r.variant===void 0)continue;let s=o.display.variant;if(s===null)throw new g(400,`Section instance "${n}" declares no display variant.`);if(s.locked)throw new g(400,`Section instance "${n}" declares a locked variant, which the user cannot switch.`);if(!s.cases.includes(r.variant))throw new g(400,`"${r.variant}" is not a declared case of section instance "${n}" (declared: ${s.cases.join(", ")}).`)}}function Se(e,t){return new Map(e.instances.map(n=>[n.instance_id,t[n.instance_id]?.enabled??n.enabled]))}function ke(e,t,n){let r=n[e.instance_id]?.variant;if(r===void 0||r===e.variant)return e;let o={...e.slots};for(let[s,u]of Object.entries(t))s in o||(u.variant===void 0||u.variant.cases.includes(r))&&(o[s]=u.type==="list"?[]:null);return{...e,variant:r,slots:o}}function Ie(e){return Array.isArray(e)?e.length:0}function Ee(e){return typeof e=="string"&&e!==""?e:null}function pt(e){return{propertyType:Ee(e.property_type),listingIntent:Ee(e.listing_intent),units:Ie(e.units),photos:Ie(e.photos)}}function mt(e){let t=JSON.stringify(e),n=3735928559,r=1103547991;for(let o=0;o<t.length;o++){let s=t.charCodeAt(o);n=Math.imul(n^s,2654435761),r=Math.imul(r^s,1597334677)}return n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&r)+(n>>>0)).toString(16).padStart(14,"0")}function Pe(e){return{id:e.id,label:e.label,summary:pt(e.facts),doc:mt(e.instances),display:we(e.instances)}}function Te(e,t){let n=e.replace(/\/+$/,"");return t==="/"?`${n}/`:`${n}${t}/`}function Ce(e){let{pages:t,currentPageId:n,basePath:r}=e,o=t.find(d=>d.id===n);if(!o)throw new Error(`nav: page "${n}" is not one of the declared pages (${t.map(d=>d.id).join(", ")}).`);let s=[o,...t.filter(d=>d.id!==o.id&&d.enabled!==!1)],u={};for(let d of s)for(let a of d.sections)a.enabled===!1||a.key in u||(u[a.key]=d.id===o.id?`#${a.anchor}`:`${Te(r,d.path)}#${a.anchor}`);return{anchors:u,pages:t.filter(d=>d.enabled!==!1).map(d=>({id:d.id,label:d.label,href:Te(r,d.path),current:d.id===o.id}))}}function W(e,t){return e.pages?.[t]?.enabled!==!1}function te(e,t){return t.filter(n=>W(e,n.id))}var D={base:"stylesheets/base.css",template:"stylesheets/template.css"},k={frame:"__capture/frame",print:"__capture/print"};function $e(e){return new URLSearchParams(e).toString()}function ne(e,t,n){return`${k.frame}?${$e({fixture:e,page:t,format:n})}`}function Ae(e,t){return`${k.print}?${$e({fixture:e,format:t})}`}var ft=["text","number","select","image","list","poi","url","video","tour","document"],gt=[],Tn=[...ft,...gt];var yt=["address","type","intent","describe","uploads","units","comparables","contacts"];var ht={address:"always",type:"always",intent:"always",describe:"always",uploads:"always",units:"derived",comparables:"derived",contacts:"derived"},Cn=yt.filter(e=>ht[e]==="always");var _t={matterport:{kind:"tour",label:"Matterport",pattern:/(^|\.)matterport\.com$/i,strategy:"api"},biganto:{kind:"tour",label:"Biganto",pattern:/(^|\.)biganto\.com$/i,strategy:"opengraph"},youtube:{kind:"video",label:"YouTube",pattern:/(^|\.)(youtube\.com|youtu\.be)$/i,strategy:"oembed"},vimeo:{kind:"video",label:"Vimeo",pattern:/(^|\.)vimeo\.com$/i,strategy:"oembed"},zillow:{kind:"listing",label:"Zillow",pattern:/(^|\.)zillow\.com$/i,strategy:"none"},redfin:{kind:"listing",label:"Redfin",pattern:/(^|\.)redfin\.com$/i,strategy:"none"},dropbox:{kind:"file",label:"Dropbox",pattern:/(^|\.)dropbox\.com$/i,strategy:"none"},drive:{kind:"file",label:"Google Drive",pattern:/^drive\.google\.com$/i,strategy:"none"},maps:{kind:"map",label:"Google Maps",pattern:/(^|\.)google\.com$/i,path:/^\/maps(\/|$)/i,strategy:"none"}};function He(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!=="http:"&&t.protocol!=="https:")return null;for(let[n,r]of Object.entries(_t))if(r.pattern.test(t.hostname)&&!(r.path&&!r.path.test(t.pathname)))return n;return null}var bt="badge=0&autopause=0&player_id=0&title=0&byline=0&portrait=0&sidedock=0&vimeo_logo=0&pip=0&chromecast=0&quality_selector=0&progress_bar=1";function Oe(e){let t=e.trim();if(!t)return null;let n=He(t);if(n==="vimeo"){let r=t.match(/vimeo\.com\/(?:.*\/)?(\d+)/);return r?`https://player.vimeo.com/video/${r[1]}?${bt}`:null}if(n==="youtube"){let r=t.match(/youtu\.be\/([A-Za-z0-9_-]{11})/)??t.match(/[?&]v=([A-Za-z0-9_-]{11})/)??t.match(/youtube\.com\/(?:embed|shorts)\/([A-Za-z0-9_-]{11})/);return r?`https://www.youtube.com/embed/${r[1]}?rel=0`:null}return null}function Ne(e){let t=e.trim();if(!t)return null;let n=He(t);if(n==="matterport"){let r=new URL(t).searchParams.get("m");return r!==null&&/^[A-Za-z0-9]+$/.test(r)?`https://my.matterport.com/show/?m=${r}&nt=1`:null}return n==="biganto"?t:null}var V=e=>e<0?0:e>1?1:e;function F(e){if(typeof e!="object"||e===null)return null;let{nx:t=0,ny:n=0,nw:r=1,nh:o=1}=e;if(![t,n,r,o].every(a=>typeof a=="number"&&Number.isFinite(a)))return null;let s=V(t),u=V(n),d={nx:s,ny:u,nw:Math.min(V(r),1-s),nh:Math.min(V(o),1-u)};return d.nw<=0||d.nh<=0||d.nx===0&&d.ny===0&&d.nw===1&&d.nh===1?null:d}var G={file(e){return typeof e=="string"?{url:e,responsive:null}:{url:e.url,responsive:e.responsive}}};function vt(e){if(typeof e!="object"||e===null)return null;let t=e.asset_id;return typeof t=="string"&&t!==""?t:null}function wt(e,t,n){if(e.file===null)return null;let r=n.crop===void 0?null:F(t.rect),o=n.crop===void 0?null:F(t.mobile_rect),s=n.file(e.file),u=r===null?{photo_id:e.id,url:s.url,alt:e.alt,responsive:s.responsive}:{photo_id:e.id,url:n.crop(e.file,r),alt:e.alt,responsive:null,rect:r};return o!==null&&(u.mobile={url:n.crop(e.file,o),responsive:null}),u}function Me(e,t){if(e.posterFile!==void 0){let n=t.file(e.posterFile);return n.responsive===null?{poster:n.url}:{poster:n.url,poster_responsive:n.responsive}}return{poster:e.posterUrl??""}}function xt(e,t){let n=Me(e,t);return e.file===null?{video_id:e.id,url:Oe(e.url??"")??"",...n,alt:e.alt,source:"link",...e.provider===null?{}:{provider:e.provider}}:{video_id:e.id,url:t.file(e.file).url,...n,alt:e.alt,source:"upload"}}function Rt(e,t){return{tour_id:e.id,url:Ne(e.url??"")??"",...Me(e,t),alt:e.alt,...e.provider===null?{}:{provider:e.provider}}}function St(e,t){return e.file===null?null:{asset_id:e.id,url:t.file(e.file).url,filename:e.filename,content_type:e.mime,size_bytes:0}}function kt(e,t,n,r){let o=vt(t),s=o===null?void 0:n.get(o);if(s===void 0||s.kind!==e)return null;switch(e){case"image":return wt(s,t,r);case"video":return xt(s,r);case"tour":return Rt(s,r);case"document":return St(s,r);default:return null}}var It=new Set(["image","video","tour","document"]),Et=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function Pt(e,t,n){let r=typeof e.id=="string"?e.id:"",o=typeof e.floor_label=="string"?e.floor_label:null,s=r===""?void 0:t.get(r),u=s?.kind==="image"&&s.file!==null?n.file(s.file):null;return{id:r,...typeof e.upload_id=="string"?{upload_id:e.upload_id}:{},url:u?.url??"",alt:o??"Floor plan",floor_label:o,position:typeof e.position=="number"?e.position:0,...u?.responsive?{responsive:u.responsive}:{}}}function Tt(e,t,n,r){return e.type==="image"&&Array.isArray(t)?t.filter(Et).map(o=>Pt(o,n,r)):re(e,t,n,r)}function re(e,t,n,r){if(t==null)return t;if(It.has(e.type))return kt(e.type,t,n,r);if(e.type!=="list"||!Array.isArray(t))return t;let o=t;if(e.fields!==void 0){let s=e.fields;return o.map(u=>{if(typeof u!="object"||u===null)return u;let d={...u};for(let[a,h]of Object.entries(s))d[a]=Tt(h,d[a],n,r);return d})}if(e.element!==void 0){let s=e.element;return o.map(u=>re(s,u,n,r))}return o}function De(e,t,n,r=G){let o={};for(let[s,u]of Object.entries(e.slots)){let d=t.schema.slots[s];o[s]=d===void 0?u:re(d,u,n,r)}return o}function Fe(e){return typeof e=="string"?e:e.url}function Ct(e,t){return e.split(",").map(n=>{let[r="",...o]=n.trim().split(/\s+/);return[t(r),...o].join(" ")}).join(", ")}function $t(e){return{file(t){let n=G.file(t),r=n.responsive===null?null:{...n.responsive,sources:n.responsive.sources.map(o=>({...o,srcset:Ct(o.srcset,e)}))};return{url:e(n.url),responsive:r}},crop(t,n){return e(G.file(t).url,{crop:n})}}}function A(e){return Array.isArray(e)?e:[]}function Ue(e,t){let{facts:n}=e,r=a=>e.media[a],o=a=>a?.file===null||a?.file===void 0?"":t(Fe(a.file)),s=a=>a?.posterFile!==void 0?t(Fe(a.posterFile)):a?.posterUrl??"",u=[];for(let a of A(n.photos)){let h=r(a.id);u.push({id:a.id,kind:"photo",name:h?.filename||a.id,size:"",src:o(h),caption:a.caption??null})}for(let a of A(n.floor_plans)){let h=r(a.id);u.push({id:a.id,kind:"plan",name:h?.filename||a.id,size:"",src:o(h)})}for(let a of A(n.videos)){let h=a.provider??void 0;u.push({id:a.id,kind:"video",name:a.caption??r(a.id)?.filename??a.id,size:"",src:s(r(a.id)),caption:a.caption??null,ready:!0,durationMs:a.duration_ms??null,...h===void 0?{}:{provider:h}})}for(let a of A(n.tours))u.push({id:a.id,kind:"tour",name:`${a.provider??"Tour"} ${a.id}`,size:"",src:s(r(a.id)),ready:!0,provider:a.provider??""});for(let a of A(n.documents)){let h=r(a.id)?.sizeBytes;u.push({id:a.id,kind:"document",name:a.filename??a.id,size:"",src:"",mime:a.mime??"",...h===void 0?{}:{sizeBytes:h}})}let d=[["avatar_upload_id","headshot"],["logo_dark_upload_id","logo (dark)"],["logo_light_upload_id","logo (light)"]];for(let a of A(n.contacts)){let h=typeof a.name=="string"?a.name:"Contact";for(let[v,P]of d){let S=a[v];typeof S=="string"&&u.push({id:S,kind:"library",name:`${h} \u2014 ${P}`,size:"",src:o(r(S)),caption:h})}}return u}var At={image:["photo_id","asset_id"],video:["video_id","asset_id"],tour:["tour_id","asset_id"],document:["asset_id"]};function Ht(e){return e.filter(t=>typeof t=="object"&&t!==null&&!Array.isArray(t)).map(({id:t,upload_id:n,floor_label:r,position:o})=>({id:typeof t=="string"?t:"",...typeof n=="string"?{upload_id:n}:{},floor_label:typeof r=="string"?r:null,position:typeof o=="number"?o:0}))}function oe(e,t){if(t==null)return t;let n=At[e.type];if(n!==void 0){if(typeof t!="object")return null;let o=t,s=n.map(a=>o[a]).find(a=>typeof a=="string"&&a!=="");if(typeof s!="string")return null;if(e.type!=="image")return{asset_id:s};let u=F(o.rect),d=typeof o.mobile=="object"&&o.mobile!==null?F(o.mobile.rect):null;return{asset_id:s,...u===null?{}:{rect:u},...d===null?{}:{mobile_rect:d}}}if(e.type!=="list"||!Array.isArray(t))return t;let r=t;if(e.fields!==void 0){let o=e.fields;return r.map(s=>{if(typeof s!="object"||s===null)return s;let u={...s};for(let[d,a]of Object.entries(o))d in u&&(u[d]=a.type==="image"&&Array.isArray(u[d])?Ht(u[d]):oe(a,u[d]));return u})}if(e.element!==void 0){let o=e.element;return r.map(s=>oe(o,s))}return r}function Le(e){let{instance:t,slots:n,fixture:r,session:o,assetUrl:s}=e,u={...t.slots},d={},a=r.provenance[t.instance_id]??{};for(let v of Object.keys(n))d[v]=a[v]??{kind:"empty"};for(let[v,P]of Object.entries(o??{})){let S=n[v];S!==void 0&&(u[v]=oe(S,P),d[v]={kind:"session"})}let h=new Map(Object.entries(r.media));return{slots:De({...t,slots:u},{schema:{slots:n}},h,$t(s)),provenance:d}}var je=1024*1024;function Nt(e){let t=O(e),n=typeof e.width=="string"?`${e.width} \xD7 ${String(e.height)}`:void 0;return{id:e.id,label:e.label,cssWidth:t.viewportWidth,cssHeight:t.viewportHeight,bleed:t.bleed,pixelWidth:t.pixelWidth,pixelHeight:t.pixelHeight,...n===void 0?{}:{physical:n},tokens:{...N(e)}}}function Mt(e,t){return new Response(t,{status:e,headers:{"content-type":"text/plain; charset=utf-8"}})}function ie(e){return new Response(JSON.stringify(e),{headers:{"content-type":"application/json; charset=utf-8"}})}function ae(e){return new Response(e,{headers:{"content-type":"text/html; charset=utf-8"}})}function Dt(e){if(typeof e!="object"||e===null)return null;let t=e.status;return typeof t=="number"&&Number.isInteger(t)&&t>=400&&t<600?t:null}function U(e,t,n){let r=e.searchParams.get(t);if(r===null||r==="")throw new g(400,`${n} needs a ${t} parameter.`);return r}function Ft(e){return`<script>
|
|
116
|
+
</script>`;function ye(){let e={};return new Proxy(e,{get:(t,n)=>typeof n!="string"||n in e||n==="then"||n==="toJSON"?e[n]:`#${n}`})}function ge(e){let t=new URLSearchParams;for(let[r,o]of Object.entries(e))o!=null&&o!==""&&t.set(r,o);let n=t.toString();return n===""?"":`?${n}`}var T={catalog:"api/catalog",render:"api/render",media:e=>`api/media${ge({fixture:e})}`,capture:(e,t)=>`api/capture/${e}${ge({fixture:t.fixture,format:t.format,page:t.page,canvas:t.canvas})}`,live:(e,t)=>`fixtures/${encodeURIComponent(e)}/live${t==="/"?"/":`${t}/`}`,hmr:"__hmr"};var y=class extends Error{constructor(n,r){super(r);this.status=n}status};function at(e){return e.split("-").map(t=>t&&t[0].toUpperCase()+t.slice(1)).join(" ")}function he(e){let{variant:t}=e;return{required:e.required,variant:t===null?null:{cases:t.cases.map(n=>({value:n,label:at(n)})),locked:t.locked}}}function _e(e){return Object.fromEntries(e.map(t=>[t.instance_id,{enabled:t.enabled,...t.variant===void 0?{}:{variant:t.variant}}]))}function be(e){if(e==null)return{};if(typeof e!="object"||Array.isArray(e))throw new y(400,"A render request's display is an object keyed by instance id.");let t={};for(let[n,r]of Object.entries(e)){if(typeof r!="object"||r===null||Array.isArray(r))throw new y(400,`The display state of "${n}" is not an object.`);let{enabled:o,variant:l}=r;if(o!==void 0&&typeof o!="boolean")throw new y(400,`The display state of "${n}" has a non-boolean enabled.`);if(l!==void 0&&typeof l!="string")throw new y(400,`The display state of "${n}" has a non-string variant.`);t[n]={...o===void 0?{}:{enabled:o},...l===void 0?{}:{variant:l}}}return t}function ve(e,t){for(let[n,r]of Object.entries(t)){let o=e.instances.find(u=>u.instanceId===n);if(o===void 0)throw new y(400,`The composition places no instance "${n}".`);if(r.enabled===!1&&o.display.required)throw new y(400,`Section instance "${n}" is required and cannot be hidden.`);if(r.variant===void 0)continue;let l=o.display.variant;if(l===null)throw new y(400,`Section instance "${n}" declares no display variant.`);if(l.locked)throw new y(400,`Section instance "${n}" declares a locked variant, which the user cannot switch.`);if(!l.cases.includes(r.variant))throw new y(400,`"${r.variant}" is not a declared case of section instance "${n}" (declared: ${l.cases.join(", ")}).`)}}function we(e,t){return new Map(e.instances.map(n=>[n.instance_id,t[n.instance_id]?.enabled??n.enabled]))}function xe(e,t,n){let r=n[e.instance_id]?.variant;if(r===void 0||r===e.variant)return e;let o={...e.slots};for(let[l,u]of Object.entries(t))l in o||(u.variant===void 0||u.variant.cases.includes(r))&&(o[l]=u.type==="list"?[]:null);return{...e,variant:r,slots:o}}function Re(e){return Array.isArray(e)?e.length:0}function Se(e){return typeof e=="string"&&e!==""?e:null}function st(e){return{propertyType:Se(e.property_type),listingIntent:Se(e.listing_intent),units:Re(e.units),photos:Re(e.photos)}}function lt(e){let t=JSON.stringify(e),n=3735928559,r=1103547991;for(let o=0;o<t.length;o++){let l=t.charCodeAt(o);n=Math.imul(n^l,2654435761),r=Math.imul(r^l,1597334677)}return n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&r)+(n>>>0)).toString(16).padStart(14,"0")}function ke(e){return{id:e.id,label:e.label,summary:st(e.facts),doc:lt(e.instances),display:_e(e.instances)}}function Ie(e,t){let n=e.replace(/\/+$/,"");return t==="/"?`${n}/`:`${n}${t}/`}function Pe(e){let{pages:t,currentPageId:n,basePath:r}=e,o=t.find(d=>d.id===n);if(!o)throw new Error(`nav: page "${n}" is not one of the declared pages (${t.map(d=>d.id).join(", ")}).`);let l=[o,...t.filter(d=>d.id!==o.id&&d.enabled!==!1)],u={};for(let d of l)for(let a of d.sections)a.enabled===!1||a.key in u||(u[a.key]=d.id===o.id?`#${a.anchor}`:`${Ie(r,d.path)}#${a.anchor}`);return{anchors:u,pages:t.filter(d=>d.enabled!==!1).map(d=>({id:d.id,label:d.label,href:Ie(r,d.path),current:d.id===o.id}))}}function W(e,t){return e.pages?.[t]?.enabled!==!1}function te(e,t){return t.filter(n=>W(e,n.id))}var D={base:"stylesheets/base.css",template:"stylesheets/template.css"},k={frame:"__capture/frame",print:"__capture/print"};function Ee(e){return new URLSearchParams(e).toString()}function ne(e,t,n){return`${k.frame}?${Ee({fixture:e,page:t,format:n})}`}function Te(e,t){return`${k.print}?${Ee({fixture:e,format:t})}`}var ct=["text","number","select","image","list","poi","url","video","tour","document"],dt=[],wn=[...ct,...dt];var ut=["address","type","intent","describe","uploads","units","comparables","contacts"];var pt={address:"always",type:"always",intent:"always",describe:"always",uploads:"always",units:"derived",comparables:"derived",contacts:"derived"},xn=ut.filter(e=>pt[e]==="always");var mt={matterport:{kind:"tour",label:"Matterport",pattern:/(^|\.)matterport\.com$/i,strategy:"api"},biganto:{kind:"tour",label:"Biganto",pattern:/(^|\.)biganto\.com$/i,strategy:"opengraph"},youtube:{kind:"video",label:"YouTube",pattern:/(^|\.)(youtube\.com|youtu\.be)$/i,strategy:"oembed"},vimeo:{kind:"video",label:"Vimeo",pattern:/(^|\.)vimeo\.com$/i,strategy:"oembed"},zillow:{kind:"listing",label:"Zillow",pattern:/(^|\.)zillow\.com$/i,strategy:"none"},redfin:{kind:"listing",label:"Redfin",pattern:/(^|\.)redfin\.com$/i,strategy:"none"},dropbox:{kind:"file",label:"Dropbox",pattern:/(^|\.)dropbox\.com$/i,strategy:"none"},drive:{kind:"file",label:"Google Drive",pattern:/^drive\.google\.com$/i,strategy:"none"},maps:{kind:"map",label:"Google Maps",pattern:/(^|\.)google\.com$/i,path:/^\/maps(\/|$)/i,strategy:"none"}};function $e(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!=="http:"&&t.protocol!=="https:")return null;for(let[n,r]of Object.entries(mt))if(r.pattern.test(t.hostname)&&!(r.path&&!r.path.test(t.pathname)))return n;return null}var ft="badge=0&autopause=0&player_id=0&title=0&byline=0&portrait=0&sidedock=0&vimeo_logo=0&pip=0&chromecast=0&quality_selector=0&progress_bar=1";function Ce(e){let t=e.trim();if(!t)return null;let n=$e(t);if(n==="vimeo"){let r=t.match(/vimeo\.com\/(?:.*\/)?(\d+)/);return r?`https://player.vimeo.com/video/${r[1]}?${ft}`:null}if(n==="youtube"){let r=t.match(/youtu\.be\/([A-Za-z0-9_-]{11})/)??t.match(/[?&]v=([A-Za-z0-9_-]{11})/)??t.match(/youtube\.com\/(?:embed|shorts)\/([A-Za-z0-9_-]{11})/);return r?`https://www.youtube.com/embed/${r[1]}?rel=0`:null}return null}function Ae(e){let t=e.trim();if(!t)return null;let n=$e(t);if(n==="matterport"){let r=new URL(t).searchParams.get("m");return r!==null&&/^[A-Za-z0-9]+$/.test(r)?`https://my.matterport.com/show/?m=${r}&nt=1`:null}return n==="biganto"?t:null}var V=e=>e<0?0:e>1?1:e;function F(e){if(typeof e!="object"||e===null)return null;let{nx:t=0,ny:n=0,nw:r=1,nh:o=1}=e;if(![t,n,r,o].every(a=>typeof a=="number"&&Number.isFinite(a)))return null;let l=V(t),u=V(n),d={nx:l,ny:u,nw:Math.min(V(r),1-l),nh:Math.min(V(o),1-u)};return d.nw<=0||d.nh<=0||d.nx===0&&d.ny===0&&d.nw===1&&d.nh===1?null:d}var z={file(e){return typeof e=="string"?{url:e,responsive:null}:{url:e.url,responsive:e.responsive}}};function yt(e){if(typeof e!="object"||e===null)return null;let t=e.asset_id;return typeof t=="string"&&t!==""?t:null}function gt(e,t,n){if(e.file===null)return null;let r=n.crop===void 0?null:F(t.rect),o=n.crop===void 0?null:F(t.mobile_rect),l=n.file(e.file),u=r===null?{photo_id:e.id,url:l.url,alt:e.alt,responsive:l.responsive}:{photo_id:e.id,url:n.crop(e.file,r),alt:e.alt,responsive:null,rect:r};return o!==null&&(u.mobile={url:n.crop(e.file,o),responsive:null}),u}function He(e,t){if(e.posterFile!==void 0){let n=t.file(e.posterFile);return n.responsive===null?{poster:n.url}:{poster:n.url,poster_responsive:n.responsive}}return{poster:e.posterUrl??""}}function ht(e,t){let n=He(e,t);return e.file===null?{video_id:e.id,url:Ce(e.url??"")??"",...n,alt:e.alt,source:"link",...e.provider===null?{}:{provider:e.provider}}:{video_id:e.id,url:t.file(e.file).url,...n,alt:e.alt,source:"upload"}}function _t(e,t){return{tour_id:e.id,url:Ae(e.url??"")??"",...He(e,t),alt:e.alt,...e.provider===null?{}:{provider:e.provider}}}function bt(e,t){return e.file===null?null:{asset_id:e.id,url:t.file(e.file).url,filename:e.filename,content_type:e.mime,size_bytes:0}}function vt(e,t,n,r){let o=yt(t),l=o===null?void 0:n.get(o);if(l===void 0||l.kind!==e)return null;switch(e){case"image":return gt(l,t,r);case"video":return ht(l,r);case"tour":return _t(l,r);case"document":return bt(l,r);default:return null}}var wt=new Set(["image","video","tour","document"]),xt=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function Rt(e,t,n){let r=typeof e.id=="string"?e.id:"",o=typeof e.floor_label=="string"?e.floor_label:null,l=r===""?void 0:t.get(r),u=l?.kind==="image"&&l.file!==null?n.file(l.file):null;return{id:r,...typeof e.upload_id=="string"?{upload_id:e.upload_id}:{},url:u?.url??"",alt:o??"Floor plan",floor_label:o,position:typeof e.position=="number"?e.position:0,...u?.responsive?{responsive:u.responsive}:{}}}function St(e,t,n,r){return e.type==="image"&&Array.isArray(t)?t.filter(xt).map(o=>Rt(o,n,r)):re(e,t,n,r)}function re(e,t,n,r){if(t==null)return t;if(wt.has(e.type))return vt(e.type,t,n,r);if(e.type!=="list"||!Array.isArray(t))return t;let o=t;if(e.fields!==void 0){let l=e.fields;return o.map(u=>{if(typeof u!="object"||u===null)return u;let d={...u};for(let[a,h]of Object.entries(l))d[a]=St(h,d[a],n,r);return d})}if(e.element!==void 0){let l=e.element;return o.map(u=>re(l,u,n,r))}return o}function Ne(e,t,n,r=z){let o={};for(let[l,u]of Object.entries(e.slots)){let d=t.schema.slots[l];o[l]=d===void 0?u:re(d,u,n,r)}return o}function Oe(e){return typeof e=="string"?e:e.url}function kt(e,t){return e.split(",").map(n=>{let[r="",...o]=n.trim().split(/\s+/);return[t(r),...o].join(" ")}).join(", ")}function It(e){return{file(t){let n=z.file(t),r=n.responsive===null?null:{...n.responsive,sources:n.responsive.sources.map(o=>({...o,srcset:kt(o.srcset,e)}))};return{url:e(n.url),responsive:r}},crop(t,n){return e(z.file(t).url,{crop:n})}}}function A(e){return Array.isArray(e)?e:[]}function Me(e,t){let{facts:n}=e,r=a=>e.media[a],o=a=>a?.file===null||a?.file===void 0?"":t(Oe(a.file)),l=a=>a?.posterFile!==void 0?t(Oe(a.posterFile)):a?.posterUrl??"",u=[];for(let a of A(n.photos)){let h=r(a.id);u.push({id:a.id,kind:"photo",name:h?.filename||a.id,size:"",src:o(h),caption:a.caption??null})}for(let a of A(n.floor_plans)){let h=r(a.id);u.push({id:a.id,kind:"plan",name:h?.filename||a.id,size:"",src:o(h)})}for(let a of A(n.videos)){let h=a.provider??void 0;u.push({id:a.id,kind:"video",name:a.caption??r(a.id)?.filename??a.id,size:"",src:l(r(a.id)),caption:a.caption??null,ready:!0,durationMs:a.duration_ms??null,...h===void 0?{}:{provider:h}})}for(let a of A(n.tours))u.push({id:a.id,kind:"tour",name:`${a.provider??"Tour"} ${a.id}`,size:"",src:l(r(a.id)),ready:!0,provider:a.provider??""});for(let a of A(n.documents)){let h=r(a.id)?.sizeBytes;u.push({id:a.id,kind:"document",name:a.filename??a.id,size:"",src:"",mime:a.mime??"",...h===void 0?{}:{sizeBytes:h}})}let d=[["avatar_upload_id","headshot"],["logo_dark_upload_id","logo (dark)"],["logo_light_upload_id","logo (light)"]];for(let a of A(n.contacts)){let h=typeof a.name=="string"?a.name:"Contact";for(let[v,E]of d){let S=a[v];typeof S=="string"&&u.push({id:S,kind:"library",name:`${h} \u2014 ${E}`,size:"",src:o(r(S)),caption:h})}}return u}var Pt={image:["photo_id","asset_id"],video:["video_id","asset_id"],tour:["tour_id","asset_id"],document:["asset_id"]};function Et(e){return e.filter(t=>typeof t=="object"&&t!==null&&!Array.isArray(t)).map(({id:t,upload_id:n,floor_label:r,position:o})=>({id:typeof t=="string"?t:"",...typeof n=="string"?{upload_id:n}:{},floor_label:typeof r=="string"?r:null,position:typeof o=="number"?o:0}))}function oe(e,t){if(t==null)return t;let n=Pt[e.type];if(n!==void 0){if(typeof t!="object")return null;let o=t,l=n.map(a=>o[a]).find(a=>typeof a=="string"&&a!=="");if(typeof l!="string")return null;if(e.type!=="image")return{asset_id:l};let u=F(o.rect),d=typeof o.mobile=="object"&&o.mobile!==null?F(o.mobile.rect):null;return{asset_id:l,...u===null?{}:{rect:u},...d===null?{}:{mobile_rect:d}}}if(e.type!=="list"||!Array.isArray(t))return t;let r=t;if(e.fields!==void 0){let o=e.fields;return r.map(l=>{if(typeof l!="object"||l===null)return l;let u={...l};for(let[d,a]of Object.entries(o))d in u&&(u[d]=a.type==="image"&&Array.isArray(u[d])?Et(u[d]):oe(a,u[d]));return u})}if(e.element!==void 0){let o=e.element;return r.map(l=>oe(o,l))}return r}function De(e){let{instance:t,slots:n,fixture:r,session:o,assetUrl:l}=e,u={...t.slots},d={},a=r.provenance[t.instance_id]??{};for(let v of Object.keys(n))d[v]=a[v]??{kind:"empty"};for(let[v,E]of Object.entries(o??{})){let S=n[v];S!==void 0&&(u[v]=oe(S,E),d[v]={kind:"session"})}let h=new Map(Object.entries(r.media));return{slots:Ne({...t,slots:u},{schema:{slots:n}},h,It(l)),provenance:d}}var Fe=1024*1024;function $t(e){let t=N(e),n=typeof e.width=="string"?`${e.width} \xD7 ${String(e.height)}`:void 0;return{id:e.id,label:e.label,cssWidth:t.viewportWidth,cssHeight:t.viewportHeight,bleed:t.bleed,pixelWidth:t.pixelWidth,pixelHeight:t.pixelHeight,...n===void 0?{}:{physical:n},tokens:{...O(e)}}}function Ct(e,t){return new Response(t,{status:e,headers:{"content-type":"text/plain; charset=utf-8"}})}function ie(e){return new Response(JSON.stringify(e),{headers:{"content-type":"application/json; charset=utf-8"}})}function ae(e){return new Response(e,{headers:{"content-type":"text/html; charset=utf-8"}})}function At(e){if(typeof e!="object"||e===null)return null;let t=e.status;return typeof t=="number"&&Number.isInteger(t)&&t>=400&&t<600?t:null}function U(e,t,n){let r=e.searchParams.get(t);if(r===null||r==="")throw new y(400,`${n} needs a ${t} parameter.`);return r}function Ht(e){return`<script>
|
|
117
117
|
(function () {
|
|
118
118
|
try {
|
|
119
119
|
var src = new EventSource(${JSON.stringify(e)});
|
|
@@ -122,6 +122,6 @@ ${e.body}
|
|
|
122
122
|
});
|
|
123
123
|
} catch (e) { /* no change channel; the page stays as it is */ }
|
|
124
124
|
})();
|
|
125
|
-
</script>`}function
|
|
126
|
-
${c.problems}`:void 0;return{...
|
|
127
|
-
`)},islands:(await t.islands()).documentLoader,stylesheets:{kind:"links",hrefs:u()},title:`${i.name} - ${c.label}`,extraCss:["html, body { background: #fff; }"],...t.live?{devScripts:[
|
|
125
|
+
</script>`}function Nt(e){if(e===T.catalog||e==="api/media"||e.startsWith("api/capture/")||e===k.frame||e===k.print)return!0;let[t,n,r]=e.split("/").filter(Boolean);return t==="fixtures"&&n!==void 0&&r==="live"}function Un(e){let{reader:t,assetUrl:n,renderer:r}=e,o=(e.base??"/").endsWith("/")?e.base??"/":`${e.base??"/"}/`,l=p=>/^([a-z][a-z0-9+.-]*:|\/)/i.test(p)?p:`${o}${p}`,u=()=>[D.base,D.template].map(p=>l(n(p)));async function d(p){let{fixtures:s}=await t.fixtures(),i=s.find(c=>c.id===p);if(i===void 0){let c=s.map(f=>f.id).join(", ")||"none";throw new y(404,`There is no fixture "${p}" (have: ${c}).`)}return i}function a(p,s){let i=p.instances.find(c=>c.instance_id===s);if(i===void 0)throw new y(400,`The composition places no instance "${s}".`);return i}function h(p,s,i,c,f){if(p.output!=="website")return{selfAnchor:c,anchors:ye(),pages:[]};let m=we(s,f),_=p.pages.map(R=>({id:R.id,label:R.label,path:R.path??`/${R.id}`,sections:R.sections.map(I=>({key:I.section,anchor:I.section,enabled:m.get(I.instanceId)!==!1}))})),b=`${o}${T.live(s.id,"/").replace(/\/$/,"")}`,w=Pe({pages:_,currentPageId:i,basePath:b});return{selfAnchor:c,anchors:w.anchors,pages:w.pages}}async function v(p,s,i,c,f,m){let _=p.instances.find(X=>X.instanceId===c.instance_id);if(_===void 0)throw new Error(`The composition places no section "${c.section_key}".`);let b=xe(c,_.sectionSchema.slots,m),{slots:w,provenance:R}=De({instance:b,slots:_.sectionSchema.slots,fixture:s,session:f,assetUrl:n}),I=h(p,s,i,b.section_key,m),x=b.variant,H=await r.section(b.section_key);return{html:r.renderToString(r.createElement(H,{slots:w,nav:I,variant:x??""}),{identifierPrefix:b.instance_id}),resolvedProps:{slots:w,nav:I,variant:x},provenance:R}}async function E(p,s,i){let c=[];for(let f of i.sections){let m=a(s,f.instanceId);m.enabled&&c.push((await v(p,s,i.id,m,void 0,{})).html)}return c}function S(p,s,i){let c=p.pages.find(f=>f.id===s);if(c===void 0)throw new y(i,`The template declares no page "${s}".`);return c}function G(p,s){if(p.output==="website")throw new y(404,`"${p.key}" is a website \u2014 captures are for rendered templates; open its pages live instead.`);let i=s===null?p.formats[0]:p.formats.find(c=>c.id===s);if(i===void 0)throw new y(404,`The template declares no format "${s??""}" (have: ${p.formats.map(c=>c.id).join(", ")}).`);return i}async function Ue(){let p=await t.islands(),s={wire:1,islands:{map:{...p.map},hostScript:p.canvasHost,importMap:{...p.importMap}},stylesheets:[D.base,D.template].map(m=>n(m))},i,c;try{i=await t.template(),c=await t.fixtures()}catch(m){return{...s,template:{key:"",name:"",output:"website",formats:[],pages:[],canvases:[],instances:[]},fixtures:[],capabilities:{hmr:t.live,capture:!1},error:m instanceof Error?m.message:String(m)}}let f=c.problems!==void 0&&c.fixtures.length===0?`No fixture could be rendered:
|
|
126
|
+
${c.problems}`:void 0;return{...s,template:{key:i.key,name:i.name,output:i.output,formats:i.output==="website"?[]:i.formats.map($t),pages:i.pages.map(m=>({id:m.id,label:m.label,...m.path===void 0?{}:{path:m.path},instanceIds:m.sections.map(_=>_.instanceId)})),canvases:i.canvases.map(m=>({id:m.id,label:m.label,pages:[...m.pages]})),instances:i.instances.map(m=>({...m,display:he(m.display)}))},fixtures:c.fixtures.map(ke),capabilities:{hmr:t.live,capture:i.output!=="website"&&t.capture!==void 0},...f===void 0?{}:{error:f}}}async function Le(p){if(p.method!=="POST")throw new y(405,`POST a render request to ${T.render}.`);let s=await p.text();if(new TextEncoder().encode(s).byteLength>Fe)throw new y(413,`request body exceeds ${Fe} bytes`);let i;try{i=s===""?void 0:JSON.parse(s)}catch(w){throw new y(400,`request body is not JSON: ${w instanceof Error?w.message:String(w)}`)}if(i===void 0||typeof i.page!="string"||typeof i.instance!="string"||typeof i.fixture!="string")throw new y(400,"A render request names a page, an instance and a fixture.");let c=typeof i.session=="object"&&i.session!==null?i.session:{},f=be(i.display),m=await t.template(),_=await d(i.fixture),b=S(m,i.page,400);return ve(m,f),v(m,_,b.id,a(_,i.instance),c.slots,f)}async function je(p){let s=await d(U(p,"fixture","api/media"));return{items:Me(s,n)}}async function qe(p,s){let i=await t.template();if(i.output!=="website")throw new y(404,`"${i.key}" is a rendered ${i.output} template and has no live pages \u2014 preview it on the canvas.`);let c=i.pages.find(_=>_.path===s);if(c===void 0){let _=i.pages.map(b=>b.path??b.id).join(", ");throw new y(404,`The template declares no page at "${s}" (have: ${_}).`)}let f=await d(p),m=await E(i,f,c);return C({destination:"preview",root:{kind:"plain",bodyHtml:m.join(`
|
|
127
|
+
`)},islands:(await t.islands()).documentLoader,stylesheets:{kind:"links",hrefs:u()},title:`${i.name} - ${c.label}`,extraCss:["html, body { background: #fff; }"],...t.live?{devScripts:[Ht(`${o}${T.hmr}`)]}:{}})}function se(p,s,i){let c=S(p,i,404);if(!W(s,c.id))throw new y(404,`The fixture "${s.id}" switches the page "${c.id}" off, so it has no capture.`);return c}async function We(p){let s=k.frame,i=await t.template(),c=G(i,p.searchParams.get("format")),f=await d(U(p,"fixture",s)),m=se(i,f,U(p,"page",s));return C({destination:"artifact",root:{kind:"frame",format:c,sectionHtml:await E(i,f,m)},islands:(await t.islands()).documentLoader,stylesheets:{kind:"links",hrefs:u()},title:`${i.name} \u2014 ${m.id}`})}async function Ve(p){let s=await t.template(),i=G(s,p.searchParams.get("format"));if(s.output!=="document")throw new y(404,`"${s.key}" is an ${s.output} template \u2014 a PDF is for the document class; download its pages as a zip.`);let c=await d(U(p,"fixture",k.print)),f=[];for(let m of te(c,s.pages))f.push(await E(s,c,m));if(f.length===0)throw new y(404,`The fixture "${c.id}" switches every page off, so it has no PDF.`);return C({destination:"artifact",root:{kind:"frameStack",format:i,pages:f},islands:(await t.islands()).documentLoader,stylesheets:{kind:"links",hrefs:u()},title:`${s.name} \u2014 print`})}async function ze(p,s){let i=p;if(i!=="screenshot"&&i!=="bundle"&&i!=="print")throw new y(404,`There is no capture at ${s.pathname}.`);let c=U(s,"fixture",`api/capture/${i}`),f=await t.template(),m=G(f,s.searchParams.get("format")),_=await d(c),b,w,R;if(i==="screenshot"){let x=s.searchParams.get("page")??te(_,f.pages)[0]?.id;if(x===void 0)throw new y(404,`The fixture "${c}" leaves no page on.`);se(f,_,x),b={kind:i,fixture:c,format:m,documents:[{path:ne(c,x,m.id),page:x,name:`${x}.png`}]},w="image/png",R=`${f.key}-${x}-${m.id}.png`}else if(i==="bundle"){if(f.output!=="image")throw new y(404,`"${f.key}" is a ${f.output} template \u2014 the zip is for the image class; a document downloads its PDF.`);let x=s.searchParams.get("canvas"),H=x===null?f.canvases[0]:f.canvases.find(P=>P.id===x);if(H===void 0)throw new y(404,`The template declares no canvas "${x??""}".`);let B=H.pages.filter(P=>W(_,P));if(B.length===0)throw new y(404,`The fixture "${c}" switches every page of the canvas "${H.id}" off, so it has no zip.`);let X=B.map(P=>({path:ne(c,P,m.id),page:P,name:`${f.pages.find(Be=>Be.id===P)?.label||P}.png`}));b={kind:i,fixture:c,format:m,documents:X},w="application/zip",R=`${f.key}-${m.id}.zip`}else{if(f.output!=="document")throw new y(404,`"${f.key}" is an ${f.output} template \u2014 a PDF is for the document class; download its pages as a zip.`);b={kind:i,fixture:c,format:m,documents:[{path:Te(c,m.id),page:null,name:`${f.key}.pdf`}]},w="application/pdf",R=`${f.key}.pdf`}if(t.capture===void 0)throw new y(501,"This playground has no captures to give.");let I=await t.capture(b);return new Response(new Uint8Array(I),{headers:{"content-type":w,"content-disposition":`attachment; filename="${encodeURIComponent(R)}"`}})}async function Ge(p,s,i){if(i===T.render)return ie(await Le(p));if(p.method!=="GET"&&p.method!=="HEAD"&&Nt(i))throw new y(405,`${i} only reads; the playground accepts no uploads and writes nothing.`);if(i===T.catalog)return ie(await Ue());if(i==="api/media")return ie(await je(s));if(i.startsWith("api/capture/"))return ze(i.slice(12),s);if(i===k.frame)return ae(await We(s));if(i===k.print)return ae(await Ve(s));let[c,f,m,_,...b]=i.split("/").filter(Boolean);if(c==="fixtures"&&f!==void 0&&m==="live"){if(b.length>0)throw new y(404,`There is no route at ${s.pathname}.`);return ae(await qe(decodeURIComponent(f),_===void 0?"/":`/${decodeURIComponent(_)}`))}return null}return{async handle(p){let s=new URL(p.url);if(!s.pathname.startsWith(o)&&`${s.pathname}/`!==o)return null;let i=s.pathname.slice(o.length);try{return await Ge(p,s,i)}catch(c){let f=At(c);if(f===null)throw c;return Ct(f,c instanceof Error?c.message:String(c))}}}}export{Un as createHost};
|
package/dist/base.css
CHANGED
|
@@ -105,11 +105,6 @@
|
|
|
105
105
|
* belongs at that derivation point and nowhere else. The private custom properties
|
|
106
106
|
* and counters below ARE concrete's.
|
|
107
107
|
*
|
|
108
|
-
* `.tr-frame` is its pre-4.0.0 spelling, styled alongside for a transition window
|
|
109
|
-
* only: a template built on this version can be captured by a platform that still
|
|
110
|
-
* stamps the old class. `:is()` keeps the specificity of a single class. It goes
|
|
111
|
-
* when every capture surface stamps the new class alone.
|
|
112
|
-
*
|
|
113
108
|
* The frame is a viewport: every host owes a frame document a window that is exactly the
|
|
114
109
|
* format's BLEED box, and the root fills it — viewport units and geometry @media in
|
|
115
110
|
* sections read the window and get frame geometry by construction. No size
|
|
@@ -121,7 +116,7 @@
|
|
|
121
116
|
* against a box identical to the one it would otherwise use (the root fills the
|
|
122
117
|
* window exactly), so it moves no author content; what it buys is a stacked print
|
|
123
118
|
* document, where each shell then anchors its own witness on its own sheet. */
|
|
124
|
-
|
|
119
|
+
.concrete-frame {
|
|
125
120
|
position: relative;
|
|
126
121
|
width: 100vw;
|
|
127
122
|
height: 100vh;
|
|
@@ -164,7 +159,7 @@
|
|
|
164
159
|
* pixels and identical layout to one with no witness at all. On a mismatch it covers
|
|
165
160
|
* the artifact and names both geometries, because a frame measured against the wrong
|
|
166
161
|
* box is not a preview of anything and must not read as one. */
|
|
167
|
-
|
|
162
|
+
.concrete-frame::after {
|
|
168
163
|
counter-reset:
|
|
169
164
|
concrete-frame-owed-w calc(var(--concrete-frame-window-w) / 1px)
|
|
170
165
|
concrete-frame-owed-h calc(var(--concrete-frame-window-h) / 1px)
|
|
@@ -192,7 +187,7 @@
|
|
|
192
187
|
/* Imposed from OUTSIDE <Section>, which stays byte-identical across output classes:
|
|
193
188
|
* without it flexbox would compress an overflowing stack to fit, hiding the overflow
|
|
194
189
|
* the author must be able to see. */
|
|
195
|
-
|
|
190
|
+
.concrete-frame > * {
|
|
196
191
|
flex-shrink: 0;
|
|
197
192
|
}
|
|
198
193
|
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
//#region src/browser/site-config.ts
|
|
2
|
-
const LEGACY_SITE_CONFIG_ID = "tr-site-config";
|
|
3
|
-
/** Read the per-site config a published page embeds as `#concrete-site-config`. Null when absent or incomplete. */
|
|
4
2
|
function readSiteConfig() {
|
|
5
|
-
const el = document.getElementById("concrete-site-config")
|
|
3
|
+
const el = document.getElementById("concrete-site-config");
|
|
6
4
|
if (!el?.textContent) return null;
|
|
7
5
|
try {
|
|
8
6
|
const config = JSON.parse(el.textContent);
|
|
@@ -12,14 +10,6 @@ function readSiteConfig() {
|
|
|
12
10
|
return null;
|
|
13
11
|
}
|
|
14
12
|
}
|
|
15
|
-
/**
|
|
16
|
-
* Decode hex to bytes. Always ArrayBuffer-backed (never SharedArrayBuffer), so the
|
|
17
|
-
* result satisfies the BufferSource parameter of crypto.subtle.importKey — but that
|
|
18
|
-
* generic stays out of this public signature: on TypeScript < 5.7, `Uint8Array` isn't
|
|
19
|
-
* generic at all, and writing `Uint8Array<ArrayBuffer>` here would fail every
|
|
20
|
-
* consumer's build below that floor (TS2315) for a detail only this module's own
|
|
21
|
-
* `crypto.subtle.importKey` call needs.
|
|
22
|
-
*/
|
|
23
13
|
function hexToBytes(hex) {
|
|
24
14
|
if (hex.length % 2 !== 0) throw new Error("hexToBytes: odd-length hex string");
|
|
25
15
|
if (!/^[0-9a-fA-F]*$/.test(hex)) throw new Error("hexToBytes: invalid hex string");
|
|
@@ -30,7 +20,6 @@ function hexToBytes(hex) {
|
|
|
30
20
|
function bytesToHex(buf) {
|
|
31
21
|
return Array.from(new Uint8Array(buf)).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
32
22
|
}
|
|
33
|
-
/** HMAC-SHA256 a message with a hex-encoded secret, returning the signature as lowercase hex. */
|
|
34
23
|
async function hmacHex(secretHex, message) {
|
|
35
24
|
const key = await crypto.subtle.importKey("raw", hexToBytes(secretHex), {
|
|
36
25
|
name: "HMAC",
|
|
@@ -38,10 +27,6 @@ async function hmacHex(secretHex, message) {
|
|
|
38
27
|
}, false, ["sign"]);
|
|
39
28
|
return bytesToHex(await crypto.subtle.sign("HMAC", key, new TextEncoder().encode(message)));
|
|
40
29
|
}
|
|
41
|
-
/**
|
|
42
|
-
* The signed header set every ingest request carries:
|
|
43
|
-
* `X-Signature` = hex(hmac_sha256(siteSecret, `${unixSeconds}.${body}`)).
|
|
44
|
-
*/
|
|
45
30
|
async function signedIngestHeaders(config, body) {
|
|
46
31
|
const ts = Math.floor(Date.now() / 1e3).toString();
|
|
47
32
|
const signature = await hmacHex(config.siteSecret, `${ts}.${body}`);
|
|
@@ -8,20 +8,9 @@ const UTM_KEYS = [
|
|
|
8
8
|
];
|
|
9
9
|
const UTM_MAX_LENGTH = 128;
|
|
10
10
|
const INGEST_PATH = "/leads/ingest";
|
|
11
|
-
/** Ingest replies 413 above this; failing locally gives the caller a usable reason. */
|
|
12
11
|
const MAX_BODY_BYTES = 16 * 1024;
|
|
13
12
|
const RETRY_BACKOFF_MS = [300, 1200];
|
|
14
|
-
/**
|
|
15
|
-
* The event {@link submitLead} dispatches on `window` once a lead is accepted — not
|
|
16
|
-
* on a failure, and not on a simulated submission. The event's detail is a
|
|
17
|
-
* {@link LeadEventDetail}. It is how a published page's connected integrations
|
|
18
|
-
* learn that a lead was captured; a template never dispatches it itself.
|
|
19
|
-
*/
|
|
20
13
|
const LEAD_EVENT = "homepages:lead";
|
|
21
|
-
/**
|
|
22
|
-
* Read attribution from a referrer, a query string, and the current URL.
|
|
23
|
-
* Exported for testing and for callers assembling a `source` override by hand.
|
|
24
|
-
*/
|
|
25
14
|
function captureSource(referrer, search, href) {
|
|
26
15
|
const source = {
|
|
27
16
|
referrer: "",
|
|
@@ -39,11 +28,6 @@ function captureSource(referrer, search, href) {
|
|
|
39
28
|
} catch {}
|
|
40
29
|
return source;
|
|
41
30
|
}
|
|
42
|
-
/**
|
|
43
|
-
* Serialize the ingest request body. The returned string is signed AND sent
|
|
44
|
-
* verbatim — the signature covers these exact bytes, so it must never be
|
|
45
|
-
* re-serialized between signing and sending.
|
|
46
|
-
*/
|
|
47
31
|
function buildLeadBody(input, source) {
|
|
48
32
|
const { source_url: sourceUrl, ...attribution } = source;
|
|
49
33
|
const fields = { ...input.extra };
|
|
@@ -58,7 +42,6 @@ function buildLeadBody(input, source) {
|
|
|
58
42
|
}
|
|
59
43
|
let warnedNoConfig = false;
|
|
60
44
|
const inFlight = /* @__PURE__ */ new Set();
|
|
61
|
-
/** Attribution needs a DOM; an island rendered server-side simply contributes none. */
|
|
62
45
|
function readAmbientSource() {
|
|
63
46
|
if (typeof document === "undefined" || typeof location === "undefined") return {};
|
|
64
47
|
return captureSource(document.referrer, location.search, location.href);
|
|
@@ -70,20 +53,6 @@ function resolveSource(override) {
|
|
|
70
53
|
...override ?? {}
|
|
71
54
|
};
|
|
72
55
|
}
|
|
73
|
-
/**
|
|
74
|
-
* Submit a lead to HomePages.
|
|
75
|
-
*
|
|
76
|
-
* Handles signing, the idempotency key, source attribution, and retry. Never
|
|
77
|
-
* throws — inspect the returned result. Field precedence into the submitted
|
|
78
|
-
* payload is `extra` < the named contact fields < source attribution, so `extra`
|
|
79
|
-
* can add fields but never shadow them.
|
|
80
|
-
*
|
|
81
|
-
* Off a published page — the editor canvas, or local preview — there is no site
|
|
82
|
-
* config, so nothing is sent and the result is `{ ok: true, simulated: true }`.
|
|
83
|
-
*
|
|
84
|
-
* A lead the server accepts is also announced page-wide: {@link LEAD_EVENT} is
|
|
85
|
-
* dispatched on `window` before the result resolves.
|
|
86
|
-
*/
|
|
87
56
|
async function submitLead(input, options = {}) {
|
|
88
57
|
if (!input.email || !input.email.trim()) return {
|
|
89
58
|
ok: false,
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { stampCollectionBounds } from "../../packages/internal/template-contracts/dist/slot-catalog.js";
|
|
2
2
|
import { orgsForScope } from "../../template/define-template.js";
|
|
3
|
+
import { qualify } from "../../rules/registry.js";
|
|
4
|
+
import { isInsideRoot } from "../../platform/paths.js";
|
|
3
5
|
import { CONCRETE_CLI_VERSION } from "../version.js";
|
|
4
6
|
import { MANIFEST_FILE, SECTION_FILES, TEMPLATE_FILES, assetPath, isSectionKey, isTemplateKey, islandPath, publishedSectionKey, sectionPath, staticPath, templatePath } from "../../packages/internal/template-artifact/dist/layout.js";
|
|
5
7
|
import { sectionContentHash, sourceDigest, templateContentHash } from "../../packages/internal/template-artifact/dist/hash.js";
|
|
@@ -7,22 +9,23 @@ import { ArtifactManifest } from "../../packages/internal/template-artifact/dist
|
|
|
7
9
|
import { verifyArtifact } from "../../packages/internal/template-artifact/dist/verify.js";
|
|
8
10
|
import "../../packages/internal/template-artifact/dist/index.js";
|
|
9
11
|
import { compileTemplateCss } from "../../css/compile.js";
|
|
10
|
-
import {
|
|
12
|
+
import { removeTree } from "../../platform/fs.js";
|
|
11
13
|
import { frameRungFloor } from "../media/frame-rung-floor.js";
|
|
14
|
+
import { unportablePaths } from "../../platform/names.js";
|
|
12
15
|
import { usedFactsFromSchema } from "../../schema/extract-used-facts.js";
|
|
13
16
|
import { exportSite } from "../../section/discovery.js";
|
|
14
17
|
import { buildSection } from "./sections.js";
|
|
15
18
|
import { TEMPLATE_FILE } from "../check/load-workspace.js";
|
|
19
|
+
import { collectSourceFiles } from "./source.js";
|
|
16
20
|
import { analyzeWorkspace } from "../check/analyze.js";
|
|
17
21
|
import { captureFiles } from "./captures.js";
|
|
18
22
|
import { fixtureFiles } from "./fixtures.js";
|
|
19
23
|
import { deriveSiteIcons } from "./icons.js";
|
|
20
24
|
import { playgroundFiles } from "./playground.js";
|
|
21
|
-
import { collectSourceFiles } from "./source.js";
|
|
22
25
|
import { analyticsBundle, baseCssBundle, islandRuntimeBundle, reactVendorBundles } from "./static.js";
|
|
23
26
|
import { existsSync } from "node:fs";
|
|
24
|
-
import { dirname,
|
|
25
|
-
import { mkdir, readdir,
|
|
27
|
+
import { dirname, join, relative } from "node:path";
|
|
28
|
+
import { mkdir, readdir, writeFile } from "node:fs/promises";
|
|
26
29
|
|
|
27
30
|
//#region src/cli/build/artifact.ts
|
|
28
31
|
const encoder = new TextEncoder();
|
|
@@ -30,7 +33,6 @@ const json = (value) => encoder.encode(`${JSON.stringify(value, null, 2)}\n`);
|
|
|
30
33
|
function byKey(entries) {
|
|
31
34
|
return [...entries].sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
|
|
32
35
|
}
|
|
33
|
-
/** Add a content-addressed file, refusing two different byte strings under one name. */
|
|
34
36
|
function putAsset(files, asset) {
|
|
35
37
|
const path = assetPath(asset.filename);
|
|
36
38
|
const prior = files.get(path);
|
|
@@ -40,18 +42,12 @@ function putAsset(files, asset) {
|
|
|
40
42
|
function scopeOf(scope) {
|
|
41
43
|
return scope === "global" ? "global" : { orgs: [...orgsForScope(scope)] };
|
|
42
44
|
}
|
|
43
|
-
/**
|
|
44
|
-
* Refuse an output directory whose removal would take anything but a previous artifact
|
|
45
|
-
* with it: the workspace itself, a directory above it, or one holding other files.
|
|
46
|
-
*/
|
|
47
45
|
async function assertReplaceable(root, out) {
|
|
48
|
-
|
|
49
|
-
if (rel === "" || rel !== ".." && !rel.startsWith(`..${sep}`) && !isAbsolute(rel)) throw new Error(`The output directory ${out} contains the workspace; build writes into a directory of its own.`);
|
|
46
|
+
if (relative(out, root) === "" || isInsideRoot(out, root)) throw new Error(`The output directory ${out} contains the workspace; build writes into a directory of its own.`);
|
|
50
47
|
if (!existsSync(out)) return;
|
|
51
48
|
const entries = await readdir(out);
|
|
52
49
|
if (entries.length > 0 && !entries.includes("manifest.json")) throw new Error(`The output directory ${out} is not empty and holds no artifact; build replaces only a previous artifact. Name an empty or new directory.`);
|
|
53
50
|
}
|
|
54
|
-
/** Run check and, when it is green, build and write the artifact. */
|
|
55
51
|
async function buildArtifact(options) {
|
|
56
52
|
const { root, out } = options;
|
|
57
53
|
await assertReplaceable(root, out);
|
|
@@ -113,13 +109,12 @@ async function buildArtifact(options) {
|
|
|
113
109
|
}))
|
|
114
110
|
})),
|
|
115
111
|
canvases: manifest.canvases,
|
|
116
|
-
|
|
112
|
+
read_index: composition.reads.map((read) => ({
|
|
117
113
|
instance_id: read.instanceId,
|
|
118
114
|
slot: read.slot
|
|
119
115
|
}))
|
|
120
116
|
};
|
|
121
117
|
files.set(templatePath(TEMPLATE_FILES.composition), json(compositionColumn));
|
|
122
|
-
files.set(templatePath(TEMPLATE_FILES.logic), encoder.encode(logic.template));
|
|
123
118
|
files.set(templatePath(TEMPLATE_FILES.usedFacts), json([...new Set([...usedByKey.values()].flat())].sort()));
|
|
124
119
|
files.set(templatePath(TEMPLATE_FILES.preview), json(manifest.preview ?? null));
|
|
125
120
|
const css = await compileTemplateCss({
|
|
@@ -129,7 +124,8 @@ async function buildArtifact(options) {
|
|
|
129
124
|
key: template.key,
|
|
130
125
|
output: template.output,
|
|
131
126
|
formats: template.formats
|
|
132
|
-
}
|
|
127
|
+
},
|
|
128
|
+
exclude: [options.out]
|
|
133
129
|
});
|
|
134
130
|
if (css.bundle === null) throw new Error("build: check passed but the template stylesheet did not compile.");
|
|
135
131
|
files.set(templatePath(TEMPLATE_FILES.stylesheet), css.bundle.bytes);
|
|
@@ -173,9 +169,7 @@ async function buildArtifact(options) {
|
|
|
173
169
|
files.set(templatePath(TEMPLATE_FILES.staticAssets), json(binding));
|
|
174
170
|
const fixtures = await fixtureFiles({
|
|
175
171
|
fixtures: corpus.filter((entry) => entry.emptied === void 0).map((entry) => entry.fixture),
|
|
176
|
-
assets: fixtureAssets
|
|
177
|
-
cacheDir: mediaCacheDir(root),
|
|
178
|
-
minRungWidth: frameRungFloor(template)
|
|
172
|
+
assets: fixtureAssets
|
|
179
173
|
});
|
|
180
174
|
for (const [path, bytes] of fixtures.files) files.set(path, bytes);
|
|
181
175
|
for (const asset of fixtures.assets) putAsset(files, asset);
|
|
@@ -183,7 +177,7 @@ async function buildArtifact(options) {
|
|
|
183
177
|
for (const key of builtByKey.keys()) sectionHashes.set(key, sectionContentHash(files, key));
|
|
184
178
|
const sourceFiles = await collectSourceFiles(root, [out]);
|
|
185
179
|
const artifactManifest = ArtifactManifest.parse({
|
|
186
|
-
artifact_schema:
|
|
180
|
+
artifact_schema: 2,
|
|
187
181
|
framework_version: CONCRETE_CLI_VERSION,
|
|
188
182
|
key: template.key,
|
|
189
183
|
display_name: template.name,
|
|
@@ -208,10 +202,9 @@ async function buildArtifact(options) {
|
|
|
208
202
|
for (const [path, bytes] of captures) files.set(path, bytes);
|
|
209
203
|
const verdict = verifyArtifact(files);
|
|
210
204
|
if (verdict.problems.length > 0) throw new Error(`build: the artifact failed its own verification:\n${verdict.problems.map((p) => ` ${p.path}: ${p.message}`).join("\n")}`);
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
});
|
|
205
|
+
const unportable = unportablePaths(files.keys());
|
|
206
|
+
if (unportable.length > 0) throw new Error(`the artifact would not write the same files on Windows and macOS (${qualify("workspace/unportable-name")}):\n` + unportable.map((found) => ` ${found.paths.join(" and ")}: ${found.reason}`).join("\n") + "\nRename the source files these names come from.");
|
|
207
|
+
await removeTree(out);
|
|
215
208
|
for (const [path, bytes] of byKey(files)) {
|
|
216
209
|
const target = join(out, ...path.split("/"));
|
|
217
210
|
await mkdir(dirname(target), { recursive: true });
|
|
@@ -17,13 +17,7 @@ function freePort() {
|
|
|
17
17
|
});
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
|
-
/** The server's notices are the dev command's; a build prints only its one line. */
|
|
21
20
|
const silent = new Writable({ write: (_chunk, _encoding, done) => done() });
|
|
22
|
-
/**
|
|
23
|
-
* Every capture file by artifact-relative path; empty for a website. Throws with the
|
|
24
|
-
* host's sentence when a capture fails — with the install line when Playwright is absent,
|
|
25
|
-
* since a rendered artifact without its captures would leave the platform's Download empty.
|
|
26
|
-
*/
|
|
27
21
|
async function captureFiles(options) {
|
|
28
22
|
const files = /* @__PURE__ */ new Map();
|
|
29
23
|
if (options.output === "website") return files;
|
|
@@ -4,9 +4,7 @@ import { basename, dirname, extname, join } from "node:path";
|
|
|
4
4
|
import { readFile } from "node:fs/promises";
|
|
5
5
|
|
|
6
6
|
//#region src/cli/build/esbuild.ts
|
|
7
|
-
/** The URL prefix every author asset a bundle references is baked under. */
|
|
8
7
|
const ASSET_PUBLIC_PATH = "/section-assets";
|
|
9
|
-
/** Content-hashed asset names, as the platform's asset store keys them. */
|
|
10
8
|
const ASSET_NAMES = "[name]-[hash]";
|
|
11
9
|
const CONTENT_TYPES = {
|
|
12
10
|
".svg": "image/svg+xml",
|
|
@@ -30,21 +28,10 @@ const CONTENT_TYPES = {
|
|
|
30
28
|
".pdf": "application/pdf",
|
|
31
29
|
".zip": "application/zip"
|
|
32
30
|
};
|
|
33
|
-
/** The content type an asset store serves a filename with. */
|
|
34
31
|
function assetContentType(filename) {
|
|
35
32
|
return CONTENT_TYPES[extname(filename).toLowerCase()] ?? "application/octet-stream";
|
|
36
33
|
}
|
|
37
34
|
const MANIFEST_NAMESPACE = "concrete-build-manifest";
|
|
38
|
-
/**
|
|
39
|
-
* Resolve `@homepages/concrete` and its subpaths to the running copy, bundled rather
|
|
40
|
-
* than external.
|
|
41
|
-
*
|
|
42
|
-
* Running from source, the barrel reads its version with a named import from its
|
|
43
|
-
* `package.json` under `with { type: "json" }`, which Node allows and esbuild refuses (a
|
|
44
|
-
* JSON module has only a default export). The built barrel carries the version inlined,
|
|
45
|
-
* so only a source run meets this: the package's own manifest is served to the pass as
|
|
46
|
-
* a module exporting its fields by name.
|
|
47
|
-
*/
|
|
48
35
|
function bundledFrameworkPlugin() {
|
|
49
36
|
const entries = runningCopyEntries();
|
|
50
37
|
const framework = entries.get("@homepages/concrete");
|
|
@@ -76,7 +63,6 @@ function bundledFrameworkPlugin() {
|
|
|
76
63
|
}
|
|
77
64
|
};
|
|
78
65
|
}
|
|
79
|
-
/** The loader options every pass over workspace code takes: stylesheets empty, media through the file loader. */
|
|
80
66
|
function workspaceLoaders(root) {
|
|
81
67
|
return {
|
|
82
68
|
loader: {
|
|
@@ -88,7 +74,6 @@ function workspaceLoaders(root) {
|
|
|
88
74
|
outdir: join(root, ".concrete", "cache", "build")
|
|
89
75
|
};
|
|
90
76
|
}
|
|
91
|
-
/** The non-JavaScript files a pass emitted, by filename. */
|
|
92
77
|
function emittedAssets(outputs) {
|
|
93
78
|
const byName = /* @__PURE__ */ new Map();
|
|
94
79
|
for (const file of outputs) {
|
|
@@ -103,13 +88,11 @@ function emittedAssets(outputs) {
|
|
|
103
88
|
}
|
|
104
89
|
return [...byName.values()];
|
|
105
90
|
}
|
|
106
|
-
/** The one JavaScript output of a single-entry pass. */
|
|
107
91
|
function javascriptOutput(outputs, what) {
|
|
108
92
|
const js = outputs?.find((file) => file.path.endsWith(".js")) ?? (outputs?.length === 1 ? outputs[0] : void 0);
|
|
109
93
|
if (js === void 0) throw new Error(`${what}: esbuild produced no JavaScript output.`);
|
|
110
94
|
return js.contents;
|
|
111
95
|
}
|
|
112
|
-
/** Run a pass, turning esbuild's failure into one error naming what was being built and where. */
|
|
113
96
|
async function runPass(what, pass) {
|
|
114
97
|
try {
|
|
115
98
|
return await pass();
|