@forsion/unit 2.13.2 → 2.13.3

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 (160) hide show
  1. package/main.mjs +3 -3
  2. package/package.json +1 -1
  3. package/release.json +5 -5
  4. package/web/assets/{ArtificialView-Bs_6B211.js → ArtificialView-DS97zlMg.js} +1 -1
  5. package/web/assets/{AutomationBuilder-C-IFaaBp.js → AutomationBuilder-BsJc8wuC.js} +1 -1
  6. package/web/assets/{CalendarConfigView-DEsNvVkD.js → CalendarConfigView-BN8mraSo.js} +1 -1
  7. package/web/assets/{CalendarView-D7ZUE_dr.js → CalendarView-D55PA1vn.js} +1 -1
  8. package/web/assets/{CapabilityMenu-CrsaTtDe.js → CapabilityMenu-BVrokPpT.js} +1 -1
  9. package/web/assets/{CheckboxInput-DVO2-1J7.js → CheckboxInput-BuJ3HPm_.js} +1 -1
  10. package/web/assets/{Chrome-BvpbCvo1.js → Chrome-amTcZNE4.js} +1 -1
  11. package/web/assets/{CodeView-CB4kG7Y6.js → CodeView-DRVh13k9.js} +3 -3
  12. package/web/assets/DashboardGridView-D9s9pez_.css +1 -0
  13. package/web/assets/{DashboardGridView-tgaj9-SM.js → DashboardGridView-DlFyYfUh.js} +2 -2
  14. package/web/assets/{EventCard-c6s4uGBu.js → EventCard-DUrn2krw.js} +1 -1
  15. package/web/assets/{ExcalidrawCanvas-NdV86AR3.js → ExcalidrawCanvas-TpbzBF-J.js} +1 -1
  16. package/web/assets/{FloatingToc-ldOYWe2C.js → FloatingToc-B1d4-5EL.js} +1 -1
  17. package/web/assets/HomepageView-DnQ_5Obe.css +1 -0
  18. package/web/assets/{HomepageView-4joJWYlg.js → HomepageView-nzKfbHM-.js} +1 -1
  19. package/web/assets/{ImageStudioPanels-DgMYAsHj.js → ImageStudioPanels-B2PTq6Yb.js} +1 -1
  20. package/web/assets/{ImageStudioView-_CYHoOoG.js → ImageStudioView-Cawr6pGW.js} +1 -1
  21. package/web/assets/{InlineFiles-BIfsx3R-.js → InlineFiles-DKPH5JHz.js} +1 -1
  22. package/web/assets/{MarkdownBlock-wYEaBBOr.js → MarkdownBlock-BHpDy2qQ.js} +1 -1
  23. package/web/assets/{ModelPill-DveHcLqq.js → ModelPill-ChzAM3z1.js} +1 -1
  24. package/web/assets/{MuseLibraryView-Do9RnKiq.js → MuseLibraryView-DLuQ_jyV.js} +2 -2
  25. package/web/assets/{MuseView-3GL4Ltoj.js → MuseView-CDDwV6SR.js} +2 -2
  26. package/web/assets/{PageHistoryPanel-BMQC-V_l.js → PageHistoryPanel-BbdXpjJM.js} +2 -2
  27. package/web/assets/{PdfAnnotator-CyAw8sgq.js → PdfAnnotator-CW0wPWRB.js} +1 -1
  28. package/web/assets/{PenRow-BSB-h5Pb.js → PenRow-BY-MZLDQ.js} +1 -1
  29. package/web/assets/{ProductView-B96OeHOP.js → ProductView-0ieVL3rY.js} +1 -1
  30. package/web/assets/{RightPanel-BgSeCLnw.js → RightPanel-BRexwQ3W.js} +1 -1
  31. package/web/assets/RunLocationPicker-BrDfOu8-.css +1 -0
  32. package/web/assets/RunLocationPicker-CadYiE7C.js +43 -0
  33. package/web/assets/{SketchCard-DAD0jR0i.js → SketchCard-BcXCdBAs.js} +1 -1
  34. package/web/assets/{StudioGuestSurface-DlUKXBXv.js → StudioGuestSurface-ZJFKnNYF.js} +1 -1
  35. package/web/assets/{TodoListView-_yFkPUrw.js → TodoListView-DuRdVFgB.js} +1 -1
  36. package/web/assets/{Tooltip-DXuy9-1_.js → Tooltip-DtDUL18W.js} +1 -1
  37. package/web/assets/{UnifiedPage-EJNWKzxN.js → UnifiedPage-D7JTfABH.js} +3 -3
  38. package/web/assets/{amadeus-manual.en-DzRWr4BL.js → amadeus-manual.en-B8J-svqq.js} +1 -1
  39. package/web/assets/{amadeus-manual.zh-DW32DkL7.js → amadeus-manual.zh-CkCOFnrg.js} +1 -1
  40. package/web/assets/appStore-ClD7vq5L.css +1 -0
  41. package/web/assets/{appStore-CidPWYa0.js → appStore-affnJoin.js} +155 -117
  42. package/web/assets/{arrow-up-right-KPFbRA41.js → arrow-up-right-R4P9Mmxz.js} +1 -1
  43. package/web/assets/{astryxBridge-Bupzouso.js → astryxBridge-CT2wZJXs.js} +3 -3
  44. package/web/assets/{automationListSource-1aOVKBLw.js → automationListSource-JVBMsMbC.js} +1 -1
  45. package/web/assets/{boardSurface-BHuMoQN-.js → boardSurface-Ce0_vf9f.js} +1 -1
  46. package/web/assets/{book-open-CBeNsIpo.js → book-open-CcXCToyx.js} +1 -1
  47. package/web/assets/{calendarNavStore-Duyhbmm_.js → calendarNavStore-tQJRVpum.js} +1 -1
  48. package/web/assets/{canvasPrefs-CxfyDTMT.js → canvasPrefs-CSuX9aLF.js} +1 -1
  49. package/web/assets/{chatBoxSurface-OBzO1Z5E.js → chatBoxSurface-IG6Vu4Dz.js} +1 -1
  50. package/web/assets/{circle-question-mark-M8QUJJYk.js → circle-question-mark-O8AhUz35.js} +1 -1
  51. package/web/assets/{circle-x-Szwop5L_.js → circle-x-AV2ZWulM.js} +1 -1
  52. package/web/assets/{client-CPUljePZ.js → client-BqhpYbYL.js} +1 -1
  53. package/web/assets/{code-xml-n9mgGgkv.js → code-xml-DdR58F83.js} +1 -1
  54. package/web/assets/{codeStudioStore-DXMQwRzG.js → codeStudioStore-Dq5i8nbE.js} +1 -1
  55. package/web/assets/codingNavigation-CxdCK78-.js +53 -0
  56. package/web/assets/codingNavigation-_tOR0ell.css +1 -0
  57. package/web/assets/{create-C19zqt5N.js → create-BgJN5qsj.js} +2 -2
  58. package/web/assets/{dashboardSurface-BwcH16Qc.js → dashboardSurface-BY-AFB-r.js} +1 -1
  59. package/web/assets/{deskCapture-B_LKZSPt.js → deskCapture-BD2qD6NI.js} +1 -1
  60. package/web/assets/{diff2html-DrCCWvpR.js → diff2html-OoRdHZ_O.js} +1 -1
  61. package/web/assets/{docx-preview-Bi7wekSM.js → docx-preview-B43XC8Cn.js} +1 -1
  62. package/web/assets/{emoji-DczIG8SO.js → emoji-BPdA62d7.js} +1 -1
  63. package/web/assets/{floatingTocSurface-rc1ZC7-I.js → floatingTocSurface-BM2SYE_u.js} +1 -1
  64. package/web/assets/{foldActions-BGocXE-o.js → foldActions-BcyvNVBs.js} +1 -1
  65. package/web/assets/{folder-CoOsfQ64.js → folder-CCZqnwRc.js} +1 -1
  66. package/web/assets/{folder-plus-d5MwIMlf.js → folder-plus-BJKT1Pqg.js} +1 -1
  67. package/web/assets/{gestures-CXFaEydn.js → gestures-BwPbZDkU.js} +1 -1
  68. package/web/assets/{hand-fuehbnkI.js → hand-DRu7IJdU.js} +1 -1
  69. package/web/assets/{hard-drive-Bh1DmZg0.js → hard-drive-CXNJUCXw.js} +1 -1
  70. package/web/assets/i18n-BMo19xaR.css +1 -0
  71. package/web/assets/i18n.generated-DvY59Zq3.js +15 -0
  72. package/web/assets/{imageStudio-Dgl1wZNB.js → imageStudio-Axwmd4GW.js} +2 -2
  73. package/web/assets/imageStudio-DZ0qGU2s.css +1 -0
  74. package/web/assets/{index-e-MxdHFO.js → index-B1rE_NwA.js} +1 -1
  75. package/web/assets/{index-lfow5R3O.js → index-BFTY79aq.js} +1 -1
  76. package/web/assets/{index-38xsQSS9.js → index-BGEkZBs2.js} +1 -1
  77. package/web/assets/{index-YRWOePBS.js → index-BO2XJc36.js} +1 -1
  78. package/web/assets/{index-B5UW6SaE.js → index-BYUntVIZ.js} +2 -2
  79. package/web/assets/{index-2tD0kijW.js → index-C65u4fXd.js} +1 -1
  80. package/web/assets/{index-BCG8Wnc4.js → index-C_Ohi-I3.js} +1 -1
  81. package/web/assets/{index-Dff-DL1v.js → index-CkMhazev.js} +1 -1
  82. package/web/assets/{index-Dc8iMctf.js → index-CobUnTcv.js} +1 -1
  83. package/web/assets/{index-Dy07SBfH.js → index-D102FOuM.js} +1 -1
  84. package/web/assets/{index-B8Co6KG3.js → index-D3CYvMpl.js} +1 -1
  85. package/web/assets/{index-QjVOA7QM.js → index-D78izbLA.js} +1 -1
  86. package/web/assets/{index-BPqoEOV_.js → index-DDMXVG0h.js} +1 -1
  87. package/web/assets/{index-CPLtf9Vc.js → index-DY0M_dpd.js} +1 -1
  88. package/web/assets/{index-7kdR1oL8.js → index-DcbZwhpE.js} +1 -1
  89. package/web/assets/{index-D4CSH-v1.js → index-Dlkq7gkE.js} +1 -1
  90. package/web/assets/{index-Ch0FIsJX.js → index-HqmJW2np.js} +1 -1
  91. package/web/assets/{index-DcRyQ3eU.js → index-LxlyPm0_.js} +1 -1
  92. package/web/assets/{index-Ce1sNSS8.js → index-Uq4J2aoW.js} +1 -1
  93. package/web/assets/{index-DvOrTnw2.js → index-WbVt2P8R.js} +1 -1
  94. package/web/assets/{index-Df9jregv.js → index-XyjIhkPw.js} +1 -1
  95. package/web/assets/{index-BqGpbntz.js → index-Y2kzYlZq.js} +1 -1
  96. package/web/assets/{index-CnDAYLti.js → index-mB0EQkyZ.js} +1 -1
  97. package/web/assets/{index-fViJsYjM.js → index-pJh7JN7_.js} +1 -1
  98. package/web/assets/{index-Dx9aIoyo.js → index-taRxNsbp.js} +1 -1
  99. package/web/assets/{invitePage-Dgl3-c_m.js → invitePage-BW0BH8Ac.js} +1 -1
  100. package/web/assets/{ipc-CNlIRMtU.js → ipc-D7yENkjV.js} +1 -1
  101. package/web/assets/{jszip.min-tyV0GaJg.js → jszip.min-UE5d5vPJ.js} +1 -1
  102. package/web/assets/{layout-grid-DFmwM9NU.js → layout-grid-Hs3eDA07.js} +1 -1
  103. package/web/assets/{linkFollow-iP2zfbA3.js → linkFollow-Msu1XH9v.js} +4 -4
  104. package/web/assets/{list-tree-i07HsP3D.js → list-tree-DmuRb-p9.js} +1 -1
  105. package/web/assets/{listFold-Aea6I0Sa.js → listFold-CKxjyY5_.js} +1 -1
  106. package/web/assets/{lock-TSDKuCod.js → lock-kffGfeHt.js} +1 -1
  107. package/web/assets/{log-out-DK84lW5n.js → log-out-B5gEP0tF.js} +1 -1
  108. package/web/assets/main-DIyFlyfK.js +20 -0
  109. package/web/assets/markdownEditorSurface-Cx2rqFAY.js +3 -0
  110. package/web/assets/{message-square-plus-3wFslIMY.js → message-square-plus-DxBPIhPS.js} +1 -1
  111. package/web/assets/{messages-DEAGRsC3.js → messages-4w1Khzm1.js} +1 -1
  112. package/web/assets/minus-CfoZ4oxr.js +1 -0
  113. package/web/assets/{mobileEntry-5UaAITwY.js → mobileEntry-B8JwR53-.js} +1 -1
  114. package/web/assets/{nativeDownload-B3JGkABw.js → nativeDownload-Udrv_tmU.js} +1 -1
  115. package/web/assets/{pageChrome-DFi9zs6F.js → pageChrome-D-9npbUE.js} +1 -1
  116. package/web/assets/{pageChrome-BDHHmRnt.css → pageChrome-eO9pb2fH.css} +1 -1
  117. package/web/assets/{pageTree-DZ7Eiro-.js → pageTree-CIXFRCLk.js} +2 -2
  118. package/web/assets/{pen-tool-ChGmX6g_.js → pen-tool-D_Y9We9x.js} +1 -1
  119. package/web/assets/{pencil-CJsJD7M_.js → pencil-DGiTRzW1.js} +1 -1
  120. package/web/assets/phoneList-BQfCJwKF.css +1 -0
  121. package/web/assets/{phoneList-DrxIwJxQ.js → phoneList-DHUia6HT.js} +1 -1
  122. package/web/assets/{pluginChat-0QI9a8Q1.js → pluginChat-BXuJiMYi.js} +1 -1
  123. package/web/assets/{redo-2-CI57sDFr.js → redo-2-QgiKEg9T.js} +1 -1
  124. package/web/assets/{rotate-ccw-xgT_0UN9.js → rotate-ccw-BLoH5er1.js} +1 -1
  125. package/web/assets/{sharePage-C2Yqx0NQ.js → sharePage-DYYN5usb.js} +2 -2
  126. package/web/assets/{shareViewer-DKPWhTJv.js → shareViewer-BzuSyJv_.js} +1 -1
  127. package/web/assets/{star-C9KTji9N.js → star-BmywYD3u.js} +1 -1
  128. package/web/assets/{tableSurface-cYs6dX6B.js → tableSurface-21LDYY_G.js} +1 -1
  129. package/web/assets/{terminal-DPZazOQ2.js → terminal-BlmA_Z1C.js} +1 -1
  130. package/web/assets/{terminalView-CsJmxE_m.js → terminalView-SAxITnRW.js} +1 -1
  131. package/web/assets/{type-C5J875vb.js → type-DmIL6FB-.js} +1 -1
  132. package/web/assets/{undo-2-BOUt5qks.js → undo-2-yMeXc8Wi.js} +1 -1
  133. package/web/assets/{unitAccount-BIAIxKNp.js → unitAccount-BPYRAa3m.js} +1 -1
  134. package/web/assets/{unitBridge-b2C6zb3a.js → unitBridge-BNVzai6X.js} +1 -1
  135. package/web/assets/{unitCloudTransport-NGtDDKWo.js → unitCloudTransport-iFweA1xk.js} +1 -1
  136. package/web/assets/{unitOwnerAccess-CwH9ApZT.js → unitOwnerAccess-Bggl7bDP.js} +1 -1
  137. package/web/assets/{unitShim-CY8EVkKD.js → unitShim-BP2nBO_k.js} +3 -3
  138. package/web/assets/{upload-CrbEAW8C.js → upload-D20PZHXc.js} +1 -1
  139. package/web/assets/userSpaces-CrLrKklx.js +1 -0
  140. package/web/assets/{viewportLock-Bi3orrUs.css → viewportLock-DO1lzA2N.css} +1 -1
  141. package/web/assets/viewportLock-tlT6H_Hc.js +629 -0
  142. package/web/assets/{workflow-DY2Cnaei.js → workflow-Bd6xBHiT.js} +1 -1
  143. package/web/assets/{zoom-in-BcuPvIYd.js → zoom-in-_TgFOpyv.js} +1 -1
  144. package/web/index.html +2 -2
  145. package/web/assets/DashboardGridView-hpRmBr9B.css +0 -1
  146. package/web/assets/HomepageView-Cxf3AWBu.css +0 -1
  147. package/web/assets/RunLocationPicker-CEmFio4n.css +0 -1
  148. package/web/assets/RunLocationPicker-M1UoJyjf.js +0 -38
  149. package/web/assets/appStore-DeaC1U32.css +0 -1
  150. package/web/assets/codingNavigation-CCjs1kon.js +0 -53
  151. package/web/assets/codingNavigation-yp19w6uu.css +0 -1
  152. package/web/assets/i18n-DjziAw8r.css +0 -1
  153. package/web/assets/i18n.generated-BiQFRL2U.js +0 -15
  154. package/web/assets/imageStudio--KF9gwHA.css +0 -1
  155. package/web/assets/main-D7CEGndC.js +0 -20
  156. package/web/assets/markdownEditorSurface-DISu_twy.js +0 -3
  157. package/web/assets/minus-BBdfT_sc.js +0 -1
  158. package/web/assets/phoneList-DvpzD3zT.css +0 -1
  159. package/web/assets/userSpaces-B_Njvel_.js +0 -1
  160. package/web/assets/viewportLock-DZ927PNz.js +0 -629
@@ -1 +1 @@
1
- import{d as v}from"./index-B5UW6SaE.js";import{ej as J,bq as ne,ah as re}from"./appStore-CidPWYa0.js";const K=/^(auto|scroll|hidden|clip)$/,M=(l,p=1)=>Number.isFinite(l)&&l>0?l:p,m=l=>`${Math.round(l*1e3)/1e3}px`;function ae({anchorRef:l,enabled:p=!0,onActivate:X,children:Q}){const[t]=v.useState(()=>{const d=document.createElement("div");return d.className="csu-guest-surface",d.setAttribute("aria-hidden","true"),d.inert=!0,Object.assign(d.style,{position:"absolute",display:"flex",flexDirection:"column",minWidth:"0",minHeight:"0",overflow:"hidden",boxSizing:"border-box",visibility:"hidden",pointerEvents:"none",zIndex:"1"}),d}),E=v.useRef(p);E.current=p;const Y=v.useRef(X);Y.current=X;const $=v.useRef(0),I=v.useRef(null);return v.useLayoutEffect(()=>{$.current++;let d=!1,b=0,r=t.parentElement,x=null,N=!1,R=!1;const n=t.ownerDocument,a=n.defaultView,o=(i,e)=>{t.style[i]!==e&&(t.style[i]=e)},f=()=>{o("visibility","hidden"),o("pointerEvents","none"),t.inert||(t.inert=!0),t.getAttribute("aria-hidden")!=="true"&&t.setAttribute("aria-hidden","true")},D=()=>{const i=t.style.visibility==="visible"&&E.current&&!N&&!n.documentElement.hasAttribute("data-dv-dragging");o("pointerEvents",i?"auto":"none"),t.inert===i&&(t.inert=!i);const e=i?"false":"true";t.getAttribute("aria-hidden")!==e&&t.setAttribute("aria-hidden",e)},y=()=>{d||!E.current||n.hidden||t.inert||t.style.visibility!=="visible"||!l.current?.isConnected||l.current.closest('[hidden], [inert], [aria-hidden="true"]')||n.documentElement.hasAttribute("data-dv-dragging")||(R=t.contains(n.activeElement),Y.current?.())},j=()=>{t.contains(n.activeElement)||(R=!1)},ee=()=>{const i=l.current;if(!i?.isConnected||(r||(r=i.closest(".shell-work")??i.closest(".shell-host")??n.body,(r===n.body||a.getComputedStyle(r).position==="static")&&o("position","fixed"),r.appendChild(t),A?.observe(r)),x!==i&&(x&&A?.unobserve(x),A?.observe(i),x=i),!E.current||n.hidden||!r.isConnected))return f(),!1;const e=i.getBoundingClientRect();if(e.width<=0||e.height<=0)return f(),!1;let g=Math.max(0,e.left),C=Math.max(0,e.top),z=Math.min(a.innerWidth,e.right),O=Math.min(a.innerHeight,e.bottom),W=1,k="";N=!1;for(let s=i;s;s=s.parentElement){const u=a.getComputedStyle(s);if(s.hidden||u.display==="none"||u.visibility==="hidden"||u.visibility==="collapse")return f(),!1;(s.inert||s.getAttribute("aria-hidden")==="true")&&(N=!0),s!==r&&!s.contains(r)&&(W*=Number.parseFloat(u.opacity||"1"));const P=/\b(paint|strict|content)\b/.test(u.contain),q=P||K.test(u.overflowX||u.overflow),B=P||K.test(u.overflowY||u.overflow);if(!q&&!B)continue;const h=s.getBoundingClientRect(),V=M(h.width/s.offsetWidth),Z=M(h.height/s.offsetHeight),_=h.left+s.clientLeft*V,U=h.top+s.clientTop*Z,te=_+s.clientWidth*V,ie=U+s.clientHeight*Z;q&&(g=Math.max(g,_),z=Math.min(z,te)),B&&(C=Math.max(C,U),O=Math.min(O,ie)),!k&&q&&B&&Math.abs(h.left-e.left)<1&&Math.abs(h.top-e.top)<1&&Math.abs(h.right-e.right)<1&&Math.abs(h.bottom-e.bottom)<1&&(k=u.borderRadius)}if(z<=g||O<=C)return f(),!1;if(W<=0)return f(),!0;const S=r.getBoundingClientRect(),F=M(re(t)),H=t.style.position==="absolute",L=H?M(S.width/r.offsetWidth,F):F,w=H?M(S.height/r.offsetHeight,F):F;return o("left",m(H?(e.left-S.left)/L-r.clientLeft+r.scrollLeft:e.left/L)),o("top",m(H?(e.top-S.top)/w-r.clientTop+r.scrollTop:e.top/w)),o("width",m(e.width/L)),o("height",m(e.height/w)),o("clipPath",`inset(${m((C-e.top)/w)} ${m((e.right-z)/L)} ${m((e.bottom-O)/w)} ${m((g-e.left)/L)})`),o("borderRadius",k),o("opacity",String(W)),o("visibility","visible"),D(),!0},T=()=>{if(b=0,d)return;const i=ee(),e=t.contains(n.activeElement),g=e&&!R;R=e,g&&y(),i&&(b=a.requestAnimationFrame(T))},c=()=>{!d&&!b&&(b=a.requestAnimationFrame(T))},A=typeof ResizeObserver>"u"?null:new ResizeObserver(c),G=new MutationObserver(i=>{i.some(e=>e.target===n.documentElement&&e.attributeName==="data-dv-dragging")&&D(),i.some(e=>!t.contains(e.target))&&c()});return G.observe(n.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class","hidden","inert","aria-hidden","data-dv-dragging"]}),a.addEventListener("resize",c),n.addEventListener("scroll",c,!0),n.addEventListener("visibilitychange",c),a.addEventListener(J,c),t.addEventListener("focus",y,!0),t.addEventListener("pointerdown",y,!0),n.addEventListener("focus",j,!0),I.current=()=>{E.current||f(),c()},T(),()=>{d=!0,b&&a.cancelAnimationFrame(b),A?.disconnect(),G.disconnect(),a.removeEventListener("resize",c),n.removeEventListener("scroll",c,!0),n.removeEventListener("visibilitychange",c),a.removeEventListener(J,c),t.removeEventListener("focus",y,!0),t.removeEventListener("pointerdown",y,!0),n.removeEventListener("focus",j,!0),I.current=null,f();const i=++$.current;queueMicrotask(()=>{$.current===i&&t.remove()})}},[l,t]),v.useLayoutEffect(()=>{I.current?.()},[p]),ne.createPortal(Q,t)}export{ae as S};
1
+ import{d as v}from"./index-BYUntVIZ.js";import{ej as J,bq as ne,ah as re}from"./appStore-affnJoin.js";const K=/^(auto|scroll|hidden|clip)$/,M=(l,p=1)=>Number.isFinite(l)&&l>0?l:p,m=l=>`${Math.round(l*1e3)/1e3}px`;function ae({anchorRef:l,enabled:p=!0,onActivate:X,children:Q}){const[t]=v.useState(()=>{const d=document.createElement("div");return d.className="csu-guest-surface",d.setAttribute("aria-hidden","true"),d.inert=!0,Object.assign(d.style,{position:"absolute",display:"flex",flexDirection:"column",minWidth:"0",minHeight:"0",overflow:"hidden",boxSizing:"border-box",visibility:"hidden",pointerEvents:"none",zIndex:"1"}),d}),E=v.useRef(p);E.current=p;const Y=v.useRef(X);Y.current=X;const $=v.useRef(0),I=v.useRef(null);return v.useLayoutEffect(()=>{$.current++;let d=!1,b=0,r=t.parentElement,x=null,N=!1,R=!1;const n=t.ownerDocument,a=n.defaultView,o=(i,e)=>{t.style[i]!==e&&(t.style[i]=e)},f=()=>{o("visibility","hidden"),o("pointerEvents","none"),t.inert||(t.inert=!0),t.getAttribute("aria-hidden")!=="true"&&t.setAttribute("aria-hidden","true")},D=()=>{const i=t.style.visibility==="visible"&&E.current&&!N&&!n.documentElement.hasAttribute("data-dv-dragging");o("pointerEvents",i?"auto":"none"),t.inert===i&&(t.inert=!i);const e=i?"false":"true";t.getAttribute("aria-hidden")!==e&&t.setAttribute("aria-hidden",e)},y=()=>{d||!E.current||n.hidden||t.inert||t.style.visibility!=="visible"||!l.current?.isConnected||l.current.closest('[hidden], [inert], [aria-hidden="true"]')||n.documentElement.hasAttribute("data-dv-dragging")||(R=t.contains(n.activeElement),Y.current?.())},j=()=>{t.contains(n.activeElement)||(R=!1)},ee=()=>{const i=l.current;if(!i?.isConnected||(r||(r=i.closest(".shell-work")??i.closest(".shell-host")??n.body,(r===n.body||a.getComputedStyle(r).position==="static")&&o("position","fixed"),r.appendChild(t),A?.observe(r)),x!==i&&(x&&A?.unobserve(x),A?.observe(i),x=i),!E.current||n.hidden||!r.isConnected))return f(),!1;const e=i.getBoundingClientRect();if(e.width<=0||e.height<=0)return f(),!1;let g=Math.max(0,e.left),C=Math.max(0,e.top),z=Math.min(a.innerWidth,e.right),O=Math.min(a.innerHeight,e.bottom),W=1,k="";N=!1;for(let s=i;s;s=s.parentElement){const u=a.getComputedStyle(s);if(s.hidden||u.display==="none"||u.visibility==="hidden"||u.visibility==="collapse")return f(),!1;(s.inert||s.getAttribute("aria-hidden")==="true")&&(N=!0),s!==r&&!s.contains(r)&&(W*=Number.parseFloat(u.opacity||"1"));const P=/\b(paint|strict|content)\b/.test(u.contain),q=P||K.test(u.overflowX||u.overflow),B=P||K.test(u.overflowY||u.overflow);if(!q&&!B)continue;const h=s.getBoundingClientRect(),V=M(h.width/s.offsetWidth),Z=M(h.height/s.offsetHeight),_=h.left+s.clientLeft*V,U=h.top+s.clientTop*Z,te=_+s.clientWidth*V,ie=U+s.clientHeight*Z;q&&(g=Math.max(g,_),z=Math.min(z,te)),B&&(C=Math.max(C,U),O=Math.min(O,ie)),!k&&q&&B&&Math.abs(h.left-e.left)<1&&Math.abs(h.top-e.top)<1&&Math.abs(h.right-e.right)<1&&Math.abs(h.bottom-e.bottom)<1&&(k=u.borderRadius)}if(z<=g||O<=C)return f(),!1;if(W<=0)return f(),!0;const S=r.getBoundingClientRect(),F=M(re(t)),H=t.style.position==="absolute",L=H?M(S.width/r.offsetWidth,F):F,w=H?M(S.height/r.offsetHeight,F):F;return o("left",m(H?(e.left-S.left)/L-r.clientLeft+r.scrollLeft:e.left/L)),o("top",m(H?(e.top-S.top)/w-r.clientTop+r.scrollTop:e.top/w)),o("width",m(e.width/L)),o("height",m(e.height/w)),o("clipPath",`inset(${m((C-e.top)/w)} ${m((e.right-z)/L)} ${m((e.bottom-O)/w)} ${m((g-e.left)/L)})`),o("borderRadius",k),o("opacity",String(W)),o("visibility","visible"),D(),!0},T=()=>{if(b=0,d)return;const i=ee(),e=t.contains(n.activeElement),g=e&&!R;R=e,g&&y(),i&&(b=a.requestAnimationFrame(T))},c=()=>{!d&&!b&&(b=a.requestAnimationFrame(T))},A=typeof ResizeObserver>"u"?null:new ResizeObserver(c),G=new MutationObserver(i=>{i.some(e=>e.target===n.documentElement&&e.attributeName==="data-dv-dragging")&&D(),i.some(e=>!t.contains(e.target))&&c()});return G.observe(n.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class","hidden","inert","aria-hidden","data-dv-dragging"]}),a.addEventListener("resize",c),n.addEventListener("scroll",c,!0),n.addEventListener("visibilitychange",c),a.addEventListener(J,c),t.addEventListener("focus",y,!0),t.addEventListener("pointerdown",y,!0),n.addEventListener("focus",j,!0),I.current=()=>{E.current||f(),c()},T(),()=>{d=!0,b&&a.cancelAnimationFrame(b),A?.disconnect(),G.disconnect(),a.removeEventListener("resize",c),n.removeEventListener("scroll",c,!0),n.removeEventListener("visibilitychange",c),a.removeEventListener(J,c),t.removeEventListener("focus",y,!0),t.removeEventListener("pointerdown",y,!0),n.removeEventListener("focus",j,!0),I.current=null,f();const i=++$.current;queueMicrotask(()=>{$.current===i&&t.remove()})}},[l,t]),v.useLayoutEffect(()=>{I.current?.()},[p]),ne.createPortal(Q,t)}export{ae as S};
@@ -1 +1 @@
1
- import{u as B,d as c,j as o,r as O}from"./index-B5UW6SaE.js";import{A as P}from"./astryxBridge-Bupzouso.js";import{jj as R,jR as U,jS as _,ju as F,jT as K,jU as z,dm as V,jV as Y,jW as W,ar as J,c6 as Q,jX as X,jQ as Z,jY as q,aE as G,jJ as ee,jD as te,jZ as oe,ah as se}from"./appStore-CidPWYa0.js";import{E as ne}from"./EventCard-c6s4uGBu.js";import"./client-CPUljePZ.js";import{C as E}from"./CheckboxInput-DVO2-1J7.js";import"./nativeDownload-B3JGkABw.js";import"./ipc-CNlIRMtU.js";import"./Tooltip-DXuy9-1_.js";O({"todolist.title":{zh:"待办",en:"To-dos"},"todolist.untitled":{zh:"未命名",en:"Untitled"},"todolist.done":{zh:"已完成",en:"Completed"},"todolist.openInNote":{zh:"在笔记中打开",en:"Open in note"},"todolist.clickToEdit":{zh:"点击编辑",en:"Click to edit"},"todolist.addPlaceholder":{zh:"新建待办",en:"New to-do"},"todolist.allDone":{zh:"全部完成了。",en:"All done."},"todolist.emptyTitle":{zh:"还没有待办。",en:"No to-dos yet."},"todolist.emptyHintA":{zh:"在笔记里写 ",en:"Write "},"todolist.emptyExample":{zh:"- [ ] 事项 @2026-09-01",en:"- [ ] Task @2026-09-01"},"todolist.emptyHintB":{zh:"(打 ",en:" in a note (type "},"todolist.emptyHintC":{zh:" 有候选),或在下面直接加一条。",en:" for suggestions), or add one below."},"todolist.emptyHintCNoAdd":{zh:" 有候选)。",en:" for suggestions)."}});const M="done";function ae(h){const l=i=>typeof i=="string"?i:typeof i=="number"?String(i):"",a=l(h?.src);return{db:l(h?.db)||void 0,src:a==="db"||a==="md"?a:"all"}}function xe({params:h}={}){const l=ae(h),{t:a}=B(),i=R(),C=U(),[T,I]=c.useState(new Set([..._,M])),[m,N]=c.useState(null),[k,j]=c.useState(""),x=c.useMemo(()=>F(new Date),[]),u=c.useMemo(()=>i.filter(e=>e.checkboxCol&&(!l.db||e.db.path===l.db)),[i,l.db]),r=c.useMemo(()=>{const e=[];if(l.src!=="md")for(const t of u){const s=t.checkboxCol;for(const n of t.db.rows){const d=typeof n.cells[t.dateCol]=="string"?n.cells[t.dateCol]:"";e.push({key:`db:${t.db.path}:${n.rowId}`,name:n.name||a("todolist.untitled"),checked:n.cells[s]===!0,raw:d,source:t.db.name,db:t,rowId:n.rowId})}}if(l.src!=="db"&&!l.db)for(const t of C.filter(s=>s.isTask))e.push({key:`md:${t.path}:${t.line}`,name:t.text,checked:t.checked,raw:t.due,source:t.heading?`${t.title} › ${t.heading}`:t.title,note:{path:t.path,heading:t.heading},mark:t});return e},[u,C,l.src,l.db,a]),f=c.useMemo(()=>r.filter(e=>e.checked),[r]),D=c.useMemo(()=>{const e=new Map;for(const t of r){if(t.checked)continue;const s=K(t.raw,x),n=e.get(s);n?n.push(t):e.set(s,[t])}for(const t of e.values())t.sort((s,n)=>{const d=z(s.raw),v=z(n.raw);return(d===v?0:d<v?-1:1)||s.source.localeCompare(n.source,"zh")||s.name.localeCompare(n.name,"zh")});return e},[r,x]),b=r.length-f.length,A=e=>I(t=>{const s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s}),w=c.useMemo(()=>{if(!m)return null;const e=u.find(n=>n.db.path===m.dbPath),t=e?.db.rows.find(n=>n.rowId===m.rowId);if(!e||!t)return null;const s=typeof t.cells[e.dateCol]=="string"?t.cells[e.dateCol]:"";return{db:e.db,row:t,colId:e.dateCol,title:t.name,raw:s}},[m,u]),p=c.useMemo(()=>u.find(e=>!e.db.readonly&&!e.db.isNoteView),[u]),H=()=>{const e=k.trim();!e||!p||(ee(p.db,p.dateCol,te(x,!0),e),j(""))},S=(e,t)=>{if(e.note){oe(e.note.path,e.note.heading);return}if(!e.db||!e.rowId)return;const s=t.currentTarget.getBoundingClientRect();N({dbPath:e.db.db.path,rowId:e.rowId,at:{left:s.left,top:s.top,right:s.right,bottom:s.bottom,zoom:se(t.currentTarget)||1}})},$=!!V?.patchMark,g=e=>{const t=X(e.raw,x);return o.jsxs("li",{className:"amx-todo-item",children:[e.db&&e.rowId?o.jsx(E,{label:e.name,isLabelHidden:!0,size:"sm",value:e.checked,onChange:s=>Z(e.db.db,e.rowId,e.db.checkboxCol,s?!0:void 0)}):e.mark&&$?o.jsx(E,{label:e.name,isLabelHidden:!0,size:"sm",value:e.checked,onChange:s=>q(e.mark,{checked:s})}):o.jsx("span",{className:`amx-todo-box${e.checked?" on":""}`,"aria-hidden":"true"}),o.jsxs("button",{className:"amx-todo-main",title:e.note?a("todolist.openInNote"):a("todolist.clickToEdit"),onClick:s=>S(e,s),children:[o.jsx("span",{className:`amx-todo-name${e.checked?" done":""}`,children:e.name}),e.raw?o.jsx("span",{className:`amx-todo-due ${t.tone}`,children:t.label}):null,e.note?o.jsx(G,{className:"amx-todo-jump",size:12}):null]})]},e.key)},L=(e,t)=>{if(e!=="undated")return o.jsx("ul",{className:"amx-todo-list",children:t.map(g)});const s=[];for(const n of t){const d=s[s.length-1];d&&d.source===n.source?d.items.push(n):s.push({source:n.source,items:[n]})}return o.jsx(o.Fragment,{children:s.map(n=>o.jsxs("div",{children:[o.jsxs("div",{className:"amx-todo-src",children:[n.source,o.jsx("span",{className:"amx-todo-srcn",children:n.items.length})]}),o.jsx("ul",{className:"amx-todo-list",children:n.items.map(g)})]},n.source))})},y=(e,t,s,n)=>{const d=!T.has(e);return o.jsxs("section",{className:"amx-todo-group",children:[o.jsxs("button",{className:`amx-todo-ghead${d?" is-open":""}`,onClick:()=>A(e),"aria-expanded":d,children:[o.jsx(Q,{className:"amx-todo-caret",size:12}),o.jsx("span",{className:"amx-todo-gname",children:t}),o.jsx("span",{className:"amx-todo-gcount",children:s.length})]}),o.jsx("div",{className:`amx-todo-reveal${d?" is-open":""}`,children:o.jsx("div",{className:"amx-todo-reveal-in",children:n})})]},e)};return o.jsx(P,{children:o.jsxs("div",{className:"amx-todo",children:[o.jsxs("div",{className:"amx-todo-bar",children:[o.jsx("span",{className:"amx-todo-title",children:a("todolist.title")}),b>0&&o.jsx("span",{className:"amx-todo-total",children:b})]}),r.length===0&&o.jsxs("div",{className:"amx-todo-empty",children:[a("todolist.emptyTitle"),!h?.miniSurface&&o.jsxs(o.Fragment,{children:[o.jsx("br",{}),a("todolist.emptyHintA"),o.jsx("code",{children:a("todolist.emptyExample")}),a("todolist.emptyHintB"),o.jsx("code",{children:"@"}),a(p?"todolist.emptyHintC":"todolist.emptyHintCNoAdd")]})]}),r.length>0&&b===0&&o.jsx("div",{className:"amx-todo-empty",children:a("todolist.allDone")}),Y.map(e=>{const t=D.get(e);return t&&t.length?y(e,W[e],t,L(e,t)):null}),f.length>0&&y(M,a("todolist.done"),f,o.jsx("ul",{className:"amx-todo-list",children:f.map(g)})),p&&o.jsxs("div",{className:"amx-todo-add",children:[o.jsx(J,{className:"amx-todo-addicon",size:13}),o.jsx("input",{className:"amx-todo-addinput",placeholder:a("todolist.addPlaceholder"),value:k,onChange:e=>j(e.target.value),onKeyDown:e=>{e.nativeEvent.isComposing||(e.key==="Enter"&&(e.preventDefault(),H()),e.key==="Escape"&&j(""))}})]}),w&&m&&o.jsx(ne,{ev:w,at:m.at,onClose:()=>N(null)})]})})}export{xe as TodoListView,ae as readTodoParams};
1
+ import{u as B,d as c,j as o,r as O}from"./index-BYUntVIZ.js";import{A as P}from"./astryxBridge-CT2wZJXs.js";import{jj as R,jR as U,jS as _,ju as F,jT as K,jU as z,dm as V,jV as Y,jW as W,ar as J,c6 as Q,jX as X,jQ as Z,jY as q,aE as G,jJ as ee,jD as te,jZ as oe,ah as se}from"./appStore-affnJoin.js";import{E as ne}from"./EventCard-DUrn2krw.js";import"./client-BqhpYbYL.js";import{C as E}from"./CheckboxInput-BuJ3HPm_.js";import"./nativeDownload-Udrv_tmU.js";import"./ipc-D7yENkjV.js";import"./Tooltip-DtDUL18W.js";O({"todolist.title":{zh:"待办",en:"To-dos"},"todolist.untitled":{zh:"未命名",en:"Untitled"},"todolist.done":{zh:"已完成",en:"Completed"},"todolist.openInNote":{zh:"在笔记中打开",en:"Open in note"},"todolist.clickToEdit":{zh:"点击编辑",en:"Click to edit"},"todolist.addPlaceholder":{zh:"新建待办",en:"New to-do"},"todolist.allDone":{zh:"全部完成了。",en:"All done."},"todolist.emptyTitle":{zh:"还没有待办。",en:"No to-dos yet."},"todolist.emptyHintA":{zh:"在笔记里写 ",en:"Write "},"todolist.emptyExample":{zh:"- [ ] 事项 @2026-09-01",en:"- [ ] Task @2026-09-01"},"todolist.emptyHintB":{zh:"(打 ",en:" in a note (type "},"todolist.emptyHintC":{zh:" 有候选),或在下面直接加一条。",en:" for suggestions), or add one below."},"todolist.emptyHintCNoAdd":{zh:" 有候选)。",en:" for suggestions)."}});const M="done";function ae(h){const l=i=>typeof i=="string"?i:typeof i=="number"?String(i):"",a=l(h?.src);return{db:l(h?.db)||void 0,src:a==="db"||a==="md"?a:"all"}}function xe({params:h}={}){const l=ae(h),{t:a}=B(),i=R(),C=U(),[T,I]=c.useState(new Set([..._,M])),[m,N]=c.useState(null),[k,j]=c.useState(""),x=c.useMemo(()=>F(new Date),[]),u=c.useMemo(()=>i.filter(e=>e.checkboxCol&&(!l.db||e.db.path===l.db)),[i,l.db]),r=c.useMemo(()=>{const e=[];if(l.src!=="md")for(const t of u){const s=t.checkboxCol;for(const n of t.db.rows){const d=typeof n.cells[t.dateCol]=="string"?n.cells[t.dateCol]:"";e.push({key:`db:${t.db.path}:${n.rowId}`,name:n.name||a("todolist.untitled"),checked:n.cells[s]===!0,raw:d,source:t.db.name,db:t,rowId:n.rowId})}}if(l.src!=="db"&&!l.db)for(const t of C.filter(s=>s.isTask))e.push({key:`md:${t.path}:${t.line}`,name:t.text,checked:t.checked,raw:t.due,source:t.heading?`${t.title} › ${t.heading}`:t.title,note:{path:t.path,heading:t.heading},mark:t});return e},[u,C,l.src,l.db,a]),f=c.useMemo(()=>r.filter(e=>e.checked),[r]),D=c.useMemo(()=>{const e=new Map;for(const t of r){if(t.checked)continue;const s=K(t.raw,x),n=e.get(s);n?n.push(t):e.set(s,[t])}for(const t of e.values())t.sort((s,n)=>{const d=z(s.raw),v=z(n.raw);return(d===v?0:d<v?-1:1)||s.source.localeCompare(n.source,"zh")||s.name.localeCompare(n.name,"zh")});return e},[r,x]),b=r.length-f.length,A=e=>I(t=>{const s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s}),w=c.useMemo(()=>{if(!m)return null;const e=u.find(n=>n.db.path===m.dbPath),t=e?.db.rows.find(n=>n.rowId===m.rowId);if(!e||!t)return null;const s=typeof t.cells[e.dateCol]=="string"?t.cells[e.dateCol]:"";return{db:e.db,row:t,colId:e.dateCol,title:t.name,raw:s}},[m,u]),p=c.useMemo(()=>u.find(e=>!e.db.readonly&&!e.db.isNoteView),[u]),H=()=>{const e=k.trim();!e||!p||(ee(p.db,p.dateCol,te(x,!0),e),j(""))},S=(e,t)=>{if(e.note){oe(e.note.path,e.note.heading);return}if(!e.db||!e.rowId)return;const s=t.currentTarget.getBoundingClientRect();N({dbPath:e.db.db.path,rowId:e.rowId,at:{left:s.left,top:s.top,right:s.right,bottom:s.bottom,zoom:se(t.currentTarget)||1}})},$=!!V?.patchMark,g=e=>{const t=X(e.raw,x);return o.jsxs("li",{className:"amx-todo-item",children:[e.db&&e.rowId?o.jsx(E,{label:e.name,isLabelHidden:!0,size:"sm",value:e.checked,onChange:s=>Z(e.db.db,e.rowId,e.db.checkboxCol,s?!0:void 0)}):e.mark&&$?o.jsx(E,{label:e.name,isLabelHidden:!0,size:"sm",value:e.checked,onChange:s=>q(e.mark,{checked:s})}):o.jsx("span",{className:`amx-todo-box${e.checked?" on":""}`,"aria-hidden":"true"}),o.jsxs("button",{className:"amx-todo-main",title:e.note?a("todolist.openInNote"):a("todolist.clickToEdit"),onClick:s=>S(e,s),children:[o.jsx("span",{className:`amx-todo-name${e.checked?" done":""}`,children:e.name}),e.raw?o.jsx("span",{className:`amx-todo-due ${t.tone}`,children:t.label}):null,e.note?o.jsx(G,{className:"amx-todo-jump",size:12}):null]})]},e.key)},L=(e,t)=>{if(e!=="undated")return o.jsx("ul",{className:"amx-todo-list",children:t.map(g)});const s=[];for(const n of t){const d=s[s.length-1];d&&d.source===n.source?d.items.push(n):s.push({source:n.source,items:[n]})}return o.jsx(o.Fragment,{children:s.map(n=>o.jsxs("div",{children:[o.jsxs("div",{className:"amx-todo-src",children:[n.source,o.jsx("span",{className:"amx-todo-srcn",children:n.items.length})]}),o.jsx("ul",{className:"amx-todo-list",children:n.items.map(g)})]},n.source))})},y=(e,t,s,n)=>{const d=!T.has(e);return o.jsxs("section",{className:"amx-todo-group",children:[o.jsxs("button",{className:`amx-todo-ghead${d?" is-open":""}`,onClick:()=>A(e),"aria-expanded":d,children:[o.jsx(Q,{className:"amx-todo-caret",size:12}),o.jsx("span",{className:"amx-todo-gname",children:t}),o.jsx("span",{className:"amx-todo-gcount",children:s.length})]}),o.jsx("div",{className:`amx-todo-reveal${d?" is-open":""}`,children:o.jsx("div",{className:"amx-todo-reveal-in",children:n})})]},e)};return o.jsx(P,{children:o.jsxs("div",{className:"amx-todo",children:[o.jsxs("div",{className:"amx-todo-bar",children:[o.jsx("span",{className:"amx-todo-title",children:a("todolist.title")}),b>0&&o.jsx("span",{className:"amx-todo-total",children:b})]}),r.length===0&&o.jsxs("div",{className:"amx-todo-empty",children:[a("todolist.emptyTitle"),!h?.miniSurface&&o.jsxs(o.Fragment,{children:[o.jsx("br",{}),a("todolist.emptyHintA"),o.jsx("code",{children:a("todolist.emptyExample")}),a("todolist.emptyHintB"),o.jsx("code",{children:"@"}),a(p?"todolist.emptyHintC":"todolist.emptyHintCNoAdd")]})]}),r.length>0&&b===0&&o.jsx("div",{className:"amx-todo-empty",children:a("todolist.allDone")}),Y.map(e=>{const t=D.get(e);return t&&t.length?y(e,W[e],t,L(e,t)):null}),f.length>0&&y(M,a("todolist.done"),f,o.jsx("ul",{className:"amx-todo-list",children:f.map(g)})),p&&o.jsxs("div",{className:"amx-todo-add",children:[o.jsx(J,{className:"amx-todo-addicon",size:13}),o.jsx("input",{className:"amx-todo-addinput",placeholder:a("todolist.addPlaceholder"),value:k,onChange:e=>j(e.target.value),onKeyDown:e=>{e.nativeEvent.isComposing||(e.key==="Enter"&&(e.preventDefault(),H()),e.key==="Escape"&&j(""))}})]}),w&&m&&o.jsx(ne,{ev:w,at:m.at,onClose:()=>N(null)})]})})}export{xe as TodoListView,ae as readTodoParams};
@@ -1 +1 @@
1
- import{d as l,j as o}from"./index-B5UW6SaE.js";import{u as E,c as f}from"./astryxBridge-Bupzouso.js";import"./appStore-CidPWYa0.js";import"./nativeDownload-B3JGkABw.js";import"./ipc-CNlIRMtU.js";import"./client-CPUljePZ.js";function N(r){return typeof r=="string"||typeof r=="number"}function p(...r){const i=r.filter(Boolean);return i.length>0?i.join(" "):void 0}function F({children:r,anchorRef:i,content:n,placement:y="above",alignment:m="center",delay:x=200,hideDelay:j=0,focusTrigger:g="auto",isEnabled:A=!0,onOpenChange:d,hasHoverIndication:b="auto",isOpen:B,isDefaultOpen:T}){const c=l.useRef(null),u=r!=null?N(r):!1,v=b===!0||b==="auto"&&u,w=l.useCallback(()=>{d?.(!0)},[d]),k=l.useCallback(()=>{d?.(!1)},[d]),e=E({placement:y,alignment:m,delay:x,hideDelay:j,focusTrigger:g,isEnabled:A,isOpen:B,isDefaultOpen:T,onShow:w,onHide:k});return f(()=>{if(!i)return;const s=i.current;if(!s)return;e.ref(s);const t=s.getAttribute("aria-describedby");return s.setAttribute("aria-describedby",p(t,e.describedBy)??""),()=>{e.ref(null),t?s.setAttribute("aria-describedby",t):s.removeAttribute("aria-describedby")}},[i,e.ref,e.describedBy]),f(()=>{if(i||u)return;const s=c.current;if(!s)return;const t=s.firstElementChild;if(!t)return;e.ref(t);const a=t.getAttribute("aria-describedby");return t.setAttribute("aria-describedby",p(a,e.describedBy)??""),()=>{e.ref(null),a?t.setAttribute("aria-describedby",a):t.removeAttribute("aria-describedby")}},[i,u,e.ref,e.describedBy]),i&&r==null?o.jsx(o.Fragment,{children:e.renderTooltip(n)}):u?o.jsxs(o.Fragment,{children:[o.jsx("span",{ref:e.ref,tabIndex:0,"aria-describedby":e.describedBy,...{0:{className:"xt0psk2"},1:{className:"xt0psk2 xujl8zx xev0dqp xycaml9 xrys4gj"}}[!!v<<0],children:r}),e.renderTooltip(n)]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:c,className:"xjp7ctv",children:r}),e.renderTooltip(n)]})}F.displayName="Tooltip";export{F as Tooltip};
1
+ import{d as l,j as o}from"./index-BYUntVIZ.js";import{u as E,c as f}from"./astryxBridge-CT2wZJXs.js";import"./appStore-affnJoin.js";import"./nativeDownload-Udrv_tmU.js";import"./ipc-D7yENkjV.js";import"./client-BqhpYbYL.js";function N(r){return typeof r=="string"||typeof r=="number"}function p(...r){const i=r.filter(Boolean);return i.length>0?i.join(" "):void 0}function F({children:r,anchorRef:i,content:n,placement:y="above",alignment:m="center",delay:x=200,hideDelay:j=0,focusTrigger:g="auto",isEnabled:A=!0,onOpenChange:d,hasHoverIndication:b="auto",isOpen:B,isDefaultOpen:T}){const c=l.useRef(null),u=r!=null?N(r):!1,v=b===!0||b==="auto"&&u,w=l.useCallback(()=>{d?.(!0)},[d]),k=l.useCallback(()=>{d?.(!1)},[d]),e=E({placement:y,alignment:m,delay:x,hideDelay:j,focusTrigger:g,isEnabled:A,isOpen:B,isDefaultOpen:T,onShow:w,onHide:k});return f(()=>{if(!i)return;const s=i.current;if(!s)return;e.ref(s);const t=s.getAttribute("aria-describedby");return s.setAttribute("aria-describedby",p(t,e.describedBy)??""),()=>{e.ref(null),t?s.setAttribute("aria-describedby",t):s.removeAttribute("aria-describedby")}},[i,e.ref,e.describedBy]),f(()=>{if(i||u)return;const s=c.current;if(!s)return;const t=s.firstElementChild;if(!t)return;e.ref(t);const a=t.getAttribute("aria-describedby");return t.setAttribute("aria-describedby",p(a,e.describedBy)??""),()=>{e.ref(null),a?t.setAttribute("aria-describedby",a):t.removeAttribute("aria-describedby")}},[i,u,e.ref,e.describedBy]),i&&r==null?o.jsx(o.Fragment,{children:e.renderTooltip(n)}):u?o.jsxs(o.Fragment,{children:[o.jsx("span",{ref:e.ref,tabIndex:0,"aria-describedby":e.describedBy,...{0:{className:"xt0psk2"},1:{className:"xt0psk2 xujl8zx xev0dqp xycaml9 xrys4gj"}}[!!v<<0],children:r}),e.renderTooltip(n)]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:c,className:"xjp7ctv",children:r}),e.renderTooltip(n)]})}F.displayName="Tooltip";export{F as Tooltip};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./PdfAnnotator-CyAw8sgq.js","./index-B5UW6SaE.js","./pdf-C2_sJa3b.js","./pdf.worker.min-CGb3BKV9.js","./appStore-CidPWYa0.js","./nativeDownload-B3JGkABw.js","./ipc-CNlIRMtU.js","./client-CPUljePZ.js","./appStore-DeaC1U32.css","./PdfAnnotator-C_kglLCA.css"])))=>i.map(i=>d[i]);
2
- import{r as gn,j as f,u as Zt,d as v,P as Cr,t as ke,bB as Du,bC as Lu,bD as Iu,bE as qs,b2 as Pu,a_ as bl,bF as Fu,b5 as Ou,bG as Zs,bH as _u,bI as Oc,bJ as Bu,bK as Ku,l as vl,bL as qu,bM as Or,bN as Hu,aG as Vu,aT as Wu,bO as Yu,bP as wl,n as Xu,bQ as Uu,m as hs,bR as Gu,bS as kl,aO as Cl,aS as Ju,bv as ia,J as Zu,ag as _c,V as Qu,_ as ed,bT as td,M as nd,bU as od,bV as rd,ab as sd,q as Sl,as as Bc,B as El,bW as Kc,bX as Hs,bY as qc,bZ as ad,b_ as Hc,ad as cd,b$ as hr,c0 as Vc,c1 as id,aw as ld,c2 as ud,ax as dd,c3 as fd,c4 as md}from"./index-B5UW6SaE.js";import{F as pd,c as Qs,d as hd,h as Ml,p as ks,e as ps,t as gd,f as yd,g as xd,i as bd,j as sc,l as zl,k as vd,m as Fa,n as wd,o as kd,q as Cd,r as Sd,v as la,w as ua,x as Ed,y as Vs,z as Oa,A as Md,B as Ws,C as zd,D as _a,E as Nl,G as Wc,H as Nd,I as $d,T as Ad,J as Td,K as jd,L as Rd,M as Dd,u as $l,N as Ld,O as Id,Q as Pd,R as Fd,S as Yc,U as Od,V as $s,W as _d,X as Bd,Y as Kd,Z as Al,_ as as,$ as qd,a0 as Hd,a1 as Vd,a2 as Wd,a3 as Yd,a4 as Xd,a5 as Ud,a6 as Gd,a7 as da,a8 as Jd,a9 as Zd,aa as Qd}from"./MarkdownBlock-wYEaBBOr.js";import{G as Qt,nd as ef,at as tf,c6 as Tl,dm as bn,ne as nf,cr as Kr,nf as Ht,ah as Ln,ng as Xc,nh as _o,ni as Ie,nj as Nr,nk as of,nl as rf,nm as sf,bq as jl,b as kn,fB as ac,nn as Uc,j8 as af,ar as cf,aF as cc,no as lf,aK as ea,np as uf,nq as df,nr as ff,ns as Tn,nt as Me,nu as zo,N as ic,I as mf,aN as Gc,lH as Sr,nv as Rl,cW as Ba,nw as Jc,nx as pf,gl as hf,ny as cr,nz as co,nA as gf,nB as yf,nC as xf,nD as bf,nE as Zc,nF as vf,fz as wf,fy as kf,nG as Cf,fj as Dl,nH as Qc,gm as Sf,nI as Ef,lB as Mf,nJ as Ll,nK as zf,nL as Nf,nM as $f,nN as Ka,nO as Af,nP as ei,nQ as Tf,nR as Ur,fV as qa,nS as ti,nT as As,d$ as jf,cP as Rf,kT as Df,kS as Lf,nU as sr,ai as Mr,P as If,nV as ni,nW as oi,g6 as ri,m7 as Pf,nX as Ff,nY as Of,nZ as _f,n_ as Bf,n$ as si,mV as Kf,o0 as qf,o1 as ai,o2 as Hf,m6 as Vf,o3 as Wf,o4 as Yf,o5 as Xf,bK as Ha,eN as Uf,fA as Gf,o6 as Jf,fc as Zf,o7 as Qf,o8 as em,o9 as tm,oa as nm,ob as om,oc as rm,od as sm,oe as ci,of as am,og as cm,oh as fa,oi as ii,oj as ma,dH as im,cL as lm,cq as um,iV as li,bV as dm,dF as fm,ok as ui,ol as mm,om as pm,on as di,oo as hm,Z as gm,b6 as ym,op as xm,oq as bm,or as vm,os as Lr,ot as xn,ou as wm,ov as km,ow as Va,fo as pa,ox as fi,m_ as Cm,i5 as Sm,oy as Em,oz as Mm}from"./appStore-CidPWYa0.js";import{c as zm}from"./client-CPUljePZ.js";import{$ as Et,a as Il,b as lc}from"./index-BqGpbntz.js";import{N as Nm,S as $m,r as Am,a as Tm,C as jm,U as Rm,I as Dm}from"./pageChrome-DFi9zs6F.js";import{h as Yr,l as Lm,f as Xr,a as mi,i as uc,b as _s,c as Im,d as gr,t as Ts,e as js,g as ha,s as Pm,j as Fm,k as Om}from"./listFold-Aea6I0Sa.js";import{a as _m,b as Bm,c as pi,v as hi,i as Km}from"./linkFollow-iP2zfbA3.js";import{S as qm,b as Hm,a as Vm,F as Wm}from"./SketchCard-DAD0jR0i.js";import{A as gi}from"./arrow-up-right-KPFbRA41.js";import{c as Pl}from"./nativeDownload-B3JGkABw.js";import{r as Gr,a as Ym,C as Xm}from"./Chrome-BvpbCvo1.js";import{e as Um,h as Gm,a as yi,o as Jm,d as Zm,i as Qm,g as ep,j as tp,k as np,f as op,c as rp}from"./canvasPrefs-CxfyDTMT.js";import{H as sp}from"./hand-fuehbnkI.js";import{T as ap,F as cp}from"./type-C5J875vb.js";import{M as ip}from"./minus-BBdfT_sc.js";import{createFoldMemory as lp,remapFoldMemory as up}from"./foldActions-BGocXE-o.js";import{L as dp}from"./lock-TSDKuCod.js";import{U as fp}from"./undo-2-BOUt5qks.js";import{C as mp}from"./code-xml-n9mgGgkv.js";import{M as pp}from"./message-square-plus-3wFslIMY.js";const hp=[["path",{d:"M12 2v20",key:"t6zp3m"}],["path",{d:"M8 10H4a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h4",key:"14d6g8"}],["path",{d:"M16 10h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-4",key:"1e2lrw"}],["path",{d:"M8 20H7a2 2 0 0 1-2-2v-2c0-1.1.9-2 2-2h1",key:"1fkdwx"}],["path",{d:"M16 14h1a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-1",key:"1euafb"}]],gp=Qt("align-center-vertical",hp);const yp=[["rect",{width:"13",height:"7",x:"3",y:"3",rx:"1",key:"11xb64"}],["path",{d:"m22 15-3-3 3-3",key:"26chmm"}],["rect",{width:"13",height:"7",x:"3",y:"14",rx:"1",key:"k6ky7n"}]],xp=Qt("between-horizontal-end",yp);const bp=[["rect",{width:"13",height:"7",x:"8",y:"3",rx:"1",key:"pkso9a"}],["path",{d:"m2 9 3 3-3 3",key:"1agib5"}],["rect",{width:"13",height:"7",x:"8",y:"14",rx:"1",key:"1q5fc1"}]],vp=Qt("between-horizontal-start",bp);const wp=[["rect",{width:"7",height:"13",x:"3",y:"3",rx:"1",key:"1fdu0f"}],["path",{d:"m9 22 3-3 3 3",key:"17z65a"}],["rect",{width:"7",height:"13",x:"14",y:"3",rx:"1",key:"1squn4"}]],kp=Qt("between-vertical-end",wp);const Cp=[["rect",{width:"7",height:"13",x:"3",y:"8",rx:"1",key:"1fjrkv"}],["path",{d:"m15 2-3 3-3-3",key:"1uh6eb"}],["rect",{width:"7",height:"13",x:"14",y:"8",rx:"1",key:"w3fjg8"}]],Sp=Qt("between-vertical-start",Cp);const Ep=[["path",{d:"m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16",key:"d5nyq2"}],["path",{d:"M22 9v7",key:"pvm9v3"}],["path",{d:"M3.304 13h6.392",key:"1q3zxz"}],["circle",{cx:"18.5",cy:"12.5",r:"3.5",key:"z97x68"}]],Mp=Qt("case-sensitive",Ep);const zp=[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]],Np=Qt("chevrons-down",zp);const $p=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]],Ap=Qt("heading-1",$p);const Tp=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]],jp=Qt("heading-2",Tp);const Rp=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]],Dp=Qt("heading-3",Rp);const Lp=[["path",{d:"M10 5h11",key:"1hkqpe"}],["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 19h11",key:"14g2nv"}],["path",{d:"m3 10 3-3-3-3",key:"i7pm08"}],["path",{d:"m3 20 3-3-3-3",key:"20gx1n"}]],Ip=Qt("list-collapse",Lp);const Pp=[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]],Fp=Qt("list-ordered",Pp);const Op=[["path",{d:"m18 8 4 4-4 4",key:"1ak13k"}],["path",{d:"M2 12h20",key:"9i4pu4"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}]],_p=Qt("move-horizontal",Op);const Bp=[["path",{d:"M18 8L22 12L18 16",key:"1r0oui"}],["path",{d:"M2 12H22",key:"1m8cig"}]],Kp=Qt("move-right",Bp);const qp=[["path",{d:"M6 8L2 12L6 16",key:"kyvwex"}],["path",{d:"M2 12H22",key:"1m8cig"}]],Hp=Qt("move-left",qp);const Vp=[["path",{d:"M13 4v16",key:"8vvj80"}],["path",{d:"M17 4v16",key:"7dpous"}],["path",{d:"M19 4H9.5a4.5 4.5 0 0 0 0 9H13",key:"sh4n9v"}]],xi=Qt("pilcrow",Vp);const Wp=[["path",{d:"M17 3v10",key:"15fgeh"}],["path",{d:"m12.67 5.5 8.66 5",key:"1gpheq"}],["path",{d:"m12.67 10.5 8.66-5",key:"1dkfa6"}],["path",{d:"M9 17a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2v-2z",key:"swwfx4"}]],Yp=Qt("regex",Wp);const Xp=[["path",{d:"M14 14a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1",key:"zg1ipl"}],["path",{d:"M14 4a1 1 0 0 1 1-1",key:"dhj8ez"}],["path",{d:"M15 10a1 1 0 0 1-1-1",key:"1mnyi5"}],["path",{d:"M19 14a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1",key:"txt6k4"}],["path",{d:"M21 4a1 1 0 0 0-1-1",key:"sfs9ap"}],["path",{d:"M21 9a1 1 0 0 1-1 1",key:"mp6qeo"}],["path",{d:"m3 7 3 3 3-3",key:"x25e72"}],["path",{d:"M6 10V5a2 2 0 0 1 2-2h2",key:"15xut4"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}]],Up=Qt("replace-all",Xp);const Gp=[["path",{d:"M14 4a1 1 0 0 1 1-1",key:"dhj8ez"}],["path",{d:"M15 10a1 1 0 0 1-1-1",key:"1mnyi5"}],["path",{d:"M21 4a1 1 0 0 0-1-1",key:"sfs9ap"}],["path",{d:"M21 9a1 1 0 0 1-1 1",key:"mp6qeo"}],["path",{d:"m3 7 3 3 3-3",key:"x25e72"}],["path",{d:"M6 10V5a2 2 0 0 1 2-2h2",key:"15xut4"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}]],Jp=Qt("replace",Gp);const Zp=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 12h18",key:"1i2n21"}]],Qp=Qt("rows-2",Zp);const eh=[["circle",{cx:"19",cy:"5",r:"2",key:"mhkx31"}],["circle",{cx:"5",cy:"19",r:"2",key:"v8kfzx"}],["path",{d:"M5 17A12 12 0 0 1 17 5",key:"1okkup"}]],th=Qt("spline",eh);const nh=[["path",{d:"M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z",key:"1dfntj"}],["path",{d:"M15 3v5a1 1 0 0 0 1 1h5",key:"6s6qgf"}]],Wa=Qt("sticky-note",nh);const oh=[["path",{d:"M17 5H3",key:"1cn7zz"}],["path",{d:"M21 12H8",key:"scolzb"}],["path",{d:"M21 19H8",key:"13qgcb"}],["path",{d:"M3 12v7",key:"1ri8j3"}]],rh=Qt("text-quote",oh);function sh(e,t){const n=e.trim().toLowerCase(),o=t.toLowerCase();if(!n)return 1;let r=0,s=0,i=-2,a=-1;for(let c=0;c<o.length&&s<n.length;c++)if(o[c]===n[s]){a<0&&(a=c);let d=1;c===i+1&&(d+=4),(c===0||/[\s/\-_.]/.test(o[c-1]))&&(d+=3),r+=d,i=c,s++}return s<n.length?null:(r-=a*.1,r-=o.length*.02,o===n&&(r+=10),r)}function ah(e,t,n){if(!e.trim())return t;const o=[];for(const r of t){const s=sh(e,n(r));s!=null&&o.push({item:r,score:s})}return o.sort((r,s)=>s.score-r.score),o.map(r=>r.item)}gn({"delassets.blockTitle":{zh:"引用块已删除",en:"Reference block deleted"},"delassets.noteTitle":{zh:"删除「{name}」",en:'Delete "{name}"'},"delassets.blockMsg":{zh:"这 {n} 个文件只被这条笔记引用,要一并从磁盘删除吗?",en:"These {n} files are only referenced by this note. Delete them from disk too?"},"delassets.noteMsg":{zh:"有 {n} 个附件只被这条笔记引用,要一并删除吗?",en:"{n} attachments are only referenced by this note. Delete them too?"},"delassets.more":{zh:"…还有 {n} 个",en:"…and {n} more"},"delassets.remember":{zh:"下次不再问(设置→笔记可改回)",en:"Don't ask again (change it back in Settings → Notes)"},"delassets.keepFiles":{zh:"保留文件",en:"Keep files"},"delassets.cancel":{zh:"取消",en:"Cancel"},"delassets.noteOnly":{zh:"只删笔记",en:"Delete note only"},"delassets.deleteAll":{zh:"一并删除",en:"Delete them too"}});const Ya="amadeus_delete_assets";function Gb(){try{const e=localStorage.getItem(Ya);return e==="yes"?!0:e==="no"?!1:null}catch{return null}}function ch(e){try{e===null?localStorage.removeItem(Ya):localStorage.setItem(Ya,e?"yes":"no")}catch{}}const gs=Pl(e=>({req:null,open:t=>e({req:t}),clear:()=>e({req:null})}));function ih(e,t,n){return new Promise(o=>{gs.getState().req?.resolve(null),gs.getState().open({note:e,assets:t,block:n?.block,resolve:o})})}function Jb(){const e=gs(t=>t.req);return e?f.jsx("div",{className:"am-app tangu-lovable",style:{display:"contents"},children:f.jsx(lh,{req:e},e.note)}):null}function lh({req:e}){const{t}=Zt(),[n,o]=v.useState(!1),r=i=>{gs.getState().req===e&&(n&&i!==null&&ch(i==="with"),gs.getState().clear(),e.resolve(i))};ef(()=>r(null));const s=e.assets.slice(0,6);return f.jsx("div",{className:"dialog-overlay",onMouseDown:()=>r(null),children:f.jsxs("div",{className:"dialog",onMouseDown:i=>i.stopPropagation(),children:[f.jsx("div",{className:"dialog-title",children:e.block?t("delassets.blockTitle"):t("delassets.noteTitle",{name:e.note})}),f.jsxs("div",{className:"dialog-msg",children:[e.block?t("delassets.blockMsg",{n:e.assets.length}):t("delassets.noteMsg",{n:e.assets.length}),f.jsxs("ul",{style:{margin:"6px 0 0",paddingLeft:18,opacity:.8},children:[s.map(i=>f.jsx("li",{children:i},i)),e.assets.length>s.length&&f.jsx("li",{children:t("delassets.more",{n:e.assets.length-s.length})})]})]}),!e.block&&f.jsxs("label",{className:"inline-check",style:{display:"flex",gap:6,alignItems:"center",marginTop:10},children:[f.jsx("input",{type:"checkbox",checked:n,onChange:i=>o(i.target.checked)}),t("delassets.remember")]}),f.jsxs("div",{className:"dialog-actions",children:[e.block?f.jsx("button",{className:"dialog-btn",autoFocus:!0,onClick:()=>r("only"),children:t("delassets.keepFiles")}):f.jsxs(f.Fragment,{children:[f.jsx("button",{className:"dialog-btn",onClick:()=>r(null),children:t("delassets.cancel")}),f.jsx("button",{className:"dialog-btn",onClick:()=>r("only"),children:t("delassets.noteOnly")})]}),f.jsx("button",{className:"dialog-btn","data-danger":!0,autoFocus:!e.block,onClick:()=>r("with"),children:t("delassets.deleteAll")})]})]})})}gn({"settings.notes.aiSpaceLabel":{zh:"空行按空格唤起 AI",en:"Press Space on an empty line for AI"},"settings.notes.aiSpaceHint":{zh:"在空的段落里按空格打开 AI 写作面板;输入法组字中的空格不受影响。仅本机生效",en:"Space on an empty paragraph opens the AI writing panel. Spaces typed with an input method are not affected. This device only"}});const Xa="forsion.amadeus.aiSpaceTrigger";let cs=null;function uh(){if(cs===null)try{cs=localStorage.getItem(Xa)==="1"}catch{cs=!1}return cs}function Zb(e){cs=e;try{e?localStorage.setItem(Xa,"1"):localStorage.removeItem(Xa)}catch{}}gn({"find.placeholder":{zh:"在本页查找…",en:"Find in page…"},"find.prev":{zh:"上一个(Shift+Enter)",en:"Previous (Shift+Enter)"},"find.next":{zh:"下一个(Enter)",en:"Next (Enter)"},"find.close":{zh:"关闭(Esc)",en:"Close (Esc)"},"find.case":{zh:"区分大小写",en:"Match case"},"find.regex":{zh:"使用正则表达式",en:"Use regular expression"},"find.toggleReplace":{zh:"切换替换(⌘⌥F / Ctrl+Alt+F)",en:"Toggle replace (⌘⌥F / Ctrl+Alt+F)"},"find.replacePlaceholder":{zh:"替换为…",en:"Replace with…"},"find.replaceOne":{zh:"替换(Enter)",en:"Replace (Enter)"},"find.replaceAll":{zh:"全部替换(⌘/Ctrl+Enter)",en:"Replace all (⌘/Ctrl+Enter)"},"find.badRegex":{zh:"正则表达式无效",en:"Invalid regular expression"}});const Fl=typeof CSS<"u"&&"highlights"in CSS;let qt=[],ys=[];const St=Pl(()=>({open:!1,query:"",active:0,total:0,root:null,caseSensitive:!1,regex:!1,bad:!1,replaceOpen:!1,replacement:"",replaceable:0,providerVer:0})),xs=new Set,bi=()=>St.setState(e=>({providerVer:e.providerVer+1}));function vi(e){return xs.add(e),bi(),()=>{xs.delete(e),bi()}}function dc(e){const t=e.startContainer;for(const n of xs)if(n.el.isConnected&&(n.owns?n.owns(t):n.el.contains(t)))return n;return null}function wi(e,t,n){return!n||!t?e:e.replace(/\$(\$|&|<([^>]*)>|(\d{1,2}))/g,(o,r,s,i)=>{if(r==="$")return"$";if(r==="&")return t[0];if(s!==void 0)return t.groups?.[s]??"";if(i!==void 0){const a=Number(i);if(a>=1&&a<t.length)return t[a]??"";if(i.length===2&&Number(i[0])>=1&&Number(i[0])<t.length)return(t[Number(i[0])]??"")+i[1]}return o})}function Ol(e,t){const n=t.regex?e:e.trim();if(!n)return null;try{return new RegExp(t.regex?n:n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),t.caseSensitive?"gm":"gim")}catch{return"bad"}}function dh(e){let t=null;const n=["fontFamily","fontSize","fontWeight","fontStyle","lineHeight","letterSpacing","wordSpacing","textIndent","textTransform","textAlign","tabSize","whiteSpace","overflowWrap","wordBreak","paddingTop","paddingRight","paddingBottom","paddingLeft","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","boxSizing","direction"],o=()=>{if(!t)return;const r=getComputedStyle(e);for(const s of n)t.style[s]=r[s];Object.assign(t.style,{position:"absolute",left:`${e.offsetLeft}px`,top:`${e.offsetTop}px`,width:`${e.offsetWidth}px`,height:`${e.offsetHeight}px`,margin:"0",borderStyle:"solid",borderColor:"transparent",overflow:"hidden",color:"transparent",background:"transparent",pointerEvents:"none",whiteSpace:"pre-wrap"}),t.firstChild?.nodeValue!==e.value&&(t.textContent=e.value),t.scrollTop=e.scrollTop};return{el:e,owns:r=>!!t&&t.contains(r),attach:()=>{t=document.createElement("div"),t.className="amx-find-mirror",t.setAttribute("aria-hidden","true"),e.parentElement?.insertBefore(t,e.nextSibling),o();const r=new ResizeObserver(o);return r.observe(e),e.addEventListener("input",o),e.addEventListener("scroll",o),()=>{r.disconnect(),e.removeEventListener("input",o),e.removeEventListener("scroll",o),t?.remove(),t=null}},replace:r=>{const s=e.value,i=r.map(({range:L,text:M})=>({from:L.startOffset,to:L.endOffset,text:M,was:L.toString()})).filter(L=>s.slice(L.from,L.to)===L.was).sort((L,M)=>L.from-M.from);if(!i.length)return 0;const a=i[0].from,c=i[i.length-1].to;let d="",m=a;for(const L of i)d+=s.slice(m,L.from)+L.text,m=L.to;d+=s.slice(m,c);const g=document.activeElement;return e.focus(),e.setSelectionRange(a,c),(d?document.execCommand("insertText",!1,d):document.execCommand("delete"))||(e.setRangeText(d,a,c,"end"),e.dispatchEvent(new Event("input",{bubbles:!0}))),g?.focus(),o(),i.length},focusAt:r=>t?.contains(r.startContainer)?(e.focus({preventScroll:!0}),e.setSelectionRange(r.startOffset,r.endOffset),!0):!1}}function fh(){const e=document.activeElement;return(e instanceof Element?e.closest(".wb-view, .mb-view, .fs-overlay"):null)??document.querySelector(".dv-active-group .wb-view")??document.querySelector(".wb-view--main")??document.querySelector(".mb-view")??document.body}function mh(){const e=document.activeElement;let t="";if(e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&/^(text|search)$/.test(e.type)){if(e.closest(".amx-findbar"))return null;t=e.value.slice(e.selectionStart??0,e.selectionEnd??0)}else t=window.getSelection()?.toString()??"";return t.trim()&&!/[\r\n]/.test(t)&&t.length<=200?t:null}let bs=null;function ph(){const e=document.activeElement;if(!(e instanceof HTMLElement)||e===document.body||e.closest(".amx-findbar")){bs=null;return}const t=window.getSelection(),n=t&&t.rangeCount?t.getRangeAt(0):null;bs={el:e,range:e.isContentEditable&&n&&e.contains(n.startContainer)?n.cloneRange():null}}function hh(e){const t=e.startContainer.parentElement;if(!t?.isContentEditable)return null;let n=t;for(;n.parentElement?.isContentEditable;)n=n.parentElement;return n}function gh(e){const t=bs;bs=null;const n=document.activeElement;if(!(n&&n!==document.body&&!n.closest(".amx-findbar"))){if(e){if(dc(e)?.focusAt?.(e))return;const r=hh(e);if(r){r.focus({preventScroll:!0});const s=window.getSelection();s?.removeAllRanges(),s?.addRange(e);return}}if(t?.el.isConnected&&(t.el.focus({preventScroll:!0}),t.range&&t.range.startContainer.isConnected)){const o=window.getSelection();o?.removeAllRanges(),o?.addRange(t.range)}}}function Qb(e={}){if(!Fl)return;const t=mh();if(St.getState().open){St.setState({...t?{query:t}:{},...e.replace?{replaceOpen:!0}:{}});const n=document.querySelector(".amx-findbar input");n?.focus(),n?.select();return}ph(),St.setState({open:!0,root:fh(),...t?{query:t}:{},...e.replace?{replaceOpen:!0}:{}})}function ga(e){const t=e==="keyboard"?qt[St.getState().active]??null:null;qt=[],ys=[],is(-1),St.setState({open:!1,query:"",active:0,total:0,root:null,bad:!1,replaceable:0}),e?gh(t):bs=null}const yh=/^(inline|contents|ruby)/;function xh(e,t){let n=e.parentElement;for(;n;){let o=t.get(n);if(o===void 0&&(o=yh.test(getComputedStyle(n).display),t.set(n,o)),!o)return n;n=n.parentElement}return null}function bh(e,t){if(ys=[],!t)return[];const n=new WeakMap,o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode(d){const m=d.parentElement;if(!m||!d.nodeValue||m.closest(".amx-findbar"))return NodeFilter.FILTER_REJECT;const g=m.tagName;return g==="SCRIPT"||g==="STYLE"||g==="NOSCRIPT"||g==="TEXTAREA"||!m.checkVisibility()?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});let r="";const s=[];let i=null;for(let d=o.nextNode();d;d=o.nextNode()){const m=d,g=xh(m,n);s.length&&g!==i&&(r+=`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./PdfAnnotator-CW0wPWRB.js","./index-BYUntVIZ.js","./pdf-C2_sJa3b.js","./pdf.worker.min-CGb3BKV9.js","./appStore-affnJoin.js","./nativeDownload-Udrv_tmU.js","./ipc-D7yENkjV.js","./client-BqhpYbYL.js","./appStore-ClD7vq5L.css","./PdfAnnotator-C_kglLCA.css"])))=>i.map(i=>d[i]);
2
+ import{r as gn,j as f,u as Zt,d as v,P as Cr,t as ke,bB as Du,bC as Lu,bD as Iu,bE as qs,b2 as Pu,a_ as bl,bF as Fu,b5 as Ou,bG as Zs,bH as _u,bI as Oc,bJ as Bu,bK as Ku,l as vl,bL as qu,bM as Or,bN as Hu,aG as Vu,aT as Wu,bO as Yu,bP as wl,n as Xu,bQ as Uu,m as hs,bR as Gu,bS as kl,aO as Cl,aS as Ju,bv as ia,J as Zu,ag as _c,V as Qu,_ as ed,bT as td,M as nd,bU as od,bV as rd,ab as sd,q as Sl,as as Bc,B as El,bW as Kc,bX as Hs,bY as qc,bZ as ad,b_ as Hc,ad as cd,b$ as hr,c0 as Vc,c1 as id,aw as ld,c2 as ud,ax as dd,c3 as fd,c4 as md}from"./index-BYUntVIZ.js";import{F as pd,c as Qs,d as hd,h as Ml,p as ks,e as ps,t as gd,f as yd,g as xd,i as bd,j as sc,l as zl,k as vd,m as Fa,n as wd,o as kd,q as Cd,r as Sd,v as la,w as ua,x as Ed,y as Vs,z as Oa,A as Md,B as Ws,C as zd,D as _a,E as Nl,G as Wc,H as Nd,I as $d,T as Ad,J as Td,K as jd,L as Rd,M as Dd,u as $l,N as Ld,O as Id,Q as Pd,R as Fd,S as Yc,U as Od,V as $s,W as _d,X as Bd,Y as Kd,Z as Al,_ as as,$ as qd,a0 as Hd,a1 as Vd,a2 as Wd,a3 as Yd,a4 as Xd,a5 as Ud,a6 as Gd,a7 as da,a8 as Jd,a9 as Zd,aa as Qd}from"./MarkdownBlock-BHpDy2qQ.js";import{G as Qt,ne as ef,at as tf,c6 as Tl,dm as bn,nf,cr as Kr,ng as Ht,ah as Ln,nh as Xc,ni as _o,nj as Ie,nk as Nr,nl as of,nm as rf,nn as sf,bq as jl,b as kn,fB as ac,no as Uc,j7 as af,ar as cf,aF as cc,np as lf,aK as ea,nq as uf,nr as df,ns as ff,nt as Tn,nu as Me,nv as zo,N as ic,I as mf,aN as Gc,lH as Sr,nw as Rl,cW as Ba,nx as Jc,ny as pf,gl as hf,nz as cr,nA as co,nB as gf,nC as yf,nD as xf,nE as bf,nF as Zc,nG as vf,fz as wf,fy as kf,nH as Cf,fj as Dl,nI as Qc,gm as Sf,nJ as Ef,lB as Mf,nK as Ll,nL as zf,nM as Nf,nN as $f,nO as Ka,nP as Af,nQ as ei,nR as Tf,nS as Ur,fV as qa,nT as ti,nU as As,d$ as jf,cP as Rf,kT as Df,kS as Lf,nV as sr,ai as Mr,P as If,nW as ni,nX as oi,g6 as ri,m7 as Pf,nY as Ff,nZ as Of,n_ as _f,n$ as Bf,o0 as si,mW as Kf,o1 as qf,o2 as ai,o3 as Hf,m6 as Vf,o4 as Wf,o5 as Yf,o6 as Xf,bK as Ha,eN as Uf,fA as Gf,o7 as Jf,fc as Zf,o8 as Qf,o9 as em,oa as tm,ob as nm,oc as om,od as rm,oe as sm,of as ci,og as am,oh as cm,oi as fa,oj as ii,ok as ma,dH as im,cL as lm,cq as um,iU as li,bV as dm,dF as fm,ol as ui,om as mm,on as pm,oo as di,op as hm,Z as gm,b6 as ym,oq as xm,or as bm,os as vm,ot as Lr,ou as xn,ov as wm,ow as km,ox as Va,fn as pa,oy as fi,m$ as Cm,i5 as Sm,oz as Em,oA as Mm}from"./appStore-affnJoin.js";import{c as zm}from"./client-BqhpYbYL.js";import{$ as Et,a as Il,b as lc}from"./index-Y2kzYlZq.js";import{N as Nm,S as $m,r as Am,a as Tm,C as jm,U as Rm,I as Dm}from"./pageChrome-D-9npbUE.js";import{h as Yr,l as Lm,f as Xr,a as mi,i as uc,b as _s,c as Im,d as gr,t as Ts,e as js,g as ha,s as Pm,j as Fm,k as Om}from"./listFold-CKxjyY5_.js";import{a as _m,b as Bm,c as pi,v as hi,i as Km}from"./linkFollow-Msu1XH9v.js";import{S as qm,b as Hm,a as Vm,F as Wm}from"./SketchCard-BcXCdBAs.js";import{A as gi}from"./arrow-up-right-R4P9Mmxz.js";import{c as Pl}from"./nativeDownload-Udrv_tmU.js";import{r as Gr,a as Ym,C as Xm}from"./Chrome-amTcZNE4.js";import{e as Um,h as Gm,a as yi,o as Jm,d as Zm,i as Qm,g as ep,j as tp,k as np,f as op,c as rp}from"./canvasPrefs-CSuX9aLF.js";import{H as sp}from"./hand-DRu7IJdU.js";import{T as ap,F as cp}from"./type-DmIL6FB-.js";import{M as ip}from"./minus-CfoZ4oxr.js";import{createFoldMemory as lp,remapFoldMemory as up}from"./foldActions-BcyvNVBs.js";import{L as dp}from"./lock-kffGfeHt.js";import{U as fp}from"./undo-2-yMeXc8Wi.js";import{C as mp}from"./code-xml-DdR58F83.js";import{M as pp}from"./message-square-plus-DxBPIhPS.js";const hp=[["path",{d:"M12 2v20",key:"t6zp3m"}],["path",{d:"M8 10H4a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h4",key:"14d6g8"}],["path",{d:"M16 10h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-4",key:"1e2lrw"}],["path",{d:"M8 20H7a2 2 0 0 1-2-2v-2c0-1.1.9-2 2-2h1",key:"1fkdwx"}],["path",{d:"M16 14h1a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-1",key:"1euafb"}]],gp=Qt("align-center-vertical",hp);const yp=[["rect",{width:"13",height:"7",x:"3",y:"3",rx:"1",key:"11xb64"}],["path",{d:"m22 15-3-3 3-3",key:"26chmm"}],["rect",{width:"13",height:"7",x:"3",y:"14",rx:"1",key:"k6ky7n"}]],xp=Qt("between-horizontal-end",yp);const bp=[["rect",{width:"13",height:"7",x:"8",y:"3",rx:"1",key:"pkso9a"}],["path",{d:"m2 9 3 3-3 3",key:"1agib5"}],["rect",{width:"13",height:"7",x:"8",y:"14",rx:"1",key:"1q5fc1"}]],vp=Qt("between-horizontal-start",bp);const wp=[["rect",{width:"7",height:"13",x:"3",y:"3",rx:"1",key:"1fdu0f"}],["path",{d:"m9 22 3-3 3 3",key:"17z65a"}],["rect",{width:"7",height:"13",x:"14",y:"3",rx:"1",key:"1squn4"}]],kp=Qt("between-vertical-end",wp);const Cp=[["rect",{width:"7",height:"13",x:"3",y:"8",rx:"1",key:"1fjrkv"}],["path",{d:"m15 2-3 3-3-3",key:"1uh6eb"}],["rect",{width:"7",height:"13",x:"14",y:"8",rx:"1",key:"w3fjg8"}]],Sp=Qt("between-vertical-start",Cp);const Ep=[["path",{d:"m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16",key:"d5nyq2"}],["path",{d:"M22 9v7",key:"pvm9v3"}],["path",{d:"M3.304 13h6.392",key:"1q3zxz"}],["circle",{cx:"18.5",cy:"12.5",r:"3.5",key:"z97x68"}]],Mp=Qt("case-sensitive",Ep);const zp=[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]],Np=Qt("chevrons-down",zp);const $p=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]],Ap=Qt("heading-1",$p);const Tp=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]],jp=Qt("heading-2",Tp);const Rp=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]],Dp=Qt("heading-3",Rp);const Lp=[["path",{d:"M10 5h11",key:"1hkqpe"}],["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 19h11",key:"14g2nv"}],["path",{d:"m3 10 3-3-3-3",key:"i7pm08"}],["path",{d:"m3 20 3-3-3-3",key:"20gx1n"}]],Ip=Qt("list-collapse",Lp);const Pp=[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]],Fp=Qt("list-ordered",Pp);const Op=[["path",{d:"m18 8 4 4-4 4",key:"1ak13k"}],["path",{d:"M2 12h20",key:"9i4pu4"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}]],_p=Qt("move-horizontal",Op);const Bp=[["path",{d:"M18 8L22 12L18 16",key:"1r0oui"}],["path",{d:"M2 12H22",key:"1m8cig"}]],Kp=Qt("move-right",Bp);const qp=[["path",{d:"M6 8L2 12L6 16",key:"kyvwex"}],["path",{d:"M2 12H22",key:"1m8cig"}]],Hp=Qt("move-left",qp);const Vp=[["path",{d:"M13 4v16",key:"8vvj80"}],["path",{d:"M17 4v16",key:"7dpous"}],["path",{d:"M19 4H9.5a4.5 4.5 0 0 0 0 9H13",key:"sh4n9v"}]],xi=Qt("pilcrow",Vp);const Wp=[["path",{d:"M17 3v10",key:"15fgeh"}],["path",{d:"m12.67 5.5 8.66 5",key:"1gpheq"}],["path",{d:"m12.67 10.5 8.66-5",key:"1dkfa6"}],["path",{d:"M9 17a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2v-2z",key:"swwfx4"}]],Yp=Qt("regex",Wp);const Xp=[["path",{d:"M14 14a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1",key:"zg1ipl"}],["path",{d:"M14 4a1 1 0 0 1 1-1",key:"dhj8ez"}],["path",{d:"M15 10a1 1 0 0 1-1-1",key:"1mnyi5"}],["path",{d:"M19 14a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1",key:"txt6k4"}],["path",{d:"M21 4a1 1 0 0 0-1-1",key:"sfs9ap"}],["path",{d:"M21 9a1 1 0 0 1-1 1",key:"mp6qeo"}],["path",{d:"m3 7 3 3 3-3",key:"x25e72"}],["path",{d:"M6 10V5a2 2 0 0 1 2-2h2",key:"15xut4"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}]],Up=Qt("replace-all",Xp);const Gp=[["path",{d:"M14 4a1 1 0 0 1 1-1",key:"dhj8ez"}],["path",{d:"M15 10a1 1 0 0 1-1-1",key:"1mnyi5"}],["path",{d:"M21 4a1 1 0 0 0-1-1",key:"sfs9ap"}],["path",{d:"M21 9a1 1 0 0 1-1 1",key:"mp6qeo"}],["path",{d:"m3 7 3 3 3-3",key:"x25e72"}],["path",{d:"M6 10V5a2 2 0 0 1 2-2h2",key:"15xut4"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}]],Jp=Qt("replace",Gp);const Zp=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 12h18",key:"1i2n21"}]],Qp=Qt("rows-2",Zp);const eh=[["circle",{cx:"19",cy:"5",r:"2",key:"mhkx31"}],["circle",{cx:"5",cy:"19",r:"2",key:"v8kfzx"}],["path",{d:"M5 17A12 12 0 0 1 17 5",key:"1okkup"}]],th=Qt("spline",eh);const nh=[["path",{d:"M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z",key:"1dfntj"}],["path",{d:"M15 3v5a1 1 0 0 0 1 1h5",key:"6s6qgf"}]],Wa=Qt("sticky-note",nh);const oh=[["path",{d:"M17 5H3",key:"1cn7zz"}],["path",{d:"M21 12H8",key:"scolzb"}],["path",{d:"M21 19H8",key:"13qgcb"}],["path",{d:"M3 12v7",key:"1ri8j3"}]],rh=Qt("text-quote",oh);function sh(e,t){const n=e.trim().toLowerCase(),o=t.toLowerCase();if(!n)return 1;let r=0,s=0,i=-2,a=-1;for(let c=0;c<o.length&&s<n.length;c++)if(o[c]===n[s]){a<0&&(a=c);let d=1;c===i+1&&(d+=4),(c===0||/[\s/\-_.]/.test(o[c-1]))&&(d+=3),r+=d,i=c,s++}return s<n.length?null:(r-=a*.1,r-=o.length*.02,o===n&&(r+=10),r)}function ah(e,t,n){if(!e.trim())return t;const o=[];for(const r of t){const s=sh(e,n(r));s!=null&&o.push({item:r,score:s})}return o.sort((r,s)=>s.score-r.score),o.map(r=>r.item)}gn({"delassets.blockTitle":{zh:"引用块已删除",en:"Reference block deleted"},"delassets.noteTitle":{zh:"删除「{name}」",en:'Delete "{name}"'},"delassets.blockMsg":{zh:"这 {n} 个文件只被这条笔记引用,要一并从磁盘删除吗?",en:"These {n} files are only referenced by this note. Delete them from disk too?"},"delassets.noteMsg":{zh:"有 {n} 个附件只被这条笔记引用,要一并删除吗?",en:"{n} attachments are only referenced by this note. Delete them too?"},"delassets.more":{zh:"…还有 {n} 个",en:"…and {n} more"},"delassets.remember":{zh:"下次不再问(设置→笔记可改回)",en:"Don't ask again (change it back in Settings → Notes)"},"delassets.keepFiles":{zh:"保留文件",en:"Keep files"},"delassets.cancel":{zh:"取消",en:"Cancel"},"delassets.noteOnly":{zh:"只删笔记",en:"Delete note only"},"delassets.deleteAll":{zh:"一并删除",en:"Delete them too"}});const Ya="amadeus_delete_assets";function Gb(){try{const e=localStorage.getItem(Ya);return e==="yes"?!0:e==="no"?!1:null}catch{return null}}function ch(e){try{e===null?localStorage.removeItem(Ya):localStorage.setItem(Ya,e?"yes":"no")}catch{}}const gs=Pl(e=>({req:null,open:t=>e({req:t}),clear:()=>e({req:null})}));function ih(e,t,n){return new Promise(o=>{gs.getState().req?.resolve(null),gs.getState().open({note:e,assets:t,block:n?.block,resolve:o})})}function Jb(){const e=gs(t=>t.req);return e?f.jsx("div",{className:"am-app tangu-lovable",style:{display:"contents"},children:f.jsx(lh,{req:e},e.note)}):null}function lh({req:e}){const{t}=Zt(),[n,o]=v.useState(!1),r=i=>{gs.getState().req===e&&(n&&i!==null&&ch(i==="with"),gs.getState().clear(),e.resolve(i))};ef(()=>r(null));const s=e.assets.slice(0,6);return f.jsx("div",{className:"dialog-overlay",onMouseDown:()=>r(null),children:f.jsxs("div",{className:"dialog",onMouseDown:i=>i.stopPropagation(),children:[f.jsx("div",{className:"dialog-title",children:e.block?t("delassets.blockTitle"):t("delassets.noteTitle",{name:e.note})}),f.jsxs("div",{className:"dialog-msg",children:[e.block?t("delassets.blockMsg",{n:e.assets.length}):t("delassets.noteMsg",{n:e.assets.length}),f.jsxs("ul",{style:{margin:"6px 0 0",paddingLeft:18,opacity:.8},children:[s.map(i=>f.jsx("li",{children:i},i)),e.assets.length>s.length&&f.jsx("li",{children:t("delassets.more",{n:e.assets.length-s.length})})]})]}),!e.block&&f.jsxs("label",{className:"inline-check",style:{display:"flex",gap:6,alignItems:"center",marginTop:10},children:[f.jsx("input",{type:"checkbox",checked:n,onChange:i=>o(i.target.checked)}),t("delassets.remember")]}),f.jsxs("div",{className:"dialog-actions",children:[e.block?f.jsx("button",{className:"dialog-btn",autoFocus:!0,onClick:()=>r("only"),children:t("delassets.keepFiles")}):f.jsxs(f.Fragment,{children:[f.jsx("button",{className:"dialog-btn",onClick:()=>r(null),children:t("delassets.cancel")}),f.jsx("button",{className:"dialog-btn",onClick:()=>r("only"),children:t("delassets.noteOnly")})]}),f.jsx("button",{className:"dialog-btn","data-danger":!0,autoFocus:!e.block,onClick:()=>r("with"),children:t("delassets.deleteAll")})]})]})})}gn({"settings.notes.aiSpaceLabel":{zh:"空行按空格唤起 AI",en:"Press Space on an empty line for AI"},"settings.notes.aiSpaceHint":{zh:"在空的段落里按空格打开 AI 写作面板;输入法组字中的空格不受影响。仅本机生效",en:"Space on an empty paragraph opens the AI writing panel. Spaces typed with an input method are not affected. This device only"}});const Xa="forsion.amadeus.aiSpaceTrigger";let cs=null;function uh(){if(cs===null)try{cs=localStorage.getItem(Xa)==="1"}catch{cs=!1}return cs}function Zb(e){cs=e;try{e?localStorage.setItem(Xa,"1"):localStorage.removeItem(Xa)}catch{}}gn({"find.placeholder":{zh:"在本页查找…",en:"Find in page…"},"find.prev":{zh:"上一个(Shift+Enter)",en:"Previous (Shift+Enter)"},"find.next":{zh:"下一个(Enter)",en:"Next (Enter)"},"find.close":{zh:"关闭(Esc)",en:"Close (Esc)"},"find.case":{zh:"区分大小写",en:"Match case"},"find.regex":{zh:"使用正则表达式",en:"Use regular expression"},"find.toggleReplace":{zh:"切换替换(⌘⌥F / Ctrl+Alt+F)",en:"Toggle replace (⌘⌥F / Ctrl+Alt+F)"},"find.replacePlaceholder":{zh:"替换为…",en:"Replace with…"},"find.replaceOne":{zh:"替换(Enter)",en:"Replace (Enter)"},"find.replaceAll":{zh:"全部替换(⌘/Ctrl+Enter)",en:"Replace all (⌘/Ctrl+Enter)"},"find.badRegex":{zh:"正则表达式无效",en:"Invalid regular expression"}});const Fl=typeof CSS<"u"&&"highlights"in CSS;let qt=[],ys=[];const St=Pl(()=>({open:!1,query:"",active:0,total:0,root:null,caseSensitive:!1,regex:!1,bad:!1,replaceOpen:!1,replacement:"",replaceable:0,providerVer:0})),xs=new Set,bi=()=>St.setState(e=>({providerVer:e.providerVer+1}));function vi(e){return xs.add(e),bi(),()=>{xs.delete(e),bi()}}function dc(e){const t=e.startContainer;for(const n of xs)if(n.el.isConnected&&(n.owns?n.owns(t):n.el.contains(t)))return n;return null}function wi(e,t,n){return!n||!t?e:e.replace(/\$(\$|&|<([^>]*)>|(\d{1,2}))/g,(o,r,s,i)=>{if(r==="$")return"$";if(r==="&")return t[0];if(s!==void 0)return t.groups?.[s]??"";if(i!==void 0){const a=Number(i);if(a>=1&&a<t.length)return t[a]??"";if(i.length===2&&Number(i[0])>=1&&Number(i[0])<t.length)return(t[Number(i[0])]??"")+i[1]}return o})}function Ol(e,t){const n=t.regex?e:e.trim();if(!n)return null;try{return new RegExp(t.regex?n:n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),t.caseSensitive?"gm":"gim")}catch{return"bad"}}function dh(e){let t=null;const n=["fontFamily","fontSize","fontWeight","fontStyle","lineHeight","letterSpacing","wordSpacing","textIndent","textTransform","textAlign","tabSize","whiteSpace","overflowWrap","wordBreak","paddingTop","paddingRight","paddingBottom","paddingLeft","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","boxSizing","direction"],o=()=>{if(!t)return;const r=getComputedStyle(e);for(const s of n)t.style[s]=r[s];Object.assign(t.style,{position:"absolute",left:`${e.offsetLeft}px`,top:`${e.offsetTop}px`,width:`${e.offsetWidth}px`,height:`${e.offsetHeight}px`,margin:"0",borderStyle:"solid",borderColor:"transparent",overflow:"hidden",color:"transparent",background:"transparent",pointerEvents:"none",whiteSpace:"pre-wrap"}),t.firstChild?.nodeValue!==e.value&&(t.textContent=e.value),t.scrollTop=e.scrollTop};return{el:e,owns:r=>!!t&&t.contains(r),attach:()=>{t=document.createElement("div"),t.className="amx-find-mirror",t.setAttribute("aria-hidden","true"),e.parentElement?.insertBefore(t,e.nextSibling),o();const r=new ResizeObserver(o);return r.observe(e),e.addEventListener("input",o),e.addEventListener("scroll",o),()=>{r.disconnect(),e.removeEventListener("input",o),e.removeEventListener("scroll",o),t?.remove(),t=null}},replace:r=>{const s=e.value,i=r.map(({range:L,text:M})=>({from:L.startOffset,to:L.endOffset,text:M,was:L.toString()})).filter(L=>s.slice(L.from,L.to)===L.was).sort((L,M)=>L.from-M.from);if(!i.length)return 0;const a=i[0].from,c=i[i.length-1].to;let d="",m=a;for(const L of i)d+=s.slice(m,L.from)+L.text,m=L.to;d+=s.slice(m,c);const g=document.activeElement;return e.focus(),e.setSelectionRange(a,c),(d?document.execCommand("insertText",!1,d):document.execCommand("delete"))||(e.setRangeText(d,a,c,"end"),e.dispatchEvent(new Event("input",{bubbles:!0}))),g?.focus(),o(),i.length},focusAt:r=>t?.contains(r.startContainer)?(e.focus({preventScroll:!0}),e.setSelectionRange(r.startOffset,r.endOffset),!0):!1}}function fh(){const e=document.activeElement;return(e instanceof Element?e.closest(".wb-view, .mb-view, .fs-overlay"):null)??document.querySelector(".dv-active-group .wb-view")??document.querySelector(".wb-view--main")??document.querySelector(".mb-view")??document.body}function mh(){const e=document.activeElement;let t="";if(e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&/^(text|search)$/.test(e.type)){if(e.closest(".amx-findbar"))return null;t=e.value.slice(e.selectionStart??0,e.selectionEnd??0)}else t=window.getSelection()?.toString()??"";return t.trim()&&!/[\r\n]/.test(t)&&t.length<=200?t:null}let bs=null;function ph(){const e=document.activeElement;if(!(e instanceof HTMLElement)||e===document.body||e.closest(".amx-findbar")){bs=null;return}const t=window.getSelection(),n=t&&t.rangeCount?t.getRangeAt(0):null;bs={el:e,range:e.isContentEditable&&n&&e.contains(n.startContainer)?n.cloneRange():null}}function hh(e){const t=e.startContainer.parentElement;if(!t?.isContentEditable)return null;let n=t;for(;n.parentElement?.isContentEditable;)n=n.parentElement;return n}function gh(e){const t=bs;bs=null;const n=document.activeElement;if(!(n&&n!==document.body&&!n.closest(".amx-findbar"))){if(e){if(dc(e)?.focusAt?.(e))return;const r=hh(e);if(r){r.focus({preventScroll:!0});const s=window.getSelection();s?.removeAllRanges(),s?.addRange(e);return}}if(t?.el.isConnected&&(t.el.focus({preventScroll:!0}),t.range&&t.range.startContainer.isConnected)){const o=window.getSelection();o?.removeAllRanges(),o?.addRange(t.range)}}}function Qb(e={}){if(!Fl)return;const t=mh();if(St.getState().open){St.setState({...t?{query:t}:{},...e.replace?{replaceOpen:!0}:{}});const n=document.querySelector(".amx-findbar input");n?.focus(),n?.select();return}ph(),St.setState({open:!0,root:fh(),...t?{query:t}:{},...e.replace?{replaceOpen:!0}:{}})}function ga(e){const t=e==="keyboard"?qt[St.getState().active]??null:null;qt=[],ys=[],is(-1),St.setState({open:!1,query:"",active:0,total:0,root:null,bad:!1,replaceable:0}),e?gh(t):bs=null}const yh=/^(inline|contents|ruby)/;function xh(e,t){let n=e.parentElement;for(;n;){let o=t.get(n);if(o===void 0&&(o=yh.test(getComputedStyle(n).display),t.set(n,o)),!o)return n;n=n.parentElement}return null}function bh(e,t){if(ys=[],!t)return[];const n=new WeakMap,o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode(d){const m=d.parentElement;if(!m||!d.nodeValue||m.closest(".amx-findbar"))return NodeFilter.FILTER_REJECT;const g=m.tagName;return g==="SCRIPT"||g==="STYLE"||g==="NOSCRIPT"||g==="TEXTAREA"||!m.checkVisibility()?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});let r="";const s=[];let i=null;for(let d=o.nextNode();d;d=o.nextNode()){const m=d,g=xh(m,n);s.length&&g!==i&&(r+=`
3
3
  `),i=g,s.push({node:m,at:r.length}),r+=m.nodeValue??""}const a=[];let c=0;t.lastIndex=0;for(let d=t.exec(r);d;d=t.exec(r)){if(!d[0]){t.lastIndex++;continue}if(d[0].includes(`
4
4
  `))continue;const m=d.index,g=m+d[0].length;for(;c>0&&s[c].at>m;)c--;for(;c+1<s.length&&s[c+1].at<=m;)c++;let C=c;for(;C+1<s.length&&s[C+1].at<g;)C++;const L=document.createRange();L.setStart(s[c].node,m-s[c].at),L.setEnd(s[C].node,Math.min(g-s[C].at,s[C].node.length)),a.push(L),ys.push(d)}return a}function ya(e){const t=St.getState(),n=Ol(t.query,t);return qt=bh(e,n==="bad"?null:n),St.setState({bad:n==="bad",replaceable:qt.filter(o=>dc(o)).length}),qt.length}function is(e){if(!Fl)return;const t=CSS.highlights;if(!qt.length){t.delete("amx-find"),t.delete("amx-find-active");return}t.set("amx-find",new Highlight(...qt));const n=qt[e],o=n?new Highlight(n):new Highlight;o.priority=1,t.set("amx-find-active",o)}function vh(e){for(let t=e;t&&t!==document.body;t=t.parentElement){if(!(t instanceof HTMLElement))continue;const n=getComputedStyle(t),o=/auto|scroll/.test(n.overflowY)&&t.scrollHeight>t.clientHeight+1,r=/auto|scroll/.test(n.overflowX)&&t.scrollWidth>t.clientWidth+1;if(o||r)return t}return null}function xa(e){const t=e.getBoundingClientRect();if(!t.width&&!t.height)return;const n=e.startContainer.parentElement;if(!n||!n.dispatchEvent(new CustomEvent("amx-reveal",{bubbles:!0,cancelable:!0,detail:{rect:t}})))return;const r=vh(n);if(!r)return;const s=r.getBoundingClientRect(),i=r.currentCSSZoom||1;(t.bottom>s.bottom||t.top<s.top)&&(r.scrollTop+=(t.top+t.height/2-(s.top+s.height/2))/i),(t.right>s.right||t.left<s.left)&&(r.scrollLeft+=(t.left+t.width/2-(s.left+s.width/2))/i)}function ev(){return St(t=>t.open)?f.jsx(wh,{}):null}function wh(){const{t:e}=Zt(),t=St(H=>H.query),n=St(H=>H.active),o=St(H=>H.total),r=St(H=>H.root),s=St(H=>H.caseSensitive),i=St(H=>H.regex),a=St(H=>H.bad),c=St(H=>H.replaceOpen),d=St(H=>H.replacement),m=St(H=>H.replaceable),g=St(H=>H.providerVer),[C,L]=v.useState({top:12,right:12}),M=v.useRef(null),k=!!r&&[...xs].some(H=>H.el.isConnected&&r.contains(H.el));v.useLayoutEffect(()=>{const H=()=>{const ne=r?.getBoundingClientRect();ne&&L({top:ne.top+8,right:Math.max(8,window.innerWidth-ne.right+8)})};return H(),window.addEventListener("resize",H),()=>window.removeEventListener("resize",H)},[r]),v.useLayoutEffect(()=>{if(!r)return;const H=[...xs].filter(ne=>ne.attach&&r.contains(ne.el)).map(ne=>ne.attach());return()=>H.forEach(ne=>ne())},[r,g]),v.useEffect(()=>{r&&(ya(r),St.setState({total:qt.length,active:0}),is(0),qt.length&&xa(qt[0]))},[r,t,s,i,g]),v.useEffect(()=>{if(!r)return;const H=()=>{r.isConnected||ga()};window.addEventListener("focusin",H);const ne=window.setInterval(H,1e3);return()=>{window.removeEventListener("focusin",H),window.clearInterval(ne)}},[r]),v.useEffect(()=>{if(!r||!t.trim())return;let H=0;const ne=new MutationObserver(()=>{window.clearTimeout(H),H=window.setTimeout(()=>{ya(r);const je=Math.min(St.getState().active,Math.max(0,qt.length-1));St.setState({total:qt.length,active:je}),is(je)},150)});return ne.observe(r,{childList:!0,subtree:!0,characterData:!0}),()=>{window.clearTimeout(H),ne.disconnect()}},[r,t,s,i]);const z=H=>{if(!qt.length)return;const ne=(St.getState().active+H+qt.length)%qt.length;St.setState({active:ne}),is(ne),xa(qt[ne])},F=H=>{if(!r||!qt.length)return;const ne=St.getState(),je=H?qt.map((be,me)=>me):[ne.active],He=new Map;for(const be of je){const me=dc(qt[be]);if(!me)continue;const Ee=He.get(me)??[];Ee.push({range:qt[be],text:wi(ne.replacement,ys[be],ne.regex)}),He.set(me,Ee)}let p=0;for(const[be,me]of He)p+=be.replace(me);if(!p&&!H){z(1);return}const fe=ne.active,rt=H?"":wi(ne.replacement,ys[ne.active],ne.regex);ya(r);let ie=0;if(!H&&qt.length){const be=Ol(ne.query,ne),me=be&&be!=="bad"?(rt.match(new RegExp(be.source,be.flags))??[]).length:0;ie=(fe+me)%qt.length}St.setState({total:qt.length,active:ie}),is(ie),qt.length&&xa(qt[ie])},J=H=>H.key==="Escape"?(ga("keyboard"),!0):(H.metaKey||H.ctrlKey)&&H.altKey&&H.code==="KeyF"?(H.preventDefault(),k&&St.setState({replaceOpen:!St.getState().replaceOpen}),!0):!1,se=H=>{St.setState({[H]:!St.getState()[H]}),M.current?.focus()};return f.jsxs("div",{className:`amx-findbar${c&&k?" amx-findbar--replace":""}`,style:{top:C.top,right:C.right},children:[k&&f.jsx("button",{className:"amx-findbar-expand",onClick:()=>St.setState({replaceOpen:!c}),title:e("find.toggleReplace"),"aria-label":e("find.toggleReplace"),"aria-expanded":c,children:c?f.jsx(tf,{size:14}):f.jsx(Tl,{size:14})}),f.jsxs("div",{className:"amx-findbar-rows",children:[f.jsxs("div",{className:"amx-findbar-row",children:[f.jsx("input",{ref:M,autoFocus:!0,placeholder:e("find.placeholder"),value:t,"aria-invalid":a||void 0,title:a?e("find.badRegex"):void 0,onFocus:H=>H.currentTarget.select(),onChange:H=>St.setState({query:H.target.value}),onKeyDown:H=>{!J(H)&&H.key==="Enter"&&z(H.shiftKey?-1:1),H.stopPropagation()}}),f.jsx("button",{className:"amx-findbar-opt",onClick:()=>se("caseSensitive"),"aria-pressed":s,title:e("find.case"),"aria-label":e("find.case"),children:f.jsx(Mp,{size:15})}),f.jsx("button",{className:"amx-findbar-opt",onClick:()=>se("regex"),"aria-pressed":i,title:e("find.regex"),"aria-label":e("find.regex"),children:f.jsx(Yp,{size:14})}),f.jsx("span",{className:"amx-findbar-count",children:o?`${n+1}/${o}`:t.trim()?"0":""}),f.jsx("button",{onClick:()=>z(-1),title:e("find.prev"),"aria-label":e("find.prev"),children:"‹"}),f.jsx("button",{onClick:()=>z(1),title:e("find.next"),"aria-label":e("find.next"),children:"›"}),f.jsx("button",{onClick:()=>ga("pointer"),title:e("find.close"),"aria-label":e("find.close"),children:"✕"})]}),c&&k&&f.jsxs("div",{className:"amx-findbar-row",children:[f.jsx("input",{className:"amx-findbar-replace",placeholder:e("find.replacePlaceholder"),value:d,onChange:H=>St.setState({replacement:H.target.value}),onKeyDown:H=>{!J(H)&&H.key==="Enter"&&F(H.metaKey||H.ctrlKey),H.stopPropagation()}}),f.jsx("button",{className:"amx-findbar-act",onClick:()=>F(!1),disabled:!m,title:e("find.replaceOne"),"aria-label":e("find.replaceOne"),children:f.jsx(Jp,{size:14})}),f.jsx("button",{className:"amx-findbar-act",onClick:()=>F(!0),disabled:!m,title:e("find.replaceAll"),"aria-label":e("find.replaceAll"),children:f.jsx(Up,{size:14})})]})]})]})}gn({"unisave.conflict.toast":{zh:"「{name}」在你编辑时被别处改过。已保留你的版本,被覆盖的那一版另存为「{copy}」。",en:'"{name}" was changed elsewhere while you were editing. Your version was kept, and the overwritten version was saved as "{copy}".'},"unisave.conflict.agentToast":{zh:"Tangu 在你编辑时改了「{name}」。已保留你的版本,Tangu 的改动另存为「{copy}」。",en:'Tangu changed "{name}" while you were editing. Your version was kept, and Tangu’s changes were saved as "{copy}".'},"unisave.conflict.open":{zh:"打开副本",en:"Open copy"},"unisave.failed.toast":{zh:"「{name}」没能保存({reason}),正在自动重试。保存成功之前请不要关闭它。",en:'Couldn’t save "{name}" ({reason}). Retrying automatically — keep it open until it’s saved.'},"unisave.failed.unknown":{zh:"未知原因",en:"unknown reason"},"unisave.failed.bar":{zh:"未保存:写入失败,正在自动重试",en:"Unsaved: the write failed and is being retried"},"unisave.failed.retry":{zh:"立即重试",en:"Retry now"},"unisave.draft.bar":{zh:"这篇笔记有一份上次没保存成功的草稿({time})。",en:"This note has a draft that wasn’t saved last time ({time})."},"unisave.draft.hint":{zh:"恢复后会覆盖盘上当前内容;盘上那一版若是别处改过的,会先另存为冲突副本。",en:"Restoring replaces what’s on disk now. If that version was changed elsewhere, it is saved as a conflict copy first."},"unisave.draft.restore":{zh:"恢复草稿",en:"Restore draft"},"unisave.draft.discard":{zh:"丢弃",en:"Discard"},"unisave.gone.toast":{zh:"「{name}」已在别处被删除或移走,最后的改动没来得及保存,另存副本也没写成。可以把这篇的内容复制下来。",en:'"{name}" was deleted or moved elsewhere before your last changes were saved, and a backup copy couldn’t be written. You can copy its text.'},"unisave.renameCopy.toast":{zh:"「{name}」改名时已被别处改过,没有覆盖它。你改名期间打的字另存为「{copy}」。",en:'"{name}" was changed elsewhere while it was being renamed, so it wasn’t overwritten. What you typed during the rename was saved as "{copy}".'},"unisave.rescued.toast":{zh:"「{name}」已在别处被删除或移走。你还没保存的内容另存为「{copy}」。",en:'"{name}" was deleted or moved elsewhere. Your unsaved changes were saved as "{copy}".'},"unisave.gone.copy":{zh:"复制内容",en:"Copy text"},"unisave.gone.copied":{zh:"已复制到剪贴板",en:"Copied to clipboard"}});function ir(e){typeof window>"u"||window.dispatchEvent(new CustomEvent("amadeus:toast",{detail:e}))}const lr=e=>(e.split("/").pop()??e).replace(/\.md$/i,"");let ki=Promise.resolve();function ba(e,t,n=new Date){const o=ki.then(()=>Ci(e,t,n),()=>Ci(e,t,n));return ki=o.catch(()=>{}),o}async function Ci(e,t,n){const o=Du(e,n);for(let r=1;r<=50;r++){const s=Lu(o,r),i=await bn.readTextFile(s);if(i===t)return s;if(i!=null)continue;const a=await bn.writeTextFile(s,t,{create:!0});if(a&&a.ok===!1){if(a.current===t)return s;if(a.current!=null)continue;throw new Error("The conflict copy could not be created")}return s}throw new Error("Too many conflict copies in one minute")}function kh(e,t,n=!1){ir({level:"error",dedupeKey:`amx-conflict:${e}`,text:ke(n?"unisave.conflict.agentToast":"unisave.conflict.toast",{name:lr(e),copy:lr(t)}),action:{label:ke("unisave.conflict.open"),run:()=>{window.dispatchEvent(new CustomEvent("amadeus:navigate-note",{detail:{path:t},cancelable:!0}))}}})}function _l(e){const n=(e instanceof Error?e.message:typeof e=="string"?e:"").replace(/^Error invoking remote method '[^']*':\s*/,"").replace(/^(?:[A-Za-z]*Error:\s*)+/,"").trim();return n?n.length>80?`${n.slice(0,79)}…`:n:ke("unisave.failed.unknown")}function va(e,t){ir({level:"warning",dedupeKey:`amx-savefail:${e}`,text:ke("unisave.failed.toast",{name:lr(e),reason:_l(t)})})}function Ch(e,t){ir({level:"error",dedupeKey:`amx-rescued:${t}`,text:ke("unisave.rescued.toast",{name:lr(e),copy:lr(t)}),action:{label:ke("unisave.conflict.open"),run:()=>{window.dispatchEvent(new CustomEvent("amadeus:navigate-note",{detail:{path:t},cancelable:!0}))}}})}function Sh(e,t){ir({level:"error",dedupeKey:`amx-renamecopy:${t}`,text:ke("unisave.renameCopy.toast",{name:lr(e),copy:lr(t)}),action:{label:ke("unisave.conflict.open"),run:()=>{window.dispatchEvent(new CustomEvent("amadeus:navigate-note",{detail:{path:t},cancelable:!0}))}}})}function Eh(e,t){ir({level:"error",dedupeKey:`amx-gone:${e}:${Cr(t)}`,text:ke("unisave.gone.toast",{name:lr(e)}),action:{label:ke("unisave.gone.copy"),run:()=>{navigator.clipboard?.writeText(t).then(()=>ir({text:ke("unisave.gone.copied")}),()=>{})}}})}const Si=[2e3,5e3,1e4,3e4,6e4],Bl=(e,t)=>`amadeus.unsavedDraft:${e??""}:${t}`,Ys=(e,t,n)=>Bl(e,t)+(n?`\0${n}`:"");function Po(e,t,n,o,r){try{const s={text:n,base:Cr(o),at:Date.now()};localStorage.setItem(Ys(e,t,r),JSON.stringify(s))}catch{}}function ls(e,t){if(!e)return null;const n=JSON.parse(e);return typeof n.text=="string"&&typeof n.base=="string"?{text:n.text,base:n.base,at:Number(n.at)||0,slot:t}:null}function Mh(e,t,n,o=()=>!0){try{const r=Ys(e,t);if(n){const a=ls(localStorage.getItem(Ys(e,t,n)),n);if(a)return a;const c=o(null)?null:ls(localStorage.getItem(r),null);if(c)return c}else{const a=ls(localStorage.getItem(r),null);if(a)return a}const s=Bl(e,t)+"\0";let i=null;for(let a=0;a<localStorage.length;a++){const c=localStorage.key(a);if(!c||!c.startsWith(s))continue;const d=c.slice(s.length);if(d===n||o(d))continue;const m=ls(localStorage.getItem(c),d);m&&(!i||m.at>i.at)&&(i=m)}return i}catch{return null}}function Jr(e,t,n,o){try{const r=Ys(e,t,o);if(n!=null){const s=ls(localStorage.getItem(r),o??null);if(!s||s.text!==n)return}localStorage.removeItem(r)}catch{}}function zh(){return typeof navigator<"u"&&/\bElectron\//.test(navigator.userAgent)}function br(e){const t=Iu(e);return t.length===e.length&&e.startsWith(qs)?{fmText:qs,body:e.slice(1)}:{fmText:e.slice(0,e.length-t.length),body:t}}function $n(e,t){return e+t}function wa(e,t){const n=ws(e);return n.trim()&&!Nh(n)?e:br(Fu(e,t)).fmText}function Nh(e){try{const t=Zs(e);return t==null||typeof t=="object"&&!Array.isArray(t)}catch{return!1}}function $h(e,t){const n=Ah(e,t);if(n!==null)return Ga(e,n);const{bom:o}=vs(e),r=Ja(e),s=t.replace(/\n+$/,"");if(!r.length&&!s.trim())return o;const i=o+["---",...r,...s.trim()?[s]:[],"---",""].join(`
5
5
  `);return Ua(s)?Ga(e,i):i}function Ah(e,t){const n=ws(e),o=t.replace(/(?:\r?\n)+$/,"");if(!n||!o.trim())return null;if(o===n)return e;const r=e.indexOf(n),s=r+n.length;if(r<=0||e[r-1]!==`
@@ -34,7 +34,7 @@ import{r as gn,j as f,u as Zt,d as v,P as Cr,t as ke,bB as Du,bC as Lu,bD as Iu,
34
34
 
35
35
  `).slice(0,12e3)}function ru(e,t){return e.trim()?`Page maintenance instructions for ${JSON.stringify(t)} (apply only when working on this page; the current user request takes precedence; do not grant permissions or inherit into other pages):
36
36
  ${e.slice(0,12e3)}
37
- End of page maintenance instructions.`:""}gn({"uembed.openInTab":{zh:"在 Forsion 标签页中打开",en:"Open in a Forsion tab"},"uembed.openWithSystem":{zh:"用系统默认程序打开",en:"Open with the system default app"},"uembed.openPdfInTab":{zh:"在 Forsion 标签页中打开",en:"Open in a Forsion tab"},"uembed.open":{zh:"打开 ↗",en:"Open ↗"},"uembed.startAt":{zh:"起播时刻",en:"Start time"},"uembed.badAnchor":{zh:"锚点无效 · 从 0 秒起播",en:"Invalid anchor · playing from 0:00"},"uembed.badAnchorTip":{zh:"只认 #t=95 / #t=01:35 / #t=1:02:30(MM 与 SS 须两位)",en:"Only #t=95 / #t=01:35 / #t=1:02:30 are recognized (MM and SS must be two digits)"},"uembed.collapse":{zh:"收起",en:"Collapse"},"uembed.expand":{zh:"展开",en:"Expand"},"uembed.loadingPdf":{zh:"加载 PDF…",en:"Loading PDF…"},"uembed.crossNote":{zh:"跨笔记嵌入(只读)",en:"Cross-note embed (read-only)"},"uembed.badge":{zh:"↪ 嵌入",en:"↪ Embed"},"uembed.editAtSource":{zh:"去源头编辑",en:"Edit at the source"},"uembed.resolving":{zh:"解析中…",en:"Resolving…"},"uembed.embedMissing":{zh:"嵌入丢失:",en:"Embed missing: "},"uembed.create":{zh:"创建",en:"Create"},"uembed.createTip":{zh:"新建笔记「{name}」",en:"Create the note “{name}”"}});function su(){const[,e]=v.useState(0);return v.useEffect(()=>El(()=>e(t=>t+1)),[]),ke}const Zg=hf(()=>ed(()=>import("./PdfAnnotator-CyAw8sgq.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url).then(e=>({default:e.PdfAnnotator}))),tr=()=>{},au=/^!\[\[([^\]\n]+)\]\]$/,Qg=/\.(png|jpe?g|gif|webp|svg|avif|bmp)$/i,ey=/\.[a-z0-9]{1,8}$/i,ty=/\.db$/i,ny=/\.pdf$/i,oy=/^https?:\/\/\S+$/i;function rr(e){if(e.type.name==="code_block"){const g={"forsion-instructions":"instructions","forsion-task":"task","forsion-prompt":"prompt"}[e.attrs.language];return g&&(g==="instructions"||ks(e.textContent))?{k:"document-agent",type:g,src:e.textContent}:e.attrs.language===Hm?e.textContent.trim()?{k:"sketch",src:e.textContent}:null:e.attrs.language!=="forsion-button"||!Rl(cu(e.textContent))?null:{k:"button",src:e.textContent}}if(e.type.name!=="paragraph")return null;const t=e.textContent.trim(),n=au.exec(t);if(!n)return oy.test(t)?{k:"bookmark",url:t}:null;const o=n[1],[r,s]=o.split("|"),i=r.trim();if(Qg.test(i))return null;const a=Ju(o);if(a)return{k:"web",url:a,w:ia(o)};if(!i.includes("#")&&ty.test(i))return{k:"db",name:i,view:s?.trim()||null};if(!i.includes("#")&&Zu(i))return{k:"draw",target:i};const c=Ba.getState().embedRenderers;if(Jc(c,o.trim()))return{k:"plugin",target:o.trim()};const d=i.includes("#")?_c(i)?.target??null:i;if(d&&Jc(c,d))return{k:"plugin",target:d};if(pf(i))return{k:"note",target:o};const m=_c(i);return m?{k:"file",name:m.target,fileKind:Qu.test(m.target)?"video":"audio",loc:m.loc,badAnchor:i.includes("#")&&!m.loc,w:ia(o)}:!i.includes("#")&&ey.test(i)?{k:"file",name:i,fileKind:ny.test(i)?"pdf":"other",w:ia(o)}:{k:"note",target:o}}function ry({name:e,fileKind:t,pagePath:n,loc:o,badAnchor:r,insertAfter:s}){const i=su(),a=kn(L=>L.files),c=kn(L=>L.openWikiLink),[d,m]=v.useState(!0),g=t==="pdf"?Dl(e,a,n):null;if(t==="other")return!/\.[a-z0-9]+\.md$/i.test(e)&&!Qc()?f.jsxs("div",{className:"embed-file",children:[f.jsx("span",{className:"embed-file-ic","aria-hidden":!0,children:"📄"}),f.jsx("span",{className:"embed-file-name",children:e})]}):f.jsxs("button",{className:"embed-file",onClick:()=>{/\.[a-z0-9]+\.md$/i.test(e)?c(e,n):bn.openAttachment(n,e)},title:/\.[a-z0-9]+\.md$/i.test(e)?i("uembed.openInTab"):i("uembed.openWithSystem"),children:[f.jsx("span",{className:"embed-file-ic","aria-hidden":!0,children:"📄"}),f.jsx("span",{className:"embed-file-name",children:e}),f.jsx("span",{className:"embed-file-open",children:i("uembed.open")})]});const C=Sl(e);return f.jsxs("div",{className:"embed-media",children:[f.jsxs("div",{className:"embed-media-head",children:[f.jsx("span",{className:"embed-file-ic","aria-hidden":!0,children:t==="pdf"?"📕":t==="video"?"🎬":"🎵"}),f.jsx("span",{className:"embed-file-name",children:e}),o&&f.jsxs("span",{className:"embed-media-at",title:i("uembed.startAt"),children:["@",Bc(o.at),o.to?`–${Bc(o.to)}`:""]}),r&&f.jsx("span",{className:"embed-media-warn",title:i("uembed.badAnchorTip"),children:i("uembed.badAnchor")}),f.jsx("button",{className:"embed-media-btn",onClick:()=>m(L=>!L),children:i(d?"uembed.collapse":"uembed.expand")}),(t==="pdf"||Qc())&&f.jsx("button",{className:"embed-media-btn",title:i(t==="pdf"?"uembed.openPdfInTab":"uembed.openWithSystem"),onClick:()=>{t==="pdf"?c(e,n):bn.openAttachment(n,e)},children:i("uembed.open")})]}),d&&t==="pdf"&&(g?f.jsx("div",{className:"embed-pdf embed-pdf-live",children:f.jsx(v.Suspense,{fallback:f.jsx("div",{className:"embed-pdf-loading",children:i("uembed.loadingPdf")}),children:f.jsx(Zg,{pdfPath:g,embed:!0})})}):f.jsx("iframe",{className:"embed-pdf",src:C,title:e})),d&&(t==="video"||t==="audio")&&f.jsx(Sf,{kind:t,url:C,name:e,pagePath:n,loc:o??null,insertAfter:s})]})}function sy({target:e,pagePath:t,readOnly:n}){const o=su(),r=kn(F=>F.openWikiLink),s=kn(F=>F.loadPage),i=kn(F=>F.pages),a=kn(F=>F.linkGraphVersion),[c,d]=v.useState("loading"),{note:m,subpath:g}=rd(e),C=g?`${m}#${g}`:m;v.useEffect(()=>{let F=!0;return d("loading"),Promise.resolve(C?bn.resolveEmbed?.(C,t)??null:null).then(J=>{F&&d(J)}).catch(()=>{F&&d(null)}),()=>{F=!1}},[C,t,a]);const L=!n&&c===null&&!!m&&!hs(m,i,t),M=()=>{kn.getState().openWikiLink(m,t),kn.getState().pendingWikiCreate?.name===m&&kn.getState().confirmWikiCreate()},z=(c&&c!=="loading"?Cf(c.type):void 0)?.Editor;return f.jsxs("div",{className:"embed-body",children:[f.jsxs("div",{className:"embed-head",children:[f.jsx("span",{className:"embed-badge",title:o("uembed.crossNote"),children:o("uembed.badge")}),c&&c!=="loading"&&f.jsxs("button",{className:"embed-src",onClick:()=>{s(c.owner)},title:o("uembed.editAtSource"),children:[sd(c.owner)," ↗"]})]}),c==="loading"?f.jsx("div",{className:"embed-loading",children:o("uembed.resolving")}):c&&z?f.jsx(z,{blockId:"uembed",content:c.content,pagePath:c.owner,readOnly:!0,onChange:tr,onInsertAfter:tr,onDeleteEmpty:tr,onMergePrev:tr,onArrowOut:tr,onMoveDir:tr,focusPlace:null,onFocused:tr,requestSelfFocus:tr,onOpenWiki:(F,J)=>r(F,c.owner,J),getPageNames:()=>i}):f.jsxs("div",{className:"embed-missing",children:[o("uembed.embedMissing"),f.jsx("code",{children:e}),L&&f.jsx("button",{type:"button",className:"embed-media-btn embed-create",title:o("uembed.createTip",{name:m}),onClick:M,children:o("uembed.create")})]})]})}function ay({kind:e,pagePath:t,replaceText:n,insertAfter:o,startTask:r,readOnly:s=!1}){const i=s?()=>{}:n;switch(e.k){case"document-agent":return f.jsx(Ug,{kind:e.type,src:e.src,pagePath:t,readOnly:s,activeInstructions:e.activeInstructions,onChange:i,onStart:r,onOpen:a=>Sr()?.openDocumentTask?.(a)});case"db":return f.jsx(kf,{target:e.name,pagePath:t,initialView:e.view??void 0,readOnly:s,onViewChange:a=>i(a?`![[${e.name}|${a}]]`:`![[${e.name}]]`)});case"draw":return f.jsx(wf,{target:e.target,pagePath:t,readOnly:s});case"plugin":return f.jsx(vf,{target:e.target,pagePath:t});case"file":return f.jsx(ry,{name:e.name,fileKind:e.fileKind,pagePath:t,loc:e.loc,badAnchor:e.badAnchor,insertAfter:s?()=>{}:o});case"note":return f.jsx(sy,{target:e.target,pagePath:t,readOnly:s});case"bookmark":return s?f.jsx(Zc,{url:e.url}):f.jsx(Zc,{url:e.url,onChangeUrl:a=>n(a),onEmbed:()=>n(`![[${od(e.url)}]]`)});case"web":return f.jsx(bf,{url:e.url,toCard:()=>i(e.url)});case"button":{const a=Rl(cu(e.src));return a?f.jsx(yf,{spec:a,readOnly:s,onChange:c=>i(cy(xf(c)))}):f.jsx("span",{})}case"sketch":return f.jsx(Vm,{items:[{callId:"note-sketch",html:e.src}]})}}function cu(e){return"```forsion-button\n"+e+"\n```"}function cy(e){const t=/^```forsion-button[ \t]*\r?\n([\s\S]*?)\r?\n?```$/.exec(e.trim());return t?t[1]:e}const Pi=(e,t)=>e.k==="db"?`db:${e.name}`:e.k==="document-agent"?`document-agent:${e.type}:${e.type==="instructions"?"":ks(e.src)?.id}`:`${e.k}:${t}`;function iy(e,t,n){let o=!0;return e.mapping.maps.forEach((r,s)=>{const i=e.mapping.slice(s+1);r.forEach((a,c,d,m)=>{(i.map(d,-1)<t||i.map(m,1)>n)&&(o=!1)})}),o}function ly(e){return[Et(()=>{const n=new Tn("UNIFIED_EMBED_LAYER"),o=new Map,r=new Set,s=(a,c,d,m,g=null)=>{const C=[],L=new Map,M=(k,z)=>{const F=rr(k);if(!F)return;F.k==="document-agent"&&(F.activeInstructions=a.resolve(z).depth===0);const J=Pi(F,k.textContent),se=L.get(J)??0;if(L.set(J,se+1),m===z&&d>z&&c<z+k.nodeSize||g===z)return;const H=`${J}#${se}`,ne=o.get(H),je=F.k==="document-agent"?`${F.activeInstructions}:${k.textContent}`:k.textContent;ne&&ne.text!==je&&(ne.text=je,ne.render(F)),C.push(co.inline(z+1,z+k.nodeSize-1,{class:"wikilink-src-hidden"})),C.push(co.node(z,z+k.nodeSize,{class:"unified-embed-host"})),C.push(co.widget(z+1,He=>{const p=o.get(H);if(p)return p.refs++,p.dom;const fe=document.createElement("div");fe.className="unified-embed",fe.contentEditable="false";const rt=Ne=>{let Ue=0,U=null;return Ne.state.doc.descendants((ce,$e)=>{if(U)return!1;const A=rr(ce);return A&&Pi(A,ce.textContent)===J?Ue===se?(U={at:$e,size:ce.nodeSize},!1):(Ue++,!1):!0}),U};fe.addEventListener("mousedown",Ne=>{if(Ne.button!==0)return;const Ue=Ne.target;if(Ue!==fe&&Ue.parentElement!==fe||Ue.closest('.amx-src-btn, .amx-img-resize, button, a, input, textarea, select, iframe, webview, video, audio, [contenteditable="true"]'))return;const U=i;if(!U)return;const ce=rt(U);ce&&(Ne.preventDefault(),Ne.stopPropagation(),U.dispatch(U.state.tr.setSelection(Me.create(U.state.doc,ce.at))),U.focus())});const ie=Ne=>{const Ue=i;if(!Ue)return;const U=rt(Ue);U&&Ue.dispatch(Ue.state.tr.insertText(Ne,U.at+1,U.at+U.size-1))},be=F.k==="web"||F.k==="file"&&F.fileKind!=="other",me=F.k==="web"||F.k==="file"?F.w:void 0;me&&(fe.style.width=`${me}px`);const Ee=document.createElement("div");if(Ee.className="unified-embed-body",fe.appendChild(Ee),be){const Ne=au.exec(k.textContent.trim())?.[1];Ne!==void 0&&gf(fe,fe,Ue=>ie(`![[${td(Ne,Ue)}]]`))}const Be=zm.createRoot(Ee),pe=Ne=>Be.render(f.jsx(nd,{children:f.jsx(ay,{kind:Ne,pagePath:e.path,readOnly:!!e.readOnly,insertAfter:Ue=>{const U=i;if(!U)return;const ce=rt(U);if(!ce)return;const $e=U.state.schema.nodes.paragraph;if(!$e)return;const A=Ue.split(/\n{2,}/).map(Z=>$e.create(null,Z?U.state.schema.text(Z):null));U.dispatch(U.state.tr.insert(ce.at+ce.size,A))},startTask:async(Ue,U)=>{const ce=Sr(),$e=kn.getState().vaultRoot,A=i,Z=A&&rt(A);if(!Z)throw new Error(ke("documentTask.sourceGone"));const le={from:Z.at,to:Z.at+Z.size,deleted:!1};r.add(le);try{const ve=()=>{if(le.deleted||e.readOnly||!i||i!==A||e.alive?.()===!1||kn.getState().vaultRoot!==$e)return null;const it=i.state.doc.nodeAt(le.from);if(!it||le.from+it.nodeSize!==le.to)return null;const mt=rr(it);if(mt?.k!=="document-agent"||mt.type!==U)return null;const ct=it?ks(it.textContent):null;return ct?.id===Ue.id&&ct.prompt===Ue.prompt&&ct.agent===Ue.agent?ct:null};if(!ve()||!e.flush)throw new Error(ke("documentTask.sourceGone"));if(await e.flush(),!ve()||!i)throw new Error(ke("documentTask.sourceGone"));const Qe=ru(tc(i.state.doc),e.path),Ke=`${Ue.prompt.trim()}
37
+ End of page maintenance instructions.`:""}gn({"uembed.openInTab":{zh:"在 Forsion 标签页中打开",en:"Open in a Forsion tab"},"uembed.openWithSystem":{zh:"用系统默认程序打开",en:"Open with the system default app"},"uembed.openPdfInTab":{zh:"在 Forsion 标签页中打开",en:"Open in a Forsion tab"},"uembed.open":{zh:"打开 ↗",en:"Open ↗"},"uembed.startAt":{zh:"起播时刻",en:"Start time"},"uembed.badAnchor":{zh:"锚点无效 · 从 0 秒起播",en:"Invalid anchor · playing from 0:00"},"uembed.badAnchorTip":{zh:"只认 #t=95 / #t=01:35 / #t=1:02:30(MM 与 SS 须两位)",en:"Only #t=95 / #t=01:35 / #t=1:02:30 are recognized (MM and SS must be two digits)"},"uembed.collapse":{zh:"收起",en:"Collapse"},"uembed.expand":{zh:"展开",en:"Expand"},"uembed.loadingPdf":{zh:"加载 PDF…",en:"Loading PDF…"},"uembed.crossNote":{zh:"跨笔记嵌入(只读)",en:"Cross-note embed (read-only)"},"uembed.badge":{zh:"↪ 嵌入",en:"↪ Embed"},"uembed.editAtSource":{zh:"去源头编辑",en:"Edit at the source"},"uembed.resolving":{zh:"解析中…",en:"Resolving…"},"uembed.embedMissing":{zh:"嵌入丢失:",en:"Embed missing: "},"uembed.create":{zh:"创建",en:"Create"},"uembed.createTip":{zh:"新建笔记「{name}」",en:"Create the note “{name}”"}});function su(){const[,e]=v.useState(0);return v.useEffect(()=>El(()=>e(t=>t+1)),[]),ke}const Zg=hf(()=>ed(()=>import("./PdfAnnotator-CW0wPWRB.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url).then(e=>({default:e.PdfAnnotator}))),tr=()=>{},au=/^!\[\[([^\]\n]+)\]\]$/,Qg=/\.(png|jpe?g|gif|webp|svg|avif|bmp)$/i,ey=/\.[a-z0-9]{1,8}$/i,ty=/\.db$/i,ny=/\.pdf$/i,oy=/^https?:\/\/\S+$/i;function rr(e){if(e.type.name==="code_block"){const g={"forsion-instructions":"instructions","forsion-task":"task","forsion-prompt":"prompt"}[e.attrs.language];return g&&(g==="instructions"||ks(e.textContent))?{k:"document-agent",type:g,src:e.textContent}:e.attrs.language===Hm?e.textContent.trim()?{k:"sketch",src:e.textContent}:null:e.attrs.language!=="forsion-button"||!Rl(cu(e.textContent))?null:{k:"button",src:e.textContent}}if(e.type.name!=="paragraph")return null;const t=e.textContent.trim(),n=au.exec(t);if(!n)return oy.test(t)?{k:"bookmark",url:t}:null;const o=n[1],[r,s]=o.split("|"),i=r.trim();if(Qg.test(i))return null;const a=Ju(o);if(a)return{k:"web",url:a,w:ia(o)};if(!i.includes("#")&&ty.test(i))return{k:"db",name:i,view:s?.trim()||null};if(!i.includes("#")&&Zu(i))return{k:"draw",target:i};const c=Ba.getState().embedRenderers;if(Jc(c,o.trim()))return{k:"plugin",target:o.trim()};const d=i.includes("#")?_c(i)?.target??null:i;if(d&&Jc(c,d))return{k:"plugin",target:d};if(pf(i))return{k:"note",target:o};const m=_c(i);return m?{k:"file",name:m.target,fileKind:Qu.test(m.target)?"video":"audio",loc:m.loc,badAnchor:i.includes("#")&&!m.loc,w:ia(o)}:!i.includes("#")&&ey.test(i)?{k:"file",name:i,fileKind:ny.test(i)?"pdf":"other",w:ia(o)}:{k:"note",target:o}}function ry({name:e,fileKind:t,pagePath:n,loc:o,badAnchor:r,insertAfter:s}){const i=su(),a=kn(L=>L.files),c=kn(L=>L.openWikiLink),[d,m]=v.useState(!0),g=t==="pdf"?Dl(e,a,n):null;if(t==="other")return!/\.[a-z0-9]+\.md$/i.test(e)&&!Qc()?f.jsxs("div",{className:"embed-file",children:[f.jsx("span",{className:"embed-file-ic","aria-hidden":!0,children:"📄"}),f.jsx("span",{className:"embed-file-name",children:e})]}):f.jsxs("button",{className:"embed-file",onClick:()=>{/\.[a-z0-9]+\.md$/i.test(e)?c(e,n):bn.openAttachment(n,e)},title:/\.[a-z0-9]+\.md$/i.test(e)?i("uembed.openInTab"):i("uembed.openWithSystem"),children:[f.jsx("span",{className:"embed-file-ic","aria-hidden":!0,children:"📄"}),f.jsx("span",{className:"embed-file-name",children:e}),f.jsx("span",{className:"embed-file-open",children:i("uembed.open")})]});const C=Sl(e);return f.jsxs("div",{className:"embed-media",children:[f.jsxs("div",{className:"embed-media-head",children:[f.jsx("span",{className:"embed-file-ic","aria-hidden":!0,children:t==="pdf"?"📕":t==="video"?"🎬":"🎵"}),f.jsx("span",{className:"embed-file-name",children:e}),o&&f.jsxs("span",{className:"embed-media-at",title:i("uembed.startAt"),children:["@",Bc(o.at),o.to?`–${Bc(o.to)}`:""]}),r&&f.jsx("span",{className:"embed-media-warn",title:i("uembed.badAnchorTip"),children:i("uembed.badAnchor")}),f.jsx("button",{className:"embed-media-btn",onClick:()=>m(L=>!L),children:i(d?"uembed.collapse":"uembed.expand")}),(t==="pdf"||Qc())&&f.jsx("button",{className:"embed-media-btn",title:i(t==="pdf"?"uembed.openPdfInTab":"uembed.openWithSystem"),onClick:()=>{t==="pdf"?c(e,n):bn.openAttachment(n,e)},children:i("uembed.open")})]}),d&&t==="pdf"&&(g?f.jsx("div",{className:"embed-pdf embed-pdf-live",children:f.jsx(v.Suspense,{fallback:f.jsx("div",{className:"embed-pdf-loading",children:i("uembed.loadingPdf")}),children:f.jsx(Zg,{pdfPath:g,embed:!0})})}):f.jsx("iframe",{className:"embed-pdf",src:C,title:e})),d&&(t==="video"||t==="audio")&&f.jsx(Sf,{kind:t,url:C,name:e,pagePath:n,loc:o??null,insertAfter:s})]})}function sy({target:e,pagePath:t,readOnly:n}){const o=su(),r=kn(F=>F.openWikiLink),s=kn(F=>F.loadPage),i=kn(F=>F.pages),a=kn(F=>F.linkGraphVersion),[c,d]=v.useState("loading"),{note:m,subpath:g}=rd(e),C=g?`${m}#${g}`:m;v.useEffect(()=>{let F=!0;return d("loading"),Promise.resolve(C?bn.resolveEmbed?.(C,t)??null:null).then(J=>{F&&d(J)}).catch(()=>{F&&d(null)}),()=>{F=!1}},[C,t,a]);const L=!n&&c===null&&!!m&&!hs(m,i,t),M=()=>{kn.getState().openWikiLink(m,t),kn.getState().pendingWikiCreate?.name===m&&kn.getState().confirmWikiCreate()},z=(c&&c!=="loading"?Cf(c.type):void 0)?.Editor;return f.jsxs("div",{className:"embed-body",children:[f.jsxs("div",{className:"embed-head",children:[f.jsx("span",{className:"embed-badge",title:o("uembed.crossNote"),children:o("uembed.badge")}),c&&c!=="loading"&&f.jsxs("button",{className:"embed-src",onClick:()=>{s(c.owner)},title:o("uembed.editAtSource"),children:[sd(c.owner)," ↗"]})]}),c==="loading"?f.jsx("div",{className:"embed-loading",children:o("uembed.resolving")}):c&&z?f.jsx(z,{blockId:"uembed",content:c.content,pagePath:c.owner,readOnly:!0,onChange:tr,onInsertAfter:tr,onDeleteEmpty:tr,onMergePrev:tr,onArrowOut:tr,onMoveDir:tr,focusPlace:null,onFocused:tr,requestSelfFocus:tr,onOpenWiki:(F,J)=>r(F,c.owner,J),getPageNames:()=>i}):f.jsxs("div",{className:"embed-missing",children:[o("uembed.embedMissing"),f.jsx("code",{children:e}),L&&f.jsx("button",{type:"button",className:"embed-media-btn embed-create",title:o("uembed.createTip",{name:m}),onClick:M,children:o("uembed.create")})]})]})}function ay({kind:e,pagePath:t,replaceText:n,insertAfter:o,startTask:r,readOnly:s=!1}){const i=s?()=>{}:n;switch(e.k){case"document-agent":return f.jsx(Ug,{kind:e.type,src:e.src,pagePath:t,readOnly:s,activeInstructions:e.activeInstructions,onChange:i,onStart:r,onOpen:a=>Sr()?.openDocumentTask?.(a)});case"db":return f.jsx(kf,{target:e.name,pagePath:t,initialView:e.view??void 0,readOnly:s,onViewChange:a=>i(a?`![[${e.name}|${a}]]`:`![[${e.name}]]`)});case"draw":return f.jsx(wf,{target:e.target,pagePath:t,readOnly:s});case"plugin":return f.jsx(vf,{target:e.target,pagePath:t});case"file":return f.jsx(ry,{name:e.name,fileKind:e.fileKind,pagePath:t,loc:e.loc,badAnchor:e.badAnchor,insertAfter:s?()=>{}:o});case"note":return f.jsx(sy,{target:e.target,pagePath:t,readOnly:s});case"bookmark":return s?f.jsx(Zc,{url:e.url}):f.jsx(Zc,{url:e.url,onChangeUrl:a=>n(a),onEmbed:()=>n(`![[${od(e.url)}]]`)});case"web":return f.jsx(bf,{url:e.url,toCard:()=>i(e.url)});case"button":{const a=Rl(cu(e.src));return a?f.jsx(yf,{spec:a,readOnly:s,onChange:c=>i(cy(xf(c)))}):f.jsx("span",{})}case"sketch":return f.jsx(Vm,{items:[{callId:"note-sketch",html:e.src}]})}}function cu(e){return"```forsion-button\n"+e+"\n```"}function cy(e){const t=/^```forsion-button[ \t]*\r?\n([\s\S]*?)\r?\n?```$/.exec(e.trim());return t?t[1]:e}const Pi=(e,t)=>e.k==="db"?`db:${e.name}`:e.k==="document-agent"?`document-agent:${e.type}:${e.type==="instructions"?"":ks(e.src)?.id}`:`${e.k}:${t}`;function iy(e,t,n){let o=!0;return e.mapping.maps.forEach((r,s)=>{const i=e.mapping.slice(s+1);r.forEach((a,c,d,m)=>{(i.map(d,-1)<t||i.map(m,1)>n)&&(o=!1)})}),o}function ly(e){return[Et(()=>{const n=new Tn("UNIFIED_EMBED_LAYER"),o=new Map,r=new Set,s=(a,c,d,m,g=null)=>{const C=[],L=new Map,M=(k,z)=>{const F=rr(k);if(!F)return;F.k==="document-agent"&&(F.activeInstructions=a.resolve(z).depth===0);const J=Pi(F,k.textContent),se=L.get(J)??0;if(L.set(J,se+1),m===z&&d>z&&c<z+k.nodeSize||g===z)return;const H=`${J}#${se}`,ne=o.get(H),je=F.k==="document-agent"?`${F.activeInstructions}:${k.textContent}`:k.textContent;ne&&ne.text!==je&&(ne.text=je,ne.render(F)),C.push(co.inline(z+1,z+k.nodeSize-1,{class:"wikilink-src-hidden"})),C.push(co.node(z,z+k.nodeSize,{class:"unified-embed-host"})),C.push(co.widget(z+1,He=>{const p=o.get(H);if(p)return p.refs++,p.dom;const fe=document.createElement("div");fe.className="unified-embed",fe.contentEditable="false";const rt=Ne=>{let Ue=0,U=null;return Ne.state.doc.descendants((ce,$e)=>{if(U)return!1;const A=rr(ce);return A&&Pi(A,ce.textContent)===J?Ue===se?(U={at:$e,size:ce.nodeSize},!1):(Ue++,!1):!0}),U};fe.addEventListener("mousedown",Ne=>{if(Ne.button!==0)return;const Ue=Ne.target;if(Ue!==fe&&Ue.parentElement!==fe||Ue.closest('.amx-src-btn, .amx-img-resize, button, a, input, textarea, select, iframe, webview, video, audio, [contenteditable="true"]'))return;const U=i;if(!U)return;const ce=rt(U);ce&&(Ne.preventDefault(),Ne.stopPropagation(),U.dispatch(U.state.tr.setSelection(Me.create(U.state.doc,ce.at))),U.focus())});const ie=Ne=>{const Ue=i;if(!Ue)return;const U=rt(Ue);U&&Ue.dispatch(Ue.state.tr.insertText(Ne,U.at+1,U.at+U.size-1))},be=F.k==="web"||F.k==="file"&&F.fileKind!=="other",me=F.k==="web"||F.k==="file"?F.w:void 0;me&&(fe.style.width=`${me}px`);const Ee=document.createElement("div");if(Ee.className="unified-embed-body",fe.appendChild(Ee),be){const Ne=au.exec(k.textContent.trim())?.[1];Ne!==void 0&&gf(fe,fe,Ue=>ie(`![[${td(Ne,Ue)}]]`))}const Be=zm.createRoot(Ee),pe=Ne=>Be.render(f.jsx(nd,{children:f.jsx(ay,{kind:Ne,pagePath:e.path,readOnly:!!e.readOnly,insertAfter:Ue=>{const U=i;if(!U)return;const ce=rt(U);if(!ce)return;const $e=U.state.schema.nodes.paragraph;if(!$e)return;const A=Ue.split(/\n{2,}/).map(Z=>$e.create(null,Z?U.state.schema.text(Z):null));U.dispatch(U.state.tr.insert(ce.at+ce.size,A))},startTask:async(Ue,U)=>{const ce=Sr(),$e=kn.getState().vaultRoot,A=i,Z=A&&rt(A);if(!Z)throw new Error(ke("documentTask.sourceGone"));const le={from:Z.at,to:Z.at+Z.size,deleted:!1};r.add(le);try{const ve=()=>{if(le.deleted||e.readOnly||!i||i!==A||e.alive?.()===!1||kn.getState().vaultRoot!==$e)return null;const it=i.state.doc.nodeAt(le.from);if(!it||le.from+it.nodeSize!==le.to)return null;const mt=rr(it);if(mt?.k!=="document-agent"||mt.type!==U)return null;const ct=it?ks(it.textContent):null;return ct?.id===Ue.id&&ct.prompt===Ue.prompt&&ct.agent===Ue.agent?ct:null};if(!ve()||!e.flush)throw new Error(ke("documentTask.sourceGone"));if(await e.flush(),!ve()||!i)throw new Error(ke("documentTask.sourceGone"));const Qe=ru(tc(i.state.doc),e.path),Ke=`${Ue.prompt.trim()}
38
38
 
39
39
  Source note: ${JSON.stringify(e.path)}. Read the source note before editing it.
40
40
  ${Qe}`;if(U==="prompt"){const it=await ce?.startChat?.({agent:Ue.agent,prompt:Ke,send:!1,...ce?.hostExecution?.()&&$e?{cwd:$e}:{},alive:()=>!!ve()});if(!it?.ok)throw new Error(it?.error||ke("docagent.unavailable"));return{}}const $t=ve()?.sessionId;if($t)return{sessionId:$t};if(!$e||!ce?.submitDocumentTask)throw new Error(ke("docagent.unavailable"));const st=await ce.submitDocumentTask({key:`${$e}
@@ -2689,7 +2689,7 @@ The first tab in the Amadeus Space's right sidebar is Tangu's "Chat panel". The
2689
2689
  - **\`@\` delegates to an agent, it does not pick notes**: the menu header reads "Delegate to agent · runs as subagent". Notes always go through \`[[\`.
2690
2690
  - **Drag notes into the chat**: drag one row or a multi-selection from the note tree onto the chat area and it becomes a reference chip; the same drag onto the editor becomes a \`[[wikilink]]\` instead.
2691
2691
  - **Citations in the answer are clickable**: \`[[…]]\` in an assistant message renders as a citation chip covering notes, headings, block anchors, a PDF page, a moment in audio or video, a range of source lines, and past sessions. Hovering a note citation shows the preview card. Anything that cannot be resolved renders as grey unclickable text rather than erroring, and a bare filename matching more than one file deliberately refuses to guess.
2692
- - **Select text inside a message**: two buttons float up, "Quote" and "Ask in side panel"; the second sends the selection to the docked chat panel.
2692
+ - **Select text inside a message**: three buttons float up, "Quote", "Ask in side panel" and "Ask aside". "Quote" adds a quote card above the input box; you can quote several passages, remove any one of them, and they stay cards in the message you send. "Ask in side panel" and "Ask aside" both ask a side question with this conversation as context, without adding to it or interrupting a running task: the first opens in the right sidebar and follows the current conversation, the second opens a floating window.
2693
2693
 
2694
2694
  | Boundary | Detail |
2695
2695
  |---|---|
@@ -2689,7 +2689,7 @@ Amadeus Space 右侧栏的第一个标签就是 Tangu 的「对话面板」。
2689
2689
  - **\`@\` 是派 Agent,不是选笔记**:菜单头写着「委派给 Agent · 作为 subagent 处理」。笔记一律用 \`[[\`。
2690
2690
  - **拖笔记进对话**:从笔记树拖一行或多行落到对话区,变成引用条;同一个拖动落进编辑器,则变成 \`[[wikilinks]]\`。
2691
2691
  - **助手回答里的引用条可以点**:回答里的 \`[[…]]\` 渲染成可点的引用条,支持笔记、标题、块锚、PDF 某一页、音视频某个时刻、代码某几行,以及以前的会话。悬停笔记引用会出预览卡。解析不了的显示成灰色不可点的文字,不会报错;同名文件不止一份时它会拒绝猜。
2692
- - **选中对话里的文字**:会浮出「引用」和「在侧栏提问」两个按钮,后者把选中内容送进侧栏的对话面板。
2692
+ - **选中对话里的文字**:会浮出「引用」「在侧栏提问」「顺便问」三个按钮。「引用」在输入框上方加一张引用卡,可以连着引用好几段、逐张移除,发出后在你的消息里仍是一张张卡片;「在侧栏提问」和「顺便问」都是带着这段对话的上下文问一句题外话,不写进对话、也不打断正在跑的任务 —— 前者开在右侧栏并跟着当前对话走,后者弹一扇浮窗。
2693
2693
 
2694
2694
  | 边界 | 说明 |
2695
2695
  |---|---|