ryugi-artifacts 1.31.3 → 1.31.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +1 -1
- package/dist/server.cjs +1 -1
- package/dist/viewer/{CloudLiveDocument-CAVtBsOK.js → CloudLiveDocument-DAfaRpMU.js} +1 -1
- package/dist/viewer/DocumentPage-B5t36jZf.js +1 -0
- package/dist/viewer/index.js +2 -2
- package/package.json +1 -1
- package/dist/viewer/DocumentPage-B29VmcZF.js +0 -1
package/dist/cli.cjs
CHANGED
package/dist/server.cjs
CHANGED
|
@@ -91649,7 +91649,7 @@ function openReady(payload) {
|
|
|
91649
91649
|
}
|
|
91650
91650
|
|
|
91651
91651
|
// package.json
|
|
91652
|
-
var version = "1.31.
|
|
91652
|
+
var version = "1.31.4";
|
|
91653
91653
|
|
|
91654
91654
|
// src/server/main.ts
|
|
91655
91655
|
async function main() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{n as t,t as n}from"./jsx-runtime-CldxteV5.js";import{a as r}from"./useSandboxFrame-DiOdLOg3.js";import{t as i}from"./index.js";import a from"./CloudDocument-DI8rTqBL.js";import{DocumentView as o,t as s}from"./DocumentPage-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{n as t,t as n}from"./jsx-runtime-CldxteV5.js";import{a as r}from"./useSandboxFrame-DiOdLOg3.js";import{t as i}from"./index.js";import a from"./CloudDocument-DI8rTqBL.js";import{DocumentView as o,t as s}from"./DocumentPage-B5t36jZf.js";var c=e(t(),1),l=`1.31.4`,u=e=>/^(\d+)\.(\d+)\./.exec(e??``)?.slice(1,3).join(`.`)??null;function d(e,t){let n=u(e);return n!==null&&n===u(t)}var f=(e,t)=>`电脑上的 ryugi 是 ${t??`未知版本`},网页是 ${e},版本对上之前只能评论`,p=n();function m({id:e,state:t,contentBase:n,liveContentBase:u,comments:m}){let{transport:h,presence:g}=s(e,u??n??``),_=g?.online??!1;r(e,{online:g?.online??null});let[v,y]=(0,c.useState)(!1);(0,c.useEffect)(()=>{_&&y(!0)},[_]);let b=t&&n?(0,p.jsx)(a,{id:e,state:t,contentBase:n,comments:m,offline:g!==null&&!_}):null;if(!h||!(v||_))return b??(0,p.jsx)(i,{children:g===null?`正在连接…`:`还没发布。电脑在线时,这里会实时显示。`});let x=_&&d(l,g?.version??null),S=_&&!x?f(l,g?.version??null):null;return(0,p.jsx)(o,{id:e,transport:h,live:_,cloud:{online:_,canEdit:x,reason:S},fallback:b})}export{m as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{n as t,t as n}from"./jsx-runtime-CldxteV5.js";import{S as r,_ as i,_i as a,a as o,b as s,f as c,ja as l,l as u,o as d,p as f,x as p,y as m}from"./useSandboxFrame-DiOdLOg3.js";import{$ as h,A as g,B as _,C as v,D as y,F as b,G as x,H as S,I as C,J as w,Jn as T,K as E,L as D,M as O,N as k,O as A,P as j,Q as ee,R as M,S as N,T as P,U as F,V as I,W as L,X as R,Y as z,Z as te,_ as ne,a as re,b as B,c as ie,d as ae,et as oe,h as se,i as V,j as ce,l as le,m as ue,n as de,nt as fe,o as pe,p as me,q as he,qn as H,r as ge,rt as U,s as _e,t as ve,tt as ye,u as be,v as xe,w as Se,x as Ce,y as we,z as Te}from"./DocumentLayout-CoaWyJ8o.js";import{a as Ee,c as De,d as Oe,f as ke,i as Ae,l as je,n as Me,o as Ne,r as Pe,s as Fe,u as Ie}from"./index.js";var Le={name:`message-square`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]};Le.node;var Re=a(Le),W=e(t(),1);function ze({streaming:e,pending:t,agentActiveAt:n,now:r}){if(e)return{kind:`editing`};if(t===0)return{kind:`idle`};if(n===void 0)return{kind:`working`,pending:t,idleMs:null};let i=Math.max(0,r-n);return i>3e5?{kind:`stale`,pending:t,idleMs:i}:{kind:`working`,pending:t,idleMs:i}}function Be(e){return e<6e4?`${Math.floor(e/1e3)} 秒`:e<36e5?`${Math.floor(e/6e4)} 分钟`:`${Math.floor(e/36e5)} 小时`}function Ve(e,t,n){switch(e.kind){case`editing`:return`${t} 正在编辑${n?` ${n}`:``}`;case`idle`:return null;case`working`:{let n=`${t} 还有 ${e.pending} 节待写`;return e.idleMs===null?n:`${n} · ${e.idleMs<1e4?`刚刚`:`${Be(e.idleMs)}前`}更新`}case`stale`:return`${t} ${Be(e.idleMs)}没有更新 · 还有 ${e.pending} 节待写`}}function He(e){let t=E(e);return t._headless=!0,[`registerDecoratorListener`,`registerRootListener`,`registerMutationListener`,`getRootElement`,`setRootElement`,`getElementByKey`,`focus`,`blur`].forEach(e=>{t[e]=()=>{(function(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)})(439,e)}}),t}var G=n();function Ue({text:e}){let t=(0,W.useRef)(null),n=(0,W.useRef)(null);return(0,W.useEffect)(()=>{let r=t.current;if(!r)return;let i=r.parentNode;if(!i)return;let a=n.current;return!a||a.parentNode!==i?(a=document.createComment(e),i.insertBefore(a,r),n.current=a):a.data!==e&&(a.data=e),()=>{n.current?.parentNode&&n.current.parentNode.removeChild(n.current),n.current=null}},[e]),(0,G.jsx)(`template`,{suppressHydrationWarning:!0,"data-rich-comment-anchor":``,ref:t})}var K=e=>`${fe[e]} ${U[e]}`,We={h1:K(`headingH1`),h2:K(`headingH2`),h3:K(`headingH3`),h4:K(`headingH4`),h5:K(`headingH5`),h6:K(`headingH6`)};function Ge(e){return e.toLowerCase().trim().replaceAll(/[^\s\w\u3000-\u9FFF\uAC00-\uD7AF\uFF00-\uFFEF-]/g,``).replaceAll(/[\s_]+/g,`-`).replaceAll(/^-+|-+$/g,``)}function Ke(e){return e.type===`comment`?``:e.text?e.text:e.children?e.children.map(Ke).join(``):``}var qe=/^["'«‘“‹「『"']/,Je=/["'»’”›」』"']$/;function Ye(e,t,n,r,i){switch(e.type){case`root`:return(0,G.jsx)(G.Fragment,{children:n});case`paragraph`:{let r=e.format?{textAlign:e.format}:void 0;return(0,G.jsx)(`p`,{className:K(`paragraph`),style:r,children:n??(0,G.jsx)(`br`,{})},t)}case`heading`:{let a=e.tag,o=Ge(i||Ke(e)),s=o;if(o){let e=r.get(o);e===void 0?r.set(o,1):(s=`${o}-${e}`,r.set(o,e+1))}return(0,G.jsxs)(a,{className:We[a],id:s||void 0,children:[s&&(0,G.jsx)(`a`,{className:K(`headingAnchor`),href:`#${s}`,tabIndex:0,children:(0,G.jsx)(T,{"aria-hidden":!0,size:14,strokeWidth:2})}),n]},t)}case`rich-quote`:case`quote`:{let r=(i||Ke(e)).trim(),a=qe.test(r),o=Je.test(r),s=e.attribution;return(0,G.jsxs)(`blockquote`,{className:K(`quote`),"data-no-close-quote":o?``:void 0,"data-no-open-quote":a?``:void 0,children:[n,s&&(0,G.jsxs)(`footer`,{className:K(`quoteAttribution`),children:[`— `,s]})]},t)}case`list`:{let r=e.listType===`number`?`ol`:`ul`,i=e.listType===`number`?K(`listOl`):e.listType===`check`?`${K(`checklist`)} ${K(`listUl`)}`:K(`listUl`);return(0,G.jsx)(r,{className:i,start:e.start===1?void 0:e.start,children:n},t)}case`listitem`:{let r=e.checked!==void 0,i=e.children?.some(e=>e.type===`list`),a=typeof e.value==`number`&&e.value>1?e.value:void 0,o;return o=i?K(`listNestedItem`):r?e.checked?`${K(`listItem`)} ${K(`listItemChecked`)}`:`${K(`listItem`)} ${K(`listItemUnchecked`)}`:K(`listItem`),(0,G.jsx)(`li`,{className:o,value:a,children:n},t)}case`link`:return(0,G.jsxs)(`a`,{className:K(`link`),href:e.url,rel:e.rel||`noopener`,target:e.target||`_blank`,children:[(0,G.jsx)(g,{href:e.url}),n]},t);case`autolink`:return(0,G.jsxs)(`a`,{className:K(`link`),href:e.url,rel:`noopener`,target:`_blank`,children:[(0,G.jsx)(g,{href:e.url}),n]},t);case`horizontalrule`:return(0,G.jsx)(`hr`,{className:K(`hr`)},t);case`table`:return(0,G.jsx)(`div`,{className:K(`tableScrollableWrapper`),children:(0,G.jsx)(`table`,{className:K(`table`),children:n})},t);case`tablerow`:return(0,G.jsx)(`tr`,{children:n},t);case`tablecell`:{let r=e.headerState?`th`:`td`,i=e.headerState?K(`tableCellHeader`):K(`tableCell`);return(0,G.jsx)(r,{className:i,colSpan:e.colSpan>1?e.colSpan:void 0,children:n},t)}case`details`:{let r=e.summary||``;return(0,G.jsxs)(`details`,{className:`${C.details} ${D.details}`,open:e.open||void 0,children:[(0,G.jsxs)(`summary`,{className:`${C.summary} ${D.summary}`,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`${C.chevron} ${D.chevron}`,children:(0,G.jsx)(`svg`,{fill:`none`,height:`20`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,viewBox:`0 0 20 20`,width:`20`,children:(0,G.jsx)(`path`,{d:`M8 6L12 10L8 14`})})}),(0,G.jsx)(`span`,{className:`${C.summaryText} ${D.summaryText}`,children:r})]}),(0,G.jsx)(`div`,{className:`${C.content} ${D.content}`,children:n})]},t)}case`spoiler`:return(0,G.jsx)(`span`,{className:K(`spoiler`),role:`button`,tabIndex:0,children:n},t);case`tag`:return(0,G.jsx)(`span`,{className:K(`tag`),style:{backgroundColor:S(e.text)},children:e.text},t);case`comment`:return(0,G.jsx)(Ue,{text:e.text??``},t);case`ruby`:return(0,W.createElement)(oe,{key:t,rendererKey:`Ruby`,defaultRenderer:A,props:{reading:e.reading??``,children:n}});case`code`:return(0,G.jsx)(`pre`,{className:`rich-code-block`,children:(0,G.jsx)(`code`,{children:n})},t);case`code-highlight`:return(0,G.jsx)(`span`,{children:e.text},t);case`linebreak`:return(0,G.jsx)(`br`,{},t);case`tab`:return(0,G.jsx)(`span`,{children:` `},t);default:return null}}var Xe=e=>`${fe[e]} ${U[e]}`,Ze=[[1,`textBold`],[2,`textItalic`],[4,`textStrikethrough`],[8,`textUnderline`],[16,`textCode`],[32,`textSubscript`],[64,`textSuperscript`],[128,`textHighlight`]];function Qe(e){let t={};for(let n of e.split(`;`)){let e=n.indexOf(`:`);if(e===-1)continue;let r=n.slice(0,e).trim(),i=n.slice(e+1).trim();if(!r||!i)continue;let a=r.replaceAll(/-([a-z])/g,(e,t)=>t.toUpperCase());t[a]=i}return t}function $e(e,t){let n=e.text,r=e.format||0;for(let[e,i]of Ze)r&e&&(n=(0,G.jsx)(`span`,{className:Xe(i),children:n},`${t}-${e}`));return e.style&&(n=(0,G.jsx)(`span`,{style:Qe(e.style),children:n},t)),n}function et(e){let t={},n=new Set,r={},i=1;function a(e){if(e.type===`footnote`&&e.identifier){let t=e.identifier;n.has(t)||(n.add(t),r[t]=i++)}if(e.type===`footnote-section`&&e.definitions&&Object.assign(t,e.definitions),e.children)for(let t of e.children)a(t);if(e.root&&a(e.root),e.content&&typeof e.content==`object`&&e.content.root&&a(e.content),e.cells&&Array.isArray(e.cells))for(let t of e.cells)t&&t.root&&a(t)}a(e);for(let e of n)e in t||(t[e]=``);return{definitions:t,displayNumberMap:r}}var tt=e=>`${fe.alert} ${U.alert} rich-alert-${e}`;function nt(e,t,n){switch(e.type){case`alert-quote`:return(0,W.createElement)(`div`,{key:t,className:tt(e.alertType)},n);case`banner`:return(0,W.createElement)(`div`,{key:t,className:`rich-banner rich-banner-${e.bannerType}`},n);case`grid-container`:return(0,W.createElement)(`div`,{key:t,className:`${M.container} ${Te.container}`},n);default:return(0,W.isValidElement)(n)?(0,W.cloneElement)(n,{key:t}):n}}function rt(e,t,n){return(0,W.isValidElement)(e)&&typeof e.type==`string`?(0,W.cloneElement)(e,{"data-block-id":t}):(0,G.jsx)(`div`,{className:`rich-block-anchor`,"data-block-id":t,children:e},`${n}-block-anchor`)}function it(e,t,n,r){return t?(r.blockAnchor??rt)(e,t,n):e}function at(e,t,n,r,i,a,o){let s=e.getKey?e.getKey():i,{builtinNodeOverrides:c}=o;if(typeof e.decorate==`function`){let r=null;try{r=e.decorate(t,n)}catch{}if(r!=null){let t=e.exportJSON?e.exportJSON():{},n=c?.[t.type];return it(n?n(t,s,[r],()=>nt(t,s,r)):nt(t,s,r),a,s,o)}}let l=e.exportJSON?e.exportJSON():{};if(l.type===`text`){let e=c?.text;return e?e(l,s,null,()=>$e(l,s)):$e(l,s)}let u=typeof e.getChildren==`function`?e.getChildren():[];Array.isArray(l.children)&&l.children.length===0&&u.length>0&&(l.children=u.map(e=>({type:typeof e.getType==`function`?e.getType():e.__type})));let d=null;u.length>0&&(d=u.map((e,i)=>at(e,t,n,r,`${s}-${i}`,void 0,o)));let f=e.getTextContent?e.getTextContent():void 0,p=c?.[l.type];return it(p?p(l,s,d,()=>Ye(l,s,d,r,f)):Ye(l,s,d,r,f),a,s,o)}function ot(e,t,n){let r=He({nodes:t,theme:I,editable:!1,onError:e=>{console.error(`[RichRenderer]`,e)}}),i={namespace:`ssr`,theme:I},a=O(e),o=r.parseEditorState(a);r.setEditorState(o);let s=et(a),c=a.root?.children,l=null;return o.read(()=>{let e=x(),t=new Map,a=e.getChildren().map((e,a)=>at(e,r,i,t,`ssr-${a}`,c?.[a]?.$?.blockId,n));l=(0,G.jsx)(G.Fragment,{children:a})}),{content:l,footnoteData:s,renderNestedContent:e=>{let r=He({nodes:t,theme:I,editable:!1,onError:e=>{console.error(`[RichRenderer:nested]`,e)}}),i={namespace:`ssr-nested`,theme:I},a=O(e),o=r.parseEditorState(a);r.setEditorState(o);let s=null,c=a.root?.children;return o.read(()=>{let e=x(),t=new Map,a=e.getChildren().map((e,a)=>at(e,r,i,t,`nested-${a}`,c?.[a]?.$?.blockId,n));s=(0,G.jsx)(G.Fragment,{children:a})}),s}}}function st({value:e,variant:t=`article`,theme:n=`light`,className:r,style:i,as:a=`div`,nested:o=!1,rendererConfig:s,extraNodes:c,builtinNodeOverrides:l,blockAnchor:u}){let d=ye(t),f=F(),{content:p,footnoteData:m,renderNestedContent:g}=(0,W.useMemo)(()=>ot(e,c?[...b,...c]:b,{blockAnchor:u,builtinNodeOverrides:l}),[u,l,c,e]),v=[`rich-content`,d,r].filter(Boolean).join(` `),y=typeof a==`string`?{suppressHydrationWarning:!0,className:v,"data-rich-nested":o?`true`:void 0,"data-theme":n}:{};return(0,G.jsx)(k,{className:d,theme:n,children:(0,G.jsx)(j,{colorScheme:n,children:(0,G.jsx)(h,{config:s,mode:`renderer`,variant:t,children:(0,G.jsx)(R,{definitions:m.definitions,displayNumberMap:m.displayNumberMap,children:(0,G.jsx)(_,{value:f??g,children:(0,G.jsx)(a,{...y,style:i,children:p})})})})})})}var ct=[v];async function lt(e){await new Promise(e=>setTimeout(e,0));let t=[...e.getAllChanges().values()].flat().sort((e,t)=>e.lamport-t.lamport||e.peer.localeCompare(t.peer)||e.counter-t.counter),n=e.shallowSinceFrontiers(),r=e.frontiersToVV(n),i=[],a=[];try{for(let n of t){r.setLast({peer:n.peer,counter:n.counter+n.length-1});let t={id:`${n.counter}@${n.peer}`,change:n,frontiers:e.vvToFrontiers(r)};i.push(t);let o=n.message===`human`?`human`:n.message?.startsWith(`agent:`)?`agent`:n.message?.startsWith(`session `)?`session`:`unknown`,s=a.at(-1),c=s?.entries.at(-1)?.change;s&&c&&o!==`unknown`&&s.source===o&&c.peer===n.peer&&c.timestamp>0&&n.timestamp>=c.timestamp&&n.timestamp-c.timestamp<=60?(s.entries.push(t),s.id=t.id):a.push({id:t.id,source:o,entries:[t]}),i.length%200==0&&await new Promise(e=>setTimeout(e,0))}}finally{r.free()}return{entries:i,groups:a.reverse(),shallow:n.length>0}}function ut(e,t,n){let r=e.fork(),i;try{if(r.checkout(t),r.getTree(`lexical`).roots().length!==1)throw Error(`此版本的文档内容不可用`);let e=E({nodes:n,editable:!1,onError:e=>{throw e}});return i=ne(e,r),e.getEditorState().toJSON()}finally{i?.dispose(),r.free()}}var dt=5e4,ft=`background-color: color-mix(in srgb, var(--rc-alert-caution) 22%, transparent); text-decoration: line-through;`,pt=`background-color: color-mix(in srgb, var(--rc-alert-tip) 22%, transparent);`;function q(e){let t=e;return t.type===`heading`?`heading:${t.tag}`:t.type===`list`?`list:${t.listType}`:t.type||`unknown`}function mt(e,t){return JSON.stringify(e)===JSON.stringify(t)}function J(e){let t=e;return t.type===`text`&&typeof t.text==`string`}function Y(e){let t=e;return Array.isArray(t.children)?t.children:null}function ht(e,t){let n=typeof e==`string`?e.trim():``;return n?`${n}${n.endsWith(`;`)?``:`;`} ${t}`:t}function X(e,t,n){let{style:r}=e;return n===`delete`?r=ht(r,ft):n===`insert`&&(r=ht(r,pt)),{...e,text:t,style:r}}function Z(e,t){return{...e,children:t}}function Q(e,t){if(J(e))return X(e,e.text,t);let n=Y(e);return n?Z(e,n.map(e=>Q(e,t))):e}function gt(e){return Array.from(e).reverse().join(``)}function _t(e){let t=[];for(let n of e){if(!n.text)continue;let e=t.at(-1);e&&e.kind===n.kind?e.text+=n.text:t.push({...n})}return t}function vt(e,t){let n=e.length,r=t.length;if(n===0&&r===0)return[];if(n===0)return[{kind:`insert`,text:t.join(``)}];if(r===0)return[{kind:`delete`,text:e.join(``)}];if(n*r>dt)return[{kind:`delete`,text:e.join(``)},{kind:`insert`,text:t.join(``)}];let i=Array.from({length:n+1},()=>Array.from({length:r+1}).fill(0));for(let a=1;a<=n;a++)for(let n=1;n<=r;n++)e[a-1]===t[n-1]?i[a][n]=i[a-1][n-1]+1:i[a][n]=Math.max(i[a-1][n],i[a][n-1]);let a=[],o=n,s=r;for(;o>0&&s>0;)if(e[o-1]===t[s-1]){let t=a.at(-1);t&&t.kind===`equal`?t.text+=e[o-1]:a.push({kind:`equal`,text:e[o-1]}),o--,s--}else if(i[o-1][s]>=i[o][s-1]){let t=a.at(-1);t&&t.kind===`delete`?t.text+=e[o-1]:a.push({kind:`delete`,text:e[o-1]}),o--}else{let e=a.at(-1);e&&e.kind===`insert`?e.text+=t[s-1]:a.push({kind:`insert`,text:t[s-1]}),s--}for(;o>0;){let t=a.at(-1);t&&t.kind===`delete`?t.text+=e[o-1]:a.push({kind:`delete`,text:e[o-1]}),o--}for(;s>0;){let e=a.at(-1);e&&e.kind===`insert`?e.text+=t[s-1]:a.push({kind:`insert`,text:t[s-1]}),s--}return _t(a.reverse().map(e=>({kind:e.kind,text:gt(e.text)})))}function yt(e,t){let n=Array.from(e),r=Array.from(t),i=0;for(;i<n.length&&i<r.length&&n[i]===r[i];)i++;let a=n.length-1,o=r.length-1;for(;a>=i&&o>=i&&n[a]===r[o];)a--,o--;let s=[];return i>0&&s.push({kind:`equal`,text:n.slice(0,i).join(``)}),s.push(...vt(n.slice(i,a+1),r.slice(i,o+1))),a<n.length-1&&s.push({kind:`equal`,text:n.slice(a+1).join(``)}),_t(s)}function bt(e,t){let n=yt(e.text,t.text),r=[],i=[],a=!1;for(let o of n)o.text&&(o.kind===`equal`?(r.push(X(e,o.text)),i.push(X(t,o.text))):(a=!0,o.kind===`delete`?r.push(X(e,o.text,`delete`)):i.push(X(t,o.text,`insert`))));return{oldNodes:r.length>0?r:[e],newNodes:i.length>0?i:[t],changed:a}}function xt(e,t){let n=e.length,r=t.length,i=Array.from({length:n+1},()=>Array.from({length:r+1}).fill(0));for(let a=1;a<=n;a++)for(let n=1;n<=r;n++){let r=Math.max(i[a-1][n],i[a][n-1]);if(q(e[a-1])===q(t[n-1])){let o=mt(e[a-1],t[n-1])?2:1;i[a][n]=Math.max(r,i[a-1][n-1]+o)}else i[a][n]=r}let a=[],o=n,s=r;for(;o>0&&s>0;){if(q(e[o-1])===q(t[s-1])){let n=mt(e[o-1],t[s-1]),r=n?2:1;if(i[o][s]===i[o-1][s-1]+r){a.push(n?{kind:`equal`,node:e[o-1]}:{kind:`modify`,oldNode:e[o-1],newNode:t[s-1]}),o--,s--;continue}}i[o-1][s]>=i[o][s-1]?(a.push({kind:`delete`,node:e[o-1]}),o--):(a.push({kind:`insert`,node:t[s-1]}),s--)}for(;o>0;)a.push({kind:`delete`,node:e[--o]});for(;s>0;)a.push({kind:`insert`,node:t[--s]});return a.reverse(),a}function St(e,t){let n=xt(e,t),r=[],i=[],a=!1;for(let e of n)switch(e.kind){case`equal`:r.push(e.node),i.push(e.node);break;case`delete`:a=!0,r.push(Q(e.node,`delete`));break;case`insert`:a=!0,i.push(Q(e.node,`insert`));break;case`modify`:{if(a=!0,J(e.oldNode)&&J(e.newNode)){let t=bt(e.oldNode,e.newNode);r.push(...t.oldNodes),i.push(...t.newNodes);break}let t=Ct(e.oldNode,e.newNode);t?(r.push(t.oldNode),i.push(t.newNode)):(r.push(Q(e.oldNode,`delete`)),i.push(Q(e.newNode,`insert`)));break}}return{oldChildren:r,newChildren:i,changed:a}}function Ct(e,t){if(q(e)!==q(t))return null;if(mt(e,t))return{oldNode:e,newNode:t,changed:!1};let n=Y(e),r=Y(t);if(!n||!r)return null;let i=St(n,r);return i.changed?{oldNode:Z(e,i.oldChildren),newNode:Z(t,i.newChildren),changed:!0}:{oldNode:e,newNode:t,changed:!1}}function wt(e,t){let n=Ct(e,t);return n?{oldNode:n.oldNode,newNode:n.newNode}:{oldNode:Q(e,`delete`),newNode:Q(t,`insert`)}}function Tt(e,t){let n=yt(e.text,t.text),r=[];for(let i of n)i.text&&(i.kind===`equal`?r.push(X(t,i.text)):i.kind===`delete`?r.push(X(e,i.text,`delete`)):r.push(X(t,i.text,`insert`)));return r}function Et(e,t){let n=xt(e,t),r=[];for(let e of n)switch(e.kind){case`equal`:r.push(e.node);break;case`delete`:r.push(Q(e.node,`delete`));break;case`insert`:r.push(Q(e.node,`insert`));break;case`modify`:{if(J(e.oldNode)&&J(e.newNode)){r.push(...Tt(e.oldNode,e.newNode));break}let t=Y(e.oldNode),n=Y(e.newNode);t&&n?r.push(Z(e.newNode,Et(t,n))):(r.push(Q(e.oldNode,`delete`)),r.push(Q(e.newNode,`insert`)));break}}return r}function Dt(e,t){if(q(e)!==q(t))return Q(t,`insert`);if(mt(e,t))return t;let n=Y(e),r=Y(t);return!n||!r?Q(t,`insert`):Z(t,Et(n,r))}function Ot(e,t){let n=xt(e.root.children,t.root.children),r=[];for(let e of n)switch(e.kind){case`equal`:{let t=r.at(-1);t&&t.type===`equal`?t.nodes.push(e.node):r.push({type:`equal`,nodes:[e.node]});break}case`modify`:{let t=wt(e.oldNode,e.newNode);r.push({type:`delete`,nodes:[t.oldNode]},{type:`insert`,nodes:[t.newNode]})}break;case`delete`:r.push({type:`delete`,nodes:[Q(e.node,`delete`)]});break;case`insert`:r.push({type:`insert`,nodes:[Q(e.node,`insert`)]})}return r}function kt(e){let t={...e};if(t.$){let{blockId:e,...n}=t.$;Object.keys(n).length?t.$=n:delete t.$}return t.children&&=t.children.map(kt),t}function At(e,t){let{children:n,text:r,...i}=e,{children:a,text:o,...s}=t;return JSON.stringify(i)!==JSON.stringify(s)||!!(n&&a&&Pt(n,a).some(e=>e.kind===`modify`&&At(e.old[0],e.current[0])))}function jt(e){let t=e;return t.type===`dynamic`||t.type===`pending`?{type:`paragraph`,version:1,direction:null,format:``,indent:0,children:[{type:`text`,version:1,text:t.type===`dynamic`?`动态内容(历史中不运行)\n${t.url}\n高度:${t.initialHeight??320}px\n${JSON.stringify(t.props??{})}`:`待完成:${t.intent??``}`,format:0,detail:0,mode:`normal`,style:``}]}:t.children?{...t,children:t.children.map(jt)}:t}function Mt(e){return Nt(e.map(jt))}function Nt(e){return{root:{type:`root`,version:1,direction:null,format:``,indent:0,children:e}}}function Pt(e,t){let n=Ot(Nt(e),Nt(t)),r=[],i=0,a=0;for(let o=0;o<n.length;o++){let s=n[o];if(s.type===`equal`){r.push({kind:`equal`,old:e.slice(i,i+s.nodes.length),current:t.slice(a,a+s.nodes.length)}),i+=s.nodes.length,a+=s.nodes.length;continue}let c=0,l=0;for(;o<n.length&&n[o].type!==`equal`;){let e=n[o++];e.type===`delete`?c+=e.nodes.length:l+=e.nodes.length}o--;for(let n=0;n<Math.max(c,l);n++){let o=n<c?[e[i+n]]:[],s=n<l?[t[a+n]]:[];r.push({kind:o.length&&s.length?`modify`:o.length?`delete`:`insert`,old:o,current:s})}i+=c,a+=l}return r}function Ft(e,t){return Pt(e.root.children.map(kt),t.root.children.map(kt)).map(e=>{if(e.kind===`modify`){let t=e.old[0],n=e.current[0];return t.type===n.type&&!At(t,n)?{kind:`modify`,value:Mt([Dt(t,n)])}:{kind:`modify`,before:Mt(e.old),value:Mt(e.current)}}let t=e.kind===`delete`?e.old:e.current;return{kind:e.kind,value:Mt(e.kind===`equal`?t:t.map(t=>Q(t,e.kind)))}})}var It=[Se,y,...ct],Lt={[w]:N,[z]:Ce,[te]:B,[ee]:ue},Rt={human:`浏览器编辑`,agent:`Agent 编辑`,session:`会话开始`,unknown:`未标记编辑`},zt=e=>JSON.stringify(e.frontiers()),Bt=e=>{let t=new Date(e*1e3);return e>0&&Number.isFinite(t.getTime())?t.toLocaleString(void 0,{month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1}):`时间未记录`};function Vt({doc:e,nodes:t,streaming:n,theme:r,title:i,onClose:a}){let[o,s]=(0,W.useState)(null),[c,l]=(0,W.useState)(null),u=(0,W.useRef)(null),d=(0,W.useRef)(null),p=(0,W.useRef)(0),[m,h]=(0,W.useState)(!0),[g,_]=(0,W.useState)(null),[v,y]=(0,W.useState)(!1),[b,x]=(0,W.useState)([]),[S,C]=(0,W.useState)(!1),[w,T]=(0,W.useState)(0),[E,D]=(0,W.useState)(50),[O,k]=(0,W.useState)(()=>new Set),[A,j]=(0,W.useState)(!1),ee=(0,W.useRef)(null),M=f(`(max-width: 1100px)`),N=(0,W.useRef)(null);(0,W.useEffect)(()=>{if(!A||!M)return;let e=document.activeElement,t=ee.current,n=()=>[...t?.querySelectorAll(`button:not(:disabled), a[href], input:not(:disabled), [tabindex="0"]`)??[]];n()[0]?.focus();let r=e=>{if(e.key!==`Tab`)return;let t=n();e.shiftKey&&document.activeElement===t[0]?(e.preventDefault(),t.at(-1)?.focus()):!e.shiftKey&&document.activeElement===t.at(-1)&&(e.preventDefault(),t[0]?.focus())};return t?.addEventListener(`keydown`,r),()=>{t?.removeEventListener(`keydown`,r),e?.focus()}},[A,M]);let P=(0,W.useCallback)(async()=>{let n=++p.current;h(!0),_(null);let r=e.fork();try{let i=await lt(r),a=ut(r,r.frontiers(),t);if(p.current!==n){r.free();return}let o=d.current;d.current=r;let c=u.current??i.groups[1]?.entries.at(-1)??i.entries[0]??null;u.current=c,l(c);let f=zt(r);s({doc:r,history:i,value:a,key:f}),y(zt(e)!==f),o?.free()}catch(e){r.free(),p.current===n&&_(e.message)}finally{p.current===n&&h(!1)}},[e,t]);(0,W.useEffect)(()=>{!n&&!d.current&&P()},[P,n]),(0,W.useEffect)(()=>()=>{p.current++,d.current?.free(),d.current=null},[e]),(0,W.useEffect)(()=>e.subscribe(()=>y(d.current!==null&&zt(e)!==zt(d.current))),[e]),(0,W.useEffect)(()=>{let e=e=>{e.key===`Escape`&&(A?j(!1):a())};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a,A]),(0,W.useEffect)(()=>{if(!o||!c)return;let e=!1;h(!0);let n=setTimeout(()=>{try{let n=Ft(ut(o.doc,c.frontiers,t),o.value);e||(x(n),T(0),_(null))}catch(t){e||_(t.message)}finally{e||h(!1)}},0);return()=>{e=!0,clearTimeout(n)}},[o,c,t]);let F=e=>{u.current=e,l(e),j(!1)},I=b.filter(e=>e.kind!==`equal`).length,L=e=>{let t=Math.max(0,Math.min(I-1,w+e));T(t),N.current?.querySelectorAll(`[data-history-change]`)[t]?.scrollIntoView?.({block:`center`,behavior:`instant`})},R=o?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{className:`history-help`,children:`选择时间点,与固定的最新版本比较`}),o.history.groups.slice(0,E).map(e=>{let t=e.entries.at(-1),n=c&&e.entries.some(({change:e})=>e.peer===c.change.peer&&e.counter<=c.change.counter&&e.counter+e.length>=c.change.counter+c.change.length);return(0,G.jsxs)(`section`,{className:`history-revision ${n?`active`:``}`,children:[(0,G.jsxs)(`button`,{type:`button`,className:`history-select`,"aria-current":n?`true`:void 0,onClick:()=>F(t),children:[(0,G.jsx)(`strong`,{children:Bt(t.change.timestamp)}),n?(0,G.jsx)(`span`,{className:`history-tag`,children:`对比起点`}):null,(0,G.jsx)(`span`,{children:Rt[e.source]}),(0,G.jsxs)(`small`,{children:[e.entries.length,` 次提交`]})]}),(0,G.jsxs)(`button`,{type:`button`,className:`history-expand`,"aria-expanded":O.has(e.id),onClick:()=>k(t=>{let n=new Set(t);return n.has(e.id)?n.delete(e.id):n.add(e.id),n}),children:[O.has(e.id)?`⌄ 收起`:`› 展开`,`原始提交`]}),O.has(e.id)?(0,G.jsx)(`div`,{className:`history-raw`,children:[...e.entries].reverse().map(e=>(0,G.jsxs)(`button`,{type:`button`,title:e.change.message,onClick:()=>F(e),children:[(0,G.jsx)(`span`,{children:Bt(e.change.timestamp)}),(0,G.jsx)(`code`,{children:e.change.message||`未标记编辑`})]},e.id))}):null]},e.id)}),E<o.history.groups.length?(0,G.jsx)(`button`,{type:`button`,className:`history-more`,onClick:()=>D(e=>e+50),children:`加载更早记录`}):(0,G.jsxs)(`p`,{className:`history-end`,children:[o.history.shallow?`更早历史未保留`:`已到最早记录`,(0,G.jsx)(`br`,{}),o.history.groups.length,` 段编辑 · `,o.history.entries.length,` 次提交`]}),(0,G.jsx)(`p`,{className:`history-help`,children:`时间来自编辑设备,顺序按因果关系排列。`})]}):(0,G.jsx)(`p`,{role:`status`,className:`history-help`,children:n?`等待本轮编辑完成…`:`正在加载历史…`}),z=e=>(0,G.jsx)(st,{value:e,variant:`article`,theme:r,extraNodes:It,rendererConfig:Lt});return(0,G.jsxs)(`main`,{className:`document-history`,children:[(0,G.jsxs)(`section`,{className:`history-work`,children:[(0,G.jsxs)(`header`,{className:`history-toolbar`,children:[(0,G.jsxs)(`div`,{className:`history-toolbar-row`,children:[(0,G.jsx)(`strong`,{children:`历史对比`}),(0,G.jsx)(`span`,{className:`history-tag`,children:`只读`}),(0,G.jsx)(`button`,{type:`button`,className:`history-exit`,onClick:a,children:`退出对比 ↗`})]}),(0,G.jsxs)(`div`,{className:`history-basis`,children:[c?Bt(c.change.timestamp):`选择时间点`,` `,(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`───>`}),` 最新版本 `,o?Bt(o.history.entries.at(-1)?.change.timestamp??0):``]}),(0,G.jsxs)(`div`,{className:`history-toolbar-row`,children:[(0,G.jsx)(`span`,{className:`history-delete-label`,children:`− 旧内容`}),(0,G.jsx)(`span`,{className:`history-insert-label`,children:`+ 新内容`}),(0,G.jsx)(`button`,{type:`button`,className:`history-filter`,"aria-pressed":S,onClick:()=>C(e=>!e),children:`仅看变更`}),(0,G.jsxs)(`span`,{role:`status`,"aria-live":`polite`,children:[I?w+1:0,` / `,I,` 处`]}),(0,G.jsx)(`button`,{type:`button`,"aria-label":`上一处变更`,disabled:w===0||m,onClick:()=>L(-1),children:`↑`}),(0,G.jsx)(`button`,{type:`button`,"aria-label":`下一处变更`,disabled:w>=I-1||m,onClick:()=>L(1),children:`↓`})]}),M?(0,G.jsx)(`button`,{type:`button`,className:`history-more`,onClick:()=>j(!0),children:`选择历史版本`}):null]}),v?(0,G.jsxs)(`div`,{className:`history-update`,role:`status`,children:[n?`等待本轮编辑完成…`:`最新文档有新内容`,(0,G.jsx)(`button`,{type:`button`,disabled:n||m,onClick:()=>void P(),children:`更新对比 →`})]}):null,g?(0,G.jsxs)(`div`,{role:`alert`,className:`history-message`,children:[`无法读取历史:`,g,(0,G.jsx)(`button`,{type:`button`,disabled:n,onClick:()=>void P(),children:`重试`})]}):m||n&&!o?(0,G.jsx)(`div`,{role:`status`,className:`history-message`,children:n?`等待本轮编辑完成…`:`正在计算差异…`}):(0,G.jsxs)(`div`,{ref:N,"aria-label":`差异正文`,className:`history-content`,children:[o?.value.root.children.some(e=>e.type===`heading`&&e.tag===`h1`)?null:(0,G.jsx)(`h1`,{children:i}),I?null:(0,G.jsx)(`p`,{className:`history-message`,children:`与当前对比版本没有差异。选择更早的时间点查看修改。`}),b.map((e,t)=>(0,G.jsxs)(`section`,{hidden:S&&e.kind===`equal`,"data-history-change":e.kind===`equal`?void 0:``,className:`history-hunk history-${e.kind}`,children:[e.kind===`equal`?null:(0,G.jsx)(`div`,{className:`history-hunk-label`,children:e.kind===`insert`?`+ 新增内容`:e.kind===`delete`?`− 删除内容`:`修改内容`}),e.before?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`history-before`,children:[(0,G.jsx)(`div`,{className:`history-hunk-label`,children:`− 旧内容`}),z(e.before)]}),(0,G.jsxs)(`div`,{className:`history-after`,children:[(0,G.jsx)(`div`,{className:`history-hunk-label`,children:`+ 新内容`}),z(e.value)]})]}):z(e.value)]},t)),(0,G.jsx)(`p`,{className:`history-end`,children:`已到本次对比末尾。媒体资源未做历史归档,同一地址的文件可能已更新。`})]})]}),M?null:(0,G.jsxs)(`aside`,{className:`history-sidebar`,"aria-label":`历史时间线`,children:[(0,G.jsx)(`h2`,{children:`历史记录`}),R]}),M&&A?(0,G.jsx)(`div`,{ref:ee,className:`history-sheet`,role:`dialog`,"aria-modal":`true`,"aria-label":`选择历史版本`,children:(0,G.jsx)(Fe,{snaps:[0,.85],snap:.85,onSnap:e=>{e===0&&j(!1)},onScrim:()=>j(!1),header:(0,G.jsxs)(`div`,{className:`history-sheet-head`,children:[(0,G.jsx)(`strong`,{children:`历史记录`}),(0,G.jsx)(`button`,{type:`button`,onClick:()=>j(!1),children:`关闭`})]}),children:R})}):null]})}function Ht({left:e,top:t,quote:n,initial:r,restored:a,leaving:o,onChange:s,onSubmit:c,onCancel:l,ref:u}){return(0,G.jsx)(`div`,{ref:u,...{0:{className:`x10l6tqk x1u8a7rm xj6ak53 xowlrko xllfotl xatqbsq x1u6ievf`},1:{className:`x10l6tqk x1u8a7rm xj6ak53 x1u6ievf xxp0q0x x12l1aco xn0cd8s x47corl`}}[!!o|0],style:{left:e,top:t},children:(0,G.jsxs)(de,{active:!0,children:[(0,G.jsxs)(`div`,{className:`x78zum5 x1pha0wt x167g77z xz9dl7a x1hr3lfm xqfszdh x1j6dyjg`,children:[(0,G.jsxs)(`span`,{className:`x98rzlu xeuugli xb3r6kr xuxw1ft xlyipyv xddlp02`,children:[`“`,n,`”`]}),a?(0,G.jsx)(`span`,{className:`x2lah0s x7zghnd`,children:`已恢复上次的草稿`}):null]}),(0,G.jsx)(i,{autoFocus:!0,initial:r,placeholder:`写下你的问题或意见…`,onChange:s,onSubmit:c,onCancel:l})]})})}function Ut({left:e,top:t,onComment:n,onCopy:r,ref:i}){return(0,G.jsxs)(`div`,{ref:i,className:`x10l6tqk x1u8a7rm x78zum5 x6s0dn4 x195vfkc xc9qbxq x9f619 x9ms5i6 xmkeg23 x1y0btm7 xgcsv5v x1q4ynmn x12ilycc x1d5q07e xi1bcxy x773k2o xa3vuyk`,style:{left:e,top:t},onMouseDown:e=>e.preventDefault(),children:[n?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`button`,{type:`button`,onClick:n,className:`x78zum5 x6s0dn4 x17d4w8g x1fgtraw xt970qd x1awh872 xc342km xu4hgxq xjbqb8w xj0l527 x2230gt xo2rkog xqfszdh xfifm61 xk50ysn x1ypdohk x1de99jn xaatb59 x1y3gkto x1uczgqu x1fkwv27`,children:[(0,G.jsx)(Re,{size:14,className:`x2lah0s x17nrqe2`}),`评论`]}),(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`x2lah0s x1i1rx1s xlup9mm xj3msbq xcn5yip`})]}):null,(0,G.jsx)(`button`,{type:`button`,onClick:r,className:`x78zum5 x6s0dn4 x17d4w8g x1fgtraw xt970qd x1awh872 xc342km xu4hgxq xjbqb8w xj0l527 x2230gt xqfszdh xfifm61 xk50ysn x1ypdohk x1de99jn xaatb59 x1y3gkto x1uczgqu x1fkwv27 x1bo0w0s`,children:`复制`})]})}var Wt=(e,t)=>`${e}\n${t}`;function Gt(){let e=new Map;return{save(t,n){n.trim()?e.set(t,n):e.delete(t)},take(t){return e.get(t)??``}}}function Kt(e){let t=(0,W.useMemo)(Gt,[]),[n,r]=(0,W.useState)(null),[i,a]=(0,W.useState)(!1),o=(0,W.useRef)(``),s=(0,W.useRef)(0),c=(0,W.useRef)(null),l=(0,W.useRef)(null);re(i?null:n?.target.range??null);let u=(0,W.useCallback)(n=>{window.clearTimeout(s.current);let i=t.take(Wt(n.blockId,n.quote));o.current=i,a(!1),r({target:n,initial:i}),window.getSelection()?.removeAllRanges(),e()},[t,e]),d=(0,W.useCallback)(e=>{n&&(t.save(Wt(n.target.blockId,n.target.quote),e?o.current:``),a(!0),s.current=window.setTimeout(()=>{r(null),a(!1)},120))},[n,t]);return(0,W.useEffect)(()=>{if(!n||i)return;let e=e=>{let t=e.target;c.current?.contains(t)||l.current?.contains(t)||d(!0)};return document.addEventListener(`pointerdown`,e,!0),()=>document.removeEventListener(`pointerdown`,e,!0)},[n,i,d]),(0,W.useEffect)(()=>()=>window.clearTimeout(s.current),[]),{draft:n,leaving:i,restored:!!n?.initial,open:u,close:d,onText:e=>{o.current=e},panelRef:c,toolbarRef:l}}function qt(e){return{left:e.offsetLeft,right:Math.min(e.offsetLeft+e.offsetWidth,window.innerWidth-16)}}function Jt({editor:e,threads:t,actions:n,agent:r,canComment:i,selection:a,clearSelection:o,onCreate:s,onMain:c,children:l}){let u=Kt(o),{draft:d}=u;return(0,G.jsx)(ve,{editor:e,threads:t,actions:n,agent:r,onMain:c,overlay:e=>(0,G.jsxs)(G.Fragment,{children:[a&&!d?(0,G.jsx)(Ut,{ref:u.toolbarRef,...le(a,qt(e),128,36,8),onComment:i?()=>u.open(a):void 0,onCopy:()=>{navigator.clipboard?.writeText(a.quote),window.getSelection()?.removeAllRanges(),o()}}):null,d?(0,G.jsx)(Ht,{ref:u.panelRef,...ie(d.target,qt(e),340,8),quote:d.target.quote,initial:d.initial,restored:u.restored,leaving:u.leaving,onChange:u.onText,onSubmit:e=>s(d.target,e).then(e=>(e&&u.close(!1),e)),onCancel:()=>u.close(!0)},`${d.target.blockId}:${d.target.quote}`):null]}),children:l})}function Yt({id:e,title:t,activity:n,agentSection:r,offline:i,openComments:a,cloud:s,compact:c=!1,onDone:l,agent:u=`Agent`,history:d}){let f=Ve(n,u,r);return o(e,s?{...t?{title:t}:{},online:s.online,comments:a,activity:f,activityTone:n.kind===`stale`?`warning`:n.kind===`working`?`quiet`:`live`,retrying:i,reason:s.reason,history:d?.available,historyOpen:d?.open}:null)&&!c?null:(0,G.jsxs)(`header`,{...{0:{className:`x7wzq59 x13vifvy x1n327nk xdd8jsf x78zum5 x6s0dn4 x1v2ro7d x4l9tsp x1rozbrz xqfszdh`},1:{className:`x7wzq59 x13vifvy x1n327nk xdd8jsf x78zum5 x6s0dn4 x1rozbrz xqfszdh x1hr3lfm x883omv`}}[!!c|0],children:[c?null:(0,G.jsxs)(`span`,{className:`xddlp02 xfifm61 xuxw1ft`,children:[`document / `,(0,G.jsx)(`span`,{className:`xo2rkog x1s688f`,children:e})]}),f?(0,G.jsxs)(`span`,{...{0:{className:`x78zum5 x6s0dn4 x17d4w8g xj8oexa x1awh872 x1e6avla xlssvyo x19ay2w6 x1j6dyjg xuxw1ft xeuugli xb3r6kr xlyipyv`},2:{className:`x78zum5 x6s0dn4 x17d4w8g xj8oexa x1awh872 x1e6avla x1j6dyjg xuxw1ft xeuugli xb3r6kr xlyipyv xahzvm9 x1bo0w0s`},1:{className:`x78zum5 x6s0dn4 x17d4w8g xj8oexa x1awh872 x1e6avla x1j6dyjg xuxw1ft xeuugli xb3r6kr xlyipyv xqdcvd7 x7zghnd`},3:{className:`x78zum5 x6s0dn4 x17d4w8g xj8oexa x1awh872 x1e6avla x1j6dyjg xuxw1ft xeuugli xb3r6kr xlyipyv xqdcvd7 x7zghnd`}}[(n.kind===`working`)<<1|n.kind===`stale`],children:[n.kind===`stale`?null:(0,G.jsx)(`i`,{className:`x1v4s8kt xols6we x16rqkct xtwfq29`}),f]}):null,i?(0,G.jsx)(`span`,{className:`x78zum5 x6s0dn4 x17d4w8g xj8oexa x1awh872 x1e6avla x1j6dyjg xuxw1ft xeuugli xb3r6kr xlyipyv xqdcvd7 x7zghnd`,children:`未同步,正在重试`}):null,s?.reason&&!c?(0,G.jsx)(`span`,{className:`xb3r6kr xddlp02 xfifm61 xuxw1ft xlyipyv`,children:s.reason}):null,(0,G.jsx)(`span`,{className:`x98rzlu`}),s?(0,G.jsxs)(`span`,{className:`x78zum5 x6s0dn4 x17d4w8g x1bo0w0s xfifm61 xuxw1ft`,children:[(0,G.jsx)(`i`,{...{0:{className:`xci0xqf x1hagigm x16rqkct xxwmxtg`},1:{className:`xci0xqf x1hagigm x16rqkct xux1nz0`}}[!!s.online|0]}),s.online?`电脑在线`:`电脑离线`]}):null,c?null:(0,G.jsxs)(`button`,{type:`button`,onClick:d?.close,className:`doc-history-entry`,children:[`评论 `,a]}),d?(0,G.jsx)(`button`,{type:`button`,className:`doc-history-entry`,"aria-pressed":d.open,disabled:!d.available,title:d.available?void 0:`电脑离线,历史暂不可用`,onClick:d.toggle,children:`历史记录`}):null,l?(0,G.jsx)(`button`,{type:`button`,onClick:l,className:`x12ulsxz xaope02 xc342km x1kogg8i x19ckca5 xs0jrwl xqfszdh x4z9k3i x1s688f x1ypdohk`,children:`完成`}):s||c?null:(0,G.jsx)(Oe,{artifact:`document/${e}`})]})}function Xt(e,t,n){let[r,i]=t<=n?[t,n]:[n,t];return{blockIds:e.slice(r,i+1).flatMap(e=>e.id?[e.id]:[]).slice(0,je.blockIds),heading:e.slice(0,r+1).filter(e=>e.heading).pop()?.text??``}}var Zt=crypto.randomUUID(),Qt=300,$={quote:``,blockIds:[],heading:``};function $t(e){let t=window.getSelection(),n=e.getRootElement();if(!t||t.isCollapsed||!n?.contains(t.anchorNode)||!n.contains(t.focusNode))return $;let r=t.toString().trim().slice(0,je.quote);return r?e.read(()=>{let e=x().getChildren(),n=t=>{let n=t&&L(t)?.getTopLevelElement();return n?e.findIndex(e=>e.is(n)):-1},i=n(t.anchorNode),a=n(t.focusNode);if(i<0||a<0)return{...$,quote:r};let o=e.map(e=>({id:he(e,ce)||``,heading:e.getType()===`heading`,text:e.getTextContent().slice(0,je.heading)}));return{quote:r,...Xt(o,i,a)}}):$}function en(e,t,n,r){let i=(0,W.useRef)($);(0,W.useEffect)(()=>{if(!e)return;let n=0,a=()=>{let n=$t(e);JSON.stringify(n)!==JSON.stringify(i.current)&&(i.current=n,r({type:`selection`,artifact:t,tab:Zt,human:!0,...n}))},o=()=>{clearTimeout(n),n=window.setTimeout(a,Qt)};return document.addEventListener(`selectionchange`,o),()=>{clearTimeout(n),document.removeEventListener(`selectionchange`,o)}},[e,t,r]),(0,W.useEffect)(()=>{n&&i.current.quote&&r({type:`selection`,artifact:t,tab:Zt,human:!1,...i.current})},[n,t,r])}var tn=[`pending`],nn=`x-ryugi-document-features`,rn=e=>{let t=``;for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return btoa(t)};function an({id:e,channel:t,send:n}){let r=(t,n,r)=>fetch(`/api/document/${e}/${t}`,{method:`POST`,headers:{"Content-Type":r,[nn]:tn.join(`,`)},body:n});return{artifact:`document/${e}`,channel:t,send:n,async meta(){let t=await fetch(`/api/artifacts/document/${e}`,{cache:`no-store`});return t.ok?await t.json():null},async state(){let t=await fetch(`/api/document/${e}/state`,{cache:`no-store`}),n=await t.json();if(!t.ok||!n.snapshot)throw Error(n.error??`load failed (${t.status})`);return n},async update(e){let t=await r(`update`,e,`application/octet-stream`);if(!t.ok)throw Error(`update failed (${t.status})`)},async comment(e){let t=await r(`comments`,JSON.stringify(e),`application/json`);if(!t.ok)throw Error(`comment failed (${t.status})`);return(await t.json()).comments}}}function on(e){let t=P(),n=(e.connect??Ae)({url:e.url,artifact:e.artifact,WebSocket:e.WebSocket,retryMs:e.retryMs,onPresence:e.onPresence,onEvent:e=>t.emit(e),onOnline:()=>t.emit({type:`open`})});return{artifact:e.artifact,channel:t,close:n.close,async meta(){let t=await n.request({op:`meta`});return/^https?:\/\//.test(t.contentBase??``)?t:{...t,contentBase:e.contentBase}},state:()=>n.request({op:`state`}),async update(e){await n.request({op:`update`,bytes:rn(e),features:tn})},async comment(e){return(await n.request({op:`comment`,comment:e})).comments},send(e){let{type:t}=e;t===`selection`?n.request({op:`selection`,selection:e}).catch(()=>{}):(t===`loaded`||t===`runtime-error`)&&n.request({op:`client`,message:e}).catch(()=>{})}}}function sn(e){let t=(0,W.useMemo)(P,[]),n=`document/${e}`,{live:r,send:i}=ke(e=>{e.artifact===n&&t.emit(e)},()=>t.emit({type:`open`}));return{transport:(0,W.useMemo)(()=>an({id:e,channel:t,send:i}),[e,t,i]),live:r}}function cn(e,t){let[n,r]=(0,W.useState)(null),[i,a]=(0,W.useState)(null);return(0,W.useEffect)(()=>{let n=on({url:Me(e),artifact:`document/${e}`,contentBase:t,onPresence:a,connect:t=>Pe({...t,cloudId:e,known:Ee()})});return r(n),()=>{n.close(),r(null),a(null)}},[e,t]),{transport:n,presence:i}}var ln={count:0,firstKey:null},un=e=>e.read(()=>{let e=x().getChildren().filter(e=>e.getType()===`pending`).map(e=>e.getKey());return{count:e.length,firstKey:e[0]??null}});function dn(e){let[t,n]=(0,W.useState)(ln);return(0,W.useEffect)(()=>{if(!e){n(ln);return}let t=e=>n(t=>t.count===e.count&&t.firstKey===e.firstKey?t:e);return t(un(e.getEditorState())),e.registerUpdateListener(({editorState:e})=>t(un(e)))},[e]),t}function fn(e,t=15e3){let[n,r]=(0,W.useState)(()=>Date.now());return(0,W.useEffect)(()=>{if(!e)return;r(Date.now());let n=setInterval(()=>r(Date.now()),t);return()=>clearInterval(n)},[e,t]),n}function pn({left:e,top:t,placement:n,canComment:r,canEdit:i,onComment:a,onEdit:o}){let s=(0,W.useRef)(null),c=[r?{label:`评论`,Icon:Re,run:a,primary:!0}:null,i?{label:`改字`,Icon:H,run:o,primary:!1}:null].filter(e=>e!==null);return(0,W.useLayoutEffect)(()=>{u(s.current,[{opacity:0,transform:`scale(0.96)`},{opacity:1,transform:`none`}],{duration:160,easing:d})},[]),c.length===0?null:(0,G.jsxs)(`div`,{ref:s,"data-edit-menu":!0,"data-placement":n,...{0:{className:`x10l6tqk x1u8a7rm x78zum5 xdt5ytf x1cy8zhl`},1:{className:`x10l6tqk x1u8a7rm x78zum5 x1cy8zhl x3ieub6`}}[n===`above`|0],style:{left:e,top:t,transformOrigin:n===`above`?`22px 100%`:`22px 0`},onMouseDown:e=>e.preventDefault(),children:[(0,G.jsx)(`span`,{className:`xsmyaan x1kpxq89 xyqm7xq x1qp53xl x1cum3z5 xf6xdpg x1158fpu`}),(0,G.jsx)(`div`,{className:`x78zum5 xn3w4p2 xfn1xvj x4pepcl xf6xdpg x1dam6yx`,children:c.map(({label:e,Icon:t,run:n,primary:r})=>(0,G.jsxs)(`button`,{type:`button`,onClick:n,...{0:{className:`x78zum5 x6s0dn4 x17d4w8g xn3w4p2 xt970qd xaope02 xc342km x1q4ynmn xjbqb8w x116urgp xqirfc3 xqfszdh xif65rj x1ypdohk`},1:{className:`x78zum5 x6s0dn4 x17d4w8g xn3w4p2 xt970qd xaope02 xc342km x1q4ynmn xjbqb8w x116urgp xqfszdh xif65rj x1ypdohk xfungia x1s688f`}}[!!r|0],children:[(0,G.jsx)(t,{size:16,"aria-hidden":!0}),e]},e))})]})}var mn={state:{kmuXW:`x2lah0s`,kGuDYH:`xfifm61`,$$css:!0},waitingAgent:{kMwMTN:`x7zghnd`,$$css:!0},answered:{kMwMTN:`xh0clw4`,$$css:!0},resolved:{kMwMTN:`xddlp02`,$$css:!0}},hn=e=>new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`});function gn({thread:e,agent:t=`Agent`,actions:n,active:a=!1,offline:o=!1}){let c=r(e),u=e.status===`resolved`,d=u?{label:`已解决`,tone:mn.resolved}:c===`agent`?{label:`等 ${t} 回复`,tone:mn.waitingAgent}:c===`human`?{label:`${t} 已回复`,tone:mn.answered}:null;return(0,G.jsxs)(`div`,{"data-thread":e.id,...{0:{className:`xxlmvz2 x178xt8z x13fuv20 xxu5053 xqfszdh xo2rkog`},1:{className:`xxlmvz2 x178xt8z x13fuv20 xxu5053 xqfszdh xo2rkog xggygye`}}[!!a|0],children:[(0,G.jsxs)(`div`,{className:`x78zum5 x1pha0wt x167g77z x1lqa7cf x1vo0akb x19ypqd9 x13ym6ox x4z9k3i`,children:[(0,G.jsx)(`span`,{className:`x98rzlu xeuugli xb3r6kr xuxw1ft xlyipyv x1bo0w0s`,children:e.anchor.quote||`整段`}),d?(0,G.jsx)(`span`,{...l(mn.state,d.tone),children:d.label}):null]}),u&&!a?null:e.messages.map(e=>{let{label:t,initial:n}=s(e);return(0,G.jsxs)(`div`,{className:`x14vqqas`,children:[(0,G.jsxs)(`div`,{className:`x78zum5 x6s0dn4 x167g77z x4z9k3i x1s688f`,children:[(0,G.jsx)(m,{human:e.author===`human`,initial:n,name:e.name,src:e.avatar}),t,(0,G.jsx)(`span`,{className:`xddlp02 xo1l8bm xfifm61`,children:hn(e.editedAt??e.at)})]}),(0,G.jsx)(`div`,{...{0:{className:`x1gslohp xxpkpgd x1jvydc1 x1dbl2gt x126k92a xj0a0fe`},1:{className:`x1gslohp xxpkpgd x1jvydc1 x1dbl2gt x126k92a xj0a0fe xc7n51q`}}[!!e.deleted|0],children:e.deleted?`已删除`:e.text})]},e.id)}),n?(0,G.jsxs)(`div`,{className:`x78zum5 x6s0dn4 xou54vl x1anpbxc xxpkpgd`,children:[u?null:(0,G.jsx)(`div`,{className:`x98rzlu xeuugli x1qyh8g1 xso031l x1q0q8m5 x1iz93xd`,children:(0,G.jsx)(i,{placeholder:`回复…`,onSubmit:t=>n.reply(e.id,t)})}),o?null:(0,G.jsx)(`button`,{type:`button`,onClick:()=>u?n.reopen(e.id):n.resolve(e.id),className:`x2lah0s x1gg8mnh xt970qd xdqyycr x1w5wx5t xc342km xjbqb8w x1bo0w0s xqfszdh x4z9k3i x1ypdohk`,children:u?`重新打开`:`解决`})]}):null]})}var _n=.5,vn=e=>e===78?_n:e;function yn({threads:e,agent:t=`Agent`,actions:n,offline:a,draft:o,onCreate:s,onCancelDraft:c,activeId:l,snap:f,onSnap:p}){let m=(0,W.useRef)(null),h=e.filter(e=>!e.messages.every(e=>e.deleted)),g=h.filter(e=>r(e)===`agent`).length,_=a?`电脑离线,暂时不能评论`:g>0?`${g} 条等 ${t} 回复`:null;return(0,W.useEffect)(()=>{let e=l?m.current?.querySelector(`[data-thread="${CSS.escape(l)}"]`):null,t=e?.closest(`[data-sheet-body]`);e&&t&&(t.scrollTo({top:t.scrollTop+e.getBoundingClientRect().top-t.getBoundingClientRect().top-8,behavior:`smooth`}),u(e,[{backgroundColor:`rgba(232, 194, 74, 0.24)`},{backgroundColor:`transparent`}],{duration:600,delay:250,easing:d}))},[l]),(0,G.jsx)(Fe,{snaps:[78,_n,1],snap:f,onSnap:p,onScrim:()=>p(_n),header:(0,G.jsxs)(`span`,{className:`x78zum5 x1pha0wt x17d4w8g xu0aao5 x17qtykl xwib8y2 xqfszdh x1jvydc1 x1s688f`,children:[`评论 `,h.length,_?(0,G.jsxs)(`span`,{className:`xddlp02 xfifm61 xo1l8bm`,children:[`· `,_]}):null]}),children:(0,G.jsxs)(`div`,{ref:m,className:`x17qtykl xwxc41k`,children:[o&&n?(0,G.jsxs)(`div`,{className:`x10dr8xq xqfszdh`,children:[(0,G.jsxs)(`div`,{className:`x78zum5 x1pha0wt x167g77z x4z9k3i`,children:[(0,G.jsx)(`span`,{className:`x98rzlu xeuugli x1lqa7cf x1vo0akb x19ypqd9 x13ym6ox xb3r6kr xuxw1ft xlyipyv x1bo0w0s`,children:o.quote}),(0,G.jsx)(`button`,{type:`button`,onClick:c,className:`x1717udv xc342km xjbqb8w xddlp02 x4z9k3i x1ypdohk`,children:`取消`})]}),(0,G.jsx)(`div`,{className:`x1xmf6yo x1qyh8g1 xso031l x1q0q8m5 x1iz93xd`,children:(0,G.jsx)(i,{autoFocus:!0,placeholder:`写给 agent 的评论…`,onSubmit:e=>s(o,e).then(e=>(e&&c(),e))})})]}):null,h.length===0&&!o?(0,G.jsx)(`div`,{className:`xr9q8rw xddlp02 xqfszdh x4z9k3i x2b8uid`,children:`还没有评论。选中文字就能评论。`}):null,h.map(e=>(0,G.jsx)(gn,{thread:e,agent:t,actions:n,active:e.id===l,offline:a},e.id))]})})}var bn=52;function xn({editor:e,threads:t,actions:n,agent:r,canComment:i,canEdit:a,offline:o,selection:s,clearSelection:c,onCreate:l,onEdit:u,onMain:d,children:f}){let[p,m]=(0,W.useState)(null),[h,g]=(0,W.useState)(null),[_,v]=(0,W.useState)(78),[y,b]=(0,W.useState)(null),x=V(e,t,p);pe(x,t,h),re(y?.range??null);let S=()=>{window.getSelection()?.removeAllRanges(),c()};return(0,G.jsxs)(`main`,{ref:e=>{m(e),d?.(e)},className:`x1n2onr6 x1cnzs8 x17qtykl x1ffnkcp`,children:[(0,G.jsx)(`article`,{onClick:e=>{let t=ge(x,e.clientX,e.clientY);g(t),t&&v(vn)},children:f}),s&&!y?(0,G.jsx)(pn,{..._e(s,{left:8,right:(p?.clientWidth??0)-8},170,44,{top:p?.getBoundingClientRect().top??0,height:window.innerHeight,reserved:De(_,window.innerHeight-bn)}),canComment:i,canEdit:a,onComment:()=>{b(s),v(_n),S()},onEdit:()=>{u(s),c()}}):null,(0,G.jsx)(`div`,{className:`xixxii4 x1ozmhy9 xu96u03 x3m8u43 x1ey2m1c x1355qak x47corl`,children:(0,G.jsx)(yn,{threads:t,agent:r,actions:n,offline:o,draft:y,onCreate:l,onCancelDraft:()=>b(null),activeId:h,snap:_,onSnap:v})})]})}var Sn=200;function Cn(e,t){let[n,r]=(0,W.useState)(null);return(0,W.useEffect)(()=>{if(!e||!t)return;let n=0,i=()=>{let n=window.getSelection(),i=e.getRootElement();if(!n||n.isCollapsed||n.rangeCount===0||!i?.contains(n.anchorNode)){r(null);return}let a=n.toString().trim(),o=e.read(()=>{let e=n.anchorNode&&L(n.anchorNode)?.getTopLevelElement(),t=n.focusNode&&L(n.focusNode)?.getTopLevelElement();return!e||!t||!e.is(t)?null:he(e,ce)||null});if(!o||!a){r(null);return}let s=n.getRangeAt(0),c=[...s.getClientRects()],l=c[0]??s.getBoundingClientRect(),u=c.at(-1)??l,d=t.getBoundingClientRect();r({blockId:o,quote:a.slice(0,500),left:l.left-d.left,bottom:u.bottom-d.top,top:l.top-d.top,right:u.right-d.left,range:s.cloneRange()})},a=()=>{clearTimeout(n),n=window.setTimeout(i,Sn)};return document.addEventListener(`selectionchange`,a),()=>{clearTimeout(n),document.removeEventListener(`selectionchange`,a)}},[e,t]),[n,()=>r(null)]}var wn=[...b.filter(e=>!ae.some(t=>t.getType()===(`getType`in e?e.getType():e.replace.getType()))),...ae];function Tn(){let e=(0,W.useMemo)(()=>window.matchMedia(`(prefers-color-scheme: dark)`),[]),[t,n]=(0,W.useState)(e.matches);return(0,W.useEffect)(()=>{let t=()=>n(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[e]),t}function En(e){(0,W.useEffect)(()=>{if(!e)return;let t=document.createElement(`base`);return t.href=e,document.head.prepend(t),()=>t.remove()},[e])}function Dn({id:e}){let{transport:t,live:n}=sn(e);return(0,G.jsx)(On,{id:e,transport:t,live:n})}function On({id:e,transport:t,live:n,cloud:r,fallback:i}){let[a,o]=(0,W.useState)(null),[s,l]=(0,W.useState)(null),[u,d]=(0,W.useState)(p),[m,h]=(0,W.useState)(null),[g,_]=(0,W.useState)(!1),[v,y]=(0,W.useState)(void 0),[b,x]=(0,W.useState)(0),S=(0,W.useCallback)(e=>{e!==void 0&&x(e-Date.now())},[]),[C,w]=(0,W.useState)(null),[T,E]=(0,W.useState)(!1),[D,O]=(0,W.useState)(!1),k=!r||r.online&&!T,A=D&&k;(0,W.useEffect)(()=>{k||O(!1)},[k]),(0,W.useEffect)(()=>{if(!r)return;let t=t=>{t.source===window.parent&&t.origin===location.origin&&t.data?.type===`ryugi:document-history`&&t.data.id===e&&(t.data.action===`close`?O(!1):t.data.action===`toggle`&&k&&O(e=>!e))};return window.addEventListener(`message`,t),()=>window.removeEventListener(`message`,t)},[e,r,k]);let[j,ee]=(0,W.useState)(null),[M,N]=(0,W.useState)(null),P=Tn(),{artifact:F,channel:I}=t,L=!r||r.online,R=!r||r.canEdit,z=f(c),[te,ne]=(0,W.useState)(!1),re=z?te&&R:R,B=(0,W.useCallback)(async()=>{let e=await t.meta();e&&o(e)},[t]),ie=i!=null;(0,W.useEffect)(()=>{let e=!1;return(async()=>{try{await B();let n=await t.state();if(e)return;let r=new xe;r.setRecordTimestamp(!0),r.setChangeMergeInterval(20),r.import(se(n.snapshot)),_(!!n.streaming),y(n.agentActiveAt),S(n.now),d(n.comments??p());let i=ie?{left:window.scrollX,top:window.scrollY,behavior:`instant`}:null;l(r),i&&requestAnimationFrame(()=>{e||window.scrollTo(i)})}catch(t){e||h(t.message)}})(),()=>{e=!0}},[t,B,S,ie]),(0,W.useEffect)(()=>I.subscribe(e=>{e.type===`change`?B():e.type===`doc-status`?(_(e.streaming),y(e.agentActiveAt),S(e.now)):e.type===`doc-comments`&&d(e.comments)}),[I,B,S]),(0,W.useEffect)(()=>{j?.setEditable(re&&!A)},[j,re,A]),(0,W.useEffect)(()=>{R||ne(!1)},[R]);let ae=(0,W.useCallback)(e=>{_(!!e.streaming),y(e.agentActiveAt),S(e.now),e.comments&&d(e.comments)},[S]);En(a?.contentBase),en(j,F,n&&!A,t.send);let oe=(0,W.useMemo)(()=>({artifact:F,contentBase:a?.contentBase??``,channel:I,send:t.send}),[F,a?.contentBase,I,t]);(0,W.useEffect)(()=>{document.title=a?.title||e},[a?.title,e]),Ie(`document`);let V=dn(j),ce=fn(V.count>0&&!g),le=ze({streaming:g,pending:V.count,agentActiveAt:v,now:ce+b}),ue=a?.agent??`Agent`,de=(0,W.useMemo)(()=>({nextKey:V.firstKey,agent:ue,activity:le.kind}),[V.firstKey,ue,le.kind]),fe=u.threads.filter(e=>e.status===`open`).length,[pe,he]=Cn(j,M),H=(0,W.useCallback)(async e=>{try{return d(await t.comment(e)),!0}catch{return!1}},[t]),ge=(0,W.useMemo)(()=>({reply:(e,t)=>H({op:`reply`,threadId:e,text:t}),edit:(e,t,n)=>void H({op:`edit`,threadId:e,messageId:t,text:n}),remove:(e,t)=>void H({op:`delete`,threadId:e,messageId:t}),resolve:e=>void H({op:`resolve`,threadId:e}),reopen:e=>void H({op:`reopen`,threadId:e})}),[H]),U=(0,W.useCallback)((e,t)=>H({op:`create`,blockId:e.blockId,quote:e.quote,text:t}),[H]),_e=(0,W.useCallback)(e=>{if(!j)return;j.setEditable(!0),ne(!0),j.getRootElement()?.focus({preventScroll:!0});let t=window.getSelection();t?.removeAllRanges(),t?.addRange(e.range)},[j]);if(m)return(0,G.jsx)(`div`,{className:`x1o8uwn5 x2b8uid x1bo0w0s xqfszdh xif65rj`,children:m});if(!s)return i??(0,G.jsx)(`div`,{className:`x1o8uwn5 x2b8uid x1bo0w0s xqfszdh xif65rj`,children:`Loading…`});let ve=(0,G.jsx)(we.Provider,{value:oe,children:(0,G.jsx)(me.Provider,{value:de,children:(0,G.jsx)(be,{transport:t,agent:a?.agent,doc:s,theme:P?`dark`:`light`,onAgentSection:w,onOffline:E,onState:ae,onEditorReady:ee})})});return(0,G.jsxs)(`div`,{className:`x1us19tq x1rozbrz xo2rkog`,className:`ryugi-doc ${{className:`x1us19tq x1rozbrz xo2rkog`}.className??``}`,children:[(0,G.jsx)(Yt,{id:e,title:a?.title||e,agent:a?.agent,activity:le,agentSection:C,offline:T,openComments:fe,cloud:r,compact:z,onDone:z&&te?()=>ne(!1):void 0,history:{available:k,open:A,toggle:()=>O(e=>!e),close:()=>O(!1)}}),A?(0,G.jsx)(Vt,{doc:s,nodes:wn,streaming:g,theme:P?`dark`:`light`,title:a?.title||e,onClose:()=>O(!1)}):null,(0,G.jsx)(`div`,{hidden:A,children:z?(0,G.jsx)(xn,{editor:j,threads:u.threads,actions:ge,agent:a?.agent,canComment:L,canEdit:R,offline:!(!r||r.online),selection:te?null:pe,clearSelection:he,onCreate:U,onEdit:_e,onMain:N,children:ve}):(0,G.jsx)(Jt,{editor:j,threads:u.threads,actions:ge,agent:a?.agent,canComment:L,selection:pe,clearSelection:he,onCreate:U,onMain:N,children:ve})}),(0,G.jsx)(Ne,{warnings:a?.warnings??[]})]})}export{On as DocumentView,Dn as default,cn as t};
|