blnkfld 0.1.1 → 0.1.2
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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@font-face{font-family:Lora Variable;src:url(/assets/lora-latin-wght-normal-BiLcIKcI.woff2) format("woff2");font-style:normal;font-weight:400 700;font-display:swap}@font-face{font-family:Lora Variable;src:url(/assets/lora-latin-wght-italic-DBI-iqMr.woff2) format("woff2");font-style:italic;font-weight:400 700;font-display:swap}@font-face{font-family:Inter Variable;src:url(/assets/inter-latin-wght-normal-Dx4kXJAl.woff2) format("woff2");font-style:normal;font-weight:100 900;font-display:swap}@font-face{font-family:Geist Mono Variable;src:url(/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2) format("woff2");font-style:normal;font-weight:100 900;font-display:swap}@font-face{font-family:IBM Plex Mono;src:url(/assets/ibm-plex-mono-latin-700-normal-7sUh57Bg.woff2) format("woff2");font-style:normal;font-weight:700;font-display:swap}:root{--sans: "Inter Variable", sans-serif;--mono: "Geist Mono Variable", "IBM Plex Mono", monospace;--serif: "Iowan Old Style", "Lora Variable", "Times New Roman", serif}:root{color:#000;background:var(--paper);font-family:var(--sans);font-synthesis:none;font-weight:500;--paper: #fefefe;--ink: #000;--muted: rgba(0, 0, 0, .8);--line: #000;--hover-background: #181818;--diagram-pattern-color: rgba(0, 0, 0, .12);--accent: #D63800;--green: var(--accent);--mono-size: 11px}*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;min-width:320px;min-height:100vh;-webkit-font-smoothing:antialiased;background:var(--paper)}button,input{font:inherit}button{color:inherit}.brand-logo{width:28px;height:28px;border-radius:50%;background:repeating-linear-gradient(to bottom,var(--ink) 0 2px,var(--paper) 2px 4px);margin-bottom:10px;flex-shrink:0}.wordmark{font-family:var(--serif);font-size:25px;font-style:normal;line-height:1;letter-spacing:.01em;font-weight:600}.product-label{color:var(--green);margin-top:4px;font-family:var(--mono);font-size:var(--mono-size);line-height:1.15;letter-spacing:.08em;text-transform:uppercase;font-weight:700}h1,h2,h3,h4,h5,h6{font-family:var(--serif)}h1,h2,h3{margin:0;font-weight:600;color:var(--ink)}h1{font-size:25px;letter-spacing:0;line-height:1.12}::selection{background:var(--accent);color:var(--paper)}code,pre,kbd,samp{font-family:var(--mono);font-weight:700;font-size:var(--mono-size)}.instrument{--surface:var(--paper);--text:var(--ink);--soft:var(--muted);--rule:var(--line);background:var(--surface);color:var(--text);min-height:100vh;font-family:var(--sans);font-size:13px;font-weight:500}.instrument button,.instrument input{font:inherit}.instrument button{cursor:pointer}.instrument button:focus-visible,.instrument a:focus-visible,.instrument input:focus-visible{outline:2px solid var(--accent);outline-offset:4px}.instrument-header{height:92px;padding:0 36px;display:flex;align-items:center;justify-content:space-between}.instrument a{color:inherit;text-decoration:none}.instrument-brand{font-size:25px;letter-spacing:-1.5px;font-weight:600;display:flex;align-items:center;gap:25px}.instrument-header-right,.eyebrow,.instrument-status,.scene-caption,.inspector-tabs,.instrument-footer,.inspector-footer{font-family:var(--mono);font-size:var(--mono-size);letter-spacing:.06em;font-weight:700}.instrument-header-right{display:flex;gap:36px}.instrument-header-right>span{color:var(--soft)}.instrument-body{display:grid;grid-template-columns:minmax(0,1fr) 300px;min-height:calc(100vh - 145px)}.instrument-workspace{padding:36px 36px 25px;min-width:0}.instrument-title{display:flex;justify-content:space-between;gap:20px}.eyebrow{color:var(--soft);display:block}.instrument h1{font-size:34px;letter-spacing:-1.5px;font-weight:500;margin:13px 0 9px}.instrument-title p{color:var(--soft);max-width:580px;font-size:12px;line-height:1.6;margin:0}.instrument-status{white-space:nowrap;height:fit-content;display:flex;gap:8px;align-items:center}.instrument-status:before{content:"";background:var(--ink);width:6px;height:6px;border-radius:50%}.scene-wrap{margin-top:35px}.scene-caption{display:flex;justify-content:space-between;color:var(--soft);font-size:var(--mono-size)}.instrument-scene{height:320px;width:100%;position:relative;overflow:hidden}.instrument-scene canvas{display:block}.module-controls{display:grid;grid-template-columns:repeat(5,1fr);gap:12px}.module-controls button{text-align:left;border:0;background:none;padding:13px 0;color:var(--text);min-width:0}.module-controls button>span{font-family:var(--mono);font-size:var(--mono-size);display:block;margin-bottom:10px;font-weight:700}.module-controls strong{font-size:12px;font-weight:500;display:block}.module-controls small{font-size:11px;color:var(--soft);display:block;margin-top:5px}.module-controls button[aria-pressed=true]>span{color:var(--accent)}.module-controls button[aria-pressed=true]{box-shadow:0 -2px var(--accent)}.instrument-summary{display:grid;grid-template-columns:130px 1fr;gap:20px;margin:24px 0 32px}.instrument-summary p{margin:0;max-width:670px;font-size:12px;line-height:1.8;color:var(--muted)}.instrument-summary .eyebrow{padding-top:4px}.sequencer{padding-top:24px}.sequence-heading{display:flex;align-items:center;justify-content:space-between}.sequence-heading h2{font-size:21px;font-weight:500;margin:10px 0 20px}.play-button{width:32px;height:32px;flex-shrink:0;display:grid;place-items:center;padding:0;background:transparent;color:var(--ink);border:1px solid var(--ink);border-radius:50%}.play-button svg{width:16px;height:16px;display:block}.instrument-inspector{padding:0 25px 25px;position:relative}.inspector-tabs{height:66px;display:flex;gap:23px;align-items:center;margin-bottom:32px}.inspector-tabs button{border:0;background:none;text-transform:uppercase;color:var(--soft);font-size:var(--mono-size);padding:8px 0}.inspector-tabs button[aria-pressed=true]{color:var(--text);box-shadow:0 2px var(--text)}.instrument-inspector h2{font-size:16px;font-weight:500;letter-spacing:-.7px;margin:17px 0 12px}.instrument-inspector h3{font-size:13px;font-weight:500;margin-top:30px}.instrument-inspector p{font-size:12px;line-height:1.8;color:var(--muted)}.inspector-rule{margin:28px 0}.source-file{margin-top:22px}.source-file>span{font-family:var(--mono);font-size:var(--mono-size);overflow-wrap:anywhere;line-height:1.8;font-weight:700}.source-file p{font-size:12px;margin-top:7px}.inspector-note{margin-top:32px;padding:15px;font-size:11px;line-height:1.8;color:var(--muted)}.inspector-footer{color:var(--soft);font-size:var(--mono-size);line-height:2.1;margin-top:55px;overflow-wrap:anywhere}.instrument-footer{display:flex;align-items:center;gap:25px;padding:15px 36px;font-size:var(--mono-size)}.instrument-footer>span:last-child{margin-left:auto}.instrument-footer button{background:none;border:0;padding:0;font-size:var(--mono-size)}.repository-popover{position:fixed;left:28px;bottom:65px;width:min(430px,calc(100vw - 56px));background:var(--paper);padding:25px;border:1px solid var(--rule);box-shadow:0 10px 50px #0002;display:grid;gap:12px;z-index:5}.repository-popover input{width:100%;padding:12px;border:1px solid var(--line);background:transparent}.repository-popover button{padding:10px;background:var(--paper);border:1px solid var(--rule)}@media(min-width:1600px){.instrument-scene{height:440px}.instrument-workspace{padding:45px 55px}}@media(max-width:1000px){.instrument-body{grid-template-columns:minmax(0,1fr) 250px}.instrument-workspace{padding:28px 22px}.instrument-header{padding:0 22px}.instrument-status{display:none}.instrument-summary{grid-template-columns:1fr;gap:10px}.instrument-scene{height:260px}}@media(max-width:700px){.instrument-body{display:block}.instrument-header{height:75px}.instrument-header-right>span{display:none}.instrument-inspector{border-left:0;padding-bottom:25px}.instrument-title h1{font-size:28px}.scene-caption{font-size:var(--mono-size)}.instrument-scene{height:230px}.module-controls{gap:5px}.module-controls strong,.module-controls small{font-size:10px}.instrument-footer{padding:15px 22px}.instrument-footer>span:last-child{display:none}.instrument-footer>span{overflow-wrap:anywhere}.instrument-summary{margin-bottom:25px}}.instrument h1,.instrument h2,.instrument h3{font-family:var(--serif);font-weight:500;font-style:normal;letter-spacing:0}.instrument-brand{display:block;letter-spacing:normal}.instrument-brand .brand-logo{width:28px;height:28px;margin-bottom:10px;background:repeating-linear-gradient(to bottom,var(--ink) 0 1px,var(--paper) 1px 3px)}.instrument-header{height:145px}.instrument-body{min-height:calc(100vh - 198px)}.instrument h1,.instrument-title h1{font-size:21px;font-weight:500;font-style:normal}.instrument-brand .wordmark{font-size:25px}.instrument-brand .product-label{font-size:var(--mono-size)}.instrument-run{margin-top:28px;padding:24px 0;scroll-margin-top:24px}.instrument-run h2{font-size:21px;margin:12px 0}.instrument-run p{font-size:13px;line-height:1.8;max-width:720px}.run-evidence{display:flex;flex-wrap:wrap;gap:12px;font-family:var(--mono);font-size:var(--mono-size);line-height:1.7;overflow-wrap:anywhere;font-weight:700}.run-evidence>span:first-child{color:var(--muted)}@media(max-width:700px){.instrument-header{height:145px}.instrument-header-right{flex-direction:column;gap:16px}.instrument-run p{font-size:13px}}.trace-scene-wrap{margin-top:12px}.trace-controls button{min-height:72px}.trace-controls button>span{display:flex;justify-content:space-between}.analysis-coverage,.trace-empty{font-size:12px;line-height:1.8;color:var(--muted)}.source-file pre{font:700 var(--mono-size)/1.6 var(--mono);max-height:300px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;font-weight:700}.source-file summary{font:700 var(--mono-size) var(--mono);cursor:pointer;font-weight:700}.trace-empty{padding:20px 0}.play-button:disabled{opacity:.35;cursor:default}.isometric-fallback{height:100%;display:flex;flex-direction:column;justify-content:center}.isometric-fallback svg{width:100%;min-height:0;flex:1}.fallback-caption{font:700 var(--mono-size) var(--mono);color:var(--muted);padding-top:16px;font-weight:700}.isometric-fallback g[role=button]:focus-visible{outline:1px solid var(--accent)}.instrument-body{max-width:1600px;margin:0 auto;padding:28px 36px 36px;grid-template-columns:minmax(0,1fr) minmax(280px,320px);column-gap:48px;row-gap:0;align-items:start}.instrument-workspace{display:contents}.instrument-title{grid-column:1 / -1;grid-row:1}.instrument-summary{grid-column:1 / -1;grid-row:2;margin:26px 0 0;grid-template-columns:130px minmax(0,720px)}.instrument-workspace>.scene-wrap{grid-column:1;grid-row:4;margin-top:0}.sequencer{grid-column:1;grid-row:8;margin-top:0;padding-top:0}.instrument-inspector{grid-column:2;grid-row:4;min-width:0;padding:0;position:sticky;top:24px;max-height:calc(100vh - 48px);overflow:auto}.instrument-inspector.inspector-trace{grid-row:8}.inspector-tabs{height:auto;min-height:26px;margin:0 0 26px;align-items:flex-start}.inspector-tabs button{padding:0 0 8px}.instrument-run{grid-column:1 / -1;grid-row:11;margin-top:0}.analysis-coverage{grid-column:1;grid-row:5}.module-controls{grid-template-columns:repeat(auto-fit,minmax(115px,1fr));gap:16px}.module-controls strong,.module-controls small{overflow-wrap:anywhere;line-height:1.5}.instrument-scene{height:clamp(280px,26vw,400px)}.instrument-title p{max-width:720px}@media(max-width:1100px){.instrument-body{grid-template-columns:minmax(0,1fr);padding:24px 28px 32px}.instrument-title,.instrument-summary,.instrument-workspace>.scene-wrap,.sequencer,.instrument-run,.analysis-coverage,.instrument-inspector{grid-column:1}.instrument-inspector{grid-row:6;position:static;max-height:none;overflow:visible;margin:24px 0 0;max-width:720px}.instrument-inspector.inspector-trace{grid-row:9}.analysis-coverage{grid-row:5}.instrument-scene{height:320px}.instrument-status{display:flex}.inspector-footer{margin-top:24px}}@media(max-width:700px){.instrument-body{display:grid;padding:20px 22px 28px}.instrument-summary{grid-template-columns:1fr;gap:10px;margin-bottom:0}.instrument-status{display:none}.instrument-scene{height:250px}.module-controls{grid-template-columns:repeat(auto-fit,minmax(100px,1fr));gap:12px}.module-controls strong{font-size:12px}.module-controls small{font-size:11px}.instrument-inspector{padding:0}}.module-controls button[aria-pressed=true] strong{color:var(--accent)}.module-controls button:hover>span,.instrument a:hover{color:var(--accent)}.inspector-tabs button[aria-pressed=true]{color:var(--accent);box-shadow:0 2px var(--accent)}.instrument-inspector[data-tab=part] .inspector-content .eyebrow:first-of-type{color:var(--accent)}.instrument-inspector[data-tab=part] .inspector-content .source-file{border-left:2px solid var(--accent);padding-left:12px}.inspection-context{font-family:var(--mono);font-size:var(--mono-size)!important;color:var(--accent)!important;font-weight:700}.module-controls button{height:132px;overflow:auto;align-self:start}.module-controls strong{height:33px;overflow:auto}.module-controls small{height:45px;overflow:auto}.trace-controls button{height:100px}.trace-controls strong{height:50px}@media(min-width:1101px){.instrument-inspector{contain:size;height:100%;min-height:0;padding-bottom:24px}.instrument-inspector.inspector-trace{margin-top:0;height:100%}}.instrument-title .eyebrow,.system-heading .eyebrow,.sequence-heading .eyebrow,.instrument-run>.eyebrow{font-weight:700}.module-controls strong{height:36px}.module-controls small{height:50px}.trace-controls strong{height:54px}.instrument-inspector{position:relative;top:auto}.module-controls button{height:148px}.trace-controls button{height:112px}.module-controls button,.trace-controls button{height:112px;min-height:0;overflow:hidden;display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start}.module-controls button>span{flex:none}.module-controls strong,.trace-controls strong{height:auto;max-height:54px;overflow:hidden;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical}.instrument-header-right a{font-weight:700}#repository,#action{scroll-margin-top:24px}.system-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:24px}.system-heading h2{font-size:21px;margin:10px 0 0}.system-view{display:flex;gap:16px;flex-shrink:0}.system-view button{font:700 var(--mono-size) var(--mono);border:0;border-bottom:1px solid transparent;background:none;padding:8px 0;color:var(--muted);font-weight:700}.system-view button[aria-pressed=true]{color:var(--accent);border-color:var(--accent)}.connection-toolbar{display:flex;justify-content:space-between;align-items:center;gap:16px;font:700 var(--mono-size)/1.7 var(--mono);padding-top:0;font-weight:700}.connection-toolbar button{border:0;background:none;padding:4px 0;font:inherit;text-align:right;text-decoration:underline;text-underline-offset:4px}.connection-toolbar button[aria-pressed=true]{color:var(--accent)}.connection-context{font:700 var(--mono-size)/1.7 var(--mono);color:var(--soft);margin:14px 0 24px;max-width:660px;font-weight:700}.connection-empty{font-size:12px;line-height:1.8;padding:24px 0}.action-summary{font-size:12px;line-height:1.8;color:var(--soft);margin:0 0 26px;max-width:700px}@media(max-width:700px){.system-heading{align-items:flex-start;flex-direction:column;gap:12px}.connection-toolbar{align-items:flex-start}.connection-toolbar>span{min-width:0;overflow-wrap:anywhere}.connection-toolbar button{max-width:140px;flex-shrink:0}}.architecture-tools{display:flex;align-items:center;justify-content:space-between;gap:16px;font:700 var(--mono-size)/1.6 var(--mono);color:#666;margin:20px 0 14px;font-weight:700}.architecture-tools button{font:inherit;color:var(--text);background:none;border:1px solid #0003;padding:6px 10px}.architecture-frame{width:100%;border:1px solid #00000018;background:var(--paper)}.architecture-map{width:100%;margin-inline:auto;position:relative;isolation:isolate}.architecture-depth{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none}.architecture-depth canvas{display:block;width:100%;height:100%}.architecture-overlay{display:block;width:100%;height:100%;position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;overflow:visible}.architecture-node{cursor:pointer;outline:none}.architecture-node:focus-visible>rect{stroke:var(--accent);stroke-width:2}.architecture-node-copy{height:100%;display:flex;flex-direction:column;justify-content:center;gap:8px;text-align:left}.architecture-node-copy>span{font:700 var(--mono-size)/1 var(--mono);text-transform:uppercase;letter-spacing:.03em;color:#777;font-weight:700}.architecture-node-copy>strong{font:500 13px/1.35 var(--sans);overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.architecture-node.is-selected .architecture-node-copy>span{color:var(--accent)}.architecture-edge{color:#636363;transition:opacity .15s}.architecture-edge.is-selected{color:var(--accent)}.architecture-edge-hit{cursor:pointer}.architecture-edge-label{width:100%;height:100%;display:flex;justify-content:center;align-items:center;border:0;padding:0;background:transparent;color:inherit;font:700 var(--mono-size)/1.5 var(--mono);text-align:center;font-weight:700}.architecture-edge-label>span{padding:3px 5px;background:var(--paper);overflow-wrap:anywhere}.architecture-edge-label:hover,.architecture-edge-label[aria-pressed=true]{color:var(--accent)}.architecture-hint{font:700 var(--mono-size)/1.8 var(--mono);color:#777;margin:14px 0 0;font-weight:700}.architecture-evidence{border-top:1px solid #0003;margin:24px 0 0;padding-top:20px}.architecture-evidence>div:first-child{display:flex;justify-content:space-between;align-items:center}.architecture-evidence>div:first-child button{background:none;border:0;font-size:20px}.architecture-evidence h3{font-size:21px;margin:12px 0}.architecture-evidence>p{font-size:12px;line-height:1.7}.architecture-evidence .source-file{margin-top:14px}.architecture-evidence .source-file p{line-height:1.7;color:var(--muted)}@media(prefers-reduced-motion:reduce){.architecture-edge{transition:none}}.instrument-body{overflow-anchor:none}.smooth-height{transition:height .32s cubic-bezier(.22,.68,0,1.01);overflow:clip}.smooth-height-content{display:flow-root}.view-enter{animation:view-enter .22s ease-out}@keyframes view-enter{0%{opacity:0}to{opacity:1}}.instrument button{transition:color .16s ease,background-color .16s ease,border-color .16s ease,box-shadow .16s ease}.repository-popover{animation:popover-enter .22s ease-out}@keyframes popover-enter{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}.smooth-height,.instrument button{transition:none}.view-enter,.repository-popover{animation:none}}.instrument .readme-trigger{flex-shrink:0;align-self:flex-start;background:transparent;border:0;padding:0;font:700 var(--mono-size)/1.5 var(--mono);letter-spacing:.06em;white-space:nowrap;font-weight:700}.readme-trigger:hover{color:var(--accent)}.readme-actions{padding:24px 0 32px}.readme-download{display:inline-block}.readme-drawer .readme-text{padding-bottom:32px}.instrument .readme-download{font:700 var(--mono-size)/1.5 var(--mono);padding:12px 16px;border:1px solid #0003;background:transparent;color:var(--text);white-space:nowrap;font-weight:700}.readme-download:hover{border-color:var(--accent);color:var(--accent)}.readme-text{max-width:760px;overflow-wrap:anywhere}.readme-text>h3{font-size:21px;margin:0 0 12px}.readme-text h4{font:normal 500 21px/1.4 var(--serif);margin:30px 0 12px}.readme-text p,.readme-text li{font-size:13px;line-height:1.85;color:var(--muted);white-space:pre-wrap}.readme-text p{margin:0 0 14px}.readme-text ul,.readme-text ol{padding-left:22px;margin:0 0 18px}.readme-text li+li{margin-top:10px}.readme-text .readme-subtitle{color:var(--text)}@media(max-width:700px){.instrument-title{flex-wrap:wrap}.instrument .readme-trigger{font-size:var(--mono-size)}}.instrument-footer>button{font:inherit;letter-spacing:inherit}.instrument-footer>button,.instrument-footer>span{text-transform:uppercase}#system{scroll-margin-top:24px}.trace-view{margin:0 0 24px}.trace-diagram{width:100%;margin:0}@media(max-width:700px){.instrument-header-right{gap:12px}.instrument-header-right a{font-size:var(--mono-size)}}.instrument-header,.instrument-footer{width:100%;max-width:1600px;margin-inline:auto;padding-inline:36px}@media(max-width:1100px){.instrument-header,.instrument-footer{padding-inline:28px}}@media(max-width:700px){.instrument-header,.instrument-footer{padding-inline:22px}}.instrument-summary .project-haiku{grid-column:2;margin:18px 0 0;font:normal 500 14.5px/1.8 var(--serif);color:var(--soft)}.instrument-summary .project-haiku-label{grid-column:1;margin-top:18px}.project-haiku span{display:block}@media(max-width:700px){.instrument-summary .project-haiku-label{margin-top:12px}.instrument-summary .project-haiku{grid-column:1;margin-top:0}}.instrument .instrument-inspector h2,.instrument .instrument-inspector h3{font-family:var(--sans);font-weight:500;font-style:normal;color:var(--ink)}.section-divider{grid-column:1 / -1;width:100%;border:0;border-top:1px solid var(--rule);opacity:.5;margin:40px 0}.divider-system{grid-row:3}.divider-action{grid-row:7}.divider-run{grid-row:10}@media(max-width:700px){.section-divider{margin:32px 0}}.instrument-header,.instrument-body,.instrument-footer{max-width:1360px}.instrument-header{height:128px}.instrument-body{column-gap:36px;min-height:calc(100vh - 181px)}.instrument-summary{margin-top:20px;gap:16px 24px}.instrument-summary p{line-height:1.6}.instrument-summary .project-haiku,.instrument-summary .project-haiku-label{margin-top:0}.instrument-summary .project-haiku{line-height:1.6}.system-heading{margin-bottom:16px}.system-heading h2{margin-top:8px}.sequence-heading h2{margin:8px 0 12px}.action-summary{line-height:1.6;margin-bottom:16px}.trace-view{margin-bottom:16px}.instrument-scene{height:300px}.module-controls button,.trace-controls button{height:auto;min-height:80px;padding:12px 0;align-self:stretch}.module-controls button>span{margin-bottom:6px}.module-controls strong,.trace-controls strong{line-height:1.4;max-height:51px}.inspector-tabs{margin-bottom:16px}.instrument-inspector h2{margin:8px 0}.instrument-inspector h3{margin:20px 0 8px}.instrument-inspector p{line-height:1.6;margin:8px 0}.inspector-rule{margin:20px 0}.source-file{margin-top:12px}.source-file>span{line-height:1.6}.source-file p{margin:6px 0 0}.inspector-note{margin-top:20px;padding:0;line-height:1.6}.inspector-footer{margin-top:24px;line-height:1.7}.instrument-run{padding:0}.instrument-run h2{margin:8px 0 12px}.instrument-run p{line-height:1.6;margin:0 0 16px}.connection-context{margin:12px 0 16px}.architecture-tools{margin:16px 0 12px}.architecture-hint{line-height:1.6;margin-top:12px}@media(max-width:1100px){.instrument-scene{height:280px}}@media(max-width:700px){.instrument-summary{gap:10px}.instrument-summary .project-haiku-label{margin-top:6px}.instrument-scene{height:230px}.module-controls button,.trace-controls button{min-height:72px}}.instrument-cards .instrument-body{padding:40px 68px 68px}.instrument-cards :is(#repository,#system,#action,#how-to-run){scroll-margin-top:56px}.instrument-cards .section-divider{border-color:transparent;margin:44px 0}.section-card-outline{grid-column:1 / -1;align-self:stretch;position:relative;pointer-events:none;min-width:0;min-height:0}.section-card-outline:before{content:"";position:absolute;top:-32px;right:-32px;bottom:-32px;left:-32px;border:1px solid var(--rule);border-radius:8px;opacity:.2}.card-repository{grid-row:1 / 3}.card-system{grid-row:4 / 7}.card-action{grid-row:8 / 10}.card-run{grid-row:11 / 12}@media(max-width:1100px){.instrument-cards .instrument-body{padding:40px 60px 64px}}@media(max-width:700px){.instrument-cards .instrument-body{padding:32px 46px 52px}.instrument-cards .section-divider{margin:36px 0}.section-card-outline:before{top:-24px;right:-24px;bottom:-24px;left:-24px}}.instrument-footer{flex-wrap:wrap}.instrument-footer>button{white-space:nowrap}.instrument-footer .changelog-trigger{margin-left:auto;font:inherit;letter-spacing:inherit;color:inherit}.changelog-trigger:hover{text-decoration:underline;text-underline-offset:4px}body:has(.changelog-drawer[open]){overflow:hidden}.changelog-drawer{position:fixed;inset:0 0 0 auto;margin:0;width:min(640px,100vw);max-width:100vw;height:100dvh;max-height:100dvh;padding:0 28px;border:0;border-left:1px solid #0003;border-radius:0;background:var(--paper);color:var(--ink);box-shadow:-16px 0 60px #0002;font-family:var(--sans);font-weight:500;letter-spacing:normal;overscroll-behavior:contain}.changelog-drawer[open]{animation:changelog-enter .24s ease-out}@keyframes changelog-enter{0%{transform:translate(100%)}to{transform:translate(0)}}@media(prefers-reduced-motion:reduce){.changelog-drawer[open]{animation:none}}.changelog-drawer::backdrop{background:#0005}.changelog-drawer header{display:flex;align-items:flex-start;justify-content:space-between;gap:24px;padding:26px 0 24px;border-bottom:1px solid #0003}.changelog-drawer h2{font-size:21px;font-style:normal;margin:10px 0}.changelog-drawer header p{font-size:12px;line-height:1.6;margin:0;color:var(--muted)}.instrument .drawer-close{width:44px;height:44px;flex-shrink:0;display:grid;place-items:center;padding:0;border:0;background:none;color:var(--ink)}.drawer-close svg{display:block;width:12px;height:12px}.drawer-close:hover{color:var(--accent)}.changelog-entry{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;padding:24px 0;border-bottom:1px solid #0003}.changelog-entry:last-child{border-bottom:0}.changelog-date{font:700 var(--mono-size)/1.8 var(--mono);color:var(--muted);font-weight:700}.changelog-entry h3{font-size:21px;font-style:normal;line-height:1.35;margin:0}.changelog-category h4{font:500 12px/1.6 var(--sans);margin:16px 0 0}.changelog-category ul{margin-top:6px}.changelog-entry ul{margin:12px 0 0;padding-left:16px;font:500 12px/1.75 var(--sans);color:var(--muted)}.changelog-entry li+li{margin-top:8px}@media(max-width:700px){.instrument-footer{gap:16px 22px}.changelog-drawer{padding:0 20px}.changelog-entry{grid-template-columns:minmax(0,1fr);gap:8px}.changelog-drawer header{gap:12px}}.footer-links{display:flex;align-items:center;gap:12px;margin-left:auto}.footer-links>button{white-space:nowrap}.instrument-footer .footer-links>button{margin:0;font:inherit;letter-spacing:inherit}.how-to-run-trigger:hover{text-decoration:underline;text-underline-offset:4px}.setup-content{padding:0 0 32px}.setup-content section{margin-top:28px}.setup-content h3{font-size:21px;margin:0 0 12px}.setup-content p,.setup-content dd{font:500 12px/1.8 var(--sans);color:var(--muted);margin:0 0 14px}.setup-content pre{font:700 var(--mono-size)/1.8 var(--mono);padding:16px;background:#00000006;white-space:pre-wrap;overflow-wrap:anywhere;font-weight:700}.setup-content code{font-family:var(--mono);font-size:var(--mono-size);font-weight:700}.setup-content dt{font:700 var(--mono-size)/1.8 var(--mono);margin:18px 0 6px;white-space:normal;font-weight:700}.setup-content{white-space:normal;overflow-wrap:anywhere}.setup-drawer header{white-space:normal}
|
|
@@ -4285,12 +4285,9 @@ void main() {
|
|
|
4285
4285
|
|
|
4286
4286
|
}
|
|
4287
4287
|
|
|
4288
|
-
}`;class TN{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,i){if(this.texture===null){const e=new i_(t.texture);(t.depthNear!==i.depthNear||t.depthFar!==i.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=e}}getMesh(t){if(this.texture!==null&&this.mesh===null){const i=t.cameras[0].viewport,e=new gs({vertexShader:SN,fragmentShader:_N,uniforms:{depthColor:{value:this.texture},depthWidth:{value:i.z},depthHeight:{value:i.w}}});this.mesh=new Hn(new Vl(20,20),e)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class bN extends hr{constructor(t,i){super();const e=this;let s=null,o=1,c=null,h="local-floor",d=1,f=null,g=null,x=null,y=null,v=null,_=null;const A=typeof XRWebGLBinding<"u",b=new TN,S={},R=i.getContextAttributes();let k=null,N=null;const D=[],I=[],F=new le;let M=null,w=null;const H=new Zn;H.viewport=new di;const V=new Zn;V.viewport=new di;const X=[H,V],$=new P1;let W=null,Q=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(ot){let yt=D[ot];return yt===void 0&&(yt=new Dd,D[ot]=yt),yt.getTargetRaySpace()},this.getControllerGrip=function(ot){let yt=D[ot];return yt===void 0&&(yt=new Dd,D[ot]=yt),yt.getGripSpace()},this.getHand=function(ot){let yt=D[ot];return yt===void 0&&(yt=new Dd,D[ot]=yt),yt.getHandSpace()};function O(ot){const yt=I.indexOf(ot.inputSource);if(yt===-1)return;const wt=D[yt];wt!==void 0&&(wt.update(ot.inputSource,ot.frame,f||c),wt.dispatchEvent({type:ot.type,data:ot.inputSource}))}function z(){s.removeEventListener("select",O),s.removeEventListener("selectstart",O),s.removeEventListener("selectend",O),s.removeEventListener("squeeze",O),s.removeEventListener("squeezestart",O),s.removeEventListener("squeezeend",O),s.removeEventListener("end",z),s.removeEventListener("inputsourceschange",st);for(let ot=0;ot<D.length;ot++){const yt=I[ot];yt!==null&&(I[ot]=null,D[ot].disconnect(yt))}W=null,Q=null,b.reset();for(const ot in S)delete S[ot];if(t.setRenderTarget(k),v=null,y=null,x=null,s=null,N=null,Gt.stop(),e.isPresenting=!1,t.setPixelRatio(M),t.setSize(F.width,F.height,!1),w!==null){const ot=w.camera;ot.fov=w.fov,ot.zoom=w.zoom,ot.updateProjectionMatrix(),w=null}e.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(ot){o=ot,e.isPresenting===!0&&de("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(ot){h=ot,e.isPresenting===!0&&de("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return f||c},this.setReferenceSpace=function(ot){f=ot},this.getBaseLayer=function(){return y!==null?y:v},this.getBinding=function(){return x===null&&A&&(x=new XRWebGLBinding(s,i)),x},this.getFrame=function(){return _},this.getSession=function(){return s},this.setSession=async function(ot){if(s=ot,s!==null){if(k=t.getRenderTarget(),s.addEventListener("select",O),s.addEventListener("selectstart",O),s.addEventListener("selectend",O),s.addEventListener("squeeze",O),s.addEventListener("squeezestart",O),s.addEventListener("squeezeend",O),s.addEventListener("end",z),s.addEventListener("inputsourceschange",st),R.xrCompatible!==!0&&await i.makeXRCompatible(),M=t.getPixelRatio(),t.getSize(F),A&&"createProjectionLayer"in XRWebGLBinding.prototype){let wt=null,ce=null,Et=null;R.depth&&(Et=R.stencil?i.DEPTH24_STENCIL8:i.DEPTH_COMPONENT24,wt=R.stencil?ar:qs,ce=R.stencil?Fl:ps);const Zt={colorFormat:i.RGBA8,depthFormat:Et,scaleFactor:o};x=this.getBinding(),y=x.createProjectionLayer(Zt),s.updateRenderState({layers:[y]}),t.setPixelRatio(1),t.setSize(y.textureWidth,y.textureHeight,!1),N=new Qn(y.textureWidth,y.textureHeight,{format:$n,type:En,depthTexture:new zl(y.textureWidth,y.textureHeight,ce,void 0,void 0,void 0,void 0,void 0,void 0,wt),stencilBuffer:R.stencil,colorSpace:t.outputColorSpace,samples:R.antialias?4:0,resolveDepthBuffer:y.ignoreDepthValues===!1,resolveStencilBuffer:y.ignoreDepthValues===!1,storeMultisampledDepthBuffer:y.ignoreDepthValues===!1,storeMultisampledStencilBuffer:y.ignoreDepthValues===!1})}else{const wt={antialias:R.antialias,alpha:!0,depth:R.depth,stencil:R.stencil,framebufferScaleFactor:o};v=new XRWebGLLayer(s,i,wt),s.updateRenderState({baseLayer:v}),t.setPixelRatio(1),t.setSize(v.framebufferWidth,v.framebufferHeight,!1),N=new Qn(v.framebufferWidth,v.framebufferHeight,{format:$n,type:En,colorSpace:t.outputColorSpace,stencilBuffer:R.stencil,resolveDepthBuffer:v.ignoreDepthValues===!1,resolveStencilBuffer:v.ignoreDepthValues===!1,storeMultisampledDepthBuffer:v.ignoreDepthValues===!1,storeMultisampledStencilBuffer:v.ignoreDepthValues===!1})}N.isXRRenderTarget=!0,this.setFoveation(d),f=null,c=await s.requestReferenceSpace(h),Gt.setContext(s),Gt.start(),e.isPresenting=!0,e.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(s!==null)return s.environmentBlendMode},this.getDepthTexture=function(){return b.getDepthTexture()};function st(ot){for(let yt=0;yt<ot.removed.length;yt++){const wt=ot.removed[yt],ce=I.indexOf(wt);ce>=0&&(I[ce]=null,D[ce].disconnect(wt))}for(let yt=0;yt<ot.added.length;yt++){const wt=ot.added[yt];let ce=I.indexOf(wt);if(ce===-1){for(let Zt=0;Zt<D.length;Zt++)if(Zt>=I.length){I.push(wt),ce=Zt;break}else if(I[Zt]===null){I[Zt]=wt,ce=Zt;break}if(ce===-1)break}const Et=D[ce];Et&&Et.connect(wt)}}const et=new Z,dt=new Z;function U(ot,yt,wt){et.setFromMatrixPosition(yt.matrixWorld),dt.setFromMatrixPosition(wt.matrixWorld);const ce=et.distanceTo(dt),Et=yt.projectionMatrix.elements,Zt=wt.projectionMatrix.elements,me=Et[14]/(Et[10]-1),Rt=Et[14]/(Et[10]+1),fe=(Et[9]+1)/Et[5],te=(Et[9]-1)/Et[5],re=(Et[8]-1)/Et[0],Pe=(Zt[8]+1)/Zt[0],ri=me*re,pi=me*Pe,Le=ce/(-re+Pe),mi=Le*-re;if(yt.matrixWorld.decompose(ot.position,ot.quaternion,ot.scale),ot.translateX(mi),ot.translateZ(Le),ot.matrixWorld.compose(ot.position,ot.quaternion,ot.scale),ot.matrixWorldInverse.copy(ot.matrixWorld).invert(),Et[10]===-1)ot.projectionMatrix.copy(yt.projectionMatrix),ot.projectionMatrixInverse.copy(yt.projectionMatrixInverse);else{const J=me+Le,je=Rt+Le,Xe=ri-mi,B=pi+(ce-mi),E=fe*Rt/je*J,it=te*Rt/je*J;ot.projectionMatrix.makePerspective(Xe,B,E,it,J,je),ot.projectionMatrixInverse.copy(ot.projectionMatrix).invert()}}function nt(ot,yt){yt===null?ot.matrixWorld.copy(ot.matrix):ot.matrixWorld.multiplyMatrices(yt.matrixWorld,ot.matrix),ot.matrixWorldInverse.copy(ot.matrixWorld).invert()}this.updateCamera=function(ot){if(s===null)return;let yt=ot.near,wt=ot.far;b.texture!==null&&(b.depthNear>0&&(yt=b.depthNear),b.depthFar>0&&(wt=b.depthFar)),$.near=V.near=H.near=yt,$.far=V.far=H.far=wt,(W!==$.near||Q!==$.far)&&(s.updateRenderState({depthNear:$.near,depthFar:$.far}),W=$.near,Q=$.far),$.layers.mask=ot.layers.mask|6,H.layers.mask=$.layers.mask&-5,V.layers.mask=$.layers.mask&-3;const ce=ot.parent,Et=$.cameras;nt($,ce);for(let Zt=0;Zt<Et.length;Zt++)nt(Et[Zt],ce);Et.length===2?U($,H,V):$.projectionMatrix.copy(H.projectionMatrix),w===null&&ot.isPerspectiveCamera&&(w={camera:ot,fov:ot.fov,zoom:ot.zoom}),mt(ot,$,ce)};function mt(ot,yt,wt){wt===null?ot.matrix.copy(yt.matrixWorld):(ot.matrix.copy(wt.matrixWorld),ot.matrix.invert(),ot.matrix.multiply(yt.matrixWorld)),ot.matrix.decompose(ot.position,ot.quaternion,ot.scale),ot.updateMatrixWorld(!0),ot.projectionMatrix.copy(yt.projectionMatrix),ot.projectionMatrixInverse.copy(yt.projectionMatrixInverse),ot.isPerspectiveCamera&&(ot.fov=kl*2*Math.atan(1/ot.projectionMatrix.elements[5]),ot.zoom=1)}this.getCamera=function(){return $},this.getFoveation=function(){if(!(y===null&&v===null))return d},this.setFoveation=function(ot){d=ot,y!==null&&(y.fixedFoveation=ot),v!==null&&v.fixedFoveation!==void 0&&(v.fixedFoveation=ot)},this.hasDepthSensing=function(){return b.texture!==null},this.getDepthSensingMesh=function(){return b.getMesh($)},this.getCameraTexture=function(ot){return S[ot]};let At=null;function It(ot,yt){if(g=yt.getViewerPose(f||c),_=yt,g!==null){const wt=g.views;v!==null&&(t.setRenderTargetFramebuffer(N,v.framebuffer),t.setRenderTarget(N));let ce=!1;wt.length!==$.cameras.length&&($.cameras.length=0,ce=!0);for(let Rt=0;Rt<wt.length;Rt++){const fe=wt[Rt];let te=null;if(v!==null)te=v.getViewport(fe);else{const Pe=x.getViewSubImage(y,fe);te=Pe.viewport,Rt===0&&(t.setRenderTargetTextures(N,Pe.colorTexture,Pe.depthStencilTexture),t.setRenderTarget(N))}let re=X[Rt];re===void 0&&(re=new Zn,re.layers.enable(Rt),re.viewport=new di,X[Rt]=re),re.matrix.fromArray(fe.transform.matrix),re.matrix.decompose(re.position,re.quaternion,re.scale),re.projectionMatrix.fromArray(fe.projectionMatrix),re.projectionMatrixInverse.copy(re.projectionMatrix).invert(),re.viewport.set(te.x,te.y,te.width,te.height),Rt===0&&($.matrix.copy(re.matrix),$.matrix.decompose($.position,$.quaternion,$.scale)),ce===!0&&$.cameras.push(re)}const Et=s.enabledFeatures;if(Et&&Et.includes("depth-sensing")&&s.depthUsage=="gpu-optimized"&&A){x=e.getBinding();const Rt=x.getDepthInformation(wt[0]);Rt&&Rt.isValid&&Rt.texture&&b.init(Rt,s.renderState)}if(Et&&Et.includes("camera-access")&&A){t.state.unbindTexture(),x=e.getBinding();for(let Rt=0;Rt<wt.length;Rt++){const fe=wt[Rt].camera;if(fe){let te=S[fe];te||(te=new i_,S[fe]=te);const re=x.getCameraImage(fe);te.sourceTexture=re}}}}for(let wt=0;wt<D.length;wt++){const ce=I[wt],Et=D[wt];ce!==null&&Et!==void 0&&Et.update(ce,yt,f||c)}At&&At(ot,yt),yt.detectedPlanes&&e.dispatchEvent({type:"planesdetected",data:yt}),_=null}const Gt=new u_;Gt.setAnimationLoop(It),this.setAnimationLoop=function(ot){At=ot},this.dispose=function(){}}}const EN=new ui,x_=new xe;x_.set(-1,0,0,0,1,0,0,0,1);function MN(r,t){function i(b,S){b.matrixAutoUpdate===!0&&b.updateMatrix(),S.value.copy(b.matrix)}function e(b,S){S.color.getRGB(b.fogColor.value,r_(r)),S.isFog?(b.fogNear.value=S.near,b.fogFar.value=S.far):S.isFogExp2&&(b.fogDensity.value=S.density)}function s(b,S,R,k,N){S.isNodeMaterial?S.uniformsNeedUpdate=!1:S.isMeshBasicMaterial?o(b,S):S.isMeshLambertMaterial?(o(b,S),S.envMap&&(b.envMapIntensity.value=S.envMapIntensity)):S.isMeshToonMaterial?(o(b,S),x(b,S)):S.isMeshPhongMaterial?(o(b,S),g(b,S),S.envMap&&(b.envMapIntensity.value=S.envMapIntensity)):S.isMeshStandardMaterial?(o(b,S),y(b,S),S.isMeshPhysicalMaterial&&v(b,S,N)):S.isMeshMatcapMaterial?(o(b,S),_(b,S)):S.isMeshDepthMaterial?o(b,S):S.isMeshDistanceMaterial?(o(b,S),A(b,S)):S.isMeshNormalMaterial?o(b,S):S.isLineBasicMaterial?(c(b,S),S.isLineDashedMaterial&&h(b,S)):S.isPointsMaterial?d(b,S,R,k):S.isSpriteMaterial?f(b,S):S.isShadowMaterial?(b.color.value.copy(S.color),b.opacity.value=S.opacity):S.isShaderMaterial&&(S.uniformsNeedUpdate=!1)}function o(b,S){b.opacity.value=S.opacity,S.color&&b.diffuse.value.copy(S.color),S.emissive&&b.emissive.value.copy(S.emissive).multiplyScalar(S.emissiveIntensity),S.map&&(b.map.value=S.map,i(S.map,b.mapTransform)),S.alphaMap&&(b.alphaMap.value=S.alphaMap,i(S.alphaMap,b.alphaMapTransform)),S.bumpMap&&(b.bumpMap.value=S.bumpMap,i(S.bumpMap,b.bumpMapTransform),b.bumpScale.value=S.bumpScale,S.side===fn&&(b.bumpScale.value*=-1)),S.normalMap&&(b.normalMap.value=S.normalMap,i(S.normalMap,b.normalMapTransform),b.normalScale.value.copy(S.normalScale),S.side===fn&&b.normalScale.value.negate()),S.displacementMap&&(b.displacementMap.value=S.displacementMap,i(S.displacementMap,b.displacementMapTransform),b.displacementScale.value=S.displacementScale,b.displacementBias.value=S.displacementBias),S.emissiveMap&&(b.emissiveMap.value=S.emissiveMap,i(S.emissiveMap,b.emissiveMapTransform)),S.specularMap&&(b.specularMap.value=S.specularMap,i(S.specularMap,b.specularMapTransform)),S.alphaTest>0&&(b.alphaTest.value=S.alphaTest);const R=t.get(S),k=R.envMap,N=R.envMapRotation;k&&(b.envMap.value=k,b.envMapRotation.value.setFromMatrix4(EN.makeRotationFromEuler(N)).transpose(),k.isCubeTexture&&k.isRenderTargetTexture===!1&&b.envMapRotation.value.premultiply(x_),b.reflectivity.value=S.reflectivity,b.ior.value=S.ior,b.refractionRatio.value=S.refractionRatio),S.lightMap&&(b.lightMap.value=S.lightMap,b.lightMapIntensity.value=S.lightMapIntensity,i(S.lightMap,b.lightMapTransform)),S.aoMap&&(b.aoMap.value=S.aoMap,b.aoMapIntensity.value=S.aoMapIntensity,i(S.aoMap,b.aoMapTransform))}function c(b,S){b.diffuse.value.copy(S.color),b.opacity.value=S.opacity,S.map&&(b.map.value=S.map,i(S.map,b.mapTransform))}function h(b,S){b.dashSize.value=S.dashSize,b.totalSize.value=S.dashSize+S.gapSize,b.scale.value=S.scale}function d(b,S,R,k){b.diffuse.value.copy(S.color),b.opacity.value=S.opacity,b.size.value=S.size*R,b.scale.value=k*.5,S.map&&(b.map.value=S.map,i(S.map,b.uvTransform)),S.alphaMap&&(b.alphaMap.value=S.alphaMap,i(S.alphaMap,b.alphaMapTransform)),S.alphaTest>0&&(b.alphaTest.value=S.alphaTest)}function f(b,S){b.diffuse.value.copy(S.color),b.opacity.value=S.opacity,b.rotation.value=S.rotation,S.map&&(b.map.value=S.map,i(S.map,b.mapTransform)),S.alphaMap&&(b.alphaMap.value=S.alphaMap,i(S.alphaMap,b.alphaMapTransform)),S.alphaTest>0&&(b.alphaTest.value=S.alphaTest)}function g(b,S){b.specular.value.copy(S.specular),b.shininess.value=Math.max(S.shininess,1e-4)}function x(b,S){S.gradientMap&&(b.gradientMap.value=S.gradientMap)}function y(b,S){b.metalness.value=S.metalness,S.metalnessMap&&(b.metalnessMap.value=S.metalnessMap,i(S.metalnessMap,b.metalnessMapTransform)),b.roughness.value=S.roughness,S.roughnessMap&&(b.roughnessMap.value=S.roughnessMap,i(S.roughnessMap,b.roughnessMapTransform)),S.envMap&&(b.envMapIntensity.value=S.envMapIntensity)}function v(b,S,R){b.ior.value=S.ior,S.sheen>0&&(b.sheenColor.value.copy(S.sheenColor).multiplyScalar(S.sheen),b.sheenRoughness.value=S.sheenRoughness,S.sheenColorMap&&(b.sheenColorMap.value=S.sheenColorMap,i(S.sheenColorMap,b.sheenColorMapTransform)),S.sheenRoughnessMap&&(b.sheenRoughnessMap.value=S.sheenRoughnessMap,i(S.sheenRoughnessMap,b.sheenRoughnessMapTransform))),S.clearcoat>0&&(b.clearcoat.value=S.clearcoat,b.clearcoatRoughness.value=S.clearcoatRoughness,S.clearcoatMap&&(b.clearcoatMap.value=S.clearcoatMap,i(S.clearcoatMap,b.clearcoatMapTransform)),S.clearcoatRoughnessMap&&(b.clearcoatRoughnessMap.value=S.clearcoatRoughnessMap,i(S.clearcoatRoughnessMap,b.clearcoatRoughnessMapTransform)),S.clearcoatNormalMap&&(b.clearcoatNormalMap.value=S.clearcoatNormalMap,i(S.clearcoatNormalMap,b.clearcoatNormalMapTransform),b.clearcoatNormalScale.value.copy(S.clearcoatNormalScale),S.side===fn&&b.clearcoatNormalScale.value.negate())),S.dispersion>0&&(b.dispersion.value=S.dispersion),S.retroreflectivity>0&&(b.retroreflectivity.value=S.retroreflectivity),S.iridescence>0&&(b.iridescence.value=S.iridescence,b.iridescenceIOR.value=S.iridescenceIOR,b.iridescenceThicknessMinimum.value=S.iridescenceThicknessRange[0],b.iridescenceThicknessMaximum.value=S.iridescenceThicknessRange[1],S.iridescenceMap&&(b.iridescenceMap.value=S.iridescenceMap,i(S.iridescenceMap,b.iridescenceMapTransform)),S.iridescenceThicknessMap&&(b.iridescenceThicknessMap.value=S.iridescenceThicknessMap,i(S.iridescenceThicknessMap,b.iridescenceThicknessMapTransform))),S.transmission>0&&(b.transmission.value=S.transmission,b.transmissionSamplerMap.value=R.texture,b.transmissionSamplerSize.value.set(R.width,R.height),S.transmissionMap&&(b.transmissionMap.value=S.transmissionMap,i(S.transmissionMap,b.transmissionMapTransform)),b.thickness.value=S.thickness,S.thicknessMap&&(b.thicknessMap.value=S.thicknessMap,i(S.thicknessMap,b.thicknessMapTransform)),b.attenuationDistance.value=S.attenuationDistance,b.attenuationColor.value.copy(S.attenuationColor)),S.anisotropy>0&&(b.anisotropyVector.value.set(S.anisotropy*Math.cos(S.anisotropyRotation),S.anisotropy*Math.sin(S.anisotropyRotation)),S.anisotropyMap&&(b.anisotropyMap.value=S.anisotropyMap,i(S.anisotropyMap,b.anisotropyMapTransform))),b.specularIntensity.value=S.specularIntensity,b.specularColor.value.copy(S.specularColor),S.specularColorMap&&(b.specularColorMap.value=S.specularColorMap,i(S.specularColorMap,b.specularColorMapTransform)),S.specularIntensityMap&&(b.specularIntensityMap.value=S.specularIntensityMap,i(S.specularIntensityMap,b.specularIntensityMapTransform))}function _(b,S){S.matcap&&(b.matcap.value=S.matcap)}function A(b,S){const R=t.get(S).light;b.referencePosition.value.setFromMatrixPosition(R.matrixWorld),b.nearDistance.value=R.shadow.camera.near,b.farDistance.value=R.shadow.camera.far}return{refreshFogUniforms:e,refreshMaterialUniforms:s}}function AN(r,t,i,e){let s={},o={},c=[];const h=r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS);function d(N,D){const I=D.program;e.uniformBlockBinding(N,I)}function f(N,D){let I=s[N.id];I===void 0&&(b(N),I=g(N),s[N.id]=I,N.addEventListener("dispose",R));const F=D.program;e.updateUBOMapping(N,F);const M=t.render.frame;o[N.id]!==M&&(y(N),o[N.id]=M)}function g(N){const D=x();N.__bindingPointIndex=D;const I=r.createBuffer(),F=N.__size,M=N.usage;return r.bindBuffer(r.UNIFORM_BUFFER,I),r.bufferData(r.UNIFORM_BUFFER,F,M),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,D,I),I}function x(){for(let N=0;N<h;N++)if(c.indexOf(N)===-1)return c.push(N),N;return He("WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function y(N){const D=s[N.id],I=N.uniforms,F=N.__cache;r.bindBuffer(r.UNIFORM_BUFFER,D);for(let M=0,w=I.length;M<w;M++){const H=I[M];if(Array.isArray(H))for(let V=0,X=H.length;V<X;V++)v(H[V],M,V,F);else v(H,M,0,F)}r.bindBuffer(r.UNIFORM_BUFFER,null)}function v(N,D,I,F){if(A(N,D,I,F)===!0){const M=N.__offset,w=N.value;if(Array.isArray(w)){let H=0;for(let V=0;V<w.length;V++){const X=w[V],$=S(X);_(X,N.__data,H),typeof X!="number"&&typeof X!="boolean"&&!X.isMatrix3&&!ArrayBuffer.isView(X)&&(H+=$.storage/Float32Array.BYTES_PER_ELEMENT)}}else _(w,N.__data,0);r.bufferSubData(r.UNIFORM_BUFFER,M,N.__data)}}function _(N,D,I){typeof N=="number"||typeof N=="boolean"?D[0]=N:N.isMatrix3?(D[0]=N.elements[0],D[1]=N.elements[1],D[2]=N.elements[2],D[3]=0,D[4]=N.elements[3],D[5]=N.elements[4],D[6]=N.elements[5],D[7]=0,D[8]=N.elements[6],D[9]=N.elements[7],D[10]=N.elements[8],D[11]=0):ArrayBuffer.isView(N)?D.set(new N.constructor(N.buffer,N.byteOffset,D.length)):N.toArray(D,I)}function A(N,D,I,F){const M=N.value,w=D+"_"+I;if(F[w]===void 0)return typeof M=="number"||typeof M=="boolean"?F[w]=M:ArrayBuffer.isView(M)?F[w]=M.slice():F[w]=M.clone(),!0;{const H=F[w];if(typeof M=="number"||typeof M=="boolean"){if(H!==M)return F[w]=M,!0}else{if(ArrayBuffer.isView(M))return!0;if(H.equals(M)===!1)return H.copy(M),!0}}return!1}function b(N){const D=N.uniforms;let I=0;const F=16;for(let w=0,H=D.length;w<H;w++){const V=Array.isArray(D[w])?D[w]:[D[w]];for(let X=0,$=V.length;X<$;X++){const W=V[X],Q=Array.isArray(W.value)?W.value:[W.value];for(let O=0,z=Q.length;O<z;O++){const st=Q[O],et=S(st),dt=I%F,U=dt%et.boundary,nt=dt+U;I+=U,nt!==0&&F-nt<et.storage&&(I+=F-nt),W.__data=new Float32Array(et.storage/Float32Array.BYTES_PER_ELEMENT),W.__offset=I,I+=et.storage}}}const M=I%F;return M>0&&(I+=F-M),N.__size=I,N.__cache={},this}function S(N){const D={boundary:0,storage:0};return typeof N=="number"||typeof N=="boolean"?(D.boundary=4,D.storage=4):N.isVector2?(D.boundary=8,D.storage=8):N.isVector3||N.isColor?(D.boundary=16,D.storage=12):N.isVector4?(D.boundary=16,D.storage=16):N.isMatrix3?(D.boundary=48,D.storage=48):N.isMatrix4?(D.boundary=64,D.storage=64):N.isTexture?de("WebGLRenderer: Texture samplers can not be part of an uniforms group."):ArrayBuffer.isView(N)?(D.boundary=16,D.storage=N.byteLength):de("WebGLRenderer: Unsupported uniform value type.",N),D}function R(N){const D=N.target;D.removeEventListener("dispose",R);const I=c.indexOf(D.__bindingPointIndex);c.splice(I,1),r.deleteBuffer(s[D.id]),delete s[D.id],delete o[D.id]}function k(){for(const N in s)r.deleteBuffer(s[N]);c=[],s={},o={}}return{bind:d,update:f,dispose:k}}const CN=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]);let os=null;function wN(){return os===null&&(os=new ZA(CN,16,16,ur,ms),os.name="DFG_LUT",os.minFilter=qi,os.magFilter=qi,os.wrapS=Vs,os.wrapT=Vs,os.generateMipmaps=!1,os.needsUpdate=!0),os}class y_{constructor(t={}){const{canvas:i=uA(),context:e=null,depth:s=!0,stencil:o=!1,alpha:c=!1,antialias:h=!1,premultipliedAlpha:d=!0,preserveDrawingBuffer:f=!1,powerPreference:g="default",failIfMajorPerformanceCaveat:x=!1,reversedDepthBuffer:y=!1,outputBufferType:v=En}=t;this.isWebGLRenderer=!0;let _;if(e!==null){if(typeof WebGLRenderingContext<"u"&&e instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");_=e.getContextAttributes().alpha}else _=c;const A=v,b=new Set([bm,Tm,_m]),S=new Set([En,ps,Ol,Fl,vm,Sm]),R=new Uint32Array(4),k=new Int32Array(4),N=new Z;let D=null,I=null;const F=[],M=[];let w=null;this.domElement=i,this.debug={checkShaderErrors:!0,diagnostics:{keywords:!1},onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=ds,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const H=this;let V=!1,X=null,$=null,W=null,Q=null;this._outputColorSpace=On;let O=0,z=0,st=null,et=-1,dt=null;const U=new di,nt=new di;let mt=null;const At=new ve(0);let It=0,Gt=i.width,ot=i.height,yt=1,wt=null,ce=null;const Et=new di(0,0,Gt,ot),Zt=new di(0,0,Gt,ot);let me=!1;const Rt=new Nm;let fe=!1,te=!1;const re=new ui,Pe=new Z,ri=new di,pi={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Le=!1;function mi(){return st===null?yt:1}let J=e;function je(C,j){return i.getContext(C,j)}let Xe,B,E,it,ut,gt,Pt,Ut,xt,vt,Nt,jt,Bt,Ot,ne,se,pe,K,Dt,_t,Lt,Xt,Mt;try{const C={alpha:!0,depth:s,stencil:o,antialias:h,premultipliedAlpha:d,preserveDrawingBuffer:f,powerPreference:g,failIfMajorPerformanceCaveat:x};if("setAttribute"in i&&i.setAttribute("data-engine",`three.js r${xm}`),i.addEventListener("webglcontextlost",$e,!1),i.addEventListener("webglcontextrestored",ke,!1),i.addEventListener("webglcontextcreationerror",en,!1),J===null){const j="webgl2";if(J=je(j,C),J===null)throw je(j)?new Error("THREE.WebGLRenderer: Error creating WebGL context with your selected attributes."):new Error("THREE.WebGLRenderer: Error creating WebGL context.")}ie()}catch(C){throw i.removeEventListener("webglcontextlost",$e,!1),i.removeEventListener("webglcontextrestored",ke,!1),i.removeEventListener("webglcontextcreationerror",en,!1),He("WebGLRenderer: "+C.message),C}function ie(){Xe=new wP(J),Xe.init(),Lt=new vN(J,Xe),B=new yP(J,Xe,t,Lt),E=new xN(J,Xe),B.reversedDepthBuffer&&y&&E.buffers.depth.setReversed(!0),$=J.createFramebuffer(),W=J.createFramebuffer(),Q=J.createFramebuffer(),it=new RP(J),ut=new nN,gt=new yN(J,Xe,E,ut,B,Lt,it),Pt=new CP(H),Ut=new L1(J),Xt=new gP(J,Ut),xt=new PP(J,Ut,it,Xt),vt=new LP(J,xt,Ut,Xt,it),K=new DP(J,B,gt),ne=new vP(ut),Nt=new iN(H,Pt,Xe,B,Xt,ne),jt=new MN(H,ut),Bt=new aN,Ot=new hN(Xe),pe=new mP(H,Pt,E,vt,_,d),se=new gN(H,vt,B),Mt=new AN(J,it,B,E),Dt=new xP(J,Xe,it),_t=new NP(J,Xe,it),it.programs=Nt.programs,H.capabilities=B,H.extensions=Xe,H.properties=ut,H.renderLists=Bt,H.shadowMap=se,H.state=E,H.info=it}A!==En&&(w=new UP(A,i.width,i.height,h,s,o));const Jt=new bN(H,J);this.xr=Jt,this.getContext=function(){return J},this.getContextAttributes=function(){return J.getContextAttributes()},this.forceContextLoss=function(){const C=Xe.get("WEBGL_lose_context");C&&C.loseContext()},this.forceContextRestore=function(){const C=Xe.get("WEBGL_lose_context");C&&C.restoreContext()},this.getPixelRatio=function(){return yt},this.setPixelRatio=function(C){C!==void 0&&(yt=C,this.setSize(Gt,ot,!1))},this.getSize=function(C){return C.set(Gt,ot)},this.setSize=function(C,j,ft=!0){if(Jt.isPresenting){de("WebGLRenderer: Can't change size while VR device is presenting.");return}Gt=C,ot=j,i.width=Math.floor(C*yt),i.height=Math.floor(j*yt),ft===!0&&(i.style.width=C+"px",i.style.height=j+"px"),w!==null&&w.setSize(i.width,i.height),this.setViewport(0,0,C,j)},this.getDrawingBufferSize=function(C){return C.set(Gt*yt,ot*yt).floor()},this.setDrawingBufferSize=function(C,j,ft){Gt=C,ot=j,yt=ft,i.width=Math.floor(C*ft),i.height=Math.floor(j*ft),this.setViewport(0,0,C,j)},this.setEffects=function(C){if(A===En){He("WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");return}if(C){for(let j=0;j<C.length;j++)if(C[j].isOutputPass===!0){de("WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");break}}w.setEffects(C||[])},this.getCurrentViewport=function(C){return C.copy(U)},this.getViewport=function(C){return C.copy(Et)},this.setViewport=function(C,j,ft,at){C.isVector4?Et.set(C.x,C.y,C.z,C.w):Et.set(C,j,ft,at),E.viewport(U.copy(Et).multiplyScalar(yt).round())},this.getScissor=function(C){return C.copy(Zt)},this.setScissor=function(C,j,ft,at){C.isVector4?Zt.set(C.x,C.y,C.z,C.w):Zt.set(C,j,ft,at),E.scissor(nt.copy(Zt).multiplyScalar(yt).round())},this.getScissorTest=function(){return me},this.setScissorTest=function(C){E.setScissorTest(me=C)},this.setOpaqueSort=function(C){wt=C},this.setTransparentSort=function(C){ce=C},this.getClearColor=function(C){return C.copy(pe.getClearColor())},this.setClearColor=function(){pe.setClearColor(...arguments)},this.getClearAlpha=function(){return pe.getClearAlpha()},this.setClearAlpha=function(){pe.setClearAlpha(...arguments)},this.clear=function(C=!0,j=!0,ft=!0){let at=0;if(C){let rt=!1;if(st!==null){const Ht=st.texture.format;rt=b.has(Ht)}if(rt){const Ht=st.texture.type,Yt=S.has(Ht),Ft=pe.getClearColor(),Wt=pe.getClearAlpha(),qt=Ft.r,ye=Ft.g,Me=Ft.b;Yt?(R[0]=qt,R[1]=ye,R[2]=Me,R[3]=Wt,J.clearBufferuiv(J.COLOR,0,R)):(k[0]=qt,k[1]=ye,k[2]=Me,k[3]=Wt,J.clearBufferiv(J.COLOR,0,k))}else at|=J.COLOR_BUFFER_BIT}j&&(at|=J.DEPTH_BUFFER_BIT,this.state.buffers.depth.setMask(!0)),ft&&(at|=J.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),at!==0&&J.clear(at)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.setNodesHandler=function(C){C.setRenderer(this),X=C},this.dispose=function(){i.removeEventListener("webglcontextlost",$e,!1),i.removeEventListener("webglcontextrestored",ke,!1),i.removeEventListener("webglcontextcreationerror",en,!1),pe.dispose(),Bt.dispose(),Ot.dispose(),ut.dispose(),Pt.dispose(),vt.dispose(),Xt.dispose(),Mt.dispose(),Nt.dispose(),Jt.dispose(),Jt.removeEventListener("sessionstart",Ti),Jt.removeEventListener("sessionend",Fi),nn.stop()};function $e(C){C.preventDefault(),tv("WebGLRenderer: Context Lost."),V=!0}function ke(){tv("WebGLRenderer: Context Restored."),V=!1;const C=it.autoReset,j=se.enabled,ft=se.autoUpdate,at=se.needsUpdate,rt=se.type;ie(),it.autoReset=C,se.enabled=j,se.autoUpdate=ft,se.needsUpdate=at,se.type=rt}function en(C){He("WebGLRenderer: A WebGL context could not be created. Reason: ",C.statusMessage)}function dn(C){const j=C.target;j.removeEventListener("dispose",dn),To(j)}function To(C){bo(C),ut.remove(C)}function bo(C){const j=ut.get(C).programs;j!==void 0&&(j.forEach(function(ft){Nt.releaseProgram(ft)}),C.isShaderMaterial&&Nt.releaseShaderCache(C))}this.renderBufferDirect=function(C,j,ft,at,rt,Ht){j===null&&(j=pi);const Yt=rt.isMesh&&rt.matrixWorld.determinantAffine()<0,Ft=Ks(C,j,ft,at,rt);E.setMaterial(at,Yt);let Wt=ft.index,qt=1;if(at.wireframe===!0){if(Wt=xt.getWireframeAttribute(ft),Wt===void 0)return;qt=2}const ye=ft.drawRange,Me=ft.attributes.position;let $t=ye.start*qt,ze=(ye.start+ye.count)*qt;Ht!==null&&($t=Math.max($t,Ht.start*qt),ze=Math.min(ze,(Ht.start+Ht.count)*qt)),Wt!==null?($t=Math.max($t,0),ze=Math.min(ze,Wt.count)):Me!=null&&($t=Math.max($t,0),ze=Math.min(ze,Me.count));const oi=ze-$t;if(oi<0||oi===1/0)return;Xt.setup(rt,at,Ft,ft,Wt);let ni,Te=Dt;if(Wt!==null&&(ni=Ut.get(Wt),Te=_t,Te.setIndex(ni)),rt.isMesh)at.wireframe===!0?(E.setLineWidth(at.wireframeLinewidth*mi()),Te.setMode(J.LINES)):Te.setMode(J.TRIANGLES);else if(rt.isLine){let Ei=at.linewidth;Ei===void 0&&(Ei=1),E.setLineWidth(Ei*mi()),rt.isLineSegments?Te.setMode(J.LINES):rt.isLineLoop?Te.setMode(J.LINE_LOOP):Te.setMode(J.LINE_STRIP)}else rt.isPoints?Te.setMode(J.POINTS):rt.isSprite&&Te.setMode(J.TRIANGLES);if(rt.isBatchedMesh)if(Xe.get("WEBGL_multi_draw"))Te.renderMultiDraw(rt._multiDrawStarts,rt._multiDrawCounts,rt._multiDrawCount);else{const Ei=rt._multiDrawStarts,Kt=rt._multiDrawCounts,Ni=rt._multiDrawCount,be=Wt?Ut.get(Wt).bytesPerElement:1,ji=ut.get(at).currentProgram.getUniforms();for(let pn=0;pn<Ni;pn++)ji.setValue(J,"_gl_DrawID",pn),Te.render(Ei[pn]/be,Kt[pn])}else if(rt.isInstancedMesh)Te.renderInstances($t,oi,rt.count);else if(ft.isInstancedBufferGeometry){const Ei=ft._maxInstanceCount!==void 0?ft._maxInstanceCount:1/0,Kt=Math.min(ft.instanceCount,Ei);Te.renderInstances($t,oi,Kt)}else Te.render($t,oi)};function Eo(C,j,ft,at){X!==null&&C.isNodeMaterial&&X.setObject(at,C),fe===!0&&ne.setState(C,ft,!1),C.transparent===!0&&C.side===us&&C.forceSinglePass===!1?(C.side=fn,C.needsUpdate=!0,Ys(C,j,at),C.side=lr,C.needsUpdate=!0,Ys(C,j,at),C.side=us):Ys(C,j,at)}this.compile=function(C,j,ft=null){ft===null&&(ft=C),X!==null&&X.renderStart(C,j,ft),I=Ot.get(ft),I.init(j),M.push(I),ft.traverseVisible(function(rt){rt.isLight&&rt.layers.test(j.layers)&&(I.pushLight(rt),rt.castShadow&&I.pushShadow(rt))}),C!==ft&&C.traverseVisible(function(rt){rt.isLight&&rt.layers.test(j.layers)&&(I.pushLight(rt),rt.castShadow&&I.pushShadow(rt))}),I.setupLights(),X!==null&&X.updateLights(I.state.lightsArray),te=this.localClippingEnabled,fe=ne.init(this.clippingPlanes,te),fe===!0&&ne.setGlobalState(this.clippingPlanes,j),X!==null&&se.render(I.state.shadowsArray,ft,j);const at=new Set;return C.traverse(function(rt){if(!(rt.isMesh||rt.isPoints||rt.isLine||rt.isSprite))return;const Ht=rt.material;if(Ht)if(Array.isArray(Ht))for(let Yt=0;Yt<Ht.length;Yt++){const Ft=Ht[Yt];Eo(Ft,ft,j,rt),at.add(Ft)}else Eo(Ht,ft,j,rt),at.add(Ht)}),I=M.pop(),X!==null&&X.renderEnd(),at},this.compileAsync=function(C,j,ft=null){const at=this.compile(C,j,ft);return new Promise(rt=>{function Ht(){if(at.forEach(function(Yt){const Wt=ut.get(Yt).currentProgram;(Wt===void 0||Wt.isReady())&&at.delete(Yt)}),at.size===0){rt(C);return}setTimeout(Ht,10)}Xe.get("KHR_parallel_shader_compile")!==null?Ht():setTimeout(Ht,10)})};let dr=null;function ts(C){dr&&dr(C)}function Ti(){nn.stop()}function Fi(){nn.start()}const nn=new u_;nn.setAnimationLoop(ts),typeof self<"u"&&nn.setContext(self),this.setAnimationLoop=function(C){dr=C,Jt.setAnimationLoop(C),C===null?nn.stop():nn.start()},Jt.addEventListener("sessionstart",Ti),Jt.addEventListener("sessionend",Fi),this.render=function(C,j){if(j!==void 0&&j.isCamera!==!0){He("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(V===!0)return;X!==null&&X.renderStart(C,j);const ft=Jt.enabled===!0&&Jt.isPresenting===!0,at=w!==null&&(st===null||ft)&&w.begin(H,st);if(C.matrixWorldAutoUpdate===!0&&C.updateMatrixWorld(),j.parent===null&&j.matrixWorldAutoUpdate===!0&&j.updateMatrixWorld(),Jt.enabled===!0&&Jt.isPresenting===!0&&(w===null||w.isCompositing()===!1)&&(Jt.cameraAutoUpdate===!0&&Jt.updateCamera(j),j=Jt.getCamera()),C.isScene===!0&&C.onBeforeRender(H,C,j,st),I=Ot.get(C,M.length),I.init(j),I.state.textureUnits=gt.getTextureUnits(),M.push(I),re.multiplyMatrices(j.projectionMatrix,j.matrixWorldInverse),Rt.setFromProjectionMatrix(re,fs,j.reversedDepth),te=this.localClippingEnabled,fe=ne.init(this.clippingPlanes,te),D=Bt.get(C,F.length),D.init(),F.push(D),Jt.enabled===!0&&Jt.isPresenting===!0){const Yt=H.xr.getDepthSensingMesh();Yt!==null&&Ia(Yt,j,-1/0,H.sortObjects)}Ia(C,j,0,H.sortObjects),D.finish(),X!==null&&X.updateLights(I.state.lightsArray),H.sortObjects===!0&&D.sort(wt,ce),Le=Jt.enabled===!1||Jt.isPresenting===!1||Jt.hasDepthSensing()===!1,Le&&pe.addToRenderList(D,C),this.info.render.frame++,this.info.autoReset===!0&&this.info.reset(),fe===!0&&ne.beginShadows();const rt=I.state.shadowsArray;if(se.render(rt,C,j),fe===!0&&ne.endShadows(),(at&&w.hasRenderPass())===!1){const Yt=D.opaque,Ft=D.transmissive;if(I.setupLights(),j.isArrayCamera){const Wt=j.cameras;if(Ft.length>0)for(let qt=0,ye=Wt.length;qt<ye;qt++){const Me=Wt[qt];Wl(Yt,Ft,C,Me)}Le&&pe.render(C);for(let qt=0,ye=Wt.length;qt<ye;qt++){const Me=Wt[qt];Xl(D,C,Me,Me.viewport)}}else Ft.length>0&&Wl(Yt,Ft,C,j),Le&&pe.render(C),Xl(D,C,j)}st!==null&&z===0&&(gt.updateMultisampleRenderTarget(st),gt.updateRenderTargetMipmap(st)),at&&w.end(H),C.isScene===!0&&C.onAfterRender(H,C,j),Xt.resetDefaultState(),et=-1,dt=null,M.pop(),M.length>0?(I=M[M.length-1],gt.setTextureUnits(I.state.textureUnits),fe===!0&&ne.setGlobalState(H.clippingPlanes,I.state.camera)):I=null,F.pop(),F.length>0?D=F[F.length-1]:D=null,X!==null&&X.renderEnd()};function Ia(C,j,ft,at){if(C.visible===!1)return;if(C.layers.test(j.layers)){if(C.isGroup)ft=C.renderOrder;else if(C.isLOD)C.autoUpdate===!0&&C.update(j);else if(C.isLightProbeGrid)I.pushLightProbeGrid(C);else if(C.isLight)I.pushLight(C),C.castShadow&&I.pushShadow(C);else if(C.isSprite){if(!C.frustumCulled||C.intersectsFrustum(Rt)){at&&ri.setFromMatrixPosition(C.matrixWorld).applyMatrix4(re);const Yt=vt.update(C),Ft=C.material;Ft.visible&&D.push(C,Yt,Ft,ft,ri.z,null,j)}}else if((C.isMesh||C.isLine||C.isPoints)&&(!C.frustumCulled||C.intersectsFrustum(Rt))){const Yt=vt.update(C),Ft=C.material;if(at&&(C.boundingSphere!==void 0?(C.boundingSphere===null&&C.computeBoundingSphere(),ri.copy(C.boundingSphere.center)):(Yt.boundingSphere===null&&Yt.computeBoundingSphere(),ri.copy(Yt.boundingSphere.center)),ri.applyMatrix4(C.matrixWorld).applyMatrix4(re)),Array.isArray(Ft)){const Wt=Yt.groups;for(let qt=0,ye=Wt.length;qt<ye;qt++){const Me=Wt[qt],$t=Ft[Me.materialIndex];$t&&$t.visible&&D.push(C,Yt,$t,ft,ri.z,Me,j)}}else Ft.visible&&D.push(C,Yt,Ft,ft,ri.z,null,j)}}const Ht=C.children;for(let Yt=0,Ft=Ht.length;Yt<Ft;Yt++)Ia(Ht[Yt],j,ft,at)}function Xl(C,j,ft,at){const{opaque:rt,transmissive:Ht,transparent:Yt}=C;I.setupLightsView(ft),fe===!0&&ne.setGlobalState(H.clippingPlanes,ft),at&&E.viewport(U.copy(at)),rt.length>0&&Ua(rt,j,ft),Ht.length>0&&Ua(Ht,j,ft),Yt.length>0&&Ua(Yt,j,ft),E.buffers.depth.setTest(!0),E.buffers.depth.setMask(!0),E.buffers.color.setMask(!0),E.setPolygonOffset(!1)}function Wl(C,j,ft,at){if((ft.isScene===!0?ft.overrideMaterial:null)!==null)return;if(I.state.transmissionRenderTarget[at.id]===void 0){const $t=Xe.has("EXT_color_buffer_half_float")||Xe.has("EXT_color_buffer_float");I.state.transmissionRenderTarget[at.id]=new Qn(1,1,{generateMipmaps:!0,type:$t?ms:En,minFilter:sr,samples:Math.max(4,B.samples),stencilBuffer:o,resolveDepthBuffer:!1,resolveStencilBuffer:!1,storeMultisampledDepthBuffer:!1,storeMultisampledStencilBuffer:!1,colorSpace:Be.workingColorSpace})}const Ht=I.state.transmissionRenderTarget[at.id],Yt=at.viewport||U;Ht.setSize(Yt.z*H.transmissionResolutionScale,Yt.w*H.transmissionResolutionScale);const Ft=H.getRenderTarget(),Wt=H.getActiveCubeFace(),qt=H.getActiveMipmapLevel();H.setRenderTarget(Ht),H.getClearColor(At),It=H.getClearAlpha(),It<1&&H.setClearColor(16777215,.5),H.clear(),Le&&pe.render(ft);const ye=H.toneMapping;H.toneMapping=ds;const Me=at.viewport;if(at.viewport!==void 0&&(at.viewport=void 0),I.setupLightsView(at),fe===!0&&ne.setGlobalState(H.clippingPlanes,at),Ua(C,ft,at),gt.updateMultisampleRenderTarget(Ht),gt.updateRenderTargetMipmap(Ht),Xe.has("WEBGL_multisampled_render_to_texture")===!1){let $t=!1;for(let ze=0,oi=j.length;ze<oi;ze++){const ni=j[ze],{object:Te,geometry:Ei,material:Kt,group:Ni}=ni;if(Kt.side===us&&Te.layers.test(at.layers)){const be=Kt.side;Kt.side=fn,Kt.needsUpdate=!0,js(Te,ft,at,Ei,Kt,Ni),Kt.side=be,Kt.needsUpdate=!0,$t=!0}}$t===!0&&(gt.updateMultisampleRenderTarget(Ht),gt.updateRenderTargetMipmap(Ht))}H.setRenderTarget(Ft,Wt,qt),H.setClearColor(At,It),Me!==void 0&&(at.viewport=Me),H.toneMapping=ye}function Ua(C,j,ft){const at=j.isScene===!0?j.overrideMaterial:null;for(let rt=0,Ht=C.length;rt<Ht;rt++){const Yt=C[rt],{object:Ft,geometry:Wt,group:qt}=Yt;let ye=Yt.material;ye.allowOverride===!0&&at!==null&&(ye=at),Ft.layers.test(ft.layers)&&js(Ft,j,ft,Wt,ye,qt)}}function js(C,j,ft,at,rt,Ht){X!==null&&rt.isNodeMaterial&&X.setObject(C,rt),C.onBeforeRender(H,j,ft,at,rt,Ht),C.modelViewMatrix.multiplyMatrices(ft.matrixWorldInverse,C.matrixWorld),C.normalMatrix.getNormalMatrix(C.modelViewMatrix),rt.onBeforeRender(H,j,ft,at,C,Ht),rt.transparent===!0&&rt.side===us&&rt.forceSinglePass===!1?(rt.side=fn,rt.needsUpdate=!0,H.renderBufferDirect(ft,j,at,rt,C,Ht),rt.side=lr,rt.needsUpdate=!0,H.renderBufferDirect(ft,j,at,rt,C,Ht),rt.side=us):H.renderBufferDirect(ft,j,at,rt,C,Ht),C.onAfterRender(H,j,ft,at,rt,Ht)}function Ys(C,j,ft){j.isScene!==!0&&(j=pi);const at=ut.get(C),rt=I.state.lights,Ht=I.state.shadowsArray,Yt=rt.state.version,Ft=Nt.getParameters(C,rt.state,Ht,j,ft,I.state.lightProbeGridArray),Wt=Nt.getProgramCacheKey(Ft);let qt=at.programs;at.environment=C.isMeshStandardMaterial||C.isMeshLambertMaterial||C.isMeshPhongMaterial?j.environment:null,at.fog=j.fog;const ye=C.isMeshStandardMaterial||C.isMeshLambertMaterial&&!C.envMap||C.isMeshPhongMaterial&&!C.envMap;at.envMap=Pt.get(C.envMap||at.environment,ye),at.envMapRotation=at.environment!==null&&C.envMap===null?j.environmentRotation:C.envMapRotation,qt===void 0&&(C.addEventListener("dispose",dn),qt=new Map,at.programs=qt);let Me=qt.get(Wt);if(Me!==void 0){if(at.currentProgram===Me&&at.lightsStateVersion===Yt)return vs(C,Ft),Me}else Ft.uniforms=Nt.getUniforms(C),X!==null&&C.isNodeMaterial&&X.build(C,ft,Ft),C.onBeforeCompile(Ft,H),Me=Nt.acquireProgram(Ft,Wt),qt.set(Wt,Me),at.uniforms=Ft.uniforms;const $t=at.uniforms;return(!C.isShaderMaterial&&!C.isRawShaderMaterial||C.clipping===!0)&&($t.clippingPlanes=ne.uniform),vs(C,Ft),at.needsLights=ql(C),at.lightsStateVersion=Yt,at.needsLights&&($t.ambientLightColor.value=rt.state.ambient,$t.lightProbe.value=rt.state.probe,$t.sunLights.value=rt.state.sun,$t.sunLightShadows.value=rt.state.sunShadow,$t.directionalLights.value=rt.state.directional,$t.directionalLightShadows.value=rt.state.directionalShadow,$t.spotLights.value=rt.state.spot,$t.spotLightShadows.value=rt.state.spotShadow,$t.rectAreaLights.value=rt.state.rectArea,$t.ltc_1.value=rt.state.rectAreaLTC1,$t.ltc_2.value=rt.state.rectAreaLTC2,$t.pointLights.value=rt.state.point,$t.pointLightShadows.value=rt.state.pointShadow,$t.hemisphereLights.value=rt.state.hemi,$t.sunShadowMatrix.value=rt.state.sunShadowMatrix,$t.sunShadowCascade.value=rt.state.sunShadowCascade,$t.directionalShadowMatrix.value=rt.state.directionalShadowMatrix,$t.spotLightMatrix.value=rt.state.spotLightMatrix,$t.spotLightMap.value=rt.state.spotLightMap,$t.pointShadowMatrix.value=rt.state.pointShadowMatrix),at.lightProbeGrid=I.state.lightProbeGridArray.length>0,at.currentProgram=Me,at.uniformsList=null,Me}function ys(C){if(C.uniformsList===null){const j=C.currentProgram.getUniforms();C.uniformsList=Vu.seqWithValue(j.seq,C.uniforms)}return C.uniformsList}function vs(C,j){const ft=ut.get(C);ft.outputColorSpace=j.outputColorSpace,ft.batching=j.batching,ft.batchingColor=j.batchingColor,ft.instancing=j.instancing,ft.instancingColor=j.instancingColor,ft.instancingMorph=j.instancingMorph,ft.skinning=j.skinning,ft.morphTargets=j.morphTargets,ft.morphNormals=j.morphNormals,ft.morphColors=j.morphColors,ft.morphTargetsCount=j.morphTargetsCount,ft.numClippingPlanes=j.numClippingPlanes,ft.numIntersection=j.numClipIntersection,ft.vertexAlphas=j.vertexAlphas,ft.vertexTangents=j.vertexTangents,ft.toneMapping=j.toneMapping}function Oa(C,j){if(C.length===0)return null;if(C.length===1)return C[0].texture!==null?C[0]:null;N.setFromMatrixPosition(j.matrixWorld);for(let ft=0,at=C.length;ft<at;ft++){const rt=C[ft];if(rt.texture!==null&&rt.boundingBox.containsPoint(N))return rt}return null}function Ks(C,j,ft,at,rt){j.isScene!==!0&&(j=pi),gt.resetTextureUnits();const Ht=j.fog,Yt=at.isMeshStandardMaterial||at.isMeshLambertMaterial||at.isMeshPhongMaterial?j.environment:null,Ft=st===null?H.outputColorSpace:st.isXRRenderTarget===!0?st.texture.colorSpace:Be.workingColorSpace,Wt=at.isMeshStandardMaterial||at.isMeshLambertMaterial&&!at.envMap||at.isMeshPhongMaterial&&!at.envMap,qt=Pt.get(at.envMap||Yt,Wt),ye=at.vertexColors===!0&&!!ft.attributes.color&&ft.attributes.color.itemSize===4,Me=!!ft.attributes.tangent&&(!!at.normalMap||at.anisotropy>0),$t=!!ft.morphAttributes.position,ze=!!ft.morphAttributes.normal,oi=!!ft.morphAttributes.color;let ni=ds;at.toneMapped&&(st===null||st.isXRRenderTarget===!0)&&(ni=H.toneMapping);const Te=ft.morphAttributes.position||ft.morphAttributes.normal||ft.morphAttributes.color,Ei=Te!==void 0?Te.length:0,Kt=ut.get(at),Ni=I.state.lights;if(fe===!0&&(te===!0||C!==dt)){const Qe=C===dt&&at.id===et;ne.setState(at,C,Qe)}let be=!1;at.version===Kt.__version?(Kt.needsLights&&Kt.lightsStateVersion!==Ni.state.version||Kt.outputColorSpace!==Ft||rt.isBatchedMesh&&Kt.batching===!1||!rt.isBatchedMesh&&Kt.batching===!0||rt.isBatchedMesh&&Kt.batchingColor===!0&&rt._colorsTexture===null||rt.isBatchedMesh&&Kt.batchingColor===!1&&rt._colorsTexture!==null||rt.isInstancedMesh&&Kt.instancing===!1||!rt.isInstancedMesh&&Kt.instancing===!0||rt.isSkinnedMesh&&Kt.skinning===!1||!rt.isSkinnedMesh&&Kt.skinning===!0||rt.isInstancedMesh&&Kt.instancingColor===!0&&rt.instanceColor===null||rt.isInstancedMesh&&Kt.instancingColor===!1&&rt.instanceColor!==null||rt.isInstancedMesh&&Kt.instancingMorph===!0&&rt.morphTexture===null||rt.isInstancedMesh&&Kt.instancingMorph===!1&&rt.morphTexture!==null||Kt.envMap!==qt||at.fog===!0&&Kt.fog!==Ht||Kt.numClippingPlanes!==void 0&&(Kt.numClippingPlanes!==ne.numPlanes||Kt.numIntersection!==ne.numIntersection)||Kt.vertexAlphas!==ye||Kt.vertexTangents!==Me||Kt.morphTargets!==$t||Kt.morphNormals!==ze||Kt.morphColors!==oi||Kt.toneMapping!==ni||Kt.morphTargetsCount!==Ei||!!Kt.lightProbeGrid!=I.state.lightProbeGridArray.length>0)&&(be=!0):(be=!0,Kt.__version=at.version);let ji=Kt.currentProgram;be===!0&&(ji=Ys(at,j,rt),X&&at.isNodeMaterial&&X.onUpdateProgram(at,ji,Kt));let pn=!1,Yi=!1,Zs=!1;const We=ji.getUniforms(),hi=Kt.uniforms;if(E.useProgram(ji.program)&&(pn=!0,Yi=!0,Zs=!0),at.id!==et&&(et=at.id,Yi=!0),Kt.needsLights){const Qe=Oa(I.state.lightProbeGridArray,rt);Kt.lightProbeGrid!==Qe&&(Kt.lightProbeGrid=Qe,Yi=!0)}if(pn||dt!==C){E.buffers.depth.getReversed()&&C.reversedDepth!==!0&&(C._reversedDepth=!0,C.updateProjectionMatrix()),We.setValue(J,"projectionMatrix",C.projectionMatrix),We.setValue(J,"viewMatrix",C.matrixWorldInverse);const es=We.map.cameraPosition;es!==void 0&&es.setValue(J,Pe.setFromMatrixPosition(C.matrixWorld)),B.logarithmicDepthBuffer&&We.setValue(J,"logDepthBufFC",2/(Math.log(C.far+1)/Math.LN2)),(at.isMeshPhongMaterial||at.isMeshToonMaterial||at.isMeshLambertMaterial||at.isMeshBasicMaterial||at.isMeshStandardMaterial||at.isShaderMaterial)&&We.setValue(J,"isOrthographic",C.isOrthographicCamera===!0),dt!==C&&(dt=C,Yi=!0,Zs=!0)}if(Kt.needsLights&&(Ni.state.sunShadowMap.length>0&&We.setValue(J,"sunShadowMap",Ni.state.sunShadowMap,gt),Ni.state.directionalShadowMap.length>0&&We.setValue(J,"directionalShadowMap",Ni.state.directionalShadowMap,gt),Ni.state.spotShadowMap.length>0&&We.setValue(J,"spotShadowMap",Ni.state.spotShadowMap,gt),Ni.state.pointShadowMap.length>0&&We.setValue(J,"pointShadowMap",Ni.state.pointShadowMap,gt)),rt.isSkinnedMesh){We.setOptional(J,rt,"bindMatrix"),We.setOptional(J,rt,"bindMatrixInverse");const Qe=rt.skeleton;Qe&&(Qe.boneTexture===null&&Qe.computeBoneTexture(),We.setValue(J,"boneTexture",Qe.boneTexture,gt))}rt.isBatchedMesh&&(We.setOptional(J,rt,"batchingTexture"),We.setValue(J,"batchingTexture",rt._matricesTexture,gt),We.setOptional(J,rt,"batchingIdTexture"),We.setValue(J,"batchingIdTexture",rt._indirectTexture,gt),We.setOptional(J,rt,"batchingColorTexture"),rt._colorsTexture!==null&&We.setValue(J,"batchingColorTexture",rt._colorsTexture,gt));const Mn=ft.morphAttributes;if((Mn.position!==void 0||Mn.normal!==void 0||Mn.color!==void 0)&&K.update(rt,ft,ji),(Yi||Kt.receiveShadow!==rt.receiveShadow)&&(Kt.receiveShadow=rt.receiveShadow,We.setValue(J,"receiveShadow",rt.receiveShadow)),(at.isMeshStandardMaterial||at.isMeshLambertMaterial||at.isMeshPhongMaterial)&&at.envMap===null&&j.environment!==null&&(hi.envMapIntensity.value=j.environmentIntensity),hi.dfgLUT!==void 0&&(hi.dfgLUT.value=wN()),Yi){if(We.setValue(J,"toneMappingExposure",H.toneMappingExposure),Kt.needsLights&&bi(hi,Zs),Ht&&at.fog===!0&&jt.refreshFogUniforms(hi,Ht),jt.refreshMaterialUniforms(hi,at,yt,ot,I.state.transmissionRenderTarget[C.id]),Kt.needsLights&&Kt.lightProbeGrid){const Qe=Kt.lightProbeGrid;hi.probesSH.value=Qe.texture,hi.probesMin.value.copy(Qe.boundingBox.min),hi.probesMax.value.copy(Qe.boundingBox.max),hi.probesResolution.value.copy(Qe.resolution)}Vu.upload(J,ys(Kt),hi,gt)}if(at.isShaderMaterial&&at.uniformsNeedUpdate===!0&&(Vu.upload(J,ys(Kt),hi,gt),at.uniformsNeedUpdate=!1),at.isSpriteMaterial&&We.setValue(J,"center",rt.center),We.setValue(J,"modelViewMatrix",rt.modelViewMatrix),We.setValue(J,"normalMatrix",rt.normalMatrix),We.setValue(J,"modelMatrix",rt.matrixWorld),at.uniformsGroups!==void 0){const Qe=at.uniformsGroups;for(let es=0,Vn=Qe.length;es<Vn;es++){const An=Qe[es];Mt.update(An,ji),Mt.bind(An,ji)}}return ji}function bi(C,j){C.ambientLightColor.needsUpdate=j,C.lightProbe.needsUpdate=j,C.sunLights.needsUpdate=j,C.sunLightShadows.needsUpdate=j,C.directionalLights.needsUpdate=j,C.directionalLightShadows.needsUpdate=j,C.pointLights.needsUpdate=j,C.pointLightShadows.needsUpdate=j,C.spotLights.needsUpdate=j,C.spotLightShadows.needsUpdate=j,C.rectAreaLights.needsUpdate=j,C.hemisphereLights.needsUpdate=j}function ql(C){return C.isMeshLambertMaterial||C.isMeshToonMaterial||C.isMeshPhongMaterial||C.isMeshStandardMaterial||C.isShadowMaterial||C.isShaderMaterial&&C.lights===!0}this.getActiveCubeFace=function(){return O},this.getActiveMipmapLevel=function(){return z},this.getRenderTarget=function(){return st},this.setRenderTargetTextures=function(C,j,ft){const at=ut.get(C);at.__autoAllocateDepthBuffer=C.resolveDepthBuffer===!1,at.__autoAllocateDepthBuffer===!1&&(at.__useRenderToTexture=!1),ut.get(C.texture).__webglTexture=j,ut.get(C.depthTexture).__webglTexture=at.__autoAllocateDepthBuffer?void 0:ft,at.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(C,j){const ft=ut.get(C);ft.__webglFramebuffer=j,ft.__useDefaultFramebuffer=j===void 0},this.setRenderTarget=function(C,j=0,ft=0){st=C,O=j,z=ft;let at=null,rt=!1,Ht=!1;if(C){const Ft=ut.get(C);if(Ft.__useDefaultFramebuffer!==void 0){E.bindFramebuffer(J.FRAMEBUFFER,Ft.__webglFramebuffer),U.copy(C.viewport),nt.copy(C.scissor),mt=C.scissorTest,E.viewport(U),E.scissor(nt),E.setScissorTest(mt),et=-1;return}else if(Ft.__webglFramebuffer===void 0)gt.setupRenderTarget(C);else if(Ft.__hasExternalTextures)gt.rebindTextures(C,ut.get(C.texture).__webglTexture,ut.get(C.depthTexture).__webglTexture);else if(C.depthBuffer){const ye=C.depthTexture;if(Ft.__boundDepthTexture!==ye){if(ye!==null&&ut.has(ye)&&(C.width!==ye.image.width||C.height!==ye.image.height))throw new Error("THREE.WebGLRenderer: Attached DepthTexture is initialized to the incorrect size.");gt.setupDepthRenderbuffer(C)}}const Wt=C.texture;(Wt.isData3DTexture||Wt.isDataArrayTexture||Wt.isCompressedArrayTexture)&&(Ht=!0);const qt=ut.get(C).__webglFramebuffer;C.isWebGLCubeRenderTarget?(Array.isArray(qt[j])?at=qt[j][ft]:at=qt[j],rt=!0):C.samples>0&>.useMultisampledRTT(C)===!1?at=ut.get(C).__webglMultisampledFramebuffer:Array.isArray(qt)?at=qt[ft]:at=qt,U.copy(C.viewport),nt.copy(C.scissor),mt=C.scissorTest}else U.copy(Et).multiplyScalar(yt).floor(),nt.copy(Zt).multiplyScalar(yt).floor(),mt=me;if(ft!==0&&(at=$),E.bindFramebuffer(J.FRAMEBUFFER,at)&&E.drawBuffers(C,at),E.viewport(U),E.scissor(nt),E.setScissorTest(mt),rt){const Ft=ut.get(C.texture);J.framebufferTexture2D(J.FRAMEBUFFER,J.COLOR_ATTACHMENT0,J.TEXTURE_CUBE_MAP_POSITIVE_X+j,Ft.__webglTexture,ft)}else if(Ht){const Ft=j;for(let Wt=0;Wt<C.textures.length;Wt++){const qt=ut.get(C.textures[Wt]);J.framebufferTextureLayer(J.FRAMEBUFFER,J.COLOR_ATTACHMENT0+Wt,qt.__webglTexture,ft,Ft)}}else if(C!==null&&ft!==0){const Ft=ut.get(C.texture);J.framebufferTexture2D(J.FRAMEBUFFER,J.COLOR_ATTACHMENT0,J.TEXTURE_2D,Ft.__webglTexture,ft)}et=-1};function Mo(C){const j=ut.get(C);return(j.__readFormat!==C.format||j.__readType!==C.type)&&(j.__readFormat=C.format,j.__readType=C.type,j.__formatReadable=B.textureFormatReadable(C.format),j.__typeReadable=B.textureTypeReadable(C.type)),j}this.readRenderTargetPixels=function(C,j,ft,at,rt,Ht,Yt,Ft=0){if(!(C&&C.isWebGLRenderTarget)){He("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Wt=ut.get(C).__webglFramebuffer;if(C.isWebGLCubeRenderTarget&&Yt!==void 0&&(Wt=Wt[Yt]),Wt){E.bindFramebuffer(J.FRAMEBUFFER,Wt);try{const qt=C.textures[Ft],ye=qt.format,Me=qt.type;C.textures.length>1&&J.readBuffer(J.COLOR_ATTACHMENT0+Ft);const $t=Mo(qt);if($t.__formatReadable===!1){He("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if($t.__typeReadable===!1){He("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}j>=0&&j<=C.width-at&&ft>=0&&ft<=C.height-rt&&J.readPixels(j,ft,at,rt,Lt.convert(ye),Lt.convert(Me),Ht)}finally{const qt=st!==null?ut.get(st).__webglFramebuffer:null;E.bindFramebuffer(J.FRAMEBUFFER,qt)}}},this.readRenderTargetPixelsAsync=async function(C,j,ft,at,rt,Ht,Yt,Ft=0){if(!(C&&C.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Wt=ut.get(C).__webglFramebuffer;if(C.isWebGLCubeRenderTarget&&Yt!==void 0&&(Wt=Wt[Yt]),Wt)if(j>=0&&j<=C.width-at&&ft>=0&&ft<=C.height-rt){E.bindFramebuffer(J.FRAMEBUFFER,Wt);const qt=C.textures[Ft],ye=qt.format,Me=qt.type;C.textures.length>1&&J.readBuffer(J.COLOR_ATTACHMENT0+Ft);const $t=Mo(qt);if($t.__formatReadable===!1)throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if($t.__typeReadable===!1)throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const ze=J.createBuffer();J.bindBuffer(J.PIXEL_PACK_BUFFER,ze),J.bufferData(J.PIXEL_PACK_BUFFER,Ht.byteLength,J.STREAM_READ),J.readPixels(j,ft,at,rt,Lt.convert(ye),Lt.convert(Me),0),J.bindBuffer(J.PIXEL_PACK_BUFFER,null);const oi=st!==null?ut.get(st).__webglFramebuffer:null;E.bindFramebuffer(J.FRAMEBUFFER,oi);const ni=J.fenceSync(J.SYNC_GPU_COMMANDS_COMPLETE,0);return J.flush(),await hA(J,ni,4),J.bindBuffer(J.PIXEL_PACK_BUFFER,ze),J.getBufferSubData(J.PIXEL_PACK_BUFFER,0,Ht),J.bindBuffer(J.PIXEL_PACK_BUFFER,null),J.deleteBuffer(ze),J.deleteSync(ni),Ht}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(C,j=null,ft=0){const at=Math.pow(2,-ft),rt=Math.floor(C.image.width*at),Ht=Math.floor(C.image.height*at),Yt=j!==null?j.x:0,Ft=j!==null?j.y:0;gt.setTexture2D(C,0),J.copyTexSubImage2D(J.TEXTURE_2D,ft,0,0,Yt,Ft,rt,Ht),E.unbindTexture()},this.copyTextureToTexture=function(C,j,ft=null,at=null,rt=0,Ht=0){let Yt,Ft,Wt,qt,ye,Me,$t,ze,oi;const ni=C.isCompressedTexture?C.mipmaps[Ht]:C.image;if(ft!==null)Yt=ft.max.x-ft.min.x,Ft=ft.max.y-ft.min.y,Wt=ft.isBox3?ft.max.z-ft.min.z:1,qt=ft.min.x,ye=ft.min.y,Me=ft.isBox3?ft.min.z:0;else{const hi=Math.pow(2,-rt);Yt=Math.floor(ni.width*hi),Ft=Math.floor(ni.height*hi),C.isDataArrayTexture?Wt=ni.depth:C.isData3DTexture?Wt=Math.floor(ni.depth*hi):Wt=1,qt=0,ye=0,Me=0}at!==null?($t=at.x,ze=at.y,oi=at.z):($t=0,ze=0,oi=0);const Te=Lt.convert(j.format),Ei=Lt.convert(j.type);let Kt;j.isData3DTexture?(gt.setTexture3D(j,0),Kt=J.TEXTURE_3D):j.isDataArrayTexture||j.isCompressedArrayTexture?(gt.setTexture2DArray(j,0),Kt=J.TEXTURE_2D_ARRAY):(gt.setTexture2D(j,0),Kt=J.TEXTURE_2D),E.activeTexture(J.TEXTURE0),E.pixelStorei(J.UNPACK_FLIP_Y_WEBGL,j.flipY),E.pixelStorei(J.UNPACK_PREMULTIPLY_ALPHA_WEBGL,j.premultiplyAlpha),E.pixelStorei(J.UNPACK_ALIGNMENT,j.unpackAlignment);const Ni=E.getParameter(J.UNPACK_ROW_LENGTH),be=E.getParameter(J.UNPACK_IMAGE_HEIGHT),ji=E.getParameter(J.UNPACK_SKIP_PIXELS),pn=E.getParameter(J.UNPACK_SKIP_ROWS),Yi=E.getParameter(J.UNPACK_SKIP_IMAGES);E.pixelStorei(J.UNPACK_ROW_LENGTH,ni.width),E.pixelStorei(J.UNPACK_IMAGE_HEIGHT,ni.height),E.pixelStorei(J.UNPACK_SKIP_PIXELS,qt),E.pixelStorei(J.UNPACK_SKIP_ROWS,ye),E.pixelStorei(J.UNPACK_SKIP_IMAGES,Me);const Zs=C.isDataArrayTexture||C.isData3DTexture,We=j.isDataArrayTexture||j.isData3DTexture;if(C.isDepthTexture){const hi=ut.get(C),Mn=ut.get(j),Qe=ut.get(hi.__renderTarget),es=ut.get(Mn.__renderTarget);E.bindFramebuffer(J.READ_FRAMEBUFFER,Qe.__webglFramebuffer),E.bindFramebuffer(J.DRAW_FRAMEBUFFER,es.__webglFramebuffer);for(let Vn=0;Vn<Wt;Vn++)Zs&&(J.framebufferTextureLayer(J.READ_FRAMEBUFFER,J.COLOR_ATTACHMENT0,ut.get(C).__webglTexture,rt,Me+Vn),J.framebufferTextureLayer(J.DRAW_FRAMEBUFFER,J.COLOR_ATTACHMENT0,ut.get(j).__webglTexture,Ht,oi+Vn)),J.blitFramebuffer(qt,ye,Yt,Ft,$t,ze,Yt,Ft,J.DEPTH_BUFFER_BIT,J.NEAREST);E.bindFramebuffer(J.READ_FRAMEBUFFER,null),E.bindFramebuffer(J.DRAW_FRAMEBUFFER,null)}else if(rt!==0||C.isRenderTargetTexture||ut.has(C)){const hi=ut.get(C),Mn=ut.get(j);E.bindFramebuffer(J.READ_FRAMEBUFFER,W),E.bindFramebuffer(J.DRAW_FRAMEBUFFER,Q);for(let Qe=0;Qe<Wt;Qe++)Zs?J.framebufferTextureLayer(J.READ_FRAMEBUFFER,J.COLOR_ATTACHMENT0,hi.__webglTexture,rt,Me+Qe):J.framebufferTexture2D(J.READ_FRAMEBUFFER,J.COLOR_ATTACHMENT0,J.TEXTURE_2D,hi.__webglTexture,rt),We?J.framebufferTextureLayer(J.DRAW_FRAMEBUFFER,J.COLOR_ATTACHMENT0,Mn.__webglTexture,Ht,oi+Qe):J.framebufferTexture2D(J.DRAW_FRAMEBUFFER,J.COLOR_ATTACHMENT0,J.TEXTURE_2D,Mn.__webglTexture,Ht),rt!==0?J.blitFramebuffer(qt,ye,Yt,Ft,$t,ze,Yt,Ft,J.COLOR_BUFFER_BIT,J.NEAREST):We?J.copyTexSubImage3D(Kt,Ht,$t,ze,oi+Qe,qt,ye,Yt,Ft):J.copyTexSubImage2D(Kt,Ht,$t,ze,qt,ye,Yt,Ft);E.bindFramebuffer(J.READ_FRAMEBUFFER,null),E.bindFramebuffer(J.DRAW_FRAMEBUFFER,null)}else We?C.isDataTexture||C.isData3DTexture?J.texSubImage3D(Kt,Ht,$t,ze,oi,Yt,Ft,Wt,Te,Ei,ni.data):j.isCompressedArrayTexture?J.compressedTexSubImage3D(Kt,Ht,$t,ze,oi,Yt,Ft,Wt,Te,ni.data):J.texSubImage3D(Kt,Ht,$t,ze,oi,Yt,Ft,Wt,Te,Ei,ni):C.isDataTexture?J.texSubImage2D(J.TEXTURE_2D,Ht,$t,ze,Yt,Ft,Te,Ei,ni.data):C.isCompressedTexture?J.compressedTexSubImage2D(J.TEXTURE_2D,Ht,$t,ze,ni.width,ni.height,Te,ni.data):J.texSubImage2D(J.TEXTURE_2D,Ht,$t,ze,Yt,Ft,Te,Ei,ni);E.pixelStorei(J.UNPACK_ROW_LENGTH,Ni),E.pixelStorei(J.UNPACK_IMAGE_HEIGHT,be),E.pixelStorei(J.UNPACK_SKIP_PIXELS,ji),E.pixelStorei(J.UNPACK_SKIP_ROWS,pn),E.pixelStorei(J.UNPACK_SKIP_IMAGES,Yi),Ht===0&&j.generateMipmaps&&J.generateMipmap(Kt),E.unbindTexture()},this.initRenderTarget=function(C){ut.get(C).__webglFramebuffer===void 0&>.setupRenderTarget(C)},this.initTexture=function(C){C.isCubeTexture?gt.setTextureCube(C,0):C.isData3DTexture?gt.setTexture3D(C,0):C.isDataArrayTexture||C.isCompressedArrayTexture?gt.setTexture2DArray(C,0):gt.setTexture2D(C,0),E.unbindTexture()},this.resetState=function(){O=0,z=0,st=null,E.reset(),Xt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return fs}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;const i=this.getContext();i.drawingBufferColorSpace=Be._getDrawingBufferColorSpace(t),i.unpackColorSpace=Be._getUnpackColorSpace()}}const Fn=180,zn=88,th=5,tS=354,eS=252;function PN(r){return 1+[501,701,901,1101].filter(t=>r>=t).length}function NN(r,t=[],i=th){i=Math.max(1,Math.min(th,Math.floor(i)||1));const e=new Map(r.map((w,H)=>[w.id,H])),s=t.filter(w=>e.has(w.from)&&e.has(w.to)),o=r.map(()=>[]);s.forEach(w=>o[e.get(w.from)].push(e.get(w.to)));let c=0;const h=new Map,d=new Map,f=[],g=new Set,x=[];function y(w){h.set(w,c),d.set(w,c++),f.push(w),g.add(w);for(const H of o[w])h.has(H)?g.has(H)&&d.set(w,Math.min(d.get(w),h.get(H))):(y(H),d.set(w,Math.min(d.get(w),d.get(H))));if(d.get(w)===h.get(w)){const H=[];let V;do V=f.pop(),g.delete(V),H.push(V);while(V!==w);x.push(H.sort((X,$)=>X-$))}}r.forEach((w,H)=>{h.has(H)||y(H)});const v=new Map;x.forEach((w,H)=>w.forEach(V=>v.set(V,H)));const _=x.map(()=>new Set);s.forEach(w=>{const H=v.get(e.get(w.from)),V=v.get(e.get(w.to));H!==V&&_[V].add(H)});const A=new Map;function b(w){return A.has(w)||A.set(w,_[w].size?1+Math.max(...[..._[w]].map(b)):0),A.get(w)}x.forEach((w,H)=>b(H));const S=r.map((w,H)=>H).sort((w,H)=>b(v.get(w))-b(v.get(H))||w-H),R=new Map(S.map((w,H)=>[w,H])),k=r.map((w,H)=>{const V=R.get(H),X=V%i,$=Math.floor(V/i);return{...w,index:H,col:X,row:$,x:42+X*tS,y:64+$*240}}),N=64+Math.max(0,Math.ceil(r.length/i)-1)*240+zn+64;let D=0;const I=s.map((w,H)=>{const V=k[e.get(w.from)],X=k[e.get(w.to)],$=V.y+zn/2,W=X.y+zn/2;let Q,O;if(X.row===V.row&&X.col===V.col+1){const z=V.x+Fn+8,st=X.x-5,et=(z+st)/2;Q=[[z,$],[et,$],[et,W],[st,W]],O={x:et,y:Math.abs($-W)<1?$-23:($+W)/2,width:150}}else if(X.row===V.row+1&&X.col===V.col){const z=V.x+Fn/2,st=V.y+zn+8,et=X.y-6;Q=[[z,st],[z,et]],O={x:z,y:(st+et)/2,width:180}}else if(X.row===V.row+1){const z=V.y+zn+72,st=V.x+Fn+28,et=X.x-28;Q=[[V.x+Fn+8,$],[st,$],[st,z],[et,z],[et,W],[X.x-5,W]],O={x:(st+et)/2,y:z-18,width:180}}else{const z=N+30+D++*64,st=V.x+Fn+28,et=X.x-28;Q=[[V.x+Fn+8,$],[st,$],[st,z],[et,z],[et,W],[X.x-5,W]],O={x:(st+et)/2,y:z-18,width:180}}return{...w,labelText:w.label,index:H,points:Q,label:O,path:Q.map(([z,st],et)=>`${et?"L":"M"}${z},${st}`).join(" ")}}),M=-Math.min(0,...I.map(w=>w.label.x-w.label.width/2-16));return M&&(k.forEach(w=>{w.x+=M}),I.forEach(w=>{w.points=w.points.map(([H,V])=>[H+M,V]),w.label.x+=M,w.path=w.points.map(([H,V],X)=>`${X?"L":"M"}${H},${V}`).join(" ")})),{columns:i,nodes:k,edges:I,width:Math.max(264+Math.max(0,Math.min(i,r.length)-1)*tS+M,...I.map(w=>w.label.x+w.label.width/2+24)),height:N+D*64+(D?40:0)}}function RN({layout:r,selected:t}){const i=Ce.useRef(null),e=Ce.useRef(()=>{});return Ce.useEffect(()=>{const s=i.current;let o;try{o=new y_({alpha:!0,antialias:!0})}catch{return}o.setPixelRatio(Math.min(devicePixelRatio,2)),o.setClearColor(16777215,0),s.appendChild(o.domElement);const c=new JS,h=new Gl(0,r.width,0,-r.height,.1,1e3);h.position.z=500,c.add(new C1(16777215,2));const d=new c_(16777215,1.5);d.position.set(-100,100,300),c.add(d);const f=[];r.nodes.forEach(y=>{const{x:v,y:_}=y,A=Fn,b=zn,S=[v,-_,0,v+A,-_,0,v+A,-_-b,0,v,-_-b,0,v+8,-_-7,-12,v+A+8,-_-7,-12,v+A+8,-_-b-7,-12,v+8,-_-b-7,-12],R=new tn;R.setAttribute("position",new _i(S,3)),R.setIndex([0,3,2,0,2,1,1,2,6,1,6,5,3,7,6,3,6,2]),R.computeVertexNormals();const k=new o_({color:"#e5e5e2",roughness:.9,side:us});c.add(new Hn(R,k)),f.push(R,k);const N=new t1(R),D=new Rm({color:"#b9b9b5"});c.add(new t_(N,D)),f.push(N,D)});function g(){s.clientWidth&&(o.setSize(s.clientWidth,s.clientHeight),o.render(c,h))}e.current=g;const x=new ResizeObserver(g);return x.observe(s),g(),()=>{x.disconnect(),e.current=()=>{},f.forEach(y=>y.dispose()),o.dispose(),o.domElement.remove()}},[r]),Ce.useEffect(()=>e.current(),[t]),L.jsx("div",{className:"architecture-depth",ref:i,"aria-hidden":"true"})}function v_({layout:r,selected:t,onSelect:i,focused:e,activeEdge:s,onEdge:o,trace:c=!1}){const h=Ce.useId().replaceAll(":",""),d=new Set([t]);e&&r.edges.forEach(x=>{const y=r.nodes.find(_=>_.id===x.from),v=r.nodes.find(_=>_.id===x.to);(y.index===t||v.index===t)&&(d.add(y.index),d.add(v.index))});function f(x){var y,v;return!e||x.from===((y=r.nodes[t])==null?void 0:y.id)||x.to===((v=r.nodes[t])==null?void 0:v.id)}function g(x,y){(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),y())}return L.jsxs(L.Fragment,{children:[L.jsx("div",{className:"architecture-tools",children:L.jsxs("span",{children:[c?"ONE ACTION":"ONE MAP"," · ",r.nodes.length," ",c?"STEPS":"COMPONENTS"," · ",r.edges.length," ",c?"TRANSITIONS":"CONNECTIONS"]})}),L.jsx("div",{className:"architecture-frame",role:"region","aria-label":c?"Action diagram":"Architecture map",children:L.jsxs("div",{className:"architecture-map","data-columns":r.columns,style:{aspectRatio:`${r.width} / ${r.height}`,maxWidth:r.width},children:[L.jsx(RN,{layout:r,selected:t}),L.jsxs("svg",{viewBox:`0 0 ${r.width} ${r.height}`,className:"architecture-overlay",role:"group","aria-label":c?"Complete action diagram":"Complete architecture diagram",children:[L.jsxs("defs",{children:[L.jsx("pattern",{id:`${h}-grid`,width:"24",height:"24",patternUnits:"userSpaceOnUse",children:L.jsx("path",{d:"M24 0H0V24",fill:"none",stroke:CS,strokeWidth:".75"})}),L.jsx("marker",{id:`${h}-arrow`,viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:"7",markerHeight:"7",orient:"auto-start-reverse",children:L.jsx("path",{d:"M1,1 L9,5 L1,9",fill:"none",stroke:"context-stroke",strokeWidth:"1.3"})})]}),L.jsx("rect",{width:r.width,height:r.height,fill:`url(#${h}-grid)`,pointerEvents:"none"}),r.edges.map(x=>L.jsxs("g",{className:`architecture-edge${s===x.index?" is-selected":""}`,opacity:f(x)?1:.16,children:[L.jsx("path",{d:x.path,fill:"none",stroke:"currentColor",strokeWidth:"1.3",markerEnd:`url(#${h}-arrow)`}),L.jsx("path",{d:x.path,fill:"none",stroke:"transparent",strokeWidth:"14",onClick:()=>o(x.index),className:"architecture-edge-hit"}),x.label&&L.jsx("foreignObject",{x:x.label.x-x.label.width/2,y:x.label.y-24,width:x.label.width,height:"48",overflow:"visible",children:L.jsx("button",{className:"architecture-edge-label","aria-pressed":s===x.index,onClick:()=>o(x.index),children:L.jsx("span",{children:x.labelText||"Connection"})})})]},x.index)),r.nodes.map(x=>L.jsxs("g",{role:"button",tabIndex:0,"aria-label":`${x.label}, ${c?"step":"component"} ${x.index+1}`,"aria-pressed":t===x.index,onClick:()=>i(x.index),onKeyDown:y=>g(y,()=>i(x.index)),className:`architecture-node${t===x.index?" is-selected":""}`,opacity:!e||d.has(x.index)?1:.38,children:[L.jsx("rect",{x:x.x,y:x.y,width:Fn,height:zn,fill:"var(--paper)",stroke:t===x.index?"var(--accent)":"#9a9a95",strokeWidth:"1"}),L.jsx("foreignObject",{x:x.x+14,y:x.y+11,width:Fn-28,height:zn-20,pointerEvents:"none",children:L.jsxs("div",{className:"architecture-node-copy",children:[L.jsxs("span",{children:[String(x.index+1).padStart(2,"0")," / ",x.kind||"component"]}),L.jsx("strong",{children:x.label})]})})]},x.id))]})]})}),L.jsx("p",{className:"architecture-hint",children:c?"Select a step to inspect its action and supporting files. Arrows show the reported sequence.":"Select a component to inspect it. Select a connection label for its evidence."})]})}function DN(r,t=th){t=Math.max(1,Math.min(th,Math.floor(t)||1));const i=r.map((s,o)=>({id:`step-${o}`,index:o,label:s.title,kind:s.kind||"action",x:40+o%t*eS,y:40+Math.floor(o/t)*180})),e=i.slice(1).map((s,o)=>{const c=i[o],h=s.y+zn/2,d=c.x+Fn+8,f=s.x-6,g=c.y+zn/2,x=c.y+zn+44,y=t===1?[[c.x+Fn/2,c.y+zn+8],[s.x+Fn/2,s.y-6]]:c.y!==s.y?[[d,g],[d+20,g],[d+20,x],[f-20,x],[f-20,h],[f,h]]:[[d,h],[f,h]];return{index:o,from:c.id,to:s.id,points:y,path:y.map(([v,_],A)=>`${A?"L":"M"}${v},${_}`).join(" ")}});return{columns:t,nodes:i,edges:e,width:260+Math.max(0,Math.min(t,i.length)-1)*eS,height:Math.max(1,Math.ceil(i.length/t))*180}}function S_(){const[r,t]=Ce.useState(1);return Ce.useLayoutEffect(()=>{const i=()=>t(PN(window.innerWidth));return i(),window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]),r}function LN({report:r,selected:t,onSelect:i}){const e=S_(),s=Ce.useMemo(()=>DN(r.trace,e),[r.trace,e]);return L.jsx("div",{className:"trace-diagram",children:s.nodes.length?L.jsx(v_,{trace:!0,layout:s,selected:t,onSelect:i,focused:!1,activeEdge:t>0?t-1:null,onEdge:o=>i(o+1)}):L.jsx("p",{className:"trace-empty",children:"No action sequence was established in this report."})})}function Um({label:r,onClick:t}){return L.jsx("button",{type:"button",className:"drawer-close","aria-label":r,autoFocus:!0,onClick:t,children:L.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",focusable:"false",children:L.jsx("path",{d:"m5 5 14 14M5 19 19 5"})})})}function IN(){const r=Ce.useRef(null);return L.jsxs(L.Fragment,{children:[L.jsx("button",{className:"how-to-run-trigger",type:"button","aria-haspopup":"dialog",onClick:()=>r.current.showModal(),children:"HOW TO RUN"}),L.jsxs("dialog",{ref:r,className:"changelog-drawer setup-drawer","aria-labelledby":"setup-title",onClick:t=>{if(t.target===r.current){const i=r.current.getBoundingClientRect();(t.clientX<i.left||t.clientX>i.right||t.clientY<i.top||t.clientY>i.bottom)&&r.current.close()}},children:[L.jsxs("header",{children:[L.jsxs("div",{children:[L.jsx("span",{className:"eyebrow",children:"BLNKFLD / QUICK START"}),L.jsx("h2",{id:"setup-title",children:"Run blnkfld in a project"}),L.jsx("p",{children:"Generate a source-backed README and an interactive architecture view from your own repository."})]}),L.jsx(Um,{label:"Close run instructions",onClick:()=>r.current.close()})]}),L.jsxs("div",{className:"setup-content",children:[L.jsxs("section",{children:[L.jsx("h3",{children:"Before you start"}),L.jsx("p",{children:"Install Node.js 22 or later and sign in to a current Codex or Claude Code CLI. blnkfld uses that existing agent account to read your project and generate its report."})]}),L.jsxs("section",{children:[L.jsx("h3",{children:"01 / Build blnkfld once"}),L.jsx("p",{children:"In your local blnkfld checkout, install dependencies and build the browser interface. Replace the example paths below with your own."}),L.jsx("pre",{children:L.jsx("code",{children:`cd /path/to/blnkfld
|
|
4289
|
-
npm install
|
|
4290
|
-
npm run build`})})]}),L.jsxs("section",{children:[L.jsx("h3",{children:"02 / Run inside your project"}),L.jsx("p",{children:"Open a terminal in the project you want to understand, then call the blnkfld CLI from its checkout."}),L.jsx("pre",{children:L.jsx("code",{children:`cd /path/to/your-project
|
|
4291
|
-
node /path/to/blnkfld/cli/main.mjs .`})}),L.jsx("p",{children:"The final dot means “analyze this directory.” You can also pass another project’s absolute path."})]}),L.jsxs("section",{children:[L.jsx("h3",{children:"03 / Explore your brief"}),L.jsxs("p",{children:["blnkfld validates the source references, saves ",L.jsx("code",{children:".blnkfld/report.json"})," in your project, and opens a local browser preview. Explore System Overview, System Architecture, and the action trace, or open VIEW README to export the text."]}),L.jsxs("p",{children:["Run the command again to refresh the report. Press ",L.jsx("code",{children:"Ctrl+C"})," in the terminal to stop the preview."]})]}),L.jsxs("section",{children:[L.jsx("h3",{children:"Optional flags"}),L.jsxs("dl",{children:[L.jsx("dt",{children:"--agent codex / --agent claude"}),L.jsx("dd",{children:"Choose an agent explicitly. By default, signed-in Codex is preferred, followed by Claude Code."}),L.jsx("dt",{children:"--no-open"}),L.jsx("dd",{children:"Print the preview link without opening a browser."}),L.jsx("dt",{children:"--port 4174"}),L.jsx("dd",{children:"Use a specific local port."}),L.jsx("dt",{children:"--report-only"}),L.jsx("dd",{children:"Save the report without starting a preview."})]})]}),L.jsxs("section",{children:[L.jsx("h3",{children:"Your source and account"}),L.jsxs("p",{children:["Analysis consumes your agent account’s usage allowance and sends source read by the agent to that agent’s configured service. Reports contain source excerpts; decide whether to ignore or version ",L.jsx("code",{children:".blnkfld/"}),". The preview runs locally and does not publish your project."]})]})]})]})]})}const iS=r=>Array.isArray(r)?r:r?[r]:[],ao=r=>iS(r).length?`Sources: ${iS(r).join(", ")}`:"";function UN(r){var s;const t=new Map((r.system||[]).map(o=>[o.id,o.label])),i=[],e=(o,c=[],h=[],d=!1)=>{c=c.filter(Boolean),h=h.filter(Boolean),(c.length||h.length)&&i.push({title:o,paragraphs:c,items:h,ordered:d})};return e("Overview",[r.summary,r.expandedSummary,r.whatItIs,ao(r.summaryEvidence)]),e("Getting started",[r.howToRun,ao(r.runEvidence)]),e("System architecture",[r.systemSummary],(r.system||[]).map(o=>{var c;return`${o.label} — ${o.detail}${(c=o.evidence)!=null&&c.length?` (${ao(o.evidence)})`:""}`})),e("Connections",[],(r.connections||[]).map(o=>{var c;return`${t.get(o.from)||o.from} → ${t.get(o.to)||o.to}: ${o.label||"Source import"}${(c=o.evidence)!=null&&c.length?` (${ao(o.evidence)})`:""}`})),e(r.traceTitle||"Representative action",[r.traceSummary,!((s=r.trace)!=null&&s.length)&&"No action sequence was established in this report."],(r.trace||[]).map(o=>{var c;return`${o.title} — ${o.description}${t.has(o.nodeId)?` Component: ${t.get(o.nodeId)}.`:""}${(c=o.evidence)!=null&&c.length?` ${ao(o.evidence)}`:""}`}),!0),e("Technology stack",[],r.stack||[]),e("Project structure",[],(r.projectMap||[]).map(o=>`${o.path} — ${o.description}`)),e("Data and persistence",[r.dataSummary,ao(r.dataEvidence)]),e("Notes and decisions",[r.matters],r.decisions||[]),e("Source evidence",[],(r.evidence||[]).map(o=>`${o.path}${o.startLine?`:${o.startLine}${o.endLine&&o.endLine!==o.startLine?`–${o.endLine}`:""}`:""} — ${o.claim}`)),e("About this README",[r.analysisKind==="agent"?"Generated from an agent-authored source report. Source references were checked against local files; interpretations and runtime behavior were not independently verified.":r.traceStatus==="curated"?"Based on a curated reference report. The action sequence illustrates documented behavior; it is not a live execution.":"Based on static source analysis. Imports and direct calls do not establish a verified runtime or deployment graph.",[r.sourceLabel&&`Source: ${r.sourceLabel}`,r.generatedAt&&`Report date: ${r.generatedAt}`,Number.isFinite(r.fileCount)&&`Files: ${r.fileCount}`].filter(Boolean).join(" · "),"Prepared with blnkfld."]),{title:r.name||"Repository",subtitle:r.subtitle||"",sections:i}}const El=r=>String(r).replace(/([\\`*_{}\[\]<>#])/g,"\\$1").replace(/^(\s*)([-+]|\d+\.)\s/gm,"$1\\$2 ");function ON(r){const t=[`# ${El(r.title).replace(/\r?\n/g," ")}`];r.subtitle&&t.push(El(r.subtitle));for(const i of r.sections)t.push(`## ${El(i.title).replace(/\r?\n/g," ")}`),t.push(...i.paragraphs.map(El)),i.items.length&&t.push(i.items.map((e,s)=>`${i.ordered?`${s+1}.`:"-"} ${El(e).replace(/\n/g,`
|
|
4288
|
+
}`;class TN{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,i){if(this.texture===null){const e=new i_(t.texture);(t.depthNear!==i.depthNear||t.depthFar!==i.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=e}}getMesh(t){if(this.texture!==null&&this.mesh===null){const i=t.cameras[0].viewport,e=new gs({vertexShader:SN,fragmentShader:_N,uniforms:{depthColor:{value:this.texture},depthWidth:{value:i.z},depthHeight:{value:i.w}}});this.mesh=new Hn(new Vl(20,20),e)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class bN extends hr{constructor(t,i){super();const e=this;let s=null,o=1,c=null,h="local-floor",d=1,f=null,g=null,x=null,y=null,v=null,_=null;const A=typeof XRWebGLBinding<"u",b=new TN,S={},R=i.getContextAttributes();let k=null,N=null;const D=[],I=[],F=new le;let M=null,w=null;const H=new Zn;H.viewport=new di;const V=new Zn;V.viewport=new di;const X=[H,V],$=new P1;let W=null,Q=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(ot){let yt=D[ot];return yt===void 0&&(yt=new Dd,D[ot]=yt),yt.getTargetRaySpace()},this.getControllerGrip=function(ot){let yt=D[ot];return yt===void 0&&(yt=new Dd,D[ot]=yt),yt.getGripSpace()},this.getHand=function(ot){let yt=D[ot];return yt===void 0&&(yt=new Dd,D[ot]=yt),yt.getHandSpace()};function O(ot){const yt=I.indexOf(ot.inputSource);if(yt===-1)return;const wt=D[yt];wt!==void 0&&(wt.update(ot.inputSource,ot.frame,f||c),wt.dispatchEvent({type:ot.type,data:ot.inputSource}))}function z(){s.removeEventListener("select",O),s.removeEventListener("selectstart",O),s.removeEventListener("selectend",O),s.removeEventListener("squeeze",O),s.removeEventListener("squeezestart",O),s.removeEventListener("squeezeend",O),s.removeEventListener("end",z),s.removeEventListener("inputsourceschange",st);for(let ot=0;ot<D.length;ot++){const yt=I[ot];yt!==null&&(I[ot]=null,D[ot].disconnect(yt))}W=null,Q=null,b.reset();for(const ot in S)delete S[ot];if(t.setRenderTarget(k),v=null,y=null,x=null,s=null,N=null,Gt.stop(),e.isPresenting=!1,t.setPixelRatio(M),t.setSize(F.width,F.height,!1),w!==null){const ot=w.camera;ot.fov=w.fov,ot.zoom=w.zoom,ot.updateProjectionMatrix(),w=null}e.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(ot){o=ot,e.isPresenting===!0&&de("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(ot){h=ot,e.isPresenting===!0&&de("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return f||c},this.setReferenceSpace=function(ot){f=ot},this.getBaseLayer=function(){return y!==null?y:v},this.getBinding=function(){return x===null&&A&&(x=new XRWebGLBinding(s,i)),x},this.getFrame=function(){return _},this.getSession=function(){return s},this.setSession=async function(ot){if(s=ot,s!==null){if(k=t.getRenderTarget(),s.addEventListener("select",O),s.addEventListener("selectstart",O),s.addEventListener("selectend",O),s.addEventListener("squeeze",O),s.addEventListener("squeezestart",O),s.addEventListener("squeezeend",O),s.addEventListener("end",z),s.addEventListener("inputsourceschange",st),R.xrCompatible!==!0&&await i.makeXRCompatible(),M=t.getPixelRatio(),t.getSize(F),A&&"createProjectionLayer"in XRWebGLBinding.prototype){let wt=null,ce=null,Et=null;R.depth&&(Et=R.stencil?i.DEPTH24_STENCIL8:i.DEPTH_COMPONENT24,wt=R.stencil?ar:qs,ce=R.stencil?Fl:ps);const Zt={colorFormat:i.RGBA8,depthFormat:Et,scaleFactor:o};x=this.getBinding(),y=x.createProjectionLayer(Zt),s.updateRenderState({layers:[y]}),t.setPixelRatio(1),t.setSize(y.textureWidth,y.textureHeight,!1),N=new Qn(y.textureWidth,y.textureHeight,{format:$n,type:En,depthTexture:new zl(y.textureWidth,y.textureHeight,ce,void 0,void 0,void 0,void 0,void 0,void 0,wt),stencilBuffer:R.stencil,colorSpace:t.outputColorSpace,samples:R.antialias?4:0,resolveDepthBuffer:y.ignoreDepthValues===!1,resolveStencilBuffer:y.ignoreDepthValues===!1,storeMultisampledDepthBuffer:y.ignoreDepthValues===!1,storeMultisampledStencilBuffer:y.ignoreDepthValues===!1})}else{const wt={antialias:R.antialias,alpha:!0,depth:R.depth,stencil:R.stencil,framebufferScaleFactor:o};v=new XRWebGLLayer(s,i,wt),s.updateRenderState({baseLayer:v}),t.setPixelRatio(1),t.setSize(v.framebufferWidth,v.framebufferHeight,!1),N=new Qn(v.framebufferWidth,v.framebufferHeight,{format:$n,type:En,colorSpace:t.outputColorSpace,stencilBuffer:R.stencil,resolveDepthBuffer:v.ignoreDepthValues===!1,resolveStencilBuffer:v.ignoreDepthValues===!1,storeMultisampledDepthBuffer:v.ignoreDepthValues===!1,storeMultisampledStencilBuffer:v.ignoreDepthValues===!1})}N.isXRRenderTarget=!0,this.setFoveation(d),f=null,c=await s.requestReferenceSpace(h),Gt.setContext(s),Gt.start(),e.isPresenting=!0,e.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(s!==null)return s.environmentBlendMode},this.getDepthTexture=function(){return b.getDepthTexture()};function st(ot){for(let yt=0;yt<ot.removed.length;yt++){const wt=ot.removed[yt],ce=I.indexOf(wt);ce>=0&&(I[ce]=null,D[ce].disconnect(wt))}for(let yt=0;yt<ot.added.length;yt++){const wt=ot.added[yt];let ce=I.indexOf(wt);if(ce===-1){for(let Zt=0;Zt<D.length;Zt++)if(Zt>=I.length){I.push(wt),ce=Zt;break}else if(I[Zt]===null){I[Zt]=wt,ce=Zt;break}if(ce===-1)break}const Et=D[ce];Et&&Et.connect(wt)}}const et=new Z,dt=new Z;function U(ot,yt,wt){et.setFromMatrixPosition(yt.matrixWorld),dt.setFromMatrixPosition(wt.matrixWorld);const ce=et.distanceTo(dt),Et=yt.projectionMatrix.elements,Zt=wt.projectionMatrix.elements,me=Et[14]/(Et[10]-1),Rt=Et[14]/(Et[10]+1),fe=(Et[9]+1)/Et[5],te=(Et[9]-1)/Et[5],re=(Et[8]-1)/Et[0],Pe=(Zt[8]+1)/Zt[0],ri=me*re,pi=me*Pe,Le=ce/(-re+Pe),mi=Le*-re;if(yt.matrixWorld.decompose(ot.position,ot.quaternion,ot.scale),ot.translateX(mi),ot.translateZ(Le),ot.matrixWorld.compose(ot.position,ot.quaternion,ot.scale),ot.matrixWorldInverse.copy(ot.matrixWorld).invert(),Et[10]===-1)ot.projectionMatrix.copy(yt.projectionMatrix),ot.projectionMatrixInverse.copy(yt.projectionMatrixInverse);else{const J=me+Le,je=Rt+Le,Xe=ri-mi,B=pi+(ce-mi),E=fe*Rt/je*J,it=te*Rt/je*J;ot.projectionMatrix.makePerspective(Xe,B,E,it,J,je),ot.projectionMatrixInverse.copy(ot.projectionMatrix).invert()}}function nt(ot,yt){yt===null?ot.matrixWorld.copy(ot.matrix):ot.matrixWorld.multiplyMatrices(yt.matrixWorld,ot.matrix),ot.matrixWorldInverse.copy(ot.matrixWorld).invert()}this.updateCamera=function(ot){if(s===null)return;let yt=ot.near,wt=ot.far;b.texture!==null&&(b.depthNear>0&&(yt=b.depthNear),b.depthFar>0&&(wt=b.depthFar)),$.near=V.near=H.near=yt,$.far=V.far=H.far=wt,(W!==$.near||Q!==$.far)&&(s.updateRenderState({depthNear:$.near,depthFar:$.far}),W=$.near,Q=$.far),$.layers.mask=ot.layers.mask|6,H.layers.mask=$.layers.mask&-5,V.layers.mask=$.layers.mask&-3;const ce=ot.parent,Et=$.cameras;nt($,ce);for(let Zt=0;Zt<Et.length;Zt++)nt(Et[Zt],ce);Et.length===2?U($,H,V):$.projectionMatrix.copy(H.projectionMatrix),w===null&&ot.isPerspectiveCamera&&(w={camera:ot,fov:ot.fov,zoom:ot.zoom}),mt(ot,$,ce)};function mt(ot,yt,wt){wt===null?ot.matrix.copy(yt.matrixWorld):(ot.matrix.copy(wt.matrixWorld),ot.matrix.invert(),ot.matrix.multiply(yt.matrixWorld)),ot.matrix.decompose(ot.position,ot.quaternion,ot.scale),ot.updateMatrixWorld(!0),ot.projectionMatrix.copy(yt.projectionMatrix),ot.projectionMatrixInverse.copy(yt.projectionMatrixInverse),ot.isPerspectiveCamera&&(ot.fov=kl*2*Math.atan(1/ot.projectionMatrix.elements[5]),ot.zoom=1)}this.getCamera=function(){return $},this.getFoveation=function(){if(!(y===null&&v===null))return d},this.setFoveation=function(ot){d=ot,y!==null&&(y.fixedFoveation=ot),v!==null&&v.fixedFoveation!==void 0&&(v.fixedFoveation=ot)},this.hasDepthSensing=function(){return b.texture!==null},this.getDepthSensingMesh=function(){return b.getMesh($)},this.getCameraTexture=function(ot){return S[ot]};let At=null;function It(ot,yt){if(g=yt.getViewerPose(f||c),_=yt,g!==null){const wt=g.views;v!==null&&(t.setRenderTargetFramebuffer(N,v.framebuffer),t.setRenderTarget(N));let ce=!1;wt.length!==$.cameras.length&&($.cameras.length=0,ce=!0);for(let Rt=0;Rt<wt.length;Rt++){const fe=wt[Rt];let te=null;if(v!==null)te=v.getViewport(fe);else{const Pe=x.getViewSubImage(y,fe);te=Pe.viewport,Rt===0&&(t.setRenderTargetTextures(N,Pe.colorTexture,Pe.depthStencilTexture),t.setRenderTarget(N))}let re=X[Rt];re===void 0&&(re=new Zn,re.layers.enable(Rt),re.viewport=new di,X[Rt]=re),re.matrix.fromArray(fe.transform.matrix),re.matrix.decompose(re.position,re.quaternion,re.scale),re.projectionMatrix.fromArray(fe.projectionMatrix),re.projectionMatrixInverse.copy(re.projectionMatrix).invert(),re.viewport.set(te.x,te.y,te.width,te.height),Rt===0&&($.matrix.copy(re.matrix),$.matrix.decompose($.position,$.quaternion,$.scale)),ce===!0&&$.cameras.push(re)}const Et=s.enabledFeatures;if(Et&&Et.includes("depth-sensing")&&s.depthUsage=="gpu-optimized"&&A){x=e.getBinding();const Rt=x.getDepthInformation(wt[0]);Rt&&Rt.isValid&&Rt.texture&&b.init(Rt,s.renderState)}if(Et&&Et.includes("camera-access")&&A){t.state.unbindTexture(),x=e.getBinding();for(let Rt=0;Rt<wt.length;Rt++){const fe=wt[Rt].camera;if(fe){let te=S[fe];te||(te=new i_,S[fe]=te);const re=x.getCameraImage(fe);te.sourceTexture=re}}}}for(let wt=0;wt<D.length;wt++){const ce=I[wt],Et=D[wt];ce!==null&&Et!==void 0&&Et.update(ce,yt,f||c)}At&&At(ot,yt),yt.detectedPlanes&&e.dispatchEvent({type:"planesdetected",data:yt}),_=null}const Gt=new u_;Gt.setAnimationLoop(It),this.setAnimationLoop=function(ot){At=ot},this.dispose=function(){}}}const EN=new ui,x_=new xe;x_.set(-1,0,0,0,1,0,0,0,1);function MN(r,t){function i(b,S){b.matrixAutoUpdate===!0&&b.updateMatrix(),S.value.copy(b.matrix)}function e(b,S){S.color.getRGB(b.fogColor.value,r_(r)),S.isFog?(b.fogNear.value=S.near,b.fogFar.value=S.far):S.isFogExp2&&(b.fogDensity.value=S.density)}function s(b,S,R,k,N){S.isNodeMaterial?S.uniformsNeedUpdate=!1:S.isMeshBasicMaterial?o(b,S):S.isMeshLambertMaterial?(o(b,S),S.envMap&&(b.envMapIntensity.value=S.envMapIntensity)):S.isMeshToonMaterial?(o(b,S),x(b,S)):S.isMeshPhongMaterial?(o(b,S),g(b,S),S.envMap&&(b.envMapIntensity.value=S.envMapIntensity)):S.isMeshStandardMaterial?(o(b,S),y(b,S),S.isMeshPhysicalMaterial&&v(b,S,N)):S.isMeshMatcapMaterial?(o(b,S),_(b,S)):S.isMeshDepthMaterial?o(b,S):S.isMeshDistanceMaterial?(o(b,S),A(b,S)):S.isMeshNormalMaterial?o(b,S):S.isLineBasicMaterial?(c(b,S),S.isLineDashedMaterial&&h(b,S)):S.isPointsMaterial?d(b,S,R,k):S.isSpriteMaterial?f(b,S):S.isShadowMaterial?(b.color.value.copy(S.color),b.opacity.value=S.opacity):S.isShaderMaterial&&(S.uniformsNeedUpdate=!1)}function o(b,S){b.opacity.value=S.opacity,S.color&&b.diffuse.value.copy(S.color),S.emissive&&b.emissive.value.copy(S.emissive).multiplyScalar(S.emissiveIntensity),S.map&&(b.map.value=S.map,i(S.map,b.mapTransform)),S.alphaMap&&(b.alphaMap.value=S.alphaMap,i(S.alphaMap,b.alphaMapTransform)),S.bumpMap&&(b.bumpMap.value=S.bumpMap,i(S.bumpMap,b.bumpMapTransform),b.bumpScale.value=S.bumpScale,S.side===fn&&(b.bumpScale.value*=-1)),S.normalMap&&(b.normalMap.value=S.normalMap,i(S.normalMap,b.normalMapTransform),b.normalScale.value.copy(S.normalScale),S.side===fn&&b.normalScale.value.negate()),S.displacementMap&&(b.displacementMap.value=S.displacementMap,i(S.displacementMap,b.displacementMapTransform),b.displacementScale.value=S.displacementScale,b.displacementBias.value=S.displacementBias),S.emissiveMap&&(b.emissiveMap.value=S.emissiveMap,i(S.emissiveMap,b.emissiveMapTransform)),S.specularMap&&(b.specularMap.value=S.specularMap,i(S.specularMap,b.specularMapTransform)),S.alphaTest>0&&(b.alphaTest.value=S.alphaTest);const R=t.get(S),k=R.envMap,N=R.envMapRotation;k&&(b.envMap.value=k,b.envMapRotation.value.setFromMatrix4(EN.makeRotationFromEuler(N)).transpose(),k.isCubeTexture&&k.isRenderTargetTexture===!1&&b.envMapRotation.value.premultiply(x_),b.reflectivity.value=S.reflectivity,b.ior.value=S.ior,b.refractionRatio.value=S.refractionRatio),S.lightMap&&(b.lightMap.value=S.lightMap,b.lightMapIntensity.value=S.lightMapIntensity,i(S.lightMap,b.lightMapTransform)),S.aoMap&&(b.aoMap.value=S.aoMap,b.aoMapIntensity.value=S.aoMapIntensity,i(S.aoMap,b.aoMapTransform))}function c(b,S){b.diffuse.value.copy(S.color),b.opacity.value=S.opacity,S.map&&(b.map.value=S.map,i(S.map,b.mapTransform))}function h(b,S){b.dashSize.value=S.dashSize,b.totalSize.value=S.dashSize+S.gapSize,b.scale.value=S.scale}function d(b,S,R,k){b.diffuse.value.copy(S.color),b.opacity.value=S.opacity,b.size.value=S.size*R,b.scale.value=k*.5,S.map&&(b.map.value=S.map,i(S.map,b.uvTransform)),S.alphaMap&&(b.alphaMap.value=S.alphaMap,i(S.alphaMap,b.alphaMapTransform)),S.alphaTest>0&&(b.alphaTest.value=S.alphaTest)}function f(b,S){b.diffuse.value.copy(S.color),b.opacity.value=S.opacity,b.rotation.value=S.rotation,S.map&&(b.map.value=S.map,i(S.map,b.mapTransform)),S.alphaMap&&(b.alphaMap.value=S.alphaMap,i(S.alphaMap,b.alphaMapTransform)),S.alphaTest>0&&(b.alphaTest.value=S.alphaTest)}function g(b,S){b.specular.value.copy(S.specular),b.shininess.value=Math.max(S.shininess,1e-4)}function x(b,S){S.gradientMap&&(b.gradientMap.value=S.gradientMap)}function y(b,S){b.metalness.value=S.metalness,S.metalnessMap&&(b.metalnessMap.value=S.metalnessMap,i(S.metalnessMap,b.metalnessMapTransform)),b.roughness.value=S.roughness,S.roughnessMap&&(b.roughnessMap.value=S.roughnessMap,i(S.roughnessMap,b.roughnessMapTransform)),S.envMap&&(b.envMapIntensity.value=S.envMapIntensity)}function v(b,S,R){b.ior.value=S.ior,S.sheen>0&&(b.sheenColor.value.copy(S.sheenColor).multiplyScalar(S.sheen),b.sheenRoughness.value=S.sheenRoughness,S.sheenColorMap&&(b.sheenColorMap.value=S.sheenColorMap,i(S.sheenColorMap,b.sheenColorMapTransform)),S.sheenRoughnessMap&&(b.sheenRoughnessMap.value=S.sheenRoughnessMap,i(S.sheenRoughnessMap,b.sheenRoughnessMapTransform))),S.clearcoat>0&&(b.clearcoat.value=S.clearcoat,b.clearcoatRoughness.value=S.clearcoatRoughness,S.clearcoatMap&&(b.clearcoatMap.value=S.clearcoatMap,i(S.clearcoatMap,b.clearcoatMapTransform)),S.clearcoatRoughnessMap&&(b.clearcoatRoughnessMap.value=S.clearcoatRoughnessMap,i(S.clearcoatRoughnessMap,b.clearcoatRoughnessMapTransform)),S.clearcoatNormalMap&&(b.clearcoatNormalMap.value=S.clearcoatNormalMap,i(S.clearcoatNormalMap,b.clearcoatNormalMapTransform),b.clearcoatNormalScale.value.copy(S.clearcoatNormalScale),S.side===fn&&b.clearcoatNormalScale.value.negate())),S.dispersion>0&&(b.dispersion.value=S.dispersion),S.retroreflectivity>0&&(b.retroreflectivity.value=S.retroreflectivity),S.iridescence>0&&(b.iridescence.value=S.iridescence,b.iridescenceIOR.value=S.iridescenceIOR,b.iridescenceThicknessMinimum.value=S.iridescenceThicknessRange[0],b.iridescenceThicknessMaximum.value=S.iridescenceThicknessRange[1],S.iridescenceMap&&(b.iridescenceMap.value=S.iridescenceMap,i(S.iridescenceMap,b.iridescenceMapTransform)),S.iridescenceThicknessMap&&(b.iridescenceThicknessMap.value=S.iridescenceThicknessMap,i(S.iridescenceThicknessMap,b.iridescenceThicknessMapTransform))),S.transmission>0&&(b.transmission.value=S.transmission,b.transmissionSamplerMap.value=R.texture,b.transmissionSamplerSize.value.set(R.width,R.height),S.transmissionMap&&(b.transmissionMap.value=S.transmissionMap,i(S.transmissionMap,b.transmissionMapTransform)),b.thickness.value=S.thickness,S.thicknessMap&&(b.thicknessMap.value=S.thicknessMap,i(S.thicknessMap,b.thicknessMapTransform)),b.attenuationDistance.value=S.attenuationDistance,b.attenuationColor.value.copy(S.attenuationColor)),S.anisotropy>0&&(b.anisotropyVector.value.set(S.anisotropy*Math.cos(S.anisotropyRotation),S.anisotropy*Math.sin(S.anisotropyRotation)),S.anisotropyMap&&(b.anisotropyMap.value=S.anisotropyMap,i(S.anisotropyMap,b.anisotropyMapTransform))),b.specularIntensity.value=S.specularIntensity,b.specularColor.value.copy(S.specularColor),S.specularColorMap&&(b.specularColorMap.value=S.specularColorMap,i(S.specularColorMap,b.specularColorMapTransform)),S.specularIntensityMap&&(b.specularIntensityMap.value=S.specularIntensityMap,i(S.specularIntensityMap,b.specularIntensityMapTransform))}function _(b,S){S.matcap&&(b.matcap.value=S.matcap)}function A(b,S){const R=t.get(S).light;b.referencePosition.value.setFromMatrixPosition(R.matrixWorld),b.nearDistance.value=R.shadow.camera.near,b.farDistance.value=R.shadow.camera.far}return{refreshFogUniforms:e,refreshMaterialUniforms:s}}function AN(r,t,i,e){let s={},o={},c=[];const h=r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS);function d(N,D){const I=D.program;e.uniformBlockBinding(N,I)}function f(N,D){let I=s[N.id];I===void 0&&(b(N),I=g(N),s[N.id]=I,N.addEventListener("dispose",R));const F=D.program;e.updateUBOMapping(N,F);const M=t.render.frame;o[N.id]!==M&&(y(N),o[N.id]=M)}function g(N){const D=x();N.__bindingPointIndex=D;const I=r.createBuffer(),F=N.__size,M=N.usage;return r.bindBuffer(r.UNIFORM_BUFFER,I),r.bufferData(r.UNIFORM_BUFFER,F,M),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,D,I),I}function x(){for(let N=0;N<h;N++)if(c.indexOf(N)===-1)return c.push(N),N;return He("WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function y(N){const D=s[N.id],I=N.uniforms,F=N.__cache;r.bindBuffer(r.UNIFORM_BUFFER,D);for(let M=0,w=I.length;M<w;M++){const H=I[M];if(Array.isArray(H))for(let V=0,X=H.length;V<X;V++)v(H[V],M,V,F);else v(H,M,0,F)}r.bindBuffer(r.UNIFORM_BUFFER,null)}function v(N,D,I,F){if(A(N,D,I,F)===!0){const M=N.__offset,w=N.value;if(Array.isArray(w)){let H=0;for(let V=0;V<w.length;V++){const X=w[V],$=S(X);_(X,N.__data,H),typeof X!="number"&&typeof X!="boolean"&&!X.isMatrix3&&!ArrayBuffer.isView(X)&&(H+=$.storage/Float32Array.BYTES_PER_ELEMENT)}}else _(w,N.__data,0);r.bufferSubData(r.UNIFORM_BUFFER,M,N.__data)}}function _(N,D,I){typeof N=="number"||typeof N=="boolean"?D[0]=N:N.isMatrix3?(D[0]=N.elements[0],D[1]=N.elements[1],D[2]=N.elements[2],D[3]=0,D[4]=N.elements[3],D[5]=N.elements[4],D[6]=N.elements[5],D[7]=0,D[8]=N.elements[6],D[9]=N.elements[7],D[10]=N.elements[8],D[11]=0):ArrayBuffer.isView(N)?D.set(new N.constructor(N.buffer,N.byteOffset,D.length)):N.toArray(D,I)}function A(N,D,I,F){const M=N.value,w=D+"_"+I;if(F[w]===void 0)return typeof M=="number"||typeof M=="boolean"?F[w]=M:ArrayBuffer.isView(M)?F[w]=M.slice():F[w]=M.clone(),!0;{const H=F[w];if(typeof M=="number"||typeof M=="boolean"){if(H!==M)return F[w]=M,!0}else{if(ArrayBuffer.isView(M))return!0;if(H.equals(M)===!1)return H.copy(M),!0}}return!1}function b(N){const D=N.uniforms;let I=0;const F=16;for(let w=0,H=D.length;w<H;w++){const V=Array.isArray(D[w])?D[w]:[D[w]];for(let X=0,$=V.length;X<$;X++){const W=V[X],Q=Array.isArray(W.value)?W.value:[W.value];for(let O=0,z=Q.length;O<z;O++){const st=Q[O],et=S(st),dt=I%F,U=dt%et.boundary,nt=dt+U;I+=U,nt!==0&&F-nt<et.storage&&(I+=F-nt),W.__data=new Float32Array(et.storage/Float32Array.BYTES_PER_ELEMENT),W.__offset=I,I+=et.storage}}}const M=I%F;return M>0&&(I+=F-M),N.__size=I,N.__cache={},this}function S(N){const D={boundary:0,storage:0};return typeof N=="number"||typeof N=="boolean"?(D.boundary=4,D.storage=4):N.isVector2?(D.boundary=8,D.storage=8):N.isVector3||N.isColor?(D.boundary=16,D.storage=12):N.isVector4?(D.boundary=16,D.storage=16):N.isMatrix3?(D.boundary=48,D.storage=48):N.isMatrix4?(D.boundary=64,D.storage=64):N.isTexture?de("WebGLRenderer: Texture samplers can not be part of an uniforms group."):ArrayBuffer.isView(N)?(D.boundary=16,D.storage=N.byteLength):de("WebGLRenderer: Unsupported uniform value type.",N),D}function R(N){const D=N.target;D.removeEventListener("dispose",R);const I=c.indexOf(D.__bindingPointIndex);c.splice(I,1),r.deleteBuffer(s[D.id]),delete s[D.id],delete o[D.id]}function k(){for(const N in s)r.deleteBuffer(s[N]);c=[],s={},o={}}return{bind:d,update:f,dispose:k}}const CN=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,14942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]);let os=null;function wN(){return os===null&&(os=new ZA(CN,16,16,ur,ms),os.name="DFG_LUT",os.minFilter=qi,os.magFilter=qi,os.wrapS=Vs,os.wrapT=Vs,os.generateMipmaps=!1,os.needsUpdate=!0),os}class y_{constructor(t={}){const{canvas:i=uA(),context:e=null,depth:s=!0,stencil:o=!1,alpha:c=!1,antialias:h=!1,premultipliedAlpha:d=!0,preserveDrawingBuffer:f=!1,powerPreference:g="default",failIfMajorPerformanceCaveat:x=!1,reversedDepthBuffer:y=!1,outputBufferType:v=En}=t;this.isWebGLRenderer=!0;let _;if(e!==null){if(typeof WebGLRenderingContext<"u"&&e instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");_=e.getContextAttributes().alpha}else _=c;const A=v,b=new Set([bm,Tm,_m]),S=new Set([En,ps,Ol,Fl,vm,Sm]),R=new Uint32Array(4),k=new Int32Array(4),N=new Z;let D=null,I=null;const F=[],M=[];let w=null;this.domElement=i,this.debug={checkShaderErrors:!0,diagnostics:{keywords:!1},onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=ds,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const H=this;let V=!1,X=null,$=null,W=null,Q=null;this._outputColorSpace=On;let O=0,z=0,st=null,et=-1,dt=null;const U=new di,nt=new di;let mt=null;const At=new ve(0);let It=0,Gt=i.width,ot=i.height,yt=1,wt=null,ce=null;const Et=new di(0,0,Gt,ot),Zt=new di(0,0,Gt,ot);let me=!1;const Rt=new Nm;let fe=!1,te=!1;const re=new ui,Pe=new Z,ri=new di,pi={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Le=!1;function mi(){return st===null?yt:1}let J=e;function je(C,j){return i.getContext(C,j)}let Xe,B,E,it,ut,gt,Pt,Ut,xt,vt,Nt,jt,Bt,Ot,ne,se,pe,K,Dt,_t,Lt,Xt,Mt;try{const C={alpha:!0,depth:s,stencil:o,antialias:h,premultipliedAlpha:d,preserveDrawingBuffer:f,powerPreference:g,failIfMajorPerformanceCaveat:x};if("setAttribute"in i&&i.setAttribute("data-engine",`three.js r${xm}`),i.addEventListener("webglcontextlost",$e,!1),i.addEventListener("webglcontextrestored",ke,!1),i.addEventListener("webglcontextcreationerror",en,!1),J===null){const j="webgl2";if(J=je(j,C),J===null)throw je(j)?new Error("THREE.WebGLRenderer: Error creating WebGL context with your selected attributes."):new Error("THREE.WebGLRenderer: Error creating WebGL context.")}ie()}catch(C){throw i.removeEventListener("webglcontextlost",$e,!1),i.removeEventListener("webglcontextrestored",ke,!1),i.removeEventListener("webglcontextcreationerror",en,!1),He("WebGLRenderer: "+C.message),C}function ie(){Xe=new wP(J),Xe.init(),Lt=new vN(J,Xe),B=new yP(J,Xe,t,Lt),E=new xN(J,Xe),B.reversedDepthBuffer&&y&&E.buffers.depth.setReversed(!0),$=J.createFramebuffer(),W=J.createFramebuffer(),Q=J.createFramebuffer(),it=new RP(J),ut=new nN,gt=new yN(J,Xe,E,ut,B,Lt,it),Pt=new CP(H),Ut=new L1(J),Xt=new gP(J,Ut),xt=new PP(J,Ut,it,Xt),vt=new LP(J,xt,Ut,Xt,it),K=new DP(J,B,gt),ne=new vP(ut),Nt=new iN(H,Pt,Xe,B,Xt,ne),jt=new MN(H,ut),Bt=new aN,Ot=new hN(Xe),pe=new mP(H,Pt,E,vt,_,d),se=new gN(H,vt,B),Mt=new AN(J,it,B,E),Dt=new xP(J,Xe,it),_t=new NP(J,Xe,it),it.programs=Nt.programs,H.capabilities=B,H.extensions=Xe,H.properties=ut,H.renderLists=Bt,H.shadowMap=se,H.state=E,H.info=it}A!==En&&(w=new UP(A,i.width,i.height,h,s,o));const Jt=new bN(H,J);this.xr=Jt,this.getContext=function(){return J},this.getContextAttributes=function(){return J.getContextAttributes()},this.forceContextLoss=function(){const C=Xe.get("WEBGL_lose_context");C&&C.loseContext()},this.forceContextRestore=function(){const C=Xe.get("WEBGL_lose_context");C&&C.restoreContext()},this.getPixelRatio=function(){return yt},this.setPixelRatio=function(C){C!==void 0&&(yt=C,this.setSize(Gt,ot,!1))},this.getSize=function(C){return C.set(Gt,ot)},this.setSize=function(C,j,ft=!0){if(Jt.isPresenting){de("WebGLRenderer: Can't change size while VR device is presenting.");return}Gt=C,ot=j,i.width=Math.floor(C*yt),i.height=Math.floor(j*yt),ft===!0&&(i.style.width=C+"px",i.style.height=j+"px"),w!==null&&w.setSize(i.width,i.height),this.setViewport(0,0,C,j)},this.getDrawingBufferSize=function(C){return C.set(Gt*yt,ot*yt).floor()},this.setDrawingBufferSize=function(C,j,ft){Gt=C,ot=j,yt=ft,i.width=Math.floor(C*ft),i.height=Math.floor(j*ft),this.setViewport(0,0,C,j)},this.setEffects=function(C){if(A===En){He("WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");return}if(C){for(let j=0;j<C.length;j++)if(C[j].isOutputPass===!0){de("WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");break}}w.setEffects(C||[])},this.getCurrentViewport=function(C){return C.copy(U)},this.getViewport=function(C){return C.copy(Et)},this.setViewport=function(C,j,ft,at){C.isVector4?Et.set(C.x,C.y,C.z,C.w):Et.set(C,j,ft,at),E.viewport(U.copy(Et).multiplyScalar(yt).round())},this.getScissor=function(C){return C.copy(Zt)},this.setScissor=function(C,j,ft,at){C.isVector4?Zt.set(C.x,C.y,C.z,C.w):Zt.set(C,j,ft,at),E.scissor(nt.copy(Zt).multiplyScalar(yt).round())},this.getScissorTest=function(){return me},this.setScissorTest=function(C){E.setScissorTest(me=C)},this.setOpaqueSort=function(C){wt=C},this.setTransparentSort=function(C){ce=C},this.getClearColor=function(C){return C.copy(pe.getClearColor())},this.setClearColor=function(){pe.setClearColor(...arguments)},this.getClearAlpha=function(){return pe.getClearAlpha()},this.setClearAlpha=function(){pe.setClearAlpha(...arguments)},this.clear=function(C=!0,j=!0,ft=!0){let at=0;if(C){let rt=!1;if(st!==null){const Ht=st.texture.format;rt=b.has(Ht)}if(rt){const Ht=st.texture.type,Yt=S.has(Ht),Ft=pe.getClearColor(),Wt=pe.getClearAlpha(),qt=Ft.r,ye=Ft.g,Me=Ft.b;Yt?(R[0]=qt,R[1]=ye,R[2]=Me,R[3]=Wt,J.clearBufferuiv(J.COLOR,0,R)):(k[0]=qt,k[1]=ye,k[2]=Me,k[3]=Wt,J.clearBufferiv(J.COLOR,0,k))}else at|=J.COLOR_BUFFER_BIT}j&&(at|=J.DEPTH_BUFFER_BIT,this.state.buffers.depth.setMask(!0)),ft&&(at|=J.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),at!==0&&J.clear(at)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.setNodesHandler=function(C){C.setRenderer(this),X=C},this.dispose=function(){i.removeEventListener("webglcontextlost",$e,!1),i.removeEventListener("webglcontextrestored",ke,!1),i.removeEventListener("webglcontextcreationerror",en,!1),pe.dispose(),Bt.dispose(),Ot.dispose(),ut.dispose(),Pt.dispose(),vt.dispose(),Xt.dispose(),Mt.dispose(),Nt.dispose(),Jt.dispose(),Jt.removeEventListener("sessionstart",Ti),Jt.removeEventListener("sessionend",Fi),nn.stop()};function $e(C){C.preventDefault(),tv("WebGLRenderer: Context Lost."),V=!0}function ke(){tv("WebGLRenderer: Context Restored."),V=!1;const C=it.autoReset,j=se.enabled,ft=se.autoUpdate,at=se.needsUpdate,rt=se.type;ie(),it.autoReset=C,se.enabled=j,se.autoUpdate=ft,se.needsUpdate=at,se.type=rt}function en(C){He("WebGLRenderer: A WebGL context could not be created. Reason: ",C.statusMessage)}function dn(C){const j=C.target;j.removeEventListener("dispose",dn),To(j)}function To(C){bo(C),ut.remove(C)}function bo(C){const j=ut.get(C).programs;j!==void 0&&(j.forEach(function(ft){Nt.releaseProgram(ft)}),C.isShaderMaterial&&Nt.releaseShaderCache(C))}this.renderBufferDirect=function(C,j,ft,at,rt,Ht){j===null&&(j=pi);const Yt=rt.isMesh&&rt.matrixWorld.determinantAffine()<0,Ft=Ks(C,j,ft,at,rt);E.setMaterial(at,Yt);let Wt=ft.index,qt=1;if(at.wireframe===!0){if(Wt=xt.getWireframeAttribute(ft),Wt===void 0)return;qt=2}const ye=ft.drawRange,Me=ft.attributes.position;let $t=ye.start*qt,ze=(ye.start+ye.count)*qt;Ht!==null&&($t=Math.max($t,Ht.start*qt),ze=Math.min(ze,(Ht.start+Ht.count)*qt)),Wt!==null?($t=Math.max($t,0),ze=Math.min(ze,Wt.count)):Me!=null&&($t=Math.max($t,0),ze=Math.min(ze,Me.count));const oi=ze-$t;if(oi<0||oi===1/0)return;Xt.setup(rt,at,Ft,ft,Wt);let ni,Te=Dt;if(Wt!==null&&(ni=Ut.get(Wt),Te=_t,Te.setIndex(ni)),rt.isMesh)at.wireframe===!0?(E.setLineWidth(at.wireframeLinewidth*mi()),Te.setMode(J.LINES)):Te.setMode(J.TRIANGLES);else if(rt.isLine){let Ei=at.linewidth;Ei===void 0&&(Ei=1),E.setLineWidth(Ei*mi()),rt.isLineSegments?Te.setMode(J.LINES):rt.isLineLoop?Te.setMode(J.LINE_LOOP):Te.setMode(J.LINE_STRIP)}else rt.isPoints?Te.setMode(J.POINTS):rt.isSprite&&Te.setMode(J.TRIANGLES);if(rt.isBatchedMesh)if(Xe.get("WEBGL_multi_draw"))Te.renderMultiDraw(rt._multiDrawStarts,rt._multiDrawCounts,rt._multiDrawCount);else{const Ei=rt._multiDrawStarts,Kt=rt._multiDrawCounts,Ni=rt._multiDrawCount,be=Wt?Ut.get(Wt).bytesPerElement:1,ji=ut.get(at).currentProgram.getUniforms();for(let pn=0;pn<Ni;pn++)ji.setValue(J,"_gl_DrawID",pn),Te.render(Ei[pn]/be,Kt[pn])}else if(rt.isInstancedMesh)Te.renderInstances($t,oi,rt.count);else if(ft.isInstancedBufferGeometry){const Ei=ft._maxInstanceCount!==void 0?ft._maxInstanceCount:1/0,Kt=Math.min(ft.instanceCount,Ei);Te.renderInstances($t,oi,Kt)}else Te.render($t,oi)};function Eo(C,j,ft,at){X!==null&&C.isNodeMaterial&&X.setObject(at,C),fe===!0&&ne.setState(C,ft,!1),C.transparent===!0&&C.side===us&&C.forceSinglePass===!1?(C.side=fn,C.needsUpdate=!0,Ys(C,j,at),C.side=lr,C.needsUpdate=!0,Ys(C,j,at),C.side=us):Ys(C,j,at)}this.compile=function(C,j,ft=null){ft===null&&(ft=C),X!==null&&X.renderStart(C,j,ft),I=Ot.get(ft),I.init(j),M.push(I),ft.traverseVisible(function(rt){rt.isLight&&rt.layers.test(j.layers)&&(I.pushLight(rt),rt.castShadow&&I.pushShadow(rt))}),C!==ft&&C.traverseVisible(function(rt){rt.isLight&&rt.layers.test(j.layers)&&(I.pushLight(rt),rt.castShadow&&I.pushShadow(rt))}),I.setupLights(),X!==null&&X.updateLights(I.state.lightsArray),te=this.localClippingEnabled,fe=ne.init(this.clippingPlanes,te),fe===!0&&ne.setGlobalState(this.clippingPlanes,j),X!==null&&se.render(I.state.shadowsArray,ft,j);const at=new Set;return C.traverse(function(rt){if(!(rt.isMesh||rt.isPoints||rt.isLine||rt.isSprite))return;const Ht=rt.material;if(Ht)if(Array.isArray(Ht))for(let Yt=0;Yt<Ht.length;Yt++){const Ft=Ht[Yt];Eo(Ft,ft,j,rt),at.add(Ft)}else Eo(Ht,ft,j,rt),at.add(Ht)}),I=M.pop(),X!==null&&X.renderEnd(),at},this.compileAsync=function(C,j,ft=null){const at=this.compile(C,j,ft);return new Promise(rt=>{function Ht(){if(at.forEach(function(Yt){const Wt=ut.get(Yt).currentProgram;(Wt===void 0||Wt.isReady())&&at.delete(Yt)}),at.size===0){rt(C);return}setTimeout(Ht,10)}Xe.get("KHR_parallel_shader_compile")!==null?Ht():setTimeout(Ht,10)})};let dr=null;function ts(C){dr&&dr(C)}function Ti(){nn.stop()}function Fi(){nn.start()}const nn=new u_;nn.setAnimationLoop(ts),typeof self<"u"&&nn.setContext(self),this.setAnimationLoop=function(C){dr=C,Jt.setAnimationLoop(C),C===null?nn.stop():nn.start()},Jt.addEventListener("sessionstart",Ti),Jt.addEventListener("sessionend",Fi),this.render=function(C,j){if(j!==void 0&&j.isCamera!==!0){He("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(V===!0)return;X!==null&&X.renderStart(C,j);const ft=Jt.enabled===!0&&Jt.isPresenting===!0,at=w!==null&&(st===null||ft)&&w.begin(H,st);if(C.matrixWorldAutoUpdate===!0&&C.updateMatrixWorld(),j.parent===null&&j.matrixWorldAutoUpdate===!0&&j.updateMatrixWorld(),Jt.enabled===!0&&Jt.isPresenting===!0&&(w===null||w.isCompositing()===!1)&&(Jt.cameraAutoUpdate===!0&&Jt.updateCamera(j),j=Jt.getCamera()),C.isScene===!0&&C.onBeforeRender(H,C,j,st),I=Ot.get(C,M.length),I.init(j),I.state.textureUnits=gt.getTextureUnits(),M.push(I),re.multiplyMatrices(j.projectionMatrix,j.matrixWorldInverse),Rt.setFromProjectionMatrix(re,fs,j.reversedDepth),te=this.localClippingEnabled,fe=ne.init(this.clippingPlanes,te),D=Bt.get(C,F.length),D.init(),F.push(D),Jt.enabled===!0&&Jt.isPresenting===!0){const Yt=H.xr.getDepthSensingMesh();Yt!==null&&Ia(Yt,j,-1/0,H.sortObjects)}Ia(C,j,0,H.sortObjects),D.finish(),X!==null&&X.updateLights(I.state.lightsArray),H.sortObjects===!0&&D.sort(wt,ce),Le=Jt.enabled===!1||Jt.isPresenting===!1||Jt.hasDepthSensing()===!1,Le&&pe.addToRenderList(D,C),this.info.render.frame++,this.info.autoReset===!0&&this.info.reset(),fe===!0&&ne.beginShadows();const rt=I.state.shadowsArray;if(se.render(rt,C,j),fe===!0&&ne.endShadows(),(at&&w.hasRenderPass())===!1){const Yt=D.opaque,Ft=D.transmissive;if(I.setupLights(),j.isArrayCamera){const Wt=j.cameras;if(Ft.length>0)for(let qt=0,ye=Wt.length;qt<ye;qt++){const Me=Wt[qt];Wl(Yt,Ft,C,Me)}Le&&pe.render(C);for(let qt=0,ye=Wt.length;qt<ye;qt++){const Me=Wt[qt];Xl(D,C,Me,Me.viewport)}}else Ft.length>0&&Wl(Yt,Ft,C,j),Le&&pe.render(C),Xl(D,C,j)}st!==null&&z===0&&(gt.updateMultisampleRenderTarget(st),gt.updateRenderTargetMipmap(st)),at&&w.end(H),C.isScene===!0&&C.onAfterRender(H,C,j),Xt.resetDefaultState(),et=-1,dt=null,M.pop(),M.length>0?(I=M[M.length-1],gt.setTextureUnits(I.state.textureUnits),fe===!0&&ne.setGlobalState(H.clippingPlanes,I.state.camera)):I=null,F.pop(),F.length>0?D=F[F.length-1]:D=null,X!==null&&X.renderEnd()};function Ia(C,j,ft,at){if(C.visible===!1)return;if(C.layers.test(j.layers)){if(C.isGroup)ft=C.renderOrder;else if(C.isLOD)C.autoUpdate===!0&&C.update(j);else if(C.isLightProbeGrid)I.pushLightProbeGrid(C);else if(C.isLight)I.pushLight(C),C.castShadow&&I.pushShadow(C);else if(C.isSprite){if(!C.frustumCulled||C.intersectsFrustum(Rt)){at&&ri.setFromMatrixPosition(C.matrixWorld).applyMatrix4(re);const Yt=vt.update(C),Ft=C.material;Ft.visible&&D.push(C,Yt,Ft,ft,ri.z,null,j)}}else if((C.isMesh||C.isLine||C.isPoints)&&(!C.frustumCulled||C.intersectsFrustum(Rt))){const Yt=vt.update(C),Ft=C.material;if(at&&(C.boundingSphere!==void 0?(C.boundingSphere===null&&C.computeBoundingSphere(),ri.copy(C.boundingSphere.center)):(Yt.boundingSphere===null&&Yt.computeBoundingSphere(),ri.copy(Yt.boundingSphere.center)),ri.applyMatrix4(C.matrixWorld).applyMatrix4(re)),Array.isArray(Ft)){const Wt=Yt.groups;for(let qt=0,ye=Wt.length;qt<ye;qt++){const Me=Wt[qt],$t=Ft[Me.materialIndex];$t&&$t.visible&&D.push(C,Yt,$t,ft,ri.z,Me,j)}}else Ft.visible&&D.push(C,Yt,Ft,ft,ri.z,null,j)}}const Ht=C.children;for(let Yt=0,Ft=Ht.length;Yt<Ft;Yt++)Ia(Ht[Yt],j,ft,at)}function Xl(C,j,ft,at){const{opaque:rt,transmissive:Ht,transparent:Yt}=C;I.setupLightsView(ft),fe===!0&&ne.setGlobalState(H.clippingPlanes,ft),at&&E.viewport(U.copy(at)),rt.length>0&&Ua(rt,j,ft),Ht.length>0&&Ua(Ht,j,ft),Yt.length>0&&Ua(Yt,j,ft),E.buffers.depth.setTest(!0),E.buffers.depth.setMask(!0),E.buffers.color.setMask(!0),E.setPolygonOffset(!1)}function Wl(C,j,ft,at){if((ft.isScene===!0?ft.overrideMaterial:null)!==null)return;if(I.state.transmissionRenderTarget[at.id]===void 0){const $t=Xe.has("EXT_color_buffer_half_float")||Xe.has("EXT_color_buffer_float");I.state.transmissionRenderTarget[at.id]=new Qn(1,1,{generateMipmaps:!0,type:$t?ms:En,minFilter:sr,samples:Math.max(4,B.samples),stencilBuffer:o,resolveDepthBuffer:!1,resolveStencilBuffer:!1,storeMultisampledDepthBuffer:!1,storeMultisampledStencilBuffer:!1,colorSpace:Be.workingColorSpace})}const Ht=I.state.transmissionRenderTarget[at.id],Yt=at.viewport||U;Ht.setSize(Yt.z*H.transmissionResolutionScale,Yt.w*H.transmissionResolutionScale);const Ft=H.getRenderTarget(),Wt=H.getActiveCubeFace(),qt=H.getActiveMipmapLevel();H.setRenderTarget(Ht),H.getClearColor(At),It=H.getClearAlpha(),It<1&&H.setClearColor(16777215,.5),H.clear(),Le&&pe.render(ft);const ye=H.toneMapping;H.toneMapping=ds;const Me=at.viewport;if(at.viewport!==void 0&&(at.viewport=void 0),I.setupLightsView(at),fe===!0&&ne.setGlobalState(H.clippingPlanes,at),Ua(C,ft,at),gt.updateMultisampleRenderTarget(Ht),gt.updateRenderTargetMipmap(Ht),Xe.has("WEBGL_multisampled_render_to_texture")===!1){let $t=!1;for(let ze=0,oi=j.length;ze<oi;ze++){const ni=j[ze],{object:Te,geometry:Ei,material:Kt,group:Ni}=ni;if(Kt.side===us&&Te.layers.test(at.layers)){const be=Kt.side;Kt.side=fn,Kt.needsUpdate=!0,js(Te,ft,at,Ei,Kt,Ni),Kt.side=be,Kt.needsUpdate=!0,$t=!0}}$t===!0&&(gt.updateMultisampleRenderTarget(Ht),gt.updateRenderTargetMipmap(Ht))}H.setRenderTarget(Ft,Wt,qt),H.setClearColor(At,It),Me!==void 0&&(at.viewport=Me),H.toneMapping=ye}function Ua(C,j,ft){const at=j.isScene===!0?j.overrideMaterial:null;for(let rt=0,Ht=C.length;rt<Ht;rt++){const Yt=C[rt],{object:Ft,geometry:Wt,group:qt}=Yt;let ye=Yt.material;ye.allowOverride===!0&&at!==null&&(ye=at),Ft.layers.test(ft.layers)&&js(Ft,j,ft,Wt,ye,qt)}}function js(C,j,ft,at,rt,Ht){X!==null&&rt.isNodeMaterial&&X.setObject(C,rt),C.onBeforeRender(H,j,ft,at,rt,Ht),C.modelViewMatrix.multiplyMatrices(ft.matrixWorldInverse,C.matrixWorld),C.normalMatrix.getNormalMatrix(C.modelViewMatrix),rt.onBeforeRender(H,j,ft,at,C,Ht),rt.transparent===!0&&rt.side===us&&rt.forceSinglePass===!1?(rt.side=fn,rt.needsUpdate=!0,H.renderBufferDirect(ft,j,at,rt,C,Ht),rt.side=lr,rt.needsUpdate=!0,H.renderBufferDirect(ft,j,at,rt,C,Ht),rt.side=us):H.renderBufferDirect(ft,j,at,rt,C,Ht),C.onAfterRender(H,j,ft,at,rt,Ht)}function Ys(C,j,ft){j.isScene!==!0&&(j=pi);const at=ut.get(C),rt=I.state.lights,Ht=I.state.shadowsArray,Yt=rt.state.version,Ft=Nt.getParameters(C,rt.state,Ht,j,ft,I.state.lightProbeGridArray),Wt=Nt.getProgramCacheKey(Ft);let qt=at.programs;at.environment=C.isMeshStandardMaterial||C.isMeshLambertMaterial||C.isMeshPhongMaterial?j.environment:null,at.fog=j.fog;const ye=C.isMeshStandardMaterial||C.isMeshLambertMaterial&&!C.envMap||C.isMeshPhongMaterial&&!C.envMap;at.envMap=Pt.get(C.envMap||at.environment,ye),at.envMapRotation=at.environment!==null&&C.envMap===null?j.environmentRotation:C.envMapRotation,qt===void 0&&(C.addEventListener("dispose",dn),qt=new Map,at.programs=qt);let Me=qt.get(Wt);if(Me!==void 0){if(at.currentProgram===Me&&at.lightsStateVersion===Yt)return vs(C,Ft),Me}else Ft.uniforms=Nt.getUniforms(C),X!==null&&C.isNodeMaterial&&X.build(C,ft,Ft),C.onBeforeCompile(Ft,H),Me=Nt.acquireProgram(Ft,Wt),qt.set(Wt,Me),at.uniforms=Ft.uniforms;const $t=at.uniforms;return(!C.isShaderMaterial&&!C.isRawShaderMaterial||C.clipping===!0)&&($t.clippingPlanes=ne.uniform),vs(C,Ft),at.needsLights=ql(C),at.lightsStateVersion=Yt,at.needsLights&&($t.ambientLightColor.value=rt.state.ambient,$t.lightProbe.value=rt.state.probe,$t.sunLights.value=rt.state.sun,$t.sunLightShadows.value=rt.state.sunShadow,$t.directionalLights.value=rt.state.directional,$t.directionalLightShadows.value=rt.state.directionalShadow,$t.spotLights.value=rt.state.spot,$t.spotLightShadows.value=rt.state.spotShadow,$t.rectAreaLights.value=rt.state.rectArea,$t.ltc_1.value=rt.state.rectAreaLTC1,$t.ltc_2.value=rt.state.rectAreaLTC2,$t.pointLights.value=rt.state.point,$t.pointLightShadows.value=rt.state.pointShadow,$t.hemisphereLights.value=rt.state.hemi,$t.sunShadowMatrix.value=rt.state.sunShadowMatrix,$t.sunShadowCascade.value=rt.state.sunShadowCascade,$t.directionalShadowMatrix.value=rt.state.directionalShadowMatrix,$t.spotLightMatrix.value=rt.state.spotLightMatrix,$t.spotLightMap.value=rt.state.spotLightMap,$t.pointShadowMatrix.value=rt.state.pointShadowMatrix),at.lightProbeGrid=I.state.lightProbeGridArray.length>0,at.currentProgram=Me,at.uniformsList=null,Me}function ys(C){if(C.uniformsList===null){const j=C.currentProgram.getUniforms();C.uniformsList=Vu.seqWithValue(j.seq,C.uniforms)}return C.uniformsList}function vs(C,j){const ft=ut.get(C);ft.outputColorSpace=j.outputColorSpace,ft.batching=j.batching,ft.batchingColor=j.batchingColor,ft.instancing=j.instancing,ft.instancingColor=j.instancingColor,ft.instancingMorph=j.instancingMorph,ft.skinning=j.skinning,ft.morphTargets=j.morphTargets,ft.morphNormals=j.morphNormals,ft.morphColors=j.morphColors,ft.morphTargetsCount=j.morphTargetsCount,ft.numClippingPlanes=j.numClippingPlanes,ft.numIntersection=j.numClipIntersection,ft.vertexAlphas=j.vertexAlphas,ft.vertexTangents=j.vertexTangents,ft.toneMapping=j.toneMapping}function Oa(C,j){if(C.length===0)return null;if(C.length===1)return C[0].texture!==null?C[0]:null;N.setFromMatrixPosition(j.matrixWorld);for(let ft=0,at=C.length;ft<at;ft++){const rt=C[ft];if(rt.texture!==null&&rt.boundingBox.containsPoint(N))return rt}return null}function Ks(C,j,ft,at,rt){j.isScene!==!0&&(j=pi),gt.resetTextureUnits();const Ht=j.fog,Yt=at.isMeshStandardMaterial||at.isMeshLambertMaterial||at.isMeshPhongMaterial?j.environment:null,Ft=st===null?H.outputColorSpace:st.isXRRenderTarget===!0?st.texture.colorSpace:Be.workingColorSpace,Wt=at.isMeshStandardMaterial||at.isMeshLambertMaterial&&!at.envMap||at.isMeshPhongMaterial&&!at.envMap,qt=Pt.get(at.envMap||Yt,Wt),ye=at.vertexColors===!0&&!!ft.attributes.color&&ft.attributes.color.itemSize===4,Me=!!ft.attributes.tangent&&(!!at.normalMap||at.anisotropy>0),$t=!!ft.morphAttributes.position,ze=!!ft.morphAttributes.normal,oi=!!ft.morphAttributes.color;let ni=ds;at.toneMapped&&(st===null||st.isXRRenderTarget===!0)&&(ni=H.toneMapping);const Te=ft.morphAttributes.position||ft.morphAttributes.normal||ft.morphAttributes.color,Ei=Te!==void 0?Te.length:0,Kt=ut.get(at),Ni=I.state.lights;if(fe===!0&&(te===!0||C!==dt)){const Qe=C===dt&&at.id===et;ne.setState(at,C,Qe)}let be=!1;at.version===Kt.__version?(Kt.needsLights&&Kt.lightsStateVersion!==Ni.state.version||Kt.outputColorSpace!==Ft||rt.isBatchedMesh&&Kt.batching===!1||!rt.isBatchedMesh&&Kt.batching===!0||rt.isBatchedMesh&&Kt.batchingColor===!0&&rt._colorsTexture===null||rt.isBatchedMesh&&Kt.batchingColor===!1&&rt._colorsTexture!==null||rt.isInstancedMesh&&Kt.instancing===!1||!rt.isInstancedMesh&&Kt.instancing===!0||rt.isSkinnedMesh&&Kt.skinning===!1||!rt.isSkinnedMesh&&Kt.skinning===!0||rt.isInstancedMesh&&Kt.instancingColor===!0&&rt.instanceColor===null||rt.isInstancedMesh&&Kt.instancingColor===!1&&rt.instanceColor!==null||rt.isInstancedMesh&&Kt.instancingMorph===!0&&rt.morphTexture===null||rt.isInstancedMesh&&Kt.instancingMorph===!1&&rt.morphTexture!==null||Kt.envMap!==qt||at.fog===!0&&Kt.fog!==Ht||Kt.numClippingPlanes!==void 0&&(Kt.numClippingPlanes!==ne.numPlanes||Kt.numIntersection!==ne.numIntersection)||Kt.vertexAlphas!==ye||Kt.vertexTangents!==Me||Kt.morphTargets!==$t||Kt.morphNormals!==ze||Kt.morphColors!==oi||Kt.toneMapping!==ni||Kt.morphTargetsCount!==Ei||!!Kt.lightProbeGrid!=I.state.lightProbeGridArray.length>0)&&(be=!0):(be=!0,Kt.__version=at.version);let ji=Kt.currentProgram;be===!0&&(ji=Ys(at,j,rt),X&&at.isNodeMaterial&&X.onUpdateProgram(at,ji,Kt));let pn=!1,Yi=!1,Zs=!1;const We=ji.getUniforms(),hi=Kt.uniforms;if(E.useProgram(ji.program)&&(pn=!0,Yi=!0,Zs=!0),at.id!==et&&(et=at.id,Yi=!0),Kt.needsLights){const Qe=Oa(I.state.lightProbeGridArray,rt);Kt.lightProbeGrid!==Qe&&(Kt.lightProbeGrid=Qe,Yi=!0)}if(pn||dt!==C){E.buffers.depth.getReversed()&&C.reversedDepth!==!0&&(C._reversedDepth=!0,C.updateProjectionMatrix()),We.setValue(J,"projectionMatrix",C.projectionMatrix),We.setValue(J,"viewMatrix",C.matrixWorldInverse);const es=We.map.cameraPosition;es!==void 0&&es.setValue(J,Pe.setFromMatrixPosition(C.matrixWorld)),B.logarithmicDepthBuffer&&We.setValue(J,"logDepthBufFC",2/(Math.log(C.far+1)/Math.LN2)),(at.isMeshPhongMaterial||at.isMeshToonMaterial||at.isMeshLambertMaterial||at.isMeshBasicMaterial||at.isMeshStandardMaterial||at.isShaderMaterial)&&We.setValue(J,"isOrthographic",C.isOrthographicCamera===!0),dt!==C&&(dt=C,Yi=!0,Zs=!0)}if(Kt.needsLights&&(Ni.state.sunShadowMap.length>0&&We.setValue(J,"sunShadowMap",Ni.state.sunShadowMap,gt),Ni.state.directionalShadowMap.length>0&&We.setValue(J,"directionalShadowMap",Ni.state.directionalShadowMap,gt),Ni.state.spotShadowMap.length>0&&We.setValue(J,"spotShadowMap",Ni.state.spotShadowMap,gt),Ni.state.pointShadowMap.length>0&&We.setValue(J,"pointShadowMap",Ni.state.pointShadowMap,gt)),rt.isSkinnedMesh){We.setOptional(J,rt,"bindMatrix"),We.setOptional(J,rt,"bindMatrixInverse");const Qe=rt.skeleton;Qe&&(Qe.boneTexture===null&&Qe.computeBoneTexture(),We.setValue(J,"boneTexture",Qe.boneTexture,gt))}rt.isBatchedMesh&&(We.setOptional(J,rt,"batchingTexture"),We.setValue(J,"batchingTexture",rt._matricesTexture,gt),We.setOptional(J,rt,"batchingIdTexture"),We.setValue(J,"batchingIdTexture",rt._indirectTexture,gt),We.setOptional(J,rt,"batchingColorTexture"),rt._colorsTexture!==null&&We.setValue(J,"batchingColorTexture",rt._colorsTexture,gt));const Mn=ft.morphAttributes;if((Mn.position!==void 0||Mn.normal!==void 0||Mn.color!==void 0)&&K.update(rt,ft,ji),(Yi||Kt.receiveShadow!==rt.receiveShadow)&&(Kt.receiveShadow=rt.receiveShadow,We.setValue(J,"receiveShadow",rt.receiveShadow)),(at.isMeshStandardMaterial||at.isMeshLambertMaterial||at.isMeshPhongMaterial)&&at.envMap===null&&j.environment!==null&&(hi.envMapIntensity.value=j.environmentIntensity),hi.dfgLUT!==void 0&&(hi.dfgLUT.value=wN()),Yi){if(We.setValue(J,"toneMappingExposure",H.toneMappingExposure),Kt.needsLights&&bi(hi,Zs),Ht&&at.fog===!0&&jt.refreshFogUniforms(hi,Ht),jt.refreshMaterialUniforms(hi,at,yt,ot,I.state.transmissionRenderTarget[C.id]),Kt.needsLights&&Kt.lightProbeGrid){const Qe=Kt.lightProbeGrid;hi.probesSH.value=Qe.texture,hi.probesMin.value.copy(Qe.boundingBox.min),hi.probesMax.value.copy(Qe.boundingBox.max),hi.probesResolution.value.copy(Qe.resolution)}Vu.upload(J,ys(Kt),hi,gt)}if(at.isShaderMaterial&&at.uniformsNeedUpdate===!0&&(Vu.upload(J,ys(Kt),hi,gt),at.uniformsNeedUpdate=!1),at.isSpriteMaterial&&We.setValue(J,"center",rt.center),We.setValue(J,"modelViewMatrix",rt.modelViewMatrix),We.setValue(J,"normalMatrix",rt.normalMatrix),We.setValue(J,"modelMatrix",rt.matrixWorld),at.uniformsGroups!==void 0){const Qe=at.uniformsGroups;for(let es=0,Vn=Qe.length;es<Vn;es++){const An=Qe[es];Mt.update(An,ji),Mt.bind(An,ji)}}return ji}function bi(C,j){C.ambientLightColor.needsUpdate=j,C.lightProbe.needsUpdate=j,C.sunLights.needsUpdate=j,C.sunLightShadows.needsUpdate=j,C.directionalLights.needsUpdate=j,C.directionalLightShadows.needsUpdate=j,C.pointLights.needsUpdate=j,C.pointLightShadows.needsUpdate=j,C.spotLights.needsUpdate=j,C.spotLightShadows.needsUpdate=j,C.rectAreaLights.needsUpdate=j,C.hemisphereLights.needsUpdate=j}function ql(C){return C.isMeshLambertMaterial||C.isMeshToonMaterial||C.isMeshPhongMaterial||C.isMeshStandardMaterial||C.isShadowMaterial||C.isShaderMaterial&&C.lights===!0}this.getActiveCubeFace=function(){return O},this.getActiveMipmapLevel=function(){return z},this.getRenderTarget=function(){return st},this.setRenderTargetTextures=function(C,j,ft){const at=ut.get(C);at.__autoAllocateDepthBuffer=C.resolveDepthBuffer===!1,at.__autoAllocateDepthBuffer===!1&&(at.__useRenderToTexture=!1),ut.get(C.texture).__webglTexture=j,ut.get(C.depthTexture).__webglTexture=at.__autoAllocateDepthBuffer?void 0:ft,at.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(C,j){const ft=ut.get(C);ft.__webglFramebuffer=j,ft.__useDefaultFramebuffer=j===void 0},this.setRenderTarget=function(C,j=0,ft=0){st=C,O=j,z=ft;let at=null,rt=!1,Ht=!1;if(C){const Ft=ut.get(C);if(Ft.__useDefaultFramebuffer!==void 0){E.bindFramebuffer(J.FRAMEBUFFER,Ft.__webglFramebuffer),U.copy(C.viewport),nt.copy(C.scissor),mt=C.scissorTest,E.viewport(U),E.scissor(nt),E.setScissorTest(mt),et=-1;return}else if(Ft.__webglFramebuffer===void 0)gt.setupRenderTarget(C);else if(Ft.__hasExternalTextures)gt.rebindTextures(C,ut.get(C.texture).__webglTexture,ut.get(C.depthTexture).__webglTexture);else if(C.depthBuffer){const ye=C.depthTexture;if(Ft.__boundDepthTexture!==ye){if(ye!==null&&ut.has(ye)&&(C.width!==ye.image.width||C.height!==ye.image.height))throw new Error("THREE.WebGLRenderer: Attached DepthTexture is initialized to the incorrect size.");gt.setupDepthRenderbuffer(C)}}const Wt=C.texture;(Wt.isData3DTexture||Wt.isDataArrayTexture||Wt.isCompressedArrayTexture)&&(Ht=!0);const qt=ut.get(C).__webglFramebuffer;C.isWebGLCubeRenderTarget?(Array.isArray(qt[j])?at=qt[j][ft]:at=qt[j],rt=!0):C.samples>0&>.useMultisampledRTT(C)===!1?at=ut.get(C).__webglMultisampledFramebuffer:Array.isArray(qt)?at=qt[ft]:at=qt,U.copy(C.viewport),nt.copy(C.scissor),mt=C.scissorTest}else U.copy(Et).multiplyScalar(yt).floor(),nt.copy(Zt).multiplyScalar(yt).floor(),mt=me;if(ft!==0&&(at=$),E.bindFramebuffer(J.FRAMEBUFFER,at)&&E.drawBuffers(C,at),E.viewport(U),E.scissor(nt),E.setScissorTest(mt),rt){const Ft=ut.get(C.texture);J.framebufferTexture2D(J.FRAMEBUFFER,J.COLOR_ATTACHMENT0,J.TEXTURE_CUBE_MAP_POSITIVE_X+j,Ft.__webglTexture,ft)}else if(Ht){const Ft=j;for(let Wt=0;Wt<C.textures.length;Wt++){const qt=ut.get(C.textures[Wt]);J.framebufferTextureLayer(J.FRAMEBUFFER,J.COLOR_ATTACHMENT0+Wt,qt.__webglTexture,ft,Ft)}}else if(C!==null&&ft!==0){const Ft=ut.get(C.texture);J.framebufferTexture2D(J.FRAMEBUFFER,J.COLOR_ATTACHMENT0,J.TEXTURE_2D,Ft.__webglTexture,ft)}et=-1};function Mo(C){const j=ut.get(C);return(j.__readFormat!==C.format||j.__readType!==C.type)&&(j.__readFormat=C.format,j.__readType=C.type,j.__formatReadable=B.textureFormatReadable(C.format),j.__typeReadable=B.textureTypeReadable(C.type)),j}this.readRenderTargetPixels=function(C,j,ft,at,rt,Ht,Yt,Ft=0){if(!(C&&C.isWebGLRenderTarget)){He("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Wt=ut.get(C).__webglFramebuffer;if(C.isWebGLCubeRenderTarget&&Yt!==void 0&&(Wt=Wt[Yt]),Wt){E.bindFramebuffer(J.FRAMEBUFFER,Wt);try{const qt=C.textures[Ft],ye=qt.format,Me=qt.type;C.textures.length>1&&J.readBuffer(J.COLOR_ATTACHMENT0+Ft);const $t=Mo(qt);if($t.__formatReadable===!1){He("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if($t.__typeReadable===!1){He("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}j>=0&&j<=C.width-at&&ft>=0&&ft<=C.height-rt&&J.readPixels(j,ft,at,rt,Lt.convert(ye),Lt.convert(Me),Ht)}finally{const qt=st!==null?ut.get(st).__webglFramebuffer:null;E.bindFramebuffer(J.FRAMEBUFFER,qt)}}},this.readRenderTargetPixelsAsync=async function(C,j,ft,at,rt,Ht,Yt,Ft=0){if(!(C&&C.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Wt=ut.get(C).__webglFramebuffer;if(C.isWebGLCubeRenderTarget&&Yt!==void 0&&(Wt=Wt[Yt]),Wt)if(j>=0&&j<=C.width-at&&ft>=0&&ft<=C.height-rt){E.bindFramebuffer(J.FRAMEBUFFER,Wt);const qt=C.textures[Ft],ye=qt.format,Me=qt.type;C.textures.length>1&&J.readBuffer(J.COLOR_ATTACHMENT0+Ft);const $t=Mo(qt);if($t.__formatReadable===!1)throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if($t.__typeReadable===!1)throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const ze=J.createBuffer();J.bindBuffer(J.PIXEL_PACK_BUFFER,ze),J.bufferData(J.PIXEL_PACK_BUFFER,Ht.byteLength,J.STREAM_READ),J.readPixels(j,ft,at,rt,Lt.convert(ye),Lt.convert(Me),0),J.bindBuffer(J.PIXEL_PACK_BUFFER,null);const oi=st!==null?ut.get(st).__webglFramebuffer:null;E.bindFramebuffer(J.FRAMEBUFFER,oi);const ni=J.fenceSync(J.SYNC_GPU_COMMANDS_COMPLETE,0);return J.flush(),await hA(J,ni,4),J.bindBuffer(J.PIXEL_PACK_BUFFER,ze),J.getBufferSubData(J.PIXEL_PACK_BUFFER,0,Ht),J.bindBuffer(J.PIXEL_PACK_BUFFER,null),J.deleteBuffer(ze),J.deleteSync(ni),Ht}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(C,j=null,ft=0){const at=Math.pow(2,-ft),rt=Math.floor(C.image.width*at),Ht=Math.floor(C.image.height*at),Yt=j!==null?j.x:0,Ft=j!==null?j.y:0;gt.setTexture2D(C,0),J.copyTexSubImage2D(J.TEXTURE_2D,ft,0,0,Yt,Ft,rt,Ht),E.unbindTexture()},this.copyTextureToTexture=function(C,j,ft=null,at=null,rt=0,Ht=0){let Yt,Ft,Wt,qt,ye,Me,$t,ze,oi;const ni=C.isCompressedTexture?C.mipmaps[Ht]:C.image;if(ft!==null)Yt=ft.max.x-ft.min.x,Ft=ft.max.y-ft.min.y,Wt=ft.isBox3?ft.max.z-ft.min.z:1,qt=ft.min.x,ye=ft.min.y,Me=ft.isBox3?ft.min.z:0;else{const hi=Math.pow(2,-rt);Yt=Math.floor(ni.width*hi),Ft=Math.floor(ni.height*hi),C.isDataArrayTexture?Wt=ni.depth:C.isData3DTexture?Wt=Math.floor(ni.depth*hi):Wt=1,qt=0,ye=0,Me=0}at!==null?($t=at.x,ze=at.y,oi=at.z):($t=0,ze=0,oi=0);const Te=Lt.convert(j.format),Ei=Lt.convert(j.type);let Kt;j.isData3DTexture?(gt.setTexture3D(j,0),Kt=J.TEXTURE_3D):j.isDataArrayTexture||j.isCompressedArrayTexture?(gt.setTexture2DArray(j,0),Kt=J.TEXTURE_2D_ARRAY):(gt.setTexture2D(j,0),Kt=J.TEXTURE_2D),E.activeTexture(J.TEXTURE0),E.pixelStorei(J.UNPACK_FLIP_Y_WEBGL,j.flipY),E.pixelStorei(J.UNPACK_PREMULTIPLY_ALPHA_WEBGL,j.premultiplyAlpha),E.pixelStorei(J.UNPACK_ALIGNMENT,j.unpackAlignment);const Ni=E.getParameter(J.UNPACK_ROW_LENGTH),be=E.getParameter(J.UNPACK_IMAGE_HEIGHT),ji=E.getParameter(J.UNPACK_SKIP_PIXELS),pn=E.getParameter(J.UNPACK_SKIP_ROWS),Yi=E.getParameter(J.UNPACK_SKIP_IMAGES);E.pixelStorei(J.UNPACK_ROW_LENGTH,ni.width),E.pixelStorei(J.UNPACK_IMAGE_HEIGHT,ni.height),E.pixelStorei(J.UNPACK_SKIP_PIXELS,qt),E.pixelStorei(J.UNPACK_SKIP_ROWS,ye),E.pixelStorei(J.UNPACK_SKIP_IMAGES,Me);const Zs=C.isDataArrayTexture||C.isData3DTexture,We=j.isDataArrayTexture||j.isData3DTexture;if(C.isDepthTexture){const hi=ut.get(C),Mn=ut.get(j),Qe=ut.get(hi.__renderTarget),es=ut.get(Mn.__renderTarget);E.bindFramebuffer(J.READ_FRAMEBUFFER,Qe.__webglFramebuffer),E.bindFramebuffer(J.DRAW_FRAMEBUFFER,es.__webglFramebuffer);for(let Vn=0;Vn<Wt;Vn++)Zs&&(J.framebufferTextureLayer(J.READ_FRAMEBUFFER,J.COLOR_ATTACHMENT0,ut.get(C).__webglTexture,rt,Me+Vn),J.framebufferTextureLayer(J.DRAW_FRAMEBUFFER,J.COLOR_ATTACHMENT0,ut.get(j).__webglTexture,Ht,oi+Vn)),J.blitFramebuffer(qt,ye,Yt,Ft,$t,ze,Yt,Ft,J.DEPTH_BUFFER_BIT,J.NEAREST);E.bindFramebuffer(J.READ_FRAMEBUFFER,null),E.bindFramebuffer(J.DRAW_FRAMEBUFFER,null)}else if(rt!==0||C.isRenderTargetTexture||ut.has(C)){const hi=ut.get(C),Mn=ut.get(j);E.bindFramebuffer(J.READ_FRAMEBUFFER,W),E.bindFramebuffer(J.DRAW_FRAMEBUFFER,Q);for(let Qe=0;Qe<Wt;Qe++)Zs?J.framebufferTextureLayer(J.READ_FRAMEBUFFER,J.COLOR_ATTACHMENT0,hi.__webglTexture,rt,Me+Qe):J.framebufferTexture2D(J.READ_FRAMEBUFFER,J.COLOR_ATTACHMENT0,J.TEXTURE_2D,hi.__webglTexture,rt),We?J.framebufferTextureLayer(J.DRAW_FRAMEBUFFER,J.COLOR_ATTACHMENT0,Mn.__webglTexture,Ht,oi+Qe):J.framebufferTexture2D(J.DRAW_FRAMEBUFFER,J.COLOR_ATTACHMENT0,J.TEXTURE_2D,Mn.__webglTexture,Ht),rt!==0?J.blitFramebuffer(qt,ye,Yt,Ft,$t,ze,Yt,Ft,J.COLOR_BUFFER_BIT,J.NEAREST):We?J.copyTexSubImage3D(Kt,Ht,$t,ze,oi+Qe,qt,ye,Yt,Ft):J.copyTexSubImage2D(Kt,Ht,$t,ze,qt,ye,Yt,Ft);E.bindFramebuffer(J.READ_FRAMEBUFFER,null),E.bindFramebuffer(J.DRAW_FRAMEBUFFER,null)}else We?C.isDataTexture||C.isData3DTexture?J.texSubImage3D(Kt,Ht,$t,ze,oi,Yt,Ft,Wt,Te,Ei,ni.data):j.isCompressedArrayTexture?J.compressedTexSubImage3D(Kt,Ht,$t,ze,oi,Yt,Ft,Wt,Te,ni.data):J.texSubImage3D(Kt,Ht,$t,ze,oi,Yt,Ft,Wt,Te,Ei,ni):C.isDataTexture?J.texSubImage2D(J.TEXTURE_2D,Ht,$t,ze,Yt,Ft,Te,Ei,ni.data):C.isCompressedTexture?J.compressedTexSubImage2D(J.TEXTURE_2D,Ht,$t,ze,ni.width,ni.height,Te,ni.data):J.texSubImage2D(J.TEXTURE_2D,Ht,$t,ze,Yt,Ft,Te,Ei,ni);E.pixelStorei(J.UNPACK_ROW_LENGTH,Ni),E.pixelStorei(J.UNPACK_IMAGE_HEIGHT,be),E.pixelStorei(J.UNPACK_SKIP_PIXELS,ji),E.pixelStorei(J.UNPACK_SKIP_ROWS,pn),E.pixelStorei(J.UNPACK_SKIP_IMAGES,Yi),Ht===0&&j.generateMipmaps&&J.generateMipmap(Kt),E.unbindTexture()},this.initRenderTarget=function(C){ut.get(C).__webglFramebuffer===void 0&>.setupRenderTarget(C)},this.initTexture=function(C){C.isCubeTexture?gt.setTextureCube(C,0):C.isData3DTexture?gt.setTexture3D(C,0):C.isDataArrayTexture||C.isCompressedArrayTexture?gt.setTexture2DArray(C,0):gt.setTexture2D(C,0),E.unbindTexture()},this.resetState=function(){O=0,z=0,st=null,E.reset(),Xt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return fs}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;const i=this.getContext();i.drawingBufferColorSpace=Be._getDrawingBufferColorSpace(t),i.unpackColorSpace=Be._getUnpackColorSpace()}}const Fn=180,zn=88,th=5,tS=354,eS=252;function PN(r){return 1+[501,701,901,1101].filter(t=>r>=t).length}function NN(r,t=[],i=th){i=Math.max(1,Math.min(th,Math.floor(i)||1));const e=new Map(r.map((w,H)=>[w.id,H])),s=t.filter(w=>e.has(w.from)&&e.has(w.to)),o=r.map(()=>[]);s.forEach(w=>o[e.get(w.from)].push(e.get(w.to)));let c=0;const h=new Map,d=new Map,f=[],g=new Set,x=[];function y(w){h.set(w,c),d.set(w,c++),f.push(w),g.add(w);for(const H of o[w])h.has(H)?g.has(H)&&d.set(w,Math.min(d.get(w),h.get(H))):(y(H),d.set(w,Math.min(d.get(w),d.get(H))));if(d.get(w)===h.get(w)){const H=[];let V;do V=f.pop(),g.delete(V),H.push(V);while(V!==w);x.push(H.sort((X,$)=>X-$))}}r.forEach((w,H)=>{h.has(H)||y(H)});const v=new Map;x.forEach((w,H)=>w.forEach(V=>v.set(V,H)));const _=x.map(()=>new Set);s.forEach(w=>{const H=v.get(e.get(w.from)),V=v.get(e.get(w.to));H!==V&&_[V].add(H)});const A=new Map;function b(w){return A.has(w)||A.set(w,_[w].size?1+Math.max(...[..._[w]].map(b)):0),A.get(w)}x.forEach((w,H)=>b(H));const S=r.map((w,H)=>H).sort((w,H)=>b(v.get(w))-b(v.get(H))||w-H),R=new Map(S.map((w,H)=>[w,H])),k=r.map((w,H)=>{const V=R.get(H),X=V%i,$=Math.floor(V/i);return{...w,index:H,col:X,row:$,x:42+X*tS,y:64+$*240}}),N=64+Math.max(0,Math.ceil(r.length/i)-1)*240+zn+64;let D=0;const I=s.map((w,H)=>{const V=k[e.get(w.from)],X=k[e.get(w.to)],$=V.y+zn/2,W=X.y+zn/2;let Q,O;if(X.row===V.row&&X.col===V.col+1){const z=V.x+Fn+8,st=X.x-5,et=(z+st)/2;Q=[[z,$],[et,$],[et,W],[st,W]],O={x:et,y:Math.abs($-W)<1?$-23:($+W)/2,width:150}}else if(X.row===V.row+1&&X.col===V.col){const z=V.x+Fn/2,st=V.y+zn+8,et=X.y-6;Q=[[z,st],[z,et]],O={x:z,y:(st+et)/2,width:180}}else if(X.row===V.row+1){const z=V.y+zn+72,st=V.x+Fn+28,et=X.x-28;Q=[[V.x+Fn+8,$],[st,$],[st,z],[et,z],[et,W],[X.x-5,W]],O={x:(st+et)/2,y:z-18,width:180}}else{const z=N+30+D++*64,st=V.x+Fn+28,et=X.x-28;Q=[[V.x+Fn+8,$],[st,$],[st,z],[et,z],[et,W],[X.x-5,W]],O={x:(st+et)/2,y:z-18,width:180}}return{...w,labelText:w.label,index:H,points:Q,label:O,path:Q.map(([z,st],et)=>`${et?"L":"M"}${z},${st}`).join(" ")}}),M=-Math.min(0,...I.map(w=>w.label.x-w.label.width/2-16));return M&&(k.forEach(w=>{w.x+=M}),I.forEach(w=>{w.points=w.points.map(([H,V])=>[H+M,V]),w.label.x+=M,w.path=w.points.map(([H,V],X)=>`${X?"L":"M"}${H},${V}`).join(" ")})),{columns:i,nodes:k,edges:I,width:Math.max(264+Math.max(0,Math.min(i,r.length)-1)*tS+M,...I.map(w=>w.label.x+w.label.width/2+24)),height:N+D*64+(D?40:0)}}function RN({layout:r,selected:t}){const i=Ce.useRef(null),e=Ce.useRef(()=>{});return Ce.useEffect(()=>{const s=i.current;let o;try{o=new y_({alpha:!0,antialias:!0})}catch{return}o.setPixelRatio(Math.min(devicePixelRatio,2)),o.setClearColor(16777215,0),s.appendChild(o.domElement);const c=new JS,h=new Gl(0,r.width,0,-r.height,.1,1e3);h.position.z=500,c.add(new C1(16777215,2));const d=new c_(16777215,1.5);d.position.set(-100,100,300),c.add(d);const f=[];r.nodes.forEach(y=>{const{x:v,y:_}=y,A=Fn,b=zn,S=[v,-_,0,v+A,-_,0,v+A,-_-b,0,v,-_-b,0,v+8,-_-7,-12,v+A+8,-_-7,-12,v+A+8,-_-b-7,-12,v+8,-_-b-7,-12],R=new tn;R.setAttribute("position",new _i(S,3)),R.setIndex([0,3,2,0,2,1,1,2,6,1,6,5,3,7,6,3,6,2]),R.computeVertexNormals();const k=new o_({color:"#e5e5e2",roughness:.9,side:us});c.add(new Hn(R,k)),f.push(R,k);const N=new t1(R),D=new Rm({color:"#b9b9b5"});c.add(new t_(N,D)),f.push(N,D)});function g(){s.clientWidth&&(o.setSize(s.clientWidth,s.clientHeight),o.render(c,h))}e.current=g;const x=new ResizeObserver(g);return x.observe(s),g(),()=>{x.disconnect(),e.current=()=>{},f.forEach(y=>y.dispose()),o.dispose(),o.domElement.remove()}},[r]),Ce.useEffect(()=>e.current(),[t]),L.jsx("div",{className:"architecture-depth",ref:i,"aria-hidden":"true"})}function v_({layout:r,selected:t,onSelect:i,focused:e,activeEdge:s,onEdge:o,trace:c=!1}){const h=Ce.useId().replaceAll(":",""),d=new Set([t]);e&&r.edges.forEach(x=>{const y=r.nodes.find(_=>_.id===x.from),v=r.nodes.find(_=>_.id===x.to);(y.index===t||v.index===t)&&(d.add(y.index),d.add(v.index))});function f(x){var y,v;return!e||x.from===((y=r.nodes[t])==null?void 0:y.id)||x.to===((v=r.nodes[t])==null?void 0:v.id)}function g(x,y){(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),y())}return L.jsxs(L.Fragment,{children:[L.jsx("div",{className:"architecture-tools",children:L.jsxs("span",{children:[c?"ONE ACTION":"ONE MAP"," · ",r.nodes.length," ",c?"STEPS":"COMPONENTS"," · ",r.edges.length," ",c?"TRANSITIONS":"CONNECTIONS"]})}),L.jsx("div",{className:"architecture-frame",role:"region","aria-label":c?"Action diagram":"Architecture map",children:L.jsxs("div",{className:"architecture-map","data-columns":r.columns,style:{aspectRatio:`${r.width} / ${r.height}`,maxWidth:r.width},children:[L.jsx(RN,{layout:r,selected:t}),L.jsxs("svg",{viewBox:`0 0 ${r.width} ${r.height}`,className:"architecture-overlay",role:"group","aria-label":c?"Complete action diagram":"Complete architecture diagram",children:[L.jsxs("defs",{children:[L.jsx("pattern",{id:`${h}-grid`,width:"24",height:"24",patternUnits:"userSpaceOnUse",children:L.jsx("path",{d:"M24 0H0V24",fill:"none",stroke:CS,strokeWidth:".75"})}),L.jsx("marker",{id:`${h}-arrow`,viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:"7",markerHeight:"7",orient:"auto-start-reverse",children:L.jsx("path",{d:"M1,1 L9,5 L1,9",fill:"none",stroke:"context-stroke",strokeWidth:"1.3"})})]}),L.jsx("rect",{width:r.width,height:r.height,fill:`url(#${h}-grid)`,pointerEvents:"none"}),r.edges.map(x=>L.jsxs("g",{className:`architecture-edge${s===x.index?" is-selected":""}`,opacity:f(x)?1:.16,children:[L.jsx("path",{d:x.path,fill:"none",stroke:"currentColor",strokeWidth:"1.3",markerEnd:`url(#${h}-arrow)`}),L.jsx("path",{d:x.path,fill:"none",stroke:"transparent",strokeWidth:"14",onClick:()=>o(x.index),className:"architecture-edge-hit"}),x.label&&L.jsx("foreignObject",{x:x.label.x-x.label.width/2,y:x.label.y-24,width:x.label.width,height:"48",overflow:"visible",children:L.jsx("button",{className:"architecture-edge-label","aria-pressed":s===x.index,onClick:()=>o(x.index),children:L.jsx("span",{children:x.labelText||"Connection"})})})]},x.index)),r.nodes.map(x=>L.jsxs("g",{role:"button",tabIndex:0,"aria-label":`${x.label}, ${c?"step":"component"} ${x.index+1}`,"aria-pressed":t===x.index,onClick:()=>i(x.index),onKeyDown:y=>g(y,()=>i(x.index)),className:`architecture-node${t===x.index?" is-selected":""}`,opacity:!e||d.has(x.index)?1:.38,children:[L.jsx("rect",{x:x.x,y:x.y,width:Fn,height:zn,fill:"var(--paper)",stroke:t===x.index?"var(--accent)":"#9a9a95",strokeWidth:"1"}),L.jsx("foreignObject",{x:x.x+14,y:x.y+11,width:Fn-28,height:zn-20,pointerEvents:"none",children:L.jsxs("div",{className:"architecture-node-copy",children:[L.jsxs("span",{children:[String(x.index+1).padStart(2,"0")," / ",x.kind||"component"]}),L.jsx("strong",{children:x.label})]})})]},x.id))]})]})}),L.jsx("p",{className:"architecture-hint",children:c?"Select a step to inspect its action and supporting files. Arrows show the reported sequence.":"Select a component to inspect it. Select a connection label for its evidence."})]})}function DN(r,t=th){t=Math.max(1,Math.min(th,Math.floor(t)||1));const i=r.map((s,o)=>({id:`step-${o}`,index:o,label:s.title,kind:s.kind||"action",x:40+o%t*eS,y:40+Math.floor(o/t)*180})),e=i.slice(1).map((s,o)=>{const c=i[o],h=s.y+zn/2,d=c.x+Fn+8,f=s.x-6,g=c.y+zn/2,x=c.y+zn+44,y=t===1?[[c.x+Fn/2,c.y+zn+8],[s.x+Fn/2,s.y-6]]:c.y!==s.y?[[d,g],[d+20,g],[d+20,x],[f-20,x],[f-20,h],[f,h]]:[[d,h],[f,h]];return{index:o,from:c.id,to:s.id,points:y,path:y.map(([v,_],A)=>`${A?"L":"M"}${v},${_}`).join(" ")}});return{columns:t,nodes:i,edges:e,width:260+Math.max(0,Math.min(t,i.length)-1)*eS,height:Math.max(1,Math.ceil(i.length/t))*180}}function S_(){const[r,t]=Ce.useState(1);return Ce.useLayoutEffect(()=>{const i=()=>t(PN(window.innerWidth));return i(),window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]),r}function LN({report:r,selected:t,onSelect:i}){const e=S_(),s=Ce.useMemo(()=>DN(r.trace,e),[r.trace,e]);return L.jsx("div",{className:"trace-diagram",children:s.nodes.length?L.jsx(v_,{trace:!0,layout:s,selected:t,onSelect:i,focused:!1,activeEdge:t>0?t-1:null,onEdge:o=>i(o+1)}):L.jsx("p",{className:"trace-empty",children:"No action sequence was established in this report."})})}function Um({label:r,onClick:t}){return L.jsx("button",{type:"button",className:"drawer-close","aria-label":r,autoFocus:!0,onClick:t,children:L.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",focusable:"false",children:L.jsx("path",{d:"m5 5 14 14M5 19 19 5"})})})}function IN(){const r=Ce.useRef(null);return L.jsxs(L.Fragment,{children:[L.jsx("button",{className:"how-to-run-trigger",type:"button","aria-haspopup":"dialog",onClick:()=>r.current.showModal(),children:"HOW TO RUN"}),L.jsxs("dialog",{ref:r,className:"changelog-drawer setup-drawer","aria-labelledby":"setup-title",onClick:t=>{if(t.target===r.current){const i=r.current.getBoundingClientRect();(t.clientX<i.left||t.clientX>i.right||t.clientY<i.top||t.clientY>i.bottom)&&r.current.close()}},children:[L.jsxs("header",{children:[L.jsxs("div",{children:[L.jsx("span",{className:"eyebrow",children:"BLNKFLD. QUICK START"}),L.jsx("h2",{id:"setup-title",children:"Run blnkfld in a project"}),L.jsx("p",{children:"Generate a source-backed README and an interactive architecture view from your own repository."})]}),L.jsx(Um,{label:"Close run instructions",onClick:()=>r.current.close()})]}),L.jsxs("div",{className:"setup-content",children:[L.jsxs("section",{children:[L.jsx("h3",{children:"Before you start"}),L.jsx("p",{children:"Install Node.js 22 or later and sign in to a current Codex or Claude Code CLI. blnkfld uses that existing agent account to read your project and generate its report."})]}),L.jsxs("section",{children:[L.jsx("h3",{children:"01. Open your project"}),L.jsx("p",{children:"Open a terminal and go to the project you want to understand. Replace the example path with your own."}),L.jsx("pre",{children:L.jsx("code",{children:"cd /path/to/your-project"})})]}),L.jsxs("section",{children:[L.jsx("h3",{children:"02. Run blnkfld"}),L.jsx("p",{children:"Run the latest published package from npm. It includes the browser interface, so no separate build is needed."}),L.jsx("pre",{children:L.jsx("code",{children:"npx blnkfld@latest"})}),L.jsx("p",{children:"If npm asks to install the package, confirm to continue. blnkfld analyzes the current directory."})]}),L.jsxs("section",{children:[L.jsx("h3",{children:"03. Explore your brief"}),L.jsxs("p",{children:["blnkfld validates the source references, saves ",L.jsx("code",{children:".blnkfld/report.json"})," in your project, and opens a local browser preview. Explore System Overview, System Architecture, and the action trace, or open VIEW README to export the text."]}),L.jsxs("p",{children:["Run the command again to refresh the report. Press ",L.jsx("code",{children:"Ctrl+C"})," in the terminal to stop the preview."]})]}),L.jsxs("section",{children:[L.jsx("h3",{children:"Optional flags"}),L.jsx("p",{children:"Add flags after the command. For example, to use Claude Code:"}),L.jsx("pre",{children:L.jsx("code",{children:"npx blnkfld@latest --agent claude"})}),L.jsxs("dl",{children:[L.jsx("dt",{children:"--agent codex / --agent claude"}),L.jsx("dd",{children:"Choose an agent explicitly. By default, signed-in Codex is preferred, followed by Claude Code."}),L.jsx("dt",{children:"--no-open"}),L.jsx("dd",{children:"Print the preview link without opening a browser."}),L.jsx("dt",{children:"--port 4174"}),L.jsx("dd",{children:"Use a specific local port."}),L.jsx("dt",{children:"--report-only"}),L.jsx("dd",{children:"Save the report without starting a preview."})]})]}),L.jsxs("section",{children:[L.jsx("h3",{children:"Your source and account"}),L.jsxs("p",{children:["Analysis consumes your agent account’s usage allowance and sends source read by the agent to that agent’s configured service. Reports contain source excerpts; decide whether to ignore or version ",L.jsx("code",{children:".blnkfld/"}),". The preview runs locally and does not publish your project."]})]})]})]})]})}const iS=r=>Array.isArray(r)?r:r?[r]:[],ao=r=>iS(r).length?`Sources: ${iS(r).join(", ")}`:"";function UN(r){var s;const t=new Map((r.system||[]).map(o=>[o.id,o.label])),i=[],e=(o,c=[],h=[],d=!1)=>{c=c.filter(Boolean),h=h.filter(Boolean),(c.length||h.length)&&i.push({title:o,paragraphs:c,items:h,ordered:d})};return e("Overview",[r.summary,r.expandedSummary,r.whatItIs,ao(r.summaryEvidence)]),e("Getting started",[r.howToRun,ao(r.runEvidence)]),e("System architecture",[r.systemSummary],(r.system||[]).map(o=>{var c;return`${o.label} — ${o.detail}${(c=o.evidence)!=null&&c.length?` (${ao(o.evidence)})`:""}`})),e("Connections",[],(r.connections||[]).map(o=>{var c;return`${t.get(o.from)||o.from} → ${t.get(o.to)||o.to}: ${o.label||"Source import"}${(c=o.evidence)!=null&&c.length?` (${ao(o.evidence)})`:""}`})),e(r.traceTitle||"Representative action",[r.traceSummary,!((s=r.trace)!=null&&s.length)&&"No action sequence was established in this report."],(r.trace||[]).map(o=>{var c;return`${o.title} — ${o.description}${t.has(o.nodeId)?` Component: ${t.get(o.nodeId)}.`:""}${(c=o.evidence)!=null&&c.length?` ${ao(o.evidence)}`:""}`}),!0),e("Technology stack",[],r.stack||[]),e("Project structure",[],(r.projectMap||[]).map(o=>`${o.path} — ${o.description}`)),e("Data and persistence",[r.dataSummary,ao(r.dataEvidence)]),e("Notes and decisions",[r.matters],r.decisions||[]),e("Source evidence",[],(r.evidence||[]).map(o=>`${o.path}${o.startLine?`:${o.startLine}${o.endLine&&o.endLine!==o.startLine?`–${o.endLine}`:""}`:""} — ${o.claim}`)),e("About this README",[r.analysisKind==="agent"?"Generated from an agent-authored source report. Source references were checked against local files; interpretations and runtime behavior were not independently verified.":r.traceStatus==="curated"?"Based on a curated reference report. The action sequence illustrates documented behavior; it is not a live execution.":"Based on static source analysis. Imports and direct calls do not establish a verified runtime or deployment graph.",[r.sourceLabel&&`Source: ${r.sourceLabel}`,r.generatedAt&&`Report date: ${r.generatedAt}`,Number.isFinite(r.fileCount)&&`Files: ${r.fileCount}`].filter(Boolean).join(" · "),"Prepared with blnkfld."]),{title:r.name||"Repository",subtitle:r.subtitle||"",sections:i}}const El=r=>String(r).replace(/([\\`*_{}\[\]<>#])/g,"\\$1").replace(/^(\s*)([-+]|\d+\.)\s/gm,"$1\\$2 ");function ON(r){const t=[`# ${El(r.title).replace(/\r?\n/g," ")}`];r.subtitle&&t.push(El(r.subtitle));for(const i of r.sections)t.push(`## ${El(i.title).replace(/\r?\n/g," ")}`),t.push(...i.paragraphs.map(El)),i.items.length&&t.push(i.items.map((e,s)=>`${i.ordered?`${s+1}.`:"-"} ${El(e).replace(/\n/g,`
|
|
4292
4289
|
`)}`).join(`
|
|
4293
4290
|
`));return`${t.join(`
|
|
4294
4291
|
|
|
4295
4292
|
`)}
|
|
4296
|
-
`}function FN({report:r}){const t=Ce.useRef(null),i=Ce.useMemo(()=>UN(r),[r]),e=Ce.useMemo(()=>ON(i),[i]);return L.jsxs(L.Fragment,{children:[L.jsx("button",{className:"readme-trigger",type:"button","aria-haspopup":"dialog",onClick:()=>t.current.showModal(),children:"VIEW README ↗"}),L.jsxs("dialog",{ref:t,className:"changelog-drawer readme-drawer","aria-labelledby":"readme-heading",onClick:s=>{if(s.target===t.current){const o=t.current.getBoundingClientRect();(s.clientX<o.left||s.clientX>o.right||s.clientY<o.top||s.clientY>o.bottom)&&t.current.close()}},children:[L.jsxs("header",{children:[L.jsxs("div",{children:[L.jsxs("span",{className:"eyebrow",children:[r.traceStatus==="curated"?"CURATED EXAMPLE":r.analysisKind==="agent"?"AGENT BRIEF":"SOURCE MODEL"," / TEXT README"]}),L.jsx("h2",{id:"readme-heading",children:"README"})]}),L.jsx(Um,{label:"Close README",onClick:()=>t.current.close()})]}),L.jsx("div",{className:"readme-actions",children:L.jsx("a",{className:"readme-download",href:`data:text/markdown;charset=utf-8,${encodeURIComponent(e)}`,download:"README.md",children:"Download README.md ↓"})}),L.jsxs("article",{className:"readme-text","aria-label":"README preview",children:[L.jsx("h3",{children:i.title}),i.subtitle&&L.jsx("p",{className:"readme-subtitle",children:i.subtitle}),i.sections.map(s=>{const o=s.ordered?"ol":"ul";return L.jsxs("section",{children:[L.jsx("h4",{children:s.title}),s.paragraphs.map((c,h)=>L.jsx("p",{children:c},h)),s.items.length>0&&L.jsx(o,{children:s.items.map((c,h)=>L.jsx("li",{children:c},h))})]},s.title)})]})]})]})}function Om({children:r,className:t=""}){const i=Ce.useRef(null),e=Ce.useRef(null);return Ce.useLayoutEffect(()=>{const s=i.current,o=e.current,c=()=>{const d=o.getBoundingClientRect().height;s.style.height=`${d}px`};c();const h=new ResizeObserver(c);return h.observe(o),()=>h.disconnect()},[]),L.jsx("div",{ref:i,className:`smooth-height ${t}`,children:L.jsx("div",{ref:e,className:"smooth-height-content",children:r})})}const BN="0.1.1",kN=[{version:"0.1.1",date:"2026-10-06",groups:[{title:"Changed",changes:["System Architecture and Trace one action now step through five, four, three, two, and one column as the window narrows, preserving selection and playback.","Newly generated IN ONE MINUTE summaries contain one to five sentences, with additional detail in the expanded summary.","The changelog groups release notes by version and date and shows only releases up to the running app's version.","The hosted interface uses Lora and Times New Roman as fallbacks when Iowan Old Style is unavailable."]}]},{version:"0.1.0",date:"2026-10-05",groups:[{title:"Added",changes:["Run npx blnkfld inside a project to generate a source-backed brief using your installed Codex or Claude Code CLI.","Explore the project's system overview, architecture, and an action trace, with source excerpts supporting the explanation.","Read a project summary and haiku, inspect setup instructions, and export the brief as a README.","View reports in a local browser interface with bundled Inter, Geist Mono, IBM Plex Mono, and Lora fonts. Serif text prefers Iowan Old Style when installed, then Lora and Times New Roman."]}]}],zN=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric",timeZone:"UTC"});function HN(){const r=Ce.useRef(null);return L.jsxs(L.Fragment,{children:[L.jsx("button",{className:"changelog-trigger",type:"button","aria-haspopup":"dialog",onClick:()=>r.current.showModal(),children:"CHANGELOG"}),L.jsxs("dialog",{ref:r,className:"changelog-drawer","aria-labelledby":"changelog-title",onClick:t=>{if(t.target===r.current){const i=r.current.getBoundingClientRect();(t.clientX<i.left||t.clientX>i.right||t.clientY<i.top||t.clientY>i.bottom)&&r.current.close()}},children:[L.jsxs("header",{children:[L.jsxs("div",{children:[L.jsx("span",{className:"eyebrow",children:"BLNKFLD / RELEASE NOTES"}),L.jsx("h2",{id:"changelog-title",children:"Changelog"}),L.jsxs("p",{children:["What’s changed through v",BN,"."]})]}),L.jsx(Um,{label:"Close changelog",onClick:()=>r.current.close()})]}),L.jsx("div",{className:"changelog-list",children:kN.map(t=>L.jsxs("article",{className:"changelog-entry",children:[L.jsx("time",{className:"changelog-date",dateTime:t.date,children:zN.format(new Date(`${t.date}T00:00:00Z`))}),L.jsxs("div",{children:[L.jsxs("h3",{children:["v",t.version]}),t.groups.map(i=>L.jsxs("section",{className:"changelog-category",children:[L.jsx("h4",{children:i.title}),L.jsx("ul",{children:i.changes.map(e=>L.jsx("li",{children:e},e))})]},i.title))]})]},t.version))})]})]})}function VN({report:r,selected:t,onSelect:i,curated:e}){var v,_,A;const[s,o]=Ce.useState(!1),[c,h]=Ce.useState(null),d=S_(),f=Ce.useMemo(()=>NN(r.system,r.connections,d),[r.system,r.connections,d]),g=f.edges[c];function x(b){h(null),i(b)}function y(b){h(b),i(r.system.findIndex(S=>S.id===f.edges[b].from))}return L.jsxs("div",{className:"connections architecture-connections",children:[L.jsxs("div",{className:"connection-toolbar",children:[L.jsx("span",{children:"ENTIRE ARCHITECTURE"}),L.jsx("button",{disabled:!r.system[t],"aria-pressed":s,onClick:()=>o(!s),children:s?"Show all connections equally":"Highlight selected component"})]}),L.jsx("p",{className:"connection-context",children:e?"Reference architecture · arrows describe the documented interaction.":r.analysisKind==="agent"?"Source-based explanation · arrows describe the reported relationship, not an observed execution.":"Static imports · arrows point from the importing file to its dependency, not the direction of runtime data."}),L.jsx(v_,{layout:f,selected:t,onSelect:x,focused:s,activeEdge:c,onEdge:y}),!f.edges.length&&L.jsx("p",{className:"connection-empty",children:"No connections were established in this report. Components remain available to inspect."}),L.jsx(Om,{children:g&&L.jsxs("section",{className:"architecture-evidence","aria-label":"Selected connection evidence",children:[L.jsxs("div",{children:[L.jsxs("span",{className:"eyebrow",children:["CONNECTION / ",String(g.index+1).padStart(2,"0")]}),L.jsx("button",{onClick:()=>h(null),"aria-label":"Close connection evidence",children:"×"})]}),L.jsxs("h3",{children:[(v=r.system.find(b=>b.id===g.from))==null?void 0:v.label," → ",(_=r.system.find(b=>b.id===g.to))==null?void 0:_.label]}),L.jsx("p",{children:g.labelText}),(A=g.evidence)==null?void 0:A.map(b=>{var S;return L.jsxs("div",{className:"source-file",children:[L.jsxs("span",{children:[b,g.line?` · line ${g.line}`:""]}),L.jsx("p",{children:((S=r.evidence.find(R=>R.path===b))==null?void 0:S.claim)||"Referenced by this relationship."})]},b)})]})})]})}function GN({nodes:r,selected:t,onSelect:i,connections:e,label:s}){const o=Ce.useId().replaceAll(":",""),c=98*Xu/Jn,h=Math.max(360,(r.length-1)*c+210),d=r.map((y,v)=>105+v*c),f=e===void 0?r.slice(1).map((y,v)=>[v,v+1]):e.map(y=>[r.findIndex(v=>v.id===y.from),r.findIndex(v=>v.id===y.to)]).filter(([y,v])=>y>=0&&v>=0),g=(y,v,_,A,b,S)=>L.jsxs("g",{children:[L.jsx("polygon",{points:`${y-_},${v-b} ${y},${v+A-b} ${y},${v+A} ${y-_},${v}`,fill:"#cecece"}),L.jsx("polygon",{points:`${y},${v+A-b} ${y+_},${v-b} ${y+_},${v} ${y},${v+A}`,fill:"#b4b4b4"}),L.jsx("polygon",{points:`${y-_},${v-b} ${y},${v-A-b} ${y+_},${v-b} ${y},${v+A-b}`,fill:"#e9e9e9"})]},S);function x(y){return["browser","cli","input"].includes(y)?L.jsxs("g",{children:[g(0,120,18,8,4),L.jsx("path",{d:"M0 111V88",stroke:"#aaa",strokeWidth:"5"}),L.jsx("polygon",{points:"-28,54 28,78 28,111 -28,87",fill:"#aaa"}),L.jsx("polygon",{points:"-23,61 23,81 23,103 -23,83",fill:"#333"})]}):y==="react"?[0,1,2].map(v=>g(0,117-v*14,35-v*7,17-v*3,5,v)):y==="database"?L.jsx("g",{children:[0,1,2].map(v=>L.jsxs("g",{children:[L.jsx("path",{d:`M-25 ${110-v*16}v12c0 13 50 13 50 0v-12`,fill:"#bbb"}),L.jsx("ellipse",{cy:110-v*16,rx:"25",ry:"10",fill:"#ddd"})]},v))}):y==="api"?L.jsxs("g",{children:[g(-22,113,10,8,40),g(22,113,10,8,40),g(0,77,33,9,8)]}):y==="file"||y==="output"?L.jsxs("g",{children:[g(0,118,34,18,5),y==="output"&&L.jsx("path",{d:"M-20 110l28 13m-18-18l28 13m-18-18l28 13",stroke:"#777",strokeWidth:"2"})]}):y==="operation"?L.jsxs("g",{children:[L.jsx("path",{d:"M-25 90v28c0 14 50 14 50 0V90",fill:"#bbb"}),L.jsx("ellipse",{cy:"90",rx:"25",ry:"13",fill:"#ddd"})]}):y==="transfer"?g(0,104,27,18,15):g(0,119,29,16,36)}return L.jsxs("div",{className:"isometric-fallback",children:[L.jsx("span",{className:"fallback-caption",children:"ISOMETRIC COMPATIBILITY VIEW"}),L.jsxs("svg",{viewBox:`0 0 ${h} 220`,role:"group","aria-label":s.replace("three-dimensional","isometric"),children:[L.jsx("defs",{children:L.jsx("marker",{id:o,viewBox:"0 0 8 8",refX:"7",refY:"4",markerWidth:"5",markerHeight:"5",orient:"auto",children:L.jsx("path",{d:"M0 0 8 4 0 8Z",fill:"context-stroke"})})}),f.map(([y,v],_)=>L.jsx("path",{d:`M${d[y]} 148 V${175+_*5} H${d[v]} V148`,fill:"none",stroke:(t==null?void 0:t.index)===y||(t==null?void 0:t.index)===v?"var(--accent)":"#aaa",strokeWidth:"1.2",markerEnd:`url(#${o})`},_)),r.map((y,v)=>L.jsxs("g",{transform:`translate(${d[v]} 0)`,role:"button",tabIndex:"0","aria-label":`Select ${y.label}`,"aria-pressed":(t==null?void 0:t.index)===v,onClick:()=>i(v),onKeyDown:_=>{["Enter"," "].includes(_.key)&&(_.preventDefault(),i(v))},style:{cursor:"pointer"},children:[L.jsx("title",{children:y.label}),g(0,143,49,24.5,7),x(y.kind),L.jsx("path",{d:"M-32 143l19 9",stroke:(t==null?void 0:t.index)===v?"var(--accent)":"#777",strokeWidth:"3"}),L.jsx("text",{y:"210",textAnchor:"middle",fill:(t==null?void 0:t.index)===v?"var(--accent)":"#555",fontSize:"var(--mono-size)",fontFamily:"var(--mono)",fontWeight:"700",children:String(v+1).padStart(2,"0")})]},y.id||v))]})]})}function XN({nodes:r,selected:t,onSelect:i,connections:e,label:s="Interactive three-dimensional repository system"}){const o=Ce.useRef(null),c=Ce.useRef({selected:t,onSelect:i});c.current={selected:t,onSelect:i};const[h,d]=Ce.useState(!1);return Ce.useEffect(()=>{const f=o.current,g=getComputedStyle(f).getPropertyValue("--accent").trim();let x;try{x=new y_({antialias:!0,alpha:!0,preserveDrawingBuffer:!0})}catch{d(!0);return}x.setPixelRatio(Math.min(window.devicePixelRatio,2)),x.shadowMap.enabled=!0,x.shadowMap.type=PS,f.appendChild(x.domElement);const y=PM(r.length),v=new JS,_=new Gl(-9,9,7,-7,.1,100);_.position.set(5,13,20),_.lookAt(0,0,0),v.add(new E1(16777215,11908533,3));const A=new c_(16777215,4);A.position.set(-3,12,7),A.castShadow=!0,A.shadow.mapSize.set(2048,2048),Object.assign(A.shadow.camera,{left:-14,right:14,top:12,bottom:-12}),A.shadow.normalBias=.03,v.add(A);const b=[],S=[];function R(Et,Zt,me,Rt=0,fe=0,te=0){b.push(Et);const re=new o_({color:Zt,roughness:.75});S.push(re);const Pe=new Hn(Et,re);return Pe.position.set(Rt,fe,te),Pe.castShadow=!0,Pe.receiveShadow=!0,me.add(Pe),Pe}v.background=new ve(getComputedStyle(f).getPropertyValue("--paper").trim());const k=new g1({opacity:.12});S.push(k);const N=new Vl(200,200);b.push(N);const D=new Hn(N,k);D.position.y=-.005,D.rotation.x=-Math.PI/2,D.receiveShadow=!0,v.add(D);const I=new R1(y.gridSize,y.gridSize/Na,wM,CS);I.position.set(y.gridX,.002,y.gridZ),v.add(I);const F=[],M=[],w=[],H=[];r.forEach((Et,Zt)=>{const me=new co;me.position.set(y.centers[Zt],0,0),v.add(me),F.push(me);const Rt=new co;me.add(Rt),M.push(Rt),R(new yi(Jn,.18,Jn),"#d3d3d3",me,0,.09,0);const fe=R(new yi(.58,.025,.08),"#777777",me,-.65,.2,1);if(fe.material.dispose(),fe.material=new Zu({color:"#777777",toneMapped:!1}),S.push(fe.material),w.push(fe),Et.kind==="browser"||Et.kind==="input"||Et.kind==="cli")R(new yi(1.8,1.35,.15),"#555555",Rt,0,1.05,-.2),R(new yi(1.58,1.12,.025),"#252525",Rt,0,1.05,-.11),R(new yi(.1,.55,.12),"#818181",Rt,0,.45,-.2),R(new yi(1,.08,.55),"#adadad",Rt,0,.25,0);else if(Et.kind==="database")for(let te=0;te<3;te++)R(new Qu(.78,.78,.3,64),"#b9b9b9",Rt,0,.42+te*.36,0);else if(Et.kind==="output"){R(new yi(1.7,.14,1.5),"#eeeeee",Rt,0,.35,0);for(let te=0;te<3;te++)R(new yi(1.1,.03,.12),"#777777",Rt,0,.44,-.35+te*.3)}else if(Et.kind==="operation")R(new Qu(.7,.7,.65,8),"#bfbfbf",Rt,0,.6,0);else if(Et.kind==="transfer"){const te=R(new yi(1.25,.25,.9),"#bfbfbf",Rt,0,.7,0);te.rotation.y=Math.PI/4}else if(Et.kind==="react")for(let te=0;te<3;te++)R(new yi(1.8-te*.22,.22,1.5-te*.15),"#c1c1c1",Rt,0,.4+te*.35,0);else if(Et.kind==="step"||Et.kind==="file")R(new yi(1.65,.22,1.4),"#bfbfbf",Rt,0,.42,0);else if(Et.kind==="api")R(new yi(.35,1.3,1.25),"#b8b8b8",Rt,-.65,.85,0),R(new yi(.35,1.3,1.25),"#b8b8b8",Rt,.65,.85,0),R(new yi(1.65,.25,1.25),"#d8d8d8",Rt,0,1.5,0);else{R(new yi(1.65,1.3,1.4),"#bfbfbf",Rt,0,.85,0);for(let te=0;te<6;te++)R(new yi(.85,.035,.025),"#6b6b6b",Rt,0,.55+te*.13,.715)}me.traverse(te=>{te.isMesh&&(te.userData.index=Zt)}),!e&&Zt<r.length-1&&H.push(R(new yi(wS,.025,.045),"#999999",v,me.position.x+Xu/2,.03,0))}),e&&e.forEach((Et,Zt)=>{const me=r.findIndex(Le=>Le.id===Et.from),Rt=r.findIndex(Le=>Le.id===Et.to);if(me<0||Rt<0||me===Rt)return;const fe=F[me].position.x,te=F[Rt].position.x,re=-Jn/2-(Zt+1)*Na,Pe=[new Z(fe,.03,-Jn/2),new Z(fe,.03,re),new Z(te,.03,re),new Z(te,.03,-Jn/2)],ri=new m1;for(let Le=1;Le<Pe.length;Le++)ri.add(new s_(Pe[Le-1],Pe[Le]));const pi=R(new Lm(ri,24,.015,4,!1),"#999999",v);pi.userData.source=me,pi.userData.target=Rt,H.push(pi)}),H.forEach(Et=>{Et.material.dispose(),Et.material=new Zu({color:"#999999",toneMapped:!1}),S.push(Et.material)});const V=new N1,X=new le;function $(Et){const Zt=f.getBoundingClientRect();return X.set((Et.clientX-Zt.left)/Zt.width*2-1,-(Et.clientY-Zt.top)/Zt.height*2+1),V.setFromCamera(X,_),V.intersectObjects(F,!0)[0]}function W(Et){const Zt=$(Et);Zt&&c.current.onSelect(Zt.object.userData.index)}function Q(Et){f.style.cursor=$(Et)?"pointer":"default"}f.addEventListener("click",W),f.addEventListener("pointermove",Q);let O=!0;const z=new ResizeObserver(()=>{const Et=f.clientWidth,Zt=f.clientHeight;x.setSize(Et,Zt);const me=Et/Zt,Rt=Math.max(4.5,(y.width/2+1.25)/me);_.left=-Rt*me,_.right=Rt*me,_.top=Rt,_.bottom=-Rt,_.updateProjectionMatrix(),O=!0});z.observe(f);const st=window.matchMedia("(prefers-reduced-motion: reduce)"),et=new ve(g),dt=new ve(g),U=new ve("#777777"),nt=new ve("#999999");let mt,At,It=0,Gt=!1,ot=[],yt=[],wt=[];function ce(Et){var me;const Zt=(me=c.current.selected)==null?void 0:me.index;if((Zt!==At||At===void 0&&!ot.length)&&(ot=M.map(Rt=>Rt.position.y),yt=w.map(Rt=>Rt.material.color.clone()),wt=H.map(Rt=>Rt.material.color.clone()),At=Zt,It=Et,Gt=!0),Gt||O){const Rt=st.matches?1:Math.min((Et-It)/360,1),fe=1-Math.pow(1-Rt,3);F.forEach((te,re)=>{M[re].position.y=PA.lerp(ot[re],re===Zt?.22:0,fe),w[re].material.color.lerpColors(yt[re],re===Zt?dt:U,fe)}),H.forEach((te,re)=>{te.material.color.lerpColors(wt[re],(e?te.userData.target===Zt||te.userData.source===Zt:re===Zt-1)?et:nt,fe)}),x.render(v,_),Gt=Rt<1,O=!1}mt=requestAnimationFrame(ce)}return mt=requestAnimationFrame(ce),()=>{cancelAnimationFrame(mt),z.disconnect(),f.removeEventListener("click",W),f.removeEventListener("pointermove",Q),b.forEach(Et=>Et.dispose()),S.forEach(Et=>Et.dispose()),I.geometry.dispose(),I.material.dispose(),x.dispose(),x.domElement.remove()}},[r,e]),L.jsx("div",{className:"instrument-scene",ref:o,"aria-label":s,children:h&&L.jsx(GN,{nodes:r,selected:t,onSelect:i,connections:e,label:s})})}function ap({path:r}){const t=r.split("/");return t.map((i,e)=>L.jsxs(Ce.Fragment,{children:[i,e<t.length-1&&L.jsxs(L.Fragment,{children:["/",L.jsx("wbr",{})]})]},e))}function nS({report:r,curated:t,node:i,active:e,trace:s,step:o,mode:c,tab:h,setTab:d}){var g;const f=(s==null?void 0:s.evidence)||(i==null?void 0:i.evidence)||[];return L.jsxs("aside",{className:`instrument-inspector inspector-${c}`,"aria-label":c==="system"?"02 / Module details":"03 / Action details","data-tab":h,children:[L.jsx("div",{className:"inspector-tabs",children:["part","files","notes"].map(x=>L.jsx("button",{"aria-pressed":h===x,onClick:()=>d(x),children:x},x))}),L.jsxs(Om,{className:"inspector-content",children:[h==="part"?L.jsxs(L.Fragment,{children:[L.jsxs("span",{className:"eyebrow",children:[c==="trace"?s?`ACTION STEP / ${String(o+1).padStart(2,"0")}`:"ACTION OVERVIEW":`SELECTED MODULE / ${String(e+1).padStart(2,"0")}`," "]}),L.jsx("h2",{children:c==="trace"?(s==null?void 0:s.title)||r.traceTitle:(i==null?void 0:i.label)||"No source components"}),s&&i&&L.jsxs("p",{className:"inspection-context",children:["MODULE ",String(e+1).padStart(2,"0")," / ",i.label]}),L.jsx("p",{children:c==="trace"?(s==null?void 0:s.description)||r.traceSummary:(i==null?void 0:i.detail)||"No readable components were established."}),L.jsx("div",{className:"inspector-rule"}),L.jsx("span",{className:"eyebrow",children:f.length?"SUPPORTING FILES":"EVIDENCE STATUS"}),f.length?f.map(x=>{var y,v,_;return L.jsxs("div",{className:"source-file",children:[L.jsxs("span",{children:["↳ ",L.jsx(ap,{path:x})]}),L.jsx("p",{children:((y=r.evidence.find(A=>A.path===x))==null?void 0:y.claim)||"Referenced by this action step."}),((v=r.evidence.find(A=>A.path===x))==null?void 0:v.excerpt)&&L.jsxs("details",{children:[L.jsxs("summary",{children:["Read source excerpt",(_=r.evidence.find(A=>A.path===x))!=null&&_.startLine?` · lines ${r.evidence.find(A=>A.path===x).startLine}–${r.evidence.find(A=>A.path===x).endLine}`:""]}),L.jsx("pre",{children:r.evidence.find(A=>A.path===x).excerpt})]})]},x)}):L.jsx("p",{children:c==="trace"&&!s?"Select an action step to inspect its supporting files.":"No source references are attached to this selection."}),!t&&((g=r.connections)==null?void 0:g.filter(x=>x.from===(i==null?void 0:i.id)||x.to===(i==null?void 0:i.id)).map((x,y)=>L.jsxs("div",{className:"source-file",children:[L.jsxs("span",{children:[x.from," → ",x.to]}),L.jsx("p",{children:r.analysisKind==="agent"?x.label:`Import declared in ${x.from}:${x.line}.`})]},`edge-${y}`))),L.jsx("div",{className:"inspector-note",children:t?"Reference explanation. Playback illustrates the documented sequence; it is not a live execution.":r.analysisKind==="agent"?"Agent-authored source analysis. References are checked against local files; interpretations and runtime behavior are not independently verified.":"Source imports and direct calls only. This is a static reading, not a verified runtime or deployment graph."})]}):h==="files"?L.jsxs(L.Fragment,{children:[L.jsx("span",{className:"eyebrow",children:"REPOSITORY EVIDENCE"}),L.jsx("h2",{children:"Source index"}),r.evidence.map(x=>L.jsxs("div",{className:"source-file",children:[L.jsx("span",{children:L.jsx(ap,{path:x.path})}),L.jsx("p",{children:x.claim})]},x.path))]}):L.jsxs(L.Fragment,{children:[L.jsx("span",{className:"eyebrow",children:"OPERATOR NOTES"}),L.jsx("h2",{children:"What matters"}),L.jsx("p",{children:r.matters}),L.jsx("h3",{children:"Data & persistence"}),L.jsx("p",{children:r.dataSummary}),L.jsx("h3",{children:"Project map"}),r.projectMap.map(x=>L.jsxs("div",{className:"source-file",children:[L.jsx("span",{children:L.jsx(ap,{path:x.path})}),L.jsx("p",{children:x.description})]},x.path)),L.jsx("h3",{children:"Tech stack"}),L.jsx("p",{children:r.stack.join(" / ")}),r.decisions.map(x=>L.jsx("p",{children:x},x))]}),L.jsxs("div",{className:"inspector-footer",children:[r.fileCount," FILES / ",r.generatedAt,L.jsx("br",{}),"SOURCE: ",r.sourceLabel]})]})]})}function WN({initialReport:r=Da}){const[t,i]=Ce.useState(r),[e,s]=Ce.useState(0),[o,c]=Ce.useState(-1),[h,d]=Ce.useState(!1),[f,g]=Ce.useState("part"),[x,y]=Ce.useState("part"),[v,_]=Ce.useState(""),[A,b]=Ce.useState(!1),[S,R]=Ce.useState(""),[k,N]=Ce.useState(!1),[D,I]=Ce.useState("3d"),F=Ce.useRef(null),M=t===Da,w=o>=0?t.system.findIndex(O=>{var z;return O.id===((z=t.trace[o])==null?void 0:z.nodeId)}):-1;function H(O){c(O),d(!1),y("part")}Ce.useEffect(()=>{if(!h)return;const O=setTimeout(()=>{if(o>=t.trace.length-1){d(!1);return}c(o+1)},1300);return()=>clearTimeout(O)},[h,o,t]);function V(O){s(O),g("part")}async function X(O){b(!0),R("");try{i(await O()),s(0),c(-1),d(!1),g("part"),y("part"),N(!1)}catch(z){R(z.message)}finally{b(!1)}}const $=t.system[e],W=t.system[w],Q=t.trace[o];return L.jsxs("main",{className:"instrument instrument-cards",children:[L.jsxs("header",{className:"instrument-header",children:[L.jsxs("a",{className:"instrument-brand",href:"/",children:[L.jsx("div",{className:"brand-logo","aria-hidden":"true"}),L.jsx("div",{className:"wordmark",children:"blnkfld"}),L.jsx("div",{className:"product-label",children:"Agentic README"})]}),L.jsxs("nav",{className:"instrument-header-right","aria-label":"Sections",children:[L.jsx("a",{href:"#repository",children:"01 / REPOSITORY"}),L.jsx("a",{href:"#system",children:"02 / SYSTEM"}),L.jsxs("a",{href:"#action",children:["03 / ",M||t.analysisKind==="agent"?"TRACE ONE ACTION":"SOURCE CALL PATH"]}),L.jsx("a",{href:"#how-to-run",children:"04 / GET STARTED"})]})]}),L.jsxs("div",{className:`instrument-body ${Q?"inspecting-trace":"inspecting-system"}`,children:[L.jsxs("section",{className:"instrument-workspace",children:[L.jsxs("div",{id:"repository",className:"instrument-title",children:[L.jsxs("div",{children:[L.jsx("span",{className:"eyebrow",children:M?"01 / REFERENCE REPOSITORY":"01 / IMPORTED REPOSITORY"}),L.jsx("h1",{children:t.name}),L.jsx("p",{children:t.subtitle})]}),L.jsx(FN,{report:t})]}),L.jsxs("div",{className:"instrument-summary",children:[L.jsx("span",{className:"eyebrow",children:"IN ONE MINUTE"}),L.jsx("p",{children:t.summary}),Array.isArray(t.haiku)&&t.haiku.length===3&&L.jsxs(L.Fragment,{children:[L.jsx("span",{className:"eyebrow project-haiku-label",children:"A HAIKU"}),L.jsx("p",{className:"project-haiku","aria-label":"Project haiku",children:t.haiku.map((O,z)=>L.jsx("span",{children:O},z))})]})]}),L.jsx("hr",{className:"section-divider divider-system"}),L.jsxs("section",{id:"system",className:"scene-wrap","aria-labelledby":"system-heading",children:[L.jsxs("div",{className:"system-heading",children:[L.jsxs("div",{children:[L.jsxs("span",{className:"eyebrow",children:["02 / SYSTEM / ",String(t.system.length).padStart(2,"0")," COMPONENTS"]}),L.jsx("h2",{id:"system-heading",children:"How the parts work together"})]}),L.jsx("div",{className:"system-view","aria-label":"System view",children:["3d","connections"].map(O=>L.jsx("button",{"aria-pressed":D===O,onClick:()=>I(O),children:O==="3d"?"SYSTEM OVERVIEW":"SYSTEM ARCHITECTURE"},O))})]}),L.jsx(Om,{children:L.jsxs("div",{className:"view-enter",children:[D==="3d"&&L.jsxs(L.Fragment,{children:[L.jsx(XN,{nodes:t.system,connections:M?void 0:t.connections,selected:{index:e},onSelect:V}),L.jsx("div",{className:"module-controls",children:t.system.map((O,z)=>L.jsxs("button",{onClick:()=>V(z),"aria-pressed":e===z,children:[L.jsx("span",{children:String(z+1).padStart(2,"0")}),L.jsx("strong",{children:O.label})]},O.id))})]}),D==="connections"&&L.jsx(VN,{report:t,selected:e,onSelect:V,curated:M},t.sourceLabel+t.generatedAt)]},D)})]}),t.analysisKind==="agent"&&L.jsxs("p",{className:"analysis-coverage",children:["Source references checked in ",t.evidence.length," files · ",t.fileCount," files inventoried · Static analysis by ",t.agent]}),t.analysisKind!=="agent"&&t.coverage&&L.jsxs("p",{className:"analysis-coverage",children:["Read ",t.coverage.readCount," of ",t.coverage.totalCount," files · Parsed ",t.coverage.parsedCount," JavaScript/TypeScript files",t.coverage.omittedCount>0?` · ${t.coverage.omittedCount} additional modules omitted from this view`:"",t.coverage.treeTruncated?" · GitHub tree is incomplete":"",". Other languages are not analyzed."]}),L.jsx("hr",{className:"section-divider divider-action"}),L.jsxs("section",{id:"action",className:"sequencer",children:[L.jsxs("div",{className:"sequence-heading",children:[L.jsxs("div",{children:[L.jsxs("span",{className:"eyebrow",children:["03 / ",M||t.analysisKind==="agent"?"TRACE ONE ACTION":"SOURCE CALL PATH"]}),L.jsx("h2",{children:t.traceTitle})]}),L.jsx("button",{className:"play-button","aria-label":h?"Pause action trace":"Play action trace",title:h?"Pause":"Play","aria-pressed":h,disabled:!t.trace.length,onClick:()=>{h?d(!1):((o<0||o===t.trace.length-1)&&c(0),d(!0),y("part"))},children:L.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:h?L.jsx("path",{d:"M9 6v12M15 6v12"}):L.jsx("path",{d:"m9 5 10 7-10 7Z"})})})]}),L.jsx("p",{className:"action-summary",children:t.traceSummary}),L.jsx(LN,{report:t,selected:o,onSelect:H})]}),L.jsx("hr",{className:"section-divider divider-run"}),L.jsxs("section",{id:"how-to-run",className:"instrument-run","aria-labelledby":"run-heading",children:[L.jsx("span",{className:"eyebrow",children:"04 / GET STARTED"}),L.jsx("h2",{id:"run-heading",children:"How to run"}),L.jsx("p",{children:t.howToRun}),L.jsxs("div",{className:"run-evidence",children:[L.jsx("span",{children:"EVIDENCE"}),(t.runEvidence||[]).map(O=>L.jsx("span",{children:O},O))]})]})]}),L.jsx(nS,{report:t,curated:M,node:$,active:e,mode:"system",tab:f,setTab:g}),L.jsx(nS,{report:t,curated:M,node:W,active:w,trace:Q,step:o,mode:"trace",tab:x,setTab:y}),["repository","system","action","run"].map(O=>L.jsx("div",{className:`section-card-outline card-${O}`,"aria-hidden":"true"},O))]}),L.jsxs("footer",{className:"instrument-footer",children:[L.jsx("button",{onClick:()=>N(!k),children:"+ CHANGE REPOSITORY"}),L.jsx("span",{children:A?"ANALYZING…":t.sourceLabel}),L.jsxs("div",{className:"footer-links",children:[L.jsx(HN,{}),L.jsx("span",{"aria-hidden":"true",children:"/"}),L.jsx(IN,{})]})]}),k&&L.jsxs("form",{className:"repository-popover",onSubmit:O=>{O.preventDefault(),X(()=>CM(v))},children:[L.jsx("label",{htmlFor:"repo-url",children:"Public GitHub repository"}),L.jsx("input",{id:"repo-url",value:v,onChange:O=>_(O.target.value),placeholder:"https://github.com/owner/repository",required:!0}),L.jsx("button",{disabled:A,children:"Analyze repository ↗"}),L.jsx("button",{type:"button",disabled:A,onClick:()=>F.current.click(),children:"Choose local folder"}),L.jsx("button",{type:"button",onClick:()=>N(!1),children:"Close"}),S&&L.jsx("p",{role:"alert",children:S})]}),L.jsx("input",{ref:F,type:"file",webkitdirectory:"",multiple:!0,hidden:!0,onChange:O=>{const z=Array.from(O.target.files);z.length&&X(()=>AM(z)),O.target.value=""}})]})}const rp=Ob.createRoot(document.getElementById("root"));async function qN(){const r=new URLSearchParams(window.location.search);let t;if(r.get("local")==="1"||document.querySelector('meta[name="blnkfld-local"]')){rp.render(L.jsx("p",{style:{padding:36},children:"Opening your project brief…"}));try{const i=await fetch("/api/report");if(!i.ok)throw new Error("Could not load the local report. Open the link printed by blnkfld in your terminal.");if(t=await i.json(),!t.system||!t.evidence)throw new Error("The local report is invalid.");r.has("token")&&(r.delete("token"),window.history.replaceState(null,"","?"+r.toString()))}catch(i){rp.render(L.jsx("p",{role:"alert",style:{padding:36},children:i.message}));return}}rp.render(L.jsx(Pb.StrictMode,{children:L.jsx(WN,{initialReport:t})}))}qN();
|
|
4293
|
+
`}function FN({report:r}){const t=Ce.useRef(null),i=Ce.useMemo(()=>UN(r),[r]),e=Ce.useMemo(()=>ON(i),[i]);return L.jsxs(L.Fragment,{children:[L.jsx("button",{className:"readme-trigger",type:"button","aria-haspopup":"dialog",onClick:()=>t.current.showModal(),children:"VIEW README ↗"}),L.jsxs("dialog",{ref:t,className:"changelog-drawer readme-drawer","aria-labelledby":"readme-heading",onClick:s=>{if(s.target===t.current){const o=t.current.getBoundingClientRect();(s.clientX<o.left||s.clientX>o.right||s.clientY<o.top||s.clientY>o.bottom)&&t.current.close()}},children:[L.jsxs("header",{children:[L.jsxs("div",{children:[L.jsxs("span",{className:"eyebrow",children:[r.traceStatus==="curated"?"CURATED EXAMPLE":r.analysisKind==="agent"?"AGENT BRIEF":"SOURCE MODEL"," / TEXT README"]}),L.jsx("h2",{id:"readme-heading",children:"README"})]}),L.jsx(Um,{label:"Close README",onClick:()=>t.current.close()})]}),L.jsx("div",{className:"readme-actions",children:L.jsx("a",{className:"readme-download",href:`data:text/markdown;charset=utf-8,${encodeURIComponent(e)}`,download:"README.md",children:"Download README.md ↓"})}),L.jsxs("article",{className:"readme-text","aria-label":"README preview",children:[L.jsx("h3",{children:i.title}),i.subtitle&&L.jsx("p",{className:"readme-subtitle",children:i.subtitle}),i.sections.map(s=>{const o=s.ordered?"ol":"ul";return L.jsxs("section",{children:[L.jsx("h4",{children:s.title}),s.paragraphs.map((c,h)=>L.jsx("p",{children:c},h)),s.items.length>0&&L.jsx(o,{children:s.items.map((c,h)=>L.jsx("li",{children:c},h))})]},s.title)})]})]})]})}function Om({children:r,className:t=""}){const i=Ce.useRef(null),e=Ce.useRef(null);return Ce.useLayoutEffect(()=>{const s=i.current,o=e.current,c=()=>{const d=o.getBoundingClientRect().height;s.style.height=`${d}px`};c();const h=new ResizeObserver(c);return h.observe(o),()=>h.disconnect()},[]),L.jsx("div",{ref:i,className:`smooth-height ${t}`,children:L.jsx("div",{ref:e,className:"smooth-height-content",children:r})})}const BN="0.1.2",kN=[{version:"0.1.2",date:"2026-10-06",groups:[{title:"Changed",changes:["App and drawer text is smaller and lighter, with consistent 21px medium serif headings and upright typography throughout, including the haiku.","Quick Start headings use periods in place of slash separators.","Quick Start uses the published npm package instead of requiring a local blnkfld checkout and build."]}]},{version:"0.1.1",date:"2026-10-06",groups:[{title:"Changed",changes:["System Architecture and Trace one action now step through five, four, three, two, and one column as the window narrows, preserving selection and playback.","Newly generated IN ONE MINUTE summaries contain one to five sentences, with additional detail in the expanded summary.","The changelog groups release notes by version and date and shows only releases up to the running app's version.","The hosted interface uses Lora and Times New Roman as fallbacks when Iowan Old Style is unavailable."]}]},{version:"0.1.0",date:"2026-10-05",groups:[{title:"Added",changes:["Run npx blnkfld inside a project to generate a source-backed brief using your installed Codex or Claude Code CLI.","Explore the project's system overview, architecture, and an action trace, with source excerpts supporting the explanation.","Read a project summary and haiku, inspect setup instructions, and export the brief as a README.","View reports in a local browser interface with bundled Inter, Geist Mono, IBM Plex Mono, and Lora fonts. Serif text prefers Iowan Old Style when installed, then Lora and Times New Roman."]}]}],zN=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric",timeZone:"UTC"});function HN(){const r=Ce.useRef(null);return L.jsxs(L.Fragment,{children:[L.jsx("button",{className:"changelog-trigger",type:"button","aria-haspopup":"dialog",onClick:()=>r.current.showModal(),children:"CHANGELOG"}),L.jsxs("dialog",{ref:r,className:"changelog-drawer release-notes-drawer","aria-labelledby":"changelog-title",onClick:t=>{if(t.target===r.current){const i=r.current.getBoundingClientRect();(t.clientX<i.left||t.clientX>i.right||t.clientY<i.top||t.clientY>i.bottom)&&r.current.close()}},children:[L.jsxs("header",{children:[L.jsxs("div",{children:[L.jsx("span",{className:"eyebrow",children:"BLNKFLD / RELEASE NOTES"}),L.jsx("h2",{id:"changelog-title",children:"Changelog"}),L.jsxs("p",{children:["What’s changed through v",BN,"."]})]}),L.jsx(Um,{label:"Close changelog",onClick:()=>r.current.close()})]}),L.jsx("div",{className:"changelog-list",children:kN.map(t=>L.jsxs("article",{className:"changelog-entry",children:[L.jsx("time",{className:"changelog-date",dateTime:t.date,children:zN.format(new Date(`${t.date}T00:00:00Z`))}),L.jsxs("div",{children:[L.jsxs("h3",{children:["v",t.version]}),t.groups.map(i=>L.jsxs("section",{className:"changelog-category",children:[L.jsx("h4",{children:i.title}),L.jsx("ul",{children:i.changes.map(e=>L.jsx("li",{children:e},e))})]},i.title))]})]},t.version))})]})]})}function VN({report:r,selected:t,onSelect:i,curated:e}){var v,_,A;const[s,o]=Ce.useState(!1),[c,h]=Ce.useState(null),d=S_(),f=Ce.useMemo(()=>NN(r.system,r.connections,d),[r.system,r.connections,d]),g=f.edges[c];function x(b){h(null),i(b)}function y(b){h(b),i(r.system.findIndex(S=>S.id===f.edges[b].from))}return L.jsxs("div",{className:"connections architecture-connections",children:[L.jsxs("div",{className:"connection-toolbar",children:[L.jsx("span",{children:"ENTIRE ARCHITECTURE"}),L.jsx("button",{disabled:!r.system[t],"aria-pressed":s,onClick:()=>o(!s),children:s?"Show all connections equally":"Highlight selected component"})]}),L.jsx("p",{className:"connection-context",children:e?"Reference architecture · arrows describe the documented interaction.":r.analysisKind==="agent"?"Source-based explanation · arrows describe the reported relationship, not an observed execution.":"Static imports · arrows point from the importing file to its dependency, not the direction of runtime data."}),L.jsx(v_,{layout:f,selected:t,onSelect:x,focused:s,activeEdge:c,onEdge:y}),!f.edges.length&&L.jsx("p",{className:"connection-empty",children:"No connections were established in this report. Components remain available to inspect."}),L.jsx(Om,{children:g&&L.jsxs("section",{className:"architecture-evidence","aria-label":"Selected connection evidence",children:[L.jsxs("div",{children:[L.jsxs("span",{className:"eyebrow",children:["CONNECTION / ",String(g.index+1).padStart(2,"0")]}),L.jsx("button",{onClick:()=>h(null),"aria-label":"Close connection evidence",children:"×"})]}),L.jsxs("h3",{children:[(v=r.system.find(b=>b.id===g.from))==null?void 0:v.label," → ",(_=r.system.find(b=>b.id===g.to))==null?void 0:_.label]}),L.jsx("p",{children:g.labelText}),(A=g.evidence)==null?void 0:A.map(b=>{var S;return L.jsxs("div",{className:"source-file",children:[L.jsxs("span",{children:[b,g.line?` · line ${g.line}`:""]}),L.jsx("p",{children:((S=r.evidence.find(R=>R.path===b))==null?void 0:S.claim)||"Referenced by this relationship."})]},b)})]})})]})}function GN({nodes:r,selected:t,onSelect:i,connections:e,label:s}){const o=Ce.useId().replaceAll(":",""),c=98*Xu/Jn,h=Math.max(360,(r.length-1)*c+210),d=r.map((y,v)=>105+v*c),f=e===void 0?r.slice(1).map((y,v)=>[v,v+1]):e.map(y=>[r.findIndex(v=>v.id===y.from),r.findIndex(v=>v.id===y.to)]).filter(([y,v])=>y>=0&&v>=0),g=(y,v,_,A,b,S)=>L.jsxs("g",{children:[L.jsx("polygon",{points:`${y-_},${v-b} ${y},${v+A-b} ${y},${v+A} ${y-_},${v}`,fill:"#cecece"}),L.jsx("polygon",{points:`${y},${v+A-b} ${y+_},${v-b} ${y+_},${v} ${y},${v+A}`,fill:"#b4b4b4"}),L.jsx("polygon",{points:`${y-_},${v-b} ${y},${v-A-b} ${y+_},${v-b} ${y},${v+A-b}`,fill:"#e9e9e9"})]},S);function x(y){return["browser","cli","input"].includes(y)?L.jsxs("g",{children:[g(0,120,18,8,4),L.jsx("path",{d:"M0 111V88",stroke:"#aaa",strokeWidth:"5"}),L.jsx("polygon",{points:"-28,54 28,78 28,111 -28,87",fill:"#aaa"}),L.jsx("polygon",{points:"-23,61 23,81 23,103 -23,83",fill:"#333"})]}):y==="react"?[0,1,2].map(v=>g(0,117-v*14,35-v*7,17-v*3,5,v)):y==="database"?L.jsx("g",{children:[0,1,2].map(v=>L.jsxs("g",{children:[L.jsx("path",{d:`M-25 ${110-v*16}v12c0 13 50 13 50 0v-12`,fill:"#bbb"}),L.jsx("ellipse",{cy:110-v*16,rx:"25",ry:"10",fill:"#ddd"})]},v))}):y==="api"?L.jsxs("g",{children:[g(-22,113,10,8,40),g(22,113,10,8,40),g(0,77,33,9,8)]}):y==="file"||y==="output"?L.jsxs("g",{children:[g(0,118,34,18,5),y==="output"&&L.jsx("path",{d:"M-20 110l28 13m-18-18l28 13m-18-18l28 13",stroke:"#777",strokeWidth:"2"})]}):y==="operation"?L.jsxs("g",{children:[L.jsx("path",{d:"M-25 90v28c0 14 50 14 50 0V90",fill:"#bbb"}),L.jsx("ellipse",{cy:"90",rx:"25",ry:"13",fill:"#ddd"})]}):y==="transfer"?g(0,104,27,18,15):g(0,119,29,16,36)}return L.jsxs("div",{className:"isometric-fallback",children:[L.jsx("span",{className:"fallback-caption",children:"ISOMETRIC COMPATIBILITY VIEW"}),L.jsxs("svg",{viewBox:`0 0 ${h} 220`,role:"group","aria-label":s.replace("three-dimensional","isometric"),children:[L.jsx("defs",{children:L.jsx("marker",{id:o,viewBox:"0 0 8 8",refX:"7",refY:"4",markerWidth:"5",markerHeight:"5",orient:"auto",children:L.jsx("path",{d:"M0 0 8 4 0 8Z",fill:"context-stroke"})})}),f.map(([y,v],_)=>L.jsx("path",{d:`M${d[y]} 148 V${175+_*5} H${d[v]} V148`,fill:"none",stroke:(t==null?void 0:t.index)===y||(t==null?void 0:t.index)===v?"var(--accent)":"#aaa",strokeWidth:"1.2",markerEnd:`url(#${o})`},_)),r.map((y,v)=>L.jsxs("g",{transform:`translate(${d[v]} 0)`,role:"button",tabIndex:"0","aria-label":`Select ${y.label}`,"aria-pressed":(t==null?void 0:t.index)===v,onClick:()=>i(v),onKeyDown:_=>{["Enter"," "].includes(_.key)&&(_.preventDefault(),i(v))},style:{cursor:"pointer"},children:[L.jsx("title",{children:y.label}),g(0,143,49,24.5,7),x(y.kind),L.jsx("path",{d:"M-32 143l19 9",stroke:(t==null?void 0:t.index)===v?"var(--accent)":"#777",strokeWidth:"3"}),L.jsx("text",{y:"210",textAnchor:"middle",fill:(t==null?void 0:t.index)===v?"var(--accent)":"#555",fontSize:"var(--mono-size)",fontFamily:"var(--mono)",fontWeight:"700",children:String(v+1).padStart(2,"0")})]},y.id||v))]})]})}function XN({nodes:r,selected:t,onSelect:i,connections:e,label:s="Interactive three-dimensional repository system"}){const o=Ce.useRef(null),c=Ce.useRef({selected:t,onSelect:i});c.current={selected:t,onSelect:i};const[h,d]=Ce.useState(!1);return Ce.useEffect(()=>{const f=o.current,g=getComputedStyle(f).getPropertyValue("--accent").trim();let x;try{x=new y_({antialias:!0,alpha:!0,preserveDrawingBuffer:!0})}catch{d(!0);return}x.setPixelRatio(Math.min(window.devicePixelRatio,2)),x.shadowMap.enabled=!0,x.shadowMap.type=PS,f.appendChild(x.domElement);const y=PM(r.length),v=new JS,_=new Gl(-9,9,7,-7,.1,100);_.position.set(5,13,20),_.lookAt(0,0,0),v.add(new E1(16777215,11908533,3));const A=new c_(16777215,4);A.position.set(-3,12,7),A.castShadow=!0,A.shadow.mapSize.set(2048,2048),Object.assign(A.shadow.camera,{left:-14,right:14,top:12,bottom:-12}),A.shadow.normalBias=.03,v.add(A);const b=[],S=[];function R(Et,Zt,me,Rt=0,fe=0,te=0){b.push(Et);const re=new o_({color:Zt,roughness:.75});S.push(re);const Pe=new Hn(Et,re);return Pe.position.set(Rt,fe,te),Pe.castShadow=!0,Pe.receiveShadow=!0,me.add(Pe),Pe}v.background=new ve(getComputedStyle(f).getPropertyValue("--paper").trim());const k=new g1({opacity:.12});S.push(k);const N=new Vl(200,200);b.push(N);const D=new Hn(N,k);D.position.y=-.005,D.rotation.x=-Math.PI/2,D.receiveShadow=!0,v.add(D);const I=new R1(y.gridSize,y.gridSize/Na,wM,CS);I.position.set(y.gridX,.002,y.gridZ),v.add(I);const F=[],M=[],w=[],H=[];r.forEach((Et,Zt)=>{const me=new co;me.position.set(y.centers[Zt],0,0),v.add(me),F.push(me);const Rt=new co;me.add(Rt),M.push(Rt),R(new yi(Jn,.18,Jn),"#d3d3d3",me,0,.09,0);const fe=R(new yi(.58,.025,.08),"#777777",me,-.65,.2,1);if(fe.material.dispose(),fe.material=new Zu({color:"#777777",toneMapped:!1}),S.push(fe.material),w.push(fe),Et.kind==="browser"||Et.kind==="input"||Et.kind==="cli")R(new yi(1.8,1.35,.15),"#555555",Rt,0,1.05,-.2),R(new yi(1.58,1.12,.025),"#252525",Rt,0,1.05,-.11),R(new yi(.1,.55,.12),"#818181",Rt,0,.45,-.2),R(new yi(1,.08,.55),"#adadad",Rt,0,.25,0);else if(Et.kind==="database")for(let te=0;te<3;te++)R(new Qu(.78,.78,.3,64),"#b9b9b9",Rt,0,.42+te*.36,0);else if(Et.kind==="output"){R(new yi(1.7,.14,1.5),"#eeeeee",Rt,0,.35,0);for(let te=0;te<3;te++)R(new yi(1.1,.03,.12),"#777777",Rt,0,.44,-.35+te*.3)}else if(Et.kind==="operation")R(new Qu(.7,.7,.65,8),"#bfbfbf",Rt,0,.6,0);else if(Et.kind==="transfer"){const te=R(new yi(1.25,.25,.9),"#bfbfbf",Rt,0,.7,0);te.rotation.y=Math.PI/4}else if(Et.kind==="react")for(let te=0;te<3;te++)R(new yi(1.8-te*.22,.22,1.5-te*.15),"#c1c1c1",Rt,0,.4+te*.35,0);else if(Et.kind==="step"||Et.kind==="file")R(new yi(1.65,.22,1.4),"#bfbfbf",Rt,0,.42,0);else if(Et.kind==="api")R(new yi(.35,1.3,1.25),"#b8b8b8",Rt,-.65,.85,0),R(new yi(.35,1.3,1.25),"#b8b8b8",Rt,.65,.85,0),R(new yi(1.65,.25,1.25),"#d8d8d8",Rt,0,1.5,0);else{R(new yi(1.65,1.3,1.4),"#bfbfbf",Rt,0,.85,0);for(let te=0;te<6;te++)R(new yi(.85,.035,.025),"#6b6b6b",Rt,0,.55+te*.13,.715)}me.traverse(te=>{te.isMesh&&(te.userData.index=Zt)}),!e&&Zt<r.length-1&&H.push(R(new yi(wS,.025,.045),"#999999",v,me.position.x+Xu/2,.03,0))}),e&&e.forEach((Et,Zt)=>{const me=r.findIndex(Le=>Le.id===Et.from),Rt=r.findIndex(Le=>Le.id===Et.to);if(me<0||Rt<0||me===Rt)return;const fe=F[me].position.x,te=F[Rt].position.x,re=-Jn/2-(Zt+1)*Na,Pe=[new Z(fe,.03,-Jn/2),new Z(fe,.03,re),new Z(te,.03,re),new Z(te,.03,-Jn/2)],ri=new m1;for(let Le=1;Le<Pe.length;Le++)ri.add(new s_(Pe[Le-1],Pe[Le]));const pi=R(new Lm(ri,24,.015,4,!1),"#999999",v);pi.userData.source=me,pi.userData.target=Rt,H.push(pi)}),H.forEach(Et=>{Et.material.dispose(),Et.material=new Zu({color:"#999999",toneMapped:!1}),S.push(Et.material)});const V=new N1,X=new le;function $(Et){const Zt=f.getBoundingClientRect();return X.set((Et.clientX-Zt.left)/Zt.width*2-1,-(Et.clientY-Zt.top)/Zt.height*2+1),V.setFromCamera(X,_),V.intersectObjects(F,!0)[0]}function W(Et){const Zt=$(Et);Zt&&c.current.onSelect(Zt.object.userData.index)}function Q(Et){f.style.cursor=$(Et)?"pointer":"default"}f.addEventListener("click",W),f.addEventListener("pointermove",Q);let O=!0;const z=new ResizeObserver(()=>{const Et=f.clientWidth,Zt=f.clientHeight;x.setSize(Et,Zt);const me=Et/Zt,Rt=Math.max(4.5,(y.width/2+1.25)/me);_.left=-Rt*me,_.right=Rt*me,_.top=Rt,_.bottom=-Rt,_.updateProjectionMatrix(),O=!0});z.observe(f);const st=window.matchMedia("(prefers-reduced-motion: reduce)"),et=new ve(g),dt=new ve(g),U=new ve("#777777"),nt=new ve("#999999");let mt,At,It=0,Gt=!1,ot=[],yt=[],wt=[];function ce(Et){var me;const Zt=(me=c.current.selected)==null?void 0:me.index;if((Zt!==At||At===void 0&&!ot.length)&&(ot=M.map(Rt=>Rt.position.y),yt=w.map(Rt=>Rt.material.color.clone()),wt=H.map(Rt=>Rt.material.color.clone()),At=Zt,It=Et,Gt=!0),Gt||O){const Rt=st.matches?1:Math.min((Et-It)/360,1),fe=1-Math.pow(1-Rt,3);F.forEach((te,re)=>{M[re].position.y=PA.lerp(ot[re],re===Zt?.22:0,fe),w[re].material.color.lerpColors(yt[re],re===Zt?dt:U,fe)}),H.forEach((te,re)=>{te.material.color.lerpColors(wt[re],(e?te.userData.target===Zt||te.userData.source===Zt:re===Zt-1)?et:nt,fe)}),x.render(v,_),Gt=Rt<1,O=!1}mt=requestAnimationFrame(ce)}return mt=requestAnimationFrame(ce),()=>{cancelAnimationFrame(mt),z.disconnect(),f.removeEventListener("click",W),f.removeEventListener("pointermove",Q),b.forEach(Et=>Et.dispose()),S.forEach(Et=>Et.dispose()),I.geometry.dispose(),I.material.dispose(),x.dispose(),x.domElement.remove()}},[r,e]),L.jsx("div",{className:"instrument-scene",ref:o,"aria-label":s,children:h&&L.jsx(GN,{nodes:r,selected:t,onSelect:i,connections:e,label:s})})}function ap({path:r}){const t=r.split("/");return t.map((i,e)=>L.jsxs(Ce.Fragment,{children:[i,e<t.length-1&&L.jsxs(L.Fragment,{children:["/",L.jsx("wbr",{})]})]},e))}function nS({report:r,curated:t,node:i,active:e,trace:s,step:o,mode:c,tab:h,setTab:d}){var g;const f=(s==null?void 0:s.evidence)||(i==null?void 0:i.evidence)||[];return L.jsxs("aside",{className:`instrument-inspector inspector-${c}`,"aria-label":c==="system"?"02 / Module details":"03 / Action details","data-tab":h,children:[L.jsx("div",{className:"inspector-tabs",children:["part","files","notes"].map(x=>L.jsx("button",{"aria-pressed":h===x,onClick:()=>d(x),children:x},x))}),L.jsxs(Om,{className:"inspector-content",children:[h==="part"?L.jsxs(L.Fragment,{children:[L.jsxs("span",{className:"eyebrow",children:[c==="trace"?s?`ACTION STEP / ${String(o+1).padStart(2,"0")}`:"ACTION OVERVIEW":`SELECTED MODULE / ${String(e+1).padStart(2,"0")}`," "]}),L.jsx("h2",{children:c==="trace"?(s==null?void 0:s.title)||r.traceTitle:(i==null?void 0:i.label)||"No source components"}),s&&i&&L.jsxs("p",{className:"inspection-context",children:["MODULE ",String(e+1).padStart(2,"0")," / ",i.label]}),L.jsx("p",{children:c==="trace"?(s==null?void 0:s.description)||r.traceSummary:(i==null?void 0:i.detail)||"No readable components were established."}),L.jsx("div",{className:"inspector-rule"}),L.jsx("span",{className:"eyebrow",children:f.length?"SUPPORTING FILES":"EVIDENCE STATUS"}),f.length?f.map(x=>{var y,v,_;return L.jsxs("div",{className:"source-file",children:[L.jsxs("span",{children:["↳ ",L.jsx(ap,{path:x})]}),L.jsx("p",{children:((y=r.evidence.find(A=>A.path===x))==null?void 0:y.claim)||"Referenced by this action step."}),((v=r.evidence.find(A=>A.path===x))==null?void 0:v.excerpt)&&L.jsxs("details",{children:[L.jsxs("summary",{children:["Read source excerpt",(_=r.evidence.find(A=>A.path===x))!=null&&_.startLine?` · lines ${r.evidence.find(A=>A.path===x).startLine}–${r.evidence.find(A=>A.path===x).endLine}`:""]}),L.jsx("pre",{children:r.evidence.find(A=>A.path===x).excerpt})]})]},x)}):L.jsx("p",{children:c==="trace"&&!s?"Select an action step to inspect its supporting files.":"No source references are attached to this selection."}),!t&&((g=r.connections)==null?void 0:g.filter(x=>x.from===(i==null?void 0:i.id)||x.to===(i==null?void 0:i.id)).map((x,y)=>L.jsxs("div",{className:"source-file",children:[L.jsxs("span",{children:[x.from," → ",x.to]}),L.jsx("p",{children:r.analysisKind==="agent"?x.label:`Import declared in ${x.from}:${x.line}.`})]},`edge-${y}`))),L.jsx("div",{className:"inspector-note",children:t?"Reference explanation. Playback illustrates the documented sequence; it is not a live execution.":r.analysisKind==="agent"?"Agent-authored source analysis. References are checked against local files; interpretations and runtime behavior are not independently verified.":"Source imports and direct calls only. This is a static reading, not a verified runtime or deployment graph."})]}):h==="files"?L.jsxs(L.Fragment,{children:[L.jsx("span",{className:"eyebrow",children:"REPOSITORY EVIDENCE"}),L.jsx("h2",{children:"Source index"}),r.evidence.map(x=>L.jsxs("div",{className:"source-file",children:[L.jsx("span",{children:L.jsx(ap,{path:x.path})}),L.jsx("p",{children:x.claim})]},x.path))]}):L.jsxs(L.Fragment,{children:[L.jsx("span",{className:"eyebrow",children:"OPERATOR NOTES"}),L.jsx("h2",{children:"What matters"}),L.jsx("p",{children:r.matters}),L.jsx("h3",{children:"Data & persistence"}),L.jsx("p",{children:r.dataSummary}),L.jsx("h3",{children:"Project map"}),r.projectMap.map(x=>L.jsxs("div",{className:"source-file",children:[L.jsx("span",{children:L.jsx(ap,{path:x.path})}),L.jsx("p",{children:x.description})]},x.path)),L.jsx("h3",{children:"Tech stack"}),L.jsx("p",{children:r.stack.join(" / ")}),r.decisions.map(x=>L.jsx("p",{children:x},x))]}),L.jsxs("div",{className:"inspector-footer",children:[r.fileCount," FILES / ",r.generatedAt,L.jsx("br",{}),"SOURCE: ",r.sourceLabel]})]})]})}function WN({initialReport:r=Da}){const[t,i]=Ce.useState(r),[e,s]=Ce.useState(0),[o,c]=Ce.useState(-1),[h,d]=Ce.useState(!1),[f,g]=Ce.useState("part"),[x,y]=Ce.useState("part"),[v,_]=Ce.useState(""),[A,b]=Ce.useState(!1),[S,R]=Ce.useState(""),[k,N]=Ce.useState(!1),[D,I]=Ce.useState("3d"),F=Ce.useRef(null),M=t===Da,w=o>=0?t.system.findIndex(O=>{var z;return O.id===((z=t.trace[o])==null?void 0:z.nodeId)}):-1;function H(O){c(O),d(!1),y("part")}Ce.useEffect(()=>{if(!h)return;const O=setTimeout(()=>{if(o>=t.trace.length-1){d(!1);return}c(o+1)},1300);return()=>clearTimeout(O)},[h,o,t]);function V(O){s(O),g("part")}async function X(O){b(!0),R("");try{i(await O()),s(0),c(-1),d(!1),g("part"),y("part"),N(!1)}catch(z){R(z.message)}finally{b(!1)}}const $=t.system[e],W=t.system[w],Q=t.trace[o];return L.jsxs("main",{className:"instrument instrument-cards",children:[L.jsxs("header",{className:"instrument-header",children:[L.jsxs("a",{className:"instrument-brand",href:"/",children:[L.jsx("div",{className:"brand-logo","aria-hidden":"true"}),L.jsx("div",{className:"wordmark",children:"blnkfld"}),L.jsx("div",{className:"product-label",children:"Agentic README"})]}),L.jsxs("nav",{className:"instrument-header-right","aria-label":"Sections",children:[L.jsx("a",{href:"#repository",children:"01 / REPOSITORY"}),L.jsx("a",{href:"#system",children:"02 / SYSTEM"}),L.jsxs("a",{href:"#action",children:["03 / ",M||t.analysisKind==="agent"?"TRACE ONE ACTION":"SOURCE CALL PATH"]}),L.jsx("a",{href:"#how-to-run",children:"04 / GET STARTED"})]})]}),L.jsxs("div",{className:`instrument-body ${Q?"inspecting-trace":"inspecting-system"}`,children:[L.jsxs("section",{className:"instrument-workspace",children:[L.jsxs("div",{id:"repository",className:"instrument-title",children:[L.jsxs("div",{children:[L.jsx("span",{className:"eyebrow",children:M?"01 / REFERENCE REPOSITORY":"01 / IMPORTED REPOSITORY"}),L.jsx("h1",{children:t.name}),L.jsx("p",{children:t.subtitle})]}),L.jsx(FN,{report:t})]}),L.jsxs("div",{className:"instrument-summary",children:[L.jsx("span",{className:"eyebrow",children:"IN ONE MINUTE"}),L.jsx("p",{children:t.summary}),Array.isArray(t.haiku)&&t.haiku.length===3&&L.jsxs(L.Fragment,{children:[L.jsx("span",{className:"eyebrow project-haiku-label",children:"A HAIKU"}),L.jsx("p",{className:"project-haiku","aria-label":"Project haiku",children:t.haiku.map((O,z)=>L.jsx("span",{children:O},z))})]})]}),L.jsx("hr",{className:"section-divider divider-system"}),L.jsxs("section",{id:"system",className:"scene-wrap","aria-labelledby":"system-heading",children:[L.jsxs("div",{className:"system-heading",children:[L.jsxs("div",{children:[L.jsxs("span",{className:"eyebrow",children:["02 / SYSTEM / ",String(t.system.length).padStart(2,"0")," COMPONENTS"]}),L.jsx("h2",{id:"system-heading",children:"How the parts work together"})]}),L.jsx("div",{className:"system-view","aria-label":"System view",children:["3d","connections"].map(O=>L.jsx("button",{"aria-pressed":D===O,onClick:()=>I(O),children:O==="3d"?"SYSTEM OVERVIEW":"SYSTEM ARCHITECTURE"},O))})]}),L.jsx(Om,{children:L.jsxs("div",{className:"view-enter",children:[D==="3d"&&L.jsxs(L.Fragment,{children:[L.jsx(XN,{nodes:t.system,connections:M?void 0:t.connections,selected:{index:e},onSelect:V}),L.jsx("div",{className:"module-controls",children:t.system.map((O,z)=>L.jsxs("button",{onClick:()=>V(z),"aria-pressed":e===z,children:[L.jsx("span",{children:String(z+1).padStart(2,"0")}),L.jsx("strong",{children:O.label})]},O.id))})]}),D==="connections"&&L.jsx(VN,{report:t,selected:e,onSelect:V,curated:M},t.sourceLabel+t.generatedAt)]},D)})]}),t.analysisKind==="agent"&&L.jsxs("p",{className:"analysis-coverage",children:["Source references checked in ",t.evidence.length," files · ",t.fileCount," files inventoried · Static analysis by ",t.agent]}),t.analysisKind!=="agent"&&t.coverage&&L.jsxs("p",{className:"analysis-coverage",children:["Read ",t.coverage.readCount," of ",t.coverage.totalCount," files · Parsed ",t.coverage.parsedCount," JavaScript/TypeScript files",t.coverage.omittedCount>0?` · ${t.coverage.omittedCount} additional modules omitted from this view`:"",t.coverage.treeTruncated?" · GitHub tree is incomplete":"",". Other languages are not analyzed."]}),L.jsx("hr",{className:"section-divider divider-action"}),L.jsxs("section",{id:"action",className:"sequencer",children:[L.jsxs("div",{className:"sequence-heading",children:[L.jsxs("div",{children:[L.jsxs("span",{className:"eyebrow",children:["03 / ",M||t.analysisKind==="agent"?"TRACE ONE ACTION":"SOURCE CALL PATH"]}),L.jsx("h2",{children:t.traceTitle})]}),L.jsx("button",{className:"play-button","aria-label":h?"Pause action trace":"Play action trace",title:h?"Pause":"Play","aria-pressed":h,disabled:!t.trace.length,onClick:()=>{h?d(!1):((o<0||o===t.trace.length-1)&&c(0),d(!0),y("part"))},children:L.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:h?L.jsx("path",{d:"M9 6v12M15 6v12"}):L.jsx("path",{d:"m9 5 10 7-10 7Z"})})})]}),L.jsx("p",{className:"action-summary",children:t.traceSummary}),L.jsx(LN,{report:t,selected:o,onSelect:H})]}),L.jsx("hr",{className:"section-divider divider-run"}),L.jsxs("section",{id:"how-to-run",className:"instrument-run","aria-labelledby":"run-heading",children:[L.jsx("span",{className:"eyebrow",children:"04 / GET STARTED"}),L.jsx("h2",{id:"run-heading",children:"How to run"}),L.jsx("p",{children:t.howToRun}),L.jsxs("div",{className:"run-evidence",children:[L.jsx("span",{children:"EVIDENCE"}),(t.runEvidence||[]).map(O=>L.jsx("span",{children:O},O))]})]})]}),L.jsx(nS,{report:t,curated:M,node:$,active:e,mode:"system",tab:f,setTab:g}),L.jsx(nS,{report:t,curated:M,node:W,active:w,trace:Q,step:o,mode:"trace",tab:x,setTab:y}),["repository","system","action","run"].map(O=>L.jsx("div",{className:`section-card-outline card-${O}`,"aria-hidden":"true"},O))]}),L.jsxs("footer",{className:"instrument-footer",children:[L.jsx("button",{onClick:()=>N(!k),children:"+ CHANGE REPOSITORY"}),L.jsx("span",{children:A?"ANALYZING…":t.sourceLabel}),L.jsxs("div",{className:"footer-links",children:[L.jsx(HN,{}),L.jsx("span",{"aria-hidden":"true",children:"/"}),L.jsx(IN,{})]})]}),k&&L.jsxs("form",{className:"repository-popover",onSubmit:O=>{O.preventDefault(),X(()=>CM(v))},children:[L.jsx("label",{htmlFor:"repo-url",children:"Public GitHub repository"}),L.jsx("input",{id:"repo-url",value:v,onChange:O=>_(O.target.value),placeholder:"https://github.com/owner/repository",required:!0}),L.jsx("button",{disabled:A,children:"Analyze repository ↗"}),L.jsx("button",{type:"button",disabled:A,onClick:()=>F.current.click(),children:"Choose local folder"}),L.jsx("button",{type:"button",onClick:()=>N(!1),children:"Close"}),S&&L.jsx("p",{role:"alert",children:S})]}),L.jsx("input",{ref:F,type:"file",webkitdirectory:"",multiple:!0,hidden:!0,onChange:O=>{const z=Array.from(O.target.files);z.length&&X(()=>AM(z)),O.target.value=""}})]})}const rp=Ob.createRoot(document.getElementById("root"));async function qN(){const r=new URLSearchParams(window.location.search);let t;if(r.get("local")==="1"||document.querySelector('meta[name="blnkfld-local"]')){rp.render(L.jsx("p",{style:{padding:36},children:"Opening your project brief…"}));try{const i=await fetch("/api/report");if(!i.ok)throw new Error("Could not load the local report. Open the link printed by blnkfld in your terminal.");if(t=await i.json(),!t.system||!t.evidence)throw new Error("The local report is invalid.");r.has("token")&&(r.delete("token"),window.history.replaceState(null,"","?"+r.toString()))}catch(i){rp.render(L.jsx("p",{role:"alert",style:{padding:36},children:i.message}));return}}rp.render(L.jsx(Pb.StrictMode,{children:L.jsx(WN,{initialReport:t})}))}qN();
|
package/dist/client/index.html
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>blnkfld — Agentic README</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-VNVorZBE.js"></script>
|
|
8
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BuhHZCBK.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
11
11
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@font-face{font-family:Lora Variable;src:url(/assets/lora-latin-wght-normal-BiLcIKcI.woff2) format("woff2");font-style:normal;font-weight:400 700;font-display:swap}@font-face{font-family:Lora Variable;src:url(/assets/lora-latin-wght-italic-DBI-iqMr.woff2) format("woff2");font-style:italic;font-weight:400 700;font-display:swap}@font-face{font-family:Inter Variable;src:url(/assets/inter-latin-wght-normal-Dx4kXJAl.woff2) format("woff2");font-style:normal;font-weight:100 900;font-display:swap}@font-face{font-family:Geist Mono Variable;src:url(/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2) format("woff2");font-style:normal;font-weight:100 900;font-display:swap}@font-face{font-family:IBM Plex Mono;src:url(/assets/ibm-plex-mono-latin-700-normal-7sUh57Bg.woff2) format("woff2");font-style:normal;font-weight:700;font-display:swap}:root{--sans: "Inter Variable", sans-serif;--mono: "Geist Mono Variable", "IBM Plex Mono", monospace;--serif: "Iowan Old Style", "Lora Variable", "Times New Roman", serif}:root{color:#000;background:var(--paper);font-family:var(--sans);font-synthesis:none;font-weight:500;--paper: #fefefe;--ink: #000;--muted: rgba(0, 0, 0, .8);--line: #000;--hover-background: #181818;--diagram-pattern-color: rgba(0, 0, 0, .12);--accent: #D63800;--green: var(--accent);--mono-size: 11px}*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;min-width:320px;min-height:100vh;-webkit-font-smoothing:antialiased;background:var(--paper)}button,input{font:inherit}button{color:inherit}.brand-logo{width:28px;height:28px;border-radius:50%;background:repeating-linear-gradient(to bottom,var(--ink) 0 2px,var(--paper) 2px 4px);margin-bottom:10px;flex-shrink:0}.wordmark{font-family:var(--serif);font-size:26px;line-height:1;letter-spacing:.01em;font-weight:600}.product-label{color:var(--green);margin-top:4px;font-family:var(--mono);font-size:var(--mono-size);line-height:1.15;letter-spacing:.08em;text-transform:uppercase;font-weight:700}h1,h2,h3,h4,h5,h6{font-family:var(--serif)}h1,h2,h3{margin:0;font-weight:600;color:var(--ink)}h1{font-size:25px;letter-spacing:0;line-height:1.12}::selection{background:var(--accent);color:var(--paper)}code,pre,kbd,samp{font-family:var(--mono);font-weight:700;font-size:var(--mono-size)}.instrument{--surface:var(--paper);--text:var(--ink);--soft:var(--muted);--rule:var(--line);background:var(--surface);color:var(--text);min-height:100vh;font-family:var(--sans);font-size:14px}.instrument button,.instrument input{font:inherit}.instrument button{cursor:pointer}.instrument button:focus-visible,.instrument a:focus-visible,.instrument input:focus-visible{outline:2px solid var(--accent);outline-offset:4px}.instrument-header{height:92px;padding:0 36px;display:flex;align-items:center;justify-content:space-between}.instrument a{color:inherit;text-decoration:none}.instrument-brand{font-size:26px;letter-spacing:-1.5px;font-weight:600;display:flex;align-items:center;gap:25px}.instrument-header-right,.eyebrow,.instrument-status,.scene-caption,.inspector-tabs,.instrument-footer,.inspector-footer{font-family:var(--mono);font-size:var(--mono-size);letter-spacing:.06em;font-weight:700}.instrument-header-right{display:flex;gap:36px}.instrument-header-right>span{color:var(--soft)}.instrument-body{display:grid;grid-template-columns:minmax(0,1fr) 300px;min-height:calc(100vh - 145px)}.instrument-workspace{padding:36px 36px 25px;min-width:0}.instrument-title{display:flex;justify-content:space-between;gap:20px}.eyebrow{color:var(--soft);display:block}.instrument h1{font-size:35px;letter-spacing:-1.5px;font-weight:500;margin:13px 0 9px}.instrument-title p{color:var(--soft);max-width:580px;font-size:13px;line-height:1.6;margin:0}.instrument-status{white-space:nowrap;height:fit-content;display:flex;gap:8px;align-items:center}.instrument-status:before{content:"";background:var(--ink);width:6px;height:6px;border-radius:50%}.scene-wrap{margin-top:35px}.scene-caption{display:flex;justify-content:space-between;color:var(--soft);font-size:var(--mono-size)}.instrument-scene{height:320px;width:100%;position:relative;overflow:hidden}.instrument-scene canvas{display:block}.module-controls{display:grid;grid-template-columns:repeat(5,1fr);gap:12px}.module-controls button{text-align:left;border:0;background:none;padding:13px 0;color:var(--text);min-width:0}.module-controls button>span{font-family:var(--mono);font-size:var(--mono-size);display:block;margin-bottom:10px;font-weight:700}.module-controls strong{font-size:12px;font-weight:500;display:block}.module-controls small{font-size:11px;color:var(--soft);display:block;margin-top:5px}.module-controls button[aria-pressed=true]>span{color:var(--accent)}.module-controls button[aria-pressed=true]{box-shadow:0 -2px var(--accent)}.instrument-summary{display:grid;grid-template-columns:130px 1fr;gap:20px;margin:24px 0 32px}.instrument-summary p{margin:0;max-width:670px;font-size:13px;line-height:1.8;color:var(--muted)}.instrument-summary .eyebrow{padding-top:4px}.sequencer{padding-top:24px}.sequence-heading{display:flex;align-items:center;justify-content:space-between}.sequence-heading h2{font-size:21px;font-weight:500;margin:10px 0 20px}.play-button{width:32px;height:32px;flex-shrink:0;display:grid;place-items:center;padding:0;background:transparent;color:var(--ink);border:1px solid var(--ink);border-radius:50%}.play-button svg{width:16px;height:16px;display:block}.instrument-inspector{padding:0 25px 25px;position:relative}.inspector-tabs{height:66px;display:flex;gap:23px;align-items:center;margin-bottom:32px}.inspector-tabs button{border:0;background:none;text-transform:uppercase;color:var(--soft);font-size:var(--mono-size);padding:8px 0}.inspector-tabs button[aria-pressed=true]{color:var(--text);box-shadow:0 2px var(--text)}.instrument-inspector h2{font-size:17px;font-weight:500;letter-spacing:-.7px;margin:17px 0 12px}.instrument-inspector h3{font-size:14px;font-weight:500;margin-top:30px}.instrument-inspector p{font-size:13px;line-height:1.8;color:var(--muted)}.inspector-rule{margin:28px 0}.source-file{margin-top:22px}.source-file>span{font-family:var(--mono);font-size:var(--mono-size);overflow-wrap:anywhere;line-height:1.8;font-weight:700}.source-file p{font-size:12px;margin-top:7px}.inspector-note{margin-top:32px;padding:15px;font-size:11px;line-height:1.8;color:var(--muted)}.inspector-footer{color:var(--soft);font-size:var(--mono-size);line-height:2.1;margin-top:55px;overflow-wrap:anywhere}.instrument-footer{display:flex;align-items:center;gap:25px;padding:15px 36px;font-size:var(--mono-size)}.instrument-footer>span:last-child{margin-left:auto}.instrument-footer button{background:none;border:0;padding:0;font-size:var(--mono-size)}.repository-popover{position:fixed;left:28px;bottom:65px;width:min(430px,calc(100vw - 56px));background:var(--paper);padding:25px;border:1px solid var(--rule);box-shadow:0 10px 50px #0002;display:grid;gap:12px;z-index:5}.repository-popover input{width:100%;padding:12px;border:1px solid var(--line);background:transparent}.repository-popover button{padding:10px;background:var(--paper);border:1px solid var(--rule)}@media(min-width:1600px){.instrument-scene{height:440px}.instrument-workspace{padding:45px 55px}}@media(max-width:1000px){.instrument-body{grid-template-columns:minmax(0,1fr) 250px}.instrument-workspace{padding:28px 22px}.instrument-header{padding:0 22px}.instrument-status{display:none}.instrument-summary{grid-template-columns:1fr;gap:10px}.instrument-scene{height:260px}}@media(max-width:700px){.instrument-body{display:block}.instrument-header{height:75px}.instrument-header-right>span{display:none}.instrument-inspector{border-left:0;padding-bottom:25px}.instrument-title h1{font-size:29px}.scene-caption{font-size:var(--mono-size)}.instrument-scene{height:230px}.module-controls{gap:5px}.module-controls strong,.module-controls small{font-size:10px}.instrument-footer{padding:15px 22px}.instrument-footer>span:last-child{display:none}.instrument-footer>span{overflow-wrap:anywhere}.instrument-summary{margin-bottom:25px}}.instrument h1,.instrument h2,.instrument h3{font-family:var(--serif);font-weight:600;letter-spacing:0}.instrument-brand{display:block;letter-spacing:normal}.instrument-brand .brand-logo{width:28px;height:28px;margin-bottom:10px;background:repeating-linear-gradient(to bottom,var(--ink) 0 1px,var(--paper) 1px 3px)}.instrument-header{height:145px}.instrument-body{min-height:calc(100vh - 198px)}.instrument h1,.instrument-title h1{font-size:23px}.instrument-brand .wordmark{font-size:26px}.instrument-brand .product-label{font-size:var(--mono-size)}.instrument-run{margin-top:28px;padding:24px 0;scroll-margin-top:24px}.instrument-run h2{font-size:21px;margin:12px 0}.instrument-run p{font-size:14px;line-height:1.8;max-width:720px}.run-evidence{display:flex;flex-wrap:wrap;gap:12px;font-family:var(--mono);font-size:var(--mono-size);line-height:1.7;overflow-wrap:anywhere;font-weight:700}.run-evidence>span:first-child{color:var(--muted)}@media(max-width:700px){.instrument-header{height:145px}.instrument-header-right{flex-direction:column;gap:16px}.instrument-run p{font-size:14px}}.trace-scene-wrap{margin-top:12px}.trace-controls button{min-height:72px}.trace-controls button>span{display:flex;justify-content:space-between}.analysis-coverage,.trace-empty{font-size:12px;line-height:1.8;color:var(--muted)}.source-file pre{font:700 var(--mono-size)/1.6 var(--mono);max-height:300px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;font-weight:700}.source-file summary{font:700 var(--mono-size) var(--mono);cursor:pointer;font-weight:700}.trace-empty{padding:20px 0}.play-button:disabled{opacity:.35;cursor:default}.isometric-fallback{height:100%;display:flex;flex-direction:column;justify-content:center}.isometric-fallback svg{width:100%;min-height:0;flex:1}.fallback-caption{font:700 var(--mono-size) var(--mono);color:var(--muted);padding-top:16px;font-weight:700}.isometric-fallback g[role=button]:focus-visible{outline:1px solid var(--accent)}.instrument-body{max-width:1600px;margin:0 auto;padding:28px 36px 36px;grid-template-columns:minmax(0,1fr) minmax(280px,320px);column-gap:48px;row-gap:0;align-items:start}.instrument-workspace{display:contents}.instrument-title{grid-column:1 / -1;grid-row:1}.instrument-summary{grid-column:1 / -1;grid-row:2;margin:26px 0 0;grid-template-columns:130px minmax(0,720px)}.instrument-workspace>.scene-wrap{grid-column:1;grid-row:4;margin-top:0}.sequencer{grid-column:1;grid-row:8;margin-top:0;padding-top:0}.instrument-inspector{grid-column:2;grid-row:4;min-width:0;padding:0;position:sticky;top:24px;max-height:calc(100vh - 48px);overflow:auto}.instrument-inspector.inspector-trace{grid-row:8}.inspector-tabs{height:auto;min-height:26px;margin:0 0 26px;align-items:flex-start}.inspector-tabs button{padding:0 0 8px}.instrument-run{grid-column:1 / -1;grid-row:11;margin-top:0}.analysis-coverage{grid-column:1;grid-row:5}.module-controls{grid-template-columns:repeat(auto-fit,minmax(115px,1fr));gap:16px}.module-controls strong,.module-controls small{overflow-wrap:anywhere;line-height:1.5}.instrument-scene{height:clamp(280px,26vw,400px)}.instrument-title p{max-width:720px}@media(max-width:1100px){.instrument-body{grid-template-columns:minmax(0,1fr);padding:24px 28px 32px}.instrument-title,.instrument-summary,.instrument-workspace>.scene-wrap,.sequencer,.instrument-run,.analysis-coverage,.instrument-inspector{grid-column:1}.instrument-inspector{grid-row:6;position:static;max-height:none;overflow:visible;margin:24px 0 0;max-width:720px}.instrument-inspector.inspector-trace{grid-row:9}.analysis-coverage{grid-row:5}.instrument-scene{height:320px}.instrument-status{display:flex}.inspector-footer{margin-top:24px}}@media(max-width:700px){.instrument-body{display:grid;padding:20px 22px 28px}.instrument-summary{grid-template-columns:1fr;gap:10px;margin-bottom:0}.instrument-status{display:none}.instrument-scene{height:250px}.module-controls{grid-template-columns:repeat(auto-fit,minmax(100px,1fr));gap:12px}.module-controls strong{font-size:12px}.module-controls small{font-size:11px}.instrument-inspector{padding:0}}.module-controls button[aria-pressed=true] strong{color:var(--accent)}.module-controls button:hover>span,.instrument a:hover{color:var(--accent)}.inspector-tabs button[aria-pressed=true]{color:var(--accent);box-shadow:0 2px var(--accent)}.instrument-inspector[data-tab=part] .inspector-content .eyebrow:first-of-type{color:var(--accent)}.instrument-inspector[data-tab=part] .inspector-content .source-file{border-left:2px solid var(--accent);padding-left:12px}.inspection-context{font-family:var(--mono);font-size:var(--mono-size)!important;color:var(--accent)!important;font-weight:700}.module-controls button{height:132px;overflow:auto;align-self:start}.module-controls strong{height:33px;overflow:auto}.module-controls small{height:45px;overflow:auto}.trace-controls button{height:100px}.trace-controls strong{height:50px}@media(min-width:1101px){.instrument-inspector{contain:size;height:100%;min-height:0;padding-bottom:24px}.instrument-inspector.inspector-trace{margin-top:0;height:100%}}.instrument-title .eyebrow,.system-heading .eyebrow,.sequence-heading .eyebrow,.instrument-run>.eyebrow{font-weight:700}.module-controls strong{height:36px}.module-controls small{height:50px}.trace-controls strong{height:54px}.instrument-inspector{position:relative;top:auto}.module-controls button{height:148px}.trace-controls button{height:112px}.module-controls button,.trace-controls button{height:112px;min-height:0;overflow:hidden;display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start}.module-controls button>span{flex:none}.module-controls strong,.trace-controls strong{height:auto;max-height:54px;overflow:hidden;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical}.instrument-header-right a{font-weight:700}#repository,#action{scroll-margin-top:24px}.system-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:24px}.system-heading h2{font-size:21px;margin:10px 0 0}.system-view{display:flex;gap:16px;flex-shrink:0}.system-view button{font:700 var(--mono-size) var(--mono);border:0;border-bottom:1px solid transparent;background:none;padding:8px 0;color:var(--muted);font-weight:700}.system-view button[aria-pressed=true]{color:var(--accent);border-color:var(--accent)}.connection-toolbar{display:flex;justify-content:space-between;align-items:center;gap:16px;font:700 var(--mono-size)/1.7 var(--mono);padding-top:0;font-weight:700}.connection-toolbar button{border:0;background:none;padding:4px 0;font:inherit;text-align:right;text-decoration:underline;text-underline-offset:4px}.connection-toolbar button[aria-pressed=true]{color:var(--accent)}.connection-context{font:700 var(--mono-size)/1.7 var(--mono);color:var(--soft);margin:14px 0 24px;max-width:660px;font-weight:700}.connection-empty{font-size:13px;line-height:1.8;padding:24px 0}.action-summary{font-size:13px;line-height:1.8;color:var(--soft);margin:0 0 26px;max-width:700px}@media(max-width:700px){.system-heading{align-items:flex-start;flex-direction:column;gap:12px}.connection-toolbar{align-items:flex-start}.connection-toolbar>span{min-width:0;overflow-wrap:anywhere}.connection-toolbar button{max-width:140px;flex-shrink:0}}.architecture-tools{display:flex;align-items:center;justify-content:space-between;gap:16px;font:700 var(--mono-size)/1.6 var(--mono);color:#666;margin:20px 0 14px;font-weight:700}.architecture-tools button{font:inherit;color:var(--text);background:none;border:1px solid #0003;padding:6px 10px}.architecture-frame{width:100%;border:1px solid #00000018;background:var(--paper)}.architecture-map{width:100%;margin-inline:auto;position:relative;isolation:isolate}.architecture-depth{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none}.architecture-depth canvas{display:block;width:100%;height:100%}.architecture-overlay{display:block;width:100%;height:100%;position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;overflow:visible}.architecture-node{cursor:pointer;outline:none}.architecture-node:focus-visible>rect{stroke:var(--accent);stroke-width:2}.architecture-node-copy{height:100%;display:flex;flex-direction:column;justify-content:center;gap:8px;text-align:left}.architecture-node-copy>span{font:700 var(--mono-size)/1 var(--mono);text-transform:uppercase;letter-spacing:.03em;color:#777;font-weight:700}.architecture-node-copy>strong{font:500 14px/1.35 var(--sans);overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.architecture-node.is-selected .architecture-node-copy>span{color:var(--accent)}.architecture-edge{color:#636363;transition:opacity .15s}.architecture-edge.is-selected{color:var(--accent)}.architecture-edge-hit{cursor:pointer}.architecture-edge-label{width:100%;height:100%;display:flex;justify-content:center;align-items:center;border:0;padding:0;background:transparent;color:inherit;font:700 var(--mono-size)/1.5 var(--mono);text-align:center;font-weight:700}.architecture-edge-label>span{padding:3px 5px;background:var(--paper);overflow-wrap:anywhere}.architecture-edge-label:hover,.architecture-edge-label[aria-pressed=true]{color:var(--accent)}.architecture-hint{font:700 var(--mono-size)/1.8 var(--mono);color:#777;margin:14px 0 0;font-weight:700}.architecture-evidence{border-top:1px solid #0003;margin:24px 0 0;padding-top:20px}.architecture-evidence>div:first-child{display:flex;justify-content:space-between;align-items:center}.architecture-evidence>div:first-child button{background:none;border:0;font-size:20px}.architecture-evidence h3{font-size:17px;margin:12px 0}.architecture-evidence>p{font-size:12px;line-height:1.7}.architecture-evidence .source-file{margin-top:14px}.architecture-evidence .source-file p{line-height:1.7;color:var(--muted)}@media(prefers-reduced-motion:reduce){.architecture-edge{transition:none}}.instrument-body{overflow-anchor:none}.smooth-height{transition:height .32s cubic-bezier(.22,.68,0,1.01);overflow:clip}.smooth-height-content{display:flow-root}.view-enter{animation:view-enter .22s ease-out}@keyframes view-enter{0%{opacity:0}to{opacity:1}}.instrument button{transition:color .16s ease,background-color .16s ease,border-color .16s ease,box-shadow .16s ease}.repository-popover{animation:popover-enter .22s ease-out}@keyframes popover-enter{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}.smooth-height,.instrument button{transition:none}.view-enter,.repository-popover{animation:none}}.instrument .readme-trigger{flex-shrink:0;align-self:flex-start;background:transparent;border:0;padding:0;font:700 var(--mono-size)/1.5 var(--mono);letter-spacing:.06em;white-space:nowrap;font-weight:700}.readme-trigger:hover{color:var(--accent)}.readme-actions{padding:24px 0 32px}.readme-download{display:inline-block}.readme-drawer .readme-text{padding-bottom:32px}.instrument .readme-download{font:700 var(--mono-size)/1.5 var(--mono);padding:12px 16px;border:1px solid #0003;background:transparent;color:var(--text);white-space:nowrap;font-weight:700}.readme-download:hover{border-color:var(--accent);color:var(--accent)}.readme-text{max-width:760px;overflow-wrap:anywhere}.readme-text>h3{font-size:26px;margin:0 0 12px}.readme-text h4{font:600 19px/1.4 var(--serif);margin:30px 0 12px}.readme-text p,.readme-text li{font-size:14px;line-height:1.85;color:var(--muted);white-space:pre-wrap}.readme-text p{margin:0 0 14px}.readme-text ul,.readme-text ol{padding-left:22px;margin:0 0 18px}.readme-text li+li{margin-top:10px}.readme-text .readme-subtitle{color:var(--text)}@media(max-width:700px){.instrument-title{flex-wrap:wrap}.instrument .readme-trigger{font-size:var(--mono-size)}}.instrument-footer>button{font:inherit;letter-spacing:inherit}.instrument-footer>button,.instrument-footer>span{text-transform:uppercase}#system{scroll-margin-top:24px}.trace-view{margin:0 0 24px}.trace-diagram{width:100%;margin:0}@media(max-width:700px){.instrument-header-right{gap:12px}.instrument-header-right a{font-size:var(--mono-size)}}.instrument-header,.instrument-footer{width:100%;max-width:1600px;margin-inline:auto;padding-inline:36px}@media(max-width:1100px){.instrument-header,.instrument-footer{padding-inline:28px}}@media(max-width:700px){.instrument-header,.instrument-footer{padding-inline:22px}}.instrument-summary .project-haiku{grid-column:2;margin:18px 0 0;font:italic 500 14.5px/1.8 var(--serif);color:var(--soft)}.instrument-summary .project-haiku-label{grid-column:1;margin-top:18px}.project-haiku span{display:block}@media(max-width:700px){.instrument-summary .project-haiku-label{margin-top:12px}.instrument-summary .project-haiku{grid-column:1;margin-top:0}}.instrument .instrument-inspector h2,.instrument .instrument-inspector h3{font-family:var(--sans);color:var(--ink)}.section-divider{grid-column:1 / -1;width:100%;border:0;border-top:1px solid var(--rule);opacity:.5;margin:40px 0}.divider-system{grid-row:3}.divider-action{grid-row:7}.divider-run{grid-row:10}@media(max-width:700px){.section-divider{margin:32px 0}}.instrument-header,.instrument-body,.instrument-footer{max-width:1360px}.instrument-header{height:128px}.instrument-body{column-gap:36px;min-height:calc(100vh - 181px)}.instrument-summary{margin-top:20px;gap:16px 24px}.instrument-summary p{line-height:1.6}.instrument-summary .project-haiku,.instrument-summary .project-haiku-label{margin-top:0}.instrument-summary .project-haiku{line-height:1.6}.system-heading{margin-bottom:16px}.system-heading h2{margin-top:8px}.sequence-heading h2{margin:8px 0 12px}.action-summary{line-height:1.6;margin-bottom:16px}.trace-view{margin-bottom:16px}.instrument-scene{height:300px}.module-controls button,.trace-controls button{height:auto;min-height:80px;padding:12px 0;align-self:stretch}.module-controls button>span{margin-bottom:6px}.module-controls strong,.trace-controls strong{line-height:1.4;max-height:51px}.inspector-tabs{margin-bottom:16px}.instrument-inspector h2{margin:8px 0}.instrument-inspector h3{margin:20px 0 8px}.instrument-inspector p{line-height:1.6;margin:8px 0}.inspector-rule{margin:20px 0}.source-file{margin-top:12px}.source-file>span{line-height:1.6}.source-file p{margin:6px 0 0}.inspector-note{margin-top:20px;padding:0;line-height:1.6}.inspector-footer{margin-top:24px;line-height:1.7}.instrument-run{padding:0}.instrument-run h2{margin:8px 0 12px}.instrument-run p{line-height:1.6;margin:0 0 16px}.connection-context{margin:12px 0 16px}.architecture-tools{margin:16px 0 12px}.architecture-hint{line-height:1.6;margin-top:12px}@media(max-width:1100px){.instrument-scene{height:280px}}@media(max-width:700px){.instrument-summary{gap:10px}.instrument-summary .project-haiku-label{margin-top:6px}.instrument-scene{height:230px}.module-controls button,.trace-controls button{min-height:72px}}.instrument-cards .instrument-body{padding:40px 68px 68px}.instrument-cards :is(#repository,#system,#action,#how-to-run){scroll-margin-top:56px}.instrument-cards .section-divider{border-color:transparent;margin:44px 0}.section-card-outline{grid-column:1 / -1;align-self:stretch;position:relative;pointer-events:none;min-width:0;min-height:0}.section-card-outline:before{content:"";position:absolute;top:-32px;right:-32px;bottom:-32px;left:-32px;border:1px solid var(--rule);border-radius:8px;opacity:.2}.card-repository{grid-row:1 / 3}.card-system{grid-row:4 / 7}.card-action{grid-row:8 / 10}.card-run{grid-row:11 / 12}@media(max-width:1100px){.instrument-cards .instrument-body{padding:40px 60px 64px}}@media(max-width:700px){.instrument-cards .instrument-body{padding:32px 46px 52px}.instrument-cards .section-divider{margin:36px 0}.section-card-outline:before{top:-24px;right:-24px;bottom:-24px;left:-24px}}.instrument-footer{flex-wrap:wrap}.instrument-footer>button{white-space:nowrap}.instrument-footer .changelog-trigger{margin-left:auto;font:inherit;letter-spacing:inherit;color:inherit}.changelog-trigger:hover{text-decoration:underline;text-underline-offset:4px}body:has(.changelog-drawer[open]){overflow:hidden}.changelog-drawer{position:fixed;inset:0 0 0 auto;margin:0;width:min(640px,100vw);max-width:100vw;height:100dvh;max-height:100dvh;padding:0 28px;border:0;border-left:1px solid #0003;border-radius:0;background:var(--paper);color:var(--ink);box-shadow:-16px 0 60px #0002;font-family:var(--sans);letter-spacing:normal;overscroll-behavior:contain}.changelog-drawer[open]{animation:changelog-enter .24s ease-out}@keyframes changelog-enter{0%{transform:translate(100%)}to{transform:translate(0)}}@media(prefers-reduced-motion:reduce){.changelog-drawer[open]{animation:none}}.changelog-drawer::backdrop{background:#0005}.changelog-drawer header{display:flex;align-items:flex-start;justify-content:space-between;gap:24px;padding:26px 0 24px;border-bottom:1px solid #0003}.changelog-drawer h2{font-size:27px;margin:10px 0}.changelog-drawer header p{font-size:13px;line-height:1.6;margin:0;color:var(--muted)}.instrument .drawer-close{width:44px;height:44px;flex-shrink:0;display:grid;place-items:center;padding:0;border:0;background:none;color:var(--ink)}.drawer-close svg{display:block;width:12px;height:12px}.drawer-close:hover{color:var(--accent)}.changelog-entry{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;padding:24px 0;border-bottom:1px solid #0003}.changelog-entry:last-child{border-bottom:0}.changelog-date{font:700 var(--mono-size)/1.8 var(--mono);color:var(--muted);font-weight:700}.changelog-entry h3{font-size:19px;line-height:1.35;margin:0}.changelog-category h4{font:600 13px/1.6 var(--sans);margin:16px 0 0}.changelog-category ul{margin-top:6px}.changelog-entry ul{margin:12px 0 0;padding-left:16px;font-size:13px;line-height:1.75;color:var(--muted)}.changelog-entry li+li{margin-top:8px}@media(max-width:700px){.instrument-footer{gap:16px 22px}.changelog-drawer{padding:0 20px}.changelog-entry{grid-template-columns:minmax(0,1fr);gap:8px}.changelog-drawer header{gap:12px}}.footer-links{display:flex;align-items:center;gap:12px;margin-left:auto}.footer-links>button{white-space:nowrap}.instrument-footer .footer-links>button{margin:0;font:inherit;letter-spacing:inherit}.how-to-run-trigger:hover{text-decoration:underline;text-underline-offset:4px}.setup-content{padding:0 0 32px}.setup-content section{margin-top:28px}.setup-content h3{font-size:19px;margin:0 0 12px}.setup-content p,.setup-content dd{font:500 13px/1.8 var(--sans);color:var(--muted);margin:0 0 14px}.setup-content pre{font:700 var(--mono-size)/1.8 var(--mono);padding:16px;background:#00000006;white-space:pre-wrap;overflow-wrap:anywhere;font-weight:700}.setup-content code{font-family:var(--mono);font-size:var(--mono-size);font-weight:700}.setup-content dt{font:700 var(--mono-size)/1.8 var(--mono);margin:18px 0 6px;white-space:normal;font-weight:700}.setup-content{white-space:normal;overflow-wrap:anywhere}.setup-drawer header{white-space:normal}
|