ryugi-artifacts 1.114.0 → 1.115.1

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.
Files changed (106) hide show
  1. package/dist/cli.cjs +180 -177
  2. package/dist/document-engine.cjs +381 -381
  3. package/dist/output-bootstrap.cjs +18 -3
  4. package/dist/viewer/{AgentDock-CDC42MYW.js → AgentDock-CH6Ykvym.js} +1 -1
  5. package/dist/viewer/{ArtboardLayout-xxRqCrgL.js → ArtboardLayout-BoYjJscp.js} +1 -1
  6. package/dist/viewer/{ArtifactList-BmTQrxlv.js → ArtifactList-uj-q3W1q.js} +2 -2
  7. package/dist/viewer/{ArtifactModal-lbwt_kHc.js → ArtifactModal-C5mrDL4r.js} +1 -1
  8. package/dist/viewer/{BottomSheet-B411Uz-m.js → BottomSheet-IPyTloz4.js} +1 -1
  9. package/dist/viewer/{BrandingMark-C4Mwov-Z.js → BrandingMark-BMinTxVM.js} +1 -1
  10. package/dist/viewer/{Canvas-JTxptPpb.js → Canvas-CCJt5GBL.js} +1 -1
  11. package/dist/viewer/{CommentPopover-CyFGfP2x.js → CommentPopover-BgaTBWoa.js} +1 -1
  12. package/dist/viewer/{DocumentExportMenu-D0DMnSWz.js → DocumentExportMenu-BRaYTbF_.js} +1 -1
  13. package/dist/viewer/DocumentLayout-Cz3hhXPR.js +2 -0
  14. package/dist/viewer/{DocumentPage-DvWmw1Vl.js → DocumentPage-CZiEPrnj.js} +1 -1
  15. package/dist/viewer/{DraggablePanel-Cm5kvE5J.js → DraggablePanel-DpBrlowL.js} +1 -1
  16. package/dist/viewer/{DropdownMenu-CM_lj_mp.js → DropdownMenu-NA_XxVZB.js} +1 -1
  17. package/dist/viewer/{GroupVerdict-Bq7go5Dw.js → GroupVerdict-itgmpXO9.js} +1 -1
  18. package/dist/viewer/{HtmlLayout-D7QQPpys.js → HtmlLayout-DBJCJRWj.js} +1 -1
  19. package/dist/viewer/{Input-ChdGr9Fa.js → Input-CIa1R1G9.js} +1 -1
  20. package/dist/viewer/{MenuSubmenuTrigger-CTC0R6dC.js → MenuSubmenuTrigger-B1GRjbbe.js} +1 -1
  21. package/dist/viewer/{PhoneArtboardBar-Cfv4CxlL.js → PhoneArtboardBar-BQw7xexp.js} +1 -1
  22. package/dist/viewer/{Popover-DW_nm51-.js → Popover-D8lFLEo-.js} +1 -1
  23. package/dist/viewer/{PreviewArtifactLayout-DQaOmm6G.js → PreviewArtifactLayout-BIGmZXGw.js} +1 -1
  24. package/dist/viewer/{PreviewLayout-BxoUaQZk.js → PreviewLayout-BmJ39T9v.js} +2 -2
  25. package/dist/viewer/{ReportLayout-CrPY-ne6.js → ReportLayout-68jrSHuE.js} +1 -1
  26. package/dist/viewer/{Segmented-CIN3ad9Q.js → Segmented-Bbax5uqk.js} +1 -1
  27. package/dist/viewer/{SelectScrollUpArrow-CpNOzSFI.js → SelectScrollUpArrow-BbJtTBmP.js} +1 -1
  28. package/dist/viewer/{SlidesLayout-C25N3SSh.js → SlidesLayout-vo3ppRgW.js} +3 -3
  29. package/dist/viewer/{SnapshotDocument-BHVzE8LV.js → SnapshotDocument-DS6l1jwP.js} +1 -1
  30. package/dist/viewer/{SplitFrame-D5Ardg20.js → SplitFrame-D6BLXuFm.js} +1 -1
  31. package/dist/viewer/{StoryboardLayout-DYD80T-k.js → StoryboardLayout-BqJngaoz.js} +1 -1
  32. package/dist/viewer/{StoryboardRender-BJrKmvdM.js → StoryboardRender-0aFMSadj.js} +1 -1
  33. package/dist/viewer/{ThreadView-DIXaEds9.js → ThreadView-ChVeZPH-.js} +1 -1
  34. package/dist/viewer/{Tooltip-CMAfTGdh.js → Tooltip-Cd3a5ILg.js} +1 -1
  35. package/dist/viewer/{VerifyLayout-DJ9FlYRd.js → VerifyLayout-CaugP8cx.js} +1 -1
  36. package/dist/viewer/{VirtualizedEditor-uWe43zaI-TLPHNI-C.js → VirtualizedEditor-uWe43zaI-Fu03GlYD.js} +1 -1
  37. package/dist/viewer/{VirtualizedRenderer-C_d95FXi-aRBTgCqJ.js → VirtualizedRenderer-C_d95FXi-Cv8_J1w4.js} +1 -1
  38. package/dist/viewer/{WarningsBadge-Bh_CkFek.js → WarningsBadge-6ZtNX9sd.js} +1 -1
  39. package/dist/viewer/{WhiteboardEditor-DrHOvXez-BwHscwim.js → WhiteboardEditor-DrHOvXez-BewOBKRS.js} +1 -1
  40. package/dist/viewer/{WhiteboardLayout-D9LlBMNj.js → WhiteboardLayout-C9oGhpGn.js} +1 -1
  41. package/dist/viewer/{WritingCursor-BtUzGhWJ.js → WritingCursor-DauvJIme.js} +1 -1
  42. package/dist/viewer/{agentLook-Cprxr_R1.js → agentLook-B5foAwJ4.js} +1 -1
  43. package/dist/viewer/app-icon-CEU9ZLB-.png +0 -0
  44. package/dist/viewer/app-icon-DYGC0Tkn.svg +1 -0
  45. package/dist/viewer/{artifact-list-DfWvMvBX.js → artifact-list-9ZLo_0qZ.js} +1 -1
  46. package/dist/viewer/{auto-publish-D2Sdw8k6.js → auto-publish-89R-LJph.js} +1 -1
  47. package/dist/viewer/{channel-BiD51VhO.js → channel-C1USfAvL.js} +3 -3
  48. package/dist/viewer/{crop-encode-8FGWjkRa.js → crop-encode-BOXz_WBQ.js} +1 -1
  49. package/dist/viewer/{dist-CPtGSowx.js → dist--Z_ipYl1.js} +1 -1
  50. package/dist/viewer/{dist-BqDVBIIH.js → dist--yOSqFYM.js} +1 -1
  51. package/dist/viewer/{dist-BvrTRRD6.js → dist-51i-jmw9.js} +1 -1
  52. package/dist/viewer/{dist-Dn1dKREw.js → dist-6il6ungj.js} +1 -1
  53. package/dist/viewer/{dist-Ba21C_mV.js → dist-BB2CzNH5.js} +1 -1
  54. package/dist/viewer/{dist-BIxIhkrY.js → dist-BL2zRMAs.js} +1 -1
  55. package/dist/viewer/{dist-Bgg1tHz7.js → dist-BaxTLfF9.js} +1 -1
  56. package/dist/viewer/{dist-ObBt5Dp1.js → dist-BoWoFylE.js} +1 -1
  57. package/dist/viewer/{dist-Cl318o9k.js → dist-ByQtqN_D.js} +1 -1
  58. package/dist/viewer/{dist-CSuSzSPo.js → dist-ByuHK6Lu.js} +1 -1
  59. package/dist/viewer/{dist-BfrSmPDU.js → dist-CIIWl59b.js} +1 -1
  60. package/dist/viewer/{dist-BxF64KGt.js → dist-CUIIyopw.js} +1 -1
  61. package/dist/viewer/{dist-spYdtL1K.js → dist-CYF35EdI.js} +1 -1
  62. package/dist/viewer/{dist-Bzhm1KUn.js → dist-CaPAmSdE.js} +1 -1
  63. package/dist/viewer/{dist-DZcYa0Km.js → dist-CjC2787O.js} +1 -1
  64. package/dist/viewer/{dist-jQ7-OojG.js → dist-CuvOSXJh.js} +1 -1
  65. package/dist/viewer/{dist-DhCx8KqI.js → dist-DCrTJsdu.js} +1 -1
  66. package/dist/viewer/{dist-C0NUbcXW.js → dist-DHXQnea3.js} +1 -1
  67. package/dist/viewer/{dist-C6amI52I.js → dist-DSuLHq_u.js} +1 -1
  68. package/dist/viewer/dist-Dow23TfB.js +1 -0
  69. package/dist/viewer/{dist-De7Ddld5.js → dist-DtXXt7a4.js} +1 -1
  70. package/dist/viewer/{dist-LBfk012X.js → dist-MC6I6nQE.js} +1 -1
  71. package/dist/viewer/{dist-DpUkQ0Ox.js → dist-iRVjkEzT.js} +1 -1
  72. package/dist/viewer/{dist-B8trFwGf.js → dist-uI-2T5ED.js} +1 -1
  73. package/dist/viewer/{editor-DrmCUAHn.js → editor-BA7mo2fo.js} +4 -4
  74. package/dist/viewer/{fit-C207_s7h.js → fit-DF-RHcFl.js} +1 -1
  75. package/dist/viewer/{icons-FDIjBpMw.js → icons-CaBMvHC2.js} +1 -1
  76. package/dist/viewer/{imperative-vWs1QrC-.js → imperative-BNlnuZ6l.js} +1 -1
  77. package/dist/viewer/index.html +16 -16
  78. package/dist/viewer/index.js +2 -2
  79. package/dist/viewer/{local-5_OoB550.js → local-DGEGKhEk.js} +1 -1
  80. package/dist/viewer/{local-split-host-CigbXofU.js → local-split-host-BtzqQOET.js} +1 -1
  81. package/dist/viewer/plugin-_bGVeqI0-ajuQLIjY.js +2 -0
  82. package/dist/viewer/preview.html +3 -3
  83. package/dist/viewer/preview.js +1 -1
  84. package/dist/viewer/{printDocument-5qz1CDkd.js → printDocument-DTucYRWz.js} +1 -1
  85. package/dist/viewer/{ref-Cb-K9axF.js → ref-Cv0JhjU5.js} +1 -1
  86. package/dist/viewer/{route-D8zY0lFu.js → route-C7yP-PEQ.js} +2 -2
  87. package/dist/viewer/{route-messages-Bp-ieAIM.js → route-messages-Cd15UR6N.js} +1 -1
  88. package/dist/viewer/{settings-liAY1Fk5.js → settings-BZwlhQsp.js} +1 -1
  89. package/dist/viewer/{snap-DC2WWHJQ.js → snap-DD8dHw6I.js} +1 -1
  90. package/dist/viewer/{split-HmiZnula.js → split-Clr7jYGP.js} +2 -2
  91. package/dist/viewer/{stable-B9eifbbY.js → stable-DU_-8Jo1.js} +1 -1
  92. package/dist/viewer/{styles-HfB4YGR3.js → styles-CdPIply-.js} +1 -1
  93. package/dist/viewer/{transport-PHP3C7d_.js → transport-DusCV1zV.js} +1 -1
  94. package/dist/viewer/{url-DnEeE4_q.js → url-CCmcoMys.js} +1 -1
  95. package/dist/viewer/{useArtifactFeed-C_WoMYlQ.js → useArtifactFeed-jfvAzTGY.js} +1 -1
  96. package/dist/viewer/{useArtifactSocket-BlSfHQ61.js → useArtifactSocket-BA04npYU.js} +1 -1
  97. package/dist/viewer/{useLayerZIndex-DmwslOGG.js → useLayerZIndex-xDNOdXYr.js} +1 -1
  98. package/dist/viewer/{useStoryboardData-CLEi4bxr.js → useStoryboardData-CiapuT5g.js} +1 -1
  99. package/dist/viewer/{view-DqCvnMlV.js → view-BeeaUcIu.js} +1 -1
  100. package/dist/viewer/{viewport-CFJHn_Y6-CqJugTRB.js → viewport-CFJHn_Y6-BjAPnbEH.js} +1 -1
  101. package/package.json +2 -2
  102. package/dist/viewer/DocumentLayout-46dXdTHt.js +0 -2
  103. package/dist/viewer/app-icon-6WJOuhLx.svg +0 -1
  104. package/dist/viewer/app-icon-Bm9-i4yr.png +0 -0
  105. package/dist/viewer/dist-DYC6-wbF.js +0 -1
  106. package/dist/viewer/plugin-_bGVeqI0-BjaaNEVp.js +0 -2
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./printDocument-5qz1CDkd.js","./rolldown-runtime-XKyaHtl9.js","./react-DlmbjZJV.js","./route-D8zY0lFu.js","./bem-vbke-3KC.js","./jsx-runtime-LKYXHABd.js","./types-BCsOeYI6.js","./index2.css","./shims-s-YVfIlz.js","./editor-DrmCUAHn.js","./url-DnEeE4_q.js","./useLayerZIndex-DmwslOGG.js","./MotionConfigContext-HC2vqcJO.js","./is-html-element-DvgHo_1h.js","./WhiteboardEditor-DrHOvXez-BwHscwim.js","./Popover-DW_nm51-.js","./chevron-right-xNdXLJg6.js","./stringifyLocale-D0juOOnH.js","./code-DnmQyGiF.js","./SelectScrollUpArrow-CpNOzSFI.js","./zoom-out-DsmGFv1v.js","./text-align-start-CRhecbJR.js","./ruler-CYb0HZGT.js","./maximize-2-Bc0lXBg6.js","./mouse-pointer-2-B-OF_fcG.js","./undo-2-B-JiyKIl.js","./plus-DZJ2BVkK.js","./MenuSubmenuTrigger-CTC0R6dC.js","./index3.css","./Tooltip-CMAfTGdh.js","./pen-tool-BfwjhXQW.js","./underline-CT_nGhA9.js","./external-link-D382oEvK.js","./table-2-D90vZ04E.js","./message-square-Yl8PoPy_.js","./presentation-DXrcAbwM.js","./ThreadView-DIXaEds9.js","./comments-DUAz1Q9X.js","./stable-B9eifbbY.js","./icons-FDIjBpMw.js","./index5.css","./search-DTrfkTpJ.js","./sliders-horizontal-CuS3-UwA.js","./upload-DffL3XsM.js","./video-DKoRqEZW.js","./agentLook-Cprxr_R1.js","./DotGrid-DKKr_PyM.js","./rounds-BLj-tfMG.js","./useMedia-CFebB4XU.js","./BottomSheet-B411Uz-m.js","./motion-Cy65kd7X.js","./preference-oNdcNeml.js","./ref-Cb-K9axF.js","./useSandboxFrame-CJmSnwgG.js","./index4.css","./dist-DYC6-wbF.js","./katex-DuZJ-tFh.js","./ArtifactModal-lbwt_kHc.js","./SplitFrame-D5Ardg20.js","./clapperboard-BfpJ7tpa.js","./embed-src-CmyqZplg.js","./ArtifactModal-BU_PR8k8.css"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{C as t,D as n,j as r,x as i}from"./route-D8zY0lFu.js";/* empty css */import{t as a}from"./react-DlmbjZJV.js";import{C as o,Er as s,Lt as c,T as l,_ as u,a as d,b as f,c as p,d as m,f as h,gr as g,hr as _,p as v,w as y,x as b}from"./url-DnEeE4_q.js";import{t as x}from"./jsx-runtime-LKYXHABd.js";import{En as S}from"./useLayerZIndex-DmwslOGG.js";import{Dt as C}from"./MotionConfigContext-HC2vqcJO.js";import{Gt as w,Jr as T,_i as E,bn as D,gn as O,ir as k,ni as A,pa as ee,sa as te,wn as ne,xr as j,zr as re}from"./WhiteboardEditor-DrHOvXez-BwHscwim.js";import{$ as ie,B as ae,C as oe,E as se,F as M,G as ce,H as le,I as ue,J as de,K as fe,L as pe,P as me,Q as he,R as ge,V as _e,Y as N,Z as ve,_t as ye,at as be,ct as xe,dt as Se,et as Ce,gt as we,ht as Te,it as Ee,j as De,jt as P,lt as Oe,mt as ke,nt as F,ot as I,pt as Ae,q as je,rt as Me,st as Ne,tt as L,ut as Pe,vt as R,x as Fe,yt as Ie,z as Le}from"./editor-DrmCUAHn.js";import{t as Re}from"./Popover-DW_nm51-.js";import{o as ze}from"./ThreadView-DIXaEds9.js";import{r as Be}from"./agentLook-Cprxr_R1.js";import{n as Ve}from"./plugin-_bGVeqI0-BjaaNEVp.js";import{n as He,t as Ue}from"./icons-FDIjBpMw.js";import{n as We,t as Ge}from"./comments-DUAz1Q9X.js";import{n as Ke}from"./useMedia-CFebB4XU.js";import{n as qe}from"./artifact-list-DfWvMvBX.js";import{a as z,i as Je,t as Ye}from"./motion-Cy65kd7X.js";import{t as Xe}from"./embed-src-CmyqZplg.js";import{n as Ze}from"./preference-oNdcNeml.js";import{a as B,n as Qe,o as $e,r as V,t as et}from"./ref-Cb-K9axF.js";import{c as tt,i as nt,l as rt,u as it}from"./route-messages-Bp-ieAIM.js";var at={name:`corner-down-right`,size:24,node:[[`path`,{d:`m15 10 5 5-5 5`,key:`qqa56n`}],[`path`,{d:`M4 4v7a4 4 0 0 0 4 4h12`,key:`z08zvw`}]]};at.node;var ot=C(at),H=e(a(),1);function st(e,t,n){let r=(0,H.useMemo)(()=>f(),[]),[i,a]=(0,H.useState)(!1),s=(0,H.useRef)(t);s.current=t;let c=(0,H.useRef)(n);c.current=n,(0,H.useEffect)(()=>{if(r)return b((e,t)=>{e.kind===`chrome`&&a(e.hosted),e.kind===`history`&&s.current(e.action),t===window.parent&&e.kind===`document-export`&&e.format===`pdf`&&c.current?.()})},[r]);let{activity:l,comments:u,history:d,historyOpen:p,documentExport:m}=e;return(0,H.useEffect)(()=>{r&&o({kind:`header`,activity:l,comments:u,history:d,historyOpen:p,documentExport:m})},[r,l,u,d,p,m]),r&&i}var U=e(r(),1),W=x(),ct=`svg[role="img"] text[font-family*="Excalifont"] { font-family: ${O}; }`;function lt(){let e=Ze();return(0,W.jsx)(W.Fragment,{children:e&&(0,U.createPortal)((0,W.jsx)(`style`,{"data-diagram-font-style":!0,children:ct}),document.head)})}var G=(e,t,n,r)=>e.find(e=>t<e.bottom+r&&t+n+r>e.top);function ut(e,t,n,r){for(let i=G(e,t,n,r);i;)t=i.bottom+r,i=G(e,t,n,r);return t}function dt(e,t,n,r){for(let i=G(e,t,n,r);i;)t=i.top-r-n,i=G(e,t,n,r);return t}function ft(e,t,n,r,i){let a=e.top-i-t.height;if(a<0||G(r,a,t.height,i))return null;let o=t.anchorTop-a,s=[],c=a;for(let e=n.length-1;e>=0;e--){let t=n[e];if(t.top+t.height+i<=c)break;let a=c-i-t.height;if(t.fixed||a<0||G(r,a,t.height,i))return null;o+=t.top-a,s.push([e,a]),c=a}return{cost:o,moves:s,top:a}}function pt(e,t,n,r=[]){let i=[...e].sort((e,t)=>e.anchorTop-t.anchorTop),a=n?i.findIndex(e=>e.id===n):-1,o=Math.max(a,0),s=[],c=-1/0;for(let e=o;e<i.length;e++){let n=i[e],o=Math.max(n.anchorTop,c),l=G(r,o,n.height,t);if(l){let e=ut(r,o,n.height,t),i=ft(l,n,s,r,t);if(i&&i.cost<=e-n.anchorTop){for(let[e,t]of i.moves)s[e].top=t;o=i.top}else o=e}s.push({id:n.id,top:o,height:n.height,fixed:e===a}),c=o+n.height+t}let l={};for(let e of s)l[e.id]=e.top;if(a>0){let e=l[i[a].id];for(let n=a-1;n>=0;n--){let a=i[n],o=Math.min(a.anchorTop,e-t-a.height),s=G(r,o,a.height,t);if(s){let n=dt(r,o,a.height,t),i=s.bottom+t;o=i+a.height+t<=e&&!G(r,i,a.height,t)&&Math.abs(i-a.anchorTop)<Math.abs(a.anchorTop-n)?i:n}l[a.id]=o,e=o}}return l}function mt(e,t,n){let r=Math.max(e.x,t.x-n),i=(r+t.x)/2,a=r>e.x?` H${r}`:``;return`M${e.x} ${e.y}${a} C${i} ${e.y} ${i} ${t.y} ${t.x} ${t.y}`}var ht=8,gt=3,_t=18;function vt(e){let t=e.right+ht;return{left:t,right:t+gt,top:e.top,bottom:e.bottom}}function yt(e){return{x:e.right,y:e.top+Math.min(_t,(e.bottom-e.top)/2)}}function bt(e,t,n,r){return{left:Math.max(t.left,Math.min(e.left,t.right-n)),top:e.bottom+r}}var xt=10;function St(e,t,n,r,i){let a=Math.max(t.left,Math.min(e.left,t.right-n)),o=e.bottom+xt;return i.top+o+r<=i.height-i.reserved-8?{left:a,top:o,placement:`below`}:{left:a,top:e.top-r-xt,placement:`above`}}var K=e=>e.kind===`element`?[]:e.blocks??(e.kind===`block`?[{id:e.threadId,element:e.element}]:[]),q=e=>e.kind===`text`?e.ranges??[e.range]:[],Ct=4;function wt(e){return[...q(e).flatMap(e=>[...e.getClientRects()]),...K(e).map(e=>vt(e.element.getBoundingClientRect()))].sort((e,t)=>e.top-t.top||e.left-t.left)}function Tt(e){if(e.kind===`element`)return e.node.isConnected?ce(e.node):null;let t=wt(e).at(-1);return t?e.kind===`text`?{x:t.right,y:t.bottom}:yt(t):null}function Et(e,t,n){let r=document.createRange(),i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),a=0,o=!1;for(let e=i.nextNode();e;e=i.nextNode()){let i=a+e.length;if(!o&&t<=i&&(r.setStart(e,t-a),o=!0),o&&n<=i)return r.setEnd(e,n-a),r;a=i}return r.selectNodeContents(e),r}function Dt(e,t,n,r=0){let[i,a]=(0,H.useState)([]);return(0,H.useEffect)(()=>{if(!e||!n)return;let r=()=>{let r=e.getEditorState().read(()=>{let e=new Map;for(let t of j().getChildren()){let n=A(t,P);n&&e.set(n,t.getKey())}return e}),i=n.getBoundingClientRect().top-n.scrollTop,o=[];for(let n of t){let t=Ge(n.anchor).flatMap(t=>{let n=r.get(t),i=n?e.getElementByKey(n):null;return i?[{id:t,element:i}]:[]}),a=t[0]?.element;if(!a)continue;if(n.anchor.diagram){let e=fe(a,n.id);if(e){let t=e.getBoundingClientRect(),r=n.anchor.diagram.kind===`edge`?ce(e).y:t.top;o.push({threadId:n.id,top:r-i,kind:`element`,node:e})}else o.push({threadId:n.id,top:a.getBoundingClientRect().top-i,kind:`block`,element:a,blocks:t});continue}if(n.anchor.textRanges){let e=new Map(n.anchor.textRanges.map(e=>[e.blockId,e])),r=[],s=[],c;for(let n of t){let t=e.get(n.id),a=t?de(n.element.textContent??``,t.quote,t.start):`block`;if(a===`block`)s.push(n),c??=n.element.getBoundingClientRect().top-i;else{let e=Et(n.element,a.start,a.end);r.push(e);let t=e.getClientRects()[0]??n.element.getBoundingClientRect();c??=t.top-i}}r.length?o.push({threadId:n.id,top:c,kind:`text`,range:r[0],ranges:r,blocks:s}):o.push({threadId:n.id,top:c,kind:`block`,element:a,blocks:s});continue}let s=n.anchor.blockIds?`block`:de(a.textContent??``,n.anchor.quote);if(s===`block`){o.push({threadId:n.id,top:a.getBoundingClientRect().top-i,kind:`block`,element:a,blocks:t});continue}let c=Et(a,s.start,s.end),l=c.getClientRects()[0]??a.getBoundingClientRect();o.push({threadId:n.id,top:l.top-i,kind:`text`,range:c})}a(o)};r();let i=0,o=()=>{cancelAnimationFrame(i),i=requestAnimationFrame(r)},s=e.registerUpdateListener(o),c=new ResizeObserver(o);c.observe(n);let l=e.getRootElement();return l&&c.observe(l),()=>{cancelAnimationFrame(i),s(),c.disconnect()}},[e,t,n,r]),i}function Ot(e,t,n){(0,H.useEffect)(()=>{if(typeof CSS>`u`||!(`highlights`in CSS))return;let r=N(t,n),i=e.filter(e=>r.has(e.threadId)&&e.threadId!==n).flatMap(q),a=e.filter(e=>e.threadId===n).flatMap(q);return CSS.highlights.set(`ryugi-comment`,new Highlight(...i)),CSS.highlights.set(`ryugi-comment-active`,new Highlight(...a)),()=>{CSS.highlights.delete(`ryugi-comment`),CSS.highlights.delete(`ryugi-comment-active`)}},[e,t,n])}function kt(e,t){(0,H.useEffect)(()=>{if(t?.length){for(let e of t)e.setAttribute(`data-comment-draft`,``);return()=>{for(let e of t)e.removeAttribute(`data-comment-draft`)}}if(e&&typeof CSS<`u`&&`highlights`in CSS)return CSS.highlights.set(`ryugi-comment-draft`,new Highlight(e)),()=>{CSS.highlights.delete(`ryugi-comment-draft`)}},[e,t])}function At(e,t,n){for(let r of e){if(r.kind===`element`)continue;let e=r.kind===`block`||K(r).length?Ct:0;for(let i of wt(r))if(t>=i.left-e&&t<=i.right+e&&n>=i.top&&n<=i.bottom)return r.threadId}return null}var jt=e=>Math.max(0,Math.min(window.scrollY+e.getBoundingClientRect().top-100,document.documentElement.scrollHeight-window.innerHeight));function Mt(e){window.scrollTo({top:jt(e),behavior:`instant`})}function J(e,t){let n=jt(e);if(z())return window.scrollTo({top:n,behavior:`instant`}),t?.(),()=>{};let r=()=>{window.removeEventListener(`wheel`,i),window.removeEventListener(`touchmove`,i)},i=()=>{a.stop(),r()},a=c({keyframes:[window.scrollY+1,n],type:`spring`,stiffness:1e3,damping:250,onUpdate:e=>window.scrollTo({top:e,behavior:`instant`}),onComplete:()=>{r(),t?.()}});return window.addEventListener(`wheel`,i,{passive:!0}),window.addEventListener(`touchmove`,i,{passive:!0}),i}var Y=12,Nt=40,Pt=18;function Ft({id:e,onHeight:t,children:n}){let r=(0,H.useRef)(null);return(0,H.useLayoutEffect)(()=>{let n=r.current;if(!n)return;let i=new ResizeObserver(()=>t(e,n.offsetHeight));return i.observe(n),t(e,n.offsetHeight),()=>i.disconnect()},[e,t]),(0,W.jsx)(`div`,{ref:r,children:n})}function It({narrow:e,threads:n,anchors:r,blocked:i,activeId:a,actions:o,onActivate:s,railRef:c,agent:l}){let[u,d]=(0,H.useState)({}),[f,p]=(0,H.useState)(0),m=(0,H.useCallback)((e,t)=>p(t),[]),[h,g]=(0,H.useState)([]),_=(0,H.useRef)(null),v=(0,H.useRef)(new Map).current,y=(0,H.useRef)((e,t)=>d(n=>n[e]===t?n:{...n,[e]:t})).current,b=(0,H.useCallback)(e=>{_.current=e,c(e)},[c]),x=new Map(r.map(e=>[e.threadId,e.top])),S=n.filter(e=>x.has(e.id)),C=n.filter(e=>!x.has(e.id)&&!e.messages.every(e=>e.deleted)),w=S.map(e=>({id:e.id,anchorTop:x.get(e.id),height:u[e.id]??120})),T=pt(w,Y,a??void 0,i),E=Math.max(0,...w.map(e=>(T[e.id]??0)+e.height)),D=ut(i??[],E+Y,f,Y),O=JSON.stringify(T);(0,H.useLayoutEffect)(()=>{let t=_.current;if(e||!t)return g([]);let i=t.getBoundingClientRect(),o=N(n,a),s=[];for(let e of r){let t=T[e.threadId],n=Tt(e);if(t===void 0||!n||!o.has(e.threadId))continue;let r={x:n.x-i.left,y:n.y-i.top};s.push({id:e.threadId,d:mt(r,{x:0,y:t+Pt},Nt)})}g(s)},[e,r,n,a,O]),(0,H.useEffect)(()=>{let t=a?v.get(a):void 0;if(e||!t)return;let n=!1,r=()=>{},i=t.getAnimations({subtree:!0}).map(e=>e.finished.catch(()=>void 0));return Promise.all(i).then(()=>{!n&&le(t.getBoundingClientRect(),window.innerHeight)&&(r=J(t))}),()=>{n=!0,r()}},[a,e,v]);let k=e=>(0,W.jsx)(ae,{actions:o,active:e.id===a,agent:l,thread:e,onActivate:()=>s(e.id)});return e?(0,W.jsxs)(`div`,{"aria-label":t(`document.commentsLabel`),ref:b,role:`region`,className:`x78zum5 xdt5ytf x1v2ro7d xh8yej3 x7ep2pv xvueqy4`,children:[[...S].sort((e,t)=>x.get(e.id)-x.get(t.id)).map(e=>(0,W.jsx)(`div`,{children:k(e)},e.id)),C.length>0?(0,W.jsx)(`div`,{className:`xqui205 x1e56ztr xddlp02 xqfszdh x1j6dyjg`,children:t(`document.originalDeleted`)}):null,C.map(e=>(0,W.jsx)(`div`,{children:k(e)},e.id))]}):(0,W.jsxs)(`aside`,{"aria-label":t(`document.commentsLabel`),ref:b,className:`x1n2onr6 xh8yej3 x2lah0s`,style:{minHeight:E},children:[(0,W.jsx)(`svg`,{className:`x10l6tqk x13vifvy xu96u03 x1i1rx1s xjm9jq1 x1rea2x4 x47corl`,children:h.map(e=>(0,W.jsx)(`path`,{d:e.d,fill:`none`,stroke:e.id===a?Be.warningStrong:`currentColor`,strokeDasharray:e.id===a?void 0:`3 3`,strokeOpacity:e.id===a?1:.25},e.id))}),S.map(e=>(0,W.jsx)(`div`,{ref:t=>{t?v.set(e.id,t):v.delete(e.id)},className:`x10l6tqk xu96u03 xh8yej3 xhtitgo x14h5d43 xx6bhzk`,style:{top:T[e.id]},children:(0,W.jsx)(Ft,{id:e.id,onHeight:y,children:k(e)})},e.id)),C.length>0?(0,W.jsx)(`div`,{style:{position:`absolute`,top:D,left:0,width:`100%`,zIndex:2},children:(0,W.jsxs)(Ft,{id:`orphaned`,onHeight:m,children:[(0,W.jsx)(`div`,{className:`xqui205 x1e56ztr xddlp02 xqfszdh x1j6dyjg`,children:t(`document.originalDeleted`)}),C.map(e=>(0,W.jsx)(`div`,{style:{marginBottom:Y},children:k(e)},e.id))]})}):null]})}function Lt({container:e,anchors:t,threads:n,activeId:r}){let[i,a]=(0,H.useState)([]);return(0,H.useLayoutEffect)(()=>{if(!e)return a([]);let i=e.getBoundingClientRect(),o=N(n,r),s=[];for(let e of t)if(o.has(e.threadId))for(let t of K(e)){let n=vt(t.element.getBoundingClientRect());s.push({id:e.threadId,key:`${e.threadId}:${t.id}`,left:n.left-i.left,top:n.top-i.top,width:n.right-n.left,height:n.bottom-n.top})}a(s)},[e,t,n,r]),i.map(e=>(0,W.jsx)(`div`,{"data-comment-block":e.id,...{0:{className:`x10l6tqk x1cum3z5 x47corl x1f2496h x15406qy xx6bhzk`},1:{className:`x10l6tqk x1cum3z5 x47corl x15406qy xx6bhzk x5hs8br`}}[e.id===r|0],style:{left:e.left,top:e.top,width:e.width,height:e.height}},e.key))}var Rt=/^#([\w-]{4,64})$/,zt=/^#ryugi-host=/,Bt=e=>Rt.exec(e)?.[1]??null;function X(e=window){if(e.parent===e||!e.parent)return e;try{return e.parent.location.href,e.parent}catch{return e}}var Vt=(e=X())=>Bt(e.location.hash);function Ht(e,t=X()){let{hash:n,pathname:r,search:i}=t.location;if(zt.test(n))return;let a=e?`#${e}`:``;n!==a&&t.history.replaceState(t.history.state,``,`${r}${i}${a}`)}function Ut(e,t){let n=new URL(e);return n.hash=t,n.toString()}var Wt=new Set([`h2`,`h3`]),Gt=160;function Kt(e){let t=document.createRange();t.selectNodeContents(e);let n=t.getClientRects?.(),r=n&&n.length>0?n.item(n.length-1):null,i=e.getBoundingClientRect();return r&&r.width>0?r:i}function qt(e,t){e.getEditorState().read(()=>{for(let n of t){let t=k(n),r=e.getElementByKey(n);if(!ne(t)||!r)continue;let i=Wt.has(t.getTag())?A(t,P):``;i?r.id=i:r.removeAttribute(`id`)}})}function Jt({editor:e,shareBase:n}){let[r,i]=(0,H.useState)(null),[a,o]=(0,H.useState)(!1),c=(0,H.useRef)(void 0);if((0,H.useEffect)(()=>{if(e.hasNodes([D]))return e.registerMutationListener(D,t=>qt(e,[...t].filter(([,e])=>e!==`destroyed`).map(([e])=>e)))},[e]),(0,H.useEffect)(()=>{let t=()=>clearTimeout(c.current),n=()=>{t(),c.current=setTimeout(()=>i(null),Gt)},r=r=>{let a=r.target;if(a?.closest?.(`[data-heading-link]`))return t();let s=e.getRootElement(),c=a?.closest?.(`h2[id], h3[id]`);if(!s||!c||!s.contains(c))return n();t();let l=Kt(c);o(!1),i({id:c.id,left:l.right+window.scrollX+6,top:l.top+window.scrollY+(l.height-24)/2})};return document.addEventListener(`pointerover`,r),()=>{t(),document.removeEventListener(`pointerover`,r)}},[e]),!r)return null;let l=()=>{let e=Ut(n||X().location.href,r.id);navigator.clipboard?.writeText(e),Ht(r.id),o(!0)},u=t(a?`document.headingLinkCopied`:`document.copyHeadingLink`);return(0,U.createPortal)((0,W.jsx)(`button`,{"aria-label":u,"data-heading-link":``,style:{left:r.left,top:r.top},title:u,type:`button`,onClick:l,onPointerDown:e=>e.preventDefault(),...{0:{className:`x10l6tqk xoegz02 xrvj5dj x1ku5rj1 xvy4d1p xxk0z11 x1717udv xc342km x1kogg8i xjbqb8w xj0l527 xddlp02 x157umkc x1in2gmu x1ypdohk x1de99jn xaatb59 x1y3gkto x1uczgqu x60py1w`},1:{className:`x10l6tqk xoegz02 xrvj5dj x1ku5rj1 xvy4d1p xxk0z11 x1717udv xc342km x1kogg8i xjbqb8w xj0l527 x1ypdohk x1de99jn xaatb59 x1y3gkto x1uczgqu x60py1w x1cge3fn`}}[!!a|0],children:a?(0,W.jsx)(s,{"aria-hidden":`true`,size:14}):(0,W.jsx)(g,{"aria-hidden":`true`,size:14})}),document.body)}var Yt=620,Xt=class extends H.Component{state={leaving:null,shown:null};static getDerivedStateFromProps(e,t){return e.history?.immersive?t.shown===e.history?null:{shown:e.history}:t.shown?{shown:null,leaving:t.shown}:null}host=null;paper=null;viewport=null;shell=null;entry=null;slide=null;exitTimer=null;getSnapshotBeforeUpdate(){return{rect:this.paper?.getBoundingClientRect()??null,x:window.scrollX,y:window.scrollY}}animate(e,t){if(!this.paper||!e||z()||typeof this.paper.animate!=`function`)return;this.slide?.cancel();let n=t??this.paper.getBoundingClientRect(),r=Math.max(56,e.top),i=parseFloat(getComputedStyle(this.paper).borderLeftWidth)||0,a=t?0:i,o=t?i:0;this.slide=this.paper.animate([{left:e.left-a+`px`,top:r-a+`px`,width:e.width+a*2+`px`,height:Math.min(e.height,window.innerHeight-r)+a+`px`},{left:n.left-o+`px`,top:n.top-o+`px`,width:n.width+o*2+`px`,height:n.height+o+`px`}],{duration:Yt,easing:Ye,fill:t?`forwards`:`none`}),this.slide.finished.catch(()=>{})}unlock=()=>{if(this.exitTimer&&clearTimeout(this.exitTimer),this.exitTimer=null,this.slide?.cancel(),this.slide=null,this.host&&(this.host.style.height=``),this.entry){let e=this.entry;document.documentElement.style.overflow=e.overflow,document.documentElement.style.scrollbarGutter=e.gutter,window.scrollTo(e.x,e.y)}this.entry=null};componentDidUpdate(e,t,n){let r=!!this.props.history?.immersive,i=!!e.history?.immersive;if(r&&!i)this.exitTimer&&clearTimeout(this.exitTimer),this.exitTimer=null,this.state.leaving&&this.setState({leaving:null}),this.entry||(this.entry={...n,focus:document.activeElement,overflow:document.documentElement.style.overflow,gutter:document.documentElement.style.scrollbarGutter,offset:Math.max(0,56-(n.rect?.top??56))},this.host&&(this.host.style.height=(n.rect?.height??0)+`px`)),n.rect&&this.shell?.style.setProperty(`--history-reading-width`,n.rect.width+`px`),document.documentElement.style.scrollbarGutter=`stable`,document.documentElement.style.overflow=`hidden`,this.viewport&&(this.viewport.scrollTop=this.entry.offset),this.animate(n.rect),this.shell?.querySelector(`[data-history-exit]`)?.focus({preventScroll:!0});else if(!r&&i&&this.entry){let e=this.entry;this.viewport&&(this.viewport.scrollTop=e.offset),window.scrollTo(e.x,e.y),e.focus?.focus({preventScroll:!0});let t=e.rect;t&&this.animate(n.rect,{left:t.left,top:Math.max(56,t.top),width:t.width,height:Math.min(t.height,window.innerHeight-Math.max(56,t.top))});let r=()=>{this.setState({leaving:null},()=>{this.unlock(),e.focus?.focus({preventScroll:!0})})};z()?r():this.exitTimer=setTimeout(r,Yt)}else!r&&!this.state.leaving&&(!e.history&&this.props.history&&(this.entry={...n,focus:null,overflow:document.documentElement.style.overflow,gutter:document.documentElement.style.scrollbarGutter,offset:0}),e.history&&!this.props.history&&this.entry&&(window.scrollTo(this.entry.x,this.entry.y),this.entry=null))}componentWillUnmount(){this.unlock()}trap=e=>{if(!this.props.history?.immersive||e.key!==`Tab`)return;let t=[...this.shell?.querySelectorAll(`button:not(:disabled),a[href],summary,[tabindex="0"]`)??[]].filter(e=>!e.closest(`[hidden],[aria-hidden="true"],[inert]`)),n=t[0],r=t.at(-1);e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n?.focus())};render(){let{history:e,children:n}=this.props,r=e?.immersive?e:this.state.leaving,i=!!r,a=!!e?.ready;return(0,W.jsx)(`div`,{className:`history-body`,ref:e=>{this.host=e},children:(0,W.jsxs)(`div`,{"aria-label":e?.immersive?t(`history.title`):void 0,"aria-modal":e?.immersive?!0:void 0,className:`history-space-shell`,"data-immersive":i?``:void 0,"data-open":e?.immersive?``:void 0,inert:!(!this.state.leaving||e),role:e?.immersive?`dialog`:void 0,ref:e=>{this.shell=e},onKeyDown:this.trap,children:[r?.space,(0,W.jsx)(`div`,{className:`history-space-paper`,ref:e=>{this.paper=e},children:(0,W.jsxs)(`div`,{className:`history-space-scroll`,tabIndex:i?0:void 0,ref:e=>{this.viewport=e},children:[(0,W.jsx)(`div`,{className:`history-body-comparison`,"data-ready":a,hidden:!a,children:e?.content}),(0,W.jsx)(`div`,{hidden:a,children:n})]})})]})})}};function Zt({history:e,children:t}){let[n,r]=(0,H.useState)({current:e,panel:e?.panel??null});return n.current!==e&&r({current:e,panel:e?.panel??n.panel}),(0,H.useEffect)(()=>{if(e)return;let t=setTimeout(()=>{r(e=>e.current?e:{...e,panel:null})},z()?0:280);return()=>clearTimeout(t)},[e]),(0,W.jsx)(`div`,{className:`history-rail`,"data-moving":e||n.panel?``:void 0,"data-open":e?``:void 0,children:(0,W.jsxs)(`div`,{className:`history-rail-track`,children:[(0,W.jsx)(`div`,{"aria-hidden":e?!0:void 0,className:`history-rail-comments`,inert:!!e,children:t}),(0,W.jsx)(`div`,{"aria-hidden":!e||void 0,className:`history-rail-panel`,inert:!e,children:e?.panel??n.panel})]})})}var Qt=(0,H.createContext)(!1),$t=3e3;function Z(e,t){let n=e.getRootElement()?.closest(`.history-body`)?.querySelector(`.history-body-comparison[data-ready="true"]`);if(n)return[...n.querySelectorAll(`[data-history-block-id]`)].find(e=>e.dataset.historyBlockId===t)?.querySelector(`.history-current :is(h1, h2, h3, h4, h5, h6)`)??null;let r=e.getEditorState().read(()=>j().getChildren().find(e=>A(e,P)===t)?.getKey());return r?e.getElementByKey(r):null}function en(e,t){let n=(0,H.useContext)(Qt)?null:e,[r]=(0,H.useState)(Vt),i=(0,H.useRef)(r),a=(0,H.useRef)(r),o=(0,H.useRef)(void 0),s=(0,H.useRef)(null),c=(0,H.useRef)(null),l=(0,H.useCallback)(e=>{s.current=e,Ht(e)},[]),u=(0,H.useCallback)(e=>{let t=n&&Z(n,e);return t?(o.current?.(),o.current=J(t,()=>{i.current===e&&!a.current&&(i.current=null)}),!0):!1},[n]),d=(0,H.useCallback)(e=>{let t=n&&Z(n,e);return t?(o.current?.(),Mt(t),i.current===e&&!a.current&&(i.current=null),!0):!1},[n]),f=(0,H.useCallback)(e=>{let t={lock:i.current,pending:a.current};i.current=e,a.current=null,u(e)?l(e):(i.current=t.lock,a.current=t.pending)},[u,l]);return(0,H.useEffect)(()=>{if(!n)return;let e=()=>{if(n.getRootElement()?.closest(`.history-space-shell[data-immersive]`))return;let e=a.current;e&&(a.current=null,v()?i.current===e&&(i.current=null):d(e)?c.current={blockId:e,until:Date.now()+$t}:a.current=e)};e();let t=()=>{i.current=null,a.current=null,c.current=null},r=new ResizeObserver(()=>{if(n.getRootElement()?.closest(`.history-space-shell[data-immersive]`))return;let e=c.current;e&&(Date.now()>e.until?c.current=null:d(e.blockId))}),l=n.registerRootListener(e=>{r.disconnect(),e&&r.observe(e)}),u=X(),f=()=>{let t=Vt();t&&t!==s.current&&!rt(u.history.state)&&(i.current=t,a.current=t,e())},p=n.registerUpdateListener(e);return window.addEventListener(`wheel`,t,{passive:!0}),window.addEventListener(`touchmove`,t,{passive:!0}),window.addEventListener(`keydown`,t),u.addEventListener(`hashchange`,f),()=>{p(),l(),r.disconnect(),o.current?.(),window.removeEventListener(`wheel`,t),window.removeEventListener(`touchmove`,t),window.removeEventListener(`keydown`,t),u.removeEventListener(`hashchange`,f)}},[n,d]),(0,H.useEffect)(()=>{if(n){if(i.current){if(a.current||t!==i.current)return;i.current=null}else l(t)}},[t,n,l]),{scrollTo:f}}function tn({editor:e}){return en(e,null),null}var nn={h2:0,h3:1};function rn(){let e=[],t=null,n=null;for(let r of j().getChildren()){let i=ne(r)?r.getTag():void 0,a=A(r,P);if(i===`h1`){t={key:r.getKey(),blockId:a,text:r.getTextContent()},n=null;continue}let o=i===void 0?void 0:nn[i];o!==void 0&&(n={key:r.getKey(),blockId:a,text:r.getTextContent(),depth:o,part:t,blocks:[]},e.push(n)),a&&n?.blocks.push(a)}return e}function an(e,t){let n=new Map;for(let t of e)for(let e of t.blocks)n.set(e,t.blockId);let r=new Set;for(let e of t)if(e.status===`open`)for(let t of Ge(e.anchor)){let e=n.get(t);e&&r.add(e)}return r}function on(e){let t=new Set(e.map(e=>e.part?.key??null)).size>1,n=[],r;for(let i of e){let e=n.at(-1),a=i.part!==r;i.depth===0||!e||a?n.push({head:i,children:[],index:n.length,partStart:t&&a?i.part:null}):e.children.push(i),r=i.part}return n}var Q={toc:{kVAEAm:`x7wzq59`,kY2c9j:`x1w0boku`,k87sOh:`xossvpg`,kSGwAc:`x1y8v6su`,keoZOQ:`x1tfhste`,k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,kskxy:`x1r4ahda`,k7Eaqz:`xeuugli`,kMv6JI:`xqfszdh`,kGuDYH:`x1ct8sxb`,kMwMTN:`x1bo0w0s`,$$css:!0},rail:{kzqmXN:`x1td3qas`,$$css:!0},list:{kAzted:`x2lwn1j`,kORKVm:`x1odjw0f`,kacamN:`x1e4zzel`,k5wCbM:`x1rohswg`,k8WAf4:`xj8oexa`,$$css:!0},item:{kVAEAm:`x1n2onr6`,k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kOIVth:`x167g77z`,kzqmXN:`xh8yej3`,kZKoxP:`xlrawln`,kmVPX3:`x1717udv`,kMzoRj:`xc342km`,kaIpWk:`x1kogg8i`,kWkggS:`xjbqb8w`,kkrTdU:`x1ypdohk`,kMeerF:`x1de99jn`,k3XXqK:`xaatb59`,kInvED:`x1g40iwv`,kjBf7l:`x1uczgqu x60py1w`,$$css:!0},tick:{kmuXW:`x2lah0s`,kzqmXN:`xsmyaan`,kZKoxP:`x36qwtl`,keTefX:`xdwrcjd`,kaIpWk:`x1nj7uno`,kWkggS:`x174nbcu`,kmkexE:`x10iii20`,$$css:!0},tickH2:{kzqmXN:`xw4jnvo`,keTefX:`x1lziwak`,kWkggS:`xxwmxtg`,$$css:!0},tickActive:{kzqmXN:`xw4jnvo`,keTefX:`x1lziwak`,kWkggS:`x15az74h`,$$css:!0},tickDot:{keTefX:`x165d6jo`,$$css:!0},part:{kB7OPa:`x9f619`,kZKoxP:`x10w6t97`,kVQacm:`xb3r6kr`,kLKAdn:`xyinxu5`,kGuDYH:`x1j6dyjg`,k63SB2:`x1s688f`,kLWn49:`x1wfe3co`,kb6lSQ:`x16q24ku`,kMwMTN:`xddlp02`,kg5iWk:`xlyipyv`,khDVqt:`xuxw1ft`,kmkexE:`x1un5det`,$$css:!0},partFirst:{kZKoxP:`xxk0z11`,kLKAdn:`x1yrsyyn`,$$css:!0},row:{k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kOIVth:`x17d4w8g`,kzqmXN:`xh8yej3`,kZKoxP:`xlrawln`,kmVPX3:`x1717udv`,kMzoRj:`xc342km`,kaIpWk:`x12oqio5`,kWkggS:`xjbqb8w`,kMwMTN:`x1bo0w0s xytdrwj`,kVVagm:`xln7xf2`,k9WMMc:`x1yc453h`,kkrTdU:`x1ypdohk`,kmkexE:`x137m0jx x413zg9`,kMeerF:`x1de99jn`,k3XXqK:`xaatb59`,kInvED:`x1g40iwv`,kjBf7l:`x1uczgqu x60py1w`,$$css:!0},rowNested:{kZCmMZ:`x1onr9mi`,kGuDYH:`xfifm61`,kMwMTN:`xddlp02 xytdrwj`,$$css:!0},rowCurrent:{kZKoxP:`x1fgtraw`,kGuDYH:`x2ouz8m`,k63SB2:`x1s688f`,kMwMTN:`xo2rkog xytdrwj`,$$css:!0},rowActive:{k63SB2:`x1s688f`,kMwMTN:`x1cge3fn x157umkc`,$$css:!0},rowText:{kUk6DE:`x98rzlu`,k7Eaqz:`xeuugli`,kVQacm:`xb3r6kr`,kg5iWk:`xlyipyv`,khDVqt:`xuxw1ft`,$$css:!0},count:{kmuXW:`x2lah0s`,kGuDYH:`x1j6dyjg`,k63SB2:`xo1l8bm`,kMwMTN:`xc7n51q`,kcqcaj:`xss6m8b`,$$css:!0},fold:{k1xSpc:`xrvj5dj`,k9llMU:`xihq33y`,k33iCy:`xlshs6z`,kSiTet:`xg01cxk`,kmkexE:`x1u0be13 x9kvfbb`,$$css:!0},foldOpen:{k9llMU:`x1tu4anv`,k33iCy:`xnpuxes`,kSiTet:`x1hc1fzr`,kmkexE:`xjgrksx x9kvfbb`,$$css:!0},foldRows:{kAzted:`x2lwn1j`,kVQacm:`xb3r6kr`,k3aq6I:`x1bvilyr`,kmkexE:`x1pagzdl x9kvfbb`,$$css:!0},foldRowsOpen:{k3aq6I:`x1c071of`,kmkexE:`x94wcrn x9kvfbb`,$$css:!0},fadeNear:{kSiTet:`xiiclqw`,$$css:!0},fadeMid:{kSiTet:`xf9vgkq`,$$css:!0},fadeFar:{kSiTet:`x197sbye`,$$css:!0},dot:{kmuXW:`x2lah0s`,kzqmXN:`x1ftt334`,kZKoxP:`x1ycjhwn`,kaIpWk:`x16rqkct`,kWkggS:`xzkukvh`,$$css:!0},card:{kVAEAm:`x10l6tqk`,kY2c9j:`x1w0boku`,k87sOh:`xn0lweg`,kbCHJM:`x6f9vd5`,kzqmXN:`x1hfn5x7`,kskxy:`x1r4ahda`,kORKVm:`x1odjw0f`,kB7OPa:`x9f619`,k8WAf4:`x1vvogim`,kg3NbH:`xaope02`,kMzoRj:`xmkeg23`,ksu8eU:`x1y0btm7`,kVAM5u:`xgcsv5v`,kaIpWk:`x1q4ynmn`,kWkggS:`x12ilycc`,kGVxlE:`x1d5q07e`,$$css:!0}},sn=120,cn=200,ln=150,un=new Set;function dn(e,t){let[n,r]=(0,H.useState)({key:null,reading:!1});return(0,H.useEffect)(()=>{if(!e)return;let n=()=>{if(e.getRootElement()?.closest(`.history-space-shell[data-immersive]`))return;let n=t[0]?.key??null,i=!1;for(let r of t){let t=r.blockId?Z(e,r.blockId):e.getElementByKey(r.key);t&&t.getBoundingClientRect().top<sn&&(n=r.key,i=!0)}r(e=>e.key===n&&e.reading===i?e:{key:n,reading:i})};return n(),window.addEventListener(`scroll`,n,{passive:!0}),()=>window.removeEventListener(`scroll`,n)},[e,t]),n}function fn(e,t,n){(0,H.useEffect)(()=>{let n=()=>{let n=e.current,r=t.current;if(!n||!r)return;let i=n.getBoundingClientRect(),a=r.getBoundingClientRect();(a.top<i.top||a.bottom>i.bottom)&&(n.scrollTop=Math.max(0,n.scrollTop+a.top-i.top-(n.clientHeight-a.height)/2))};return n(),window.addEventListener(`scroll`,n,{passive:!0}),window.addEventListener(`resize`,n),()=>{window.removeEventListener(`scroll`,n),window.removeEventListener(`resize`,n)}},n)}function pn({editor:e,threads:n=[],variant:r=`column`}){let[a,o]=(0,H.useState)([]),[s,c]=(0,H.useState)(!1),[l,u]=(0,H.useState)(un),d=(0,H.useRef)(void 0),f=(0,H.useRef)(void 0),p=(0,H.useRef)(null),m=(0,H.useRef)(null);(0,H.useEffect)(()=>{if(!e)return;let t=()=>o(e.getEditorState().read(rn));return t(),e.registerUpdateListener(t)},[e]);let h=dn(e,a),g=a.find(e=>e.key===h.key),{scrollTo:_}=en(e,h.reading&&g?.blockId?g.blockId:null),v=(0,H.useMemo)(()=>an(a,n),[a,n]),y=(0,H.useMemo)(()=>on(a),[a]);fn(p,m,[h.key,a]),(0,H.useEffect)(()=>()=>{clearTimeout(d.current),clearTimeout(f.current)},[]);let b=y.find(e=>e.head.key===h.key||e.children.some(e=>e.key===h.key)),x=b?.head.key??null,[S,C]=(0,H.useState)(x),w=e=>u(t=>t.has(e)?t:new Set(t).add(e));S!==x&&(C(x),s&&S&&w(S));let T=()=>{clearTimeout(d.current),c(!0)},E=()=>{clearTimeout(d.current),clearTimeout(f.current),d.current=setTimeout(()=>{c(!1),u(un)},cn)},D=e=>{clearTimeout(f.current),f.current=setTimeout(()=>w(e),ln)},O=t=>{if(t.blockId)return _(t.blockId);let n=e?.getElementByKey(t.key);n&&J(n)};if(r===`hidden`)return null;if(a.length===0)return(0,W.jsx)(`nav`,{"data-variant":r,...i(Q.toc)});let k=r===`rail`,A=e=>y.map(t=>{let{head:n,children:r}=t,a=t===b,o=a||l.has(n.key),c=b?Math.abs(t.index-b.index):0,u=e!==`column`||s||c===0?null:c===1?Q.fadeNear:c<=3?Q.fadeMid:Q.fadeFar,d=(t,n,r,o,s=!1)=>{let c=t.key===h.key,l=e===`card`,d=o?(0,W.jsx)(`span`,{"data-commented":``,...i(Q.dot,e===`ticks`&&Q.tickDot)}):null;return(0,W.jsxs)(`button`,{"aria-current":c&&!l?`location`:void 0,"aria-label":t.text,ref:c&&!l?m:void 0,tabIndex:l?-1:void 0,type:`button`,onClick:()=>O(t),onFocus:s?()=>w(t.key):void 0,onPointerEnter:s?()=>D(t.key):void 0,onPointerLeave:s?()=>clearTimeout(f.current):void 0,...i(e===`ticks`?Q.item:Q.row,e!==`ticks`&&n&&Q.rowNested,!n&&a&&Q.rowCurrent,e!==`ticks`&&c&&Q.rowActive,!n&&u),children:[e===`ticks`?(0,W.jsx)(`span`,{...i(Q.tick,!n&&Q.tickH2,c&&Q.tickActive)}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{...i(Q.rowText),children:t.text}),r>0?(0,W.jsx)(`span`,{...i(Q.count),children:r}):null]}),d]},t.key)},p=!o&&r.some(e=>v.has(e.blockId));return(0,W.jsxs)(H.Fragment,{children:[t.partStart?(0,W.jsx)(`div`,{"aria-hidden":e===`ticks`||void 0,...i(Q.part,t.index===0&&Q.partFirst,u),children:e===`ticks`?null:t.partStart.text}):null,d(n,!1,o?0:r.length,v.has(n.blockId)||p,r.length>0),r.length>0?(0,W.jsx)(`div`,{inert:!o,...i(Q.fold,o&&Q.foldOpen),children:(0,W.jsx)(`div`,{...i(Q.foldRows,o&&Q.foldRowsOpen),children:r.map(e=>d(e,!0,0,v.has(e.blockId)))})}):null]},n.key)});return(0,W.jsxs)(`nav`,{"aria-label":t(`document.toc`),"data-expanded":s?`true`:`false`,"data-variant":r,onFocus:T,onPointerEnter:T,onPointerLeave:E,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||E()},...i(Q.toc,k&&Q.rail),children:[(0,W.jsx)(`div`,{"data-toc-list":``,ref:p,...i(Q.list),children:A(k?`ticks`:`column`)}),k&&s?(0,W.jsx)(`div`,{"data-toc-card":``,ref:e=>{e&&p.current&&(e.scrollTop=p.current.scrollTop)},...i(Q.card),children:A(`card`)}):null]})}var mn=`.rich-table-scrollable-wrapper, .ryugi-mermaid-preview`;function hn(e,t){let n=e.getBoundingClientRect().right;return[...e.querySelectorAll(mn)].map(e=>e.getBoundingClientRect()).filter(e=>e.right>n+1).map(e=>({top:e.top-t,bottom:e.bottom-t}))}var gn=(e,t)=>e.length===t.length&&e.every((e,n)=>e.top===t[n].top&&e.bottom===t[n].bottom);function _n(e,t){let[n,r]=(0,H.useState)([]);return(0,H.useEffect)(()=>{let n=e?.getRootElement();if(!e||!t||!n)return;let i=()=>{let e=t.getBoundingClientRect().top-t.scrollTop,i=hn(n,e);r(e=>gn(e,i)?e:i)};i();let a=0,o=()=>{cancelAnimationFrame(a),a=requestAnimationFrame(i)},s=e.registerUpdateListener(o),c=new ResizeObserver(o);return c.observe(t),c.observe(n),()=>{cancelAnimationFrame(a),s(),c.disconnect()}},[e,t]),n}var vn=56,yn=40;function bn(e,t,n){return n>=e.top&&n<=Math.max(e.bottom,e.top+yn)&&t<=e.right+vn}function xn(e){return Math.max(e.getBoundingClientRect().right,...[...e.querySelectorAll(mn)].map(e=>e.getBoundingClientRect().right))}function Sn(e,t){let n=e.getRootElement(),r=t instanceof Element?t:null;for(;r&&r.parentElement!==n;)r=r.parentElement;return n&&r instanceof HTMLElement?r:null}function Cn(e,t){let n=Sn(e,t);return n?wn(e,n):null}function wn(e,t){return e.read(()=>{for(let n of j().getChildren())if(e.getElementByKey(n.getKey())===t)return A(n,P)||null;return null})}function Tn(e,t,n){let[r,i]=(0,H.useState)(null);return(0,H.useEffect)(()=>{if(!e||!t||!n){i(null);return}let r=0,a=null,o=e=>{e?.element!==a?.element&&(a=e,i(e))},s=()=>{cancelAnimationFrame(r),o(null)},c=t=>{if(cancelAnimationFrame(r),t.pointerType!==`mouse`&&t.pointerType!==`pen`||t.buttons!==0)return o(null);let{target:n,clientX:i,clientY:s}=t;r=requestAnimationFrame(()=>{let t=Sn(e,n);if(t){if(t===a?.element)return;let n=wn(e,t);return o(n?{id:n,element:t}:null)}if(a){let{top:e,bottom:t}=a.element.getBoundingClientRect();if(bn({top:e,bottom:t,right:xn(a.element)},i,s))return}o(null)})};return document.addEventListener(`pointermove`,c),document.addEventListener(`scroll`,s,!0),document.documentElement.addEventListener(`pointerleave`,s),()=>{cancelAnimationFrame(r),document.removeEventListener(`pointermove`,c),document.removeEventListener(`scroll`,s,!0),document.documentElement.removeEventListener(`pointerleave`,s)}},[e,t,n]),(0,H.useMemo)(()=>{if(!r||!t||!n||!r.element.isConnected)return null;let e=r.element.getBoundingClientRect(),i=t.getBoundingClientRect(),a=document.createRange();return a.selectNodeContents(r.element),{kind:`block`,blockId:r.id,quote:``,elements:[r.element],range:a,left:e.left-i.left,right:xn(r.element)-i.left,top:e.top-i.top,bottom:e.bottom-i.top}},[r,t,n])}var En=80,Dn=240,On=e=>{let t=/matrix\(([^)]+)\)/.exec(getComputedStyle(e).transform);return t?Number(t[1].split(`,`)[4]):0};function kn(e,t){let n=t.offsetLeft,r=null,i=()=>{let i=n-t.offsetLeft;if(n=t.offsetLeft,!i||z()||!r&&Math.abs(i)<En)return;let a=i+(r?On(t):0),o={duration:Dn,easing:Ye};if(r)r.cancel();else for(let n of e.children)n!==t&&Je(n,[{opacity:0},{opacity:1}],o);let s=t.animate([{transform:`translateX(${a}px)`},{transform:`none`}],o);r=s,s.finished.then(()=>{r===s&&(r=null)},()=>void 0)},a=new ResizeObserver(i);return a.observe(e),{settle:i,stop:()=>a.disconnect()}}function An({editor:e,threads:t,actions:n,agent:r,diagram:i,onMain:a,overlay:o,history:s,shareBase:c,children:l}){let[u,d]=(0,H.useState)(null),[f,p]=(0,H.useState)(null),[m,h]=(0,H.useState)(null),[g,_]=(0,H.useState)(null),v=(0,H.useCallback)(e=>{_(e),a?.(e)},[a]),y=(0,H.useRef)(null);(0,H.useEffect)(()=>{if(!g||!m)return;let e=kn(g,m);return y.current=e,()=>{y.current=null,e.stop()}},[g,m]);let b=Ke(`(max-width: 1100px)`),x=!Ke(`(max-width: 1480px)`),S=b?`hidden`:x?`column`:`rail`,[C,w]=(0,H.useState)(0),T=Dt(e,t,u,C),E=(0,H.useMemo)(()=>i&&e&&!s?{threads:t,activeId:f,draft:i.draft,pick:i.pick,readOnly:i.readOnly,blockAction:i.blockAction,viewer:{actions:n,agent:r,create:i.create,drafts:i.drafts},activate:p,marked:()=>w(e=>e+1),blockIdOf:t=>Cn(e,t)}:null,[i,e,s,t,f,n,r]),D=_n(e,b||s?null:u);return Ot(T,t,f),(0,H.useLayoutEffect)(()=>y.current?.settle(),[S]),(0,W.jsxs)(`main`,{ref:v,...{0:{className:`x1n2onr6 xrvj5dj xc94fvo xl56j7k xwaa2ar x13zrc24 x1ffnkcp x4l9tsp`},2:{className:`x1n2onr6 xrvj5dj xl56j7k xwaa2ar x13zrc24 x1ffnkcp x4l9tsp xoiau2f`},1:{className:`x1n2onr6 xc94fvo xl56j7k xwaa2ar x13zrc24 x1ffnkcp x78zum5 xdt5ytf x1qjc9v5 x17qtykl`},3:{className:`x1n2onr6 xl56j7k xwaa2ar x13zrc24 x1ffnkcp xoiau2f x78zum5 xdt5ytf x1qjc9v5 x17qtykl`}}[(S===`rail`)<<1|!!b],children:[(0,W.jsx)(`div`,{className:`history-space-toc`,inert:!!s?.immersive,children:(0,W.jsx)(pn,{editor:e,threads:t,variant:S})}),e?(0,W.jsx)(Jt,{editor:e,shareBase:c}):null,(0,W.jsxs)(`article`,{ref:h,className:`x1n2onr6 x1vjfegm xh8yej3 xrgej4m xeuugli`,style:b?{marginInline:`auto`}:s?void 0:{"--ryugi-table-bleed":`368px`},onClick:e=>p(At(T,e.clientX,e.clientY)),children:[(0,W.jsx)(lt,{}),(0,W.jsx)(Le,{value:E,children:(0,W.jsx)(Xt,{history:s,children:l})}),s?null:(0,W.jsx)(Lt,{activeId:f,anchors:T,container:m,threads:t})]}),(0,W.jsx)(`div`,{className:`x1n2onr6`,className:`history-space-comments ${{className:`x1n2onr6`}.className??``}`,inert:!!s?.immersive,children:(0,W.jsx)(Zt,{history:s?.immersive?null:s,children:(0,W.jsx)(It,{actions:n,activeId:f,agent:r,anchors:T,blocked:D,narrow:b,railRef:d,threads:t,onActivate:p})})}),m&&o&&!s?o(m):null]})}function jn({left:e,top:n,quote:r,wholeBlock:i,initial:a,restored:o,leaving:s,onChange:c,onSubmit:l,onCancel:u,ref:d}){return(0,W.jsx)(`div`,{ref:d,...{0:{className:`x10l6tqk x1u8a7rm xj6ak53 xowlrko xllfotl xatqbsq x1u6ievf`},1:{className:`x10l6tqk x1u8a7rm xj6ak53 x1u6ievf xxp0q0x x12l1aco xn0cd8s x47corl`}}[!!s|0],style:{left:e,top:n},children:(0,W.jsxs)(_e,{active:!0,children:[(0,W.jsxs)(`div`,{className:`x78zum5 x1pha0wt x167g77z xz9dl7a x1hr3lfm xqfszdh x1j6dyjg`,children:[(0,W.jsx)(`span`,{className:`x98rzlu xeuugli xb3r6kr xuxw1ft xlyipyv xddlp02`,children:i?r:`“${r}”`}),o?(0,W.jsx)(`span`,{className:`x2lah0s x7zghnd`,children:t(`document.draftRestored`)}):null]}),(0,W.jsx)(ze,{autoFocus:!0,initial:a,placeholder:t(`document.draftPlaceholder`),onCancel:u,onChange:c,onSubmit:l})]})})}function Mn(e){let t=(0,H.useMemo)(me,[]),[n,r]=(0,H.useState)(null),[i,a]=(0,H.useState)(!1),o=(0,H.useRef)(``),s=(0,H.useRef)(0),c=(0,H.useRef)(null),l=(0,H.useRef)(null);kt(i?null:n?.target.range??null,i?void 0:n?.target.elements);let u=(0,H.useCallback)(n=>{window.clearTimeout(s.current);let i=t.take(M(n.blockId,n.quote,n.blockIds,n.textRanges,n.diagram));o.current=i,a(!1),r({target:n,initial:i}),window.getSelection()?.removeAllRanges(),e()},[t,e]),d=(0,H.useCallback)(e=>{n&&(t.save(M(n.target.blockId,n.target.quote,n.target.blockIds,n.target.textRanges,n.target.diagram),e?o.current:``),a(!0),s.current=window.setTimeout(()=>{r(null),a(!1)},120))},[n,t]);return(0,H.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,H.useEffect)(()=>()=>window.clearTimeout(s.current),[]),{drafts:t,draft:n,leaving:i,restored:!!n?.initial,open:u,close:d,onText:e=>{o.current=e},panelRef:c,toolbarRef:l}}var Nn=46;function Pn(e,t){return Math.min(e+8,window.innerWidth-(t.offsetParent?.getBoundingClientRect().left??0)-40)}function Fn({article:e,editor:t,enabled:n,onComment:r}){let i=Tn(t,e.closest(`main`),n);return i?(0,W.jsx)(ue,{left:Pn(i.right,e),top:i.top,onComment:()=>r(i)}):null}function In({blockId:e,element:t,node:n,host:r}){let i=r.closest(`main`);if(!i)return null;let a=n.getBoundingClientRect(),o=i.getBoundingClientRect(),s=document.createRange();return s.setStart(r,0),{blockId:e,quote:t.label,diagram:t.target,range:s,left:a.left-o.left,right:a.right-o.left,top:a.top-o.top,bottom:a.bottom-o.top}}function Ln(e){return{left:e.offsetLeft,right:Math.min(e.offsetLeft+e.offsetWidth,window.innerWidth-16)}}function Rn({editor:e,threads:t,actions:n,agent:r,canComment:i,canCommentDiagram:a=i,selection:o,clearSelection:s,resolveSelection:c,onCreate:l,onMain:u,onToolbar:d,history:f,shareBase:p,children:m}){let h=Mn(s),{draft:g,open:_}=h,[v,y]=(0,H.useState)(null),[b,x]=(0,H.useState)(0);(0,H.useLayoutEffect)(()=>{if(!v||f)return;let t=()=>{let t=v.querySelector(`.ryugi-editor-toolbar`);t?x(t.getBoundingClientRect().height):e?.isEditable()||x(0)};t();let n=new MutationObserver(t);return n.observe(v,{childList:!0}),()=>n.disconnect()},[v,f,e]),(0,H.useEffect)(()=>{if(!v||!d)return;let e=()=>d(v.querySelector(`.ryugi-editor-toolbar, .history-bar`)!==null);e();let t=new MutationObserver(e);return t.observe(v,{childList:!0}),()=>{t.disconnect(),d(!1)}},[v,d]);let S=h.leaving?null:g?.target??null,{drafts:C}=h,w=(0,H.useMemo)(()=>({draft:S,drafts:C,readOnly:!a,blockAction:i,pick:e=>{let t=In(e);t&&_(t)},create:(e,t)=>l({...e,range:document.createRange(),left:0,right:0,top:0,bottom:0},t)}),[i,a,S,C,_,l]),T=(0,H.useCallback)(()=>{let e=window.getSelection();navigator.clipboard?.writeText(e?.toString()??``),e?.removeAllRanges(),s()},[s]),E=(0,H.useMemo)(()=>({toolbarSlot:v,selectionActions:g?null:(0,W.jsx)(pe,{onCopy:T,onComment:i?()=>{let e=c();e&&_(e)}:void 0})}),[v,g,i,c,_,T]);return(0,W.jsxs)(Ie,{value:E,children:[(0,W.jsx)(`div`,{className:`ryugi-editor-toolbar-slot`,ref:y,children:b>0?(0,W.jsx)(`div`,{"aria-hidden":`true`,className:`history-toolbar-space`,style:{height:b}}):null}),(0,W.jsx)(An,{actions:n,agent:r,diagram:w,editor:e,history:f,shareBase:p,threads:t,overlay:t=>(0,W.jsxs)(W.Fragment,{children:[o&&!g&&o.kind===`block`&&i?(0,W.jsx)(ue,{left:Pn(o.right,t),ref:h.toolbarRef,top:o.top,onComment:()=>h.open(o)}):null,(0,W.jsx)(Fn,{article:t,editor:e,enabled:i&&!g&&!o,onComment:h.open}),o&&!g&&o.kind===`nested`?(0,W.jsx)(ge,{left:o.left,ref:h.toolbarRef,top:Math.max(o.top-Nn,0),children:(0,W.jsx)(pe,{onComment:i?()=>h.open(o):void 0,onCopy:T})}):null,g?(0,W.jsx)(jn,{ref:h.panelRef,...bt(g.target,Ln(t),340,8),initial:g.initial,leaving:h.leaving,quote:je(g.target),restored:h.restored,wholeBlock:g.target.kind===`block`,onCancel:()=>h.close(!0),onChange:h.onText,onSubmit:e=>l(g.target,e).then(e=>(e&&h.close(!1),e))},M(g.target.blockId,g.target.quote,g.target.blockIds,g.target.textRanges,g.target.diagram)):null]}),onMain:u,children:m})]})}function zn(e){let t=ee(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}function Bn({text:e}){let t=(0,H.useRef)(null),n=(0,H.useRef)(null);return(0,H.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,W.jsx)(`template`,{suppressHydrationWarning:!0,"data-rich-comment-anchor":``,ref:t})}var $=e=>`${ye[e]} ${R[e]}`,Vn={h1:$(`headingH1`),h2:$(`headingH2`),h3:$(`headingH3`),h4:$(`headingH4`),h5:$(`headingH5`),h6:$(`headingH6`)};function Hn(e){return e.toLowerCase().trim().replaceAll(/[^\s\w\u3000-\u9FFF\uAC00-\uD7AF\uFF00-\uFFEF-]/g,``).replaceAll(/[\s_]+/g,`-`).replaceAll(/^-+|-+$/g,``)}function Un(e){return e.type===`comment`?``:e.text?e.text:e.children?e.children.map(Un).join(``):``}var Wn=/^["'«‘“‹「『"']/,Gn=/["'»’”›」』"']$/;function Kn(e,t,n,r,i,a){switch(e.type){case`root`:return(0,W.jsx)(W.Fragment,{children:n});case`paragraph`:{let r=e.format?{textAlign:e.format}:void 0;return(0,W.jsx)(`p`,{className:$(`paragraph`),style:r,children:n??(0,W.jsx)(`br`,{})},t)}case`heading`:{let o=e.tag,s=Hn(i||Un(e)),c=a??s;if(a===void 0&&s){let e=r.get(s);e===void 0?r.set(s,1):(c=`${s}-${e}`,r.set(s,e+1))}return(0,W.jsxs)(o,{className:Vn[o],id:c||void 0,children:[c&&(0,W.jsx)(`a`,{className:$(`headingAnchor`),href:`#${c}`,tabIndex:0,children:(0,W.jsx)(_,{"aria-hidden":!0,size:14,strokeWidth:2})}),n]},t)}case`rich-quote`:case`quote`:{let r=(i||Un(e)).trim(),a=Wn.test(r),o=Gn.test(r),s=e.attribution;return(0,W.jsxs)(`blockquote`,{className:$(`quote`),"data-no-close-quote":o?``:void 0,"data-no-open-quote":a?``:void 0,children:[n,s&&(0,W.jsxs)(`footer`,{className:$(`quoteAttribution`),children:[`— `,s]})]},t)}case`list`:{let r=e.listType===`number`?`ol`:`ul`,i=e.listType===`number`?$(`listOl`):e.listType===`check`?`${$(`checklist`)} ${$(`listUl`)}`:$(`listUl`);return(0,W.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?$(`listNestedItem`):r?e.checked?`${$(`listItem`)} ${$(`listItemChecked`)}`:`${$(`listItem`)} ${$(`listItemUnchecked`)}`:$(`listItem`),(0,W.jsx)(`li`,{className:o,value:a,children:n},t)}case`link`:return(0,W.jsxs)(`a`,{className:$(`link`),href:e.url,rel:e.rel||`noopener`,target:e.target||`_blank`,children:[(0,W.jsx)(ve,{href:e.url}),n]},t);case`autolink`:return(0,W.jsxs)(`a`,{className:$(`link`),href:e.url,rel:`noopener`,target:`_blank`,children:[(0,W.jsx)(ve,{href:e.url}),n]},t);case`horizontalrule`:return(0,W.jsx)(`hr`,{className:$(`hr`)},t);case`table`:return(0,W.jsx)(`div`,{className:$(`tableScrollableWrapper`),children:(0,W.jsx)(`table`,{className:$(`table`),children:n})},t);case`tablerow`:return(0,W.jsx)(`tr`,{children:n},t);case`tablecell`:{let r=e.headerState?`th`:`td`,i=e.headerState?$(`tableCellHeader`):$(`tableCell`);return(0,W.jsx)(r,{className:i,colSpan:e.colSpan>1?e.colSpan:void 0,children:n},t)}case`details`:{let r=e.summary||``;return(0,W.jsxs)(`details`,{className:`${L.details} ${F.details}`,open:e.open||void 0,children:[(0,W.jsxs)(`summary`,{className:`${L.summary} ${F.summary}`,children:[(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`${L.chevron} ${F.chevron}`,children:(0,W.jsx)(`svg`,{fill:`none`,height:`20`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,viewBox:`0 0 20 20`,width:`20`,children:(0,W.jsx)(`path`,{d:`M8 6L12 10L8 14`})})}),(0,W.jsx)(`span`,{className:`${L.summaryText} ${F.summaryText}`,children:r})]}),(0,W.jsx)(`div`,{className:`${L.content} ${F.content}`,children:n})]},t)}case`spoiler`:return(0,W.jsx)(`span`,{className:$(`spoiler`),role:`button`,tabIndex:0,children:n},t);case`tag`:return(0,W.jsx)(`span`,{className:$(`tag`),style:{backgroundColor:Ne(e.text)},children:e.text},t);case`comment`:return(0,W.jsx)(Bn,{text:e.text??``},t);case`ruby`:return(0,H.createElement)(Te,{key:t,rendererKey:`Ruby`,defaultRenderer:De,props:{reading:e.reading??``,children:n}});case`code`:return(0,W.jsx)(`pre`,{className:`rich-code-block`,children:(0,W.jsx)(`code`,{children:n})},t);case`code-highlight`:return(0,W.jsx)(`span`,{children:e.text},t);case`linebreak`:return(0,W.jsx)(`br`,{},t);case`tab`:return(0,W.jsx)(`span`,{children:` `},t);default:return null}}var qn=e=>`${ye[e]} ${R[e]}`,Jn=[[1,`textBold`],[2,`textItalic`],[4,`textStrikethrough`],[8,`textUnderline`],[16,`textCode`],[32,`textSubscript`],[64,`textSuperscript`],[128,`textHighlight`]];function Yn(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 Xn(e,t){let n=e.text,r=e.format||0;for(let[e,i]of Jn)r&e&&(n=(0,W.jsx)(`span`,{className:qn(i),children:n},`${t}-${e}`));return e.style&&(n=(0,W.jsx)(`span`,{style:Yn(e.style),children:n},t)),n}function Zn(e,t=!1){let n=[],r=t?e.findIndex(e=>e.type===`paragraph`):-1,i=e=>e.type===`image`&&typeof e.layout==`string`&&e.layout.startsWith(`float-`);for(let t=0;t<e.length;t++){let a=[t];if(t===r&&t+1<e.length&&a.push(++t),i(e[t]))for(;++t<e.length;){a.push(t);let n=e[t];if(!i(n)&&![`paragraph`,`list`,`quote`,`rich-quote`,`comment`].includes(n.type))break}n.push(a)}let a=[];for(let t of n)a.length&&t.every(t=>e[t].type===`comment`)||a.at(-1)?.every(t=>e[t].type===`comment`)?a.at(-1).push(...t):a.push(t);return a}function Qn(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 $n=e=>`${ye.alert} ${R.alert} rich-alert-${e}`;function er(e,t,n){switch(e.type){case`alert-quote`:return(0,H.createElement)(`div`,{key:t,className:$n(e.alertType)},n);case`banner`:return(0,H.createElement)(`div`,{key:t,className:`rich-banner rich-banner-${e.bannerType}`},n);case`grid-container`:return(0,H.createElement)(`div`,{key:t,className:`${Me.container} ${Ee.container}`},n);default:return(0,H.isValidElement)(n)?(0,H.cloneElement)(n,{key:t}):n}}function tr(e,t,n){return(0,H.isValidElement)(e)&&typeof e.type==`string`?(0,H.cloneElement)(e,{"data-block-id":t}):(0,W.jsx)(`div`,{className:`rich-block-anchor`,"data-block-id":t,children:e},`${n}-block-anchor`)}function nr(e,t,n,r){return t?(r.blockAnchor??tr)(e,t,n):e}function rr(e,t,n,r,i,a,o){let s=o.recycleKeys?i:e.getKey?e.getKey():i,c=o.headingIds?.get(e.getKey?.()),{builtinNodeOverrides:l}=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=l?.[t.type];return nr(n?n(t,s,[r],()=>er(t,s,r)):er(t,s,r),a,s,o)}}let u=e.exportJSON?e.exportJSON():{};if(u.type===`text`){let e=l?.text;return e?e(u,s,null,()=>Xn(u,s)):Xn(u,s)}let d=typeof e.getChildren==`function`?e.getChildren():[];Array.isArray(u.children)&&u.children.length===0&&d.length>0&&(u.children=d.map(e=>({type:typeof e.getType==`function`?e.getType():e.__type})));let f=null;d.length>0&&(f=d.map((e,i)=>rr(e,t,n,r,`${s}-${i}`,void 0,o)));let p=e.getTextContent?e.getTextContent():void 0,m=l?.[u.type];return nr(m?m(u,s,f,()=>Kn(u,s,f,r,p,c)):Kn(u,s,f,r,p,c),a,s,o)}function ir(e,t,n,r){let i=zn({nodes:t,theme:I,editable:!1,onError:e=>{console.error(`[RichRenderer]`,e)}}),a={namespace:`ssr`,theme:I},o=he(e),s=i.parseEditorState(o);i.setEditorState(s);let c=Qn(o),l=o.root?.children,u=new Map,d=new Map,f=new Map,p=s.read(()=>{let e=new Map,t=(n,r,i)=>{if(f.set(n.getKey(),i),n.getType()===`heading`){let t=Hn(n.getTextContent()),i=e.get(t)??0,a=t?`${t}${i?`-${i}`:``}`:``;e.set(t,i+1),u.set(n.getKey(),a),a&&d.set(a,r)}te(n)&&n.getChildren().forEach((e,n)=>t(e,r,`${i}.${n}`))},n=j().getChildren();return n.forEach((e,n)=>t(e,n,`${n}:0`)),n}),m=new Set,h=p.map((e,t)=>{let n=l?.[t]??{type:e.getType(),version:1},r=n.$?.blockId??`renderer-${t}`;for(;m.has(r);)r=`${r}:${t}`;return m.add(r),{id:r,data:n,index:t,pool:`${n.type}:${n.type===`dynamic`?n.url:n.tag??``}`}}),g=Zn(h.map(e=>e.data),r),_=new Map,v=g.map((e,t)=>{let n=e.map(e=>(_.set(e,t),h[e])),r=n[0];return{blocks:n,id:r.id,data:n.length===1?r.data:{type:`flow-group`,version:1,children:n.map(e=>e.data)},pool:n.length===1?r.pool:`flow-group`}});for(let[e,t]of d)d.set(e,_.get(t));let y=(e,t)=>s.read(()=>{let r=v[e];return r?(0,W.jsx)(H.Fragment,{children:r.blocks.map((e,r)=>rr(p[e.index],i,a,new Map,t===void 0?`ssr-${e.index}`:`recycler-${t}-${r}`,l?.[e.index]?.$?.blockId,{...n,headingIds:u,recycleKeys:t!==void 0}))},t===void 0?r.id:`recycler-${t}`):null}),b;return{document:{editor:i,rows:v,headingRows:d,render:y,renderAll:()=>b??=(0,W.jsx)(W.Fragment,{children:v.map((e,t)=>y(t))}),nodePath:e=>e?f.get(e)??e:`0`},footnoteData:c,renderNestedContent:e=>{let r=zn({nodes:t,theme:I,editable:!1,onError:e=>{console.error(`[RichRenderer:nested]`,e)}}),i={namespace:`ssr-nested`,theme:I},a=he(e),o=r.parseEditorState(a);r.setEditorState(o);let s=null,c=a.root?.children;return o.read(()=>{let e=j(),t=new Map,a=e.getChildren().map((e,a)=>rr(e,r,i,t,`nested-${a}`,c?.[a]?.$?.blockId,n));s=(0,W.jsx)(W.Fragment,{children:a})}),s}}}function ar({document:e}){return e.renderAll()}function or({value:e,variant:t=`article`,theme:n,className:r,style:i,as:a=`div`,nested:o=!1,rendererConfig:s,extraNodes:c,builtinNodeOverrides:l,blockAnchor:u,surface:d,virtualization:f}){let p=we(t),m=xe(),{document:h,footnoteData:g,renderNestedContent:_}=(0,H.useMemo)(()=>ir(e,c?[...Ce,...c]:Ce,{blockAnchor:u,builtinNodeOverrides:l},t===`note`),[u,l,c,e,t]),{scrollContainer:v,overscan:y,estimateBlockHeight:b,preserveCapacity:x}=typeof f==`object`?f:{},S=!!f,C=f===!1,T=(0,H.useMemo)(()=>C?ar:S?Ve({scrollContainer:v,overscan:y,estimateBlockHeight:b,preserveCapacity:x}):d??ar,[d,S,C,v,y,b,x]),E=[`rich-content`,p,r].filter(Boolean).join(` `),D=typeof a==`string`?{suppressHydrationWarning:!0,className:E,"data-rich-nested":o?`true`:void 0,"data-theme":n}:{},O=n??`light`;return(0,W.jsx)(w,{className:p,theme:O,children:(0,W.jsx)(ie,{colorScheme:O,children:(0,W.jsx)(ke,{config:s,mode:`renderer`,variant:t,children:(0,W.jsx)(Se,{definitions:g.definitions,displayNumberMap:g.displayNumberMap,children:(0,W.jsx)(be,{value:m??_,children:(0,W.jsx)(a,{...D,style:i,children:(0,W.jsx)(T,{document:h})})})})})})})}var sr=/^claude-(opus|sonnet|haiku|fable)-(\d+)-(\d+)(?:\[[^\]]*\])?$/;function cr(e){let t=sr.exec(e);if(!t)return e;let[,n,r,i]=t;return`${n[0].toUpperCase()}${n.slice(1)} ${r}.${i}`}var lr=16,ur={content:{"--lobe-popover-viewport-inline-padding":`4px`}},dr=4,fr=(e,n)=>e.kind===`human`&&e.name===n?t(`common.you`):e.name;function pr({contributor:e,stacked:t=!1}){let[n,r]=(0,H.useState)(!1),i=e.kind===`agent`?He(e.name):void 0,a=i?Ue[i]:void 0;return(0,W.jsx)(`span`,{"data-byline-face":``,...{0:{className:`xrvj5dj x1ku5rj1 x2lah0s x1kky2od xlup9mm x16rqkct xb3r6kr x7em3ua x15dg6x3 x1bo0w0s xvwhms9 x1s688f`},1:{className:`xrvj5dj x1ku5rj1 x2lah0s x1kky2od xlup9mm x16rqkct xb3r6kr x7em3ua x15dg6x3 x1bo0w0s xvwhms9 x1s688f x165d6jo`}}[!!t|0],children:a?(0,W.jsx)(a.Avatar,{shape:`circle`,size:lr}):e.avatar&&!n?(0,W.jsx)(`img`,{alt:``,src:e.avatar,onError:()=>r(!0),className:`x1kky2od xlup9mm xl1xv1r`}):[...e.name][0]?.toUpperCase()})}function mr({contributors:e,me:n,now:r}){return(0,W.jsx)(`div`,{className:`x78zum5 xdt5ytf x1u2d2a2 xxc7z9f`,children:e.map(e=>(0,W.jsxs)(`div`,{"data-contributor":``,className:`xrvj5dj x1g3yg12 x6s0dn4 x167g77z x1t0vds8 xdqyycr x1ct8sxb x178xt8z x1g31smg x13fuv20 xxu5053`,children:[(0,W.jsx)(pr,{contributor:e}),(0,W.jsx)(`span`,{className:`xo2rkog xb3r6kr xlyipyv xuxw1ft`,children:[fr(e,n),e.models.map(cr).join(` / `)].filter(Boolean).join(` · `)}),(0,W.jsxs)(`span`,{className:`xddlp02 x1qt5hsa xss6m8b xuxw1ft`,children:[t(`document.byline.edits`,{count:e.edits}),` ·`,` `,qe(e.lastAt*1e3,r)]})]},e.kind+e.name))})}function hr({byline:e,me:n,now:r}){let{contributors:i,last:a}=e;if(!i.length)return null;let o=i.length===1?fr(i[0],n):t(`document.byline.authors`,{count:i.length});return(0,W.jsx)(Re,{content:(0,W.jsx)(mr,{contributors:i,me:n,now:r}),placement:`bottomLeft`,styles:ur,trigger:`hover`,children:(0,W.jsxs)(`button`,{"data-byline":``,type:`button`,className:`x3nfvp2 x6s0dn4 x17d4w8g x193iq5w xxk0z11 x14oi46j x165d6jo xc342km x1kogg8i xjbqb8w x9jwiqo xddlp02 xln7xf2 x1ct8sxb xuxw1ft xt0e3qv`,children:[(0,W.jsx)(`span`,{className:`x3nfvp2 x2lah0s`,children:i.slice(0,dr).map((e,t)=>(0,W.jsx)(pr,{contributor:e,stacked:t>0},e.kind+e.name))}),(0,W.jsx)(`span`,{className:`x1bo0w0s xk50ysn`,children:o}),a?(0,W.jsxs)(`span`,{children:[`·`,` `,t(`document.byline.edited`,{name:fr(a,n),time:qe(a.at*1e3,r)})]}):null]})})}var gr=32,_r=6e4;function vr({editor:e,byline:t,me:n}){let[r,i]=(0,H.useState)(null),[a,o]=(0,H.useState)(Date.now);(0,H.useEffect)(()=>{o(Date.now());let e=setInterval(()=>o(Date.now()),_r);return()=>clearInterval(e)},[t]);let s=t.contributors.length>0;return(0,H.useLayoutEffect)(()=>{let t=null,n=()=>{t=e.getRootElement();let n=t?.offsetParent;if(!t||!(n instanceof HTMLElement)||!s){t&&delete t.dataset.byline,i(null);return}let r=t.firstElementChild,a=r instanceof HTMLElement&&r.tagName===`H1`?r:null;t.dataset.byline=a?`title`:`top`;let o=n.getBoundingClientRect(),c=(a??t).getBoundingClientRect(),l=a?c.bottom+4:c.top-gr;i(e=>{let t={host:n,left:c.left-o.left,top:l-o.top};return e?.host===t.host&&e.left===t.left&&e.top===t.top?e:t})};n();let r=new ResizeObserver(n),a=e.getRootElement();a&&r.observe(a);let o=e.registerUpdateListener(()=>requestAnimationFrame(n));return window.addEventListener(`resize`,n),()=>{r.disconnect(),o(),window.removeEventListener(`resize`,n),t&&delete t.dataset.byline}},[e,s]),r?(0,U.createPortal)((0,W.jsx)(`div`,{style:{position:`absolute`,zIndex:1,left:r.left,top:r.top,whiteSpace:`nowrap`},onMouseMove:e=>e.stopPropagation(),onPointerMove:e=>e.stopPropagation(),children:(0,W.jsx)(hr,{byline:t,me:n,now:a})}),r.host):null}function yr({error:e,onDismiss:n}){return e?(0,U.createPortal)((0,W.jsxs)(`div`,{role:`alert`,className:`xixxii4 xy58vm5 xvf9o5y xvueqy4 xeq5yr9 x27kpxv x11uqc5h x78zum5 x6s0dn4 x1v2ro7d x10dr8xq x1hr3lfm xur7f20 xmkeg23 x1y0btm7 xgcsv5v x1rozbrz xo2rkog xqfszdh x4z9k3i x1pzk2i8`,children:[(0,W.jsx)(`span`,{children:t(`documentExport.failed`)}),(0,W.jsx)(`button`,{"aria-label":t(`common.close`),type:`button`,onClick:n,className:`xrvj5dj x1ku5rj1 xjbqb8w x1bo0w0s xc342km xgd8bvy x1fgtraw x1717udv x1ypdohk x2lah0s`,children:(0,W.jsx)(S,{size:16})})]}),document.body):null}var br={[Oe]:se,[Pe]:oe,[Ae]:Fe},xr={claude:`Claude Code`,codex:`Codex`},Sr=e=>String(e).padStart(2,`0`);function Cr(e){let t=new Date(e);return`${t.getMonth()+1}/${t.getDate()} ${Sr(t.getHours())}:${Sr(t.getMinutes())}`}function wr({prompt:e,empty:n,theme:r}){let i=(0,H.useRef)(null),[a,o]=(0,H.useState)(!1),[s,c]=(0,H.useState)(!1);return(0,H.useLayoutEffect)(()=>{let e=i.current;e&&!a&&c(e.scrollHeight>e.clientHeight+1)},[a,e]),(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`aside`,{"aria-label":t(`document.promptLabel`),"data-ryugi-no-comment":``,"data-task-prompt":``,className:`x8o32fp x1onr9mi xyumdvf x1t7ytsu x1awn4rw x1hx0egp`,children:[(0,W.jsxs)(`p`,{className:`x78zum5 x6s0dn4 x17d4w8g x1ghz6dp xddlp02 x1qt5hsa xd4r4e8`,children:[(0,W.jsx)(ot,{"aria-hidden":`true`,size:12}),t(`document.promptMeta`,{time:Cr(e.at),agent:xr[e.harness]??e.harness})]}),(0,W.jsx)(`div`,{"data-task-prompt-body":``,ref:i,...{0:{className:`x1gslohp x1bo0w0s xif65rj x11m8ghp xb3r6kr`},1:{className:`x1gslohp x1bo0w0s xif65rj x11m8ghp xb3r6kr x1n19c2o`}}[!a|0],children:(0,W.jsx)(or,{rendererConfig:br,theme:r,value:e.state,variant:`comment`})}),(s||a)&&(0,W.jsx)(`button`,{"aria-expanded":a,type:`button`,onClick:()=>o(e=>!e),className:`x1gslohp x1717udv xc342km xjbqb8w xddlp02 x12rs2w1 xjb2p0i xfifm61 x1bvjpef xrys4gj x1ypdohk`,children:t(a?`document.promptCollapse`:`document.promptExpand`)})]}),n&&(0,W.jsx)(`p`,{className:`x103tiuj xddlp02 x2ouz8m`,children:t(`document.promptEmpty`)})]})}var Tr=[`wheel`,`touchmove`,`keydown`,`pointerdown`];function Er(e){return e.getEditorState().read(()=>j().getChildren().map(e=>({id:A(e,P),key:e.getKey()}))).flatMap(({id:t,key:n})=>{let r=t?e.getElementByKey(n):null;return r?[{id:t,element:r}]:[]})}function Dr(e,t){if(t.kind!==`document`)return!1;let n=Er(e).find(({id:e})=>e===t.blockId);if(!n)return!1;let r=n.element.getBoundingClientRect().top-t.top;return r!==0&&window.scrollBy({top:r,behavior:`instant`}),!0}function Or(e){(0,H.useEffect)(()=>{if(!e)return;let t=h({read(){let t=null;for(let{id:n,element:r}of Er(e)){let{top:e,bottom:i}=r.getBoundingClientRect();if(!(i<=0)){if(e>=0&&e<window.innerHeight)return{kind:`document`,blockId:n,top:e};if(t??={kind:`document`,blockId:n,top:e},e>=0)break}}return t},apply:t=>Dr(e,t)}),n=()=>{let t=v();t&&Dr(e,t)};n();let r=e.registerUpdateListener(n);for(let e of Tr)window.addEventListener(e,m,{passive:!0});return()=>{t(),r();for(let e of Tr)window.removeEventListener(e,m)}},[e])}var kr=e=>`${B(e)}:${Qe(e)}`;async function Ar(e,t){let n=new Map;for(let t of $e(e))et(t)&&n.set(kr(t),t);let r=await Promise.all([...n].map(async([e,n])=>[e,await t(n).catch(()=>void 0)])),i={};for(let[e,t]of r)t&&(i[e]=t);return i}function jr(e){let t=structuredClone({...e,comments:e.comments??We()}),n=t=>{if(!t||t.startsWith(`#`))return t;try{return new URL(t,e.contentBase||e.sourceUrl).href}catch{return t}},r=e=>{if(!e||typeof e!=`object`)return;let t=e;if(typeof t.type==`string`){for(let e of[`src`,`poster`,`favicon`,`image`])typeof t[e]==`string`&&(t[e]=n(t[e]));if((t.type===`link`||t.type===`autolink`||t.type===`link-card`)&&typeof t.url==`string`&&(t.url=n(t.url)),t.type===`excalidraw`&&typeof t.snapshot==`string`){let[e=``,...r]=t.snapshot.split(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./printDocument-DTucYRWz.js","./rolldown-runtime-XKyaHtl9.js","./react-DlmbjZJV.js","./route-C7yP-PEQ.js","./bem-vbke-3KC.js","./jsx-runtime-LKYXHABd.js","./types-BCsOeYI6.js","./index2.css","./shims-s-YVfIlz.js","./editor-BA7mo2fo.js","./url-CCmcoMys.js","./useLayerZIndex-xDNOdXYr.js","./MotionConfigContext-HC2vqcJO.js","./is-html-element-DvgHo_1h.js","./WhiteboardEditor-DrHOvXez-BewOBKRS.js","./Popover-D8lFLEo-.js","./chevron-right-xNdXLJg6.js","./stringifyLocale-D0juOOnH.js","./code-DnmQyGiF.js","./SelectScrollUpArrow-BbJtTBmP.js","./zoom-out-DsmGFv1v.js","./text-align-start-CRhecbJR.js","./ruler-CYb0HZGT.js","./maximize-2-Bc0lXBg6.js","./mouse-pointer-2-B-OF_fcG.js","./undo-2-B-JiyKIl.js","./plus-DZJ2BVkK.js","./MenuSubmenuTrigger-B1GRjbbe.js","./index3.css","./Tooltip-Cd3a5ILg.js","./pen-tool-BfwjhXQW.js","./underline-CT_nGhA9.js","./external-link-D382oEvK.js","./table-2-D90vZ04E.js","./message-square-Yl8PoPy_.js","./presentation-DXrcAbwM.js","./ThreadView-ChVeZPH-.js","./comments-DUAz1Q9X.js","./stable-DU_-8Jo1.js","./icons-CaBMvHC2.js","./index5.css","./search-DTrfkTpJ.js","./sliders-horizontal-CuS3-UwA.js","./upload-DffL3XsM.js","./video-DKoRqEZW.js","./agentLook-B5foAwJ4.js","./DotGrid-DKKr_PyM.js","./rounds-BLj-tfMG.js","./useMedia-CFebB4XU.js","./BottomSheet-IPyTloz4.js","./motion-Cy65kd7X.js","./preference-oNdcNeml.js","./ref-Cv0JhjU5.js","./useSandboxFrame-CJmSnwgG.js","./index4.css","./dist-Dow23TfB.js","./katex-DuZJ-tFh.js","./ArtifactModal-C5mrDL4r.js","./SplitFrame-D6BLXuFm.js","./clapperboard-BfpJ7tpa.js","./embed-src-CmyqZplg.js","./ArtifactModal-BU_PR8k8.css"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{C as t,D as n,j as r,x as i}from"./route-C7yP-PEQ.js";/* empty css */import{t as a}from"./react-DlmbjZJV.js";import{C as o,Er as s,Lt as c,T as l,_ as u,a as d,b as f,c as p,d as m,f as h,gr as g,hr as _,p as v,w as y,x as b}from"./url-CCmcoMys.js";import{t as x}from"./jsx-runtime-LKYXHABd.js";import{En as S}from"./useLayerZIndex-xDNOdXYr.js";import{Dt as C}from"./MotionConfigContext-HC2vqcJO.js";import{Gt as w,Jr as T,_i as E,bn as D,gn as O,ir as k,ni as A,pa as ee,sa as te,wn as ne,xr as j,zr as re}from"./WhiteboardEditor-DrHOvXez-BewOBKRS.js";import{$ as ie,B as ae,C as oe,E as se,F as M,G as ce,H as le,I as ue,J as de,K as fe,L as pe,P as me,Q as he,R as ge,V as _e,Y as N,Z as ve,_t as ye,at as be,ct as xe,dt as Se,et as Ce,gt as we,ht as Te,it as Ee,j as De,jt as P,lt as Oe,mt as ke,nt as F,ot as I,pt as Ae,q as je,rt as Me,st as Ne,tt as L,ut as Pe,vt as R,x as Fe,yt as Ie,z as Le}from"./editor-BA7mo2fo.js";import{t as Re}from"./Popover-D8lFLEo-.js";import{o as ze}from"./ThreadView-ChVeZPH-.js";import{r as Be}from"./agentLook-B5foAwJ4.js";import{n as Ve}from"./plugin-_bGVeqI0-ajuQLIjY.js";import{n as He,t as Ue}from"./icons-CaBMvHC2.js";import{n as We,t as Ge}from"./comments-DUAz1Q9X.js";import{n as Ke}from"./useMedia-CFebB4XU.js";import{n as qe}from"./artifact-list-9ZLo_0qZ.js";import{a as z,i as Je,t as Ye}from"./motion-Cy65kd7X.js";import{t as Xe}from"./embed-src-CmyqZplg.js";import{n as Ze}from"./preference-oNdcNeml.js";import{a as B,n as Qe,o as $e,r as V,t as et}from"./ref-Cv0JhjU5.js";import{c as tt,i as nt,l as rt,u as it}from"./route-messages-Cd15UR6N.js";var at={name:`corner-down-right`,size:24,node:[[`path`,{d:`m15 10 5 5-5 5`,key:`qqa56n`}],[`path`,{d:`M4 4v7a4 4 0 0 0 4 4h12`,key:`z08zvw`}]]};at.node;var ot=C(at),H=e(a(),1);function st(e,t,n){let r=(0,H.useMemo)(()=>f(),[]),[i,a]=(0,H.useState)(!1),s=(0,H.useRef)(t);s.current=t;let c=(0,H.useRef)(n);c.current=n,(0,H.useEffect)(()=>{if(r)return b((e,t)=>{e.kind===`chrome`&&a(e.hosted),e.kind===`history`&&s.current(e.action),t===window.parent&&e.kind===`document-export`&&e.format===`pdf`&&c.current?.()})},[r]);let{activity:l,comments:u,history:d,historyOpen:p,documentExport:m}=e;return(0,H.useEffect)(()=>{r&&o({kind:`header`,activity:l,comments:u,history:d,historyOpen:p,documentExport:m})},[r,l,u,d,p,m]),r&&i}var U=e(r(),1),W=x(),ct=`svg[role="img"] text[font-family*="Excalifont"] { font-family: ${O}; }`;function lt(){let e=Ze();return(0,W.jsx)(W.Fragment,{children:e&&(0,U.createPortal)((0,W.jsx)(`style`,{"data-diagram-font-style":!0,children:ct}),document.head)})}var G=(e,t,n,r)=>e.find(e=>t<e.bottom+r&&t+n+r>e.top);function ut(e,t,n,r){for(let i=G(e,t,n,r);i;)t=i.bottom+r,i=G(e,t,n,r);return t}function dt(e,t,n,r){for(let i=G(e,t,n,r);i;)t=i.top-r-n,i=G(e,t,n,r);return t}function ft(e,t,n,r,i){let a=e.top-i-t.height;if(a<0||G(r,a,t.height,i))return null;let o=t.anchorTop-a,s=[],c=a;for(let e=n.length-1;e>=0;e--){let t=n[e];if(t.top+t.height+i<=c)break;let a=c-i-t.height;if(t.fixed||a<0||G(r,a,t.height,i))return null;o+=t.top-a,s.push([e,a]),c=a}return{cost:o,moves:s,top:a}}function pt(e,t,n,r=[]){let i=[...e].sort((e,t)=>e.anchorTop-t.anchorTop),a=n?i.findIndex(e=>e.id===n):-1,o=Math.max(a,0),s=[],c=-1/0;for(let e=o;e<i.length;e++){let n=i[e],o=Math.max(n.anchorTop,c),l=G(r,o,n.height,t);if(l){let e=ut(r,o,n.height,t),i=ft(l,n,s,r,t);if(i&&i.cost<=e-n.anchorTop){for(let[e,t]of i.moves)s[e].top=t;o=i.top}else o=e}s.push({id:n.id,top:o,height:n.height,fixed:e===a}),c=o+n.height+t}let l={};for(let e of s)l[e.id]=e.top;if(a>0){let e=l[i[a].id];for(let n=a-1;n>=0;n--){let a=i[n],o=Math.min(a.anchorTop,e-t-a.height),s=G(r,o,a.height,t);if(s){let n=dt(r,o,a.height,t),i=s.bottom+t;o=i+a.height+t<=e&&!G(r,i,a.height,t)&&Math.abs(i-a.anchorTop)<Math.abs(a.anchorTop-n)?i:n}l[a.id]=o,e=o}}return l}function mt(e,t,n){let r=Math.max(e.x,t.x-n),i=(r+t.x)/2,a=r>e.x?` H${r}`:``;return`M${e.x} ${e.y}${a} C${i} ${e.y} ${i} ${t.y} ${t.x} ${t.y}`}var ht=8,gt=3,_t=18;function vt(e){let t=e.right+ht;return{left:t,right:t+gt,top:e.top,bottom:e.bottom}}function yt(e){return{x:e.right,y:e.top+Math.min(_t,(e.bottom-e.top)/2)}}function bt(e,t,n,r){return{left:Math.max(t.left,Math.min(e.left,t.right-n)),top:e.bottom+r}}var xt=10;function St(e,t,n,r,i){let a=Math.max(t.left,Math.min(e.left,t.right-n)),o=e.bottom+xt;return i.top+o+r<=i.height-i.reserved-8?{left:a,top:o,placement:`below`}:{left:a,top:e.top-r-xt,placement:`above`}}var K=e=>e.kind===`element`?[]:e.blocks??(e.kind===`block`?[{id:e.threadId,element:e.element}]:[]),q=e=>e.kind===`text`?e.ranges??[e.range]:[],Ct=4;function wt(e){return[...q(e).flatMap(e=>[...e.getClientRects()]),...K(e).map(e=>vt(e.element.getBoundingClientRect()))].sort((e,t)=>e.top-t.top||e.left-t.left)}function Tt(e){if(e.kind===`element`)return e.node.isConnected?ce(e.node):null;let t=wt(e).at(-1);return t?e.kind===`text`?{x:t.right,y:t.bottom}:yt(t):null}function Et(e,t,n){let r=document.createRange(),i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),a=0,o=!1;for(let e=i.nextNode();e;e=i.nextNode()){let i=a+e.length;if(!o&&t<=i&&(r.setStart(e,t-a),o=!0),o&&n<=i)return r.setEnd(e,n-a),r;a=i}return r.selectNodeContents(e),r}function Dt(e,t,n,r=0){let[i,a]=(0,H.useState)([]);return(0,H.useEffect)(()=>{if(!e||!n)return;let r=()=>{let r=e.getEditorState().read(()=>{let e=new Map;for(let t of j().getChildren()){let n=A(t,P);n&&e.set(n,t.getKey())}return e}),i=n.getBoundingClientRect().top-n.scrollTop,o=[];for(let n of t){let t=Ge(n.anchor).flatMap(t=>{let n=r.get(t),i=n?e.getElementByKey(n):null;return i?[{id:t,element:i}]:[]}),a=t[0]?.element;if(!a)continue;if(n.anchor.diagram){let e=fe(a,n.id);if(e){let t=e.getBoundingClientRect(),r=n.anchor.diagram.kind===`edge`?ce(e).y:t.top;o.push({threadId:n.id,top:r-i,kind:`element`,node:e})}else o.push({threadId:n.id,top:a.getBoundingClientRect().top-i,kind:`block`,element:a,blocks:t});continue}if(n.anchor.textRanges){let e=new Map(n.anchor.textRanges.map(e=>[e.blockId,e])),r=[],s=[],c;for(let n of t){let t=e.get(n.id),a=t?de(n.element.textContent??``,t.quote,t.start):`block`;if(a===`block`)s.push(n),c??=n.element.getBoundingClientRect().top-i;else{let e=Et(n.element,a.start,a.end);r.push(e);let t=e.getClientRects()[0]??n.element.getBoundingClientRect();c??=t.top-i}}r.length?o.push({threadId:n.id,top:c,kind:`text`,range:r[0],ranges:r,blocks:s}):o.push({threadId:n.id,top:c,kind:`block`,element:a,blocks:s});continue}let s=n.anchor.blockIds?`block`:de(a.textContent??``,n.anchor.quote);if(s===`block`){o.push({threadId:n.id,top:a.getBoundingClientRect().top-i,kind:`block`,element:a,blocks:t});continue}let c=Et(a,s.start,s.end),l=c.getClientRects()[0]??a.getBoundingClientRect();o.push({threadId:n.id,top:l.top-i,kind:`text`,range:c})}a(o)};r();let i=0,o=()=>{cancelAnimationFrame(i),i=requestAnimationFrame(r)},s=e.registerUpdateListener(o),c=new ResizeObserver(o);c.observe(n);let l=e.getRootElement();return l&&c.observe(l),()=>{cancelAnimationFrame(i),s(),c.disconnect()}},[e,t,n,r]),i}function Ot(e,t,n){(0,H.useEffect)(()=>{if(typeof CSS>`u`||!(`highlights`in CSS))return;let r=N(t,n),i=e.filter(e=>r.has(e.threadId)&&e.threadId!==n).flatMap(q),a=e.filter(e=>e.threadId===n).flatMap(q);return CSS.highlights.set(`ryugi-comment`,new Highlight(...i)),CSS.highlights.set(`ryugi-comment-active`,new Highlight(...a)),()=>{CSS.highlights.delete(`ryugi-comment`),CSS.highlights.delete(`ryugi-comment-active`)}},[e,t,n])}function kt(e,t){(0,H.useEffect)(()=>{if(t?.length){for(let e of t)e.setAttribute(`data-comment-draft`,``);return()=>{for(let e of t)e.removeAttribute(`data-comment-draft`)}}if(e&&typeof CSS<`u`&&`highlights`in CSS)return CSS.highlights.set(`ryugi-comment-draft`,new Highlight(e)),()=>{CSS.highlights.delete(`ryugi-comment-draft`)}},[e,t])}function At(e,t,n){for(let r of e){if(r.kind===`element`)continue;let e=r.kind===`block`||K(r).length?Ct:0;for(let i of wt(r))if(t>=i.left-e&&t<=i.right+e&&n>=i.top&&n<=i.bottom)return r.threadId}return null}var jt=e=>Math.max(0,Math.min(window.scrollY+e.getBoundingClientRect().top-100,document.documentElement.scrollHeight-window.innerHeight));function Mt(e){window.scrollTo({top:jt(e),behavior:`instant`})}function J(e,t){let n=jt(e);if(z())return window.scrollTo({top:n,behavior:`instant`}),t?.(),()=>{};let r=()=>{window.removeEventListener(`wheel`,i),window.removeEventListener(`touchmove`,i)},i=()=>{a.stop(),r()},a=c({keyframes:[window.scrollY+1,n],type:`spring`,stiffness:1e3,damping:250,onUpdate:e=>window.scrollTo({top:e,behavior:`instant`}),onComplete:()=>{r(),t?.()}});return window.addEventListener(`wheel`,i,{passive:!0}),window.addEventListener(`touchmove`,i,{passive:!0}),i}var Y=12,Nt=40,Pt=18;function Ft({id:e,onHeight:t,children:n}){let r=(0,H.useRef)(null);return(0,H.useLayoutEffect)(()=>{let n=r.current;if(!n)return;let i=new ResizeObserver(()=>t(e,n.offsetHeight));return i.observe(n),t(e,n.offsetHeight),()=>i.disconnect()},[e,t]),(0,W.jsx)(`div`,{ref:r,children:n})}function It({narrow:e,threads:n,anchors:r,blocked:i,activeId:a,actions:o,onActivate:s,railRef:c,agent:l}){let[u,d]=(0,H.useState)({}),[f,p]=(0,H.useState)(0),m=(0,H.useCallback)((e,t)=>p(t),[]),[h,g]=(0,H.useState)([]),_=(0,H.useRef)(null),v=(0,H.useRef)(new Map).current,y=(0,H.useRef)((e,t)=>d(n=>n[e]===t?n:{...n,[e]:t})).current,b=(0,H.useCallback)(e=>{_.current=e,c(e)},[c]),x=new Map(r.map(e=>[e.threadId,e.top])),S=n.filter(e=>x.has(e.id)),C=n.filter(e=>!x.has(e.id)&&!e.messages.every(e=>e.deleted)),w=S.map(e=>({id:e.id,anchorTop:x.get(e.id),height:u[e.id]??120})),T=pt(w,Y,a??void 0,i),E=Math.max(0,...w.map(e=>(T[e.id]??0)+e.height)),D=ut(i??[],E+Y,f,Y),O=JSON.stringify(T);(0,H.useLayoutEffect)(()=>{let t=_.current;if(e||!t)return g([]);let i=t.getBoundingClientRect(),o=N(n,a),s=[];for(let e of r){let t=T[e.threadId],n=Tt(e);if(t===void 0||!n||!o.has(e.threadId))continue;let r={x:n.x-i.left,y:n.y-i.top};s.push({id:e.threadId,d:mt(r,{x:0,y:t+Pt},Nt)})}g(s)},[e,r,n,a,O]),(0,H.useEffect)(()=>{let t=a?v.get(a):void 0;if(e||!t)return;let n=!1,r=()=>{},i=t.getAnimations({subtree:!0}).map(e=>e.finished.catch(()=>void 0));return Promise.all(i).then(()=>{!n&&le(t.getBoundingClientRect(),window.innerHeight)&&(r=J(t))}),()=>{n=!0,r()}},[a,e,v]);let k=e=>(0,W.jsx)(ae,{actions:o,active:e.id===a,agent:l,thread:e,onActivate:()=>s(e.id)});return e?(0,W.jsxs)(`div`,{"aria-label":t(`document.commentsLabel`),ref:b,role:`region`,className:`x78zum5 xdt5ytf x1v2ro7d xh8yej3 x7ep2pv xvueqy4`,children:[[...S].sort((e,t)=>x.get(e.id)-x.get(t.id)).map(e=>(0,W.jsx)(`div`,{children:k(e)},e.id)),C.length>0?(0,W.jsx)(`div`,{className:`xqui205 x1e56ztr xddlp02 xqfszdh x1j6dyjg`,children:t(`document.originalDeleted`)}):null,C.map(e=>(0,W.jsx)(`div`,{children:k(e)},e.id))]}):(0,W.jsxs)(`aside`,{"aria-label":t(`document.commentsLabel`),ref:b,className:`x1n2onr6 xh8yej3 x2lah0s`,style:{minHeight:E},children:[(0,W.jsx)(`svg`,{className:`x10l6tqk x13vifvy xu96u03 x1i1rx1s xjm9jq1 x1rea2x4 x47corl`,children:h.map(e=>(0,W.jsx)(`path`,{d:e.d,fill:`none`,stroke:e.id===a?Be.warningStrong:`currentColor`,strokeDasharray:e.id===a?void 0:`3 3`,strokeOpacity:e.id===a?1:.25},e.id))}),S.map(e=>(0,W.jsx)(`div`,{ref:t=>{t?v.set(e.id,t):v.delete(e.id)},className:`x10l6tqk xu96u03 xh8yej3 xhtitgo x14h5d43 xx6bhzk`,style:{top:T[e.id]},children:(0,W.jsx)(Ft,{id:e.id,onHeight:y,children:k(e)})},e.id)),C.length>0?(0,W.jsx)(`div`,{style:{position:`absolute`,top:D,left:0,width:`100%`,zIndex:2},children:(0,W.jsxs)(Ft,{id:`orphaned`,onHeight:m,children:[(0,W.jsx)(`div`,{className:`xqui205 x1e56ztr xddlp02 xqfszdh x1j6dyjg`,children:t(`document.originalDeleted`)}),C.map(e=>(0,W.jsx)(`div`,{style:{marginBottom:Y},children:k(e)},e.id))]})}):null]})}function Lt({container:e,anchors:t,threads:n,activeId:r}){let[i,a]=(0,H.useState)([]);return(0,H.useLayoutEffect)(()=>{if(!e)return a([]);let i=e.getBoundingClientRect(),o=N(n,r),s=[];for(let e of t)if(o.has(e.threadId))for(let t of K(e)){let n=vt(t.element.getBoundingClientRect());s.push({id:e.threadId,key:`${e.threadId}:${t.id}`,left:n.left-i.left,top:n.top-i.top,width:n.right-n.left,height:n.bottom-n.top})}a(s)},[e,t,n,r]),i.map(e=>(0,W.jsx)(`div`,{"data-comment-block":e.id,...{0:{className:`x10l6tqk x1cum3z5 x47corl x1f2496h x15406qy xx6bhzk`},1:{className:`x10l6tqk x1cum3z5 x47corl x15406qy xx6bhzk x5hs8br`}}[e.id===r|0],style:{left:e.left,top:e.top,width:e.width,height:e.height}},e.key))}var Rt=/^#([\w-]{4,64})$/,zt=/^#ryugi-host=/,Bt=e=>Rt.exec(e)?.[1]??null;function X(e=window){if(e.parent===e||!e.parent)return e;try{return e.parent.location.href,e.parent}catch{return e}}var Vt=(e=X())=>Bt(e.location.hash);function Ht(e,t=X()){let{hash:n,pathname:r,search:i}=t.location;if(zt.test(n))return;let a=e?`#${e}`:``;n!==a&&t.history.replaceState(t.history.state,``,`${r}${i}${a}`)}function Ut(e,t){let n=new URL(e);return n.hash=t,n.toString()}var Wt=new Set([`h2`,`h3`]),Gt=160;function Kt(e){let t=document.createRange();t.selectNodeContents(e);let n=t.getClientRects?.(),r=n&&n.length>0?n.item(n.length-1):null,i=e.getBoundingClientRect();return r&&r.width>0?r:i}function qt(e,t){e.getEditorState().read(()=>{for(let n of t){let t=k(n),r=e.getElementByKey(n);if(!ne(t)||!r)continue;let i=Wt.has(t.getTag())?A(t,P):``;i?r.id=i:r.removeAttribute(`id`)}})}function Jt({editor:e,shareBase:n}){let[r,i]=(0,H.useState)(null),[a,o]=(0,H.useState)(!1),c=(0,H.useRef)(void 0);if((0,H.useEffect)(()=>{if(e.hasNodes([D]))return e.registerMutationListener(D,t=>qt(e,[...t].filter(([,e])=>e!==`destroyed`).map(([e])=>e)))},[e]),(0,H.useEffect)(()=>{let t=()=>clearTimeout(c.current),n=()=>{t(),c.current=setTimeout(()=>i(null),Gt)},r=r=>{let a=r.target;if(a?.closest?.(`[data-heading-link]`))return t();let s=e.getRootElement(),c=a?.closest?.(`h2[id], h3[id]`);if(!s||!c||!s.contains(c))return n();t();let l=Kt(c);o(!1),i({id:c.id,left:l.right+window.scrollX+6,top:l.top+window.scrollY+(l.height-24)/2})};return document.addEventListener(`pointerover`,r),()=>{t(),document.removeEventListener(`pointerover`,r)}},[e]),!r)return null;let l=()=>{let e=Ut(n||X().location.href,r.id);navigator.clipboard?.writeText(e),Ht(r.id),o(!0)},u=t(a?`document.headingLinkCopied`:`document.copyHeadingLink`);return(0,U.createPortal)((0,W.jsx)(`button`,{"aria-label":u,"data-heading-link":``,style:{left:r.left,top:r.top},title:u,type:`button`,onClick:l,onPointerDown:e=>e.preventDefault(),...{0:{className:`x10l6tqk xoegz02 xrvj5dj x1ku5rj1 xvy4d1p xxk0z11 x1717udv xc342km x1kogg8i xjbqb8w xj0l527 xddlp02 x157umkc x1in2gmu x1ypdohk x1de99jn xaatb59 x1y3gkto x1uczgqu x60py1w`},1:{className:`x10l6tqk xoegz02 xrvj5dj x1ku5rj1 xvy4d1p xxk0z11 x1717udv xc342km x1kogg8i xjbqb8w xj0l527 x1ypdohk x1de99jn xaatb59 x1y3gkto x1uczgqu x60py1w x1cge3fn`}}[!!a|0],children:a?(0,W.jsx)(s,{"aria-hidden":`true`,size:14}):(0,W.jsx)(g,{"aria-hidden":`true`,size:14})}),document.body)}var Yt=620,Xt=class extends H.Component{state={leaving:null,shown:null};static getDerivedStateFromProps(e,t){return e.history?.immersive?t.shown===e.history?null:{shown:e.history}:t.shown?{shown:null,leaving:t.shown}:null}host=null;paper=null;viewport=null;shell=null;entry=null;slide=null;exitTimer=null;getSnapshotBeforeUpdate(){return{rect:this.paper?.getBoundingClientRect()??null,x:window.scrollX,y:window.scrollY}}animate(e,t){if(!this.paper||!e||z()||typeof this.paper.animate!=`function`)return;this.slide?.cancel();let n=t??this.paper.getBoundingClientRect(),r=Math.max(56,e.top),i=parseFloat(getComputedStyle(this.paper).borderLeftWidth)||0,a=t?0:i,o=t?i:0;this.slide=this.paper.animate([{left:e.left-a+`px`,top:r-a+`px`,width:e.width+a*2+`px`,height:Math.min(e.height,window.innerHeight-r)+a+`px`},{left:n.left-o+`px`,top:n.top-o+`px`,width:n.width+o*2+`px`,height:n.height+o+`px`}],{duration:Yt,easing:Ye,fill:t?`forwards`:`none`}),this.slide.finished.catch(()=>{})}unlock=()=>{if(this.exitTimer&&clearTimeout(this.exitTimer),this.exitTimer=null,this.slide?.cancel(),this.slide=null,this.host&&(this.host.style.height=``),this.entry){let e=this.entry;document.documentElement.style.overflow=e.overflow,document.documentElement.style.scrollbarGutter=e.gutter,window.scrollTo(e.x,e.y)}this.entry=null};componentDidUpdate(e,t,n){let r=!!this.props.history?.immersive,i=!!e.history?.immersive;if(r&&!i)this.exitTimer&&clearTimeout(this.exitTimer),this.exitTimer=null,this.state.leaving&&this.setState({leaving:null}),this.entry||(this.entry={...n,focus:document.activeElement,overflow:document.documentElement.style.overflow,gutter:document.documentElement.style.scrollbarGutter,offset:Math.max(0,56-(n.rect?.top??56))},this.host&&(this.host.style.height=(n.rect?.height??0)+`px`)),n.rect&&this.shell?.style.setProperty(`--history-reading-width`,n.rect.width+`px`),document.documentElement.style.scrollbarGutter=`stable`,document.documentElement.style.overflow=`hidden`,this.viewport&&(this.viewport.scrollTop=this.entry.offset),this.animate(n.rect),this.shell?.querySelector(`[data-history-exit]`)?.focus({preventScroll:!0});else if(!r&&i&&this.entry){let e=this.entry;this.viewport&&(this.viewport.scrollTop=e.offset),window.scrollTo(e.x,e.y),e.focus?.focus({preventScroll:!0});let t=e.rect;t&&this.animate(n.rect,{left:t.left,top:Math.max(56,t.top),width:t.width,height:Math.min(t.height,window.innerHeight-Math.max(56,t.top))});let r=()=>{this.setState({leaving:null},()=>{this.unlock(),e.focus?.focus({preventScroll:!0})})};z()?r():this.exitTimer=setTimeout(r,Yt)}else!r&&!this.state.leaving&&(!e.history&&this.props.history&&(this.entry={...n,focus:null,overflow:document.documentElement.style.overflow,gutter:document.documentElement.style.scrollbarGutter,offset:0}),e.history&&!this.props.history&&this.entry&&(window.scrollTo(this.entry.x,this.entry.y),this.entry=null))}componentWillUnmount(){this.unlock()}trap=e=>{if(!this.props.history?.immersive||e.key!==`Tab`)return;let t=[...this.shell?.querySelectorAll(`button:not(:disabled),a[href],summary,[tabindex="0"]`)??[]].filter(e=>!e.closest(`[hidden],[aria-hidden="true"],[inert]`)),n=t[0],r=t.at(-1);e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n?.focus())};render(){let{history:e,children:n}=this.props,r=e?.immersive?e:this.state.leaving,i=!!r,a=!!e?.ready;return(0,W.jsx)(`div`,{className:`history-body`,ref:e=>{this.host=e},children:(0,W.jsxs)(`div`,{"aria-label":e?.immersive?t(`history.title`):void 0,"aria-modal":e?.immersive?!0:void 0,className:`history-space-shell`,"data-immersive":i?``:void 0,"data-open":e?.immersive?``:void 0,inert:!(!this.state.leaving||e),role:e?.immersive?`dialog`:void 0,ref:e=>{this.shell=e},onKeyDown:this.trap,children:[r?.space,(0,W.jsx)(`div`,{className:`history-space-paper`,ref:e=>{this.paper=e},children:(0,W.jsxs)(`div`,{className:`history-space-scroll`,tabIndex:i?0:void 0,ref:e=>{this.viewport=e},children:[(0,W.jsx)(`div`,{className:`history-body-comparison`,"data-ready":a,hidden:!a,children:e?.content}),(0,W.jsx)(`div`,{hidden:a,children:n})]})})]})})}};function Zt({history:e,children:t}){let[n,r]=(0,H.useState)({current:e,panel:e?.panel??null});return n.current!==e&&r({current:e,panel:e?.panel??n.panel}),(0,H.useEffect)(()=>{if(e)return;let t=setTimeout(()=>{r(e=>e.current?e:{...e,panel:null})},z()?0:280);return()=>clearTimeout(t)},[e]),(0,W.jsx)(`div`,{className:`history-rail`,"data-moving":e||n.panel?``:void 0,"data-open":e?``:void 0,children:(0,W.jsxs)(`div`,{className:`history-rail-track`,children:[(0,W.jsx)(`div`,{"aria-hidden":e?!0:void 0,className:`history-rail-comments`,inert:!!e,children:t}),(0,W.jsx)(`div`,{"aria-hidden":!e||void 0,className:`history-rail-panel`,inert:!e,children:e?.panel??n.panel})]})})}var Qt=(0,H.createContext)(!1),$t=3e3;function Z(e,t){let n=e.getRootElement()?.closest(`.history-body`)?.querySelector(`.history-body-comparison[data-ready="true"]`);if(n)return[...n.querySelectorAll(`[data-history-block-id]`)].find(e=>e.dataset.historyBlockId===t)?.querySelector(`.history-current :is(h1, h2, h3, h4, h5, h6)`)??null;let r=e.getEditorState().read(()=>j().getChildren().find(e=>A(e,P)===t)?.getKey());return r?e.getElementByKey(r):null}function en(e,t){let n=(0,H.useContext)(Qt)?null:e,[r]=(0,H.useState)(Vt),i=(0,H.useRef)(r),a=(0,H.useRef)(r),o=(0,H.useRef)(void 0),s=(0,H.useRef)(null),c=(0,H.useRef)(null),l=(0,H.useCallback)(e=>{s.current=e,Ht(e)},[]),u=(0,H.useCallback)(e=>{let t=n&&Z(n,e);return t?(o.current?.(),o.current=J(t,()=>{i.current===e&&!a.current&&(i.current=null)}),!0):!1},[n]),d=(0,H.useCallback)(e=>{let t=n&&Z(n,e);return t?(o.current?.(),Mt(t),i.current===e&&!a.current&&(i.current=null),!0):!1},[n]),f=(0,H.useCallback)(e=>{let t={lock:i.current,pending:a.current};i.current=e,a.current=null,u(e)?l(e):(i.current=t.lock,a.current=t.pending)},[u,l]);return(0,H.useEffect)(()=>{if(!n)return;let e=()=>{if(n.getRootElement()?.closest(`.history-space-shell[data-immersive]`))return;let e=a.current;e&&(a.current=null,v()?i.current===e&&(i.current=null):d(e)?c.current={blockId:e,until:Date.now()+$t}:a.current=e)};e();let t=()=>{i.current=null,a.current=null,c.current=null},r=new ResizeObserver(()=>{if(n.getRootElement()?.closest(`.history-space-shell[data-immersive]`))return;let e=c.current;e&&(Date.now()>e.until?c.current=null:d(e.blockId))}),l=n.registerRootListener(e=>{r.disconnect(),e&&r.observe(e)}),u=X(),f=()=>{let t=Vt();t&&t!==s.current&&!rt(u.history.state)&&(i.current=t,a.current=t,e())},p=n.registerUpdateListener(e);return window.addEventListener(`wheel`,t,{passive:!0}),window.addEventListener(`touchmove`,t,{passive:!0}),window.addEventListener(`keydown`,t),u.addEventListener(`hashchange`,f),()=>{p(),l(),r.disconnect(),o.current?.(),window.removeEventListener(`wheel`,t),window.removeEventListener(`touchmove`,t),window.removeEventListener(`keydown`,t),u.removeEventListener(`hashchange`,f)}},[n,d]),(0,H.useEffect)(()=>{if(n){if(i.current){if(a.current||t!==i.current)return;i.current=null}else l(t)}},[t,n,l]),{scrollTo:f}}function tn({editor:e}){return en(e,null),null}var nn={h2:0,h3:1};function rn(){let e=[],t=null,n=null;for(let r of j().getChildren()){let i=ne(r)?r.getTag():void 0,a=A(r,P);if(i===`h1`){t={key:r.getKey(),blockId:a,text:r.getTextContent()},n=null;continue}let o=i===void 0?void 0:nn[i];o!==void 0&&(n={key:r.getKey(),blockId:a,text:r.getTextContent(),depth:o,part:t,blocks:[]},e.push(n)),a&&n?.blocks.push(a)}return e}function an(e,t){let n=new Map;for(let t of e)for(let e of t.blocks)n.set(e,t.blockId);let r=new Set;for(let e of t)if(e.status===`open`)for(let t of Ge(e.anchor)){let e=n.get(t);e&&r.add(e)}return r}function on(e){let t=new Set(e.map(e=>e.part?.key??null)).size>1,n=[],r;for(let i of e){let e=n.at(-1),a=i.part!==r;i.depth===0||!e||a?n.push({head:i,children:[],index:n.length,partStart:t&&a?i.part:null}):e.children.push(i),r=i.part}return n}var Q={toc:{kVAEAm:`x7wzq59`,kY2c9j:`x1w0boku`,k87sOh:`xossvpg`,kSGwAc:`x1y8v6su`,keoZOQ:`x1tfhste`,k1xSpc:`x78zum5`,kXwgrk:`xdt5ytf`,kskxy:`x1r4ahda`,k7Eaqz:`xeuugli`,kMv6JI:`xqfszdh`,kGuDYH:`x1ct8sxb`,kMwMTN:`x1bo0w0s`,$$css:!0},rail:{kzqmXN:`x1td3qas`,$$css:!0},list:{kAzted:`x2lwn1j`,kORKVm:`x1odjw0f`,kacamN:`x1e4zzel`,k5wCbM:`x1rohswg`,k8WAf4:`xj8oexa`,$$css:!0},item:{kVAEAm:`x1n2onr6`,k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kOIVth:`x167g77z`,kzqmXN:`xh8yej3`,kZKoxP:`xlrawln`,kmVPX3:`x1717udv`,kMzoRj:`xc342km`,kaIpWk:`x1kogg8i`,kWkggS:`xjbqb8w`,kkrTdU:`x1ypdohk`,kMeerF:`x1de99jn`,k3XXqK:`xaatb59`,kInvED:`x1g40iwv`,kjBf7l:`x1uczgqu x60py1w`,$$css:!0},tick:{kmuXW:`x2lah0s`,kzqmXN:`xsmyaan`,kZKoxP:`x36qwtl`,keTefX:`xdwrcjd`,kaIpWk:`x1nj7uno`,kWkggS:`x174nbcu`,kmkexE:`x10iii20`,$$css:!0},tickH2:{kzqmXN:`xw4jnvo`,keTefX:`x1lziwak`,kWkggS:`xxwmxtg`,$$css:!0},tickActive:{kzqmXN:`xw4jnvo`,keTefX:`x1lziwak`,kWkggS:`x15az74h`,$$css:!0},tickDot:{keTefX:`x165d6jo`,$$css:!0},part:{kB7OPa:`x9f619`,kZKoxP:`x10w6t97`,kVQacm:`xb3r6kr`,kLKAdn:`xyinxu5`,kGuDYH:`x1j6dyjg`,k63SB2:`x1s688f`,kLWn49:`x1wfe3co`,kb6lSQ:`x16q24ku`,kMwMTN:`xddlp02`,kg5iWk:`xlyipyv`,khDVqt:`xuxw1ft`,kmkexE:`x1un5det`,$$css:!0},partFirst:{kZKoxP:`xxk0z11`,kLKAdn:`x1yrsyyn`,$$css:!0},row:{k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kOIVth:`x17d4w8g`,kzqmXN:`xh8yej3`,kZKoxP:`xlrawln`,kmVPX3:`x1717udv`,kMzoRj:`xc342km`,kaIpWk:`x12oqio5`,kWkggS:`xjbqb8w`,kMwMTN:`x1bo0w0s xytdrwj`,kVVagm:`xln7xf2`,k9WMMc:`x1yc453h`,kkrTdU:`x1ypdohk`,kmkexE:`x137m0jx x413zg9`,kMeerF:`x1de99jn`,k3XXqK:`xaatb59`,kInvED:`x1g40iwv`,kjBf7l:`x1uczgqu x60py1w`,$$css:!0},rowNested:{kZCmMZ:`x1onr9mi`,kGuDYH:`xfifm61`,kMwMTN:`xddlp02 xytdrwj`,$$css:!0},rowCurrent:{kZKoxP:`x1fgtraw`,kGuDYH:`x2ouz8m`,k63SB2:`x1s688f`,kMwMTN:`xo2rkog xytdrwj`,$$css:!0},rowActive:{k63SB2:`x1s688f`,kMwMTN:`x1cge3fn x157umkc`,$$css:!0},rowText:{kUk6DE:`x98rzlu`,k7Eaqz:`xeuugli`,kVQacm:`xb3r6kr`,kg5iWk:`xlyipyv`,khDVqt:`xuxw1ft`,$$css:!0},count:{kmuXW:`x2lah0s`,kGuDYH:`x1j6dyjg`,k63SB2:`xo1l8bm`,kMwMTN:`xc7n51q`,kcqcaj:`xss6m8b`,$$css:!0},fold:{k1xSpc:`xrvj5dj`,k9llMU:`xihq33y`,k33iCy:`xlshs6z`,kSiTet:`xg01cxk`,kmkexE:`x1u0be13 x9kvfbb`,$$css:!0},foldOpen:{k9llMU:`x1tu4anv`,k33iCy:`xnpuxes`,kSiTet:`x1hc1fzr`,kmkexE:`xjgrksx x9kvfbb`,$$css:!0},foldRows:{kAzted:`x2lwn1j`,kVQacm:`xb3r6kr`,k3aq6I:`x1bvilyr`,kmkexE:`x1pagzdl x9kvfbb`,$$css:!0},foldRowsOpen:{k3aq6I:`x1c071of`,kmkexE:`x94wcrn x9kvfbb`,$$css:!0},fadeNear:{kSiTet:`xiiclqw`,$$css:!0},fadeMid:{kSiTet:`xf9vgkq`,$$css:!0},fadeFar:{kSiTet:`x197sbye`,$$css:!0},dot:{kmuXW:`x2lah0s`,kzqmXN:`x1ftt334`,kZKoxP:`x1ycjhwn`,kaIpWk:`x16rqkct`,kWkggS:`xzkukvh`,$$css:!0},card:{kVAEAm:`x10l6tqk`,kY2c9j:`x1w0boku`,k87sOh:`xn0lweg`,kbCHJM:`x6f9vd5`,kzqmXN:`x1hfn5x7`,kskxy:`x1r4ahda`,kORKVm:`x1odjw0f`,kB7OPa:`x9f619`,k8WAf4:`x1vvogim`,kg3NbH:`xaope02`,kMzoRj:`xmkeg23`,ksu8eU:`x1y0btm7`,kVAM5u:`xgcsv5v`,kaIpWk:`x1q4ynmn`,kWkggS:`x12ilycc`,kGVxlE:`x1d5q07e`,$$css:!0}},sn=120,cn=200,ln=150,un=new Set;function dn(e,t){let[n,r]=(0,H.useState)({key:null,reading:!1});return(0,H.useEffect)(()=>{if(!e)return;let n=()=>{if(e.getRootElement()?.closest(`.history-space-shell[data-immersive]`))return;let n=t[0]?.key??null,i=!1;for(let r of t){let t=r.blockId?Z(e,r.blockId):e.getElementByKey(r.key);t&&t.getBoundingClientRect().top<sn&&(n=r.key,i=!0)}r(e=>e.key===n&&e.reading===i?e:{key:n,reading:i})};return n(),window.addEventListener(`scroll`,n,{passive:!0}),()=>window.removeEventListener(`scroll`,n)},[e,t]),n}function fn(e,t,n){(0,H.useEffect)(()=>{let n=()=>{let n=e.current,r=t.current;if(!n||!r)return;let i=n.getBoundingClientRect(),a=r.getBoundingClientRect();(a.top<i.top||a.bottom>i.bottom)&&(n.scrollTop=Math.max(0,n.scrollTop+a.top-i.top-(n.clientHeight-a.height)/2))};return n(),window.addEventListener(`scroll`,n,{passive:!0}),window.addEventListener(`resize`,n),()=>{window.removeEventListener(`scroll`,n),window.removeEventListener(`resize`,n)}},n)}function pn({editor:e,threads:n=[],variant:r=`column`}){let[a,o]=(0,H.useState)([]),[s,c]=(0,H.useState)(!1),[l,u]=(0,H.useState)(un),d=(0,H.useRef)(void 0),f=(0,H.useRef)(void 0),p=(0,H.useRef)(null),m=(0,H.useRef)(null);(0,H.useEffect)(()=>{if(!e)return;let t=()=>o(e.getEditorState().read(rn));return t(),e.registerUpdateListener(t)},[e]);let h=dn(e,a),g=a.find(e=>e.key===h.key),{scrollTo:_}=en(e,h.reading&&g?.blockId?g.blockId:null),v=(0,H.useMemo)(()=>an(a,n),[a,n]),y=(0,H.useMemo)(()=>on(a),[a]);fn(p,m,[h.key,a]),(0,H.useEffect)(()=>()=>{clearTimeout(d.current),clearTimeout(f.current)},[]);let b=y.find(e=>e.head.key===h.key||e.children.some(e=>e.key===h.key)),x=b?.head.key??null,[S,C]=(0,H.useState)(x),w=e=>u(t=>t.has(e)?t:new Set(t).add(e));S!==x&&(C(x),s&&S&&w(S));let T=()=>{clearTimeout(d.current),c(!0)},E=()=>{clearTimeout(d.current),clearTimeout(f.current),d.current=setTimeout(()=>{c(!1),u(un)},cn)},D=e=>{clearTimeout(f.current),f.current=setTimeout(()=>w(e),ln)},O=t=>{if(t.blockId)return _(t.blockId);let n=e?.getElementByKey(t.key);n&&J(n)};if(r===`hidden`)return null;if(a.length===0)return(0,W.jsx)(`nav`,{"data-variant":r,...i(Q.toc)});let k=r===`rail`,A=e=>y.map(t=>{let{head:n,children:r}=t,a=t===b,o=a||l.has(n.key),c=b?Math.abs(t.index-b.index):0,u=e!==`column`||s||c===0?null:c===1?Q.fadeNear:c<=3?Q.fadeMid:Q.fadeFar,d=(t,n,r,o,s=!1)=>{let c=t.key===h.key,l=e===`card`,d=o?(0,W.jsx)(`span`,{"data-commented":``,...i(Q.dot,e===`ticks`&&Q.tickDot)}):null;return(0,W.jsxs)(`button`,{"aria-current":c&&!l?`location`:void 0,"aria-label":t.text,ref:c&&!l?m:void 0,tabIndex:l?-1:void 0,type:`button`,onClick:()=>O(t),onFocus:s?()=>w(t.key):void 0,onPointerEnter:s?()=>D(t.key):void 0,onPointerLeave:s?()=>clearTimeout(f.current):void 0,...i(e===`ticks`?Q.item:Q.row,e!==`ticks`&&n&&Q.rowNested,!n&&a&&Q.rowCurrent,e!==`ticks`&&c&&Q.rowActive,!n&&u),children:[e===`ticks`?(0,W.jsx)(`span`,{...i(Q.tick,!n&&Q.tickH2,c&&Q.tickActive)}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{...i(Q.rowText),children:t.text}),r>0?(0,W.jsx)(`span`,{...i(Q.count),children:r}):null]}),d]},t.key)},p=!o&&r.some(e=>v.has(e.blockId));return(0,W.jsxs)(H.Fragment,{children:[t.partStart?(0,W.jsx)(`div`,{"aria-hidden":e===`ticks`||void 0,...i(Q.part,t.index===0&&Q.partFirst,u),children:e===`ticks`?null:t.partStart.text}):null,d(n,!1,o?0:r.length,v.has(n.blockId)||p,r.length>0),r.length>0?(0,W.jsx)(`div`,{inert:!o,...i(Q.fold,o&&Q.foldOpen),children:(0,W.jsx)(`div`,{...i(Q.foldRows,o&&Q.foldRowsOpen),children:r.map(e=>d(e,!0,0,v.has(e.blockId)))})}):null]},n.key)});return(0,W.jsxs)(`nav`,{"aria-label":t(`document.toc`),"data-expanded":s?`true`:`false`,"data-variant":r,onFocus:T,onPointerEnter:T,onPointerLeave:E,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||E()},...i(Q.toc,k&&Q.rail),children:[(0,W.jsx)(`div`,{"data-toc-list":``,ref:p,...i(Q.list),children:A(k?`ticks`:`column`)}),k&&s?(0,W.jsx)(`div`,{"data-toc-card":``,ref:e=>{e&&p.current&&(e.scrollTop=p.current.scrollTop)},...i(Q.card),children:A(`card`)}):null]})}var mn=`.rich-table-scrollable-wrapper, .ryugi-mermaid-preview`;function hn(e,t){let n=e.getBoundingClientRect().right;return[...e.querySelectorAll(mn)].map(e=>e.getBoundingClientRect()).filter(e=>e.right>n+1).map(e=>({top:e.top-t,bottom:e.bottom-t}))}var gn=(e,t)=>e.length===t.length&&e.every((e,n)=>e.top===t[n].top&&e.bottom===t[n].bottom);function _n(e,t){let[n,r]=(0,H.useState)([]);return(0,H.useEffect)(()=>{let n=e?.getRootElement();if(!e||!t||!n)return;let i=()=>{let e=t.getBoundingClientRect().top-t.scrollTop,i=hn(n,e);r(e=>gn(e,i)?e:i)};i();let a=0,o=()=>{cancelAnimationFrame(a),a=requestAnimationFrame(i)},s=e.registerUpdateListener(o),c=new ResizeObserver(o);return c.observe(t),c.observe(n),()=>{cancelAnimationFrame(a),s(),c.disconnect()}},[e,t]),n}var vn=56,yn=40;function bn(e,t,n){return n>=e.top&&n<=Math.max(e.bottom,e.top+yn)&&t<=e.right+vn}function xn(e){return Math.max(e.getBoundingClientRect().right,...[...e.querySelectorAll(mn)].map(e=>e.getBoundingClientRect().right))}function Sn(e,t){let n=e.getRootElement(),r=t instanceof Element?t:null;for(;r&&r.parentElement!==n;)r=r.parentElement;return n&&r instanceof HTMLElement?r:null}function Cn(e,t){let n=Sn(e,t);return n?wn(e,n):null}function wn(e,t){return e.read(()=>{for(let n of j().getChildren())if(e.getElementByKey(n.getKey())===t)return A(n,P)||null;return null})}function Tn(e,t,n){let[r,i]=(0,H.useState)(null);return(0,H.useEffect)(()=>{if(!e||!t||!n){i(null);return}let r=0,a=null,o=e=>{e?.element!==a?.element&&(a=e,i(e))},s=()=>{cancelAnimationFrame(r),o(null)},c=t=>{if(cancelAnimationFrame(r),t.pointerType!==`mouse`&&t.pointerType!==`pen`||t.buttons!==0)return o(null);let{target:n,clientX:i,clientY:s}=t;r=requestAnimationFrame(()=>{let t=Sn(e,n);if(t){if(t===a?.element)return;let n=wn(e,t);return o(n?{id:n,element:t}:null)}if(a){let{top:e,bottom:t}=a.element.getBoundingClientRect();if(bn({top:e,bottom:t,right:xn(a.element)},i,s))return}o(null)})};return document.addEventListener(`pointermove`,c),document.addEventListener(`scroll`,s,!0),document.documentElement.addEventListener(`pointerleave`,s),()=>{cancelAnimationFrame(r),document.removeEventListener(`pointermove`,c),document.removeEventListener(`scroll`,s,!0),document.documentElement.removeEventListener(`pointerleave`,s)}},[e,t,n]),(0,H.useMemo)(()=>{if(!r||!t||!n||!r.element.isConnected)return null;let e=r.element.getBoundingClientRect(),i=t.getBoundingClientRect(),a=document.createRange();return a.selectNodeContents(r.element),{kind:`block`,blockId:r.id,quote:``,elements:[r.element],range:a,left:e.left-i.left,right:xn(r.element)-i.left,top:e.top-i.top,bottom:e.bottom-i.top}},[r,t,n])}var En=80,Dn=240,On=e=>{let t=/matrix\(([^)]+)\)/.exec(getComputedStyle(e).transform);return t?Number(t[1].split(`,`)[4]):0};function kn(e,t){let n=t.offsetLeft,r=null,i=()=>{let i=n-t.offsetLeft;if(n=t.offsetLeft,!i||z()||!r&&Math.abs(i)<En)return;let a=i+(r?On(t):0),o={duration:Dn,easing:Ye};if(r)r.cancel();else for(let n of e.children)n!==t&&Je(n,[{opacity:0},{opacity:1}],o);let s=t.animate([{transform:`translateX(${a}px)`},{transform:`none`}],o);r=s,s.finished.then(()=>{r===s&&(r=null)},()=>void 0)},a=new ResizeObserver(i);return a.observe(e),{settle:i,stop:()=>a.disconnect()}}function An({editor:e,threads:t,actions:n,agent:r,diagram:i,onMain:a,overlay:o,history:s,shareBase:c,children:l}){let[u,d]=(0,H.useState)(null),[f,p]=(0,H.useState)(null),[m,h]=(0,H.useState)(null),[g,_]=(0,H.useState)(null),v=(0,H.useCallback)(e=>{_(e),a?.(e)},[a]),y=(0,H.useRef)(null);(0,H.useEffect)(()=>{if(!g||!m)return;let e=kn(g,m);return y.current=e,()=>{y.current=null,e.stop()}},[g,m]);let b=Ke(`(max-width: 1100px)`),x=!Ke(`(max-width: 1480px)`),S=b?`hidden`:x?`column`:`rail`,[C,w]=(0,H.useState)(0),T=Dt(e,t,u,C),E=(0,H.useMemo)(()=>i&&e&&!s?{threads:t,activeId:f,draft:i.draft,pick:i.pick,readOnly:i.readOnly,blockAction:i.blockAction,viewer:{actions:n,agent:r,create:i.create,drafts:i.drafts},activate:p,marked:()=>w(e=>e+1),blockIdOf:t=>Cn(e,t)}:null,[i,e,s,t,f,n,r]),D=_n(e,b||s?null:u);return Ot(T,t,f),(0,H.useLayoutEffect)(()=>y.current?.settle(),[S]),(0,W.jsxs)(`main`,{ref:v,...{0:{className:`x1n2onr6 xrvj5dj xc94fvo xl56j7k xwaa2ar x13zrc24 x1ffnkcp x4l9tsp`},2:{className:`x1n2onr6 xrvj5dj xl56j7k xwaa2ar x13zrc24 x1ffnkcp x4l9tsp xoiau2f`},1:{className:`x1n2onr6 xc94fvo xl56j7k xwaa2ar x13zrc24 x1ffnkcp x78zum5 xdt5ytf x1qjc9v5 x17qtykl`},3:{className:`x1n2onr6 xl56j7k xwaa2ar x13zrc24 x1ffnkcp xoiau2f x78zum5 xdt5ytf x1qjc9v5 x17qtykl`}}[(S===`rail`)<<1|!!b],children:[(0,W.jsx)(`div`,{className:`history-space-toc`,inert:!!s?.immersive,children:(0,W.jsx)(pn,{editor:e,threads:t,variant:S})}),e?(0,W.jsx)(Jt,{editor:e,shareBase:c}):null,(0,W.jsxs)(`article`,{ref:h,className:`x1n2onr6 x1vjfegm xh8yej3 xrgej4m xeuugli`,style:b?{marginInline:`auto`}:s?void 0:{"--ryugi-table-bleed":`368px`},onClick:e=>p(At(T,e.clientX,e.clientY)),children:[(0,W.jsx)(lt,{}),(0,W.jsx)(Le,{value:E,children:(0,W.jsx)(Xt,{history:s,children:l})}),s?null:(0,W.jsx)(Lt,{activeId:f,anchors:T,container:m,threads:t})]}),(0,W.jsx)(`div`,{className:`x1n2onr6`,className:`history-space-comments ${{className:`x1n2onr6`}.className??``}`,inert:!!s?.immersive,children:(0,W.jsx)(Zt,{history:s?.immersive?null:s,children:(0,W.jsx)(It,{actions:n,activeId:f,agent:r,anchors:T,blocked:D,narrow:b,railRef:d,threads:t,onActivate:p})})}),m&&o&&!s?o(m):null]})}function jn({left:e,top:n,quote:r,wholeBlock:i,initial:a,restored:o,leaving:s,onChange:c,onSubmit:l,onCancel:u,ref:d}){return(0,W.jsx)(`div`,{ref:d,...{0:{className:`x10l6tqk x1u8a7rm xj6ak53 xowlrko xllfotl xatqbsq x1u6ievf`},1:{className:`x10l6tqk x1u8a7rm xj6ak53 x1u6ievf xxp0q0x x12l1aco xn0cd8s x47corl`}}[!!s|0],style:{left:e,top:n},children:(0,W.jsxs)(_e,{active:!0,children:[(0,W.jsxs)(`div`,{className:`x78zum5 x1pha0wt x167g77z xz9dl7a x1hr3lfm xqfszdh x1j6dyjg`,children:[(0,W.jsx)(`span`,{className:`x98rzlu xeuugli xb3r6kr xuxw1ft xlyipyv xddlp02`,children:i?r:`“${r}”`}),o?(0,W.jsx)(`span`,{className:`x2lah0s x7zghnd`,children:t(`document.draftRestored`)}):null]}),(0,W.jsx)(ze,{autoFocus:!0,initial:a,placeholder:t(`document.draftPlaceholder`),onCancel:u,onChange:c,onSubmit:l})]})})}function Mn(e){let t=(0,H.useMemo)(me,[]),[n,r]=(0,H.useState)(null),[i,a]=(0,H.useState)(!1),o=(0,H.useRef)(``),s=(0,H.useRef)(0),c=(0,H.useRef)(null),l=(0,H.useRef)(null);kt(i?null:n?.target.range??null,i?void 0:n?.target.elements);let u=(0,H.useCallback)(n=>{window.clearTimeout(s.current);let i=t.take(M(n.blockId,n.quote,n.blockIds,n.textRanges,n.diagram));o.current=i,a(!1),r({target:n,initial:i}),window.getSelection()?.removeAllRanges(),e()},[t,e]),d=(0,H.useCallback)(e=>{n&&(t.save(M(n.target.blockId,n.target.quote,n.target.blockIds,n.target.textRanges,n.target.diagram),e?o.current:``),a(!0),s.current=window.setTimeout(()=>{r(null),a(!1)},120))},[n,t]);return(0,H.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,H.useEffect)(()=>()=>window.clearTimeout(s.current),[]),{drafts:t,draft:n,leaving:i,restored:!!n?.initial,open:u,close:d,onText:e=>{o.current=e},panelRef:c,toolbarRef:l}}var Nn=46;function Pn(e,t){return Math.min(e+8,window.innerWidth-(t.offsetParent?.getBoundingClientRect().left??0)-40)}function Fn({article:e,editor:t,enabled:n,onComment:r}){let i=Tn(t,e.closest(`main`),n);return i?(0,W.jsx)(ue,{left:Pn(i.right,e),top:i.top,onComment:()=>r(i)}):null}function In({blockId:e,element:t,node:n,host:r}){let i=r.closest(`main`);if(!i)return null;let a=n.getBoundingClientRect(),o=i.getBoundingClientRect(),s=document.createRange();return s.setStart(r,0),{blockId:e,quote:t.label,diagram:t.target,range:s,left:a.left-o.left,right:a.right-o.left,top:a.top-o.top,bottom:a.bottom-o.top}}function Ln(e){return{left:e.offsetLeft,right:Math.min(e.offsetLeft+e.offsetWidth,window.innerWidth-16)}}function Rn({editor:e,threads:t,actions:n,agent:r,canComment:i,canCommentDiagram:a=i,selection:o,clearSelection:s,resolveSelection:c,onCreate:l,onMain:u,onToolbar:d,history:f,shareBase:p,children:m}){let h=Mn(s),{draft:g,open:_}=h,[v,y]=(0,H.useState)(null),[b,x]=(0,H.useState)(0);(0,H.useLayoutEffect)(()=>{if(!v||f)return;let t=()=>{let t=v.querySelector(`.ryugi-editor-toolbar`);t?x(t.getBoundingClientRect().height):e?.isEditable()||x(0)};t();let n=new MutationObserver(t);return n.observe(v,{childList:!0}),()=>n.disconnect()},[v,f,e]),(0,H.useEffect)(()=>{if(!v||!d)return;let e=()=>d(v.querySelector(`.ryugi-editor-toolbar, .history-bar`)!==null);e();let t=new MutationObserver(e);return t.observe(v,{childList:!0}),()=>{t.disconnect(),d(!1)}},[v,d]);let S=h.leaving?null:g?.target??null,{drafts:C}=h,w=(0,H.useMemo)(()=>({draft:S,drafts:C,readOnly:!a,blockAction:i,pick:e=>{let t=In(e);t&&_(t)},create:(e,t)=>l({...e,range:document.createRange(),left:0,right:0,top:0,bottom:0},t)}),[i,a,S,C,_,l]),T=(0,H.useCallback)(()=>{let e=window.getSelection();navigator.clipboard?.writeText(e?.toString()??``),e?.removeAllRanges(),s()},[s]),E=(0,H.useMemo)(()=>({toolbarSlot:v,selectionActions:g?null:(0,W.jsx)(pe,{onCopy:T,onComment:i?()=>{let e=c();e&&_(e)}:void 0})}),[v,g,i,c,_,T]);return(0,W.jsxs)(Ie,{value:E,children:[(0,W.jsx)(`div`,{className:`ryugi-editor-toolbar-slot`,ref:y,children:b>0?(0,W.jsx)(`div`,{"aria-hidden":`true`,className:`history-toolbar-space`,style:{height:b}}):null}),(0,W.jsx)(An,{actions:n,agent:r,diagram:w,editor:e,history:f,shareBase:p,threads:t,overlay:t=>(0,W.jsxs)(W.Fragment,{children:[o&&!g&&o.kind===`block`&&i?(0,W.jsx)(ue,{left:Pn(o.right,t),ref:h.toolbarRef,top:o.top,onComment:()=>h.open(o)}):null,(0,W.jsx)(Fn,{article:t,editor:e,enabled:i&&!g&&!o,onComment:h.open}),o&&!g&&o.kind===`nested`?(0,W.jsx)(ge,{left:o.left,ref:h.toolbarRef,top:Math.max(o.top-Nn,0),children:(0,W.jsx)(pe,{onComment:i?()=>h.open(o):void 0,onCopy:T})}):null,g?(0,W.jsx)(jn,{ref:h.panelRef,...bt(g.target,Ln(t),340,8),initial:g.initial,leaving:h.leaving,quote:je(g.target),restored:h.restored,wholeBlock:g.target.kind===`block`,onCancel:()=>h.close(!0),onChange:h.onText,onSubmit:e=>l(g.target,e).then(e=>(e&&h.close(!1),e))},M(g.target.blockId,g.target.quote,g.target.blockIds,g.target.textRanges,g.target.diagram)):null]}),onMain:u,children:m})]})}function zn(e){let t=ee(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}function Bn({text:e}){let t=(0,H.useRef)(null),n=(0,H.useRef)(null);return(0,H.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,W.jsx)(`template`,{suppressHydrationWarning:!0,"data-rich-comment-anchor":``,ref:t})}var $=e=>`${ye[e]} ${R[e]}`,Vn={h1:$(`headingH1`),h2:$(`headingH2`),h3:$(`headingH3`),h4:$(`headingH4`),h5:$(`headingH5`),h6:$(`headingH6`)};function Hn(e){return e.toLowerCase().trim().replaceAll(/[^\s\w\u3000-\u9FFF\uAC00-\uD7AF\uFF00-\uFFEF-]/g,``).replaceAll(/[\s_]+/g,`-`).replaceAll(/^-+|-+$/g,``)}function Un(e){return e.type===`comment`?``:e.text?e.text:e.children?e.children.map(Un).join(``):``}var Wn=/^["'«‘“‹「『"']/,Gn=/["'»’”›」』"']$/;function Kn(e,t,n,r,i,a){switch(e.type){case`root`:return(0,W.jsx)(W.Fragment,{children:n});case`paragraph`:{let r=e.format?{textAlign:e.format}:void 0;return(0,W.jsx)(`p`,{className:$(`paragraph`),style:r,children:n??(0,W.jsx)(`br`,{})},t)}case`heading`:{let o=e.tag,s=Hn(i||Un(e)),c=a??s;if(a===void 0&&s){let e=r.get(s);e===void 0?r.set(s,1):(c=`${s}-${e}`,r.set(s,e+1))}return(0,W.jsxs)(o,{className:Vn[o],id:c||void 0,children:[c&&(0,W.jsx)(`a`,{className:$(`headingAnchor`),href:`#${c}`,tabIndex:0,children:(0,W.jsx)(_,{"aria-hidden":!0,size:14,strokeWidth:2})}),n]},t)}case`rich-quote`:case`quote`:{let r=(i||Un(e)).trim(),a=Wn.test(r),o=Gn.test(r),s=e.attribution;return(0,W.jsxs)(`blockquote`,{className:$(`quote`),"data-no-close-quote":o?``:void 0,"data-no-open-quote":a?``:void 0,children:[n,s&&(0,W.jsxs)(`footer`,{className:$(`quoteAttribution`),children:[`— `,s]})]},t)}case`list`:{let r=e.listType===`number`?`ol`:`ul`,i=e.listType===`number`?$(`listOl`):e.listType===`check`?`${$(`checklist`)} ${$(`listUl`)}`:$(`listUl`);return(0,W.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?$(`listNestedItem`):r?e.checked?`${$(`listItem`)} ${$(`listItemChecked`)}`:`${$(`listItem`)} ${$(`listItemUnchecked`)}`:$(`listItem`),(0,W.jsx)(`li`,{className:o,value:a,children:n},t)}case`link`:return(0,W.jsxs)(`a`,{className:$(`link`),href:e.url,rel:e.rel||`noopener`,target:e.target||`_blank`,children:[(0,W.jsx)(ve,{href:e.url}),n]},t);case`autolink`:return(0,W.jsxs)(`a`,{className:$(`link`),href:e.url,rel:`noopener`,target:`_blank`,children:[(0,W.jsx)(ve,{href:e.url}),n]},t);case`horizontalrule`:return(0,W.jsx)(`hr`,{className:$(`hr`)},t);case`table`:return(0,W.jsx)(`div`,{className:$(`tableScrollableWrapper`),children:(0,W.jsx)(`table`,{className:$(`table`),children:n})},t);case`tablerow`:return(0,W.jsx)(`tr`,{children:n},t);case`tablecell`:{let r=e.headerState?`th`:`td`,i=e.headerState?$(`tableCellHeader`):$(`tableCell`);return(0,W.jsx)(r,{className:i,colSpan:e.colSpan>1?e.colSpan:void 0,children:n},t)}case`details`:{let r=e.summary||``;return(0,W.jsxs)(`details`,{className:`${L.details} ${F.details}`,open:e.open||void 0,children:[(0,W.jsxs)(`summary`,{className:`${L.summary} ${F.summary}`,children:[(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`${L.chevron} ${F.chevron}`,children:(0,W.jsx)(`svg`,{fill:`none`,height:`20`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,viewBox:`0 0 20 20`,width:`20`,children:(0,W.jsx)(`path`,{d:`M8 6L12 10L8 14`})})}),(0,W.jsx)(`span`,{className:`${L.summaryText} ${F.summaryText}`,children:r})]}),(0,W.jsx)(`div`,{className:`${L.content} ${F.content}`,children:n})]},t)}case`spoiler`:return(0,W.jsx)(`span`,{className:$(`spoiler`),role:`button`,tabIndex:0,children:n},t);case`tag`:return(0,W.jsx)(`span`,{className:$(`tag`),style:{backgroundColor:Ne(e.text)},children:e.text},t);case`comment`:return(0,W.jsx)(Bn,{text:e.text??``},t);case`ruby`:return(0,H.createElement)(Te,{key:t,rendererKey:`Ruby`,defaultRenderer:De,props:{reading:e.reading??``,children:n}});case`code`:return(0,W.jsx)(`pre`,{className:`rich-code-block`,children:(0,W.jsx)(`code`,{children:n})},t);case`code-highlight`:return(0,W.jsx)(`span`,{children:e.text},t);case`linebreak`:return(0,W.jsx)(`br`,{},t);case`tab`:return(0,W.jsx)(`span`,{children:` `},t);default:return null}}var qn=e=>`${ye[e]} ${R[e]}`,Jn=[[1,`textBold`],[2,`textItalic`],[4,`textStrikethrough`],[8,`textUnderline`],[16,`textCode`],[32,`textSubscript`],[64,`textSuperscript`],[128,`textHighlight`]];function Yn(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 Xn(e,t){let n=e.text,r=e.format||0;for(let[e,i]of Jn)r&e&&(n=(0,W.jsx)(`span`,{className:qn(i),children:n},`${t}-${e}`));return e.style&&(n=(0,W.jsx)(`span`,{style:Yn(e.style),children:n},t)),n}function Zn(e,t=!1){let n=[],r=t?e.findIndex(e=>e.type===`paragraph`):-1,i=e=>e.type===`image`&&typeof e.layout==`string`&&e.layout.startsWith(`float-`);for(let t=0;t<e.length;t++){let a=[t];if(t===r&&t+1<e.length&&a.push(++t),i(e[t]))for(;++t<e.length;){a.push(t);let n=e[t];if(!i(n)&&![`paragraph`,`list`,`quote`,`rich-quote`,`comment`].includes(n.type))break}n.push(a)}let a=[];for(let t of n)a.length&&t.every(t=>e[t].type===`comment`)||a.at(-1)?.every(t=>e[t].type===`comment`)?a.at(-1).push(...t):a.push(t);return a}function Qn(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 $n=e=>`${ye.alert} ${R.alert} rich-alert-${e}`;function er(e,t,n){switch(e.type){case`alert-quote`:return(0,H.createElement)(`div`,{key:t,className:$n(e.alertType)},n);case`banner`:return(0,H.createElement)(`div`,{key:t,className:`rich-banner rich-banner-${e.bannerType}`},n);case`grid-container`:return(0,H.createElement)(`div`,{key:t,className:`${Me.container} ${Ee.container}`},n);default:return(0,H.isValidElement)(n)?(0,H.cloneElement)(n,{key:t}):n}}function tr(e,t,n){return(0,H.isValidElement)(e)&&typeof e.type==`string`?(0,H.cloneElement)(e,{"data-block-id":t}):(0,W.jsx)(`div`,{className:`rich-block-anchor`,"data-block-id":t,children:e},`${n}-block-anchor`)}function nr(e,t,n,r){return t?(r.blockAnchor??tr)(e,t,n):e}function rr(e,t,n,r,i,a,o){let s=o.recycleKeys?i:e.getKey?e.getKey():i,c=o.headingIds?.get(e.getKey?.()),{builtinNodeOverrides:l}=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=l?.[t.type];return nr(n?n(t,s,[r],()=>er(t,s,r)):er(t,s,r),a,s,o)}}let u=e.exportJSON?e.exportJSON():{};if(u.type===`text`){let e=l?.text;return e?e(u,s,null,()=>Xn(u,s)):Xn(u,s)}let d=typeof e.getChildren==`function`?e.getChildren():[];Array.isArray(u.children)&&u.children.length===0&&d.length>0&&(u.children=d.map(e=>({type:typeof e.getType==`function`?e.getType():e.__type})));let f=null;d.length>0&&(f=d.map((e,i)=>rr(e,t,n,r,`${s}-${i}`,void 0,o)));let p=e.getTextContent?e.getTextContent():void 0,m=l?.[u.type];return nr(m?m(u,s,f,()=>Kn(u,s,f,r,p,c)):Kn(u,s,f,r,p,c),a,s,o)}function ir(e,t,n,r){let i=zn({nodes:t,theme:I,editable:!1,onError:e=>{console.error(`[RichRenderer]`,e)}}),a={namespace:`ssr`,theme:I},o=he(e),s=i.parseEditorState(o);i.setEditorState(s);let c=Qn(o),l=o.root?.children,u=new Map,d=new Map,f=new Map,p=s.read(()=>{let e=new Map,t=(n,r,i)=>{if(f.set(n.getKey(),i),n.getType()===`heading`){let t=Hn(n.getTextContent()),i=e.get(t)??0,a=t?`${t}${i?`-${i}`:``}`:``;e.set(t,i+1),u.set(n.getKey(),a),a&&d.set(a,r)}te(n)&&n.getChildren().forEach((e,n)=>t(e,r,`${i}.${n}`))},n=j().getChildren();return n.forEach((e,n)=>t(e,n,`${n}:0`)),n}),m=new Set,h=p.map((e,t)=>{let n=l?.[t]??{type:e.getType(),version:1},r=n.$?.blockId??`renderer-${t}`;for(;m.has(r);)r=`${r}:${t}`;return m.add(r),{id:r,data:n,index:t,pool:`${n.type}:${n.type===`dynamic`?n.url:n.tag??``}`}}),g=Zn(h.map(e=>e.data),r),_=new Map,v=g.map((e,t)=>{let n=e.map(e=>(_.set(e,t),h[e])),r=n[0];return{blocks:n,id:r.id,data:n.length===1?r.data:{type:`flow-group`,version:1,children:n.map(e=>e.data)},pool:n.length===1?r.pool:`flow-group`}});for(let[e,t]of d)d.set(e,_.get(t));let y=(e,t)=>s.read(()=>{let r=v[e];return r?(0,W.jsx)(H.Fragment,{children:r.blocks.map((e,r)=>rr(p[e.index],i,a,new Map,t===void 0?`ssr-${e.index}`:`recycler-${t}-${r}`,l?.[e.index]?.$?.blockId,{...n,headingIds:u,recycleKeys:t!==void 0}))},t===void 0?r.id:`recycler-${t}`):null}),b;return{document:{editor:i,rows:v,headingRows:d,render:y,renderAll:()=>b??=(0,W.jsx)(W.Fragment,{children:v.map((e,t)=>y(t))}),nodePath:e=>e?f.get(e)??e:`0`},footnoteData:c,renderNestedContent:e=>{let r=zn({nodes:t,theme:I,editable:!1,onError:e=>{console.error(`[RichRenderer:nested]`,e)}}),i={namespace:`ssr-nested`,theme:I},a=he(e),o=r.parseEditorState(a);r.setEditorState(o);let s=null,c=a.root?.children;return o.read(()=>{let e=j(),t=new Map,a=e.getChildren().map((e,a)=>rr(e,r,i,t,`nested-${a}`,c?.[a]?.$?.blockId,n));s=(0,W.jsx)(W.Fragment,{children:a})}),s}}}function ar({document:e}){return e.renderAll()}function or({value:e,variant:t=`article`,theme:n,className:r,style:i,as:a=`div`,nested:o=!1,rendererConfig:s,extraNodes:c,builtinNodeOverrides:l,blockAnchor:u,surface:d,virtualization:f}){let p=we(t),m=xe(),{document:h,footnoteData:g,renderNestedContent:_}=(0,H.useMemo)(()=>ir(e,c?[...Ce,...c]:Ce,{blockAnchor:u,builtinNodeOverrides:l},t===`note`),[u,l,c,e,t]),{scrollContainer:v,overscan:y,estimateBlockHeight:b,preserveCapacity:x}=typeof f==`object`?f:{},S=!!f,C=f===!1,T=(0,H.useMemo)(()=>C?ar:S?Ve({scrollContainer:v,overscan:y,estimateBlockHeight:b,preserveCapacity:x}):d??ar,[d,S,C,v,y,b,x]),E=[`rich-content`,p,r].filter(Boolean).join(` `),D=typeof a==`string`?{suppressHydrationWarning:!0,className:E,"data-rich-nested":o?`true`:void 0,"data-theme":n}:{},O=n??`light`;return(0,W.jsx)(w,{className:p,theme:O,children:(0,W.jsx)(ie,{colorScheme:O,children:(0,W.jsx)(ke,{config:s,mode:`renderer`,variant:t,children:(0,W.jsx)(Se,{definitions:g.definitions,displayNumberMap:g.displayNumberMap,children:(0,W.jsx)(be,{value:m??_,children:(0,W.jsx)(a,{...D,style:i,children:(0,W.jsx)(T,{document:h})})})})})})})}var sr=/^claude-(opus|sonnet|haiku|fable)-(\d+)-(\d+)(?:\[[^\]]*\])?$/;function cr(e){let t=sr.exec(e);if(!t)return e;let[,n,r,i]=t;return`${n[0].toUpperCase()}${n.slice(1)} ${r}.${i}`}var lr=16,ur={content:{"--lobe-popover-viewport-inline-padding":`4px`}},dr=4,fr=(e,n)=>e.kind===`human`&&e.name===n?t(`common.you`):e.name;function pr({contributor:e,stacked:t=!1}){let[n,r]=(0,H.useState)(!1),i=e.kind===`agent`?He(e.name):void 0,a=i?Ue[i]:void 0;return(0,W.jsx)(`span`,{"data-byline-face":``,...{0:{className:`xrvj5dj x1ku5rj1 x2lah0s x1kky2od xlup9mm x16rqkct xb3r6kr x7em3ua x15dg6x3 x1bo0w0s xvwhms9 x1s688f`},1:{className:`xrvj5dj x1ku5rj1 x2lah0s x1kky2od xlup9mm x16rqkct xb3r6kr x7em3ua x15dg6x3 x1bo0w0s xvwhms9 x1s688f x165d6jo`}}[!!t|0],children:a?(0,W.jsx)(a.Avatar,{shape:`circle`,size:lr}):e.avatar&&!n?(0,W.jsx)(`img`,{alt:``,src:e.avatar,onError:()=>r(!0),className:`x1kky2od xlup9mm xl1xv1r`}):[...e.name][0]?.toUpperCase()})}function mr({contributors:e,me:n,now:r}){return(0,W.jsx)(`div`,{className:`x78zum5 xdt5ytf x1u2d2a2 xxc7z9f`,children:e.map(e=>(0,W.jsxs)(`div`,{"data-contributor":``,className:`xrvj5dj x1g3yg12 x6s0dn4 x167g77z x1t0vds8 xdqyycr x1ct8sxb x178xt8z x1g31smg x13fuv20 xxu5053`,children:[(0,W.jsx)(pr,{contributor:e}),(0,W.jsx)(`span`,{className:`xo2rkog xb3r6kr xlyipyv xuxw1ft`,children:[fr(e,n),e.models.map(cr).join(` / `)].filter(Boolean).join(` · `)}),(0,W.jsxs)(`span`,{className:`xddlp02 x1qt5hsa xss6m8b xuxw1ft`,children:[t(`document.byline.edits`,{count:e.edits}),` ·`,` `,qe(e.lastAt*1e3,r)]})]},e.kind+e.name))})}function hr({byline:e,me:n,now:r}){let{contributors:i,last:a}=e;if(!i.length)return null;let o=i.length===1?fr(i[0],n):t(`document.byline.authors`,{count:i.length});return(0,W.jsx)(Re,{content:(0,W.jsx)(mr,{contributors:i,me:n,now:r}),placement:`bottomLeft`,styles:ur,trigger:`hover`,children:(0,W.jsxs)(`button`,{"data-byline":``,type:`button`,className:`x3nfvp2 x6s0dn4 x17d4w8g x193iq5w xxk0z11 x14oi46j x165d6jo xc342km x1kogg8i xjbqb8w x9jwiqo xddlp02 xln7xf2 x1ct8sxb xuxw1ft xt0e3qv`,children:[(0,W.jsx)(`span`,{className:`x3nfvp2 x2lah0s`,children:i.slice(0,dr).map((e,t)=>(0,W.jsx)(pr,{contributor:e,stacked:t>0},e.kind+e.name))}),(0,W.jsx)(`span`,{className:`x1bo0w0s xk50ysn`,children:o}),a?(0,W.jsxs)(`span`,{children:[`·`,` `,t(`document.byline.edited`,{name:fr(a,n),time:qe(a.at*1e3,r)})]}):null]})})}var gr=32,_r=6e4;function vr({editor:e,byline:t,me:n}){let[r,i]=(0,H.useState)(null),[a,o]=(0,H.useState)(Date.now);(0,H.useEffect)(()=>{o(Date.now());let e=setInterval(()=>o(Date.now()),_r);return()=>clearInterval(e)},[t]);let s=t.contributors.length>0;return(0,H.useLayoutEffect)(()=>{let t=null,n=()=>{t=e.getRootElement();let n=t?.offsetParent;if(!t||!(n instanceof HTMLElement)||!s){t&&delete t.dataset.byline,i(null);return}let r=t.firstElementChild,a=r instanceof HTMLElement&&r.tagName===`H1`?r:null;t.dataset.byline=a?`title`:`top`;let o=n.getBoundingClientRect(),c=(a??t).getBoundingClientRect(),l=a?c.bottom+4:c.top-gr;i(e=>{let t={host:n,left:c.left-o.left,top:l-o.top};return e?.host===t.host&&e.left===t.left&&e.top===t.top?e:t})};n();let r=new ResizeObserver(n),a=e.getRootElement();a&&r.observe(a);let o=e.registerUpdateListener(()=>requestAnimationFrame(n));return window.addEventListener(`resize`,n),()=>{r.disconnect(),o(),window.removeEventListener(`resize`,n),t&&delete t.dataset.byline}},[e,s]),r?(0,U.createPortal)((0,W.jsx)(`div`,{style:{position:`absolute`,zIndex:1,left:r.left,top:r.top,whiteSpace:`nowrap`},onMouseMove:e=>e.stopPropagation(),onPointerMove:e=>e.stopPropagation(),children:(0,W.jsx)(hr,{byline:t,me:n,now:a})}),r.host):null}function yr({error:e,onDismiss:n}){return e?(0,U.createPortal)((0,W.jsxs)(`div`,{role:`alert`,className:`xixxii4 xy58vm5 xvf9o5y xvueqy4 xeq5yr9 x27kpxv x11uqc5h x78zum5 x6s0dn4 x1v2ro7d x10dr8xq x1hr3lfm xur7f20 xmkeg23 x1y0btm7 xgcsv5v x1rozbrz xo2rkog xqfszdh x4z9k3i x1pzk2i8`,children:[(0,W.jsx)(`span`,{children:t(`documentExport.failed`)}),(0,W.jsx)(`button`,{"aria-label":t(`common.close`),type:`button`,onClick:n,className:`xrvj5dj x1ku5rj1 xjbqb8w x1bo0w0s xc342km xgd8bvy x1fgtraw x1717udv x1ypdohk x2lah0s`,children:(0,W.jsx)(S,{size:16})})]}),document.body):null}var br={[Oe]:se,[Pe]:oe,[Ae]:Fe},xr={claude:`Claude Code`,codex:`Codex`},Sr=e=>String(e).padStart(2,`0`);function Cr(e){let t=new Date(e);return`${t.getMonth()+1}/${t.getDate()} ${Sr(t.getHours())}:${Sr(t.getMinutes())}`}function wr({prompt:e,empty:n,theme:r}){let i=(0,H.useRef)(null),[a,o]=(0,H.useState)(!1),[s,c]=(0,H.useState)(!1);return(0,H.useLayoutEffect)(()=>{let e=i.current;e&&!a&&c(e.scrollHeight>e.clientHeight+1)},[a,e]),(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`aside`,{"aria-label":t(`document.promptLabel`),"data-ryugi-no-comment":``,"data-task-prompt":``,className:`x8o32fp x1onr9mi xyumdvf x1t7ytsu x1awn4rw x1hx0egp`,children:[(0,W.jsxs)(`p`,{className:`x78zum5 x6s0dn4 x17d4w8g x1ghz6dp xddlp02 x1qt5hsa xd4r4e8`,children:[(0,W.jsx)(ot,{"aria-hidden":`true`,size:12}),t(`document.promptMeta`,{time:Cr(e.at),agent:xr[e.harness]??e.harness})]}),(0,W.jsx)(`div`,{"data-task-prompt-body":``,ref:i,...{0:{className:`x1gslohp x1bo0w0s xif65rj x11m8ghp xb3r6kr`},1:{className:`x1gslohp x1bo0w0s xif65rj x11m8ghp xb3r6kr x1n19c2o`}}[!a|0],children:(0,W.jsx)(or,{rendererConfig:br,theme:r,value:e.state,variant:`comment`})}),(s||a)&&(0,W.jsx)(`button`,{"aria-expanded":a,type:`button`,onClick:()=>o(e=>!e),className:`x1gslohp x1717udv xc342km xjbqb8w xddlp02 x12rs2w1 xjb2p0i xfifm61 x1bvjpef xrys4gj x1ypdohk`,children:t(a?`document.promptCollapse`:`document.promptExpand`)})]}),n&&(0,W.jsx)(`p`,{className:`x103tiuj xddlp02 x2ouz8m`,children:t(`document.promptEmpty`)})]})}var Tr=[`wheel`,`touchmove`,`keydown`,`pointerdown`];function Er(e){return e.getEditorState().read(()=>j().getChildren().map(e=>({id:A(e,P),key:e.getKey()}))).flatMap(({id:t,key:n})=>{let r=t?e.getElementByKey(n):null;return r?[{id:t,element:r}]:[]})}function Dr(e,t){if(t.kind!==`document`)return!1;let n=Er(e).find(({id:e})=>e===t.blockId);if(!n)return!1;let r=n.element.getBoundingClientRect().top-t.top;return r!==0&&window.scrollBy({top:r,behavior:`instant`}),!0}function Or(e){(0,H.useEffect)(()=>{if(!e)return;let t=h({read(){let t=null;for(let{id:n,element:r}of Er(e)){let{top:e,bottom:i}=r.getBoundingClientRect();if(!(i<=0)){if(e>=0&&e<window.innerHeight)return{kind:`document`,blockId:n,top:e};if(t??={kind:`document`,blockId:n,top:e},e>=0)break}}return t},apply:t=>Dr(e,t)}),n=()=>{let t=v();t&&Dr(e,t)};n();let r=e.registerUpdateListener(n);for(let e of Tr)window.addEventListener(e,m,{passive:!0});return()=>{t(),r();for(let e of Tr)window.removeEventListener(e,m)}},[e])}var kr=e=>`${B(e)}:${Qe(e)}`;async function Ar(e,t){let n=new Map;for(let t of $e(e))et(t)&&n.set(kr(t),t);let r=await Promise.all([...n].map(async([e,n])=>[e,await t(n).catch(()=>void 0)])),i={};for(let[e,t]of r)t&&(i[e]=t);return i}function jr(e){let t=structuredClone({...e,comments:e.comments??We()}),n=t=>{if(!t||t.startsWith(`#`))return t;try{return new URL(t,e.contentBase||e.sourceUrl).href}catch{return t}},r=e=>{if(!e||typeof e!=`object`)return;let t=e;if(typeof t.type==`string`){for(let e of[`src`,`poster`,`favicon`,`image`])typeof t[e]==`string`&&(t[e]=n(t[e]));if((t.type===`link`||t.type===`autolink`||t.type===`link-card`)&&typeof t.url==`string`&&(t.url=n(t.url)),t.type===`excalidraw`&&typeof t.snapshot==`string`){let[e=``,...r]=t.snapshot.split(`
3
3
  `);!e.trimStart().startsWith(`{`)&&!e.startsWith(`ref:`)&&/(?:\.excalidraw(?:[?#]|$)|^https?:|^blob:)/.test(e)&&(t.snapshot=[n(e),...r].join(`
4
- `))}}for(let e of Object.values(t))typeof e==`object`&&r(e)};return r(t.state),t}function Mr(e,t){let n;if(t.cloudOrigin){if(!e.to)return;n=new URL(`/a/${encodeURIComponent(e.to)}`,t.cloudOrigin)}else{n=new URL(`/${V(e)}/${encodeURIComponent(B(e))}`,t.sourceUrl);let r=new URL(t.sourceUrl);n.searchParams.set(`at`,r.searchParams.get(`at`)??r.pathname)}for(let t of p)e[t]&&n.searchParams.set(t,e[t]);return n.href}function Nr(e){let[t,r]=(0,H.useState)(!1),[i,a]=(0,H.useState)(!1),o=(0,H.useRef)(e);o.current=e;let s=(0,H.useRef)(null),c=async()=>{let e=o.current;if(!e.editor||e.available===!1||s.current)return;let t=new AbortController;s.current=t,r(!0),a(!1);try{let r=e.editor.getEditorState().toJSON(),i=e.scenes?await Ar(r,e.scenes.load):void 0;if(t.signal.aborted)return;let a=jr({state:r,...i?{embeds:i}:{},comments:e.comments,title:e.title,contentBase:e.contentBase,sourceUrl:location.href,cloudOrigin:y()??(e.cloud?location.origin:void 0)}),{printDocument:o}=await n(async()=>{let{printDocument:e}=await import(`./printDocument-5qz1CDkd.js`);return{printDocument:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56]),import.meta.url);await o(a,{signal:t.signal})}catch(e){t.signal.aborted||(a(!0),console.warn(`Document export failed`,e))}finally{s.current===t&&(s.current=null),t.signal.aborted||r(!1)}},u=(0,H.useRef)(c);return u.current=c,(0,H.useEffect)(()=>{r(!1),a(!1);let t=t=>{l(t)&&t.data?.type===`ryugi:document-export`&&t.data.id===e.id&&t.data.format===`pdf`&&u.current()};return window.addEventListener(`message`,t),()=>{window.removeEventListener(`message`,t),s.current?.abort(),s.current=null}},[e.id]),{state:t?`preparing`:e.editor&&e.available!==!1?`ready`:null,error:i,dismiss:()=>a(!1),exportPdf:()=>void c()}}var Pr=2400,Fr=[{boxShadow:`inset 2px 0 0 #0d99ff`,backgroundColor:`rgb(13 153 255 / 0.13)`},{boxShadow:`inset 2px 0 0 transparent`,backgroundColor:`transparent`}];function Ir(e,t){let n=e.getEditorState().read(()=>j().getChildren().find(e=>A(e,P)===t)?.getKey());return n?e.getElementByKey(n):null}var Lr=50,Rr=100;function zr(e){let t=e.indexOf(`:`),n=e.slice(0,t),r=e.slice(t+1);return`[data-ref-chip="${n}"][data-ref-key="${r}"], [data-ref-to="${n}"][data-ref-key="${r}"]`}function Br(e){let t=0,n=setInterval(()=>{let r=document.querySelector(zr(e));r&&J(r),(r||++t>=Lr)&&clearInterval(n)},Rr);return()=>clearInterval(n)}function Vr(e,t){let n=0,r=()=>{let r=Ir(e,t);return r&&(J(r),r.animate(Fr,{duration:Pr,easing:`ease-out`})),!!r||++n>=Lr};if(r())return()=>void 0;let i=setInterval(()=>{r()&&clearInterval(i)},Rr);return()=>clearInterval(i)}var Hr=(e,t)=>V(e)===`document`&&(e.to===t||B(e)===t);function Ur(e,t,r,i,a){let s=!!r,[c,l]=(0,H.useState)(null),p=(0,H.useMemo)(()=>s&&f(),[s]),{role:m}=u(),h=(0,H.useRef)(()=>void 0);return(0,H.useEffect)(()=>{if(!s)return;let e=X(),n=()=>{let n=tt(e.history.state,t);n!==null&&(h.current(),window.scrollTo({top:n,behavior:`instant`}))};return e.addEventListener(`popstate`,n),()=>e.removeEventListener(`popstate`,n)},[s,t]),(0,H.useEffect)(()=>{if(!p)return;let t,n,r=b(r=>{if(r.kind===`active`&&l(r.key),r.kind===`reveal`&&(l(r.key),t?.(),t=Br(r.key)),r.kind===`focus`&&r.block&&e&&(n?.(),n=Vr(e,r.block)),r.kind!==`scroll-to`)return;l(r.key);let i=e&&Ir(e,r.blockId);i&&(J(i),i.animate(Fr,{duration:Pr,easing:`ease-out`}))});return o({kind:`ready`}),()=>{r(),t?.(),n?.()}},[p,e]),(0,H.useMemo)(()=>s?{active:c,isSelf:e=>Hr(e,t),useBoard:r,useScene:i,openEmbed:e=>{if(p)return o({kind:`embed-open`,target:e});let t=a?.refId(e);if(!a||!t)return;let r=Xe(a.frameSrc(`whiteboard`,t),e);n(async()=>{let{openArtifactModal:e}=await import(`./ArtifactModal-lbwt_kHc.js`);return{openArtifactModal:e}},__vite__mapDeps([57,1,10,3,4,2,5,6,7,11,12,13,58,30,59,18,35,60,61,40]),import.meta.url).then(({openArtifactModal:t})=>t({allow:a.frameAllow,src:r,title:e.label??B(e)}))},open:n=>{let r=V(n);if(Hr(n,t)){let r=e&&n.block?Ir(e,n.block):null;if(!r||!n.block){window.scrollTo({top:0,behavior:`instant`});return}p&&m===`beside`?o({kind:`block-focus`,block:n.block}):it(t,n.block,X()),h.current(),h.current=J(r),r.animate(Fr,{duration:Pr,easing:`ease-out`})}else p?o({kind:`ref-open`,target:n}):location.assign(`/document/${t}${d(location.search,nt(B(n),r,n,`document`))}`)}}:null,[s,c,p,m,e,t,r,i,a])}function Wr(e){let[t,n]=(0,H.useState)([]);return(0,H.useEffect)(()=>{if(!e)return;let t=()=>{let t=$e(e.getEditorState().toJSON());n(e=>JSON.stringify(e)===JSON.stringify(t)?e:t)};return t(),e.registerUpdateListener(t)},[e]),t}function Gr(e,t){return j().getChildren().flatMap(n=>{let r=A(n,P),i=e.getElementByKey(n.getKey());if(!r||!i||!t.intersectsNode(i))return[];let a=document.createRange();if(a.selectNodeContents(i),t.compareBoundaryPoints(Range.START_TO_START,a)>0&&a.setStart(t.startContainer,t.startOffset),t.compareBoundaryPoints(Range.END_TO_END,a)<0&&a.setEnd(t.endContainer,t.endOffset),a.collapsed)return[];let o=a.toString();if(!o&&i.textContent)return[];let s=document.createRange();return s.selectNodeContents(i),s.setEnd(a.startContainer,a.startOffset),[{blockId:r,quote:o,start:s.toString().length}]})}var Kr=200;function qr(e,t){let n=(t instanceof Element?t:t?.parentElement)?.closest(`[contenteditable="true"]`);return!!(n&&n!==e&&e.contains(n))}function Jr(e,t){let n=e.read(()=>{let t=re();return T(t)?j().getChildren().flatMap(n=>{if(!t.has(n.getKey()))return[];let r=A(n,P),i=e.getElementByKey(n.getKey());return r&&i?[{id:r,element:i}]:[]}):[]});if(n.length){let e=n.map(e=>e.element),r=e.map(e=>e.getBoundingClientRect()),i=t.getBoundingClientRect(),a=document.createRange();return a.selectNodeContents(e[0]),{kind:`block`,blockId:n[0].id,...n.length>1?{blockIds:n.map(e=>e.id)}:{},quote:``,elements:e,range:a,left:Math.min(...r.map(e=>e.left))-i.left,right:Math.max(...r.map(e=>e.right))-i.left,top:r[0].top-i.top,bottom:r.at(-1).bottom-i.top}}let r=window.getSelection(),i=e.getRootElement();if(!r||r.isCollapsed||r.rangeCount===0||!i?.contains(r.anchorNode)||!i.contains(r.focusNode))return null;let a=r.toString().trim(),o=r.getRangeAt(0),s=e.read(()=>Gr(e,o));if(!s.length||!a)return null;let c=qr(i,r.anchorNode)&&qr(i,r.focusNode),l=[...o.getClientRects()],u=l[0]??o.getBoundingClientRect(),d=l.at(-1)??u,f=t.getBoundingClientRect();return{blockId:s[0].blockId,...s.length>1?{blockIds:s.map(e=>e.blockId),textRanges:s}:c?{textRanges:s}:{},...c?{kind:`nested`}:{},quote:a.slice(0,500),left:u.left-f.left,bottom:d.bottom-f.top,top:u.top-f.top,right:Math.max(...l.map(e=>e.right),d.right)-f.left,range:o.cloneRange()}}function Yr(e,t){let[n,r]=(0,H.useState)(null);return(0,H.useEffect)(()=>{if(!e||!t)return;let n=0,i=()=>{clearTimeout(n),n=window.setTimeout(()=>r(Jr(e,t)),Kr)};document.addEventListener(`selectionchange`,i);let a=e.registerUpdateListener(i);window.addEventListener(`scroll`,i,!0),window.addEventListener(`resize`,i);let o=new ResizeObserver(i);return e.getRootElement()&&o.observe(e.getRootElement()),()=>{clearTimeout(n),document.removeEventListener(`selectionchange`,i),a(),window.removeEventListener(`scroll`,i,!0),window.removeEventListener(`resize`,i),o.disconnect()}},[e,t]),[n,(0,H.useCallback)(()=>{r(null),e?.read(()=>T(re()))&&e.update(()=>E(null))},[e]),(0,H.useCallback)(()=>e&&t?Jr(e,t):null,[e,t])]}function Xr(){let e=new Set;return{emit:t=>e.forEach(e=>e(t)),subscribe:t=>(e.add(t),()=>e.delete(t))}}export{kt as C,st as D,lt as E,Dt as S,St as T,tn as _,Wr as a,Jt as b,Mr as c,wr as d,yr as f,An as g,Rn as h,Ur as i,Dr as l,or as m,Yr as n,Nr as o,vr as p,Gr as r,kr as s,Xr as t,Or as u,Qt as v,Ot as w,At as x,Xt as y};
4
+ `))}}for(let e of Object.values(t))typeof e==`object`&&r(e)};return r(t.state),t}function Mr(e,t){let n;if(t.cloudOrigin){if(!e.to)return;n=new URL(`/a/${encodeURIComponent(e.to)}`,t.cloudOrigin)}else{n=new URL(`/${V(e)}/${encodeURIComponent(B(e))}`,t.sourceUrl);let r=new URL(t.sourceUrl);n.searchParams.set(`at`,r.searchParams.get(`at`)??r.pathname)}for(let t of p)e[t]&&n.searchParams.set(t,e[t]);return n.href}function Nr(e){let[t,r]=(0,H.useState)(!1),[i,a]=(0,H.useState)(!1),o=(0,H.useRef)(e);o.current=e;let s=(0,H.useRef)(null),c=async()=>{let e=o.current;if(!e.editor||e.available===!1||s.current)return;let t=new AbortController;s.current=t,r(!0),a(!1);try{let r=e.editor.getEditorState().toJSON(),i=e.scenes?await Ar(r,e.scenes.load):void 0;if(t.signal.aborted)return;let a=jr({state:r,...i?{embeds:i}:{},comments:e.comments,title:e.title,contentBase:e.contentBase,sourceUrl:location.href,cloudOrigin:y()??(e.cloud?location.origin:void 0)}),{printDocument:o}=await n(async()=>{let{printDocument:e}=await import(`./printDocument-DTucYRWz.js`);return{printDocument:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56]),import.meta.url);await o(a,{signal:t.signal})}catch(e){t.signal.aborted||(a(!0),console.warn(`Document export failed`,e))}finally{s.current===t&&(s.current=null),t.signal.aborted||r(!1)}},u=(0,H.useRef)(c);return u.current=c,(0,H.useEffect)(()=>{r(!1),a(!1);let t=t=>{l(t)&&t.data?.type===`ryugi:document-export`&&t.data.id===e.id&&t.data.format===`pdf`&&u.current()};return window.addEventListener(`message`,t),()=>{window.removeEventListener(`message`,t),s.current?.abort(),s.current=null}},[e.id]),{state:t?`preparing`:e.editor&&e.available!==!1?`ready`:null,error:i,dismiss:()=>a(!1),exportPdf:()=>void c()}}var Pr=2400,Fr=[{boxShadow:`inset 2px 0 0 #0d99ff`,backgroundColor:`rgb(13 153 255 / 0.13)`},{boxShadow:`inset 2px 0 0 transparent`,backgroundColor:`transparent`}];function Ir(e,t){let n=e.getEditorState().read(()=>j().getChildren().find(e=>A(e,P)===t)?.getKey());return n?e.getElementByKey(n):null}var Lr=50,Rr=100;function zr(e){let t=e.indexOf(`:`),n=e.slice(0,t),r=e.slice(t+1);return`[data-ref-chip="${n}"][data-ref-key="${r}"], [data-ref-to="${n}"][data-ref-key="${r}"]`}function Br(e){let t=0,n=setInterval(()=>{let r=document.querySelector(zr(e));r&&J(r),(r||++t>=Lr)&&clearInterval(n)},Rr);return()=>clearInterval(n)}function Vr(e,t){let n=0,r=()=>{let r=Ir(e,t);return r&&(J(r),r.animate(Fr,{duration:Pr,easing:`ease-out`})),!!r||++n>=Lr};if(r())return()=>void 0;let i=setInterval(()=>{r()&&clearInterval(i)},Rr);return()=>clearInterval(i)}var Hr=(e,t)=>V(e)===`document`&&(e.to===t||B(e)===t);function Ur(e,t,r,i,a){let s=!!r,[c,l]=(0,H.useState)(null),p=(0,H.useMemo)(()=>s&&f(),[s]),{role:m}=u(),h=(0,H.useRef)(()=>void 0);return(0,H.useEffect)(()=>{if(!s)return;let e=X(),n=()=>{let n=tt(e.history.state,t);n!==null&&(h.current(),window.scrollTo({top:n,behavior:`instant`}))};return e.addEventListener(`popstate`,n),()=>e.removeEventListener(`popstate`,n)},[s,t]),(0,H.useEffect)(()=>{if(!p)return;let t,n,r=b(r=>{if(r.kind===`active`&&l(r.key),r.kind===`reveal`&&(l(r.key),t?.(),t=Br(r.key)),r.kind===`focus`&&r.block&&e&&(n?.(),n=Vr(e,r.block)),r.kind!==`scroll-to`)return;l(r.key);let i=e&&Ir(e,r.blockId);i&&(J(i),i.animate(Fr,{duration:Pr,easing:`ease-out`}))});return o({kind:`ready`}),()=>{r(),t?.(),n?.()}},[p,e]),(0,H.useMemo)(()=>s?{active:c,isSelf:e=>Hr(e,t),useBoard:r,useScene:i,openEmbed:e=>{if(p)return o({kind:`embed-open`,target:e});let t=a?.refId(e);if(!a||!t)return;let r=Xe(a.frameSrc(`whiteboard`,t),e);n(async()=>{let{openArtifactModal:e}=await import(`./ArtifactModal-C5mrDL4r.js`);return{openArtifactModal:e}},__vite__mapDeps([57,1,10,3,4,2,5,6,7,11,12,13,58,30,59,18,35,60,61,40]),import.meta.url).then(({openArtifactModal:t})=>t({allow:a.frameAllow,src:r,title:e.label??B(e)}))},open:n=>{let r=V(n);if(Hr(n,t)){let r=e&&n.block?Ir(e,n.block):null;if(!r||!n.block){window.scrollTo({top:0,behavior:`instant`});return}p&&m===`beside`?o({kind:`block-focus`,block:n.block}):it(t,n.block,X()),h.current(),h.current=J(r),r.animate(Fr,{duration:Pr,easing:`ease-out`})}else p?o({kind:`ref-open`,target:n}):location.assign(`/document/${t}${d(location.search,nt(B(n),r,n,`document`))}`)}}:null,[s,c,p,m,e,t,r,i,a])}function Wr(e){let[t,n]=(0,H.useState)([]);return(0,H.useEffect)(()=>{if(!e)return;let t=()=>{let t=$e(e.getEditorState().toJSON());n(e=>JSON.stringify(e)===JSON.stringify(t)?e:t)};return t(),e.registerUpdateListener(t)},[e]),t}function Gr(e,t){return j().getChildren().flatMap(n=>{let r=A(n,P),i=e.getElementByKey(n.getKey());if(!r||!i||!t.intersectsNode(i))return[];let a=document.createRange();if(a.selectNodeContents(i),t.compareBoundaryPoints(Range.START_TO_START,a)>0&&a.setStart(t.startContainer,t.startOffset),t.compareBoundaryPoints(Range.END_TO_END,a)<0&&a.setEnd(t.endContainer,t.endOffset),a.collapsed)return[];let o=a.toString();if(!o&&i.textContent)return[];let s=document.createRange();return s.selectNodeContents(i),s.setEnd(a.startContainer,a.startOffset),[{blockId:r,quote:o,start:s.toString().length}]})}var Kr=200;function qr(e,t){let n=(t instanceof Element?t:t?.parentElement)?.closest(`[contenteditable="true"]`);return!!(n&&n!==e&&e.contains(n))}function Jr(e,t){let n=e.read(()=>{let t=re();return T(t)?j().getChildren().flatMap(n=>{if(!t.has(n.getKey()))return[];let r=A(n,P),i=e.getElementByKey(n.getKey());return r&&i?[{id:r,element:i}]:[]}):[]});if(n.length){let e=n.map(e=>e.element),r=e.map(e=>e.getBoundingClientRect()),i=t.getBoundingClientRect(),a=document.createRange();return a.selectNodeContents(e[0]),{kind:`block`,blockId:n[0].id,...n.length>1?{blockIds:n.map(e=>e.id)}:{},quote:``,elements:e,range:a,left:Math.min(...r.map(e=>e.left))-i.left,right:Math.max(...r.map(e=>e.right))-i.left,top:r[0].top-i.top,bottom:r.at(-1).bottom-i.top}}let r=window.getSelection(),i=e.getRootElement();if(!r||r.isCollapsed||r.rangeCount===0||!i?.contains(r.anchorNode)||!i.contains(r.focusNode))return null;let a=r.toString().trim(),o=r.getRangeAt(0),s=e.read(()=>Gr(e,o));if(!s.length||!a)return null;let c=qr(i,r.anchorNode)&&qr(i,r.focusNode),l=[...o.getClientRects()],u=l[0]??o.getBoundingClientRect(),d=l.at(-1)??u,f=t.getBoundingClientRect();return{blockId:s[0].blockId,...s.length>1?{blockIds:s.map(e=>e.blockId),textRanges:s}:c?{textRanges:s}:{},...c?{kind:`nested`}:{},quote:a.slice(0,500),left:u.left-f.left,bottom:d.bottom-f.top,top:u.top-f.top,right:Math.max(...l.map(e=>e.right),d.right)-f.left,range:o.cloneRange()}}function Yr(e,t){let[n,r]=(0,H.useState)(null);return(0,H.useEffect)(()=>{if(!e||!t)return;let n=0,i=()=>{clearTimeout(n),n=window.setTimeout(()=>r(Jr(e,t)),Kr)};document.addEventListener(`selectionchange`,i);let a=e.registerUpdateListener(i);window.addEventListener(`scroll`,i,!0),window.addEventListener(`resize`,i);let o=new ResizeObserver(i);return e.getRootElement()&&o.observe(e.getRootElement()),()=>{clearTimeout(n),document.removeEventListener(`selectionchange`,i),a(),window.removeEventListener(`scroll`,i,!0),window.removeEventListener(`resize`,i),o.disconnect()}},[e,t]),[n,(0,H.useCallback)(()=>{r(null),e?.read(()=>T(re()))&&e.update(()=>E(null))},[e]),(0,H.useCallback)(()=>e&&t?Jr(e,t):null,[e,t])]}function Xr(){let e=new Set;return{emit:t=>e.forEach(e=>e(t)),subscribe:t=>(e.add(t),()=>e.delete(t))}}export{kt as C,st as D,lt as E,Dt as S,St as T,tn as _,Wr as a,Jt as b,Mr as c,wr as d,yr as f,An as g,Rn as h,Ur as i,Dr as l,or as m,Yr as n,Nr as o,vr as p,Gr as r,kr as s,Xr as t,Or as u,Qt as v,Ot as w,At as x,Xt as y};
@@ -1 +1 @@
1
- import{x as e}from"./route-D8zY0lFu.js";import{t}from"./jsx-runtime-LKYXHABd.js";import{Dt as n}from"./MotionConfigContext-HC2vqcJO.js";var r={name:`panel-right`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]};r.node;var i=n(r),a=t(),o=184320,s=262144,c=80,l=e=>e?.trim().slice(0,c)||void 0,u={pin:{kVAEAm:`x10l6tqk`,kzqmXN:`xgd8bvy`,kZKoxP:`x1fgtraw`,kmVPX3:`x1717udv`,k1xSpc:`xrvj5dj`,kgQiWS:`x1ku5rj1`,kaIpWk:`x983p9h`,kMzoRj:`xdh2fpr`,ksu8eU:`x1y0btm7`,kVAM5u:`x1im9181`,kWkggS:`xudn41b`,kMwMTN:`x6l8oc8`,kMv6JI:`xqfszdh`,kGuDYH:`x1j6dyjg`,k63SB2:`x1s688f`,k3aq6I:`x105ttfm`,kfzvcC:`x67bb7w`,kkrTdU:`x1ypdohk`,kGVxlE:`x3oy991`,kY2c9j:`x1q8xho0`,$$css:!0},pinReplied:{kWkggS:`x1cjskoo`,$$css:!0},pinReject:{kWkggS:`x9e8z1k`,$$css:!0},pinResolved:{kWkggS:`x4xwj5a`,kMwMTN:`xcfla50`,$$css:!0},pinDetached:{kWkggS:`x184qs1t`,ksu8eU:`xbsl7fq`,kVAM5u:`x1b74vrs`,kMwMTN:`x16m9qdy`,$$css:!0},pinActive:{kMeerF:`x1s780dp`,k3XXqK:`xaatb59`,kjBf7l:`xr7sard`,$$css:!0}};function d({label:e,rect:t}){return(0,a.jsx)(`div`,{className:`x10l6tqk xvndefy x1y0btm7 x11cp7ww x1mzvsll x1sxf85j x47corl xhtitgo`,style:{left:t.x,top:t.y,width:t.w,height:t.h},children:e?(0,a.jsx)(`div`,{className:`x10l6tqk x1ojtbga x10hu2aj x1qx5ct2 xlkn9b3 x12oqio5 xudn41b x6l8oc8 x1b02387 x1j6dyjg xk50ysn x1fc57z9 xuxw1ft x1va8c73 xb3r6kr xlyipyv`,children:e}):null})}function f({active:t,ariaLabel:n,dataVerdict:r,detached:i,label:o,onClick:s,onMouseEnter:c,onMouseLeave:l,reject:d,replied:f,resolved:p,title:m,x:h,y:g}){return(0,a.jsx)(`button`,{"aria-label":n,"data-verdict":r,title:m,type:`button`,onClick:s,onMouseEnter:c,onMouseLeave:l,...e(u.pin,f&&u.pinReplied,d&&u.pinReject,p&&u.pinResolved,i&&u.pinDetached,t&&u.pinActive),style:{left:h,top:g},children:o})}function p({x:e,y:t}){return(0,a.jsx)(`span`,{className:`x10l6tqk xgd8bvy x1fgtraw x1717udv xrvj5dj x1ku5rj1 x983p9h xdh2fpr x1y0btm7 x1im9181 xudn41b x6l8oc8 xqfszdh x1j6dyjg x1s688f x105ttfm x67bb7w x1ypdohk x3oy991 x1q8xho0`,style:{left:e,top:t}})}function m({children:e,style:t}){return(0,a.jsx)(`div`,{className:`x10l6tqk x1cvmir6 x18b33ah xixl9f9 xmkeg23 x1y0btm7 x12xov25 x12ilycc xo2rkog x1d5q07e x67bb7w xt0e3qv x1hx0egp x1355qak`,style:t,children:e})}var h=1024,g=768;function _(e){let t=e.slice(e.indexOf(`,`)+1),n=t.endsWith(`==`)?2:+!!t.endsWith(`=`);return Math.floor(t.length*3/4)-n}function v(e){return async(t,n,r)=>{let i=document.createElement(`canvas`);i.width=Math.max(1,Math.round(t.sw*n)),i.height=Math.max(1,Math.round(t.sh*n));let a=i.getContext(`2d`);return a?(a.fillStyle=`#fff`,a.fillRect(0,0,i.width,i.height),e(a,t,i.width,i.height),i.toDataURL(`image/jpeg`,r)):null}}async function y(e,t,n=o){let r=Math.max(t.sw,t.sh);if(r<=0)return null;let i=Math.min(1,h/r),a=Math.min(g,r)/r,s=Math.max(i*.75,a),c=[[i,.85],[i,.7],...s<i?[[s,.7]]:[]];for(let[r,i]of c){let a=await e.encode(t,r,i);if(!a)return null;if(_(a)<=n)return a}return null}export{f as a,s as c,i as d,m as i,o as l,_ as n,p as o,y as r,d as s,v as t,l as u};
1
+ import{x as e}from"./route-C7yP-PEQ.js";import{t}from"./jsx-runtime-LKYXHABd.js";import{Dt as n}from"./MotionConfigContext-HC2vqcJO.js";var r={name:`panel-right`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]};r.node;var i=n(r),a=t(),o=184320,s=262144,c=80,l=e=>e?.trim().slice(0,c)||void 0,u={pin:{kVAEAm:`x10l6tqk`,kzqmXN:`xgd8bvy`,kZKoxP:`x1fgtraw`,kmVPX3:`x1717udv`,k1xSpc:`xrvj5dj`,kgQiWS:`x1ku5rj1`,kaIpWk:`x983p9h`,kMzoRj:`xdh2fpr`,ksu8eU:`x1y0btm7`,kVAM5u:`x1im9181`,kWkggS:`xudn41b`,kMwMTN:`x6l8oc8`,kMv6JI:`xqfszdh`,kGuDYH:`x1j6dyjg`,k63SB2:`x1s688f`,k3aq6I:`x105ttfm`,kfzvcC:`x67bb7w`,kkrTdU:`x1ypdohk`,kGVxlE:`x3oy991`,kY2c9j:`x1q8xho0`,$$css:!0},pinReplied:{kWkggS:`x1cjskoo`,$$css:!0},pinReject:{kWkggS:`x9e8z1k`,$$css:!0},pinResolved:{kWkggS:`x4xwj5a`,kMwMTN:`xcfla50`,$$css:!0},pinDetached:{kWkggS:`x184qs1t`,ksu8eU:`xbsl7fq`,kVAM5u:`x1b74vrs`,kMwMTN:`x16m9qdy`,$$css:!0},pinActive:{kMeerF:`x1s780dp`,k3XXqK:`xaatb59`,kjBf7l:`xr7sard`,$$css:!0}};function d({label:e,rect:t}){return(0,a.jsx)(`div`,{className:`x10l6tqk xvndefy x1y0btm7 x11cp7ww x1mzvsll x1sxf85j x47corl xhtitgo`,style:{left:t.x,top:t.y,width:t.w,height:t.h},children:e?(0,a.jsx)(`div`,{className:`x10l6tqk x1ojtbga x10hu2aj x1qx5ct2 xlkn9b3 x12oqio5 xudn41b x6l8oc8 x1b02387 x1j6dyjg xk50ysn x1fc57z9 xuxw1ft x1va8c73 xb3r6kr xlyipyv`,children:e}):null})}function f({active:t,ariaLabel:n,dataVerdict:r,detached:i,label:o,onClick:s,onMouseEnter:c,onMouseLeave:l,reject:d,replied:f,resolved:p,title:m,x:h,y:g}){return(0,a.jsx)(`button`,{"aria-label":n,"data-verdict":r,title:m,type:`button`,onClick:s,onMouseEnter:c,onMouseLeave:l,...e(u.pin,f&&u.pinReplied,d&&u.pinReject,p&&u.pinResolved,i&&u.pinDetached,t&&u.pinActive),style:{left:h,top:g},children:o})}function p({x:e,y:t}){return(0,a.jsx)(`span`,{className:`x10l6tqk xgd8bvy x1fgtraw x1717udv xrvj5dj x1ku5rj1 x983p9h xdh2fpr x1y0btm7 x1im9181 xudn41b x6l8oc8 xqfszdh x1j6dyjg x1s688f x105ttfm x67bb7w x1ypdohk x3oy991 x1q8xho0`,style:{left:e,top:t}})}function m({children:e,style:t}){return(0,a.jsx)(`div`,{className:`x10l6tqk x1cvmir6 x18b33ah xixl9f9 xmkeg23 x1y0btm7 x12xov25 x12ilycc xo2rkog x1d5q07e x67bb7w xt0e3qv x1hx0egp x1355qak`,style:t,children:e})}var h=1024,g=768;function _(e){let t=e.slice(e.indexOf(`,`)+1),n=t.endsWith(`==`)?2:+!!t.endsWith(`=`);return Math.floor(t.length*3/4)-n}function v(e){return async(t,n,r)=>{let i=document.createElement(`canvas`);i.width=Math.max(1,Math.round(t.sw*n)),i.height=Math.max(1,Math.round(t.sh*n));let a=i.getContext(`2d`);return a?(a.fillStyle=`#fff`,a.fillRect(0,0,i.width,i.height),e(a,t,i.width,i.height),i.toDataURL(`image/jpeg`,r)):null}}async function y(e,t,n=o){let r=Math.max(t.sw,t.sh);if(r<=0)return null;let i=Math.min(1,h/r),a=Math.min(g,r)/r,s=Math.max(i*.75,a),c=[[i,.85],[i,.7],...s<i?[[s,.7]]:[]];for(let[r,i]of c){let a=await e.encode(t,r,i);if(!a)return null;if(_(a)<=n)return a}return null}export{f as a,s as c,i as d,m as i,o as l,_ as n,p as o,y as r,d as s,v as t,l as u};
@@ -1 +1 @@
1
- import{Qt as e,Yt as t,an as n,dn as r,fn as i,gn as a,hn as o,in as s,ln as c,mn as l,nn as u,on as d,pn as f,rn as p,sn as m,un as h}from"./editor-DrmCUAHn.js";var g=class{constructor(e,t,n,r){this.state=e,this.pos=t,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let n=e(this.state).resolveInner(this.pos,-1);for(;n&&t.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.text.slice(n-t.from,this.pos-t.from),i=r.search(x(e,!1));return i<0?null:{from:n+i,to:this.pos,text:r.slice(i)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,n){e==`abort`&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}};function _(e){let t=Object.keys(e).join(``),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,``)),`[${n?`\\w`:``}${t.replace(/[^\w\s]/g,`\\$&`)}]`}function v(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let e=1;e<r.length;e++)n[r[e]]=!0}let r=_(t)+_(n)+`*$`;return[RegExp(`^`+r),new RegExp(r)]}function y(e){let t=e.map(e=>typeof e==`string`?{label:e}:e),[n,r]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:v(t);return e=>{let i=e.matchBefore(r);return i||e.explicit?{from:i?i.from:e.pos,options:t,validFor:n}:null}}function b(t,n){return r=>{for(let n=e(r.state).resolveInner(r.pos,-1);n;n=n.parent){if(t.indexOf(n.name)>-1)return null;if(n.type.isTop)break}return n(r)}}function x(e,t){let{source:n}=e,r=t&&n[0]!=`^`,i=n[n.length-1]!=`$`;return!r&&!i?e:RegExp(`${r?`^`:``}(?:${n})${i?`$`:``}`,e.flags??(e.ignoreCase?`i`:``))}var S=d.define();typeof navigator==`object`&&navigator.platform;var C=p.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:`monospace`,whiteSpace:`nowrap`,overflow:`hidden auto`,maxWidth_fallback:`700px`,maxWidth:`min(700px, 95vw)`,minWidth:`250px`,maxHeight:`10em`,height:`100%`,listStyle:`none`,margin:0,padding:0,"& > li, & > completion-section":{padding:`1px 3px`,lineHeight:1.2},"& > li":{overflowX:`hidden`,textOverflow:`ellipsis`,cursor:`pointer`},"& > completion-section":{display:`list-item`,borderBottom:`1px solid silver`,paddingLeft:`0.5em`,opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#17c`,color:`white`},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#777`},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#347`,color:`white`},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#444`},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:`"···"`,opacity:.5,display:`block`,textAlign:`center`,cursor:`pointer`},".cm-tooltip.cm-completionInfo":{position:`absolute`,padding:`3px 9px`,width:`max-content`,maxWidth:`400px`,boxSizing:`border-box`,whiteSpace:`pre-line`},".cm-completionInfo.cm-completionInfo-left":{right:`100%`},".cm-completionInfo.cm-completionInfo-right":{left:`100%`},".cm-completionInfo.cm-completionInfo-left-narrow":{right:`30px`},".cm-completionInfo.cm-completionInfo-right-narrow":{left:`30px`},"&light .cm-snippetField":{backgroundColor:`#00000022`},"&dark .cm-snippetField":{backgroundColor:`#ffffff22`},".cm-snippetFieldPosition":{verticalAlign:`text-top`,width:0,height:`1.15em`,display:`inline-block`,margin:`0 -0.7px -.7em`,borderLeft:`1.4px dotted #888`},".cm-completionMatchedText":{textDecoration:`underline`},".cm-completionDetail":{marginLeft:`0.5em`,fontStyle:`italic`},".cm-completionIcon":{fontSize:`90%`,width:`.8em`,display:`inline-block`,textAlign:`center`,paddingRight:`.6em`,opacity:`0.6`,boxSizing:`content-box`},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:`'ƒ'`}},".cm-completionIcon-class":{"&:after":{content:`'○'`}},".cm-completionIcon-interface":{"&:after":{content:`'◌'`}},".cm-completionIcon-variable":{"&:after":{content:`'𝑥'`}},".cm-completionIcon-constant":{"&:after":{content:`'𝐶'`}},".cm-completionIcon-type":{"&:after":{content:`'𝑡'`}},".cm-completionIcon-enum":{"&:after":{content:`'∪'`}},".cm-completionIcon-property":{"&:after":{content:`'□'`}},".cm-completionIcon-keyword":{"&:after":{content:`'🔑︎'`}},".cm-completionIcon-namespace":{"&:after":{content:`'▢'`}},".cm-completionIcon-text":{"&:after":{content:`'abc'`,fontSize:`50%`,verticalAlign:`middle`}}}),w=class{constructor(e,t,n,r){this.field=e,this.line=t,this.from=n,this.to=r}},T=class e{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(t){let n=t.mapPos(this.from,-1,h.TrackDel),r=t.mapPos(this.to,1,h.TrackDel);return n==null||r==null?null:new e(this.field,n,r)}},E=class e{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,n){let r=[],i=[n],a=e.doc.lineAt(n),o=/^\s*/.exec(a.text)[0];for(let a of this.lines){if(r.length){let r=o,s=/^\t*/.exec(a)[0].length;for(let n=0;n<s;n++)r+=e.facet(t);i.push(n+r.length-s),a=r+a.slice(s)}r.push(a),n+=a.length+1}return{text:r,ranges:this.fieldPositions.map(e=>new T(e.field,i[e.line]+e.from,i[e.line]+e.to))}}static parse(t){let n=[],r=[],i=[],a;for(let e of t.split(/\r\n?|\n/)){for(;a=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(e);){let t=a[1]?+a[1]:null,o=a[2]||a[3]||``,s=-1;t===0&&(t=1e9);let c=o.replace(/\\[{}]/g,e=>e[1]);for(let e=0;e<n.length;e++)(t==null?c&&n[e].name==c:n[e].seq==t)&&(s=e);if(s<0){let e=0;for(;e<n.length&&(t==null||n[e].seq!=null&&n[e].seq<t);)e++;n.splice(e,0,{seq:t,name:c}),s=e;for(let e of i)e.field>=s&&e.field++}for(let e of i)if(e.line==r.length&&e.from>a.index){let t=a[2]?3+(a[1]||``).length:2;e.from-=t,e.to-=t}i.push(new w(s,r.length,a.index,a.index+c.length)),e=e.slice(0,a.index)+o+e.slice(a.index+a[0].length)}e=e.replace(/\\([{}])/g,(e,t,n)=>{for(let e of i)e.line==r.length&&e.from>n&&(e.from--,e.to--);return t}),r.push(e)}return new e(r,i)}},D=u.widget({widget:new class extends s{toDOM(){let e=document.createElement(`span`);return e.className=`cm-snippetFieldPosition`,e}ignoreEvent(){return!1}}}),O=u.mark({class:`cm-snippetField`}),k=class e{constructor(e,t){this.ranges=e,this.active=t,this.deco=u.set(e.map(e=>(e.from==e.to?D:O).range(e.from,e.to)),!0)}map(t){let n=[];for(let e of this.ranges){let r=e.map(t);if(!r)return null;n.push(r)}return new e(n,this.active)}selectionInsideField(e){return e.ranges.every(e=>this.ranges.some(t=>t.field==this.active&&t.from<=e.from&&t.to>=e.to))}},A=f.define({map(e,t){return e&&e.map(t)}}),j=f.define(),M=l.define({create(){return null},update(e,t){for(let n of t.effects){if(n.is(A))return n.value;if(n.is(j)&&e)return new k(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>p.decorations.from(e,e=>e?e.deco:u.none)});function N(e,t){return m.create(e.filter(e=>e.field==t).map(e=>m.range(e.from,e.to)))}function P(e){let t=E.parse(e);return(e,n,r,i)=>{let{text:s,ranges:c}=t.instantiate(e.state,r),{main:l}=e.state.selection,u={changes:{from:r,to:i==l.from?l.to:i,insert:o.of(s)},scrollIntoView:!0,annotations:n?[S.of(n),a.userEvent.of(`input.complete`)]:void 0};if(c.length&&(u.selection=N(c,0)),c.some(e=>e.field>0)){let t=new k(c,0),n=u.effects=[A.of(t)];e.state.field(M,!1)===void 0&&n.push(f.appendConfig.of([M,R,B,C]))}e.dispatch(e.state.update(u))}}function F(e){return({state:t,dispatch:n})=>{let r=t.field(M,!1);if(!r||e<0&&r.active==0)return!1;let i=r.active+e,a=e>0&&!r.ranges.some(t=>t.field==i+e);return n(t.update({selection:N(r.ranges,i),effects:A.of(a?null:new k(r.ranges,i)),scrollIntoView:!0})),!0}}var I=[{key:`Tab`,run:F(1),shift:F(-1)},{key:`Escape`,run:({state:e,dispatch:t})=>e.field(M,!1)?(t(e.update({effects:A.of(null)})),!0):!1}],L=c.define({combine(e){return e.length?e[0]:I}}),R=r.highest(n.compute([L],e=>e.facet(L)));function z(e,t){return{...t,apply:P(e)}}var B=p.domEventHandlers({mousedown(e,t){let n=t.state.field(M,!1),r;if(!n||(r=t.posAtCoords({x:e.clientX,y:e.clientY}))==null)return!1;let i=n.ranges.find(e=>e.from<=r&&e.to>=r);return!i||i.field==n.active?!1:(t.dispatch({selection:N(n.ranges,i.field),effects:A.of(n.ranges.some(e=>e.field>i.field)?new k(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),V=new class extends i{};V.startSide=1,V.endSide=-1,typeof navigator==`object`&&navigator.userAgent;export{z as i,y as n,b as r,g as t};
1
+ import{Qt as e,Yt as t,an as n,dn as r,fn as i,gn as a,hn as o,in as s,ln as c,mn as l,nn as u,on as d,pn as f,rn as p,sn as m,un as h}from"./editor-BA7mo2fo.js";var g=class{constructor(e,t,n,r){this.state=e,this.pos=t,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let n=e(this.state).resolveInner(this.pos,-1);for(;n&&t.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.text.slice(n-t.from,this.pos-t.from),i=r.search(x(e,!1));return i<0?null:{from:n+i,to:this.pos,text:r.slice(i)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,n){e==`abort`&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}};function _(e){let t=Object.keys(e).join(``),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,``)),`[${n?`\\w`:``}${t.replace(/[^\w\s]/g,`\\$&`)}]`}function v(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let e=1;e<r.length;e++)n[r[e]]=!0}let r=_(t)+_(n)+`*$`;return[RegExp(`^`+r),new RegExp(r)]}function y(e){let t=e.map(e=>typeof e==`string`?{label:e}:e),[n,r]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:v(t);return e=>{let i=e.matchBefore(r);return i||e.explicit?{from:i?i.from:e.pos,options:t,validFor:n}:null}}function b(t,n){return r=>{for(let n=e(r.state).resolveInner(r.pos,-1);n;n=n.parent){if(t.indexOf(n.name)>-1)return null;if(n.type.isTop)break}return n(r)}}function x(e,t){let{source:n}=e,r=t&&n[0]!=`^`,i=n[n.length-1]!=`$`;return!r&&!i?e:RegExp(`${r?`^`:``}(?:${n})${i?`$`:``}`,e.flags??(e.ignoreCase?`i`:``))}var S=d.define();typeof navigator==`object`&&navigator.platform;var C=p.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:`monospace`,whiteSpace:`nowrap`,overflow:`hidden auto`,maxWidth_fallback:`700px`,maxWidth:`min(700px, 95vw)`,minWidth:`250px`,maxHeight:`10em`,height:`100%`,listStyle:`none`,margin:0,padding:0,"& > li, & > completion-section":{padding:`1px 3px`,lineHeight:1.2},"& > li":{overflowX:`hidden`,textOverflow:`ellipsis`,cursor:`pointer`},"& > completion-section":{display:`list-item`,borderBottom:`1px solid silver`,paddingLeft:`0.5em`,opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#17c`,color:`white`},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#777`},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:`#347`,color:`white`},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:`#444`},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:`"···"`,opacity:.5,display:`block`,textAlign:`center`,cursor:`pointer`},".cm-tooltip.cm-completionInfo":{position:`absolute`,padding:`3px 9px`,width:`max-content`,maxWidth:`400px`,boxSizing:`border-box`,whiteSpace:`pre-line`},".cm-completionInfo.cm-completionInfo-left":{right:`100%`},".cm-completionInfo.cm-completionInfo-right":{left:`100%`},".cm-completionInfo.cm-completionInfo-left-narrow":{right:`30px`},".cm-completionInfo.cm-completionInfo-right-narrow":{left:`30px`},"&light .cm-snippetField":{backgroundColor:`#00000022`},"&dark .cm-snippetField":{backgroundColor:`#ffffff22`},".cm-snippetFieldPosition":{verticalAlign:`text-top`,width:0,height:`1.15em`,display:`inline-block`,margin:`0 -0.7px -.7em`,borderLeft:`1.4px dotted #888`},".cm-completionMatchedText":{textDecoration:`underline`},".cm-completionDetail":{marginLeft:`0.5em`,fontStyle:`italic`},".cm-completionIcon":{fontSize:`90%`,width:`.8em`,display:`inline-block`,textAlign:`center`,paddingRight:`.6em`,opacity:`0.6`,boxSizing:`content-box`},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:`'ƒ'`}},".cm-completionIcon-class":{"&:after":{content:`'○'`}},".cm-completionIcon-interface":{"&:after":{content:`'◌'`}},".cm-completionIcon-variable":{"&:after":{content:`'𝑥'`}},".cm-completionIcon-constant":{"&:after":{content:`'𝐶'`}},".cm-completionIcon-type":{"&:after":{content:`'𝑡'`}},".cm-completionIcon-enum":{"&:after":{content:`'∪'`}},".cm-completionIcon-property":{"&:after":{content:`'□'`}},".cm-completionIcon-keyword":{"&:after":{content:`'🔑︎'`}},".cm-completionIcon-namespace":{"&:after":{content:`'▢'`}},".cm-completionIcon-text":{"&:after":{content:`'abc'`,fontSize:`50%`,verticalAlign:`middle`}}}),w=class{constructor(e,t,n,r){this.field=e,this.line=t,this.from=n,this.to=r}},T=class e{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(t){let n=t.mapPos(this.from,-1,h.TrackDel),r=t.mapPos(this.to,1,h.TrackDel);return n==null||r==null?null:new e(this.field,n,r)}},E=class e{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,n){let r=[],i=[n],a=e.doc.lineAt(n),o=/^\s*/.exec(a.text)[0];for(let a of this.lines){if(r.length){let r=o,s=/^\t*/.exec(a)[0].length;for(let n=0;n<s;n++)r+=e.facet(t);i.push(n+r.length-s),a=r+a.slice(s)}r.push(a),n+=a.length+1}return{text:r,ranges:this.fieldPositions.map(e=>new T(e.field,i[e.line]+e.from,i[e.line]+e.to))}}static parse(t){let n=[],r=[],i=[],a;for(let e of t.split(/\r\n?|\n/)){for(;a=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(e);){let t=a[1]?+a[1]:null,o=a[2]||a[3]||``,s=-1;t===0&&(t=1e9);let c=o.replace(/\\[{}]/g,e=>e[1]);for(let e=0;e<n.length;e++)(t==null?c&&n[e].name==c:n[e].seq==t)&&(s=e);if(s<0){let e=0;for(;e<n.length&&(t==null||n[e].seq!=null&&n[e].seq<t);)e++;n.splice(e,0,{seq:t,name:c}),s=e;for(let e of i)e.field>=s&&e.field++}for(let e of i)if(e.line==r.length&&e.from>a.index){let t=a[2]?3+(a[1]||``).length:2;e.from-=t,e.to-=t}i.push(new w(s,r.length,a.index,a.index+c.length)),e=e.slice(0,a.index)+o+e.slice(a.index+a[0].length)}e=e.replace(/\\([{}])/g,(e,t,n)=>{for(let e of i)e.line==r.length&&e.from>n&&(e.from--,e.to--);return t}),r.push(e)}return new e(r,i)}},D=u.widget({widget:new class extends s{toDOM(){let e=document.createElement(`span`);return e.className=`cm-snippetFieldPosition`,e}ignoreEvent(){return!1}}}),O=u.mark({class:`cm-snippetField`}),k=class e{constructor(e,t){this.ranges=e,this.active=t,this.deco=u.set(e.map(e=>(e.from==e.to?D:O).range(e.from,e.to)),!0)}map(t){let n=[];for(let e of this.ranges){let r=e.map(t);if(!r)return null;n.push(r)}return new e(n,this.active)}selectionInsideField(e){return e.ranges.every(e=>this.ranges.some(t=>t.field==this.active&&t.from<=e.from&&t.to>=e.to))}},A=f.define({map(e,t){return e&&e.map(t)}}),j=f.define(),M=l.define({create(){return null},update(e,t){for(let n of t.effects){if(n.is(A))return n.value;if(n.is(j)&&e)return new k(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>p.decorations.from(e,e=>e?e.deco:u.none)});function N(e,t){return m.create(e.filter(e=>e.field==t).map(e=>m.range(e.from,e.to)))}function P(e){let t=E.parse(e);return(e,n,r,i)=>{let{text:s,ranges:c}=t.instantiate(e.state,r),{main:l}=e.state.selection,u={changes:{from:r,to:i==l.from?l.to:i,insert:o.of(s)},scrollIntoView:!0,annotations:n?[S.of(n),a.userEvent.of(`input.complete`)]:void 0};if(c.length&&(u.selection=N(c,0)),c.some(e=>e.field>0)){let t=new k(c,0),n=u.effects=[A.of(t)];e.state.field(M,!1)===void 0&&n.push(f.appendConfig.of([M,R,B,C]))}e.dispatch(e.state.update(u))}}function F(e){return({state:t,dispatch:n})=>{let r=t.field(M,!1);if(!r||e<0&&r.active==0)return!1;let i=r.active+e,a=e>0&&!r.ranges.some(t=>t.field==i+e);return n(t.update({selection:N(r.ranges,i),effects:A.of(a?null:new k(r.ranges,i)),scrollIntoView:!0})),!0}}var I=[{key:`Tab`,run:F(1),shift:F(-1)},{key:`Escape`,run:({state:e,dispatch:t})=>e.field(M,!1)?(t(e.update({effects:A.of(null)})),!0):!1}],L=c.define({combine(e){return e.length?e[0]:I}}),R=r.highest(n.compute([L],e=>e.facet(L)));function z(e,t){return{...t,apply:P(e)}}var B=p.domEventHandlers({mousedown(e,t){let n=t.state.field(M,!1),r;if(!n||(r=t.posAtCoords({x:e.clientX,y:e.clientY}))==null)return!1;let i=n.ranges.find(e=>e.from<=r&&e.to>=r);return!i||i.field==n.active?!1:(t.dispatch({selection:N(n.ranges,i.field),effects:A.of(n.ranges.some(e=>e.field>i.field)?new k(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),V=new class extends i{};V.startSide=1,V.endSide=-1,typeof navigator==`object`&&navigator.userAgent;export{z as i,y as n,b as r,g as t};
@@ -1 +1 @@
1
- import{En as e,Ft as t,Jt as n,Kt as r,Qt as i,Rt as a,Ut as o,en as s,rn as c,sn as l,tn as u}from"./editor-DrmCUAHn.js";import{html as d}from"./dist-C0NUbcXW.js";import{n as f,r as p}from"./dist-BvrTRRD6.js";var m=1,h=2,g=3,_=183,v=4,y=184,b=5,x=185,S=6;function C(e){return e>=65&&e<=90||e>=97&&e<=122}var w=new f(e=>{let t=e.pos;for(;;){let{next:n}=e;if(n<0)break;if(n==123){let n=e.peek(1);if(n==123){if(e.pos>t)break;e.acceptToken(m,2);return}if(n==37){if(e.pos>t)break;let n=2,r=2;for(;;){let t=e.peek(n);if(t==32||t==10)++n;else if(t==35)for(++n;;){let t=e.peek(n);if(t<0||t==10)break;n++}else if(t==45&&r==2)r=++n;else{let i=t==101&&e.peek(n+1)==110&&e.peek(n+2)==100;e.acceptToken(i?g:h,r);return}}}}if(e.advance(),n==10)break}e.pos>t&&e.acceptToken(_)});function T(e,t,n){return new f(r=>{let i=r.pos;for(;;){let{next:t}=r;if(t==123&&r.peek(1)==37){let t=2;for(;;t++){let e=r.peek(t);if(e!=32&&e!=10)break}let a=``;for(;;t++){let e=r.peek(t);if(!C(e))break;a+=String.fromCharCode(e)}if(a==e){if(r.pos>i)break;r.acceptToken(n,2);break}}else if(t<0)break;if(r.advance(),t==10)break}r.pos>i&&r.acceptToken(t)})}var E=T(`endcomment`,x,b),D=T(`endraw`,y,v),O=new f(e=>{if(e.next==35){for(e.advance();!(e.next==10||e.next<0||(e.next==37||e.next==125)&&e.peek(1)==125);)e.advance();e.acceptToken(S)}}),k={__proto__:null,contains:34,or:38,and:38,true:52,false:52,empty:54,forloop:57,tablerowloop:59,continue:61,in:135,with:199,for:201,as:203,if:239,endif:243,unless:249,endunless:253,elsif:257,else:261,case:267,endcase:271,when:275,endfor:283,tablerow:289,endtablerow:293,break:297,cycle:303,echo:307,render:311,include:315,assign:319,capture:325,endcapture:329,increment:333,decrement:337},A={__proto__:null,if:90,endif:94,elsif:98,else:102,unless:108,endunless:112,case:118,endcase:122,when:126,for:132,endfor:140,tablerow:146,endtablerow:150,break:154,continue:158,cycle:162,comment:168,endcomment:174,raw:180,endraw:186,echo:190,render:194,include:206,assign:210,capture:216,endcapture:220,increment:224,decrement:228,liquid:232},j=p.deserialize({version:14,states:"MfQYOPOOOOOP'#F}'#F}OhOaO'#CdOyQhO'#CfO!hQxO'#DUO$ROPO'#DXO$aOPO'#DbO$oOPO'#DgO$}OPO'#DnO%]OPO'#DuO%kOSO'#EQO%pOQO'#EWO%uOPO'#EjO&TQxO'#F{OOOP'#Gj'#GjOOOP'#G`'#G`OOOP'#F|'#F|QYOPOOOOOP-E9{-E9{OOQW'#Cg'#CgO&nQ!jO,59QO&uQ!jO'#GaOyQhO'#CtOOQW'#Ge'#GeOOQW'#Gf'#GfOOQW'#Gg'#GgOOQW'#Ga'#GaOOOP,59p,59pO*SQhO,59pOyQhO,59tOyQhO,59xO*^QhO,59zOyQhO,59}OyQhO,5:SOyQhO,5:WO!cQhO,5:ZO!cQhO,5:bO*cQhO,5:fO*hQhO,5:hO*mQhO,5:jO*rQhO,5:mO*wQhO,5:sOyQhO,5:xOyQhO,5:zOyQhO,5;QOyQhO,5;SOyQhO,5;VOyQhO,5;ZOyQhO,5;]O,WQhO,5;_O,_OPO'#CdOOOP,59s,59sO$ROPO,59sO,mQxO'#F{OOOP,59|,59|O$aOPO,59|O,uQxO'#F{OOOP,5:R,5:RO$oOPO,5:RO,}QxO'#F{OOOP,5:Y,5:YO$}OPO,5:YO-VQxO'#F{OOOP,5:a,5:aO%]OPO,5:aO-_QxO'#F{OOOS'#GT'#GTO-gOSO'#ETO-oOSO,5:lOOOQ'#GU'#GUO-tOQO'#EZO-|OQO,5:rOOOP,5;U,5;UO%uOPO,5;UO.RQxO'#F{O.ZQhO,5<gOOOP-E9z-E9zO.`Q#|O,59SOyQhO,59VOyQhO,59WOyQhO,59WO.eQhO'#C}OOQW'#GO'#GOO.jQhO1G.lOOOP1G.l1G.lOyQhO,59WOyQhO,59[O/TQ!jO,59`O/[Q!jO'#CgO1kQ!jO'#Gi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&X&_&d&nm#t!R#k#n#u#y#|$^$e%|&R&X&_&d&nT&V#u&Xm#w!R#k#n#u#y#|$^$e%|&R&X&_&d&nT&]#y&_m#{!R#k#n#u#y#|$^$e%|&R&X&_&d&nT&b#|&dm$O!R#k#n#u#y#|$^$e%|&R&X&_&d&nm$R!R#k#n#u#y#|$^$e%|&R&X&_&d&nm$T!R#k#n#u#y#|$^$e%|&R&X&_&d&nm$V!R#k#n#u#y#|$^$e%|&R&X&_&d&nm$X!R#k#n#u#y#|$^$e%|&R&X&_&d&nm$Z!R#k#n#u#y#|$^$e%|&R&X&_&d&nm$]!R#k#n#u#y#|$^$e%|&R&X&_&d&nT&l$^&nm$`!R#k#n#u#y#|$^$e%|&R&X&_&d&nm$b!R#k#n#u#y#|$^$e%|&R&X&_&d&n",nodeNames:`⚠ {{ {% {% {% {% InlineComment Template Text }} Interpolation VariableName MemberExpression . PropertyName SubscriptExpression BinaryExpression contains CompareOp LogicOp AssignmentExpression AssignOp ) ( RangeExpression .. BooleanLiteral empty forloop tablerowloop continue StringLiteral NumberLiteral Filter | FilterName : NamedArgument ParameterName , Tag TagName %} IfDirective Tag if EndTag endif Tag elsif Tag else UnlessDirective Tag unless EndTag endunless CaseDirective Tag case EndTag endcase Tag when ForDirective Tag for in Parameter EndTag endfor TableDirective Tag tablerow EndTag endtablerow Tag break Tag continue Tag cycle Comment Tag comment CommentText EndTag endcomment RawDirective Tag raw RawText EndTag endraw Tag echo Tag render RenderParameter with for as Tag include Tag assign CaptureDirective Tag capture EndTag endcapture Tag increment Tag decrement Tag liquid IfDirective Tag if EndTag endif UnlessDirective Tag unless EndTag endunless Tag elsif Tag else CaseDirective Tag case EndTag endcase Tag when ForDirective Tag EndTag endfor TableDirective Tag tablerow EndTag endtablerow Tag break Tag Tag cycle Tag echo Tag render Tag include Tag assign CaptureDirective Tag capture EndTag endcapture Tag increment Tag decrement EndTag`,maxTerm:225,nodeProps:[[`closedBy`,1,`}}`,-4,2,3,4,5,`%}`,23,`)`],[`openedBy`,9,`{{`,22,`(`,42,`{%`],[`group`,-13,11,12,15,16,20,24,26,27,28,29,30,31,32,`Expression`]],skippedNodes:[0,6],repeatNodeCount:12,tokenData:")e~RmXY!|YZ!|]^!|pq!|qr#_rs#juv$[wx$gxy%Syz%X{|%^|}&x}!O&}!O!P'Z!Q![&g![!]'k!^!_'p!_!`'x!`!a'p!c!}(Q!}#O(y#P#Q)O#R#S(Q#T#o(Q#p#q)T#q#r)Y%W;'S(Q;'S;:j(s<%lO(Q~#RS%R~XY!|YZ!|]^!|pq!|~#bP!_!`#e~#jOb~~#mUOY#jZr#jrs$Ps;'S#j;'S;=`$U<%lO#j~$UOo~~$XP;=`<%l#j~$_P#q#r$b~$gOz~~$jUOY$gZw$gwx$Px;'S$g;'S;=`$|<%lO$g~%PP;=`<%l$g~%XOg~~%^Of~P%aQ!O!P%g!Q![&gP%jP!Q![%mP%rRpP!Q![%m!g!h%{#X#Y%{P&OR{|&X}!O&X!Q![&_P&[P!Q![&_P&dPpP!Q![&_P&lSpP!O!P%g!Q![&g!g!h%{#X#Y%{~&}Ow~~'QRuv$[!O!P%g!Q![&g~'`Q]S!O!P'f!Q![%m~'kOi~~'pOt~~'uPb~!_!`#e~'}Pe~!_!`#e_(ZW^WyQ%UT}!O(Q!Q![(Q!c!}(Q#R#S(Q#T#o(Q%W;'S(Q;'S;:j(s<%lO(Q_(vP;=`<%l(Q~)OO%W~~)TO%V~~)YOr~~)]P#q#r)`~)eOX~",tokenizers:[w,D,E,O,0,1,2,3],topRules:{Template:[0,7]},dynamicPrecedences:{193:1,194:1,195:1,199:1,200:1,201:1,202:1,204:1,205:1,206:1,207:1,208:1,209:1,210:1,211:1,212:1,213:1,214:1,215:1,216:1,217:1,218:1,219:1,220:1,221:1,222:1,223:1,224:1,225:1},specialized:[{term:190,get:e=>k[e]||-1},{term:41,get:e=>A[e]||-1}],tokenPrec:0});function M(e,t){return e.split(` `).map(e=>({label:e,type:t}))}var N=M(`abs append at_least at_most capitalize ceil compact concat date default divided_by downcase escape escape_once first floor join last lstrip map minus modulo newline_to_br plus prepend remove remove_first replace replace_first reverse round rstrip size slice sort sort_natural split strip strip_html strip_newlines sum times truncate truncatewords uniq upcase url_decode url_encode where`,`function`),P=M(`cycle comment endcomment raw endraw echo increment decrement liquid if elsif else endif unless endunless case endcase for endfor tablerow endtablerow break continue assign capture endcapture render include`,`keyword`),F=M(`empty forloop tablerowloop in with as`,`keyword`),I=M(`first index index0 last length rindex`,`property`),L=M(`col col0 col_first col_last first index index0 last length rindex rindex0 row`,`property`);function R(e){let{state:t,pos:n}=e,r=i(t).resolveInner(n,-1).enterUnfinishedNodesBefore(n),a=r.childBefore(n)?.name||r.name;if(r.name==`FilterName`)return{type:`filter`,node:r};if(e.explicit&&a==`|`)return{type:`filter`};if(r.name==`TagName`)return{type:`tag`,node:r};if(e.explicit&&a==`{%`)return{type:`tag`};if(r.name==`PropertyName`&&r.parent.name==`MemberExpression`)return{type:`property`,node:r,target:r.parent};if(r.name==`.`&&r.parent.name==`MemberExpression`)return{type:`property`,target:r.parent};if(r.name==`MemberExpression`&&a==`.`)return{type:`property`,target:r};if(r.name==`VariableName`)return{type:`expression`,from:r.from};let o=e.matchBefore(/[\w\u00c0-\uffff]+$/);return o?{type:`expression`,from:o.from}:e.explicit&&r.name!=`CommentText`&&r.name!=`StringLiteral`&&r.name!=`NumberLiteral`&&r.name!=`InlineComment`?{type:`expression`}:null}function z(e,t,n,r){let i=[];for(;;){let n=t.getChild(`Expression`);if(!n)return[];if(n.name==`VariableName`||n.name==`forloop`||n.name==`tablerowloop`){let t=e.sliceDoc(n.from,n.to);if(t==`forloop`)return i.length?[]:I;if(t==`tablerowloop`)return i.length?[]:L;i.unshift(t);break}if(n.name==`MemberExpression`){let r=n.getChild(`PropertyName`);r&&i.unshift(e.sliceDoc(r.from,r.to)),t=n}else if(n.name==`SubscriptExpression`){let r=n.getChildren(`Expression`)[1];i.unshift(r?.name==`StringLiteral`?e.sliceDoc(r.from+1,r.to-1):`[]`),t=n}else return[]}return r?r(i,e,n):[]}function B(e={}){let t=e.filters?e.filters.concat(N):N,n=e.tags?e.tags.concat(P):P,r=e.variables?e.variables.concat(F):F,{properties:i}=e;return e=>{let a=R(e);if(!a)return null;let o=a.from??(a.node?a.node.from:e.pos),s;return s=a.type==`filter`?t:a.type==`tag`?n:a.type==`expression`?r:z(e.state,a.target,e,i),s.length?{options:s,from:o,validFor:/^[\w\u00c0-\uffff]*$/}:null}}var V=c.inputHandler.of((e,t,n,r)=>r!=`%`||t!=n||e.state.doc.sliceString(t-1,n+1)!=`{}`?!1:(e.dispatch(e.state.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:`%%`},range:l.cursor(e.from+1)})),{scrollIntoView:!0,userEvent:`input.type`}),!0));function H(e){return t=>{let n=e.test(t.textAfter);return t.lineIndent(t.node.from)+(n?0:t.unit)}}var U=t.define({name:`liquid`,parser:j.configure({props:[s({"cycle comment endcomment raw endraw echo increment decrement liquid in with as":u.keyword,"empty forloop tablerowloop":u.atom,"if elsif else endif unless endunless case endcase for endfor tablerow endtablerow break continue":u.controlKeyword,"assign capture endcapture":u.definitionKeyword,contains:u.operatorKeyword,"render include":u.moduleKeyword,VariableName:u.variableName,TagName:u.keyword,FilterName:u.function(u.variableName),PropertyName:u.propertyName,ParameterName:u.attributeName,CompareOp:u.compareOperator,AssignOp:u.definitionOperator,LogicOp:u.logicOperator,NumberLiteral:u.number,StringLiteral:u.string,BooleanLiteral:u.bool,InlineComment:u.lineComment,CommentText:u.blockComment,"{% %} {{ }}":u.brace,"[ ]":u.bracket,"( )":u.paren,".":u.derefOperator,", .. : |":u.punctuation}),n.add({Tag:o({closing:`%}`}),"UnlessDirective ForDirective TablerowDirective CaptureDirective":H(/^\s*(\{%-?\s*)?end\w/),IfDirective:H(/^\s*(\{%-?\s*)?(endif|else|elsif)\b/),CaseDirective:H(/^\s*(\{%-?\s*)?(endcase|when)\b/)}),r.add({"UnlessDirective ForDirective TablerowDirective CaptureDirective IfDirective CaseDirective RawDirective Comment"(e){let t=e.firstChild,n=e.lastChild;return!t||t.name!=`Tag`?null:{from:t.to,to:n.name==`EndTag`?n.from:e.to}}})]}),languageData:{commentTokens:{line:`#`},indentOnInput:/^\s*{%-?\s*(?:end|elsif|else|when|)$/}}),W=d();function G(t){return U.configure({wrap:e(e=>e.type.isTop?{parser:t.parser,overlay:e=>e.name==`Text`||e.name==`RawText`}:null)},`liquid`)}var K=G(W.language);function q(e={}){let t=e.base||W,n=t.language==W.language?K:G(t.language);return new a(n,[t.support,n.data.of({autocomplete:B(e)}),t.language.data.of({closeBrackets:{brackets:[`{`]}}),V])}export{q as liquid};
1
+ import{En as e,Ft as t,Jt as n,Kt as r,Qt as i,Rt as a,Ut as o,en as s,rn as c,sn as l,tn as u}from"./editor-BA7mo2fo.js";import{html as d}from"./dist-DHXQnea3.js";import{n as f,r as p}from"./dist-51i-jmw9.js";var m=1,h=2,g=3,_=183,v=4,y=184,b=5,x=185,S=6;function C(e){return e>=65&&e<=90||e>=97&&e<=122}var w=new f(e=>{let t=e.pos;for(;;){let{next:n}=e;if(n<0)break;if(n==123){let n=e.peek(1);if(n==123){if(e.pos>t)break;e.acceptToken(m,2);return}if(n==37){if(e.pos>t)break;let n=2,r=2;for(;;){let t=e.peek(n);if(t==32||t==10)++n;else if(t==35)for(++n;;){let t=e.peek(n);if(t<0||t==10)break;n++}else if(t==45&&r==2)r=++n;else{let i=t==101&&e.peek(n+1)==110&&e.peek(n+2)==100;e.acceptToken(i?g:h,r);return}}}}if(e.advance(),n==10)break}e.pos>t&&e.acceptToken(_)});function T(e,t,n){return new f(r=>{let i=r.pos;for(;;){let{next:t}=r;if(t==123&&r.peek(1)==37){let t=2;for(;;t++){let e=r.peek(t);if(e!=32&&e!=10)break}let a=``;for(;;t++){let e=r.peek(t);if(!C(e))break;a+=String.fromCharCode(e)}if(a==e){if(r.pos>i)break;r.acceptToken(n,2);break}}else if(t<0)break;if(r.advance(),t==10)break}r.pos>i&&r.acceptToken(t)})}var E=T(`endcomment`,x,b),D=T(`endraw`,y,v),O=new f(e=>{if(e.next==35){for(e.advance();!(e.next==10||e.next<0||(e.next==37||e.next==125)&&e.peek(1)==125);)e.advance();e.acceptToken(S)}}),k={__proto__:null,contains:34,or:38,and:38,true:52,false:52,empty:54,forloop:57,tablerowloop:59,continue:61,in:135,with:199,for:201,as:203,if:239,endif:243,unless:249,endunless:253,elsif:257,else:261,case:267,endcase:271,when:275,endfor:283,tablerow:289,endtablerow:293,break:297,cycle:303,echo:307,render:311,include:315,assign:319,capture:325,endcapture:329,increment:333,decrement:337},A={__proto__:null,if:90,endif:94,elsif:98,else:102,unless:108,endunless:112,case:118,endcase:122,when:126,for:132,endfor:140,tablerow:146,endtablerow:150,break:154,continue:158,cycle:162,comment:168,endcomment:174,raw:180,endraw:186,echo:190,render:194,include:206,assign:210,capture:216,endcapture:220,increment:224,decrement:228,liquid:232},j=p.deserialize({version:14,states:"MfQYOPOOOOOP'#F}'#F}OhOaO'#CdOyQhO'#CfO!hQxO'#DUO$ROPO'#DXO$aOPO'#DbO$oOPO'#DgO$}OPO'#DnO%]OPO'#DuO%kOSO'#EQO%pOQO'#EWO%uOPO'#EjO&TQxO'#F{OOOP'#Gj'#GjOOOP'#G`'#G`OOOP'#F|'#F|QYOPOOOOOP-E9{-E9{OOQW'#Cg'#CgO&nQ!jO,59QO&uQ!jO'#GaOyQhO'#CtOOQW'#Ge'#GeOOQW'#Gf'#GfOOQW'#Gg'#GgOOQW'#Ga'#GaOOOP,59p,59pO*SQhO,59pOyQhO,59tOyQhO,59xO*^QhO,59zOyQhO,59}OyQhO,5:SOyQhO,5:WO!cQhO,5:ZO!cQhO,5:bO*cQhO,5:fO*hQhO,5:hO*mQhO,5:jO*rQhO,5:mO*wQhO,5:sOyQhO,5:xOyQhO,5:zOyQhO,5;QOyQhO,5;SOyQhO,5;VOyQhO,5;ZOyQhO,5;]O,WQhO,5;_O,_OPO'#CdOOOP,59s,59sO$ROPO,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Q(](PR(b(W!zjRflmnpqrz{|}!O!P!Q!p!q!r!w!x#j#m#p#t#w$T$V$X$Z$]$`$b%U%V%W%`%d%e%n&|'g'i(P(Wm$P!R#k#n#u#y#|$^$e%|&R&X&_&d&nQ#RlR't&|S#Ol&|R'P%WQ%d#YQ%e#ZQ'g&ZR'i&`X%n#b%p&g'ol#x!R#k#n#u#y#|$^$e%|&R&X&_&d&nX%n#b%p&g'oR(R'_m$d!R#k#n#u#y#|$^$e%|&R&X&_&d&nm#j!R#k#n#u#y#|$^$e%|&R&X&_&d&nT%z#k%|m#m!R#k#n#u#y#|$^$e%|&R&X&_&d&nT&P#n&Rm#p!R#k#n#u#y#|$^$e%|&R&X&_&d&nm#r!R#k#n#u#y#|$^$e%|&R&X&_&d&nm#t!R#k#n#u#y#|$^$e%|&R&X&_&d&nT&V#u&Xm#w!R#k#n#u#y#|$^$e%|&R&X&_&d&nT&]#y&_m#{!R#k#n#u#y#|$^$e%|&R&X&_&d&nT&b#|&dm$O!R#k#n#u#y#|$^$e%|&R&X&_&d&nm$R!R#k#n#u#y#|$^$e%|&R&X&_&d&nm$T!R#k#n#u#y#|$^$e%|&R&X&_&d&nm$V!R#k#n#u#y#|$^$e%|&R&X&_&d&nm$X!R#k#n#u#y#|$^$e%|&R&X&_&d&nm$Z!R#k#n#u#y#|$^$e%|&R&X&_&d&nm$]!R#k#n#u#y#|$^$e%|&R&X&_&d&nT&l$^&nm$`!R#k#n#u#y#|$^$e%|&R&X&_&d&nm$b!R#k#n#u#y#|$^$e%|&R&X&_&d&n",nodeNames:`⚠ {{ {% {% {% {% InlineComment Template Text }} Interpolation VariableName MemberExpression . PropertyName SubscriptExpression BinaryExpression contains CompareOp LogicOp AssignmentExpression AssignOp ) ( RangeExpression .. BooleanLiteral empty forloop tablerowloop continue StringLiteral NumberLiteral Filter | FilterName : NamedArgument ParameterName , Tag TagName %} IfDirective Tag if EndTag endif Tag elsif Tag else UnlessDirective Tag unless EndTag endunless CaseDirective Tag case EndTag endcase Tag when ForDirective Tag for in Parameter EndTag endfor TableDirective Tag tablerow EndTag endtablerow Tag break Tag continue Tag cycle Comment Tag comment CommentText EndTag endcomment RawDirective Tag raw RawText EndTag endraw Tag echo Tag render RenderParameter with for as Tag include Tag assign CaptureDirective Tag capture EndTag endcapture Tag increment Tag decrement Tag liquid IfDirective Tag if EndTag endif UnlessDirective Tag unless EndTag endunless Tag elsif Tag else CaseDirective Tag case EndTag endcase Tag when ForDirective Tag EndTag endfor TableDirective Tag tablerow EndTag endtablerow Tag break Tag Tag cycle Tag echo Tag render Tag include Tag assign CaptureDirective Tag capture EndTag endcapture Tag increment Tag decrement EndTag`,maxTerm:225,nodeProps:[[`closedBy`,1,`}}`,-4,2,3,4,5,`%}`,23,`)`],[`openedBy`,9,`{{`,22,`(`,42,`{%`],[`group`,-13,11,12,15,16,20,24,26,27,28,29,30,31,32,`Expression`]],skippedNodes:[0,6],repeatNodeCount:12,tokenData:")e~RmXY!|YZ!|]^!|pq!|qr#_rs#juv$[wx$gxy%Syz%X{|%^|}&x}!O&}!O!P'Z!Q![&g![!]'k!^!_'p!_!`'x!`!a'p!c!}(Q!}#O(y#P#Q)O#R#S(Q#T#o(Q#p#q)T#q#r)Y%W;'S(Q;'S;:j(s<%lO(Q~#RS%R~XY!|YZ!|]^!|pq!|~#bP!_!`#e~#jOb~~#mUOY#jZr#jrs$Ps;'S#j;'S;=`$U<%lO#j~$UOo~~$XP;=`<%l#j~$_P#q#r$b~$gOz~~$jUOY$gZw$gwx$Px;'S$g;'S;=`$|<%lO$g~%PP;=`<%l$g~%XOg~~%^Of~P%aQ!O!P%g!Q![&gP%jP!Q![%mP%rRpP!Q![%m!g!h%{#X#Y%{P&OR{|&X}!O&X!Q![&_P&[P!Q![&_P&dPpP!Q![&_P&lSpP!O!P%g!Q![&g!g!h%{#X#Y%{~&}Ow~~'QRuv$[!O!P%g!Q![&g~'`Q]S!O!P'f!Q![%m~'kOi~~'pOt~~'uPb~!_!`#e~'}Pe~!_!`#e_(ZW^WyQ%UT}!O(Q!Q![(Q!c!}(Q#R#S(Q#T#o(Q%W;'S(Q;'S;:j(s<%lO(Q_(vP;=`<%l(Q~)OO%W~~)TO%V~~)YOr~~)]P#q#r)`~)eOX~",tokenizers:[w,D,E,O,0,1,2,3],topRules:{Template:[0,7]},dynamicPrecedences:{193:1,194:1,195:1,199:1,200:1,201:1,202:1,204:1,205:1,206:1,207:1,208:1,209:1,210:1,211:1,212:1,213:1,214:1,215:1,216:1,217:1,218:1,219:1,220:1,221:1,222:1,223:1,224:1,225:1},specialized:[{term:190,get:e=>k[e]||-1},{term:41,get:e=>A[e]||-1}],tokenPrec:0});function M(e,t){return e.split(` `).map(e=>({label:e,type:t}))}var N=M(`abs append at_least at_most capitalize ceil compact concat date default divided_by downcase escape escape_once first floor join last lstrip map minus modulo newline_to_br plus prepend remove remove_first replace replace_first reverse round rstrip size slice sort sort_natural split strip strip_html strip_newlines sum times truncate truncatewords uniq upcase url_decode url_encode where`,`function`),P=M(`cycle comment endcomment raw endraw echo increment decrement liquid if elsif else endif unless endunless case endcase for endfor tablerow endtablerow break continue assign capture endcapture render include`,`keyword`),F=M(`empty forloop tablerowloop in with as`,`keyword`),I=M(`first index index0 last length rindex`,`property`),L=M(`col col0 col_first col_last first index index0 last length rindex rindex0 row`,`property`);function R(e){let{state:t,pos:n}=e,r=i(t).resolveInner(n,-1).enterUnfinishedNodesBefore(n),a=r.childBefore(n)?.name||r.name;if(r.name==`FilterName`)return{type:`filter`,node:r};if(e.explicit&&a==`|`)return{type:`filter`};if(r.name==`TagName`)return{type:`tag`,node:r};if(e.explicit&&a==`{%`)return{type:`tag`};if(r.name==`PropertyName`&&r.parent.name==`MemberExpression`)return{type:`property`,node:r,target:r.parent};if(r.name==`.`&&r.parent.name==`MemberExpression`)return{type:`property`,target:r.parent};if(r.name==`MemberExpression`&&a==`.`)return{type:`property`,target:r};if(r.name==`VariableName`)return{type:`expression`,from:r.from};let o=e.matchBefore(/[\w\u00c0-\uffff]+$/);return o?{type:`expression`,from:o.from}:e.explicit&&r.name!=`CommentText`&&r.name!=`StringLiteral`&&r.name!=`NumberLiteral`&&r.name!=`InlineComment`?{type:`expression`}:null}function z(e,t,n,r){let i=[];for(;;){let n=t.getChild(`Expression`);if(!n)return[];if(n.name==`VariableName`||n.name==`forloop`||n.name==`tablerowloop`){let t=e.sliceDoc(n.from,n.to);if(t==`forloop`)return i.length?[]:I;if(t==`tablerowloop`)return i.length?[]:L;i.unshift(t);break}if(n.name==`MemberExpression`){let r=n.getChild(`PropertyName`);r&&i.unshift(e.sliceDoc(r.from,r.to)),t=n}else if(n.name==`SubscriptExpression`){let r=n.getChildren(`Expression`)[1];i.unshift(r?.name==`StringLiteral`?e.sliceDoc(r.from+1,r.to-1):`[]`),t=n}else return[]}return r?r(i,e,n):[]}function B(e={}){let t=e.filters?e.filters.concat(N):N,n=e.tags?e.tags.concat(P):P,r=e.variables?e.variables.concat(F):F,{properties:i}=e;return e=>{let a=R(e);if(!a)return null;let o=a.from??(a.node?a.node.from:e.pos),s;return s=a.type==`filter`?t:a.type==`tag`?n:a.type==`expression`?r:z(e.state,a.target,e,i),s.length?{options:s,from:o,validFor:/^[\w\u00c0-\uffff]*$/}:null}}var V=c.inputHandler.of((e,t,n,r)=>r!=`%`||t!=n||e.state.doc.sliceString(t-1,n+1)!=`{}`?!1:(e.dispatch(e.state.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:`%%`},range:l.cursor(e.from+1)})),{scrollIntoView:!0,userEvent:`input.type`}),!0));function H(e){return t=>{let n=e.test(t.textAfter);return t.lineIndent(t.node.from)+(n?0:t.unit)}}var U=t.define({name:`liquid`,parser:j.configure({props:[s({"cycle comment endcomment raw endraw echo increment decrement liquid in with as":u.keyword,"empty forloop tablerowloop":u.atom,"if elsif else endif unless endunless case endcase for endfor tablerow endtablerow break continue":u.controlKeyword,"assign capture endcapture":u.definitionKeyword,contains:u.operatorKeyword,"render include":u.moduleKeyword,VariableName:u.variableName,TagName:u.keyword,FilterName:u.function(u.variableName),PropertyName:u.propertyName,ParameterName:u.attributeName,CompareOp:u.compareOperator,AssignOp:u.definitionOperator,LogicOp:u.logicOperator,NumberLiteral:u.number,StringLiteral:u.string,BooleanLiteral:u.bool,InlineComment:u.lineComment,CommentText:u.blockComment,"{% %} {{ }}":u.brace,"[ ]":u.bracket,"( )":u.paren,".":u.derefOperator,", .. : |":u.punctuation}),n.add({Tag:o({closing:`%}`}),"UnlessDirective ForDirective TablerowDirective CaptureDirective":H(/^\s*(\{%-?\s*)?end\w/),IfDirective:H(/^\s*(\{%-?\s*)?(endif|else|elsif)\b/),CaseDirective:H(/^\s*(\{%-?\s*)?(endcase|when)\b/)}),r.add({"UnlessDirective ForDirective TablerowDirective CaptureDirective IfDirective CaseDirective RawDirective Comment"(e){let t=e.firstChild,n=e.lastChild;return!t||t.name!=`Tag`?null:{from:t.to,to:n.name==`EndTag`?n.from:e.to}}})]}),languageData:{commentTokens:{line:`#`},indentOnInput:/^\s*{%-?\s*(?:end|elsif|else|when|)$/}}),W=d();function G(t){return U.configure({wrap:e(e=>e.type.isTop?{parser:t.parser,overlay:e=>e.name==`Text`||e.name==`RawText`}:null)},`liquid`)}var K=G(W.language);function q(e={}){let t=e.base||W,n=t.language==W.language?K:G(t.language);return new a(n,[t.support,n.data.of({autocomplete:B(e)}),t.language.data.of({closeBrackets:{brackets:[`{`]}}),V])}export{q as liquid};