agentroam-runtime-darwin-arm64 0.2.0-preview.82 → 0.2.0-preview.83

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 (197) hide show
  1. package/manifest.json +2 -2
  2. package/package.json +1 -1
  3. package/runtime/.next/BUILD_ID +1 -1
  4. package/runtime/.next/app-build-manifest.json +19 -18
  5. package/runtime/.next/app-path-routes-manifest.json +1 -1
  6. package/runtime/.next/build-manifest.json +7 -7
  7. package/runtime/.next/prerender-manifest.json +1 -1
  8. package/runtime/.next/react-loadable-manifest.json +4 -4
  9. package/runtime/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  10. package/runtime/.next/server/app/_not-found.html +1 -1
  11. package/runtime/.next/server/app/_not-found.rsc +1 -1
  12. package/runtime/.next/server/app/api/engine-threads.body +1 -1
  13. package/runtime/.next/server/app/api/update/check/route.js +1 -1
  14. package/runtime/.next/server/app/api/update/install/route.js +1 -1
  15. package/runtime/.next/server/app/api/update/status/route.js +1 -1
  16. package/runtime/.next/server/app/web/page.js +4 -4
  17. package/runtime/.next/server/app/web/page_client-reference-manifest.js +1 -1
  18. package/runtime/.next/server/app-paths-manifest.json +39 -39
  19. package/runtime/.next/server/middleware-build-manifest.js +1 -1
  20. package/runtime/.next/server/middleware-react-loadable-manifest.js +1 -1
  21. package/runtime/.next/server/pages/404.html +1 -1
  22. package/runtime/.next/server/pages/500.html +1 -1
  23. package/runtime/.next/server/server-reference-manifest.json +1 -1
  24. package/runtime/.next/static/chunks/20.2eb9bc3a5b4d410b.js +1 -0
  25. package/runtime/.next/static/chunks/325-0818ba5a4060a0e8.js +1 -0
  26. package/runtime/.next/static/chunks/34.c7dbf7ffc8914be9.js +1 -0
  27. package/runtime/.next/static/chunks/686.7b5c444243fcf29a.js +1 -0
  28. package/runtime/.next/static/chunks/app/web/page-8adf166584b0088e.js +1 -0
  29. package/runtime/.next/static/chunks/{webpack-f51a057f833e73eb.js → webpack-040c7a20dd455025.js} +1 -1
  30. package/runtime/.next/static/css/645d4c94ea111811.css +1 -0
  31. package/runtime/lib/tunnel-control.mjs +1 -1
  32. package/runtime/native/Support.noindex/AgentRoam Remote Desktop.app/Contents/MacOS/agentroam-remote-desktop +0 -0
  33. package/runtime/native/Support.noindex/AgentRoam Remote Desktop.app/Contents/Resources/agentroam-component.json +1 -1
  34. package/runtime/native/Support.noindex/AgentRoam Remote Desktop.app/Contents/_CodeSignature/CodeResources +2 -2
  35. package/runtime/node_modules/.package-lock.json +3 -3
  36. package/runtime/node_modules/@agent/core/dist/index.js +10 -3
  37. package/runtime/node_modules/@agent/native-runtime/dist/index.js +55 -24
  38. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.cjs +41 -10
  39. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.min.cjs +9 -9
  40. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.min.mjs +10 -10
  41. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.mjs +41 -10
  42. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.node.cjs +41 -10
  43. package/runtime/node_modules/mediabunny/dist/modules/src/isobmff/isobmff-demuxer.js +50 -11
  44. package/runtime/node_modules/mediabunny/dist/modules/src/tsconfig.tsbuildinfo +1 -1
  45. package/runtime/node_modules/mediabunny/dist/modules/src/version.js +1 -1
  46. package/runtime/node_modules/mediabunny/package.json +1 -1
  47. package/runtime/node_modules/mediabunny/src/isobmff/isobmff-demuxer.ts +59 -13
  48. package/runtime/node_modules/mediabunny/src/metadata.ts +1 -0
  49. package/runtime/node_modules/mediabunny/src/version.ts +1 -1
  50. package/runtime/package-lock.json +3 -3
  51. package/runtime/webapp/dist/assets/AIHubView-HV2FIroL.js +1 -0
  52. package/runtime/webapp/dist/assets/{AgentManager-B8TTqJaL.js → AgentManager-C4zPGI-Y.js} +1 -1
  53. package/runtime/webapp/dist/assets/AiHubPane-CEjQjdqT.js +1 -0
  54. package/runtime/webapp/dist/assets/App-CS2wVlfV.js +68 -0
  55. package/runtime/webapp/dist/assets/{BrowserLivePanel-DnzJOz5w.js → BrowserLivePanel-BwtEM-IV.js} +2 -2
  56. package/runtime/webapp/dist/assets/CalendarPage-DY8pZK7d.js +1 -0
  57. package/runtime/webapp/dist/assets/{CalendarView-QXZbXnXA.js → CalendarView-CuBzp-g8.js} +3 -3
  58. package/runtime/webapp/dist/assets/CollaborationCreateDialog-DsXkxAd1.js +1 -0
  59. package/runtime/webapp/dist/assets/CollaborationDashboard-CvE5vaOh.js +1 -0
  60. package/runtime/webapp/dist/assets/{CollaborationPage-B2mIAc-h.js → CollaborationPage-Cjeo60S0.js} +2 -2
  61. package/runtime/webapp/dist/assets/{FilePreview-BCEiERA1.js → FilePreview-CyXKv1Cu.js} +5 -5
  62. package/runtime/webapp/dist/assets/{FileTree-CMbs1Gj3.js → FileTree-DNI9VhEp.js} +2 -2
  63. package/runtime/webapp/dist/assets/FileWorkspaceDrawer-DRluuYWn.js +1 -0
  64. package/runtime/webapp/dist/assets/FlowStudioPane-CKlzxza_.js +5 -0
  65. package/runtime/webapp/dist/assets/HostProjectPicker-CjlxN2ct.js +1 -0
  66. package/runtime/webapp/dist/assets/{LSPServerList-COMVmsvb.js → LSPServerList-BbAS_sm-.js} +1 -1
  67. package/runtime/webapp/dist/assets/{MCPServerList-C_juD6B4.js → MCPServerList-DkVUlKEJ.js} +1 -1
  68. package/runtime/webapp/dist/assets/{MemoryViewer-Et2vysSN.js → MemoryViewer-Ywl80xth.js} +1 -1
  69. package/runtime/webapp/dist/assets/NewSessionWindow-B4H26X5c.js +1 -0
  70. package/runtime/webapp/dist/assets/RemoteDesktopPage-B4q2I23i.js +1 -0
  71. package/runtime/webapp/dist/assets/{RemoteDesktopTabBridge-BFzNwpUn.js → RemoteDesktopTabBridge-B_cCKi7K.js} +1 -1
  72. package/runtime/webapp/dist/assets/{RunningSessionsIcon-D_cOqmmk.js → RunningSessionsIcon-Cz8_524L.js} +1 -1
  73. package/runtime/webapp/dist/assets/{SessionDashboard-yjdEKypJ.js → SessionDashboard-DXPSvNsY.js} +2 -2
  74. package/runtime/webapp/dist/assets/{SessionDashboardBridge-Kc_1Et9r.js → SessionDashboardBridge-7BjKdfN8.js} +1 -1
  75. package/runtime/webapp/dist/assets/{SettingsPanel-t26XhKHP.js → SettingsPanel-C78O9_ho.js} +1 -1
  76. package/runtime/webapp/dist/assets/{SkillManager-nZU7b1sc.js → SkillManager-BdkBUxhH.js} +1 -1
  77. package/runtime/webapp/dist/assets/{TaskPaneTerminal-BPaCKman.js → TaskPaneTerminal-B2WKBysj.js} +1 -1
  78. package/runtime/webapp/dist/assets/{TerminalPane-CiIpI1Id.js → TerminalPane-CxGcN85G.js} +1 -1
  79. package/runtime/webapp/dist/assets/TodoPage-CdzjZR2O.js +1 -0
  80. package/runtime/webapp/dist/assets/{abnfDiagram-VCTEODGH-DmKjGVfG.js → abnfDiagram-VCTEODGH-DFIXyU71.js} +1 -1
  81. package/runtime/webapp/dist/assets/{arc-D6bpvBke.js → arc-CLpaLEla.js} +1 -1
  82. package/runtime/webapp/dist/assets/{architectureDiagram-5GKGNRK7-NEKc2BYf.js → architectureDiagram-5GKGNRK7-Df8T0lx0.js} +1 -1
  83. package/runtime/webapp/dist/assets/{blockDiagram-I7D4REHJ-V6G00twZ.js → blockDiagram-I7D4REHJ-jCoyPZhV.js} +1 -1
  84. package/runtime/webapp/dist/assets/{c4Diagram-7LVT6UL2-CojA33V5.js → c4Diagram-7LVT6UL2-DsZuTCuo.js} +1 -1
  85. package/runtime/webapp/dist/assets/{calendar-days-DXE_2mLa.js → calendar-days-BIRmYMrW.js} +1 -1
  86. package/runtime/webapp/dist/assets/channel-0IyV-PVi.js +1 -0
  87. package/runtime/webapp/dist/assets/{check-UipgMBET.js → check-DCU8YHqr.js} +1 -1
  88. package/runtime/webapp/dist/assets/{chevron-down-Dvinwg2S.js → chevron-down-BUEiUZA7.js} +1 -1
  89. package/runtime/webapp/dist/assets/{chevron-right-BGU3tcLA.js → chevron-right-B_ITnckH.js} +1 -1
  90. package/runtime/webapp/dist/assets/{chunk-2Q5K7J3B-DObpPEgk.js → chunk-2Q5K7J3B-BEZp3wuG.js} +1 -1
  91. package/runtime/webapp/dist/assets/{chunk-5VM5RSS4-PaTzAg6w.js → chunk-5VM5RSS4-BGGDhFwD.js} +1 -1
  92. package/runtime/webapp/dist/assets/{chunk-F27PBJKO-Pn4gut94.js → chunk-F27PBJKO-Mqzm4ODE.js} +1 -1
  93. package/runtime/webapp/dist/assets/{chunk-IMKFNOWR-nRaVFzK9.js → chunk-IMKFNOWR-DtnGgUQJ.js} +1 -1
  94. package/runtime/webapp/dist/assets/{chunk-JWPE2WC7-CxssjKKN.js → chunk-JWPE2WC7-By3kXE4y.js} +1 -1
  95. package/runtime/webapp/dist/assets/{chunk-POPQ4Y6H-CweDXr-B.js → chunk-POPQ4Y6H-BTHuMHN1.js} +1 -1
  96. package/runtime/webapp/dist/assets/{chunk-SVP7TREG-C7T3FGE-.js → chunk-SVP7TREG-BeWH1pvB.js} +1 -1
  97. package/runtime/webapp/dist/assets/{chunk-TICWLB2K-Nc0H-0_V.js → chunk-TICWLB2K-oiekJTZh.js} +1 -1
  98. package/runtime/webapp/dist/assets/{chunk-XXDRQBXY-D_GQGF5g.js → chunk-XXDRQBXY-B7CKqUBs.js} +1 -1
  99. package/runtime/webapp/dist/assets/classDiagram-ZZMXUADV-Dm5zwUmQ.js +1 -0
  100. package/runtime/webapp/dist/assets/classDiagram-v2-VYDZK3BY-Dm5zwUmQ.js +1 -0
  101. package/runtime/webapp/dist/assets/{client-Bb0hpbIR.js → client-BpqlZTm2.js} +1 -1
  102. package/runtime/webapp/dist/assets/{codeSyntax-DHonp3tF.js → codeSyntax-GjP28nDI.js} +1 -1
  103. package/runtime/webapp/dist/assets/{collaboration-e_iziKU1.js → collaboration-CYS2Soeh.js} +1 -1
  104. package/runtime/webapp/dist/assets/{composer-file-routing-CWyT7leB.js → composer-file-routing-DHdpFYk8.js} +2 -2
  105. package/runtime/webapp/dist/assets/{cose-bilkent-JH36ORCC-Ac_FBan4.js → cose-bilkent-JH36ORCC-BmhhO76e.js} +1 -1
  106. package/runtime/webapp/dist/assets/{cynefin-OW5HDTMX-vr6c389q.js → cynefin-OW5HDTMX-BesIxLGS.js} +1 -1
  107. package/runtime/webapp/dist/assets/{cynefinDiagram-5FMLGOSQ-sXmUCrp_.js → cynefinDiagram-5FMLGOSQ-DdF6XhwX.js} +1 -1
  108. package/runtime/webapp/dist/assets/{dagre-GXQ25YYZ-B0DmGxDv.js → dagre-GXQ25YYZ-CxUfRr5w.js} +1 -1
  109. package/runtime/webapp/dist/assets/{diagram-S7CK7UJ4-Dn-2jJ6S.js → diagram-S7CK7UJ4-zSD7nygh.js} +1 -1
  110. package/runtime/webapp/dist/assets/{diagram-UQ7AKVKN-BcasYsju.js → diagram-UQ7AKVKN-CgirUu7t.js} +1 -1
  111. package/runtime/webapp/dist/assets/{diagram-VSXAHHWV-DCgGkc82.js → diagram-VSXAHHWV-CkI9kDpP.js} +1 -1
  112. package/runtime/webapp/dist/assets/{diagram-VX7I27RA-Cjs0Ny4i.js → diagram-VX7I27RA-ZfbGJBGR.js} +1 -1
  113. package/runtime/webapp/dist/assets/{diagram-Z3DM3KII-0nyddp0v.js → diagram-Z3DM3KII-CA44IJP4.js} +1 -1
  114. package/runtime/webapp/dist/assets/{ebnfDiagram-PWID7BFC-By7gCUsz.js → ebnfDiagram-PWID7BFC-CVwSxyot.js} +1 -1
  115. package/runtime/webapp/dist/assets/{erDiagram-RLTQ6QDP-DdwBp45A.js → erDiagram-RLTQ6QDP-DwjlVHEs.js} +1 -1
  116. package/runtime/webapp/dist/assets/{file-types-nujx8XUw.js → file-types-Dj25tuty.js} +1 -1
  117. package/runtime/webapp/dist/assets/{flowDiagram-HODETNUW-DbOwRaT9.js → flowDiagram-HODETNUW-CEt0pwA8.js} +1 -1
  118. package/runtime/webapp/dist/assets/{ganttDiagram-EL5Y4UJY-CG8obc7O.js → ganttDiagram-EL5Y4UJY-CNsj7gWS.js} +1 -1
  119. package/runtime/webapp/dist/assets/{gitGraphDiagram-WWUBYQGX-ru6aSu_g.js → gitGraphDiagram-WWUBYQGX-ERbll1_Q.js} +1 -1
  120. package/runtime/webapp/dist/assets/{history-DaBh5_SJ.js → history-DTS97eAH.js} +1 -1
  121. package/runtime/webapp/dist/assets/{image-plus-Cm9jq1yo.js → image-plus-BmlwMe18.js} +1 -1
  122. package/runtime/webapp/dist/assets/index-C30NoLsn.js +500 -0
  123. package/runtime/webapp/dist/assets/{index-BAGzBXQc.css → index-COFV-DUC.css} +1 -1
  124. package/runtime/webapp/dist/assets/{infoDiagram-27XIBGKW-Crx1iSbW.js → infoDiagram-27XIBGKW-BiMEmJW5.js} +1 -1
  125. package/runtime/webapp/dist/assets/{ishikawaDiagram-5VMMS53U-ClQPMEk5.js → ishikawaDiagram-5VMMS53U-CPlJXmF2.js} +1 -1
  126. package/runtime/webapp/dist/assets/{journeyDiagram-3NMN7TZE-DHso2Xht.js → journeyDiagram-3NMN7TZE-DJJ-qvlw.js} +1 -1
  127. package/runtime/webapp/dist/assets/{kanban-definition-UXKFOSKX-D6psIAhv.js → kanban-definition-UXKFOSKX-PHmavvDJ.js} +1 -1
  128. package/runtime/webapp/dist/assets/{layout-B6AVZ9v9.js → layout-DH5OfcVL.js} +1 -1
  129. package/runtime/webapp/dist/assets/{linear-CEZOUjlB.js → linear-DQek-QDQ.js} +1 -1
  130. package/runtime/webapp/dist/assets/{list-todo-D9ChIz0f.js → list-todo-DULblcsU.js} +1 -1
  131. package/runtime/webapp/dist/assets/{locate-fixed-2R48MVg_.js → locate-fixed-B3zScPI-.js} +1 -1
  132. package/runtime/webapp/dist/assets/{mermaid.core-DH0df9xk.js → mermaid.core-D6eHnLLU.js} +5 -5
  133. package/runtime/webapp/dist/assets/{mindmap-definition-YA3MSWOX-QWt8leZC.js → mindmap-definition-YA3MSWOX-D0TkZusX.js} +1 -1
  134. package/runtime/webapp/dist/assets/{mobileViewport-CKvpvxYc.js → mobileViewport-BhIxH-zP.js} +1 -1
  135. package/runtime/webapp/dist/assets/{new-session-window-CiRwM3Od.js → new-session-window-bxVA-U3Y.js} +56 -56
  136. package/runtime/webapp/dist/assets/page-DyPXAvyj.js +86 -0
  137. package/runtime/webapp/dist/assets/{pause-ddt7BLlm.js → pause-C793N3J1.js} +1 -1
  138. package/runtime/webapp/dist/assets/{pegDiagram-XKGWAZYB-JNBt0nDx.js → pegDiagram-XKGWAZYB-DMIjPBzH.js} +1 -1
  139. package/runtime/webapp/dist/assets/{pieDiagram-E7YTZNPT-g0hnDqNp.js → pieDiagram-E7YTZNPT-DctF47JZ.js} +1 -1
  140. package/runtime/webapp/dist/assets/{pin-BTP5lC_c.js → pin-BLVakDSL.js} +1 -1
  141. package/runtime/webapp/dist/assets/{quadrantDiagram-AXDQQJYC-mLZASjSm.js → quadrantDiagram-AXDQQJYC-JnwbWWwT.js} +1 -1
  142. package/runtime/webapp/dist/assets/{railroadDiagram-O6MQD6OU-CAXNAZhB.js → railroadDiagram-O6MQD6OU-DcpHMNVP.js} +1 -1
  143. package/runtime/webapp/dist/assets/{requirementDiagram-BXWQKSXE-BC8y1ZXE.js → requirementDiagram-BXWQKSXE-C-fRbIOI.js} +1 -1
  144. package/runtime/webapp/dist/assets/{rotate-ccw-CHFTy38a.js → rotate-ccw-CyZK_Om1.js} +1 -1
  145. package/runtime/webapp/dist/assets/{rotate-cw-CFCtRFDl.js → rotate-cw-ChAt9mcI.js} +1 -1
  146. package/runtime/webapp/dist/assets/{sankeyDiagram-P5KCCOFB-Boi5NPjT.js → sankeyDiagram-P5KCCOFB-Sb34Y9Ep.js} +1 -1
  147. package/runtime/webapp/dist/assets/{send-CzCncLlt.js → send-DlrISC4K.js} +1 -1
  148. package/runtime/webapp/dist/assets/{sequenceDiagram-WJ2MYXX4-D4ccoVEB.js → sequenceDiagram-WJ2MYXX4-BeHoOpkJ.js} +1 -1
  149. package/runtime/webapp/dist/assets/{session-dashboard-C0KfSCDl.js → session-dashboard-D1JY1ka0.js} +1 -1
  150. package/runtime/webapp/dist/assets/{session-tree-CTzXmV6R.js → session-tree-Q-jABJNB.js} +1 -1
  151. package/runtime/webapp/dist/assets/{shield-check-Da6EGdIt.js → shield-check-Bzd1i1OQ.js} +1 -1
  152. package/runtime/webapp/dist/assets/{sizeCapture-INFHLROL-Cd5jIVgK.js → sizeCapture-INFHLROL-DspvE2eQ.js} +1 -1
  153. package/runtime/webapp/dist/assets/{stateDiagram-D77RDMKH-DXlmaNwu.js → stateDiagram-D77RDMKH-oBIvmRy9.js} +1 -1
  154. package/runtime/webapp/dist/assets/stateDiagram-v2-MP3YSRHH-DXD2F0in.js +1 -0
  155. package/runtime/webapp/dist/assets/{swimlanes-42K2YHIH-DyhRB_e0.js → swimlanes-42K2YHIH-CAdrbVmI.js} +1 -1
  156. package/runtime/webapp/dist/assets/swimlanesDiagram-VR7AAH4N-CXpNu-5Z.js +8 -0
  157. package/runtime/webapp/dist/assets/{timeline-definition-24CTP7MA-Bkfs9Mi-.js → timeline-definition-24CTP7MA-BtWjc4KI.js} +1 -1
  158. package/runtime/webapp/dist/assets/{trash-2-C682LDDA.js → trash-2-DwFoTvHX.js} +1 -1
  159. package/runtime/webapp/dist/assets/{types-CfOuS-6l.js → types-COzZsLPY.js} +1 -1
  160. package/runtime/webapp/dist/assets/{use-session-activity-C9Cn92Hj.js → use-session-activity-BRhj0V5U.js} +1 -1
  161. package/runtime/webapp/dist/assets/{vennDiagram-4TSXK5OY-APWT64sw.js → vennDiagram-4TSXK5OY-Be4H6PYr.js} +1 -1
  162. package/runtime/webapp/dist/assets/{wardleyDiagram-VM6X3IG4-H7xLoxwM.js → wardleyDiagram-VM6X3IG4-COVxCAu8.js} +1 -1
  163. package/runtime/webapp/dist/assets/{web-CT8e03DV.js → web-BdMHTzmo.js} +1 -1
  164. package/runtime/webapp/dist/assets/{web-DG022HwJ.js → web-Qg6ZVe1T.js} +1 -1
  165. package/runtime/webapp/dist/assets/{loader-circle-CAHZbD5s.js → x-CoIXF2eL.js} +2 -2
  166. package/runtime/webapp/dist/assets/{xychartDiagram-S5SC5T6Z-DIrxZ4UJ.js → xychartDiagram-S5SC5T6Z-J_S9eMK9.js} +1 -1
  167. package/runtime/webapp/dist/assets/{zoom-out-CRN76HNZ.js → zoom-out-C10hb0zX.js} +1 -1
  168. package/runtime/webapp/dist/index.html +2 -2
  169. package/runtime/.next/static/chunks/106.b2050e53421795af.js +0 -1
  170. package/runtime/.next/static/chunks/20.7bd5212774091396.js +0 -1
  171. package/runtime/.next/static/chunks/34.40a88b70750502fb.js +0 -1
  172. package/runtime/.next/static/chunks/753-90c7dd1ba08be9be.js +0 -1
  173. package/runtime/.next/static/chunks/app/web/page-f008ab6dfeab7ce7.js +0 -1
  174. package/runtime/webapp/dist/assets/AIHubView-CNKanNZa.js +0 -1
  175. package/runtime/webapp/dist/assets/AiHubPane-Coyn3P-J.js +0 -1
  176. package/runtime/webapp/dist/assets/App-BGIGpBp3.js +0 -68
  177. package/runtime/webapp/dist/assets/CalendarPage-D0oaq2_l.js +0 -1
  178. package/runtime/webapp/dist/assets/CollaborationCreateDialog-CE8OML-A.js +0 -1
  179. package/runtime/webapp/dist/assets/CollaborationDashboard-CV18iiBO.js +0 -1
  180. package/runtime/webapp/dist/assets/FileWorkspaceDrawer-BxFS-0sF.js +0 -1
  181. package/runtime/webapp/dist/assets/FlowStudioPane-CVP0Q6zR.js +0 -5
  182. package/runtime/webapp/dist/assets/HostProjectPicker-DUUgM2Cm.js +0 -1
  183. package/runtime/webapp/dist/assets/NewSessionWindow-DwJhkRJd.js +0 -1
  184. package/runtime/webapp/dist/assets/RemoteDesktopPage-Cqsea4X7.js +0 -1
  185. package/runtime/webapp/dist/assets/TodoPage-CG__S6_l.js +0 -1
  186. package/runtime/webapp/dist/assets/channel-D66Qxmo0.js +0 -1
  187. package/runtime/webapp/dist/assets/classDiagram-ZZMXUADV-BAX0-S6b.js +0 -1
  188. package/runtime/webapp/dist/assets/classDiagram-v2-VYDZK3BY-BAX0-S6b.js +0 -1
  189. package/runtime/webapp/dist/assets/index-YrEOkxAg.js +0 -500
  190. package/runtime/webapp/dist/assets/page-Cd9ci9uo.js +0 -86
  191. package/runtime/webapp/dist/assets/stateDiagram-v2-MP3YSRHH-Dh6coc1l.js +0 -1
  192. package/runtime/webapp/dist/assets/swimlanesDiagram-VR7AAH4N-BzriATjP.js +0 -8
  193. /package/runtime/.next/static/{_rMvYWpbWkNWrFkCQx3rK → XwGGZtJQeU5VoGqV-1dyI}/_buildManifest.js +0 -0
  194. /package/runtime/.next/static/{_rMvYWpbWkNWrFkCQx3rK → XwGGZtJQeU5VoGqV-1dyI}/_ssgManifest.js +0 -0
  195. /package/runtime/.next/static/chunks/{183-dbd3e343da4ba103.js → 183-5019797f0b42210b.js} +0 -0
  196. /package/runtime/.next/static/chunks/{3cc391f0-4ff886cecc4d6d79.js → 3cc391f0-6cd083946ece156d.js} +0 -0
  197. /package/runtime/.next/static/chunks/app/_not-found/{page-c0fc9b6684d4f0ca.js → page-cffe4d626dcef5fd.js} +0 -0
@@ -0,0 +1,500 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./page-DyPXAvyj.js","./RunningSessionsIcon-Cz8_524L.js","./x-CoIXF2eL.js","./calendar-days-BIRmYMrW.js","./chevron-down-BUEiUZA7.js","./check-DCU8YHqr.js","./trash-2-DwFoTvHX.js","./RemoteDesktopTabBridge-B_cCKi7K.js","./chevron-right-B_ITnckH.js","./mobileViewport-BhIxH-zP.js","./pin-BLVakDSL.js","./CollaborationTabBridge-Dxq4G1Uk.js","./SessionDashboardBridge-7BjKdfN8.js","./NewSessionWindow-B4H26X5c.js","./new-session-window-bxVA-U3Y.js","./composer-file-routing-DHdpFYk8.js","./file-types-Dj25tuty.js","./list-todo-DULblcsU.js","./session-tree-Q-jABJNB.js","./zoom-out-C10hb0zX.js","./rotate-ccw-CyZK_Om1.js","./use-session-activity-BRhj0V5U.js","./client-BpqlZTm2.js","./HostProjectPicker-CjlxN2ct.js","./new-session-window-DIU2v1uh.css","./NewSessionWindow-DOLG1XEp.css","./CollaborationPage-Cjeo60S0.js","./shield-check-Bzd1i1OQ.js","./collaboration-CYS2Soeh.js","./collaboration-B0IRHmY_.css","./types-COzZsLPY.js","./history-DTS97eAH.js","./image-plus-BmlwMe18.js","./CollaborationDashboard-CvE5vaOh.js","./CollaborationCreateDialog-DsXkxAd1.js","./CollaborationDashboard-CCXC6JuQ.css","./SessionDashboard-DXPSvNsY.js","./session-dashboard-D1JY1ka0.js","./session-dashboard-BZIyuFTU.css","./pause-C793N3J1.js","./SessionDashboard-CAYVDT8Z.css","./RemoteDesktopPage-B4q2I23i.js","./BrowserLivePanel-BwtEM-IV.js","./CalendarPage-DY8pZK7d.js","./CalendarView-CuBzp-g8.js","./locate-fixed-B3zScPI-.js","./CalendarView-BjjC_t12.css","./TodoPage-CdzjZR2O.js","./App-CS2wVlfV.js","./rotate-cw-ChAt9mcI.js","./App-C0CP5N5K.css"])))=>i.map(i=>d[i]);
2
+ (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))o(l);new MutationObserver(l=>{for(const u of l)if(u.type==="childList")for(const h of u.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&o(h)}).observe(document,{childList:!0,subtree:!0});function r(l){const u={};return l.integrity&&(u.integrity=l.integrity),l.referrerPolicy&&(u.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?u.credentials="include":l.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function o(l){if(l.ep)return;l.ep=!0;const u=r(l);fetch(l.href,u)}})();const g3="modulepreload",p3=function(t,e){return new URL(t,e).href},yh={},Br=function(e,r,o){let l=Promise.resolve();if(r&&r.length>0){const h=document.getElementsByTagName("link"),x=document.querySelector("meta[property=csp-nonce]"),w=(x==null?void 0:x.nonce)||(x==null?void 0:x.getAttribute("nonce"));l=Promise.allSettled(r.map(m=>{if(m=p3(m,o),m in yh)return;yh[m]=!0;const y=m.endsWith(".css"),b=y?'[rel="stylesheet"]':"";if(o)for(let T=h.length-1;T>=0;T--){const k=h[T];if(k.href===m&&(!y||k.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${m}"]${b}`))return;const C=document.createElement("link");if(C.rel=y?"stylesheet":g3,y||(C.as="script"),C.crossOrigin="",C.href=m,w&&C.setAttribute("nonce",w),document.head.appendChild(C),y)return new Promise((T,k)=>{C.addEventListener("load",T),C.addEventListener("error",()=>k(Error(`Unable to preload CSS for ${m}`)))})}))}function u(h){const x=new Event("vite:preloadError",{cancelable:!0});if(x.payload=h,window.dispatchEvent(x),!x.defaultPrevented)throw h}return l.then(h=>{for(const x of h||[])x.status==="rejected"&&u(x.reason);return e().catch(u)})};var mn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Y2(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var K2={exports:{}},vc={},Z2={exports:{}},Ce={};/**
3
+ * @license React
4
+ * react.production.min.js
5
+ *
6
+ * Copyright (c) Facebook, Inc. and its affiliates.
7
+ *
8
+ * This source code is licensed under the MIT license found in the
9
+ * LICENSE file in the root directory of this source tree.
10
+ */var la=Symbol.for("react.element"),m3=Symbol.for("react.portal"),x3=Symbol.for("react.fragment"),w3=Symbol.for("react.strict_mode"),v3=Symbol.for("react.profiler"),y3=Symbol.for("react.provider"),E3=Symbol.for("react.context"),A3=Symbol.for("react.forward_ref"),b3=Symbol.for("react.suspense"),C3=Symbol.for("react.memo"),S3=Symbol.for("react.lazy"),Eh=Symbol.iterator;function I3(t){return t===null||typeof t!="object"?null:(t=Eh&&t[Eh]||t["@@iterator"],typeof t=="function"?t:null)}var Q2={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},q2=Object.assign,J2={};function Ps(t,e,r){this.props=t,this.context=e,this.refs=J2,this.updater=r||Q2}Ps.prototype.isReactComponent={};Ps.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};Ps.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function em(){}em.prototype=Ps.prototype;function vd(t,e,r){this.props=t,this.context=e,this.refs=J2,this.updater=r||Q2}var yd=vd.prototype=new em;yd.constructor=vd;q2(yd,Ps.prototype);yd.isPureReactComponent=!0;var Ah=Array.isArray,tm=Object.prototype.hasOwnProperty,Ed={current:null},rm={key:!0,ref:!0,__self:!0,__source:!0};function nm(t,e,r){var o,l={},u=null,h=null;if(e!=null)for(o in e.ref!==void 0&&(h=e.ref),e.key!==void 0&&(u=""+e.key),e)tm.call(e,o)&&!rm.hasOwnProperty(o)&&(l[o]=e[o]);var x=arguments.length-2;if(x===1)l.children=r;else if(1<x){for(var w=Array(x),m=0;m<x;m++)w[m]=arguments[m+2];l.children=w}if(t&&t.defaultProps)for(o in x=t.defaultProps,x)l[o]===void 0&&(l[o]=x[o]);return{$$typeof:la,type:t,key:u,ref:h,props:l,_owner:Ed.current}}function T3(t,e){return{$$typeof:la,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function Ad(t){return typeof t=="object"&&t!==null&&t.$$typeof===la}function R3(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(r){return e[r]})}var bh=/\/+/g;function Au(t,e){return typeof t=="object"&&t!==null&&t.key!=null?R3(""+t.key):e.toString(36)}function dl(t,e,r,o,l){var u=typeof t;(u==="undefined"||u==="boolean")&&(t=null);var h=!1;if(t===null)h=!0;else switch(u){case"string":case"number":h=!0;break;case"object":switch(t.$$typeof){case la:case m3:h=!0}}if(h)return h=t,l=l(h),t=o===""?"."+Au(h,0):o,Ah(l)?(r="",t!=null&&(r=t.replace(bh,"$&/")+"/"),dl(l,e,r,"",function(m){return m})):l!=null&&(Ad(l)&&(l=T3(l,r+(!l.key||h&&h.key===l.key?"":(""+l.key).replace(bh,"$&/")+"/")+t)),e.push(l)),1;if(h=0,o=o===""?".":o+":",Ah(t))for(var x=0;x<t.length;x++){u=t[x];var w=o+Au(u,x);h+=dl(u,e,r,w,l)}else if(w=I3(t),typeof w=="function")for(t=w.call(t),x=0;!(u=t.next()).done;)u=u.value,w=o+Au(u,x++),h+=dl(u,e,r,w,l);else if(u==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return h}function ka(t,e,r){if(t==null)return t;var o=[],l=0;return dl(t,o,"","",function(u){return e.call(r,u,l++)}),o}function _3(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(r){(t._status===0||t._status===-1)&&(t._status=1,t._result=r)},function(r){(t._status===0||t._status===-1)&&(t._status=2,t._result=r)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var Yt={current:null},hl={transition:null},N3={ReactCurrentDispatcher:Yt,ReactCurrentBatchConfig:hl,ReactCurrentOwner:Ed};function im(){throw Error("act(...) is not supported in production builds of React.")}Ce.Children={map:ka,forEach:function(t,e,r){ka(t,function(){e.apply(this,arguments)},r)},count:function(t){var e=0;return ka(t,function(){e++}),e},toArray:function(t){return ka(t,function(e){return e})||[]},only:function(t){if(!Ad(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};Ce.Component=Ps;Ce.Fragment=x3;Ce.Profiler=v3;Ce.PureComponent=vd;Ce.StrictMode=w3;Ce.Suspense=b3;Ce.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=N3;Ce.act=im;Ce.cloneElement=function(t,e,r){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var o=q2({},t.props),l=t.key,u=t.ref,h=t._owner;if(e!=null){if(e.ref!==void 0&&(u=e.ref,h=Ed.current),e.key!==void 0&&(l=""+e.key),t.type&&t.type.defaultProps)var x=t.type.defaultProps;for(w in e)tm.call(e,w)&&!rm.hasOwnProperty(w)&&(o[w]=e[w]===void 0&&x!==void 0?x[w]:e[w])}var w=arguments.length-2;if(w===1)o.children=r;else if(1<w){x=Array(w);for(var m=0;m<w;m++)x[m]=arguments[m+2];o.children=x}return{$$typeof:la,type:t.type,key:l,ref:u,props:o,_owner:h}};Ce.createContext=function(t){return t={$$typeof:E3,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:y3,_context:t},t.Consumer=t};Ce.createElement=nm;Ce.createFactory=function(t){var e=nm.bind(null,t);return e.type=t,e};Ce.createRef=function(){return{current:null}};Ce.forwardRef=function(t){return{$$typeof:A3,render:t}};Ce.isValidElement=Ad;Ce.lazy=function(t){return{$$typeof:S3,_payload:{_status:-1,_result:t},_init:_3}};Ce.memo=function(t,e){return{$$typeof:C3,type:t,compare:e===void 0?null:e}};Ce.startTransition=function(t){var e=hl.transition;hl.transition={};try{t()}finally{hl.transition=e}};Ce.unstable_act=im;Ce.useCallback=function(t,e){return Yt.current.useCallback(t,e)};Ce.useContext=function(t){return Yt.current.useContext(t)};Ce.useDebugValue=function(){};Ce.useDeferredValue=function(t){return Yt.current.useDeferredValue(t)};Ce.useEffect=function(t,e){return Yt.current.useEffect(t,e)};Ce.useId=function(){return Yt.current.useId()};Ce.useImperativeHandle=function(t,e,r){return Yt.current.useImperativeHandle(t,e,r)};Ce.useInsertionEffect=function(t,e){return Yt.current.useInsertionEffect(t,e)};Ce.useLayoutEffect=function(t,e){return Yt.current.useLayoutEffect(t,e)};Ce.useMemo=function(t,e){return Yt.current.useMemo(t,e)};Ce.useReducer=function(t,e,r){return Yt.current.useReducer(t,e,r)};Ce.useRef=function(t){return Yt.current.useRef(t)};Ce.useState=function(t){return Yt.current.useState(t)};Ce.useSyncExternalStore=function(t,e,r){return Yt.current.useSyncExternalStore(t,e,r)};Ce.useTransition=function(){return Yt.current.useTransition()};Ce.version="18.3.1";Z2.exports=Ce;var ie=Z2.exports;const O3=Y2(ie);/**
11
+ * @license React
12
+ * react-jsx-runtime.production.min.js
13
+ *
14
+ * Copyright (c) Facebook, Inc. and its affiliates.
15
+ *
16
+ * This source code is licensed under the MIT license found in the
17
+ * LICENSE file in the root directory of this source tree.
18
+ */var k3=ie,M3=Symbol.for("react.element"),D3=Symbol.for("react.fragment"),P3=Object.prototype.hasOwnProperty,L3=k3.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,B3={key:!0,ref:!0,__self:!0,__source:!0};function sm(t,e,r){var o,l={},u=null,h=null;r!==void 0&&(u=""+r),e.key!==void 0&&(u=""+e.key),e.ref!==void 0&&(h=e.ref);for(o in e)P3.call(e,o)&&!B3.hasOwnProperty(o)&&(l[o]=e[o]);if(t&&t.defaultProps)for(o in e=t.defaultProps,e)l[o]===void 0&&(l[o]=e[o]);return{$$typeof:M3,type:t,key:u,ref:h,props:l,_owner:L3.current}}vc.Fragment=D3;vc.jsx=sm;vc.jsxs=sm;K2.exports=vc;var M=K2.exports;const F3="agentroam:page-activity:v1",U3="agentroam:page-activity-request:v1";function j3(t,e,r){var o;return!r||t.source!==r||t.origin!==e||((o=t.data)==null?void 0:o.type)!==F3||typeof t.data.active!="boolean"?null:t.data.active}function W3(t){let e=t.parent===t,r=!1;const o=new Set,l=()=>e&&t.document.visibilityState!=="hidden";let u=l();const h=()=>{const m=l();m!==u&&(u=m,o.forEach(y=>y()))},x=m=>{const y=j3(m,t.location.origin,t.parent);y!==null&&(e=y,h())};return{active:l,subscribe:m=>(o.add(m),r||(r=!0,t.addEventListener("message",x),t.document.addEventListener("visibilitychange",h),t.parent!==t&&t.parent.postMessage({type:U3},t.location.origin)),()=>{o.delete(m),!o.size&&(t.removeEventListener("message",x),t.document.removeEventListener("visibilitychange",h),r=!1)})}}let V3;function om(){return V3??(V3=W3(window))}function z3(){return typeof window<"u"&&om().active()}function zN(){const t=typeof window>"u"?{subscribe:()=>()=>{},active:()=>!1}:om();return ie.useSyncExternalStore(t.subscribe,t.active,()=>!1)}var qs=function(t){return t&&t.Math===Math&&t},ft=qs(typeof globalThis=="object"&&globalThis)||qs(typeof window=="object"&&window)||qs(typeof self=="object"&&self)||qs(typeof mn=="object"&&mn)||qs(typeof mn=="object"&&mn)||function(){return this}()||Function("return this")(),bd={},lt=function(t){try{return!!t()}catch{return!0}},$3=lt,Kt=!$3(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),H3=lt,Cd=!H3(function(){var t=(function(){}).bind();return typeof t!="function"||t.hasOwnProperty("prototype")}),G3=Cd,Ma=Function.prototype.call,In=G3?Ma.bind(Ma):function(){return Ma.apply(Ma,arguments)},am={},lm={}.propertyIsEnumerable,cm=Object.getOwnPropertyDescriptor,X3=cm&&!lm.call({1:2},1);am.f=X3?function(e){var r=cm(this,e);return!!r&&r.enumerable}:lm;var Pi=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}},um=Cd,fm=Function.prototype,Vf=fm.call,Y3=um&&fm.bind.bind(Vf,Vf),dt=um?Y3:function(t){return function(){return Vf.apply(t,arguments)}},dm=dt,K3=dm({}.toString),Z3=dm("".slice),Li=function(t){return Z3(K3(t),8,-1)},Q3=dt,q3=lt,J3=Li,bu=Object,eE=Q3("".split),hm=q3(function(){return!bu("z").propertyIsEnumerable(0)})?function(t){return J3(t)==="String"?eE(t,""):bu(t)}:bu,Ls=function(t){return t==null},tE=Ls,rE=TypeError,Sd=function(t){if(tE(t))throw new rE("Can't call method on "+t);return t},nE=hm,iE=Sd,Bs=function(t){return nE(iE(t))},Cu=typeof document=="object"&&document.all,bt=typeof Cu>"u"&&Cu!==void 0?function(t){return typeof t=="function"||t===Cu}:function(t){return typeof t=="function"},sE=bt,xr=function(t){return typeof t=="object"?t!==null:sE(t)},Su=ft,oE=bt,aE=function(t){return oE(t)?t:void 0},Tn=function(t,e){return arguments.length<2?aE(Su[t]):Su[t]&&Su[t][e]},lE=dt,yc=lE({}.isPrototypeOf),cE=ft,Ch=cE.navigator,Sh=Ch&&Ch.userAgent,gm=Sh?String(Sh):"",pm=ft,Iu=gm,Ih=pm.process,Th=pm.Deno,Rh=Ih&&Ih.versions||Th&&Th.version,_h=Rh&&Rh.v8,jr,Ll;_h&&(jr=_h.split("."),Ll=jr[0]>0&&jr[0]<4?1:+(jr[0]+jr[1]));!Ll&&Iu&&(jr=Iu.match(/Edge\/(\d+)/),(!jr||jr[1]>=74)&&(jr=Iu.match(/Chrome\/(\d+)/),jr&&(Ll=+jr[1])));var mm=Ll,Nh=mm,uE=lt,fE=ft,dE=fE.String,xm=!!Object.getOwnPropertySymbols&&!uE(function(){var t=Symbol("symbol detection");return!dE(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&Nh&&Nh<41}),hE=xm,wm=hE&&!Symbol.sham&&typeof Symbol.iterator=="symbol",gE=Tn,pE=bt,mE=yc,xE=wm,wE=Object,Id=xE?function(t){return typeof t=="symbol"}:function(t){var e=gE("Symbol");return pE(e)&&mE(e.prototype,wE(t))},vE=String,Td=function(t){try{return vE(t)}catch{return"Object"}},yE=bt,EE=Td,AE=TypeError,Rd=function(t){if(yE(t))return t;throw new AE(EE(t)+" is not a function")},bE=Rd,CE=Ls,_d=function(t,e){var r=t[e];return CE(r)?void 0:bE(r)},Tu=In,Ru=bt,_u=xr,SE=TypeError,IE=function(t,e){var r,o;if(e==="string"&&Ru(r=t.toString)&&!_u(o=Tu(r,t))||Ru(r=t.valueOf)&&!_u(o=Tu(r,t))||e!=="string"&&Ru(r=t.toString)&&!_u(o=Tu(r,t)))return o;throw new SE("Can't convert object to primitive value")},vm={exports:{}},Oh=ft,TE=Object.defineProperty,Nd=function(t,e){try{TE(Oh,t,{value:e,configurable:!0,writable:!0})}catch{Oh[t]=e}return e},RE=ft,_E=Nd,kh="__core-js_shared__",Mh=vm.exports=RE[kh]||_E(kh,{});(Mh.versions||(Mh.versions=[])).push({version:"3.50.0",mode:"global",copyright:"© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.",license:"https://github.com/zloirock/core-js/blob/v3.50.0/LICENSE",source:"https://github.com/zloirock/core-js"});var Od=vm.exports,Dh=Od,NE=Object.create||Object,ym=function(t,e){return Dh[t]||(Dh[t]=e||NE(null))},OE=Sd,kE=Object,ca=function(t){return kE(OE(t))},ME=dt,DE=ca,PE=ME({}.hasOwnProperty),ur=Object.hasOwn||function(e,r){return PE(DE(e),r)},LE=dt,BE=0,FE=Math.random(),UE=LE(1.1.toString),Ec=function(t){return"Symbol("+(t===void 0?"":t)+")_"+UE(++BE+FE,36)},jE=ft,WE=ym,Ph=ur,VE=Ec,zE=xm,$E=wm,ts=jE.Symbol,Nu=WE("wks"),HE=$E?ts.for||ts:ts&&ts.withoutSetter||VE,Hr=function(t){return Ph(Nu,t)||(Nu[t]=zE&&Ph(ts,t)?ts[t]:HE("Symbol."+t)),Nu[t]},GE=In,Lh=xr,Bh=Id,XE=_d,YE=IE,KE=Hr,ZE=TypeError,QE=KE("toPrimitive"),qE=function(t,e){if(!Lh(t)||Bh(t))return t;var r=XE(t,QE),o;if(r){if(e===void 0&&(e="default"),o=GE(r,t,e),!Lh(o)||Bh(o))return o;throw new ZE("Can't convert object to primitive value")}return e===void 0&&(e="number"),YE(t,e)},JE=qE,e8=Id,Em=function(t){var e=JE(t,"string");return e8(e)?e:e+""},t8=ft,Fh=xr,zf=t8.document,r8=Fh(zf)&&Fh(zf.createElement),Am=function(t){return r8?zf.createElement(t):{}},n8=Kt,i8=lt,s8=Am,bm=!n8&&!i8(function(){return Object.defineProperty(s8("div"),"a",{get:function(){return 7}}).a!==7}),o8=Kt,a8=In,l8=am,c8=Pi,u8=Bs,f8=Em,d8=ur,h8=bm,Uh=Object.getOwnPropertyDescriptor;bd.f=o8?Uh:function(e,r){if(e=u8(e),r=f8(r),h8)try{return Uh(e,r)}catch{}if(d8(e,r))return c8(!a8(l8.f,e,r),e[r])};var wr={},g8=Kt,p8=lt,Cm=g8&&p8(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),m8=xr,x8=String,w8=TypeError,Gr=function(t){if(m8(t))return t;throw new w8(x8(t)+" is not an object")},v8=Kt,y8=bm,E8=Cm,Da=Gr,jh=Em,A8=TypeError,Ou=Object.defineProperty,b8=Object.getOwnPropertyDescriptor,ku="enumerable",Mu="configurable",Du="writable";wr.f=v8?E8?function(e,r,o){if(Da(e),r=jh(r),Da(o),typeof e=="function"&&r==="prototype"&&"value"in o&&Du in o&&!o[Du]){var l=b8(e,r);l&&l[Du]&&(e[r]=o.value,o={configurable:Mu in o?o[Mu]:l[Mu],enumerable:ku in o?o[ku]:l[ku],writable:!1})}return Ou(e,r,o)}:Ou:function(e,r,o){if(Da(e),r=jh(r),Da(o),y8)try{return Ou(e,r,o)}catch{}if("get"in o||"set"in o)throw new A8("Accessors not supported");return"value"in o&&(e[r]=o.value),e};var C8=Kt,S8=wr,I8=Pi,Ac=C8?function(t,e,r){return S8.f(t,e,I8(1,r))}:function(t,e,r){return t[e]=r,t},Sm={exports:{}},$f=Kt,T8=ur,Im=Function.prototype,R8=$f&&Object.getOwnPropertyDescriptor,Tm=T8(Im,"name"),_8=Tm&&(function(){}).name==="something",N8=Tm&&(!$f||$f&&R8(Im,"name").configurable),Rm={PROPER:_8,CONFIGURABLE:N8},O8=dt,k8=bt,Hf=Od,M8=O8(Function.toString);k8(Hf.inspectSource)||(Hf.inspectSource=function(t){return M8(t)});var _m=Hf.inspectSource,D8=ft,P8=bt,Wh=D8.WeakMap,L8=P8(Wh)&&/native code/.test(String(Wh)),B8=ym,F8=Ec,Vh=B8("keys"),kd=function(t){return Vh[t]||(Vh[t]=F8(t))},bc={},U8=L8,Nm=ft,j8=xr,W8=Ac,Pu=ur,Lu=Od,V8=kd,z8=bc,zh="Object already initialized",Gf=Nm.TypeError,$8=Nm.WeakMap,Bl,Lo,Fl,H8=function(t){return Fl(t)?Lo(t):Bl(t,{})},G8=function(t){return function(e){var r;if(!j8(e)||(r=Lo(e)).type!==t)throw new Gf("Incompatible receiver, "+t+" required");return r}};if(U8||Lu.state){var en=Lu.state||(Lu.state=new $8);en.get=en.get,en.has=en.has,en.set=en.set,Bl=function(t,e){if(en.has(t))throw new Gf(zh);return e.facade=t,en.set(t,e),e},Lo=function(t){return en.get(t)||{}},Fl=function(t){return en.has(t)}}else{var Zi=V8("state");z8[Zi]=!0,Bl=function(t,e){if(Pu(t,Zi))throw new Gf(zh);return e.facade=t,W8(t,Zi,e),e},Lo=function(t){return Pu(t,Zi)?t[Zi]:{}},Fl=function(t){return Pu(t,Zi)}}var Cc={set:Bl,get:Lo,has:Fl,enforce:H8,getterFor:G8},Md=dt,X8=lt,Y8=bt,Pa=ur,Xf=Kt,K8=Rm.CONFIGURABLE,Z8=_m,Om=Cc,Q8=Om.enforce,q8=Om.get,$h=String,gl=Object.defineProperty,J8=Md("".slice),e4=Md("".replace),t4=Md([].join),r4=Xf&&!X8(function(){return gl(function(){},"length",{value:8}).length!==8}),n4=String(String).split("String"),i4=Sm.exports=function(t,e,r){J8($h(e),0,7)==="Symbol("&&(e="["+e4($h(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!Pa(t,"name")||K8&&t.name!==e)&&(Xf?gl(t,"name",{value:e,configurable:!0}):t.name=e),r4&&r&&Pa(r,"arity")&&t.length!==r.arity&&gl(t,"length",{value:r.arity});try{r&&Pa(r,"constructor")&&r.constructor?Xf&&gl(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch{}var o=Q8(t);return Pa(o,"source")||(o.source=t4(n4,typeof e=="string"?e:"")),t};Function.prototype.toString=i4(function(){return Y8(this)&&q8(this).source||Z8(this)},"toString");var km=Sm.exports,s4=bt,o4=wr,a4=km,l4=Nd,ni=function(t,e,r,o){o||(o={});var l=o.enumerable,u=o.name!==void 0?o.name:e;if(s4(r)&&a4(r,u,o),o.global)l?t[e]=r:l4(e,r);else{try{o.unsafe?t[e]&&(l=!0):delete t[e]}catch{}l?t[e]=r:o4.f(t,e,{value:r,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return t},Sc={},c4=Math.ceil,u4=Math.floor,f4=Math.trunc||function(e){var r=+e;return(r>0?u4:c4)(r)},d4=f4,Dd=function(t){var e=+t;return e!==e||e===0?0:d4(e)},h4=Dd,g4=Math.max,p4=Math.min,m4=function(t,e){var r=h4(t);return r<0?g4(r+e,0):p4(r,e)},x4=Dd,w4=Math.min,v4=function(t){var e=x4(t);return e>0?w4(e,9007199254740991):0},y4=v4,ua=function(t){return y4(t.length)},E4=Bs,A4=m4,b4=ua,C4=function(t){return function(e,r,o){var l=E4(e),u=b4(l);if(u===0)return!t&&-1;var h=A4(o,u),x;if(t&&r!==r){for(;u>h;)if(x=l[h++],x!==x)return!0}else for(;u>h;h++)if((t||h in l)&&l[h]===r)return t||h||0;return!t&&-1}},S4={indexOf:C4(!1)},I4=dt,Bu=ur,T4=Bs,R4=S4.indexOf,_4=bc,Hh=I4([].push),Mm=function(t,e){var r=T4(t),o=0,l=[],u;for(u in r)!Bu(_4,u)&&Bu(r,u)&&Hh(l,u);for(;e.length>o;)Bu(r,u=e[o++])&&(~R4(l,u)||Hh(l,u));return l},Pd=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],N4=Mm,O4=Pd,k4=O4.concat("length","prototype");Sc.f=Object.getOwnPropertyNames||function(e){return N4(e,k4)};var Dm={};Dm.f=Object.getOwnPropertySymbols;var M4=Tn,D4=dt,P4=Sc,L4=Dm,B4=Gr,F4=D4([].concat),U4=M4("Reflect","ownKeys")||function(e){var r=P4.f(B4(e)),o=L4.f;return o?F4(r,o(e)):r},Gh=ur,j4=U4,W4=bd,V4=wr,z4=function(t,e,r){for(var o=j4(e),l=V4.f,u=W4.f,h=0;h<o.length;h++){var x=o[h];!Gh(t,x)&&!(r&&Gh(r,x))&&l(t,x,u(e,x))}},$4=lt,H4=bt,G4=/#|\.prototype\./,fa=function(t,e){var r=Y4[X4(t)];return r===Z4?!0:r===K4?!1:H4(e)?$4(e):!!e},X4=fa.normalize=function(t){return String(t).replace(G4,".").toLowerCase()},Y4=fa.data={},K4=fa.NATIVE="N",Z4=fa.POLYFILL="P",Pm=fa,La=ft,Q4=bd.f,q4=Ac,J4=ni,eA=Nd,tA=z4,rA=Pm,un=function(t,e){var r=t.target,o=t.global,l=t.stat,u,h,x,w,m,y;if(o?h=La:l?h=La[r]||eA(r,{}):h=La[r]&&La[r].prototype,h)for(x in e){if(m=e[x],t.dontCallGetSet?(y=Q4(h,x),w=y&&y.value):w=h[x],u=rA(o?x:r+(l?".":"#")+x,t.forced),!u&&w!==void 0){if(typeof m==typeof w)continue;tA(m,w)}(t.sham||w&&w.sham)&&q4(m,"sham",!0),J4(h,x,m,t)}},Lm={},nA=Mm,iA=Pd,Bm=Object.keys||function(e){return nA(e,iA)},sA=Kt,oA=Cm,aA=wr,lA=Gr,cA=Bs,uA=Bm;Lm.f=sA&&!oA?Object.defineProperties:function(e,r){lA(e);for(var o=cA(r),l=uA(r),u=l.length,h=0,x;u>h;)aA.f(e,x=l[h++],o[x]);return e};var fA=Tn,dA=fA("document","documentElement"),hA=Gr,gA=Lm,Xh=Pd,pA=bc,mA=dA,xA=Am,wA=kd,Yh=">",Kh="<",Yf="prototype",Kf="script",Fm=wA("IE_PROTO"),Fu=function(){},Um=function(t){return Kh+Kf+Yh+t+Kh+"/"+Kf+Yh},Zh=function(t){t.write(Um("")),t.close();var e=t.parentWindow.Object;return t=null,e},vA=function(){var t=xA("iframe"),e="java"+Kf+":",r;return t.style.display="none",mA.appendChild(t),t.src=String(e),r=t.contentWindow.document,r.open(),r.write(Um("document.F=Object")),r.close(),r.F},Ba,pl=function(){try{Ba=new ActiveXObject("htmlfile")}catch{}pl=typeof document<"u"?document.domain&&Ba?Zh(Ba):vA():Zh(Ba);for(var t=Xh.length;t--;)delete pl[Yf][Xh[t]];return pl()};pA[Fm]=!0;var Ic=Object.create||function(e,r){var o;return e!==null?(Fu[Yf]=hA(e),o=new Fu,Fu[Yf]=null,o[Fm]=e):o=pl(),r===void 0?o:gA.f(o,r)},yA=Hr,EA=Ic,AA=wr.f,Zf=yA("unscopables"),Qf=Array.prototype;Qf[Zf]===void 0&&AA(Qf,Zf,{configurable:!0,value:EA(null)});var Tc=function(t){Qf[Zf][t]=!0},bA=un,CA=ca,SA=ua,IA=Dd,TA=Tc;bA({target:"Array",proto:!0},{at:function(e){var r=CA(this),o=SA(r),l=IA(e),u=l>=0?l:o+l;return u<0||u>=o?void 0:r[u]}});TA("at");var RA=ft,_A=dt,Ld=function(t,e){return _A(RA[t].prototype[e])},NA=Ld;NA("Array","at");var OA=Li,kA=dt,MA=function(t){if(OA(t)==="Function")return kA(t)},Qh=MA,DA=Rd,PA=Cd,LA=Qh(Qh.bind),Bd=function(t,e){return DA(t),e===void 0?t:PA?LA(t,e):function(){return t.apply(e,arguments)}},BA=Bd,FA=hm,UA=ca,jA=ua,qh=function(t){var e=t===1;return function(r,o,l){for(var u=UA(r),h=FA(u),x=jA(h),w=BA(o,l),m,y;x-- >0;)if(m=h[x],y=w(m,x,u),y)switch(t){case 0:return m;case 1:return x}return e?-1:void 0}},jm={findLast:qh(0),findLastIndex:qh(1)},WA=un,VA=jm.findLast,zA=Tc;WA({target:"Array",proto:!0},{findLast:function(e){return VA(this,e,arguments.length>1?arguments[1]:void 0)}});zA("findLast");var $A=Ld;$A("Array","findLast");var HA=un,GA=jm.findLastIndex,XA=Tc;HA({target:"Array",proto:!0},{findLastIndex:function(e){return GA(this,e,arguments.length>1?arguments[1]:void 0)}});XA("findLastIndex");var YA=Ld;YA("Array","findLastIndex");var KA=Hr,ZA=KA("toStringTag"),Wm={};Wm[ZA]="z";var Fd=String(Wm)==="[object z]",QA=Fd,qA=bt,ml=Li,JA=Hr,eb=JA("toStringTag"),tb=Object,rb=ml(function(){return arguments}())==="Arguments",nb=function(t,e){try{return t[e]}catch{}},Rc=QA?ml:function(t){var e,r,o;return t===void 0?"Undefined":t===null?"Null":typeof(r=nb(e=tb(t),eb))=="string"?r:rb?ml(e):(o=ml(e))==="Object"&&qA(e.callee)?"Arguments":o},ib=Rc,sb=String,ob=function(t){if(ib(t)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return sb(t)},ab=ob,Ud=function(t,e){return t===void 0?arguments.length<2?"":e:ab(t)},lb=Kt,cb=lt,ub=Gr,Jh=Ud,xl=Error.prototype.toString,fb=cb(function(){if(lb){var t=Object.create(Object.defineProperty({},"name",{get:function(){return this===t}}));if(xl.call(t)!=="true")return!0}return xl.call({message:1,name:2})!=="2: 1"||xl.call({})!=="Error"}),Vm=fb?function(){var e=ub(this),r=Jh(e.name,"Error"),o=Jh(e.message);return r?o?r+": "+o:r:o}:xl,db=ni,eg=Vm,tg=Error.prototype;tg.toString!==eg&&db(tg,"toString",eg);var _c=Object.create?Object.create(null):{},hb=lt,gb=!hb(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}),pb=ur,mb=bt,xb=ca,wb=kd,vb=gb,rg=wb("IE_PROTO"),qf=Object,yb=qf.prototype,zm=vb?qf.getPrototypeOf:function(t){var e=xb(t);if(pb(e,rg))return e[rg];var r=e.constructor;return mb(r)&&e instanceof r?r.prototype:e instanceof qf?yb:null},Eb=lt,Ab=bt,bb=xr,ng=zm,Cb=ni,Sb=Hr,Jf=Sb("iterator"),$m=!1,Ti,Uu,ju;[].keys&&(ju=[].keys(),"next"in ju?(Uu=ng(ng(ju)),Uu!==Object.prototype&&(Ti=Uu)):$m=!0);var Ib=!bb(Ti)||Eb(function(){var t={};return Ti[Jf].call(t)!==t});Ib&&(Ti={});Ab(Ti[Jf])||Cb(Ti,Jf,function(){return this});var Hm={IteratorPrototype:Ti,BUGGY_SAFARI_ITERATORS:$m},Tb=wr.f,Rb=ur,_b=Hr,ig=_b("toStringTag"),Nc=function(t,e,r){t&&!r&&(t=t.prototype),t&&!Rb(t,ig)&&Tb(t,ig,{configurable:!0,value:e})},Nb=Hm.IteratorPrototype,Ob=Ic,kb=Pi,Mb=Nc,Db=_c,Pb=function(){return this},Lb=function(t,e,r,o){var l=e+" Iterator";return t.prototype=Ob(Nb,{next:kb(+!o,r)}),Mb(t,l,!1),Db[l]=Pb,t},Bb=dt,Fb=Rd,Ub=function(t,e,r){try{return Bb(Fb(Object.getOwnPropertyDescriptor(t,e)[r]))}catch{}},jb=xr,Wb=function(t){return jb(t)||t===null},Vb=Wb,zb=String,$b=TypeError,Hb=function(t){if(Vb(t))return t;throw new $b("Can't set "+zb(t)+" as a prototype")},Gb=Ub,Xb=xr,Yb=Sd,Kb=Hb,Gm=Object.setPrototypeOf||("__proto__"in{}?function(){var t=!1,e={},r;try{r=Gb(Object.prototype,"__proto__","set"),r(e,[]),t=e instanceof Array}catch{}return function(l,u){return Yb(l),Kb(u),Xb(l)&&(t?r(l,u):l.__proto__=u),l}}():void 0),Zb=un,Qb=In,Xm=Rm,qb=bt,Jb=Lb,sg=zm,og=Gm,eC=Nc,tC=Ac,Wu=ni,rC=Hr,nC=_c,Ym=Hm,iC=Xm.PROPER,sC=Xm.CONFIGURABLE,ag=Ym.IteratorPrototype,Fa=Ym.BUGGY_SAFARI_ITERATORS,Js=rC("iterator"),lg="keys",eo="values",cg="entries",oC=function(){return this},Km=function(t,e,r,o,l,u,h){Jb(r,e,o);var x=function(O){if(O===l&&C)return C;if(!Fa&&O&&O in y)return y[O];switch(O){case lg:return function(){return new r(this,O)};case eo:return function(){return new r(this,O)};case cg:return function(){return new r(this,O)}}return function(){return new r(this)}},w=e+" Iterator",m=!1,y=t.prototype,b=y[Js]||y["@@iterator"]||l&&y[l],C=!Fa&&b||x(l),T=e==="Array"&&y.entries||b,k,D,X;if(T&&(k=sg(T.call(new t)),k!==Object.prototype&&k.next&&(sg(k)!==ag&&(og?og(k,ag):qb(k[Js])||Wu(k,Js,oC)),eC(k,w,!0))),iC&&l===eo&&b&&b.name!==eo&&(sC?tC(y,"name",eo):(m=!0,C=function(){return Qb(b,this)})),l)if(D={values:x(eo),keys:u?C:x(lg),entries:x(cg)},h)for(X in D)(Fa||m||!(X in y))&&Wu(y,X,D[X]);else Zb({target:e,proto:!0,forced:Fa||m},D);return y[Js]!==C&&Wu(y,Js,C,{name:l}),nC[e]=C,D},Zm=function(t,e){return{value:t,done:e}},aC=Bs,jd=Tc,ug=_c,Qm=Cc,lC=wr.f,cC=Km,Ua=Zm,uC=Kt,qm="Array Iterator",fC=Qm.set,dC=Qm.getterFor(qm);cC(Array,"Array",function(t,e){fC(this,{type:qm,target:aC(t),index:0,kind:e})},function(){var t=dC(this),e=t.target,r=t.index++;if(!e||r>=e.length)return t.target=null,Ua(void 0,!0);switch(t.kind){case"keys":return Ua(r,!1);case"values":return Ua(e[r],!1)}return Ua([r,e[r]],!1)},"values");var fg=ug.Arguments=ug.Array;jd("keys");jd("values");jd("entries");if(uC&&fg.name!=="values")try{lC(fg,"name",{value:"values"})}catch{}var hC=un,gC=ca,Jm=Bm,pC=lt,mC=pC(function(){Jm(1)});hC({target:"Object",stat:!0,forced:mC},{keys:function(e){return Jm(gC(e))}});var xC=Fd,wC=Rc,vC=xC?{}.toString:function(){return"[object "+wC(this)+"]"},yC=Fd,EC=ni,AC=vC;yC||EC(Object.prototype,"toString",AC,{unsafe:!0});var ex={exports:{}},tx={},bC=dt,CC=bC([].slice),SC=Li,IC=Bs,rx=Sc.f,TC=CC,nx=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],RC=function(t){try{return rx(t)}catch{return TC(nx)}};tx.f=function(e){return nx&&SC(e)==="Window"?RC(e):rx(IC(e))};var _C=lt,NC=_C(function(){if(typeof ArrayBuffer=="function"){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}}),OC=lt,kC=xr,MC=Li,dg=NC,wl=Object.isExtensible,DC=OC(function(){wl(1)}),PC=DC||dg?function(e){return!kC(e)||dg&&MC(e)==="ArrayBuffer"?!1:wl?wl(e):!0}:wl,LC=lt,BC=!LC(function(){return Object.isExtensible(Object.preventExtensions({}))}),FC=un,UC=dt,jC=bc,WC=xr,Wd=ur,VC=wr.f,hg=Sc,zC=tx,Vd=PC,$C=Ec,HC=BC,ix=!1,yn=$C("meta"),GC=0,zd=function(t){VC(t,yn,{value:{objectID:"O"+GC++,weakData:{}}})},XC=function(t,e){if(!WC(t))return typeof t=="symbol"?t:(typeof t=="string"?"S":"P")+t;if(!Wd(t,yn)){if(!Vd(t))return"F";if(!e)return"E";zd(t)}return t[yn].objectID},YC=function(t,e){if(!Wd(t,yn)){if(!Vd(t))return!0;if(!e)return!1;zd(t)}return t[yn].weakData},KC=function(t){return HC&&ix&&Vd(t)&&!Wd(t,yn)&&zd(t),t},ZC=function(){QC.enable=function(){},ix=!0;var t=hg.f,e=UC([].splice),r={};r[yn]=1,t(r).length&&(hg.f=function(o){for(var l=t(o),u=0,h=l.length;u<h;u++)if(l[u]===yn){e(l,u,1);break}return l},FC({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:zC.f}))},QC=ex.exports={enable:ZC,fastKey:XC,getWeakData:YC,onFreeze:KC};jC[yn]=!0;var sx=ex.exports,qC=Hr,JC=_c,e6=qC("iterator"),t6=Array.prototype,r6=function(t){return t!==void 0&&(JC.Array===t||t6[e6]===t)},n6=Li,i6=Ls,gg=_d,s6=Hr,pg=s6("iterator"),o6=Array.prototype,ox=function(t){if(!i6(t))return gg(t,pg)||gg(t,"@@iterator")||(n6(t)==="Arguments"?o6[pg]:void 0)},a6=In,l6=bt,c6=Gr,u6=Td,f6=ox,d6=TypeError,h6=function(t,e){var r=arguments.length<2?f6(t):e;if(l6(r))return c6(a6(r,t));throw new d6(u6(t)+" is not iterable")},g6=In,mg=Gr,p6=_d,m6=function(t,e,r){var o,l;mg(t);try{if(o=p6(t,"return"),!o){if(e==="throw")throw r;return r}o=g6(o,t)}catch(u){l=!0,o=u}if(e==="throw")throw r;if(l)throw o;return mg(o),r},x6=Bd,w6=In,v6=Gr,y6=Td,E6=r6,A6=ua,xg=yc,b6=h6,C6=ox,wg=m6,S6=TypeError,vl=function(t,e){this.stopped=t,this.result=e},vg=vl.prototype,$d=function(t,e,r){var o=r&&r.that,l=!!(r&&r.AS_ENTRIES),u=!!(r&&r.IS_RECORD),h=!!(r&&r.IS_ITERATOR),x=!!(r&&r.INTERRUPTED),w=x6(e,o),m,y,b,C,T,k,D,X=function(_){var L=m;return m=void 0,L&&wg(L,"normal"),new vl(!0,_)},O=function(_){return l?(v6(_),x?w(_[0],_[1],X):w(_[0],_[1])):x?w(_,X):w(_)};if(u)m=t.iterator;else if(h)m=t;else{if(y=C6(t),!y)throw new S6(y6(t)+" is not iterable");if(E6(y)){for(b=0,C=A6(t);C>b;b++)if(T=O(t[b]),T&&xg(vg,T))return T;return new vl(!1)}m=b6(t,y)}for(k=u?t.next:m.next;!(D=w6(k,m)).done;){var I=D.value;try{T=O(I)}catch(_){if(m)wg(m,"throw",_);else throw _}if(typeof T=="object"&&T&&xg(vg,T))return T}return new vl(!1)},I6=yc,T6=TypeError,Oc=function(t,e){if(I6(e,t))return t;throw new T6("Incorrect invocation")},R6=Hr,ax=R6("iterator"),lx=!1;try{var _6=0,yg={next:function(){return{done:!!_6++}},return:function(){lx=!0}};yg[ax]=function(){return this},Array.from(yg,function(){throw 2})}catch{}var N6=function(t,e){try{if(!e&&!lx)return!1}catch{return!1}var r=!1;try{var o={};o[ax]=function(){return{next:function(){return{done:r=!0}}}},t(o)}catch{}return r},O6=bt,k6=xr,Eg=Gm,cx=function(t,e,r){var o,l;return Eg&&O6(o=e.constructor)&&o!==r&&k6(l=o.prototype)&&l!==r.prototype&&Eg(t,l),t},M6=un,D6=ft,P6=dt,Ag=Pm,L6=ni,B6=sx,F6=$d,U6=Oc,j6=bt,W6=Ls,Vu=xr,zu=lt,V6=N6,z6=Nc,$6=cx,ux=function(t,e,r){var o=t.indexOf("Map")!==-1,l=t.indexOf("Weak")!==-1,u=o?"set":"add",h=D6[t],x=h&&h.prototype,w=h,m={},y=function(O){var I=P6(x[O]);L6(x,O,O==="add"?function(L){return I(this,L===0?0:L),this}:O==="delete"?function(_){return l&&!Vu(_)?!1:I(this,_===0?0:_)}:O==="get"?function(L){return l&&!Vu(L)?void 0:I(this,L===0?0:L)}:O==="has"?function(L){return l&&!Vu(L)?!1:I(this,L===0?0:L)}:function(L,j){return I(this,L===0?0:L,j),this})},b=Ag(t,!j6(h)||!(l||x.forEach&&!zu(function(){new h().entries().next()})));if(b)w=r.getConstructor(e,t,o,u),B6.enable();else if(Ag(t,!0)){var C=new w,T=C[u](l?{}:-0,1)!==C,k=zu(function(){C.has(1)}),D=V6(function(O){new h(O)}),X=!l&&zu(function(){for(var O=new h,I=5;I--;)O[u](I,I);return!O.has(-0)});D||(w=e(function(O,I){U6(O,x);var _=$6(new h,O,w);return W6(I)||F6(I,_[u],{that:_,AS_ENTRIES:o}),_}),w.prototype=x,x.constructor=w),(k||X)&&(y("delete"),y("has"),o&&y("get")),(X||T)&&y(u),l&&x.clear&&delete x.clear}return m[t]=w,M6({global:!0,constructor:!0,forced:w!==h},m),z6(w,t),l||r.setStrong(w,t,o),w},bg=km,H6=wr,Hd=function(t,e,r){return r.get&&bg(r.get,e,{getter:!0}),r.set&&bg(r.set,e,{setter:!0}),H6.f(t,e,r)},G6=ni,X6=function(t,e,r){for(var o in e)G6(t,o,e[o],r);return t},Y6=Tn,K6=Hd,Z6=Hr,Q6=Kt,Cg=Z6("species"),q6=function(t){var e=Y6(t);Q6&&e&&!e[Cg]&&K6(e,Cg,{configurable:!0,get:function(){return this}})},Sg=Ic,J6=Hd,Ig=X6,eS=Bd,tS=Oc,rS=Ls,nS=$d,iS=Km,ja=Zm,sS=q6,to=Kt,Tg=sx.fastKey,fx=Cc,Rg=fx.set,$u=fx.getterFor,dx={getConstructor:function(t,e,r,o){var l=t(function(m,y){tS(m,u),Rg(m,{type:e,index:Sg(null),first:null,last:null,size:0}),to||(m.size=0),rS(y)||nS(y,m[o],{that:m,AS_ENTRIES:r})}),u=l.prototype,h=$u(e),x=function(m,y,b){var C=h(m),T=w(m,y),k,D;return T?T.value=b:(C.last=T={index:D=Tg(y,!0),key:y,value:b,previous:k=C.last,next:null,removed:!1},C.first||(C.first=T),k&&(k.next=T),to?C.size++:m.size++,D!=="F"&&(C.index[D]=T)),m},w=function(m,y){var b=h(m),C=Tg(y),T;if(C!=="F")return b.index[C];for(T=b.first;T;T=T.next)if(T.key===y)return T};return Ig(u,{clear:function(){for(var y=this,b=h(y),C=b.first;C;)C.removed=!0,C.previous&&(C.previous=C.previous.next=null),C=C.next;b.first=b.last=null,b.index=Sg(null),to?b.size=0:y.size=0},delete:function(m){var y=this,b=h(y),C=w(y,m);if(C){var T=C.next,k=C.previous;delete b.index[C.index],C.removed=!0,k&&(k.next=T),T&&(T.previous=k),b.first===C&&(b.first=T),b.last===C&&(b.last=k),to?b.size--:y.size--}return!!C},forEach:function(y){for(var b=h(this),C=eS(y,arguments.length>1?arguments[1]:void 0),T;T=T?T.next:b.first;)for(C(T.value,T.key,this);T&&T.removed;)T=T.previous},has:function(y){return!!w(this,y)}}),Ig(u,r?{get:function(y){var b=w(this,y);return b&&b.value},set:function(y,b){return x(this,y===0?0:y,b)}}:{add:function(y){return x(this,y=y===0?0:y,y)}}),to&&J6(u,"size",{configurable:!0,get:function(){return h(this).size}}),l},setStrong:function(t,e,r){var o=e+" Iterator",l=$u(e),u=$u(o);iS(t,e,function(h,x){Rg(this,{type:o,target:h,state:l(h),kind:x,last:null})},function(){for(var h=u(this),x=h.kind,w=h.last;w&&w.removed;)w=w.previous;return!h.target||!(h.last=w=w?w.next:h.state.first)?(h.target=null,ja(void 0,!0)):ja(x==="keys"?w.key:x==="values"?w.value:[w.key,w.value],!1)},r?"entries":"values",!r,!0),sS(e)}},oS=ux,aS=dx;oS("Map",function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},aS);var lS=ux,cS=dx;lS("Set",function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},cS);var ro=ft,uS=gm,fS=Li,Wa=function(t){return uS.slice(0,t.length)===t},hx=function(){return Wa("Bun/")?"BUN":Wa("Cloudflare-Workers")?"CLOUDFLARE":Wa("Deno/")?"DENO":Wa("Node.js/")?"NODE":ro.Bun&&typeof Bun.version=="string"?"BUN":ro.Deno&&typeof Deno.version=="object"?"DENO":fS(ro.process)==="process"?"NODE":ro.window&&ro.document?"BROWSER":"REST"}(),dS=hx,hS=dS==="NODE",gS=ft,pS=hS,gx=function(t){if(pS){try{return gS.process.getBuiltinModule(t)}catch{}try{return Function('return require("'+t+'")')()}catch{}}},px={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}},mS=dt,mx=Error,xS=mS("".replace),wS=function(t){return String(new mx(t).stack)}("zxcasd"),xx=/\n\s*at [^:]*:[^\n]*/,vS=xx.test(wS),wx=function(t,e){if(vS&&typeof t=="string"&&!mx.prepareStackTrace)for(;e--;)t=xS(t,xx,"");return t},yS=un,Ul=Tn,ES=gx,Gd=lt,AS=Ic,Xd=Pi,jl=wr.f,bS=ni,yl=Hd,El=ur,CS=Oc,SS=Gr,vx=Vm,_g=Ud,ms=px,IS=wx,yx=Cc,Yd=Kt,Cs="DOMException",e1="DATA_CLONE_ERR",kc=Ul("Error"),En=Ul(Cs)||function(){try{var t=Ul("MessageChannel")||ES("worker_threads").MessageChannel;new t().port1.postMessage(new WeakMap)}catch(e){if(e.name===e1&&e.code===25)return e.constructor}}(),TS=En&&En.prototype,Ex=kc.prototype,RS=yx.set,_S=yx.getterFor(Cs),NS="stack"in new kc(Cs),Ax=function(t){return El(ms,t)&&ms[t].m?ms[t].c:0},Kd=function(){CS(this,Ao);var e=arguments.length,r=_g(e<1?void 0:arguments[0]),o=_g(e<2?void 0:arguments[1],"Error"),l=Ax(o);if(RS(this,{type:Cs,name:o,message:r,code:l}),Yd||(this.name=o,this.message=r,this.code=l),NS){var u=new kc(r);u.name=Cs,jl(this,"stack",Xd(1,IS(u.stack,1)))}},Ao=Kd.prototype=AS(Ex),bx=function(t){return{enumerable:!0,configurable:!0,get:t}},Hu=function(t){return bx(function(){return _S(this)[t]})};Yd&&(yl(Ao,"code",Hu("code")),yl(Ao,"message",Hu("message")),yl(Ao,"name",Hu("name")));jl(Ao,"constructor",Xd(1,Kd));var Mc=Gd(function(){return!(new En instanceof kc)}),OS=Mc||Gd(function(){return Ex.toString!==vx||String(new En(1,2))!=="2: 1"}),kS=Mc||Gd(function(){return new En(1,"DataCloneError").code!==25});Mc||En[e1]!==25||TS[e1];var Ng=Mc;yS({global:!0,constructor:!0,forced:Ng},{DOMException:Ng?Kd:En});var Bo=Ul(Cs),Wl=Bo.prototype;OS&&En===Bo&&bS(Wl,"toString",vx);kS&&Yd&&En===Bo&&yl(Wl,"code",bx(function(){return Ax(SS(this).name)}));for(var Og in ms)if(El(ms,Og)){var kg=ms[Og],Va=kg.s,Mg=Xd(6,kg.c);El(Bo,Va)||jl(Bo,Va,Mg),El(Wl,Va)||jl(Wl,Va,Mg)}var MS=un,DS=ft,Zd=Tn,t1=Pi,r1=wr.f,Dg=ur,PS=Oc,LS=cx,Pg=Ud,Gu=px,BS=wx,FS=Kt,da="DOMException",Cx=Zd("Error"),ha=Zd(da),Qd=function(){PS(this,US);var e=arguments.length,r=Pg(e<1?void 0:arguments[0]),o=Pg(e<2?void 0:arguments[1],"Error"),l=new ha(r,o),u=new Cx(r);return u.name=da,r1(l,"stack",t1(1,BS(u.stack,1))),LS(l,this,Qd),l},US=Qd.prototype=ha.prototype,jS="stack"in new Cx(da),WS="stack"in new ha(1,2),Xu=ha&&FS&&Object.getOwnPropertyDescriptor(DS,da),VS=!!Xu&&!(Xu.writable&&Xu.configurable),Lg=jS&&!VS&&!WS;MS({global:!0,constructor:!0,forced:Lg},{DOMException:Lg?Qd:ha});var go=Zd(da),Bg=go.prototype;if(Bg.constructor!==go){r1(Bg,"constructor",t1(1,go));for(var Fg in Gu)if(Dg(Gu,Fg)){var Ug=Gu[Fg],jg=Ug.s;Dg(go,jg)||r1(go,jg,t1(6,Ug.c))}}var zS=Tn,$S=Nc,Wg="DOMException";$S(zS(Wg),Wg);var HS=dt,GS=lt,Sx=bt,XS=Rc,YS=Tn,KS=_m,Ix=function(){},Tx=YS("Reflect","construct"),qd=/^\s*(?:class|function)\b/,ZS=HS(qd.exec),QS=!qd.test(Ix),no=function(e){if(!Sx(e))return!1;try{return Tx(Ix,[],e),!0}catch{return!1}},Rx=function(e){if(!Sx(e))return!1;switch(XS(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return QS||!!ZS(qd,KS(e))}catch{return!0}};Rx.sham=!0;var qS=!Tx||GS(function(){var t;return no(no.call)||!no(Object)||!no(function(){t=!0})||t})?Rx:no,JS=Kt,eI=wr,tI=Pi,rI=function(t,e,r){JS?eI.f(t,e,tI(0,r)):t[e]=r},nI=TypeError,iI=function(t,e){if(t<e)throw new nI("Not enough arguments");return t},sI=ft,oI=lt,Vg=sI.RegExp,aI=!oI(function(){var t=!0;try{Vg(".","d")}catch{t=!1}var e={},r="",o=t?"dgimsy":"gimsy",l=function(w,m){Object.defineProperty(e,w,{get:function(){return r+=m,!0}})},u={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};t&&(u.hasIndices="d");for(var h in u)l(h,u[h]);var x=Object.getOwnPropertyDescriptor(Vg.prototype,"flags").get.call(e);return x!==o||r!==o}),lI={correct:aI},cI=Gr,uI=function(){var t=cI(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.unicodeSets&&(e+="v"),t.sticky&&(e+="y"),e},fI=In,dI=ur,hI=yc,zg=lI,gI=uI,pI=RegExp.prototype,mI=zg.correct?function(t){return t.flags}:function(t){return!zg.correct&&hI(pI,t)&&!dI(t,"flags")?fI(gI,t):t.flags},za=dt,$a=Map.prototype,xI={Map,set:za($a.set),get:za($a.get),has:za($a.has),remove:za($a.delete)},Yu=dt,Ha=Set.prototype,_x={Set,add:Yu(Ha.add),has:Yu(Ha.has),remove:Yu(Ha.delete),proto:Ha},wI=In,vI=function(t,e,r){for(var o=r?t:t.iterator,l=t.next,u,h;!(u=wI(l,o)).done;)if(h=e(u.value),h!==void 0)return h},Nx=dt,yI=vI,Ox=_x,EI=Ox.Set,kx=Ox.proto,AI=Nx(kx.forEach),Mx=Nx(kx.keys),bI=Mx(new EI).next,CI=function(t,e,r){return r?yI({iterator:Mx(t),next:bI},e):AI(t,e)},SI=ft,II=lt,Ku=mm,Zu=hx,$g=SI.structuredClone,Dx=!!$g&&!II(function(){if(Zu==="DENO"&&Ku>92||Zu==="NODE"&&Ku>94||Zu==="BROWSER"&&Ku>97)return!1;var t=new ArrayBuffer(8),e=$g(t,{transfer:[t]});return t.byteLength!==0||e.byteLength!==8}),Jd=ft,TI=gx,RI=Dx,_I=Jd.structuredClone,Hg=Jd.ArrayBuffer,Ga=Jd.MessageChannel,n1=!1,Qu,Gg,Xa,qu;if(RI)n1=function(t){_I(t,{transfer:[t]})};else if(Hg)try{Ga||(Qu=TI("worker_threads"),Qu&&(Ga=Qu.MessageChannel)),Ga&&(Gg=new Ga,Xa=new Hg(2),qu=function(t){Gg.port1.postMessage(null,[t])},Xa.byteLength===2&&(qu(Xa),Xa.byteLength===0&&(n1=qu)))}catch{}var NI=n1,OI=lt,kI=Pi,MI=!OI(function(){var t=new Error("a");return"stack"in t?(Object.defineProperty(t,"stack",kI(1,7)),t.stack!==7):!0}),DI=un,Pt=ft,bo=Tn,ga=dt,e0=lt,PI=Ec,Ss=bt,LI=qS,BI=Ls,Dc=xr,FI=Id,UI=$d,Px=Gr,Vl=Rc,jI=ur,WI=rI,Ju=Ac,Al=ua,VI=iI,zI=mI,Pc=xI,t0=_x,$I=CI,Xg=NI,HI=MI,r0=Dx,po=Pt.Object,GI=Pt.Array,Lx=Pt.Date,Bx=Pt.Error,XI=Pt.TypeError,YI=Pt.PerformanceMark,Ri=bo("DOMException"),i1=Pc.Map,n0=Pc.has,Fx=Pc.get,zl=Pc.set,Ux=t0.Set,jx=t0.add,KI=t0.has,ZI=bo("Object","keys"),QI=ga([].push),qI=ga((!0).valueOf),JI=ga(1.1.valueOf),e5=ga("".valueOf),t5=ga(Lx.prototype.getTime),s1=PI("structuredClone"),Fo="DataCloneError",bl="Transferring",Wx=function(t){return!e0(function(){var e=new Pt.Set([7]),r=t(e),o=t(po(7));return r===e||!r.has(7)||!Dc(o)||+o!=7})&&t},Yg=function(t,e){return!e0(function(){var r=new e,o=t({a:r,b:r});return!(o&&o.a===o.b&&o.a instanceof e&&o.a.stack===r.stack)})},r5=function(t){return!e0(function(){var e=t(new Pt.AggregateError([1],s1,{cause:3}));return e.name!=="AggregateError"||e.errors[0]!==1||e.message!==s1||e.cause!==3})},Ai=Pt.structuredClone,n5=!Yg(Ai,Bx)||!Yg(Ai,Ri)||!r5(Ai),i5=!Ai&&Wx(function(t){return new YI(s1,{detail:t}).detail}),zn=Wx(Ai)||i5,ef=function(t){throw new Ri("Uncloneable type: "+t,Fo)},ir=function(t,e){throw new Ri((e||"Cloning")+" of "+t+" cannot be properly polyfilled in this engine",Fo)},tf=function(t,e){return zn||ir(e),zn(t)},s5=function(){var t;try{t=new Pt.DataTransfer}catch{try{t=new Pt.ClipboardEvent("").clipboardData}catch{}}return t&&t.items&&t.files?t:null},Vx=function(t,e,r){if(n0(e,t))return Fx(e,t);var o=r||Vl(t),l,u,h,x,w,m;if(o==="SharedArrayBuffer")zn?l=zn(t):l=t;else{var y=Pt.DataView;!y&&!Ss(t.slice)&&ir("ArrayBuffer");try{if(Ss(t.slice)&&!t.resizable)l=t.slice(0);else for(u=t.byteLength,h=("maxByteLength"in t)?{maxByteLength:t.maxByteLength}:void 0,l=new ArrayBuffer(u,h),x=new y(t),w=new y(l),m=0;m<u;m++)w.setUint8(m,x.getUint8(m))}catch{throw new Ri("ArrayBuffer is detached",Fo)}}return zl(e,t,l),l},o5=function(t,e,r,o,l){var u=Pt[e];return Dc(u)||ir(e),new u(Vx(t.buffer,l),r,o)},Mt=function(t,e){if(FI(t)&&ef("Symbol"),!Dc(t))return t;if(e){if(n0(e,t))return Fx(e,t)}else e=new i1;var r=Vl(t),o,l,u,h,x,w,m,y;switch(r){case"Array":u=GI(Al(t));break;case"Object":u={};break;case"Map":u=new i1;break;case"Set":u=new Ux;break;case"RegExp":u=new RegExp(t.source,zI(t));break;case"Error":switch(l=t.name,l){case"AggregateError":u=new(bo(l))([]);break;case"EvalError":case"RangeError":case"ReferenceError":case"SuppressedError":case"SyntaxError":case"TypeError":case"URIError":u=new(bo(l));break;case"CompileError":case"LinkError":case"RuntimeError":u=new(bo("WebAssembly",l));break;default:u=new Bx}break;case"DOMException":u=new Ri(t.message,t.name);break;case"ArrayBuffer":case"SharedArrayBuffer":u=Vx(t,e,r);break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float16Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":w=r==="DataView"?t.byteLength:t.length,u=o5(t,r,t.byteOffset,w,e);break;case"DOMQuad":try{u=new DOMQuad(Mt(t.p1,e),Mt(t.p2,e),Mt(t.p3,e),Mt(t.p4,e))}catch{u=tf(t,r)}break;case"File":if(zn)try{u=zn(t),Vl(u)!==r&&(u=void 0)}catch{}if(!u)try{u=new File([t],t.name,t)}catch{}u||ir(r);break;case"FileList":if(h=s5(),h){for(x=0,w=Al(t);x<w;x++)h.items.add(Mt(t[x],e));u=h.files}else u=tf(t,r);break;case"ImageData":try{u=new ImageData(Mt(t.data,e),t.width,t.height,{colorSpace:t.colorSpace})}catch{u=tf(t,r)}break;default:if(zn)u=zn(t);else switch(r){case"BigInt":u=po(t.valueOf());break;case"Boolean":u=po(qI(t));break;case"Number":u=po(JI(t));break;case"String":u=po(e5(t));break;case"Date":u=new Lx(t5(t));break;case"Blob":try{u=t.slice(0,t.size,t.type)}catch{ir(r)}break;case"DOMPoint":case"DOMPointReadOnly":o=Pt[r];try{u=o.fromPoint?o.fromPoint(t):new o(t.x,t.y,t.z,t.w)}catch{ir(r)}break;case"DOMRect":case"DOMRectReadOnly":o=Pt[r];try{u=o.fromRect?o.fromRect(t):new o(t.x,t.y,t.width,t.height)}catch{ir(r)}break;case"DOMMatrix":case"DOMMatrixReadOnly":o=Pt[r];try{u=o.fromMatrix?o.fromMatrix(t):new o(t)}catch{ir(r)}break;case"AudioData":case"VideoFrame":Ss(t.clone)||ir(r);try{u=t.clone()}catch{ef(r)}break;case"CropTarget":case"CryptoKey":case"FileSystemDirectoryHandle":case"FileSystemFileHandle":case"FileSystemHandle":case"GPUCompilationInfo":case"GPUCompilationMessage":case"ImageBitmap":case"RTCCertificate":case"WebAssembly.Module":ir(r);default:ef(r)}}switch(zl(e,t,u),r){case"Array":case"Object":for(m=ZI(t),x=0,w=Al(m);x<w;x++)y=m[x],WI(u,y,Mt(t[y],e));break;case"Map":t.forEach(function(b,C){zl(u,Mt(C,e),Mt(b,e))});break;case"Set":t.forEach(function(b){jx(u,Mt(b,e))});break;case"Error":Ju(u,"message",Mt(t.message,e)),jI(t,"cause")&&Ju(u,"cause",Mt(t.cause,e)),l==="AggregateError"?u.errors=Mt(t.errors,e):l==="SuppressedError"&&(u.error=Mt(t.error,e),u.suppressed=Mt(t.suppressed,e));case"DOMException":HI&&Ju(u,"stack",Mt(t.stack,e))}return u},a5=function(t,e){if(!Dc(t))throw new XI("Transfer option cannot be converted to a sequence");var r=[];UI(t,function(C){QI(r,Px(C))});for(var o=0,l=Al(r),u=new Ux,h,x,w,m,y,b;o<l;){if(h=r[o++],x=Vl(h),m=void 0,x==="ArrayBuffer"?KI(u,h):n0(e,h))throw new Ri("Duplicate transferable",Fo);if(x==="ArrayBuffer"){jx(u,h);continue}if(r0)m=Ai(h,{transfer:[h]});else switch(x){case"ImageBitmap":w=Pt.OffscreenCanvas,LI(w)||ir(x,bl);try{y=new w(h.width,h.height),b=y.getContext("bitmaprenderer"),b.transferFromImageBitmap(h),m=y.transferToImageBitmap()}catch{}break;case"AudioData":case"VideoFrame":(!Ss(h.clone)||!Ss(h.close))&&ir(x,bl);try{m=h.clone(),h.close()}catch{}break;case"MediaSourceHandle":case"MessagePort":case"MIDIAccess":case"OffscreenCanvas":case"ReadableStream":case"RTCDataChannel":case"TransformStream":case"WebTransportReceiveStream":case"WebTransportSendStream":case"WritableStream":ir(x,bl)}if(m===void 0)throw new Ri("This object cannot be transferred: "+x,Fo);zl(e,h,m)}return u},l5=function(t){$I(t,function(e){r0?Ai(e,{transfer:[e]}):Ss(e.transfer)?e.transfer():Xg?Xg(e):ir("ArrayBuffer",bl)})};DI({global:!0,enumerable:!0,sham:!r0,forced:n5},{structuredClone:function(e){var r=VI(arguments.length,1)>1&&!BI(arguments[1])?Px(arguments[1]):void 0,o=r?r.transfer:void 0,l,u;o!==void 0&&(l=new i1,u=a5(o,l));var h=Mt(e,l);return u&&l5(u),h}});var c5=ft,u5=c5,f5=u5;f5.structuredClone;function d5(){typeof AbortSignal.timeout!="function"&&Object.defineProperty(AbortSignal,"timeout",{configurable:!0,writable:!0,value:t=>{const e=new AbortController;return setTimeout(()=>{e.abort(new DOMException("The operation timed out.","TimeoutError"))},t),e.signal}})}const h5=ie.createContext(null),g5=ie.createContext(null),p5={},Kg=t=>{let e;const r=new Set,o=(y,b)=>{const C=typeof y=="function"?y(e):y;if(!Object.is(C,e)){const T=e;e=b??(typeof C!="object"||C===null)?C:Object.assign({},e,C),r.forEach(k=>k(e,T))}},l=()=>e,w={setState:o,getState:l,getInitialState:()=>m,subscribe:y=>(r.add(y),()=>r.delete(y)),destroy:()=>{(p5?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},m=e=t(o,l,w);return w},m5=t=>t?Kg(t):Kg;var zx={exports:{}},$x={},Hx={exports:{}},Gx={};/**
19
+ * @license React
20
+ * use-sync-external-store-shim.production.js
21
+ *
22
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
23
+ *
24
+ * This source code is licensed under the MIT license found in the
25
+ * LICENSE file in the root directory of this source tree.
26
+ */var Is=ie;function x5(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var w5=typeof Object.is=="function"?Object.is:x5,v5=Is.useState,y5=Is.useEffect,E5=Is.useLayoutEffect,A5=Is.useDebugValue;function b5(t,e){var r=e(),o=v5({inst:{value:r,getSnapshot:e}}),l=o[0].inst,u=o[1];return E5(function(){l.value=r,l.getSnapshot=e,rf(l)&&u({inst:l})},[t,r,e]),y5(function(){return rf(l)&&u({inst:l}),t(function(){rf(l)&&u({inst:l})})},[t]),A5(r),r}function rf(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!w5(t,r)}catch{return!0}}function C5(t,e){return e()}var S5=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?C5:b5;Gx.useSyncExternalStore=Is.useSyncExternalStore!==void 0?Is.useSyncExternalStore:S5;Hx.exports=Gx;var I5=Hx.exports;/**
27
+ * @license React
28
+ * use-sync-external-store-shim/with-selector.production.js
29
+ *
30
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
31
+ *
32
+ * This source code is licensed under the MIT license found in the
33
+ * LICENSE file in the root directory of this source tree.
34
+ */var Lc=ie,T5=I5;function R5(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var _5=typeof Object.is=="function"?Object.is:R5,N5=T5.useSyncExternalStore,O5=Lc.useRef,k5=Lc.useEffect,M5=Lc.useMemo,D5=Lc.useDebugValue;$x.useSyncExternalStoreWithSelector=function(t,e,r,o,l){var u=O5(null);if(u.current===null){var h={hasValue:!1,value:null};u.current=h}else h=u.current;u=M5(function(){function w(T){if(!m){if(m=!0,y=T,T=o(T),l!==void 0&&h.hasValue){var k=h.value;if(l(k,T))return b=k}return b=T}if(k=b,_5(y,T))return k;var D=o(T);return l!==void 0&&l(k,D)?(y=T,k):(y=T,b=D)}var m=!1,y,b,C=r===void 0?null:r;return[function(){return w(e())},C===null?void 0:function(){return w(C())}]},[e,r,o,l]);var x=N5(t,u[0],u[1]);return k5(function(){h.hasValue=!0,h.value=x},[x]),D5(x),x};zx.exports=$x;var P5=zx.exports;const L5=Y2(P5),Xx={},{useDebugValue:B5}=O3,{useSyncExternalStoreWithSelector:F5}=L5;let Zg=!1;const U5=t=>t;function j5(t,e=U5,r){(Xx?"production":void 0)!=="production"&&r&&!Zg&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Zg=!0);const o=F5(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,r);return B5(o),o}const Qg=t=>{(Xx?"production":void 0)!=="production"&&typeof t!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e=typeof t=="function"?m5(t):t,r=(o,l)=>j5(e,o,l);return Object.assign(r,e),r},W5=t=>t?Qg(t):Qg,V5={};function z5(t,e){let r;try{r=t()}catch{return}return{getItem:l=>{var u;const h=w=>w===null?null:JSON.parse(w,void 0),x=(u=r.getItem(l))!=null?u:null;return x instanceof Promise?x.then(h):h(x)},setItem:(l,u)=>r.setItem(l,JSON.stringify(u,void 0)),removeItem:l=>r.removeItem(l)}}const Uo=t=>e=>{try{const r=t(e);return r instanceof Promise?r:{then(o){return Uo(o)(r)},catch(o){return this}}}catch(r){return{then(o){return this},catch(o){return Uo(o)(r)}}}},$5=(t,e)=>(r,o,l)=>{let u={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:X=>X,version:0,merge:(X,O)=>({...O,...X}),...e},h=!1;const x=new Set,w=new Set;let m;try{m=u.getStorage()}catch{}if(!m)return t((...X)=>{console.warn(`[zustand persist middleware] Unable to update item '${u.name}', the given storage is currently unavailable.`),r(...X)},o,l);const y=Uo(u.serialize),b=()=>{const X=u.partialize({...o()});let O;const I=y({state:X,version:u.version}).then(_=>m.setItem(u.name,_)).catch(_=>{O=_});if(O)throw O;return I},C=l.setState;l.setState=(X,O)=>{C(X,O),b()};const T=t((...X)=>{r(...X),b()},o,l);let k;const D=()=>{var X;if(!m)return;h=!1,x.forEach(I=>I(o()));const O=((X=u.onRehydrateStorage)==null?void 0:X.call(u,o()))||void 0;return Uo(m.getItem.bind(m))(u.name).then(I=>{if(I)return u.deserialize(I)}).then(I=>{if(I)if(typeof I.version=="number"&&I.version!==u.version){if(u.migrate)return u.migrate(I.state,I.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return I.state}).then(I=>{var _;return k=u.merge(I,(_=o())!=null?_:T),r(k,!0),b()}).then(()=>{O==null||O(k,void 0),h=!0,w.forEach(I=>I(k))}).catch(I=>{O==null||O(void 0,I)})};return l.persist={setOptions:X=>{u={...u,...X},X.getStorage&&(m=X.getStorage())},clearStorage:()=>{m==null||m.removeItem(u.name)},getOptions:()=>u,rehydrate:()=>D(),hasHydrated:()=>h,onHydrate:X=>(x.add(X),()=>{x.delete(X)}),onFinishHydration:X=>(w.add(X),()=>{w.delete(X)})},D(),k||T},H5=(t,e)=>(r,o,l)=>{let u={storage:z5(()=>localStorage),partialize:D=>D,version:0,merge:(D,X)=>({...X,...D}),...e},h=!1;const x=new Set,w=new Set;let m=u.storage;if(!m)return t((...D)=>{console.warn(`[zustand persist middleware] Unable to update item '${u.name}', the given storage is currently unavailable.`),r(...D)},o,l);const y=()=>{const D=u.partialize({...o()});return m.setItem(u.name,{state:D,version:u.version})},b=l.setState;l.setState=(D,X)=>{b(D,X),y()};const C=t((...D)=>{r(...D),y()},o,l);l.getInitialState=()=>C;let T;const k=()=>{var D,X;if(!m)return;h=!1,x.forEach(I=>{var _;return I((_=o())!=null?_:C)});const O=((X=u.onRehydrateStorage)==null?void 0:X.call(u,(D=o())!=null?D:C))||void 0;return Uo(m.getItem.bind(m))(u.name).then(I=>{if(I)if(typeof I.version=="number"&&I.version!==u.version){if(u.migrate)return[!0,u.migrate(I.state,I.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,I.state];return[!1,void 0]}).then(I=>{var _;const[L,j]=I;if(T=u.merge(j,(_=o())!=null?_:C),r(T,!0),L)return y()}).then(()=>{O==null||O(T,void 0),T=o(),h=!0,w.forEach(I=>I(T))}).catch(I=>{O==null||O(void 0,I)})};return l.persist={setOptions:D=>{u={...u,...D},D.storage&&(m=D.storage)},clearStorage:()=>{m==null||m.removeItem(u.name)},getOptions:()=>u,rehydrate:()=>k(),hasHydrated:()=>h,onHydrate:D=>(x.add(D),()=>{x.delete(D)}),onFinishHydration:D=>(w.add(D),()=>{w.delete(D)})},u.skipHydration||k(),T||C},G5=(t,e)=>"getStorage"in e||"serialize"in e||"deserialize"in e?((V5?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),$5(t,e)):H5(t,e),X5=G5;function Yx(){return typeof document<"u"&&document.body.dataset.webShell==="1"}function Kx(){return typeof navigator>"u"?!1:Yx()||!/Electron\//i.test(navigator.userAgent)}function $N(t=900){const[e,r]=ie.useState(()=>typeof window<"u"&&window.innerWidth<t);return ie.useEffect(()=>{const o=window.matchMedia(`(max-width: ${t-1}px)`),l=u=>r(u.matches);return r(o.matches),o.addEventListener("change",l),()=>o.removeEventListener("change",l)},[t]),e}const HN={classic:"原布局","agent-rail":"单层抬头","all-sessions":"所有会话"},Y5="agent-rail",K5="agent-web-shell:navigation-layout:v1";function Zx(t){return t==="classic"||t==="agent-rail"||t==="all-sessions"}function Z5(t){if(!t||typeof t!="object")return null;const e=t;return e.type===K5&&Zx(e.navigationLayout)?e.navigationLayout:null}const qg=[{id:"glass",label:"毛玻璃",preview:["#c3dbee","#357b88"]},{id:"pearl",label:"珍珠白",preview:["#f5f6fa","#4f6ef7"]},{id:"scifi",label:"科幻霓虹",preview:["#050a14","#22d3ee"]},{id:"noir",label:"暗夜黑",preview:["#0f1115","#a78bfa"]},{id:"mist",label:"雾白靛蓝",preview:["#f7f8fb","#4258c4"]},{id:"pine",label:"暖灰松绿",preview:["#f6f7f3","#356c55"]},{id:"graphite",label:"石墨夜色",preview:["#202630","#a4bad2"]}],GN=[{id:"standard",label:"标准",description:"侧边栏 + 对话区"},{id:"focus",label:"专注",description:"隐藏侧边栏,居中沉浸对话"},{id:"compact",label:"紧凑",description:"更小间距与字号,信息密度优先"}],Q5=5;function Qx(t){return Array.isArray(t)?[...new Set(t.filter(e=>typeof e=="string"&&e.length>0))]:[]}function q5(t,e){const r=t??{};return{...r.skin!==void 0?{skin:r.skin}:{},...r.layout!==void 0?{layout:r.layout}:{},...Zx(r.navigationLayout)?{navigationLayout:r.navigationLayout}:{},...r.wakeEnabled!==void 0?{wakeEnabled:r.wakeEnabled}:{},...r.wakeWord!==void 0?{wakeWord:r.wakeWord}:{},...r.runningFirst!==void 0?{runningFirst:r.runningFirst}:{},...typeof r.dashboardSessionsMerged=="boolean"?{dashboardSessionsMerged:r.dashboardSessionsMerged}:{},pinnedSessionIds:Qx(r.pinnedSessionIds),...e<4&&Kx()?{wakeEnabled:!1}:{}}}function J5(t=Kx()){return!t}const bi=W5()(X5(t=>({skin:"pearl",layout:"standard",navigationLayout:Y5,wakeEnabled:J5(),wakeWord:"小智",runningFirst:!1,dashboardSessionsMerged:!1,pinnedSessionIds:[],setSkin:e=>t({skin:e}),setLayout:e=>t({layout:e}),setNavigationLayout:e=>t({navigationLayout:e}),setWakeEnabled:e=>t({wakeEnabled:e}),setWakeWord:e=>t({wakeWord:e}),setRunningFirst:e=>t({runningFirst:e}),setDashboardSessionsMerged:e=>t({dashboardSessionsMerged:e}),togglePinnedSession:e=>t(r=>({pinnedSessionIds:r.pinnedSessionIds.includes(e)?r.pinnedSessionIds.filter(o=>o!==e):Qx([...r.pinnedSessionIds,e])})),removePinnedSessions:e=>t(r=>{const o=new Set(e);return{pinnedSessionIds:r.pinnedSessionIds.filter(l=>!o.has(l))}})}),{name:"agent-ui-prefs",version:Q5,migrate:q5}));var qx={exports:{}},vr={},Jx={exports:{}},ew={};/**
35
+ * @license React
36
+ * scheduler.production.min.js
37
+ *
38
+ * Copyright (c) Facebook, Inc. and its affiliates.
39
+ *
40
+ * This source code is licensed under the MIT license found in the
41
+ * LICENSE file in the root directory of this source tree.
42
+ */(function(t){function e(ne,fe){var he=ne.length;ne.push(fe);e:for(;0<he;){var Pe=he-1>>>1,Te=ne[Pe];if(0<l(Te,fe))ne[Pe]=fe,ne[he]=Te,he=Pe;else break e}}function r(ne){return ne.length===0?null:ne[0]}function o(ne){if(ne.length===0)return null;var fe=ne[0],he=ne.pop();if(he!==fe){ne[0]=he;e:for(var Pe=0,Te=ne.length,Er=Te>>>1;Pe<Er;){var Qe=2*(Pe+1)-1,ai=ne[Qe],ue=Qe+1,_n=ne[ue];if(0>l(ai,he))ue<Te&&0>l(_n,ai)?(ne[Pe]=_n,ne[ue]=he,Pe=ue):(ne[Pe]=ai,ne[Qe]=he,Pe=Qe);else if(ue<Te&&0>l(_n,he))ne[Pe]=_n,ne[ue]=he,Pe=ue;else break e}}return fe}function l(ne,fe){var he=ne.sortIndex-fe.sortIndex;return he!==0?he:ne.id-fe.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;t.unstable_now=function(){return u.now()}}else{var h=Date,x=h.now();t.unstable_now=function(){return h.now()-x}}var w=[],m=[],y=1,b=null,C=3,T=!1,k=!1,D=!1,X=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(ne){for(var fe=r(m);fe!==null;){if(fe.callback===null)o(m);else if(fe.startTime<=ne)o(m),fe.sortIndex=fe.expirationTime,e(w,fe);else break;fe=r(m)}}function L(ne){if(D=!1,_(ne),!k)if(r(w)!==null)k=!0,De(j);else{var fe=r(m);fe!==null&&pe(L,fe.startTime-ne)}}function j(ne,fe){k=!1,D&&(D=!1,O(Y),Y=-1),T=!0;var he=C;try{for(_(fe),b=r(w);b!==null&&(!(b.expirationTime>fe)||ne&&!ve());){var Pe=b.callback;if(typeof Pe=="function"){b.callback=null,C=b.priorityLevel;var Te=Pe(b.expirationTime<=fe);fe=t.unstable_now(),typeof Te=="function"?b.callback=Te:b===r(w)&&o(w),_(fe)}else o(w);b=r(w)}if(b!==null)var Er=!0;else{var Qe=r(m);Qe!==null&&pe(L,Qe.startTime-fe),Er=!1}return Er}finally{b=null,C=he,T=!1}}var U=!1,F=null,Y=-1,$=5,se=-1;function ve(){return!(t.unstable_now()-se<$)}function Q(){if(F!==null){var ne=t.unstable_now();se=ne;var fe=!0;try{fe=F(!0,ne)}finally{fe?xe():(U=!1,F=null)}}else U=!1}var xe;if(typeof I=="function")xe=function(){I(Q)};else if(typeof MessageChannel<"u"){var re=new MessageChannel,z=re.port2;re.port1.onmessage=Q,xe=function(){z.postMessage(null)}}else xe=function(){X(Q,0)};function De(ne){F=ne,U||(U=!0,xe())}function pe(ne,fe){Y=X(function(){ne(t.unstable_now())},fe)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(ne){ne.callback=null},t.unstable_continueExecution=function(){k||T||(k=!0,De(j))},t.unstable_forceFrameRate=function(ne){0>ne||125<ne?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):$=0<ne?Math.floor(1e3/ne):5},t.unstable_getCurrentPriorityLevel=function(){return C},t.unstable_getFirstCallbackNode=function(){return r(w)},t.unstable_next=function(ne){switch(C){case 1:case 2:case 3:var fe=3;break;default:fe=C}var he=C;C=fe;try{return ne()}finally{C=he}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(ne,fe){switch(ne){case 1:case 2:case 3:case 4:case 5:break;default:ne=3}var he=C;C=ne;try{return fe()}finally{C=he}},t.unstable_scheduleCallback=function(ne,fe,he){var Pe=t.unstable_now();switch(typeof he=="object"&&he!==null?(he=he.delay,he=typeof he=="number"&&0<he?Pe+he:Pe):he=Pe,ne){case 1:var Te=-1;break;case 2:Te=250;break;case 5:Te=1073741823;break;case 4:Te=1e4;break;default:Te=5e3}return Te=he+Te,ne={id:y++,callback:fe,priorityLevel:ne,startTime:he,expirationTime:Te,sortIndex:-1},he>Pe?(ne.sortIndex=he,e(m,ne),r(w)===null&&ne===r(m)&&(D?(O(Y),Y=-1):D=!0,pe(L,he-Pe))):(ne.sortIndex=Te,e(w,ne),k||T||(k=!0,De(j))),ne},t.unstable_shouldYield=ve,t.unstable_wrapCallback=function(ne){var fe=C;return function(){var he=C;C=fe;try{return ne.apply(this,arguments)}finally{C=he}}}})(ew);Jx.exports=ew;var e7=Jx.exports;/**
43
+ * @license React
44
+ * react-dom.production.min.js
45
+ *
46
+ * Copyright (c) Facebook, Inc. and its affiliates.
47
+ *
48
+ * This source code is licensed under the MIT license found in the
49
+ * LICENSE file in the root directory of this source tree.
50
+ */var t7=ie,mr=e7;function q(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=1;r<arguments.length;r++)e+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var tw=new Set,jo={};function Bi(t,e){Ts(t,e),Ts(t+"Capture",e)}function Ts(t,e){for(jo[t]=e,t=0;t<e.length;t++)tw.add(e[t])}var An=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),o1=Object.prototype.hasOwnProperty,r7=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Jg={},ep={};function n7(t){return o1.call(ep,t)?!0:o1.call(Jg,t)?!1:r7.test(t)?ep[t]=!0:(Jg[t]=!0,!1)}function i7(t,e,r,o){if(r!==null&&r.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return o?!1:r!==null?!r.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function s7(t,e,r,o){if(e===null||typeof e>"u"||i7(t,e,r,o))return!0;if(o)return!1;if(r!==null)switch(r.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Zt(t,e,r,o,l,u,h){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=o,this.attributeNamespace=l,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=u,this.removeEmptyString=h}var Bt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Bt[t]=new Zt(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Bt[e]=new Zt(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Bt[t]=new Zt(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Bt[t]=new Zt(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){Bt[t]=new Zt(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Bt[t]=new Zt(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Bt[t]=new Zt(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Bt[t]=new Zt(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Bt[t]=new Zt(t,5,!1,t.toLowerCase(),null,!1,!1)});var i0=/[\-:]([a-z])/g;function s0(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(i0,s0);Bt[e]=new Zt(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(i0,s0);Bt[e]=new Zt(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(i0,s0);Bt[e]=new Zt(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Bt[t]=new Zt(t,1,!1,t.toLowerCase(),null,!1,!1)});Bt.xlinkHref=new Zt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Bt[t]=new Zt(t,1,!1,t.toLowerCase(),null,!0,!0)});function o0(t,e,r,o){var l=Bt.hasOwnProperty(e)?Bt[e]:null;(l!==null?l.type!==0:o||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(s7(e,r,l,o)&&(r=null),o||l===null?n7(e)&&(r===null?t.removeAttribute(e):t.setAttribute(e,""+r)):l.mustUseProperty?t[l.propertyName]=r===null?l.type===3?!1:"":r:(e=l.attributeName,o=l.attributeNamespace,r===null?t.removeAttribute(e):(l=l.type,r=l===3||l===4&&r===!0?"":""+r,o?t.setAttributeNS(o,e,r):t.setAttribute(e,r))))}var Rn=t7.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ya=Symbol.for("react.element"),rs=Symbol.for("react.portal"),ns=Symbol.for("react.fragment"),a0=Symbol.for("react.strict_mode"),a1=Symbol.for("react.profiler"),rw=Symbol.for("react.provider"),nw=Symbol.for("react.context"),l0=Symbol.for("react.forward_ref"),l1=Symbol.for("react.suspense"),c1=Symbol.for("react.suspense_list"),c0=Symbol.for("react.memo"),Fn=Symbol.for("react.lazy"),iw=Symbol.for("react.offscreen"),tp=Symbol.iterator;function io(t){return t===null||typeof t!="object"?null:(t=tp&&t[tp]||t["@@iterator"],typeof t=="function"?t:null)}var rt=Object.assign,nf;function mo(t){if(nf===void 0)try{throw Error()}catch(r){var e=r.stack.trim().match(/\n( *(at )?)/);nf=e&&e[1]||""}return`
51
+ `+nf+t}var sf=!1;function of(t,e){if(!t||sf)return"";sf=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(m){var o=m}Reflect.construct(t,[],e)}else{try{e.call()}catch(m){o=m}t.call(e.prototype)}else{try{throw Error()}catch(m){o=m}t()}}catch(m){if(m&&o&&typeof m.stack=="string"){for(var l=m.stack.split(`
52
+ `),u=o.stack.split(`
53
+ `),h=l.length-1,x=u.length-1;1<=h&&0<=x&&l[h]!==u[x];)x--;for(;1<=h&&0<=x;h--,x--)if(l[h]!==u[x]){if(h!==1||x!==1)do if(h--,x--,0>x||l[h]!==u[x]){var w=`
54
+ `+l[h].replace(" at new "," at ");return t.displayName&&w.includes("<anonymous>")&&(w=w.replace("<anonymous>",t.displayName)),w}while(1<=h&&0<=x);break}}}finally{sf=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?mo(t):""}function o7(t){switch(t.tag){case 5:return mo(t.type);case 16:return mo("Lazy");case 13:return mo("Suspense");case 19:return mo("SuspenseList");case 0:case 2:case 15:return t=of(t.type,!1),t;case 11:return t=of(t.type.render,!1),t;case 1:return t=of(t.type,!0),t;default:return""}}function u1(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case ns:return"Fragment";case rs:return"Portal";case a1:return"Profiler";case a0:return"StrictMode";case l1:return"Suspense";case c1:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case nw:return(t.displayName||"Context")+".Consumer";case rw:return(t._context.displayName||"Context")+".Provider";case l0:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case c0:return e=t.displayName||null,e!==null?e:u1(t.type)||"Memo";case Fn:e=t._payload,t=t._init;try{return u1(t(e))}catch{}}return null}function a7(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return u1(e);case 8:return e===a0?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function ei(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function sw(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function l7(t){var e=sw(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),o=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var l=r.get,u=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return l.call(this)},set:function(h){o=""+h,u.call(this,h)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return o},setValue:function(h){o=""+h},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Ka(t){t._valueTracker||(t._valueTracker=l7(t))}function ow(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),o="";return t&&(o=sw(t)?t.checked?"true":"false":t.value),t=o,t!==r?(e.setValue(t),!0):!1}function $l(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function f1(t,e){var r=e.checked;return rt({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function rp(t,e){var r=e.defaultValue==null?"":e.defaultValue,o=e.checked!=null?e.checked:e.defaultChecked;r=ei(e.value!=null?e.value:r),t._wrapperState={initialChecked:o,initialValue:r,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function aw(t,e){e=e.checked,e!=null&&o0(t,"checked",e,!1)}function d1(t,e){aw(t,e);var r=ei(e.value),o=e.type;if(r!=null)o==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if(o==="submit"||o==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?h1(t,e.type,r):e.hasOwnProperty("defaultValue")&&h1(t,e.type,ei(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function np(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var o=e.type;if(!(o!=="submit"&&o!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}r=t.name,r!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,r!==""&&(t.name=r)}function h1(t,e,r){(e!=="number"||$l(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var xo=Array.isArray;function xs(t,e,r,o){if(t=t.options,e){e={};for(var l=0;l<r.length;l++)e["$"+r[l]]=!0;for(r=0;r<t.length;r++)l=e.hasOwnProperty("$"+t[r].value),t[r].selected!==l&&(t[r].selected=l),l&&o&&(t[r].defaultSelected=!0)}else{for(r=""+ei(r),e=null,l=0;l<t.length;l++){if(t[l].value===r){t[l].selected=!0,o&&(t[l].defaultSelected=!0);return}e!==null||t[l].disabled||(e=t[l])}e!==null&&(e.selected=!0)}}function g1(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(q(91));return rt({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function ip(t,e){var r=e.value;if(r==null){if(r=e.children,e=e.defaultValue,r!=null){if(e!=null)throw Error(q(92));if(xo(r)){if(1<r.length)throw Error(q(93));r=r[0]}e=r}e==null&&(e=""),r=e}t._wrapperState={initialValue:ei(r)}}function lw(t,e){var r=ei(e.value),o=ei(e.defaultValue);r!=null&&(r=""+r,r!==t.value&&(t.value=r),e.defaultValue==null&&t.defaultValue!==r&&(t.defaultValue=r)),o!=null&&(t.defaultValue=""+o)}function sp(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function cw(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function p1(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?cw(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var Za,uw=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,r,o,l){MSApp.execUnsafeLocalFunction(function(){return t(e,r,o,l)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(Za=Za||document.createElement("div"),Za.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=Za.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Wo(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var Co={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},c7=["Webkit","ms","Moz","O"];Object.keys(Co).forEach(function(t){c7.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Co[e]=Co[t]})});function fw(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||Co.hasOwnProperty(t)&&Co[t]?(""+e).trim():e+"px"}function dw(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var o=r.indexOf("--")===0,l=fw(r,e[r],o);r==="float"&&(r="cssFloat"),o?t.setProperty(r,l):t[r]=l}}var u7=rt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function m1(t,e){if(e){if(u7[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(q(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(q(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(q(61))}if(e.style!=null&&typeof e.style!="object")throw Error(q(62))}}function x1(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var w1=null;function u0(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var v1=null,ws=null,vs=null;function op(t){if(t=xa(t)){if(typeof v1!="function")throw Error(q(280));var e=t.stateNode;e&&(e=Wc(e),v1(t.stateNode,t.type,e))}}function hw(t){ws?vs?vs.push(t):vs=[t]:ws=t}function gw(){if(ws){var t=ws,e=vs;if(vs=ws=null,op(t),e)for(t=0;t<e.length;t++)op(e[t])}}function pw(t,e){return t(e)}function mw(){}var af=!1;function xw(t,e,r){if(af)return t(e,r);af=!0;try{return pw(t,e,r)}finally{af=!1,(ws!==null||vs!==null)&&(mw(),gw())}}function Vo(t,e){var r=t.stateNode;if(r===null)return null;var o=Wc(r);if(o===null)return null;r=o[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(t=t.type,o=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!o;break e;default:t=!1}if(t)return null;if(r&&typeof r!="function")throw Error(q(231,e,typeof r));return r}var y1=!1;if(An)try{var so={};Object.defineProperty(so,"passive",{get:function(){y1=!0}}),window.addEventListener("test",so,so),window.removeEventListener("test",so,so)}catch{y1=!1}function f7(t,e,r,o,l,u,h,x,w){var m=Array.prototype.slice.call(arguments,3);try{e.apply(r,m)}catch(y){this.onError(y)}}var So=!1,Hl=null,Gl=!1,E1=null,d7={onError:function(t){So=!0,Hl=t}};function h7(t,e,r,o,l,u,h,x,w){So=!1,Hl=null,f7.apply(d7,arguments)}function g7(t,e,r,o,l,u,h,x,w){if(h7.apply(this,arguments),So){if(So){var m=Hl;So=!1,Hl=null}else throw Error(q(198));Gl||(Gl=!0,E1=m)}}function Fi(t){var e=t,r=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(r=e.return),t=e.return;while(t)}return e.tag===3?r:null}function ww(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function ap(t){if(Fi(t)!==t)throw Error(q(188))}function p7(t){var e=t.alternate;if(!e){if(e=Fi(t),e===null)throw Error(q(188));return e!==t?null:t}for(var r=t,o=e;;){var l=r.return;if(l===null)break;var u=l.alternate;if(u===null){if(o=l.return,o!==null){r=o;continue}break}if(l.child===u.child){for(u=l.child;u;){if(u===r)return ap(l),t;if(u===o)return ap(l),e;u=u.sibling}throw Error(q(188))}if(r.return!==o.return)r=l,o=u;else{for(var h=!1,x=l.child;x;){if(x===r){h=!0,r=l,o=u;break}if(x===o){h=!0,o=l,r=u;break}x=x.sibling}if(!h){for(x=u.child;x;){if(x===r){h=!0,r=u,o=l;break}if(x===o){h=!0,o=u,r=l;break}x=x.sibling}if(!h)throw Error(q(189))}}if(r.alternate!==o)throw Error(q(190))}if(r.tag!==3)throw Error(q(188));return r.stateNode.current===r?t:e}function vw(t){return t=p7(t),t!==null?yw(t):null}function yw(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=yw(t);if(e!==null)return e;t=t.sibling}return null}var Ew=mr.unstable_scheduleCallback,lp=mr.unstable_cancelCallback,m7=mr.unstable_shouldYield,x7=mr.unstable_requestPaint,ut=mr.unstable_now,w7=mr.unstable_getCurrentPriorityLevel,f0=mr.unstable_ImmediatePriority,Aw=mr.unstable_UserBlockingPriority,Xl=mr.unstable_NormalPriority,v7=mr.unstable_LowPriority,bw=mr.unstable_IdlePriority,Bc=null,sn=null;function y7(t){if(sn&&typeof sn.onCommitFiberRoot=="function")try{sn.onCommitFiberRoot(Bc,t,void 0,(t.current.flags&128)===128)}catch{}}var Vr=Math.clz32?Math.clz32:b7,E7=Math.log,A7=Math.LN2;function b7(t){return t>>>=0,t===0?32:31-(E7(t)/A7|0)|0}var Qa=64,qa=4194304;function wo(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Yl(t,e){var r=t.pendingLanes;if(r===0)return 0;var o=0,l=t.suspendedLanes,u=t.pingedLanes,h=r&268435455;if(h!==0){var x=h&~l;x!==0?o=wo(x):(u&=h,u!==0&&(o=wo(u)))}else h=r&~l,h!==0?o=wo(h):u!==0&&(o=wo(u));if(o===0)return 0;if(e!==0&&e!==o&&!(e&l)&&(l=o&-o,u=e&-e,l>=u||l===16&&(u&4194240)!==0))return e;if(o&4&&(o|=r&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=o;0<e;)r=31-Vr(e),l=1<<r,o|=t[r],e&=~l;return o}function C7(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function S7(t,e){for(var r=t.suspendedLanes,o=t.pingedLanes,l=t.expirationTimes,u=t.pendingLanes;0<u;){var h=31-Vr(u),x=1<<h,w=l[h];w===-1?(!(x&r)||x&o)&&(l[h]=C7(x,e)):w<=e&&(t.expiredLanes|=x),u&=~x}}function A1(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function Cw(){var t=Qa;return Qa<<=1,!(Qa&4194240)&&(Qa=64),t}function lf(t){for(var e=[],r=0;31>r;r++)e.push(t);return e}function pa(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Vr(e),t[e]=r}function I7(t,e){var r=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var o=t.eventTimes;for(t=t.expirationTimes;0<r;){var l=31-Vr(r),u=1<<l;e[l]=0,o[l]=-1,t[l]=-1,r&=~u}}function d0(t,e){var r=t.entangledLanes|=e;for(t=t.entanglements;r;){var o=31-Vr(r),l=1<<o;l&e|t[o]&e&&(t[o]|=e),r&=~l}}var Be=0;function Sw(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var Iw,h0,Tw,Rw,_w,b1=!1,Ja=[],Gn=null,Xn=null,Yn=null,zo=new Map,$o=new Map,jn=[],T7="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function cp(t,e){switch(t){case"focusin":case"focusout":Gn=null;break;case"dragenter":case"dragleave":Xn=null;break;case"mouseover":case"mouseout":Yn=null;break;case"pointerover":case"pointerout":zo.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":$o.delete(e.pointerId)}}function oo(t,e,r,o,l,u){return t===null||t.nativeEvent!==u?(t={blockedOn:e,domEventName:r,eventSystemFlags:o,nativeEvent:u,targetContainers:[l]},e!==null&&(e=xa(e),e!==null&&h0(e)),t):(t.eventSystemFlags|=o,e=t.targetContainers,l!==null&&e.indexOf(l)===-1&&e.push(l),t)}function R7(t,e,r,o,l){switch(e){case"focusin":return Gn=oo(Gn,t,e,r,o,l),!0;case"dragenter":return Xn=oo(Xn,t,e,r,o,l),!0;case"mouseover":return Yn=oo(Yn,t,e,r,o,l),!0;case"pointerover":var u=l.pointerId;return zo.set(u,oo(zo.get(u)||null,t,e,r,o,l)),!0;case"gotpointercapture":return u=l.pointerId,$o.set(u,oo($o.get(u)||null,t,e,r,o,l)),!0}return!1}function Nw(t){var e=vi(t.target);if(e!==null){var r=Fi(e);if(r!==null){if(e=r.tag,e===13){if(e=ww(r),e!==null){t.blockedOn=e,_w(t.priority,function(){Tw(r)});return}}else if(e===3&&r.stateNode.current.memoizedState.isDehydrated){t.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Cl(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var r=C1(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(r===null){r=t.nativeEvent;var o=new r.constructor(r.type,r);w1=o,r.target.dispatchEvent(o),w1=null}else return e=xa(r),e!==null&&h0(e),t.blockedOn=r,!1;e.shift()}return!0}function up(t,e,r){Cl(t)&&r.delete(e)}function _7(){b1=!1,Gn!==null&&Cl(Gn)&&(Gn=null),Xn!==null&&Cl(Xn)&&(Xn=null),Yn!==null&&Cl(Yn)&&(Yn=null),zo.forEach(up),$o.forEach(up)}function ao(t,e){t.blockedOn===e&&(t.blockedOn=null,b1||(b1=!0,mr.unstable_scheduleCallback(mr.unstable_NormalPriority,_7)))}function Ho(t){function e(l){return ao(l,t)}if(0<Ja.length){ao(Ja[0],t);for(var r=1;r<Ja.length;r++){var o=Ja[r];o.blockedOn===t&&(o.blockedOn=null)}}for(Gn!==null&&ao(Gn,t),Xn!==null&&ao(Xn,t),Yn!==null&&ao(Yn,t),zo.forEach(e),$o.forEach(e),r=0;r<jn.length;r++)o=jn[r],o.blockedOn===t&&(o.blockedOn=null);for(;0<jn.length&&(r=jn[0],r.blockedOn===null);)Nw(r),r.blockedOn===null&&jn.shift()}var ys=Rn.ReactCurrentBatchConfig,Kl=!0;function N7(t,e,r,o){var l=Be,u=ys.transition;ys.transition=null;try{Be=1,g0(t,e,r,o)}finally{Be=l,ys.transition=u}}function O7(t,e,r,o){var l=Be,u=ys.transition;ys.transition=null;try{Be=4,g0(t,e,r,o)}finally{Be=l,ys.transition=u}}function g0(t,e,r,o){if(Kl){var l=C1(t,e,r,o);if(l===null)wf(t,e,o,Zl,r),cp(t,o);else if(R7(l,t,e,r,o))o.stopPropagation();else if(cp(t,o),e&4&&-1<T7.indexOf(t)){for(;l!==null;){var u=xa(l);if(u!==null&&Iw(u),u=C1(t,e,r,o),u===null&&wf(t,e,o,Zl,r),u===l)break;l=u}l!==null&&o.stopPropagation()}else wf(t,e,o,null,r)}}var Zl=null;function C1(t,e,r,o){if(Zl=null,t=u0(o),t=vi(t),t!==null)if(e=Fi(t),e===null)t=null;else if(r=e.tag,r===13){if(t=ww(e),t!==null)return t;t=null}else if(r===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return Zl=t,null}function Ow(t){switch(t){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(w7()){case f0:return 1;case Aw:return 4;case Xl:case v7:return 16;case bw:return 536870912;default:return 16}default:return 16}}var $n=null,p0=null,Sl=null;function kw(){if(Sl)return Sl;var t,e=p0,r=e.length,o,l="value"in $n?$n.value:$n.textContent,u=l.length;for(t=0;t<r&&e[t]===l[t];t++);var h=r-t;for(o=1;o<=h&&e[r-o]===l[u-o];o++);return Sl=l.slice(t,1<o?1-o:void 0)}function Il(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function el(){return!0}function fp(){return!1}function yr(t){function e(r,o,l,u,h){this._reactName=r,this._targetInst=l,this.type=o,this.nativeEvent=u,this.target=h,this.currentTarget=null;for(var x in t)t.hasOwnProperty(x)&&(r=t[x],this[x]=r?r(u):u[x]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?el:fp,this.isPropagationStopped=fp,this}return rt(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=el)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=el)},persist:function(){},isPersistent:el}),e}var Fs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},m0=yr(Fs),ma=rt({},Fs,{view:0,detail:0}),k7=yr(ma),cf,uf,lo,Fc=rt({},ma,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:x0,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==lo&&(lo&&t.type==="mousemove"?(cf=t.screenX-lo.screenX,uf=t.screenY-lo.screenY):uf=cf=0,lo=t),cf)},movementY:function(t){return"movementY"in t?t.movementY:uf}}),dp=yr(Fc),M7=rt({},Fc,{dataTransfer:0}),D7=yr(M7),P7=rt({},ma,{relatedTarget:0}),ff=yr(P7),L7=rt({},Fs,{animationName:0,elapsedTime:0,pseudoElement:0}),B7=yr(L7),F7=rt({},Fs,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),U7=yr(F7),j7=rt({},Fs,{data:0}),hp=yr(j7),W7={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},V7={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},z7={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $7(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=z7[t])?!!e[t]:!1}function x0(){return $7}var H7=rt({},ma,{key:function(t){if(t.key){var e=W7[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Il(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?V7[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:x0,charCode:function(t){return t.type==="keypress"?Il(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Il(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),G7=yr(H7),X7=rt({},Fc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),gp=yr(X7),Y7=rt({},ma,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:x0}),K7=yr(Y7),Z7=rt({},Fs,{propertyName:0,elapsedTime:0,pseudoElement:0}),Q7=yr(Z7),q7=rt({},Fc,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),J7=yr(q7),eT=[9,13,27,32],w0=An&&"CompositionEvent"in window,Io=null;An&&"documentMode"in document&&(Io=document.documentMode);var tT=An&&"TextEvent"in window&&!Io,Mw=An&&(!w0||Io&&8<Io&&11>=Io),pp=" ",mp=!1;function Dw(t,e){switch(t){case"keyup":return eT.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Pw(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var is=!1;function rT(t,e){switch(t){case"compositionend":return Pw(e);case"keypress":return e.which!==32?null:(mp=!0,pp);case"textInput":return t=e.data,t===pp&&mp?null:t;default:return null}}function nT(t,e){if(is)return t==="compositionend"||!w0&&Dw(t,e)?(t=kw(),Sl=p0=$n=null,is=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return Mw&&e.locale!=="ko"?null:e.data;default:return null}}var iT={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function xp(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!iT[t.type]:e==="textarea"}function Lw(t,e,r,o){hw(o),e=Ql(e,"onChange"),0<e.length&&(r=new m0("onChange","change",null,r,o),t.push({event:r,listeners:e}))}var To=null,Go=null;function sT(t){Xw(t,0)}function Uc(t){var e=as(t);if(ow(e))return t}function oT(t,e){if(t==="change")return e}var Bw=!1;if(An){var df;if(An){var hf="oninput"in document;if(!hf){var wp=document.createElement("div");wp.setAttribute("oninput","return;"),hf=typeof wp.oninput=="function"}df=hf}else df=!1;Bw=df&&(!document.documentMode||9<document.documentMode)}function vp(){To&&(To.detachEvent("onpropertychange",Fw),Go=To=null)}function Fw(t){if(t.propertyName==="value"&&Uc(Go)){var e=[];Lw(e,Go,t,u0(t)),xw(sT,e)}}function aT(t,e,r){t==="focusin"?(vp(),To=e,Go=r,To.attachEvent("onpropertychange",Fw)):t==="focusout"&&vp()}function lT(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Uc(Go)}function cT(t,e){if(t==="click")return Uc(e)}function uT(t,e){if(t==="input"||t==="change")return Uc(e)}function fT(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var $r=typeof Object.is=="function"?Object.is:fT;function Xo(t,e){if($r(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var r=Object.keys(t),o=Object.keys(e);if(r.length!==o.length)return!1;for(o=0;o<r.length;o++){var l=r[o];if(!o1.call(e,l)||!$r(t[l],e[l]))return!1}return!0}function yp(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Ep(t,e){var r=yp(t);t=0;for(var o;r;){if(r.nodeType===3){if(o=t+r.textContent.length,t<=e&&o>=e)return{node:r,offset:e-t};t=o}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=yp(r)}}function Uw(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Uw(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function jw(){for(var t=window,e=$l();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=$l(t.document)}return e}function v0(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function dT(t){var e=jw(),r=t.focusedElem,o=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&Uw(r.ownerDocument.documentElement,r)){if(o!==null&&v0(r)){if(e=o.start,t=o.end,t===void 0&&(t=e),"selectionStart"in r)r.selectionStart=e,r.selectionEnd=Math.min(t,r.value.length);else if(t=(e=r.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var l=r.textContent.length,u=Math.min(o.start,l);o=o.end===void 0?u:Math.min(o.end,l),!t.extend&&u>o&&(l=o,o=u,u=l),l=Ep(r,u);var h=Ep(r,o);l&&h&&(t.rangeCount!==1||t.anchorNode!==l.node||t.anchorOffset!==l.offset||t.focusNode!==h.node||t.focusOffset!==h.offset)&&(e=e.createRange(),e.setStart(l.node,l.offset),t.removeAllRanges(),u>o?(t.addRange(e),t.extend(h.node,h.offset)):(e.setEnd(h.node,h.offset),t.addRange(e)))}}for(e=[],t=r;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<e.length;r++)t=e[r],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var hT=An&&"documentMode"in document&&11>=document.documentMode,ss=null,S1=null,Ro=null,I1=!1;function Ap(t,e,r){var o=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;I1||ss==null||ss!==$l(o)||(o=ss,"selectionStart"in o&&v0(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),Ro&&Xo(Ro,o)||(Ro=o,o=Ql(S1,"onSelect"),0<o.length&&(e=new m0("onSelect","select",null,e,r),t.push({event:e,listeners:o}),e.target=ss)))}function tl(t,e){var r={};return r[t.toLowerCase()]=e.toLowerCase(),r["Webkit"+t]="webkit"+e,r["Moz"+t]="moz"+e,r}var os={animationend:tl("Animation","AnimationEnd"),animationiteration:tl("Animation","AnimationIteration"),animationstart:tl("Animation","AnimationStart"),transitionend:tl("Transition","TransitionEnd")},gf={},Ww={};An&&(Ww=document.createElement("div").style,"AnimationEvent"in window||(delete os.animationend.animation,delete os.animationiteration.animation,delete os.animationstart.animation),"TransitionEvent"in window||delete os.transitionend.transition);function jc(t){if(gf[t])return gf[t];if(!os[t])return t;var e=os[t],r;for(r in e)if(e.hasOwnProperty(r)&&r in Ww)return gf[t]=e[r];return t}var Vw=jc("animationend"),zw=jc("animationiteration"),$w=jc("animationstart"),Hw=jc("transitionend"),Gw=new Map,bp="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ii(t,e){Gw.set(t,e),Bi(e,[t])}for(var pf=0;pf<bp.length;pf++){var mf=bp[pf],gT=mf.toLowerCase(),pT=mf[0].toUpperCase()+mf.slice(1);ii(gT,"on"+pT)}ii(Vw,"onAnimationEnd");ii(zw,"onAnimationIteration");ii($w,"onAnimationStart");ii("dblclick","onDoubleClick");ii("focusin","onFocus");ii("focusout","onBlur");ii(Hw,"onTransitionEnd");Ts("onMouseEnter",["mouseout","mouseover"]);Ts("onMouseLeave",["mouseout","mouseover"]);Ts("onPointerEnter",["pointerout","pointerover"]);Ts("onPointerLeave",["pointerout","pointerover"]);Bi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Bi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Bi("onBeforeInput",["compositionend","keypress","textInput","paste"]);Bi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Bi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Bi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var vo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),mT=new Set("cancel close invalid load scroll toggle".split(" ").concat(vo));function Cp(t,e,r){var o=t.type||"unknown-event";t.currentTarget=r,g7(o,e,void 0,t),t.currentTarget=null}function Xw(t,e){e=(e&4)!==0;for(var r=0;r<t.length;r++){var o=t[r],l=o.event;o=o.listeners;e:{var u=void 0;if(e)for(var h=o.length-1;0<=h;h--){var x=o[h],w=x.instance,m=x.currentTarget;if(x=x.listener,w!==u&&l.isPropagationStopped())break e;Cp(l,x,m),u=w}else for(h=0;h<o.length;h++){if(x=o[h],w=x.instance,m=x.currentTarget,x=x.listener,w!==u&&l.isPropagationStopped())break e;Cp(l,x,m),u=w}}}if(Gl)throw t=E1,Gl=!1,E1=null,t}function Ge(t,e){var r=e[O1];r===void 0&&(r=e[O1]=new Set);var o=t+"__bubble";r.has(o)||(Yw(e,t,2,!1),r.add(o))}function xf(t,e,r){var o=0;e&&(o|=4),Yw(r,t,o,e)}var rl="_reactListening"+Math.random().toString(36).slice(2);function Yo(t){if(!t[rl]){t[rl]=!0,tw.forEach(function(r){r!=="selectionchange"&&(mT.has(r)||xf(r,!1,t),xf(r,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[rl]||(e[rl]=!0,xf("selectionchange",!1,e))}}function Yw(t,e,r,o){switch(Ow(e)){case 1:var l=N7;break;case 4:l=O7;break;default:l=g0}r=l.bind(null,e,r,t),l=void 0,!y1||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(l=!0),o?l!==void 0?t.addEventListener(e,r,{capture:!0,passive:l}):t.addEventListener(e,r,!0):l!==void 0?t.addEventListener(e,r,{passive:l}):t.addEventListener(e,r,!1)}function wf(t,e,r,o,l){var u=o;if(!(e&1)&&!(e&2)&&o!==null)e:for(;;){if(o===null)return;var h=o.tag;if(h===3||h===4){var x=o.stateNode.containerInfo;if(x===l||x.nodeType===8&&x.parentNode===l)break;if(h===4)for(h=o.return;h!==null;){var w=h.tag;if((w===3||w===4)&&(w=h.stateNode.containerInfo,w===l||w.nodeType===8&&w.parentNode===l))return;h=h.return}for(;x!==null;){if(h=vi(x),h===null)return;if(w=h.tag,w===5||w===6){o=u=h;continue e}x=x.parentNode}}o=o.return}xw(function(){var m=u,y=u0(r),b=[];e:{var C=Gw.get(t);if(C!==void 0){var T=m0,k=t;switch(t){case"keypress":if(Il(r)===0)break e;case"keydown":case"keyup":T=G7;break;case"focusin":k="focus",T=ff;break;case"focusout":k="blur",T=ff;break;case"beforeblur":case"afterblur":T=ff;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":T=dp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":T=D7;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":T=K7;break;case Vw:case zw:case $w:T=B7;break;case Hw:T=Q7;break;case"scroll":T=k7;break;case"wheel":T=J7;break;case"copy":case"cut":case"paste":T=U7;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":T=gp}var D=(e&4)!==0,X=!D&&t==="scroll",O=D?C!==null?C+"Capture":null:C;D=[];for(var I=m,_;I!==null;){_=I;var L=_.stateNode;if(_.tag===5&&L!==null&&(_=L,O!==null&&(L=Vo(I,O),L!=null&&D.push(Ko(I,L,_)))),X)break;I=I.return}0<D.length&&(C=new T(C,k,null,r,y),b.push({event:C,listeners:D}))}}if(!(e&7)){e:{if(C=t==="mouseover"||t==="pointerover",T=t==="mouseout"||t==="pointerout",C&&r!==w1&&(k=r.relatedTarget||r.fromElement)&&(vi(k)||k[bn]))break e;if((T||C)&&(C=y.window===y?y:(C=y.ownerDocument)?C.defaultView||C.parentWindow:window,T?(k=r.relatedTarget||r.toElement,T=m,k=k?vi(k):null,k!==null&&(X=Fi(k),k!==X||k.tag!==5&&k.tag!==6)&&(k=null)):(T=null,k=m),T!==k)){if(D=dp,L="onMouseLeave",O="onMouseEnter",I="mouse",(t==="pointerout"||t==="pointerover")&&(D=gp,L="onPointerLeave",O="onPointerEnter",I="pointer"),X=T==null?C:as(T),_=k==null?C:as(k),C=new D(L,I+"leave",T,r,y),C.target=X,C.relatedTarget=_,L=null,vi(y)===m&&(D=new D(O,I+"enter",k,r,y),D.target=_,D.relatedTarget=X,L=D),X=L,T&&k)t:{for(D=T,O=k,I=0,_=D;_;_=Qi(_))I++;for(_=0,L=O;L;L=Qi(L))_++;for(;0<I-_;)D=Qi(D),I--;for(;0<_-I;)O=Qi(O),_--;for(;I--;){if(D===O||O!==null&&D===O.alternate)break t;D=Qi(D),O=Qi(O)}D=null}else D=null;T!==null&&Sp(b,C,T,D,!1),k!==null&&X!==null&&Sp(b,X,k,D,!0)}}e:{if(C=m?as(m):window,T=C.nodeName&&C.nodeName.toLowerCase(),T==="select"||T==="input"&&C.type==="file")var j=oT;else if(xp(C))if(Bw)j=uT;else{j=lT;var U=aT}else(T=C.nodeName)&&T.toLowerCase()==="input"&&(C.type==="checkbox"||C.type==="radio")&&(j=cT);if(j&&(j=j(t,m))){Lw(b,j,r,y);break e}U&&U(t,C,m),t==="focusout"&&(U=C._wrapperState)&&U.controlled&&C.type==="number"&&h1(C,"number",C.value)}switch(U=m?as(m):window,t){case"focusin":(xp(U)||U.contentEditable==="true")&&(ss=U,S1=m,Ro=null);break;case"focusout":Ro=S1=ss=null;break;case"mousedown":I1=!0;break;case"contextmenu":case"mouseup":case"dragend":I1=!1,Ap(b,r,y);break;case"selectionchange":if(hT)break;case"keydown":case"keyup":Ap(b,r,y)}var F;if(w0)e:{switch(t){case"compositionstart":var Y="onCompositionStart";break e;case"compositionend":Y="onCompositionEnd";break e;case"compositionupdate":Y="onCompositionUpdate";break e}Y=void 0}else is?Dw(t,r)&&(Y="onCompositionEnd"):t==="keydown"&&r.keyCode===229&&(Y="onCompositionStart");Y&&(Mw&&r.locale!=="ko"&&(is||Y!=="onCompositionStart"?Y==="onCompositionEnd"&&is&&(F=kw()):($n=y,p0="value"in $n?$n.value:$n.textContent,is=!0)),U=Ql(m,Y),0<U.length&&(Y=new hp(Y,t,null,r,y),b.push({event:Y,listeners:U}),F?Y.data=F:(F=Pw(r),F!==null&&(Y.data=F)))),(F=tT?rT(t,r):nT(t,r))&&(m=Ql(m,"onBeforeInput"),0<m.length&&(y=new hp("onBeforeInput","beforeinput",null,r,y),b.push({event:y,listeners:m}),y.data=F))}Xw(b,e)})}function Ko(t,e,r){return{instance:t,listener:e,currentTarget:r}}function Ql(t,e){for(var r=e+"Capture",o=[];t!==null;){var l=t,u=l.stateNode;l.tag===5&&u!==null&&(l=u,u=Vo(t,r),u!=null&&o.unshift(Ko(t,u,l)),u=Vo(t,e),u!=null&&o.push(Ko(t,u,l))),t=t.return}return o}function Qi(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function Sp(t,e,r,o,l){for(var u=e._reactName,h=[];r!==null&&r!==o;){var x=r,w=x.alternate,m=x.stateNode;if(w!==null&&w===o)break;x.tag===5&&m!==null&&(x=m,l?(w=Vo(r,u),w!=null&&h.unshift(Ko(r,w,x))):l||(w=Vo(r,u),w!=null&&h.push(Ko(r,w,x)))),r=r.return}h.length!==0&&t.push({event:e,listeners:h})}var xT=/\r\n?/g,wT=/\u0000|\uFFFD/g;function Ip(t){return(typeof t=="string"?t:""+t).replace(xT,`
55
+ `).replace(wT,"")}function nl(t,e,r){if(e=Ip(e),Ip(t)!==e&&r)throw Error(q(425))}function ql(){}var T1=null,R1=null;function _1(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var N1=typeof setTimeout=="function"?setTimeout:void 0,vT=typeof clearTimeout=="function"?clearTimeout:void 0,Tp=typeof Promise=="function"?Promise:void 0,yT=typeof queueMicrotask=="function"?queueMicrotask:typeof Tp<"u"?function(t){return Tp.resolve(null).then(t).catch(ET)}:N1;function ET(t){setTimeout(function(){throw t})}function vf(t,e){var r=e,o=0;do{var l=r.nextSibling;if(t.removeChild(r),l&&l.nodeType===8)if(r=l.data,r==="/$"){if(o===0){t.removeChild(l),Ho(e);return}o--}else r!=="$"&&r!=="$?"&&r!=="$!"||o++;r=l}while(r);Ho(e)}function Kn(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function Rp(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var r=t.data;if(r==="$"||r==="$!"||r==="$?"){if(e===0)return t;e--}else r==="/$"&&e++}t=t.previousSibling}return null}var Us=Math.random().toString(36).slice(2),nn="__reactFiber$"+Us,Zo="__reactProps$"+Us,bn="__reactContainer$"+Us,O1="__reactEvents$"+Us,AT="__reactListeners$"+Us,bT="__reactHandles$"+Us;function vi(t){var e=t[nn];if(e)return e;for(var r=t.parentNode;r;){if(e=r[bn]||r[nn]){if(r=e.alternate,e.child!==null||r!==null&&r.child!==null)for(t=Rp(t);t!==null;){if(r=t[nn])return r;t=Rp(t)}return e}t=r,r=t.parentNode}return null}function xa(t){return t=t[nn]||t[bn],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function as(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(q(33))}function Wc(t){return t[Zo]||null}var k1=[],ls=-1;function si(t){return{current:t}}function Xe(t){0>ls||(t.current=k1[ls],k1[ls]=null,ls--)}function $e(t,e){ls++,k1[ls]=t.current,t.current=e}var ti={},zt=si(ti),ar=si(!1),_i=ti;function Rs(t,e){var r=t.type.contextTypes;if(!r)return ti;var o=t.stateNode;if(o&&o.__reactInternalMemoizedUnmaskedChildContext===e)return o.__reactInternalMemoizedMaskedChildContext;var l={},u;for(u in r)l[u]=e[u];return o&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=l),l}function lr(t){return t=t.childContextTypes,t!=null}function Jl(){Xe(ar),Xe(zt)}function _p(t,e,r){if(zt.current!==ti)throw Error(q(168));$e(zt,e),$e(ar,r)}function Kw(t,e,r){var o=t.stateNode;if(e=e.childContextTypes,typeof o.getChildContext!="function")return r;o=o.getChildContext();for(var l in o)if(!(l in e))throw Error(q(108,a7(t)||"Unknown",l));return rt({},r,o)}function ec(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||ti,_i=zt.current,$e(zt,t),$e(ar,ar.current),!0}function Np(t,e,r){var o=t.stateNode;if(!o)throw Error(q(169));r?(t=Kw(t,e,_i),o.__reactInternalMemoizedMergedChildContext=t,Xe(ar),Xe(zt),$e(zt,t)):Xe(ar),$e(ar,r)}var pn=null,Vc=!1,yf=!1;function Zw(t){pn===null?pn=[t]:pn.push(t)}function CT(t){Vc=!0,Zw(t)}function oi(){if(!yf&&pn!==null){yf=!0;var t=0,e=Be;try{var r=pn;for(Be=1;t<r.length;t++){var o=r[t];do o=o(!0);while(o!==null)}pn=null,Vc=!1}catch(l){throw pn!==null&&(pn=pn.slice(t+1)),Ew(f0,oi),l}finally{Be=e,yf=!1}}return null}var cs=[],us=0,tc=null,rc=0,Ir=[],Tr=0,Ni=null,xn=1,wn="";function mi(t,e){cs[us++]=rc,cs[us++]=tc,tc=t,rc=e}function Qw(t,e,r){Ir[Tr++]=xn,Ir[Tr++]=wn,Ir[Tr++]=Ni,Ni=t;var o=xn;t=wn;var l=32-Vr(o)-1;o&=~(1<<l),r+=1;var u=32-Vr(e)+l;if(30<u){var h=l-l%5;u=(o&(1<<h)-1).toString(32),o>>=h,l-=h,xn=1<<32-Vr(e)+l|r<<l|o,wn=u+t}else xn=1<<u|r<<l|o,wn=t}function y0(t){t.return!==null&&(mi(t,1),Qw(t,1,0))}function E0(t){for(;t===tc;)tc=cs[--us],cs[us]=null,rc=cs[--us],cs[us]=null;for(;t===Ni;)Ni=Ir[--Tr],Ir[Tr]=null,wn=Ir[--Tr],Ir[Tr]=null,xn=Ir[--Tr],Ir[Tr]=null}var pr=null,gr=null,Ze=!1,Wr=null;function qw(t,e){var r=Rr(5,null,null,0);r.elementType="DELETED",r.stateNode=e,r.return=t,e=t.deletions,e===null?(t.deletions=[r],t.flags|=16):e.push(r)}function Op(t,e){switch(t.tag){case 5:var r=t.type;return e=e.nodeType!==1||r.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,pr=t,gr=Kn(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,pr=t,gr=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(r=Ni!==null?{id:xn,overflow:wn}:null,t.memoizedState={dehydrated:e,treeContext:r,retryLane:1073741824},r=Rr(18,null,null,0),r.stateNode=e,r.return=t,t.child=r,pr=t,gr=null,!0):!1;default:return!1}}function M1(t){return(t.mode&1)!==0&&(t.flags&128)===0}function D1(t){if(Ze){var e=gr;if(e){var r=e;if(!Op(t,e)){if(M1(t))throw Error(q(418));e=Kn(r.nextSibling);var o=pr;e&&Op(t,e)?qw(o,r):(t.flags=t.flags&-4097|2,Ze=!1,pr=t)}}else{if(M1(t))throw Error(q(418));t.flags=t.flags&-4097|2,Ze=!1,pr=t}}}function kp(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;pr=t}function il(t){if(t!==pr)return!1;if(!Ze)return kp(t),Ze=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!_1(t.type,t.memoizedProps)),e&&(e=gr)){if(M1(t))throw Jw(),Error(q(418));for(;e;)qw(t,e),e=Kn(e.nextSibling)}if(kp(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(q(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var r=t.data;if(r==="/$"){if(e===0){gr=Kn(t.nextSibling);break e}e--}else r!=="$"&&r!=="$!"&&r!=="$?"||e++}t=t.nextSibling}gr=null}}else gr=pr?Kn(t.stateNode.nextSibling):null;return!0}function Jw(){for(var t=gr;t;)t=Kn(t.nextSibling)}function _s(){gr=pr=null,Ze=!1}function A0(t){Wr===null?Wr=[t]:Wr.push(t)}var ST=Rn.ReactCurrentBatchConfig;function co(t,e,r){if(t=r.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(q(309));var o=r.stateNode}if(!o)throw Error(q(147,t));var l=o,u=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===u?e.ref:(e=function(h){var x=l.refs;h===null?delete x[u]:x[u]=h},e._stringRef=u,e)}if(typeof t!="string")throw Error(q(284));if(!r._owner)throw Error(q(290,t))}return t}function sl(t,e){throw t=Object.prototype.toString.call(e),Error(q(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function Mp(t){var e=t._init;return e(t._payload)}function ev(t){function e(O,I){if(t){var _=O.deletions;_===null?(O.deletions=[I],O.flags|=16):_.push(I)}}function r(O,I){if(!t)return null;for(;I!==null;)e(O,I),I=I.sibling;return null}function o(O,I){for(O=new Map;I!==null;)I.key!==null?O.set(I.key,I):O.set(I.index,I),I=I.sibling;return O}function l(O,I){return O=Jn(O,I),O.index=0,O.sibling=null,O}function u(O,I,_){return O.index=_,t?(_=O.alternate,_!==null?(_=_.index,_<I?(O.flags|=2,I):_):(O.flags|=2,I)):(O.flags|=1048576,I)}function h(O){return t&&O.alternate===null&&(O.flags|=2),O}function x(O,I,_,L){return I===null||I.tag!==6?(I=Tf(_,O.mode,L),I.return=O,I):(I=l(I,_),I.return=O,I)}function w(O,I,_,L){var j=_.type;return j===ns?y(O,I,_.props.children,L,_.key):I!==null&&(I.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Fn&&Mp(j)===I.type)?(L=l(I,_.props),L.ref=co(O,I,_),L.return=O,L):(L=Ml(_.type,_.key,_.props,null,O.mode,L),L.ref=co(O,I,_),L.return=O,L)}function m(O,I,_,L){return I===null||I.tag!==4||I.stateNode.containerInfo!==_.containerInfo||I.stateNode.implementation!==_.implementation?(I=Rf(_,O.mode,L),I.return=O,I):(I=l(I,_.children||[]),I.return=O,I)}function y(O,I,_,L,j){return I===null||I.tag!==7?(I=Si(_,O.mode,L,j),I.return=O,I):(I=l(I,_),I.return=O,I)}function b(O,I,_){if(typeof I=="string"&&I!==""||typeof I=="number")return I=Tf(""+I,O.mode,_),I.return=O,I;if(typeof I=="object"&&I!==null){switch(I.$$typeof){case Ya:return _=Ml(I.type,I.key,I.props,null,O.mode,_),_.ref=co(O,null,I),_.return=O,_;case rs:return I=Rf(I,O.mode,_),I.return=O,I;case Fn:var L=I._init;return b(O,L(I._payload),_)}if(xo(I)||io(I))return I=Si(I,O.mode,_,null),I.return=O,I;sl(O,I)}return null}function C(O,I,_,L){var j=I!==null?I.key:null;if(typeof _=="string"&&_!==""||typeof _=="number")return j!==null?null:x(O,I,""+_,L);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case Ya:return _.key===j?w(O,I,_,L):null;case rs:return _.key===j?m(O,I,_,L):null;case Fn:return j=_._init,C(O,I,j(_._payload),L)}if(xo(_)||io(_))return j!==null?null:y(O,I,_,L,null);sl(O,_)}return null}function T(O,I,_,L,j){if(typeof L=="string"&&L!==""||typeof L=="number")return O=O.get(_)||null,x(I,O,""+L,j);if(typeof L=="object"&&L!==null){switch(L.$$typeof){case Ya:return O=O.get(L.key===null?_:L.key)||null,w(I,O,L,j);case rs:return O=O.get(L.key===null?_:L.key)||null,m(I,O,L,j);case Fn:var U=L._init;return T(O,I,_,U(L._payload),j)}if(xo(L)||io(L))return O=O.get(_)||null,y(I,O,L,j,null);sl(I,L)}return null}function k(O,I,_,L){for(var j=null,U=null,F=I,Y=I=0,$=null;F!==null&&Y<_.length;Y++){F.index>Y?($=F,F=null):$=F.sibling;var se=C(O,F,_[Y],L);if(se===null){F===null&&(F=$);break}t&&F&&se.alternate===null&&e(O,F),I=u(se,I,Y),U===null?j=se:U.sibling=se,U=se,F=$}if(Y===_.length)return r(O,F),Ze&&mi(O,Y),j;if(F===null){for(;Y<_.length;Y++)F=b(O,_[Y],L),F!==null&&(I=u(F,I,Y),U===null?j=F:U.sibling=F,U=F);return Ze&&mi(O,Y),j}for(F=o(O,F);Y<_.length;Y++)$=T(F,O,Y,_[Y],L),$!==null&&(t&&$.alternate!==null&&F.delete($.key===null?Y:$.key),I=u($,I,Y),U===null?j=$:U.sibling=$,U=$);return t&&F.forEach(function(ve){return e(O,ve)}),Ze&&mi(O,Y),j}function D(O,I,_,L){var j=io(_);if(typeof j!="function")throw Error(q(150));if(_=j.call(_),_==null)throw Error(q(151));for(var U=j=null,F=I,Y=I=0,$=null,se=_.next();F!==null&&!se.done;Y++,se=_.next()){F.index>Y?($=F,F=null):$=F.sibling;var ve=C(O,F,se.value,L);if(ve===null){F===null&&(F=$);break}t&&F&&ve.alternate===null&&e(O,F),I=u(ve,I,Y),U===null?j=ve:U.sibling=ve,U=ve,F=$}if(se.done)return r(O,F),Ze&&mi(O,Y),j;if(F===null){for(;!se.done;Y++,se=_.next())se=b(O,se.value,L),se!==null&&(I=u(se,I,Y),U===null?j=se:U.sibling=se,U=se);return Ze&&mi(O,Y),j}for(F=o(O,F);!se.done;Y++,se=_.next())se=T(F,O,Y,se.value,L),se!==null&&(t&&se.alternate!==null&&F.delete(se.key===null?Y:se.key),I=u(se,I,Y),U===null?j=se:U.sibling=se,U=se);return t&&F.forEach(function(Q){return e(O,Q)}),Ze&&mi(O,Y),j}function X(O,I,_,L){if(typeof _=="object"&&_!==null&&_.type===ns&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case Ya:e:{for(var j=_.key,U=I;U!==null;){if(U.key===j){if(j=_.type,j===ns){if(U.tag===7){r(O,U.sibling),I=l(U,_.props.children),I.return=O,O=I;break e}}else if(U.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Fn&&Mp(j)===U.type){r(O,U.sibling),I=l(U,_.props),I.ref=co(O,U,_),I.return=O,O=I;break e}r(O,U);break}else e(O,U);U=U.sibling}_.type===ns?(I=Si(_.props.children,O.mode,L,_.key),I.return=O,O=I):(L=Ml(_.type,_.key,_.props,null,O.mode,L),L.ref=co(O,I,_),L.return=O,O=L)}return h(O);case rs:e:{for(U=_.key;I!==null;){if(I.key===U)if(I.tag===4&&I.stateNode.containerInfo===_.containerInfo&&I.stateNode.implementation===_.implementation){r(O,I.sibling),I=l(I,_.children||[]),I.return=O,O=I;break e}else{r(O,I);break}else e(O,I);I=I.sibling}I=Rf(_,O.mode,L),I.return=O,O=I}return h(O);case Fn:return U=_._init,X(O,I,U(_._payload),L)}if(xo(_))return k(O,I,_,L);if(io(_))return D(O,I,_,L);sl(O,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,I!==null&&I.tag===6?(r(O,I.sibling),I=l(I,_),I.return=O,O=I):(r(O,I),I=Tf(_,O.mode,L),I.return=O,O=I),h(O)):r(O,I)}return X}var Ns=ev(!0),tv=ev(!1),nc=si(null),ic=null,fs=null,b0=null;function C0(){b0=fs=ic=null}function S0(t){var e=nc.current;Xe(nc),t._currentValue=e}function P1(t,e,r){for(;t!==null;){var o=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,o!==null&&(o.childLanes|=e)):o!==null&&(o.childLanes&e)!==e&&(o.childLanes|=e),t===r)break;t=t.return}}function Es(t,e){ic=t,b0=fs=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(or=!0),t.firstContext=null)}function Nr(t){var e=t._currentValue;if(b0!==t)if(t={context:t,memoizedValue:e,next:null},fs===null){if(ic===null)throw Error(q(308));fs=t,ic.dependencies={lanes:0,firstContext:t}}else fs=fs.next=t;return e}var yi=null;function I0(t){yi===null?yi=[t]:yi.push(t)}function rv(t,e,r,o){var l=e.interleaved;return l===null?(r.next=r,I0(e)):(r.next=l.next,l.next=r),e.interleaved=r,Cn(t,o)}function Cn(t,e){t.lanes|=e;var r=t.alternate;for(r!==null&&(r.lanes|=e),r=t,t=t.return;t!==null;)t.childLanes|=e,r=t.alternate,r!==null&&(r.childLanes|=e),r=t,t=t.return;return r.tag===3?r.stateNode:null}var Un=!1;function T0(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function nv(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function vn(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Zn(t,e,r){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,Ne&2){var l=o.pending;return l===null?e.next=e:(e.next=l.next,l.next=e),o.pending=e,Cn(t,r)}return l=o.interleaved,l===null?(e.next=e,I0(o)):(e.next=l.next,l.next=e),o.interleaved=e,Cn(t,r)}function Tl(t,e,r){if(e=e.updateQueue,e!==null&&(e=e.shared,(r&4194240)!==0)){var o=e.lanes;o&=t.pendingLanes,r|=o,e.lanes=r,d0(t,r)}}function Dp(t,e){var r=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,r===o)){var l=null,u=null;if(r=r.firstBaseUpdate,r!==null){do{var h={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};u===null?l=u=h:u=u.next=h,r=r.next}while(r!==null);u===null?l=u=e:u=u.next=e}else l=u=e;r={baseState:o.baseState,firstBaseUpdate:l,lastBaseUpdate:u,shared:o.shared,effects:o.effects},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=e:t.next=e,r.lastBaseUpdate=e}function sc(t,e,r,o){var l=t.updateQueue;Un=!1;var u=l.firstBaseUpdate,h=l.lastBaseUpdate,x=l.shared.pending;if(x!==null){l.shared.pending=null;var w=x,m=w.next;w.next=null,h===null?u=m:h.next=m,h=w;var y=t.alternate;y!==null&&(y=y.updateQueue,x=y.lastBaseUpdate,x!==h&&(x===null?y.firstBaseUpdate=m:x.next=m,y.lastBaseUpdate=w))}if(u!==null){var b=l.baseState;h=0,y=m=w=null,x=u;do{var C=x.lane,T=x.eventTime;if((o&C)===C){y!==null&&(y=y.next={eventTime:T,lane:0,tag:x.tag,payload:x.payload,callback:x.callback,next:null});e:{var k=t,D=x;switch(C=e,T=r,D.tag){case 1:if(k=D.payload,typeof k=="function"){b=k.call(T,b,C);break e}b=k;break e;case 3:k.flags=k.flags&-65537|128;case 0:if(k=D.payload,C=typeof k=="function"?k.call(T,b,C):k,C==null)break e;b=rt({},b,C);break e;case 2:Un=!0}}x.callback!==null&&x.lane!==0&&(t.flags|=64,C=l.effects,C===null?l.effects=[x]:C.push(x))}else T={eventTime:T,lane:C,tag:x.tag,payload:x.payload,callback:x.callback,next:null},y===null?(m=y=T,w=b):y=y.next=T,h|=C;if(x=x.next,x===null){if(x=l.shared.pending,x===null)break;C=x,x=C.next,C.next=null,l.lastBaseUpdate=C,l.shared.pending=null}}while(!0);if(y===null&&(w=b),l.baseState=w,l.firstBaseUpdate=m,l.lastBaseUpdate=y,e=l.shared.interleaved,e!==null){l=e;do h|=l.lane,l=l.next;while(l!==e)}else u===null&&(l.shared.lanes=0);ki|=h,t.lanes=h,t.memoizedState=b}}function Pp(t,e,r){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var o=t[e],l=o.callback;if(l!==null){if(o.callback=null,o=r,typeof l!="function")throw Error(q(191,l));l.call(o)}}}var wa={},on=si(wa),Qo=si(wa),qo=si(wa);function Ei(t){if(t===wa)throw Error(q(174));return t}function R0(t,e){switch($e(qo,e),$e(Qo,t),$e(on,wa),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:p1(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=p1(e,t)}Xe(on),$e(on,e)}function Os(){Xe(on),Xe(Qo),Xe(qo)}function iv(t){Ei(qo.current);var e=Ei(on.current),r=p1(e,t.type);e!==r&&($e(Qo,t),$e(on,r))}function _0(t){Qo.current===t&&(Xe(on),Xe(Qo))}var et=si(0);function oc(t){for(var e=t;e!==null;){if(e.tag===13){var r=e.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Ef=[];function N0(){for(var t=0;t<Ef.length;t++)Ef[t]._workInProgressVersionPrimary=null;Ef.length=0}var Rl=Rn.ReactCurrentDispatcher,Af=Rn.ReactCurrentBatchConfig,Oi=0,tt=null,Et=null,Tt=null,ac=!1,_o=!1,Jo=0,IT=0;function jt(){throw Error(q(321))}function O0(t,e){if(e===null)return!1;for(var r=0;r<e.length&&r<t.length;r++)if(!$r(t[r],e[r]))return!1;return!0}function k0(t,e,r,o,l,u){if(Oi=u,tt=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Rl.current=t===null||t.memoizedState===null?NT:OT,t=r(o,l),_o){u=0;do{if(_o=!1,Jo=0,25<=u)throw Error(q(301));u+=1,Tt=Et=null,e.updateQueue=null,Rl.current=kT,t=r(o,l)}while(_o)}if(Rl.current=lc,e=Et!==null&&Et.next!==null,Oi=0,Tt=Et=tt=null,ac=!1,e)throw Error(q(300));return t}function M0(){var t=Jo!==0;return Jo=0,t}function rn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Tt===null?tt.memoizedState=Tt=t:Tt=Tt.next=t,Tt}function Or(){if(Et===null){var t=tt.alternate;t=t!==null?t.memoizedState:null}else t=Et.next;var e=Tt===null?tt.memoizedState:Tt.next;if(e!==null)Tt=e,Et=t;else{if(t===null)throw Error(q(310));Et=t,t={memoizedState:Et.memoizedState,baseState:Et.baseState,baseQueue:Et.baseQueue,queue:Et.queue,next:null},Tt===null?tt.memoizedState=Tt=t:Tt=Tt.next=t}return Tt}function ea(t,e){return typeof e=="function"?e(t):e}function bf(t){var e=Or(),r=e.queue;if(r===null)throw Error(q(311));r.lastRenderedReducer=t;var o=Et,l=o.baseQueue,u=r.pending;if(u!==null){if(l!==null){var h=l.next;l.next=u.next,u.next=h}o.baseQueue=l=u,r.pending=null}if(l!==null){u=l.next,o=o.baseState;var x=h=null,w=null,m=u;do{var y=m.lane;if((Oi&y)===y)w!==null&&(w=w.next={lane:0,action:m.action,hasEagerState:m.hasEagerState,eagerState:m.eagerState,next:null}),o=m.hasEagerState?m.eagerState:t(o,m.action);else{var b={lane:y,action:m.action,hasEagerState:m.hasEagerState,eagerState:m.eagerState,next:null};w===null?(x=w=b,h=o):w=w.next=b,tt.lanes|=y,ki|=y}m=m.next}while(m!==null&&m!==u);w===null?h=o:w.next=x,$r(o,e.memoizedState)||(or=!0),e.memoizedState=o,e.baseState=h,e.baseQueue=w,r.lastRenderedState=o}if(t=r.interleaved,t!==null){l=t;do u=l.lane,tt.lanes|=u,ki|=u,l=l.next;while(l!==t)}else l===null&&(r.lanes=0);return[e.memoizedState,r.dispatch]}function Cf(t){var e=Or(),r=e.queue;if(r===null)throw Error(q(311));r.lastRenderedReducer=t;var o=r.dispatch,l=r.pending,u=e.memoizedState;if(l!==null){r.pending=null;var h=l=l.next;do u=t(u,h.action),h=h.next;while(h!==l);$r(u,e.memoizedState)||(or=!0),e.memoizedState=u,e.baseQueue===null&&(e.baseState=u),r.lastRenderedState=u}return[u,o]}function sv(){}function ov(t,e){var r=tt,o=Or(),l=e(),u=!$r(o.memoizedState,l);if(u&&(o.memoizedState=l,or=!0),o=o.queue,D0(cv.bind(null,r,o,t),[t]),o.getSnapshot!==e||u||Tt!==null&&Tt.memoizedState.tag&1){if(r.flags|=2048,ta(9,lv.bind(null,r,o,l,e),void 0,null),Rt===null)throw Error(q(349));Oi&30||av(r,e,l)}return l}function av(t,e,r){t.flags|=16384,t={getSnapshot:e,value:r},e=tt.updateQueue,e===null?(e={lastEffect:null,stores:null},tt.updateQueue=e,e.stores=[t]):(r=e.stores,r===null?e.stores=[t]:r.push(t))}function lv(t,e,r,o){e.value=r,e.getSnapshot=o,uv(e)&&fv(t)}function cv(t,e,r){return r(function(){uv(e)&&fv(t)})}function uv(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!$r(t,r)}catch{return!0}}function fv(t){var e=Cn(t,1);e!==null&&zr(e,t,1,-1)}function Lp(t){var e=rn();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ea,lastRenderedState:t},e.queue=t,t=t.dispatch=_T.bind(null,tt,t),[e.memoizedState,t]}function ta(t,e,r,o){return t={tag:t,create:e,destroy:r,deps:o,next:null},e=tt.updateQueue,e===null?(e={lastEffect:null,stores:null},tt.updateQueue=e,e.lastEffect=t.next=t):(r=e.lastEffect,r===null?e.lastEffect=t.next=t:(o=r.next,r.next=t,t.next=o,e.lastEffect=t)),t}function dv(){return Or().memoizedState}function _l(t,e,r,o){var l=rn();tt.flags|=t,l.memoizedState=ta(1|e,r,void 0,o===void 0?null:o)}function zc(t,e,r,o){var l=Or();o=o===void 0?null:o;var u=void 0;if(Et!==null){var h=Et.memoizedState;if(u=h.destroy,o!==null&&O0(o,h.deps)){l.memoizedState=ta(e,r,u,o);return}}tt.flags|=t,l.memoizedState=ta(1|e,r,u,o)}function Bp(t,e){return _l(8390656,8,t,e)}function D0(t,e){return zc(2048,8,t,e)}function hv(t,e){return zc(4,2,t,e)}function gv(t,e){return zc(4,4,t,e)}function pv(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function mv(t,e,r){return r=r!=null?r.concat([t]):null,zc(4,4,pv.bind(null,e,t),r)}function P0(){}function xv(t,e){var r=Or();e=e===void 0?null:e;var o=r.memoizedState;return o!==null&&e!==null&&O0(e,o[1])?o[0]:(r.memoizedState=[t,e],t)}function wv(t,e){var r=Or();e=e===void 0?null:e;var o=r.memoizedState;return o!==null&&e!==null&&O0(e,o[1])?o[0]:(t=t(),r.memoizedState=[t,e],t)}function vv(t,e,r){return Oi&21?($r(r,e)||(r=Cw(),tt.lanes|=r,ki|=r,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,or=!0),t.memoizedState=r)}function TT(t,e){var r=Be;Be=r!==0&&4>r?r:4,t(!0);var o=Af.transition;Af.transition={};try{t(!1),e()}finally{Be=r,Af.transition=o}}function yv(){return Or().memoizedState}function RT(t,e,r){var o=qn(t);if(r={lane:o,action:r,hasEagerState:!1,eagerState:null,next:null},Ev(t))Av(e,r);else if(r=rv(t,e,r,o),r!==null){var l=Xt();zr(r,t,o,l),bv(r,e,o)}}function _T(t,e,r){var o=qn(t),l={lane:o,action:r,hasEagerState:!1,eagerState:null,next:null};if(Ev(t))Av(e,l);else{var u=t.alternate;if(t.lanes===0&&(u===null||u.lanes===0)&&(u=e.lastRenderedReducer,u!==null))try{var h=e.lastRenderedState,x=u(h,r);if(l.hasEagerState=!0,l.eagerState=x,$r(x,h)){var w=e.interleaved;w===null?(l.next=l,I0(e)):(l.next=w.next,w.next=l),e.interleaved=l;return}}catch{}finally{}r=rv(t,e,l,o),r!==null&&(l=Xt(),zr(r,t,o,l),bv(r,e,o))}}function Ev(t){var e=t.alternate;return t===tt||e!==null&&e===tt}function Av(t,e){_o=ac=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function bv(t,e,r){if(r&4194240){var o=e.lanes;o&=t.pendingLanes,r|=o,e.lanes=r,d0(t,r)}}var lc={readContext:Nr,useCallback:jt,useContext:jt,useEffect:jt,useImperativeHandle:jt,useInsertionEffect:jt,useLayoutEffect:jt,useMemo:jt,useReducer:jt,useRef:jt,useState:jt,useDebugValue:jt,useDeferredValue:jt,useTransition:jt,useMutableSource:jt,useSyncExternalStore:jt,useId:jt,unstable_isNewReconciler:!1},NT={readContext:Nr,useCallback:function(t,e){return rn().memoizedState=[t,e===void 0?null:e],t},useContext:Nr,useEffect:Bp,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,_l(4194308,4,pv.bind(null,e,t),r)},useLayoutEffect:function(t,e){return _l(4194308,4,t,e)},useInsertionEffect:function(t,e){return _l(4,2,t,e)},useMemo:function(t,e){var r=rn();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var o=rn();return e=r!==void 0?r(e):e,o.memoizedState=o.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},o.queue=t,t=t.dispatch=RT.bind(null,tt,t),[o.memoizedState,t]},useRef:function(t){var e=rn();return t={current:t},e.memoizedState=t},useState:Lp,useDebugValue:P0,useDeferredValue:function(t){return rn().memoizedState=t},useTransition:function(){var t=Lp(!1),e=t[0];return t=TT.bind(null,t[1]),rn().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var o=tt,l=rn();if(Ze){if(r===void 0)throw Error(q(407));r=r()}else{if(r=e(),Rt===null)throw Error(q(349));Oi&30||av(o,e,r)}l.memoizedState=r;var u={value:r,getSnapshot:e};return l.queue=u,Bp(cv.bind(null,o,u,t),[t]),o.flags|=2048,ta(9,lv.bind(null,o,u,r,e),void 0,null),r},useId:function(){var t=rn(),e=Rt.identifierPrefix;if(Ze){var r=wn,o=xn;r=(o&~(1<<32-Vr(o)-1)).toString(32)+r,e=":"+e+"R"+r,r=Jo++,0<r&&(e+="H"+r.toString(32)),e+=":"}else r=IT++,e=":"+e+"r"+r.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},OT={readContext:Nr,useCallback:xv,useContext:Nr,useEffect:D0,useImperativeHandle:mv,useInsertionEffect:hv,useLayoutEffect:gv,useMemo:wv,useReducer:bf,useRef:dv,useState:function(){return bf(ea)},useDebugValue:P0,useDeferredValue:function(t){var e=Or();return vv(e,Et.memoizedState,t)},useTransition:function(){var t=bf(ea)[0],e=Or().memoizedState;return[t,e]},useMutableSource:sv,useSyncExternalStore:ov,useId:yv,unstable_isNewReconciler:!1},kT={readContext:Nr,useCallback:xv,useContext:Nr,useEffect:D0,useImperativeHandle:mv,useInsertionEffect:hv,useLayoutEffect:gv,useMemo:wv,useReducer:Cf,useRef:dv,useState:function(){return Cf(ea)},useDebugValue:P0,useDeferredValue:function(t){var e=Or();return Et===null?e.memoizedState=t:vv(e,Et.memoizedState,t)},useTransition:function(){var t=Cf(ea)[0],e=Or().memoizedState;return[t,e]},useMutableSource:sv,useSyncExternalStore:ov,useId:yv,unstable_isNewReconciler:!1};function Fr(t,e){if(t&&t.defaultProps){e=rt({},e),t=t.defaultProps;for(var r in t)e[r]===void 0&&(e[r]=t[r]);return e}return e}function L1(t,e,r,o){e=t.memoizedState,r=r(o,e),r=r==null?e:rt({},e,r),t.memoizedState=r,t.lanes===0&&(t.updateQueue.baseState=r)}var $c={isMounted:function(t){return(t=t._reactInternals)?Fi(t)===t:!1},enqueueSetState:function(t,e,r){t=t._reactInternals;var o=Xt(),l=qn(t),u=vn(o,l);u.payload=e,r!=null&&(u.callback=r),e=Zn(t,u,l),e!==null&&(zr(e,t,l,o),Tl(e,t,l))},enqueueReplaceState:function(t,e,r){t=t._reactInternals;var o=Xt(),l=qn(t),u=vn(o,l);u.tag=1,u.payload=e,r!=null&&(u.callback=r),e=Zn(t,u,l),e!==null&&(zr(e,t,l,o),Tl(e,t,l))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var r=Xt(),o=qn(t),l=vn(r,o);l.tag=2,e!=null&&(l.callback=e),e=Zn(t,l,o),e!==null&&(zr(e,t,o,r),Tl(e,t,o))}};function Fp(t,e,r,o,l,u,h){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(o,u,h):e.prototype&&e.prototype.isPureReactComponent?!Xo(r,o)||!Xo(l,u):!0}function Cv(t,e,r){var o=!1,l=ti,u=e.contextType;return typeof u=="object"&&u!==null?u=Nr(u):(l=lr(e)?_i:zt.current,o=e.contextTypes,u=(o=o!=null)?Rs(t,l):ti),e=new e(r,u),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=$c,t.stateNode=e,e._reactInternals=t,o&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=l,t.__reactInternalMemoizedMaskedChildContext=u),e}function Up(t,e,r,o){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(r,o),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(r,o),e.state!==t&&$c.enqueueReplaceState(e,e.state,null)}function B1(t,e,r,o){var l=t.stateNode;l.props=r,l.state=t.memoizedState,l.refs={},T0(t);var u=e.contextType;typeof u=="object"&&u!==null?l.context=Nr(u):(u=lr(e)?_i:zt.current,l.context=Rs(t,u)),l.state=t.memoizedState,u=e.getDerivedStateFromProps,typeof u=="function"&&(L1(t,e,u,r),l.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof l.getSnapshotBeforeUpdate=="function"||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(e=l.state,typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount(),e!==l.state&&$c.enqueueReplaceState(l,l.state,null),sc(t,r,l,o),l.state=t.memoizedState),typeof l.componentDidMount=="function"&&(t.flags|=4194308)}function ks(t,e){try{var r="",o=e;do r+=o7(o),o=o.return;while(o);var l=r}catch(u){l=`
56
+ Error generating stack: `+u.message+`
57
+ `+u.stack}return{value:t,source:e,stack:l,digest:null}}function Sf(t,e,r){return{value:t,source:null,stack:r??null,digest:e??null}}function F1(t,e){try{console.error(e.value)}catch(r){setTimeout(function(){throw r})}}var MT=typeof WeakMap=="function"?WeakMap:Map;function Sv(t,e,r){r=vn(-1,r),r.tag=3,r.payload={element:null};var o=e.value;return r.callback=function(){uc||(uc=!0,Y1=o),F1(t,e)},r}function Iv(t,e,r){r=vn(-1,r),r.tag=3;var o=t.type.getDerivedStateFromError;if(typeof o=="function"){var l=e.value;r.payload=function(){return o(l)},r.callback=function(){F1(t,e)}}var u=t.stateNode;return u!==null&&typeof u.componentDidCatch=="function"&&(r.callback=function(){F1(t,e),typeof o!="function"&&(Qn===null?Qn=new Set([this]):Qn.add(this));var h=e.stack;this.componentDidCatch(e.value,{componentStack:h!==null?h:""})}),r}function jp(t,e,r){var o=t.pingCache;if(o===null){o=t.pingCache=new MT;var l=new Set;o.set(e,l)}else l=o.get(e),l===void 0&&(l=new Set,o.set(e,l));l.has(r)||(l.add(r),t=XT.bind(null,t,e,r),e.then(t,t))}function Wp(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function Vp(t,e,r,o,l){return t.mode&1?(t.flags|=65536,t.lanes=l,t):(t===e?t.flags|=65536:(t.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(e=vn(-1,1),e.tag=2,Zn(r,e,1))),r.lanes|=1),t)}var DT=Rn.ReactCurrentOwner,or=!1;function Gt(t,e,r,o){e.child=t===null?tv(e,null,r,o):Ns(e,t.child,r,o)}function zp(t,e,r,o,l){r=r.render;var u=e.ref;return Es(e,l),o=k0(t,e,r,o,u,l),r=M0(),t!==null&&!or?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~l,Sn(t,e,l)):(Ze&&r&&y0(e),e.flags|=1,Gt(t,e,o,l),e.child)}function $p(t,e,r,o,l){if(t===null){var u=r.type;return typeof u=="function"&&!z0(u)&&u.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(e.tag=15,e.type=u,Tv(t,e,u,o,l)):(t=Ml(r.type,null,o,e,e.mode,l),t.ref=e.ref,t.return=e,e.child=t)}if(u=t.child,!(t.lanes&l)){var h=u.memoizedProps;if(r=r.compare,r=r!==null?r:Xo,r(h,o)&&t.ref===e.ref)return Sn(t,e,l)}return e.flags|=1,t=Jn(u,o),t.ref=e.ref,t.return=e,e.child=t}function Tv(t,e,r,o,l){if(t!==null){var u=t.memoizedProps;if(Xo(u,o)&&t.ref===e.ref)if(or=!1,e.pendingProps=o=u,(t.lanes&l)!==0)t.flags&131072&&(or=!0);else return e.lanes=t.lanes,Sn(t,e,l)}return U1(t,e,r,o,l)}function Rv(t,e,r){var o=e.pendingProps,l=o.children,u=t!==null?t.memoizedState:null;if(o.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},$e(hs,hr),hr|=r;else{if(!(r&1073741824))return t=u!==null?u.baseLanes|r:r,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,$e(hs,hr),hr|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},o=u!==null?u.baseLanes:r,$e(hs,hr),hr|=o}else u!==null?(o=u.baseLanes|r,e.memoizedState=null):o=r,$e(hs,hr),hr|=o;return Gt(t,e,l,r),e.child}function _v(t,e){var r=e.ref;(t===null&&r!==null||t!==null&&t.ref!==r)&&(e.flags|=512,e.flags|=2097152)}function U1(t,e,r,o,l){var u=lr(r)?_i:zt.current;return u=Rs(e,u),Es(e,l),r=k0(t,e,r,o,u,l),o=M0(),t!==null&&!or?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~l,Sn(t,e,l)):(Ze&&o&&y0(e),e.flags|=1,Gt(t,e,r,l),e.child)}function Hp(t,e,r,o,l){if(lr(r)){var u=!0;ec(e)}else u=!1;if(Es(e,l),e.stateNode===null)Nl(t,e),Cv(e,r,o),B1(e,r,o,l),o=!0;else if(t===null){var h=e.stateNode,x=e.memoizedProps;h.props=x;var w=h.context,m=r.contextType;typeof m=="object"&&m!==null?m=Nr(m):(m=lr(r)?_i:zt.current,m=Rs(e,m));var y=r.getDerivedStateFromProps,b=typeof y=="function"||typeof h.getSnapshotBeforeUpdate=="function";b||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(x!==o||w!==m)&&Up(e,h,o,m),Un=!1;var C=e.memoizedState;h.state=C,sc(e,o,h,l),w=e.memoizedState,x!==o||C!==w||ar.current||Un?(typeof y=="function"&&(L1(e,r,y,o),w=e.memoizedState),(x=Un||Fp(e,r,x,o,C,w,m))?(b||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(e.flags|=4194308)):(typeof h.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=o,e.memoizedState=w),h.props=o,h.state=w,h.context=m,o=x):(typeof h.componentDidMount=="function"&&(e.flags|=4194308),o=!1)}else{h=e.stateNode,nv(t,e),x=e.memoizedProps,m=e.type===e.elementType?x:Fr(e.type,x),h.props=m,b=e.pendingProps,C=h.context,w=r.contextType,typeof w=="object"&&w!==null?w=Nr(w):(w=lr(r)?_i:zt.current,w=Rs(e,w));var T=r.getDerivedStateFromProps;(y=typeof T=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(x!==b||C!==w)&&Up(e,h,o,w),Un=!1,C=e.memoizedState,h.state=C,sc(e,o,h,l);var k=e.memoizedState;x!==b||C!==k||ar.current||Un?(typeof T=="function"&&(L1(e,r,T,o),k=e.memoizedState),(m=Un||Fp(e,r,m,o,C,k,w)||!1)?(y||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(o,k,w),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(o,k,w)),typeof h.componentDidUpdate=="function"&&(e.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof h.componentDidUpdate!="function"||x===t.memoizedProps&&C===t.memoizedState||(e.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||x===t.memoizedProps&&C===t.memoizedState||(e.flags|=1024),e.memoizedProps=o,e.memoizedState=k),h.props=o,h.state=k,h.context=w,o=m):(typeof h.componentDidUpdate!="function"||x===t.memoizedProps&&C===t.memoizedState||(e.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||x===t.memoizedProps&&C===t.memoizedState||(e.flags|=1024),o=!1)}return j1(t,e,r,o,u,l)}function j1(t,e,r,o,l,u){_v(t,e);var h=(e.flags&128)!==0;if(!o&&!h)return l&&Np(e,r,!1),Sn(t,e,u);o=e.stateNode,DT.current=e;var x=h&&typeof r.getDerivedStateFromError!="function"?null:o.render();return e.flags|=1,t!==null&&h?(e.child=Ns(e,t.child,null,u),e.child=Ns(e,null,x,u)):Gt(t,e,x,u),e.memoizedState=o.state,l&&Np(e,r,!0),e.child}function Nv(t){var e=t.stateNode;e.pendingContext?_p(t,e.pendingContext,e.pendingContext!==e.context):e.context&&_p(t,e.context,!1),R0(t,e.containerInfo)}function Gp(t,e,r,o,l){return _s(),A0(l),e.flags|=256,Gt(t,e,r,o),e.child}var W1={dehydrated:null,treeContext:null,retryLane:0};function V1(t){return{baseLanes:t,cachePool:null,transitions:null}}function Ov(t,e,r){var o=e.pendingProps,l=et.current,u=!1,h=(e.flags&128)!==0,x;if((x=h)||(x=t!==null&&t.memoizedState===null?!1:(l&2)!==0),x?(u=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(l|=1),$e(et,l&1),t===null)return D1(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(h=o.children,t=o.fallback,u?(o=e.mode,u=e.child,h={mode:"hidden",children:h},!(o&1)&&u!==null?(u.childLanes=0,u.pendingProps=h):u=Xc(h,o,0,null),t=Si(t,o,r,null),u.return=e,t.return=e,u.sibling=t,e.child=u,e.child.memoizedState=V1(r),e.memoizedState=W1,t):L0(e,h));if(l=t.memoizedState,l!==null&&(x=l.dehydrated,x!==null))return PT(t,e,h,o,x,l,r);if(u){u=o.fallback,h=e.mode,l=t.child,x=l.sibling;var w={mode:"hidden",children:o.children};return!(h&1)&&e.child!==l?(o=e.child,o.childLanes=0,o.pendingProps=w,e.deletions=null):(o=Jn(l,w),o.subtreeFlags=l.subtreeFlags&14680064),x!==null?u=Jn(x,u):(u=Si(u,h,r,null),u.flags|=2),u.return=e,o.return=e,o.sibling=u,e.child=o,o=u,u=e.child,h=t.child.memoizedState,h=h===null?V1(r):{baseLanes:h.baseLanes|r,cachePool:null,transitions:h.transitions},u.memoizedState=h,u.childLanes=t.childLanes&~r,e.memoizedState=W1,o}return u=t.child,t=u.sibling,o=Jn(u,{mode:"visible",children:o.children}),!(e.mode&1)&&(o.lanes=r),o.return=e,o.sibling=null,t!==null&&(r=e.deletions,r===null?(e.deletions=[t],e.flags|=16):r.push(t)),e.child=o,e.memoizedState=null,o}function L0(t,e){return e=Xc({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function ol(t,e,r,o){return o!==null&&A0(o),Ns(e,t.child,null,r),t=L0(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function PT(t,e,r,o,l,u,h){if(r)return e.flags&256?(e.flags&=-257,o=Sf(Error(q(422))),ol(t,e,h,o)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(u=o.fallback,l=e.mode,o=Xc({mode:"visible",children:o.children},l,0,null),u=Si(u,l,h,null),u.flags|=2,o.return=e,u.return=e,o.sibling=u,e.child=o,e.mode&1&&Ns(e,t.child,null,h),e.child.memoizedState=V1(h),e.memoizedState=W1,u);if(!(e.mode&1))return ol(t,e,h,null);if(l.data==="$!"){if(o=l.nextSibling&&l.nextSibling.dataset,o)var x=o.dgst;return o=x,u=Error(q(419)),o=Sf(u,o,void 0),ol(t,e,h,o)}if(x=(h&t.childLanes)!==0,or||x){if(o=Rt,o!==null){switch(h&-h){case 4:l=2;break;case 16:l=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:l=32;break;case 536870912:l=268435456;break;default:l=0}l=l&(o.suspendedLanes|h)?0:l,l!==0&&l!==u.retryLane&&(u.retryLane=l,Cn(t,l),zr(o,t,l,-1))}return V0(),o=Sf(Error(q(421))),ol(t,e,h,o)}return l.data==="$?"?(e.flags|=128,e.child=t.child,e=YT.bind(null,t),l._reactRetry=e,null):(t=u.treeContext,gr=Kn(l.nextSibling),pr=e,Ze=!0,Wr=null,t!==null&&(Ir[Tr++]=xn,Ir[Tr++]=wn,Ir[Tr++]=Ni,xn=t.id,wn=t.overflow,Ni=e),e=L0(e,o.children),e.flags|=4096,e)}function Xp(t,e,r){t.lanes|=e;var o=t.alternate;o!==null&&(o.lanes|=e),P1(t.return,e,r)}function If(t,e,r,o,l){var u=t.memoizedState;u===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:o,tail:r,tailMode:l}:(u.isBackwards=e,u.rendering=null,u.renderingStartTime=0,u.last=o,u.tail=r,u.tailMode=l)}function kv(t,e,r){var o=e.pendingProps,l=o.revealOrder,u=o.tail;if(Gt(t,e,o.children,r),o=et.current,o&2)o=o&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Xp(t,r,e);else if(t.tag===19)Xp(t,r,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}o&=1}if($e(et,o),!(e.mode&1))e.memoizedState=null;else switch(l){case"forwards":for(r=e.child,l=null;r!==null;)t=r.alternate,t!==null&&oc(t)===null&&(l=r),r=r.sibling;r=l,r===null?(l=e.child,e.child=null):(l=r.sibling,r.sibling=null),If(e,!1,l,r,u);break;case"backwards":for(r=null,l=e.child,e.child=null;l!==null;){if(t=l.alternate,t!==null&&oc(t)===null){e.child=l;break}t=l.sibling,l.sibling=r,r=l,l=t}If(e,!0,r,null,u);break;case"together":If(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Nl(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function Sn(t,e,r){if(t!==null&&(e.dependencies=t.dependencies),ki|=e.lanes,!(r&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(q(153));if(e.child!==null){for(t=e.child,r=Jn(t,t.pendingProps),e.child=r,r.return=e;t.sibling!==null;)t=t.sibling,r=r.sibling=Jn(t,t.pendingProps),r.return=e;r.sibling=null}return e.child}function LT(t,e,r){switch(e.tag){case 3:Nv(e),_s();break;case 5:iv(e);break;case 1:lr(e.type)&&ec(e);break;case 4:R0(e,e.stateNode.containerInfo);break;case 10:var o=e.type._context,l=e.memoizedProps.value;$e(nc,o._currentValue),o._currentValue=l;break;case 13:if(o=e.memoizedState,o!==null)return o.dehydrated!==null?($e(et,et.current&1),e.flags|=128,null):r&e.child.childLanes?Ov(t,e,r):($e(et,et.current&1),t=Sn(t,e,r),t!==null?t.sibling:null);$e(et,et.current&1);break;case 19:if(o=(r&e.childLanes)!==0,t.flags&128){if(o)return kv(t,e,r);e.flags|=128}if(l=e.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),$e(et,et.current),o)break;return null;case 22:case 23:return e.lanes=0,Rv(t,e,r)}return Sn(t,e,r)}var Mv,z1,Dv,Pv;Mv=function(t,e){for(var r=e.child;r!==null;){if(r.tag===5||r.tag===6)t.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};z1=function(){};Dv=function(t,e,r,o){var l=t.memoizedProps;if(l!==o){t=e.stateNode,Ei(on.current);var u=null;switch(r){case"input":l=f1(t,l),o=f1(t,o),u=[];break;case"select":l=rt({},l,{value:void 0}),o=rt({},o,{value:void 0}),u=[];break;case"textarea":l=g1(t,l),o=g1(t,o),u=[];break;default:typeof l.onClick!="function"&&typeof o.onClick=="function"&&(t.onclick=ql)}m1(r,o);var h;r=null;for(m in l)if(!o.hasOwnProperty(m)&&l.hasOwnProperty(m)&&l[m]!=null)if(m==="style"){var x=l[m];for(h in x)x.hasOwnProperty(h)&&(r||(r={}),r[h]="")}else m!=="dangerouslySetInnerHTML"&&m!=="children"&&m!=="suppressContentEditableWarning"&&m!=="suppressHydrationWarning"&&m!=="autoFocus"&&(jo.hasOwnProperty(m)?u||(u=[]):(u=u||[]).push(m,null));for(m in o){var w=o[m];if(x=l!=null?l[m]:void 0,o.hasOwnProperty(m)&&w!==x&&(w!=null||x!=null))if(m==="style")if(x){for(h in x)!x.hasOwnProperty(h)||w&&w.hasOwnProperty(h)||(r||(r={}),r[h]="");for(h in w)w.hasOwnProperty(h)&&x[h]!==w[h]&&(r||(r={}),r[h]=w[h])}else r||(u||(u=[]),u.push(m,r)),r=w;else m==="dangerouslySetInnerHTML"?(w=w?w.__html:void 0,x=x?x.__html:void 0,w!=null&&x!==w&&(u=u||[]).push(m,w)):m==="children"?typeof w!="string"&&typeof w!="number"||(u=u||[]).push(m,""+w):m!=="suppressContentEditableWarning"&&m!=="suppressHydrationWarning"&&(jo.hasOwnProperty(m)?(w!=null&&m==="onScroll"&&Ge("scroll",t),u||x===w||(u=[])):(u=u||[]).push(m,w))}r&&(u=u||[]).push("style",r);var m=u;(e.updateQueue=m)&&(e.flags|=4)}};Pv=function(t,e,r,o){r!==o&&(e.flags|=4)};function uo(t,e){if(!Ze)switch(t.tailMode){case"hidden":e=t.tail;for(var r=null;e!==null;)e.alternate!==null&&(r=e),e=e.sibling;r===null?t.tail=null:r.sibling=null;break;case"collapsed":r=t.tail;for(var o=null;r!==null;)r.alternate!==null&&(o=r),r=r.sibling;o===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:o.sibling=null}}function Wt(t){var e=t.alternate!==null&&t.alternate.child===t.child,r=0,o=0;if(e)for(var l=t.child;l!==null;)r|=l.lanes|l.childLanes,o|=l.subtreeFlags&14680064,o|=l.flags&14680064,l.return=t,l=l.sibling;else for(l=t.child;l!==null;)r|=l.lanes|l.childLanes,o|=l.subtreeFlags,o|=l.flags,l.return=t,l=l.sibling;return t.subtreeFlags|=o,t.childLanes=r,e}function BT(t,e,r){var o=e.pendingProps;switch(E0(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Wt(e),null;case 1:return lr(e.type)&&Jl(),Wt(e),null;case 3:return o=e.stateNode,Os(),Xe(ar),Xe(zt),N0(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(t===null||t.child===null)&&(il(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Wr!==null&&(Q1(Wr),Wr=null))),z1(t,e),Wt(e),null;case 5:_0(e);var l=Ei(qo.current);if(r=e.type,t!==null&&e.stateNode!=null)Dv(t,e,r,o,l),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!o){if(e.stateNode===null)throw Error(q(166));return Wt(e),null}if(t=Ei(on.current),il(e)){o=e.stateNode,r=e.type;var u=e.memoizedProps;switch(o[nn]=e,o[Zo]=u,t=(e.mode&1)!==0,r){case"dialog":Ge("cancel",o),Ge("close",o);break;case"iframe":case"object":case"embed":Ge("load",o);break;case"video":case"audio":for(l=0;l<vo.length;l++)Ge(vo[l],o);break;case"source":Ge("error",o);break;case"img":case"image":case"link":Ge("error",o),Ge("load",o);break;case"details":Ge("toggle",o);break;case"input":rp(o,u),Ge("invalid",o);break;case"select":o._wrapperState={wasMultiple:!!u.multiple},Ge("invalid",o);break;case"textarea":ip(o,u),Ge("invalid",o)}m1(r,u),l=null;for(var h in u)if(u.hasOwnProperty(h)){var x=u[h];h==="children"?typeof x=="string"?o.textContent!==x&&(u.suppressHydrationWarning!==!0&&nl(o.textContent,x,t),l=["children",x]):typeof x=="number"&&o.textContent!==""+x&&(u.suppressHydrationWarning!==!0&&nl(o.textContent,x,t),l=["children",""+x]):jo.hasOwnProperty(h)&&x!=null&&h==="onScroll"&&Ge("scroll",o)}switch(r){case"input":Ka(o),np(o,u,!0);break;case"textarea":Ka(o),sp(o);break;case"select":case"option":break;default:typeof u.onClick=="function"&&(o.onclick=ql)}o=l,e.updateQueue=o,o!==null&&(e.flags|=4)}else{h=l.nodeType===9?l:l.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=cw(r)),t==="http://www.w3.org/1999/xhtml"?r==="script"?(t=h.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof o.is=="string"?t=h.createElement(r,{is:o.is}):(t=h.createElement(r),r==="select"&&(h=t,o.multiple?h.multiple=!0:o.size&&(h.size=o.size))):t=h.createElementNS(t,r),t[nn]=e,t[Zo]=o,Mv(t,e,!1,!1),e.stateNode=t;e:{switch(h=x1(r,o),r){case"dialog":Ge("cancel",t),Ge("close",t),l=o;break;case"iframe":case"object":case"embed":Ge("load",t),l=o;break;case"video":case"audio":for(l=0;l<vo.length;l++)Ge(vo[l],t);l=o;break;case"source":Ge("error",t),l=o;break;case"img":case"image":case"link":Ge("error",t),Ge("load",t),l=o;break;case"details":Ge("toggle",t),l=o;break;case"input":rp(t,o),l=f1(t,o),Ge("invalid",t);break;case"option":l=o;break;case"select":t._wrapperState={wasMultiple:!!o.multiple},l=rt({},o,{value:void 0}),Ge("invalid",t);break;case"textarea":ip(t,o),l=g1(t,o),Ge("invalid",t);break;default:l=o}m1(r,l),x=l;for(u in x)if(x.hasOwnProperty(u)){var w=x[u];u==="style"?dw(t,w):u==="dangerouslySetInnerHTML"?(w=w?w.__html:void 0,w!=null&&uw(t,w)):u==="children"?typeof w=="string"?(r!=="textarea"||w!=="")&&Wo(t,w):typeof w=="number"&&Wo(t,""+w):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(jo.hasOwnProperty(u)?w!=null&&u==="onScroll"&&Ge("scroll",t):w!=null&&o0(t,u,w,h))}switch(r){case"input":Ka(t),np(t,o,!1);break;case"textarea":Ka(t),sp(t);break;case"option":o.value!=null&&t.setAttribute("value",""+ei(o.value));break;case"select":t.multiple=!!o.multiple,u=o.value,u!=null?xs(t,!!o.multiple,u,!1):o.defaultValue!=null&&xs(t,!!o.multiple,o.defaultValue,!0);break;default:typeof l.onClick=="function"&&(t.onclick=ql)}switch(r){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}}o&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return Wt(e),null;case 6:if(t&&e.stateNode!=null)Pv(t,e,t.memoizedProps,o);else{if(typeof o!="string"&&e.stateNode===null)throw Error(q(166));if(r=Ei(qo.current),Ei(on.current),il(e)){if(o=e.stateNode,r=e.memoizedProps,o[nn]=e,(u=o.nodeValue!==r)&&(t=pr,t!==null))switch(t.tag){case 3:nl(o.nodeValue,r,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&nl(o.nodeValue,r,(t.mode&1)!==0)}u&&(e.flags|=4)}else o=(r.nodeType===9?r:r.ownerDocument).createTextNode(o),o[nn]=e,e.stateNode=o}return Wt(e),null;case 13:if(Xe(et),o=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(Ze&&gr!==null&&e.mode&1&&!(e.flags&128))Jw(),_s(),e.flags|=98560,u=!1;else if(u=il(e),o!==null&&o.dehydrated!==null){if(t===null){if(!u)throw Error(q(318));if(u=e.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(q(317));u[nn]=e}else _s(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Wt(e),u=!1}else Wr!==null&&(Q1(Wr),Wr=null),u=!0;if(!u)return e.flags&65536?e:null}return e.flags&128?(e.lanes=r,e):(o=o!==null,o!==(t!==null&&t.memoizedState!==null)&&o&&(e.child.flags|=8192,e.mode&1&&(t===null||et.current&1?At===0&&(At=3):V0())),e.updateQueue!==null&&(e.flags|=4),Wt(e),null);case 4:return Os(),z1(t,e),t===null&&Yo(e.stateNode.containerInfo),Wt(e),null;case 10:return S0(e.type._context),Wt(e),null;case 17:return lr(e.type)&&Jl(),Wt(e),null;case 19:if(Xe(et),u=e.memoizedState,u===null)return Wt(e),null;if(o=(e.flags&128)!==0,h=u.rendering,h===null)if(o)uo(u,!1);else{if(At!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(h=oc(t),h!==null){for(e.flags|=128,uo(u,!1),o=h.updateQueue,o!==null&&(e.updateQueue=o,e.flags|=4),e.subtreeFlags=0,o=r,r=e.child;r!==null;)u=r,t=o,u.flags&=14680066,h=u.alternate,h===null?(u.childLanes=0,u.lanes=t,u.child=null,u.subtreeFlags=0,u.memoizedProps=null,u.memoizedState=null,u.updateQueue=null,u.dependencies=null,u.stateNode=null):(u.childLanes=h.childLanes,u.lanes=h.lanes,u.child=h.child,u.subtreeFlags=0,u.deletions=null,u.memoizedProps=h.memoizedProps,u.memoizedState=h.memoizedState,u.updateQueue=h.updateQueue,u.type=h.type,t=h.dependencies,u.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),r=r.sibling;return $e(et,et.current&1|2),e.child}t=t.sibling}u.tail!==null&&ut()>Ms&&(e.flags|=128,o=!0,uo(u,!1),e.lanes=4194304)}else{if(!o)if(t=oc(h),t!==null){if(e.flags|=128,o=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),uo(u,!0),u.tail===null&&u.tailMode==="hidden"&&!h.alternate&&!Ze)return Wt(e),null}else 2*ut()-u.renderingStartTime>Ms&&r!==1073741824&&(e.flags|=128,o=!0,uo(u,!1),e.lanes=4194304);u.isBackwards?(h.sibling=e.child,e.child=h):(r=u.last,r!==null?r.sibling=h:e.child=h,u.last=h)}return u.tail!==null?(e=u.tail,u.rendering=e,u.tail=e.sibling,u.renderingStartTime=ut(),e.sibling=null,r=et.current,$e(et,o?r&1|2:r&1),e):(Wt(e),null);case 22:case 23:return W0(),o=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==o&&(e.flags|=8192),o&&e.mode&1?hr&1073741824&&(Wt(e),e.subtreeFlags&6&&(e.flags|=8192)):Wt(e),null;case 24:return null;case 25:return null}throw Error(q(156,e.tag))}function FT(t,e){switch(E0(e),e.tag){case 1:return lr(e.type)&&Jl(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Os(),Xe(ar),Xe(zt),N0(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return _0(e),null;case 13:if(Xe(et),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(q(340));_s()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Xe(et),null;case 4:return Os(),null;case 10:return S0(e.type._context),null;case 22:case 23:return W0(),null;case 24:return null;default:return null}}var al=!1,Vt=!1,UT=typeof WeakSet=="function"?WeakSet:Set,le=null;function ds(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(o){at(t,e,o)}else r.current=null}function $1(t,e,r){try{r()}catch(o){at(t,e,o)}}var Yp=!1;function jT(t,e){if(T1=Kl,t=jw(),v0(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var o=r.getSelection&&r.getSelection();if(o&&o.rangeCount!==0){r=o.anchorNode;var l=o.anchorOffset,u=o.focusNode;o=o.focusOffset;try{r.nodeType,u.nodeType}catch{r=null;break e}var h=0,x=-1,w=-1,m=0,y=0,b=t,C=null;t:for(;;){for(var T;b!==r||l!==0&&b.nodeType!==3||(x=h+l),b!==u||o!==0&&b.nodeType!==3||(w=h+o),b.nodeType===3&&(h+=b.nodeValue.length),(T=b.firstChild)!==null;)C=b,b=T;for(;;){if(b===t)break t;if(C===r&&++m===l&&(x=h),C===u&&++y===o&&(w=h),(T=b.nextSibling)!==null)break;b=C,C=b.parentNode}b=T}r=x===-1||w===-1?null:{start:x,end:w}}else r=null}r=r||{start:0,end:0}}else r=null;for(R1={focusedElem:t,selectionRange:r},Kl=!1,le=e;le!==null;)if(e=le,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,le=t;else for(;le!==null;){e=le;try{var k=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(k!==null){var D=k.memoizedProps,X=k.memoizedState,O=e.stateNode,I=O.getSnapshotBeforeUpdate(e.elementType===e.type?D:Fr(e.type,D),X);O.__reactInternalSnapshotBeforeUpdate=I}break;case 3:var _=e.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(q(163))}}catch(L){at(e,e.return,L)}if(t=e.sibling,t!==null){t.return=e.return,le=t;break}le=e.return}return k=Yp,Yp=!1,k}function No(t,e,r){var o=e.updateQueue;if(o=o!==null?o.lastEffect:null,o!==null){var l=o=o.next;do{if((l.tag&t)===t){var u=l.destroy;l.destroy=void 0,u!==void 0&&$1(e,r,u)}l=l.next}while(l!==o)}}function Hc(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var r=e=e.next;do{if((r.tag&t)===t){var o=r.create;r.destroy=o()}r=r.next}while(r!==e)}}function H1(t){var e=t.ref;if(e!==null){var r=t.stateNode;switch(t.tag){case 5:t=r;break;default:t=r}typeof e=="function"?e(t):e.current=t}}function Lv(t){var e=t.alternate;e!==null&&(t.alternate=null,Lv(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[nn],delete e[Zo],delete e[O1],delete e[AT],delete e[bT])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function Bv(t){return t.tag===5||t.tag===3||t.tag===4}function Kp(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Bv(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function G1(t,e,r){var o=t.tag;if(o===5||o===6)t=t.stateNode,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=ql));else if(o!==4&&(t=t.child,t!==null))for(G1(t,e,r),t=t.sibling;t!==null;)G1(t,e,r),t=t.sibling}function X1(t,e,r){var o=t.tag;if(o===5||o===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(o!==4&&(t=t.child,t!==null))for(X1(t,e,r),t=t.sibling;t!==null;)X1(t,e,r),t=t.sibling}var Dt=null,Ur=!1;function Bn(t,e,r){for(r=r.child;r!==null;)Fv(t,e,r),r=r.sibling}function Fv(t,e,r){if(sn&&typeof sn.onCommitFiberUnmount=="function")try{sn.onCommitFiberUnmount(Bc,r)}catch{}switch(r.tag){case 5:Vt||ds(r,e);case 6:var o=Dt,l=Ur;Dt=null,Bn(t,e,r),Dt=o,Ur=l,Dt!==null&&(Ur?(t=Dt,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):Dt.removeChild(r.stateNode));break;case 18:Dt!==null&&(Ur?(t=Dt,r=r.stateNode,t.nodeType===8?vf(t.parentNode,r):t.nodeType===1&&vf(t,r),Ho(t)):vf(Dt,r.stateNode));break;case 4:o=Dt,l=Ur,Dt=r.stateNode.containerInfo,Ur=!0,Bn(t,e,r),Dt=o,Ur=l;break;case 0:case 11:case 14:case 15:if(!Vt&&(o=r.updateQueue,o!==null&&(o=o.lastEffect,o!==null))){l=o=o.next;do{var u=l,h=u.destroy;u=u.tag,h!==void 0&&(u&2||u&4)&&$1(r,e,h),l=l.next}while(l!==o)}Bn(t,e,r);break;case 1:if(!Vt&&(ds(r,e),o=r.stateNode,typeof o.componentWillUnmount=="function"))try{o.props=r.memoizedProps,o.state=r.memoizedState,o.componentWillUnmount()}catch(x){at(r,e,x)}Bn(t,e,r);break;case 21:Bn(t,e,r);break;case 22:r.mode&1?(Vt=(o=Vt)||r.memoizedState!==null,Bn(t,e,r),Vt=o):Bn(t,e,r);break;default:Bn(t,e,r)}}function Zp(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new UT),e.forEach(function(o){var l=KT.bind(null,t,o);r.has(o)||(r.add(o),o.then(l,l))})}}function Pr(t,e){var r=e.deletions;if(r!==null)for(var o=0;o<r.length;o++){var l=r[o];try{var u=t,h=e,x=h;e:for(;x!==null;){switch(x.tag){case 5:Dt=x.stateNode,Ur=!1;break e;case 3:Dt=x.stateNode.containerInfo,Ur=!0;break e;case 4:Dt=x.stateNode.containerInfo,Ur=!0;break e}x=x.return}if(Dt===null)throw Error(q(160));Fv(u,h,l),Dt=null,Ur=!1;var w=l.alternate;w!==null&&(w.return=null),l.return=null}catch(m){at(l,e,m)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)Uv(e,t),e=e.sibling}function Uv(t,e){var r=t.alternate,o=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Pr(e,t),tn(t),o&4){try{No(3,t,t.return),Hc(3,t)}catch(D){at(t,t.return,D)}try{No(5,t,t.return)}catch(D){at(t,t.return,D)}}break;case 1:Pr(e,t),tn(t),o&512&&r!==null&&ds(r,r.return);break;case 5:if(Pr(e,t),tn(t),o&512&&r!==null&&ds(r,r.return),t.flags&32){var l=t.stateNode;try{Wo(l,"")}catch(D){at(t,t.return,D)}}if(o&4&&(l=t.stateNode,l!=null)){var u=t.memoizedProps,h=r!==null?r.memoizedProps:u,x=t.type,w=t.updateQueue;if(t.updateQueue=null,w!==null)try{x==="input"&&u.type==="radio"&&u.name!=null&&aw(l,u),x1(x,h);var m=x1(x,u);for(h=0;h<w.length;h+=2){var y=w[h],b=w[h+1];y==="style"?dw(l,b):y==="dangerouslySetInnerHTML"?uw(l,b):y==="children"?Wo(l,b):o0(l,y,b,m)}switch(x){case"input":d1(l,u);break;case"textarea":lw(l,u);break;case"select":var C=l._wrapperState.wasMultiple;l._wrapperState.wasMultiple=!!u.multiple;var T=u.value;T!=null?xs(l,!!u.multiple,T,!1):C!==!!u.multiple&&(u.defaultValue!=null?xs(l,!!u.multiple,u.defaultValue,!0):xs(l,!!u.multiple,u.multiple?[]:"",!1))}l[Zo]=u}catch(D){at(t,t.return,D)}}break;case 6:if(Pr(e,t),tn(t),o&4){if(t.stateNode===null)throw Error(q(162));l=t.stateNode,u=t.memoizedProps;try{l.nodeValue=u}catch(D){at(t,t.return,D)}}break;case 3:if(Pr(e,t),tn(t),o&4&&r!==null&&r.memoizedState.isDehydrated)try{Ho(e.containerInfo)}catch(D){at(t,t.return,D)}break;case 4:Pr(e,t),tn(t);break;case 13:Pr(e,t),tn(t),l=t.child,l.flags&8192&&(u=l.memoizedState!==null,l.stateNode.isHidden=u,!u||l.alternate!==null&&l.alternate.memoizedState!==null||(U0=ut())),o&4&&Zp(t);break;case 22:if(y=r!==null&&r.memoizedState!==null,t.mode&1?(Vt=(m=Vt)||y,Pr(e,t),Vt=m):Pr(e,t),tn(t),o&8192){if(m=t.memoizedState!==null,(t.stateNode.isHidden=m)&&!y&&t.mode&1)for(le=t,y=t.child;y!==null;){for(b=le=y;le!==null;){switch(C=le,T=C.child,C.tag){case 0:case 11:case 14:case 15:No(4,C,C.return);break;case 1:ds(C,C.return);var k=C.stateNode;if(typeof k.componentWillUnmount=="function"){o=C,r=C.return;try{e=o,k.props=e.memoizedProps,k.state=e.memoizedState,k.componentWillUnmount()}catch(D){at(o,r,D)}}break;case 5:ds(C,C.return);break;case 22:if(C.memoizedState!==null){qp(b);continue}}T!==null?(T.return=C,le=T):qp(b)}y=y.sibling}e:for(y=null,b=t;;){if(b.tag===5){if(y===null){y=b;try{l=b.stateNode,m?(u=l.style,typeof u.setProperty=="function"?u.setProperty("display","none","important"):u.display="none"):(x=b.stateNode,w=b.memoizedProps.style,h=w!=null&&w.hasOwnProperty("display")?w.display:null,x.style.display=fw("display",h))}catch(D){at(t,t.return,D)}}}else if(b.tag===6){if(y===null)try{b.stateNode.nodeValue=m?"":b.memoizedProps}catch(D){at(t,t.return,D)}}else if((b.tag!==22&&b.tag!==23||b.memoizedState===null||b===t)&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===t)break e;for(;b.sibling===null;){if(b.return===null||b.return===t)break e;y===b&&(y=null),b=b.return}y===b&&(y=null),b.sibling.return=b.return,b=b.sibling}}break;case 19:Pr(e,t),tn(t),o&4&&Zp(t);break;case 21:break;default:Pr(e,t),tn(t)}}function tn(t){var e=t.flags;if(e&2){try{e:{for(var r=t.return;r!==null;){if(Bv(r)){var o=r;break e}r=r.return}throw Error(q(160))}switch(o.tag){case 5:var l=o.stateNode;o.flags&32&&(Wo(l,""),o.flags&=-33);var u=Kp(t);X1(t,u,l);break;case 3:case 4:var h=o.stateNode.containerInfo,x=Kp(t);G1(t,x,h);break;default:throw Error(q(161))}}catch(w){at(t,t.return,w)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function WT(t,e,r){le=t,jv(t)}function jv(t,e,r){for(var o=(t.mode&1)!==0;le!==null;){var l=le,u=l.child;if(l.tag===22&&o){var h=l.memoizedState!==null||al;if(!h){var x=l.alternate,w=x!==null&&x.memoizedState!==null||Vt;x=al;var m=Vt;if(al=h,(Vt=w)&&!m)for(le=l;le!==null;)h=le,w=h.child,h.tag===22&&h.memoizedState!==null?Jp(l):w!==null?(w.return=h,le=w):Jp(l);for(;u!==null;)le=u,jv(u),u=u.sibling;le=l,al=x,Vt=m}Qp(t)}else l.subtreeFlags&8772&&u!==null?(u.return=l,le=u):Qp(t)}}function Qp(t){for(;le!==null;){var e=le;if(e.flags&8772){var r=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:Vt||Hc(5,e);break;case 1:var o=e.stateNode;if(e.flags&4&&!Vt)if(r===null)o.componentDidMount();else{var l=e.elementType===e.type?r.memoizedProps:Fr(e.type,r.memoizedProps);o.componentDidUpdate(l,r.memoizedState,o.__reactInternalSnapshotBeforeUpdate)}var u=e.updateQueue;u!==null&&Pp(e,u,o);break;case 3:var h=e.updateQueue;if(h!==null){if(r=null,e.child!==null)switch(e.child.tag){case 5:r=e.child.stateNode;break;case 1:r=e.child.stateNode}Pp(e,h,r)}break;case 5:var x=e.stateNode;if(r===null&&e.flags&4){r=x;var w=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":w.autoFocus&&r.focus();break;case"img":w.src&&(r.src=w.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var m=e.alternate;if(m!==null){var y=m.memoizedState;if(y!==null){var b=y.dehydrated;b!==null&&Ho(b)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(q(163))}Vt||e.flags&512&&H1(e)}catch(C){at(e,e.return,C)}}if(e===t){le=null;break}if(r=e.sibling,r!==null){r.return=e.return,le=r;break}le=e.return}}function qp(t){for(;le!==null;){var e=le;if(e===t){le=null;break}var r=e.sibling;if(r!==null){r.return=e.return,le=r;break}le=e.return}}function Jp(t){for(;le!==null;){var e=le;try{switch(e.tag){case 0:case 11:case 15:var r=e.return;try{Hc(4,e)}catch(w){at(e,r,w)}break;case 1:var o=e.stateNode;if(typeof o.componentDidMount=="function"){var l=e.return;try{o.componentDidMount()}catch(w){at(e,l,w)}}var u=e.return;try{H1(e)}catch(w){at(e,u,w)}break;case 5:var h=e.return;try{H1(e)}catch(w){at(e,h,w)}}}catch(w){at(e,e.return,w)}if(e===t){le=null;break}var x=e.sibling;if(x!==null){x.return=e.return,le=x;break}le=e.return}}var VT=Math.ceil,cc=Rn.ReactCurrentDispatcher,B0=Rn.ReactCurrentOwner,_r=Rn.ReactCurrentBatchConfig,Ne=0,Rt=null,pt=null,Lt=0,hr=0,hs=si(0),At=0,ra=null,ki=0,Gc=0,F0=0,Oo=null,sr=null,U0=0,Ms=1/0,gn=null,uc=!1,Y1=null,Qn=null,ll=!1,Hn=null,fc=0,ko=0,K1=null,Ol=-1,kl=0;function Xt(){return Ne&6?ut():Ol!==-1?Ol:Ol=ut()}function qn(t){return t.mode&1?Ne&2&&Lt!==0?Lt&-Lt:ST.transition!==null?(kl===0&&(kl=Cw()),kl):(t=Be,t!==0||(t=window.event,t=t===void 0?16:Ow(t.type)),t):1}function zr(t,e,r,o){if(50<ko)throw ko=0,K1=null,Error(q(185));pa(t,r,o),(!(Ne&2)||t!==Rt)&&(t===Rt&&(!(Ne&2)&&(Gc|=r),At===4&&Wn(t,Lt)),cr(t,o),r===1&&Ne===0&&!(e.mode&1)&&(Ms=ut()+500,Vc&&oi()))}function cr(t,e){var r=t.callbackNode;S7(t,e);var o=Yl(t,t===Rt?Lt:0);if(o===0)r!==null&&lp(r),t.callbackNode=null,t.callbackPriority=0;else if(e=o&-o,t.callbackPriority!==e){if(r!=null&&lp(r),e===1)t.tag===0?CT(e2.bind(null,t)):Zw(e2.bind(null,t)),yT(function(){!(Ne&6)&&oi()}),r=null;else{switch(Sw(o)){case 1:r=f0;break;case 4:r=Aw;break;case 16:r=Xl;break;case 536870912:r=bw;break;default:r=Xl}r=Yv(r,Wv.bind(null,t))}t.callbackPriority=e,t.callbackNode=r}}function Wv(t,e){if(Ol=-1,kl=0,Ne&6)throw Error(q(327));var r=t.callbackNode;if(As()&&t.callbackNode!==r)return null;var o=Yl(t,t===Rt?Lt:0);if(o===0)return null;if(o&30||o&t.expiredLanes||e)e=dc(t,o);else{e=o;var l=Ne;Ne|=2;var u=zv();(Rt!==t||Lt!==e)&&(gn=null,Ms=ut()+500,Ci(t,e));do try{HT();break}catch(x){Vv(t,x)}while(!0);C0(),cc.current=u,Ne=l,pt!==null?e=0:(Rt=null,Lt=0,e=At)}if(e!==0){if(e===2&&(l=A1(t),l!==0&&(o=l,e=Z1(t,l))),e===1)throw r=ra,Ci(t,0),Wn(t,o),cr(t,ut()),r;if(e===6)Wn(t,o);else{if(l=t.current.alternate,!(o&30)&&!zT(l)&&(e=dc(t,o),e===2&&(u=A1(t),u!==0&&(o=u,e=Z1(t,u))),e===1))throw r=ra,Ci(t,0),Wn(t,o),cr(t,ut()),r;switch(t.finishedWork=l,t.finishedLanes=o,e){case 0:case 1:throw Error(q(345));case 2:xi(t,sr,gn);break;case 3:if(Wn(t,o),(o&130023424)===o&&(e=U0+500-ut(),10<e)){if(Yl(t,0)!==0)break;if(l=t.suspendedLanes,(l&o)!==o){Xt(),t.pingedLanes|=t.suspendedLanes&l;break}t.timeoutHandle=N1(xi.bind(null,t,sr,gn),e);break}xi(t,sr,gn);break;case 4:if(Wn(t,o),(o&4194240)===o)break;for(e=t.eventTimes,l=-1;0<o;){var h=31-Vr(o);u=1<<h,h=e[h],h>l&&(l=h),o&=~u}if(o=l,o=ut()-o,o=(120>o?120:480>o?480:1080>o?1080:1920>o?1920:3e3>o?3e3:4320>o?4320:1960*VT(o/1960))-o,10<o){t.timeoutHandle=N1(xi.bind(null,t,sr,gn),o);break}xi(t,sr,gn);break;case 5:xi(t,sr,gn);break;default:throw Error(q(329))}}}return cr(t,ut()),t.callbackNode===r?Wv.bind(null,t):null}function Z1(t,e){var r=Oo;return t.current.memoizedState.isDehydrated&&(Ci(t,e).flags|=256),t=dc(t,e),t!==2&&(e=sr,sr=r,e!==null&&Q1(e)),t}function Q1(t){sr===null?sr=t:sr.push.apply(sr,t)}function zT(t){for(var e=t;;){if(e.flags&16384){var r=e.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var o=0;o<r.length;o++){var l=r[o],u=l.getSnapshot;l=l.value;try{if(!$r(u(),l))return!1}catch{return!1}}}if(r=e.child,e.subtreeFlags&16384&&r!==null)r.return=e,e=r;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function Wn(t,e){for(e&=~F0,e&=~Gc,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var r=31-Vr(e),o=1<<r;t[r]=-1,e&=~o}}function e2(t){if(Ne&6)throw Error(q(327));As();var e=Yl(t,0);if(!(e&1))return cr(t,ut()),null;var r=dc(t,e);if(t.tag!==0&&r===2){var o=A1(t);o!==0&&(e=o,r=Z1(t,o))}if(r===1)throw r=ra,Ci(t,0),Wn(t,e),cr(t,ut()),r;if(r===6)throw Error(q(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,xi(t,sr,gn),cr(t,ut()),null}function j0(t,e){var r=Ne;Ne|=1;try{return t(e)}finally{Ne=r,Ne===0&&(Ms=ut()+500,Vc&&oi())}}function Mi(t){Hn!==null&&Hn.tag===0&&!(Ne&6)&&As();var e=Ne;Ne|=1;var r=_r.transition,o=Be;try{if(_r.transition=null,Be=1,t)return t()}finally{Be=o,_r.transition=r,Ne=e,!(Ne&6)&&oi()}}function W0(){hr=hs.current,Xe(hs)}function Ci(t,e){t.finishedWork=null,t.finishedLanes=0;var r=t.timeoutHandle;if(r!==-1&&(t.timeoutHandle=-1,vT(r)),pt!==null)for(r=pt.return;r!==null;){var o=r;switch(E0(o),o.tag){case 1:o=o.type.childContextTypes,o!=null&&Jl();break;case 3:Os(),Xe(ar),Xe(zt),N0();break;case 5:_0(o);break;case 4:Os();break;case 13:Xe(et);break;case 19:Xe(et);break;case 10:S0(o.type._context);break;case 22:case 23:W0()}r=r.return}if(Rt=t,pt=t=Jn(t.current,null),Lt=hr=e,At=0,ra=null,F0=Gc=ki=0,sr=Oo=null,yi!==null){for(e=0;e<yi.length;e++)if(r=yi[e],o=r.interleaved,o!==null){r.interleaved=null;var l=o.next,u=r.pending;if(u!==null){var h=u.next;u.next=l,o.next=h}r.pending=o}yi=null}return t}function Vv(t,e){do{var r=pt;try{if(C0(),Rl.current=lc,ac){for(var o=tt.memoizedState;o!==null;){var l=o.queue;l!==null&&(l.pending=null),o=o.next}ac=!1}if(Oi=0,Tt=Et=tt=null,_o=!1,Jo=0,B0.current=null,r===null||r.return===null){At=1,ra=e,pt=null;break}e:{var u=t,h=r.return,x=r,w=e;if(e=Lt,x.flags|=32768,w!==null&&typeof w=="object"&&typeof w.then=="function"){var m=w,y=x,b=y.tag;if(!(y.mode&1)&&(b===0||b===11||b===15)){var C=y.alternate;C?(y.updateQueue=C.updateQueue,y.memoizedState=C.memoizedState,y.lanes=C.lanes):(y.updateQueue=null,y.memoizedState=null)}var T=Wp(h);if(T!==null){T.flags&=-257,Vp(T,h,x,u,e),T.mode&1&&jp(u,m,e),e=T,w=m;var k=e.updateQueue;if(k===null){var D=new Set;D.add(w),e.updateQueue=D}else k.add(w);break e}else{if(!(e&1)){jp(u,m,e),V0();break e}w=Error(q(426))}}else if(Ze&&x.mode&1){var X=Wp(h);if(X!==null){!(X.flags&65536)&&(X.flags|=256),Vp(X,h,x,u,e),A0(ks(w,x));break e}}u=w=ks(w,x),At!==4&&(At=2),Oo===null?Oo=[u]:Oo.push(u),u=h;do{switch(u.tag){case 3:u.flags|=65536,e&=-e,u.lanes|=e;var O=Sv(u,w,e);Dp(u,O);break e;case 1:x=w;var I=u.type,_=u.stateNode;if(!(u.flags&128)&&(typeof I.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(Qn===null||!Qn.has(_)))){u.flags|=65536,e&=-e,u.lanes|=e;var L=Iv(u,x,e);Dp(u,L);break e}}u=u.return}while(u!==null)}Hv(r)}catch(j){e=j,pt===r&&r!==null&&(pt=r=r.return);continue}break}while(!0)}function zv(){var t=cc.current;return cc.current=lc,t===null?lc:t}function V0(){(At===0||At===3||At===2)&&(At=4),Rt===null||!(ki&268435455)&&!(Gc&268435455)||Wn(Rt,Lt)}function dc(t,e){var r=Ne;Ne|=2;var o=zv();(Rt!==t||Lt!==e)&&(gn=null,Ci(t,e));do try{$T();break}catch(l){Vv(t,l)}while(!0);if(C0(),Ne=r,cc.current=o,pt!==null)throw Error(q(261));return Rt=null,Lt=0,At}function $T(){for(;pt!==null;)$v(pt)}function HT(){for(;pt!==null&&!m7();)$v(pt)}function $v(t){var e=Xv(t.alternate,t,hr);t.memoizedProps=t.pendingProps,e===null?Hv(t):pt=e,B0.current=null}function Hv(t){var e=t;do{var r=e.alternate;if(t=e.return,e.flags&32768){if(r=FT(r,e),r!==null){r.flags&=32767,pt=r;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{At=6,pt=null;return}}else if(r=BT(r,e,hr),r!==null){pt=r;return}if(e=e.sibling,e!==null){pt=e;return}pt=e=t}while(e!==null);At===0&&(At=5)}function xi(t,e,r){var o=Be,l=_r.transition;try{_r.transition=null,Be=1,GT(t,e,r,o)}finally{_r.transition=l,Be=o}return null}function GT(t,e,r,o){do As();while(Hn!==null);if(Ne&6)throw Error(q(327));r=t.finishedWork;var l=t.finishedLanes;if(r===null)return null;if(t.finishedWork=null,t.finishedLanes=0,r===t.current)throw Error(q(177));t.callbackNode=null,t.callbackPriority=0;var u=r.lanes|r.childLanes;if(I7(t,u),t===Rt&&(pt=Rt=null,Lt=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||ll||(ll=!0,Yv(Xl,function(){return As(),null})),u=(r.flags&15990)!==0,r.subtreeFlags&15990||u){u=_r.transition,_r.transition=null;var h=Be;Be=1;var x=Ne;Ne|=4,B0.current=null,jT(t,r),Uv(r,t),dT(R1),Kl=!!T1,R1=T1=null,t.current=r,WT(r),x7(),Ne=x,Be=h,_r.transition=u}else t.current=r;if(ll&&(ll=!1,Hn=t,fc=l),u=t.pendingLanes,u===0&&(Qn=null),y7(r.stateNode),cr(t,ut()),e!==null)for(o=t.onRecoverableError,r=0;r<e.length;r++)l=e[r],o(l.value,{componentStack:l.stack,digest:l.digest});if(uc)throw uc=!1,t=Y1,Y1=null,t;return fc&1&&t.tag!==0&&As(),u=t.pendingLanes,u&1?t===K1?ko++:(ko=0,K1=t):ko=0,oi(),null}function As(){if(Hn!==null){var t=Sw(fc),e=_r.transition,r=Be;try{if(_r.transition=null,Be=16>t?16:t,Hn===null)var o=!1;else{if(t=Hn,Hn=null,fc=0,Ne&6)throw Error(q(331));var l=Ne;for(Ne|=4,le=t.current;le!==null;){var u=le,h=u.child;if(le.flags&16){var x=u.deletions;if(x!==null){for(var w=0;w<x.length;w++){var m=x[w];for(le=m;le!==null;){var y=le;switch(y.tag){case 0:case 11:case 15:No(8,y,u)}var b=y.child;if(b!==null)b.return=y,le=b;else for(;le!==null;){y=le;var C=y.sibling,T=y.return;if(Lv(y),y===m){le=null;break}if(C!==null){C.return=T,le=C;break}le=T}}}var k=u.alternate;if(k!==null){var D=k.child;if(D!==null){k.child=null;do{var X=D.sibling;D.sibling=null,D=X}while(D!==null)}}le=u}}if(u.subtreeFlags&2064&&h!==null)h.return=u,le=h;else e:for(;le!==null;){if(u=le,u.flags&2048)switch(u.tag){case 0:case 11:case 15:No(9,u,u.return)}var O=u.sibling;if(O!==null){O.return=u.return,le=O;break e}le=u.return}}var I=t.current;for(le=I;le!==null;){h=le;var _=h.child;if(h.subtreeFlags&2064&&_!==null)_.return=h,le=_;else e:for(h=I;le!==null;){if(x=le,x.flags&2048)try{switch(x.tag){case 0:case 11:case 15:Hc(9,x)}}catch(j){at(x,x.return,j)}if(x===h){le=null;break e}var L=x.sibling;if(L!==null){L.return=x.return,le=L;break e}le=x.return}}if(Ne=l,oi(),sn&&typeof sn.onPostCommitFiberRoot=="function")try{sn.onPostCommitFiberRoot(Bc,t)}catch{}o=!0}return o}finally{Be=r,_r.transition=e}}return!1}function t2(t,e,r){e=ks(r,e),e=Sv(t,e,1),t=Zn(t,e,1),e=Xt(),t!==null&&(pa(t,1,e),cr(t,e))}function at(t,e,r){if(t.tag===3)t2(t,t,r);else for(;e!==null;){if(e.tag===3){t2(e,t,r);break}else if(e.tag===1){var o=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(Qn===null||!Qn.has(o))){t=ks(r,t),t=Iv(e,t,1),e=Zn(e,t,1),t=Xt(),e!==null&&(pa(e,1,t),cr(e,t));break}}e=e.return}}function XT(t,e,r){var o=t.pingCache;o!==null&&o.delete(e),e=Xt(),t.pingedLanes|=t.suspendedLanes&r,Rt===t&&(Lt&r)===r&&(At===4||At===3&&(Lt&130023424)===Lt&&500>ut()-U0?Ci(t,0):F0|=r),cr(t,e)}function Gv(t,e){e===0&&(t.mode&1?(e=qa,qa<<=1,!(qa&130023424)&&(qa=4194304)):e=1);var r=Xt();t=Cn(t,e),t!==null&&(pa(t,e,r),cr(t,r))}function YT(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),Gv(t,r)}function KT(t,e){var r=0;switch(t.tag){case 13:var o=t.stateNode,l=t.memoizedState;l!==null&&(r=l.retryLane);break;case 19:o=t.stateNode;break;default:throw Error(q(314))}o!==null&&o.delete(e),Gv(t,r)}var Xv;Xv=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||ar.current)or=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return or=!1,LT(t,e,r);or=!!(t.flags&131072)}else or=!1,Ze&&e.flags&1048576&&Qw(e,rc,e.index);switch(e.lanes=0,e.tag){case 2:var o=e.type;Nl(t,e),t=e.pendingProps;var l=Rs(e,zt.current);Es(e,r),l=k0(null,e,o,t,l,r);var u=M0();return e.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,lr(o)?(u=!0,ec(e)):u=!1,e.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,T0(e),l.updater=$c,e.stateNode=l,l._reactInternals=e,B1(e,o,t,r),e=j1(null,e,o,!0,u,r)):(e.tag=0,Ze&&u&&y0(e),Gt(null,e,l,r),e=e.child),e;case 16:o=e.elementType;e:{switch(Nl(t,e),t=e.pendingProps,l=o._init,o=l(o._payload),e.type=o,l=e.tag=QT(o),t=Fr(o,t),l){case 0:e=U1(null,e,o,t,r);break e;case 1:e=Hp(null,e,o,t,r);break e;case 11:e=zp(null,e,o,t,r);break e;case 14:e=$p(null,e,o,Fr(o.type,t),r);break e}throw Error(q(306,o,""))}return e;case 0:return o=e.type,l=e.pendingProps,l=e.elementType===o?l:Fr(o,l),U1(t,e,o,l,r);case 1:return o=e.type,l=e.pendingProps,l=e.elementType===o?l:Fr(o,l),Hp(t,e,o,l,r);case 3:e:{if(Nv(e),t===null)throw Error(q(387));o=e.pendingProps,u=e.memoizedState,l=u.element,nv(t,e),sc(e,o,null,r);var h=e.memoizedState;if(o=h.element,u.isDehydrated)if(u={element:o,isDehydrated:!1,cache:h.cache,pendingSuspenseBoundaries:h.pendingSuspenseBoundaries,transitions:h.transitions},e.updateQueue.baseState=u,e.memoizedState=u,e.flags&256){l=ks(Error(q(423)),e),e=Gp(t,e,o,r,l);break e}else if(o!==l){l=ks(Error(q(424)),e),e=Gp(t,e,o,r,l);break e}else for(gr=Kn(e.stateNode.containerInfo.firstChild),pr=e,Ze=!0,Wr=null,r=tv(e,null,o,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(_s(),o===l){e=Sn(t,e,r);break e}Gt(t,e,o,r)}e=e.child}return e;case 5:return iv(e),t===null&&D1(e),o=e.type,l=e.pendingProps,u=t!==null?t.memoizedProps:null,h=l.children,_1(o,l)?h=null:u!==null&&_1(o,u)&&(e.flags|=32),_v(t,e),Gt(t,e,h,r),e.child;case 6:return t===null&&D1(e),null;case 13:return Ov(t,e,r);case 4:return R0(e,e.stateNode.containerInfo),o=e.pendingProps,t===null?e.child=Ns(e,null,o,r):Gt(t,e,o,r),e.child;case 11:return o=e.type,l=e.pendingProps,l=e.elementType===o?l:Fr(o,l),zp(t,e,o,l,r);case 7:return Gt(t,e,e.pendingProps,r),e.child;case 8:return Gt(t,e,e.pendingProps.children,r),e.child;case 12:return Gt(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(o=e.type._context,l=e.pendingProps,u=e.memoizedProps,h=l.value,$e(nc,o._currentValue),o._currentValue=h,u!==null)if($r(u.value,h)){if(u.children===l.children&&!ar.current){e=Sn(t,e,r);break e}}else for(u=e.child,u!==null&&(u.return=e);u!==null;){var x=u.dependencies;if(x!==null){h=u.child;for(var w=x.firstContext;w!==null;){if(w.context===o){if(u.tag===1){w=vn(-1,r&-r),w.tag=2;var m=u.updateQueue;if(m!==null){m=m.shared;var y=m.pending;y===null?w.next=w:(w.next=y.next,y.next=w),m.pending=w}}u.lanes|=r,w=u.alternate,w!==null&&(w.lanes|=r),P1(u.return,r,e),x.lanes|=r;break}w=w.next}}else if(u.tag===10)h=u.type===e.type?null:u.child;else if(u.tag===18){if(h=u.return,h===null)throw Error(q(341));h.lanes|=r,x=h.alternate,x!==null&&(x.lanes|=r),P1(h,r,e),h=u.sibling}else h=u.child;if(h!==null)h.return=u;else for(h=u;h!==null;){if(h===e){h=null;break}if(u=h.sibling,u!==null){u.return=h.return,h=u;break}h=h.return}u=h}Gt(t,e,l.children,r),e=e.child}return e;case 9:return l=e.type,o=e.pendingProps.children,Es(e,r),l=Nr(l),o=o(l),e.flags|=1,Gt(t,e,o,r),e.child;case 14:return o=e.type,l=Fr(o,e.pendingProps),l=Fr(o.type,l),$p(t,e,o,l,r);case 15:return Tv(t,e,e.type,e.pendingProps,r);case 17:return o=e.type,l=e.pendingProps,l=e.elementType===o?l:Fr(o,l),Nl(t,e),e.tag=1,lr(o)?(t=!0,ec(e)):t=!1,Es(e,r),Cv(e,o,l),B1(e,o,l,r),j1(null,e,o,!0,t,r);case 19:return kv(t,e,r);case 22:return Rv(t,e,r)}throw Error(q(156,e.tag))};function Yv(t,e){return Ew(t,e)}function ZT(t,e,r,o){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Rr(t,e,r,o){return new ZT(t,e,r,o)}function z0(t){return t=t.prototype,!(!t||!t.isReactComponent)}function QT(t){if(typeof t=="function")return z0(t)?1:0;if(t!=null){if(t=t.$$typeof,t===l0)return 11;if(t===c0)return 14}return 2}function Jn(t,e){var r=t.alternate;return r===null?(r=Rr(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&14680064,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function Ml(t,e,r,o,l,u){var h=2;if(o=t,typeof t=="function")z0(t)&&(h=1);else if(typeof t=="string")h=5;else e:switch(t){case ns:return Si(r.children,l,u,e);case a0:h=8,l|=8;break;case a1:return t=Rr(12,r,e,l|2),t.elementType=a1,t.lanes=u,t;case l1:return t=Rr(13,r,e,l),t.elementType=l1,t.lanes=u,t;case c1:return t=Rr(19,r,e,l),t.elementType=c1,t.lanes=u,t;case iw:return Xc(r,l,u,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case rw:h=10;break e;case nw:h=9;break e;case l0:h=11;break e;case c0:h=14;break e;case Fn:h=16,o=null;break e}throw Error(q(130,t==null?t:typeof t,""))}return e=Rr(h,r,e,l),e.elementType=t,e.type=o,e.lanes=u,e}function Si(t,e,r,o){return t=Rr(7,t,o,e),t.lanes=r,t}function Xc(t,e,r,o){return t=Rr(22,t,o,e),t.elementType=iw,t.lanes=r,t.stateNode={isHidden:!1},t}function Tf(t,e,r){return t=Rr(6,t,null,e),t.lanes=r,t}function Rf(t,e,r){return e=Rr(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function qT(t,e,r,o,l){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=lf(0),this.expirationTimes=lf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=lf(0),this.identifierPrefix=o,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function $0(t,e,r,o,l,u,h,x,w){return t=new qT(t,e,r,x,w),e===1?(e=1,u===!0&&(e|=8)):e=0,u=Rr(3,null,null,e),t.current=u,u.stateNode=t,u.memoizedState={element:o,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},T0(u),t}function JT(t,e,r){var o=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:rs,key:o==null?null:""+o,children:t,containerInfo:e,implementation:r}}function Kv(t){if(!t)return ti;t=t._reactInternals;e:{if(Fi(t)!==t||t.tag!==1)throw Error(q(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(lr(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(q(171))}if(t.tag===1){var r=t.type;if(lr(r))return Kw(t,r,e)}return e}function Zv(t,e,r,o,l,u,h,x,w){return t=$0(r,o,!0,t,l,u,h,x,w),t.context=Kv(null),r=t.current,o=Xt(),l=qn(r),u=vn(o,l),u.callback=e??null,Zn(r,u,l),t.current.lanes=l,pa(t,l,o),cr(t,o),t}function Yc(t,e,r,o){var l=e.current,u=Xt(),h=qn(l);return r=Kv(r),e.context===null?e.context=r:e.pendingContext=r,e=vn(u,h),e.payload={element:t},o=o===void 0?null:o,o!==null&&(e.callback=o),t=Zn(l,e,h),t!==null&&(zr(t,l,h,u),Tl(t,l,h)),h}function hc(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function r2(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var r=t.retryLane;t.retryLane=r!==0&&r<e?r:e}}function H0(t,e){r2(t,e),(t=t.alternate)&&r2(t,e)}function e9(){return null}var Qv=typeof reportError=="function"?reportError:function(t){console.error(t)};function G0(t){this._internalRoot=t}Kc.prototype.render=G0.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(q(409));Yc(t,e,null,null)};Kc.prototype.unmount=G0.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Mi(function(){Yc(null,t,null,null)}),e[bn]=null}};function Kc(t){this._internalRoot=t}Kc.prototype.unstable_scheduleHydration=function(t){if(t){var e=Rw();t={blockedOn:null,target:t,priority:e};for(var r=0;r<jn.length&&e!==0&&e<jn[r].priority;r++);jn.splice(r,0,t),r===0&&Nw(t)}};function X0(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Zc(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function n2(){}function t9(t,e,r,o,l){if(l){if(typeof o=="function"){var u=o;o=function(){var m=hc(h);u.call(m)}}var h=Zv(e,o,t,0,null,!1,!1,"",n2);return t._reactRootContainer=h,t[bn]=h.current,Yo(t.nodeType===8?t.parentNode:t),Mi(),h}for(;l=t.lastChild;)t.removeChild(l);if(typeof o=="function"){var x=o;o=function(){var m=hc(w);x.call(m)}}var w=$0(t,0,!1,null,null,!1,!1,"",n2);return t._reactRootContainer=w,t[bn]=w.current,Yo(t.nodeType===8?t.parentNode:t),Mi(function(){Yc(e,w,r,o)}),w}function Qc(t,e,r,o,l){var u=r._reactRootContainer;if(u){var h=u;if(typeof l=="function"){var x=l;l=function(){var w=hc(h);x.call(w)}}Yc(e,h,t,l)}else h=t9(r,e,t,l,o);return hc(h)}Iw=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var r=wo(e.pendingLanes);r!==0&&(d0(e,r|1),cr(e,ut()),!(Ne&6)&&(Ms=ut()+500,oi()))}break;case 13:Mi(function(){var o=Cn(t,1);if(o!==null){var l=Xt();zr(o,t,1,l)}}),H0(t,1)}};h0=function(t){if(t.tag===13){var e=Cn(t,134217728);if(e!==null){var r=Xt();zr(e,t,134217728,r)}H0(t,134217728)}};Tw=function(t){if(t.tag===13){var e=qn(t),r=Cn(t,e);if(r!==null){var o=Xt();zr(r,t,e,o)}H0(t,e)}};Rw=function(){return Be};_w=function(t,e){var r=Be;try{return Be=t,e()}finally{Be=r}};v1=function(t,e,r){switch(e){case"input":if(d1(t,r),e=r.name,r.type==="radio"&&e!=null){for(r=t;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<r.length;e++){var o=r[e];if(o!==t&&o.form===t.form){var l=Wc(o);if(!l)throw Error(q(90));ow(o),d1(o,l)}}}break;case"textarea":lw(t,r);break;case"select":e=r.value,e!=null&&xs(t,!!r.multiple,e,!1)}};pw=j0;mw=Mi;var r9={usingClientEntryPoint:!1,Events:[xa,as,Wc,hw,gw,j0]},fo={findFiberByHostInstance:vi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},n9={bundleType:fo.bundleType,version:fo.version,rendererPackageName:fo.rendererPackageName,rendererConfig:fo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Rn.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=vw(t),t===null?null:t.stateNode},findFiberByHostInstance:fo.findFiberByHostInstance||e9,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var cl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!cl.isDisabled&&cl.supportsFiber)try{Bc=cl.inject(n9),sn=cl}catch{}}vr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=r9;vr.createPortal=function(t,e){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!X0(e))throw Error(q(200));return JT(t,e,null,r)};vr.createRoot=function(t,e){if(!X0(t))throw Error(q(299));var r=!1,o="",l=Qv;return e!=null&&(e.unstable_strictMode===!0&&(r=!0),e.identifierPrefix!==void 0&&(o=e.identifierPrefix),e.onRecoverableError!==void 0&&(l=e.onRecoverableError)),e=$0(t,1,!1,null,null,r,!1,o,l),t[bn]=e.current,Yo(t.nodeType===8?t.parentNode:t),new G0(e)};vr.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(q(188)):(t=Object.keys(t).join(","),Error(q(268,t)));return t=vw(e),t=t===null?null:t.stateNode,t};vr.flushSync=function(t){return Mi(t)};vr.hydrate=function(t,e,r){if(!Zc(e))throw Error(q(200));return Qc(null,t,e,!0,r)};vr.hydrateRoot=function(t,e,r){if(!X0(t))throw Error(q(405));var o=r!=null&&r.hydratedSources||null,l=!1,u="",h=Qv;if(r!=null&&(r.unstable_strictMode===!0&&(l=!0),r.identifierPrefix!==void 0&&(u=r.identifierPrefix),r.onRecoverableError!==void 0&&(h=r.onRecoverableError)),e=Zv(e,null,t,1,r??null,l,!1,u,h),t[bn]=e.current,Yo(t),o)for(t=0;t<o.length;t++)r=o[t],l=r._getVersion,l=l(r._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[r,l]:e.mutableSourceEagerHydrationData.push(r,l);return new Kc(e)};vr.render=function(t,e,r){if(!Zc(e))throw Error(q(200));return Qc(null,t,e,!1,r)};vr.unmountComponentAtNode=function(t){if(!Zc(t))throw Error(q(40));return t._reactRootContainer?(Mi(function(){Qc(null,null,t,!1,function(){t._reactRootContainer=null,t[bn]=null})}),!0):!1};vr.unstable_batchedUpdates=j0;vr.unstable_renderSubtreeIntoContainer=function(t,e,r,o){if(!Zc(r))throw Error(q(200));if(t==null||t._reactInternals===void 0)throw Error(q(38));return Qc(t,e,r,!1,o)};vr.version="18.3.1-next-f1338f8080-20240426";function qv(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(qv)}catch(t){console.error(t)}}qv(),qx.exports=vr;var na=qx.exports;function i9({message:t,showGuidance:e,windows:r,onClose:o}){const l=ie.useRef(null);return ie.useEffect(()=>{var u;(u=l.current)==null||u.showModal()},[]),na.createPortal(M.jsx("dialog",{ref:l,"aria-label":"远程桌面提醒",onCancel:o,onClick:u=>{u.target===u.currentTarget&&o()},style:{margin:"auto",inset:0,width:"min(370px, calc(100vw - 32px))",maxHeight:"calc(100dvh - 32px)",overflowY:"auto",padding:0,borderRadius:12,border:"1px solid var(--border-default)",background:"var(--bg-surface, white)",color:"var(--text-primary)",fontSize:14,lineHeight:1.7},children:M.jsxs("div",{style:{padding:20},children:[M.jsx("strong",{children:"远程桌面提醒"}),M.jsx("p",{children:t}),e&&M.jsxs(M.Fragment,{children:[M.jsx("p",{children:"请在电脑上打开远程桌面授权页面,点击“远程授权”(盾牌图标)。"}),M.jsx("p",{children:r?"在 Windows 电脑上点击“开启共享”,并保持用户已登录、桌面未锁定。完成后此处会自动更新。":"在系统设置中为 AgentRoam Remote Desktop 开启“屏幕录制”和“辅助功能”权限,然后点击“开启共享”。完成后此处会自动更新。"})]}),M.jsx("button",{type:"button",className:"ui-quiet-button",onClick:o,autoFocus:!0,children:"知道了"})]})}),document.body)}function s9(){const[t,e]=ie.useState(null),[r,o]=ie.useState(!1),[l,u]=ie.useState(!1),[h,x]=ie.useState(""),w=["127.0.0.1","localhost","[::1]"].includes(location.hostname),m=!/Android|iPhone|iPad|iPod/i.test(navigator.userAgent);ie.useEffect(()=>{let C=!0;const T=async()=>{try{const D=await fetch(m&&w?"/api/remote-authorization":"/api/remote-authorization/status",{credentials:"same-origin",cache:"no-store"});if(!D.ok)return;const X=await D.json();C&&e(X)}catch{}};T();const k=setInterval(T,2e3);return()=>{C=!1,clearInterval(k)}},[m,w]);const y=(t==null?void 0:t.platform)==="win32";if(!m){if(!t||t.online&&t.accessibility)return null;const C=t.supported?t.installed?t.enabled?y&&t.locked&&t.unlock==="available"?"Windows 已锁屏。打开「远程桌面」并选择本机桌面,即可唤醒屏幕或输入密码/PIN 解锁。":y&&t.locked?"Windows 已锁屏,但远程解锁服务尚未安装。请在电脑上运行 agentroam unlock-service install。":t.locked?"macOS 已锁屏。打开「远程桌面」并选择本机桌面会自动唤醒屏幕,随后可在锁屏画面输入密码。":!t.screen||!t.accessibility?y?"Windows 桌面暂不可用,请检查 UAC 提示或登录状态。":"电脑的远程桌面授权尚未完成。":"电脑桌面正在连接,请稍候。":"电脑尚未开启桌面共享,请在电脑上完成授权并开启共享。":"电脑缺少远程桌面组件,请在电脑上升级 CLI。":"这台电脑暂不支持远程桌面。";return M.jsxs("div",{className:"remote-desktop-guidance",children:[M.jsx("button",{type:"button",className:"ui-icon-button","aria-label":"查看远程桌面提醒","aria-haspopup":"dialog","aria-expanded":r,onClick:()=>o(!0),style:{color:"var(--warning, #d97706)",minWidth:44,minHeight:44},children:M.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[M.jsx("circle",{cx:"12",cy:"12",r:"9"}),M.jsx("path",{d:"M12 7v6m0 4h.01"})]})}),r&&M.jsx(i9,{windows:y,message:C,showGuidance:t.supported&&t.installed&&(!t.enabled||!t.screen||!t.accessibility),onClose:()=>o(!1)})]})}if(!w)return M.jsxs("div",{style:{position:"relative",marginLeft:12},children:[M.jsx("button",{type:"button",className:"ui-icon-button",onClick:()=>o(!r),"aria-expanded":r,"aria-label":"远程授权",title:"远程授权",children:M.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[M.jsx("path",{d:"M12 22s8-4 8-11V5l-8-3-8 3v6c0 7 8 11 8 11Z"}),M.jsx("path",{d:"m9 12 2 2 4-4"})]})}),r&&M.jsxs("section",{"aria-label":"远程授权设置",style:{position:"absolute",top:40,left:0,width:"min(370px, 70vw)",zIndex:30,padding:18,borderRadius:12,background:"var(--bg-surface, white)",border:"1px solid var(--border-default)",boxShadow:"0 10px 40px #0003",fontSize:13},children:[M.jsx("strong",{children:"远程授权"}),M.jsx("p",{style:{lineHeight:1.6},children:"请在运行 CLI 的电脑上打开终端显示的本机地址,完成配对并开启桌面共享。"}),M.jsxs("p",{children:["在电脑终端运行 ",M.jsx("code",{children:"agentroam service status"})," 查看本机地址。"]}),M.jsx("p",{style:{lineHeight:1.6},children:"如果你正在另一台电脑上查看,请到运行 CLI 的电脑操作。授权完成后,可回到当前页面查看画面。"})]})]});if(!(t!=null&&t.local))return null;const b=async(C,T)=>{u(!0),x("");try{const k=await fetch("/api/remote-authorization",{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json"},body:JSON.stringify({action:C,permission:T})}),D=await k.json();if(!k.ok)throw new Error(D.error||"操作失败");e(D)}catch(k){x(k instanceof Error?k.message:"操作失败")}finally{u(!1)}};return M.jsxs("div",{style:{position:"relative",marginLeft:12},children:[M.jsx("button",{type:"button",className:"ui-icon-button",onClick:()=>o(!r),"aria-expanded":r,"aria-label":"远程授权",title:"远程授权",children:M.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[M.jsx("path",{d:"M12 22s8-4 8-11V5l-8-3-8 3v6c0 7 8 11 8 11Z"}),M.jsx("path",{d:"m9 12 2 2 4-4"})]})}),r&&M.jsxs("section",{"aria-label":"远程授权设置",style:{position:"absolute",top:40,left:0,width:"min(370px, 70vw)",zIndex:30,padding:18,borderRadius:12,background:"var(--bg-surface, white)",color:"var(--text-primary)",border:"1px solid var(--border-default)",boxShadow:"0 10px 40px #0003",fontSize:13},children:[M.jsx("strong",{children:"远程授权"}),M.jsx("p",{style:{lineHeight:1.6,margin:"10px 0"},children:y?"开启后,已配对设备可查看桌面;接管后可使用鼠标和键盘。":"在系统设置中允许「AgentRoam Remote Desktop」。屏幕录制用于手机查看,辅助功能用于鼠标键盘控制。"}),t.component&&M.jsxs("div",{"aria-label":"远控组件信息",style:{fontSize:12,lineHeight:1.6,overflowWrap:"anywhere"},children:[M.jsxs("div",{children:["组件版本:",t.component.version==="legacy"?`旧版(${t.component.fingerprint??"未记录版本"})`:t.component.version]}),M.jsxs("div",{children:[y?"组件位置":"授权应用位置",":",M.jsx("code",{children:t.component.path})]}),t.component.installed===!1&&M.jsx("p",{children:"点击“重新检测”后会安装到此位置。"}),t.component.updatePending&&M.jsx("p",{role:"status",children:"旧版组件仍在使用。结束其他 AgentRoam 的桌面共享后,点击“重新检测”更新。"})]}),t.supported?t.installed?M.jsxs(M.Fragment,{children:[!y&&["screen","accessibility"].map(C=>M.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,margin:"12px 0"},children:[M.jsxs("span",{children:[C==="screen"?"屏幕录制":"辅助功能",":",t[C]?"已授权":"待授权"]}),M.jsx("button",{type:"button",className:"ui-icon-button ui-icon-button--auto",disabled:l,onClick:()=>void b("authorize",C),children:"去授权"})]},C)),M.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:8},children:[M.jsx("button",{type:"button",className:"ui-icon-button ui-icon-button--auto",disabled:l,onClick:()=>void b(t.enabled?"disable":"enable"),children:t.enabled?"停止共享":"开启共享"}),M.jsx("button",{type:"button",className:"ui-icon-button ui-icon-button--auto",disabled:l,onClick:()=>void b("recheck"),children:"重新检测"}),M.jsx("button",{type:"button",className:"ui-icon-button ui-icon-button--auto",disabled:l,onClick:()=>void b("restart"),children:"重启授权组件"})]}),y&&M.jsxs("p",{style:{fontSize:12,lineHeight:1.6},children:["远程解锁服务:",t.unlock==="available"?"已安装,可在锁屏后远程唤醒和解锁。":"未安装;在 Windows 终端运行 agentroam unlock-service install 后可启用。"]}),M.jsx("p",{role:"status",style:{marginTop:12},children:t.online?"共享已开启,已配对手机可在直播列表选择本机桌面。":t.enabled?"等待桌面可用或首帧画面…":"尚未开启共享。"}),M.jsx("p",{style:{fontSize:12,lineHeight:1.6},children:y?"Windows 锁屏后直播入口会保留,可唤醒屏幕或远程解锁;UAC 安全桌面和未登录状态仍不支持控制。":"授权后会自动继续。系统要求重新打开应用时,点击“重启授权组件”。"})]}):M.jsx("p",{children:"当前 CLI 未包含远程授权组件,请升级 CLI。"}):M.jsx("p",{children:"目前支持 Windows 10/11 x64 和 macOS 14 及以上的 Apple Silicon 电脑。"}),(h||t.error)&&M.jsx("p",{role:"alert",style:{color:"var(--danger, #c33)"},children:h||t.error})]})]})}/**
58
+ * @license lucide-react v0.468.0 - ISC
59
+ *
60
+ * This source code is licensed under the ISC license.
61
+ * See the LICENSE file in the root directory of this source tree.
62
+ */const o9=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Jv=(...t)=>t.filter((e,r,o)=>!!e&&e.trim()!==""&&o.indexOf(e)===r).join(" ").trim();/**
63
+ * @license lucide-react v0.468.0 - ISC
64
+ *
65
+ * This source code is licensed under the ISC license.
66
+ * See the LICENSE file in the root directory of this source tree.
67
+ */var a9={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
68
+ * @license lucide-react v0.468.0 - ISC
69
+ *
70
+ * This source code is licensed under the ISC license.
71
+ * See the LICENSE file in the root directory of this source tree.
72
+ */const l9=ie.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:l="",children:u,iconNode:h,...x},w)=>ie.createElement("svg",{ref:w,...a9,width:e,height:e,stroke:t,strokeWidth:o?Number(r)*24/Number(e):r,className:Jv("lucide",l),...x},[...h.map(([m,y])=>ie.createElement(m,y)),...Array.isArray(u)?u:[u]]));/**
73
+ * @license lucide-react v0.468.0 - ISC
74
+ *
75
+ * This source code is licensed under the ISC license.
76
+ * See the LICENSE file in the root directory of this source tree.
77
+ */const mt=(t,e)=>{const r=ie.forwardRef(({className:o,...l},u)=>ie.createElement(l9,{ref:u,iconNode:e,className:Jv(`lucide-${o9(t)}`,o),...l}));return r.displayName=`${t}`,r};/**
78
+ * @license lucide-react v0.468.0 - ISC
79
+ *
80
+ * This source code is licensed under the ISC license.
81
+ * See the LICENSE file in the root directory of this source tree.
82
+ */const c9=mt("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
83
+ * @license lucide-react v0.468.0 - ISC
84
+ *
85
+ * This source code is licensed under the ISC license.
86
+ * See the LICENSE file in the root directory of this source tree.
87
+ */const u9=mt("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
88
+ * @license lucide-react v0.468.0 - ISC
89
+ *
90
+ * This source code is licensed under the ISC license.
91
+ * See the LICENSE file in the root directory of this source tree.
92
+ */const ey=mt("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
93
+ * @license lucide-react v0.468.0 - ISC
94
+ *
95
+ * This source code is licensed under the ISC license.
96
+ * See the LICENSE file in the root directory of this source tree.
97
+ */const f9=mt("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/**
98
+ * @license lucide-react v0.468.0 - ISC
99
+ *
100
+ * This source code is licensed under the ISC license.
101
+ * See the LICENSE file in the root directory of this source tree.
102
+ */const d9=mt("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
103
+ * @license lucide-react v0.468.0 - ISC
104
+ *
105
+ * This source code is licensed under the ISC license.
106
+ * See the LICENSE file in the root directory of this source tree.
107
+ */const h9=mt("ChevronsLeft",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);/**
108
+ * @license lucide-react v0.468.0 - ISC
109
+ *
110
+ * This source code is licensed under the ISC license.
111
+ * See the LICENSE file in the root directory of this source tree.
112
+ */const g9=mt("ChevronsRight",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);/**
113
+ * @license lucide-react v0.468.0 - ISC
114
+ *
115
+ * This source code is licensed under the ISC license.
116
+ * See the LICENSE file in the root directory of this source tree.
117
+ */const ty=mt("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
118
+ * @license lucide-react v0.468.0 - ISC
119
+ *
120
+ * This source code is licensed under the ISC license.
121
+ * See the LICENSE file in the root directory of this source tree.
122
+ */const i2=mt("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
123
+ * @license lucide-react v0.468.0 - ISC
124
+ *
125
+ * This source code is licensed under the ISC license.
126
+ * See the LICENSE file in the root directory of this source tree.
127
+ */const p9=mt("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
128
+ * @license lucide-react v0.468.0 - ISC
129
+ *
130
+ * This source code is licensed under the ISC license.
131
+ * See the LICENSE file in the root directory of this source tree.
132
+ */const m9=mt("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
133
+ * @license lucide-react v0.468.0 - ISC
134
+ *
135
+ * This source code is licensed under the ISC license.
136
+ * See the LICENSE file in the root directory of this source tree.
137
+ */const x9=mt("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
138
+ * @license lucide-react v0.468.0 - ISC
139
+ *
140
+ * This source code is licensed under the ISC license.
141
+ * See the LICENSE file in the root directory of this source tree.
142
+ */const w9=mt("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
143
+ * @license lucide-react v0.468.0 - ISC
144
+ *
145
+ * This source code is licensed under the ISC license.
146
+ * See the LICENSE file in the root directory of this source tree.
147
+ */const v9=mt("MonitorUp",[["path",{d:"m9 10 3-3 3 3",key:"11gsxs"}],["path",{d:"M12 13V7",key:"h0r20n"}],["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}]]);/**
148
+ * @license lucide-react v0.468.0 - ISC
149
+ *
150
+ * This source code is licensed under the ISC license.
151
+ * See the LICENSE file in the root directory of this source tree.
152
+ */const y9=mt("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/**
153
+ * @license lucide-react v0.468.0 - ISC
154
+ *
155
+ * This source code is licensed under the ISC license.
156
+ * See the LICENSE file in the root directory of this source tree.
157
+ */const E9=mt("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
158
+ * @license lucide-react v0.468.0 - ISC
159
+ *
160
+ * This source code is licensed under the ISC license.
161
+ * See the LICENSE file in the root directory of this source tree.
162
+ */const A9=mt("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
163
+ * @license lucide-react v0.468.0 - ISC
164
+ *
165
+ * This source code is licensed under the ISC license.
166
+ * See the LICENSE file in the root directory of this source tree.
167
+ */const ry=mt("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
168
+ * @license lucide-react v0.468.0 - ISC
169
+ *
170
+ * This source code is licensed under the ISC license.
171
+ * See the LICENSE file in the root directory of this source tree.
172
+ */const b9=mt("UsersRound",[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]]);/**
173
+ * @license lucide-react v0.468.0 - ISC
174
+ *
175
+ * This source code is licensed under the ISC license.
176
+ * See the LICENSE file in the root directory of this source tree.
177
+ */const C9=mt("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);function S9(){const[t,e]=ie.useState(!1);return null}var ny,s2=na;ny=s2.createRoot,s2.hydrateRoot;class iy extends Error{constructor(){super("未登录或会话已过期"),this.name="UnauthorizedError"}}class sy extends Error{constructor(e,r,o){super(r),this.status=e,this.code=o,this.name="ApiError"}}class oy extends Error{constructor(){super("请求超时,请检查连接后重试"),this.name="RequestTimeoutError"}}class I9{constructor(e=(...o)=>fetch(...o),r=""){this.transport=e,this.baseUrl=r}setBaseUrl(e){this.baseUrl=e.replace(/\/+$/,"")}resolve(e){return this.baseUrl+e}async get(e,r){return this.request(e,{method:"GET",headers:r==null?void 0:r.headers,signal:r==null?void 0:r.signal},r==null?void 0:r.timeoutMs)}async post(e,r,o){return this.request(e,{method:"POST",signal:o==null?void 0:o.signal,headers:{"content-type":"application/json",...o==null?void 0:o.headers},body:r===void 0?void 0:JSON.stringify(r)},o==null?void 0:o.timeoutMs)}async patch(e,r,o){return this.request(e,{method:"PATCH",signal:o==null?void 0:o.signal,headers:{"content-type":"application/json",...o==null?void 0:o.headers},body:r===void 0?void 0:JSON.stringify(r)},o==null?void 0:o.timeoutMs)}async put(e,r,o){return this.request(e,{method:"PUT",signal:o==null?void 0:o.signal,headers:{"content-type":"application/json",...o==null?void 0:o.headers},body:r===void 0?void 0:JSON.stringify(r)},o==null?void 0:o.timeoutMs)}async delete(e,r){return this.request(e,{method:"DELETE",headers:r==null?void 0:r.headers,signal:r==null?void 0:r.signal},r==null?void 0:r.timeoutMs)}async request(e,r,o=3e4){const l=r.signal;l==null||l.throwIfAborted();const u=new AbortController;let h,x;const w=new Promise((m,y)=>{h=setTimeout(()=>{y(new oy),u.abort()},o),l&&(x=()=>{y(l.reason),u.abort(l.reason)},l.addEventListener("abort",x,{once:!0}))});try{return await Promise.race([this.readResponse(e,{...r,signal:u.signal}),w])}finally{clearTimeout(h),x&&(l==null||l.removeEventListener("abort",x))}}async readResponse(e,r){var l;const o=await this.transport(this.resolve(e),{credentials:"same-origin",cache:"no-store",...r});if(o.status===401||o.status===423)throw window.dispatchEvent(new CustomEvent("webapp:unauthorized")),new iy;if(!o.ok){let u=`请求失败 (${o.status})`,h;try{const x=await o.json();typeof x.error=="string"?u=x.error:(l=x.error)!=null&&l.message&&(u=x.error.message),typeof x.code=="string"&&(h=x.code)}catch{}throw new sy(o.status,u,h)}if(o.status!==204)return await o.json()}}const T9=30,R9=20,_9=2e3;function o2(t){var e,r;if(t instanceof Error)return{name:t.name,message:t.message,stack:(e=t.stack)==null?void 0:e.slice(0,8e3)};if(typeof t=="string")return{name:"Error",message:t};try{return{name:"NonError",message:((r=JSON.stringify(t))==null?void 0:r.slice(0,2e3))??String(t)}}catch{return{name:"NonError",message:String(t)}}}function N9(t={}){const e=t.source??"webapp",r=()=>((typeof t.baseUrl=="function"?t.baseUrl():t.baseUrl)??"").replace(/\/+$/,""),o=[];let l=null,u=!1,h=!1;const x=()=>{if(h||u||o.length===0)return;const C=o.splice(0,R9);u=!0;const T=JSON.stringify({entries:C});fetch(`${r()}/api/client-logs`,{method:"POST",headers:{"content-type":"application/json"},body:T,keepalive:!0}).catch(()=>{}).finally(()=>{u=!1,o.length>0&&w()})},w=()=>{l!==null||h||(l=setTimeout(()=>{l=null,x()},_9))},m=C=>{h||(o.length>=T9&&o.shift(),o.push(C),w())},y=C=>{var T;m({level:"error",message:C.message||"window error",source:e,error:{name:"Error",message:C.message||"window error",stack:[C.filename?`${C.filename}:${C.lineno}:${C.colno}`:"",((T=C.error)==null?void 0:T.stack)??""].filter(Boolean).join(`
178
+ `).slice(0,8e3)||void 0},data:{filename:C.filename,lineno:C.lineno,colno:C.colno}})},b=C=>{const T=o2(C.reason);m({level:"error",message:`unhandledRejection: ${T.message}`,source:e,error:T})};return window.addEventListener("error",y),window.addEventListener("unhandledrejection",b),{reportError:(C,T)=>{const k=o2(C);m({level:"error",message:k.message,source:e,error:k,data:T})},reportWarning:(C,T)=>{m({level:"warn",message:C,source:e,data:T})},uninstall:()=>{h=!0,l!==null&&(clearTimeout(l),l=null),window.removeEventListener("error",y),window.removeEventListener("unhandledrejection",b)}}}const Y0=["customer-agent","codex","claude-code","opencode","deepseek-harness","qoder","zcode","workbuddy","copilot","grok","agy"],XN=Y0.filter(t=>t!=="customer-agent");function ay(t){return typeof t=="string"&&Y0.some(e=>e===t)}function YN(t){return ay(t)&&t!=="customer-agent"}const O9=2048,ly=384*1024,k9=.85;function M9(t,e,r=O9){const o=Math.max(t,e);if(o<=r)return{width:t,height:e};const l=r/o;return{width:Math.max(1,Math.round(t*l)),height:Math.max(1,Math.round(e*l))}}async function D9(t,e=cy){if(t.type.toLowerCase()==="image/gif")return t;let r=null;try{r=await e.decode(t);const o=M9(r.width,r.height);if(!(o.width!==r.width||o.height!==r.height)&&t.size<=ly)return t;const u=t.type.toLowerCase()==="image/jpeg"?"image/jpeg":"image/webp",h=await e.encode(r,o.width,o.height,u,k9);return h&&h.size<t.size?h:t}catch{return t}finally{r==null||r.dispose()}}function P9(t){return new Promise((e,r)=>{const o=new FileReader;o.onload=()=>e(o.result),o.onerror=r,o.readAsDataURL(t)})}async function a2(t,e=cy){const r=[];for(const o of t){const l=/^data:(image\/(?:png|jpe?g|webp));base64,/i.exec(o),u=l?o.length-l[0].length:0;if(!l||u*3/4<=ly){r.push(o);continue}try{const h=Uint8Array.from(atob(o.slice(l[0].length)),m=>m.charCodeAt(0)),x=new Blob([h],{type:l[1].toLowerCase()}),w=await D9(x,e);r.push(w===x?o:await P9(w))}catch{r.push(o)}}return r}const cy={decode(t){return new Promise((e,r)=>{const o=URL.createObjectURL(t),l=new Image;let u=!1;const h=()=>URL.revokeObjectURL(o);l.onload=()=>{u=!0,e({source:l,width:l.naturalWidth,height:l.naturalHeight,dispose:h})},l.onerror=()=>{u||h(),r(new Error("无法解码图片"))},l.src=o})},encode(t,e,r,o,l){const u=document.createElement("canvas");u.width=e,u.height=r;const h=u.getContext("2d");return h?(h.drawImage(t.source,0,0,e,r),new Promise(x=>u.toBlob(x,o,l))):Promise.resolve(null)}},uy="agent-webapp:artifact-open:v1";function q1(t){if(/[\0\r\n]/.test(t))return!1;try{const e=new URL(t);return(e.protocol==="http:"||e.protocol==="https:")&&/\.(mp4|webm|mov|m4v|mp3|wav|m4a|aac|ogg|flac|png|jpe?g|gif|webp|pdf)$/i.test(e.pathname)}catch{return!1}}function L9(t){return t.startsWith("/")||/^[A-Za-z]:[\\/]/.test(t)||/^\\\\[^\\/]+[\\/][^\\/]+/.test(t)}function B9(t){if(!t||typeof t!="object")return null;const e=t;return e.type!==uy||!Number.isSafeInteger(e.requestId)||Number(e.requestId)<1||typeof e.path!="string"||!(L9(e.path)||e.path.startsWith("~/")||q1(e.path))||e.path.includes("\0")||e.path.includes(`
179
+ `)||e.path.includes("\r")||e.revealOnly!==void 0&&(e.revealOnly!==!0||q1(e.path))?null:e}function KN(t,e,r){return t.origin!==e||t.source!==r?null:B9(t.data)}let l2=0;function F9(t){var r;if(typeof t!="string"||/[\\\0\r\n?#]/.test(t))return null;const e=(r=/^\/(?:private\/)?tmp\/(.+)$/.exec(t))==null?void 0:r[1];return!e||!/\.(?:png|jpe?g|webp|gif|bmp|ico)$/i.test(e)||e.split("/").some(o=>!o||o==="."||o==="..")?null:`~/.agentroam/artifacts/tmp/${e}`}function c2(t){return t.startsWith("/")||/^[A-Za-z]:[\\/]/.test(t)||/^\\\\[^\\/]+[\\/][^\\/]+/.test(t)}function U9(t,e,r){const o=t.trim();if(!o||/[\0\r\n]/.test(o))return null;if(q1(o))return o;if(o.startsWith("~/")){const h=o.slice(2);return!h||h.split(/[\\/]/).includes("..")?null:r?U9(h,r):o}if(c2(o))return o;if(!e||!c2(e))return null;const l=o.replaceAll("\\","/").split("/").filter(h=>h&&h!==".");if(l.length===0||l.some(h=>h===".."))return null;const u=/^[A-Za-z]:[\\/]/.test(e)||e.startsWith("\\\\")?"\\":"/";return`${e.replace(/[\\/]+$/,"")}${u}${l.join(u)}`}function ZN(t,e=window,r){return e.parent===e?!1:(l2+=1,e.parent.postMessage({type:uy,requestId:l2,path:t,...r?{revealOnly:r}:{}},e.location.origin),!0)}function j9(t){return{getUpdateStatus:()=>t.get("/api/update/status",{timeoutMs:5e3}),checkForUpdate:()=>t.post("/api/update/check",{},{timeoutMs:5e3}),installUpdate:()=>t.post("/api/update/install",{},{timeoutMs:5e3}),onUpdateStatus:()=>()=>{}}}const _f="<think>",Nf="</think>";function u2(t,e){const r=Math.min(e.length-1,t.length);for(let o=r;o>0;o--)if(t.endsWith(e.slice(0,o)))return o;return 0}function ho(t){return t.replace(/<think>[\s\S]*?<\/think>/g,"")}class W9{constructor(){this.buffer="",this.dropping=!1}push(e){this.buffer+=e;let r="";for(;;){if(this.dropping){const l=this.buffer.indexOf(Nf);if(l===-1){const u=u2(this.buffer,Nf);return this.buffer=this.buffer.slice(this.buffer.length-u),r}this.buffer=this.buffer.slice(l+Nf.length),this.dropping=!1;continue}const o=this.buffer.indexOf(_f);if(o===-1){const l=u2(this.buffer,_f);return r+=this.buffer.slice(0,this.buffer.length-l),this.buffer=this.buffer.slice(this.buffer.length-l),r}r+=this.buffer.slice(0,o),this.buffer=this.buffer.slice(o+_f.length),this.dropping=!0}}flush(){const e=this.buffer;return this.buffer="",e}}const V9=/^(?:load failed|failed to fetch|network request failed|networkerror when attempting to fetch resource\.?|the network connection was lost\.?|fetch failed)$/i,z9=50,$9=1e3,H9=2e3,G9=8e3;function f2(t){return t instanceof oy||t instanceof Error&&t.name!=="AbortError"&&V9.test(t.message.trim())}class X9{constructor(e,r,o,l=x=>new EventSource(x),u,h={}){this.http=e,this.settings=r,this.projectBridge=o,this.createEventSource=l,this.dictation=u,this.streams=new Map,this.nativeStreamCursors=new Map,this.nativeFinalAnswerSnapshots=new Map,this.pendingRuns=new Map,this.listeners=new Set,this.thinkFilters=new Map,this.bufferedStreamText=new Map,this.ordinaryRunRecoveryTimers=new Map,this.ordinaryRunStreamText=new Map,this.nativeRunRecoveries=new Map,this.nativeRunIdentities=new Map,this.sessionHistoryObservationMode=h.historyObservation??"sse",this.updates=j9(e)}dictationStart(){var e;return((e=this.dictation)==null?void 0:e.dictationStart())??Promise.resolve({ok:!1,reason:"语音输入尚未初始化"})}dictationStop(){var e;return((e=this.dictation)==null?void 0:e.dictationStop())??Promise.resolve({ok:!0})}onDictation(e){var r;return((r=this.dictation)==null?void 0:r.onDictation(e))??(()=>{})}onDictationError(e){var r;return((r=this.dictation)==null?void 0:r.onDictationError(e))??(()=>{})}async fileWorkspaceRequest(e,r={}){if(e!=="fs:preview-open"&&e!=="fs:preview-close")throw new Error("消息区仅支持媒体预览操作");const o=this.requireProjectBridge();try{return await o.request(e,r)}catch(l){const u=l==null?void 0:l.code;if(e!=="fs:preview-open"||u!=="PATH_OUTSIDE_ROOT"&&u!=="PATH_NOT_FOUND")throw l;const h=F9(r.path);if(!h)throw l;return o.request(e,{...r,path:h}).catch(x=>{throw(x==null?void 0:x.code)==="PATH_NOT_FOUND"||(x==null?void 0:x.code)==="PATH_OUTSIDE_ROOT"?l:x})}}requireProjectBridge(){if(this.projectBridge)return this.projectBridge;throw Object.assign(new Error("请从 AgentRoam Web 控制台打开项目"),{code:"WEB_SHELL_REQUIRED"})}async syncSessionViews(e){try{return await this.http.post("/api/session-views",e)}catch(r){if(!(r instanceof sy)||r.status!==404)throw r;return this.http.post("/api/collaboration",{action:"sessionViews",...e})}}async collaboration(e,r){return this.http.post("/api/collaboration",e,r)}async calendarOverview(e){const r=new URLSearchParams({from:e.from,to:e.to});return this.http.get(`/api/calendar?${r.toString()}`)}todoList(e={}){return this.http.get(`/api/todos?${new URLSearchParams(Object.entries(e).filter(([,r])=>r!==void 0).map(([r,o])=>[r,String(o)]))}`)}todoGet(e){return this.http.get(`/api/todos/${encodeURIComponent(e)}`)}todoCommand(e,r){return this.http.post(e.type==="create"?"/api/todos":`/api/todos/${encodeURIComponent(e.taskId)}/commands`,{command:e,requestId:r})}notificationList(){return this.http.get("/api/notifications")}notificationRead(e){return this.http.post(`/api/notifications/${encodeURIComponent(e)}/ack`,{read:!0})}onEvent(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}async run(e,r,o,l,u,h){var T,k,D,X;const x=r.startsWith("runtime:"),w=this.streams.has(r),m=this.pendingRuns.has(r),y=this.nativeStreamCursors.get(r);x&&!m&&this.beginNativeRunRecovery(r,void 0,!0);let b=null,C=null;try{x||await this.openStream(r,this.nativeStreamCursors.get(r)),C=m?null:new Promise(L=>{b=L,this.pendingRuns.set(r,L)}),x||this.ordinaryRunStreamText.set(r,"");const O=u!=null&&u.length?await a2(u):void 0,I={input:e,sessionId:r,...O?{images:O}:{},...o!=null&&o.length?{agentIds:o}:{},...!x&&(h!=null&&h.profileId)?{profileId:h.profileId}:{},...(T=h==null?void 0:h.model)!=null&&T.id?{nativeModel:h.model}:{},...h!=null&&h.reasoningEffort?{nativeReasoningEffort:h.reasoningEffort}:{},...h!=null&&h.codexMode?{codexMode:h.codexMode}:{},...(k=h==null?void 0:h.attachments)!=null&&k.length?{attachments:h.attachments}:{}},_=x&&!(u!=null&&u.length)&&!((D=h==null?void 0:h.attachments)!=null&&D.length)?await this.http.post("/api/agent/run",I,{timeoutMs:G9}):await this.http.post("/api/agent/run",I);if(x||this.startOrdinaryRunRecovery(r),x){const L=this.nativeRunRecoveries.get(r);L&&(L.awaitingAdmission=!1,L.runId=typeof _.runId=="string"?_.runId:void 0);const j=typeof _.runId=="string"&&(y==null?void 0:y.runId)!==_.runId?{sequence:0,runId:_.runId}:y??{sequence:0,...typeof _.runId=="string"?{runId:_.runId}:{}};await this.openStream(r,j,{waitForOpen:!1})}this.dispatch(r,{type:"run_admitted",...typeof _.runId=="string"?{_nativeRunId:_.runId}:{}}),C&&await C}catch(O){const I=!m&&x&&f2(O)?await this.recoverNativeAdmission(r,y):null;if(I){const U=this.nativeRunRecoveries.get(r);return U&&(U.awaitingAdmission=!1,U.runId=I.runId),await this.openStream(r,I,{waitForOpen:!1}),C&&await C,[]}const _=O.code,L=typeof _=="string"?_:O.status===409?"SESSION_OCCUPIED":void 0;x&&L==="SESSION_ALREADY_RUNNING"&&await this.openStream(r,y??{sequence:0},{waitForOpen:!1});const j=w||m||L==="SESSION_ALREADY_RUNNING";if(x&&j){const U=this.nativeRunRecoveries.get(r);U&&(U.awaitingAdmission=!1),this.startNativeRunRecovery(r,(X=this.nativeStreamCursors.get(r))==null?void 0:X.runId)}this.dispatch(r,{type:"error",message:f2(O)?"网络连接中断,消息未确认发送,请重试":O instanceof Error?O.message:"无法启动运行",...L?{code:L}:{},...j?{_preserveActiveRun:!0}:{}}),j?b&&this.pendingRuns.get(r)===b&&this.pendingRuns.delete(r):(this.closeStream(r),this.settle(r))}return[]}async recoverNativeAdmission(e,r){const o=this.nativeStreamCursors.get(e);if(o!=null&&o.runId&&o.runId!==(r==null?void 0:r.runId))return this.dispatchRecoveredAdmission(e,o),o;try{const l=await this.http.get(`/api/sessions/${encodeURIComponent(e)}?limit=1&view=core`,{timeoutMs:4e3}),u=typeof l.snapshotRunId=="string"?l.snapshotRunId:void 0,h=typeof l.snapshotRevision=="number"?l.snapshotRevision:0,x=!!(u&&(r!=null&&r.runId)&&u!==r.runId),w=!!(u&&!(r!=null&&r.runId)&&l.status==="running");return!x&&!w?null:(this.dispatchRecoveredAdmission(e,{runId:u,sequence:h}),{runId:u,sequence:0})}catch{return null}}dispatchRecoveredAdmission(e,r){this.dispatch(e,{type:"run_admitted",...r.runId?{_nativeRunId:r.runId}:{}})}async steer(e,r,o){return(await this.http.post("/api/agent/steer",{input:e,sessionId:r})).steered}async steerSessionMessage(e,r){const o=await this.http.post("/api/agent/steer",{sessionId:e,messageId:r});if(!o.steered)throw new Error("当前运行不支持插队消息");return o.state}async steerSessionGoal(e,r){const o=await this.http.post("/api/agent/steer",{sessionId:e,goalId:r});if(!o.steered)throw new Error("当前会话无法插入目标,已保留在队列中");return o.state}async abort(e,r,o){var h,x,w,m;const l=e!=null&&e.startsWith("runtime:")?o||(((h=this.nativeRunRecoveries.get(e))==null?void 0:h.runId)??((x=this.nativeStreamCursors.get(e))==null?void 0:x.runId)):void 0,u=e?[e]:[...new Set([...this.pendingRuns.keys(),...this.streams.keys(),...this.nativeRunRecoveries.keys()])].filter(y=>!y.startsWith("runtime:"));await this.http.post("/api/agent/abort",{...e?{sessionId:e}:{},...l?{expectedRunId:l}:{},...r?{trigger:r}:{}});for(const y of u){const b=((w=this.nativeRunRecoveries.get(y))==null?void 0:w.runId)??((m=this.nativeStreamCursors.get(y))==null?void 0:m.runId);l&&b!==l||(this.settle(y),this.closeStream(y))}}async answerQuestion(e,r,o){try{return await this.http.post("/api/agent/answer",{questionId:e,answer:r,selectedIndices:o}),!0}catch{return!1}}async listSessions(e){const r=e?`?projectId=${encodeURIComponent(e)}`:"";return this.http.get(`/api/sessions${r}`)}async listAgentWorkspaces(e,r={}){const o=new URLSearchParams({agentType:e});return r.cursor&&o.set("cursor",r.cursor),r.limit!==void 0&&o.set("limit",String(r.limit)),r.refresh&&o.set("refresh","1"),r.since&&o.set("since",r.since),this.http.get(`/api/agent-workspaces?${o.toString()}`)}async importAgentWorkspace(e,r,o){return this.http.post("/api/agent-workspaces",{agentType:e,path:r,...o?{name:o}:{}})}async removeInvalidAgentWorkspace(e,r){const o=new URLSearchParams({agentType:e,workspaceId:r});await this.http.delete(`/api/agent-workspaces?${o.toString()}`)}async listAgentWorkspaceSessions(e,r,o={}){const l=new URLSearchParams({agentType:e});return o.cursor&&l.set("cursor",o.cursor),o.limit!==void 0&&l.set("limit",String(o.limit)),o.refresh&&l.set("refresh","1"),this.http.get(`/api/agent-workspaces/${encodeURIComponent(r)}/sessions?${l.toString()}`)}async refreshSessions(e){const r=e?`?refresh=1&projectId=${encodeURIComponent(e)}`:"?refresh=1";return this.http.get(`/api/sessions${r}`)}async listChildSessions(e){return[]}async getSession(e,r,o={}){var h;const l=this.nativeRunRecoveries.get(e),u=l==null?void 0:l.runId;try{const x=new URLSearchParams;r!=null&&r.before&&x.set("before",r.before),r!=null&&r.after&&x.set("after",r.after),r!=null&&r.anchor&&x.set("anchor",r.anchor),(r==null?void 0:r.limit)!==void 0&&x.set("limit",String(r.limit)),r!=null&&r.view&&x.set("view",r.view),r!=null&&r.revision&&x.set("revision",r.revision),r!=null&&r.turnId&&x.set("turnId",r.turnId);const w=x.size>0?`?${x.toString()}`:"",m=await this.http.get(`/api/sessions/${encodeURIComponent(e)}${w}`,o.signal?{signal:o.signal}:void 0);Array.isArray(m.messages)&&(m.messages=m.messages.map(C=>typeof C.content=="string"?{...C,content:ho(C.content)}:C)),Array.isArray(m.events)&&(m.events=m.events.map(C=>typeof C.text=="string"&&C.text.includes("<think>")?{...C,text:ho(C.text)}:typeof C.finalText=="string"&&C.finalText.includes("<think>")?{...C,finalText:ho(C.finalText)}:C));const y=l===this.nativeRunRecoveries.get(e)&&u===(l==null?void 0:l.runId),b=!(r!=null&&r.before)&&!(r!=null&&r.after)&&!(r!=null&&r.anchor)&&(r==null?void 0:r.view)!=="trace";if(e.startsWith("runtime:")&&y&&b&&typeof m.snapshotRevision=="number"){const C=typeof m.snapshotRunId=="string"?m.snapshotRunId:void 0;if(C&&((h=this.nativeRunIdentities.get(e))!=null&&h.retired.has(C)))return m;const T=m.history,k=(T==null?void 0:T.delivery)==="core"||(T==null?void 0:T.delivery)==="trace",D=this.snapshotRunMatchesHistoryTurn(m);if((T==null?void 0:T.delivery)==="core"&&!o.lifecycleOnly&&C&&D&&this.coreSnapshotContainsTailFinalAnswer(m.messages)&&this.rememberNativeFinalAnswerSnapshot(e,m.snapshotRevision,C),k||this.rememberNativeStreamCursor(e,m.snapshotRevision,C),m.status==="running"&&m.snapshotRunStatus!=="terminal"&&m.occupancy!=="owned-externally"&&(!k||D)){const X=this.nativeStreamCursors.get(e),O=k&&C&&(X==null?void 0:X.runId)!==C?{sequence:0,runId:C}:X??(k?{sequence:0,...C?{runId:C}:{}}:void 0);this.openStream(e,O).catch(()=>{})}l&&(D?await this.reconcileNativeRun(e,l,u,m):!l.awaitingAdmission&&m.snapshotRunStatus==="terminal"&&C===u&&(this.closeStream(e),this.settle(e)))}else if(!e.startsWith("runtime:")&&m.status==="active"){const C=m.activeRun;(C==null?void 0:C.running)===!0&&typeof C.eventId=="number"&&this.openStream(e,{sequence:C.eventId}).catch(()=>{})}return m}catch(x){if(x.status===404)return null;throw x}}async getSessionImage(e,r){return(await this.http.get(`/api/session-images/${encodeURIComponent(e)}?variant=${r}`)).dataUrl}async getSessionToolResult(e,r){const o=new URLSearchParams(r);return this.http.get(`/api/sessions/${encodeURIComponent(e)}/tool-result?${o.toString()}`)}async getSessionQueryIndex(e){return this.http.get(`/api/sessions/${encodeURIComponent(e)}/query-index`)}observeSession(e,r,o){const l=this.createEventSource(`/api/sessions/${encodeURIComponent(e)}/changes`);let u=!1;return l.onmessage=h=>{if(h.data)try{const x=JSON.parse(h.data);x.type==="session_history_changed"&&typeof x.revision=="number"&&r({type:x.type,revision:x.revision})}catch{}},l.onerror=()=>{u||(u=!0,l.close(),o==null||o())},()=>{u||(u=!0,l.close())}}async setSessionPermissionMode(e,r){return this.http.patch(`/api/sessions/${encodeURIComponent(e)}`,{permissionMode:r})}async setSessionNativeMode(e,r){return this.http.patch(`/api/sessions/${encodeURIComponent(e)}`,{nativeMode:r})}async setSessionNativePermissionPreset(e,r){return this.http.patch(`/api/sessions/${encodeURIComponent(e)}`,{nativePermissionPreset:r})}async getSessionNativeGoal(e){return(await this.http.get(`/api/sessions/${encodeURIComponent(e)}/native-goal`)).goal}async listSessionBackgroundJobs(e){return(await this.http.get(`/api/sessions/${encodeURIComponent(e)}/background-jobs`)).jobs}async getSessionBackgroundJobOutput(e,r){return this.http.get(`/api/sessions/${encodeURIComponent(e)}/background-jobs/${encodeURIComponent(r)}`)}async stopSessionBackgroundJob(e,r){return this.http.post(`/api/sessions/${encodeURIComponent(e)}/background-jobs/${encodeURIComponent(r)}/stop`,{})}async mutateSessionNativeGoal(e,r){return(await this.http.post(`/api/sessions/${encodeURIComponent(e)}/native-goal`,r)).goal}async getSessionGoals(e){const r=await this.http.get(`/api/sessions/${encodeURIComponent(e)}/goals`);return r.active&&this.openStream(e,this.nativeStreamCursors.get(e)).catch(()=>{}),r}getCodexComposerCatalog(e,r,o){const l=new URLSearchParams({cwd:e});return r!==void 0&&l.set("fileQuery",r),this.http.get(`/api/agent/composer?${l}`,{signal:o,timeoutMs:7e3})}async requestComposerPrediction(e,r,o){return(await this.http.post("/api/agent/composer",{sessionId:e,turnId:r},{signal:o,timeoutMs:1e4})).text}async enqueueSessionGoal(e,r,o){var u;await this.openStream(e,this.nativeStreamCursors.get(e));const l=await this.http.post(`/api/sessions/${encodeURIComponent(e)}/goals`,{objective:r,sourceMessageId:o});return typeof((u=l.started)==null?void 0:u.snapshotRevision)=="number"&&this.dispatch(e,{type:"run_admitted",...l.started.runId?{_nativeRunId:l.started.runId}:{}}),l.state}async reorderSessionGoals(e,r){return this.http.patch(`/api/sessions/${encodeURIComponent(e)}/goals`,{orderedIds:r})}async updateSessionGoal(e,r,o){return this.http.patch(`/api/sessions/${encodeURIComponent(e)}/goals`,{goalId:r,objective:o})}async cancelSessionGoal(e,r){return this.http.delete(`/api/sessions/${encodeURIComponent(e)}/goals?goalId=${encodeURIComponent(r)}`)}async getThreadGoal(e){return(await this.http.get(`/api/sessions/${encodeURIComponent(e)}/thread-goal`)).goal??null}async setThreadGoal(e,r,o){const l=await this.http.put(`/api/sessions/${encodeURIComponent(e)}/thread-goal`,{objective:r,tokenBudget:o??null});return this.openStream(e,this.nativeStreamCursors.get(e)).catch(()=>{}),l.goal}async updateThreadGoal(e,r){return(await this.http.patch(`/api/sessions/${encodeURIComponent(e)}/thread-goal`,{action:r})).goal}async clearThreadGoal(e){return(await this.http.delete(`/api/sessions/${encodeURIComponent(e)}/thread-goal`)).cleared}async enqueueSessionMessage(e,r){var u,h;await this.openStream(e,this.nativeStreamCursors.get(e));const o=(u=r.images)!=null&&u.length?await a2(r.images):r.images,l=await this.http.post(`/api/sessions/${encodeURIComponent(e)}/goals`,{kind:"message",objective:r.content,sourceMessageId:r.sourceMessageId,messagePayload:{images:o,agentIds:r.agentIds,agentName:r.agentName,...r.runOptions?{runOptions:r.runOptions}:{}}});return typeof((h=l.started)==null?void 0:h.snapshotRevision)=="number"&&this.dispatch(e,{type:"run_admitted",...l.started.runId?{_nativeRunId:l.started.runId}:{}}),l.state}async updateSessionMessage(e,r,o){return this.http.patch(`/api/sessions/${encodeURIComponent(e)}/goals`,{kind:"message",messageId:r,objective:o})}async reorderSessionMessages(e,r){return this.http.patch(`/api/sessions/${encodeURIComponent(e)}/goals`,{kind:"message",orderedIds:r})}async cancelSessionMessage(e,r){return this.http.delete(`/api/sessions/${encodeURIComponent(e)}/goals?kind=message&goalId=${encodeURIComponent(r)}`)}async createSession(e,r,o,l){const u=await this.http.post("/api/sessions",{title:e,...r?{projectId:r}:{},...o&&o!=="customer-agent"?{agentType:o}:{},...l?{cwd:l}:{}});return this.announceSession(u,{title:e,projectId:r,agentType:o,cwd:l}),u}async createParallelSessions(e){const r=await this.http.post("/api/sessions/parallel",e);for(const o of r.members)this.announceSession(o);return r}async getParallelSessionGroup(e){return this.http.get(`/api/sessions/parallel?sessionId=${encodeURIComponent(e)}`)}async forkSession(e,r){const o=await this.http.post(`/api/sessions/${encodeURIComponent(e)}/${r?"fork-at":"fork"}`,r?{point:r}:{});return this.announceSession(o),o}async releaseCodexSession(e){await this.http.post(`/api/sessions/${encodeURIComponent(e)}/release`,{})}async deleteSession(e){await this.http.delete(`/api/sessions/${encodeURIComponent(e)}`)}async getRuntimeHealth(){return this.http.get("/api/agent/runtime-health")}getUpdateStatus(){return this.updates.getUpdateStatus()}checkForUpdate(){return this.updates.checkForUpdate()}installUpdate(){return this.updates.installUpdate()}onUpdateStatus(e){return()=>{}}async listAgentModels(e){return this.http.get(`/api/agent/models?agentType=${encodeURIComponent(e)}`)}async listProjects(){return this.projectBridge?(await this.requireProjectBridge().request("project:list")).projects??[]:this.http.get("/api/projects")}async getProject(e){return this.projectBridge?(await this.requireProjectBridge().request("project:get",{projectId:e})).project??null:this.http.get(`/api/projects/${encodeURIComponent(e)}`)}async createProject(e,r){return this.projectBridge?(await this.requireProjectBridge().request("project:create",{name:e,path:r??""})).project:this.http.post("/api/projects",{name:e,path:r??""})}async updateProject(e,r){return this.projectBridge?(await this.requireProjectBridge().request("project:rename",{projectId:e,name:r.name})).project:this.http.patch(`/api/projects/${encodeURIComponent(e)}`,r)}async deleteProject(e){if(!this.projectBridge){await this.http.delete(`/api/projects/${encodeURIComponent(e)}`);return}await this.requireProjectBridge().request("project:delete",{projectId:e})}async checkProjectPath(e){return this.projectBridge?(await this.requireProjectBridge().request("project:check",{path:e})).valid===!0:(await this.http.get(`/api/projects/check?path=${encodeURIComponent(e)}`)).valid===!0}async listProjectRoots(){return this.projectBridge?(await this.requireProjectBridge().request("project:roots")).roots??[]:this.http.get("/api/projects/roots")}async getProjectPickerLocation(){return this.projectBridge?this.requireProjectBridge().request("project:roots"):this.http.get("/api/projects/roots?picker=1")}async listProjectDirectories(e){return this.projectBridge?(await this.requireProjectBridge().request("project:directories",{path:e})).entries??[]:this.http.get(`/api/projects/directories?path=${encodeURIComponent(e)}`)}async setProjectWorkingDir(e){return await this.saveSettings({workingDirectory:e}),{ok:!0,path:e}}async getSettings(){return this.http.get("/api/settings")}async setSetting(e,r){const o=await this.getSettings();if(!(e in o)||e==="revision"||e==="settingsSpaceId")throw new Error("Unsupported setting");const l=typeof o[e]=="number"?Number(r):Array.isArray(o[e])?JSON.parse(r):r;await this.saveSettings({[e]:l,revision:o.revision})}async subscribe(){}async handoffSession(e){return this.http.post(`/api/sessions/${encodeURIComponent(e)}/handoff`,{})}async saveSettings(e){return this.http.post("/api/settings",e)}async setActiveProfile(e){return this.http.post("/api/settings",{activeProfileId:e})}async refreshServerModel(){const e=await this.getSettings(),r=`webapp.sharedMigration.${e.settingsSpaceId}`;if(!e.settingsSpaceId||localStorage.getItem(r))return;const o=(u,h)=>{try{return JSON.parse(localStorage.getItem(u)||"null")??h}catch{return h}},l=o("webapp.settings.v1",{});await this.business("importLegacy",[{profiles:l.profiles||[],agents:o("webapp.agentDefs",[]),lsp:o("webapp.lspServers",[])}]),localStorage.setItem(r,"1")}business(e,r){return this.http.post("/api/business",{method:e,args:r})}async listMemories(){return this.business("listMemories",[])}async searchMemories(e){return this.business("searchMemories",[e])}async getMemory(e){return this.business("getMemory",[e])}async setMemory(e){return this.business("setMemory",[e])}async deleteMemory(e){return this.business("deleteMemory",[e])}async mcpList(){return this.business("mcpList",[])}async mcpSave(e){return this.business("mcpSave",[e])}async mcpDelete(e){return this.business("mcpDelete",[e])}async mcpSetEnabled(e,r){return this.business("mcpSetEnabled",[e,r])}async mcpProbe(e){return this.business("mcpProbe",[e])}async listSkills(){return this.business("listSkills",[])}async saveSkill(e){return this.business("saveSkill",[e])}async deleteSkill(e){return this.business("deleteSkill",[e])}async setSkillEnabled(e,r){return this.business("setSkillEnabled",[e,r])}async listAgentDefs(){return this.business("listAgentDefs",[])}async getAgentDef(e){return this.business("getAgentDef",[e])}async createAgentDef(e){return this.business("createAgentDef",[e])}async updateAgentDef(e,r){return this.business("updateAgentDef",[e,r])}async deleteAgentDef(e){return this.business("deleteAgentDef",[e])}async setActiveAgentDef(e){return this.business("setActiveAgentDef",[e])}async lspList(){return this.business("lspList",[])}async lspSave(e){return this.business("lspSave",[e])}async lspDelete(e){return this.business("lspDelete",[e])}async lspSetEnabled(e,r){return this.business("lspSetEnabled",[e,r])}async listUploads(){return this.business("listUploads",[])}async getUpload(e){return this.business("getUpload",[e])}async saveUpload(e){return this.business("saveUpload",[e])}async deleteUpload(e){return this.business("deleteUpload",[e])}async importSkill(){return null}async cronCreate(e,r,o){return this.business("cronCreate",[e,r,o])}async cronPause(e){return this.business("cronPause",[e])}async cronResume(e){return this.business("cronResume",[e])}async cronDelete(e){return this.business("cronDelete",[e])}async cronDeleteAll(){return this.business("cronDeleteAll",[])}async cronList(){return this.business("cronList",[])}async openFileDialog(){return null}async readFile(){throw new Error("Web 端不支持直接读取本地文件")}async writeFile(){throw new Error("Web 端不支持直接写入本地文件")}async hideWindow(){}async showWindow(){}async isWindowVisible(){return!0}async wakeStop(){return{ok:!0}}async wakeConversation(e){return{ok:!0,conversation:e}}onWake(){return()=>{}}onWakeCommand(){return()=>{}}announceSession(e,r={}){if(!e||typeof e!="object")return;const o=e;if(typeof o.id!="string")return;const l=o.agentType??r.agentType??"customer-agent";if(!ay(l))return;const u=o.status==="active"||o.status==="running"?"running":o.status==="completed"||o.status==="failed"?o.status:"idle",h={id:o.id,agentType:l,status:u,title:typeof o.title=="string"?o.title:r.title??"未命名会话",cwd:typeof o.cwd=="string"?o.cwd:r.cwd??"",projectId:typeof o.projectId=="string"?o.projectId:r.projectId,...typeof o.parentSessionId=="string"?{parentSessionId:o.parentSessionId}:{},updated:typeof o.updated=="string"?o.updated:new Date().toISOString(),...typeof o.completedAt=="string"?{completedAt:o.completedAt}:{},canResume:o.canResume!==!1};this.dispatch(h.id,{type:"session_summary",session:h})}dispatch(e,r){const o={...r,_sid:e};for(const l of this.listeners)try{l(o)}catch{}}dispatchStreamEvent(e,r){if(!(e.startsWith("runtime:codex:")&&r.type==="text_chunk"&&r.messagePhase==="commentary"&&typeof r.text=="string")){this.flushBufferedStreamText(e),this.dispatch(e,r);return}const l=this.bufferedStreamText.get(e);if(l&&l.event._nativeRunId===r._nativeRunId&&l.event.turnId===r.turnId&&l.event.itemId===r.itemId){l.event={...l.event,...r,text:String(l.event.text??"")+r.text};return}this.flushBufferedStreamText(e);const h=setTimeout(()=>this.flushBufferedStreamText(e),z9);this.bufferedStreamText.set(e,{event:{...r},timer:h})}flushBufferedStreamText(e){const r=this.bufferedStreamText.get(e);r&&(this.bufferedStreamText.delete(e),clearTimeout(r.timer),this.dispatch(e,r.event))}settle(e){this.stopOrdinaryRunRecovery(e),this.stopNativeRunRecovery(e);const r=this.pendingRuns.get(e);r&&(this.pendingRuns.delete(e),r())}beginNativeRunRecovery(e,r,o=!1){this.stopNativeRunRecovery(e);const l={runId:r,awaitingAdmission:o,inFlight:!1};return this.nativeRunRecoveries.set(e,l),l}startNativeRunRecovery(e,r){let o=this.nativeRunRecoveries.get(e);if(o!=null&&o.awaitingAdmission)return;if(r){const u=this.nativeRunIdentities.get(e);if(u!=null&&u.retired.has(r))return;u&&u.current!==r?(u.retired.add(u.current),u.current=r):u||this.nativeRunIdentities.set(e,{current:r,retired:new Set})}if((!o||r&&o.runId!==r)&&(o=this.beginNativeRunRecovery(e,r)),o.timer)return;const l=o;o.timer=setInterval(()=>{this.recoverNativeRun(e,l)},H9)}stopNativeRunRecovery(e){const r=this.nativeRunRecoveries.get(e);r!=null&&r.timer&&clearInterval(r.timer),this.nativeRunRecoveries.delete(e)}async recoverNativeRun(e,r){if(!(r.inFlight||r.awaitingAdmission||this.nativeRunRecoveries.get(e)!==r)){r.inFlight=!0;try{await this.getSession(e,{limit:1,view:"core"},{lifecycleOnly:!0})}catch{}finally{r.inFlight=!1}}}async reconcileNativeRun(e,r,o,l){var k;if(r.awaitingAdmission||this.nativeRunRecoveries.get(e)!==r||r.runId!==o||!o&&this.pendingRuns.has(e)||o&&typeof l.snapshotRunId!="string"&&l.snapshotRunId!==null||!["idle","completed","failed","aborted"].includes(String(l.status)))return;let u=r,h=o;if(typeof l.snapshotRunId=="string"&&l.snapshotRunId!==o){if((k=this.nativeRunIdentities.get(e))!=null&&k.retired.has(l.snapshotRunId))return;this.startNativeRunRecovery(e,l.snapshotRunId);const D=this.nativeRunRecoveries.get(e);if(!D||D.runId!==l.snapshotRunId)return;u=D,h=l.snapshotRunId}let x=Array.isArray(l.events)?l.events:[],w=l.status,m=[...x].reverse().find(D=>D.type==="done"||D.type==="error"||D.type==="turn_aborted");if(!m&&typeof l.snapshotRunId=="string")try{const D=await this.http.get(`/api/sessions/${encodeURIComponent(e)}?limit=1`);if(D.snapshotRunId!==l.snapshotRunId||!["idle","completed","failed","aborted"].includes(String(D.status)))return;w=D.status,x=Array.isArray(D.events)?D.events:[],m=[...x].reverse().find(X=>X.type==="done"||X.type==="error"||X.type==="turn_aborted")}catch{return}if(this.nativeRunRecoveries.get(e)!==u||u.runId!==h||u.awaitingAdmission)return;const y=(m==null?void 0:m.type)??(w==="failed"?"error":w==="aborted"?"turn_aborted":"done"),{_nativeSequence:b,_nativeRunId:C,...T}=m??{};this.closeStream(e),this.settle(e),this.dispatch(e,{...T,type:y,...y==="error"?{message:(m==null?void 0:m.message)||"运行失败,但未记录具体错误"}:{},...y==="done"?{finalText:"",...(m==null?void 0:m.durationMs)===void 0?{}:{durationMs:m.durationMs}}:{},...h??l.snapshotRunId?{_nativeRunId:h??l.snapshotRunId}:{},...y==="done"&&typeof l.completedAt=="string"?{_nativeCompletedAt:l.completedAt}:{},_nativeRecoveredFromSnapshot:!0})}startOrdinaryRunRecovery(e){const r=this.ordinaryRunRecoveryTimers.get(e);r&&clearInterval(r);const o=setInterval(()=>{this.recoverSettledOrdinaryRun(e)},$9);this.ordinaryRunRecoveryTimers.set(e,o)}stopOrdinaryRunRecovery(e){const r=this.ordinaryRunRecoveryTimers.get(e);r&&clearInterval(r),this.ordinaryRunRecoveryTimers.delete(e),this.ordinaryRunStreamText.delete(e)}async recoverSettledOrdinaryRun(e){var r;if(!this.pendingRuns.has(e)){this.stopOrdinaryRunRecovery(e);return}try{const o=await this.getSession(e,{limit:50});if(!o||o.status==="active"||o.status==="running"||o.status!=="completed"&&o.status!=="failed"&&o.status!=="aborted")return;const l=o.messages??[],u=l.map(m=>m.role).lastIndexOf("user"),h=ho(l.slice(u+1).filter(m=>m.role==="assistant"&&(m.content??"").trim()).map(m=>m.content.trim()).join(`
180
+
181
+ `)),x=this.ordinaryRunStreamText.get(e)??"",w=h.startsWith(x)?h.slice(x.length):h;if(w&&this.dispatch(e,{type:"text_chunk",text:w}),o.status==="completed")this.dispatch(e,{type:"done",finalText:""});else{const m=(r=[...o.events??[]].reverse().find(y=>{var b;return y.type==="error"&&((b=y.message)==null?void 0:b.trim())}))==null?void 0:r.message;this.dispatch(e,{type:"error",message:m||(o.status==="aborted"?"运行已中止":"运行失败,但未记录具体错误")})}this.closeStream(e),this.settle(e)}catch{}}openStream(e,r,o={}){if(e.startsWith("runtime:")&&this.startNativeRunRecovery(e,r==null?void 0:r.runId),this.streams.has(e))return Promise.resolve();this.thinkFilters.set(e,new W9);const l=new URLSearchParams({sessionId:e});Number.isSafeInteger(r==null?void 0:r.sequence)&&l.set(e.startsWith("runtime:")?"afterSequence":"afterEventId",String(r.sequence)),e.startsWith("runtime:")&&(r!=null&&r.runId)&&l.set("afterRunId",r.runId);const u=this.createEventSource(`/api/agent/stream?${l.toString()}`);let h=!1;this.streams.set(e,u);const x=o.waitForOpen!==!1;let w=x,m=null,y=null,b=null;const C=x?new Promise((T,k)=>{y=T,b=k,m=setTimeout(()=>{w=!1,this.streams.get(e)===u&&this.closeStream(e),k(new Error("事件流连接超时"))},8e3)}):Promise.resolve();return u.onopen=()=>{w&&(w=!1,m&&clearTimeout(m),y==null||y())},u.onmessage=T=>{var D,X;if(this.streams.get(e)!==u||!T.data)return;let k;try{k=JSON.parse(T.data)}catch{return}if(typeof k._nativeSequence=="number"){const O=typeof k._nativeRunId=="string"?k._nativeRunId:void 0,I=this.nativeRunRecoveries.get(e),_=k.type==="done"||k.type==="error"||k.type==="turn_aborted";if(O&&((D=this.nativeRunIdentities.get(e))!=null&&D.retired.has(O))||O&&(I!=null&&I.runId)&&I.runId!==O&&this.pendingRuns.has(e)||_&&O&&(I!=null&&I.runId)&&I.runId!==O||!this.acceptNativeStreamEvent(e,k._nativeSequence,O)||_&&(I!=null&&I.awaitingAdmission)||(this.startNativeRunRecovery(e,O),this.isNativeFinalAnswerCoveredBySnapshot(e,k,k._nativeSequence,O)))return}if(k.type==="text_chunk"&&typeof k.text=="string"&&(k.text=this.thinkFilters.get(e).push(k.text),!e.startsWith("runtime:")&&k.text&&this.ordinaryRunStreamText.set(e,(this.ordinaryRunStreamText.get(e)??"")+k.text)),k.type==="done"||k.type==="error"||k.type==="turn_aborted"){const O=((X=this.thinkFilters.get(e))==null?void 0:X.flush())??"";O&&k.type==="done"&&typeof k.finalText=="string"&&(k.finalText=k.finalText+O),h=!0}k.type==="text_chunk"&&k.text===""||(this.dispatchStreamEvent(e,k),(k.type==="done"||k.type==="error"||k.type==="turn_aborted")&&(this.closeStream(e),this.settle(e)))},u.onerror=()=>{if(this.streams.get(e)===u){if(e.startsWith("runtime:")){const T=this.nativeRunRecoveries.get(e);u.readyState===EventSource.CLOSED&&(w&&(w=!1,m&&clearTimeout(m),b==null||b(new Error("事件流连接失败"))),this.closeStream(e)),T&&this.recoverNativeRun(e,T);return}if(w&&u.readyState===EventSource.CLOSED){w=!1,m&&clearTimeout(m),b==null||b(new Error("事件流连接失败"));return}if(u.readyState===EventSource.CLOSED){if(this.closeStream(e),h){this.settle(e);return}(async()=>{let T="";for(let k=0;k<8&&!T;k++){k>0&&await new Promise(D=>setTimeout(D,750));try{const D=await this.getSession(e,{limit:50}),X=(D==null?void 0:D.messages)??[],O=X.map(_=>_.role).lastIndexOf("user"),I=X.slice(O+1).filter(_=>_.role==="assistant"&&(_.content??"").trim()).map(_=>_.content.trim()).join(`
182
+
183
+ `);T=ho(I).trim()}catch{}}T?this.dispatch(e,{type:"text_chunk",text:T}):this.dispatch(e,{type:"error",message:"连接中断,回复未能恢复,请重试"}),this.dispatch(e,{type:"done",finalText:""}),this.settle(e)})()}}},C}rememberNativeStreamCursor(e,r,o){const l=this.nativeStreamCursors.get(e);if(l&&(l.runId===o||!o)&&r<l.sequence)return;const h=o??(l==null?void 0:l.runId);this.nativeStreamCursors.set(e,{sequence:r,...h?{runId:h}:{}})}acceptNativeStreamEvent(e,r,o){const l=this.nativeStreamCursors.get(e);return l&&(l.runId===o||!o)&&r<=l.sequence?!1:(this.rememberNativeStreamCursor(e,r,o),!0)}snapshotRunMatchesHistoryTurn(e){var l,u;if(typeof e.snapshotTurnId!="string"||!e.snapshotTurnId||!Array.isArray(e.messages))return!0;const r=e.messages.slice().reverse().find(h=>(h==null?void 0:h.role)==="user"),o=(u=(l=r==null?void 0:r.presentation)==null?void 0:l.executionTrace)==null?void 0:u.turnId;return typeof o!="string"||o===e.snapshotTurnId}coreSnapshotContainsTailFinalAnswer(e){if(!Array.isArray(e))return!1;let r=-1;for(let o=e.length-1;o>=0;o-=1){const l=e[o];if(typeof l=="object"&&l!==null&&l.role==="user"){r=o;break}}return e.slice(r+1).some(o=>{var u;if(typeof o!="object"||o===null)return!1;const l=o;return l.role==="assistant"&&((u=l.presentation)==null?void 0:u.agentMessagePhase)==="final_answer"})}rememberNativeFinalAnswerSnapshot(e,r,o){const l=this.nativeFinalAnswerSnapshots.get(e);(l==null?void 0:l.runId)===o&&l.sequence>=r||this.nativeFinalAnswerSnapshots.set(e,{runId:o,sequence:r})}isNativeFinalAnswerCoveredBySnapshot(e,r,o,l){const u=this.nativeFinalAnswerSnapshots.get(e);return!u||!l?!1:r.type==="text_chunk"&&r.messagePhase==="final_answer"&&u.runId===l&&o<=u.sequence}closeStream(e){this.flushBufferedStreamText(e);const r=this.streams.get(e);r&&(r.close(),this.streams.delete(e),this.thinkFilters.delete(e))}}async function Y9(t,e){const r=new URL(t,"http://event-source.local"),o=r.searchParams.get("sessionId");if(!(o!=null&&o.startsWith("runtime:"))||r.searchParams.has("afterSequence"))return t;const l=await e(o);if(!Number.isSafeInteger(l.snapshotRevision)||Number(l.snapshotRevision)<0)throw new Error("无法确定运行事件的恢复位置,请重试");return r.searchParams.set("afterSequence",String(l.snapshotRevision)),typeof l.snapshotRunId=="string"&&l.snapshotRunId&&r.searchParams.set("afterRunId",l.snapshotRunId),t.startsWith("/")?`${r.pathname}${r.search}${r.hash}`:r.href}class K9{constructor(e){this.options=e,this.active=new Set,this.queue=[],this.maxConnections=Math.max(1,Math.floor(e.maxConnections??3)),this.leaseMs=Math.max(1,e.leaseMs??1e3),this.yieldMs=Math.max(1,e.yieldMs??25),this.timers=e.timers??globalThis}open(e,r){const o=new Z9(this,e);return Promise.resolve().then(async()=>{if(!o.closed)try{o.resumeUrl=r?await r():e,o.closed||this.enqueue(o)}catch{o.fail()}}),o}enqueue(e){e.closed||this.queue.includes(e)||this.active.has(e)||(this.queue.push(e),this.schedulePump())}schedulePump(){this.pumpTimer!==void 0||!this.queue.length||(this.pumpTimer=this.timers.setTimeout(()=>{for(this.pumpTimer=void 0;this.active.size<this.maxConnections&&this.queue.length;){const e=this.queue.shift();e.closed||(this.active.add(e),e.connect(this.options.createEventSource),this.active.has(e)&&this.scheduleLease(e))}},this.yieldMs))}scheduleLease(e){e.leaseTimer=this.timers.setTimeout(()=>{e.leaseTimer=void 0,!(!this.active.has(e)||e.closed)&&(this.queue.length&&e.resumable?(this.release(e),this.enqueue(e)):this.scheduleLease(e))},this.leaseMs)}release(e){e.leaseTimer!==void 0&&this.timers.clearTimeout(e.leaseTimer),e.leaseTimer=void 0,this.active.delete(e);const r=this.queue.indexOf(e);r!==-1&&this.queue.splice(r,1),e.disconnect(),this.schedulePump(),!this.active.size&&!this.queue.length&&this.pumpTimer!==void 0&&(this.timers.clearTimeout(this.pumpTimer),this.pumpTimer=void 0)}}class Z9 extends EventTarget{constructor(e,r){super(),this.pool=e,this.url=r,this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,this.withCredentials=!1,this.onopen=null,this.onerror=null,this.onmessage=null,this.readyState=0,this.closed=!1,this.physical=null,this.generation=0,this.retiredRuns=new Set,this.resumeUrl=r}get resumable(){const e=new URL(this.resumeUrl,"http://event-source.local").searchParams;return e.has("afterSequence")||e.has("afterEventId")}connect(e){if(this.closed)return;const r=++this.generation;let o;try{o=e(this.resumeUrl)}catch{this.fail();return}this.physical=o;const l=()=>!this.closed&&r===this.generation&&this.physical===o;o.onopen=()=>{var u;l()&&(this.readyState=this.OPEN,(u=this.onopen)==null||u.call(this,new Event("open")),l()&&this.dispatchEvent(new Event("open")))},o.onmessage=u=>{var h;!l()||!this.rememberCursor(u.lastEventId)||((h=this.onmessage)==null||h.call(this,u),l()&&this.dispatchEvent(new MessageEvent("message",{data:u.data,lastEventId:u.lastEventId,origin:u.origin})))},o.onerror=u=>{var h;l()&&(o.readyState===this.CLOSED?(this.closed=!0,this.readyState=this.CLOSED,this.pool.release(this)):this.readyState=this.CONNECTING,(h=this.onerror)==null||h.call(this,u),this.dispatchEvent(new Event("error")))}}rememberCursor(e){var o;if(!e)return!0;const r=new URL(this.resumeUrl,"http://event-source.local");if((o=r.searchParams.get("sessionId"))!=null&&o.startsWith("runtime:")){const l=e.lastIndexOf(":"),u=l>0?e.slice(0,l):"",h=Number(l>0?e.slice(l+1):e);if(!Number.isSafeInteger(h)||h<0||u&&this.retiredRuns.has(u))return!1;const x=r.searchParams.get("afterRunId"),w=Number(r.searchParams.get("afterSequence"));if((!u||!x||u===x)&&r.searchParams.has("afterSequence")&&h<=w)return!1;u&&x&&u!==x&&this.retiredRuns.add(x),u&&r.searchParams.set("afterRunId",u),r.searchParams.set("afterSequence",String(h))}else{const l=Number(e);if(!Number.isSafeInteger(l)||l<0||r.searchParams.has("afterEventId")&&l<=Number(r.searchParams.get("afterEventId")))return!1;r.searchParams.set("afterEventId",String(l))}return this.resumeUrl=this.resumeUrl.startsWith("/")?`${r.pathname}${r.search}${r.hash}`:r.href,!0}disconnect(){++this.generation;const e=this.physical;this.physical=null,e&&(e.onopen=e.onmessage=e.onerror=null,e.close()),this.closed||(this.readyState=this.CONNECTING)}fail(){var r;if(this.closed)return;this.close();const e=new Event("error");(r=this.onerror)==null||r.call(this,e),this.dispatchEvent(e)}close(){this.closed||(this.closed=!0,this.readyState=this.CLOSED,this.pool.release(this))}}const Of="__agentroamBoundedRunSourcesV1";function Q9(t=window){var r;let e=t;try{((r=t.top)==null?void 0:r.location.origin)===t.location.origin&&(e=t.top)}catch{}return e[Of]??(e[Of]=new K9({createEventSource:o=>new e.EventSource(o),timers:e}))}function fy(t){return Number.isFinite(t.width)&&t.width>=900&&!t.nativeApp&&!t.coarsePointer&&!/Android|iPhone|iPad|iPod|IEMobile|Opera Mini|Mobile/i.test(t.userAgent)}function d2(){return typeof window<"u"&&Yx()&&fy({width:window.innerWidth,userAgent:navigator.userAgent,coarsePointer:window.matchMedia("(pointer: coarse)").matches,nativeApp:document.body.dataset.nativeApp==="1"})}function QN(){const[t,e]=ie.useState(d2);return ie.useEffect(()=>{const r=()=>e(d2()),o=window.matchMedia("(pointer: coarse)");return r(),window.addEventListener("resize",r),o.addEventListener("change",r),()=>{window.removeEventListener("resize",r),o.removeEventListener("change",r)}},[]),t}class q9{constructor(e,r){this.emit=r,this.sum=0,this.weight=0,this.frame=new Float32Array(1600),this.offset=0,this.ratio=e/16e3}push(e){if(e.length)for(let r=0;r<e[0].length;r++){let o=0;for(const u of e)o+=u[r]/e.length;let l=1;for(;l>1e-9;){const u=Math.min(l,this.ratio-this.weight);this.sum+=o*u,this.weight+=u,l-=u,this.weight>=this.ratio-1e-9&&(this.frame[this.offset++]=this.sum/this.ratio,this.weight=0,this.sum=0,this.offset===this.frame.length&&this.flush())}}}flush(){this.offset&&(this.emit(this.frame.slice(0,this.offset).buffer),this.offset=0)}}class J9{constructor(e){this.environment=e,this.active=null,this.generation=0,this.results=new Set,this.errors=new Set,window.addEventListener("pagehide",()=>this.complete(this.active)),document.addEventListener("visibilitychange",()=>{document.hidden&&this.complete(this.active)})}onDictation(e){return this.results.add(e),()=>{this.results.delete(e)}}onDictationError(e){return this.errors.add(e),()=>{this.errors.delete(e)}}async dictationStart(){var r,o,l,u,h;if(this.active)return{ok:!1,reason:"语音输入尚未结束"};if(!window.isSecureContext||!((r=navigator.mediaDevices)!=null&&r.getUserMedia))return{ok:!1,reason:"语音输入需要 HTTPS 地址和麦克风权限"};const e={state:"starting",sessionId:crypto.randomUUID(),generation:++this.generation,committed:"",interim:"",utterances:new Set};this.active=e;try{const x=((l=(o=this.environment).createContext)==null?void 0:l.call(o))??new AudioContext;e.context=x;const w=(((h=(u=this.environment).getUserMedia)==null?void 0:h.call(u))??navigator.mediaDevices.getUserMedia({audio:{channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}})).then(y=>{if(this.active!==e){for(const b of y.getTracks())b.stop();throw new Error("语音输入已取消")}e.stream=y}),m=Promise.all([w,this.connect(e),x.resume().then(()=>this.prepareProcessor(e))]);return await Promise.race([m,new Promise(y=>{e.cancelStartup=y}),new Promise((y,b)=>{e.startupTimer=setTimeout(()=>b(new Error("麦克风启动超时,请检查权限后重试")),1e4)})]),clearTimeout(e.startupTimer),this.active!==e?{ok:!1}:(e.source=x.createMediaStreamSource(e.stream),e.source.connect(e.node),e.node.connect(x.destination),e.state="capturing",{ok:!0})}catch(x){if(this.active!==e)return{ok:!1};const w=x instanceof Error&&x.name==="NotAllowedError"?"麦克风权限未开启,请在浏览器网站设置中允许麦克风":x instanceof Error?x.message:"无法启动语音输入";return this.release(e),{ok:!1,reason:w}}}async dictationStop(){var r,o,l;const e=this.active;if(!e)return{ok:!0};if(e.state==="starting")return this.complete(e),{ok:!0};if(e.state==="draining")return await e.stopped,{ok:!0};e.state="draining",e.stopped=new Promise(u=>{e.resolveStopped=u});for(const u of((r=e.stream)==null?void 0:r.getTracks())??[])u.stop();(o=e.source)==null||o.disconnect(),clearTimeout(e.timer),e.timer=setTimeout(()=>this.fail(e,"语音识别收尾超时,已保留当前文字"),12e3);try{await((l=e.flushAudio)==null?void 0:l.call(e)),this.releaseMicrophone(e),this.active===e&&e.socket.send(JSON.stringify({type:"finish",sessionId:e.sessionId,generation:e.generation}))}catch{this.fail(e,"语音输入收尾失败,已保留当前文字")}return await e.stopped,{ok:!0}}async prepareProcessor(e){var x,w;const r=e.context;let o;const l=r.audioWorklet&&await Promise.race([r.audioWorklet.addModule(new URL("./dictation-audio-worklet.js",location.href).href).then(()=>!0,()=>!1),new Promise(m=>{o=setTimeout(()=>m(!1),1500)})]);if(clearTimeout(o),this.active!==e)return;if(l){const m=((w=(x=this.environment).createWorklet)==null?void 0:w.call(x,r))??new AudioWorkletNode(r,"dictation-capture");e.node=m;let y;m.port.onmessage=({data:b})=>{this.active===e&&(b.type==="pcm"&&b.pcm instanceof ArrayBuffer&&this.sendPcm(e,b.pcm),b.type==="flushed"&&(y==null||y()))},e.flushAudio=()=>new Promise((b,C)=>{const T=setTimeout(()=>C(new Error("Audio flush timed out")),500);y=()=>{clearTimeout(T),b()},e.cancelFlush=y,m.port.postMessage({type:"flush"})}),m.onprocessorerror=()=>this.fail(e,"麦克风音频处理失败,请重新开始"),e.clearProcessor=()=>{m.port.onmessage=null,m.onprocessorerror=null};return}const u=r.createScriptProcessor(2048,1,1),h=new q9(r.sampleRate,m=>this.sendPcm(e,m));u.onaudioprocess=m=>{m.outputBuffer.getChannelData(0).fill(0),h.push([m.inputBuffer.getChannelData(0)])},e.node=u,e.flushAudio=async()=>{u.onaudioprocess=null,h.flush()},e.clearProcessor=()=>{u.onaudioprocess=null}}sendPcm(e,r){var o;if(this.active===e){if(((o=e.socket)==null?void 0:o.readyState)!==WebSocket.OPEN){this.fail(e,"语音连接已断开");return}if(e.socket.bufferedAmount>128*1024){this.fail(e,"网络过慢,语音输入已停止");return}e.socket.send(r)}}async connect(e){const r=await this.environment.openSocket();if(this.active!==e){r.close();return}return e.socket=r,new Promise((o,l)=>{e.ready=o,e.rejectReady=l,e.timer=setTimeout(()=>l(new Error("本机语音服务连接超时")),8e3);const u=()=>r.send(JSON.stringify({type:"start",mode:"dictation",sampleRate:16e3,sessionId:e.sessionId,generation:e.generation}));r.addEventListener("open",u,{once:!0}),r.addEventListener("message",({data:x})=>{if(this.active!==e)return;let w;try{w=JSON.parse(String(x))}catch{this.fail(e,"语音服务返回无效数据");return}if(w.type==="error"){this.fail(e,typeof w.message=="string"?w.message:"语音识别失败");return}if(!(w.sessionId!==e.sessionId||w.generation!==e.generation)){if(w.type==="ready"){clearTimeout(e.timer),o();return}(w.type==="partial"||w.type==="final")&&typeof w.text=="string"&&(w.type==="partial"?e.interim=w.text:Number.isSafeInteger(w.utteranceId)&&!e.utterances.has(Number(w.utteranceId))&&(e.utterances.add(Number(w.utteranceId)),e.committed=this.join(e.committed,w.text),e.interim=""),this.emit({text:this.join(e.committed,e.interim),isFinal:!1})),w.type==="finished"&&this.complete(e)}});const h=()=>this.fail(e,"语音连接已断开,已保留当前文字");r.addEventListener("error",h),r.addEventListener("close",h),r.readyState===WebSocket.OPEN&&u()})}join(e,r){return e+(/[a-z0-9]$/i.test(e)&&/^[a-z0-9]/i.test(r)?" ":"")+r}emit(e){for(const r of this.results)r(e)}complete(e){if(!e||this.active!==e)return;const r=this.join(e.committed,e.interim);this.release(e),this.emit({text:r,isFinal:!0})}fail(e,r){var o;if(this.active===e){(o=e.rejectReady)==null||o.call(e,new Error(r)),this.release(e);for(const l of this.errors)l(r)}}releaseMicrophone(e){var r,o,l,u,h;if(!e.microphoneReleased){if(e.microphoneReleased=!0,e.state!=="draining")for(const x of((r=e.stream)==null?void 0:r.getTracks())??[])x.stop();(o=e.clearProcessor)==null||o.call(e),(l=e.source)==null||l.disconnect(),(u=e.node)==null||u.disconnect(),(h=e.context)==null||h.close().catch(()=>{})}}release(e){var r,o,l,u,h;this.active===e&&(this.active=null),clearTimeout(e.timer),clearTimeout(e.startupTimer),(r=e.cancelStartup)==null||r.call(e),(o=e.cancelFlush)==null||o.call(e),(l=e.resolveStopped)==null||l.call(e),(u=e.ready)==null||u.call(e),this.releaseMicrophone(e),(h=e.socket)==null||h.close()}}const ul="webapp.settings.v1";class eR{constructor(){this.cached=null}get(){if(this.cached)return this.cached;let e={};try{e=JSON.parse(localStorage.getItem(ul)??"{}")}catch{e={}}return this.cached={...this.defaults(),...e},this.cached}save(e){const r=this.get();this.cached={...r,...e},e.profiles&&!e.activeProfileId&&(this.cached.activeProfileId=r.activeProfileId),localStorage.setItem(ul,JSON.stringify(this.cached))}setActiveProfile(e){const r=this.get();this.cached={...r,activeProfileId:e},localStorage.setItem(ul,JSON.stringify(this.cached))}reflectServerModel(e){if(!(e!=null&&e.modelId))return;const r=this.get(),o=r.profiles.find(x=>x.id==="server-managed");if(!o||o.apiKey!=="managed"||o.modelId===e.modelId&&o.provider===(e.provider||"openai"))return;const l=e.modelId,u=e.provider||"openai",h=e.baseUrl||"";this.cached={...r,profiles:r.profiles.map(x=>x.id==="server-managed"?{...x,name:`服务端 · ${l}`,provider:u,modelId:l,baseUrl:h}:x),modelProvider:u,modelId:l,baseUrl:h||r.baseUrl},localStorage.setItem(ul,JSON.stringify(this.cached))}getModelOverride(){const e=this.get(),r=e.profiles.find(x=>x.id===e.activeProfileId)??null,o=(r==null?void 0:r.provider)??e.modelProvider,l=(r==null?void 0:r.apiKey)??e.apiKey,u=(r==null?void 0:r.modelId)??e.modelId,h=(r==null?void 0:r.baseUrl)??e.baseUrl;return!l||l==="managed"||!u||u==="server"?null:{provider:o,apiKey:l,modelId:u,...h?{baseUrl:h}:{},...(r==null?void 0:r.requestTimeoutSeconds)===void 0?{}:{requestTimeoutSeconds:r.requestTimeoutSeconds}}}getReasoningEffort(){const e=this.get().reasoningEffort;return["off","low","medium","high"].includes(e)?e:"off"}getRunLimits(){const e=this.get(),r=Number(e.maxIterations),o=Number.isFinite(r)&&r>=0?Math.trunc(r):10,l=Math.min(2e3,Math.max(8,Math.trunc(Number(e.contextWindow)||100)));return{maxIterations:o,maxTokens:l*1e3}}defaults(){const e={id:"server-managed",name:"服务端托管",provider:"openai",modelId:"server",apiKey:"managed",baseUrl:""};return{modelProvider:e.provider,modelId:e.modelId,apiKey:e.apiKey,baseUrl:"",maxIterations:10,contextWindow:100,workingDirectory:"/",profiles:[e],activeProfileId:e.id,reasoningEffort:"off"}}}function tR(t){return t.toString(16).padStart(2,"0")}function rR(t){const e=t.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;const r=Array.from(e,tR);return[r.slice(0,4).join(""),r.slice(4,6).join(""),r.slice(6,8).join(""),r.slice(8,10).join(""),r.slice(10,16).join("")].join("-")}function nR(t=globalThis.crypto){typeof t.randomUUID!="function"&&Object.defineProperty(t,"randomUUID",{configurable:!0,writable:!0,value:()=>rR(t)})}const kf="agent-webapp:tab-swipe:v1",iR=["input","textarea","select","button","a[href]","[contenteditable='true']","[role='button']","[data-tab-swipe-ignore]"].join(","),h2=24;function sR(t){return!t||typeof t.closest!="function"?!1:!!t.closest(iR)}function oR(t){let e=null;const r=o=>e!==null&&o.pointerType==="touch"&&o.pointerId===e.pointerId;return{pointerDown(o){o.pointerType!=="touch"||!o.isPrimary||o.interactive||!(o.clientX<=h2||o.clientX>=o.viewportWidth-h2)||(e={pointerId:o.pointerId,startX:o.clientX,startY:o.clientY,axis:"pending"})},pointerMove(o){if(!r(o)||!e)return!1;const l=o.clientX-e.startX,u=o.clientY-e.startY;if(e.axis==="pending"){if(Math.max(Math.abs(l),Math.abs(u))<=8)return!1;if(Math.abs(u)>=Math.abs(l)*1.2)return e=null,!1;e.axis="horizontal"}return t({type:kf,phase:"move",deltaX:l}),!0},pointerUp(o){if(!r(o)||!e)return!1;const l=e.axis==="horizontal";return l&&t({type:kf,phase:"end",deltaX:o.clientX-e.startX}),e=null,l},pointerCancel(o){if(!r(o)||!e)return!1;const l=e.axis==="horizontal";return l&&t({type:kf,phase:"cancel",deltaX:0}),e=null,l}}}function aR(){if(window.parent===window)return()=>{};const t=oR(h=>{window.parent.postMessage(h,window.location.origin)}),e=h=>({pointerId:h.pointerId,pointerType:h.pointerType,isPrimary:h.isPrimary,clientX:h.clientX,clientY:h.clientY,viewportWidth:window.innerWidth}),r=h=>{t.pointerDown({...e(h),interactive:sR(h.target)})},o=h=>{t.pointerMove(e(h))&&h.preventDefault()},l=h=>{t.pointerUp(e(h))&&h.preventDefault()},u=h=>{t.pointerCancel(e(h))};return document.addEventListener("pointerdown",r,{capture:!0}),document.addEventListener("pointermove",o,{capture:!0,passive:!1}),document.addEventListener("pointerup",l,{capture:!0,passive:!1}),document.addEventListener("pointercancel",u,{capture:!0}),()=>{document.removeEventListener("pointerdown",r,{capture:!0}),document.removeEventListener("pointermove",o,{capture:!0}),document.removeEventListener("pointerup",l,{capture:!0}),document.removeEventListener("pointercancel",u,{capture:!0})}}const lR="agent-web-shell:skin:v1",cR=["pearl","scifi","noir","mist","pine","graphite","glass"];function uR(){if(window.parent===window)return()=>{};const t=e=>{if(e.origin!==window.location.origin||e.source!==window.parent)return;const r=e.data;if(!r||typeof r!="object"||r.type!==lR||typeof r.skin!="string"||!cR.includes(r.skin))return;const o=bi.getState();o.skin!==r.skin&&o.setSkin(r.skin)};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)}function fR(){if(window.parent===window)return()=>{};const t=r=>{if(r.origin!==window.location.origin||r.source!==window.parent)return;const o=Z5(r.data);if(o){document.body.dataset.webShellEmbedded="1";const l=bi.getState();l.navigationLayout!==o&&l.setNavigationLayout(o)}},e=r=>{r.storageArea&&r.storageArea!==window.localStorage||r.key!==null&&r.key!==bi.persist.getOptions().name||bi.persist.rehydrate()};return window.addEventListener("message",t),window.addEventListener("storage",e),()=>{window.removeEventListener("message",t),window.removeEventListener("storage",e),delete document.body.dataset.webShellEmbedded}}const dR="agentroam:open-browser-live",J1="agent-web-shell:open-browser-live:v1";function hR(t){return!t||typeof t!="object"||t.type!==J1?null:{type:J1}}function qN(t,e,r){return t.origin!==e||t.source!==r?null:hR(t.data)}function gR(){if(window.parent===window)return()=>{};const t=e=>{if(e.origin!==window.location.origin||e.source!==window.parent)return;const r=e.data;!r||typeof r!="object"||r.type!==J1||window.dispatchEvent(new CustomEvent(dR))};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)}const pR="agent-webapp:ready:v1";function mR(){window.parent!==window&&window.parent.postMessage({type:pR},window.location.origin)}function xR(){if(window.parent!==window)try{if(window.parent.location.origin===window.location.origin){window.parent.location.reload();return}}catch{}window.location.reload()}const dy="agent-webapp:project-request:v1",wR="agent-web-shell:project-response:v1",vR=["project:list","project:get","project:create","project:rename","project:delete","project:roots","project:directories","project:check"],yR=new Set([...vR,"fs:preview-open","fs:preview-close"]);function ER(t){if(!t||typeof t!="object")return null;const e=t;return e.type!==dy||!Number.isSafeInteger(e.id)||Number(e.id)<1||typeof e.method!="string"||!yR.has(e.method)||!e.payload||typeof e.payload!="object"||Array.isArray(e.payload)?null:e}function JN(t,e,r){return t.origin!==e||t.source!==r?null:ER(t.data)}function AR(t){if(!t||typeof t!="object")return null;const e=t;return e.type!==wR||!Number.isSafeInteger(e.id)||Number(e.id)<1||typeof e.ok!="boolean"||!e.ok&&typeof e.error!="string"?null:e}class bR{constructor(e=window,r=15e3){this.context=e,this.timeoutMs=r,this.sequence=0,this.pending=new Map,this.onMessage=o=>{if(o.origin!==this.context.location.origin||o.source!==this.context.parent)return;const l=AR(o.data);if(!l)return;const u=this.pending.get(l.id);u&&(this.pending.delete(l.id),clearTimeout(u.timer),l.ok?u.resolve(l.result):u.reject(Object.assign(new Error(l.error||"项目操作失败"),{code:l.code})))},this.context.addEventListener("message",this.onMessage)}request(e,r={}){if(this.context.parent===this.context)return Promise.reject(Object.assign(new Error("请从 AgentRoam Web 控制台打开项目"),{code:"WEB_SHELL_REQUIRED"}));const o=++this.sequence;return new Promise((l,u)=>{const h=setTimeout(()=>{this.pending.delete(o),u(Object.assign(new Error("项目操作超时"),{code:"WEB_SHELL_TIMEOUT"}))},this.timeoutMs);this.pending.set(o,{resolve:l,reject:u,timer:h}),this.context.parent.postMessage({type:dy,id:o,method:e,payload:r},this.context.location.origin)})}dispose(){this.context.removeEventListener("message",this.onMessage);for(const e of this.pending.values())clearTimeout(e.timer),e.reject(Object.assign(new Error("项目桥已关闭"),{code:"WEB_SHELL_CLOSED"}));this.pending.clear()}}const hy="agent-webapp:browser-request:v1",CR="agent-web-shell:browser-response:v1",SR="agent-web-shell:browser-event:v1",IR="agent-web-shell:browser-frame:v1",TR=["browser:list","browser:watch","browser:unwatch","browser:desktop-watch","browser:desktop-unwatch","browser:takeover","browser:return","browser:input","browser:set-display","browser:ping","browser:webrtc","browser:system"],RR=new Set(TR);function _R(t){if(!t||typeof t!="object")return null;const e=t;return e.type!==hy||!Number.isSafeInteger(e.id)||Number(e.id)<1||typeof e.method!="string"||!RR.has(e.method)||!e.payload||typeof e.payload!="object"||Array.isArray(e.payload)?null:e}function eO(t,e,r){return t.origin!==e||t.source!==r?null:_R(t.data)}function NR(t){if(!t||typeof t!="object")return null;const e=t;return e.type!==CR||!Number.isSafeInteger(e.id)||Number(e.id)<1||typeof e.ok!="boolean"||!e.ok&&typeof e.error!="string"?null:e}function OR(t){if(!t||typeof t!="object")return null;const e=t;if(e.type!==SR||!e.event||typeof e.event!="object")return null;const r=e.event;return typeof r.type!="string"||!r.type.startsWith("browser:")?null:e}function kR(t){if(!t||typeof t!="object")return null;const e=t;return e.type!==IR||!Number.isSafeInteger(e.channelId)||Number(e.channelId)<1||!Number.isSafeInteger(e.sequence)||Number(e.sequence)<0||!(e.data instanceof ArrayBuffer)?null:e}class MR{constructor(e=window,r=15e3){this.context=e,this.timeoutMs=r,this.sequence=0,this.pending=new Map,this.listeners=new Set,this.sessionsByChannel=new Map,this.pendingFramesByChannel=new Map,this.onMessage=o=>{var w;if(o.origin!==this.context.location.origin||o.source!==this.context.parent)return;const l=kR(o.data);if(l){const m=this.sessionsByChannel.get(l.channelId);if(!m){this.pendingFramesByChannel.set(l.channelId,l);return}this.emitBinaryFrame(l,m);return}const u=OR(o.data);if(u){if(u.event.type==="browser:connection"){this.sessionsByChannel.clear(),this.pendingFramesByChannel.clear();for(const m of this.pending.values())clearTimeout(m.timer),m.reject(Object.assign(new Error("远程连接已变化,请重新接管"),{code:"EOFFLINE"}));this.pending.clear()}for(const m of this.listeners)m(u.event);return}const h=NR(o.data);if(!h)return;const x=this.pending.get(h.id);if(x)if(this.pending.delete(h.id),clearTimeout(x.timer),h.ok){const m=x.method==="browser:desktop-watch";if((x.method==="browser:watch"||m)&&h.result&&typeof h.result=="object"){const y=h.result;if(Number.isSafeInteger(y.channelId)&&typeof((w=y.session)==null?void 0:w.id)=="string"){const b=Number(y.channelId),C={sessionId:y.session.id,sessionDesktop:m};this.sessionsByChannel.set(b,C);const T=this.pendingFramesByChannel.get(b);T&&(this.pendingFramesByChannel.delete(b),this.emitBinaryFrame(T,C))}}x.resolve(h.result)}else x.reject(Object.assign(new Error(h.error||"浏览器操作失败"),{code:h.code}))},this.context.addEventListener("message",this.onMessage)}emitBinaryFrame(e,r){for(const o of this.listeners)o({type:"browser:frame",sessionId:r.sessionId,...r.sessionDesktop?{sessionDesktop:!0}:{},sequence:e.sequence,data:e.data,mime:"image/jpeg",timestamp:Date.now()})}request(e,r={}){if(this.context.parent===this.context)return Promise.reject(Object.assign(new Error("请从 AgentRoam Web 控制台打开浏览器直播"),{code:"WEB_SHELL_REQUIRED"}));const o=++this.sequence;return new Promise((l,u)=>{const h=setTimeout(()=>{this.pending.delete(o),u(Object.assign(new Error("浏览器操作超时"),{code:"WEB_SHELL_TIMEOUT"}))},this.timeoutMs);this.pending.set(o,{resolve:l,reject:u,timer:h,method:e}),this.context.parent.postMessage({type:hy,id:o,method:e,payload:r},this.context.location.origin)})}async readDesktopLockState(e){const r=await fetch("/api/remote-authorization/status",{credentials:"same-origin",cache:"no-store",signal:e});if(!r.ok)return null;const o=await r.json();return o.online===!0&&typeof o.locked=="boolean"?o.locked:null}onEvent(e){return this.listeners.add(e),()=>this.listeners.delete(e)}dispose(){this.context.removeEventListener("message",this.onMessage);for(const e of this.pending.values())clearTimeout(e.timer),e.reject(Object.assign(new Error("浏览器桥已关闭"),{code:"WEB_SHELL_CLOSED"}));this.pending.clear(),this.listeners.clear(),this.sessionsByChannel.clear(),this.pendingFramesByChannel.clear()}}class ln{constructor(e){this.url=e}static parse(e){const r=e.trim();if(!r)return null;const o=/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//.test(r)?r:`http://${r}`;let l;try{l=new URL(o)}catch{return null}return l.protocol!=="http:"&&l.protocol!=="https:"||!l.hostname?null:new ln(`${l.protocol}//${l.host}`)}toString(){return this.url}api(e){return`${this.url}${e.startsWith("/")?e:`/${e}`}`}}class DR{constructor(e,r,o){this.environment=e,this.storage=r,this.probe=o}async planStartup(){if(!this.environment.isNativeApp())return{mode:"same-origin"};const e=this.launchEndpoint();if(e)return{mode:"ready",endpoint:e};const r=this.storage.load();if(r){const o=await this.probe.probe(r);return o.ok?{mode:"ready",endpoint:r}:{mode:"setup",endpoint:r,failure:o.reason}}return{mode:"setup",endpoint:null}}async connect(e){const r=ln.parse(e);if(!r)return{ok:!1,reason:"地址无效,请输入 http(s)://host:port 形式的服务器地址"};const o=await this.probe.probe(r);return o.ok?(this.storage.save(r),{ok:!0,endpoint:r}):{ok:!1,reason:`无法连接服务器:${o.reason}`}}disconnect(){this.storage.clear()}launchEndpoint(){const e=this.environment.launchServerUrl();return e?ln.parse(e):null}}function g2(){return window.Capacitor??null}class PR{isNativeApp(){var e,r;return((r=(e=g2())==null?void 0:e.isNativePlatform)==null?void 0:r.call(e))??!1}platform(){var r,o;const e=(o=(r=g2())==null?void 0:r.getPlatform)==null?void 0:o.call(r);return e==="ios"||e==="android"?e:"web"}launchServerUrl(){const e=new URLSearchParams(window.location.search).get("server");return e&&e.trim()?e.trim():null}}const Mf="webapp.mobile.serverEndpoint.v1";class gy{load(){try{const e=localStorage.getItem(Mf);return e?ln.parse(e):null}catch{return null}}save(e){localStorage.setItem(Mf,e.toString())}clear(){localStorage.removeItem(Mf)}}const LR=6e3;class BR{constructor(e=(...r)=>fetch(...r)){this.transport=e}async probe(e,r=LR){const o=new AbortController,l=setTimeout(()=>o.abort(),r);try{const u=await this.transport(e.api("/api/agent/model"),{method:"GET",cache:"no-store",signal:o.signal});return u.ok?{ok:!0,modelId:(await u.json()).modelId??null}:{ok:!1,reason:u.status===401?"此 App 尚未授权,请扫描电脑上的授权二维码。":u.status===423?"电脑已锁定远程访问,请先在电脑上解锁。":`HTTP ${u.status}`}}catch(u){return{ok:!1,reason:u instanceof DOMException&&u.name==="AbortError"?"连接超时":FR(u)}}finally{clearTimeout(l)}}}function FR(t){return(t instanceof Error?t.message:String(t))||"网络错误"}function UR({id:t,label:e,className:r,disabled:o,children:l,onMove:u}){const[h,x]=ie.useState(null),w=ie.useRef(null),m=ie.useRef(),y=ie.useRef(0),b=()=>{clearTimeout(m.current),document.querySelectorAll(".toolbar-sort-target").forEach(C=>C.classList.remove("toolbar-sort-target")),w.current=null,x(null)};return ie.useEffect(()=>()=>{clearTimeout(m.current)},[]),M.jsx("div",{className:`${r} sortable-toolbar-action${h?" is-dragging":""}`,"data-toolbar-sort-id":t,title:`${e} · 长按拖动排序`,"aria-description":"长按拖动排序,也可按 Alt 加方向键调整顺序",style:h?{transform:`translate(${h.x}px, ${h.y}px)`}:void 0,onContextMenu:C=>C.preventDefault(),onKeyDown:C=>{var X;if(o||!C.altKey||!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(C.key))return;const T=Array.from(C.currentTarget.parentElement.querySelectorAll("[data-toolbar-sort-id]")),k=C.key==="ArrowLeft"?-1:C.key==="ArrowRight"?1:C.key==="ArrowUp"?-3:3,D=(X=T[T.indexOf(C.currentTarget)+k])==null?void 0:X.dataset.toolbarSortId;D&&(C.preventDefault(),u(t,D))},onPointerDownCapture:C=>{if(o||C.button!==0||!C.isPrimary)return;const T=C.currentTarget,k={pointer:C.pointerId,x:C.clientX,y:C.clientY,active:!1,target:t,node:T};w.current=k,C.pointerType!=="mouse"&&(m.current=setTimeout(()=>{w.current===k&&(k.active=!0,T.setPointerCapture(k.pointer),x({x:0,y:0}))},260))},onPointerMove:C=>{var O;const T=w.current;if(!T||T.pointer!==C.pointerId)return;const k=C.clientX-T.x,D=C.clientY-T.y;if(!T.active&&C.pointerType==="mouse"&&Math.hypot(k,D)>=6&&(T.active=!0,T.node.setPointerCapture(T.pointer)),!T.active){Math.hypot(k,D)>=10&&b();return}C.preventDefault(),x({x:k,y:D});const X=(O=document.elementFromPoint(C.clientX,C.clientY))==null?void 0:O.closest("[data-toolbar-sort-id]");document.querySelectorAll(".toolbar-sort-target").forEach(I=>I.classList.remove("toolbar-sort-target")),T.target=(X==null?void 0:X.dataset.toolbarSortId)??t,T.target!==t&&(X==null||X.classList.add("toolbar-sort-target"))},onPointerUp:C=>{const T=w.current;!T||T.pointer!==C.pointerId||(T.active&&(y.current=Date.now()+500,T.node.hasPointerCapture(T.pointer)&&T.node.releasePointerCapture(T.pointer),T.target!==t&&u(t,T.target)),b())},onPointerCancel:b,onClickCapture:C=>{Date.now()<y.current&&(C.preventDefault(),C.stopPropagation())},children:l})}const jR={refresh:"刷新页面",dashboard:"进行中的会话",collaboration:"群聊看板",install:"安装应用",remote:"远程桌面","ai-hub":"AI Hub",flow:"数字人",theme:"皮肤",files:"我的文件"};function WR(t){return t.map(e=>e.compactItems??[e]).filter(e=>e.length>0)}function VR(t){return WR(t).flat().filter(e=>e.id!=="files")}function zR({items:t,avatar:e,onReorder:r,sortingDisabled:o=!1}){const[l,u]=ie.useState(!1);ie.useEffect(()=>{C(!1)},[l]),ie.useEffect(()=>{const L=window.matchMedia("(max-width: 899px)"),j=()=>u(L.matches);return j(),L.addEventListener("change",j),()=>L.removeEventListener("change",j)},[]);const h=ie.useRef(null),x=ie.useRef(null),w=ie.useRef(null),[m,y]=ie.useState(null),[b,C]=ie.useState(!1),[T,k]=ie.useState({top:-1e3,left:0}),[D,X]=ie.useState(""),O=(L,j)=>{!r||o||(X(""),r(L,j).catch(U=>X(U instanceof Error?U.message:"顺序保存失败,请重试。")))},I=(L,j)=>M.jsx(UR,{id:L.id,label:jR[L.id]??L.id,className:j,disabled:!r||o,onMove:O,children:_(L)},L.id);ie.useEffect(()=>{var L;y(((L=h.current)==null?void 0:L.closest(".web-root"))??document.body)},[]),ie.useLayoutEffect(()=>{if(!b||l)return;const L=()=>{var $,se,ve,Q;const U=($=w.current)==null?void 0:$.getBoundingClientRect();if(!U)return;const F=((se=x.current)==null?void 0:se.getBoundingClientRect().width)??Math.min(292,innerWidth-16),Y=((Q=(ve=h.current)==null?void 0:ve.closest(".terminal-tabs"))==null?void 0:Q.getBoundingClientRect().bottom)??U.bottom;k({top:Math.max(U.bottom,Y)+6,left:Math.max(8,Math.min(innerWidth-F-8,U.right-F))})};L();const j=new ResizeObserver(L);return x.current&&j.observe(x.current),window.addEventListener("resize",L),window.addEventListener("scroll",L,!0),()=>{j.disconnect(),window.removeEventListener("resize",L),window.removeEventListener("scroll",L,!0)}},[b,l]),ie.useEffect(()=>{if(!b)return;const L=U=>{var Y,$;const F=U.target;(Y=h.current)!=null&&Y.contains(F)||($=x.current)!=null&&$.contains(F)||F instanceof Element&&F.closest("[data-toolbar-overlay]")||C(!1)},j=U=>{var F;U.key==="Escape"&&(C(!1),(F=w.current)==null||F.focus())};return document.addEventListener("pointerdown",L),document.addEventListener("keydown",j),()=>{document.removeEventListener("pointerdown",L),document.removeEventListener("keydown",j)}},[b]);const _=L=>M.jsx("div",{className:"toolbar-slot","data-toolbar-item":L.id,onClick:L.id==="remote"?()=>C(!1):void 0,children:L.content},L.id);if(!l){const L=["files","remote"].flatMap(U=>t.filter(F=>F.id===U)),j=t.filter(U=>!["files","remote"].includes(U.id));return M.jsxs("div",{ref:h,className:"responsive-toolbar glass-desktop-toolbar",children:[M.jsxs("div",{className:"glass-desktop-actions",children:[L.map(_),j.length>0&&M.jsx("button",{ref:w,type:"button",className:"file-drawer-toggle","aria-label":"更多功能",title:"更多功能","aria-haspopup":"dialog","aria-expanded":b,onClick:()=>C(U=>!U),children:M.jsx(i2,{size:20})})]}),M.jsx("div",{className:"toolbar-avatar",onPointerDown:()=>C(!1),children:e}),m&&na.createPortal(M.jsxs("div",{ref:x,hidden:!b,className:"glass-desktop-menu",role:"dialog","aria-label":"更多功能","data-toolbar-overlay":!0,style:{position:"fixed",top:T.top,left:T.left,zIndex:200},children:[j.map(U=>I(U,"toolbar-sort-cell")),D&&M.jsx("p",{className:"toolbar-sort-error",role:"alert",children:D})]}),m)]})}{const L=M.jsx("div",{className:"glass-mobile-actions",style:{display:"flex",alignItems:"center",gap:4},children:M.jsx("button",{ref:w,type:"button",className:"file-drawer-toggle ui-icon-button","aria-haspopup":"dialog","aria-label":"更多功能","aria-expanded":b,onClick:()=>C(j=>!j),children:M.jsx(i2,{size:20})})});return M.jsxs("div",{ref:h,className:"responsive-toolbar glass-mobile-toolbar",children:[t.filter(j=>j.id==="files").map(_),L,M.jsx("div",{className:"toolbar-avatar",children:e}),m&&na.createPortal(M.jsx("div",{hidden:!b,className:"glass-tools-backdrop",onClick:()=>C(!1),children:M.jsxs("section",{ref:x,className:"glass-tools-sheet",role:"dialog","aria-label":"更多功能","data-toolbar-overlay":!0,onClick:j=>j.stopPropagation(),children:[M.jsxs("header",{children:[M.jsxs("div",{children:[M.jsx("strong",{children:"更多功能"}),M.jsx("small",{children:"长按拖动排序"})]}),M.jsx("button",{type:"button","aria-label":"关闭更多功能",onClick:()=>{var j;C(!1),(j=w.current)==null||j.focus()},children:"×"})]}),M.jsx("div",{className:"glass-tools-grid",children:VR(t).map(j=>I(j,"glass-tool-cell"))}),D&&M.jsx("p",{className:"toolbar-sort-error",role:"alert",children:D})]})}),m)]})}}function $R(t,e){return Math.max(0,Math.floor((e-t)/1e3))}function K0({ready:t=!1,error:e,onRetry:r}){const[o]=ie.useState(Date.now),[l,u]=ie.useState(Date.now);ie.useEffect(()=>{if(t||e)return;const x=setInterval(()=>u(Date.now()),1e3);return()=>clearInterval(x)},[t,e]);const h=e||"数字人核心正在就绪";return M.jsxs("main",{className:`neural-boot${t?" is-ready":""}${e?" is-error":""}`,role:e?"alert":"status","aria-live":"polite","aria-busy":!t&&!e,"aria-hidden":t,children:[M.jsx("div",{className:"neural-grid","aria-hidden":"true"}),M.jsx("div",{className:"neural-rail neural-rail-left","aria-hidden":"true"}),M.jsx("div",{className:"neural-rail neural-rail-right","aria-hidden":"true"}),M.jsxs("section",{className:"neural-content",children:[M.jsxs("div",{className:"neural-brand","aria-hidden":"true",children:[M.jsx("span",{className:"neural-brand-signal"}),M.jsx("span",{children:"AgentRoam"}),M.jsx("small",{children:"NEURAL LINK"})]}),M.jsxs("div",{className:"neural-portrait","aria-hidden":"true",children:[M.jsx("span",{className:"neural-ring neural-ring-outer"}),M.jsx("span",{className:"neural-ring neural-ring-inner"}),M.jsx("span",{className:"neural-axis neural-axis-x"}),M.jsx("span",{className:"neural-axis neural-axis-y"}),M.jsx("span",{className:"neural-node neural-node-one"}),M.jsx("span",{className:"neural-node neural-node-two"}),M.jsx("span",{className:"neural-node neural-node-three"}),M.jsx("span",{className:"neural-node neural-node-four"}),M.jsx("div",{className:"neural-avatar-frame",children:M.jsxs("div",{className:"neural-avatar",children:[M.jsx(ey,{className:"neural-avatar-icon",size:66,strokeWidth:1.3}),M.jsx("span",{className:"neural-visor"})]})})]}),M.jsxs("div",{className:"neural-copy",children:[M.jsx("strong",{children:"正在唤醒工作区"}),M.jsx("span",{children:h})]}),M.jsx("div",{className:"neural-progress","aria-hidden":"true",children:M.jsx("span",{})}),M.jsxs("div",{className:"neural-meta","aria-hidden":"true",children:[M.jsx("span",{children:"AGENT CORE"}),M.jsxs("span",{className:"neural-meta-time",children:["T+",$R(o,l).toString().padStart(2,"0"),"S"]})]}),e&&M.jsx("button",{type:"button",className:"neural-retry","aria-label":"重试连接",title:"重试连接",onClick:()=>r==null?void 0:r(),children:M.jsx(ry,{size:18,"aria-hidden":"true"})})]})]})}const HR=`
184
+ .web-appearance-controls { display: flex; align-items: center; gap: 4px; }
185
+ .web-root.is-remote-fullscreen > .terminal-tabs { display: none; }
186
+ .web-root.is-remote-fullscreen .tree-col,
187
+ .web-root.is-remote-fullscreen .preview-col { display: none; }
188
+
189
+ html, body { width:100%; height:100%; margin:0; overflow:hidden; background:var(--ui-root-bg, #0b0b10); overscroll-behavior:none; color:var(--ui-text, #e8e8ee); }
190
+ * { -webkit-tap-highlight-color: transparent; }
191
+ .terminal-tabs { display:flex; align-items:end; gap:4px; min-height:38px; padding:0 8px; background:var(--ui-tabbar-bg, #12141b); border-bottom:0; flex-shrink:0; }
192
+ .terminal-tab-list[hidden],.terminal-add[hidden]{display:none}
193
+ .computer-page-heading{display:flex;align-items:center;gap:4px;flex:1;min-width:0;color:var(--ui-text,#e8e8ee);font-size:13px}.computer-page-heading>span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.computer-page-heading a{text-decoration:none;display:grid;place-items:center;flex-shrink:0}
194
+ .computer-page-pane{position:relative;flex:1;min-height:0;background:var(--ui-root-bg,#0b0b10)}.computer-page-pane>iframe{width:100%;height:100%;border:0;display:block}.computer-page-fallback{position:absolute;bottom:32px;left:50%;transform:translateX(-50%);color:var(--ui-tab-accent,#7aa2f7);font-size:13px;z-index:2}
195
+ .computer-page-blocked{flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;text-align:center;padding:24px;color:var(--ui-text,#e8e8ee)}.computer-page-blocked h2{font-size:20px;margin:0}.computer-page-blocked p{max-width:420px;line-height:1.7;color:var(--ui-muted-text,#999dab);margin:0}.computer-page-blocked a{display:flex;align-items:center;gap:8px;padding:12px 18px;border-radius:8px;background:var(--ui-tab-accent,#7aa2f7);color:var(--ui-root-bg,#0b0b10);text-decoration:none}
196
+ .terminal-tab-list { position:relative; display:flex; align-items:end; gap:4px; flex:0 1 auto; min-width:0; height:100%; overflow-x:auto; overflow-y:hidden; touch-action:pan-x; overscroll-behavior-x:contain; -webkit-overflow-scrolling:touch; scroll-behavior:smooth; scrollbar-width:none; }
197
+ .terminal-tab { display:flex; align-items:center; flex-shrink:0; gap:7px; min-width:74px; max-width:130px; height:32px; padding:0 7px 0 10px; border-radius:7px 7px 0 0; background:var(--ui-tab-bg, #1b1e28); color:var(--ui-tab-text, #8f93a4); font-size:11px; cursor:pointer; box-sizing:border-box; transition:color .2s ease,box-shadow .2s ease; }
198
+ .terminal-tab.active { color:var(--ui-tab-active-text, #edf0f7); background:var(--ui-active-content-bg, var(--ui-tab-active-bg, #262b38)); box-shadow:inset 0 2px var(--ui-tab-accent, #7aa2f7); }
199
+ .terminal-tab span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; flex:1; }
200
+ .terminal-tab button { width:18px; height:18px; border:0; border-radius:4px; background:transparent; color:var(--ui-tab-text, #707586); padding:0; }
201
+ .terminal-add { flex-shrink:0; min-width:30px; height:28px; margin-bottom:2px; border:1px solid var(--ui-tabbar-border, #303442); border-radius:6px; background:var(--ui-tab-bg, #1b1e28); color:var(--ui-tab-text, #9da2b2); }
202
+ .terminal-connection { align-self:stretch; display:flex; align-items:center; margin-left:auto; padding:0 9px; background:var(--ui-connection-bg, #12141b); color:var(--ui-connection-text, #777b8c); font-size:10.5px; flex-shrink:0; z-index:5; }
203
+ .file-drawer-toggle { display:grid; place-items:center; width:28px; height:28px; padding:0; border:0; border-radius:6px; background:transparent; color:var(--ui-connection-text, #777b8c); cursor:pointer; flex-shrink:0; touch-action:manipulation; }
204
+ .file-drawer-toggle:hover, .file-drawer-toggle[aria-expanded="true"] { background:color-mix(in srgb, var(--ui-tab-accent, #7aa2f7) 12%, transparent); color:var(--ui-tab-active-text, #edf0f7); }
205
+ .file-drawer-toggle:focus-visible { outline:2px solid var(--ui-tab-accent, #7aa2f7); outline-offset:-2px; }
206
+ .theme-avatar-with-status { position:relative; display:flex; flex-shrink:0; }
207
+ .theme-avatar-status { position:absolute; right:-2px; bottom:-2px; z-index:7; width:6px; height:6px; box-sizing:border-box; border:1px solid var(--ui-connection-bg, #12141b); border-radius:50%; background:var(--ui-error); pointer-events:none; }
208
+ .theme-avatar-status[data-connected="true"] { background:var(--ui-success); }
209
+ .theme-picker { position:relative; display:flex; align-items:center; flex-shrink:0; }
210
+ .responsive-toolbar { --toolbar-avatar-gap:clamp(0.75rem, 2vi, 2rem); position:relative; display:flex; align-items:center; flex-shrink:0; gap:0; z-index:6; }
211
+ .glass-mobile-toolbar { column-gap:var(--toolbar-avatar-gap); }
212
+ .glass-desktop-menu[hidden], .glass-tools-backdrop[hidden] { display:none; }
213
+ .glass-tool-cell .toolbar-slot > * { width:100%; min-width:0; border-radius:inherit; }
214
+ .sortable-toolbar-action { position:relative; touch-action:none; user-select:none; -webkit-user-select:none; -webkit-touch-callout:none; cursor:grab; }
215
+ .sortable-toolbar-action.is-dragging { z-index:2; pointer-events:none; opacity:.85; cursor:grabbing; box-shadow:0 8px 24px #0004; }
216
+ .sortable-toolbar-action.toolbar-sort-target { outline:2px solid var(--ui-tab-accent); outline-offset:2px; }
217
+ .glass-tools-sheet header small { display:block; margin-top:4px; font-size:11px; color:var(--ui-muted-text); }
218
+ .toolbar-sort-error { flex-basis:100%; margin:8px 0 0; color:var(--ui-error); font-size:12px; }
219
+ .toolbar-avatar, .toolbar-slot { display:flex; align-items:center; flex-shrink:0; }
220
+ .toolbar-size-measure { position:fixed; top:-1000px; visibility:hidden; pointer-events:none; }
221
+ .toolbar-tools { display:flex; align-items:center; flex-shrink:0; gap:0; }
222
+ .toolbar-tools-expanded { flex-wrap:wrap; padding:4px; }
223
+ .theme-avatar { position:relative; display:flex; align-items:center; justify-content:center; width:18px; height:18px; padding:0; border-radius:99px; font-size:9px; font-weight:700; cursor:pointer; flex-shrink:0; touch-action:manipulation; -webkit-tap-highlight-color:transparent; transition:transform .12s ease, filter .12s ease; }
224
+ /* Hit-area padding keeps the compact visual circle easy to target. */
225
+ .theme-avatar::after { content:""; position:absolute; inset:-6px; border-radius:99px; }
226
+ .theme-avatar:active { transform:scale(.9); filter:brightness(1.15); }
227
+ .theme-popover-item { display:flex; align-items:center; gap:8px; padding:7px 8px; border:none; border-radius:8px; cursor:pointer; touch-action:manipulation; -webkit-tap-highlight-color:transparent; }
228
+ .theme-popover-item:active { background:color-mix(in srgb, var(--ui-tab-accent, #7aa2f7) 22%, transparent); }
229
+ /* Touch devices: keep hit areas tall while packing icons horizontally.
230
+ The tab bar must grow in step — it clips overflow-y, so an expanded
231
+ hit area taller than the bar would get cut off. */
232
+ @media (pointer: coarse) {
233
+ .terminal-tabs { min-height:44px; }
234
+ .theme-avatar-with-status { width:36px; height:44px; align-items:center; justify-content:center; }
235
+ .theme-avatar::after { inset:-13px -9px; }
236
+ .theme-avatar-status { right:6px; bottom:10px; }
237
+ .toolbar-tools .file-drawer-toggle, .responsive-toolbar .file-drawer-toggle { width:32px; height:40px; }
238
+ .theme-popover-item { padding-top:11px; padding-bottom:11px; }
239
+ }
240
+ @media (prefers-reduced-motion: reduce) { .theme-avatar { transition:none; } }
241
+ .terminal-track { display:flex; width:100%; height:100%; will-change:transform; }
242
+ .terminal-slide { position:relative; flex:0 0 100%; width:100%; height:100%; min-width:0; overflow:hidden; }
243
+ .webapp-frame { display:block; width:100%; height:100%; border:0; background:var(--ui-term-col-bg, #101014); }
244
+ .terminal-surface { position:relative; flex:1; min-height:90px; overflow:hidden; }
245
+ .terminal-screen { display:flex; flex-direction:column; width:100%; min-height:0; overflow:hidden; box-sizing:border-box; }
246
+ .terminal-screen .xterm { flex:1; height:100%; background:var(--ui-terminal-bg, #101014); }
247
+ .terminal-screen .xterm .xterm-viewport { background-color:var(--ui-terminal-bg, #101014); }
248
+ .terminal-screen .xterm-scrollable-element { touch-action:pan-y; -webkit-overflow-scrolling:touch; }
249
+ .terminal-boot { position:absolute; inset:0; z-index:46; display:flex; align-items:center; justify-content:center; gap:9px; pointer-events:auto; font-size:12px; line-height:1.4; letter-spacing:0; }
250
+ .terminal-boot-spinner { width:16px; height:16px; box-sizing:border-box; border:2px solid color-mix(in srgb,currentColor 24%,transparent); border-top-color:currentColor; border-radius:50%; animation:terminal-boot-spin .8s linear infinite; }
251
+ .terminal-boot-warning { position:absolute; top:9px; left:50%; z-index:45; transform:translateX(-50%); max-width:calc(100% - 24px); padding:5px 8px; border:1px solid; border-radius:6px; pointer-events:none; font-size:11px; line-height:1.35; letter-spacing:0; white-space:normal; text-align:center; }
252
+ @keyframes terminal-boot-spin { to { transform:rotate(360deg); } }
253
+ @media (prefers-reduced-motion: reduce) { .terminal-track,.terminal-tab { transition:none !important; } .terminal-boot-spinner { animation:none !important; } }
254
+ .web-root {
255
+ position: fixed;
256
+ top: var(--vv-top, 0px);
257
+ left: var(--vv-left, 0px);
258
+ width: var(--vv-width, 100vw);
259
+ height: var(--vv-height, 100dvh) !important;
260
+ }
261
+ .tree-scroll {
262
+ flex: 1;
263
+ min-height: 0;
264
+ overflow-y: auto;
265
+ overflow-x: hidden;
266
+ overscroll-behavior: contain;
267
+ touch-action: pan-y;
268
+ -webkit-overflow-scrolling: touch;
269
+ padding: 6px;
270
+ }
271
+ .tree-location {
272
+ position: sticky;
273
+ top: -6px;
274
+ z-index: 3;
275
+ display: flex;
276
+ align-items: center;
277
+ gap: 5px;
278
+ margin: -1px -1px 0;
279
+ padding: 7px 7px 5px;
280
+ background: color-mix(in srgb, var(--ui-tree-bg, #121218) 98%, transparent);
281
+ }
282
+ .tree-location input {
283
+ flex: 1;
284
+ min-width: 0;
285
+ height: 28px;
286
+ border: 1px solid var(--ui-panel-input-border, #30303b);
287
+ border-radius: 6px;
288
+ outline: none;
289
+ padding: 0 8px;
290
+ background: var(--ui-panel-input-bg, #0f0f15);
291
+ color: var(--ui-panel-input-text, #d8d8df);
292
+ font-family: "SF Mono", Menlo, monospace;
293
+ font-size: 10.5px;
294
+ }
295
+ .tree-location input:focus { border-color: var(--ui-tab-accent, #536b9e); }
296
+ .tree-location button {
297
+ width: 28px;
298
+ height: 28px;
299
+ flex-shrink: 0;
300
+ border: 1px solid var(--ui-panel-input-border, #30303a);
301
+ border-radius: 6px;
302
+ background: var(--ui-tab-bg, #202029);
303
+ color: var(--ui-tab-text, #aaaab8);
304
+ font-size: 12px;
305
+ }
306
+ .tree-location button[data-active="1"] {
307
+ border-color: var(--ui-success, #4f6f58);
308
+ color: var(--ui-success, #9ece6a);
309
+ background: color-mix(in srgb, var(--ui-success, #9ece6a) 12%, var(--ui-tree-bg, #18221b));
310
+ }
311
+ .tree-head button { height:26px; padding:0 10px; border:0; border-radius:6px 6px 0 0; background:transparent; color:var(--ui-drawer-tab-text, #74798a); font-size:11px; }
312
+ .tree-head button.drawer-tab-active { color:var(--ui-drawer-tab-active, #e4e7ef); box-shadow:inset 0 -2px var(--ui-tab-accent, #7aa2f7); }
313
+ .history-panel { flex:1; min-height:0; overflow:auto; padding:7px; }
314
+ .pinned-commands { position:sticky; top:0; z-index:3; margin:-1px -1px 7px; border:1px solid var(--ui-tabbar-border, #252832); border-radius:6px; background:var(--ui-tree-bg, #121218); box-shadow:0 7px 12px color-mix(in srgb, var(--ui-root-bg, #0b0b10) 58%, transparent); overflow:hidden; }
315
+ .pinned-command-head { display:flex; align-items:center; min-height:30px; padding:0 6px 0 10px; border-bottom:1px solid var(--ui-tabbar-border, #252832); color:var(--ui-history-meta, #74798a); font-size:10px; }
316
+ .pinned-command-head span { flex:1; }
317
+ .pinned-command-row { display:flex; align-items:center; min-height:34px; border-bottom:1px solid color-mix(in srgb, var(--ui-tabbar-border, #252832) 76%, transparent); cursor:pointer; outline:none; }
318
+ .pinned-command-row:last-child { border-bottom:0; }
319
+ .pinned-command-row:hover,.pinned-command-row:focus-visible { background:color-mix(in srgb, var(--ui-tab-active-bg, #1f2430) 76%, transparent); }
320
+ .pinned-command-row:focus-visible { box-shadow:inset 2px 0 var(--ui-tab-accent, #7aa2f7); }
321
+ .pinned-command-dragging { opacity:.66; background:var(--ui-tab-active-bg, #1f2430); }
322
+ .pinned-command-row code { flex:1; min-width:0; padding:0 5px; overflow:hidden; color:var(--ui-history-item-text, #d3d6df); font-size:11px; text-overflow:ellipsis; white-space:nowrap; }
323
+ .pinned-command-grip { display:inline-flex; align-items:center; justify-content:center; width:28px; height:32px; padding:0; border:0; background:transparent; color:var(--ui-history-meta, #626777); cursor:grab; touch-action:none; }
324
+ .pinned-command-grip:active { cursor:grabbing; }
325
+ .pinned-command-actions { display:flex; align-items:center; padding-right:3px; opacity:.42; transition:opacity .15s ease; }
326
+ .pinned-command-row:hover .pinned-command-actions,.pinned-command-row:focus-within .pinned-command-actions { opacity:1; }
327
+ .pinned-command-editor { display:grid; grid-template-columns:minmax(0,1fr) 27px 27px; gap:4px; align-items:center; min-height:39px; padding:4px 5px 4px 8px; border-bottom:1px solid var(--ui-tabbar-border, #252832); }
328
+ .pinned-command-editor input { min-width:0; height:27px; box-sizing:border-box; border:1px solid var(--ui-tab-accent, #536b9e); border-radius:5px; outline:none; padding:0 7px; background:var(--ui-panel-input-bg, #0f0f15); color:var(--ui-panel-input-text, #ddd); font-family:"SF Mono",Menlo,monospace; font-size:10.5px; }
329
+ .pinned-command-editor small { grid-column:1 / -1; color:var(--ui-danger, #e06c75); font-size:9px; }
330
+ .terminal-clipboard-notice { padding:4px 8px; flex-shrink:0; font-size:12px; }
331
+ .terminal-native-touch, .terminal-native-touch .xterm-screen, .terminal-native-touch .terminal-native-rows, .terminal-native-touch .terminal-native-rows * { -webkit-user-select:text !important; user-select:text !important; -webkit-touch-callout:default; }
332
+ .terminal-native-touch .terminal-native-rows { position:absolute; top:0; left:0; z-index:4; pointer-events:auto !important; }
333
+ .terminal-native-touch .xterm-rows:not(.terminal-native-rows) { -webkit-user-select:none !important; user-select:none !important; }
334
+ .terminal-native-touch .terminal-native-rows span { display:inline !important; }
335
+ .terminal-native-touch .xterm-helper-textarea { opacity:1; background:transparent; color:transparent; -webkit-text-fill-color:transparent; caret-color:transparent; outline:none; text-shadow:none; -webkit-appearance:none; appearance:none; -webkit-user-select:text; user-select:text; -webkit-touch-callout:default; font-size:16px !important; left:var(--native-input-left, 0px) !important; top:var(--native-input-top, 0px) !important; width:var(--native-input-width, 80px) !important; height:var(--native-input-height, 32px) !important; z-index:10 !important; pointer-events:var(--native-input-events, none); }
336
+ .history-search { display:flex; gap:5px; padding:5px; background:var(--ui-tree-bg, #121218); }
337
+ .history-search input { flex:1; min-width:0; height:28px; border:1px solid var(--ui-panel-input-border, #30303a); border-radius:6px; padding:0 8px; background:var(--ui-panel-input-bg, #0f0f15); color:var(--ui-panel-input-text, #ddd); font-size:11px; }
338
+ .history-icon-button { display:inline-flex; align-items:center; justify-content:center; width:27px; min-width:27px; height:27px; padding:0; border:1px solid var(--ui-panel-input-border, #30303a); border-radius:5px; background:var(--ui-tab-bg, #202029); color:var(--ui-connection-text, #999dab); }
339
+ .history-icon-button:hover:not(:disabled) { color:var(--ui-drawer-tab-active, #e4e7ef); border-color:var(--ui-tab-accent, #536b9e); }
340
+ .history-icon-button:disabled { cursor:not-allowed; opacity:.32; }
341
+ .history-icon-danger:hover:not(:disabled) { color:var(--ui-danger, #e06c75); border-color:color-mix(in srgb, var(--ui-danger, #e06c75) 60%, var(--ui-panel-input-border, #30303a)); }
342
+ .history-item { padding:9px 7px; border-bottom:1px solid var(--ui-tabbar-border, #242731); cursor:pointer; border-radius:6px; }
343
+ .history-item:hover { background:color-mix(in srgb, var(--ui-tab-active-bg, #181b24) 80%, transparent); }
344
+ .history-item:active { background:var(--ui-tab-active-bg, #1f2430); }
345
+ .history-item-disabled { cursor:not-allowed; opacity:.55; }
346
+ .history-item-disabled:hover { background:transparent; }
347
+ .history-item:focus-visible { outline:1px solid var(--ui-tab-accent, #536b9e); outline-offset:-1px; }
348
+ .history-item code { display:block; color:var(--ui-history-item-text, #d3d6df); font-size:11px; overflow-wrap:anywhere; }
349
+ .history-item small { display:block; margin:4px 0 7px; color:var(--ui-history-meta, #656a79); font-size:9.5px; }
350
+ .history-item-actions { display:flex; gap:5px; }
351
+ .history-empty { padding:18px; color:#5d6270; font-size:11px; text-align:center; }
352
+ @media (pointer:coarse) { .pinned-command-actions { opacity:.78; } }
353
+ .keybar-scroll { scrollbar-width:none; }
354
+ .keybar-scroll::-webkit-scrollbar { display:none; }
355
+ .tree-filter {
356
+ position: sticky;
357
+ top: 34px;
358
+ z-index: 2;
359
+ display: flex;
360
+ align-items: center;
361
+ gap: 6px;
362
+ margin: -1px -1px 7px;
363
+ padding: 7px 8px;
364
+ border-bottom: 1px solid var(--ui-tabbar-border, #25252e);
365
+ background: color-mix(in srgb, var(--ui-tree-bg, #121218) 97%, transparent);
366
+ color: var(--ui-history-meta, #666678);
367
+ backdrop-filter: blur(8px);
368
+ }
369
+ .tree-filter input {
370
+ flex: 1;
371
+ min-width: 0;
372
+ height: 27px;
373
+ border: 1px solid var(--ui-panel-input-border, #30303a);
374
+ border-radius: 6px;
375
+ outline: none;
376
+ padding: 0 8px;
377
+ background: var(--ui-panel-input-bg, #0f0f15);
378
+ color: var(--ui-panel-input-text, #d8d8df);
379
+ font-size: 11px;
380
+ }
381
+ .tree-filter input:focus { border-color: var(--ui-tab-accent, #536b9e); }
382
+ @media (max-width:768px), (pointer:coarse) {
383
+ .pinned-command-editor input, .history-search input, .tree-filter input { font-size:16px; }
384
+ .terminal-screen .xterm-helper-textarea { font-size:16px !important; }
385
+ }
386
+ .tree-filter button {
387
+ width: 25px;
388
+ height: 25px;
389
+ padding: 0;
390
+ border: 0;
391
+ border-radius: 5px;
392
+ background: var(--ui-tab-bg, #24242d);
393
+ color: var(--ui-connection-text, #9999a6);
394
+ font-size: 10px;
395
+ }
396
+ .tree-row {
397
+ display: flex;
398
+ align-items: center;
399
+ gap: 6px;
400
+ min-height: 31px;
401
+ padding-right: 7px;
402
+ border-radius: 6px;
403
+ font-size: 12px;
404
+ white-space: nowrap;
405
+ cursor: pointer;
406
+ }
407
+ .tree-disclosure {
408
+ width: 13px;
409
+ min-width: 13px;
410
+ height: 16px;
411
+ display: inline-flex;
412
+ align-items: center;
413
+ justify-content: center;
414
+ color: var(--ui-history-meta, #777785);
415
+ }
416
+ .tree-entry-icon {
417
+ width: 17px;
418
+ min-width: 17px;
419
+ height: 17px;
420
+ display: inline-flex;
421
+ align-items: center;
422
+ justify-content: center;
423
+ }
424
+ .tree-folder-icon { color: var(--ui-tab-accent, #7aa2f7); }
425
+ .tree-entry-name { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
426
+ .tree-spin { animation:tree-spin .8s linear infinite; }
427
+ @keyframes tree-spin { to { transform:rotate(360deg); } }
428
+ @media (prefers-reduced-motion: reduce) { .tree-spin { animation:none; } }
429
+ .tree-row[data-selected="1"] { background: color-mix(in srgb, var(--ui-tab-accent, #26304a) 24%, transparent); }
430
+ .tree-error { margin: 2px 8px 6px; padding: 7px 8px; border-left: 2px solid #f7768e; color: #f7768e; font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
431
+ .tree-size { margin-left: auto; color: var(--ui-history-meta, #555); font-size: 10px; flex-shrink: 0; }
432
+
433
+ /* phone-first: terminal is THE screen */
434
+ .workspace { display: grid !important; grid-template-columns: 1fr; }
435
+ .workspace[hidden] { display:none !important; }
436
+ .tree-col {
437
+ display: flex;
438
+ position: fixed;
439
+ top: var(--vv-top, 0px);
440
+ height: var(--vv-height, 100dvh);
441
+ right: calc(100vw - var(--vv-left, 0px) - var(--vv-width, 100vw));
442
+ width: min(82vw, 320px); z-index: 40;
443
+ transform: translateX(102%); transition: transform .22s ease;
444
+ }
445
+ .tree-col-open { transform: translateX(0); box-shadow: -12px 0 32px rgba(0,0,0,.5); }
446
+ .drawer-mask { position:fixed; top:var(--vv-top, 0px); left:var(--vv-left, 0px); width:var(--vv-width, 100vw); height:var(--vv-height, 100dvh); background:rgba(0,0,0,.45); z-index:39; }
447
+ .preview-col {
448
+ position: fixed;
449
+ top: var(--vv-top, 0px);
450
+ left: var(--vv-left, 0px);
451
+ width: var(--vv-width, 100vw);
452
+ height: var(--vv-height, 100dvh);
453
+ z-index: 50;
454
+ background: var(--ui-term-col-bg, #101014);
455
+ }
456
+ .cwd-hint { max-width: 40vw; }
457
+
458
+ @media (min-width: 900px) {
459
+ .workspace.show-tree.has-preview { grid-template-columns: 46% 20% 34%; }
460
+ .workspace.show-tree:not(.has-preview) { grid-template-columns: 80% 20%; }
461
+ .workspace.has-preview:not(.show-tree) { grid-template-columns: 66% 34%; }
462
+ /* desktop: the tree becomes a right column only while the drawer is open */
463
+ .tree-col {
464
+ position: static; top: auto; height: auto; width: auto; transform: none;
465
+ box-shadow: none; border-left: 1px solid var(--ui-tree-border, #1e1e26);
466
+ }
467
+ .workspace:not(.show-tree) .tree-col { display: none; }
468
+ .preview-col { position: relative; inset: auto; width: auto; height: auto; border-left: 1px solid var(--ui-tree-border, #1e1e26); }
469
+ .drawer-mask { display: none; }
470
+ }
471
+ .web-root.is-remote-fullscreen .workspace { grid-template-columns: minmax(0, 1fr); }
472
+ `,gi=t=>t,GR=[gi({id:"pearl",label:"珍珠白",swatch:"#f5f6fa",preview:["#f5f6fa","#4f6ef7"],cssVars:{"--ui-color-scheme":"light","--ui-root-bg":"#f5f6fa","--ui-text":"#111827","--ui-tabbar-bg":"#eef0f6","--ui-tabbar-border":"#dfe3ee","--ui-tab-bg":"#e6e9f4","--ui-tab-text":"#5b6472","--ui-tab-active-bg":"#ffffff","--ui-tab-active-text":"#111827","--ui-tab-accent":"#4f6ef7","--ui-connection-bg":"#eef0f6","--ui-connection-text":"#9ca3af","--ui-tree-bg":"#fbfcfe","--ui-tree-border":"#e5e8f0","--ui-term-col-bg":"#f5f6fa","--ui-fab-bg":"#ffffff","--ui-fab-border":"#d8dcea","--ui-muted-surface":"#eef0f6","--ui-muted-border":"#d8dcea","--ui-muted-text":"#6b7280","--ui-panel-input-bg":"#ffffff","--ui-panel-input-text":"#111827","--ui-panel-input-border":"#d8dcea","--ui-drawer-tab-text":"#6b7280","--ui-drawer-tab-active":"#111827","--ui-history-item-text":"#1f2937","--ui-history-meta":"#9ca3af","--ui-success":"#059669","--ui-error":"#dc2626"},termHostBg:"#ffffff",keybar:{bg:"#eef0f6",border:"#dfe3ee",keyBg:"#ffffff",keyBorder:"#d8dcea",keyText:"#4b5563",accent:"#4f6ef7",accentText:"#ffffff",drag:"#a5b4fc"},xterm:{background:"#ffffff",foreground:"#1f2937",cursor:"#4f6ef7",selectionBackground:"#c7d2fe",black:"#24292e",red:"#d73a49",green:"#22863a",yellow:"#b08800",blue:"#005cc5",magenta:"#6f42c1",cyan:"#1b7c83",white:"#6a737d",brightBlack:"#959da5",brightWhite:"#fafbfc"}}),gi({id:"scifi",label:"科幻霓虹",swatch:"#050a14",preview:["#050a14","#22d3ee"],cssVars:{"--ui-color-scheme":"dark","--ui-root-bg":"#050a14","--ui-text":"#e2f3ff","--ui-tabbar-bg":"#0a1220","--ui-tabbar-border":"#10263c","--ui-tab-bg":"#0d1626","--ui-tab-text":"#5c7893","--ui-tab-active-bg":"#122036","--ui-tab-active-text":"#e2f3ff","--ui-tab-accent":"#22d3ee","--ui-connection-bg":"#0a1220","--ui-connection-text":"#5c7893","--ui-tree-bg":"#0d1626","--ui-tree-border":"#10263c","--ui-term-col-bg":"#050a14","--ui-fab-bg":"#122036","--ui-fab-border":"#155e75","--ui-muted-surface":"#0d1626","--ui-muted-border":"#164e63","--ui-muted-text":"#9fb8d0","--ui-panel-input-bg":"#0a1220","--ui-panel-input-text":"#e2f3ff","--ui-panel-input-border":"#164e63","--ui-drawer-tab-text":"#5c7893","--ui-drawer-tab-active":"#e2f3ff","--ui-history-item-text":"#d5ecfb","--ui-history-meta":"#5c7893","--ui-success":"#34d399","--ui-error":"#fb7185"},termHostBg:"#0a1220",keybar:{bg:"#0a1220",border:"#10263c",keyBg:"#0d1626",keyBorder:"#164e63",keyText:"#9fb8d0",accent:"#22d3ee",accentText:"#04121a",drag:"#155e75"},xterm:{background:"#0a1220",foreground:"#e2f3ff",cursor:"#22d3ee",selectionBackground:"#164e63",black:"#0d1626",red:"#fb7185",green:"#34d399",yellow:"#fbbf24",blue:"#38bdf8",magenta:"#e879f9",cyan:"#22d3ee",white:"#e2f3ff",brightBlack:"#5c7893",brightWhite:"#ffffff"}}),gi({id:"noir",label:"暗夜黑",swatch:"#0f1115",preview:["#0f1115","#a78bfa"],cssVars:{"--ui-color-scheme":"dark","--ui-root-bg":"#0f1115","--ui-text":"#eceff4","--ui-tabbar-bg":"#14171d","--ui-tabbar-border":"#232833","--ui-tab-bg":"#191d24","--ui-tab-text":"#6b7280","--ui-tab-active-bg":"#1f242d","--ui-tab-active-text":"#eceff4","--ui-tab-accent":"#a78bfa","--ui-connection-bg":"#14171d","--ui-connection-text":"#6b7280","--ui-tree-bg":"#191d24","--ui-tree-border":"#232833","--ui-term-col-bg":"#0f1115","--ui-fab-bg":"#1f242d","--ui-fab-border":"#2a3040","--ui-muted-surface":"#191d24","--ui-muted-border":"#2a3040","--ui-muted-text":"#aab2bf","--ui-panel-input-bg":"#14171d","--ui-panel-input-text":"#eceff4","--ui-panel-input-border":"#2a3040","--ui-drawer-tab-text":"#6b7280","--ui-drawer-tab-active":"#eceff4","--ui-history-item-text":"#d7dce4","--ui-history-meta":"#6b7280","--ui-success":"#4ade80","--ui-error":"#f87171"},termHostBg:"#14171d",keybar:{bg:"#14171d",border:"#232833",keyBg:"#191d24",keyBorder:"#2a3040",keyText:"#aab2bf",accent:"#a78bfa",accentText:"#0f1115",drag:"#4b4470"},xterm:{background:"#14171d",foreground:"#eceff4",cursor:"#a78bfa",selectionBackground:"#3b3654",black:"#191d24",red:"#f87171",green:"#4ade80",yellow:"#fbbf24",blue:"#60a5fa",magenta:"#c084fc",cyan:"#67e8f9",white:"#eceff4",brightBlack:"#6b7280",brightWhite:"#ffffff"}}),gi({id:"mist",label:"雾白靛蓝",swatch:"#f7f8fb",preview:["#f7f8fb","#4258c4"],cssVars:{"--ui-color-scheme":"light","--ui-root-bg":"#f7f8fb","--ui-text":"#252d3d","--ui-tabbar-bg":"#e4e9f2","--ui-tabbar-border":"#dce3ef","--ui-tab-bg":"#e9edf5","--ui-tab-text":"#5b687f","--ui-tab-active-bg":"#f7f8fb","--ui-tab-active-text":"#252d3d","--ui-tab-accent":"#4258c4","--ui-connection-bg":"#e4e9f2","--ui-connection-text":"#5b687f","--ui-tree-bg":"#e9edf5","--ui-tree-border":"#dce3ef","--ui-term-col-bg":"#f7f8fb","--ui-fab-bg":"#ffffff","--ui-fab-border":"#dce3ef","--ui-muted-surface":"#e9edf5","--ui-muted-border":"#dce3ef","--ui-muted-text":"#5b687f","--ui-panel-input-bg":"#ffffff","--ui-panel-input-text":"#252d3d","--ui-panel-input-border":"#dce3ef","--ui-drawer-tab-text":"#5b687f","--ui-drawer-tab-active":"#252d3d","--ui-history-item-text":"#252d3d","--ui-history-meta":"#5b687f","--ui-success":"#247860","--ui-error":"#be3d50"},termHostBg:"#ffffff",keybar:{bg:"#e4e9f2",border:"#dce3ef",keyBg:"#ffffff",keyBorder:"#dce3ef",keyText:"#5b687f",accent:"#4258c4",accentText:"#ffffff",drag:"#8a9ac5"},xterm:{background:"#ffffff",foreground:"#252d3d",cursor:"#4258c4",selectionBackground:"#d6dcf4",black:"#252d3d",red:"#be3d50",green:"#247860",yellow:"#956018",blue:"#346faa",magenta:"#7456a6",cyan:"#277784",white:"#5b687f",brightBlack:"#5b687f",brightWhite:"#f7f8fb"}}),gi({id:"glass",label:"毛玻璃",swatch:"#c3dbee",preview:["#c3dbee","#357b88"],cssVars:{"--ui-color-scheme":"light","--ui-root-bg":"#edf3f4","--ui-text":"#263e48","--ui-tabbar-bg":"#e0ebee","--ui-tabbar-border":"#d3e1e5","--ui-tab-bg":"#e5eef1","--ui-tab-text":"#58727c","--ui-tab-active-bg":"#edf3f4","--ui-tab-active-text":"#263e48","--ui-tab-accent":"#357b88","--ui-connection-bg":"#e0ebee","--ui-connection-text":"#58727c","--ui-tree-bg":"#e5eef1","--ui-tree-border":"#d3e1e5","--ui-term-col-bg":"#edf3f4","--ui-fab-bg":"#ffffff","--ui-fab-border":"#d3e1e5","--ui-muted-surface":"#e5eef1","--ui-muted-border":"#d3e1e5","--ui-muted-text":"#58727c","--ui-panel-input-bg":"#ffffff","--ui-panel-input-text":"#263e48","--ui-panel-input-border":"#d3e1e5","--ui-drawer-tab-text":"#58727c","--ui-drawer-tab-active":"#263e48","--ui-history-item-text":"#263e48","--ui-history-meta":"#58727c","--ui-success":"#247860","--ui-error":"#be3d50"},termHostBg:"#ffffff",keybar:{bg:"#e0ebee",border:"#d3e1e5",keyBg:"#ffffff",keyBorder:"#d3e1e5",keyText:"#58727c",accent:"#357b88",accentText:"#ffffff",drag:"#8a9ac5"},xterm:{background:"#ffffff",foreground:"#263e48",cursor:"#357b88",selectionBackground:"#d6dcf4",black:"#263e48",red:"#be3d50",green:"#247860",yellow:"#956018",blue:"#346faa",magenta:"#7456a6",cyan:"#277784",white:"#58727c",brightBlack:"#58727c",brightWhite:"#edf3f4"}}),gi({id:"pine",label:"暖灰松绿",swatch:"#f6f7f3",preview:["#f6f7f3","#356c55"],cssVars:{"--ui-color-scheme":"light","--ui-root-bg":"#f6f7f3","--ui-text":"#2d382f","--ui-tabbar-bg":"#e2e7df","--ui-tabbar-border":"#d9e1d6","--ui-tab-bg":"#e8ece5","--ui-tab-text":"#5b6e61","--ui-tab-active-bg":"#f6f7f3","--ui-tab-active-text":"#2d382f","--ui-tab-accent":"#356c55","--ui-connection-bg":"#e2e7df","--ui-connection-text":"#5b6e61","--ui-tree-bg":"#e8ece5","--ui-tree-border":"#d9e1d6","--ui-term-col-bg":"#f6f7f3","--ui-fab-bg":"#ffffff","--ui-fab-border":"#d9e1d6","--ui-muted-surface":"#e8ece5","--ui-muted-border":"#d9e1d6","--ui-muted-text":"#5b6e61","--ui-panel-input-bg":"#ffffff","--ui-panel-input-text":"#2d382f","--ui-panel-input-border":"#d9e1d6","--ui-drawer-tab-text":"#5b6e61","--ui-drawer-tab-active":"#2d382f","--ui-history-item-text":"#2d382f","--ui-history-meta":"#5b6e61","--ui-success":"#357450","--ui-error":"#b6454d"},termHostBg:"#ffffff",keybar:{bg:"#e2e7df",border:"#d9e1d6",keyBg:"#ffffff",keyBorder:"#d9e1d6",keyText:"#5b6e61",accent:"#356c55",accentText:"#ffffff",drag:"#86a38b"},xterm:{background:"#ffffff",foreground:"#2d382f",cursor:"#356c55",selectionBackground:"#d4e1d9",black:"#2d382f",red:"#b6454d",green:"#357450",yellow:"#8c641e",blue:"#3d7189",magenta:"#805e88",cyan:"#317c74",white:"#5b6e61",brightBlack:"#5b6e61",brightWhite:"#f6f7f3"}}),gi({id:"graphite",label:"石墨夜色",swatch:"#202630",preview:["#202630","#a4bad2"],cssVars:{"--ui-color-scheme":"dark","--ui-root-bg":"#202630","--ui-text":"#e4ebf4","--ui-tabbar-bg":"#161c25","--ui-tabbar-border":"#384859","--ui-tab-bg":"#161c25","--ui-tab-text":"#b0bfd3","--ui-tab-active-bg":"#202630","--ui-tab-active-text":"#e4ebf4","--ui-tab-accent":"color-mix(in srgb, #386a9a 40%, #ecf0f8)","--ui-connection-bg":"#161c25","--ui-connection-text":"#b0bfd3","--ui-tree-bg":"#161c25","--ui-tree-border":"#384859","--ui-term-col-bg":"#202630","--ui-fab-bg":"#293440","--ui-fab-border":"#384859","--ui-muted-surface":"#161c25","--ui-muted-border":"#384859","--ui-muted-text":"#b0bfd3","--ui-panel-input-bg":"#293440","--ui-panel-input-text":"#e4ebf4","--ui-panel-input-border":"#384859","--ui-drawer-tab-text":"#b0bfd3","--ui-drawer-tab-active":"#e4ebf4","--ui-history-item-text":"#e4ebf4","--ui-history-meta":"#b0bfd3","--ui-success":"#89d3af","--ui-error":"#f097a2"},termHostBg:"#202630",keybar:{bg:"#161c25",border:"#384859",keyBg:"#293440",keyBorder:"#384859",keyText:"#b0bfd3",accent:"#a4bad2",accentText:"#14212b",drag:"#61778c"},xterm:{background:"#202630",foreground:"#e4ebf4",cursor:"#a4bad2",selectionBackground:"#2a3e53",black:"#161c25",red:"#f097a2",green:"#89d3af",yellow:"#e5c58a",blue:"#9accf0",magenta:"#c4b3e1",cyan:"#91cfd6",white:"#e4ebf4",brightBlack:"#b0bfd3",brightWhite:"#ffffff"}})],XR="pearl",fl=Object.fromEntries(GR.map(t=>[t.id,t])),YR={dark:"noir",black:"noir",gray:"noir",blue:"noir",red:"noir",yellow:"noir",green:"noir",white:"pearl"};function KR(t){if(t&&t in fl)return fl[t];const e=t?YR[t]:void 0;return e?fl[e]:fl[XR]}const Z0={"customer-agent":"Customer Agent",codex:"Codex","claude-code":"Claude Code",opencode:"OpenCode","deepseek-harness":"DeepSeek Harness",qoder:"Qoder",zcode:"ZCode",workbuddy:"WorkBuddy",copilot:"VS Code Copilot",grok:"Grok CLI",agy:"Antigravity CLI"},ZR=[{prompt:"带我熟悉这个项目",Icon:u9},{prompt:"帮我排查一个问题",Icon:C9},{prompt:"一起实现一个新想法",Icon:m9}];function QR(t){return t>=5&&t<9?{title:"早啊。",prompt:"新的一天,想做点什么?"}:t>=9&&t<12?{title:"上午好。",prompt:"今天想一起做点什么?"}:t>=12&&t<14?{title:"中午好。",prompt:"想趁午休推进点什么?"}:t>=14&&t<18?{title:"下午好。",prompt:"这个下午,想做点什么?"}:t>=18&&t<23?{title:"晚上好。",prompt:"今晚想一起做点什么?"}:{title:"夜深了。",prompt:"注意休息,重要的事可以先留给我。"}}function qR({agentType:t,ready:e,connectionRequired:r=!1,now:o,onSelectPrompt:l}){const u=Z0[t],h=QR((o??new Date).getHours());return M.jsxs("section",{className:"empty-session-welcome","aria-labelledby":"empty-session-welcome-title",children:[M.jsxs("div",{className:"empty-session-welcome__core","aria-hidden":"true",children:[M.jsx("span",{className:"empty-session-welcome__glow"}),M.jsxs("svg",{viewBox:"0 0 120 120",role:"presentation",children:[M.jsx("circle",{className:"empty-session-welcome__orbit empty-session-welcome__orbit--outer",cx:"60",cy:"60",r:"44"}),M.jsx("circle",{className:"empty-session-welcome__orbit empty-session-welcome__orbit--inner",cx:"60",cy:"60",r:"33"}),M.jsx("rect",{className:"empty-session-welcome__diamond",x:"43",y:"43",width:"34",height:"34",rx:"2"}),M.jsx("circle",{className:"empty-session-welcome__pulse",cx:"60",cy:"60",r:"3"})]})]}),M.jsxs("div",{className:"empty-session-welcome__copy",children:[M.jsx("p",{className:"empty-session-welcome__status",children:r?`${u} · 等待连接`:e?`${u} · 已准备好`:`${u} · 等待配置`}),M.jsx("h2",{id:"empty-session-welcome-title",children:h.title}),M.jsx("p",{className:"empty-session-welcome__prompt",children:r?"扫码连接电脑后,就能开始。":e?h.prompt:"配置好 API Key 后,我就能开始。"})]}),M.jsx("div",{className:"empty-session-welcome__starters","aria-label":"开始一个任务",children:ZR.map(({prompt:x,Icon:w})=>M.jsxs("button",{type:"button","data-prompt":x,disabled:!e,onClick:()=>l(x),children:[M.jsx(w,{size:16,strokeWidth:1.8,"aria-hidden":"true"}),M.jsx("span",{children:x})]},x))})]})}const JR={copilot:{src:new URL(""+new URL("copilot-7BoBRmFo.png",import.meta.url).href,import.meta.url).href,viewBox:"0 0 256 256"},qoder:{src:new URL(""+new URL("qoder-CGHn7M84.png",import.meta.url).href,import.meta.url).href,viewBox:"14 14 100 100"},zcode:{src:new URL(""+new URL("zcode-CsXrmDtX.png",import.meta.url).href,import.meta.url).href,viewBox:"12 12 104 104"},workbuddy:{src:new URL(""+new URL("workbuddy-hEyEE8dU.png",import.meta.url).href,import.meta.url).href,viewBox:"13 13 102 102"}},e_={grok:new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMAAAADACAYAAABS3GwHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAApwSURBVHgB7Z0tl1RHF4UrWRkNEgVIFEgwYFGDBAMWA0jGgAQzWEaABQMSFBbMjASFBBQSfsFk7U6KdJr+qHP7ftS9+3nWypq8b5Jhes3ep06dOnXqj52dneMEYMqfCcAYDADWYACwBgOANRgArMEAYA0GAGswAFiDAcAaDADWYACwBgOANRgArMEAYA0GAGswAFiDAcAaDADWYACwBgOANRgArMEAYA0GAGswAFiDAcAaDADWYACwBgOANRgArMEAYA0GAGswAFiDAcAaDADWYACwBgOANRgArMEAYA0GAGswAFiDAcAaDADWYACwBgOANRgArMEAsDU3b95MYwUDwFY8fPgwffjwIY0VDACNuXv3bjo+Pk5fv35NY+WvBNCAW7dupd3d3XT16tU0ZjAAhJH49/f306VLl9LYwQAQ4sqVK+n58+fp/v37o059Mn/s7OwcJ4ACzp8/n969e5fevn2bbt++naYABoAisvh//vw5y/unEP0FKRBs5MyZMzPxnzx5Mu3t7U1G/IIVANaSxa+vnz59ShcvXkxTAgPASubFL86dOzep6C9IgXpCIrpw4UI6ffr07O9PnDjxS1jzSGDKs/VVEVd//fjxI/XNovgfPXo0OfELVoCOUL6sHhmVDS9fvjz7302R8N6/fz9rOdDXroW4KH79ear5D2HErsEALZJFrxNSCb8rZIKXL1+mFy9epLZZFL9QybOLP6sGMEALSCzqi5H4t4n0UfLK8Pjx41ZWhWXi1/dV7j9VMMAWSCgPHjyYtQYMjSL0NkaQcQ8PD3/bl0w5+gsM0ACJ5c6dO7Oo32fEL0GbVRkhgj6DIr8Ou+aZevQXGCBI7oVZVsGpBQm39LR2lfjF1KO/4D5AAF3+WMyRa0Q/n9IZlV038ezZs6XiF9pfTB3OAQpQlHz16lWnlZ22UKny4OAgPX36dGPZUivZtWvXlv4zRf4p1v0XwQAbWFYZqZGI8IXEv27zro5PBzDAGvoQ/3yU1elwdFMdFb5QKrepcjXme74RMMAK2ha/hK6oqtaGjx8/pm/fvq0UrHJy/blKufT3y1IvfT9Ve6KbVIlfpdt1KPef4qnvMjDAEtoSf25fiObTuQcopyHZDCq9qk+o6Slwifjzz+0CZdAF2hB/Pp2tSUil4hfXr19nD+DKNjX+GoUvIuIXSs9cwABzSChNSp3KlyV8bURrQ6fVEfEL7VFcIAX6F202j46OUpTIqWvfqNKjFS2C9hinTp1KLnAS/C+vX79OUd68eTPrk5+K+IVL9SdDCpT+SX2ieb+qMLWOBtFq1kT8jtivALmlOULt4lcVC8qwN0BU/Krw1C7+2lq0a8baAIr+kcssyvVrFb8+i/YxiD+GtQGi0b/Wak+bbRu1N/21ja0BotG/1rEgXTTsOa0itgaIpj7Ra4Z90FW3qrpSXbA1QORdKyfxi1U3xKaIpQHU7lAqHFV9arsXm+/xbvoMamlo0pfktA+wNMCYo3+J+HN7hk6p9VWTHSL9PU4rgGUv0OfPn4uiXG1jQdZNcMgo4t+4ceO3lgZ9Xn3uEmSWKTx/VILdCiAhlC7xtUX/dRMchCpVivjL+nnyFLkSNE3CpRJkZwANqi2lpr7+dRMccsqzybCRSy4u+wA7A5T2+/cxhbmUdRMcdHVS4i8xa2QzHwkUY8YyBSqhliuB6yY46AKOXmwpNWp+d6AEl42wnQFKf7GKrEOz6iqjcnz1JOmp0iilxnYxgNV9gMjcnaENsEr8295AK/3vzp49mxywWgFKZmUKlQGHvBm1SvzK4be9gVY68KrJkK4xYmWA0h4X5cpDsUr8SneU9mxrzMh/79AThAGWMFT1Z9kEB/0s2ui2NXEi8tlYASZG6S90CAOo0vPkyZP//X8qbSrlGWo/wgowMWr9hS6b4LDuVHdb3CY/rIOpEAOzOMFB4lQvT5en0Fyb/A8rA9R2o2txgoNSHc3ldHiYohYYjLWEPiLk4gSH6KluUyJp4JDVsL6wWgFKf6Fd7xXmJzgo5dnb2+vt0k3kgMthr2BlgNKpx122AcxfZRxirmjE3A6pmFUK9OXLl6J/r6s2gHnxt3Gq24TSLk+XfYiVAZQClSzripKlbROlzIu/rVPdJpR+LgwwUUoPldrsh8/iF22e6jah9HPV0A3bBxhgBbu7u6kN8j1eRdQhT3WFLgOVVrhc3gmzM0DpLzYillVk8Svf7+pUN0JkGgYrwESJRDa9ytiU/Lq88v1aLteXXgfVasUeYKJoI1xqgsj4xEVkHm10a0kllNJFhoG5YHkSXHotML/PG0XnCIr6NUVRtVqXoneIXbAcjKUy5/fv34v+3dqGYzVBJi59NWYKnzeC5QoQSYO0CkSiZ41E3gtzSn+EbTNcpPemySN6taDKT+Rnr3ESdpfYGiAy90cp0xhfXZTwZd5SahoG1he2BoikQUJ59P7+fhoTMi3Rfz3W9wGihz337t0Lvys2FIr8kQqWgoFb/i+sDdBkuY8KawhWjVZZR62vX3aNtQGatCaoka3mSKnDuyYPf7tew+RKZABNamgyj7MvVK6NbtZrfQCwLzBAIRJ/zUJR2rM4V6iE2k6s+8Z6LEpphaRm8eszKOo32Zco9antAcC+sTZAye0obQ5rFUkepdikbVtRX5fx3bE2wLrL731Pa4igaC/hN61G6bPVcD+hBmwNsO6t4CyQppdCFJHVDq0pFG2drup7yrDbCD+jyXMM3/oHWwOsuh0lYWg6WxPxZ+ErNZlPS2QCtRjre0be69X3UB+/7vHqaxsDu2q6o1ADlu3QivyHh4e/CarpnJ5Vwl+GVhcZIb/Xtew93xzt227Aq3k/MxSWK4AOi9oQvwSqlCRyc0x/bt8nyTXvZ4bGbgVYFv2j4peAlUJtc2WyL7ZJ6RywWwEWy4b5nd2SiojSEh021d4LlGHa9GasToIXo7Y2g5FyYOSd3aHpa9r02LFJgeZHEwrlw007IFWR0UpQ4y0xRX31K1HpKcPGAEdHR78OvhQd22hqy52XNRhBq5jaNYYcuzhGLAww3x/fdl+PxK8VQSXQIYwg4R8cHMyEz8lunMkbQMLMXZJdN7VpRdA+o49NslIc3WvWARvCb86kDTA/D0cpT1/pQV4V9FebZpDo9dK76/XFLpisAebr/UOegOZTXbUz5NPdki5UVW/UNpH7iSR8In37TNIAueKjcSZdPznaFBlDP1/eN0jc+Q0zSpf9MTkDzIt/m45O8GBSJ8GKqnp9UQzx/haMj0mdBGsef478iB9KmIwB8sks4ocIkzBAHlaF+CHK6PcAOuhSvZ07rtCEUa8AivqqrSN+aMpoV4D8fJHrTEtoh9GuABK/ensAtsHyUjxAhtmgYA0GAGswAFiDAcAaDADWYACwBgOANRgArMEAYA0GAGswAFiDAcAaDADWYACwBgOANRgArMEAYA0GAGswAFiDAcAaDADWYACwBgOANRgArMEAYA0GAGswAFiDAcAaDADWYACwBgOANRgArMEAYA0GAGswAFiDAcAaDADWYACwBgOANRgArMEAYA0GAGswAFiDAcAaDADW/A0CciUlJNyrrgAAAABJRU5ErkJggg==",import.meta.url).href,agy:new URL(""+new URL("agy-DixLPvyv.png",import.meta.url).href,import.meta.url).href},t_="m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z",r_="M75.91 73.628V62.232c0-.96.36-1.68 1.199-2.16l22.912-13.194c3.119-1.8 6.838-2.639 10.676-2.639 14.394 0 23.511 11.157 23.511 23.032 0 .839 0 1.799-.12 2.758l-23.752-13.914c-1.439-.84-2.879-.84-4.318 0L75.91 73.627Zm53.499 44.383v-27.23c0-1.68-.72-2.88-2.159-3.719L97.142 69.55l9.836-5.638c.839-.48 1.559-.48 2.399 0l22.912 13.195c6.598 3.839 11.035 11.995 11.035 19.912 0 9.116-5.397 17.513-13.915 20.992v.001Zm-60.577-23.99-9.836-5.758c-.84-.48-1.2-1.2-1.2-2.16v-26.39c0-12.834 9.837-22.55 23.152-22.55 5.039 0 9.716 1.679 13.676 4.678L70.993 55.516c-1.44.84-2.16 2.039-2.16 3.719v34.787-.002Zm21.173 12.234L75.91 98.339V81.546l14.095-7.917 14.094 7.917v16.793l-14.094 7.916Zm9.056 36.467c-5.038 0-9.716-1.68-13.675-4.678l23.631-13.676c1.439-.839 2.159-2.038 2.159-3.718V85.863l9.956 5.757c.84.48 1.2 1.2 1.2 2.16v26.389c0 12.835-9.957 22.552-23.27 22.552v.001Zm-28.43-26.75L47.72 102.778c-6.599-3.84-11.036-11.996-11.036-19.913 0-9.236 5.518-17.513 14.034-20.992v27.35c0 1.68.72 2.879 2.16 3.718l29.989 17.393-9.837 5.638c-.84.48-1.56.48-2.399 0Zm-1.318 19.673c-13.555 0-23.512-10.196-23.512-22.792 0-.959.12-1.919.24-2.879l23.63 13.675c1.44.84 2.88.84 4.32 0l30.108-17.392v11.395c0 .96-.361 1.68-1.2 2.16l-22.912 13.194c-3.119 1.8-6.837 2.639-10.675 2.639Zm29.748 14.274c14.515 0 26.63-10.316 29.39-23.991 13.434-3.479 22.071-16.074 22.071-28.91 0-8.396-3.598-16.553-10.076-22.43.6-2.52.96-5.039.96-7.557 0-17.153-13.915-29.99-29.989-29.99-3.239 0-6.358.48-9.477 1.56-5.398-5.278-12.835-8.637-20.992-8.637-14.515 0-26.63 10.316-29.39 23.991-13.434 3.48-22.07 16.074-22.07 28.91 0 8.396 3.598 16.553 10.075 22.431-.6 2.519-.96 5.038-.96 7.556 0 17.154 13.915 29.989 29.99 29.989 3.238 0 6.357-.479 9.476-1.559 5.397 5.278 12.835 8.637 20.992 8.637Z";function n_({agentType:t,size:e=16,className:r}){const o=e_[t];if(o)return M.jsx("img",{className:r,"data-agent-icon":t,width:e,height:e,src:o,alt:""});const l=JR[t];return l?M.jsx("svg",{className:r,"data-agent-icon":t,width:e,height:e,viewBox:l.viewBox,"aria-hidden":"true",children:M.jsx("image",{href:l.src,width:t==="copilot"?256:128,height:t==="copilot"?256:128})}):t==="customer-agent"?M.jsxs("svg",{className:r,"data-agent-icon":t,width:e,height:e,viewBox:"50 48 180 180",fill:"none","aria-hidden":"true",children:[M.jsx("path",{d:"M76 187V90Q76 74 92 74H188Q204 74 204 90V187",stroke:"currentColor",strokeWidth:"18",strokeLinecap:"round"}),M.jsx("path",{d:"m108 116 26 24-26 24m47 0h22M100 207h80",stroke:"currentColor",strokeWidth:"14",strokeLinecap:"round",strokeLinejoin:"round"}),M.jsx("circle",{cx:"204",cy:"207",r:"11",fill:"currentColor"})]}):t==="codex"?M.jsx("svg",{className:r,"data-agent-icon":t,width:e,height:e,viewBox:"29.487 29.964 121.035 119.954","aria-hidden":"true",children:M.jsx("path",{fill:"currentColor",d:r_})}):t==="claude-code"?M.jsx("svg",{className:r,"data-agent-icon":t,width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:M.jsx("path",{fill:"currentColor",d:t_})}):t==="deepseek-harness"?M.jsx("svg",{className:r,"data-agent-icon":t,width:e,height:e,viewBox:"0 0 50 50","aria-hidden":"true",children:M.jsx("path",{fill:"currentColor",d:"M48.8354 10.0479C48.3232 9.79199 48.1025 10.2798 47.8032 10.5278C47.7007 10.6079 47.6143 10.7119 47.5273 10.8076C46.7793 11.624 45.9048 12.1597 44.7622 12.0957C43.0923 12 41.666 12.5356 40.4058 13.8398C40.1377 12.2319 39.2476 11.272 37.8926 10.6558C37.1836 10.3359 36.4668 10.0156 35.9702 9.31982C35.6235 8.82373 35.5293 8.27197 35.356 7.72754C35.2456 7.3999 35.1353 7.06396 34.7651 7.00781C34.3633 6.94385 34.2056 7.2876 34.0479 7.57568C33.418 8.75195 33.1733 10.0479 33.1973 11.3599C33.2524 14.312 34.4736 16.6641 36.8999 18.3359C37.1758 18.5278 37.2466 18.7197 37.1597 19C36.9946 19.5757 36.7974 20.1357 36.624 20.7119C36.5137 21.0801 36.3486 21.1597 35.9624 21C34.6309 20.4321 33.481 19.5918 32.4644 18.5757C30.7393 16.8721 29.1792 14.9917 27.2334 13.52C26.7764 13.1758 26.3193 12.856 25.8467 12.5518C23.8618 10.584 26.1069 8.96777 26.627 8.77588C27.1704 8.57568 26.8159 7.8877 25.0591 7.896C23.3022 7.90381 21.6953 8.50391 19.647 9.30371C19.3477 9.42383 19.0322 9.51172 18.7095 9.58398C16.8501 9.22363 14.9199 9.14355 12.9033 9.37598C9.10596 9.80762 6.07275 11.6396 3.84326 14.7681C1.16455 18.5278 0.53418 22.7998 1.30664 27.2559C2.11768 31.9521 4.46582 35.8398 8.07373 38.8799C11.8159 42.0322 16.1255 43.5762 21.041 43.2803C24.0269 43.104 27.3516 42.6963 31.1016 39.4561C32.0469 39.936 33.0396 40.1279 34.686 40.272C35.9546 40.3921 37.1758 40.208 38.1211 40.0078C39.6021 39.688 39.4995 38.2881 38.9639 38.0322C34.623 35.9678 35.5762 36.8081 34.71 36.1279C36.9155 33.4639 40.2402 30.6958 41.54 21.728C41.6426 21.0161 41.5557 20.5679 41.54 19.9917C41.5322 19.6396 41.6108 19.5039 42.0049 19.4639C43.0923 19.3359 44.1479 19.0317 45.1167 18.4878C47.9292 16.9199 49.064 14.3438 49.3315 11.2559C49.3711 10.7837 49.3237 10.2959 48.8354 10.0479ZM24.3262 37.8398C20.1196 34.4639 18.0791 33.3521 17.2358 33.3999C16.4482 33.4482 16.5898 34.3682 16.7632 34.9678C16.9443 35.5601 17.1812 35.9683 17.5117 36.4878C17.7402 36.832 17.8979 37.3442 17.2832 37.728C15.9282 38.584 13.5728 37.4399 13.4624 37.3838C10.7207 35.7358 8.42822 33.5601 6.81348 30.584C5.25342 27.7197 4.34766 24.6479 4.19775 21.3677C4.1582 20.5757 4.38672 20.2959 5.15869 20.1519C6.17529 19.96 7.22314 19.9199 8.23926 20.0718C12.5327 20.7119 16.1885 22.6719 19.2529 25.7759C21.002 27.5439 22.3252 29.6558 23.6885 31.7202C25.1377 33.9121 26.6978 36 28.6831 37.7119C29.3843 38.312 29.9434 38.7681 30.479 39.104C28.8643 39.2881 26.1699 39.3281 24.3262 37.8398ZM26.3433 24.6001C26.3433 24.248 26.6191 23.9678 26.9658 23.9678C27.0444 23.9678 27.1152 23.9839 27.1782 24.0078C27.2651 24.04 27.3438 24.0879 27.4067 24.1602C27.5171 24.272 27.5801 24.4321 27.5801 24.6001C27.5801 24.9521 27.3042 25.2319 26.9575 25.2319C26.6108 25.2319 26.3433 24.9521 26.3433 24.6001ZM32.6064 27.8799C32.2046 28.0479 31.8027 28.1919 31.4165 28.208C30.8179 28.2397 30.1641 27.9922 29.8096 27.688C29.2583 27.2158 28.8643 26.9521 28.6987 26.1279C28.6279 25.7759 28.6675 25.2319 28.7305 24.9199C28.8721 24.248 28.7144 23.8159 28.2495 23.4238C27.8716 23.104 27.3911 23.0161 26.8633 23.0161C26.666 23.0161 26.4849 22.9277 26.3511 22.856C26.1304 22.7441 25.9492 22.4639 26.1226 22.1201C26.1777 22.0078 26.4458 21.7358 26.5088 21.688C27.2256 21.272 28.0527 21.4077 28.8169 21.7197C29.5259 22.0161 30.0615 22.5601 30.834 23.3281C31.6216 24.2559 31.7632 24.5117 32.2124 25.208C32.5669 25.752 32.8901 26.312 33.1104 26.9521C33.2446 27.3521 33.0713 27.6802 32.6064 27.8799Z"})}):M.jsx("svg",{className:r,"data-agent-icon":t,width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:M.jsx("path",{fill:"currentColor",d:"M22 24H2V0h20zM17 4.8H7v14.4h10z",fillRule:"evenodd"})})}function i_(t){const e=new Set(t.filter(r=>r.available).map(r=>r.agentType));return Y0.filter(r=>e.has(r)||r==="customer-agent"&&!t.some(o=>o.agentType===r))}function tO(t,e){const r=e.find(l=>l.agentType===t);if(r!=null&&r.available||t==="customer-agent"&&!r)return;const o=Z0[t];return r?/not installed|not found|ENOENT|未安装|找不到/i.test(r.error??"")?`远程未安装 ${o}`:`远程 ${o} 暂不可用`:`正在检查远程 ${o},请稍后重试`}function s_({value:t,health:e,onChange:r,vertical:o=!1,onPreview:l}){const u=ie.useRef(null),[h,x]=ie.useState(!1);return ie.useEffect(()=>{if(o)return;const w=u.current,m=()=>{const b=w==null?void 0:w.querySelector('[aria-selected="true"]');if(!w||!b)return;const C=b.offsetLeft;C<w.scrollLeft?w.scrollTo({left:C,behavior:"smooth"}):C+b.offsetWidth>w.scrollLeft+w.clientWidth&&w.scrollTo({left:C+b.offsetWidth-w.clientWidth,behavior:"smooth"})};m();const y=typeof ResizeObserver>"u"?null:new ResizeObserver(m);return w&&(y==null||y.observe(w)),()=>y==null?void 0:y.disconnect()},[t,o]),M.jsxs("div",{className:`agent-workspace-switcher${o?" is-vertical":""}`,children:[M.jsx("div",{ref:u,className:"agent-workspace-track",role:"tablist","aria-label":"切换 Agent","aria-orientation":o?"vertical":"horizontal",onScroll:w=>x(w.currentTarget.scrollLeft>1),children:i_(e).map(w=>{const m=Z0[w];return M.jsx("button",{type:"button",role:"tab","aria-selected":t===w,"aria-label":m,title:m,className:t===w?"is-active":void 0,onPointerEnter:y=>l==null?void 0:l(w,m,y.currentTarget.getBoundingClientRect()),onFocus:y=>l==null?void 0:l(w,m,y.currentTarget.getBoundingClientRect()),onClick:()=>r(w),children:M.jsx(n_,{agentType:w,size:22})},w)})}),M.jsx("button",{type:"button",className:"agent-workspace-more","aria-label":h?"前面的 Agent":"更多 Agent",title:`${h?"前面的 Agent":"更多 Agent"} · 手机可左右滑动`,onClick:()=>{const w=u.current;if(!w)return;const m=w.scrollWidth-w.clientWidth;w.scrollTo({left:h?0:m,behavior:"smooth"})},children:h?M.jsx(h9,{size:20,strokeWidth:1.8,"aria-hidden":"true"}):M.jsx(g9,{size:20,strokeWidth:1.8,"aria-hidden":"true"})})]})}const py="https://registry.npmjs.org/agentroam",p2=`${py}/latest`,o_=`${py}/preview`,Q0="https://github.com/tclxqu-cao/team-agent",a_="main",l_=`${Q0}/raw/${a_}`,c_=`${l_}/packages/cli/install`,u_=`${Q0}/releases/download`,f_={"darwin-arm64":"install-agentroam.sh","windows-amd64":"install-agentroam.ps1"};function cn(t){const e=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-preview\.(0|[1-9]\d*))?$/.exec(t);return e?{core:[BigInt(e[1]),BigInt(e[2]),BigInt(e[3])],preview:e[4]===void 0?null:BigInt(e[4])}:null}function d_(t){if(typeof t!="string")return null;const e=cn(t);return e&&e.preview===null?t:null}function h_(t){return t==="preview"?[p2,o_]:[p2]}function g_(t,e){const r=d_(t);return r||(typeof t!="string"?null:cn(t)?t:null)}function Ii(t,e){const r=cn(t),o=cn(e);if(!r||!o)throw new Error("invalid AgentRoam version");for(let l=0;l<r.core.length;l+=1)if(r.core[l]!==o.core[l])return r.core[l]>o.core[l]?1:-1;return r.preview===o.preview?0:r.preview===null?1:o.preview===null?-1:r.preview>o.preview?1:-1}function p_(){return`${c_}/install-manifest.json`}function m_(t,e){const r=f_[e];if(!r)throw new Error("CLI install manifest does not support this platform");if(!Df(t)||t.schemaVersion!==1||!Df(t.installers))throw new Error("invalid CLI install manifest identity");const o=t.installers[e];if(!Df(o)||o.fileName!==r||typeof o.sha256!="string"||!/^[a-f0-9]{64}$/.test(o.sha256))throw new Error("invalid CLI installer metadata");if(o.size!==void 0&&(!Number.isSafeInteger(o.size)||o.size<=0))throw new Error("invalid CLI installer size");return{fileName:r,sha256:o.sha256,...o.size===void 0?{}:{size:o.size}}}function Df(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}const ed=new Set(["downloading","installing","reconnecting"]),x_=new Set(["checking",...ed]),m2=new Set(["available","failed"]),Pf=new Set(["available","failed","complete"]),my=ie.createContext(null);function w_({iconOnly:t=!1,className:e=t?"file-drawer-toggle":""}){const r=ie.useContext(my);if(!r)return null;const o=r.checking?"正在检查更新":r.available?"有可用更新,检查更新":"检查更新",l=r.checking?x9:ty;return M.jsxs("button",{type:"button",className:`update-check-button ${e}`.trim(),"data-pairing-action":!0,"data-update-available":r.available||void 0,title:o,"aria-label":o,"aria-busy":r.checking,disabled:r.disabled,onClick:r.check,children:[M.jsx(l,{size:16,"aria-hidden":"true"}),!t&&(r.available&&!r.checking?"有新版本":o)]})}function x2({api:t,product:e="AgentRoam",scope:r="desktop",hint:o="安装后将重新打开应用",installLabel:l="安装更新",enabled:u=!0,children:h}){const x=`agentroam.dismissed-update.${r}`,[w,m]=ie.useState(null),[y,b]=ie.useState(()=>typeof window>"u"?null:sessionStorage.getItem(x)),[C,T]=ie.useState(null),[k,D]=ie.useState(null),[X,O]=ie.useState(!1),[I,_]=ie.useState(!1),L=ie.useCallback(re=>{O(re.phase==="checking"),m(z=>re.phase==="checking"&&(z!=null&&z.targetVersion)&&Pf.has(z.phase)&&(!re.targetVersion||z.targetVersion===re.targetVersion)?z:r==="cli"&&(z!=null&&z.targetVersion)&&(ed.has(z.phase)||z.phase==="complete")&&["idle","checking","up-to-date"].includes(re.phase)?cn(re.currentVersion)&&cn(z.targetVersion)&&Ii(re.currentVersion,z.targetVersion)>=0?{phase:"complete",currentVersion:re.currentVersion,targetVersion:z.targetVersion,message:`电脑已更新到 ${re.currentVersion}。`}:z:re)},[r]);ie.useEffect(()=>{var fe;if(!u)return;let re=!0,z=0;const De=(fe=t.onUpdateStatus)==null?void 0:fe.call(t,he=>{z++,L(he)}),pe=()=>{const he=++z;t.getUpdateStatus().then(Pe=>{re&&z===he&&L(Pe)}).catch(()=>{})};pe();const ne=()=>{document.visibilityState==="visible"&&pe()};return document.addEventListener("visibilitychange",ne),()=>{re=!1,document.removeEventListener("visibilitychange",ne),De==null||De()}},[t,u,L]);const j=ie.useCallback(re=>{if(L(re),T(null),re.targetVersion&&Pf.has(re.phase)){b(null);return}re.phase==="up-to-date"?D(re.message??`当前已是最新版本 ${re.currentVersion}。`):(re.phase==="unavailable"||re.phase==="idle"||re.phase==="failed")&&D(re.message??"当前无法检查更新。")},[L]);ie.useEffect(()=>{const re=C==="waiting",z=re||w&&x_.has(w.phase);if(!u||!z&&r!=="cli"||C==="requesting")return;let De=!0,pe;const ne=Date.now()+15e3,fe=z?1500:3e4,he=async()=>{try{if(z||document.visibilityState==="visible"){const Pe=await t.getUpdateStatus();if(!De)return;if(re&&Pe.phase!=="checking")return j(Pe);L(Pe)}}catch{}if(De){if(re&&Date.now()>=ne){T(null),D("检查更新超时,请稍后重试。");return}pe=window.setTimeout(he,fe)}};return pe=window.setTimeout(he,fe),()=>{De=!1,window.clearTimeout(pe)}},[t,u,j,C,L,r,w==null?void 0:w.phase]);const U=async()=>{D(null),T("requesting");try{const re=await t.checkForUpdate();re.phase==="checking"?(L(re),T("waiting")):j(re)}catch{T(null),D("检查更新失败,请稍后重试。")}},F=re=>{sessionStorage.setItem(x,re),b(re)},Y=()=>{if(k){D(null);return}w!=null&&w.targetVersion&&F(w.targetVersion)},$=async()=>{if(!(!w||I)){_(!0);try{const re=await t.installUpdate();L(re),re.phase==="available"&&re.targetVersion&&F(re.targetVersion)}catch(re){L({...w,phase:"failed",message:re instanceof Error?re.message:"更新失败"})}finally{_(!1)}}},se=w&&ed.has(w.phase),ve=!!(w!=null&&w.targetVersion&&m2.has(w.phase)),Q=w!=null&&w.targetVersion&&Pf.has(w.phase)&&w.targetVersion!==y?w:null,xe=!k&&Q&&m2.has(Q.phase);return M.jsxs(my.Provider,{value:u?{checking:C!==null,disabled:C!==null||!!se||I,available:ve,check:()=>void U()}:null,children:[h,u&&se&&w&&M.jsx("aside",{className:"update-notice",role:"status",children:w.message??(w.phase==="downloading"?`正在下载${w.progress===void 0?"":` ${w.progress}%`}`:w.phase==="installing"?"正在安装":"正在重连")}),u&&(k||Q)&&M.jsx(v_,{title:k?"检查更新":(Q==null?void 0:Q.phase)==="failed"?"更新失败":(Q==null?void 0:Q.phase)==="complete"?"更新已就绪":`发现 ${e} 新版本`,message:k??((Q==null?void 0:Q.phase)==="available"?`${Q.currentVersion} → ${Q.targetVersion}`:Q==null?void 0:Q.message),detail:!k&&(Q==null?void 0:Q.phase)==="available"?Q.message:void 0,hint:!k&&(Q==null?void 0:Q.phase)==="available"?o:void 0,onDismiss:Y,dismissLabel:!k&&(Q==null?void 0:Q.phase)==="available"?"稍后":"关闭",action:xe&&M.jsxs("button",{type:"button",className:"update-dialog__primary",disabled:I||X||C!==null,onClick:()=>void $(),children:[M.jsx(ty,{size:16,"aria-hidden":"true"}),Q.phase==="failed"?"重试更新":l]})})]})}function v_({title:t,message:e,detail:r,hint:o,action:l,onDismiss:u,dismissLabel:h}){const x=ie.useRef(null),w=ie.useId(),m=typeof HTMLDialogElement<"u"&&typeof HTMLDialogElement.prototype.showModal=="function";return ie.useEffect(()=>{if(!m)return;const y=x.current;return y==null||y.showModal(),()=>{y!=null&&y.open&&y.close()}},[m]),na.createPortal(M.jsxs(M.Fragment,{children:[!m&&M.jsx("div",{className:"update-dialog-fallback-backdrop","aria-hidden":"true"}),M.jsxs("dialog",{ref:x,className:"update-dialog",open:!m,"aria-labelledby":w,role:"dialog","aria-modal":"true",onCancel:y=>{y.preventDefault(),u()},onKeyDown:y=>{!m&&y.key==="Escape"&&u()},children:[M.jsx("h2",{id:w,children:t}),e&&M.jsx("p",{children:e}),r&&M.jsx("p",{children:r}),o&&M.jsx("p",{children:o}),M.jsxs("div",{className:"update-dialog__actions",children:[M.jsx("button",{type:"button",autoFocus:!0,onClick:u,children:h}),l]})]})]}),document.body)}const y_="请点击扫码按钮扫码",E_=[["刷新页面",ry],["打开群聊看板",b9],["打开远程桌面",v9],["打开 AI Hub",p9],["打开数字人",ey],["皮肤",y9],["打开我的文件",E9]];function A_({onScan:t,initialFailure:e=""}){const[r,o]=ie.useState(!1),[l,u]=ie.useState(e),[h,x]=ie.useState(!1),w=ie.useRef();ie.useEffect(()=>{const T=setTimeout(()=>x(!0),650);return()=>{clearTimeout(T),clearTimeout(w.current)}},[]);const m=()=>{u(y_),clearTimeout(w.current),w.current=setTimeout(()=>u(""),3e3)},y=T=>{T.target.closest("[data-pairing-action]")||(T.preventDefault(),T.stopPropagation(),m())},b=async()=>{if(!r){clearTimeout(w.current),o(!0),u("");try{await t()}catch(T){u(T instanceof Error?T.message:"扫码连接失败,请重试。")}finally{o(!1)}}},C=KR("pearl");return M.jsxs("div",{className:"web-root unpaired-home",style:C.cssVars,onClickCapture:y,onKeyDownCapture:T=>{(T.key==="Enter"||T.key===" ")&&y(T)},children:[M.jsx("style",{dangerouslySetInnerHTML:{__html:HR}}),M.jsxs("div",{className:"terminal-tabs",children:[M.jsx("div",{className:"terminal-tab-list",children:M.jsx("div",{className:"terminal-tab active",role:"tab","aria-disabled":"true",children:M.jsx("span",{children:"智能助手"})})}),M.jsx("button",{type:"button",className:"terminal-add","aria-label":"新建终端页签","aria-disabled":"true",children:"+"}),M.jsxs("div",{className:"terminal-connection",children:[M.jsx(w_,{}),M.jsx(zR,{items:E_.map(([T,k])=>({id:T,content:M.jsx("button",{type:"button",className:"file-drawer-toggle","aria-label":T,"aria-disabled":"true",children:M.jsx(k,{size:17})})})),avatar:M.jsxs("button",{type:"button","data-pairing-action":!0,className:"unpaired-scan","aria-label":"扫码连接电脑",title:"扫码连接电脑",disabled:r,onClick:()=>void b(),children:[M.jsx(f9,{size:19}),M.jsx("span",{children:r?"连接中":"扫码"})]})})]})]}),M.jsxs("main",{className:"unpaired-workspace","aria-label":"尚未连接电脑的工作区",children:[M.jsxs("header",{className:"unpaired-workspace-header",children:[M.jsx("button",{type:"button",className:"ui-icon-button","aria-label":"会话列表","aria-disabled":"true",children:M.jsx(w9,{size:18})}),M.jsx("span",{children:"智能助手"}),M.jsx("button",{type:"button",className:"ui-icon-button","aria-label":"返回","aria-disabled":"true",children:M.jsx(d9,{size:17})})]}),M.jsx("div",{className:"unpaired-agent-switcher",children:M.jsx(s_,{value:"codex",health:[],onChange:m})}),M.jsx("div",{className:"unpaired-welcome",children:M.jsx(qR,{agentType:"codex",ready:!0,connectionRequired:!0,onSelectPrompt:m})}),M.jsxs("div",{className:"unpaired-composer",children:[M.jsx("span",{children:"发送消息…"}),M.jsxs("div",{children:[M.jsx("button",{type:"button",className:"ui-icon-button","aria-label":"添加附件","aria-disabled":"true",children:M.jsx(A9,{size:19})}),M.jsx("button",{type:"button",className:"ui-icon-button","aria-label":"发送消息","aria-disabled":"true",children:M.jsx(c9,{size:19})})]})]})]}),l&&M.jsx("p",{className:"unpaired-notice",role:"alert",children:l}),M.jsx(K0,{ready:h})]})}/*! Capacitor: https://capacitorjs.com/ - MIT License */var Ds;(function(t){t.Unimplemented="UNIMPLEMENTED",t.Unavailable="UNAVAILABLE"})(Ds||(Ds={}));class Lf extends Error{constructor(e,r,o){super(e),this.message=e,this.code=r,this.data=o}}const b_=t=>{var e,r;return t!=null&&t.androidBridge?"android":!((r=(e=t==null?void 0:t.webkit)===null||e===void 0?void 0:e.messageHandlers)===null||r===void 0)&&r.bridge?"ios":"web"},C_=t=>{const e=t.CapacitorCustomPlatform||null,r=t.Capacitor||{},o=r.Plugins=r.Plugins||{},l=()=>e!==null?e.name:b_(t),u=()=>l()!=="web",h=b=>{const C=m.get(b);return!!(C!=null&&C.platforms.has(l())||x(b))},x=b=>{var C;return(C=r.PluginHeaders)===null||C===void 0?void 0:C.find(T=>T.name===b)},w=b=>t.console.error(b),m=new Map,y=(b,C={})=>{const T=m.get(b);if(T)return console.warn(`Capacitor plugin "${b}" already registered. Cannot register plugins twice.`),T.proxy;const k=l(),D=x(b);let X;const O=async()=>(!X&&k in C?X=typeof C[k]=="function"?X=await C[k]():X=C[k]:e!==null&&!X&&"web"in C&&(X=typeof C.web=="function"?X=await C.web():X=C.web),X),I=(Y,$)=>{var se,ve;if(D){const Q=D==null?void 0:D.methods.find(xe=>$===xe.name);if(Q)return Q.rtype==="promise"?xe=>r.nativePromise(b,$.toString(),xe):(xe,re)=>r.nativeCallback(b,$.toString(),xe,re);if(Y)return(se=Y[$])===null||se===void 0?void 0:se.bind(Y)}else{if(Y)return(ve=Y[$])===null||ve===void 0?void 0:ve.bind(Y);throw new Lf(`"${b}" plugin is not implemented on ${k}`,Ds.Unimplemented)}},_=Y=>{let $;const se=(...ve)=>{const Q=O().then(xe=>{const re=I(xe,Y);if(re){const z=re(...ve);return $=z==null?void 0:z.remove,z}else throw new Lf(`"${b}.${Y}()" is not implemented on ${k}`,Ds.Unimplemented)});return Y==="addListener"&&(Q.remove=async()=>$()),Q};return se.toString=()=>`${Y.toString()}() { [capacitor code] }`,Object.defineProperty(se,"name",{value:Y,writable:!1,configurable:!1}),se},L=_("addListener"),j=_("removeListener"),U=(Y,$)=>{const se=L({eventName:Y},$),ve=async()=>{const xe=await se;j({eventName:Y,callbackId:xe},$)},Q=new Promise(xe=>se.then(()=>xe({remove:ve})));return Q.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await ve()},Q},F=new Proxy({},{get(Y,$){switch($){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return D?U:L;case"removeListener":return j;default:return _($)}}});return o[b]=F,m.set(b,{name:b,proxy:F,platforms:new Set([...Object.keys(C),...D?[k]:[]])}),F};return r.convertFileSrc||(r.convertFileSrc=b=>b),r.getPlatform=l,r.handleError=w,r.isNativePlatform=u,r.isPluginAvailable=h,r.registerPlugin=y,r.Exception=Lf,r.DEBUG=!!r.DEBUG,r.isLoggingEnabled=!!r.isLoggingEnabled,r},S_=t=>t.Capacitor=C_(t),Di=S_(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),Ui=Di.registerPlugin;class xy{constructor(){this.listeners={},this.retainedEventArguments={},this.windowListeners={}}addListener(e,r){let o=!1;this.listeners[e]||(this.listeners[e]=[],o=!0),this.listeners[e].push(r);const u=this.windowListeners[e];u&&!u.registered&&this.addWindowListener(u),o&&this.sendRetainedArgumentsForEvent(e);const h=async()=>this.removeListener(e,r);return Promise.resolve({remove:h})}async removeAllListeners(){this.listeners={};for(const e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}}notifyListeners(e,r,o){const l=this.listeners[e];if(!l){if(o){let u=this.retainedEventArguments[e];u||(u=[]),u.push(r),this.retainedEventArguments[e]=u}return}l.forEach(u=>u(r))}hasListeners(e){var r;return!!(!((r=this.listeners[e])===null||r===void 0)&&r.length)}registerWindowListener(e,r){this.windowListeners[r]={registered:!1,windowEventName:e,pluginEventName:r,handler:o=>{this.notifyListeners(r,o)}}}unimplemented(e="not implemented"){return new Di.Exception(e,Ds.Unimplemented)}unavailable(e="not available"){return new Di.Exception(e,Ds.Unavailable)}async removeListener(e,r){const o=this.listeners[e];if(!o)return;const l=o.indexOf(r);this.listeners[e].splice(l,1),this.listeners[e].length||this.removeWindowListener(this.windowListeners[e])}addWindowListener(e){window.addEventListener(e.windowEventName,e.handler),e.registered=!0}removeWindowListener(e){e&&(window.removeEventListener(e.windowEventName,e.handler),e.registered=!1)}sendRetainedArgumentsForEvent(e){const r=this.retainedEventArguments[e];r&&(delete this.retainedEventArguments[e],r.forEach(o=>{this.notifyListeners(e,o)}))}}const w2=t=>encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),v2=t=>t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class I_ extends xy{async getCookies(){const e=document.cookie,r={};return e.split(";").forEach(o=>{if(o.length<=0)return;let[l,u]=o.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");l=v2(l).trim(),u=v2(u).trim(),r[l]=u}),r}async setCookie(e){try{const r=w2(e.key),o=w2(e.value),l=e.expires?`; expires=${e.expires.replace("expires=","")}`:"",u=(e.path||"/").replace("path=",""),h=e.url!=null&&e.url.length>0?`domain=${e.url}`:"";document.cookie=`${r}=${o||""}${l}; path=${u}; ${h};`}catch(r){return Promise.reject(r)}}async deleteCookie(e){try{document.cookie=`${e.key}=; Max-Age=0`}catch(r){return Promise.reject(r)}}async clearCookies(){try{const e=document.cookie.split(";")||[];for(const r of e)document.cookie=r.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(e){return Promise.reject(e)}}async clearAllCookies(){try{await this.clearCookies()}catch(e){return Promise.reject(e)}}}Ui("CapacitorCookies",{web:()=>new I_});const T_=async t=>new Promise((e,r)=>{const o=new FileReader;o.onload=()=>{const l=o.result;e(l.indexOf(",")>=0?l.split(",")[1]:l)},o.onerror=l=>r(l),o.readAsDataURL(t)}),R_=(t={})=>{const e=Object.keys(t);return Object.keys(t).map(l=>l.toLocaleLowerCase()).reduce((l,u,h)=>(l[u]=t[e[h]],l),{})},__=(t,e=!0)=>t?Object.entries(t).reduce((o,l)=>{const[u,h]=l;let x,w;return Array.isArray(h)?(w="",h.forEach(m=>{x=e?encodeURIComponent(m):m,w+=`${u}=${x}&`}),w.slice(0,-1)):(x=e?encodeURIComponent(h):h,w=`${u}=${x}`),`${o}&${w}`},"").substr(1):null,N_=(t,e={})=>{const r=Object.assign({method:t.method||"GET",headers:t.headers},e),l=R_(t.headers)["content-type"]||"";if(typeof t.data=="string")r.body=t.data;else if(l.includes("application/x-www-form-urlencoded")){const u=new URLSearchParams;for(const[h,x]of Object.entries(t.data||{}))u.set(h,x);r.body=u.toString()}else if(l.includes("multipart/form-data")||t.data instanceof FormData){const u=new FormData;if(t.data instanceof FormData)t.data.forEach((x,w)=>{u.append(w,x)});else for(const x of Object.keys(t.data))u.append(x,t.data[x]);r.body=u;const h=new Headers(r.headers);h.delete("content-type"),r.headers=h}else(l.includes("application/json")||typeof t.data=="object")&&(r.body=JSON.stringify(t.data));return r};class O_ extends xy{async request(e){const r=N_(e,e.webFetchExtra),o=__(e.params,e.shouldEncodeUrlParams),l=o?`${e.url}?${o}`:e.url,u=await fetch(l,r),h=u.headers.get("content-type")||"";let{responseType:x="text"}=u.ok?e:{};h.includes("application/json")&&(x="json");let w,m;switch(x){case"arraybuffer":case"blob":m=await u.blob(),w=await T_(m);break;case"json":w=await u.json();break;case"document":case"text":default:w=await u.text()}const y={};return u.headers.forEach((b,C)=>{y[C]=b}),{data:w,headers:y,status:u.status,url:u.url}}async get(e){return this.request(Object.assign(Object.assign({},e),{method:"GET"}))}async post(e){return this.request(Object.assign(Object.assign({},e),{method:"POST"}))}async put(e){return this.request(Object.assign(Object.assign({},e),{method:"PUT"}))}async patch(e){return this.request(Object.assign(Object.assign({},e),{method:"PATCH"}))}async delete(e){return this.request(Object.assign(Object.assign({},e),{method:"DELETE"}))}}const wy=Ui("CapacitorHttp",{web:()=>new O_}),k_="https://api.github.com/repos/tclxqu-cao/team-agent/releases?per_page=50",td=`${Q0}/releases`,y2=`${new URL(td).pathname}/tag/`;function vy(t,e){const r=e.client==="desktop"&&t.startsWith("v")?"v":`${e.client}-v`;if(!t.startsWith(r))return null;const o=t.slice(r.length);if(!cn(o))return null;const l=e.client==="desktop-lite"?"AgentRoam-Lite":"AgentRoam",u=e.platform==="android"?`AgentRoam-${o}-android.apk`:e.platform==="darwin-arm64"?`${l}-${o}-arm64.dmg`:`${l}-Setup-${o}-x64.exe`;return{version:o,baseUrl:`${u_}/${t}`,fileName:u}}function M_(t,e){if(!t||typeof t!="object")return null;const{name:r,state:o,size:l,digest:u,browser_download_url:h}=t;return r!==e.fileName||o!=="uploaded"||h!==`${e.baseUrl}/${r}`||typeof l!="number"||!Number.isSafeInteger(l)||l<=0||typeof u!="string"||!/^sha256:[a-f0-9]{64}$/.test(u)?null:{fileName:r,sha256:u.slice(7),size:l,url:h}}function D_(t,e,r){if(!Array.isArray(t))throw new Error("Invalid GitHub release list");let o=null;for(const l of t){if((l==null?void 0:l.draft)!==!1||typeof l.tag_name!="string"||!l.published_at||!Array.isArray(l.assets))continue;const u=vy(l.tag_name,e);if(!u||Ii(u.version,(o==null?void 0:o.version)??r)<=0)continue;const h=l.assets.map(x=>M_(x,u)).find(Boolean);h&&(o={version:u.version,asset:h})}return o}async function P_(t,e,r,o){var m;try{const y=await r(k_,{headers:{accept:"application/vnd.github+json"},signal:AbortSignal.timeout(o)});if(y.ok)return D_(await y.json(),t,e)}catch{}const l=t.client==="desktop-lite"?"lite":t.client,u=await Promise.allSettled([td,`${td}?q=${l}`].map(async y=>{const b=await r(y,{signal:AbortSignal.timeout(o)});if(!b.ok)throw new Error("GitHub releases unavailable");return[...(await b.text()).matchAll(/\bhref="([^"<>]+)"/g)].flatMap(([,C])=>{const T=C.startsWith("https://github.com/")?C.slice(18):C;return T.startsWith(y2)?[T.slice(y2.length)]:[]})})),h=new Set(u.flatMap(y=>y.status==="fulfilled"?y.value:[]));if(!h.size)throw new Error("GitHub releases unavailable");const x=[...h].map(y=>vy(y,t)).filter(y=>!!(y&&Ii(y.version,e)>0)).sort((y,b)=>Ii(b.version,y.version)),w=AbortSignal.timeout(o);for(const y of x){const b=await r(`${y.baseUrl}/SHA256SUMS`,{signal:w});if(b.status===404)continue;if(!b.ok)throw new Error("Release checksums unavailable");const C=(m=(await b.text()).split(/\r?\n/).map(T=>/^([a-f0-9]{64})[ \t]+\*?(\S+)$/.exec(T.trim())).find(T=>(T==null?void 0:T[2])===y.fileName))==null?void 0:m[1];if(C)return{version:y.version,asset:{fileName:y.fileName,sha256:C,url:`${y.baseUrl}/${y.fileName}`}}}return null}const L_=5*6e4;class yy{constructor(e){if(this.options=e,this.checkedAt=0,this.registryCache=new Map,this.inFlight=null,this.listeners=new Set,this.scheduled=!1,!cn(e.currentVersion))throw new Error("invalid current AgentRoam version");this.fetchImpl=e.fetch??globalThis.fetch,this.now=e.now??Date.now,this.random=e.random??Math.random,this.setTimer=e.setTimer??setTimeout,this.timeoutMs=e.timeoutMs??4e3,this.intervalMs=e.intervalMs??L_,this.status={phase:"idle",currentVersion:e.currentVersion}}getStatus(){return structuredClone(this.status)}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}schedule(){if(this.scheduled)return;this.scheduled=!0;const e=6e3+Math.floor(this.random()*24001),r=this.setTimer(()=>{this.refresh().finally(()=>this.scheduleAfterInterval())},e);typeof r=="object"&&r&&"unref"in r&&r.unref()}scheduleAfterInterval(){const e=this.setTimer(()=>{this.refresh().finally(()=>this.scheduleAfterInterval())},this.intervalMs);typeof e=="object"&&e&&"unref"in e&&e.unref()}refresh(e={}){return this.inFlight?this.inFlight:!e.force&&this.checkedAt>0&&this.now()-this.checkedAt<this.intervalMs?Promise.resolve(this.getStatus()):(this.inFlight=this.runRefresh().finally(()=>{this.inFlight=null}),this.inFlight)}async runRefresh(){const e=this.status;this.publish({...e,phase:"checking",message:void 0});try{if(this.options.client==="ios"){const o=await this.options.readStoreVersion();this.checkedAt=this.now();const l={currentVersion:this.options.currentVersion,checkedAt:this.checkedAt};return this.publish(Ii(o,l.currentVersion)>0?{...l,phase:"available",targetVersion:o}:{...l,phase:"up-to-date"})}const r=this.options.client==="cli"?await this.readCliRelease(this.options.platform):await P_(this.options,this.options.currentVersion,this.fetchImpl,this.timeoutMs);return this.checkedAt=this.now(),r?this.publish({phase:"available",currentVersion:this.options.currentVersion,targetVersion:r.version,checkedAt:this.checkedAt,asset:r.asset}):this.publish({phase:"up-to-date",currentVersion:this.options.currentVersion,checkedAt:this.checkedAt})}catch{this.checkedAt=this.now();const r={checkedAt:this.checkedAt,message:"检查更新失败,请稍后重试。"};return["available","up-to-date"].includes(e.phase)?this.publish({...e,...r}):this.publish({phase:"unavailable",currentVersion:this.options.currentVersion,...r})}}async readCliRelease(e){const r=AbortSignal.timeout(this.timeoutMs),o=await this.readRegistryCandidate(r);if(Ii(o,this.options.currentVersion)<=0)return null;const l=await this.fetchImpl(p_(),{headers:{accept:"application/json"},signal:r});if(!l.ok)throw new Error("CLI installer manifest unavailable");return{version:o,asset:m_(await l.json(),e)}}async readRegistryCandidate(e){const r=await Promise.allSettled(h_("preview").map(async l=>{const u={accept:"application/json"},h=this.registryCache.get(l);h!=null&&h.etag&&(u["if-none-match"]=h.etag);const x=await this.fetchImpl(l,{headers:u,signal:e});if(x.status===304)return h==null?void 0:h.version;if(!x.ok)return;const w=g_((await x.json()).version);return w&&this.registryCache.set(l,{version:w,etag:x.headers.get("etag")}),w}));let o=null;for(const l of r){const u=l.status==="fulfilled"?l.value:null;u&&(!o||Ii(u,o)>0)&&(o=u)}if(!o)throw new Error("npm release channel unavailable");return o}publish(e){this.status=e;for(const r of this.listeners)r(this.getStatus());return this.getStatus()}}const Bf=Ui("AgentRoamAppUpdate");class B_{constructor(){this.inFlight=null,this.operation=null,this.listeners=new Set}async getUpdateStatus(){const e=await this.getChecker(),r=(e==null?void 0:e.getStatus())??{phase:"unavailable",currentVersion:""};return this.operation&&(this.inFlight||this.operation.targetVersion===r.targetVersion)?this.operation:r}async checkForUpdate(){var r;const e=this.inFlight?null:await((r=await this.getChecker())==null?void 0:r.refresh({force:!0}));return e!=null&&e.message?e:this.getUpdateStatus()}installUpdate(){return this.inFlight??(this.inFlight=this.install().finally(()=>{this.inFlight=null}))}onUpdateStatus(e){return this.listeners.add(e),()=>this.listeners.delete(e)}getChecker(){return this.checker??(this.checker=Bf.getInfo().then(({version:e})=>{if(!cn(e))return null;const r=new yy({currentVersion:e,client:"android",platform:"android",fetch:F_,timeoutMs:1e4});return r.subscribe(o=>{!this.inFlight&&(!this.operation||this.operation.targetVersion!==o.targetVersion)&&this.notify(o)}),r.schedule(),r}).catch(()=>(this.checker=void 0,null)))}async install(){var o;const e=(o=await this.getChecker())==null?void 0:o.getStatus();if((e==null?void 0:e.phase)!=="available"||!e.asset||!e.targetVersion)throw new Error("当前没有可安装的更新");let r;try{return this.publish({...e,phase:"installing",message:"正在准备 Android 更新"}),r=await Bf.addListener("progress",l=>this.publish({...e,...l})),await Bf.install({version:e.targetVersion,sha256:e.asset.sha256}),this.publish({...e,phase:"complete",message:"安装完成,请重新打开应用"})}catch(l){return this.publish({...e,phase:"failed",message:l instanceof Error?l.message:"Android 更新失败"})}finally{await(r==null?void 0:r.remove().catch(()=>{}))}}publish(e){return this.operation=e,this.notify(e),e}notify(e){for(const r of this.listeners)r(e)}}const F_=async(t,e)=>{var l,u;if((l=e==null?void 0:e.signal)!=null&&l.aborted)throw new Error("Update check timed out");const r=await wy.get({url:String(t),headers:Object.fromEntries(new Headers(e==null?void 0:e.headers).entries()),responseType:"text",connectTimeout:5e3,readTimeout:5e3});if((u=e==null?void 0:e.signal)!=null&&u.aborted)throw new Error("Update check timed out");const o=typeof r.data=="string"?r.data:JSON.stringify(r.data);return new Response([204,205,304].includes(r.status)?null:o,{status:r.status,headers:r.headers})},E2=Ui("AgentRoamAppUpdate"),A2="当前地区的 App Store 暂未提供更新,请通过原安装渠道检查。",b2={phase:"unavailable",currentVersion:"",message:"请通过原安装渠道检查 iOS 更新。"};function C2(t){if(typeof t!="string"||!/^\d+(?:\.\d+){0,2}$/.test(t))return null;const e=t.split(".");for(;e.length<3;)e.push("0");const r=e.join(".");return cn(r)?r:null}class U_{constructor(){this.unlisted=!1,this.listeners=new Set}async getUpdateStatus(){var e;return this.withStoreMessage(((e=await this.getChecker())==null?void 0:e.getStatus())??b2)}async checkForUpdate(){var e;return this.withStoreMessage(await((e=await this.getChecker())==null?void 0:e.refresh({force:!0}))??b2)}async installUpdate(){const e=await this.getUpdateStatus();if(e.phase!=="available"||!this.storeId)throw new Error("当前没有可打开的 App Store 更新");return await E2.openStore({id:this.storeId}),e}onUpdateStatus(e){return this.listeners.add(e),()=>this.listeners.delete(e)}getChecker(){return this.checker??(this.checker=E2.getInfo().then(({version:e,bundleId:r,country:o})=>{const l=C2(e);if(!l||!r)return null;const u=new yy({client:"ios",currentVersion:l,readStoreVersion:()=>this.readStoreVersion(r,o)});return u.subscribe(h=>{for(const x of this.listeners)x(this.withStoreMessage(h))}),u.schedule(),u}).catch(()=>(this.checker=void 0,null)))}async readStoreVersion(e,r){var w;this.unlisted=!1;const o=await wy.get({url:"https://itunes.apple.com/lookup",params:{bundleId:e,entity:"software",...r?{country:r}:{}},responseType:"json",connectTimeout:5e3,readTimeout:5e3}),l=(w=o.data)==null?void 0:w.results;if(o.status!==200||!Array.isArray(l))throw new Error("App Store lookup unavailable");const u=l.find(m=>(m==null?void 0:m.bundleId)===e);if(!u)throw this.unlisted=!0,new Error(A2);const h=C2(u.version),x=u.trackId;if(!h||typeof x!="number"||!Number.isSafeInteger(x)||x<=0)throw new Error("Invalid App Store listing");return this.storeId=String(x),h}withStoreMessage(e){return this.unlisted&&e.message?{...e,message:A2}:e}}const Ey=Di.getPlatform(),S2=Ey==="android"?new B_:null,I2=Ey==="ios"?new U_:null;function Ay({children:t}){return S2?M.jsx(x2,{api:S2,product:"AgentRoam Android",scope:"android",hint:"下载后按 Android 提示确认安装",children:t}):I2?M.jsx(x2,{api:I2,product:"AgentRoam iOS",scope:"ios",hint:"在 App Store 确认更新",installLabel:"前往 App Store",children:t}):t}let an=null;function j_(t){an=t}function rO(){return an}function W_(){return(an==null?void 0:an.origin)??location.origin}function nO(t){return(an==null?void 0:an.frameUrl(t))??t}function iO(t){return an?new URL(t,an.origin).href:t}function sO(){const t=new URL("/ws",W_());return t.protocol=t.protocol==="https:"?"wss:":"ws:",t.href}const by="agentroam.computers.v1",Cy=20,V_=/^[A-Za-z0-9_-]{43}$/;function Sy(t){try{if(typeof t!="string"||t.length>8192)throw new Error;const e=new URL(t.trim().replace(/[,。]+$/,""));if(!["http:","https:"].includes(e.protocol)||e.username||e.password)throw new Error;return e.href}catch{throw new Error("请填写有效的 http(s) 页面地址。")}}function z_(t){if(!Array.isArray(t)||t.length>20)return[];const e=new Map;for(const r of t)if(!(!r||typeof r.id!="string"||!/^[A-Za-z0-9_-]{1,80}$/.test(r.id)||typeof r.name!="string"||!r.name.trim()||!["current","new-tab"].includes(r.openMode)))try{e.set(r.id,{id:r.id,name:r.name.trim().slice(0,60),url:Sy(r.url),openMode:r.openMode})}catch{}return[...e.values()]}function oO(t){try{const e=new URL(Sy(t)).hostname;return e==="qoder.com"||e.endsWith(".qoder.com")?"new-tab":"current"}catch{return"current"}}function qc(t){try{const e=new URL(t);return!["http:","https:"].includes(e.protocol)||e.username||e.password||e.pathname!=="/"||e.search||e.hash?null:e.origin}catch{return null}}function Jc(t){if(!Array.isArray(t)||t.length>Cy)return[];const e=new Map;for(const r of t){const o=r&&typeof r.origin=="string"?qc(r.origin):null;if(!o||typeof r.name!="string")continue;const l=r.name.trim().slice(0,60)||new URL(o).hostname,u=z_(r.pages);e.set(o,{origin:o,name:l,...r.pagesMigrated===!0?{pagesMigrated:!0}:Array.isArray(r.pages)?{pages:u}:{}})}return[...e.values()]}function Iy(t=localStorage){try{return Jc(JSON.parse(t.getItem(by)||"[]"))}catch{return[]}}function $_(...t){const e=new Map;for(const r of t)for(const o of Jc(r)){const u={...e.get(o.origin),...o};u.pagesMigrated&&delete u.pages,e.set(o.origin,u)}if(e.size>Cy)throw new Error("最多可添加 20 台电脑。");return[...e.values()]}function H_(t,e=localStorage){const r=Jc(t);try{e.setItem(by,JSON.stringify(r))}catch{throw new Error("浏览器无法保存电脑列表,请检查浏览器存储设置。")}return r}function G_(t,e,r=Iy()){var u;const o=qc(t);if(!o)throw new Error("电脑地址无效。");const l=r.find(h=>h.origin===o);return $_(r,[{origin:o,name:(l==null?void 0:l.name)||new URL(o).hostname,...(u=l==null?void 0:l.pages)!=null&&u.length?{pages:l.pages}:{}}])}function X_(t){try{if(typeof t!="string"||t.length>2048)throw new Error;if(t=t.trim(),t.startsWith("{")){const r=JSON.parse(t),o=qc(r.server);if(r.type!=="agentroam-pair"||r.version!==1||!o||!V_.test(r.grant))throw new Error;t=o+"/pair#pair="+r.grant}const e=new URL(t);if(!["http:","https:"].includes(e.protocol)||e.username||e.password||e.pathname!=="/pair"||e.search||!/^#pair=[A-Za-z0-9_-]{43}$/.test(e.hash))throw new Error;return e}catch{throw new Error("这不是 AgentRoam 授权二维码,请在电脑上重新生成。")}}function Ty(t,e,r=""){const o=new URLSearchParams(t.hash.slice(1)),l=Jc(e).map(u=>{var h;return{origin:u.origin,name:u.name,...u.pagesMigrated?{pagesMigrated:!0}:{},...u.origin===t.origin&&!u.pagesMigrated&&((h=u.pages)!=null&&h.length)?{pages:u.pages}:{}}});if(o.set("computers",JSON.stringify({version:1,computers:l,name:r.trim().slice(0,60)})),o.toString().length>16383)throw new Error("电脑列表或待导入页面配置过长,请先导入旧页面后再切换电脑。");return t.hash=o.toString(),t.href}function aO(t,e,r=""){return Ty(X_(t),e,r)}function lO(t,e){const r=qc(t);if(!r)throw new Error("电脑地址无效。");return Ty(new URL(r+"/pair"),e)}var oe;(function(t){t[t.QR_CODE=0]="QR_CODE",t[t.AZTEC=1]="AZTEC",t[t.CODABAR=2]="CODABAR",t[t.CODE_39=3]="CODE_39",t[t.CODE_93=4]="CODE_93",t[t.CODE_128=5]="CODE_128",t[t.DATA_MATRIX=6]="DATA_MATRIX",t[t.MAXICODE=7]="MAXICODE",t[t.ITF=8]="ITF",t[t.EAN_13=9]="EAN_13",t[t.EAN_8=10]="EAN_8",t[t.PDF_417=11]="PDF_417",t[t.RSS_14=12]="RSS_14",t[t.RSS_EXPANDED=13]="RSS_EXPANDED",t[t.UPC_A=14]="UPC_A",t[t.UPC_E=15]="UPC_E",t[t.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"})(oe||(oe={}));var T2=new Map([[oe.QR_CODE,"QR_CODE"],[oe.AZTEC,"AZTEC"],[oe.CODABAR,"CODABAR"],[oe.CODE_39,"CODE_39"],[oe.CODE_93,"CODE_93"],[oe.CODE_128,"CODE_128"],[oe.DATA_MATRIX,"DATA_MATRIX"],[oe.MAXICODE,"MAXICODE"],[oe.ITF,"ITF"],[oe.EAN_13,"EAN_13"],[oe.EAN_8,"EAN_8"],[oe.PDF_417,"PDF_417"],[oe.RSS_14,"RSS_14"],[oe.RSS_EXPANDED,"RSS_EXPANDED"],[oe.UPC_A,"UPC_A"],[oe.UPC_E,"UPC_E"],[oe.UPC_EAN_EXTENSION,"UPC_EAN_EXTENSION"]]),R2;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.URL=1]="URL"})(R2||(R2={}));function Y_(t){return Object.values(oe).includes(t)}var gc;(function(t){t[t.SCAN_TYPE_CAMERA=0]="SCAN_TYPE_CAMERA",t[t.SCAN_TYPE_FILE=1]="SCAN_TYPE_FILE"})(gc||(gc={}));var K_=function(){function t(){}return t.GITHUB_PROJECT_URL="https://github.com/mebjas/html5-qrcode",t.SCAN_DEFAULT_FPS=2,t.DEFAULT_DISABLE_FLIP=!1,t.DEFAULT_REMEMBER_LAST_CAMERA_USED=!0,t.DEFAULT_SUPPORTED_SCAN_TYPE=[gc.SCAN_TYPE_CAMERA,gc.SCAN_TYPE_FILE],t}(),Ry=function(){function t(e,r){this.format=e,this.formatName=r}return t.prototype.toString=function(){return this.formatName},t.create=function(e){if(!T2.has(e))throw"".concat(e," not in html5QrcodeSupportedFormatsTextMap");return new t(e,T2.get(e))},t}(),_2=function(){function t(){}return t.createFromText=function(e){var r={text:e};return{decodedText:e,result:r}},t.createFromQrcodeResult=function(e){return{decodedText:e.text,result:e}},t}(),rd;(function(t){t[t.UNKWOWN_ERROR=0]="UNKWOWN_ERROR",t[t.IMPLEMENTATION_ERROR=1]="IMPLEMENTATION_ERROR",t[t.NO_CODE_FOUND_ERROR=2]="NO_CODE_FOUND_ERROR"})(rd||(rd={}));var Z_=function(){function t(){}return t.createFrom=function(e){return{errorMessage:e,type:rd.UNKWOWN_ERROR}},t}(),Q_=function(){function t(e){this.verbose=e}return t.prototype.log=function(e){this.verbose&&console.log(e)},t.prototype.warn=function(e){this.verbose&&console.warn(e)},t.prototype.logError=function(e,r){(this.verbose||r===!0)&&console.error(e)},t.prototype.logErrors=function(e){if(e.length===0)throw"Logger#logError called without arguments";this.verbose&&console.error(e)},t}();function dn(t){return typeof t>"u"||t===null}var gs=function(){function t(){}return t.codeParseError=function(e){return"QR code parse error, error = ".concat(e)},t.errorGettingUserMedia=function(e){return"Error getting userMedia, error = ".concat(e)},t.onlyDeviceSupportedError=function(){return"The device doesn't support navigator.mediaDevices , only supported cameraIdOrConfig in this case is deviceId parameter (string)."},t.cameraStreamingNotSupported=function(){return"Camera streaming not supported by the browser."},t.unableToQuerySupportedDevices=function(){return"Unable to query supported devices, unknown error."},t.insecureContextCameraQueryError=function(){return"Camera access is only supported in secure context like https or localhost."},t.scannerPaused=function(){return"Scanner paused"},t}(),_y=function(){function t(){}return t.isMediaStreamConstraintsValid=function(e,r){if(typeof e!="object"){var o=typeof e;return r.logError("videoConstraints should be of type object, the "+"object passed is of type ".concat(o,"."),!0),!1}for(var l=["autoGainControl","channelCount","echoCancellation","latency","noiseSuppression","sampleRate","sampleSize","volume"],u=new Set(l),h=Object.keys(e),x=0,w=h;x<w.length;x++){var m=w[x];if(u.has(m))return r.logError("".concat(m," is not supported videoConstaints."),!0),!1}return!0},t}(),nd={exports:{}};(function(t,e){(function(r,o){o(e)})(mn,function(r){function o(E){return E==null}var l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,n){E.__proto__=n}||function(E,n){for(var i in n)n.hasOwnProperty(i)&&(E[i]=n[i])};function u(E,n){l(E,n);function i(){this.constructor=E}E.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}function h(E,n){var i=Object.setPrototypeOf;i?i(E,n):E.__proto__=n}function x(E,n){n===void 0&&(n=E.constructor);var i=Error.captureStackTrace;i&&i(E,n)}var w=function(E){u(n,E);function n(i){var s=this.constructor,a=E.call(this,i)||this;return Object.defineProperty(a,"name",{value:s.name,enumerable:!1}),h(a,s.prototype),x(a),a}return n}(Error);class m extends w{constructor(n=void 0){super(n),this.message=n}getKind(){return this.constructor.kind}}m.kind="Exception";class y extends m{}y.kind="ArgumentException";class b extends m{}b.kind="IllegalArgumentException";class C{constructor(n){if(this.binarizer=n,n===null)throw new b("Binarizer must be non-null.")}getWidth(){return this.binarizer.getWidth()}getHeight(){return this.binarizer.getHeight()}getBlackRow(n,i){return this.binarizer.getBlackRow(n,i)}getBlackMatrix(){return(this.matrix===null||this.matrix===void 0)&&(this.matrix=this.binarizer.getBlackMatrix()),this.matrix}isCropSupported(){return this.binarizer.getLuminanceSource().isCropSupported()}crop(n,i,s,a){const c=this.binarizer.getLuminanceSource().crop(n,i,s,a);return new C(this.binarizer.createBinarizer(c))}isRotateSupported(){return this.binarizer.getLuminanceSource().isRotateSupported()}rotateCounterClockwise(){const n=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new C(this.binarizer.createBinarizer(n))}rotateCounterClockwise45(){const n=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new C(this.binarizer.createBinarizer(n))}toString(){try{return this.getBlackMatrix().toString()}catch{return""}}}class T extends m{static getChecksumInstance(){return new T}}T.kind="ChecksumException";class k{constructor(n){this.source=n}getLuminanceSource(){return this.source}getWidth(){return this.source.getWidth()}getHeight(){return this.source.getHeight()}}class D{static arraycopy(n,i,s,a,c){for(;c--;)s[a++]=n[i++]}static currentTimeMillis(){return Date.now()}}class X extends m{}X.kind="IndexOutOfBoundsException";class O extends X{constructor(n=void 0,i=void 0){super(i),this.index=n,this.message=i}}O.kind="ArrayIndexOutOfBoundsException";class I{static fill(n,i){for(let s=0,a=n.length;s<a;s++)n[s]=i}static fillWithin(n,i,s,a){I.rangeCheck(n.length,i,s);for(let c=i;c<s;c++)n[c]=a}static rangeCheck(n,i,s){if(i>s)throw new b("fromIndex("+i+") > toIndex("+s+")");if(i<0)throw new O(i);if(s>n)throw new O(s)}static asList(...n){return n}static create(n,i,s){return Array.from({length:n}).map(c=>Array.from({length:i}).fill(s))}static createInt32Array(n,i,s){return Array.from({length:n}).map(c=>Int32Array.from({length:i}).fill(s))}static equals(n,i){if(!n||!i||!n.length||!i.length||n.length!==i.length)return!1;for(let s=0,a=n.length;s<a;s++)if(n[s]!==i[s])return!1;return!0}static hashCode(n){if(n===null)return 0;let i=1;for(const s of n)i=31*i+s;return i}static fillUint8Array(n,i){for(let s=0;s!==n.length;s++)n[s]=i}static copyOf(n,i){return n.slice(0,i)}static copyOfUint8Array(n,i){if(n.length<=i){const s=new Uint8Array(i);return s.set(n),s}return n.slice(0,i)}static copyOfRange(n,i,s){const a=s-i,c=new Int32Array(a);return D.arraycopy(n,i,c,0,a),c}static binarySearch(n,i,s){s===void 0&&(s=I.numberComparator);let a=0,c=n.length-1;for(;a<=c;){const f=c+a>>1,d=s(i,n[f]);if(d>0)a=f+1;else if(d<0)c=f-1;else return f}return-a-1}static numberComparator(n,i){return n-i}}class _{static numberOfTrailingZeros(n){let i;if(n===0)return 32;let s=31;return i=n<<16,i!==0&&(s-=16,n=i),i=n<<8,i!==0&&(s-=8,n=i),i=n<<4,i!==0&&(s-=4,n=i),i=n<<2,i!==0&&(s-=2,n=i),s-(n<<1>>>31)}static numberOfLeadingZeros(n){if(n===0)return 32;let i=1;return n>>>16||(i+=16,n<<=16),n>>>24||(i+=8,n<<=8),n>>>28||(i+=4,n<<=4),n>>>30||(i+=2,n<<=2),i-=n>>>31,i}static toHexString(n){return n.toString(16)}static toBinaryString(n){return String(parseInt(String(n),2))}static bitCount(n){return n=n-(n>>>1&1431655765),n=(n&858993459)+(n>>>2&858993459),n=n+(n>>>4)&252645135,n=n+(n>>>8),n=n+(n>>>16),n&63}static truncDivision(n,i){return Math.trunc(n/i)}static parseInt(n,i=void 0){return parseInt(n,i)}}_.MIN_VALUE_32_BITS=-2147483648,_.MAX_VALUE=Number.MAX_SAFE_INTEGER;class L{constructor(n,i){n===void 0?(this.size=0,this.bits=new Int32Array(1)):(this.size=n,i==null?this.bits=L.makeArray(n):this.bits=i)}getSize(){return this.size}getSizeInBytes(){return Math.floor((this.size+7)/8)}ensureCapacity(n){if(n>this.bits.length*32){const i=L.makeArray(n);D.arraycopy(this.bits,0,i,0,this.bits.length),this.bits=i}}get(n){return(this.bits[Math.floor(n/32)]&1<<(n&31))!==0}set(n){this.bits[Math.floor(n/32)]|=1<<(n&31)}flip(n){this.bits[Math.floor(n/32)]^=1<<(n&31)}getNextSet(n){const i=this.size;if(n>=i)return i;const s=this.bits;let a=Math.floor(n/32),c=s[a];c&=~((1<<(n&31))-1);const f=s.length;for(;c===0;){if(++a===f)return i;c=s[a]}const d=a*32+_.numberOfTrailingZeros(c);return d>i?i:d}getNextUnset(n){const i=this.size;if(n>=i)return i;const s=this.bits;let a=Math.floor(n/32),c=~s[a];c&=~((1<<(n&31))-1);const f=s.length;for(;c===0;){if(++a===f)return i;c=~s[a]}const d=a*32+_.numberOfTrailingZeros(c);return d>i?i:d}setBulk(n,i){this.bits[Math.floor(n/32)]=i}setRange(n,i){if(i<n||n<0||i>this.size)throw new b;if(i===n)return;i--;const s=Math.floor(n/32),a=Math.floor(i/32),c=this.bits;for(let f=s;f<=a;f++){const d=f>s?0:n&31,p=(2<<(f<a?31:i&31))-(1<<d);c[f]|=p}}clear(){const n=this.bits.length,i=this.bits;for(let s=0;s<n;s++)i[s]=0}isRange(n,i,s){if(i<n||n<0||i>this.size)throw new b;if(i===n)return!0;i--;const a=Math.floor(n/32),c=Math.floor(i/32),f=this.bits;for(let d=a;d<=c;d++){const g=d>a?0:n&31,v=(2<<(d<c?31:i&31))-(1<<g)&4294967295;if((f[d]&v)!==(s?v:0))return!1}return!0}appendBit(n){this.ensureCapacity(this.size+1),n&&(this.bits[Math.floor(this.size/32)]|=1<<(this.size&31)),this.size++}appendBits(n,i){if(i<0||i>32)throw new b("Num bits must be between 0 and 32");this.ensureCapacity(this.size+i);for(let s=i;s>0;s--)this.appendBit((n>>s-1&1)===1)}appendBitArray(n){const i=n.size;this.ensureCapacity(this.size+i);for(let s=0;s<i;s++)this.appendBit(n.get(s))}xor(n){if(this.size!==n.size)throw new b("Sizes don't match");const i=this.bits;for(let s=0,a=i.length;s<a;s++)i[s]^=n.bits[s]}toBytes(n,i,s,a){for(let c=0;c<a;c++){let f=0;for(let d=0;d<8;d++)this.get(n)&&(f|=1<<7-d),n++;i[s+c]=f}}getBitArray(){return this.bits}reverse(){const n=new Int32Array(this.bits.length),i=Math.floor((this.size-1)/32),s=i+1,a=this.bits;for(let c=0;c<s;c++){let f=a[c];f=f>>1&1431655765|(f&1431655765)<<1,f=f>>2&858993459|(f&858993459)<<2,f=f>>4&252645135|(f&252645135)<<4,f=f>>8&16711935|(f&16711935)<<8,f=f>>16&65535|(f&65535)<<16,n[i-c]=f}if(this.size!==s*32){const c=s*32-this.size;let f=n[0]>>>c;for(let d=1;d<s;d++){const g=n[d];f|=g<<32-c,n[d-1]=f,f=g>>>c}n[s-1]=f}this.bits=n}static makeArray(n){return new Int32Array(Math.floor((n+31)/32))}equals(n){if(!(n instanceof L))return!1;const i=n;return this.size===i.size&&I.equals(this.bits,i.bits)}hashCode(){return 31*this.size+I.hashCode(this.bits)}toString(){let n="";for(let i=0,s=this.size;i<s;i++)i&7||(n+=" "),n+=this.get(i)?"X":".";return n}clone(){return new L(this.size,this.bits.slice())}}var j;(function(E){E[E.OTHER=0]="OTHER",E[E.PURE_BARCODE=1]="PURE_BARCODE",E[E.POSSIBLE_FORMATS=2]="POSSIBLE_FORMATS",E[E.TRY_HARDER=3]="TRY_HARDER",E[E.CHARACTER_SET=4]="CHARACTER_SET",E[E.ALLOWED_LENGTHS=5]="ALLOWED_LENGTHS",E[E.ASSUME_CODE_39_CHECK_DIGIT=6]="ASSUME_CODE_39_CHECK_DIGIT",E[E.ASSUME_GS1=7]="ASSUME_GS1",E[E.RETURN_CODABAR_START_END=8]="RETURN_CODABAR_START_END",E[E.NEED_RESULT_POINT_CALLBACK=9]="NEED_RESULT_POINT_CALLBACK",E[E.ALLOWED_EAN_EXTENSIONS=10]="ALLOWED_EAN_EXTENSIONS"})(j||(j={}));var U=j;class F extends m{static getFormatInstance(){return new F}}F.kind="FormatException";var Y;(function(E){E[E.Cp437=0]="Cp437",E[E.ISO8859_1=1]="ISO8859_1",E[E.ISO8859_2=2]="ISO8859_2",E[E.ISO8859_3=3]="ISO8859_3",E[E.ISO8859_4=4]="ISO8859_4",E[E.ISO8859_5=5]="ISO8859_5",E[E.ISO8859_6=6]="ISO8859_6",E[E.ISO8859_7=7]="ISO8859_7",E[E.ISO8859_8=8]="ISO8859_8",E[E.ISO8859_9=9]="ISO8859_9",E[E.ISO8859_10=10]="ISO8859_10",E[E.ISO8859_11=11]="ISO8859_11",E[E.ISO8859_13=12]="ISO8859_13",E[E.ISO8859_14=13]="ISO8859_14",E[E.ISO8859_15=14]="ISO8859_15",E[E.ISO8859_16=15]="ISO8859_16",E[E.SJIS=16]="SJIS",E[E.Cp1250=17]="Cp1250",E[E.Cp1251=18]="Cp1251",E[E.Cp1252=19]="Cp1252",E[E.Cp1256=20]="Cp1256",E[E.UnicodeBigUnmarked=21]="UnicodeBigUnmarked",E[E.UTF8=22]="UTF8",E[E.ASCII=23]="ASCII",E[E.Big5=24]="Big5",E[E.GB18030=25]="GB18030",E[E.EUC_KR=26]="EUC_KR"})(Y||(Y={}));class ${constructor(n,i,s,...a){this.valueIdentifier=n,this.name=s,typeof i=="number"?this.values=Int32Array.from([i]):this.values=i,this.otherEncodingNames=a,$.VALUE_IDENTIFIER_TO_ECI.set(n,this),$.NAME_TO_ECI.set(s,this);const c=this.values;for(let f=0,d=c.length;f!==d;f++){const g=c[f];$.VALUES_TO_ECI.set(g,this)}for(const f of a)$.NAME_TO_ECI.set(f,this)}getValueIdentifier(){return this.valueIdentifier}getName(){return this.name}getValue(){return this.values[0]}static getCharacterSetECIByValue(n){if(n<0||n>=900)throw new F("incorect value");const i=$.VALUES_TO_ECI.get(n);if(i===void 0)throw new F("incorect value");return i}static getCharacterSetECIByName(n){const i=$.NAME_TO_ECI.get(n);if(i===void 0)throw new F("incorect value");return i}equals(n){if(!(n instanceof $))return!1;const i=n;return this.getName()===i.getName()}}$.VALUE_IDENTIFIER_TO_ECI=new Map,$.VALUES_TO_ECI=new Map,$.NAME_TO_ECI=new Map,$.Cp437=new $(Y.Cp437,Int32Array.from([0,2]),"Cp437"),$.ISO8859_1=new $(Y.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),$.ISO8859_2=new $(Y.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),$.ISO8859_3=new $(Y.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),$.ISO8859_4=new $(Y.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),$.ISO8859_5=new $(Y.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),$.ISO8859_6=new $(Y.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),$.ISO8859_7=new $(Y.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),$.ISO8859_8=new $(Y.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),$.ISO8859_9=new $(Y.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),$.ISO8859_10=new $(Y.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),$.ISO8859_11=new $(Y.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),$.ISO8859_13=new $(Y.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),$.ISO8859_14=new $(Y.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),$.ISO8859_15=new $(Y.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),$.ISO8859_16=new $(Y.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),$.SJIS=new $(Y.SJIS,20,"SJIS","Shift_JIS"),$.Cp1250=new $(Y.Cp1250,21,"Cp1250","windows-1250"),$.Cp1251=new $(Y.Cp1251,22,"Cp1251","windows-1251"),$.Cp1252=new $(Y.Cp1252,23,"Cp1252","windows-1252"),$.Cp1256=new $(Y.Cp1256,24,"Cp1256","windows-1256"),$.UnicodeBigUnmarked=new $(Y.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),$.UTF8=new $(Y.UTF8,26,"UTF8","UTF-8"),$.ASCII=new $(Y.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),$.Big5=new $(Y.Big5,28,"Big5"),$.GB18030=new $(Y.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),$.EUC_KR=new $(Y.EUC_KR,30,"EUC_KR","EUC-KR");class se extends m{}se.kind="UnsupportedOperationException";class ve{static decode(n,i){const s=this.encodingName(i);return this.customDecoder?this.customDecoder(n,s):typeof TextDecoder>"u"||this.shouldDecodeOnFallback(s)?this.decodeFallback(n,s):new TextDecoder(s).decode(n)}static shouldDecodeOnFallback(n){return!ve.isBrowser()&&n==="ISO-8859-1"}static encode(n,i){const s=this.encodingName(i);return this.customEncoder?this.customEncoder(n,s):typeof TextEncoder>"u"?this.encodeFallback(n):new TextEncoder().encode(n)}static isBrowser(){return typeof window<"u"&&{}.toString.call(window)==="[object Window]"}static encodingName(n){return typeof n=="string"?n:n.getName()}static encodingCharacterSet(n){return n instanceof $?n:$.getCharacterSetECIByName(n)}static decodeFallback(n,i){const s=this.encodingCharacterSet(i);if(ve.isDecodeFallbackSupported(s)){let a="";for(let c=0,f=n.length;c<f;c++){let d=n[c].toString(16);d.length<2&&(d="0"+d),a+="%"+d}return decodeURIComponent(a)}if(s.equals($.UnicodeBigUnmarked))return String.fromCharCode.apply(null,new Uint16Array(n.buffer));throw new se(`Encoding ${this.encodingName(i)} not supported by fallback.`)}static isDecodeFallbackSupported(n){return n.equals($.UTF8)||n.equals($.ISO8859_1)||n.equals($.ASCII)}static encodeFallback(n){const s=btoa(unescape(encodeURIComponent(n))).split(""),a=[];for(let c=0;c<s.length;c++)a.push(s[c].charCodeAt(0));return new Uint8Array(a)}}class Q{static castAsNonUtf8Char(n,i=null){const s=i?i.getName():this.ISO88591;return ve.decode(new Uint8Array([n]),s)}static guessEncoding(n,i){if(i!=null&&i.get(U.CHARACTER_SET)!==void 0)return i.get(U.CHARACTER_SET).toString();const s=n.length;let a=!0,c=!0,f=!0,d=0,g=0,p=0,v=0,A=0,S=0,N=0,P=0,B=0,W=0,G=0;const J=n.length>3&&n[0]===239&&n[1]===187&&n[2]===191;for(let ee=0;ee<s&&(a||c||f);ee++){const Z=n[ee]&255;f&&(d>0?Z&128?d--:f=!1:Z&128&&(Z&64?(d++,Z&32?(d++,Z&16?(d++,Z&8?f=!1:v++):p++):g++):f=!1)),a&&(Z>127&&Z<160?a=!1:Z>159&&(Z<192||Z===215||Z===247)&&G++),c&&(A>0?Z<64||Z===127||Z>252?c=!1:A--:Z===128||Z===160||Z>239?c=!1:Z>160&&Z<224?(S++,P=0,N++,N>B&&(B=N)):Z>127?(A++,N=0,P++,P>W&&(W=P)):(N=0,P=0))}return f&&d>0&&(f=!1),c&&A>0&&(c=!1),f&&(J||g+p+v>0)?Q.UTF8:c&&(Q.ASSUME_SHIFT_JIS||B>=3||W>=3)?Q.SHIFT_JIS:a&&c?B===2&&S===2||G*10>=s?Q.SHIFT_JIS:Q.ISO88591:a?Q.ISO88591:c?Q.SHIFT_JIS:f?Q.UTF8:Q.PLATFORM_DEFAULT_ENCODING}static format(n,...i){let s=-1;function a(f,d,g,p,v,A){if(f==="%%")return"%";if(i[++s]===void 0)return;f=p?parseInt(p.substr(1)):void 0;let S=v?parseInt(v.substr(1)):void 0,N;switch(A){case"s":N=i[s];break;case"c":N=i[s][0];break;case"f":N=parseFloat(i[s]).toFixed(f);break;case"p":N=parseFloat(i[s]).toPrecision(f);break;case"e":N=parseFloat(i[s]).toExponential(f);break;case"x":N=parseInt(i[s]).toString(S||16);break;case"d":N=parseFloat(parseInt(i[s],S||10).toPrecision(f)).toFixed(0);break}N=typeof N=="object"?JSON.stringify(N):(+N).toString(S);let P=parseInt(g),B=g&&g[0]+""=="0"?"0":" ";for(;N.length<P;)N=d!==void 0?N+B:B+N;return N}let c=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return n.replace(c,a)}static getBytes(n,i){return ve.encode(n,i)}static getCharCode(n,i=0){return n.charCodeAt(i)}static getCharAt(n){return String.fromCharCode(n)}}Q.SHIFT_JIS=$.SJIS.getName(),Q.GB2312="GB2312",Q.ISO88591=$.ISO8859_1.getName(),Q.EUC_JP="EUC_JP",Q.UTF8=$.UTF8.getName(),Q.PLATFORM_DEFAULT_ENCODING=Q.UTF8,Q.ASSUME_SHIFT_JIS=!1;class xe{constructor(n=""){this.value=n}enableDecoding(n){return this.encoding=n,this}append(n){return typeof n=="string"?this.value+=n.toString():this.encoding?this.value+=Q.castAsNonUtf8Char(n,this.encoding):this.value+=String.fromCharCode(n),this}appendChars(n,i,s){for(let a=i;i<i+s;a++)this.append(n[a]);return this}length(){return this.value.length}charAt(n){return this.value.charAt(n)}deleteCharAt(n){this.value=this.value.substr(0,n)+this.value.substring(n+1)}setCharAt(n,i){this.value=this.value.substr(0,n)+i+this.value.substr(n+1)}substring(n,i){return this.value.substring(n,i)}setLengthToZero(){this.value=""}toString(){return this.value}insert(n,i){this.value=this.value.substr(0,n)+i+this.value.substr(n+i.length)}}class re{constructor(n,i,s,a){if(this.width=n,this.height=i,this.rowSize=s,this.bits=a,i==null&&(i=n),this.height=i,n<1||i<1)throw new b("Both dimensions must be greater than 0");s==null&&(s=Math.floor((n+31)/32)),this.rowSize=s,a==null&&(this.bits=new Int32Array(this.rowSize*this.height))}static parseFromBooleanArray(n){const i=n.length,s=n[0].length,a=new re(s,i);for(let c=0;c<i;c++){const f=n[c];for(let d=0;d<s;d++)f[d]&&a.set(d,c)}return a}static parseFromString(n,i,s){if(n===null)throw new b("stringRepresentation cannot be null");const a=new Array(n.length);let c=0,f=0,d=-1,g=0,p=0;for(;p<n.length;)if(n.charAt(p)===`
473
+ `||n.charAt(p)==="\r"){if(c>f){if(d===-1)d=c-f;else if(c-f!==d)throw new b("row lengths do not match");f=c,g++}p++}else if(n.substring(p,p+i.length)===i)p+=i.length,a[c]=!0,c++;else if(n.substring(p,p+s.length)===s)p+=s.length,a[c]=!1,c++;else throw new b("illegal character encountered: "+n.substring(p));if(c>f){if(d===-1)d=c-f;else if(c-f!==d)throw new b("row lengths do not match");g++}const v=new re(d,g);for(let A=0;A<c;A++)a[A]&&v.set(Math.floor(A%d),Math.floor(A/d));return v}get(n,i){const s=i*this.rowSize+Math.floor(n/32);return(this.bits[s]>>>(n&31)&1)!==0}set(n,i){const s=i*this.rowSize+Math.floor(n/32);this.bits[s]|=1<<(n&31)&4294967295}unset(n,i){const s=i*this.rowSize+Math.floor(n/32);this.bits[s]&=~(1<<(n&31)&4294967295)}flip(n,i){const s=i*this.rowSize+Math.floor(n/32);this.bits[s]^=1<<(n&31)&4294967295}xor(n){if(this.width!==n.getWidth()||this.height!==n.getHeight()||this.rowSize!==n.getRowSize())throw new b("input matrix dimensions do not match");const i=new L(Math.floor(this.width/32)+1),s=this.rowSize,a=this.bits;for(let c=0,f=this.height;c<f;c++){const d=c*s,g=n.getRow(c,i).getBitArray();for(let p=0;p<s;p++)a[d+p]^=g[p]}}clear(){const n=this.bits,i=n.length;for(let s=0;s<i;s++)n[s]=0}setRegion(n,i,s,a){if(i<0||n<0)throw new b("Left and top must be nonnegative");if(a<1||s<1)throw new b("Height and width must be at least 1");const c=n+s,f=i+a;if(f>this.height||c>this.width)throw new b("The region must fit inside the matrix");const d=this.rowSize,g=this.bits;for(let p=i;p<f;p++){const v=p*d;for(let A=n;A<c;A++)g[v+Math.floor(A/32)]|=1<<(A&31)&4294967295}}getRow(n,i){i==null||i.getSize()<this.width?i=new L(this.width):i.clear();const s=this.rowSize,a=this.bits,c=n*s;for(let f=0;f<s;f++)i.setBulk(f*32,a[c+f]);return i}setRow(n,i){D.arraycopy(i.getBitArray(),0,this.bits,n*this.rowSize,this.rowSize)}rotate180(){const n=this.getWidth(),i=this.getHeight();let s=new L(n),a=new L(n);for(let c=0,f=Math.floor((i+1)/2);c<f;c++)s=this.getRow(c,s),a=this.getRow(i-1-c,a),s.reverse(),a.reverse(),this.setRow(c,a),this.setRow(i-1-c,s)}getEnclosingRectangle(){const n=this.width,i=this.height,s=this.rowSize,a=this.bits;let c=n,f=i,d=-1,g=-1;for(let p=0;p<i;p++)for(let v=0;v<s;v++){const A=a[p*s+v];if(A!==0){if(p<f&&(f=p),p>g&&(g=p),v*32<c){let S=0;for(;!(A<<31-S&4294967295);)S++;v*32+S<c&&(c=v*32+S)}if(v*32+31>d){let S=31;for(;!(A>>>S);)S--;v*32+S>d&&(d=v*32+S)}}}return d<c||g<f?null:Int32Array.from([c,f,d-c+1,g-f+1])}getTopLeftOnBit(){const n=this.rowSize,i=this.bits;let s=0;for(;s<i.length&&i[s]===0;)s++;if(s===i.length)return null;const a=s/n;let c=s%n*32;const f=i[s];let d=0;for(;!(f<<31-d&4294967295);)d++;return c+=d,Int32Array.from([c,a])}getBottomRightOnBit(){const n=this.rowSize,i=this.bits;let s=i.length-1;for(;s>=0&&i[s]===0;)s--;if(s<0)return null;const a=Math.floor(s/n);let c=Math.floor(s%n)*32;const f=i[s];let d=31;for(;!(f>>>d);)d--;return c+=d,Int32Array.from([c,a])}getWidth(){return this.width}getHeight(){return this.height}getRowSize(){return this.rowSize}equals(n){if(!(n instanceof re))return!1;const i=n;return this.width===i.width&&this.height===i.height&&this.rowSize===i.rowSize&&I.equals(this.bits,i.bits)}hashCode(){let n=this.width;return n=31*n+this.width,n=31*n+this.height,n=31*n+this.rowSize,n=31*n+I.hashCode(this.bits),n}toString(n="X ",i=" ",s=`
474
+ `){return this.buildToString(n,i,s)}buildToString(n,i,s){let a=new xe;for(let c=0,f=this.height;c<f;c++){for(let d=0,g=this.width;d<g;d++)a.append(this.get(d,c)?n:i);a.append(s)}return a.toString()}clone(){return new re(this.width,this.height,this.rowSize,this.bits.slice())}}class z extends m{static getNotFoundInstance(){return new z}}z.kind="NotFoundException";class De extends k{constructor(n){super(n),this.luminances=De.EMPTY,this.buckets=new Int32Array(De.LUMINANCE_BUCKETS)}getBlackRow(n,i){const s=this.getLuminanceSource(),a=s.getWidth();i==null||i.getSize()<a?i=new L(a):i.clear(),this.initArrays(a);const c=s.getRow(n,this.luminances),f=this.buckets;for(let g=0;g<a;g++)f[(c[g]&255)>>De.LUMINANCE_SHIFT]++;const d=De.estimateBlackPoint(f);if(a<3)for(let g=0;g<a;g++)(c[g]&255)<d&&i.set(g);else{let g=c[0]&255,p=c[1]&255;for(let v=1;v<a-1;v++){const A=c[v+1]&255;(p*4-g-A)/2<d&&i.set(v),g=p,p=A}}return i}getBlackMatrix(){const n=this.getLuminanceSource(),i=n.getWidth(),s=n.getHeight(),a=new re(i,s);this.initArrays(i);const c=this.buckets;for(let g=1;g<5;g++){const p=Math.floor(s*g/5),v=n.getRow(p,this.luminances),A=Math.floor(i*4/5);for(let S=Math.floor(i/5);S<A;S++){const N=v[S]&255;c[N>>De.LUMINANCE_SHIFT]++}}const f=De.estimateBlackPoint(c),d=n.getMatrix();for(let g=0;g<s;g++){const p=g*i;for(let v=0;v<i;v++)(d[p+v]&255)<f&&a.set(v,g)}return a}createBinarizer(n){return new De(n)}initArrays(n){this.luminances.length<n&&(this.luminances=new Uint8ClampedArray(n));const i=this.buckets;for(let s=0;s<De.LUMINANCE_BUCKETS;s++)i[s]=0}static estimateBlackPoint(n){const i=n.length;let s=0,a=0,c=0;for(let v=0;v<i;v++)n[v]>c&&(a=v,c=n[v]),n[v]>s&&(s=n[v]);let f=0,d=0;for(let v=0;v<i;v++){const A=v-a,S=n[v]*A*A;S>d&&(f=v,d=S)}if(a>f){const v=a;a=f,f=v}if(f-a<=i/16)throw new z;let g=f-1,p=-1;for(let v=f-1;v>a;v--){const A=v-a,S=A*A*(f-v)*(s-n[v]);S>p&&(g=v,p=S)}return g<<De.LUMINANCE_SHIFT}}De.LUMINANCE_BITS=5,De.LUMINANCE_SHIFT=8-De.LUMINANCE_BITS,De.LUMINANCE_BUCKETS=1<<De.LUMINANCE_BITS,De.EMPTY=Uint8ClampedArray.from([0]);class pe extends De{constructor(n){super(n),this.matrix=null}getBlackMatrix(){if(this.matrix!==null)return this.matrix;const n=this.getLuminanceSource(),i=n.getWidth(),s=n.getHeight();if(i>=pe.MINIMUM_DIMENSION&&s>=pe.MINIMUM_DIMENSION){const a=n.getMatrix();let c=i>>pe.BLOCK_SIZE_POWER;i&pe.BLOCK_SIZE_MASK&&c++;let f=s>>pe.BLOCK_SIZE_POWER;s&pe.BLOCK_SIZE_MASK&&f++;const d=pe.calculateBlackPoints(a,c,f,i,s),g=new re(i,s);pe.calculateThresholdForBlock(a,c,f,i,s,d,g),this.matrix=g}else this.matrix=super.getBlackMatrix();return this.matrix}createBinarizer(n){return new pe(n)}static calculateThresholdForBlock(n,i,s,a,c,f,d){const g=c-pe.BLOCK_SIZE,p=a-pe.BLOCK_SIZE;for(let v=0;v<s;v++){let A=v<<pe.BLOCK_SIZE_POWER;A>g&&(A=g);const S=pe.cap(v,2,s-3);for(let N=0;N<i;N++){let P=N<<pe.BLOCK_SIZE_POWER;P>p&&(P=p);const B=pe.cap(N,2,i-3);let W=0;for(let J=-2;J<=2;J++){const ee=f[S+J];W+=ee[B-2]+ee[B-1]+ee[B]+ee[B+1]+ee[B+2]}const G=W/25;pe.thresholdBlock(n,P,A,G,a,d)}}}static cap(n,i,s){return n<i?i:n>s?s:n}static thresholdBlock(n,i,s,a,c,f){for(let d=0,g=s*c+i;d<pe.BLOCK_SIZE;d++,g+=c)for(let p=0;p<pe.BLOCK_SIZE;p++)(n[g+p]&255)<=a&&f.set(i+p,s+d)}static calculateBlackPoints(n,i,s,a,c){const f=c-pe.BLOCK_SIZE,d=a-pe.BLOCK_SIZE,g=new Array(s);for(let p=0;p<s;p++){g[p]=new Int32Array(i);let v=p<<pe.BLOCK_SIZE_POWER;v>f&&(v=f);for(let A=0;A<i;A++){let S=A<<pe.BLOCK_SIZE_POWER;S>d&&(S=d);let N=0,P=255,B=0;for(let G=0,J=v*a+S;G<pe.BLOCK_SIZE;G++,J+=a){for(let ee=0;ee<pe.BLOCK_SIZE;ee++){const Z=n[J+ee]&255;N+=Z,Z<P&&(P=Z),Z>B&&(B=Z)}if(B-P>pe.MIN_DYNAMIC_RANGE)for(G++,J+=a;G<pe.BLOCK_SIZE;G++,J+=a)for(let ee=0;ee<pe.BLOCK_SIZE;ee++)N+=n[J+ee]&255}let W=N>>pe.BLOCK_SIZE_POWER*2;if(B-P<=pe.MIN_DYNAMIC_RANGE&&(W=P/2,p>0&&A>0)){const G=(g[p-1][A]+2*g[p][A-1]+g[p-1][A-1])/4;P<G&&(W=G)}g[p][A]=W}}return g}}pe.BLOCK_SIZE_POWER=3,pe.BLOCK_SIZE=1<<pe.BLOCK_SIZE_POWER,pe.BLOCK_SIZE_MASK=pe.BLOCK_SIZE-1,pe.MINIMUM_DIMENSION=pe.BLOCK_SIZE*5,pe.MIN_DYNAMIC_RANGE=24;class ne{constructor(n,i){this.width=n,this.height=i}getWidth(){return this.width}getHeight(){return this.height}isCropSupported(){return!1}crop(n,i,s,a){throw new se("This luminance source does not support cropping.")}isRotateSupported(){return!1}rotateCounterClockwise(){throw new se("This luminance source does not support rotation by 90 degrees.")}rotateCounterClockwise45(){throw new se("This luminance source does not support rotation by 45 degrees.")}toString(){const n=new Uint8ClampedArray(this.width);let i=new xe;for(let s=0;s<this.height;s++){const a=this.getRow(s,n);for(let c=0;c<this.width;c++){const f=a[c]&255;let d;f<64?d="#":f<128?d="+":f<192?d=".":d=" ",i.append(d)}i.append(`
475
+ `)}return i.toString()}}class fe extends ne{constructor(n){super(n.getWidth(),n.getHeight()),this.delegate=n}getRow(n,i){const s=this.delegate.getRow(n,i),a=this.getWidth();for(let c=0;c<a;c++)s[c]=255-(s[c]&255);return s}getMatrix(){const n=this.delegate.getMatrix(),i=this.getWidth()*this.getHeight(),s=new Uint8ClampedArray(i);for(let a=0;a<i;a++)s[a]=255-(n[a]&255);return s}isCropSupported(){return this.delegate.isCropSupported()}crop(n,i,s,a){return new fe(this.delegate.crop(n,i,s,a))}isRotateSupported(){return this.delegate.isRotateSupported()}invert(){return this.delegate}rotateCounterClockwise(){return new fe(this.delegate.rotateCounterClockwise())}rotateCounterClockwise45(){return new fe(this.delegate.rotateCounterClockwise45())}}class he extends ne{constructor(n){super(n.width,n.height),this.canvas=n,this.tempCanvasElement=null,this.buffer=he.makeBufferFromCanvasImageData(n)}static makeBufferFromCanvasImageData(n){const i=n.getContext("2d").getImageData(0,0,n.width,n.height);return he.toGrayscaleBuffer(i.data,n.width,n.height)}static toGrayscaleBuffer(n,i,s){const a=new Uint8ClampedArray(i*s);for(let c=0,f=0,d=n.length;c<d;c+=4,f++){let g;if(n[c+3]===0)g=255;else{const v=n[c],A=n[c+1],S=n[c+2];g=306*v+601*A+117*S+512>>10}a[f]=g}return a}getRow(n,i){if(n<0||n>=this.getHeight())throw new b("Requested row is outside the image: "+n);const s=this.getWidth(),a=n*s;return i===null?i=this.buffer.slice(a,a+s):(i.length<s&&(i=new Uint8ClampedArray(s)),i.set(this.buffer.slice(a,a+s))),i}getMatrix(){return this.buffer}isCropSupported(){return!0}crop(n,i,s,a){return super.crop(n,i,s,a),this}isRotateSupported(){return!0}rotateCounterClockwise(){return this.rotate(-90),this}rotateCounterClockwise45(){return this.rotate(-45),this}getTempCanvasElement(){if(this.tempCanvasElement===null){const n=this.canvas.ownerDocument.createElement("canvas");n.width=this.canvas.width,n.height=this.canvas.height,this.tempCanvasElement=n}return this.tempCanvasElement}rotate(n){const i=this.getTempCanvasElement(),s=i.getContext("2d"),a=n*he.DEGREE_TO_RADIANS,c=this.canvas.width,f=this.canvas.height,d=Math.ceil(Math.abs(Math.cos(a))*c+Math.abs(Math.sin(a))*f),g=Math.ceil(Math.abs(Math.sin(a))*c+Math.abs(Math.cos(a))*f);return i.width=d,i.height=g,s.translate(d/2,g/2),s.rotate(a),s.drawImage(this.canvas,c/-2,f/-2),this.buffer=he.makeBufferFromCanvasImageData(i),this}invert(){return new fe(this)}}he.DEGREE_TO_RADIANS=Math.PI/180;class Pe{constructor(n,i,s){this.deviceId=n,this.label=i,this.kind="videoinput",this.groupId=s||void 0}toJSON(){return{kind:this.kind,groupId:this.groupId,deviceId:this.deviceId,label:this.label}}}var Te=(globalThis||mn||self||window||void 0)&&(globalThis||mn||self||window||void 0).__awaiter||function(E,n,i,s){function a(c){return c instanceof i?c:new i(function(f){f(c)})}return new(i||(i=Promise))(function(c,f){function d(v){try{p(s.next(v))}catch(A){f(A)}}function g(v){try{p(s.throw(v))}catch(A){f(A)}}function p(v){v.done?c(v.value):a(v.value).then(d,g)}p((s=s.apply(E,n||[])).next())})};class Er{constructor(n,i=500,s){this.reader=n,this.timeBetweenScansMillis=i,this._hints=s,this._stopContinuousDecode=!1,this._stopAsyncDecode=!1,this._timeBetweenDecodingAttempts=0}get hasNavigator(){return typeof navigator<"u"}get isMediaDevicesSuported(){return this.hasNavigator&&!!navigator.mediaDevices}get canEnumerateDevices(){return!!(this.isMediaDevicesSuported&&navigator.mediaDevices.enumerateDevices)}get timeBetweenDecodingAttempts(){return this._timeBetweenDecodingAttempts}set timeBetweenDecodingAttempts(n){this._timeBetweenDecodingAttempts=n<0?0:n}set hints(n){this._hints=n||null}get hints(){return this._hints}listVideoInputDevices(){return Te(this,void 0,void 0,function*(){if(!this.hasNavigator)throw new Error("Can't enumerate devices, navigator is not present.");if(!this.canEnumerateDevices)throw new Error("Can't enumerate devices, method not supported.");const n=yield navigator.mediaDevices.enumerateDevices(),i=[];for(const s of n){const a=s.kind==="video"?"videoinput":s.kind;if(a!=="videoinput")continue;const c=s.deviceId||s.id,f=s.label||`Video device ${i.length+1}`,d=s.groupId,g={deviceId:c,label:f,kind:a,groupId:d};i.push(g)}return i})}getVideoInputDevices(){return Te(this,void 0,void 0,function*(){return(yield this.listVideoInputDevices()).map(i=>new Pe(i.deviceId,i.label))})}findDeviceById(n){return Te(this,void 0,void 0,function*(){const i=yield this.listVideoInputDevices();return i?i.find(s=>s.deviceId===n):null})}decodeFromInputVideoDevice(n,i){return Te(this,void 0,void 0,function*(){return yield this.decodeOnceFromVideoDevice(n,i)})}decodeOnceFromVideoDevice(n,i){return Te(this,void 0,void 0,function*(){this.reset();let s;n?s={deviceId:{exact:n}}:s={facingMode:"environment"};const a={video:s};return yield this.decodeOnceFromConstraints(a,i)})}decodeOnceFromConstraints(n,i){return Te(this,void 0,void 0,function*(){const s=yield navigator.mediaDevices.getUserMedia(n);return yield this.decodeOnceFromStream(s,i)})}decodeOnceFromStream(n,i){return Te(this,void 0,void 0,function*(){this.reset();const s=yield this.attachStreamToVideo(n,i);return yield this.decodeOnce(s)})}decodeFromInputVideoDeviceContinuously(n,i,s){return Te(this,void 0,void 0,function*(){return yield this.decodeFromVideoDevice(n,i,s)})}decodeFromVideoDevice(n,i,s){return Te(this,void 0,void 0,function*(){let a;n?a={deviceId:{exact:n}}:a={facingMode:"environment"};const c={video:a};return yield this.decodeFromConstraints(c,i,s)})}decodeFromConstraints(n,i,s){return Te(this,void 0,void 0,function*(){const a=yield navigator.mediaDevices.getUserMedia(n);return yield this.decodeFromStream(a,i,s)})}decodeFromStream(n,i,s){return Te(this,void 0,void 0,function*(){this.reset();const a=yield this.attachStreamToVideo(n,i);return yield this.decodeContinuously(a,s)})}stopAsyncDecode(){this._stopAsyncDecode=!0}stopContinuousDecode(){this._stopContinuousDecode=!0}attachStreamToVideo(n,i){return Te(this,void 0,void 0,function*(){const s=this.prepareVideoElement(i);return this.addVideoSource(s,n),this.videoElement=s,this.stream=n,yield this.playVideoOnLoadAsync(s),s})}playVideoOnLoadAsync(n){return new Promise((i,s)=>this.playVideoOnLoad(n,()=>i()))}playVideoOnLoad(n,i){this.videoEndedListener=()=>this.stopStreams(),this.videoCanPlayListener=()=>this.tryPlayVideo(n),n.addEventListener("ended",this.videoEndedListener),n.addEventListener("canplay",this.videoCanPlayListener),n.addEventListener("playing",i),this.tryPlayVideo(n)}isVideoPlaying(n){return n.currentTime>0&&!n.paused&&!n.ended&&n.readyState>2}tryPlayVideo(n){return Te(this,void 0,void 0,function*(){if(this.isVideoPlaying(n)){console.warn("Trying to play video that is already playing.");return}try{yield n.play()}catch{console.warn("It was not possible to play the video.")}})}getMediaElement(n,i){const s=document.getElementById(n);if(!s)throw new y(`element with id '${n}' not found`);if(s.nodeName.toLowerCase()!==i.toLowerCase())throw new y(`element with id '${n}' must be an ${i} element`);return s}decodeFromImage(n,i){if(!n&&!i)throw new y("either imageElement with a src set or an url must be provided");return i&&!n?this.decodeFromImageUrl(i):this.decodeFromImageElement(n)}decodeFromVideo(n,i){if(!n&&!i)throw new y("Either an element with a src set or an URL must be provided");return i&&!n?this.decodeFromVideoUrl(i):this.decodeFromVideoElement(n)}decodeFromVideoContinuously(n,i,s){if(n===void 0&&i===void 0)throw new y("Either an element with a src set or an URL must be provided");return i&&!n?this.decodeFromVideoUrlContinuously(i,s):this.decodeFromVideoElementContinuously(n,s)}decodeFromImageElement(n){if(!n)throw new y("An image element must be provided.");this.reset();const i=this.prepareImageElement(n);this.imageElement=i;let s;return this.isImageLoaded(i)?s=this.decodeOnce(i,!1,!0):s=this._decodeOnLoadImage(i),s}decodeFromVideoElement(n){const i=this._decodeFromVideoElementSetup(n);return this._decodeOnLoadVideo(i)}decodeFromVideoElementContinuously(n,i){const s=this._decodeFromVideoElementSetup(n);return this._decodeOnLoadVideoContinuously(s,i)}_decodeFromVideoElementSetup(n){if(!n)throw new y("A video element must be provided.");this.reset();const i=this.prepareVideoElement(n);return this.videoElement=i,i}decodeFromImageUrl(n){if(!n)throw new y("An URL must be provided.");this.reset();const i=this.prepareImageElement();this.imageElement=i;const s=this._decodeOnLoadImage(i);return i.src=n,s}decodeFromVideoUrl(n){if(!n)throw new y("An URL must be provided.");this.reset();const i=this.prepareVideoElement(),s=this.decodeFromVideoElement(i);return i.src=n,s}decodeFromVideoUrlContinuously(n,i){if(!n)throw new y("An URL must be provided.");this.reset();const s=this.prepareVideoElement(),a=this.decodeFromVideoElementContinuously(s,i);return s.src=n,a}_decodeOnLoadImage(n){return new Promise((i,s)=>{this.imageLoadedListener=()=>this.decodeOnce(n,!1,!0).then(i,s),n.addEventListener("load",this.imageLoadedListener)})}_decodeOnLoadVideo(n){return Te(this,void 0,void 0,function*(){return yield this.playVideoOnLoadAsync(n),yield this.decodeOnce(n)})}_decodeOnLoadVideoContinuously(n,i){return Te(this,void 0,void 0,function*(){yield this.playVideoOnLoadAsync(n),this.decodeContinuously(n,i)})}isImageLoaded(n){return!(!n.complete||n.naturalWidth===0)}prepareImageElement(n){let i;return typeof n>"u"&&(i=document.createElement("img"),i.width=200,i.height=200),typeof n=="string"&&(i=this.getMediaElement(n,"img")),n instanceof HTMLImageElement&&(i=n),i}prepareVideoElement(n){let i;return!n&&typeof document<"u"&&(i=document.createElement("video"),i.width=200,i.height=200),typeof n=="string"&&(i=this.getMediaElement(n,"video")),n instanceof HTMLVideoElement&&(i=n),i.setAttribute("autoplay","true"),i.setAttribute("muted","true"),i.setAttribute("playsinline","true"),i}decodeOnce(n,i=!0,s=!0){this._stopAsyncDecode=!1;const a=(c,f)=>{if(this._stopAsyncDecode){f(new z("Video stream has ended before any code could be detected.")),this._stopAsyncDecode=void 0;return}try{const d=this.decode(n);c(d)}catch(d){const g=i&&d instanceof z,v=(d instanceof T||d instanceof F)&&s;if(g||v)return setTimeout(a,this._timeBetweenDecodingAttempts,c,f);f(d)}};return new Promise((c,f)=>a(c,f))}decodeContinuously(n,i){this._stopContinuousDecode=!1;const s=()=>{if(this._stopContinuousDecode){this._stopContinuousDecode=void 0;return}try{const a=this.decode(n);i(a,null),setTimeout(s,this.timeBetweenScansMillis)}catch(a){i(null,a);const c=a instanceof T||a instanceof F,f=a instanceof z;(c||f)&&setTimeout(s,this._timeBetweenDecodingAttempts)}};s()}decode(n){const i=this.createBinaryBitmap(n);return this.decodeBitmap(i)}_isHTMLVideoElement(n){return n.videoWidth!==0}drawFrameOnCanvas(n,i,s){i||(i={sx:0,sy:0,sWidth:n.videoWidth,sHeight:n.videoHeight,dx:0,dy:0,dWidth:n.videoWidth,dHeight:n.videoHeight}),s||(s=this.captureCanvasContext),s.drawImage(n,i.sx,i.sy,i.sWidth,i.sHeight,i.dx,i.dy,i.dWidth,i.dHeight)}drawImageOnCanvas(n,i,s=this.captureCanvasContext){i||(i={sx:0,sy:0,sWidth:n.naturalWidth,sHeight:n.naturalHeight,dx:0,dy:0,dWidth:n.naturalWidth,dHeight:n.naturalHeight}),s||(s=this.captureCanvasContext),s.drawImage(n,i.sx,i.sy,i.sWidth,i.sHeight,i.dx,i.dy,i.dWidth,i.dHeight)}createBinaryBitmap(n){this.getCaptureCanvasContext(n),this._isHTMLVideoElement(n)?this.drawFrameOnCanvas(n):this.drawImageOnCanvas(n);const i=this.getCaptureCanvas(n),s=new he(i),a=new pe(s);return new C(a)}getCaptureCanvasContext(n){if(!this.captureCanvasContext){const s=this.getCaptureCanvas(n).getContext("2d");this.captureCanvasContext=s}return this.captureCanvasContext}getCaptureCanvas(n){if(!this.captureCanvas){const i=this.createCaptureCanvas(n);this.captureCanvas=i}return this.captureCanvas}decodeBitmap(n){return this.reader.decode(n,this._hints)}createCaptureCanvas(n){if(typeof document>"u")return this._destroyCaptureCanvas(),null;const i=document.createElement("canvas");let s,a;return typeof n<"u"&&(n instanceof HTMLVideoElement?(s=n.videoWidth,a=n.videoHeight):n instanceof HTMLImageElement&&(s=n.naturalWidth||n.width,a=n.naturalHeight||n.height)),i.style.width=s+"px",i.style.height=a+"px",i.width=s,i.height=a,i}stopStreams(){this.stream&&(this.stream.getVideoTracks().forEach(n=>n.stop()),this.stream=void 0),this._stopAsyncDecode===!1&&this.stopAsyncDecode(),this._stopContinuousDecode===!1&&this.stopContinuousDecode()}reset(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()}_destroyVideoElement(){this.videoElement&&(typeof this.videoEndedListener<"u"&&this.videoElement.removeEventListener("ended",this.videoEndedListener),typeof this.videoPlayingEventListener<"u"&&this.videoElement.removeEventListener("playing",this.videoPlayingEventListener),typeof this.videoCanPlayListener<"u"&&this.videoElement.removeEventListener("loadedmetadata",this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),this.videoElement=void 0)}_destroyImageElement(){this.imageElement&&(this.imageLoadedListener!==void 0&&this.imageElement.removeEventListener("load",this.imageLoadedListener),this.imageElement.src=void 0,this.imageElement.removeAttribute("src"),this.imageElement=void 0)}_destroyCaptureCanvas(){this.captureCanvasContext=void 0,this.captureCanvas=void 0}addVideoSource(n,i){try{n.srcObject=i}catch{n.src=URL.createObjectURL(i)}}cleanVideoSource(n){try{n.srcObject=null}catch{n.src=""}this.videoElement.removeAttribute("src")}}class Qe{constructor(n,i,s=i==null?0:8*i.length,a,c,f=D.currentTimeMillis()){this.text=n,this.rawBytes=i,this.numBits=s,this.resultPoints=a,this.format=c,this.timestamp=f,this.text=n,this.rawBytes=i,s==null?this.numBits=i==null?0:8*i.length:this.numBits=s,this.resultPoints=a,this.format=c,this.resultMetadata=null,f==null?this.timestamp=D.currentTimeMillis():this.timestamp=f}getText(){return this.text}getRawBytes(){return this.rawBytes}getNumBits(){return this.numBits}getResultPoints(){return this.resultPoints}getBarcodeFormat(){return this.format}getResultMetadata(){return this.resultMetadata}putMetadata(n,i){this.resultMetadata===null&&(this.resultMetadata=new Map),this.resultMetadata.set(n,i)}putAllMetadata(n){n!==null&&(this.resultMetadata===null?this.resultMetadata=n:this.resultMetadata=new Map(n))}addResultPoints(n){const i=this.resultPoints;if(i===null)this.resultPoints=n;else if(n!==null&&n.length>0){const s=new Array(i.length+n.length);D.arraycopy(i,0,s,0,i.length),D.arraycopy(n,0,s,i.length,n.length),this.resultPoints=s}}getTimestamp(){return this.timestamp}toString(){return this.text}}var ai;(function(E){E[E.AZTEC=0]="AZTEC",E[E.CODABAR=1]="CODABAR",E[E.CODE_39=2]="CODE_39",E[E.CODE_93=3]="CODE_93",E[E.CODE_128=4]="CODE_128",E[E.DATA_MATRIX=5]="DATA_MATRIX",E[E.EAN_8=6]="EAN_8",E[E.EAN_13=7]="EAN_13",E[E.ITF=8]="ITF",E[E.MAXICODE=9]="MAXICODE",E[E.PDF_417=10]="PDF_417",E[E.QR_CODE=11]="QR_CODE",E[E.RSS_14=12]="RSS_14",E[E.RSS_EXPANDED=13]="RSS_EXPANDED",E[E.UPC_A=14]="UPC_A",E[E.UPC_E=15]="UPC_E",E[E.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"})(ai||(ai={}));var ue=ai,_n;(function(E){E[E.OTHER=0]="OTHER",E[E.ORIENTATION=1]="ORIENTATION",E[E.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",E[E.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",E[E.ISSUE_NUMBER=4]="ISSUE_NUMBER",E[E.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",E[E.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",E[E.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",E[E.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",E[E.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",E[E.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY"})(_n||(_n={}));var Ct=_n;class js{constructor(n,i,s,a,c=-1,f=-1){this.rawBytes=n,this.text=i,this.byteSegments=s,this.ecLevel=a,this.structuredAppendSequenceNumber=c,this.structuredAppendParity=f,this.numBits=n==null?0:8*n.length}getRawBytes(){return this.rawBytes}getNumBits(){return this.numBits}setNumBits(n){this.numBits=n}getText(){return this.text}getByteSegments(){return this.byteSegments}getECLevel(){return this.ecLevel}getErrorsCorrected(){return this.errorsCorrected}setErrorsCorrected(n){this.errorsCorrected=n}getErasures(){return this.erasures}setErasures(n){this.erasures=n}getOther(){return this.other}setOther(n){this.other=n}hasStructuredAppend(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0}getStructuredAppendParity(){return this.structuredAppendParity}getStructuredAppendSequenceNumber(){return this.structuredAppendSequenceNumber}}class Ws{exp(n){return this.expTable[n]}log(n){if(n===0)throw new b;return this.logTable[n]}static addOrSubtract(n,i){return n^i}}class Qt{constructor(n,i){if(i.length===0)throw new b;this.field=n;const s=i.length;if(s>1&&i[0]===0){let a=1;for(;a<s&&i[a]===0;)a++;a===s?this.coefficients=Int32Array.from([0]):(this.coefficients=new Int32Array(s-a),D.arraycopy(i,a,this.coefficients,0,this.coefficients.length))}else this.coefficients=i}getCoefficients(){return this.coefficients}getDegree(){return this.coefficients.length-1}isZero(){return this.coefficients[0]===0}getCoefficient(n){return this.coefficients[this.coefficients.length-1-n]}evaluateAt(n){if(n===0)return this.getCoefficient(0);const i=this.coefficients;let s;if(n===1){s=0;for(let f=0,d=i.length;f!==d;f++){const g=i[f];s=Ws.addOrSubtract(s,g)}return s}s=i[0];const a=i.length,c=this.field;for(let f=1;f<a;f++)s=Ws.addOrSubtract(c.multiply(n,s),i[f]);return s}addOrSubtract(n){if(!this.field.equals(n.field))throw new b("GenericGFPolys do not have same GenericGF field");if(this.isZero())return n;if(n.isZero())return this;let i=this.coefficients,s=n.coefficients;if(i.length>s.length){const f=i;i=s,s=f}let a=new Int32Array(s.length);const c=s.length-i.length;D.arraycopy(s,0,a,0,c);for(let f=c;f<s.length;f++)a[f]=Ws.addOrSubtract(i[f-c],s[f]);return new Qt(this.field,a)}multiply(n){if(!this.field.equals(n.field))throw new b("GenericGFPolys do not have same GenericGF field");if(this.isZero()||n.isZero())return this.field.getZero();const i=this.coefficients,s=i.length,a=n.coefficients,c=a.length,f=new Int32Array(s+c-1),d=this.field;for(let g=0;g<s;g++){const p=i[g];for(let v=0;v<c;v++)f[g+v]=Ws.addOrSubtract(f[g+v],d.multiply(p,a[v]))}return new Qt(d,f)}multiplyScalar(n){if(n===0)return this.field.getZero();if(n===1)return this;const i=this.coefficients.length,s=this.field,a=new Int32Array(i),c=this.coefficients;for(let f=0;f<i;f++)a[f]=s.multiply(c[f],n);return new Qt(s,a)}multiplyByMonomial(n,i){if(n<0)throw new b;if(i===0)return this.field.getZero();const s=this.coefficients,a=s.length,c=new Int32Array(a+n),f=this.field;for(let d=0;d<a;d++)c[d]=f.multiply(s[d],i);return new Qt(f,c)}divide(n){if(!this.field.equals(n.field))throw new b("GenericGFPolys do not have same GenericGF field");if(n.isZero())throw new b("Divide by 0");const i=this.field;let s=i.getZero(),a=this;const c=n.getCoefficient(n.getDegree()),f=i.inverse(c);for(;a.getDegree()>=n.getDegree()&&!a.isZero();){const d=a.getDegree()-n.getDegree(),g=i.multiply(a.getCoefficient(a.getDegree()),f),p=n.multiplyByMonomial(d,g),v=i.buildMonomial(d,g);s=s.addOrSubtract(v),a=a.addOrSubtract(p)}return[s,a]}toString(){let n="";for(let i=this.getDegree();i>=0;i--){let s=this.getCoefficient(i);if(s!==0){if(s<0?(n+=" - ",s=-s):n.length>0&&(n+=" + "),i===0||s!==1){const a=this.field.log(s);a===0?n+="1":a===1?n+="a":(n+="a^",n+=a)}i!==0&&(i===1?n+="x":(n+="x^",n+=i))}}return n}}class va extends m{}va.kind="ArithmeticException";class Oe extends Ws{constructor(n,i,s){super(),this.primitive=n,this.size=i,this.generatorBase=s;const a=new Int32Array(i);let c=1;for(let d=0;d<i;d++)a[d]=c,c*=2,c>=i&&(c^=n,c&=i-1);this.expTable=a;const f=new Int32Array(i);for(let d=0;d<i-1;d++)f[a[d]]=d;this.logTable=f,this.zero=new Qt(this,Int32Array.from([0])),this.one=new Qt(this,Int32Array.from([1]))}getZero(){return this.zero}getOne(){return this.one}buildMonomial(n,i){if(n<0)throw new b;if(i===0)return this.zero;const s=new Int32Array(n+1);return s[0]=i,new Qt(this,s)}inverse(n){if(n===0)throw new va;return this.expTable[this.size-this.logTable[n]-1]}multiply(n,i){return n===0||i===0?0:this.expTable[(this.logTable[n]+this.logTable[i])%(this.size-1)]}getSize(){return this.size}getGeneratorBase(){return this.generatorBase}toString(){return"GF(0x"+_.toHexString(this.primitive)+","+this.size+")"}equals(n){return n===this}}Oe.AZTEC_DATA_12=new Oe(4201,4096,1),Oe.AZTEC_DATA_10=new Oe(1033,1024,1),Oe.AZTEC_DATA_6=new Oe(67,64,1),Oe.AZTEC_PARAM=new Oe(19,16,1),Oe.QR_CODE_FIELD_256=new Oe(285,256,0),Oe.DATA_MATRIX_FIELD_256=new Oe(301,256,1),Oe.AZTEC_DATA_8=Oe.DATA_MATRIX_FIELD_256,Oe.MAXICODE_FIELD_64=Oe.AZTEC_DATA_6;class ji extends m{}ji.kind="ReedSolomonException";class Xr extends m{}Xr.kind="IllegalStateException";class Vs{constructor(n){this.field=n}decode(n,i){const s=this.field,a=new Qt(s,n),c=new Int32Array(i);let f=!0;for(let N=0;N<i;N++){const P=a.evaluateAt(s.exp(N+s.getGeneratorBase()));c[c.length-1-N]=P,P!==0&&(f=!1)}if(f)return;const d=new Qt(s,c),g=this.runEuclideanAlgorithm(s.buildMonomial(i,1),d,i),p=g[0],v=g[1],A=this.findErrorLocations(p),S=this.findErrorMagnitudes(v,A);for(let N=0;N<A.length;N++){const P=n.length-1-s.log(A[N]);if(P<0)throw new ji("Bad error location");n[P]=Oe.addOrSubtract(n[P],S[N])}}runEuclideanAlgorithm(n,i,s){if(n.getDegree()<i.getDegree()){const N=n;n=i,i=N}const a=this.field;let c=n,f=i,d=a.getZero(),g=a.getOne();for(;f.getDegree()>=(s/2|0);){let N=c,P=d;if(c=f,d=g,c.isZero())throw new ji("r_{i-1} was zero");f=N;let B=a.getZero();const W=c.getCoefficient(c.getDegree()),G=a.inverse(W);for(;f.getDegree()>=c.getDegree()&&!f.isZero();){const J=f.getDegree()-c.getDegree(),ee=a.multiply(f.getCoefficient(f.getDegree()),G);B=B.addOrSubtract(a.buildMonomial(J,ee)),f=f.addOrSubtract(c.multiplyByMonomial(J,ee))}if(g=B.multiply(d).addOrSubtract(P),f.getDegree()>=c.getDegree())throw new Xr("Division algorithm failed to reduce polynomial?")}const p=g.getCoefficient(0);if(p===0)throw new ji("sigmaTilde(0) was zero");const v=a.inverse(p),A=g.multiplyScalar(v),S=f.multiplyScalar(v);return[A,S]}findErrorLocations(n){const i=n.getDegree();if(i===1)return Int32Array.from([n.getCoefficient(1)]);const s=new Int32Array(i);let a=0;const c=this.field;for(let f=1;f<c.getSize()&&a<i;f++)n.evaluateAt(f)===0&&(s[a]=c.inverse(f),a++);if(a!==i)throw new ji("Error locator degree does not match number of roots");return s}findErrorMagnitudes(n,i){const s=i.length,a=new Int32Array(s),c=this.field;for(let f=0;f<s;f++){const d=c.inverse(i[f]);let g=1;for(let p=0;p<s;p++)if(f!==p){const v=c.multiply(i[p],d),A=v&1?v&-2:v|1;g=c.multiply(g,A)}a[f]=c.multiply(n.evaluateAt(d),c.inverse(g)),c.getGeneratorBase()!==0&&(a[f]=c.multiply(a[f],d))}return a}}var _t;(function(E){E[E.UPPER=0]="UPPER",E[E.LOWER=1]="LOWER",E[E.MIXED=2]="MIXED",E[E.DIGIT=3]="DIGIT",E[E.PUNCT=4]="PUNCT",E[E.BINARY=5]="BINARY"})(_t||(_t={}));class Ve{decode(n){this.ddata=n;let i=n.getBits(),s=this.extractBits(i),a=this.correctBits(s),c=Ve.convertBoolArrayToByteArray(a),f=Ve.getEncodedData(a),d=new js(c,f,null,null);return d.setNumBits(a.length),d}static highLevelDecode(n){return this.getEncodedData(n)}static getEncodedData(n){let i=n.length,s=_t.UPPER,a=_t.UPPER,c="",f=0;for(;f<i;)if(a===_t.BINARY){if(i-f<5)break;let d=Ve.readCode(n,f,5);if(f+=5,d===0){if(i-f<11)break;d=Ve.readCode(n,f,11)+31,f+=11}for(let g=0;g<d;g++){if(i-f<8){f=i;break}const p=Ve.readCode(n,f,8);c+=Q.castAsNonUtf8Char(p),f+=8}a=s}else{let d=a===_t.DIGIT?4:5;if(i-f<d)break;let g=Ve.readCode(n,f,d);f+=d;let p=Ve.getCharacter(a,g);p.startsWith("CTRL_")?(s=a,a=Ve.getTable(p.charAt(5)),p.charAt(6)==="L"&&(s=a)):(c+=p,a=s)}return c}static getTable(n){switch(n){case"L":return _t.LOWER;case"P":return _t.PUNCT;case"M":return _t.MIXED;case"D":return _t.DIGIT;case"B":return _t.BINARY;case"U":default:return _t.UPPER}}static getCharacter(n,i){switch(n){case _t.UPPER:return Ve.UPPER_TABLE[i];case _t.LOWER:return Ve.LOWER_TABLE[i];case _t.MIXED:return Ve.MIXED_TABLE[i];case _t.PUNCT:return Ve.PUNCT_TABLE[i];case _t.DIGIT:return Ve.DIGIT_TABLE[i];default:throw new Xr("Bad table")}}correctBits(n){let i,s;this.ddata.getNbLayers()<=2?(s=6,i=Oe.AZTEC_DATA_6):this.ddata.getNbLayers()<=8?(s=8,i=Oe.AZTEC_DATA_8):this.ddata.getNbLayers()<=22?(s=10,i=Oe.AZTEC_DATA_10):(s=12,i=Oe.AZTEC_DATA_12);let a=this.ddata.getNbDatablocks(),c=n.length/s;if(c<a)throw new F;let f=n.length%s,d=new Int32Array(c);for(let S=0;S<c;S++,f+=s)d[S]=Ve.readCode(n,f,s);try{new Vs(i).decode(d,c-a)}catch(S){throw new F(S)}let g=(1<<s)-1,p=0;for(let S=0;S<a;S++){let N=d[S];if(N===0||N===g)throw new F;(N===1||N===g-1)&&p++}let v=new Array(a*s-p),A=0;for(let S=0;S<a;S++){let N=d[S];if(N===1||N===g-1)v.fill(N>1,A,A+s-1),A+=s-1;else for(let P=s-1;P>=0;--P)v[A++]=(N&1<<P)!==0}return v}extractBits(n){let i=this.ddata.isCompact(),s=this.ddata.getNbLayers(),a=(i?11:14)+s*4,c=new Int32Array(a),f=new Array(this.totalBitsInLayer(s,i));if(i)for(let d=0;d<c.length;d++)c[d]=d;else{let d=a+1+2*_.truncDivision(_.truncDivision(a,2)-1,15),g=a/2,p=_.truncDivision(d,2);for(let v=0;v<g;v++){let A=v+_.truncDivision(v,15);c[g-v-1]=p-A-1,c[g+v]=p+A+1}}for(let d=0,g=0;d<s;d++){let p=(s-d)*4+(i?9:12),v=d*2,A=a-1-v;for(let S=0;S<p;S++){let N=S*2;for(let P=0;P<2;P++)f[g+N+P]=n.get(c[v+P],c[v+S]),f[g+2*p+N+P]=n.get(c[v+S],c[A-P]),f[g+4*p+N+P]=n.get(c[A-P],c[A-S]),f[g+6*p+N+P]=n.get(c[A-S],c[v+P])}g+=p*8}return f}static readCode(n,i,s){let a=0;for(let c=i;c<i+s;c++)a<<=1,n[c]&&(a|=1);return a}static readByte(n,i){let s=n.length-i;return s>=8?Ve.readCode(n,i,8):Ve.readCode(n,i,s)<<8-s}static convertBoolArrayToByteArray(n){let i=new Uint8Array((n.length+7)/8);for(let s=0;s<i.length;s++)i[s]=Ve.readByte(n,8*s);return i}totalBitsInLayer(n,i){return((i?88:112)+16*n)*n}}Ve.UPPER_TABLE=["CTRL_PS"," ","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","CTRL_LL","CTRL_ML","CTRL_DL","CTRL_BS"],Ve.LOWER_TABLE=["CTRL_PS"," ","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","CTRL_US","CTRL_ML","CTRL_DL","CTRL_BS"],Ve.MIXED_TABLE=["CTRL_PS"," ","\\1","\\2","\\3","\\4","\\5","\\6","\\7","\b"," ",`
476
+ `,"\\13","\f","\r","\\33","\\34","\\35","\\36","\\37","@","\\","^","_","`","|","~","\\177","CTRL_LL","CTRL_UL","CTRL_PL","CTRL_BS"],Ve.PUNCT_TABLE=["","\r",`\r
477
+ `,". ",", ",": ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}","CTRL_UL"],Ve.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"];class Re{constructor(){}static round(n){return n===NaN?0:n<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:n>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:n+(n<0?-.5:.5)|0}static distance(n,i,s,a){const c=n-s,f=i-a;return Math.sqrt(c*c+f*f)}static sum(n){let i=0;for(let s=0,a=n.length;s!==a;s++){const c=n[s];i+=c}return i}}class ya{static floatToIntBits(n){return n}}ya.MAX_VALUE=Number.MAX_SAFE_INTEGER;class ce{constructor(n,i){this.x=n,this.y=i}getX(){return this.x}getY(){return this.y}equals(n){if(n instanceof ce){const i=n;return this.x===i.x&&this.y===i.y}return!1}hashCode(){return 31*ya.floatToIntBits(this.x)+ya.floatToIntBits(this.y)}toString(){return"("+this.x+","+this.y+")"}static orderBestPatterns(n){const i=this.distance(n[0],n[1]),s=this.distance(n[1],n[2]),a=this.distance(n[0],n[2]);let c,f,d;if(s>=i&&s>=a?(f=n[0],c=n[1],d=n[2]):a>=s&&a>=i?(f=n[1],c=n[0],d=n[2]):(f=n[2],c=n[0],d=n[1]),this.crossProductZ(c,f,d)<0){const g=c;c=d,d=g}n[0]=c,n[1]=f,n[2]=d}static distance(n,i){return Re.distance(n.x,n.y,i.x,i.y)}static crossProductZ(n,i,s){const a=i.x,c=i.y;return(s.x-a)*(n.y-c)-(s.y-c)*(n.x-a)}}class Ea{constructor(n,i){this.bits=n,this.points=i}getBits(){return this.bits}getPoints(){return this.points}}class eh extends Ea{constructor(n,i,s,a,c){super(n,i),this.compact=s,this.nbDatablocks=a,this.nbLayers=c}getNbLayers(){return this.nbLayers}getNbDatablocks(){return this.nbDatablocks}isCompact(){return this.compact}}class fn{constructor(n,i,s,a){this.image=n,this.height=n.getHeight(),this.width=n.getWidth(),i==null&&(i=fn.INIT_SIZE),s==null&&(s=n.getWidth()/2|0),a==null&&(a=n.getHeight()/2|0);const c=i/2|0;if(this.leftInit=s-c,this.rightInit=s+c,this.upInit=a-c,this.downInit=a+c,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new z}detect(){let n=this.leftInit,i=this.rightInit,s=this.upInit,a=this.downInit,c=!1,f=!0,d=!1,g=!1,p=!1,v=!1,A=!1;const S=this.width,N=this.height;for(;f;){f=!1;let P=!0;for(;(P||!g)&&i<S;)P=this.containsBlackPoint(s,a,i,!1),P?(i++,f=!0,g=!0):g||i++;if(i>=S){c=!0;break}let B=!0;for(;(B||!p)&&a<N;)B=this.containsBlackPoint(n,i,a,!0),B?(a++,f=!0,p=!0):p||a++;if(a>=N){c=!0;break}let W=!0;for(;(W||!v)&&n>=0;)W=this.containsBlackPoint(s,a,n,!1),W?(n--,f=!0,v=!0):v||n--;if(n<0){c=!0;break}let G=!0;for(;(G||!A)&&s>=0;)G=this.containsBlackPoint(n,i,s,!0),G?(s--,f=!0,A=!0):A||s--;if(s<0){c=!0;break}f&&(d=!0)}if(!c&&d){const P=i-n;let B=null;for(let ee=1;B===null&&ee<P;ee++)B=this.getBlackPointOnSegment(n,a-ee,n+ee,a);if(B==null)throw new z;let W=null;for(let ee=1;W===null&&ee<P;ee++)W=this.getBlackPointOnSegment(n,s+ee,n+ee,s);if(W==null)throw new z;let G=null;for(let ee=1;G===null&&ee<P;ee++)G=this.getBlackPointOnSegment(i,s+ee,i-ee,s);if(G==null)throw new z;let J=null;for(let ee=1;J===null&&ee<P;ee++)J=this.getBlackPointOnSegment(i,a-ee,i-ee,a);if(J==null)throw new z;return this.centerEdges(J,B,G,W)}else throw new z}getBlackPointOnSegment(n,i,s,a){const c=Re.round(Re.distance(n,i,s,a)),f=(s-n)/c,d=(a-i)/c,g=this.image;for(let p=0;p<c;p++){const v=Re.round(n+p*f),A=Re.round(i+p*d);if(g.get(v,A))return new ce(v,A)}return null}centerEdges(n,i,s,a){const c=n.getX(),f=n.getY(),d=i.getX(),g=i.getY(),p=s.getX(),v=s.getY(),A=a.getX(),S=a.getY(),N=fn.CORR;return c<this.width/2?[new ce(A-N,S+N),new ce(d+N,g+N),new ce(p-N,v-N),new ce(c+N,f-N)]:[new ce(A+N,S+N),new ce(d+N,g-N),new ce(p-N,v+N),new ce(c-N,f-N)]}containsBlackPoint(n,i,s,a){const c=this.image;if(a){for(let f=n;f<=i;f++)if(c.get(f,s))return!0}else for(let f=n;f<=i;f++)if(c.get(s,f))return!0;return!1}}fn.INIT_SIZE=10,fn.CORR=1;class ru{static checkAndNudgePoints(n,i){const s=n.getWidth(),a=n.getHeight();let c=!0;for(let f=0;f<i.length&&c;f+=2){const d=Math.floor(i[f]),g=Math.floor(i[f+1]);if(d<-1||d>s||g<-1||g>a)throw new z;c=!1,d===-1?(i[f]=0,c=!0):d===s&&(i[f]=s-1,c=!0),g===-1?(i[f+1]=0,c=!0):g===a&&(i[f+1]=a-1,c=!0)}c=!0;for(let f=i.length-2;f>=0&&c;f-=2){const d=Math.floor(i[f]),g=Math.floor(i[f+1]);if(d<-1||d>s||g<-1||g>a)throw new z;c=!1,d===-1?(i[f]=0,c=!0):d===s&&(i[f]=s-1,c=!0),g===-1?(i[f+1]=0,c=!0):g===a&&(i[f+1]=a-1,c=!0)}}}class kr{constructor(n,i,s,a,c,f,d,g,p){this.a11=n,this.a21=i,this.a31=s,this.a12=a,this.a22=c,this.a32=f,this.a13=d,this.a23=g,this.a33=p}static quadrilateralToQuadrilateral(n,i,s,a,c,f,d,g,p,v,A,S,N,P,B,W){const G=kr.quadrilateralToSquare(n,i,s,a,c,f,d,g);return kr.squareToQuadrilateral(p,v,A,S,N,P,B,W).times(G)}transformPoints(n){const i=n.length,s=this.a11,a=this.a12,c=this.a13,f=this.a21,d=this.a22,g=this.a23,p=this.a31,v=this.a32,A=this.a33;for(let S=0;S<i;S+=2){const N=n[S],P=n[S+1],B=c*N+g*P+A;n[S]=(s*N+f*P+p)/B,n[S+1]=(a*N+d*P+v)/B}}transformPointsWithValues(n,i){const s=this.a11,a=this.a12,c=this.a13,f=this.a21,d=this.a22,g=this.a23,p=this.a31,v=this.a32,A=this.a33,S=n.length;for(let N=0;N<S;N++){const P=n[N],B=i[N],W=c*P+g*B+A;n[N]=(s*P+f*B+p)/W,i[N]=(a*P+d*B+v)/W}}static squareToQuadrilateral(n,i,s,a,c,f,d,g){const p=n-s+c-d,v=i-a+f-g;if(p===0&&v===0)return new kr(s-n,c-s,n,a-i,f-a,i,0,0,1);{const A=s-c,S=d-c,N=a-f,P=g-f,B=A*P-S*N,W=(p*P-S*v)/B,G=(A*v-p*N)/B;return new kr(s-n+W*s,d-n+G*d,n,a-i+W*a,g-i+G*g,i,W,G,1)}}static quadrilateralToSquare(n,i,s,a,c,f,d,g){return kr.squareToQuadrilateral(n,i,s,a,c,f,d,g).buildAdjoint()}buildAdjoint(){return new kr(this.a22*this.a33-this.a23*this.a32,this.a23*this.a31-this.a21*this.a33,this.a21*this.a32-this.a22*this.a31,this.a13*this.a32-this.a12*this.a33,this.a11*this.a33-this.a13*this.a31,this.a12*this.a31-this.a11*this.a32,this.a12*this.a23-this.a13*this.a22,this.a13*this.a21-this.a11*this.a23,this.a11*this.a22-this.a12*this.a21)}times(n){return new kr(this.a11*n.a11+this.a21*n.a12+this.a31*n.a13,this.a11*n.a21+this.a21*n.a22+this.a31*n.a23,this.a11*n.a31+this.a21*n.a32+this.a31*n.a33,this.a12*n.a11+this.a22*n.a12+this.a32*n.a13,this.a12*n.a21+this.a22*n.a22+this.a32*n.a23,this.a12*n.a31+this.a22*n.a32+this.a32*n.a33,this.a13*n.a11+this.a23*n.a12+this.a33*n.a13,this.a13*n.a21+this.a23*n.a22+this.a33*n.a23,this.a13*n.a31+this.a23*n.a32+this.a33*n.a33)}}class th extends ru{sampleGrid(n,i,s,a,c,f,d,g,p,v,A,S,N,P,B,W,G,J,ee){const Z=kr.quadrilateralToQuadrilateral(a,c,f,d,g,p,v,A,S,N,P,B,W,G,J,ee);return this.sampleGridWithTransform(n,i,s,Z)}sampleGridWithTransform(n,i,s,a){if(i<=0||s<=0)throw new z;const c=new re(i,s),f=new Float32Array(2*i);for(let d=0;d<s;d++){const g=f.length,p=d+.5;for(let v=0;v<g;v+=2)f[v]=v/2+.5,f[v+1]=p;a.transformPoints(f),ru.checkAndNudgePoints(n,f);try{for(let v=0;v<g;v+=2)n.get(Math.floor(f[v]),Math.floor(f[v+1]))&&c.set(v/2,d)}catch{throw new z}}return c}}class Nn{static setGridSampler(n){Nn.gridSampler=n}static getInstance(){return Nn.gridSampler}}Nn.gridSampler=new th;class $t{constructor(n,i){this.x=n,this.y=i}toResultPoint(){return new ce(this.getX(),this.getY())}getX(){return this.x}getY(){return this.y}}class rh{constructor(n){this.EXPECTED_CORNER_BITS=new Int32Array([3808,476,2107,1799]),this.image=n}detect(){return this.detectMirror(!1)}detectMirror(n){let i=this.getMatrixCenter(),s=this.getBullsEyeCorners(i);if(n){let f=s[0];s[0]=s[2],s[2]=f}this.extractParameters(s);let a=this.sampleGrid(this.image,s[this.shift%4],s[(this.shift+1)%4],s[(this.shift+2)%4],s[(this.shift+3)%4]),c=this.getMatrixCornerPoints(s);return new eh(a,c,this.compact,this.nbDataBlocks,this.nbLayers)}extractParameters(n){if(!this.isValidPoint(n[0])||!this.isValidPoint(n[1])||!this.isValidPoint(n[2])||!this.isValidPoint(n[3]))throw new z;let i=2*this.nbCenterLayers,s=new Int32Array([this.sampleLine(n[0],n[1],i),this.sampleLine(n[1],n[2],i),this.sampleLine(n[2],n[3],i),this.sampleLine(n[3],n[0],i)]);this.shift=this.getRotation(s,i);let a=0;for(let f=0;f<4;f++){let d=s[(this.shift+f)%4];this.compact?(a<<=7,a+=d>>1&127):(a<<=10,a+=(d>>2&992)+(d>>1&31))}let c=this.getCorrectedParameterData(a,this.compact);this.compact?(this.nbLayers=(c>>6)+1,this.nbDataBlocks=(c&63)+1):(this.nbLayers=(c>>11)+1,this.nbDataBlocks=(c&2047)+1)}getRotation(n,i){let s=0;n.forEach((a,c,f)=>{let d=(a>>i-2<<1)+(a&1);s=(s<<3)+d}),s=((s&1)<<11)+(s>>1);for(let a=0;a<4;a++)if(_.bitCount(s^this.EXPECTED_CORNER_BITS[a])<=2)return a;throw new z}getCorrectedParameterData(n,i){let s,a;i?(s=7,a=2):(s=10,a=4);let c=s-a,f=new Int32Array(s);for(let g=s-1;g>=0;--g)f[g]=n&15,n>>=4;try{new Vs(Oe.AZTEC_PARAM).decode(f,c)}catch{throw new z}let d=0;for(let g=0;g<a;g++)d=(d<<4)+f[g];return d}getBullsEyeCorners(n){let i=n,s=n,a=n,c=n,f=!0;for(this.nbCenterLayers=1;this.nbCenterLayers<9;this.nbCenterLayers++){let A=this.getFirstDifferent(i,f,1,-1),S=this.getFirstDifferent(s,f,1,1),N=this.getFirstDifferent(a,f,-1,1),P=this.getFirstDifferent(c,f,-1,-1);if(this.nbCenterLayers>2){let B=this.distancePoint(P,A)*this.nbCenterLayers/(this.distancePoint(c,i)*(this.nbCenterLayers+2));if(B<.75||B>1.25||!this.isWhiteOrBlackRectangle(A,S,N,P))break}i=A,s=S,a=N,c=P,f=!f}if(this.nbCenterLayers!==5&&this.nbCenterLayers!==7)throw new z;this.compact=this.nbCenterLayers===5;let d=new ce(i.getX()+.5,i.getY()-.5),g=new ce(s.getX()+.5,s.getY()+.5),p=new ce(a.getX()-.5,a.getY()+.5),v=new ce(c.getX()-.5,c.getY()-.5);return this.expandSquare([d,g,p,v],2*this.nbCenterLayers-3,2*this.nbCenterLayers)}getMatrixCenter(){let n,i,s,a;try{let d=new fn(this.image).detect();n=d[0],i=d[1],s=d[2],a=d[3]}catch{let g=this.image.getWidth()/2,p=this.image.getHeight()/2;n=this.getFirstDifferent(new $t(g+7,p-7),!1,1,-1).toResultPoint(),i=this.getFirstDifferent(new $t(g+7,p+7),!1,1,1).toResultPoint(),s=this.getFirstDifferent(new $t(g-7,p+7),!1,-1,1).toResultPoint(),a=this.getFirstDifferent(new $t(g-7,p-7),!1,-1,-1).toResultPoint()}let c=Re.round((n.getX()+a.getX()+i.getX()+s.getX())/4),f=Re.round((n.getY()+a.getY()+i.getY()+s.getY())/4);try{let d=new fn(this.image,15,c,f).detect();n=d[0],i=d[1],s=d[2],a=d[3]}catch{n=this.getFirstDifferent(new $t(c+7,f-7),!1,1,-1).toResultPoint(),i=this.getFirstDifferent(new $t(c+7,f+7),!1,1,1).toResultPoint(),s=this.getFirstDifferent(new $t(c-7,f+7),!1,-1,1).toResultPoint(),a=this.getFirstDifferent(new $t(c-7,f-7),!1,-1,-1).toResultPoint()}return c=Re.round((n.getX()+a.getX()+i.getX()+s.getX())/4),f=Re.round((n.getY()+a.getY()+i.getY()+s.getY())/4),new $t(c,f)}getMatrixCornerPoints(n){return this.expandSquare(n,2*this.nbCenterLayers,this.getDimension())}sampleGrid(n,i,s,a,c){let f=Nn.getInstance(),d=this.getDimension(),g=d/2-this.nbCenterLayers,p=d/2+this.nbCenterLayers;return f.sampleGrid(n,d,d,g,g,p,g,p,p,g,p,i.getX(),i.getY(),s.getX(),s.getY(),a.getX(),a.getY(),c.getX(),c.getY())}sampleLine(n,i,s){let a=0,c=this.distanceResultPoint(n,i),f=c/s,d=n.getX(),g=n.getY(),p=f*(i.getX()-n.getX())/c,v=f*(i.getY()-n.getY())/c;for(let A=0;A<s;A++)this.image.get(Re.round(d+A*p),Re.round(g+A*v))&&(a|=1<<s-A-1);return a}isWhiteOrBlackRectangle(n,i,s,a){let c=3;n=new $t(n.getX()-c,n.getY()+c),i=new $t(i.getX()-c,i.getY()-c),s=new $t(s.getX()+c,s.getY()-c),a=new $t(a.getX()+c,a.getY()+c);let f=this.getColor(a,n);if(f===0)return!1;let d=this.getColor(n,i);return d!==f||(d=this.getColor(i,s),d!==f)?!1:(d=this.getColor(s,a),d===f)}getColor(n,i){let s=this.distancePoint(n,i),a=(i.getX()-n.getX())/s,c=(i.getY()-n.getY())/s,f=0,d=n.getX(),g=n.getY(),p=this.image.get(n.getX(),n.getY()),v=Math.ceil(s);for(let S=0;S<v;S++)d+=a,g+=c,this.image.get(Re.round(d),Re.round(g))!==p&&f++;let A=f/s;return A>.1&&A<.9?0:A<=.1===p?1:-1}getFirstDifferent(n,i,s,a){let c=n.getX()+s,f=n.getY()+a;for(;this.isValid(c,f)&&this.image.get(c,f)===i;)c+=s,f+=a;for(c-=s,f-=a;this.isValid(c,f)&&this.image.get(c,f)===i;)c+=s;for(c-=s;this.isValid(c,f)&&this.image.get(c,f)===i;)f+=a;return f-=a,new $t(c,f)}expandSquare(n,i,s){let a=s/(2*i),c=n[0].getX()-n[2].getX(),f=n[0].getY()-n[2].getY(),d=(n[0].getX()+n[2].getX())/2,g=(n[0].getY()+n[2].getY())/2,p=new ce(d+a*c,g+a*f),v=new ce(d-a*c,g-a*f);c=n[1].getX()-n[3].getX(),f=n[1].getY()-n[3].getY(),d=(n[1].getX()+n[3].getX())/2,g=(n[1].getY()+n[3].getY())/2;let A=new ce(d+a*c,g+a*f),S=new ce(d-a*c,g-a*f);return[p,A,v,S]}isValid(n,i){return n>=0&&n<this.image.getWidth()&&i>0&&i<this.image.getHeight()}isValidPoint(n){let i=Re.round(n.getX()),s=Re.round(n.getY());return this.isValid(i,s)}distancePoint(n,i){return Re.distance(n.getX(),n.getY(),i.getX(),i.getY())}distanceResultPoint(n,i){return Re.distance(n.getX(),n.getY(),i.getX(),i.getY())}getDimension(){return this.compact?4*this.nbLayers+11:this.nbLayers<=4?4*this.nbLayers+15:4*this.nbLayers+2*(_.truncDivision(this.nbLayers-4,8)+1)+15}}class Aa{decode(n,i=null){let s=null,a=new rh(n.getBlackMatrix()),c=null,f=null;try{let v=a.detectMirror(!1);c=v.getPoints(),this.reportFoundResultPoints(i,c),f=new Ve().decode(v)}catch(v){s=v}if(f==null)try{let v=a.detectMirror(!0);c=v.getPoints(),this.reportFoundResultPoints(i,c),f=new Ve().decode(v)}catch(v){throw s??v}let d=new Qe(f.getText(),f.getRawBytes(),f.getNumBits(),c,ue.AZTEC,D.currentTimeMillis()),g=f.getByteSegments();g!=null&&d.putMetadata(Ct.BYTE_SEGMENTS,g);let p=f.getECLevel();return p!=null&&d.putMetadata(Ct.ERROR_CORRECTION_LEVEL,p),d}reportFoundResultPoints(n,i){if(n!=null){let s=n.get(U.NEED_RESULT_POINT_CALLBACK);s!=null&&i.forEach((a,c,f)=>{s.foundPossibleResultPoint(a)})}}reset(){}}class By extends Er{constructor(n=500){super(new Aa,n)}}class ht{decode(n,i){try{return this.doDecode(n,i)}catch{if(i&&i.get(U.TRY_HARDER)===!0&&n.isRotateSupported()){const c=n.rotateCounterClockwise(),f=this.doDecode(c,i),d=f.getResultMetadata();let g=270;d!==null&&d.get(Ct.ORIENTATION)===!0&&(g=g+d.get(Ct.ORIENTATION)%360),f.putMetadata(Ct.ORIENTATION,g);const p=f.getResultPoints();if(p!==null){const v=c.getHeight();for(let A=0;A<p.length;A++)p[A]=new ce(v-p[A].getY()-1,p[A].getX())}return f}else throw new z}}reset(){}doDecode(n,i){const s=n.getWidth(),a=n.getHeight();let c=new L(s);const f=i&&i.get(U.TRY_HARDER)===!0,d=Math.max(1,a>>(f?8:5));let g;f?g=a:g=15;const p=Math.trunc(a/2);for(let v=0;v<g;v++){const A=Math.trunc((v+1)/2),S=(v&1)===0,N=p+d*(S?A:-A);if(N<0||N>=a)break;try{c=n.getBlackRow(N,c)}catch{continue}for(let P=0;P<2;P++){if(P===1&&(c.reverse(),i&&i.get(U.NEED_RESULT_POINT_CALLBACK)===!0)){const B=new Map;i.forEach((W,G)=>B.set(G,W)),B.delete(U.NEED_RESULT_POINT_CALLBACK),i=B}try{const B=this.decodeRow(N,c,i);if(P===1){B.putMetadata(Ct.ORIENTATION,180);const W=B.getResultPoints();W!==null&&(W[0]=new ce(s-W[0].getX()-1,W[0].getY()),W[1]=new ce(s-W[1].getX()-1,W[1].getY()))}return B}catch{}}}throw new z}static recordPattern(n,i,s){const a=s.length;for(let p=0;p<a;p++)s[p]=0;const c=n.getSize();if(i>=c)throw new z;let f=!n.get(i),d=0,g=i;for(;g<c;){if(n.get(g)!==f)s[d]++;else{if(++d===a)break;s[d]=1,f=!f}g++}if(!(d===a||d===a-1&&g===c))throw new z}static recordPatternInReverse(n,i,s){let a=s.length,c=n.get(i);for(;i>0&&a>=0;)n.get(--i)!==c&&(a--,c=!c);if(a>=0)throw new z;ht.recordPattern(n,i+1,s)}static patternMatchVariance(n,i,s){const a=n.length;let c=0,f=0;for(let p=0;p<a;p++)c+=n[p],f+=i[p];if(c<f)return Number.POSITIVE_INFINITY;const d=c/f;s*=d;let g=0;for(let p=0;p<a;p++){const v=n[p],A=i[p]*d,S=v>A?v-A:A-v;if(S>s)return Number.POSITIVE_INFINITY;g+=S}return g/c}}class te extends ht{static findStartPattern(n){const i=n.getSize(),s=n.getNextSet(0);let a=0,c=Int32Array.from([0,0,0,0,0,0]),f=s,d=!1;const g=6;for(let p=s;p<i;p++)if(n.get(p)!==d)c[a]++;else{if(a===g-1){let v=te.MAX_AVG_VARIANCE,A=-1;for(let S=te.CODE_START_A;S<=te.CODE_START_C;S++){const N=ht.patternMatchVariance(c,te.CODE_PATTERNS[S],te.MAX_INDIVIDUAL_VARIANCE);N<v&&(v=N,A=S)}if(A>=0&&n.isRange(Math.max(0,f-(p-f)/2),f,!1))return Int32Array.from([f,p,A]);f+=c[0]+c[1],c=c.slice(2,c.length-1),c[a-1]=0,c[a]=0,a--}else a++;c[a]=1,d=!d}throw new z}static decodeCode(n,i,s){ht.recordPattern(n,s,i);let a=te.MAX_AVG_VARIANCE,c=-1;for(let f=0;f<te.CODE_PATTERNS.length;f++){const d=te.CODE_PATTERNS[f],g=this.patternMatchVariance(i,d,te.MAX_INDIVIDUAL_VARIANCE);g<a&&(a=g,c=f)}if(c>=0)return c;throw new z}decodeRow(n,i,s){const a=s&&s.get(U.ASSUME_GS1)===!0,c=te.findStartPattern(i),f=c[2];let d=0;const g=new Uint8Array(20);g[d++]=f;let p;switch(f){case te.CODE_START_A:p=te.CODE_CODE_A;break;case te.CODE_START_B:p=te.CODE_CODE_B;break;case te.CODE_START_C:p=te.CODE_CODE_C;break;default:throw new F}let v=!1,A=!1,S="",N=c[0],P=c[1];const B=Int32Array.from([0,0,0,0,0,0]);let W=0,G=0,J=f,ee=0,Z=!0,Se=!1,ye=!1;for(;!v;){const Ki=A;switch(A=!1,W=G,G=te.decodeCode(i,B,P),g[d++]=G,G!==te.CODE_STOP&&(Z=!0),G!==te.CODE_STOP&&(ee++,J+=ee*G),N=P,P+=B.reduce((d3,h3)=>d3+h3,0),G){case te.CODE_START_A:case te.CODE_START_B:case te.CODE_START_C:throw new F}switch(p){case te.CODE_CODE_A:if(G<64)ye===Se?S+=String.fromCharCode(32+G):S+=String.fromCharCode(32+G+128),ye=!1;else if(G<96)ye===Se?S+=String.fromCharCode(G-64):S+=String.fromCharCode(G+64),ye=!1;else switch(G!==te.CODE_STOP&&(Z=!1),G){case te.CODE_FNC_1:a&&(S.length===0?S+="]C1":S+="");break;case te.CODE_FNC_2:case te.CODE_FNC_3:break;case te.CODE_FNC_4_A:!Se&&ye?(Se=!0,ye=!1):Se&&ye?(Se=!1,ye=!1):ye=!0;break;case te.CODE_SHIFT:A=!0,p=te.CODE_CODE_B;break;case te.CODE_CODE_B:p=te.CODE_CODE_B;break;case te.CODE_CODE_C:p=te.CODE_CODE_C;break;case te.CODE_STOP:v=!0;break}break;case te.CODE_CODE_B:if(G<96)ye===Se?S+=String.fromCharCode(32+G):S+=String.fromCharCode(32+G+128),ye=!1;else switch(G!==te.CODE_STOP&&(Z=!1),G){case te.CODE_FNC_1:a&&(S.length===0?S+="]C1":S+="");break;case te.CODE_FNC_2:case te.CODE_FNC_3:break;case te.CODE_FNC_4_B:!Se&&ye?(Se=!0,ye=!1):Se&&ye?(Se=!1,ye=!1):ye=!0;break;case te.CODE_SHIFT:A=!0,p=te.CODE_CODE_A;break;case te.CODE_CODE_A:p=te.CODE_CODE_A;break;case te.CODE_CODE_C:p=te.CODE_CODE_C;break;case te.CODE_STOP:v=!0;break}break;case te.CODE_CODE_C:if(G<100)G<10&&(S+="0"),S+=G;else switch(G!==te.CODE_STOP&&(Z=!1),G){case te.CODE_FNC_1:a&&(S.length===0?S+="]C1":S+="");break;case te.CODE_CODE_A:p=te.CODE_CODE_A;break;case te.CODE_CODE_B:p=te.CODE_CODE_B;break;case te.CODE_STOP:v=!0;break}break}Ki&&(p=p===te.CODE_CODE_A?te.CODE_CODE_B:te.CODE_CODE_A)}const tr=P-N;if(P=i.getNextUnset(P),!i.isRange(P,Math.min(i.getSize(),P+(P-N)/2),!1))throw new z;if(J-=ee*W,J%103!==W)throw new T;const Dr=S.length;if(Dr===0)throw new z;Dr>0&&Z&&(p===te.CODE_CODE_C?S=S.substring(0,Dr-2):S=S.substring(0,Dr-1));const rr=(c[1]+c[0])/2,We=N+tr/2,kt=g.length,fr=new Uint8Array(kt);for(let Ki=0;Ki<kt;Ki++)fr[Ki]=g[Ki];const Yi=[new ce(rr,n),new ce(We,n)];return new Qe(S,fr,0,Yi,ue.CODE_128,new Date().getTime())}}te.CODE_PATTERNS=[Int32Array.from([2,1,2,2,2,2]),Int32Array.from([2,2,2,1,2,2]),Int32Array.from([2,2,2,2,2,1]),Int32Array.from([1,2,1,2,2,3]),Int32Array.from([1,2,1,3,2,2]),Int32Array.from([1,3,1,2,2,2]),Int32Array.from([1,2,2,2,1,3]),Int32Array.from([1,2,2,3,1,2]),Int32Array.from([1,3,2,2,1,2]),Int32Array.from([2,2,1,2,1,3]),Int32Array.from([2,2,1,3,1,2]),Int32Array.from([2,3,1,2,1,2]),Int32Array.from([1,1,2,2,3,2]),Int32Array.from([1,2,2,1,3,2]),Int32Array.from([1,2,2,2,3,1]),Int32Array.from([1,1,3,2,2,2]),Int32Array.from([1,2,3,1,2,2]),Int32Array.from([1,2,3,2,2,1]),Int32Array.from([2,2,3,2,1,1]),Int32Array.from([2,2,1,1,3,2]),Int32Array.from([2,2,1,2,3,1]),Int32Array.from([2,1,3,2,1,2]),Int32Array.from([2,2,3,1,1,2]),Int32Array.from([3,1,2,1,3,1]),Int32Array.from([3,1,1,2,2,2]),Int32Array.from([3,2,1,1,2,2]),Int32Array.from([3,2,1,2,2,1]),Int32Array.from([3,1,2,2,1,2]),Int32Array.from([3,2,2,1,1,2]),Int32Array.from([3,2,2,2,1,1]),Int32Array.from([2,1,2,1,2,3]),Int32Array.from([2,1,2,3,2,1]),Int32Array.from([2,3,2,1,2,1]),Int32Array.from([1,1,1,3,2,3]),Int32Array.from([1,3,1,1,2,3]),Int32Array.from([1,3,1,3,2,1]),Int32Array.from([1,1,2,3,1,3]),Int32Array.from([1,3,2,1,1,3]),Int32Array.from([1,3,2,3,1,1]),Int32Array.from([2,1,1,3,1,3]),Int32Array.from([2,3,1,1,1,3]),Int32Array.from([2,3,1,3,1,1]),Int32Array.from([1,1,2,1,3,3]),Int32Array.from([1,1,2,3,3,1]),Int32Array.from([1,3,2,1,3,1]),Int32Array.from([1,1,3,1,2,3]),Int32Array.from([1,1,3,3,2,1]),Int32Array.from([1,3,3,1,2,1]),Int32Array.from([3,1,3,1,2,1]),Int32Array.from([2,1,1,3,3,1]),Int32Array.from([2,3,1,1,3,1]),Int32Array.from([2,1,3,1,1,3]),Int32Array.from([2,1,3,3,1,1]),Int32Array.from([2,1,3,1,3,1]),Int32Array.from([3,1,1,1,2,3]),Int32Array.from([3,1,1,3,2,1]),Int32Array.from([3,3,1,1,2,1]),Int32Array.from([3,1,2,1,1,3]),Int32Array.from([3,1,2,3,1,1]),Int32Array.from([3,3,2,1,1,1]),Int32Array.from([3,1,4,1,1,1]),Int32Array.from([2,2,1,4,1,1]),Int32Array.from([4,3,1,1,1,1]),Int32Array.from([1,1,1,2,2,4]),Int32Array.from([1,1,1,4,2,2]),Int32Array.from([1,2,1,1,2,4]),Int32Array.from([1,2,1,4,2,1]),Int32Array.from([1,4,1,1,2,2]),Int32Array.from([1,4,1,2,2,1]),Int32Array.from([1,1,2,2,1,4]),Int32Array.from([1,1,2,4,1,2]),Int32Array.from([1,2,2,1,1,4]),Int32Array.from([1,2,2,4,1,1]),Int32Array.from([1,4,2,1,1,2]),Int32Array.from([1,4,2,2,1,1]),Int32Array.from([2,4,1,2,1,1]),Int32Array.from([2,2,1,1,1,4]),Int32Array.from([4,1,3,1,1,1]),Int32Array.from([2,4,1,1,1,2]),Int32Array.from([1,3,4,1,1,1]),Int32Array.from([1,1,1,2,4,2]),Int32Array.from([1,2,1,1,4,2]),Int32Array.from([1,2,1,2,4,1]),Int32Array.from([1,1,4,2,1,2]),Int32Array.from([1,2,4,1,1,2]),Int32Array.from([1,2,4,2,1,1]),Int32Array.from([4,1,1,2,1,2]),Int32Array.from([4,2,1,1,1,2]),Int32Array.from([4,2,1,2,1,1]),Int32Array.from([2,1,2,1,4,1]),Int32Array.from([2,1,4,1,2,1]),Int32Array.from([4,1,2,1,2,1]),Int32Array.from([1,1,1,1,4,3]),Int32Array.from([1,1,1,3,4,1]),Int32Array.from([1,3,1,1,4,1]),Int32Array.from([1,1,4,1,1,3]),Int32Array.from([1,1,4,3,1,1]),Int32Array.from([4,1,1,1,1,3]),Int32Array.from([4,1,1,3,1,1]),Int32Array.from([1,1,3,1,4,1]),Int32Array.from([1,1,4,1,3,1]),Int32Array.from([3,1,1,1,4,1]),Int32Array.from([4,1,1,1,3,1]),Int32Array.from([2,1,1,4,1,2]),Int32Array.from([2,1,1,2,1,4]),Int32Array.from([2,1,1,2,3,2]),Int32Array.from([2,3,3,1,1,1,2])],te.MAX_AVG_VARIANCE=.25,te.MAX_INDIVIDUAL_VARIANCE=.7,te.CODE_SHIFT=98,te.CODE_CODE_C=99,te.CODE_CODE_B=100,te.CODE_CODE_A=101,te.CODE_FNC_1=102,te.CODE_FNC_2=97,te.CODE_FNC_3=96,te.CODE_FNC_4_A=101,te.CODE_FNC_4_B=100,te.CODE_START_A=103,te.CODE_START_B=104,te.CODE_START_C=105,te.CODE_STOP=106;class xt extends ht{constructor(n=!1,i=!1){super(),this.usingCheckDigit=n,this.extendedMode=i,this.decodeRowResult="",this.counters=new Int32Array(9)}decodeRow(n,i,s){let a=this.counters;a.fill(0),this.decodeRowResult="";let c=xt.findAsteriskPattern(i,a),f=i.getNextSet(c[1]),d=i.getSize(),g,p;do{xt.recordPattern(i,f,a);let B=xt.toNarrowWidePattern(a);if(B<0)throw new z;g=xt.patternToChar(B),this.decodeRowResult+=g,p=f;for(let W of a)f+=W;f=i.getNextSet(f)}while(g!=="*");this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);let v=0;for(let B of a)v+=B;let A=f-p-v;if(f!==d&&A*2<v)throw new z;if(this.usingCheckDigit){let B=this.decodeRowResult.length-1,W=0;for(let G=0;G<B;G++)W+=xt.ALPHABET_STRING.indexOf(this.decodeRowResult.charAt(G));if(this.decodeRowResult.charAt(B)!==xt.ALPHABET_STRING.charAt(W%43))throw new T;this.decodeRowResult=this.decodeRowResult.substring(0,B)}if(this.decodeRowResult.length===0)throw new z;let S;this.extendedMode?S=xt.decodeExtended(this.decodeRowResult):S=this.decodeRowResult;let N=(c[1]+c[0])/2,P=p+v/2;return new Qe(S,null,0,[new ce(N,n),new ce(P,n)],ue.CODE_39,new Date().getTime())}static findAsteriskPattern(n,i){let s=n.getSize(),a=n.getNextSet(0),c=0,f=a,d=!1,g=i.length;for(let p=a;p<s;p++)if(n.get(p)!==d)i[c]++;else{if(c===g-1){if(this.toNarrowWidePattern(i)===xt.ASTERISK_ENCODING&&n.isRange(Math.max(0,f-Math.floor((p-f)/2)),f,!1))return[f,p];f+=i[0]+i[1],i.copyWithin(0,2,2+c-1),i[c-1]=0,i[c]=0,c--}else c++;i[c]=1,d=!d}throw new z}static toNarrowWidePattern(n){let i=n.length,s=0,a;do{let c=2147483647;for(let g of n)g<c&&g>s&&(c=g);s=c,a=0;let f=0,d=0;for(let g=0;g<i;g++){let p=n[g];p>s&&(d|=1<<i-1-g,a++,f+=p)}if(a===3){for(let g=0;g<i&&a>0;g++){let p=n[g];if(p>s&&(a--,p*2>=f))return-1}return d}}while(a>3);return-1}static patternToChar(n){for(let i=0;i<xt.CHARACTER_ENCODINGS.length;i++)if(xt.CHARACTER_ENCODINGS[i]===n)return xt.ALPHABET_STRING.charAt(i);if(n===xt.ASTERISK_ENCODING)return"*";throw new z}static decodeExtended(n){let i=n.length,s="";for(let a=0;a<i;a++){let c=n.charAt(a);if(c==="+"||c==="$"||c==="%"||c==="/"){let f=n.charAt(a+1),d="\0";switch(c){case"+":if(f>="A"&&f<="Z")d=String.fromCharCode(f.charCodeAt(0)+32);else throw new F;break;case"$":if(f>="A"&&f<="Z")d=String.fromCharCode(f.charCodeAt(0)-64);else throw new F;break;case"%":if(f>="A"&&f<="E")d=String.fromCharCode(f.charCodeAt(0)-38);else if(f>="F"&&f<="J")d=String.fromCharCode(f.charCodeAt(0)-11);else if(f>="K"&&f<="O")d=String.fromCharCode(f.charCodeAt(0)+16);else if(f>="P"&&f<="T")d=String.fromCharCode(f.charCodeAt(0)+43);else if(f==="U")d="\0";else if(f==="V")d="@";else if(f==="W")d="`";else if(f==="X"||f==="Y"||f==="Z")d="";else throw new F;break;case"/":if(f>="A"&&f<="O")d=String.fromCharCode(f.charCodeAt(0)-32);else if(f==="Z")d=":";else throw new F;break}s+=d,a++}else s+=c}return s}}xt.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",xt.CHARACTER_ENCODINGS=[52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,168,162,138,42],xt.ASTERISK_ENCODING=148;class Ue extends ht{constructor(){super(...arguments),this.narrowLineWidth=-1}decodeRow(n,i,s){let a=this.decodeStart(i),c=this.decodeEnd(i),f=new xe;Ue.decodeMiddle(i,a[1],c[0],f);let d=f.toString(),g=null;s!=null&&(g=s.get(U.ALLOWED_LENGTHS)),g==null&&(g=Ue.DEFAULT_ALLOWED_LENGTHS);let p=d.length,v=!1,A=0;for(let P of g){if(p===P){v=!0;break}P>A&&(A=P)}if(!v&&p>A&&(v=!0),!v)throw new F;const S=[new ce(a[1],n),new ce(c[0],n)];return new Qe(d,null,0,S,ue.ITF,new Date().getTime())}static decodeMiddle(n,i,s,a){let c=new Int32Array(10),f=new Int32Array(5),d=new Int32Array(5);for(c.fill(0),f.fill(0),d.fill(0);i<s;){ht.recordPattern(n,i,c);for(let p=0;p<5;p++){let v=2*p;f[p]=c[v],d[p]=c[v+1]}let g=Ue.decodeDigit(f);a.append(g.toString()),g=this.decodeDigit(d),a.append(g.toString()),c.forEach(function(p){i+=p})}}decodeStart(n){let i=Ue.skipWhiteSpace(n),s=Ue.findGuardPattern(n,i,Ue.START_PATTERN);return this.narrowLineWidth=(s[1]-s[0])/4,this.validateQuietZone(n,s[0]),s}validateQuietZone(n,i){let s=this.narrowLineWidth*10;s=s<i?s:i;for(let a=i-1;s>0&&a>=0&&!n.get(a);a--)s--;if(s!==0)throw new z}static skipWhiteSpace(n){const i=n.getSize(),s=n.getNextSet(0);if(s===i)throw new z;return s}decodeEnd(n){n.reverse();try{let i=Ue.skipWhiteSpace(n),s;try{s=Ue.findGuardPattern(n,i,Ue.END_PATTERN_REVERSED[0])}catch(c){c instanceof z&&(s=Ue.findGuardPattern(n,i,Ue.END_PATTERN_REVERSED[1]))}this.validateQuietZone(n,s[0]);let a=s[0];return s[0]=n.getSize()-s[1],s[1]=n.getSize()-a,s}finally{n.reverse()}}static findGuardPattern(n,i,s){let a=s.length,c=new Int32Array(a),f=n.getSize(),d=!1,g=0,p=i;c.fill(0);for(let v=i;v<f;v++)if(n.get(v)!==d)c[g]++;else{if(g===a-1){if(ht.patternMatchVariance(c,s,Ue.MAX_INDIVIDUAL_VARIANCE)<Ue.MAX_AVG_VARIANCE)return[p,v];p+=c[0]+c[1],D.arraycopy(c,2,c,0,g-1),c[g-1]=0,c[g]=0,g--}else g++;c[g]=1,d=!d}throw new z}static decodeDigit(n){let i=Ue.MAX_AVG_VARIANCE,s=-1,a=Ue.PATTERNS.length;for(let c=0;c<a;c++){let f=Ue.PATTERNS[c],d=ht.patternMatchVariance(n,f,Ue.MAX_INDIVIDUAL_VARIANCE);d<i?(i=d,s=c):d===i&&(s=-1)}if(s>=0)return s%10;throw new z}}Ue.PATTERNS=[Int32Array.from([1,1,2,2,1]),Int32Array.from([2,1,1,1,2]),Int32Array.from([1,2,1,1,2]),Int32Array.from([2,2,1,1,1]),Int32Array.from([1,1,2,1,2]),Int32Array.from([2,1,2,1,1]),Int32Array.from([1,2,2,1,1]),Int32Array.from([1,1,1,2,2]),Int32Array.from([2,1,1,2,1]),Int32Array.from([1,2,1,2,1]),Int32Array.from([1,1,3,3,1]),Int32Array.from([3,1,1,1,3]),Int32Array.from([1,3,1,1,3]),Int32Array.from([3,3,1,1,1]),Int32Array.from([1,1,3,1,3]),Int32Array.from([3,1,3,1,1]),Int32Array.from([1,3,3,1,1]),Int32Array.from([1,1,1,3,3]),Int32Array.from([3,1,1,3,1]),Int32Array.from([1,3,1,3,1])],Ue.MAX_AVG_VARIANCE=.38,Ue.MAX_INDIVIDUAL_VARIANCE=.5,Ue.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],Ue.START_PATTERN=Int32Array.from([1,1,1,1]),Ue.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])];class nt extends ht{constructor(){super(...arguments),this.decodeRowStringBuffer=""}static findStartGuardPattern(n){let i=!1,s,a=0,c=Int32Array.from([0,0,0]);for(;!i;){c=Int32Array.from([0,0,0]),s=nt.findGuardPattern(n,a,!1,this.START_END_PATTERN,c);let f=s[0];a=s[1];let d=f-(a-f);d>=0&&(i=n.isRange(d,f,!1))}return s}static checkChecksum(n){return nt.checkStandardUPCEANChecksum(n)}static checkStandardUPCEANChecksum(n){let i=n.length;if(i===0)return!1;let s=parseInt(n.charAt(i-1),10);return nt.getStandardUPCEANChecksum(n.substring(0,i-1))===s}static getStandardUPCEANChecksum(n){let i=n.length,s=0;for(let a=i-1;a>=0;a-=2){let c=n.charAt(a).charCodeAt(0)-48;if(c<0||c>9)throw new F;s+=c}s*=3;for(let a=i-2;a>=0;a-=2){let c=n.charAt(a).charCodeAt(0)-48;if(c<0||c>9)throw new F;s+=c}return(1e3-s)%10}static decodeEnd(n,i){return nt.findGuardPattern(n,i,!1,nt.START_END_PATTERN,new Int32Array(nt.START_END_PATTERN.length).fill(0))}static findGuardPatternWithoutCounters(n,i,s,a){return this.findGuardPattern(n,i,s,a,new Int32Array(a.length))}static findGuardPattern(n,i,s,a,c){let f=n.getSize();i=s?n.getNextUnset(i):n.getNextSet(i);let d=0,g=i,p=a.length,v=s;for(let A=i;A<f;A++)if(n.get(A)!==v)c[d]++;else{if(d===p-1){if(ht.patternMatchVariance(c,a,nt.MAX_INDIVIDUAL_VARIANCE)<nt.MAX_AVG_VARIANCE)return Int32Array.from([g,A]);g+=c[0]+c[1];let S=c.slice(2,c.length-1);for(let N=0;N<d-1;N++)c[N]=S[N];c[d-1]=0,c[d]=0,d--}else d++;c[d]=1,v=!v}throw new z}static decodeDigit(n,i,s,a){this.recordPattern(n,s,i);let c=this.MAX_AVG_VARIANCE,f=-1,d=a.length;for(let g=0;g<d;g++){let p=a[g],v=ht.patternMatchVariance(i,p,nt.MAX_INDIVIDUAL_VARIANCE);v<c&&(c=v,f=g)}if(f>=0)return f;throw new z}}nt.MAX_AVG_VARIANCE=.48,nt.MAX_INDIVIDUAL_VARIANCE=.7,nt.START_END_PATTERN=Int32Array.from([1,1,1]),nt.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),nt.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),nt.L_PATTERNS=[Int32Array.from([3,2,1,1]),Int32Array.from([2,2,2,1]),Int32Array.from([2,1,2,2]),Int32Array.from([1,4,1,1]),Int32Array.from([1,1,3,2]),Int32Array.from([1,2,3,1]),Int32Array.from([1,1,1,4]),Int32Array.from([1,3,1,2]),Int32Array.from([1,2,1,3]),Int32Array.from([3,1,1,2])];class zs{constructor(){this.CHECK_DIGIT_ENCODINGS=[24,20,18,17,12,6,3,10,9,5],this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}decodeRow(n,i,s){let a=this.decodeRowStringBuffer,c=this.decodeMiddle(i,s,a),f=a.toString(),d=zs.parseExtensionString(f),g=[new ce((s[0]+s[1])/2,n),new ce(c,n)],p=new Qe(f,null,0,g,ue.UPC_EAN_EXTENSION,new Date().getTime());return d!=null&&p.putAllMetadata(d),p}decodeMiddle(n,i,s){let a=this.decodeMiddleCounters;a[0]=0,a[1]=0,a[2]=0,a[3]=0;let c=n.getSize(),f=i[1],d=0;for(let p=0;p<5&&f<c;p++){let v=nt.decodeDigit(n,a,f,nt.L_AND_G_PATTERNS);s+=String.fromCharCode(48+v%10);for(let A of a)f+=A;v>=10&&(d|=1<<4-p),p!==4&&(f=n.getNextSet(f),f=n.getNextUnset(f))}if(s.length!==5)throw new z;let g=this.determineCheckDigit(d);if(zs.extensionChecksum(s.toString())!==g)throw new z;return f}static extensionChecksum(n){let i=n.length,s=0;for(let a=i-2;a>=0;a-=2)s+=n.charAt(a).charCodeAt(0)-48;s*=3;for(let a=i-1;a>=0;a-=2)s+=n.charAt(a).charCodeAt(0)-48;return s*=3,s%10}determineCheckDigit(n){for(let i=0;i<10;i++)if(n===this.CHECK_DIGIT_ENCODINGS[i])return i;throw new z}static parseExtensionString(n){if(n.length!==5)return null;let i=zs.parseExtension5String(n);return i==null?null:new Map([[Ct.SUGGESTED_PRICE,i]])}static parseExtension5String(n){let i;switch(n.charAt(0)){case"0":i="£";break;case"5":i="$";break;case"9":switch(n){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}i="";break;default:i="";break}let s=parseInt(n.substring(1)),a=(s/100).toString(),c=s%100,f=c<10?"0"+c:c.toString();return i+a+"."+f}}class nu{constructor(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}decodeRow(n,i,s){let a=this.decodeRowStringBuffer,c=this.decodeMiddle(i,s,a),f=a.toString(),d=nu.parseExtensionString(f),g=[new ce((s[0]+s[1])/2,n),new ce(c,n)],p=new Qe(f,null,0,g,ue.UPC_EAN_EXTENSION,new Date().getTime());return d!=null&&p.putAllMetadata(d),p}decodeMiddle(n,i,s){let a=this.decodeMiddleCounters;a[0]=0,a[1]=0,a[2]=0,a[3]=0;let c=n.getSize(),f=i[1],d=0;for(let g=0;g<2&&f<c;g++){let p=nt.decodeDigit(n,a,f,nt.L_AND_G_PATTERNS);s+=String.fromCharCode(48+p%10);for(let v of a)f+=v;p>=10&&(d|=1<<1-g),g!==1&&(f=n.getNextSet(f),f=n.getNextUnset(f))}if(s.length!==2)throw new z;if(parseInt(s.toString())%4!==d)throw new z;return f}static parseExtensionString(n){return n.length!==2?null:new Map([[Ct.ISSUE_NUMBER,parseInt(n)]])}}class nh{static decodeRow(n,i,s){let a=nt.findGuardPattern(i,s,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{return new zs().decodeRow(n,i,a)}catch{return new nu().decodeRow(n,i,a)}}}nh.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]);class ke extends nt{constructor(){super(),this.decodeRowStringBuffer="",ke.L_AND_G_PATTERNS=ke.L_PATTERNS.map(n=>Int32Array.from(n));for(let n=10;n<20;n++){let i=ke.L_PATTERNS[n-10],s=new Int32Array(i.length);for(let a=0;a<i.length;a++)s[a]=i[i.length-a-1];ke.L_AND_G_PATTERNS[n]=s}}decodeRow(n,i,s){let a=ke.findStartGuardPattern(i),c=s==null?null:s.get(U.NEED_RESULT_POINT_CALLBACK);if(c!=null){const Z=new ce((a[0]+a[1])/2,n);c.foundPossibleResultPoint(Z)}let f=this.decodeMiddle(i,a,this.decodeRowStringBuffer),d=f.rowOffset,g=f.resultString;if(c!=null){const Z=new ce(d,n);c.foundPossibleResultPoint(Z)}let p=this.decodeEnd(i,d);if(c!=null){const Z=new ce((p[0]+p[1])/2,n);c.foundPossibleResultPoint(Z)}let v=p[1],A=v+(v-p[0]);if(A>=i.getSize()||!i.isRange(v,A,!1))throw new z;let S=g.toString();if(S.length<8)throw new F;if(!ke.checkChecksum(S))throw new T;let N=(a[1]+a[0])/2,P=(p[1]+p[0])/2,B=this.getBarcodeFormat(),W=[new ce(N,n),new ce(P,n)],G=new Qe(S,null,0,W,B,new Date().getTime()),J=0;try{let Z=nh.decodeRow(n,i,p[1]);G.putMetadata(Ct.UPC_EAN_EXTENSION,Z.getText()),G.putAllMetadata(Z.getResultMetadata()),G.addResultPoints(Z.getResultPoints()),J=Z.getText().length}catch{}let ee=s==null?null:s.get(U.ALLOWED_EAN_EXTENSIONS);if(ee!=null){let Z=!1;for(let Se in ee)if(J.toString()===Se){Z=!0;break}if(!Z)throw new z}return G}decodeEnd(n,i){return ke.findGuardPattern(n,i,!1,ke.START_END_PATTERN,new Int32Array(ke.START_END_PATTERN.length).fill(0))}static checkChecksum(n){return ke.checkStandardUPCEANChecksum(n)}static checkStandardUPCEANChecksum(n){let i=n.length;if(i===0)return!1;let s=parseInt(n.charAt(i-1),10);return ke.getStandardUPCEANChecksum(n.substring(0,i-1))===s}static getStandardUPCEANChecksum(n){let i=n.length,s=0;for(let a=i-1;a>=0;a-=2){let c=n.charAt(a).charCodeAt(0)-48;if(c<0||c>9)throw new F;s+=c}s*=3;for(let a=i-2;a>=0;a-=2){let c=n.charAt(a).charCodeAt(0)-48;if(c<0||c>9)throw new F;s+=c}return(1e3-s)%10}}class li extends ke{constructor(){super(),this.decodeMiddleCounters=Int32Array.from([0,0,0,0])}decodeMiddle(n,i,s){let a=this.decodeMiddleCounters;a[0]=0,a[1]=0,a[2]=0,a[3]=0;let c=n.getSize(),f=i[1],d=0;for(let p=0;p<6&&f<c;p++){let v=ke.decodeDigit(n,a,f,ke.L_AND_G_PATTERNS);s+=String.fromCharCode(48+v%10);for(let A of a)f+=A;v>=10&&(d|=1<<5-p)}s=li.determineFirstDigit(s,d),f=ke.findGuardPattern(n,f,!0,ke.MIDDLE_PATTERN,new Int32Array(ke.MIDDLE_PATTERN.length).fill(0))[1];for(let p=0;p<6&&f<c;p++){let v=ke.decodeDigit(n,a,f,ke.L_PATTERNS);s+=String.fromCharCode(48+v);for(let A of a)f+=A}return{rowOffset:f,resultString:s}}getBarcodeFormat(){return ue.EAN_13}static determineFirstDigit(n,i){for(let s=0;s<10;s++)if(i===this.FIRST_DIGIT_ENCODINGS[s])return n=String.fromCharCode(48+s)+n,n;throw new z}}li.FIRST_DIGIT_ENCODINGS=[0,11,13,14,19,25,28,21,22,26];class ih extends ke{constructor(){super(),this.decodeMiddleCounters=Int32Array.from([0,0,0,0])}decodeMiddle(n,i,s){const a=this.decodeMiddleCounters;a[0]=0,a[1]=0,a[2]=0,a[3]=0;let c=n.getSize(),f=i[1];for(let g=0;g<4&&f<c;g++){let p=ke.decodeDigit(n,a,f,ke.L_PATTERNS);s+=String.fromCharCode(48+p);for(let v of a)f+=v}f=ke.findGuardPattern(n,f,!0,ke.MIDDLE_PATTERN,new Int32Array(ke.MIDDLE_PATTERN.length).fill(0))[1];for(let g=0;g<4&&f<c;g++){let p=ke.decodeDigit(n,a,f,ke.L_PATTERNS);s+=String.fromCharCode(48+p);for(let v of a)f+=v}return{rowOffset:f,resultString:s}}getBarcodeFormat(){return ue.EAN_8}}class sh extends ke{constructor(){super(...arguments),this.ean13Reader=new li}getBarcodeFormat(){return ue.UPC_A}decode(n,i){return this.maybeReturnResult(this.ean13Reader.decode(n))}decodeRow(n,i,s){return this.maybeReturnResult(this.ean13Reader.decodeRow(n,i,s))}decodeMiddle(n,i,s){return this.ean13Reader.decodeMiddle(n,i,s)}maybeReturnResult(n){let i=n.getText();if(i.charAt(0)==="0"){let s=new Qe(i.substring(1),null,null,n.getResultPoints(),ue.UPC_A);return n.getResultMetadata()!=null&&s.putAllMetadata(n.getResultMetadata()),s}else throw new z}reset(){this.ean13Reader.reset()}}class Mr extends ke{constructor(){super(),this.decodeMiddleCounters=new Int32Array(4)}decodeMiddle(n,i,s){const a=this.decodeMiddleCounters.map(p=>p);a[0]=0,a[1]=0,a[2]=0,a[3]=0;const c=n.getSize();let f=i[1],d=0;for(let p=0;p<6&&f<c;p++){const v=Mr.decodeDigit(n,a,f,Mr.L_AND_G_PATTERNS);s+=String.fromCharCode(48+v%10);for(let A of a)f+=A;v>=10&&(d|=1<<5-p)}let g=Mr.determineNumSysAndCheckDigit(s,d);return{rowOffset:f,resultString:g}}decodeEnd(n,i){return Mr.findGuardPatternWithoutCounters(n,i,!0,Mr.MIDDLE_END_PATTERN)}checkChecksum(n){return ke.checkChecksum(Mr.convertUPCEtoUPCA(n))}static determineNumSysAndCheckDigit(n,i){for(let s=0;s<=1;s++)for(let a=0;a<10;a++)if(i===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[s][a]){let c=String.fromCharCode(48+s),f=String.fromCharCode(48+a);return c+n+f}throw z.getNotFoundInstance()}getBarcodeFormat(){return ue.UPC_E}static convertUPCEtoUPCA(n){const i=n.slice(1,7).split("").map(c=>c.charCodeAt(0)),s=new xe;s.append(n.charAt(0));let a=i[5];switch(a){case 0:case 1:case 2:s.appendChars(i,0,2),s.append(a),s.append("0000"),s.appendChars(i,2,3);break;case 3:s.appendChars(i,0,3),s.append("00000"),s.appendChars(i,3,2);break;case 4:s.appendChars(i,0,4),s.append("00000"),s.append(i[4]);break;default:s.appendChars(i,0,5),s.append("0000"),s.append(a);break}return n.length>=8&&s.append(n.charAt(7)),s.toString()}}Mr.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),Mr.NUMSYS_AND_CHECK_DIGIT_PATTERNS=[Int32Array.from([56,52,50,49,44,38,35,42,41,37]),Int32Array.from([7,11,13,14,19,25,28,21,22,26])];class iu extends ht{constructor(n){super();let i=n==null?null:n.get(U.POSSIBLE_FORMATS),s=[];o(i)?(s.push(new li),s.push(new sh),s.push(new ih),s.push(new Mr)):(i.indexOf(ue.EAN_13)>-1&&s.push(new li),i.indexOf(ue.UPC_A)>-1&&s.push(new sh),i.indexOf(ue.EAN_8)>-1&&s.push(new ih),i.indexOf(ue.UPC_E)>-1&&s.push(new Mr)),this.readers=s}decodeRow(n,i,s){for(let a of this.readers)try{const c=a.decodeRow(n,i,s),f=c.getBarcodeFormat()===ue.EAN_13&&c.getText().charAt(0)==="0",d=s==null?null:s.get(U.POSSIBLE_FORMATS),g=d==null||d.includes(ue.UPC_A);if(f&&g){const p=c.getRawBytes(),v=new Qe(c.getText().substring(1),p,p?p.length:null,c.getResultPoints(),ue.UPC_A);return v.putAllMetadata(c.getResultMetadata()),v}return c}catch{}throw new z}reset(){for(let n of this.readers)n.reset()}}class Ft extends ht{constructor(){super(),this.decodeFinderCounters=new Int32Array(4),this.dataCharacterCounters=new Int32Array(8),this.oddRoundingErrors=new Array(4),this.evenRoundingErrors=new Array(4),this.oddCounts=new Array(this.dataCharacterCounters.length/2),this.evenCounts=new Array(this.dataCharacterCounters.length/2)}getDecodeFinderCounters(){return this.decodeFinderCounters}getDataCharacterCounters(){return this.dataCharacterCounters}getOddRoundingErrors(){return this.oddRoundingErrors}getEvenRoundingErrors(){return this.evenRoundingErrors}getOddCounts(){return this.oddCounts}getEvenCounts(){return this.evenCounts}parseFinderValue(n,i){for(let s=0;s<i.length;s++)if(ht.patternMatchVariance(n,i[s],Ft.MAX_INDIVIDUAL_VARIANCE)<Ft.MAX_AVG_VARIANCE)return s;throw new z}static count(n){return Re.sum(new Int32Array(n))}static increment(n,i){let s=0,a=i[0];for(let c=1;c<n.length;c++)i[c]>a&&(a=i[c],s=c);n[s]++}static decrement(n,i){let s=0,a=i[0];for(let c=1;c<n.length;c++)i[c]<a&&(a=i[c],s=c);n[s]--}static isFinderPattern(n){let i=n[0]+n[1],s=i+n[2]+n[3],a=i/s;if(a>=Ft.MIN_FINDER_PATTERN_RATIO&&a<=Ft.MAX_FINDER_PATTERN_RATIO){let c=Number.MAX_SAFE_INTEGER,f=Number.MIN_SAFE_INTEGER;for(let d of n)d>f&&(f=d),d<c&&(c=d);return f<10*c}return!1}}Ft.MAX_AVG_VARIANCE=.2,Ft.MAX_INDIVIDUAL_VARIANCE=.45,Ft.MIN_FINDER_PATTERN_RATIO=9.5/12,Ft.MAX_FINDER_PATTERN_RATIO=12.5/14;class Wi{constructor(n,i){this.value=n,this.checksumPortion=i}getValue(){return this.value}getChecksumPortion(){return this.checksumPortion}toString(){return this.value+"("+this.checksumPortion+")"}equals(n){if(!(n instanceof Wi))return!1;const i=n;return this.value===i.value&&this.checksumPortion===i.checksumPortion}hashCode(){return this.value^this.checksumPortion}}class ba{constructor(n,i,s,a,c){this.value=n,this.startEnd=i,this.value=n,this.startEnd=i,this.resultPoints=new Array,this.resultPoints.push(new ce(s,c)),this.resultPoints.push(new ce(a,c))}getValue(){return this.value}getStartEnd(){return this.startEnd}getResultPoints(){return this.resultPoints}equals(n){if(!(n instanceof ba))return!1;const i=n;return this.value===i.value}hashCode(){return this.value}}class Yr{constructor(){}static getRSSvalue(n,i,s){let a=0;for(let g of n)a+=g;let c=0,f=0,d=n.length;for(let g=0;g<d-1;g++){let p;for(p=1,f|=1<<g;p<n[g];p++,f&=~(1<<g)){let v=Yr.combins(a-p-1,d-g-2);if(s&&f===0&&a-p-(d-g-1)>=d-g-1&&(v-=Yr.combins(a-p-(d-g),d-g-2)),d-g-1>1){let A=0;for(let S=a-p-(d-g-2);S>i;S--)A+=Yr.combins(a-p-S-1,d-g-3);v-=A*(d-1-g)}else a-p>i&&v--;c+=v}a-=p}return c}static combins(n,i){let s,a;n-i>i?(a=i,s=n-i):(a=n-i,s=i);let c=1,f=1;for(let d=n;d>s;d--)c*=d,f<=a&&(c/=f,f++);for(;f<=a;)c/=f,f++;return c}}class Fy{static buildBitArray(n){let i=n.length*2-1;n[n.length-1].getRightChar()==null&&(i-=1);let s=12*i,a=new L(s),c=0,d=n[0].getRightChar().getValue();for(let g=11;g>=0;--g)d&1<<g&&a.set(c),c++;for(let g=1;g<n.length;++g){let p=n[g],v=p.getLeftChar().getValue();for(let A=11;A>=0;--A)v&1<<A&&a.set(c),c++;if(p.getRightChar()!=null){let A=p.getRightChar().getValue();for(let S=11;S>=0;--S)A&1<<S&&a.set(c),c++}}return a}}class ci{constructor(n,i){i?this.decodedInformation=null:(this.finished=n,this.decodedInformation=i)}getDecodedInformation(){return this.decodedInformation}isFinished(){return this.finished}}class su{constructor(n){this.newPosition=n}getNewPosition(){return this.newPosition}}class qt extends su{constructor(n,i){super(n),this.value=i}getValue(){return this.value}isFNC1(){return this.value===qt.FNC1}}qt.FNC1="$";class ui extends su{constructor(n,i,s){super(n),s?(this.remaining=!0,this.remainingValue=this.remainingValue):(this.remaining=!1,this.remainingValue=0),this.newString=i}getNewString(){return this.newString}isRemaining(){return this.remaining}getRemainingValue(){return this.remainingValue}}class Ar extends su{constructor(n,i,s){if(super(n),i<0||i>10||s<0||s>10)throw new F;this.firstDigit=i,this.secondDigit=s}getFirstDigit(){return this.firstDigit}getSecondDigit(){return this.secondDigit}getValue(){return this.firstDigit*10+this.secondDigit}isFirstDigitFNC1(){return this.firstDigit===Ar.FNC1}isSecondDigitFNC1(){return this.secondDigit===Ar.FNC1}isAnyFNC1(){return this.firstDigit===Ar.FNC1||this.secondDigit===Ar.FNC1}}Ar.FNC1=10;class ae{constructor(){}static parseFieldsInGeneralPurpose(n){if(!n)return null;if(n.length<2)throw new z;let i=n.substring(0,2);for(let c of ae.TWO_DIGIT_DATA_LENGTH)if(c[0]===i)return c[1]===ae.VARIABLE_LENGTH?ae.processVariableAI(2,c[2],n):ae.processFixedAI(2,c[1],n);if(n.length<3)throw new z;let s=n.substring(0,3);for(let c of ae.THREE_DIGIT_DATA_LENGTH)if(c[0]===s)return c[1]===ae.VARIABLE_LENGTH?ae.processVariableAI(3,c[2],n):ae.processFixedAI(3,c[1],n);for(let c of ae.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH)if(c[0]===s)return c[1]===ae.VARIABLE_LENGTH?ae.processVariableAI(4,c[2],n):ae.processFixedAI(4,c[1],n);if(n.length<4)throw new z;let a=n.substring(0,4);for(let c of ae.FOUR_DIGIT_DATA_LENGTH)if(c[0]===a)return c[1]===ae.VARIABLE_LENGTH?ae.processVariableAI(4,c[2],n):ae.processFixedAI(4,c[1],n);throw new z}static processFixedAI(n,i,s){if(s.length<n)throw new z;let a=s.substring(0,n);if(s.length<n+i)throw new z;let c=s.substring(n,n+i),f=s.substring(n+i),d="("+a+")"+c,g=ae.parseFieldsInGeneralPurpose(f);return g==null?d:d+g}static processVariableAI(n,i,s){let a=s.substring(0,n),c;s.length<n+i?c=s.length:c=n+i;let f=s.substring(n,c),d=s.substring(c),g="("+a+")"+f,p=ae.parseFieldsInGeneralPurpose(d);return p==null?g:g+p}}ae.VARIABLE_LENGTH=[],ae.TWO_DIGIT_DATA_LENGTH=[["00",18],["01",14],["02",14],["10",ae.VARIABLE_LENGTH,20],["11",6],["12",6],["13",6],["15",6],["17",6],["20",2],["21",ae.VARIABLE_LENGTH,20],["22",ae.VARIABLE_LENGTH,29],["30",ae.VARIABLE_LENGTH,8],["37",ae.VARIABLE_LENGTH,8],["90",ae.VARIABLE_LENGTH,30],["91",ae.VARIABLE_LENGTH,30],["92",ae.VARIABLE_LENGTH,30],["93",ae.VARIABLE_LENGTH,30],["94",ae.VARIABLE_LENGTH,30],["95",ae.VARIABLE_LENGTH,30],["96",ae.VARIABLE_LENGTH,30],["97",ae.VARIABLE_LENGTH,3],["98",ae.VARIABLE_LENGTH,30],["99",ae.VARIABLE_LENGTH,30]],ae.THREE_DIGIT_DATA_LENGTH=[["240",ae.VARIABLE_LENGTH,30],["241",ae.VARIABLE_LENGTH,30],["242",ae.VARIABLE_LENGTH,6],["250",ae.VARIABLE_LENGTH,30],["251",ae.VARIABLE_LENGTH,30],["253",ae.VARIABLE_LENGTH,17],["254",ae.VARIABLE_LENGTH,20],["400",ae.VARIABLE_LENGTH,30],["401",ae.VARIABLE_LENGTH,30],["402",17],["403",ae.VARIABLE_LENGTH,30],["410",13],["411",13],["412",13],["413",13],["414",13],["420",ae.VARIABLE_LENGTH,20],["421",ae.VARIABLE_LENGTH,15],["422",3],["423",ae.VARIABLE_LENGTH,15],["424",3],["425",3],["426",3]],ae.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH=[["310",6],["311",6],["312",6],["313",6],["314",6],["315",6],["316",6],["320",6],["321",6],["322",6],["323",6],["324",6],["325",6],["326",6],["327",6],["328",6],["329",6],["330",6],["331",6],["332",6],["333",6],["334",6],["335",6],["336",6],["340",6],["341",6],["342",6],["343",6],["344",6],["345",6],["346",6],["347",6],["348",6],["349",6],["350",6],["351",6],["352",6],["353",6],["354",6],["355",6],["356",6],["357",6],["360",6],["361",6],["362",6],["363",6],["364",6],["365",6],["366",6],["367",6],["368",6],["369",6],["390",ae.VARIABLE_LENGTH,15],["391",ae.VARIABLE_LENGTH,18],["392",ae.VARIABLE_LENGTH,15],["393",ae.VARIABLE_LENGTH,18],["703",ae.VARIABLE_LENGTH,30]],ae.FOUR_DIGIT_DATA_LENGTH=[["7001",13],["7002",ae.VARIABLE_LENGTH,30],["7003",10],["8001",14],["8002",ae.VARIABLE_LENGTH,20],["8003",ae.VARIABLE_LENGTH,30],["8004",ae.VARIABLE_LENGTH,30],["8005",6],["8006",18],["8007",ae.VARIABLE_LENGTH,30],["8008",ae.VARIABLE_LENGTH,12],["8018",18],["8020",ae.VARIABLE_LENGTH,25],["8100",6],["8101",10],["8102",2],["8110",ae.VARIABLE_LENGTH,70],["8200",ae.VARIABLE_LENGTH,70]];class Vi{constructor(n){this.buffer=new xe,this.information=n}decodeAllCodes(n,i){let s=i,a=null;do{let c=this.decodeGeneralPurposeField(s,a),f=ae.parseFieldsInGeneralPurpose(c.getNewString());if(f!=null&&n.append(f),c.isRemaining()?a=""+c.getRemainingValue():a=null,s===c.getNewPosition())break;s=c.getNewPosition()}while(!0);return n.toString()}isStillNumeric(n){if(n+7>this.information.getSize())return n+4<=this.information.getSize();for(let i=n;i<n+3;++i)if(this.information.get(i))return!0;return this.information.get(n+3)}decodeNumeric(n){if(n+7>this.information.getSize()){let c=this.extractNumericValueFromBitArray(n,4);return c===0?new Ar(this.information.getSize(),Ar.FNC1,Ar.FNC1):new Ar(this.information.getSize(),c-1,Ar.FNC1)}let i=this.extractNumericValueFromBitArray(n,7),s=(i-8)/11,a=(i-8)%11;return new Ar(n+7,s,a)}extractNumericValueFromBitArray(n,i){return Vi.extractNumericValueFromBitArray(this.information,n,i)}static extractNumericValueFromBitArray(n,i,s){let a=0;for(let c=0;c<s;++c)n.get(i+c)&&(a|=1<<s-c-1);return a}decodeGeneralPurposeField(n,i){this.buffer.setLengthToZero(),i!=null&&this.buffer.append(i),this.current.setPosition(n);let s=this.parseBlocks();return s!=null&&s.isRemaining()?new ui(this.current.getPosition(),this.buffer.toString(),s.getRemainingValue()):new ui(this.current.getPosition(),this.buffer.toString())}parseBlocks(){let n,i;do{let s=this.current.getPosition();if(this.current.isAlpha()?(i=this.parseAlphaBlock(),n=i.isFinished()):this.current.isIsoIec646()?(i=this.parseIsoIec646Block(),n=i.isFinished()):(i=this.parseNumericBlock(),n=i.isFinished()),!(s!==this.current.getPosition())&&!n)break}while(!n);return i.getDecodedInformation()}parseNumericBlock(){for(;this.isStillNumeric(this.current.getPosition());){let n=this.decodeNumeric(this.current.getPosition());if(this.current.setPosition(n.getNewPosition()),n.isFirstDigitFNC1()){let i;return n.isSecondDigitFNC1()?i=new ui(this.current.getPosition(),this.buffer.toString()):i=new ui(this.current.getPosition(),this.buffer.toString(),n.getSecondDigit()),new ci(!0,i)}if(this.buffer.append(n.getFirstDigit()),n.isSecondDigitFNC1()){let i=new ui(this.current.getPosition(),this.buffer.toString());return new ci(!0,i)}this.buffer.append(n.getSecondDigit())}return this.isNumericToAlphaNumericLatch(this.current.getPosition())&&(this.current.setAlpha(),this.current.incrementPosition(4)),new ci(!1)}parseIsoIec646Block(){for(;this.isStillIsoIec646(this.current.getPosition());){let n=this.decodeIsoIec646(this.current.getPosition());if(this.current.setPosition(n.getNewPosition()),n.isFNC1()){let i=new ui(this.current.getPosition(),this.buffer.toString());return new ci(!0,i)}this.buffer.append(n.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setAlpha()),new ci(!1)}parseAlphaBlock(){for(;this.isStillAlpha(this.current.getPosition());){let n=this.decodeAlphanumeric(this.current.getPosition());if(this.current.setPosition(n.getNewPosition()),n.isFNC1()){let i=new ui(this.current.getPosition(),this.buffer.toString());return new ci(!0,i)}this.buffer.append(n.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setIsoIec646()),new ci(!1)}isStillIsoIec646(n){if(n+5>this.information.getSize())return!1;let i=this.extractNumericValueFromBitArray(n,5);if(i>=5&&i<16)return!0;if(n+7>this.information.getSize())return!1;let s=this.extractNumericValueFromBitArray(n,7);if(s>=64&&s<116)return!0;if(n+8>this.information.getSize())return!1;let a=this.extractNumericValueFromBitArray(n,8);return a>=232&&a<253}decodeIsoIec646(n){let i=this.extractNumericValueFromBitArray(n,5);if(i===15)return new qt(n+5,qt.FNC1);if(i>=5&&i<15)return new qt(n+5,"0"+(i-5));let s=this.extractNumericValueFromBitArray(n,7);if(s>=64&&s<90)return new qt(n+7,""+(s+1));if(s>=90&&s<116)return new qt(n+7,""+(s+7));let a=this.extractNumericValueFromBitArray(n,8),c;switch(a){case 232:c="!";break;case 233:c='"';break;case 234:c="%";break;case 235:c="&";break;case 236:c="'";break;case 237:c="(";break;case 238:c=")";break;case 239:c="*";break;case 240:c="+";break;case 241:c=",";break;case 242:c="-";break;case 243:c=".";break;case 244:c="/";break;case 245:c=":";break;case 246:c=";";break;case 247:c="<";break;case 248:c="=";break;case 249:c=">";break;case 250:c="?";break;case 251:c="_";break;case 252:c=" ";break;default:throw new F}return new qt(n+8,c)}isStillAlpha(n){if(n+5>this.information.getSize())return!1;let i=this.extractNumericValueFromBitArray(n,5);if(i>=5&&i<16)return!0;if(n+6>this.information.getSize())return!1;let s=this.extractNumericValueFromBitArray(n,6);return s>=16&&s<63}decodeAlphanumeric(n){let i=this.extractNumericValueFromBitArray(n,5);if(i===15)return new qt(n+5,qt.FNC1);if(i>=5&&i<15)return new qt(n+5,"0"+(i-5));let s=this.extractNumericValueFromBitArray(n,6);if(s>=32&&s<58)return new qt(n+6,""+(s+33));let a;switch(s){case 58:a="*";break;case 59:a=",";break;case 60:a="-";break;case 61:a=".";break;case 62:a="/";break;default:throw new Xr("Decoding invalid alphanumeric value: "+s)}return new qt(n+6,a)}isAlphaTo646ToAlphaLatch(n){if(n+1>this.information.getSize())return!1;for(let i=0;i<5&&i+n<this.information.getSize();++i)if(i===2){if(!this.information.get(n+2))return!1}else if(this.information.get(n+i))return!1;return!0}isAlphaOr646ToNumericLatch(n){if(n+3>this.information.getSize())return!1;for(let i=n;i<n+3;++i)if(this.information.get(i))return!1;return!0}isNumericToAlphaNumericLatch(n){if(n+1>this.information.getSize())return!1;for(let i=0;i<4&&i+n<this.information.getSize();++i)if(this.information.get(n+i))return!1;return!0}}class ou{constructor(n){this.information=n,this.generalDecoder=new Vi(n)}getInformation(){return this.information}getGeneralDecoder(){return this.generalDecoder}}class Jt extends ou{constructor(n){super(n)}encodeCompressedGtin(n,i){n.append("(01)");let s=n.length();n.append("9"),this.encodeCompressedGtinWithoutAI(n,i,s)}encodeCompressedGtinWithoutAI(n,i,s){for(let a=0;a<4;++a){let c=this.getGeneralDecoder().extractNumericValueFromBitArray(i+10*a,10);c/100===0&&n.append("0"),c/10===0&&n.append("0"),n.append(c)}Jt.appendCheckDigit(n,s)}static appendCheckDigit(n,i){let s=0;for(let a=0;a<13;a++){let c=n.charAt(a+i).charCodeAt(0)-48;s+=a&1?c:3*c}s=10-s%10,s===10&&(s=0),n.append(s)}}Jt.GTIN_SIZE=40;class zi extends Jt{constructor(n){super(n)}parseInformation(){let n=new xe;n.append("(01)");let i=n.length(),s=this.getGeneralDecoder().extractNumericValueFromBitArray(zi.HEADER_SIZE,4);return n.append(s),this.encodeCompressedGtinWithoutAI(n,zi.HEADER_SIZE+4,i),this.getGeneralDecoder().decodeAllCodes(n,zi.HEADER_SIZE+44)}}zi.HEADER_SIZE=4;class Ca extends ou{constructor(n){super(n)}parseInformation(){let n=new xe;return this.getGeneralDecoder().decodeAllCodes(n,Ca.HEADER_SIZE)}}Ca.HEADER_SIZE=5;class Sa extends Jt{constructor(n){super(n)}encodeCompressedWeight(n,i,s){let a=this.getGeneralDecoder().extractNumericValueFromBitArray(i,s);this.addWeightCode(n,a);let c=this.checkWeight(a),f=1e5;for(let d=0;d<5;++d)c/f===0&&n.append("0"),f/=10;n.append(c)}}class Kr extends Sa{constructor(n){super(n)}parseInformation(){if(this.getInformation().getSize()!=Kr.HEADER_SIZE+Sa.GTIN_SIZE+Kr.WEIGHT_SIZE)throw new z;let n=new xe;return this.encodeCompressedGtin(n,Kr.HEADER_SIZE),this.encodeCompressedWeight(n,Kr.HEADER_SIZE+Sa.GTIN_SIZE,Kr.WEIGHT_SIZE),n.toString()}}Kr.HEADER_SIZE=5,Kr.WEIGHT_SIZE=15;class Uy extends Kr{constructor(n){super(n)}addWeightCode(n,i){n.append("(3103)")}checkWeight(n){return n}}class jy extends Kr{constructor(n){super(n)}addWeightCode(n,i){i<1e4?n.append("(3202)"):n.append("(3203)")}checkWeight(n){return n<1e4?n:n-1e4}}class Zr extends Jt{constructor(n){super(n)}parseInformation(){if(this.getInformation().getSize()<Zr.HEADER_SIZE+Jt.GTIN_SIZE)throw new z;let n=new xe;this.encodeCompressedGtin(n,Zr.HEADER_SIZE);let i=this.getGeneralDecoder().extractNumericValueFromBitArray(Zr.HEADER_SIZE+Jt.GTIN_SIZE,Zr.LAST_DIGIT_SIZE);n.append("(392"),n.append(i),n.append(")");let s=this.getGeneralDecoder().decodeGeneralPurposeField(Zr.HEADER_SIZE+Jt.GTIN_SIZE+Zr.LAST_DIGIT_SIZE,null);return n.append(s.getNewString()),n.toString()}}Zr.HEADER_SIZE=8,Zr.LAST_DIGIT_SIZE=2;class Ht extends Jt{constructor(n){super(n)}parseInformation(){if(this.getInformation().getSize()<Ht.HEADER_SIZE+Jt.GTIN_SIZE)throw new z;let n=new xe;this.encodeCompressedGtin(n,Ht.HEADER_SIZE);let i=this.getGeneralDecoder().extractNumericValueFromBitArray(Ht.HEADER_SIZE+Jt.GTIN_SIZE,Ht.LAST_DIGIT_SIZE);n.append("(393"),n.append(i),n.append(")");let s=this.getGeneralDecoder().extractNumericValueFromBitArray(Ht.HEADER_SIZE+Jt.GTIN_SIZE+Ht.LAST_DIGIT_SIZE,Ht.FIRST_THREE_DIGITS_SIZE);s/100==0&&n.append("0"),s/10==0&&n.append("0"),n.append(s);let a=this.getGeneralDecoder().decodeGeneralPurposeField(Ht.HEADER_SIZE+Jt.GTIN_SIZE+Ht.LAST_DIGIT_SIZE+Ht.FIRST_THREE_DIGITS_SIZE,null);return n.append(a.getNewString()),n.toString()}}Ht.HEADER_SIZE=8,Ht.LAST_DIGIT_SIZE=2,Ht.FIRST_THREE_DIGITS_SIZE=10;class Ye extends Sa{constructor(n,i,s){super(n),this.dateCode=s,this.firstAIdigits=i}parseInformation(){if(this.getInformation().getSize()!=Ye.HEADER_SIZE+Ye.GTIN_SIZE+Ye.WEIGHT_SIZE+Ye.DATE_SIZE)throw new z;let n=new xe;return this.encodeCompressedGtin(n,Ye.HEADER_SIZE),this.encodeCompressedWeight(n,Ye.HEADER_SIZE+Ye.GTIN_SIZE,Ye.WEIGHT_SIZE),this.encodeCompressedDate(n,Ye.HEADER_SIZE+Ye.GTIN_SIZE+Ye.WEIGHT_SIZE),n.toString()}encodeCompressedDate(n,i){let s=this.getGeneralDecoder().extractNumericValueFromBitArray(i,Ye.DATE_SIZE);if(s==38400)return;n.append("("),n.append(this.dateCode),n.append(")");let a=s%32;s/=32;let c=s%12+1;s/=12;let f=s;f/10==0&&n.append("0"),n.append(f),c/10==0&&n.append("0"),n.append(c),a/10==0&&n.append("0"),n.append(a)}addWeightCode(n,i){n.append("("),n.append(this.firstAIdigits),n.append(i/1e5),n.append(")")}checkWeight(n){return n%1e5}}Ye.HEADER_SIZE=8,Ye.WEIGHT_SIZE=20,Ye.DATE_SIZE=16;function oh(E){try{if(E.get(1))return new zi(E);if(!E.get(2))return new Ca(E);switch(Vi.extractNumericValueFromBitArray(E,1,4)){case 4:return new Uy(E);case 5:return new jy(E)}switch(Vi.extractNumericValueFromBitArray(E,1,5)){case 12:return new Zr(E);case 13:return new Ht(E)}switch(Vi.extractNumericValueFromBitArray(E,1,7)){case 56:return new Ye(E,"310","11");case 57:return new Ye(E,"320","11");case 58:return new Ye(E,"310","13");case 59:return new Ye(E,"320","13");case 60:return new Ye(E,"310","15");case 61:return new Ye(E,"320","15");case 62:return new Ye(E,"310","17");case 63:return new Ye(E,"320","17")}}catch(n){throw console.log(n),new Xr("unknown decoder: "+E)}}class On{constructor(n,i,s,a){this.leftchar=n,this.rightchar=i,this.finderpattern=s,this.maybeLast=a}mayBeLast(){return this.maybeLast}getLeftChar(){return this.leftchar}getRightChar(){return this.rightchar}getFinderPattern(){return this.finderpattern}mustBeLast(){return this.rightchar==null}toString(){return"[ "+this.leftchar+", "+this.rightchar+" : "+(this.finderpattern==null?"null":this.finderpattern.getValue())+" ]"}static equals(n,i){return n instanceof On?On.equalsOrNull(n.leftchar,i.leftchar)&&On.equalsOrNull(n.rightchar,i.rightchar)&&On.equalsOrNull(n.finderpattern,i.finderpattern):!1}static equalsOrNull(n,i){return n===null?i===null:On.equals(n,i)}hashCode(){return this.leftchar.getValue()^this.rightchar.getValue()^this.finderpattern.getValue()}}class au{constructor(n,i,s){this.pairs=n,this.rowNumber=i,this.wasReversed=s}getPairs(){return this.pairs}getRowNumber(){return this.rowNumber}isReversed(){return this.wasReversed}isEquivalent(n){return this.checkEqualitity(this,n)}toString(){return"{ "+this.pairs+" }"}equals(n,i){return n instanceof au?this.checkEqualitity(n,i)&&n.wasReversed===i.wasReversed:!1}checkEqualitity(n,i){if(!n||!i)return;let s;return n.forEach((a,c)=>{i.forEach(f=>{a.getLeftChar().getValue()===f.getLeftChar().getValue()&&a.getRightChar().getValue()===f.getRightChar().getValue()&&a.getFinderPatter().getValue()===f.getFinderPatter().getValue()&&(s=!0)})}),s}}class K extends Ft{constructor(n){super(...arguments),this.pairs=new Array(K.MAX_PAIRS),this.rows=new Array,this.startEnd=[2],this.verbose=n===!0}decodeRow(n,i,s){this.pairs.length=0,this.startFromEven=!1;try{return K.constructResult(this.decodeRow2pairs(n,i))}catch(a){this.verbose&&console.log(a)}return this.pairs.length=0,this.startFromEven=!0,K.constructResult(this.decodeRow2pairs(n,i))}reset(){this.pairs.length=0,this.rows.length=0}decodeRow2pairs(n,i){let s=!1;for(;!s;)try{this.pairs.push(this.retrieveNextPair(i,this.pairs,n))}catch(c){if(c instanceof z){if(!this.pairs.length)throw new z;s=!0}}if(this.checkChecksum())return this.pairs;let a;if(this.rows.length?a=!0:a=!1,this.storeRow(n,!1),a){let c=this.checkRowsBoolean(!1);if(c!=null||(c=this.checkRowsBoolean(!0),c!=null))return c}throw new z}checkRowsBoolean(n){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,n&&(this.rows=this.rows.reverse());let i=null;try{i=this.checkRows(new Array,0)}catch(s){this.verbose&&console.log(s)}return n&&(this.rows=this.rows.reverse()),i}checkRows(n,i){for(let s=i;s<this.rows.length;s++){let a=this.rows[s];this.pairs.length=0;for(let f of n)this.pairs.push(f.getPairs());if(this.pairs.push(a.getPairs()),!K.isValidSequence(this.pairs))continue;if(this.checkChecksum())return this.pairs;let c=new Array(n);c.push(a);try{return this.checkRows(c,s+1)}catch(f){this.verbose&&console.log(f)}}throw new z}static isValidSequence(n){for(let i of K.FINDER_PATTERN_SEQUENCES){if(n.length>i.length)continue;let s=!0;for(let a=0;a<n.length;a++)if(n[a].getFinderPattern().getValue()!=i[a]){s=!1;break}if(s)return!0}return!1}storeRow(n,i){let s=0,a=!1,c=!1;for(;s<this.rows.length;){let f=this.rows[s];if(f.getRowNumber()>n){c=f.isEquivalent(this.pairs);break}a=f.isEquivalent(this.pairs),s++}c||a||K.isPartialRow(this.pairs,this.rows)||(this.rows.push(s,new au(this.pairs,n,i)),this.removePartialRows(this.pairs,this.rows))}removePartialRows(n,i){for(let s of i)if(s.getPairs().length!==n.length){for(let a of s.getPairs())for(let c of n)if(On.equals(a,c))break}}static isPartialRow(n,i){for(let s of i){let a=!0;for(let c of n){let f=!1;for(let d of s.getPairs())if(c.equals(d)){f=!0;break}if(!f){a=!1;break}}if(a)return!0}return!1}getRows(){return this.rows}static constructResult(n){let i=Fy.buildBitArray(n),a=oh(i).parseInformation(),c=n[0].getFinderPattern().getResultPoints(),f=n[n.length-1].getFinderPattern().getResultPoints(),d=[c[0],c[1],f[0],f[1]];return new Qe(a,null,null,d,ue.RSS_EXPANDED,null)}checkChecksum(){let n=this.pairs.get(0),i=n.getLeftChar(),s=n.getRightChar();if(s==null)return!1;let a=s.getChecksumPortion(),c=2;for(let d=1;d<this.pairs.size();++d){let g=this.pairs.get(d);a+=g.getLeftChar().getChecksumPortion(),c++;let p=g.getRightChar();p!=null&&(a+=p.getChecksumPortion(),c++)}return a%=211,211*(c-4)+a==i.getValue()}static getNextSecondBar(n,i){let s;return n.get(i)?(s=n.getNextUnset(i),s=n.getNextSet(s)):(s=n.getNextSet(i),s=n.getNextUnset(s)),s}retrieveNextPair(n,i,s){let a=i.length%2==0;this.startFromEven&&(a=!a);let c,f=!0,d=-1;do this.findNextPair(n,i,d),c=this.parseFoundFinderPattern(n,s,a),c==null?d=K.getNextSecondBar(n,this.startEnd[0]):f=!1;while(f);let g=this.decodeDataCharacter(n,c,a,!0);if(!this.isEmptyPair(i)&&i[i.length-1].mustBeLast())throw new z;let p;try{p=this.decodeDataCharacter(n,c,a,!1)}catch(v){p=null,this.verbose&&console.log(v)}return new On(g,p,c,!0)}isEmptyPair(n){return n.length===0}findNextPair(n,i,s){let a=this.getDecodeFinderCounters();a[0]=0,a[1]=0,a[2]=0,a[3]=0;let c=n.getSize(),f;s>=0?f=s:this.isEmptyPair(i)?f=0:f=i[i.length-1].getFinderPattern().getStartEnd()[1];let d=i.length%2!=0;this.startFromEven&&(d=!d);let g=!1;for(;f<c&&(g=!n.get(f),!!g);)f++;let p=0,v=f;for(let A=f;A<c;A++)if(n.get(A)!=g)a[p]++;else{if(p==3){if(d&&K.reverseCounters(a),K.isFinderPattern(a)){this.startEnd[0]=v,this.startEnd[1]=A;return}d&&K.reverseCounters(a),v+=a[0]+a[1],a[0]=a[2],a[1]=a[3],a[2]=0,a[3]=0,p--}else p++;a[p]=1,g=!g}throw new z}static reverseCounters(n){let i=n.length;for(let s=0;s<i/2;++s){let a=n[s];n[s]=n[i-s-1],n[i-s-1]=a}}parseFoundFinderPattern(n,i,s){let a,c,f;if(s){let p=this.startEnd[0]-1;for(;p>=0&&!n.get(p);)p--;p++,a=this.startEnd[0]-p,c=p,f=this.startEnd[1]}else c=this.startEnd[0],f=n.getNextUnset(this.startEnd[1]+1),a=f-this.startEnd[1];let d=this.getDecodeFinderCounters();D.arraycopy(d,0,d,1,d.length-1),d[0]=a;let g;try{g=this.parseFinderValue(d,K.FINDER_PATTERNS)}catch{return null}return new ba(g,[c,f],c,f,i)}decodeDataCharacter(n,i,s,a){let c=this.getDataCharacterCounters();for(let We=0;We<c.length;We++)c[We]=0;if(a)K.recordPatternInReverse(n,i.getStartEnd()[0],c);else{K.recordPattern(n,i.getStartEnd()[1],c);for(let We=0,kt=c.length-1;We<kt;We++,kt--){let fr=c[We];c[We]=c[kt],c[kt]=fr}}let f=17,d=Re.sum(new Int32Array(c))/f,g=(i.getStartEnd()[1]-i.getStartEnd()[0])/15;if(Math.abs(d-g)/g>.3)throw new z;let p=this.getOddCounts(),v=this.getEvenCounts(),A=this.getOddRoundingErrors(),S=this.getEvenRoundingErrors();for(let We=0;We<c.length;We++){let kt=1*c[We]/d,fr=kt+.5;if(fr<1){if(kt<.3)throw new z;fr=1}else if(fr>8){if(kt>8.7)throw new z;fr=8}let Yi=We/2;We&1?(v[Yi]=fr,S[Yi]=kt-fr):(p[Yi]=fr,A[Yi]=kt-fr)}this.adjustOddEvenCounts(f);let N=4*i.getValue()+(s?0:2)+(a?0:1)-1,P=0,B=0;for(let We=p.length-1;We>=0;We--){if(K.isNotA1left(i,s,a)){let kt=K.WEIGHTS[N][2*We];B+=p[We]*kt}P+=p[We]}let W=0;for(let We=v.length-1;We>=0;We--)if(K.isNotA1left(i,s,a)){let kt=K.WEIGHTS[N][2*We+1];W+=v[We]*kt}let G=B+W;if(P&1||P>13||P<4)throw new z;let J=(13-P)/2,ee=K.SYMBOL_WIDEST[J],Z=9-ee,Se=Yr.getRSSvalue(p,ee,!0),ye=Yr.getRSSvalue(v,Z,!1),tr=K.EVEN_TOTAL_SUBSET[J],Dr=K.GSUM[J],rr=Se*tr+ye+Dr;return new Wi(rr,G)}static isNotA1left(n,i,s){return!(n.getValue()==0&&i&&s)}adjustOddEvenCounts(n){let i=Re.sum(new Int32Array(this.getOddCounts())),s=Re.sum(new Int32Array(this.getEvenCounts())),a=!1,c=!1;i>13?c=!0:i<4&&(a=!0);let f=!1,d=!1;s>13?d=!0:s<4&&(f=!0);let g=i+s-n,p=(i&1)==1,v=(s&1)==0;if(g==1)if(p){if(v)throw new z;c=!0}else{if(!v)throw new z;d=!0}else if(g==-1)if(p){if(v)throw new z;a=!0}else{if(!v)throw new z;f=!0}else if(g==0){if(p){if(!v)throw new z;i<s?(a=!0,d=!0):(c=!0,f=!0)}else if(v)throw new z}else throw new z;if(a){if(c)throw new z;K.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(c&&K.decrement(this.getOddCounts(),this.getOddRoundingErrors()),f){if(d)throw new z;K.increment(this.getEvenCounts(),this.getOddRoundingErrors())}d&&K.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())}}K.SYMBOL_WIDEST=[7,5,4,3,1],K.EVEN_TOTAL_SUBSET=[4,20,52,104,204],K.GSUM=[0,348,1388,2948,3988],K.FINDER_PATTERNS=[Int32Array.from([1,8,4,1]),Int32Array.from([3,6,4,1]),Int32Array.from([3,4,6,1]),Int32Array.from([3,2,8,1]),Int32Array.from([2,6,5,1]),Int32Array.from([2,2,9,1])],K.WEIGHTS=[[1,3,9,27,81,32,96,77],[20,60,180,118,143,7,21,63],[189,145,13,39,117,140,209,205],[193,157,49,147,19,57,171,91],[62,186,136,197,169,85,44,132],[185,133,188,142,4,12,36,108],[113,128,173,97,80,29,87,50],[150,28,84,41,123,158,52,156],[46,138,203,187,139,206,196,166],[76,17,51,153,37,111,122,155],[43,129,176,106,107,110,119,146],[16,48,144,10,30,90,59,177],[109,116,137,200,178,112,125,164],[70,210,208,202,184,130,179,115],[134,191,151,31,93,68,204,190],[148,22,66,198,172,94,71,2],[6,18,54,162,64,192,154,40],[120,149,25,75,14,42,126,167],[79,26,78,23,69,207,199,175],[103,98,83,38,114,131,182,124],[161,61,183,127,170,88,53,159],[55,165,73,8,24,72,5,15],[45,135,194,160,58,174,100,89]],K.FINDER_PAT_A=0,K.FINDER_PAT_B=1,K.FINDER_PAT_C=2,K.FINDER_PAT_D=3,K.FINDER_PAT_E=4,K.FINDER_PAT_F=5,K.FINDER_PATTERN_SEQUENCES=[[K.FINDER_PAT_A,K.FINDER_PAT_A],[K.FINDER_PAT_A,K.FINDER_PAT_B,K.FINDER_PAT_B],[K.FINDER_PAT_A,K.FINDER_PAT_C,K.FINDER_PAT_B,K.FINDER_PAT_D],[K.FINDER_PAT_A,K.FINDER_PAT_E,K.FINDER_PAT_B,K.FINDER_PAT_D,K.FINDER_PAT_C],[K.FINDER_PAT_A,K.FINDER_PAT_E,K.FINDER_PAT_B,K.FINDER_PAT_D,K.FINDER_PAT_D,K.FINDER_PAT_F],[K.FINDER_PAT_A,K.FINDER_PAT_E,K.FINDER_PAT_B,K.FINDER_PAT_D,K.FINDER_PAT_E,K.FINDER_PAT_F,K.FINDER_PAT_F],[K.FINDER_PAT_A,K.FINDER_PAT_A,K.FINDER_PAT_B,K.FINDER_PAT_B,K.FINDER_PAT_C,K.FINDER_PAT_C,K.FINDER_PAT_D,K.FINDER_PAT_D],[K.FINDER_PAT_A,K.FINDER_PAT_A,K.FINDER_PAT_B,K.FINDER_PAT_B,K.FINDER_PAT_C,K.FINDER_PAT_C,K.FINDER_PAT_D,K.FINDER_PAT_E,K.FINDER_PAT_E],[K.FINDER_PAT_A,K.FINDER_PAT_A,K.FINDER_PAT_B,K.FINDER_PAT_B,K.FINDER_PAT_C,K.FINDER_PAT_C,K.FINDER_PAT_D,K.FINDER_PAT_E,K.FINDER_PAT_F,K.FINDER_PAT_F],[K.FINDER_PAT_A,K.FINDER_PAT_A,K.FINDER_PAT_B,K.FINDER_PAT_B,K.FINDER_PAT_C,K.FINDER_PAT_D,K.FINDER_PAT_D,K.FINDER_PAT_E,K.FINDER_PAT_E,K.FINDER_PAT_F,K.FINDER_PAT_F]],K.MAX_PAIRS=11;class Wy extends Wi{constructor(n,i,s){super(n,i),this.count=0,this.finderPattern=s}getFinderPattern(){return this.finderPattern}getCount(){return this.count}incrementCount(){this.count++}}class it extends Ft{constructor(){super(...arguments),this.possibleLeftPairs=[],this.possibleRightPairs=[]}decodeRow(n,i,s){const a=this.decodePair(i,!1,n,s);it.addOrTally(this.possibleLeftPairs,a),i.reverse();let c=this.decodePair(i,!0,n,s);it.addOrTally(this.possibleRightPairs,c),i.reverse();for(let f of this.possibleLeftPairs)if(f.getCount()>1){for(let d of this.possibleRightPairs)if(d.getCount()>1&&it.checkChecksum(f,d))return it.constructResult(f,d)}throw new z}static addOrTally(n,i){if(i==null)return;let s=!1;for(let a of n)if(a.getValue()===i.getValue()){a.incrementCount(),s=!0;break}s||n.push(i)}reset(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0}static constructResult(n,i){let s=4537077*n.getValue()+i.getValue(),a=new String(s).toString(),c=new xe;for(let p=13-a.length;p>0;p--)c.append("0");c.append(a);let f=0;for(let p=0;p<13;p++){let v=c.charAt(p).charCodeAt(0)-48;f+=p&1?v:3*v}f=10-f%10,f===10&&(f=0),c.append(f.toString());let d=n.getFinderPattern().getResultPoints(),g=i.getFinderPattern().getResultPoints();return new Qe(c.toString(),null,0,[d[0],d[1],g[0],g[1]],ue.RSS_14,new Date().getTime())}static checkChecksum(n,i){let s=(n.getChecksumPortion()+16*i.getChecksumPortion())%79,a=9*n.getFinderPattern().getValue()+i.getFinderPattern().getValue();return a>72&&a--,a>8&&a--,s===a}decodePair(n,i,s,a){try{let c=this.findFinderPattern(n,i),f=this.parseFoundFinderPattern(n,s,i,c),d=a==null?null:a.get(U.NEED_RESULT_POINT_CALLBACK);if(d!=null){let v=(c[0]+c[1])/2;i&&(v=n.getSize()-1-v),d.foundPossibleResultPoint(new ce(v,s))}let g=this.decodeDataCharacter(n,f,!0),p=this.decodeDataCharacter(n,f,!1);return new Wy(1597*g.getValue()+p.getValue(),g.getChecksumPortion()+4*p.getChecksumPortion(),f)}catch{return null}}decodeDataCharacter(n,i,s){let a=this.getDataCharacterCounters();for(let W=0;W<a.length;W++)a[W]=0;if(s)ht.recordPatternInReverse(n,i.getStartEnd()[0],a);else{ht.recordPattern(n,i.getStartEnd()[1]+1,a);for(let W=0,G=a.length-1;W<G;W++,G--){let J=a[W];a[W]=a[G],a[G]=J}}let c=s?16:15,f=Re.sum(new Int32Array(a))/c,d=this.getOddCounts(),g=this.getEvenCounts(),p=this.getOddRoundingErrors(),v=this.getEvenRoundingErrors();for(let W=0;W<a.length;W++){let G=a[W]/f,J=Math.floor(G+.5);J<1?J=1:J>8&&(J=8);let ee=Math.floor(W/2);W&1?(g[ee]=J,v[ee]=G-J):(d[ee]=J,p[ee]=G-J)}this.adjustOddEvenCounts(s,c);let A=0,S=0;for(let W=d.length-1;W>=0;W--)S*=9,S+=d[W],A+=d[W];let N=0,P=0;for(let W=g.length-1;W>=0;W--)N*=9,N+=g[W],P+=g[W];let B=S+3*N;if(s){if(A&1||A>12||A<4)throw new z;let W=(12-A)/2,G=it.OUTSIDE_ODD_WIDEST[W],J=9-G,ee=Yr.getRSSvalue(d,G,!1),Z=Yr.getRSSvalue(g,J,!0),Se=it.OUTSIDE_EVEN_TOTAL_SUBSET[W],ye=it.OUTSIDE_GSUM[W];return new Wi(ee*Se+Z+ye,B)}else{if(P&1||P>10||P<4)throw new z;let W=(10-P)/2,G=it.INSIDE_ODD_WIDEST[W],J=9-G,ee=Yr.getRSSvalue(d,G,!0),Z=Yr.getRSSvalue(g,J,!1),Se=it.INSIDE_ODD_TOTAL_SUBSET[W],ye=it.INSIDE_GSUM[W];return new Wi(Z*Se+ee+ye,B)}}findFinderPattern(n,i){let s=this.getDecodeFinderCounters();s[0]=0,s[1]=0,s[2]=0,s[3]=0;let a=n.getSize(),c=!1,f=0;for(;f<a&&(c=!n.get(f),i!==c);)f++;let d=0,g=f;for(let p=f;p<a;p++)if(n.get(p)!==c)s[d]++;else{if(d===3){if(Ft.isFinderPattern(s))return[g,p];g+=s[0]+s[1],s[0]=s[2],s[1]=s[3],s[2]=0,s[3]=0,d--}else d++;s[d]=1,c=!c}throw new z}parseFoundFinderPattern(n,i,s,a){let c=n.get(a[0]),f=a[0]-1;for(;f>=0&&c!==n.get(f);)f--;f++;const d=a[0]-f,g=this.getDecodeFinderCounters(),p=new Int32Array(g.length);D.arraycopy(g,0,p,1,g.length-1),p[0]=d;const v=this.parseFinderValue(p,it.FINDER_PATTERNS);let A=f,S=a[1];return s&&(A=n.getSize()-1-A,S=n.getSize()-1-S),new ba(v,[f,a[1]],A,S,i)}adjustOddEvenCounts(n,i){let s=Re.sum(new Int32Array(this.getOddCounts())),a=Re.sum(new Int32Array(this.getEvenCounts())),c=!1,f=!1,d=!1,g=!1;n?(s>12?f=!0:s<4&&(c=!0),a>12?g=!0:a<4&&(d=!0)):(s>11?f=!0:s<5&&(c=!0),a>10?g=!0:a<4&&(d=!0));let p=s+a-i,v=(s&1)===(n?1:0),A=(a&1)===1;if(p===1)if(v){if(A)throw new z;f=!0}else{if(!A)throw new z;g=!0}else if(p===-1)if(v){if(A)throw new z;c=!0}else{if(!A)throw new z;d=!0}else if(p===0){if(v){if(!A)throw new z;s<a?(c=!0,g=!0):(f=!0,d=!0)}else if(A)throw new z}else throw new z;if(c){if(f)throw new z;Ft.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(f&&Ft.decrement(this.getOddCounts(),this.getOddRoundingErrors()),d){if(g)throw new z;Ft.increment(this.getEvenCounts(),this.getOddRoundingErrors())}g&&Ft.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())}}it.OUTSIDE_EVEN_TOTAL_SUBSET=[1,10,34,70,126],it.INSIDE_ODD_TOTAL_SUBSET=[4,20,48,81],it.OUTSIDE_GSUM=[0,161,961,2015,2715],it.INSIDE_GSUM=[0,336,1036,1516],it.OUTSIDE_ODD_WIDEST=[8,6,4,3,1],it.INSIDE_ODD_WIDEST=[2,4,6,8],it.FINDER_PATTERNS=[Int32Array.from([3,8,2,1]),Int32Array.from([3,5,5,1]),Int32Array.from([3,3,7,1]),Int32Array.from([3,1,9,1]),Int32Array.from([2,7,4,1]),Int32Array.from([2,5,6,1]),Int32Array.from([2,3,8,1]),Int32Array.from([1,5,7,1]),Int32Array.from([1,3,9,1])];class $i extends ht{constructor(n,i){super(),this.readers=[],this.verbose=i===!0;const s=n?n.get(U.POSSIBLE_FORMATS):null,a=n&&n.get(U.ASSUME_CODE_39_CHECK_DIGIT)!==void 0;s?((s.includes(ue.EAN_13)||s.includes(ue.UPC_A)||s.includes(ue.EAN_8)||s.includes(ue.UPC_E))&&this.readers.push(new iu(n)),s.includes(ue.CODE_39)&&this.readers.push(new xt(a)),s.includes(ue.CODE_128)&&this.readers.push(new te),s.includes(ue.ITF)&&this.readers.push(new Ue),s.includes(ue.RSS_14)&&this.readers.push(new it),s.includes(ue.RSS_EXPANDED)&&this.readers.push(new K(this.verbose))):(this.readers.push(new iu(n)),this.readers.push(new xt),this.readers.push(new iu(n)),this.readers.push(new te),this.readers.push(new Ue),this.readers.push(new it),this.readers.push(new K(this.verbose)))}decodeRow(n,i,s){for(let a=0;a<this.readers.length;a++)try{return this.readers[a].decodeRow(n,i,s)}catch{}throw new z}reset(){this.readers.forEach(n=>n.reset())}}class Vy extends Er{constructor(n=500,i){super(new $i(i),n,i)}}class Le{constructor(n,i,s){this.ecCodewords=n,this.ecBlocks=[i],s&&this.ecBlocks.push(s)}getECCodewords(){return this.ecCodewords}getECBlocks(){return this.ecBlocks}}class Me{constructor(n,i){this.count=n,this.dataCodewords=i}getCount(){return this.count}getDataCodewords(){return this.dataCodewords}}class Ie{constructor(n,i,s,a,c,f){this.versionNumber=n,this.symbolSizeRows=i,this.symbolSizeColumns=s,this.dataRegionSizeRows=a,this.dataRegionSizeColumns=c,this.ecBlocks=f;let d=0;const g=f.getECCodewords(),p=f.getECBlocks();for(let v of p)d+=v.getCount()*(v.getDataCodewords()+g);this.totalCodewords=d}getVersionNumber(){return this.versionNumber}getSymbolSizeRows(){return this.symbolSizeRows}getSymbolSizeColumns(){return this.symbolSizeColumns}getDataRegionSizeRows(){return this.dataRegionSizeRows}getDataRegionSizeColumns(){return this.dataRegionSizeColumns}getTotalCodewords(){return this.totalCodewords}getECBlocks(){return this.ecBlocks}static getVersionForDimensions(n,i){if(n&1||i&1)throw new F;for(let s of Ie.VERSIONS)if(s.symbolSizeRows===n&&s.symbolSizeColumns===i)return s;throw new F}toString(){return""+this.versionNumber}static buildVersions(){return[new Ie(1,10,10,8,8,new Le(5,new Me(1,3))),new Ie(2,12,12,10,10,new Le(7,new Me(1,5))),new Ie(3,14,14,12,12,new Le(10,new Me(1,8))),new Ie(4,16,16,14,14,new Le(12,new Me(1,12))),new Ie(5,18,18,16,16,new Le(14,new Me(1,18))),new Ie(6,20,20,18,18,new Le(18,new Me(1,22))),new Ie(7,22,22,20,20,new Le(20,new Me(1,30))),new Ie(8,24,24,22,22,new Le(24,new Me(1,36))),new Ie(9,26,26,24,24,new Le(28,new Me(1,44))),new Ie(10,32,32,14,14,new Le(36,new Me(1,62))),new Ie(11,36,36,16,16,new Le(42,new Me(1,86))),new Ie(12,40,40,18,18,new Le(48,new Me(1,114))),new Ie(13,44,44,20,20,new Le(56,new Me(1,144))),new Ie(14,48,48,22,22,new Le(68,new Me(1,174))),new Ie(15,52,52,24,24,new Le(42,new Me(2,102))),new Ie(16,64,64,14,14,new Le(56,new Me(2,140))),new Ie(17,72,72,16,16,new Le(36,new Me(4,92))),new Ie(18,80,80,18,18,new Le(48,new Me(4,114))),new Ie(19,88,88,20,20,new Le(56,new Me(4,144))),new Ie(20,96,96,22,22,new Le(68,new Me(4,174))),new Ie(21,104,104,24,24,new Le(56,new Me(6,136))),new Ie(22,120,120,18,18,new Le(68,new Me(6,175))),new Ie(23,132,132,20,20,new Le(62,new Me(8,163))),new Ie(24,144,144,22,22,new Le(62,new Me(8,156),new Me(2,155))),new Ie(25,8,18,6,16,new Le(7,new Me(1,5))),new Ie(26,8,32,6,14,new Le(11,new Me(1,10))),new Ie(27,12,26,10,24,new Le(14,new Me(1,16))),new Ie(28,12,36,10,16,new Le(18,new Me(1,22))),new Ie(29,16,36,14,16,new Le(24,new Me(1,32))),new Ie(30,16,48,14,22,new Le(28,new Me(1,49)))]}}Ie.VERSIONS=Ie.buildVersions();class lu{constructor(n){const i=n.getHeight();if(i<8||i>144||i&1)throw new F;this.version=lu.readVersion(n),this.mappingBitMatrix=this.extractDataRegion(n),this.readMappingMatrix=new re(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}getVersion(){return this.version}static readVersion(n){const i=n.getHeight(),s=n.getWidth();return Ie.getVersionForDimensions(i,s)}readCodewords(){const n=new Int8Array(this.version.getTotalCodewords());let i=0,s=4,a=0;const c=this.mappingBitMatrix.getHeight(),f=this.mappingBitMatrix.getWidth();let d=!1,g=!1,p=!1,v=!1;do if(s===c&&a===0&&!d)n[i++]=this.readCorner1(c,f)&255,s-=2,a+=2,d=!0;else if(s===c-2&&a===0&&f&3&&!g)n[i++]=this.readCorner2(c,f)&255,s-=2,a+=2,g=!0;else if(s===c+4&&a===2&&!(f&7)&&!p)n[i++]=this.readCorner3(c,f)&255,s-=2,a+=2,p=!0;else if(s===c-2&&a===0&&(f&7)===4&&!v)n[i++]=this.readCorner4(c,f)&255,s-=2,a+=2,v=!0;else{do s<c&&a>=0&&!this.readMappingMatrix.get(a,s)&&(n[i++]=this.readUtah(s,a,c,f)&255),s-=2,a+=2;while(s>=0&&a<f);s+=1,a+=3;do s>=0&&a<f&&!this.readMappingMatrix.get(a,s)&&(n[i++]=this.readUtah(s,a,c,f)&255),s+=2,a-=2;while(s<c&&a>=0);s+=3,a+=1}while(s<c||a<f);if(i!==this.version.getTotalCodewords())throw new F;return n}readModule(n,i,s,a){return n<0&&(n+=s,i+=4-(s+4&7)),i<0&&(i+=a,n+=4-(a+4&7)),this.readMappingMatrix.set(i,n),this.mappingBitMatrix.get(i,n)}readUtah(n,i,s,a){let c=0;return this.readModule(n-2,i-2,s,a)&&(c|=1),c<<=1,this.readModule(n-2,i-1,s,a)&&(c|=1),c<<=1,this.readModule(n-1,i-2,s,a)&&(c|=1),c<<=1,this.readModule(n-1,i-1,s,a)&&(c|=1),c<<=1,this.readModule(n-1,i,s,a)&&(c|=1),c<<=1,this.readModule(n,i-2,s,a)&&(c|=1),c<<=1,this.readModule(n,i-1,s,a)&&(c|=1),c<<=1,this.readModule(n,i,s,a)&&(c|=1),c}readCorner1(n,i){let s=0;return this.readModule(n-1,0,n,i)&&(s|=1),s<<=1,this.readModule(n-1,1,n,i)&&(s|=1),s<<=1,this.readModule(n-1,2,n,i)&&(s|=1),s<<=1,this.readModule(0,i-2,n,i)&&(s|=1),s<<=1,this.readModule(0,i-1,n,i)&&(s|=1),s<<=1,this.readModule(1,i-1,n,i)&&(s|=1),s<<=1,this.readModule(2,i-1,n,i)&&(s|=1),s<<=1,this.readModule(3,i-1,n,i)&&(s|=1),s}readCorner2(n,i){let s=0;return this.readModule(n-3,0,n,i)&&(s|=1),s<<=1,this.readModule(n-2,0,n,i)&&(s|=1),s<<=1,this.readModule(n-1,0,n,i)&&(s|=1),s<<=1,this.readModule(0,i-4,n,i)&&(s|=1),s<<=1,this.readModule(0,i-3,n,i)&&(s|=1),s<<=1,this.readModule(0,i-2,n,i)&&(s|=1),s<<=1,this.readModule(0,i-1,n,i)&&(s|=1),s<<=1,this.readModule(1,i-1,n,i)&&(s|=1),s}readCorner3(n,i){let s=0;return this.readModule(n-1,0,n,i)&&(s|=1),s<<=1,this.readModule(n-1,i-1,n,i)&&(s|=1),s<<=1,this.readModule(0,i-3,n,i)&&(s|=1),s<<=1,this.readModule(0,i-2,n,i)&&(s|=1),s<<=1,this.readModule(0,i-1,n,i)&&(s|=1),s<<=1,this.readModule(1,i-3,n,i)&&(s|=1),s<<=1,this.readModule(1,i-2,n,i)&&(s|=1),s<<=1,this.readModule(1,i-1,n,i)&&(s|=1),s}readCorner4(n,i){let s=0;return this.readModule(n-3,0,n,i)&&(s|=1),s<<=1,this.readModule(n-2,0,n,i)&&(s|=1),s<<=1,this.readModule(n-1,0,n,i)&&(s|=1),s<<=1,this.readModule(0,i-2,n,i)&&(s|=1),s<<=1,this.readModule(0,i-1,n,i)&&(s|=1),s<<=1,this.readModule(1,i-1,n,i)&&(s|=1),s<<=1,this.readModule(2,i-1,n,i)&&(s|=1),s<<=1,this.readModule(3,i-1,n,i)&&(s|=1),s}extractDataRegion(n){const i=this.version.getSymbolSizeRows(),s=this.version.getSymbolSizeColumns();if(n.getHeight()!==i)throw new b("Dimension of bitMatrix must match the version size");const a=this.version.getDataRegionSizeRows(),c=this.version.getDataRegionSizeColumns(),f=i/a|0,d=s/c|0,g=f*a,p=d*c,v=new re(p,g);for(let A=0;A<f;++A){const S=A*a;for(let N=0;N<d;++N){const P=N*c;for(let B=0;B<a;++B){const W=A*(a+2)+1+B,G=S+B;for(let J=0;J<c;++J){const ee=N*(c+2)+1+J;if(n.get(ee,W)){const Z=P+J;v.set(Z,G)}}}}}return v}}class cu{constructor(n,i){this.numDataCodewords=n,this.codewords=i}static getDataBlocks(n,i){const s=i.getECBlocks();let a=0;const c=s.getECBlocks();for(let B of c)a+=B.getCount();const f=new Array(a);let d=0;for(let B of c)for(let W=0;W<B.getCount();W++){const G=B.getDataCodewords(),J=s.getECCodewords()+G;f[d++]=new cu(G,new Uint8Array(J))}const p=f[0].codewords.length-s.getECCodewords(),v=p-1;let A=0;for(let B=0;B<v;B++)for(let W=0;W<d;W++)f[W].codewords[B]=n[A++];const S=i.getVersionNumber()===24,N=S?8:d;for(let B=0;B<N;B++)f[B].codewords[p-1]=n[A++];const P=f[0].codewords.length;for(let B=p;B<P;B++)for(let W=0;W<d;W++){const G=S?(W+8)%d:W,J=S&&G>7?B-1:B;f[G].codewords[J]=n[A++]}if(A!==n.length)throw new b;return f}getNumDataCodewords(){return this.numDataCodewords}getCodewords(){return this.codewords}}class uu{constructor(n){this.bytes=n,this.byteOffset=0,this.bitOffset=0}getBitOffset(){return this.bitOffset}getByteOffset(){return this.byteOffset}readBits(n){if(n<1||n>32||n>this.available())throw new b(""+n);let i=0,s=this.bitOffset,a=this.byteOffset;const c=this.bytes;if(s>0){const f=8-s,d=n<f?n:f,g=f-d,p=255>>8-d<<g;i=(c[a]&p)>>g,n-=d,s+=d,s===8&&(s=0,a++)}if(n>0){for(;n>=8;)i=i<<8|c[a]&255,a++,n-=8;if(n>0){const f=8-n,d=255>>f<<f;i=i<<n|(c[a]&d)>>f,s+=n}}return this.bitOffset=s,this.byteOffset=a,i}available(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset}}var wt;(function(E){E[E.PAD_ENCODE=0]="PAD_ENCODE",E[E.ASCII_ENCODE=1]="ASCII_ENCODE",E[E.C40_ENCODE=2]="C40_ENCODE",E[E.TEXT_ENCODE=3]="TEXT_ENCODE",E[E.ANSIX12_ENCODE=4]="ANSIX12_ENCODE",E[E.EDIFACT_ENCODE=5]="EDIFACT_ENCODE",E[E.BASE256_ENCODE=6]="BASE256_ENCODE"})(wt||(wt={}));class kn{static decode(n){const i=new uu(n),s=new xe,a=new xe,c=new Array;let f=wt.ASCII_ENCODE;do if(f===wt.ASCII_ENCODE)f=this.decodeAsciiSegment(i,s,a);else{switch(f){case wt.C40_ENCODE:this.decodeC40Segment(i,s);break;case wt.TEXT_ENCODE:this.decodeTextSegment(i,s);break;case wt.ANSIX12_ENCODE:this.decodeAnsiX12Segment(i,s);break;case wt.EDIFACT_ENCODE:this.decodeEdifactSegment(i,s);break;case wt.BASE256_ENCODE:this.decodeBase256Segment(i,s,c);break;default:throw new F}f=wt.ASCII_ENCODE}while(f!==wt.PAD_ENCODE&&i.available()>0);return a.length()>0&&s.append(a.toString()),new js(n,s.toString(),c.length===0?null:c,null)}static decodeAsciiSegment(n,i,s){let a=!1;do{let c=n.readBits(8);if(c===0)throw new F;if(c<=128)return a&&(c+=128),i.append(String.fromCharCode(c-1)),wt.ASCII_ENCODE;if(c===129)return wt.PAD_ENCODE;if(c<=229){const f=c-130;f<10&&i.append("0"),i.append(""+f)}else switch(c){case 230:return wt.C40_ENCODE;case 231:return wt.BASE256_ENCODE;case 232:i.append("");break;case 233:case 234:break;case 235:a=!0;break;case 236:i.append("[)>05"),s.insert(0,"");break;case 237:i.append("[)>06"),s.insert(0,"");break;case 238:return wt.ANSIX12_ENCODE;case 239:return wt.TEXT_ENCODE;case 240:return wt.EDIFACT_ENCODE;case 241:break;default:if(c!==254||n.available()!==0)throw new F;break}}while(n.available()>0);return wt.ASCII_ENCODE}static decodeC40Segment(n,i){let s=!1;const a=[];let c=0;do{if(n.available()===8)return;const f=n.readBits(8);if(f===254)return;this.parseTwoBytes(f,n.readBits(8),a);for(let d=0;d<3;d++){const g=a[d];switch(c){case 0:if(g<3)c=g+1;else if(g<this.C40_BASIC_SET_CHARS.length){const p=this.C40_BASIC_SET_CHARS[g];s?(i.append(String.fromCharCode(p.charCodeAt(0)+128)),s=!1):i.append(p)}else throw new F;break;case 1:s?(i.append(String.fromCharCode(g+128)),s=!1):i.append(String.fromCharCode(g)),c=0;break;case 2:if(g<this.C40_SHIFT2_SET_CHARS.length){const p=this.C40_SHIFT2_SET_CHARS[g];s?(i.append(String.fromCharCode(p.charCodeAt(0)+128)),s=!1):i.append(p)}else switch(g){case 27:i.append("");break;case 30:s=!0;break;default:throw new F}c=0;break;case 3:s?(i.append(String.fromCharCode(g+224)),s=!1):i.append(String.fromCharCode(g+96)),c=0;break;default:throw new F}}}while(n.available()>0)}static decodeTextSegment(n,i){let s=!1,a=[],c=0;do{if(n.available()===8)return;const f=n.readBits(8);if(f===254)return;this.parseTwoBytes(f,n.readBits(8),a);for(let d=0;d<3;d++){const g=a[d];switch(c){case 0:if(g<3)c=g+1;else if(g<this.TEXT_BASIC_SET_CHARS.length){const p=this.TEXT_BASIC_SET_CHARS[g];s?(i.append(String.fromCharCode(p.charCodeAt(0)+128)),s=!1):i.append(p)}else throw new F;break;case 1:s?(i.append(String.fromCharCode(g+128)),s=!1):i.append(String.fromCharCode(g)),c=0;break;case 2:if(g<this.TEXT_SHIFT2_SET_CHARS.length){const p=this.TEXT_SHIFT2_SET_CHARS[g];s?(i.append(String.fromCharCode(p.charCodeAt(0)+128)),s=!1):i.append(p)}else switch(g){case 27:i.append("");break;case 30:s=!0;break;default:throw new F}c=0;break;case 3:if(g<this.TEXT_SHIFT3_SET_CHARS.length){const p=this.TEXT_SHIFT3_SET_CHARS[g];s?(i.append(String.fromCharCode(p.charCodeAt(0)+128)),s=!1):i.append(p),c=0}else throw new F;break;default:throw new F}}}while(n.available()>0)}static decodeAnsiX12Segment(n,i){const s=[];do{if(n.available()===8)return;const a=n.readBits(8);if(a===254)return;this.parseTwoBytes(a,n.readBits(8),s);for(let c=0;c<3;c++){const f=s[c];switch(f){case 0:i.append("\r");break;case 1:i.append("*");break;case 2:i.append(">");break;case 3:i.append(" ");break;default:if(f<14)i.append(String.fromCharCode(f+44));else if(f<40)i.append(String.fromCharCode(f+51));else throw new F;break}}}while(n.available()>0)}static parseTwoBytes(n,i,s){let a=(n<<8)+i-1,c=Math.floor(a/1600);s[0]=c,a-=c*1600,c=Math.floor(a/40),s[1]=c,s[2]=a-c*40}static decodeEdifactSegment(n,i){do{if(n.available()<=16)return;for(let s=0;s<4;s++){let a=n.readBits(6);if(a===31){const c=8-n.getBitOffset();c!==8&&n.readBits(c);return}a&32||(a|=64),i.append(String.fromCharCode(a))}}while(n.available()>0)}static decodeBase256Segment(n,i,s){let a=1+n.getByteOffset();const c=this.unrandomize255State(n.readBits(8),a++);let f;if(c===0?f=n.available()/8|0:c<250?f=c:f=250*(c-249)+this.unrandomize255State(n.readBits(8),a++),f<0)throw new F;const d=new Uint8Array(f);for(let g=0;g<f;g++){if(n.available()<8)throw new F;d[g]=this.unrandomize255State(n.readBits(8),a++)}s.push(d);try{i.append(ve.decode(d,Q.ISO88591))}catch(g){throw new Xr("Platform does not support required encoding: "+g.message)}}static unrandomize255State(n,i){const s=149*i%255+1,a=n-s;return a>=0?a:a+256}}kn.C40_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],kn.C40_SHIFT2_SET_CHARS=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],kn.TEXT_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],kn.TEXT_SHIFT2_SET_CHARS=kn.C40_SHIFT2_SET_CHARS,kn.TEXT_SHIFT3_SET_CHARS=["`","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","{","|","}","~",""];class zy{constructor(){this.rsDecoder=new Vs(Oe.DATA_MATRIX_FIELD_256)}decode(n){const i=new lu(n),s=i.getVersion(),a=i.readCodewords(),c=cu.getDataBlocks(a,s);let f=0;for(let p of c)f+=p.getNumDataCodewords();const d=new Uint8Array(f),g=c.length;for(let p=0;p<g;p++){const v=c[p],A=v.getCodewords(),S=v.getNumDataCodewords();this.correctErrors(A,S);for(let N=0;N<S;N++)d[N*g+p]=A[N]}return kn.decode(d)}correctErrors(n,i){const s=new Int32Array(n);try{this.rsDecoder.decode(s,n.length-i)}catch{throw new T}for(let a=0;a<i;a++)n[a]=s[a]}}class ct{constructor(n){this.image=n,this.rectangleDetector=new fn(this.image)}detect(){const n=this.rectangleDetector.detect();let i=this.detectSolid1(n);if(i=this.detectSolid2(i),i[3]=this.correctTopRight(i),!i[3])throw new z;i=this.shiftToModuleCenter(i);const s=i[0],a=i[1],c=i[2],f=i[3];let d=this.transitionsBetween(s,f)+1,g=this.transitionsBetween(c,f)+1;(d&1)===1&&(d+=1),(g&1)===1&&(g+=1),4*d<7*g&&4*g<7*d&&(d=g=Math.max(d,g));let p=ct.sampleGrid(this.image,s,a,c,f,d,g);return new Ea(p,[s,a,c,f])}static shiftPoint(n,i,s){let a=(i.getX()-n.getX())/(s+1),c=(i.getY()-n.getY())/(s+1);return new ce(n.getX()+a,n.getY()+c)}static moveAway(n,i,s){let a=n.getX(),c=n.getY();return a<i?a-=1:a+=1,c<s?c-=1:c+=1,new ce(a,c)}detectSolid1(n){let i=n[0],s=n[1],a=n[3],c=n[2],f=this.transitionsBetween(i,s),d=this.transitionsBetween(s,a),g=this.transitionsBetween(a,c),p=this.transitionsBetween(c,i),v=f,A=[c,i,s,a];return v>d&&(v=d,A[0]=i,A[1]=s,A[2]=a,A[3]=c),v>g&&(v=g,A[0]=s,A[1]=a,A[2]=c,A[3]=i),v>p&&(A[0]=a,A[1]=c,A[2]=i,A[3]=s),A}detectSolid2(n){let i=n[0],s=n[1],a=n[2],c=n[3],f=this.transitionsBetween(i,c),d=ct.shiftPoint(s,a,(f+1)*4),g=ct.shiftPoint(a,s,(f+1)*4),p=this.transitionsBetween(d,i),v=this.transitionsBetween(g,c);return p<v?(n[0]=i,n[1]=s,n[2]=a,n[3]=c):(n[0]=s,n[1]=a,n[2]=c,n[3]=i),n}correctTopRight(n){let i=n[0],s=n[1],a=n[2],c=n[3],f=this.transitionsBetween(i,c),d=this.transitionsBetween(s,c),g=ct.shiftPoint(i,s,(d+1)*4),p=ct.shiftPoint(a,s,(f+1)*4);f=this.transitionsBetween(g,c),d=this.transitionsBetween(p,c);let v=new ce(c.getX()+(a.getX()-s.getX())/(f+1),c.getY()+(a.getY()-s.getY())/(f+1)),A=new ce(c.getX()+(i.getX()-s.getX())/(d+1),c.getY()+(i.getY()-s.getY())/(d+1));if(!this.isValid(v))return this.isValid(A)?A:null;if(!this.isValid(A))return v;let S=this.transitionsBetween(g,v)+this.transitionsBetween(p,v),N=this.transitionsBetween(g,A)+this.transitionsBetween(p,A);return S>N?v:A}shiftToModuleCenter(n){let i=n[0],s=n[1],a=n[2],c=n[3],f=this.transitionsBetween(i,c)+1,d=this.transitionsBetween(a,c)+1,g=ct.shiftPoint(i,s,d*4),p=ct.shiftPoint(a,s,f*4);f=this.transitionsBetween(g,c)+1,d=this.transitionsBetween(p,c)+1,(f&1)===1&&(f+=1),(d&1)===1&&(d+=1);let v=(i.getX()+s.getX()+a.getX()+c.getX())/4,A=(i.getY()+s.getY()+a.getY()+c.getY())/4;i=ct.moveAway(i,v,A),s=ct.moveAway(s,v,A),a=ct.moveAway(a,v,A),c=ct.moveAway(c,v,A);let S,N;return g=ct.shiftPoint(i,s,d*4),g=ct.shiftPoint(g,c,f*4),S=ct.shiftPoint(s,i,d*4),S=ct.shiftPoint(S,a,f*4),p=ct.shiftPoint(a,c,d*4),p=ct.shiftPoint(p,s,f*4),N=ct.shiftPoint(c,a,d*4),N=ct.shiftPoint(N,i,f*4),[g,S,p,N]}isValid(n){return n.getX()>=0&&n.getX()<this.image.getWidth()&&n.getY()>0&&n.getY()<this.image.getHeight()}static sampleGrid(n,i,s,a,c,f,d){return Nn.getInstance().sampleGrid(n,f,d,.5,.5,f-.5,.5,f-.5,d-.5,.5,d-.5,i.getX(),i.getY(),c.getX(),c.getY(),a.getX(),a.getY(),s.getX(),s.getY())}transitionsBetween(n,i){let s=Math.trunc(n.getX()),a=Math.trunc(n.getY()),c=Math.trunc(i.getX()),f=Math.trunc(i.getY()),d=Math.abs(f-a)>Math.abs(c-s);if(d){let B=s;s=a,a=B,B=c,c=f,f=B}let g=Math.abs(c-s),p=Math.abs(f-a),v=-g/2,A=a<f?1:-1,S=s<c?1:-1,N=0,P=this.image.get(d?a:s,d?s:a);for(let B=s,W=a;B!==c;B+=S){let G=this.image.get(d?W:B,d?B:W);if(G!==P&&(N++,P=G),v+=p,v>0){if(W===f)break;W+=A,v-=g}}return N}}class Mn{constructor(){this.decoder=new zy}decode(n,i=null){let s,a;if(i!=null&&i.has(U.PURE_BARCODE)){const p=Mn.extractPureBits(n.getBlackMatrix());s=this.decoder.decode(p),a=Mn.NO_POINTS}else{const p=new ct(n.getBlackMatrix()).detect();s=this.decoder.decode(p.getBits()),a=p.getPoints()}const c=s.getRawBytes(),f=new Qe(s.getText(),c,8*c.length,a,ue.DATA_MATRIX,D.currentTimeMillis()),d=s.getByteSegments();d!=null&&f.putMetadata(Ct.BYTE_SEGMENTS,d);const g=s.getECLevel();return g!=null&&f.putMetadata(Ct.ERROR_CORRECTION_LEVEL,g),f}reset(){}static extractPureBits(n){const i=n.getTopLeftOnBit(),s=n.getBottomRightOnBit();if(i==null||s==null)throw new z;const a=this.moduleSize(i,n);let c=i[1];const f=s[1];let d=i[0];const p=(s[0]-d+1)/a,v=(f-c+1)/a;if(p<=0||v<=0)throw new z;const A=a/2;c+=A,d+=A;const S=new re(p,v);for(let N=0;N<v;N++){const P=c+N*a;for(let B=0;B<p;B++)n.get(d+B*a,P)&&S.set(B,N)}return S}static moduleSize(n,i){const s=i.getWidth();let a=n[0];const c=n[1];for(;a<s&&i.get(a,c);)a++;if(a===s)throw new z;const f=a-n[0];if(f===0)throw new z;return f}}Mn.NO_POINTS=[];class $y extends Er{constructor(n=500){super(new Mn,n)}}var Hi;(function(E){E[E.L=0]="L",E[E.M=1]="M",E[E.Q=2]="Q",E[E.H=3]="H"})(Hi||(Hi={}));class ze{constructor(n,i,s){this.value=n,this.stringValue=i,this.bits=s,ze.FOR_BITS.set(s,this),ze.FOR_VALUE.set(n,this)}getValue(){return this.value}getBits(){return this.bits}static fromString(n){switch(n){case"L":return ze.L;case"M":return ze.M;case"Q":return ze.Q;case"H":return ze.H;default:throw new y(n+"not available")}}toString(){return this.stringValue}equals(n){if(!(n instanceof ze))return!1;const i=n;return this.value===i.value}static forBits(n){if(n<0||n>=ze.FOR_BITS.size)throw new b;return ze.FOR_BITS.get(n)}}ze.FOR_BITS=new Map,ze.FOR_VALUE=new Map,ze.L=new ze(Hi.L,"L",1),ze.M=new ze(Hi.M,"M",0),ze.Q=new ze(Hi.Q,"Q",3),ze.H=new ze(Hi.H,"H",2);class Ut{constructor(n){this.errorCorrectionLevel=ze.forBits(n>>3&3),this.dataMask=n&7}static numBitsDiffering(n,i){return _.bitCount(n^i)}static decodeFormatInformation(n,i){const s=Ut.doDecodeFormatInformation(n,i);return s!==null?s:Ut.doDecodeFormatInformation(n^Ut.FORMAT_INFO_MASK_QR,i^Ut.FORMAT_INFO_MASK_QR)}static doDecodeFormatInformation(n,i){let s=Number.MAX_SAFE_INTEGER,a=0;for(const c of Ut.FORMAT_INFO_DECODE_LOOKUP){const f=c[0];if(f===n||f===i)return new Ut(c[1]);let d=Ut.numBitsDiffering(n,f);d<s&&(a=c[1],s=d),n!==i&&(d=Ut.numBitsDiffering(i,f),d<s&&(a=c[1],s=d))}return s<=3?new Ut(a):null}getErrorCorrectionLevel(){return this.errorCorrectionLevel}getDataMask(){return this.dataMask}hashCode(){return this.errorCorrectionLevel.getBits()<<3|this.dataMask}equals(n){if(!(n instanceof Ut))return!1;const i=n;return this.errorCorrectionLevel===i.errorCorrectionLevel&&this.dataMask===i.dataMask}}Ut.FORMAT_INFO_MASK_QR=21522,Ut.FORMAT_INFO_DECODE_LOOKUP=[Int32Array.from([21522,0]),Int32Array.from([20773,1]),Int32Array.from([24188,2]),Int32Array.from([23371,3]),Int32Array.from([17913,4]),Int32Array.from([16590,5]),Int32Array.from([20375,6]),Int32Array.from([19104,7]),Int32Array.from([30660,8]),Int32Array.from([29427,9]),Int32Array.from([32170,10]),Int32Array.from([30877,11]),Int32Array.from([26159,12]),Int32Array.from([25368,13]),Int32Array.from([27713,14]),Int32Array.from([26998,15]),Int32Array.from([5769,16]),Int32Array.from([5054,17]),Int32Array.from([7399,18]),Int32Array.from([6608,19]),Int32Array.from([1890,20]),Int32Array.from([597,21]),Int32Array.from([3340,22]),Int32Array.from([2107,23]),Int32Array.from([13663,24]),Int32Array.from([12392,25]),Int32Array.from([16177,26]),Int32Array.from([14854,27]),Int32Array.from([9396,28]),Int32Array.from([8579,29]),Int32Array.from([11994,30]),Int32Array.from([11245,31])];class V{constructor(n,...i){this.ecCodewordsPerBlock=n,this.ecBlocks=i}getECCodewordsPerBlock(){return this.ecCodewordsPerBlock}getNumBlocks(){let n=0;const i=this.ecBlocks;for(const s of i)n+=s.getCount();return n}getTotalECCodewords(){return this.ecCodewordsPerBlock*this.getNumBlocks()}getECBlocks(){return this.ecBlocks}}class R{constructor(n,i){this.count=n,this.dataCodewords=i}getCount(){return this.count}getDataCodewords(){return this.dataCodewords}}class de{constructor(n,i,...s){this.versionNumber=n,this.alignmentPatternCenters=i,this.ecBlocks=s;let a=0;const c=s[0].getECCodewordsPerBlock(),f=s[0].getECBlocks();for(const d of f)a+=d.getCount()*(d.getDataCodewords()+c);this.totalCodewords=a}getVersionNumber(){return this.versionNumber}getAlignmentPatternCenters(){return this.alignmentPatternCenters}getTotalCodewords(){return this.totalCodewords}getDimensionForVersion(){return 17+4*this.versionNumber}getECBlocksForLevel(n){return this.ecBlocks[n.getValue()]}static getProvisionalVersionForDimension(n){if(n%4!==1)throw new F;try{return this.getVersionForNumber((n-17)/4)}catch{throw new F}}static getVersionForNumber(n){if(n<1||n>40)throw new b;return de.VERSIONS[n-1]}static decodeVersionInformation(n){let i=Number.MAX_SAFE_INTEGER,s=0;for(let a=0;a<de.VERSION_DECODE_INFO.length;a++){const c=de.VERSION_DECODE_INFO[a];if(c===n)return de.getVersionForNumber(a+7);const f=Ut.numBitsDiffering(n,c);f<i&&(s=a+7,i=f)}return i<=3?de.getVersionForNumber(s):null}buildFunctionPattern(){const n=this.getDimensionForVersion(),i=new re(n);i.setRegion(0,0,9,9),i.setRegion(n-8,0,8,9),i.setRegion(0,n-8,9,8);const s=this.alignmentPatternCenters.length;for(let a=0;a<s;a++){const c=this.alignmentPatternCenters[a]-2;for(let f=0;f<s;f++)a===0&&(f===0||f===s-1)||a===s-1&&f===0||i.setRegion(this.alignmentPatternCenters[f]-2,c,5,5)}return i.setRegion(6,9,1,n-17),i.setRegion(9,6,n-17,1),this.versionNumber>6&&(i.setRegion(n-11,0,3,6),i.setRegion(0,n-11,6,3)),i}toString(){return""+this.versionNumber}}de.VERSION_DECODE_INFO=Int32Array.from([31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017]),de.VERSIONS=[new de(1,new Int32Array(0),new V(7,new R(1,19)),new V(10,new R(1,16)),new V(13,new R(1,13)),new V(17,new R(1,9))),new de(2,Int32Array.from([6,18]),new V(10,new R(1,34)),new V(16,new R(1,28)),new V(22,new R(1,22)),new V(28,new R(1,16))),new de(3,Int32Array.from([6,22]),new V(15,new R(1,55)),new V(26,new R(1,44)),new V(18,new R(2,17)),new V(22,new R(2,13))),new de(4,Int32Array.from([6,26]),new V(20,new R(1,80)),new V(18,new R(2,32)),new V(26,new R(2,24)),new V(16,new R(4,9))),new de(5,Int32Array.from([6,30]),new V(26,new R(1,108)),new V(24,new R(2,43)),new V(18,new R(2,15),new R(2,16)),new V(22,new R(2,11),new R(2,12))),new de(6,Int32Array.from([6,34]),new V(18,new R(2,68)),new V(16,new R(4,27)),new V(24,new R(4,19)),new V(28,new R(4,15))),new de(7,Int32Array.from([6,22,38]),new V(20,new R(2,78)),new V(18,new R(4,31)),new V(18,new R(2,14),new R(4,15)),new V(26,new R(4,13),new R(1,14))),new de(8,Int32Array.from([6,24,42]),new V(24,new R(2,97)),new V(22,new R(2,38),new R(2,39)),new V(22,new R(4,18),new R(2,19)),new V(26,new R(4,14),new R(2,15))),new de(9,Int32Array.from([6,26,46]),new V(30,new R(2,116)),new V(22,new R(3,36),new R(2,37)),new V(20,new R(4,16),new R(4,17)),new V(24,new R(4,12),new R(4,13))),new de(10,Int32Array.from([6,28,50]),new V(18,new R(2,68),new R(2,69)),new V(26,new R(4,43),new R(1,44)),new V(24,new R(6,19),new R(2,20)),new V(28,new R(6,15),new R(2,16))),new de(11,Int32Array.from([6,30,54]),new V(20,new R(4,81)),new V(30,new R(1,50),new R(4,51)),new V(28,new R(4,22),new R(4,23)),new V(24,new R(3,12),new R(8,13))),new de(12,Int32Array.from([6,32,58]),new V(24,new R(2,92),new R(2,93)),new V(22,new R(6,36),new R(2,37)),new V(26,new R(4,20),new R(6,21)),new V(28,new R(7,14),new R(4,15))),new de(13,Int32Array.from([6,34,62]),new V(26,new R(4,107)),new V(22,new R(8,37),new R(1,38)),new V(24,new R(8,20),new R(4,21)),new V(22,new R(12,11),new R(4,12))),new de(14,Int32Array.from([6,26,46,66]),new V(30,new R(3,115),new R(1,116)),new V(24,new R(4,40),new R(5,41)),new V(20,new R(11,16),new R(5,17)),new V(24,new R(11,12),new R(5,13))),new de(15,Int32Array.from([6,26,48,70]),new V(22,new R(5,87),new R(1,88)),new V(24,new R(5,41),new R(5,42)),new V(30,new R(5,24),new R(7,25)),new V(24,new R(11,12),new R(7,13))),new de(16,Int32Array.from([6,26,50,74]),new V(24,new R(5,98),new R(1,99)),new V(28,new R(7,45),new R(3,46)),new V(24,new R(15,19),new R(2,20)),new V(30,new R(3,15),new R(13,16))),new de(17,Int32Array.from([6,30,54,78]),new V(28,new R(1,107),new R(5,108)),new V(28,new R(10,46),new R(1,47)),new V(28,new R(1,22),new R(15,23)),new V(28,new R(2,14),new R(17,15))),new de(18,Int32Array.from([6,30,56,82]),new V(30,new R(5,120),new R(1,121)),new V(26,new R(9,43),new R(4,44)),new V(28,new R(17,22),new R(1,23)),new V(28,new R(2,14),new R(19,15))),new de(19,Int32Array.from([6,30,58,86]),new V(28,new R(3,113),new R(4,114)),new V(26,new R(3,44),new R(11,45)),new V(26,new R(17,21),new R(4,22)),new V(26,new R(9,13),new R(16,14))),new de(20,Int32Array.from([6,34,62,90]),new V(28,new R(3,107),new R(5,108)),new V(26,new R(3,41),new R(13,42)),new V(30,new R(15,24),new R(5,25)),new V(28,new R(15,15),new R(10,16))),new de(21,Int32Array.from([6,28,50,72,94]),new V(28,new R(4,116),new R(4,117)),new V(26,new R(17,42)),new V(28,new R(17,22),new R(6,23)),new V(30,new R(19,16),new R(6,17))),new de(22,Int32Array.from([6,26,50,74,98]),new V(28,new R(2,111),new R(7,112)),new V(28,new R(17,46)),new V(30,new R(7,24),new R(16,25)),new V(24,new R(34,13))),new de(23,Int32Array.from([6,30,54,78,102]),new V(30,new R(4,121),new R(5,122)),new V(28,new R(4,47),new R(14,48)),new V(30,new R(11,24),new R(14,25)),new V(30,new R(16,15),new R(14,16))),new de(24,Int32Array.from([6,28,54,80,106]),new V(30,new R(6,117),new R(4,118)),new V(28,new R(6,45),new R(14,46)),new V(30,new R(11,24),new R(16,25)),new V(30,new R(30,16),new R(2,17))),new de(25,Int32Array.from([6,32,58,84,110]),new V(26,new R(8,106),new R(4,107)),new V(28,new R(8,47),new R(13,48)),new V(30,new R(7,24),new R(22,25)),new V(30,new R(22,15),new R(13,16))),new de(26,Int32Array.from([6,30,58,86,114]),new V(28,new R(10,114),new R(2,115)),new V(28,new R(19,46),new R(4,47)),new V(28,new R(28,22),new R(6,23)),new V(30,new R(33,16),new R(4,17))),new de(27,Int32Array.from([6,34,62,90,118]),new V(30,new R(8,122),new R(4,123)),new V(28,new R(22,45),new R(3,46)),new V(30,new R(8,23),new R(26,24)),new V(30,new R(12,15),new R(28,16))),new de(28,Int32Array.from([6,26,50,74,98,122]),new V(30,new R(3,117),new R(10,118)),new V(28,new R(3,45),new R(23,46)),new V(30,new R(4,24),new R(31,25)),new V(30,new R(11,15),new R(31,16))),new de(29,Int32Array.from([6,30,54,78,102,126]),new V(30,new R(7,116),new R(7,117)),new V(28,new R(21,45),new R(7,46)),new V(30,new R(1,23),new R(37,24)),new V(30,new R(19,15),new R(26,16))),new de(30,Int32Array.from([6,26,52,78,104,130]),new V(30,new R(5,115),new R(10,116)),new V(28,new R(19,47),new R(10,48)),new V(30,new R(15,24),new R(25,25)),new V(30,new R(23,15),new R(25,16))),new de(31,Int32Array.from([6,30,56,82,108,134]),new V(30,new R(13,115),new R(3,116)),new V(28,new R(2,46),new R(29,47)),new V(30,new R(42,24),new R(1,25)),new V(30,new R(23,15),new R(28,16))),new de(32,Int32Array.from([6,34,60,86,112,138]),new V(30,new R(17,115)),new V(28,new R(10,46),new R(23,47)),new V(30,new R(10,24),new R(35,25)),new V(30,new R(19,15),new R(35,16))),new de(33,Int32Array.from([6,30,58,86,114,142]),new V(30,new R(17,115),new R(1,116)),new V(28,new R(14,46),new R(21,47)),new V(30,new R(29,24),new R(19,25)),new V(30,new R(11,15),new R(46,16))),new de(34,Int32Array.from([6,34,62,90,118,146]),new V(30,new R(13,115),new R(6,116)),new V(28,new R(14,46),new R(23,47)),new V(30,new R(44,24),new R(7,25)),new V(30,new R(59,16),new R(1,17))),new de(35,Int32Array.from([6,30,54,78,102,126,150]),new V(30,new R(12,121),new R(7,122)),new V(28,new R(12,47),new R(26,48)),new V(30,new R(39,24),new R(14,25)),new V(30,new R(22,15),new R(41,16))),new de(36,Int32Array.from([6,24,50,76,102,128,154]),new V(30,new R(6,121),new R(14,122)),new V(28,new R(6,47),new R(34,48)),new V(30,new R(46,24),new R(10,25)),new V(30,new R(2,15),new R(64,16))),new de(37,Int32Array.from([6,28,54,80,106,132,158]),new V(30,new R(17,122),new R(4,123)),new V(28,new R(29,46),new R(14,47)),new V(30,new R(49,24),new R(10,25)),new V(30,new R(24,15),new R(46,16))),new de(38,Int32Array.from([6,32,58,84,110,136,162]),new V(30,new R(4,122),new R(18,123)),new V(28,new R(13,46),new R(32,47)),new V(30,new R(48,24),new R(14,25)),new V(30,new R(42,15),new R(32,16))),new de(39,Int32Array.from([6,26,54,82,110,138,166]),new V(30,new R(20,117),new R(4,118)),new V(28,new R(40,47),new R(7,48)),new V(30,new R(43,24),new R(22,25)),new V(30,new R(10,15),new R(67,16))),new de(40,Int32Array.from([6,30,58,86,114,142,170]),new V(30,new R(19,118),new R(6,119)),new V(28,new R(18,47),new R(31,48)),new V(30,new R(34,24),new R(34,25)),new V(30,new R(20,15),new R(61,16)))];var St;(function(E){E[E.DATA_MASK_000=0]="DATA_MASK_000",E[E.DATA_MASK_001=1]="DATA_MASK_001",E[E.DATA_MASK_010=2]="DATA_MASK_010",E[E.DATA_MASK_011=3]="DATA_MASK_011",E[E.DATA_MASK_100=4]="DATA_MASK_100",E[E.DATA_MASK_101=5]="DATA_MASK_101",E[E.DATA_MASK_110=6]="DATA_MASK_110",E[E.DATA_MASK_111=7]="DATA_MASK_111"})(St||(St={}));class br{constructor(n,i){this.value=n,this.isMasked=i}unmaskBitMatrix(n,i){for(let s=0;s<i;s++)for(let a=0;a<i;a++)this.isMasked(s,a)&&n.flip(a,s)}}br.values=new Map([[St.DATA_MASK_000,new br(St.DATA_MASK_000,(E,n)=>(E+n&1)===0)],[St.DATA_MASK_001,new br(St.DATA_MASK_001,(E,n)=>(E&1)===0)],[St.DATA_MASK_010,new br(St.DATA_MASK_010,(E,n)=>n%3===0)],[St.DATA_MASK_011,new br(St.DATA_MASK_011,(E,n)=>(E+n)%3===0)],[St.DATA_MASK_100,new br(St.DATA_MASK_100,(E,n)=>(Math.floor(E/2)+Math.floor(n/3)&1)===0)],[St.DATA_MASK_101,new br(St.DATA_MASK_101,(E,n)=>E*n%6===0)],[St.DATA_MASK_110,new br(St.DATA_MASK_110,(E,n)=>E*n%6<3)],[St.DATA_MASK_111,new br(St.DATA_MASK_111,(E,n)=>(E+n+E*n%3&1)===0)]]);class Hy{constructor(n){const i=n.getHeight();if(i<21||(i&3)!==1)throw new F;this.bitMatrix=n}readFormatInformation(){if(this.parsedFormatInfo!==null&&this.parsedFormatInfo!==void 0)return this.parsedFormatInfo;let n=0;for(let c=0;c<6;c++)n=this.copyBit(c,8,n);n=this.copyBit(7,8,n),n=this.copyBit(8,8,n),n=this.copyBit(8,7,n);for(let c=5;c>=0;c--)n=this.copyBit(8,c,n);const i=this.bitMatrix.getHeight();let s=0;const a=i-7;for(let c=i-1;c>=a;c--)s=this.copyBit(8,c,s);for(let c=i-8;c<i;c++)s=this.copyBit(c,8,s);if(this.parsedFormatInfo=Ut.decodeFormatInformation(n,s),this.parsedFormatInfo!==null)return this.parsedFormatInfo;throw new F}readVersion(){if(this.parsedVersion!==null&&this.parsedVersion!==void 0)return this.parsedVersion;const n=this.bitMatrix.getHeight(),i=Math.floor((n-17)/4);if(i<=6)return de.getVersionForNumber(i);let s=0;const a=n-11;for(let f=5;f>=0;f--)for(let d=n-9;d>=a;d--)s=this.copyBit(d,f,s);let c=de.decodeVersionInformation(s);if(c!==null&&c.getDimensionForVersion()===n)return this.parsedVersion=c,c;s=0;for(let f=5;f>=0;f--)for(let d=n-9;d>=a;d--)s=this.copyBit(f,d,s);if(c=de.decodeVersionInformation(s),c!==null&&c.getDimensionForVersion()===n)return this.parsedVersion=c,c;throw new F}copyBit(n,i,s){return(this.isMirror?this.bitMatrix.get(i,n):this.bitMatrix.get(n,i))?s<<1|1:s<<1}readCodewords(){const n=this.readFormatInformation(),i=this.readVersion(),s=br.values.get(n.getDataMask()),a=this.bitMatrix.getHeight();s.unmaskBitMatrix(this.bitMatrix,a);const c=i.buildFunctionPattern();let f=!0;const d=new Uint8Array(i.getTotalCodewords());let g=0,p=0,v=0;for(let A=a-1;A>0;A-=2){A===6&&A--;for(let S=0;S<a;S++){const N=f?a-1-S:S;for(let P=0;P<2;P++)c.get(A-P,N)||(v++,p<<=1,this.bitMatrix.get(A-P,N)&&(p|=1),v===8&&(d[g++]=p,v=0,p=0))}f=!f}if(g!==i.getTotalCodewords())throw new F;return d}remask(){if(this.parsedFormatInfo===null)return;const n=br.values[this.parsedFormatInfo.getDataMask()],i=this.bitMatrix.getHeight();n.unmaskBitMatrix(this.bitMatrix,i)}setMirror(n){this.parsedVersion=null,this.parsedFormatInfo=null,this.isMirror=n}mirror(){const n=this.bitMatrix;for(let i=0,s=n.getWidth();i<s;i++)for(let a=i+1,c=n.getHeight();a<c;a++)n.get(i,a)!==n.get(a,i)&&(n.flip(a,i),n.flip(i,a))}}class fu{constructor(n,i){this.numDataCodewords=n,this.codewords=i}static getDataBlocks(n,i,s){if(n.length!==i.getTotalCodewords())throw new b;const a=i.getECBlocksForLevel(s);let c=0;const f=a.getECBlocks();for(const P of f)c+=P.getCount();const d=new Array(c);let g=0;for(const P of f)for(let B=0;B<P.getCount();B++){const W=P.getDataCodewords(),G=a.getECCodewordsPerBlock()+W;d[g++]=new fu(W,new Uint8Array(G))}const p=d[0].codewords.length;let v=d.length-1;for(;v>=0&&d[v].codewords.length!==p;)v--;v++;const A=p-a.getECCodewordsPerBlock();let S=0;for(let P=0;P<A;P++)for(let B=0;B<g;B++)d[B].codewords[P]=n[S++];for(let P=v;P<g;P++)d[P].codewords[A]=n[S++];const N=d[0].codewords.length;for(let P=A;P<N;P++)for(let B=0;B<g;B++){const W=B<v?P:P+1;d[B].codewords[W]=n[S++]}return d}getNumDataCodewords(){return this.numDataCodewords}getCodewords(){return this.codewords}}var Cr;(function(E){E[E.TERMINATOR=0]="TERMINATOR",E[E.NUMERIC=1]="NUMERIC",E[E.ALPHANUMERIC=2]="ALPHANUMERIC",E[E.STRUCTURED_APPEND=3]="STRUCTURED_APPEND",E[E.BYTE=4]="BYTE",E[E.ECI=5]="ECI",E[E.KANJI=6]="KANJI",E[E.FNC1_FIRST_POSITION=7]="FNC1_FIRST_POSITION",E[E.FNC1_SECOND_POSITION=8]="FNC1_SECOND_POSITION",E[E.HANZI=9]="HANZI"})(Cr||(Cr={}));class ge{constructor(n,i,s,a){this.value=n,this.stringValue=i,this.characterCountBitsForVersions=s,this.bits=a,ge.FOR_BITS.set(a,this),ge.FOR_VALUE.set(n,this)}static forBits(n){const i=ge.FOR_BITS.get(n);if(i===void 0)throw new b;return i}getCharacterCountBits(n){const i=n.getVersionNumber();let s;return i<=9?s=0:i<=26?s=1:s=2,this.characterCountBitsForVersions[s]}getValue(){return this.value}getBits(){return this.bits}equals(n){if(!(n instanceof ge))return!1;const i=n;return this.value===i.value}toString(){return this.stringValue}}ge.FOR_BITS=new Map,ge.FOR_VALUE=new Map,ge.TERMINATOR=new ge(Cr.TERMINATOR,"TERMINATOR",Int32Array.from([0,0,0]),0),ge.NUMERIC=new ge(Cr.NUMERIC,"NUMERIC",Int32Array.from([10,12,14]),1),ge.ALPHANUMERIC=new ge(Cr.ALPHANUMERIC,"ALPHANUMERIC",Int32Array.from([9,11,13]),2),ge.STRUCTURED_APPEND=new ge(Cr.STRUCTURED_APPEND,"STRUCTURED_APPEND",Int32Array.from([0,0,0]),3),ge.BYTE=new ge(Cr.BYTE,"BYTE",Int32Array.from([8,16,16]),4),ge.ECI=new ge(Cr.ECI,"ECI",Int32Array.from([0,0,0]),7),ge.KANJI=new ge(Cr.KANJI,"KANJI",Int32Array.from([8,10,12]),8),ge.FNC1_FIRST_POSITION=new ge(Cr.FNC1_FIRST_POSITION,"FNC1_FIRST_POSITION",Int32Array.from([0,0,0]),5),ge.FNC1_SECOND_POSITION=new ge(Cr.FNC1_SECOND_POSITION,"FNC1_SECOND_POSITION",Int32Array.from([0,0,0]),9),ge.HANZI=new ge(Cr.HANZI,"HANZI",Int32Array.from([8,10,12]),13);class qe{static decode(n,i,s,a){const c=new uu(n);let f=new xe;const d=new Array;let g=-1,p=-1;try{let v=null,A=!1,S;do{if(c.available()<4)S=ge.TERMINATOR;else{const N=c.readBits(4);S=ge.forBits(N)}switch(S){case ge.TERMINATOR:break;case ge.FNC1_FIRST_POSITION:case ge.FNC1_SECOND_POSITION:A=!0;break;case ge.STRUCTURED_APPEND:if(c.available()<16)throw new F;g=c.readBits(8),p=c.readBits(8);break;case ge.ECI:const N=qe.parseECIValue(c);if(v=$.getCharacterSetECIByValue(N),v===null)throw new F;break;case ge.HANZI:const P=c.readBits(4),B=c.readBits(S.getCharacterCountBits(i));P===qe.GB2312_SUBSET&&qe.decodeHanziSegment(c,f,B);break;default:const W=c.readBits(S.getCharacterCountBits(i));switch(S){case ge.NUMERIC:qe.decodeNumericSegment(c,f,W);break;case ge.ALPHANUMERIC:qe.decodeAlphanumericSegment(c,f,W,A);break;case ge.BYTE:qe.decodeByteSegment(c,f,W,v,d,a);break;case ge.KANJI:qe.decodeKanjiSegment(c,f,W);break;default:throw new F}break}}while(S!==ge.TERMINATOR)}catch{throw new F}return new js(n,f.toString(),d.length===0?null:d,s===null?null:s.toString(),g,p)}static decodeHanziSegment(n,i,s){if(s*13>n.available())throw new F;const a=new Uint8Array(2*s);let c=0;for(;s>0;){const f=n.readBits(13);let d=f/96<<8&4294967295|f%96;d<959?d+=41377:d+=42657,a[c]=d>>8&255,a[c+1]=d&255,c+=2,s--}try{i.append(ve.decode(a,Q.GB2312))}catch(f){throw new F(f)}}static decodeKanjiSegment(n,i,s){if(s*13>n.available())throw new F;const a=new Uint8Array(2*s);let c=0;for(;s>0;){const f=n.readBits(13);let d=f/192<<8&4294967295|f%192;d<7936?d+=33088:d+=49472,a[c]=d>>8,a[c+1]=d,c+=2,s--}try{i.append(ve.decode(a,Q.SHIFT_JIS))}catch(f){throw new F(f)}}static decodeByteSegment(n,i,s,a,c,f){if(8*s>n.available())throw new F;const d=new Uint8Array(s);for(let p=0;p<s;p++)d[p]=n.readBits(8);let g;a===null?g=Q.guessEncoding(d,f):g=a.getName();try{i.append(ve.decode(d,g))}catch(p){throw new F(p)}c.push(d)}static toAlphaNumericChar(n){if(n>=qe.ALPHANUMERIC_CHARS.length)throw new F;return qe.ALPHANUMERIC_CHARS[n]}static decodeAlphanumericSegment(n,i,s,a){const c=i.length();for(;s>1;){if(n.available()<11)throw new F;const f=n.readBits(11);i.append(qe.toAlphaNumericChar(Math.floor(f/45))),i.append(qe.toAlphaNumericChar(f%45)),s-=2}if(s===1){if(n.available()<6)throw new F;i.append(qe.toAlphaNumericChar(n.readBits(6)))}if(a)for(let f=c;f<i.length();f++)i.charAt(f)==="%"&&(f<i.length()-1&&i.charAt(f+1)==="%"?i.deleteCharAt(f+1):i.setCharAt(f,""))}static decodeNumericSegment(n,i,s){for(;s>=3;){if(n.available()<10)throw new F;const a=n.readBits(10);if(a>=1e3)throw new F;i.append(qe.toAlphaNumericChar(Math.floor(a/100))),i.append(qe.toAlphaNumericChar(Math.floor(a/10)%10)),i.append(qe.toAlphaNumericChar(a%10)),s-=3}if(s===2){if(n.available()<7)throw new F;const a=n.readBits(7);if(a>=100)throw new F;i.append(qe.toAlphaNumericChar(Math.floor(a/10))),i.append(qe.toAlphaNumericChar(a%10))}else if(s===1){if(n.available()<4)throw new F;const a=n.readBits(4);if(a>=10)throw new F;i.append(qe.toAlphaNumericChar(a))}}static parseECIValue(n){const i=n.readBits(8);if(!(i&128))return i&127;if((i&192)===128){const s=n.readBits(8);return(i&63)<<8&4294967295|s}if((i&224)===192){const s=n.readBits(16);return(i&31)<<16&4294967295|s}throw new F}}qe.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",qe.GB2312_SUBSET=1;class ah{constructor(n){this.mirrored=n}isMirrored(){return this.mirrored}applyMirroredCorrection(n){if(!this.mirrored||n===null||n.length<3)return;const i=n[0];n[0]=n[2],n[2]=i}}class Gy{constructor(){this.rsDecoder=new Vs(Oe.QR_CODE_FIELD_256)}decodeBooleanArray(n,i){return this.decodeBitMatrix(re.parseFromBooleanArray(n),i)}decodeBitMatrix(n,i){const s=new Hy(n);let a=null;try{return this.decodeBitMatrixParser(s,i)}catch(c){a=c}try{s.remask(),s.setMirror(!0),s.readVersion(),s.readFormatInformation(),s.mirror();const c=this.decodeBitMatrixParser(s,i);return c.setOther(new ah(!0)),c}catch(c){throw a!==null?a:c}}decodeBitMatrixParser(n,i){const s=n.readVersion(),a=n.readFormatInformation().getErrorCorrectionLevel(),c=n.readCodewords(),f=fu.getDataBlocks(c,s,a);let d=0;for(const v of f)d+=v.getNumDataCodewords();const g=new Uint8Array(d);let p=0;for(const v of f){const A=v.getCodewords(),S=v.getNumDataCodewords();this.correctErrors(A,S);for(let N=0;N<S;N++)g[p++]=A[N]}return qe.decode(g,s,a,i)}correctErrors(n,i){const s=new Int32Array(n);try{this.rsDecoder.decode(s,n.length-i)}catch{throw new T}for(let a=0;a<i;a++)n[a]=s[a]}}class du extends ce{constructor(n,i,s){super(n,i),this.estimatedModuleSize=s}aboutEquals(n,i,s){if(Math.abs(i-this.getY())<=n&&Math.abs(s-this.getX())<=n){const a=Math.abs(n-this.estimatedModuleSize);return a<=1||a<=this.estimatedModuleSize}return!1}combineEstimate(n,i,s){const a=(this.getX()+i)/2,c=(this.getY()+n)/2,f=(this.estimatedModuleSize+s)/2;return new du(a,c,f)}}class Ia{constructor(n,i,s,a,c,f,d){this.image=n,this.startX=i,this.startY=s,this.width=a,this.height=c,this.moduleSize=f,this.resultPointCallback=d,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}find(){const n=this.startX,i=this.height,s=this.width,a=n+s,c=this.startY+i/2,f=new Int32Array(3),d=this.image;for(let g=0;g<i;g++){const p=c+(g&1?-Math.floor((g+1)/2):Math.floor((g+1)/2));f[0]=0,f[1]=0,f[2]=0;let v=n;for(;v<a&&!d.get(v,p);)v++;let A=0;for(;v<a;){if(d.get(v,p))if(A===1)f[1]++;else if(A===2){if(this.foundPatternCross(f)){const S=this.handlePossibleCenter(f,p,v);if(S!==null)return S}f[0]=f[2],f[1]=1,f[2]=0,A=1}else f[++A]++;else A===1&&A++,f[A]++;v++}if(this.foundPatternCross(f)){const S=this.handlePossibleCenter(f,p,a);if(S!==null)return S}}if(this.possibleCenters.length!==0)return this.possibleCenters[0];throw new z}static centerFromEnd(n,i){return i-n[2]-n[1]/2}foundPatternCross(n){const i=this.moduleSize,s=i/2;for(let a=0;a<3;a++)if(Math.abs(i-n[a])>=s)return!1;return!0}crossCheckVertical(n,i,s,a){const c=this.image,f=c.getHeight(),d=this.crossCheckStateCount;d[0]=0,d[1]=0,d[2]=0;let g=n;for(;g>=0&&c.get(i,g)&&d[1]<=s;)d[1]++,g--;if(g<0||d[1]>s)return NaN;for(;g>=0&&!c.get(i,g)&&d[0]<=s;)d[0]++,g--;if(d[0]>s)return NaN;for(g=n+1;g<f&&c.get(i,g)&&d[1]<=s;)d[1]++,g++;if(g===f||d[1]>s)return NaN;for(;g<f&&!c.get(i,g)&&d[2]<=s;)d[2]++,g++;if(d[2]>s)return NaN;const p=d[0]+d[1]+d[2];return 5*Math.abs(p-a)>=2*a?NaN:this.foundPatternCross(d)?Ia.centerFromEnd(d,g):NaN}handlePossibleCenter(n,i,s){const a=n[0]+n[1]+n[2],c=Ia.centerFromEnd(n,s),f=this.crossCheckVertical(i,c,2*n[1],a);if(!isNaN(f)){const d=(n[0]+n[1]+n[2])/3;for(const p of this.possibleCenters)if(p.aboutEquals(d,f,c))return p.combineEstimate(f,c,d);const g=new du(c,f,d);this.possibleCenters.push(g),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(g)}return null}}class hu extends ce{constructor(n,i,s,a){super(n,i),this.estimatedModuleSize=s,this.count=a,a===void 0&&(this.count=1)}getEstimatedModuleSize(){return this.estimatedModuleSize}getCount(){return this.count}aboutEquals(n,i,s){if(Math.abs(i-this.getY())<=n&&Math.abs(s-this.getX())<=n){const a=Math.abs(n-this.estimatedModuleSize);return a<=1||a<=this.estimatedModuleSize}return!1}combineEstimate(n,i,s){const a=this.count+1,c=(this.count*this.getX()+i)/a,f=(this.count*this.getY()+n)/a,d=(this.count*this.estimatedModuleSize+s)/a;return new hu(c,f,d,a)}}class Xy{constructor(n){this.bottomLeft=n[0],this.topLeft=n[1],this.topRight=n[2]}getBottomLeft(){return this.bottomLeft}getTopLeft(){return this.topLeft}getTopRight(){return this.topRight}}class It{constructor(n,i){this.image=n,this.resultPointCallback=i,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=i}getImage(){return this.image}getPossibleCenters(){return this.possibleCenters}find(n){const i=n!=null&&n.get(U.TRY_HARDER)!==void 0,s=n!=null&&n.get(U.PURE_BARCODE)!==void 0,a=this.image,c=a.getHeight(),f=a.getWidth();let d=Math.floor(3*c/(4*It.MAX_MODULES));(d<It.MIN_SKIP||i)&&(d=It.MIN_SKIP);let g=!1;const p=new Int32Array(5);for(let A=d-1;A<c&&!g;A+=d){p[0]=0,p[1]=0,p[2]=0,p[3]=0,p[4]=0;let S=0;for(let N=0;N<f;N++)if(a.get(N,A))(S&1)===1&&S++,p[S]++;else if(S&1)p[S]++;else if(S===4)if(It.foundPatternCross(p)){if(this.handlePossibleCenter(p,A,N,s)===!0)if(d=2,this.hasSkipped===!0)g=this.haveMultiplyConfirmedCenters();else{const B=this.findRowSkip();B>p[2]&&(A+=B-p[2]-d,N=f-1)}else{p[0]=p[2],p[1]=p[3],p[2]=p[4],p[3]=1,p[4]=0,S=3;continue}S=0,p[0]=0,p[1]=0,p[2]=0,p[3]=0,p[4]=0}else p[0]=p[2],p[1]=p[3],p[2]=p[4],p[3]=1,p[4]=0,S=3;else p[++S]++;It.foundPatternCross(p)&&this.handlePossibleCenter(p,A,f,s)===!0&&(d=p[0],this.hasSkipped&&(g=this.haveMultiplyConfirmedCenters()))}const v=this.selectBestPatterns();return ce.orderBestPatterns(v),new Xy(v)}static centerFromEnd(n,i){return i-n[4]-n[3]-n[2]/2}static foundPatternCross(n){let i=0;for(let c=0;c<5;c++){const f=n[c];if(f===0)return!1;i+=f}if(i<7)return!1;const s=i/7,a=s/2;return Math.abs(s-n[0])<a&&Math.abs(s-n[1])<a&&Math.abs(3*s-n[2])<3*a&&Math.abs(s-n[3])<a&&Math.abs(s-n[4])<a}getCrossCheckStateCount(){const n=this.crossCheckStateCount;return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n}crossCheckDiagonal(n,i,s,a){const c=this.getCrossCheckStateCount();let f=0;const d=this.image;for(;n>=f&&i>=f&&d.get(i-f,n-f);)c[2]++,f++;if(n<f||i<f)return!1;for(;n>=f&&i>=f&&!d.get(i-f,n-f)&&c[1]<=s;)c[1]++,f++;if(n<f||i<f||c[1]>s)return!1;for(;n>=f&&i>=f&&d.get(i-f,n-f)&&c[0]<=s;)c[0]++,f++;if(c[0]>s)return!1;const g=d.getHeight(),p=d.getWidth();for(f=1;n+f<g&&i+f<p&&d.get(i+f,n+f);)c[2]++,f++;if(n+f>=g||i+f>=p)return!1;for(;n+f<g&&i+f<p&&!d.get(i+f,n+f)&&c[3]<s;)c[3]++,f++;if(n+f>=g||i+f>=p||c[3]>=s)return!1;for(;n+f<g&&i+f<p&&d.get(i+f,n+f)&&c[4]<s;)c[4]++,f++;if(c[4]>=s)return!1;const v=c[0]+c[1]+c[2]+c[3]+c[4];return Math.abs(v-a)<2*a&&It.foundPatternCross(c)}crossCheckVertical(n,i,s,a){const c=this.image,f=c.getHeight(),d=this.getCrossCheckStateCount();let g=n;for(;g>=0&&c.get(i,g);)d[2]++,g--;if(g<0)return NaN;for(;g>=0&&!c.get(i,g)&&d[1]<=s;)d[1]++,g--;if(g<0||d[1]>s)return NaN;for(;g>=0&&c.get(i,g)&&d[0]<=s;)d[0]++,g--;if(d[0]>s)return NaN;for(g=n+1;g<f&&c.get(i,g);)d[2]++,g++;if(g===f)return NaN;for(;g<f&&!c.get(i,g)&&d[3]<s;)d[3]++,g++;if(g===f||d[3]>=s)return NaN;for(;g<f&&c.get(i,g)&&d[4]<s;)d[4]++,g++;if(d[4]>=s)return NaN;const p=d[0]+d[1]+d[2]+d[3]+d[4];return 5*Math.abs(p-a)>=2*a?NaN:It.foundPatternCross(d)?It.centerFromEnd(d,g):NaN}crossCheckHorizontal(n,i,s,a){const c=this.image,f=c.getWidth(),d=this.getCrossCheckStateCount();let g=n;for(;g>=0&&c.get(g,i);)d[2]++,g--;if(g<0)return NaN;for(;g>=0&&!c.get(g,i)&&d[1]<=s;)d[1]++,g--;if(g<0||d[1]>s)return NaN;for(;g>=0&&c.get(g,i)&&d[0]<=s;)d[0]++,g--;if(d[0]>s)return NaN;for(g=n+1;g<f&&c.get(g,i);)d[2]++,g++;if(g===f)return NaN;for(;g<f&&!c.get(g,i)&&d[3]<s;)d[3]++,g++;if(g===f||d[3]>=s)return NaN;for(;g<f&&c.get(g,i)&&d[4]<s;)d[4]++,g++;if(d[4]>=s)return NaN;const p=d[0]+d[1]+d[2]+d[3]+d[4];return 5*Math.abs(p-a)>=a?NaN:It.foundPatternCross(d)?It.centerFromEnd(d,g):NaN}handlePossibleCenter(n,i,s,a){const c=n[0]+n[1]+n[2]+n[3]+n[4];let f=It.centerFromEnd(n,s),d=this.crossCheckVertical(i,Math.floor(f),n[2],c);if(!isNaN(d)&&(f=this.crossCheckHorizontal(Math.floor(f),Math.floor(d),n[2],c),!isNaN(f)&&(!a||this.crossCheckDiagonal(Math.floor(d),Math.floor(f),n[2],c)))){const g=c/7;let p=!1;const v=this.possibleCenters;for(let A=0,S=v.length;A<S;A++){const N=v[A];if(N.aboutEquals(g,d,f)){v[A]=N.combineEstimate(d,f,g),p=!0;break}}if(!p){const A=new hu(f,d,g);v.push(A),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(A)}return!0}return!1}findRowSkip(){if(this.possibleCenters.length<=1)return 0;let i=null;for(const s of this.possibleCenters)if(s.getCount()>=It.CENTER_QUORUM)if(i==null)i=s;else return this.hasSkipped=!0,Math.floor((Math.abs(i.getX()-s.getX())-Math.abs(i.getY()-s.getY()))/2);return 0}haveMultiplyConfirmedCenters(){let n=0,i=0;const s=this.possibleCenters.length;for(const f of this.possibleCenters)f.getCount()>=It.CENTER_QUORUM&&(n++,i+=f.getEstimatedModuleSize());if(n<3)return!1;const a=i/s;let c=0;for(const f of this.possibleCenters)c+=Math.abs(f.getEstimatedModuleSize()-a);return c<=.05*i}selectBestPatterns(){const n=this.possibleCenters.length;if(n<3)throw new z;const i=this.possibleCenters;let s;if(n>3){let a=0,c=0;for(const g of this.possibleCenters){const p=g.getEstimatedModuleSize();a+=p,c+=p*p}s=a/n;let f=Math.sqrt(c/n-s*s);i.sort((g,p)=>{const v=Math.abs(p.getEstimatedModuleSize()-s),A=Math.abs(g.getEstimatedModuleSize()-s);return v<A?-1:v>A?1:0});const d=Math.max(.2*s,f);for(let g=0;g<i.length&&i.length>3;g++){const p=i[g];Math.abs(p.getEstimatedModuleSize()-s)>d&&(i.splice(g,1),g--)}}if(i.length>3){let a=0;for(const c of i)a+=c.getEstimatedModuleSize();s=a/i.length,i.sort((c,f)=>{if(f.getCount()===c.getCount()){const d=Math.abs(f.getEstimatedModuleSize()-s),g=Math.abs(c.getEstimatedModuleSize()-s);return d<g?1:d>g?-1:0}else return f.getCount()-c.getCount()}),i.splice(3)}return[i[0],i[1],i[2]]}}It.CENTER_QUORUM=2,It.MIN_SKIP=3,It.MAX_MODULES=57;class $s{constructor(n){this.image=n}getImage(){return this.image}getResultPointCallback(){return this.resultPointCallback}detect(n){this.resultPointCallback=n==null?null:n.get(U.NEED_RESULT_POINT_CALLBACK);const s=new It(this.image,this.resultPointCallback).find(n);return this.processFinderPatternInfo(s)}processFinderPatternInfo(n){const i=n.getTopLeft(),s=n.getTopRight(),a=n.getBottomLeft(),c=this.calculateModuleSize(i,s,a);if(c<1)throw new z("No pattern found in proccess finder.");const f=$s.computeDimension(i,s,a,c),d=de.getProvisionalVersionForDimension(f),g=d.getDimensionForVersion()-7;let p=null;if(d.getAlignmentPatternCenters().length>0){const N=s.getX()-i.getX()+a.getX(),P=s.getY()-i.getY()+a.getY(),B=1-3/g,W=Math.floor(i.getX()+B*(N-i.getX())),G=Math.floor(i.getY()+B*(P-i.getY()));for(let J=4;J<=16;J<<=1)try{p=this.findAlignmentInRegion(c,W,G,J);break}catch(ee){if(!(ee instanceof z))throw ee}}const v=$s.createTransform(i,s,a,p,f),A=$s.sampleGrid(this.image,v,f);let S;return p===null?S=[a,i,s]:S=[a,i,s,p],new Ea(A,S)}static createTransform(n,i,s,a,c){const f=c-3.5;let d,g,p,v;return a!==null?(d=a.getX(),g=a.getY(),p=f-3,v=p):(d=i.getX()-n.getX()+s.getX(),g=i.getY()-n.getY()+s.getY(),p=f,v=f),kr.quadrilateralToQuadrilateral(3.5,3.5,f,3.5,p,v,3.5,f,n.getX(),n.getY(),i.getX(),i.getY(),d,g,s.getX(),s.getY())}static sampleGrid(n,i,s){return Nn.getInstance().sampleGridWithTransform(n,s,s,i)}static computeDimension(n,i,s,a){const c=Re.round(ce.distance(n,i)/a),f=Re.round(ce.distance(n,s)/a);let d=Math.floor((c+f)/2)+7;switch(d&3){case 0:d++;break;case 2:d--;break;case 3:throw new z("Dimensions could be not found.")}return d}calculateModuleSize(n,i,s){return(this.calculateModuleSizeOneWay(n,i)+this.calculateModuleSizeOneWay(n,s))/2}calculateModuleSizeOneWay(n,i){const s=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(n.getX()),Math.floor(n.getY()),Math.floor(i.getX()),Math.floor(i.getY())),a=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(i.getX()),Math.floor(i.getY()),Math.floor(n.getX()),Math.floor(n.getY()));return isNaN(s)?a/7:isNaN(a)?s/7:(s+a)/14}sizeOfBlackWhiteBlackRunBothWays(n,i,s,a){let c=this.sizeOfBlackWhiteBlackRun(n,i,s,a),f=1,d=n-(s-n);d<0?(f=n/(n-d),d=0):d>=this.image.getWidth()&&(f=(this.image.getWidth()-1-n)/(d-n),d=this.image.getWidth()-1);let g=Math.floor(i-(a-i)*f);return f=1,g<0?(f=i/(i-g),g=0):g>=this.image.getHeight()&&(f=(this.image.getHeight()-1-i)/(g-i),g=this.image.getHeight()-1),d=Math.floor(n+(d-n)*f),c+=this.sizeOfBlackWhiteBlackRun(n,i,d,g),c-1}sizeOfBlackWhiteBlackRun(n,i,s,a){const c=Math.abs(a-i)>Math.abs(s-n);if(c){let N=n;n=i,i=N,N=s,s=a,a=N}const f=Math.abs(s-n),d=Math.abs(a-i);let g=-f/2;const p=n<s?1:-1,v=i<a?1:-1;let A=0;const S=s+p;for(let N=n,P=i;N!==S;N+=p){const B=c?P:N,W=c?N:P;if(A===1===this.image.get(B,W)){if(A===2)return Re.distance(N,P,n,i);A++}if(g+=d,g>0){if(P===a)break;P+=v,g-=f}}return A===2?Re.distance(s+p,a,n,i):NaN}findAlignmentInRegion(n,i,s,a){const c=Math.floor(a*n),f=Math.max(0,i-c),d=Math.min(this.image.getWidth()-1,i+c);if(d-f<n*3)throw new z("Alignment top exceeds estimated module size.");const g=Math.max(0,s-c),p=Math.min(this.image.getHeight()-1,s+c);if(p-g<n*3)throw new z("Alignment bottom exceeds estimated module size.");return new Ia(this.image,f,g,d-f,p-g,n,this.resultPointCallback).find()}}class Dn{constructor(){this.decoder=new Gy}getDecoder(){return this.decoder}decode(n,i){let s,a;if(i!=null&&i.get(U.PURE_BARCODE)!==void 0){const g=Dn.extractPureBits(n.getBlackMatrix());s=this.decoder.decodeBitMatrix(g,i),a=Dn.NO_POINTS}else{const g=new $s(n.getBlackMatrix()).detect(i);s=this.decoder.decodeBitMatrix(g.getBits(),i),a=g.getPoints()}s.getOther()instanceof ah&&s.getOther().applyMirroredCorrection(a);const c=new Qe(s.getText(),s.getRawBytes(),void 0,a,ue.QR_CODE,void 0),f=s.getByteSegments();f!==null&&c.putMetadata(Ct.BYTE_SEGMENTS,f);const d=s.getECLevel();return d!==null&&c.putMetadata(Ct.ERROR_CORRECTION_LEVEL,d),s.hasStructuredAppend()&&(c.putMetadata(Ct.STRUCTURED_APPEND_SEQUENCE,s.getStructuredAppendSequenceNumber()),c.putMetadata(Ct.STRUCTURED_APPEND_PARITY,s.getStructuredAppendParity())),c}reset(){}static extractPureBits(n){const i=n.getTopLeftOnBit(),s=n.getBottomRightOnBit();if(i===null||s===null)throw new z;const a=this.moduleSize(i,n);let c=i[1],f=s[1],d=i[0],g=s[0];if(d>=g||c>=f)throw new z;if(f-c!==g-d&&(g=d+(f-c),g>=n.getWidth()))throw new z;const p=Math.round((g-d+1)/a),v=Math.round((f-c+1)/a);if(p<=0||v<=0)throw new z;if(v!==p)throw new z;const A=Math.floor(a/2);c+=A,d+=A;const S=d+Math.floor((p-1)*a)-g;if(S>0){if(S>A)throw new z;d-=S}const N=c+Math.floor((v-1)*a)-f;if(N>0){if(N>A)throw new z;c-=N}const P=new re(p,v);for(let B=0;B<v;B++){const W=c+Math.floor(B*a);for(let G=0;G<p;G++)n.get(d+Math.floor(G*a),W)&&P.set(G,B)}return P}static moduleSize(n,i){const s=i.getHeight(),a=i.getWidth();let c=n[0],f=n[1],d=!0,g=0;for(;c<a&&f<s;){if(d!==i.get(c,f)){if(++g===5)break;d=!d}c++,f++}if(c===a||f===s)throw new z;return(c-n[0])/7}}Dn.NO_POINTS=new Array;class we{PDF417Common(){}static getBitCountSum(n){return Re.sum(n)}static toIntArray(n){if(n==null||!n.length)return we.EMPTY_INT_ARRAY;const i=new Int32Array(n.length);let s=0;for(const a of n)i[s++]=a;return i}static getCodeword(n){const i=I.binarySearch(we.SYMBOL_TABLE,n&262143);return i<0?-1:(we.CODEWORD_TABLE[i]-1)%we.NUMBER_OF_CODEWORDS}}we.NUMBER_OF_CODEWORDS=929,we.MAX_CODEWORDS_IN_BARCODE=we.NUMBER_OF_CODEWORDS-1,we.MIN_ROWS_IN_BARCODE=3,we.MAX_ROWS_IN_BARCODE=90,we.MODULES_IN_CODEWORD=17,we.MODULES_IN_STOP_PATTERN=18,we.BARS_IN_MODULE=8,we.EMPTY_INT_ARRAY=new Int32Array([]),we.SYMBOL_TABLE=Int32Array.from([66142,66170,66206,66236,66290,66292,66350,66382,66396,66454,66470,66476,66594,66600,66614,66626,66628,66632,66640,66654,66662,66668,66682,66690,66718,66720,66748,66758,66776,66798,66802,66804,66820,66824,66832,66846,66848,66876,66880,66936,66950,66956,66968,66992,67006,67022,67036,67042,67044,67048,67062,67118,67150,67164,67214,67228,67256,67294,67322,67350,67366,67372,67398,67404,67416,67438,67474,67476,67490,67492,67496,67510,67618,67624,67650,67656,67664,67678,67686,67692,67706,67714,67716,67728,67742,67744,67772,67782,67788,67800,67822,67826,67828,67842,67848,67870,67872,67900,67904,67960,67974,67992,68016,68030,68046,68060,68066,68068,68072,68086,68104,68112,68126,68128,68156,68160,68216,68336,68358,68364,68376,68400,68414,68448,68476,68494,68508,68536,68546,68548,68552,68560,68574,68582,68588,68654,68686,68700,68706,68708,68712,68726,68750,68764,68792,68802,68804,68808,68816,68830,68838,68844,68858,68878,68892,68920,68976,68990,68994,68996,69e3,69008,69022,69024,69052,69062,69068,69080,69102,69106,69108,69142,69158,69164,69190,69208,69230,69254,69260,69272,69296,69310,69326,69340,69386,69394,69396,69410,69416,69430,69442,69444,69448,69456,69470,69478,69484,69554,69556,69666,69672,69698,69704,69712,69726,69754,69762,69764,69776,69790,69792,69820,69830,69836,69848,69870,69874,69876,69890,69918,69920,69948,69952,70008,70022,70040,70064,70078,70094,70108,70114,70116,70120,70134,70152,70174,70176,70264,70384,70412,70448,70462,70496,70524,70542,70556,70584,70594,70600,70608,70622,70630,70636,70664,70672,70686,70688,70716,70720,70776,70896,71136,71180,71192,71216,71230,71264,71292,71360,71416,71452,71480,71536,71550,71554,71556,71560,71568,71582,71584,71612,71622,71628,71640,71662,71726,71732,71758,71772,71778,71780,71784,71798,71822,71836,71864,71874,71880,71888,71902,71910,71916,71930,71950,71964,71992,72048,72062,72066,72068,72080,72094,72096,72124,72134,72140,72152,72174,72178,72180,72206,72220,72248,72304,72318,72416,72444,72456,72464,72478,72480,72508,72512,72568,72588,72600,72624,72638,72654,72668,72674,72676,72680,72694,72726,72742,72748,72774,72780,72792,72814,72838,72856,72880,72894,72910,72924,72930,72932,72936,72950,72966,72972,72984,73008,73022,73056,73084,73102,73116,73144,73156,73160,73168,73182,73190,73196,73210,73226,73234,73236,73250,73252,73256,73270,73282,73284,73296,73310,73318,73324,73346,73348,73352,73360,73374,73376,73404,73414,73420,73432,73454,73498,73518,73522,73524,73550,73564,73570,73572,73576,73590,73800,73822,73858,73860,73872,73886,73888,73916,73944,73970,73972,73992,74014,74016,74044,74048,74104,74118,74136,74160,74174,74210,74212,74216,74230,74244,74256,74270,74272,74360,74480,74502,74508,74544,74558,74592,74620,74638,74652,74680,74690,74696,74704,74726,74732,74782,74784,74812,74992,75232,75288,75326,75360,75388,75456,75512,75576,75632,75646,75650,75652,75664,75678,75680,75708,75718,75724,75736,75758,75808,75836,75840,75896,76016,76256,76736,76824,76848,76862,76896,76924,76992,77048,77296,77340,77368,77424,77438,77536,77564,77572,77576,77584,77600,77628,77632,77688,77702,77708,77720,77744,77758,77774,77788,77870,77902,77916,77922,77928,77966,77980,78008,78018,78024,78032,78046,78060,78074,78094,78136,78192,78206,78210,78212,78224,78238,78240,78268,78278,78284,78296,78322,78324,78350,78364,78448,78462,78560,78588,78600,78622,78624,78652,78656,78712,78726,78744,78768,78782,78798,78812,78818,78820,78824,78838,78862,78876,78904,78960,78974,79072,79100,79296,79352,79368,79376,79390,79392,79420,79424,79480,79600,79628,79640,79664,79678,79712,79740,79772,79800,79810,79812,79816,79824,79838,79846,79852,79894,79910,79916,79942,79948,79960,79982,79988,80006,80024,80048,80062,80078,80092,80098,80100,80104,80134,80140,80176,80190,80224,80252,80270,80284,80312,80328,80336,80350,80358,80364,80378,80390,80396,80408,80432,80446,80480,80508,80576,80632,80654,80668,80696,80752,80766,80776,80784,80798,80800,80828,80844,80856,80878,80882,80884,80914,80916,80930,80932,80936,80950,80962,80968,80976,80990,80998,81004,81026,81028,81040,81054,81056,81084,81094,81100,81112,81134,81154,81156,81160,81168,81182,81184,81212,81216,81272,81286,81292,81304,81328,81342,81358,81372,81380,81384,81398,81434,81454,81458,81460,81486,81500,81506,81508,81512,81526,81550,81564,81592,81602,81604,81608,81616,81630,81638,81644,81702,81708,81722,81734,81740,81752,81774,81778,81780,82050,82078,82080,82108,82180,82184,82192,82206,82208,82236,82240,82296,82316,82328,82352,82366,82402,82404,82408,82440,82448,82462,82464,82492,82496,82552,82672,82694,82700,82712,82736,82750,82784,82812,82830,82882,82884,82888,82896,82918,82924,82952,82960,82974,82976,83004,83008,83064,83184,83424,83468,83480,83504,83518,83552,83580,83648,83704,83740,83768,83824,83838,83842,83844,83848,83856,83872,83900,83910,83916,83928,83950,83984,84e3,84028,84032,84088,84208,84448,84928,85040,85054,85088,85116,85184,85240,85488,85560,85616,85630,85728,85756,85764,85768,85776,85790,85792,85820,85824,85880,85894,85900,85912,85936,85966,85980,86048,86080,86136,86256,86496,86976,88160,88188,88256,88312,88560,89056,89200,89214,89312,89340,89536,89592,89608,89616,89632,89664,89720,89840,89868,89880,89904,89952,89980,89998,90012,90040,90190,90204,90254,90268,90296,90306,90308,90312,90334,90382,90396,90424,90480,90494,90500,90504,90512,90526,90528,90556,90566,90572,90584,90610,90612,90638,90652,90680,90736,90750,90848,90876,90884,90888,90896,90910,90912,90940,90944,91e3,91014,91020,91032,91056,91070,91086,91100,91106,91108,91112,91126,91150,91164,91192,91248,91262,91360,91388,91584,91640,91664,91678,91680,91708,91712,91768,91888,91928,91952,91966,92e3,92028,92046,92060,92088,92098,92100,92104,92112,92126,92134,92140,92188,92216,92272,92384,92412,92608,92664,93168,93200,93214,93216,93244,93248,93304,93424,93664,93720,93744,93758,93792,93820,93888,93944,93980,94008,94064,94078,94084,94088,94096,94110,94112,94140,94150,94156,94168,94246,94252,94278,94284,94296,94318,94342,94348,94360,94384,94398,94414,94428,94440,94470,94476,94488,94512,94526,94560,94588,94606,94620,94648,94658,94660,94664,94672,94686,94694,94700,94714,94726,94732,94744,94768,94782,94816,94844,94912,94968,94990,95004,95032,95088,95102,95112,95120,95134,95136,95164,95180,95192,95214,95218,95220,95244,95256,95280,95294,95328,95356,95424,95480,95728,95758,95772,95800,95856,95870,95968,95996,96008,96016,96030,96032,96060,96064,96120,96152,96176,96190,96220,96226,96228,96232,96290,96292,96296,96310,96322,96324,96328,96336,96350,96358,96364,96386,96388,96392,96400,96414,96416,96444,96454,96460,96472,96494,96498,96500,96514,96516,96520,96528,96542,96544,96572,96576,96632,96646,96652,96664,96688,96702,96718,96732,96738,96740,96744,96758,96772,96776,96784,96798,96800,96828,96832,96888,97008,97030,97036,97048,97072,97086,97120,97148,97166,97180,97208,97220,97224,97232,97246,97254,97260,97326,97330,97332,97358,97372,97378,97380,97384,97398,97422,97436,97464,97474,97476,97480,97488,97502,97510,97516,97550,97564,97592,97648,97666,97668,97672,97680,97694,97696,97724,97734,97740,97752,97774,97830,97836,97850,97862,97868,97880,97902,97906,97908,97926,97932,97944,97968,97998,98012,98018,98020,98024,98038,98618,98674,98676,98838,98854,98874,98892,98904,98926,98930,98932,98968,99006,99042,99044,99048,99062,99166,99194,99246,99286,99350,99366,99372,99386,99398,99416,99438,99442,99444,99462,99504,99518,99534,99548,99554,99556,99560,99574,99590,99596,99608,99632,99646,99680,99708,99726,99740,99768,99778,99780,99784,99792,99806,99814,99820,99834,99858,99860,99874,99880,99894,99906,99920,99934,99962,99970,99972,99976,99984,99998,1e5,100028,100038,100044,100056,100078,100082,100084,100142,100174,100188,100246,100262,100268,100306,100308,100390,100396,100410,100422,100428,100440,100462,100466,100468,100486,100504,100528,100542,100558,100572,100578,100580,100584,100598,100620,100656,100670,100704,100732,100750,100792,100802,100808,100816,100830,100838,100844,100858,100888,100912,100926,100960,100988,101056,101112,101148,101176,101232,101246,101250,101252,101256,101264,101278,101280,101308,101318,101324,101336,101358,101362,101364,101410,101412,101416,101430,101442,101448,101456,101470,101478,101498,101506,101508,101520,101534,101536,101564,101580,101618,101620,101636,101640,101648,101662,101664,101692,101696,101752,101766,101784,101838,101858,101860,101864,101934,101938,101940,101966,101980,101986,101988,101992,102030,102044,102072,102082,102084,102088,102096,102138,102166,102182,102188,102214,102220,102232,102254,102282,102290,102292,102306,102308,102312,102326,102444,102458,102470,102476,102488,102514,102516,102534,102552,102576,102590,102606,102620,102626,102632,102646,102662,102668,102704,102718,102752,102780,102798,102812,102840,102850,102856,102864,102878,102886,102892,102906,102936,102974,103008,103036,103104,103160,103224,103280,103294,103298,103300,103312,103326,103328,103356,103366,103372,103384,103406,103410,103412,103472,103486,103520,103548,103616,103672,103920,103992,104048,104062,104160,104188,104194,104196,104200,104208,104224,104252,104256,104312,104326,104332,104344,104368,104382,104398,104412,104418,104420,104424,104482,104484,104514,104520,104528,104542,104550,104570,104578,104580,104592,104606,104608,104636,104652,104690,104692,104706,104712,104734,104736,104764,104768,104824,104838,104856,104910,104930,104932,104936,104968,104976,104990,104992,105020,105024,105080,105200,105240,105278,105312,105372,105410,105412,105416,105424,105446,105518,105524,105550,105564,105570,105572,105576,105614,105628,105656,105666,105672,105680,105702,105722,105742,105756,105784,105840,105854,105858,105860,105864,105872,105888,105932,105970,105972,106006,106022,106028,106054,106060,106072,106100,106118,106124,106136,106160,106174,106190,106210,106212,106216,106250,106258,106260,106274,106276,106280,106306,106308,106312,106320,106334,106348,106394,106414,106418,106420,106566,106572,106610,106612,106630,106636,106648,106672,106686,106722,106724,106728,106742,106758,106764,106776,106800,106814,106848,106876,106894,106908,106936,106946,106948,106952,106960,106974,106982,106988,107032,107056,107070,107104,107132,107200,107256,107292,107320,107376,107390,107394,107396,107400,107408,107422,107424,107452,107462,107468,107480,107502,107506,107508,107544,107568,107582,107616,107644,107712,107768,108016,108060,108088,108144,108158,108256,108284,108290,108292,108296,108304,108318,108320,108348,108352,108408,108422,108428,108440,108464,108478,108494,108508,108514,108516,108520,108592,108640,108668,108736,108792,109040,109536,109680,109694,109792,109820,110016,110072,110084,110088,110096,110112,110140,110144,110200,110320,110342,110348,110360,110384,110398,110432,110460,110478,110492,110520,110532,110536,110544,110558,110658,110686,110714,110722,110724,110728,110736,110750,110752,110780,110796,110834,110836,110850,110852,110856,110864,110878,110880,110908,110912,110968,110982,111e3,111054,111074,111076,111080,111108,111112,111120,111134,111136,111164,111168,111224,111344,111372,111422,111456,111516,111554,111556,111560,111568,111590,111632,111646,111648,111676,111680,111736,111856,112096,112152,112224,112252,112320,112440,112514,112516,112520,112528,112542,112544,112588,112686,112718,112732,112782,112796,112824,112834,112836,112840,112848,112870,112890,112910,112924,112952,113008,113022,113026,113028,113032,113040,113054,113056,113100,113138,113140,113166,113180,113208,113264,113278,113376,113404,113416,113424,113440,113468,113472,113560,113614,113634,113636,113640,113686,113702,113708,113734,113740,113752,113778,113780,113798,113804,113816,113840,113854,113870,113890,113892,113896,113926,113932,113944,113968,113982,114016,114044,114076,114114,114116,114120,114128,114150,114170,114194,114196,114210,114212,114216,114242,114244,114248,114256,114270,114278,114306,114308,114312,114320,114334,114336,114364,114380,114420,114458,114478,114482,114484,114510,114524,114530,114532,114536,114842,114866,114868,114970,114994,114996,115042,115044,115048,115062,115130,115226,115250,115252,115278,115292,115298,115300,115304,115318,115342,115394,115396,115400,115408,115422,115430,115436,115450,115478,115494,115514,115526,115532,115570,115572,115738,115758,115762,115764,115790,115804,115810,115812,115816,115830,115854,115868,115896,115906,115912,115920,115934,115942,115948,115962,115996,116024,116080,116094,116098,116100,116104,116112,116126,116128,116156,116166,116172,116184,116206,116210,116212,116246,116262,116268,116282,116294,116300,116312,116334,116338,116340,116358,116364,116376,116400,116414,116430,116444,116450,116452,116456,116498,116500,116514,116520,116534,116546,116548,116552,116560,116574,116582,116588,116602,116654,116694,116714,116762,116782,116786,116788,116814,116828,116834,116836,116840,116854,116878,116892,116920,116930,116936,116944,116958,116966,116972,116986,117006,117048,117104,117118,117122,117124,117136,117150,117152,117180,117190,117196,117208,117230,117234,117236,117304,117360,117374,117472,117500,117506,117508,117512,117520,117536,117564,117568,117624,117638,117644,117656,117680,117694,117710,117724,117730,117732,117736,117750,117782,117798,117804,117818,117830,117848,117874,117876,117894,117936,117950,117966,117986,117988,117992,118022,118028,118040,118064,118078,118112,118140,118172,118210,118212,118216,118224,118238,118246,118266,118306,118312,118338,118352,118366,118374,118394,118402,118404,118408,118416,118430,118432,118460,118476,118514,118516,118574,118578,118580,118606,118620,118626,118628,118632,118678,118694,118700,118730,118738,118740,118830,118834,118836,118862,118876,118882,118884,118888,118902,118926,118940,118968,118978,118980,118984,118992,119006,119014,119020,119034,119068,119096,119152,119166,119170,119172,119176,119184,119198,119200,119228,119238,119244,119256,119278,119282,119284,119324,119352,119408,119422,119520,119548,119554,119556,119560,119568,119582,119584,119612,119616,119672,119686,119692,119704,119728,119742,119758,119772,119778,119780,119784,119798,119920,119934,120032,120060,120256,120312,120324,120328,120336,120352,120384,120440,120560,120582,120588,120600,120624,120638,120672,120700,120718,120732,120760,120770,120772,120776,120784,120798,120806,120812,120870,120876,120890,120902,120908,120920,120946,120948,120966,120972,120984,121008,121022,121038,121058,121060,121064,121078,121100,121112,121136,121150,121184,121212,121244,121282,121284,121288,121296,121318,121338,121356,121368,121392,121406,121440,121468,121536,121592,121656,121730,121732,121736,121744,121758,121760,121804,121842,121844,121890,121922,121924,121928,121936,121950,121958,121978,121986,121988,121992,122e3,122014,122016,122044,122060,122098,122100,122116,122120,122128,122142,122144,122172,122176,122232,122246,122264,122318,122338,122340,122344,122414,122418,122420,122446,122460,122466,122468,122472,122510,122524,122552,122562,122564,122568,122576,122598,122618,122646,122662,122668,122694,122700,122712,122738,122740,122762,122770,122772,122786,122788,122792,123018,123026,123028,123042,123044,123048,123062,123098,123146,123154,123156,123170,123172,123176,123190,123202,123204,123208,123216,123238,123244,123258,123290,123314,123316,123402,123410,123412,123426,123428,123432,123446,123458,123464,123472,123486,123494,123500,123514,123522,123524,123528,123536,123552,123580,123590,123596,123608,123630,123634,123636,123674,123698,123700,123740,123746,123748,123752,123834,123914,123922,123924,123938,123944,123958,123970,123976,123984,123998,124006,124012,124026,124034,124036,124048,124062,124064,124092,124102,124108,124120,124142,124146,124148,124162,124164,124168,124176,124190,124192,124220,124224,124280,124294,124300,124312,124336,124350,124366,124380,124386,124388,124392,124406,124442,124462,124466,124468,124494,124508,124514,124520,124558,124572,124600,124610,124612,124616,124624,124646,124666,124694,124710,124716,124730,124742,124748,124760,124786,124788,124818,124820,124834,124836,124840,124854,124946,124948,124962,124964,124968,124982,124994,124996,125e3,125008,125022,125030,125036,125050,125058,125060,125064,125072,125086,125088,125116,125126,125132,125144,125166,125170,125172,125186,125188,125192,125200,125216,125244,125248,125304,125318,125324,125336,125360,125374,125390,125404,125410,125412,125416,125430,125444,125448,125456,125472,125504,125560,125680,125702,125708,125720,125744,125758,125792,125820,125838,125852,125880,125890,125892,125896,125904,125918,125926,125932,125978,125998,126002,126004,126030,126044,126050,126052,126056,126094,126108,126136,126146,126148,126152,126160,126182,126202,126222,126236,126264,126320,126334,126338,126340,126344,126352,126366,126368,126412,126450,126452,126486,126502,126508,126522,126534,126540,126552,126574,126578,126580,126598,126604,126616,126640,126654,126670,126684,126690,126692,126696,126738,126754,126756,126760,126774,126786,126788,126792,126800,126814,126822,126828,126842,126894,126898,126900,126934,127126,127142,127148,127162,127178,127186,127188,127254,127270,127276,127290,127302,127308,127320,127342,127346,127348,127370,127378,127380,127394,127396,127400,127450,127510,127526,127532,127546,127558,127576,127598,127602,127604,127622,127628,127640,127664,127678,127694,127708,127714,127716,127720,127734,127754,127762,127764,127778,127784,127810,127812,127816,127824,127838,127846,127866,127898,127918,127922,127924,128022,128038,128044,128058,128070,128076,128088,128110,128114,128116,128134,128140,128152,128176,128190,128206,128220,128226,128228,128232,128246,128262,128268,128280,128304,128318,128352,128380,128398,128412,128440,128450,128452,128456,128464,128478,128486,128492,128506,128522,128530,128532,128546,128548,128552,128566,128578,128580,128584,128592,128606,128614,128634,128642,128644,128648,128656,128670,128672,128700,128716,128754,128756,128794,128814,128818,128820,128846,128860,128866,128868,128872,128886,128918,128934,128940,128954,128978,128980,129178,129198,129202,129204,129238,129258,129306,129326,129330,129332,129358,129372,129378,129380,129384,129398,129430,129446,129452,129466,129482,129490,129492,129562,129582,129586,129588,129614,129628,129634,129636,129640,129654,129678,129692,129720,129730,129732,129736,129744,129758,129766,129772,129814,129830,129836,129850,129862,129868,129880,129902,129906,129908,129930,129938,129940,129954,129956,129960,129974,130010]),we.CODEWORD_TABLE=Int32Array.from([2627,1819,2622,2621,1813,1812,2729,2724,2723,2779,2774,2773,902,896,908,868,865,861,859,2511,873,871,1780,835,2493,825,2491,842,837,844,1764,1762,811,810,809,2483,807,2482,806,2480,815,814,813,812,2484,817,816,1745,1744,1742,1746,2655,2637,2635,2626,2625,2623,2628,1820,2752,2739,2737,2728,2727,2725,2730,2785,2783,2778,2777,2775,2780,787,781,747,739,736,2413,754,752,1719,692,689,681,2371,678,2369,700,697,694,703,1688,1686,642,638,2343,631,2341,627,2338,651,646,643,2345,654,652,1652,1650,1647,1654,601,599,2322,596,2321,594,2319,2317,611,610,608,606,2324,603,2323,615,614,612,1617,1616,1614,1612,616,1619,1618,2575,2538,2536,905,901,898,909,2509,2507,2504,870,867,864,860,2512,875,872,1781,2490,2489,2487,2485,1748,836,834,832,830,2494,827,2492,843,841,839,845,1765,1763,2701,2676,2674,2653,2648,2656,2634,2633,2631,2629,1821,2638,2636,2770,2763,2761,2750,2745,2753,2736,2735,2733,2731,1848,2740,2738,2786,2784,591,588,576,569,566,2296,1590,537,534,526,2276,522,2274,545,542,539,548,1572,1570,481,2245,466,2242,462,2239,492,485,482,2249,496,494,1534,1531,1528,1538,413,2196,406,2191,2188,425,419,2202,415,2199,432,430,427,1472,1467,1464,433,1476,1474,368,367,2160,365,2159,362,2157,2155,2152,378,377,375,2166,372,2165,369,2162,383,381,379,2168,1419,1418,1416,1414,385,1411,384,1423,1422,1420,1424,2461,802,2441,2439,790,786,783,794,2409,2406,2403,750,742,738,2414,756,753,1720,2367,2365,2362,2359,1663,693,691,684,2373,680,2370,702,699,696,704,1690,1687,2337,2336,2334,2332,1624,2329,1622,640,637,2344,634,2342,630,2340,650,648,645,2346,655,653,1653,1651,1649,1655,2612,2597,2595,2571,2568,2565,2576,2534,2529,2526,1787,2540,2537,907,904,900,910,2503,2502,2500,2498,1768,2495,1767,2510,2508,2506,869,866,863,2513,876,874,1782,2720,2713,2711,2697,2694,2691,2702,2672,2670,2664,1828,2678,2675,2647,2646,2644,2642,1823,2639,1822,2654,2652,2650,2657,2771,1855,2765,2762,1850,1849,2751,2749,2747,2754,353,2148,344,342,336,2142,332,2140,345,1375,1373,306,2130,299,2128,295,2125,319,314,311,2132,1354,1352,1349,1356,262,257,2101,253,2096,2093,274,273,267,2107,263,2104,280,278,275,1316,1311,1308,1320,1318,2052,202,2050,2044,2040,219,2063,212,2060,208,2055,224,221,2066,1260,1258,1252,231,1248,229,1266,1264,1261,1268,155,1998,153,1996,1994,1991,1988,165,164,2007,162,2006,159,2003,2e3,172,171,169,2012,166,2010,1186,1184,1182,1179,175,1176,173,1192,1191,1189,1187,176,1194,1193,2313,2307,2305,592,589,2294,2292,2289,578,572,568,2297,580,1591,2272,2267,2264,1547,538,536,529,2278,525,2275,547,544,541,1574,1571,2237,2235,2229,1493,2225,1489,478,2247,470,2244,465,2241,493,488,484,2250,498,495,1536,1533,1530,1539,2187,2186,2184,2182,1432,2179,1430,2176,1427,414,412,2197,409,2195,405,2193,2190,426,424,421,2203,418,2201,431,429,1473,1471,1469,1466,434,1477,1475,2478,2472,2470,2459,2457,2454,2462,803,2437,2432,2429,1726,2443,2440,792,789,785,2401,2399,2393,1702,2389,1699,2411,2408,2405,745,741,2415,758,755,1721,2358,2357,2355,2353,1661,2350,1660,2347,1657,2368,2366,2364,2361,1666,690,687,2374,683,2372,701,698,705,1691,1689,2619,2617,2610,2608,2605,2613,2593,2588,2585,1803,2599,2596,2563,2561,2555,1797,2551,1795,2573,2570,2567,2577,2525,2524,2522,2520,1786,2517,1785,2514,1783,2535,2533,2531,2528,1788,2541,2539,906,903,911,2721,1844,2715,2712,1838,1836,2699,2696,2693,2703,1827,1826,1824,2673,2671,2669,2666,1829,2679,2677,1858,1857,2772,1854,1853,1851,1856,2766,2764,143,1987,139,1986,135,133,131,1984,128,1983,125,1981,138,137,136,1985,1133,1132,1130,112,110,1974,107,1973,104,1971,1969,122,121,119,117,1977,114,1976,124,1115,1114,1112,1110,1117,1116,84,83,1953,81,1952,78,1950,1948,1945,94,93,91,1959,88,1958,85,1955,99,97,95,1961,1086,1085,1083,1081,1078,100,1090,1089,1087,1091,49,47,1917,44,1915,1913,1910,1907,59,1926,56,1925,53,1922,1919,66,64,1931,61,1929,1042,1040,1038,71,1035,70,1032,68,1048,1047,1045,1043,1050,1049,12,10,1869,1867,1864,1861,21,1880,19,1877,1874,1871,28,1888,25,1886,22,1883,982,980,977,974,32,30,991,989,987,984,34,995,994,992,2151,2150,2147,2146,2144,356,355,354,2149,2139,2138,2136,2134,1359,343,341,338,2143,335,2141,348,347,346,1376,1374,2124,2123,2121,2119,1326,2116,1324,310,308,305,2131,302,2129,298,2127,320,318,316,313,2133,322,321,1355,1353,1351,1357,2092,2091,2089,2087,1276,2084,1274,2081,1271,259,2102,256,2100,252,2098,2095,272,269,2108,266,2106,281,279,277,1317,1315,1313,1310,282,1321,1319,2039,2037,2035,2032,1203,2029,1200,1197,207,2053,205,2051,201,2049,2046,2043,220,218,2064,215,2062,211,2059,228,226,223,2069,1259,1257,1254,232,1251,230,1267,1265,1263,2316,2315,2312,2311,2309,2314,2304,2303,2301,2299,1593,2308,2306,590,2288,2287,2285,2283,1578,2280,1577,2295,2293,2291,579,577,574,571,2298,582,581,1592,2263,2262,2260,2258,1545,2255,1544,2252,1541,2273,2271,2269,2266,1550,535,532,2279,528,2277,546,543,549,1575,1573,2224,2222,2220,1486,2217,1485,2214,1482,1479,2238,2236,2234,2231,1496,2228,1492,480,477,2248,473,2246,469,2243,490,487,2251,497,1537,1535,1532,2477,2476,2474,2479,2469,2468,2466,2464,1730,2473,2471,2453,2452,2450,2448,1729,2445,1728,2460,2458,2456,2463,805,804,2428,2427,2425,2423,1725,2420,1724,2417,1722,2438,2436,2434,2431,1727,2444,2442,793,791,788,795,2388,2386,2384,1697,2381,1696,2378,1694,1692,2402,2400,2398,2395,1703,2392,1701,2412,2410,2407,751,748,744,2416,759,757,1807,2620,2618,1806,1805,2611,2609,2607,2614,1802,1801,1799,2594,2592,2590,2587,1804,2600,2598,1794,1793,1791,1789,2564,2562,2560,2557,1798,2554,1796,2574,2572,2569,2578,1847,1846,2722,1843,1842,1840,1845,2716,2714,1835,1834,1832,1830,1839,1837,2700,2698,2695,2704,1817,1811,1810,897,862,1777,829,826,838,1760,1758,808,2481,1741,1740,1738,1743,2624,1818,2726,2776,782,740,737,1715,686,679,695,1682,1680,639,628,2339,647,644,1645,1643,1640,1648,602,600,597,595,2320,593,2318,609,607,604,1611,1610,1608,1606,613,1615,1613,2328,926,924,892,886,899,857,850,2505,1778,824,823,821,819,2488,818,2486,833,831,828,840,1761,1759,2649,2632,2630,2746,2734,2732,2782,2781,570,567,1587,531,527,523,540,1566,1564,476,467,463,2240,486,483,1524,1521,1518,1529,411,403,2192,399,2189,423,416,1462,1457,1454,428,1468,1465,2210,366,363,2158,360,2156,357,2153,376,373,370,2163,1410,1409,1407,1405,382,1402,380,1417,1415,1412,1421,2175,2174,777,774,771,784,732,725,722,2404,743,1716,676,674,668,2363,665,2360,685,1684,1681,626,624,622,2335,620,2333,617,2330,641,635,649,1646,1644,1642,2566,928,925,2530,2527,894,891,888,2501,2499,2496,858,856,854,851,1779,2692,2668,2665,2645,2643,2640,2651,2768,2759,2757,2744,2743,2741,2748,352,1382,340,337,333,1371,1369,307,300,296,2126,315,312,1347,1342,1350,261,258,250,2097,246,2094,271,268,264,1306,1301,1298,276,1312,1309,2115,203,2048,195,2045,191,2041,213,209,2056,1246,1244,1238,225,1234,222,1256,1253,1249,1262,2080,2079,154,1997,150,1995,147,1992,1989,163,160,2004,156,2001,1175,1174,1172,1170,1167,170,1164,167,1185,1183,1180,1177,174,1190,1188,2025,2024,2022,587,586,564,559,556,2290,573,1588,520,518,512,2268,508,2265,530,1568,1565,461,457,2233,450,2230,446,2226,479,471,489,1526,1523,1520,397,395,2185,392,2183,389,2180,2177,410,2194,402,422,1463,1461,1459,1456,1470,2455,799,2433,2430,779,776,773,2397,2394,2390,734,728,724,746,1717,2356,2354,2351,2348,1658,677,675,673,670,667,688,1685,1683,2606,2589,2586,2559,2556,2552,927,2523,2521,2518,2515,1784,2532,895,893,890,2718,2709,2707,2689,2687,2684,2663,2662,2660,2658,1825,2667,2769,1852,2760,2758,142,141,1139,1138,134,132,129,126,1982,1129,1128,1126,1131,113,111,108,105,1972,101,1970,120,118,115,1109,1108,1106,1104,123,1113,1111,82,79,1951,75,1949,72,1946,92,89,86,1956,1077,1076,1074,1072,98,1069,96,1084,1082,1079,1088,1968,1967,48,45,1916,42,1914,39,1911,1908,60,57,54,1923,50,1920,1031,1030,1028,1026,67,1023,65,1020,62,1041,1039,1036,1033,69,1046,1044,1944,1943,1941,11,9,1868,7,1865,1862,1859,20,1878,16,1875,13,1872,970,968,966,963,29,960,26,23,983,981,978,975,33,971,31,990,988,985,1906,1904,1902,993,351,2145,1383,331,330,328,326,2137,323,2135,339,1372,1370,294,293,291,289,2122,286,2120,283,2117,309,303,317,1348,1346,1344,245,244,242,2090,239,2088,236,2085,2082,260,2099,249,270,1307,1305,1303,1300,1314,189,2038,186,2036,183,2033,2030,2026,206,198,2047,194,216,1247,1245,1243,1240,227,1237,1255,2310,2302,2300,2286,2284,2281,565,563,561,558,575,1589,2261,2259,2256,2253,1542,521,519,517,514,2270,511,533,1569,1567,2223,2221,2218,2215,1483,2211,1480,459,456,453,2232,449,474,491,1527,1525,1522,2475,2467,2465,2451,2449,2446,801,800,2426,2424,2421,2418,1723,2435,780,778,775,2387,2385,2382,2379,1695,2375,1693,2396,735,733,730,727,749,1718,2616,2615,2604,2603,2601,2584,2583,2581,2579,1800,2591,2550,2549,2547,2545,1792,2542,1790,2558,929,2719,1841,2710,2708,1833,1831,2690,2688,2686,1815,1809,1808,1774,1756,1754,1737,1736,1734,1739,1816,1711,1676,1674,633,629,1638,1636,1633,1641,598,1605,1604,1602,1600,605,1609,1607,2327,887,853,1775,822,820,1757,1755,1584,524,1560,1558,468,464,1514,1511,1508,1519,408,404,400,1452,1447,1444,417,1458,1455,2208,364,361,358,2154,1401,1400,1398,1396,374,1393,371,1408,1406,1403,1413,2173,2172,772,726,723,1712,672,669,666,682,1678,1675,625,623,621,618,2331,636,632,1639,1637,1635,920,918,884,880,889,849,848,847,846,2497,855,852,1776,2641,2742,2787,1380,334,1367,1365,301,297,1340,1338,1335,1343,255,251,247,1296,1291,1288,265,1302,1299,2113,204,196,192,2042,1232,1230,1224,214,1220,210,1242,1239,1235,1250,2077,2075,151,148,1993,144,1990,1163,1162,1160,1158,1155,161,1152,157,1173,1171,1168,1165,168,1181,1178,2021,2020,2018,2023,585,560,557,1585,516,509,1562,1559,458,447,2227,472,1516,1513,1510,398,396,393,390,2181,386,2178,407,1453,1451,1449,1446,420,1460,2209,769,764,720,712,2391,729,1713,664,663,661,659,2352,656,2349,671,1679,1677,2553,922,919,2519,2516,885,883,881,2685,2661,2659,2767,2756,2755,140,1137,1136,130,127,1125,1124,1122,1127,109,106,102,1103,1102,1100,1098,116,1107,1105,1980,80,76,73,1947,1068,1067,1065,1063,90,1060,87,1075,1073,1070,1080,1966,1965,46,43,40,1912,36,1909,1019,1018,1016,1014,58,1011,55,1008,51,1029,1027,1024,1021,63,1037,1034,1940,1939,1937,1942,8,1866,4,1863,1,1860,956,954,952,949,946,17,14,969,967,964,961,27,957,24,979,976,972,1901,1900,1898,1896,986,1905,1903,350,349,1381,329,327,324,1368,1366,292,290,287,284,2118,304,1341,1339,1337,1345,243,240,237,2086,233,2083,254,1297,1295,1293,1290,1304,2114,190,187,184,2034,180,2031,177,2027,199,1233,1231,1229,1226,217,1223,1241,2078,2076,584,555,554,552,550,2282,562,1586,507,506,504,502,2257,499,2254,515,1563,1561,445,443,441,2219,438,2216,435,2212,460,454,475,1517,1515,1512,2447,798,797,2422,2419,770,768,766,2383,2380,2376,721,719,717,714,731,1714,2602,2582,2580,2548,2546,2543,923,921,2717,2706,2705,2683,2682,2680,1771,1752,1750,1733,1732,1731,1735,1814,1707,1670,1668,1631,1629,1626,1634,1599,1598,1596,1594,1603,1601,2326,1772,1753,1751,1581,1554,1552,1504,1501,1498,1509,1442,1437,1434,401,1448,1445,2206,1392,1391,1389,1387,1384,359,1399,1397,1394,1404,2171,2170,1708,1672,1669,619,1632,1630,1628,1773,1378,1363,1361,1333,1328,1336,1286,1281,1278,248,1292,1289,2111,1218,1216,1210,197,1206,193,1228,1225,1221,1236,2073,2071,1151,1150,1148,1146,152,1143,149,1140,145,1161,1159,1156,1153,158,1169,1166,2017,2016,2014,2019,1582,510,1556,1553,452,448,1506,1500,394,391,387,1443,1441,1439,1436,1450,2207,765,716,713,1709,662,660,657,1673,1671,916,914,879,878,877,882,1135,1134,1121,1120,1118,1123,1097,1096,1094,1092,103,1101,1099,1979,1059,1058,1056,1054,77,1051,74,1066,1064,1061,1071,1964,1963,1007,1006,1004,1002,999,41,996,37,1017,1015,1012,1009,52,1025,1022,1936,1935,1933,1938,942,940,938,935,932,5,2,955,953,950,947,18,943,15,965,962,958,1895,1894,1892,1890,973,1899,1897,1379,325,1364,1362,288,285,1334,1332,1330,241,238,234,1287,1285,1283,1280,1294,2112,188,185,181,178,2028,1219,1217,1215,1212,200,1209,1227,2074,2072,583,553,551,1583,505,503,500,513,1557,1555,444,442,439,436,2213,455,451,1507,1505,1502,796,763,762,760,767,711,710,708,706,2377,718,715,1710,2544,917,915,2681,1627,1597,1595,2325,1769,1749,1747,1499,1438,1435,2204,1390,1388,1385,1395,2169,2167,1704,1665,1662,1625,1623,1620,1770,1329,1282,1279,2109,1214,1207,1222,2068,2065,1149,1147,1144,1141,146,1157,1154,2013,2011,2008,2015,1579,1549,1546,1495,1487,1433,1431,1428,1425,388,1440,2205,1705,658,1667,1664,1119,1095,1093,1978,1057,1055,1052,1062,1962,1960,1005,1003,1e3,997,38,1013,1010,1932,1930,1927,1934,941,939,936,933,6,930,3,951,948,944,1889,1887,1884,1881,959,1893,1891,35,1377,1360,1358,1327,1325,1322,1331,1277,1275,1272,1269,235,1284,2110,1205,1204,1201,1198,182,1195,179,1213,2070,2067,1580,501,1551,1548,440,437,1497,1494,1490,1503,761,709,707,1706,913,912,2198,1386,2164,2161,1621,1766,2103,1208,2058,2054,1145,1142,2005,2002,1999,2009,1488,1429,1426,2200,1698,1659,1656,1975,1053,1957,1954,1001,998,1924,1921,1918,1928,937,934,931,1879,1876,1873,1870,945,1885,1882,1323,1273,1270,2105,1202,1199,1196,1211,2061,2057,1576,1543,1540,1484,1481,1478,1491,1700]);class Yy{constructor(n,i){this.bits=n,this.points=i}getBits(){return this.bits}getPoints(){return this.points}}class Ee{static detectMultiple(n,i,s){let a=n.getBlackMatrix(),c=Ee.detect(s,a);return c.length||(a=a.clone(),a.rotate180(),c=Ee.detect(s,a)),new Yy(a,c)}static detect(n,i){const s=new Array;let a=0,c=0,f=!1;for(;a<i.getHeight();){const d=Ee.findVertices(i,a,c);if(d[0]==null&&d[3]==null){if(!f)break;f=!1,c=0;for(const g of s)g[1]!=null&&(a=Math.trunc(Math.max(a,g[1].getY()))),g[3]!=null&&(a=Math.max(a,Math.trunc(g[3].getY())));a+=Ee.ROW_STEP;continue}if(f=!0,s.push(d),!n)break;d[2]!=null?(c=Math.trunc(d[2].getX()),a=Math.trunc(d[2].getY())):(c=Math.trunc(d[4].getX()),a=Math.trunc(d[4].getY()))}return s}static findVertices(n,i,s){const a=n.getHeight(),c=n.getWidth(),f=new Array(8);return Ee.copyToResult(f,Ee.findRowsWithPattern(n,a,c,i,s,Ee.START_PATTERN),Ee.INDEXES_START_PATTERN),f[4]!=null&&(s=Math.trunc(f[4].getX()),i=Math.trunc(f[4].getY())),Ee.copyToResult(f,Ee.findRowsWithPattern(n,a,c,i,s,Ee.STOP_PATTERN),Ee.INDEXES_STOP_PATTERN),f}static copyToResult(n,i,s){for(let a=0;a<s.length;a++)n[s[a]]=i[a]}static findRowsWithPattern(n,i,s,a,c,f){const d=new Array(4);let g=!1;const p=new Int32Array(f.length);for(;a<i;a+=Ee.ROW_STEP){let A=Ee.findGuardPattern(n,c,a,s,!1,f,p);if(A!=null){for(;a>0;){const S=Ee.findGuardPattern(n,c,--a,s,!1,f,p);if(S!=null)A=S;else{a++;break}}d[0]=new ce(A[0],a),d[1]=new ce(A[1],a),g=!0;break}}let v=a+1;if(g){let A=0,S=Int32Array.from([Math.trunc(d[0].getX()),Math.trunc(d[1].getX())]);for(;v<i;v++){const N=Ee.findGuardPattern(n,S[0],v,s,!1,f,p);if(N!=null&&Math.abs(S[0]-N[0])<Ee.MAX_PATTERN_DRIFT&&Math.abs(S[1]-N[1])<Ee.MAX_PATTERN_DRIFT)S=N,A=0;else{if(A>Ee.SKIPPED_ROW_COUNT_MAX)break;A++}}v-=A+1,d[2]=new ce(S[0],v),d[3]=new ce(S[1],v)}return v-a<Ee.BARCODE_MIN_HEIGHT&&I.fill(d,null),d}static findGuardPattern(n,i,s,a,c,f,d){I.fillWithin(d,0,d.length,0);let g=i,p=0;for(;n.get(g,s)&&g>0&&p++<Ee.MAX_PIXEL_DRIFT;)g--;let v=g,A=0,S=f.length;for(let N=c;v<a;v++)if(n.get(v,s)!==N)d[A]++;else{if(A===S-1){if(Ee.patternMatchVariance(d,f,Ee.MAX_INDIVIDUAL_VARIANCE)<Ee.MAX_AVG_VARIANCE)return new Int32Array([g,v]);g+=d[0]+d[1],D.arraycopy(d,2,d,0,A-1),d[A-1]=0,d[A]=0,A--}else A++;d[A]=1,N=!N}return A===S-1&&Ee.patternMatchVariance(d,f,Ee.MAX_INDIVIDUAL_VARIANCE)<Ee.MAX_AVG_VARIANCE?new Int32Array([g,v-1]):null}static patternMatchVariance(n,i,s){let a=n.length,c=0,f=0;for(let p=0;p<a;p++)c+=n[p],f+=i[p];if(c<f)return 1/0;let d=c/f;s*=d;let g=0;for(let p=0;p<a;p++){let v=n[p],A=i[p]*d,S=v>A?v-A:A-v;if(S>s)return 1/0;g+=S}return g/c}}Ee.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),Ee.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),Ee.MAX_AVG_VARIANCE=.42,Ee.MAX_INDIVIDUAL_VARIANCE=.8,Ee.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),Ee.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),Ee.MAX_PIXEL_DRIFT=3,Ee.MAX_PATTERN_DRIFT=5,Ee.SKIPPED_ROW_COUNT_MAX=25,Ee.ROW_STEP=5,Ee.BARCODE_MIN_HEIGHT=10;class Nt{constructor(n,i){if(i.length===0)throw new b;this.field=n;let s=i.length;if(s>1&&i[0]===0){let a=1;for(;a<s&&i[a]===0;)a++;a===s?this.coefficients=new Int32Array([0]):(this.coefficients=new Int32Array(s-a),D.arraycopy(i,a,this.coefficients,0,this.coefficients.length))}else this.coefficients=i}getCoefficients(){return this.coefficients}getDegree(){return this.coefficients.length-1}isZero(){return this.coefficients[0]===0}getCoefficient(n){return this.coefficients[this.coefficients.length-1-n]}evaluateAt(n){if(n===0)return this.getCoefficient(0);if(n===1){let a=0;for(let c of this.coefficients)a=this.field.add(a,c);return a}let i=this.coefficients[0],s=this.coefficients.length;for(let a=1;a<s;a++)i=this.field.add(this.field.multiply(n,i),this.coefficients[a]);return i}add(n){if(!this.field.equals(n.field))throw new b("ModulusPolys do not have same ModulusGF field");if(this.isZero())return n;if(n.isZero())return this;let i=this.coefficients,s=n.coefficients;if(i.length>s.length){let f=i;i=s,s=f}let a=new Int32Array(s.length),c=s.length-i.length;D.arraycopy(s,0,a,0,c);for(let f=c;f<s.length;f++)a[f]=this.field.add(i[f-c],s[f]);return new Nt(this.field,a)}subtract(n){if(!this.field.equals(n.field))throw new b("ModulusPolys do not have same ModulusGF field");return n.isZero()?this:this.add(n.negative())}multiply(n){return n instanceof Nt?this.multiplyOther(n):this.multiplyScalar(n)}multiplyOther(n){if(!this.field.equals(n.field))throw new b("ModulusPolys do not have same ModulusGF field");if(this.isZero()||n.isZero())return new Nt(this.field,new Int32Array([0]));let i=this.coefficients,s=i.length,a=n.coefficients,c=a.length,f=new Int32Array(s+c-1);for(let d=0;d<s;d++){let g=i[d];for(let p=0;p<c;p++)f[d+p]=this.field.add(f[d+p],this.field.multiply(g,a[p]))}return new Nt(this.field,f)}negative(){let n=this.coefficients.length,i=new Int32Array(n);for(let s=0;s<n;s++)i[s]=this.field.subtract(0,this.coefficients[s]);return new Nt(this.field,i)}multiplyScalar(n){if(n===0)return new Nt(this.field,new Int32Array([0]));if(n===1)return this;let i=this.coefficients.length,s=new Int32Array(i);for(let a=0;a<i;a++)s[a]=this.field.multiply(this.coefficients[a],n);return new Nt(this.field,s)}multiplyByMonomial(n,i){if(n<0)throw new b;if(i===0)return new Nt(this.field,new Int32Array([0]));let s=this.coefficients.length,a=new Int32Array(s+n);for(let c=0;c<s;c++)a[c]=this.field.multiply(this.coefficients[c],i);return new Nt(this.field,a)}toString(){let n=new xe;for(let i=this.getDegree();i>=0;i--){let s=this.getCoefficient(i);s!==0&&(s<0?(n.append(" - "),s=-s):n.length()>0&&n.append(" + "),(i===0||s!==1)&&n.append(s),i!==0&&(i===1?n.append("x"):(n.append("x^"),n.append(i))))}return n.toString()}}class Ky{add(n,i){return(n+i)%this.modulus}subtract(n,i){return(this.modulus+n-i)%this.modulus}exp(n){return this.expTable[n]}log(n){if(n===0)throw new b;return this.logTable[n]}inverse(n){if(n===0)throw new va;return this.expTable[this.modulus-this.logTable[n]-1]}multiply(n,i){return n===0||i===0?0:this.expTable[(this.logTable[n]+this.logTable[i])%(this.modulus-1)]}getSize(){return this.modulus}equals(n){return n===this}}class gu extends Ky{constructor(n,i){super(),this.modulus=n,this.expTable=new Int32Array(n),this.logTable=new Int32Array(n);let s=1;for(let a=0;a<n;a++)this.expTable[a]=s,s=s*i%n;for(let a=0;a<n-1;a++)this.logTable[this.expTable[a]]=a;this.zero=new Nt(this,new Int32Array([0])),this.one=new Nt(this,new Int32Array([1]))}getZero(){return this.zero}getOne(){return this.one}buildMonomial(n,i){if(n<0)throw new b;if(i===0)return this.zero;let s=new Int32Array(n+1);return s[0]=i,new Nt(this,s)}}gu.PDF417_GF=new gu(we.NUMBER_OF_CODEWORDS,3);class lh{constructor(){this.field=gu.PDF417_GF}decode(n,i,s){let a=new Nt(this.field,n),c=new Int32Array(i),f=!1;for(let P=i;P>0;P--){let B=a.evaluateAt(this.field.exp(P));c[i-P]=B,B!==0&&(f=!0)}if(!f)return 0;let d=this.field.getOne();if(s!=null)for(const P of s){let B=this.field.exp(n.length-1-P),W=new Nt(this.field,new Int32Array([this.field.subtract(0,B),1]));d=d.multiply(W)}let g=new Nt(this.field,c),p=this.runEuclideanAlgorithm(this.field.buildMonomial(i,1),g,i),v=p[0],A=p[1],S=this.findErrorLocations(v),N=this.findErrorMagnitudes(A,v,S);for(let P=0;P<S.length;P++){let B=n.length-1-this.field.log(S[P]);if(B<0)throw T.getChecksumInstance();n[B]=this.field.subtract(n[B],N[P])}return S.length}runEuclideanAlgorithm(n,i,s){if(n.getDegree()<i.getDegree()){let S=n;n=i,i=S}let a=n,c=i,f=this.field.getZero(),d=this.field.getOne();for(;c.getDegree()>=Math.round(s/2);){let S=a,N=f;if(a=c,f=d,a.isZero())throw T.getChecksumInstance();c=S;let P=this.field.getZero(),B=a.getCoefficient(a.getDegree()),W=this.field.inverse(B);for(;c.getDegree()>=a.getDegree()&&!c.isZero();){let G=c.getDegree()-a.getDegree(),J=this.field.multiply(c.getCoefficient(c.getDegree()),W);P=P.add(this.field.buildMonomial(G,J)),c=c.subtract(a.multiplyByMonomial(G,J))}d=P.multiply(f).subtract(N).negative()}let g=d.getCoefficient(0);if(g===0)throw T.getChecksumInstance();let p=this.field.inverse(g),v=d.multiply(p),A=c.multiply(p);return[v,A]}findErrorLocations(n){let i=n.getDegree(),s=new Int32Array(i),a=0;for(let c=1;c<this.field.getSize()&&a<i;c++)n.evaluateAt(c)===0&&(s[a]=this.field.inverse(c),a++);if(a!==i)throw T.getChecksumInstance();return s}findErrorMagnitudes(n,i,s){let a=i.getDegree(),c=new Int32Array(a);for(let p=1;p<=a;p++)c[a-p]=this.field.multiply(p,i.getCoefficient(p));let f=new Nt(this.field,c),d=s.length,g=new Int32Array(d);for(let p=0;p<d;p++){let v=this.field.inverse(s[p]),A=this.field.subtract(0,n.evaluateAt(v)),S=this.field.inverse(f.evaluateAt(v));g[p]=this.field.multiply(A,S)}return g}}class fi{constructor(n,i,s,a,c){n instanceof fi?this.constructor_2(n):this.constructor_1(n,i,s,a,c)}constructor_1(n,i,s,a,c){const f=i==null||s==null,d=a==null||c==null;if(f&&d)throw new z;f?(i=new ce(0,a.getY()),s=new ce(0,c.getY())):d&&(a=new ce(n.getWidth()-1,i.getY()),c=new ce(n.getWidth()-1,s.getY())),this.image=n,this.topLeft=i,this.bottomLeft=s,this.topRight=a,this.bottomRight=c,this.minX=Math.trunc(Math.min(i.getX(),s.getX())),this.maxX=Math.trunc(Math.max(a.getX(),c.getX())),this.minY=Math.trunc(Math.min(i.getY(),a.getY())),this.maxY=Math.trunc(Math.max(s.getY(),c.getY()))}constructor_2(n){this.image=n.image,this.topLeft=n.getTopLeft(),this.bottomLeft=n.getBottomLeft(),this.topRight=n.getTopRight(),this.bottomRight=n.getBottomRight(),this.minX=n.getMinX(),this.maxX=n.getMaxX(),this.minY=n.getMinY(),this.maxY=n.getMaxY()}static merge(n,i){return n==null?i:i==null?n:new fi(n.image,n.topLeft,n.bottomLeft,i.topRight,i.bottomRight)}addMissingRows(n,i,s){let a=this.topLeft,c=this.bottomLeft,f=this.topRight,d=this.bottomRight;if(n>0){let g=s?this.topLeft:this.topRight,p=Math.trunc(g.getY()-n);p<0&&(p=0);let v=new ce(g.getX(),p);s?a=v:f=v}if(i>0){let g=s?this.bottomLeft:this.bottomRight,p=Math.trunc(g.getY()+i);p>=this.image.getHeight()&&(p=this.image.getHeight()-1);let v=new ce(g.getX(),p);s?c=v:d=v}return new fi(this.image,a,c,f,d)}getMinX(){return this.minX}getMaxX(){return this.maxX}getMinY(){return this.minY}getMaxY(){return this.maxY}getTopLeft(){return this.topLeft}getTopRight(){return this.topRight}getBottomLeft(){return this.bottomLeft}getBottomRight(){return this.bottomRight}}class Zy{constructor(n,i,s,a){this.columnCount=n,this.errorCorrectionLevel=a,this.rowCountUpperPart=i,this.rowCountLowerPart=s,this.rowCount=i+s}getColumnCount(){return this.columnCount}getErrorCorrectionLevel(){return this.errorCorrectionLevel}getRowCount(){return this.rowCount}getRowCountUpperPart(){return this.rowCountUpperPart}getRowCountLowerPart(){return this.rowCountLowerPart}}class Hs{constructor(){this.buffer=""}static form(n,i){let s=-1;function a(f,d,g,p,v,A){if(f==="%%")return"%";if(i[++s]===void 0)return;f=p?parseInt(p.substr(1)):void 0;let S=v?parseInt(v.substr(1)):void 0,N;switch(A){case"s":N=i[s];break;case"c":N=i[s][0];break;case"f":N=parseFloat(i[s]).toFixed(f);break;case"p":N=parseFloat(i[s]).toPrecision(f);break;case"e":N=parseFloat(i[s]).toExponential(f);break;case"x":N=parseInt(i[s]).toString(S||16);break;case"d":N=parseFloat(parseInt(i[s],S||10).toPrecision(f)).toFixed(0);break}N=typeof N=="object"?JSON.stringify(N):(+N).toString(S);let P=parseInt(g),B=g&&g[0]+""=="0"?"0":" ";for(;N.length<P;)N=d!==void 0?N+B:B+N;return N}let c=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return n.replace(c,a)}format(n,...i){this.buffer+=Hs.form(n,i)}toString(){return this.buffer}}class Gs{constructor(n){this.boundingBox=new fi(n),this.codewords=new Array(n.getMaxY()-n.getMinY()+1)}getCodewordNearby(n){let i=this.getCodeword(n);if(i!=null)return i;for(let s=1;s<Gs.MAX_NEARBY_DISTANCE;s++){let a=this.imageRowToCodewordIndex(n)-s;if(a>=0&&(i=this.codewords[a],i!=null)||(a=this.imageRowToCodewordIndex(n)+s,a<this.codewords.length&&(i=this.codewords[a],i!=null)))return i}return null}imageRowToCodewordIndex(n){return n-this.boundingBox.getMinY()}setCodeword(n,i){this.codewords[this.imageRowToCodewordIndex(n)]=i}getCodeword(n){return this.codewords[this.imageRowToCodewordIndex(n)]}getBoundingBox(){return this.boundingBox}getCodewords(){return this.codewords}toString(){const n=new Hs;let i=0;for(const s of this.codewords){if(s==null){n.format("%3d: | %n",i++);continue}n.format("%3d: %3d|%3d%n",i++,s.getRowNumber(),s.getValue())}return n.toString()}}Gs.MAX_NEARBY_DISTANCE=5;class Xs{constructor(){this.values=new Map}setValue(n){n=Math.trunc(n);let i=this.values.get(n);i==null&&(i=0),i++,this.values.set(n,i)}getValue(){let n=-1,i=new Array;for(const[s,a]of this.values.entries()){const c={getKey:()=>s,getValue:()=>a};c.getValue()>n?(n=c.getValue(),i=[],i.push(c.getKey())):c.getValue()===n&&i.push(c.getKey())}return we.toIntArray(i)}getConfidence(n){return this.values.get(n)}}class ch extends Gs{constructor(n,i){super(n),this._isLeft=i}setRowNumbers(){for(let n of this.getCodewords())n!=null&&n.setRowNumberAsRowIndicatorColumn()}adjustCompleteIndicatorColumnRowNumbers(n){let i=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(i,n);let s=this.getBoundingBox(),a=this._isLeft?s.getTopLeft():s.getTopRight(),c=this._isLeft?s.getBottomLeft():s.getBottomRight(),f=this.imageRowToCodewordIndex(Math.trunc(a.getY())),d=this.imageRowToCodewordIndex(Math.trunc(c.getY())),g=-1,p=1,v=0;for(let A=f;A<d;A++){if(i[A]==null)continue;let S=i[A],N=S.getRowNumber()-g;if(N===0)v++;else if(N===1)p=Math.max(p,v),v=1,g=S.getRowNumber();else if(N<0||S.getRowNumber()>=n.getRowCount()||N>A)i[A]=null;else{let P;p>2?P=(p-2)*N:P=N;let B=P>=A;for(let W=1;W<=P&&!B;W++)B=i[A-W]!=null;B?i[A]=null:(g=S.getRowNumber(),v=1)}}}getRowHeights(){let n=this.getBarcodeMetadata();if(n==null)return null;this.adjustIncompleteIndicatorColumnRowNumbers(n);let i=new Int32Array(n.getRowCount());for(let s of this.getCodewords())if(s!=null){let a=s.getRowNumber();if(a>=i.length)continue;i[a]++}return i}adjustIncompleteIndicatorColumnRowNumbers(n){let i=this.getBoundingBox(),s=this._isLeft?i.getTopLeft():i.getTopRight(),a=this._isLeft?i.getBottomLeft():i.getBottomRight(),c=this.imageRowToCodewordIndex(Math.trunc(s.getY())),f=this.imageRowToCodewordIndex(Math.trunc(a.getY())),d=this.getCodewords(),g=-1;for(let p=c;p<f;p++){if(d[p]==null)continue;let v=d[p];v.setRowNumberAsRowIndicatorColumn();let A=v.getRowNumber()-g;A===0||(A===1?g=v.getRowNumber():v.getRowNumber()>=n.getRowCount()?d[p]=null:g=v.getRowNumber())}}getBarcodeMetadata(){let n=this.getCodewords(),i=new Xs,s=new Xs,a=new Xs,c=new Xs;for(let d of n){if(d==null)continue;d.setRowNumberAsRowIndicatorColumn();let g=d.getValue()%30,p=d.getRowNumber();switch(this._isLeft||(p+=2),p%3){case 0:s.setValue(g*3+1);break;case 1:c.setValue(g/3),a.setValue(g%3);break;case 2:i.setValue(g+1);break}}if(i.getValue().length===0||s.getValue().length===0||a.getValue().length===0||c.getValue().length===0||i.getValue()[0]<1||s.getValue()[0]+a.getValue()[0]<we.MIN_ROWS_IN_BARCODE||s.getValue()[0]+a.getValue()[0]>we.MAX_ROWS_IN_BARCODE)return null;let f=new Zy(i.getValue()[0],s.getValue()[0],a.getValue()[0],c.getValue()[0]);return this.removeIncorrectCodewords(n,f),f}removeIncorrectCodewords(n,i){for(let s=0;s<n.length;s++){let a=n[s];if(n[s]==null)continue;let c=a.getValue()%30,f=a.getRowNumber();if(f>i.getRowCount()){n[s]=null;continue}switch(this._isLeft||(f+=2),f%3){case 0:c*3+1!==i.getRowCountUpperPart()&&(n[s]=null);break;case 1:(Math.trunc(c/3)!==i.getErrorCorrectionLevel()||c%3!==i.getRowCountLowerPart())&&(n[s]=null);break;case 2:c+1!==i.getColumnCount()&&(n[s]=null);break}}}isLeft(){return this._isLeft}toString(){return"IsLeft: "+this._isLeft+`
478
+ `+super.toString()}}class Ys{constructor(n,i){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=n,this.barcodeColumnCount=n.getColumnCount(),this.boundingBox=i,this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}getDetectionResultColumns(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);let n=we.MAX_CODEWORDS_IN_BARCODE,i;do i=n,n=this.adjustRowNumbersAndGetCount();while(n>0&&n<i);return this.detectionResultColumns}adjustIndicatorColumnRowNumbers(n){n!=null&&n.adjustCompleteIndicatorColumnRowNumbers(this.barcodeMetadata)}adjustRowNumbersAndGetCount(){let n=this.adjustRowNumbersByRow();if(n===0)return 0;for(let i=1;i<this.barcodeColumnCount+1;i++){let s=this.detectionResultColumns[i].getCodewords();for(let a=0;a<s.length;a++)s[a]!=null&&(s[a].hasValidRowNumber()||this.adjustRowNumbers(i,a,s))}return n}adjustRowNumbersByRow(){return this.adjustRowNumbersFromBothRI(),this.adjustRowNumbersFromLRI()+this.adjustRowNumbersFromRRI()}adjustRowNumbersFromBothRI(){if(this.detectionResultColumns[0]==null||this.detectionResultColumns[this.barcodeColumnCount+1]==null)return;let n=this.detectionResultColumns[0].getCodewords(),i=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords();for(let s=0;s<n.length;s++)if(n[s]!=null&&i[s]!=null&&n[s].getRowNumber()===i[s].getRowNumber())for(let a=1;a<=this.barcodeColumnCount;a++){let c=this.detectionResultColumns[a].getCodewords()[s];c!=null&&(c.setRowNumber(n[s].getRowNumber()),c.hasValidRowNumber()||(this.detectionResultColumns[a].getCodewords()[s]=null))}}adjustRowNumbersFromRRI(){if(this.detectionResultColumns[this.barcodeColumnCount+1]==null)return 0;let n=0,i=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords();for(let s=0;s<i.length;s++){if(i[s]==null)continue;let a=i[s].getRowNumber(),c=0;for(let f=this.barcodeColumnCount+1;f>0&&c<this.ADJUST_ROW_NUMBER_SKIP;f--){let d=this.detectionResultColumns[f].getCodewords()[s];d!=null&&(c=Ys.adjustRowNumberIfValid(a,c,d),d.hasValidRowNumber()||n++)}}return n}adjustRowNumbersFromLRI(){if(this.detectionResultColumns[0]==null)return 0;let n=0,i=this.detectionResultColumns[0].getCodewords();for(let s=0;s<i.length;s++){if(i[s]==null)continue;let a=i[s].getRowNumber(),c=0;for(let f=1;f<this.barcodeColumnCount+1&&c<this.ADJUST_ROW_NUMBER_SKIP;f++){let d=this.detectionResultColumns[f].getCodewords()[s];d!=null&&(c=Ys.adjustRowNumberIfValid(a,c,d),d.hasValidRowNumber()||n++)}}return n}static adjustRowNumberIfValid(n,i,s){return s==null||s.hasValidRowNumber()||(s.isValidRowNumber(n)?(s.setRowNumber(n),i=0):++i),i}adjustRowNumbers(n,i,s){if(!this.detectionResultColumns[n-1])return;let a=s[i],c=this.detectionResultColumns[n-1].getCodewords(),f=c;this.detectionResultColumns[n+1]!=null&&(f=this.detectionResultColumns[n+1].getCodewords());let d=new Array(14);d[2]=c[i],d[3]=f[i],i>0&&(d[0]=s[i-1],d[4]=c[i-1],d[5]=f[i-1]),i>1&&(d[8]=s[i-2],d[10]=c[i-2],d[11]=f[i-2]),i<s.length-1&&(d[1]=s[i+1],d[6]=c[i+1],d[7]=f[i+1]),i<s.length-2&&(d[9]=s[i+2],d[12]=c[i+2],d[13]=f[i+2]);for(let g of d)if(Ys.adjustRowNumber(a,g))return}static adjustRowNumber(n,i){return i==null?!1:i.hasValidRowNumber()&&i.getBucket()===n.getBucket()?(n.setRowNumber(i.getRowNumber()),!0):!1}getBarcodeColumnCount(){return this.barcodeColumnCount}getBarcodeRowCount(){return this.barcodeMetadata.getRowCount()}getBarcodeECLevel(){return this.barcodeMetadata.getErrorCorrectionLevel()}setBoundingBox(n){this.boundingBox=n}getBoundingBox(){return this.boundingBox}setDetectionResultColumn(n,i){this.detectionResultColumns[n]=i}getDetectionResultColumn(n){return this.detectionResultColumns[n]}toString(){let n=this.detectionResultColumns[0];n==null&&(n=this.detectionResultColumns[this.barcodeColumnCount+1]);let i=new Hs;for(let s=0;s<n.getCodewords().length;s++){i.format("CW %3d:",s);for(let a=0;a<this.barcodeColumnCount+2;a++){if(this.detectionResultColumns[a]==null){i.format(" | ");continue}let c=this.detectionResultColumns[a].getCodewords()[s];if(c==null){i.format(" | ");continue}i.format(" %3d|%3d",c.getRowNumber(),c.getValue())}i.format("%n")}return i.toString()}}class Ks{constructor(n,i,s,a){this.rowNumber=Ks.BARCODE_ROW_UNKNOWN,this.startX=Math.trunc(n),this.endX=Math.trunc(i),this.bucket=Math.trunc(s),this.value=Math.trunc(a)}hasValidRowNumber(){return this.isValidRowNumber(this.rowNumber)}isValidRowNumber(n){return n!==Ks.BARCODE_ROW_UNKNOWN&&this.bucket===n%3*3}setRowNumberAsRowIndicatorColumn(){this.rowNumber=Math.trunc(Math.trunc(this.value/30)*3+Math.trunc(this.bucket/3))}getWidth(){return this.endX-this.startX}getStartX(){return this.startX}getEndX(){return this.endX}getBucket(){return this.bucket}getValue(){return this.value}getRowNumber(){return this.rowNumber}setRowNumber(n){this.rowNumber=n}toString(){return this.rowNumber+"|"+this.value}}Ks.BARCODE_ROW_UNKNOWN=-1;class er{static initialize(){for(let n=0;n<we.SYMBOL_TABLE.length;n++){let i=we.SYMBOL_TABLE[n],s=i&1;for(let a=0;a<we.BARS_IN_MODULE;a++){let c=0;for(;(i&1)===s;)c+=1,i>>=1;s=i&1,er.RATIOS_TABLE[n]||(er.RATIOS_TABLE[n]=new Array(we.BARS_IN_MODULE)),er.RATIOS_TABLE[n][we.BARS_IN_MODULE-a-1]=Math.fround(c/we.MODULES_IN_CODEWORD)}}this.bSymbolTableReady=!0}static getDecodedValue(n){let i=er.getDecodedCodewordValue(er.sampleBitCounts(n));return i!==-1?i:er.getClosestDecodedValue(n)}static sampleBitCounts(n){let i=Re.sum(n),s=new Int32Array(we.BARS_IN_MODULE),a=0,c=0;for(let f=0;f<we.MODULES_IN_CODEWORD;f++){let d=i/(2*we.MODULES_IN_CODEWORD)+f*i/we.MODULES_IN_CODEWORD;c+n[a]<=d&&(c+=n[a],a++),s[a]++}return s}static getDecodedCodewordValue(n){let i=er.getBitValue(n);return we.getCodeword(i)===-1?-1:i}static getBitValue(n){let i=0;for(let s=0;s<n.length;s++)for(let a=0;a<n[s];a++)i=i<<1|(s%2===0?1:0);return Math.trunc(i)}static getClosestDecodedValue(n){let i=Re.sum(n),s=new Array(we.BARS_IN_MODULE);if(i>1)for(let f=0;f<s.length;f++)s[f]=Math.fround(n[f]/i);let a=ya.MAX_VALUE,c=-1;this.bSymbolTableReady||er.initialize();for(let f=0;f<er.RATIOS_TABLE.length;f++){let d=0,g=er.RATIOS_TABLE[f];for(let p=0;p<we.BARS_IN_MODULE;p++){let v=Math.fround(g[p]-s[p]);if(d+=Math.fround(v*v),d>=a)break}d<a&&(a=d,c=we.SYMBOL_TABLE[f])}return c}}er.bSymbolTableReady=!1,er.RATIOS_TABLE=new Array(we.SYMBOL_TABLE.length).map(E=>new Array(we.BARS_IN_MODULE));class uh{constructor(){this.segmentCount=-1,this.fileSize=-1,this.timestamp=-1,this.checksum=-1}getSegmentIndex(){return this.segmentIndex}setSegmentIndex(n){this.segmentIndex=n}getFileId(){return this.fileId}setFileId(n){this.fileId=n}getOptionalData(){return this.optionalData}setOptionalData(n){this.optionalData=n}isLastSegment(){return this.lastSegment}setLastSegment(n){this.lastSegment=n}getSegmentCount(){return this.segmentCount}setSegmentCount(n){this.segmentCount=n}getSender(){return this.sender||null}setSender(n){this.sender=n}getAddressee(){return this.addressee||null}setAddressee(n){this.addressee=n}getFileName(){return this.fileName}setFileName(n){this.fileName=n}getFileSize(){return this.fileSize}setFileSize(n){this.fileSize=n}getChecksum(){return this.checksum}setChecksum(n){this.checksum=n}getTimestamp(){return this.timestamp}setTimestamp(n){this.timestamp=n}}class fh{static parseLong(n,i=void 0){return parseInt(n,i)}}class dh extends m{}dh.kind="NullPointerException";class Qy{writeBytes(n){this.writeBytesOffset(n,0,n.length)}writeBytesOffset(n,i,s){if(n==null)throw new dh;if(i<0||i>n.length||s<0||i+s>n.length||i+s<0)throw new X;if(s===0)return;for(let a=0;a<s;a++)this.write(n[i+a])}flush(){}close(){}}class qy extends m{}class Jy extends Qy{constructor(n=32){if(super(),this.count=0,n<0)throw new b("Negative initial size: "+n);this.buf=new Uint8Array(n)}ensureCapacity(n){n-this.buf.length>0&&this.grow(n)}grow(n){let s=this.buf.length<<1;if(s-n<0&&(s=n),s<0){if(n<0)throw new qy;s=_.MAX_VALUE}this.buf=I.copyOfUint8Array(this.buf,s)}write(n){this.ensureCapacity(this.count+1),this.buf[this.count]=n,this.count+=1}writeBytesOffset(n,i,s){if(i<0||i>n.length||s<0||i+s-n.length>0)throw new X;this.ensureCapacity(this.count+s),D.arraycopy(n,i,this.buf,this.count,s),this.count+=s}writeTo(n){n.writeBytesOffset(this.buf,0,this.count)}reset(){this.count=0}toByteArray(){return I.copyOfUint8Array(this.buf,this.count)}size(){return this.count}toString(n){return n?typeof n=="string"?this.toString_string(n):this.toString_number(n):this.toString_void()}toString_void(){return new String(this.buf).toString()}toString_string(n){return new String(this.buf).toString()}toString_number(n){return new String(this.buf).toString()}close(){}}var Fe;(function(E){E[E.ALPHA=0]="ALPHA",E[E.LOWER=1]="LOWER",E[E.MIXED=2]="MIXED",E[E.PUNCT=3]="PUNCT",E[E.ALPHA_SHIFT=4]="ALPHA_SHIFT",E[E.PUNCT_SHIFT=5]="PUNCT_SHIFT"})(Fe||(Fe={}));function hh(){if(typeof window<"u")return window.BigInt||null;if(typeof mn<"u")return mn.BigInt||null;if(typeof self<"u")return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}let Ta;function Pn(E){if(typeof Ta>"u"&&(Ta=hh()),Ta===null)throw new Error("BigInt is not supported!");return Ta(E)}function e3(){let E=[];E[0]=Pn(1);let n=Pn(900);E[1]=n;for(let i=2;i<16;i++)E[i]=E[i-1]*n;return E}class H{static decode(n,i){let s=new xe(""),a=$.ISO8859_1;s.enableDecoding(a);let c=1,f=n[c++],d=new uh;for(;c<n[0];){switch(f){case H.TEXT_COMPACTION_MODE_LATCH:c=H.textCompaction(n,c,s);break;case H.BYTE_COMPACTION_MODE_LATCH:case H.BYTE_COMPACTION_MODE_LATCH_6:c=H.byteCompaction(f,n,a,c,s);break;case H.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:s.append(n[c++]);break;case H.NUMERIC_COMPACTION_MODE_LATCH:c=H.numericCompaction(n,c,s);break;case H.ECI_CHARSET:$.getCharacterSetECIByValue(n[c++]);break;case H.ECI_GENERAL_PURPOSE:c+=2;break;case H.ECI_USER_DEFINED:c++;break;case H.BEGIN_MACRO_PDF417_CONTROL_BLOCK:c=H.decodeMacroBlock(n,c,d);break;case H.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case H.MACRO_PDF417_TERMINATOR:throw new F;default:c--,c=H.textCompaction(n,c,s);break}if(c<n.length)f=n[c++];else throw F.getFormatInstance()}if(s.length()===0)throw F.getFormatInstance();let g=new js(null,s.toString(),null,i);return g.setOther(d),g}static decodeMacroBlock(n,i,s){if(i+H.NUMBER_OF_SEQUENCE_CODEWORDS>n[0])throw F.getFormatInstance();let a=new Int32Array(H.NUMBER_OF_SEQUENCE_CODEWORDS);for(let d=0;d<H.NUMBER_OF_SEQUENCE_CODEWORDS;d++,i++)a[d]=n[i];s.setSegmentIndex(_.parseInt(H.decodeBase900toBase10(a,H.NUMBER_OF_SEQUENCE_CODEWORDS)));let c=new xe;i=H.textCompaction(n,i,c),s.setFileId(c.toString());let f=-1;for(n[i]===H.BEGIN_MACRO_PDF417_OPTIONAL_FIELD&&(f=i+1);i<n[0];)switch(n[i]){case H.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:switch(i++,n[i]){case H.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME:let d=new xe;i=H.textCompaction(n,i+1,d),s.setFileName(d.toString());break;case H.MACRO_PDF417_OPTIONAL_FIELD_SENDER:let g=new xe;i=H.textCompaction(n,i+1,g),s.setSender(g.toString());break;case H.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE:let p=new xe;i=H.textCompaction(n,i+1,p),s.setAddressee(p.toString());break;case H.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT:let v=new xe;i=H.numericCompaction(n,i+1,v),s.setSegmentCount(_.parseInt(v.toString()));break;case H.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP:let A=new xe;i=H.numericCompaction(n,i+1,A),s.setTimestamp(fh.parseLong(A.toString()));break;case H.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM:let S=new xe;i=H.numericCompaction(n,i+1,S),s.setChecksum(_.parseInt(S.toString()));break;case H.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE:let N=new xe;i=H.numericCompaction(n,i+1,N),s.setFileSize(fh.parseLong(N.toString()));break;default:throw F.getFormatInstance()}break;case H.MACRO_PDF417_TERMINATOR:i++,s.setLastSegment(!0);break;default:throw F.getFormatInstance()}if(f!==-1){let d=i-f;s.isLastSegment()&&d--,s.setOptionalData(I.copyOfRange(n,f,f+d))}return i}static textCompaction(n,i,s){let a=new Int32Array((n[0]-i)*2),c=new Int32Array((n[0]-i)*2),f=0,d=!1;for(;i<n[0]&&!d;){let g=n[i++];if(g<H.TEXT_COMPACTION_MODE_LATCH)a[f]=g/30,a[f+1]=g%30,f+=2;else switch(g){case H.TEXT_COMPACTION_MODE_LATCH:a[f++]=H.TEXT_COMPACTION_MODE_LATCH;break;case H.BYTE_COMPACTION_MODE_LATCH:case H.BYTE_COMPACTION_MODE_LATCH_6:case H.NUMERIC_COMPACTION_MODE_LATCH:case H.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case H.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case H.MACRO_PDF417_TERMINATOR:i--,d=!0;break;case H.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:a[f]=H.MODE_SHIFT_TO_BYTE_COMPACTION_MODE,g=n[i++],c[f]=g,f++;break}}return H.decodeTextCompaction(a,c,f,s),i}static decodeTextCompaction(n,i,s,a){let c=Fe.ALPHA,f=Fe.ALPHA,d=0;for(;d<s;){let g=n[d],p="";switch(c){case Fe.ALPHA:if(g<26)p=String.fromCharCode(65+g);else switch(g){case 26:p=" ";break;case H.LL:c=Fe.LOWER;break;case H.ML:c=Fe.MIXED;break;case H.PS:f=c,c=Fe.PUNCT_SHIFT;break;case H.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:a.append(i[d]);break;case H.TEXT_COMPACTION_MODE_LATCH:c=Fe.ALPHA;break}break;case Fe.LOWER:if(g<26)p=String.fromCharCode(97+g);else switch(g){case 26:p=" ";break;case H.AS:f=c,c=Fe.ALPHA_SHIFT;break;case H.ML:c=Fe.MIXED;break;case H.PS:f=c,c=Fe.PUNCT_SHIFT;break;case H.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:a.append(i[d]);break;case H.TEXT_COMPACTION_MODE_LATCH:c=Fe.ALPHA;break}break;case Fe.MIXED:if(g<H.PL)p=H.MIXED_CHARS[g];else switch(g){case H.PL:c=Fe.PUNCT;break;case 26:p=" ";break;case H.LL:c=Fe.LOWER;break;case H.AL:c=Fe.ALPHA;break;case H.PS:f=c,c=Fe.PUNCT_SHIFT;break;case H.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:a.append(i[d]);break;case H.TEXT_COMPACTION_MODE_LATCH:c=Fe.ALPHA;break}break;case Fe.PUNCT:if(g<H.PAL)p=H.PUNCT_CHARS[g];else switch(g){case H.PAL:c=Fe.ALPHA;break;case H.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:a.append(i[d]);break;case H.TEXT_COMPACTION_MODE_LATCH:c=Fe.ALPHA;break}break;case Fe.ALPHA_SHIFT:if(c=f,g<26)p=String.fromCharCode(65+g);else switch(g){case 26:p=" ";break;case H.TEXT_COMPACTION_MODE_LATCH:c=Fe.ALPHA;break}break;case Fe.PUNCT_SHIFT:if(c=f,g<H.PAL)p=H.PUNCT_CHARS[g];else switch(g){case H.PAL:c=Fe.ALPHA;break;case H.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:a.append(i[d]);break;case H.TEXT_COMPACTION_MODE_LATCH:c=Fe.ALPHA;break}break}p!==""&&a.append(p),d++}}static byteCompaction(n,i,s,a,c){let f=new Jy,d=0,g=0,p=!1;switch(n){case H.BYTE_COMPACTION_MODE_LATCH:let v=new Int32Array(6),A=i[a++];for(;a<i[0]&&!p;)switch(v[d++]=A,g=900*g+A,A=i[a++],A){case H.TEXT_COMPACTION_MODE_LATCH:case H.BYTE_COMPACTION_MODE_LATCH:case H.NUMERIC_COMPACTION_MODE_LATCH:case H.BYTE_COMPACTION_MODE_LATCH_6:case H.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case H.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case H.MACRO_PDF417_TERMINATOR:a--,p=!0;break;default:if(d%5===0&&d>0){for(let S=0;S<6;++S)f.write(Number(Pn(g)>>Pn(8*(5-S))));g=0,d=0}break}a===i[0]&&A<H.TEXT_COMPACTION_MODE_LATCH&&(v[d++]=A);for(let S=0;S<d;S++)f.write(v[S]);break;case H.BYTE_COMPACTION_MODE_LATCH_6:for(;a<i[0]&&!p;){let S=i[a++];if(S<H.TEXT_COMPACTION_MODE_LATCH)d++,g=900*g+S;else switch(S){case H.TEXT_COMPACTION_MODE_LATCH:case H.BYTE_COMPACTION_MODE_LATCH:case H.NUMERIC_COMPACTION_MODE_LATCH:case H.BYTE_COMPACTION_MODE_LATCH_6:case H.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case H.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case H.MACRO_PDF417_TERMINATOR:a--,p=!0;break}if(d%5===0&&d>0){for(let N=0;N<6;++N)f.write(Number(Pn(g)>>Pn(8*(5-N))));g=0,d=0}}break}return c.append(ve.decode(f.toByteArray(),s)),a}static numericCompaction(n,i,s){let a=0,c=!1,f=new Int32Array(H.MAX_NUMERIC_CODEWORDS);for(;i<n[0]&&!c;){let d=n[i++];if(i===n[0]&&(c=!0),d<H.TEXT_COMPACTION_MODE_LATCH)f[a]=d,a++;else switch(d){case H.TEXT_COMPACTION_MODE_LATCH:case H.BYTE_COMPACTION_MODE_LATCH:case H.BYTE_COMPACTION_MODE_LATCH_6:case H.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case H.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case H.MACRO_PDF417_TERMINATOR:i--,c=!0;break}(a%H.MAX_NUMERIC_CODEWORDS===0||d===H.NUMERIC_COMPACTION_MODE_LATCH||c)&&a>0&&(s.append(H.decodeBase900toBase10(f,a)),a=0)}return i}static decodeBase900toBase10(n,i){let s=Pn(0);for(let c=0;c<i;c++)s+=H.EXP900[i-c-1]*Pn(n[c]);let a=s.toString();if(a.charAt(0)!=="1")throw new F;return a.substring(1)}}H.TEXT_COMPACTION_MODE_LATCH=900,H.BYTE_COMPACTION_MODE_LATCH=901,H.NUMERIC_COMPACTION_MODE_LATCH=902,H.BYTE_COMPACTION_MODE_LATCH_6=924,H.ECI_USER_DEFINED=925,H.ECI_GENERAL_PURPOSE=926,H.ECI_CHARSET=927,H.BEGIN_MACRO_PDF417_CONTROL_BLOCK=928,H.BEGIN_MACRO_PDF417_OPTIONAL_FIELD=923,H.MACRO_PDF417_TERMINATOR=922,H.MODE_SHIFT_TO_BYTE_COMPACTION_MODE=913,H.MAX_NUMERIC_CODEWORDS=15,H.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME=0,H.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT=1,H.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP=2,H.MACRO_PDF417_OPTIONAL_FIELD_SENDER=3,H.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE=4,H.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE=5,H.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM=6,H.PL=25,H.LL=27,H.AS=27,H.ML=28,H.AL=28,H.PS=29,H.PAL=29,H.PUNCT_CHARS=`;<>@[\\]_\`~!\r ,:
479
+ -.$/"|*()?{}'`,H.MIXED_CHARS="0123456789&\r ,:#-.$/+%*=^",H.EXP900=hh()?e3():[],H.NUMBER_OF_SEQUENCE_CODEWORDS=2;class Ae{constructor(){}static decode(n,i,s,a,c,f,d){let g=new fi(n,i,s,a,c),p=null,v=null,A;for(let P=!0;;P=!1){if(i!=null&&(p=Ae.getRowIndicatorColumn(n,g,i,!0,f,d)),a!=null&&(v=Ae.getRowIndicatorColumn(n,g,a,!1,f,d)),A=Ae.merge(p,v),A==null)throw z.getNotFoundInstance();let B=A.getBoundingBox();if(P&&B!=null&&(B.getMinY()<g.getMinY()||B.getMaxY()>g.getMaxY()))g=B;else break}A.setBoundingBox(g);let S=A.getBarcodeColumnCount()+1;A.setDetectionResultColumn(0,p),A.setDetectionResultColumn(S,v);let N=p!=null;for(let P=1;P<=S;P++){let B=N?P:S-P;if(A.getDetectionResultColumn(B)!==void 0)continue;let W;B===0||B===S?W=new ch(g,B===0):W=new Gs(g),A.setDetectionResultColumn(B,W);let G=-1,J=G;for(let ee=g.getMinY();ee<=g.getMaxY();ee++){if(G=Ae.getStartColumn(A,B,ee,N),G<0||G>g.getMaxX()){if(J===-1)continue;G=J}let Z=Ae.detectCodeword(n,g.getMinX(),g.getMaxX(),N,G,ee,f,d);Z!=null&&(W.setCodeword(ee,Z),J=G,f=Math.min(f,Z.getWidth()),d=Math.max(d,Z.getWidth()))}}return Ae.createDecoderResult(A)}static merge(n,i){if(n==null&&i==null)return null;let s=Ae.getBarcodeMetadata(n,i);if(s==null)return null;let a=fi.merge(Ae.adjustBoundingBox(n),Ae.adjustBoundingBox(i));return new Ys(s,a)}static adjustBoundingBox(n){if(n==null)return null;let i=n.getRowHeights();if(i==null)return null;let s=Ae.getMax(i),a=0;for(let d of i)if(a+=s-d,d>0)break;let c=n.getCodewords();for(let d=0;a>0&&c[d]==null;d++)a--;let f=0;for(let d=i.length-1;d>=0&&(f+=s-i[d],!(i[d]>0));d--);for(let d=c.length-1;f>0&&c[d]==null;d--)f--;return n.getBoundingBox().addMissingRows(a,f,n.isLeft())}static getMax(n){let i=-1;for(let s of n)i=Math.max(i,s);return i}static getBarcodeMetadata(n,i){let s;if(n==null||(s=n.getBarcodeMetadata())==null)return i==null?null:i.getBarcodeMetadata();let a;return i==null||(a=i.getBarcodeMetadata())==null?s:s.getColumnCount()!==a.getColumnCount()&&s.getErrorCorrectionLevel()!==a.getErrorCorrectionLevel()&&s.getRowCount()!==a.getRowCount()?null:s}static getRowIndicatorColumn(n,i,s,a,c,f){let d=new ch(i,a);for(let g=0;g<2;g++){let p=g===0?1:-1,v=Math.trunc(Math.trunc(s.getX()));for(let A=Math.trunc(Math.trunc(s.getY()));A<=i.getMaxY()&&A>=i.getMinY();A+=p){let S=Ae.detectCodeword(n,0,n.getWidth(),a,v,A,c,f);S!=null&&(d.setCodeword(A,S),a?v=S.getStartX():v=S.getEndX())}}return d}static adjustCodewordCount(n,i){let s=i[0][1],a=s.getValue(),c=n.getBarcodeColumnCount()*n.getBarcodeRowCount()-Ae.getNumberOfECCodeWords(n.getBarcodeECLevel());if(a.length===0){if(c<1||c>we.MAX_CODEWORDS_IN_BARCODE)throw z.getNotFoundInstance();s.setValue(c)}else a[0]!==c&&s.setValue(c)}static createDecoderResult(n){let i=Ae.createBarcodeMatrix(n);Ae.adjustCodewordCount(n,i);let s=new Array,a=new Int32Array(n.getBarcodeRowCount()*n.getBarcodeColumnCount()),c=[],f=new Array;for(let g=0;g<n.getBarcodeRowCount();g++)for(let p=0;p<n.getBarcodeColumnCount();p++){let v=i[g][p+1].getValue(),A=g*n.getBarcodeColumnCount()+p;v.length===0?s.push(A):v.length===1?a[A]=v[0]:(f.push(A),c.push(v))}let d=new Array(c.length);for(let g=0;g<d.length;g++)d[g]=c[g];return Ae.createDecoderResultFromAmbiguousValues(n.getBarcodeECLevel(),a,we.toIntArray(s),we.toIntArray(f),d)}static createDecoderResultFromAmbiguousValues(n,i,s,a,c){let f=new Int32Array(a.length),d=100;for(;d-- >0;){for(let g=0;g<f.length;g++)i[a[g]]=c[g][f[g]];try{return Ae.decodeCodewords(i,n,s)}catch(g){if(!(g instanceof T))throw g}if(f.length===0)throw T.getChecksumInstance();for(let g=0;g<f.length;g++)if(f[g]<c[g].length-1){f[g]++;break}else if(f[g]=0,g===f.length-1)throw T.getChecksumInstance()}throw T.getChecksumInstance()}static createBarcodeMatrix(n){let i=Array.from({length:n.getBarcodeRowCount()},()=>new Array(n.getBarcodeColumnCount()+2));for(let a=0;a<i.length;a++)for(let c=0;c<i[a].length;c++)i[a][c]=new Xs;let s=0;for(let a of n.getDetectionResultColumns()){if(a!=null){for(let c of a.getCodewords())if(c!=null){let f=c.getRowNumber();if(f>=0){if(f>=i.length)continue;i[f][s].setValue(c.getValue())}}}s++}return i}static isValidBarcodeColumn(n,i){return i>=0&&i<=n.getBarcodeColumnCount()+1}static getStartColumn(n,i,s,a){let c=a?1:-1,f=null;if(Ae.isValidBarcodeColumn(n,i-c)&&(f=n.getDetectionResultColumn(i-c).getCodeword(s)),f!=null)return a?f.getEndX():f.getStartX();if(f=n.getDetectionResultColumn(i).getCodewordNearby(s),f!=null)return a?f.getStartX():f.getEndX();if(Ae.isValidBarcodeColumn(n,i-c)&&(f=n.getDetectionResultColumn(i-c).getCodewordNearby(s)),f!=null)return a?f.getEndX():f.getStartX();let d=0;for(;Ae.isValidBarcodeColumn(n,i-c);){i-=c;for(let g of n.getDetectionResultColumn(i).getCodewords())if(g!=null)return(a?g.getEndX():g.getStartX())+c*d*(g.getEndX()-g.getStartX());d++}return a?n.getBoundingBox().getMinX():n.getBoundingBox().getMaxX()}static detectCodeword(n,i,s,a,c,f,d,g){c=Ae.adjustCodewordStartColumn(n,i,s,a,c,f);let p=Ae.getModuleBitCount(n,i,s,a,c,f);if(p==null)return null;let v,A=Re.sum(p);if(a)v=c+A;else{for(let P=0;P<p.length/2;P++){let B=p[P];p[P]=p[p.length-1-P],p[p.length-1-P]=B}v=c,c=v-A}if(!Ae.checkCodewordSkew(A,d,g))return null;let S=er.getDecodedValue(p),N=we.getCodeword(S);return N===-1?null:new Ks(c,v,Ae.getCodewordBucketNumber(S),N)}static getModuleBitCount(n,i,s,a,c,f){let d=c,g=new Int32Array(8),p=0,v=a?1:-1,A=a;for(;(a?d<s:d>=i)&&p<g.length;)n.get(d,f)===A?(g[p]++,d+=v):(p++,A=!A);return p===g.length||d===(a?s:i)&&p===g.length-1?g:null}static getNumberOfECCodeWords(n){return 2<<n}static adjustCodewordStartColumn(n,i,s,a,c,f){let d=c,g=a?-1:1;for(let p=0;p<2;p++){for(;(a?d>=i:d<s)&&a===n.get(d,f);){if(Math.abs(c-d)>Ae.CODEWORD_SKEW_SIZE)return c;d+=g}g=-g,a=!a}return d}static checkCodewordSkew(n,i,s){return i-Ae.CODEWORD_SKEW_SIZE<=n&&n<=s+Ae.CODEWORD_SKEW_SIZE}static decodeCodewords(n,i,s){if(n.length===0)throw F.getFormatInstance();let a=1<<i+1,c=Ae.correctErrors(n,s,a);Ae.verifyCodewordCount(n,a);let f=H.decode(n,""+i);return f.setErrorsCorrected(c),f.setErasures(s.length),f}static correctErrors(n,i,s){if(i!=null&&i.length>s/2+Ae.MAX_ERRORS||s<0||s>Ae.MAX_EC_CODEWORDS)throw T.getChecksumInstance();return Ae.errorCorrection.decode(n,s,i)}static verifyCodewordCount(n,i){if(n.length<4)throw F.getFormatInstance();let s=n[0];if(s>n.length)throw F.getFormatInstance();if(s===0)if(i<n.length)n[0]=n.length-i;else throw F.getFormatInstance()}static getBitCountForCodeword(n){let i=new Int32Array(8),s=0,a=i.length-1;for(;!((n&1)!==s&&(s=n&1,a--,a<0));)i[a]++,n>>=1;return i}static getCodewordBucketNumber(n){return n instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(n):this.getCodewordBucketNumber_number(n)}static getCodewordBucketNumber_number(n){return Ae.getCodewordBucketNumber(Ae.getBitCountForCodeword(n))}static getCodewordBucketNumber_Int32Array(n){return(n[0]-n[2]+n[4]-n[6]+9)%9}static toString(n){let i=new Hs;for(let s=0;s<n.length;s++){i.format("Row %2d: ",s);for(let a=0;a<n[s].length;a++){let c=n[s][a];c.getValue().length===0?i.format(" ",null):i.format("%4d(%2d)",c.getValue()[0],c.getConfidence(c.getValue()[0]))}i.format("%n")}return i.toString()}}Ae.CODEWORD_SKEW_SIZE=2,Ae.MAX_ERRORS=3,Ae.MAX_EC_CODEWORDS=512,Ae.errorCorrection=new lh;class Ot{decode(n,i=null){let s=Ot.decode(n,i,!1);if(s==null||s.length===0||s[0]==null)throw z.getNotFoundInstance();return s[0]}decodeMultiple(n,i=null){try{return Ot.decode(n,i,!0)}catch(s){throw s instanceof F||s instanceof T?z.getNotFoundInstance():s}}static decode(n,i,s){const a=new Array,c=Ee.detectMultiple(n,i,s);for(const f of c.getPoints()){const d=Ae.decode(c.getBits(),f[4],f[5],f[6],f[7],Ot.getMinCodewordWidth(f),Ot.getMaxCodewordWidth(f)),g=new Qe(d.getText(),d.getRawBytes(),void 0,f,ue.PDF_417);g.putMetadata(Ct.ERROR_CORRECTION_LEVEL,d.getECLevel());const p=d.getOther();p!=null&&g.putMetadata(Ct.PDF417_EXTRA_METADATA,p),a.push(g)}return a.map(f=>f)}static getMaxWidth(n,i){return n==null||i==null?0:Math.trunc(Math.abs(n.getX()-i.getX()))}static getMinWidth(n,i){return n==null||i==null?_.MAX_VALUE:Math.trunc(Math.abs(n.getX()-i.getX()))}static getMaxCodewordWidth(n){return Math.floor(Math.max(Math.max(Ot.getMaxWidth(n[0],n[4]),Ot.getMaxWidth(n[6],n[2])*we.MODULES_IN_CODEWORD/we.MODULES_IN_STOP_PATTERN),Math.max(Ot.getMaxWidth(n[1],n[5]),Ot.getMaxWidth(n[7],n[3])*we.MODULES_IN_CODEWORD/we.MODULES_IN_STOP_PATTERN)))}static getMinCodewordWidth(n){return Math.floor(Math.min(Math.min(Ot.getMinWidth(n[0],n[4]),Ot.getMinWidth(n[6],n[2])*we.MODULES_IN_CODEWORD/we.MODULES_IN_STOP_PATTERN),Math.min(Ot.getMinWidth(n[1],n[5]),Ot.getMinWidth(n[7],n[3])*we.MODULES_IN_CODEWORD/we.MODULES_IN_STOP_PATTERN)))}reset(){}}class Ra extends m{}Ra.kind="ReaderException";class gh{constructor(n,i){this.verbose=n===!0,i&&this.setHints(i)}decode(n,i){return i&&this.setHints(i),this.decodeInternal(n)}decodeWithState(n){return(this.readers===null||this.readers===void 0)&&this.setHints(null),this.decodeInternal(n)}setHints(n){this.hints=n;const i=!o(n)&&n.get(U.TRY_HARDER)===!0,s=o(n)?null:n.get(U.POSSIBLE_FORMATS),a=new Array;if(!o(s)){const c=s.some(f=>f===ue.UPC_A||f===ue.UPC_E||f===ue.EAN_13||f===ue.EAN_8||f===ue.CODABAR||f===ue.CODE_39||f===ue.CODE_93||f===ue.CODE_128||f===ue.ITF||f===ue.RSS_14||f===ue.RSS_EXPANDED);c&&!i&&a.push(new $i(n,this.verbose)),s.includes(ue.QR_CODE)&&a.push(new Dn),s.includes(ue.DATA_MATRIX)&&a.push(new Mn),s.includes(ue.AZTEC)&&a.push(new Aa),s.includes(ue.PDF_417)&&a.push(new Ot),c&&i&&a.push(new $i(n,this.verbose))}a.length===0&&(i||a.push(new $i(n,this.verbose)),a.push(new Dn),a.push(new Mn),a.push(new Aa),a.push(new Ot),i&&a.push(new $i(n,this.verbose))),this.readers=a}reset(){if(this.readers!==null)for(const n of this.readers)n.reset()}decodeInternal(n){if(this.readers===null)throw new Ra("No readers where selected, nothing can be read.");for(const i of this.readers)try{return i.decode(n,this.hints)}catch(s){if(s instanceof Ra)continue}throw new z("No MultiFormat Readers were able to detect the code.")}}class t3 extends Er{constructor(n=null,i=500){const s=new gh;s.setHints(n),super(s,i)}decodeBitmap(n){return this.reader.decodeWithState(n)}}class r3 extends Er{constructor(n=500){super(new Ot,n)}}class n3 extends Er{constructor(n=500){super(new Dn,n)}}var pu;(function(E){E[E.ERROR_CORRECTION=0]="ERROR_CORRECTION",E[E.CHARACTER_SET=1]="CHARACTER_SET",E[E.DATA_MATRIX_SHAPE=2]="DATA_MATRIX_SHAPE",E[E.MIN_SIZE=3]="MIN_SIZE",E[E.MAX_SIZE=4]="MAX_SIZE",E[E.MARGIN=5]="MARGIN",E[E.PDF417_COMPACT=6]="PDF417_COMPACT",E[E.PDF417_COMPACTION=7]="PDF417_COMPACTION",E[E.PDF417_DIMENSIONS=8]="PDF417_DIMENSIONS",E[E.AZTEC_LAYERS=9]="AZTEC_LAYERS",E[E.QR_VERSION=10]="QR_VERSION"})(pu||(pu={}));var vt=pu;class mu{constructor(n){this.field=n,this.cachedGenerators=[],this.cachedGenerators.push(new Qt(n,Int32Array.from([1])))}buildGenerator(n){const i=this.cachedGenerators;if(n>=i.length){let s=i[i.length-1];const a=this.field;for(let c=i.length;c<=n;c++){const f=s.multiply(new Qt(a,Int32Array.from([1,a.exp(c-1+a.getGeneratorBase())])));i.push(f),s=f}}return i[n]}encode(n,i){if(i===0)throw new b("No error correction bytes");const s=n.length-i;if(s<=0)throw new b("No data bytes provided");const a=this.buildGenerator(i),c=new Int32Array(s);D.arraycopy(n,0,c,0,s);let f=new Qt(this.field,c);f=f.multiplyByMonomial(i,1);const g=f.divide(a)[1].getCoefficients(),p=i-g.length;for(let v=0;v<p;v++)n[s+v]=0;D.arraycopy(g,0,n,s+p,g.length)}}class st{constructor(){}static applyMaskPenaltyRule1(n){return st.applyMaskPenaltyRule1Internal(n,!0)+st.applyMaskPenaltyRule1Internal(n,!1)}static applyMaskPenaltyRule2(n){let i=0;const s=n.getArray(),a=n.getWidth(),c=n.getHeight();for(let f=0;f<c-1;f++){const d=s[f];for(let g=0;g<a-1;g++){const p=d[g];p===d[g+1]&&p===s[f+1][g]&&p===s[f+1][g+1]&&i++}}return st.N2*i}static applyMaskPenaltyRule3(n){let i=0;const s=n.getArray(),a=n.getWidth(),c=n.getHeight();for(let f=0;f<c;f++)for(let d=0;d<a;d++){const g=s[f];d+6<a&&g[d]===1&&g[d+1]===0&&g[d+2]===1&&g[d+3]===1&&g[d+4]===1&&g[d+5]===0&&g[d+6]===1&&(st.isWhiteHorizontal(g,d-4,d)||st.isWhiteHorizontal(g,d+7,d+11))&&i++,f+6<c&&s[f][d]===1&&s[f+1][d]===0&&s[f+2][d]===1&&s[f+3][d]===1&&s[f+4][d]===1&&s[f+5][d]===0&&s[f+6][d]===1&&(st.isWhiteVertical(s,d,f-4,f)||st.isWhiteVertical(s,d,f+7,f+11))&&i++}return i*st.N3}static isWhiteHorizontal(n,i,s){i=Math.max(i,0),s=Math.min(s,n.length);for(let a=i;a<s;a++)if(n[a]===1)return!1;return!0}static isWhiteVertical(n,i,s,a){s=Math.max(s,0),a=Math.min(a,n.length);for(let c=s;c<a;c++)if(n[c][i]===1)return!1;return!0}static applyMaskPenaltyRule4(n){let i=0;const s=n.getArray(),a=n.getWidth(),c=n.getHeight();for(let g=0;g<c;g++){const p=s[g];for(let v=0;v<a;v++)p[v]===1&&i++}const f=n.getHeight()*n.getWidth();return Math.floor(Math.abs(i*2-f)*10/f)*st.N4}static getDataMaskBit(n,i,s){let a,c;switch(n){case 0:a=s+i&1;break;case 1:a=s&1;break;case 2:a=i%3;break;case 3:a=(s+i)%3;break;case 4:a=Math.floor(s/2)+Math.floor(i/3)&1;break;case 5:c=s*i,a=(c&1)+c%3;break;case 6:c=s*i,a=(c&1)+c%3&1;break;case 7:c=s*i,a=c%3+(s+i&1)&1;break;default:throw new b("Invalid mask pattern: "+n)}return a===0}static applyMaskPenaltyRule1Internal(n,i){let s=0;const a=i?n.getHeight():n.getWidth(),c=i?n.getWidth():n.getHeight(),f=n.getArray();for(let d=0;d<a;d++){let g=0,p=-1;for(let v=0;v<c;v++){const A=i?f[d][v]:f[v][d];A===p?g++:(g>=5&&(s+=st.N1+(g-5)),g=1,p=A)}g>=5&&(s+=st.N1+(g-5))}return s}}st.N1=3,st.N2=3,st.N3=40,st.N4=10;class _a{constructor(n,i){this.width=n,this.height=i;const s=new Array(i);for(let a=0;a!==i;a++)s[a]=new Uint8Array(n);this.bytes=s}getHeight(){return this.height}getWidth(){return this.width}get(n,i){return this.bytes[i][n]}getArray(){return this.bytes}setNumber(n,i,s){this.bytes[i][n]=s}setBoolean(n,i,s){this.bytes[i][n]=s?1:0}clear(n){for(const i of this.bytes)I.fill(i,n)}equals(n){if(!(n instanceof _a))return!1;const i=n;if(this.width!==i.width||this.height!==i.height)return!1;for(let s=0,a=this.height;s<a;++s){const c=this.bytes[s],f=i.bytes[s];for(let d=0,g=this.width;d<g;++d)if(c[d]!==f[d])return!1}return!0}toString(){const n=new xe;for(let i=0,s=this.height;i<s;++i){const a=this.bytes[i];for(let c=0,f=this.width;c<f;++c)switch(a[c]){case 0:n.append(" 0");break;case 1:n.append(" 1");break;default:n.append(" ");break}n.append(`
480
+ `)}return n.toString()}}class di{constructor(){this.maskPattern=-1}getMode(){return this.mode}getECLevel(){return this.ecLevel}getVersion(){return this.version}getMaskPattern(){return this.maskPattern}getMatrix(){return this.matrix}toString(){const n=new xe;return n.append(`<<
481
+ `),n.append(" mode: "),n.append(this.mode?this.mode.toString():"null"),n.append(`
482
+ ecLevel: `),n.append(this.ecLevel?this.ecLevel.toString():"null"),n.append(`
483
+ version: `),n.append(this.version?this.version.toString():"null"),n.append(`
484
+ maskPattern: `),n.append(this.maskPattern.toString()),this.matrix?(n.append(`
485
+ matrix:
486
+ `),n.append(this.matrix.toString())):n.append(`
487
+ matrix: null
488
+ `),n.append(`>>
489
+ `),n.toString()}setMode(n){this.mode=n}setECLevel(n){this.ecLevel=n}setVersion(n){this.version=n}setMaskPattern(n){this.maskPattern=n}setMatrix(n){this.matrix=n}static isValidMaskPattern(n){return n>=0&&n<di.NUM_MASK_PATTERNS}}di.NUM_MASK_PATTERNS=8;class je extends m{}je.kind="WriterException";class me{constructor(){}static clearMatrix(n){n.clear(255)}static buildMatrix(n,i,s,a,c){me.clearMatrix(c),me.embedBasicPatterns(s,c),me.embedTypeInfo(i,a,c),me.maybeEmbedVersionInfo(s,c),me.embedDataBits(n,a,c)}static embedBasicPatterns(n,i){me.embedPositionDetectionPatternsAndSeparators(i),me.embedDarkDotAtLeftBottomCorner(i),me.maybeEmbedPositionAdjustmentPatterns(n,i),me.embedTimingPatterns(i)}static embedTypeInfo(n,i,s){const a=new L;me.makeTypeInfoBits(n,i,a);for(let c=0,f=a.getSize();c<f;++c){const d=a.get(a.getSize()-1-c),g=me.TYPE_INFO_COORDINATES[c],p=g[0],v=g[1];if(s.setBoolean(p,v,d),c<8){const A=s.getWidth()-c-1;s.setBoolean(A,8,d)}else{const S=s.getHeight()-7+(c-8);s.setBoolean(8,S,d)}}}static maybeEmbedVersionInfo(n,i){if(n.getVersionNumber()<7)return;const s=new L;me.makeVersionInfoBits(n,s);let a=6*3-1;for(let c=0;c<6;++c)for(let f=0;f<3;++f){const d=s.get(a);a--,i.setBoolean(c,i.getHeight()-11+f,d),i.setBoolean(i.getHeight()-11+f,c,d)}}static embedDataBits(n,i,s){let a=0,c=-1,f=s.getWidth()-1,d=s.getHeight()-1;for(;f>0;){for(f===6&&(f-=1);d>=0&&d<s.getHeight();){for(let g=0;g<2;++g){const p=f-g;if(!me.isEmpty(s.get(p,d)))continue;let v;a<n.getSize()?(v=n.get(a),++a):v=!1,i!==255&&st.getDataMaskBit(i,p,d)&&(v=!v),s.setBoolean(p,d,v)}d+=c}c=-c,d+=c,f-=2}if(a!==n.getSize())throw new je("Not all bits consumed: "+a+"/"+n.getSize())}static findMSBSet(n){return 32-_.numberOfLeadingZeros(n)}static calculateBCHCode(n,i){if(i===0)throw new b("0 polynomial");const s=me.findMSBSet(i);for(n<<=s-1;me.findMSBSet(n)>=s;)n^=i<<me.findMSBSet(n)-s;return n}static makeTypeInfoBits(n,i,s){if(!di.isValidMaskPattern(i))throw new je("Invalid mask pattern");const a=n.getBits()<<3|i;s.appendBits(a,5);const c=me.calculateBCHCode(a,me.TYPE_INFO_POLY);s.appendBits(c,10);const f=new L;if(f.appendBits(me.TYPE_INFO_MASK_PATTERN,15),s.xor(f),s.getSize()!==15)throw new je("should not happen but we got: "+s.getSize())}static makeVersionInfoBits(n,i){i.appendBits(n.getVersionNumber(),6);const s=me.calculateBCHCode(n.getVersionNumber(),me.VERSION_INFO_POLY);if(i.appendBits(s,12),i.getSize()!==18)throw new je("should not happen but we got: "+i.getSize())}static isEmpty(n){return n===255}static embedTimingPatterns(n){for(let i=8;i<n.getWidth()-8;++i){const s=(i+1)%2;me.isEmpty(n.get(i,6))&&n.setNumber(i,6,s),me.isEmpty(n.get(6,i))&&n.setNumber(6,i,s)}}static embedDarkDotAtLeftBottomCorner(n){if(n.get(8,n.getHeight()-8)===0)throw new je;n.setNumber(8,n.getHeight()-8,1)}static embedHorizontalSeparationPattern(n,i,s){for(let a=0;a<8;++a){if(!me.isEmpty(s.get(n+a,i)))throw new je;s.setNumber(n+a,i,0)}}static embedVerticalSeparationPattern(n,i,s){for(let a=0;a<7;++a){if(!me.isEmpty(s.get(n,i+a)))throw new je;s.setNumber(n,i+a,0)}}static embedPositionAdjustmentPattern(n,i,s){for(let a=0;a<5;++a){const c=me.POSITION_ADJUSTMENT_PATTERN[a];for(let f=0;f<5;++f)s.setNumber(n+f,i+a,c[f])}}static embedPositionDetectionPattern(n,i,s){for(let a=0;a<7;++a){const c=me.POSITION_DETECTION_PATTERN[a];for(let f=0;f<7;++f)s.setNumber(n+f,i+a,c[f])}}static embedPositionDetectionPatternsAndSeparators(n){const i=me.POSITION_DETECTION_PATTERN[0].length;me.embedPositionDetectionPattern(0,0,n),me.embedPositionDetectionPattern(n.getWidth()-i,0,n),me.embedPositionDetectionPattern(0,n.getWidth()-i,n);const s=8;me.embedHorizontalSeparationPattern(0,s-1,n),me.embedHorizontalSeparationPattern(n.getWidth()-s,s-1,n),me.embedHorizontalSeparationPattern(0,n.getWidth()-s,n);const a=7;me.embedVerticalSeparationPattern(a,0,n),me.embedVerticalSeparationPattern(n.getHeight()-a-1,0,n),me.embedVerticalSeparationPattern(a,n.getHeight()-a,n)}static maybeEmbedPositionAdjustmentPatterns(n,i){if(n.getVersionNumber()<2)return;const s=n.getVersionNumber()-1,a=me.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[s];for(let c=0,f=a.length;c!==f;c++){const d=a[c];if(d>=0)for(let g=0;g!==f;g++){const p=a[g];p>=0&&me.isEmpty(i.get(p,d))&&me.embedPositionAdjustmentPattern(p-2,d-2,i)}}}}me.POSITION_DETECTION_PATTERN=Array.from([Int32Array.from([1,1,1,1,1,1,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,1,1,1,1,1,1])]),me.POSITION_ADJUSTMENT_PATTERN=Array.from([Int32Array.from([1,1,1,1,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,0,1,0,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,1,1,1,1])]),me.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE=Array.from([Int32Array.from([-1,-1,-1,-1,-1,-1,-1]),Int32Array.from([6,18,-1,-1,-1,-1,-1]),Int32Array.from([6,22,-1,-1,-1,-1,-1]),Int32Array.from([6,26,-1,-1,-1,-1,-1]),Int32Array.from([6,30,-1,-1,-1,-1,-1]),Int32Array.from([6,34,-1,-1,-1,-1,-1]),Int32Array.from([6,22,38,-1,-1,-1,-1]),Int32Array.from([6,24,42,-1,-1,-1,-1]),Int32Array.from([6,26,46,-1,-1,-1,-1]),Int32Array.from([6,28,50,-1,-1,-1,-1]),Int32Array.from([6,30,54,-1,-1,-1,-1]),Int32Array.from([6,32,58,-1,-1,-1,-1]),Int32Array.from([6,34,62,-1,-1,-1,-1]),Int32Array.from([6,26,46,66,-1,-1,-1]),Int32Array.from([6,26,48,70,-1,-1,-1]),Int32Array.from([6,26,50,74,-1,-1,-1]),Int32Array.from([6,30,54,78,-1,-1,-1]),Int32Array.from([6,30,56,82,-1,-1,-1]),Int32Array.from([6,30,58,86,-1,-1,-1]),Int32Array.from([6,34,62,90,-1,-1,-1]),Int32Array.from([6,28,50,72,94,-1,-1]),Int32Array.from([6,26,50,74,98,-1,-1]),Int32Array.from([6,30,54,78,102,-1,-1]),Int32Array.from([6,28,54,80,106,-1,-1]),Int32Array.from([6,32,58,84,110,-1,-1]),Int32Array.from([6,30,58,86,114,-1,-1]),Int32Array.from([6,34,62,90,118,-1,-1]),Int32Array.from([6,26,50,74,98,122,-1]),Int32Array.from([6,30,54,78,102,126,-1]),Int32Array.from([6,26,52,78,104,130,-1]),Int32Array.from([6,30,56,82,108,134,-1]),Int32Array.from([6,34,60,86,112,138,-1]),Int32Array.from([6,30,58,86,114,142,-1]),Int32Array.from([6,34,62,90,118,146,-1]),Int32Array.from([6,30,54,78,102,126,150]),Int32Array.from([6,24,50,76,102,128,154]),Int32Array.from([6,28,54,80,106,132,158]),Int32Array.from([6,32,58,84,110,136,162]),Int32Array.from([6,26,54,82,110,138,166]),Int32Array.from([6,30,58,86,114,142,170])]),me.TYPE_INFO_COORDINATES=Array.from([Int32Array.from([8,0]),Int32Array.from([8,1]),Int32Array.from([8,2]),Int32Array.from([8,3]),Int32Array.from([8,4]),Int32Array.from([8,5]),Int32Array.from([8,7]),Int32Array.from([8,8]),Int32Array.from([7,8]),Int32Array.from([5,8]),Int32Array.from([4,8]),Int32Array.from([3,8]),Int32Array.from([2,8]),Int32Array.from([1,8]),Int32Array.from([0,8])]),me.VERSION_INFO_POLY=7973,me.TYPE_INFO_POLY=1335,me.TYPE_INFO_MASK_PATTERN=21522;class i3{constructor(n,i){this.dataBytes=n,this.errorCorrectionBytes=i}getDataBytes(){return this.dataBytes}getErrorCorrectionBytes(){return this.errorCorrectionBytes}}class He{constructor(){}static calculateMaskPenalty(n){return st.applyMaskPenaltyRule1(n)+st.applyMaskPenaltyRule2(n)+st.applyMaskPenaltyRule3(n)+st.applyMaskPenaltyRule4(n)}static encode(n,i,s=null){let a=He.DEFAULT_BYTE_MODE_ENCODING;const c=s!==null&&s.get(vt.CHARACTER_SET)!==void 0;c&&(a=s.get(vt.CHARACTER_SET).toString());const f=this.chooseMode(n,a),d=new L;if(f===ge.BYTE&&(c||He.DEFAULT_BYTE_MODE_ENCODING!==a)){const ee=$.getCharacterSetECIByName(a);ee!==void 0&&this.appendECI(ee,d)}this.appendModeInfo(f,d);const g=new L;this.appendBytes(n,f,g,a);let p;if(s!==null&&s.get(vt.QR_VERSION)!==void 0){const ee=Number.parseInt(s.get(vt.QR_VERSION).toString(),10);p=de.getVersionForNumber(ee);const Z=this.calculateBitsNeeded(f,d,g,p);if(!this.willFit(Z,p,i))throw new je("Data too big for requested version")}else p=this.recommendVersion(i,f,d,g);const v=new L;v.appendBitArray(d);const A=f===ge.BYTE?g.getSizeInBytes():n.length;this.appendLengthInfo(A,p,f,v),v.appendBitArray(g);const S=p.getECBlocksForLevel(i),N=p.getTotalCodewords()-S.getTotalECCodewords();this.terminateBits(N,v);const P=this.interleaveWithECBytes(v,p.getTotalCodewords(),N,S.getNumBlocks()),B=new di;B.setECLevel(i),B.setMode(f),B.setVersion(p);const W=p.getDimensionForVersion(),G=new _a(W,W),J=this.chooseMaskPattern(P,i,p,G);return B.setMaskPattern(J),me.buildMatrix(P,i,p,J,G),B.setMatrix(G),B}static recommendVersion(n,i,s,a){const c=this.calculateBitsNeeded(i,s,a,de.getVersionForNumber(1)),f=this.chooseVersion(c,n),d=this.calculateBitsNeeded(i,s,a,f);return this.chooseVersion(d,n)}static calculateBitsNeeded(n,i,s,a){return i.getSize()+n.getCharacterCountBits(a)+s.getSize()}static getAlphanumericCode(n){return n<He.ALPHANUMERIC_TABLE.length?He.ALPHANUMERIC_TABLE[n]:-1}static chooseMode(n,i=null){if($.SJIS.getName()===i&&this.isOnlyDoubleByteKanji(n))return ge.KANJI;let s=!1,a=!1;for(let c=0,f=n.length;c<f;++c){const d=n.charAt(c);if(He.isDigit(d))s=!0;else if(this.getAlphanumericCode(d.charCodeAt(0))!==-1)a=!0;else return ge.BYTE}return a?ge.ALPHANUMERIC:s?ge.NUMERIC:ge.BYTE}static isOnlyDoubleByteKanji(n){let i;try{i=ve.encode(n,$.SJIS)}catch{return!1}const s=i.length;if(s%2!==0)return!1;for(let a=0;a<s;a+=2){const c=i[a]&255;if((c<129||c>159)&&(c<224||c>235))return!1}return!0}static chooseMaskPattern(n,i,s,a){let c=Number.MAX_SAFE_INTEGER,f=-1;for(let d=0;d<di.NUM_MASK_PATTERNS;d++){me.buildMatrix(n,i,s,d,a);let g=this.calculateMaskPenalty(a);g<c&&(c=g,f=d)}return f}static chooseVersion(n,i){for(let s=1;s<=40;s++){const a=de.getVersionForNumber(s);if(He.willFit(n,a,i))return a}throw new je("Data too big")}static willFit(n,i,s){const a=i.getTotalCodewords(),f=i.getECBlocksForLevel(s).getTotalECCodewords(),d=a-f,g=(n+7)/8;return d>=g}static terminateBits(n,i){const s=n*8;if(i.getSize()>s)throw new je("data bits cannot fit in the QR Code"+i.getSize()+" > "+s);for(let f=0;f<4&&i.getSize()<s;++f)i.appendBit(!1);const a=i.getSize()&7;if(a>0)for(let f=a;f<8;f++)i.appendBit(!1);const c=n-i.getSizeInBytes();for(let f=0;f<c;++f)i.appendBits(f&1?17:236,8);if(i.getSize()!==s)throw new je("Bits size does not equal capacity")}static getNumDataBytesAndNumECBytesForBlockID(n,i,s,a,c,f){if(a>=s)throw new je("Block ID too large");const d=n%s,g=s-d,p=Math.floor(n/s),v=p+1,A=Math.floor(i/s),S=A+1,N=p-A,P=v-S;if(N!==P)throw new je("EC bytes mismatch");if(s!==g+d)throw new je("RS blocks mismatch");if(n!==(A+N)*g+(S+P)*d)throw new je("Total bytes mismatch");a<g?(c[0]=A,f[0]=N):(c[0]=S,f[0]=P)}static interleaveWithECBytes(n,i,s,a){if(n.getSizeInBytes()!==s)throw new je("Number of bits and data bytes does not match");let c=0,f=0,d=0;const g=new Array;for(let v=0;v<a;++v){const A=new Int32Array(1),S=new Int32Array(1);He.getNumDataBytesAndNumECBytesForBlockID(i,s,a,v,A,S);const N=A[0],P=new Uint8Array(N);n.toBytes(8*c,P,0,N);const B=He.generateECBytes(P,S[0]);g.push(new i3(P,B)),f=Math.max(f,N),d=Math.max(d,B.length),c+=A[0]}if(s!==c)throw new je("Data bytes does not match offset");const p=new L;for(let v=0;v<f;++v)for(const A of g){const S=A.getDataBytes();v<S.length&&p.appendBits(S[v],8)}for(let v=0;v<d;++v)for(const A of g){const S=A.getErrorCorrectionBytes();v<S.length&&p.appendBits(S[v],8)}if(i!==p.getSizeInBytes())throw new je("Interleaving error: "+i+" and "+p.getSizeInBytes()+" differ.");return p}static generateECBytes(n,i){const s=n.length,a=new Int32Array(s+i);for(let f=0;f<s;f++)a[f]=n[f]&255;new mu(Oe.QR_CODE_FIELD_256).encode(a,i);const c=new Uint8Array(i);for(let f=0;f<i;f++)c[f]=a[s+f];return c}static appendModeInfo(n,i){i.appendBits(n.getBits(),4)}static appendLengthInfo(n,i,s,a){const c=s.getCharacterCountBits(i);if(n>=1<<c)throw new je(n+" is bigger than "+((1<<c)-1));a.appendBits(n,c)}static appendBytes(n,i,s,a){switch(i){case ge.NUMERIC:He.appendNumericBytes(n,s);break;case ge.ALPHANUMERIC:He.appendAlphanumericBytes(n,s);break;case ge.BYTE:He.append8BitBytes(n,s,a);break;case ge.KANJI:He.appendKanjiBytes(n,s);break;default:throw new je("Invalid mode: "+i)}}static getDigit(n){return n.charCodeAt(0)-48}static isDigit(n){const i=He.getDigit(n);return i>=0&&i<=9}static appendNumericBytes(n,i){const s=n.length;let a=0;for(;a<s;){const c=He.getDigit(n.charAt(a));if(a+2<s){const f=He.getDigit(n.charAt(a+1)),d=He.getDigit(n.charAt(a+2));i.appendBits(c*100+f*10+d,10),a+=3}else if(a+1<s){const f=He.getDigit(n.charAt(a+1));i.appendBits(c*10+f,7),a+=2}else i.appendBits(c,4),a++}}static appendAlphanumericBytes(n,i){const s=n.length;let a=0;for(;a<s;){const c=He.getAlphanumericCode(n.charCodeAt(a));if(c===-1)throw new je;if(a+1<s){const f=He.getAlphanumericCode(n.charCodeAt(a+1));if(f===-1)throw new je;i.appendBits(c*45+f,11),a+=2}else i.appendBits(c,6),a++}}static append8BitBytes(n,i,s){let a;try{a=ve.encode(n,s)}catch(c){throw new je(c)}for(let c=0,f=a.length;c!==f;c++){const d=a[c];i.appendBits(d,8)}}static appendKanjiBytes(n,i){let s;try{s=ve.encode(n,$.SJIS)}catch(c){throw new je(c)}const a=s.length;for(let c=0;c<a;c+=2){const f=s[c]&255,d=s[c+1]&255,g=f<<8&4294967295|d;let p=-1;if(g>=33088&&g<=40956?p=g-33088:g>=57408&&g<=60351&&(p=g-49472),p===-1)throw new je("Invalid byte sequence");const v=(p>>8)*192+(p&255);i.appendBits(v,13)}}static appendECI(n,i){i.appendBits(ge.ECI.getBits(),4),i.appendBits(n.getValue(),8)}}He.ALPHANUMERIC_TABLE=Int32Array.from([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,36,-1,-1,-1,37,38,-1,-1,-1,-1,39,40,-1,41,42,43,0,1,2,3,4,5,6,7,8,9,44,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1]),He.DEFAULT_BYTE_MODE_ENCODING=$.UTF8.getName();class hi{write(n,i,s,a=null){if(n.length===0)throw new b("Found empty contents");if(i<0||s<0)throw new b("Requested dimensions are too small: "+i+"x"+s);let c=ze.L,f=hi.QUIET_ZONE_SIZE;a!==null&&(a.get(vt.ERROR_CORRECTION)!==void 0&&(c=ze.fromString(a.get(vt.ERROR_CORRECTION).toString())),a.get(vt.MARGIN)!==void 0&&(f=Number.parseInt(a.get(vt.MARGIN).toString(),10)));const d=He.encode(n,c,a);return this.renderResult(d,i,s,f)}writeToDom(n,i,s,a,c=null){typeof n=="string"&&(n=document.querySelector(n));const f=this.write(i,s,a,c);n&&n.appendChild(f)}renderResult(n,i,s,a){const c=n.getMatrix();if(c===null)throw new Xr;const f=c.getWidth(),d=c.getHeight(),g=f+a*2,p=d+a*2,v=Math.max(i,g),A=Math.max(s,p),S=Math.min(Math.floor(v/g),Math.floor(A/p)),N=Math.floor((v-f*S)/2),P=Math.floor((A-d*S)/2),B=this.createSVGElement(v,A);for(let W=0,G=P;W<d;W++,G+=S)for(let J=0,ee=N;J<f;J++,ee+=S)if(c.get(J,W)===1){const Z=this.createSvgRectElement(ee,G,S,S);B.appendChild(Z)}return B}createSVGElement(n,i){const s=document.createElementNS(hi.SVG_NS,"svg");return s.setAttributeNS(null,"height",n.toString()),s.setAttributeNS(null,"width",i.toString()),s}createSvgRectElement(n,i,s,a){const c=document.createElementNS(hi.SVG_NS,"rect");return c.setAttributeNS(null,"x",n.toString()),c.setAttributeNS(null,"y",i.toString()),c.setAttributeNS(null,"height",s.toString()),c.setAttributeNS(null,"width",a.toString()),c.setAttributeNS(null,"fill","#000000"),c}}hi.QUIET_ZONE_SIZE=4,hi.SVG_NS="http://www.w3.org/2000/svg";class Gi{encode(n,i,s,a,c){if(n.length===0)throw new b("Found empty contents");if(i!==ue.QR_CODE)throw new b("Can only encode QR_CODE, but got "+i);if(s<0||a<0)throw new b(`Requested dimensions are too small: ${s}x${a}`);let f=ze.L,d=Gi.QUIET_ZONE_SIZE;c!==null&&(c.get(vt.ERROR_CORRECTION)!==void 0&&(f=ze.fromString(c.get(vt.ERROR_CORRECTION).toString())),c.get(vt.MARGIN)!==void 0&&(d=Number.parseInt(c.get(vt.MARGIN).toString(),10)));const g=He.encode(n,f,c);return Gi.renderResult(g,s,a,d)}static renderResult(n,i,s,a){const c=n.getMatrix();if(c===null)throw new Xr;const f=c.getWidth(),d=c.getHeight(),g=f+a*2,p=d+a*2,v=Math.max(i,g),A=Math.max(s,p),S=Math.min(Math.floor(v/g),Math.floor(A/p)),N=Math.floor((v-f*S)/2),P=Math.floor((A-d*S)/2),B=new re(v,A);for(let W=0,G=P;W<d;W++,G+=S)for(let J=0,ee=N;J<f;J++,ee+=S)c.get(J,W)===1&&B.setRegion(ee,G,S,S);return B}}Gi.QUIET_ZONE_SIZE=4;class s3{encode(n,i,s,a,c){let f;switch(i){case ue.QR_CODE:f=new Gi;break;default:throw new b("No encoder available for format "+i)}return f.encode(n,i,s,a,c)}}class Qr extends ne{constructor(n,i,s,a,c,f,d,g){if(super(f,d),this.yuvData=n,this.dataWidth=i,this.dataHeight=s,this.left=a,this.top=c,a+f>i||c+d>s)throw new b("Crop rectangle does not fit within image data.");g&&this.reverseHorizontal(f,d)}getRow(n,i){if(n<0||n>=this.getHeight())throw new b("Requested row is outside the image: "+n);const s=this.getWidth();(i==null||i.length<s)&&(i=new Uint8ClampedArray(s));const a=(n+this.top)*this.dataWidth+this.left;return D.arraycopy(this.yuvData,a,i,0,s),i}getMatrix(){const n=this.getWidth(),i=this.getHeight();if(n===this.dataWidth&&i===this.dataHeight)return this.yuvData;const s=n*i,a=new Uint8ClampedArray(s);let c=this.top*this.dataWidth+this.left;if(n===this.dataWidth)return D.arraycopy(this.yuvData,c,a,0,s),a;for(let f=0;f<i;f++){const d=f*n;D.arraycopy(this.yuvData,c,a,d,n),c+=this.dataWidth}return a}isCropSupported(){return!0}crop(n,i,s,a){return new Qr(this.yuvData,this.dataWidth,this.dataHeight,this.left+n,this.top+i,s,a,!1)}renderThumbnail(){const n=this.getWidth()/Qr.THUMBNAIL_SCALE_FACTOR,i=this.getHeight()/Qr.THUMBNAIL_SCALE_FACTOR,s=new Int32Array(n*i),a=this.yuvData;let c=this.top*this.dataWidth+this.left;for(let f=0;f<i;f++){const d=f*n;for(let g=0;g<n;g++){const p=a[c+g*Qr.THUMBNAIL_SCALE_FACTOR]&255;s[d+g]=4278190080|p*65793}c+=this.dataWidth*Qr.THUMBNAIL_SCALE_FACTOR}return s}getThumbnailWidth(){return this.getWidth()/Qr.THUMBNAIL_SCALE_FACTOR}getThumbnailHeight(){return this.getHeight()/Qr.THUMBNAIL_SCALE_FACTOR}reverseHorizontal(n,i){const s=this.yuvData;for(let a=0,c=this.top*this.dataWidth+this.left;a<i;a++,c+=this.dataWidth){const f=c+n/2;for(let d=c,g=c+n-1;d<f;d++,g--){const p=s[d];s[d]=s[g],s[g]=p}}}invert(){return new fe(this)}}Qr.THUMBNAIL_SCALE_FACTOR=2;class xu extends ne{constructor(n,i,s,a,c,f,d){if(super(i,s),this.dataWidth=a,this.dataHeight=c,this.left=f,this.top=d,n.BYTES_PER_ELEMENT===4){const g=i*s,p=new Uint8ClampedArray(g);for(let v=0;v<g;v++){const A=n[v],S=A>>16&255,N=A>>7&510,P=A&255;p[v]=(S+N+P)/4&255}this.luminances=p}else this.luminances=n;if(a===void 0&&(this.dataWidth=i),c===void 0&&(this.dataHeight=s),f===void 0&&(this.left=0),d===void 0&&(this.top=0),this.left+i>this.dataWidth||this.top+s>this.dataHeight)throw new b("Crop rectangle does not fit within image data.")}getRow(n,i){if(n<0||n>=this.getHeight())throw new b("Requested row is outside the image: "+n);const s=this.getWidth();(i==null||i.length<s)&&(i=new Uint8ClampedArray(s));const a=(n+this.top)*this.dataWidth+this.left;return D.arraycopy(this.luminances,a,i,0,s),i}getMatrix(){const n=this.getWidth(),i=this.getHeight();if(n===this.dataWidth&&i===this.dataHeight)return this.luminances;const s=n*i,a=new Uint8ClampedArray(s);let c=this.top*this.dataWidth+this.left;if(n===this.dataWidth)return D.arraycopy(this.luminances,c,a,0,s),a;for(let f=0;f<i;f++){const d=f*n;D.arraycopy(this.luminances,c,a,d,n),c+=this.dataWidth}return a}isCropSupported(){return!0}crop(n,i,s,a){return new xu(this.luminances,s,a,this.dataWidth,this.dataHeight,this.left+n,this.top+i)}invert(){return new fe(this)}}class ph extends ${static forName(n){return this.getCharacterSetECIByName(n)}}class wu{}wu.ISO_8859_1=$.ISO8859_1;class mh{isCompact(){return this.compact}setCompact(n){this.compact=n}getSize(){return this.size}setSize(n){this.size=n}getLayers(){return this.layers}setLayers(n){this.layers=n}getCodeWords(){return this.codeWords}setCodeWords(n){this.codeWords=n}getMatrix(){return this.matrix}setMatrix(n){this.matrix=n}}class xh{static singletonList(n){return[n]}static min(n,i){return n.sort(i)[0]}}class o3{constructor(n){this.previous=n}getPrevious(){return this.previous}}class Xi extends o3{constructor(n,i,s){super(n),this.value=i,this.bitCount=s}appendTo(n,i){n.appendBits(this.value,this.bitCount)}add(n,i){return new Xi(this,n,i)}addBinaryShift(n,i){return console.warn("addBinaryShift on SimpleToken, this simply returns a copy of this token"),new Xi(this,n,i)}toString(){let n=this.value&(1<<this.bitCount)-1;return n|=1<<this.bitCount,"<"+_.toBinaryString(n|1<<this.bitCount).substring(1)+">"}}class vu extends Xi{constructor(n,i,s){super(n,0,0),this.binaryShiftStart=i,this.binaryShiftByteCount=s}appendTo(n,i){for(let s=0;s<this.binaryShiftByteCount;s++)(s===0||s===31&&this.binaryShiftByteCount<=62)&&(n.appendBits(31,5),this.binaryShiftByteCount>62?n.appendBits(this.binaryShiftByteCount-31,16):s===0?n.appendBits(Math.min(this.binaryShiftByteCount,31),5):n.appendBits(this.binaryShiftByteCount-31,5)),n.appendBits(i[this.binaryShiftStart+s],8)}addBinaryShift(n,i){return new vu(this,n,i)}toString(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"}}function a3(E,n,i){return new vu(E,n,i)}function Zs(E,n,i){return new Xi(E,n,i)}const l3=["UPPER","LOWER","DIGIT","MIXED","PUNCT"],Ln=0,Na=1,Sr=2,wh=3,qr=4,c3=new Xi(null,0,0),yu=[Int32Array.from([0,(5<<16)+28,(5<<16)+30,(5<<16)+29,656318]),Int32Array.from([(9<<16)+480+14,0,(5<<16)+30,(5<<16)+29,656318]),Int32Array.from([(4<<16)+14,(9<<16)+448+28,0,(9<<16)+448+29,932798]),Int32Array.from([(5<<16)+29,(5<<16)+28,656318,0,(5<<16)+30]),Int32Array.from([(5<<16)+31,656380,656382,656381,0])];function u3(E){for(let n of E)I.fill(n,-1);return E[Ln][qr]=0,E[Na][qr]=0,E[Na][Ln]=28,E[wh][qr]=0,E[Sr][qr]=0,E[Sr][Ln]=15,E}const vh=u3(I.createInt32Array(6,6));class Jr{constructor(n,i,s,a){this.token=n,this.mode=i,this.binaryShiftByteCount=s,this.bitCount=a}getMode(){return this.mode}getToken(){return this.token}getBinaryShiftByteCount(){return this.binaryShiftByteCount}getBitCount(){return this.bitCount}latchAndAppend(n,i){let s=this.bitCount,a=this.token;if(n!==this.mode){let f=yu[this.mode][n];a=Zs(a,f&65535,f>>16),s+=f>>16}let c=n===Sr?4:5;return a=Zs(a,i,c),new Jr(a,n,0,s+c)}shiftAndAppend(n,i){let s=this.token,a=this.mode===Sr?4:5;return s=Zs(s,vh[this.mode][n],a),s=Zs(s,i,5),new Jr(s,this.mode,0,this.bitCount+a+5)}addBinaryShiftChar(n){let i=this.token,s=this.mode,a=this.bitCount;if(this.mode===qr||this.mode===Sr){let d=yu[s][Ln];i=Zs(i,d&65535,d>>16),a+=d>>16,s=Ln}let c=this.binaryShiftByteCount===0||this.binaryShiftByteCount===31?18:this.binaryShiftByteCount===62?9:8,f=new Jr(i,s,this.binaryShiftByteCount+1,a+c);return f.binaryShiftByteCount===2078&&(f=f.endBinaryShift(n+1)),f}endBinaryShift(n){if(this.binaryShiftByteCount===0)return this;let i=this.token;return i=a3(i,n-this.binaryShiftByteCount,this.binaryShiftByteCount),new Jr(i,this.mode,0,this.bitCount)}isBetterThanOrEqualTo(n){let i=this.bitCount+(yu[this.mode][n.mode]>>16);return this.binaryShiftByteCount<n.binaryShiftByteCount?i+=Jr.calculateBinaryShiftCost(n)-Jr.calculateBinaryShiftCost(this):this.binaryShiftByteCount>n.binaryShiftByteCount&&n.binaryShiftByteCount>0&&(i+=10),i<=n.bitCount}toBitArray(n){let i=[];for(let a=this.endBinaryShift(n.length).token;a!==null;a=a.getPrevious())i.unshift(a);let s=new L;for(const a of i)a.appendTo(s,n);return s}toString(){return Q.format("%s bits=%d bytes=%d",l3[this.mode],this.bitCount,this.binaryShiftByteCount)}static calculateBinaryShiftCost(n){return n.binaryShiftByteCount>62?21:n.binaryShiftByteCount>31?20:n.binaryShiftByteCount>0?10:0}}Jr.INITIAL_STATE=new Jr(c3,Ln,0,0);function f3(E){const n=Q.getCharCode(" "),i=Q.getCharCode("."),s=Q.getCharCode(",");E[Ln][n]=1;const a=Q.getCharCode("Z"),c=Q.getCharCode("A");for(let S=c;S<=a;S++)E[Ln][S]=S-c+2;E[Na][n]=1;const f=Q.getCharCode("z"),d=Q.getCharCode("a");for(let S=d;S<=f;S++)E[Na][S]=S-d+2;E[Sr][n]=1;const g=Q.getCharCode("9"),p=Q.getCharCode("0");for(let S=p;S<=g;S++)E[Sr][S]=S-p+2;E[Sr][s]=12,E[Sr][i]=13;const v=["\0"," ","","","","","","","\x07","\b"," ",`
490
+ `,"\v","\f","\r","\x1B","","","","","@","\\","^","_","`","|","~",""];for(let S=0;S<v.length;S++)E[wh][Q.getCharCode(v[S])]=S;const A=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"];for(let S=0;S<A.length;S++)Q.getCharCode(A[S])>0&&(E[qr][Q.getCharCode(A[S])]=S);return E}const Eu=f3(I.createInt32Array(5,256));class Qs{constructor(n){this.text=n}encode(){const n=Q.getCharCode(" "),i=Q.getCharCode(`
491
+ `);let s=xh.singletonList(Jr.INITIAL_STATE);for(let c=0;c<this.text.length;c++){let f,d=c+1<this.text.length?this.text[c+1]:0;switch(this.text[c]){case Q.getCharCode("\r"):f=d===i?2:0;break;case Q.getCharCode("."):f=d===n?3:0;break;case Q.getCharCode(","):f=d===n?4:0;break;case Q.getCharCode(":"):f=d===n?5:0;break;default:f=0}f>0?(s=Qs.updateStateListForPair(s,c,f),c++):s=this.updateStateListForChar(s,c)}return xh.min(s,(c,f)=>c.getBitCount()-f.getBitCount()).toBitArray(this.text)}updateStateListForChar(n,i){const s=[];for(let a of n)this.updateStateForChar(a,i,s);return Qs.simplifyStates(s)}updateStateForChar(n,i,s){let a=this.text[i]&255,c=Eu[n.getMode()][a]>0,f=null;for(let d=0;d<=qr;d++){let g=Eu[d][a];if(g>0){if(f==null&&(f=n.endBinaryShift(i)),!c||d===n.getMode()||d===Sr){const p=f.latchAndAppend(d,g);s.push(p)}if(!c&&vh[n.getMode()][d]>=0){const p=f.shiftAndAppend(d,g);s.push(p)}}}if(n.getBinaryShiftByteCount()>0||Eu[n.getMode()][a]===0){let d=n.addBinaryShiftChar(i);s.push(d)}}static updateStateListForPair(n,i,s){const a=[];for(let c of n)this.updateStateForPair(c,i,s,a);return this.simplifyStates(a)}static updateStateForPair(n,i,s,a){let c=n.endBinaryShift(i);if(a.push(c.latchAndAppend(qr,s)),n.getMode()!==qr&&a.push(c.shiftAndAppend(qr,s)),s===3||s===4){let f=c.latchAndAppend(Sr,16-s).latchAndAppend(Sr,1);a.push(f)}if(n.getBinaryShiftByteCount()>0){let f=n.addBinaryShiftChar(i).addBinaryShiftChar(i+1);a.push(f)}}static simplifyStates(n){let i=[];for(const s of n){let a=!0;for(const c of i){if(c.isBetterThanOrEqualTo(s)){a=!1;break}s.isBetterThanOrEqualTo(c)&&(i=i.filter(f=>f!==c))}a&&i.push(s)}return i}}class _e{constructor(){}static encodeBytes(n){return _e.encode(n,_e.DEFAULT_EC_PERCENT,_e.DEFAULT_AZTEC_LAYERS)}static encode(n,i,s){let a=new Qs(n).encode(),c=_.truncDivision(a.getSize()*i,100)+11,f=a.getSize()+c,d,g,p,v,A;if(s!==_e.DEFAULT_AZTEC_LAYERS){if(d=s<0,g=Math.abs(s),g>(d?_e.MAX_NB_BITS_COMPACT:_e.MAX_NB_BITS))throw new b(Q.format("Illegal value %s for layers",s));p=_e.totalBitsInLayer(g,d),v=_e.WORD_SIZE[g];let Z=p-p%v;if(A=_e.stuffBits(a,v),A.getSize()+c>Z)throw new b("Data to large for user specified layer");if(d&&A.getSize()>v*64)throw new b("Data to large for user specified layer")}else{v=0,A=null;for(let Z=0;;Z++){if(Z>_e.MAX_NB_BITS)throw new b("Data too large for an Aztec code");if(d=Z<=3,g=d?Z+1:Z,p=_e.totalBitsInLayer(g,d),f>p)continue;(A==null||v!==_e.WORD_SIZE[g])&&(v=_e.WORD_SIZE[g],A=_e.stuffBits(a,v));let Se=p-p%v;if(!(d&&A.getSize()>v*64)&&A.getSize()+c<=Se)break}}let S=_e.generateCheckWords(A,p,v),N=A.getSize()/v,P=_e.generateModeMessage(d,g,N),B=(d?11:14)+g*4,W=new Int32Array(B),G;if(d){G=B;for(let Z=0;Z<W.length;Z++)W[Z]=Z}else{G=B+1+2*_.truncDivision(_.truncDivision(B,2)-1,15);let Z=_.truncDivision(B,2),Se=_.truncDivision(G,2);for(let ye=0;ye<Z;ye++){let tr=ye+_.truncDivision(ye,15);W[Z-ye-1]=Se-tr-1,W[Z+ye]=Se+tr+1}}let J=new re(G);for(let Z=0,Se=0;Z<g;Z++){let ye=(g-Z)*4+(d?9:12);for(let tr=0;tr<ye;tr++){let Dr=tr*2;for(let rr=0;rr<2;rr++)S.get(Se+Dr+rr)&&J.set(W[Z*2+rr],W[Z*2+tr]),S.get(Se+ye*2+Dr+rr)&&J.set(W[Z*2+tr],W[B-1-Z*2-rr]),S.get(Se+ye*4+Dr+rr)&&J.set(W[B-1-Z*2-rr],W[B-1-Z*2-tr]),S.get(Se+ye*6+Dr+rr)&&J.set(W[B-1-Z*2-tr],W[Z*2+rr])}Se+=ye*8}if(_e.drawModeMessage(J,d,G,P),d)_e.drawBullsEye(J,_.truncDivision(G,2),5);else{_e.drawBullsEye(J,_.truncDivision(G,2),7);for(let Z=0,Se=0;Z<_.truncDivision(B,2)-1;Z+=15,Se+=16)for(let ye=_.truncDivision(G,2)&1;ye<G;ye+=2)J.set(_.truncDivision(G,2)-Se,ye),J.set(_.truncDivision(G,2)+Se,ye),J.set(ye,_.truncDivision(G,2)-Se),J.set(ye,_.truncDivision(G,2)+Se)}let ee=new mh;return ee.setCompact(d),ee.setSize(G),ee.setLayers(g),ee.setCodeWords(N),ee.setMatrix(J),ee}static drawBullsEye(n,i,s){for(let a=0;a<s;a+=2)for(let c=i-a;c<=i+a;c++)n.set(c,i-a),n.set(c,i+a),n.set(i-a,c),n.set(i+a,c);n.set(i-s,i-s),n.set(i-s+1,i-s),n.set(i-s,i-s+1),n.set(i+s,i-s),n.set(i+s,i-s+1),n.set(i+s,i+s-1)}static generateModeMessage(n,i,s){let a=new L;return n?(a.appendBits(i-1,2),a.appendBits(s-1,6),a=_e.generateCheckWords(a,28,4)):(a.appendBits(i-1,5),a.appendBits(s-1,11),a=_e.generateCheckWords(a,40,4)),a}static drawModeMessage(n,i,s,a){let c=_.truncDivision(s,2);if(i)for(let f=0;f<7;f++){let d=c-3+f;a.get(f)&&n.set(d,c-5),a.get(f+7)&&n.set(c+5,d),a.get(20-f)&&n.set(d,c+5),a.get(27-f)&&n.set(c-5,d)}else for(let f=0;f<10;f++){let d=c-5+f+_.truncDivision(f,5);a.get(f)&&n.set(d,c-7),a.get(f+10)&&n.set(c+7,d),a.get(29-f)&&n.set(d,c+7),a.get(39-f)&&n.set(c-7,d)}}static generateCheckWords(n,i,s){let a=n.getSize()/s,c=new mu(_e.getGF(s)),f=_.truncDivision(i,s),d=_e.bitsToWords(n,s,f);c.encode(d,f-a);let g=i%s,p=new L;p.appendBits(0,g);for(const v of Array.from(d))p.appendBits(v,s);return p}static bitsToWords(n,i,s){let a=new Int32Array(s),c,f;for(c=0,f=n.getSize()/i;c<f;c++){let d=0;for(let g=0;g<i;g++)d|=n.get(c*i+g)?1<<i-g-1:0;a[c]=d}return a}static getGF(n){switch(n){case 4:return Oe.AZTEC_PARAM;case 6:return Oe.AZTEC_DATA_6;case 8:return Oe.AZTEC_DATA_8;case 10:return Oe.AZTEC_DATA_10;case 12:return Oe.AZTEC_DATA_12;default:throw new b("Unsupported word size "+n)}}static stuffBits(n,i){let s=new L,a=n.getSize(),c=(1<<i)-2;for(let f=0;f<a;f+=i){let d=0;for(let g=0;g<i;g++)(f+g>=a||n.get(f+g))&&(d|=1<<i-1-g);(d&c)===c?(s.appendBits(d&c,i),f--):d&c?s.appendBits(d,i):(s.appendBits(d|1,i),f--)}return s}static totalBitsInLayer(n,i){return((i?88:112)+16*n)*n}}_e.DEFAULT_EC_PERCENT=33,_e.DEFAULT_AZTEC_LAYERS=0,_e.MAX_NB_BITS=32,_e.MAX_NB_BITS_COMPACT=4,_e.WORD_SIZE=Int32Array.from([4,6,6,8,8,8,8,8,8,10,10,10,10,10,10,10,10,10,10,10,10,10,10,12,12,12,12,12,12,12,12,12,12]);class Oa{encode(n,i,s,a){return this.encodeWithHints(n,i,s,a,null)}encodeWithHints(n,i,s,a,c){let f=wu.ISO_8859_1,d=_e.DEFAULT_EC_PERCENT,g=_e.DEFAULT_AZTEC_LAYERS;return c!=null&&(c.has(vt.CHARACTER_SET)&&(f=ph.forName(c.get(vt.CHARACTER_SET).toString())),c.has(vt.ERROR_CORRECTION)&&(d=_.parseInt(c.get(vt.ERROR_CORRECTION).toString())),c.has(vt.AZTEC_LAYERS)&&(g=_.parseInt(c.get(vt.AZTEC_LAYERS).toString()))),Oa.encodeLayers(n,i,s,a,f,d,g)}static encodeLayers(n,i,s,a,c,f,d){if(i!==ue.AZTEC)throw new b("Can only encode AZTEC, but got "+i);let g=_e.encode(Q.getBytes(n,c),f,d);return Oa.renderResult(g,s,a)}static renderResult(n,i,s){let a=n.getMatrix();if(a==null)throw new Xr;let c=a.getWidth(),f=a.getHeight(),d=Math.max(i,c),g=Math.max(s,f),p=Math.min(d/c,g/f),v=(d-c*p)/2,A=(g-f*p)/2,S=new re(d,g);for(let N=0,P=A;N<f;N++,P+=p)for(let B=0,W=v;B<c;B++,W+=p)a.get(B,N)&&S.setRegion(W,P,p,p);return S}}r.AbstractExpandedDecoder=ou,r.ArgumentException=y,r.ArithmeticException=va,r.AztecCode=mh,r.AztecCodeReader=Aa,r.AztecCodeWriter=Oa,r.AztecDecoder=Ve,r.AztecDetector=rh,r.AztecDetectorResult=eh,r.AztecEncoder=_e,r.AztecHighLevelEncoder=Qs,r.AztecPoint=$t,r.BarcodeFormat=ue,r.Binarizer=k,r.BinaryBitmap=C,r.BitArray=L,r.BitMatrix=re,r.BitSource=uu,r.BrowserAztecCodeReader=By,r.BrowserBarcodeReader=Vy,r.BrowserCodeReader=Er,r.BrowserDatamatrixCodeReader=$y,r.BrowserMultiFormatReader=t3,r.BrowserPDF417Reader=r3,r.BrowserQRCodeReader=n3,r.BrowserQRCodeSvgWriter=hi,r.CharacterSetECI=$,r.ChecksumException=T,r.Code128Reader=te,r.Code39Reader=xt,r.DataMatrixDecodedBitStreamParser=kn,r.DataMatrixReader=Mn,r.DecodeHintType=U,r.DecoderResult=js,r.DefaultGridSampler=th,r.DetectorResult=Ea,r.EAN13Reader=li,r.EncodeHintType=vt,r.Exception=m,r.FormatException=F,r.GenericGF=Oe,r.GenericGFPoly=Qt,r.GlobalHistogramBinarizer=De,r.GridSampler=ru,r.GridSamplerInstance=Nn,r.HTMLCanvasElementLuminanceSource=he,r.HybridBinarizer=pe,r.ITFReader=Ue,r.IllegalArgumentException=b,r.IllegalStateException=Xr,r.InvertedLuminanceSource=fe,r.LuminanceSource=ne,r.MathUtils=Re,r.MultiFormatOneDReader=$i,r.MultiFormatReader=gh,r.MultiFormatWriter=s3,r.NotFoundException=z,r.OneDReader=ht,r.PDF417DecodedBitStreamParser=H,r.PDF417DecoderErrorCorrection=lh,r.PDF417Reader=Ot,r.PDF417ResultMetadata=uh,r.PerspectiveTransform=kr,r.PlanarYUVLuminanceSource=Qr,r.QRCodeByteMatrix=_a,r.QRCodeDataMask=br,r.QRCodeDecodedBitStreamParser=qe,r.QRCodeDecoderErrorCorrectionLevel=ze,r.QRCodeDecoderFormatInformation=Ut,r.QRCodeEncoder=He,r.QRCodeEncoderQRCode=di,r.QRCodeMaskUtil=st,r.QRCodeMatrixUtil=me,r.QRCodeMode=ge,r.QRCodeReader=Dn,r.QRCodeVersion=de,r.QRCodeWriter=Gi,r.RGBLuminanceSource=xu,r.RSS14Reader=it,r.RSSExpandedReader=K,r.ReaderException=Ra,r.ReedSolomonDecoder=Vs,r.ReedSolomonEncoder=mu,r.ReedSolomonException=ji,r.Result=Qe,r.ResultMetadataType=Ct,r.ResultPoint=ce,r.StringUtils=Q,r.UnsupportedOperationException=se,r.VideoInputDevice=Pe,r.WhiteRectangleDetector=fn,r.WriterException=je,r.ZXingArrays=I,r.ZXingCharset=ph,r.ZXingInteger=_,r.ZXingStandardCharsets=wu,r.ZXingStringBuilder=xe,r.ZXingStringEncoding=ve,r.ZXingSystem=D,r.createAbstractExpandedDecoder=oh,Object.defineProperty(r,"__esModule",{value:!0})})})(nd,nd.exports);var Je=nd.exports;const q_=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var N2=function(){function t(e,r,o){if(this.formatMap=new Map([[oe.QR_CODE,Je.BarcodeFormat.QR_CODE],[oe.AZTEC,Je.BarcodeFormat.AZTEC],[oe.CODABAR,Je.BarcodeFormat.CODABAR],[oe.CODE_39,Je.BarcodeFormat.CODE_39],[oe.CODE_93,Je.BarcodeFormat.CODE_93],[oe.CODE_128,Je.BarcodeFormat.CODE_128],[oe.DATA_MATRIX,Je.BarcodeFormat.DATA_MATRIX],[oe.MAXICODE,Je.BarcodeFormat.MAXICODE],[oe.ITF,Je.BarcodeFormat.ITF],[oe.EAN_13,Je.BarcodeFormat.EAN_13],[oe.EAN_8,Je.BarcodeFormat.EAN_8],[oe.PDF_417,Je.BarcodeFormat.PDF_417],[oe.RSS_14,Je.BarcodeFormat.RSS_14],[oe.RSS_EXPANDED,Je.BarcodeFormat.RSS_EXPANDED],[oe.UPC_A,Je.BarcodeFormat.UPC_A],[oe.UPC_E,Je.BarcodeFormat.UPC_E],[oe.UPC_EAN_EXTENSION,Je.BarcodeFormat.UPC_EAN_EXTENSION]]),this.reverseFormatMap=this.createReverseFormatMap(),!q_)throw"Use html5qrcode.min.js without edit, ZXing not found.";this.verbose=r,this.logger=o;var l=this.createZXingFormats(e),u=new Map;u.set(Je.DecodeHintType.POSSIBLE_FORMATS,l),u.set(Je.DecodeHintType.TRY_HARDER,!1),this.hints=u}return t.prototype.decodeAsync=function(e){var r=this;return new Promise(function(o,l){try{o(r.decode(e))}catch(u){l(u)}})},t.prototype.decode=function(e){var r=new Je.MultiFormatReader(this.verbose,this.hints),o=new Je.HTMLCanvasElementLuminanceSource(e),l=new Je.BinaryBitmap(new Je.HybridBinarizer(o)),u=r.decode(l);return{text:u.text,format:Ry.create(this.toHtml5QrcodeSupportedFormats(u.format)),debugData:this.createDebugData()}},t.prototype.createReverseFormatMap=function(){var e=new Map;return this.formatMap.forEach(function(r,o,l){e.set(r,o)}),e},t.prototype.toHtml5QrcodeSupportedFormats=function(e){if(!this.reverseFormatMap.has(e))throw"reverseFormatMap doesn't have ".concat(e);return this.reverseFormatMap.get(e)},t.prototype.createZXingFormats=function(e){for(var r=[],o=0,l=e;o<l.length;o++){var u=l[o];this.formatMap.has(u)?r.push(this.formatMap.get(u)):this.logger.logError("".concat(u," is not supported by")+"ZXingHtml5QrcodeShim")}return r},t.prototype.createDebugData=function(){return{decoderName:"zxing-js"}},t}(),J_=function(t,e,r,o){function l(u){return u instanceof r?u:new r(function(h){h(u)})}return new(r||(r=Promise))(function(u,h){function x(y){try{m(o.next(y))}catch(b){h(b)}}function w(y){try{m(o.throw(y))}catch(b){h(b)}}function m(y){y.done?u(y.value):l(y.value).then(x,w)}m((o=o.apply(t,e||[])).next())})},eN=function(t,e){var r={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,l,u,h;return h={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function x(m){return function(y){return w([m,y])}}function w(m){if(o)throw new TypeError("Generator is already executing.");for(;h&&(h=0,m[0]&&(r=0)),r;)try{if(o=1,l&&(u=m[0]&2?l.return:m[0]?l.throw||((u=l.return)&&u.call(l),0):l.next)&&!(u=u.call(l,m[1])).done)return u;switch(l=0,u&&(m=[m[0]&2,u.value]),m[0]){case 0:case 1:u=m;break;case 4:return r.label++,{value:m[1],done:!1};case 5:r.label++,l=m[1],m=[0];continue;case 7:m=r.ops.pop(),r.trys.pop();continue;default:if(u=r.trys,!(u=u.length>0&&u[u.length-1])&&(m[0]===6||m[0]===2)){r=0;continue}if(m[0]===3&&(!u||m[1]>u[0]&&m[1]<u[3])){r.label=m[1];break}if(m[0]===6&&r.label<u[1]){r.label=u[1],u=m;break}if(u&&r.label<u[2]){r.label=u[2],r.ops.push(m);break}u[2]&&r.ops.pop(),r.trys.pop();continue}m=e.call(t,r)}catch(y){m=[6,y],l=0}finally{o=u=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}},O2=function(){function t(e,r,o){if(this.formatMap=new Map([[oe.QR_CODE,"qr_code"],[oe.AZTEC,"aztec"],[oe.CODABAR,"codabar"],[oe.CODE_39,"code_39"],[oe.CODE_93,"code_93"],[oe.CODE_128,"code_128"],[oe.DATA_MATRIX,"data_matrix"],[oe.ITF,"itf"],[oe.EAN_13,"ean_13"],[oe.EAN_8,"ean_8"],[oe.PDF_417,"pdf417"],[oe.UPC_A,"upc_a"],[oe.UPC_E,"upc_e"]]),this.reverseFormatMap=this.createReverseFormatMap(),!t.isSupported())throw"Use html5qrcode.min.js without edit, Use BarcodeDetectorDelegate only if it isSupported();";this.verbose=r,this.logger=o;var l=this.createBarcodeDetectorFormats(e);if(this.detector=new BarcodeDetector(l),!this.detector)throw"BarcodeDetector detector not supported"}return t.isSupported=function(){if(!("BarcodeDetector"in window))return!1;var e=new BarcodeDetector({formats:["qr_code"]});return typeof e<"u"},t.prototype.decodeAsync=function(e){return J_(this,void 0,void 0,function(){var r,o;return eN(this,function(l){switch(l.label){case 0:return[4,this.detector.detect(e)];case 1:if(r=l.sent(),!r||r.length===0)throw"No barcode or QR code detected.";return o=this.selectLargestBarcode(r),[2,{text:o.rawValue,format:Ry.create(this.toHtml5QrcodeSupportedFormats(o.format)),debugData:this.createDebugData()}]}})})},t.prototype.selectLargestBarcode=function(e){for(var r=null,o=0,l=0,u=e;l<u.length;l++){var h=u[l],x=h.boundingBox.width*h.boundingBox.height;x>o&&(o=x,r=h)}if(!r)throw"No largest barcode found";return r},t.prototype.createBarcodeDetectorFormats=function(e){for(var r=[],o=0,l=e;o<l.length;o++){var u=l[o];this.formatMap.has(u)?r.push(this.formatMap.get(u)):this.logger.warn("".concat(u," is not supported by")+"BarcodeDetectorDelegate")}return{formats:r}},t.prototype.toHtml5QrcodeSupportedFormats=function(e){if(!this.reverseFormatMap.has(e))throw"reverseFormatMap doesn't have ".concat(e);return this.reverseFormatMap.get(e)},t.prototype.createReverseFormatMap=function(){var e=new Map;return this.formatMap.forEach(function(r,o,l){e.set(r,o)}),e},t.prototype.createDebugData=function(){return{decoderName:"BarcodeDetector"}},t}(),k2=function(t,e,r,o){function l(u){return u instanceof r?u:new r(function(h){h(u)})}return new(r||(r=Promise))(function(u,h){function x(y){try{m(o.next(y))}catch(b){h(b)}}function w(y){try{m(o.throw(y))}catch(b){h(b)}}function m(y){y.done?u(y.value):l(y.value).then(x,w)}m((o=o.apply(t,e||[])).next())})},M2=function(t,e){var r={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,l,u,h;return h={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function x(m){return function(y){return w([m,y])}}function w(m){if(o)throw new TypeError("Generator is already executing.");for(;h&&(h=0,m[0]&&(r=0)),r;)try{if(o=1,l&&(u=m[0]&2?l.return:m[0]?l.throw||((u=l.return)&&u.call(l),0):l.next)&&!(u=u.call(l,m[1])).done)return u;switch(l=0,u&&(m=[m[0]&2,u.value]),m[0]){case 0:case 1:u=m;break;case 4:return r.label++,{value:m[1],done:!1};case 5:r.label++,l=m[1],m=[0];continue;case 7:m=r.ops.pop(),r.trys.pop();continue;default:if(u=r.trys,!(u=u.length>0&&u[u.length-1])&&(m[0]===6||m[0]===2)){r=0;continue}if(m[0]===3&&(!u||m[1]>u[0]&&m[1]<u[3])){r.label=m[1];break}if(m[0]===6&&r.label<u[1]){r.label=u[1],u=m;break}if(u&&r.label<u[2]){r.label=u[2],r.ops.push(m);break}u[2]&&r.ops.pop(),r.trys.pop();continue}m=e.call(t,r)}catch(y){m=[6,y],l=0}finally{o=u=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}},tN=function(){function t(e,r,o,l){this.EXECUTIONS_TO_REPORT_PERFORMANCE=100,this.executions=0,this.executionResults=[],this.wasPrimaryDecoderUsedInLastDecode=!1,this.verbose=o,r&&O2.isSupported()?(this.primaryDecoder=new O2(e,o,l),this.secondaryDecoder=new N2(e,o,l)):this.primaryDecoder=new N2(e,o,l)}return t.prototype.decodeAsync=function(e){return k2(this,void 0,void 0,function(){var r;return M2(this,function(o){switch(o.label){case 0:r=performance.now(),o.label=1;case 1:return o.trys.push([1,,3,4]),[4,this.getDecoder().decodeAsync(e)];case 2:return[2,o.sent()];case 3:return this.possiblyLogPerformance(r),[7];case 4:return[2]}})})},t.prototype.decodeRobustlyAsync=function(e){return k2(this,void 0,void 0,function(){var r,o;return M2(this,function(l){switch(l.label){case 0:r=performance.now(),l.label=1;case 1:return l.trys.push([1,3,4,5]),[4,this.primaryDecoder.decodeAsync(e)];case 2:return[2,l.sent()];case 3:if(o=l.sent(),this.secondaryDecoder)return[2,this.secondaryDecoder.decodeAsync(e)];throw o;case 4:return this.possiblyLogPerformance(r),[7];case 5:return[2]}})})},t.prototype.getDecoder=function(){return this.secondaryDecoder?this.wasPrimaryDecoderUsedInLastDecode===!1?(this.wasPrimaryDecoderUsedInLastDecode=!0,this.primaryDecoder):(this.wasPrimaryDecoderUsedInLastDecode=!1,this.secondaryDecoder):this.primaryDecoder},t.prototype.possiblyLogPerformance=function(e){if(this.verbose){var r=performance.now()-e;this.executionResults.push(r),this.executions++,this.possiblyFlushPerformanceReport()}},t.prototype.possiblyFlushPerformanceReport=function(){if(!(this.executions<this.EXECUTIONS_TO_REPORT_PERFORMANCE)){for(var e=0,r=0,o=this.executionResults;r<o.length;r++){var l=o[r];e+=l}var u=e/this.executionResults.length;console.log("".concat(u," ms for ").concat(this.executionResults.length," last runs.")),this.executions=0,this.executionResults=[]}},t}(),q0=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,l){o.__proto__=l}||function(o,l){for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(o[u]=l[u])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function o(){this.constructor=e}e.prototype=r===null?Object.create(r):(o.prototype=r.prototype,new o)}}(),pc=function(t,e,r,o){function l(u){return u instanceof r?u:new r(function(h){h(u)})}return new(r||(r=Promise))(function(u,h){function x(y){try{m(o.next(y))}catch(b){h(b)}}function w(y){try{m(o.throw(y))}catch(b){h(b)}}function m(y){y.done?u(y.value):l(y.value).then(x,w)}m((o=o.apply(t,e||[])).next())})},mc=function(t,e){var r={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,l,u,h;return h={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function x(m){return function(y){return w([m,y])}}function w(m){if(o)throw new TypeError("Generator is already executing.");for(;h&&(h=0,m[0]&&(r=0)),r;)try{if(o=1,l&&(u=m[0]&2?l.return:m[0]?l.throw||((u=l.return)&&u.call(l),0):l.next)&&!(u=u.call(l,m[1])).done)return u;switch(l=0,u&&(m=[m[0]&2,u.value]),m[0]){case 0:case 1:u=m;break;case 4:return r.label++,{value:m[1],done:!1};case 5:r.label++,l=m[1],m=[0];continue;case 7:m=r.ops.pop(),r.trys.pop();continue;default:if(u=r.trys,!(u=u.length>0&&u[u.length-1])&&(m[0]===6||m[0]===2)){r=0;continue}if(m[0]===3&&(!u||m[1]>u[0]&&m[1]<u[3])){r.label=m[1];break}if(m[0]===6&&r.label<u[1]){r.label=u[1],u=m;break}if(u&&r.label<u[2]){r.label=u[2],r.ops.push(m);break}u[2]&&r.ops.pop(),r.trys.pop();continue}m=e.call(t,r)}catch(y){m=[6,y],l=0}finally{o=u=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}},Ny=function(){function t(e,r){this.name=e,this.track=r}return t.prototype.isSupported=function(){return this.track.getCapabilities?this.name in this.track.getCapabilities():!1},t.prototype.apply=function(e){var r={};r[this.name]=e;var o={advanced:[r]};return this.track.applyConstraints(o)},t.prototype.value=function(){var e=this.track.getSettings();if(this.name in e){var r=e[this.name];return r}return null},t}(),rN=function(t){q0(e,t);function e(r,o){return t.call(this,r,o)||this}return e.prototype.min=function(){return this.getCapabilities().min},e.prototype.max=function(){return this.getCapabilities().max},e.prototype.step=function(){return this.getCapabilities().step},e.prototype.apply=function(r){var o={};o[this.name]=r;var l={advanced:[o]};return this.track.applyConstraints(l)},e.prototype.getCapabilities=function(){this.failIfNotSupported();var r=this.track.getCapabilities(),o=r[this.name];return{min:o.min,max:o.max,step:o.step}},e.prototype.failIfNotSupported=function(){if(!this.isSupported())throw new Error("".concat(this.name," capability not supported"))},e}(Ny),nN=function(t){q0(e,t);function e(r){return t.call(this,"zoom",r)||this}return e}(rN),iN=function(t){q0(e,t);function e(r){return t.call(this,"torch",r)||this}return e}(Ny),sN=function(){function t(e){this.track=e}return t.prototype.zoomFeature=function(){return new nN(this.track)},t.prototype.torchFeature=function(){return new iN(this.track)},t}(),oN=function(){function t(e,r,o){this.isClosed=!1,this.parentElement=e,this.mediaStream=r,this.callbacks=o,this.surface=this.createVideoElement(this.parentElement.clientWidth),e.append(this.surface)}return t.prototype.createVideoElement=function(e){var r=document.createElement("video");return r.style.width="".concat(e,"px"),r.style.display="block",r.muted=!0,r.setAttribute("muted","true"),r.playsInline=!0,r},t.prototype.setupSurface=function(){var e=this;this.surface.onabort=function(){throw"RenderedCameraImpl video surface onabort() called"},this.surface.onerror=function(){throw"RenderedCameraImpl video surface onerror() called"};var r=function(){var o=e.surface.clientWidth,l=e.surface.clientHeight;e.callbacks.onRenderSurfaceReady(o,l),e.surface.removeEventListener("playing",r)};this.surface.addEventListener("playing",r),this.surface.srcObject=this.mediaStream,this.surface.play()},t.create=function(e,r,o,l){return pc(this,void 0,void 0,function(){var u,h;return mc(this,function(x){switch(x.label){case 0:return u=new t(e,r,l),o.aspectRatio?(h={aspectRatio:o.aspectRatio},[4,u.getFirstTrackOrFail().applyConstraints(h)]):[3,2];case 1:x.sent(),x.label=2;case 2:return u.setupSurface(),[2,u]}})})},t.prototype.failIfClosed=function(){if(this.isClosed)throw"The RenderedCamera has already been closed."},t.prototype.getFirstTrackOrFail=function(){if(this.failIfClosed(),this.mediaStream.getVideoTracks().length===0)throw"No video tracks found";return this.mediaStream.getVideoTracks()[0]},t.prototype.pause=function(){this.failIfClosed(),this.surface.pause()},t.prototype.resume=function(e){this.failIfClosed();var r=this,o=function(){setTimeout(e,200),r.surface.removeEventListener("playing",o)};this.surface.addEventListener("playing",o),this.surface.play()},t.prototype.isPaused=function(){return this.failIfClosed(),this.surface.paused},t.prototype.getSurface=function(){return this.failIfClosed(),this.surface},t.prototype.getRunningTrackCapabilities=function(){return this.getFirstTrackOrFail().getCapabilities()},t.prototype.getRunningTrackSettings=function(){return this.getFirstTrackOrFail().getSettings()},t.prototype.applyVideoConstraints=function(e){return pc(this,void 0,void 0,function(){return mc(this,function(r){if("aspectRatio"in e)throw"Changing 'aspectRatio' in run-time is not yet supported.";return[2,this.getFirstTrackOrFail().applyConstraints(e)]})})},t.prototype.close=function(){if(this.isClosed)return Promise.resolve();var e=this;return new Promise(function(r,o){var l=e.mediaStream.getVideoTracks(),u=l.length,h=0;e.mediaStream.getVideoTracks().forEach(function(x){e.mediaStream.removeTrack(x),x.stop(),++h,h>=u&&(e.isClosed=!0,e.parentElement.removeChild(e.surface),r())})})},t.prototype.getCapabilities=function(){return new sN(this.getFirstTrackOrFail())},t}(),aN=function(){function t(e){this.mediaStream=e}return t.prototype.render=function(e,r,o){return pc(this,void 0,void 0,function(){return mc(this,function(l){return[2,oN.create(e,this.mediaStream,r,o)]})})},t.create=function(e){return pc(this,void 0,void 0,function(){var r,o;return mc(this,function(l){switch(l.label){case 0:if(!navigator.mediaDevices)throw"navigator.mediaDevices not supported";return r={audio:!1,video:e},[4,navigator.mediaDevices.getUserMedia(r)];case 1:return o=l.sent(),[2,new t(o)]}})})},t}(),D2=function(t,e,r,o){function l(u){return u instanceof r?u:new r(function(h){h(u)})}return new(r||(r=Promise))(function(u,h){function x(y){try{m(o.next(y))}catch(b){h(b)}}function w(y){try{m(o.throw(y))}catch(b){h(b)}}function m(y){y.done?u(y.value):l(y.value).then(x,w)}m((o=o.apply(t,e||[])).next())})},P2=function(t,e){var r={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,l,u,h;return h={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function x(m){return function(y){return w([m,y])}}function w(m){if(o)throw new TypeError("Generator is already executing.");for(;h&&(h=0,m[0]&&(r=0)),r;)try{if(o=1,l&&(u=m[0]&2?l.return:m[0]?l.throw||((u=l.return)&&u.call(l),0):l.next)&&!(u=u.call(l,m[1])).done)return u;switch(l=0,u&&(m=[m[0]&2,u.value]),m[0]){case 0:case 1:u=m;break;case 4:return r.label++,{value:m[1],done:!1};case 5:r.label++,l=m[1],m=[0];continue;case 7:m=r.ops.pop(),r.trys.pop();continue;default:if(u=r.trys,!(u=u.length>0&&u[u.length-1])&&(m[0]===6||m[0]===2)){r=0;continue}if(m[0]===3&&(!u||m[1]>u[0]&&m[1]<u[3])){r.label=m[1];break}if(m[0]===6&&r.label<u[1]){r.label=u[1],u=m;break}if(u&&r.label<u[2]){r.label=u[2],r.ops.push(m);break}u[2]&&r.ops.pop(),r.trys.pop();continue}m=e.call(t,r)}catch(y){m=[6,y],l=0}finally{o=u=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}},lN=function(){function t(){}return t.failIfNotSupported=function(){return D2(this,void 0,void 0,function(){return P2(this,function(e){if(!navigator.mediaDevices)throw"navigator.mediaDevices not supported";return[2,new t]})})},t.prototype.create=function(e){return D2(this,void 0,void 0,function(){return P2(this,function(r){return[2,aN.create(e)]})})},t}(),cN=function(t,e,r,o){function l(u){return u instanceof r?u:new r(function(h){h(u)})}return new(r||(r=Promise))(function(u,h){function x(y){try{m(o.next(y))}catch(b){h(b)}}function w(y){try{m(o.throw(y))}catch(b){h(b)}}function m(y){y.done?u(y.value):l(y.value).then(x,w)}m((o=o.apply(t,e||[])).next())})},uN=function(t,e){var r={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,l,u,h;return h={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function x(m){return function(y){return w([m,y])}}function w(m){if(o)throw new TypeError("Generator is already executing.");for(;h&&(h=0,m[0]&&(r=0)),r;)try{if(o=1,l&&(u=m[0]&2?l.return:m[0]?l.throw||((u=l.return)&&u.call(l),0):l.next)&&!(u=u.call(l,m[1])).done)return u;switch(l=0,u&&(m=[m[0]&2,u.value]),m[0]){case 0:case 1:u=m;break;case 4:return r.label++,{value:m[1],done:!1};case 5:r.label++,l=m[1],m=[0];continue;case 7:m=r.ops.pop(),r.trys.pop();continue;default:if(u=r.trys,!(u=u.length>0&&u[u.length-1])&&(m[0]===6||m[0]===2)){r=0;continue}if(m[0]===3&&(!u||m[1]>u[0]&&m[1]<u[3])){r.label=m[1];break}if(m[0]===6&&r.label<u[1]){r.label=u[1],u=m;break}if(u&&r.label<u[2]){r.label=u[2],r.ops.push(m);break}u[2]&&r.ops.pop(),r.trys.pop();continue}m=e.call(t,r)}catch(y){m=[6,y],l=0}finally{o=u=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}},fN=function(){function t(){}return t.retrieve=function(){if(navigator.mediaDevices)return t.getCamerasFromMediaDevices();var e=MediaStreamTrack;return MediaStreamTrack&&e.getSources?t.getCamerasFromMediaStreamTrack():t.rejectWithError()},t.rejectWithError=function(){var e=gs.unableToQuerySupportedDevices();return t.isHttpsOrLocalhost()||(e=gs.insecureContextCameraQueryError()),Promise.reject(e)},t.isHttpsOrLocalhost=function(){if(location.protocol==="https:")return!0;var e=location.host.split(":")[0];return e==="127.0.0.1"||e==="localhost"},t.getCamerasFromMediaDevices=function(){return cN(this,void 0,void 0,function(){var e,r,o,l,u,h,x;return uN(this,function(w){switch(w.label){case 0:return e=function(m){for(var y=m.getVideoTracks(),b=0,C=y;b<C.length;b++){var T=C[b];T.enabled=!1,T.stop(),m.removeTrack(T)}},[4,navigator.mediaDevices.getUserMedia({audio:!1,video:!0})];case 1:return r=w.sent(),[4,navigator.mediaDevices.enumerateDevices()];case 2:for(o=w.sent(),l=[],u=0,h=o;u<h.length;u++)x=h[u],x.kind==="videoinput"&&l.push({id:x.deviceId,label:x.label});return e(r),[2,l]}})})},t.getCamerasFromMediaStreamTrack=function(){return new Promise(function(e,r){var o=function(u){for(var h=[],x=0,w=u;x<w.length;x++){var m=w[x];m.kind==="video"&&h.push({id:m.id,label:m.label})}e(h)},l=MediaStreamTrack;l.getSources(o)})},t}(),ot;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.NOT_STARTED=1]="NOT_STARTED",t[t.SCANNING=2]="SCANNING",t[t.PAUSED=3]="PAUSED"})(ot||(ot={}));var dN=function(){function t(){this.state=ot.NOT_STARTED,this.onGoingTransactionNewState=ot.UNKNOWN}return t.prototype.directTransition=function(e){this.failIfTransitionOngoing(),this.validateTransition(e),this.state=e},t.prototype.startTransition=function(e){return this.failIfTransitionOngoing(),this.validateTransition(e),this.onGoingTransactionNewState=e,this},t.prototype.execute=function(){if(this.onGoingTransactionNewState===ot.UNKNOWN)throw"Transaction is already cancelled, cannot execute().";var e=this.onGoingTransactionNewState;this.onGoingTransactionNewState=ot.UNKNOWN,this.directTransition(e)},t.prototype.cancel=function(){if(this.onGoingTransactionNewState===ot.UNKNOWN)throw"Transaction is already cancelled, cannot cancel().";this.onGoingTransactionNewState=ot.UNKNOWN},t.prototype.getState=function(){return this.state},t.prototype.failIfTransitionOngoing=function(){if(this.onGoingTransactionNewState!==ot.UNKNOWN)throw"Cannot transition to a new state, already under transition"},t.prototype.validateTransition=function(e){switch(this.state){case ot.UNKNOWN:throw"Transition from unknown is not allowed";case ot.NOT_STARTED:this.failIfNewStateIs(e,[ot.PAUSED]);break;case ot.SCANNING:break;case ot.PAUSED:break}},t.prototype.failIfNewStateIs=function(e,r){for(var o=0,l=r;o<l.length;o++){var u=l[o];if(e===u)throw"Cannot transition from ".concat(this.state," to ").concat(e)}},t}(),hN=function(){function t(e){this.stateManager=e}return t.prototype.startTransition=function(e){return this.stateManager.startTransition(e)},t.prototype.directTransition=function(e){this.stateManager.directTransition(e)},t.prototype.getState=function(){return this.stateManager.getState()},t.prototype.canScanFile=function(){return this.stateManager.getState()===ot.NOT_STARTED},t.prototype.isScanning=function(){return this.stateManager.getState()!==ot.NOT_STARTED},t.prototype.isStrictlyScanning=function(){return this.stateManager.getState()===ot.SCANNING},t.prototype.isPaused=function(){return this.stateManager.getState()===ot.PAUSED},t}(),gN=function(){function t(){}return t.create=function(){return new hN(new dN)},t}(),pN=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,l){o.__proto__=l}||function(o,l){for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(o[u]=l[u])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function o(){this.constructor=e}e.prototype=r===null?Object.create(r):(o.prototype=r.prototype,new o)}}(),dr=function(t){pN(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.DEFAULT_WIDTH=300,e.DEFAULT_WIDTH_OFFSET=2,e.FILE_SCAN_MIN_HEIGHT=300,e.FILE_SCAN_HIDDEN_CANVAS_PADDING=100,e.MIN_QR_BOX_SIZE=50,e.SHADED_LEFT=1,e.SHADED_RIGHT=2,e.SHADED_TOP=3,e.SHADED_BOTTOM=4,e.SHADED_REGION_ELEMENT_ID="qr-shaded-region",e.VERBOSE=!1,e.BORDER_SHADER_DEFAULT_COLOR="#ffffff",e.BORDER_SHADER_MATCH_COLOR="rgb(90, 193, 56)",e}(K_),mN=function(){function t(e,r){this.logger=r,this.fps=dr.SCAN_DEFAULT_FPS,e?(e.fps&&(this.fps=e.fps),this.disableFlip=e.disableFlip===!0,this.qrbox=e.qrbox,this.aspectRatio=e.aspectRatio,this.videoConstraints=e.videoConstraints):this.disableFlip=dr.DEFAULT_DISABLE_FLIP}return t.prototype.isMediaStreamConstraintsValid=function(){return this.videoConstraints?_y.isMediaStreamConstraintsValid(this.videoConstraints,this.logger):(this.logger.logError("Empty videoConstraints",!0),!1)},t.prototype.isShadedBoxEnabled=function(){return!dn(this.qrbox)},t.create=function(e,r){return new t(e,r)},t}(),cO=function(){function t(e,r){if(this.element=null,this.canvasElement=null,this.scannerPausedUiElement=null,this.hasBorderShaders=null,this.borderShaders=null,this.qrMatch=null,this.renderedCamera=null,this.qrRegion=null,this.context=null,this.lastScanImageFile=null,this.isScanning=!1,!document.getElementById(e))throw"HTML Element with id=".concat(e," not found");this.elementId=e,this.verbose=!1;var o;typeof r=="boolean"?this.verbose=r===!0:r&&(o=r,this.verbose=o.verbose===!0,o.experimentalFeatures),this.logger=new Q_(this.verbose),this.qrcode=new tN(this.getSupportedFormats(r),this.getUseBarCodeDetectorIfSupported(o),this.verbose,this.logger),this.foreverScanTimeout,this.shouldScan=!0,this.stateManagerProxy=gN.create()}return t.prototype.start=function(e,r,o,l){var u=this;if(!e)throw"cameraIdOrConfig is required";if(!o||typeof o!="function")throw"qrCodeSuccessCallback is required and should be a function.";var h;l?h=l:h=this.verbose?this.logger.log:function(){};var x=mN.create(r,this.logger);this.clearElement();var w=!1;x.videoConstraints&&(x.isMediaStreamConstraintsValid()?w=!0:this.logger.logError("'videoConstraints' is not valid 'MediaStreamConstraints, it will be ignored.'",!0));var m=w,y=document.getElementById(this.elementId);y.clientWidth?y.clientWidth:dr.DEFAULT_WIDTH,y.style.position="relative",this.shouldScan=!0,this.element=y;var b=this,C=this.stateManagerProxy.startTransition(ot.SCANNING);return new Promise(function(T,k){var D=m?x.videoConstraints:b.createVideoConstraints(e);if(!D){C.cancel(),k("videoConstraints should be defined");return}var X={};(!m||x.aspectRatio)&&(X.aspectRatio=x.aspectRatio);var O={onRenderSurfaceReady:function(I,_){b.setupUi(I,_,x),b.isScanning=!0,b.foreverScan(x,o,h)}};lN.failIfNotSupported().then(function(I){I.create(D).then(function(_){return _.render(u.element,X,O).then(function(L){b.renderedCamera=L,C.execute(),T(null)}).catch(function(L){C.cancel(),k(L)})}).catch(function(_){C.cancel(),k(gs.errorGettingUserMedia(_))})}).catch(function(I){C.cancel(),k(gs.cameraStreamingNotSupported())})})},t.prototype.pause=function(e){if(!this.stateManagerProxy.isStrictlyScanning())throw"Cannot pause, scanner is not scanning.";this.stateManagerProxy.directTransition(ot.PAUSED),this.showPausedState(),(dn(e)||e!==!0)&&(e=!1),e&&this.renderedCamera&&this.renderedCamera.pause()},t.prototype.resume=function(){if(!this.stateManagerProxy.isPaused())throw"Cannot result, scanner is not paused.";if(!this.renderedCamera)throw"renderedCamera doesn't exist while trying resume()";var e=this,r=function(){e.stateManagerProxy.directTransition(ot.SCANNING),e.hidePausedState()};if(!this.renderedCamera.isPaused()){r();return}this.renderedCamera.resume(function(){r()})},t.prototype.getState=function(){return this.stateManagerProxy.getState()},t.prototype.stop=function(){var e=this;if(!this.stateManagerProxy.isScanning())throw"Cannot stop, scanner is not running or paused.";var r=this.stateManagerProxy.startTransition(ot.NOT_STARTED);this.shouldScan=!1,this.foreverScanTimeout&&clearTimeout(this.foreverScanTimeout);var o=function(){if(e.element){var u=document.getElementById(dr.SHADED_REGION_ELEMENT_ID);u&&e.element.removeChild(u)}},l=this;return this.renderedCamera.close().then(function(){return l.renderedCamera=null,l.element&&(l.element.removeChild(l.canvasElement),l.canvasElement=null),o(),l.qrRegion&&(l.qrRegion=null),l.context&&(l.context=null),r.execute(),l.hidePausedState(),l.isScanning=!1,Promise.resolve()})},t.prototype.scanFile=function(e,r){return this.scanFileV2(e,r).then(function(o){return o.decodedText})},t.prototype.scanFileV2=function(e,r){var o=this;if(!e||!(e instanceof File))throw"imageFile argument is mandatory and should be instance of File. Use 'event.target.files[0]'.";if(dn(r)&&(r=!0),!this.stateManagerProxy.canScanFile())throw"Cannot start file scan - ongoing camera scan";return new Promise(function(l,u){o.possiblyCloseLastScanImageFile(),o.clearElement(),o.lastScanImageFile=URL.createObjectURL(e);var h=new Image;h.onload=function(){var x=h.width,w=h.height,m=document.getElementById(o.elementId),y=m.clientWidth?m.clientWidth:dr.DEFAULT_WIDTH,b=Math.max(m.clientHeight?m.clientHeight:w,dr.FILE_SCAN_MIN_HEIGHT),C=o.computeCanvasDrawConfig(x,w,y,b);if(r){var T=o.createCanvasElement(y,b,"qr-canvas-visible");T.style.display="inline-block",m.appendChild(T);var k=T.getContext("2d");if(!k)throw"Unable to get 2d context from canvas";k.canvas.width=y,k.canvas.height=b,k.drawImage(h,0,0,x,w,C.x,C.y,C.width,C.height)}var D=dr.FILE_SCAN_HIDDEN_CANVAS_PADDING,X=Math.max(h.width,C.width),O=Math.max(h.height,C.height),I=X+2*D,_=O+2*D,L=o.createCanvasElement(I,_);m.appendChild(L);var j=L.getContext("2d");if(!j)throw"Unable to get 2d context from canvas";j.canvas.width=I,j.canvas.height=_,j.drawImage(h,0,0,x,w,D,D,X,O);try{o.qrcode.decodeRobustlyAsync(L).then(function(U){l(_2.createFromQrcodeResult(U))}).catch(u)}catch(U){u("QR code parse error, error = ".concat(U))}},h.onerror=u,h.onabort=u,h.onstalled=u,h.onsuspend=u,h.src=URL.createObjectURL(e)})},t.prototype.clear=function(){this.clearElement()},t.getCameras=function(){return fN.retrieve()},t.prototype.getRunningTrackCapabilities=function(){return this.getRenderedCameraOrFail().getRunningTrackCapabilities()},t.prototype.getRunningTrackSettings=function(){return this.getRenderedCameraOrFail().getRunningTrackSettings()},t.prototype.getRunningTrackCameraCapabilities=function(){return this.getRenderedCameraOrFail().getCapabilities()},t.prototype.applyVideoConstraints=function(e){if(e){if(!_y.isMediaStreamConstraintsValid(e,this.logger))throw"invalid videoConstaints passed, check logs for more details"}else throw"videoConstaints is required argument.";return this.getRenderedCameraOrFail().applyVideoConstraints(e)},t.prototype.getRenderedCameraOrFail=function(){if(this.renderedCamera==null)throw"Scanning is not in running state, call this API only when QR code scanning using camera is in running state.";return this.renderedCamera},t.prototype.getSupportedFormats=function(e){var r=[oe.QR_CODE,oe.AZTEC,oe.CODABAR,oe.CODE_39,oe.CODE_93,oe.CODE_128,oe.DATA_MATRIX,oe.MAXICODE,oe.ITF,oe.EAN_13,oe.EAN_8,oe.PDF_417,oe.RSS_14,oe.RSS_EXPANDED,oe.UPC_A,oe.UPC_E,oe.UPC_EAN_EXTENSION];if(!e||typeof e=="boolean"||!e.formatsToSupport)return r;if(!Array.isArray(e.formatsToSupport))throw"configOrVerbosityFlag.formatsToSupport should be undefined or an array.";if(e.formatsToSupport.length===0)throw"Atleast 1 formatsToSupport is needed.";for(var o=[],l=0,u=e.formatsToSupport;l<u.length;l++){var h=u[l];Y_(h)?o.push(h):this.logger.warn("Invalid format: ".concat(h," passed in config, ignoring."))}if(o.length===0)throw"None of formatsToSupport match supported values.";return o},t.prototype.getUseBarCodeDetectorIfSupported=function(e){if(dn(e))return!0;if(!dn(e.useBarCodeDetectorIfSupported))return e.useBarCodeDetectorIfSupported!==!1;if(dn(e.experimentalFeatures))return!0;var r=e.experimentalFeatures;return dn(r.useBarCodeDetectorIfSupported)?!0:r.useBarCodeDetectorIfSupported!==!1},t.prototype.validateQrboxSize=function(e,r,o){var l=this,u=o.qrbox;this.validateQrboxConfig(u);var h=this.toQrdimensions(e,r,u),x=function(m){if(m<dr.MIN_QR_BOX_SIZE)throw"minimum size of 'config.qrbox' dimension value is"+" ".concat(dr.MIN_QR_BOX_SIZE,"px.")},w=function(m){return m>e&&(l.logger.warn("`qrbox.width` or `qrbox` is larger than the width of the root element. The width will be truncated to the width of root element."),m=e),m};x(h.width),x(h.height),h.width=w(h.width)},t.prototype.validateQrboxConfig=function(e){if(typeof e!="number"&&typeof e!="function"&&(e.width===void 0||e.height===void 0))throw"Invalid instance of QrDimensions passed for 'config.qrbox'. Both 'width' and 'height' should be set."},t.prototype.toQrdimensions=function(e,r,o){if(typeof o=="number")return{width:o,height:o};if(typeof o=="function")try{return o(e,r)}catch(l){throw new Error("qrbox config was passed as a function but it failed with unknown error"+l)}return o},t.prototype.setupUi=function(e,r,o){o.isShadedBoxEnabled()&&this.validateQrboxSize(e,r,o);var l=dn(o.qrbox)?{width:e,height:r}:o.qrbox;this.validateQrboxConfig(l);var u=this.toQrdimensions(e,r,l);u.height>r&&this.logger.warn("[Html5Qrcode] config.qrbox has height that isgreater than the height of the video stream. Shading will be ignored");var h=o.isShadedBoxEnabled()&&u.height<=r,x={x:0,y:0,width:e,height:r},w=h?this.getShadedRegionBounds(e,r,u):x,m=this.createCanvasElement(w.width,w.height),y={willReadFrequently:!0},b=m.getContext("2d",y);b.canvas.width=w.width,b.canvas.height=w.height,this.element.append(m),h&&this.possiblyInsertShadingElement(this.element,e,r,u),this.createScannerPausedUiElement(this.element),this.qrRegion=w,this.context=b,this.canvasElement=m},t.prototype.createScannerPausedUiElement=function(e){var r=document.createElement("div");r.innerText=gs.scannerPaused(),r.style.display="none",r.style.position="absolute",r.style.top="0px",r.style.zIndex="1",r.style.background="rgba(9, 9, 9, 0.46)",r.style.color="#FFECEC",r.style.textAlign="center",r.style.width="100%",e.appendChild(r),this.scannerPausedUiElement=r},t.prototype.scanContext=function(e,r){var o=this;return this.stateManagerProxy.isPaused()?Promise.resolve(!1):this.qrcode.decodeAsync(this.canvasElement).then(function(l){return e(l.text,_2.createFromQrcodeResult(l)),o.possiblyUpdateShaders(!0),!0}).catch(function(l){o.possiblyUpdateShaders(!1);var u=gs.codeParseError(l);return r(u,Z_.createFrom(u)),!1})},t.prototype.foreverScan=function(e,r,o){var l=this;if(this.shouldScan&&this.renderedCamera){var u=this.renderedCamera.getSurface(),h=u.videoWidth/u.clientWidth,x=u.videoHeight/u.clientHeight;if(!this.qrRegion)throw"qrRegion undefined when localMediaStream is ready.";var w=this.qrRegion.width*h,m=this.qrRegion.height*x,y=this.qrRegion.x*h,b=this.qrRegion.y*x;this.context.drawImage(u,y,b,w,m,0,0,this.qrRegion.width,this.qrRegion.height);var C=function(){l.foreverScanTimeout=setTimeout(function(){l.foreverScan(e,r,o)},l.getTimeoutFps(e.fps))};this.scanContext(r,o).then(function(T){!T&&e.disableFlip!==!0?(l.context.translate(l.context.canvas.width,0),l.context.scale(-1,1),l.scanContext(r,o).finally(function(){C()})):C()}).catch(function(T){l.logger.logError("Error happend while scanning context",T),C()})}},t.prototype.createVideoConstraints=function(e){if(typeof e=="string")return{deviceId:{exact:e}};if(typeof e=="object"){var r="facingMode",o="deviceId",l={user:!0,environment:!0},u="exact",h=function(k){if(k in l)return!0;throw"config has invalid 'facingMode' value = "+"'".concat(k,"'")},x=Object.keys(e);if(x.length!==1)throw"'cameraIdOrConfig' object should have exactly 1 key,"+" if passed as an object, found ".concat(x.length," keys");var w=Object.keys(e)[0];if(w!==r&&w!==o)throw"Only '".concat(r,"' and '").concat(o,"' ")+" are supported for 'cameraIdOrConfig'";if(w===r){var m=e.facingMode;if(typeof m=="string"){if(h(m))return{facingMode:m}}else if(typeof m=="object")if(u in m){if(h(m["".concat(u)]))return{facingMode:{exact:m["".concat(u)]}}}else throw"'facingMode' should be string or object with"+" ".concat(u," as key.");else{var y=typeof m;throw"Invalid type of 'facingMode' = ".concat(y)}}else{var b=e.deviceId;if(typeof b=="string")return{deviceId:b};if(typeof b=="object"){if(u in b)return{deviceId:{exact:b["".concat(u)]}};throw"'deviceId' should be string or object with"+" ".concat(u," as key.")}else{var C=typeof b;throw"Invalid type of 'deviceId' = ".concat(C)}}}var T=typeof e;throw"Invalid type of 'cameraIdOrConfig' = ".concat(T)},t.prototype.computeCanvasDrawConfig=function(e,r,o,l){if(e<=o&&r<=l){var u=(o-e)/2,h=(l-r)/2;return{x:u,y:h,width:e,height:r}}else{var x=e,w=r;return e>o&&(r=o/e*r,e=o),r>l&&(e=l/r*e,r=l),this.logger.log("Image downsampled from "+"".concat(x,"X").concat(w)+" to ".concat(e,"X").concat(r,".")),this.computeCanvasDrawConfig(e,r,o,l)}},t.prototype.clearElement=function(){if(this.stateManagerProxy.isScanning())throw"Cannot clear while scan is ongoing, close it first.";var e=document.getElementById(this.elementId);e&&(e.innerHTML="")},t.prototype.possiblyUpdateShaders=function(e){this.qrMatch!==e&&(this.hasBorderShaders&&this.borderShaders&&this.borderShaders.length&&this.borderShaders.forEach(function(r){r.style.backgroundColor=e?dr.BORDER_SHADER_MATCH_COLOR:dr.BORDER_SHADER_DEFAULT_COLOR}),this.qrMatch=e)},t.prototype.possiblyCloseLastScanImageFile=function(){this.lastScanImageFile&&(URL.revokeObjectURL(this.lastScanImageFile),this.lastScanImageFile=null)},t.prototype.createCanvasElement=function(e,r,o){var l=e,u=r,h=document.createElement("canvas");return h.style.width="".concat(l,"px"),h.style.height="".concat(u,"px"),h.style.display="none",h.id=dn(o)?"qr-canvas":o,h},t.prototype.getShadedRegionBounds=function(e,r,o){if(o.width>e||o.height>r)throw"'config.qrbox' dimensions should not be greater than the dimensions of the root HTML element.";return{x:(e-o.width)/2,y:(r-o.height)/2,width:o.width,height:o.height}},t.prototype.possiblyInsertShadingElement=function(e,r,o,l){if(!(r-l.width<1||o-l.height<1)){var u=document.createElement("div");u.style.position="absolute";var h=(r-l.width)/2,x=(o-l.height)/2;if(u.style.borderLeft="".concat(h,"px solid rgba(0, 0, 0, 0.48)"),u.style.borderRight="".concat(h,"px solid rgba(0, 0, 0, 0.48)"),u.style.borderTop="".concat(x,"px solid rgba(0, 0, 0, 0.48)"),u.style.borderBottom="".concat(x,"px solid rgba(0, 0, 0, 0.48)"),u.style.boxSizing="border-box",u.style.top="0px",u.style.bottom="0px",u.style.left="0px",u.style.right="0px",u.id="".concat(dr.SHADED_REGION_ELEMENT_ID),r-l.width<11||o-l.height<11)this.hasBorderShaders=!1;else{var w=5,m=40;this.insertShaderBorders(u,m,w,-w,null,0,!0),this.insertShaderBorders(u,m,w,-w,null,0,!1),this.insertShaderBorders(u,m,w,null,-w,0,!0),this.insertShaderBorders(u,m,w,null,-w,0,!1),this.insertShaderBorders(u,w,m+w,-w,null,-w,!0),this.insertShaderBorders(u,w,m+w,null,-w,-w,!0),this.insertShaderBorders(u,w,m+w,-w,null,-w,!1),this.insertShaderBorders(u,w,m+w,null,-w,-w,!1),this.hasBorderShaders=!0}e.append(u)}},t.prototype.insertShaderBorders=function(e,r,o,l,u,h,x){var w=document.createElement("div");w.style.position="absolute",w.style.backgroundColor=dr.BORDER_SHADER_DEFAULT_COLOR,w.style.width="".concat(r,"px"),w.style.height="".concat(o,"px"),l!==null&&(w.style.top="".concat(l,"px")),u!==null&&(w.style.bottom="".concat(u,"px")),x?w.style.left="".concat(h,"px"):w.style.right="".concat(h,"px"),this.borderShaders||(this.borderShaders=[]),this.borderShaders.push(w),e.appendChild(w)},t.prototype.showPausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="block"},t.prototype.hidePausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="none"},t.prototype.getTimeoutFps=function(e){return 1e3/e},t}(),L2;(function(t){t[t.STATUS_DEFAULT=0]="STATUS_DEFAULT",t[t.STATUS_SUCCESS=1]="STATUS_SUCCESS",t[t.STATUS_WARNING=2]="STATUS_WARNING",t[t.STATUS_REQUESTING_PERMISSION=3]="STATUS_REQUESTING_PERMISSION"})(L2||(L2={}));var id;(function(t){t[t.BACK=1]="BACK",t[t.FRONT=2]="FRONT"})(id||(id={}));var sd;(function(t){t[t.PORTRAIT=1]="PORTRAIT",t[t.LANDSCAPE=2]="LANDSCAPE",t[t.ADAPTIVE=3]="ADAPTIVE"})(sd||(sd={}));var od;(function(t){t[t.ALL=17]="ALL"})(od||(od={}));const xN=Object.assign(Object.assign({},oe),od);var B2;(function(t){t.ZXING="zxing",t.MLKIT="mlkit"})(B2||(B2={}));const wN=[{selector:".scanner-container-display",css:"display: block;"},{selector:".scanner-dialog",css:"display: none; position: fixed; z-index: 999; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.4);"},{selector:".scanner-dialog-inner",css:"background-color: #fefefe; margin: 2% auto; padding: 20px; border: 1px solid #888; width: 96%;"},{selector:".close-button",css:"color: #aaa; float: right; font-size: 28px; font-weight: bold; cursor: pointer;"},{selector:".close-button:hover",css:"color: #222;"},{selector:".scanner-container-full-width",css:"width: 100%;"}];function vN(t){const e="custom-style-os-cap-barcode";let r=document.getElementById(e);if(r||(r=document.createElement("style"),r.type="text/css",r.id=e,document.head.appendChild(r)),r.sheet){for(;r.sheet.cssRules.length;)r.sheet.deleteRule(0);for(const{selector:o,css:l}of t)r.sheet.insertRule(`${o} { ${l} }`)}else{r.textContent="";for(const{selector:o,css:l}of t)r.textContent+=`${o} { ${l} }`}}const yN=Ui("CapacitorBarcodeScanner",{web:()=>(vN(wN),Br(()=>import("./web-Qg6ZVe1T.js"),[],import.meta.url).then(t=>new t.CapacitorBarcodeScannerWeb))});class EN{static async scanBarcode(e){return e.scanInstructions=e.scanInstructions||" ",e.scanButton=e.scanButton||!1,e.scanText=e.scanText||" ",e.cameraDirection=e.cameraDirection||id.BACK,e.scanOrientation=e.scanOrientation||sd.ADAPTIVE,yN.scanBarcode(e)}}const Ff=Ui("SecureStoragePlugin",{web:()=>Br(()=>import("./web-BdMHTzmo.js"),[],import.meta.url).then(t=>new t.SecureStoragePluginWeb)});function AN(t){try{if(t.length>2048)throw new Error;if(!t.startsWith("{")){const l=new URL(t);if(!["http:","https:"].includes(l.protocol)||l.username||l.password||l.pathname!=="/pair"||l.search||!/^#pair=[A-Za-z0-9_-]{43}$/.test(l.hash))throw new Error;const u=ln.parse(l.origin);if(!u)throw new Error;return{endpoint:u,grant:l.hash.slice(6)}}const e=JSON.parse(t);if(e.type!=="agentroam-pair"||e.version!==1||typeof e.server!="string"||typeof e.grant!="string"||!/^[A-Za-z0-9_-]{43}$/.test(e.grant))throw new Error;const r=new URL(e.server);if(r.username||r.password||r.search||r.hash||r.pathname!=="/")throw new Error;const o=ln.parse(e.server);if(!o)throw new Error;return{endpoint:o,grant:e.grant}}catch{throw new Error("这不是 AgentRoam 授权二维码,请扫描电脑终端上新生成的二维码。")}}class Oy{ready(){if(!Di.isNativePlatform())throw new Error("请在 AgentRoam App 中扫码连接。")}async get(e){this.ready();try{return(await Ff.get({key:`agentroam-device:${e}`})).value}catch(r){if(String(r).includes("does not exist"))return null;throw new Error("无法读取设备凭证,请重试。")}}async set(e,r){this.ready(),await Ff.set({key:`agentroam-device:${e}`,value:r})}async remove(e){this.ready();try{await Ff.remove({key:`agentroam-device:${e}`})}catch(r){if(!String(r).includes("does not exist"))throw r}}}async function ky(){if(!Di.isNativePlatform())throw new Error("请在 AgentRoam App 中使用相机扫码。");try{return(await EN.scanBarcode({hint:xN.QR_CODE,scanInstructions:"扫描电脑上的 AgentRoam 授权二维码",cameraDirection:1})).ScanResult||null}catch(t){if(/cancel/i.test(String(t)))return null;throw new Error("无法打开相机,请在系统设置中允许 AgentRoam 使用相机后重试。")}}class My{constructor(e,r=(...l)=>fetch(...l),o=()=>window.dispatchEvent(new CustomEvent("webapp:unauthorized"))){this.storage=e,this.transport=r,this.onRevoked=o,this.session=null,this.fetch=async(l,u={})=>{const h=this.session,x=new URL(typeof l=="string"?l:l instanceof URL?l.href:l.url),w=new Headers(u.headers??(l instanceof Request?l.headers:void 0));h&&x.origin===h.origin&&w.set("authorization",`Bearer ${h.token}`);const m=await this.transport(l,{...u,headers:w,credentials:"omit",redirect:"error"});if(h&&this.session===h&&x.origin===h.origin&&(m.status===401||m.status===423)){this.session=null;try{await this.storage.remove(h.origin)}finally{this.onRevoked()}}return m}}async resume(e){const r=await this.storage.get(e.url);this.session=r?{origin:e.url,token:r}:null}async pair(e){const{endpoint:r,grant:o}=AN(e),l=new AbortController,u=setTimeout(()=>l.abort(),3e4);let h=null;try{let x;try{x=await this.transport(r.api("/api/pairing/qr-exchange"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant:o,name:"我的 App"}),credentials:"omit",redirect:"error",signal:l.signal}),x.ok&&(h=await x.json())}catch(w){if(w instanceof SyntaxError)throw new Error("服务器返回了无效的设备凭证。");const m=l.signal.aborted||w instanceof Error&&(w.name==="TimeoutError"||w.name==="AbortError"),y=r.url.startsWith("http://")?"请确认手机与电脑在同一网络,并检查电脑防火墙是否允许 AgentRoam 连接。":"请检查手机网络和电脑的远程连接是否可用。";throw new Error(`${m?"连接电脑超时":"无法连接电脑"}(${r.url})。${y}请在电脑上刷新二维码后重新扫码。`)}if(!x.ok)throw new Error(x.status===423?"电脑已锁定远程访问,请先在电脑上解锁。":x.status===410?"二维码已使用或已过期,请在电脑上重新生成。":"扫码连接失败,请检查服务器地址和网络后重试。")}finally{clearTimeout(u)}if(!h||typeof h.token!="string"||!/^[A-Za-z0-9_-]{43}$/.test(h.token))throw new Error("服务器返回了无效的设备凭证。");try{await this.storage.set(r.url,h.token)}catch{throw await this.transport(r.api("/api/pairing/logout"),{method:"POST",headers:{authorization:`Bearer ${h.token}`},credentials:"omit",redirect:"error",signal:AbortSignal.timeout(5e3)}).catch(()=>{}),new Error("无法安全保存设备凭证,请在电脑上重新生成二维码后重试。")}return this.session={origin:r.url,token:h.token},r}async checkAuthorization(){const e=this.session;if(!e)return;const r=await this.fetch(`${e.origin}/api/web-auth/status`,{signal:AbortSignal.timeout(5e3)});if(!r.ok)return;const o=await r.json();if(this.session===e&&(o.locked||o.authenticated===!1)){this.session=null;try{await this.storage.remove(e.origin)}finally{this.onRevoked()}}}}function Dy(t,e,r,o){const l=new URL(e);return(u,h)=>{const x=typeof u=="string"?u:u instanceof URL?u.href:u.url,w=new URL(x,l),m=w.protocol===l.protocol&&w.host===l.host;if(w.pathname.startsWith("/api/")&&(m||w.origin===t)){const y=new URL(w.pathname+w.search,t);return r.fetch(u instanceof Request?new Request(y,u):y,h)}return o(u,h)}}function bN(t,e){const r=new URL(t,"https://agentroam.local");if(r.pathname!=="/app/")throw new Error("Invalid workspace frame path");const o=new URL(e);return o.search=r.search,o.searchParams.set("workspace","1"),o.hash="",o.href}function ad(t){H_(G_(t.url,void 0,Iy())),new gy().save(t)}async function CN(t,e,r,o){t.render(M.jsx(K0,{})),window.__agentroamNativeFrame={origin:e.url,fetch:r.fetch},globalThis.fetch=Dy(e.url,location.href,r,o);const l=async h=>{const x=await r.pair(h);ad(x),location.reload()};j_({origin:e.url,frameUrl:h=>bN(h,location.href),pair:l,scan:async()=>{const h=await ky();h&&await l(h)},switchComputer:async h=>{const x=ln.parse(h);if(!x)throw new Error("电脑地址无效,请重新扫码。");const w=new My(new Oy,o,()=>{});await w.resume(x);const m=await w.fetch(x.api("/api/web-auth/status"),{signal:AbortSignal.timeout(5e3)}),y=m.ok?await m.json():null;if(!(y!=null&&y.authenticated)||y.locked)throw new Error("这台电脑需要重新授权,请点击扫码添加电脑。");ad(x),location.reload()}});const{default:u}=await Br(async()=>{const{default:h}=await import("./page-DyPXAvyj.js").then(x=>x.p);return{default:h}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url);t.render(M.jsx(ie.StrictMode,{children:M.jsx(Ay,{children:M.jsx(u,{})})}))}function SN(){if(window.parent===window||new URLSearchParams(location.search).get("workspace")!=="1")return null;try{const t=new URL(window.parent.location.href);return t.protocol!==location.protocol||t.host!==location.host?null:window.parent.__agentroamNativeFrame??null}catch{return null}}function IN(t){return async(e,r)=>{const o=new Request(e,r);return t.fetch(o.url,{method:o.method,headers:Object.fromEntries(o.headers),body:o.method==="GET"||o.method==="HEAD"?void 0:await o.arrayBuffer(),signal:o.signal,cache:o.cache})}}var xc;(function(t){t.Dark="DARK",t.Light="LIGHT",t.Default="DEFAULT"})(xc||(xc={}));var F2;(function(t){t.None="NONE",t.Slide="SLIDE",t.Fade="FADE"})(F2||(F2={}));const Uf=Ui("StatusBar");function TN(t){const e=/^#([a-f\d]{6})$/i.exec(t.trim());if(!e)return null;const r=[0,2,4].map(l=>{const u=parseInt(e[1].slice(l,l+2),16)/255;return u<=.04045?u/12.92:((u+.055)/1.055)**2.4}),o=.2126*r[0]+.7152*r[1]+.0722*r[2];return{color:`#${e[1]}`,style:o>.179?xc.Light:xc.Dark}}function RN(){if(Di.getPlatform()!=="android")return()=>{};const t=document.documentElement;t.dataset.skin=bi.getState().skin;let e=!1,r=Uf.setOverlaysWebView({overlay:!1}).catch(()=>{});const o=()=>{const h=TN(getComputedStyle(t).getPropertyValue("--bg-deepest"));h&&(r=r.then(async()=>{e||(await Uf.setBackgroundColor({color:h.color}),await Uf.setStyle({style:h.style}))}).catch(()=>{console.warn("Unable to update the Android status bar.")}))},l=new MutationObserver(o);l.observe(t,{attributes:!0,attributeFilter:["data-skin"]});const u=()=>{document.hidden||o()};return document.addEventListener("visibilitychange",u),window.addEventListener("focus",o),o(),()=>{e=!0,l.disconnect(),document.removeEventListener("visibilitychange",u),window.removeEventListener("focus",o)}}const _N="/service-worker.js";function NN(){return typeof window<"u"&&window.isSecureContext===!0&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window}function ON(t){const e="=".repeat((4-t.length%4)%4),r=`${t}${e}`.replace(/-/g,"+").replace(/_/g,"/"),o=atob(r),l=new Uint8Array(new ArrayBuffer(o.length));for(let u=0;u<o.length;u+=1)l[u]=o.charCodeAt(u);return l}async function U2(t){const{publicKey:e}=await t.get("/api/push/vapid");if(!e)return;const r=await navigator.serviceWorker.register(_N),l=await r.pushManager.getSubscription()??await r.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:ON(e)});await t.post("/api/push/subscribe",l.toJSON())}function kN(t){NN()&&(async()=>{try{if(Notification.permission==="granted"){await U2(t);return}if(Notification.permission!=="default")return;const e=()=>{(async()=>{try{await Notification.requestPermission()==="granted"&&await U2(t)}catch{}})()};document.addEventListener("pointerdown",e,{once:!0})}catch{}})()}class jf extends Error{constructor(e,r){super(e),this.name="ParseError",this.type=r.type,this.field=r.field,this.value=r.value,this.line=r.line}}const j2=10,MN=13,pi=32;function Wf(t){}function DN(t){if(typeof t=="function")throw new TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");const{onEvent:e=Wf,onError:r=Wf,onRetry:o=Wf,onComment:l,maxBufferSize:u}=t,h=[];let x=0,w=!0,m,y="",b=0,C,T=!1;function k(j){if(T)throw new Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(w&&(w=!1,j.charCodeAt(0)===239&&j.charCodeAt(1)===187&&j.charCodeAt(2)===191&&(j=j.slice(3))),h.length===0){const Y=X(j);Y!==""&&(h.push(Y),x=Y.length),D();return}if(j.indexOf(`
492
+ `)===-1&&j.indexOf("\r")===-1){h.push(j),x+=j.length,D();return}h.push(j);const U=h.join("");h.length=0,x=0;const F=X(U);F!==""&&(h.push(F),x=F.length),D()}function D(){u!==void 0&&(x+y.length<=u||(T=!0,h.length=0,x=0,m=void 0,y="",b=0,C=void 0,r(new jf(`Buffered data exceeded max buffer size of ${u} characters`,{type:"max-buffer-size-exceeded"}))))}function X(j){let U=0;if(j.indexOf("\r")===-1){let F=j.indexOf(`
493
+ `,U);for(;F!==-1;){if(U===F){b>0&&e({id:m,event:C,data:y}),m=void 0,y="",b=0,C=void 0,U=F+1,F=j.indexOf(`
494
+ `,U);continue}const Y=j.charCodeAt(U);if(W2(j,U,Y)){const $=j.charCodeAt(U+5)===pi?U+6:U+5,se=j.slice($,F);if(b===0&&j.charCodeAt(F+1)===j2){e({id:m,event:C,data:se}),m=void 0,y="",C=void 0,U=F+2,F=j.indexOf(`
495
+ `,U);continue}y=b===0?se:`${y}
496
+ ${se}`,b++}else V2(j,U,Y)?C=j.slice(j.charCodeAt(U+6)===pi?U+7:U+6,F)||void 0:O(j,U,F);U=F+1,F=j.indexOf(`
497
+ `,U)}return j.slice(U)}for(;U<j.length;){const F=j.indexOf("\r",U),Y=j.indexOf(`
498
+ `,U);let $=-1;if(F!==-1&&Y!==-1?$=F<Y?F:Y:F!==-1?F===j.length-1?$=-1:$=F:Y!==-1&&($=Y),$===-1)break;O(j,U,$),U=$+1,j.charCodeAt(U-1)===MN&&j.charCodeAt(U)===j2&&U++}return j.slice(U)}function O(j,U,F){if(U===F){_();return}const Y=j.charCodeAt(U);if(W2(j,U,Y)){const re=j.charCodeAt(U+5)===pi?U+6:U+5,z=j.slice(re,F);y=b===0?z:`${y}
499
+ ${z}`,b++;return}if(V2(j,U,Y)){C=j.slice(j.charCodeAt(U+6)===pi?U+7:U+6,F)||void 0;return}if(Y===105&&j.charCodeAt(U+1)===100&&j.charCodeAt(U+2)===58){const re=j.slice(j.charCodeAt(U+3)===pi?U+4:U+3,F);re.includes("\0")||(m=re);return}if(Y===58){if(l){const re=j.slice(U,F);l(re.slice(j.charCodeAt(U+1)===pi?2:1))}return}const $=j.slice(U,F),se=$.indexOf(":");if(se===-1){I($,"",$);return}const ve=$.slice(0,se),Q=$.charCodeAt(se+1)===pi?2:1,xe=$.slice(se+Q);I(ve,xe,$)}function I(j,U,F){switch(j){case"event":C=U||void 0;break;case"data":y=b===0?U:`${y}
500
+ ${U}`,b++;break;case"id":U.includes("\0")||(m=U);break;case"retry":/^\d+$/.test(U)?o(parseInt(U,10)):r(new jf(`Invalid \`retry\` value: "${U}"`,{type:"invalid-retry",value:U,line:F}));break;default:r(new jf(`Unknown field "${j.length>20?`${j.slice(0,20)}…`:j}"`,{type:"unknown-field",field:j,value:U,line:F}));break}}function _(){b>0&&e({id:m,event:C,data:y}),m=void 0,y="",b=0,C=void 0}function L(j={}){if(j.consume&&h.length>0){const U=h.join("");O(U,0,U.length)}w=!0,m=void 0,y="",b=0,C=void 0,h.length=0,x=0,T=!1}return{feed:k,reset:L}}function W2(t,e,r){return r===100&&t.charCodeAt(e+1)===97&&t.charCodeAt(e+2)===116&&t.charCodeAt(e+3)===97&&t.charCodeAt(e+4)===58}function V2(t,e,r){return r===101&&t.charCodeAt(e+1)===118&&t.charCodeAt(e+2)===101&&t.charCodeAt(e+3)===110&&t.charCodeAt(e+4)===116&&t.charCodeAt(e+5)===58}class z2 extends Event{constructor(e,r){var o,l;super(e),this.code=(o=r==null?void 0:r.code)!=null?o:void 0,this.message=(l=r==null?void 0:r.message)!=null?l:void 0}[Symbol.for("nodejs.util.inspect.custom")](e,r,o){return o($2(this),r)}[Symbol.for("Deno.customInspect")](e,r){return e($2(this),r)}}function PN(t){const e=globalThis.DOMException;return typeof e=="function"?new e(t,"SyntaxError"):new SyntaxError(t)}function ld(t){return t instanceof Error?"errors"in t&&Array.isArray(t.errors)?t.errors.map(ld).join(", "):"cause"in t&&t.cause instanceof Error?`${t}: ${ld(t.cause)}`:t.message:`${t}`}function $2(t){return{type:t.type,message:t.message,code:t.code,defaultPrevented:t.defaultPrevented,cancelable:t.cancelable,timeStamp:t.timeStamp}}var Py=t=>{throw TypeError(t)},J0=(t,e,r)=>e.has(t)||Py("Cannot "+r),be=(t,e,r)=>(J0(t,e,"read from private field"),r?r.call(t):e.get(t)),yt=(t,e,r)=>e.has(t)?Py("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),Ke=(t,e,r,o)=>(J0(t,e,"write to private field"),e.set(t,r),r),hn=(t,e,r)=>(J0(t,e,"access private method"),r),nr,wi,qi,Dl,wc,Mo,ps,Do,Vn,Ji,bs,es,yo,Lr,cd,ud,fd,H2,dd,hd,Eo,gd,pd;let Pl=class extends EventTarget{constructor(e,r){var o,l;super(),yt(this,Lr),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,yt(this,nr),yt(this,wi),yt(this,qi),yt(this,Dl),yt(this,wc),yt(this,Mo),yt(this,ps),yt(this,Do,null),yt(this,Vn),yt(this,Ji),yt(this,bs,null),yt(this,es,null),yt(this,yo,null),yt(this,ud,async u=>{var h;be(this,Ji).reset();const{body:x,redirected:w,status:m,headers:y}=u;if(m===204){hn(this,Lr,Eo).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(w?Ke(this,qi,new URL(u.url)):Ke(this,qi,void 0),m!==200){hn(this,Lr,Eo).call(this,`Non-200 status code (${m})`,m);return}if(!(y.get("content-type")||"").startsWith("text/event-stream")){hn(this,Lr,Eo).call(this,'Invalid content type, expected "text/event-stream"',m);return}if(be(this,nr)===this.CLOSED)return;Ke(this,nr,this.OPEN);const b=new Event("open");if((h=be(this,yo))==null||h.call(this,b),this.dispatchEvent(b),typeof x!="object"||!x||!("getReader"in x)){hn(this,Lr,Eo).call(this,"Invalid response body, expected a web ReadableStream",m),this.close();return}const C=new TextDecoder,T=x.getReader();let k=!0;do{const{done:D,value:X}=await T.read();X&&be(this,Ji).feed(C.decode(X,{stream:!D})),D&&(k=!1,be(this,Ji).reset(),hn(this,Lr,gd).call(this))}while(k)}),yt(this,fd,u=>{Ke(this,Vn,void 0),!(u.name==="AbortError"||u.type==="aborted")&&hn(this,Lr,gd).call(this,ld(u))}),yt(this,dd,u=>{typeof u.id=="string"&&Ke(this,Do,u.id);const h=new MessageEvent(u.event||"message",{data:u.data,origin:be(this,qi)?be(this,qi).origin:be(this,wi).origin,lastEventId:u.id||""});be(this,es)&&(!u.event||u.event==="message")&&be(this,es).call(this,h),this.dispatchEvent(h)}),yt(this,hd,u=>{Ke(this,Mo,u)}),yt(this,pd,()=>{Ke(this,ps,void 0),be(this,nr)===this.CONNECTING&&hn(this,Lr,cd).call(this)});try{if(e instanceof URL)Ke(this,wi,e);else if(typeof e=="string")Ke(this,wi,new URL(e,LN()));else throw new Error("Invalid URL")}catch{throw PN("An invalid or illegal string was specified")}Ke(this,Ji,DN({onEvent:be(this,dd),onRetry:be(this,hd)})),Ke(this,nr,this.CONNECTING),Ke(this,Mo,3e3),Ke(this,wc,(o=r==null?void 0:r.fetch)!=null?o:globalThis.fetch),Ke(this,Dl,(l=r==null?void 0:r.withCredentials)!=null?l:!1),hn(this,Lr,cd).call(this)}get readyState(){return be(this,nr)}get url(){return be(this,wi).href}get withCredentials(){return be(this,Dl)}get onerror(){return be(this,bs)}set onerror(e){Ke(this,bs,e)}get onmessage(){return be(this,es)}set onmessage(e){Ke(this,es,e)}get onopen(){return be(this,yo)}set onopen(e){Ke(this,yo,e)}addEventListener(e,r,o){const l=r;super.addEventListener(e,l,o)}removeEventListener(e,r,o){const l=r;super.removeEventListener(e,l,o)}close(){be(this,ps)&&clearTimeout(be(this,ps)),be(this,nr)!==this.CLOSED&&(be(this,Vn)&&be(this,Vn).abort(),Ke(this,nr,this.CLOSED),Ke(this,Vn,void 0))}};nr=new WeakMap,wi=new WeakMap,qi=new WeakMap,Dl=new WeakMap,wc=new WeakMap,Mo=new WeakMap,ps=new WeakMap,Do=new WeakMap,Vn=new WeakMap,Ji=new WeakMap,bs=new WeakMap,es=new WeakMap,yo=new WeakMap,Lr=new WeakSet,cd=function(){Ke(this,nr,this.CONNECTING),Ke(this,Vn,new AbortController),be(this,wc)(be(this,wi),hn(this,Lr,H2).call(this)).then(be(this,ud)).catch(be(this,fd))},ud=new WeakMap,fd=new WeakMap,H2=function(){var t;const e={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...be(this,Do)?{"Last-Event-ID":be(this,Do)}:void 0},cache:"no-store",signal:(t=be(this,Vn))==null?void 0:t.signal};return"window"in globalThis&&(e.credentials=this.withCredentials?"include":"same-origin"),e},dd=new WeakMap,hd=new WeakMap,Eo=function(t,e){var r;be(this,nr)!==this.CLOSED&&Ke(this,nr,this.CLOSED);const o=new z2("error",{code:e,message:t});(r=be(this,bs))==null||r.call(this,o),this.dispatchEvent(o)},gd=function(t,e){var r;if(be(this,nr)===this.CLOSED)return;Ke(this,nr,this.CONNECTING);const o=new z2("error",{code:e,message:t});(r=be(this,bs))==null||r.call(this,o),this.dispatchEvent(o),Ke(this,ps,setTimeout(be(this,pd),be(this,Mo)))},pd=new WeakMap,Pl.CONNECTING=0,Pl.OPEN=1,Pl.CLOSED=2;function LN(){const t="document"in globalThis?globalThis.document:void 0;return t&&typeof t=="object"&&"baseURI"in t&&typeof t.baseURI=="string"?t.baseURI:void 0}d5();nR();aR();uR();fR();gR();N9({baseUrl:()=>aa,source:"webapp"});document.body.dataset.webShell="1";const eu=new PR,ri=SN(),ia=eu.isNativeApp()||!!ri;ia&&(document.body.dataset.nativeApp="1");RN();if(!eu.isNativeApp()&&window.parent===window){const t=document.createElement("link");t.rel="manifest",t.href="/manifest.webmanifest",document.head.append(t);const e=document.querySelector('link[rel="apple-touch-icon"]');e&&(e.href="/pwa/apple-touch-icon.png");const r=document.createElement("script");r.src="/pwa/install.js",document.head.append(r)}if(window.parent===window){const t=()=>{const e=qg.find(o=>o.id===bi.getState().skin)??qg[0];document.body.style.background=e.preview[0];let r=document.querySelector('meta[name="theme-color"]');r||(r=document.createElement("meta"),r.name="theme-color",document.head.append(r)),r.content=e.preview[0]};t(),bi.subscribe(t)}const tu=globalThis.fetch.bind(globalThis),gt=eu.isNativeApp()&&!ri?new My(new Oy,tu):null,sa=ri?IN(ri):gt==null?void 0:gt.fetch;ri&&sa&&(globalThis.fetch=Dy(ri.origin,location.href,{fetch:sa},tu));const oa=new I9(sa),BN=window.parent===window?void 0:new bR,FN=window.parent===window?void 0:new MR,UN=fy({width:900,userAgent:navigator.userAgent,coarsePointer:window.matchMedia("(pointer: coarse)").matches,nativeApp:ia}),G2=ia?null:Q9(),md=new Set;window.addEventListener("pagehide",t=>{if(!t.persisted)for(const e of md)e.close()});let aa="";async function jN(t){const{wsNonce:e}=await oa.get("/api/web-console/bootstrap"),r=new URL(t,aa||location.href);return r.protocol=r.protocol==="https:"?"wss:":"ws:",r.searchParams.set("nonce",e),new WebSocket(r)}const X2=new X9(oa,new eR,BN,t=>{if(!G2||!t.startsWith("/api/agent/stream?"))return sa?new Pl(aa+t,{fetch:sa}):new EventSource(aa+t);const e=G2.open(t,()=>Y9(t,o=>oa.get(`/api/sessions/${encodeURIComponent(o)}?limit=1&view=core`)));md.add(e);const r=e.close.bind(e);return e.close=()=>{md.delete(e),r()},e},new J9({openSocket:()=>jN("/ws/voice")}),{historyObservation:UN?"polling":"sse"});window.browserLiveApi=FN;const Ly=document.getElementById("root");if(!Ly)throw new Error("#root missing");const Po=ny(Ly);gt&&window.parent===window&&Po.render(M.jsx(K0,{}));function WN(){return ie.useEffect(()=>{mR()},[]),null}(async()=>{gt&&window.addEventListener("webapp:unauthorized",()=>location.reload());const t=new DR(eu,new gy,new BR(gt?async(r,o)=>{const l=ln.parse(String(r));return l&&await gt.resume(l),gt.fetch(r,o)}:void 0));if(ri){await wd(ln.parse(ri.origin));return}const e=await t.planStartup();if(e.mode==="setup"){xd(e.failure);return}await wd(e.mode==="ready"?e.endpoint:null)})().catch(t=>{gt&&xd(t instanceof Error?t.message:"连接失败,请重新扫码。")});function xd(t=""){globalThis.fetch=tu,delete window.__agentroamNativeFrame,Po.render(M.jsx(Ay,{children:M.jsx(A_,{initialFailure:t,onScan:async()=>{const e=await ky();if(!e||!gt)return;const r=await gt.pair(e);ad(r),await wd(r)}})}))}async function wd(t){try{if(t&&(await(gt==null?void 0:gt.resume(t)),oa.setBaseUrl(t.url),aa=t.url),gt&&t&&window.parent===window){await CN(Po,t,gt,tu),setInterval(()=>{gt.checkAuthorization().catch(()=>{})},1e4);return}window.agentApi=X2;const e=new URLSearchParams(location.search).get("view"),r=new URLSearchParams(location.search).get("newSessionWindow")==="1",o=r?Br(()=>import("./NewSessionWindow-B4H26X5c.js"),__vite__mapDeps([13,14,15,2,7,5,1,6,16,17,8,4,18,19,20,21,22,23,24,25]),import.meta.url):e==="collaboration"?Br(()=>import("./CollaborationPage-Cjeo60S0.js"),__vite__mapDeps([26,15,2,12,27,22,28,29,30,11,31,32,5]),import.meta.url):e==="collaboration-dashboard"?Br(()=>import("./CollaborationDashboard-CvE5vaOh.js"),__vite__mapDeps([33,11,34,30,23,16,2,6,8,22,18,28,29,4,12,35]),import.meta.url):e==="session-dashboard"?Br(()=>import("./SessionDashboard-DXPSvNsY.js"),__vite__mapDeps([36,12,37,38,18,22,21,28,29,2,4,27,39,40]),import.meta.url):e==="remote-desktop"?Br(()=>import("./RemoteDesktopPage-B4q2I23i.js"),__vite__mapDeps([41,42,4,7,19,20,2]),import.meta.url):e==="calendar"?Br(()=>import("./CalendarPage-DY8pZK7d.js"),__vite__mapDeps([43,44,3,2,8,45,17,4,5,39,46]),import.meta.url):e==="todo"?Br(()=>import("./TodoPage-CdzjZR2O.js"),__vite__mapDeps([47,43,44,3,2,8,45,17,4,5,39,46]),import.meta.url):Br(()=>import("./App-CS2wVlfV.js").then(u=>u.a),__vite__mapDeps([48,14,15,2,7,5,1,6,16,17,8,4,18,19,20,21,22,23,24,34,30,28,29,37,12,38,3,49,10,11,31,50]),import.meta.url),[,{default:l}]=await Promise.all([X2.refreshServerModel(),o]);!r&&!ia&&window.parent===window&&kN(oa),Po.render(M.jsxs(ie.StrictMode,{children:[M.jsx(g5.Provider,{value:M.jsx(S9,{}),children:M.jsx(h5.Provider,{value:M.jsx(s9,{}),children:M.jsx(l,{})})}),M.jsx(WN,{})]})),gt&&setInterval(()=>{gt.checkAuthorization().catch(()=>{})},1e4),t||(window.addEventListener("webapp:unauthorized",()=>location.reload()),VN())}catch(e){if(e instanceof iy&&!ia&&window.parent===window){location.replace("/pair");return}if(gt&&window.parent===window){xd(e instanceof Error?e.message:"连接失败,请重新扫码。");return}Po.render(M.jsx("div",{style:{minHeight:"100dvh",display:"flex",alignItems:"center",justifyContent:"center",padding:24,background:"#f5f6fa",boxSizing:"border-box"},children:M.jsxs("div",{style:{maxWidth:560,background:"#fff",borderRadius:12,padding:20,boxShadow:"0 4px 16px rgba(0,0,0,0.08)"},children:[M.jsx("h2",{style:{margin:"0 0 8px",fontSize:16,color:"#dc2626"},children:"界面启动失败"}),M.jsx("p",{style:{margin:"0 0 12px",fontSize:13,color:"#374151",wordBreak:"break-all"},children:e instanceof Error?`${e.name}: ${e.message}`:String(e)}),M.jsx("button",{type:"button",onClick:()=>location.reload(),style:{padding:"8px 20px",fontSize:14,borderRadius:8,border:"1px solid #d6d9e0",background:"#fff",cursor:"pointer"},children:"重试"})]})}))}}function VN(){const t=[...document.scripts].map(r=>r.src).join(",").match(/index-([^/]+)\.js/),e=t?t[1]:null;e&&setInterval(async()=>{if(z3())try{const r=await fetch("/api/agent/model",{credentials:"same-origin",cache:"no-store"});if(r.status===401||r.status===423){location.reload();return}const l=((await r.json()).buildId||"").replace(/^index-|\.js$/g,"");l&&l!==e&&xR()}catch{}},6e4)}export{f9 as $,Z0 as A,D9 as B,sd as C,c9 as D,h5 as E,v9 as F,oO as G,cO as H,Sy as I,Iy as J,H_ as K,x9 as L,w9 as M,XN as N,G_ as O,y9 as P,rO as Q,ry as R,E9 as S,p9 as T,b9 as U,ey as V,xy as W,X_ as X,aO as Y,$_ as Z,lO as _,na as a,JN as a0,wR as a1,U3 as a2,F3 as a3,K0 as a4,GR as a5,Y5 as a6,Zx as a7,nO as a8,x2 as a9,i2 as aA,g5 as aB,dR as aC,qR as aD,J1 as aE,P9 as aF,j9 as aa,I9 as ab,IR as ac,K5 as ad,SR as ae,HR as af,w_ as ag,zR as ah,XR as ai,qN as aj,KN as ak,eO as al,CR as am,Br as an,O3 as ao,HN as ap,i_ as aq,s_ as ar,$N as as,QN as at,tO as au,Kx as av,qg as aw,GN as ax,ty as ay,C9 as az,xN as b,mt as c,KR as d,W_ as e,iO as f,sO as g,A9 as h,ay as i,M as j,n_ as k,Yx as l,Y0 as m,zN as n,q1 as o,W5 as p,X5 as q,ie as r,mn as s,Y2 as t,bi as u,z3 as v,YN as w,d9 as x,U9 as y,ZN as z};