@takeokunn/gbrainx 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +38 -2
- package/dist/core.mjs +1346 -0
- package/dist/gbrainx.mjs +7097 -0
- package/dist/web/client/assets/api-BvRk9kiK.js +0 -0
- package/dist/web/client/assets/demo-G0WCPBHC.js +10 -0
- package/dist/web/client/assets/entry.client-BMJZABtH.js +9 -0
- package/dist/web/client/assets/gbrainx-DfnQgPxe.js +49 -0
- package/dist/web/client/assets/health-BvRk9kiK.js +0 -0
- package/dist/web/client/assets/home-DmjYPYzC.js +7 -0
- package/dist/web/client/assets/i18n-CbBRRmtS.js +1 -0
- package/dist/web/client/assets/jsx-runtime-C8YK_IxR.js +16 -0
- package/dist/web/client/assets/lib-C32AnKSP.js +1 -0
- package/dist/web/client/assets/manifest-24d3a028.js +1 -0
- package/dist/web/client/assets/root-C-cLqVHP.js +1 -0
- package/dist/web/client/assets/root-D4kqIC2S.css +2 -0
- package/dist/web/client/assets/root-i18n-_0Yddpt_.js +1 -0
- package/dist/web/client/assets/sell-C3y92_D_.js +1 -0
- package/dist/web/client/assets/sell-ChG4r-W3.css +1 -0
- package/dist/web/client/assets/use-lp-language-ij45BzB4.js +1 -0
- package/dist/web/client/avatars/aiko.svg +7 -0
- package/dist/web/client/avatars/daniel.svg +7 -0
- package/dist/web/client/avatars/ken.svg +7 -0
- package/dist/web/client/avatars/leo.svg +7 -0
- package/dist/web/client/avatars/yui.svg +7 -0
- package/dist/web/client/demo.mp4 +0 -0
- package/dist/web/client/favicon.ico +0 -0
- package/dist/web/server/assets/cloudflare-context-CIZdXilT.js +3426 -0
- package/dist/web/server/assets/rolldown-runtime-nwr4M8im.js +34 -0
- package/dist/web/server/assets/server-build-DGFJ8-cb.js +22842 -0
- package/dist/web/server/assets/server-build-DarI7Ueq.css +2 -0
- package/package.json +9 -4
|
File without changes
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{lt as e,o as t,st as n,t as r}from"./jsx-runtime-C8YK_IxR.js";import{r as i}from"./lib-C32AnKSP.js";import{n as a,r as o,t as s}from"./i18n-CbBRRmtS.js";import{n as c}from"./root-i18n-_0Yddpt_.js";var l=e(n(),1),u=r();function d({view:e,data:t}){let{state:n,t:r,actions:i}=e,a=n.tPhase,s=a>0&&a<6,c={border:0,borderRadius:999,padding:`12px 20px`,cursor:`pointer`,fontWeight:600};return(0,u.jsxs)(`section`,{className:`demo-agent`,style:{maxWidth:1e3,margin:`0 auto`,padding:`30px 24px 48px`},children:[(0,u.jsx)(`style`,{children:`@keyframes demo-cursor { 50% { opacity: 0; } } @media(max-width:640px){.demo-agent{padding-left:14px!important;padding-right:14px!important}.demo-term{font-size:11.5px!important;line-height:1.7!important}.demo-term-body{padding:16px 14px!important}}`}),(0,u.jsxs)(`div`,{className:`demo-term`,style:{background:o.navy,color:o.textOnNavy,borderRadius:16,overflow:`hidden`,fontFamily:`"JetBrains Mono", monospace`,fontSize:13,lineHeight:1.9},children:[(0,u.jsxs)(`div`,{style:{padding:`12px 20px`,borderBottom:`1px solid ${o.navyBorder}`},children:[`● ● ● `,(0,u.jsx)(`span`,{style:{marginLeft:16},children:r.termTitle})]}),(0,u.jsxs)(`div`,{className:`demo-term-body`,style:{padding:`22px 24px`,overflowWrap:`anywhere`},children:[t.rows.filter(e=>e.phase<=a).map((e,t)=>(0,u.jsx)(`div`,{"data-t-phase":e.phase||void 0,children:e.content},t)),s&&(0,u.jsx)(`span`,{"aria-hidden":`true`,style:{animation:`demo-cursor 1s steps(1) infinite`},children:`▍`})]}),(0,u.jsxs)(`div`,{style:{padding:`12px 24px`,borderTop:`1px solid ${o.navyBorder}`,display:`flex`,gap:24,flexWrap:`wrap`},children:[(0,u.jsxs)(`span`,{children:[r.budget,` `,t.budget,` / `,t.budgetLimit]}),(0,u.jsxs)(`span`,{children:[r.statusMounted,` · `,t.loadedPack]})]})]}),(0,u.jsxs)(`div`,{style:{display:`flex`,gap:12,marginTop:20,flexWrap:`wrap`,alignItems:`center`},children:[(0,u.jsx)(`button`,{type:`button`,onClick:i.play,disabled:s,style:{...c,background:a===6?o.white:o.navy,color:a===6?o.navy:o.white},children:s?r.playing:a===6?r.replay:r.play}),a===6&&(0,u.jsx)(`button`,{type:`button`,onClick:()=>i.setView(`earnings`),style:{...c,background:o.navy,color:o.white},children:r.toEarn}),a===6&&(0,u.jsxs)(`button`,{type:`button`,onClick:i.importPack,disabled:n.imported,style:{...c,display:`inline-flex`,alignItems:`center`,gap:8,minHeight:50,border:`1.5px solid ${o.navy}`,background:o.white,color:o.navy,opacity:n.imported?.6:1},children:[(0,u.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`72 36 56 56`,"aria-hidden":`true`,children:[(0,u.jsx)(`g`,{transform:`translate(100 62) scale(0.9) translate(-100 -62)`,children:(0,u.jsx)(`path`,{d:`M100 40 c-10 0 -22 2 -24 12 c-10 2 -14 14 -8 22 c-4 10 4 20 14 18 c4 6 12 6 18 2 M100 40 c10 0 22 2 24 12 c10 2 14 14 8 22 c4 10 -4 20 -14 18 c-4 6 -12 6 -18 2 M100 40 v56`,fill:`none`,stroke:o.navy,strokeWidth:`4`,strokeLinecap:`round`,strokeLinejoin:`round`})}),(0,u.jsx)(`path`,{d:`M89.2 56.6L100 62l-7.2 9M109 54.8L100 62l10.8 7.2M89.2 56.6l3.6 14.4M109 54.8l1.8 14.4`,fill:`none`,stroke:o.navy,strokeWidth:`1.26`,opacity:`0.7`}),[[89.2,56.6],[92.8,71],[109,54.8],[110.8,69.2],[100,62]].map(([e,t])=>(0,u.jsx)(`circle`,{cx:e,cy:t,r:`2.34`,fill:o.navy},`${e}-${t}`))]}),n.imported?r.importDone:r.importBtn]}),(0,u.jsx)(`button`,{type:`button`,onClick:i.resetAgent,style:{...c,marginLeft:`auto`,background:`transparent`,color:o.muted},children:r.resetAgent})]})]})}var f={background:o.white,border:`1px solid ${o.border}`,borderRadius:14,padding:22};function p(e){let{data:t,showTestData:n=!0}=e,r=e.view,i=r?r.t:e.t,a=r?()=>r.actions.setView(`factory`):e.onGoFactory,s=[i.colPack,i.colPrice,i.colMounts,i.colSolved,i.colEval,i.colEarned,i.colStatus];return(0,u.jsxs)(`section`,{className:`demo-earnings`,style:{padding:`32px 24px 48px`},children:[(0,u.jsx)(`style`,{children:`@media(max-width:640px){.demo-earnings{padding-left:14px!important;padding-right:14px!important}.demo-earnings table{min-width:0!important;table-layout:fixed}.demo-earnings .demo-mhide{display:none}.demo-earnings td,.demo-earnings th{overflow-wrap:anywhere}.demo-earnings p,.demo-earnings small{overflow-wrap:anywhere}}`}),(0,u.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,gap:12,flexWrap:`wrap`,alignItems:`center`},children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`h1`,{children:i.earnTitle}),(0,u.jsx)(`p`,{children:i.earnSub})]}),(0,u.jsxs)(`div`,{children:[n&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`strong`,{style:{background:o.yellowPale,color:o.yellowText,padding:`5px 10px`,borderRadius:999},children:i.testData}),` · `]}),i.period]})]}),(0,u.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit,minmax(260px,1fr))`,gap:16},children:[(0,u.jsxs)(`div`,{style:{...f,background:o.navy,color:o.white},children:[(0,u.jsx)(`div`,{children:i.balance}),(0,u.jsx)(`strong`,{"data-testid":`earn-balance`,style:{fontSize:38},children:t.balance}),t.recentAmount&&(0,u.jsxs)(`span`,{style:{color:o.mint},children:[` +`,t.recentAmount,` · `,i.justNow]}),(0,u.jsx)(`p`,{children:i.payoutNext}),(0,u.jsx)(`small`,{children:i.paidOut})]}),(0,u.jsxs)(`div`,{style:f,children:[(0,u.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,gap:16,flexWrap:`wrap`},children:[(0,u.jsxs)(`div`,{children:[i.mounts,(0,u.jsx)(`h2`,{"data-testid":`earn-uses`,children:t.uses})]}),(0,u.jsxs)(`div`,{children:[i.solveRate,(0,u.jsxs)(`h2`,{"data-testid":`earn-solve-rate`,children:[t.solveRate,`%`]})]}),(0,u.jsxs)(`div`,{children:[i.earned30,(0,u.jsx)(`h2`,{"data-testid":`earn-30d`,children:t.earned30})]})]}),(0,u.jsx)(`div`,{"aria-label":i.chartLabel,style:{height:66,display:`flex`,alignItems:`end`,gap:3},children:t.dailyUses.map((e,n)=>(0,u.jsx)(`div`,{title:i.dayTip.replace(`{n}`,String(e)),style:{flex:1,height:Math.max(3,t.dailyMax?e/t.dailyMax*66:0),borderRadius:3,background:n===t.dailyUses.length-1?t.highlightToday?o.green:o.blue:o.border}},n))})]})]}),(0,u.jsxs)(`div`,{style:{...f,marginTop:16,overflowX:`auto`},children:[(0,u.jsx)(`h2`,{children:i.packsTitle}),(0,u.jsxs)(`table`,{style:{width:`100%`,textAlign:`left`,borderCollapse:`collapse`,minWidth:700},children:[(0,u.jsx)(`thead`,{children:(0,u.jsx)(`tr`,{children:s.map((e,t)=>(0,u.jsx)(`th`,{className:t===0||t===2||t===5?void 0:`demo-mhide`,style:{padding:8},children:e},e))})}),(0,u.jsx)(`tbody`,{children:t.packs.map(e=>(0,u.jsxs)(`tr`,{style:{background:e.highlight?o.greenPale:void 0},children:[(0,u.jsxs)(`td`,{style:{padding:8},children:[(0,u.jsx)(`strong`,{children:e.title}),(0,u.jsx)(`br`,{}),(0,u.jsx)(`small`,{children:e.meta})]}),(0,u.jsx)(`td`,{className:`demo-mhide`,children:e.price}),(0,u.jsx)(`td`,{children:e.uses}),(0,u.jsx)(`td`,{className:`demo-mhide`,children:e.solved}),(0,u.jsx)(`td`,{className:`demo-mhide`,children:e.eval}),(0,u.jsx)(`td`,{children:e.earned}),(0,u.jsx)(`td`,{className:`demo-mhide`,children:e.status})]},e.title))})]}),t.showNoPack&&(0,u.jsxs)(`p`,{children:[i.noPack,` `,(0,u.jsx)(`button`,{type:`button`,onClick:a,children:i.goFactoryBtn})]})]}),(0,u.jsxs)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit,minmax(280px,1fr))`,gap:16,marginTop:16},children:[(0,u.jsxs)(`div`,{style:f,children:[(0,u.jsx)(`h2`,{children:i.activityTitle}),t.activity.map((e,t)=>(0,u.jsxs)(`p`,{children:[e.description,(0,u.jsx)(`br`,{}),e.pages.map(e=>`[[${e}]]`).join(` `)]},t)),(0,u.jsx)(`small`,{children:i.privacy})]}),(0,u.jsxs)(`div`,{style:f,children:[(0,u.jsx)(`h2`,{children:i.pagesTitle}),(0,u.jsx)(`p`,{children:i.pagesSub}),t.pages.map(({name:e,count:n})=>(0,u.jsxs)(`div`,{style:{marginBottom:12},children:[(0,u.jsxs)(`div`,{children:[e,` · `,i.pageUses.replace(`{n}`,String(n))]}),(0,u.jsx)(`div`,{style:{background:o.border,height:6,borderRadius:4},children:(0,u.jsx)(`div`,{style:{width:`${t.pageMax?n/t.pageMax*100:0}%`,height:6,background:o.blue,borderRadius:4}})})]},e))]})]}),(0,u.jsxs)(`div`,{style:{...f,marginTop:16},children:[(0,u.jsx)(`h2`,{children:i.splitTitle}),(0,u.jsxs)(`div`,{style:{display:`flex`,borderRadius:8,overflow:`hidden`,color:o.white},children:[(0,u.jsxs)(`div`,{style:{width:`90%`,background:o.navy,padding:10},children:[i.splitYou,` 90%`]}),(0,u.jsx)(`div`,{style:{width:`10%`,minWidth:53,background:o.blue,padding:10},children:`10%`})]}),(0,u.jsx)(`p`,{children:i.splitFee})]})]})}var m={memoryPages:[{id:`stripe-idempotency`,expertise:!0},{id:`webhook-dedupe`,expertise:!0},{id:`payment-retries`,expertise:!0},{id:`acme-checkout`,expertise:!1},{id:`standup-notes`,expertise:!1},{id:`oncall-rotation`,expertise:!1},{id:`customer-8812`,expertise:!1},{id:`aws-prod-account`,expertise:!1}],pack:{title:`Stripe Double-Charge Prevention`,slug:`stripe-double-charge-prevention`,nodes:[`stripe-idempotency`,`idempotency-key`,`webhook-dedupe`],scrubbed:[{before:`sk_live_EXAMPLE…`,after:`[REDACTED_STRIPE_KEY_1]`,layer:`pattern`},{before:`internal.corp.local`,after:`[REDACTED_HOST_1]`,layer:`pattern`},{before:`taro@example.com`,after:`[REDACTED_EMAIL_1]`,layer:`pattern`},{before:`Acme Corp`,after:`[REDACTED_NAME_1]`,layer:`denyList`}],eval:{static:`pass`,keywords:`pass`,knowledgeTest:{model:`haiku`,without:`fail`,with:`pass`,calls:1},runTest:{with:`12/12`,recorded:!0}},price:`$0.50`,authorShare:`$0.45`,paragraphReview:[{id:`stripe-idempotency#4`,decision:`drop`,by:`auto`,reason:`customer name`},{id:`webhook-dedupe#3`,decision:`ask`,confidence:.62,reason:`internal incident log`},{id:`payment-retries#2`,decision:`keep`,by:`auto`,confidence:.94}],distilled:[{field:`symptom`,source:`stripe-idempotency#1`},{field:`cause`,source:`stripe-idempotency#2`},{field:`fix`,source:`payment-retries#2`},{field:`avoid`,source:`webhook-dedupe#1`},{field:`verify`,source:`payment-retries#3`}],keywords:[`orderKey`,`event.id`]},session:{title:`claude · ~/acme-checkout`,searchQuery:`stripe double charge on retry`,budget:{before:`$10.00`,after:`$9.50`,perPurchaseCap:`$1.00`},tokens:412,diff:[{file:`src/checkout.ts`,line:`+ idempotencyKey: orderKey(order)`},{file:`src/webhooks.ts`,line:`+ if (seen(event.id)) return;`}],tests:`12/12`},earningsSeed:{testDataLabel:!0,balance:{before:`$13.36`,after:`$13.81`},uses30d:{before:86,after:87},solved30d:{before:78,after:79},earned30d:{before:`$47.88`,after:`$48.33`},lastPayout:`2026-11-30 · $34.52`,nextPayout:`2026-12-31`,payoutMinimum:`$10.00`,dailyUses30d:[1,1,2,1,2,2,1,2,1,2,1,1,2,4,1,2,3,5,3,4,6,2,6,3,4,4,5,7,4,4],packs:[{title:`Stripe Double-Charge Prevention`,version:`v1`,domain:`payments`,pages:3,price:`$0.50`,uses:0,solved:0,earned:`$0.00`,isDemoPack:!0},{title:`Stripe Webhook Signature Errors`,version:`v3`,domain:`payments`,pages:5,price:`$0.50`,uses:52,solved:48,earned:`$23.40`},{title:`Postgres Zero-Downtime Migrations`,version:`v2`,domain:`data`,pages:4,price:`$0.80`,uses:34,solved:30,earned:`$24.48`}],recentUses:[{amount:`+$0.45`,solved:!0,pages:[`stripe-webhook-signature`,`raw-body-parsing`]},{amount:`+$0.72`,solved:!0,pages:[`pg-add-column-safely`]},{amount:`+$0.45`,solved:!1,pages:[`stripe-webhook-signature`]}],pageUses:[[`stripe-webhook-signature`,41],[`pg-add-column-safely`,27],[`raw-body-parsing`,22],[`stripe-idempotency`,0],[`webhook-dedupe`,0]]},typeform:{waitlist:{env:`NEXT_PUBLIC_TYPEFORM_WAITLIST_ID`,placeholder:`GBX_WAITLIST`,hidden:{source:`lp-buyer`}},author:{env:`NEXT_PUBLIC_TYPEFORM_AUTHOR_ID`,placeholder:`GBX_AUTHOR`,hidden:{source:`lp-seller`}}}},h=[0,1e3,2e3,3100,4200],g=[0,800,1600,2400,3300,4300],_=m.memoryPages,v=m.pack,y=m.session,b=m.earningsSeed;function x(){return Object.fromEntries(_.map(e=>[e.id,e.expertise]))}function S(e){return{lang:e,view:`factory`,loaded:!1,review:null,keep:x(),fPhase:0,published:!1,tPhase:0,imported:!1,earnSeen:!1}}function C(e){return e>0&&e<5}function w(e,t=_){return t.filter(t=>e[t.id]).length}function T(e,t){return e<t?`idle`:e===t?`running`:`passed`}var E={passed:{background:o.green,color:o.white,border:o.green},running:{background:o.bluePale,color:o.blue,border:o.blue},idle:{background:o.white,color:o.mutedLight,border:o.border}};function D(e,t,n=_){let r=w(e.keep,n);return t.gates.map((n,i)=>{let a=i+1,c=T(e.fPhase,a);return{index:a,label:n,status:c,stat:c===`passed`?s(t.stats[i],{n:r}):c===`running`?t.running:`—`,statColor:c===`passed`?o.green:o.muted,hasLine:a>1,lineColor:e.fPhase>=a?o.green:o.border,circle:E[c]}})}function O(e,t=_){return t.map(({id:t})=>{let n=!!e.keep[t];return{id:t,keep:n,background:n?o.greenPale:`transparent`,color:n?o.greenText:o.muted,borderStyle:n?`solid`:`dashed`,borderColor:n?o.greenBorder:o.border,textDecoration:n?`none`:`line-through`,dot:n?o.green:o.borderStrong}})}function k(e,t){let n=C(e);return{label:n?t.verifying:e===5?t.again:t.compile,disabled:n,opacity:n?.6:1}}function A(e){return{distillOpacity:e>=3?1:.35,scrubOpacity:e>=4?1:.35,evalOpacity:e>=4?1:.35}}var j=`"JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace`,M={background:o.white,border:`1px solid ${o.border}`,borderRadius:20},N={border:0,background:o.navy,color:o.white,fontWeight:600,borderRadius:999,cursor:`pointer`,fontFamily:`inherit`},P=`
|
|
2
|
+
.fv-spin{animation:fv-spin .9s linear infinite}
|
|
3
|
+
.fv-fade{animation:fv-fade .35s ease-out both}
|
|
4
|
+
@keyframes fv-spin{to{transform:rotate(360deg)}}
|
|
5
|
+
@keyframes fv-fade{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
|
|
6
|
+
.fv-btn:hover:not(:disabled){background:${o.blue}}
|
|
7
|
+
.fv-chip:hover{border-color:${o.blue}}
|
|
8
|
+
.fv-root button:focus-visible{outline:2px solid ${o.navy};outline-offset:2px}
|
|
9
|
+
@media(max-width:640px){.fv-root{padding-left:14px!important;padding-right:14px!important}.fv-gcell{width:66px!important}.fv-gcirc{width:46px!important;height:46px!important}.fv-gline{margin-top:22px!important}.fv-glabel{font-size:11.5px!important;text-align:center}.fv-gstat{font-size:10.5px!important}.fv-root section{max-width:100%!important}.fv-results{grid-template-columns:minmax(0,1fr)!important}}
|
|
10
|
+
`;function F({color:e=o.mutedLight}){return(0,u.jsxs)(`svg`,{width:`44`,height:`44`,viewBox:`72 36 56 56`,fill:`none`,stroke:e,strokeWidth:`3`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,u.jsx)(`path`,{d:`M100 40c-10 0-22 2-24 12-10 2-14 14-8 22-4 10 4 20 14 18 4 6 12 6 18 2M100 40c10 0 22 2 24 12 10 2 14 14 8 22 4 10-4 20-14 18-4 6-12 6-18 2M100 40v56`}),(0,u.jsx)(`path`,{d:`M88 56l12 6 10-7M92 71l8-9 11 7`,strokeWidth:`1.5`})]})}var I={width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.8,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0};function L({index:e}){switch(e){case 1:return(0,u.jsxs)(`svg`,{...I,children:[(0,u.jsx)(`circle`,{cx:`6`,cy:`6`,r:`3`}),(0,u.jsx)(`circle`,{cx:`6`,cy:`18`,r:`3`}),(0,u.jsx)(`path`,{d:`M20 4L8.1 15.9`}),(0,u.jsx)(`path`,{d:`M14.5 14.5L20 20`}),(0,u.jsx)(`path`,{d:`M8.1 8.1L12 12`})]});case 2:return(0,u.jsxs)(`svg`,{...I,children:[(0,u.jsx)(`circle`,{cx:`5`,cy:`12`,r:`2.5`}),(0,u.jsx)(`circle`,{cx:`19`,cy:`5`,r:`2.5`}),(0,u.jsx)(`circle`,{cx:`19`,cy:`19`,r:`2.5`}),(0,u.jsx)(`path`,{d:`M7.3 11l9.4-4.8`}),(0,u.jsx)(`path`,{d:`M7.3 13l9.4 4.8`})]});case 3:return(0,u.jsxs)(`svg`,{...I,children:[(0,u.jsx)(`path`,{d:`M12 3l8 3v6c0 5-3.5 8-8 9-4.5-1-8-4-8-9V6l8-3z`}),(0,u.jsx)(`path`,{d:`M9 12l2 2 4-4`})]});default:return(0,u.jsxs)(`svg`,{...I,children:[(0,u.jsx)(`path`,{d:`M5 20V12`}),(0,u.jsx)(`path`,{d:`M12 20V5`}),(0,u.jsx)(`path`,{d:`M19 20v-9`})]})}}function R({color:e}){return(0,u.jsx)(`span`,{style:{width:6,height:6,borderRadius:999,background:e,flex:`none`}})}function z({card:e,opacity:t,title:n,meta:r,metaColor:i,metaSize:a=12,children:o}){return(0,u.jsxs)(`section`,{"data-card":e,style:{...M,padding:20,display:`flex`,flexDirection:`column`,gap:14,opacity:t,transition:`opacity 300ms`},children:[(0,u.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,u.jsx)(`h3`,{style:{margin:0,fontSize:14,fontWeight:600},children:n}),(0,u.jsx)(`span`,{style:{fontFamily:j,fontSize:a,color:i},children:r})]}),o]})}function B({view:e,data:t}){let{state:n,t:r,actions:i}=e,{pack:a,chips:c,gates:l,keptLabel:d,results:f}=t,p=n.fPhase>0&&n.fPhase<5,m=n.fPhase>=5,h=k(n.fPhase,r),g=n.loaded&&n.review===null;return(0,u.jsxs)(`div`,{className:`fv-root`,style:{padding:`28px 24px 48px`,display:`flex`,flexDirection:`column`,gap:20,fontSize:14,lineHeight:1.5},children:[(0,u.jsx)(`style`,{children:P}),(0,u.jsxs)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:20,alignItems:`stretch`},children:[(0,u.jsxs)(`section`,{style:{...M,flex:`1 1 320px`,maxWidth:360,padding:20,display:`flex`,flexDirection:`column`,gap:14},children:[(0,u.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,u.jsx)(`h2`,{style:{margin:0,fontSize:15,fontWeight:600},children:r.memTitle}),n.loaded&&(0,u.jsx)(`span`,{style:{fontFamily:j,fontSize:12,color:o.greenText},children:d})]}),n.loaded?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`div`,{className:`fv-fade`,style:{display:`flex`,flexWrap:`wrap`,gap:8,alignContent:`flex-start`},children:c.map(e=>(0,u.jsxs)(`button`,{type:`button`,className:`fv-chip`,"aria-pressed":e.keep,"aria-label":s(e.keep?r.prune:r.keepIt,{id:e.id}),disabled:p,onClick:()=>i.toggleKeep(e.id),style:{display:`inline-flex`,alignItems:`center`,gap:6,padding:`7px 11px`,minHeight:36,borderRadius:999,fontFamily:j,fontSize:12,cursor:p?`default`:`pointer`,background:e.background,color:e.color,border:`1px ${e.borderStyle} ${e.borderColor}`,textDecoration:e.textDecoration},children:[(0,u.jsx)(R,{color:e.dot}),e.id]},e.id))}),(0,u.jsxs)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:14,fontSize:12,color:o.muted},children:[(0,u.jsxs)(`span`,{style:{display:`inline-flex`,alignItems:`center`,gap:6},children:[(0,u.jsx)(R,{color:o.greenText}),r.legendKeep]}),(0,u.jsxs)(`span`,{style:{display:`inline-flex`,alignItems:`center`,gap:6},children:[(0,u.jsx)(R,{color:o.borderStrong}),r.legendPrune]})]}),(0,u.jsxs)(`div`,{style:{border:`1px solid ${o.border}`,borderRadius:12,padding:12},children:[(0,u.jsx)(`strong`,{children:r.paraTitle}),` · `,n.review===null?r.reviewPending:r.reviewDone,(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`code`,{children:`stripe-idempotency#4`}),` · `,r.tagDropAuto,(0,u.jsx)(`br`,{}),r.para1]}),(0,u.jsxs)(`div`,{style:{background:o.yellowPale,padding:8,margin:`8px 0`},children:[(0,u.jsx)(`code`,{children:`webhook-dedupe#3`}),` · `,n.review===null?r.tagAsk:n.review===`keep`?r.tagKeepOk:r.tagDropOk,(0,u.jsx)(`br`,{}),r.para2,(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`button`,{type:`button`,disabled:p,"aria-pressed":n.review===`keep`,onClick:()=>i.reviewParagraph(`keep`),children:r.keepBtn}),` `,(0,u.jsx)(`button`,{type:`button`,disabled:p,"aria-pressed":n.review===`drop`,onClick:()=>i.reviewParagraph(`drop`),children:r.dropBtn})]})]}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`code`,{children:`payment-retries#2`}),` · `,r.tagKeepAuto,(0,u.jsx)(`br`,{}),r.para3]})]})]}):(0,u.jsxs)(`button`,{type:`button`,className:`fv-chip`,onClick:i.upload,style:{flex:`1 1 auto`,minHeight:220,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:12,border:`2px dashed ${o.borderStrong}`,background:o.background,color:o.navy,borderRadius:16,cursor:`pointer`,fontFamily:`inherit`,fontSize:14,fontWeight:600},children:[(0,u.jsxs)(`svg`,{width:`28`,height:`28`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,u.jsx)(`path`,{d:`M12 16V4`}),(0,u.jsx)(`path`,{d:`M7 9l5-5 5 5`}),(0,u.jsx)(`path`,{d:`M4 16v3a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-3`})]}),r.upload,(0,u.jsx)(`span`,{style:{fontFamily:j,fontSize:12,fontWeight:400,color:o.muted},children:`~/brain`})]})]}),(0,u.jsxs)(`section`,{style:{...M,flex:`999 1 520px`,minWidth:0,padding:`28px 24px`,display:`flex`,flexDirection:`column`,justifyContent:`center`,gap:28},children:[(0,u.jsx)(`div`,{className:`fv-gates`,style:{display:`flex`,alignItems:`flex-start`},children:l.map(e=>(0,u.jsxs)(`div`,{"data-gate":e.index,"data-status":e.status,style:{display:`flex`,alignItems:`flex-start`,flex:e.hasLine?`1 1 0`:`0 0 auto`},children:[e.hasLine&&(0,u.jsx)(`div`,{className:`fv-gline`,style:{flex:`1 1 auto`,height:1,marginTop:32,background:e.lineColor,transition:`background 300ms`}}),(0,u.jsxs)(`div`,{className:`fv-gcell`,style:{display:`flex`,flexDirection:`column`,alignItems:`center`,gap:10,width:104},children:[(0,u.jsxs)(`div`,{className:`fv-gcirc`,style:{position:`relative`,width:64,height:64,borderRadius:999,display:`flex`,alignItems:`center`,justifyContent:`center`,background:e.circle.background,color:e.circle.color,border:`1px solid ${e.circle.border}`,transition:`all 300ms`},children:[e.status===`running`&&(0,u.jsx)(`span`,{className:`fv-spin`,style:{position:`absolute`,inset:-4,borderRadius:999,border:`2px solid transparent`,borderTopColor:o.navy}}),(0,u.jsx)(L,{index:e.index})]}),(0,u.jsx)(`span`,{className:`fv-glabel`,style:{fontSize:13,fontWeight:600},children:e.label}),(0,u.jsx)(`span`,{className:`fv-gstat`,style:{fontFamily:j,fontSize:12,color:e.statColor},children:e.stat})]})]},e.index))}),(0,u.jsx)(`button`,{type:`button`,className:`fv-btn`,disabled:h.disabled||g,onClick:i.compile,style:{...N,alignSelf:`center`,display:`inline-flex`,alignItems:`center`,gap:8,fontSize:15,padding:`0 24px`,minHeight:48,opacity:h.opacity},children:g?r.needReview:h.label})]}),(0,u.jsx)(`section`,{style:{flex:`1 1 280px`,maxWidth:320,display:`flex`},children:m?(0,u.jsxs)(`div`,{className:`fv-fade`,"data-pack":`verified`,style:{...M,background:o.navy,color:o.white,borderColor:o.navy,flex:`1 1 auto`,padding:22,display:`flex`,flexDirection:`column`,gap:14},children:[(0,u.jsxs)(`span`,{style:{display:`inline-flex`,alignItems:`center`,gap:8,fontSize:12,color:o.mint},children:[(0,u.jsx)(F,{color:o.mint}),r.verifiedPack]}),(0,u.jsx)(`span`,{style:{fontSize:18,fontWeight:600,lineHeight:1.35},children:a.title}),(0,u.jsxs)(`div`,{style:{fontFamily:j,fontSize:12,lineHeight:1.9,color:o.textOnNavy},children:[(0,u.jsx)(`div`,{children:t.packLift}),(0,u.jsx)(`div`,{children:t.packScrub})]}),(0,u.jsx)(`div`,{style:{flex:`1 1 auto`}}),(0,u.jsxs)(`div`,{style:{fontFamily:j,fontSize:30,fontWeight:500,letterSpacing:`-0.02em`},children:[a.price,(0,u.jsxs)(`span`,{style:{fontSize:13,color:o.muted},children:[` `,r.perMount]})]}),(0,u.jsx)(`button`,{type:`button`,className:`fv-btn`,onClick:i.publish,style:{...N,background:o.white,color:o.navy,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:14,padding:`0 16px`,minHeight:46},children:r.publish})]}):(0,u.jsxs)(`div`,{"data-pack":`placeholder`,style:{flex:`1 1 auto`,border:`1px dashed ${o.borderStrong}`,borderRadius:12,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:10,color:o.mutedLight,minHeight:240},children:[(0,u.jsx)(F,{}),(0,u.jsx)(`span`,{style:{fontSize:13,color:o.muted},children:r.packPlaceholder})]})})]}),(0,u.jsxs)(`div`,{className:`fv-results`,style:{display:`grid`,gridTemplateColumns:`repeat(auto-fit, minmax(300px, 1fr))`,gap:20},children:[(0,u.jsx)(z,{card:`graph`,opacity:f.distillOpacity,title:r.distTitle,meta:r.distMeta,metaColor:o.muted,children:t.distilled.map(([e,t,n])=>(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`strong`,{children:e}),` · `,t,` `,(0,u.jsx)(`code`,{children:n})]},n))}),(0,u.jsxs)(z,{card:`scrub`,opacity:f.scrubOpacity,title:r.scrubTitle,meta:t.scrubMeta,metaColor:o.greenText,children:[a.scrubbed.map(e=>(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`span`,{style:{color:o.redText,textDecoration:`line-through`},children:e.before}),` → `,(0,u.jsx)(`span`,{children:e.after}),e.layer===`denyList`&&(0,u.jsxs)(`small`,{children:[` · `,r.denyTag]})]},e.after)),(0,u.jsx)(`div`,{children:t.scrubLayers.map(e=>(0,u.jsx)(`span`,{style:{display:`inline-block`,padding:4,background:o.bluePale,borderRadius:6,marginRight:4},children:e},e))})]}),(0,u.jsx)(z,{card:`eval`,opacity:f.evalOpacity,title:r.evalTitle,meta:m?r.evalMetaDone:`—`,metaColor:o.greenText,children:t.evalStages.map(([e,t,n])=>(0,u.jsxs)(`div`,{children:[(0,u.jsxs)(`strong`,{children:[m?`✓ `:``,e]}),` · `,t,` · `,n]},e))})]})]})}function V({view:e}){let{state:t,t:n,actions:r}=e,i=t.earnSeen?4:t.tPhase>=6?3:t.published?2:+(t.fPhase===5),a=e=>({border:0,cursor:`pointer`,padding:`7px 16px`,borderRadius:999,fontSize:13,fontWeight:600,minHeight:36,background:e?o.white:`transparent`,color:e?o.navy:o.textOnNavy}),s=e=>({border:0,cursor:`pointer`,minWidth:44,minHeight:34,fontSize:12,fontFamily:`"JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace`,background:e?o.white:`transparent`,color:e?o.navy:o.textOnNavy});return(0,u.jsxs)(`header`,{style:{background:o.navy,color:o.white},children:[(0,u.jsx)(`style`,{children:`.demo-tab{white-space:nowrap}@media(max-width:640px){.demo-hdrtag{display:none}.demo-tab{padding:7px 10px!important;font-size:12px!important}}`}),(0,u.jsxs)(`div`,{style:{maxWidth:1320,margin:`0 auto`,padding:`12px 24px`,display:`flex`,flexWrap:`wrap`,alignItems:`center`,gap:20},children:[(0,u.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,u.jsxs)(`svg`,{width:`22`,height:`22`,viewBox:`0 0 28 28`,"aria-hidden":`true`,children:[(0,u.jsx)(`rect`,{width:`28`,height:`28`,rx:`6`,fill:o.white}),(0,u.jsx)(`circle`,{cx:`9`,cy:`9`,r:`2.6`,fill:o.navy}),(0,u.jsx)(`circle`,{cx:`19`,cy:`14`,r:`2.6`,fill:o.navy}),(0,u.jsx)(`circle`,{cx:`9`,cy:`19`,r:`2.6`,fill:o.navy}),(0,u.jsx)(`path`,{d:`M9 9L19 14L9 19`,stroke:o.navy,strokeWidth:`1.6`,fill:`none`,strokeLinejoin:`round`})]}),(0,u.jsx)(`span`,{style:{fontWeight:600,fontSize:16},children:`GbrainX`}),(0,u.jsx)(`span`,{className:`demo-hdrtag`,style:{fontSize:12,color:o.headerAccent,border:`1px solid ${o.navyBorder}`,borderRadius:999,padding:`2px 10px`},children:n.ext})]}),(0,u.jsxs)(`nav`,{"aria-label":n.viewsLabel,style:{display:`flex`,gap:4,padding:4,background:o.navyRaised,borderRadius:999},children:[(0,u.jsx)(`button`,{className:`demo-tab`,type:`button`,onClick:()=>r.setView(`factory`),"aria-pressed":t.view===`factory`,style:a(t.view===`factory`),children:n.tabFactory}),(0,u.jsx)(`button`,{className:`demo-tab`,type:`button`,onClick:()=>r.setView(`agent`),"aria-pressed":t.view===`agent`,style:a(t.view===`agent`),children:n.tabAgent}),(0,u.jsx)(`button`,{className:`demo-tab`,type:`button`,onClick:()=>r.setView(`earnings`),"aria-pressed":t.view===`earnings`,style:a(t.view===`earnings`),children:n.tabEarn})]}),(0,u.jsx)(`div`,{style:{flex:`1 1 auto`}}),(0,u.jsx)(`div`,{role:`img`,"aria-label":n.progressLabel,style:{display:`flex`,alignItems:`center`,gap:6},children:n.steps.map((e,t)=>(0,u.jsx)(`span`,{title:e,style:{width:t===i?24:6,height:6,borderRadius:999,background:t<i?o.mint:t===i?o.white:o.navyBorder,transition:`all 300ms`}},e))}),(0,u.jsxs)(`div`,{role:`group`,"aria-label":n.language,style:{display:`flex`,border:`1px solid ${o.navyBorder}`,borderRadius:999,overflow:`hidden`},children:[(0,u.jsx)(`button`,{type:`button`,onClick:()=>r.setLang(`en`),"aria-pressed":t.lang===`en`,style:s(t.lang===`en`),children:`EN`}),(0,u.jsx)(`button`,{type:`button`,onClick:()=>r.setLang(`ja`),"aria-pressed":t.lang===`ja`,style:{...s(t.lang===`ja`),borderLeft:`1px solid ${o.navyBorder}`},children:`JA`})]}),(0,u.jsx)(`button`,{type:`button`,onClick:()=>r.restart(),"aria-label":n.restart,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:36,height:36,border:`1px solid ${o.navyBorder}`,background:`transparent`,color:o.textOnNavy,borderRadius:8,cursor:`pointer`},children:(0,u.jsxs)(`svg`,{width:`15`,height:`15`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,u.jsx)(`path`,{d:`M3 12a9 9 0 1 0 3-6.7L3 8`}),(0,u.jsx)(`path`,{d:`M3 3v5h5`})]})})]})]})}function H(e){let t=new Set,n=new Set,r=new Set,i=!1;async function a(n,i,a){let o=new AbortController;t.add(o);let s=setTimeout(()=>o.abort(),1e4);r.add(s);try{let t=await e.fetch(`/api${n}`,{method:i,signal:o.signal,...a===void 0?{}:{headers:{"Content-Type":`application/json`},body:JSON.stringify(a)}});if(!t.ok)throw Error(`request failed`);return await t.json()}finally{clearTimeout(s),r.delete(s),t.delete(o)}}function o(t,a,o,s,c){let l,u,d=!1,f=()=>{d||(d=!0,clearTimeout(u),r.delete(u),l.close(),n.delete(l))},p=()=>{d||i||(f(),o())},m=()=>{clearTimeout(u),r.delete(u)},h=()=>{m(),u=setTimeout(p,s),r.add(u)};try{l=e.eventSource(`/api${t}`),n.add(l),u=setTimeout(p,s),r.add(u),l.onopen=()=>{c||m()},l.onmessage=e=>{if(!(d||i)){c?h():m();try{a(JSON.parse(e.data))&&f()}catch{p()}}},l.onerror=p}catch{return i||o(),()=>{}}return f}return{upload:()=>a(`/memory`,`POST`,{pages:_.map(({id:e,expertise:t})=>({id:e,title:e,markdown:`# ${e}`,class:t?`expertise`:`project`,keep:t}))}),toggle:(e,t)=>a(`/memory/${encodeURIComponent(e)}`,`PATCH`,{keep:t}),compile:()=>a(`/packs/compile`,`POST`),publish:e=>a(`/packs/${encodeURIComponent(e)}/publish`,`POST`),reset:()=>a(`/demo/reset`,`POST`),job:(e,t,n)=>o(`/jobs/${encodeURIComponent(e)}/events`,t,n,6e4,!0),session:(e,t,n)=>o(`/sessions/${encodeURIComponent(e)}/events`,e=>(t(e),!1),n,3e4,!1),dispose:()=>{i=!0,t.forEach(e=>e.abort()),n.forEach(e=>e.close()),n.clear(),r.forEach(clearTimeout),r.clear()}}}function U(e,t={}){let n=e=>({...S(e),source:t.mode===`live`?`live`:`mock`,fallback:[]}),r=n(e),i=new Set,a=[],o=[],s,c=0,l=!1,u=`nixos-native-clib-linking`,d,f,p=0;function m(e){r={...r,...e},i.forEach(e=>e())}function _(e,t){if(c!==t||r.fallback.includes(e))return;let n=[...r.fallback,e];m({fallback:n,source:n.includes(`job`)&&n.includes(`session`)?`mock`:`live`})}function v(e){e.forEach(clearTimeout),e.length=0}function y(){c++,v(a),v(o),d?.(),d=void 0,s?.dispose(),s=void 0}function b(e=!1){if(t.mode!==`live`||s)return;s=t.createClient?.()??H({fetch:(...e)=>globalThis.fetch(...e),eventSource:e=>new EventSource(e)});let n=c;l=!1;let i=s,a=()=>{c===n&&i.session(t.session||`demo`,e=>{c===n&&(e.type===`buy`?m({tPhase:3}):e.type===`load`?m({tPhase:4}):e.type===`attempt`&&e.n>=3?m({tPhase:e.ok?6:5}):e.type===`solved`?m({tPhase:6}):e.type===`loop`&&m({tPhase:0}))},()=>{c===n&&(_(`session`,n),l=!0,r.tPhase>0&&r.tPhase<6&&(m({tPhase:0}),C()))})};e?i.reset().then(a,()=>{_(`reset`,n),a()}):a()}function x(){v(a),m({loaded:!0,fPhase:1}),h.slice(1).forEach((e,t)=>a.push(setTimeout(()=>m({fPhase:t+2}),e)))}function C(){r.tPhase>0&&r.tPhase<6||(v(o),m({tPhase:1}),g.slice(1).forEach((e,t)=>o.push(setTimeout(()=>m({tPhase:t+2}),e))))}async function w(){if(m({loaded:!0}),!s||r.fallback.includes(`memory`))return;let e=c,t=p;await s.upload().then(n=>{if(c!==e)return;let r=n.pages;if(!Array.isArray(r)||!r.every(e=>e&&typeof e.id==`string`&&typeof e.keep==`boolean`))throw Error(`invalid pages`);p===t&&m({keep:Object.fromEntries(r.map(e=>[e.id,e.keep]))})}).catch(()=>{_(`memory`,e)})}return{getSnapshot:()=>r,subscribe:e=>(i.add(e),()=>i.delete(e)),actions:{setLang:e=>m({lang:e}),setView:e=>m({view:e,earnSeen:r.earnSeen||e===`earnings`&&r.tPhase>=3}),restart:()=>{f=void 0,p++;let e=!!s;y(),r=n(r.lang),i.forEach(e=>e()),e&&b(!0)},upload:()=>{f=w()},reviewParagraph:e=>{r.fPhase>0&&r.fPhase<5||m({review:e})},toggleKeep:e=>{if(r.fPhase>0&&r.fPhase<5)return;p++;let t=!r.keep[e];if(m({keep:{...r.keep,[e]:t}}),s){let n=s,i=c;f=(f??Promise.resolve()).then(()=>c===i&&!r.fallback.includes(`memory`)?n.toggle(e,t):void 0).then(()=>void 0,()=>{_(`memory`,i)})}},compile:()=>{if(r.fPhase>0&&r.fPhase<5)return;if(!r.loaded){f=w();return}if(r.review===null)return;if(!s||r.fallback.includes(`job`)){x();return}let e=r.loaded?f??Promise.resolve():w();v(a),d?.(),m({loaded:!0,fPhase:1});let t=c,n=()=>{c===t&&(_(`job`,t),x())},i=s;e.then(()=>c===t?i.compile():void 0).then(e=>{if(c!==t||!s)return;let r=e.jobId;if(typeof r!=`string`||!r)throw Error(`invalid job`);d=s.job(r,e=>{if(c!==t)return!0;let n=e;if(n.error||!Number.isInteger(n.phase)||Number(n.phase)<1||Number(n.phase)>5)throw Error(`invalid job event`);if(n.phase===5){if(typeof n.pack?.id!=`string`)throw Error(`missing pack`);u=n.pack.id}return m({fPhase:n.phase}),n.phase===5},n)}).catch(n)},publish:()=>{m({published:!0,view:`agent`});let e=c;s&&!r.fallback.includes(`publish`)&&s.publish(u).catch(()=>{_(`publish`,e)})},play:()=>{r.tPhase>0&&r.tPhase<6||(m({imported:!1}),(!s||l)&&C())},importPack:()=>{r.tPhase===6&&m({imported:!0})},resetAgent:()=>{v(o),m({tPhase:0,imported:!1})}},start:b,dispose:y}}function W(e,t=`mock`,n=`demo`){let r=(0,l.useMemo)(()=>U(e,{mode:t,session:n}),[e,t,n]),i=(0,l.useSyncExternalStore)(r.subscribe,r.getSnapshot,r.getSnapshot);return(0,l.useEffect)(()=>(r.start(),()=>r.dispose()),[r]),{state:i,t:a(i.lang),actions:r.actions}}function G(e,t,n=!1){return{rows:[{phase:0,content:(0,u.jsxs)(u.Fragment,{children:[`› `,e.prompt]})},{phase:0,content:(0,u.jsxs)(u.Fragment,{children:[`● `,e.attempt1,(0,u.jsxs)(`div`,{style:{color:o.redOnNavy},children:[`⎿ ✗ `,e.fail,` · order #1042 · 2 charges`]})]})},{phase:0,content:(0,u.jsxs)(u.Fragment,{children:[`● `,e.attempt2,(0,u.jsxs)(`div`,{style:{color:o.redOnNavy},children:[`⎿ ✗ `,e.fail,` · order #1042 · 2 charges `,(0,u.jsxs)(`span`,{style:{color:o.yellow},children:[`↻ `,e.loop]})]})]})},{phase:1,content:(0,u.jsxs)(u.Fragment,{children:[`● `,e.think,(0,u.jsxs)(`div`,{style:{color:o.cyan},children:[`gbrainx.search("`,y.searchQuery,`")`]})]})},{phase:2,content:(0,u.jsxs)(u.Fragment,{children:[`⎿ `,v.title,` · `,v.price,` · `,(0,u.jsx)(`span`,{style:{color:o.mint},children:e.evalPass}),` · `,e.secrets0]})},{phase:3,content:(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(`span`,{style:{color:o.cyan},children:[`gbrainx.buy("`,v.slug,`")`]}),(0,u.jsxs)(`div`,{children:[`⎿ `,e.autoBuy,` · `,y.budget.before,` → `,y.budget.after]})]})},{phase:4,content:(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(`span`,{style:{color:o.cyan},children:[`gbrainx.load("`,v.slug,`")`]}),(0,u.jsxs)(`div`,{children:[`⎿ `,e.mountedLine,` · `,v.nodes.map(e=>`[[${e}]]`).join(` `)]}),(0,u.jsxs)(`div`,{style:{color:o.mutedOnNavy},children:[`⎿ `,e.cacheLine]})]})},{phase:5,content:(0,u.jsxs)(u.Fragment,{children:[`● `,e.attempt3,(0,u.jsx)(`div`,{style:{background:o.navyPanel,padding:12,borderRadius:8},children:y.diff.map(e=>(0,u.jsxs)(`div`,{children:[e.file,(0,u.jsx)(`br`,{}),(0,u.jsx)(`span`,{style:{color:o.mint},children:e.line})]},e.file))})]})},{phase:6,content:(0,u.jsxs)(`span`,{style:{color:o.mint},children:[`⎿ ✓ `,e.done,(0,u.jsx)(`div`,{children:e.cite})]})},...n?[{phase:6,content:(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`span`,{style:{color:o.cyan},children:`$`}),` gbrainx import `,v.slug,` --to ~/brain`]}),(0,u.jsxs)(`div`,{style:{color:o.mint},children:[`⎿ `,e.importLine]})]})}]:[]],budget:t>=3?y.budget.after:y.budget.before,budgetLimit:y.budget.before,loadedPack:t>=4?v.title:e.none}}function K(e){return{pack:v,chips:O(e.state,_),gates:D(e.state,e.t,_),keptLabel:s(e.t.kept,{n:w(e.state.keep,_)}),packLift:e.t.packLift,packScrub:e.t.packScrub,scrubMeta:e.t.scrubMeta,distilled:e.t.dist,evalStages:e.t.evalStages,scrubLayers:e.t.scrubLayers,results:A(e.state.fPhase)}}function q(e){let{state:t,t:n}=e,r=t.tPhase>=3,i=t.tPhase>=6,a=r?b.uses30d.after:b.uses30d.before,o=i?b.solved30d.after:b.solved30d.before,s=b.recentUses.map((e,t)=>({description:[...n.seedActs[t],e.solved?n.resOk:n.resNg,e.amount].join(` · `),pages:e.pages}));return r&&s.unshift({description:[n.actWhat,n.actArea,n.justNow,i?n.resOk:n.resRun,`+${v.authorShare}`].join(` · `),pages:[`stripe-idempotency`,`webhook-dedupe`]}),{balance:r?b.balance.after:b.balance.before,recentAmount:r?v.authorShare:null,uses:a,solveRate:Math.round(o/a*100),earned30:r?b.earned30d.after:b.earned30d.before,dailyUses:b.dailyUses30d.map((e,t)=>e+(r&&t===29?1:0)),dailyMax:8,highlightToday:r,showNoPack:!t.published,packs:b.packs.flatMap((e,a)=>a===0&&!t.published?[]:[{title:e.title,meta:n.seedMeta[a],price:e.price,uses:a===0&&r?1:e.uses,solved:a===0&&i?1:e.solved,eval:`3/3`,earned:a===0&&r?v.authorShare:e.earned,status:n.statusLive,highlight:a===0}]),activity:s,pages:b.pageUses.map(([e,t])=>({name:String(e),count:Number(t)+(i&&(e===`stripe-idempotency`||e===`webhook-dedupe`)?1:0)})),pageMax:41}}function J(e){let t=e.get(`session`)??``;return{mode:e.get(`mode`)===`live`?`live`:`mock`,session:/^[A-Za-z0-9_-]{1,128}$/.test(t)?t:`demo`}}function Y(e,t,n){return{"data-mode":e,"data-source":t,"data-fallback":n.length?n.join(`,`):void 0}}function X({location:e}){return[{title:c(e.search)===`ja`?`GbrainX デモ`:`GbrainX demo`}]}var Z=t(function(){let[e]=i(),{mode:t,session:n}=J(e),r=W(c(e.toString()),t,n),{lang:a}=r.state;return(0,l.useEffect)(()=>{document.documentElement.lang=a,document.title=r.t.title},[a,r.t.title]),(0,u.jsxs)(`div`,{lang:a,...Y(t,r.state.source,r.state.fallback),style:{minHeight:`100vh`,background:o.background,color:o.navy,fontFamily:`"Inter", "Noto Sans JP", sans-serif`},children:[(0,u.jsx)(V,{view:r}),(0,u.jsxs)(`div`,{"aria-live":`polite`,style:{background:`#EAF1FA`,padding:`12px 24px`,color:o.navy},children:[(0,u.jsx)(`strong`,{children:r.state.view===`factory`?r.t.info.stepF:r.state.view===`agent`?r.t.info.stepA:r.t.info.stepE}),` · `,r.state.view===`factory`?r.state.loaded?r.state.fPhase===5?r.t.info.fDone:r.state.fPhase>0?r.t.info.fGate[r.state.fPhase-1]:r.state.review===null?r.t.info.fReview:r.t.info.fReady:r.t.info.f0:r.state.view===`agent`?r.state.imported?r.t.info.aImported:r.t.info.a[r.state.tPhase]:r.state.tPhase>=3?r.t.info.eEarned:r.t.info.e0]}),(0,u.jsx)(`main`,{style:{maxWidth:1320,margin:`0 auto`},children:r.state.view===`factory`?(0,u.jsx)(B,{view:r,data:K(r)}):r.state.view===`agent`?(0,u.jsx)(d,{view:r,data:G(r.t,r.state.tPhase,r.state.imported)}):(0,u.jsx)(p,{view:r,data:q(r)})})]})});export{Z as default,X as meta};
|