showai-reader 0.0.0-stage → 0.9.0-reader.cppyr4f7
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 +9 -2
- package/chunks/ComparisonMatrix-YQJRBJHK.js +1 -0
- package/chunks/ExperimentTracker-L4ERILSH.js +1 -0
- package/chunks/ExternalDiagram-CESN6AFD.js +27619 -0
- package/chunks/Flowchart-7I3IRBXN.js +10 -0
- package/chunks/Flowchart-7I3IRBXN.js.LEGAL.txt +4 -0
- package/chunks/G2Chart-N3VN7CJU.js +1218 -0
- package/chunks/G2Chart-N3VN7CJU.js.LEGAL.txt +85 -0
- package/chunks/Mindmap-H2BMB2CH.js +2 -0
- package/chunks/RichTextEditor-XPGN2LUL.js +155 -0
- package/chunks/Scene3D-RIDB2UPZ.js +4222 -0
- package/chunks/Scene3D-RIDB2UPZ.js.LEGAL.txt +9 -0
- package/chunks/StatusTree-DE6SBNV3.js +1 -0
- package/chunks/chunk-24VJITFC.js +2 -0
- package/chunks/chunk-77DN5DLU.js +1 -0
- package/chunks/chunk-7GHGKKPY.js +2 -0
- package/chunks/chunk-C4JCEMQN.js +1 -0
- package/chunks/chunk-DG67SWQA.js +1 -0
- package/chunks/chunk-DUIGVKKG.js +1 -0
- package/chunks/chunk-EJKNO2TI.js +2 -0
- package/chunks/chunk-KF47DKNH.js +1 -0
- package/chunks/chunk-KS3LLFYE.js +326 -0
- package/chunks/chunk-LY26FKQZ.js +1 -0
- package/chunks/chunk-M3KEZP5Z.js +1 -0
- package/chunks/chunk-P5ET5XMK.js +1 -0
- package/chunks/chunk-QBNRB4AJ.js +1 -0
- package/chunks/chunk-UYGYV3XW.js +2 -0
- package/chunks/chunk-UYGYV3XW.js.LEGAL.txt +23 -0
- package/chunks/chunk-WDYURK6F.js +1 -0
- package/chunks/chunk-X2BFI7UA.js +1 -0
- package/chunks/chunk-Z2EQGXZF.js +21 -0
- package/chunks/chunk-Z2EQGXZF.js.LEGAL.txt +166 -0
- package/chunks/chunk-ZZKYSVG3.js +2 -0
- package/chunks/pdf-engine-PQMJ3BVE.js +107 -0
- package/index.js +1 -0
- package/manifest.json +9 -0
- package/package.json +17 -4
- package/reader-CPPYR4F7.js +41 -0
- package/reader-CPPYR4F7.js.LEGAL.txt +34 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as H}from"./chunk-24VJITFC.js";import{a as x,d as U}from"./chunk-KF47DKNH.js";import{d as z}from"./chunk-X2BFI7UA.js";import{c as ee,hb as O,kb as q}from"./chunk-Z2EQGXZF.js";import{c as L}from"./chunk-DUIGVKKG.js";var m=L(ee(),1);var t=L(O(),1),R={done:"\u2713",failed:"\u2715",active:"\u25CF",todo:"\u25CB",paused:"\u2016"},X={done:["var(--an-good)","var(--an-good-soft)"],failed:["var(--an-bad)","var(--an-bad-soft)"],active:["var(--an-info)","var(--an-info-soft)"],todo:["var(--an-idle)","var(--an-idle-soft)"],paused:["var(--an-warn)","var(--an-warn-soft)"]},v=s=>({"--tone":s.color??X[s.tone][0],"--tone-soft":s.color?`color-mix(in srgb, ${s.color} 14%, transparent)`:X[s.tone][1]}),te=new Map(x.map(s=>[s.id,s.label])),se={done:"tree.status.done",active:"tree.status.active",failed:"tree.status.failed",todo:"tree.status.todo",paused:"tree.status.paused"};function ae(s,o){let a=se[s.id];return a&&te.get(s.id)===s.label?{...s,label:o(a)}:s}function ne(){let s=(0,m.useRef)(null),[o,a]=(0,m.useState)(800);return(0,m.useEffect)(()=>{let r=s.current;if(!r)return;let d=new ResizeObserver(([c])=>a(c.contentRect.width));return d.observe(r),()=>d.disconnect()},[]),[s,o]}function Y({items:s,statuses:o,height:a}){return(0,t.jsx)("div",{className:"an-bar",style:a?{height:a,borderRadius:a/2}:void 0,children:o.map(r=>{let d=s.filter(c=>c.status===r.id).length;return d?(0,t.jsx)("div",{style:{...v(r),width:`${d/s.length*100}%`,background:"var(--tone)"}},r.id):null})})}function ue({data:s}){let o=q(H),a=s,r=(a.statuses??x).map(e=>ae(e,o)),d=new Map(r.map(e=>[e.id,e])),c=a.groups.flatMap(e=>e.items),G=U(a),[V,E]=ne(),[g,J]=(0,m.useState)(()=>(c.find(e=>d.get(e.status)?.tone==="active")??c[0])?.id??""),[h,Q]=(0,m.useState)(null),k=E<980?E:E-316,b=!!a.root&&k>760,N=b?150:0,W=200,D=b?46:36,y=b?N+D:0,S=y+W+D,I=Math.max(180,k-S),K=38,P=16,p=0,A=[],$=[];for(let e of a.groups){let n=p;for(let l of e.items)A.push({item:l,y:p+K/2,group:e}),p+=K;$.push({group:e,y:(n+p)/2,top:n,bottom:p}),p+=P}let C=Math.max(0,p-P),B=C/2,i=c.find(e=>e.id===g),_=a.groups.find(e=>e.items.some(n=>n.id===g)),f=i?d.get(i.status):void 0,F=e=>h!==null&&e.status!==h;return(0,t.jsxs)("section",{className:"sb-block an-block","aria-label":z(a.title,o("tree.title")),children:[(0,t.jsxs)("div",{className:"an-head",children:[a.title&&(0,t.jsx)("h3",{className:"an-title",children:a.title}),a.description&&(0,t.jsx)("p",{className:"an-sub",children:a.description}),(0,t.jsx)("div",{className:"an-tools",role:"group","aria-label":o("tree.highlightByStatus"),children:r.map(e=>(0,t.jsx)("button",{type:"button",className:"an-chip",style:{...v(e),color:"var(--tone)"},"aria-pressed":h===e.id,onClick:()=>Q(h===e.id?null:e.id),children:`${R[e.tone]} ${e.label} ${G[e.id]??0}`},e.id))})]}),(0,t.jsxs)("div",{className:"an-tree-layout",ref:V,children:[(0,t.jsxs)("div",{className:"an-tree",style:{height:C,width:k},children:[(0,t.jsxs)("svg",{width:k,height:C,"aria-hidden":"true",children:[b&&$.map(({group:e,y:n})=>{let l=(N+y)/2;return(0,t.jsx)("path",{d:`M${N},${B} C${l},${B} ${l},${n} ${y},${n}`,fill:"none",stroke:"var(--an-line)",strokeWidth:1.5},e.id)}),A.map(({item:e,y:n,group:l})=>{let w=$.find(j=>j.group.id===l.id),u=d.get(e.status),T=y+W,M=(T+S)/2,Z=u.tone==="todo"||u.tone==="paused";return(0,t.jsx)("path",{d:`M${T},${w.y} C${M},${w.y} ${M},${n} ${S},${n}`,fill:"none",style:v(u),stroke:"var(--tone)",strokeOpacity:F(e)?.12:Z?.45:.7,strokeWidth:e.id===g?2.5:1.6,strokeDasharray:u.tone==="failed"||u.tone==="todo"?"4 4":void 0},e.id)})]}),b&&(0,t.jsxs)("div",{className:"an-root",style:{left:0,top:B-60,width:N,height:120},children:[(0,t.jsx)("small",{children:o("tree.question")}),a.root]}),$.map(({group:e,y:n,top:l,bottom:w})=>{let u=Math.max(56,Math.min(w-l-6,92)),T=e.items.filter(M=>d.get(M.status)?.tone==="done").length;return(0,t.jsxs)("div",{className:"an-group",style:{left:y,top:n-u/2,width:W,height:u},children:[(0,t.jsxs)("div",{className:"an-group-top",children:[(0,t.jsx)("b",{children:e.label}),(0,t.jsxs)("span",{children:[T,"/",e.items.length]})]}),e.summary&&u>70&&(0,t.jsx)("div",{className:"an-group-summary",children:e.summary}),(0,t.jsx)(Y,{items:e.items,statuses:r})]},e.id)}),A.map(({item:e,y:n})=>{let l=d.get(e.status);return(0,t.jsxs)("button",{type:"button",className:`an-item an-st-${l.tone}${e.id===g?" is-selected":""}${F(e)?" is-dim":""}`,style:{...v(l),left:S,top:n-15,width:I,height:30},"aria-pressed":e.id===g,onClick:()=>J(e.id),children:[(0,t.jsx)("span",{className:"an-mark","aria-label":l.label,children:R[l.tone]}),(0,t.jsx)("span",{className:"an-item-label",children:e.label}),e.result&&I>420&&(0,t.jsx)("span",{className:"an-item-result",children:e.result}),e.source&&(0,t.jsx)("span",{className:"an-item-source",children:e.source})]},e.id)})]}),i&&f&&(0,t.jsxs)("aside",{className:"an-detail","aria-live":"polite",children:[(0,t.jsxs)("div",{className:"an-panel",children:[_&&(0,t.jsx)("div",{className:"an-sub",children:_.label}),(0,t.jsx)("h4",{children:i.label}),(0,t.jsxs)("span",{className:"an-pill",style:v(f),children:[R[f.tone]," ",f.label]}),i.source&&(0,t.jsxs)("span",{className:"an-sub",children:[" \xB7 ",o("tree.source",{source:i.source})]}),i.detail&&(0,t.jsxs)("div",{className:"an-field",children:[(0,t.jsx)("small",{children:o("tree.detail")}),i.detail]}),i.result&&(0,t.jsxs)("div",{className:"an-result-box",style:v(f),children:[(0,t.jsx)("small",{style:{color:"var(--tone)",fontWeight:600},children:o("tree.result")}),(0,t.jsx)("div",{children:i.result})]}),i.links&&i.links.length>0&&(0,t.jsxs)("div",{className:"an-field",children:[(0,t.jsx)("small",{children:o("tree.links")}),(0,t.jsx)("div",{className:"an-tags",children:i.links.map(e=>(0,t.jsx)("span",{className:"an-tag",children:e},e))})]})]}),(0,t.jsxs)("div",{className:"an-panel",children:[(0,t.jsx)("p",{className:"an-panel-title",children:o("tree.overall")}),(0,t.jsx)(Y,{items:c,statuses:r,height:10}),(0,t.jsx)("div",{className:"an-legend",children:r.map(e=>(0,t.jsxs)("span",{style:v(e),children:[(0,t.jsx)("b",{children:R[e.tone]})," ",e.label," ",G[e.id]??0]},e.id))})]})]})]}),(0,t.jsxs)("details",{className:"an-static",children:[(0,t.jsx)("summary",{children:o("tree.readAll",{count:c.length})}),a.groups.map(e=>(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{children:e.label}),(0,t.jsx)("ul",{children:e.items.map(n=>(0,t.jsxs)("li",{children:[(0,t.jsx)("b",{children:d.get(n.status)?.label})," \xB7"," ",n.result?o("tree.itemResult",{label:n.label,result:n.result}):n.label]},n.id))})]},e.id))]})]})}export{ue as StatusTreeBlock};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a}from"./chunk-Z2EQGXZF.js";import{d as e}from"./chunk-DUIGVKKG.js";a(`.sb-block.an-block{--an-text: var(--text, #222222);--an-muted: var(--muted, #6a6a6a);--an-line: var(--line, #dddddd);--an-paper: var(--paper, #ffffff);--an-surface: var(--surface, #fafafa);--an-accent: var(--accent, #120a8f);--an-accent-soft: var(--accent-soft, #eeedf9);--an-good: #2f6b4f;--an-good-soft: #e6efe9;--an-bad: #b0473f;--an-bad-soft: #f8e7e5;--an-warn: #a86b34;--an-warn-soft: #f6ece2;--an-info: #3b74b8;--an-info-soft: #e5eff8;--an-idle: #8a918c;--an-idle-soft: #f1f2ee;color:var(--an-text);font-family:inherit;font-size:14px;line-height:1.55;padding:8px 0;container-type:inline-size;overflow-wrap:anywhere}:root[data-theme=dark] .an-block,[data-theme=dark] .an-block{--an-good: #7cc3a0;--an-good-soft: #20352b;--an-bad: #e48b83;--an-bad-soft: #3b2423;--an-warn: #e0a96f;--an-warn-soft: #3a2c1e;--an-info: #8bb8eb;--an-info-soft: #1f2d3d;--an-idle: #a3aaa5;--an-idle-soft: #2a2c2b}.an-block *{box-sizing:border-box}.an-head{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px 12px;margin-bottom:12px}.an-title{font-size:17px;font-weight:700;margin:0}.an-sub{color:var(--an-muted);font-size:13px;margin:0}.an-tools{margin-left:auto;display:flex;flex-wrap:wrap;gap:6px;align-items:center}.an-block .an-chip{border:1px solid var(--an-line);background:var(--an-paper);color:var(--an-muted);border-radius:999px;padding:3px 10px;font:inherit;font-size:12px;font-weight:600;cursor:pointer}.an-chip[aria-pressed=true]{border-color:currentColor;background:var(--an-surface);color:var(--an-text)}.an-chip:focus-visible,.an-item:focus-visible,.an-col-button:focus-visible,.an-row:focus-visible{outline:2px solid var(--an-accent);outline-offset:2px}.an-panel{background:var(--an-paper);border:1px solid var(--an-line);border-radius:12px;padding:12px;min-width:0}.an-panel-title{font-size:12.5px;font-weight:700;margin:0 0 8px}.an-empty{color:var(--an-muted);font-size:13px;padding:12px 0}.an-static{margin-top:10px;font-size:13px}.an-static summary{cursor:pointer;color:var(--an-muted)}.an-static table{border-collapse:collapse;width:100%;margin-top:8px}.an-static th,.an-static td{border-bottom:1px solid var(--an-line);padding:4px 6px;text-align:left;vertical-align:top}.an-tone-yes{--tone: var(--an-good);--tone-soft: var(--an-good-soft)}.an-tone-no{--tone: var(--an-bad);--tone-soft: var(--an-bad-soft)}.an-tone-partial{--tone: var(--an-warn);--tone-soft: var(--an-warn-soft)}.an-tone-neutral{--tone: var(--an-info);--tone-soft: var(--an-info-soft)}.an-tone-na{--tone: var(--an-idle);--tone-soft: transparent}.an-matrix-scroll{overflow-x:auto}.an-matrix{border-collapse:separate;border-spacing:0;width:100%;min-width:560px}.an-matrix th,.an-matrix td{padding:8px 10px;border-bottom:1px solid var(--an-line);text-align:left;vertical-align:top}.an-matrix thead th{font-size:13px;white-space:nowrap;border-bottom-width:2px}.an-matrix .an-rowhead{position:sticky;left:0;z-index:1;background:var(--an-paper);width:180px;min-width:140px}.an-row-label{font-weight:600}.an-row-hint{color:var(--an-muted);font-size:11.5px;margin-top:2px}.an-group-row th{background:var(--an-surface);color:var(--an-muted);font-size:12px;letter-spacing:.04em}.an-col-button{all:unset;cursor:pointer;display:block}.an-col-note{display:block;font-weight:500;font-size:11.5px;color:var(--an-muted);white-space:normal}.an-matrix .is-highlight{background:var(--an-accent-soft);box-shadow:inset 2px 0 var(--an-accent),inset -2px 0 var(--an-accent)}.an-matrix thead .is-highlight{color:var(--an-accent)}.an-matrix .is-focus{background:var(--an-surface);box-shadow:inset 2px 0 var(--an-text),inset -2px 0 var(--an-text)}.an-matrix.has-focus td:not(.is-focus):not(.is-highlight):not(.an-rowhead){opacity:.55}.an-matrix tbody tr:hover td,.an-matrix tbody tr:hover th{background-image:linear-gradient(var(--an-surface),var(--an-surface))}.an-cell{display:inline-flex;gap:5px;align-items:baseline;color:var(--tone);background:var(--tone-soft);border-radius:6px;padding:1px 6px;line-height:1.5;white-space:nowrap}.an-cell span{color:var(--an-text)}.an-tone-na.an-cell,.an-tone-na.an-cell span{color:var(--an-idle);padding:0}.an-note-mark{color:var(--an-muted);font-size:11px;vertical-align:super}.an-legend{display:flex;flex-wrap:wrap;gap:4px 14px;margin-top:8px;font-size:12px;color:var(--an-muted)}.an-legend b{color:var(--tone)}.an-tree-layout{display:flex;gap:16px;align-items:flex-start}.an-tree{flex:none;max-width:100%;position:relative}.an-tree svg{position:absolute;inset:0;overflow:visible}.an-root{position:absolute;border-radius:14px;background:var(--an-text);color:var(--an-paper);padding:12px 14px;display:flex;flex-direction:column;justify-content:center;font-size:13px;font-weight:600;line-height:1.45}.an-root small{opacity:.7;font-size:11px;font-weight:500}.an-group{position:absolute;background:var(--an-paper);border:1px solid var(--an-line);border-radius:12px;padding:8px 12px;display:flex;flex-direction:column;justify-content:center;gap:5px}.an-group-top{display:flex;align-items:baseline;gap:6px;font-size:13.5px}.an-group-top span{margin-left:auto;font-size:11.5px;color:var(--an-muted)}.an-group-summary{font-size:11px;color:var(--an-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.an-bar{display:flex;height:6px;border-radius:3px;overflow:hidden;background:var(--an-idle-soft)}.an-block .an-item{position:absolute;display:flex;align-items:center;gap:8px;padding:0 10px 0 6px;border-radius:9px;border:1px solid var(--an-line);background:var(--an-paper);font:inherit;font-size:12.5px;color:var(--an-text);text-align:left;cursor:pointer;transition:opacity .15s}.an-item.is-selected{border-color:var(--tone);background:var(--tone-soft)}.an-item.is-dim{opacity:.3}.an-mark{width:20px;height:20px;flex-shrink:0;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:700;color:var(--tone);background:var(--tone-soft)}.an-st-done .an-mark{color:var(--an-paper);background:var(--tone)}.an-st-todo .an-mark{border:1px dashed var(--tone)}.an-st-active .an-mark{animation:an-pulse 1.4s ease-in-out infinite}.an-item-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.an-st-failed .an-item-label{color:var(--an-muted);text-decoration:line-through;text-decoration-color:color-mix(in srgb,var(--an-bad) 55%,transparent)}.an-item-result{max-width:48%;font-size:11px;color:var(--an-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.an-st-done .an-item-result{color:var(--tone)}.an-item-source{font-size:10.5px;color:var(--an-muted);white-space:nowrap}.an-detail{width:300px;flex-shrink:0;position:sticky;top:8px;display:flex;flex-direction:column;gap:10px}.an-detail h4{font-size:15px;margin:4px 0 8px;line-height:1.4}.an-pill{display:inline-block;font-size:12px;font-weight:600;color:var(--tone);background:var(--tone-soft);border-radius:999px;padding:2px 10px}.an-field{margin-top:12px}.an-field small{display:block;font-size:11.5px;color:var(--an-muted);margin-bottom:3px}.an-result-box{margin-top:12px;padding:10px 12px;border-radius:10px;background:var(--tone-soft)}.an-tags{display:flex;flex-wrap:wrap;gap:5px}.an-tag{font-size:12px;font-weight:600;padding:2px 8px;border-radius:6px;background:var(--an-idle-soft)}@keyframes an-pulse{0%,to{opacity:1}50%{opacity:.35}}.an-tracker{background:var(--an-surface);border:1px solid var(--an-line);border-radius:14px;padding:14px}.an-tracker-grid{display:grid;grid-template-columns:250px minmax(0,1fr) 250px;gap:16px;align-items:stretch}.an-runs{display:flex;flex-direction:column;padding:0;min-height:0}.an-runs-head{padding:10px 12px 8px;border-bottom:1px solid var(--an-line)}.an-runs-list{overflow-y:auto;flex:1 1 0;min-height:0}.an-row{display:grid;grid-template-columns:16px 40px minmax(0,1fr) auto;align-items:center;gap:6px;padding:7px 10px;font-size:12px;cursor:pointer;border-bottom:1px solid var(--an-idle-soft)}.an-row:hover{background:var(--an-surface)}.an-row.is-selected{background:var(--an-accent-soft)}.an-row-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.an-row-name small{display:block;font-size:10.5px;color:var(--an-muted)}.an-score{font-variant-numeric:tabular-nums;font-weight:600}.an-status{font-size:10.5px;font-weight:600;color:var(--tone);background:var(--tone-soft);border-radius:999px;padding:0 7px;white-space:nowrap}.an-ex-kept{--tone: var(--an-good);--tone-soft: var(--an-good-soft)}.an-ex-discarded{--tone: var(--an-idle);--tone-soft: var(--an-idle-soft)}.an-ex-failed{--tone: var(--an-bad);--tone-soft: var(--an-bad-soft)}.an-ex-running{--tone: var(--an-info);--tone-soft: var(--an-info-soft)}.an-ex-stopped{--tone: var(--an-warn);--tone-soft: var(--an-warn-soft)}.an-main{display:flex;flex-direction:column;gap:12px;min-width:0}.an-plot-legend{display:flex;flex-wrap:wrap;gap:4px 14px;font-size:12px;color:var(--an-muted);padding:0 4px 6px;align-items:center}.an-plot-legend b{color:var(--an-text);font-size:13px}.an-plot{position:relative}.an-plot svg{display:block}.an-plot text{fill:var(--an-muted);font-size:11px}.an-grid-line{stroke:var(--an-line);stroke-dasharray:3 5}.an-frontier{fill:none;stroke:var(--an-good);stroke-width:2.5;stroke-linejoin:round}.an-baseline{stroke:var(--an-warn);stroke-dasharray:6 4}.an-plot .an-baseline-label{fill:var(--an-warn)}.an-lane{fill:var(--an-idle-soft)}.an-point{cursor:pointer}.an-point-kept{fill:var(--an-good)}.an-point-other{fill:var(--an-paper);stroke:var(--an-idle);stroke-width:1.6}.an-point-label{font-weight:600}.an-plot .an-point-label.is-frontier{fill:var(--an-good)}.an-ring{animation:an-ring 1.8s ease-out infinite;transform-box:fill-box;transform-origin:center}@keyframes an-ring{0%{opacity:.9;transform:scale(.6)}to{opacity:0;transform:scale(1.6)}}.an-tip{position:absolute;width:220px;pointer-events:none;background:var(--an-text);color:var(--an-paper);border-radius:10px;padding:10px 12px;font-size:12px;line-height:1.6;box-shadow:0 10px 30px #0003}.an-tip span{display:block;opacity:.75}.an-small-multiples{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px}.an-mini text{fill:var(--an-muted);font-size:10px}.an-mini-values{display:flex;flex-wrap:wrap;gap:2px 10px;font-size:11px;color:var(--an-muted);min-height:17px}.an-stats{display:flex;flex-direction:column;gap:8px}.an-stat-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.an-stat{background:var(--an-paper);border:1px solid var(--an-line);border-radius:10px;padding:8px 10px;min-width:0}.an-stat.is-wide{grid-column:1 / -1}.an-stat small{display:block;font-size:11.5px;color:var(--an-muted)}.an-stat-value{display:block;font-size:21px;font-variant-numeric:tabular-nums;line-height:1.3;white-space:nowrap}.an-stat-unit{font-style:normal;font-size:12px;font-weight:500;color:var(--an-muted);margin-left:3px}.an-stat p{margin:0;font-size:10.5px;color:var(--an-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.an-meter{height:5px;border-radius:3px;background:var(--an-idle-soft);margin-top:6px;position:relative}.an-meter i{position:absolute;inset:0 auto 0 0;border-radius:3px;background:var(--an-good)}.an-meter i.is-total{background:var(--an-line)}.an-detail-card{background:var(--an-text);color:var(--an-paper);border-radius:10px;padding:10px 12px;font-size:12px;line-height:1.6}.an-detail-card span{display:block;opacity:.75}@container (max-width: 980px){.an-tracker-grid{grid-template-columns:minmax(0,1fr)}.an-runs{order:3;max-height:320px}.an-stats{order:2}.an-stat-grid{grid-template-columns:repeat(auto-fit,minmax(140px,1fr))}.an-tree-layout{flex-direction:column}.an-detail{width:100%;position:static}}@media(prefers-reduced-motion:reduce){.an-ring,.an-st-active .an-mark{animation:none}}@media print{.an-tools,.an-tip{display:none}.an-runs-list{overflow:visible}}
|
|
2
|
+
`);var n=e("analysis",{"zh-CN":{"matrix.title":"\u5BF9\u6BD4\u77E9\u9635","matrix.legend.yes":"\u91C7\u7528 / \u6EE1\u8DB3","matrix.legend.no":"\u4E0D\u91C7\u7528 / \u4E0D\u6EE1\u8DB3","matrix.legend.partial":"\u90E8\u5206\u6216\u6709\u6539\u52A8","matrix.legend.neutral":"\u4E2D\u6027\u8BF4\u660E","matrix.legend.na":"\u672A\u6D89\u53CA","matrix.diffOnly":"\u53EA\u770B\u5DEE\u5F02 {count}/{total}","matrix.clearFocus":"\u53D6\u6D88\u805A\u7126","matrix.dimension":"\u7EF4\u5EA6","matrix.source":"\u6765\u6E90 \u2197","matrix.allSame":"\u6240\u6709\u7EF4\u5EA6\u5728\u5404\u5217\u4E4B\u95F4\u90FD\u76F8\u540C\u3002","matrix.focusHint":"\u70B9\u51FB\u5217\u5934\u53EF\u805A\u7126\u4E00\u5217","matrix.notes":"\u6CE8\u91CA","matrix.note":"{column} \xB7 {row}\uFF1A{note}","tree.title":"\u72B6\u6001\u6811","tree.status.done":"\u8D70\u901A","tree.status.active":"\u8FDB\u884C\u4E2D","tree.status.failed":"\u6CA1\u8D70\u901A","tree.status.todo":"\u5F85\u63A2\u7D22","tree.status.paused":"\u6401\u7F6E","tree.highlightByStatus":"\u6309\u72B6\u6001\u7A81\u51FA","tree.question":"\u95EE\u9898","tree.source":"\u6765\u6E90\uFF1A{source}","tree.detail":"\u8BF4\u660E","tree.result":"\u7ED3\u679C","tree.links":"\u5173\u8054","tree.overall":"\u6574\u4F53\u8FDB\u5EA6","tree.readAll":"\u6309\u7C7B\u522B\u9605\u8BFB\u5168\u90E8\u6761\u76EE\uFF08{count}\uFF09","tree.itemResult":"{label}\uFF1A{result}","tracker.title":"\u5B9E\u9A8C\u8FFD\u8E2A","tracker.status.kept":"\u4FDD\u7559","tracker.status.discarded":"\u653E\u5F03","tracker.status.failed":"\u5931\u8D25","tracker.status.running":"\u8FD0\u884C\u4E2D","tracker.status.stopped":"\u5DF2\u505C\u6B62","tracker.overTime":"{metric} \u968F\u65F6\u95F4\u7684\u5206\u5E03","tracker.noScore":"\u65E0\u5206\u6570","tracker.baseline":"\u57FA\u7EBF {value}","tracker.startTime":"\u5F00\u59CB\u65F6\u95F4 \u2192","tracker.minutes":"{count} \u5206\u949F","tracker.metricValue":"{metric}\uFF1A{value}","tracker.best":"\u6700\u4F73","tracker.updatedAt":"\u66F4\u65B0\u4E8E {time}","tracker.runs":"\u8FD0\u884C \xB7 {count}","tracker.filterByStatus":"\u6309\u72B6\u6001\u7B5B\u9009","tracker.all":"\u5168\u90E8","tracker.showRun":"\u5728\u66F2\u7EBF\u4E2D\u663E\u793A {id}","tracker.allExperiments":"\u5168\u90E8\u5B9E\u9A8C \xB7 {metric}","tracker.higherIsBetter":"\u8D8A\u9AD8\u8D8A\u597D","tracker.lowerIsBetter":"\u8D8A\u4F4E\u8D8A\u597D","tracker.frontier":"\u2014 \u6700\u4F18\u524D\u6CBF","tracker.legendKept":"\u25CF \u4FDD\u7559","tracker.legendOther":"\u25CB \u5176\u4ED6","tracker.listSeparator":"\u3001","tracker.runsHint":"\u6A2A\u8F74\u4E3A\u8BAD\u7EC3\u6B65\uFF1B\u5728\u5DE6\u4FA7\u52FE\u9009\u4EE5\u663E\u793A\u6216\u9690\u85CF","tracker.total":"\u5B9E\u9A8C\u603B\u6570","tracker.runningCount":"\u8FD0\u884C\u4E2D {count}","tracker.groupBest":"{group}\u6700\u4F73","tracker.currentBest":"\u5F53\u524D\u6700\u4F73","tracker.gain":"\u6BD4\u57FA\u7EBF\u6539\u5584","tracker.gainDetail":"\u524D\u6CBF\u4E0A\u7684\u6700\u4F73 {best} \xB7 \u57FA\u7EBF {baseline}","tracker.keepRate":"\u4FDD\u7559\u7387","tracker.keepRateDetail":"\u4FDD\u7559 {kept} \xB7 \u8FD0\u884C\u4E2D {running}","tracker.resourceHours":"{unit} \xB7 \u65F6","tracker.budget":"\u9884\u7B97 {value}","tracker.cost":"\u4F30\u7B97\u6210\u672C","tracker.costRate":"\u6309 {rate} / {unit}\xB7\u65F6","tracker.byCategory":"\u6309\u65B9\u5411 \xB7 \u4FDD\u7559 / \u603B\u6570","tracker.readTable":"\u4EE5\u8868\u683C\u9605\u8BFB\u5168\u90E8\u5B9E\u9A8C\uFF08{count}\uFF09","tracker.column.name":"\u540D\u79F0","tracker.column.start":"\u5F00\u59CB","tracker.column.status":"\u72B6\u6001","tracker.column.note":"\u5907\u6CE8"},en:{"matrix.title":"Comparison matrix","matrix.legend.yes":"Adopted / met","matrix.legend.no":"Not adopted / not met","matrix.legend.partial":"Partly or with changes","matrix.legend.neutral":"Neutral note","matrix.legend.na":"Not covered","matrix.diffOnly":"Differences only {count}/{total}","matrix.clearFocus":"Clear focus","matrix.dimension":"Dimension","matrix.source":"Source \u2197","matrix.allSame":"Every dimension is the same across all columns.","matrix.focusHint":"Click a column header to focus it","matrix.notes":"Notes","matrix.note":"{column} \xB7 {row}: {note}","tree.title":"Status tree","tree.status.done":"Worked","tree.status.active":"In progress","tree.status.failed":"Didn't work","tree.status.todo":"To explore","tree.status.paused":"On hold","tree.highlightByStatus":"Highlight by status","tree.question":"Question","tree.source":"Source: {source}","tree.detail":"Details","tree.result":"Result","tree.links":"Related","tree.overall":"Overall progress","tree.readAll":"Read all items by category ({count})","tree.itemResult":"{label}: {result}","tracker.title":"Experiment tracker","tracker.status.kept":"Kept","tracker.status.discarded":"Discarded","tracker.status.failed":"Failed","tracker.status.running":"Running","tracker.status.stopped":"Stopped","tracker.overTime":"{metric} over time","tracker.noScore":"No score","tracker.baseline":"Baseline {value}","tracker.startTime":"Start time \u2192","tracker.minutes":"{count} min","tracker.metricValue":"{metric}: {value}","tracker.best":"Best","tracker.updatedAt":"Updated {time}","tracker.runs":"Runs \xB7 {count}","tracker.filterByStatus":"Filter by status","tracker.all":"All","tracker.showRun":"Show {id} in charts","tracker.allExperiments":"All experiments \xB7 {metric}","tracker.higherIsBetter":"higher is better","tracker.lowerIsBetter":"lower is better","tracker.frontier":"\u2014 Best frontier","tracker.legendKept":"\u25CF Kept","tracker.legendOther":"\u25CB Other","tracker.listSeparator":", ","tracker.runsHint":"X-axis shows training steps; check runs on the left to show or hide them","tracker.total":"Experiments","tracker.runningCount":"Running {count}","tracker.groupBest":"Best in {group}","tracker.currentBest":"Current best","tracker.gain":"Gain over baseline","tracker.gainDetail":"Best on the frontier {best} \xB7 baseline {baseline}","tracker.keepRate":"Keep rate","tracker.keepRateDetail":"Kept {kept} \xB7 running {running}","tracker.resourceHours":"{unit} hours","tracker.budget":"Budget {value}","tracker.cost":"Estimated cost","tracker.costRate":"At {rate} per {unit} hour","tracker.byCategory":"By direction \xB7 kept / total","tracker.readTable":"Read all experiments as a table ({count})","tracker.column.name":"Name","tracker.column.start":"Start","tracker.column.status":"Status","tracker.column.note":"Notes"}});export{n as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var p=["group","box","sphere","cylinder","cone","torus","plane","arrow","line","label"],y=["position.x","position.y","position.z","rotation.x","rotation.y","rotation.z","scale","scale.x","scale.y","scale.z"],g=["XYZ","XZY","YXZ","YZX","ZXY","ZYX"],a={objects:300,depth:8,parameters:8,points:500,coordinate:1e4},r=i=>{throw new Error(i)},m=i=>!!i&&typeof i=="object"&&!Array.isArray(i);function $(i,e){(typeof i!="string"||!i.trim())&&r(`${e} must be non-empty text.`)}function c(i,e){i!==void 0&&$(i,e)}function f(i,e,n=-1/0,t=1/0){(typeof i!="number"||!Number.isFinite(i)||i<n||i>t)&&r(`${e} must be a finite number${Number.isFinite(n)||Number.isFinite(t)?` from ${n} to ${t}`:""}.`)}function d(i,e){i!==void 0&&f(i,e,Number.MIN_VALUE,a.coordinate)}function l(i,e){i!==void 0&&typeof i!="boolean"&&r(`${e} must be true or false.`)}function x(i,e){i!==void 0&&!/^#[0-9a-fA-F]{6}$/.test(i)&&r(`${e} must be a six-digit hex color.`)}function u(i,e,n=3,t=!1){i===void 0&&!t||((!Array.isArray(i)||i.length!==n)&&r(`${e} must be an array of ${n} numbers.`),i.forEach((s,o)=>f(s,`${e}[${o}]`,-a.coordinate,a.coordinate)))}function E(i){i!==void 0&&(m(i)||r("camera must be an object."),u(i.position,"camera.position"),u(i.target,"camera.target"),i.fov!==void 0&&f(i.fov,"camera.fov",10,120),l(i.autoRotate,"camera.autoRotate"),i.position&&i.target&&i.position.every((e,n)=>e===i.target[n])&&r("camera.position must differ from camera.target."))}function A(i){if(i===void 0)return new Set;(!Array.isArray(i)||i.length>a.parameters)&&r(`parameters must be an array of at most ${a.parameters} items.`);let e=new Set;for(let n of i)m(n)||r("parameters contains an invalid item."),$(n.id,"parameter.id"),e.has(n.id)&&r(`parameters contains duplicate id ${n.id}.`),e.add(n.id),$(n.label,`parameter ${n.id} label`),f(n.min,`parameter ${n.id} min`),f(n.max,`parameter ${n.id} max`),n.min>=n.max&&r(`parameter ${n.id} min must be less than max.`),f(n.value,`parameter ${n.id} value`,n.min,n.max),n.step!==void 0&&f(n.step,`parameter ${n.id} step`,Number.MIN_VALUE,n.max-n.min),n.unit!==void 0&&typeof n.unit!="string"&&r(`parameter ${n.id} unit must be text.`),c(n.description,`parameter ${n.id} description`),l(n.demo,`parameter ${n.id} demo`);return e}function b(i,e,n,t){switch(m(i)||r(`${e} must be an object.`),n>a.depth&&r(`objects are nested deeper than ${a.depth} levels.`),++t.count>a.objects&&r(`A scene can contain at most ${a.objects} objects.`),p.includes(i.type)||r(`${e}.type must be one of ${p.join(", ")}.`),i.id!==void 0&&($(i.id,`${e}.id`),t.ids.has(i.id)&&r(`objects contains duplicate id ${i.id}.`),t.ids.add(i.id)),c(i.label,`${e}.label`),u(i.labelOffset,`${e}.labelOffset`),u(i.position,`${e}.position`),u(i.rotation,`${e}.rotation`),i.rotationOrder!==void 0&&!g.includes(i.rotationOrder)&&r(`${e}.rotationOrder must be one of ${g.join(", ")}.`),typeof i.scale=="number"?d(i.scale,`${e}.scale`):(u(i.scale,`${e}.scale`),i.scale?.forEach((s,o)=>d(s,`${e}.scale[${o}]`))),x(i.color,`${e}.color`),i.opacity!==void 0&&f(i.opacity,`${e}.opacity`,0,1),l(i.wireframe,`${e}.wireframe`),i.type){case"box":u(i.size,`${e}.size`),i.size?.forEach((s,o)=>d(s,`${e}.size[${o}]`));break;case"plane":u(i.size,`${e}.size`,2),i.size?.forEach((s,o)=>d(s,`${e}.size[${o}]`));break;case"sphere":d(i.radius,`${e}.radius`);break;case"cylinder":i.radiusTop!==void 0&&f(i.radiusTop,`${e}.radiusTop`,0,a.coordinate),i.radiusBottom!==void 0&&f(i.radiusBottom,`${e}.radiusBottom`,0,a.coordinate),d(i.radius,`${e}.radius`),d(i.height,`${e}.height`);break;case"cone":d(i.radius,`${e}.radius`),d(i.height,`${e}.height`);break;case"torus":d(i.radius,`${e}.radius`),d(i.tube,`${e}.tube`);break;case"arrow":u(i.from,`${e}.from`),u(i.to,`${e}.to`,3,!0),(i.from??[0,0,0]).every((s,o)=>s===i.to[o])&&r(`${e} must have different from and to points.`);break;case"line":(!Array.isArray(i.points)||i.points.length<2||i.points.length>a.points)&&r(`${e}.points must contain 2 to ${a.points} points.`),i.points.forEach((s,o)=>u(s,`${e}.points[${o}]`,3,!0)),l(i.closed,`${e}.closed`);break;case"label":$(i.text??i.label,`${e}.text`),c(i.text,`${e}.text`);break}if(i.bindings!==void 0){(!Array.isArray(i.bindings)||i.bindings.length>10)&&r(`${e}.bindings must be an array of at most 10 items.`);for(let s of i.bindings)m(s)||r(`${e}.bindings contains an invalid item.`),$(s.parameter,`${e}.bindings.parameter`),t.parameters.has(s.parameter)||r(`${e}.bindings references unknown parameter ${s.parameter}.`),y.includes(s.property)||r(`${e}.bindings.property must be one of ${y.join(", ")}.`),s.factor!==void 0&&f(s.factor,`${e}.bindings.factor`)}i.children!==void 0&&(i.type!=="group"&&r(`${e}.children requires type group.`),Array.isArray(i.children)||r(`${e}.children must be an array.`),i.children.forEach((s,o)=>b(s,`${e}.children[${o}]`,n+1,t)))}function N(i){m(i)||r("scene-3d data must be an object."),c(i.title,"title"),c(i.description,"description"),i.height!==void 0&&f(i.height,"height",200,900),x(i.background,"background"),l(i.grid,"grid"),l(i.axes,"axes"),E(i.camera);let e=A(i.parameters);(!Array.isArray(i.objects)||i.objects.length<1)&&r("objects must be a non-empty array.");let n={count:0,ids:new Set,parameters:e};return i.objects.forEach((t,s)=>b(t,`objects[${s}]`,1,n)),i}function S(i,e,n){let t=n[e.parameter];return i+(e.factor??1)*(Number.isFinite(t)?t:0)}function k(i){let e=[],n=t=>{let s=t.type==="label"?t.text??t.label:t.label;s&&e.push(s),t.children?.forEach(n)};return i.objects?.forEach(n),e}export{N as a,S as b,k as c};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as h}from"./chunk-WDYURK6F.js";import{f as d,i as g}from"./chunk-DUIGVKKG.js";var a=g(h),D=["#120a8f","#5147b8","#8179c2","#4674af","#6b78a8","#898892"],C=(e,r="")=>typeof e=="string"||typeof e=="number"?String(e):r,S=(e,r=0)=>typeof e=="number"&&Number.isFinite(e)?e:r,x=()=>globalThis.crypto?.randomUUID?.()??`row-${Date.now()}-${Math.random().toString(36).slice(2)}`;function w(e){if(typeof e=="string"&&!/^[\u0000-\u0020]|[\u0000-\u001f]/.test(e))try{let r=new URL(e);return["http:","https:"].includes(r.protocol)?r.href:void 0}catch{return}}function L(e){if(typeof e=="string")return/^data:image\/(?:png|jpeg|gif|webp|avif);base64,[a-z\d+/=\s]+$/i.test(e)?e:w(e)}function R(e){let r=JSON.parse(e);if(!r||typeof r!="object")throw new Error(a("chartData.notObject"));let{labels:o,series:n}=r;if(!Array.isArray(o)||!o.every(t=>typeof t=="string"))throw new Error(a("chartData.labels"));if(!Array.isArray(n))throw new Error(a("chartData.series"));if(o.length>500||n.length>20)throw new Error(a("chartData.tooLarge"));for(let t of n){if(!t||typeof t.name!="string"||!Array.isArray(t.values))throw new Error(a("chartData.seriesShape"));if(t.values.length!==o.length)throw new Error(a("chartData.length",{name:t.name}));if(!t.values.every(i=>typeof i=="number"&&Number.isFinite(i)))throw new Error(a("chartData.finite",{name:t.name}));if(t.color!==void 0&&(typeof t.color!="string"||!/^#(?:[a-f\d]{3}|[a-f\d]{4}|[a-f\d]{6}|[a-f\d]{8})$/i.test(t.color)))throw new Error(a("chartData.color",{name:t.name}))}return{labels:o,series:n}}function k(e,r,o,n,t){let i=o.trim().toLocaleLowerCase(),l=e.filter(s=>(!i||r.some(c=>String(s[c.id]??"").toLocaleLowerCase().includes(i)))&&(!n.column||String(s[n.column]??"")===n.value));if(!t)return l;let m=r.find(s=>s.id===t.column);return l.sort((s,c)=>{let u=s[t.column]??"",f=c[t.column]??"",p=m?.type==="number"?Number(u)-Number(f):m?.type==="checkbox"?+!!u-+!!f:String(u).localeCompare(String(f),d(),{numeric:!0});return t.direction==="asc"?p:-p})}function E(e,r){let o=n=>{let t=String(n??"");return`"${(/^[\s]*[=+@-]|^[\t\r\n]/.test(t)&&!/^-?\d+(\.\d+)?$/.test(t)?`'${t}`:t).replaceAll('"','""')}"`};return"\uFEFF"+[e.map(n=>o(n.name)).join(","),...r.map(n=>e.map(t=>o(n[t.id])).join(","))].join(`\r
|
|
2
|
+
`)}function U(e,r,o){let n=URL.createObjectURL(new Blob([e],{type:o})),t=document.createElement("a");t.href=n,t.download=r,t.click(),setTimeout(()=>URL.revokeObjectURL(n),1e3)}export{D as a,C as b,S as c,x as d,w as e,L as f,R as g,k as h,E as i,U as j};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var c=new Set(["indigo","classic","dark"]),h=new Set(["tooltip","elementHighlight","elementSelect","brushHighlight","brushFilter","legendFilter"]);function y(r){if(!r||typeof r!="object"||Array.isArray(r))throw new Error("\u56FE\u8868\u53C2\u6570\u5FC5\u987B\u662F\u5BF9\u8C61\u3002");if(!r.datasets||typeof r.datasets!="object"||Array.isArray(r.datasets)||!Object.keys(r.datasets).length)throw new Error("datasets \u5FC5\u987B\u5305\u542B\u56FE\u8868\u6570\u636E\u3002");if(r.theme!==void 0&&!c.has(r.theme))throw new Error("\u4E0D\u652F\u6301\u7684\u56FE\u8868\u4E3B\u9898\u3002");if(r.height!==void 0&&(!Number.isFinite(r.height)||r.height<200||r.height>900))throw new Error("\u56FE\u8868\u9AD8\u5EA6\u5E94\u4E3A 200 \u5230 900\u3002");for(let e of["title","description"])if(r[e]!==void 0&&typeof r[e]!="string")throw new Error(e+" \u5FC5\u987B\u662F\u6587\u5B57\u3002");for(let e of["legend","animation"])if(r[e]!==void 0&&typeof r[e]!="boolean")throw new Error(e+" \u5FC5\u987B\u662F\u5E03\u5C14\u503C\u3002");if(r.fields!==void 0&&(!r.fields||typeof r.fields!="object"||Array.isArray(r.fields)||Object.entries(r.fields).some(([e,t])=>["__proto__","constructor","prototype"].includes(e)||typeof t!="string"||!t)))throw new Error("\u5B57\u6BB5\u5BF9\u5E94\u5FC5\u987B\u662F\u975E\u7A7A\u4E14\u975E\u4FDD\u7559\u7684\u5B57\u6BB5\u540D\u3002");if(r.interaction!==void 0&&(!r.interaction||typeof r.interaction!="object"||Object.entries(r.interaction).some(([e,t])=>!h.has(e)||typeof t!="boolean")))throw new Error("\u4EA4\u4E92\u914D\u7F6E\u683C\u5F0F\u4E0D\u6B63\u786E\u3002");let o=r.appearance??{};if(!o||typeof o!="object"||Array.isArray(o))throw new Error("\u5916\u89C2\u914D\u7F6E\u5FC5\u987B\u662F\u5BF9\u8C61\u3002");if(o.palette!==void 0&&(!Array.isArray(o.palette)||!o.palette.length||o.palette.length>20||o.palette.some(e=>typeof e!="string"||!/^#[a-f\d]{6}$/i.test(e))))throw new Error("\u8C03\u8272\u677F\u9700\u8981 1 \u5230 20 \u4E2A\u516D\u4F4D\u5341\u516D\u8FDB\u5236\u989C\u8272\u3002");for(let[e,t,n]of[["fontSize",8,32],["lineWidth",0,12],["opacity",0,1]])if(o[e]!==void 0&&(!Number.isFinite(o[e])||o[e]<t||o[e]>n))throw new Error(e+" \u8D85\u51FA\u5141\u8BB8\u8303\u56F4\u3002");let s=0,i=(e,t=0)=>{if(++s>3e5||t>40)throw new Error("\u56FE\u8868\u6570\u636E\u8FC7\u5927\u6216\u5D4C\u5957\u8FC7\u6DF1\u3002");if(!(e===null||typeof e=="string"||typeof e=="boolean")&&!(typeof e=="number"&&Number.isFinite(e))){if(Array.isArray(e)){e.forEach(n=>i(n,t+1));return}if(e&&typeof e=="object"){for(let[n,f]of Object.entries(e)){if(["__proto__","constructor","prototype"].includes(n))throw new Error("\u6570\u636E\u542B\u6709\u4FDD\u7559\u5B57\u6BB5\u3002");i(f,t+1)}return}throw new Error("\u6570\u636E\u5FC5\u987B\u662F\u6709\u9650\u6570\u503C\u6216\u53EF\u5E8F\u5217\u5316\u7684 JSON\u3002")}};i(r.datasets);for(let[e,t]of Object.entries(r.datasets))if(!t||typeof t!="object")throw new Error(e+" \u5FC5\u987B\u662F\u6570\u636E\u6570\u7EC4\u6216\u5C42\u7EA7\u5BF9\u8C61\u3002");return r}export{y as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var N=new Set(["__proto__","prototype","constructor"]),y=500;function $(e){for(let n of["title","description"])if(e[n]!==void 0&&(typeof e[n]!="string"||e[n].length>1e4))throw new Error(`mindmap.${n} must be text.`);if(e.height!==void 0&&(!Number.isFinite(e.height)||e.height<240||e.height>1200))throw new Error("Mind map height must be between 240 and 1200.");if(!Array.isArray(e.nodes)||!e.nodes.length||e.nodes.length>y)throw new Error(`Mind map requires 1\u2013${y} nodes.`);if(e.layout!==void 0&&!["radial","tree"].includes(e.layout))throw new Error("Mind map layout must be radial or tree.");if(e.direction!==void 0&&!["right","left"].includes(e.direction))throw new Error("Mind map direction must be right or left.");let i=new Map;for(let n of e.nodes){if(!n||typeof n!="object"||Array.isArray(n)||typeof n.id!="string"||!n.id.trim()||n.id.length>200||N.has(n.id)||i.has(n.id))throw new Error("Mind map node IDs must be unique, non-reserved text.");if(typeof n.label!="string"||!n.label.trim()||n.label.length>200)throw new Error("Mind map node labels require 1\u2013200 characters.");if(n.parentId!==null&&(typeof n.parentId!="string"||!n.parentId))throw new Error("Mind map nodes require parentId (null for the root).");if(n.collapsed!==void 0&&typeof n.collapsed!="boolean")throw new Error("Mind map collapsed must be boolean.");i.set(n.id,n)}if(e.nodes.filter(n=>n.parentId===null).length!==1)throw new Error("Mind map requires exactly one root.");let s=new Set;for(let n of e.nodes){let o=new Set,t=n;for(;t&&!s.has(t.id);){if(o.has(t.id))throw new Error("Mind map cannot contain cycles.");if(o.add(t.id),t.parentId===null)break;if(t=i.get(t.parentId),!t)throw new Error("Mind map references a missing parent.")}for(let d of o)s.add(d)}return e}function v(e,i){return e.nodes.filter(s=>s.parentId===i)}function _(e,i,s,n="child",o=!1){let t=e.nodes.find(l=>l.id===i);if(!t)throw new Error("Selected mind map node is missing.");if(e.nodes.length>=y)throw new Error("\u601D\u7EF4\u5BFC\u56FE\u6700\u591A\u652F\u6301 500 \u4E2A\u8282\u70B9\u3002");let d=n==="sibling"&&t.parentId!==null?t.parentId:t.id,m={id:s,parentId:d,label:d===t.id?"\u5B50\u4E3B\u9898":"\u540C\u7EA7\u4E3B\u9898"},a=e.nodes.map(l=>l.id===d?{...l,collapsed:!1}:l),g=a.findIndex(l=>l.id===t.id);return a.splice(n==="sibling"?g+(o?0:1):a.length,0,m),$({...e,nodes:a})}function k(e,i){let s=e.nodes.find(t=>t.id===i);if(!s||s.parentId===null)return e;let n=new Set([i]),o=[i];for(let t=0;t<o.length;t++)for(let d of v(e,o[t]))n.add(d.id),o.push(d.id);return{...e,nodes:e.nodes.filter(t=>!n.has(t.id))}}function C(e,i){let s=e.nodes.find(t=>t.id===i),n=e.nodes.find(t=>t.id===s?.parentId);if(!n||n.parentId===null)return e;let o=e.nodes.filter(t=>t.id!==i);return o.splice(o.findIndex(t=>t.id===n.id)+1,0,{...s,parentId:n.parentId}),$({...e,nodes:o})}function D(e,i=new Set){let s=e.nodes.find(r=>r.parentId===null),n=new Map(e.nodes.map(r=>[r.id,v(e,r.id)])),o=new Map,t=r=>Math.max(46,22+Math.ceil([...r.label].reduce((c,h)=>c+(h.charCodeAt(0)>255?1:.55),0)/10)*20),d=r=>i.has(r.id)?[]:n.get(r.id),m=r=>{let c=d(r),h=Math.max(t(r),c.reduce((p,f)=>p+m(f),0)+Math.max(0,c.length-1)*18);return o.set(r.id,h),h};m(s);let a=e.layout==="tree",g=[[],[]],l=[0,0];d(s).forEach((r,c)=>{let h=a||l[0]<=l[1]?0:1;g[h].push({node:r,color:c%6}),l[h]+=o.get(r.id)+18});let M=Math.max(t(s),...l.map(r=>Math.max(0,r-18)))+64,w=[{...s,x:0,y:M/2-t(s)/2,width:184,height:t(s),side:0,axis:"horizontal",depth:0,color:-1}],b=(r,c,h,p,f)=>{w.push({...r,x:p*c*244,y:h+(o.get(r.id)-t(r))/2,width:184,height:t(r),side:p,axis:"horizontal",depth:c,color:f});let u=d(r),S=u.reduce((x,q)=>x+o.get(q.id),0)+Math.max(0,u.length-1)*18,E=h+(o.get(r.id)-S)/2;u.forEach(x=>{b(x,c+1,E,p,f),E+=o.get(x.id)+18})};g.forEach((r,c)=>{let h=(M-Math.max(0,l[c]-18))/2;r.forEach(({node:p,color:f})=>{let u=a?e.direction==="left"?-1:1:c===0?1:-1;b(p,1,h,u,f),h+=o.get(p.id)+18})});let I=Math.min(...w.map(r=>r.x)),A=Math.max(...w.map(r=>r.x+r.width))-I+64;return{nodes:w.map(r=>({...r,x:r.x-I+32})),width:A,height:M}}function z(e,i){let s=e.x+(i.side>0?e.width:0),n=i.x+(i.side>0?0:i.width),o=e.y+e.height/2,t=i.y+i.height/2,d=(s+n)/2;return`M ${s} ${o} C ${d} ${o}, ${d} ${t}, ${n} ${t}`}export{y as a,$ as b,v as c,_ as d,k as e,C as f,D as g,z as h};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var d=Object.create;var i=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty;var M=(e,n)=>()=>{try{return n||e((n={exports:{}}).exports,n),n.exports}catch(t){throw n=0,t}},A=(e,n)=>{for(var t in n)i(e,t,{get:n[t],enumerable:!0})},T=(e,n,t,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of L(n))!m.call(e,r)&&r!==t&&i(e,r,{get:()=>n[r],enumerable:!(o=p(n,r))||o.enumerable});return e};var S=(e,n,t)=>(t=e!=null?d(y(e)):{},T(n||!e||!e.__esModule?i(t,"default",{value:e,enumerable:!0}):t,e));function C(e,n){return{name:e,catalogs:n}}function h(e){let t=(typeof e=="string"?[e]:e??[]).find(o=>!!o&&o.trim()!=="");return t&&/^zh\b/i.test(t.trim())?"zh-CN":"en"}function l(){return typeof process<"u"&&process.env?process.env:{}}function x(){let e=l().SHOWAI_LANGUAGE;if(e)return[e];if(typeof navigator<"u"){if(navigator.languages?.length)return navigator.languages;if(navigator.language)return[navigator.language]}let n=l(),t=n.LC_ALL||n.LC_MESSAGES||n.LANG;return t&&t!=="C"&&t!=="POSIX"?[t.split(/[.@]/)[0].replace("_","-")]:[Intl.DateTimeFormat().resolvedOptions().locale]}function v(){if(typeof document>"u")return;let e=document.documentElement?.dataset.showaiLocale;return e==="zh-CN"||e==="en"?e:void 0}var u=h(x());var a=v()??u,c=new Set;function N(e,n=!1){if(typeof document<"u"&&(document.documentElement.lang=e,document.documentElement.dataset.showaiLocale=e),!(e===a&&!n)){a=e;for(let t of[...c])t()}}function R(){return a}function b(e,n){n&&(u=n),N(e)}function w(e){return c.add(e),()=>c.delete(e)}var g=new Map;function P(e,n,t=a){let o;if(typeof e=="string")o=e;else{let r=Number(n?.count??0),s=g.get(t);s||g.set(t,s=new Intl.PluralRules(t));let f=r===0&&e.zero!==void 0?"zero":s.select(r);o=e[f]??e.other}return n?o.replace(/\{(\w+)\}/g,(r,s)=>Object.prototype.hasOwnProperty.call(n,s)?String(n[s]):r):o}function z(e){return(n,t)=>{let r=e.catalogs[a][n]??e.catalogs["zh-CN"][n];return r===void 0?`${e.name}.${n}`:P(r,t)}}export{M as a,A as b,S as c,C as d,h as e,R as f,b as g,w as h,z as i};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as h}from"./chunk-WDYURK6F.js";import{a as y,c as $,hb as E,kb as K,ma as x,na as L}from"./chunk-Z2EQGXZF.js";import{c as f,i as S}from"./chunk-DUIGVKKG.js";var i=f($(),1);y(`.viewport-lock-button{position:absolute;top:8px;right:8px;z-index:30;display:grid;place-items:center;width:30px;height:30px;padding:0;border:1px solid var(--sb-line, var(--line, #e9ece5));border-radius:6px;background:var(--sb-surface, var(--paper, #fff));color:var(--sb-muted, var(--muted, #92968f));cursor:pointer}.viewport-lock-button[aria-pressed=false]{color:var(--accent, #120a8f)}.viewport-lock-button:hover{background:var(--sb-hover, var(--hover, #f0f2ed))}.viewport-lock-button:focus-visible{outline:2px solid var(--accent, #120a8f);outline-offset:2px}.viewport-lock-error{display:none;position:absolute;top:100%;right:0;width:220px;padding:8px;background:var(--paper, #fff);color:var(--text, #343a35);font-size:11px}.viewport-lock-button:hover .viewport-lock-error,.viewport-lock-button:focus-visible .viewport-lock-error{display:block}[data-viewport-locked=true]>.surface-scroll{touch-action:pan-y;overscroll-behavior:auto}.sf-block[data-viewport-locked=true] .react-flow__pane,.sf-block[data-viewport-locked=true] .react-flow__node{touch-action:pan-y;cursor:auto}.sb-header:has(~.viewport-lock-button){right:42px}.sb-header.has-caption:has(~.viewport-lock-button){right:auto;padding-right:42px}.sb-header.has-caption:has(~.viewport-lock-button)>.sb-actions{right:42px}.sb-g2-chart:has(>.viewport-lock-button)>.sb-g2-toolbar{padding-right:42px}@media print{.viewport-lock-button{display:none!important}}
|
|
2
|
+
`);var l=f(E(),1),M=S(h);function z(e,n){let r=e.closest("[data-block-id], [data-surface-id]");return`showai.viewport-lock.v1:${r?.getAttribute("data-block-id")||r?.getAttribute("data-surface-id")||location.pathname}:${n}`}function V(e){return localStorage.getItem(e)!=="unlocked"}function _(e,n){localStorage.setItem(e,n?"locked":"unlocked")}function O(e,n){let r=(0,i.useRef)(null),c=(0,i.useRef)(""),p=(0,i.useRef)(null),[s,d]=(0,i.useState)(!0),[D,g]=(0,i.useState)("");return(0,i.useLayoutEffect)(()=>{let o=r.current,T=[...(o.closest("[data-block-id], [data-surface-id]")||o.ownerDocument.body).querySelectorAll(`[data-viewport-lock-scope="${e}"]`)],w=`${e}:${T.indexOf(o)}`;c.current=n||z(o,w);let b=o.ownerDocument.getElementById("showai-component-data"),u=b?JSON.parse(b.textContent||"{}").channel:void 0;if(u&&window.parent!==window){p.current={channel:u,scope:w};let k=t=>{t.source!==parent||t.data?.channel!==u||t.data?.type!=="showai:viewport-lock-state"||t.data.scope!==w||(typeof t.data.locked=="boolean"&&d(t.data.locked),g(t.data.error||""))},m=t=>{if(o.dataset.viewportLocked==="true"){for(let a=t.target instanceof Element?t.target:null;a&&a!==o;a=a.parentElement){let Y=getComputedStyle(a);if(/auto|scroll/.test(Y.overflowY)&&(t.deltaY>0&&a.scrollTop+a.clientHeight<a.scrollHeight-1||t.deltaY<0&&a.scrollTop>0))return}t.preventDefault(),t.stopPropagation(),parent.postMessage({channel:u,type:"showai:reading-wheel",deltaX:t.deltaX,deltaY:t.deltaY,deltaMode:t.deltaMode,ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey},"*")}};return window.addEventListener("message",k),o.addEventListener("wheel",m,{capture:!0,passive:!1}),parent.postMessage({channel:u,type:"showai:viewport-lock-get",scope:w},"*"),()=>{window.removeEventListener("message",k),o.removeEventListener("wheel",m,!0)}}try{d(V(c.current))}catch(k){g(M("viewportLock.readFailed",{error:String(k)}))}},[e,n]),{ref:r,locked:s,toggle:()=>{let o=!s;if(p.current){parent.postMessage({...p.current,type:"showai:viewport-lock-set",locked:o},"*");return}try{_(c.current,o),g("")}catch(v){g(M("viewportLock.saveFailed",{error:String(v)}))}d(o)},error:D}}function X({locked:e,toggle:n,error:r="",label:c,unlockDescription:p}){let s=K(h),d=s(e?"viewportLock.unlock":"viewportLock.lock",{target:c});return(0,l.jsxs)("button",{type:"button",className:"viewport-lock-button","data-surface-ui":!0,"aria-label":d,"aria-pressed":e,title:r||(e?s("viewportLock.unlockTitle",{target:c,description:p??s("viewportLock.unlockDescription")}):s("viewportLock.lockTitle",{target:c})),onClick:n,children:[e?(0,l.jsx)(L,{size:16}):(0,l.jsx)(x,{size:16}),r&&(0,l.jsx)("span",{className:"viewport-lock-error",role:"alert",children:r})]})}export{z as a,V as b,_ as c,O as d,X as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s=e=>{throw new Error(e)},a=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function c(e,o){(typeof e!="string"||!e.trim())&&s(`${o} must be non-empty text.`)}function l(e,o){e!==void 0&&c(e,o)}function m(e,o){(typeof e!="number"||!Number.isFinite(e))&&s(`${o} must be a finite number.`)}function f(e,o,u,i=0){(!Array.isArray(e)||e.length<i||e.length>u)&&s(`${o} must be an array of ${i} to ${u} items.`);for(let t of e)a(t)||s(`${o} contains an invalid item.`);return e}function d(e,o){let u=new Set;for(let i of e)c(i.id,`${o}.id`),u.has(i.id)&&s(`${o} contains duplicate id ${i.id}.`),u.add(i.id);return u}function x(e,o){e!==void 0&&!/^#[0-9a-fA-F]{6}$/.test(e)&&s(`${o} must be a six-digit hex color.`)}function y(e,o){e!==void 0&&!/^https?:\/\//i.test(e)&&s(`${o} must be an http(s) URL.`)}var g=["yes","no","partial","neutral","na"],b=["done","failed","active","todo","paused"],h=["kept","discarded","failed","running","stopped"],$=[{id:"done",label:"\u8D70\u901A",tone:"done"},{id:"active",label:"\u8FDB\u884C\u4E2D",tone:"active"},{id:"failed",label:"\u6CA1\u8D70\u901A",tone:"failed"},{id:"todo",label:"\u5F85\u63A2\u7D22",tone:"todo"},{id:"paused",label:"\u6401\u7F6E",tone:"paused"}];function w(e){l(e.description,"description");let o=d(f(e.rows,"rows",60,1),"rows");for(let t of e.rows)c(t.label,"row.label"),l(t.hint,"row.hint"),l(t.group,"row.group");let u=d(f(e.columns,"columns",12,1),"columns");for(let t of e.columns)c(t.label,"column.label"),l(t.note,"column.note"),y(t.url,"column.url"),t.highlight!==void 0&&typeof t.highlight!="boolean"&&s("column.highlight must be true or false.");e.columns.filter(t=>t.highlight).length>1&&s("At most one column can be highlighted.");let i=new Set;for(let t of f(e.cells,"cells",720)){o.has(t.row)||s(`cell.row ${t.row} does not match a row id.`),u.has(t.column)||s(`cell.column ${t.column} does not match a column id.`);let n=`${t.row}\0${t.column}`;i.has(n)&&s(`Duplicate cell for row ${t.row} and column ${t.column}.`),i.add(n),g.includes(t.tone)||s(`cell.tone must be one of ${g.join(", ")}.`),l(t.text,"cell.text"),l(t.note,"cell.note")}if(e.legend!==void 0){a(e.legend)||s("legend must be an object.");for(let[t,n]of Object.entries(e.legend))g.includes(t)||s(`legend key ${t} is not a tone.`),c(n,`legend.${t}`)}}function A(e){l(e.root,"root"),l(e.description,"description");let o=e.statuses??$;if(e.statuses!==void 0){f(e.statuses,"statuses",8,1),d(e.statuses,"statuses");for(let t of e.statuses)c(t.label,"status.label"),b.includes(t.tone)||s(`status.tone must be one of ${b.join(", ")}.`),x(t.color,"status.color")}let u=new Set(o.map(t=>t.id));d(f(e.groups,"groups",16,1),"groups");let i=new Set;for(let t of e.groups){c(t.label,"group.label"),l(t.summary,"group.summary");for(let n of f(t.items,"group.items",30,1)){c(n.id,"item.id"),i.has(n.id)&&s(`items contain duplicate id ${n.id}.`),i.add(n.id),c(n.label,"item.label"),u.has(n.status)||s(`item.status ${n.status} is not a defined status.`);for(let r of["source","detail","result"])l(n[r],`item.${r}`);if(n.links!==void 0){(!Array.isArray(n.links)||n.links.length>20)&&s("item.links must be an array of at most 20 labels.");for(let r of n.links)c(r,"item.link")}}}}function S(e){l(e.subtitle,"subtitle"),e.updatedAt!==void 0&&Number.isNaN(Date.parse(e.updatedAt))&&s("updatedAt must be a date-time."),a(e.metric)||s("metric must be an object."),c(e.metric.label,"metric.label"),l(e.metric.unit,"metric.unit"),["higher","lower"].includes(e.metric.direction)||s("metric.direction must be higher or lower."),e.metric.baseline!==void 0&&m(e.metric.baseline,"metric.baseline");let o=e.groups??[];if(e.groups!==void 0){f(e.groups,"groups",6,1),d(e.groups,"groups");for(let t of e.groups)c(t.label,"group.label"),t.frontier!==void 0&&typeof t.frontier!="boolean"&&s("group.frontier must be true or false."),t.shape!==void 0&&!["dot","diamond"].includes(t.shape)&&s("group.shape must be dot or diamond.")}let u=new Set(o.map(t=>t.id)),i=f(e.runs??[],"runs",20);d(i,"runs"),d(f(e.experiments,"experiments",2e3,1),"experiments");for(let t of e.experiments)c(t.name,"experiment.name"),t.group!==void 0&&!u.has(t.group)&&s(`experiment.group ${t.group} is not a defined group.`),l(t.category,"experiment.category"),h.includes(t.status)||s(`experiment.status must be one of ${h.join(", ")}.`),Number.isNaN(Date.parse(t.start))&&s(`experiment ${t.id} needs a valid start date-time.`),t.minutes!==void 0&&m(t.minutes,"experiment.minutes"),t.resources!==void 0&&m(t.resources,"experiment.resources"),t.score!==null&&m(t.score,"experiment.score"),l(t.note,"experiment.note");for(let t of i){c(t.name,"run.name"),x(t.color,"run.color"),(!Array.isArray(t.steps)||t.steps.length>2e3)&&s("run.steps must be an array of at most 2000 numbers.");for(let n of t.steps)m(n,"run.step");a(t.series)||s("run.series must be an object.");for(let[n,r]of Object.entries(t.series)){(!Array.isArray(r)||r.length!==t.steps.length)&&s(`run ${t.id} series ${n} must match its steps.`);for(let p of r)m(p,`run.series.${n}`)}}for(let t of f(e.charts??[],"charts",4))c(t.key,"chart.key"),c(t.label,"chart.label"),l(t.unit,"chart.unit");e.resource!==void 0&&(a(e.resource)||s("resource must be an object."),c(e.resource.unit,"resource.unit"),e.resource.costPerHour!==void 0&&m(e.resource.costPerHour,"resource.costPerHour"),l(e.resource.currency,"resource.currency"),e.resource.budget!==void 0&&m(e.resource.budget,"resource.budget"))}function k(e,o){return a(o)||s("Component data must be an object."),l(o.title,"title"),e==="comparison-matrix"?w(o):e==="status-tree"?A(o):e==="experiment-tracker"?S(o):s(`Unknown analysis component ${e}.`),o}function T(e){return e.rows.filter(o=>{let u=e.columns.map(i=>{let t=e.cells.find(n=>n.row===o.id&&n.column===i.id);return t?`${t.tone}\0${t.text??""}`:"na"});return new Set(u).size>1}).map(o=>o.id)}function E(e){let o={};for(let u of e.groups)for(let i of u.items)o[i.status]=(o[i.status]??0)+1;return o}function j(e){let o=e.metric.direction==="higher",u=new Set((e.groups??[]).filter(r=>r.frontier!==!1).map(r=>r.id)),i=(e.groups??[]).length>0,t=e.experiments.filter(r=>r.score!==null&&r.status!=="failed"&&(!i||u.has(r.group))).sort((r,p)=>Date.parse(r.start)-Date.parse(p.start)),n=[];for(let r of t){let p=n[n.length-1];(!p||(o?r.score>p.score:r.score<p.score))&&n.push(r)}return n.map(r=>r.id)}export{$ as a,k as b,T as c,E as d,j as e};
|